- (window.webpackJsonp = window.webpackJsonp || [
- ]).push([[3],
- {
- 100: function (e, t, n) {
- var n = [
- n(7),
- n(65),
- n(28),
- n(170)
- ],
- n = function (a, e, r, t) {
- 'use strict';
- e = e.Model.extend({
- idAttribute: 'url',
- defaults: {
- mediaType: null,
- html: '',
- htmlWidth: null,
- htmlHeight: null,
- thumbnailUrl: '',
- thumbnailWidth: null,
- thumbnailHeight: null,
- url: '',
- urlRedirect: '',
- resolvedUrl: '',
- resolvedUrlRedirect: '',
- title: '',
- description: '',
- providerName: ''
- },
- parse: function (e) {
- return e.response
- },
- sync: function (e, t, n) {
- if ('read' !== e) throw Error('Media models do not support methods other than "read".');
- return r.call('media/details.json', a.extend({
- method: 'POST',
- data: {
- url: this.get('url'),
- forum: n.forum
- }
- }, n))
- }
- }, {
- MEDIA_TYPES: {
- IMAGE: '1',
- IMAGE_UPLOAD: '2',
- YOUTUBE_VIDEO: '3',
- WEBPAGE: '4',
- TWITTER_STATUS: '5',
- FACEBOOK_PAGE: '6',
- FACEBOOK_POST: '7',
- FACEBOOK_PHOTO: '8',
- FACEBOOK_VIDEO: '9',
- SOUNDCLOUD_SOUND: '10',
- GOOGLE_MAP: '11',
- VIMEO_VIDEO: '12',
- VINE_VIDEO: '14',
- GIF_VIDEO: '15',
- MP4_VIDEO: '16'
- },
- WEBPAGE_TYPES: [
- '4',
- '6',
- '7'
- ]
- });
- return t.addType('Media', e),
- e
- }.apply(t, n);
- void 0 === n || (e.exports = n)
- },
- 101: function (e, t, n) {
- 'use strict';
- function o(e, t, n) {
- return t in e ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n,
- e
- }
- n = [
- n(25),
- n(26),
- n(33)
- ],
- void 0 === (n = function (n, e, t) {
- var a = (o(r = {
- }, t.DISQUS_BASIC_PACKAGE_ID, 'https://disqus.com/features/engage/'), o(r, t.DISQUS_PRO_PACKAGE_ID, 'https://disqus.com/landing/disqus-pro'), o(r, t.DISQUS_BUSINESS_PACKAGE_ID, 'https://disqus.com/landing/disqus-business/'), r),
- r = function (e) {
- var t = e.package;
- return t && a[t.id] ? n.createElement('a', {
- className: 'subscription-package__learnmore subscription-package__full',
- href: a[t.id],
- target: '_blank',
- rel: 'noopener noreferrer'
- }, e.useNewText ? 'Learn more about '.concat(t.name, ' »') : 'Learn more about Disqus\' '.concat(t.name, ' features')) : null
- };
- return r.displayName = 'PackageLearnMoreLink',
- r.propTypes = {
- package: t.PACKAGE_SHAPE,
- useNewText: e.bool
- },
- r
- }.apply(t, n)) || (e.exports = n)
- },
- 102: function (e, t, n) {
- 'use strict';
- var n = [
- n(25),
- n(26),
- n(175),
- n(33),
- n(173),
- n(43)
- ],
- n = function (D, e, t, n, j, a) {
- var T = t.MONTHS_PER_YEAR,
- I = n.ADS_OPTIONAL_FEATURE_ID,
- q = n.DISQUS_BASIC_PACKAGE_ID,
- F = n.DISQUS_BUSINESS_PACKAGE_ID,
- L = n.DISQUS_PLUS_PACKAGE_ID,
- U = n.DISQUS_PREFERRED_CUSTOMER_PACKAGE_ID,
- M = n.DISQUS_PRO_PACKAGE_ID,
- B = n.DISQUS_POLLS_PRO_PACKAGE_ID,
- z = n.DISQUS_POLLS_BUSINESS_PACKAGE_ID,
- H = n.DISQUS_POLLS_AD_SUPPORTED_PACKAGE_ID,
- G = n.SAAS_PRODUCT_POLLS,
- r = n.ORG_BILLING_SHAPE,
- o = n.PACKAGE_SHAPE,
- V = n.PLUS_YEARLY_SLIDER_PLAN_IDS,
- W = n.PLUS_MONTHLY_SLIDER_PLAN_IDS,
- Y = n.PRO_YEARLY_SLIDER_PLAN_IDS,
- Q = n.PRO_MONTHLY_SLIDER_PLAN_IDS,
- K = n.POLLS_PRO_YEARLY_SLIDER_PLAN_IDS,
- J = n.POLLS_PRO_MONTHLY_SLIDER_PLAN_IDS,
- $ = n.RENDER_FEATURE_TEXT,
- i = n.TRIAL_SHAPE,
- s = n.SAAS_PRODUCT_PLAN_CANCELLED_STATUS,
- l = n.SAAS_PRODUCT_PLAN_ACTIVE_STATUS,
- t = n.SAAS_PRODUCT_PLAN_TRIALING_STATUS,
- Z = a.formatPageViews,
- X = a.formatPlanAmount,
- a = function (e) {
- var t,
- n = e.plan,
- a = e.package,
- r = e.includesFeaturesFrom,
- o = e.basicPackage,
- i = e.subscribeText,
- s = e.learnMoreLink,
- l = e.orgBilling,
- c = e.orgCurrentPackage,
- u = e.orgCurrentPackageWillCancel,
- p = e.orgTrial,
- d = e.onRequestInfo,
- m = e.onSubscribe,
- f = e.onStartTrial,
- h = e.maxButtons,
- g = e.newSubscriptionFlow,
- y = e.isCollapsed,
- b = e.onCollapse,
- v = e.onExpand,
- _ = e.selectPlan,
- E = e.showSlider,
- O = e.isCurrentPlan,
- S = e.pollsOrgTrial,
- w = e.pollsOrgCurrentPackage,
- P = e.pollsOrgCurrentPackageWillCancel,
- k = e.organization,
- N = e.pollsPlanStatus,
- C = (C = e.features) || a.features,
- R = n && n.pageViewRange,
- e = (R = !R || null === R.max && null === R.min ? a.pageViewRange : R).min && R.max ? 'Between '.concat(R.min.toLocaleString(), ' and ').concat(R.max.toLocaleString(), ' total monthly pageviews') : a.id === q || a.id === H ? 'Any number of total monthly pageviews' : a.id === L ? 'For mid-size publishers with <'.concat(R.max.toLocaleString(), ' average monthly pageviews') : a.id === M ? 'For larger publishers with <'.concat(R.max.toLocaleString(), ' average monthly pageviews') : a.id === F ? 'For large publishers and enterprise-level organizations' : a.id === B ? 'For publishers with <'.concat(R.max.toLocaleString(), ' average monthly pageviews') : a.id === z ? 'For large publishers and media organizations' : R.min ? 'Over '.concat(R.min.toLocaleString(), ' total monthly pageviews') : R.max ? 'For publishers with <'.concat(R.max.toLocaleString(), ' average monthly pageviews') : '',
- R = function (e, t) {
- return 'year' === t ? e / T : e
- };
- t = a.id === F || a.id === z ? 'Custom pricing' : n.amount && (c && (c.id === L || c.id === M) || w && w.id === B) ? D.createElement(D.Fragment, null, D.createElement('span', null, '$', X(R(n.amount, n.interval))), D.createElement('span', {
- className: 'period-text'
- }, '/ month', 'year' === n.interval && D.createElement('div', null, 'when billed annually'))) : n.amount ? (A = 'month' === n.interval ? n : a.plans.find(function (e) {
- return e.id === n.id.replace('yearly', 'monthly')
- }), t = 'year' === n.interval ? n : a.plans.find(function (e) {
- return e.id === n.id.replace('monthly', 'yearly')
- }), D.createElement(D.Fragment, null, D.createElement('span', null, '$', X(R(t.amount, t.interval))), D.createElement('span', {
- className: 'period-text period-text--block'
- }, 'Per month when billed annually'), D.createElement('span', {
- className: 'period-text period-text--block'
- }, 'or $', X(R(A.amount, A.interval)), ' billed monthly'))) : O || a.id === U || a.features.some(function (e) {
- return e.id === I
- }) ? 'Free' : null;
- var x,
- A,
- R = null;
- E && (E = (A = c && c.plans.find(function (e) {
- return e.isSubscribed
- }) || {
- }) && 'year' === A.interval, A = '', A = a.id === B && E ? (x = K, ' polls-plan-slider') : a.id === B ? (x = J, ' polls-plan-slider') : (x = a.id === L && E ? V : a.id === L ? W : a.id === M && E ? Y : Q, ' comments-plan-slider'), R = D.createElement('div', {
- className: 'plan-slider-container'
- }, D.createElement('div', {
- className: 'plan-slider-header'
- }, 'Monthly pageviews'), D.createElement('input', {
- className: 'plan-slider'.concat(A),
- type: 'range',
- min: '0',
- max: x.length - 1,
- value: x.findIndex(function (e) {
- return n.id === e
- }),
- onChange: function (e) {
- return _(x[e.target.value])
- }
- }), D.createElement('div', {
- className: 'align align--between'
- }, x.map(function (t) {
- var e = a.plans.find(function (e) {
- return e.id === t
- });
- return e ? D.createElement('span', {
- key: e.id,
- className: t === n.id ? '--selected' : ''
- }, Z(e.pageViewRange.max)) : null
- }))));
- k = {
- plan: n,
- package: a,
- basicPackage: o,
- orgBilling: l,
- subscribeText: i,
- onSubscribe: m && function () {
- return m(n, a)
- },
- onRequestInfo: d && function () {
- return d(n)
- },
- onStartTrial: f && function () {
- return f(n, a)
- },
- maxButtons: h,
- newSubscriptionFlow: g,
- organization: k
- };
- n.productName === G ? (k.orgTrial = S, k.orgCurrentPackage = w, k.orgCurrentPackageWillCancel = P, k.pollsPlanStatus = N) : (k.orgTrial = p, k.orgCurrentPackage = c, k.orgCurrentPackageWillCancel = u),
- a.id === H && (k.subscribeText = 'Apply Now');
- u = ''.concat(n.productName === G ? 'polls-' : '').concat(a.name.toLowerCase());
- return D.createElement('div', {
- className: 'subscription-package --'.concat(u).concat(y ? ' --collapsed' : '').concat(O ? ' --current-plan' : '')
- }, D.createElement('div', {
- className: 'subscription-package__wrap'
- }, !O && D.createElement('span', {
- className: 'subscription-package__collapse icon '.concat(y ? 'icon-plus' : 'icon-minus'),
- onClick: y ? v : b
- }), D.createElement('div', {
- className: 'subscription-package__heading'
- }, D.createElement('div', {
- className: 'subscription-package__name-container align align--between align--middle'
- }, D.createElement('h1', {
- className: 'subscription-package__name'
- }, a.name), O && D.createElement('div', {
- className: 'label label-blue text-uppercase'
- }, n.productName), !O && a.id !== q && a.features.some(function (e) {
- return e.id === I
- }) && D.createElement('div', {
- className: 'subscription-package__ads'
- }, $[I])), e ? D.createElement('div', {
- className: 'subscription-package__page-view'
- }, e) : null, R, t ? D.createElement('div', {
- className: 'subscription-package__price'.concat(a.id === F ? ' --fit-text' : '')
- }, t) : null), D.createElement(j, k), D.createElement('div', {
- className: 'subscription-package__features-container'.concat(a.id === q ? ' basic-package-container' : '')
- }, r ? D.createElement('div', {
- className: 'subscription-package__features-from'
- }, 'Everything in the ', r, ' plan, and:') : null, C.length ? D.createElement('ul', {
- className: 'subscription-package__features subscription-package__full text-left'
- }, C.map(function (e) {
- return D.createElement('li', {
- className: 'subscription-package__features-entry',
- key: e.id
- }, D.createElement('span', {
- className: 'subscription-feature__bullet icon icon-small '.concat(e.isCustom ? 'icon-plus' : 'icon-mod-check')
- }), D.createElement('span', {
- className: e.isBold ? 'text-semibold' : ''
- }, e.name))
- })) : null), s))
- };
- return a.propTypes = {
- plan: n.PLAN_SHAPE.isRequired,
- package: o.isRequired,
- basicPackage: o.isRequired,
- maxButtons: e.number,
- features: e.arrayOf(n.FEATURE_SHAPE),
- includesFeaturesFrom: e.string,
- subscribeText: e.string,
- learnMoreLink: e.node,
- orgBilling: r,
- orgCurrentPackage: o,
- orgCurrentPackageWillCancel: e.bool,
- orgTrial: i,
- onRequestInfo: e.func,
- onSubscribe: e.func,
- onStartTrial: e.func,
- newSubscriptionFlow: e.bool,
- isCollapsed: e.bool,
- onCollapse: e.func,
- onExpand: e.func,
- selectPlan: e.func,
- showSlider: e.bool,
- isCurrentPlan: e.bool,
- pollsOrgCurrentPackage: o,
- pollsOrgCurrentPackageWillCancel: e.bool,
- pollsOrgTrial: i,
- organization: e.object.isRequired,
- pollsPlanStatus: e.oneOf([s,
- l,
- t])
- },
- a
- }.apply(t, n);
- void 0 === n || (e.exports = n)
- },
- 145: function (e, t, n) {
- var n = [
- n(271)
- ],
- n = function (i) {
- 'use strict';
- return function (e, t) {
- var n = e.length,
- a = Array.prototype.forEach;
- if (isNaN(n)) for (var r in e) i(e, r) && t(e[r], r, e);
- else if (a) a.call(e, t);
- else for (var o = 0; o < n; o++) t(e[o], o, e)
- }
- }.apply(t, n);
- void 0 === n || (e.exports = n)
- },
- 146: function (e, t, n) {
- var n = [
- n(37),
- n(7),
- n(65),
- n(2),
- n(272)
- ],
- n = function (a, r, e, n, o) {
- 'use strict';
- var t = e.Model.extend({
- url: o.jester + '/event.js',
- defaults: {
- experiment: 'default',
- variant: 'control'
- },
- setHostReferrer: function (e) {
- e ? ~e.indexOf('http') && this.set('page_referrer', e) : this.set('page_referrer', 'direct')
- },
- decoratePayload: function (e) {
- var t;
- return e.event || (e.event = 'activity'),
- e = r.extend(this.toJSON(), e),
- r.extend(e, {
- imp: n.impression.impId,
- prev_imp: n.impression.prevImp
- }),
- e.section || (e.section = 'default'),
- e.area || (e.area = 'n/a'),
- 2048 < a.param(e).length && this.has('page_referrer') && ((t = window.document.createElement('a')).href = this.get('page_referrer'), (t = t.hostname) && (e.page_referrer_domain = t), delete e.page_referrer),
- e
- },
- emit: function (e) {
- return a.ajax({
- url: r.result(this, 'url'),
- data: this.decoratePayload(e),
- dataType: 'script',
- cache: !0
- })
- }
- }),
- e = new t;
- return e.setHostReferrer(window.document.referrer),
- {
- ActivityClient: t,
- client: e,
- logStat: function (e) {
- var t = new window.Image;
- return t.src = o.jester + '/stat.gif?' + a.param({
- event: e
- }),
- t
- },
- telemetry: function (e, n) {
- if (!r.any(n, function (e) {
- return e < 0
- })) {
- r.each(n, function (e, t) {
- n[t] = Math.round(e)
- });
- var t = new window.Image;
- return t.src = o.jester + '/telemetry/' + e + '.gif?' + a.param(n),
- t
- }
- }
- }
- }.apply(t, n);
- void 0 === n || (e.exports = n)
- },
- 148: function (e, t, n) {
- t = function (e) {
- 'use strict';
- e.VOTING_TYPES = {
- DETAILED: 0,
- DOWNVOTE_LIMITED: 1,
- DOWNVOTE_DISABLED: 2,
- DISABLED: 3
- },
- e.DEFAULT_VOTING_TYPE = e.VOTING_TYPES.DETAILED
- }.apply(t, [
- t
- ]);
- void 0 === t || (e.exports = t)
- },
- 168: function (e, t, n) {
- 'use strict';
- var n = [
- n(25),
- n(26)
- ],
- n = function (p, e) {
- function t(e) {
- var t = e.className,
- n = e.id,
- a = e.isChecked,
- r = e.isDisabled,
- o = e.isStatic,
- i = e.onChange,
- s = e.onClick,
- l = e.prefix,
- c = e.values,
- u = e.width,
- e = e.displayBothValues,
- t = 'toggle-button'.concat(r ? ' disabled' : '').concat(o ? ' static' : '').concat(t ? ' '.concat(t) : '');
- return p.createElement('span', {
- className: t
- }, l ? p.createElement('span', {
- className: 'label-prefix'
- }, l) : null, p.createElement('input', {
- type: 'checkbox',
- id: n,
- onChange: function (e) {
- return i(e)
- },
- onClick: s,
- checked: !r && a,
- disabled: r || o
- }), e ? p.createElement('label', {
- className: 'toggle-button-label--multivalue',
- htmlFor: n,
- style: {
- width: u
- }
- }, p.createElement('span', {
- className: 'toggle-button-text'
- }, c.checked), p.createElement('span', {
- className: 'toggle-button-text'
- }, c.unchecked), p.createElement('span', {
- className: 'toggle-button-slider'
- }, !r && a ? c.unchecked : c.checked)) : p.createElement('label', {
- htmlFor: n,
- style: {
- width: u
- }
- }, !r && a ? c.checked : c.unchecked))
- }
- return t.displayName = 'ToggleSwitch',
- t.defaultProps = {
- values: {
- checked: 'ON',
- unchecked: 'OFF'
- },
- width: '76px'
- },
- t.propTypes = {
- className: e.string,
- id: e.string.isRequired,
- isChecked: e.bool.isRequired,
- isDisabled: e.bool,
- isStatic: e.bool,
- onChange: e.func.isRequired,
- onClick: e.func,
- prefix: e.string,
- values: e.shape({
- checked: e.node,
- unchecked: e.node
- }),
- displayBothValues: e.bool,
- width: e.string
- },
- t
- }.apply(t, n);
- void 0 === n || (e.exports = n)
- },
- 169: function (e, t, n) {
- var n = [
- n(145)
- ],
- n = function (n) {
- 'use strict';
- return function (e) {
- void 0 === e && (e = window.location.search);
- var t = {
- };
- return n(e.substr(1).split('&'), function (e) {
- e = e.split('=').map(function (e) {
- return decodeURIComponent(e.replace(/\+/g, '%20'))
- });
- e[0] && (t[e[0]] = e[1])
- }),
- t
- }
- }.apply(t, n);
- void 0 === n || (e.exports = n)
- },
- 170: function (e, t, n) {
- var n = [
- n(7)
- ],
- n = function (n) {
- 'use strict';
- function o(e, t, n) {
- var a = o.pool(e),
- r = t && t[e.prototype.idAttribute];
- return r ? (o.get(e, r) ? a[r].set(t) : a[r] = new e(t, n), a[r]) : new e(t, n)
- }
- return o.pool = {
- },
- o.pool = function (e) {
- e = o.pool[e.__type__];
- if (!e) throw Error('Model not registered. Use UniqueModel.addType');
- return e
- },
- o.get = function (e, t) {
- return o.pool(e) [t]
- },
- o.set = function (e, t) {
- var n = o.pool(e),
- a = t && t.get(e.prototype.idAttribute);
- if (!a) return t;
- e = o.get(e, a);
- return e ? e.set(t.attributes) : e = n[a] = t,
- e
- },
- o.addType = function (e, t) {
- t.__type__ && o.pool[e] || (o.pool[t.__type__ = e] = {
- })
- },
- o.boundModel = function (e) {
- var t = n.bind(o, o, e);
- return t.prototype = e.prototype,
- t
- },
- o.wrap = o.boundModel,
- o
- }.apply(t, n);
- void 0 === n || (e.exports = n)
- },
- 171: function (e, t, n) {
- 'use strict';
- function r(e) {
- return (r = 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator ? function (e) {
- return typeof e
- }
- : function (e) {
- return e && 'function' == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? 'symbol' : typeof e
- }) (e)
- }
- function D(e, t) {
- for (var n = 0; n < t.length; n++) {
- var a = t[n];
- a.enumerable = a.enumerable || !1,
- a.configurable = !0,
- 'value' in a && (a.writable = !0),
- Object.defineProperty(e, a.key, a)
- }
- }
- function j(e, t) {
- return (j = Object.setPrototypeOf || function (e, t) {
- return e.__proto__ = t,
- e
- }) (e, t)
- }
- function T(n) {
- var a = function () {
- if ('undefined' == typeof Reflect || !Reflect.construct) return !1;
- if (Reflect.construct.sham) return !1;
- if ('function' == typeof Proxy) return !0;
- try {
- return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [
- ], function () {
- })),
- !0
- } catch (e) {
- return !1
- }
- }();
- return function () {
- var e,
- t = o(n);
- return e = a ? (e = o(this).constructor, Reflect.construct(t, arguments, e)) : t.apply(this, arguments),
- t = this,
- !(e = e) || 'object' !== r(e) && 'function' != typeof e ? I(t) : e
- }
- }
- function I(e) {
- if (void 0 === e) throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called');
- return e
- }
- function o(e) {
- return (o = Object.setPrototypeOf ? Object.getPrototypeOf : function (e) {
- return e.__proto__ || Object.getPrototypeOf(e)
- }) (e)
- }
- function q(e, t, n) {
- return t in e ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n,
- e
- }
- n = [
- n(25),
- n(26),
- n(7),
- n(32),
- n(168),
- n(33),
- n(496),
- n(515)
- ],
- void 0 === (n = function (o, e, c, t, i, n, s, l) {
- var a = n.ORG_BILLING_SHAPE,
- r = n.TRIAL_SHAPE,
- u = n.PACKAGE_SHAPE,
- p = n.DISQUS_PLUS_PACKAGE_ID,
- d = n.DISQUS_PLUS_FREE_PACKAGE_ID,
- m = n.DISQUS_PRO_PACKAGE_ID,
- f = n.DISQUS_BUSINESS_PACKAGE_ID,
- h = n.DISQUS_PLUS_100K_PLAN_ID,
- g = n.DISQUS_PLUS_100K_YEARLY_PLAN_ID,
- y = n.DISQUS_PLUS_350K_PLAN_ID,
- b = n.DISQUS_PLUS_350K_YEARLY_PLAN_ID,
- v = n.DISQUS_PLUS_900K_PLAN_ID,
- _ = n.DISQUS_PLUS_900K_YEARLY_PLAN_ID,
- E = n.DISQUS_PLUS_FREE_PLAN_ID,
- O = n.DISQUS_PRO_1M_PLAN_ID,
- S = n.DISQUS_PRO_1M_YEARLY_PLAN_ID,
- w = n.DISQUS_PRO_2_5M_PLAN_ID,
- P = n.DISQUS_PRO_2_5M_YEARLY_PLAN_ID,
- k = n.DISQUS_PRO_5M_PLAN_ID,
- N = n.DISQUS_PRO_5M_YEARLY_PLAN_ID,
- C = n.DISQUS_BUSINESS_PLAN_ID,
- R = n.SAAS_PRODUCT_POLLS,
- x = (q(A = {
- }, n.DISQUS_BASIC_PACKAGE_ID, [
- n.DISQUS_BASIC_PLAN_ID
- ]), q(A, p, [
- g,
- b,
- _,
- h,
- y,
- v
- ]), q(A, d, [
- E
- ]), q(A, m, [
- S,
- P,
- N,
- O,
- w,
- k
- ]), q(A, f, [
- C
- ]), A),
- A = function () {
- !function (e, t) {
- if ('function' != typeof t && null !== t) throw new TypeError('Super expression must either be null or a function');
- e.prototype = Object.create(t && t.prototype, {
- constructor: {
- value: e,
- writable: !0,
- configurable: !0
- }
- }),
- t && j(e, t)
- }(r, o.Component);
- var e,
- t,
- n,
- a = T(r);
- function r(e) {
- var t;
- return function (e, t) {
- if (!(e instanceof t)) throw new TypeError('Cannot call a class as a function')
- }(this, r),
- (t = a.call(this, e)).state = {
- displayPolls: e.history.location.query.product === R
- },
- t.toggleDisplayPolls = t.toggleDisplayPolls.bind(I(t)),
- t
- }
- return e = r,
- (t = [
- {
- key: 'toggleDisplayPolls',
- value: function (e) {
- this.setState({
- displayPolls: !!e.target.checked
- })
- }
- },
- {
- key: 'render',
- value: function () {
- return o.createElement(o.Fragment, null, o.createElement('div', {
- className: 'subscription-interval'
- }, o.createElement('div', {
- className: 'fieldset align--center spacing-bottom-quad'
- }, o.createElement(i, {
- id: 'annual-interval',
- isChecked: this.state.displayPolls,
- onChange: this.toggleDisplayPolls,
- values: {
- checked: 'Comments',
- unchecked: o.createElement(o.Fragment, null, 'Polls', o.createElement('span', {
- className: 'toggle-button-new-label label label-'.concat(this.state.displayPolls ? 'white' : 'blue', ' spacing-left-small')
- }, 'NEW'))
- },
- displayBothValues: !0,
- width: '320px'
- }))), o.createElement(this.state.displayPolls ? l : s, this.props))
- }
- }
- ]) && D(e.prototype, t),
- n && D(e, n),
- r
- }();
- return A.propTypes = {
- packages: function (e, t, a, r, o) {
- for (var i, n = arguments.length, s = Array(5 < n ? n - 5 : 0), l = 5; l < n; l++) s[l - 5] = arguments[l];
- return o = o || t,
- (i = e[t]) ? c.chain(x).map(function (e, n) {
- return u.isRequired.apply(u, [
- i,
- n,
- ''.concat(a),
- r,
- ''.concat(o, '[').concat(n, ']')
- ].concat(s)) || c.chain(e).map(function (t) {
- return c.find(i[n].plans, function (e) {
- return e.id === t
- }) ? null : Error('A plan with id '.concat(t, ' is required in `').concat(a, '`, prop `').concat(o, '[').concat(n, ']`, but its value is `null`.'))
- }).compact().value() [0]
- }).compact().value() [0] : Error('The '.concat(r, ' `').concat(o, '` is required in `').concat(a, '`, but its value is `null`.'))
- },
- orgBilling: a,
- orgCurrentPackage: u,
- orgCurrentPackageWillCancel: e.bool,
- orgTrial: r,
- subscribeText: e.string,
- onRequestInfo: e.func,
- onSubscribe: e.func,
- onStartTrial: e.func,
- newSubscriptionFlow: e.bool,
- useAdSupportedCard: e.bool,
- hideAdSupported: e.bool,
- history: e.shape({
- location: e.shape({
- query: e.shape({
- product: e.oneOf([R,
- void 0])
- })
- })
- })
- },
- t(A)
- }.apply(t, n)) || (e.exports = n)
- },
- 172: function (e, t, n) {
- 'use strict';
- var n = [
- n(25),
- n(26),
- n(33),
- n(173)
- ],
- n = function (f, e, t, h) {
- function n(e) {
- var t = e.plan,
- n = e.package,
- a = e.basicPackage,
- r = e.subscribeText,
- o = e.orgBilling,
- i = e.orgCurrentPackage,
- s = e.orgCurrentPackageWillCancel,
- l = e.orgTrial,
- c = e.onRequestInfo,
- u = e.onSubscribe,
- p = e.onStartTrial,
- d = e.maxButtons,
- m = e.newSubscriptionFlow,
- e = e.organization;
- return f.createElement('div', {
- className: 'subscription-package --ad-supported --no-card'
- }, f.createElement('div', {
- className: 'basic-package-header'
- }, 'Interested in the Free Version of Disqus ', f.createElement('span', {
- className: 'basic-package-header text-capitalized'
- }, a.productName), '?'), f.createElement('div', {
- className: 'basic-package-body'
- }, 'We offer a free, ad-supported version of Disqus ', f.createElement('span', {
- className: 'basic-package-body text-capitalized'
- }, a.productName), ' to eligible publishers.'), f.createElement(h, {
- plan: t,
- package: n,
- orgTrial: l,
- basicPackage: a,
- orgBilling: o,
- orgCurrentPackage: i,
- orgCurrentPackageWillCancel: s,
- subscribeText: r,
- onSubscribe: u && function () {
- return u(t, n)
- },
- onRequestInfo: c && function () {
- return c(t)
- },
- onStartTrial: p && function () {
- return p(t)
- },
- maxButtons: d,
- newSubscriptionFlow: m,
- organization: e
- }))
- }
- var a = t.PACKAGE_SHAPE;
- return n.propTypes = {
- plan: t.PLAN_SHAPE.isRequired,
- package: a.isRequired,
- basicPackage: a.isRequired,
- maxButtons: e.number,
- subscribeText: e.string,
- orgBilling: t.ORG_BILLING_SHAPE,
- orgCurrentPackage: a,
- orgCurrentPackageWillCancel: e.bool,
- orgTrial: t.TRIAL_SHAPE,
- onRequestInfo: e.func,
- onSubscribe: e.func,
- onStartTrial: e.func,
- newSubscriptionFlow: e.bool,
- organization: e.object.isRequired
- },
- n
- }.apply(t, n);
- void 0 === n || (e.exports = n)
- },
- 173: function (e, t, n) {
- 'use strict';
- function l() {
- return (l = Object.assign || function (e) {
- for (var t = 1; t < arguments.length; t++) {
- var n,
- a = arguments[t];
- for (n in a) Object.prototype.hasOwnProperty.call(a, n) && (e[n] = a[n])
- }
- return e
- }).apply(this, arguments)
- }
- function o(t, e) {
- var n,
- a = Object.keys(t);
- return Object.getOwnPropertySymbols && (n = Object.getOwnPropertySymbols(t), e && (n = n.filter(function (e) {
- return Object.getOwnPropertyDescriptor(t, e).enumerable
- })), a.push.apply(a, n)),
- a
- }
- function c(a) {
- for (var e = 1; e < arguments.length; e++) {
- var r = null != arguments[e] ? arguments[e] : {
- };
- e % 2 ? o(Object(r), !0).forEach(function (e) {
- var t,
- n;
- n = r[t = e],
- t in (e = a) ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(a, Object.getOwnPropertyDescriptors(r)) : o(Object(r)).forEach(function (e) {
- Object.defineProperty(a, e, Object.getOwnPropertyDescriptor(r, e))
- })
- }
- return a
- }
- function u(e, t) {
- if (null == e) return {
- };
- var n,
- a = function (e, t) {
- if (null == e) return {
- };
- var n,
- a,
- r = {
- },
- o = Object.keys(e);
- for (a = 0; a < o.length; a++) ~t.indexOf(n = o[a]) || (r[n] = e[n]);
- return r
- }(e, t);
- if (Object.getOwnPropertySymbols) for (var r = Object.getOwnPropertySymbols(e), o = 0; o < r.length; o++) ~t.indexOf(n = r[o]) || Object.prototype.propertyIsEnumerable.call(e, n) && (a[n] = e[n]);
- return a
- }
- n = [
- n(25),
- n(26),
- n(497),
- n(33),
- n(513),
- n(92)
- ],
- void 0 === (n = function (g, e, y, t, b, v) {
- function _(e) {
- var t = e.children,
- n = e.id,
- a = void 0 !== (o = e.disabled) && o,
- r = void 0 !== (s = e.isSubscribed) && s,
- o = void 0 === (i = e.href) ? '' : i,
- i = void 0 === (s = e.icon) ? null : s,
- s = u(e, [
- 'children',
- 'id',
- 'disabled',
- 'isSubscribed',
- 'href',
- 'icon'
- ]),
- e = null !== i ? g.createElement('span', {
- className: 'icon icon-'.concat(i, ' icon-small')
- }) : null;
- return s = c({
- }, s),
- o && (s.href = o),
- g.createElement('button', l({
- id: n,
- className: 'button button-medium plan-button'.concat(a ? ' button-disabled' : '').concat(r ? ' --subscribed' : '', ' spacing-bottom-small')
- }, s), e, ' ', t)
- }
- var E = t.DISQUS_BASIC_PACKAGE_ID,
- O = t.DISQUS_BUSINESS_PACKAGE_ID,
- S = t.DISQUS_POLLS_AD_SUPPORTED_PACKAGE_ID,
- w = t.DISQUS_POLLS_BUSINESS_PACKAGE_ID,
- P = t.DISQUS_BASIC_PLAN_ID,
- k = t.BASIC_SUBSCRIPTION,
- n = t.PLAN_SHAPE,
- a = t.PACKAGE_SHAPE,
- r = t.ORG_BILLING_SHAPE,
- o = t.TRIAL_SHAPE,
- N = t.SAAS_PRODUCT_POLLS,
- C = t.SAAS_PRODUCT_COMMENTS,
- R = t.SAAS_PRODUCT_PLAN_CANCELLED_STATUS,
- i = t.SAAS_PRODUCT_PLAN_ACTIVE_STATUS,
- s = t.SAAS_PRODUCT_PLAN_TRIALING_STATUS;
- _.propTypes = {
- id: e.string,
- children: e.node,
- className: e.string,
- disabled: e.bool,
- isSubscribed: e.bool,
- href: e.string,
- icon: e.string
- };
- t = function (e) {
- var t,
- n = e.plan,
- a = e.package,
- r = e.orgBilling,
- o = e.orgCurrentPackageWillCancel,
- i = e.orgTrial,
- s = e.subscribeText,
- l = e.onStartTrial,
- c = e.onSubscribe,
- u = e.maxButtons,
- p = e.newSubscriptionFlow,
- d = e.organization,
- m = e.pollsPlanStatus;
- if (0 === u) return null;
- if (n && n.isSubscribed && (n.productName === N || !d.pollsOnly) && (n.productName !== N || m !== R) || a && a.isSubscribed && (a.productName === N || !d.pollsOnly) && i && i.isActive) {
- if (i && i.isActive) {
- var f,
- e = r && r.paymentInfo && !o && d && !d.pollsOnly && n.productName !== N,
- i = e && (void 0 === u || 1 < u);
- return i ? f = 'You are subscribed, but you will not be charged until your trial ends.' : e || 1 !== u ? e || p || (f = 'If you subscribe, you will not be charged until your trial ends.') : f = 'Currently on free trial',
- g.createElement('div', {
- className: 'subscription-package__buttons'
- }, f ? g.createElement('div', {
- key: 0,
- className: 'subscription-package__trial-note text-gray text-small'
- }, f) : null, g.createElement('div', {
- className: 'subscription-package__buttons-container'
- }, void 0 === u || 1 < u || e || 1 === u && p ? g.createElement(_, {
- key: 1,
- icon: 'mod-check',
- disabled: !0,
- isSubscribed: !0
- }, 'On Trial') : null, i ? g.createElement(_, {
- key: 2,
- icon: 'mod-check',
- disabled: !0,
- isSubscribed: !0
- }, 'Subscribed') : null, e || p ? null : g.createElement('div', {
- className: 'inline__item'
- }, g.createElement(_, {
- key: 3,
- onClick: c
- }, 'Subscribe Now'))))
- }
- return n.productName !== C || d.pollsOnly ? n.productName === N && (t = r.currentPollsSubscription) : t = n.id !== P || r.currentSubscription ? r.currentSubscription : k,
- g.createElement('div', {
- className: 'subscription-package__buttons'
- }, a.id === O || a.id === w ? g.createElement('div', {
- className: 'spacing-bottom'
- }, 'Please ', g.createElement('a', {
- href: 'mailto:pub-solutions@disqus.com'
- }, 'contact sales'), ' with any questions about your plan or to change your plan.') : null, t ? g.createElement(_, {
- icon: 'mod-check',
- disabled: !0,
- isSubscribed: !0
- }, 'Subscribed'.concat(r && t && t.amount || !n.amount ? '' : ' (Free)')) : g.createElement(_, {
- id: 'get-started-'.concat(a.name.toLowerCase(), '-pricing'),
- onClick: c
- }, 'Re-subscribe Now'))
- }
- if (a.id === O || a.id === w || a.id === S) {
- var h = a.id === w ? v.disqusPollsBusinessContact : a.id === S ? v.disqusPollsAdSupportedContact : v.disqusBusinessContact;
- return g.createElement('div', {
- className: 'subscription-package__buttons'
- }, g.createElement(_, {
- id: 'requestinfo-business-pricing',
- onClick: function () {
- return window.open(h, '_blank')
- },
- rel: 'noreferrer noopener',
- target: '_blank'
- }, a.id === S ? s : 'Request Info'))
- }
- if (n.isEligible) return n.hasTrialAvailable && n.amount && n.trialLengthDays ? g.createElement('div', {
- className: 'subscription-package__buttons'
- }, g.createElement(_, {
- key: 1,
- id: 'start-trial-'.concat(a.name.toLowerCase(), '-pricing'),
- onClick: l
- }, 'Try for free'), p ? g.createElement(b, {
- className: 'subscription-package__trial-terms'
- }) : g.createElement('div', {
- key: 0,
- className: 'subscription-package__trial-note text-gray text-small'
- }, 'No credit card required')) : g.createElement('div', {
- className: 'subscription-package__buttons'
- }, a.id === E && !a.isSubscribed && o ? g.createElement('div', {
- className: 'spacing-bottom'
- }, 'You will automatically subscribe to the Basic plan at the end of your billing period.') : null, g.createElement(_, {
- id: 'get-started-'.concat(a.name.toLowerCase(), '-pricing'),
- onClick: c
- }, m === R ? 'Re-subscribe Now' : s || 'Subscribe Now'));
- a = n.pageViewRange.max || a.pageViewRange.max || 0;
- return g.createElement('div', {
- className: 'subscription-package__buttons --disabled'
- }, g.createElement(_, {
- disabled: !0
- }, g.createElement('span', {
- key: 'ineligibleInfo',
- 'data-tip': !0,
- 'data-for': 'ineligibleCard-'.concat(n.id)
- }, 'Not Eligible', g.createElement('span', {
- className: 'icon-info spacing-left-small'
- })), g.createElement(y, {
- key: 'ineligibleCard',
- id: 'ineligibleCard-'.concat(n.id),
- effect: 'solid',
- type: 'light',
- offset: {
- right: 50
- },
- delayHide: 175,
- className: 'hovercard'
- }, g.createElement('div', {
- className: 'hovercard__content subscription-ineligible__info',
- onClick: function (e) {
- e.stopPropagation()
- }
- }, 'Disqus has identified that your site receives over ', a.toLocaleString(), ' total monthly pageviews. If you believe this is an error, please ', g.createElement('a', {
- href: 'mailto:publisher-success@disqus.com'
- }, 'contact support'), '.'))))
- };
- return t.propTypes = {
- plan: n.isRequired,
- package: a.isRequired,
- basicPackage: a.isRequired,
- orgBilling: r,
- orgCurrentPackage: a,
- orgCurrentPackageWillCancel: e.bool,
- orgTrial: o,
- subscribeText: e.string,
- onStartTrial: e.func.isRequired,
- onSubscribe: e.func.isRequired,
- maxButtons: e.number,
- newSubscriptionFlow: e.bool,
- organization: e.object.isRequired,
- pollsPlanStatus: e.oneOf([R,
- i,
- s])
- },
- t
- }.apply(t, n)) || (e.exports = n)
- },
- 175: function (e, t, n) {
- t = function (e) {
- 'use strict';
- e.MONTHS_PER_YEAR = 12
- }.apply(t, [
- t
- ]);
- void 0 === t || (e.exports = t)
- },
- 176: function (e, t, n) {
- var n = [
- n(7),
- t,
- n(28),
- n(100),
- n(170)
- ],
- n = function (r, o, a, i, s) {
- 'use strict';
- o.uploadSupported = !!window.FormData,
- o._extractFirstImageFile = function (e) {
- return r.find(e, function (e) {
- return e.type.match(/^image\//)
- })
- },
- o._uploadViaApi = function (e, t, n) {
- return Promise.resolve(a.call(e, {
- data: t,
- contentType: !1,
- processData: !1,
- method: 'POST',
- xhr: function () {
- var e = new window.XMLHttpRequest,
- t = n && n.onProgress;
- return t && e.upload.addEventListener('progress', function (e) {
- e.total && t(100 * e.loaded / e.total)
- }),
- e
- }
- }))
- },
- o.UPLOAD_URL = 'https://uploads.services.disqus.com/api/3.0/media/create.json',
- o.uploadMediaUrl = function (e, t) {
- var n,
- a = new window.FormData,
- e = o._extractFirstImageFile(e);
- return e ? (a.append('upload', e), a.append('permanent', 1), o._uploadViaApi(o.UPLOAD_URL, a, t).then(function (e) {
- e = r.first(r.values(e.response));
- if (!e || !e.ok) throw (n = Error('Upload failed')).code = e && e['error-code'],
- n;
- return new s(i, {
- mediaType: i.MEDIA_TYPES.IMAGE_UPLOAD,
- url: e.url,
- thumbnailUrl: e.url
- })
- }, function (e) {
- if (e.responseJSON && 4 === e.responseJSON.code) throw (n = Error('Upload failed')).code = 'not-authenticated',
- n;
- throw e
- })) : ((n = Error('No image file to upload')).code = 'invalid-content-type', Promise.reject(n))
- }
- }.apply(t, n);
- void 0 === n || (e.exports = n)
- },
- 177: function (e, t, n) {
- var n = [
- t,
- n(61)
- ],
- n = function (e, t) {
- 'use strict';
- e.DEFAULT_BUTTON_TEXT = t.interpolate((0, t.get) ('Show Comments (%(count)s)'), {
- count: '{postCount}'
- })
- }.apply(t, n);
- void 0 === n || (e.exports = n)
- },
- 24: function (e, t, n) {
- 'use strict';
- n.r(t);
- var a = {
- };
- n.r(a),
- n.d(a, 'fetchSubscription', function () {
- return Hl
- }),
- n.d(a, 'updatePaymentInfo', function () {
- return Gl
- }),
- n.d(a, 'updateInvoiceInfo', function () {
- return Vl
- }),
- n.d(a, 'onSubscribe', function () {
- return Wl
- }),
- n.d(a, 'activatePlan', function () {
- return Yl
- }),
- n.d(a, 'validateActivationCode', function () {
- return Ql
- }),
- n.d(a, 'handleUpdatePaymentInfo', function () {
- return Kl
- });
- var r = {
- };
- n.r(r),
- n.d(r, 'fetchForumDetails', function () {
- return ig
- }),
- n.d(r, 'updateForumDetails', function () {
- return sg
- });
- var o = n(178),
- i = n(25),
- C = n.n(i),
- s = n(44),
- l = n.n(s),
- c = n(36),
- _ = n.n(c),
- u = n(27),
- v = n(31),
- p = n(261),
- d = n.n(p),
- m = n(262),
- f = n.n(m),
- h = n(91),
- g = n.n(h),
- y = n(26),
- b = n.n(y);
- function E(e) {
- return (E = 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator ? function (e) {
- return typeof e
- }
- : function (e) {
- return e && 'function' == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? 'symbol' : typeof e
- }) (e)
- }
- function O(e, t) {
- for (var n = 0; n < t.length; n++) {
- var a = t[n];
- a.enumerable = a.enumerable || !1,
- a.configurable = !0,
- 'value' in a && (a.writable = !0),
- Object.defineProperty(e, a.key, a)
- }
- }
- function S(e, t) {
- return (S = Object.setPrototypeOf || function (e, t) {
- return e.__proto__ = t,
- e
- }) (e, t)
- }
- function w(n) {
- var a = function () {
- if ('undefined' == typeof Reflect || !Reflect.construct) return !1;
- if (Reflect.construct.sham) return !1;
- if ('function' == typeof Proxy) return !0;
- try {
- return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [
- ], function () {
- })),
- !0
- } catch (e) {
- return !1
- }
- }();
- return function () {
- var e,
- t = P(n);
- return e = a ? (e = P(this).constructor, Reflect.construct(t, arguments, e)) : t.apply(this, arguments),
- t = this,
- !(e = e) || 'object' !== E(e) && 'function' != typeof e ? function (e) {
- if (void 0 !== e) return e;
- throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called')
- }(t) : e
- }
- }
- function P(e) {
- return (P = Object.setPrototypeOf ? Object.getPrototypeOf : function (e) {
- return e.__proto__ || Object.getPrototypeOf(e)
- }) (e)
- }
- var k,
- N,
- R,
- x = function () {
- !function (e, t) {
- if ('function' != typeof t && null !== t) throw new TypeError('Super expression must either be null or a function');
- e.prototype = Object.create(t && t.prototype, {
- constructor: {
- value: e,
- writable: !0,
- configurable: !0
- }
- }),
- t && S(e, t)
- }(r, C.a.Component);
- var e,
- t,
- n,
- a = w(r);
- function r() {
- return function (e, t) {
- if (!(e instanceof t)) throw new TypeError('Cannot call a class as a function')
- }(this, r),
- a.apply(this, arguments)
- }
- return e = r,
- (t = [
- {
- key: 'componentDidMount',
- value: function () {
- this.props.emitDefaultViewEvent && this.props.emitDefaultViewEvent()
- }
- }
- ]) && O(e.prototype, t),
- n && O(e, n),
- r
- }();
- R = {
- emitDefaultViewEvent: b.a.func
- },
- (N = 'propTypes') in (k = x) ? Object.defineProperty(k, N, {
- value: R,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : k[N] = R;
- var A = x,
- D = n(265),
- j = n.n(D),
- T = n(126),
- I = n(266),
- q = n.n(I),
- F = function (n, e) {
- return e.reduce(function (e, t) {
- return e[t] = ''.concat(n, '.').concat(t),
- e
- }, {
- })
- },
- L = F('aet', [
- 'fetching',
- 'onFetch',
- 'onError'
- ]),
- U = F('analyticsContent', [
- 'fetching',
- 'onFetch',
- 'onFetchMore'
- ]),
- M = F('audienceAnalytics', [
- 'fetchingUserReport',
- 'onFetchOverviewMetrics',
- 'onFetchUserReport',
- 'onFetchEngagementReport'
- ]),
- B = F('badges', [
- 'toggling',
- 'onToggle',
- 'onToggleError',
- 'fetching',
- 'onFetch',
- 'onFetchError',
- 'saving',
- 'onSave',
- 'onSaveError',
- 'uploading',
- 'onUpload',
- 'onUploadError'
- ]),
- z = F('badgesManage', [
- 'updateModal',
- 'awarding',
- 'onAward',
- 'onAwardError',
- 'removing',
- 'onRemove',
- 'onRemoveError'
- ]),
- H = F('behindClick', [
- 'fetching',
- 'onFetch',
- 'onFetchError',
- 'saving',
- 'onSave',
- 'onSaveError'
- ]),
- G = F('campaign', [
- 'onFetch',
- 'onError'
- ]),
- V = F('commentCounts', [
- 'onFetch'
- ]),
- W = F('discussionsEdit', [
- 'fetchedCategories',
- 'fetchingDiscussions',
- 'fetchedDiscussions',
- 'onFetchError',
- 'updatedThread',
- 'updateThreadError',
- 'clearAlert',
- 'resetDiscussions'
- ]),
- Y = F('earnings', [
- 'onFetch'
- ]),
- Q = F('featuredMessages', [
- 'onFetchViewStatus'
- ]),
- K = F('forumCategories', [
- 'onFetch'
- ]),
- J = F('forumDetails', [
- 'fetching',
- 'onFetch',
- 'onError',
- 'onUpdate'
- ]),
- $ = F('forumLanguages', [
- 'onFetch'
- ]),
- Z = F('forumModerator', [
- 'fetching',
- 'onFetch',
- 'onFetchError',
- 'saving',
- 'onSave',
- 'onSaveError',
- 'updating',
- 'onUpdate',
- 'onUpdateError'
- ]),
- X = F('pollModerator', [
- 'fetching',
- 'onFetch',
- 'onFetchError',
- 'saving',
- 'onSave',
- 'onSaveError',
- 'updating',
- 'onUpdate',
- 'onUpdateError'
- ]),
- ee = F('forumUpdateFavicon', [
- 'dismissError',
- 'isSaving',
- 'onError',
- 'onSave',
- 'setApiCall',
- 'validateImageFile'
- ]),
- te = F('forumWebhooks', [
- 'fetching',
- 'onFetch',
- 'onFetchError',
- 'selectSubscription',
- 'saving',
- 'onSave',
- 'onSaveError',
- 'updateInput'
- ]),
- ne = F('moderateSearch', [
- 'update',
- 'changeActive'
- ]),
- ae = F('moderateSuggestedActions', [
- 'fetching',
- 'onFetch',
- 'onError'
- ]),
- re = F('moderateUserLists', [
- 'resetDefault',
- 'updateModal',
- 'updateBanFormValues'
- ]),
- oe = F('moderationRules', [
- 'rulesFetching',
- 'onFetchRules',
- 'onFetchModerationHistory',
- 'rulesSaving',
- 'onSaveRules',
- 'onSaveRulesError'
- ]),
- ie = F('orgAdmin', [
- 'fetching',
- 'onFetch',
- 'onFetchError',
- 'saving',
- 'onSave',
- 'onSaveError',
- 'updating',
- 'onUpdate',
- 'onUpdateError'
- ]),
- se = F('orgForums', [
- 'fetching',
- 'onFetch',
- 'onFetchMore',
- 'onFetchError'
- ]),
- le = F('policy', [
- 'saving',
- 'onSave',
- 'setApiCall'
- ]),
- ce = F('pollsEditor', [
- 'isFetching',
- 'isSyncing',
- 'onFetch',
- 'onSave',
- 'onDelete',
- 'onPublish',
- 'onPreview',
- 'reset'
- ]),
- ue = F('pollsList', [
- 'updateSearchQuery',
- 'isFetching',
- 'onFetch',
- 'onDelete',
- 'reset',
- 'onPreview'
- ]),
- pe = F('pollStats', [
- 'isFetching',
- 'onFetch'
- ]),
- de = F('pollsAnaytics', [
- 'isFetching',
- 'isFetchingDetails',
- 'onFetchTotalResponsesReport',
- 'onFetchPollResponsesReport',
- 'onFetchPollBreakdownReport',
- 'onFetchPollDetails'
- ]),
- me = F('reactions', [
- 'fetchReactions',
- 'onFetch',
- 'onError',
- 'saveReactions',
- 'onSave',
- 'onDisable',
- 'fetchDefaultReactions',
- 'onFetchDefaultReactions'
- ]),
- fe = F('reactionsAnalytics', [
- 'onFetchTotalReactionsReportByDate',
- 'onFetchTotalReactionsReportByThread',
- 'onFetchThreadSpecificReactionsReport'
- ]),
- he = F('recommendations', [
- 'enabling',
- 'onEnable',
- 'onEnableError',
- 'fetching',
- 'onFetch',
- 'onFetchError',
- 'saving',
- 'onSave',
- 'onSaveError'
- ]),
- ge = F('restricedWords', [
- 'fetching',
- 'fetchFailed',
- 'saving',
- 'saved',
- 'saveFailed',
- 'update',
- 'clearError',
- 'edit'
- ]),
- ye = F('saasFeatures', [
- 'fetching',
- 'onFetch',
- 'onError'
- ]),
- be = F('selection', [
- 'onEnableComments'
- ]),
- ve = F('stripeCheckout', [
- 'scriptAdded',
- 'scriptLoaded',
- 'checkoutScriptAdded',
- 'stripeCheckoutLoaded',
- 'updateData',
- 'onError'
- ]),
- _e = F('subscription', [
- 'fetchStart',
- 'fetchFailed',
- 'fetchedPackages',
- 'fetchedCurrentPlan',
- 'pollsFetchedCurrentPlan',
- 'fetchedBillingInformation',
- 'updateInvoiceStart',
- 'updateInvoiceEnd',
- 'updateSubscriptionStart',
- 'updateSubscriptionEnd'
- ]),
- Ee = F('wordpressInstall', [
- 'configureRemotePlugin',
- 'configuring',
- 'onConfigure',
- 'onConfigureError',
- 'updateInstallToken'
- ]);
- function Oe(t, e) {
- var n,
- a = Object.keys(t);
- return Object.getOwnPropertySymbols && (n = Object.getOwnPropertySymbols(t), e && (n = n.filter(function (e) {
- return Object.getOwnPropertyDescriptor(t, e).enumerable
- })), a.push.apply(a, n)),
- a
- }
- function Se(a) {
- for (var e = 1; e < arguments.length; e++) {
- var r = null != arguments[e] ? arguments[e] : {
- };
- e % 2 ? Oe(Object(r), !0).forEach(function (e) {
- var t,
- n;
- n = r[t = e],
- t in (e = a) ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(a, Object.getOwnPropertyDescriptors(r)) : Oe(Object(r)).forEach(function (e) {
- Object.defineProperty(a, e, Object.getOwnPropertyDescriptor(r, e))
- })
- }
- return a
- }
- function we(e, t) {
- if (null == e) return {
- };
- var n,
- a = function (e, t) {
- if (null == e) return {
- };
- var n,
- a,
- r = {
- },
- o = Object.keys(e);
- for (a = 0; a < o.length; a++) ~t.indexOf(n = o[a]) || (r[n] = e[n]);
- return r
- }(e, t);
- if (Object.getOwnPropertySymbols) for (var r = Object.getOwnPropertySymbols(e), o = 0; o < r.length; o++) ~t.indexOf(n = r[o]) || Object.prototype.propertyIsEnumerable.call(e, n) && (a[n] = e[n]);
- return a
- }
- function Pe() {
- var e = 0 < arguments.length && void 0 !== arguments[0] ? arguments[0] : ke,
- t = 1 < arguments.length ? arguments[1] : void 0,
- n = t.type,
- a = we(t, [
- 'type'
- ]);
- switch (n) {
- case L.fetching:
- return Se(Se({
- }, e), {
- }, {
- pendingExportInfo: Se(Se({
- }, e.pendingExportInfo), {
- }, {
- isFetching: !0
- })
- });
- case L.onFetch:
- return Se(Se({
- }, e), {
- }, {
- pendingExportInfo: Se(Se(Se({
- }, e.pendingExportInfo), a.pendingExportInfo), {
- }, {
- isFetching: !1,
- isFetched: !0
- })
- });
- case L.onError:
- return Se(Se({
- }, e), {
- }, {
- pendingExportInfo: Se(Se({
- }, e.pendingExportInfo), {
- }, {
- isFetching: !1
- })
- });
- default:
- return e
- }
- }
- var ke = {
- pendingExportInfo: {
- isFetching: !1,
- isFetched: !1,
- pendingExports: 0,
- totalExports: 0,
- lastExportDate: ''
- }
- };
- function Ne(t, e) {
- var n,
- a = Object.keys(t);
- return Object.getOwnPropertySymbols && (n = Object.getOwnPropertySymbols(t), e && (n = n.filter(function (e) {
- return Object.getOwnPropertyDescriptor(t, e).enumerable
- })), a.push.apply(a, n)),
- a
- }
- function Ce(a) {
- for (var e = 1; e < arguments.length; e++) {
- var r = null != arguments[e] ? arguments[e] : {
- };
- e % 2 ? Ne(Object(r), !0).forEach(function (e) {
- var t,
- n;
- n = r[t = e],
- t in (e = a) ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(a, Object.getOwnPropertyDescriptors(r)) : Ne(Object(r)).forEach(function (e) {
- Object.defineProperty(a, e, Object.getOwnPropertyDescriptor(r, e))
- })
- }
- return a
- }
- function Re(e, t) {
- if (null == e) return {
- };
- var n,
- a = function (e, t) {
- if (null == e) return {
- };
- var n,
- a,
- r = {
- },
- o = Object.keys(e);
- for (a = 0; a < o.length; a++) ~t.indexOf(n = o[a]) || (r[n] = e[n]);
- return r
- }(e, t);
- if (Object.getOwnPropertySymbols) for (var r = Object.getOwnPropertySymbols(e), o = 0; o < r.length; o++) ~t.indexOf(n = r[o]) || Object.prototype.propertyIsEnumerable.call(e, n) && (a[n] = e[n]);
- return a
- }
- function xe() {
- var e = 0 < arguments.length && void 0 !== arguments[0] ? arguments[0] : Ae,
- t = 1 < arguments.length ? arguments[1] : void 0,
- n = t.type,
- a = Re(t, [
- 'type'
- ]);
- switch (n) {
- case U.fetching:
- return Ce(Ce({
- }, e), {
- }, {
- isFetching: !0
- });
- case U.onFetch:
- return Ce(Ce({
- }, e), {
- }, {
- isFetching: a.isFetching,
- cursor: a.cursor,
- items: a.items,
- reportData: a.reportData,
- hasMore: a.cursor && a.cursor.hasNext
- });
- case U.onFetchMore:
- return Ce(Ce({
- }, e), {
- }, {
- isFetching: a.isFetching,
- cursor: a.cursor,
- items: a.items,
- hasMore: a.cursor && a.cursor.hasNext
- });
- default:
- return e
- }
- }
- var Ae = {
- items: null,
- isFetching: !0,
- cursor: null,
- hasMore: !1,
- reportData: null
- },
- De = n(7),
- je = n.n(De);
- function Te(e) {
- return function (e) {
- if (Array.isArray(e)) return Ie(e)
- }(e) || function (e) {
- if ('undefined' != typeof Symbol && null != e[Symbol.iterator] || null != e['@@iterator']) return Array.from(e)
- }(e) || function (e, t) {
- if (e) {
- if ('string' == typeof e) return Ie(e, t);
- var n = Object.prototype.toString.call(e).slice(8, - 1);
- return 'Map' === (n = 'Object' === n && e.constructor ? e.constructor.name : n) || 'Set' === n ? Array.from(e) : 'Arguments' === n || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n) ? Ie(e, t) : void 0
- }
- }(e) || function () {
- throw new TypeError('Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.')
- }()
- }
- function Ie(e, t) {
- for (var n = 0, a = Array(t = null == t || e.length < t ? e.length : t); n < t; n++) a[n] = e[n];
- return a
- }
- function qe(t, e) {
- var n,
- a = Object.keys(t);
- return Object.getOwnPropertySymbols && (n = Object.getOwnPropertySymbols(t), e && (n = n.filter(function (e) {
- return Object.getOwnPropertyDescriptor(t, e).enumerable
- })), a.push.apply(a, n)),
- a
- }
- function Fe(a) {
- for (var e = 1; e < arguments.length; e++) {
- var r = null != arguments[e] ? arguments[e] : {
- };
- e % 2 ? qe(Object(r), !0).forEach(function (e) {
- var t,
- n;
- n = r[t = e],
- t in (e = a) ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(a, Object.getOwnPropertyDescriptors(r)) : qe(Object(r)).forEach(function (e) {
- Object.defineProperty(a, e, Object.getOwnPropertyDescriptor(r, e))
- })
- }
- return a
- }
- function Le(e, t) {
- if (null == e) return {
- };
- var n,
- a = function (e, t) {
- if (null == e) return {
- };
- var n,
- a,
- r = {
- },
- o = Object.keys(e);
- for (a = 0; a < o.length; a++) ~t.indexOf(n = o[a]) || (r[n] = e[n]);
- return r
- }(e, t);
- if (Object.getOwnPropertySymbols) for (var r = Object.getOwnPropertySymbols(e), o = 0; o < r.length; o++) ~t.indexOf(n = r[o]) || Object.prototype.propertyIsEnumerable.call(e, n) && (a[n] = e[n]);
- return a
- }
- function Ue() {
- var e = 0 < arguments.length && void 0 !== arguments[0] ? arguments[0] : He,
- t = 1 < arguments.length ? arguments[1] : void 0,
- n = t.type,
- a = Le(t, [
- 'type'
- ]);
- switch (n) {
- case M.fetchingUserReport:
- return Fe(Fe({
- }, e), {
- }, {
- userReport: Fe(Fe({
- }, e.userReport), {
- }, {
- isFetching: !0
- })
- });
- case M.onFetchOverviewMetrics:
- return Fe(Fe({
- }, e), {
- }, {
- overviewMetrics: Fe({
- current: Be,
- previous: Be
- }, a.response)
- });
- case M.onFetchUserReport:
- return Fe(Fe({
- }, e), {
- }, {
- userReport: {
- users: [
- ].concat(Te(a.fetchMore ? e.userReport.users : [
- ]), Te(a.response)),
- cursor: a.cursor,
- isFetching: !1
- }
- });
- case M.onFetchEngagementReport:
- return Fe(Fe({
- }, e), {
- }, {
- engagementReport: Fe(Fe({
- }, je.a.mapObject(ze, function () {
- return [[a.start.split('T') [0],
- 0],
- [
- a.end.split('T') [0],
- 0
- ]]
- })), a.response)
- });
- default:
- return e
- }
- }
- function Me() {
- return 0 < arguments.length && void 0 !== arguments[0] ? arguments[0] : {
- auth: Object(Ge.getFromCookie) ()
- }
- }
- var Be = {
- commentReaders: 0,
- subscribedReaders: 0,
- engagedReaders: {
- new : 0,
- returning: 0,
- recovered: 0
- }
- },
- ze = {
- new : [
- ],
- returning: [
- ],
- recovered: [
- ],
- inactive: [
- ]
- },
- He = {
- overviewMetrics: null,
- engagementReport: ze,
- userReport: {
- cursor: {
- },
- users: [
- ],
- isFetching: !1
- }
- },
- Ge = n(42),
- Ve = n.n(Ge),
- We = n(59);
- function Ye(t, e) {
- var n,
- a = Object.keys(t);
- return Object.getOwnPropertySymbols && (n = Object.getOwnPropertySymbols(t), e && (n = n.filter(function (e) {
- return Object.getOwnPropertyDescriptor(t, e).enumerable
- })), a.push.apply(a, n)),
- a
- }
- function Qe(a) {
- for (var e = 1; e < arguments.length; e++) {
- var r = null != arguments[e] ? arguments[e] : {
- };
- e % 2 ? Ye(Object(r), !0).forEach(function (e) {
- var t,
- n;
- n = r[t = e],
- t in (e = a) ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(a, Object.getOwnPropertyDescriptors(r)) : Ye(Object(r)).forEach(function (e) {
- Object.defineProperty(a, e, Object.getOwnPropertyDescriptor(r, e))
- })
- }
- return a
- }
- function Ke(e, t) {
- if (null == e) return {
- };
- var n,
- a = function (e, t) {
- if (null == e) return {
- };
- var n,
- a,
- r = {
- },
- o = Object.keys(e);
- for (a = 0; a < o.length; a++) ~t.indexOf(n = o[a]) || (r[n] = e[n]);
- return r
- }(e, t);
- if (Object.getOwnPropertySymbols) for (var r = Object.getOwnPropertySymbols(e), o = 0; o < r.length; o++) ~t.indexOf(n = r[o]) || Object.prototype.propertyIsEnumerable.call(e, n) && (a[n] = e[n]);
- return a
- }
- function Je() {
- var e = 0 < arguments.length && void 0 !== arguments[0] ? arguments[0] : $e,
- t = 1 < arguments.length ? arguments[1] : void 0,
- n = t.type,
- a = Ke(t, [
- 'type'
- ]);
- switch (n) {
- case z.updateModal:
- return Qe(Qe({
- }, e), {
- }, {
- isOpen: ('boolean' == typeof a.isOpen ? a : e).isOpen,
- forum: a.forum || e.forum,
- user: a.user || e.user
- });
- case z.updateBadgeAction:
- return Qe(Qe({
- }, e), {
- }, {
- isOpen: ('boolean' == typeof a.isOpen ? a : e).isOpen,
- action: a.action || e.action
- });
- case z.awarding:
- return Qe(Qe({
- }, e), {
- }, {
- isAwarding: !0,
- isAwarded: !1,
- error: null
- });
- case z.onAward:
- return Qe(Qe({
- }, e), {
- }, {
- targetBadge: a.badge,
- isAwarding: !1,
- isAwarded: !0,
- error: null
- });
- case z.onAwardError:
- return Qe(Qe({
- }, e), {
- }, {
- isAwarding: !1,
- isAwarded: !1,
- error: a.error
- });
- case z.removing:
- return Qe(Qe({
- }, e), {
- }, {
- isRemoving: !0,
- isRemoved: !1,
- error: null
- });
- case z.onRemove:
- return Qe(Qe({
- }, e), {
- }, {
- targetBadge: a.badge,
- isRemoving: !1,
- isRemoved: !0,
- error: null
- });
- case z.onRemoveError:
- return Qe(Qe({
- }, e), {
- }, {
- isRemoving: !1,
- isRemoved: !1,
- error: a.error
- });
- default:
- return e
- }
- }
- var $e = {
- isOpen: !1,
- action: We.ACTION_TYPES.AWARD,
- user: null,
- forum: null,
- targetBadge: null,
- isAwarding: !1,
- isAwarded: !1,
- isRemoving: !1,
- isRemoved: !1,
- error: null
- };
- function Ze(t, e) {
- var n,
- a = Object.keys(t);
- return Object.getOwnPropertySymbols && (n = Object.getOwnPropertySymbols(t), e && (n = n.filter(function (e) {
- return Object.getOwnPropertyDescriptor(t, e).enumerable
- })), a.push.apply(a, n)),
- a
- }
- function Xe(a) {
- for (var e = 1; e < arguments.length; e++) {
- var r = null != arguments[e] ? arguments[e] : {
- };
- e % 2 ? Ze(Object(r), !0).forEach(function (e) {
- var t,
- n;
- n = r[t = e],
- t in (e = a) ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(a, Object.getOwnPropertyDescriptors(r)) : Ze(Object(r)).forEach(function (e) {
- Object.defineProperty(a, e, Object.getOwnPropertyDescriptor(r, e))
- })
- }
- return a
- }
- function et(e, t) {
- if (null == e) return {
- };
- var n,
- a = function (e, t) {
- if (null == e) return {
- };
- var n,
- a,
- r = {
- },
- o = Object.keys(e);
- for (a = 0; a < o.length; a++) ~t.indexOf(n = o[a]) || (r[n] = e[n]);
- return r
- }(e, t);
- if (Object.getOwnPropertySymbols) for (var r = Object.getOwnPropertySymbols(e), o = 0; o < r.length; o++) ~t.indexOf(n = r[o]) || Object.prototype.propertyIsEnumerable.call(e, n) && (a[n] = e[n]);
- return a
- }
- function tt() {
- var e = 0 < arguments.length && void 0 !== arguments[0] ? arguments[0] : nt,
- t = 1 < arguments.length ? arguments[1] : void 0,
- n = t.type,
- a = et(t, [
- 'type'
- ]);
- switch (n) {
- case B.toggling:
- return Xe(Xe({
- }, e), {
- }, {
- isToggling: !0,
- errors: [
- ]
- });
- case B.onToggle:
- return Xe(Xe({
- }, e), {
- }, {
- badgesEnabled: a.badgesEnabled,
- isToggling: !1,
- errors: [
- ]
- });
- case B.onToggleError:
- return Xe(Xe({
- }, e), {
- }, {
- isToggling: !1,
- errors: [
- a.message
- ]
- });
- case B.fetching:
- return Xe(Xe({
- }, e), {
- }, {
- isFetching: !0,
- isFetched: !1,
- errors: [
- ]
- });
- case B.onFetch:
- return Xe(Xe({
- }, e), {
- }, {
- isFetching: !1,
- isFetched: !0,
- badgesEnabled: a.badgesEnabled,
- badges: a.badges,
- errors: [
- ]
- });
- case B.onFetchError:
- return Xe(Xe({
- }, e), {
- }, {
- isFetching: !1,
- isFetched: !0,
- errors: [
- a.message
- ]
- });
- case B.uploading:
- return Xe(Xe({
- }, e), {
- }, {
- isUploading: !0,
- errors: [
- ]
- });
- case B.onUpload:
- return Xe(Xe({
- }, e), {
- }, {
- isUploading: !1,
- isUploaded: !0,
- badges: a.badges,
- errors: [
- ]
- });
- case B.onUploadError:
- return Xe(Xe({
- }, e), {
- }, {
- isUploading: !1,
- isUploaded: !1,
- errors: [
- a.message
- ]
- });
- case B.saving:
- return Xe(Xe({
- }, e), {
- }, {
- isSaving: !0,
- isSaved: !1,
- errors: [
- ]
- });
- case B.onSave:
- return Xe(Xe({
- }, e), {
- }, {
- badges: a.badges,
- isSaving: !1,
- isSaved: !0,
- errors: [
- ]
- });
- case B.onSaveError:
- return {
- isSaving: !1,
- errors: [
- a.message
- ]
- };
- default:
- return e
- }
- }
- var nt = {
- badgesEnabled: !1,
- badges: [
- ],
- isToggling: !1,
- isFetching: !1,
- isFetched: !1,
- isUploading: !1,
- isUploaded: !1,
- isSaving: !1,
- isSaved: !1,
- errors: [
- ]
- };
- function at(t, e) {
- var n,
- a = Object.keys(t);
- return Object.getOwnPropertySymbols && (n = Object.getOwnPropertySymbols(t), e && (n = n.filter(function (e) {
- return Object.getOwnPropertyDescriptor(t, e).enumerable
- })), a.push.apply(a, n)),
- a
- }
- function rt(a) {
- for (var e = 1; e < arguments.length; e++) {
- var r = null != arguments[e] ? arguments[e] : {
- };
- e % 2 ? at(Object(r), !0).forEach(function (e) {
- var t,
- n;
- n = r[t = e],
- t in (e = a) ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(a, Object.getOwnPropertyDescriptors(r)) : at(Object(r)).forEach(function (e) {
- Object.defineProperty(a, e, Object.getOwnPropertyDescriptor(r, e))
- })
- }
- return a
- }
- function ot(e, t) {
- if (null == e) return {
- };
- var n,
- a = function (e, t) {
- if (null == e) return {
- };
- var n,
- a,
- r = {
- },
- o = Object.keys(e);
- for (a = 0; a < o.length; a++) ~t.indexOf(n = o[a]) || (r[n] = e[n]);
- return r
- }(e, t);
- if (Object.getOwnPropertySymbols) for (var r = Object.getOwnPropertySymbols(e), o = 0; o < r.length; o++) ~t.indexOf(n = r[o]) || Object.prototype.propertyIsEnumerable.call(e, n) && (a[n] = e[n]);
- return a
- }
- function it() {
- var e = 0 < arguments.length && void 0 !== arguments[0] ? arguments[0] : st,
- t = 1 < arguments.length ? arguments[1] : void 0,
- n = t.type,
- a = ot(t, [
- 'type'
- ]);
- switch (n) {
- case H.fetching:
- return rt(rt({
- }, e), {
- }, {
- isFetching: !0,
- error: null
- });
- case H.onFetch:
- return rt(rt({
- }, e), {
- }, {
- isFetching: !1,
- titleEnabled: a.title_enabled,
- titleText: a.title_text,
- titleCSS: a.title_css,
- buttonText: a.button_text,
- buttonCSS: a.button_css
- });
- case H.onFetchError:
- return rt(rt({
- }, e), {
- }, {
- isFetching: !1,
- isSaving: !1,
- error: a.message || 'We couldn\'t retrieve your behind a click settings. Try again.'
- });
- case H.saving:
- return rt(rt({
- }, e), {
- }, {
- isSaving: !0,
- isSaved: !1,
- error: null
- });
- case H.onSave:
- return rt(rt({
- }, e), {
- }, {
- isSaving: !1,
- isSaved: !0
- });
- case H.onSaveError:
- return rt(rt({
- }, e), {
- }, {
- isFetching: !1,
- isSaving: !1,
- error: a.message || 'We couldn\'t save your behind a click settings. Try again.'
- });
- default:
- return e
- }
- }
- var st = {
- titleEnabled: !1,
- titleText: null,
- titleCSS: null,
- buttonText: null,
- buttonCSS: null,
- isFetching: !1,
- isSaving: !1,
- isSaved: !1,
- error: null
- },
- lt = n(30),
- ct = n.n(lt),
- ut = n(35),
- pt = n.n(ut),
- dt = '//'.concat(pt.a.disqusHost),
- mt = 'sites',
- ft = {
- global: 'global',
- organization: 'organization',
- forum: 'forum'
- },
- ht = b.a.shape({
- type: b.a.oneOf(je.a.values(ft)).isRequired,
- forum: b.a.object,
- organization: b.a.object,
- organizationForums: b.a.object
- }),
- gt = ct.a.unix('1420156799'),
- yt = [
- '7 days',
- '30 days'
- ];
- function bt(e, t) {
- if (null == e) return {
- };
- var n,
- a = function (e, t) {
- if (null == e) return {
- };
- var n,
- a,
- r = {
- },
- o = Object.keys(e);
- for (a = 0; a < o.length; a++) ~t.indexOf(n = o[a]) || (r[n] = e[n]);
- return r
- }(e, t);
- if (Object.getOwnPropertySymbols) for (var r = Object.getOwnPropertySymbols(e), o = 0; o < r.length; o++) ~t.indexOf(n = r[o]) || Object.prototype.propertyIsEnumerable.call(e, n) && (a[n] = e[n]);
- return a
- }
- function vt() {
- var e = 0 < arguments.length && void 0 !== arguments[0] ? arguments[0] : _t,
- t = 1 < arguments.length ? arguments[1] : void 0,
- n = t.type,
- a = bt(t, [
- 'type'
- ]);
- switch (n) {
- case G.onFetch:
- return a.selection.type === ft.forum ? {
- canParticipate: a.response.settings.adsEnabled
- }
- : a.selection.type === ft.organization ? {
- canParticipate: !a.response.action_id
- }
- : {
- canParticipate: !1
- };
- case G.onError:
- return {
- canParticipate: !1
- };
- default:
- return e
- }
- }
- var _t = {
- canParticipate: !1
- };
- function Et(t, e) {
- var n,
- a = Object.keys(t);
- return Object.getOwnPropertySymbols && (n = Object.getOwnPropertySymbols(t), e && (n = n.filter(function (e) {
- return Object.getOwnPropertyDescriptor(t, e).enumerable
- })), a.push.apply(a, n)),
- a
- }
- function Ot(a) {
- for (var e = 1; e < arguments.length; e++) {
- var r = null != arguments[e] ? arguments[e] : {
- };
- e % 2 ? Et(Object(r), !0).forEach(function (e) {
- var t,
- n;
- n = r[t = e],
- t in (e = a) ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(a, Object.getOwnPropertyDescriptors(r)) : Et(Object(r)).forEach(function (e) {
- Object.defineProperty(a, e, Object.getOwnPropertyDescriptor(r, e))
- })
- }
- return a
- }
- function St(e, t) {
- if (null == e) return {
- };
- var n,
- a = function (e, t) {
- if (null == e) return {
- };
- var n,
- a,
- r = {
- },
- o = Object.keys(e);
- for (a = 0; a < o.length; a++) ~t.indexOf(n = o[a]) || (r[n] = e[n]);
- return r
- }(e, t);
- if (Object.getOwnPropertySymbols) for (var r = Object.getOwnPropertySymbols(e), o = 0; o < r.length; o++) ~t.indexOf(n = r[o]) || Object.prototype.propertyIsEnumerable.call(e, n) && (a[n] = e[n]);
- return a
- }
- function wt() {
- var e = 0 < arguments.length && void 0 !== arguments[0] ? arguments[0] : Pt,
- t = (n = 1 < arguments.length ? arguments[1] : void 0).type,
- n = St(n, [
- 'type'
- ]);
- return t !== V.onFetch ? e : Ot(Ot({
- }, e), {
- }, {
- commentCounts: n.response.comments_series
- })
- }
- var Pt = {
- commentCounts: null
- };
- function kt(t, e) {
- var n,
- a = Object.keys(t);
- return Object.getOwnPropertySymbols && (n = Object.getOwnPropertySymbols(t), e && (n = n.filter(function (e) {
- return Object.getOwnPropertyDescriptor(t, e).enumerable
- })), a.push.apply(a, n)),
- a
- }
- function Nt(a) {
- for (var e = 1; e < arguments.length; e++) {
- var r = null != arguments[e] ? arguments[e] : {
- };
- e % 2 ? kt(Object(r), !0).forEach(function (e) {
- var t,
- n;
- n = r[t = e],
- t in (e = a) ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(a, Object.getOwnPropertyDescriptors(r)) : kt(Object(r)).forEach(function (e) {
- Object.defineProperty(a, e, Object.getOwnPropertyDescriptor(r, e))
- })
- }
- return a
- }
- function Ct(e, t) {
- if (null == e) return {
- };
- var n,
- a = function (e, t) {
- if (null == e) return {
- };
- var n,
- a,
- r = {
- },
- o = Object.keys(e);
- for (a = 0; a < o.length; a++) ~t.indexOf(n = o[a]) || (r[n] = e[n]);
- return r
- }(e, t);
- if (Object.getOwnPropertySymbols) for (var r = Object.getOwnPropertySymbols(e), o = 0; o < r.length; o++) ~t.indexOf(n = r[o]) || Object.prototype.propertyIsEnumerable.call(e, n) && (a[n] = e[n]);
- return a
- }
- function Rt() {
- var e = 0 < arguments.length && void 0 !== arguments[0] ? arguments[0] : xt,
- t = 1 < arguments.length ? arguments[1] : void 0,
- n = t.type,
- a = Ct(t, [
- 'type'
- ]);
- switch (n) {
- case W.fetchedCategories:
- return Nt(Nt({
- }, e), {
- }, {
- categories: a.categories,
- isFetchingThreads: !1
- });
- case W.fetchingDiscussions:
- return Nt(Nt({
- }, e), {
- }, {
- alert: null,
- isFetchingThreads: !0
- });
- case W.fetchedDiscussions:
- return Nt(Nt({
- }, e), {
- }, {
- cursor: a.cursor,
- hasNextPage: !(!a.cursor || !a.cursor.hasNext),
- isFetchingThreads: !1,
- threads: e.threads.concat(a.threads)
- });
- case W.resetDiscussions:
- return Nt(Nt({
- }, e), {
- }, {
- cursor: null,
- threads: [
- ],
- hasNextPage: !1
- });
- case W.onFetchError:
- return Nt(Nt({
- }, e), {
- }, {
- alert: {
- type: 'error',
- message: 'There was an error retrieving discussions for this site'
- },
- isFetchingThreads: !1
- });
- case W.updatedThread:
- return Nt(Nt({
- }, e), {
- }, {
- alert: {
- status: 'success',
- message: 'Saved'
- },
- threads: a.threads
- });
- case W.updateThreadError:
- return Nt(Nt({
- }, e), {
- }, {
- alert: {
- status: 'error',
- message: a.errorMessage
- }
- });
- case W.clearAlert:
- return Nt(Nt({
- }, e), {
- }, {
- alert: null
- });
- default:
- return e
- }
- }
- var xt = {
- alert: null,
- categories: [
- ],
- cursor: null,
- hasNextPage: !1,
- isFetchingThreads: !1,
- numPerPage: 20,
- threads: [
- ]
- };
- function At(t, e) {
- var n,
- a = Object.keys(t);
- return Object.getOwnPropertySymbols && (n = Object.getOwnPropertySymbols(t), e && (n = n.filter(function (e) {
- return Object.getOwnPropertyDescriptor(t, e).enumerable
- })), a.push.apply(a, n)),
- a
- }
- function Dt(a) {
- for (var e = 1; e < arguments.length; e++) {
- var r = null != arguments[e] ? arguments[e] : {
- };
- e % 2 ? At(Object(r), !0).forEach(function (e) {
- var t,
- n;
- n = r[t = e],
- t in (e = a) ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(a, Object.getOwnPropertyDescriptors(r)) : At(Object(r)).forEach(function (e) {
- Object.defineProperty(a, e, Object.getOwnPropertyDescriptor(r, e))
- })
- }
- return a
- }
- function jt(e, t) {
- if (null == e) return {
- };
- var n,
- a = function (e, t) {
- if (null == e) return {
- };
- var n,
- a,
- r = {
- },
- o = Object.keys(e);
- for (a = 0; a < o.length; a++) ~t.indexOf(n = o[a]) || (r[n] = e[n]);
- return r
- }(e, t);
- if (Object.getOwnPropertySymbols) for (var r = Object.getOwnPropertySymbols(e), o = 0; o < r.length; o++) ~t.indexOf(n = r[o]) || Object.prototype.propertyIsEnumerable.call(e, n) && (a[n] = e[n]);
- return a
- }
- function Tt() {
- var e = 0 < arguments.length && void 0 !== arguments[0] ? arguments[0] : It,
- t = (n = 1 < arguments.length ? arguments[1] : void 0).type,
- n = jt(n, [
- 'type'
- ]);
- return t !== Y.onFetch ? e : Dt(Dt({
- }, e), {
- }, {
- earnings: n.results
- })
- }
- var It = {
- earnings: null
- };
- function qt(t, e) {
- var n,
- a = Object.keys(t);
- return Object.getOwnPropertySymbols && (n = Object.getOwnPropertySymbols(t), e && (n = n.filter(function (e) {
- return Object.getOwnPropertyDescriptor(t, e).enumerable
- })), a.push.apply(a, n)),
- a
- }
- function Ft(a) {
- for (var e = 1; e < arguments.length; e++) {
- var r = null != arguments[e] ? arguments[e] : {
- };
- e % 2 ? qt(Object(r), !0).forEach(function (e) {
- var t,
- n;
- n = r[t = e],
- t in (e = a) ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(a, Object.getOwnPropertyDescriptors(r)) : qt(Object(r)).forEach(function (e) {
- Object.defineProperty(a, e, Object.getOwnPropertyDescriptor(r, e))
- })
- }
- return a
- }
- function Lt(e, t) {
- if (null == e) return {
- };
- var n,
- a = function (e, t) {
- if (null == e) return {
- };
- var n,
- a,
- r = {
- },
- o = Object.keys(e);
- for (a = 0; a < o.length; a++) ~t.indexOf(n = o[a]) || (r[n] = e[n]);
- return r
- }(e, t);
- if (Object.getOwnPropertySymbols) for (var r = Object.getOwnPropertySymbols(e), o = 0; o < r.length; o++) ~t.indexOf(n = r[o]) || Object.prototype.propertyIsEnumerable.call(e, n) && (a[n] = e[n]);
- return a
- }
- function Ut() {
- var e = 0 < arguments.length && void 0 !== arguments[0] ? arguments[0] : Mt,
- t = (n = 1 < arguments.length ? arguments[1] : void 0).type,
- n = Lt(n, [
- 'type'
- ]);
- return t !== Q.onFetchViewStatus ? e : Ft(Ft({
- }, e), {
- }, {
- userHasViewedMessages: Ft(Ft({
- }, e.viewStatuses), n.response),
- isFetched: !0
- })
- }
- var Mt = {
- userHasViewedMessages: {
- },
- isFetched: !1
- };
- function Bt(e, t) {
- if (null == e) return {
- };
- var n,
- a = function (e, t) {
- if (null == e) return {
- };
- var n,
- a,
- r = {
- },
- o = Object.keys(e);
- for (a = 0; a < o.length; a++) ~t.indexOf(n = o[a]) || (r[n] = e[n]);
- return r
- }(e, t);
- if (Object.getOwnPropertySymbols) for (var r = Object.getOwnPropertySymbols(e), o = 0; o < r.length; o++) ~t.indexOf(n = r[o]) || Object.prototype.propertyIsEnumerable.call(e, n) && (a[n] = e[n]);
- return a
- }
- function zt() {
- var e = 0 < arguments.length && void 0 !== arguments[0] ? arguments[0] : Ht,
- t = (n = 1 < arguments.length ? arguments[1] : void 0).type,
- n = Bt(n, [
- 'type'
- ]);
- return t !== K.onFetch ? e : {
- allCategories: n.response
- }
- }
- var Ht = {
- allCategories: [
- ]
- };
- function Gt(t, e) {
- var n,
- a = Object.keys(t);
- return Object.getOwnPropertySymbols && (n = Object.getOwnPropertySymbols(t), e && (n = n.filter(function (e) {
- return Object.getOwnPropertyDescriptor(t, e).enumerable
- })), a.push.apply(a, n)),
- a
- }
- function Vt(a) {
- for (var e = 1; e < arguments.length; e++) {
- var r = null != arguments[e] ? arguments[e] : {
- };
- e % 2 ? Gt(Object(r), !0).forEach(function (e) {
- var t,
- n;
- n = r[t = e],
- t in (e = a) ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(a, Object.getOwnPropertyDescriptors(r)) : Gt(Object(r)).forEach(function (e) {
- Object.defineProperty(a, e, Object.getOwnPropertyDescriptor(r, e))
- })
- }
- return a
- }
- function Wt(e, t) {
- if (null == e) return {
- };
- var n,
- a = function (e, t) {
- if (null == e) return {
- };
- var n,
- a,
- r = {
- },
- o = Object.keys(e);
- for (a = 0; a < o.length; a++) ~t.indexOf(n = o[a]) || (r[n] = e[n]);
- return r
- }(e, t);
- if (Object.getOwnPropertySymbols) for (var r = Object.getOwnPropertySymbols(e), o = 0; o < r.length; o++) ~t.indexOf(n = r[o]) || Object.prototype.propertyIsEnumerable.call(e, n) && (a[n] = e[n]);
- return a
- }
- function Yt() {
- var e = 0 < arguments.length && void 0 !== arguments[0] ? arguments[0] : Qt,
- t = 1 < arguments.length ? arguments[1] : void 0,
- n = t.type,
- a = Wt(t, [
- 'type'
- ]);
- switch (n) {
- case J.fetching:
- return Vt(Vt({
- }, e), {
- }, {
- forumDetailsError: null,
- forumDetailsIsFetching: !0
- });
- case J.onFetch:
- return Vt(Vt({
- }, e), {
- }, {
- forumDetails: a.forumDetails,
- forumDetailsError: null,
- forumDetailsIsFetching: !1
- });
- case J.onError:
- return Vt(Vt({
- }, e), {
- }, {
- forumDetailsError: 'There was an error retrieving details for this site',
- forumDetailsIsFetching: !1
- });
- case J.onUpdate:
- return Vt(Vt({
- }, e), {
- }, {
- forumDetails: Vt(Vt({
- }, e.forumDetails), a.forumDetails)
- });
- default:
- return e
- }
- }
- var Qt = {
- forumDetails: null,
- forumDetailsError: null,
- forumDetailsIsFetching: !1
- };
- function Kt(e, t) {
- if (null == e) return {
- };
- var n,
- a = function (e, t) {
- if (null == e) return {
- };
- var n,
- a,
- r = {
- },
- o = Object.keys(e);
- for (a = 0; a < o.length; a++) ~t.indexOf(n = o[a]) || (r[n] = e[n]);
- return r
- }(e, t);
- if (Object.getOwnPropertySymbols) for (var r = Object.getOwnPropertySymbols(e), o = 0; o < r.length; o++) ~t.indexOf(n = r[o]) || Object.prototype.propertyIsEnumerable.call(e, n) && (a[n] = e[n]);
- return a
- }
- function Jt() {
- var e = 0 < arguments.length && void 0 !== arguments[0] ? arguments[0] : $t,
- t = (n = 1 < arguments.length ? arguments[1] : void 0).type,
- n = Kt(n, [
- 'type'
- ]);
- return t !== $.onFetch ? e : {
- languages: n.response
- }
- }
- var $t = {
- languages: [
- ]
- };
- function Zt(t, e) {
- var n,
- a = Object.keys(t);
- return Object.getOwnPropertySymbols && (n = Object.getOwnPropertySymbols(t), e && (n = n.filter(function (e) {
- return Object.getOwnPropertyDescriptor(t, e).enumerable
- })), a.push.apply(a, n)),
- a
- }
- function Xt(a) {
- for (var e = 1; e < arguments.length; e++) {
- var r = null != arguments[e] ? arguments[e] : {
- };
- e % 2 ? Zt(Object(r), !0).forEach(function (e) {
- var t,
- n;
- n = r[t = e],
- t in (e = a) ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(a, Object.getOwnPropertyDescriptors(r)) : Zt(Object(r)).forEach(function (e) {
- Object.defineProperty(a, e, Object.getOwnPropertyDescriptor(r, e))
- })
- }
- return a
- }
- function en(e, t) {
- if (null == e) return {
- };
- var n,
- a = function (e, t) {
- if (null == e) return {
- };
- var n,
- a,
- r = {
- },
- o = Object.keys(e);
- for (a = 0; a < o.length; a++) ~t.indexOf(n = o[a]) || (r[n] = e[n]);
- return r
- }(e, t);
- if (Object.getOwnPropertySymbols) for (var r = Object.getOwnPropertySymbols(e), o = 0; o < r.length; o++) ~t.indexOf(n = r[o]) || Object.prototype.propertyIsEnumerable.call(e, n) && (a[n] = e[n]);
- return a
- }
- function tn() {
- return (tn = Object.assign || function (e) {
- for (var t = 1; t < arguments.length; t++) {
- var n,
- a = arguments[t];
- for (n in a) Object.prototype.hasOwnProperty.call(a, n) && (e[n] = a[n])
- }
- return e
- }).apply(this, arguments)
- }
- function nn(e) {
- var t;
- try {
- ~(t = JSON.parse(e.responseText).response).indexOf('Invalid argument, \'user\': User matching query does not exist') && (t = 'No user found with this username.')
- } catch (e) {
- t = 'There was an unknown error.'
- }
- return t
- }
- function an(e, t) {
- return e.map(function (e) {
- return e.user.username === t.username ? tn({
- }, e, t.permissions) : e
- })
- }
- function rn() {
- var e = 0 < arguments.length && void 0 !== arguments[0] ? arguments[0] : on,
- t = 1 < arguments.length ? arguments[1] : void 0,
- n = t.type,
- a = en(t, [
- 'type'
- ]);
- switch (n) {
- case Z.fetching:
- return Xt(Xt({
- }, e), {
- }, {
- isFetching: !0,
- fetchError: null
- });
- case Z.onFetch:
- return Xt(Xt({
- }, e), {
- }, {
- forumModeratorList: a.moderatorList.filter(function (e) {
- return 'None' !== e.id
- }),
- isFetching: !1,
- fetchError: null
- });
- case Z.onFetchError:
- return Xt(Xt({
- }, e), {
- }, {
- isFetching: !1,
- fetchError: nn(a)
- });
- case Z.saving:
- return Xt(Xt({
- }, e), {
- }, {
- isSaving: !0,
- saveError: null
- });
- case Z.onSave:
- return Xt(Xt({
- }, e), {
- }, {
- isSaving: !1,
- saveError: null
- });
- case Z.onSaveError:
- return Xt(Xt({
- }, e), {
- }, {
- isSaving: !1,
- saveError: nn(a)
- });
- case Z.updating:
- return Xt(Xt({
- }, e), {
- }, {
- forumModeratorList: an(e.forumModeratorList, a),
- isUpdating: !0,
- updateError: null
- });
- case Z.onUpdate:
- return Xt(Xt({
- }, e), {
- }, {
- forumModeratorList: an(e.forumModeratorList, a),
- isUpdating: !1,
- updateError: null
- });
- case Z.onUpdateError:
- return Xt(Xt({
- }, e), {
- }, {
- forumModeratorList: an(e.forumModeratorList, a),
- isUpdating: !1,
- updateError: nn(a)
- });
- default:
- return e
- }
- }
- var on = {
- forumModeratorList: [
- ],
- isFetching: !1,
- fetchError: null,
- isSaving: !1,
- saveError: null,
- isUpdating: !1,
- updateError: null
- };
- function sn(t, e) {
- var n,
- a = Object.keys(t);
- return Object.getOwnPropertySymbols && (n = Object.getOwnPropertySymbols(t), e && (n = n.filter(function (e) {
- return Object.getOwnPropertyDescriptor(t, e).enumerable
- })), a.push.apply(a, n)),
- a
- }
- function ln(a) {
- for (var e = 1; e < arguments.length; e++) {
- var r = null != arguments[e] ? arguments[e] : {
- };
- e % 2 ? sn(Object(r), !0).forEach(function (e) {
- var t,
- n;
- n = r[t = e],
- t in (e = a) ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(a, Object.getOwnPropertyDescriptors(r)) : sn(Object(r)).forEach(function (e) {
- Object.defineProperty(a, e, Object.getOwnPropertyDescriptor(r, e))
- })
- }
- return a
- }
- function cn(e, t) {
- if (null == e) return {
- };
- var n,
- a = function (e, t) {
- if (null == e) return {
- };
- var n,
- a,
- r = {
- },
- o = Object.keys(e);
- for (a = 0; a < o.length; a++) ~t.indexOf(n = o[a]) || (r[n] = e[n]);
- return r
- }(e, t);
- if (Object.getOwnPropertySymbols) for (var r = Object.getOwnPropertySymbols(e), o = 0; o < r.length; o++) ~t.indexOf(n = r[o]) || Object.prototype.propertyIsEnumerable.call(e, n) && (a[n] = e[n]);
- return a
- }
- function un() {
- var e = 0 < arguments.length && void 0 !== arguments[0] ? arguments[0] : pn,
- t = 1 < arguments.length ? arguments[1] : void 0,
- n = t.type,
- a = cn(t, [
- 'type'
- ]);
- switch (n) {
- case ee.validateImageFile:
- return ln(ln({
- }, e), {
- }, {
- error: a.isValidImageFile ? null : 'Please choose a valid image file. You may choose .jpg/.jpeg, .png, .gif, and .bmp files.'
- });
- case ee.isSaving:
- return ln(ln({
- }, e), {
- }, {
- isSaving: !0
- });
- case ee.dismissError:
- return ln(ln({
- }, e), {
- }, {
- error: null
- });
- case ee.onSave:
- return ln(ln({
- }, e), {
- }, {
- forumFaviconNewUrl: ''.concat(a.data.response, '#').concat((new Date).getTime()),
- isSaving: !1
- });
- case ee.onError:
- return ln(ln({
- }, e), {
- }, {
- error: a.error,
- isSaving: !1
- });
- case ee.setApiCall:
- return ln(ln({
- }, e), {
- }, {
- apiCall: a.apiCall
- });
- default:
- return e
- }
- }
- var pn = {
- apiCall: null,
- error: null,
- isSaving: !1,
- forumFaviconNewUrl: null
- };
- function dn(t, e) {
- var n,
- a = Object.keys(t);
- return Object.getOwnPropertySymbols && (n = Object.getOwnPropertySymbols(t), e && (n = n.filter(function (e) {
- return Object.getOwnPropertyDescriptor(t, e).enumerable
- })), a.push.apply(a, n)),
- a
- }
- function mn(t) {
- for (var e = 1; e < arguments.length; e++) {
- var n = null != arguments[e] ? arguments[e] : {
- };
- e % 2 ? dn(Object(n), !0).forEach(function (e) {
- fn(t, e, n[e])
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(n)) : dn(Object(n)).forEach(function (e) {
- Object.defineProperty(t, e, Object.getOwnPropertyDescriptor(n, e))
- })
- }
- return t
- }
- function fn(e, t, n) {
- return t in e ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n,
- e
- }
- function hn(e, t) {
- if (null == e) return {
- };
- var n,
- a = function (e, t) {
- if (null == e) return {
- };
- var n,
- a,
- r = {
- },
- o = Object.keys(e);
- for (a = 0; a < o.length; a++) ~t.indexOf(n = o[a]) || (r[n] = e[n]);
- return r
- }(e, t);
- if (Object.getOwnPropertySymbols) for (var r = Object.getOwnPropertySymbols(e), o = 0; o < r.length; o++) ~t.indexOf(n = r[o]) || Object.prototype.propertyIsEnumerable.call(e, n) && (a[n] = e[n]);
- return a
- }
- function gn() {
- var e = 0 < arguments.length && void 0 !== arguments[0] ? arguments[0] : yn,
- t = 1 < arguments.length ? arguments[1] : void 0,
- n = t.type,
- a = hn(t, [
- 'type'
- ]);
- switch (n) {
- case te.fetching:
- return mn(mn({
- }, e), {
- }, {
- isFetching: !0,
- fetchError: null
- });
- case te.onFetch:
- return mn(mn({
- }, e), {
- }, {
- subscriptionList: a.subscriptionList,
- isFetching: !1,
- fetchError: null
- });
- case te.onFetchError:
- return mn(mn({
- }, e), {
- }, {
- fetchError: a.message,
- isFetching: !1
- });
- case te.saving:
- return mn(mn({
- }, e), {
- }, {
- isSaving: !0,
- isSaved: !1,
- saveError: null
- });
- case te.onSave:
- return mn(mn({
- }, e), {
- }, {
- isSaving: !1,
- isSaved: !0,
- changedInputs: {
- },
- selectedSubscription: mn(mn({
- }, e.selectedSubscription), a.savedSubscription),
- subscriptionList: e.subscriptionList.map(function (e) {
- return e.id === a.savedSubscription.id ? mn(mn({
- }, e), a.savedSubscription) : e
- })
- });
- case te.onSaveError:
- return mn(mn({
- }, e), {
- }, {
- saveError: a.message,
- isSaving: !1,
- isSaved: !1
- });
- case te.selectSubscription:
- return mn(mn({
- }, e), {
- }, {
- selectedSubscription: a.subscription,
- changedInputs: a.subscription ? e.changedInputs : {
- },
- isSaved: !!a.subscription && e.isSaved,
- saveError: a.subscription ? e.saveError : null
- });
- case te.updateInput:
- return mn(mn({
- }, e), {
- }, {
- selectedSubscription: mn(mn({
- }, e.selectedSubscription), {
- }, fn({
- }, a.name, 'checkbox' === a.evt.target.type ? a.evt.target.checked : a.evt.target.value)),
- changedInputs: mn(mn({
- }, e.changedInputs), {
- }, fn({
- }, a.name, !0))
- });
- default:
- return e
- }
- }
- var yn = {
- isFetching: !1,
- changedInputs: {
- }
- };
- function bn(t, e) {
- var n,
- a = Object.keys(t);
- return Object.getOwnPropertySymbols && (n = Object.getOwnPropertySymbols(t), e && (n = n.filter(function (e) {
- return Object.getOwnPropertyDescriptor(t, e).enumerable
- })), a.push.apply(a, n)),
- a
- }
- function vn(a) {
- for (var e = 1; e < arguments.length; e++) {
- var r = null != arguments[e] ? arguments[e] : {
- };
- e % 2 ? bn(Object(r), !0).forEach(function (e) {
- var t,
- n;
- n = r[t = e],
- t in (e = a) ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(a, Object.getOwnPropertyDescriptors(r)) : bn(Object(r)).forEach(function (e) {
- Object.defineProperty(a, e, Object.getOwnPropertyDescriptor(r, e))
- })
- }
- return a
- }
- function _n(e, t) {
- if (null == e) return {
- };
- var n,
- a = function (e, t) {
- if (null == e) return {
- };
- var n,
- a,
- r = {
- },
- o = Object.keys(e);
- for (a = 0; a < o.length; a++) ~t.indexOf(n = o[a]) || (r[n] = e[n]);
- return r
- }(e, t);
- if (Object.getOwnPropertySymbols) for (var r = Object.getOwnPropertySymbols(e), o = 0; o < r.length; o++) ~t.indexOf(n = r[o]) || Object.prototype.propertyIsEnumerable.call(e, n) && (a[n] = e[n]);
- return a
- }
- function En() {
- var e = 0 < arguments.length && void 0 !== arguments[0] ? arguments[0] : On,
- t = 1 < arguments.length ? arguments[1] : void 0,
- n = t.type,
- a = _n(t, [
- 'type'
- ]);
- switch (n) {
- case ne.update:
- return vn(vn({
- }, e), {
- }, {
- localSearchQuery: a.search
- });
- case ne.changeActive:
- return vn(vn({
- }, e), {
- }, {
- isActive: a.isActive
- });
- default:
- return e
- }
- }
- var On = {
- localSearchQuery: '',
- isActive: !1
- },
- Sn = 'https://disqus.com/support/',
- wn = 'https://help.disqus.com/customer/',
- Pn = {
- adminArticles: ''.concat(wn, 'portal/articles/545277-disqus-appearance-tweaks'),
- adminRoles: ''.concat(wn, 'portal/articles/2354460-admin-roles-and-permissions'),
- adsTxt: '//c.disquscdn.com/next/current/publisher-admin/assets/docs/ads.txt',
- adTraining: ''.concat(wn, 'portal/articles/1657951-ad-training-settings'),
- audienceAnalytics: ''.concat(wn, 'portal/articles/2717193-disqus-pro-analytics#audience-analytics'),
- badges: 'https://help.disqus.com/articles/5445956-badges',
- badgesImageCollection: 'https://s3.amazonaws.com/media.disqus.net/uploads/badges/badges-library_optimized.zip',
- basicDisqusRules: ''.concat(wn, 'portal/articles/1753105-basic-rules-for-disqus'),
- bloggerManualInstall: ''.concat(wn, 'portal/articles/888340'),
- bloggerIEFix: ''.concat(wn, 'portal/articles/1189621'),
- changePrimaryMod: ''.concat(wn, 'portal/articles/654999'),
- commentCountLinks: ''.concat(wn, 'portal/articles/565624'),
- commentPolicySuggestions: 'https://blog.disqus.com/how-to-create-an-effective-comment-policy-that-readers-actually-follow',
- contactSupport: Sn,
- developer: ''.concat(wn, 'portal/topics/107054-developers/articles'),
- discussionsEdit: ''.concat(wn, 'portal/articles/1141248'),
- emailSubscriptionPrompt: ''.concat(wn, 'portal/articles/2901101'),
- flagging: ''.concat(wn, 'portal/articles/466224'),
- githubDisqusReact: 'https://github.com/disqus/disqus-react',
- iabDisplay: ''.concat(wn, 'portal/articles/1969476#iab-display'),
- modArticles: ''.concat(wn, 'en/portal/articles/2308273-how-to-add-admins-and-moderators-to-your-organization#adding-moderators'),
- moderationRules: ''.concat(wn, 'en/portal/articles/2918046'),
- nsfwContent: ''.concat(wn, 'en/portal/articles/2285755-inappropriate-profile-content'),
- organicDiscovery: ''.concat(wn, 'en/portal/articles/1370221-discovery'),
- payments: ''.concat(wn, 'portal/articles/1208081'),
- pageIdentifiers: ''.concat(wn, 'portal/articles/472098-javascript-configuration-variables#thispageidentifier'),
- pricingAndPlans: ''.concat(wn, 'portal/articles/2759918-disqus-pricing-and-plans'),
- profileAvatar: 'http://disqus.com/profile/avatar/',
- reactionsAnalytics: 'https://help.disqus.com/en/articles/1717089-disqus-basic-analytics#h_cb7cf4d8d5',
- recommendations: 'https://help.disqus.com/en/articles/3517730-recommendations',
- standaloneRecommendations: 'https://help.disqus.com/en/articles/3517730-recommendations#standalone-recommendations',
- restrictedWordsHelp: ''.concat(wn, 'portal/articles/466238#restricted-words'),
- reveal: 'https://disqus.com/features/monetize',
- revealContact: 'https://help.disqus.com/en/articles/3787995',
- revealDeactivationContact: ''.concat(Sn, '?article=contact_dashub'),
- revealEligibility: ''.concat(wn, 'en/portal/articles/2238701-reveal-eligibility-criteria'),
- revealFAQ: ''.concat(wn, 'portal/articles/2069645'),
- sampleBadwords: '//c.disquscdn.com/next/current/publisher-admin/assets/docs/sample-badwords.txt',
- sponsoredLinks: ''.concat(wn, 'portal/articles/1969476#sponsored-links'),
- sponsoredStory: ''.concat(wn, 'portal/articles/1969476#sponsored-story'),
- sponsoredVideo: ''.concat(wn, 'portal/articles/1969476#sponsored-video'),
- splitThreads: ''.concat(wn, 'en/portal/articles/2158629'),
- suggestedActions: ''.concat(wn, 'portal/articles/2880487'),
- toxicModFilter: ''.concat(wn, 'portal/articles/2865852-toxic-mod-filter'),
- translate: 'https://disqus.com/translate/',
- tumblrManualInstall: ''.concat(wn, 'portal/articles/758168'),
- jimdoHelp: 'http://support.jimdo.com/basics/working-with-elements/widget-html/',
- typePadHelp: 'http://help.typepad.com/disqus.html',
- userReputation: ''.concat(wn, 'portal/articles/466247-user-reputation'),
- verifyAccount: ''.concat(wn, 'en/portal/articles/960202-verifying-your-disqus-account'),
- webhooks: ''.concat(wn, 'en/portal/articles/2818810'),
- wordPressCom: ''.concat(wn, 'en/portal/articles/663013'),
- yamlFrontMatter: 'http://jekyllrb.com/docs/frontmatter/'
- };
- function kn(e) {
- return function (e) {
- if (Array.isArray(e)) return Nn(e)
- }(e) || function (e) {
- if ('undefined' != typeof Symbol && null != e[Symbol.iterator] || null != e['@@iterator']) return Array.from(e)
- }(e) || function (e, t) {
- if (e) {
- if ('string' == typeof e) return Nn(e, t);
- var n = Object.prototype.toString.call(e).slice(8, - 1);
- return 'Map' === (n = 'Object' === n && e.constructor ? e.constructor.name : n) || 'Set' === n ? Array.from(e) : 'Arguments' === n || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n) ? Nn(e, t) : void 0
- }
- }(e) || function () {
- throw new TypeError('Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.')
- }()
- }
- function Nn(e, t) {
- for (var n = 0, a = Array(t = null == t || e.length < t ? e.length : t); n < t; n++) a[n] = e[n];
- return a
- }
- function Cn(t, e) {
- var n,
- a = Object.keys(t);
- return Object.getOwnPropertySymbols && (n = Object.getOwnPropertySymbols(t), e && (n = n.filter(function (e) {
- return Object.getOwnPropertyDescriptor(t, e).enumerable
- })), a.push.apply(a, n)),
- a
- }
- function Rn(t) {
- for (var e = 1; e < arguments.length; e++) {
- var n = null != arguments[e] ? arguments[e] : {
- };
- e % 2 ? Cn(Object(n), !0).forEach(function (e) {
- xn(t, e, n[e])
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(n)) : Cn(Object(n)).forEach(function (e) {
- Object.defineProperty(t, e, Object.getOwnPropertyDescriptor(n, e))
- })
- }
- return t
- }
- function xn(e, t, n) {
- return t in e ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n,
- e
- }
- function An(e) {
- return e.stopPropagation()
- }
- var Dn = {
- user: {
- authorLowRep: {
- title: 'has Low Rep',
- description: C.a.createElement('span', null, 'The ', C.a.createElement('strong', null, 'has Low Rep'), ' filter will target comments made by users that have a low reputation on the Disqus network. Reputation is platform-wide across the entire Disqus network and a user\'s reputation is the same across all Disqus-powered sites. Read more about reputation ', C.a.createElement('a', {
- onClick: An,
- href: Pn.userReputation
- }, 'here'), '.'),
- moderationFilter: {
- id: 'hasLowRep',
- name: 'Low Rep'
- },
- requiresFeature: !0
- },
- authorRecentlyFlagged: {
- title: 'Profile Reported at Least 5 Times',
- description: C.a.createElement('span', null, 'The ', C.a.createElement('strong', null, 'Profile Reported at Least 5 Times'), ' filter will target comments made by users that have been reported 5 times or more by other users in the past 30 days. The user can be flagged for harassment, spam, an inappropriate profile, posting threatening content, impersonation, or posting private information of others. Read more about user flagging ', C.a.createElement('a', {
- onClick: An,
- href: Pn.basicDisqusRules
- }, 'here'), '.'),
- requiresFeature: !0
- }
- },
- comment: {
- postContainsRestrictedWord: {
- title: 'has Restricted word',
- description: C.a.createElement('span', null, 'The ', C.a.createElement('strong', null, 'has Restricted Word'), ' filter will target comments that match a word you’ve specified in your ', C.a.createElement(v.Link, {
- onClick: An,
- to: '/settings/access/'
- }, 'restricted word list'), '. Read more about restricted words ', C.a.createElement('a', {
- onClick: An,
- href: Pn.restrictedWordsHelp
- }, 'here'), '.'),
- moderationFilter: {
- id: 'hasBadWords',
- name: 'Restricted Word'
- },
- requiresFeature: !1
- },
- postIsToxic: {
- title: 'is Toxic',
- description: C.a.createElement('span', null, 'The ', C.a.createElement('strong', null, 'is Toxic'), ' filter will target comments that may cause reasonable readers to avoid participating in discussions. We’ve partnered with ', C.a.createElement('a', {
- onClick: An,
- href: Pn.toxicModFilter
- }, 'Google’s Perspective'), ' to leverage the power of machine learning to more quickly identify and isolate these types of comments. Read more about the toxic filter ', C.a.createElement('a', {
- onClick: An,
- href: 'https://www.perspectiveapi.com/'
- }, 'here'), '.'),
- moderationFilter: {
- id: 'isToxic',
- name: 'Toxic'
- },
- requiresFeature: !1
- },
- postIsSexual: {
- title: 'is Sexual',
- description: C.a.createElement('span', null, C.a.createElement('b', null, 'Explicit'), ': Intercourse, masturbation, porn, sex toys and genitalia', C.a.createElement('br', null), C.a.createElement('b', null, 'Intent & nudity'), ': Sexual intent, nudity and lingerie', C.a.createElement('br', null), C.a.createElement('b', null, 'Statements'), ': Informational statements that are sexual in nature, affectionate activities (kissing, hugging, etc.), flirting, pet names, relationship status, sexual insults and rejecting sexual advances'),
- moderationFilter: {
- id: 'isSexual',
- name: 'Sexual'
- },
- requiresFeature: !0
- },
- postIsHate: {
- title: 'is Hate',
- description: C.a.createElement('span', null, C.a.createElement('b', null, 'Hate Speech'), ': Slurs, hate speech, promotion of hateful ideology', C.a.createElement('br', null), C.a.createElement('b', null, 'Slurs'), ': Negative stereotypes or jokes, degrading comments, denouncing slurs, challenging a protected group\'s morality or identity, violence against religion', C.a.createElement('br', null), C.a.createElement('b', null, 'Informational'), ': Positive stereotypes, informational statements, reclaimed slurs, references to hateful ideology, immorality of protected group\'s rights'),
- moderationFilter: {
- id: 'isHate',
- name: 'Hate'
- },
- requiresFeature: !0
- },
- postIsViolence: {
- title: 'is Violence',
- description: C.a.createElement('span', null, C.a.createElement('b', null, 'Intimidation'), ': Serious and realistic threats, mentions of past violence', C.a.createElement('br', null), C.a.createElement('b', null, 'Instigation'), ': Calls for violence, destruction of property, calls for military action, calls for the death penalty outside a legal setting, mentions of self-harm/suicide', C.a.createElement('br', null), C.a.createElement('b', null, 'Description'), ': Denouncing acts of violence, soft threats (kicking, punching, etc.), violence against non-human subjects, descriptions of violence, gun usage, abortion, self-defense, calls for capital punishment in a legal setting, destruction of small personal belongings, violent jokes'),
- moderationFilter: {
- id: 'isViolence',
- name: 'Violence'
- },
- requiresFeature: !0
- },
- postIsBullying: {
- title: 'is Bullying',
- description: C.a.createElement('span', null, C.a.createElement('b', null, 'Brutalizing'), ': Slurs or profane descriptors toward specific individuals, encouraging suicide or severe self-harm, severe violent threats toward specific individuals', C.a.createElement('br', null), C.a.createElement('b', null, 'Profane'), ': Non-profane insults toward specific individuals, encouraging non-severe self-harm, non-severe violent threats toward specific individuals, silencing or exclusion', C.a.createElement('br', null), C.a.createElement('b', null, 'Insults'), ': Profanity in a non-bullying context, playful teasing, self-deprecation, reclaimed slurs, degrading a person\'s belongings, bullying toward organizations, denouncing bullying'),
- moderationFilter: {
- id: 'isBullying',
- name: 'Bullying'
- },
- requiresFeature: !0
- },
- postIsPromotion: {
- title: 'is Promotion',
- description: C.a.createElement('span', null, C.a.createElement('b', null, 'Promotion'), ': Asking for likes/follows/shares, advertising monthly newsletters/special promotions, asking for donations/payments, advertising products, selling pornography, giveaways'),
- moderationFilter: {
- id: 'isPromotion',
- name: 'Promotion'
- },
- requiresFeature: !0
- },
- postContainsLink: {
- title: 'Contains link',
- description: C.a.createElement('span', null, 'The ', C.a.createElement('strong', null, 'Contains Link'), ' filter will target any comments that contain a link.'),
- moderationFilter: {
- id: 'hasLinks',
- name: 'Contains Link'
- },
- requiresFeature: !0
- },
- postHasMedia: {
- title: 'Contains media',
- description: C.a.createElement('span', null, 'The ', C.a.createElement('strong', null, 'Contains Media'), ' filter will target any comments that contain a media.'),
- moderationFilter: {
- id: 'hasMedia',
- name: 'Contains Media'
- },
- requiresFeature: !0
- }
- }
- },
- jn = {
- approve: {
- past: 'Approved'
- },
- pending: {
- present: 'Send to Pending',
- past: 'Pending'
- },
- delete : {
- present: 'Delete',
- past: 'Deleted'
- },
- spam: {
- present: 'Mark as Spam',
- past: 'Marked as Spam'
- }
- },
- Tn = Object.keys(Dn),
- In = Tn.reduce(function (e, n) {
- return Rn(Rn({
- }, e), Object.keys(Dn[n]).reduce(function (e, t) {
- return Rn(Rn({
- }, e), {
- }, xn({
- }, t, n))
- }, {
- }))
- }, {
- }),
- qn = {
- id: b.a.string.isRequired,
- type: b.a.oneOf([].concat(kn(Tn), [
- ''
- ])),
- action: b.a.oneOf([].concat(kn(Object.keys(jn).filter(function (e) {
- return jn[e].present
- })), [
- ''
- ])),
- filter: b.a.oneOf([].concat(kn(Object.keys(In)), [
- ''
- ])),
- severity: b.a.string,
- enabled: b.a.bool.isRequired,
- isNew: b.a.bool,
- isDirty: b.a.bool
- },
- Fn = [
- 'delete',
- 'spam',
- 'approve',
- 'pending'
- ].reduce(function (e, t) {
- return e[t] = b.a.number,
- e
- }, {
- }),
- Ln = Tn.reduce(function (e, t) {
- return e[t] = b.a.shape(Object.keys(Dn[t]).reduce(function (e, t) {
- return e[t] = Fn,
- e
- }, {
- })),
- e
- }, {
- }),
- Un = {
- postIsHate: {
- 3: '3 - Hate Speech',
- 2: '2 - Slurs',
- 1: '1 - Informational'
- },
- postIsViolence: {
- 3: '3 - Intimidation',
- 2: '2 - Instigation',
- 1: '1 - Description'
- },
- postIsBullying: {
- 3: '3 - Brutalizing',
- 2: '2 - Profane',
- 1: '1 - Insults'
- },
- postIsSexual: {
- 3: '3 - Explicit',
- 2: '2 - Intent & nudity',
- 1: '1 - Statements'
- }
- };
- function Mn(t, e) {
- var n,
- a = Object.keys(t);
- return Object.getOwnPropertySymbols && (n = Object.getOwnPropertySymbols(t), e && (n = n.filter(function (e) {
- return Object.getOwnPropertyDescriptor(t, e).enumerable
- })), a.push.apply(a, n)),
- a
- }
- function Bn(a) {
- for (var e = 1; e < arguments.length; e++) {
- var r = null != arguments[e] ? arguments[e] : {
- };
- e % 2 ? Mn(Object(r), !0).forEach(function (e) {
- var t,
- n;
- n = r[t = e],
- t in (e = a) ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(a, Object.getOwnPropertyDescriptors(r)) : Mn(Object(r)).forEach(function (e) {
- Object.defineProperty(a, e, Object.getOwnPropertyDescriptor(r, e))
- })
- }
- return a
- }
- function zn(e, t) {
- if (null == e) return {
- };
- var n,
- a = function (e, t) {
- if (null == e) return {
- };
- var n,
- a,
- r = {
- },
- o = Object.keys(e);
- for (a = 0; a < o.length; a++) ~t.indexOf(n = o[a]) || (r[n] = e[n]);
- return r
- }(e, t);
- if (Object.getOwnPropertySymbols) for (var r = Object.getOwnPropertySymbols(e), o = 0; o < r.length; o++) ~t.indexOf(n = r[o]) || Object.prototype.propertyIsEnumerable.call(e, n) && (a[n] = e[n]);
- return a
- }
- function Hn(e) {
- return e.sort(function (e, t) {
- return e.order - t.order
- }).map(function (e) {
- return {
- id: ''.concat(e.id),
- type: In[e.filterName],
- action: e.action,
- filter: e.filterName,
- severity: e.filter && '' + e.filter.value,
- enabled: e.enabled
- }
- })
- }
- function Gn() {
- var e = 0 < arguments.length && void 0 !== arguments[0] ? arguments[0] : Vn,
- t = 1 < arguments.length ? arguments[1] : void 0,
- n = t.type,
- a = zn(t, [
- 'type'
- ]);
- switch (n) {
- case oe.rulesFetching:
- return Bn(Bn({
- }, e), {
- }, {
- rulesAreFetching: !0
- });
- case oe.onFetchRules:
- return Bn(Bn({
- }, e), {
- }, {
- rulesAreFetching: !1,
- rules: Hn(a.response)
- });
- case oe.onFetchModerationHistory:
- return Bn(Bn({
- }, e), {
- }, {
- moderationHistory: a.response.filterStats
- });
- case oe.rulesSaving:
- return Bn(Bn({
- }, e), {
- }, {
- rulesAreSaving: !0,
- rulesAreSaved: !1,
- rulesSaveFailed: !1,
- rulesSaveError: ''
- });
- case oe.onSaveRules:
- return Bn(Bn({
- }, e), {
- }, {
- rulesAreSaving: !1,
- rulesAreSaved: !0,
- rulesSaveFailed: !1,
- rulesSaveError: '',
- rules: Hn(a.response)
- });
- case oe.onSaveRulesError:
- return Bn(Bn({
- }, e), {
- }, {
- rulesAreSaving: !1,
- rulesAreSaved: !1,
- rulesSaveFailed: !0,
- rulesSaveError: 'There was an error saving your moderation rules.'
- });
- default:
- return e
- }
- }
- var Vn = {
- rules: [
- ],
- rulesAreFetching: !1,
- rulesAreSaving: !1,
- rulesAreSaved: !1,
- rulesSaveFailed: !1,
- rulesSaveError: ''
- },
- Wn = n(51),
- Yn = n.n(Wn);
- function Qn(t, e) {
- var n,
- a = Object.keys(t);
- return Object.getOwnPropertySymbols && (n = Object.getOwnPropertySymbols(t), e && (n = n.filter(function (e) {
- return Object.getOwnPropertyDescriptor(t, e).enumerable
- })), a.push.apply(a, n)),
- a
- }
- function Kn(a) {
- for (var e = 1; e < arguments.length; e++) {
- var r = null != arguments[e] ? arguments[e] : {
- };
- e % 2 ? Qn(Object(r), !0).forEach(function (e) {
- var t,
- n;
- n = r[t = e],
- t in (e = a) ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(a, Object.getOwnPropertyDescriptors(r)) : Qn(Object(r)).forEach(function (e) {
- Object.defineProperty(a, e, Object.getOwnPropertyDescriptor(r, e))
- })
- }
- return a
- }
- function Jn(e, t) {
- if (null == e) return {
- };
- var n,
- a = function (e, t) {
- if (null == e) return {
- };
- var n,
- a,
- r = {
- },
- o = Object.keys(e);
- for (a = 0; a < o.length; a++) ~t.indexOf(n = o[a]) || (r[n] = e[n]);
- return r
- }(e, t);
- if (Object.getOwnPropertySymbols) for (var r = Object.getOwnPropertySymbols(e), o = 0; o < r.length; o++) ~t.indexOf(n = r[o]) || Object.prototype.propertyIsEnumerable.call(e, n) && (a[n] = e[n]);
- return a
- }
- function $n() {
- var e = 0 < arguments.length && void 0 !== arguments[0] ? arguments[0] : Zn,
- t = 1 < arguments.length ? arguments[1] : void 0,
- n = t.type,
- a = Jn(t, [
- 'type'
- ]);
- switch (n) {
- case re.updateModal:
- return Kn(Kn({
- }, e), {
- }, {
- modalIsOpen: 'boolean' == typeof a.isOpen ? a.isOpen : e.modalIsOpen,
- listType: ('string' == typeof a.listType ? a : e).listType,
- modalFormValues: a.formValues || Wn.DEFAULT_FORM_VALUES,
- postId: a.postId || e.postId,
- author: a.author || e.author
- });
- case re.updateBanFormValues:
- return Kn(Kn({
- }, e), {
- }, {
- banType: a.banType
- });
- case re.resetDefault:
- return Zn;
- default:
- return e
- }
- }
- var Zn = {
- modalIsOpen: !1,
- listType: null,
- banType: null,
- modalFormValues: Wn.DEFAULT_FORM_VALUES,
- postId: null,
- author: null
- };
- function Xn(t, e) {
- var n,
- a = Object.keys(t);
- return Object.getOwnPropertySymbols && (n = Object.getOwnPropertySymbols(t), e && (n = n.filter(function (e) {
- return Object.getOwnPropertyDescriptor(t, e).enumerable
- })), a.push.apply(a, n)),
- a
- }
- function ea(a) {
- for (var e = 1; e < arguments.length; e++) {
- var r = null != arguments[e] ? arguments[e] : {
- };
- e % 2 ? Xn(Object(r), !0).forEach(function (e) {
- var t,
- n;
- n = r[t = e],
- t in (e = a) ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(a, Object.getOwnPropertyDescriptors(r)) : Xn(Object(r)).forEach(function (e) {
- Object.defineProperty(a, e, Object.getOwnPropertyDescriptor(r, e))
- })
- }
- return a
- }
- function ta(e, t) {
- if (null == e) return {
- };
- var n,
- a = function (e, t) {
- if (null == e) return {
- };
- var n,
- a,
- r = {
- },
- o = Object.keys(e);
- for (a = 0; a < o.length; a++) ~t.indexOf(n = o[a]) || (r[n] = e[n]);
- return r
- }(e, t);
- if (Object.getOwnPropertySymbols) for (var r = Object.getOwnPropertySymbols(e), o = 0; o < r.length; o++) ~t.indexOf(n = r[o]) || Object.prototype.propertyIsEnumerable.call(e, n) && (a[n] = e[n]);
- return a
- }
- function na(e) {
- var t;
- try {
- ~(t = JSON.parse(e.responseText).response).indexOf('Invalid argument, \'user\': User matching query does not exist') && (t = 'No user found with this username.')
- } catch (e) {
- t = 'There was an unknown error.'
- }
- return t
- }
- function aa() {
- var e = 0 < arguments.length && void 0 !== arguments[0] ? arguments[0] : ra,
- t = 1 < arguments.length ? arguments[1] : void 0,
- n = t.type,
- a = ta(t, [
- 'type'
- ]);
- switch (n) {
- case ie.fetching:
- return ea(ea({
- }, e), {
- }, {
- orgAdminIsFetching: !0,
- orgAdminFetchError: null
- });
- case ie.onFetch:
- return ea(ea({
- }, e), {
- }, {
- orgAdminList: a.orgAdminList.filter(function (e) {
- return !e.user.isAnonymous
- }),
- orgAdminIsFetching: !1,
- orgAdminFetchError: null
- });
- case ie.onFetchError:
- return ea(ea({
- }, e), {
- }, {
- orgAdminIsFetching: !1,
- orgAdminFetchError: na(a)
- });
- case ie.saving:
- return ea(ea({
- }, e), {
- }, {
- orgAdminIsSaving: !0,
- orgAdminIsSaved: !1,
- orgAdminSaveError: null
- });
- case ie.onSave:
- return ea(ea({
- }, e), {
- }, {
- orgAdminIsSaving: !1,
- orgAdminIsSaved: !0,
- orgAdminSaveError: null
- });
- case ie.onSaveError:
- return ea(ea({
- }, e), {
- }, {
- orgAdminIsSaving: !1,
- orgAdminIsSaved: !1,
- orgAdminSaveError: na(a)
- });
- default:
- return e
- }
- }
- var ra = {
- orgAdminList: [
- ],
- orgAdminIsFetching: !1,
- orgAdminFetchError: null,
- orgAdminIsSaving: !1,
- orgAdminIsSaved: !1,
- orgAdminSaveError: null
- };
- function oa(t, e) {
- var n,
- a = Object.keys(t);
- return Object.getOwnPropertySymbols && (n = Object.getOwnPropertySymbols(t), e && (n = n.filter(function (e) {
- return Object.getOwnPropertyDescriptor(t, e).enumerable
- })), a.push.apply(a, n)),
- a
- }
- function ia(a) {
- for (var e = 1; e < arguments.length; e++) {
- var r = null != arguments[e] ? arguments[e] : {
- };
- e % 2 ? oa(Object(r), !0).forEach(function (e) {
- var t,
- n;
- n = r[t = e],
- t in (e = a) ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(a, Object.getOwnPropertyDescriptors(r)) : oa(Object(r)).forEach(function (e) {
- Object.defineProperty(a, e, Object.getOwnPropertyDescriptor(r, e))
- })
- }
- return a
- }
- function sa(e, t) {
- if (null == e) return {
- };
- var n,
- a = function (e, t) {
- if (null == e) return {
- };
- var n,
- a,
- r = {
- },
- o = Object.keys(e);
- for (a = 0; a < o.length; a++) ~t.indexOf(n = o[a]) || (r[n] = e[n]);
- return r
- }(e, t);
- if (Object.getOwnPropertySymbols) for (var r = Object.getOwnPropertySymbols(e), o = 0; o < r.length; o++) ~t.indexOf(n = r[o]) || Object.prototype.propertyIsEnumerable.call(e, n) && (a[n] = e[n]);
- return a
- }
- function la() {
- var e = 0 < arguments.length && void 0 !== arguments[0] ? arguments[0] : ca,
- t = 1 < arguments.length ? arguments[1] : void 0,
- n = t.type,
- a = sa(t, [
- 'type'
- ]);
- switch (n) {
- case se.fetching:
- return ia(ia({
- }, e), {
- }, {
- orgForumsIsFetching: !0,
- orgForumsError: null
- });
- case se.onFetch:
- return ia(ia({
- }, e), {
- }, {
- orgForumsList: a.forumList,
- orgForumsHasMore: a.cursor.hasNext,
- orgForumsCursor: a.cursor,
- orgForumsIsFetching: !1,
- orgForumsError: null
- });
- case se.onFetchMore:
- return ia(ia({
- }, e), {
- }, {
- orgForumsList: e.orgForumsList.concat(a.forumList),
- orgForumsHasMore: a.cursor.hasNext,
- orgForumsCursor: a.cursor,
- orgForumsIsFetching: !1,
- orgForumsError: null
- });
- case se.onFetchError:
- return ia(ia({
- }, e), {
- }, {
- orgForumsIsFetching: !1,
- orgForumsError: 'There was an error retrieving the sites for this organization.'
- });
- default:
- return e
- }
- }
- var ca = {
- orgForumsList: [
- ],
- orgForumsIsFetching: !1,
- orgForumsHasMore: !1,
- orgForumsError: null,
- orgForumsCursor: {
- }
- };
- function ua(t, e) {
- var n,
- a = Object.keys(t);
- return Object.getOwnPropertySymbols && (n = Object.getOwnPropertySymbols(t), e && (n = n.filter(function (e) {
- return Object.getOwnPropertyDescriptor(t, e).enumerable
- })), a.push.apply(a, n)),
- a
- }
- function pa(a) {
- for (var e = 1; e < arguments.length; e++) {
- var r = null != arguments[e] ? arguments[e] : {
- };
- e % 2 ? ua(Object(r), !0).forEach(function (e) {
- var t,
- n;
- n = r[t = e],
- t in (e = a) ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(a, Object.getOwnPropertyDescriptors(r)) : ua(Object(r)).forEach(function (e) {
- Object.defineProperty(a, e, Object.getOwnPropertyDescriptor(r, e))
- })
- }
- return a
- }
- function da(e, t) {
- if (null == e) return {
- };
- var n,
- a = function (e, t) {
- if (null == e) return {
- };
- var n,
- a,
- r = {
- },
- o = Object.keys(e);
- for (a = 0; a < o.length; a++) ~t.indexOf(n = o[a]) || (r[n] = e[n]);
- return r
- }(e, t);
- if (Object.getOwnPropertySymbols) for (var r = Object.getOwnPropertySymbols(e), o = 0; o < r.length; o++) ~t.indexOf(n = r[o]) || Object.prototype.propertyIsEnumerable.call(e, n) && (a[n] = e[n]);
- return a
- }
- function ma() {
- var e = 0 < arguments.length && void 0 !== arguments[0] ? arguments[0] : fa,
- t = 1 < arguments.length ? arguments[1] : void 0,
- n = t.type,
- a = da(t, [
- 'type'
- ]);
- switch (n) {
- case J.saving:
- return pa(pa({
- }, e), {
- }, {
- policyIsSaving: !0
- });
- case J.onSave:
- return pa(pa({
- }, e), {
- }, {
- policyIsSaving: !1
- });
- case J.setApiCall:
- return pa(pa({
- }, e), {
- }, {
- apiCall: a.apiCall
- });
- default:
- return e
- }
- }
- var fa = {
- apiCall: null,
- policyIsSaving: !1
- };
- function ha(t, e) {
- var n,
- a = Object.keys(t);
- return Object.getOwnPropertySymbols && (n = Object.getOwnPropertySymbols(t), e && (n = n.filter(function (e) {
- return Object.getOwnPropertyDescriptor(t, e).enumerable
- })), a.push.apply(a, n)),
- a
- }
- function ga(a) {
- for (var e = 1; e < arguments.length; e++) {
- var r = null != arguments[e] ? arguments[e] : {
- };
- e % 2 ? ha(Object(r), !0).forEach(function (e) {
- var t,
- n;
- n = r[t = e],
- t in (e = a) ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(a, Object.getOwnPropertyDescriptors(r)) : ha(Object(r)).forEach(function (e) {
- Object.defineProperty(a, e, Object.getOwnPropertyDescriptor(r, e))
- })
- }
- return a
- }
- function ya(e, t) {
- if (null == e) return {
- };
- var n,
- a = function (e, t) {
- if (null == e) return {
- };
- var n,
- a,
- r = {
- },
- o = Object.keys(e);
- for (a = 0; a < o.length; a++) ~t.indexOf(n = o[a]) || (r[n] = e[n]);
- return r
- }(e, t);
- if (Object.getOwnPropertySymbols) for (var r = Object.getOwnPropertySymbols(e), o = 0; o < r.length; o++) ~t.indexOf(n = r[o]) || Object.prototype.propertyIsEnumerable.call(e, n) && (a[n] = e[n]);
- return a
- }
- function ba() {
- var e = 0 < arguments.length && void 0 !== arguments[0] ? arguments[0] : va,
- t = 1 < arguments.length ? arguments[1] : void 0,
- n = t.type,
- a = ya(t, [
- 'type'
- ]);
- switch (n) {
- case ce.isSyncing:
- return ga(ga({
- }, e), {
- }, {
- isSyncing: !0
- });
- case ce.isFetching:
- return ga(ga({
- }, e), {
- }, {
- isFetching: !0
- });
- case ce.onFetch:
- return ga(ga({
- }, e), {
- }, {
- isFetching: !1,
- isSyncing: !1,
- poll: a.response
- });
- case ce.onSave:
- return ga(ga({
- }, e), {
- }, {
- isSyncing: !1,
- poll: a.response
- });
- case ce.onDelete:
- return ga(ga({
- }, e), {
- }, {
- isSyncing: !1
- });
- case ce.onPublish:
- return ga(ga({
- }, e), {
- }, {
- isSyncing: !1,
- poll: ga(ga({
- }, e.poll), {
- }, {
- published: !0
- })
- });
- case ce.onPreview:
- return ga(ga({
- }, e), {
- }, {
- isSyncing: !1
- });
- case ce.reset:
- return ga({
- }, va);
- default:
- return e
- }
- }
- var va = {
- poll: null,
- isSyncing: !1,
- isFetching: !1
- };
- function _a(e) {
- return function (e) {
- if (Array.isArray(e)) return Ea(e)
- }(e) || function (e) {
- if ('undefined' != typeof Symbol && null != e[Symbol.iterator] || null != e['@@iterator']) return Array.from(e)
- }(e) || function (e, t) {
- if (e) {
- if ('string' == typeof e) return Ea(e, t);
- var n = Object.prototype.toString.call(e).slice(8, - 1);
- return 'Map' === (n = 'Object' === n && e.constructor ? e.constructor.name : n) || 'Set' === n ? Array.from(e) : 'Arguments' === n || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n) ? Ea(e, t) : void 0
- }
- }(e) || function () {
- throw new TypeError('Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.')
- }()
- }
- function Ea(e, t) {
- for (var n = 0, a = Array(t = null == t || e.length < t ? e.length : t); n < t; n++) a[n] = e[n];
- return a
- }
- function Oa(t, e) {
- var n,
- a = Object.keys(t);
- return Object.getOwnPropertySymbols && (n = Object.getOwnPropertySymbols(t), e && (n = n.filter(function (e) {
- return Object.getOwnPropertyDescriptor(t, e).enumerable
- })), a.push.apply(a, n)),
- a
- }
- function Sa(a) {
- for (var e = 1; e < arguments.length; e++) {
- var r = null != arguments[e] ? arguments[e] : {
- };
- e % 2 ? Oa(Object(r), !0).forEach(function (e) {
- var t,
- n;
- n = r[t = e],
- t in (e = a) ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(a, Object.getOwnPropertyDescriptors(r)) : Oa(Object(r)).forEach(function (e) {
- Object.defineProperty(a, e, Object.getOwnPropertyDescriptor(r, e))
- })
- }
- return a
- }
- function wa(e, t) {
- if (null == e) return {
- };
- var n,
- a = function (e, t) {
- if (null == e) return {
- };
- var n,
- a,
- r = {
- },
- o = Object.keys(e);
- for (a = 0; a < o.length; a++) ~t.indexOf(n = o[a]) || (r[n] = e[n]);
- return r
- }(e, t);
- if (Object.getOwnPropertySymbols) for (var r = Object.getOwnPropertySymbols(e), o = 0; o < r.length; o++) ~t.indexOf(n = r[o]) || Object.prototype.propertyIsEnumerable.call(e, n) && (a[n] = e[n]);
- return a
- }
- function Pa() {
- var e = 0 < arguments.length && void 0 !== arguments[0] ? arguments[0] : ka,
- t = 1 < arguments.length ? arguments[1] : void 0,
- n = t.type,
- a = wa(t, [
- 'type'
- ]);
- switch (n) {
- case ue.updateSearchQuery:
- return Sa(Sa({
- }, e), {
- }, {
- searchQuery: a.searchQuery
- });
- case ue.isFetching:
- return Sa(Sa({
- }, e), {
- }, {
- isFetching: !0
- });
- case ue.onFetch:
- return Sa(Sa({
- }, e), {
- }, {
- isFetching: !1,
- polls: a.shouldAppend ? [
- ].concat(_a(e.polls), _a(a.response)) : a.response,
- cursor: a.cursor,
- hasNext: a.cursor && a.cursor.hasNext,
- total: a.cursor && a.cursor.total,
- searchQuery: a.query
- });
- case ue.onDelete:
- return Sa(Sa({
- }, e), {
- }, {
- polls: e.polls.filter(function (e) {
- return e.id !== a.pollId
- }),
- total: e.total - 1
- });
- case ue.reset:
- return Sa({
- }, ka);
- default:
- return e
- }
- }
- var ka = {
- searchQuery: '',
- polls: [
- ],
- isFetching: !1,
- cursor: {
- },
- hasNext: !1,
- total: 0
- };
- function Na(t, e) {
- var n,
- a = Object.keys(t);
- return Object.getOwnPropertySymbols && (n = Object.getOwnPropertySymbols(t), e && (n = n.filter(function (e) {
- return Object.getOwnPropertyDescriptor(t, e).enumerable
- })), a.push.apply(a, n)),
- a
- }
- function Ca(a) {
- for (var e = 1; e < arguments.length; e++) {
- var r = null != arguments[e] ? arguments[e] : {
- };
- e % 2 ? Na(Object(r), !0).forEach(function (e) {
- var t,
- n;
- n = r[t = e],
- t in (e = a) ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(a, Object.getOwnPropertyDescriptors(r)) : Na(Object(r)).forEach(function (e) {
- Object.defineProperty(a, e, Object.getOwnPropertyDescriptor(r, e))
- })
- }
- return a
- }
- function Ra(e, t) {
- if (null == e) return {
- };
- var n,
- a = function (e, t) {
- if (null == e) return {
- };
- var n,
- a,
- r = {
- },
- o = Object.keys(e);
- for (a = 0; a < o.length; a++) ~t.indexOf(n = o[a]) || (r[n] = e[n]);
- return r
- }(e, t);
- if (Object.getOwnPropertySymbols) for (var r = Object.getOwnPropertySymbols(e), o = 0; o < r.length; o++) ~t.indexOf(n = r[o]) || Object.prototype.propertyIsEnumerable.call(e, n) && (a[n] = e[n]);
- return a
- }
- function xa() {
- return (xa = Object.assign || function (e) {
- for (var t = 1; t < arguments.length; t++) {
- var n,
- a = arguments[t];
- for (n in a) Object.prototype.hasOwnProperty.call(a, n) && (e[n] = a[n])
- }
- return e
- }).apply(this, arguments)
- }
- function Aa(e) {
- var t;
- try {
- ~(t = JSON.parse(e.responseText).response).indexOf('Invalid argument, \'user\': User matching query does not exist') && (t = 'No user found with this username.')
- } catch (e) {
- t = 'There was an unknown error.'
- }
- return t
- }
- function Da(e, t) {
- return e.map(function (e) {
- return e.user.username === t.username ? xa({
- }, e, t.permissions) : e
- })
- }
- function ja() {
- var e = 0 < arguments.length && void 0 !== arguments[0] ? arguments[0] : Ta,
- t = 1 < arguments.length ? arguments[1] : void 0,
- n = t.type,
- a = Ra(t, [
- 'type'
- ]);
- switch (n) {
- case X.fetching:
- return Ca(Ca({
- }, e), {
- }, {
- isFetching: !0,
- fetchError: null
- });
- case X.onFetch:
- return Ca(Ca({
- }, e), {
- }, {
- pollModeratorList: a.moderatorList.filter(function (e) {
- return 'None' !== e.id
- }),
- isFetching: !1,
- fetchError: null
- });
- case X.onFetchError:
- return Ca(Ca({
- }, e), {
- }, {
- isFetching: !1,
- fetchError: Aa(a)
- });
- case X.saving:
- return Ca(Ca({
- }, e), {
- }, {
- isSaving: !0,
- saveError: null
- });
- case X.onSave:
- return Ca(Ca({
- }, e), {
- }, {
- isSaving: !1,
- saveError: null
- });
- case X.onSaveError:
- return Ca(Ca({
- }, e), {
- }, {
- isSaving: !1,
- saveError: Aa(a)
- });
- case X.updating:
- return Ca(Ca({
- }, e), {
- }, {
- pollModeratorList: Da(e.pollModeratorList, a),
- isUpdating: !0,
- updateError: null
- });
- case X.onUpdate:
- return Ca(Ca({
- }, e), {
- }, {
- pollModeratorList: Da(e.pollModeratorList, a),
- isUpdating: !1,
- updateError: null
- });
- case X.onUpdateError:
- return Ca(Ca({
- }, e), {
- }, {
- pollModeratorList: Da(e.pollModeratorList, a),
- isUpdating: !1,
- updateError: Aa(a)
- });
- default:
- return e
- }
- }
- var Ta = {
- pollModeratorList: [
- ],
- isFetching: !1,
- fetchError: null,
- isSaving: !1,
- saveError: null,
- isUpdating: !1,
- updateError: null
- };
- function Ia(t, e) {
- var n,
- a = Object.keys(t);
- return Object.getOwnPropertySymbols && (n = Object.getOwnPropertySymbols(t), e && (n = n.filter(function (e) {
- return Object.getOwnPropertyDescriptor(t, e).enumerable
- })), a.push.apply(a, n)),
- a
- }
- function qa(a) {
- for (var e = 1; e < arguments.length; e++) {
- var r = null != arguments[e] ? arguments[e] : {
- };
- e % 2 ? Ia(Object(r), !0).forEach(function (e) {
- var t,
- n;
- n = r[t = e],
- t in (e = a) ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(a, Object.getOwnPropertyDescriptors(r)) : Ia(Object(r)).forEach(function (e) {
- Object.defineProperty(a, e, Object.getOwnPropertyDescriptor(r, e))
- })
- }
- return a
- }
- function Fa(e, t) {
- if (null == e) return {
- };
- var n,
- a = function (e, t) {
- if (null == e) return {
- };
- var n,
- a,
- r = {
- },
- o = Object.keys(e);
- for (a = 0; a < o.length; a++) ~t.indexOf(n = o[a]) || (r[n] = e[n]);
- return r
- }(e, t);
- if (Object.getOwnPropertySymbols) for (var r = Object.getOwnPropertySymbols(e), o = 0; o < r.length; o++) ~t.indexOf(n = r[o]) || Object.prototype.propertyIsEnumerable.call(e, n) && (a[n] = e[n]);
- return a
- }
- function La() {
- var e = 0 < arguments.length && void 0 !== arguments[0] ? arguments[0] : Ua,
- t = 1 < arguments.length ? arguments[1] : void 0,
- n = t.type,
- a = Fa(t, [
- 'type'
- ]);
- switch (n) {
- case pe.isFetching:
- return qa(qa({
- }, e), {
- }, {
- isFetching: !0
- });
- case pe.onFetch:
- return qa(qa({
- }, e), {
- }, {
- pollStats: a.response,
- isFetching: !1
- });
- default:
- return e
- }
- }
- var Ua = {
- pollStats: {
- activePolls: 0,
- respondents: 0,
- responseRate: 0
- },
- isFetching: !1
- };
- function Ma(t, e) {
- var n,
- a = Object.keys(t);
- return Object.getOwnPropertySymbols && (n = Object.getOwnPropertySymbols(t), e && (n = n.filter(function (e) {
- return Object.getOwnPropertyDescriptor(t, e).enumerable
- })), a.push.apply(a, n)),
- a
- }
- function Ba(t) {
- for (var e = 1; e < arguments.length; e++) {
- var n = null != arguments[e] ? arguments[e] : {
- };
- e % 2 ? Ma(Object(n), !0).forEach(function (e) {
- za(t, e, n[e])
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(n)) : Ma(Object(n)).forEach(function (e) {
- Object.defineProperty(t, e, Object.getOwnPropertyDescriptor(n, e))
- })
- }
- return t
- }
- function za(e, t, n) {
- return t in e ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n,
- e
- }
- function Ha(e, t) {
- if (null == e) return {
- };
- var n,
- a = function (e, t) {
- if (null == e) return {
- };
- var n,
- a,
- r = {
- },
- o = Object.keys(e);
- for (a = 0; a < o.length; a++) ~t.indexOf(n = o[a]) || (r[n] = e[n]);
- return r
- }(e, t);
- if (Object.getOwnPropertySymbols) for (var r = Object.getOwnPropertySymbols(e), o = 0; o < r.length; o++) ~t.indexOf(n = r[o]) || Object.prototype.propertyIsEnumerable.call(e, n) && (a[n] = e[n]);
- return a
- }
- function Ga() {
- var e = 0 < arguments.length && void 0 !== arguments[0] ? arguments[0] : Va,
- t = 1 < arguments.length ? arguments[1] : void 0,
- n = t.type,
- a = Ha(t, [
- 'type'
- ]);
- switch (n) {
- case de.isFetching:
- return Ba(Ba({
- }, e), {
- }, {
- isFetching: !0
- });
- case de.isFetchingDetails:
- return Ba(Ba({
- }, e), {
- }, {
- isFetchingDetails: !0
- });
- case de.onFetchTotalResponsesReport:
- return Ba(Ba({
- }, e), {
- }, {
- isFetching: !1,
- totalResponsesReport: Ba({
- }, a.response)
- });
- case de.onFetchPollResponsesReport:
- return Ba(Ba({
- }, e), {
- }, {
- isFetching: !1,
- pollResponsesReport: Ba({
- }, a.response)
- });
- case de.onFetchPollBreakdownReport:
- return Ba(Ba({
- }, e), {
- }, {
- isFetching: !1,
- pollBreakdownReport: Ba({
- }, a.response)
- });
- case de.onFetchPollDetails:
- return Ba(Ba({
- }, e), {
- }, {
- isFetchingDetails: !1,
- pollDetails: Ba(Ba({
- }, e.pollDetails), {
- }, za({
- }, a.response.id, a.response))
- });
- default:
- return e
- }
- }
- var Va = {
- totalResponsesReport: {
- responses: 0,
- impressions: 0,
- respondents: 0,
- response_rate: 0,
- impressions_series: [
- ],
- responses_series: [
- ],
- response_rate_series: [
- ]
- },
- pollResponsesReport: {
- },
- pollBreakdownReport: {
- total_responses: 0,
- questions: [
- ]
- },
- pollDetails: {
- },
- isFetching: !1,
- isFetchingDetails: !1
- };
- function Wa(e) {
- return function (e) {
- if (Array.isArray(e)) return Ya(e)
- }(e) || function (e) {
- if ('undefined' != typeof Symbol && null != e[Symbol.iterator] || null != e['@@iterator']) return Array.from(e)
- }(e) || function (e, t) {
- if (e) {
- if ('string' == typeof e) return Ya(e, t);
- var n = Object.prototype.toString.call(e).slice(8, - 1);
- return 'Map' === (n = 'Object' === n && e.constructor ? e.constructor.name : n) || 'Set' === n ? Array.from(e) : 'Arguments' === n || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n) ? Ya(e, t) : void 0
- }
- }(e) || function () {
- throw new TypeError('Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.')
- }()
- }
- function Ya(e, t) {
- for (var n = 0, a = Array(t = null == t || e.length < t ? e.length : t); n < t; n++) a[n] = e[n];
- return a
- }
- function Qa(t, e) {
- var n,
- a = Object.keys(t);
- return Object.getOwnPropertySymbols && (n = Object.getOwnPropertySymbols(t), e && (n = n.filter(function (e) {
- return Object.getOwnPropertyDescriptor(t, e).enumerable
- })), a.push.apply(a, n)),
- a
- }
- function Ka(a) {
- for (var e = 1; e < arguments.length; e++) {
- var r = null != arguments[e] ? arguments[e] : {
- };
- e % 2 ? Qa(Object(r), !0).forEach(function (e) {
- var t,
- n;
- n = r[t = e],
- t in (e = a) ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(a, Object.getOwnPropertyDescriptors(r)) : Qa(Object(r)).forEach(function (e) {
- Object.defineProperty(a, e, Object.getOwnPropertyDescriptor(r, e))
- })
- }
- return a
- }
- function Ja(e, t) {
- if (null == e) return {
- };
- var n,
- a = function (e, t) {
- if (null == e) return {
- };
- var n,
- a,
- r = {
- },
- o = Object.keys(e);
- for (a = 0; a < o.length; a++) ~t.indexOf(n = o[a]) || (r[n] = e[n]);
- return r
- }(e, t);
- if (Object.getOwnPropertySymbols) for (var r = Object.getOwnPropertySymbols(e), o = 0; o < r.length; o++) ~t.indexOf(n = r[o]) || Object.prototype.propertyIsEnumerable.call(e, n) && (a[n] = e[n]);
- return a
- }
- function $a() {
- var e = 0 < arguments.length && void 0 !== arguments[0] ? arguments[0] : Za,
- t = 1 < arguments.length ? arguments[1] : void 0,
- n = t.type,
- a = Ja(t, [
- 'type'
- ]);
- switch (n) {
- case me.fetchReactions:
- return Ka(Ka({
- }, e), {
- }, {
- isFetching: !0,
- error: null
- });
- case me.onFetch:
- var r = !a.reactions || !a.reactions.length || a.reactions.every(function (e) {
- return e.imageUrl
- });
- return Ka(Ka({
- }, e), {
- }, {
- isFetching: !1,
- templateId: a.reactions && a.reactions.length && a.reactions[0].template || null,
- reactions: a.reactions ? a.reactions.map(function (e) {
- return {
- text: e.text,
- imageUrl: e.imageUrl,
- imageID: e.image
- }
- }) : [
- ],
- customImages: a.images.length ? a.images.filter(function (e) {
- return e.forum
- }).map(function (e) {
- return {
- imageID: e.id,
- imageUrl: e.url
- }
- }) : [
- ],
- prompt: a.prompt,
- hadPreviousReactions: !!a.reactions.length,
- reactionsEnabled: a.enabled,
- includesImages: r
- });
- case me.onFetchDefaultReactions:
- return Ka(Ka({
- }, e), {
- }, {
- defaultReactions: Wa(a.payload)
- });
- case me.onError:
- return Ka(Ka({
- }, e), {
- }, {
- isFetching: !1,
- isSaving: !1,
- error: a.message || 'We couldn\'t retrieve your reactions. Try again later.'
- });
- case me.saveReactions:
- return Ka(Ka({
- }, e), {
- }, {
- isSaving: !0,
- isSaved: !1,
- error: null
- });
- case me.onSave:
- return Ka(Ka({
- }, e), {
- }, {
- isSaving: !1,
- isSaved: !0
- });
- case me.onDisable:
- return Ka(Ka({
- }, e), {
- }, {
- reactionsEnabled: !1
- });
- default:
- return e
- }
- }
- var Za = {
- reactions: [
- ],
- defaultReactions: [
- ],
- customImages: [
- ],
- prompt: null,
- hadPreviousReactions: !1,
- isFetching: !1,
- isSaving: !1,
- isSaved: !1,
- error: null,
- reactionsEnabled: !1,
- includesImages: !0
- };
- function Xa(t, e) {
- var n,
- a = Object.keys(t);
- return Object.getOwnPropertySymbols && (n = Object.getOwnPropertySymbols(t), e && (n = n.filter(function (e) {
- return Object.getOwnPropertyDescriptor(t, e).enumerable
- })), a.push.apply(a, n)),
- a
- }
- function er(a) {
- for (var e = 1; e < arguments.length; e++) {
- var r = null != arguments[e] ? arguments[e] : {
- };
- e % 2 ? Xa(Object(r), !0).forEach(function (e) {
- var t,
- n;
- n = r[t = e],
- t in (e = a) ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(a, Object.getOwnPropertyDescriptors(r)) : Xa(Object(r)).forEach(function (e) {
- Object.defineProperty(a, e, Object.getOwnPropertyDescriptor(r, e))
- })
- }
- return a
- }
- function tr(e, t) {
- if (null == e) return {
- };
- var n,
- a = function (e, t) {
- if (null == e) return {
- };
- var n,
- a,
- r = {
- },
- o = Object.keys(e);
- for (a = 0; a < o.length; a++) ~t.indexOf(n = o[a]) || (r[n] = e[n]);
- return r
- }(e, t);
- if (Object.getOwnPropertySymbols) for (var r = Object.getOwnPropertySymbols(e), o = 0; o < r.length; o++) ~t.indexOf(n = r[o]) || Object.prototype.propertyIsEnumerable.call(e, n) && (a[n] = e[n]);
- return a
- }
- function nr() {
- var e = 0 < arguments.length && void 0 !== arguments[0] ? arguments[0] : ar,
- t = 1 < arguments.length ? arguments[1] : void 0,
- n = t.type,
- a = tr(t, [
- 'type'
- ]);
- switch (n) {
- case fe.onFetchTotalReactionsReportByDate:
- return er(er({
- }, e), {
- }, {
- totalReactionsReportByDate: er({
- }, a.response)
- });
- case fe.onFetchThreadSpecificReactionsReport:
- return er(er({
- }, e), {
- }, {
- threadSpecificReactionsReport: er({
- }, a.response)
- });
- case fe.onFetchTotalReactionsReportByThread:
- return er(er({
- }, e), {
- }, {
- totalReactionsReportByThread: er({
- }, a.response)
- });
- default:
- return e
- }
- }
- var ar = {
- totalReactionsReportByDate: {
- anon_series: [
- ],
- logged_in_series: [
- ],
- standard_series: [
- ]
- },
- totalReactionsReportByThread: {
- },
- threadSpecificReactionsReport: {
- }
- },
- rr = {
- contentPreview: !0,
- disableOverlay: !1,
- maxAgeDays: 0,
- metaComments: !0,
- metaDate: !0,
- placement: 'top',
- titleHidden: !1
- },
- or = [
- {
- key: 0,
- value: {
- contentPreview: !0,
- disableOverlay: !1,
- titleHidden: !1
- },
- image: '//c.disquscdn.com/next/current/publisher-admin/assets/img/recommendations/layouts/layout_option1.svg'
- },
- {
- key: 1,
- value: {
- contentPreview: !0,
- disableOverlay: !0,
- titleHidden: !1
- },
- image: '//c.disquscdn.com/next/current/publisher-admin/assets/img/recommendations/layouts/layout_option2.svg'
- },
- {
- key: 2,
- value: {
- contentPreview: !0,
- disableOverlay: !0,
- titleHidden: !0
- },
- image: '//c.disquscdn.com/next/current/publisher-admin/assets/img/recommendations/layouts/layout_option3.svg'
- },
- {
- key: 3,
- value: {
- contentPreview: !1,
- disableOverlay: !1,
- titleHidden: !1
- },
- image: '//c.disquscdn.com/next/current/publisher-admin/assets/img/recommendations/layouts/layout_option4.svg'
- }
- ],
- ir = [
- {
- key: 'top',
- value: 'top',
- label: 'Top'
- },
- {
- key: 'bottom',
- value: 'bottom',
- label: 'Bottom'
- },
- {
- key: 'standalone',
- value: 'standalone',
- label: 'Standalone',
- tag: {
- text: 'BETA',
- color: '#5cb767'
- }
- }
- ],
- sr = [
- {
- key: 'none',
- value: 0,
- label: 'None'
- },
- {
- key: 'week',
- value: 7,
- label: 'Last Week'
- },
- {
- key: 'month',
- value: 30,
- label: 'Last Month'
- },
- {
- key: '6 months',
- value: 180,
- label: 'Last Six Months'
- },
- {
- key: 'year',
- value: 365,
- label: 'Last Year'
- }
- ],
- lr = {
- collection: [
- {
- title: 'How to Conduct SEO Research for Your Blog',
- forumName: 'The Disqus Blog',
- description: 'Seventy million new blog posts appear every month on WordPress alone. That’s almost 27 blog posts published every second!',
- createdAgo: '2 months ago',
- posts: 38,
- recommendationsLink: '#',
- images: [
- {
- url: '//c.disquscdn.com/next/current/publisher-admin/assets/img/recommendations/preview/seo_research.png'
- }
- ]
- },
- {
- title: 'Introducing: Moderation Profiles',
- forumName: 'The Disqus Blog',
- description: 'Moderating your community doesn’t have to be hard, tedious work!',
- createdAgo: '5 months ago',
- posts: 424,
- recommendationsLink: '#',
- images: [
- {
- url: '//c.disquscdn.com/next/current/publisher-admin/assets/img/recommendations/preview/moderation_profiles.png'
- }
- ]
- },
- {
- title: 'Creating a Successful Landing Page',
- forumName: 'The Disqus Blog',
- description: 'Landing pages are standard practice in marketing. Let\'s talk more about why they\'re important, what they are and how to create one.',
- createdAgo: '3 months ago',
- posts: 55,
- recommendationsLink: '#',
- images: [
- {
- url: '//c.disquscdn.com/next/current/publisher-admin/assets/img/recommendations/preview/landing_page.png'
- }
- ]
- },
- {
- title: 'Leveraging Content Calendars to Improve Consistency',
- forumName: 'The Disqus Blog',
- description: 'A content calendar provides further direction on the creation and distribution of your content. It can cover your social media posts, blog, emails, & more.',
- createdAgo: '6 months ago',
- posts: 42,
- recommendationsLink: '#',
- images: [
- {
- url: '//c.disquscdn.com/next/current/publisher-admin/assets/img/recommendations/preview/content_calendar.png'
- }
- ]
- },
- {
- title: 'Email Marketing 101',
- forumName: 'The Disqus Blog',
- description: 'Email marketing is sending a targeted marketing campaign to your audience via email. Anything you send to your email list is considered email marketing',
- createdAgo: '9 months ago',
- posts: 60,
- recommendationsLink: '#',
- images: [
- {
- url: '//c.disquscdn.com/next/current/publisher-admin/assets/img/recommendations/preview/email_marketing.png'
- }
- ]
- },
- {
- title: 'The Ultimate Guide to Content Marketing',
- forumName: 'The Disqus Blog',
- description: 'Content marketing is not a buzzword. It’s a proven method to nurture leads and get your target audience to notice you!',
- createdAgo: '3 months ago',
- posts: 72,
- recommendationsLink: '#',
- images: [
- {
- url: '//c.disquscdn.com/next/current/publisher-admin/assets/img/recommendations/preview/content_marketing.png'
- }
- ]
- },
- {
- title: 'Getting to Know Your Audience',
- forumName: 'The Disqus Blog',
- description: 'Before you decide on which digital content strategy will work best for your brand and goals, it\'s important to know as much as you can about your audience. Without doing the research and analyzing who your readers are, you can\'t even begin to sort out important aspects of your strategy like messaging or how to retain those loyal followers.',
- createdAgo: 'a year ago',
- posts: 515,
- recommendationsLink: '#',
- images: [
- {
- url: '//c.disquscdn.com/next/current/publisher-admin/assets/img/recommendations/preview/know_your_audience.png'
- }
- ]
- },
- {
- title: 'Reactions: A new way to engage',
- forumName: 'The Disqus Blog',
- description: 'Today we have a big update to share and want to know what you think. Reactions are now available for all publishers on Disqus. Reactions are a fun, low-effort, means for readers to engage on their favorite sites and for publishers to better understand their audiences.',
- createdAgo: 'a year ago',
- posts: 515,
- recommendationsLink: '#',
- images: [
- {
- url: '//c.disquscdn.com/next/current/publisher-admin/assets/img/recommendations/preview/reactions.png'
- }
- ]
- }
- ]
- };
- function cr(e, t) {
- if (null == e) return {
- };
- var n,
- a = function (e, t) {
- if (null == e) return {
- };
- var n,
- a,
- r = {
- },
- o = Object.keys(e);
- for (a = 0; a < o.length; a++) ~t.indexOf(n = o[a]) || (r[n] = e[n]);
- return r
- }(e, t);
- if (Object.getOwnPropertySymbols) for (var r = Object.getOwnPropertySymbols(e), o = 0; o < r.length; o++) ~t.indexOf(n = r[o]) || Object.prototype.propertyIsEnumerable.call(e, n) && (a[n] = e[n]);
- return a
- }
- function ur(t, e) {
- var n,
- a = Object.keys(t);
- return Object.getOwnPropertySymbols && (n = Object.getOwnPropertySymbols(t), e && (n = n.filter(function (e) {
- return Object.getOwnPropertyDescriptor(t, e).enumerable
- })), a.push.apply(a, n)),
- a
- }
- function pr(a) {
- for (var e = 1; e < arguments.length; e++) {
- var r = null != arguments[e] ? arguments[e] : {
- };
- e % 2 ? ur(Object(r), !0).forEach(function (e) {
- var t,
- n;
- n = r[t = e],
- t in (e = a) ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(a, Object.getOwnPropertyDescriptors(r)) : ur(Object(r)).forEach(function (e) {
- Object.defineProperty(a, e, Object.getOwnPropertyDescriptor(r, e))
- })
- }
- return a
- }
- function dr() {
- var e = 0 < arguments.length && void 0 !== arguments[0] ? arguments[0] : mr,
- t = 1 < arguments.length ? arguments[1] : void 0,
- n = t.type,
- a = cr(t, [
- 'type'
- ]);
- switch (n) {
- case he.enabling:
- return pr(pr({
- }, e), {
- }, {
- isEnabling: !0,
- error: null
- });
- case he.onEnable:
- return pr(pr({
- }, e), {
- }, {
- isEnabling: !1,
- isEnabled: !0
- });
- case he.onEnableError:
- return pr(pr({
- }, e), {
- }, {
- isEnabling: !1,
- isFetching: !1,
- isSaving: !1,
- error: a.message || 'We couldn\'t enable Recommendations. Try again.'
- });
- case he.fetching:
- return pr(pr({
- }, e), {
- }, {
- isFetching: !0,
- error: null
- });
- case he.onFetch:
- return pr(pr({
- }, e), {
- }, {
- isFetching: !1,
- recommendationsEnabled: a.recommendationsEnabled,
- contentPreview: a.contentPreview,
- disableOverlay: a.disableOverlay,
- maxAgeDays: parseInt(a.maxAgeDays, 10),
- metaComments: a.metaComments,
- metaDate: a.metaDate,
- placement: a.placement,
- titleHidden: a.titleHidden
- });
- case he.onFetchError:
- return pr(pr({
- }, e), {
- }, {
- isFetching: !1,
- isSaving: !1,
- error: a.message || 'We couldn\'t retrieve your Recommendations settings. Try again.'
- });
- case he.saving:
- return pr(pr({
- }, e), {
- }, {
- isSaving: !0,
- isSaved: !1,
- error: null
- });
- case he.onSave:
- return pr(pr({
- }, e), {
- }, {
- isSaving: !1,
- isSaved: !0
- });
- case he.onSaveError:
- return pr(pr({
- }, e), {
- }, {
- isFetching: !1,
- isSaving: !1,
- error: a.message || 'We couldn\'t save your Recommendations settings. Try again.'
- });
- default:
- return e
- }
- }
- var mr = pr(pr({
- recommendationsEnabled: !0
- }, rr), {
- }, {
- isFetching: !1,
- isSaving: !1,
- isSaved: !1,
- error: null
- });
- function fr() {
- return (fr = Object.assign || function (e) {
- for (var t = 1; t < arguments.length; t++) {
- var n,
- a = arguments[t];
- for (n in a) Object.prototype.hasOwnProperty.call(a, n) && (e[n] = a[n])
- }
- return e
- }).apply(this, arguments)
- }
- function hr(e, t) {
- if (null == e) return {
- };
- var n,
- a = function (e, t) {
- if (null == e) return {
- };
- var n,
- a,
- r = {
- },
- o = Object.keys(e);
- for (a = 0; a < o.length; a++) ~t.indexOf(n = o[a]) || (r[n] = e[n]);
- return r
- }(e, t);
- if (Object.getOwnPropertySymbols) for (var r = Object.getOwnPropertySymbols(e), o = 0; o < r.length; o++) ~t.indexOf(n = r[o]) || Object.prototype.propertyIsEnumerable.call(e, n) && (a[n] = e[n]);
- return a
- }
- function gr() {
- var e = 0 < arguments.length && void 0 !== arguments[0] ? arguments[0] : yr,
- t = 1 < arguments.length ? arguments[1] : void 0,
- n = t.type,
- a = hr(t, [
- 'type'
- ]);
- switch (n) {
- case ge.fetching:
- return fr({
- }, e, {
- isFetching: !0,
- error: null
- });
- case ge.fetchFailed:
- return fr({
- }, e, {
- isFetching: !1,
- error: a.message || 'We couldn\'t retrieve your restricted word list. Try again later.'
- });
- case ge.update:
- return fr({
- }, e, {
- wordArr: a.entries,
- words: a.entries.join(', '),
- isFetching: !1,
- error: null,
- wordsChanged: !1
- });
- case ge.edit:
- return fr({
- }, e, {
- words: a.words,
- wordsChanged: !0
- });
- case ge.saving:
- return fr({
- }, e, {
- isSaved: !1,
- isSaving: !0,
- error: null
- });
- case ge.saved:
- return fr({
- }, e, {
- wordArr: a.entries,
- words: a.entries.join(', '),
- isSaved: !0,
- isSaving: !1,
- wordsChanged: !1
- });
- case ge.saveFailed:
- return fr({
- }, e, {
- isSaving: !1,
- error: a.message || 'There was an unknown problem saving the word list. Please try again later.'
- });
- case ge.clearError:
- return fr({
- }, e, {
- error: null
- });
- default:
- return e
- }
- }
- var yr = {
- wordArr: [
- ],
- words: '',
- wordsChanged: !1,
- isFetching: !1,
- isSaving: !1,
- isSaved: !1,
- error: null
- },
- br = {
- shortname: pt.a.currentForum,
- orgId: (window.location.pathname.match(/\/admin\/orgs\/(\d+)/) || [
- ]) [1],
- disqusHost: pt.a.disqusHost,
- mediaUrl: window._v5Config.mediaUrl
- };
- function vr(t, e) {
- var n,
- a = Object.keys(t);
- return Object.getOwnPropertySymbols && (n = Object.getOwnPropertySymbols(t), e && (n = n.filter(function (e) {
- return Object.getOwnPropertyDescriptor(t, e).enumerable
- })), a.push.apply(a, n)),
- a
- }
- function _r(t) {
- for (var e = 1; e < arguments.length; e++) {
- var n = null != arguments[e] ? arguments[e] : {
- };
- e % 2 ? vr(Object(n), !0).forEach(function (e) {
- Or(t, e, n[e])
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(n)) : vr(Object(n)).forEach(function (e) {
- Object.defineProperty(t, e, Object.getOwnPropertyDescriptor(n, e))
- })
- }
- return t
- }
- function Er(e, t) {
- if (null == e) return {
- };
- var n,
- a = function (e, t) {
- if (null == e) return {
- };
- var n,
- a,
- r = {
- },
- o = Object.keys(e);
- for (a = 0; a < o.length; a++) ~t.indexOf(n = o[a]) || (r[n] = e[n]);
- return r
- }(e, t);
- if (Object.getOwnPropertySymbols) for (var r = Object.getOwnPropertySymbols(e), o = 0; o < r.length; o++) ~t.indexOf(n = r[o]) || Object.prototype.propertyIsEnumerable.call(e, n) && (a[n] = e[n]);
- return a
- }
- function Or(e, t, n) {
- return t in e ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n,
- e
- }
- function Sr() {
- var e = 0 < arguments.length && void 0 !== arguments[0] ? arguments[0] : function () {
- if (br.shortname) {
- var e = window._v5Config.forums[br.shortname] || {
- };
- return Or({
- }, e.organization, e.features)
- }
- if (br.orgId) {
- e = ((window._v5Config.organizations[br.orgId] || {
- }).forums || [
- ]) [0];
- return Or({
- }, br.orgId, (window._v5Config.forums[e] || {
- }).features)
- }
- return {
- }
- }(),
- t = 1 < arguments.length ? arguments[1] : void 0,
- n = t.type,
- a = Er(t, [
- 'type'
- ]);
- switch (n) {
- case ye.fetching:
- return _r(_r({
- }, e), {
- }, Or({
- }, a.orgId, _r(_r({
- }, e[a.orgId]), {
- }, {
- isFetching: !0
- })));
- case ye.onFetch:
- return _r(_r({
- }, e), {
- }, Or({
- }, a.orgId, _r(_r({
- }, a.features), {
- }, {
- isFetching: !1,
- isFetched: !0
- })));
- case ye.onError:
- return _r(_r({
- }, e), {
- }, Or({
- }, a.orgId, _r(_r({
- }, e[a.orgId]), {
- }, {
- isFetching: !1
- })));
- default:
- return e
- }
- }
- function wr(t, e) {
- var n,
- a = Object.keys(t);
- return Object.getOwnPropertySymbols && (n = Object.getOwnPropertySymbols(t), e && (n = n.filter(function (e) {
- return Object.getOwnPropertyDescriptor(t, e).enumerable
- })), a.push.apply(a, n)),
- a
- }
- function Pr(a) {
- for (var e = 1; e < arguments.length; e++) {
- var r = null != arguments[e] ? arguments[e] : {
- };
- e % 2 ? wr(Object(r), !0).forEach(function (e) {
- var t,
- n;
- n = r[t = e],
- t in (e = a) ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(a, Object.getOwnPropertyDescriptors(r)) : wr(Object(r)).forEach(function (e) {
- Object.defineProperty(a, e, Object.getOwnPropertyDescriptor(r, e))
- })
- }
- return a
- }
- var kr = window._v5Config.forums,
- Nr = window._v5Config.organizations,
- Cr = window._v5Config.moderated_forums,
- Rr = Ve.a.getFromCookie().username;
- function xr(e) {
- var t = Nr[e].owner === Rr,
- n = Nr[e].permissions.isModerator,
- e = Object.values(Nr[e].forums.reduce(function (e, t) {
- return e[t] = kr[t],
- e
- }, {
- }));
- return {
- canModerate: t || n || e.some(function (e) {
- return e.permissions.canModerate
- }),
- canEditPolls: t || e.some(function (e) {
- return e.permissions.canEditPolls
- })
- }
- }
- function Ar() {
- var e,
- t,
- n,
- a,
- r,
- o,
- i,
- s = {
- };
- return (e = br.shortname ? kr[br.shortname] || {
- shortname: br.shortname
- }
- : e) ? (i = (r = e) && r.organization && Nr[r.organization].permissions.isModerator, t = {
- canModerate: (o = r && r.organization && Nr[r.organization].owner === Rr) || i || r && r.permissions && r.permissions.canModerate,
- canEditPolls: o || i || r && r.permissions && r.permissions.canEditPolls
- }, s.type = ft.forum, s.forum = (i = (o = e) && o.permissions && o.permissions.canAdminister, r = o && o.settings && o.settings.ADS_ANALYTICS_VIEWABLE, Pr(Pr({
- }, o), {
- }, {
- hasAdsAnalytics: r,
- canAdminister: i
- })), s.organization = e.organization && Nr[e.organization], s.isCommentsVisible = t.canModerate, s.isPollsVisible = t.canEditPolls) : br.orgId ? (n = xr(br.orgId), s.type = ft.organization, s.organization = a = Pr(Pr({
- }, a = Nr[br.orgId] || {
- id: br.orgId
- }), {
- }, {
- canAdminister: a && a.forums.some(function (e) {
- e = kr[e];
- return e && e.permissions.canAdminister
- }),
- hasAdsSettings: a && a.forums.some(function (e) {
- e = kr[e];
- return e && e.settings.ADS_SETTINGS_VIEWABLE
- }),
- hasAdsAnalytics: a && a.forums.some(function (e) {
- e = kr[e];
- return e && e.settings.ADS_ANALYTICS_VIEWABLE
- }),
- hasGuarantee: function () {
- return a && a.hasGuarantee
- }
- }), s.organizationForums = s.organization.forums.reduce(function (e, t) {
- return e[t] = kr[t],
- e
- }, {
- }), s.isCommentsVisible = n.canModerate, s.isPollsVisible = n.canEditPolls) : (e = Object.values(Nr).some(function (e) {
- return e.owner === Rr
- }), t = Object.values(Nr).some(function (e) {
- return e.permissions.isAdmin
- }), n = Object.values(Nr).some(function (e) {
- return e.permissions.isModerator
- }), t = {
- canModerate: e || t || n || Cr.some(function (e) {
- return kr[e].permissions.canModerate || kr[e].permissions.canAdminister
- }),
- canEditPolls: e || t || Cr.some(function (e) {
- return kr[e].permissions.canEditPolls
- })
- }, s.type = ft.global, s.global = {
- canAdminister: Object.keys(kr).some(function (e) {
- e = kr[e];
- return e.permissions && e.permissions.canAdminister
- }),
- hasAdsSettings: Object.keys(kr).some(function (e) {
- e = kr[e];
- return e.settings && e.settings.ADS_SETTINGS_VIEWABLE
- }),
- hasAdsAnalytics: Object.keys(kr).some(function (e) {
- e = kr[e];
- return e.settings && e.settings.ADS_ANALYTICS_VIEWABLE
- })
- }, s.isCommentsVisible = t.canModerate, s.isPollsVisible = t.canEditPolls),
- s.isRevealVisible = s[s.type].hasAdsAnalytics,
- s.isSettingsVisible = s[s.type].canAdminister,
- s
- }
- function Dr() {
- var e = 0 < arguments.length && void 0 !== arguments[0] ? arguments[0] : jr();
- return e = (1 < arguments.length ? arguments[1] : void 0).type === be.onEnableComments ? Pr(Pr({
- }, e), {
- }, {
- organization: Pr(Pr({
- }, e.organization), {
- }, {
- pollsOnly: !1
- })
- }) : e
- }
- var jr = Ar;
- function Tr(t, e) {
- var n,
- a = Object.keys(t);
- return Object.getOwnPropertySymbols && (n = Object.getOwnPropertySymbols(t), e && (n = n.filter(function (e) {
- return Object.getOwnPropertyDescriptor(t, e).enumerable
- })), a.push.apply(a, n)),
- a
- }
- function Ir(a) {
- for (var e = 1; e < arguments.length; e++) {
- var r = null != arguments[e] ? arguments[e] : {
- };
- e % 2 ? Tr(Object(r), !0).forEach(function (e) {
- var t,
- n;
- n = r[t = e],
- t in (e = a) ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(a, Object.getOwnPropertyDescriptors(r)) : Tr(Object(r)).forEach(function (e) {
- Object.defineProperty(a, e, Object.getOwnPropertyDescriptor(r, e))
- })
- }
- return a
- }
- function qr(e, t) {
- if (null == e) return {
- };
- var n,
- a = function (e, t) {
- if (null == e) return {
- };
- var n,
- a,
- r = {
- },
- o = Object.keys(e);
- for (a = 0; a < o.length; a++) ~t.indexOf(n = o[a]) || (r[n] = e[n]);
- return r
- }(e, t);
- if (Object.getOwnPropertySymbols) for (var r = Object.getOwnPropertySymbols(e), o = 0; o < r.length; o++) ~t.indexOf(n = r[o]) || Object.prototype.propertyIsEnumerable.call(e, n) && (a[n] = e[n]);
- return a
- }
- function Fr() {
- var e = 0 < arguments.length && void 0 !== arguments[0] ? arguments[0] : Lr,
- t = 1 < arguments.length ? arguments[1] : void 0,
- n = t.type,
- a = qr(t, [
- 'type'
- ]);
- switch (n) {
- case ve.scriptAdded:
- return Ir(Ir({
- }, e), {
- }, {
- stripeScriptAdded: !0
- });
- case ve.scriptLoaded:
- return Ir(Ir({
- }, e), {
- }, {
- stripeScriptInstance: window.StripeCheckout
- });
- case ve.checkoutScriptAdded:
- return Ir(Ir({
- }, e), {
- }, {
- error: '',
- stripeScriptAdded: !0
- });
- case ve.stripeCheckoutLoaded:
- return Ir(Ir({
- }, e), {
- }, {
- error: '',
- stripeInstance: a.stripeInstance
- });
- case ve.updateData:
- return Ir(Ir({
- }, e), {
- }, {
- error: '',
- checkoutData: Ir(Ir({
- }, e.checkoutData), a.checkoutData)
- });
- case ve.onError:
- return Ir(Ir({
- }, e), {
- }, {
- error: a.error
- });
- default:
- return e
- }
- }
- var Lr = {
- stripeScriptAdded: !1,
- stripeScriptInstance: null,
- stripeCheckoutScriptAdded: !1,
- stripeCheckoutInstance: null,
- checkoutData: {
- organization: null,
- forum: null,
- plan: null
- },
- error: ''
- },
- Ur = n(33);
- function Mr(e, t) {
- if (null == e) return {
- };
- var n,
- a = function (e, t) {
- if (null == e) return {
- };
- var n,
- a,
- r = {
- },
- o = Object.keys(e);
- for (a = 0; a < o.length; a++) ~t.indexOf(n = o[a]) || (r[n] = e[n]);
- return r
- }(e, t);
- if (Object.getOwnPropertySymbols) for (var r = Object.getOwnPropertySymbols(e), o = 0; o < r.length; o++) ~t.indexOf(n = r[o]) || Object.prototype.propertyIsEnumerable.call(e, n) && (a[n] = e[n]);
- return a
- }
- function Br(t, e) {
- var n,
- a = Object.keys(t);
- return Object.getOwnPropertySymbols && (n = Object.getOwnPropertySymbols(t), e && (n = n.filter(function (e) {
- return Object.getOwnPropertyDescriptor(t, e).enumerable
- })), a.push.apply(a, n)),
- a
- }
- function zr(a) {
- for (var e = 1; e < arguments.length; e++) {
- var r = null != arguments[e] ? arguments[e] : {
- };
- e % 2 ? Br(Object(r), !0).forEach(function (e) {
- var t,
- n;
- n = r[t = e],
- t in (e = a) ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(a, Object.getOwnPropertyDescriptors(r)) : Br(Object(r)).forEach(function (e) {
- Object.defineProperty(a, e, Object.getOwnPropertyDescriptor(r, e))
- })
- }
- return a
- }
- function Hr(e) {
- return function (e) {
- if (Array.isArray(e)) return Gr(e)
- }(e) || function (e) {
- if ('undefined' != typeof Symbol && null != e[Symbol.iterator] || null != e['@@iterator']) return Array.from(e)
- }(e) || function (e, t) {
- if (e) {
- if ('string' == typeof e) return Gr(e, t);
- var n = Object.prototype.toString.call(e).slice(8, - 1);
- return 'Map' === (n = 'Object' === n && e.constructor ? e.constructor.name : n) || 'Set' === n ? Array.from(e) : 'Arguments' === n || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n) ? Gr(e, t) : void 0
- }
- }(e) || function () {
- throw new TypeError('Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.')
- }()
- }
- function Gr(e, t) {
- for (var n = 0, a = Array(t = null == t || e.length < t ? e.length : t); n < t; n++) a[n] = e[n];
- return a
- }
- function Vr(r) {
- if (r.orgSubscriptionIsFetching || !r.packages) return {
- };
- var o = r.orgCurrentPlan ? r.orgCurrentPlan.id : Ur.DISQUS_BASIC_PLAN_ID,
- i = r.pollsOrgCurrentPlan && r.pollsOrgCurrentPlan.id,
- e = [
- Ur.BASIC_PACKAGE
- ].concat(Hr(r.packages)).map(function (e) {
- var t = e.plans.map(function (e) {
- var t = !!r.orgAvailableTrials && !!~r.orgAvailableTrials.indexOf(e.id) || !!r.orgTransferableTrials && !!~r.orgTransferableTrials.indexOf(e.id),
- n = e.interval || 'month';
- return e.id === o ? zr(zr(zr({
- }, e), r.orgCurrentPlan), {
- }, {
- hasTrialAvailable: t,
- interval: n,
- isSubscribed: !0
- }) : e.id === i ? zr(zr(zr({
- }, e), r.pollsOrgCurrentPlan), {
- }, {
- hasTrialAvailable: t,
- interval: n,
- isSubscribed: !0
- }) : zr(zr({
- }, e), {
- }, {
- hasTrialAvailable: t,
- interval: n,
- isSubscribed: !1
- })
- }),
- n = t.some(function (e) {
- return e.isSubscribed
- }),
- a = e.features.map(function (e) {
- return zr(zr({
- }, e), {
- }, {
- isCustom: !1
- })
- });
- return n && (a = a.concat((r.orgCustomFeatures || [
- ]).map(function (e) {
- return zr(zr({
- }, e), {
- }, {
- isCustom: !0
- })
- }))),
- zr(zr({
- }, e), {
- }, {
- features: a,
- plans: t,
- isSubscribed: n
- })
- });
- return {
- orgPackages: e,
- orgCurrentPackage: je.a.find(e, function (e) {
- return e.productName === Ur.SAAS_PRODUCT_COMMENTS && e.isSubscribed
- }),
- pollsOrgCurrentPackage: je.a.find(e, function (e) {
- return e.productName === Ur.SAAS_PRODUCT_POLLS && e.isSubscribed
- })
- }
- }
- function Wr() {
- var e = 0 < arguments.length && void 0 !== arguments[0] ? arguments[0] : Yr,
- t = 1 < arguments.length ? arguments[1] : void 0,
- n = t.type,
- a = Mr(t, [
- 'type'
- ]);
- switch (n) {
- case _e.fetchStart:
- e = zr(zr({
- }, e), {
- }, {
- numFetching: e.numFetching + 1,
- orgSubscriptionIsFetching: !0
- });
- break;
- case _e.updateSubscriptionStart:
- e = zr(zr({
- }, e), {
- }, {
- isSubscriptionUpdating: !0
- });
- break;
- case _e.updateSubscriptionEnd:
- e = zr(zr({
- }, e), {
- }, {
- isSubscriptionUpdating: !1
- });
- break;
- case _e.updateInvoiceStart:
- e = zr(zr({
- }, e), {
- }, {
- isInvoiceUpdating: !0
- });
- break;
- case _e.updateInvoiceEnd:
- e = zr(zr({
- }, e), {
- }, {
- isInvoiceUpdating: !1
- });
- break;
- case _e.fetchFailed:
- case _e.fetchedPackages:
- case _e.fetchedCurrentPlan:
- case _e.pollsFetchedCurrentPlan:
- case _e.fetchedBillingInformation:
- a.isFromInitialFetch && (e = zr(zr({
- }, e), {
- }, {
- numFetching: e.numFetching - 1,
- orgSubscriptionIsFetching: 0 < e.numFetching - 1 || !a.response
- }))
- }
- if (a.response) switch (n) {
- case _e.fetchedPackages:
- e = zr(zr({
- }, e), {
- }, {
- packages: a.response.map(function (e) {
- var t = e.id === Ur.DISQUS_POLLS_BUSINESS_PACKAGE_ID ? [
- Ur.POLLS_BUSINESS_PLAN
- ] : e.id === Ur.DISQUS_POLLS_AD_SUPPORTED_PACKAGE_ID ? [
- Ur.POLLS_AD_SUPPORTED_PLAN
- ] : e.plans.filter(function (e) {
- return !~Ur.OLD_PLAN_IDS.indexOf(e.id)
- }),
- n = e.pricingOptions.filter(function (e) {
- return !~Ur.OLD_PLAN_IDS.indexOf(e.id)
- });
- return zr(zr({
- }, e), {
- }, {
- plans: t,
- pricingOptions: n
- })
- })
- }),
- e = zr(zr({
- }, e), Vr(e));
- break;
- case _e.fetchedCurrentPlan:
- e = zr(zr({
- }, e), {
- }, {
- orgAvailableTrials: a.response.availableTrials,
- orgTransferableTrials: a.response.transferableTrials,
- orgCurrentPackageWillCancel: a.response.cancelAtPeriodEnd,
- orgCurrentPlan: a.response.plan || Ur.BASIC_PLAN,
- orgCustomFeatures: a.response.customFeatures,
- orgTrial: a.response.trial,
- orgAvailableDiscount: a.response.availableDiscount
- }),
- e = zr(zr({
- }, e), Vr(e));
- break;
- case _e.pollsFetchedCurrentPlan:
- e = zr(zr({
- }, e), {
- }, {
- orgAvailableTrials: a.response.availableTrials,
- orgTransferableTrials: a.response.transferableTrials,
- pollsOrgCurrentPackageWillCancel: a.response.cancelAtPeriodEnd,
- pollsOrgCurrentPlan: a.response.plan,
- pollsOrgCustomFeatures: a.response.customFeatures,
- pollsOrgTrial: a.response.trial,
- pollsOrgAvailableDiscount: a.response.availableDiscount,
- pollsPlanStatus: a.response.status
- }),
- e = zr(zr({
- }, e), Vr(e));
- break;
- case _e.fetchedBillingInformation:
- case _e.updateInvoiceEnd:
- e = zr(zr({
- }, e), {
- }, {
- orgBilling: a.response
- }),
- e = zr(zr({
- }, e), Vr(e))
- }
- return e
- }
- var Yr = {
- isSubscriptionUpdating: !1,
- isInvoiceUpdating: !1,
- numFetching: 0,
- orgAvailableTrials: null,
- orgBilling: null,
- orgCurrentPackage: null,
- orgCurrentPackageWillCancel: !1,
- orgCurrentPlan: null,
- orgCustomFeatures: null,
- orgPackages: null,
- orgSubscriptionIsFetching: !1,
- orgTrial: null,
- packages: null,
- orgAvailableDiscount: null,
- pollsOrgCurrentPackageWillCancel: !1,
- pollsOrgCurrentPlan: null,
- pollsOrgCustomFeatures: null,
- pollsOrgTrial: null,
- pollsOrgAvailableDiscount: null,
- pollsPlanStatus: null
- };
- function Qr(t, e) {
- var n,
- a = Object.keys(t);
- return Object.getOwnPropertySymbols && (n = Object.getOwnPropertySymbols(t), e && (n = n.filter(function (e) {
- return Object.getOwnPropertyDescriptor(t, e).enumerable
- })), a.push.apply(a, n)),
- a
- }
- function Kr(a) {
- for (var e = 1; e < arguments.length; e++) {
- var r = null != arguments[e] ? arguments[e] : {
- };
- e % 2 ? Qr(Object(r), !0).forEach(function (e) {
- var t,
- n;
- n = r[t = e],
- t in (e = a) ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(a, Object.getOwnPropertyDescriptors(r)) : Qr(Object(r)).forEach(function (e) {
- Object.defineProperty(a, e, Object.getOwnPropertyDescriptor(r, e))
- })
- }
- return a
- }
- function Jr(e, t) {
- if (null == e) return {
- };
- var n,
- a = function (e, t) {
- if (null == e) return {
- };
- var n,
- a,
- r = {
- },
- o = Object.keys(e);
- for (a = 0; a < o.length; a++) ~t.indexOf(n = o[a]) || (r[n] = e[n]);
- return r
- }(e, t);
- if (Object.getOwnPropertySymbols) for (var r = Object.getOwnPropertySymbols(e), o = 0; o < r.length; o++) ~t.indexOf(n = r[o]) || Object.prototype.propertyIsEnumerable.call(e, n) && (a[n] = e[n]);
- return a
- }
- function $r() {
- var e = 0 < arguments.length && void 0 !== arguments[0] ? arguments[0] : Zr,
- t = (n = 1 < arguments.length ? arguments[1] : void 0).type,
- n = Jr(n, [
- 'type'
- ]);
- return t !== ae.onFetch ? e : Kr(Kr({
- }, e), n.suggestedActions)
- }
- var Zr = {
- };
- function Xr(t, e) {
- var n,
- a = Object.keys(t);
- return Object.getOwnPropertySymbols && (n = Object.getOwnPropertySymbols(t), e && (n = n.filter(function (e) {
- return Object.getOwnPropertyDescriptor(t, e).enumerable
- })), a.push.apply(a, n)),
- a
- }
- function eo(a) {
- for (var e = 1; e < arguments.length; e++) {
- var r = null != arguments[e] ? arguments[e] : {
- };
- e % 2 ? Xr(Object(r), !0).forEach(function (e) {
- var t,
- n;
- n = r[t = e],
- t in (e = a) ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(a, Object.getOwnPropertyDescriptors(r)) : Xr(Object(r)).forEach(function (e) {
- Object.defineProperty(a, e, Object.getOwnPropertyDescriptor(r, e))
- })
- }
- return a
- }
- function to(e, t) {
- if (null == e) return {
- };
- var n,
- a = function (e, t) {
- if (null == e) return {
- };
- var n,
- a,
- r = {
- },
- o = Object.keys(e);
- for (a = 0; a < o.length; a++) ~t.indexOf(n = o[a]) || (r[n] = e[n]);
- return r
- }(e, t);
- if (Object.getOwnPropertySymbols) for (var r = Object.getOwnPropertySymbols(e), o = 0; o < r.length; o++) ~t.indexOf(n = r[o]) || Object.prototype.propertyIsEnumerable.call(e, n) && (a[n] = e[n]);
- return a
- }
- function no() {
- var e = 0 < arguments.length && void 0 !== arguments[0] ? arguments[0] : ao,
- t = 1 < arguments.length ? arguments[1] : void 0,
- n = t.type,
- a = to(t, [
- 'type'
- ]);
- switch (n) {
- case Ee.configureRemotePlugin:
- return eo(eo({
- }, e), {
- }, {
- isConfiguring: !0,
- configureError: null
- });
- case Ee.onConfigureError:
- return eo(eo({
- }, e), {
- }, {
- isConfiguring: !1,
- configureError: a.message
- });
- case Ee.configuring:
- return eo(eo({
- }, e), {
- }, {
- isConfiguring: !0,
- isConfigured: !1,
- configureError: null
- });
- case Ee.onConfigure:
- return eo(eo({
- }, e), {
- }, {
- isConfiguring: !1,
- isConfigured: !0,
- configureError: null,
- installToken: ''
- });
- case Ee.updateInstallToken:
- return eo(eo({
- }, e), {
- }, {
- installToken: a.token
- });
- default:
- return e
- }
- }
- var ao = {
- installToken: '',
- isConfiguring: !1,
- isConfigured: !1,
- configureError: null
- },
- ro = function () {
- var e = Object(T.applyMiddleware) (q.a);
- return Object(T.createStore) (Object(T.combineReducers) ({
- aet: Pe,
- analyticsContent: xe,
- audienceAnalytics: Ue,
- auth: Me,
- badges: tt,
- badgesManage: Je,
- behindClick: it,
- campaign: vt,
- commentCounts: wt,
- discussionsEdit: Rt,
- earnings: Tt,
- featuredMessages: Ut,
- forumCategories: zt,
- forumDetails: Yt,
- forumLanguages: Jt,
- forumModerator: rn,
- forumUpdateFavicon: un,
- forumWebhooks: gn,
- moderateSearch: En,
- moderationRules: Gn,
- moderationUserLists: $n,
- orgAdmin: aa,
- orgForums: la,
- policy: ma,
- pollsEditor: ba,
- pollsList: Pa,
- pollModerator: ja,
- pollStats: La,
- pollAnalytics: Ga,
- reactions: $a,
- reactionsAnalytics: nr,
- recommendations: dr,
- restrictedWords: gr,
- saasFeatures: Sr,
- selection: Dr,
- stripeCheckout: Fr,
- subscription: Wr,
- suggestedActions: $r,
- wordpressInstall: no
- }), {
- }, e)
- },
- oo = n(28),
- io = n.n(oo),
- so = {
- fetch: function (n) {
- return function (t, e) {
- e = e(),
- e = e.saasFeatures[n = n || (e.selection.organization || {
- }).id] || {
- };
- !n || e.isFetching || e.isFetched || (e = {
- organization: n,
- attach: 'organizationFeatures'
- }, t({
- orgId: n,
- type: ye.fetching
- }), io.a.call('organizations/details', {
- data: e
- }).success(function (e) {
- t({
- orgId: n,
- type: ye.onFetch,
- features: e.response.features
- })
- }).error(function () {
- t({
- orgId: n,
- type: ye.onError
- })
- }))
- }
- }
- },
- lo = Object.keys(ft).reduce(function (e, t) {
- return e[ft[t]] = !0,
- e
- }, {
- }),
- co = {
- };
- var uo = {
- addSupportedSelections: function (e, n) {
- co[e] = Object.keys(n).reduce(function (e, t) {
- return e[t] = !!n[t],
- e
- }, {
- })
- },
- getSupportedSelections: function (e) {
- return co[e] || lo
- }
- },
- po = /(\/admin(?:\/orgs\/\d+\/[^/]+)?)(\/.*)/;
- function mo(e) {
- return window.location.pathname.match(po) [1].replace('/admin', '') + e
- }
- function fo(e) {
- var t = (e || window.location.pathname).match(po);
- return t ? t[2] : e
- }
- var ho = {
- getAdminPath: fo,
- getRoot: function (e) {
- var t = (e || window.location.pathname).match(po);
- return t ? t[1] : e
- },
- getRoute: mo
- },
- go = n(34),
- yo = n.n(go),
- bo = n(37),
- vo = n.n(bo),
- _o = n(66),
- Eo = n.n(_o);
- function Oo(t, e) {
- var n,
- a = Object.keys(t);
- return Object.getOwnPropertySymbols && (n = Object.getOwnPropertySymbols(t), e && (n = n.filter(function (e) {
- return Object.getOwnPropertyDescriptor(t, e).enumerable
- })), a.push.apply(a, n)),
- a
- }
- function So(t) {
- for (var e = 1; e < arguments.length; e++) {
- var n = null != arguments[e] ? arguments[e] : {
- };
- e % 2 ? Oo(Object(n), !0).forEach(function (e) {
- wo(t, e, n[e])
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(n)) : Oo(Object(n)).forEach(function (e) {
- Object.defineProperty(t, e, Object.getOwnPropertyDescriptor(n, e))
- })
- }
- return t
- }
- function wo(e, t, n) {
- return t in e ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n,
- e
- }
- function Po(e, t) {
- t({
- type: ve.updateData,
- checkoutData: e
- })
- }
- var ko = {
- addStripeScript: function (e, t) {
- t().stripeCheckout.stripeScriptAdded || ((t = window.document.createElement('script')).src = 'https://checkout.stripe.com/checkout.js', t.async = 1, t.onload = function () {
- e({
- type: ve.scriptLoaded
- })
- }, window.document.head.appendChild(t), e({
- type: ve.scriptAdded
- }))
- },
- onOpenStripe: function (e, t) {
- var t = t().stripeCheckout.stripeScriptInstance,
- n = vo.a.Deferred();
- if (!t) return n.reject(Error('Stripe has not loaded')),
- n.promise();
- var a = !1;
- return t.open(So(So({
- key: pt.a.keys.stripe,
- locale: 'auto'
- }, e), {
- }, {
- token: function (e) {
- a = !0,
- n.resolve(e)
- },
- closed: function () {
- a || n.reject(Error('Checkout window was closed'))
- }
- })),
- n.promise()
- },
- addStripeCheckoutScript: function () {
- return function (t, e) {
- var n = vo.a.Deferred();
- if (e().stripeCheckout.checkoutScriptAdded) return n.resolve(!0);
- e = window.document.createElement('script');
- return e.src = 'https://js.stripe.com/v3/',
- e.async = 1,
- e.onload = function () {
- var e = window.Stripe && window.Stripe(pt.a.keys.stripe);
- t({
- type: ve.stripeCheckoutLoaded,
- stripeInstance: e
- }),
- n.resolve(!0)
- },
- window.document.head.appendChild(e),
- t({
- type: ve.checkoutScriptAdded
- }),
- n.promise()
- }
- },
- createStripeCheckoutSession: function () {
- return function (e, t) {
- var n = t().stripeCheckout.checkoutData,
- a = n.plan,
- r = n.returnUrl,
- o = n.forum,
- n = n.organization,
- t = t().selection,
- n = n || t && t.organization && t.organization.id,
- t = n ? void 0 : o || t && t.forum && t.forum.shortname,
- i = vo.a.Deferred();
- return io.a.call('organizations/saas/startCheckoutSession', {
- type: 'POST',
- data: {
- organization: n,
- forum: t,
- pricingOption: a || void 0,
- returnUrl: r && Eo() (r, wo({
- }, Ur.CHECKOUT_SUCCESS_QUERY_PARAM, a.indexOf('polls') ? Ur.CHECKOUT_SUCCESS_QUERY_PARAM_VALUE_COMMENTS : Ur.CHECKOUT_SUCCESS_QUERY_PARAM_VALUE_POLLS))
- },
- success: function (e) {
- i.resolve(e.response && e.response.clientSecret)
- },
- error: function () {
- e({
- type: ve.onError
- }),
- i.reject('There was an error')
- }
- }),
- i.promise()
- }
- },
- updateCheckoutData: Po,
- updateCheckoutDataFromComponent: function (t) {
- return function (e) {
- return Po(t, e)
- }
- }
- };
- function No(e) {
- return (No = 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator ? function (e) {
- return typeof e
- }
- : function (e) {
- return e && 'function' == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? 'symbol' : typeof e
- }) (e)
- }
- function Co(e, t) {
- for (var n = 0; n < t.length; n++) {
- var a = t[n];
- a.enumerable = a.enumerable || !1,
- a.configurable = !0,
- 'value' in a && (a.writable = !0),
- Object.defineProperty(e, a.key, a)
- }
- }
- function Ro(e, t) {
- return (Ro = Object.setPrototypeOf || function (e, t) {
- return e.__proto__ = t,
- e
- }) (e, t)
- }
- function xo(n) {
- var a = function () {
- if ('undefined' == typeof Reflect || !Reflect.construct) return !1;
- if (Reflect.construct.sham) return !1;
- if ('function' == typeof Proxy) return !0;
- try {
- return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [
- ], function () {
- })),
- !0
- } catch (e) {
- return !1
- }
- }();
- return function () {
- var e,
- t = Do(n);
- return e = a ? (e = Do(this).constructor, Reflect.construct(t, arguments, e)) : t.apply(this, arguments),
- t = this,
- !(e = e) || 'object' !== No(e) && 'function' != typeof e ? Ao(t) : e
- }
- }
- function Ao(e) {
- if (void 0 === e) throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called');
- return e
- }
- function Do(e) {
- return (Do = Object.setPrototypeOf ? Object.getPrototypeOf : function (e) {
- return e.__proto__ || Object.getPrototypeOf(e)
- }) (e)
- }
- function jo(e, t, n) {
- return t in e ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n,
- e
- }
- var To = function () {
- !function (e, t) {
- if ('function' != typeof t && null !== t) throw new TypeError('Super expression must either be null or a function');
- e.prototype = Object.create(t && t.prototype, {
- constructor: {
- value: e,
- writable: !0,
- configurable: !0
- }
- }),
- t && Ro(e, t)
- }(o, A);
- var e,
- t,
- n,
- r = xo(o);
- function o() {
- var n;
- !function (e, t) {
- if (!(e instanceof t)) throw new TypeError('Cannot call a class as a function')
- }(this, o);
- for (var e = arguments.length, t = Array(e), a = 0; a < e; a++) t[a] = arguments[a];
- return jo(Ao(n = r.call.apply(r, [
- this
- ].concat(t))), 'state', {
- embeddedCheckout: null
- }),
- jo(Ao(n), 'loadStripeCheckout', function () {
- var e = n.props,
- t = e.stripeInstance;
- t && t.initEmbeddedCheckout({
- fetchClientSecret: e.createStripeCheckoutSession
- }).then(function (e) {
- e = e.embeddedCheckout;
- n.setState({
- embeddedCheckout: e
- }),
- e.mount('#checkout')
- })
- }),
- n
- }
- return e = o,
- (t = [
- {
- key: 'componentDidMount',
- value: function () {
- this.props.addStripeCheckoutScript().done(this.loadStripeCheckout)
- }
- },
- {
- key: 'componentWillUnmount',
- value: function () {
- this.state.embeddedCheckout && this.state.embeddedCheckout.destroy()
- }
- },
- {
- key: 'render',
- value: function () {
- return C.a.createElement('section', null, C.a.createElement('div', {
- className: 'content__wrap --checkout'
- }, C.a.createElement('header', {
- className: 'checkout__header'
- }, C.a.createElement('img', {
- src: '//c.disquscdn.com/next/current/publisher-admin/assets/img/disqus-logo-blue-transparent.png',
- width: '174',
- height: '32',
- alt: 'Disqus',
- title: 'Disqus'
- }), C.a.createElement('h2', {
- className: 'checkout__title'
- }, 'Checkout')), C.a.createElement('div', {
- id: 'checkout'
- })))
- }
- }
- ]) && Co(e.prototype, t),
- n && Co(e, n),
- o
- }();
- jo(To, 'propTypes', {
- stripeInstance: b.a.object,
- addStripeCheckoutScript: b.a.func.isRequired,
- createStripeCheckoutSession: b.a.func.isRequired
- });
- var Io = Object(u.connect) (function (e) {
- return {
- stripeInstance: e.stripeCheckout.stripeInstance
- }
- }, {
- addStripeCheckoutScript: ko.addStripeCheckoutScript,
- createStripeCheckoutSession: ko.createStripeCheckoutSession
- }) (To),
- qo = n(32),
- Fo = n.n(qo),
- Lo = function (e) {
- var t = e.children,
- n = e.linkActiveClassName,
- a = e.linkClassName,
- r = e.path,
- o = e.selection,
- i = e.activeRoutes,
- s = e.forumId,
- l = e.onlyActiveOnIndex,
- c = e.history,
- u = e.forceActive,
- e = e.disabled;
- if (s && (o.type === ft.global || o.type === ft.organization || o.forum.id !== s)) {
- s = '//'.concat(s, '.').concat(br.disqusHost, '/admin').concat(r);
- return C.a.createElement('a', {
- href: s,
- className: a
- }, t)
- }
- n = n || 'active',
- a = u || (i || [
- ]).some(function (e) {
- return c.isActive(e)
- }) ? ''.concat(a, ' ').concat(n) : a;
- return C.a.createElement(l ? v.IndexLink : v.Link, {
- to: r,
- className: a,
- activeClassName: n,
- disabled: e
- }, t)
- };
- Lo.propTypes = {
- children: b.a.node.isRequired,
- linkActiveClassName: b.a.string,
- linkClassName: b.a.string,
- path: b.a.string.isRequired,
- selection: ht.isRequired,
- activeRoutes: b.a.arrayOf(b.a.string),
- forumId: b.a.string,
- onlyActiveOnIndex: b.a.bool,
- history: b.a.shape({
- isActive: b.a.func.isRequired
- }).isRequired,
- forceActive: b.a.bool,
- disabled: b.a.bool
- };
- var Uo = Fo() (Lo),
- Mo = n(146),
- Bo = n.n(Mo);
- function zo(t, e) {
- var n,
- a = Object.keys(t);
- return Object.getOwnPropertySymbols && (n = Object.getOwnPropertySymbols(t), e && (n = n.filter(function (e) {
- return Object.getOwnPropertyDescriptor(t, e).enumerable
- })), a.push.apply(a, n)),
- a
- }
- function Ho(t) {
- for (var e = 1; e < arguments.length; e++) {
- var n = null != arguments[e] ? arguments[e] : {
- };
- e % 2 ? zo(Object(n), !0).forEach(function (e) {
- Go(t, e, n[e])
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(n)) : zo(Object(n)).forEach(function (e) {
- Object.defineProperty(t, e, Object.getOwnPropertyDescriptor(n, e))
- })
- }
- return t
- }
- function Go(e, t, n) {
- return t in e ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n,
- e
- }
- function Vo() {
- return (Vo = Object.assign || function (e) {
- for (var t = 1; t < arguments.length; t++) {
- var n,
- a = arguments[t];
- for (n in a) Object.prototype.hasOwnProperty.call(a, n) && (e[n] = a[n])
- }
- return e
- }).apply(this, arguments)
- }
- function Wo(e) {
- var t = {
- };
- return (e = e || {
- }).type === ft.forum ? Vo(t, {
- object_type: 'forum',
- object_id: e.forum.shortname,
- forum_id: e.forum.id
- }) : e.type === ft.organization && Vo(t, {
- object_type: 'organization',
- object_id: e.organization.id
- }),
- e.organization && (t.organization_id = e.organization.id),
- t
- }
- function Yo(e, t) {
- return Bo.a.client.emit(Ho(Ho(Ho({
- }, Ko), {
- }, {
- user_id: Qo.id
- }, Wo(e)), t))
- }
- var Qo = Ve.a.getFromCookie(),
- Ko = Object.freeze({
- product: 'publisher_admin'
- }),
- Jo = {
- ADS_KEYS: [
- 'adsPositionTopEnabled',
- 'adsPositionBottomEnabled',
- 'adsPositionInthreadEnabled',
- 'adsPositionRecommendationsEnabled',
- 'adsProductDisplayEnabled',
- 'adsProductStoriesEnabled',
- 'adsProductLinksEnabled',
- 'adsProductVideoEnabled'
- ],
- getSelectionData: Wo,
- ensureBooleans: function (n) {
- return Object.keys(n || {
- }).reduce(function (e, t) {
- return Ho(Ho({
- }, e), {
- }, Go({
- }, t, !!n[t]))
- }, {
- })
- },
- emitEvent: Yo,
- trackSettingsChanges: function (e) {
- var n = (e = e || {
- }).oldState || {
- },
- a = e.newState || {
- },
- t = e.jesterData,
- r = !e.keys,
- o = (e.keys || Object.keys(Ho(Ho({
- }, n), a))).reduce(function (e, t) {
- return r && n[t] === a[t] ? e : Ho(Ho({
- }, e), {
- }, Go({
- }, t, {
- before: n[t],
- after: a[t]
- }))
- }, {
- }),
- o = Object.keys(o).length ? JSON.stringify(o) : void 0;
- Yo(e.selection, Ho({
- extra_data: o
- }, t))
- }
- };
- function $o(t, e) {
- var n,
- a = Object.keys(t);
- return Object.getOwnPropertySymbols && (n = Object.getOwnPropertySymbols(t), e && (n = n.filter(function (e) {
- return Object.getOwnPropertyDescriptor(t, e).enumerable
- })), a.push.apply(a, n)),
- a
- }
- function Zo(a) {
- for (var e = 1; e < arguments.length; e++) {
- var r = null != arguments[e] ? arguments[e] : {
- };
- e % 2 ? $o(Object(r), !0).forEach(function (e) {
- var t,
- n;
- n = r[t = e],
- t in (e = a) ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(a, Object.getOwnPropertyDescriptors(r)) : $o(Object(r)).forEach(function (e) {
- Object.defineProperty(a, e, Object.getOwnPropertyDescriptor(r, e))
- })
- }
- return a
- }
- function Xo(a) {
- return function (n) {
- return function (e, t) {
- t = t().selection;
- Jo.emitEvent(t, Zo(Zo({
- }, a), n))
- }
- }
- }
- function ei(n) {
- return function () {
- return function (e, t) {
- t = t().selection;
- Jo.emitEvent(t, Zo(Zo({
- }, n), {
- }, {
- verb: 'view'
- }))
- }
- }
- }
- var ti = function (e) {
- var t = e.linkClassName,
- n = ho.getAdminPath();
- return (e.activeRoutes || [
- e.path
- ]).some(function (e) {
- return e.test ? e.test(n) : n === e
- }) && (t += ' '.concat(e.linkActiveClassName || 'active')),
- C.a.createElement(v.Link, {
- to: ho.getRoute(e.path),
- className: t,
- activeClassName: e.linkActiveClassName,
- disabled: e.disabled
- }, e.children)
- };
- ti.propTypes = {
- children: b.a.node.isRequired,
- linkActiveClassName: b.a.string,
- linkClassName: b.a.string,
- path: b.a.string.isRequired,
- activeRoutes: b.a.arrayOf(b.a.oneOfType([b.a.string,
- b.a.instanceOf(RegExp)])),
- disabled: b.a.bool
- };
- var ni = ti,
- ai = function (e) {
- return C.a.createElement(ni, {
- linkActiveClassName: e.linkActiveClassName,
- linkClassName: e.linkClassName,
- path: e.path,
- activeRoutes: e.activeRoutes,
- disabled: e.disabled
- }, e.children)
- };
- ai.propTypes = {
- children: b.a.node.isRequired,
- linkActiveClassName: b.a.string,
- linkClassName: b.a.string,
- path: b.a.string.isRequired,
- activeRoutes: b.a.arrayOf(b.a.oneOfType([b.a.string,
- b.a.instanceOf(RegExp)])),
- disabled: b.a.bool
- };
- var ri = ai;
- function oi(e) {
- return (oi = 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator ? function (e) {
- return typeof e
- }
- : function (e) {
- return e && 'function' == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? 'symbol' : typeof e
- }) (e)
- }
- function ii(e, t) {
- for (var n = 0; n < t.length; n++) {
- var a = t[n];
- a.enumerable = a.enumerable || !1,
- a.configurable = !0,
- 'value' in a && (a.writable = !0),
- Object.defineProperty(e, a.key, a)
- }
- }
- function si(e, t) {
- return (si = Object.setPrototypeOf || function (e, t) {
- return e.__proto__ = t,
- e
- }) (e, t)
- }
- function li(n) {
- var a = function () {
- if ('undefined' == typeof Reflect || !Reflect.construct) return !1;
- if (Reflect.construct.sham) return !1;
- if ('function' == typeof Proxy) return !0;
- try {
- return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [
- ], function () {
- })),
- !0
- } catch (e) {
- return !1
- }
- }();
- return function () {
- var e,
- t = ui(n);
- return e = a ? (e = ui(this).constructor, Reflect.construct(t, arguments, e)) : t.apply(this, arguments),
- t = this,
- !(e = e) || 'object' !== oi(e) && 'function' != typeof e ? ci(t) : e
- }
- }
- function ci(e) {
- if (void 0 === e) throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called');
- return e
- }
- function ui(e) {
- return (ui = Object.setPrototypeOf ? Object.getPrototypeOf : function (e) {
- return e.__proto__ || Object.getPrototypeOf(e)
- }) (e)
- }
- function pi(e, t, n) {
- return t in e ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n,
- e
- }
- var di = function () {
- !function (e, t) {
- if ('function' != typeof t && null !== t) throw new TypeError('Super expression must either be null or a function');
- e.prototype = Object.create(t && t.prototype, {
- constructor: {
- value: e,
- writable: !0,
- configurable: !0
- }
- }),
- t && si(e, t)
- }(o, A);
- var e,
- t,
- n,
- r = li(o);
- function o() {
- var t;
- !function (e, t) {
- if (!(e instanceof t)) throw new TypeError('Cannot call a class as a function')
- }(this, o);
- for (var e = arguments.length, n = Array(e), a = 0; a < e; a++) n[a] = arguments[a];
- return pi(ci(t = r.call.apply(r, [
- this
- ].concat(n))), 'state', {
- isOpen: !1
- }),
- pi(ci(t), 'handleClick', function () {
- t.setState({
- isOpen: !t.state.isOpen
- })
- }),
- pi(ci(t), 'reportClick', function (e) {
- t.props.emitTrackingEvent({
- verb: 'click',
- area: 'side_panel',
- object_type: 'button',
- object_id: e
- })
- }),
- pi(ci(t), 'isAdvancedAnalyticsSupported', function () {
- if (!t.props.selection.organization) return !1;
- var e = t.props.saasFeatures[t.props.selection.organization.id];
- return e && e.advancedAnalytics
- }),
- t
- }
- return e = o,
- (t = [
- {
- key: 'render',
- value: function () {
- var e = this.state.isOpen ? 'nav__item dropdown-open' : 'nav__item',
- t = this.isAdvancedAnalyticsSupported(),
- n = t ? Uo : ri,
- a = yo.a.isFeatureActive('reactions_analytics') ? C.a.createElement(Uo, {
- linkClassName: e,
- linkActiveClassName: 'active',
- path: '/analytics/reactions/',
- selection: this.props.selection,
- disabled: this.props.pollsOnly
- }, C.a.createElement('div', {
- className: 'nav-lnk -color-muted'
- }, C.a.createElement('div', {
- className: 'nav-lnk__blk'
- }, C.a.createElement('span', {
- className: 'button__text'
- }, 'Reactions')), C.a.createElement('div', {
- className: 'nav-lnk__pointer'
- }, C.a.createElement('span', {
- className: 'icon icon-right-bracket'
- })))) : null,
- r = yo.a.isFeatureActive('customer_pulse_analytics') ? C.a.createElement(Uo, {
- linkClassName: e,
- linkActiveClassName: 'active',
- path: '/analytics/pulse/',
- selection: this.props.selection,
- disabled: this.props.pollsOnly
- }, C.a.createElement('div', {
- className: 'nav-lnk -color-muted'
- }, C.a.createElement('div', {
- className: 'nav-lnk__blk'
- }, C.a.createElement('span', {
- className: 'button__text'
- }, 'Attention Analytics')), C.a.createElement('div', {
- className: 'nav-lnk__pointer'
- }, C.a.createElement('span', {
- className: 'icon icon-right-bracket'
- })))) : null;
- return C.a.createElement('nav', null, C.a.createElement('div', {
- className: 'nav--tablet-dropdown',
- onClick: this.handleClick
- }, C.a.createElement(n, {
- linkClassName: e,
- linkActiveClassName: 'active',
- path: '/analytics/comments/',
- selection: this.props.selection,
- disabled: this.props.pollsOnly
- }, C.a.createElement('div', {
- className: 'nav-lnk -color-muted',
- onClick: this.reportClick.bind(this, 'overview')
- }, C.a.createElement('div', {
- className: 'nav-lnk__blk'
- }, C.a.createElement('span', {
- className: 'button__text'
- }, 'Overview')), C.a.createElement('div', {
- className: 'nav-lnk__pointer'
- }, C.a.createElement('span', {
- className: 'icon icon-right-bracket'
- })))), a, t ? C.a.createElement(C.a.Fragment, null, C.a.createElement(Uo, {
- linkClassName: e,
- linkActiveClassName: 'active',
- path: '/analytics/content/',
- selection: this.props.selection,
- disabled: this.props.pollsOnly
- }, C.a.createElement('div', {
- className: 'nav-lnk -color-muted',
- onClick: this.reportClick.bind(this, 'content')
- }, C.a.createElement('div', {
- className: 'nav-lnk__blk'
- }, C.a.createElement('span', {
- className: 'button__text'
- }, 'Content Analysis')), C.a.createElement('div', {
- className: 'nav-lnk__pointer'
- }, C.a.createElement('span', {
- className: 'icon icon-right-bracket'
- })))), C.a.createElement(Uo, {
- linkClassName: e,
- linkActiveClassName: 'active',
- path: '/analytics/audience/',
- selection: this.props.selection,
- disabled: this.props.pollsOnly
- }, C.a.createElement('div', {
- className: 'nav-lnk -color-muted'
- }, C.a.createElement('div', {
- className: 'nav-lnk__blk'
- }, C.a.createElement('span', {
- className: 'button__text'
- }, 'Audience Analysis')), C.a.createElement('div', {
- className: 'nav-lnk__pointer'
- }, C.a.createElement('span', {
- className: 'icon icon-right-bracket'
- })))), C.a.createElement(ri, {
- linkClassName: e,
- linkActiveClassName: 'active',
- path: '/analytics/top_comments/',
- disabled: this.props.pollsOnly
- }, C.a.createElement('div', {
- className: 'nav-lnk -color-muted'
- }, C.a.createElement('div', {
- className: 'nav-lnk__blk'
- }, C.a.createElement('span', {
- className: 'button__text'
- }, 'Top comments')), C.a.createElement('div', {
- className: 'nav-lnk__pointer'
- }, C.a.createElement('span', {
- className: 'icon icon-right-bracket'
- }))))) : null, r))
- }
- }
- ]) && ii(e.prototype, t),
- n && ii(e, n),
- o
- }();
- pi(di, 'propTypes', {
- selection: ht.isRequired,
- emitTrackingEvent: b.a.func.isRequired,
- saasFeatures: b.a.objectOf(b.a.objectOf(b.a.bool)).isRequired,
- pollsOnly: b.a.bool
- });
- var mi = Object(u.connect) (function (e) {
- return {
- saasFeatures: e.saasFeatures
- }
- }, {
- emitTrackingEvent: Xo({
- zone: 'analytics'
- })
- }) (di);
- function fi(e) {
- return (fi = 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator ? function (e) {
- return typeof e
- }
- : function (e) {
- return e && 'function' == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? 'symbol' : typeof e
- }) (e)
- }
- function hi(e, t) {
- for (var n = 0; n < t.length; n++) {
- var a = t[n];
- a.enumerable = a.enumerable || !1,
- a.configurable = !0,
- 'value' in a && (a.writable = !0),
- Object.defineProperty(e, a.key, a)
- }
- }
- function gi(e, t) {
- return (gi = Object.setPrototypeOf || function (e, t) {
- return e.__proto__ = t,
- e
- }) (e, t)
- }
- function yi(n) {
- var a = function () {
- if ('undefined' == typeof Reflect || !Reflect.construct) return !1;
- if (Reflect.construct.sham) return !1;
- if ('function' == typeof Proxy) return !0;
- try {
- return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [
- ], function () {
- })),
- !0
- } catch (e) {
- return !1
- }
- }();
- return function () {
- var e,
- t = vi(n);
- return e = a ? (e = vi(this).constructor, Reflect.construct(t, arguments, e)) : t.apply(this, arguments),
- t = this,
- !(e = e) || 'object' !== fi(e) && 'function' != typeof e ? bi(t) : e
- }
- }
- function bi(e) {
- if (void 0 === e) throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called');
- return e
- }
- function vi(e) {
- return (vi = Object.setPrototypeOf ? Object.getPrototypeOf : function (e) {
- return e.__proto__ || Object.getPrototypeOf(e)
- }) (e)
- }
- function _i(e, t, n) {
- return t in e ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n,
- e
- }
- var Ei = [
- '/discussions/import/',
- '/discussions/import/platform/wordpress/',
- '/discussions/import/platform/blogger/',
- '/discussions/import/platform/movabletype/',
- '/discussions/import/platform/intensedebate/',
- '/discussions/import/platform/generic/'
- ],
- Oi = function () {
- !function (e, t) {
- if ('function' != typeof t && null !== t) throw new TypeError('Super expression must either be null or a function');
- e.prototype = Object.create(t && t.prototype, {
- constructor: {
- value: e,
- writable: !0,
- configurable: !0
- }
- }),
- t && gi(e, t)
- }(o, A);
- var e,
- t,
- n,
- r = yi(o);
- function o() {
- var e;
- !function (e, t) {
- if (!(e instanceof t)) throw new TypeError('Cannot call a class as a function')
- }(this, o);
- for (var t = arguments.length, n = Array(t), a = 0; a < t; a++) n[a] = arguments[a];
- return _i(bi(e = r.call.apply(r, [
- this
- ].concat(n))), 'state', {
- isOpen: !1
- }),
- _i(bi(e), 'handleClick', function () {
- e.setState({
- isOpen: !e.state.isOpen
- })
- }),
- _i(bi(e), 'getSettingTab', function () {
- return {
- title: yo.a.isFeatureActive('polls_pub_admin') ? 'Settings' : 'Configuration',
- link: '/settings/moderation/'
- }
- }),
- e
- }
- return e = o,
- (t = [
- {
- key: 'render',
- value: function () {
- var e = this.props.selection.type === ft.forum && this.props.selection.forum,
- t = this.state.isOpen ? 'nav__item dropdown-open' : 'nav__item',
- n = e && e.features && e.features.logs,
- a = this.props.selection[this.props.selection.type].canAdminister,
- e = this.getSettingTab();
- return C.a.createElement('nav', {
- className: 'layout__nav'
- }, C.a.createElement('div', {
- className: 'nav__subheadings nav__spacing',
- key: 'left-secondary-nav-header'
- }, C.a.createElement('h4', {
- className: 'text-subheading'
- }, 'General')), C.a.createElement('div', {
- className: 'nav--tablet-dropdown'
- }, C.a.createElement(v.Link, {
- className: t,
- activeClassName: 'active',
- to: ho.getRoute('/moderate/'),
- onClick: this.handleClick,
- disabled: this.props.pollsOnly
- }, C.a.createElement('div', {
- className: 'nav-lnk -color-muted'
- }, C.a.createElement('div', {
- className: 'nav-lnk__blk'
- }, C.a.createElement('span', {
- className: 'button__text'
- }, 'Moderate comments')), C.a.createElement('div', {
- className: 'nav-lnk__pointer'
- }, C.a.createElement('span', {
- className: 'icon icon-right-bracket'
- })))), yo.a.isFeatureActive('polls_pub_admin') && C.a.createElement(C.a.Fragment, null, C.a.createElement('div', {
- className: 'nav__subheadings nav__spacing',
- key: 'left-secondary-nav-header'
- }, C.a.createElement('h4', {
- className: 'text-subheading'
- }, 'Analytics')), C.a.createElement(mi, {
- selection: this.props.selection,
- pollsOnly: this.props.pollsOnly
- })), C.a.createElement('div', null, C.a.createElement('div', {
- className: 'nav__subheadings nav__spacing'.concat(this.state.isOpen ? '' : ' hidden-lg'),
- key: 'left-secondary-nav-header'
- }, C.a.createElement('h4', {
- className: 'text-subheading'
- }, yo.a.isFeatureActive('polls_pub_admin') ? 'Configuration' : 'Settings')), a ? C.a.createElement(Uo, {
- linkClassName: t,
- linkActiveClassName: 'active',
- path: e.link,
- selection: this.props.selection,
- disabled: this.props.pollsOnly
- }, C.a.createElement('div', {
- className: 'nav-lnk -color-muted'
- }, C.a.createElement('div', {
- className: 'nav-lnk__blk'
- }, C.a.createElement('span', {
- className: 'button__text'
- }, e.title)), C.a.createElement('div', {
- className: 'nav-lnk__pointer'
- }, C.a.createElement('span', {
- className: 'icon icon-right-bracket'
- })))) : null, !yo.a.isFeatureActive('polls_pub_admin') && a && C.a.createElement(Uo, {
- linkClassName: t,
- linkActiveClassName: 'active',
- path: '/settings/moderators/',
- selection: this.props.selection,
- disabled: this.props.pollsOnly
- }, C.a.createElement('div', {
- className: 'nav-lnk -color-muted'
- }, C.a.createElement('div', {
- className: 'nav-lnk__blk'
- }, C.a.createElement('span', {
- className: 'button__text'
- }, 'Moderators')), C.a.createElement('div', {
- className: 'nav-lnk__pointer'
- }, C.a.createElement('span', {
- className: 'icon icon-right-bracket'
- })))), a ? C.a.createElement(Uo, {
- linkClassName: t,
- linkActiveClassName: 'active',
- path: '/settings/access/',
- selection: this.props.selection,
- disabled: this.props.pollsOnly
- }, C.a.createElement('div', {
- className: 'nav-lnk -color-muted'
- }, C.a.createElement('div', {
- className: 'nav-lnk__blk'
- }, C.a.createElement('span', {
- className: 'button__text'
- }, 'Word filters')), C.a.createElement('div', {
- className: 'nav-lnk__pointer'
- }, C.a.createElement('span', {
- className: 'icon icon-right-bracket'
- })))) : null, C.a.createElement(Uo, {
- linkClassName: t,
- linkActiveClassName: 'active',
- path: '/access/banned/',
- selection: this.props.selection,
- activeRoutes: [
- '/access/banned/',
- '/access/trusted/'
- ],
- disabled: this.props.pollsOnly
- }, C.a.createElement('div', {
- className: 'nav-lnk -color-muted'
- }, C.a.createElement('div', {
- className: 'nav-lnk__blk'
- }, C.a.createElement('span', {
- className: 'button__text'
- }, 'Banned users')), C.a.createElement('div', {
- className: 'nav-lnk__pointer'
- }, C.a.createElement('span', {
- className: 'icon icon-right-bracket'
- }))))), a ? C.a.createElement('div', null, C.a.createElement('div', {
- className: 'nav__subheadings nav__spacing'.concat(this.state.isOpen ? '' : ' hidden-lg'),
- key: 'left-secondary-nav-header'
- }, C.a.createElement('h4', {
- className: 'text-subheading'
- }, 'Tools')), C.a.createElement(Uo, {
- linkClassName: t,
- linkActiveClassName: 'active',
- path: '/discussions/',
- selection: this.props.selection,
- onlyActiveOnIndex: !0,
- disabled: this.props.pollsOnly
- }, C.a.createElement('div', {
- className: 'nav-lnk -color-muted'
- }, C.a.createElement('div', {
- className: 'nav-lnk__blk'
- }, C.a.createElement('span', {
- className: 'button__text'
- }, 'Discussions')), C.a.createElement('div', {
- className: 'nav-lnk__pointer'
- }, C.a.createElement('span', {
- className: 'icon icon-right-bracket'
- })))), C.a.createElement(Uo, {
- linkClassName: t,
- linkActiveClassName: 'active',
- path: '/discussions/migrate/',
- selection: this.props.selection,
- activeRoutes: [
- '/discussions/migrate/',
- 'tools/migrate-map/'
- ],
- disabled: this.props.pollsOnly
- }, C.a.createElement('div', {
- className: 'nav-lnk -color-muted'
- }, C.a.createElement('div', {
- className: 'nav-lnk__blk'
- }, C.a.createElement('span', {
- className: 'button__text'
- }, 'Migration Tools')), C.a.createElement('div', {
- className: 'nav-lnk__pointer'
- }, C.a.createElement('span', {
- className: 'icon icon-right-bracket'
- })))), C.a.createElement(Uo, {
- linkClassName: t,
- linkActiveClassName: 'active',
- path: '/discussions/import/platform/wordpress/',
- selection: this.props.selection,
- activeRoutes: Ei,
- disabled: this.props.pollsOnly
- }, C.a.createElement('div', {
- className: 'nav-lnk -color-muted'
- }, C.a.createElement('div', {
- className: 'nav-lnk__blk'
- }, C.a.createElement('span', {
- className: 'button__text'
- }, 'Import')), C.a.createElement('div', {
- className: 'nav-lnk__pointer'
- }, C.a.createElement('span', {
- className: 'icon icon-right-bracket'
- })))), C.a.createElement(Uo, {
- linkClassName: t,
- linkActiveClassName: 'active',
- path: '/discussions/export/',
- selection: this.props.selection,
- disabled: this.props.pollsOnly
- }, C.a.createElement('div', {
- className: 'nav-lnk -color-muted'
- }, C.a.createElement('div', {
- className: 'nav-lnk__blk'
- }, C.a.createElement('span', {
- className: 'button__text'
- }, 'Export')), C.a.createElement('div', {
- className: 'nav-lnk__pointer'
- }, C.a.createElement('span', {
- className: 'icon icon-right-bracket'
- })))), n ? C.a.createElement(Uo, {
- linkClassName: t,
- linkActiveClassName: 'active',
- path: '/discussions/history/',
- selection: this.props.selection,
- disabled: this.props.pollsOnly
- }, C.a.createElement('div', {
- className: 'nav-lnk -color-muted'
- }, C.a.createElement('div', {
- className: 'nav-lnk__blk'
- }, C.a.createElement('span', {
- className: 'button__text'
- }, 'History logs')), C.a.createElement('div', {
- className: 'nav-lnk__pointer'
- }, C.a.createElement('span', {
- className: 'icon icon-right-bracket'
- })))) : null) : null))
- }
- }
- ]) && hi(e.prototype, t),
- n && hi(e, n),
- o
- }();
- _i(Oi, 'propTypes', {
- selection: ht.isRequired,
- saasFeatures: b.a.objectOf(b.a.objectOf(b.a.bool)).isRequired,
- pollsOnly: b.a.bool
- });
- var Si = Object(u.connect) (function (e) {
- return {
- saasFeatures: e.saasFeatures
- }
- }) (Oi),
- wi = function (e) {
- return C.a.createElement('div', {
- className: 'section-contained'
- }, C.a.createElement('div', {
- className: 'layout layout--publishers'
- }, C.a.createElement('div', {
- className: 'layout__main'
- }, C.a.createElement(Si, {
- selection: e.selection
- }), C.a.createElement('div', {
- className: 'layout__content'
- }, C.a.createElement('div', {
- className: 'content__wrap spacing-bottom-double'
- }, C.a.createElement('header', {
- className: 'settings__header'
- }, C.a.createElement('h2', {
- className: 'text-gray-darker text-larger spacing-bottom'
- }, 'Banned and Trusted Users'), C.a.createElement('p', {
- className: 'text-gray'
- }, 'Control lists allow you to control who is able to participate within your community. You can specify items such as users, emails, IP addresses, and words. Banned items prevent certain people from posting, while Trusted items allow users to bypass certain moderation filters (such as spam).')), C.a.createElement('section', {
- className: 'settings__content'
- }, e.children))))))
- };
- wi.displayName = 'Access',
- wi.propTypes = {
- children: b.a.node.isRequired,
- forums: b.a.object.isRequired,
- organizations: b.a.object.isRequired,
- selection: ht.isRequired
- };
- var Pi = Object(u.connect) (function (e) {
- return {
- selection: e.selection
- }
- }) (wi),
- ki = n(29),
- Ni = n.n(ki),
- Ci = [
- {
- permissions: [
- 'canModerate'
- ],
- lists: [
- 'blacklist',
- 'whitelist'
- ],
- isChannelVisible: !0,
- value: 'user',
- displayName: 'Username'
- },
- {
- permissions: [
- 'canModerate'
- ],
- lists: [
- 'blacklist',
- 'whitelist'
- ],
- isChannelVisible: !1,
- value: 'email',
- displayName: 'Email address'
- },
- {
- permissions: [
- 'canModerate'
- ],
- lists: [
- 'blacklist'
- ],
- isChannelVisible: !1,
- value: 'ip',
- displayName: 'IP address'
- },
- {
- permissions: [
- 'canModerate',
- 'canAdminister'
- ],
- lists: [
- 'blacklist'
- ],
- isChannelVisible: !1,
- value: 'domain',
- displayName: 'Domain'
- }
- ];
- function Ri(e) {
- return (Ri = 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator ? function (e) {
- return typeof e
- }
- : function (e) {
- return e && 'function' == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? 'symbol' : typeof e
- }) (e)
- }
- function xi(e, t) {
- for (var n = 0; n < t.length; n++) {
- var a = t[n];
- a.enumerable = a.enumerable || !1,
- a.configurable = !0,
- 'value' in a && (a.writable = !0),
- Object.defineProperty(e, a.key, a)
- }
- }
- function Ai(e, t) {
- return (Ai = Object.setPrototypeOf || function (e, t) {
- return e.__proto__ = t,
- e
- }) (e, t)
- }
- function Di(n) {
- var a = function () {
- if ('undefined' == typeof Reflect || !Reflect.construct) return !1;
- if (Reflect.construct.sham) return !1;
- if ('function' == typeof Proxy) return !0;
- try {
- return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [
- ], function () {
- })),
- !0
- } catch (e) {
- return !1
- }
- }();
- return function () {
- var e,
- t = Ti(n);
- return e = a ? (e = Ti(this).constructor, Reflect.construct(t, arguments, e)) : t.apply(this, arguments),
- t = this,
- !(e = e) || 'object' !== Ri(e) && 'function' != typeof e ? ji(t) : e
- }
- }
- function ji(e) {
- if (void 0 === e) throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called');
- return e
- }
- function Ti(e) {
- return (Ti = Object.setPrototypeOf ? Object.getPrototypeOf : function (e) {
- return e.__proto__ || Object.getPrototypeOf(e)
- }) (e)
- }
- function Ii(e, t, n) {
- return t in e ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n,
- e
- }
- var qi = 'desc',
- Fi = function () {
- !function (e, t) {
- if ('function' != typeof t && null !== t) throw new TypeError('Super expression must either be null or a function');
- e.prototype = Object.create(t && t.prototype, {
- constructor: {
- value: e,
- writable: !0,
- configurable: !0
- }
- }),
- t && Ai(e, t)
- }(o, A);
- var e,
- t,
- n,
- r = Di(o);
- function o() {
- var a;
- !function (e, t) {
- if (!(e instanceof t)) throw new TypeError('Cannot call a class as a function')
- }(this, o);
- for (var e = arguments.length, t = Array(e), n = 0; n < e; n++) t[n] = arguments[n];
- return Ii(ji(a = r.call.apply(r, [
- this
- ].concat(t))), 'state', {
- items: [
- ],
- cursor: {
- },
- query: null,
- fetchError: null,
- isFetching: !1,
- saveError: null,
- isSaving: !1
- }),
- Ii(ji(a), 'fetchAccessList', function (e, t) {
- a.setState({
- isFetching: !0,
- fetchError: null,
- currentPage: t
- });
- t = {
- type: je.a.pluck(a.filterTypesForSelection(e), 'value'),
- cursor: t,
- query: a.state.query,
- order: qi,
- forum: a.props.selection.forum.shortname
- };
- return a.apiCall = io.a.call(''.concat(e, 's/list.json'), {
- data: t
- }).done(a.handleFetchSuccess).error(a.handleFetchError),
- a.apiCall
- }),
- Ii(ji(a), 'handleFetchSuccess', function (e) {
- a.setState({
- items: e.response,
- cursor: e.cursor,
- isFetching: !1
- })
- }),
- Ii(ji(a), 'handleFetchError', function (e) {
- var t;
- try {
- t = JSON.parse(e.responseText).response
- } catch (e) {
- t = 'There was an error loading this list.'
- }
- a.setState({
- fetchError: t,
- isFetching: !1
- })
- }),
- Ii(ji(a), 'handleQuerySubmit', function (e) {
- a.setState({
- query: e
- }, a.fetchAccessList.bind(ji(a), a.props.route.accessListType))
- }),
- Ii(ji(a), 'handlePaginateNext', function () {
- !a.isFetching && a.state.cursor.hasNext && a.fetchAccessList(a.props.route.accessListType, a.state.cursor.next)
- }),
- Ii(ji(a), 'handlePaginatePrev', function () {
- !a.isFetching && a.state.cursor.hasPrev && a.fetchAccessList(a.props.route.accessListType, a.state.cursor.prev)
- }),
- Ii(ji(a), 'handleClearSaveError', function () {
- a.setState({
- saveError: null
- })
- }),
- Ii(ji(a), 'handleRemoveItem', function (e) {
- a.setState({
- isSaving: !0,
- saveError: null
- });
- var t = {
- forum: a.props.selection.forum.shortname
- };
- return 'blacklist' === a.props.route.accessListType ? t.blacklist = e.id : je.a.isObject(e.value) ? t[e.type] = e.value.id : t.id = e.id,
- io.a.call(''.concat(a.props.route.accessListType, 's/remove.json'), {
- type: 'POST',
- data: t
- }).done(a.handleSaveItemSuccess.bind(ji(a), a.state.currentPage)).error(a.handleSaveError)
- }),
- Ii(ji(a), 'handleAddItem', function (e) {
- a.setState({
- isSaving: !0,
- saveError: null
- });
- var t = {
- forum: a.props.selection.forum.shortname,
- notes: e.itemNotes
- };
- return 'user' === e.itemType && (e.itemValue = 'username:'.concat(e.itemValue)),
- t[e.itemType] = e.itemValue,
- 'blacklist' === e.itemList && (t.retroactive = e.retroactiveAction ? 1 : 0, t.shadowBan = 'shadow' === e.itemMethod || 'shadowban' === e.itemMethod ? 1 : 0),
- 'time' === e.itemMethod && (t.dateExpires = e.itemTime),
- 'temp' === e.itemMethod && (t.dateExpires = e.dateExpires),
- io.a.call(''.concat(e.itemList, 's/add.json'), {
- type: 'POST',
- data: t
- }).done(a.handleSaveItemSuccess.bind(ji(a), null)).error(a.handleSaveError)
- }),
- Ii(ji(a), 'handleSaveItemSuccess', function (e) {
- a.setState({
- isSaving: !1
- }),
- a.fetchAccessList(a.props.route.accessListType, e)
- }),
- Ii(ji(a), 'handleSaveError', function (e) {
- var t;
- try {
- t = JSON.parse(e.responseText).response
- } catch (e) {
- t = 'There was an error saving your changes.'
- }
- a.setState({
- saveError: t,
- isSaving: !1
- })
- }),
- Ii(ji(a), 'filterTypesForSelection', function (t) {
- var n = a.props.selection.forum;
- return je.a.filter(Ci, function (e) {
- return n.settings.IS_CHANNEL_PRIMARY_FORUM && !n.permissions.canAdminister ? e.isChannelVisible : je.a.contains(e.lists, t) && je.a.every(e.permissions, function (e) {
- return n.permissions[e]
- })
- })
- }),
- Ii(ji(a), 'getComponentProps', function () {
- return {
- accessListType: a.props.route.accessListType,
- accessOnFilterTypes: a.filterTypesForSelection,
- accessList: a.state.items,
- accessCursor: a.state.cursor,
- accessQuery: a.state.query,
- accessOnQuerySubmit: a.handleQuerySubmit,
- accessFetchError: a.state.fetchError,
- accessIsFetching: a.state.isFetching,
- accessSaveError: a.state.saveError,
- accessOnClearSaveError: a.handleClearSaveError,
- accessIsSaving: a.state.isSaving,
- accessOnPaginateNext: a.handlePaginateNext,
- accessOnPaginatePrev: a.handlePaginatePrev,
- accessOnRemoveItem: a.handleRemoveItem,
- accessOnAddItem: a.handleAddItem
- }
- }),
- a
- }
- return e = o,
- (t = [
- {
- key: 'componentDidMount',
- value: function () {
- this.fetchAccessList(this.props.route.accessListType)
- }
- },
- {
- key: 'componentWillUnmount',
- value: function () {
- this.apiCall && 'pending' === this.apiCall.state() && this.apiCall.abort()
- }
- },
- {
- key: 'componentWillReceiveProps',
- value: function (e) {
- e.route.accessListType !== this.props.route.accessListType && this.fetchAccessList(e.route.accessListType)
- }
- }
- ]) && xi(e.prototype, t),
- n && xi(e, n),
- o
- }();
- Ii(Fi, 'displayName', 'AccessDriver'),
- Ii(Fi, 'propTypes', {
- selection: ht.isRequired,
- route: b.a.shape({
- accessListType: b.a.oneOf(['blacklist',
- 'whitelist']).isRequired
- }).isRequired
- });
- var Li = Object(ki.createDriver) (Fi);
- function Ui(e) {
- return (Ui = 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator ? function (e) {
- return typeof e
- }
- : function (e) {
- return e && 'function' == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? 'symbol' : typeof e
- }) (e)
- }
- function Mi(e, t) {
- return (Mi = Object.setPrototypeOf || function (e, t) {
- return e.__proto__ = t,
- e
- }) (e, t)
- }
- function Bi(n) {
- var a = function () {
- if ('undefined' == typeof Reflect || !Reflect.construct) return !1;
- if (Reflect.construct.sham) return !1;
- if ('function' == typeof Proxy) return !0;
- try {
- return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [
- ], function () {
- })),
- !0
- } catch (e) {
- return !1
- }
- }();
- return function () {
- var e,
- t = Hi(n);
- return e = a ? (e = Hi(this).constructor, Reflect.construct(t, arguments, e)) : t.apply(this, arguments),
- t = this,
- !(e = e) || 'object' !== Ui(e) && 'function' != typeof e ? zi(t) : e
- }
- }
- function zi(e) {
- if (void 0 === e) throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called');
- return e
- }
- function Hi(e) {
- return (Hi = Object.setPrototypeOf ? Object.getPrototypeOf : function (e) {
- return e.__proto__ || Object.getPrototypeOf(e)
- }) (e)
- }
- function Gi(e, t, n) {
- return t in e ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n,
- e
- }
- var Vi = function () {
- !function (e, t) {
- if ('function' != typeof t && null !== t) throw new TypeError('Super expression must either be null or a function');
- e.prototype = Object.create(t && t.prototype, {
- constructor: {
- value: e,
- writable: !0,
- configurable: !0
- }
- }),
- t && Mi(e, t)
- }(o, A);
- var r = Bi(o);
- function o() {
- var e;
- !function (e, t) {
- if (!(e instanceof t)) throw new TypeError('Cannot call a class as a function')
- }(this, o);
- for (var t = arguments.length, n = Array(t), a = 0; a < t; a++) n[a] = arguments[a];
- return Gi(zi(e = r.call.apply(r, [
- this
- ].concat(n))), 'addUserToWhitelist', function (e) {
- return io.a.call('whitelists/add', {
- data: {
- forum: e.forumId,
- user: e.userId
- },
- method: 'POST'
- })
- }),
- Gi(zi(e), 'addUserToBlacklist', function (e) {
- var t = e.username,
- n = e.postId,
- a = e.ipAddress,
- r = e.email,
- o = e.retroactiveAction,
- i = e.reason,
- s = e.type,
- e = e.dateExpires;
- if (t || a || r) {
- e = {
- retroactiveAction: o,
- post: n,
- banUser: t ? 1 : 0,
- banIp: a ? 1 : 0,
- banEmail: r ? 1 : 0,
- notes: i,
- shadowBan: s === Wn.BAN_TYPES.SHADOW ? 1 : 0,
- dateExpires: e
- };
- return s === Wn.BAN_TYPES.PERMANENT && (e.retroactiveAction = o),
- io.a.call('forums/block/banPostAuthor.json', {
- data: e,
- method: 'POST'
- })
- }
- }),
- Gi(zi(e), 'getComponentProps', function () {
- return {
- addUserToWhitelist: e.addUserToWhitelist,
- addUserToBlacklist: e.addUserToBlacklist
- }
- }),
- e
- }
- return o
- }();
- Gi(Vi, 'displayName', 'ModerationUserListsDriver');
- var Wi = Object(ki.createDriver) (Vi),
- Yi = function (e) {
- return C.a.createElement('div', {
- className: [
- e.topMarginClass || 'spacing-top',
- 'alert',
- 'alert--'.concat(e.alertType || 'brand'),
- 'align align--between align--middle'
- ].join(' ')
- }, C.a.createElement('div', {
- className: 'spacing-narrow text-medium'
- }, C.a.createElement('span', {
- className: 'icon icon-warning icon__position',
- style: {
- paddingRight: '10px'
- }
- }), e.message), e.onRequestClose ? C.a.createElement('button', {
- className: 'link-inverted-opaque',
- onClick: e.onRequestClose
- }, C.a.createElement('span', {
- className: 'icon-cancel icon__position text-small',
- style: {
- paddingLeft: '3px'
- }
- })) : null)
- };
- Yi.displayName = 'AlertBar',
- Yi.propTypes = {
- message: b.a.node.isRequired,
- alertType: b.a.string,
- onRequestClose: b.a.func,
- topMarginClass: b.a.string
- };
- function Qi() {
- return C.a.createElement('div', {
- className: 'loading-spinner'
- })
- }
- var Ki = Yi,
- Ji = function () {
- return C.a.createElement('div', {
- className: 'loading-container'
- }, C.a.createElement(Qi, null))
- };
- function $i(e) {
- return ($i = 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator ? function (e) {
- return typeof e
- }
- : function (e) {
- return e && 'function' == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? 'symbol' : typeof e
- }) (e)
- }
- function Zi(t, e) {
- var n,
- a = Object.keys(t);
- return Object.getOwnPropertySymbols && (n = Object.getOwnPropertySymbols(t), e && (n = n.filter(function (e) {
- return Object.getOwnPropertyDescriptor(t, e).enumerable
- })), a.push.apply(a, n)),
- a
- }
- function Xi(t) {
- for (var e = 1; e < arguments.length; e++) {
- var n = null != arguments[e] ? arguments[e] : {
- };
- e % 2 ? Zi(Object(n), !0).forEach(function (e) {
- os(t, e, n[e])
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(n)) : Zi(Object(n)).forEach(function (e) {
- Object.defineProperty(t, e, Object.getOwnPropertyDescriptor(n, e))
- })
- }
- return t
- }
- function es(e, t) {
- for (var n = 0; n < t.length; n++) {
- var a = t[n];
- a.enumerable = a.enumerable || !1,
- a.configurable = !0,
- 'value' in a && (a.writable = !0),
- Object.defineProperty(e, a.key, a)
- }
- }
- function ts(e, t) {
- return (ts = Object.setPrototypeOf || function (e, t) {
- return e.__proto__ = t,
- e
- }) (e, t)
- }
- function ns(n) {
- var a = function () {
- if ('undefined' == typeof Reflect || !Reflect.construct) return !1;
- if (Reflect.construct.sham) return !1;
- if ('function' == typeof Proxy) return !0;
- try {
- return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [
- ], function () {
- })),
- !0
- } catch (e) {
- return !1
- }
- }();
- return function () {
- var e,
- t = rs(n);
- return e = a ? (e = rs(this).constructor, Reflect.construct(t, arguments, e)) : t.apply(this, arguments),
- t = this,
- !(e = e) || 'object' !== $i(e) && 'function' != typeof e ? as(t) : e
- }
- }
- function as(e) {
- if (void 0 === e) throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called');
- return e
- }
- function rs(e) {
- return (rs = Object.setPrototypeOf ? Object.getPrototypeOf : function (e) {
- return e.__proto__ || Object.getPrototypeOf(e)
- }) (e)
- }
- function os(e, t, n) {
- return t in e ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n,
- e
- }
- var is = {
- blacklist: 'Banned',
- whitelist: 'Trusted'
- },
- ss = [
- 10,
- 13
- ],
- ls = {
- itemType: 'user',
- itemValue: '',
- itemNotes: '',
- retroactive: !1
- },
- cs = function () {
- !function (e, t) {
- if ('function' != typeof t && null !== t) throw new TypeError('Super expression must either be null or a function');
- e.prototype = Object.create(t && t.prototype, {
- constructor: {
- value: e,
- writable: !0,
- configurable: !0
- }
- }),
- t && ts(e, t)
- }(r, A);
- var e,
- t,
- n,
- a = ns(r);
- function r(e) {
- var n;
- return function (e, t) {
- if (!(e instanceof t)) throw new TypeError('Cannot call a class as a function')
- }(this, r),
- os(as(n = a.call(this, e)), 'handleChangeValue', function (e) {
- var t = {
- };
- t[e.target.name] = 'checkbox' === e.target.type ? e.target.checked : e.target.value,
- n.setState(t)
- }),
- os(as(n), 'getPlaceholderForValue', function (e) {
- switch (e) {
- case 'email':
- return 'Enter an email address, e.g. someone@example.com';
- case 'user':
- return 'Enter a registered Disqus username';
- case 'domain':
- return 'Enter a domain, e.g. example.com';
- case 'ip':
- return 'Enter an IP address, e.g. 123.123.123.123';
- default:
- return ''
- }
- }),
- os(as(n), 'handleSubmitNewItem', function () {
- n.props.onSubmitNewItem(n.state)
- }),
- os(as(n), 'handleKeyUp', function (e) {
- ~ss.indexOf(e.keyCode) && n.props.onSubmitNewItem(n.state)
- }),
- n.state = Xi({
- itemList: e.initialList
- }, ls),
- n
- }
- return e = r,
- (t = [
- {
- key: 'componentWillReceiveProps',
- value: function (e) {
- !this.props.isOpen && e.isOpen && this.setState(Xi({
- itemList: this.props.initialList
- }, ls))
- }
- },
- {
- key: 'render',
- value: function () {
- var e = 'blacklist' === this.state.itemList,
- t = this.props.accessOnFilterTypes(this.state.itemList);
- return C.a.createElement(_.a, {
- className: 'site-picker-modal',
- isOpen: this.props.isOpen,
- onRequestClose: this.props.onRequestClose
- }, C.a.createElement('div', {
- className: 'modal-content',
- onKeyUp: this.handleKeyUp
- }, C.a.createElement('div', {
- className: 'modal-header'
- }, C.a.createElement('h4', {
- className: 'modal-title'
- }, 'Add to '.concat(is[this.state.itemList], ' List'))), this.props.isFetching ? C.a.createElement(Qi, null) : null, C.a.createElement('div', {
- className: 'modal-body'
- }, this.props.error ? C.a.createElement(Ki, {
- message: this.props.error,
- onRequestClose: this.props.onClearError,
- alertType: 'error'
- }) : null, C.a.createElement('div', {
- className: 'spacing-top spacing-bottom form-attribute-input'
- }, C.a.createElement('div', null, C.a.createElement('h3', {
- className: 'text-gray-darker'
- }, 'Type')), C.a.createElement('select', {
- name: 'itemType',
- className: 'input--select',
- value: this.state.itemType,
- onChange: this.handleChangeValue,
- disabled: t.length <= 1
- }, t.map(function (e) {
- return C.a.createElement('option', {
- key: e.value,
- value: e.value
- }, e.displayName)
- }))), C.a.createElement('div', {
- className: 'spacing-top spacing-bottom form-attribute-input'
- }, C.a.createElement('h3', {
- className: 'text-gray-darker'
- }, 'Value'), C.a.createElement('div', null, C.a.createElement('input', {
- className: 'input--textbox',
- name: 'itemValue',
- type: 'text',
- placeholder: this.getPlaceholderForValue(this.state.itemType),
- value: this.state.itemValue,
- onChange: this.handleChangeValue
- }))), C.a.createElement('div', {
- className: 'spacing-top spacing-bottom form-attribute-input'
- }, C.a.createElement('h3', {
- className: 'text-gray-darker'
- }, 'Notes'), C.a.createElement('div', null, C.a.createElement('input', {
- className: 'input--textbox',
- name: 'itemNotes',
- type: 'text',
- placeholder: 'Enter a note for other moderators to see…',
- value: this.state.itemNotes,
- onChange: this.handleChangeValue,
- maxLength: '50'
- }))), e ? C.a.createElement('div', {
- className: 'spacing-top spacing-bottom form-attribute-input'
- }, C.a.createElement('input', {
- name: 'retroactive',
- type: 'checkbox',
- checked: this.state.retroactive,
- onChange: this.handleChangeValue
- }), C.a.createElement('label', {
- className: 'text-gray-dark'
- }, 'Remove last 30 days of comments')) : null), C.a.createElement('div', {
- className: 'modal-footer'
- }, C.a.createElement('button', {
- className: 'button button-outline button-small spacing-right',
- onClick: this.props.onRequestClose
- }, 'Close'), C.a.createElement('button', {
- className: 'button button-fill--brand button-small',
- onClick: this.handleSubmitNewItem
- }, 'Add to '.concat(is[this.state.itemList], ' List')))))
- }
- }
- ]) && es(e.prototype, t),
- n && es(e, n),
- r
- }();
- os(cs, 'displayName', 'AccessItemAddModal'),
- os(cs, 'propTypes', {
- accessOnFilterTypes: b.a.func.isRequired,
- onSubmitNewItem: b.a.func.isRequired,
- onRequestClose: b.a.func.isRequired,
- initialList: b.a.string.isRequired,
- isOpen: b.a.bool.isRequired,
- isFetching: b.a.bool,
- error: b.a.string,
- onClearError: b.a.func.isRequired
- });
- var us = cs;
- function ps(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) {
- var a,
- r,
- o = [
- ],
- i = !0,
- s = !1;
- try {
- for (n = n.call(e); !(i = (a = n.next()).done) && (o.push(a.value), !t || o.length !== t); i = !0);
- } catch (e) {
- s = !0,
- r = e
- } finally {
- try {
- i || null == n.return || n.return()
- } finally {
- if (s) throw r
- }
- }
- return o
- }
- }(e, t) || function (e, t) {
- if (e) {
- if ('string' == typeof e) return ds(e, t);
- var n = Object.prototype.toString.call(e).slice(8, - 1);
- return 'Map' === (n = 'Object' === n && e.constructor ? e.constructor.name : n) || 'Set' === n ? Array.from(e) : 'Arguments' === n || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n) ? ds(e, t) : void 0
- }
- }(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 ds(e, t) {
- for (var n = 0, a = Array(t = null == t || e.length < t ? e.length : t); n < t; n++) a[n] = e[n];
- return a
- }
- function ms(e, t) {
- var n = (i = e.split('T')) [0].split('-'),
- a = i[1].split(':'),
- r = + ('' + n[0]),
- o = + ('' + (n[1] - 1)),
- e = + ('' + n[2]),
- i = + ('' + a[0]),
- n = + ('' + a[1]),
- a = + ('' + a[2]) || 0;
- return t ? new Date(r, o, e, i, n, a) : new Date(Date.UTC(r, o, e, i, n, a))
- }
- var fs = [
- [60,
- 'just now',
- 'just now'],
- [
- 120,
- '1 minute ago',
- '1 minute from now'
- ],
- [
- 3600,
- 'minutes',
- 60
- ],
- [
- 7200,
- '1 hour ago',
- '1 hour from now'
- ],
- [
- 86400,
- 'hours',
- 3600
- ],
- [
- 172800,
- 'yesterday',
- 'tomorrow'
- ],
- [
- 604800,
- 'days',
- 86400
- ],
- [
- 1209600,
- 'last week',
- 'next week'
- ],
- [
- 2419200,
- 'weeks',
- 604800
- ],
- [
- 4838400,
- 'last month',
- 'next month'
- ],
- [
- 29030400,
- 'months',
- 2419200
- ],
- [
- 58060800,
- 'last year',
- 'next year'
- ],
- [
- 2903040000,
- 'years',
- 29030400
- ],
- [
- 5806080000,
- 'last century',
- 'next century'
- ],
- [
- 58060800000,
- 'centuries',
- 2903040000
- ]
- ],
- hs = [
- 'Sunday',
- 'Monday',
- 'Tuesday',
- 'Wednesday',
- 'Thursday',
- 'Friday',
- 'Saturday'
- ],
- gs = [
- 'Sun',
- 'Mon',
- 'Tue',
- 'Wed',
- 'Thu',
- 'Fri',
- 'Sat'
- ],
- ys = [
- 'January',
- 'February',
- 'March',
- 'April',
- 'May',
- 'June',
- 'July',
- 'August',
- 'September',
- 'October',
- 'November',
- 'December'
- ],
- bs = [
- 'Jan',
- 'Feb',
- 'Mar',
- 'Apr',
- 'May',
- 'Jun',
- 'Jul',
- 'Aug',
- 'Sep',
- 'Oct',
- 'Nov',
- 'Dec'
- ],
- vs = function n(e, a) {
- var r = (a = a || new Date).getDay(),
- o = a.getYear(),
- i = ('' + a).match(/\((\w+)\)/),
- s = a.getTimezoneOffset(),
- l = s < 0 ? '-' : '+';
- return e.replace(/%(.)/g, function (e, t) {
- switch (t) {
- case 'A':
- return hs[a.getDay()];
- case 'a':
- return gs[a.getDay()];
- case 'B':
- return ys[a.getMonth()];
- case 'b':
- case 'h':
- return bs[a.getMonth()];
- case 'D':
- return n('%m/%d/%y', a);
- case 'd':
- return _s(a.getDate());
- case 'e':
- return a.getDate();
- case 'F':
- return n('%Y-%m-%d', a);
- case 'H':
- return _s(a.getHours());
- case 'I':
- return _s(Es(a));
- case 'k':
- return _s(a.getHours(), ' ');
- case 'l':
- return _s(Es(a), ' ');
- case 'M':
- return _s(a.getMinutes());
- case 'm':
- return _s(1 + a.getMonth());
- case 'n':
- return '\n';
- case 'p':
- return a.getHours() < 12 ? 'AM' : 'PM';
- case 'R':
- return n('%H:%M', a);
- case 'r':
- return n('%I:%M:%S %p', a);
- case 'S':
- return _s(a.getSeconds());
- case 's':
- return a.getTime();
- case 'T':
- return n('%H:%M:%S', a);
- case 't':
- return '\t';
- case 'u':
- return 0 == r ? 7 : r;
- case 'v':
- return n('%e-%b-%Y', a);
- case 'w':
- return a.getDay();
- case 'Y':
- return a.getFullYear();
- case 'y':
- return _s(o < 100 ? o : o - 100);
- case 'Z':
- return i && i[1] || '';
- case 'z':
- return l + _s(s / 60) + _s(s % 60);
- default:
- return t
- }
- })
- };
- function _s(e, t) {
- return 10 <= e ? e : (t || '0') + e
- }
- function Es(e) {
- e = e.getHours();
- return 0 === e ? e = 12 : 12 < e && (e -= 12),
- e
- }
- var Os = {
- prettyDatetime: function (e, t) {
- var n,
- a = Ve.a.getFromCookie(),
- r = a.tzOffset;
- return 'absolute' !== (t = t || a.datetimeFormatting) ? function (e) {
- var t = (new Date - e) / 1000,
- n = Math.abs(t),
- a = je.a.find(fs, function (e) {
- e = ps(e, 1);
- return n < e[0]
- }),
- r = ps(a = a || fs[fs.length - 1], 3),
- e = r[1],
- a = r[2];
- if ('string' == typeof a) return t < 0 ? a : e;
- r = t < 0 ? 'from now' : 'ago';
- return ''.concat(Math.floor(Math.abs(t) / a), ' ').concat(e, ' ').concat(r)
- }(ms(e)) : (r ? (n = ms(e, !0)).setTime(n.getTime() + (r = '-' == (t = (a = r) [0] || '') ? - 1 : 1, 1000 * (60 * (a = '-' == t || '+' == t ? a.substring(1) : a).substring(0, 2) * 60 * r + 60 * a.substring(2, 4)))) : n = ms(e), vs('%m/%d/%y %I:%M %p', n))
- },
- parseISO8601: ms
- },
- Ss = function (e) {
- var t,
- n = e.entry,
- a = 'user' === n.type,
- r = a ? C.a.createElement('div', null, (t = n.value).isAnonymous ? C.a.createElement('em', null, 'Account deleted') : C.a.createElement('div', null, C.a.createElement('a', {
- href: t.profileUrl,
- className: 'truncate-line'
- }, t.username), C.a.createElement('p', {
- className: 'text-gray text-small'
- }, t.name))) : n.value,
- o = n.createdAt ? ct.a.utc(n.createdAt).fromNow() : null;
- return C.a.createElement('div', {
- className: 'list__item align align--between'
- }, C.a.createElement('div', {
- className: 'align align--stretch access__block'
- }, a ? C.a.createElement('a', {
- href: n.value.profileUrl,
- className: 'spacing-right'
- }, C.a.createElement('img', {
- src: n.value.avatar ? n.value.avatar.cache : '//c.disquscdn.com/next/current/publisher-admin/assets/img/noavatar32.png',
- alt: n.value.name,
- className: 'img-round-sm'
- })) : C.a.createElement('div', {
- className: 'spacing-right'
- }, C.a.createElement('div', {
- className: 'access-avatar -'.concat(n.type)
- }, C.a.createElement('p', {
- className: 'access-avatar__name'
- }, 'email' === n.type ? '@' : n.type.substr(0, 2)))), C.a.createElement('div', {
- className: 'access__value'
- }, r, C.a.createElement('p', {
- className: 'text-small text-gray'
- }, o, n.notes ? C.a.createElement('span', null, ' · ', n.notes) : null))), n.shadowBan ? C.a.createElement('em', {
- className: 'text-gray text-small'
- }, 'Shadow Banned') : null, n.dateExpires ? C.a.createElement('em', {
- className: 'text-gray text-small spacing-right'
- }, 'Timeout expires ', Os.prettyDatetime(n.dateExpires, 'relative')) : null, a && n.value.isAnonymous ? null : C.a.createElement('div', {
- className: 'access__button'
- }, C.a.createElement('button', {
- className: 'button button-outline button-small',
- disabled: e.isSaving,
- onClick: e.onRemoveRequested
- }, 'Remove')))
- };
- Ss.displayName = 'AccessItem',
- Ss.propTypes = {
- entry: b.a.object.isRequired,
- onRemoveRequested: b.a.func.isRequired,
- isSaving: b.a.bool
- };
- var ws = Ss;
- function Ps(e) {
- return (Ps = 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator ? function (e) {
- return typeof e
- }
- : function (e) {
- return e && 'function' == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? 'symbol' : typeof e
- }) (e)
- }
- function ks(e, t) {
- for (var n = 0; n < t.length; n++) {
- var a = t[n];
- a.enumerable = a.enumerable || !1,
- a.configurable = !0,
- 'value' in a && (a.writable = !0),
- Object.defineProperty(e, a.key, a)
- }
- }
- function Ns(e, t) {
- return (Ns = Object.setPrototypeOf || function (e, t) {
- return e.__proto__ = t,
- e
- }) (e, t)
- }
- function Cs(n) {
- var a = function () {
- if ('undefined' == typeof Reflect || !Reflect.construct) return !1;
- if (Reflect.construct.sham) return !1;
- if ('function' == typeof Proxy) return !0;
- try {
- return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [
- ], function () {
- })),
- !0
- } catch (e) {
- return !1
- }
- }();
- return function () {
- var e,
- t = xs(n);
- return e = a ? (e = xs(this).constructor, Reflect.construct(t, arguments, e)) : t.apply(this, arguments),
- t = this,
- !(e = e) || 'object' !== Ps(e) && 'function' != typeof e ? Rs(t) : e
- }
- }
- function Rs(e) {
- if (void 0 === e) throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called');
- return e
- }
- function xs(e) {
- return (xs = Object.setPrototypeOf ? Object.getPrototypeOf : function (e) {
- return e.__proto__ || Object.getPrototypeOf(e)
- }) (e)
- }
- function As(e, t, n) {
- return t in e ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n,
- e
- }
- var Ds = function () {
- !function (e, t) {
- if ('function' != typeof t && null !== t) throw new TypeError('Super expression must either be null or a function');
- e.prototype = Object.create(t && t.prototype, {
- constructor: {
- value: e,
- writable: !0,
- configurable: !0
- }
- }),
- t && Ns(e, t)
- }(o, A);
- var e,
- t,
- n,
- r = Cs(o);
- function o() {
- var t;
- !function (e, t) {
- if (!(e instanceof t)) throw new TypeError('Cannot call a class as a function')
- }(this, o);
- for (var e = arguments.length, n = Array(e), a = 0; a < e; a++) n[a] = arguments[a];
- return As(Rs(t = r.call.apply(r, [
- this
- ].concat(n))), 'renderListCard', function (e) {
- return C.a.createElement(ws, {
- key: e.id,
- entry: e,
- onRemoveRequested: t.props.onRemoveItem.bind(null, e),
- isSaving: t.props.isSaving
- })
- }),
- t
- }
- return e = o,
- (t = [
- {
- key: 'render',
- value: function () {
- return C.a.createElement('div', {
- className: 'list--border-bottom border-top'
- }, this.props.list.length ? this.props.list.map(this.renderListCard) : C.a.createElement('p', {
- className: 'text-center text-gray spacing-top'
- }, 'There are no items to show here.'))
- }
- }
- ]) && ks(e.prototype, t),
- n && ks(e, n),
- o
- }();
- As(Ds, 'displayName', 'AccessList'),
- As(Ds, 'propTypes', {
- list: b.a.array.isRequired,
- onRemoveItem: b.a.func.isRequired,
- isSaving: b.a.bool
- });
- var js = Ds,
- Ts = n(39),
- Is = n.n(Ts),
- qs = n(273),
- Fs = n.n(qs),
- Ls = function (e) {
- var t = e.children,
- n = e.linkActiveClassName,
- a = e.linkClassName,
- r = e.path,
- o = e.orgId,
- i = e.onClick,
- e = e.orgSlug || mt,
- r = '/orgs/'.concat(o, '/').concat(e).concat(r);
- return br.shortname || (br.orgId && parseInt(br.orgId, 10)) !== o ? (r = '//'.concat(br.disqusHost, '/admin').concat(r), C.a.createElement('a', {
- target: '_blank',
- rel: 'noopener noreferrer',
- href: r,
- className: a,
- onClick: i
- }, t)) : C.a.createElement(v.Link, {
- to: r,
- className: a,
- activeClassName: n,
- onClick: i
- }, t)
- };
- Ls.propTypes = {
- children: b.a.node.isRequired,
- linkActiveClassName: b.a.string,
- linkClassName: b.a.string,
- path: b.a.string.isRequired,
- orgId: b.a.number.isRequired,
- orgSlug: b.a.string,
- onClick: b.a.func
- };
- var Us = Ls;
- function Ms(e) {
- return (Ms = 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator ? function (e) {
- return typeof e
- }
- : function (e) {
- return e && 'function' == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? 'symbol' : typeof e
- }) (e)
- }
- function Bs(e, t) {
- for (var n = 0; n < t.length; n++) {
- var a = t[n];
- a.enumerable = a.enumerable || !1,
- a.configurable = !0,
- 'value' in a && (a.writable = !0),
- Object.defineProperty(e, a.key, a)
- }
- }
- function zs(e, t) {
- return (zs = Object.setPrototypeOf || function (e, t) {
- return e.__proto__ = t,
- e
- }) (e, t)
- }
- function Hs(n) {
- var a = function () {
- if ('undefined' == typeof Reflect || !Reflect.construct) return !1;
- if (Reflect.construct.sham) return !1;
- if ('function' == typeof Proxy) return !0;
- try {
- return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [
- ], function () {
- })),
- !0
- } catch (e) {
- return !1
- }
- }();
- return function () {
- var e,
- t = Vs(n);
- return e = a ? (e = Vs(this).constructor, Reflect.construct(t, arguments, e)) : t.apply(this, arguments),
- t = this,
- !(e = e) || 'object' !== Ms(e) && 'function' != typeof e ? Gs(t) : e
- }
- }
- function Gs(e) {
- if (void 0 === e) throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called');
- return e
- }
- function Vs(e) {
- return (Vs = Object.setPrototypeOf ? Object.getPrototypeOf : function (e) {
- return e.__proto__ || Object.getPrototypeOf(e)
- }) (e)
- }
- function Ws(e, t, n) {
- return t in e ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n,
- e
- }
- function Ys(e) {
- var t = e.className,
- n = e.organization,
- a = e.onClick,
- r = e.children,
- e = e.plan;
- return n ? C.a.createElement(Us, {
- linkClassName: t,
- path: '/settings/subscription'.concat(e === Ur.DISQUS_POLLS_BUSINESS_PLAN_ID ? '/?product=polls' : ''),
- onClick: a,
- orgId: n.id,
- orgSlug: n.slug
- }, r) : C.a.createElement(v.Link, {
- className: t,
- to: '/settings/subscription'.concat(e === Ur.DISQUS_POLLS_BUSINESS_PLAN_ID ? '/?product=polls' : ''),
- onClick: a
- }, r)
- }
- Ys.propTypes = {
- children: b.a.node.isRequired,
- onClick: b.a.func.isRequired,
- organization: b.a.shape({
- id: b.a.number.isRequired,
- slug: b.a.string.isRequired
- }),
- className: b.a.string,
- plan: b.a.oneOf(['plus',
- 'pro',
- 'business',
- Ur.DISQUS_POLLS_BUSINESS_PLAN_ID])
- };
- var Qs = function () {
- !function (e, t) {
- if ('function' != typeof t && null !== t) throw new TypeError('Super expression must either be null or a function');
- e.prototype = Object.create(t && t.prototype, {
- constructor: {
- value: e,
- writable: !0,
- configurable: !0
- }
- }),
- t && zs(e, t)
- }(o, A);
- var e,
- t,
- n,
- r = Hs(o);
- function o() {
- var e;
- !function (e, t) {
- if (!(e instanceof t)) throw new TypeError('Cannot call a class as a function')
- }(this, o);
- for (var t = arguments.length, n = Array(t), a = 0; a < t; a++) n[a] = arguments[a];
- return Ws(Gs(e = r.call.apply(r, [
- this
- ].concat(n))), 'state', {
- hasSentHoverEvent: !1
- }),
- Ws(Gs(e), 'getUpgradeMessage', function () {
- switch (e.props.plan) {
- case 'plus':
- return 'Disqus Plus gives you access to an ad-free experience.';
- case 'pro':
- return 'Disqus Pro gives you access to exclusive features like auto-moderation, shadow banning, and customization options.';
- case 'business':
- case Ur.DISQUS_POLLS_BUSINESS_PLAN_ID:
- return 'Disqus'.concat(e.props.plan === Ur.DISQUS_POLLS_BUSINESS_PLAN_ID ? ' Polls' : '', ' Business gives you access to exclusive features like single sign-on, direct account management, and the full range of customization options.');
- default:
- return ''
- }
- }),
- Ws(Gs(e), 'handleMouseEnter', function () {
- e.state.hasSentHoverEvent || (e.setState({
- hasSentHoverEvent: !0
- }), e.props.emitEvent({
- verb: 'hover',
- object_type: 'icon',
- object_id: 'disqus_pro'
- }))
- }),
- Ws(Gs(e), 'handleUpgradeClick', function () {
- e.props.emitEvent({
- verb: 'click',
- object_type: 'button',
- object_id: 'subscriptions'
- })
- }),
- e
- }
- return e = o,
- (t = [
- {
- key: 'render',
- value: function () {
- var e = {
- fontSize: ''.concat(this.props.height, 'px')
- },
- t = {
- top: ''.concat(this.props.height + 12, 'px')
- };
- return C.a.createElement('span', {
- className: 'settings-general__upgrade-container align-inline media-middle'.concat(this.props.className ? ' '.concat(this.props.className) : '')
- }, C.a.createElement(Ys, {
- className: 'upgrade-link',
- organization: this.props.organization,
- onClick: this.handleUpgradeClick,
- plan: this.props.plan
- }, C.a.createElement('span', {
- className: [
- 'icon icon-upgrade-arrow-pro settings-general__upgrade-icon',
- this.props.iconClass
- ].join(' ').trim(),
- style: e,
- onMouseEnter: this.handleMouseEnter
- })), C.a.createElement('span', {
- className: 'settings-general__upgrade-tooltip text-medium '.concat(this.props.tooltipClass || ''),
- style: t
- }, C.a.createElement('span', {
- className: 'settings-general__upgrade-text text-gray spacing-bottom text-left text-normal'
- }, this.getUpgradeMessage()), C.a.createElement(Ys, {
- organization: this.props.organization,
- onClick: this.handleUpgradeClick,
- className: 'button button-fill--brand button-wide button-padding-taller',
- plan: this.props.plan
- }, 'Subscriptions and Billing')))
- }
- }
- ]) && Bs(e.prototype, t),
- n && Bs(e, n),
- o
- }();
- Ws(Qs, 'propTypes', {
- emitEvent: b.a.func.isRequired,
- className: b.a.string,
- plan: b.a.oneOf(['plus',
- 'pro',
- 'business',
- Ur.DISQUS_POLLS_BUSINESS_PLAN_ID]),
- height: b.a.number,
- organization: b.a.shape({
- id: b.a.number.isRequired,
- slug: b.a.string.isRequired
- }),
- iconClass: b.a.string,
- tooltipClass: b.a.string
- }),
- Ws(Qs, 'defaultProps', {
- plan: 'pro',
- height: 28
- });
- var Ks = Qs,
- Js = {
- updateUserListsModal: function (e) {
- return {
- type: re.updateModal,
- isOpen: e.isOpen,
- listType: e.listType,
- formValues: e.formValues,
- postId: e.postId,
- author: e.author
- }
- },
- updateBanFormType: function (e) {
- return {
- type: re.updateBanFormValues,
- banType: e
- }
- },
- resetUserListsModal: function () {
- return {
- type: re.resetDefault
- }
- }
- };
- function $s(e) {
- return ($s = 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator ? function (e) {
- return typeof e
- }
- : function (e) {
- return e && 'function' == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? 'symbol' : typeof e
- }) (e)
- }
- function Zs() {
- return (Zs = Object.assign || function (e) {
- for (var t = 1; t < arguments.length; t++) {
- var n,
- a = arguments[t];
- for (n in a) Object.prototype.hasOwnProperty.call(a, n) && (e[n] = a[n])
- }
- return e
- }).apply(this, arguments)
- }
- function Xs(t, e) {
- var n,
- a = Object.keys(t);
- return Object.getOwnPropertySymbols && (n = Object.getOwnPropertySymbols(t), e && (n = n.filter(function (e) {
- return Object.getOwnPropertyDescriptor(t, e).enumerable
- })), a.push.apply(a, n)),
- a
- }
- function el(t) {
- for (var e = 1; e < arguments.length; e++) {
- var n = null != arguments[e] ? arguments[e] : {
- };
- e % 2 ? Xs(Object(n), !0).forEach(function (e) {
- il(t, e, n[e])
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(n)) : Xs(Object(n)).forEach(function (e) {
- Object.defineProperty(t, e, Object.getOwnPropertyDescriptor(n, e))
- })
- }
- return t
- }
- function tl(e, t) {
- for (var n = 0; n < t.length; n++) {
- var a = t[n];
- a.enumerable = a.enumerable || !1,
- a.configurable = !0,
- 'value' in a && (a.writable = !0),
- Object.defineProperty(e, a.key, a)
- }
- }
- function nl(e, t) {
- return (nl = Object.setPrototypeOf || function (e, t) {
- return e.__proto__ = t,
- e
- }) (e, t)
- }
- function al(n) {
- var a = function () {
- if ('undefined' == typeof Reflect || !Reflect.construct) return !1;
- if (Reflect.construct.sham) return !1;
- if ('function' == typeof Proxy) return !0;
- try {
- return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [
- ], function () {
- })),
- !0
- } catch (e) {
- return !1
- }
- }();
- return function () {
- var e,
- t = ol(n);
- return e = a ? (e = ol(this).constructor, Reflect.construct(t, arguments, e)) : t.apply(this, arguments),
- t = this,
- !(e = e) || 'object' !== $s(e) && 'function' != typeof e ? rl(t) : e
- }
- }
- function rl(e) {
- if (void 0 === e) throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called');
- return e
- }
- function ol(e) {
- return (ol = Object.setPrototypeOf ? Object.getPrototypeOf : function (e) {
- return e.__proto__ || Object.getPrototypeOf(e)
- }) (e)
- }
- function il(e, t, n) {
- return t in e ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n,
- e
- }
- var sl = function () {
- !function (e, t) {
- if ('function' != typeof t && null !== t) throw new TypeError('Super expression must either be null or a function');
- e.prototype = Object.create(t && t.prototype, {
- constructor: {
- value: e,
- writable: !0,
- configurable: !0
- }
- }),
- t && nl(e, t)
- }(r, A);
- var e,
- t,
- n,
- a = al(r);
- function r(e) {
- var o;
- return function (e, t) {
- if (!(e instanceof t)) throw new TypeError('Cannot call a class as a function')
- }(this, r),
- il(rl(o = a.call(this, e)), 'onOpen', function (e) {
- var t,
- n,
- a;
- o.props.emitTrackingEvent({
- verb: 'view',
- object_type: 'modal',
- object_id: e.listName === Wn.LIST_TYPES.WHITELIST ? 'trust_user' : 'ban_user'
- }),
- e.listName && e.forum ? (a = e.banType, t = e.saasFeatures[o.props.forum.organizationId], Object(Wn.isBanTypeSupported) (a, t) || (n = Is.a.get(Wn.STORAGE_KEY_BAN_TYPE), a = Object(Wn.isBanTypeSupported) (n, t) ? n : Wn.BAN_TYPES.PERMANENT, o.props.updateBanFormType(a)), a = el(el({
- }, e.defaultFormValues), {
- }, {
- type: a
- }), e.user && (a.userId = e.user.id), o.setState({
- formValues: a,
- itemType: 'user',
- itemValue: ''
- })) : o.handleClose()
- }),
- il(rl(o), 'handleClose', function (e) {
- o.state.formValues.replaceCancel && o.props.performActionOnReplacedCancel('spam', o.props.postId, !(!e || !e.preventUndo)),
- o.setState({
- formValues: {
- },
- itemType: 'user',
- itemValue: ''
- }),
- o.props.isOpen && o.props.close(),
- o.props.updateBanFormType(null)
- }),
- il(rl(o), 'validateProps', function (e) {
- return !!(e.listName && e.user && e.forum)
- }),
- il(rl(o), 'validatePropsNoUser', function (e) {
- return !(!e.listName || !e.forum)
- }),
- il(rl(o), 'toggleUserValueChecked', function (e, t) {
- o.setState({
- formValues: je.a.defaults(il({
- }, t, e.target.checked ? o.props.user[t] : null), o.state.formValues)
- })
- }),
- il(rl(o), 'toggleIpAddressChecked', function (e) {
- o.setState({
- formValues: je.a.defaults({
- ipAddress: e.target.checked ? o.props.ipAddress : null
- }, o.state.formValues)
- })
- }),
- il(rl(o), 'toggleBanType', function (e, t) {
- e.preventDefault();
- e = o.props.forum.organizationId || o.props.forum.organization;
- Object(Wn.isBanTypeSupported) (t, o.props.saasFeatures[e]) && (o.props.updateBanFormType(t), o.setState(function (e) {
- return {
- formValues: je.a.defaults({
- type: t
- }, e.formValues)
- }
- }), Is.a.set(Wn.STORAGE_KEY_BAN_TYPE, t))
- }),
- il(rl(o), 'toggleBanTypeCallback', function (e) {
- o.toggleBanType(e, e.target.value)
- }),
- il(rl(o), 'selectRetroactiveAction', function (e) {
- o.setState({
- formValues: je.a.defaults({
- retroactiveAction: e.target.value || Wn.RETROACTIVE_ACTION_TYPES.DO_NOTHING
- }, o.state.formValues)
- })
- }),
- il(rl(o), 'updateReason', function (e) {
- o.setState({
- formValues: je.a.defaults({
- reason: e.target.value
- }, o.state.formValues)
- })
- }),
- il(rl(o), 'updateDuration', function (e) {
- o.setState({
- formValues: je.a.defaults({
- durationHours: e.target.value
- }, o.state.formValues)
- })
- }),
- il(rl(o), 'updateCustomDurationAmount', function (e) {
- e = e.target.value.replace(/[^\d]/g, '');
- o.setState({
- formValues: je.a.defaults({
- durationHours: 'custom',
- customDurationAmount: e
- }, o.state.formValues)
- })
- }),
- il(rl(o), 'updateCustomDurationScale', function (e) {
- o.setState({
- formValues: je.a.defaults({
- durationHours: 'custom',
- customDurationScale: e.target.value
- }, o.state.formValues)
- })
- }),
- il(rl(o), 'handleChangeValue', function (e) {
- o.setState('itemType' === e.target.name ? {
- itemType: e.target.value
- }
- : {
- itemValue: e.target.value
- })
- }),
- il(rl(o), 'getPlaceholderForValue', function (e) {
- switch (e) {
- case 'email':
- return 'Enter an email address, e.g. someone@example.com';
- case 'user':
- return 'Enter a registered Disqus username';
- case 'domain':
- return 'Enter a domain, e.g. example.com';
- case 'ip':
- return 'Enter an IP address, e.g. 123.123.123.123';
- default:
- return ''
- }
- }),
- il(rl(o), 'filterTypesForSelection', function (t) {
- var n = o.props.selection.forum;
- return n ? je.a.filter(Ci, function (e) {
- return ('domain' !== e.value || o.state.formValues.type === Wn.BAN_TYPES.PERMANENT) && (n.settings.IS_CHANNEL_PRIMARY_FORUM && !n.permissions.canAdminister ? e.isChannelVisible : je.a.contains(e.lists, t) && je.a.every(e.permissions, function (e) {
- return n.permissions[e]
- }))
- }) : [
- ]
- }),
- il(rl(o), 'handleSubmit', function (e) {
- e.preventDefault();
- var t = o.props.banType === Wn.BAN_TYPES.TEMP ? Object(Wn.getDateExpires) ({
- durationHours: o.state.formValues.durationHours,
- customDurationAmount: o.state.formValues.customDurationAmount,
- customDurationScale: o.state.formValues.customDurationScale
- }) : null,
- n = je.a.extend({
- forumId: o.props.forum.id,
- postId: o.props.postId,
- type: o.props.banType,
- dateExpires: t
- }, o.state.formValues);
- o.props.emitTrackingEvent({
- verb: 'click',
- object_type: 'button',
- object_id: o.props.listName === Wn.LIST_TYPES.WHITELIST ? 'trust_user' : 'ban_user',
- extra_data: o.props.listName === Wn.LIST_TYPES.BLACKLIST ? JSON.stringify({
- date_added: ct() ().toISOString(),
- date_expires: t
- }) : null
- });
- var a,
- r = !1;
- o.props.listName === Wn.LIST_TYPES.WHITELIST ? o.props.addUserToWhitelist(n) : (a = o.state.formValues.replaceCancel ? n.postId : '', e = !!o.state.formValues.email || !!o.state.formValues.username || !!o.state.formValues.ipAddress, r = (t = o.props.banType === Wn.BAN_TYPES.PERMANENT) && e && (n.retroactiveAction === Wn.RETROACTIVE_ACTION_TYPES.DELETE || n.retroactiveAction === Wn.RETROACTIVE_ACTION_TYPES.MARK_AS_SPAM), o.props.addNewItem || o.props.addUserToBlacklist(je.a.omit(n, je.a.isNull)), t && e && o.props.performRetroactiveAction(a, n.userId, n.retroactiveAction), o.props.addNewItem && (n.itemType = o.state.itemType, n.itemValue = o.state.itemValue, n.itemMethod = n.type, n.itemList = 'blacklist', o.props.addNewItem(n))),
- o.handleClose({
- preventUndo: r
- })
- }),
- o.state = {
- formValues: e.defaultFormValues,
- itemType: 'user',
- itemValue: ''
- },
- o
- }
- return e = r,
- (t = [
- {
- key: 'componentDidMount',
- value: function () {
- this.props.fetchSaasFeatures(this.props.forum.organizationId),
- this.props.isOpen && this.onOpen(this.props)
- }
- },
- {
- key: 'componentWillReceiveProps',
- value: function (e) {
- e.isOpen && !this.props.isOpen && this.onOpen(e),
- e.forum !== this.props.forum && this.props.fetchSaasFeatures(e.forum.organizationId)
- }
- },
- {
- key: 'componentWillUnmount',
- value: function () {
- this.handleClose()
- }
- },
- {
- key: 'render',
- value: function () {
- var t = this,
- e = this.props.saasFeatures[this.props.forum.organizationId || this.props.forum.organization];
- return C.a.createElement(_.a, {
- isOpen: this.props.isOpen,
- onRequestClose: this.handleClose,
- className: 'admin-modal -mobile',
- overlayClassName: 'modal-overlay'
- }, C.a.createElement('div', {
- className: 'admin-modal__header align align--between'
- }, C.a.createElement('h3', {
- className: 'text-large text-capitalized'
- }, 'Add to ', 'whitelist' === this.props.listName ? 'Trusted' : 'Banned', ' List on ', this.props.forum.name), C.a.createElement('button', {
- className: 'link-gray',
- onClick: this.handleClose
- }, C.a.createElement('span', {
- className: 'icon-cancel icon__position'
- }))), C.a.createElement(Fs.a, Zs({
- formValues: je.a.defaults({
- type: this.props.banType
- }, this.state.formValues),
- supportsShadowBanning: Object(Wn.isBanTypeSupported) (Wn.BAN_TYPES.SHADOW, e),
- supportsTempBanning: Object(Wn.isBanTypeSupported) (Wn.BAN_TYPES.TEMP, e),
- selectRetroactiveAction: this.selectRetroactiveAction,
- toggleBanTypeCallback: this.toggleBanTypeCallback,
- toggleUserValueChecked: this.toggleUserValueChecked,
- toggleIpAddressChecked: this.toggleIpAddressChecked,
- updateReason: this.updateReason,
- updateDuration: this.updateDuration,
- updateCustomDurationAmount: this.updateCustomDurationAmount,
- updateCustomDurationScale: this.updateCustomDurationScale,
- handleSubmit: this.handleSubmit,
- handleClose: this.handleClose,
- handleChangeValue: this.handleChangeValue,
- closeText: this.state.formValues.replaceCancel ? 'Skip' : 'Cancel',
- getPlaceholderForValue: this.getPlaceholderForValue,
- itemTypes: this.filterTypesForSelection(this.props.listName),
- itemType: this.state.itemType,
- itemValue: this.state.itemValue,
- UpgradeIcon: function (e) {
- return C.a.createElement(Ks, Zs({
- organization: t.props.selection.organization,
- emitEvent: t.props.emitTrackingEvent,
- iconClass: 'media-middle text-largest text-yellow spacing-left'
- }, e))
- }
- }, this.props)))
- }
- }
- ]) && tl(e.prototype, t),
- n && tl(e, n),
- r
- }();
- il(sl, 'displayName', 'ModerationUserListsModal'),
- il(sl, 'propTypes', {
- emitTrackingEvent: b.a.func.isRequired,
- listName: b.a.oneOf(je.a.values(Wn.LIST_TYPES)),
- user: b.a.object,
- ipAddress: b.a.string,
- postId: b.a.string,
- forum: b.a.object,
- isOpen: b.a.bool.isRequired,
- close: b.a.func.isRequired,
- selection: ht,
- addUserToWhitelist: b.a.func.isRequired,
- addUserToBlacklist: b.a.func.isRequired,
- performRetroactiveAction: b.a.func.isRequired,
- updateBanFormType: b.a.func.isRequired,
- saasFeatures: b.a.objectOf(b.a.objectOf(b.a.bool)).isRequired,
- fetchSaasFeatures: b.a.func.isRequired,
- banType: b.a.string,
- defaultFormValues: b.a.shape({
- durationHours: b.a.string,
- customDurationAmount: b.a.string,
- customDurationScale: b.a.string,
- retroactiveAction: b.a.string,
- type: b.a.string,
- replaceCancel: b.a.bool,
- username: b.a.string,
- email: b.a.string,
- reason: b.a.string
- }),
- performActionOnReplacedCancel: b.a.func,
- addNewItem: b.a.func
- });
- var ll = Object(u.connect) (function (e) {
- var t = e.moderationUserLists;
- return {
- saasFeatures: e.saasFeatures,
- isOpen: t.modalIsOpen,
- listName: t.listType,
- banType: t.banType,
- defaultFormValues: t.modalFormValues,
- postId: t.postId,
- user: t.author
- }
- }, {
- fetchSaasFeatures: so.fetch,
- updateBanFormType: Js.updateBanFormType,
- emitTrackingEvent: Xo({
- zone: 'moderation_panel',
- section: 'welcome',
- area: 'user_sidebar'
- })
- }) (sl);
- function cl(e) {
- return (cl = 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator ? function (e) {
- return typeof e
- }
- : function (e) {
- return e && 'function' == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? 'symbol' : typeof e
- }) (e)
- }
- function ul(e, t) {
- for (var n = 0; n < t.length; n++) {
- var a = t[n];
- a.enumerable = a.enumerable || !1,
- a.configurable = !0,
- 'value' in a && (a.writable = !0),
- Object.defineProperty(e, a.key, a)
- }
- }
- function pl(e, t) {
- return (pl = Object.setPrototypeOf || function (e, t) {
- return e.__proto__ = t,
- e
- }) (e, t)
- }
- function dl(n) {
- var a = function () {
- if ('undefined' == typeof Reflect || !Reflect.construct) return !1;
- if (Reflect.construct.sham) return !1;
- if ('function' == typeof Proxy) return !0;
- try {
- return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [
- ], function () {
- })),
- !0
- } catch (e) {
- return !1
- }
- }();
- return function () {
- var e,
- t = fl(n);
- return e = a ? (e = fl(this).constructor, Reflect.construct(t, arguments, e)) : t.apply(this, arguments),
- t = this,
- !(e = e) || 'object' !== cl(e) && 'function' != typeof e ? ml(t) : e
- }
- }
- function ml(e) {
- if (void 0 === e) throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called');
- return e
- }
- function fl(e) {
- return (fl = Object.setPrototypeOf ? Object.getPrototypeOf : function (e) {
- return e.__proto__ || Object.getPrototypeOf(e)
- }) (e)
- }
- function hl(e, t, n) {
- return t in e ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n,
- e
- }
- var gl = [
- 10,
- 13
- ],
- yl = function () {
- !function (e, t) {
- if ('function' != typeof t && null !== t) throw new TypeError('Super expression must either be null or a function');
- e.prototype = Object.create(t && t.prototype, {
- constructor: {
- value: e,
- writable: !0,
- configurable: !0
- }
- }),
- t && pl(e, t)
- }(o, A);
- var e,
- t,
- n,
- r = dl(o);
- function o() {
- var t;
- !function (e, t) {
- if (!(e instanceof t)) throw new TypeError('Cannot call a class as a function')
- }(this, o);
- for (var e = arguments.length, n = Array(e), a = 0; a < e; a++) n[a] = arguments[a];
- return hl(ml(t = r.call.apply(r, [
- this
- ].concat(n))), 'state', {
- queryInput: '',
- showAddItemModal: !1
- }),
- hl(ml(t), 'handleQueryChange', function (e) {
- t.setState({
- queryInput: e.target.value
- })
- }),
- hl(ml(t), 'handleNewQuerySearch', function (e) {
- t.props.accessOnQuerySubmit(e || t.state.queryInput)
- }),
- hl(ml(t), 'handleQueryKeyUp', function (e) {
- e.preventDefault(),
- ~gl.indexOf(e.keyCode) && t.handleNewQuerySearch(e.target.value)
- }),
- hl(ml(t), 'handleToggleAddItemModal', function (e) {
- t.setState({
- showAddItemModal: je.a.isBoolean(e) ? e : !t.state.showAddItemModal
- })
- }),
- hl(ml(t), 'handleAddNewItem', function (e) {
- t.props.accessOnAddItem(e).done(t.handleToggleAddItemModal.bind(ml(t), !1))
- }),
- t
- }
- return e = o,
- (t = [
- {
- key: 'componentWillReceiveProps',
- value: function (e) {
- this.setState({
- queryInput: e.accessQuery || ''
- })
- }
- },
- {
- key: 'componentDidMount',
- value: function () {
- this.props.resetUserListsModal()
- }
- },
- {
- key: 'componentDidUpdate',
- value: function () {
- 'blacklist' === this.props.route.accessListType && this.props.updateUserListsModal({
- isOpen: this.state.showAddItemModal,
- listType: this.props.route.accessListType
- })
- }
- },
- {
- key: 'render',
- value: function () {
- return C.a.createElement('div', null, C.a.createElement('ul', {
- className: 'nav-tabs -small'
- }, C.a.createElement('li', {
- className: 'blacklist' === this.props.route.accessListType ? 'active' : null
- }, C.a.createElement(Uo, {
- linkActiveClassName: 'active',
- path: '/access/banned/',
- selection: this.props.selection
- }, 'Banned')), C.a.createElement('li', {
- className: 'whitelist' === this.props.route.accessListType ? 'active' : null
- }, C.a.createElement(Uo, {
- linkActiveClassName: 'active',
- path: '/access/trusted/',
- selection: this.props.selection
- }, 'Trusted'))), this.props.accessFetchError ? C.a.createElement(Ki, {
- message: this.props.accessFetchError,
- alertType: 'error'
- }) : null, this.props.accessSaveError ? C.a.createElement(Ki, {
- message: this.props.accessSaveError,
- alertType: 'error'
- }) : null, C.a.createElement('div', null, C.a.createElement('div', {
- className: 'align align--between align--middle spacing-top spacing-bottom'
- }, C.a.createElement('div', {
- className: 'align align--between align--middle'
- }, C.a.createElement('form', {
- onSubmit: function (e) {
- return e.preventDefault()
- }
- }, C.a.createElement('input', {
- className: 'input--default input--textbox -text-small -wide padding-small',
- type: 'text',
- placeholder: 'Search by username, ip, or email',
- value: this.state.queryInput,
- onChange: this.handleQueryChange,
- onKeyUp: this.handleQueryKeyUp
- }), C.a.createElement('button', {
- className: 'button button-link text-small',
- type: 'button',
- onClick: this.handleNewQuerySearch.bind(this, this.state.queryInput)
- }, 'Filter'))), C.a.createElement('div', null, 'blacklist' === this.props.route.accessListType ? C.a.createElement(C.a.Fragment, null, C.a.createElement('button', {
- type: 'button',
- className: 'button button-fill--brand button-small',
- onClick: this.handleToggleAddItemModal
- }, 'Add Banned'), C.a.createElement(ll, {
- listName: Yn.a.BLACKLIST,
- postId: '',
- user: '',
- ipAddress: '',
- selection: this.props.selection,
- forum: this.props.selection.forum,
- addUserToBlacklist: this.props.addUserToBlacklist,
- performRetroactiveAction: function () {
- },
- addUserToWhitelist: this.props.addUserToWhitelist,
- isOpen: this.state.showAddItemModal,
- close: this.handleToggleAddItemModal,
- performActionOnReplacedCancel: this.handlePostAction,
- addNewItem: this.props.accessOnAddItem
- })) : C.a.createElement(C.a.Fragment, null, C.a.createElement('button', {
- type: 'button',
- className: 'button button-fill--brand button-small',
- onClick: this.handleToggleAddItemModal
- }, ' Add Trusted '), C.a.createElement(us, {
- initialList: this.props.route.accessListType,
- accessOnFilterTypes: this.props.accessOnFilterTypes,
- isOpen: this.state.showAddItemModal,
- isFetching: this.props.accessIsSaving,
- error: this.props.accessSaveError,
- onClearError: this.props.accessOnClearSaveError,
- onSubmitNewItem: this.handleAddNewItem,
- onRequestClose: this.handleToggleAddItemModal
- })))), this.props.accessIsFetching ? C.a.createElement(Qi, null) : null, C.a.createElement(js, {
- list: this.props.accessList,
- onRemoveItem: this.props.accessOnRemoveItem,
- isSaving: this.props.accessIsSaving
- }), C.a.createElement('div', {
- className: 'align align--between align--middle border-top spacing-top'
- }, C.a.createElement('button', {
- className: 'button button-outline button-small spacing-top',
- onClick: this.props.accessOnPaginatePrev,
- disabled: !this.props.accessCursor.hasPrev
- }, C.a.createElement('strong', null, 'Previous Page')), C.a.createElement('button', {
- className: 'button button-outline button-small spacing-top',
- onClick: this.props.accessOnPaginateNext,
- disabled: !this.props.accessCursor.hasNext
- }, C.a.createElement('strong', null, 'Next Page')))))
- }
- }
- ]) && ul(e.prototype, t),
- n && ul(e, n),
- o
- }();
- hl(yl, 'displayName', 'AccessTab'),
- hl(yl, 'propTypes', {
- selection: ht.isRequired,
- route: b.a.shape({
- accessListType: b.a.oneOf(['blacklist',
- 'whitelist']).isRequired
- }).isRequired,
- accessOnFilterTypes: b.a.func.isRequired,
- accessList: b.a.array.isRequired,
- accessCursor: b.a.object.isRequired,
- accessQuery: b.a.string,
- accessOnQuerySubmit: b.a.func.isRequired,
- accessFetchError: b.a.string,
- accessIsFetching: b.a.bool,
- accessSaveError: b.a.string,
- accessOnClearSaveError: b.a.func.isRequired,
- accessIsSaving: b.a.bool,
- accessOnPaginateNext: b.a.func.isRequired,
- accessOnPaginatePrev: b.a.func.isRequired,
- accessOnRemoveItem: b.a.func.isRequired,
- accessOnAddItem: b.a.func.isRequired,
- updateUserListsModal: b.a.func.isRequired,
- resetUserListsModal: b.a.func.isRequired
- });
- var bl = Object(u.connect) (function (e) {
- return {
- selection: e.selection
- }
- }, {
- updateUserListsModal: Js.updateUserListsModal,
- resetUserListsModal: Js.resetUserListsModal
- }) (Ni.a.attachDrivers(yl, [
- Li,
- Wi
- ])),
- vl = n(92),
- _l = n.n(vl);
- function El(e) {
- return (El = 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator ? function (e) {
- return typeof e
- }
- : function (e) {
- return e && 'function' == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? 'symbol' : typeof e
- }) (e)
- }
- function Ol(e, t) {
- for (var n = 0; n < t.length; n++) {
- var a = t[n];
- a.enumerable = a.enumerable || !1,
- a.configurable = !0,
- 'value' in a && (a.writable = !0),
- Object.defineProperty(e, a.key, a)
- }
- }
- function Sl(e, t) {
- return (Sl = Object.setPrototypeOf || function (e, t) {
- return e.__proto__ = t,
- e
- }) (e, t)
- }
- function wl(n) {
- var a = function () {
- if ('undefined' == typeof Reflect || !Reflect.construct) return !1;
- if (Reflect.construct.sham) return !1;
- if ('function' == typeof Proxy) return !0;
- try {
- return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [
- ], function () {
- })),
- !0
- } catch (e) {
- return !1
- }
- }();
- return function () {
- var e,
- t = kl(n);
- return e = a ? (e = kl(this).constructor, Reflect.construct(t, arguments, e)) : t.apply(this, arguments),
- t = this,
- !(e = e) || 'object' !== El(e) && 'function' != typeof e ? Pl(t) : e
- }
- }
- function Pl(e) {
- if (void 0 === e) throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called');
- return e
- }
- function kl(e) {
- return (kl = Object.setPrototypeOf ? Object.getPrototypeOf : function (e) {
- return e.__proto__ || Object.getPrototypeOf(e)
- }) (e)
- }
- function Nl(e, t, n) {
- return t in e ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n,
- e
- }
- var Cl = function () {
- !function (e, t) {
- if ('function' != typeof t && null !== t) throw new TypeError('Super expression must either be null or a function');
- e.prototype = Object.create(t && t.prototype, {
- constructor: {
- value: e,
- writable: !0,
- configurable: !0
- }
- }),
- t && Sl(e, t)
- }(o, A);
- var e,
- t,
- n,
- r = wl(o);
- function o() {
- var e;
- !function (e, t) {
- if (!(e instanceof t)) throw new TypeError('Cannot call a class as a function')
- }(this, o);
- for (var t = arguments.length, n = Array(t), a = 0; a < t; a++) n[a] = arguments[a];
- return Nl(Pl(e = r.call.apply(r, [
- this
- ].concat(n))), 'state', {
- isOpen: !0
- }),
- Nl(Pl(e), 'open', function () {
- e.setState({
- isOpen: !0
- })
- }),
- Nl(Pl(e), 'close', function () {
- e.setState({
- isOpen: !1
- })
- }),
- e
- }
- return e = o,
- (t = [
- {
- key: 'render',
- value: function () {
- return C.a.createElement('div', null, C.a.createElement('button', {
- type: 'button',
- className: 'button button-wide button-fill--green spacing-bottom',
- onClick: this.open
- }, C.a.createElement('span', {
- className: 'icon-warning'
- }), C.a.createElement('span', {
- className: 'spacing-left'
- }, 'Disqus is currently undergoing maintenance')), C.a.createElement(_.a, {
- isOpen: this.state.isOpen,
- onRequestClose: this.close,
- 'admin-modal': 'admin-modal'
- }, C.a.createElement('div', {
- className: 'modal-content'
- }, C.a.createElement('div', {
- className: 'modal-header'
- }, C.a.createElement('h4', {
- className: 'modal-title'
- }, C.a.createElement('span', {
- className: 'icon__position spacing-right-small'
- }, C.a.createElement('span', {
- className: 'icon-warning'
- })), C.a.createElement('span', {
- className: 'spacing-left'
- }, 'Maintenance Alert!'))), C.a.createElement('div', {
- className: 'modal-body'
- }, C.a.createElement('p', null, 'Disqus is currently undergoing maintenance. You will still be able to see things here, but you won\'t be able to change anything until this is complete. See our status page for more.')), C.a.createElement('div', {
- className: 'modal-footer text-center'
- }, C.a.createElement('a', {
- href: 'https://status.disqus.com/',
- className: 'button button-wide button-fill--brand'
- }, 'Check Status'), C.a.createElement('button', {
- type: 'button',
- className: 'button button-link spacing-top text-small',
- onClick: this.close
- }, 'Or continue to admin')))))
- }
- }
- ]) && Ol(e.prototype, t),
- n && Ol(e, n),
- o
- }();
- Nl(Cl, 'displayName', 'ReadOnlyAlert');
- var Rl = Cl,
- xl = n(276),
- Al = n.n(xl),
- Dl = n(60),
- jl = n.n(Dl),
- Tl = n(43),
- Il = n.n(Tl);
- var ql = function (e) {
- var t;
- return !!(e.forum && (e.forum.organizationId || e.forum.organization) || e.organization && e.organization.id) && ((t = e).organization && t.organization.oldPolicyException || function (e) {
- e = e.organization || e.forum;
- return e && e.newPolicy
- }(e))
- };
- function Fl(t, e) {
- var n,
- a = Object.keys(t);
- return Object.getOwnPropertySymbols && (n = Object.getOwnPropertySymbols(t), e && (n = n.filter(function (e) {
- return Object.getOwnPropertyDescriptor(t, e).enumerable
- })), a.push.apply(a, n)),
- a
- }
- function Ll(a) {
- for (var e = 1; e < arguments.length; e++) {
- var r = null != arguments[e] ? arguments[e] : {
- };
- e % 2 ? Fl(Object(r), !0).forEach(function (e) {
- var t,
- n;
- n = r[t = e],
- t in (e = a) ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(a, Object.getOwnPropertyDescriptors(r)) : Fl(Object(r)).forEach(function (e) {
- Object.defineProperty(a, e, Object.getOwnPropertyDescriptor(r, e))
- })
- }
- return a
- }
- function Ul(a, r, e, t, o) {
- var i = e().selection.organization,
- s = {
- organization: e().selection.organization.id,
- plan: a.id
- };
- yo.a.isFeatureActive('stripeCoupons') && (s.coupon = t && t.stripeId),
- io.a.call('organizations/saas/subscribe', {
- method: 'POST',
- data: s
- }).done(function (e) {
- return {
- response: e.response
- }
- }).fail(function () {
- r({
- type: _e.updateSubscriptionEnd
- })
- }).then(function (n) {
- return (o ? io.a.call('organizations/saas/subscribe', {
- method: 'POST',
- data: Ll(Ll({
- }, s), {
- }, {
- plan: o.id
- })
- }).done(function (e) {
- return {
- response: e.response
- }
- }).fail(function () {
- r({
- type: _e.updateSubscriptionEnd
- })
- }) : vo.a.when(0)).then(function (t) {
- return io.a.call('organizations/saas/billingInformation', {
- data: {
- organization: e().selection.organization.id
- }
- }).then(function (e) {
- r({
- type: _e.updateSubscriptionEnd
- }),
- r({
- type: a.id.indexOf('polls') ? _e.fetchedCurrentPlan : _e.pollsFetchedCurrentPlan,
- response: n.response
- }),
- o && r({
- type: o.id.indexOf('polls') ? _e.fetchedCurrentPlan : _e.pollsFetchedCurrentPlan,
- response: t.response
- }),
- r({
- type: _e.fetchedBillingInformation,
- response: e.response
- }),
- a.productName === Ur.SAAS_PRODUCT_COMMENTS && i.pollsOnly && r({
- type: be.onEnableComments
- }),
- e = {
- event: Object(Tl.getGtmEvent) (a),
- conversionValue: '$'.concat(Object(Tl.formatPlanAmount) (a.amount))
- },
- (window.dataLayer || [
- ]).push(e)
- }, function () {
- r({
- type: a.id.indexOf('polls') ? _e.fetchedCurrentPlan : _e.pollsFetchedCurrentPlan,
- response: n.response
- })
- })
- })
- })
- }
- function Ml(e, t, n) {
- return e.name = e.name || 'Disqus',
- ko.onOpenStripe(Ll({
- image: '//c.disquscdn.com/next/current/publisher-admin/assets/img/disqus-social-icon-blue--small.png',
- billingAddress: !0,
- zipCode: !0
- }, e), n).then(function (e) {
- return t({
- type: _e.updateSubscriptionStart
- }),
- Gl(t, n, e)
- })
- }
- var Bl,
- zl = jl.a.isMobileUserAgent,
- Hl = function () {
- return function (t, e) {
- var n = e().selection.organization,
- a = {
- organization: n ? n.id : void 0
- },
- r = n && (n.permissions.isAdmin || n.permissions.isModerator);
- !e().subscription.orgSubscriptionIsFetching && r && (t({
- type: _e.fetchStart
- }), io.a.call('saas/packages/list', {
- data: a
- }).done(function (e) {
- t({
- type: _e.fetchedPackages,
- isFromInitialFetch: !0,
- response: e.response
- })
- }).fail(function () {
- t({
- type: _e.fetchFailed,
- isFromInitialFetch: !0
- })
- }), n && (n.pollsOnly || (t({
- type: _e.fetchStart
- }), io.a.call('organizations/saas/currentPlan', {
- data: a
- }).done(function (e) {
- t({
- type: _e.fetchedCurrentPlan,
- isFromInitialFetch: !0,
- response: e.response
- })
- }).fail(function () {
- t({
- type: _e.fetchFailed,
- isFromInitialFetch: !0
- })
- })), n.pollsActivationDate && (t({
- type: _e.fetchStart
- }), io.a.call('organizations/saas/currentPlan', {
- data: Ll(Ll({
- }, a), {
- }, {
- productName: Ur.SAAS_PRODUCT_POLLS,
- includeInactive: 1
- })
- }).done(function (e) {
- t({
- type: _e.pollsFetchedCurrentPlan,
- isFromInitialFetch: !0,
- response: e.response
- })
- }).fail(function () {
- t({
- type: _e.fetchFailed,
- isFromInitialFetch: !0
- })
- })), t({
- type: _e.fetchStart
- }), io.a.call('organizations/saas/billingInformation', {
- data: a
- }).done(function (e) {
- t({
- type: _e.fetchedBillingInformation,
- isFromInitialFetch: !0,
- response: e.response
- })
- }).fail(function () {
- t({
- type: _e.fetchFailed,
- isFromInitialFetch: !0
- })
- }))),
- ko.addStripeScript(t, e)
- }
- },
- Gl = function (t, e, n) {
- return io.a.call('organizations/saas/updatePaymentInfo', {
- method: 'POST',
- data: {
- organization: e().selection.organization.id,
- token: n.id
- }
- }).then(function (e) {
- e = e.response;
- t({
- type: _e.updateSubscriptionEnd
- }),
- t({
- type: _e.fetchedBillingInformation,
- response: e
- })
- })
- },
- Vl = function (n) {
- return function (t, e) {
- t({
- type: _e.updateInvoiceStart
- }),
- io.a.call('organizations/saas/updateInvoiceInfo', {
- method: 'POST',
- data: Ll({
- organization: e().selection.organization.id
- }, n)
- }).done(function (e) {
- t({
- type: _e.updateInvoiceEnd,
- response: e.response
- })
- }).fail(function () {
- t({
- type: _e.updateInvoiceEnd
- })
- })
- }
- },
- Wl = function (d, r, o, m) {
- return function (i, s) {
- if (d.id === Ur.DISQUS_BASIC_PLAN_ID) return e = i,
- io.a.call('organizations/enableComments', {
- method: 'POST',
- data: {
- organization: s().selection.organization.id
- }
- }).done(function () {
- e({
- type: be.onEnableComments
- })
- });
- var e,
- t = s().subscription;
- t.orgBilling.paymentInfo && i({
- type: _e.updateSubscriptionStart
- });
- var l = s().selection.organization.id,
- c = t.orgTrial || {
- },
- u = je.a.find(t.packages, function (e) {
- return e.plans.some(function (e) {
- return e.id === d.id
- })
- });
- if (!u) {
- var n = vo.a.Deferred();
- return n.reject(Error('Unknown plan')),
- n.promise()
- }
- function p() {
- return Ul(d, i, s, null, m)
- }
- var a = !!t.orgAvailableTrials && !!~t.orgAvailableTrials.indexOf(d.id) || !!t.orgTransferableTrials && !!~t.orgTransferableTrials.indexOf(d.id),
- n = vo.a.when(0);
- return !d.amount || t.orgBilling.paymentInfo || !Object(Tl.isNewFlow) ('cc_v2', {
- orgId: l,
- trial: c
- }) && a ? n.then(p).then(null, function (e) {
- var t,
- n = e && e.responseText || '';
- try {
- r = JSON.parse(e.responseText)
- } catch (e) {
- }
- if (r && 25 === r.code) {
- try {
- t = JSON.parse(r.response)
- } catch (e) {
- }
- if (t && 'stripe' === t.provider && 'card_error' === t.type) {
- var a = vo.a.Deferred(),
- r = Error('Could not subscribe');
- return r.code = 25,
- r.reason = t.message,
- a.reject(r),
- a
- }
- }
- if (~n.indexOf('You must unsubscribe from your current plan.')) {
- Hl();
- a = vo.a.Deferred();
- return a.reject(Error('Could not subscribe')),
- a
- }
- if (~n.indexOf('Need payment information.') && !zl()) return o = '',
- 'month' === (n = d.interval || 'month') ? o = 'Monthly ' : 'year' === n && (o = 'Yearly '),
- Ml({
- amount: d.amount,
- description: Object(Tl.isNewFlow) ('cc_v2_stripe', {
- orgId: l,
- trial: c
- }) ? 'You won’t be charged for 30 days' : ''.concat(o).concat(u.name, ' subscription'),
- panelLabel: 'Subscribe {{amount}} /'.concat(n),
- name: Object(Tl.isNewFlow) ('cc_v2_stripe', {
- orgId: l,
- trial: c
- }) ? 'Disqus '.concat(o).concat(u.name) : null,
- nostyle: !0
- }, i, s).then(p);
- var o = vo.a.Deferred();
- return o.reject(e),
- o
- }) : (ko.updateCheckoutData({
- plan: d.id,
- organization: l,
- returnUrl: o
- }, i), r.push(ho.getRoute('/checkout/')), n)
- }
- },
- Yl = function (e, n) {
- return function (t) {
- return io.a.call('organizations/saas/subscribe', {
- method: 'POST',
- data: {
- organization: e,
- activationCode: n
- }
- }).done(function (e) {
- e = e.response;
- t({
- type: e.plan.id.indexOf('polls') ? _e.fetchedCurrentPlan : _e.pollsFetchedCurrentPlan,
- response: e.response
- })
- }).fail(function () {
- t({
- type: _e.updateSubscriptionEnd
- })
- })
- }
- },
- Ql = function (e) {
- return function () {
- return io.a.call('internal/saas/activationCode/validate', {
- data: {
- activationCode: e
- }
- })
- }
- },
- Kl = function () {
- return function (e, t) {
- return Ml({
- amount: 0,
- panelLabel: 'Update payment info'
- }, e, t)
- }
- };
- function Jl(e) {
- return (Jl = 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator ? function (e) {
- return typeof e
- }
- : function (e) {
- return e && 'function' == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? 'symbol' : typeof e
- }) (e)
- }
- function $l(e, t) {
- for (var n = 0; n < t.length; n++) {
- var a = t[n];
- a.enumerable = a.enumerable || !1,
- a.configurable = !0,
- 'value' in a && (a.writable = !0),
- Object.defineProperty(e, a.key, a)
- }
- }
- function Zl(e, t) {
- return (Zl = Object.setPrototypeOf || function (e, t) {
- return e.__proto__ = t,
- e
- }) (e, t)
- }
- function Xl(n) {
- var a = function () {
- if ('undefined' == typeof Reflect || !Reflect.construct) return !1;
- if (Reflect.construct.sham) return !1;
- if ('function' == typeof Proxy) return !0;
- try {
- return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [
- ], function () {
- })),
- !0
- } catch (e) {
- return !1
- }
- }();
- return function () {
- var e,
- t = tc(n);
- return e = a ? (e = tc(this).constructor, Reflect.construct(t, arguments, e)) : t.apply(this, arguments),
- t = this,
- !(e = e) || 'object' !== Jl(e) && 'function' != typeof e ? ec(t) : e
- }
- }
- function ec(e) {
- if (void 0 === e) throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called');
- return e
- }
- function tc(e) {
- return (tc = Object.setPrototypeOf ? Object.getPrototypeOf : function (e) {
- return e.__proto__ || Object.getPrototypeOf(e)
- }) (e)
- }
- function nc(e, t, n) {
- return t in e ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n,
- e
- }
- var ac = function () {
- !function (e, t) {
- if ('function' != typeof t && null !== t) throw new TypeError('Super expression must either be null or a function');
- e.prototype = Object.create(t && t.prototype, {
- constructor: {
- value: e,
- writable: !0,
- configurable: !0
- }
- }),
- t && Zl(e, t)
- }(o, A);
- var e,
- t,
- n,
- r = Xl(o);
- function o() {
- var t;
- !function (e, t) {
- if (!(e instanceof t)) throw new TypeError('Cannot call a class as a function')
- }(this, o);
- for (var e = arguments.length, n = Array(e), a = 0; a < e; a++) n[a] = arguments[a];
- return nc(ec(t = r.call.apply(r, [
- this
- ].concat(n))), 'state', {
- user: Bl
- }),
- nc(ec(t), 'fetchData', function () {
- t.apiCall = io.a.call('users/details').done(t.onFetch)
- }),
- nc(ec(t), 'onFetch', function (e) {
- t.setState({
- user: Bl = e.response
- })
- }),
- nc(ec(t), 'getComponentProps', function () {
- return {
- user: t.state.user
- }
- }),
- t
- }
- return e = o,
- (t = [
- {
- key: 'componentDidMount',
- value: function () {
- this.state.user || this.fetchData()
- }
- },
- {
- key: 'componentWillUnmount',
- value: function () {
- this.apiCall && 'pending' === this.apiCall.state() && this.apiCall.abort()
- }
- }
- ]) && $l(e.prototype, t),
- n && $l(e, n),
- o
- }();
- nc(ac, 'displayName', 'LoggedInUserDetailsDriver');
- var rc = Object(ki.createDriver) (ac);
- function oc(e) {
- return (oc = 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator ? function (e) {
- return typeof e
- }
- : function (e) {
- return e && 'function' == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? 'symbol' : typeof e
- }) (e)
- }
- function ic(e) {
- return function (e) {
- if (Array.isArray(e)) return cc(e)
- }(e) || uc(e) || lc(e) || function () {
- throw new TypeError('Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.')
- }()
- }
- function sc(e) {
- return function (e) {
- if (Array.isArray(e)) return e
- }(e) || uc(e) || lc(e) || 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 lc(e, t) {
- if (e) {
- if ('string' == typeof e) return cc(e, t);
- var n = Object.prototype.toString.call(e).slice(8, - 1);
- return 'Map' === (n = 'Object' === n && e.constructor ? e.constructor.name : n) || 'Set' === n ? Array.from(e) : 'Arguments' === n || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n) ? cc(e, t) : void 0
- }
- }
- function cc(e, t) {
- for (var n = 0, a = Array(t = null == t || e.length < t ? e.length : t); n < t; n++) a[n] = e[n];
- return a
- }
- function uc(e) {
- if ('undefined' != typeof Symbol && null != e[Symbol.iterator] || null != e['@@iterator']) return Array.from(e)
- }
- function pc(e, t) {
- for (var n = 0; n < t.length; n++) {
- var a = t[n];
- a.enumerable = a.enumerable || !1,
- a.configurable = !0,
- 'value' in a && (a.writable = !0),
- Object.defineProperty(e, a.key, a)
- }
- }
- function dc(e, t) {
- return (dc = Object.setPrototypeOf || function (e, t) {
- return e.__proto__ = t,
- e
- }) (e, t)
- }
- function mc(n) {
- var a = function () {
- if ('undefined' == typeof Reflect || !Reflect.construct) return !1;
- if (Reflect.construct.sham) return !1;
- if ('function' == typeof Proxy) return !0;
- try {
- return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [
- ], function () {
- })),
- !0
- } catch (e) {
- return !1
- }
- }();
- return function () {
- var e,
- t = hc(n);
- return e = a ? (e = hc(this).constructor, Reflect.construct(t, arguments, e)) : t.apply(this, arguments),
- t = this,
- !(e = e) || 'object' !== oc(e) && 'function' != typeof e ? fc(t) : e
- }
- }
- function fc(e) {
- if (void 0 === e) throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called');
- return e
- }
- function hc(e) {
- return (hc = Object.setPrototypeOf ? Object.getPrototypeOf : function (e) {
- return e.__proto__ || Object.getPrototypeOf(e)
- }) (e)
- }
- function gc(e, t, n) {
- return t in e ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n,
- e
- }
- var yc = function () {
- !function (e, t) {
- if ('function' != typeof t && null !== t) throw new TypeError('Super expression must either be null or a function');
- e.prototype = Object.create(t && t.prototype, {
- constructor: {
- value: e,
- writable: !0,
- configurable: !0
- }
- }),
- t && dc(e, t)
- }(s, A);
- var e,
- t,
- n,
- a = mc(s);
- function s() {
- var i;
- !function (e, t) {
- if (!(e instanceof t)) throw new TypeError('Cannot call a class as a function')
- }(this, s);
- for (var e = arguments.length, t = Array(e), n = 0; n < e; n++) t[n] = arguments[n];
- return gc(fc(i = a.call.apply(a, [
- this
- ].concat(t))), 'onLocationChange', function () {
- clearTimeout(i._pendingPageView),
- i._pendingPageView = je.a.defer(function () {
- window.location.href !== i._pageHref && (i._pageHref = window.location.href, i.onSegmentCall('page', {
- path: fo()
- }))
- })
- }),
- gc(fc(i), 'sendPageView', function () {
- window.location.href === i._pageHref && i.onSegmentCall('page', {
- path: fo()
- })
- }),
- gc(fc(i), 'checkUser', function () {
- var e;
- s._hasSeenUser || (e = i.props.user) && (s._hasSeenUser = !0, i.onSegmentCall('identify', e.id, {
- avatar: e.avatar && e.avatar.cache,
- createdAt: ''.concat(e.joinedAt, 'Z'),
- email: e.email,
- name: e.name,
- username: e.username,
- website: e.url
- }))
- }),
- gc(fc(i), 'checkGroup', function () {
- if (!s._hasSeenGroup) {
- var e,
- t = i.props.selection.organization;
- if (!t) {
- if (!i.props.user) return;
- t = je.a.chain(window._v5Config.organizations).values().find(function (e) {
- return e.owner === i.props.user.username
- }).value()
- }
- !t || !t.pollsOnly && !i.props.orgCurrentPlan || t.pollsActivationDate && !i.props.pollsOrgCurrentPlan || (s._hasSeenGroup = !0, e = {
- name: t.name,
- slug: t.slug,
- averageDailyPageviews: t.averageDailyPageviews,
- averageDailyPosts: t.averageDailyPosts,
- totalRecentPosts: t.totalRecentPosts,
- plan: i.props.orgCurrentPlan ? i.props.orgCurrentPlan.id : void 0,
- pollsOnly: t.pollsOnly,
- pollsActivationDate: t.pollsActivationDate ? ''.concat(t.pollsActivationDate, 'Z') : void 0,
- pollsPlan: i.props.pollsOrgCurrentPlan && i.props.pollsPlanStatus !== Ur.SAAS_PRODUCT_PLAN_CANCELLED_STATUS ? i.props.pollsOrgCurrentPlan.id : void 0
- }, null !== t.averageDailyPostshareRevenue && (e.averageDailyPostshareRevenue = t.averageDailyPostshareRevenue), i.onSegmentCall('group', '' + t.id, e))
- }
- }),
- gc(fc(i), 'onSegmentCall', function (e) {
- for (var t, n, a = arguments.length, r = Array(1 < a ? a - 1 : 0), o = 1; o < a; o++) r[o - 1] = arguments[o];
- if (s._hasSentIdentify || 'identify' === e || 'debug' === e) {
- if (window.analytics) return window.analytics.initialize ? t = (n = window.analytics) [e].apply(n, r) : window.analytics.push([e].concat(r)),
- 'identify' !== e || s._hasSentIdentify || (s._hasSentIdentify = !0, n = s._queue, s._queue = [
- ], n.forEach(function (e) {
- var t = sc(e),
- e = t[0],
- t = t.slice(1);
- return i.onSegmentCall.apply(i, [
- e
- ].concat(ic(t)))
- })),
- t
- } else s._queue.push([e].concat(r))
- }),
- gc(fc(i), 'getComponentProps', function () {
- return {
- onSegmentCall: i.onSegmentCall
- }
- }),
- i
- }
- return e = s,
- (t = [
- {
- key: 'getChildContext',
- value: function () {
- return {
- onSegmentCall: this.onSegmentCall
- }
- }
- },
- {
- key: 'componentWillMount',
- value: function () {
- this._pageHref = window.location.href
- }
- },
- {
- key: 'componentDidMount',
- value: function () {
- var e,
- t = this;
- s._scriptAdded || window.analytics && window.analytics.initialize || (window.analytics || (window.analytics = [
- ]), window.analytics.SNIPPET_VERSION = '4.0.0', s._scriptAdded = !0, (e = window.document.createElement('script')).src = 'https://cdn.segment.com/analytics.js/v1/'.concat(pt.a.keys.segmentIO, '/analytics.min.js'), e.async = 1, window.document.head.appendChild(e)),
- this.checkUser(),
- this.checkGroup(),
- this.sendPageView(),
- this._pendingPageView = null,
- this._stopListening = this.context.router.listen(function () {
- return t.onLocationChange()
- })
- }
- },
- {
- key: 'componentDidUpdate',
- value: function (e) {
- this.checkUser(),
- this.checkGroup(),
- this.props.selection.organization && e.orgCurrentPlan && this.props.orgCurrentPlan && e.orgCurrentPlan.id !== this.props.orgCurrentPlan.id && this.onSegmentCall('group', '' + this.props.selection.organization.id, {
- plan: this.props.orgCurrentPlan.id
- }),
- (e.selection.organization && !e.selection.organization.pollsActivationDate && !e.pollsOrgCurrentPlan && this.props.pollsOrgCurrentPlan || e.pollsOrgCurrentPlan && this.props.pollsOrgCurrentPlan && e.pollsOrgCurrentPlan.id !== this.props.pollsOrgCurrentPlan.id || e.pollsOrgCurrentPlan && this.props.pollsOrgCurrentPlan && e.pollsPlanStatus === Ur.SAAS_PRODUCT_PLAN_CANCELLED_STATUS && this.props.pollsPlanStatus !== Ur.SAAS_PRODUCT_PLAN_CANCELLED_STATUS) && this.onSegmentCall('group', '' + this.props.selection.organization.id, {
- pollsPlan: this.props.pollsOrgCurrentPlan.id
- }),
- !s.hasSeenPublishedPoll && this.props.polls && this.props.polls.some(function (e) {
- return e.published
- }) && (s.hasSeenPublishedPoll = !0)
- }
- },
- {
- key: 'componentWillUnmount',
- value: function () {
- this._stopListening && this._stopListening(),
- clearTimeout(this._pendingPageView)
- }
- }
- ]) && pc(e.prototype, t),
- n && pc(e, n),
- s
- }();
- gc(yc, 'displayName', 'SegmentIODriver'),
- gc(yc, 'propTypes', {
- orgCurrentPlan: Ur.PLAN_SHAPE,
- selection: ht,
- user: b.a.object
- }),
- gc(yc, 'contextTypes', {
- router: b.a.object.isRequired
- }),
- gc(yc, 'childContextTypes', {
- onSegmentCall: b.a.func
- }),
- gc(yc, '_scriptAdded', !1),
- gc(yc, '_hasSeenGroup', !1),
- gc(yc, '_hasSeenUser', !1),
- gc(yc, '_queue', [
- ]),
- gc(yc, '_hasSentIdentify', !1);
- var bc = Ni.a.attachDrivers(Ni.a.createDriver(yc, function (e) {
- var t = e.subscription;
- return {
- orgCurrentPlan: t.orgCurrentPlan,
- pollsOrgCurrentPlan: t.pollsOrgCurrentPlan,
- pollsPlanStatus: t.pollsPlanStatus,
- selection: e.selection,
- pollsList: e.pollsList
- }
- }), [
- rc
- ]);
- function vc(e) {
- return (vc = 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator ? function (e) {
- return typeof e
- }
- : function (e) {
- return e && 'function' == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? 'symbol' : typeof e
- }) (e)
- }
- function _c(e, t) {
- for (var n = 0; n < t.length; n++) {
- var a = t[n];
- a.enumerable = a.enumerable || !1,
- a.configurable = !0,
- 'value' in a && (a.writable = !0),
- Object.defineProperty(e, a.key, a)
- }
- }
- function Ec(e, t) {
- return (Ec = Object.setPrototypeOf || function (e, t) {
- return e.__proto__ = t,
- e
- }) (e, t)
- }
- function Oc(n) {
- var a = function () {
- if ('undefined' == typeof Reflect || !Reflect.construct) return !1;
- if (Reflect.construct.sham) return !1;
- if ('function' == typeof Proxy) return !0;
- try {
- return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [
- ], function () {
- })),
- !0
- } catch (e) {
- return !1
- }
- }();
- return function () {
- var e,
- t = Sc(n);
- return e = a ? (e = Sc(this).constructor, Reflect.construct(t, arguments, e)) : t.apply(this, arguments),
- t = this,
- !(e = e) || 'object' !== vc(e) && 'function' != typeof e ? function (e) {
- if (void 0 !== e) return e;
- throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called')
- }(t) : e
- }
- }
- function Sc(e) {
- return (Sc = Object.setPrototypeOf ? Object.getPrototypeOf : function (e) {
- return e.__proto__ || Object.getPrototypeOf(e)
- }) (e)
- }
- function wc(e, t, n) {
- return t in e ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n,
- e
- }
- var Pc = function () {
- !function (e, t) {
- if ('function' != typeof t && null !== t) throw new TypeError('Super expression must either be null or a function');
- e.prototype = Object.create(t && t.prototype, {
- constructor: {
- value: e,
- writable: !0,
- configurable: !0
- }
- }),
- t && Ec(e, t)
- }(r, A);
- var e,
- t,
- n,
- a = Oc(r);
- function r() {
- return function (e, t) {
- if (!(e instanceof t)) throw new TypeError('Cannot call a class as a function')
- }(this, r),
- a.apply(this, arguments)
- }
- return e = r,
- (t = [
- {
- key: 'componentDidMount',
- value: function () {
- this.props.fetchSubscription()
- }
- },
- {
- key: 'render',
- value: function () {
- var t = this;
- if (this.props.orgSubscriptionIsFetching || !(this.props.orgTrial && this.props.orgTrial.isActive && this.props.orgBilling) || this.props.orgBilling.paymentInfo || '/settings/subscription/' === fo(this.props.location.basename + this.props.location.pathname)) return null;
- var e = ct() (this.props.orgTrial.endDate).diff(ct() (), 'days'),
- n = (this.props.selection.organization || {
- }).id;
- return C.a.createElement('div', {
- className: 'motd-alert alert--muted-dark'
- }, C.a.createElement('div', {
- className: 'padding-default'
- }, C.a.createElement('div', {
- className: 'text-center'
- }, C.a.createElement('span', {
- className: 'spacing-narrow motd-alert__subscription-text'
- }, C.a.createElement('span', {
- className: 'icon-expire icon__position spacing-right'
- }), C.a.createElement('strong', {
- className: 'spacing-right'
- }, 'Your trial of ', this.props.orgCurrentPackage.name, ' ends in ', e, ' ', 1 === e ? 'day' : 'days', '.')), Object(Tl.isNewFlow) ('cc_v2', {
- orgId: n,
- trial: this.props.orgTrial
- }) ? null : C.a.createElement('button', {
- className: 'button button-outline text-gray motd-alert__subscription-button',
- onClick: function () {
- var e = t.props.orgCurrentPlan;
- return t.props.emitTrackingEvent({
- verb: 'click',
- object_type: 'button',
- object_id: e && e.id
- }),
- t.props.onSubscribe(e).then(function () {
- t.props.history.push(mo('/settings/subscription/'))
- })
- }
- }, 'Subscribe Now'))))
- }
- }
- ]) && _c(e.prototype, t),
- n && _c(e, n),
- r
- }();
- wc(Pc, 'displayname', 'SubscribeBar'),
- wc(Pc, 'propTypes', {
- history: b.a.shape({
- push: b.a.func.isRequired
- }).isRequired,
- location: b.a.object.isRequired,
- emitTrackingEvent: b.a.func.isRequired,
- fetchSubscription: b.a.func.isRequired,
- onSubscribe: b.a.func.isRequired,
- orgSubscriptionIsFetching: b.a.bool.isRequired,
- orgTrial: b.a.shape({
- endDate: function (e, t, n) {
- return e.isActive && !e.endDate ? Error('orgTrial.endDate in '.concat(n, ' is required when orgTrial.isActive is true')) : null
- },
- startDate: b.a.string,
- isActive: b.a.bool.isRequired,
- paymentInfo: b.a.any
- }),
- orgCurrentPackage: b.a.shape({
- name: b.a.string.isRequired
- }),
- orgCurrentPlan: b.a.object,
- orgBilling: b.a.object
- });
- var kc = Object(u.connect) (function (e) {
- var t = e.subscription;
- return {
- orgBilling: t.orgBilling,
- orgCurrentPackage: t.orgCurrentPackage,
- orgCurrentPlan: t.orgCurrentPlan,
- orgSubscriptionIsFetching: t.orgSubscriptionIsFetching,
- orgTrial: t.orgTrial,
- selection: e.selection
- }
- }, {
- emitTrackingEvent: Xo({
- zone: 'payment_banner'
- }),
- fetchSubscription: Hl,
- onSubscribe: Wl
- }) (Ni.a.attachDrivers(Fo() (Pc), [
- bc
- ])),
- Nc = b.a.shape({
- avatarUrl: b.a.string,
- datetimeFormatting: b.a.string,
- id: b.a.number.isRequired,
- isAuthenticated: b.a.bool,
- isModerator: b.a.bool,
- staff: b.a.bool,
- tzOffset: b.a.string,
- username: b.a.string.isRequired
- }),
- Cc = Object.freeze({
- MAX_POLL_NAME_LENGTH: 76,
- MAX_QUESTION_LENGTH: 76,
- MAX_ANSWER_LENGTH: 43,
- MAX_QUESTIONS: 3,
- MIN_QUESTIONS: 1,
- MAX_ANSWERS: 4,
- MIN_ANSWERS: 2
- }),
- Rc = [
- 'ID',
- 'Name',
- 'Status',
- 'Responses',
- 'Created',
- 'Exclude from Universal Tags',
- 'Actions'
- ],
- xc = Object.freeze({
- SINGLE: '1',
- MULTI: '2',
- SINGLE_RANDOM: '3',
- SINGLE_RANDOM_WITH_ANCHOR: '4'
- }),
- Ac = xc.SINGLE,
- Dc = b.a.oneOf(Object.values(xc)),
- jc = [
- {
- key: xc.SINGLE,
- value: xc.SINGLE,
- label: 'Single Choice'
- },
- {
- key: xc.MULTI,
- value: xc.MULTI,
- label: 'Multi-select'
- },
- {
- key: xc.SINGLE_RANDOM,
- value: xc.SINGLE_RANDOM,
- label: 'Single Choice Random'
- },
- {
- key: xc.SINGLE_RANDOM_WITH_ANCHOR,
- value: xc.SINGLE_RANDOM_WITH_ANCHOR,
- label: 'Single Choice Random + Anchor'
- }
- ],
- Tc = [
- {
- key: 1,
- value: 1,
- label: '1 day'
- },
- {
- key: 7,
- value: 7,
- label: '7 days'
- },
- {
- key: 30,
- value: 30,
- label: '30 days'
- }
- ],
- Ic = 1,
- qc = b.a.arrayOf(b.a.shape({
- id: b.a.number.isRequired,
- name: b.a.string.isRequired,
- published: b.a.bool.isRequired,
- responses: b.a.number.isRequired,
- createdAt: b.a.string.isRequired
- })),
- Fc = b.a.shape({
- text: b.a.string.isRequired
- }),
- Lc = b.a.shape({
- text: b.a.string.isRequired,
- type: Dc,
- answers: b.a.arrayOf(Fc).isRequired
- }),
- Uc = (b.a.shape({
- id: b.a.number,
- name: b.a.string.isRequired,
- published: b.a.bool.isRequired,
- startDate: b.a.string.isRequired,
- endDate: b.a.string.isRequired,
- requireAuth: b.a.bool.isRequired,
- voteInterval: b.a.number,
- questions: b.a.arrayOf(Lc).isRequired
- }), b.a.shape({
- id: b.a.number.isRequired,
- name: b.a.string.isRequired,
- published: b.a.bool.isRequired,
- startDate: b.a.string.isRequired,
- endDate: b.a.string.isRequired,
- requireAuth: b.a.bool.isRequired,
- voteInterval: b.a.number,
- questions: b.a.arrayOf(Lc).isRequired
- })),
- Mc = b.a.shape({
- text: b.a.bool.isRequired,
- answers: b.a.object.isRequired
- }),
- Bc = 'https://polls.services.disqus.com/poll/preview?previewId=',
- zc = 'pendingPreview',
- Hc = 'no_poll_instructions',
- Gc = /^(?:\/admin)?\/polls\/editor\/(?:\d+|[a-zA-Z]+)?\/?$/,
- Vc = /^(?:\/admin)?\/polls\/insights\/(?:\d+|[a-zA-Z]+)?\/?$/,
- Wc = {
- LIST: '/polls/list/',
- EDITOR: '/polls/editor/',
- EDITOR_NEW: '/polls/editor/new/',
- INSIGHTS: '/polls/insights/'
- },
- Yc = n(72),
- Qc = n.n(Yc),
- Kc = 3,
- Jc = b.a.shape({
- adsSettingsUrl: b.a.string.isRequired,
- disableDisqusBranding: b.a.bool.isRequired,
- features: b.a.objectOf(b.a.bool).isRequired,
- founder: b.a.shape({
- username: b.a.string,
- id: b.a.number
- }).isRequired,
- id: b.a.number.isRequired,
- installCompleted: b.a.bool.isRequired,
- name: b.a.string,
- newPolicy: b.a.bool.isRequired,
- organization: b.a.number.isRequired,
- permissions: b.a.objectOf(b.a.bool).isRequired,
- saasPolicy: b.a.bool.isRequired,
- settings: b.a.objectOf(b.a.bool).isRequired,
- shortname: b.a.string.isRequired,
- tipaltiUrl: b.a.string.isRequired,
- url: b.a.string,
- website: b.a.string
- }),
- $c = b.a.shape({
- aetBannerEnabled: b.a.bool,
- aetBannerTitle: b.a.string,
- aetBannerDescription: b.a.string,
- aetBannerConfirmation: b.a.string,
- name: b.a.string
- });
- function Zc(e) {
- return (Zc = 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator ? function (e) {
- return typeof e
- }
- : function (e) {
- return e && 'function' == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? 'symbol' : typeof e
- }) (e)
- }
- function Xc(e, t) {
- if (!(e instanceof t)) throw new TypeError('Cannot call a class as a function')
- }
- function eu(e, t) {
- for (var n = 0; n < t.length; n++) {
- var a = t[n];
- a.enumerable = a.enumerable || !1,
- a.configurable = !0,
- 'value' in a && (a.writable = !0),
- Object.defineProperty(e, a.key, a)
- }
- }
- function tu(e, t, n) {
- return t && eu(e.prototype, t),
- n && eu(e, n),
- e
- }
- function nu(e, t) {
- if ('function' != typeof t && null !== t) throw new TypeError('Super expression must either be null or a function');
- e.prototype = Object.create(t && t.prototype, {
- constructor: {
- value: e,
- writable: !0,
- configurable: !0
- }
- }),
- t && au(e, t)
- }
- function au(e, t) {
- return (au = Object.setPrototypeOf || function (e, t) {
- return e.__proto__ = t,
- e
- }) (e, t)
- }
- function ru(n) {
- var a = function () {
- if ('undefined' == typeof Reflect || !Reflect.construct) return !1;
- if (Reflect.construct.sham) return !1;
- if ('function' == typeof Proxy) return !0;
- try {
- return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [
- ], function () {
- })),
- !0
- } catch (e) {
- return !1
- }
- }();
- return function () {
- var e,
- t = iu(n);
- return e = a ? (e = iu(this).constructor, Reflect.construct(t, arguments, e)) : t.apply(this, arguments),
- t = this,
- !(e = e) || 'object' !== Zc(e) && 'function' != typeof e ? ou(t) : e
- }
- }
- function ou(e) {
- if (void 0 === e) throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called');
- return e
- }
- function iu(e) {
- return (iu = Object.setPrototypeOf ? Object.getPrototypeOf : function (e) {
- return e.__proto__ || Object.getPrototypeOf(e)
- }) (e)
- }
- function su(e, t, n) {
- return t in e ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n,
- e
- }
- var lu = 3,
- cu = function () {
- nu(c, A);
- var a = ru(c);
- function c() {
- var l;
- Xc(this, c);
- for (var e = arguments.length, t = Array(e), n = 0; n < e; n++) t[n] = arguments[n];
- return su(ou(l = a.call.apply(a, [
- this
- ].concat(t))), 'state', {
- searchTerm: null
- }),
- su(ou(l), 'onKeyUp', function (e) {
- l.setState({
- searchTerm: e.target.value
- })
- }),
- su(ou(l), 'handleMarkOrgDefault', function (e, t) {
- e.preventDefault(),
- io.a.call('users/starOrganization', {
- data: {
- organization: t
- },
- method: 'POST'
- }).done(function () {
- window.location.reload()
- })
- }),
- su(ou(l), 'getGroupedForums', function () {
- var a = l.state.searchTerm,
- r = l.props.adminPath,
- n = l.props.organizations,
- o = l.props.supportedSelections,
- e = je.a.chain(l.props.moderatedForums).map(function (e, t) {
- return e.url = t,
- e
- }).filter(function (e) {
- if (!a) return !0;
- var t = a.toLowerCase(),
- n = !e.settings.IS_CHANNEL_PRIMARY_FORUM && !!~e.founder.username.toLowerCase().indexOf(t);
- return !!~e.name.toLowerCase().indexOf(t) || n
- }).groupBy(function (e) {
- return !(e.organization && n[e.organization]).name && e.settings.IS_CHANNEL_PRIMARY_FORUM ? 'channels' : 'orgs'
- }).value();
- e.orgs = je.a.chain(e.orgs).groupBy(function (e) {
- return e.organization
- }).map(function (e, t) {
- t = n[t];
- return [je.a.extend({
- text: t.name || 'Owned by '.concat(t.owner),
- isOrg: !0
- }, t),
- e]
- }).value().sort(function (e, t) {
- e = e[0],
- t = t[0];
- return e.starred ? - 1 : t.starred ? 1 : [
- e.name,
- t.name
- ].sort()
- }),
- e.channels = e.channels ? [
- [{
- text: 'Channels'
- },
- e.channels]
- ] : [
- ];
- var i = 1 < e.orgs.length,
- s = ou(l);
- return je.a.chain([e.orgs,
- e.channels]).flatten(!0).reduce(function (e, t) {
- var n = t[0],
- a = t[1];
- (t = [
- ]).push(C.a.createElement(c.HeaderItem, {
- supportedSelections: o,
- key: ''.concat(n.text, '-name'),
- text: n.text,
- orgId: n.isOrg && n.id,
- orgSlug: n.isOrg && n.slug,
- orgIsAdmin: n.isOrg && n.permissions.isAdmin,
- adminPath: r,
- orgIsStarred: n.isOrg && n.starred,
- onMakeOrgDefault: i ? s.handleMarkOrgDefault : null
- })),
- n.isOrg && !n.name && n.permissions.isAdmin && t.push(C.a.createElement(c.ChangeNameAlertItem, {
- key: ''.concat(n.text, '-changeName'),
- orgId: n.id
- }));
- a = C.a.createElement('section', {
- className: 'site-list__sites',
- key: ''.concat(n.text, '-sites')
- }, a.sort(function (e, t) {
- e = e.name.toLowerCase(),
- t = t.name.toLowerCase();
- return e < t ? - 1 : t < e ? 1 : 0
- }).map(function (e) {
- return C.a.createElement(c.ForumItem, {
- key: e.url,
- text: e.name,
- url: e.url,
- website: e.website,
- adminPath: r,
- supportedSelections: o
- })
- })),
- t = t.concat(a);
- return e.concat(C.a.createElement('div', {
- key: ''.concat(n.text, '-container'),
- className: 'site-list__container'
- }, t))
- }, [
- ]).value()
- }),
- su(ou(l), 'getHeaderComponent', function () {
- if ('user' === l.props.initiator) {
- var e = Object.keys(l.props.moderatedForums).length;
- return C.a.createElement('div', {
- className: 'site-picker__header align align--between align--middle'
- }, C.a.createElement('h4', null, 'Your Sites', C.a.createElement('span', {
- className: 'label--gray spacing-left-small'
- }, e)), C.a.createElement('div', {
- className: 'site-picker__filter'
- }, C.a.createElement('a', {
- href: pt.a.urls.createSite,
- className: 'button button-outline text-small site-picker__button spacing-right-small'
- }, C.a.createElement('span', {
- className: 'icon icon-plus site-picker__button-icon'
- }), 'New'), lu < e ? C.a.createElement('input', {
- type: 'text',
- className: 'site-picker__input',
- placeholder: 'Search',
- onKeyUp: l.onKeyUp
- }) : null))
- }
- var t = [
- ];
- l.props.supportedSelections.forum && t.push('site'),
- l.props.supportedSelections.organization && t.push('organization');
- var n = window._v5Config.httpStatusCode === g.a.FORBIDDEN,
- e = 'a';
- n ? e = 'another' : 'organization' === t[0] && (e = 'an');
- var a,
- r,
- t = 'Please choose '.concat(e, ' ').concat(t.join(' or '));
- return n ? (a = 'Whoops, you\'re not allowed on that page.', r = t) : (a = t, l.props.supportedSelections.organization || 'organization' !== l.props.selection.type || (r = 'This page does not work for an organization.'), l.props.supportedSelections.forum || 'forum' !== l.props.selection.type || (r = 'This page does not work for a single site')),
- C.a.createElement('div', {
- className: 'site-picker__header'
- }, C.a.createElement('div', {
- className: 'spacing-top-small spacing-bottom-small'
- }, C.a.createElement('h4', {
- className: 'text-large'
- }, n ? C.a.createElement('span', {
- className: 'icon-cancel spacing-right-small text-error text-smaller'
- }) : null, a), C.a.createElement('p', {
- className: 'text-gray'
- }, r)))
- }),
- l
- }
- return tu(c, [
- {
- key: 'render',
- value: function () {
- var e = je.a.keys(this.props.moderatedForums).length,
- t = this.getGroupedForums();
- return C.a.createElement('div', {
- className: 'site-picker__wrapper'
- }, this.getHeaderComponent(), C.a.createElement('ul', {
- className: 'site-list'
- }, 'user' !== this.props.initiator && lu < e ? C.a.createElement('li', {
- className: 'site-list__item'
- }, C.a.createElement('div', {
- className: 'spacing-bottom'
- }, C.a.createElement('input', {
- type: 'text',
- className: 'site-picker__input',
- placeholder: 'Search',
- onKeyUp: this.onKeyUp
- }))) : null, t.length ? t : C.a.createElement('li', {
- className: 'site-list__item'
- }, 'Nothing to show!')))
- }
- }
- ]),
- c
- }();
- su(cu, 'displayName', 'ModeratedForumsList'),
- su(cu, 'propTypes', {
- selection: ht.isRequired,
- adminPath: b.a.string.isRequired,
- organizations: b.a.object.isRequired,
- supportedSelections: b.a.shape({
- forum: b.a.bool,
- organization: b.a.bool
- }).isRequired,
- moderatedForums: b.a.object,
- initiator: b.a.string
- }),
- su(cu, 'defaultProps', {
- moderatedForums: je.a.pick(window._v5Config.forums, window._v5Config.moderated_forums),
- organizations: window._v5Config.organizations
- }),
- cu.ForumItem = (vh = lh = function () {
- nu(o, A);
- var r = ru(o);
- function o() {
- var e;
- Xc(this, o);
- for (var t = arguments.length, n = Array(t), a = 0; a < t; a++) n[a] = arguments[a];
- return su(ou(e = r.call.apply(r, [
- this
- ].concat(n))), 'getForumAdminUrl', function () {
- return '//'.concat(e.props.url, '.').concat(br.disqusHost, '/admin').concat(e.props.adminPath)
- }),
- e
- }
- return tu(o, [
- {
- key: 'render',
- value: function () {
- var e = this.getForumAdminUrl(),
- t = ((this.props.website || '').match(/https?:\/\/(.+)\/?/) || [
- ]) [1];
- return this.props.supportedSelections.forum ? C.a.createElement('li', {
- className: 'site-list__item'
- }, C.a.createElement('a', {
- href: e,
- className: 'site-list__link -default'
- }, C.a.createElement('strong', {
- className: 'site-list__name'
- }, this.props.text), C.a.createElement('span', {
- className: 'spacing-left-small'
- }, t))) : C.a.createElement('li', {
- className: 'site-list__subheading'
- }, this.props.text)
- }
- }
- ]),
- o
- }(), su(lh, 'propTypes', {
- text: b.a.string.isRequired,
- adminPath: b.a.string.isRequired,
- url: b.a.string.isRequired,
- supportedSelections: b.a.shape({
- forum: b.a.bool,
- organiztion: b.a.bool
- }).isRequired,
- website: b.a.string
- }), vh),
- cu.HeaderItem = (Sh = Vb = function () {
- nu(o, A);
- var r = ru(o);
- function o() {
- var t;
- Xc(this, o);
- for (var e = arguments.length, n = Array(e), a = 0; a < e; a++) n[a] = arguments[a];
- return su(ou(t = r.call.apply(r, [
- this
- ].concat(n))), 'getOrgAdminUrl', function () {
- var e = t.props.orgSlug || mt;
- return '//'.concat(br.disqusHost, '/admin/orgs/').concat(t.props.orgId, '/').concat(e).concat(t.props.adminPath).concat(window.location.search)
- }),
- t
- }
- return tu(o, [
- {
- key: 'render',
- value: function () {
- var e = this.props.orgId && this.getOrgAdminUrl(),
- t = null,
- n = null,
- a = null,
- r = null;
- return this.props.orgSlug && this.props.supportedSelections.organization && this.props.orgIsAdmin && (t = C.a.createElement(Us, {
- path: ho.getAdminPath('/settings/general/'),
- linkClassName: 'bullet-after',
- orgId: this.props.orgId,
- orgSlug: this.props.orgSlug
- }, 'Edit'), a = 'bullet-after', r = C.a.createElement('a', {
- href: e
- }, 'Select')),
- this.props.onMakeOrgDefault && this.props.orgId && (n = this.props.orgIsStarred ? C.a.createElement('span', null, C.a.createElement('span', {
- className: 'icon-star icon-tiny text-warning spacing-right-small'
- }), 'Default') : C.a.createElement('a', {
- href: '#',
- onClick: je.a.partial(this.props.onMakeOrgDefault, je.a, this.props.orgId)
- }, 'Make Default')),
- C.a.createElement('li', {
- className: 'site-list__heading'
- }, C.a.createElement('div', {
- className: 'align align--between'
- }, C.a.createElement('div', {
- className: 'align truncate-line'
- }, C.a.createElement('p', {
- className: a
- }, this.props.text), r), t || n ? C.a.createElement('div', {
- className: 'site-list__select-org'
- }, t, n) : null))
- }
- }
- ]),
- o
- }(), su(Vb, 'propTypes', {
- supportedSelections: b.a.shape({
- forum: b.a.bool,
- organization: b.a.bool
- }).isRequired,
- text: b.a.string.isRequired,
- adminPath: b.a.string,
- orgId: b.a.number,
- orgSlug: b.a.string,
- orgIsAdmin: b.a.bool,
- orgIsStarred: b.a.bool,
- onMakeOrgDefault: b.a.func
- }), Sh),
- cu.ChangeNameAlertItem = function (e) {
- return C.a.createElement('li', {
- className: 'site-list__item'
- }, C.a.createElement(Us, {
- path: ho.getAdminPath('/settings/general/'),
- linkClassName: 'site-list__link -highlight',
- orgId: e.orgId,
- orgSlug: mt
- }, C.a.createElement('strong', null, 'Give your site an organization name'), C.a.createElement('span', {
- className: 'site-list__icon icon-right-bracket'
- })))
- },
- cu.ChangeNameAlertItem.displayName = 'ChangeNameAlertItem',
- cu.ChangeNameAlertItem.propTypes = {
- orgId: b.a.number.isRequired
- };
- var uu = Object(u.connect) (function (e) {
- return {
- selection: e.selection
- }
- }) (cu);
- function pu(e) {
- return (pu = 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator ? function (e) {
- return typeof e
- }
- : function (e) {
- return e && 'function' == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? 'symbol' : typeof e
- }) (e)
- }
- function du(e, t) {
- for (var n = 0; n < t.length; n++) {
- var a = t[n];
- a.enumerable = a.enumerable || !1,
- a.configurable = !0,
- 'value' in a && (a.writable = !0),
- Object.defineProperty(e, a.key, a)
- }
- }
- function mu(e, t) {
- return (mu = Object.setPrototypeOf || function (e, t) {
- return e.__proto__ = t,
- e
- }) (e, t)
- }
- function fu(n) {
- var a = function () {
- if ('undefined' == typeof Reflect || !Reflect.construct) return !1;
- if (Reflect.construct.sham) return !1;
- if ('function' == typeof Proxy) return !0;
- try {
- return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [
- ], function () {
- })),
- !0
- } catch (e) {
- return !1
- }
- }();
- return function () {
- var e,
- t = hu(n);
- return e = a ? (e = hu(this).constructor, Reflect.construct(t, arguments, e)) : t.apply(this, arguments),
- t = this,
- !(e = e) || 'object' !== pu(e) && 'function' != typeof e ? function (e) {
- if (void 0 !== e) return e;
- throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called')
- }(t) : e
- }
- }
- function hu(e) {
- return (hu = Object.setPrototypeOf ? Object.getPrototypeOf : function (e) {
- return e.__proto__ || Object.getPrototypeOf(e)
- }) (e)
- }
- function gu(e, t, n) {
- return t in e ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n,
- e
- }
- var yu,
- bu,
- vu = function () {
- !function (e, t) {
- if ('function' != typeof t && null !== t) throw new TypeError('Super expression must either be null or a function');
- e.prototype = Object.create(t && t.prototype, {
- constructor: {
- value: e,
- writable: !0,
- configurable: !0
- }
- }),
- t && mu(e, t)
- }(r, A);
- var e,
- t,
- n,
- a = fu(r);
- function r(e) {
- return function (e, t) {
- if (!(e instanceof t)) throw new TypeError('Cannot call a class as a function')
- }(this, r),
- (e = a.call(this, e)).dropdown = C.a.createRef(),
- e
- }
- return e = r,
- (t = [
- {
- key: 'componentDidMount',
- value: function () {
- var e = this;
- this.props.history && this.props.history.listenBefore(function () {
- return e.dropdown.current && e.dropdown.current.closeDropdown()
- })
- }
- },
- {
- key: 'render',
- value: function () {
- var e = this.props.currentOrgForums ? C.a.createElement('p', {
- className: 'site-nav__subtitle truncate-line'
- }, je.a.pluck(this.props.currentOrgForums, 'name').join(', ')) : this.props.currentForumWebsite ? C.a.createElement('p', {
- className: 'site-nav__subtitle truncate-line'
- }, this.props.currentForumPrettyUrl || this.props.currentForumWebsite) : C.a.createElement('p', {
- className: 'site-nav__subtitle truncate-line'
- }, this.props.numForums, ' total'),
- t = uo.getSupportedSelections(this.props.adminPath);
- return C.a.createElement('div', {
- className: this.props.className
- }, C.a.createElement(Qc.a, {
- buttonChildren: C.a.createElement('div', {
- className: 'site-nav__button'
- }, this.props.currentOrgForums ? C.a.createElement('span', {
- className: 'hidden-sm icon-organization spacing-top-small spacing-right text-larger'
- }) : null, C.a.createElement('span', {
- className: 'site-nav__forum-name'
- }, C.a.createElement('strong', {
- className: 'truncate-line'
- }, this.props.currentOrgName || this.props.currentForumName || 'Your Sites'), e), C.a.createElement('span', {
- className: 'icon-caret spacing-top-small spacing-left'
- })),
- className: 'dropdown-toggle',
- ref: this.dropdown
- }, C.a.createElement('div', {
- className: 'dropdown-menu'
- }, C.a.createElement(uu, {
- adminPath: this.props.adminPath,
- initiator: 'user',
- supportedSelections: t
- }))))
- }
- }
- ]) && du(e.prototype, t),
- n && du(e, n),
- r
- }();
- gu(vu, 'propTypes', {
- adminPath: b.a.string.isRequired,
- className: b.a.string.isRequired,
- currentForumName: b.a.string,
- currentForumWebsite: b.a.string,
- currentForumPrettyUrl: b.a.string,
- currentOrgName: b.a.string,
- currentOrgForums: b.a.arrayOf(Jc),
- numForums: b.a.number.isRequired,
- history: b.a.shape({
- listenBefore: b.a.func.isRequired
- })
- }),
- gu(vu, 'defaultProps', (Ph = window._v5Config.organizations, yu = window._v5Config.forums || {
- }, bu = window._v5Config.moderated_forums || [
- ], Nh = {
- numForums: bu.length
- }, br.orgId ? (kh = (Ph = Ph[br.orgId]) && je.a.chain(Ph.forums).filter(function (e) {
- return je.a.contains(bu, e)
- }).map(function (e) {
- return yu[e]
- }).value(), je.a.extend(Nh, {
- currentOrgName: Ph ? Ph.name : null,
- currentOrgForums: kh
- })) : je.a.extend(Nh, {
- currentForumName: (kh = yu[br.shortname]) ? kh.name : null,
- currentForumWebsite: kh ? kh.website : null,
- currentForumPrettyUrl: kh ? ((kh.website || '').match(/https?:\/\/(.+)\/?/) || [
- ]) [1] : null
- }), Nh));
- var _u = Fo() (vu);
- function Eu(e) {
- return (Eu = 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator ? function (e) {
- return typeof e
- }
- : function (e) {
- return e && 'function' == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? 'symbol' : typeof e
- }) (e)
- }
- function Ou(e, t) {
- for (var n = 0; n < t.length; n++) {
- var a = t[n];
- a.enumerable = a.enumerable || !1,
- a.configurable = !0,
- 'value' in a && (a.writable = !0),
- Object.defineProperty(e, a.key, a)
- }
- }
- function Su(e, t) {
- return (Su = Object.setPrototypeOf || function (e, t) {
- return e.__proto__ = t,
- e
- }) (e, t)
- }
- function wu(n) {
- var a = function () {
- if ('undefined' == typeof Reflect || !Reflect.construct) return !1;
- if (Reflect.construct.sham) return !1;
- if ('function' == typeof Proxy) return !0;
- try {
- return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [
- ], function () {
- })),
- !0
- } catch (e) {
- return !1
- }
- }();
- return function () {
- var e,
- t = ku(n);
- return e = a ? (e = ku(this).constructor, Reflect.construct(t, arguments, e)) : t.apply(this, arguments),
- t = this,
- !(e = e) || 'object' !== Eu(e) && 'function' != typeof e ? Pu(t) : e
- }
- }
- function Pu(e) {
- if (void 0 === e) throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called');
- return e
- }
- function ku(e) {
- return (ku = Object.setPrototypeOf ? Object.getPrototypeOf : function (e) {
- return e.__proto__ || Object.getPrototypeOf(e)
- }) (e)
- }
- function Nu(e, t, n) {
- return t in e ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n,
- e
- }
- var Cu = null,
- Ru = function () {
- !function (e, t) {
- if ('function' != typeof t && null !== t) throw new TypeError('Super expression must either be null or a function');
- e.prototype = Object.create(t && t.prototype, {
- constructor: {
- value: e,
- writable: !0,
- configurable: !0
- }
- }),
- t && Su(e, t)
- }(o, A);
- var e,
- t,
- n,
- r = wu(o);
- function o() {
- var t;
- !function (e, t) {
- if (!(e instanceof t)) throw new TypeError('Cannot call a class as a function')
- }(this, o);
- for (var e = arguments.length, n = Array(e), a = 0; a < e; a++) n[a] = arguments[a];
- return Nu(Pu(t = r.call.apply(r, [
- this
- ].concat(n))), 'state', {
- isOpen: !1,
- adminPath: ho.getAdminPath()
- }),
- Nu(Pu(t), 'open', function (e) {
- t.setState({
- isOpen: !0,
- adminPath: ho.getAdminPath(e)
- })
- }),
- Nu(Pu(t), 'close', function () {
- t.setState({
- isOpen: !1
- })
- }),
- t
- }
- return e = o,
- (t = [
- {
- key: 'componentDidMount',
- value: function () {
- Cu = this;
- var e = ho.getAdminPath(),
- t = uo.getSupportedSelections(e);
- window._v5Config.httpStatusCode !== g.a.FORBIDDEN && t[this.props.selection.type] || this.open(e)
- }
- },
- {
- key: 'componentWillUnmount',
- value: function () {
- Cu = null,
- this.close()
- }
- },
- {
- key: 'render',
- value: function () {
- var e = uo.getSupportedSelections(this.state.adminPath);
- return C.a.createElement(_.a, {
- className: 'site-picker-modal',
- overlayClassName: 'modal-overlay',
- isOpen: this.state.isOpen,
- onRequestClose: this.close
- }, C.a.createElement('div', {
- className: 'site-picker-modal__content'
- }, C.a.createElement(uu, {
- adminPath: this.state.adminPath,
- supportedSelections: e
- }), C.a.createElement('div', {
- className: 'site-picker-modal__footer visible-md'
- }, C.a.createElement('button', {
- type: 'button',
- className: 'button button-wide button-outline',
- onClick: this.close
- }, 'Close'))))
- }
- }
- ]) && Ou(e.prototype, t),
- n && Ou(e, n),
- o
- }();
- Nu(Ru, 'propTypes', {
- selection: ht.isRequired
- });
- var xu = Object(u.connect) (function (e) {
- return {
- selection: e.selection
- }
- }) (Ru);
- xu.openCurrentInstance = function (e) {
- Cu && !Cu.state.isOpen && Cu.open(e)
- };
- var Au = xu;
- function Du(e) {
- return (Du = 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator ? function (e) {
- return typeof e
- }
- : function (e) {
- return e && 'function' == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? 'symbol' : typeof e
- }) (e)
- }
- function ju(e, t) {
- for (var n = 0; n < t.length; n++) {
- var a = t[n];
- a.enumerable = a.enumerable || !1,
- a.configurable = !0,
- 'value' in a && (a.writable = !0),
- Object.defineProperty(e, a.key, a)
- }
- }
- function Tu(e, t) {
- return (Tu = Object.setPrototypeOf || function (e, t) {
- return e.__proto__ = t,
- e
- }) (e, t)
- }
- function Iu(n) {
- var a = function () {
- if ('undefined' == typeof Reflect || !Reflect.construct) return !1;
- if (Reflect.construct.sham) return !1;
- if ('function' == typeof Proxy) return !0;
- try {
- return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [
- ], function () {
- })),
- !0
- } catch (e) {
- return !1
- }
- }();
- return function () {
- var e,
- t = qu(n);
- return e = a ? (e = qu(this).constructor, Reflect.construct(t, arguments, e)) : t.apply(this, arguments),
- t = this,
- !(e = e) || 'object' !== Du(e) && 'function' != typeof e ? function (e) {
- if (void 0 !== e) return e;
- throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called')
- }(t) : e
- }
- }
- function qu(e) {
- return (qu = Object.setPrototypeOf ? Object.getPrototypeOf : function (e) {
- return e.__proto__ || Object.getPrototypeOf(e)
- }) (e)
- }
- var Fu,
- Lu,
- Uu,
- Mu = '//'.concat(pt.a.disqusHost),
- Bu = function () {
- !function (e, t) {
- if ('function' != typeof t && null !== t) throw new TypeError('Super expression must either be null or a function');
- e.prototype = Object.create(t && t.prototype, {
- constructor: {
- value: e,
- writable: !0,
- configurable: !0
- }
- }),
- t && Tu(e, t)
- }(r, A);
- var e,
- t,
- n,
- a = Iu(r);
- function r() {
- return function (e, t) {
- if (!(e instanceof t)) throw new TypeError('Cannot call a class as a function')
- }(this, r),
- a.apply(this, arguments)
- }
- return e = r,
- (t = [
- {
- key: 'render',
- value: function () {
- var e = this,
- t = 'https://disqus.com/by/'.concat(this.props.auth.username, '/');
- return C.a.createElement('div', {
- className: this.props.className
- }, C.a.createElement(Qc.a, {
- buttonChildren: C.a.createElement('div', {
- className: 'site-nav__block'
- }, C.a.createElement('img', {
- src: this.props.auth.avatarUrl,
- alt: this.props.auth.username,
- className: 'site-nav__avatar'
- }), C.a.createElement('div', {
- className: 'site-nav__caret hidden-lg'
- }, C.a.createElement('span', {
- className: 'icon-caret'
- }))),
- className: 'dropdown-toggle'
- }, C.a.createElement('ul', {
- className: 'dropdown-menu dropdown-settings'
- }, C.a.createElement('li', null, C.a.createElement('a', {
- href: t,
- onClick: function () {
- e.props.emitTrackingEvent({
- verb: 'open',
- object_type: 'product',
- object_id: 'profile/comments',
- forum: e.props.selection.forum.shortname
- })
- }
- }, 'View Profile')), C.a.createElement('li', {
- className: 'hidden-md'
- }, C.a.createElement('a', {
- href: 'https://disqus.com/home/settings/account/'
- }, 'Settings')), C.a.createElement('li', {
- className: 'visible-md'
- }, C.a.createElement('a', {
- href: 'https://disqus.com/home/settings/'
- }, 'Settings')), C.a.createElement('li', {
- role: 'presentation',
- className: 'divider'
- }), C.a.createElement('li', null, C.a.createElement(v.Link, {
- to: '/settings/install/',
- 'data-role': 'help'
- }, 'Install on Site')), C.a.createElement('li', {
- role: 'presentation',
- className: 'divider'
- }), C.a.createElement('li', null, C.a.createElement('a', {
- href: 'https://disqus.com/about/',
- 'data-role': 'about'
- }, 'About')), C.a.createElement('li', null, C.a.createElement('a', {
- href: Pn.contactSupport,
- 'data-role': 'help'
- }, 'Help')), C.a.createElement('li', null, C.a.createElement('a', {
- href: ''.concat(Mu, '/logout/?redirect=https%3A%2F%2Fdisqus.com%2F'),
- target: '_self'
- }, 'Log Out')))))
- }
- }
- ]) && ju(e.prototype, t),
- n && ju(e, n),
- r
- }();
- Fu = Bu,
- Lu = 'propTypes',
- Uu = {
- auth: b.a.shape({
- avatarUrl: b.a.string,
- username: b.a.string
- }).isRequired,
- className: b.a.string.isRequired,
- emitTrackingEvent: b.a.func.isRequired,
- selection: ht.isRequired
- },
- Lu in Fu ? Object.defineProperty(Fu, Lu, {
- value: Uu,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : Fu[Lu] = Uu;
- var zu = Object(u.connect) (function (e) {
- return {
- selection: e.selection
- }
- }, {
- emitTrackingEvent: Xo({
- zone: 'user_menu',
- section: 'nav_bar'
- })
- }) (Bu);
- function Hu(e) {
- return (Hu = 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator ? function (e) {
- return typeof e
- }
- : function (e) {
- return e && 'function' == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? 'symbol' : typeof e
- }) (e)
- }
- function Gu(e, t) {
- for (var n = 0; n < t.length; n++) {
- var a = t[n];
- a.enumerable = a.enumerable || !1,
- a.configurable = !0,
- 'value' in a && (a.writable = !0),
- Object.defineProperty(e, a.key, a)
- }
- }
- function Vu(e, t) {
- return (Vu = Object.setPrototypeOf || function (e, t) {
- return e.__proto__ = t,
- e
- }) (e, t)
- }
- function Wu(n) {
- var a = function () {
- if ('undefined' == typeof Reflect || !Reflect.construct) return !1;
- if (Reflect.construct.sham) return !1;
- if ('function' == typeof Proxy) return !0;
- try {
- return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [
- ], function () {
- })),
- !0
- } catch (e) {
- return !1
- }
- }();
- return function () {
- var e,
- t = Qu(n);
- return e = a ? (e = Qu(this).constructor, Reflect.construct(t, arguments, e)) : t.apply(this, arguments),
- t = this,
- !(e = e) || 'object' !== Hu(e) && 'function' != typeof e ? Yu(t) : e
- }
- }
- function Yu(e) {
- if (void 0 === e) throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called');
- return e
- }
- function Qu(e) {
- return (Qu = Object.setPrototypeOf ? Object.getPrototypeOf : function (e) {
- return e.__proto__ || Object.getPrototypeOf(e)
- }) (e)
- }
- function Ku(e, t, n) {
- return t in e ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n,
- e
- }
- var Ju = function () {
- !function (e, t) {
- if ('function' != typeof t && null !== t) throw new TypeError('Super expression must either be null or a function');
- e.prototype = Object.create(t && t.prototype, {
- constructor: {
- value: e,
- writable: !0,
- configurable: !0
- }
- }),
- t && Vu(e, t)
- }(o, A);
- var e,
- t,
- n,
- r = Wu(o);
- function o() {
- var t;
- !function (e, t) {
- if (!(e instanceof t)) throw new TypeError('Cannot call a class as a function')
- }(this, o);
- for (var e = arguments.length, n = Array(e), a = 0; a < e; a++) n[a] = arguments[a];
- return Ku(Yu(t = r.call.apply(r, [
- this
- ].concat(n))), 'state', {
- count: null
- }),
- Ku(Yu(t), 'fetchData', function () {
- io.a.call('timelines/getUnreadCount', {
- type: 'GET',
- data: {
- type: 'notifications',
- routingVersion: pt.a.feedApiVersion
- }
- }).done(t.onFetch)
- }),
- Ku(Yu(t), 'onFetch', function (e) {
- t.state.sidebarHasOpened || t.setState({
- count: 9 <= (e = e.response) ? '9+' : e
- })
- }),
- Ku(Yu(t), 'handleClick', function (e) {
- e.preventDefault(),
- jl.a.openWindow('https://disqus.com/home/notifications'),
- t.setState({
- count: 0
- }),
- t.props.emitTrackingEvent({
- verb: 'open',
- object_type: 'product',
- object_id: 'home',
- page_referrer: window.document.location.origin
- })
- }),
- t
- }
- return e = o,
- (t = [
- {
- key: 'componentDidMount',
- value: function () {
- this.fetchData()
- }
- },
- {
- key: 'render',
- value: function () {
- return C.a.createElement('div', {
- className: this.props.className
- }, this.state.sidebarLoading ? C.a.createElement(Qi, null) : C.a.createElement('a', {
- className: this.state.count ? 'site-nav__link has-notifs' : 'site-nav__link',
- href: 'https://disqus.com/home/notifications/',
- onClick: this.handleClick
- }, this.state.count ? C.a.createElement('div', {
- className: 'notif-count'
- }, this.state.count) : null, C.a.createElement('svg', {
- className: 'icon-notif site-nav-item__icon',
- viewBox: '0 0 21 21',
- width: '24',
- height: '24'
- }, C.a.createElement('path', {
- d: 'M10.4 20c5.3 0 9.6-4.5 9.6-10S15.7 0 10.4 0C5 0 0.7 4.5 0.7 10 c0 1.5 0.3 2.9 0.9 4.1L0 18.2l4.1-0.6C5.8 19.1 8 20 10.4 20z',
- className: 'fill'
- }), C.a.createElement('path', {
- d: 'M11 11.2v2.6l4-3.9L11 6v2.3C6.1 8.3 5 14 5 14 C6.4 11.4 8.3 11.2 11 11.2z',
- className: 'arrow'
- }), C.a.createElement('desc', null, 'Notifications'))))
- }
- }
- ]) && Gu(e.prototype, t),
- n && Gu(e, n),
- o
- }();
- Ku(Ju, 'displayName', 'TopNavRightNotifications'),
- Ku(Ju, 'propTypes', {
- className: b.a.string.isRequired
- });
- var $u = Object(u.connect) (null, {
- emitTrackingEvent: Xo({
- zone: 'notifications',
- section: 'all'
- })
- }) (Ju),
- Zu = function (e) {
- return e.auth.isAuthenticated ? C.a.createElement('div', {
- className: 'site-nav__settings'
- }, C.a.createElement($u, {
- className: 'tooltipped site-nav__menu-item spacing-right'
- }), C.a.createElement(zu, {
- className: 'tooltipped bottom-right site-nav__menu-item dropdown--settings',
- auth: e.auth
- })) : C.a.createElement('div', {
- className: 'site-nav__secondary'
- }, C.a.createElement('div', {
- className: 'site-nav__menu-item'
- }, C.a.createElement('a', {
- className: 'site-nav__link nav-link-underline',
- href: ''.concat(dt, '/publishers/login/')
- }, C.a.createElement('div', {
- className: 'site-nav__block'
- }, C.a.createElement('div', {
- className: 'site-nav-item__name'
- }, 'Log In')))), C.a.createElement('div', {
- className: 'site-nav__menu-item'
- }, C.a.createElement('a', {
- className: 'site-nav__link nav-link-underline',
- href: ''.concat(dt, '/publishers/signup/')
- }, C.a.createElement('div', {
- className: 'site-nav__block'
- }, C.a.createElement('div', {
- className: 'site-nav-item__name'
- }, 'Get Started')))))
- };
- Zu.propTypes = {
- auth: b.a.shape({
- avatarUrl: b.a.string,
- username: b.a.string,
- id: b.a.oneOfType([b.a.string,
- b.a.number]).isRequired,
- isAuthenticated: b.a.bool.isRequired
- }).isRequired
- };
- var Xu = Zu;
- function ep(e) {
- return (ep = 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator ? function (e) {
- return typeof e
- }
- : function (e) {
- return e && 'function' == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? 'symbol' : typeof e
- }) (e)
- }
- function tp(e, t) {
- for (var n = 0; n < t.length; n++) {
- var a = t[n];
- a.enumerable = a.enumerable || !1,
- a.configurable = !0,
- 'value' in a && (a.writable = !0),
- Object.defineProperty(e, a.key, a)
- }
- }
- function np(e, t) {
- return (np = Object.setPrototypeOf || function (e, t) {
- return e.__proto__ = t,
- e
- }) (e, t)
- }
- function ap(n) {
- var a = function () {
- if ('undefined' == typeof Reflect || !Reflect.construct) return !1;
- if (Reflect.construct.sham) return !1;
- if ('function' == typeof Proxy) return !0;
- try {
- return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [
- ], function () {
- })),
- !0
- } catch (e) {
- return !1
- }
- }();
- return function () {
- var e,
- t = rp(n);
- return e = a ? (e = rp(this).constructor, Reflect.construct(t, arguments, e)) : t.apply(this, arguments),
- t = this,
- !(e = e) || 'object' !== ep(e) && 'function' != typeof e ? function (e) {
- if (void 0 !== e) return e;
- throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called')
- }(t) : e
- }
- }
- function rp(e) {
- return (rp = Object.setPrototypeOf ? Object.getPrototypeOf : function (e) {
- return e.__proto__ || Object.getPrototypeOf(e)
- }) (e)
- }
- var op,
- ip,
- sp,
- lp = {
- 1: 'plus.svg',
- 2: 'business.svg',
- 3: 'pro.svg'
- },
- cp = function () {
- !function (e, t) {
- if ('function' != typeof t && null !== t) throw new TypeError('Super expression must either be null or a function');
- e.prototype = Object.create(t && t.prototype, {
- constructor: {
- value: e,
- writable: !0,
- configurable: !0
- }
- }),
- t && np(e, t)
- }(r, A);
- var e,
- t,
- n,
- a = ap(r);
- function r() {
- return function (e, t) {
- if (!(e instanceof t)) throw new TypeError('Cannot call a class as a function')
- }(this, r),
- a.apply(this, arguments)
- }
- return e = r,
- (t = [
- {
- key: 'componentDidMount',
- value: function () {
- this.props.fetchSubscription()
- }
- },
- {
- key: 'render',
- value: function () {
- var e = this,
- t = this.props,
- n = t.orgAvailableTrials,
- a = t.orgCurrentPackage,
- r = t.orgCurrentPlan;
- if (!a || !ql(t.selection) || null === n) return null;
- t = lp[a.id] ? a.color : 'rgb(170, 175, 185)',
- n = lp[a.id] ? '//c.disquscdn.com/next/current/publisher-admin/assets/img/badges/'.concat(lp[a.id]) : null;
- return C.a.createElement(v.Link, {
- className: 'site-nav__badge',
- onClick: function () {
- e.props.emitTrackingEvent({
- verb: 'click',
- object_type: 'button',
- object_id: r && r.id
- })
- },
- style: {
- backgroundColor: t
- },
- to: '/settings/subscription'
- }, C.a.createElement('img', {
- className: 'site-nav__badge__star',
- src: '//c.disquscdn.com/next/current/publisher-admin/assets/img/badges/star.svg'
- }), n ? C.a.createElement('img', {
- className: 'site-nav__badge__name',
- src: n,
- alt: a.name
- }) : null)
- }
- }
- ]) && tp(e.prototype, t),
- n && tp(e, n),
- r
- }();
- op = cp,
- ip = 'propTypes',
- sp = {
- selection: ht.isRequired,
- emitTrackingEvent: b.a.func.isRequired,
- fetchSubscription: b.a.func.isRequired,
- orgAvailableTrials: b.a.arrayOf(b.a.string),
- orgCurrentPackage: Ur.PACKAGE_SHAPE,
- orgCurrentPlan: Ur.PLAN_SHAPE
- },
- ip in op ? Object.defineProperty(op, ip, {
- value: sp,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : op[ip] = sp;
- var up = Object(u.connect) (function (e) {
- var t = e.subscription;
- return {
- orgAvailableTrials: t.orgAvailableTrials,
- orgCurrentPackage: t.orgCurrentPackage,
- orgCurrentPlan: t.orgCurrentPlan,
- selection: e.selection
- }
- }, {
- fetchSubscription: Hl,
- emitTrackingEvent: Xo({
- zone: 'nav_bar',
- section: 'badge'
- })
- }) (Ni.a.attachDrivers(cp, [
- bc
- ]));
- function pp(e) {
- return function (e) {
- if (Array.isArray(e)) return dp(e)
- }(e) || function (e) {
- if ('undefined' != typeof Symbol && null != e[Symbol.iterator] || null != e['@@iterator']) return Array.from(e)
- }(e) || function (e, t) {
- if (e) {
- if ('string' == typeof e) return dp(e, t);
- var n = Object.prototype.toString.call(e).slice(8, - 1);
- return 'Map' === (n = 'Object' === n && e.constructor ? e.constructor.name : n) || 'Set' === n ? Array.from(e) : 'Arguments' === n || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n) ? dp(e, t) : void 0
- }
- }(e) || function () {
- throw new TypeError('Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.')
- }()
- }
- function dp(e, t) {
- for (var n = 0, a = Array(t = null == t || e.length < t ? e.length : t); n < t; n++) a[n] = e[n];
- return a
- }
- var mp = [
- '/analytics/comments/',
- '/analytics/content/',
- '/analytics/top_comments/',
- '/analytics/reactions/',
- '/analytics/pulse/',
- '/analytics/audience/'
- ],
- fp = [
- '/moderate/',
- '/moderate/pending',
- '/access/banned/',
- '/access/trusted/'
- ].concat(pp(yo.a.isFeatureActive('polls_pub_admin') ? [
- ] : [
- '/settings/moderators/'
- ]), [
- '/settings/access/',
- '/discussions/',
- '/discussions/migrate/',
- '/tools/migrate-map/',
- '/discussions/history/',
- /^\/discussions\/import\//,
- '/discussions/export/',
- /^\/discussions\/history\//
- ], pp(yo.a.isFeatureActive('polls_pub_admin') ? mp : [
- ])),
- hp = [
- '/analytics/ads/',
- '/analytics/revenue/',
- '/analytics/payments/',
- '/settings/revenue/hub/'
- ],
- gp = [
- Wc.LIST,
- Wc.EDITOR,
- Wc.EDITOR_NEW,
- Wc.INSIGHTS
- ],
- yp = [
- '/settings/general/',
- '/settings/sites/',
- '/settings/admins/',
- '/settings/community/',
- '/settings/moderation/'
- ].concat(pp(yo.a.isFeatureActive('polls_pub_admin') ? [
- '/settings/moderators/'
- ] : [
- ]), [
- '/settings/advanced/',
- '/settings/revenue/',
- '/settings/subscription/',
- '/settings/webhooks/',
- '/settings/install/',
- '/settings/universalcode/',
- '/settings/wordpress/',
- '/settings/blogger/',
- '/settings/tumblr/',
- '/settings/squarespace/',
- '/settings/typepad/',
- '/settings/movabletype/',
- '/settings/drupal/',
- '/settings/joomla/',
- '/settings/weebly/',
- '/settings/strikingly/',
- '/settings/jekyll/',
- '/settings/ghost/',
- '/settings/hubspot/',
- '/settings/shopify/',
- '/settings/amp/',
- '/settings/adobemuse/',
- '/settings/jimdo/',
- '/settings/postachio/',
- '/settings/gatsby/',
- '/settings/pattern/',
- '/settings/polls/general/',
- '/settings/polls/pollsters/'
- ]),
- bp = function (e) {
- var t = e.auth.staff,
- n = e.auth.isAuthenticated && !e.isSetup,
- a = 'site-nav__link nav-link-underline';
- return /^\/admin\/install\/([\w]+\/)*/.test(e.currentPath) && (a += ' active'),
- C.a.createElement('div', {
- className: 'site-nav site-nav--dark site-nav--publishers'
- }, C.a.createElement('nav', {
- className: 'site-nav__container section-contained'
- }, C.a.createElement('div', {
- className: 'site-nav__main'
- }, C.a.createElement('div', {
- className: 'site-nav__logo'
- }, C.a.createElement('a', {
- href: 'https://disqus.com/'
- }, C.a.createElement('img', {
- className: 'disqus-logo',
- src: '//c.disquscdn.com/next/current/publisher-admin/assets/img/disqus-logo-light.svg',
- alt: 'Disqus'
- })), C.a.createElement(up, null)), n ? C.a.createElement(_u, {
- adminPath: ho.getAdminPath(e.currentPath),
- className: 'site-nav__menu-item dropdown--site-picker'
- }) : null, n ? C.a.createElement('div', {
- className: 'site-nav__secondary nav-fixed-mobile'
- }, C.a.createElement('div', {
- className: 'site-nav__menu-item'
- }, C.a.createElement(v.IndexLink, {
- to: ho.getRoute('/'),
- className: a,
- activeClassName: 'active'
- }, C.a.createElement('div', {
- className: 'site-nav__block'
- }, yo.a.isFeatureActive('polls_pub_admin') ? 'Overview' : 'Start'))), !yo.a.isFeatureActive('polls_pub_admin') && C.a.createElement('div', {
- className: 'site-nav__menu-item'
- }, C.a.createElement(ri, {
- path: '/analytics/comments',
- linkClassName: 'site-nav__link nav-link-underline',
- linkActiveClassName: 'active',
- selection: e.selection,
- activeRoutes: mp
- }, C.a.createElement('div', {
- className: 'site-nav__block'
- }, 'Analytics'))), (t || e.selection.isCommentsVisible) && C.a.createElement('div', {
- className: 'site-nav__menu-item'
- }, C.a.createElement(ri, {
- path: '/moderate/',
- linkClassName: 'site-nav__link nav-link-underline',
- linkActiveClassName: 'active',
- selection: e.selection,
- activeRoutes: fp
- }, C.a.createElement('div', {
- className: 'site-nav__block'
- }, yo.a.isFeatureActive('polls_pub_admin') ? 'Comments' : 'Moderation'))), yo.a.isFeatureActive('polls_pub_admin') && (t || e.selection.isPollsVisible) && C.a.createElement('div', {
- className: 'site-nav__menu-item'
- }, C.a.createElement(Uo, {
- linkClassName: 'site-nav__link nav-link-underline',
- linkActiveClassName: 'active',
- path: '/polls/',
- selection: e.selection,
- activeRoutes: gp,
- forceActive: Gc.test(window.location.pathname) || Vc.test(window.location.pathname)
- }, C.a.createElement('div', {
- className: 'site-nav__block'
- }, 'Polls', C.a.createElement('span', {
- className: 'label --new label-warning spacing-left-small'
- }, 'NEW')))), e.selection.isRevealVisible ? C.a.createElement('div', {
- className: 'site-nav__menu-item'
- }, C.a.createElement(ri, {
- path: '/analytics/revenue/',
- linkClassName: 'site-nav__link nav-link-underline',
- linkActiveClassName: 'active',
- selection: e.selection,
- activeRoutes: hp
- }, C.a.createElement('div', {
- className: 'site-nav__block'
- }, 'Ads'))) : null, t || e.selection.isSettingsVisible ? C.a.createElement('div', {
- className: 'site-nav__menu-item'
- }, C.a.createElement(ri, {
- linkClassName: 'site-nav__link nav-link-underline',
- linkActiveClassName: 'active',
- path: e.selection.organization && e.selection.organization.pollsOnly ? '/settings/polls/general' : '/settings/general/',
- selection: e.selection,
- activeRoutes: yp
- }, C.a.createElement('div', {
- className: 'site-nav__block'
- }, 'Settings'))) : null, C.a.createElement('div', {
- className: 'site-nav__menu-item'
- }, C.a.createElement('a', {
- className: 'site-nav__link nav-link-underline',
- href: Pn.contactSupport,
- target: '_blank',
- rel: 'noopener noreferrer'
- }, C.a.createElement('div', {
- className: 'site-nav__block'
- }, 'Help'))), C.a.createElement('div', {
- className: 'site-nav__menu-item'
- }, C.a.createElement('a', {
- className: 'site-nav__link nav-link-underline',
- href: 'https://about.disqus.com/disqus-101',
- target: '_blank',
- rel: 'noopener noreferrer'
- }, C.a.createElement('div', {
- className: 'site-nav__block'
- }, 'Disqus 101')))) : null), C.a.createElement(Xu, {
- auth: e.auth,
- currentPath: e.currentPath
- }), C.a.createElement(Au, null)))
- };
- bp.displayName = 'TopNav',
- bp.propTypes = {
- auth: Nc.isRequired,
- currentPath: b.a.string.isRequired,
- isSetup: b.a.bool.isRequired,
- selection: ht.isRequired
- };
- var vp = Object(u.connect) (function (e) {
- return {
- selection: e.selection
- }
- }) (bp);
- function _p(e) {
- return (_p = 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator ? function (e) {
- return typeof e
- }
- : function (e) {
- return e && 'function' == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? 'symbol' : typeof e
- }) (e)
- }
- function Ep() {
- return (Ep = Object.assign || function (e) {
- for (var t = 1; t < arguments.length; t++) {
- var n,
- a = arguments[t];
- for (n in a) Object.prototype.hasOwnProperty.call(a, n) && (e[n] = a[n])
- }
- return e
- }).apply(this, arguments)
- }
- function Op(e, t) {
- for (var n = 0; n < t.length; n++) {
- var a = t[n];
- a.enumerable = a.enumerable || !1,
- a.configurable = !0,
- 'value' in a && (a.writable = !0),
- Object.defineProperty(e, a.key, a)
- }
- }
- function Sp(e, t) {
- return (Sp = Object.setPrototypeOf || function (e, t) {
- return e.__proto__ = t,
- e
- }) (e, t)
- }
- function wp(n) {
- var a = function () {
- if ('undefined' == typeof Reflect || !Reflect.construct) return !1;
- if (Reflect.construct.sham) return !1;
- if ('function' == typeof Proxy) return !0;
- try {
- return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [
- ], function () {
- })),
- !0
- } catch (e) {
- return !1
- }
- }();
- return function () {
- var e,
- t = kp(n);
- return e = a ? (e = kp(this).constructor, Reflect.construct(t, arguments, e)) : t.apply(this, arguments),
- t = this,
- !(e = e) || 'object' !== _p(e) && 'function' != typeof e ? Pp(t) : e
- }
- }
- function Pp(e) {
- if (void 0 === e) throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called');
- return e
- }
- function kp(e) {
- return (kp = Object.setPrototypeOf ? Object.getPrototypeOf : function (e) {
- return e.__proto__ || Object.getPrototypeOf(e)
- }) (e)
- }
- function Np(e, t, n) {
- return t in e ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n,
- e
- }
- var Cp = [
- '/moderate/'
- ],
- Rp = [
- '/setup/',
- '/create/'
- ],
- xp = [
- '/create/',
- '/checkout/',
- '/acknowledge/'
- ],
- Ap = function () {
- !function (e, t) {
- if ('function' != typeof t && null !== t) throw new TypeError('Super expression must either be null or a function');
- e.prototype = Object.create(t && t.prototype, {
- constructor: {
- value: e,
- writable: !0,
- configurable: !0
- }
- }),
- t && Sp(e, t)
- }(o, A);
- var e,
- t,
- n,
- r = wp(o);
- function o() {
- var n;
- !function (e, t) {
- if (!(e instanceof t)) throw new TypeError('Cannot call a class as a function')
- }(this, o);
- for (var e = arguments.length, t = Array(e), a = 0; a < e; a++) t[a] = arguments[a];
- return Np(Pp(n = r.call.apply(r, [
- this
- ].concat(t))), 'getChildContext', function () {
- return {
- auth: n.state.auth
- }
- }),
- Np(Pp(n), 'state', {
- auth: Ve.a.getFromCookie(),
- forums: window._v5Config.forums,
- isReadOnly: window._v5Config.isReadonly,
- isSetup: !1,
- organizations: window._v5Config.organizations,
- isWideLayout: !1,
- isCreate: !1
- }),
- Np(Pp(n), 'updateLayoutState', function (e) {
- var t = ho.getAdminPath((e = e || n.props.location).basename + e.pathname),
- e = !!~xp.indexOf(t);
- n.setState({
- isWideLayout: !!~Cp.indexOf(t),
- isSetup: !!~Rp.indexOf(t),
- isCreate: e
- }),
- vo() ('body').toggleClass('bg-create', e)
- }),
- n
- }
- return e = o,
- (t = [
- {
- key: 'componentWillReceiveProps',
- value: function (e) {
- this.updateLayoutState(e.location)
- }
- },
- {
- key: 'componentDidMount',
- value: function () {
- vo() ('.content').remove(),
- vo() ('body').attr('class', '').fadeIn(200),
- this.updateLayoutState()
- }
- },
- {
- key: 'render',
- value: function () {
- return this.state.isCreate ? C.a.createElement('div', null, C.a.cloneElement(this.props.children, this.state), C.a.createElement(o.FooterAlternate, {
- isReadOnly: this.state.isReadOnly
- })) : C.a.createElement('div', {
- className: this.state.isWideLayout ? 'layout--wide' : ''
- }, C.a.createElement(vp, Ep({
- }, this.state, {
- currentPath: this.props.location.basename + this.props.location.pathname
- })), C.a.createElement(kc, {
- location: this.props.location
- }), this.state.isSetup ? null : C.a.createElement(Al.a, {
- zone: 'admin'
- }), C.a.cloneElement(this.props.children, this.state), C.a.createElement(o.Footer, {
- isReadOnly: this.state.isReadOnly
- }))
- }
- }
- ]) && Op(e.prototype, t),
- n && Op(e, n),
- o
- }();
- Np(Ap, 'childContextTypes', {
- auth: b.a.object.isRequired
- }),
- Np(Ap, 'propTypes', {
- children: b.a.node.isRequired,
- location: b.a.object.isRequired
- }),
- Ap.Footer = function (e) {
- return C.a.createElement('div', null, C.a.createElement('div', {
- className: 'section-contained'
- }, C.a.createElement('footer', {
- className: 'global-footer'
- }, C.a.createElement('nav', {
- className: 'footer-nav'
- }, C.a.createElement('ul', null, C.a.createElement('li', {
- 'data-analytics': 'footer for websties'
- }, C.a.createElement('a', {
- href: 'http://disqus.com/features/',
- className: 'link-gray'
- }, 'Features')), C.a.createElement('li', {
- 'data-analytics': 'footer about'
- }, C.a.createElement('a', {
- href: 'http://disqus.com/company/',
- className: 'link-gray'
- }, 'Company')), C.a.createElement('li', {
- 'data-analytics': 'footer brand'
- }, C.a.createElement('a', {
- href: 'http://disqus.com/brand/',
- className: 'link-gray'
- }, 'Logos')), C.a.createElement('li', {
- 'data-analytics': 'footer docs'
- }, C.a.createElement('a', {
- href: Pn.contactSupport,
- className: 'link-gray'
- }, 'Help')), C.a.createElement('li', {
- 'data-analytics': 'footer blog'
- }, C.a.createElement('a', {
- href: 'http://blog.disqus.com',
- className: 'link-gray'
- }, 'Blog')), C.a.createElement('li', {
- 'data-analytics': 'footer api'
- }, C.a.createElement('a', {
- href: 'https://disqus.com/api/docs/',
- className: 'link-gray'
- }, 'API')), C.a.createElement('li', {
- 'data-analytics': 'footer terms'
- }, C.a.createElement('a', {
- href: 'https://docs.disqus.com/kb/terms-and-policies/',
- className: 'link-gray'
- }, 'Terms & Policies'))), C.a.createElement('span', {
- className: 'copyright'
- }, '© ', (new Date).getFullYear(), ' · ', C.a.createElement('a', {
- href: '/',
- className: 'disqus link-gray'
- }, 'Disqus'))))), e.isReadOnly ? C.a.createElement(Rl, null) : null)
- },
- Ap.Footer.displayName = 'ApplicationFooter',
- Ap.Footer.propTypes = {
- isReadOnly: b.a.bool
- },
- Ap.FooterAlternate = function (e) {
- return C.a.createElement('div', null, C.a.createElement('div', {
- className: 'section-contained'
- }, C.a.createElement('footer', {
- className: 'global-footer'
- }, C.a.createElement('nav', {
- className: 'text-center footer-nav-alt'
- }, C.a.createElement('div', {
- className: 'footer-group'
- }, C.a.createElement('span', {
- className: 'footer-item'
- }, '© ', (new Date).getFullYear(), ' Disqus'), C.a.createElement('a', {
- className: 'footer-item footer-link',
- href: 'https://about.disqus.com/contact',
- target: '_blank',
- rel: 'noopener noreferrer'
- }, 'Contact Us')), C.a.createElement('div', {
- className: 'footer-group'
- }, C.a.createElement('a', {
- className: 'footer-item footer-link',
- href: _l.a.terms,
- target: '_blank',
- rel: 'noopener noreferrer'
- }, 'Terms & Conditions'), C.a.createElement('a', {
- className: 'footer-item footer-link',
- href: _l.a.privacy,
- target: '_blank',
- rel: 'noopener noreferrer'
- }, 'Privacy Policy'))))), e.isReadOnly ? C.a.createElement(Rl, null) : null)
- },
- Ap.FooterAlternate.displayName = 'ApplicationFooterAlternate',
- Ap.FooterAlternate.propTypes = {
- isReadOnly: b.a.bool
- };
- var t = Ap,
- Dp = {
- roundMoney: function (e) {
- return Math.round(100 * (e + 1e-7)) / 100
- },
- addThousandsSeparator: function (e) {
- e = ('' + e).split('.');
- return e[0] = e[0].replace(/\B(?=(\d{3})+(?!\d))/g, ','),
- e.join('.')
- }
- };
- function jp(e) {
- return (jp = 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator ? function (e) {
- return typeof e
- }
- : function (e) {
- return e && 'function' == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? 'symbol' : typeof e
- }) (e)
- }
- function Tp(e) {
- var t,
- n,
- n = (n = jp(t = e), Array.isArray(t) ? 'array' : t instanceof RegExp ? 'object' : n);
- if ('object' === n) {
- if (e instanceof Date) return 'date';
- if (e instanceof RegExp) return 'regexp'
- }
- return n
- }
- function Ip(e, t, n, a) {
- t = t[n];
- return null == t ? e ? Error('Required prop `'.concat(n, '` was not specified in `').concat(a, '`.')) : null : ct.a.isMoment(t) ? null : Error('Invalid prop `'.concat(n, '` of type `').concat(Tp(t), '` ') + 'was supplied to `'.concat(a, '`, expected moment instance.'))
- }
- i = {
- };
- i.moment = Ip.bind(null, !1),
- i.moment.isRequired = Ip.bind(null, !0);
- var s = i,
- c = n(65),
- qp = n.n(c),
- Fp = qp.a.Model.extend({
- idAttribute: 'date_utc',
- defaults: {
- shortname: '',
- viewability_percent: 0,
- earnings: 0,
- rpmv: 0,
- viewable_impressions: 0,
- date_utc: null
- },
- parse: function (e) {
- return e.date_utc = ct() (e.date_utc.replace('UTC', '.000Z')).utc(),
- e.viewability_percent *= 100,
- e
- }
- }),
- Lp = ct.a.utc().startOf('day').subtract(1, 'year').add(1, 'day'),
- Up = ct.a.utc().startOf('day'),
- Mp = qp.a.Model.extend({
- initialize: function () {
- this.byDay = new qp.a.Collection([], {
- comparator: 'date_utc',
- model: Fp
- }),
- this.byMonth = new qp.a.Collection([], {
- model: Fp
- })
- },
- sync: function (e, t, n) {
- if ('read' !== e) throw Error('Invalid method');
- var a = ct.a.utc(n.start).startOf('month'),
- r = ct.a.utc(n.end).endOf('month').startOf('day'),
- e = je.a.extend({
- start: ct.a.max(Lp, a).toISOString(),
- end: ct.a.min(Up, r).toISOString()
- }, n.data),
- a = br.orgId,
- r = br.shortname,
- r = a ? (e = je.a.extend({
- organization: a
- }, e), 'discovery/reports/organizationRevealStats.json') : (e = je.a.extend({
- forum: r
- }, e), 'discovery/reports/revealStats.json');
- return io.a.call(r, je.a.defaults({
- data: e,
- error: je.a.bind(function (e, t) {
- this.trigger('error', e, t)
- }, this)
- }, n))
- },
- parse: function (e) {
- this.byDay.reset(e.response.results, {
- parse: !0
- });
- var t,
- n,
- a,
- r,
- e = (t = this.byDay.toJSON(), n = function (e) {
- e = e.date_utc;
- return JSON.stringify([e.year(),
- e.month()])
- }, r = [
- ], je.a.each(t, function (e) {
- var t = n(e);
- r.length && t === a ? r[r.length - 1].push(e) : r.push([e]),
- a = t
- }), r),
- e = je.a.map(e, function (e) {
- e = je.a.chain(e).map(function (e) {
- return e.total_impressions = e.viewability_percent ? 100 * e.viewable_impressions / e.viewability_percent : 0,
- e
- }).reduce(function (n, e) {
- return je.a.each(e, function (e, t) {
- je.a.has(n, t) ? 'number' == typeof n[t] && (n[t] += e) : n[t] = e
- }),
- n
- }).value();
- return e.rpmv = e.viewable_impressions ? 1000 * e.earnings / e.viewable_impressions : 0,
- e.viewability_percent = e.total_impressions ? 100 * e.viewable_impressions / e.total_impressions : 0,
- delete e.total_impressions,
- e
- });
- this.byMonth.reset(e)
- }
- }),
- p = function (e) {
- return C.a.createElement('div', {
- className: e.className || ''
- }, C.a.createElement('h2', {
- className: 'card__title-mobile'
- }, e.leftTitle), C.a.createElement('div', {
- className: 'card__header'
- }, C.a.createElement('div', {
- className: 'card__header-content card__title -left'
- }, e.leftTitle), C.a.createElement('div', {
- className: 'card__header-content -right'
- }, e.rightTitle)), C.a.createElement('div', {
- className: 'card__body '.concat(e.bodyClassName || '-overflow-scroll')
- }, e.children))
- };
- p.displayName = 'Card',
- p.propTypes = {
- leftTitle: b.a.node,
- rightTitle: b.a.node,
- children: b.a.node,
- className: b.a.string,
- bodyClassName: b.a.string
- };
- var Bp = p,
- m = n(73),
- zp = n.n(m);
- n(147);
- function Hp(e) {
- return (Hp = 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator ? function (e) {
- return typeof e
- }
- : function (e) {
- return e && 'function' == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? 'symbol' : typeof e
- }) (e)
- }
- function Gp(e, t) {
- for (var n = 0; n < t.length; n++) {
- var a = t[n];
- a.enumerable = a.enumerable || !1,
- a.configurable = !0,
- 'value' in a && (a.writable = !0),
- Object.defineProperty(e, a.key, a)
- }
- }
- function Vp(e, t) {
- return (Vp = Object.setPrototypeOf || function (e, t) {
- return e.__proto__ = t,
- e
- }) (e, t)
- }
- function Wp(n) {
- var a = function () {
- if ('undefined' == typeof Reflect || !Reflect.construct) return !1;
- if (Reflect.construct.sham) return !1;
- if ('function' == typeof Proxy) return !0;
- try {
- return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [
- ], function () {
- })),
- !0
- } catch (e) {
- return !1
- }
- }();
- return function () {
- var e,
- t = Qp(n);
- return e = a ? (e = Qp(this).constructor, Reflect.construct(t, arguments, e)) : t.apply(this, arguments),
- t = this,
- !(e = e) || 'object' !== Hp(e) && 'function' != typeof e ? Yp(t) : e
- }
- }
- function Yp(e) {
- if (void 0 === e) throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called');
- return e
- }
- function Qp(e) {
- return (Qp = Object.setPrototypeOf ? Object.getPrototypeOf : function (e) {
- return e.__proto__ || Object.getPrototypeOf(e)
- }) (e)
- }
- function Kp(e, t, n) {
- return t in e ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n,
- e
- }
- function Jp(e) {
- var t = e.startDate,
- n = e.endDate,
- a = e.maxDate,
- e = ''.concat(t.format('MM/DD/YY'), ' - ').concat(n.format('MM/DD/YY'));
- return n.isSame(a) ? (a = n.diff(t, 'months'), t = n.diff(t, 'days'), t = 1 < a ? ''.concat(a, ' months') : ''.concat(t, ' day').concat(1 === t ? '' : 's'), C.a.createElement('span', null, C.a.createElement('span', {
- className: 'text-semibold'
- }, 'Past ', t), ' ', '(', e, ')')) : C.a.createElement('span', null, e)
- }
- var $p = {
- day: 'Daily',
- month: 'Monthly',
- thread: 'Thread'
- };
- Jp.propTypes = {
- startDate: s.moment.isRequired,
- endDate: s.moment.isRequired,
- maxDate: s.moment.isRequired
- };
- h = function () {
- !function (e, t) {
- if ('function' != typeof t && null !== t) throw new TypeError('Super expression must either be null or a function');
- e.prototype = Object.create(t && t.prototype, {
- constructor: {
- value: e,
- writable: !0,
- configurable: !0
- }
- }),
- t && Vp(e, t)
- }(o, A);
- var e,
- t,
- n,
- r = Wp(o);
- function o() {
- var a;
- !function (e, t) {
- if (!(e instanceof t)) throw new TypeError('Cannot call a class as a function')
- }(this, o);
- for (var e = arguments.length, t = Array(e), n = 0; n < e; n++) t[n] = arguments[n];
- return Kp(Yp(a = r.call.apply(r, [
- this
- ].concat(t))), 'state', {
- pickerOpen: !1,
- groupsOpen: !1
- }),
- Kp(Yp(a), 'datePickerInput', C.a.createRef()),
- Kp(Yp(a), 'datePickerContainer', C.a.createRef()),
- Kp(Yp(a), 'handleDateChange', function (e, t) {
- a.setState({
- pickerOpen: !1
- });
- var n = a.props.persistLocalTime ? ct() (t.date1) : a.localToUtc(ct() (t.date1)),
- t = a.props.persistLocalTime ? ct() (t.date2) : a.localToUtc(ct() (t.date2));
- (a.props.sortByThread || a.props.threadSpecificReactionsReport) && t.diff(n, 'days') <= 2 && (n = ct() (t).subtract(3, 'days')),
- a.props.startDate.isSame(n) && a.props.endDate.isSame(t) || a.props.onDateChange && a.props.onDateChange(n, t)
- }),
- Kp(Yp(a), 'handleGroupChange', function (e) {
- a.setState({
- groupsOpen: !1
- }),
- a.props.onGroupChange && a.props.onGroupChange(e)
- }),
- Kp(Yp(a), 'updatePickerDates', function () {
- var e = a.utcToLocal(a.props.startDate).toDate(),
- t = a.utcToLocal(a.props.endDate).toDate();
- a._picker.setDateRange(e, t, !0)
- }),
- Kp(Yp(a), 'showPicker', function (e) {
- e.preventDefault(),
- e.stopPropagation(),
- e.nativeEvent.stopImmediatePropagation(),
- a.setState(function (e) {
- return {
- pickerOpen: !e.pickerOpen
- }
- })
- }),
- Kp(Yp(a), 'toggleGroupsVisible', function () {
- a.setState(function (e) {
- return {
- groupsOpen: !e.groupsOpen
- }
- })
- }),
- Kp(Yp(a), 'hideGroups', function () {
- a.setState({
- groupsOpen: !1
- })
- }),
- Kp(Yp(a), 'hidePicker', function () {
- a.setState({
- pickerOpen: !1
- })
- }),
- Kp(Yp(a), 'rangeFnFromStartDate', function (e) {
- return je.a.constant([e.toDate(),
- a.today().toDate()])
- }),
- Kp(Yp(a), 'today', function () {
- return a.utcToLocal(a.props.maxDate || ct.a.utc()).startOf('day')
- }),
- Kp(Yp(a), 'localToUtc', function (e) {
- return ct.a.utc(e.toArray())
- }),
- Kp(Yp(a), 'utcToLocal', function (e) {
- return ct() (e.toArray())
- }),
- Kp(Yp(a), 'formatThreadTitle', function (e) {
- var t = a.props.threadSpecificReactionsReport[e].date,
- e = e.split('_').map(function (e) {
- if (e) return e[0].toUpperCase() + e.slice(1)
- }).join(' ');
- return ''.concat(t, ': ').concat(e)
- }),
- a
- }
- return e = o,
- (t = [
- {
- key: 'componentDidMount',
- value: function () {
- var t = Object.freeze({
- '7 days': this.rangeFnFromStartDate(this.today().subtract(6, 'days')),
- '30 days': this.rangeFnFromStartDate(this.today().subtract(29, 'days')),
- '90 days': this.rangeFnFromStartDate(this.today().subtract(89, 'days')),
- '1 year': this.rangeFnFromStartDate(this.today().subtract(1, 'year').add(1, 'day'))
- }),
- e = (this.props.shortcuts || Object.keys(t)).map(function (e) {
- return {
- name: e,
- dates: t[e]
- }
- });
- return this._picker = vo() (this.datePickerInput.current).dateRangePicker({
- inline: !0,
- container: vo() (this.datePickerContainer.current),
- showShortcuts: this.props.shortcuts,
- showTopbar: !1,
- autoClose: !this.props.alwaysOpen,
- alwaysOpen: this.props.alwaysOpen,
- format: 'MM/DD/YY',
- separator: ' - ',
- duration: 0,
- startDate: this.props.minDate && this.utcToLocal(this.props.minDate),
- endDate: this.props.maxDate && this.utcToLocal(this.props.maxDate),
- shortcuts: null,
- customShortcuts: e
- }).bind('datepicker-change', je.a.bind(this.handleDateChange, this)).data('dateRangePicker'),
- this.updatePickerDates(),
- this._picker
- }
- },
- {
- key: 'componentDidUpdate',
- value: function () {
- this.updatePickerDates(),
- this.state.pickerOpen && 'thread' !== this.props.group ? this._picker.open(0) : this._picker.close(0)
- }
- },
- {
- key: 'componentWillUnmount',
- value: function () {
- this._picker.destroy()
- }
- },
- {
- key: 'render',
- value: function () {
- var t,
- n = this,
- e = this.props.dateWrapperClass || 'date-input-group__wrapper--'.concat(this.props.group ? 'switch' : 'no-switch'),
- a = this.props.hideInput ? this.showPicker : null,
- r = this.props.threadSpecificReactionsList ? (t = [
- ], 0 === this.props.threadSpecificReactionsList.length ? t = [
- 'No threads in given time period'
- ] : this.props.threadSpecificReactionsList.forEach(function (e) {
- t.push(C.a.createElement('li', {
- className: 'reactions-group-li',
- onClick: n.handleGroupChange.bind(null, e),
- key: n.props.threadSpecificReactionsReport[e].threadId
- }, n.formatThreadTitle(e)))
- }), C.a.createElement('div', {
- className: 'reactions-group-dropdown__wrapper'
- }, C.a.createElement('div', {
- className: 'card__header-content-item group-dropdown__button -button -right -left',
- onClick: this.toggleGroupsVisible
- }, C.a.createElement('span', {
- className: 'icon-group spacing-right text-gray'
- }), this.state.groupsOpen ? 'Dates Published & Thread Titles:' : this.props.group && this.formatThreadTitle(this.props.group), C.a.createElement('span', {
- className: 'icon-arrow text-large date-input-group__icon'
- })), C.a.createElement(zp.a, {
- className: this.state.groupsOpen ? '' : 'hidden',
- active: this.state.groupsOpen,
- onOutsideClick: this.hideGroups
- }, C.a.createElement('div', {
- className: 'group__dropdown'
- }, C.a.createElement('ul', {
- className: 'reactions-group-ul'
- }, t))))) : this.props.group ? C.a.createElement('div', {
- className: 'group-dropdown__wrapper'
- }, C.a.createElement('div', {
- className: 'card__header-content-item group-dropdown__button -button -right -left',
- onClick: this.toggleGroupsVisible
- }, C.a.createElement('span', {
- className: 'icon-group spacing-right text-gray'
- }), this.state.groupsOpen ? 'Group by' : $p[this.props.group], C.a.createElement('span', {
- className: 'icon-arrow text-large date-input-group__icon'
- })), C.a.createElement(zp.a, {
- active: this.state.groupsOpen,
- onOutsideClick: this.hideGroups,
- className: this.state.groupsOpen ? '' : 'hidden'
- }, C.a.createElement('div', {
- className: 'group__dropdown'
- }, C.a.createElement('ul', null, C.a.createElement('li', {
- className: 'day' === this.props.group ? 'active' : '',
- onClick: this.handleGroupChange.bind(null, 'day')
- }, $p.day), this.props.sortByThread ? null : C.a.createElement('li', {
- className: 'month' === this.props.group ? 'active' : '',
- onClick: this.handleGroupChange.bind(null, 'month')
- }, $p.month), this.props.sortByThread ? C.a.createElement('li', {
- className: 'thread' === this.props.group ? 'active' : '',
- onClick: this.handleGroupChange.bind(null, 'thread')
- }, $p.thread) : null)))) : this.props.hideInput ? C.a.createElement('div', {
- className: 'date-input-group__label'
- }, C.a.createElement('span', {
- className: 'icon-calendar text-large spacing-right text-gray'
- }), C.a.createElement(Jp, {
- endDate: this.props.endDate,
- startDate: this.props.startDate,
- maxDate: this.props.maxDate
- })) : null;
- return C.a.createElement('div', {
- className: e,
- onClick: a
- }, C.a.createElement('div', {
- className: 'date-input-group align align--stretch text-small text-semibold'
- }, r, C.a.createElement('div', {
- className: 'card__header-content-item group-dropdown__button -button -nest daterange-picker',
- onClick: this.showPicker
- }, C.a.createElement('span', {
- className: 'icon-calendar text-large spacing-right text-gray',
- hidden: this.props.hideInput
- }), C.a.createElement('input', {
- className: 'date-input-group__input text-gray-dark text-semibold',
- hidden: this.props.hideInput,
- ref: this.datePickerInput
- }), C.a.createElement('span', {
- className: 'icon-arrow text-large spacing-left date-input-group__icon',
- hidden: this.props.hideInput
- }))), C.a.createElement(zp.a, {
- active: this.state.pickerOpen,
- onOutsideClick: this.hidePicker,
- className: this.state.pickerOpen ? '' : 'hidden'
- }, C.a.createElement('div', {
- className: 'date-input-group__dropdown',
- ref: this.datePickerContainer
- })))
- }
- }
- ]) && Gp(e.prototype, t),
- n && Gp(e, n),
- o
- }();
- Kp(h, 'propTypes', {
- maxDate: s.moment.isRequired,
- minDate: s.moment.isRequired,
- startDate: s.moment.isRequired,
- endDate: s.moment.isRequired,
- group: b.a.string,
- onDateChange: b.a.func,
- onGroupChange: b.a.func,
- alwaysOpen: b.a.bool,
- dateWrapperClass: b.a.string,
- hideInput: b.a.bool,
- shortcuts: b.a.arrayOf(b.a.string),
- sortByThread: b.a.bool,
- persistLocalTime: b.a.bool
- }),
- Kp(h, 'defaultProps', {
- alwaysOpen: !1,
- hideInput: !1
- });
- var Zp = h;
- function Xp(e) {
- return (Xp = 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator ? function (e) {
- return typeof e
- }
- : function (e) {
- return e && 'function' == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? 'symbol' : typeof e
- }) (e)
- }
- function ed(e, t) {
- for (var n = 0; n < t.length; n++) {
- var a = t[n];
- a.enumerable = a.enumerable || !1,
- a.configurable = !0,
- 'value' in a && (a.writable = !0),
- Object.defineProperty(e, a.key, a)
- }
- }
- function td(e, t) {
- return (td = Object.setPrototypeOf || function (e, t) {
- return e.__proto__ = t,
- e
- }) (e, t)
- }
- function nd(n) {
- var a = function () {
- if ('undefined' == typeof Reflect || !Reflect.construct) return !1;
- if (Reflect.construct.sham) return !1;
- if ('function' == typeof Proxy) return !0;
- try {
- return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [
- ], function () {
- })),
- !0
- } catch (e) {
- return !1
- }
- }();
- return function () {
- var e,
- t = ad(n);
- return e = a ? (e = ad(this).constructor, Reflect.construct(t, arguments, e)) : t.apply(this, arguments),
- t = this,
- !(e = e) || 'object' !== Xp(e) && 'function' != typeof e ? function (e) {
- if (void 0 !== e) return e;
- throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called')
- }(t) : e
- }
- }
- function ad(e) {
- return (ad = Object.setPrototypeOf ? Object.getPrototypeOf : function (e) {
- return e.__proto__ || Object.getPrototypeOf(e)
- }) (e)
- }
- function rd(e, t, n) {
- return t in e ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n,
- e
- }
- var od = 'Jason Voegle',
- id = 'jasonv@disqus.com',
- sd = '415-508-7521',
- ld = 'settings',
- cd = 'revenue',
- ud = 'payments',
- y = function () {
- !function (e, t) {
- if ('function' != typeof t && null !== t) throw new TypeError('Super expression must either be null or a function');
- e.prototype = Object.create(t && t.prototype, {
- constructor: {
- value: e,
- writable: !0,
- configurable: !0
- }
- }),
- t && td(e, t)
- }(r, A);
- var e,
- t,
- n,
- a = nd(r);
- function r() {
- return function (e, t) {
- if (!(e instanceof t)) throw new TypeError('Cannot call a class as a function')
- }(this, r),
- a.apply(this, arguments)
- }
- return e = r,
- (t = [
- {
- key: 'render',
- value: function () {
- var e;
- switch (this.props.secondaryMessageType) {
- case ld:
- e = 'The ability to make changes to your ad settings is restricted during this period. Please email your account manager if you have any questions.';
- break;
- case cd:
- e = 'During the first 30 days of your promotional period, Disqus will actively review the performance of your site and reserves the right to terminate or alter any guarantees.';
- break;
- case ud:
- e = 'Your payment during the promotional period will be at least the guaranteed amount.';
- break;
- default:
- e = null
- }
- var t = this.props.endDate.diff(this.props.startDate, 'days'),
- n = ct() ().utc().add(1, 'days').diff(this.props.startDate, 'days'),
- a = Dp.addThousandsSeparator(this.props.amount);
- return C.a.createElement('div', {
- className: 'alert alert--warning-light spacing-bottom'
- }, C.a.createElement('div', {
- className: 'spacing-narrow'
- }, C.a.createElement('h2', {
- className: 'spacing-bottom-narrow'
- }, C.a.createElement('span', {
- className: 'icon__position spacing-right-small'
- }, C.a.createElement('img', {
- src: '//c.disquscdn.com/next/current/publisher-admin/assets/img/icons/info.png',
- width: '20'
- })), 'You are currently on day ', n, ' of your ', t, ' day promotional period. Based on the terms of your ', t, '-day agreement, you are guaranteed to earn $', a, ' for this period.'), e ? C.a.createElement('p', {
- className: 'text-medium spacing-top'
- }, e) : null, C.a.createElement('p', {
- className: 'text-medium spacing-top'
- }, 'Have questions? Contact your account manager.'), C.a.createElement('p', {
- className: 'text-medium spacing-top'
- }, 'Your account manager:', C.a.createElement('br', null), C.a.createElement('strong', null, od), C.a.createElement('br', null), 'Email: ', C.a.createElement('a', {
- href: 'mailto:'.concat(id)
- }, id), C.a.createElement('br', null), 'Phone: ', sd)))
- }
- }
- ]) && ed(e.prototype, t),
- n && ed(e, n),
- r
- }();
- rd(y, 'displayName', 'GuaranteeAlert'),
- rd(y, 'propTypes', {
- secondaryMessageType: b.a.oneOf([ld,
- cd,
- ud]),
- startDate: s.moment.isRequired,
- endDate: s.moment.isRequired,
- amount: b.a.number.isRequired
- }),
- rd(y, 'defaultProps', {
- secondaryMessageType: 'settings'
- });
- var pd = y,
- D = function (e) {
- var t,
- e = e.isPermissionError ? (t = '//c.disquscdn.com/next/current/publisher-admin/assets/img/icons/closed_lock.svg', 'Looks like you don\'t have enough permissions to see this data.') : (t = '//c.disquscdn.com/next/current/publisher-admin/assets/img/icons/info.png', 'Something went wrong while fetching the data. You can refresh and try again.');
- return C.a.createElement('div', {
- className: 'alert alert--warning-light spacing-bottom'
- }, C.a.createElement('div', {
- className: 'spacing-narrow'
- }, C.a.createElement('h2', {
- className: 'spacing-bottom-narrow'
- }, C.a.createElement('span', {
- className: 'icon__position spacing-right-small'
- }, C.a.createElement('img', {
- src: t,
- width: '20',
- height: '16'
- })), 'Oops, loading failed =('), C.a.createElement('p', {
- className: 'text-medium'
- }, 'We were not able to load your analytics data. ', e)))
- };
- D.propTypes = {
- isPermissionError: b.a.bool.isRequired
- };
- var dd = D;
- function md(e) {
- return (md = 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator ? function (e) {
- return typeof e
- }
- : function (e) {
- return e && 'function' == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? 'symbol' : typeof e
- }) (e)
- }
- function fd(e, t) {
- for (var n = 0; n < t.length; n++) {
- var a = t[n];
- a.enumerable = a.enumerable || !1,
- a.configurable = !0,
- 'value' in a && (a.writable = !0),
- Object.defineProperty(e, a.key, a)
- }
- }
- function hd(e, t) {
- return (hd = Object.setPrototypeOf || function (e, t) {
- return e.__proto__ = t,
- e
- }) (e, t)
- }
- function gd(n) {
- var a = function () {
- if ('undefined' == typeof Reflect || !Reflect.construct) return !1;
- if (Reflect.construct.sham) return !1;
- if ('function' == typeof Proxy) return !0;
- try {
- return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [
- ], function () {
- })),
- !0
- } catch (e) {
- return !1
- }
- }();
- return function () {
- var e,
- t = bd(n);
- return e = a ? (e = bd(this).constructor, Reflect.construct(t, arguments, e)) : t.apply(this, arguments),
- t = this,
- !(e = e) || 'object' !== md(e) && 'function' != typeof e ? yd(t) : e
- }
- }
- function yd(e) {
- if (void 0 === e) throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called');
- return e
- }
- function bd(e) {
- return (bd = Object.setPrototypeOf ? Object.getPrototypeOf : function (e) {
- return e.__proto__ || Object.getPrototypeOf(e)
- }) (e)
- }
- function vd(e, t, n) {
- return t in e ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n,
- e
- }
- var _d = function () {
- !function (e, t) {
- if ('function' != typeof t && null !== t) throw new TypeError('Super expression must either be null or a function');
- e.prototype = Object.create(t && t.prototype, {
- constructor: {
- value: e,
- writable: !0,
- configurable: !0
- }
- }),
- t && hd(e, t)
- }(o, A);
- var e,
- t,
- n,
- r = gd(o);
- function o() {
- var t;
- !function (e, t) {
- if (!(e instanceof t)) throw new TypeError('Cannot call a class as a function')
- }(this, o);
- for (var e = arguments.length, n = Array(e), a = 0; a < e; a++) n[a] = arguments[a];
- return vd(yd(t = r.call.apply(r, [
- this
- ].concat(n))), 'handleShowYear', function (e) {
- e.preventDefault(),
- t.props.onDateChange(ct() (t.props.maxDate).subtract(1, 'year').add(1, 'day'), t.props.maxDate)
- }),
- t
- }
- return e = o,
- (t = [
- {
- key: 'render',
- value: function () {
- var e = br.shortname && window._v5Config.forums[br.shortname],
- e = e && e.adsSettingsUrl;
- return C.a.createElement('div', {
- className: 'alert alert--warning-light spacing-bottom'
- }, C.a.createElement('div', {
- className: 'spacing-narrow'
- }, C.a.createElement('h2', {
- className: 'spacing-bottom-narrow'
- }, C.a.createElement('span', {
- className: 'icon__position spacing-right-small'
- }, C.a.createElement('img', {
- src: '//c.disquscdn.com/next/current/publisher-admin/assets/img/icons/info.png',
- width: '20'
- })), 'No revenue for this date range'), C.a.createElement('p', {
- className: 'text-medium'
- }, 'We haven\'t seen any Reveal revenue activity for your site in this date range.'), C.a.createElement('ul', {
- className: 'text-medium'
- }, C.a.createElement('li', {
- className: 'spacing-narrow'
- }, 'If you\'ve just activated Reveal, it can take up to 24 hours before data is available in your dashboard.'), C.a.createElement('li', {
- className: 'spacing-narrow'
- }, 'Earnings also will not accumulate if ads are not enabled. ', C.a.createElement('strong', null, C.a.createElement('a', {
- href: e
- }, 'View your site settings')), ' and turn on Reveal to unlock your earning potential.'), C.a.createElement('li', {
- className: 'spacing-narrow'
- }, 'You can try selecting a longer date range. ', C.a.createElement('strong', null, C.a.createElement('a', {
- href: '#',
- onClick: this.handleShowYear
- }, 'View revenue for the past year')), '.'))))
- }
- }
- ]) && fd(e.prototype, t),
- n && fd(e, n),
- o
- }();
- vd(_d, 'displayName', 'NoEarningsAlert'),
- vd(_d, 'propTypes', {
- maxDate: b.a.instanceOf(ct.a.fn.constructor).isRequired,
- onDateChange: b.a.func.isRequired
- });
- var I = n(47),
- Ed = n.n(I),
- F = n(93),
- Od = n.n(F);
- function Sd(e) {
- return (Sd = 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator ? function (e) {
- return typeof e
- }
- : function (e) {
- return e && 'function' == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? 'symbol' : typeof e
- }) (e)
- }
- function wd(t, e) {
- var n,
- a = Object.keys(t);
- return Object.getOwnPropertySymbols && (n = Object.getOwnPropertySymbols(t), e && (n = n.filter(function (e) {
- return Object.getOwnPropertyDescriptor(t, e).enumerable
- })), a.push.apply(a, n)),
- a
- }
- function Pd(t) {
- for (var e = 1; e < arguments.length; e++) {
- var n = null != arguments[e] ? arguments[e] : {
- };
- e % 2 ? wd(Object(n), !0).forEach(function (e) {
- Ad(t, e, n[e])
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(n)) : wd(Object(n)).forEach(function (e) {
- Object.defineProperty(t, e, Object.getOwnPropertyDescriptor(n, e))
- })
- }
- return t
- }
- function kd(e, t) {
- for (var n = 0; n < t.length; n++) {
- var a = t[n];
- a.enumerable = a.enumerable || !1,
- a.configurable = !0,
- 'value' in a && (a.writable = !0),
- Object.defineProperty(e, a.key, a)
- }
- }
- function Nd(e, t) {
- return (Nd = Object.setPrototypeOf || function (e, t) {
- return e.__proto__ = t,
- e
- }) (e, t)
- }
- function Cd(n) {
- var a = function () {
- if ('undefined' == typeof Reflect || !Reflect.construct) return !1;
- if (Reflect.construct.sham) return !1;
- if ('function' == typeof Proxy) return !0;
- try {
- return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [
- ], function () {
- })),
- !0
- } catch (e) {
- return !1
- }
- }();
- return function () {
- var e,
- t = xd(n);
- return e = a ? (e = xd(this).constructor, Reflect.construct(t, arguments, e)) : t.apply(this, arguments),
- t = this,
- !(e = e) || 'object' !== Sd(e) && 'function' != typeof e ? Rd(t) : e
- }
- }
- function Rd(e) {
- if (void 0 === e) throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called');
- return e
- }
- function xd(e) {
- return (xd = Object.setPrototypeOf ? Object.getPrototypeOf : function (e) {
- return e.__proto__ || Object.getPrototypeOf(e)
- }) (e)
- }
- function Ad(e, t, n) {
- return t in e ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n,
- e
- }
- lt = function () {
- !function (e, t) {
- if ('function' != typeof t && null !== t) throw new TypeError('Super expression must either be null or a function');
- e.prototype = Object.create(t && t.prototype, {
- constructor: {
- value: e,
- writable: !0,
- configurable: !0
- }
- }),
- t && Nd(e, t)
- }(o, A);
- var e,
- t,
- n,
- r = Cd(o);
- function o() {
- var e;
- !function (e, t) {
- if (!(e instanceof t)) throw new TypeError('Cannot call a class as a function')
- }(this, o);
- for (var t = arguments.length, n = Array(t), a = 0; a < t; a++) n[a] = arguments[a];
- return Ad(Rd(e = r.call.apply(r, [
- this
- ].concat(n))), 'graph', C.a.createRef()),
- Ad(Rd(e), 'getGraphData', function () {
- return {
- x: 'date_utc',
- json: e.props.rows.map(function (e) {
- return Pd(Pd({
- }, e), {
- }, {
- date_utc: e.date_utc.toDate()
- })
- }),
- keys: {
- value: [
- 'date_utc',
- 'earnings',
- 'viewable_impressions',
- 'viewability_percent',
- 'rpmv'
- ]
- },
- names: {
- viewability_percent: 'Viewability Percent',
- rpmv: 'RPMv',
- viewable_impressions: 'Viewable Impressions',
- earnings: 'Ad Revenue'
- },
- axes: {
- viewable_impressions: 'y',
- viewability_percent: 'y',
- rpmv: 'y2',
- earnings: 'y'
- }
- }
- }),
- e
- }
- return e = o,
- (t = [
- {
- key: 'componentDidMount',
- value: function () {
- var e = this.getGraphData();
- e.hide = [
- 'viewability_percent',
- 'rpmv',
- 'viewable_impressions'
- ],
- this.chart = Ed.a.generate({
- oninit: function () {
- je.a.defer(function () {
- vo() ('.c3-axis-y2').hide()
- })
- },
- bindto: this.graph.current,
- data: e,
- color: {
- pattern: [
- '#752C85',
- '#8B020E',
- '#E56C00',
- '#FDBE13'
- ]
- },
- transition: {
- duration: 0
- },
- axis: {
- y: {
- tick: {
- format: function (e) {
- return e.toLocaleString()
- }
- }
- },
- y2: {
- show: !0,
- tick: {
- format: function (e) {
- return e.toLocaleString()
- }
- }
- },
- x: {
- type: 'timeseries',
- tick: {
- format: this.props.dateColumnConfig.formatter
- }
- }
- },
- size: {
- height: 200
- },
- point: {
- show: !1
- },
- legend: {
- item: {
- onclick: function (e) {
- var t = this.api;
- t.toggle(e);
- var n = this.api.data.shown(),
- e = je.a.chain(n).map(function (e) {
- return {
- id: e.id,
- max: je.a.max(t.data.values(e.id))
- }
- }).sortBy('max').reduce(function (e, t, n, a) {
- return e[t.id] = 0 === n && 1 < a.length ? 'y2' : 'y',
- e
- }, {
- }).value();
- t.data.axes(e),
- vo() ('.c3-axis-y2') [1 < n.length ? 'show' : 'hide']()
- }
- }
- },
- tooltip: {
- format: {
- value: function (e, t, n) {
- return 'earnings' === n ? Od.a.format('$.2f') (e) : 'viewable_impressions' === n ? Od.a.format('0,000') (e) : 'viewability_percent' === n ? ''.concat(Od.a.format('.2f') (e), '%') : 'rpmv' === n ? Od.a.format('$.2f') (e) : e
- }
- }
- }
- })
- }
- },
- {
- key: 'componentDidUpdate',
- value: function () {
- this.chart.load(this.getGraphData())
- }
- },
- {
- key: 'componentWillUnmount',
- value: function () {
- this.chart && (this.chart = this.chart.destroy())
- }
- },
- {
- key: 'render',
- value: function () {
- return C.a.createElement('div', {
- ref: this.graph
- })
- }
- }
- ]) && kd(e.prototype, t),
- n && kd(e, n),
- o
- }();
- Ad(lt, 'propTypes', {
- dateColumnConfig: b.a.object.isRequired,
- rows: b.a.array
- });
- var Dd = lt;
- function jd(e) {
- return (jd = 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator ? function (e) {
- return typeof e
- }
- : function (e) {
- return e && 'function' == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? 'symbol' : typeof e
- }) (e)
- }
- function Td(e, t) {
- for (var n = 0; n < t.length; n++) {
- var a = t[n];
- a.enumerable = a.enumerable || !1,
- a.configurable = !0,
- 'value' in a && (a.writable = !0),
- Object.defineProperty(e, a.key, a)
- }
- }
- function Id(e, t) {
- return (Id = Object.setPrototypeOf || function (e, t) {
- return e.__proto__ = t,
- e
- }) (e, t)
- }
- function qd(n) {
- var a = function () {
- if ('undefined' == typeof Reflect || !Reflect.construct) return !1;
- if (Reflect.construct.sham) return !1;
- if ('function' == typeof Proxy) return !0;
- try {
- return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [
- ], function () {
- })),
- !0
- } catch (e) {
- return !1
- }
- }();
- return function () {
- var e,
- t = Ld(n);
- return e = a ? (e = Ld(this).constructor, Reflect.construct(t, arguments, e)) : t.apply(this, arguments),
- t = this,
- !(e = e) || 'object' !== jd(e) && 'function' != typeof e ? Fd(t) : e
- }
- }
- function Fd(e) {
- if (void 0 === e) throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called');
- return e
- }
- function Ld(e) {
- return (Ld = Object.setPrototypeOf ? Object.getPrototypeOf : function (e) {
- return e.__proto__ || Object.getPrototypeOf(e)
- }) (e)
- }
- function Ud(e, t, n) {
- return t in e ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n,
- e
- }
- ut = function () {
- !function (e, t) {
- if ('function' != typeof t && null !== t) throw new TypeError('Super expression must either be null or a function');
- e.prototype = Object.create(t && t.prototype, {
- constructor: {
- value: e,
- writable: !0,
- configurable: !0
- }
- }),
- t && Id(e, t)
- }(r, A);
- var e,
- t,
- n,
- a = qd(r);
- function r(e) {
- var n;
- return function (e, t) {
- if (!(e instanceof t)) throw new TypeError('Cannot call a class as a function')
- }(this, r),
- Ud(Fd(n = a.call(this, e)), 'calcTooltipWidth', function () {
- var e,
- t;
- n.icon.current && (e = n.getAvailableSpace(n.icon.current), t = n.state.contentWidth || n.estimateContentWidth(), n.setState({
- width: ''.concat(t < e ? t : e, 'px'),
- contentWidth: t
- }))
- }),
- n.state = {
- width: null,
- isVisible: !1,
- contentWidth: null,
- clicked: !1
- },
- n.icon = C.a.createRef(),
- n.calcTooltipWidth = n.calcTooltipWidth.bind(Fd(n)),
- n.hoverTooltip = n.hoverTooltip.bind(Fd(n)),
- n.leaveTooltip = n.leaveTooltip.bind(Fd(n)),
- n.clickTooltip = n.clickTooltip.bind(Fd(n)),
- n
- }
- return e = r,
- (t = [
- {
- key: 'componentDidMount',
- value: function () {
- this.calcTooltipWidth(),
- window.addEventListener('resize', this.calcTooltipWidth)
- }
- },
- {
- key: 'componentWillUnmount',
- value: function () {
- window.removeEventListener('resize', this.calcTooltipWidth)
- }
- },
- {
- key: 'getAvailableSpace',
- value: function (e) {
- var t = e.getBoundingClientRect();
- if (0 === t.width) return 285;
- var n = this.props.direction.split('-').splice( - 1) [0],
- e = t[n];
- if ('left' === n) return 0.95 * e;
- if ('right' === n) return 0.95 * (window.innerWidth - e);
- e = window.innerWidth - t.right;
- return t.left < e ? 0.95 * t.left * 2 : 0.95 * e * 2
- }
- },
- {
- key: 'estimateContentWidth',
- value: function () {
- return 6.5 * this.getContentLength(this.props.content) + 24
- }
- },
- {
- key: 'getContentLength',
- value: function (e) {
- var n = this;
- return 'string' == typeof e ? e.length : 'object' === jd(e) && e.props && e.props.children ? C.a.Children.toArray(e.props.children).reduce(function (e, t) {
- return e + n.getContentLength(t)
- }, 0) : void 0
- }
- },
- {
- key: 'toggleTooltip',
- value: function (e) {
- this.setState({
- isVisible: e,
- clicked: this.props.clickToggle && e
- }),
- e && this.props.onShow && this.props.onShow()
- }
- },
- {
- key: 'hoverTooltip',
- value: function () {
- this.props.clickToggle || this.toggleTooltip(!0)
- }
- },
- {
- key: 'leaveTooltip',
- value: function () {
- this.props.clickToggle || this.toggleTooltip(!1)
- }
- },
- {
- key: 'clickTooltip',
- value: function () {
- this.props.clickToggle && this.toggleTooltip(!this.state.isVisible)
- }
- },
- {
- key: 'render',
- value: function () {
- var e = this.props.tooltipKey ? 'tooltip-'.concat(this.props.tooltipKey.replace(/\s+/g, '_')) : void 0;
- return C.a.createElement('div', {
- className: 'tooltip-container tooltip-'.concat(this.props.direction, ' ').concat(this.props.additionalClass),
- onMouseLeave: this.leaveTooltip
- }, this.props.children ? C.a.createElement('span', {
- onMouseOver: this.hoverTooltip,
- onClick: this.clickTooltip,
- 'data-for': e,
- 'data-tip': !0,
- ref: this.icon
- }, this.props.children) : C.a.createElement('span', {
- className: 'icon-tooltip'.concat(this.state.isVisible ? ' active' : ''),
- onMouseOver: this.hoverTooltip,
- onClick: this.clickTooltip,
- 'data-for': e,
- 'data-tip': !0,
- ref: this.icon
- }), this.state.isVisible && C.a.createElement('div', {
- className: 'tooltip-wrapper text-gray text-small',
- style: {
- width: this.state.width
- }
- }, C.a.createElement('div', {
- className: 'tooltip-content'
- }, this.props.content)))
- }
- }
- ]) && Td(e.prototype, t),
- n && Td(e, n),
- r
- }();
- Ud(ut, 'propTypes', {
- content: b.a.node.isRequired,
- additionalClass: b.a.string,
- children: b.a.node,
- clickToggle: b.a.bool,
- direction: b.a.oneOf(['top',
- 'top-right',
- 'top-left',
- 'left',
- 'right',
- 'bottom',
- 'bottom-right',
- 'bottom-left']),
- onShow: b.a.func,
- tooltipKey: b.a.string
- }),
- Ud(ut, 'defaultProps', {
- clickToggle: !1,
- direction: 'bottom-right',
- additionalClass: ''
- });
- var Md = ut;
- function Bd(e) {
- return (Bd = 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator ? function (e) {
- return typeof e
- }
- : function (e) {
- return e && 'function' == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? 'symbol' : typeof e
- }) (e)
- }
- function zd(e, t) {
- for (var n = 0; n < t.length; n++) {
- var a = t[n];
- a.enumerable = a.enumerable || !1,
- a.configurable = !0,
- 'value' in a && (a.writable = !0),
- Object.defineProperty(e, a.key, a)
- }
- }
- function Hd(e, t) {
- return (Hd = Object.setPrototypeOf || function (e, t) {
- return e.__proto__ = t,
- e
- }) (e, t)
- }
- function Gd(n) {
- var a = function () {
- if ('undefined' == typeof Reflect || !Reflect.construct) return !1;
- if (Reflect.construct.sham) return !1;
- if ('function' == typeof Proxy) return !0;
- try {
- return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [
- ], function () {
- })),
- !0
- } catch (e) {
- return !1
- }
- }();
- return function () {
- var e,
- t = Wd(n);
- return e = a ? (e = Wd(this).constructor, Reflect.construct(t, arguments, e)) : t.apply(this, arguments),
- t = this,
- !(e = e) || 'object' !== Bd(e) && 'function' != typeof e ? Vd(t) : e
- }
- }
- function Vd(e) {
- if (void 0 === e) throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called');
- return e
- }
- function Wd(e) {
- return (Wd = Object.setPrototypeOf ? Object.getPrototypeOf : function (e) {
- return e.__proto__ || Object.getPrototypeOf(e)
- }) (e)
- }
- function Yd(e, t, n) {
- return t in e ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n,
- e
- }
- Sn = function () {
- !function (e, t) {
- if ('function' != typeof t && null !== t) throw new TypeError('Super expression must either be null or a function');
- e.prototype = Object.create(t && t.prototype, {
- constructor: {
- value: e,
- writable: !0,
- configurable: !0
- }
- }),
- t && Hd(e, t)
- }(o, A);
- var e,
- t,
- n,
- r = Gd(o);
- function o() {
- var e;
- !function (e, t) {
- if (!(e instanceof t)) throw new TypeError('Cannot call a class as a function')
- }(this, o);
- for (var t = arguments.length, n = Array(t), a = 0; a < t; a++) n[a] = arguments[a];
- return Yd(Vd(e = r.call.apply(r, [
- this
- ].concat(n))), 'getFormattedRows', function () {
- return null === e.props.rows || 0 === e.props.rows.length ? [
- ] : je.a.map(e.props.rows, e.formatRow, Vd(e))
- }),
- Yd(Vd(e), 'getColumnsConfig', function () {
- return [e.props.dateColumnConfig].concat(e.props.columnsConfig)
- }),
- Yd(Vd(e), 'formatRow', function (n) {
- return je.a.map(e.getColumnsConfig(), function (e) {
- var t = n[e.key] || 0;
- return e.formatter && (t = e.formatter(t)),
- t = e.prefix ? e.prefix + t : t
- })
- }),
- e
- }
- return e = o,
- (t = [
- {
- key: 'render',
- value: function () {
- var e = je.a.map(this.getColumnsConfig(), function (e) {
- return C.a.createElement('th', {
- key: e.key
- }, e.name, ' ', e.description ? C.a.createElement(Md, {
- tooltipKey: e.key,
- content: e.description,
- direction: 'top'
- }) : null)
- }),
- t = je.a.map(this.getFormattedRows(this.props.rows), function (e) {
- return C.a.createElement(o.Row, {
- row: e,
- key: e[0]
- })
- });
- return this.props.reverse && t.reverse(),
- C.a.createElement('table', {
- className: 'zebra-striped spacing-top'
- }, C.a.createElement('thead', null, C.a.createElement('tr', null, e)), C.a.createElement('tbody', null, t))
- }
- }
- ]) && zd(e.prototype, t),
- n && zd(e, n),
- o
- }();
- Yd(Sn, 'defaultProps', {
- reverse: !1
- }),
- Yd(Sn, 'propTypes', {
- rows: b.a.array.isRequired,
- columnsConfig: b.a.array.isRequired,
- dateColumnConfig: b.a.object.isRequired,
- reverse: b.a.bool
- }),
- Sn.Row = function (e) {
- return C.a.createElement('tr', null, e.row.map(function (e, t) {
- return C.a.createElement('td', {
- key: t
- }, e)
- }))
- },
- Sn.Row.displayName = 'AnalyticsTableRow',
- Sn.Row.propTypes = {
- row: b.a.array.isRequired
- };
- var Qd = Sn;
- function Kd(e) {
- return (Kd = 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator ? function (e) {
- return typeof e
- }
- : function (e) {
- return e && 'function' == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? 'symbol' : typeof e
- }) (e)
- }
- function Jd(e, t) {
- for (var n = 0; n < t.length; n++) {
- var a = t[n];
- a.enumerable = a.enumerable || !1,
- a.configurable = !0,
- 'value' in a && (a.writable = !0),
- Object.defineProperty(e, a.key, a)
- }
- }
- function $d(e, t) {
- return ($d = Object.setPrototypeOf || function (e, t) {
- return e.__proto__ = t,
- e
- }) (e, t)
- }
- function Zd(n) {
- var a = function () {
- if ('undefined' == typeof Reflect || !Reflect.construct) return !1;
- if (Reflect.construct.sham) return !1;
- if ('function' == typeof Proxy) return !0;
- try {
- return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [
- ], function () {
- })),
- !0
- } catch (e) {
- return !1
- }
- }();
- return function () {
- var e,
- t = em(n);
- return e = a ? (e = em(this).constructor, Reflect.construct(t, arguments, e)) : t.apply(this, arguments),
- t = this,
- !(e = e) || 'object' !== Kd(e) && 'function' != typeof e ? Xd(t) : e
- }
- }
- function Xd(e) {
- if (void 0 === e) throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called');
- return e
- }
- function em(e) {
- return (em = Object.setPrototypeOf ? Object.getPrototypeOf : function (e) {
- return e.__proto__ || Object.getPrototypeOf(e)
- }) (e)
- }
- function tm(e, t, n) {
- return t in e ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n,
- e
- }
- var nm = 'HH:mm:ss MMMM Do, YYYY',
- am = function () {
- !function (e, t) {
- if ('function' != typeof t && null !== t) throw new TypeError('Super expression must either be null or a function');
- e.prototype = Object.create(t && t.prototype, {
- constructor: {
- value: e,
- writable: !0,
- configurable: !0
- }
- }),
- t && $d(e, t)
- }(r, A);
- var e,
- t,
- n,
- a = Zd(r);
- function r(e) {
- var t;
- return function (e, t) {
- if (!(e instanceof t)) throw new TypeError('Cannot call a class as a function')
- }(this, r),
- tm(Xd(t = a.call(this, e)), 'getCurrentTime', function () {
- return ct.a.utc().format(nm)
- }),
- tm(Xd(t), 'tick', function () {
- t.setState({
- time: t.getCurrentTime()
- })
- }),
- t.state = {
- time: t.getCurrentTime()
- },
- t
- }
- return e = r,
- (t = [
- {
- key: 'componentDidMount',
- value: function () {
- this.timerId = setInterval(this.tick, 1000)
- }
- },
- {
- key: 'componentWillUnmount',
- value: function () {
- clearInterval(this.timerId)
- }
- },
- {
- key: 'render',
- value: function () {
- return C.a.createElement('time', null, this.state.time)
- }
- }
- ]) && Jd(e.prototype, t),
- n && Jd(e, n),
- r
- }();
- function rm(e) {
- return (rm = 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator ? function (e) {
- return typeof e
- }
- : function (e) {
- return e && 'function' == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? 'symbol' : typeof e
- }) (e)
- }
- function om() {
- return (om = Object.assign || function (e) {
- for (var t = 1; t < arguments.length; t++) {
- var n,
- a = arguments[t];
- for (n in a) Object.prototype.hasOwnProperty.call(a, n) && (e[n] = a[n])
- }
- return e
- }).apply(this, arguments)
- }
- function im(e, t) {
- for (var n = 0; n < t.length; n++) {
- var a = t[n];
- a.enumerable = a.enumerable || !1,
- a.configurable = !0,
- 'value' in a && (a.writable = !0),
- Object.defineProperty(e, a.key, a)
- }
- }
- function sm(e, t) {
- return (sm = Object.setPrototypeOf || function (e, t) {
- return e.__proto__ = t,
- e
- }) (e, t)
- }
- function lm(n) {
- var a = function () {
- if ('undefined' == typeof Reflect || !Reflect.construct) return !1;
- if (Reflect.construct.sham) return !1;
- if ('function' == typeof Proxy) return !0;
- try {
- return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [
- ], function () {
- })),
- !0
- } catch (e) {
- return !1
- }
- }();
- return function () {
- var e,
- t = um(n);
- return e = a ? (e = um(this).constructor, Reflect.construct(t, arguments, e)) : t.apply(this, arguments),
- t = this,
- !(e = e) || 'object' !== rm(e) && 'function' != typeof e ? cm(t) : e
- }
- }
- function cm(e) {
- if (void 0 === e) throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called');
- return e
- }
- function um(e) {
- return (um = Object.setPrototypeOf ? Object.getPrototypeOf : function (e) {
- return e.__proto__ || Object.getPrototypeOf(e)
- }) (e)
- }
- function pm(e, t, n) {
- return t in e ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n,
- e
- }
- tm(am, 'displayName', 'TimeDisplay');
- var wn = function (e) {
- return Dp.addThousandsSeparator(Dp.roundMoney(e).toFixed(2))
- },
- dm = [
- {
- key: 'earnings',
- name: 'Ad Revenue',
- description: 'Amount you earned from Reveal advertising',
- prefix: '$',
- suffix: ' earned',
- formatter: wn
- },
- {
- key: 'viewable_impressions',
- name: 'Viewable Impressions',
- description: 'How often users scroll down below the fold and see Reveal ads',
- suffix: ' viewable impressions',
- formatter: Dp.addThousandsSeparator,
- startVisible: !1
- },
- {
- key: 'viewability_percent',
- name: 'Viewability Percent',
- description: 'Percentage of loads which resulted in a viewable impression',
- suffix: '% viewability',
- formatter: function (e) {
- return e.toFixed(2)
- },
- startVisible: !1
- },
- {
- key: 'rpmv',
- name: 'RPMv',
- description: 'Revenue earned per 1,000 viewable impressions',
- prefix: '$',
- suffix: ' RPMv',
- formatter: wn,
- startVisible: !1
- }
- ],
- oo = function () {
- !function (e, t) {
- if ('function' != typeof t && null !== t) throw new TypeError('Super expression must either be null or a function');
- e.prototype = Object.create(t && t.prototype, {
- constructor: {
- value: e,
- writable: !0,
- configurable: !0
- }
- }),
- t && sm(e, t)
- }(r, A);
- var e,
- t,
- n,
- a = lm(r);
- function r() {
- var i;
- !function (e, t) {
- if (!(e instanceof t)) throw new TypeError('Cannot call a class as a function')
- }(this, r);
- for (var e = arguments.length, t = Array(e), n = 0; n < e; n++) t[n] = arguments[n];
- return pm(cm(i = a.call.apply(a, [
- this
- ].concat(t))), 'state', {
- startDate: ct() (i.props.maxDate).subtract(1, 'month').startOf('day'),
- endDate: i.props.maxDate,
- loading: !0,
- group: 'day',
- rows: null,
- errorCode: null
- }),
- pm(cm(i), 'getExportUrl', function () {
- var e = i.state.startDate.format('YYYY-MM-DDZ'),
- t = i.state.endDate.format('YYYY-MM-DDZ'),
- n = pt.a.keys.api,
- a = i.props.selection,
- r = a.type === ft.organization,
- o = ''.concat(r ? 'organizations' : 'forums', '/discovery/reports/revealStats.csv'),
- a = r ? 'organization='.concat(a.organization.id) : 'forum='.concat(a.forum.shortname);
- return ''.concat(io.a.getURL(o), '?api_key=').concat(n, '&').concat(a, '&start=').concat(e, '&end=').concat(t)
- }),
- pm(cm(i), 'fetchData', function (e, t) {
- return i.setState({
- loading: !0
- }),
- i.metricsReport.fetch({
- start: e,
- end: t
- }).done(je.a.bind(i.onFetch, cm(i), e, t))
- }),
- pm(cm(i), 'formatRows', function (e) {
- return je.a.map(e, function (t) {
- return je.a.each(['earnings',
- 'viewability_percent',
- 'viewable_impressions',
- 'rpmv'], function (e) {
- t[e] = t[e] || 0
- }),
- t
- })
- }),
- pm(cm(i), 'onFetch', function (e, t) {
- var n = i.getModelsForGroup(i.state.group, e, t);
- i.setState({
- startDate: e,
- endDate: t,
- loading: !1,
- rows: i.formatRows(je.a.invoke(n, 'toJSON')),
- errorCode: null
- })
- }),
- pm(cm(i), 'onError', function (e) {
- i.setState({
- errorCode: e,
- loading: !1
- })
- }),
- pm(cm(i), 'onGroupChange', function (e) {
- var t = i.getModelsForGroup(e, i.state.startDate, i.state.endDate);
- i.setState({
- rows: i.formatRows(je.a.invoke(t, 'toJSON')),
- group: e
- })
- }),
- pm(cm(i), 'onDateChange', function (e, t) {
- i.fetchData(e, t)
- }),
- pm(cm(i), 'getModelsForGroup', function (e, t, n) {
- return 'month' === e ? i.metricsReport.byMonth.models : je.a.filter(i.metricsReport.byDay.models, function (e) {
- return t <= e.get('date_utc') && e.get('date_utc') <= n
- }, cm(i))
- }),
- pm(cm(i), 'getCardContent', function () {
- var e,
- t = [
- ];
- return i.state.errorCode ? t.push(C.a.createElement(dd, {
- isPermissionError: 22 === i.state.errorCode,
- key: 'error'
- })) : i.state.rows && (e = je.a.reduce(i.state.rows, function (e, t) {
- return e + t.earnings
- }, 0), t.push(0 < e ? C.a.createElement(Dd, {
- rows: i.state.rows,
- dateColumnConfig: i.dateColumnConfig,
- key: 'graph'
- }) : C.a.createElement(_d, {
- maxDate: i.props.maxDate,
- onDateChange: i.onDateChange,
- key: 'alert'
- }), C.a.createElement(Qd, om({
- }, i.state, {
- reverse: !0,
- columnsConfig: dm,
- dateColumnConfig: i.dateColumnConfig,
- key: 'table'
- })), C.a.createElement(r.Footer, {
- key: 'footer'
- }))),
- i.state.loading && t.push(C.a.createElement(Ji, {
- key: 'loading'
- })),
- t
- }),
- i
- }
- return e = r,
- (t = [
- {
- key: 'componentDidMount',
- value: function () {
- this.metricsReport = new Mp,
- this.dateColumnConfig = {
- key: 'date_utc',
- name: 'Date (UTC)',
- formatter: je.a.bind(function (e) {
- return 'day' === this.state.group ? ct.a.utc(e).format('MMM Do YYYY') : ct.a.utc(e).format('MMM YYYY')
- }, this)
- },
- this.metricsReport.on('error', this.onError, this),
- this.fetchData(this.state.startDate, this.state.endDate)
- }
- },
- {
- key: 'render',
- value: function () {
- var e = this.props.selection,
- t = e.organization && e.organization.activeGuarantee;
- return C.a.createElement(Bp, {
- className: 'revenue-analytics',
- leftTitle: 'Your '.concat(e.type === ft.organization ? 'Organization\'s' : 'Site\'s', ' Revenue'),
- rightTitle: C.a.createElement('div', {
- className: 'card__header-right'
- }, C.a.createElement('a', {
- href: this.getExportUrl(),
- target: '_blank',
- rel: 'noopener noreferrer',
- className: 'card__header-content-item -button -right text-gray-dark text-semibold'
- }, C.a.createElement('span', {
- className: 'icon-download text-large spacing-right text-gray'
- }), 'Download CSV'), C.a.createElement(Zp, {
- dateWrapperClass: 'card__header-datepicker',
- minDate: this.props.minDate,
- maxDate: this.props.maxDate,
- startDate: this.state.startDate,
- endDate: this.state.endDate,
- group: this.state.group,
- onDateChange: this.onDateChange,
- onGroupChange: this.onGroupChange
- }))
- }, t ? C.a.createElement(pd, {
- secondaryMessageType: 'revenue',
- startDate: ct() (t.start),
- endDate: ct() (t.end),
- amount: t.amount
- }) : null, this.getCardContent())
- }
- }
- ]) && im(e.prototype, t),
- n && im(e, n),
- r
- }();
- pm(oo, 'propTypes', {
- minDate: s.moment,
- maxDate: s.moment,
- selection: ht
- }),
- pm(oo, 'defaultProps', (go = ct.a.utc().startOf('day'), {
- minDate: ct() (go).subtract(1, 'year').add(1, 'day').startOf('day'),
- maxDate: go
- })),
- oo.Footer = function () {
- return C.a.createElement('footer', null, C.a.createElement('aside', null, C.a.createElement('em', null, 'All dates in UTC. Current UTC time is ', C.a.createElement(am, null), '.')), C.a.createElement('br', null), C.a.createElement('aside', null, C.a.createElement('em', null, 'All amounts above are estimates that will be finalized during data verification the first week of the following month.')), C.a.createElement('br', null), C.a.createElement('aside', null, C.a.createElement('a', {
- href: 'https://help.disqus.com/customer/portal/articles/2080463',
- target: '_blank',
- rel: 'noopener noreferrer'
- }, 'Learn more about Reveal earnings reports, payment policies, and settings.')))
- },
- oo.Footer.displayName = 'RevenueTabFooter';
- var mm = oo,
- fm = {
- product: Ur.SAAS_PRODUCT_POLLS,
- header: 'Maximize Audience Engagement with Polls',
- subheader: 'With Disqus Polls for publishers, you can build interactive polls and embed them directly onto your site in minutes, allowing you to boost engagement and create a more fun and enjoyable experience for your audiences.',
- tagline: 'Fits perfectly alongside Disqus Comments to deliver the full on-site engagement experience to your audiences.'
- },
- hm = [
- {
- header: 'Audience engagement has never been this fun',
- body: 'Create dynamic on-site Polls that boost time-on-site and deliver fun experiences to your audiences.'
- },
- {
- header: 'Build polls in minutes that keep your audiences engaged for hours.',
- body: 'Poll setup is a blast. Deploy Polls anywhere on your page, anywhere across your site with a click of a button. Optimized for all browsers and devices.'
- },
- {
- header: 'Get to know your audiences better.',
- body: 'Tap into audience sentiment and leverage Polls-driven insights to learn which topics and discussions your audiences are most excited about.'
- }
- ],
- gm = {
- product: Ur.SAAS_PRODUCT_COMMENTS,
- header: 'Engage and grow your audiences with word-class Disqus Comments.',
- subheader: 'Add Disqus Comments to your site and take your audience engagement to the next level.',
- tagline: 'More publishers trust Disqus with their audience engagement than any other comment provider'
- },
- ym = [
- {
- header: 'Powerful engagement features',
- body: C.a.createElement(C.a.Fragment, null, 'Build a highly-interactive community with features like ', C.a.createElement('span', {
- className: 'text-bold'
- }, 'Reactions'), ', ', C.a.createElement('span', {
- className: 'text-bold'
- }, 'Star Ratings'), ', and ', C.a.createElement('span', {
- className: 'text-bold'
- }, 'Badges'), '.')
- },
- {
- header: 'AI-powered moderation tools',
- body: 'Our moderation & safety tools keep the conversation as high-quality and civil as possible—letting you banish spam and toxicity without the headache of manual moderation.'
- },
- {
- header: 'Rev up your on-site revenue',
- body: 'Disqus Comments are proven to boost site traffic, time-on-site, and return visitors. Keep your community on-site where it belongs.'
- }
- ];
- function bm(e) {
- return (bm = 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator ? function (e) {
- return typeof e
- }
- : function (e) {
- return e && 'function' == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? 'symbol' : typeof e
- }) (e)
- }
- function vm(e, t) {
- for (var n = 0; n < t.length; n++) {
- var a = t[n];
- a.enumerable = a.enumerable || !1,
- a.configurable = !0,
- 'value' in a && (a.writable = !0),
- Object.defineProperty(e, a.key, a)
- }
- }
- function _m(e, t) {
- return (_m = Object.setPrototypeOf || function (e, t) {
- return e.__proto__ = t,
- e
- }) (e, t)
- }
- function Em(n) {
- var a = function () {
- if ('undefined' == typeof Reflect || !Reflect.construct) return !1;
- if (Reflect.construct.sham) return !1;
- if ('function' == typeof Proxy) return !0;
- try {
- return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [
- ], function () {
- })),
- !0
- } catch (e) {
- return !1
- }
- }();
- return function () {
- var e,
- t = Sm(n);
- return e = a ? (e = Sm(this).constructor, Reflect.construct(t, arguments, e)) : t.apply(this, arguments),
- t = this,
- !(e = e) || 'object' !== bm(e) && 'function' != typeof e ? Om(t) : e
- }
- }
- function Om(e) {
- if (void 0 === e) throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called');
- return e
- }
- function Sm(e) {
- return (Sm = Object.setPrototypeOf ? Object.getPrototypeOf : function (e) {
- return e.__proto__ || Object.getPrototypeOf(e)
- }) (e)
- }
- function wm(e, t, n) {
- return t in e ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n,
- e
- }
- var Pm = '//c.disquscdn.com/next/current/publisher-admin/assets/img/internal-landing',
- km = function (e) {
- var t = e.product,
- n = e.header,
- a = e.subheader,
- r = e.tagline,
- e = e.organization;
- return C.a.createElement('div', {
- className: 'internal-hero__container --'.concat(t)
- }, C.a.createElement('div', {
- className: 'internal-hero__content-container align'
- }, C.a.createElement('div', {
- className: 'internal-hero__content align align--column'
- }, C.a.createElement('h3', {
- className: 'product'
- }, t), C.a.createElement('h1', {
- className: 'header'
- }, n), C.a.createElement('p', {
- className: 'subheader'
- }, a), C.a.createElement(Us, {
- path: '/settings/subscription/'.concat(t === Ur.SAAS_PRODUCT_POLLS ? '?product=polls' : ''),
- orgId: e.id,
- orgSlug: e.slug,
- linkClassName: 'cta '.concat(t === Ur.SAAS_PRODUCT_COMMENTS ? 'orange' : 'blue')
- }, 'Get Started')), C.a.createElement('img', {
- className: 'internal-hero-img',
- src: ''.concat(Pm, '/').concat(t, '-hero.png')
- })), C.a.createElement('p', {
- className: 'tagline'
- }, r))
- };
- km.propTypes = {
- product: b.a.string.isRequired,
- header: b.a.string.isRequired,
- subheader: b.a.string.isRequired,
- tagline: b.a.string.isRequired,
- organization: b.a.shape({
- id: b.a.number.isRequired,
- slug: b.a.string.isRequired
- })
- };
- var Nm = function (e) {
- var t = e.product,
- n = e.header,
- a = e.body,
- e = n.split(' ') [0].toLowerCase();
- return C.a.createElement('div', {
- className: 'internal-content-panel__container align --'.concat(t, ' --').concat(e)
- }, C.a.createElement('img', {
- className: 'internal-content-img',
- src: ''.concat(Pm, '/').concat(t, '-').concat(e, '.png')
- }), C.a.createElement('div', {
- className: 'internal-content-panel__content align align--column'
- }, C.a.createElement('h1', {
- className: 'header'
- }, n), C.a.createElement('p', {
- className: 'body'
- }, a)))
- };
- Nm.propTypes = {
- product: b.a.string.isRequired,
- header: b.a.string.isRequired,
- body: b.a.node.isRequired
- };
- bo = function () {
- !function (e, t) {
- if ('function' != typeof t && null !== t) throw new TypeError('Super expression must either be null or a function');
- e.prototype = Object.create(t && t.prototype, {
- constructor: {
- value: e,
- writable: !0,
- configurable: !0
- }
- }),
- t && _m(e, t)
- }(o, A);
- var e,
- t,
- n,
- r = Em(o);
- function o() {
- var n;
- !function (e, t) {
- if (!(e instanceof t)) throw new TypeError('Cannot call a class as a function')
- }(this, o);
- for (var e = arguments.length, t = Array(e), a = 0; a < e; a++) t[a] = arguments[a];
- return wm(Om(n = r.call.apply(r, [
- this
- ].concat(t))), 'hero', function () {
- var e = n.props.isPolls ? fm : gm;
- return C.a.createElement(km, {
- product: e.product,
- header: e.header,
- subheader: e.subheader,
- tagline: e.tagline,
- organization: n.props.organization
- })
- }),
- wm(Om(n), 'contentPanels', function () {
- return (n.props.isPolls ? hm : ym).map(function (e, t) {
- return C.a.createElement(Nm, {
- key: t,
- product: n.props.isPolls ? Ur.SAAS_PRODUCT_POLLS : Ur.SAAS_PRODUCT_COMMENTS,
- header: e.header,
- body: e.body
- })
- })
- }),
- n
- }
- return e = o,
- (t = [
- {
- key: 'render',
- value: function () {
- return C.a.createElement('div', {
- className: 'layout__content --internal-landing'
- }, C.a.createElement('div', {
- className: 'polls__wrapper'
- }, C.a.createElement('div', {
- className: 'content__wrap'
- }, this.hero(), this.contentPanels())))
- }
- }
- ]) && vm(e.prototype, t),
- n && vm(e, n),
- o
- }();
- wm(bo, 'displayName', 'InternalLanding'),
- wm(bo, 'propTypes', {
- isPolls: b.a.bool.isRequired,
- organization: b.a.shape({
- id: b.a.number.isRequired,
- slug: b.a.string.isRequired
- })
- });
- var Cm = bo;
- function Rm(e) {
- return (Rm = 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator ? function (e) {
- return typeof e
- }
- : function (e) {
- return e && 'function' == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? 'symbol' : typeof e
- }) (e)
- }
- function xm(e, t) {
- for (var n = 0; n < t.length; n++) {
- var a = t[n];
- a.enumerable = a.enumerable || !1,
- a.configurable = !0,
- 'value' in a && (a.writable = !0),
- Object.defineProperty(e, a.key, a)
- }
- }
- function Am(e, t) {
- return (Am = Object.setPrototypeOf || function (e, t) {
- return e.__proto__ = t,
- e
- }) (e, t)
- }
- function Dm(n) {
- var a = function () {
- if ('undefined' == typeof Reflect || !Reflect.construct) return !1;
- if (Reflect.construct.sham) return !1;
- if ('function' == typeof Proxy) return !0;
- try {
- return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [
- ], function () {
- })),
- !0
- } catch (e) {
- return !1
- }
- }();
- return function () {
- var e,
- t = Tm(n);
- return e = a ? (e = Tm(this).constructor, Reflect.construct(t, arguments, e)) : t.apply(this, arguments),
- t = this,
- !(e = e) || 'object' !== Rm(e) && 'function' != typeof e ? jm(t) : e
- }
- }
- function jm(e) {
- if (void 0 === e) throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called');
- return e
- }
- function Tm(e) {
- return (Tm = Object.setPrototypeOf ? Object.getPrototypeOf : function (e) {
- return e.__proto__ || Object.getPrototypeOf(e)
- }) (e)
- }
- function Im(e, t, n) {
- return t in e ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n,
- e
- }
- _o = function () {
- !function (e, t) {
- if ('function' != typeof t && null !== t) throw new TypeError('Super expression must either be null or a function');
- e.prototype = Object.create(t && t.prototype, {
- constructor: {
- value: e,
- writable: !0,
- configurable: !0
- }
- }),
- t && Am(e, t)
- }(o, A);
- var e,
- t,
- n,
- r = Dm(o);
- function o() {
- var t;
- !function (e, t) {
- if (!(e instanceof t)) throw new TypeError('Cannot call a class as a function')
- }(this, o);
- for (var e = arguments.length, n = Array(e), a = 0; a < e; a++) n[a] = arguments[a];
- return Im(jm(t = r.call.apply(r, [
- this
- ].concat(n))), 'state', {
- popularComments: [
- ],
- showNumComments: 10,
- errorCode: null,
- isFetching: !0
- }),
- Im(jm(t), 'isAdvancedAnalyticsSupported', function () {
- if (!t.props.selection.organization) return !1;
- var e = t.props.saasFeatures[t.props.selection.organization.id];
- return e && e.advancedAnalytics
- }),
- Im(jm(t), 'fetchData', function () {
- t.setState({
- isFetching: !0
- });
- var e = br.orgId,
- e = je.a.extend(e ? {
- organization: e
- }
- : {
- forum: br.shortname
- }, e = {
- related: 'thread'
- });
- io.a.call('posts/listPopular', {
- data: e,
- success: t.onFetch,
- error: t.onError
- })
- }),
- Im(jm(t), 'onFetch', function (e) {
- t.setState({
- isFetching: !1,
- popularComments: e.response
- })
- }),
- Im(jm(t), 'onError', function (e) {
- t.setState({
- isFetching: !1,
- errorCode: e
- })
- }),
- Im(jm(t), 'onClick', function () {
- t.setState({
- showNumComments: t.state.showNumComments + 10
- })
- }),
- Im(jm(t), 'hasComments', function () {
- return !t.state.errorCode && !t.state.isFetching && t.state.popularComments && t.state.popularComments.length
- }),
- Im(jm(t), 'noComments', function () {
- return !t.state.errorCode && !t.state.isFetching && je.a.isEmpty(t.state.popularComments)
- }),
- t
- }
- return e = o,
- (t = [
- {
- key: 'componentWillMount',
- value: function () {
- this.fetchData()
- }
- },
- {
- key: 'componentDidMount',
- value: function () {
- this.isAdvancedAnalyticsSupported() ? this.props.emitTrackingEvent({
- verb: 'view',
- object_type: 'page',
- object_id: ''.concat(window.document.location.host).concat(window.document.location.pathname)
- }) : this.props.history.push(ho.getRoute('/analytics/comments/'))
- }
- },
- {
- key: 'render',
- value: function () {
- if (!this.isAdvancedAnalyticsSupported()) return null;
- if (this.props.organization && this.props.organization.pollsOnly) return C.a.createElement(Cm, {
- isPolls: !1,
- organization: this.props.organization
- });
- var e,
- t = this.hasComments(),
- n = this.noComments();
- return t && (e = je.a.chain(this.state.popularComments).first(this.state.showNumComments).map(function (e) {
- return C.a.createElement(o.Comment, {
- key: e.id,
- comment: e
- })
- }).value()),
- C.a.createElement('div', {
- className: 'admin_content'
- }, C.a.createElement('header', {
- className: 'spacing-bottom align-min-tablet align--row-reverse align--between align--middle'
- }, C.a.createElement('strong', {
- className: 'text-small text-gray'
- }, 'Last 7 days'), C.a.createElement('h2', null, C.a.createElement('span', {
- className: 'spacing-right-small'
- }, 'Top Comments'), C.a.createElement(Md, {
- tooltipKey: 'comments',
- content: 'These are the comments from the last 7 days that have received the most positive voting ratios.',
- direction: 'top'
- }))), this.state.errorCode ? C.a.createElement(dd, {
- isPermissionError: 22 === this.state.errorCode
- }) : null, t ? C.a.createElement('div', {
- className: 'border-top'
- }, ' ', e, ' ') : null, n ? C.a.createElement(o.NoComments, null) : null, this.state.isFetching ? C.a.createElement(Ji, null) : null, this.state.showNumComments < this.state.popularComments.length ? C.a.createElement('div', {
- className: 'spacing-top'
- }, C.a.createElement('button', {
- className: 'button button-wide button-fill text-medium',
- onClick: this.onClick
- }, 'Load more top comments')) : null)
- }
- }
- ]) && xm(e.prototype, t),
- n && xm(e, n),
- o
- }();
- Im(_o, 'propTypes', {
- emitTrackingEvent: b.a.func.isRequired,
- history: b.a.shape({
- push: b.a.func.isRequired
- }).isRequired,
- selection: ht.isRequired,
- saasFeatures: b.a.objectOf(b.a.objectOf(b.a.bool)).isRequired
- }),
- _o.Comment = function (e) {
- var t = e.comment,
- e = C.a.createElement('span', {
- className: 'truncate-line'
- }, t.thread.clean_title);
- return C.a.createElement('div', {
- className: 'padding-top text-medium border-bottom'
- }, C.a.createElement('h2', null, t.thread.link ? C.a.createElement('a', {
- href: t.thread.link
- }, e) : e), C.a.createElement('div', {
- className: 'align spacing-top'
- }, C.a.createElement('div', {
- className: 'spacing-right'
- }, C.a.createElement('a', {
- href: t.author.profileUrl
- }, C.a.createElement('img', {
- className: 'border-radius-sm',
- src: t.author.avatar.small.cache
- }))), C.a.createElement('div', null, C.a.createElement('div', {
- className: 'text-small text-gray top-comment__header'
- }, C.a.createElement('strong', null, C.a.createElement('a', {
- href: t.author.profileUrl
- }, t.author.name)), ' · ', ct.a.utc(t.createdAt).fromNow(), ' · ', t.likes, ' upvotes · ', t.dislikes, ' downvotes'), C.a.createElement('p', {
- className: 'text-gray-dark top-comment__content'
- }, t.url ? C.a.createElement('a', {
- className: 'link-gray-dark',
- href: t.url
- }, jl.a.niceTruncate(t.raw_message, 210)) : jl.a.niceTruncate(t.raw_message, 210)))))
- },
- _o.Comment.displayName = 'TopCommentsTabComment',
- _o.Comment.propTypes = {
- comment: b.a.object.isRequired
- },
- _o.NoComments = function () {
- return C.a.createElement('div', {
- className: 'alert alert--warning-light spacing-bottom'
- }, C.a.createElement('div', {
- className: 'spacing-narrow'
- }, C.a.createElement('h2', {
- className: 'spacing-bottom-narrow'
- }, C.a.createElement('span', {
- className: 'icon__position spacing-right-small'
- }, C.a.createElement('img', {
- src: '//c.disquscdn.com/next/current/publisher-admin/assets/img/icons/info.png',
- width: '20'
- })), 'No top comments for the past week'), C.a.createElement('p', {
- className: 'text-medium'
- }, 'There hasn\'t been enough activity on your site in the past week to show the top comments.')))
- },
- _o.NoComments.displayName = 'TopCommentsTabNoComments';
- var qm = Object(u.connect) (function (e) {
- return {
- saasFeatures: e.saasFeatures,
- organization: e.selection.organization
- }
- }, {
- emitTrackingEvent: Xo({
- zone: 'analytics',
- section: 'top_comments'
- })
- }) (Fo() (_o)),
- To = function (e) {
- return C.a.createElement('div', {
- className: 'section-contained'
- }, e.auth.staff ? C.a.cloneElement(e.children) : C.a.createElement('div', null, 'You aren\'t allowed to access this page'))
- };
- To.displayName = 'InternalTools',
- To.propTypes = {
- auth: b.a.object,
- children: b.a.node.isRequired
- };
- var qo = To,
- Fm = n(94),
- Lm = ct() ('2007-10-30'),
- Um = ct.a.utc().startOf('day').add(1, 'days'),
- Lo = 'adsAnalyticsViewable',
- Mo = 'adsPositionBottomEnabled',
- ti = 'adsPositionInthreadEnabled',
- ai = 'adsPositionRecommendationsEnabled',
- di = 'adsPositionTopEnabled',
- Oi = 'adsProductDisplayEnabled',
- wi = 'adsProductVideoEnabled',
- Fi = 'adsSettingsLocked',
- Vi = 'adsSettingsViewable',
- Yi = 'update',
- Mm = {
- text: 'text',
- boolean: 'boolean',
- select: 'select',
- number: 'number',
- multiText: 'multiText',
- date: 'date'
- },
- cs = Fm.data.map(function (e) {
- return {
- id: e.attributes.code,
- name: e.attributes.name
- }
- }),
- Ss = [
- {
- id: '0',
- name: 'Not Reviewed'
- },
- {
- id: '1',
- name: 'Qualified'
- },
- {
- id: '2',
- name: 'Disqualified'
- }
- ],
- Ds = [
- {
- id: 1,
- name: 'Business'
- },
- {
- id: 2,
- name: 'Celebrity'
- },
- {
- id: 3,
- name: 'Culture'
- },
- {
- id: 4,
- name: 'Entertainment'
- },
- {
- id: 5,
- name: 'Games'
- },
- {
- id: 6,
- name: 'Living'
- },
- {
- id: 7,
- name: 'News'
- },
- {
- id: 8,
- name: 'Tech'
- },
- {
- id: 9,
- name: 'Style'
- },
- {
- id: 10,
- name: 'Sports'
- }
- ],
- Ts = [
- {
- id: '10',
- name: 'Safe/Sensitive'
- },
- {
- id: '20',
- name: 'Standard'
- },
- {
- id: '30',
- name: 'Optimal'
- },
- {
- id: '40',
- name: 'Unfiltered'
- }
- ],
- qs = [
- {
- id: '4',
- name: 'A - paying'
- },
- {
- id: '1',
- name: 'B - non-commercial'
- },
- {
- id: '3',
- name: 'C - policy-against-ads'
- },
- {
- id: '5',
- name: 'D - squeaky'
- },
- {
- id: '6',
- name: 'E - feature-instream-position'
- },
- {
- id: '14',
- name: 'F - feature-niche-demand'
- },
- {
- id: '15',
- name: 'G - feature-earnings'
- },
- {
- id: '2',
- name: 'H - channel-conflict'
- },
- {
- id: '8',
- name: 'I - data-value-risk'
- },
- {
- id: '9',
- name: 'J - brand-value-risk'
- },
- {
- id: '10',
- name: 'K - other-partner'
- }
- ],
- Ls = [
- {
- id: 'KILL',
- name: 'Delete'
- },
- {
- id: 'SPAM',
- name: 'Spam'
- }
- ],
- Qs = [
- {
- id: '1',
- name: 'Ads Optional'
- },
- {
- id: '2',
- name: 'Shadow Banning'
- },
- {
- id: '3',
- name: 'Advanced Analytics'
- },
- {
- id: '4',
- name: 'Priority Support'
- },
- {
- id: '5',
- name: 'Branding Optional'
- },
- {
- id: '6',
- name: 'Single Sign-On'
- },
- {
- id: '7',
- name: 'Admin Logging'
- },
- {
- id: '8',
- name: 'Unlimited API Access'
- },
- {
- id: '9',
- name: 'Higher Bad Words Limit'
- },
- {
- id: '10',
- name: 'Timeouts'
- },
- {
- id: '11',
- name: 'Direct Support'
- },
- {
- id: '12',
- name: 'Email Subscriptions'
- },
- {
- id: '13',
- name: 'All Moderation Rules'
- },
- {
- id: '14',
- name: 'Star Ratings'
- },
- {
- id: '15',
- name: 'Custom Reactions'
- },
- {
- id: '16',
- name: 'Social Share Optional'
- },
- {
- id: '17',
- name: 'Recommendations'
- },
- {
- id: '18',
- name: 'Custom Fonts'
- }
- ],
- Bm = {
- adverb: 'bulk',
- verb: 'update',
- service: 'incredible_bulk_service',
- product: 'internal_tools',
- zone: 'incredible_bulk'
- },
- zm = [
- {
- key: 'forum',
- value: 'forum',
- label: 'Forum'
- },
- {
- key: 'global',
- value: 'global',
- label: 'Global'
- },
- {
- key: 'organization',
- value: 'organization',
- label: 'Organizations'
- },
- {
- key: 'subscription',
- value: 'subscription',
- label: 'Subscriptions'
- }
- ],
- Hm = {
- organization: [
- {
- key: Yi,
- label: 'Update',
- endpoint: 'internal/organizations/update'
- },
- {
- key: 'saasSubscribe',
- label: 'Subscribe To Plan',
- endpoint: 'organizations/saas/subscribe'
- },
- {
- key: 'saasUnsubscribeComments',
- label: 'Unsubscribe Organization From Comments Plan (If Any)',
- endpoint: 'organizations/saas/unsubscribe',
- defaultData: {
- productName: Ur.SAAS_PRODUCT_COMMENTS
- }
- },
- {
- key: 'saasUnsubscribePolls',
- label: 'Unsubscribe Organization From Polls Plan (If Any)',
- endpoint: 'organizations/saas/unsubscribe',
- defaultData: {
- productName: Ur.SAAS_PRODUCT_POLLS
- }
- },
- {
- key: 'saasAssignFeature',
- label: 'Assign Feature To Organization',
- endpoint: 'internal/saas/organizations/addFeature'
- },
- {
- key: 'saasRemoveFeature',
- label: 'Remove Feature From Organization',
- endpoint: 'internal/saas/organizations/removeFeature'
- }
- ],
- forum: [
- {
- key: Yi,
- label: 'Update',
- endpoint: 'internal/forums/update',
- defaultData: {
- shouldError: 1
- }
- },
- {
- key: 'addModerator',
- label: 'Add Moderator',
- endpoint: 'forums/addModerator'
- },
- {
- key: 'createTrustedDomain',
- label: 'Create Trusted Domain',
- endpoint: 'forums/trustedDomain/create'
- },
- {
- key: 'killTrustedDomain',
- label: 'Remove Trusted Domain',
- endpoint: 'forums/trustedDomain/kill'
- },
- {
- key: 'blacklistsAdd',
- label: 'Add to Blacklist',
- endpoint: 'blacklists/add'
- },
- {
- key: 'blacklistsRemove',
- label: 'Remove from Blacklist',
- endpoint: 'blacklists/remove'
- }
- ],
- global: [
- {
- key: 'globalBlacklistAdd',
- label: 'Add to Global Blacklist',
- endpoint: 'blacklists/global/add'
- }
- ],
- subscription: [
- {
- key: 'saasUpdateSubscription',
- label: 'Update start/end dates for Subscription',
- endpoint: 'internal/saas/subscriptions/update'
- }
- ]
- },
- Gm = {
- organization: {
- update: [
- {
- id: 'adsExceptionReason',
- label: 'Ads Exception',
- description: 'Ads Exception Reason',
- placeholder: 'Select a reason',
- type: Mm.select,
- options: qs,
- value: '4'
- },
- {
- id: 'owner',
- label: 'Owner',
- description: 'Owner of the organization',
- placeholder: 'Enter a user ID, or `username:<USERNAME>`',
- type: Mm.text
- },
- {
- id: 'eligibleForEarnings',
- label: 'Earnings Eligible',
- description: 'eligible for earnings',
- placeholder: 'True or False',
- type: Mm.boolean,
- value: '1'
- },
- {
- id: 'saasPolicy',
- label: 'SAAS Policy',
- description: 'Does the SAAS policy introduced in Jan 2017 apply to this organization?',
- placeholder: 'True or False',
- type: Mm.boolean,
- value: '1'
- }
- ],
- saasSubscribe: [
- {
- id: 'plan',
- label: 'Plan',
- description: 'Plan id of the plan to subscribe the organization to (`plus`, `plus-free` etc)',
- placeholder: 'Enter the plan id',
- type: Mm.text
- }
- ],
- saasUnsubscribeComments: [
- {
- id: 'immediately-comments',
- key: 'immediately',
- label: 'Cancel Immediately',
- description: 'Should we cancel the subscription now, or at the end of the current period?',
- placeholder: 'True or False',
- type: Mm.boolean,
- value: '1'
- }
- ],
- saasUnsubscribePolls: [
- {
- id: 'immediately-polls',
- key: 'immediately',
- label: 'Cancel Immediately',
- description: 'Should we cancel the subscription now, or at the end of the current period?',
- placeholder: 'True or False',
- type: Mm.boolean,
- value: '1'
- }
- ],
- saasAssignFeature: [
- {
- id: 'feature',
- label: 'Feature',
- description: 'Feature to assign',
- placeholder: 'Select a Feature',
- type: Mm.select,
- options: Qs
- }
- ],
- saasRemoveFeature: [
- {
- id: 'feature',
- label: 'Feature',
- description: 'Feature to remove',
- placeholder: 'Select a Feature',
- type: Mm.select,
- options: Qs
- }
- ]
- },
- forum: {
- update: [
- {
- id: 'adultContent',
- label: 'Adult Content',
- description: 'Flag as adult content?',
- type: Mm.boolean,
- value: '1'
- },
- {
- id: Lo,
- label: 'Ads Analytics Viewable',
- description: 'Let forum admins see ads analytics?',
- type: Mm.boolean,
- value: '1'
- },
- {
- id: Vi,
- label: 'Ads Settings Viewable',
- description: 'Let forum admins see ads settings?',
- type: Mm.boolean,
- value: '1'
- },
- {
- id: Fi,
- label: 'Lock Ads Settings',
- description: 'Prevent site admins from changing Ads settings?',
- type: Mm.boolean,
- value: '1'
- },
- {
- id: 'adsProductLinksEnabled',
- label: 'Ads Links Enabled',
- description: 'Enable Links?',
- type: Mm.boolean,
- value: '1'
- },
- {
- id: 'adsProductStoriesEnabled',
- label: 'Ads Story Enabled',
- description: 'Enable Story?',
- type: Mm.boolean,
- value: '1'
- },
- {
- id: Oi,
- label: 'Ads Display Enabled',
- description: 'Enable Display?',
- type: Mm.boolean,
- value: '1'
- },
- {
- id: wi,
- label: 'Ads Video Enabled',
- description: 'Enable Video?',
- type: Mm.boolean,
- value: '1'
- },
- {
- id: 'adsProductLinksThumbnailsEnabled',
- label: 'Link Thumbnails',
- description: 'Enable thumbnails for Sponsored Links?',
- type: Mm.boolean,
- value: '1'
- },
- {
- id: di,
- label: 'Ads Position Top',
- description: 'Show ads above the embed?',
- type: Mm.boolean,
- value: '1'
- },
- {
- id: Mo,
- label: 'Ads Position Bottom',
- description: 'Show ads below the embed?',
- type: Mm.boolean,
- value: '1'
- },
- {
- id: ti,
- label: 'Ads Position In-Thread',
- description: 'Show ads in the embed comments?',
- type: Mm.boolean,
- value: '1'
- },
- {
- id: ai,
- label: 'Ads Position in Recommendations',
- description: 'Show ads in Recommendations?',
- type: Mm.boolean,
- value: '1'
- },
- {
- id: 'adsPositionSidebarEnabled',
- label: 'Ads Position in Sidebar',
- description: 'Show ads in the sidebar?',
- type: Mm.boolean,
- value: '1'
- },
- {
- id: 'adsReviewStatus',
- label: 'Ads Review Status',
- description: 'Change the ads review status',
- placeholder: 'Select a qualification',
- type: Mm.select,
- options: Ss,
- value: '0'
- },
- {
- id: 'adsReviewNotes',
- label: 'Ads Review Notes',
- description: 'Updates notes relating to the ads review',
- placeholder: 'Enter a note',
- type: Mm.text
- },
- {
- id: 'adsLanguage',
- label: 'Ads Language',
- description: 'Change the ads language',
- placeholder: 'Select a language',
- type: Mm.select,
- options: cs,
- value: cs[0].id
- },
- {
- id: 'adsTaboolaNamed',
- label: 'Ads Taboola Named',
- description: 'Use a named publisher placement for Taboola?',
- type: Mm.boolean,
- value: '1'
- },
- {
- id: 'inEmbedAds',
- label: 'In Embed Ads',
- description: 'Put ads inside comments iframe?',
- type: Mm.boolean,
- value: '1'
- },
- {
- id: 'safetyLevel',
- label: 'Safety Level',
- description: 'Set the safety level to control ad mix',
- placeholder: 'Select a level',
- type: Mm.select,
- options: Ts,
- value: '10'
- },
- {
- id: 'forumCategory',
- label: 'Forum Category',
- description: 'Change the forum category',
- placeholder: 'Select a category',
- type: Mm.select,
- options: Ds,
- value: 1
- },
- {
- id: 'linkAffiliationEnabled',
- label: 'Link Affiliation Enabled',
- description: 'Insert affiliate links when the embed loads?',
- type: Mm.boolean,
- value: '1'
- },
- {
- id: 'translationLanguage',
- label: 'Translation Language',
- description: 'Change the translation language',
- placeholder: 'Select a language',
- type: Mm.select,
- options: cs,
- value: cs[0].id
- },
- {
- id: 'allowAnonPost',
- label: 'Guest Commenting',
- description: 'Enable guest commenting?',
- type: Mm.boolean,
- value: '1'
- },
- {
- id: 'moderatorBadgeText',
- label: 'Moderator Badge Text',
- description: 'Change the label that appears next to moderator comments',
- placeholder: 'Enter badge label text',
- type: Mm.text
- },
- {
- id: 'organization',
- label: 'Organization',
- description: 'Assign these forums to a single organization',
- placeholder: 'Enter an org ID',
- type: Mm.number
- },
- {
- id: 'disableThirdPartyTrackers',
- label: 'Third-party Trackers',
- description: 'Turn off third-party tracking?',
- type: Mm.boolean,
- value: '1'
- },
- {
- id: 'daysThreadAlive',
- label: 'Automatic Thread Closing',
- description: 'Changes the number of days before a thread automatically closes',
- placeholder: 'Enter number of days, or 0 to disable',
- type: Mm.number,
- value: '0'
- },
- {
- id: 'threadRatingsEnabled',
- label: 'Star Ratings',
- description: 'Enable star ratings?',
- type: Mm.boolean,
- value: '1'
- },
- {
- id: 'behindClickEnabled',
- label: 'Behind a Click',
- description: 'Enable behind a click?',
- type: Mm.boolean,
- value: '1'
- },
- {
- id: 'userIdentityDisabled',
- label: 'User Identity Disabled',
- description: 'Disable user identity?',
- type: Mm.boolean,
- value: '1'
- },
- {
- id: 'sideBarEnabled',
- label: 'User Profile Sidebar',
- description: 'Enable user profile sidebar?',
- type: Mm.boolean,
- value: '1'
- }
- ],
- addModerator: [
- {
- id: 'user',
- argPrefix: 'username:',
- label: 'Username',
- description: 'Adds a moderator to all the selected forums',
- placeholder: 'Enter a username',
- type: Mm.text,
- isRequired: !0
- },
- {
- id: 'canEdit',
- label: 'Can Edit',
- description: 'User can edit comment?',
- type: Mm.boolean,
- value: '0'
- },
- {
- id: 'canAdminister',
- label: 'Can Administer',
- description: 'User can change settings?',
- type: Mm.boolean,
- value: '0'
- }
- ],
- createTrustedDomain: [
- {
- id: 'domainName',
- label: 'Domain Name',
- description: 'Adds a Trusted Domain to these forums',
- placeholder: 'Enter a valid domain, e.g. disqus.com',
- type: Mm.text,
- isRequired: !0
- }
- ],
- killTrustedDomain: [
- {
- id: 'domain',
- argPrefix: 'domain:',
- label: 'Domain Name',
- description: 'Removes a Trusted Domain from these forums',
- placeholder: 'Enter a valid domain, e.g. disqus.com',
- type: Mm.text,
- isRequired: !0
- }
- ],
- blacklistsAdd: [
- {
- id: 'word',
- label: 'Words',
- description: 'Adds words to restricted words list',
- placeholder: 'Enter words you want to add separated by a comma',
- type: Mm.multiText
- },
- {
- id: 'domain',
- label: 'Domains',
- description: 'Adds domain names to restricted words list',
- placeholder: 'Enter domains you want to add separated by a comma',
- type: Mm.multiText
- },
- {
- id: 'ip',
- label: 'IP Addresses',
- description: 'Adds IP addresses to blacklist',
- placeholder: 'Enter IPs you want to add separated by a comma',
- type: Mm.multiText
- },
- {
- id: 'user',
- label: 'Users',
- argPrefix: 'username:',
- description: 'Adds users to blacklist',
- placeholder: 'Enter usernames you want to add separated by a comma',
- type: Mm.multiText
- },
- {
- id: 'email',
- label: 'Emails',
- description: 'Adds emails to blacklist',
- placeholder: 'Enter emails you want to add separated by a comma',
- type: Mm.multiText
- },
- {
- id: 'shadowBan',
- label: 'Shadow Ban',
- description: 'Shadow ban users?',
- type: Mm.boolean,
- isParam: !0,
- value: '0'
- },
- {
- id: 'retroactiveAction',
- label: 'Retroactive Action',
- description: 'Action to apply retroactively to existing posts',
- placeholder: 'Select an action',
- type: Mm.select,
- options: Ls,
- value: 'KILL'
- },
- {
- id: 'notes',
- label: 'Notes',
- description: 'Add note to each blacklist entry',
- placeholder: 'Enter a note up to 50 characters',
- type: Mm.text
- }
- ],
- blacklistsRemove: [
- {
- id: 'all',
- key: 'blacklist',
- label: 'All',
- description: 'Removes all blacklist entries from before the selected date',
- getRequest: {
- endpoint: 'blacklists/list',
- id: 'since',
- params: {
- order: 'desc'
- },
- type: Mm.multiText
- },
- type: Mm.date,
- value: Um.toISOString()
- },
- {
- id: 'word',
- key: 'blacklist',
- label: 'Words',
- description: 'Removes words from restricted words list from before the selected date',
- getRequest: {
- endpoint: 'blacklists/list',
- id: 'since',
- params: {
- type: 'word',
- order: 'desc'
- },
- type: Mm.multiText
- },
- type: Mm.date,
- value: Um.toISOString()
- },
- {
- id: 'domain',
- key: 'blacklist',
- label: 'Domains',
- description: 'Removes domain names from restricted words list from before the selected date',
- getRequest: {
- endpoint: 'blacklists/list',
- id: 'since',
- params: {
- type: 'domain',
- order: 'desc'
- },
- type: Mm.multiText
- },
- type: Mm.date,
- value: Um.toISOString()
- },
- {
- id: 'ip',
- key: 'blacklist',
- label: 'IP Addresses',
- description: 'Removes blacklisted IP addresses from before the selected date',
- getRequest: {
- endpoint: 'blacklists/list',
- id: 'since',
- params: {
- type: 'ip',
- order: 'desc'
- },
- type: Mm.multiText
- },
- type: Mm.date,
- value: Um.toISOString()
- },
- {
- id: 'user',
- key: 'blacklist',
- label: 'Users',
- argPrefix: 'username:',
- description: 'Removes blacklisted user from before the selected date',
- getRequest: {
- endpoint: 'blacklists/list',
- id: 'since',
- params: {
- type: 'user',
- order: 'desc'
- },
- type: Mm.multiText
- },
- type: Mm.date,
- value: Um.toISOString()
- },
- {
- id: 'email',
- key: 'blacklist',
- label: 'Emails',
- description: 'Removes emails from blacklist',
- getRequest: {
- endpoint: 'blacklists/list',
- id: 'since',
- params: {
- type: 'email',
- order: 'desc'
- },
- type: Mm.multiText
- },
- type: Mm.date,
- value: Um.toISOString()
- }
- ]
- },
- global: {
- globalBlacklistAdd: [
- {
- id: 'user',
- label: 'Users',
- argPrefix: 'username:',
- description: 'Adds users to blacklist',
- placeholder: 'Enter usernames you want to add separated by a comma',
- type: Mm.multiText
- },
- {
- id: 'email',
- label: 'Emails',
- description: 'Adds emails to blacklist',
- placeholder: 'Enter emails you want to add separated by a comma',
- type: Mm.multiText
- },
- {
- id: 'shadowBan',
- label: 'Shadow Ban',
- description: 'Shadow ban users?',
- type: Mm.boolean,
- isParam: !0,
- value: '0'
- }
- ],
- globalShadowBan: [
- {
- id: 'user',
- key: 'shadowBanUser',
- label: 'Users',
- argPrefix: 'username:',
- description: 'Globally shadow bans users',
- placeholder: 'Enter usernames you want to shadow ban separated by a comma',
- type: Mm.multiText
- },
- {
- id: 'email',
- key: 'shadowBanEmail',
- label: 'Emails',
- description: 'Globally shadow bans emails',
- placeholder: 'Enter emails you want to shadow ban separated by a comma',
- type: Mm.multiText
- }
- ]
- },
- subscription: {
- saasUpdateSubscription: [
- {
- id: 'start',
- label: 'Start Date',
- description: 'Start Date (YY-DD-MM HH:MM:SS)',
- placeholder: 'Enter start date',
- type: Mm.text
- },
- {
- id: 'end',
- label: 'End Date',
- description: 'End Date (YY-DD-MM HH:MM:SS)',
- placeholder: 'Enter end date',
- type: Mm.text
- }
- ]
- }
- },
- Vm = {
- organization: [
- ],
- forum: [
- {
- id: 'atf',
- label: 'Add ATF Actions',
- actions: [
- {
- group: Yi,
- id: Lo
- },
- {
- group: Yi,
- id: Mo
- },
- {
- group: Yi,
- id: ti
- },
- {
- group: Yi,
- id: ai
- },
- {
- group: Yi,
- id: di
- },
- {
- group: Yi,
- id: Oi
- },
- {
- group: Yi,
- id: wi
- },
- {
- group: Yi,
- id: Fi
- },
- {
- group: Yi,
- id: Vi
- }
- ]
- }
- ],
- global: [
- ],
- subscription: [
- ]
- };
- function Wm(e) {
- return (Wm = 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator ? function (e) {
- return typeof e
- }
- : function (e) {
- return e && 'function' == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? 'symbol' : typeof e
- }) (e)
- }
- function Ym(e, t) {
- for (var n = 0; n < t.length; n++) {
- var a = t[n];
- a.enumerable = a.enumerable || !1,
- a.configurable = !0,
- 'value' in a && (a.writable = !0),
- Object.defineProperty(e, a.key, a)
- }
- }
- function Qm(e, t) {
- return (Qm = Object.setPrototypeOf || function (e, t) {
- return e.__proto__ = t,
- e
- }) (e, t)
- }
- function Km(n) {
- var a = function () {
- if ('undefined' == typeof Reflect || !Reflect.construct) return !1;
- if (Reflect.construct.sham) return !1;
- if ('function' == typeof Proxy) return !0;
- try {
- return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [
- ], function () {
- })),
- !0
- } catch (e) {
- return !1
- }
- }();
- return function () {
- var e,
- t = $m(n);
- return e = a ? (e = $m(this).constructor, Reflect.construct(t, arguments, e)) : t.apply(this, arguments),
- t = this,
- !(e = e) || 'object' !== Wm(e) && 'function' != typeof e ? Jm(t) : e
- }
- }
- function Jm(e) {
- if (void 0 === e) throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called');
- return e
- }
- function $m(e) {
- return ($m = Object.setPrototypeOf ? Object.getPrototypeOf : function (e) {
- return e.__proto__ || Object.getPrototypeOf(e)
- }) (e)
- }
- function Zm(e, t, n) {
- return t in e ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n,
- e
- }
- function Xm(e) {
- return e = ''.concat(e.startDate.format('MM/DD/YY')),
- C.a.createElement('span', null, e)
- }
- Xm.propTypes = {
- startDate: s.moment.isRequired
- };
- sl = function () {
- !function (e, t) {
- if ('function' != typeof t && null !== t) throw new TypeError('Super expression must either be null or a function');
- e.prototype = Object.create(t && t.prototype, {
- constructor: {
- value: e,
- writable: !0,
- configurable: !0
- }
- }),
- t && Qm(e, t)
- }(o, A);
- var e,
- t,
- n,
- r = Km(o);
- function o() {
- var a;
- !function (e, t) {
- if (!(e instanceof t)) throw new TypeError('Cannot call a class as a function')
- }(this, o);
- for (var e = arguments.length, t = Array(e), n = 0; n < e; n++) t[n] = arguments[n];
- return Zm(Jm(a = r.call.apply(r, [
- this
- ].concat(t))), 'state', {
- pickerOpen: !1
- }),
- Zm(Jm(a), 'datePickerInput', C.a.createRef()),
- Zm(Jm(a), 'datePickerContainer', C.a.createRef()),
- Zm(Jm(a), 'handleDateChange', function (e, t) {
- a.setState({
- pickerOpen: !1
- });
- var n = a.localToUtc(ct() (t.date1));
- a.props.startDate.isSame(n) || ((t = a.localToUtc(ct() (a.datePickerInput.current.value, 'MM/DD/YY'))) !== n && (n = t), a.props.onDateChange && (a.props.action && a.props.actionGroup ? a.props.onDateChange(a.props.action, a.props.actionGroup, n) : a.props.onDateChange(n)))
- }),
- Zm(Jm(a), 'updatePickerDate', function () {
- var e = a.utcToLocal(a.props.startDate).toDate();
- a._picker.setStart(e)
- }),
- Zm(Jm(a), 'showPicker', function (e) {
- e.preventDefault(),
- e.stopPropagation(),
- e.nativeEvent.stopImmediatePropagation(),
- a.setState(function (e) {
- return {
- pickerOpen: !e.pickerOpen
- }
- })
- }),
- Zm(Jm(a), 'rangeFnFromStartDate', function (e) {
- return je.a.constant([e.toDate(),
- a.today().toDate()])
- }),
- Zm(Jm(a), 'today', function () {
- return a.utcToLocal(a.props.maxDate || ct.a.utc()).startOf('day')
- }),
- Zm(Jm(a), 'localToUtc', function (e) {
- return ct.a.utc(e.toArray())
- }),
- Zm(Jm(a), 'utcToLocal', function (e) {
- return ct() (e.toArray())
- }),
- a
- }
- return e = o,
- (t = [
- {
- key: 'componentDidMount',
- value: function () {
- return this._picker = vo() (this.datePickerInput.current).dateRangePicker({
- inline: !0,
- container: vo() (this.datePickerContainer.current),
- singleDate: this.props.singleDate,
- singleMonth: this.props.singleMonth,
- showTopbar: !1,
- showShortcuts: !1,
- alwaysOpen: this.props.alwaysOpen,
- autoClose: !this.props.alwaysOpen,
- format: 'MM/DD/YY',
- startDate: this.props.minDate && this.utcToLocal(this.props.minDate),
- endDate: this.props.maxDate && this.utcToLocal(this.props.maxDate),
- shortcuts: null
- }).bind('datepicker-first-date-selected', je.a.bind(this.handleDateChange, this)).bind('datepicker-closed', je.a.bind(this.handleDateChange, this)).data('dateRangePicker'),
- this.updatePickerDate(),
- this._picker
- }
- },
- {
- key: 'componentDidUpdate',
- value: function (e, t) {
- t.pickerOpen !== this.state.pickerOpen ? this.state.pickerOpen ? this._picker.open(0) : this._picker.close(0) : e.startDate !== this.props.startDate && this.updatePickerDate()
- }
- },
- {
- key: 'componentWillUnmount',
- value: function () {
- this._picker.destroy()
- }
- },
- {
- key: 'render',
- value: function () {
- var e = this.props.dateWrapperClass || 'date-input-group__wrapper--no-switch',
- t = this.props.hideInput ? this.showPicker : null,
- n = this.props.hideInput ? C.a.createElement('div', {
- className: 'date-input-group__label'
- }, C.a.createElement('span', {
- className: 'icon-calendar text-large spacing-right text-gray'
- }), C.a.createElement(Xm, {
- startDate: this.props.startDate
- })) : null;
- return C.a.createElement('div', {
- className: e,
- onClick: t
- }, C.a.createElement('div', {
- className: 'date-input-group align align--stretch text-small text-semibold'
- }, n, C.a.createElement('div', {
- className: 'card__header-content-item -button -nest daterange-picker',
- onClick: this.showPicker
- }, C.a.createElement('span', {
- className: 'icon-calendar text-large spacing-right text-gray',
- hidden: this.props.hideInput
- }), C.a.createElement('input', {
- className: 'date-input-group__input text-gray-dark text-semibold',
- hidden: this.props.hideInput,
- ref: this.datePickerInput
- }), C.a.createElement('span', {
- className: 'icon-arrow text-large spacing-left date-input-group__icon'
- }))), C.a.createElement('div', {
- className: 'date-input-group__dropdown',
- ref: this.datePickerContainer
- }))
- }
- }
- ]) && Ym(e.prototype, t),
- n && Ym(e, n),
- o
- }();
- Zm(sl, 'propTypes', {
- singleDate: b.a.bool,
- singleMonth: b.a.bool,
- minDate: s.moment.isRequired,
- maxDate: s.moment.isRequired,
- startDate: s.moment.isRequired,
- onDateChange: b.a.func,
- onGroupChange: b.a.func,
- alwaysOpen: b.a.bool,
- dateWrapperClass: b.a.string,
- hideInput: b.a.bool,
- action: b.a.object,
- actionGroup: b.a.string
- }),
- Zm(sl, 'defaultProps', {
- singleMonth: !1,
- singleDate: !0,
- alwaysOpen: !1,
- hideInput: !1
- });
- var ef = sl,
- yl = n(280),
- tf = n.n(yl),
- nf = n(148);
- function af(t, e) {
- var n,
- a = Object.keys(t);
- return Object.getOwnPropertySymbols && (n = Object.getOwnPropertySymbols(t), e && (n = n.filter(function (e) {
- return Object.getOwnPropertyDescriptor(t, e).enumerable
- })), a.push.apply(a, n)),
- a
- }
- function rf(a) {
- for (var e = 1; e < arguments.length; e++) {
- var r = null != arguments[e] ? arguments[e] : {
- };
- e % 2 ? af(Object(r), !0).forEach(function (e) {
- var t,
- n;
- n = r[t = e],
- t in (e = a) ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(a, Object.getOwnPropertyDescriptors(r)) : af(Object(r)).forEach(function (e) {
- Object.defineProperty(a, e, Object.getOwnPropertyDescriptor(r, e))
- })
- }
- return a
- }
- var Li = b.a.shape({
- key: b.a.oneOfType([b.a.string,
- b.a.number]).isRequired,
- value: b.a.any.isRequired,
- label: b.a.string.isRequired,
- icon: b.a.string,
- style: b.a.object,
- isDisabled: b.a.bool
- }),
- vl = b.a.shape({
- date_added: b.a.string.isRequired,
- id: b.a.number.isRequired,
- name: b.a.string.isRequired
- }),
- of = 'https://c.disquscdn.com/images/noavatar92.png',
- sf = {
- auto: 'Auto',
- serif: 'Serif',
- 'sans-serif': 'Sans-serif'
- },
- lf = [
- {
- key: 'auto',
- label: 'Auto',
- value: 'auto'
- },
- {
- key: 'serif',
- label: 'Serif',
- value: 'serif'
- },
- {
- key: 'sans-serif',
- label: 'Sans-serif',
- value: 'sans-serif'
- }
- ],
- cf = {
- name: 'Default',
- category: 'auto',
- isDefault: !0
- },
- uf = {
- auto: 'Auto',
- light: 'Light',
- dark: 'Dark'
- },
- pf = [
- {
- key: 'auto',
- label: 'Auto',
- value: 'auto'
- },
- {
- key: 'light',
- label: 'Light',
- value: 'light'
- },
- {
- key: 'dark',
- label: 'Dark',
- value: 'dark'
- }
- ],
- df = [
- {
- key: 4,
- value: 4,
- label: 'Best First'
- },
- {
- key: 2,
- value: 2,
- label: 'Newest First'
- },
- {
- key: 1,
- value: 1,
- label: 'Oldest First'
- }
- ],
- mf = [
- {
- label: 'Zero comments',
- key: 'commentsLinkZero'
- },
- {
- label: 'One comment',
- key: 'commentsLinkOne'
- },
- {
- label: 'Multiple comments',
- key: 'commentsLinkMultiple'
- }
- ],
- ff = {
- commentsLinkZero: '0 Comments',
- commentsLinkOne: '1 Comment',
- commentsLinkMultiple: '{num} Comments'
- },
- hf = [
- {
- label: 'Empty thread',
- key: 'commentsPlaceholderTextEmpty',
- default:
- 'Start the discussion…'
- },
- {
- label: 'Populated thread',
- key: 'commentsPlaceholderTextPopulated',
- default:
- 'Join the discussion…'
- }
- ],
- gf = [
- {
- label: 'Upvote & Downvote',
- key: nf.VOTING_TYPES.DETAILED
- },
- {
- label: 'Hide downvote count and downvoters',
- key: nf.VOTING_TYPES.DOWNVOTE_LIMITED
- },
- {
- label: 'Upvote only',
- key: nf.VOTING_TYPES.DOWNVOTE_DISABLED
- },
- {
- label: 'Disabled',
- key: nf.VOTING_TYPES.DISABLED
- }
- ],
- yf = [
- 1,
- 3,
- 5,
- 10,
- 15,
- 20,
- 25
- ].map(function (e) {
- return {
- key: e,
- value: e,
- label: ''.concat(e, 1 === e ? ' time' : ' times')
- }
- }),
- Cl = b.a.shape({
- forum_id: b.a.number.isRequired,
- id: b.a.number.isRequired,
- domain: b.a.string.isRequired
- }),
- bf = [
- 'I can\'t get Disqus to work on my site.',
- 'I added an extra website by accident! Oops!',
- 'I was not using my site as much as I thought and just wanted to clean house.',
- 'Other'
- ],
- xl = b.a.shape({
- rtl: b.a.bool.isRequired,
- code: b.a.string.isRequired,
- name: b.a.string.isRequired
- }),
- vf = [
- {
- id: 'wordpress',
- name: 'WordPress'
- },
- {
- id: 'blogger',
- name: 'Blogger'
- },
- {
- id: 'tumblr',
- name: 'Tumblr'
- },
- {
- id: 'squarespace',
- name: 'Squarespace'
- },
- {
- id: 'typepad',
- name: 'TypePad'
- },
- {
- id: 'movabletype',
- name: 'Movable Type'
- },
- {
- id: 'drupal',
- name: 'Drupal'
- },
- {
- id: 'joomla',
- name: 'Joomla'
- },
- {
- id: 'weebly',
- name: 'Weebly'
- },
- {
- id: 'strikingly',
- name: 'Strikingly'
- },
- {
- id: 'jekyll',
- name: 'Jekyll'
- },
- {
- id: 'ghost',
- name: 'Ghost'
- },
- {
- id: 'hubspot',
- name: 'HubSpot'
- },
- {
- id: 'shopify',
- name: 'Shopify'
- },
- {
- id: 'adobemuse',
- name: 'Adobe Muse'
- },
- {
- id: 'amp',
- name: 'AMP'
- },
- {
- id: 'jimdo',
- name: 'Jimdo'
- },
- {
- id: 'postachio',
- name: 'Postach.io'
- },
- {
- id: 'gatsby',
- name: 'Gatsby'
- },
- {
- id: 'pattern',
- name: 'Pattern'
- },
- {
- id: 'react',
- name: 'React'
- }
- ],
- _f = {
- min: 1,
- default:
- 50,
- max: 50
- },
- Ef = 0,
- Of = 10000,
- Sf = {
- min: 1,
- default:
- 2,
- max: 99
- },
- ac = b.a.shape({
- name: b.a.string.isRequired,
- color: b.a.string.isRequired,
- description: b.a.node,
- settings: b.a.arrayOf(b.a.shape({
- key: b.a.string.isRequired,
- value: b.a.oneOfType([b.a.bool,
- b.a.number,
- b.a.string]).isRequired,
- text: b.a.node
- })).isRequired,
- rules: b.a.objectOf(b.a.shape({
- key: b.a.string.isRequired,
- filter: b.a.string.isRequired,
- action: b.a.string.isRequired,
- text: b.a.node
- })).isRequired
- }),
- wf = [
- {
- name: 'Balanced',
- color: 'green',
- description: 'Recommended for publishers looking to reduce the possibility of troublesome comments through automated moderation, while balancing the openness of conversation.',
- settings: [
- {
- key: 'unapproveLinks',
- value: !1
- },
- {
- key: 'mediaembedEnabled',
- value: !0,
- text: 'Images, Videos, and Links will be allowed in comments'
- },
- {
- key: 'allowAnonPost',
- value: !0,
- text: 'Guest comments will be allowed'
- },
- {
- key: 'flaggingEnabled',
- value: !0
- },
- {
- key: 'flagThreshold',
- value: 5,
- text: 'Comments that are flagged 5 times will be sent to pending'
- },
- {
- key: 'daysThreadAlive',
- value: 0
- }
- ],
- rules: {
- postContainsRestrictedWord: {
- key: 'postContainsRestrictedWord',
- filter: 'postContainsRestrictedWord',
- type: 'comment',
- action: 'delete',
- text: 'Comments containing restricted words will be automatically deleted'
- },
- postIsToxic: {
- key: 'postIsToxic',
- filter: 'postIsToxic',
- type: 'comment',
- action: 'pending',
- text: C.a.createElement(C.a.Fragment, null, C.a.createElement('a', {
- href: Pn.toxicModFilter,
- rel: 'noreferrer noopener',
- target: '_blank'
- }, 'Toxic comments'), ' will require moderator approval to be displayed')
- },
- postIsPromotion: {
- key: 'postIsPromotion',
- filter: 'postIsPromotion',
- type: 'comment',
- action: 'spam',
- text: C.a.createElement(C.a.Fragment, null, 'Promotional comments will be automatically marked as spam'),
- isHiveRule: !0
- },
- postIsSexual: {
- key: 'postIsSexual',
- filter: 'postIsSexual',
- severity: 3,
- type: 'comment',
- action: 'pending',
- text: C.a.createElement(C.a.Fragment, null, 'Comments containing restricted words, toxicity, sexual content, hate, violence, or bullying will require moderator approval to be displayed'),
- isHiveRule: !0
- },
- postIsHate: {
- key: 'postIsHate',
- filter: 'postIsHate',
- severity: 3,
- type: 'comment',
- action: 'pending',
- isHiveRule: !0
- },
- postIsViolence: {
- key: 'postIsViolence',
- filter: 'postIsViolence',
- severity: 3,
- type: 'comment',
- action: 'pending',
- isHiveRule: !0
- }
- }
- },
- {
- name: 'Strict',
- color: 'violet',
- description: 'Recommended for publishers looking to aggressively reduce the possibility of troublesome comments through strict automated moderation, and limitations on who can comment and allowed comment types.',
- settings: [
- {
- key: 'unapproveLinks',
- value: !0
- },
- {
- key: 'mediaembedEnabled',
- value: !1,
- text: 'Images, Videos, and Links will not be allowed in comments'
- },
- {
- key: 'allowAnonPost',
- value: !1,
- text: 'Guest comments will not be allowed'
- },
- {
- key: 'flaggingEnabled',
- value: !0
- },
- {
- key: 'flagThreshold',
- value: 3,
- text: 'Comments that are flagged 3 times will be sent to pending'
- },
- {
- key: 'daysThreadAlive',
- value: 30,
- text: 'Threads will be automatically closed after 30 days'
- }
- ],
- rules: {
- postContainsRestrictedWord: {
- key: 'postContainsRestrictedWord',
- filter: 'postContainsRestrictedWord',
- type: 'comment',
- action: 'delete',
- text: 'Comments containing restricted words will be automatically deleted'
- },
- postIsToxic: {
- key: 'postIsToxic',
- filter: 'postIsToxic',
- type: 'comment',
- action: 'delete',
- text: C.a.createElement(C.a.Fragment, null, C.a.createElement('a', {
- href: Pn.toxicModFilter,
- rel: 'noreferrer noopener',
- target: '_blank'
- }, 'Toxic comments'), ' will be automatically deleted')
- },
- postIsPromotion: {
- key: 'postIsPromotion',
- filter: 'postIsPromotion',
- type: 'comment',
- action: 'spam',
- text: C.a.createElement(C.a.Fragment, null, 'Promotional comments will be automatically marked as spam'),
- isHiveRule: !0
- },
- postIsSexual: {
- key: 'postIsSexual',
- filter: 'postIsSexual',
- severity: 3,
- type: 'comment',
- action: 'delete',
- text: C.a.createElement(C.a.Fragment, null, 'Comments containing restricted words, toxicity, sexual content, hate, violence, or bullying will be automatically deleted'),
- isHiveRule: !0
- },
- postIsHate: {
- key: 'postIsHate',
- filter: 'postIsHate',
- severity: 3,
- type: 'comment',
- action: 'delete',
- isHiveRule: !0
- },
- postIsViolence: {
- key: 'postIsViolence',
- filter: 'postIsViolence',
- severity: 3,
- type: 'comment',
- action: 'delete',
- isHiveRule: !0
- }
- }
- }
- ],
- Pf = function (e, t) {
- var n = t.forumDetails,
- a = t.orgCurrentPlan;
- if (!n || t.orgSubscriptionIsFetching) return null;
- n = rf({
- package: a && a.id || null,
- aet_banner_enabled: n.aetBannerEnabled
- }, e.extra_data);
- return rf(rf({
- }, e), {
- }, {
- extra_data: JSON.stringify(n)
- })
- },
- yc = function (e) {
- var t = 'fieldset__label text-gray'.concat(e.shouldHighlight ? ' settings__highlighted' : '', ' ').concat(e.labelAdditionalClass || ''),
- n = 'fieldset__block'.concat(e.childIsInput ? '' : ' spacing-left-tiny').concat(e.blockAdditionalClass ? ' ' + e.blockAdditionalClass : '').concat(e.readOnly ? ' readOnly' : '');
- return C.a.createElement('div', {
- className: 'fieldset '.concat(e.fieldsetAdditionalClass || '')
- }, C.a.createElement('label', {
- htmlFor: e.labelId,
- className: t
- }, e.label, e.tooltip ? C.a.createElement(Md, {
- tooltipKey: e.labelId,
- content: e.tooltip
- }) : null), C.a.createElement('div', {
- className: n
- }, e.children))
- };
- yc.propTypes = {
- label: b.a.node,
- labelId: b.a.string,
- blockAdditionalClass: b.a.string,
- fieldsetAdditionalClass: b.a.string,
- labelAdditionalClass: b.a.string,
- readOnly: b.a.bool,
- shouldHighlight: b.a.bool,
- tooltip: b.a.node,
- children: b.a.node,
- childIsInput: b.a.bool
- };
- var kf = yc;
- function Nf(e) {
- return (Nf = 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator ? function (e) {
- return typeof e
- }
- : function (e) {
- return e && 'function' == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? 'symbol' : typeof e
- }) (e)
- }
- function Cf(t, e) {
- var n,
- a = Object.keys(t);
- return Object.getOwnPropertySymbols && (n = Object.getOwnPropertySymbols(t), e && (n = n.filter(function (e) {
- return Object.getOwnPropertyDescriptor(t, e).enumerable
- })), a.push.apply(a, n)),
- a
- }
- function Rf(t) {
- for (var e = 1; e < arguments.length; e++) {
- var n = null != arguments[e] ? arguments[e] : {
- };
- e % 2 ? Cf(Object(n), !0).forEach(function (e) {
- If(t, e, n[e])
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(n)) : Cf(Object(n)).forEach(function (e) {
- Object.defineProperty(t, e, Object.getOwnPropertyDescriptor(n, e))
- })
- }
- return t
- }
- function xf(e, t) {
- for (var n = 0; n < t.length; n++) {
- var a = t[n];
- a.enumerable = a.enumerable || !1,
- a.configurable = !0,
- 'value' in a && (a.writable = !0),
- Object.defineProperty(e, a.key, a)
- }
- }
- function Af(e, t) {
- return (Af = Object.setPrototypeOf || function (e, t) {
- return e.__proto__ = t,
- e
- }) (e, t)
- }
- function Df(n) {
- var a = function () {
- if ('undefined' == typeof Reflect || !Reflect.construct) return !1;
- if (Reflect.construct.sham) return !1;
- if ('function' == typeof Proxy) return !0;
- try {
- return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [
- ], function () {
- })),
- !0
- } catch (e) {
- return !1
- }
- }();
- return function () {
- var e,
- t = Tf(n);
- return e = a ? (e = Tf(this).constructor, Reflect.construct(t, arguments, e)) : t.apply(this, arguments),
- t = this,
- !(e = e) || 'object' !== Nf(e) && 'function' != typeof e ? jf(t) : e
- }
- }
- function jf(e) {
- if (void 0 === e) throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called');
- return e
- }
- function Tf(e) {
- return (Tf = Object.setPrototypeOf ? Object.getPrototypeOf : function (e) {
- return e.__proto__ || Object.getPrototypeOf(e)
- }) (e)
- }
- function If(e, t, n) {
- return t in e ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n,
- e
- }
- function qf() {
- return (qf = Object.assign || function (e) {
- for (var t = 1; t < arguments.length; t++) {
- var n,
- a = arguments[t];
- for (n in a) Object.prototype.hasOwnProperty.call(a, n) && (e[n] = a[n])
- }
- return e
- }).apply(this, arguments)
- }
- function Ff(e) {
- return C.a.createElement(Lf, qf({
- }, e, {
- className: 'select__option'.concat(e.className ? ' '.concat(e.className) : '').concat(e.data.icon ? ' has-icon' : '').concat(e.data.tag ? ' has-tag' : '').concat(e.isDisabled ? ' disabled' : ''),
- isDisabled: e.isDisabled
- }), e.data.icon ? C.a.createElement('span', {
- className: 'icon icon-'.concat(e.data.icon)
- }) : null, C.a.createElement('span', {
- style: e.data.style
- }, e.data.label), e.data.tag ? C.a.createElement('span', {
- className: 'select__option-tag',
- style: {
- background: e.data.tag.color
- }
- }, e.data.tag.text) : null)
- }
- var Lf = yl.components.Option;
- Ff.propTypes = {
- className: b.a.string,
- isDisabled: b.a.bool,
- data: b.a.shape({
- label: b.a.string.isRequired,
- key: b.a.oneOfType([b.a.string,
- b.a.number]).isRequired,
- value: b.a.any.isRequired,
- icon: b.a.string,
- tag: b.a.shape({
- text: b.a.string,
- color: b.a.string
- }),
- style: b.a.object
- }).isRequired
- };
- function Uf(e) {
- return C.a.createElement('div', {
- className: 'select__value'.concat(e.data.icon ? ' has-icon' : '').concat(e.data.tag ? ' has-tag' : ''),
- style: e.data.style
- }, e.data.icon ? C.a.createElement('span', {
- className: 'icon icon-'.concat(e.data.icon)
- }) : null, e.data.label, e.data.tag ? C.a.createElement('span', {
- className: 'select__option-tag',
- style: {
- background: e.data.tag.color
- }
- }, e.data.tag.text) : null)
- }
- Uf.propTypes = {
- className: b.a.string,
- data: b.a.shape({
- label: b.a.string.isRequired,
- icon: b.a.string,
- tag: b.a.shape({
- text: b.a.string,
- color: b.a.string
- }),
- style: b.a.object
- }).isRequired
- };
- Pc = function () {
- !function (e, t) {
- if ('function' != typeof t && null !== t) throw new TypeError('Super expression must either be null or a function');
- e.prototype = Object.create(t && t.prototype, {
- constructor: {
- value: e,
- writable: !0,
- configurable: !0
- }
- }),
- t && Af(e, t)
- }(r, A);
- var e,
- t,
- n,
- a = Df(r);
- function r(e) {
- var n;
- return function (e, t) {
- if (!(e instanceof t)) throw new TypeError('Cannot call a class as a function')
- }(this, r),
- If(jf(n = a.call(this, e)), 'getInitialSelection', function () {
- return n.props.value ? n.getOptionByValue(n.props.value) : null
- }),
- If(jf(n), 'getOptionByValue', function (t) {
- var e = n.props.options.filter(function (e) {
- return e.value === t
- });
- return e.length ? e[0] : null
- }),
- If(jf(n), 'handleChange', function (e) {
- e = {
- target: Rf(Rf({
- }, e), {
- }, {
- type: 'select'
- })
- };
- n.props.onChange(e)
- }),
- If(jf(n), 'handleClick', function (e) {
- e.preventDefault(),
- e.stopPropagation()
- }),
- If(jf(n), 'getEstimatedWidth', function (e) {
- e = e.reduce(function (e, t) {
- return e < t.label.length ? t.label.length : e
- }, n.props.placeholder ? n.props.placeholder.length : '');
- return e < 15 ? 175 : 8 * e + 20 + 37
- }),
- n.handleChange = n.handleChange.bind(jf(n)),
- n.getInitialSelection = n.getInitialSelection.bind(jf(n)),
- n.getOptionByValue = n.getOptionByValue.bind(jf(n)),
- n.state = {
- selectedOption: n.getInitialSelection(),
- width: n.props.width || n.getEstimatedWidth(n.props.options)
- },
- n
- }
- return e = r,
- (t = [
- {
- key: 'componentWillReceiveProps',
- value: function (e) {
- this.props.width === e.width && JSON.stringify(this.props.options) === JSON.stringify(e.options) || (this.state.width = this.props.width || this.getEstimatedWidth(e.options))
- }
- },
- {
- key: 'render',
- value: function () {
- var t = this,
- e = ''.concat(this.props.idNamespace || '', '_').concat(this.props.name),
- n = 'select__wrapper'.concat(this.props.inline ? ' inline-select' : '').concat(this.props.className ? ' '.concat(this.props.className) : ''),
- a = 'select__container'.concat(this.props.searchable ? ' searchable' : ''),
- a = C.a.createElement('div', {
- className: n,
- onClick: function (e) {
- return t.handleClick(e)
- },
- style: {
- width: ''.concat(this.state.width, 'px')
- }
- }, C.a.createElement(tf.a, {
- id: e,
- className: a,
- classNamePrefix: 'select',
- options: this.props.options,
- isOptionDisabled: function (e) {
- return e.isDisabled
- },
- value: this.getOptionByValue(this.props.value),
- placeholder: this.props.placeholder,
- components: {
- Option: this.props.customOption || Ff,
- SingleValue: Uf
- },
- onChange: function (e) {
- return t.handleChange(e)
- },
- isDisabled: this.props.readOnly || this.props.disabled,
- isLoading: this.props.loading,
- isSearchable: this.props.searchable || !1,
- isMulti: this.props.multiple
- }));
- return !this.props.inline && this.props.label ? C.a.createElement(kf, {
- label: this.props.label,
- labelId: e,
- tooltip: this.props.tooltip,
- shouldHighlight: this.props.shouldHighlight
- }, a, this.props.children) : this.props.secondaryLabel ? C.a.createElement('div', {
- className: this.props.inline ? 'spacing-right' : 'spacing-bottom'
- }, C.a.createElement('div', {
- className: 'spacing-bottom-small text-semibold'
- }, this.props.label || this.props.secondaryLabel), a) : a
- }
- }
- ]) && xf(e.prototype, t),
- n && xf(e, n),
- r
- }();
- Pc.propTypes = {
- name: b.a.string.isRequired,
- options: b.a.arrayOf(Li).isRequired,
- placeholder: b.a.string,
- value: b.a.node,
- label: b.a.node,
- secondaryLabel: b.a.node,
- disabled: b.a.bool,
- loading: b.a.bool,
- shouldHighlight: b.a.bool,
- onChange: b.a.func.isRequired,
- idNamespace: b.a.string,
- tooltip: b.a.node,
- width: b.a.number,
- customOption: b.a.node,
- className: b.a.string,
- children: b.a.node,
- readOnly: b.a.bool,
- searchable: b.a.bool,
- multiple: b.a.bool,
- inline: b.a.bool
- };
- var Mf = Pc;
- function Bf(e) {
- return (Bf = 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator ? function (e) {
- return typeof e
- }
- : function (e) {
- return e && 'function' == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? 'symbol' : typeof e
- }) (e)
- }
- function zf(t, e) {
- var n,
- a = Object.keys(t);
- return Object.getOwnPropertySymbols && (n = Object.getOwnPropertySymbols(t), e && (n = n.filter(function (e) {
- return Object.getOwnPropertyDescriptor(t, e).enumerable
- })), a.push.apply(a, n)),
- a
- }
- function Hf() {
- return (Hf = Object.assign || function (e) {
- for (var t = 1; t < arguments.length; t++) {
- var n,
- a = arguments[t];
- for (n in a) Object.prototype.hasOwnProperty.call(a, n) && (e[n] = a[n])
- }
- return e
- }).apply(this, arguments)
- }
- function Gf(e, t) {
- for (var n = 0; n < t.length; n++) {
- var a = t[n];
- a.enumerable = a.enumerable || !1,
- a.configurable = !0,
- 'value' in a && (a.writable = !0),
- Object.defineProperty(e, a.key, a)
- }
- }
- function Vf(e, t) {
- return (Vf = Object.setPrototypeOf || function (e, t) {
- return e.__proto__ = t,
- e
- }) (e, t)
- }
- function Wf(n) {
- var a = function () {
- if ('undefined' == typeof Reflect || !Reflect.construct) return !1;
- if (Reflect.construct.sham) return !1;
- if ('function' == typeof Proxy) return !0;
- try {
- return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [
- ], function () {
- })),
- !0
- } catch (e) {
- return !1
- }
- }();
- return function () {
- var e,
- t = Qf(n);
- return e = a ? (e = Qf(this).constructor, Reflect.construct(t, arguments, e)) : t.apply(this, arguments),
- t = this,
- !(e = e) || 'object' !== Bf(e) && 'function' != typeof e ? Yf(t) : e
- }
- }
- function Yf(e) {
- if (void 0 === e) throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called');
- return e
- }
- function Qf(e) {
- return (Qf = Object.setPrototypeOf ? Object.getPrototypeOf : function (e) {
- return e.__proto__ || Object.getPrototypeOf(e)
- }) (e)
- }
- function Kf(e, t, n) {
- return t in e ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n,
- e
- }
- var Jf = Ve.a.getFromCookie(),
- Dc = function () {
- !function (e, t) {
- if ('function' != typeof t && null !== t) throw new TypeError('Super expression must either be null or a function');
- e.prototype = Object.create(t && t.prototype, {
- constructor: {
- value: e,
- writable: !0,
- configurable: !0
- }
- }),
- t && Vf(e, t)
- }(r, A);
- var e,
- t,
- n,
- a = Wf(r);
- function r() {
- var s;
- !function (e, t) {
- if (!(e instanceof t)) throw new TypeError('Cannot call a class as a function')
- }(this, r);
- for (var e = arguments.length, t = Array(e), n = 0; n < e; n++) t[n] = arguments[n];
- return Kf(Yf(s = a.call.apply(a, [
- this
- ].concat(t))), 'state', {
- modelType: 'forum',
- actionGroup: Hm.forum[0].key,
- selectedActions: null,
- idsText: '',
- ids: [
- ],
- progress: 0,
- logs: [
- ],
- selectedLog: null,
- isSaving: !1,
- isSaved: !1
- }),
- Kf(Yf(s), 'getActionPresets', function () {
- return Vm[s.state.modelType]
- }),
- Kf(Yf(s), 'getActionGroup', function (e) {
- return je.a.findWhere(Hm[s.state.modelType], {
- key: e
- })
- }),
- Kf(Yf(s), 'getAction', function (e, t) {
- return je.a.findWhere(Gm[s.state.modelType][t], {
- id: e
- })
- }),
- Kf(Yf(s), 'handleIdsTextareaChange', function (e) {
- s.setState({
- idsText: e.target.value
- })
- }),
- Kf(Yf(s), 'handleIdsTextareaBlur', function () {
- var e = je.a.chain(s.state.idsText.split(',')).map(function (e) {
- return e.replace(/\s/g, '')
- }).filter().uniq().value();
- s.setState({
- ids: e
- })
- }),
- Kf(Yf(s), 'handleActionGroupChange', function (e) {
- s.setState({
- actionGroup: e.target.value
- })
- }),
- Kf(Yf(s), 'handleAddAction', function (e, t) {
- s.handleAddActions([{
- action: e,
- actionGroup: t
- }
- ])
- }),
- Kf(Yf(s), 'handleAddActions', function (e) {
- var a = Hf({
- }, s.state.selectedActions);
- e.forEach(function (e) {
- var t = e.action,
- n = e.actionGroup;
- a[n] || (a[n] = [
- ]);
- e = a[n],
- n = je.a.findIndex(e, function (e) {
- return e.id === t.id
- });
- n < 0 ? e.push(t) : e[n] = t
- }),
- s.setState({
- selectedActions: a
- })
- }),
- Kf(Yf(s), 'handlePreset', function (e) {
- e = e.actions.map(function (e) {
- return {
- action: s.getAction(e.id, e.group),
- actionGroup: e.group
- }
- });
- s.handleAddActions(e)
- }),
- Kf(Yf(s), 'handleUpdateActionValue', function (e, t, n) {
- e.value !== n && s.handleAddAction(Hf({
- }, e, {
- value: n
- }), t)
- }),
- Kf(Yf(s), 'handleRemoveAction', function (t, e) {
- var n = Hf({
- }, s.state.selectedActions);
- n[e] = je.a.reject(n[e], function (e) {
- return e.id === t.id
- }),
- n[e].length || (n = je.a.omit(n, e)),
- s.setState({
- selectedActions: n = !Object.keys(n).length ? null : n
- })
- }),
- Kf(Yf(s), 'handleUpdateClick', function () {
- s.setState({
- isSaving: !0,
- isSaved: !1,
- logs: [
- ],
- progress: 0
- }, function () {
- function i(e, t) {
- return (e || '') + t
- }
- s.state.ids.forEach(function (t) {
- Object.keys(s.state.selectedActions).forEach(function (e) {
- var r = s.getActionGroup(e),
- o = function (t) {
- for (var e = 1; e < arguments.length; e++) {
- var n = null != arguments[e] ? arguments[e] : {
- };
- e % 2 ? zf(Object(n), !0).forEach(function (e) {
- Kf(t, e, n[e])
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(n)) : zf(Object(n)).forEach(function (e) {
- Object.defineProperty(t, e, Object.getOwnPropertyDescriptor(n, e))
- })
- }
- return t
- }({
- }, r.defaultData);
- 'global' !== s.state.modelType && (o[s.state.modelType] = t),
- s.state.selectedActions[e].forEach(function (t) {
- var n,
- a;
- t.isParam || (n = t.key || t.id, t.getRequest ? ((a = {
- forum: o.forum
- }) [t.getRequest.id] = t.value, t.getRequest.params && Object.keys(t.getRequest.params).forEach(function (e) {
- a[e] = t.getRequest.params[e]
- }), s.sendGetRequest(t.getRequest.endpoint, a).then(function (e) {
- o[n] = e.map(function (e) {
- return e.id
- }),
- s.sendRequest(r.endpoint, o)
- })) : (je.a.isArray(t.value) ? o[n] = t.value.map(function (e) {
- return i(t.argPrefix, e.trim())
- }) : o[n] = i(t.argPrefix, t.value), s.sendRequest(r.endpoint, o)))
- })
- })
- })
- })
- }),
- Kf(Yf(s), 'handleModelTypeChanged', function (e) {
- var t = e.target.value,
- n = s.state.actionGroup,
- e = s.state.selectedActions;
- Gm[t][n] || (n = Hm[t][0].key, e = null),
- s.setState({
- ids: 'global' === t ? [
- 'global'
- ] : [
- ],
- modelType: t,
- actionGroup: n,
- selectedActions: e
- })
- }),
- Kf(Yf(s), 'sendGetRequest', function (a, r) {
- return new Promise(function (n) {
- io.a.call(a, {
- data: r,
- method: 'GET'
- }).success(function (t) {
- if (t.cursor.hasPrev || t.cursor.hasNext) {
- if (t.cursor.hasPrev && !t.cursor.hasNext) return n(t.response);
- var e;
- t.cursor.hasNext && (r.cursor = t.cursor.next, e = s.sendGetRequest(a, r).then(function (e) {
- return t.response.concat(e)
- }), n(e))
- } else n(t.response)
- }).fail(function (e) {
- var t;
- try {
- t = JSON.parse(e.responseText)
- } catch (e) {
- t = {
- code: 99,
- response: 'There was an unknown error.'
- }
- }
- s.appendLog(a, r, t)
- })
- })
- }),
- Kf(Yf(s), 'sendRequest', function (n, a) {
- return io.a.call(n, {
- data: a,
- method: 'POST'
- }).done(s.appendLog.bind(Yf(s), n, a)).fail(function (e) {
- var t;
- try {
- t = JSON.parse(e.responseText)
- } catch (e) {
- t = {
- code: 99,
- response: 'There was an unknown error.'
- }
- }
- s.appendLog(n, a, t)
- })
- }),
- Kf(Yf(s), 'appendLog', function (e, t, n) {
- var a = t[s.state.modelType];
- n && 0 === n.code && s.jesterEmit({
- object_type: s.state.modelType,
- object_id: a,
- extra_data: JSON.stringify({
- call: {
- endpoint: e,
- data: t
- }
- })
- });
- t = s.state.logs.concat([{
- id: a,
- data: t,
- endpoint: e,
- status: n
- }
- ]),
- e = t.length / (s.state.ids.length * Object.keys(s.state.selectedActions).length) * 100,
- n = 100 <= e,
- e = {
- logs: t,
- progress: Math.min(100, e),
- isSaved: n,
- isSaving: !n
- };
- n && ('global' !== s.state.modelType && (e.ids = [
- ]), e.idsText = ''),
- s.setState(e)
- }),
- Kf(Yf(s), 'filterAvailableActions', function () {
- var e = Gm[s.state.modelType][s.state.actionGroup];
- if (!s.state.selectedActions) return e;
- var n = s.state.selectedActions[s.state.actionGroup];
- return je.a.filter(e, function (t) {
- return je.a.findIndex(n, function (e) {
- return e.id === t.id
- }) < 0
- })
- }),
- Kf(Yf(s), 'jesterEmit', function (e) {
- e = Hf({
- user_id: Jf.id
- }, Bm, e),
- Bo.a.client.emit(e)
- }),
- Kf(Yf(s), 'renderAvailableActionItem', function (e) {
- return C.a.createElement('div', {
- key: e.id,
- className: 'align align--between align--middle spacing-bottom-small'
- }, C.a.createElement('div', null, C.a.createElement('h4', null, e.label, e.isRequired ? C.a.createElement('em', {
- className: 'text-small text-gray spacing-left-small'
- }, 'Required') : null)), C.a.createElement('div', null, C.a.createElement('button', {
- className: 'button button-sm button-outline text-smallest',
- onClick: s.handleAddAction.bind(Yf(s), e, s.state.actionGroup),
- disabled: s.state.isSaving
- }, C.a.createElement('span', {
- className: 'icon-small icon-plus icon-position'
- }))))
- }),
- Kf(Yf(s), 'renderPresetAction', function (e) {
- return C.a.createElement('div', {
- key: e.id
- }, C.a.createElement('button', {
- className: 'button button-sm button-outline text-smallest',
- onClick: s.handlePreset.bind(Yf(s), e)
- }, e.label))
- }),
- Kf(Yf(s), 'getActionOptions', function (e) {
- var t = e.options.map(function (e) {
- return {
- key: e.id,
- value: e.value || e.id,
- label: e.name
- }
- });
- return t.unshift({
- key: 'default',
- value: null,
- label: e.placeholder
- }),
- t
- }),
- Kf(Yf(s), 'renderSelectedActionInput', function (t, n) {
- switch (t.type) {
- case Mm.text:
- case Mm.number:
- return C.a.createElement('input', {
- type: t.type,
- className: 'input--textbox',
- placeholder: t.placeholder,
- disabled: s.state.isSaving,
- value: t.value,
- onChange: function (e) {
- return s.handleUpdateActionValue(t, n, e.target.value)
- }
- });
- case Mm.multiText:
- return C.a.createElement('textarea', {
- className: 'input--textbox',
- placeholder: t.placeholder,
- disabled: s.state.isSaving,
- value: je.a.isArray(t.value) ? t.value.join(',') : t.value,
- onChange: function (e) {
- return s.handleUpdateActionValue(t, n, e.target.value.split(','))
- }
- });
- case Mm.boolean:
- return C.a.createElement('div', null, C.a.createElement('label', {
- className: 'text-medium fieldset__block--checkbox'
- }, t.description), C.a.createElement('input', {
- name: t.id,
- type: 'radio',
- value: '1',
- checked: '1' === t.value,
- disabled: s.state.isSaving,
- onChange: s.handleUpdateActionValue.bind(Yf(s), t, n, '1')
- }), ' Yes', C.a.createElement('input', {
- name: t.id,
- type: 'radio',
- value: '0',
- checked: '0' === t.value,
- disabled: s.state.isSaving,
- onChange: s.handleUpdateActionValue.bind(Yf(s), t, n, '0'),
- className: 'spacing-left'
- }), ' No');
- case Mm.select:
- return C.a.createElement(Mf, {
- name: 'action',
- value: t.value,
- placeholder: t.placeholder,
- options: s.getActionOptions(t),
- onChange: function (e) {
- return s.handleUpdateActionValue(t, n, e.target.value)
- },
- disabled: s.state.isSaving
- });
- case Mm.date:
- return C.a.createElement(ef, {
- dateWrapperClass: 'bulk-tool__datepicker',
- singleDate: !0,
- singleMonth: !0,
- startDate: Um,
- minDate: Lm,
- maxDate: Um,
- action: t,
- actionGroup: n,
- onDateChange: s.onDateChange
- });
- default:
- return null
- }
- }),
- Kf(Yf(s), 'onDateChange', function (e, t, n) {
- n = ct.a.max(Lm, n).toISOString();
- s.handleUpdateActionValue(e, t, n)
- }),
- Kf(Yf(s), 'renderSelectedActionGroup', function (t) {
- var n = s.getActionGroup(t);
- return C.a.createElement('div', {
- key: n.key,
- className: 'spacing-top'
- }, C.a.createElement('strong', {
- className: 'text-small text-gray'
- }, n.label), s.state.selectedActions[n.key].map(function (e) {
- return C.a.createElement('div', {
- key: e.id,
- className: 'align align--between align--middle spacing-bottom spacing-top-small'
- }, C.a.createElement('div', {
- className: 'align align--middle'
- }, C.a.createElement('div', null, e.label), C.a.createElement('div', {
- className: 'spacing-left'
- }, s.renderSelectedActionInput(e, n.key))), C.a.createElement('div', null, C.a.createElement('button', {
- className: 'button button-sm button-fill--red text-smallest',
- onClick: s.handleRemoveAction.bind(Yf(s), e, t),
- disabled: s.state.isSaving
- }, C.a.createElement('span', {
- className: 'icon-small icon-cancel icon-position'
- }))))
- }))
- }),
- Kf(Yf(s), 'renderStatusLogs', function () {
- return C.a.createElement('div', {
- className: 'content__wrap spacing-bottom is-high-revenue'
- }, C.a.createElement('header', {
- className: 'settings__header'
- }, C.a.createElement('h3', {
- className: 'text-large text-gray-darker spacing-bottom-small'
- }, 'Status'), C.a.createElement('div', {
- className: 'earnings-bar__wrapper spacing-bottom-narrow'
- }, C.a.createElement('div', {
- className: 'earnings-bar__value',
- style: {
- width: ''.concat(s.state.progress, '%')
- }
- }))), C.a.createElement('section', {
- className: 'settings__content'
- }, C.a.createElement('table', {
- style: {
- width: '100%'
- }
- }, C.a.createElement('thead', null, C.a.createElement('tr', null, C.a.createElement('th', null, C.a.createElement('strong', null, 'Id')), C.a.createElement('th', null, C.a.createElement('strong', null, 'Status')))), C.a.createElement('tbody', null, s.state.logs.map(function (e, t) {
- return C.a.createElement('tr', {
- key: ''.concat(e.id, ' ').concat(e.endpoint, ' ').concat(t)
- }, C.a.createElement('td', null, e.id), C.a.createElement('td', null, C.a.createElement('span', {
- style: {
- color: 0 < e.status.code ? 'red' : 'green'
- }
- }, 0 === e.status.code ? 'Success' : 'Failure'), C.a.createElement('button', {
- className: 'button button-link spacing-left-small',
- onClick: function () {
- return s.setState({
- selectedLog: e
- })
- }
- }, 'More Details')))
- })))))
- }),
- s
- }
- return e = r,
- (t = [
- {
- key: 'render',
- value: function () {
- var n = this,
- e = this.state.actionGroup && this.filterAvailableActions();
- return C.a.createElement('div', {
- className: 'layout layout--publishers'
- }, C.a.createElement('div', {
- className: 'layout__main-with-aside'
- }, C.a.createElement('div', {
- className: 'content__wrap spacing-bottom-double'
- }, C.a.createElement('header', {
- className: 'settings__header'
- }, C.a.createElement('h2', {
- className: 'text-larger text-gray-darker spacing-bottom-small'
- }, 'The Incredible Bulk')), C.a.createElement('section', {
- className: 'settings__content'
- }, C.a.createElement(Mf, {
- name: 'modelType',
- className: 'spacing-bottom-narrow',
- value: this.state.modelType,
- options: zm,
- onChange: this.handleModelTypeChanged,
- disabled: this.state.isSaving
- }), 'global' === this.state.modelType ? null : C.a.createElement('textarea', {
- className: 'input--textbox',
- disabled: this.state.isSaving,
- value: this.state.idsText,
- onChange: this.handleIdsTextareaChange,
- onBlur: this.handleIdsTextareaBlur,
- placeholder: 'Enter '.concat('forum' === this.state.modelType ? 'Shortnames' : 'Ids', ' (separated by a comma)')
- })), C.a.createElement('section', {
- className: 'settings__content'
- }, C.a.createElement('h4', {
- className: 'text-large text-gray-darker spacing-bottom-small'
- }, 'Selected Actions'), this.state.selectedActions ? Object.keys(this.state.selectedActions).map(this.renderSelectedActionGroup) : C.a.createElement('em', {
- className: 'text-small text-gray'
- }, 'You haven\'t selected any actions yet.')), C.a.createElement('footer', {
- className: 'settings__footer'
- }, this.state.ids.length ? C.a.createElement('div', {
- className: 'spacing-bottom'
- }, this.state.ids.map(function (e) {
- var t;
- switch (n.state.modelType) {
- case 'forum':
- t = '//'.concat(e, '.').concat(pt.a.disqusHost, '/admin/');
- break;
- case 'organization':
- t = '//'.concat(pt.a.disqusHost, '/admin/orgs/').concat(e, '/slug/')
- }
- return C.a.createElement('a', {
- key: e,
- href: t,
- target: '_blank',
- rel: 'noopener noreferrer',
- className: 'button button-small button-outline spacing-right-small'
- }, e)
- })) : null, C.a.createElement('button', {
- className: 'button button-fill--brand button-padding-wider button-medium',
- disabled: !this.state.selectedActions || this.state.isSaving || !this.state.ids.length,
- onClick: this.handleUpdateClick
- }, 'Process Action'))), this.state.isSaving || this.state.isSaved ? this.renderStatusLogs() : null), C.a.createElement(_.a, {
- isOpen: !!this.state.selectedLog,
- onRequestClose: function () {
- return n.setState({
- selectedLog: null
- })
- },
- className: 'admin-modal -clipped'
- }, C.a.createElement('div', {
- className: 'admin-modal__header align align--between'
- }, C.a.createElement('h3', {
- className: 'text-large'
- }, 'Status Detail')), C.a.createElement('div', {
- className: 'admin-modal__content padding-default'
- }, this.state.selectedLog ? C.a.createElement('div', null, C.a.createElement('strong', null, 'POST:'), ' ', C.a.createElement('a', {
- href: '//'.concat(pt.a.disqusHost, '/api/docs/').concat(this.state.selectedLog.endpoint)
- }, this.state.selectedLog.endpoint), C.a.createElement('div', null, C.a.createElement('pre', {
- className: 'spacing-top'
- }, C.a.createElement('code', null, JSON.stringify(this.state.selectedLog.data, null, ' ')))), C.a.createElement('h4', {
- className: 'spacing-top'
- }, 'Response'), C.a.createElement('div', null, C.a.createElement('pre', {
- className: 'spacing-top'
- }, C.a.createElement('code', null, JSON.stringify(this.state.selectedLog.status, null, ' '))))) : null)), C.a.createElement('div', {
- className: 'layout__aside'
- }, C.a.createElement('div', {
- className: 'content__wrap text-medium'
- }, C.a.createElement('div', {
- className: 'border-bottom padding-default'
- }, C.a.createElement('h3', null, 'Available Actions')), this.getActionPresets().length ? C.a.createElement('div', {
- className: 'padding-default'
- }, C.a.createElement('label', null, 'Presets'), this.getActionPresets().map(this.renderPresetAction)) : null, C.a.createElement('div', {
- className: 'border-bottom padding-default'
- }, C.a.createElement('label', null, 'Action Groups'), C.a.createElement(Mf, {
- name: 'actionGroup',
- value: this.state.actionGroup,
- options: Hm[this.state.modelType].map(function (e) {
- return {
- key: e.key,
- value: e.key,
- label: e.label
- }
- }),
- onChange: this.handleActionGroupChange,
- placeholder: 'Select an action group',
- disabled: this.state.isSaving,
- width: '100%'
- })), C.a.createElement('div', {
- className: 'padding-default'
- }, e && e.length ? e.map(this.renderAvailableActionItem) : C.a.createElement('em', {
- className: 'text-gray text-small'
- }, 'No more available actions')))))
- }
- }
- ]) && Gf(e.prototype, t),
- n && Gf(e, n),
- r
- }();
- function $f(e) {
- return ($f = 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator ? function (e) {
- return typeof e
- }
- : function (e) {
- return e && 'function' == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? 'symbol' : typeof e
- }) (e)
- }
- function Zf(t, e) {
- var n,
- a = Object.keys(t);
- return Object.getOwnPropertySymbols && (n = Object.getOwnPropertySymbols(t), e && (n = n.filter(function (e) {
- return Object.getOwnPropertyDescriptor(t, e).enumerable
- })), a.push.apply(a, n)),
- a
- }
- function Xf(t) {
- for (var e = 1; e < arguments.length; e++) {
- var n = null != arguments[e] ? arguments[e] : {
- };
- e % 2 ? Zf(Object(n), !0).forEach(function (e) {
- oh(t, e, n[e])
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(n)) : Zf(Object(n)).forEach(function (e) {
- Object.defineProperty(t, e, Object.getOwnPropertyDescriptor(n, e))
- })
- }
- return t
- }
- function eh(e, t) {
- for (var n = 0; n < t.length; n++) {
- var a = t[n];
- a.enumerable = a.enumerable || !1,
- a.configurable = !0,
- 'value' in a && (a.writable = !0),
- Object.defineProperty(e, a.key, a)
- }
- }
- function th(e, t) {
- return (th = Object.setPrototypeOf || function (e, t) {
- return e.__proto__ = t,
- e
- }) (e, t)
- }
- function nh(n) {
- var a = function () {
- if ('undefined' == typeof Reflect || !Reflect.construct) return !1;
- if (Reflect.construct.sham) return !1;
- if ('function' == typeof Proxy) return !0;
- try {
- return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [
- ], function () {
- })),
- !0
- } catch (e) {
- return !1
- }
- }();
- return function () {
- var e,
- t = rh(n);
- return e = a ? (e = rh(this).constructor, Reflect.construct(t, arguments, e)) : t.apply(this, arguments),
- t = this,
- !(e = e) || 'object' !== $f(e) && 'function' != typeof e ? ah(t) : e
- }
- }
- function ah(e) {
- if (void 0 === e) throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called');
- return e
- }
- function rh(e) {
- return (rh = Object.setPrototypeOf ? Object.getPrototypeOf : function (e) {
- return e.__proto__ || Object.getPrototypeOf(e)
- }) (e)
- }
- function oh(e, t, n) {
- return t in e ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n,
- e
- }
- Fc = function () {
- !function (e, t) {
- if ('function' != typeof t && null !== t) throw new TypeError('Super expression must either be null or a function');
- e.prototype = Object.create(t && t.prototype, {
- constructor: {
- value: e,
- writable: !0,
- configurable: !0
- }
- }),
- t && th(e, t)
- }(o, A);
- var e,
- t,
- n,
- r = nh(o);
- function o() {
- var e;
- !function (e, t) {
- if (!(e instanceof t)) throw new TypeError('Cannot call a class as a function')
- }(this, o);
- for (var t = arguments.length, n = Array(t), a = 0; a < t; a++) n[a] = arguments[a];
- return oh(ah(e = r.call.apply(r, [
- this
- ].concat(n))), 'graph', C.a.createRef()),
- oh(ah(e), 'getGraphData', function () {
- return {
- x: 'date_utc',
- json: e.props.rows.map(function (e) {
- return Xf(Xf({
- }, e), {
- }, {
- date_utc: e.date_utc.toDate()
- })
- }),
- keys: {
- value: [
- 'date_utc',
- 'comments',
- 'votes'
- ]
- },
- names: {
- comments: 'Comments',
- votes: 'Votes'
- }
- }
- }),
- e
- }
- return e = o,
- (t = [
- {
- key: 'componentDidMount',
- value: function () {
- var e = this.getGraphData();
- this.chart = Ed.a.generate({
- bindto: this.graph.current,
- data: e,
- color: {
- pattern: [
- '#752C85',
- '#8B020E',
- '#E56C00',
- '#FDBE13'
- ]
- },
- transition: {
- duration: 0
- },
- axis: {
- y: {
- min: 0,
- padding: {
- bottom: 0
- }
- },
- x: {
- type: 'timeseries',
- tick: {
- format: this.props.dateColumnConfig.formatter
- }
- }
- },
- size: {
- height: 200
- },
- point: {
- show: !1
- }
- })
- }
- },
- {
- key: 'componentDidUpdate',
- value: function () {
- this.chart.load(this.getGraphData())
- }
- },
- {
- key: 'componentWillUnmount',
- value: function () {
- this.chart && (this.chart = this.chart.destroy())
- }
- },
- {
- key: 'render',
- value: function () {
- return C.a.createElement('div', {
- ref: this.graph
- })
- }
- }
- ]) && eh(e.prototype, t),
- n && eh(e, n),
- o
- }();
- oh(Fc, 'propTypes', {
- dateColumnConfig: b.a.object.isRequired,
- rows: b.a.array
- });
- var ih = Fc,
- Yc = function (e) {
- return C.a.createElement('div', {
- className: ''.concat(e.type, '_box dialog_box admin_content _analytics_comments_').concat(e.className ? ' '.concat(e.className) : '')
- }, C.a.createElement('div', {
- className: ''.concat(e.type, '_box_message dialog_box_message spacing-bottom-small')
- }, C.a.createElement('h2', {
- className: 'text-larger text-gray-darker spacing-bottom'
- }, e.headline), e.message), C.a.createElement('div', {
- className: 'text-semibold'
- }, 'upsell' === e.type ? C.a.createElement(Us, {
- linkClassName: 'button button-small text-medium '.concat(e.type, '_box_button'),
- path: '/settings/subscription/',
- orgId: e.selection.organization.id,
- orgSlug: e.selection.organization.slug,
- onClick: function () {
- return e.emitTrackingEvent({
- verb: 'click',
- object_type: 'button',
- object_id: 'upgrade_options'
- })
- }
- }, C.a.createElement('div', {
- className: 'align align--middle'
- }, C.a.createElement('div', {
- className: 'icon icon-'.concat(e.icon, ' spacing-right')
- }), C.a.createElement('div', null, 'See upgrade options'))) : C.a.createElement('a', {
- className: 'button button-small text-medium '.concat(e.type, '_box_button'),
- href: e.detailsUrl,
- target: '_blank',
- rel: 'noopener noreferrer'
- }, C.a.createElement('div', {
- className: 'align align--middle'
- }, C.a.createElement('div', {
- className: 'icon icon-'.concat(e.icon, ' spacing-right')
- }), C.a.createElement('div', null, e.buttonText)))))
- };
- Yc.displayName = 'DialogBox',
- Yc.propTypes = {
- type: b.a.oneOf(['info',
- 'upsell']).isRequired,
- icon: b.a.string.isRequired,
- headline: b.a.oneOfType([b.a.string,
- b.a.node]).isRequired,
- detailsUrl: b.a.string.isRequired,
- buttonText: b.a.string,
- className: b.a.string,
- message: b.a.node.isRequired,
- selection: ht.isRequired,
- emitTrackingEvent: b.a.func
- };
- var sh = Yc,
- lh = function (e) {
- return C.a.createElement(sh, {
- type: 'upsell',
- icon: 'upgrade-arrow-pro',
- detailsUrl: e.planDetailsUrl,
- message: C.a.createElement(C.a.Fragment, null, e.upsellMessageLeft, ' ', C.a.createElement('a', {
- href: e.planDetailsUrl,
- target: '_blank',
- rel: 'noopener noreferrer'
- }, e.promotionalPlan), e.upsellMessageRight),
- headline: e.headline,
- selection: e.selection,
- className: e.className,
- emitTrackingEvent: e.emitTrackingEvent
- })
- };
- lh.displayName = 'UpsellBox',
- lh.propTypes = {
- headline: b.a.string.isRequired,
- promotionalPlan: b.a.string.isRequired,
- planDetailsUrl: b.a.string.isRequired,
- upsellMessageLeft: b.a.string.isRequired,
- upsellMessageRight: b.a.string.isRequired,
- selection: ht.isRequired,
- emitTrackingEvent: b.a.func.isRequired,
- className: b.a.string
- };
- var ch = lh;
- function uh(e) {
- return (uh = 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator ? function (e) {
- return typeof e
- }
- : function (e) {
- return e && 'function' == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? 'symbol' : typeof e
- }) (e)
- }
- function ph() {
- return (ph = Object.assign || function (e) {
- for (var t = 1; t < arguments.length; t++) {
- var n,
- a = arguments[t];
- for (n in a) Object.prototype.hasOwnProperty.call(a, n) && (e[n] = a[n])
- }
- return e
- }).apply(this, arguments)
- }
- function dh(e, t) {
- for (var n = 0; n < t.length; n++) {
- var a = t[n];
- a.enumerable = a.enumerable || !1,
- a.configurable = !0,
- 'value' in a && (a.writable = !0),
- Object.defineProperty(e, a.key, a)
- }
- }
- function mh(e, t) {
- return (mh = Object.setPrototypeOf || function (e, t) {
- return e.__proto__ = t,
- e
- }) (e, t)
- }
- function fh(n) {
- var a = function () {
- if ('undefined' == typeof Reflect || !Reflect.construct) return !1;
- if (Reflect.construct.sham) return !1;
- if ('function' == typeof Proxy) return !0;
- try {
- return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [
- ], function () {
- })),
- !0
- } catch (e) {
- return !1
- }
- }();
- return function () {
- var e,
- t = gh(n);
- return e = a ? (e = gh(this).constructor, Reflect.construct(t, arguments, e)) : t.apply(this, arguments),
- t = this,
- !(e = e) || 'object' !== uh(e) && 'function' != typeof e ? hh(t) : e
- }
- }
- function hh(e) {
- if (void 0 === e) throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called');
- return e
- }
- function gh(e) {
- return (gh = Object.setPrototypeOf ? Object.getPrototypeOf : function (e) {
- return e.__proto__ || Object.getPrototypeOf(e)
- }) (e)
- }
- function yh(e, t, n) {
- return t in e ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n,
- e
- }
- var bh = [
- {
- key: 'comments',
- name: 'Comments',
- description: 'Number of comments',
- prefix: '',
- suffix: ' comments',
- formatter: Dp.addThousandsSeparator
- },
- {
- key: 'votes',
- name: 'Votes',
- description: 'Number of votes',
- prefix: '',
- suffix: ' votes',
- formatter: Dp.addThousandsSeparator
- }
- ],
- vh = 'month',
- _h = (yh(Vb = {
- }, 'day', 'YYYY-MM-DD'), yh(Vb, vh, 'YYYY-MM'), Vb),
- Eh = ct.a.utc().startOf('day').subtract(1, 'year').add(1, 'day'),
- Oh = ct.a.utc().startOf('day'),
- Sh = {
- zone: 'analytics',
- section: 'comments'
- },
- cu = function () {
- !function (e, t) {
- if ('function' != typeof t && null !== t) throw new TypeError('Super expression must either be null or a function');
- e.prototype = Object.create(t && t.prototype, {
- constructor: {
- value: e,
- writable: !0,
- configurable: !0
- }
- }),
- t && mh(e, t)
- }(r, A);
- var e,
- t,
- n,
- a = fh(r);
- function r() {
- var l;
- !function (e, t) {
- if (!(e instanceof t)) throw new TypeError('Cannot call a class as a function')
- }(this, r);
- for (var e = arguments.length, t = Array(e), n = 0; n < e; n++) t[n] = arguments[n];
- return yh(hh(l = a.call.apply(a, [
- this
- ].concat(t))), 'state', {
- startDate: ct() (l.props.maxDate).subtract(1, 'month').startOf('day'),
- endDate: l.props.maxDate,
- comments: null,
- votes: null,
- loading: !0,
- group: 'day',
- errorCode: null
- }),
- yh(hh(l), 'onFetch', function (e, t, n) {
- l.setState({
- comments: (n = n.response ? n.response : n).comments_series,
- votes: n.votes_series,
- startDate: e,
- endDate: t,
- loading: !1,
- errorCode: null
- })
- }),
- yh(hh(l), 'onError', function (e) {
- l.setState({
- errorCode: e,
- loading: !1
- })
- }),
- yh(hh(l), 'onGroupChange', function (e) {
- l.setState({
- group: e
- })
- }),
- yh(hh(l), 'onDateChange', function (e, t) {
- l.fetchData(e, t)
- }),
- yh(hh(l), 'fetchData', function (e, t) {
- l.setState({
- loading: !0
- });
- var n = e.clone().startOf('month').subtract(1, 'day'),
- a = t.clone().endOf('month').startOf('day'),
- r = br.orgId,
- o = br.shortname,
- a = {
- start: ct.a.max(Eh, n).toISOString(),
- end: ct.a.min(Oh, a).toISOString()
- },
- o = r ? (a = je.a.extend({
- organization: r
- }, a), 'organizations/admin/reports/interactionReport') : (a = je.a.extend({
- forum: o
- }, a), 'forums/admin/reports/interactionReport');
- io.a.call(o, {
- data: a,
- success: je.a.bind(l.onFetch, hh(l), e, t),
- error: l.onError
- })
- }),
- yh(hh(l), 'getRows', function () {
- for (var e = l.state.group, t = l.state.startDate.clone().startOf(e), n = l.state.endDate.clone().endOf(e), a = l.formatDataByInterval(l.state.comments, e), r = l.formatDataByInterval(l.state.votes, e), o = [
- ], i = t; i.isBefore(n); i.add(1, e)) {
- var s = i.format(_h[e]);
- o.push({
- date_utc: i.clone(),
- comments: a[s] || 0,
- votes: r[s] || 0
- })
- }
- t = o.length - 1;
- return l.isRowZero(o[t]) && o.splice(t, 1),
- o
- }),
- yh(hh(l), 'isRowZero', function (e) {
- return 0 === e.comments && 0 === e.votes
- }),
- yh(hh(l), 'formatDataByInterval', function (e, t) {
- if (!e) return [];
- var a = _h[t];
- return je.a.chain(e).reduce(function (e, t) {
- var n = ct.a.utc(t[0]).format(a);
- return e[n] = e[n] ? e[n] + t[1] : t[1],
- e
- }, {
- }).value()
- }),
- yh(hh(l), 'getCardContent', function () {
- var e,
- t = [
- ];
- return l.state.errorCode ? t.push(C.a.createElement(dd, {
- isPermissionError: 22 === l.state.errorCode,
- key: 'error'
- })) : (e = l.state.comments && l.state.votes ? l.getRows() : null) && t.push(C.a.createElement(ih, {
- dateColumnConfig: l.dateColumnConfig,
- rows: e,
- key: 'graph'
- }), C.a.createElement(Qd, ph({
- }, l.state, {
- key: 'table',
- rows: e,
- reverse: !0,
- columnsConfig: bh,
- dateColumnConfig: l.dateColumnConfig
- }))),
- l.state.loading && t.push(C.a.createElement(Ji, {
- key: 'loader'
- })),
- t
- }),
- l
- }
- return e = r,
- (t = [
- {
- key: 'componentWillMount',
- value: function () {
- this.dateColumnConfig = {
- key: 'date_utc',
- name: 'Date (UTC)',
- formatter: je.a.bind(function (e) {
- return 'day' === this.state.group ? ct.a.utc(e).format('MMM Do YYYY') : ct.a.utc(e).format('MMM YYYY')
- }, this)
- },
- this.fetchData(this.state.startDate, this.state.endDate)
- }
- },
- {
- key: 'render',
- value: function () {
- var e = 'Your '.concat(br.orgId ? 'Organization\'s' : 'Site\'s', ' Comment Activity'),
- t = {
- api_key: pt.a.keys.api,
- start: ct.a.utc(this.state.startDate).toISOString(),
- end: ct.a.utc(this.state.endDate).toISOString()
- };
- br.orgId ? (n = 'organizations', t.organization = br.orgId) : br.shortname && (n = 'forums', t.forum = br.shortname);
- var n = io.a.getURL(''.concat(n, '/admin/reports/interactionReport.csv?').concat(vo.a.param(t))),
- t = ql(this.props.selection) && yo.a.isFeatureActive('launch_pro');
- return C.a.createElement('div', null, t ? C.a.createElement(ch, {
- headline: 'Looking for more advanced analytics?',
- promotionalPlan: 'Pro Analytics',
- planDetailsUrl: 'https://help.disqus.com/customer/en/portal/articles/2717193-disqus-pro-analytics',
- upsellMessageLeft: 'Upgrade to',
- upsellMessageRight: ' to better understand your audience and optimize your content strategy. Use Content Analysis to find which stories generate the most engagement.',
- selection: this.props.selection,
- emitTrackingEvent: this.props.emitTrackingEvent
- }) : null, C.a.createElement(Bp, {
- className: 'spacing-bottom basic-analytics',
- leftTitle: e,
- rightTitle: C.a.createElement('div', {
- className: 'card__header-right'
- }, C.a.createElement('a', {
- href: n,
- target: '_blank',
- rel: 'noopener noreferrer',
- className: 'card__header-content-item -button -right text-gray-dark text-semibold'
- }, C.a.createElement('span', {
- className: 'icon-download text-large spacing-right text-gray'
- }), 'Export Data'), C.a.createElement(Zp, {
- dateWrapperClass: 'card__header-datepicker',
- minDate: this.props.minDate,
- maxDate: this.props.maxDate,
- startDate: this.state.startDate,
- endDate: this.state.endDate,
- group: this.state.group,
- onDateChange: this.onDateChange,
- onGroupChange: this.onGroupChange
- }))
- }, this.getCardContent()))
- }
- }
- ]) && dh(e.prototype, t),
- n && dh(e, n),
- r
- }();
- yh(cu, 'propTypes', {
- maxDate: s.moment,
- minDate: s.moment,
- emitTrackingEvent: b.a.func.isRequired,
- emitDefaultViewEvent: b.a.func.isRequired,
- selection: ht.isRequired
- }),
- yh(cu, 'defaultProps', {
- minDate: ct() (ct.a.utc().startOf('day')).subtract(1, 'year').add(1, 'day').startOf('day'),
- maxDate: ct.a.utc().startOf('day')
- });
- var wh = Object(u.connect) (function (e) {
- return {
- selection: e.selection
- }
- }, {
- emitTrackingEvent: Xo(Sh),
- emitDefaultViewEvent: ei(Sh)
- }) (cu),
- Jc = function (e) {
- return C.a.createElement('div', {
- className: 'section-contained-narrower padding-top'
- }, C.a.createElement('div', {
- className: 'layout'
- }, C.a.cloneElement(e.children, {
- user: e.user
- })))
- };
- Jc.displayName = 'ForumCreate',
- Jc.propTypes = {
- children: b.a.node.isRequired,
- user: b.a.shape({
- name: b.a.string.isRequired,
- id: b.a.string.isRequired,
- username: b.a.string.isRequired,
- avatar: b.a.shape({
- cache: b.a.string.isRequired
- }).isRequired
- })
- };
- var Ph = Ni.a.attachDrivers(Jc, [
- rc
- ]),
- kh = n(49),
- Nh = function () {
- return function (t) {
- return io.a.call('forumCategories/list').done(function (e) {
- t({
- type: K.onFetch,
- response: e.response
- })
- })
- }
- },
- vu = function () {
- return function (n) {
- return io.a.call(''.concat(pt.a.urls.cdnCurrent, 'lang/statsP.js'), {
- cache: !0,
- dataType: 'jsonp',
- jsonpCallback: 'updateLanguageList',
- omitDisqusApiKey: !0
- }).done(function (e) {
- var t;
- n({
- type: $.onFetch,
- response: (t = e, Fm.data.map(function (e) {
- return {
- code: e.attributes.code,
- name: e.attributes.name,
- rtl: e.attributes.rtl
- }
- }).filter(function (e) {
- return 'en' === e.code || t[e.code] && 65 <= t[e.code]
- }))
- })
- })
- }
- };
- function Ch(e) {
- return (Ch = 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator ? function (e) {
- return typeof e
- }
- : function (e) {
- return e && 'function' == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? 'symbol' : typeof e
- }) (e)
- }
- function Rh(e, t) {
- for (var n = 0; n < t.length; n++) {
- var a = t[n];
- a.enumerable = a.enumerable || !1,
- a.configurable = !0,
- 'value' in a && (a.writable = !0),
- Object.defineProperty(e, a.key, a)
- }
- }
- function xh(e, t) {
- return (xh = Object.setPrototypeOf || function (e, t) {
- return e.__proto__ = t,
- e
- }) (e, t)
- }
- function Ah(n) {
- var a = function () {
- if ('undefined' == typeof Reflect || !Reflect.construct) return !1;
- if (Reflect.construct.sham) return !1;
- if ('function' == typeof Proxy) return !0;
- try {
- return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [
- ], function () {
- })),
- !0
- } catch (e) {
- return !1
- }
- }();
- return function () {
- var e,
- t = jh(n);
- return e = a ? (e = jh(this).constructor, Reflect.construct(t, arguments, e)) : t.apply(this, arguments),
- t = this,
- !(e = e) || 'object' !== Ch(e) && 'function' != typeof e ? Dh(t) : e
- }
- }
- function Dh(e) {
- if (void 0 === e) throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called');
- return e
- }
- function jh(e) {
- return (jh = Object.setPrototypeOf ? Object.getPrototypeOf : function (e) {
- return e.__proto__ || Object.getPrototypeOf(e)
- }) (e)
- }
- function Th(e, t, n) {
- return t in e ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n,
- e
- }
- Ru = function () {
- !function (e, t) {
- if ('function' != typeof t && null !== t) throw new TypeError('Super expression must either be null or a function');
- e.prototype = Object.create(t && t.prototype, {
- constructor: {
- value: e,
- writable: !0,
- configurable: !0
- }
- }),
- t && xh(e, t)
- }(o, A);
- var e,
- t,
- n,
- r = Ah(o);
- function o() {
- var t;
- !function (e, t) {
- if (!(e instanceof t)) throw new TypeError('Cannot call a class as a function')
- }(this, o);
- for (var e = arguments.length, n = Array(e), a = 0; a < e; a++) n[a] = arguments[a];
- return Th(Dh(t = r.call.apply(r, [
- this
- ].concat(n))), 'state', {
- error: null,
- isSaving: !1,
- isSaved: !1,
- validatedShortname: ''
- }),
- Th(Dh(t), 'handleRegisterForum', function (e) {
- return t.setState({
- isSaving: !0,
- error: null,
- isSaved: !1
- }),
- t.apiCall = io.a.call('forums/create', {
- data: e,
- method: 'POST'
- }).done(t.handleRegisterForumSuccess).fail(t.handleRegisterForumError),
- t.apiCall
- }),
- Th(Dh(t), 'handleSetError', function (e) {
- t.setState({
- error: e
- })
- }),
- Th(Dh(t), 'handleDismissError', function () {
- t.setState({
- error: null
- })
- }),
- Th(Dh(t), 'handleRegisterForumSuccess', function () {
- t.setState({
- error: null,
- isSaving: !1,
- isSaved: !0
- })
- }),
- Th(Dh(t), 'handleRegisterForumError', function (e) {
- t.setState({
- error: t.parseErrorResponse(e),
- isSaving: !1
- })
- }),
- Th(Dh(t), 'handleGenerateShortname', je.a.debounce(function (e) {
- t.getShortnameApiCall && 'pending' === t.getShortnameApiCall.state() && t.getShortnameApiCall.abort(),
- (e = (e || '').trim()).length < Kc ? t.setState({
- validatedShortname: ''
- }) : t.getShortnameApiCall = io.a.call('forums/getAvailableShortname', {
- data: {
- name: e
- }
- }).done(function (e) {
- t.setState({
- validatedShortname: e.response
- })
- }).fail(function () {
- t.setState({
- validatedShortname: t.handleFormatShortname(e)
- })
- })
- }, 500)),
- Th(Dh(t), 'handleFormatShortname', function (e) {
- return e ? e.toLowerCase().replace(/[^a-z0-9-]+/g, '').match(/^.{1,50}/) [0] : ''
- }),
- Th(Dh(t), 'parseErrorResponse', function (e) {
- var t;
- try {
- 'Invalid argument, \'short_name\': This short name has already been taken.' === (t = JSON.parse(e.responseText).response) && (t = 'Your Disqus URL shortname is already taken. Please enter a new one.')
- } catch (e) {
- t = 'There was an error saving your changes.'
- }
- return t
- }),
- Th(Dh(t), 'getComponentProps', function () {
- return {
- forumCreateOnGenerateShortname: t.handleGenerateShortname,
- forumCreateValidatedShortname: t.state.validatedShortname,
- forumCreateOnFormatShortname: t.handleFormatShortname,
- forumCreateError: t.state.error,
- forumCreateIsSaving: t.state.isSaving,
- forumCreateIsSaved: t.state.isSaved,
- forumCreateOnRegister: t.handleRegisterForum,
- forumCreateOnDismissError: t.handleDismissError,
- forumCreateSetError: t.handleSetError
- }
- }),
- t
- }
- return e = o,
- (t = [
- {
- key: 'componentWillUnmount',
- value: function () {
- this.apiCall && 'pending' === this.apiCall.state() && this.apiCall.abort()
- }
- }
- ]) && Rh(e.prototype, t),
- n && Rh(e, n),
- o
- }();
- Th(Ru, 'displayName', 'ForumCreateDriver');
- xu = Object(ki.createDriver) (Ru);
- function Ih(e) {
- return (Ih = 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator ? function (e) {
- return typeof e
- }
- : function (e) {
- return e && 'function' == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? 'symbol' : typeof e
- }) (e)
- }
- function qh(e, t) {
- for (var n = 0; n < t.length; n++) {
- var a = t[n];
- a.enumerable = a.enumerable || !1,
- a.configurable = !0,
- 'value' in a && (a.writable = !0),
- Object.defineProperty(e, a.key, a)
- }
- }
- function Fh(e, t) {
- return (Fh = Object.setPrototypeOf || function (e, t) {
- return e.__proto__ = t,
- e
- }) (e, t)
- }
- function Lh(n) {
- var a = function () {
- if ('undefined' == typeof Reflect || !Reflect.construct) return !1;
- if (Reflect.construct.sham) return !1;
- if ('function' == typeof Proxy) return !0;
- try {
- return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [
- ], function () {
- })),
- !0
- } catch (e) {
- return !1
- }
- }();
- return function () {
- var e,
- t = Uh(n);
- return e = a ? (e = Uh(this).constructor, Reflect.construct(t, arguments, e)) : t.apply(this, arguments),
- t = this,
- !(e = e) || 'object' !== Ih(e) && 'function' != typeof e ? function (e) {
- if (void 0 !== e) return e;
- throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called')
- }(t) : e
- }
- }
- function Uh(e) {
- return (Uh = Object.setPrototypeOf ? Object.getPrototypeOf : function (e) {
- return e.__proto__ || Object.getPrototypeOf(e)
- }) (e)
- }
- function Mh(e, t, n) {
- return t in e ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n,
- e
- }
- Bu = function () {
- !function (e, t) {
- if ('function' != typeof t && null !== t) throw new TypeError('Super expression must either be null or a function');
- e.prototype = Object.create(t && t.prototype, {
- constructor: {
- value: e,
- writable: !0,
- configurable: !0
- }
- }),
- t && Fh(e, t)
- }(r, A);
- var e,
- t,
- n,
- a = Lh(r);
- function r() {
- return function (e, t) {
- if (!(e instanceof t)) throw new TypeError('Cannot call a class as a function')
- }(this, r),
- a.apply(this, arguments)
- }
- return e = r,
- (t = [
- {
- key: 'render',
- value: function () {
- var e = null,
- t = null;
- this.props.isSaved ? (e = 'is-saved', t = 'icon-checkmark') : this.props.isSaving ? (e = 'is-saving', t = 'spinner -sm') : this.props.saveErr && (e = 'save-err', t = 'icon-cancel');
- var n = 'fieldset__label '.concat(e ? ' '.concat(e) : '').concat(this.props.fieldsetAdditionalClass ? ' '.concat(this.props.fieldsetAdditionalClass) : ''),
- e = 'fieldset__block'.concat(this.props.blockAdditionalClass ? ' '.concat(this.props.blockAdditionalClass) : '');
- return C.a.createElement('div', {
- className: 'fieldset fieldset--save'
- }, C.a.createElement('div', {
- className: n
- }, C.a.createElement('div', {
- className: t
- })), C.a.createElement('div', {
- className: e
- }, C.a.createElement('button', {
- id: this.props.id,
- className: 'button button-fill--brand button-padding-wider button-medium',
- disabled: this.props.disabled,
- onClick: this.props.onClick
- }, this.props.buttonLabel), this.props.children))
- }
- }
- ]) && qh(e.prototype, t),
- n && qh(e, n),
- r
- }();
- Mh(Bu, 'defaultProps', {
- buttonLabel: 'Save'
- }),
- Mh(Bu, 'propTypes', {
- id: b.a.string,
- children: b.a.node,
- disabled: b.a.bool,
- onClick: b.a.func,
- isSaving: b.a.bool,
- isSaved: b.a.bool,
- saveErr: b.a.bool,
- buttonLabel: b.a.string,
- fieldsetAdditionalClass: b.a.string,
- blockAdditionalClass: b.a.string
- });
- var Bh = Bu;
- function zh(e) {
- return (zh = 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator ? function (e) {
- return typeof e
- }
- : function (e) {
- return e && 'function' == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? 'symbol' : typeof e
- }) (e)
- }
- function Hh() {
- return (Hh = Object.assign || function (e) {
- for (var t = 1; t < arguments.length; t++) {
- var n,
- a = arguments[t];
- for (n in a) Object.prototype.hasOwnProperty.call(a, n) && (e[n] = a[n])
- }
- return e
- }).apply(this, arguments)
- }
- function Gh(t, e) {
- var n,
- a = Object.keys(t);
- return Object.getOwnPropertySymbols && (n = Object.getOwnPropertySymbols(t), e && (n = n.filter(function (e) {
- return Object.getOwnPropertyDescriptor(t, e).enumerable
- })), a.push.apply(a, n)),
- a
- }
- function Vh(e, t) {
- if (null == e) return {
- };
- var n,
- a = function (e, t) {
- if (null == e) return {
- };
- var n,
- a,
- r = {
- },
- o = Object.keys(e);
- for (a = 0; a < o.length; a++) ~t.indexOf(n = o[a]) || (r[n] = e[n]);
- return r
- }(e, t);
- if (Object.getOwnPropertySymbols) for (var r = Object.getOwnPropertySymbols(e), o = 0; o < r.length; o++) ~t.indexOf(n = r[o]) || Object.prototype.propertyIsEnumerable.call(e, n) && (a[n] = e[n]);
- return a
- }
- function Wh(e, t) {
- for (var n = 0; n < t.length; n++) {
- var a = t[n];
- a.enumerable = a.enumerable || !1,
- a.configurable = !0,
- 'value' in a && (a.writable = !0),
- Object.defineProperty(e, a.key, a)
- }
- }
- function Yh(e, t) {
- return (Yh = Object.setPrototypeOf || function (e, t) {
- return e.__proto__ = t,
- e
- }) (e, t)
- }
- function Qh(n) {
- var a = function () {
- if ('undefined' == typeof Reflect || !Reflect.construct) return !1;
- if (Reflect.construct.sham) return !1;
- if ('function' == typeof Proxy) return !0;
- try {
- return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [
- ], function () {
- })),
- !0
- } catch (e) {
- return !1
- }
- }();
- return function () {
- var e,
- t = Kh(n);
- return e = a ? (e = Kh(this).constructor, Reflect.construct(t, arguments, e)) : t.apply(this, arguments),
- t = this,
- !(e = e) || 'object' !== zh(e) && 'function' != typeof e ? function (e) {
- if (void 0 !== e) return e;
- throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called')
- }(t) : e
- }
- }
- function Kh(e) {
- return (Kh = Object.setPrototypeOf ? Object.getPrototypeOf : function (e) {
- return e.__proto__ || Object.getPrototypeOf(e)
- }) (e)
- }
- function Jh(e, t, n) {
- return t in e ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n,
- e
- }
- Ju = function () {
- !function (e, t) {
- if ('function' != typeof t && null !== t) throw new TypeError('Super expression must either be null or a function');
- e.prototype = Object.create(t && t.prototype, {
- constructor: {
- value: e,
- writable: !0,
- configurable: !0
- }
- }),
- t && Yh(e, t)
- }(r, A);
- var e,
- t,
- n,
- a = Qh(r);
- function r() {
- return function (e, t) {
- if (!(e instanceof t)) throw new TypeError('Cannot call a class as a function')
- }(this, r),
- a.apply(this, arguments)
- }
- return e = r,
- (t = [
- {
- key: 'render',
- value: function () {
- var e = this.props,
- t = e.idNamespace,
- n = e.name,
- a = e.inputState,
- r = e.label,
- o = e.labelAdditionalClass,
- i = e.fieldsetAdditionalClass,
- s = e.showLimit,
- l = e.useTextarea,
- c = e.children,
- u = e.inputOverrideClassName,
- p = e.value,
- d = e.type,
- m = e.shouldHighlight,
- f = e.inline,
- h = e.width,
- g = e.style,
- y = e.autocomplete,
- b = e.inputRef,
- v = e.childIsInput,
- e = Vh(e, [
- 'idNamespace',
- 'name',
- 'inputState',
- 'label',
- 'labelAdditionalClass',
- 'fieldsetAdditionalClass',
- 'showLimit',
- 'useTextarea',
- 'children',
- 'inputOverrideClassName',
- 'value',
- 'type',
- 'shouldHighlight',
- 'inline',
- 'width',
- 'style',
- 'autocomplete',
- 'inputRef',
- 'childIsInput'
- ]),
- n = ''.concat(t || '', '_').concat(n),
- a = 'align__item--grow'.concat('error' === a ? ' is-error' : ''),
- u = ''.concat(u || 'input--textbox').concat(s ? ' resize-vertical show-limit' : ''),
- g = function (t) {
- for (var e = 1; e < arguments.length; e++) {
- var n = null != arguments[e] ? arguments[e] : {
- };
- e % 2 ? Gh(Object(n), !0).forEach(function (e) {
- Jh(t, e, n[e])
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(n)) : Gh(Object(n)).forEach(function (e) {
- Object.defineProperty(t, e, Object.getOwnPropertyDescriptor(n, e))
- })
- }
- return t
- }({
- }, g);
- h && (g.width = ''.concat(h, 'px'));
- p = null === p ? '' : p,
- e = l ? C.a.createElement('textarea', Hh({
- id: n,
- className: u,
- type: 'text',
- value: p,
- style: g,
- autoComplete: y ? 'on' : 'none'
- }, e)) : C.a.createElement('input', Hh({
- id: n,
- className: u,
- value: p,
- type: d,
- style: g,
- autoComplete: y ? 'on' : 'none',
- ref: b
- }, e));
- return f ? C.a.createElement('div', {
- className: 'inline__container'
- }, C.a.createElement('div', {
- className: 'relative__wrapper'
- }, e, C.a.createElement('div', {
- className: 'fieldset__limit'.concat(s ? '' : ' hidden')
- }, (this.props.value || '').length, '/', this.props.maxLength)), c) : C.a.createElement(kf, {
- label: r,
- labelId: n,
- labelAdditionalClass: o,
- fieldsetAdditionalClass: i,
- blockAdditionalClass: a,
- tooltip: this.props.tooltip,
- shouldHighlight: m,
- childIsInput: v
- }, C.a.createElement('div', {
- className: 'relative__wrapper'
- }, e, C.a.createElement('div', {
- className: 'fieldset__limit'.concat(s ? '' : ' hidden')
- }, (this.props.value || '').length, '/', this.props.maxLength)), c)
- }
- }
- ]) && Wh(e.prototype, t),
- n && Wh(e, n),
- r
- }();
- Jh(Ju, 'propTypes', {
- name: b.a.string.isRequired,
- value: b.a.string,
- type: b.a.oneOf(['text',
- 'number']),
- inputState: b.a.oneOf(['none',
- 'error']),
- placeholder: b.a.string,
- label: b.a.node,
- labelAdditionalClass: b.a.string,
- fieldsetAdditionalClass: b.a.string,
- onChange: b.a.func.isRequired,
- idNamespace: b.a.string,
- inputOverrideClassName: b.a.string,
- showLimit: b.a.bool,
- useTextarea: b.a.bool,
- tooltip: b.a.node,
- children: b.a.node,
- disabled: b.a.bool,
- readOnly: b.a.bool,
- shouldHighlight: b.a.bool,
- inline: b.a.bool,
- width: b.a.number,
- style: b.a.objectOf(b.a.oneOfType([b.a.string,
- b.a.number])),
- min: b.a.oneOfType([b.a.number,
- b.a.string]),
- max: b.a.oneOfType([b.a.number,
- b.a.string]),
- maxLength: b.a.oneOfType([b.a.number,
- b.a.string]),
- inputRef: b.a.shape({
- current: b.a.any
- }),
- spellCheck: b.a.bool,
- childIsInput: b.a.bool
- }),
- Jh(Ju, 'defaultProps', {
- type: 'text',
- autocomplete: !0
- });
- var $h = Ju;
- function Zh(e) {
- return (Zh = 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator ? function (e) {
- return typeof e
- }
- : function (e) {
- return e && 'function' == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? 'symbol' : typeof e
- }) (e)
- }
- function Xh(e, t) {
- for (var n = 0; n < t.length; n++) {
- var a = t[n];
- a.enumerable = a.enumerable || !1,
- a.configurable = !0,
- 'value' in a && (a.writable = !0),
- Object.defineProperty(e, a.key, a)
- }
- }
- function eg(e, t) {
- return (eg = Object.setPrototypeOf || function (e, t) {
- return e.__proto__ = t,
- e
- }) (e, t)
- }
- function tg(n) {
- var a = function () {
- if ('undefined' == typeof Reflect || !Reflect.construct) return !1;
- if (Reflect.construct.sham) return !1;
- if ('function' == typeof Proxy) return !0;
- try {
- return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [
- ], function () {
- })),
- !0
- } catch (e) {
- return !1
- }
- }();
- return function () {
- var e,
- t = ag(n);
- return e = a ? (e = ag(this).constructor, Reflect.construct(t, arguments, e)) : t.apply(this, arguments),
- t = this,
- !(e = e) || 'object' !== Zh(e) && 'function' != typeof e ? ng(t) : e
- }
- }
- function ng(e) {
- if (void 0 === e) throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called');
- return e
- }
- function ag(e) {
- return (ag = Object.setPrototypeOf ? Object.getPrototypeOf : function (e) {
- return e.__proto__ || Object.getPrototypeOf(e)
- }) (e)
- }
- function rg(e, t, n) {
- return t in e ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n,
- e
- }
- var Zu = window.navigator,
- og = (Zu.languages && Zu.languages[0] || Zu.language || 'en').split('-') [0],
- cp = {
- zone: 'create',
- section: 'install_new'
- },
- bp = function () {
- !function (e, t) {
- if ('function' != typeof t && null !== t) throw new TypeError('Super expression must either be null or a function');
- e.prototype = Object.create(t && t.prototype, {
- constructor: {
- value: e,
- writable: !0,
- configurable: !0
- }
- }),
- t && eg(e, t)
- }(r, A);
- var e,
- t,
- n,
- a = tg(r);
- function r() {
- var o;
- !function (e, t) {
- if (!(e instanceof t)) throw new TypeError('Cannot call a class as a function')
- }(this, r);
- for (var e = arguments.length, t = Array(e), n = 0; n < e; n++) t[n] = arguments[n];
- return rg(ng(o = a.call.apply(a, [
- this
- ].concat(t))), 'state', {
- name: null,
- shortnameInputVisible: !1,
- customShortname: null,
- customShortnameTaken: !1,
- category: null,
- language: null,
- organization: null
- }),
- rg(ng(o), 'getSelectedLanguage', function (e) {
- e = je.a.find(e, function (e) {
- return e.code.split('_') [0] === og
- });
- return e ? e.code : 'en'
- }),
- rg(ng(o), 'handleCategoryInputChange', function (e) {
- o.setState({
- forumCategory: e.target.value
- })
- }),
- rg(ng(o), 'handleOrganizationInputChange', function (e) {
- o.setState({
- organization: e.target.value
- })
- }),
- rg(ng(o), 'handleNameInputChange', function (e) {
- e = e.target.value;
- o.setState({
- name: e
- }, o.state.shortnameInputVisible ? void 0 : o.props.forumCreateOnGenerateShortname.bind(null, e))
- }),
- rg(ng(o), 'handleShortnameInputChange', function (e) {
- e = o.props.forumCreateOnFormatShortname(e.target.value);
- o.setState({
- customShortname: e,
- customShortnameTaken: !1
- }, o.props.forumCreateOnGenerateShortname.bind(null, e))
- }),
- rg(ng(o), 'handleLanguageInputChange', function (e) {
- o.setState({
- language: e.target.value
- })
- }),
- rg(ng(o), 'handleCustomizeShortnameClick', function (e) {
- e.preventDefault(),
- o.setState({
- shortnameInputVisible: !0
- })
- }),
- rg(ng(o), 'createForum', function () {
- return o.props.forumCreateOnRegister({
- name: o.state.name,
- forumCategory: o.state.forumCategory,
- language: o.state.language,
- short_name: null === o.state.customShortname ? o.props.forumCreateValidatedShortname : o.state.customShortname,
- attach: [
- 'forumNewPolicy'
- ],
- orgID: o.state.organization
- })
- }),
- rg(ng(o), 'navigateToNext', function (e) {
- var t = o.props.location.query.next,
- n = 'https://'.concat(e.response.id, '.').concat(pt.a.disqusHost, '/admin/install/welcome'),
- a = 'https://'.concat(e.response.id, '.').concat(pt.a.disqusHost, '/admin/acknowledge'),
- r = 'https://'.concat(e.response.id, '.').concat(pt.a.disqusHost, '/admin/polls/list');
- 'checkout' === t ? (o.props.updateCheckoutData({
- forum: e.response.id
- }), o.props.history.push(ho.getRoute('/checkout/'))) : 'install' === t ? window.location.assign(n) : 'acknowledge' === t ? window.location.assign(a) : 'polls' === t ? window.location.assign(''.concat(r, '/?').concat(Ur.CHECKOUT_SUCCESS_QUERY_PARAM, '=').concat(Ur.CHECKOUT_SUCCESS_QUERY_PARAM_VALUE_POLLS)) : o.state.organization && window._v5Config.organizations && window._v5Config.organizations[o.state.organization] && window._v5Config.organizations[o.state.organization].pollsOnly ? window.location.assign(r) : o.state.organization ? window.location.assign(n) : window.location.assign(a)
- }),
- rg(ng(o), 'setPlanActivationError', function () {
- o.props.forumCreateSetError(C.a.createElement('span', null, 'There was an error with your activation code. Please try again or email ', C.a.createElement('a', {
- href: 'mailto:cwalkershaw@disqus.com'
- }, 'cwalkershaw@disqus.com'), ' if the issue persists.'))
- }),
- rg(ng(o), 'handleCreateForum', function (e) {
- e.preventDefault();
- var t = o.props.location.query.activationCode;
- return t ? o.props.validateActivationCode(t).done(function (e) {
- return e.response ? o.createForum().done(function (e) {
- return o.props.activatePlan(e.response.organizationId || o.state.organization, t).done(function () {
- return o.navigateToNext(e)
- }).fail(o.setPlanActivationError)
- }) : o.setPlanActivationError()
- }).fail(o.setPlanActivationError) : o.createForum().done(function (e) {
- return o.navigateToNext(e)
- })
- }),
- rg(ng(o), 'handleClickSuggestedShortname', function (e) {
- e.preventDefault(),
- o.setState({
- customShortname: o.props.forumCreateValidatedShortname,
- customShortnameTaken: !1
- })
- }),
- o
- }
- return e = r,
- (t = [
- {
- key: 'componentWillMount',
- value: function () {
- this.props.forumLanguages.length && this.setState({
- language: this.getSelectedLanguage(this.props.forumLanguages)
- })
- }
- },
- {
- key: 'componentDidMount',
- value: function () {
- this.props.fetchForumCategories(),
- this.props.fetchForumLanguages()
- }
- },
- {
- key: 'componentWillReceiveProps',
- value: function (e) {
- var t = {
- },
- n = e.forumCreateValidatedShortname || '',
- n = this.state.shortnameInputVisible && Kc <= n.length && n !== this.state.customShortname;
- n && (t.customShortnameTaken = n),
- this.props.forumLanguages.length || !e.forumLanguages.length || this.state.language || (t.language = this.getSelectedLanguage(e.forumLanguages)),
- this.setState(t)
- }
- },
- {
- key: 'render',
- value: function () {
- var t = this;
- if (!this.props.user) return C.a.createElement(Ji, null);
- var e = this.props.forumCategories.allCategories.map(function (e) {
- return {
- key: e.id,
- value: e.id,
- label: e.name
- }
- }),
- n = this.props.forumLanguages.map(function (e) {
- return {
- key: e.code,
- value: e.code,
- label: e.name
- }
- }),
- a = null === this.state.customShortname ? this.props.forumCreateValidatedShortname : this.state.customShortname,
- r = '//'.concat(pt.a.disqusHost, '/logout/?redirect=').concat(encodeURIComponent(window.location.href)),
- o = C.a.createElement('p', {
- className: 'forum-create__description spacing-top-small'
- }, 'Your unique disqus URL will be: ', C.a.createElement('span', {
- className: 'text-bold'
- }, a || 'shortname'), '.disqus.com', this.state.shortnameInputVisible ? null : C.a.createElement('span', null, C.a.createElement('br', null), C.a.createElement('a', {
- href: '#',
- onClick: this.handleCustomizeShortnameClick
- }, 'Customize Your URL'))),
- i = this.state.shortnameInputVisible ? C.a.createElement('div', {
- className: 'spacing-bottom-large'
- }, C.a.createElement('div', {
- className: 'forum-create__label'
- }, 'Shortname*'), C.a.createElement($h, {
- name: 'customShortname',
- value: a,
- labelAdditionalClass: 'hidden',
- onChange: this.handleShortnameInputChange,
- idNamespace: this.constructor.displayName,
- readOnly: this.props.forumCreateIsSaving,
- disabled: this.props.forumCreateIsSaving,
- placeholder: 'Enter only letters, numbers or hyphens for your subdomain',
- maxLength: '50'
- }, C.a.createElement('div', null, o, this.state.customShortnameTaken ? C.a.createElement('p', {
- className: 'text-violet text-small'
- }, 'This shortname is already registered. Here\'s one that\'s available: ', C.a.createElement('a', {
- href: '#',
- onClick: this.handleClickSuggestedShortname
- }, this.props.forumCreateValidatedShortname)) : null))) : null,
- s = 'en' !== og,
- l = je.a.values(window._v5Config.organizations),
- c = je.a.chain(l).find(function (e) {
- return e.owner === t.props.user.username
- }).value(),
- l = je.a.chain(l).map(function (e, t) {
- return {
- key: t,
- value: e.id,
- label: 'default' === e.slug ? ''.concat(e.owner, '\'s organization') : e.slug
- }
- }).value(),
- a = a && this.state.name && this.state.forumCategory && (!(0 < l.length) || this.state.organization);
- return C.a.createElement('form', {
- id: 'create-forum',
- onSubmit: this.handleCreateForum
- }, C.a.createElement('div', {
- className: 'spacing-bottom-quad'
- }, C.a.createElement('header', {
- className: 'forum-create__header'
- }, C.a.createElement('img', {
- src: '//c.disquscdn.com/next/current/publisher-admin/assets/img/disqus-logo-blue-transparent.png',
- width: '174',
- height: '32',
- alt: 'Disqus',
- title: 'Disqus'
- }), C.a.createElement('h2', {
- className: 'forum-create__header-text'
- }, 'Create a new site')), C.a.createElement('section', {
- className: 'settings__content'
- }, C.a.createElement('div', {
- className: 'spacing-bottom-large'
- }, C.a.createElement(kf, {
- labelAdditionalClass: 'hidden',
- labelId: 'site-owner',
- blockAdditionalClass: '-text text-medium align'
- }, C.a.createElement('div', null, C.a.createElement('div', {
- className: 'forum-create__label'
- }, 'Site owner*'), C.a.createElement('div', {
- className: 'align align--middle'
- }, C.a.createElement('a', {
- href: this.props.user.profileUrl
- }, C.a.createElement('img', {
- src: this.props.user.avatar.cache,
- alt: this.props.user.name,
- className: 'forum-create__avatar'
- })), C.a.createElement('div', {
- className: 'forum-create__username'
- }, this.props.user.name)), C.a.createElement('p', {
- className: 'forum-create__description spacing-top-small'
- }, 'To associate a different account as the site owner,', C.a.createElement('br', null), C.a.createElement('a', {
- href: r
- }, 'login with a different account'))))), 0 < l.length ? C.a.createElement('div', {
- className: 'spacing-bottom-large'
- }, C.a.createElement('div', {
- className: 'forum-create__label'
- }, 'Organization*'), C.a.createElement(kf, {
- labelAdditionalClass: 'hidden',
- blockAdditionalClass: 'text-medium'
- }, C.a.createElement(Mf, {
- name: 'organization',
- options: l,
- placeholder: 'Please select an organization',
- value: this.state.organization,
- onChange: this.handleOrganizationInputChange,
- idNamespace: this.constructor.displayName,
- readOnly: this.props.forumCreateIsSaving,
- disabled: this.props.forumCreateIsSaving,
- width: '100%'
- }), C.a.createElement('p', {
- className: 'forum-create__description spacing-top'
- }, 'The group of sites you own or are an organization admin for.', C.a.createElement('br', null), this.state.organization || c ? C.a.createElement(Us, {
- path: '/settings/general/',
- orgId: this.state.organization || c.id,
- orgSlug: this.state.organization ? je.a.chain(l).find(function (e) {
- if (e.id === t.state.organization) return e.slug
- }).value() : c.slug
- }, this.state.organization ? 'Edit selected organization settings' : 'Edit owned organization settings') : C.a.createElement('a', {
- href: 'https://blog.disqus.com/organizations-better-combined-reporting-for-the-forums-you-own',
- target: '_blank',
- rel: 'noopener noreferrer'
- }, 'Read more about organizations')))) : null, C.a.createElement('div', {
- className: 'spacing-bottom-large'
- }, C.a.createElement('div', {
- className: 'forum-create__label'
- }, 'Website Name*'), C.a.createElement($h, {
- name: 'name',
- value: this.state.name,
- labelAdditionalClass: 'hidden',
- onChange: this.handleNameInputChange,
- idNamespace: this.constructor.displayName,
- readOnly: this.props.forumCreateIsSaving,
- disabled: this.props.forumCreateIsSaving,
- placeholder: 'Enter the name of your site',
- maxLength: '64'
- }, this.state.shortnameInputVisible ? null : o)), i, C.a.createElement('div', {
- className: 'spacing-bottom-large'
- }, C.a.createElement('div', {
- className: 'forum-create__label'
- }, 'Category*'), C.a.createElement(Mf, {
- name: 'category',
- className: 'spacing-top',
- options: e,
- placeholder: 'Please select a category',
- value: this.state.forumCategory,
- labelAdditionalClass: 'hidden',
- onChange: this.handleCategoryInputChange,
- idNamespace: this.constructor.displayName,
- readOnly: this.props.forumCreateIsSaving,
- disabled: !e.length || this.props.forumCreateIsSaving,
- width: '100%'
- })), s ? C.a.createElement('div', {
- className: 'spacing-bottom-large'
- }, C.a.createElement('div', {
- className: 'forum-create__label'
- }, 'Language*'), C.a.createElement(Mf, {
- name: 'language',
- disabled: !n.length,
- options: n,
- placeholder: 'Select a Language',
- value: this.state.language,
- labelAdditionalClass: 'hidden',
- onChange: this.handleLanguageInputChange,
- idNamespace: this.constructor.displayName,
- width: '100%'
- })) : null, this.props.forumCreateError ? C.a.createElement(Ki, {
- message: this.props.forumCreateError,
- onRequestClose: this.props.forumCreateOnDismissError,
- alertType: 'error'
- }) : null), C.a.createElement('footer', {
- className: 'settings__footer'
- }, C.a.createElement(Bh, {
- id: 'admin-create-site',
- disabled: !a,
- isSaving: this.props.forumCreateIsSaving,
- isSaved: this.props.forumCreateIsSaved,
- buttonLabel: 'Create Site',
- blockAdditionalClass: 'forum-create__save-button',
- fieldsetAdditionalClass: 'hidden'
- }), C.a.createElement('div', {
- className: 'forum-create__description text-bold text-center spacing-top'
- }, '*all fields are mandatory'))))
- }
- }
- ]) && Xh(e.prototype, t),
- n && Xh(e, n),
- r
- }();
- rg(bp, 'displayName', 'ForumCreateRegister'),
- rg(bp, 'propTypes', {
- forumCreateOnRegister: b.a.func.isRequired,
- forumCreateOnDismissError: b.a.func.isRequired,
- forumCreateOnGenerateShortname: b.a.func.isRequired,
- forumCreateOnFormatShortname: b.a.func.isRequired,
- forumCreateSetError: b.a.func.isRequired,
- forumCreateValidatedShortname: b.a.string,
- forumCreateError: b.a.string,
- forumCreateIsSaving: b.a.bool,
- forumCreateIsSaved: b.a.bool,
- forumCategories: b.a.shape({
- allCategories: b.a.arrayOf(vl)
- }).isRequired,
- forumLanguages: b.a.arrayOf(xl),
- user: b.a.object,
- emitTrackingEvent: b.a.func.isRequired,
- emitDefaultViewEvent: b.a.func.isRequired,
- fetchForumCategories: b.a.func.isRequired,
- fetchForumLanguages: b.a.func.isRequired,
- activatePollsAdSupported: b.a.func.isRequired,
- history: b.a.shape({
- push: b.a.func.isRequired
- }).isRequired,
- location: kh.locationShape
- });
- var Ap = Object(u.connect) (function (e) {
- return {
- forumCategories: e.forumCategories,
- forumLanguages: e.forumLanguages.languages
- }
- }, {
- emitTrackingEvent: Xo(cp),
- emitDefaultViewEvent: ei(cp),
- fetchForumCategories: Nh,
- fetchForumLanguages: vu,
- updateCheckoutData: ko.updateCheckoutDataFromComponent,
- activatePlan: Yl,
- validateActivationCode: Ql
- }) (Ni.a.attachDrivers(Fo() (bp), [
- xu,
- bc
- ])),
- ig = function () {
- return function (t, e) {
- e = e().selection.forum;
- if (e) return t({
- type: J.fetching
- }),
- io.a.call('forums/details', {
- data: {
- forum: e.shortname,
- attach: [
- 'forumFeatures',
- 'forumForumCategory',
- 'forumIntegration',
- 'forumNewPolicy',
- 'forumPermissions'
- ]
- }
- }).done(function (e) {
- return t({
- type: J.onFetch,
- forumDetails: e.response
- })
- }).fail(function () {
- return t({
- type: J.onError,
- error: 'There was an error retrieving details for this site'
- })
- })
- }
- },
- sg = function (t) {
- return function (e) {
- return e({
- type: J.onUpdate,
- forumDetails: t
- })
- }
- };
- function lg(t, e) {
- var n,
- a = Object.keys(t);
- return Object.getOwnPropertySymbols && (n = Object.getOwnPropertySymbols(t), e && (n = n.filter(function (e) {
- return Object.getOwnPropertyDescriptor(t, e).enumerable
- })), a.push.apply(a, n)),
- a
- }
- function cg(a) {
- for (var e = 1; e < arguments.length; e++) {
- var r = null != arguments[e] ? arguments[e] : {
- };
- e % 2 ? lg(Object(r), !0).forEach(function (e) {
- var t,
- n;
- n = r[t = e],
- t in (e = a) ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(a, Object.getOwnPropertyDescriptors(r)) : lg(Object(r)).forEach(function (e) {
- Object.defineProperty(a, e, Object.getOwnPropertyDescriptor(r, e))
- })
- }
- return a
- }
- function ug(e, t, n) {
- t.selection.forum && n(e = {
- data: cg({
- forum: t.selection.forum.shortname
- }, e)
- })
- }
- i = function (n) {
- return function (t, e) {
- t({
- type: oe.rulesFetching
- }),
- ug(n, e(), function (e) {
- io.a.call('rules/list', e).success(function (e) {
- t({
- type: oe.onFetchRules,
- response: e.response
- })
- })
- })
- }
- },
- c = function (n) {
- return function (t, e) {
- t({
- type: oe.rulesSaving
- }),
- ug(n.data, e(), function (e) {
- io.a.call('rules/modifyRules', cg(cg({
- }, e), {
- }, {
- method: 'POST'
- })).success(function (e) {
- t({
- type: oe.onSaveRules,
- response: e.response
- })
- }).error(function () {
- t({
- type: oe.onSaveRulesError
- })
- })
- })
- }
- };
- function pg(e) {
- return (pg = 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator ? function (e) {
- return typeof e
- }
- : function (e) {
- return e && 'function' == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? 'symbol' : typeof e
- }) (e)
- }
- function dg() {
- return (dg = Object.assign || function (e) {
- for (var t = 1; t < arguments.length; t++) {
- var n,
- a = arguments[t];
- for (n in a) Object.prototype.hasOwnProperty.call(a, n) && (e[n] = a[n])
- }
- return e
- }).apply(this, arguments)
- }
- function mg(t, e) {
- var n,
- a = Object.keys(t);
- return Object.getOwnPropertySymbols && (n = Object.getOwnPropertySymbols(t), e && (n = n.filter(function (e) {
- return Object.getOwnPropertyDescriptor(t, e).enumerable
- })), a.push.apply(a, n)),
- a
- }
- function fg(e, t) {
- for (var n = 0; n < t.length; n++) {
- var a = t[n];
- a.enumerable = a.enumerable || !1,
- a.configurable = !0,
- 'value' in a && (a.writable = !0),
- Object.defineProperty(e, a.key, a)
- }
- }
- function hg(e, t) {
- return (hg = Object.setPrototypeOf || function (e, t) {
- return e.__proto__ = t,
- e
- }) (e, t)
- }
- function gg(n) {
- var a = function () {
- if ('undefined' == typeof Reflect || !Reflect.construct) return !1;
- if (Reflect.construct.sham) return !1;
- if ('function' == typeof Proxy) return !0;
- try {
- return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [
- ], function () {
- })),
- !0
- } catch (e) {
- return !1
- }
- }();
- return function () {
- var e,
- t = bg(n);
- return e = a ? (e = bg(this).constructor, Reflect.construct(t, arguments, e)) : t.apply(this, arguments),
- t = this,
- !(e = e) || 'object' !== pg(e) && 'function' != typeof e ? yg(t) : e
- }
- }
- function yg(e) {
- if (void 0 === e) throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called');
- return e
- }
- function bg(e) {
- return (bg = Object.setPrototypeOf ? Object.getPrototypeOf : function (e) {
- return e.__proto__ || Object.getPrototypeOf(e)
- }) (e)
- }
- function vg(e, t, n) {
- return t in e ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n,
- e
- }
- p = function () {
- !function (e, t) {
- if ('function' != typeof t && null !== t) throw new TypeError('Super expression must either be null or a function');
- e.prototype = Object.create(t && t.prototype, {
- constructor: {
- value: e,
- writable: !0,
- configurable: !0
- }
- }),
- t && hg(e, t)
- }(o, A);
- var e,
- t,
- n,
- r = gg(o);
- function o() {
- var n;
- !function (e, t) {
- if (!(e instanceof t)) throw new TypeError('Cannot call a class as a function')
- }(this, o);
- for (var e = arguments.length, t = Array(e), a = 0; a < e; a++) t[a] = arguments[a];
- return vg(yg(n = r.call.apply(r, [
- this
- ].concat(t))), 'state', {
- error: null,
- isSaving: !1,
- isFetching: !1,
- isValidating: !1
- }),
- vg(yg(n), 'validateForum', function (e) {
- n.setState({
- isValidating: !0
- }),
- n.props.selection.forum && (e = function (t) {
- for (var e = 1; e < arguments.length; e++) {
- var n = null != arguments[e] ? arguments[e] : {
- };
- e % 2 ? mg(Object(n), !0).forEach(function (e) {
- vg(t, e, n[e])
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(n)) : mg(Object(n)).forEach(function (e) {
- Object.defineProperty(t, e, Object.getOwnPropertyDescriptor(n, e))
- })
- }
- return t
- }({
- forum: n.props.selection.forum.shortname
- }, e)),
- n.apiCall = io.a.call('forums/validate', {
- data: e
- }).done(n.handleValidateForumSuccess).fail(n.handleApiCallFail).always(n.handleValidateForumComplete)
- }),
- vg(yg(n), 'handleSaveForum', function (e, t) {
- return n.setState({
- isSaving: !0,
- error: null,
- isSaved: !1
- }),
- n.props.selection.forum && (e = dg({
- forum: n.props.selection.forum.shortname
- }, e)),
- n.apiCall = io.a.call(t && t.useInternal ? 'internal/forums/update' : 'forums/update', {
- data: e,
- method: 'POST'
- }).done(n.handleSaveForumSuccess).fail(n.handleApiCallFail).always(n.handleSaveForumComplete),
- n.apiCall
- }),
- vg(yg(n), 'handleDisableAds', function () {
- return n.setState({
- isSaving: !0,
- error: null,
- isSaved: !1
- }),
- n.apiCall = io.a.call('forums/disableAds', {
- data: {
- forum: n.props.selection.forum.shortname
- },
- method: 'POST'
- }).done(n.handleSaveForumSuccess).fail(n.handleApiCallFail).always(n.handleSaveForumComplete),
- n.apiCall
- }),
- vg(yg(n), 'handleValidateForumSuccess', function (e) {
- n.setState({
- error: e.response && e.response[0] || null
- })
- }),
- vg(yg(n), 'handleValidateForumComplete', function () {
- n.setState({
- isValidating: !1
- })
- }),
- vg(yg(n), 'handleDismissError', function () {
- n.setState({
- error: null
- })
- }),
- vg(yg(n), 'handleSaveForumComplete', function () {
- n.setState({
- isSaving: !1
- })
- }),
- vg(yg(n), 'handleSaveForumSuccess', function (e) {
- n.props.updateForumDetails(e.response),
- n.setState({
- error: null,
- isSaved: !0
- })
- }),
- vg(yg(n), 'handleApiCallFail', function (e) {
- n.setState({
- error: n.parseErrorResponse(e)
- })
- }),
- vg(yg(n), 'parseErrorResponse', function (e) {
- var t;
- try {
- ~(t = JSON.parse(e.responseText).response).indexOf('Invalid argument, \'website\': Invalid URL') && (t = 'Invalid URL entered for your website. It should be the full address of your home page, e.g. http://example.com')
- } catch (e) {
- t = 'There was an error saving your changes.'
- }
- return t
- }),
- vg(yg(n), 'getComponentProps', function () {
- return {
- forumUpdateError: n.state.error,
- forumUpdateIsSaving: n.state.isSaving,
- forumUpdateIsSaved: n.state.isSaved,
- forumUpdateIsValidating: n.state.isValidating,
- forumUpdateValidate: n.validateForum,
- forumUpdateOnSave: n.handleSaveForum,
- forumUpdateOnDisableAds: n.handleDisableAds,
- forumUpdateOnDismissError: n.handleDismissError
- }
- }),
- n
- }
- return e = o,
- (t = [
- {
- key: 'componentWillUnmount',
- value: function () {
- this.apiCall && 'pending' === this.apiCall.state() && this.apiCall.abort()
- }
- }
- ]) && fg(e.prototype, t),
- n && fg(e, n),
- o
- }();
- vg(p, 'displayName', 'ForumUpdateDriver'),
- vg(p, 'propTypes', {
- selection: ht.isRequired
- });
- m = Object(ki.createDriver) (p, function (e) {
- return {
- selection: e.selection
- }
- }, {
- updateForumDetails: sg
- }),
- h = function (e) {
- var t = e.hasOwnProperty('iconClassName') ? e.iconClassName : 'icon-right-bracket',
- n = e.linkActiveClassName || 'active';
- return !e.showIf || e.showIf(e) ? C.a.createElement(Uo, {
- linkClassName: e.linkClassName,
- path: e.path,
- selection: e.selection,
- activeRoutes: e.activeRoutes,
- onlyActiveOnIndex: e.onlyActiveOnIndex,
- linkActiveClassName: n
- }, C.a.createElement('div', {
- className: 'nav-lnk -color-muted'
- }, C.a.createElement('div', {
- className: 'nav-lnk__blk'
- }, C.a.createElement('span', {
- className: 'button__text'
- }, e.label)), C.a.createElement('div', {
- className: 'nav-lnk__pointer'
- }, C.a.createElement('span', {
- className: 'icon '.concat(t)
- })))) : null
- };
- h.propTypes = {
- selection: b.a.object.isRequired,
- linkClassName: b.a.string.isRequired,
- path: b.a.string.isRequired,
- label: b.a.string.isRequired,
- activeRoutes: b.a.arrayOf(b.a.string),
- iconClassName: b.a.string,
- showIf: b.a.func,
- onlyActiveOnIndex: b.a.bool,
- linkActiveClassName: b.a.string
- };
- var _g = h;
- function Eg(e) {
- return (Eg = 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator ? function (e) {
- return typeof e
- }
- : function (e) {
- return e && 'function' == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? 'symbol' : typeof e
- }) (e)
- }
- function Og(e, t) {
- if (null == e) return {
- };
- var n,
- a = function (e, t) {
- if (null == e) return {
- };
- var n,
- a,
- r = {
- },
- o = Object.keys(e);
- for (a = 0; a < o.length; a++) ~t.indexOf(n = o[a]) || (r[n] = e[n]);
- return r
- }(e, t);
- if (Object.getOwnPropertySymbols) for (var r = Object.getOwnPropertySymbols(e), o = 0; o < r.length; o++) ~t.indexOf(n = r[o]) || Object.prototype.propertyIsEnumerable.call(e, n) && (a[n] = e[n]);
- return a
- }
- function Sg() {
- return (Sg = Object.assign || function (e) {
- for (var t = 1; t < arguments.length; t++) {
- var n,
- a = arguments[t];
- for (n in a) Object.prototype.hasOwnProperty.call(a, n) && (e[n] = a[n])
- }
- return e
- }).apply(this, arguments)
- }
- function wg(e, t) {
- for (var n = 0; n < t.length; n++) {
- var a = t[n];
- a.enumerable = a.enumerable || !1,
- a.configurable = !0,
- 'value' in a && (a.writable = !0),
- Object.defineProperty(e, a.key, a)
- }
- }
- function Pg(e, t) {
- return (Pg = Object.setPrototypeOf || function (e, t) {
- return e.__proto__ = t,
- e
- }) (e, t)
- }
- function kg(n) {
- var a = function () {
- if ('undefined' == typeof Reflect || !Reflect.construct) return !1;
- if (Reflect.construct.sham) return !1;
- if ('function' == typeof Proxy) return !0;
- try {
- return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [
- ], function () {
- })),
- !0
- } catch (e) {
- return !1
- }
- }();
- return function () {
- var e,
- t = Cg(n);
- return e = a ? (e = Cg(this).constructor, Reflect.construct(t, arguments, e)) : t.apply(this, arguments),
- t = this,
- !(e = e) || 'object' !== Eg(e) && 'function' != typeof e ? Ng(t) : e
- }
- }
- function Ng(e) {
- if (void 0 === e) throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called');
- return e
- }
- function Cg(e) {
- return (Cg = Object.setPrototypeOf ? Object.getPrototypeOf : function (e) {
- return e.__proto__ || Object.getPrototypeOf(e)
- }) (e)
- }
- function Rg(e, t, n) {
- return t in e ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n,
- e
- }
- var xg = {
- welcome: 1,
- platforms: 2,
- settings: 3,
- moderation: 4,
- complete: 5
- },
- y = function () {
- !function (e, t) {
- if ('function' != typeof t && null !== t) throw new TypeError('Super expression must either be null or a function');
- e.prototype = Object.create(t && t.prototype, {
- constructor: {
- value: e,
- writable: !0,
- configurable: !0
- }
- }),
- t && Pg(e, t)
- }(o, A);
- var e,
- t,
- n,
- r = kg(o);
- function o() {
- var a;
- !function (e, t) {
- if (!(e instanceof t)) throw new TypeError('Cannot call a class as a function')
- }(this, o);
- for (var e = arguments.length, t = Array(e), n = 0; n < e; n++) t[n] = arguments[n];
- return Rg(Ng(a = r.call.apply(r, [
- this
- ].concat(t))), 'getCurrentPageStep', function () {
- var e = a.props.location.pathname.match(/\/install\/([^/]+)/);
- return e && e[1] ? xg[e[1]] : xg.platforms
- }),
- Rg(Ng(a), 'renderSubTabs', function (e) {
- var n = 'nav__item nav__item--subitem dropdown-open';
- return e.map(function (e) {
- if (e.isMockNav) {
- var t = a.props.history.isActive(e.isActivePath);
- return C.a.createElement('div', {
- className: n += t ? ' active' : '',
- disabled: !t,
- key: e.label
- }, C.a.createElement('div', {
- className: 'nav-lnk -color-muted'
- }, C.a.createElement('div', {
- className: 'nav-lnk__blk'
- }, C.a.createElement('span', {
- className: 'button__text'
- }, e.label))))
- }
- return C.a.createElement(_g, Sg({
- selection: a.props.selection,
- linkClassName: n,
- iconClassName: ''
- }, e, {
- key: e.label
- }))
- })
- }),
- a
- }
- return e = o,
- (t = [
- {
- key: 'render',
- value: function () {
- var s = this,
- e = [
- {
- path: '/install/welcome/',
- label: '1. Welcome',
- step: xg.welcome
- },
- {
- path: '/install/',
- label: '2. Install Disqus',
- step: xg.platforms,
- subTabs: [
- {
- path: '/install/',
- label: 'Select Platform',
- onlyActiveOnIndex: !0
- },
- {
- label: 'Install Instructions',
- isMockNav: !0,
- isActivePath: '/install/platforms/'
- }
- ]
- },
- {
- path: '/install/settings/',
- label: '3. Configure Disqus',
- step: xg.settings
- },
- {
- path: '/install/moderation/',
- label: '4. Setup Moderation',
- step: xg.moderation
- }
- ];
- if (this.props.selection.type !== ft.forum) return C.a.createElement('nav', {
- className: 'layout__nav'
- }, C.a.createElement('div', {
- className: 'nav-dropdown'
- }, C.a.createElement(Uo, {
- path: e[0].path,
- selection: this.props.selection,
- linkClassName: 'button button-fill--brand text-medium button-wide hidden-md spacing-bottom-small'
- }, C.a.createElement('span', {
- className: 'icon-switch icon__position text-smaller spacing-right-small'
- }), 'Pick a Site'), C.a.createElement('a', {
- className: 'button button-fill--brand text-medium button-wide hidden-md',
- href: '/admin/create/'
- }, C.a.createElement('span', {
- className: 'icon-plus icon__position text-smaller spacing-right-small'
- }), 'Create a Site')));
- e = e.map(function (e) {
- var t = e.step,
- n = e.subTabs,
- a = Og(e, [
- 'step',
- 'subTabs'
- ]),
- r = [
- ],
- o = 'icon-right-bracket',
- i = 'nav__item dropdown-open';
- return t === s.getCurrentPageStep() && n && (r = s.renderSubTabs(e.subTabs)),
- n && (a.linkActiveClassName = ' '),
- t < s.getCurrentPageStep() && (i += ' nav__item--completed', o = 'icon-checkmark'),
- [
- C.a.createElement(_g, Sg({
- selection: s.props.selection,
- linkClassName: i,
- iconClassName: o,
- key: e.label
- }, a)),
- r
- ]
- });
- return C.a.createElement('nav', {
- className: 'layout__nav'
- }, C.a.createElement('div', {
- className: 'nav-dropdown'
- }, e))
- }
- }
- ]) && wg(e.prototype, t),
- n && wg(e, n),
- o
- }();
- Rg(y, 'displayName', 'ForumInstallNav'),
- Rg(y, 'propTypes', {
- location: b.a.object.isRequired,
- history: b.a.shape({
- isActive: b.a.func.isRequired
- }).isRequired,
- selection: ht.isRequired
- });
- var Ag = Fo() (y),
- D = function () {
- return function () {
- var e,
- t,
- a = window.Intercom;
- 'function' == typeof a ? a('reattach_activator') : ((a = window.Intercom = function () {
- for (var e = arguments.length, t = Array(e), n = 0; n < e; n++) t[n] = arguments[n];
- a.callback(t)
- }).queue = [
- ], a.callback = function (e) {
- a.queue.push(e)
- }, (e = window.document.createElement('script')).src = 'https://widget.intercom.io/widget/'.concat(pt.a.intercomAppId), e.async = !0, (t = window.document.getElementsByTagName('script') [0]).parentNode.insertBefore(e, t))
- }
- },
- I = function (a) {
- return function (e, t) {
- var n;
- a && (t = (n = t().selection).forum, n = n.organization, window.intercomSettings = {
- app_id: pt.a.intercomAppId,
- name: a.username,
- email: a.email,
- user_id: a.id,
- shortname: t && t.shortname || null,
- website: t && t.website || null,
- organization: n && n.id || null
- }, (n = window.Intercom) ('boot', window.intercomSettings), n('show'))
- }
- },
- F = function () {
- return function () {
- window.Intercom && (window.Intercom('shutdown'), delete window.Intercom)
- }
- };
- function Dg(e) {
- return (Dg = 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator ? function (e) {
- return typeof e
- }
- : function (e) {
- return e && 'function' == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? 'symbol' : typeof e
- }) (e)
- }
- function jg(e, t) {
- for (var n = 0; n < t.length; n++) {
- var a = t[n];
- a.enumerable = a.enumerable || !1,
- a.configurable = !0,
- 'value' in a && (a.writable = !0),
- Object.defineProperty(e, a.key, a)
- }
- }
- function Tg(e, t) {
- return (Tg = Object.setPrototypeOf || function (e, t) {
- return e.__proto__ = t,
- e
- }) (e, t)
- }
- function Ig(n) {
- var a = function () {
- if ('undefined' == typeof Reflect || !Reflect.construct) return !1;
- if (Reflect.construct.sham) return !1;
- if ('function' == typeof Proxy) return !0;
- try {
- return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [
- ], function () {
- })),
- !0
- } catch (e) {
- return !1
- }
- }();
- return function () {
- var e,
- t = Fg(n);
- return e = a ? (e = Fg(this).constructor, Reflect.construct(t, arguments, e)) : t.apply(this, arguments),
- t = this,
- !(e = e) || 'object' !== Dg(e) && 'function' != typeof e ? qg(t) : e
- }
- }
- function qg(e) {
- if (void 0 === e) throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called');
- return e
- }
- function Fg(e) {
- return (Fg = Object.setPrototypeOf ? Object.getPrototypeOf : function (e) {
- return e.__proto__ || Object.getPrototypeOf(e)
- }) (e)
- }
- function Lg(e, t, n) {
- return t in e ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n,
- e
- }
- lt = function () {
- !function (e, t) {
- if ('function' != typeof t && null !== t) throw new TypeError('Super expression must either be null or a function');
- e.prototype = Object.create(t && t.prototype, {
- constructor: {
- value: e,
- writable: !0,
- configurable: !0
- }
- }),
- t && Tg(e, t)
- }(o, A);
- var e,
- t,
- n,
- r = Ig(o);
- function o() {
- var e;
- !function (e, t) {
- if (!(e instanceof t)) throw new TypeError('Cannot call a class as a function')
- }(this, o);
- for (var t = arguments.length, n = Array(t), a = 0; a < t; a++) n[a] = arguments[a];
- return Lg(qg(e = r.call.apply(r, [
- this
- ].concat(n))), 'componentWillMount', function () {
- e.props.addIntercomScript()
- }),
- Lg(qg(e), 'componentWillUnmount', function () {
- e.props.removeIntercomScript()
- }),
- Lg(qg(e), 'handleClick', function () {
- e.props.intercomInitWithUser(e.props.user)
- }),
- e
- }
- return e = o,
- (t = [
- {
- key: 'render',
- value: function () {
- return C.a.createElement('button', {
- onClick: this.handleClick,
- className: 'button button-large button-fill--brand text-medium spacing-narrow spacing-right',
- disabled: !this.props.user
- }, this.props.children)
- }
- }
- ]) && jg(e.prototype, t),
- n && jg(e, n),
- o
- }();
- Lg(lt, 'displayName', 'IntercomButton'),
- Lg(lt, 'propTypes', {
- children: b.a.node,
- addIntercomScript: b.a.func.isRequired,
- intercomInitWithUser: b.a.func.isRequired,
- removeIntercomScript: b.a.func.isRequired,
- user: b.a.shape({
- id: b.a.string.isRequired,
- username: b.a.string.isRequired,
- email: b.a.string.isRequired,
- name: b.a.string.isRequired
- })
- });
- function Ug() {
- return C.a.createElement('div', {
- className: 'content__wrap text-center padding-default'
- }, C.a.createElement('p', {
- className: 'text-large spacing-narrow spacing-bottom'
- }, C.a.createElement('strong', null, 'Having trouble with installation?')), yo.a.isFeatureActive('intercomEnabled') ? C.a.createElement(Mg, null, 'Talk to Support') : C.a.createElement('a', {
- href: Pn.contactSupport,
- className: 'button button-large button-fill--brand text-medium spacing-narrow spacing-right',
- target: '_blank',
- rel: 'noopener noreferrer'
- }, 'Contact Support'))
- }
- var Mg = Object(u.connect) (null, {
- addIntercomScript: D,
- intercomInitWithUser: I,
- removeIntercomScript: F
- }) (Ni.a.attachDrivers(lt, [
- rc
- ])),
- ut = function (e) {
- return e.forceEnable || yo.a.isFeatureActive('subscription_intercom') ? C.a.createElement('div', {
- className: 'content__wrap text-center spacing-bottom padding-default'
- }, C.a.createElement('p', {
- className: 'text-large spacing-narrow spacing-bottom'
- }, C.a.createElement('strong', null, 'Have questions about our subscription plans?')), C.a.createElement(Mg, null, 'Chat with Support')) : null
- };
- ut.propTypes = {
- forceEnable: b.a.bool
- };
- var Bg = ut;
- function zg(e) {
- return (zg = 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator ? function (e) {
- return typeof e
- }
- : function (e) {
- return e && 'function' == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? 'symbol' : typeof e
- }) (e)
- }
- function Hg() {
- return (Hg = Object.assign || function (e) {
- for (var t = 1; t < arguments.length; t++) {
- var n,
- a = arguments[t];
- for (n in a) Object.prototype.hasOwnProperty.call(a, n) && (e[n] = a[n])
- }
- return e
- }).apply(this, arguments)
- }
- function Gg(t, e) {
- var n,
- a = Object.keys(t);
- return Object.getOwnPropertySymbols && (n = Object.getOwnPropertySymbols(t), e && (n = n.filter(function (e) {
- return Object.getOwnPropertyDescriptor(t, e).enumerable
- })), a.push.apply(a, n)),
- a
- }
- function Vg(t) {
- for (var e = 1; e < arguments.length; e++) {
- var n = null != arguments[e] ? arguments[e] : {
- };
- e % 2 ? Gg(Object(n), !0).forEach(function (e) {
- $g(t, e, n[e])
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(n)) : Gg(Object(n)).forEach(function (e) {
- Object.defineProperty(t, e, Object.getOwnPropertyDescriptor(n, e))
- })
- }
- return t
- }
- function Wg(e, t) {
- for (var n = 0; n < t.length; n++) {
- var a = t[n];
- a.enumerable = a.enumerable || !1,
- a.configurable = !0,
- 'value' in a && (a.writable = !0),
- Object.defineProperty(e, a.key, a)
- }
- }
- function Yg(e, t) {
- return (Yg = Object.setPrototypeOf || function (e, t) {
- return e.__proto__ = t,
- e
- }) (e, t)
- }
- function Qg(n) {
- var a = function () {
- if ('undefined' == typeof Reflect || !Reflect.construct) return !1;
- if (Reflect.construct.sham) return !1;
- if ('function' == typeof Proxy) return !0;
- try {
- return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [
- ], function () {
- })),
- !0
- } catch (e) {
- return !1
- }
- }();
- return function () {
- var e,
- t = Jg(n);
- return e = a ? (e = Jg(this).constructor, Reflect.construct(t, arguments, e)) : t.apply(this, arguments),
- t = this,
- !(e = e) || 'object' !== zg(e) && 'function' != typeof e ? Kg(t) : e
- }
- }
- function Kg(e) {
- if (void 0 === e) throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called');
- return e
- }
- function Jg(e) {
- return (Jg = Object.setPrototypeOf ? Object.getPrototypeOf : function (e) {
- return e.__proto__ || Object.getPrototypeOf(e)
- }) (e)
- }
- function $g(e, t, n) {
- return t in e ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n,
- e
- }
- Sn = function () {
- !function (e, t) {
- if ('function' != typeof t && null !== t) throw new TypeError('Super expression must either be null or a function');
- e.prototype = Object.create(t && t.prototype, {
- constructor: {
- value: e,
- writable: !0,
- configurable: !0
- }
- }),
- t && Yg(e, t)
- }(o, A);
- var e,
- t,
- n,
- a = Qg(o);
- function o() {
- var r;
- !function (e, t) {
- if (!(e instanceof t)) throw new TypeError('Cannot call a class as a function')
- }(this, o);
- for (var e = arguments.length, t = Array(e), n = 0; n < e; n++) t[n] = arguments[n];
- return $g(Kg(r = a.call.apply(a, [
- this
- ].concat(t))), 'state', {
- settings: o.getEditableFieldsFromForum(r.props.forumDetails),
- settingsChanged: !1,
- rules: {
- },
- rulesChanged: !1
- }),
- $g(Kg(r), 'updateSettingsState', function (e) {
- r.setState({
- settings: Vg(Vg({
- }, r.state.settings), e),
- settingsChanged: !0
- })
- }),
- $g(Kg(r), 'updateRulesState', function (e) {
- r.setState({
- rules: r.getUpdatedRules(e),
- rulesChanged: !0
- })
- }),
- $g(Kg(r), 'getUpdatedRules', function (e) {
- var n = [
- ],
- a = Hg({
- }, e);
- return r.props.rules.forEach(function (e) {
- var t;
- a[e.filter] && (t = a[e.filter], delete a[e.filter], n.push({
- rule: e.id,
- filterName: t.filter,
- action: t.action,
- order: e.order,
- enabled: !0
- }))
- }),
- {
- newRules: Object.values(a).map(function (e, t) {
- return {
- filterName: e.filter,
- action: e.action,
- order: n.length + t,
- enabled: !0
- }
- }),
- updatedRules: n
- }
- }),
- $g(Kg(r), 'handleSaveSettings', function () {
- return r.props.forumUpdateOnSave({
- name: r.state.settings.name,
- website: r.state.settings.website,
- forumCategory: r.state.settings.category,
- description: r.state.settings.description,
- colorScheme: r.state.settings.colorScheme,
- typeface: r.state.settings.typeface,
- translationLanguage: r.state.settings.language,
- commentPolicyLink: r.state.settings.commentPolicyLink,
- commentPolicyText: r.state.settings.commentPolicyText,
- unapproveLinks: r.state.settings.unapproveLinks,
- mediaembedEnabled: r.state.settings.mediaembedEnabled,
- allowAnonPost: r.state.settings.allowAnonPost,
- flaggingEnabled: r.state.settings.flaggingEnabled,
- flagThreshold: r.state.settings.flagThreshold,
- daysThreadAlive: r.state.settings.daysThreadAlive,
- installCompleted: 1
- }).done(r.setState.bind(Kg(r), {
- settingsChanged: !1
- }, null))
- }),
- $g(Kg(r), 'handleSaveRules', function () {
- return r.props.saveRules({
- data: {
- newRules: JSON.stringify(r.state.rules.newRules),
- updatedRules: JSON.stringify(r.state.rules.updatedRules)
- }
- })
- }),
- $g(Kg(r), 'handleSaveChanges', function () {
- return r.handleSaveSettings().then(r.handleSaveRules())
- }),
- $g(Kg(r), 'markCompleteSetup', function () {
- return r.props.forumDetails.installCompleted ? vo.a.when(!0) : r.props.forumUpdateOnSave({
- installCompleted: 1
- })
- }),
- $g(Kg(r), 'handleCompleteSetup', function () {
- var e = r.state.settingsChanged || r.state.rulesChanged ? r.handleSaveChanges() : r.markCompleteSetup(),
- t = r.props.history;
- e.done(t.push.bind(t, '/install/complete'))
- }),
- r
- }
- return e = o,
- (t = [
- {
- key: 'componentDidMount',
- value: function () {
- this.props.fetchForumDetails(),
- this.props.fetchRules()
- }
- },
- {
- key: 'componentWillReceiveProps',
- value: function (e) {
- !this.props.forumDetails && e.forumDetails && this.setState({
- settings: o.getEditableFieldsFromForum(e.forumDetails)
- })
- }
- },
- {
- key: 'render',
- value: function () {
- var e = {
- selection: this.props.selection,
- isBaseInstallPath: !0,
- updateSettingsState: this.updateSettingsState,
- updateRulesState: this.updateRulesState,
- rulesSaveError: this.rulesSaveError,
- forumDetails: this.state.settings,
- forumChanged: this.state.settingsChanged,
- forumDetailsError: this.props.forumDetailsError,
- forumDetailsIsFetching: this.props.forumDetailsIsFetching,
- forumUpdateIsSaving: this.props.forumUpdateIsSaving,
- forumUpdateIsSaved: this.props.forumUpdateIsSaved,
- forumUpdateError: this.props.forumUpdateError,
- forumUpdateOnDismissError: this.props.forumUpdateOnDismissError,
- handleCompleteSetup: this.handleCompleteSetup
- },
- t = {
- selection: this.props.selection,
- location: this.props.location,
- history: this.props.history
- },
- n = this.props.auth.isAuthenticated,
- a = null;
- return n && (a = '/install/subscription/' === fo() ? C.a.createElement(Bg, {
- forceEnable: yo.a.isFeatureActive('intercomEnabled')
- }) : C.a.createElement(Ug, {
- selection: this.props.selection
- })),
- C.a.createElement('div', {
- className: 'section-contained'
- }, C.a.createElement('div', {
- className: 'layout layout--publishers'
- }, C.a.createElement('div', {
- className: 'layout__main'
- }, n ? C.a.createElement(Ag, t) : C.a.createElement('div', {
- className: 'layout__nav layout__nav--placeholder'
- }), C.a.createElement('div', {
- className: 'layout__content'
- }, C.a.cloneElement(this.props.children, e), a || null))))
- }
- }
- ]) && Wg(e.prototype, t),
- n && Wg(e, n),
- o
- }();
- $g(Sn, 'displayName', 'ForumInstall'),
- $g(Sn, 'propTypes', {
- auth: b.a.object.isRequired,
- location: kh.locationShape.isRequired,
- children: b.a.node.isRequired,
- history: b.a.shape({
- push: b.a.func.isRequired
- }).isRequired,
- selection: ht.isRequired,
- forumDetails: $c,
- forumDetailsError: b.a.string,
- forumDetailsIsFetching: b.a.bool,
- fetchForumDetails: b.a.func.isRequired,
- forumUpdateError: b.a.string,
- forumUpdateIsSaving: b.a.bool,
- forumUpdateIsSaved: b.a.bool,
- forumUpdateOnSave: b.a.func.isRequired,
- forumUpdateOnDismissError: b.a.func.isRequired,
- rules: b.a.arrayOf(b.a.shape(qn)),
- fetchRules: b.a.func.isRequired,
- saveRules: b.a.func.isRequired,
- rulesAreFetching: b.a.bool,
- rulesAreSaving: b.a.bool,
- rulesAreSaved: b.a.bool,
- rulesSaveFailed: b.a.bool,
- rulesSaveError: b.a.string
- }),
- $g(Sn, 'getEditableFieldsFromForum', function (e) {
- return {
- name: (e = e || {
- }).name,
- website: e.url,
- category: e.forumCategory && e.forumCategory.id || null,
- typeface: e.typeface,
- colorScheme: e.colorScheme,
- description: e.raw_description,
- language: e.language,
- commentPolicyLink: e.commentPolicyLink,
- commentPolicyText: e.commentPolicyText
- }
- });
- wn = Object(u.connect) (function (e) {
- var t = e.forumDetails,
- n = e.selection;
- return Vg(Vg({
- forumDetails: t.forumDetails,
- forumDetailsError: t.forumDetailsError,
- forumDetailsIsFetching: t.forumDetailsIsFetching
- }, e.moderationRules), {
- }, {
- selection: n
- })
- }, {
- fetchRules: i,
- saveRules: c,
- fetchForumDetails: ig
- }) (Ni.a.attachDrivers(Fo() (Sn), [
- m,
- bc
- ])),
- go = function (e) {
- var t = e.commentPolicyLink,
- n = e.commentPolicyText,
- a = e.forumDetails,
- r = e.expanded,
- o = e.colorScheme,
- i = t && t.trim(),
- e = n && n.trim();
- if (!r || !a || !a.name || !i && !e) return null;
- r = yo.a.isFeatureActive('embed_refresh', {
- forum: a.id
- });
- return C.a.createElement('div', {
- className: 'fieldset comment-policy__wrapper'.concat('dark' === o ? ' dark' : '')
- }, C.a.createElement('div', {
- className: ''.concat(r ? 'comment-policy-refresh' : 'comment-policy', ' fieldset__block')
- }, C.a.createElement('div', {
- className: 'content'
- }, C.a.createElement('p', {
- className: r ? 'comment-policy-refresh__heading' : 'comment-policy-text text-bold'
- }, a.name, ' Comment Policy'), C.a.createElement('p', {
- className: r ? 'comment-policy-refresh__text' : 'comment-policy-text'
- }, e ? n : null, i ? C.a.createElement('p', {
- className: r ? 'comment-policy-refresh__prompt' : 'comment-policy-link'
- }, 'Please read our', ' ', C.a.createElement('a', {
- href: t,
- className: r ? 'comment-policy-refresh__link' : 'policy-link',
- target: '_blank',
- rel: 'noopener noreferrer'
- }, 'Comment Policy'), ' ', 'before commenting.') : null)), r ? C.a.createElement('button', {
- className: 'btn comment-policy-refresh__button publisher-background-color'
- }, 'Got it') : C.a.createElement('span', {
- 'aria-hidden': 'true',
- className: 'icon icon-chat-bubble'
- })))
- };
- go.propTypes = {
- expanded: b.a.bool.isRequired,
- commentPolicyLink: b.a.string,
- commentPolicyText: b.a.string,
- forumDetails: $c,
- colorScheme: b.a.oneOf(['light',
- 'dark',
- 'auto'])
- };
- var Zg = go;
- function Xg(e) {
- return (Xg = 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator ? function (e) {
- return typeof e
- }
- : function (e) {
- return e && 'function' == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? 'symbol' : typeof e
- }) (e)
- }
- function ey(e, t) {
- for (var n = 0; n < t.length; n++) {
- var a = t[n];
- a.enumerable = a.enumerable || !1,
- a.configurable = !0,
- 'value' in a && (a.writable = !0),
- Object.defineProperty(e, a.key, a)
- }
- }
- function ty(e, t) {
- return (ty = Object.setPrototypeOf || function (e, t) {
- return e.__proto__ = t,
- e
- }) (e, t)
- }
- function ny(n) {
- var a = function () {
- if ('undefined' == typeof Reflect || !Reflect.construct) return !1;
- if (Reflect.construct.sham) return !1;
- if ('function' == typeof Proxy) return !0;
- try {
- return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [
- ], function () {
- })),
- !0
- } catch (e) {
- return !1
- }
- }();
- return function () {
- var e,
- t = ry(n);
- return e = a ? (e = ry(this).constructor, Reflect.construct(t, arguments, e)) : t.apply(this, arguments),
- t = this,
- !(e = e) || 'object' !== Xg(e) && 'function' != typeof e ? ay(t) : e
- }
- }
- function ay(e) {
- if (void 0 === e) throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called');
- return e
- }
- function ry(e) {
- return (ry = Object.setPrototypeOf ? Object.getPrototypeOf : function (e) {
- return e.__proto__ || Object.getPrototypeOf(e)
- }) (e)
- }
- function oy(e, t, n) {
- return t in e ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n,
- e
- }
- oo = {
- zone: 'install',
- section: 'settings'
- },
- bo = function () {
- !function (e, t) {
- if ('function' != typeof t && null !== t) throw new TypeError('Super expression must either be null or a function');
- e.prototype = Object.create(t && t.prototype, {
- constructor: {
- value: e,
- writable: !0,
- configurable: !0
- }
- }),
- t && ty(e, t)
- }(o, A);
- var e,
- t,
- n,
- r = ny(o);
- function o() {
- var n;
- !function (e, t) {
- if (!(e instanceof t)) throw new TypeError('Cannot call a class as a function')
- }(this, o);
- for (var e = arguments.length, t = Array(e), a = 0; a < e; a++) t[a] = arguments[a];
- return oy(ay(n = r.call.apply(r, [
- this
- ].concat(t))), 'state', {
- commentPolicyPreviewExpanded: !0
- }),
- oy(ay(n), 'toggleCommentPolicyPreviewExpanded', function (e) {
- e.preventDefault(),
- n.setState(function (e) {
- return {
- commentPolicyPreviewExpanded: !e.commentPolicyPreviewExpanded
- }
- })
- }),
- oy(ay(n), 'handleInputChange', function (t) {
- return function (e) {
- n.props.updateSettingsState(oy({
- }, t, e.target.value))
- }
- }),
- oy(ay(n), 'getInputId', function (e) {
- return ''.concat(n.constructor.displayName, '_').concat(e)
- }),
- n
- }
- return e = o,
- (t = [
- {
- key: 'componentDidMount',
- value: function () {
- this.props.fetchForumCategories(),
- this.props.fetchForumLanguages(),
- this.props.emitTrackingEvent({
- verb: 'view',
- section: 'configure',
- zone: 'install'
- })
- }
- },
- {
- key: 'render',
- value: function () {
- if (this.props.forumDetailsIsFetching) return C.a.createElement(Ji, null);
- if (this.props.forumDetailsError) return C.a.createElement('div', {
- className: 'content__wrap spacing-bottom-double'
- }, this.props.forumDetailsError ? C.a.createElement(Ki, {
- message: this.props.forumDetailsError,
- alertType: 'error'
- }) : null);
- var e = this.props.forumCategories.allCategories.map(function (e) {
- return {
- key: e.id,
- value: e.id,
- label: e.name
- }
- }),
- t = this.props.forumLanguages.map(function (e) {
- return {
- key: e.code,
- value: e.code,
- label: e.name
- }
- }),
- n = this.getInputId('colorScheme'),
- a = this.getInputId('typeface');
- return C.a.createElement('div', {
- className: 'content__wrap'
- }, C.a.createElement('header', {
- className: 'settings__header'
- }, C.a.createElement('h2', {
- className: 'text-larger text-gray-darker spacing-bottom-small'
- }, 'Configure Disqus'), C.a.createElement('p', {
- className: 'text-gray'
- }, 'Here are popular configuration settings you can adjust for your site. You can always revisit these later in the settings tab.')), C.a.createElement('section', {
- className: 'settings__content'
- }, this.props.forumUpdateError ? C.a.createElement(Ki, {
- message: this.props.forumUpdateError,
- onRequestClose: this.props.forumUpdateOnDismissError,
- alertType: 'error'
- }) : null, C.a.createElement($h, {
- name: 'name',
- value: this.props.forumDetails.name,
- label: 'Website Name',
- onChange: this.handleInputChange('name'),
- idNamespace: this.constructor.displayName,
- readOnly: this.props.forumUpdateIsSaving,
- disabled: this.props.forumUpdateIsSaving
- }), C.a.createElement($h, {
- name: 'website',
- value: this.props.forumDetails.website,
- label: 'Website URL',
- onChange: this.handleInputChange('website'),
- idNamespace: this.constructor.displayName,
- readOnly: this.props.forumUpdateIsSaving,
- disabled: this.props.forumUpdateIsSaving,
- tooltip: C.a.createElement(C.a.Fragment, null, 'Changing domains? ', C.a.createElement('a', {
- href: '/admin/discussions/migrate/'
- }, 'Learn how'), '.')
- }), C.a.createElement($h, {
- name: 'commentPolicyLink',
- value: this.props.forumDetails.commentPolicyLink,
- label: 'Comment Policy URL',
- onChange: this.handleInputChange('commentPolicyLink'),
- idNamespace: this.constructor.displayName,
- readOnly: this.props.forumUpdateIsSaving,
- disabled: this.props.forumUpdateIsSaving,
- tooltip: C.a.createElement(C.a.Fragment, null, 'Don\'t have a comment policy yet? ', C.a.createElement('a', {
- href: Pn.commentPolicySuggestions
- }, 'Check out our suggestions.'))
- }), C.a.createElement($h, {
- name: 'commentPolicyText',
- value: this.props.forumDetails.commentPolicyText,
- label: 'Comment Policy Summary',
- onChange: this.handleInputChange('commentPolicyText'),
- idNamespace: this.constructor.displayName,
- readOnly: this.props.forumUpdateIsSaving,
- disabled: this.props.forumUpdateIsSaving,
- placeholder: 'Ex: We welcome relevant and respectful comments. Off-topic comments may be removed.',
- maxLength: 120,
- tooltip: C.a.createElement(C.a.Fragment, null, 'A brief summary of your policy that will appear above the comment area.', ' ', C.a.createElement('a', {
- href: '#',
- onClick: this.toggleCommentPolicyPreviewExpanded
- }, this.state.commentPolicyPreviewExpanded ? 'Collapse preview.' : 'Preview what it looks like.'))
- }), C.a.createElement(Zg, {
- commentPolicyText: this.props.forumDetails.commentPolicyText,
- commentPolicyLink: this.props.forumDetails.commentPolicyLink,
- colorScheme: this.props.forumDetails.colorScheme,
- expanded: this.state.commentPolicyPreviewExpanded,
- forumDetails: this.props.forumDetails
- }), C.a.createElement(Mf, {
- name: 'category',
- options: e,
- placeholder: 'Please select a category',
- value: this.props.forumDetails.category,
- label: 'Category',
- onChange: this.handleInputChange('category'),
- idNamespace: this.constructor.displayName,
- readOnly: this.props.forumUpdateIsSaving,
- disabled: !e.length || this.props.forumUpdateIsSaving
- }), C.a.createElement($h, {
- name: 'description',
- value: this.props.forumDetails.description,
- label: 'Description',
- onChange: this.handleInputChange('description'),
- idNamespace: this.constructor.displayName,
- useTextarea: !0,
- readOnly: this.props.forumUpdateIsSaving,
- disabled: this.props.forumUpdateIsSaving
- }), C.a.createElement(Mf, {
- name: 'language',
- disabled: !t.length,
- options: t,
- placeholder: 'Select a Language',
- value: this.props.forumDetails.language,
- label: 'Language',
- onChange: this.handleInputChange('language'),
- idNamespace: this.constructor.displayName,
- tooltip: C.a.createElement(C.a.Fragment, null, C.a.createElement('a', {
- href: Pn.translate
- }, 'Make Disqus available in your language.'))
- }), C.a.createElement(kf, {
- label: 'Appearance',
- labelId: n,
- blockAdditionalClass: '-text text-medium align align--wrap'
- }, C.a.createElement(Mf, {
- id: n,
- name: 'colorScheme',
- secondaryLabel: 'Color scheme',
- className: 'fieldset-item__select',
- value: this.props.forumDetails.colorScheme,
- options: pf,
- onChange: this.handleInputChange('colorScheme'),
- inline: !0,
- readOnly: this.props.forumUpdateIsSaving,
- loading: this.props.forumUpdateIsSaving
- }), C.a.createElement(Mf, {
- id: a,
- name: 'typeface',
- secondaryLabel: 'Typeface',
- className: 'fieldset-item__select',
- value: this.props.forumDetails.typeface,
- options: lf,
- onChange: this.handleInputChange('typeface'),
- inline: !0,
- readOnly: this.props.forumUpdateIsSaving,
- loading: this.props.forumUpdateIsSaving
- }))), C.a.createElement('footer', {
- className: 'settings__footer clearfix'
- }, C.a.createElement(v.Link, {
- id: 'admin-configure-disqus-next',
- to: '/install/moderation/',
- className: 'button button-fill--brand button-padding-wide button-medium pull-right'
- }, 'Next')))
- }
- }
- ]) && ey(e.prototype, t),
- n && ey(e, n),
- o
- }();
- oy(bo, 'displayName', 'ForumInstallConfig'),
- oy(bo, 'propTypes', {
- updateSettingsState: b.a.func.isRequired,
- forumUpdateOnDismissError: b.a.func.isRequired,
- handleCompleteSetup: b.a.func.isRequired,
- forumDetails: $c,
- forumDetailsError: b.a.string,
- forumDetailsIsFetching: b.a.bool,
- forumUpdateError: b.a.string,
- forumUpdateIsSaving: b.a.bool,
- forumUpdateIsSaved: b.a.bool,
- forumCategories: b.a.shape({
- allCategories: b.a.arrayOf(vl)
- }).isRequired,
- forumLanguages: b.a.arrayOf(xl),
- emitTrackingEvent: b.a.func.isRequired,
- emitDefaultViewEvent: b.a.func.isRequired,
- fetchForumCategories: b.a.func.isRequired,
- fetchForumLanguages: b.a.func.isRequired
- }),
- oy(bo, 'defaultProps', {
- forumDetails: {
- }
- });
- _o = Object(u.connect) (function (e) {
- return {
- forumCategories: e.forumCategories,
- forumLanguages: e.forumLanguages.languages
- }
- }, {
- emitTrackingEvent: Xo(oo),
- emitDefaultViewEvent: ei(oo),
- fetchForumCategories: Nh,
- fetchForumLanguages: vu
- }) (bo);
- function iy(e) {
- return (iy = 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator ? function (e) {
- return typeof e
- }
- : function (e) {
- return e && 'function' == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? 'symbol' : typeof e
- }) (e)
- }
- function sy() {
- return (sy = Object.assign || function (e) {
- for (var t = 1; t < arguments.length; t++) {
- var n,
- a = arguments[t];
- for (n in a) Object.prototype.hasOwnProperty.call(a, n) && (e[n] = a[n])
- }
- return e
- }).apply(this, arguments)
- }
- function ly(e, t) {
- for (var n = 0; n < t.length; n++) {
- var a = t[n];
- a.enumerable = a.enumerable || !1,
- a.configurable = !0,
- 'value' in a && (a.writable = !0),
- Object.defineProperty(e, a.key, a)
- }
- }
- function cy(e, t) {
- return (cy = Object.setPrototypeOf || function (e, t) {
- return e.__proto__ = t,
- e
- }) (e, t)
- }
- function uy(n) {
- var a = function () {
- if ('undefined' == typeof Reflect || !Reflect.construct) return !1;
- if (Reflect.construct.sham) return !1;
- if ('function' == typeof Proxy) return !0;
- try {
- return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [
- ], function () {
- })),
- !0
- } catch (e) {
- return !1
- }
- }();
- return function () {
- var e,
- t = dy(n);
- return e = a ? (e = dy(this).constructor, Reflect.construct(t, arguments, e)) : t.apply(this, arguments),
- t = this,
- !(e = e) || 'object' !== iy(e) && 'function' != typeof e ? py(t) : e
- }
- }
- function py(e) {
- if (void 0 === e) throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called');
- return e
- }
- function dy(e) {
- return (dy = Object.setPrototypeOf ? Object.getPrototypeOf : function (e) {
- return e.__proto__ || Object.getPrototypeOf(e)
- }) (e)
- }
- function my(e, t, n) {
- return t in e ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n,
- e
- }
- To = function () {
- !function (e, t) {
- if ('function' != typeof t && null !== t) throw new TypeError('Super expression must either be null or a function');
- e.prototype = Object.create(t && t.prototype, {
- constructor: {
- value: e,
- writable: !0,
- configurable: !0
- }
- }),
- t && cy(e, t)
- }(o, A);
- var e,
- t,
- n,
- r = uy(o);
- function o() {
- var t;
- !function (e, t) {
- if (!(e instanceof t)) throw new TypeError('Cannot call a class as a function')
- }(this, o);
- for (var e = arguments.length, n = Array(e), a = 0; a < e; a++) n[a] = arguments[a];
- return my(py(t = r.call.apply(r, [
- this
- ].concat(n))), 'state', {
- threads: [
- ]
- }),
- my(py(t), 'fetchForumThreads', function (e) {
- e = sy({
- forum: t.props.selection.forum.shortname,
- limit: 1
- }, e);
- t.apiCall = io.a.call('forums/listThreads', {
- data: e
- }).done(t.handleFetchSuccess)
- }),
- my(py(t), 'handleFetchSuccess', function (e) {
- t.setState({
- threads: e.response
- })
- }),
- my(py(t), 'getComponentProps', function () {
- return {
- forumThreads: t.state.threads
- }
- }),
- t
- }
- return e = o,
- (t = [
- {
- key: 'componentWillUnmount',
- value: function () {
- this.apiCall && 'pending' === this.apiCall.state() && this.apiCall.abort()
- }
- },
- {
- key: 'componentDidMount',
- value: function () {
- this.props.selection.type === ft.forum && this.fetchForumThreads()
- }
- }
- ]) && ly(e.prototype, t),
- n && ly(e, n),
- o
- }();
- my(To, 'displayName', 'ForumThreadDriver'),
- my(To, 'propTypes', {
- selection: ht.isRequired
- });
- qs = Object(ki.createDriver) (To, function (e) {
- return {
- selection: e.selection
- }
- }),
- Qs = function (e) {
- var t = e.iconName;
- return e.href ? C.a.createElement('a', {
- href: e.href,
- className: 'settings__card text-larger -link'
- }, C.a.createElement('i', {
- className: '-icon'.concat(t ? ' icon-'.concat(t) : '')
- }), e.title) : C.a.createElement('div', {
- className: 'settings__card'
- }, C.a.createElement('h2', {
- className: 'text-larger text-gray-darker spacing-bottom-small'
- }, e.title), e.children)
- };
- Qs.propTypes = {
- title: b.a.string.isRequired,
- iconName: b.a.string,
- href: b.a.string,
- children: b.a.array
- };
- var fy = Qs;
- function hy(e) {
- return (hy = 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator ? function (e) {
- return typeof e
- }
- : function (e) {
- return e && 'function' == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? 'symbol' : typeof e
- }) (e)
- }
- function gy(e, t) {
- for (var n = 0; n < t.length; n++) {
- var a = t[n];
- a.enumerable = a.enumerable || !1,
- a.configurable = !0,
- 'value' in a && (a.writable = !0),
- Object.defineProperty(e, a.key, a)
- }
- }
- function yy(e, t) {
- return (yy = Object.setPrototypeOf || function (e, t) {
- return e.__proto__ = t,
- e
- }) (e, t)
- }
- function by(n) {
- var a = function () {
- if ('undefined' == typeof Reflect || !Reflect.construct) return !1;
- if (Reflect.construct.sham) return !1;
- if ('function' == typeof Proxy) return !0;
- try {
- return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [
- ], function () {
- })),
- !0
- } catch (e) {
- return !1
- }
- }();
- return function () {
- var e,
- t = vy(n);
- return e = a ? (e = vy(this).constructor, Reflect.construct(t, arguments, e)) : t.apply(this, arguments),
- t = this,
- !(e = e) || 'object' !== hy(e) && 'function' != typeof e ? function (e) {
- if (void 0 !== e) return e;
- throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called')
- }(t) : e
- }
- }
- function vy(e) {
- return (vy = Object.setPrototypeOf ? Object.getPrototypeOf : function (e) {
- return e.__proto__ || Object.getPrototypeOf(e)
- }) (e)
- }
- function _y(e, t, n) {
- return t in e ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n,
- e
- }
- Ss = {
- zone: 'install',
- section: 'complete'
- },
- Ts = function () {
- !function (e, t) {
- if ('function' != typeof t && null !== t) throw new TypeError('Super expression must either be null or a function');
- e.prototype = Object.create(t && t.prototype, {
- constructor: {
- value: e,
- writable: !0,
- configurable: !0
- }
- }),
- t && yy(e, t)
- }(r, A);
- var e,
- t,
- n,
- a = by(r);
- function r() {
- return function (e, t) {
- if (!(e instanceof t)) throw new TypeError('Cannot call a class as a function')
- }(this, r),
- a.apply(this, arguments)
- }
- return e = r,
- (t = [
- {
- key: 'render',
- value: function () {
- return this.props.viewData.links[0].href = this.props.forumThreads[0] && this.props.forumThreads[0].signedLink || null,
- C.a.createElement('div', {
- className: 'settings content__wrap'
- }, C.a.createElement('header', {
- className: 'settings__header'
- }, C.a.createElement('h2', {
- className: 'text-larger text-gray-darker spacing-bottom-small'
- }, 'Setup Complete!'), C.a.createElement('p', {
- className: 'text-gray'
- }, 'Congratulations, you finished installing Disqus! Here are a few pages to help you get started using Disqus.')), C.a.createElement('div', {
- className: 'spacing-top-quad'
- }, C.a.createElement('div', {
- className: 'video-wrapper install-complete'
- }, this.props.viewData.videos.map(function (e, t) {
- return C.a.createElement('iframe', {
- id: 'ytplayer',
- key: t,
- src: e.src,
- allow: e.allow,
- allowFullScreen: e.allowFullScreen
- })
- }))), C.a.createElement('div', {
- className: 'spacing-top-quad'
- }, this.props.viewData.links.map(function (e, t) {
- return e.href ? C.a.createElement(fy, {
- key: t,
- title: e.title,
- href: e.href,
- iconName: e.iconName
- }) : null
- })), C.a.createElement('div', {
- className: 'spacing-top-quad spacing-bottom-quad'
- }, this.props.viewData.paragraphs.map(function (e, t) {
- return C.a.createElement(fy, {
- key: t,
- title: e.title
- }, e.content.map(function (e, t) {
- return C.a.createElement('p', {
- key: t,
- className: 'text-gray'
- }, e.value, C.a.createElement('a', {
- key: t,
- href: e.href,
- className: 'settings__tile__link'
- }, e.hrefValue), '.')
- }))
- })), C.a.createElement('footer', {
- className: 'settings__footer clearfix'
- }, C.a.createElement(v.Link, {
- to: '/install/moderation',
- className: 'button button-fill button-padding-wide button-medium pull-left'
- }, 'Back'), C.a.createElement(v.Link, {
- to: '/',
- className: 'button button-fill--brand button-padding-wide button-medium pull-right'
- }, 'Dismiss Setup')))
- }
- }
- ]) && gy(e.prototype, t),
- n && gy(e, n),
- r
- }();
- _y(Ts, 'displayName', 'ForumInstallComplete'),
- _y(Ts, 'propTypes', {
- viewData: b.a.object.isRequired,
- forumThreads: b.a.arrayOf(b.a.object).isRequired,
- emitTrackingEvent: b.a.func.isRequired,
- emitDefaultViewEvent: b.a.func.isRequired
- }),
- _y(Ts, 'defaultProps', {
- viewData: {
- videos: [
- {
- src: 'https://www.youtube.com/embed/wTRsNa8kzTw?rel=0',
- allow: 'autoplay; encrypted-media',
- allowFullScreen: ''
- }
- ],
- links: [
- {
- title: 'Learn how to moderate comments',
- href: '//www.disqus.com/admin/moderate/',
- iconName: 'flag-wave'
- },
- {
- title: 'Configure your site\'s community settings',
- href: '//www.disqus.com/admin/settings/community/',
- iconName: 'cog'
- }
- ],
- paragraphs: [
- {
- title: 'Need help?',
- content: [
- {
- value: 'Contact our support team at ',
- href: '//www.disqus.com/support/',
- hrefValue: 'disqus.com/support'
- },
- {
- value: 'You can also reach our active community of Disqus users at ',
- href: '//www.disqus.com/channel/discussdisqus/',
- hrefValue: 'Discuss Disqus'
- }
- ]
- },
- {
- title: 'Need to import old comments?',
- content: [
- {
- value: 'See our Knowledge Base article on ',
- href: '//www.disqus.com/admin/discussions/import/platform/wordpress/',
- hrefValue: 'How to import old comments'
- }
- ]
- }
- ]
- }
- });
- Ds = Object(u.connect) (null, {
- emitTrackingEvent: Xo(Ss),
- emitDefaultViewEvent: ei(Ss)
- }) (Ni.a.attachDrivers(Ts, [
- qs
- ])),
- cs = function (t) {
- return C.a.createElement('div', {
- id: 'admin-'.concat(t.profile.name.toLowerCase(), '-moderation'),
- className: 'moderation-profile-container '.concat(t.profile.color, '-profile').concat(t.isSelected ? ' selected' : ''),
- 'data-value': t.profile.name,
- onClick: function (e) {
- return t.handleClick(e)
- }
- }, C.a.createElement('div', {
- className: 'moderation-profile-header'
- }, C.a.createElement('span', {
- className: 'profile-selected-check'.concat(t.isSelected ? ' checked' : '')
- }), C.a.createElement('h3', {
- className: 'moderation-profile-title'
- }, t.profile.name)), C.a.createElement('div', {
- className: 'profile-content-wrapper'
- }, t.profile.description && t.showDescription ? C.a.createElement('div', {
- className: 'moderation-profile-description text-medium'
- }, t.profile.description) : null, t.profile.settings && t.showSettings ? C.a.createElement('ul', {
- className: 'moderation-profile-list text-medium'
- }, t.profile.settings.map(function (e) {
- return e.text ? C.a.createElement('li', {
- key: ''.concat(t.profile.name, '-').concat(e.key),
- className: 'moderation-profile-list-item'
- }, e.text) : null
- }), Object.values(t.profile.rules).map(function (e) {
- return !e.text || e.isHiveRule && !yo.a.isFeatureActive('thehive', {
- forum: t.forumId || ''
- }) ? null : C.a.createElement('li', {
- key: ''.concat(t.profile.name, '-').concat(e.key),
- className: 'moderation-profile-list-item'
- }, e.text)
- })) : null))
- };
- cs.propTypes = {
- profile: ac.isRequired,
- showDescription: b.a.bool,
- showSettings: b.a.bool,
- isSelected: b.a.bool.isRequired,
- handleClick: b.a.func.isRequired,
- forumId: b.a.string
- };
- var Ey = cs,
- Ls = function (e) {
- var t = e.id,
- n = e.children,
- a = e.onClick,
- r = '',
- o = '';
- return e.isSaved ? (r = 'is-saved', o = 'icon-checkmark') : e.isSaving && (r = 'is-saving', o = 'spinner -sm'),
- C.a.createElement('div', {
- className: 'save-button fieldset--save pull-right'
- }, C.a.createElement('div', {
- className: 'save-button__icon-container '.concat(r)
- }, C.a.createElement('div', {
- className: 'save-button__icon '.concat(o)
- })), C.a.createElement('button', {
- id: t,
- className: 'button button-fill--brand button-padding-wide button-medium',
- onClick: a
- }, n))
- };
- Ls.propTypes = {
- children: b.a.node.isRequired,
- id: b.a.string,
- isSaving: b.a.bool,
- isSaved: b.a.bool,
- onClick: b.a.func
- };
- var Oy = Ls;
- function Sy(e) {
- return (Sy = 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator ? function (e) {
- return typeof e
- }
- : function (e) {
- return e && 'function' == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? 'symbol' : typeof e
- }) (e)
- }
- function wy(t, e) {
- var n,
- a = Object.keys(t);
- return Object.getOwnPropertySymbols && (n = Object.getOwnPropertySymbols(t), e && (n = n.filter(function (e) {
- return Object.getOwnPropertyDescriptor(t, e).enumerable
- })), a.push.apply(a, n)),
- a
- }
- function Py(t) {
- for (var e = 1; e < arguments.length; e++) {
- var n = null != arguments[e] ? arguments[e] : {
- };
- e % 2 ? wy(Object(n), !0).forEach(function (e) {
- jy(t, e, n[e])
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(n)) : wy(Object(n)).forEach(function (e) {
- Object.defineProperty(t, e, Object.getOwnPropertyDescriptor(n, e))
- })
- }
- return t
- }
- function ky(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) {
- var a,
- r,
- o = [
- ],
- i = !0,
- s = !1;
- try {
- for (n = n.call(e); !(i = (a = n.next()).done) && (o.push(a.value), !t || o.length !== t); i = !0);
- } catch (e) {
- s = !0,
- r = e
- } finally {
- try {
- i || null == n.return || n.return()
- } finally {
- if (s) throw r
- }
- }
- return o
- }
- }(e, t) || function (e, t) {
- if (e) {
- if ('string' == typeof e) return Ny(e, t);
- var n = Object.prototype.toString.call(e).slice(8, - 1);
- return 'Map' === (n = 'Object' === n && e.constructor ? e.constructor.name : n) || 'Set' === n ? Array.from(e) : 'Arguments' === n || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n) ? Ny(e, t) : void 0
- }
- }(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 Ny(e, t) {
- for (var n = 0, a = Array(t = null == t || e.length < t ? e.length : t); n < t; n++) a[n] = e[n];
- return a
- }
- function Cy(e, t) {
- for (var n = 0; n < t.length; n++) {
- var a = t[n];
- a.enumerable = a.enumerable || !1,
- a.configurable = !0,
- 'value' in a && (a.writable = !0),
- Object.defineProperty(e, a.key, a)
- }
- }
- function Ry(e, t) {
- return (Ry = Object.setPrototypeOf || function (e, t) {
- return e.__proto__ = t,
- e
- }) (e, t)
- }
- function xy(n) {
- var a = function () {
- if ('undefined' == typeof Reflect || !Reflect.construct) return !1;
- if (Reflect.construct.sham) return !1;
- if ('function' == typeof Proxy) return !0;
- try {
- return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [
- ], function () {
- })),
- !0
- } catch (e) {
- return !1
- }
- }();
- return function () {
- var e,
- t = Dy(n);
- return e = a ? (e = Dy(this).constructor, Reflect.construct(t, arguments, e)) : t.apply(this, arguments),
- t = this,
- !(e = e) || 'object' !== Sy(e) && 'function' != typeof e ? Ay(t) : e
- }
- }
- function Ay(e) {
- if (void 0 === e) throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called');
- return e
- }
- function Dy(e) {
- return (Dy = Object.setPrototypeOf ? Object.getPrototypeOf : function (e) {
- return e.__proto__ || Object.getPrototypeOf(e)
- }) (e)
- }
- function jy(e, t, n) {
- return t in e ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n,
- e
- }
- Lo = {
- zone: 'install',
- section: 'moderation'
- },
- Mo = function () {
- !function (e, t) {
- if ('function' != typeof t && null !== t) throw new TypeError('Super expression must either be null or a function');
- e.prototype = Object.create(t && t.prototype, {
- constructor: {
- value: e,
- writable: !0,
- configurable: !0
- }
- }),
- t && Ry(e, t)
- }(o, A);
- var e,
- t,
- n,
- a = xy(o);
- function o() {
- var r;
- !function (e, t) {
- if (!(e instanceof t)) throw new TypeError('Cannot call a class as a function')
- }(this, o);
- for (var e = arguments.length, t = Array(e), n = 0; n < e; n++) t[n] = arguments[n];
- return jy(Ay(r = a.call.apply(a, [
- this
- ].concat(t))), 'state', {
- rules: {
- },
- selectedProfile: null
- }),
- jy(Ay(r), 'handleProfileSelect', function (t) {
- var e,
- n = wf.filter(function (e) {
- return e.name === t.currentTarget.dataset.value
- }) [0] || null,
- a = {
- };
- n && (n.settings.forEach(function (e) {
- a[e.key] = 'boolean' == typeof e.value ? e.value ? 1 : 0 : e.value
- }), e = Object.entries(n.rules), n.rules = Object.fromEntries(e.filter(function (e) {
- e = ky(e, 2);
- return !e[1].isHiveRule || r.props.selection.forum.features.allModRules || yo.a.isFeatureActive('thehive', {
- forum: r.props.selection.forum.shortname
- })
- }))),
- r.setState(Py(Py({
- }, a), {
- }, {
- rules: n.rules,
- selectedProfile: n.name
- })),
- r.props.updateSettingsState(a),
- r.props.updateRulesState(n.rules)
- }),
- r
- }
- return e = o,
- (t = [
- {
- key: 'render',
- value: function () {
- var t = this;
- return C.a.createElement('div', {
- className: 'content__wrap'
- }, C.a.createElement('header', {
- className: 'settings__header'
- }, C.a.createElement('h2', {
- className: 'text-larger text-gray-darker spacing-bottom-small'
- }, 'Comment and Moderation Settings')), C.a.createElement('section', {
- className: 'settings__content'
- }, this.props.forumUpdateError ? C.a.createElement(Ki, {
- message: this.props.forumUpdateError,
- onRequestClose: this.props.forumUpdateOnDismissError,
- alertType: 'error'
- }) : null, this.props.rulesSaveError ? C.a.createElement(Ki, {
- message: this.props.rulesSaveError,
- alertType: 'error'
- }) : null, C.a.createElement('div', {
- className: 'text-gray spacing-bottom-large'
- }, 'Select the default settings profile that best fits your moderation style and community', C.a.createElement('p', {
- className: 'text-blue text-semibold'
- }, 'Don’t worry, you can modify any of the individual settings at any time.')), wf.map(function (e) {
- return C.a.createElement(Ey, {
- key: e.name,
- profile: e,
- showDescription: !1,
- showSettings: !0,
- isSelected: t.state.selectedProfile === e.name,
- handleClick: t.handleProfileSelect,
- forumId: t.props.selection.forum.shortname
- })
- })), C.a.createElement('footer', {
- className: 'settings__footer clearfix'
- }, C.a.createElement(v.Link, {
- to: '/install/settings',
- className: 'button button-fill button-padding-wide button-medium pull-left'
- }, 'Back'), C.a.createElement(Oy, {
- id: 'admin-complete-setup',
- onClick: this.props.handleCompleteSetup,
- isSaving: this.props.forumUpdateIsSaving,
- isSaved: this.props.forumUpdateIsSaved
- }, 'Complete Setup')))
- }
- }
- ]) && Cy(e.prototype, t),
- n && Cy(e, n),
- o
- }();
- jy(Mo, 'displayName', 'ForumInstallModeration'),
- jy(Mo, 'propTypes', {
- updateSettingsState: b.a.func.isRequired,
- updateRulesState: b.a.func.isRequired,
- forumUpdateOnDismissError: b.a.func.isRequired,
- handleCompleteSetup: b.a.func.isRequired,
- forumUpdateError: b.a.string,
- forumUpdateIsSaving: b.a.bool,
- forumUpdateIsSaved: b.a.bool,
- rulesSaveError: b.a.string,
- emitTrackingEvent: b.a.func.isRequired,
- emitDefaultViewEvent: b.a.func.isRequired,
- selection: ht.isRequired
- });
- ti = Object(u.connect) (null, {
- emitTrackingEvent: Xo(Lo),
- emitDefaultViewEvent: ei(Lo)
- }) (Mo),
- ai = function (e) {
- var t = e.package,
- n = e.onClose,
- e = t.id === Ur.DISQUS_PLUS_PACKAGE_ID,
- a = t.id === Ur.DISQUS_POLLS_PRO_PACKAGE_ID ? {
- header: 'Welcome to Disqus Polls Pro',
- intro: 'You’ve joined a community of thousands of premier publishers who use our tools to build, engage, and grow their online communities.',
- list: [
- {
- text: 'Create interactive Polls and embed them anywhere on your site in minutes',
- icon: '//c.disquscdn.com/next/current/publisher-admin/assets/img/welcome/clipboard.svg'
- },
- {
- text: 'Keep your audiences engaged via dynamic and customizable question formats',
- icon: '//c.disquscdn.com/next/current/publisher-admin/assets/img/welcome/social-media.svg'
- },
- {
- text: 'Track results in real-time via in-depth reporting and analytics',
- icon: '//c.disquscdn.com/next/current/publisher-admin/assets/img/welcome/chart.svg'
- }
- ],
- imageClass: 'welcome-image-polls-pro',
- contentClass: 'welcome-content-polls',
- getStarted: 'Get started by creating your first poll now.'
- }
- : t.id === Ur.DISQUS_POLLS_AD_SUPPORTED_PACKAGE_ID ? {
- header: 'Welcome to Disqus Polls',
- intro: 'You’ve joined a community of thousands of premier publishers who use our tools to build, engage, and grow their online communities.',
- list: [
- {
- text: 'Create interactive Polls and embed them anywhere on your site in minutes',
- icon: '//c.disquscdn.com/next/current/publisher-admin/assets/img/welcome/one.svg'
- },
- {
- text: 'Complete your ad setup so that you can start earning a share of the ad revenue generated by your Polls',
- icon: '//c.disquscdn.com/next/current/publisher-admin/assets/img/welcome/two.svg'
- },
- {
- text: 'Track results in real-time via in-depth reporting and analytics',
- icon: '//c.disquscdn.com/next/current/publisher-admin/assets/img/welcome/three.svg'
- }
- ],
- imageClass: 'welcome-image-polls-free',
- contentClass: 'welcome-content-polls',
- itemTextClass: 'welcome-item-text-free',
- paragraphClass: 'welcome-paragraph-free',
- containerClass: 'welcome-container-free',
- getStarted: 'Get started by creating your first poll now.'
- }
- : t.id === Ur.DISQUS_PRO_PACKAGE_ID ? {
- header: 'Welcome to Disqus Pro',
- intro: 'You’ve joined a community of thousands of premier publishers who take advantage of advanced engagement, analytics, and moderation features.',
- list: [
- {
- text: C.a.createElement(C.a.Fragment, null, 'Engage your audience via advanced features like ', C.a.createElement('span', {
- className: 'welcome-item-text -bold'
- }, 'Community Badges, Custom Reactions,'), ' and ', C.a.createElement('span', {
- className: 'welcome-item-text -bold'
- }, 'Star Ratings')),
- icon: '//c.disquscdn.com/next/current/publisher-admin/assets/img/welcome/reactions.svg'
- },
- {
- text: C.a.createElement(C.a.Fragment, null, 'Enforce your comment policy with ease using AI-powered ', C.a.createElement('span', {
- className: 'welcome-item-text -bold'
- }, 'Advanced Moderation'), ' tools'),
- icon: '//c.disquscdn.com/next/current/publisher-admin/assets/img/welcome/debate.svg'
- },
- {
- text: C.a.createElement(C.a.Fragment, null, 'Dive into your engagement data via ', C.a.createElement('span', {
- className: 'welcome-item-text -bold'
- }, 'Advanced Analytics'), ' dashboards'),
- icon: '//c.disquscdn.com/next/current/publisher-admin/assets/img/welcome/dashboard.svg'
- }
- ],
- imageClass: 'welcome-image-pro',
- getStarted: 'Get started by setting up your comment section now.'
- }
- : e ? {
- header: 'Welcome to Disqus Plus',
- intro: 'You’ve joined a community of thousands of premier publishers who use our tools to build, engage, and grow their online communities.',
- list: [
- {
- text: 'Deliver a premium, ad-free experience to your commenters',
- icon: '//c.disquscdn.com/next/current/publisher-admin/assets/img/welcome/premium.svg'
- },
- {
- text: 'Engage your users via a number of powerful engagement features',
- icon: '//c.disquscdn.com/next/current/publisher-admin/assets/img/welcome/social-media.svg'
- },
- {
- text: 'Enjoy access to direct customer support + resources',
- icon: '//c.disquscdn.com/next/current/publisher-admin/assets/img/welcome/online-chat.svg'
- }
- ],
- imageClass: 'welcome-image-plus',
- getStarted: 'Get started by setting up your comment section now.'
- }
- : {
- header: 'Welcome to Disqus',
- intro: 'You’ve joined a community of thousands of premier publishers who use our tools to build, engage, and grow their online communities.',
- list: [
- {
- text: 'You’ve selected a free, ad-supported version of Disqus. Your site will now undergo review while we determine your ad eligibility status.',
- icon: '//c.disquscdn.com/next/current/publisher-admin/assets/img/welcome/one.svg'
- },
- {
- text: 'If we determine that your site is NOT eligible for our free plan, we’ll reach out to let you know that you’ll have to choose a paid plan to continue using Disqus.',
- icon: '//c.disquscdn.com/next/current/publisher-admin/assets/img/welcome/two.svg'
- },
- {
- text: 'If we determine that your site is eligible, we’ll let you know and you’ll be able to proceed with this plan.',
- icon: '//c.disquscdn.com/next/current/publisher-admin/assets/img/welcome/three.svg'
- },
- {
- text: 'While we begin the review process, go ahead and click the button below to start setting up your site account.',
- icon: '//c.disquscdn.com/next/current/publisher-admin/assets/img/welcome/four.svg'
- }
- ],
- imageClass: 'welcome-image-free',
- contentClass: 'welcome-content-free',
- itemTextClass: 'welcome-item-text-free',
- paragraphClass: 'welcome-paragraph-free',
- containerClass: 'welcome-container-free'
- };
- return C.a.createElement(_.a, {
- isOpen: !0,
- onRequestClose: n,
- className: 'admin-modal -clipped -wide welcome-modal',
- overlayClassName: 'modal-overlay -dark'
- }, C.a.createElement('div', {
- className: a.containerClass || 'welcome-container'
- }, C.a.createElement('div', {
- className: a.contentClass || 'welcome-content'
- }, C.a.createElement('h3', {
- className: 'welcome-header'
- }, a.header), C.a.createElement('p', {
- className: a.paragraphClass || 'welcome-paragraph'
- }, a.intro), C.a.createElement('ul', {
- className: 'welcome-list'
- }, (a.list || [
- ]).map(function (e, t) {
- return C.a.createElement('li', {
- className: 'welcome-item',
- key: t
- }, C.a.createElement('img', {
- className: 'welcome-item-img',
- src: e.icon
- }), C.a.createElement('span', {
- className: a.itemTextClass || 'welcome-item-text'
- }, e.text))
- })), a.getStarted && C.a.createElement('p', {
- className: 'welcome-paragraph'
- }, a.getStarted), C.a.createElement('button', {
- className: 'welcome-button',
- onClick: n
- }, 'Get Started')), C.a.createElement('div', {
- className: a.imageClass
- })))
- };
- ai.propTypes = {
- package: Ur.PACKAGE_SHAPE.isRequired,
- onClose: b.a.func
- };
- var Ty = ai;
- function Iy(e) {
- return (Iy = 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator ? function (e) {
- return typeof e
- }
- : function (e) {
- return e && 'function' == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? 'symbol' : typeof e
- }) (e)
- }
- function qy(e, t) {
- for (var n = 0; n < t.length; n++) {
- var a = t[n];
- a.enumerable = a.enumerable || !1,
- a.configurable = !0,
- 'value' in a && (a.writable = !0),
- Object.defineProperty(e, a.key, a)
- }
- }
- function Fy(e, t) {
- return (Fy = Object.setPrototypeOf || function (e, t) {
- return e.__proto__ = t,
- e
- }) (e, t)
- }
- function Ly(n) {
- var a = function () {
- if ('undefined' == typeof Reflect || !Reflect.construct) return !1;
- if (Reflect.construct.sham) return !1;
- if ('function' == typeof Proxy) return !0;
- try {
- return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [
- ], function () {
- })),
- !0
- } catch (e) {
- return !1
- }
- }();
- return function () {
- var e,
- t = My(n);
- return e = a ? (e = My(this).constructor, Reflect.construct(t, arguments, e)) : t.apply(this, arguments),
- t = this,
- !(e = e) || 'object' !== Iy(e) && 'function' != typeof e ? Uy(t) : e
- }
- }
- function Uy(e) {
- if (void 0 === e) throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called');
- return e
- }
- function My(e) {
- return (My = Object.setPrototypeOf ? Object.getPrototypeOf : function (e) {
- return e.__proto__ || Object.getPrototypeOf(e)
- }) (e)
- }
- function By(e, t, n) {
- return t in e ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n,
- e
- }
- di = function () {
- !function (e, t) {
- if ('function' != typeof t && null !== t) throw new TypeError('Super expression must either be null or a function');
- e.prototype = Object.create(t && t.prototype, {
- constructor: {
- value: e,
- writable: !0,
- configurable: !0
- }
- }),
- t && Fy(e, t)
- }(o, A);
- var e,
- t,
- n,
- r = Ly(o);
- function o() {
- var t;
- !function (e, t) {
- if (!(e instanceof t)) throw new TypeError('Cannot call a class as a function')
- }(this, o);
- for (var e = arguments.length, n = Array(e), a = 0; a < e; a++) n[a] = arguments[a];
- return By(Uy(t = r.call.apply(r, [
- this
- ].concat(n))), 'state', {
- isModalOpen: !1
- }),
- By(Uy(t), 'handleCloseModal', function () {
- t.setState({
- isModalOpen: !1
- })
- }),
- By(Uy(t), 'handlePlatformClick', function (e) {
- t.props.emitTrackingEvent({
- verb: 'click',
- section: 'platform_list',
- object_type: 'section',
- object_id: 'platform',
- extra_data: JSON.stringify({
- platform: e
- })
- })
- }),
- t
- }
- return e = o,
- (t = [
- {
- key: 'componentDidMount',
- value: function () {
- this.props.emitTrackingEvent({
- verb: 'view',
- section: this.state.isModalOpen ? 'welcome' : 'platform_list'
- }),
- this.props.fetchSubscription()
- }
- },
- {
- key: 'componentWillReceiveProps',
- value: function (e) {
- this.props.isBaseInstallPath && ('welcome' !== this.props.route.path || e.route.path ? this.props.route.path || 'welcome' !== e.route.path || this.props.emitTrackingEvent({
- verb: 'view',
- section: 'welcome'
- }) : this.props.emitTrackingEvent({
- verb: 'view',
- section: 'platform_list'
- })),
- this.props.history.isActive('/install/welcome/') && this.setState({
- isModalOpen: !0
- })
- }
- },
- {
- key: 'render',
- value: function () {
- var t = this,
- e = this.props.selection.type === ft.forum,
- n = null;
- this.context.auth.isAuthenticated ? e && !0 === this.props.selection.forum.installCompleted ? n = C.a.createElement('div', {
- className: 'alert alert--brand text-medium spacing-double padding-double spacing-bottom-none border-radius-base'
- }, C.a.createElement('h2', {
- className: 'text-larger'
- }, 'Looks like Disqus is already installed on your site'), C.a.createElement('p', null, 'If you\'re trying to migrate your site to a new domain, you can do so using our Migration Tools.'), C.a.createElement(Uo, {
- path: ho.getAdminPath('/discussions/migrate/'),
- selection: this.props.selection
- }, C.a.createElement('button', {
- className: 'button button-medium button-padding-wide button-wide--mobile button-outline spacing-top'
- }, 'Migrate to a new site'))) : e || (n = C.a.createElement('p', {
- className: 'spacing-double'
- }, C.a.createElement(Uo, {
- path: '/install/',
- selection: this.props.selection
- }, 'Select a site'), ' to get instructions tailored to that site.')) : n = C.a.createElement('div', {
- className: 'alert alert--brand text-medium spacing-double padding-double spacing-bottom-none border-radius-base'
- }, C.a.createElement('h2', {
- className: 'text-larger'
- }, 'Ready to install Disqus?'), C.a.createElement('p', null, 'Create an account to install Disqus on your site. These instructions only work if you have an account registered with Disqus and are logged in.'), C.a.createElement('a', {
- href: ''.concat(dt, '/publishers/signup/?next=/admin/create/')
- }, C.a.createElement('button', {
- className: 'button button-medium button-padding-wide button-wide--mobile button-outline spacing-top'
- }, 'Get Started')));
- for (var a = [
- ], r = 0; r < 3; r++) a.push(C.a.createElement('div', {
- key: r,
- className: 'platform-list__placeholder'
- }));
- return this.props.orgCurrentPackage ? C.a.createElement('div', {
- className: 'content__wrap'
- }, C.a.createElement('header', {
- className: 'settings__header'
- }, C.a.createElement('h2', {
- className: 'text-larger text-gray-darker spacing-bottom-small'
- }, 'What platform is your site on?')), n, C.a.createElement('div', {
- className: 'align align--wrap align--install spacing-top'
- }, vf.map(function (e) {
- return C.a.createElement('div', {
- className: 'platform-list__option',
- key: e.id
- }, C.a.createElement(v.Link, {
- id: 'admin-install-'.concat(e.id),
- to: '/install/platforms/'.concat(e.id, '/'),
- className: 'text-large link-gray-dark',
- onClick: function () {
- return t.handlePlatformClick(e.name)
- }
- }, C.a.createElement('div', {
- className: 'platform-list__icon -'.concat(e.id)
- }, C.a.createElement('img', {
- src: '//c.disquscdn.com/next/current/publisher-admin/assets/img/install_icons/'.concat(e.id, '.png'),
- alt: e.name,
- height: '64',
- width: '64'
- })), e.name))
- }), a), C.a.createElement('div', {
- className: 'align align--around spacing-top-quad spacing-bottom-quad'
- }, C.a.createElement(v.Link, {
- id: 'admin-install-universal-code',
- to: '/install/platforms/universalcode/',
- className: 'text-large universal-code-btn'
- }, C.a.createElement('div', {
- className: 'platform-list__universal align align--middle'
- }, C.a.createElement('img', {
- src: '//c.disquscdn.com/next/current/publisher-admin/assets/img/install_icons/universal-code.svg',
- alt: 'Universal Code',
- height: '64',
- width: '64'
- }), C.a.createElement('span', null, 'I don\'t see my platform listed, install manually with ', C.a.createElement('strong', null, 'Universal Code'))))), this.state.isModalOpen && C.a.createElement(Ty, {
- package: this.props.orgCurrentPackage,
- onClose: this.handleCloseModal
- })) : C.a.createElement(Qi, null)
- }
- }
- ]) && qy(e.prototype, t),
- n && qy(e, n),
- o
- }();
- By(di, 'displayName', 'ForumInstallPlatforms'),
- By(di, 'propTypes', {
- history: b.a.shape({
- isActive: b.a.func.isRequired
- }).isRequired,
- route: b.a.object.isRequired,
- emitTrackingEvent: b.a.func.isRequired,
- selection: ht,
- isBaseInstallPath: b.a.bool
- }),
- By(di, 'contextTypes', {
- auth: b.a.object.isRequired
- });
- Oi = Object(u.connect) (function (e) {
- e = e.subscription;
- return {
- orgSubscriptionIsFetching: e.orgSubscriptionIsFetching,
- orgCurrentPackage: e.orgCurrentPackage,
- subscription: e
- }
- }, {
- fetchSubscription: Hl,
- emitTrackingEvent: Xo({
- zone: 'install'
- })
- }) (Fo() (di));
- function zy(e, t) {
- for (var n = 0, a = Array(t = null == t || e.length < t ? e.length : t); n < t; n++) a[n] = e[n];
- return a
- }
- var Hy,
- Gy = [
- {
- path: '/settings/install/',
- label: 'Installation',
- activeRoutes: [
- '/settings/install/',
- '/settings/universalcode/',
- '/settings/wordpress/',
- '/settings/blogger/',
- '/settings/tumblr/',
- '/settings/squarespace/',
- '/settings/typepad/',
- '/settings/movabletype/',
- '/settings/drupal/',
- '/settings/joomla/',
- '/settings/weebly/',
- '/settings/strikingly/',
- '/settings/jekyll/',
- '/settings/ghost/',
- '/settings/hubspot/',
- '/settings/shopify/',
- '/settings/amp/',
- '/settings/adobemuse/',
- '/settings/jimdo/',
- '/settings/postachio/',
- '/settings/gatsby/',
- '/settings/pattern/'
- ]
- },
- {
- path: '/settings/general/',
- label: 'General'
- },
- {
- path: '/settings/community/',
- label: 'Community'
- },
- {
- path: '/settings/moderation/',
- label: 'Moderation'
- }
- ].concat(function (e) {
- if (Array.isArray(e)) return zy(e)
- }(Hy = yo.a.isFeatureActive('polls_pub_admin') ? [
- {
- path: '/settings/moderators/',
- label: 'Moderators'
- }
- ] : [
- ]) || function (e) {
- if ('undefined' != typeof Symbol && null != e[Symbol.iterator] || null != e['@@iterator']) return Array.from(e)
- }(Hy) || function (e, t) {
- if (e) {
- if ('string' == typeof e) return zy(e, t);
- var n = Object.prototype.toString.call(e).slice(8, - 1);
- return 'Map' === (n = 'Object' === n && e.constructor ? e.constructor.name : n) || 'Set' === n ? Array.from(e) : 'Arguments' === n || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n) ? zy(e, t) : void 0
- }
- }(Hy) || function () {
- throw new TypeError('Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.')
- }(), [
- {
- path: '/settings/ads/',
- label: 'Ads',
- activeRoutes: [
- '/settings/ads/',
- '/settings/revenue/'
- ]
- },
- {
- path: '/settings/reactions/',
- label: 'Reactions'
- },
- {
- path: '/settings/recommendations/',
- label: 'Recommendations'
- },
- {
- path: '/settings/badges/',
- label: 'Badges',
- feature: 'badges'
- },
- {
- path: '/settings/behind-click/',
- label: 'Behind a Click',
- isNew: !0
- },
- {
- path: '/settings/email-subscriptions/',
- label: 'Email Subscriptions'
- },
- {
- path: '/settings/advanced/',
- label: 'Advanced'
- },
- {
- path: '/settings/webhooks/',
- label: 'Webhooks'
- }
- ]),
- Vy = [
- {
- path: '/settings/general/',
- label: 'General'
- },
- {
- path: '/settings/sites/',
- label: 'Sites'
- },
- {
- path: '/settings/admins/',
- label: 'Admins'
- }
- ],
- Wy = [
- {
- path: '/settings/polls/general/',
- label: 'General'
- },
- {
- path: '/settings/polls/pollsters/',
- label: 'Pollsters'
- }
- ],
- wi = function (e) {
- var t = e.children,
- n = e.isActive,
- a = e.label,
- r = e.handleToggle;
- return C.a.createElement('nav', {
- className: 'nav-section '.concat(e.isOpen ? 'nav-section--open' : '')
- }, C.a.createElement('div', {
- className: 'nav__subheadings padding-top-none '.concat(yo.a.isFeatureActive('polls_pub_admin') ? 'nav-section__toggle' : ''),
- onClick: r
- }, C.a.createElement('h4', {
- className: 'text-subheading'
- }, a), yo.a.isFeatureActive('polls_pub_admin') && C.a.createElement('span', {
- className: 'nav__caret'
- })), C.a.createElement('div', {
- className: 'nav--mobile-dropdown '.concat(n ? '-active' : '')
- }, t))
- };
- wi.displayName = 'NavSection',
- wi.propTypes = {
- children: b.a.element,
- isActive: b.a.bool,
- isOpen: b.a.bool,
- label: b.a.string.isRequired,
- handleToggle: b.a.func
- };
- var Yy = wi;
- function Qy(e) {
- return (Qy = 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator ? function (e) {
- return typeof e
- }
- : function (e) {
- return e && 'function' == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? 'symbol' : typeof e
- }) (e)
- }
- function Ky() {
- return (Ky = Object.assign || function (e) {
- for (var t = 1; t < arguments.length; t++) {
- var n,
- a = arguments[t];
- for (n in a) Object.prototype.hasOwnProperty.call(a, n) && (e[n] = a[n])
- }
- return e
- }).apply(this, arguments)
- }
- function Jy(t, e) {
- var n,
- a = Object.keys(t);
- return Object.getOwnPropertySymbols && (n = Object.getOwnPropertySymbols(t), e && (n = n.filter(function (e) {
- return Object.getOwnPropertyDescriptor(t, e).enumerable
- })), a.push.apply(a, n)),
- a
- }
- function $y(t) {
- for (var e = 1; e < arguments.length; e++) {
- var n = null != arguments[e] ? arguments[e] : {
- };
- e % 2 ? Jy(Object(n), !0).forEach(function (e) {
- ab(t, e, n[e])
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(n)) : Jy(Object(n)).forEach(function (e) {
- Object.defineProperty(t, e, Object.getOwnPropertyDescriptor(n, e))
- })
- }
- return t
- }
- function Zy(e, t) {
- for (var n = 0; n < t.length; n++) {
- var a = t[n];
- a.enumerable = a.enumerable || !1,
- a.configurable = !0,
- 'value' in a && (a.writable = !0),
- Object.defineProperty(e, a.key, a)
- }
- }
- function Xy(e, t) {
- return (Xy = Object.setPrototypeOf || function (e, t) {
- return e.__proto__ = t,
- e
- }) (e, t)
- }
- function eb(n) {
- var a = function () {
- if ('undefined' == typeof Reflect || !Reflect.construct) return !1;
- if (Reflect.construct.sham) return !1;
- if ('function' == typeof Proxy) return !0;
- try {
- return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [
- ], function () {
- })),
- !0
- } catch (e) {
- return !1
- }
- }();
- return function () {
- var e,
- t = nb(n);
- return e = a ? (e = nb(this).constructor, Reflect.construct(t, arguments, e)) : t.apply(this, arguments),
- t = this,
- !(e = e) || 'object' !== Qy(e) && 'function' != typeof e ? tb(t) : e
- }
- }
- function tb(e) {
- if (void 0 === e) throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called');
- return e
- }
- function nb(e) {
- return (nb = Object.setPrototypeOf ? Object.getPrototypeOf : function (e) {
- return e.__proto__ || Object.getPrototypeOf(e)
- }) (e)
- }
- function ab(e, t, n) {
- return t in e ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n,
- e
- }
- Fi = function () {
- !function (e, t) {
- if ('function' != typeof t && null !== t) throw new TypeError('Super expression must either be null or a function');
- e.prototype = Object.create(t && t.prototype, {
- constructor: {
- value: e,
- writable: !0,
- configurable: !0
- }
- }),
- t && Xy(e, t)
- }(o, A);
- var e,
- t,
- n,
- r = eb(o);
- function o() {
- var n;
- !function (e, t) {
- if (!(e instanceof t)) throw new TypeError('Cannot call a class as a function')
- }(this, o);
- for (var e = arguments.length, t = Array(e), a = 0; a < e; a++) t[a] = arguments[a];
- return ab(tb(n = r.call.apply(r, [
- this
- ].concat(t))), 'state', $y($y({
- }, o.getFieldsFromForum(n.props.forumDetails)), {
- }, {
- isOpen: !1,
- openSection: {
- forum: !0,
- polls: !0,
- organization: !0
- }
- })),
- ab(tb(n), 'isDropdown', function () {
- return (window.innerWidth || window.document.documentElement.clientWidth || window.document.body.clientWidth || 0) < 768
- }),
- ab(tb(n), 'handleClick', function (e) {
- n.isDropdown() && (n.state.isOpen && 'icon icon-right-bracket' !== e.target.className || e.preventDefault(), n.setState({
- isOpen: !n.state.isOpen
- }))
- }),
- ab(tb(n), 'handleSectionToggle', function (e) {
- yo.a.isFeatureActive('polls_pub_admin') && !n.isDropdown() && n.setState({
- openSection: $y($y({
- }, n.state.openSection), {
- }, ab({
- }, e, !n.state.openSection[e]))
- })
- }),
- ab(tb(n), 'isForumTabActive', function () {
- return Gy.some(function (e) {
- return e.path === n.props.history.location.pathname
- })
- }),
- ab(tb(n), 'isPollsTabActive', function () {
- return Wy.some(function (e) {
- return e.path === n.props.history.location.pathname
- })
- }),
- ab(tb(n), 'isOrgTabActive', function () {
- return 'organization' === n.props.selection.type
- }),
- ab(tb(n), 'hasFeature', function (e) {
- return 'organization' === n.props.selection.type && n.props.selection.organization.forums.length ? n.props.selection.organizationForums[n.props.selection.organization.forums[0]].features[e] : !(!n.props.forumDetails || !n.props.forumDetails.features) && n.props.forumDetails.features[e]
- }),
- ab(tb(n), 'getForumTabs', function () {
- return Gy.filter(function (e) {
- return '/settings/behind-click/' !== e.path || n.state.behindClickEnabled
- })
- }),
- ab(tb(n), 'getOrgTabs', function () {
- var t = n.props.selection.organization.forums.length,
- e = Vy.map(function (e) {
- return '/settings/sites/' === e.path && (e.aside = t),
- e
- });
- return ql(n.props.selection) && e.push({
- path: '/settings/subscription/',
- label: 'Subscription & Billing'
- }),
- e
- }),
- ab(tb(n), 'linkClassName', function () {
- return n.state.isOpen ? 'nav__item dropdown-open' : 'nav__item'
- }),
- ab(tb(n), 'buildForumLink', function (e) {
- if (!e.feature || n.hasFeature(e.feature)) {
- if ('organization' === n.props.selection.type) return C.a.createElement('a', {
- href: '/admin'.concat(e.path),
- className: n.linkClassName(),
- key: e.path
- }, C.a.createElement(rb, Ky({
- }, e, {
- handleClick: n.handleClick
- })));
- var t = (e.activeRoutes || [
- ]).some(function (e) {
- return n.props.history.isActive(e)
- });
- return C.a.createElement(v.Link, {
- to: e.path,
- className: ''.concat(n.linkClassName()).concat(t ? ' active' : ''),
- activeClassName: 'active',
- key: e.path
- }, C.a.createElement(rb, Ky({
- }, e, {
- handleClick: n.handleClick
- })))
- }
- }),
- ab(tb(n), 'buildOrgLink', function (e) {
- var t = n.props.selection.organization;
- return 'forum' === n.props.selection.type ? C.a.createElement('a', {
- href: '//'.concat(br.disqusHost, '/admin/orgs/').concat(t.id, '/').concat(t.slug).concat(e.path),
- className: n.linkClassName(),
- key: e.path
- }, C.a.createElement(rb, Ky({
- }, e, {
- handleClick: n.handleClick
- }))) : C.a.createElement(v.Link, {
- to: '/orgs/'.concat(t.id, '/').concat(t.slug).concat(e.path),
- className: n.linkClassName(),
- activeClassName: 'active',
- key: e.path
- }, C.a.createElement(rb, Ky({
- }, e, {
- handleClick: n.handleClick
- })))
- }),
- ab(tb(n), 'buildPollsLink', function (e) {
- return C.a.createElement(v.Link, {
- to: ''.concat(e.path),
- className: n.linkClassName(),
- activeClassName: 'active',
- key: e.path
- }, C.a.createElement(rb, Ky({
- }, e, {
- handleClick: n.handleClick
- })))
- }),
- n
- }
- return e = o,
- (t = [
- {
- key: 'componentDidMount',
- value: function () {
- this.props.fetchForumDetails()
- }
- },
- {
- key: 'componentWillReceiveProps',
- value: function (e) {
- !this.props.forumDetails && e.forumDetails ? this.setState($y({
- }, o.getFieldsFromForum(e.forumDetails))) : 'organization' === this.props.selection.type && this.getForumTabs()
- }
- },
- {
- key: 'render',
- value: function () {
- var t = this,
- e = this.getForumTabs(),
- n = this.getOrgTabs(),
- a = this.props.selection.organization && Ur.SAAS_PRODUCT_PLAN_ACTIVE_STATUSES_SET.has(this.props.selection.organization.pollsSubscriptionStatus);
- return C.a.createElement('div', {
- className: 'layout__nav'
- }, this.props.selection.organization && !this.props.selection.organization.pollsOnly && C.a.createElement(Yy, {
- isActive: this.isForumTabActive(),
- isOpen: this.state.openSection.forum,
- label: yo.a.isFeatureActive('polls_pub_admin') ? 'Comments' : 'Site',
- handleToggle: function () {
- return t.handleSectionToggle('forum')
- }
- }, C.a.createElement(C.a.Fragment, null, e.map(function (e) {
- return t.buildForumLink(e)
- }))), yo.a.isFeatureActive('polls_pub_admin', {
- username: this.props.auth.username
- }) && a && C.a.createElement(Yy, {
- isActive: this.isPollsTabActive(),
- isOpen: this.state.openSection.polls,
- label: 'Polls',
- handleToggle: function () {
- return t.handleSectionToggle('polls')
- }
- }, C.a.createElement(C.a.Fragment, null, Wy.map(function (e) {
- return t.buildPollsLink(e)
- }))), C.a.createElement(Yy, {
- isActive: this.isOrgTabActive(),
- isOpen: this.state.openSection.organization,
- label: 'Organization',
- handleToggle: function () {
- return t.handleSectionToggle('organization')
- }
- }, C.a.createElement(C.a.Fragment, null, n.map(function (e) {
- return t.buildOrgLink(e)
- }))))
- }
- }
- ]) && Zy(e.prototype, t),
- n && Zy(e, n),
- o
- }();
- ab(Fi, 'propTypes', {
- auth: Nc.isRequired,
- history: b.a.shape({
- isActive: b.a.func.isRequired
- }).isRequired,
- fetchForumDetails: b.a.func.isRequired,
- forumDetails: $c,
- forumDetailsError: b.a.string,
- forumDetailsIsFetching: b.a.bool,
- selection: ht.isRequired
- }),
- ab(Fi, 'getFieldsFromForum', function (e) {
- var t = (e = e || {
- }).settings || {
- };
- return {
- forum: e.id,
- badgesEnabled: t.badgesEnabled,
- behindClickEnabled: t.behindClickEnabled
- }
- });
- var rb = function (e) {
- return C.a.createElement('div', {
- className: 'nav-lnk -color-muted',
- onClick: e.handleClick
- }, C.a.createElement('div', {
- className: 'nav-lnk__blk'
- }, C.a.createElement('span', null, C.a.createElement('span', {
- className: 'button__text'
- }, e.label), e.isNew ? C.a.createElement('span', {
- className: 'label label-warning spacing-left-small'
- }, 'NEW') : null, e.aside ? C.a.createElement('span', {
- className: 'label--nav-aside spacing-left-small'
- }, e.aside) : null)), C.a.createElement('div', {
- className: 'nav-lnk__pointer'
- }, C.a.createElement('span', {
- className: 'icon icon-right-bracket'
- })))
- };
- rb.propTypes = {
- label: b.a.string.isRequired,
- handleClick: b.a.func.isRequired,
- aside: b.a.oneOfType([b.a.string,
- b.a.number]),
- isNew: b.a.bool,
- children: b.a.oneOfType([b.a.arrayOf(b.a.node),
- b.a.node])
- };
- var ob = Object(u.connect) (function (e) {
- var t = e.forumDetails;
- return {
- forumDetails: t.forumDetails,
- forumDetailsError: t.forumDetailsError,
- forumDetailsIsFetching: t.forumDetailsIsFetching,
- selection: e.selection,
- subscription: e.subscription
- }
- }, {
- fetchForumDetails: ig
- }) (Fo() (Fi)),
- Yi = function (e) {
- e = C.a.createElement('div', null, C.a.createElement(ob, {
- auth: e.auth,
- selection: e.selection
- }), C.a.createElement('div', {
- className: 'layout__content'
- }, e.selection.forum.canAdminister ? C.a.cloneElement(e.children, e) : C.a.createElement(Ki, {
- alertType: 'brand',
- message: 'You don\'t have permission to change this site\'s settings. A site admin can give you permission if needed.'
- })));
- return C.a.createElement('div', {
- className: 'section-contained'
- }, C.a.createElement('div', {
- className: 'layout layout--publishers'
- }, '/settings/ads/' === fo() ? e : C.a.createElement('div', {
- className: 'layout__main'
- }, e)))
- };
- Yi.displayName = 'ForumSettings',
- Yi.propTypes = {
- auth: Nc.isRequired,
- children: b.a.node.isRequired,
- forums: b.a.object.isRequired,
- organizations: b.a.object.isRequired,
- selection: ht.isRequired
- };
- var ib = Object(u.connect) (function (e) {
- return {
- selection: e.selection
- }
- }) (Ni.a.attachDrivers(Yi, [
- bc
- ]));
- function sb(e) {
- return (sb = 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator ? function (e) {
- return typeof e
- }
- : function (e) {
- return e && 'function' == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? 'symbol' : typeof e
- }) (e)
- }
- function lb() {
- return (lb = Object.assign || function (e) {
- for (var t = 1; t < arguments.length; t++) {
- var n,
- a = arguments[t];
- for (n in a) Object.prototype.hasOwnProperty.call(a, n) && (e[n] = a[n])
- }
- return e
- }).apply(this, arguments)
- }
- function cb(e, t) {
- for (var n = 0; n < t.length; n++) {
- var a = t[n];
- a.enumerable = a.enumerable || !1,
- a.configurable = !0,
- 'value' in a && (a.writable = !0),
- Object.defineProperty(e, a.key, a)
- }
- }
- function ub(e, t) {
- return (ub = Object.setPrototypeOf || function (e, t) {
- return e.__proto__ = t,
- e
- }) (e, t)
- }
- function pb(n) {
- var a = function () {
- if ('undefined' == typeof Reflect || !Reflect.construct) return !1;
- if (Reflect.construct.sham) return !1;
- if ('function' == typeof Proxy) return !0;
- try {
- return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [
- ], function () {
- })),
- !0
- } catch (e) {
- return !1
- }
- }();
- return function () {
- var e,
- t = mb(n);
- return e = a ? (e = mb(this).constructor, Reflect.construct(t, arguments, e)) : t.apply(this, arguments),
- t = this,
- !(e = e) || 'object' !== sb(e) && 'function' != typeof e ? db(t) : e
- }
- }
- function db(e) {
- if (void 0 === e) throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called');
- return e
- }
- function mb(e) {
- return (mb = Object.setPrototypeOf ? Object.getPrototypeOf : function (e) {
- return e.__proto__ || Object.getPrototypeOf(e)
- }) (e)
- }
- function fb(e, t, n) {
- return t in e ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n,
- e
- }
- Vi = function () {
- !function (e, t) {
- if ('function' != typeof t && null !== t) throw new TypeError('Super expression must either be null or a function');
- e.prototype = Object.create(t && t.prototype, {
- constructor: {
- value: e,
- writable: !0,
- configurable: !0
- }
- }),
- t && ub(e, t)
- }(o, A);
- var e,
- t,
- n,
- r = pb(o);
- function o() {
- var n;
- !function (e, t) {
- if (!(e instanceof t)) throw new TypeError('Cannot call a class as a function')
- }(this, o);
- for (var e = arguments.length, t = Array(e), a = 0; a < e; a++) t[a] = arguments[a];
- return fb(db(n = r.call.apply(r, [
- this
- ].concat(t))), 'state', {
- error: null,
- passwordError: null,
- isSaving: !1
- }),
- fb(db(n), 'handleDeleteForum', function (e, t) {
- return n.setState({
- isSaving: !0,
- error: null
- }),
- n.apiCall = io.a.call('forums/kill', {
- data: {
- forum: n.props.selection.forum.shortname,
- reason: e,
- password: t
- },
- method: 'POST'
- }).done(n.handleDeleteForumSuccess).fail(n.handleDeleteForumError),
- n.apiCall
- }),
- fb(db(n), 'handleDeleteForumSuccess', function () {
- n.setState({
- error: null,
- isSaving: !1
- }),
- window.location.href = 'https://disqus.com/admin/'
- }),
- fb(db(n), 'handleDeleteForumError', function (e) {
- n.setState(lb({
- isSaving: !1
- }, n.getErrorState(e)))
- }),
- fb(db(n), 'getErrorState', function (e) {
- var t = {
- };
- try {
- var n = JSON.parse(e.responseText).response;
- ~n.indexOf('Invalid password') ? t.passwordError = 'Incorrect password for this account.' : t.error = n
- } catch (e) {
- t.error = 'There was an error deleting this site.'
- }
- return t
- }),
- fb(db(n), 'getComponentProps', function () {
- return {
- forumDeleteError: n.state.error,
- forumDeletePasswordError: n.state.passwordError,
- forumDeleteIsSaving: n.state.isSaving,
- forumDeleteOnSave: n.handleDeleteForum
- }
- }),
- n
- }
- return e = o,
- (t = [
- {
- key: 'componentWillUnmount',
- value: function () {
- this.apiCall && 'pending' === this.apiCall.state() && this.apiCall.abort()
- }
- }
- ]) && cb(e.prototype, t),
- n && cb(e, n),
- o
- }();
- fb(Vi, 'displayName', 'ForumDeleteDriver'),
- fb(Vi, 'propTypes', {
- selection: ht.isRequired
- });
- sl = Object(ki.createDriver) (Vi, function (e) {
- return {
- selection: e.selection
- }
- });
- function hb(e) {
- return (hb = 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator ? function (e) {
- return typeof e
- }
- : function (e) {
- return e && 'function' == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? 'symbol' : typeof e
- }) (e)
- }
- function gb(e, t) {
- for (var n = 0; n < t.length; n++) {
- var a = t[n];
- a.enumerable = a.enumerable || !1,
- a.configurable = !0,
- 'value' in a && (a.writable = !0),
- Object.defineProperty(e, a.key, a)
- }
- }
- function yb(e, t) {
- return (yb = Object.setPrototypeOf || function (e, t) {
- return e.__proto__ = t,
- e
- }) (e, t)
- }
- function bb(n) {
- var a = function () {
- if ('undefined' == typeof Reflect || !Reflect.construct) return !1;
- if (Reflect.construct.sham) return !1;
- if ('function' == typeof Proxy) return !0;
- try {
- return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [
- ], function () {
- })),
- !0
- } catch (e) {
- return !1
- }
- }();
- return function () {
- var e,
- t = _b(n);
- return e = a ? (e = _b(this).constructor, Reflect.construct(t, arguments, e)) : t.apply(this, arguments),
- t = this,
- !(e = e) || 'object' !== hb(e) && 'function' != typeof e ? vb(t) : e
- }
- }
- function vb(e) {
- if (void 0 === e) throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called');
- return e
- }
- function _b(e) {
- return (_b = Object.setPrototypeOf ? Object.getPrototypeOf : function (e) {
- return e.__proto__ || Object.getPrototypeOf(e)
- }) (e)
- }
- function Eb(e, t, n) {
- return t in e ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n,
- e
- }
- yc = function () {
- !function (e, t) {
- if ('function' != typeof t && null !== t) throw new TypeError('Super expression must either be null or a function');
- e.prototype = Object.create(t && t.prototype, {
- constructor: {
- value: e,
- writable: !0,
- configurable: !0
- }
- }),
- t && yb(e, t)
- }(o, A);
- var e,
- t,
- n,
- r = bb(o);
- function o() {
- var t;
- !function (e, t) {
- if (!(e instanceof t)) throw new TypeError('Cannot call a class as a function')
- }(this, o);
- for (var e = arguments.length, n = Array(e), a = 0; a < e; a++) n[a] = arguments[a];
- return Eb(vb(t = r.call.apply(r, [
- this
- ].concat(n))), 'state', {
- fetchError: null,
- saveError: null,
- isSaving: !1,
- isFetching: !1,
- trustedDomainList: null,
- isSaved: !1
- }),
- Eb(vb(t), 'fetchTrustedDomainList', function () {
- return t.setState({
- isFetching: !0,
- fetchError: null
- }),
- t.apiCall = io.a.call('forums/trustedDomain/list', {
- data: {
- forum: t.props.selection.forum.shortname
- }
- }).done(function (e) {
- t.setState({
- isFetching: !1,
- trustedDomainList: e.response
- })
- }).fail(function (e) {
- t.setState({
- isFetching: !1,
- fetchError: t.parseErrorResponse(e)
- })
- }),
- t.apiCall
- }),
- Eb(vb(t), 'handleCreateTrustedDomain', function (e) {
- return t.setState({
- isSaving: !0,
- saveError: null,
- isSaved: !1
- }),
- t.apiCall = io.a.call('forums/trustedDomain/create', {
- data: {
- forum: t.props.selection.forum.shortname,
- domainName: e
- },
- method: 'POST'
- }).done(t.handleSaveTrustedDomainSuccess).fail(t.handleSaveTrustedDomainError),
- t.apiCall
- }),
- Eb(vb(t), 'handleKillTrustedDomain', function (e) {
- return t.setState({
- isSaving: !0,
- saveError: null,
- isSaved: !1
- }),
- t.apiCall = io.a.call('forums/trustedDomain/kill', {
- data: {
- forum: t.props.selection.forum.shortname,
- domain: e
- },
- method: 'POST'
- }).done(t.handleSaveTrustedDomainSuccess).fail(t.handleSaveTrustedDomainError),
- t.apiCall
- }),
- Eb(vb(t), 'handleSaveTrustedDomainSuccess', function () {
- t.setState({
- saveError: null,
- isSaving: !1,
- isSaved: !0
- }),
- t.fetchTrustedDomainList()
- }),
- Eb(vb(t), 'handleSaveTrustedDomainError', function (e) {
- t.setState({
- saveError: t.parseErrorResponse(e),
- isSaving: !1
- })
- }),
- Eb(vb(t), 'parseErrorResponse', function (e) {
- var t;
- try {
- ~(t = JSON.parse(e.responseText).response).indexOf('Invalid argument, \'domainName\'') && (t = 'This domain name isn\'t valid. The domain should be formatted like \'example.com\'')
- } catch (e) {
- t = 'There was an error saving your changes.'
- }
- return t
- }),
- Eb(vb(t), 'getComponentProps', function () {
- return {
- trustedDomainList: t.state.trustedDomainList,
- trustedDomainOnCreate: t.handleCreateTrustedDomain,
- trustedDomainOnKill: t.handleKillTrustedDomain,
- trustedDomainFetchError: t.state.fetchError,
- trustedDomainSaveError: t.state.saveError,
- trustedDomainIsFetching: t.state.isFetching,
- trustedDomainIsSaving: t.state.isSaving,
- trustedDomainIsSaved: t.state.isSaved
- }
- }),
- t
- }
- return e = o,
- (t = [
- {
- key: 'componentDidMount',
- value: function () {
- this.fetchTrustedDomainList()
- }
- },
- {
- key: 'componentWillUnmount',
- value: function () {
- this.apiCall && 'pending' === this.apiCall.state() && this.apiCall.abort()
- }
- }
- ]) && gb(e.prototype, t),
- n && gb(e, n),
- o
- }();
- Eb(yc, 'displayName', 'TrustedDomainDriver'),
- Eb(yc, 'propTypes', {
- selection: ht.isRequired
- });
- yl = Object(ki.createDriver) (yc, function (e) {
- return {
- selection: e.selection
- }
- }),
- Li = function (e) {
- var t = ''.concat(e.idNamespace || '', '_').concat(e.name),
- n = 'text-medium fieldset__block--checkbox '.concat(e.additionalClass || '', ' ').concat(e.readOnly ? 'readOnly' : ''),
- a = e.labelAdditionalClass || '',
- r = '-fieldset__block--checkbox'.concat(e.fieldsetAdditionalClass ? ' '.concat(e.fieldsetAdditionalClass) : '') || !1,
- t = C.a.createElement('label', {
- htmlFor: t,
- className: n
- }, C.a.createElement('input', {
- name: e.name || '',
- type: 'checkbox',
- id: t,
- checked: e.checked,
- value: e.value,
- onChange: e.onChange,
- disabled: e.readOnly,
- readOnly: e.readOnly
- }), e.secondaryLabel, e.ignoreFieldset ? e.children : null);
- return e.ignoreFieldset ? t : C.a.createElement(kf, {
- label: e.label,
- labelAdditionalClass: a,
- fieldsetAdditionalClass: r,
- tooltip: e.tooltip,
- shouldHighlight: e.shouldHighlight,
- childIsInput: !0
- }, t, e.children)
- };
- Li.propTypes = {
- name: b.a.string,
- checked: b.a.bool,
- value: b.a.oneOfType([b.a.string,
- b.a.number]),
- additionalClass: b.a.string,
- label: b.a.node,
- labelAdditionalClass: b.a.string,
- fieldsetAdditionalClass: b.a.string,
- secondaryLabel: b.a.node,
- onChange: b.a.func.isRequired,
- idNamespace: b.a.string,
- tooltip: b.a.node,
- children: b.a.node,
- readOnly: b.a.bool,
- shouldHighlight: b.a.bool,
- ignoreFieldset: b.a.bool
- };
- var Ob = Li,
- Pc = n(8),
- Sb = n.n(Pc);
- function wb(e) {
- return (wb = 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator ? function (e) {
- return typeof e
- }
- : function (e) {
- return e && 'function' == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? 'symbol' : typeof e
- }) (e)
- }
- function Pb(t, e) {
- var n,
- a = Object.keys(t);
- return Object.getOwnPropertySymbols && (n = Object.getOwnPropertySymbols(t), e && (n = n.filter(function (e) {
- return Object.getOwnPropertyDescriptor(t, e).enumerable
- })), a.push.apply(a, n)),
- a
- }
- function kb(t) {
- for (var e = 1; e < arguments.length; e++) {
- var n = null != arguments[e] ? arguments[e] : {
- };
- e % 2 ? Pb(Object(n), !0).forEach(function (e) {
- Ib(t, e, n[e])
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(n)) : Pb(Object(n)).forEach(function (e) {
- Object.defineProperty(t, e, Object.getOwnPropertyDescriptor(n, e))
- })
- }
- return t
- }
- function Nb(e, t) {
- if (!(e instanceof t)) throw new TypeError('Cannot call a class as a function')
- }
- function Cb(e, t) {
- for (var n = 0; n < t.length; n++) {
- var a = t[n];
- a.enumerable = a.enumerable || !1,
- a.configurable = !0,
- 'value' in a && (a.writable = !0),
- Object.defineProperty(e, a.key, a)
- }
- }
- function Rb(e, t, n) {
- return t && Cb(e.prototype, t),
- n && Cb(e, n),
- e
- }
- function xb(e, t) {
- if ('function' != typeof t && null !== t) throw new TypeError('Super expression must either be null or a function');
- e.prototype = Object.create(t && t.prototype, {
- constructor: {
- value: e,
- writable: !0,
- configurable: !0
- }
- }),
- t && Ab(e, t)
- }
- function Ab(e, t) {
- return (Ab = Object.setPrototypeOf || function (e, t) {
- return e.__proto__ = t,
- e
- }) (e, t)
- }
- function Db(n) {
- var a = function () {
- if ('undefined' == typeof Reflect || !Reflect.construct) return !1;
- if (Reflect.construct.sham) return !1;
- if ('function' == typeof Proxy) return !0;
- try {
- return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [
- ], function () {
- })),
- !0
- } catch (e) {
- return !1
- }
- }();
- return function () {
- var e,
- t = Tb(n);
- return e = a ? (e = Tb(this).constructor, Reflect.construct(t, arguments, e)) : t.apply(this, arguments),
- t = this,
- !(e = e) || 'object' !== wb(e) && 'function' != typeof e ? jb(t) : e
- }
- }
- function jb(e) {
- if (void 0 === e) throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called');
- return e
- }
- function Tb(e) {
- return (Tb = Object.setPrototypeOf ? Object.getPrototypeOf : function (e) {
- return e.__proto__ || Object.getPrototypeOf(e)
- }) (e)
- }
- function Ib(e, t, n) {
- return t in e ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n,
- e
- }
- Fc = function () {
- xb(o, A);
- var r = Db(o);
- function o() {
- var a;
- Nb(this, o);
- for (var e = arguments.length, t = Array(e), n = 0; n < e; n++) t[n] = arguments[n];
- return Ib(jb(a = r.call.apply(r, [
- this
- ].concat(t))), 'state', kb(kb({
- }, o.getEditableFieldsFromForum(a.props.forumDetails)), {
- }, {
- savedFields: o.getEditableFieldsFromForum(a.props.forumDetails),
- deleteFormExpanded: !1,
- newTrustedDomain: null,
- isTosExempt: o.isTosExempt(a.props.selection.forum.shortname)
- })),
- Ib(jb(a), 'confirmNavigationIfUnsaved', function () {
- if (a.hasUnsavedChanges()) return 'You have unsaved changes. Do you want to leave this page?'
- }),
- Ib(jb(a), 'handleInputChange', function (e, t) {
- var n = t.target,
- t = 'checkbox' === n.type ? n.checked : n.value,
- t = Ib({
- }, e, t = 'radio' === n.type ? 'true' === t : t);
- a.setState(t)
- }),
- Ib(jb(a), 'hasFieldChanged', function (e) {
- return a.state[e] !== a.state.savedFields[e] && !(null === a.state.savedFields[e] && '' === a.state[e])
- }),
- Ib(jb(a), 'handleAddNewTrustedDomain', function () {
- a.props.trustedDomainOnCreate(a.state.newTrustedDomain).then(function () {
- a.setState({
- newTrustedDomain: null
- })
- })
- }),
- Ib(jb(a), 'hasUnsavedChanges', function () {
- return Object.keys(a.state.savedFields).some(function (e) {
- return a.hasFieldChanged(e)
- })
- }),
- Ib(jb(a), 'handleSaveChanges', function () {
- a.props.forumUpdateOnSave({
- disableThirdPartyTrackers: a.state.enable3rdPartyTrackers ? 0 : 1,
- linkAffiliationEnabled: a.state.linkAffiliationEnabled ? 1 : 0
- }).done(function () {
- a.setState(function (e) {
- return {
- savedFields: {
- enable3rdPartyTrackers: e.enable3rdPartyTrackers,
- linkAffiliationEnabled: e.linkAffiliationEnabled
- }
- }
- })
- })
- }),
- a
- }
- return Rb(o, [
- {
- key: 'componentDidMount',
- value: function () {
- this.props.history.setRouteLeaveHook(this.props.route, this.confirmNavigationIfUnsaved),
- this.props.fetchForumDetails()
- }
- },
- {
- key: 'componentWillReceiveProps',
- value: function (e) {
- !this.props.forumDetails && e.forumDetails && (e = o.getEditableFieldsFromForum(e.forumDetails), this.setState(kb(kb({
- }, e), {
- }, {
- savedFields: e
- })))
- }
- },
- {
- key: 'render',
- value: function () {
- var t = this;
- if (this.props.selection.organization && this.props.selection.organization.pollsOnly) return C.a.createElement(Cm, {
- isPolls: !1,
- organization: this.props.selection.organization
- });
- if (this.props.forumDetailsIsFetching) return C.a.createElement(Ji, null);
- if (this.props.forumDetailsError) return C.a.createElement('div', {
- className: 'content__wrap spacing-bottom-double'
- }, C.a.createElement(Ki, {
- message: this.props.forumDetailsError,
- alertType: 'error'
- }));
- var e = null,
- e = '' + this.context.auth.id === (this.props.forumDetails && this.props.forumDetails.founder) ? this.state.deleteFormExpanded ? C.a.createElement(o.DeleteForm, {
- error: this.props.forumDeleteError,
- passwordError: this.props.forumDeletePasswordError,
- isSaving: this.props.forumDeleteIsSaving,
- onConfirm: this.props.forumDeleteOnSave,
- onCancel: function () {
- return t.setState({
- deleteFormExpanded: !1
- })
- }
- }) : C.a.createElement('div', null, C.a.createElement('button', {
- className: 'button button-fill button-medium',
- onClick: function () {
- return t.setState({
- deleteFormExpanded: !0
- })
- }
- }, 'Delete site and comments.'), C.a.createElement('p', {
- className: 'fieldset__description text-small text-gray'
- }, 'This cannot be undone.')) : C.a.createElement('p', {
- className: 'text-small text-gray spacing-top'
- }, 'Only the primary moderator can delete this site.');
- return C.a.createElement('div', null, C.a.createElement('div', {
- className: 'content__wrap spacing-bottom-double'
- }, C.a.createElement('header', {
- className: 'settings__header'
- }, C.a.createElement('h2', {
- className: 'text-larger text-gray-darker spacing-bottom-small'
- }, 'Deeply integrate Disqus with your community.'), C.a.createElement('p', {
- className: 'text-gray'
- }, 'Disqus plays well with other systems and offers advanced integration options to developers. ', C.a.createElement('a', {
- href: Pn.developer,
- target: '_blank'
- }, 'Learn more »'))), C.a.createElement('section', {
- className: 'settings__content'
- }, C.a.createElement(Ob, {
- readOnly: this.state.isTosExempt,
- name: 'enable3rdPartyTrackers',
- checked: !this.state.isTosExempt && !!this.state.enable3rdPartyTrackers,
- label: 'Tracking',
- secondaryLabel: 'Enable anonymous cookie targeting for your site\'s visitors.',
- onChange: this.handleInputChange.bind(this, 'enable3rdPartyTrackers'),
- idNamespace: this.constructor.displayName,
- shouldHighlight: this.hasFieldChanged('enable3rdPartyTrackers'),
- tooltip: this.state.isTosExempt ? C.a.createElement(C.a.Fragment, null, 'This feature is disabled for your site. Please contact your account manager for assistance.') : C.a.createElement(C.a.Fragment, null, 'This helps to provide personalized content and advertising for your site\'s visitors. ', C.a.createElement('a', {
- href: ''.concat(Pn.adTraining, '?utm_source=disqus&utm_medium=forumset-tracking&utm_content=txt'),
- target: '_blank',
- rel: 'noopener noreferrer'
- }, 'Learn more »'))
- }), C.a.createElement(Ob, {
- name: 'linkAffiliationEnabled',
- checked: !!this.state.linkAffiliationEnabled,
- label: 'Affiliate links',
- secondaryLabel: 'Automatically append merchant codes to product links on your site.',
- onChange: this.handleInputChange.bind(this, 'linkAffiliationEnabled'),
- idNamespace: this.constructor.displayName,
- shouldHighlight: this.hasFieldChanged('linkAffiliationEnabled')
- })), C.a.createElement('footer', {
- className: 'settings__footer'
- }, C.a.createElement(Bh, {
- disabled: !this.hasUnsavedChanges(),
- onClick: this.handleSaveChanges,
- isSaving: this.props.forumUpdateIsSaving,
- isSaved: this.props.forumUpdateIsSaved
- }, this.props.forumUpdateError ? C.a.createElement('p', {
- className: 'text-medium text-error text-semibold spacing-narrow'
- }, this.props.forumUpdateError) : null))), C.a.createElement('div', {
- className: 'content__wrap spacing-bottom-double'
- }, C.a.createElement('header', {
- className: 'settings__header'
- }, C.a.createElement('h2', {
- className: 'text-larger text-gray-darker spacing-bottom-small'
- }, 'Trusted Domains'), C.a.createElement('p', {
- className: 'text-gray'
- }, 'You may optionally specify a list of trusted domains that are allowed to load your Disqus comments embed.')), C.a.createElement('section', {
- className: 'settings__content'
- }, C.a.createElement(kf, {
- label: 'Trusted Domains',
- blockAdditionalClass: this.props.trustedDomainSaveError ? 'is-error' : null,
- tooltip: C.a.createElement(C.a.Fragment, null, 'Adding a domain will include all subdomains below it, e.g. ', C.a.createElement('code', null, 'disqus.com'), ' will include that domain, as well as ', C.a.createElement('code', null, 'blog.disqus.com'), ' and ', C.a.createElement('code', null, 'help.disqus.com'), '.')
- }, (this.props.trustedDomainList || [
- ]).map(function (e) {
- return C.a.createElement('div', {
- key: e.id,
- className: 'spacing-narrow text-medium'
- }, C.a.createElement('button', {
- onClick: t.props.trustedDomainOnKill.bind(null, e.id),
- disabled: t.props.trustedDomainIsSaving,
- className: 'text-medium'
- }, C.a.createElement('span', {
- className: 'text-gray-dark spacing-right-small'
- }, e.domain), C.a.createElement('span', {
- className: 'icon-smallest icon-cancel'
- })))
- }), C.a.createElement('form', null, C.a.createElement('div', {
- className: 'align'
- }, C.a.createElement('input', {
- type: 'text',
- className: 'input--textbox spacing-right-small align__item--grow',
- placeholder: 'Enter a domain, e.g. disqus.com',
- value: null === this.state.newTrustedDomain ? '' : this.state.newTrustedDomain,
- onChange: function (e) {
- return t.setState({
- newTrustedDomain: e.target.value
- })
- },
- disabled: this.props.trustedDomainIsSaving
- }), C.a.createElement('button', {
- className: 'button button-small button-fill',
- onClick: this.handleAddNewTrustedDomain,
- disabled: this.props.trustedDomainIsSaving
- }, 'Add')), this.props.trustedDomainSaveError ? C.a.createElement('p', {
- className: 'text-medium text-error text-semibold spacing-narrow'
- }, this.props.trustedDomainSaveError) : null)))), C.a.createElement('div', {
- className: 'content__wrap spacing-bottom-double'
- }, C.a.createElement('header', {
- className: 'settings__header'
- }, C.a.createElement('h2', {
- className: 'text-larger text-gray-darker spacing-bottom-small'
- }, 'Delete from Disqus'), C.a.createElement('p', {
- className: 'text-gray'
- }, 'Site data can not be recovered once a site is deleted so please be certain before taking this action.')), C.a.createElement('section', {
- className: 'settings__content'
- }, C.a.createElement(kf, {
- label: 'Delete from Disqus',
- blockAdditionalClass: this.props.forumDeletePasswordError ? 'is-error' : null
- }, e))))
- }
- }
- ]),
- o
- }();
- Ib(Fc, 'displayName', 'ForumSettingsAdvanced'),
- Ib(Fc, 'propTypes', {
- history: b.a.shape({
- setRouteLeaveHook: b.a.func.isRequired
- }).isRequired,
- route: b.a.object.isRequired,
- forumDetails: $c,
- forumDetailsError: b.a.string,
- forumDetailsIsFetching: b.a.bool,
- fetchForumDetails: b.a.func.isRequired,
- forumUpdateError: b.a.string,
- forumUpdateIsSaving: b.a.bool,
- forumUpdateIsSaved: b.a.bool,
- forumUpdateOnSave: b.a.func.isRequired,
- trustedDomainList: b.a.arrayOf(Cl),
- trustedDomainOnCreate: b.a.func.isRequired,
- trustedDomainOnKill: b.a.func.isRequired,
- trustedDomainSaveError: b.a.string,
- trustedDomainIsSaving: b.a.bool,
- forumDeleteError: b.a.string,
- forumDeletePasswordError: b.a.string,
- forumDeleteIsSaving: b.a.bool,
- forumDeleteOnSave: b.a.func.isRequired
- }),
- Ib(Fc, 'contextTypes', {
- auth: b.a.object
- }),
- Ib(Fc, 'getEditableFieldsFromForum', function (e) {
- e = (e = e || {
- }) && e.settings || {
- };
- return {
- enable3rdPartyTrackers: !e.disable3rdPartyTrackers,
- linkAffiliationEnabled: e.linkAffiliationEnabled
- }
- }),
- Ib(Fc, 'isTosExempt', function (e) {
- return Sb.a.tos_exempt_forums_shortnames.includes(e = e || '')
- }),
- Fc.DeleteForm = (lh = Yc = function () {
- xb(o, A);
- var r = Db(o);
- function o() {
- var t;
- Nb(this, o);
- for (var e = arguments.length, n = Array(e), a = 0; a < e; a++) n[a] = arguments[a];
- return Ib(jb(t = r.call.apply(r, [
- this
- ].concat(n))), 'state', {
- reason: null,
- password: null
- }),
- Ib(jb(t), 'handleReasonInputChange', function (e) {
- t.setState({
- reason: e.target.value
- })
- }),
- Ib(jb(t), 'handlePasswordInputChange', function (e) {
- t.setState({
- password: e.target.value
- })
- }),
- t
- }
- return Rb(o, [
- {
- key: 'render',
- value: function () {
- var n = this,
- e = !!this.state.reason,
- t = !(!e || !this.state.password),
- a = t && !this.props.isSaving;
- return C.a.createElement('div', null, C.a.createElement('div', {
- className: 'spacing-top-narrow'
- }, C.a.createElement('h3', {
- className: 'text-medium'
- }, 'Please tell us why (required)'), bf.map(function (e, t) {
- return C.a.createElement('label', {
- key: t,
- className: 'text-medium align align--middle spacing-top-narrow'
- }, C.a.createElement('input', {
- type: 'radio',
- name: 'ForumSettingsAdvancedDeleteForm_reason',
- onChange: n.handleReasonInputChange,
- value: e,
- disabled: n.props.isSaving,
- readOnly: n.props.isSaving
- }), e)
- })), e ? C.a.createElement('div', {
- className: 'spacing-top'
- }, C.a.createElement('h4', {
- className: 'text-medium'
- }, 'Please enter your password to confirm deletion.'), C.a.createElement('div', {
- className: 'align align--middle spacing-narrow'
- }, C.a.createElement('div', {
- className: 'text-gray spacing-right text-medium'
- }, 'Password'), C.a.createElement('div', {
- className: 'fieldset-item__input'
- }, C.a.createElement('input', {
- type: 'password',
- className: 'input--textbox',
- onChange: this.handlePasswordInputChange,
- disabled: this.props.isSaving,
- readOnly: this.props.isSaving
- }))), this.props.passwordError ? C.a.createElement('p', {
- className: 'text-medium text-error text-semibold spacing-narrow'
- }, this.props.passwordError) : null) : null, C.a.createElement('div', null, t ? C.a.createElement('p', {
- className: 'fieldset__description text-small text-gray spacing-narrow spacing-bottom'
- }, 'This will delete your website and its comments from Disqus. ', C.a.createElement('strong', null, 'Are you sure?')) : null, C.a.createElement('div', {
- className: 'spacing-top'
- }, C.a.createElement('button', {
- disabled: !a,
- className: 'button button-fill button-fill--red button-small',
- onClick: this.props.onConfirm.bind(null, this.state.reason, this.state.password)
- }, 'Delete'), C.a.createElement('span', {
- className: 'spacing-left spacing-right text-medium'
- }, 'or'), C.a.createElement('button', {
- className: 'button button-fill button-small',
- onClick: this.props.onCancel
- }, 'Cancel'), this.props.error ? C.a.createElement('p', {
- className: 'text-medium text-error text-semibold spacing-narrow'
- }, this.props.error) : null)))
- }
- }
- ]),
- o
- }(), Ib(Yc, 'propTypes', {
- error: b.a.string,
- passwordError: b.a.string,
- isSaving: b.a.bool,
- onConfirm: b.a.func.isRequired,
- onCancel: b.a.func.isRequired
- }), lh);
- vh = Object(u.connect) (function (e) {
- var t = e.forumDetails;
- return {
- forumDetails: t.forumDetails,
- forumDetailsError: t.forumDetailsError,
- forumDetailsIsFetching: t.forumDetailsIsFetching,
- selection: e.selection
- }
- }, {
- fetchForumDetails: ig
- }) (Ni.a.attachDrivers(Fo() (Fc), [
- sl,
- m,
- yl
- ]));
- function qb(e) {
- return (qb = 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator ? function (e) {
- return typeof e
- }
- : function (e) {
- return e && 'function' == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? 'symbol' : typeof e
- }) (e)
- }
- function Fb(t, e) {
- var n,
- a = Object.keys(t);
- return Object.getOwnPropertySymbols && (n = Object.getOwnPropertySymbols(t), e && (n = n.filter(function (e) {
- return Object.getOwnPropertyDescriptor(t, e).enumerable
- })), a.push.apply(a, n)),
- a
- }
- function Lb(t) {
- for (var e = 1; e < arguments.length; e++) {
- var n = null != arguments[e] ? arguments[e] : {
- };
- e % 2 ? Fb(Object(n), !0).forEach(function (e) {
- Gb(t, e, n[e])
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(n)) : Fb(Object(n)).forEach(function (e) {
- Object.defineProperty(t, e, Object.getOwnPropertyDescriptor(n, e))
- })
- }
- return t
- }
- function Ub(e, t) {
- for (var n = 0; n < t.length; n++) {
- var a = t[n];
- a.enumerable = a.enumerable || !1,
- a.configurable = !0,
- 'value' in a && (a.writable = !0),
- Object.defineProperty(e, a.key, a)
- }
- }
- function Mb(e, t) {
- return (Mb = Object.setPrototypeOf || function (e, t) {
- return e.__proto__ = t,
- e
- }) (e, t)
- }
- function Bb(n) {
- var a = function () {
- if ('undefined' == typeof Reflect || !Reflect.construct) return !1;
- if (Reflect.construct.sham) return !1;
- if ('function' == typeof Proxy) return !0;
- try {
- return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [
- ], function () {
- })),
- !0
- } catch (e) {
- return !1
- }
- }();
- return function () {
- var e,
- t = Hb(n);
- return e = a ? (e = Hb(this).constructor, Reflect.construct(t, arguments, e)) : t.apply(this, arguments),
- t = this,
- !(e = e) || 'object' !== qb(e) && 'function' != typeof e ? zb(t) : e
- }
- }
- function zb(e) {
- if (void 0 === e) throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called');
- return e
- }
- function Hb(e) {
- return (Hb = Object.setPrototypeOf ? Object.getPrototypeOf : function (e) {
- return e.__proto__ || Object.getPrototypeOf(e)
- }) (e)
- }
- function Gb(e, t, n) {
- return t in e ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n,
- e
- }
- var Vb = function () {
- !function (e, t) {
- if ('function' != typeof t && null !== t) throw new TypeError('Super expression must either be null or a function');
- e.prototype = Object.create(t && t.prototype, {
- constructor: {
- value: e,
- writable: !0,
- configurable: !0
- }
- }),
- t && Mb(e, t)
- }(o, A);
- var e,
- t,
- n,
- r = Bb(o);
- function o() {
- var a;
- !function (e, t) {
- if (!(e instanceof t)) throw new TypeError('Cannot call a class as a function')
- }(this, o);
- for (var e = arguments.length, t = Array(e), n = 0; n < e; n++) t[n] = arguments[n];
- return Gb(zb(a = r.call.apply(r, [
- this
- ].concat(t))), 'state', Lb(Lb({
- }, o.getEditableFieldsFromForum(a.props.forumDetails)), {
- }, {
- invalidFields: {
- },
- savedFields: o.getEditableFieldsFromForum(a.props.forumDetails)
- })),
- Gb(zb(a), 'confirmNavigationIfUnsaved', function () {
- if (a.hasUnsavedChanges()) return 'You have unsaved changes. Do you want to leave this page?'
- }),
- Gb(zb(a), 'handleInputChange', function (t, e) {
- var e = e.target,
- n = 'checkbox' !== e.type || null != e.value && '' !== e.value ? e.value : e.checked;
- 'text' === e.type || 'boolean' == typeof n || '' === n || isNaN(n) || (n = parseInt(n, 10)),
- a.setState(function (e) {
- e = Lb(Lb({
- }, e), {
- }, Gb({
- }, t, n));
- return e.invalidFields[t] = !a.validateField(t, n),
- e
- })
- }),
- Gb(zb(a), 'hasFieldChanged', function (e) {
- return a.state[e] !== a.state.savedFields[e] && !(null === a.state.savedFields[e] && '' === a.state[e])
- }),
- Gb(zb(a), 'hasUnsavedChanges', function () {
- return Object.keys(a.state.savedFields).some(function (e) {
- return a.hasFieldChanged(e)
- })
- }),
- Gb(zb(a), 'handleSaveChanges', function () {
- var e = {
- commentsLinkZero: a.state.commentsLinkZero,
- commentsLinkOne: a.state.commentsLinkOne,
- commentsLinkMultiple: a.state.commentsLinkMultiple,
- moderatorBadgeText: a.state.moderatorBadgeText,
- sort: a.state.sort,
- validateAllPosts: a.state.validateAllPosts ? 1 : 0,
- unapproveLinks: a.state.unapproveLinks ? 1 : 0,
- mediaembedEnabled: a.state.mediaembedEnabled ? 1 : 0,
- gifPickerEnabled: a.state.gifPickerEnabled ? 1 : 0,
- flaggingNotifications: a.state.flaggingNotifications ? 1 : 0,
- flaggingEnabled: a.state.flaggingEnabled ? 1 : 0,
- flagThreshold: a.state.flagThreshold,
- daysThreadAlive: a.state.daysThreadAlive,
- twitterName: a.state.twitterName,
- allowAnonPost: a.state.allowAnonPost ? 1 : 0,
- votingType: a.state.votingType
- };
- a.hasFeature('threadRatings') && (e.threadRatingsEnabled = a.state.threadRatingsEnabled ? 1 : 0),
- a.hasFeature('embedCustomizations') && yo.a.isFeatureActive('embed_customizations', {
- forum: a.props.selection.forum.shortname
- }) && (e.disableSocialShare = a.state.disableSocialShare ? 1 : 0, e.initialCommentCount = a.state.initialCommentCount, e.commentsPlaceholderTextEmpty = a.state.commentsPlaceholderTextEmpty, e.commentsPlaceholderTextPopulated = a.state.commentsPlaceholderTextPopulated),
- a.props.forumUpdateOnSave(e).done(function () {
- a.setState(function (e) {
- return {
- savedFields: {
- commentsLinkZero: e.commentsLinkZero,
- commentsLinkOne: e.commentsLinkOne,
- commentsLinkMultiple: e.commentsLinkMultiple,
- moderatorBadgeText: e.moderatorBadgeText,
- sort: e.sort,
- validateAllPosts: e.validateAllPosts,
- unapproveLinks: e.unapproveLinks,
- mediaembedEnabled: e.mediaembedEnabled,
- gifPickerEnabled: e.gifPickerEnabled,
- flaggingNotifications: e.flaggingNotifications,
- flaggingEnabled: e.flaggingEnabled,
- flagThreshold: e.flagThreshold,
- daysThreadAlive: e.daysThreadAlive,
- twitterName: e.twitterName,
- allowAnonPost: e.allowAnonPost,
- votingType: e.votingType,
- threadRatingsEnabled: e.threadRatingsEnabled,
- disableSocialShare: e.disableSocialShare,
- initialCommentCount: e.initialCommentCount,
- commentsPlaceholderTextEmpty: e.commentsPlaceholderTextEmpty,
- commentsPlaceholderTextPopulated: e.commentsPlaceholderTextPopulated
- }
- }
- })
- })
- }),
- Gb(zb(a), 'validateField', function (e, t) {
- return 'initialCommentCount' !== e || _f.min <= t && t <= _f.max
- }),
- Gb(zb(a), 'hasInvalidFields', function () {
- return 0 < Object.keys(a.state.invalidFields).filter(function (e) {
- return !0 === a.state.invalidFields[e]
- }).length
- }),
- Gb(zb(a), 'getInputId', function (e) {
- return ''.concat(a.constructor.displayName, '_').concat(e)
- }),
- Gb(zb(a), 'hasFeature', function (e) {
- return !!(a.props.forumDetails && a.props.forumDetails.features && a.props.forumDetails.features[e])
- }),
- a
- }
- return e = o,
- (t = [
- {
- key: 'componentDidMount',
- value: function () {
- this.props.history.setRouteLeaveHook(this.props.route, this.confirmNavigationIfUnsaved),
- this.props.fetchForumDetails()
- }
- },
- {
- key: 'componentWillReceiveProps',
- value: function (e) {
- !this.props.forumDetails && e.forumDetails && this.setState(Lb(Lb({
- }, o.getEditableFieldsFromForum(e.forumDetails)), {
- }, {
- savedFields: o.getEditableFieldsFromForum(e.forumDetails)
- }))
- }
- },
- {
- key: 'render',
- value: function () {
- var t = this;
- if (this.props.selection.organization && this.props.selection.organization.pollsOnly) return C.a.createElement(Cm, {
- isPolls: !1,
- organization: this.props.selection.organization
- });
- if (this.props.forumDetailsIsFetching) return C.a.createElement(Ji, null);
- if (this.props.forumDetailsError) return C.a.createElement('div', {
- className: 'content__wrap spacing-bottom-double'
- }, C.a.createElement(Ki, {
- message: this.props.forumDetailsError,
- alertType: 'error'
- }));
- var e = this.props.organizations[this.props.selection.forum.organization],
- n = this.hasFeature('threadRatings'),
- a = this.hasFeature('embedCustomizations'),
- r = [
- ],
- o = [
- ],
- i = C.a.createElement(Ob, {
- name: 'threadRatingsEnabled',
- key: 'threadRatingsEnabled',
- checked: n && !!this.state.threadRatingsEnabled,
- label: C.a.createElement('span', null, n || yo.a.isFeatureActive('embed_customizations', {
- forum: this.props.selection.forum.shortname
- }) ? null : C.a.createElement(Ks, {
- emitEvent: function (e) {
- return t.props.emitTrackingEvent(Lb({
- area: 'thread_ratings'
- }, e))
- },
- organization: e,
- iconClass: 'spacing-right-small'
- }), 'Star Ratings'),
- secondaryLabel: 'Enable Star Ratings',
- onChange: this.handleInputChange.bind(this, 'threadRatingsEnabled'),
- idNamespace: this.constructor.displayName,
- readOnly: !n || this.props.forumUpdateIsSaving,
- disabled: !n || this.props.forumUpdateIsSaving,
- shouldHighlight: this.hasFieldChanged('threadRatingsEnabled'),
- tooltip: 'Allow users to rate articles with their comments.'
- });
- (n || !yo.a.isFeatureActive('embed_customizations', {
- forum: this.props.selection.forum.shortname
- }) ? o : r).push(i);
- var s,
- l = C.a.createElement(Ob, {
- name: 'disableSocialShare',
- key: 'disableSocialShare',
- checked: !!this.state.disableSocialShare,
- label: 'Hide Social Share',
- secondaryLabel: 'Hide social share buttons.',
- onChange: this.handleInputChange.bind(this, 'disableSocialShare'),
- idNamespace: this.constructor.displayName,
- readOnly: !a || this.props.forumUpdateIsSaving,
- disabled: !a || this.props.forumUpdateIsSaving,
- shouldHighlight: this.hasFieldChanged('disableSocialShare'),
- tooltip: 'Hides social share buttons, Facebook and X (Twitter), from the embed.'
- }),
- c = C.a.createElement(Ob, {
- name: 'hideDownvoteDetails',
- key: 'hideDownvoteDetails',
- checked: !!this.state.votingType,
- label: 'Downvote Details',
- secondaryLabel: gf[1].label,
- value: (this.state.votingType === gf[1].key ? gf[0] : gf[1]).key,
- onChange: this.handleInputChange.bind(this, 'votingType'),
- idNamespace: this.constructor.displayName,
- readOnly: this.props.forumUpdateIsSaving,
- disabled: this.props.forumUpdateIsSaving,
- shouldHighlight: this.hasFieldChanged('votingType')
- });
- return yo.a.isFeatureActive('embed_customizations', {
- forum: this.props.selection.forum.shortname
- }) ? (s = C.a.createElement(kf, {
- label: 'Voting',
- key: 'votingType',
- blockAdditionalClass: '-fieldset__block--radio text-medium',
- readOnly: !a,
- shouldHighlight: this.hasFieldChanged('votingType'),
- childIsInput: !0
- }, C.a.createElement('label', {
- className: 'fieldset__block--radio text-medium spacing-bottom-small'
- }, C.a.createElement('input', {
- name: 'votingType',
- type: 'radio',
- value: gf[3].key,
- checked: this.state.votingType === gf[3].key,
- onChange: this.handleInputChange.bind(this, 'votingType'),
- readOnly: !a || this.props.forumUpdateIsSaving,
- disabled: !a || this.props.forumUpdateIsSaving
- }), gf[3].label), C.a.createElement('label', {
- className: 'fieldset__block--radio text-medium spacing-bottom-small'
- }, C.a.createElement('input', {
- name: 'votingType',
- type: 'radio',
- value: gf[2].key,
- checked: this.state.votingType === gf[2].key,
- onChange: this.handleInputChange.bind(this, 'votingType'),
- readOnly: !a || this.props.forumUpdateIsSaving,
- disabled: !a || this.props.forumUpdateIsSaving
- }), gf[2].label), C.a.createElement('label', {
- className: 'fieldset__block--radio text-medium spacing-bottom-small'
- }, C.a.createElement('input', {
- name: 'votingType',
- type: 'radio',
- value: gf[0].key,
- checked: this.state.votingType === gf[0].key || this.state.votingType === gf[1].key,
- onChange: this.handleInputChange.bind(this, 'votingType'),
- readOnly: !a || this.props.forumUpdateIsSaving,
- disabled: !a || this.props.forumUpdateIsSaving
- }), gf[0].label), C.a.createElement('label', {
- className: 'text-medium fieldset__block--checkbox spacing-left-large'
- }, C.a.createElement('input', {
- name: 'votingType',
- type: 'checkbox',
- value: (this.state.votingType === gf[1].key ? gf[0] : gf[1]).key,
- checked: this.state.votingType === gf[1].key,
- onChange: this.handleInputChange.bind(this, 'votingType'),
- disabled: !a || this.props.forumUpdateIsSaving,
- readOnly: !a || this.props.forumUpdateIsSaving
- }), gf[1].label)), n = C.a.createElement(kf, {
- labelId: this.getInputId('initialCommentCount'),
- readOnly: !a || this.props.forumUpdateIsSaving,
- label: 'Initial Comments',
- key: 'initialCommentCount',
- shouldHighlight: this.hasFieldChanged('initialCommentCount')
- }, C.a.createElement('div', {
- className: 'spacing-top-small text-medium'
- }, 'Display', C.a.createElement('input', {
- type: 'number',
- id: this.getInputId('initialCommentCount'),
- min: _f.min,
- max: _f.max,
- value: this.state.initialCommentCount || _f.default,
- onChange: this.handleInputChange.bind(this, 'initialCommentCount'),
- size: '3',
- className: 'input--textbox -text-small -inline spacing-left-small spacing-right-small',
- readOnly: !a || this.props.forumUpdateIsSaving,
- disabled: !a || this.props.forumUpdateIsSaving
- }), 'comments before the ', C.a.createElement('i', null, '"Load more comments"'), ' button.'), this.state.invalidFields.initialCommentCount ? C.a.createElement('div', {
- className: 'spacing-top-small text-small text-error'
- }, 'Initial comment count must be between 1-50') : null), i = C.a.createElement(kf, {
- label: 'Comment Prompt',
- blockAdditionalClass: '-no-input text-medium',
- key: 'commentsPlaceholderText',
- readOnly: !a,
- shouldHighlight: hf.some(function (e) {
- return t.hasFieldChanged(e.key)
- })
- }, hf.map(function (e) {
- return C.a.createElement('div', {
- key: e.key,
- className: 'align align--middle spacing-bottom'
- }, C.a.createElement('div', {
- className: 'fieldset-item__label'
- }, e.label), C.a.createElement('div', {
- className: 'fieldset-item__input'
- }, C.a.createElement('input', {
- type: 'text',
- className: 'input--textbox',
- value: t.state[e.key],
- maxLength: 45,
- onChange: t.handleInputChange.bind(t, e.key),
- placeholder: 'e.g. '.concat(e.default),
- readOnly: !a || t.props.forumUpdateIsSaving,
- disabled: !a || t.props.forumUpdateIsSaving
- })))
- })), a ? o.push(l, s, n, i) : (r.push(l, s, n, i), o.push(c))) : (a && o.push(l), o.push(c)),
- C.a.createElement('div', null, C.a.createElement('div', {
- className: 'content__wrap spacing-bottom-double'
- }, C.a.createElement('header', {
- className: 'settings__header'
- }, C.a.createElement('h2', {
- className: 'text-larger text-gray-darker spacing-bottom-small'
- }, 'Community & Comments Configuration')), C.a.createElement('section', {
- className: 'settings__content'
- }, this.props.forumUpdateError ? C.a.createElement(Ki, {
- message: this.props.forumUpdateError,
- onRequestClose: this.props.forumUpdateOnDismissError,
- alertType: 'error'
- }) : null, C.a.createElement(kf, {
- label: 'Comment Count Link',
- blockAdditionalClass: '-no-input text-medium',
- shouldHighlight: mf.some(function (e) {
- return t.hasFieldChanged(e.key)
- }),
- tooltip: C.a.createElement(C.a.Fragment, null, 'Customize the text of the comment count link. Use ', C.a.createElement('code', null, '{num}'), ' as a placeholder for the current comment count.')
- }, mf.map(function (e) {
- return C.a.createElement('div', {
- key: e.key,
- className: 'align align--middle spacing-bottom'
- }, C.a.createElement('div', {
- className: 'fieldset-item__label'
- }, e.label), C.a.createElement('div', {
- className: 'fieldset-item__input'
- }, C.a.createElement('input', {
- type: 'text',
- className: 'input--textbox',
- value: t.state[e.key],
- onChange: t.handleInputChange.bind(t, e.key),
- placeholder: 'e.g. '.concat(ff[e.key]),
- readOnly: t.props.forumUpdateIsSaving,
- disabled: t.props.forumUpdateIsSaving
- })))
- })), C.a.createElement(Mf, {
- name: 'sort',
- options: df,
- value: this.state.sort,
- label: 'Default Sort',
- onChange: this.handleInputChange.bind(this, 'sort'),
- idNamespace: this.constructor.displayName,
- readOnly: this.props.forumUpdateIsSaving,
- disabled: this.props.forumUpdateIsSaving,
- shouldHighlight: this.hasFieldChanged('sort'),
- tooltip: '"Best first" sorts comments statistically based on votes.'
- }), C.a.createElement($h, {
- name: 'moderatorBadgeText',
- value: this.state.moderatorBadgeText,
- label: 'Moderator Badge Text',
- placeholder: 'Mod',
- onChange: this.handleInputChange.bind(this, 'moderatorBadgeText'),
- idNamespace: this.constructor.displayName,
- readOnly: this.props.forumUpdateIsSaving,
- disabled: this.props.forumUpdateIsSaving,
- shouldHighlight: this.hasFieldChanged('moderatorBadgeText')
- }), C.a.createElement($h, {
- name: 'twitterName',
- value: this.state.twitterName,
- label: 'X (Twitter) @Replies',
- onChange: this.handleInputChange.bind(this, 'twitterName'),
- idNamespace: this.constructor.displayName,
- readOnly: this.props.forumUpdateIsSaving,
- disabled: this.props.forumUpdateIsSaving,
- shouldHighlight: this.hasFieldChanged('twitterName'),
- tooltip: 'Allow your visitors to automatically @reply your X (Twitter) name when they are sharing replies to your comments.'
- }), o), r.length ? C.a.createElement('section', {
- className: 'settings__content'
- }, C.a.createElement('div', {
- className: 'settings-community__features-container'
- }, C.a.createElement(Ks, {
- emitEvent: function (e) {
- return t.props.emitTrackingEvent(Lb({
- area: 'embed_customizations'
- }, e))
- },
- organization: e,
- iconClass: 'spacing-right-small'
- }), C.a.createElement('span', {
- className: 'fieldset__description text-medium'
- }, 'These features are only available to publishers on a Disqus Pro plan.', ' ', C.a.createElement(Us, {
- path: '/settings/subscription/',
- orgId: e.id,
- orgSlug: e.slug
- }, 'View upgrade options'), '.')), r) : null, C.a.createElement('footer', {
- className: 'settings__footer'
- }, C.a.createElement(Bh, {
- disabled: !this.hasUnsavedChanges() || this.hasInvalidFields(),
- onClick: this.handleSaveChanges,
- isSaving: this.props.forumUpdateIsSaving,
- isSaved: this.props.forumUpdateIsSaved
- }))))
- }
- }
- ]) && Ub(e.prototype, t),
- n && Ub(e, n),
- o
- }();
- Gb(Vb, 'displayName', 'ForumSettingsCommunity'),
- Gb(Vb, 'propTypes', {
- history: b.a.shape({
- setRouteLeaveHook: b.a.func.isRequired
- }).isRequired,
- route: b.a.object.isRequired,
- organizations: b.a.object.isRequired,
- selection: ht.isRequired,
- forumDetails: $c,
- forumDetailsError: b.a.string,
- forumDetailsIsFetching: b.a.bool,
- fetchForumDetails: b.a.func.isRequired,
- forumUpdateError: b.a.string,
- forumUpdateIsSaving: b.a.bool,
- forumUpdateIsSaved: b.a.bool,
- forumUpdateOnSave: b.a.func.isRequired,
- forumUpdateOnDismissError: b.a.func.isRequired,
- emitTrackingEvent: b.a.func.isRequired
- }),
- Gb(Vb, 'getEditableFieldsFromForum', function (e) {
- var t = (e = e || {
- }).settings || {
- };
- return {
- commentsLinkZero: e.commentsLinkZero || ff.commentsLinkZero,
- commentsLinkOne: e.commentsLinkOne || ff.commentsLinkZero,
- commentsLinkMultiple: e.commentsLinkMultiple || ff.commentsLinkZero,
- commentsPlaceholderTextEmpty: e.commentsPlaceholderTextEmpty || '',
- commentsPlaceholderTextPopulated: e.commentsPlaceholderTextPopulated || '',
- moderatorBadgeText: e.moderatorBadgeText,
- sort: e.sort,
- validateAllPosts: t.validateAllPosts,
- unapproveLinks: t.unapproveLinks,
- mediaembedEnabled: t.mediaembedEnabled,
- disableSocialShare: t.disableSocialShare,
- gifPickerEnabled: t.gifPickerEnabled,
- flaggingNotifications: t.flaggingNotifications,
- flaggingEnabled: t.flaggingEnabled,
- flagThreshold: e.flagThreshold,
- daysThreadAlive: e.daysThreadAlive,
- twitterName: e.twitterName,
- allowAnonPost: t.allowAnonPost,
- threadRatingsEnabled: t.threadRatingsEnabled,
- initialCommentCount: e.initialCommentCount,
- votingType: null === e.votingType ? nf.DEFAULT_VOTING_TYPE : e.votingType
- }
- });
- var Sh = Object(u.connect) (function (e) {
- var t = e.forumDetails;
- return {
- forumDetails: t.forumDetails,
- forumDetailsError: t.forumDetailsError,
- forumDetailsIsFetching: t.forumDetailsIsFetching,
- selection: e.selection
- }
- }, {
- emitTrackingEvent: Xo({
- zone: 'settings',
- section: 'community'
- }),
- fetchForumDetails: ig
- }) (Ni.a.attachDrivers(Fo() (Vb), [
- m
- ])),
- cu = n(317),
- Wb = n.n(cu),
- Jc = n(318),
- Yb = n.n(Jc);
- function Qb(e) {
- return (Qb = 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator ? function (e) {
- return typeof e
- }
- : function (e) {
- return e && 'function' == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? 'symbol' : typeof e
- }) (e)
- }
- function Kb(t, e) {
- var n,
- a = Object.keys(t);
- return Object.getOwnPropertySymbols && (n = Object.getOwnPropertySymbols(t), e && (n = n.filter(function (e) {
- return Object.getOwnPropertyDescriptor(t, e).enumerable
- })), a.push.apply(a, n)),
- a
- }
- function Jb(t) {
- for (var e = 1; e < arguments.length; e++) {
- var n = null != arguments[e] ? arguments[e] : {
- };
- e % 2 ? Kb(Object(n), !0).forEach(function (e) {
- ov(t, e, n[e])
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(n)) : Kb(Object(n)).forEach(function (e) {
- Object.defineProperty(t, e, Object.getOwnPropertyDescriptor(n, e))
- })
- }
- return t
- }
- function $b(e, t) {
- if (!(e instanceof t)) throw new TypeError('Cannot call a class as a function')
- }
- function Zb(e, t) {
- for (var n = 0; n < t.length; n++) {
- var a = t[n];
- a.enumerable = a.enumerable || !1,
- a.configurable = !0,
- 'value' in a && (a.writable = !0),
- Object.defineProperty(e, a.key, a)
- }
- }
- function Xb(e, t, n) {
- return t && Zb(e.prototype, t),
- n && Zb(e, n),
- e
- }
- function ev(e, t) {
- if ('function' != typeof t && null !== t) throw new TypeError('Super expression must either be null or a function');
- e.prototype = Object.create(t && t.prototype, {
- constructor: {
- value: e,
- writable: !0,
- configurable: !0
- }
- }),
- t && tv(e, t)
- }
- function tv(e, t) {
- return (tv = Object.setPrototypeOf || function (e, t) {
- return e.__proto__ = t,
- e
- }) (e, t)
- }
- function nv(n) {
- var a = function () {
- if ('undefined' == typeof Reflect || !Reflect.construct) return !1;
- if (Reflect.construct.sham) return !1;
- if ('function' == typeof Proxy) return !0;
- try {
- return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [
- ], function () {
- })),
- !0
- } catch (e) {
- return !1
- }
- }();
- return function () {
- var e,
- t = rv(n);
- return e = a ? (e = rv(this).constructor, Reflect.construct(t, arguments, e)) : t.apply(this, arguments),
- t = this,
- !(e = e) || 'object' !== Qb(e) && 'function' != typeof e ? av(t) : e
- }
- }
- function av(e) {
- if (void 0 === e) throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called');
- return e
- }
- function rv(e) {
- return (rv = Object.setPrototypeOf ? Object.getPrototypeOf : function (e) {
- return e.__proto__ || Object.getPrototypeOf(e)
- }) (e)
- }
- function ov(e, t, n) {
- return t in e ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n,
- e
- }
- function iv(e) {
- var t = e.onAgree,
- n = e.onCancel,
- e = e.onClose;
- return C.a.createElement(_.a, {
- isOpen: !0,
- onRequestClose: n,
- className: 'admin-modal -clipped -wider',
- overlayClassName: 'modal-overlay -dark'
- }, C.a.createElement('div', {
- className: 'admin-modal__header align align--between'
- }, C.a.createElement('h3', {
- className: 'text-large'
- }, 'Exporting subscribers'), C.a.createElement('button', {
- className: 'link-gray',
- onClick: e
- }, C.a.createElement('span', {
- className: 'icon-cancel icon__position'
- }))), C.a.createElement('div', {
- className: 'padding-double'
- }, C.a.createElement('p', {
- className: 'spacing-bottom-small'
- }, 'By enabling this feature, you\'re agreeing to:'), C.a.createElement('ul', {
- className: 'list-bullet'
- }, C.a.createElement('li', null, 'Not share the information provided without the user\'s consent'), C.a.createElement('li', null, 'Refrain from sending malicious or manipulative communication'), C.a.createElement('li', null, 'Respect requests to unsubscribe and opt-out of future communications'))), C.a.createElement('div', {
- className: 'admin-modal__footer align align--between'
- }, C.a.createElement('button', {
- className: 'button button-fill text-small',
- onClick: n
- }, 'Go back'), C.a.createElement('button', {
- className: 'button button-fill--brand text-small spacing-left-large',
- onClick: t
- }, 'Agree, enable email subscriptions')))
- }
- Ru = b.a.shape({
- isFetching: b.a.bool.isRequired,
- isFetched: b.a.bool.isRequired,
- pendingExports: b.a.number,
- totalExports: b.a.number,
- lastExportDate: b.a.string
- });
- iv.propTypes = {
- onAgree: b.a.func,
- onCancel: b.a.func,
- onClose: b.a.func
- };
- function sv(e) {
- var a = e.all,
- r = e.forum,
- t = e.onCancel,
- n = e.onClose,
- o = e.onExport,
- e = e.pendingExportInfo;
- return C.a.createElement(_.a, {
- isOpen: !0,
- onRequestClose: n,
- className: 'admin-modal -clipped -wider',
- overlayClassName: 'modal-overlay -dark'
- }, C.a.createElement('div', {
- className: 'admin-modal__header align align--between'
- }, C.a.createElement('h3', {
- className: 'text-large'
- }, 'Exporting subscribers'), C.a.createElement('button', {
- className: 'link-gray',
- onClick: n
- }, C.a.createElement('span', {
- className: 'icon-cancel icon__position'
- }))), C.a.createElement('div', {
- className: 'padding-double'
- }, C.a.createElement('p', {
- className: 'spacing-bottom-small'
- }, 'By exporting this information, you\'re agreeing to:'), C.a.createElement('ul', {
- className: 'list-bullet'
- }, C.a.createElement('li', null, 'Not share the information provided without the user\'s consent'), C.a.createElement('li', null, 'Refrain from sending communication that may be malicious or manipulative'), C.a.createElement('li', null, 'Respect requests to unsubscribe and opt-out of future communications'))), C.a.createElement('div', {
- className: 'admin-modal__footer align align--between'
- }, C.a.createElement('button', {
- className: 'button button-fill text-small',
- onClick: t
- }, 'Go back'), C.a.createElement('button', {
- className: 'button button-fill--brand',
- onClick: function () {
- io.a.call('aet/export.csv', {
- data: {
- forum: r.shortname,
- full: a ? '1' : '0'
- },
- method: 'POST'
- }).done(function (e) {
- var e = new window.Blob([e], {
- type: 'text/csv'
- }),
- t = window.URL.createObjectURL(e),
- n = window.document.createElement('a');
- n.download = 'Disqus '.concat(r.shortname, ' ').concat(ct() ().format('MM/DD/YY'), ' ').concat(a ? 'Full ' : '', 'Email Export.csv'),
- n.href = t,
- n.style.display = 'none',
- window.document.body.appendChild(n),
- n.click(),
- setTimeout(function () {
- window.document.body.removeChild(n),
- window.URL.revokeObjectURL(t)
- }, 0)
- }).fail(function () {
- window.alert('There was an error exporting, please try again later.')
- }).always(function () {
- o(),
- n()
- })
- }
- }, a ? C.a.createElement('span', null, 'Agree, export all subscribers') : C.a.createElement('span', null, 'Agree, export ', e.pendingExports, ' new ', 1 === e.pendingExports ? 'subscriber' : 'subscribers'))))
- }
- sv.propTypes = {
- all: b.a.bool,
- forum: b.a.shape({
- shortname: b.a.string.isRequired
- }).isRequired,
- onCancel: b.a.func,
- onClose: b.a.func.isRequired,
- onExport: b.a.func.isRequired,
- pendingExportInfo: Ru.isRequired
- };
- var lv = 'loggedIn',
- cv = 'loggedOut',
- uv = function () {
- ev(o, A);
- var r = nv(o);
- function o() {
- var t;
- $b(this, o);
- for (var e = arguments.length, n = Array(e), a = 0; a < e; a++) n[a] = arguments[a];
- return ov(av(t = r.call.apply(r, [
- this
- ].concat(n))), 'state', {
- signupComplete: !1,
- previewState: lv
- }),
- ov(av(t), 'handleChooseState', function (e) {
- t.setState({
- signupComplete: !1,
- previewState: e.target.value
- })
- }),
- ov(av(t), 'handleSubscribe', function () {
- t.setState({
- signupComplete: !0
- })
- }),
- ov(av(t), 'handleDismiss', function () {
- t.setState({
- signupComplete: !1
- })
- }),
- t
- }
- return Xb(o, [
- {
- key: 'render',
- value: function () {
- return C.a.createElement('div', null, C.a.createElement('h2', {
- className: 'text-gray spacing-bottom'
- }, 'Preview'), C.a.createElement('p', {
- className: 'spacing-bottom'
- }, 'Readers logged-in to Disqus can subscribe with one click because their emails are already verified by Disqus. Logged-out readers enter their email address and receive a confirmation email. Click "Subscribe" to preview the confirmation message.'), C.a.createElement('form', null, C.a.createElement('label', null, C.a.createElement('input', {
- type: 'radio',
- name: 'state',
- value: lv,
- checked: this.state.previewState === lv,
- onChange: this.handleChooseState
- }), 'Logged-in to Disqus'), C.a.createElement('br', null), C.a.createElement('label', null, C.a.createElement('input', {
- type: 'radio',
- name: 'state',
- value: cv,
- checked: this.state.previewState === cv,
- onChange: this.handleChooseState
- }), 'Not logged-in to Disqus')), C.a.createElement('div', {
- className: 'email_preview'
- }, C.a.createElement('img', {
- className: 'email_preview__wide',
- src: '//c.disquscdn.com/next/current/publisher-admin/assets/img/email_preview/'.concat(this.state.previewState === lv ? 'logged_in_wide.png' : 'logged_out_wide.png')
- }), C.a.createElement('img', {
- className: 'email_preview__narrow',
- src: '//c.disquscdn.com/next/current/publisher-admin/assets/img/email_preview/'.concat(this.state.previewState === lv ? 'logged_in_narrow.png' : 'logged_out_narrow.png')
- }), this.state.signupComplete ? C.a.createElement(Wb.a, {
- forum: this.props.forum,
- isVerified: this.state.previewState === lv,
- onDismiss: this.handleDismiss
- }) : C.a.createElement(Yb.a, {
- forum: this.props.forum,
- isLoading: !1,
- isLoggedIn: this.state.previewState === lv,
- onSubscribe: this.handleSubscribe,
- allowEmpty: !0
- }), C.a.createElement('img', {
- src: '//c.disquscdn.com/next/current/publisher-admin/assets/img/email_preview/below.png'
- })))
- }
- }
- ]),
- o
- }();
- ov(uv, 'displayName', 'EmailSubscriptionPreview'),
- ov(uv, 'propTypes', {
- forum: $c.isRequired
- });
- function pv(e) {
- e.preventDefault()
- }
- var dv = 1,
- mv = 2,
- fv = 3,
- Bu = function () {
- ev(n, A);
- var t = nv(n);
- function n(e) {
- var a;
- $b(this, n),
- ov(av(a = t.call(this, e)), 'emitViewEvent', function (e) {
- var t = e.forumDetails,
- n = e.pendingExportInfo;
- if (!a._emittedViewEvent && t) {
- e = {
- };
- if (t.aetBannerEnabled) {
- if (!n.isFetched) return;
- e.new_subscribers_to_export = n.pendingExports,
- e.all_subscribers_to_export = n.totalExports,
- e.since_last_exported = n.lastExportDate || null
- }
- a._emittedViewEvent = a.emitEvent({
- verb: 'view',
- extra_data: e
- })
- }
- }),
- ov(av(a), 'emitEvent', function (e) {
- e = Pf(e, 1 < arguments.length && void 0 !== arguments[1] ? arguments[1] : a.props);
- return e && a.props.emitTrackingEvent(e),
- !!e
- }),
- ov(av(a), 'getFormStateFromForumDetails', function () {
- var e = 0 < arguments.length && void 0 !== arguments[0] ? arguments[0] : a.props,
- t = e.forumDetails || {
- },
- n = e.selection && e.selection.forum && e.selection.forum.name,
- e = a.state && a.state.form || {
- };
- return {
- aetBannerEnabled: t.aetBannerEnabled || !1,
- aetBannerTitle: t.aetBannerTitle || e.aetBannerTitle || 'Like this article?',
- aetBannerDescription: t.aetBannerDescription || e.aetBannerDescription || (n ? 'Subscribe to '.concat(n, ' to receive daily updates of the latest articles delivered straight to your inbox.') : ''),
- aetBannerConfirmation: t.aetBannerConfirmation || e.aetBannerConfirmation || (n ? 'Thanks for subscribing to email updates from '.concat(n, '! If you\'d like to unsubscribe, there will be a link in emails you receive from ').concat(n, '.') : '')
- }
- }),
- ov(av(a), 'handleInputChange', function (t) {
- return function (e) {
- a.setState({
- form: Jb(Jb({
- }, a.state.form), {
- }, ov({
- }, t, e.target.value))
- })
- }
- }),
- ov(av(a), 'hasFieldChanged', function (e) {
- return a.state.form[e] !== a.state.savedForm[e] && !(null === a.state.savedForm[e] && '' === a.state.form[e])
- }),
- ov(av(a), 'getFormExtraData', function () {
- return {
- email_subscription_prompt: {
- title: a.state.form.aetBannerTitle,
- description_copy: a.state.form.aetBannerDescription,
- confirmation_copy: a.state.form.aetBannerConfirmation
- }
- }
- }),
- ov(av(a), 'handleOpenConfirmModal', function () {
- a.setState({
- modal: dv
- }),
- a.emitEvent({
- verb: 'view',
- adjective: 'enable_warning',
- object_type: 'note',
- object_id: 'enable_warning_modal',
- area: 'modal',
- extra_data: Jb(Jb({
- }, a.getFormExtraData()), {
- }, {
- aet_banner_enabled: {
- before: !1,
- after: !0
- }
- })
- })
- }),
- ov(av(a), 'handleCancelModal', function (e) {
- a.setState({
- modal: null
- }),
- a.emitEvent(Jb({
- verb: 'click',
- object_type: 'button',
- object_id: 'go_back',
- area: 'modal',
- extra_data: Jb(Jb({
- }, a.getFormExtraData()), {
- }, {
- aet_banner_enabled: {
- before: !1,
- after: !0
- }
- })
- }, e))
- }),
- ov(av(a), 'handleEnable', function () {
- a.setState({
- modal: null
- }),
- a.save({
- aetBannerEnabled: !0
- }),
- a.emitEvent({
- verb: 'update',
- object_type: 'forum',
- area: 'modal',
- object_id: a.props.selection.forum.shortname,
- extra_data: Jb(Jb({
- }, a.getFormExtraData()), {
- }, {
- aet_banner_enabled: {
- before: !1,
- after: !0
- }
- })
- })
- }),
- ov(av(a), 'handleSave', function () {
- a.save()
- }),
- ov(av(a), 'save', function (n) {
- var t = Jb(Jb({
- }, a.state.form), n);
- a.props.forumUpdateOnSave(Jb(Jb({
- }, t), {
- }, {
- aetBannerEnabled: t.aetBannerEnabled ? '1' : '0'
- })).then(function () {
- t.aetBannerEnabled === a.state.savedForm.aetBannerEnabled && [
- 'aetBannerConfirmation',
- 'aetBannerDescription',
- 'aetBannerTitle'
- ].some(function (e) {
- return t[e] !== a.state.savedForm[e]
- }) && a.props.emitTrackingEvent({
- verb: 'update',
- object_type: 'area',
- object_id: 'email_subscription_copy',
- area: 'email_subscription_copy',
- extra_data: JSON.stringify(a.getFormExtraData())
- }),
- a.setState(function (e) {
- var t = e.form,
- e = e.savedForm;
- return {
- form: Jb(Jb({
- }, t), n),
- savedForm: Jb(Jb(Jb({
- }, e), t), n)
- }
- })
- })
- }),
- ov(av(a), 'handleDisable', function () {
- a.save({
- aetBannerEnabled: !1
- }),
- a.emitEvent({
- verb: 'update',
- object_type: 'forum',
- area: 'modal',
- object_id: a.props.selection.forum.shortname,
- extra_data: Jb(Jb({
- }, a.getFormExtraData()), {
- }, {
- aet_banner_enabled: {
- before: !0,
- after: !1
- }
- })
- })
- }),
- ov(av(a), 'handleTogglePreview', function () {
- a.setState(function (e) {
- return {
- isPreviewOpen: !e.isPreviewOpen
- }
- }, function () {
- a.state.isPreviewOpen && a.props.emitTrackingEvent({
- verb: 'open',
- object_type: 'area',
- object_id: 'preview',
- area: 'preview',
- extra_data: JSON.stringify(a.getFormExtraData())
- })
- })
- }),
- ov(av(a), 'handleExportClick', function () {
- a.setState({
- modal: fv
- }),
- a.emitEvent({
- verb: 'click',
- object_type: 'area',
- object_id: 'export_new_subscribers',
- area: 'export_new_subscribers',
- extra_data: {
- new_subscribers_to_export: a.props.pendingExportInfo.pendingExports,
- since_last_exported: a.props.pendingExportInfo.lastExportDate
- }
- }),
- a.emitExportWarningModalEvent()
- }),
- ov(av(a), 'handleExportAllClick', function (e) {
- e.preventDefault(),
- a.setState({
- modal: mv
- }),
- a.emitEvent({
- verb: 'click',
- object_type: 'area',
- object_id: 'export_all_subscribers',
- area: 'export_all_subscribers',
- extra_data: {
- all_subscribers_to_export: a.props.pendingExportInfo.totalExports,
- since_last_exported: a.props.pendingExportInfo.lastExportDate
- }
- }),
- a.emitExportWarningModalEvent()
- }),
- ov(av(a), 'emitExportWarningModalEvent', function () {
- a.emitEvent({
- adverb: 'auto',
- verb: 'view',
- adjective: 'export_warning',
- object_type: 'note',
- object_id: 'export_warning_modal',
- area: 'modal',
- extra_data: {
- new_subscribers_to_export: a.props.pendingExportInfo.pendingExports,
- all_subscribers_to_export: a.props.pendingExportInfo.totalExports,
- since_last_exported: a.props.pendingExportInfo.lastExportDate
- }
- })
- });
- e = a.getFormStateFromForumDetails(a.props);
- return a.state = {
- form: e,
- savedForm: e,
- modal: null,
- isModalVisible: !1,
- isPreviewOpen: !1
- },
- a
- }
- return Xb(n, [
- {
- key: 'componentWillMount',
- value: function () {
- this._emittedViewEvent = !1
- }
- },
- {
- key: 'componentWillReceiveProps',
- value: function (e) {
- var n;
- !this.props.forumDetails && e.forumDetails && (n = this.getFormStateFromForumDetails(e), this.setState(function (e) {
- var t = e.savedForm;
- return {
- form: Jb(Jb({
- }, e.form), n),
- savedForm: Jb(Jb({
- }, t), n)
- }
- })),
- this.emitViewEvent(e)
- }
- },
- {
- key: 'componentDidMount',
- value: function () {
- this.props.fetchPendingExportInfo(this.props.selection),
- this.props.fetchSubscription(),
- this.props.fetchForumDetails()
- }
- },
- {
- key: 'render',
- value: function () {
- var t = this;
- if (this.props.selection.organization && this.props.selection.organization.pollsOnly) return C.a.createElement(Cm, {
- isPolls: !1,
- organization: this.props.selection.organization
- });
- if (!this.props.pendingExportInfo.isFetched || this.props.forumDetailsIsFetching) return C.a.createElement(Qi, null);
- if (this.props.forumDetailsError) return C.a.createElement('div', {
- className: 'content__wrap spacing-bottom-double'
- }, C.a.createElement(Ki, {
- message: this.props.forumDetailsError,
- alertType: 'error'
- }));
- var e = this.props.selection.organization && this.props.selection.organization.id,
- e = e && this.props.saasFeatures[e];
- if (!e || !e.isFetched) return C.a.createElement(Qi, null);
- e = !e.audienceEmailTransfer;
- return C.a.createElement('div', null, this.state.modal === dv ? C.a.createElement(iv, {
- onAgree: this.handleEnable,
- onCancel: function () {
- t.handleCancelModal()
- },
- onClose: function () {
- t.setState({
- modal: null
- })
- }
- }) : null, this.state.modal === mv || this.state.modal === fv ? C.a.createElement(sv, {
- all: this.state.modal === mv,
- forum: this.props.selection.forum,
- onCancel: function () {
- return t.handleCancelModal({
- adjective: 'export_warning'
- })
- },
- onClose: function () {
- t.setState({
- modal: null
- })
- },
- pendingExportInfo: this.props.pendingExportInfo,
- onExport: function () {
- var e = t.state.modal === mv;
- t.emitEvent({
- verb: 'export',
- adjective: 'subscriber_email',
- object_type: 'file',
- object_id: 'csv',
- extra_data: {
- export_type: e ? 'all' : 'new',
- subscribers_to_export: t.props.pendingExportInfo[e ? 'totalExports' : 'pendingExports'],
- since_last_exported: t.props.pendingExportInfo.lastExportDate
- }
- })
- }
- }) : null, e ? C.a.createElement(ch, {
- headline: 'Looking to collect newsletter signups?',
- promotionalPlan: 'Which Plan is Right For You',
- planDetailsUrl: 'https://disqus.com/pricing/',
- upsellMessageLeft: 'Unlock powerful new features with a Disqus Pro subscription. Learn more about Disqus upgrades at',
- upsellMessageRight: '.',
- selection: this.props.selection,
- emitTrackingEvent: this.props.emitTrackingEvent
- }) : null, this.state.form.aetBannerEnabled ? C.a.createElement('div', {
- className: 'content__wrap spacing-bottom-double'
- }, C.a.createElement('header', {
- className: 'settings__header settings-inline-section align align--middle'
- }, C.a.createElement('div', {
- className: 'align__item--flex-1 text-gray spacing-right-large'
- }, C.a.createElement('h2', {
- className: 'text-gray-darker text-larger spacing-bottom-small'
- }, 'Export email list to .CSV'), C.a.createElement('p', {
- className: 'text-gray'
- }, 'Import this .CSV into the system you use to send emails. If a subscriber unsubscribes from your email, it is not reflected in this list. You can also', ' ', C.a.createElement('a', {
- href: '#',
- onClick: this.handleExportAllClick
- }, 'Export all subscribers'), ' ', 'who have ever subscribed via Disqus.')), C.a.createElement('div', {
- className: 'align__item--no-shrink spacing-right-large'
- }, C.a.createElement('button', {
- className: 'button '.concat(this.props.pendingExportInfo.pendingExports ? 'button-fill--brand' : 'button-disabled'),
- onClick: this.props.pendingExportInfo.pendingExports ? this.handleExportClick : pv,
- disabled: !this.props.pendingExportInfo.pendingExports
- }, this.props.pendingExportInfo.pendingExports ? C.a.createElement('span', null, 'Export ', this.props.pendingExportInfo.pendingExports, ' new ', 1 === this.props.pendingExportInfo.pendingExports ? 'subscriber' : 'subscribers') : C.a.createElement('span', null, 'No new subscribers to export')), this.props.pendingExportInfo.lastExportDate ? C.a.createElement('p', {
- className: 'text-gray text-small spacing-top-small'
- }, 'Since last exported ', ct() (this.props.pendingExportInfo.lastExportDate).format('MM/DD/YY')) : null))) : null, C.a.createElement('div', {
- className: 'content__wrap spacing-bottom-double'
- }, C.a.createElement('header', {
- className: 'settings__header'
- }, C.a.createElement('h2', {
- className: 'text-larger text-gray-darker spacing-bottom-small'
- }, 'Email subscriptions'), C.a.createElement('p', {
- className: 'text-gray'
- }, 'Convert readers into subscribers to your email list by showing an opt-in prompt in the comments section. Export new subscriber emails to CSV and import them into your email system.', ' ', C.a.createElement('a', {
- href: Pn.emailSubscriptionPrompt,
- target: '_blank',
- rel: 'noopener noreferrer'
- }, 'Learn more'))), C.a.createElement('section', {
- className: 'settings__content'
- }, C.a.createElement($h, {
- name: 'aetBannerTitle',
- value: this.state.form.aetBannerTitle,
- label: 'Title',
- onChange: this.handleInputChange('aetBannerTitle'),
- idNamespace: this.constructor.displayName,
- readOnly: this.props.forumUpdateIsSaving,
- disabled: e,
- shouldHighlight: this.hasFieldChanged('aetBannerTitle'),
- maxLength: '75',
- showLimit: !0
- }), C.a.createElement($h, {
- name: 'aetBannerDescription',
- value: this.state.form.aetBannerDescription,
- label: 'Short description',
- onChange: this.handleInputChange('aetBannerDescription'),
- idNamespace: this.constructor.displayName,
- readOnly: this.props.forumUpdateIsSaving,
- disabled: e,
- shouldHighlight: this.hasFieldChanged('aetBannerDescription'),
- maxLength: '360',
- showLimit: !0,
- useTextarea: !0,
- tooltip: C.a.createElement(C.a.Fragment, null, 'Describe the content readers are subscribing to, the frequency of the emails, and options for unsubscribing. This copy must adhere to email laws in your country.', ' ', C.a.createElement('a', {
- href: Pn.emailSubscriptionPrompt,
- target: '_blank',
- rel: 'noopener noreferrer'
- }, 'Learn more'))
- }), C.a.createElement($h, {
- name: 'aetBannerConfirmation',
- value: this.state.form.aetBannerConfirmation,
- label: 'Confirmation message',
- onChange: this.handleInputChange('aetBannerConfirmation'),
- idNamespace: this.constructor.displayName,
- readOnly: this.props.forumUpdateIsSaving,
- disabled: e,
- shouldHighlight: this.hasFieldChanged('aetBannerConfirmation'),
- maxLength: '360',
- showLimit: !0,
- useTextarea: !0
- }), C.a.createElement('div', {
- className: 'spacing-top'
- }, C.a.createElement(Bh, {
- buttonLabel: this.state.form.aetBannerEnabled ? 'Save changes' : 'Enable email subscriptions',
- disabled: e,
- isSaving: this.props.forumUpdateIsSaving,
- isSaved: this.props.forumUpdateIsSaved,
- onClick: this.state.form.aetBannerEnabled ? this.handleSave : this.handleOpenConfirmModal
- })), C.a.createElement('div', {
- className: 'fieldset'
- }, C.a.createElement('div', {
- className: 'fieldset__label'
- }), C.a.createElement('div', {
- className: 'fieldset__block'
- }, C.a.createElement('button', {
- className: 'button button-fill button-padding-wider button-medium',
- onClick: this.handleTogglePreview,
- disabled: e
- }, this.state.isPreviewOpen ? 'Hide Preview ▼' : 'Show Preview ▶')))), this.state.isPreviewOpen ? C.a.createElement('section', {
- className: 'settings__content'
- }, C.a.createElement(uv, {
- forum: Jb(Jb({
- }, this.props.forumDetails), this.state.form)
- })) : null), this.state.form.aetBannerEnabled ? C.a.createElement('div', {
- className: 'content__wrap'
- }, C.a.createElement('header', {
- className: 'settings__header settings-inline-section align align--between align--middle'
- }, C.a.createElement('div', {
- className: 'spacing-right'
- }, C.a.createElement('h2', {
- className: 'text-larger text-gray-darker spacing-bottom-small'
- }, 'Turn email subscriptions off'), C.a.createElement('p', {
- className: 'text-gray'
- }, 'The email subscription prompt will be removed from all new and existing Disqus threads. You will not be able to export your email subscriber list after this feature has been turned off.')), C.a.createElement('div', {
- className: 'align__item--no-shrink'
- }, C.a.createElement('button', {
- className: 'button button-fill--red button-medium',
- onClick: this.handleDisable
- }, 'Turn email subscriptions off')))) : null)
- }
- }
- ]),
- n
- }();
- ov(Bu, 'displayName', 'ForumSettingsEmailSubscriptions'),
- ov(Bu, 'propTypes', {
- history: b.a.object.isRequired,
- saasFeatures: b.a.objectOf(b.a.objectOf(b.a.bool)).isRequired,
- selection: ht.isRequired,
- forumDetails: $c,
- forumDetailsError: b.a.string,
- forumDetailsIsFetching: b.a.bool,
- fetchForumDetails: b.a.func.isRequired,
- forumUpdateError: b.a.string,
- forumUpdateIsSaving: b.a.bool,
- forumUpdateIsSaved: b.a.bool,
- forumUpdateOnSave: b.a.func.isRequired,
- forumUpdateOnDismissError: b.a.func.isRequired,
- fetchPendingExportInfo: b.a.func.isRequired,
- fetchSubscription: b.a.func.isRequired,
- orgSubscriptionIsFetching: b.a.bool.isRequired,
- orgCurrentPlan: b.a.shape({
- id: b.a.string.isRequired
- }),
- pendingExportInfo: Ru.isRequired,
- emitTrackingEvent: b.a.func.isRequired
- });
- function hv(n) {
- return function (e) {
- var t = n && je.a.contains(gv, n.type);
- return e({
- type: ee.validateImageFile,
- isValidImageFile: t
- }),
- t
- }
- }
- var Ju = Object(u.connect) (function (e) {
- var t = e.forumDetails,
- n = e.subscription;
- return {
- pendingExportInfo: e.aet.pendingExportInfo,
- forumDetails: t.forumDetails,
- forumDetailsError: t.forumDetailsError,
- forumDetailsIsFetching: t.forumDetailsIsFetching,
- saasFeatures: e.saasFeatures,
- orgCurrentPlan: n.orgCurrentPlan,
- orgSubscriptionIsFetching: n.orgSubscriptionIsFetching,
- selection: e.selection
- }
- }, {
- fetchPendingExportInfo: function (e) {
- return function (t) {
- return t({
- type: L.fetching
- }),
- io.a.call('aet/pendingExportInfo', {
- data: {
- forum: e.forum.shortname
- }
- }).then(function (e) {
- t({
- type: L.onFetch,
- pendingExportInfo: e.response
- })
- }).then(null, function () {
- t({
- type: L.onError
- })
- })
- }
- },
- fetchForumDetails: ig,
- fetchSubscription: Hl,
- emitTrackingEvent: Xo({
- zone: 'settings',
- section: 'email_subscriptions'
- })
- }) (Ni.a.attachDrivers(Fo() (Bu), [
- m,
- bc
- ])),
- gv = [
- 'image/jpeg',
- 'image/png',
- 'image/gif',
- 'image/bmp'
- ],
- Zu = function () {
- return function (e, t) {
- t = t().forumUpdateFavicon.apiCall;
- t && 'pending' === t.state() && t.abort()
- }
- },
- cp = function (a) {
- return function (t, e) {
- hv(a),
- t({
- type: ee.isSaving
- });
- var n = new window.FormData;
- n.append('favicon_file', a, a.name),
- n.append('forum', e().selection.forum.shortname),
- n.append('api_key', pt.a.keys.api);
- n = io.a.call('forums/updateFavicon', {
- data: n,
- method: 'POST',
- omitDisqusApiKey: !0,
- contentType: !1,
- processData: !1
- }).done(function (e) {
- t({
- type: ee.onSave,
- data: e
- })
- }).fail(function (e) {
- t({
- type: ee.onError,
- error: function (e) {
- var t;
- try {
- t = JSON.parse(e.responseText).response
- } catch (e) {
- t = 'There was an error uploading this file. Make sure your image is valid and is less than 2MB.'
- }
- return t
- }(e)
- })
- });
- return t({
- type: ee.setApiCall,
- apiCall: n
- }),
- n
- }
- },
- bp = function () {
- return function (e) {
- e({
- type: ee.dismissError
- })
- }
- };
- function yv(e) {
- return (yv = 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator ? function (e) {
- return typeof e
- }
- : function (e) {
- return e && 'function' == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? 'symbol' : typeof e
- }) (e)
- }
- function bv(e, t) {
- for (var n = 0; n < t.length; n++) {
- var a = t[n];
- a.enumerable = a.enumerable || !1,
- a.configurable = !0,
- 'value' in a && (a.writable = !0),
- Object.defineProperty(e, a.key, a)
- }
- }
- function vv(e, t) {
- return (vv = Object.setPrototypeOf || function (e, t) {
- return e.__proto__ = t,
- e
- }) (e, t)
- }
- function _v(n) {
- var a = function () {
- if ('undefined' == typeof Reflect || !Reflect.construct) return !1;
- if (Reflect.construct.sham) return !1;
- if ('function' == typeof Proxy) return !0;
- try {
- return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [
- ], function () {
- })),
- !0
- } catch (e) {
- return !1
- }
- }();
- return function () {
- var e,
- t = Ov(n);
- return e = a ? (e = Ov(this).constructor, Reflect.construct(t, arguments, e)) : t.apply(this, arguments),
- t = this,
- !(e = e) || 'object' !== yv(e) && 'function' != typeof e ? Ev(t) : e
- }
- }
- function Ev(e) {
- if (void 0 === e) throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called');
- return e
- }
- function Ov(e) {
- return (Ov = Object.setPrototypeOf ? Object.getPrototypeOf : function (e) {
- return e.__proto__ || Object.getPrototypeOf(e)
- }) (e)
- }
- function Sv(e, t, n) {
- return t in e ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n,
- e
- }
- var wv = [
- 'image/jpeg',
- 'image/png',
- 'image/gif',
- 'image/bmp'
- ],
- Pv = 'Please choose a valid image file. You may choose .jpg/.jpeg, .png, .gif, and .bmp files.',
- xu = function () {
- !function (e, t) {
- if ('function' != typeof t && null !== t) throw new TypeError('Super expression must either be null or a function');
- e.prototype = Object.create(t && t.prototype, {
- constructor: {
- value: e,
- writable: !0,
- configurable: !0
- }
- }),
- t && vv(e, t)
- }(o, A);
- var e,
- t,
- n,
- r = _v(o);
- function o() {
- var n;
- !function (e, t) {
- if (!(e instanceof t)) throw new TypeError('Cannot call a class as a function')
- }(this, o);
- for (var e = arguments.length, t = Array(e), a = 0; a < e; a++) t[a] = arguments[a];
- return Sv(Ev(n = r.call.apply(r, [
- this
- ].concat(t))), 'state', {
- error: null,
- isSaving: !1,
- newAvatarUrl: null
- }),
- Sv(Ev(n), 'validateImageFile', function (e) {
- e = e && je.a.contains(wv, e.type);
- return n.setState({
- error: e ? null : Pv
- }),
- e
- }),
- Sv(Ev(n), 'handleSaveForumAvatar', function (e) {
- if (n.validateImageFile(e)) {
- n.setState({
- isSaving: !0
- });
- var t = new window.FormData;
- return t.append('avatar_file', e, e.name),
- t.append('forum', n.props.selection.forum.shortname),
- t.append('api_key', pt.a.keys.api),
- n.apiCall = io.a.call('forums/updateDefaultAvatar', {
- data: t,
- method: 'POST',
- omitDisqusApiKey: !0,
- contentType: !1,
- processData: !1
- }).done(n.handleUpdateSuccess).fail(n.handleUpdateError),
- n.apiCall
- }
- }),
- Sv(Ev(n), 'handleRemoveForumAvatar', function () {
- return n.setState({
- isSaving: !0,
- error: null
- }),
- n.apiCall = io.a.call('forums/removeDefaultAvatar', {
- data: {
- forum: n.props.selection.forum.shortname
- },
- method: 'POST'
- }).done(n.handleUpdateSuccess).fail(n.handleUpdateError),
- n.apiCall
- }),
- Sv(Ev(n), 'handleDismissError', function () {
- n.setState({
- error: null
- })
- }),
- Sv(Ev(n), 'handleUpdateSuccess', function (e) {
- n.setState({
- newAvatarUrl: e.response,
- isSaving: !1
- })
- }),
- Sv(Ev(n), 'handleUpdateError', function (e) {
- n.setState({
- error: n.parseErrorResponse(e),
- isSaving: !1
- })
- }),
- Sv(Ev(n), 'parseErrorResponse', function (e) {
- var t;
- try {
- t = JSON.parse(e.responseText).response
- } catch (e) {
- t = 'There was an error uploading this file. Make sure your image is valid and is less than 2MB.'
- }
- return t
- }),
- Sv(Ev(n), 'getComponentProps', function () {
- return {
- forumAvatarError: n.state.error,
- forumAvatarIsSaving: n.state.isSaving,
- forumAvatarNewUrl: n.state.newAvatarUrl,
- forumAvatarOnSave: n.handleSaveForumAvatar,
- forumAvatarOnRemove: n.handleRemoveForumAvatar,
- forumAvatarValidateImageFile: n.validateImageFile,
- forumAvatarOnDismissError: n.handleDismissError
- }
- }),
- n
- }
- return e = o,
- (t = [
- {
- key: 'componentWillUnmount',
- value: function () {
- this.apiCall && 'pending' === this.apiCall.state() && this.apiCall.abort()
- }
- }
- ]) && bv(e.prototype, t),
- n && bv(e, n),
- o
- }();
- Sv(xu, 'displayName', 'ForumUpdateAvatarDriver'),
- Sv(xu, 'propTypes', {
- selection: ht.isRequired
- });
- p = Object(ki.createDriver) (xu, function (e) {
- return {
- selection: e.selection
- }
- });
- function kv(e) {
- return (kv = 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator ? function (e) {
- return typeof e
- }
- : function (e) {
- return e && 'function' == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? 'symbol' : typeof e
- }) (e)
- }
- function Nv() {
- return (Nv = Object.assign || function (e) {
- for (var t = 1; t < arguments.length; t++) {
- var n,
- a = arguments[t];
- for (n in a) Object.prototype.hasOwnProperty.call(a, n) && (e[n] = a[n])
- }
- return e
- }).apply(this, arguments)
- }
- function Cv(e, t) {
- for (var n = 0; n < t.length; n++) {
- var a = t[n];
- a.enumerable = a.enumerable || !1,
- a.configurable = !0,
- 'value' in a && (a.writable = !0),
- Object.defineProperty(e, a.key, a)
- }
- }
- function Rv(e, t) {
- return (Rv = Object.setPrototypeOf || function (e, t) {
- return e.__proto__ = t,
- e
- }) (e, t)
- }
- function xv(n) {
- var a = function () {
- if ('undefined' == typeof Reflect || !Reflect.construct) return !1;
- if (Reflect.construct.sham) return !1;
- if ('function' == typeof Proxy) return !0;
- try {
- return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [
- ], function () {
- })),
- !0
- } catch (e) {
- return !1
- }
- }();
- return function () {
- var e,
- t = Dv(n);
- return e = a ? (e = Dv(this).constructor, Reflect.construct(t, arguments, e)) : t.apply(this, arguments),
- t = this,
- !(e = e) || 'object' !== kv(e) && 'function' != typeof e ? Av(t) : e
- }
- }
- function Av(e) {
- if (void 0 === e) throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called');
- return e
- }
- function Dv(e) {
- return (Dv = Object.setPrototypeOf ? Object.getPrototypeOf : function (e) {
- return e.__proto__ || Object.getPrototypeOf(e)
- }) (e)
- }
- function jv(e, t, n) {
- return t in e ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n,
- e
- }
- h = function () {
- !function (e, t) {
- if ('function' != typeof t && null !== t) throw new TypeError('Super expression must either be null or a function');
- e.prototype = Object.create(t && t.prototype, {
- constructor: {
- value: e,
- writable: !0,
- configurable: !0
- }
- }),
- t && Rv(e, t)
- }(o, A);
- var e,
- t,
- n,
- a = xv(o);
- function o() {
- var r;
- !function (e, t) {
- if (!(e instanceof t)) throw new TypeError('Cannot call a class as a function')
- }(this, o);
- for (var e = arguments.length, t = Array(e), n = 0; n < e; n++) t[n] = arguments[n];
- return jv(Av(r = a.call.apply(a, [
- this
- ].concat(t))), 'loadFonts', function (e) {
- var t,
- n,
- a,
- r;
- 'undefined' != typeof window && ((n = (t = window.document).createElement('link')).id = 'custom_google_fonts', n.rel = 'stylesheet', n.type = 'text/css', a = 'https://fonts.googleapis.com/css2', r = 0, e.forEach(function (e) {
- e.isDefault || 'Source+Sans+Pro' === e.name || (a += ''.concat(r < 1 ? '?' : '&', 'family=').concat(e.name), r += 1)
- }), n.href = a += '&subset=latin&display=swap', (e = t.getElementById(n.id)) && e.parentNode.removeChild(e), t.head.appendChild(n))
- }),
- jv(Av(r), 'getFontOptions', function () {
- var e = r.props.fontList;
- if (e) return e.map(function (e) {
- var t = e.name.replace(/\+/g, ' '),
- n = {
- fontWeight: '400'
- };
- e.isDefault || 'Source+Sans+Pro' === e.name || (n.fontFamily = ''.concat(t, ', ').concat(e.category));
- var a = r.props.defaultsOnly;
- return {
- key: e.name,
- label: t,
- value: e.name,
- category: e.category,
- isDefault: e.isDefault,
- isDisabled: (a = !a && 'auto' !== r.props.selectedCategory ? r.props.selectedCategory !== e.category : a) && !e.isDefault,
- style: n
- }
- }).sort(function (e, t) {
- return e.isDisabled === t.isDisabled ? t.key < e.key ? 1 : - 1 : e.isDisabled && !t.isDisabled ? 1 : - 1
- })
- }),
- r
- }
- return e = o,
- (t = [
- {
- key: 'componentDidMount',
- value: function () {
- this.props.fontList && this.props.fontList.length && this.loadFonts(this.props.fontList)
- }
- },
- {
- key: 'componentDidUpdate',
- value: function (e) {
- this.props.fontList !== e.fontList && this.loadFonts(this.props.fontList)
- }
- },
- {
- key: 'render',
- value: function () {
- return C.a.createElement(Mf, Nv({
- name: 'Font-family',
- value: this.props.value,
- options: this.getFontOptions()
- }, this.props))
- }
- }
- ]) && Cv(e.prototype, t),
- n && Cv(e, n),
- o
- }();
- h.propTypes = {
- fontList: b.a.arrayOf(b.a.shape({
- name: b.a.string,
- category: b.a.oneOf(['auto',
- 'serif',
- 'sans-serif']),
- isDefault: b.a.bool
- })),
- value: b.a.string,
- label: b.a.node,
- selectedCategory: b.a.string,
- secondaryLabel: b.a.node,
- defaultsOnly: b.a.bool,
- disabled: b.a.bool,
- loading: b.a.bool,
- shouldHighlight: b.a.bool,
- onChange: b.a.func.isRequired,
- idNamespace: b.a.string,
- tooltip: b.a.node,
- width: b.a.number,
- className: b.a.string,
- children: b.a.node,
- readOnly: b.a.bool
- };
- var Tv = h;
- function Iv() {
- return (Iv = Object.assign || function (e) {
- for (var t = 1; t < arguments.length; t++) {
- var n,
- a = arguments[t];
- for (n in a) Object.prototype.hasOwnProperty.call(a, n) && (e[n] = a[n])
- }
- return e
- }).apply(this, arguments)
- }
- y = function (a) {
- var e = ''.concat(a.idNamespace || '', '_').concat(a.name),
- r = null === a.value ? '' : a.value,
- o = null === a.additionalClass ? '' : a.additionalClass,
- i = {
- width: a.width,
- height: a.height
- },
- s = {
- minWidth: a.width,
- minHeight: a.height
- };
- return C.a.createElement(kf, Iv({
- label: a.label,
- labelId: e,
- tooltip: a.tooltip,
- fieldsetAdditionalClass: a.className
- }, a), C.a.createElement('div', {
- id: e,
- className: 'input--image-select',
- value: r
- }, a.options.map(function (e, t) {
- var n = r === t ? 'active' : '';
- return C.a.createElement('div', {
- key: e.key,
- index: e.key,
- value: e.value,
- className: 'input--image-item '.concat(o, ' ').concat(n),
- onClick: function (e) {
- return a.onChange(e)
- },
- style: i
- }, C.a.createElement('img', {
- src: e.image,
- style: s,
- alt: 'image '.concat(t)
- }))
- }), a.children ? C.a.createElement('div', {
- className: 'input--image-item '.concat(o),
- style: i
- }, a.children) : null), a.error ? C.a.createElement('span', {
- className: 'text-medium text-error text-semibold spacing-narrow'
- }, a.error) : null)
- };
- y.propTypes = {
- name: b.a.string.isRequired,
- options: b.a.arrayOf(b.a.shape({
- key: b.a.oneOfType([b.a.string,
- b.a.number]).isRequired,
- value: b.a.any.isRequired,
- image: b.a.string.isRequired
- }).isRequired).isRequired,
- className: b.a.string,
- additionalClass: b.a.string,
- defaultOptionName: b.a.string,
- defaultOptionIsDisabled: b.a.bool,
- value: b.a.number.isRequired,
- label: b.a.string.isRequired,
- onChange: b.a.func.isRequired,
- idNamespace: b.a.string.isRequired,
- tooltip: b.a.node,
- width: b.a.string,
- height: b.a.string,
- error: b.a.string,
- children: b.a.node
- };
- var qv = y;
- function Fv(e) {
- return (Fv = 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator ? function (e) {
- return typeof e
- }
- : function (e) {
- return e && 'function' == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? 'symbol' : typeof e
- }) (e)
- }
- function Lv(t, e) {
- var n,
- a = Object.keys(t);
- return Object.getOwnPropertySymbols && (n = Object.getOwnPropertySymbols(t), e && (n = n.filter(function (e) {
- return Object.getOwnPropertyDescriptor(t, e).enumerable
- })), a.push.apply(a, n)),
- a
- }
- function Uv(t) {
- for (var e = 1; e < arguments.length; e++) {
- var n = null != arguments[e] ? arguments[e] : {
- };
- e % 2 ? Lv(Object(n), !0).forEach(function (e) {
- Vv(t, e, n[e])
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(n)) : Lv(Object(n)).forEach(function (e) {
- Object.defineProperty(t, e, Object.getOwnPropertyDescriptor(n, e))
- })
- }
- return t
- }
- function Mv(e, t) {
- for (var n = 0; n < t.length; n++) {
- var a = t[n];
- a.enumerable = a.enumerable || !1,
- a.configurable = !0,
- 'value' in a && (a.writable = !0),
- Object.defineProperty(e, a.key, a)
- }
- }
- function Bv(e, t) {
- return (Bv = Object.setPrototypeOf || function (e, t) {
- return e.__proto__ = t,
- e
- }) (e, t)
- }
- function zv(n) {
- var a = function () {
- if ('undefined' == typeof Reflect || !Reflect.construct) return !1;
- if (Reflect.construct.sham) return !1;
- if ('function' == typeof Proxy) return !0;
- try {
- return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [
- ], function () {
- })),
- !0
- } catch (e) {
- return !1
- }
- }();
- return function () {
- var e,
- t = Gv(n);
- return e = a ? (e = Gv(this).constructor, Reflect.construct(t, arguments, e)) : t.apply(this, arguments),
- t = this,
- !(e = e) || 'object' !== Fv(e) && 'function' != typeof e ? Hv(t) : e
- }
- }
- function Hv(e) {
- if (void 0 === e) throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called');
- return e
- }
- function Gv(e) {
- return (Gv = Object.setPrototypeOf ? Object.getPrototypeOf : function (e) {
- return e.__proto__ || Object.getPrototypeOf(e)
- }) (e)
- }
- function Vv(e, t, n) {
- return t in e ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n,
- e
- }
- lt = function () {
- !function (e, t) {
- if ('function' != typeof t && null !== t) throw new TypeError('Super expression must either be null or a function');
- e.prototype = Object.create(t && t.prototype, {
- constructor: {
- value: e,
- writable: !0,
- configurable: !0
- }
- }),
- t && Bv(e, t)
- }(r, A);
- var e,
- t,
- n,
- a = zv(r);
- function r() {
- var o;
- !function (e, t) {
- if (!(e instanceof t)) throw new TypeError('Cannot call a class as a function')
- }(this, r);
- for (var e = arguments.length, t = Array(e), n = 0; n < e; n++) t[n] = arguments[n];
- return Vv(Hv(o = a.call.apply(a, [
- this
- ].concat(t))), 'state', Uv(Uv({
- }, r.getEditableFieldsFromForum(o.props.forumDetails)), {
- }, {
- selectedAvatarIndex: 0,
- avatarOptions: [
- of
- ],
- hasPendingAvatarChange: !1,
- selectedFaviconIndex: 0,
- faviconOptions: [
- ],
- hasPendingFaviconChange: !1,
- commentPolicyPreviewExpanded: !0,
- fontOptionList: r.getFontOptionsList(),
- savedFields: Uv(Uv({
- }, r.getEditableFieldsFromForum(o.props.forumDetails)), {
- }, {
- hasPendingAvatarChange: !1,
- hasPendingFaviconChange: !1
- })
- })),
- Vv(Hv(o), 'avatarFileInput', C.a.createRef()),
- Vv(Hv(o), 'faviconFileInput', C.a.createRef()),
- Vv(Hv(o), 'confirmNavigationIfUnsaved', function () {
- if (o.hasUnsavedChanges()) return 'You have unsaved changes. Do you want to leave this page?'
- }),
- Vv(Hv(o), 'toggleCommentPolicyPreviewExpanded', function (e) {
- e.preventDefault(),
- o.setState(function (e) {
- return {
- commentPolicyPreviewExpanded: !e.commentPolicyPreviewExpanded
- }
- })
- }),
- Vv(Hv(o), 'getUploadedCustomAvatarFile', function () {
- var e = o.avatarFileInput.current && o.avatarFileInput.current.files;
- return e && e[0]
- }),
- Vv(Hv(o), 'getUploadedFaviconFile', function () {
- var e = o.faviconFileInput.current && o.faviconFileInput.current.files;
- return e && e[0]
- }),
- Vv(Hv(o), 'getAvatarOptions', function () {
- var e = o.props.forumDetails,
- n = o.state.avatarOptions;
- return o.state.hasCustomAvatar && 1 === n.length && (n.unshift(o.lastValidAvatar || o.props.forumAvatarNewUrl || e && e.avatar && e.avatar.large.permalink), o.setState({
- avatarOptions: n
- })),
- n.map(function (e, t) {
- return {
- key: t,
- value: {
- isCustomAvatarSelected: t < n.length - 1
- },
- image: e
- }
- })
- }),
- Vv(Hv(o), 'getFaviconOptions', function () {
- return o.state.faviconOptions.map(function (e, t) {
- return {
- key: t,
- value: t,
- image: e
- }
- })
- }),
- Vv(Hv(o), 'getFontCategory', function (t) {
- return o.state.fontOptionList.filter(function (e) {
- return e.name === t
- }) [0].category
- }),
- Vv(Hv(o), 'handleFontSelection', function (r) {
- return function (e) {
- var t,
- n = o.state.customFont,
- a = o.state.typeface;
- 'typeface' === r ? (a = e.target.value, t = o.getFontCategory(n), 'auto' !== a && 'auto' !== t && a !== t && (n = cf.name)) : 'auto' !== o.getFontCategory(n = e.target.value) && (a = o.getFontCategory(n)),
- o.setState({
- typeface: a,
- customFont: n
- })
- }
- }),
- Vv(Hv(o), 'hasValidCustomAvatar', function () {
- var e = o.getUploadedCustomAvatarFile();
- return o.state.hasCustomAvatar || !!(e ? o.props.forumAvatarValidateImageFile(e) : o.lastValidAvatar)
- }),
- Vv(Hv(o), 'hasValidFavicon', function () {
- var e = o.getUploadedFaviconFile();
- return !!(e ? o.props.forumFaviconValidateImageFile(e) : o.lastValidFavicon)
- }),
- Vv(Hv(o), 'isCustomAvatarSelected', function () {
- return o.hasValidCustomAvatar() && 0 === o.state.selectedAvatarIndex
- }),
- Vv(Hv(o), 'isNewFaviconSelected', function () {
- return o.hasValidFavicon() && 1 === o.state.selectedFaviconIndex
- }),
- Vv(Hv(o), 'handleAvatarTypeChange', function (e) {
- var t = parseInt(e.target.parentElement.getAttribute('index'), 10),
- n = o.hasValidCustomAvatar(),
- e = o.getUploadedCustomAvatarFile() || 0 !== t;
- o.setState({
- selectedAvatarIndex: t,
- hasCustomAvatar: n,
- hasPendingAvatarChange: e
- })
- }),
- Vv(Hv(o), 'handleFaviconTypeChange', function (e) {
- var t = parseInt(e.target.parentElement.getAttribute('index'), 10),
- e = o.getUploadedFaviconFile() || 0 !== t;
- o.setState({
- selectedFaviconIndex: t,
- hasNewFavicon: o.hasValidFavicon(),
- hasPendingFaviconChange: e
- })
- }),
- Vv(Hv(o), 'handleInputChange', function (a) {
- return function (e) {
- var e = e.target,
- n = 'checkbox' === e.type ? e.checked : e.value;
- 'radio' === e.type ? n = 'true' === n : 'text' === e.type || 'boolean' == typeof n || '' === n || isNaN(n) || (n = parseInt(n, 10)),
- o.setState(function (e) {
- var t = {
- };
- return Vv(t, a, n),
- Vv(t, 'hasPendingAvatarChange', 'hasCustomAvatar' === a || e.hasPendingAvatarChange),
- Vv(t, 'hasPendingFaviconChange', 'hasNewFavicon' === a || e.hasPendingFaviconChange),
- t
- })
- }
- }),
- Vv(Hv(o), 'hasFieldChanged', function (e) {
- return o.state[e] !== o.state.savedFields[e] && !(null === o.state.savedFields[e] && '' === o.state[e])
- }),
- Vv(Hv(o), 'handleAvatarFileInputChange', function () {
- var e,
- t;
- o.hasValidCustomAvatar() ? (o.props.forumAvatarOnDismissError(), e = o.state.avatarOptions, t = o.getUploadedCustomAvatarFile(), 1 === e.length ? e.unshift(URL.createObjectURL(t)) : e[0] = URL.createObjectURL(t), o.setState({
- hasCustomAvatar: !0,
- hasPendingAvatarChange: !0,
- avatarOptions: e
- })) : o.setState({
- hasCustomAvatar: !1
- })
- }),
- Vv(Hv(o), 'handleFaviconFileInputChange', function () {
- var e,
- t;
- o.hasValidFavicon() ? (o.props.forumFaviconOnDismissError(), e = o.state.faviconOptions, t = o.getUploadedFaviconFile(), e[1] = URL.createObjectURL(t), o.setState({
- hasNewFavicon: !0,
- hasPendingFaviconChange: !0,
- faviconOptions: e,
- selectedFaviconIndex: 1
- })) : o.setState({
- hasNewFavicon: !1
- })
- }),
- Vv(Hv(o), 'hasUnsavedChanges', function () {
- return Object.keys(o.state.savedFields).some(function (e) {
- return o.hasFieldChanged(e)
- })
- }),
- Vv(Hv(o), 'handleSaveChanges', function () {
- var e;
- o.state.hasPendingAvatarChange ? o.handleSaveAvatar() : o.state.hasPendingFaviconChange ? o.handleSaveFavicon() : (e = {
- name: o.state.name,
- website: o.state.website,
- forumCategory: o.state.category,
- adultContent: o.state.adultContent ? 1 : 0,
- description: o.state.description,
- colorScheme: o.state.colorScheme,
- typeface: o.state.typeface,
- translationLanguage: o.state.language,
- disableDisqusBranding: o.state.enableDisqusBranding ? 0 : 1,
- commentPolicyLink: o.state.commentPolicyLink,
- commentPolicyText: o.state.commentPolicyText
- }, o.hasFeature('customFonts') && (e.customFont = o.state.customFont), o.props.forumUpdateOnSave(e).done(function () {
- o.setState(function (e) {
- return {
- savedFields: {
- name: e.name,
- website: e.website,
- category: e.category,
- adultContent: e.adultContent,
- colorScheme: e.colorScheme,
- typeface: e.typeface,
- customFont: e.customFont,
- description: e.description,
- hasCustomAvatar: e.hasCustomAvatar,
- lastValidAvatar: e.lastValidAvatar,
- language: e.language,
- enableDisqusBranding: e.enableDisqusBranding,
- commentPolicyText: e.commentPolicyText,
- commentPolicyLink: e.commentPolicyLink,
- hasPendingAvatarChange: !1,
- hasPendingFaviconChange: !1
- }
- }
- })
- }))
- }),
- Vv(Hv(o), 'handleSaveAvatar', function () {
- var e = o.state.hasCustomAvatar,
- t = o.getUploadedCustomAvatarFile(),
- t = t && o.isCustomAvatarSelected() ? o.props.forumAvatarOnSave(t) : o.props.forumAvatarOnRemove();
- t && t.done(function () {
- this.avatarFileInput.current.value = '',
- e && (this.lastValidAvatar = this.props.forumAvatarNewUrl),
- this.setState({
- hasPendingAvatarChange: !1
- }, this.handleSaveChanges)
- }.bind(Hv(o)))
- }),
- Vv(Hv(o), 'handleSaveFavicon', function () {
- var e = o.getUploadedFaviconFile();
- e && o.isNewFaviconSelected() ? o.props.forumFaviconOnSave(e).done(function () {
- this.faviconFileInput.current.value = '',
- this.lastValidFavicon = this.props.forumFaviconNewUrl,
- this.setState({
- hasPendingFaviconChange: !1,
- faviconOptions: [
- this.props.forumFaviconNewUrl
- ]
- }, this.handleSaveChanges)
- }.bind(Hv(o))) : o.setState({
- hasPendingFaviconChange: !1
- }, o.handleSaveChanges)
- }),
- Vv(Hv(o), 'hasFeature', function (e) {
- return !!(o.props.forumDetails && o.props.forumDetails.features && o.props.forumDetails.features[e])
- }),
- Vv(Hv(o), 'getInputId', function (e) {
- return ''.concat(o.constructor.displayName, '_').concat(e)
- }),
- o
- }
- return e = r,
- (t = [
- {
- key: 'componentDidMount',
- value: function () {
- this.props.history.setRouteLeaveHook(this.props.route, this.confirmNavigationIfUnsaved),
- this.props.emitTrackingEvent({
- verb: 'view',
- object_type: 'page',
- object_id: ''.concat(window.document.location.host).concat(window.document.location.pathname)
- }),
- this.props.fetchForumCategories(),
- this.props.fetchForumDetails(),
- this.props.fetchForumLanguages()
- }
- },
- {
- key: 'componentWillReceiveProps',
- value: function (t) {
- var n;
- !this.props.forumDetails && t.forumDetails && (n = r.getEditableFieldsFromForum(t.forumDetails), this.setState(function (e) {
- return Uv(Uv({
- }, n), {
- }, {
- savedFields: Uv(Uv({
- }, r.getEditableFieldsFromForum(t.forumDetails)), {
- }, {
- hasPendingAvatarChange: !1,
- hasPendingFaviconChange: !1
- }),
- faviconOptions: !e.faviconOptions.length && t.forumDetails.favicon.permalink ? [
- t.forumDetails.favicon.permalink
- ] : e.faviconOptions
- })
- }, Function.bind.call(function () {
- var e;
- this.state.hasCustomAvatar && (this.lastValidAvatar = (e = t.forumDetails.avatar) && e.large.permalink),
- this.state.hasNewFavicon && (this.lastValidFavicon = (e = t.forumDetails.favicon) && e.permalink)
- }, this)))
- }
- },
- {
- key: 'componentWillUnmount',
- value: function () {
- this.props.abortUpdateForumFaviconApiCall()
- }
- },
- {
- key: 'render',
- value: function () {
- var t = this;
- if (this.props.selection.organization && this.props.selection.organization.pollsOnly) return C.a.createElement(Cm, {
- isPolls: !1,
- organization: this.props.selection.organization
- });
- if (this.props.forumDetailsIsFetching) return C.a.createElement(Ji, null);
- if (this.props.forumDetailsError) return C.a.createElement('div', {
- className: 'content__wrap spacing-bottom-double'
- }, C.a.createElement(Ki, {
- message: this.props.forumDetailsError,
- alertType: 'error'
- }));
- var e = this.props.forumDetails,
- n = this.props.organizations[this.props.selection.forum.organization],
- a = this.props.forumCategories.allCategories.map(function (e) {
- return {
- key: e.id,
- value: e.id,
- label: e.name
- }
- }),
- r = this.props.forumLanguages.map(function (e) {
- return {
- key: e.code,
- value: e.code,
- label: e.name
- }
- }),
- o = this.getInputId('colorScheme'),
- i = this.getInputId('typeface'),
- s = this.hasFeature('brandingOptional'),
- l = this.hasFeature('customFonts'),
- c = yo.a.isFeatureActive('custom_fonts', {
- forum: (this.props.selection.forum || {
- }).shortname
- }),
- u = s || ql(this.props.selection);
- return C.a.createElement('div', null, C.a.createElement('div', {
- className: 'content__wrap spacing-bottom-double'
- }, C.a.createElement('header', {
- className: 'settings__header'
- }, C.a.createElement('h2', {
- className: 'text-larger text-gray-darker spacing-bottom-small'
- }, 'Configure Disqus for Your Site'), C.a.createElement('p', {
- className: 'text-gray'
- }, 'Disqus automatically adapts to your community and offers powerful customization options. ', C.a.createElement('a', {
- href: Pn.adminArticles,
- target: '_blank',
- rel: 'noopener noreferrer'
- }, 'Learn more »'))), C.a.createElement('section', {
- className: 'settings__content'
- }, this.props.forumUpdateError ? C.a.createElement(Ki, {
- message: this.props.forumUpdateError,
- onRequestClose: this.props.forumUpdateOnDismissError,
- alertType: 'error'
- }) : null, C.a.createElement(kf, {
- label: 'Organization',
- blockAdditionalClass: 'text-medium',
- tooltip: n.name ? C.a.createElement(C.a.Fragment, null, 'Organizations are used to manage multiple sites, and this is the organization this site belongs to.', C.a.createElement('span', null, ' ', C.a.createElement(Us, {
- path: '/settings/general/',
- orgId: n.id,
- orgSlug: n.slug
- }, 'Edit organization settings.'))) : null
- }, C.a.createElement('div', null, n.name ? C.a.createElement('h4', {
- className: 'spacing-top-narrow'
- }, n.name) : C.a.createElement('p', {
- className: 'spacing-top-small'
- }, 'Organizations are used to manage multiple sites, and this is the organization this site belongs to.', C.a.createElement('span', null, ' ', C.a.createElement(Us, {
- path: '/settings/general/',
- orgId: n.id,
- orgSlug: n.slug
- }, 'Edit organization settings.'))))), C.a.createElement(kf, {
- label: 'Shortname',
- fieldsetAdditionalClass: 'spacing-top-narrow',
- blockAdditionalClass: 'text-medium',
- tooltip: 'This is used to uniquely identify your website on Disqus. It cannot be changed.'
- }, e ? C.a.createElement('div', {
- className: 'spacing-top-narrow'
- }, C.a.createElement('h4', null, e.id)) : null), C.a.createElement($h, {
- name: 'name',
- value: this.state.name,
- label: 'Website Name',
- onChange: this.handleInputChange('name'),
- idNamespace: this.constructor.displayName,
- readOnly: this.props.forumUpdateIsSaving,
- disabled: this.props.forumUpdateIsSaving,
- shouldHighlight: this.hasFieldChanged('name'),
- maxLength: '64'
- }), C.a.createElement($h, {
- name: 'website',
- value: this.state.website,
- label: 'Website URL',
- onChange: this.handleInputChange('website'),
- idNamespace: this.constructor.displayName,
- readOnly: this.props.forumUpdateIsSaving,
- disabled: this.props.forumUpdateIsSaving,
- shouldHighlight: this.hasFieldChanged('website'),
- tooltip: C.a.createElement(C.a.Fragment, null, 'Changing domains? ', C.a.createElement('a', {
- href: '/admin/discussions/migrate/'
- }, 'Learn how'), '.')
- }), C.a.createElement(qv, {
- name: 'forum-favicon',
- label: 'Website Favicon',
- idNamespace: 'forum-favicon',
- className: 'spacing-bottom-large',
- options: this.getFaviconOptions(),
- value: this.state.selectedFaviconIndex,
- onChange: this.handleFaviconTypeChange,
- error: this.props.forumFaviconError,
- shouldHighlight: this.hasFieldChanged('hasPendingFaviconChange'),
- width: '48px',
- height: '48px',
- tooltip: C.a.createElement(C.a.Fragment, null, 'This will be the image for your site, which will appear at the top of your ', C.a.createElement('a', {
- href: '//disqus.com/home/forum/'.concat(e && e.id)
- }, 'forum profile'), '.')
- }, C.a.createElement('input', {
- type: 'file',
- id: 'custom-favicon-input',
- className: 'input--display-label',
- ref: this.faviconFileInput,
- onChange: this.handleFaviconFileInputChange
- }), C.a.createElement('label', {
- htmlFor: 'custom-favicon-input'
- }, C.a.createElement('img', {
- src: '//c.disquscdn.com/next/current/publisher-admin/assets/img/add-avatar-plus.svg',
- alt: 'Upload a favicon'
- }))), C.a.createElement($h, {
- name: 'commentPolicyLink',
- value: this.state.commentPolicyLink,
- label: 'Comment Policy URL',
- onChange: this.handleInputChange('commentPolicyLink'),
- idNamespace: this.constructor.displayName,
- readOnly: this.props.forumUpdateIsSaving,
- disabled: this.props.forumUpdateIsSaving,
- shouldHighlight: this.hasFieldChanged('commentPolicyLink'),
- tooltip: C.a.createElement(C.a.Fragment, null, 'Don\'t have a comment policy yet? ', C.a.createElement('a', {
- href: Pn.commentPolicySuggestions
- }, 'Check out our suggestions.'))
- }), C.a.createElement($h, {
- name: 'commentPolicyText',
- value: this.state.commentPolicyText,
- label: 'Comment Policy Summary',
- onChange: this.handleInputChange('commentPolicyText'),
- idNamespace: this.constructor.displayName,
- readOnly: this.props.forumUpdateIsSaving,
- disabled: this.props.forumUpdateIsSaving,
- placeholder: 'Ex: We welcome relevant and respectful comments. Off-topic comments may be removed.',
- shouldHighlight: this.hasFieldChanged('commentPolicyText'),
- maxLength: 120,
- tooltip: C.a.createElement(C.a.Fragment, null, 'A brief summary of your policy that will appear above the comment area.', ' ', C.a.createElement('a', {
- href: '#',
- onClick: this.toggleCommentPolicyPreviewExpanded
- }, this.state.commentPolicyPreviewExpanded ? 'Collapse preview.' : 'Preview what it looks like.'))
- }), C.a.createElement(Zg, {
- commentPolicyLink: this.state.commentPolicyLink,
- commentPolicyText: this.state.commentPolicyText,
- colorScheme: this.state.colorScheme,
- forumDetails: this.props.forumDetails,
- expanded: this.state.commentPolicyPreviewExpanded
- }), C.a.createElement(qv, {
- name: 'default-commenter-avatar',
- label: 'Default Commenter Avatar',
- idNamespace: 'default-commenter-avatar',
- className: 'spacing-bottom-large',
- additionalClass: 'default-commenter-avatar',
- options: this.getAvatarOptions(),
- value: this.state.selectedAvatarIndex,
- onChange: this.handleAvatarTypeChange,
- error: this.props.forumAvatarError,
- shouldHighlight: this.hasFieldChanged('hasPendingAvatarChange'),
- width: '48px',
- height: '48px',
- tooltip: C.a.createElement(C.a.Fragment, null, 'Commenters without a chosen avatar picture will use this image on your site. To set your own avatar, ', C.a.createElement('a', {
- href: Pn.profileAvatar
- }, 'go to your profile'), '.')
- }, C.a.createElement('input', {
- type: 'file',
- id: 'custom-avatar-input',
- className: 'custom-avatar-input input--display-label',
- ref: this.avatarFileInput,
- onChange: this.handleAvatarFileInputChange
- }), C.a.createElement('label', {
- htmlFor: 'custom-avatar-input'
- }, C.a.createElement('img', {
- src: '//c.disquscdn.com/next/current/publisher-admin/assets/img/add-avatar-plus.svg',
- alt: 'Upload an Avatar'
- }))), C.a.createElement(Mf, {
- name: 'category',
- label: 'Category',
- value: this.state.category,
- options: a,
- placeholder: 'Please select a category',
- onChange: this.handleInputChange('category'),
- idNamespace: this.constructor.displayName,
- readOnly: this.props.forumUpdateIsSaving,
- disabled: !a.length || this.props.forumUpdateIsSaving,
- shouldHighlight: this.hasFieldChanged('category')
- }), C.a.createElement($h, {
- name: 'description',
- value: this.state.description,
- label: 'Description',
- onChange: this.handleInputChange('description'),
- idNamespace: this.constructor.displayName,
- useTextarea: !0,
- readOnly: this.props.forumUpdateIsSaving,
- disabled: this.props.forumUpdateIsSaving,
- shouldHighlight: this.hasFieldChanged('description'),
- maxLength: '300'
- }), C.a.createElement(Mf, {
- name: 'language',
- label: 'Language',
- value: this.state.language,
- options: r,
- placeholder: 'Select a Language',
- onChange: this.handleInputChange('language'),
- disabled: !r.length,
- idNamespace: this.constructor.displayName,
- shouldHighlight: this.hasFieldChanged('language'),
- tooltip: C.a.createElement(C.a.Fragment, null, C.a.createElement('a', {
- href: Pn.translate
- }, 'Make Disqus available in your language.'))
- }), u ? C.a.createElement(Ob, {
- name: 'enableDisqusBranding',
- checked: this.state.enableDisqusBranding,
- label: C.a.createElement('span', null, s ? null : C.a.createElement(Ks, {
- emitEvent: function (e) {
- return t.props.emitTrackingEvent(Uv({
- area: 'disqus_branding'
- }, e))
- },
- organization: n,
- iconClass: 'spacing-right-small'
- }), 'Disqus Branding'),
- secondaryLabel: 'Show Disqus logo and "Add Disqus to your site" text in comments area',
- onChange: this.handleInputChange('enableDisqusBranding'),
- idNamespace: this.constructor.displayName,
- readOnly: !s || this.props.forumUpdateIsSaving,
- shouldHighlight: this.hasFieldChanged('enableDisqusBranding')
- }, s ? null : C.a.createElement('p', {
- className: 'fieldset__description text-small text-gray'
- }, 'This feature is only available to publishers on a Disqus Pro plan.', ' ', C.a.createElement(Us, {
- path: '/settings/subscription/',
- orgId: n.id,
- orgSlug: n.slug
- }, 'View upgrade options'), '.')) : null, C.a.createElement(Ob, {
- name: 'adultContent',
- checked: this.state.adultContent,
- label: 'Adult Content',
- secondaryLabel: 'Flag my site as adult oriented or NSFW',
- onChange: this.handleInputChange('adultContent'),
- idNamespace: this.constructor.displayName,
- readOnly: this.props.forumUpdateIsSaving,
- shouldHighlight: this.hasFieldChanged('adultContent'),
- tooltip: C.a.createElement(C.a.Fragment, null, C.a.createElement('a', {
- href: Pn.nsfwContent
- }, 'What does this mean?'))
- }), c ? C.a.createElement('span', null, C.a.createElement(Mf, {
- id: o,
- name: 'colorScheme',
- label: 'Color scheme',
- className: 'fieldset-item__select',
- value: this.state.colorScheme,
- options: pf,
- onChange: this.handleInputChange('colorScheme'),
- readOnly: this.props.forumUpdateIsSaving,
- loading: this.props.forumUpdateIsSaving,
- shouldHighlight: this.hasFieldChanged('colorScheme')
- }), C.a.createElement(kf, {
- label: 'Typeface',
- labelId: i,
- blockAdditionalClass: '-text text-medium align align--wrap',
- shouldHighlight: this.hasFieldChanged('typeface') || this.hasFieldChanged('customFont')
- }, C.a.createElement(Mf, {
- id: i,
- name: 'typeface',
- secondaryLabel: 'Category',
- className: 'fieldset-item__select',
- value: this.state.typeface,
- options: lf,
- onChange: this.handleFontSelection('typeface'),
- inline: !0,
- readOnly: this.props.forumUpdateIsSaving,
- loading: this.props.forumUpdateIsSaving
- }), C.a.createElement(Tv, {
- name: 'customFont',
- className: 'limit-menu-height',
- secondaryLabel: l ? 'Font Family' : C.a.createElement('span', null, C.a.createElement(Ks, {
- className: 'media-middle',
- plan: 'business',
- height: 17,
- emitEvent: function (e) {
- return t.props.emitTrackingEvent(Uv({
- area: 'disqus_branding'
- }, e))
- },
- organization: n,
- iconClass: 'spacing-right-small'
- }), 'Font Family'),
- value: this.state.customFont,
- fontList: this.state.fontOptionList,
- selectedCategory: this.state.typeface,
- defaultsOnly: !l,
- onChange: this.handleFontSelection('customFont'),
- inline: !0,
- readOnly: !this.state.fontOptionList.length || this.props.forumUpdateIsSaving,
- disabled: !this.state.fontOptionList.length || this.props.forumUpdateIsSaving
- }))) : C.a.createElement(kf, {
- label: 'Appearance',
- labelId: o,
- blockAdditionalClass: '-text text-medium align align--wrap',
- shouldHighlight: this.hasFieldChanged('colorScheme') || this.hasFieldChanged('typeface')
- }, C.a.createElement(Mf, {
- id: o,
- name: 'colorScheme',
- secondaryLabel: 'Color scheme',
- className: 'fieldset-item__select',
- value: this.state.colorScheme,
- options: pf,
- onChange: this.handleInputChange('colorScheme'),
- inline: !0,
- readOnly: this.props.forumUpdateIsSaving,
- loading: this.props.forumUpdateIsSaving
- }), C.a.createElement(Mf, {
- id: i,
- name: 'typeface',
- secondaryLabel: 'Typeface',
- className: 'fieldset-item__select',
- value: this.state.typeface,
- options: lf,
- onChange: this.handleInputChange('typeface'),
- inline: !0,
- readOnly: this.props.forumUpdateIsSaving,
- loading: this.props.forumUpdateIsSaving
- }))), C.a.createElement('footer', {
- className: 'settings__footer'
- }, C.a.createElement(Bh, {
- disabled: !this.hasUnsavedChanges(),
- onClick: this.handleSaveChanges,
- isSaving: this.props.forumUpdateIsSaving || this.props.forumAvatarIsSaving || this.props.forumFaviconIsSaving,
- isSaved: this.props.forumUpdateIsSaved
- }))))
- }
- }
- ]) && Mv(e.prototype, t),
- n && Mv(e, n),
- r
- }();
- Vv(lt, 'displayName', 'ForumSettingsGeneral'),
- Vv(lt, 'propTypes', {
- history: b.a.shape({
- setRouteLeaveHook: b.a.func.isRequired
- }).isRequired,
- route: b.a.object.isRequired,
- organizations: b.a.object.isRequired,
- selection: ht.isRequired,
- forumDetails: $c,
- forumDetailsError: b.a.string,
- forumDetailsIsFetching: b.a.bool,
- fetchForumDetails: b.a.func.isRequired,
- forumUpdateError: b.a.string,
- forumUpdateIsSaving: b.a.bool,
- forumUpdateIsSaved: b.a.bool,
- forumUpdateOnSave: b.a.func.isRequired,
- forumUpdateOnDismissError: b.a.func.isRequired,
- forumAvatarError: b.a.string,
- forumAvatarIsSaving: b.a.bool,
- forumAvatarNewUrl: b.a.string,
- forumAvatarOnSave: b.a.func.isRequired,
- forumAvatarOnRemove: b.a.func.isRequired,
- forumAvatarValidateImageFile: b.a.func.isRequired,
- forumAvatarOnDismissError: b.a.func.isRequired,
- forumCategories: b.a.shape({
- allCategories: b.a.arrayOf(vl)
- }).isRequired,
- forumLanguages: b.a.arrayOf(xl).isRequired,
- emitTrackingEvent: b.a.func.isRequired,
- fetchForumCategories: b.a.func.isRequired,
- fetchForumLanguages: b.a.func.isRequired,
- abortUpdateForumFaviconApiCall: b.a.func.isRequired,
- forumFaviconValidateImageFile: b.a.func.isRequired,
- forumFaviconOnSave: b.a.func.isRequired,
- forumFaviconOnDismissError: b.a.func.isRequired,
- forumFaviconError: b.a.string,
- forumFaviconIsSaving: b.a.bool,
- forumFaviconNewUrl: b.a.string
- }),
- Vv(lt, 'getEditableFieldsFromForum', function (e) {
- var t = (e = e || {
- }).settings || {
- };
- return {
- name: e.name,
- website: e.url,
- category: e.forumCategory && e.forumCategory.id || null,
- adultContent: !!t.adultContent,
- typeface: e.typeface,
- customFont: e.customFont || cf.name,
- colorScheme: e.colorScheme,
- description: e.raw_description,
- hasCustomAvatar: t.hasCustomAvatar,
- lastValidAvatar: t.hasCustomAvatar && e.avatar && e.avatar.large.permalink,
- lastValidFavicon: e.favicon && e.favicon.permalink,
- language: e.language,
- enableDisqusBranding: !e.disableDisqusBranding,
- commentPolicyText: e.commentPolicyText,
- commentPolicyLink: e.commentPolicyLink
- }
- }),
- Vv(lt, 'getFontOptionsList', function () {
- var e = (Sb.a.lounge || {
- }).font_options;
- return e[0] !== cf && e.unshift(cf),
- e
- });
- var Wv = Object(u.connect) (function (e) {
- var t = e.forumDetails,
- n = e.forumUpdateFavicon;
- return {
- forumCategories: e.forumCategories,
- forumLanguages: e.forumLanguages.languages,
- forumDetails: t.forumDetails,
- forumDetailsError: t.forumDetailsError,
- forumDetailsIsFetching: t.forumDetailsIsFetching,
- forumFaviconError: n.error,
- forumFaviconIsSaving: n.isSaving,
- forumFaviconNewUrl: n.forumFaviconNewUrl,
- selection: e.selection
- }
- }, {
- emitTrackingEvent: Xo({
- zone: 'settings',
- section: 'general'
- }),
- fetchForumCategories: Nh,
- fetchForumLanguages: vu,
- fetchForumDetails: ig,
- abortUpdateForumFaviconApiCall: Zu,
- forumFaviconValidateImageFile: hv,
- forumFaviconOnSave: cp,
- forumFaviconOnDismissError: bp
- }) (Ni.a.attachDrivers(Fo() (lt), [
- m,
- p
- ])),
- ut = n(168),
- Yv = n.n(ut);
- function Qv(e) {
- return (Qv = 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator ? function (e) {
- return typeof e
- }
- : function (e) {
- return e && 'function' == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? 'symbol' : typeof e
- }) (e)
- }
- function Kv() {
- return (Kv = Object.assign || function (e) {
- for (var t = 1; t < arguments.length; t++) {
- var n,
- a = arguments[t];
- for (n in a) Object.prototype.hasOwnProperty.call(a, n) && (e[n] = a[n])
- }
- return e
- }).apply(this, arguments)
- }
- function Jv(e) {
- return function (e) {
- if (Array.isArray(e)) return Xv(e)
- }(e) || function (e) {
- if ('undefined' != typeof Symbol && null != e[Symbol.iterator] || null != e['@@iterator']) return Array.from(e)
- }(e) || Zv(e) || function () {
- throw new TypeError('Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.')
- }()
- }
- function $v(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) {
- var a,
- r,
- o = [
- ],
- i = !0,
- s = !1;
- try {
- for (n = n.call(e); !(i = (a = n.next()).done) && (o.push(a.value), !t || o.length !== t); i = !0);
- } catch (e) {
- s = !0,
- r = e
- } finally {
- try {
- i || null == n.return || n.return()
- } finally {
- if (s) throw r
- }
- }
- return o
- }
- }(e, t) || Zv(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 Zv(e, t) {
- if (e) {
- if ('string' == typeof e) return Xv(e, t);
- var n = Object.prototype.toString.call(e).slice(8, - 1);
- return 'Map' === (n = 'Object' === n && e.constructor ? e.constructor.name : n) || 'Set' === n ? Array.from(e) : 'Arguments' === n || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n) ? Xv(e, t) : void 0
- }
- }
- function Xv(e, t) {
- for (var n = 0, a = Array(t = null == t || e.length < t ? e.length : t); n < t; n++) a[n] = e[n];
- return a
- }
- function e_(e, t) {
- if (!(e instanceof t)) throw new TypeError('Cannot call a class as a function')
- }
- function t_(e, t) {
- for (var n = 0; n < t.length; n++) {
- var a = t[n];
- a.enumerable = a.enumerable || !1,
- a.configurable = !0,
- 'value' in a && (a.writable = !0),
- Object.defineProperty(e, a.key, a)
- }
- }
- function n_(e, t, n) {
- return t && t_(e.prototype, t),
- n && t_(e, n),
- e
- }
- function a_(e, t) {
- if ('function' != typeof t && null !== t) throw new TypeError('Super expression must either be null or a function');
- e.prototype = Object.create(t && t.prototype, {
- constructor: {
- value: e,
- writable: !0,
- configurable: !0
- }
- }),
- t && r_(e, t)
- }
- function r_(e, t) {
- return (r_ = Object.setPrototypeOf || function (e, t) {
- return e.__proto__ = t,
- e
- }) (e, t)
- }
- function o_(n) {
- var a = function () {
- if ('undefined' == typeof Reflect || !Reflect.construct) return !1;
- if (Reflect.construct.sham) return !1;
- if ('function' == typeof Proxy) return !0;
- try {
- return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [
- ], function () {
- })),
- !0
- } catch (e) {
- return !1
- }
- }();
- return function () {
- var e,
- t = s_(n);
- return e = a ? (e = s_(this).constructor, Reflect.construct(t, arguments, e)) : t.apply(this, arguments),
- t = this,
- !(e = e) || 'object' !== Qv(e) && 'function' != typeof e ? i_(t) : e
- }
- }
- function i_(e) {
- if (void 0 === e) throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called');
- return e
- }
- function s_(e) {
- return (s_ = Object.setPrototypeOf ? Object.getPrototypeOf : function (e) {
- return e.__proto__ || Object.getPrototypeOf(e)
- }) (e)
- }
- function l_(t, e) {
- var n,
- a = Object.keys(t);
- return Object.getOwnPropertySymbols && (n = Object.getOwnPropertySymbols(t), e && (n = n.filter(function (e) {
- return Object.getOwnPropertyDescriptor(t, e).enumerable
- })), a.push.apply(a, n)),
- a
- }
- function c_(t) {
- for (var e = 1; e < arguments.length; e++) {
- var n = null != arguments[e] ? arguments[e] : {
- };
- e % 2 ? l_(Object(n), !0).forEach(function (e) {
- u_(t, e, n[e])
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(n)) : l_(Object(n)).forEach(function (e) {
- Object.defineProperty(t, e, Object.getOwnPropertyDescriptor(n, e))
- })
- }
- return t
- }
- function u_(e, t, n) {
- return t in e ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n,
- e
- }
- var p_ = function (e) {
- return e.type && e.filter && e.action && Dn[e.type][e.filter] && jn[e.action] && jn[e.action].present && !e.isUpsell
- },
- d_ = function (n, a, r) {
- return {
- rule_id: n.isNew ? void 0 : n.id,
- status: 'enabled' === a ? {
- before: n.enabled ? 'on' : 'off',
- after: n.enabled ? 'off' : 'on'
- }
- : n.enabled ? 'on' : 'off',
- rule: [
- 'type',
- 'filter',
- 'action'
- ].reduce(function (e, t) {
- return c_(c_({
- }, e), {
- }, u_({
- }, t, a === t ? {
- before: n[t],
- after: r
- }
- : n[t]))
- }, {
- })
- }
- },
- m_ = function () {
- a_(o, A);
- var r = o_(o);
- function o() {
- var a;
- e_(this, o);
- for (var e = arguments.length, t = Array(e), n = 0; n < e; n++) t[n] = arguments[n];
- return u_(i_(a = r.call.apply(r, [
- this
- ].concat(t))), 'toggleEnabled', function () {
- a.props.emitTrackingEvent({
- verb: 'update',
- object_type: 'rule',
- object_id: a.props.isNew ? void 0 : a.props.id,
- adjective: a.props.enabled ? 'disable' : 'enable',
- extra_data: JSON.stringify(d_(a.props, 'enabled', !a.props.enabled))
- }),
- a.props.onChange({
- enabled: !a.props.enabled
- })
- }),
- u_(i_(a), 'toggleExpanded', function (e) {
- a.props.type && a.props.filter && (~e.target.className.indexOf('expandable') || ~e.target.className.indexOf('row__header')) && (a.props.isExpanded || a.props.emitTrackingEvent({
- verb: 'click',
- object_type: 'area',
- area: 'card',
- extra_data: JSON.stringify({
- rule_id: a.props.isNew ? void 0 : a.props.id,
- comments_affected_history: a.props.moderationHistory
- })
- }), a.props.toggleExpanded())
- }),
- u_(i_(a), 'trackModerateFilterClick', function (e) {
- a.props.emitTrackingEvent({
- verb: 'click',
- object_type: 'link',
- object_id: e.target.href,
- area: 'card',
- extra_data: JSON.stringify({
- rule_id: a.props.isNew ? void 0 : a.props.id,
- comments_affected_history: a.props.moderationHistory
- })
- })
- }),
- u_(i_(a), 'onChange', function (e, t) {
- var n = d_(a.props, e, t.target.value);
- a.props.emitTrackingEvent({
- verb: 'update',
- object_type: 'rule',
- object_id: a.props.isNew ? void 0 : a.props.id,
- adjective: e,
- extra_data: JSON.stringify(c_(c_({
- }, n), {
- }, {
- rule: c_(c_({
- }, n.rule), {
- }, {
- filter: 'type' === e ? '' : n.rule.filter
- })
- }))
- });
- t = u_({
- type: a.props.type,
- filter: 'type' === e ? '' : a.props.filter,
- severity: a.props.severity,
- action: a.props.action
- }, e, t.target.value);
- t.type && t.filter && t.action || (t.enabled = !1),
- a.props.onChange(t)
- }),
- u_(i_(a), 'getTypeOptions', function () {
- var e = Tn.filter(function (t) {
- return t === a.props.type || Object.keys(Dn[t]).some(function (e) {
- return !(a.props.existingRules[t] || {
- }) [e]
- })
- }).map(function (e) {
- return {
- key: e,
- value: e,
- label: e
- }
- });
- return e.unshift({
- key: 'default',
- value: '',
- label: 'Select type'
- }),
- e
- }),
- u_(i_(a), 'getFilterOptions', function () {
- var e = {
- key: 'default',
- value: '',
- label: 'Select filter'
- };
- if (!a.props.type) return [e];
- var t = Object.keys(Dn[a.props.type]).filter(function (e) {
- e = (a.props.existingRules[a.props.type] || {
- }) [e];
- return !e || e === a.props.id
- }).map(function (e) {
- var t = Dn[a.props.type][e];
- return {
- key: e,
- value: e,
- label: t.title,
- icon: a.props.limitedModRules && t.requiresFeature ? 'upgrade-arrow-pro' : ''
- }
- });
- return t.unshift(e),
- t
- }),
- u_(i_(a), 'getActionOptions', function () {
- var e = Object.keys(jn).filter(function (e) {
- return jn[e].present
- }).map(function (e) {
- return {
- key: e,
- value: e,
- label: jn[e].present
- }
- });
- return e.unshift({
- key: 'default',
- value: '',
- label: 'Select action'
- }),
- e
- }),
- u_(i_(a), 'getSeverityOptions', function () {
- return Object.entries(Un[a.props.filter] || {
- }).map(function (e) {
- var t = $v(e, 2),
- e = t[0];
- return {
- key: e,
- value: '' + e,
- label: t[1]
- }
- })
- }),
- u_(i_(a), 'isSeverityVisible', function () {
- return 1 < a.getSeverityOptions().length
- }),
- u_(i_(a), 'updateIndex', function (e, t) {
- t.stopPropagation(),
- a.props.updateIndex(e)
- }),
- u_(i_(a), 'unhighlight', function () {
- a.props.onChange({
- highlighted: !1
- })
- }),
- a
- }
- return n_(o, [
- {
- key: 'render',
- value: function () {
- var e,
- n = this,
- t = Object.keys(this.props.moderationHistory || {
- }).reduce(function (e, t) {
- return e + n.props.moderationHistory[t]
- }, 0),
- a = Object.keys(this.props.moderationHistory || {
- }).map(function (e) {
- return {
- action: e,
- count: n.props.moderationHistory[e],
- percent: t ? Math.floor(n.props.moderationHistory[e] / t * 100) : 0
- }
- }).sort(function (e, t) {
- var n = t.count - e.count;
- return n || (e.action < t.action ? - 1 : t.action < e.action ? 1 : 0)
- }),
- r = Object.keys(this.props.existingRules).reduce(function (e, t) {
- return e + Object.keys(n.props.existingRules[t]).reduce(function (e) {
- return e + 1
- }, 0)
- }, 0);
- return this.props.highlighted && (e = function () {
- return n.refs.rule.addEventListener('animationend', n.unhighlight)
- }, this.refs.rule ? e() : setTimeout(e, 0)),
- C.a.createElement('div', {
- className: 'rule row'.concat(this.props.highlighted ? ' highlight' : '').concat(this.props.moderationHistory ? ' expandable' : '').concat(this.props.isExpanded ? ' expanded' : ''),
- ref: 'rule',
- onClick: function (e) {
- return n.toggleExpanded(e)
- }
- }, C.a.createElement('div', {
- className: 'row__header'.concat(this.props.isDirty ? ' settings__highlighted' : '')
- }, C.a.createElement('div', {
- className: 'align row__header-left text-gray spacing-bottom'
- }, C.a.createElement('span', {
- className: 'priority-arrows align align--column align--around spacing-right'
- }, C.a.createElement('span', {
- className: 'icon icon-arrow-2'.concat(this.props.index ? '' : ' disabled'),
- onClick: this.updateIndex.bind(this, - 1)
- }), C.a.createElement('span', {
- className: 'icon icon-arrow'.concat(this.props.index === r - 1 ? ' disabled' : ''),
- onClick: this.updateIndex.bind(this, 1)
- })), C.a.createElement('span', {
- className: 'align align--middle align--wrap'
- }, C.a.createElement('span', {
- className: 'type-wrapper align--wrap'
- }, 'If', C.a.createElement(Mf, {
- name: 'type',
- className: 'select__type'.concat(this.props.highlightInvalid && !this.props.type ? ' is-error' : ''),
- onChange: this.onChange.bind(this, 'type'),
- value: this.props.type || '',
- inline: !0,
- options: this.getTypeOptions()
- })), C.a.createElement('span', {
- className: 'filter-wrapper align--wrap'
- }, C.a.createElement(Mf, {
- name: 'filter',
- className: 'select__filter'.concat(this.props.highlightInvalid && !this.props.filter ? ' is-error' : ''),
- onChange: this.onChange.bind(this, 'filter'),
- value: this.props.filter || '',
- inline: !0,
- options: this.getFilterOptions()
- })), C.a.createElement('span', {
- className: 'action-wrapper align--wrap '.concat(this.isSeverityVisible() ? '' : 'hidden')
- }, 'with severity', C.a.createElement(Mf, {
- name: 'severity',
- className: 'select__severity'.concat(this.props.highlightInvalid && !this.props.severity ? ' is-error' : ''),
- onChange: this.onChange.bind(this, 'severity'),
- value: '' + (this.props.severity || ''),
- inline: !0,
- options: this.getSeverityOptions()
- })), C.a.createElement('span', {
- className: 'action-wrapper align--wrap'
- }, 'then', C.a.createElement(Mf, {
- name: 'action',
- className: 'select__action'.concat(this.props.highlightInvalid && !this.props.action ? ' is-error' : ''),
- onChange: this.onChange.bind(this, 'action'),
- value: this.props.action || '',
- inline: !0,
- options: this.getActionOptions()
- })))), C.a.createElement('div', {
- className: 'align row__header-right'
- }, C.a.createElement(Yv.a, {
- id: 'toggle_'.concat(this.props.id),
- isDisabled: !p_(this.props),
- isChecked: this.props.enabled,
- onChange: this.toggleEnabled,
- onClick: An
- }), C.a.createElement('button', {
- className: 'button button-outline button-small',
- onClick: this.props.removeRule
- }, 'Remove'))), this.props.type && this.props.filter ? C.a.createElement('div', {
- className: 'collapsible moderation-history'
- }, C.a.createElement('p', {
- className: 'spacing-bottom'
- }, Dn[this.props.type][this.props.filter].description), this.props.moderationHistory ? C.a.createElement('section', null, C.a.createElement('p', {
- className: 'spacing-bottom'
- }, 'In the past 30 days, your site had '.concat(t, ' total ').concat(this.props.type, 's filtered by ').concat('user' === this.props.type ? 'author ' : ''), C.a.createElement('strong', null, Dn[this.props.type][this.props.filter].title), ' and here is how you moderated them:'), C.a.createElement('div', {
- className: 'actions-graph spacing-bottom'
- }, a.map(function (e) {
- return jn[e.action] && jn[e.action].past ? C.a.createElement('div', {
- key: e.action,
- className: 'actions-graph__item'
- }, C.a.createElement('div', {
- className: 'action-graph__label'
- }, jn[e.action].past), C.a.createElement('div', {
- className: 'bar-container'
- }, C.a.createElement('div', {
- className: 'bar',
- style: {
- width: ''.concat(0.8 * e.percent, '%')
- }
- }), e.count, ' ('.concat(e.percent, '%)'))) : null
- })), Dn[this.props.type][this.props.filter].moderationFilter ? C.a.createElement('div', null, C.a.createElement(v.Link, {
- to: 'moderate/all/filter/'.concat(Dn[this.props.type][this.props.filter].moderationFilter.id, '/'),
- onClick: this.trackModerateFilterClick
- }, 'View comments on your site filtered by ', C.a.createElement('strong', null, Dn[this.props.type][this.props.filter].moderationFilter.name))) : null) : C.a.createElement(Ji, null)) : null)
- }
- }
- ]),
- o
- }();
- u_(m_, 'propTypes', c_(c_({
- }, qn), {
- }, {
- onChange: b.a.func.isRequired,
- toggleExpanded: b.a.func.isRequired,
- isExpanded: b.a.bool,
- updateIndex: b.a.func.isRequired,
- index: b.a.number.isRequired,
- existingRules: b.a.shape(Tn.reduce(function (e, t) {
- return e[t] = b.a.shape(Object.keys(Dn[t]).reduce(function (e, t) {
- return e[t] = b.a.oneOfType([b.a.string,
- b.a.number]),
- e
- }, {
- })),
- e
- }, {
- })),
- limitedModRules: b.a.bool,
- moderationHistory: b.a.shape(Fn),
- highlighted: b.a.bool.isRequired,
- highlightInvalid: b.a.bool,
- emitTrackingEvent: b.a.func.isRequired
- }));
- Sn = function () {
- a_(r, A);
- var a = o_(r);
- function r() {
- var l;
- e_(this, r);
- for (var e = arguments.length, t = Array(e), n = 0; n < e; n++) t[n] = arguments[n];
- return u_(i_(l = a.call.apply(a, [
- this
- ].concat(t))), 'state', {
- rules: l.props.rules,
- expandedRuleId: l.props.params.rule ? parseInt(l.props.params.rule, 10) : null,
- highlightedRuleId: null,
- invalidRulesErr: !1,
- isDirty: !1,
- rulesAreSaved: l.props.rulesAreSaved
- }),
- u_(i_(l), 'trackSave', function (e) {
- (e = e || l.props).emitTrackingEvent({
- verb: 'click',
- object_type: 'button',
- object_id: 'save',
- extra_data: {
- rules: e.rules.map(function (e) {
- return e.id
- })
- }
- }),
- e.emitTrackingEvent({
- verb: 'view',
- object_type: 'page',
- object_id: ho.getAdminPath(),
- adjective: e.rulesAreSaved ? 'valid_save' : 'invalid_save'
- })
- }),
- u_(i_(l), 'addRule', function () {
- l.props.emitTrackingEvent({
- verb: 'create',
- object_type: 'rule'
- });
- var t = 'new'.concat(Math.random());
- l.setState(function (e) {
- return {
- rules: [
- ].concat(Jv(e.rules), [
- {
- id: t,
- type: '',
- filter: '',
- severity: '',
- action: '',
- enabled: !1,
- isNew: !0,
- isInvalid: !0,
- isDirty: !0
- }
- ]),
- highlightedRuleId: t
- }
- }, function () {
- l.props.onRuleChange(l.state.rules)
- })
- }),
- u_(i_(l), 'removeRule', function (a) {
- l.setState(function (e) {
- var t = e.rules.findIndex(function (e) {
- return e.id === a
- });
- if (t < 0) return l.state;
- var n = e.rules[t];
- l.props.emitTrackingEvent({
- verb: 'delete',
- object_type: 'rule',
- object_id: n.isNew ? void 0 : a,
- extra_data: JSON.stringify(d_(n))
- });
- e = e.rules.slice(0);
- return n.isNew ? e.splice(t, 1) : e[t].isDeleted = e[t].isDirty = !0,
- {
- rules: e,
- invalidRulesErr: e.some(function (e) {
- return !e.isDeleted && !p_(e)
- })
- }
- }, function () {
- l.props.onRuleChange(l.state.rules, l.state.invalidRulesErr)
- })
- }),
- u_(i_(l), 'handleRuleChange', function (i, s) {
- l.setState(function (e, t) {
- var n = e.rules.findIndex(function (e) {
- return e.id === i
- });
- if (n < 0) return e;
- var a = t.syncedRules.findIndex(function (e) {
- return e.id === i
- }),
- r = a < 0 || Object.keys(s).some(function (e) {
- return t.syncedRules[a][e] !== s[e]
- }),
- o = c_(c_(c_({
- }, e.rules[n]), s), {
- }, {
- isDirty: r
- });
- o.isUpsell = l.props.limitedModRules && Dn[o.type] && (Dn[o.type][o.filter] || {
- }).requiresFeature,
- o.isInvalid = !p_(o);
- r = [
- ].concat(Jv(e.rules.slice(0, n)), [
- o
- ], Jv(e.rules.slice(n + 1))),
- o = o.filter !== e.rules[n].filter && o.filter ? i : o.filter || e.expandedRuleId !== i ? e.expandedRuleId : null;
- return {
- rules: r,
- expandedRuleId: o,
- invalidRulesErr: e.invalidRulesErr && r.some(function (e) {
- return !e.isDeleted && !p_(e)
- })
- }
- }, function () {
- l.props.onRuleChange(l.state.rules, l.state.invalidRulesErr)
- })
- }),
- u_(i_(l), 'toggleRuleExpanded', function (t) {
- l.setState(function (e) {
- return {
- expandedRuleId: e.expandedRuleId === t ? null : t
- }
- })
- }),
- u_(i_(l), 'updateRuleIndex', function (r, o) {
- l.setState(function (e) {
- for (var t = e.rules.findIndex(function (e) {
- return e.id === r
- }), n = t + o; 0 <= n && n < e.rules.length && e.rules[n].isDeleted; n += o);
- if (t < 0 || n < 0 || e.rules.length <= n) return l.prevState;
- var a = e.rules.slice();
- a.splice(t, 1),
- a.splice(n, 0, e.rules[t]),
- a[t].isDirty = a[n].isDirty = !0;
- t = e.highlightedRuleId === r;
- return t && setTimeout(function () {
- l.setState({
- highlightedRuleId: r
- })
- }, 50),
- {
- rules: a,
- highlightedRuleId: t ? null : r
- }
- })
- }),
- u_(i_(l), 'saveRules', function () {
- if (l.state.rules.some(function (e) {
- return !e.isDeleted && !p_(e)
- })) return l.trackSave(),
- void l.setState({
- invalidRulesErr: !0,
- rulesAreSaved: !1
- });
- var n = [
- ],
- a = [
- ],
- r = [
- ];
- l.state.rules.forEach(function (e, t) {
- e.isDeleted ? r.push(e.id) : e.isNew ? n.push({
- filterName: e.filter,
- severity: e.severity,
- action: e.action,
- enabled: e.enabled,
- order: t
- }) : e.isDirty && a.push({
- rule: e.id,
- filterName: e.filter,
- severity: e.severity,
- action: e.action,
- enabled: e.enabled,
- order: t
- })
- }),
- l.props.saveRules({
- data: {
- newRules: JSON.stringify(n),
- updatedRules: JSON.stringify(a),
- deletedRules: r
- }
- })
- }),
- l
- }
- return n_(r, [
- {
- key: 'componentDidMount',
- value: function () {
- this.props.history.setRouteLeaveHook(this.props.route, this.confirmNavigationIfUnsaved),
- window.onbeforeunload = this.confirmNavigationIfUnsaved
- }
- },
- {
- key: 'componentWillUnmount',
- value: function () {
- window.onbeforeunload = null
- }
- },
- {
- key: 'componentWillReceiveProps',
- value: function (e) {
- var t = {
- };
- this.props.rules !== e.rules && (t.rules = e.rules.map(function (e) {
- return e.isInvalid = !p_(e),
- e
- })),
- this.props.rulesAreSaved !== e.rulesAreSaved && (t.rulesAreSaved = e.rulesAreSaved),
- this.props.params.expandedRuleId !== e.params.expandedRuleId && (t.expandedRuleId = e.params.expandedRuleId),
- this.state.invalidRulesErr !== e.invalidRulesErr && (t.invalidRulesErr = e.invalidRulesErr),
- Object.keys(t).length && this.setState(t),
- this.props.rulesAreSaving && !e.rulesAreSaving && this.trackSave(e)
- }
- },
- {
- key: 'render',
- value: function () {
- var n = this,
- e = this.state.rules.filter(function (e) {
- return !e.isDeleted
- }),
- a = e.reduce(function (e, t) {
- return e[t.type] = e[t.type] || {
- },
- e[t.type][t.filter] = t.id,
- e
- }, {
- }),
- e = e.length ? e.map(function (e, t) {
- return C.a.createElement(m_, Kv({
- }, e, {
- key: e.id,
- severity: e.severity,
- onChange: n.handleRuleChange.bind(n, e.id),
- toggleExpanded: n.toggleRuleExpanded.bind(n, e.id),
- updateIndex: n.updateRuleIndex.bind(n, e.id),
- removeRule: n.removeRule.bind(n, e.id),
- existingRules: a,
- isExpanded: n.state.expandedRuleId === e.id,
- index: t,
- limitedModRules: n.props.limitedModRules,
- moderationHistory: e.filter ? n.props.moderationHistory && n.props.moderationHistory[e.filter] : {
- },
- emitTrackingEvent: n.props.emitTrackingEvent,
- highlighted: n.state.highlightedRuleId === e.id,
- highlightInvalid: n.state.invalidRulesErr
- }))
- }) : this.props.rulesAreFetching ? C.a.createElement(Ji, null) : C.a.createElement('div', {
- className: 'align align--middle padding-quad padding-top padding-bottom'
- }, C.a.createElement('img', {
- className: 'img-responsive',
- src: '//c.disquscdn.com/next/current/publisher-admin/assets/img/pam-confused.svg'
- }), C.a.createElement('div', {
- className: 'spacing-top padding-top-double'
- }, C.a.createElement('h2', {
- className: 'text-gray-dark text-large spacing-bottom-small'
- }, 'You don\'t have any moderation rules yet. Click the blue Add Rule button to begin!'), C.a.createElement('p', {
- className: 'text-gray'
- }, 'Want to learn about moderation rules? Check out our ', C.a.createElement('a', {
- href: Pn.moderationRules
- }, 'Knowledge Base Article.'))));
- return C.a.createElement('div', {
- className: 'moderation-rules'
- }, C.a.createElement('div', {
- className: 'rows__container'
- }, this.state.rules.some(function (e) {
- return e.isUpsell
- }) ? C.a.createElement(ch, {
- headline: 'Looking for more moderation rules?',
- promotionalPlan: 'Disqus Pro',
- planDetailsUrl: 'https://disqus.com/pricing/',
- upsellMessageLeft: 'Upgrade to',
- upsellMessageRight: ' to unlock the full potential of the moderation rules.',
- className: 'spacing-bottom-small',
- selection: this.props.selection,
- emitTrackingEvent: this.props.emitTrackingEvent
- }) : null, e, C.a.createElement('div', {
- className: 'add-row align'
- }, C.a.createElement('button', {
- className: 'button button-fill--brand button-small',
- onClick: this.addRule
- }, '+ Add rule'))))
- }
- }
- ]),
- r
- }();
- u_(Sn, 'propTypes', {
- history: b.a.shape({
- setRouteLeaveHook: b.a.func.isRequired
- }).isRequired,
- route: b.a.object.isRequired,
- selection: ht.isRequired,
- params: b.a.shape({
- rule: b.a.string
- }),
- rules: b.a.arrayOf(b.a.shape(qn)),
- syncedRules: b.a.arrayOf(b.a.shape(qn)),
- limitedModRules: b.a.bool,
- rulesAreFetching: b.a.bool,
- rulesAreSaving: b.a.bool,
- rulesAreSaved: b.a.bool,
- rulesSaveFailed: b.a.bool,
- saveRules: b.a.func.isRequired,
- onRuleChange: b.a.func.isRequired,
- moderationHistory: b.a.shape(Ln),
- emitTrackingEvent: b.a.func.isRequired
- });
- var f_ = Sn;
- function h_(e) {
- return (h_ = 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator ? function (e) {
- return typeof e
- }
- : function (e) {
- return e && 'function' == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? 'symbol' : typeof e
- }) (e)
- }
- function g_(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) {
- var a,
- r,
- o = [
- ],
- i = !0,
- s = !1;
- try {
- for (n = n.call(e); !(i = (a = n.next()).done) && (o.push(a.value), !t || o.length !== t); i = !0);
- } catch (e) {
- s = !0,
- r = e
- } finally {
- try {
- i || null == n.return || n.return()
- } finally {
- if (s) throw r
- }
- }
- return o
- }
- }(e, t) || function (e, t) {
- if (e) {
- if ('string' == typeof e) return y_(e, t);
- var n = Object.prototype.toString.call(e).slice(8, - 1);
- return 'Map' === (n = 'Object' === n && e.constructor ? e.constructor.name : n) || 'Set' === n ? Array.from(e) : 'Arguments' === n || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n) ? y_(e, t) : void 0
- }
- }(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 y_(e, t) {
- for (var n = 0, a = Array(t = null == t || e.length < t ? e.length : t); n < t; n++) a[n] = e[n];
- return a
- }
- function b_() {
- return (b_ = Object.assign || function (e) {
- for (var t = 1; t < arguments.length; t++) {
- var n,
- a = arguments[t];
- for (n in a) Object.prototype.hasOwnProperty.call(a, n) && (e[n] = a[n])
- }
- return e
- }).apply(this, arguments)
- }
- function v_(t, e) {
- var n,
- a = Object.keys(t);
- return Object.getOwnPropertySymbols && (n = Object.getOwnPropertySymbols(t), e && (n = n.filter(function (e) {
- return Object.getOwnPropertyDescriptor(t, e).enumerable
- })), a.push.apply(a, n)),
- a
- }
- function __(t) {
- for (var e = 1; e < arguments.length; e++) {
- var n = null != arguments[e] ? arguments[e] : {
- };
- e % 2 ? v_(Object(n), !0).forEach(function (e) {
- k_(t, e, n[e])
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(n)) : v_(Object(n)).forEach(function (e) {
- Object.defineProperty(t, e, Object.getOwnPropertyDescriptor(n, e))
- })
- }
- return t
- }
- function E_(e, t) {
- for (var n = 0; n < t.length; n++) {
- var a = t[n];
- a.enumerable = a.enumerable || !1,
- a.configurable = !0,
- 'value' in a && (a.writable = !0),
- Object.defineProperty(e, a.key, a)
- }
- }
- function O_(e, t) {
- return (O_ = Object.setPrototypeOf || function (e, t) {
- return e.__proto__ = t,
- e
- }) (e, t)
- }
- function S_(n) {
- var a = function () {
- if ('undefined' == typeof Reflect || !Reflect.construct) return !1;
- if (Reflect.construct.sham) return !1;
- if ('function' == typeof Proxy) return !0;
- try {
- return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [
- ], function () {
- })),
- !0
- } catch (e) {
- return !1
- }
- }();
- return function () {
- var e,
- t = P_(n);
- return e = a ? (e = P_(this).constructor, Reflect.construct(t, arguments, e)) : t.apply(this, arguments),
- t = this,
- !(e = e) || 'object' !== h_(e) && 'function' != typeof e ? w_(t) : e
- }
- }
- function w_(e) {
- if (void 0 === e) throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called');
- return e
- }
- function P_(e) {
- return (P_ = Object.setPrototypeOf ? Object.getPrototypeOf : function (e) {
- return e.__proto__ || Object.getPrototypeOf(e)
- }) (e)
- }
- function k_(e, t, n) {
- return t in e ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n,
- e
- }
- go = function () {
- !function (e, t) {
- if ('function' != typeof t && null !== t) throw new TypeError('Super expression must either be null or a function');
- e.prototype = Object.create(t && t.prototype, {
- constructor: {
- value: e,
- writable: !0,
- configurable: !0
- }
- }),
- t && O_(e, t)
- }(r, A);
- var e,
- t,
- n,
- a = S_(r);
- function r() {
- var o;
- !function (e, t) {
- if (!(e instanceof t)) throw new TypeError('Cannot call a class as a function')
- }(this, r);
- for (var e = arguments.length, t = Array(e), n = 0; n < e; n++) t[n] = arguments[n];
- return k_(w_(o = a.call.apply(a, [
- this
- ].concat(t))), 'state', __(__({
- }, r.getEditableFieldsFromForum(o.props.forumDetails)), {
- }, {
- rules: o.props.rules,
- selectedProfile: null,
- profilesExpanded: !1,
- rulesChanged: !1,
- invalidRulesErr: !1,
- invalidFields: {
- },
- savedFields: r.getEditableFieldsFromForum(o.props.forumDetails)
- })),
- k_(w_(o), 'confirmNavigationIfUnsaved', function () {
- if (o.hasUnsavedChanges()) return 'You have unsaved changes. Do you want to leave this page?'
- }),
- k_(w_(o), 'handleInputChange', function (t, e, n) {
- var a = e.target;
- void 0 === n && (n = a.value, 'checkbox' === a.type ? n = a.checked : 'radio' === a.type ? n = 'true' === n : 'text' === a.type || 'boolean' == typeof n || '' === n || isNaN(n) || (n = parseInt(n, 10))),
- o.setState(function (e) {
- e = __(__({
- }, e), {
- }, k_({
- }, t, n));
- return e.invalidFields[t] = !o.validateField(a),
- e
- })
- }),
- k_(w_(o), 'hasFieldChanged', function (e) {
- return o.state[e] !== o.state.savedFields[e] && !(null === o.state.savedFields[e] && '' === o.state[e])
- }),
- k_(w_(o), 'hasUnsavedChanges', function () {
- return Object.keys(o.state.savedFields).some(function (e) {
- return o.hasFieldChanged(e)
- })
- }),
- k_(w_(o), 'onRuleChange', function (e, t) {
- var n = e.some(function (e) {
- return e.isDirty
- });
- o.setState({
- rules: e,
- invalidRulesErr: t,
- rulesChanged: n
- })
- }),
- k_(w_(o), 'getUpdatedRules', function (e) {
- var a = b_({
- }, e.rules),
- n = o.state.rules.map(function (e) {
- if (a[e.filter]) {
- var t = a[e.filter];
- return delete a[e.filter],
- __(__(__({
- }, e), {
- }, {
- action: t.action
- }, t.severity ? {
- severity: '' + t.severity
- }
- : {
- }), {
- }, {
- isDirty: (n = e).action !== (t = t).action || (!(!t.severity || '' + n.severity == '' + t.severity) || void 0),
- enabled: !0,
- isDeleted: !1,
- isInvalid: !1
- })
- }
- var n;
- return e
- }),
- e = Object.values(a).map(function (e, t) {
- return __(__({
- id: 'new'.concat(Math.random()),
- type: e.type,
- filter: e.filter
- }, e.severity ? {
- severity: '' + e.severity
- }
- : {
- }), {
- }, {
- action: e.action,
- order: n.length + t,
- enabled: !0,
- isNew: !0,
- isDirty: !0,
- isInvalid: !1
- })
- });
- return n.concat(e)
- }),
- k_(w_(o), 'getRuleData', function () {
- var n = [
- ],
- a = [
- ],
- r = [
- ];
- return o.state.rules.forEach(function (e, t) {
- e.isDeleted ? r.push(e.id) : e.isNew ? n.push(__({
- filterName: e.filter,
- action: e.action,
- enabled: e.enabled,
- order: t
- }, e.severity ? {
- severity: e.severity
- }
- : {
- })) : e.isDirty && a.push(__(__({
- filterName: e.filter
- }, e.severity ? {
- severity: e.severity
- }
- : {
- }), {
- }, {
- action: e.action,
- enabled: e.enabled,
- order: t,
- rule: e.id
- }))
- }),
- {
- newRules: JSON.stringify(n),
- updatedRules: JSON.stringify(a),
- deletedRules: r
- }
- }),
- k_(w_(o), 'handleSaveChanges', function () {
- var e = {
- validateAllPosts: o.state.validateAllPosts ? 1 : 0,
- unapproveLinks: o.state.unapproveLinks ? 1 : 0,
- mediaembedEnabled: o.state.mediaembedEnabled ? 1 : 0,
- gifPickerEnabled: o.state.gifPickerEnabled ? 1 : 0,
- flaggingNotifications: o.state.flaggingNotifications ? 1 : 0,
- flaggingEnabled: o.state.flaggingEnabled ? 1 : 0,
- flagThreshold: o.state.flagThreshold,
- daysThreadAlive: o.state.daysThreadAlive,
- allowAnonPost: o.state.allowAnonPost ? 1 : 0
- };
- o.hasFeature('unapproveNewUsers') && yo.a.isFeatureActive('new_user_premoderation', {
- forum: o.props.selection.forum.name
- }) && (e.unapproveNewUsersEnabled = o.state.unapproveNewUsersEnabled ? 1 : 0, e.daysUnapproveNewUsers = o.state.daysUnapproveNewUsers || Sf.default),
- o.state.rules.some(function (e) {
- return !e.isDeleted && e.isInvalid
- }) ? o.setState({
- invalidRulesErr: !0,
- rulesAreSaved: !1
- }) : o.props.forumUpdateOnSave(e).done(function () {
- o.setState(function (e) {
- return {
- savedFields: {
- validateAllPosts: e.validateAllPosts,
- unapproveLinks: e.unapproveLinks,
- mediaembedEnabled: e.mediaembedEnabled,
- gifPickerEnabled: e.gifPickerEnabled,
- flaggingNotifications: e.flaggingNotifications,
- flaggingEnabled: e.flaggingEnabled,
- flagThreshold: e.flagThreshold,
- daysThreadAlive: e.daysThreadAlive,
- allowAnonPost: e.allowAnonPost,
- unapproveNewUsersEnabled: e.unapproveNewUsersEnabled,
- daysUnapproveNewUsers: e.daysUnapproveNewUsers
- }
- }
- })
- }).then(o.props.saveRules({
- data: o.getRuleData()
- }))
- }),
- k_(w_(o), 'toggleModerationProfiles', function () {
- o.setState(function (e) {
- return {
- profilesExpanded: !e.profilesExpanded
- }
- })
- }),
- k_(w_(o), 'handleProfileSelect', function (t) {
- var e = wf.filter(function (e) {
- return e.name === t.currentTarget.dataset.value
- }) [0] || null,
- n = {
- };
- e && (e.settings.forEach(function (e) {
- n[e.key] = e.value
- }), a = Object.entries(e.rules), e.rules = Object.fromEntries(a.filter(function (e) {
- e = g_(e, 2);
- return !e[1].isHiveRule || o.hasFeature('allModRules') || yo.a.isFeatureActive('thehive', {
- forum: o.props.forumDetails.id
- })
- })));
- var a = o.getUpdatedRules(e);
- o.setState(__(__({
- }, n), {
- }, {
- rules: a,
- rulesChanged: a.some(function (e) {
- return e.isDirty
- }),
- selectedProfile: e.name
- }))
- }),
- k_(w_(o), 'validateField', function (e) {
- if ('number' !== e.type) return !0;
- var t = parseInt(e.min, 10),
- n = parseInt(e.max, 10);
- return (isNaN(t) || t <= e.value) && (isNaN(n) || e.value <= n)
- }),
- k_(w_(o), 'hasInvalidFields', function () {
- var e = Object.keys(o.state.invalidFields).some(function (e) {
- return !0 === o.state.invalidFields[e]
- }),
- t = o.state.rules.some(function (e) {
- return e.isUpsell
- });
- return e || t
- }),
- k_(w_(o), 'getInputId', function (e) {
- return ''.concat(o.constructor.displayName, '_').concat(e)
- }),
- k_(w_(o), 'hasFeature', function (e) {
- return !!(o.props.forumDetails && o.props.forumDetails.features && o.props.forumDetails.features[e])
- }),
- o
- }
- return e = r,
- (t = [
- {
- key: 'componentDidMount',
- value: function () {
- this.props.history.setRouteLeaveHook(this.props.route, this.confirmNavigationIfUnsaved),
- this.props.fetchForumDetails(),
- this.props.fetchRules(),
- this.props.fetchModerationHistory()
- }
- },
- {
- key: 'componentWillReceiveProps',
- value: function (e) {
- var t = {
- },
- n = r.getEditableFieldsFromForum(e.forumDetails);
- !this.props.forumDetails && e.forumDetails && (t = __(__({
- }, n), {
- }, {
- savedFields: n
- })),
- this.props.rules !== e.rules && (t.rules = e.rules),
- this.props.rulesAreSaving !== e.rulesAreSaving && (t.rulesAreSaving = e.rulesAreSaving),
- this.props.rulesAreSaved !== e.rulesAreSaved && (t.rulesAreSaved = e.rulesAreSaved, t.rulesChanged = !1),
- this.setState(t)
- }
- },
- {
- key: 'render',
- value: function () {
- var e,
- t = this;
- if (this.props.selection.organization && this.props.selection.organization.pollsOnly) return C.a.createElement(Cm, {
- isPolls: !1,
- organization: this.props.selection.organization
- });
- if (this.props.forumDetailsIsFetching) return C.a.createElement(Ji, null);
- if (this.props.forumDetailsError) return C.a.createElement('div', {
- className: 'content__wrap spacing-bottom-double'
- }, C.a.createElement(Ki, {
- message: this.props.forumDetailsError,
- alertType: 'error'
- }));
- this.state.invalidRulesErr && (e = 'Your changes did not save because you have one or more rules missing a selection. Fix the highlighted fields above and try again.');
- var n = this.props.organizations[this.props.selection.forum.organization],
- a = !this.hasFeature('allModRules'),
- r = this.hasFeature('unapproveNewUsers');
- return C.a.createElement('div', null, C.a.createElement('div', {
- className: 'content__wrap spacing-bottom-double'
- }, C.a.createElement('header', {
- className: 'settings__header'
- }, C.a.createElement('h2', {
- className: 'text-larger text-gray-darker spacing-bottom-small'
- }, 'Comment & Moderation Settings'), C.a.createElement('p', {
- className: 'text-gray'
- }, 'Configure comments and setup rules to automatically moderate your community.', C.a.createElement('br', null), C.a.createElement('button', {
- className: 'text-button text-base',
- onClick: this.toggleModerationProfiles
- }, this.state.profilesExpanded ? 'Hide moderation profiles' : 'Choose a moderation profile', ' »'))), C.a.createElement('section', {
- className: 'settings__content'
- }, this.props.rulesSaveError ? C.a.createElement(Ki, {
- message: this.props.rulesSaveError,
- alertType: 'error'
- }) : null, C.a.createElement('section', {
- className: 'moderation-profile-section border-bottom'.concat(this.state.profilesExpanded ? ' expanded padding-bottom-double spacing-bottom' : ' collapsed')
- }, C.a.createElement('header', {
- className: 'spacing-bottom'
- }, C.a.createElement('h2', {
- className: 'text-gray-dark text-large spacing-bottom-small'
- }, 'Moderation Profiles'), C.a.createElement('p', {
- className: 'text-gray text-medium'
- }, 'Select the profile that best fits your moderation style and the community you would like to foster. Below, you can customize your selection and modify all the individual settings to your liking.')), wf.map(function (e) {
- return C.a.createElement(Ey, {
- key: e.name,
- profile: e,
- showDescription: !0,
- showSettings: !1,
- isSelected: t.state.selectedProfile === e.name,
- handleClick: t.handleProfileSelect,
- forumId: t.props.forumDetails && t.props.forumDetails.id
- })
- })), this.props.forumUpdateError ? C.a.createElement(Ki, {
- message: this.props.forumUpdateError,
- onRequestClose: this.props.forumUpdateOnDismissError,
- alertType: 'error'
- }) : null, C.a.createElement('section', {
- className: 'moderation-rule-section spacing-bottom border-bottom'
- }, C.a.createElement('header', {
- className: 'spacing-bottom'
- }, C.a.createElement('h2', {
- className: 'text-gray-dark text-large spacing-bottom-small'
- }, 'Moderation Rules'), C.a.createElement('p', {
- className: 'text-gray text-medium'
- }, 'Automatically moderate comments by defining a rule and assigning an action to a filter. Rules at the top take highest priority if a comment matches multiple conditions.')), C.a.createElement(f_, {
- history: this.props.history,
- route: this.props.route,
- selection: this.props.selection,
- params: this.props.params,
- rules: this.state.rules,
- syncedRules: this.props.rules,
- limitedModRules: a,
- saveRules: this.props.saveRules,
- rulesAreFetching: this.props.rulesAreFetching,
- rulesAreSaving: this.props.rulesAreSaving,
- rulesAreSaved: this.props.rulesAreSaved,
- rulesSaveFailed: this.props.rulesSaveFailed,
- onRuleChange: this.onRuleChange,
- invalidRulesErr: this.state.invalidRulesErr,
- moderationHistory: this.props.moderationHistory,
- emitTrackingEvent: this.props.emitTrackingEvent
- })), C.a.createElement('section', {
- className: 'moderation-setting-section spacing-bottom'
- }, C.a.createElement('header', {
- className: 'spacing-bottom'
- }, C.a.createElement('h2', {
- className: 'text-gray-dark text-large spacing-bottom-small'
- }, 'Moderation Settings')), C.a.createElement(kf, {
- label: 'Pre-moderation',
- blockAdditionalClass: '-fieldset__block--radio text-medium',
- tooltip: C.a.createElement(C.a.Fragment, null, C.a.createElement('strong', null, 'Note'), ': Registered users must now ', C.a.createElement('a', {
- href: Pn.verifyAccount
- }, 'verify'), ' their email address prior to posting a comment. Pre-moderation is always enabled for guest comments.'),
- shouldHighlight: this.hasFieldChanged('validateAllPosts') || r && this.hasFieldChanged('unapproveNewUsersEnabled') || r && this.hasFieldChanged('daysUnapproveNewUsers'),
- childIsInput: !0
- }, C.a.createElement('label', {
- className: 'fieldset__block--radio text-medium spacing-bottom-small'
- }, C.a.createElement('input', {
- name: this.getInputId('validateAllPosts'),
- type: 'radio',
- checked: !this.state.validateAllPosts && !this.state.unapproveNewUsersEnabled,
- value: !1,
- onChange: function (e) {
- t.handleInputChange('validateAllPosts', e),
- t.handleInputChange('unapproveNewUsersEnabled', e, !1)
- },
- readOnly: this.props.forumUpdateIsSaving,
- disabled: this.props.forumUpdateIsSaving
- }), C.a.createElement('strong', null, 'None'), ' — Comments don\'t need to be approved before they are published.'), yo.a.isFeatureActive('new_user_premoderation', {
- forum: this.props.selection.forum.name
- }) ? C.a.createElement('label', {
- className: 'fieldset__block--radio text-medium spacing-bottom-small'
- }, C.a.createElement('input', {
- name: this.getInputId('unapproveNewUsersEnabled'),
- type: 'radio',
- checked: !!this.state.unapproveNewUsersEnabled,
- value: !0,
- onChange: function (e) {
- t.handleInputChange('unapproveNewUsersEnabled', e),
- t.handleInputChange('validateAllPosts', e, !1)
- },
- readOnly: this.props.forumUpdateIsSaving || !r,
- disabled: this.props.forumUpdateIsSaving || !r
- }), r ? null : C.a.createElement(Ks, {
- emitEvent: function (e) {
- return t.props.emitTrackingEvent(__({
- area: 'unapprove_new_users'
- }, e))
- },
- organization: n,
- iconClass: 'spacing-right-small',
- height: 24
- }), C.a.createElement('strong', null, 'New Commenters'), ' — Commenters new to your forum will require approval for', C.a.createElement('input', {
- type: 'number',
- id: this.getInputId('daysUnapproveNewUsers'),
- min: Sf.min,
- max: Sf.max,
- value: this.state.daysUnapproveNewUsers || Sf.default,
- onChange: this.handleInputChange.bind(this, 'daysUnapproveNewUsers'),
- size: '2',
- className: 'input--textbox -text-small -inline spacing-left-small spacing-right-small',
- readOnly: this.props.forumUpdateIsSaving || !r,
- disabled: this.props.forumUpdateIsSaving || !r
- }), 'days.') : null, C.a.createElement('label', {
- className: 'fieldset__block--radio text-medium spacing-bottom-small'
- }, C.a.createElement('input', {
- name: this.getInputId('validateAllPosts'),
- type: 'radio',
- checked: this.state.validateAllPosts,
- value: !0,
- onChange: function (e) {
- t.handleInputChange('validateAllPosts', e),
- t.handleInputChange('unapproveNewUsersEnabled', e, !1)
- },
- readOnly: this.props.forumUpdateIsSaving,
- disabled: this.props.forumUpdateIsSaving
- }), C.a.createElement('strong', null, 'All'), ' — Moderators must approve all comments.')), C.a.createElement(Ob, {
- name: 'allowAnonPost',
- checked: !!this.state.allowAnonPost,
- label: 'Guest Commenting',
- secondaryLabel: 'Allow guests to comment',
- onChange: this.handleInputChange.bind(this, 'allowAnonPost'),
- idNamespace: this.constructor.displayName,
- readOnly: this.props.forumUpdateIsSaving,
- disabled: this.props.forumUpdateIsSaving,
- shouldHighlight: this.hasFieldChanged('allowAnonPost'),
- tooltip: 'Guest commenters do not receive email notifications and do not have profiles showing their comment history.'
- }), C.a.createElement(Ob, {
- name: 'unapproveLinks',
- checked: !!this.state.unapproveLinks,
- label: 'Links in Comments',
- secondaryLabel: 'Comments containing links must be approved before they are published.',
- onChange: this.handleInputChange.bind(this, 'unapproveLinks'),
- idNamespace: this.constructor.displayName,
- readOnly: this.props.forumUpdateIsSaving,
- disabled: this.props.forumUpdateIsSaving,
- shouldHighlight: this.hasFieldChanged('unapproveLinks')
- }), C.a.createElement(Ob, {
- name: 'flaggingNotifications',
- checked: !!this.state.flaggingNotifications,
- label: 'Flagged Comments',
- secondaryLabel: 'Email moderators when a post is flagged.',
- onChange: this.handleInputChange.bind(this, 'flaggingNotifications'),
- idNamespace: this.constructor.displayName,
- readOnly: this.props.forumUpdateIsSaving,
- disabled: this.props.forumUpdateIsSaving,
- shouldHighlight: this.hasFieldChanged('flaggingNotifications') || this.hasFieldChanged('flaggingEnabled') || this.hasFieldChanged('flagThreshold'),
- tooltip: C.a.createElement(C.a.Fragment, null, 'People may flag comments for moderator attention. ', C.a.createElement('a', {
- href: Pn.flagging
- }, 'Learn more about flagging.'))
- }, C.a.createElement(Ob, {
- name: 'flaggingEnabled',
- checked: !!this.state.flaggingEnabled,
- label: 'Flagged Comments',
- secondaryLabel: 'Do not display a comment once it is flagged',
- onChange: this.handleInputChange.bind(this, 'flaggingEnabled'),
- idNamespace: this.constructor.displayName,
- readOnly: this.props.forumUpdateIsSaving,
- disabled: this.props.forumUpdateIsSaving,
- ignoreFieldset: !0
- }, C.a.createElement(Mf, {
- name: 'flagThreshold',
- className: '-text-small spacing-left',
- options: yf,
- value: this.state.flagThreshold,
- width: 120,
- inline: !0,
- onChange: this.handleInputChange.bind(this, 'flagThreshold'),
- readOnly: this.props.forumUpdateIsSaving,
- disabled: !this.state.flaggingEnabled || this.props.forumUpdateIsSaving
- }))), C.a.createElement(Ob, {
- name: 'mediaembedEnabled',
- checked: !!this.state.mediaembedEnabled,
- label: 'Images and Videos',
- secondaryLabel: 'Allow comments with images and videos',
- onChange: this.handleInputChange.bind(this, 'mediaembedEnabled'),
- idNamespace: this.constructor.displayName,
- readOnly: this.props.forumUpdateIsSaving,
- disabled: this.props.forumUpdateIsSaving,
- shouldHighlight: this.hasFieldChanged('mediaembedEnabled'),
- tooltip: 'Automatically attach and display images and videos that are mentioned with comments.'
- }), C.a.createElement(Ob, {
- name: 'gifPickerEnabled',
- checked: !!this.state.gifPickerEnabled,
- label: 'Gif Picker',
- secondaryLabel: 'Enable Gif Picker',
- onChange: this.handleInputChange.bind(this, 'gifPickerEnabled'),
- idNamespace: this.constructor.displayName,
- readOnly: this.props.forumUpdateIsSaving,
- disabled: this.props.forumUpdateIsSaving,
- shouldHighlight: this.hasFieldChanged('gifPickerEnabled'),
- tooltip: 'Allow users to search and add safe GIFs to their comments.'
- }), C.a.createElement(kf, {
- label: 'Automatic Closing',
- labelId: this.getInputId('daysThreadAlive'),
- shouldHighlight: this.hasFieldChanged('daysThreadAlive')
- }, C.a.createElement('div', {
- className: 'spacing-top-small spacing-left-tiny text-medium'
- }, 'Do not allow comments after', C.a.createElement('input', {
- type: 'number',
- id: this.getInputId('daysThreadAlive'),
- min: Ef,
- max: Of,
- value: this.state.daysThreadAlive,
- onChange: this.handleInputChange.bind(this, 'daysThreadAlive'),
- size: '3',
- className: 'input--textbox -text-small -inline spacing-left-small spacing-right-small',
- readOnly: this.props.forumUpdateIsSaving,
- disabled: this.props.forumUpdateIsSaving
- }), 'days. Using 0 days will disable this feature.')))), C.a.createElement('footer', {
- className: 'settings__footer'
- }, C.a.createElement(Bh, {
- disabled: !(this.hasUnsavedChanges() || this.state.rulesChanged) || this.hasInvalidFields(),
- onClick: this.handleSaveChanges,
- isSaving: this.props.forumUpdateIsSaving || this.props.rulesAreSaving,
- isSaved: this.props.forumUpdateIsSaved && this.props.rulesAreSaved,
- saveErr: !!e
- }, e && !this.hasInvalidFields() ? C.a.createElement('div', {
- className: 'text-medium text-gray-dark spacing-narrow'
- }, e) : null))))
- }
- }
- ]) && E_(e.prototype, t),
- n && E_(e, n),
- r
- }();
- k_(go, 'displayName', 'ForumSettingsModeration'),
- k_(go, 'propTypes', {
- history: b.a.shape({
- setRouteLeaveHook: b.a.func.isRequired
- }).isRequired,
- route: b.a.object.isRequired,
- params: b.a.shape({
- rule: b.a.string
- }),
- organizations: b.a.object.isRequired,
- selection: ht.isRequired,
- forumDetails: $c,
- forumDetailsError: b.a.string,
- forumDetailsIsFetching: b.a.bool,
- fetchForumDetails: b.a.func.isRequired,
- forumUpdateError: b.a.string,
- forumUpdateIsSaving: b.a.bool,
- forumUpdateIsSaved: b.a.bool,
- forumUpdateOnSave: b.a.func.isRequired,
- forumUpdateOnDismissError: b.a.func.isRequired,
- rulesAreFetching: b.a.bool,
- rulesAreSaving: b.a.bool,
- rulesAreSaved: b.a.bool,
- rulesSaveFailed: b.a.bool,
- rulesSaveError: b.a.string,
- rules: b.a.arrayOf(b.a.shape(qn)),
- moderationHistory: b.a.shape(Ln),
- fetchRules: b.a.func.isRequired,
- fetchModerationHistory: b.a.func.isRequired,
- saveRules: b.a.func.isRequired,
- saasFeatures: b.a.objectOf(b.a.objectOf(b.a.bool)).isRequired,
- emitTrackingEvent: b.a.func.isRequired
- }),
- k_(go, 'getEditableFieldsFromForum', function (e) {
- var t = (e = e || {
- }).settings || {
- };
- return {
- validateAllPosts: t.validateAllPosts,
- unapproveLinks: t.unapproveLinks,
- mediaembedEnabled: t.mediaembedEnabled,
- gifPickerEnabled: t.gifPickerEnabled,
- flaggingNotifications: t.flaggingNotifications,
- flaggingEnabled: t.flaggingEnabled,
- flagThreshold: e.flagThreshold,
- daysThreadAlive: e.daysThreadAlive,
- allowAnonPost: t.allowAnonPost,
- unapproveNewUsersEnabled: t.unapproveNewUsersEnabled,
- daysUnapproveNewUsers: e.daysUnapproveNewUsers
- }
- });
- oo = Object(u.connect) (function (e) {
- var t = e.forumDetails,
- n = e.saasFeatures,
- a = e.selection;
- return __(__({
- forumDetails: t.forumDetails,
- forumDetailsError: t.forumDetailsError,
- forumDetailsIsFetching: t.forumDetailsIsFetching
- }, e.moderationRules), {
- }, {
- saasFeatures: n,
- selection: a
- })
- }, {
- fetchRules: i,
- fetchModerationHistory: function (n) {
- return function (t, e) {
- ug(n, e(), function (e) {
- io.a.call('rules/moderationHistory', e).success(function (e) {
- t({
- type: oe.onFetchModerationHistory,
- response: e.response
- })
- })
- })
- }
- },
- saveRules: c,
- emitTrackingEvent: Xo({
- zone: 'settings',
- section: 'moderation'
- }),
- fetchForumDetails: ig
- }) (Ni.a.attachDrivers(Fo() (go), [
- m
- ])),
- bo = b.a.shape({
- cache: b.a.string,
- isCustom: b.a.bool,
- permalink: b.a.string,
- small: b.a.shape({
- cache: b.a.string,
- permalink: b.a.string
- }),
- large: b.a.shape({
- cache: b.a.string,
- permalink: b.a.string
- })
- }),
- To = b.a.shape({
- id: b.a.string.isRequired,
- name: b.a.string,
- username: b.a.string.isRequired,
- url: b.a.string.isRequired,
- profileUrl: b.a.string.isRequired,
- signedUrl: b.a.string.isRequired,
- location: b.a.string,
- joinedAt: b.a.string,
- avatar: bo
- });
- function N_(t, e) {
- var n,
- a = Object.keys(t);
- return Object.getOwnPropertySymbols && (n = Object.getOwnPropertySymbols(t), e && (n = n.filter(function (e) {
- return Object.getOwnPropertyDescriptor(t, e).enumerable
- })), a.push.apply(a, n)),
- a
- }
- function C_(a) {
- for (var e = 1; e < arguments.length; e++) {
- var r = null != arguments[e] ? arguments[e] : {
- };
- e % 2 ? N_(Object(r), !0).forEach(function (e) {
- var t,
- n;
- n = r[t = e],
- t in (e = a) ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(a, Object.getOwnPropertyDescriptors(r)) : N_(Object(r)).forEach(function (e) {
- Object.defineProperty(a, e, Object.getOwnPropertyDescriptor(r, e))
- })
- }
- return a
- }
- function R_() {
- return (R_ = Object.assign || function (e) {
- for (var t = 1; t < arguments.length; t++) {
- var n,
- a = arguments[t];
- for (n in a) Object.prototype.hasOwnProperty.call(a, n) && (e[n] = a[n])
- }
- return e
- }).apply(this, arguments)
- }
- Qs = {
- fetchForumModeratorList: function () {
- return function (t, e) {
- t({
- type: Z.fetching
- });
- e = e().selection.forum.shortname;
- io.a.call('forums/listModerators', {
- type: 'GET',
- data: {
- forum: e
- },
- success: function (e) {
- t({
- type: Z.onFetch,
- moderatorList: e.response
- })
- },
- error: function (e) {
- t({
- type: Z.onFetchError,
- data: e
- })
- }
- })
- }
- },
- addForumModerator: function (n, a) {
- return function (t, e) {
- t({
- type: Z.saving
- });
- e = e().selection.forum.shortname,
- e = R_({
- user: 'username:'.concat(n),
- forum: e
- }, a);
- io.a.call('forums/addModerator', {
- type: 'POST',
- data: e,
- success: function () {
- t({
- type: Z.onSave
- })
- },
- error: function (e) {
- t({
- type: Z.onSaveError,
- data: e
- })
- }
- })
- }
- },
- removeForumModerator: function (e) {
- return function (t) {
- t({
- type: Z.saving
- }),
- io.a.call('forums/removeModerator', {
- type: 'POST',
- data: {
- moderator: e
- },
- success: function () {
- t({
- type: Z.onSave
- })
- },
- error: function (e) {
- t({
- type: Z.onSaveError,
- data: e
- })
- }
- })
- }
- },
- updateModeratorPermissions: function (n, a) {
- return function (t, e) {
- t({
- type: Z.updating,
- username: n,
- permissions: {
- isSaving: !0
- }
- });
- e = e().selection.forum.shortname,
- e = R_({
- user: 'username:'.concat(n),
- forum: e
- }, a);
- io.a.call('forums/addModerator', {
- type: 'POST',
- data: e,
- success: function (e) {
- t({
- type: Z.onUpdate,
- username: n,
- permissions: C_(C_({
- }, e.response), {
- }, {
- isSaving: !1
- })
- })
- },
- error: function (e) {
- t(C_({
- type: Z.onUpdateError,
- username: n,
- permissions: {
- isSaving: !1
- }
- }, e))
- }
- })
- }
- }
- };
- function x_(t, e) {
- var n,
- a = Object.keys(t);
- return Object.getOwnPropertySymbols && (n = Object.getOwnPropertySymbols(t), e && (n = n.filter(function (e) {
- return Object.getOwnPropertyDescriptor(t, e).enumerable
- })), a.push.apply(a, n)),
- a
- }
- function A_(a) {
- for (var e = 1; e < arguments.length; e++) {
- var r = null != arguments[e] ? arguments[e] : {
- };
- e % 2 ? x_(Object(r), !0).forEach(function (e) {
- var t,
- n;
- n = r[t = e],
- t in (e = a) ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(a, Object.getOwnPropertyDescriptors(r)) : x_(Object(r)).forEach(function (e) {
- Object.defineProperty(a, e, Object.getOwnPropertyDescriptor(r, e))
- })
- }
- return a
- }
- Ss = {
- fetchOrgAdminList: function () {
- return function (t, e) {
- t({
- type: ie.fetching
- });
- e = e().selection.organization.id;
- io.a.call('organizations/listOrganizationRoles', {
- type: 'GET',
- data: {
- organization: e
- },
- success: function (e) {
- t({
- type: ie.onFetch,
- orgAdminList: e.response
- })
- },
- error: function (e) {
- t({
- type: ie.onFetchError,
- data: e
- })
- }
- })
- }
- },
- addOrgAdmin: function (e) {
- var n = e.data,
- a = e.onSuccess;
- return function (t, e) {
- t({
- type: ie.saving
- });
- e = e().selection.organization.id;
- io.a.call('organizations/addAdmin', {
- type: 'POST',
- data: {
- user: 'username:'.concat(n.username),
- organization: e
- },
- success: function () {
- t({
- type: ie.onSave
- }),
- a()
- },
- error: function (e) {
- t({
- type: ie.onSaveError,
- data: e
- })
- }
- })
- }
- },
- updateOrgAdmin: function (n, a) {
- return function (t, e) {
- t({
- type: ie.saving
- });
- e = e().selection.organization.id;
- io.a.call('organizations/setRole', {
- type: 'POST',
- data: A_({
- user: 'username:'.concat(n),
- organization: e
- }, a),
- success: function () {
- t({
- type: ie.onSave
- })
- },
- error: function (e) {
- t({
- type: ie.onSaveError,
- data: e
- })
- }
- })
- }
- },
- removeOrgAdmin: function (n) {
- return function (t, e) {
- t({
- type: ie.saving
- });
- e = e().selection.organization.id;
- io.a.call('organizations/removeAdmin', {
- type: 'POST',
- data: {
- user: n,
- organization: e
- },
- success: function () {
- t({
- type: ie.onSave
- })
- },
- error: function (e) {
- t({
- type: ie.onSaveError,
- data: e
- })
- }
- })
- }
- }
- };
- function D_(e) {
- return (D_ = 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator ? function (e) {
- return typeof e
- }
- : function (e) {
- return e && 'function' == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? 'symbol' : typeof e
- }) (e)
- }
- function j_(t, e) {
- var n,
- a = Object.keys(t);
- return Object.getOwnPropertySymbols && (n = Object.getOwnPropertySymbols(t), e && (n = n.filter(function (e) {
- return Object.getOwnPropertyDescriptor(t, e).enumerable
- })), a.push.apply(a, n)),
- a
- }
- function T_(t) {
- for (var e = 1; e < arguments.length; e++) {
- var n = null != arguments[e] ? arguments[e] : {
- };
- e % 2 ? j_(Object(n), !0).forEach(function (e) {
- M_(t, e, n[e])
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(n)) : j_(Object(n)).forEach(function (e) {
- Object.defineProperty(t, e, Object.getOwnPropertyDescriptor(n, e))
- })
- }
- return t
- }
- function I_(e, t) {
- for (var n = 0; n < t.length; n++) {
- var a = t[n];
- a.enumerable = a.enumerable || !1,
- a.configurable = !0,
- 'value' in a && (a.writable = !0),
- Object.defineProperty(e, a.key, a)
- }
- }
- function q_(e, t) {
- return (q_ = Object.setPrototypeOf || function (e, t) {
- return e.__proto__ = t,
- e
- }) (e, t)
- }
- function F_(n) {
- var a = function () {
- if ('undefined' == typeof Reflect || !Reflect.construct) return !1;
- if (Reflect.construct.sham) return !1;
- if ('function' == typeof Proxy) return !0;
- try {
- return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [
- ], function () {
- })),
- !0
- } catch (e) {
- return !1
- }
- }();
- return function () {
- var e,
- t = U_(n);
- return e = a ? (e = U_(this).constructor, Reflect.construct(t, arguments, e)) : t.apply(this, arguments),
- t = this,
- !(e = e) || 'object' !== D_(e) && 'function' != typeof e ? L_(t) : e
- }
- }
- function L_(e) {
- if (void 0 === e) throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called');
- return e
- }
- function U_(e) {
- return (U_ = Object.setPrototypeOf ? Object.getPrototypeOf : function (e) {
- return e.__proto__ || Object.getPrototypeOf(e)
- }) (e)
- }
- function M_(e, t, n) {
- return t in e ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n,
- e
- }
- Ts = function () {
- !function (e, t) {
- if ('function' != typeof t && null !== t) throw new TypeError('Super expression must either be null or a function');
- e.prototype = Object.create(t && t.prototype, {
- constructor: {
- value: e,
- writable: !0,
- configurable: !0
- }
- }),
- t && q_(e, t)
- }(o, A);
- var e,
- t,
- n,
- r = F_(o);
- function o() {
- var a;
- !function (e, t) {
- if (!(e instanceof t)) throw new TypeError('Cannot call a class as a function')
- }(this, o);
- for (var e = arguments.length, t = Array(e), n = 0; n < e; n++) t[n] = arguments[n];
- return M_(L_(a = r.call.apply(r, [
- this
- ].concat(t))), 'state', {
- newUsername: ''
- }),
- M_(L_(a), 'handleAddModerator', function () {
- var e = a.state.newUsername.trim();
- e && a.props.addForumModerator(e)
- }),
- M_(L_(a), 'handlePermissionChange', function (e, t, n) {
- a.props.updateModeratorPermissions(e.user.username, M_({
- }, t, n.target.checked ? 1 : 0))
- }),
- M_(L_(a), 'getOrgAdminPermissions', function (e) {
- var t = [
- ];
- e.isAdmin && t.push('can edit organization info'),
- e.isModerator && t.push('can moderate all organization sites');
- e = t.join(', ');
- return t.length ? (e[0] || '').toUpperCase() + e.slice(1) : ''
- }),
- a
- }
- return e = o,
- (t = [
- {
- key: 'componentDidMount',
- value: function () {
- this.props.fetchForumModeratorList(),
- this.props.selection.organization && this.props.fetchOrgAdminList()
- }
- },
- {
- key: 'componentWillReceiveProps',
- value: function (e) {
- var t = {
- };
- !e.isSaving && this.props.isSaving && (this.props.fetchForumModeratorList(), t.newUsername = ''),
- this.setState(t)
- }
- },
- {
- key: 'render',
- value: function () {
- var r = this;
- return this.props.selection.organization && this.props.selection.organization.pollsOnly ? C.a.createElement(Cm, {
- isPolls: !1,
- organization: this.props.selection.organization
- }) : C.a.createElement('div', null, this.props.fetchError || this.props.updateError ? C.a.createElement(Ki, {
- message: this.props.fetchError || this.props.updateError,
- alertType: 'error'
- }) : null, C.a.createElement('div', {
- className: 'content__wrap spacing-bottom-double'
- }, C.a.createElement('header', {
- className: 'settings__header'
- }, C.a.createElement('h2', {
- className: 'text-larger text-gray-darker spacing-bottom-small'
- }, 'Comment Moderators'), C.a.createElement('p', {
- className: 'text-gray text-medium'
- }, 'Add people to help moderate your community. All moderators can ban users.', C.a.createElement('a', {
- href: Pn.modArticles,
- target: '_blank',
- rel: 'noopener noreferrer'
- }, ' Learn more » '))), C.a.createElement('section', null, this.props.isFetching && !this.props.forumModeratorList ? C.a.createElement(Ji, null) : null, (this.props.forumModeratorList || [
- ]).map(function (e) {
- var t = e.user.username === r.props.selection.forum.founder.username,
- n = '//'.concat(pt.a.disqusHost, '/by/').concat(e.user.username, '/'),
- a = r.props.isSaving || e.isSaving;
- return C.a.createElement('div', {
- key: e.user.id,
- className: 'settings-list__item',
- style: {
- opacity: e.isSaving ? '0.7' : '1'
- }
- }, C.a.createElement('div', {
- className: 'align align--between'
- }, C.a.createElement('div', {
- className: 'spacing-right align'
- }, C.a.createElement('div', {
- className: 'spacing-right spacing-top-small'
- }, C.a.createElement('img', {
- className: 'border-radius-base',
- src: e.user.avatar.cache,
- width: '40',
- height: '40'
- })), C.a.createElement('div', null, C.a.createElement('a', {
- href: n,
- className: 'text-medium text-semibold'
- }, e.user.name), t ? C.a.createElement('p', {
- className: 'text-small text-gray spacing-top-tiny'
- }, 'Primary moderator has full permissions. ', C.a.createElement('a', {
- href: Pn.changePrimaryMod,
- target: '_blank',
- rel: 'noopener noreferrer'
- }, 'Need to change the primary moderator?')) : C.a.createElement('p', {
- className: 'text-small text-gray spacing-top-tiny'
- }, C.a.createElement('label', {
- className: 'fieldset__inline-block--checkbox spacing-right-large'
- }, C.a.createElement('input', {
- type: 'checkbox',
- className: 'input--checkbox',
- checked: e.canAdminister,
- onChange: r.handlePermissionChange.bind(r, e, 'canAdminister'),
- disabled: a
- }), ' Can change settings'), C.a.createElement('label', {
- className: 'fieldset__inline-block--checkbox'
- }, C.a.createElement('input', {
- type: 'checkbox',
- className: 'input--checkbox',
- checked: e.canEdit,
- onChange: r.handlePermissionChange.bind(r, e, 'canEdit'),
- disabled: a
- }), ' Can edit comments')))), t ? null : C.a.createElement('div', {
- className: 'align-min-tablet align--middle spacing-top-small spacing-bottom-small'
- }, C.a.createElement('button', {
- className: 'button button-outline text-medium',
- onClick: r.props.removeForumModerator.bind(null, e.id),
- disabled: a
- }, 'Remove'))))
- }), C.a.createElement('div', {
- className: 'settings-list__item'
- }, C.a.createElement('form', {
- onSubmit: function (e) {
- return e.preventDefault()
- }
- }, C.a.createElement('div', {
- className: 'align spacing-top-small'
- }, C.a.createElement('div', {
- className: 'spacing-right align__item--grow'
- }, C.a.createElement('input', {
- type: 'text',
- className: 'input--textbox',
- placeholder: 'Add a new comment moderator by their username',
- onChange: function (e) {
- return r.setState({
- newUsername: e.target.value
- })
- },
- value: this.state.newUsername,
- disabled: this.props.isSaving
- })), C.a.createElement('button', {
- className: 'button button-outline text-medium',
- onClick: this.handleAddModerator,
- disabled: this.props.isSaving || !this.state.newUsername
- }, 'Add')), C.a.createElement('p', {
- className: 'fieldset__description spacing-bottom-small text-small text-gray spacing-top-tiny'
- }, 'Moderators require a Disqus account.', C.a.createElement('a', {
- href: Pn.modArticles,
- target: '_blank',
- rel: 'noopener noreferrer'
- }, ' Learn more » ')), this.props.saveError ? C.a.createElement('p', {
- className: 'text-medium text-error text-semibold spacing-narrow'
- }, this.props.saveError) : null)))), this.props.selection.organization ? C.a.createElement('div', {
- className: 'content__wrap spacing-bottom-double'
- }, C.a.createElement('header', {
- className: 'settings__header'
- }, C.a.createElement('h2', {
- className: 'text-larger text-gray-darker spacing-bottom-small'
- }, 'Organization Admins'), C.a.createElement('p', {
- className: 'text-gray text-medium'
- }, 'Organization admins have full moderation permissions on each of the sites in the organization.', ' ', C.a.createElement(Us, {
- path: '/settings/admins/',
- orgId: this.props.selection.organization.id,
- orgSlug: this.props.selection.organization.slug
- }, 'Manage Admins »'))), C.a.createElement('section', null, this.props.orgAdminListIsFetching && !this.props.orgAdminList ? C.a.createElement(Ji, null) : null, (this.props.orgAdminList || [
- ]).map(function (e) {
- var t = r.props.selection.organization && e.user.username === r.props.selection.organization.owner,
- n = '//'.concat(pt.a.disqusHost, '/by/').concat(e.user.username, '/');
- return C.a.createElement('div', {
- className: 'settings-list__item',
- key: e.id
- }, C.a.createElement('div', {
- className: 'align align--between'
- }, C.a.createElement('div', {
- className: 'spacing-right align'
- }, C.a.createElement('div', {
- className: 'spacing-right spacing-top-small'
- }, C.a.createElement('img', {
- className: 'border-radius-base',
- src: e.user.avatar.cache,
- width: '40',
- height: '40'
- })), C.a.createElement('div', null, C.a.createElement('a', {
- href: n,
- className: 'text-medium text-semibold'
- }, e.user.name), C.a.createElement('p', {
- className: 'text-small text-gray spacing-top-tiny'
- }, t ? 'Organization owner has full permissions.' : r.getOrgAdminPermissions(e))))))
- }))) : null)
- }
- }
- ]) && I_(e.prototype, t),
- n && I_(e, n),
- o
- }();
- M_(Ts, 'displayName', 'ForumSettingsModerators'),
- M_(Ts, 'propTypes', {
- selection: ht.isRequired,
- forumModeratorList: b.a.arrayOf(b.a.shape({
- user: b.a.shape({
- id: b.a.string,
- username: b.a.string,
- name: b.a.string,
- avatar: b.a.shape({
- cache: b.a.string
- })
- }),
- id: b.a.string,
- forum: b.a.string,
- canAdminister: b.a.bool,
- canEdit: b.a.bool
- })),
- isFetching: b.a.bool,
- isSaving: b.a.bool,
- isUpdating: b.a.bool,
- fetchError: b.a.string,
- saveError: b.a.string,
- updateError: b.a.string,
- orgAdminList: b.a.arrayOf(b.a.shape({
- id: b.a.number.isRequired,
- organizationId: b.a.number.isRequired,
- isAdmin: b.a.bool.isRequired,
- isModerator: b.a.bool.isRequired,
- user: To
- })),
- orgAdminIsFetching: b.a.bool,
- fetchOrgAdminList: b.a.func.isRequired,
- fetchForumModeratorList: b.a.func.isRequired,
- addForumModerator: b.a.func.isRequired,
- removeForumModerator: b.a.func.isRequired,
- updateModeratorPermissions: b.a.func.isRequired
- });
- qs = Object(u.connect) (function (e) {
- var t = e.orgAdmin;
- return T_(T_({
- selection: e.selection
- }, e.forumModerator), t)
- }, T_(T_({
- }, Qs), Ss)) (Fo() (Ts)),
- ac = function (e) {
- return C.a.createElement('label', {
- className: 'align spacing-bottom-narrow text-medium'
- }, C.a.createElement('input', {
- type: 'radio',
- name: 'reason',
- className: 'spacing-right',
- value: e.reason,
- onChange: e.onChange,
- checked: e.checked
- }), e.reason_text, e.children)
- };
- ac.propTypes = {
- reason: b.a.string,
- onChange: b.a.func,
- checked: b.a.bool,
- children: b.a.node,
- reason_text: b.a.string.isRequired
- };
- var B_ = ac;
- function z_(e) {
- return (z_ = 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator ? function (e) {
- return typeof e
- }
- : function (e) {
- return e && 'function' == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? 'symbol' : typeof e
- }) (e)
- }
- function H_(t, e) {
- var n,
- a = Object.keys(t);
- return Object.getOwnPropertySymbols && (n = Object.getOwnPropertySymbols(t), e && (n = n.filter(function (e) {
- return Object.getOwnPropertyDescriptor(t, e).enumerable
- })), a.push.apply(a, n)),
- a
- }
- function G_(t) {
- for (var e = 1; e < arguments.length; e++) {
- var n = null != arguments[e] ? arguments[e] : {
- };
- e % 2 ? H_(Object(n), !0).forEach(function (e) {
- J_(t, e, n[e])
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(n)) : H_(Object(n)).forEach(function (e) {
- Object.defineProperty(t, e, Object.getOwnPropertyDescriptor(n, e))
- })
- }
- return t
- }
- function V_(e, t) {
- for (var n = 0; n < t.length; n++) {
- var a = t[n];
- a.enumerable = a.enumerable || !1,
- a.configurable = !0,
- 'value' in a && (a.writable = !0),
- Object.defineProperty(e, a.key, a)
- }
- }
- function W_(e, t) {
- return (W_ = Object.setPrototypeOf || function (e, t) {
- return e.__proto__ = t,
- e
- }) (e, t)
- }
- function Y_(n) {
- var a = function () {
- if ('undefined' == typeof Reflect || !Reflect.construct) return !1;
- if (Reflect.construct.sham) return !1;
- if ('function' == typeof Proxy) return !0;
- try {
- return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [
- ], function () {
- })),
- !0
- } catch (e) {
- return !1
- }
- }();
- return function () {
- var e,
- t = K_(n);
- return e = a ? (e = K_(this).constructor, Reflect.construct(t, arguments, e)) : t.apply(this, arguments),
- t = this,
- !(e = e) || 'object' !== z_(e) && 'function' != typeof e ? Q_(t) : e
- }
- }
- function Q_(e) {
- if (void 0 === e) throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called');
- return e
- }
- function K_(e) {
- return (K_ = Object.setPrototypeOf ? Object.getPrototypeOf : function (e) {
- return e.__proto__ || Object.getPrototypeOf(e)
- }) (e)
- }
- function J_(e, t, n) {
- return t in e ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n,
- e
- }
- var $_ = {
- ad_quality: 'The ads are low quality or inappropriate.',
- ad_relevance: 'The ads are not relevant to our content.',
- ad_revenue: 'The earnings are not high enough.',
- ad_design: 'The ad layout, size, design, and/or placement doesn\'t work for our site.',
- ad_conflict: 'The ads conflict with our existing contracts with other ad providers.',
- ad_payment: 'The payments are too slow and/or confusing.',
- ad_load_speed: 'The ads make our site(s) slow-to-load.',
- ad_controls: 'The ad controls are too limited for our needs.'
- },
- cs = function () {
- !function (e, t) {
- if ('function' != typeof t && null !== t) throw new TypeError('Super expression must either be null or a function');
- e.prototype = Object.create(t && t.prototype, {
- constructor: {
- value: e,
- writable: !0,
- configurable: !0
- }
- }),
- t && W_(e, t)
- }(o, A);
- var e,
- t,
- n,
- r = Y_(o);
- function o() {
- var t;
- !function (e, t) {
- if (!(e instanceof t)) throw new TypeError('Cannot call a class as a function')
- }(this, o);
- for (var e = arguments.length, n = Array(e), a = 0; a < e; a++) n[a] = arguments[a];
- return J_(Q_(t = r.call.apply(r, [
- this
- ].concat(n))), 'state', {
- showForm: !1,
- selectedReason: '',
- reasonText: ''
- }),
- J_(Q_(t), 'startDeactivation', function () {
- t.setState({
- showForm: !0
- })
- }),
- J_(Q_(t), 'cancelDeactivation', function () {
- t.setState({
- showForm: !1
- })
- }),
- J_(Q_(t), 'onReasonSelected', function (e) {
- t.setState({
- selectedReason: e.target.value,
- reasonText: $_[e.target.value]
- })
- }),
- J_(Q_(t), 'otherReasonSelected', function (e) {
- t.setState({
- selectedReason: 'other',
- reasonText: e.target.value
- })
- }),
- J_(Q_(t), 'reportUpgradeEvent', function () {
- t.props.emitTrackingEvent({
- verb: 'click',
- object_type: 'button',
- object_id: 'upgrade_account'
- })
- }),
- J_(Q_(t), 'confirmDeactivation', function () {
- t.props.emitTrackingEvent({
- verb: 'update',
- object_type: 'forum',
- object_id: t.props.selection.forum.shortname,
- area: 'deactivation',
- extra_data: JSON.stringify(G_(G_({
- }, t.props.forumState), {
- }, {
- reason: t.state.selectedReason,
- reason_text: t.state.reasonText
- }))
- }),
- t.props.onDeactivate()
- }),
- t
- }
- return e = o,
- (t = [
- {
- key: 'render',
- value: function () {
- var t = this;
- return this.props.isNewPolicy && this.props.hasAdsOptional ? C.a.createElement('div', {
- className: 'deactivation '.concat(this.state.showForm ? '-show-form' : '')
- }, C.a.createElement('div', {
- className: 'cta',
- id: 'deactivate'
- }, C.a.createElement('div', {
- className: 'settings__content padding-double'
- }, C.a.createElement('header', {
- className: 'align align--between'
- }, C.a.createElement('h2', {
- className: 'text-gray-darker text-larger'
- }, 'Turn ads off'), C.a.createElement('div', {
- className: 'button button-fill button-padding-wide',
- onClick: this.startDeactivation
- }, 'Start deactivation')))), C.a.createElement('div', {
- className: 'form'
- }, C.a.createElement('div', {
- className: 'reasons padding-double'
- }, C.a.createElement('div', {
- className: 'text-gray spacing-bottom'
- }, 'Please help us improve our ads experience by answering the following question: why would you like to deactivate ads?'), Object.keys($_).map(function (e) {
- return C.a.createElement(B_, {
- key: e,
- reason: e,
- reason_text: $_[e],
- checked: e === t.state.selectedReason,
- onChange: t.onReasonSelected
- })
- }), C.a.createElement(B_, {
- key: 'Other',
- reason: 'other',
- reason_text: 'Other',
- checked: 'other' === this.state.selectedReason,
- onChange: this.onReasonSelected
- }, C.a.createElement('input', {
- type: 'text',
- className: 'input--default spacing-left',
- onChange: this.otherReasonSelected,
- onClick: this.otherReasonSelected
- }))), C.a.createElement('footer', {
- className: 'settings__footer align align--between'
- }, C.a.createElement('button', {
- className: 'button button-fill--blue-light button-padding-wide button-medium',
- onClick: this.cancelDeactivation
- }, 'Cancel Deactivation'), C.a.createElement('button', {
- className: 'button button-fill--brand button-padding-wide button-medium',
- onClick: this.confirmDeactivation
- }, 'Deactivate Ads')))) : this.props.isNewPolicy && !this.props.hasAdsOptional ? C.a.createElement('header', {
- className: 'settings__header settings-inline-section align align--between align--middle padding-double'
- }, C.a.createElement('div', {
- className: 'align__item--flex-1 text-gray spacing-right-large'
- }, C.a.createElement('h2', {
- className: 'text-gray-darker text-larger'
- }, 'Looking to remove ads?'), 'Disqus is powered by its relationship with its publishers.', ' ', 'Learn more about', ' ', C.a.createElement('a', {
- target: '_blank',
- rel: 'noopener noreferrer',
- href: 'https://disqus.com/features/'
- }, 'How Disqus Works'), ' ', 'and finding', ' ', C.a.createElement(Us, {
- path: '/settings/subscription/',
- orgId: this.props.selection.organization.id,
- orgSlug: this.props.selection.organization.slug
- }, 'Which Plan is Right For You'), '.'), C.a.createElement('div', {
- className: 'align__item--no-shrink',
- onClick: this.reportUpgradeEvent
- }, C.a.createElement(Us, {
- path: '/settings/subscription/',
- orgId: this.props.selection.organization.id,
- orgSlug: this.props.selection.organization.slug
- }, C.a.createElement('div', {
- className: 'button button-fill button-fill--yellow button-padding-wide'
- }, C.a.createElement('span', {
- className: 'icon-upgrade-arrow icon__position spacing-right-small'
- }), 'Upgrade Your Account')))) : !this.props.isNewPolicy && this.props.hasAdsOptional ? C.a.createElement('header', {
- className: 'settings__content align align--between padding-double'
- }, C.a.createElement('h2', {
- className: 'text-gray-darker text-larger'
- }, 'Deactivate Reveal Ads'), C.a.createElement(Uo, {
- path: '/settings/revenue/hub',
- selection: this.props.selection
- }, C.a.createElement('div', {
- className: 'button button-outline -border-red'
- }, 'Start Ads Deactivation Process'))) : C.a.createElement('header', {
- className: 'settings__header settings-inline-section padding-double'
- }, C.a.createElement('div', null, 'Looking to remove ads?'), C.a.createElement('div', null, C.a.createElement('a', {
- href: Pn.revealContact
- }, C.a.createElement('strong', null, 'Contact our Publisher Support Team to upgrade your account.')), ' We\'ll get back to you shortly.'))
- }
- }
- ]) && V_(e.prototype, t),
- n && V_(e, n),
- o
- }();
- J_(cs, 'propTypes', {
- isNewPolicy: b.a.bool,
- forumState: b.a.object,
- hasAdsOptional: b.a.bool,
- onDeactivate: b.a.func.isRequired,
- selection: ht.isRequired,
- emitTrackingEvent: b.a.func.isRequired
- });
- function Z_(e) {
- var t = e.adPosition,
- n = e.allowedLocation,
- a = e.titleOnly;
- return C.a.createElement('div', {
- className: 'reveal-preview__card'.concat((e = e.extraClass) ? ' '.concat(e) : '')
- }, C.a.createElement('p', {
- className: 'primary-comment'
- }, C.a.createElement('span', {
- className: 'icon-checkmark'
- }), ' ', t, ' Ads Position'), a ? null : C.a.createElement('p', {
- className: 'secondary-comment'
- }, 'Ads are allowed ', n, ' comments'))
- }
- var X_ = Object(u.connect) (null, {
- emitTrackingEvent: Xo({
- zone: 'settings',
- section: 'ads'
- })
- }) (cs);
- Z_.propTypes = {
- adPosition: b.a.string.isRequired,
- allowedLocation: b.a.string.isRequired,
- titleOnly: b.a.bool,
- extraClass: b.a.string
- };
- function eE(e) {
- return C.a.createElement('div', {
- className: 'align'
- }, e.positionEnabled ? C.a.createElement(Z_, {
- adPosition: 'Recommendations',
- allowedLocation: 'recommendations',
- titleOnly: !0,
- extraClass: 'align align--middle spacing-top-double spacing-right padding-double'
- }) : null, C.a.createElement('img', {
- className: 'reveal-preview__image recommendations align-inline spacing-bottom-none',
- src: '//c.disquscdn.com/next/current/publisher-admin/assets/img/reveal_preview/recommendations.png'
- }))
- }
- eE.propTypes = {
- positionEnabled: b.a.bool.isRequired
- };
- Ls = function (e) {
- return C.a.createElement('div', {
- className: 'reveal-preview text-center'
- }, C.a.createElement('div', {
- className: 'reveal-preview__inner'
- }, C.a.createElement('img', {
- className: 'reveal-preview__image spacing-top-none',
- src: '//c.disquscdn.com/next/current/publisher-admin/assets/img/reveal_preview/site_content.png'
- }), e.adsPositionsEnabled.topEnabled ? C.a.createElement(Z_, {
- adPosition: 'Above',
- allowedLocation: 'above'
- }) : null, C.a.createElement('img', {
- className: 'reveal-preview__image',
- src: '//c.disquscdn.com/next/current/publisher-admin/assets/img/reveal_preview/comments_top.png'
- }), e.adsPositionsEnabled.inthreadEnabled ? C.a.createElement(Z_, {
- adPosition: 'In-thread',
- allowedLocation: 'within'
- }) : null, C.a.createElement('img', {
- className: 'reveal-preview__image spacing-bottom-none',
- src: '//c.disquscdn.com/next/current/publisher-admin/assets/img/reveal_preview/comments_bottom.png'
- }), e.adsPositionsEnabled.bottomEnabled ? C.a.createElement(Z_, {
- adPosition: 'Below',
- allowedLocation: 'below',
- extraClass: 'spacing-bottom-none'
- }) : null, e.recommendationsEnabled ? C.a.createElement(eE, {
- positionEnabled: !!e.adsPositionsEnabled.recommendationsEnabled
- }) : null))
- };
- Ls.displayName = 'AdPreviewer',
- Ls.propTypes = {
- adsPositionsEnabled: b.a.shape({
- topEnabled: b.a.bool,
- inthreadEnabled: b.a.bool,
- bottomEnabled: b.a.bool,
- recommendationsEnabled: b.a.bool
- }).isRequired,
- recommendationsEnabled: b.a.bool.isRequired
- };
- var tE = Ls,
- Lo = function (e) {
- var t = e.isSubHeading ? 'settings__subheading' : 'settings__header',
- n = 'text-gray'.concat(e.isSubHeading ? ' text-medium' : '');
- return C.a.createElement('header', {
- className: t
- }, C.a.createElement('h2', {
- className: 'text-gray-darker '.concat(e.isSubHeading ? 'text-large' : 'text-larger spacing-bottom-small')
- }, e.headline), e.description ? C.a.createElement('p', {
- className: n
- }, e.description) : null, e.subDescription ? C.a.createElement('p', {
- className: n
- }, e.subDescription) : null, e.children)
- };
- Lo.displayName = 'ForumSettingsHeader',
- Lo.propTypes = {
- headline: b.a.string.isRequired,
- description: b.a.node,
- subDescription: b.a.node,
- isSubHeading: b.a.bool,
- children: b.a.node
- };
- var nE = Lo;
- function aE(e) {
- return (aE = 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator ? function (e) {
- return typeof e
- }
- : function (e) {
- return e && 'function' == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? 'symbol' : typeof e
- }) (e)
- }
- function rE(t, e) {
- var n,
- a = Object.keys(t);
- return Object.getOwnPropertySymbols && (n = Object.getOwnPropertySymbols(t), e && (n = n.filter(function (e) {
- return Object.getOwnPropertyDescriptor(t, e).enumerable
- })), a.push.apply(a, n)),
- a
- }
- function oE(t) {
- for (var e = 1; e < arguments.length; e++) {
- var n = null != arguments[e] ? arguments[e] : {
- };
- e % 2 ? rE(Object(n), !0).forEach(function (e) {
- pE(t, e, n[e])
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(n)) : rE(Object(n)).forEach(function (e) {
- Object.defineProperty(t, e, Object.getOwnPropertyDescriptor(n, e))
- })
- }
- return t
- }
- function iE(e, t) {
- for (var n = 0; n < t.length; n++) {
- var a = t[n];
- a.enumerable = a.enumerable || !1,
- a.configurable = !0,
- 'value' in a && (a.writable = !0),
- Object.defineProperty(e, a.key, a)
- }
- }
- function sE(e, t) {
- return (sE = Object.setPrototypeOf || function (e, t) {
- return e.__proto__ = t,
- e
- }) (e, t)
- }
- function lE(n) {
- var a = function () {
- if ('undefined' == typeof Reflect || !Reflect.construct) return !1;
- if (Reflect.construct.sham) return !1;
- if ('function' == typeof Proxy) return !0;
- try {
- return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [
- ], function () {
- })),
- !0
- } catch (e) {
- return !1
- }
- }();
- return function () {
- var e,
- t = uE(n);
- return e = a ? (e = uE(this).constructor, Reflect.construct(t, arguments, e)) : t.apply(this, arguments),
- t = this,
- !(e = e) || 'object' !== aE(e) && 'function' != typeof e ? cE(t) : e
- }
- }
- function cE(e) {
- if (void 0 === e) throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called');
- return e
- }
- function uE(e) {
- return (uE = Object.setPrototypeOf ? Object.getPrototypeOf : function (e) {
- return e.__proto__ || Object.getPrototypeOf(e)
- }) (e)
- }
- function pE(e, t, n) {
- return t in e ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n,
- e
- }
- var dE = [
- 'adsPositionTopEnabled',
- 'adsPositionInthreadEnabled',
- 'adsPositionBottomEnabled',
- 'adsPositionRecommendationsEnabled'
- ],
- mE = [
- 'adsPositionTopEnabled',
- 'adsPositionBottomEnabled',
- 'activationStarted'
- ],
- Mo = function () {
- !function (e, t) {
- if ('function' != typeof t && null !== t) throw new TypeError('Super expression must either be null or a function');
- e.prototype = Object.create(t && t.prototype, {
- constructor: {
- value: e,
- writable: !0,
- configurable: !0
- }
- }),
- t && sE(e, t)
- }(o, A);
- var e,
- t,
- n,
- a = lE(o);
- function o(e) {
- var r;
- !function (e, t) {
- if (!(e instanceof t)) throw new TypeError('Cannot call a class as a function')
- }(this, o),
- pE(cE(r = a.call(this, e)), 'getStateFromForum', function (e) {
- e = e && e.settings || {
- };
- return {
- adsPositionTopEnabled: e.adsPositionTopEnabled,
- adsPositionInthreadEnabled: e.adsPositionInthreadEnabled,
- adsPositionBottomEnabled: e.adsPositionBottomEnabled,
- adsPositionRecommendationsEnabled: e.adsPositionRecommendationsEnabled
- }
- }),
- pE(cE(r), 'getOrganization', function () {
- return r.props.selection.organization || r.props.organizations[r.props.selection.forum.organization]
- }),
- pE(cE(r), 'isActivation', function () {
- return r.props.forumDetails && !r.props.forumDetails.settings.adsEnabled
- }),
- pE(cE(r), 'isTopBottomDisabled', function () {
- return !(r.props.selection.organization.eligibleForEarnings || r.isAdsOptional() || r.state.adsPositionTopEnabled || r.state.adsPositionBottomEnabled)
- }),
- pE(cE(r), 'isNewPolicy', function () {
- return r.props.forumDetails && r.props.forumDetails.newPolicy
- }),
- pE(cE(r), 'isAdsOptional', function () {
- return r.props.forumDetails && r.props.forumDetails.features && r.props.forumDetails.features.adsOptional
- }),
- pE(cE(r), 'adsReviewStatus', function () {
- return r.props.forumDetails && r.props.forumDetails.adsReviewStatus
- }),
- pE(cE(r), 'getImageToggleClassNameByName', function (e) {
- var t = '-'.concat(e.toLowerCase());
- return 'fieldset__card '.concat(r.state['show'.concat(e, 'ImageToggle')] ? '-show '.concat(t) : t)
- }),
- pE(cE(r), 'getAlertBar', function (e) {
- var t,
- n = !r.hasPositionEnabled(),
- a = r.isTopBottomDisabled();
- if (!e) if (n) e = 'At least one position must be allowed.';
- else {
- if (!a) return null;
- e = 'Please enable Top or Bottom placements.'
- }
- return (n && !r.isActivation() || r.isTopBottomDisabled()) && (t = r.isAdsOptional() ? r.isNewPolicy() ? C.a.createElement('span', null, ' Trying to deactivate ads? ', C.a.createElement('a', {
- href: '#deactivate'
- }, 'Start deactivation process »')) : C.a.createElement('span', null, ' Trying to deactivate ads? ', C.a.createElement(Uo, {
- path: '/settings/revenue/hub',
- selection: r.props.selection
- }, 'Start deactivation process »')) : (t = r.getOrganization(), r.isNewPolicy() ? C.a.createElement('span', null, ' Looking to remove ads? ', C.a.createElement(Us, {
- path: '/settings/subscription/',
- orgId: t.id,
- orgSlug: t.slug
- }, 'Upgrade Your Account')) : C.a.createElement('span', null, ' Looking to remove ads? ', C.a.createElement('br', null), C.a.createElement('a', {
- href: Pn.revealContact
- }, 'Contact our Publisher Support Team to upgrade your account.'), ' We\'ll get back to you shortly.'))),
- C.a.createElement(Ki, {
- message: e,
- alertType: 'error',
- topMarginClass: 'spacing-top-narrow'
- }, t)
- }),
- pE(cE(r), 'getActivationFields', function () {
- var e = mE;
- return r.props.forumDetails && r.props.forumDetails.settings.organicDiscoveryEnabled && e.push('adsPositionRecommendationsEnabled'),
- e
- }),
- pE(cE(r), 'updateActivationFields', function (n) {
- var e = r.getActivationFields();
- r.setState(e.reduce(function (e, t) {
- return oE(oE({
- }, e), {
- }, pE({
- }, t, n))
- }, {
- }))
- }),
- pE(cE(r), 'startActivation', function () {
- r.updateActivationFields(!0)
- }),
- pE(cE(r), 'cancelActivation', function () {
- r.updateActivationFields(!1)
- }),
- pE(cE(r), 'confirmDeactivation', function () {
- r.props.forumUpdateOnDisableAds().done(function (e) {
- r.setState({
- showForm: !1
- }),
- r.handleForumDetailsUpdate(e)
- })
- }),
- pE(cE(r), 'getDeactivateModule', function () {
- return r.isActivation() ? null : C.a.createElement('div', {
- className: 'content__wrap'
- }, C.a.createElement(X_, {
- isNewPolicy: r.isNewPolicy(),
- hasAdsOptional: r.isAdsOptional(),
- onDeactivate: r.confirmDeactivation,
- selection: r.props.selection,
- forumState: r.getStateFromForum(r.props.forumDetails)
- }))
- }),
- pE(cE(r), 'recommendationsTooltip', function (e, t) {
- return e ? t ? null : C.a.createElement(Ks, {
- emitEvent: function (e) {
- return r.props.emitTrackingEvent(oE({
- area: 'recommendations_ads'
- }, e))
- },
- plan: 'plus',
- height: 18,
- organization: r.getOrganization(),
- iconClass: 'spacing-left-small'
- }) : C.a.createElement(Md, {
- tooltipKey: 'ads-recommendations',
- direction: 'bottom',
- content: C.a.createElement(C.a.Fragment, null, ' Recommendations are not enabled on this forum. ', C.a.createElement(Uo, {
- key: 'recommendations-link',
- path: '/settings/recommendations/',
- selection: r.props.selection
- }, 'Enable Recommendations'))
- })
- }),
- pE(cE(r), 'handleInputChange', function (e, t) {
- r.setState(pE({
- }, e, t.target.checked), function () {
- this.props.forumUpdateValidate(this.getSaveData())
- })
- }),
- pE(cE(r), 'hasFieldChanged', function (e) {
- return r.state[e] !== r.state.savedFields[e] && !(null === r.state.savedFields[e] && '' === r.state[e])
- }),
- pE(cE(r), 'handleViewExample', function (e) {
- e = 'show'.concat(e, 'ImageToggle');
- r.setState(pE({
- }, e, !r.state[e]))
- }),
- pE(cE(r), 'getSaveData', function () {
- return dE.reduce(function (e, t) {
- return e[t] = r.state[t] ? 1 : 0,
- e
- }, {
- })
- }),
- pE(cE(r), 'handleSaveChanges', function () {
- r.props.forumUpdateOnSave(r.getSaveData()).done(r.handleForumDetailsUpdate)
- }),
- pE(cE(r), 'hasUnsavedChanges', function () {
- return Object.keys(r.state.savedFields).some(function (e) {
- return r.hasFieldChanged(e)
- })
- }),
- pE(cE(r), 'handleForumDetailsUpdate', function (e) {
- r.trackSettingsUpdated(r.props.forumDetails, e.response),
- r.setState(r.getStateFromForum(e.response), r.props.fetchForumDetails)
- }),
- pE(cE(r), 'trackSettingsUpdated', function (e, t) {
- Jo.trackSettingsChanges({
- selection: r.props.selection,
- jesterData: {
- verb: 'update',
- zone: 'settings',
- section: 'reveal'
- },
- oldState: Jo.ensureBooleans(e.settings),
- newState: Jo.ensureBooleans(t.settings),
- keys: Jo.ADS_KEYS
- })
- }),
- pE(cE(r), 'togglePreview', function () {
- r.setState(function (e) {
- return {
- isPreviewVisible: !e.isPreviewVisible
- }
- })
- }),
- pE(cE(r), 'confirmNavigationIfUnsaved', function (e) {
- if (r.hasUnsavedChanges() && '/settings/revenue/hub' !== e.pathname) return 'You have unsaved changes. Do you want to leave this page?'
- }),
- pE(cE(r), 'hasPositionEnabled', function (e) {
- return (e = e || r.state).adsPositionTopEnabled || e.adsPositionInthreadEnabled || e.adsPositionBottomEnabled
- }),
- pE(cE(r), 'adsEnabled', function (e) {
- return !e && r.hasPositionEnabled()
- });
- e = r.getStateFromForum(r.props.forumDetails);
- return r.state = oE(oE({
- }, e), {
- }, {
- alertBar: null,
- isPreviewVisible: !0,
- savedFields: e
- }),
- r
- }
- return e = o,
- (t = [
- {
- key: 'componentDidMount',
- value: function () {
- var e = this;
- this.props.history.setRouteLeaveHook(this.props.route, this.confirmNavigationIfUnsaved),
- this.props.emitTrackingEvent({
- verb: 'view',
- object_type: 'page',
- object_id: ''.concat(window.document.location.host).concat(window.document.location.pathname)
- }),
- this.props.fetchSubscription(),
- this.props.fetchForumDetails();
- var t = new window.XMLHttpRequest;
- t.open('GET', Pn.adsTxt),
- t.onreadystatechange = function () {
- t.readyState === window.XMLHttpRequest.DONE && 200 === t.status && e.setState({
- adstxt: 'disqus.com, '.concat(e.props.selection.organization.id, ', DIRECT\n').concat(t.responseText)
- })
- },
- t.send()
- }
- },
- {
- key: 'componentWillReceiveProps',
- value: function (e) {
- var t;
- this.props.forumDetails !== e.forumDetails && (t = this.getStateFromForum(e.forumDetails), this.setState(oE(oE({
- }, t), {
- }, {
- savedFields: t
- }))),
- this.props.forumUpdateIsValidating && !e.forumUpdateIsValidating && this.setState({
- alertBar: this.getAlertBar(e.forumUpdateError)
- })
- }
- },
- {
- key: 'render',
- value: function () {
- var t = this;
- if (this.props.selection.organization && this.props.selection.organization.pollsOnly) return C.a.createElement(Cm, {
- isPolls: !1,
- organization: this.props.selection.organization
- });
- var e = this.props.forumDetails && this.props.forumDetails.settings.adsSettingsLocked,
- n = e || this.props.forumUpdateIsSaving,
- a = this.isActivation(),
- r = a && !this.state.activationStarted,
- o = this.props.forumDetails && this.props.forumDetails.permissions.canEditPayments,
- i = this.props.forumDetails && this.props.forumDetails.settings.organicDiscoveryEnabled,
- s = !this.hasUnsavedChanges() || this.props.forumUpdateIsSaving || !this.adsEnabled(this.props.forumUpdateError) || this.isTopBottomDisabled(),
- l = {
- topEnabled: this.state.adsPositionTopEnabled,
- inthreadEnabled: this.state.adsPositionInthreadEnabled,
- bottomEnabled: this.state.adsPositionBottomEnabled,
- recommendationsEnabled: this.state.adsPositionRecommendationsEnabled
- },
- c = this.isAdsOptional(),
- u = !c && this.state.adsPositionTopEnabled,
- p = !c && this.state.adsPositionRecommendationsEnabled;
- return this.props.forumDetailsIsFetching && !this.props.forumDetails ? C.a.createElement(Ji, null) : this.props.forumDetailsError ? C.a.createElement('div', {
- className: 'content__wrap spacing-bottom-double'
- }, C.a.createElement(Ki, {
- message: this.props.forumDetailsError,
- alertType: 'error'
- })) : this.props.forumDetails ? C.a.createElement('div', {
- className: 'layout__main'
- }, C.a.createElement('div', {
- className: 'content__wrap'
- }, C.a.createElement(nE, {
- headline: 'Ads Configuration',
- description: r ? null : 'Control the content and visual layout of the ads Disqus serves on your site.'
- }, r ? C.a.createElement(Ki, {
- alertType: 'error',
- message: C.a.createElement('span', null, 'Ads are currently deactivated. ', C.a.createElement('span', {
- className: 'link link-inverted-opaque',
- onClick: this.startActivation
- }, 'Activate ads now »'))
- }) : null), r ? null : C.a.createElement('section', {
- className: 'settings__content'
- }, e ? C.a.createElement('div', {
- className: 'ads-settings-inner alert alert--warning spacing-narrow text-medium'
- }, C.a.createElement('span', {
- className: 'help-block'
- }, C.a.createElement('strong', null, 'Looking to change the ad types on your site?'), C.a.createElement('br', null), C.a.createElement('a', {
- href: Pn.revealContact
- }, 'Contact our Publisher Support Team directly'), '. We\'d be happy to help.')) : null, C.a.createElement(nE, {
- isSubHeading: !0,
- headline: 'Positions',
- description: 'Disqus will only display ads in the positions that you select below:'
- }), C.a.createElement(Ob, {
- name: 'adsTop',
- checked: this.state.adsPositionTopEnabled,
- label: 'Above Comments',
- secondaryLabel: C.a.createElement(C.a.Fragment, null, 'Allow ads above the comments.', u ? C.a.createElement(Ks, {
- emitEvent: function (e) {
- return t.props.emitTrackingEvent(oE({
- area: 'top_ads'
- }, e))
- },
- plan: 'plus',
- height: 18,
- organization: this.getOrganization(),
- iconClass: 'spacing-left-small'
- }) : null),
- readOnly: n || u,
- idNamespace: this.constructor.displayName,
- onChange: this.handleInputChange.bind(this, 'adsPositionTopEnabled'),
- shouldHighlight: this.hasFieldChanged('adsPositionTopEnabled')
- }), C.a.createElement(Ob, {
- name: 'adsInthread',
- checked: this.state.adsPositionInthreadEnabled,
- label: 'In-thread',
- secondaryLabel: 'Allow ads within comments.',
- readOnly: n,
- idNamespace: this.constructor.displayName,
- onChange: this.handleInputChange.bind(this, 'adsPositionInthreadEnabled'),
- shouldHighlight: this.hasFieldChanged('adsPositionInthreadEnabled')
- }), C.a.createElement(Ob, {
- name: 'adsBottom',
- checked: this.state.adsPositionBottomEnabled,
- label: 'Below Comments',
- secondaryLabel: 'Allow ads below the comments.',
- readOnly: n,
- idNamespace: this.constructor.displayName,
- onChange: this.handleInputChange.bind(this, 'adsPositionBottomEnabled'),
- shouldHighlight: this.hasFieldChanged('adsPositionBottomEnabled')
- }), C.a.createElement(Ob, {
- name: 'adsRecommendations',
- checked: this.state.adsPositionRecommendationsEnabled && i,
- label: 'Recommendations',
- secondaryLabel: C.a.createElement(C.a.Fragment, null, 'Allow ads in Recommendations.', this.recommendationsTooltip(i, c)),
- readOnly: n || p || !i,
- idNamespace: this.constructor.displayName,
- onChange: this.handleInputChange.bind(this, 'adsPositionRecommendationsEnabled'),
- shouldHighlight: this.hasFieldChanged('adsPositionRecommendationsEnabled')
- }), C.a.createElement('div', {
- className: 'spacing-top-double'
- }, this.state.alertBar, C.a.createElement(Bh, {
- disabled: s,
- buttonLabel: a ? 'Activate Ads' : void 0,
- onClick: this.handleSaveChanges,
- isSaving: this.props.forumUpdateIsSaving,
- isSaved: this.props.forumUpdateIsSaved
- }, a ? C.a.createElement('button', {
- onClick: this.cancelActivation,
- className: 'button button-outline button-padding-wider button-medium spacing-left'
- }, 'Cancel') : null), C.a.createElement('div', {
- className: 'fieldset fieldset--save spacing-top'
- }, C.a.createElement('div', {
- className: 'fieldset__label'
- }), C.a.createElement('div', {
- className: 'fieldset__block'
- }, C.a.createElement('button', {
- className: 'button button-fill button-medium',
- onClick: this.togglePreview
- }, this.state.isPreviewVisible ? 'Hide Preview' : 'Show Preview', C.a.createElement('span', {
- className: 'spacing-left-small icon icon-arrow'
- }))))), this.state.isPreviewVisible ? C.a.createElement('div', {
- className: 'spacing-top-double'
- }, C.a.createElement(tE, {
- adsPositionsEnabled: l,
- recommendationsEnabled: i
- })) : null)), this.state.adstxt && !r ? C.a.createElement('div', {
- className: 'content__wrap'
- }, C.a.createElement(nE, {
- headline: 'Ads.txt',
- description: C.a.createElement('span', null, 'To ensure you\'re maximizing your ad revenue, please copy and paste the following up-to-date ads.txt lines onto your site. Need help? Check out ', C.a.createElement('a', {
- href: 'https://help.disqus.com/en/articles/1765357-ads-txt-implementation-guide',
- target: '_blank',
- rel: 'noopener noreferrer'
- }, 'our implementation guide'), ' for some quick and easy instructions.')
- }), C.a.createElement('section', {
- className: 'settings__content'
- }, C.a.createElement($h, {
- name: 'adsTxt',
- value: this.state.adstxt,
- label: 'Ads.txt lines',
- idNamespace: this.constructor.displayName,
- inputOverrideClassName: 'input--textbox adstxt-lines',
- readOnly: !0,
- disabled: !0,
- useTextarea: !0,
- onChange: function () {
- }
- }), C.a.createElement('div', {
- className: 'fieldset fieldset--save'
- }, C.a.createElement('div', {
- className: 'fieldset__label'.concat(this.state.adsTxtCopied ? ' is-copied' : '')
- }, C.a.createElement('div', {
- className: this.state.adsTxtCopied ? 'icon-checkmark' : ''
- })), C.a.createElement('div', {
- className: 'fieldset__block'
- }, C.a.createElement('button', {
- className: 'button button-fill--brand button-padding-wider button-medium',
- onClick: function () {
- window.navigator.clipboard.writeText(t.state.adstxt),
- t.setState({
- adsTxtCopied: !0
- }),
- setTimeout(function () {
- return t.setState({
- adsTxtCopied: !1
- })
- }, 1000)
- }
- }, 'Copy to clipboard'))))) : null, C.a.createElement('div', {
- className: 'content__wrap'
- }, C.a.createElement(nE, {
- headline: 'Payment',
- description: 'Control the way Disqus pays your site for earnings.'
- }), C.a.createElement('section', {
- className: 'settings__content'
- }, C.a.createElement('div', {
- className: 'fieldset'
- }, C.a.createElement('label', {
- className: 'fieldset__label text-gray'
- }, 'Payment Information'), C.a.createElement('div', {
- className: 'fieldset__block'
- }, o ? C.a.createElement('a', {
- target: '_blank',
- rel: 'noopener noreferrer',
- href: this.props.selection.forum.tipaltiUrl,
- className: 'button button-fill button-medium'
- }, 'Set up or update your payment method »') : C.a.createElement('strong', {
- className: 'text-gray text-small'
- }, 'Sorry! It seems you do not have permission to manage payment information.'), C.a.createElement('p', {
- className: 'fieldset__description text-small text-gray'
- }, 'Payments will be made by the end of the month for the previous quarter\'s earnings. ', C.a.createElement('a', {
- href: Pn.payments
- }, 'Learn more »')))))), r ? null : C.a.createElement('div', {
- className: 'content__wrap'
- }, C.a.createElement(nE, {
- headline: 'Advanced',
- description: 'General site settings that affect ads.'
- }), C.a.createElement('section', {
- className: 'settings__content'
- }, C.a.createElement(kf, {
- label: 'Appearance',
- blockAdditionalClass: 'fieldset__block--text text-medium',
- tooltip: C.a.createElement(C.a.Fragment, null, 'Ads take on the site\'s appearance settings. ', C.a.createElement(Uo, {
- path: '/settings/general/',
- selection: this.props.selection
- }, 'Modify site apperance.'))
- }, C.a.createElement('div', {
- className: 'align text-medium'
- }, C.a.createElement('div', {
- className: 'spacing-right fieldset-item__select'
- }, C.a.createElement('strong', null, 'Color Scheme'), C.a.createElement('br', null), uf[this.props.forumDetails.colorScheme]), C.a.createElement('div', {
- className: 'spacing-right fieldset-item__select'
- }, C.a.createElement('strong', null, 'Typography'), C.a.createElement('br', null), sf[this.props.forumDetails.typeface]))), C.a.createElement(kf, {
- label: 'Category',
- blockAdditionalClass: 'fieldset__block--text text-medium',
- tooltip: C.a.createElement(C.a.Fragment, null, 'Ads are affected by your site category. ', C.a.createElement(Uo, {
- path: '/settings/general/',
- selection: this.props.selection
- }, 'Modify site category.'))
- }, C.a.createElement('p', {
- className: 'text-medium'
- }, this.props.forumDetails.forumCategory ? this.props.forumDetails.forumCategory.name : C.a.createElement('em', null, 'Uncategorized'))))), C.a.createElement('div', {
- className: 'content__wrap'
- }, C.a.createElement('div', {
- className: 'padding-default border-bottom text-gray-dark text-center text-medium'
- }, C.a.createElement('p', {
- className: 'spacing-narrow'
- }, 'Need help? ', 'Want to earn more?'), C.a.createElement('a', {
- href: Pn.revealContact,
- className: 'button button-outline button-medium button-wide'
- }, 'Talk to our Publisher Support Team'))), this.getDeactivateModule()) : null
- }
- }
- ]) && iE(e.prototype, t),
- n && iE(e, n),
- o
- }();
- pE(Mo, 'displayName', 'ForumSettingsAds'),
- pE(Mo, 'propTypes', {
- history: b.a.shape({
- setRouteLeaveHook: b.a.func.isRequired
- }).isRequired,
- route: b.a.object.isRequired,
- organizations: b.a.object.isRequired,
- selection: ht.isRequired,
- fetchForumDetails: b.a.func.isRequired,
- forumUpdateOnSave: b.a.func.isRequired,
- forumUpdateOnDisableAds: b.a.func.isRequired,
- forumUpdateValidate: b.a.func.isRequired,
- forumUpdateIsValidating: b.a.bool.isRequired,
- emitTrackingEvent: b.a.func.isRequired,
- forumDetails: $c,
- forumDetailsError: b.a.string,
- forumDetailsIsFetching: b.a.bool,
- forumUpdateIsSaving: b.a.bool,
- forumUpdateIsSaved: b.a.bool,
- forumUpdateError: b.a.string,
- fetchSubscription: b.a.func.isRequired,
- orgCurrentPackage: Ur.PACKAGE_SHAPE
- }),
- pE(Mo, 'contextTypes', {
- auth: b.a.object
- });
- var ai = Object(u.connect) (function (e) {
- var t = e.forumDetails;
- return {
- forumDetails: t.forumDetails,
- forumDetailsError: t.forumDetailsError,
- forumDetailsIsFetching: t.forumDetailsIsFetching,
- orgCurrentPackage: e.subscription.orgCurrentPackage,
- selection: e.selection
- }
- }, {
- emitTrackingEvent: Xo({
- zone: 'settings',
- section: 'ads'
- }),
- fetchForumDetails: ig,
- fetchSubscription: Hl
- }) (Ni.a.attachDrivers(Fo() (Mo), [
- m,
- bc
- ])),
- di = n(169),
- fE = n.n(di);
- function hE() {
- return (hE = Object.assign || function (e) {
- for (var t = 1; t < arguments.length; t++) {
- var n,
- a = arguments[t];
- for (n in a) Object.prototype.hasOwnProperty.call(a, n) && (e[n] = a[n])
- }
- return e
- }).apply(this, arguments)
- }
- var gE = Object.freeze({
- campaign: 'engage-reveal-policy',
- action: 'agree'
- });
- function yE(e) {
- return (yE = 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator ? function (e) {
- return typeof e
- }
- : function (e) {
- return e && 'function' == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? 'symbol' : typeof e
- }) (e)
- }
- function bE(e, t) {
- for (var n = 0; n < t.length; n++) {
- var a = t[n];
- a.enumerable = a.enumerable || !1,
- a.configurable = !0,
- 'value' in a && (a.writable = !0),
- Object.defineProperty(e, a.key, a)
- }
- }
- function vE(e, t) {
- return (vE = Object.setPrototypeOf || function (e, t) {
- return e.__proto__ = t,
- e
- }) (e, t)
- }
- function _E(n) {
- var a = function () {
- if ('undefined' == typeof Reflect || !Reflect.construct) return !1;
- if (Reflect.construct.sham) return !1;
- if ('function' == typeof Proxy) return !0;
- try {
- return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [
- ], function () {
- })),
- !0
- } catch (e) {
- return !1
- }
- }();
- return function () {
- var e,
- t = EE(n);
- return e = a ? (e = EE(this).constructor, Reflect.construct(t, arguments, e)) : t.apply(this, arguments),
- t = this,
- !(e = e) || 'object' !== yE(e) && 'function' != typeof e ? function (e) {
- if (void 0 !== e) return e;
- throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called')
- }(t) : e
- }
- }
- function EE(e) {
- return (EE = Object.setPrototypeOf ? Object.getPrototypeOf : function (e) {
- return e.__proto__ || Object.getPrototypeOf(e)
- }) (e)
- }
- function OE(e, t, n) {
- return t in e ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n,
- e
- }
- var SE = [
- {
- key: 'section1',
- header: 'What is Disqus?',
- text: C.a.createElement('span', null, 'Disqus is a platform for publishers to build and engage with their audiences. ', C.a.createElement('strong', null, 'Engage'), ' is the most popular comment system used across the web, and ', C.a.createElement('strong', null, 'Reveal'), ' is the integrated system that helps publishers earn incremental revenue through advertising.')
- },
- {
- key: 'section2',
- header: 'What is Disqus Engage? The world\'s most popular comment system',
- text: C.a.createElement('span', null, 'Engage by Disqus makes building and managing communities easier for publishers. Millions of people already use Disqus to post more than 50 million comments every month. It\'s easy to install using a plugin or universal code, so you can get going right away!')
- },
- {
- key: 'section3',
- header: 'What is Disqus Reveal? Do I have to use it?',
- text: C.a.createElement('span', null, 'Reveal helps publishers generate revenue through integrated ads and keeps Disqus free to use. Reveal is a default part of Disqus. If advertising is not a good fit for your site, we offer an ad-free version of Disqus for an affordable monthly subscription.')
- }
- ],
- wi = function () {
- !function (e, t) {
- if ('function' != typeof t && null !== t) throw new TypeError('Super expression must either be null or a function');
- e.prototype = Object.create(t && t.prototype, {
- constructor: {
- value: e,
- writable: !0,
- configurable: !0
- }
- }),
- t && vE(e, t)
- }(r, A);
- var e,
- t,
- n,
- a = _E(r);
- function r() {
- return function (e, t) {
- if (!(e instanceof t)) throw new TypeError('Cannot call a class as a function')
- }(this, r),
- a.apply(this, arguments)
- }
- return e = r,
- (t = [
- {
- key: 'componentWillUnmount',
- value: function () {
- this.props.abortPolicyApiCall()
- }
- },
- {
- key: 'render',
- value: function () {
- return C.a.createElement('div', null, C.a.createElement('header', {
- className: 'alert--brand padding-default border-radius-sm-top'
- }, C.a.createElement('div', {
- className: 'text-center spacing-top-narrow spacing-bottom-narrow'
- }, C.a.createElement('strong', null, 'Welcome to Disqus!'))), C.a.createElement('section', {
- className: 'settings__content'
- }, C.a.createElement('div', {
- className: 'align-min-tablet align--middle'
- }, C.a.createElement('div', {
- className: 'text-center-sm policy__content'
- }, SE.map(function (e) {
- return C.a.createElement('div', {
- key: e.key,
- className: 'spacing-top-double'
- }, C.a.createElement('h3', null, e.header), C.a.createElement('p', null, e.text))
- })), C.a.createElement('div', {
- className: 'spacing-left-double text-center relative__wrapper'
- }, C.a.createElement('img', {
- src: '//c.disquscdn.com/next/current/publisher-admin/assets/img/policy/engage-reveal.png',
- className: 'img-responsive img-block spacing-center',
- width: '300'
- }), C.a.createElement('div', {
- className: 'policy__link'
- }, C.a.createElement('a', {
- href: 'https://disqus.com/features/?utm_source=policy&utm_medium=web',
- target: '_blank',
- rel: 'noopener noreferrer'
- }, C.a.createElement('strong', null, 'Learn how they work together.')))))), C.a.createElement('footer', {
- className: 'settings__footer'
- }, C.a.createElement('button', {
- className: 'button button-outline button-wide button-large',
- onClick: this.props.policyOnAgree.bind(null, this.props.history, this.props.isBaseInstallPath),
- disabled: this.props.policyIsSaving
- }, 'Got it. Let\'s get started!')))
- }
- }
- ]) && bE(e.prototype, t),
- n && bE(e, n),
- r
- }();
- OE(wi, 'displayName', 'SetupPolicyContent'),
- OE(wi, 'propTypes', {
- history: b.a.object.isRequired,
- selection: ht.isRequired,
- policyOnAgree: b.a.func.isRequired,
- policyIsSaving: b.a.bool
- });
- var wE = Object(u.connect) (function (e) {
- return {
- policyIsSaving: e.policy.policyIsSaving
- }
- }, {
- abortPolicyApiCall: function () {
- return function (e, t) {
- t = t().policy.apiCall;
- t && 'pending' === t.state() && t.abort()
- }
- },
- policyOnAgree: function (n, a) {
- return function (e, t) {
- e({
- type: le.saving
- });
- t = hE({
- organization: t().selection.organization.id
- }, gE),
- t = io.a.call('organizations/campaigns/performAction', {
- data: t,
- method: 'POST'
- }).always(function (e, t, n) {
- n({
- type: le.onSave
- });
- t = ho.getRoute(t ? '/install/' : '/settings/install/');
- e.push(t)
- }.bind(null, n, a, e));
- return e({
- type: le.setApiCall,
- apiCall: t
- }),
- t
- }
- }
- }) (wi);
- function PE(e) {
- return (PE = 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator ? function (e) {
- return typeof e
- }
- : function (e) {
- return e && 'function' == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? 'symbol' : typeof e
- }) (e)
- }
- function kE(e, t) {
- for (var n = 0; n < t.length; n++) {
- var a = t[n];
- a.enumerable = a.enumerable || !1,
- a.configurable = !0,
- 'value' in a && (a.writable = !0),
- Object.defineProperty(e, a.key, a)
- }
- }
- function NE(e, t) {
- return (NE = Object.setPrototypeOf || function (e, t) {
- return e.__proto__ = t,
- e
- }) (e, t)
- }
- function CE(n) {
- var a = function () {
- if ('undefined' == typeof Reflect || !Reflect.construct) return !1;
- if (Reflect.construct.sham) return !1;
- if ('function' == typeof Proxy) return !0;
- try {
- return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [
- ], function () {
- })),
- !0
- } catch (e) {
- return !1
- }
- }();
- return function () {
- var e,
- t = xE(n);
- return e = a ? (e = xE(this).constructor, Reflect.construct(t, arguments, e)) : t.apply(this, arguments),
- t = this,
- !(e = e) || 'object' !== PE(e) && 'function' != typeof e ? RE(t) : e
- }
- }
- function RE(e) {
- if (void 0 === e) throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called');
- return e
- }
- function xE(e) {
- return (xE = Object.setPrototypeOf ? Object.getPrototypeOf : function (e) {
- return e.__proto__ || Object.getPrototypeOf(e)
- }) (e)
- }
- function AE(e, t, n) {
- return t in e ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n,
- e
- }
- Fi = function () {
- !function (e, t) {
- if ('function' != typeof t && null !== t) throw new TypeError('Super expression must either be null or a function');
- e.prototype = Object.create(t && t.prototype, {
- constructor: {
- value: e,
- writable: !0,
- configurable: !0
- }
- }),
- t && NE(e, t)
- }(o, A);
- var e,
- t,
- n,
- r = CE(o);
- function o() {
- var e;
- !function (e, t) {
- if (!(e instanceof t)) throw new TypeError('Cannot call a class as a function')
- }(this, o);
- for (var t = arguments.length, n = Array(t), a = 0; a < t; a++) n[a] = arguments[a];
- return AE(RE(e = r.call.apply(r, [
- this
- ].concat(n))), 'state', {
- policyModalOpen: !!fE() ().setup
- }),
- e
- }
- return e = o,
- (t = [
- {
- key: 'componentWillReceiveProps',
- value: function () {
- this.setState({
- policyModalOpen: !!fE() ().setup
- })
- }
- },
- {
- key: 'render',
- value: function () {
- var t = this;
- return this.props.selection.organization && this.props.selection.organization.pollsOnly ? C.a.createElement(Cm, {
- isPolls: !1,
- organization: this.props.selection.organization
- }) : C.a.createElement('div', null, C.a.createElement('div', {
- className: 'content__wrap'
- }, C.a.createElement('header', {
- className: 'settings__header'
- }, C.a.createElement('h2', {
- className: 'text-larger text-gray-darker spacing-bottom-small'
- }, 'What platform is your site on?')), C.a.createElement('div', {
- className: 'align align--wrap align--install spacing-top'
- }, vf.map(function (e) {
- return C.a.createElement('div', {
- className: 'platform-list__option',
- key: e.id
- }, C.a.createElement(Uo, {
- path: '/settings/'.concat(e.id, '/'),
- linkClassName: 'text-large link-gray-darker',
- selection: t.props.selection
- }, C.a.createElement('div', {
- className: 'platform-list__icon -'.concat(e.id)
- }, C.a.createElement('img', {
- src: '//c.disquscdn.com/next/current/publisher-admin/assets/img/install_icons/'.concat(e.id, '.png'),
- alt: e.name,
- height: '64',
- width: '64'
- })), e.name))
- })), C.a.createElement('div', {
- className: 'align align--around spacing-top-quad spacing-bottom-quad'
- }, C.a.createElement(Uo, {
- path: '/settings/universalcode/',
- linkClassName: 'text-large',
- selection: this.props.selection
- }, C.a.createElement('div', {
- className: 'platform-list__universal align align--middle'
- }, C.a.createElement('img', {
- src: '//c.disquscdn.com/next/current/publisher-admin/assets/img/install_icons/universal-code.svg',
- alt: 'Universal Code',
- height: '64',
- width: '64'
- }), C.a.createElement('span', null, 'I don\'t see my platform listed, install manually with ', C.a.createElement('strong', null, 'Universal Code'))))), C.a.createElement(_.a, {
- className: 'admin-modal -widest -clipped',
- overlayClassName: 'modal-overlay',
- isOpen: this.state.policyModalOpen,
- onRequestClose: null
- }, C.a.createElement(wE, {
- selection: this.props.selection,
- history: this.props.history
- }))))
- }
- }
- ]) && kE(e.prototype, t),
- n && kE(e, n),
- o
- }();
- AE(Fi, 'displayName', 'ForumSettingsInstall'),
- AE(Fi, 'propTypes', {
- history: b.a.object.isRequired,
- selection: ht.isRequired
- });
- Yi = Object(u.connect) (function (e) {
- return {
- selection: e.selection
- }
- }) (Fo() (Fi)),
- Vi = {
- fetch: function (e) {
- return function (t) {
- t({
- type: te.fetching
- }),
- io.a.call('forums/webhooks/list', {
- data: {
- forum: e
- },
- success: function (e) {
- t({
- type: te.onFetch,
- subscriptionList: e.response
- })
- },
- error: function () {
- t({
- type: te.onFetchError,
- message: 'An error occurred trying to fetch your webhook subscriptions.'
- })
- }
- })
- }
- },
- save: function (n, a) {
- return function (t) {
- t({
- type: te.saving
- });
- var e = {
- subscription: n.id,
- enableSending: n.enableSending ? 1 : 0
- };
- (a.url || a.secret) && (e.url = n.url, e.secret = n.secret),
- io.a.call('forums/webhooks/update', {
- method: 'POST',
- data: e,
- success: function (e) {
- t({
- type: te.onSave,
- savedSubscription: e.response
- })
- },
- error: function () {
- t({
- type: te.onSaveError,
- message: 'An error occurred trying to save your webhook subscription.'
- })
- }
- })
- }
- },
- selectSubscription: function (t) {
- return function (e) {
- e({
- type: te.selectSubscription,
- subscription: t
- })
- }
- },
- updateInput: function (t, n) {
- return function (e) {
- e({
- type: te.updateInput,
- name: t,
- evt: n
- })
- }
- }
- };
- function DE(e) {
- return (DE = 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator ? function (e) {
- return typeof e
- }
- : function (e) {
- return e && 'function' == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? 'symbol' : typeof e
- }) (e)
- }
- function jE(e, t) {
- for (var n = 0; n < t.length; n++) {
- var a = t[n];
- a.enumerable = a.enumerable || !1,
- a.configurable = !0,
- 'value' in a && (a.writable = !0),
- Object.defineProperty(e, a.key, a)
- }
- }
- function TE(e, t) {
- return (TE = Object.setPrototypeOf || function (e, t) {
- return e.__proto__ = t,
- e
- }) (e, t)
- }
- function IE(n) {
- var a = function () {
- if ('undefined' == typeof Reflect || !Reflect.construct) return !1;
- if (Reflect.construct.sham) return !1;
- if ('function' == typeof Proxy) return !0;
- try {
- return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [
- ], function () {
- })),
- !0
- } catch (e) {
- return !1
- }
- }();
- return function () {
- var e,
- t = FE(n);
- return e = a ? (e = FE(this).constructor, Reflect.construct(t, arguments, e)) : t.apply(this, arguments),
- t = this,
- !(e = e) || 'object' !== DE(e) && 'function' != typeof e ? qE(t) : e
- }
- }
- function qE(e) {
- if (void 0 === e) throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called');
- return e
- }
- function FE(e) {
- return (FE = Object.setPrototypeOf ? Object.getPrototypeOf : function (e) {
- return e.__proto__ || Object.getPrototypeOf(e)
- }) (e)
- }
- function LE(e, t, n) {
- return t in e ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n,
- e
- }
- yc = function () {
- !function (e, t) {
- if ('function' != typeof t && null !== t) throw new TypeError('Super expression must either be null or a function');
- e.prototype = Object.create(t && t.prototype, {
- constructor: {
- value: e,
- writable: !0,
- configurable: !0
- }
- }),
- t && TE(e, t)
- }(o, A);
- var e,
- t,
- n,
- r = IE(o);
- function o() {
- var t;
- !function (e, t) {
- if (!(e instanceof t)) throw new TypeError('Cannot call a class as a function')
- }(this, o);
- for (var e = arguments.length, n = Array(e), a = 0; a < e; a++) n[a] = arguments[a];
- return LE(qE(t = r.call.apply(r, [
- this
- ].concat(n))), 'getListPlaceholderContent', function () {
- var e = t.props.forumWebhooks;
- return e.fetchError ? C.a.createElement('div', {
- className: 'spacing-default'
- }, C.a.createElement(Ki, {
- message: e.fetchError,
- alertType: 'error'
- })) : e.isFetching ? C.a.createElement(Ji, null) : (e.subscriptionList || [
- ]).length ? null : C.a.createElement('p', {
- className: 'text-small text-gray text-center padding-double'
- }, 'This site has no webhook subscriptions yet.')
- }),
- t
- }
- return e = o,
- (t = [
- {
- key: 'componentDidMount',
- value: function () {
- this.props.fetchSubscriptions(this.props.selection.forum.shortname)
- }
- },
- {
- key: 'render',
- value: function () {
- var t = this;
- if (this.props.selection.organization && this.props.selection.organization.pollsOnly) return C.a.createElement(Cm, {
- isPolls: !1,
- organization: this.props.selection.organization
- });
- var n = this.props.forumWebhooks,
- e = n.subscriptionList || [
- ],
- a = n.selectedSubscription;
- return C.a.createElement('div', null, a ? C.a.createElement('div', {
- className: 'content__wrap spacing-bottom-double'
- }, C.a.createElement('header', {
- className: 'settings__header'
- }, C.a.createElement('h2', {
- className: 'text-larger text-gray-darker spacing-bottom-small'
- }, 'Edit Webhook Subscription'), C.a.createElement('button', {
- className: 'button button-link padding-small',
- onClick: this.props.onSelectSubscription.bind(null, null)
- }, '« Back to list')), C.a.createElement('section', null, C.a.createElement('div', {
- className: 'settings-list__item'
- }, n.saveError ? C.a.createElement(Ki, {
- message: n.saveError,
- alertType: 'error'
- }) : null, C.a.createElement($h, {
- name: 'url',
- value: a.url,
- label: 'Webhook URL',
- onChange: this.props.onSubscriptionInputChange.bind(null, 'url'),
- idNamespace: this.constructor.displayName,
- readOnly: n.isSaving,
- disabled: n.isSaving
- }), C.a.createElement($h, {
- name: 'secret',
- value: a.secret,
- label: 'Secret Key',
- onChange: this.props.onSubscriptionInputChange.bind(null, 'secret'),
- idNamespace: this.constructor.displayName,
- readOnly: n.isSaving,
- disabled: n.isSaving
- }), C.a.createElement(Ob, {
- name: 'enableSending',
- checked: a.enableSending,
- label: 'Enabled',
- secondaryLabel: 'Enable sending events',
- onChange: this.props.onSubscriptionInputChange.bind(null, 'enableSending'),
- idNamespace: this.constructor.displayName,
- readOnly: n.isSaving
- }))), C.a.createElement('footer', {
- className: 'settings__footer'
- }, C.a.createElement(Bh, {
- onClick: this.props.onSaveSubscription.bind(null, a, n.changedInputs),
- isSaving: n.isSaving,
- isSaved: n.isSaved,
- disabled: 0 === Object.keys(n.changedInputs).length
- }))) : C.a.createElement('div', {
- className: 'content__wrap spacing-bottom-double'
- }, C.a.createElement('header', {
- className: 'settings__header'
- }, C.a.createElement('h2', {
- className: 'text-larger text-gray-darker spacing-bottom-small'
- }, 'Manage Webhooks'), C.a.createElement('p', {
- className: 'text-gray'
- }, 'Webhooks allow another service to be notified when comments are posted or updated for this site. ', C.a.createElement('a', {
- href: Pn.webhooks,
- target: '_blank',
- rel: 'noopener noreferrer'
- }, 'Learn more »'))), C.a.createElement('section', null, this.getListPlaceholderContent(), e.map(function (e) {
- return C.a.createElement('div', {
- className: 'settings-list__item',
- key: e.id
- }, C.a.createElement('div', {
- className: 'align align--between'
- }, C.a.createElement('div', {
- className: 'spacing-right align'
- }, C.a.createElement('div', null, C.a.createElement('a', {
- href: e.url,
- className: 'text-medium text-semibold'
- }, e.url), C.a.createElement('p', {
- className: 'text-small text-gray'
- }, 'Status: ', C.a.createElement('strong', null, e.enableSending ? 'Enabled' : 'Paused')))), C.a.createElement('div', {
- className: 'align-min-tablet align--middle spacing-top-small spacing-bottom-small'
- }, C.a.createElement('button', {
- className: 'button button-outline text-medium',
- onClick: t.props.onSelectSubscription.bind(null, e),
- disabled: n.isFetching
- }, 'Edit'))))
- }))))
- }
- }
- ]) && jE(e.prototype, t),
- n && jE(e, n),
- o
- }();
- LE(yc, 'displayName', 'ForumSettingsWebhooks'),
- LE(yc, 'propTypes', {
- selection: ht.isRequired,
- fetchSubscriptions: b.a.func.isRequired,
- onSaveSubscription: b.a.func.isRequired,
- onSelectSubscription: b.a.func.isRequired,
- onSubscriptionInputChange: b.a.func.isRequired,
- forumWebhooks: b.a.shape({
- changedInputs: b.a.object.isRequired,
- subscriptionList: b.a.arrayOf(b.a.any),
- isSaved: b.a.bool,
- isSaving: b.a.bool,
- isFetching: b.a.bool,
- fetchError: b.a.string,
- saveError: b.a.string
- }).isRequired
- });
- var Li = Object(u.connect) (function (e) {
- return {
- forumWebhooks: e.forumWebhooks,
- selection: e.selection
- }
- }, {
- fetchSubscriptions: Vi.fetch,
- onSaveSubscription: Vi.save,
- onSelectSubscription: Vi.selectSubscription,
- onSubscriptionInputChange: Vi.updateInput
- }) (yc),
- Pc = n(319),
- UE = n.n(Pc);
- function ME(e) {
- return (ME = 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator ? function (e) {
- return typeof e
- }
- : function (e) {
- return e && 'function' == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? 'symbol' : typeof e
- }) (e)
- }
- function BE(e, t) {
- for (var n = 0; n < t.length; n++) {
- var a = t[n];
- a.enumerable = a.enumerable || !1,
- a.configurable = !0,
- 'value' in a && (a.writable = !0),
- Object.defineProperty(e, a.key, a)
- }
- }
- function zE(e, t) {
- return (zE = Object.setPrototypeOf || function (e, t) {
- return e.__proto__ = t,
- e
- }) (e, t)
- }
- function HE(n) {
- var a = function () {
- if ('undefined' == typeof Reflect || !Reflect.construct) return !1;
- if (Reflect.construct.sham) return !1;
- if ('function' == typeof Proxy) return !0;
- try {
- return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [
- ], function () {
- })),
- !0
- } catch (e) {
- return !1
- }
- }();
- return function () {
- var e,
- t = VE(n);
- return e = a ? (e = VE(this).constructor, Reflect.construct(t, arguments, e)) : t.apply(this, arguments),
- t = this,
- !(e = e) || 'object' !== ME(e) && 'function' != typeof e ? GE(t) : e
- }
- }
- function GE(e) {
- if (void 0 === e) throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called');
- return e
- }
- function VE(e) {
- return (VE = Object.setPrototypeOf ? Object.getPrototypeOf : function (e) {
- return e.__proto__ || Object.getPrototypeOf(e)
- }) (e)
- }
- function WE(e, t, n) {
- return t in e ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n,
- e
- }
- Cl = function () {
- !function (e, t) {
- if ('function' != typeof t && null !== t) throw new TypeError('Super expression must either be null or a function');
- e.prototype = Object.create(t && t.prototype, {
- constructor: {
- value: e,
- writable: !0,
- configurable: !0
- }
- }),
- t && zE(e, t)
- }(o, A);
- var e,
- t,
- n,
- r = HE(o);
- function o() {
- var e;
- !function (e, t) {
- if (!(e instanceof t)) throw new TypeError('Cannot call a class as a function')
- }(this, o);
- for (var t = arguments.length, n = Array(t), a = 0; a < t; a++) n[a] = arguments[a];
- return WE(GE(e = r.call.apply(r, [
- this
- ].concat(n))), 'state', {
- hasCopied: !1
- }),
- WE(GE(e), 'copyToClipboard', function (e) {
- var t = window.document.createElement('textarea');
- t.value = e,
- t.setAttribute('readonly', ''),
- t.style.position = 'absolute',
- t.style.left = '-9999px',
- window.document.body.appendChild(t),
- t.select(),
- window.document.execCommand('copy')
- }),
- WE(GE(e), 'handleCopyClick', function () {
- e.state.hasCopied || (e.copyToClipboard(e.props.children), e.setState({
- hasCopied: !0
- }), setTimeout(function () {
- e.setState({
- hasCopied: !1
- })
- }, 5000))
- }),
- e
- }
- return e = o,
- (t = [
- {
- key: 'componentDidMount',
- value: function () {
- UE.a.highlightBlock(this.node)
- }
- },
- {
- key: 'render',
- value: function () {
- var t = this;
- return C.a.createElement('div', {
- className: 'codeblock-wrapper'
- }, C.a.createElement('pre', {
- className: this.props.language,
- ref: function (e) {
- return t.node = e
- }
- }, C.a.createElement('code', {
- className: 'highlight-'.concat(this.props.language).concat(this.props.inline ? ' inline' : '')
- }, this.props.children)), C.a.createElement('button', {
- className: 'codeblock-copy-button',
- onClick: this.handleCopyClick
- }, this.state.hasCopied ? 'Copied' : 'Copy'))
- }
- }
- ]) && BE(e.prototype, t),
- n && BE(e, n),
- o
- }();
- Cl.defaultProps = {
- language: 'html'
- },
- Cl.propTypes = {
- language: b.a.string,
- inline: b.a.bool,
- children: b.a.node
- };
- var YE = Cl;
- function QE(e) {
- return (QE = 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator ? function (e) {
- return typeof e
- }
- : function (e) {
- return e && 'function' == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? 'symbol' : typeof e
- }) (e)
- }
- function KE(e, t) {
- for (var n = 0; n < t.length; n++) {
- var a = t[n];
- a.enumerable = a.enumerable || !1,
- a.configurable = !0,
- 'value' in a && (a.writable = !0),
- Object.defineProperty(e, a.key, a)
- }
- }
- function JE(e, t) {
- return (JE = Object.setPrototypeOf || function (e, t) {
- return e.__proto__ = t,
- e
- }) (e, t)
- }
- function $E(n) {
- var a = function () {
- if ('undefined' == typeof Reflect || !Reflect.construct) return !1;
- if (Reflect.construct.sham) return !1;
- if ('function' == typeof Proxy) return !0;
- try {
- return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [
- ], function () {
- })),
- !0
- } catch (e) {
- return !1
- }
- }();
- return function () {
- var e,
- t = XE(n);
- return e = a ? (e = XE(this).constructor, Reflect.construct(t, arguments, e)) : t.apply(this, arguments),
- t = this,
- !(e = e) || 'object' !== QE(e) && 'function' != typeof e ? ZE(t) : e
- }
- }
- function ZE(e) {
- if (void 0 === e) throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called');
- return e
- }
- function XE(e) {
- return (XE = Object.setPrototypeOf ? Object.getPrototypeOf : function (e) {
- return e.__proto__ || Object.getPrototypeOf(e)
- }) (e)
- }
- function eO(e, t, n) {
- return t in e ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n,
- e
- }
- Yc = function () {
- !function (e, t) {
- if ('function' != typeof t && null !== t) throw new TypeError('Super expression must either be null or a function');
- e.prototype = Object.create(t && t.prototype, {
- constructor: {
- value: e,
- writable: !0,
- configurable: !0
- }
- }),
- t && JE(e, t)
- }(o, A);
- var e,
- t,
- n,
- r = $E(o);
- function o() {
- var t;
- !function (e, t) {
- if (!(e instanceof t)) throw new TypeError('Cannot call a class as a function')
- }(this, o);
- for (var e = arguments.length, n = Array(e), a = 0; a < e; a++) n[a] = arguments[a];
- return eO(ZE(t = r.call.apply(r, [
- this
- ].concat(n))), 'handleClickEvent', function (e) {
- t.props.emitTrackingEvent({
- verb: 'click',
- zone: 'install',
- object_type: 'section',
- object_id: e,
- extra_data: JSON.stringify({
- platform: t.props.platformPageName
- })
- })
- }),
- t
- }
- return e = o,
- (t = [
- {
- key: 'componentDidMount',
- value: function () {
- this.props.emitTrackingEvent({
- verb: 'view',
- extra_data: JSON.stringify({
- platform: this.props.platformPageName
- })
- })
- }
- },
- {
- key: 'render',
- value: function () {
- var e,
- t = this;
- this.context.auth.isAuthenticated || (e = C.a.createElement('div', {
- className: 'alert alert--brand text-medium spacing-double padding-double spacing-bottom-none border-radius-base'
- }, C.a.createElement('h2', {
- className: 'text-larger'
- }, 'Ready to install Disqus?'), C.a.createElement('p', null, 'Create an account to install Disqus on your site. These instructions only work if you have an account registered with Disqus and are logged in.'), C.a.createElement('a', {
- href: ''.concat(dt, '/publishers/signup/')
- }, C.a.createElement('button', {
- className: 'button button-medium button-padding-wide button-wide--mobile button-outline spacing-top'
- }, 'Get Started'))));
- var n = this.props.selection.type === ft.forum;
- return C.a.createElement('div', null, C.a.createElement('div', {
- className: 'content__wrap'
- }, C.a.createElement('header', {
- className: 'settings__header'
- }, C.a.createElement('div', {
- className: 'settings__header--icon -'.concat(this.props.platformClassName)
- }, C.a.createElement('img', {
- src: '//c.disquscdn.com/next/current/publisher-admin/assets/img/install_icons/'.concat(this.props.platformClassName, '.png'),
- width: '28'
- })), C.a.createElement('h2', {
- className: 'text-larger text-gray-darker spacing-bottom-small'
- }, this.props.platformPageName, ' install instructions'), C.a.createElement('p', {
- className: 'text-gray'
- }, 'Not using ', this.props.platformPageName, '? ', C.a.createElement(v.Link, {
- to: this.props.isBaseInstallPath ? '/install/' : '/settings/install/'
- }, C.a.createElement('strong', null, 'Change platform')))), e, this.props.children, this.props.isBaseInstallPath ? C.a.createElement('footer', {
- className: 'settings__footer clearfix'
- }, C.a.createElement(v.Link, {
- to: '/install/',
- className: 'button button-fill button-padding-wide button-medium pull-left'
- }, 'Back'), n ? C.a.createElement(v.Link, {
- to: '/install/settings/',
- className: 'button button-fill--brand button-padding-wide button-medium pull-right',
- onClick: function () {
- return t.handleClickEvent('configure')
- }
- }, 'Configure') : null) : null))
- }
- }
- ]) && KE(e.prototype, t),
- n && KE(e, n),
- o
- }();
- eO(Yc, 'displayName', 'InstallationInstruction'),
- eO(Yc, 'propTypes', {
- children: b.a.node.isRequired,
- platformClassName: b.a.string.isRequired,
- platformPageName: b.a.string.isRequired,
- emitTrackingEvent: b.a.func.isRequired,
- selection: ht,
- isBaseInstallPath: b.a.bool
- }),
- eO(Yc, 'contextTypes', {
- auth: b.a.object.isRequired
- });
- var tO = Object(u.connect) (null, {
- emitTrackingEvent: Xo({
- zone: 'install',
- section: 'platform'
- })
- }) (Yc),
- lh = function (e) {
- var t = ((e.selection || {
- }).forum || {
- }).shortname || 'EXAMPLE';
- return C.a.createElement(tO, {
- selection: e.selection,
- platformClassName: 'universalcode',
- platformPageName: 'Universal Code',
- isBaseInstallPath: e.isBaseInstallPath
- }, C.a.createElement('div', {
- className: 'settings__content'
- }, C.a.createElement('div', {
- className: 'video-wrapper'
- }, C.a.createElement('iframe', {
- id: 'ytplayer',
- type: 'text/html',
- width: '720',
- height: '405',
- src: 'https://www.youtube.com/embed/Dr6pSdeJgkA?modestbranding=1&rel=0&showinfo=0',
- frameBorder: '0',
- allowFullScreen: !0
- })), C.a.createElement('ol', {
- className: 'installation__instruction-list'
- }, C.a.createElement('li', null, 'Place the following code where you\'d like Disqus to load:', C.a.createElement('br', null), C.a.createElement(YE, {
- language: 'html'
- }, '<div id="disqus_thread"></div>\n<script>\n /**\n * RECOMMENDED CONFIGURATION VARIABLES: EDIT AND UNCOMMENT THE SECTION BELOW TO INSERT DYNAMIC VALUES FROM YOUR PLATFORM OR CMS.\n * LEARN WHY DEFINING THESE VARIABLES IS IMPORTANT: https://disqus.com/admin/universalcode/#configuration-variables */\n /*\n var disqus_config = function () {\n this.page.url = PAGE_URL; // Replace PAGE_URL with your page\'s canonical URL variable\n this.page.identifier = PAGE_IDENTIFIER; // Replace PAGE_IDENTIFIER with your page\'s unique identifier variable\n };\n */\n (function() { // DON\'T EDIT BELOW THIS LINE\n var d = document, s = d.createElement(\'script\');\n s.src = \'https://'.concat(t, '.disqus.com/embed.js\';\n s.setAttribute(\'data-timestamp\', +new Date());\n (d.head || d.body).appendChild(s);\n })();\n</script>\n<noscript>Please enable JavaScript to view the <a href="https://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>'))), C.a.createElement('li', null, '(Recommended) Edit the ', C.a.createElement('code', null, 'RECOMMENDED CONFIGURATION VARIABLES'), ' section using your CMS or platform\'s dynamic values. See our ', C.a.createElement('a', {
- href: Pn.splitThreads
- }, 'documentation'), ' to learn why defining ', C.a.createElement('code', null, 'identifier'), ' and ', C.a.createElement('code', null, 'url'), ' is important for preventing duplicate threads.')), C.a.createElement('h2', {
- className: 'text-gray-dark text-larger spacing-bottom'
- }, 'How to display comment count'), C.a.createElement('div', {
- className: 'video-wrapper'
- }, C.a.createElement('iframe', {
- id: 'ytplayer',
- type: 'text/html',
- width: '720',
- height: '405',
- src: 'https://www.youtube.com/embed/EalamXPZFeY?modestbranding=1&rel=0&showinfo=0',
- frameBorder: '0',
- allowFullScreen: !0
- })), C.a.createElement('ol', {
- className: 'installation__instruction-list'
- }, C.a.createElement('li', null, 'Place the following code before your site\'s closing ', C.a.createElement('code', null, '</body>'), ' tag:', C.a.createElement('br', null), C.a.createElement(YE, {
- language: 'html'
- }, '<script id="dsq-count-scr" src="//'.concat(t, '.disqus.com/count.js" async></script>'))), C.a.createElement('li', null, 'Append ', C.a.createElement('code', null, '#disqus_thread'), ' to the ', C.a.createElement('code', null, 'href'), ' attribute in your links. This will tell Disqus which links to look up and return the comment count. For example: ', C.a.createElement('code', null, '<a href="http://foo.com/bar.html#disqus_thread">Link</a>'), '.')), C.a.createElement('h2', {
- className: 'text-gray-dark text-larger spacing-bottom'
- }, 'Additional customization'), C.a.createElement('div', {
- className: 'alert alert--muted text-medium'
- }, 'See our ', C.a.createElement('a', {
- href: Pn.commentCountLinks
- }, 'Adding comment count links to your home page'), ' documentation.')))
- };
- lh.displayName = 'UniversalCodeInstall',
- lh.propTypes = {
- selection: ht,
- isBaseInstallPath: b.a.bool
- };
- Fc = lh;
- function nO(e) {
- var t = window.opener;
- t && t.postMessage(e, '*')
- }
- sl = {
- configure: function (n, a) {
- return function (e) {
- e({
- type: Ee.configuring
- });
- var t = a.trim().split(' ');
- t.length < 2 ? e({
- type: Ee.onConfigureError,
- message: 'Your install token is invalid. Try copying and pasting it from your plugin installation page again.'
- }) : io.a.call('integration/wordpress/updateConfiguration', {
- method: 'POST',
- data: {
- forum: n,
- url: t[0],
- secret: t[1]
- },
- success: function () {
- e({
- type: Ee.onConfigure
- }),
- nO('configurationUpdated')
- },
- error: function () {
- e({
- type: Ee.onConfigureError,
- message: 'An error occurred trying to configure your site. Make sure the Disqus plugin is installed and activated, and that your site is publicly accessible.'
- }),
- nO('configurationError')
- }
- })
- }
- },
- updateInstallToken: function (e) {
- return {
- type: Ee.updateInstallToken,
- token: e.data || e.target.value
- }
- }
- };
- function aO(e) {
- return (aO = 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator ? function (e) {
- return typeof e
- }
- : function (e) {
- return e && 'function' == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? 'symbol' : typeof e
- }) (e)
- }
- function rO(e, t) {
- for (var n = 0; n < t.length; n++) {
- var a = t[n];
- a.enumerable = a.enumerable || !1,
- a.configurable = !0,
- 'value' in a && (a.writable = !0),
- Object.defineProperty(e, a.key, a)
- }
- }
- function oO(e, t) {
- return (oO = Object.setPrototypeOf || function (e, t) {
- return e.__proto__ = t,
- e
- }) (e, t)
- }
- function iO(n) {
- var a = function () {
- if ('undefined' == typeof Reflect || !Reflect.construct) return !1;
- if (Reflect.construct.sham) return !1;
- if ('function' == typeof Proxy) return !0;
- try {
- return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [
- ], function () {
- })),
- !0
- } catch (e) {
- return !1
- }
- }();
- return function () {
- var e,
- t = lO(n);
- return e = a ? (e = lO(this).constructor, Reflect.construct(t, arguments, e)) : t.apply(this, arguments),
- t = this,
- !(e = e) || 'object' !== aO(e) && 'function' != typeof e ? sO(t) : e
- }
- }
- function sO(e) {
- if (void 0 === e) throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called');
- return e
- }
- function lO(e) {
- return (lO = Object.setPrototypeOf ? Object.getPrototypeOf : function (e) {
- return e.__proto__ || Object.getPrototypeOf(e)
- }) (e)
- }
- function cO(e, t, n) {
- return t in e ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n,
- e
- }
- var uO = !!window.opener,
- yl = function () {
- !function (e, t) {
- if ('function' != typeof t && null !== t) throw new TypeError('Super expression must either be null or a function');
- e.prototype = Object.create(t && t.prototype, {
- constructor: {
- value: e,
- writable: !0,
- configurable: !0
- }
- }),
- t && oO(e, t)
- }(o, A);
- var e,
- t,
- n,
- r = iO(o);
- function o() {
- var t;
- !function (e, t) {
- if (!(e instanceof t)) throw new TypeError('Cannot call a class as a function')
- }(this, o);
- for (var e = arguments.length, n = Array(e), a = 0; a < e; a++) n[a] = arguments[a];
- return cO(sO(t = r.call.apply(r, [
- this
- ].concat(n))), 'handleReceivePostMessage', function (e) {
- ~e.data.indexOf('disqus/v1/settings') && t.props.updateInstallToken(e)
- }),
- cO(sO(t), 'submitInstallForum', function (e) {
- e.preventDefault();
- e = t.props.selection && t.props.selection.forum && t.props.selection.forum.shortname;
- e && t.props.configure(e, t.props.wordpressInstall.installToken)
- }),
- t
- }
- return e = o,
- (t = [
- {
- key: 'componentDidMount',
- value: function () {
- nO('installPageReady'),
- window.opener && window.addEventListener('message', this.handleReceivePostMessage, !1)
- }
- },
- {
- key: 'componentWillUnmount',
- value: function () {
- window.opener && window.removeEventListener('message', this.handleReceivePostMessage, !1)
- }
- },
- {
- key: 'render',
- value: function () {
- var e = (this.props.selection.forum || {
- }).shortname,
- t = this.props.wordpressInstall.installToken,
- n = this.props.wordpressInstall.isConfiguring ? 'Contacting your site…' : C.a.createElement('span', null, 'Install ', C.a.createElement('em', null, e), ' on your site'),
- e = this.props.wordpressInstall.isConfigured ? C.a.createElement('div', {
- className: 'spacing-top-double spacing-bottom'
- }, C.a.createElement('span', {
- className: 'icon icon-checkmark'
- }), ' Site updated. Click ', C.a.createElement('strong', null, 'Configure'), ' to continue setting up Disqus.') : e ? C.a.createElement('div', null, C.a.createElement('div', {
- className: 'video-wrapper'
- }, C.a.createElement('iframe', {
- id: 'ytplayer',
- type: 'text/html',
- width: '720',
- height: '405',
- src: 'https://www.youtube.com/embed/a4JBJXyuaFk?modestbranding=1&rel=0&showinfo=0',
- frameBorder: '0',
- allowFullScreen: !0
- })), C.a.createElement('ol', {
- className: 'installation__instruction-list'
- }, uO ? null : [
- C.a.createElement('li', {
- key: '1'
- }, 'In the left panel of your WordPress admin, select ', C.a.createElement('strong', null, 'Plugins > Add New.')),
- C.a.createElement('li', {
- key: '2'
- }, 'Search for "Disqus" and find the plugin provided by "Disqus".'),
- C.a.createElement('li', {
- key: '3'
- }, 'Select ', C.a.createElement('strong', null, 'Install Now'), ' then ', C.a.createElement('strong', null, 'Activate Plugin')),
- C.a.createElement('li', {
- key: '4'
- }, 'Click "Disqus" in the left panel of your WordPress admin.')
- ], C.a.createElement('li', null, C.a.createElement('form', {
- onSubmit: this.submitInstallForum
- }, C.a.createElement('label', null, 'Copy the ', C.a.createElement('strong', null, 'Installation Token'), ' and paste it into the form below to complete the installation', C.a.createElement('input', {
- type: 'text',
- className: 'input--textbox spacing-top-narrow',
- name: 'installToken',
- placeholder: 'Paste your WordPress install key here',
- value: t,
- onChange: this.props.updateInstallToken,
- disabled: !e
- })), C.a.createElement('button', {
- className: 'button button-fill--brand button-padding-wide button-medium spacing-top-narrow',
- disabled: this.props.wordpressInstall.isConfiguring || !t || !t.length
- }, n)), this.props.wordpressInstall.configureError ? C.a.createElement(Ki, {
- message: this.props.wordpressInstall.configureError,
- alertType: 'error'
- }) : null, C.a.createElement('div', null, C.a.createElement('h3', {
- className: 'spacing-top'
- }, 'Using manual installation?'), C.a.createElement('ul', {
- className: 'list-bullet'
- }, C.a.createElement('li', null, 'In the shortname field, enter your shortname: ', C.a.createElement('code', {
- className: 'inline'
- }, e)), C.a.createElement('li', null, 'Optionally, create an ', C.a.createElement('a', {
- href: 'https://disqus.com/api/applications/'
- }, 'API Application'), ' for your site.', C.a.createElement('ul', {
- className: 'list-circle'
- }, C.a.createElement('li', null, 'After registering the application, go to the settings tab and set ', C.a.createElement('strong', null, 'Default Access'), ' to ', C.a.createElement('em', null, 'Read, write, and manage forums'), '.'), C.a.createElement('li', null, 'On the plugin configuration page, enter the API key, secret, and access token and click ', C.a.createElement('strong', null, 'Save'), '.')))))))) : C.a.createElement('div', {
- className: 'spacing-top-double spacing-bottom'
- }, C.a.createElement('strong', null, 'Pick a Site'), ' or ', C.a.createElement('strong', null, 'Create a Site'), ' to continue installation.');
- return C.a.createElement(tO, {
- selection: this.props.selection,
- platformClassName: 'wordpress',
- platformPageName: 'WordPress',
- isBaseInstallPath: this.props.isBaseInstallPath
- }, C.a.createElement('div', {
- className: 'padding-double'
- }, e))
- }
- }
- ]) && rO(e.prototype, t),
- n && rO(e, n),
- o
- }();
- cO(yl, 'displayName', 'WordpressInstall'),
- cO(yl, 'propTypes', {
- selection: ht.isRequired,
- configure: b.a.func.isRequired,
- updateInstallToken: b.a.func.isRequired,
- wordpressInstall: b.a.shape({
- installToken: b.a.string,
- isConfiguring: b.a.bool,
- isConfigured: b.a.bool,
- configureError: b.a.string
- }).isRequired,
- isBaseInstallPath: b.a.bool,
- installToken: b.a.string,
- isConfiguring: b.a.bool,
- isConfigured: b.a.bool,
- configureError: b.a.string
- });
- Vb = {
- configure: sl.configure,
- updateInstallToken: sl.updateInstallToken
- },
- cu = Object(u.connect) (function (e) {
- return {
- wordpressInstall: e.wordpressInstall
- }
- }, Vb) (yl);
- function pO(e) {
- return (pO = 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator ? function (e) {
- return typeof e
- }
- : function (e) {
- return e && 'function' == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? 'symbol' : typeof e
- }) (e)
- }
- function dO(e, t) {
- for (var n = 0; n < t.length; n++) {
- var a = t[n];
- a.enumerable = a.enumerable || !1,
- a.configurable = !0,
- 'value' in a && (a.writable = !0),
- Object.defineProperty(e, a.key, a)
- }
- }
- function mO(e, t) {
- return (mO = Object.setPrototypeOf || function (e, t) {
- return e.__proto__ = t,
- e
- }) (e, t)
- }
- function fO(n) {
- var a = function () {
- if ('undefined' == typeof Reflect || !Reflect.construct) return !1;
- if (Reflect.construct.sham) return !1;
- if ('function' == typeof Proxy) return !0;
- try {
- return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [
- ], function () {
- })),
- !0
- } catch (e) {
- return !1
- }
- }();
- return function () {
- var e,
- t = gO(n);
- return e = a ? (e = gO(this).constructor, Reflect.construct(t, arguments, e)) : t.apply(this, arguments),
- t = this,
- !(e = e) || 'object' !== pO(e) && 'function' != typeof e ? hO(t) : e
- }
- }
- function hO(e) {
- if (void 0 === e) throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called');
- return e
- }
- function gO(e) {
- return (gO = Object.setPrototypeOf ? Object.getPrototypeOf : function (e) {
- return e.__proto__ || Object.getPrototypeOf(e)
- }) (e)
- }
- function yO(e, t, n) {
- return t in e ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n,
- e
- }
- Jc = function () {
- !function (e, t) {
- if ('function' != typeof t && null !== t) throw new TypeError('Super expression must either be null or a function');
- e.prototype = Object.create(t && t.prototype, {
- constructor: {
- value: e,
- writable: !0,
- configurable: !0
- }
- }),
- t && mO(e, t)
- }(o, A);
- var e,
- t,
- n,
- r = fO(o);
- function o() {
- var t;
- !function (e, t) {
- if (!(e instanceof t)) throw new TypeError('Cannot call a class as a function')
- }(this, o);
- for (var e = arguments.length, n = Array(e), a = 0; a < e; a++) n[a] = arguments[a];
- return yO(hO(t = r.call.apply(r, [
- this
- ].concat(n))), 'handleClick', function (e) {
- e.preventDefault(),
- Au.openCurrentInstance(t.props.path)
- }),
- t
- }
- return e = o,
- (t = [
- {
- key: 'render',
- value: function () {
- return C.a.createElement('a', {
- href: ho.getRoute(this.props.path),
- onClick: this.handleClick,
- className: this.props.linkClassName
- }, this.props.children)
- }
- }
- ]) && dO(e.prototype, t),
- n && dO(e, n),
- o
- }();
- yO(Jc, 'propTypes', {
- children: b.a.node.isRequired,
- linkClassName: b.a.string,
- path: b.a.string.isRequired
- });
- var bO = Jc,
- Ru = function (e) {
- e = ((e.selection || {
- }).forum || {
- }).shortname || 'EXAMPLE';
- return C.a.createElement('form', {
- method: 'post',
- action: 'https://www.blogger.com/add-widget',
- target: '_blank'
- }, C.a.createElement('input', {
- type: 'hidden',
- name: 'infoUrl',
- value: 'https://'.concat(e, '.disqus.com/admin/settings/blogger/')
- }), C.a.createElement('input', {
- type: 'hidden',
- name: 'logoUrl',
- value: 'https://disqus.com/api/forums/favicons/'.concat(e, '.jpg')
- }), C.a.createElement('input', {
- type: 'hidden',
- name: 'widget.title',
- value: 'Disqus for '.concat(e)
- }), C.a.createElement('textarea', {
- name: 'widget.content',
- className: 'installation__textarea',
- style: {
- display: 'none'
- }
- }, '<!-- Disqus Widget -->'), C.a.createElement('input', {
- type: 'hidden',
- name: 'widget.template',
- value: '<b:includable id=\'main\'>\n<script type=\'text/javascript\'>\nvar disqus_shortname = \''.concat(e, '\';\nvar disqus_blogger_current_url = "<data:blog.canonicalUrl/>";\nif (!disqus_blogger_current_url.length) {\ndisqus_blogger_current_url = "<data:blog.url/>";\n}\nvar disqus_blogger_homepage_url = "<data:blog.homepageUrl/>";\nvar disqus_blogger_canonical_homepage_url = "<data:blog.canonicalHomepageUrl/>";\n</script>\n<b:if cond=\'data:blog.pageType == "item"\'>\n<style type=\'text/css\'>\n#comments {display:none;}\n</style>\n<script type=\'text/javascript\'>\n(function() {\n var bloggerjs = document.createElement(\'script\');\n bloggerjs.type = \'text/javascript\';\n bloggerjs.async = true;\n bloggerjs.src = \'//\' + disqus_shortname + \'.disqus.com/blogger_item.js\';\n (document.getElementsByTagName(\'head\')[0] || document.getElementsByTagName(\'body\')[0]).appendChild(bloggerjs);\n})();\n</script>\n</b:if>\n<style type=\'text/css\'>\n.post-comment-link { visibility: hidden; }\n</style>\n<script type=\'text/javascript\'>\n(function() {\nvar bloggerjs = document.createElement(\'script\');\nbloggerjs.type = \'text/javascript\';\nbloggerjs.async = true;\nbloggerjs.src = \'//\' + disqus_shortname + \'.disqus.com/blogger_index.js\';\n(document.getElementsByTagName(\'head\')[0] || document.getElementsByTagName(\'body\')[0]).appendChild(bloggerjs);\n})();\n</script>\n</b:includable>')
- }), C.a.createElement('button', {
- className: 'button button-fill--brand button-padding-wide button-medium',
- name: 'go'
- }, 'Add '.concat(e, ' to my Blogger site')))
- };
- Ru.displayName = 'UniversalCodeInstallationBloggerWidget',
- Ru.propTypes = {
- selection: ht
- };
- var vO = Ru,
- Bu = function (e, t) {
- var n = t.auth.isAuthenticated,
- t = ''.concat(dt, '/publishers/login/?next=').concat(window.location.pathname),
- t = n ? e.selection.forum ? C.a.createElement(vO, {
- selection: e.selection
- }) : C.a.createElement('p', null, C.a.createElement(bO, null, 'Please select a site'), ' to add the Blogger widget.') : C.a.createElement('p', null, C.a.createElement('a', {
- href: t
- }, 'Please login'), ' to add the Blogger widget.');
- return C.a.createElement(tO, {
- selection: e.selection,
- platformClassName: 'blogger',
- platformPageName: 'Blogger',
- isBaseInstallPath: e.isBaseInstallPath
- }, C.a.createElement('div', {
- className: 'padding-double'
- }, C.a.createElement('div', {
- className: 'video-wrapper'
- }, C.a.createElement('iframe', {
- id: 'ytplayer',
- type: 'text/html',
- width: '720',
- height: '405',
- src: 'https://www.youtube.com/embed/JldEG0XU9w8?modestbranding=1&rel=0&showinfo=0',
- frameBorder: '0',
- allowFullScreen: !0
- })), C.a.createElement('ol', {
- className: 'installation__instruction-list -blogger'
- }, C.a.createElement('li', null, t), C.a.createElement('li', null, 'Import your existing Blogger comments into Disqus at ', C.a.createElement(Uo, {
- path: '/discussions/import/platform/blogger/',
- selection: e.selection
- }, 'Discussions > Import'), '.'), C.a.createElement('li', null, 'Update your blogger template\'s meta tags for full Internet Explorer compatibility. ', C.a.createElement('a', {
- href: Pn.bloggerIEFix
- }, 'See instructions here.'))), C.a.createElement('div', {
- className: 'alert alert--muted text-medium'
- }, 'If the widget does not work, see ', C.a.createElement('a', {
- href: Pn.bloggerManualInstall
- }, 'Blogger Installation Help'), ' for instructions on how to update your Blogger template to work with the widget.')))
- };
- Bu.displayName = 'BloggerInstall',
- Bu.contextTypes = {
- auth: b.a.object.isRequired
- },
- Bu.propTypes = {
- selection: ht,
- isBaseInstallPath: b.a.bool
- };
- xu = Bu,
- h = function (e) {
- var t = ((e.selection || {
- }).forum || {
- }).shortname || 'EXAMPLE';
- return C.a.createElement(tO, {
- selection: e.selection,
- platformClassName: 'tumblr',
- platformPageName: 'Tumblr',
- isBaseInstallPath: e.isBaseInstallPath
- }, C.a.createElement('div', {
- className: 'padding-double'
- }, C.a.createElement('ol', {
- className: 'installation__instruction-list'
- }, C.a.createElement('li', null, 'In Tumblr, visit ', C.a.createElement('a', {
- href: 'https://www.tumblr.com/settings/',
- target: '_blank'
- }, C.a.createElement('strong', null, 'Settings')), ' > pick your blog > click ', C.a.createElement('span', {
- className: 'installation__instruction-tumblr-edit-theme'
- }, 'Edit theme')), C.a.createElement('li', null, 'In the shortname field, enter your shortname: ', C.a.createElement('code', {
- className: 'inline'
- }, t)), C.a.createElement('li', null, 'Save your theme and you\'re done.')), C.a.createElement('div', {
- className: 'alert alert--muted text-medium'
- }, C.a.createElement('p', null, C.a.createElement('strong', null, 'Note:'), ' If your Tumblr theme does not have built-in Disqus support, you can ', C.a.createElement('a', {
- href: Pn.tumblrManualInstall,
- target: '_blank'
- }, 'install Disqus manually'), '.'))))
- };
- h.displayName = 'TumblrInstall',
- h.propTypes = {
- selection: ht,
- isBaseInstallPath: b.a.bool
- };
- y = h,
- lt = function (e) {
- var t = ((e.selection || {
- }).forum || {
- }).shortname || 'EXAMPLE';
- return C.a.createElement(tO, {
- selection: e.selection,
- platformClassName: 'squarespace',
- platformPageName: 'Squarespace',
- isBaseInstallPath: e.isBaseInstallPath
- }, C.a.createElement('div', {
- className: 'padding-double'
- }, C.a.createElement('ol', {
- className: 'installation__instruction-list'
- }, C.a.createElement('li', null, 'Navigate to your Squarespace ', C.a.createElement('strong', null, 'Settings > Blogging'), ' page.'), C.a.createElement('li', null, 'In the Disqus shortname field, enter your shortname: ', C.a.createElement('code', {
- className: 'inline site-shortname'
- }, t), '.'), C.a.createElement('li', null, 'Navigate to your ', C.a.createElement('strong', null, 'Comments Settings'), ' page and select ', C.a.createElement('strong', null, 'Enable Comments Globally'), '.')), C.a.createElement('div', {
- className: 'alert alert--muted text-medium'
- }, C.a.createElement('strong', null, 'Note:'), ' This installation method enables Disqus on blog pages only. To add Disqus to non-blog content like e-commerce pages, use the ', C.a.createElement(v.Link, {
- to: '/install/platforms/universalcode/'
- }, 'Universal Code'), ' instructions and Squarespace\'s ', C.a.createElement('a', {
- href: 'https://support.squarespace.com/hc/en-us/articles/205815908-Using-Code-Injection',
- target: '_blank'
- }, 'Code Injection'), ' tool.')))
- };
- lt.displayName = 'SquarespaceInstall',
- lt.propTypes = {
- selection: ht,
- isBaseInstallPath: b.a.bool
- };
- p = lt,
- ut = function (e) {
- var t = ((e.selection || {
- }).forum || {
- }).shortname || 'EXAMPLE';
- return C.a.createElement(tO, {
- selection: e.selection,
- platformClassName: 'typepad',
- platformPageName: 'TypePad',
- isBaseInstallPath: e.isBaseInstallPath
- }, C.a.createElement('div', {
- className: 'padding-double'
- }, C.a.createElement('ol', {
- className: 'installation__instruction-list'
- }, C.a.createElement('li', null, 'In your TypePad dashboard select ', C.a.createElement('strong', null, 'Design'), '.'), C.a.createElement('li', null, 'On the left sidebar select ', C.a.createElement('strong', null, 'Content'), '.'), C.a.createElement('li', null, 'Under Modules, choose ', C.a.createElement('strong', null, 'Embed your own HTML'), ' > ', C.a.createElement('strong', null, 'Add this module'), '.', C.a.createElement('div', {
- className: 'alert alert--muted text-medium'
- }, 'Note: If you do not have the Content or \'Embed Your Own HTML\' option with your design, please see Typepad\'s more specific ', C.a.createElement('a', {
- href: Pn.typePadHelp,
- target: '_blank',
- rel: 'noopener noreferrer'
- }, 'installation instructions'), '.')), C.a.createElement('li', null, 'In the label field type "Disqus".'), C.a.createElement('li', null, 'Copy and paste the following code into the HTML field.', 'EXAMPLE' === t ? C.a.createElement(C.a.Fragment, null, C.a.createElement('div', {
- className: 'alert alert--muted text-medium spacing-top-small spacing-bottom-none'
- }, 'Make sure to replace ', C.a.createElement('i', null, 'EXAMPLE'), ' in the ', C.a.createElement('code', {
- className: 'inline'
- }, 'disqus_shortname'), ' with the shortname for your own forum.')) : null, C.a.createElement(YE, {
- language: 'html'
- }, '<script type=\'text/javascript\'>\n var disqus_shortname = \''.concat(t, '\';\n // DON\'T EDIT BELOW THIS LINE\n (function () {\n var loaded = false;\n function loadDisqus() {\n if (loaded) return;\n loaded = true;\n var div = document.getElementById(\'all-comments\');\n div.innerHTML = \'\'; div.id = \'disqus_thread\';\n\n var dsq = document.createElement(\'script\'); dsq.type = \'text/javascript\'; dsq.async = true;\n dsq.src = \'https://\' + disqus_shortname + \'.disqus.com/embed.js\';\n\n (document.getElementsByTagName(\'head\')[0] || document.getElementsByTagName(\'body\')[0]).appendChild(dsq);\n\n }\n\n if ( document.getElementById(\'all-comments\') || document.readyState === "complete" ) {\n return setTimeout( loadDisqus, 1 );\n }\n\n if ( document.addEventListener ) {\n document.addEventListener( "DOMContentLoaded", loadDisqus, false );\n window.addEventListener( "load", loadDisqus, false );\n } else if ( document.attachEvent ) {\n document.attachEvent( "onreadystatechange", loadDisqus );\n window.attachEvent( "onload", loadDisqus);\n }\n }());\n</script>'))), C.a.createElement('li', null, 'On the left sidebar select ', C.a.createElement('strong', null, 'Custom CSS'), ' and copy and paste the following code.', C.a.createElement(YE, {
- language: 'css'
- }, '#all-comments {\n display: none !important;\n}\n.comments-open {\n display: none !important;\n}')), C.a.createElement('li', null, 'Save your changes.'))))
- };
- ut.displayName = 'TypepadInstall',
- ut.propTypes = {
- selection: ht,
- isBaseInstallPath: b.a.bool
- };
- Sn = ut,
- qn = function (e) {
- var t = ((e.selection || {
- }).forum || {
- }).shortname || 'EXAMPLE';
- return C.a.createElement(tO, {
- selection: e.selection,
- platformClassName: 'movabletype',
- platformPageName: 'Movable Type',
- isBaseInstallPath: e.isBaseInstallPath
- }, C.a.createElement('div', {
- className: 'padding-double'
- }, C.a.createElement('ol', {
- className: 'installation__instruction-list'
- }, C.a.createElement('li', null, 'Download the ', C.a.createElement('a', {
- href: 'https://media.disqus.com/disqus-movabletype-2.02.zip'
- }, 'Disqus plugin for Movable Type')), C.a.createElement('li', null, 'Unpack the archive to the ', C.a.createElement('code', {
- className: 'inline'
- }, '/path/to/movabletype'), ' directory inside of Movable Type.', C.a.createElement('div', {
- className: 'alert alert--muted text-medium'
- }, C.a.createElement('span', null, C.a.createElement('strong', null, 'Important:'), ' Maintain the directory structure of the archive. All extracted files should exist in: ', C.a.createElement('br', null), C.a.createElement('br', null), C.a.createElement('code', null, '/path/to/movabletype/plugins/disqus/'), ' — If your site doesn\'t allow global CGI execution, this path may be located in your cgi-bin.', C.a.createElement('br', null), C.a.createElement('br', null), C.a.createElement('code', null, '/path/to/movabletype/mt-static/plugins/disqus/')))), C.a.createElement('li', null, 'On your site\'s ', C.a.createElement('strong', null, 'Tools > Plugins'), ' page, enable the Disqus plugin.'), C.a.createElement('li', null, 'In the ', C.a.createElement('strong', null, 'Settings'), ' tab, choose ', C.a.createElement('strong', null, 'Install DISQUS')), C.a.createElement('li', null, 'Follow the walkthrough setup process. In the shortname field, enter your shortname: ', C.a.createElement('code', {
- className: 'inline'
- }, t), '.'), C.a.createElement('li', null, 'Choose ', C.a.createElement('strong', null, 'Publish Site'), ' and publish all files.'))))
- };
- qn.displayName = 'MovableTypeInstall',
- qn.propTypes = {
- selection: ht,
- isBaseInstallPath: b.a.bool
- };
- Ln = qn,
- i = function (e) {
- var t = ((e.selection || {
- }).forum || {
- }).shortname || 'EXAMPLE';
- return C.a.createElement(tO, {
- selection: e.selection,
- platformClassName: 'drupal',
- platformPageName: 'Drupal',
- isBaseInstallPath: e.isBaseInstallPath
- }, C.a.createElement('div', {
- className: 'padding-double'
- }, C.a.createElement('ol', {
- className: 'installation__instruction-list'
- }, C.a.createElement('li', null, 'Download the ', C.a.createElement('a', {
- href: 'https://www.drupal.org/project/disqus',
- target: '_blank'
- }, 'Disqus Drupal module'), '.'), C.a.createElement('li', null, 'Upload the Disqus module to your site\'s modules directory in ', C.a.createElement('code', {
- className: 'inline'
- }, 'sites/all/modules')), C.a.createElement('li', null, 'Visit ', C.a.createElement('strong', null, 'Administer > Site building > Modules'), ' and enable the module.'), C.a.createElement('li', null, 'Visit ', C.a.createElement('strong', null, 'Administer > Site configuration > Disqus'), '.'), C.a.createElement('li', null, 'In the shortname field, enter your shortname: ', C.a.createElement('code', {
- className: 'inline'
- }, t), '.'), C.a.createElement('li', null, 'Visit ', C.a.createElement('strong', null, 'Administer > User Management > Permissions'), ' and enable the "View Disqus Comments" permission.'))))
- };
- i.displayName = 'DrupalInstall',
- i.propTypes = {
- selection: ht,
- isBaseInstallPath: b.a.bool
- };
- c = i,
- go = function (e) {
- var t = ((e.selection || {
- }).forum || {
- }).shortname || 'EXAMPLE';
- return C.a.createElement(tO, {
- selection: e.selection,
- platformClassName: 'joomla',
- platformPageName: 'Joomla',
- isBaseInstallPath: e.isBaseInstallPath
- }, C.a.createElement('div', {
- className: 'padding-double'
- }, C.a.createElement('ol', {
- className: 'installation__instruction-list'
- }, C.a.createElement('li', null, 'Download the ', C.a.createElement('a', {
- href: 'http://extensions.joomla.org/extensions/extension/social-web/social-comments/disqus-comments',
- target: '_blank'
- }, 'Disqus for Joomla plug-in'), '.'), C.a.createElement('li', null, 'In your Joomla admin select ', C.a.createElement('strong', null, 'Extension Manager'), '.'), C.a.createElement('li', null, 'Upload the Disqus plugin.'), C.a.createElement('li', null, 'Under the Extensions menu choose ', C.a.createElement('strong', null, 'Plug-in Manager'), '.'), C.a.createElement('li', null, 'In the Disqus subdomain field, enter your shortname: ', C.a.createElement('code', {
- className: 'inline'
- }, t), '.'))))
- };
- go.displayName = 'JoomlaInstall',
- go.propTypes = {
- selection: ht,
- isBaseInstallPath: b.a.bool
- };
- bo = go,
- Qs = function (e) {
- return C.a.createElement(tO, {
- selection: e.selection,
- platformClassName: 'weebly',
- platformPageName: 'Weebly',
- isBaseInstallPath: e.isBaseInstallPath
- }, C.a.createElement('div', {
- className: 'padding-double'
- }, C.a.createElement('ol', {
- className: 'installation__instruction-list'
- }, C.a.createElement('li', null, 'Go to the Blog Settings button at the bottom of your blog.'), C.a.createElement('li', null, 'Choose "Disqus" from the Commenting System drop down menu.'), C.a.createElement('li', null, 'Enter your shortname in the Weebly "Disqus Shortname" field.'), C.a.createElement('li', null, 'Save your changes and Publish your site.'))))
- };
- Qs.displayName = 'WeeblyInstall',
- Qs.propTypes = {
- selection: ht,
- isBaseInstallPath: b.a.bool
- };
- Ts = Qs,
- ac = function (e) {
- var t = ((e.selection || {
- }).forum || {
- }).shortname || 'EXAMPLE';
- return C.a.createElement(tO, {
- selection: e.selection,
- platformClassName: 'strikingly',
- platformPageName: 'Strikingly',
- isBaseInstallPath: e.isBaseInstallPath
- }, C.a.createElement('div', {
- className: 'padding-double'
- }, C.a.createElement('ol', {
- className: 'installation__instruction-list'
- }, C.a.createElement('li', null, 'In Strikingly, click on ', C.a.createElement('strong', null, 'Manage Blog Posts'), '.'), C.a.createElement('li', null, 'In the ', C.a.createElement('strong', null, 'BLOG SETTINGS'), ' tab, enter your ', C.a.createElement('strong', null, 'shortname:'), ' ', C.a.createElement('code', {
- className: 'inline'
- }, t)), C.a.createElement('li', null, 'Click ', C.a.createElement('strong', null, 'SAVE CHANGES'), '.'))))
- };
- ac.displayName = 'StrikinglyInstall',
- ac.propTypes = {
- selection: ht,
- isBaseInstallPath: b.a.bool
- };
- cs = ac,
- Ls = function (e) {
- return C.a.createElement(tO, {
- selection: e.selection,
- platformClassName: 'jekyll',
- platformPageName: 'Jekyll',
- isBaseInstallPath: e.isBaseInstallPath
- }, C.a.createElement('div', {
- className: 'padding-double'
- }, C.a.createElement('ol', {
- className: 'installation__instruction-list'
- }, C.a.createElement('li', null, 'Add a variable called ', C.a.createElement('code', {
- className: 'inline'
- }, 'comments'), ' to the', C.a.createElement('a', {
- href: Pn.yamlFrontMatter,
- target: '_blank',
- rel: 'noopener noreferrer'
- }, ' ', 'YAML Front Matter'), ' and set its value to ', C.a.createElement('code', {
- className: 'inline'
- }, 'true'), '. A sample front matter might look like:', C.a.createElement('br', null), C.a.createElement(YE, {
- language: 'yaml'
- }, '---\nlayout: default\ncomments: true\n# other options\n---')), C.a.createElement('li', null, 'In between a ', C.a.createElement('code', {
- className: 'inline'
- }, '{% if page.comments %}'), ' and', ' ', 'a ', C.a.createElement('code', {
- className: 'inline'
- }, '{% endif %}'), ' tag, copy and paste the', ' ', C.a.createElement(v.Link, {
- to: '/install/platforms/universalcode'
- }, 'Universal Embed Code'), ' in the', ' ', 'appropriate template where you\'d like Disqus to load.')), C.a.createElement('div', {
- className: 'alert alert--muted text-medium'
- }, 'Note: Comments can be disabled per-page by setting ', C.a.createElement('code', {
- className: 'inline'
- }, 'comments: false'), ' or by not including the comments option at all.')))
- };
- Ls.displayName = 'JekyllInstall',
- Ls.propTypes = {
- selection: ht,
- isBaseInstallPath: b.a.bool
- };
- Lo = Ls,
- Mo = function (e) {
- return C.a.createElement(tO, {
- selection: e.selection,
- platformClassName: 'ghost',
- platformPageName: 'Ghost',
- isBaseInstallPath: e.isBaseInstallPath
- }, C.a.createElement('div', {
- className: 'padding-double'
- }, C.a.createElement('ol', {
- className: 'installation__instruction-list'
- }, C.a.createElement('li', null, 'Find the ', C.a.createElement('strong', null, 'post.hbs'), ' file located in your current theme\'s directory, for example ', C.a.createElement('code', {
- className: 'inline'
- }, 'yourghostdir/content/themes/casper/')), C.a.createElement('li', null, 'Copy and paste the ', C.a.createElement(v.Link, {
- to: '/install/platforms/universalcode'
- }, 'Universal Embed Code'), ' somewhere', ' ', 'between the opening ', C.a.createElement('code', {
- className: 'inline'
- }, '{{#post}}'), ' and closing', ' ', C.a.createElement('code', {
- className: 'inline'
- }, '{{/post}}'), ' helpers.'), C.a.createElement('li', null, 'Change ', C.a.createElement('code', {
- className: 'inline'
- }, 'PAGE_IDENTIFER'), 'to be', C.a.createElement('code', {
- className: 'inline'
- }, '"ghost-{{comment_id}}"'), ' (including quotes).'), C.a.createElement('li', null, 'Restart Ghost.')), C.a.createElement('div', {
- className: 'alert alert--muted text-medium'
- }, 'Note: If you choose to place the snippet outside of the', C.a.createElement('code', {
- className: 'inline'
- }, '{{#post}}{{/post}}'), 'block, your identifier would need to be', C.a.createElement('code', {
- className: 'inline'
- }, '"ghost-{{post.comment_id}}'), '. The ', C.a.createElement('code', {
- className: 'inline'
- }, 'comment_id'), ' identifier is required to avoid any issues caused by post URLs changing. ', C.a.createElement('a', {
- href: Pn.splitThreads
- }, 'Learn more'), '.')))
- };
- Mo.displayName = 'GhostInstall',
- Mo.propTypes = {
- selection: ht,
- isBaseInstallPath: b.a.bool
- };
- di = Mo,
- wi = function (e) {
- return C.a.createElement(tO, {
- selection: e.selection,
- platformClassName: 'hubspot',
- platformPageName: 'HubSpot',
- isBaseInstallPath: e.isBaseInstallPath
- }, C.a.createElement('div', {
- className: 'padding-double'
- }, C.a.createElement('ol', {
- className: 'installation__instruction-list'
- }, C.a.createElement('li', null, 'From your Hubspot blog admin click ', C.a.createElement('strong', null, 'options'), '.'), C.a.createElement('li', null, 'Under General options uncheck ', C.a.createElement('strong', null, 'Allow Comments'), '.'), C.a.createElement('li', null, 'Uncheck ', C.a.createElement('strong', null, 'Include Footer'), ' on Listing Pages.'), C.a.createElement('li', null, 'Click on ', C.a.createElement('strong', null, 'HTML'), ' in the blog footer edit menu.'), C.a.createElement('li', null, 'Copy and paste the ', C.a.createElement(v.Link, {
- to: '/install/platforms/universalcode'
- }, 'Universal Embed Code'), ' ', 'in the HTML Code widow.'))))
- };
- wi.displayName = 'HubspotInstall',
- wi.propTypes = {
- selection: ht,
- isBaseInstallPath: b.a.bool
- };
- Fi = wi,
- Vi = function (e) {
- return C.a.createElement(tO, {
- selection: e.selection,
- platformClassName: 'shopify',
- platformPageName: 'Shopify',
- isBaseInstallPath: e.isBaseInstallPath
- }, C.a.createElement('div', {
- className: 'padding-double'
- }, C.a.createElement('ol', {
- className: 'installation__instruction-list'
- }, C.a.createElement('li', null, 'In the Shopify store admin, go to ', C.a.createElement('strong', null, 'Online Store > Themes'), '.'), C.a.createElement('li', null, 'Click the ', C.a.createElement('strong', null, '...'), ' menu, and then click ', C.a.createElement('strong', null, 'Edit HTML/CSS'), '.'), C.a.createElement('li', null, 'Copy the ', C.a.createElement(v.Link, {
- to: '/install/platforms/universalcode'
- }, 'Universal Embed Code'), '.'), C.a.createElement('li', null, 'If you want the Disqus embed to load on your product pages, paste the code at the bottom of the ', C.a.createElement('code', {
- className: 'inline'
- }, 'product.liquid'), ' file.'), C.a.createElement('li', null, 'If you want the Disqus embed to load on your blog pages, paste the code at the bottom of the ', C.a.createElement('code', {
- className: 'inline'
- }, 'article.liquid'), ' file.'), C.a.createElement('li', null, C.a.createElement('strong', null, 'Save'), ' your changes.'))))
- };
- Vi.displayName = 'ShopifyInstall',
- Vi.propTypes = {
- selection: ht,
- isBaseInstallPath: b.a.bool
- };
- yc = Vi,
- Pc = function (e) {
- var t = ((e.selection || {
- }).forum || {
- }).shortname || 'EXAMPLE';
- return C.a.createElement(tO, {
- selection: e.selection,
- platformClassName: 'amp',
- platformPageName: 'Amp',
- isBaseInstallPath: e.isBaseInstallPath
- }, C.a.createElement('div', {
- className: 'padding-double'
- }, C.a.createElement('ol', {
- className: 'installation__instruction-list'
- }, C.a.createElement('li', {
- id: 'step-1'
- }, 'Create and host the following Universal Code file on a different domain than where you intend to load Disqus for AMP. This will be the URL that you will provide to the ', C.a.createElement('code', {
- className: 'inline'
- }, 'src'), ' attribute in ', C.a.createElement('a', {
- className: 'text-bold',
- href: '#step-4'
- }, 'Step 4'), ' below.', 'EXAMPLE' === t ? C.a.createElement(C.a.Fragment, null, C.a.createElement('div', {
- className: 'alert alert--muted text-medium spacing-top-small spacing-bottom-none'
- }, 'Make sure to replace the ', C.a.createElement('i', null, 'EXAMPLE'), ' inside ', C.a.createElement('code', {
- className: 'inline'
- }, 's.src'), ' with the name of your own forum.')) : null, C.a.createElement(YE, {
- language: 'html'
- }, '<div id="disqus_thread"></div>\n<script>\n window.addEventListener(\'message\', receiveMessage, false);\n function receiveMessage(event) {\n if (event.data) {\n var msg;\n try {\n msg = JSON.parse(event.data);\n } catch (err) {\n // Do nothing\n }\n if (!msg) {\n return false;\n }\n if (msg.name === \'resize\' || msg.name === \'rendered\') {\n window.parent.postMessage({\n sentinel: \'amp\',\n type: \'embed-size\',\n height: msg.data.height\n }, \'*\');\n }\n }\n }\n</script>\n<script>\n /**\n * RECOMMENDED CONFIGURATION VARIABLES: EDIT AND UNCOMMENT THE SECTION BELOW TO INSERT DYNAMIC VALUES FROM YOUR PLATFORM OR CMS.\n * LEARN WHY DEFINING THESE VARIABLES IS IMPORTANT: https://disqus.com/admin/universalcode/#configuration-variables\n */\n var disqus_config = function () {\n this.page.url = window.location;\n this.page.identifier = window.location.hash;\n };\n (function() { // DON\'T EDIT BELOW THIS LINE\n var d = document, s = d.createElement(\'script\');\n\n s.src = \'//'.concat(t, '.disqus.com/embed.js\';\n\n s.setAttribute(\'data-timestamp\', +new Date());\n (d.head || d.body).appendChild(s);\n })();\n</script>'))), C.a.createElement('li', {
- id: 'step-2'
- }, 'Refer to the ', C.a.createElement('code', {
- className: 'inline'
- }, 'amp-iframe'), ' ', C.a.createElement('a', {
- href: 'https://www.ampproject.org/docs/reference/extended/amp-iframe.html',
- target: '_blank',
- rel: 'noopener noreferrer'
- }, 'documentation'), ' and add the required ', C.a.createElement('code', {
- className: 'inline'
- }, 'amp-iframe'), ' script to your document\'s ', C.a.createElement('code', {
- className: 'inline'
- }, '<head>'), ':', C.a.createElement('br', null), C.a.createElement(YE, {
- language: 'html'
- }, '<script async custom-element="amp-iframe" src="https://cdn.ampproject.org/v0/amp-iframe-0.1.js"></script>')), C.a.createElement('li', {
- id: 'step-3'
- }, 'Place the following ', C.a.createElement('code', {
- className: 'inline'
- }, '<amp-iframe>'), ' element anywhere within the ', C.a.createElement('code', {
- className: 'inline'
- }, '<body>'), ' of your AMP page. It will likely make sense to place it at the end of your article content, where ever your audience should engage further after reading.', C.a.createElement('br', null), C.a.createElement(YE, {
- language: 'html'
- }, '<amp-iframe\n width=600 height=140\n src="https://example.com/amp#hash"\n layout="responsive"\n sandbox="allow-scripts allow-same-origin allow-modals allow-popups allow-forms"\n resizable\n>\n <div\n aria-label="Load more"\n role=button\n tabindex=0\n overflow\n style="display:block;font-size:12px;font-weight:500;font-family:Helvetica Neue, arial, sans-serif;text-align:center;line-height:1.1;padding:12px 16px;border-radius:4px;background:rgba(29,47,58,0.6);color:rgb(255,255,255)"\n >\n Load more\n </div>\n</amp-iframe>')), C.a.createElement('li', {
- id: 'step-4'
- }, 'Replace ', C.a.createElement('code', {
- className: 'inline'
- }, 'hash'), ' in the ', C.a.createElement('code', {
- className: 'inline'
- }, 'src'), ' with a unique identifier that represents the page where you’d like a specific thread to display. If you are loading the ', C.a.createElement('code', {
- className: 'inline'
- }, '<amp-iframe>'), ' element on multiple pages, you will need to generate the ', C.a.createElement('code', {
- className: 'inline'
- }, 'hash'), ' dynamically for each page.', C.a.createElement('br', null), 'The hash you provide will be used in the ', C.a.createElement('code', {
- className: 'inline'
- }, 'identifier'), ' variable in ', C.a.createElement('a', {
- className: 'text-bold',
- href: '#step-1'
- }, 'Step 1'), '. Learn more about ', C.a.createElement('a', {
- href: Pn.pageIdentifiers
- }, 'identifiers'), '.'), C.a.createElement('li', {
- id: 'step-5'
- }, 'Add the new domain as a Trusted Domain in your Admin › Settings › ', C.a.createElement(v.Link, {
- to: '/settings/advanced/'
- }, 'Advanced'), '.'))))
- };
- Pc.displayName = 'AmpInstall',
- Pc.propTypes = {
- selection: ht,
- isBaseInstallPath: b.a.bool
- };
- Cl = Pc,
- Yc = function (e) {
- return C.a.createElement(tO, {
- selection: e.selection,
- platformClassName: 'adobemuse',
- platformPageName: 'Adobe Muse',
- isBaseInstallPath: e.isBaseInstallPath
- }, C.a.createElement('div', {
- className: 'padding-double'
- }, C.a.createElement('ol', {
- className: 'installation__instruction-list'
- }, C.a.createElement('li', null, 'Open your website\'s ', C.a.createElement('strong', null, '.muse'), ' file and select a page where you would like Disqus to load'), C.a.createElement('li', null, 'In the menu, go to Object > ', C.a.createElement('strong', null, 'Insert HTML...')), C.a.createElement('li', null, 'Copy and paste the ', C.a.createElement(v.Link, {
- to: '/install/platforms/universalcode'
- }, 'Universal Embed Code'), ' ', 'in the HTML Code widow.'))))
- };
- Yc.displayName = 'AdobemuseInstall',
- Yc.propTypes = {
- selection: ht,
- isBaseInstallPath: b.a.bool
- };
- lh = Yc,
- sl = function (e) {
- var t = ((e.selection || {
- }).forum || {
- }).shortname || 'EXAMPLE';
- return C.a.createElement(tO, {
- selection: e.selection,
- platformClassName: 'jimdo',
- platformPageName: 'Jimdo',
- isBaseInstallPath: e.isBaseInstallPath
- }, C.a.createElement('div', {
- className: 'padding-double'
- }, C.a.createElement('ol', {
- className: 'installation__instruction-list'
- }, C.a.createElement('li', null, 'Log into Jimdo, open the menu in the top left, and click ', C.a.createElement('strong', null, 'Blog'), '.'), C.a.createElement('li', null, 'Click ', C.a.createElement('strong', null, 'General'), ' in the Settings section on the left.'), C.a.createElement('li', null, 'Enable comments, choose Disqus from the dropdown, enter your shortname:', ' ', C.a.createElement('code', {
- className: 'inline'
- }, t), ' and click ', C.a.createElement('strong', null, 'Save'), '.')), C.a.createElement('div', {
- className: 'alert alert--muted text-medium'
- }, C.a.createElement('strong', null, 'Note:'), ' This installation method enables Disqus on Blog Posts only. To add Disqus to other pages, use the ', C.a.createElement(v.Link, {
- to: '/install/platforms/universalcode'
- }, 'Universal Embed Code'), ' ', 'instructions and Jimdo\'s', ' ', C.a.createElement('a', {
- href: Pn.jimdoHelp,
- target: '_blank',
- rel: 'noopener noreferrer'
- }, 'Widget/HTML module'), '.')))
- };
- sl.displayName = 'JimdoInstall',
- sl.propTypes = {
- selection: ht,
- isBaseInstallPath: b.a.bool
- };
- Vb = sl,
- yl = function (e) {
- var t = ((e.selection || {
- }).forum || {
- }).shortname || 'EXAMPLE';
- return C.a.createElement(tO, {
- selection: e.selection,
- platformClassName: 'postachio',
- platformPageName: 'Postach.io',
- isBaseInstallPath: e.isBaseInstallPath
- }, C.a.createElement('div', {
- className: 'padding-double'
- }, C.a.createElement('ol', {
- className: 'installation__instruction-list'
- }, C.a.createElement('li', null, 'In Postach.io, on your Sites page, click on the ', C.a.createElement('strong', null, 'pencil icon'), ' to edit.'), C.a.createElement('li', null, 'Select ', C.a.createElement('strong', null, 'Add-Ons'), '. '), C.a.createElement('li', null, 'Find the ', C.a.createElement('strong', null, 'Disqus Comments'), ' Add-On and click ', C.a.createElement('strong', null, 'Set Up'), '.'), C.a.createElement('li', null, 'In the box provided, enter your shortname: ', C.a.createElement('code', {
- className: 'inline'
- }, t)), C.a.createElement('li', null, 'Save your changes.'))))
- };
- yl.displayName = 'PostachioInstall',
- yl.propTypes = {
- selection: ht,
- isBaseInstallPath: b.a.bool
- };
- Jc = yl,
- Ru = function (e) {
- var t = ((e.selection || {
- }).forum || {
- }).shortname || 'EXAMPLE';
- return C.a.createElement(tO, {
- selection: e.selection,
- platformClassName: 'gatsby',
- platformPageName: 'Gatsby',
- isBaseInstallPath: e.isBaseInstallPath
- }, C.a.createElement('div', {
- className: 'padding-double'
- }, C.a.createElement('ol', {
- className: 'installation__instruction-list'
- }, C.a.createElement('li', null, 'Install the ', C.a.createElement('code', {
- className: 'inline'
- }, 'gatsby-plugin-disqus'), ' plugin as a dependency with ', C.a.createElement('a', {
- href: 'https://www.npmjs.com/',
- target: '_blank',
- rel: 'noopener noreferrer'
- }, 'npm'), ' by running the following command in your website directory.', C.a.createElement('br', null), C.a.createElement(YE, {
- language: 'sh'
- }, 'npm install --save gatsby-plugin-disqus')), C.a.createElement('li', null, 'Add the plugin to your ', C.a.createElement('code', {
- className: 'inline'
- }, 'gatsby-config.js'), ' file with your Disqus shortname.', 'EXAMPLE' === t ? C.a.createElement(C.a.Fragment, null, C.a.createElement('div', {
- className: 'alert alert--muted text-medium spacing-top-small spacing-bottom-none'
- }, 'Make sure to replace the ', C.a.createElement('i', null, 'EXAMPLE'), ' inside ', C.a.createElement('code', {
- className: 'inline'
- }, 'options'), ' with the shortname for your own forum.')) : null, C.a.createElement('br', null), C.a.createElement(YE, {
- language: 'javascript'
- }, '// gatsby-config.js\nmodule.exports = {\n plugins: [\n {\n resolve: `gatsby-plugin-disqus`,\n options: {\n shortname: `'.concat(t, '`\n }\n },\n ]\n}'))), C.a.createElement('li', null, 'The plugin can then be used to place the Disqus comment section in your page as shown in the following example:', C.a.createElement('br', null), C.a.createElement(YE, {
- language: 'jsx'
- }, 'import { Disqus } from \'gatsby-plugin-disqus\';\n\nconst Template = () => (\n /* Page contents */\n\n <Disqus\n config={\n /* Replace PAGE_URL with your post\'s canonical URL variable */\n url: \'PAGE_URL\',\n /* Replace PAGE_IDENTIFIER with your page\'s unique identifier variable */\n identifier: \'PAGE_IDENTIFIER\',\n /* Replace PAGE_TITLE with the title of the page */\n title: \'PAGE_TITLE\',\n }\n />\n);')))))
- };
- Ru.displayName = 'GatsbyInstall',
- Ru.propTypes = {
- selection: ht,
- isBaseInstallPath: b.a.bool
- };
- Bu = Ru,
- h = function (e) {
- var t = ((e.selection || {
- }).forum || {
- }).shortname || 'EXAMPLE';
- return C.a.createElement(tO, {
- selection: e.selection,
- platformClassName: 'pattern',
- platformPageName: 'Pattern by Etsy',
- isBaseInstallPath: e.isBaseInstallPath
- }, C.a.createElement('div', {
- className: 'padding-double'
- }, C.a.createElement('ol', {
- className: 'installation__instruction-list'
- }, C.a.createElement('li', null, 'Navigate to your ', C.a.createElement('strong', null, 'Settings'), ' from your Pattern Dashboard.'), C.a.createElement('li', null, 'In the Disqus shortname field, enter your shortname: ', C.a.createElement('code', {
- className: 'inline site-shortname'
- }, t), '.'), C.a.createElement('li', null, 'Click ', C.a.createElement('strong', null, 'Publish'), '.')), C.a.createElement('div', {
- className: 'alert alert--muted text-medium'
- }, 'Note: For blog posts, you will have to enable comments on each post in your ', C.a.createElement('strong', null, 'Blog Settings'), '.')))
- };
- h.displayName = 'PatternInstall',
- h.propTypes = {
- selection: ht,
- isBaseInstallPath: b.a.bool
- };
- lt = h,
- ut = function (e) {
- var t = ((e.selection || {
- }).forum || {
- }).shortname || 'EXAMPLE';
- return C.a.createElement(tO, {
- selection: e.selection,
- platformClassName: 'react',
- platformPageName: 'React',
- isBaseInstallPath: e.isBaseInstallPath
- }, C.a.createElement('div', {
- className: 'settings__content'
- }, C.a.createElement('h2', {
- className: 'text-gray-dark text-larger spacing-bottom'
- }, 'Installation'), C.a.createElement('ul', {
- className: 'spacing-bottom'
- }, C.a.createElement('li', {
- className: 'spacing-bottom'
- }, 'Using npm:', C.a.createElement(YE, null, '$ npm install --save disqus-react')), C.a.createElement('li', null, 'Using yarn:', C.a.createElement(YE, null, '$ npm install --save disqus-react'))), C.a.createElement('h2', {
- className: 'text-gray-dark text-larger spacing-bottom'
- }, 'Usage: DiscussionEmbed'), C.a.createElement('p', null, 'This is the component that will load the main Disqus comments section.'), C.a.createElement(YE, {
- language: 'typescript'
- }, 'import { DiscussionEmbed } from \'disqus-react\';\n\n<DiscussionEmbed\n shortname=\''.concat(t, '\'\n config={\n {\n url: this.props.article.url,\n identifier: this.props.article.id,\n title: this.props.article.title,\n language: \'zh_TW\' //e.g. for Traditional Chinese (Taiwan)\n }\n }\n/>')), C.a.createElement('p', {
- className: 'spacing-top spacing-bottom'
- }, 'This component is limited to one instance in the DOM at a time and will handle updates to both the ', C.a.createElement('code', null, 'config'), ' and ', C.a.createElement('code', null, 'shortname'), ' props and reload appropriately with the new discussion thread.'), C.a.createElement('h2', {
- className: 'text-gray-dark text-larger spacing-bottom'
- }, 'Usage: CommentCount'), C.a.createElement('p', null, 'This component will display the comment count for the Disqus thread associated with the provided config.'), C.a.createElement(YE, {
- language: 'typescript'
- }, 'import { CommentCount } from \'disqus-react\';\n\n<CommentCount\n shortname=\''.concat(t, '\'\n config={\n {\n url: this.props.article.url,\n identifier: this.props.article.id,\n title: this.props.article.title,\n }\n }\n>\n {/* Placeholder Text */}\n Comments\n</CommentCount>')), C.a.createElement('p', {
- className: 'spacing-top spacing-bottom'
- }, 'Multiple instances of this component can be included on the same page with different', ' ', C.a.createElement('code', null, 'config'), ' variables (e.g. an article list showing the comment count for each). However, all threads on the site must be under the same primary site ', C.a.createElement('code', null, 'shortname'), '. If the component receives a new ', C.a.createElement('code', null, 'shortname'), ', all instances will be reset with counts for threads matching the updated site.'), C.a.createElement('div', {
- className: 'alert alert--muted text-medium'
- }, 'See our ', C.a.createElement('a', {
- href: Pn.githubDisqusReact,
- target: '_blank',
- rel: 'noopener noreferrer'
- }, 'GitHub'), ' ', 'for more examples.')))
- };
- ut.displayName = 'UniversalCodeInstall',
- ut.propTypes = {
- selection: ht,
- isBaseInstallPath: b.a.bool
- };
- qn = ut;
- function _O(e) {
- return (_O = 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator ? function (e) {
- return typeof e
- }
- : function (e) {
- return e && 'function' == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? 'symbol' : typeof e
- }) (e)
- }
- function EO(e, t) {
- for (var n = 0; n < t.length; n++) {
- var a = t[n];
- a.enumerable = a.enumerable || !1,
- a.configurable = !0,
- 'value' in a && (a.writable = !0),
- Object.defineProperty(e, a.key, a)
- }
- }
- function OO(e, t) {
- return (OO = Object.setPrototypeOf || function (e, t) {
- return e.__proto__ = t,
- e
- }) (e, t)
- }
- function SO(n) {
- var a = function () {
- if ('undefined' == typeof Reflect || !Reflect.construct) return !1;
- if (Reflect.construct.sham) return !1;
- if ('function' == typeof Proxy) return !0;
- try {
- return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [
- ], function () {
- })),
- !0
- } catch (e) {
- return !1
- }
- }();
- return function () {
- var e,
- t = PO(n);
- return e = a ? (e = PO(this).constructor, Reflect.construct(t, arguments, e)) : t.apply(this, arguments),
- t = this,
- !(e = e) || 'object' !== _O(e) && 'function' != typeof e ? wO(t) : e
- }
- }
- function wO(e) {
- if (void 0 === e) throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called');
- return e
- }
- function PO(e) {
- return (PO = Object.setPrototypeOf ? Object.getPrototypeOf : function (e) {
- return e.__proto__ || Object.getPrototypeOf(e)
- }) (e)
- }
- function kO(e, t, n) {
- return t in e ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n,
- e
- }
- i = function () {
- !function (e, t) {
- if ('function' != typeof t && null !== t) throw new TypeError('Super expression must either be null or a function');
- e.prototype = Object.create(t && t.prototype, {
- constructor: {
- value: e,
- writable: !0,
- configurable: !0
- }
- }),
- t && OO(e, t)
- }(o, A);
- var e,
- t,
- n,
- r = SO(o);
- function o() {
- var t;
- !function (e, t) {
- if (!(e instanceof t)) throw new TypeError('Cannot call a class as a function')
- }(this, o);
- for (var e = arguments.length, n = Array(e), a = 0; a < e; a++) n[a] = arguments[a];
- return kO(wO(t = r.call.apply(r, [
- this
- ].concat(n))), 'state', {
- details: null,
- fetchError: null,
- isFetching: !1
- }),
- kO(wO(t), 'fetchImportDetails', function (e) {
- return t.setState({
- isFetching: !0,
- fetchError: null
- }),
- t.apiCall = io.a.call('imports/details', {
- data: {
- forum: t.props.selection.forum.shortname,
- group: e
- }
- }).done(t.handleFetchDetailsSuccess).fail(t.handleFetchError),
- t.apiCall
- }),
- kO(wO(t), 'handleFetchDetailsSuccess', function (e) {
- t.setState({
- isFetching: !1,
- details: e.response
- })
- }),
- kO(wO(t), 'handleFetchError', function (e) {
- t.setState({
- isFetching: !1,
- fetchError: t.parseErrorResponse(e)
- })
- }),
- kO(wO(t), 'parseErrorResponse', function (e) {
- var t;
- try {
- ~(t = JSON.parse(e.responseText).response).indexOf('Invalid argument, \'group\': Unable to find group') && (t = 'No import was found with this ID.')
- } catch (e) {
- t = 'There was an error retrieving the details of this import.'
- }
- return t
- }),
- kO(wO(t), 'getComponentProps', function () {
- return {
- importHistoryDetails: t.state.details,
- importHistoryIsFetching: t.state.isFetching,
- importHistoryError: t.state.fetchError
- }
- }),
- t
- }
- return e = o,
- (t = [
- {
- key: 'componentDidMount',
- value: function () {
- this.props.params.groupId && this.fetchImportDetails(this.props.params.groupId)
- }
- },
- {
- key: 'componentWillUnmount',
- value: function () {
- this.apiCall && 'pending' === this.apiCall.state() && this.apiCall.abort()
- }
- }
- ]) && EO(e.prototype, t),
- n && EO(e, n),
- o
- }();
- kO(i, 'displayName', 'ImportHistoryDriver'),
- kO(i, 'propTypes', {
- selection: ht.isRequired,
- params: b.a.object.isRequired
- });
- var go = Object(ki.createDriver) (i, function (e) {
- return {
- selection: e.selection
- }
- }),
- NO = '//import.disqus.com/',
- Qs = function (e) {
- if (e.importHistoryIsFetching) return C.a.createElement(Ji, null);
- if (e.importHistoryError) return C.a.createElement(Ki, {
- message: e.importHistoryError,
- alertType: 'error'
- });
- if (!e.importHistoryDetails) return null;
- var t = e.importHistoryDetails,
- n = t.startedAt && ct() (t.startedAt).format('LLL'),
- a = t.finishedAt && ct() (t.finishedAt).format('LLL'),
- r = 'text-gray';
- return 100 <= t.statusCode ? r = 'text-success' : t.statusCode < 0 && (r = 'text-error'),
- C.a.createElement('div', null, C.a.createElement('div', {
- className: 'content__wrap spacing-bottom-double'
- }, C.a.createElement('header', {
- className: 'settings__header'
- }, C.a.createElement('h2', {
- className: 'text-larger text-gray-darker spacing-bottom-small'
- }, 'Import Details'), t ? C.a.createElement('p', {
- className: r
- }, t.statusName) : null), C.a.createElement('section', {
- className: 'settings__content'
- }, t ? C.a.createElement('div', {
- className: 'text-medium text-gray-dark spacing-top-narrow'
- }, C.a.createElement('p', null, C.a.createElement('strong', {
- className: 'spacing-right text-gray-darker'
- }, 'Started'), n), C.a.createElement('p', null, C.a.createElement('strong', {
- className: 'spacing-right text-gray-darker'
- }, 'Completed'), a), C.a.createElement('p', null, C.a.createElement('strong', {
- className: 'spacing-right text-gray-darker'
- }, 'Platform'), t.platform), C.a.createElement('p', null, C.a.createElement('strong', {
- className: 'spacing-right text-gray-darker'
- }, 'Progress'), ''.concat(t.chunksDone, ' / ').concat(t.chunksTotal, ' ').concat(1 === t.chunksTotal ? 'File' : 'Files')), C.a.createElement('p', {
- className: 'spacing-bottom'
- }, C.a.createElement('strong', {
- className: 'spacing-right text-gray-darker'
- }, 'Status'), C.a.createElement('span', {
- className: r
- }, t.statusName)), C.a.createElement('a', {
- href: ''.concat(NO, 'group/').concat(t.forum, '/').concat(e.params.groupId, '/'),
- className: 'button button-small button-outline'
- }, 'More Details')) : null), C.a.createElement('footer', {
- className: 'settings__footer'
- }, C.a.createElement('a', {
- href: ''.concat(NO + t.forum, '/?a=1'),
- className: 'button button-outline button-medium'
- }, 'All Imports for ', t.forum))))
- };
- Qs.displayName = 'ImportDetails',
- Qs.propTypes = {
- params: b.a.object.isRequired,
- importHistoryDetails: b.a.object,
- importHistoryIsFetching: b.a.bool,
- importHistoryError: b.a.string
- };
- var ac = Object(u.connect) (function (e) {
- return {
- selection: e.selection
- }
- }) (Ni.a.attachDrivers(Qs, [
- go
- ])),
- CO = {
- forum: 'signup_forum',
- org: 'signup_org',
- start: 'signup_start',
- settingsOrg: 'settings_org',
- deactivationHubOrg: 'deactivation_hub_organization_flow',
- deactivationHubForum: 'deactivation_hub_forum_flow'
- };
- function RO(t, e) {
- var n,
- a = Object.keys(t);
- return Object.getOwnPropertySymbols && (n = Object.getOwnPropertySymbols(t), e && (n = n.filter(function (e) {
- return Object.getOwnPropertyDescriptor(t, e).enumerable
- })), a.push.apply(a, n)),
- a
- }
- function xO(a) {
- for (var e = 1; e < arguments.length; e++) {
- var r = null != arguments[e] ? arguments[e] : {
- };
- e % 2 ? RO(Object(r), !0).forEach(function (e) {
- var t,
- n;
- n = r[t = e],
- t in (e = a) ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(a, Object.getOwnPropertyDescriptors(r)) : RO(Object(r)).forEach(function (e) {
- Object.defineProperty(a, e, Object.getOwnPropertyDescriptor(r, e))
- })
- }
- return a
- }
- Ls = function (e) {
- return C.a.createElement('div', {
- className: 'section-contained'
- }, C.a.createElement('div', {
- className: 'layout layout--publishers'
- }, C.a.createElement('div', {
- className: 'layout__main'
- }, C.a.createElement(ob, {
- auth: e.auth,
- selection: e.selection
- }), C.a.createElement('div', {
- className: 'layout__content'
- }, C.a.cloneElement(e.children, xO(xO({
- }, e), {
- }, {
- initialQuestionGroup: CO.settingsOrg
- }))))))
- };
- Ls.displayName = 'OrgSettings',
- Ls.propTypes = {
- auth: Nc.isRequired,
- children: b.a.node.isRequired,
- forums: b.a.object.isRequired,
- organizations: b.a.object.isRequired,
- selection: ht.isRequired
- };
- var AO = Object(u.connect) (function (e) {
- return {
- selection: e.selection
- }
- }) (Ni.a.attachDrivers(Ls, [
- bc
- ]));
- function DO(e) {
- return (DO = 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator ? function (e) {
- return typeof e
- }
- : function (e) {
- return e && 'function' == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? 'symbol' : typeof e
- }) (e)
- }
- function jO(t, e) {
- var n,
- a = Object.keys(t);
- return Object.getOwnPropertySymbols && (n = Object.getOwnPropertySymbols(t), e && (n = n.filter(function (e) {
- return Object.getOwnPropertyDescriptor(t, e).enumerable
- })), a.push.apply(a, n)),
- a
- }
- function TO(t) {
- for (var e = 1; e < arguments.length; e++) {
- var n = null != arguments[e] ? arguments[e] : {
- };
- e % 2 ? jO(Object(n), !0).forEach(function (e) {
- MO(t, e, n[e])
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(n)) : jO(Object(n)).forEach(function (e) {
- Object.defineProperty(t, e, Object.getOwnPropertyDescriptor(n, e))
- })
- }
- return t
- }
- function IO(e, t) {
- for (var n = 0; n < t.length; n++) {
- var a = t[n];
- a.enumerable = a.enumerable || !1,
- a.configurable = !0,
- 'value' in a && (a.writable = !0),
- Object.defineProperty(e, a.key, a)
- }
- }
- function qO(e, t) {
- return (qO = Object.setPrototypeOf || function (e, t) {
- return e.__proto__ = t,
- e
- }) (e, t)
- }
- function FO(n) {
- var a = function () {
- if ('undefined' == typeof Reflect || !Reflect.construct) return !1;
- if (Reflect.construct.sham) return !1;
- if ('function' == typeof Proxy) return !0;
- try {
- return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [
- ], function () {
- })),
- !0
- } catch (e) {
- return !1
- }
- }();
- return function () {
- var e,
- t = UO(n);
- return e = a ? (e = UO(this).constructor, Reflect.construct(t, arguments, e)) : t.apply(this, arguments),
- t = this,
- !(e = e) || 'object' !== DO(e) && 'function' != typeof e ? LO(t) : e
- }
- }
- function LO(e) {
- if (void 0 === e) throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called');
- return e
- }
- function UO(e) {
- return (UO = Object.setPrototypeOf ? Object.getPrototypeOf : function (e) {
- return e.__proto__ || Object.getPrototypeOf(e)
- }) (e)
- }
- function MO(e, t, n) {
- return t in e ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n,
- e
- }
- Mo = function () {
- !function (e, t) {
- if ('function' != typeof t && null !== t) throw new TypeError('Super expression must either be null or a function');
- e.prototype = Object.create(t && t.prototype, {
- constructor: {
- value: e,
- writable: !0,
- configurable: !0
- }
- }),
- t && qO(e, t)
- }(o, A);
- var e,
- t,
- n,
- r = FO(o);
- function o() {
- var a;
- !function (e, t) {
- if (!(e instanceof t)) throw new TypeError('Cannot call a class as a function')
- }(this, o);
- for (var e = arguments.length, t = Array(e), n = 0; n < e; n++) t[n] = arguments[n];
- return MO(LO(a = r.call.apply(r, [
- this
- ].concat(t))), 'state', {
- newUsername: ''
- }),
- MO(LO(a), 'handleAddModerator', function () {
- var e = a.state.newUsername.trim();
- e && a.props.addOrgAdmin({
- data: {
- username: e
- },
- onSuccess: function () {
- a.setState({
- newUsername: ''
- })
- }
- })
- }),
- MO(LO(a), 'handlePermissionChange', function (e, t, n) {
- n = MO({
- isAdmin: e.isAdmin ? 1 : 0,
- isModerator: e.isModerator ? 1 : 0
- }, t, n.target.checked ? 1 : 0);
- a.props.updateOrgAdmin(e.user.username, n)
- }),
- a
- }
- return e = o,
- (t = [
- {
- key: 'componentDidMount',
- value: function () {
- this.props.fetchOrgAdminList()
- }
- },
- {
- key: 'componentWillReceiveProps',
- value: function (e) {
- this.props.orgAdminIsSaving && e.orgAdminIsSaved && this.props.fetchOrgAdminList()
- }
- },
- {
- key: 'render',
- value: function () {
- var a = this;
- return this.props.orgAdminListIsFetching && !this.props.orgAdminList ? C.a.createElement(Ji, null) : this.props.orgAdminListError ? C.a.createElement(Ki, {
- message: this.props.orgAdminListError,
- alertType: 'error'
- }) : C.a.createElement('div', null, C.a.createElement('div', {
- className: 'content__wrap spacing-bottom-double'
- }, C.a.createElement('header', {
- className: 'settings__header'
- }, C.a.createElement('h2', {
- className: 'text-larger text-gray-darker spacing-bottom-small'
- }, 'Organization Admins'), C.a.createElement('p', {
- className: 'text-gray'
- }, 'Add and remove admins so they can help manage your organization. ', C.a.createElement('a', {
- href: Pn.adminRoles,
- target: '_blank',
- rel: 'noopener noreferrer'
- }, 'Learn more »'))), C.a.createElement('section', null, (this.props.orgAdminList || [
- ]).map(function (e) {
- var t = e.user.username === a.props.selection.organization.owner,
- n = '//'.concat(pt.a.disqusHost, '/by/').concat(e.user.username, '/');
- return C.a.createElement('div', {
- className: 'settings-list__item',
- key: e.id
- }, C.a.createElement('div', {
- className: 'align align--between'
- }, C.a.createElement('div', {
- className: 'spacing-right align'
- }, C.a.createElement('div', {
- className: 'spacing-right spacing-top-small'
- }, C.a.createElement('img', {
- className: 'border-radius-base',
- src: e.user.avatar.cache,
- width: '40',
- height: '40'
- })), C.a.createElement('div', null, C.a.createElement('a', {
- href: n,
- className: 'text-medium text-semibold'
- }, e.user.name), t ? C.a.createElement('p', {
- className: 'text-small text-gray spacing-top-tiny'
- }, 'You\'re the organization super admin and have full permissions.') : C.a.createElement('p', {
- className: 'text-small text-gray spacing-top-tiny'
- }, C.a.createElement('label', {
- className: 'fieldset__inline-block--checkbox spacing-right-large'
- }, C.a.createElement('input', {
- type: 'checkbox',
- className: 'input--checkbox',
- checked: e.isAdmin,
- onChange: a.handlePermissionChange.bind(a, e, 'isAdmin'),
- disabled: a.props.orgAdminIsSaving
- }), 'Can edit organization info'), C.a.createElement('label', {
- className: 'fieldset__inline-block--checkbox'
- }, C.a.createElement('input', {
- type: 'checkbox',
- className: 'input--checkbox',
- checked: e.isModerator,
- onChange: a.handlePermissionChange.bind(a, e, 'isModerator'),
- disabled: a.props.orgAdminIsSaving
- }), 'Can manage all organization sites')))), t ? null : C.a.createElement('div', {
- className: 'align-min-tablet align--middle spacing-top-small spacing-bottom-small'
- }, C.a.createElement('button', {
- className: 'button button-outline text-medium',
- onClick: a.props.removeOrgAdmin.bind(null, e.user.id),
- disabled: a.props.orgAdminIsSaving
- }, 'Remove'))))
- }), C.a.createElement('div', {
- className: 'settings-list__item'
- }, C.a.createElement('form', {
- onSubmit: function (e) {
- return e.preventDefault()
- }
- }, C.a.createElement('div', {
- className: 'align spacing-top-small'
- }, C.a.createElement('div', {
- className: 'spacing-right align__item--grow'
- }, C.a.createElement('input', {
- type: 'text',
- className: 'input--textbox',
- placeholder: 'Add a new org admin by username',
- onChange: function (e) {
- return a.setState({
- newUsername: e.target.value
- })
- },
- value: this.state.newUsername,
- disabled: this.props.orgAdminIsSaving
- })), C.a.createElement('button', {
- className: 'button button-outline text-medium',
- onClick: this.handleAddModerator,
- disabled: this.props.orgAdminIsSaving || !this.state.newUsername
- }, 'Add Admin')), C.a.createElement('p', {
- className: 'fieldset__description spacing-bottom-small text-small text-gray spacing-top-tiny'
- }, 'People you add will receive a notification that they\'re now an admin of this organization.'), this.props.orgAdminSaveError ? C.a.createElement('p', {
- className: 'text-medium text-error text-semibold spacing-narrow'
- }, this.props.orgAdminSaveError) : null)))))
- }
- }
- ]) && IO(e.prototype, t),
- n && IO(e, n),
- o
- }();
- MO(Mo, 'displayName', 'OrgSettingsAdmins'),
- MO(Mo, 'propTypes', {
- selection: ht.isRequired,
- orgAdminList: b.a.arrayOf(b.a.shape({
- id: b.a.number.isRequired,
- organizationId: b.a.number.isRequired,
- isAdmin: b.a.bool.isRequired,
- isModerator: b.a.bool.isRequired,
- user: To
- })),
- orgAdminIsFetching: b.a.bool,
- orgAdminIsSaving: b.a.bool,
- orgAdminIsSaved: b.a.bool,
- orgAdminFetchError: b.a.string,
- orgAdminSaveError: b.a.string,
- fetchOrgAdminList: b.a.func.isRequired,
- addOrgAdmin: b.a.func.isRequired,
- updateOrgAdmin: b.a.func.isRequired,
- removeOrgAdmin: b.a.func.isRequired
- });
- wi = Object(u.connect) (function (e) {
- return TO({
- selection: e.selection
- }, e.orgAdmin)
- }, TO({
- }, Ss)) (Fo() (Mo));
- function BO(e) {
- return (BO = 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator ? function (e) {
- return typeof e
- }
- : function (e) {
- return e && 'function' == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? 'symbol' : typeof e
- }) (e)
- }
- function zO() {
- return (zO = Object.assign || function (e) {
- for (var t = 1; t < arguments.length; t++) {
- var n,
- a = arguments[t];
- for (n in a) Object.prototype.hasOwnProperty.call(a, n) && (e[n] = a[n])
- }
- return e
- }).apply(this, arguments)
- }
- function HO(e, t) {
- for (var n = 0; n < t.length; n++) {
- var a = t[n];
- a.enumerable = a.enumerable || !1,
- a.configurable = !0,
- 'value' in a && (a.writable = !0),
- Object.defineProperty(e, a.key, a)
- }
- }
- function GO(e, t) {
- return (GO = Object.setPrototypeOf || function (e, t) {
- return e.__proto__ = t,
- e
- }) (e, t)
- }
- function VO(n) {
- var a = function () {
- if ('undefined' == typeof Reflect || !Reflect.construct) return !1;
- if (Reflect.construct.sham) return !1;
- if ('function' == typeof Proxy) return !0;
- try {
- return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [
- ], function () {
- })),
- !0
- } catch (e) {
- return !1
- }
- }();
- return function () {
- var e,
- t = YO(n);
- return e = a ? (e = YO(this).constructor, Reflect.construct(t, arguments, e)) : t.apply(this, arguments),
- t = this,
- !(e = e) || 'object' !== BO(e) && 'function' != typeof e ? WO(t) : e
- }
- }
- function WO(e) {
- if (void 0 === e) throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called');
- return e
- }
- function YO(e) {
- return (YO = Object.setPrototypeOf ? Object.getPrototypeOf : function (e) {
- return e.__proto__ || Object.getPrototypeOf(e)
- }) (e)
- }
- function QO(e, t, n) {
- return t in e ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n,
- e
- }
- Vi = function () {
- !function (e, t) {
- if ('function' != typeof t && null !== t) throw new TypeError('Super expression must either be null or a function');
- e.prototype = Object.create(t && t.prototype, {
- constructor: {
- value: e,
- writable: !0,
- configurable: !0
- }
- }),
- t && GO(e, t)
- }(o, A);
- var e,
- t,
- n,
- r = VO(o);
- function o() {
- var n;
- !function (e, t) {
- if (!(e instanceof t)) throw new TypeError('Cannot call a class as a function')
- }(this, o);
- for (var e = arguments.length, t = Array(e), a = 0; a < e; a++) t[a] = arguments[a];
- return QO(WO(n = r.call.apply(r, [
- this
- ].concat(t))), 'state', {
- name: n.props.selection.organization ? n.props.selection.organization.name : '',
- error: null,
- isLoading: !1
- }),
- QO(WO(n), 'handleUpdateOrg', function (e, t) {
- return n.setState({
- isLoading: !0,
- error: null
- }),
- n.props.selection.organization && (e = zO({
- organization: n.props.selection.organization.id
- }, e)),
- n.apiCall = io.a.call(t && t.useInternal ? 'internal/organizations/update' : 'organizations/update', {
- data: e,
- method: 'POST'
- }).done(n.handleUpdateSuccess).fail(n.handleUpdateError),
- n.apiCall
- }),
- QO(WO(n), 'handleDismissError', function () {
- n.setState({
- error: null
- })
- }),
- QO(WO(n), 'handleUpdateSuccess', function () {
- n.setState({
- error: null,
- isLoading: !1
- })
- }),
- QO(WO(n), 'handleUpdateError', function (e) {
- var t;
- try {
- ~(t = JSON.parse(e.responseText).response).indexOf('Missing required argument: \'name\'') && (t = 'Name can\'t be blank')
- } catch (e) {
- t = 'There was an error saving your changes.'
- }
- n.setState({
- error: t,
- isLoading: !1
- })
- }),
- QO(WO(n), 'getComponentProps', function () {
- return {
- orgUpdateName: n.state.name,
- orgUpdateError: n.state.error,
- orgUpdateIsLoading: n.state.isLoading,
- orgUpdateOnUpdateOrg: n.handleUpdateOrg,
- orgUpdateOnDismissError: n.handleDismissError
- }
- }),
- n
- }
- return e = o,
- (t = [
- {
- key: 'componentWillUnmount',
- value: function () {
- this.apiCall && 'pending' === this.apiCall.state() && this.apiCall.abort()
- }
- }
- ]) && HO(e.prototype, t),
- n && HO(e, n),
- o
- }();
- QO(Vi, 'displayName', 'OrgUpdateDriver'),
- QO(Vi, 'propTypes', {
- selection: ht.isRequired
- });
- Pc = Object(ki.createDriver) (Vi, function (e) {
- return {
- selection: e.selection
- }
- });
- function KO(e) {
- return (KO = 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator ? function (e) {
- return typeof e
- }
- : function (e) {
- return e && 'function' == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? 'symbol' : typeof e
- }) (e)
- }
- function JO(e) {
- return function (e) {
- if (Array.isArray(e)) return $O(e)
- }(e) || function (e) {
- if ('undefined' != typeof Symbol && null != e[Symbol.iterator] || null != e['@@iterator']) return Array.from(e)
- }(e) || function (e, t) {
- if (e) {
- if ('string' == typeof e) return $O(e, t);
- var n = Object.prototype.toString.call(e).slice(8, - 1);
- return 'Map' === (n = 'Object' === n && e.constructor ? e.constructor.name : n) || 'Set' === n ? Array.from(e) : 'Arguments' === n || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n) ? $O(e, t) : void 0
- }
- }(e) || function () {
- throw new TypeError('Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.')
- }()
- }
- function $O(e, t) {
- for (var n = 0, a = Array(t = null == t || e.length < t ? e.length : t); n < t; n++) a[n] = e[n];
- return a
- }
- function ZO(e, t) {
- for (var n = 0; n < t.length; n++) {
- var a = t[n];
- a.enumerable = a.enumerable || !1,
- a.configurable = !0,
- 'value' in a && (a.writable = !0),
- Object.defineProperty(e, a.key, a)
- }
- }
- function XO(e, t) {
- return (XO = Object.setPrototypeOf || function (e, t) {
- return e.__proto__ = t,
- e
- }) (e, t)
- }
- function eS(n) {
- var a = function () {
- if ('undefined' == typeof Reflect || !Reflect.construct) return !1;
- if (Reflect.construct.sham) return !1;
- if ('function' == typeof Proxy) return !0;
- try {
- return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [
- ], function () {
- })),
- !0
- } catch (e) {
- return !1
- }
- }();
- return function () {
- var e,
- t = nS(n);
- return e = a ? (e = nS(this).constructor, Reflect.construct(t, arguments, e)) : t.apply(this, arguments),
- t = this,
- !(e = e) || 'object' !== KO(e) && 'function' != typeof e ? tS(t) : e
- }
- }
- function tS(e) {
- if (void 0 === e) throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called');
- return e
- }
- function nS(e) {
- return (nS = Object.setPrototypeOf ? Object.getPrototypeOf : function (e) {
- return e.__proto__ || Object.getPrototypeOf(e)
- }) (e)
- }
- function aS(e, t, n) {
- return t in e ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n,
- e
- }
- Yc = function () {
- !function (e, t) {
- if ('function' != typeof t && null !== t) throw new TypeError('Super expression must either be null or a function');
- e.prototype = Object.create(t && t.prototype, {
- constructor: {
- value: e,
- writable: !0,
- configurable: !0
- }
- }),
- t && XO(e, t)
- }(o, A);
- var e,
- t,
- n,
- a = eS(o);
- function o() {
- var r;
- !function (e, t) {
- if (!(e instanceof t)) throw new TypeError('Cannot call a class as a function')
- }(this, o);
- for (var e = arguments.length, t = Array(e), n = 0; n < e; n++) t[n] = arguments[n];
- return aS(tS(r = a.call.apply(a, [
- this
- ].concat(t))), 'state', {
- questions: null,
- questionsGroup: r.props.initialQuestionGroup || (r.props.selection.type === ft.forum ? CO.deactivationHubForum : CO.start)
- }),
- aS(tS(r), 'fetchData', function (e) {
- var t,
- e = {
- group: e || r.state.questionsGroup
- };
- r.props.selection.type === ft.forum ? (t = 'forums/questions/listGroup', e.forum = r.props.selection.forum.shortname) : r.props.selection.type === ft.organization && (t = 'organizations/questions/listGroup', e.organization = r.props.selection.organization.id),
- r.apiCall = io.a.call(t, {
- data: e
- }).done(je.a.partial(r.onFetch, e.group))
- }),
- aS(tS(r), 'onFetch', function (e, t) {
- var n = t.response.objects;
- r.setState({
- questionsGroup: e,
- questions: t.response.items.map(function (e) {
- return {
- question: n[e.reference],
- answer: e.answer
- }
- })
- })
- }),
- aS(tS(r), 'updateAnswer', function (e, t) {
- var n,
- a = {
- answer: t,
- group: r.state.questionsGroup,
- question: e
- };
- return r.updateLocalAnswer(e, t),
- r.props.selection.type === ft.forum ? (n = 'forums/questions/answer', a.forum = r.props.selection.forum.shortname) : r.props.selection.type === ft.organization && (n = 'organizations/questions/answer', a.organization = r.props.selection.organization.id),
- r.apiCall = io.a.call(n, {
- data: a,
- method: 'POST'
- }),
- r.apiCall
- }),
- aS(tS(r), 'updateLocalAnswer', function (t, e) {
- var n = JO(r.state.questions);
- n.find(function (e) {
- return e.question.id === t
- }).answer = '' === e.text ? e.choice : ''.concat(e.choice, ': ').concat(e.text),
- r.setState({
- questions: n
- })
- }),
- aS(tS(r), 'getComponentProps', function () {
- return {
- questions: r.state.questions,
- updateAnswer: r.updateAnswer
- }
- }),
- r
- }
- return e = o,
- (t = [
- {
- key: 'componentDidMount',
- value: function () {
- this.fetchData()
- }
- }
- ]) && ZO(e.prototype, t),
- n && ZO(e, n),
- o
- }();
- aS(Yc, 'displayName', 'QuestionsDriver'),
- aS(Yc, 'propTypes', {
- selection: ht.isRequired,
- initialQuestionGroup: b.a.string
- });
- sl = Object(ki.createDriver) (Yc, function (e) {
- return {
- selection: e.selection
- }
- });
- function rS(e) {
- return (rS = 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator ? function (e) {
- return typeof e
- }
- : function (e) {
- return e && 'function' == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? 'symbol' : typeof e
- }) (e)
- }
- function oS() {
- return (oS = Object.assign || function (e) {
- for (var t = 1; t < arguments.length; t++) {
- var n,
- a = arguments[t];
- for (n in a) Object.prototype.hasOwnProperty.call(a, n) && (e[n] = a[n])
- }
- return e
- }).apply(this, arguments)
- }
- function iS(t, e) {
- var n,
- a = Object.keys(t);
- return Object.getOwnPropertySymbols && (n = Object.getOwnPropertySymbols(t), e && (n = n.filter(function (e) {
- return Object.getOwnPropertyDescriptor(t, e).enumerable
- })), a.push.apply(a, n)),
- a
- }
- function sS(t) {
- for (var e = 1; e < arguments.length; e++) {
- var n = null != arguments[e] ? arguments[e] : {
- };
- e % 2 ? iS(Object(n), !0).forEach(function (e) {
- mS(t, e, n[e])
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(n)) : iS(Object(n)).forEach(function (e) {
- Object.defineProperty(t, e, Object.getOwnPropertyDescriptor(n, e))
- })
- }
- return t
- }
- function lS(e, t) {
- for (var n = 0; n < t.length; n++) {
- var a = t[n];
- a.enumerable = a.enumerable || !1,
- a.configurable = !0,
- 'value' in a && (a.writable = !0),
- Object.defineProperty(e, a.key, a)
- }
- }
- function cS(e, t) {
- return (cS = Object.setPrototypeOf || function (e, t) {
- return e.__proto__ = t,
- e
- }) (e, t)
- }
- function uS(n) {
- var a = function () {
- if ('undefined' == typeof Reflect || !Reflect.construct) return !1;
- if (Reflect.construct.sham) return !1;
- if ('function' == typeof Proxy) return !0;
- try {
- return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [
- ], function () {
- })),
- !0
- } catch (e) {
- return !1
- }
- }();
- return function () {
- var e,
- t = dS(n);
- return e = a ? (e = dS(this).constructor, Reflect.construct(t, arguments, e)) : t.apply(this, arguments),
- t = this,
- !(e = e) || 'object' !== rS(e) && 'function' != typeof e ? pS(t) : e
- }
- }
- function pS(e) {
- if (void 0 === e) throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called');
- return e
- }
- function dS(e) {
- return (dS = Object.setPrototypeOf ? Object.getPrototypeOf : function (e) {
- return e.__proto__ || Object.getPrototypeOf(e)
- }) (e)
- }
- function mS(e, t, n) {
- return t in e ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n,
- e
- }
- var fS = 'question_',
- hS = 'error_',
- gS = 'success_',
- yl = function () {
- !function (e, t) {
- if ('function' != typeof t && null !== t) throw new TypeError('Super expression must either be null or a function');
- e.prototype = Object.create(t && t.prototype, {
- constructor: {
- value: e,
- writable: !0,
- configurable: !0
- }
- }),
- t && cS(e, t)
- }(i, A);
- var e,
- t,
- n,
- o = uS(i);
- function i() {
- var e,
- r;
- !function (e, t) {
- if (!(e instanceof t)) throw new TypeError('Cannot call a class as a function')
- }(this, i);
- for (var t = arguments.length, n = Array(t), a = 0; a < t; a++) n[a] = arguments[a];
- return mS(pS(r = o.call.apply(o, [
- this
- ].concat(n))), 'state', sS(sS({
- }, i.getAnswerStateFromQuestions(r.props.questions)), {
- }, (mS(e = {
- name: r.props.orgUpdateName
- }, ''.concat(hS, 'name'), r.props.orgUpdateError), mS(e, 'isSaved', !1), mS(e, 'savedFields', sS(sS({
- }, i.getAnswerStateFromQuestions(r.props.questions)), {
- }, {
- name: r.props.orgUpdateName
- })), e))),
- mS(pS(r), 'handleInputChange', function (e, t) {
- var n = (mS(n = {
- }, e, t.target.value), mS(n, hS + e, null), mS(n, gS + e, null), n);
- r.setState(n)
- }),
- mS(pS(r), 'hasFieldChanged', function (e) {
- return r.state[e] !== r.state.savedFields[e] && !(null === r.state.savedFields[e] && '' === r.state[e])
- }),
- mS(pS(r), 'hasUnsavedChanges', function () {
- return Object.keys(r.state.savedFields).some(function (e) {
- return r.hasFieldChanged(e)
- })
- }),
- mS(pS(r), 'handleSaveChangesClick', function () {
- var e,
- a,
- t;
- r.props.orgUpdateIsSaving || (a = [
- ], (t = r.props.selection.organization.name !== (e = r.state.name)) && a.push(r.props.orgUpdateOnUpdateOrg({
- name: e
- })), r.props.questions && r.props.questions.forEach(function (e) {
- var t = fS + e.question.id,
- n = this.state[t];
- void 0 !== n && e.answer !== n && a.push(this.props.updateAnswer(e.question.id, n).fail(this.handleQuestionApiCallFail.bind(this, t)))
- }.bind(pS(r))), vo.a.when.apply(vo.a, a).then(r.handleAllApiCallsComplete.bind(pS(r), t)))
- }),
- mS(pS(r), 'handleAllApiCallsComplete', function (a) {
- r.setState(function (n, e) {
- var t = {
- };
- return mS(t, ''.concat(gS, 'name'), !!a),
- mS(t, 'isSaved', !0),
- mS(t, 'savedFields', e.questions.reduce(function (e, t) {
- return e[fS + t.question.id] = n[fS + t.question.id],
- e
- }, {
- name: n.name
- })),
- t
- })
- }),
- mS(pS(r), 'handleQuestionApiCallFail', function (e, t) {
- var n;
- try {
- ~(n = JSON.parse(t.responseText).response).indexOf('Missing required argument: \'answer\'') && (n = 'Answer can\'t be blank')
- } catch (e) {
- n = 'Invalid answer'
- }
- r.setState((mS(t = {
- }, hS + e, n), mS(t, gS + e, null), t))
- }),
- r
- }
- return e = i,
- (t = [
- {
- key: 'componentWillReceiveProps',
- value: function (e) {
- var t,
- n = {
- };
- (n = !this.props.questions && e.questions ? sS(sS({
- }, t = i.getAnswerStateFromQuestions(e.questions)), {
- }, {
- savedFields: sS(sS({
- }, t), {
- }, {
- name: e.orgUpdateName
- })
- }) : n) [''.concat(hS, 'name')] = e.orgUpdateError,
- this.setState(n)
- }
- },
- {
- key: 'render',
- value: function () {
- var r = this,
- e = this.props.selection.organization.forums.length;
- return C.a.createElement('div', null, C.a.createElement('div', {
- className: 'content__wrap spacing-bottom-double'
- }, C.a.createElement('header', {
- className: 'settings__header'
- }, C.a.createElement('h2', {
- className: 'text-larger text-gray-darker spacing-bottom-small'
- }, ''.concat(this.props.selection.organization.name, ' Info')), C.a.createElement('p', {
- className: 'text-gray'
- }, 'Update your basic organization information.')), C.a.createElement('section', {
- className: 'settings__content'
- }, C.a.createElement(kf, {
- label: 'Sites',
- blockAdditionalClass: '-no-input text-medium'
- }, C.a.createElement('span', {
- className: 'spacing-right'
- }, e, ' total.'), C.a.createElement(Us, {
- path: '/settings/sites/',
- orgId: this.props.selection.organization.id,
- orgSlug: this.props.selection.organization.slug,
- linkClassName: 'button button-outline text-medium spacing-left-small'
- }, 'View'), C.a.createElement('a', {
- href: pt.a.urls.createSite,
- className: 'button button-outline text-medium spacing-left-small'
- }, 'Add')), C.a.createElement($h, {
- name: 'name',
- value: this.state.name,
- placeholder: 'Enter a name for your organization',
- inputState: this.state[''.concat(hS, 'name')] ? 'error' : 'none',
- label: 'Name',
- onChange: this.handleInputChange.bind(this, 'name'),
- idNamespace: this.constructor.displayName,
- shouldHighlight: this.hasFieldChanged('name'),
- tooltip: 'Only shown to other organization admins.'
- }, this.state[''.concat(hS, 'name')] ? C.a.createElement('span', {
- className: 'text-medium text-error text-semibold spacing-narrow'
- }, this.state[''.concat(hS, 'name')]) : null, this.state[''.concat(gS, 'name')] ? C.a.createElement('span', {
- className: 'text-medium text-success text-semibold spacing-narrow'
- }, 'Your organizaton name was updated. You may need to ', C.a.createElement('a', {
- href: window.location.href
- }, 'Reload the page'), ' to see the changes.') : null), (this.props.questions || [
- ]).map(function (e) {
- var t = fS + e.question.id,
- n = r.state[hS + t];
- if ('MULTIPLE_CHOICE' !== e.question.typeName) return C.a.createElement($h, {
- key: e.question.id,
- name: t,
- value: r.state[t],
- type: 'INTEGER' === e.question.typeName ? 'number' : 'text',
- inputState: n ? 'error' : 'none',
- label: e.question.text,
- onChange: r.handleInputChange.bind(r, t),
- idNamespace: r.constructor.displayName,
- placeholder: e.question.placeholderText,
- min: 'INTEGER' === e.question.typeName ? 0 : null,
- shouldHighlight: r.hasFieldChanged(t)
- }, n ? C.a.createElement('span', {
- className: 'text-medium text-error text-semibold spacing-narrow'
- }, n) : null);
- var a = e.question.typeContext.map(function (e) {
- return {
- key: e,
- value: e,
- label: e
- }
- });
- return C.a.createElement(Mf, {
- key: e.question.id,
- name: t,
- disabled: !1,
- options: a,
- placeholder: 'Choose an answer',
- value: r.state[t],
- label: e.question.text,
- onChange: r.handleInputChange.bind(r, t),
- idNamespace: r.constructor.displayName,
- shouldHighlight: r.hasFieldChanged(t)
- }, n ? C.a.createElement('span', {
- className: 'text-medium text-error text-semibold spacing-narrow'
- }, n) : null)
- })), C.a.createElement('footer', {
- className: 'settings__footer'
- }, C.a.createElement(Bh, {
- disabled: !this.hasUnsavedChanges(),
- onClick: this.handleSaveChangesClick,
- isSaving: this.props.orgUpdateIsSaving,
- isSaved: this.state.isSaved
- }))), C.a.createElement('div', {
- className: 'content__wrap hidden'
- }, C.a.createElement('header', {
- className: 'settings__header'
- }, C.a.createElement('h2', {
- className: 'text-larger text-gray-darker spacing-bottom-small'
- }, 'Payment'), C.a.createElement('p', {
- className: 'text-gray'
- }, 'Control the way Disqus pays your organization for earnings.')), C.a.createElement('section', {
- className: 'settings__content'
- }, C.a.createElement('div', {
- className: 'fieldset'
- }, C.a.createElement('label', {
- htmlFor: '',
- className: 'fieldset__label text-gray'
- }, 'By Site'), C.a.createElement('div', {
- className: 'fieldset__block'
- }, C.a.createElement('div', {
- className: 'fieldset__block--radio'
- }, C.a.createElement('input', {
- type: 'radio',
- name: ''
- }), C.a.createElement('label', {
- htmlFor: '',
- className: 'text-medium'
- }, 'Subscribe automatically to discussions you comment on')), C.a.createElement('p', {
- className: 'fieldset__description text-small text-gray'
- }, 'Only shown to other organization admins.'))), C.a.createElement('div', {
- className: 'fieldset'
- }, C.a.createElement('label', {
- htmlFor: '',
- className: 'fieldset__label text-gray'
- }, 'By Organization'), C.a.createElement('div', {
- className: 'fieldset__block'
- }, C.a.createElement('div', {
- className: 'fieldset__block--radio'
- }, C.a.createElement('input', {
- type: 'radio',
- name: ''
- }), C.a.createElement('label', {
- htmlFor: '',
- className: 'text-medium'
- }, 'The organization is paid once for all sites')), C.a.createElement('p', {
- className: 'fieldset__description text-small spacing-bottom-narrow'
- }, C.a.createElement('strong', null, 'Are you sure? This is a big deal. It affects the way you file taxes.')), C.a.createElement('button', {
- className: 'button button-small button-fill--brand'
- }, 'Yes, I understand. Let me set up my organization payment info »')))), C.a.createElement('footer', {
- className: 'settings__footer'
- }, C.a.createElement('div', {
- className: 'fieldset fieldset--save'
- }, C.a.createElement('div', {
- className: 'fieldset__label'
- }, C.a.createElement('div', {
- className: 'spinner-small'
- }), C.a.createElement('div', {
- className: 'icon-checkmark'
- })), C.a.createElement('div', {
- className: 'fieldset__block'
- }, C.a.createElement('button', {
- className: 'button button-fill--brand button-padding-wider text-medium',
- disabled: !0
- }, 'Save'))))))
- }
- }
- ]) && lS(e.prototype, t),
- n && lS(e, n),
- i
- }();
- mS(yl, 'displayName', 'OrgSettingsGeneral'),
- mS(yl, 'propTypes', {
- forums: b.a.object.isRequired,
- selection: ht.isRequired,
- questions: b.a.array,
- updateAnswer: b.a.func.isRequired,
- orgUpdateName: b.a.string,
- orgUpdateError: b.a.string,
- orgUpdateIsSaving: b.a.bool,
- orgUpdateOnUpdateOrg: b.a.func.isRequired
- }),
- mS(yl, 'getAnswerStateFromQuestions', function (e) {
- return (e || [
- ]).reduce(function (e, t) {
- return oS(e, mS({
- }, fS + t.question.id, t.answer))
- }, {
- })
- });
- var yS = Object(u.connect) (function (e) {
- return {
- selection: e.selection
- }
- }) (Ni.a.attachDrivers(yl, [
- Pc,
- sl
- ])),
- Ru = {
- fetchOrgForums: function () {
- return function (t, e) {
- t({
- type: se.fetching
- });
- e = e().selection.organization.id;
- io.a.call('organizations/listForums', {
- type: 'GET',
- data: {
- organization: e
- },
- success: function (e) {
- t({
- type: se.onFetch,
- forumList: e.response,
- cursor: e.cursor
- })
- },
- error: function (e) {
- t({
- type: se.onFetchError,
- data: e
- })
- }
- })
- }
- },
- fetchMoreOrgForums: function () {
- return function (t, e) {
- t({
- type: se.fetching
- });
- var n = e().selection.organization.id,
- e = e().orgForums.orgForumsCursor;
- e && e.hasNext && io.a.call('organizations/listForums', {
- type: 'GET',
- data: {
- organization: n,
- cursor: e.next
- },
- success: function (e) {
- t({
- type: se.onFetchMore,
- forumList: e.response,
- cursor: e.cursor
- })
- },
- error: function (e) {
- t({
- type: se.onFetchError,
- data: e
- })
- }
- })
- }
- }
- };
- function bS(e) {
- return (bS = 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator ? function (e) {
- return typeof e
- }
- : function (e) {
- return e && 'function' == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? 'symbol' : typeof e
- }) (e)
- }
- function vS(t, e) {
- var n,
- a = Object.keys(t);
- return Object.getOwnPropertySymbols && (n = Object.getOwnPropertySymbols(t), e && (n = n.filter(function (e) {
- return Object.getOwnPropertyDescriptor(t, e).enumerable
- })), a.push.apply(a, n)),
- a
- }
- function _S(t) {
- for (var e = 1; e < arguments.length; e++) {
- var n = null != arguments[e] ? arguments[e] : {
- };
- e % 2 ? vS(Object(n), !0).forEach(function (e) {
- kS(t, e, n[e])
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(n)) : vS(Object(n)).forEach(function (e) {
- Object.defineProperty(t, e, Object.getOwnPropertyDescriptor(n, e))
- })
- }
- return t
- }
- function ES(e, t) {
- for (var n = 0; n < t.length; n++) {
- var a = t[n];
- a.enumerable = a.enumerable || !1,
- a.configurable = !0,
- 'value' in a && (a.writable = !0),
- Object.defineProperty(e, a.key, a)
- }
- }
- function OS(e, t) {
- return (OS = Object.setPrototypeOf || function (e, t) {
- return e.__proto__ = t,
- e
- }) (e, t)
- }
- function SS(n) {
- var a = function () {
- if ('undefined' == typeof Reflect || !Reflect.construct) return !1;
- if (Reflect.construct.sham) return !1;
- if ('function' == typeof Proxy) return !0;
- try {
- return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [
- ], function () {
- })),
- !0
- } catch (e) {
- return !1
- }
- }();
- return function () {
- var e,
- t = PS(n);
- return e = a ? (e = PS(this).constructor, Reflect.construct(t, arguments, e)) : t.apply(this, arguments),
- t = this,
- !(e = e) || 'object' !== bS(e) && 'function' != typeof e ? wS(t) : e
- }
- }
- function wS(e) {
- if (void 0 === e) throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called');
- return e
- }
- function PS(e) {
- return (PS = Object.setPrototypeOf ? Object.getPrototypeOf : function (e) {
- return e.__proto__ || Object.getPrototypeOf(e)
- }) (e)
- }
- function kS(e, t, n) {
- return t in e ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n,
- e
- }
- var NS = [
- 'adsProductVideoEnabled',
- 'adsProductStoriesEnabled',
- 'adsProductLinksEnabled'
- ],
- h = function () {
- !function (e, t) {
- if ('function' != typeof t && null !== t) throw new TypeError('Super expression must either be null or a function');
- e.prototype = Object.create(t && t.prototype, {
- constructor: {
- value: e,
- writable: !0,
- configurable: !0
- }
- }),
- t && OS(e, t)
- }(o, A);
- var e,
- t,
- n,
- r = SS(o);
- function o() {
- var e;
- !function (e, t) {
- if (!(e instanceof t)) throw new TypeError('Cannot call a class as a function')
- }(this, o);
- for (var t = arguments.length, n = Array(t), a = 0; a < t; a++) n[a] = arguments[a];
- return kS(wS(e = r.call.apply(r, [
- this
- ].concat(n))), 'loadMoreForums', function () {
- e.props.fetchMoreOrgForums()
- }),
- e
- }
- return e = o,
- (t = [
- {
- key: 'componentDidMount',
- value: function () {
- this.props.fetchOrgForums()
- }
- },
- {
- key: 'render',
- value: function () {
- var n = this;
- if (this.props.orgForumsIsFetching && !this.props.orgForumsList) return C.a.createElement(Ji, null);
- if (this.props.orgForumsError) return C.a.createElement(Ki, {
- message: this.props.orgForumsError,
- alertType: 'error'
- });
- var e,
- t,
- a = this.props.selection.organization.forums.length,
- r = this.props.orgForumsList ? this.props.orgForumsList.length : 0,
- a = 1 === a ? '1 site' : ''.concat(a, ' sites');
- return this.props.orgForumsHasMore ? (e = 'Info on '.concat(r, ' of ').concat(a, ' in this organization'), t = C.a.createElement('button', {
- className: 'button button-large button-wide button-padding-wide button-wide--mobile button-fill--brand',
- onClick: this.loadMoreForums
- }, 'Load More')) : e = 'Info on the '.concat(a, ' in this organization.'),
- C.a.createElement('div', {
- className: 'content__wrap spacing-bottom-double'
- }, C.a.createElement('header', {
- className: 'settings__header'
- }, C.a.createElement('h2', {
- className: 'text-larger text-gray-darker spacing-bottom-small'
- }, 'Organization Sites'), C.a.createElement('p', {
- className: 'text-gray'
- }, e)), C.a.createElement('section', null, (this.props.orgForumsList || [
- ]).map(function (t) {
- var e = je.a.some(NS, function (e) {
- return t.settings[e]
- }) && n.props.selection.organization.eligibleForEarnings;
- return C.a.createElement('div', {
- className: 'settings-list__item',
- key: t.id
- }, C.a.createElement('div', {
- className: 'align align--between'
- }, C.a.createElement('div', {
- className: 'spacing-right align align--middle align--wrap'
- }, t.signedUrl ? C.a.createElement('a', {
- href: t.signedUrl,
- target: '_blank',
- rel: 'noopener noreferrer',
- className: 'text-semibold spacing-right-large'
- }, t.name) : C.a.createElement('span', {
- className: 'text-semibold spacing-right-large'
- }, t.name), C.a.createElement('span', {
- className: 'text-small text-gray spacing-right-small'
- }, 'Created ', ct() (t.createdAt).format('MMM Do YYYY')), e ? C.a.createElement('span', {
- className: 'bullet text-small text-gray spacing-right-small'
- }, 'Reveal enabled') : null), C.a.createElement('div', {
- className: 'align-min-tablet align--middle spacing-top-small spacing-bottom-small'
- }, C.a.createElement(Uo, {
- linkClassName: 'button button-outline text-medium',
- linkActiveClassName: 'active',
- path: '/settings/general/',
- selection: n.props.selection,
- forumId: t.id
- }, 'Edit Settings'))))
- })), t)
- }
- }
- ]) && ES(e.prototype, t),
- n && ES(e, n),
- o
- }();
- kS(h, 'displayName', 'OrgSettingsSites'),
- kS(h, 'propTypes', {
- selection: ht.isRequired,
- orgForumsList: b.a.array,
- orgForumsError: b.a.string,
- orgForumsIsFetching: b.a.bool,
- orgForumsHasMore: b.a.bool.isRequired,
- fetchOrgForums: b.a.func.isRequired,
- fetchMoreOrgForums: b.a.func.isRequired
- });
- var ut = Object(u.connect) (function (e) {
- return _S({
- selection: e.selection
- }, e.orgForums)
- }, _S({
- }, Ru)) (Fo() (h)),
- CS = 'https://looker.local.disqus.net/looks/',
- RS = [
- 'forum_id',
- 'website',
- 'url',
- 'ads_language',
- 'ads_review_status',
- 'ads_review_notes',
- 'adult_content',
- 'forum_category_id',
- 'ads_settings_and_analytics_viewable'
- ],
- xS = {
- 'Daily-Inbox': 'F2BCMn6cW3KwnpQZHyzfBW6wBrrdPNN8',
- 'Needs-Review-English-Most-Traffic-Sort': 'bYKqFk7yc3t4nGyvtKDFrS2bf5FvDc5p',
- 'Needs-Category-Reveal-Active-Most-Traffic-Sort': 'H49RQHXfmzcjzhWPsFnrjmMRwf8F5jPm',
- 'Needs-Category-English-Most-Traffic-Sort': 'KR7tg543MH98qGnfkr2Rr7q7SFHyVCn6',
- 'Low-US-Sort': 'RPCnb6ddrBtczpmqdbRVxGr73sHyZvsJ',
- 'Search-by-Shortname': 'Ddtt8g7fzr9jKpNRV3PdKJdzyVK7dqtX'
- },
- i = Fm.data.map(function (e) {
- return {
- id: e.attributes.code,
- code: e.attributes.code,
- name: e.attributes.name
- }
- }).sort(function (e, t) {
- return t.name < e.name ? 1 : e.name < t.name ? - 1 : 0
- }),
- AS = {
- NOT_REVIEWED: '0',
- QUALIFIED: '1',
- DISQUALIFIED: '2'
- },
- DS = [
- {
- id: 4,
- name: 'A - Paying'
- },
- {
- id: 1,
- name: 'B - Non-Commercial'
- },
- {
- id: 3,
- name: 'C - Policy Against Ads'
- },
- {
- id: 5,
- name: 'D - Squeaky'
- },
- {
- id: 6,
- name: 'E - Feature Instream Position'
- },
- {
- id: 14,
- name: 'F - Feature Niche Demand'
- },
- {
- id: 15,
- name: 'G - Feature Earnings'
- },
- {
- id: 2,
- name: 'H - Channel Conflict'
- },
- {
- id: 8,
- name: 'I - Data Value Risk'
- },
- {
- id: 9,
- name: 'J - Brand Value Risk'
- },
- {
- id: 10,
- name: 'K - Other Partner'
- },
- {
- id: 'null',
- name: 'Reviewed, not Excepted'
- }
- ],
- jS = Object.freeze({
- _order: [
- 'url',
- 'website',
- 'ads_review_status',
- 'ads_review_notes',
- 'ads_settings_and_analytics_viewable',
- 'forum_category_id',
- 'ads_language',
- 'adult_content'
- ],
- url: {
- title: 'Forum Shortname',
- type: 'text'
- },
- website: {
- title: 'Website',
- type: 'link'
- },
- ads_review_status: {
- options: [
- {
- id: AS.NOT_REVIEWED,
- name: 'Not Reviewed'
- },
- {
- id: AS.QUALIFIED,
- name: 'Qualified'
- },
- {
- id: AS.DISQUALIFIED,
- name: 'Disqualified'
- }
- ],
- title: 'Review Status',
- type: 'select'
- },
- ads_review_notes: {
- title: 'Notes',
- type: 'input'
- },
- ads_settings_and_analytics_viewable: {
- title: 'Reveal Eligible Settings Enabled',
- type: 'checkbox',
- computeValue: function (e) {
- return 'true' === e
- }
- },
- forum_category_id: {
- defaultValue: {
- id: '',
- name: 'None'
- },
- options: [
- {
- id: '1',
- name: 'Business'
- },
- {
- id: '2',
- name: 'Celebrity'
- },
- {
- id: '3',
- name: 'Culture'
- },
- {
- id: '4',
- name: 'Entertainment'
- },
- {
- id: '5',
- name: 'Games'
- },
- {
- id: '6',
- name: 'Living'
- },
- {
- id: '7',
- name: 'News'
- },
- {
- id: '8',
- name: 'Tech'
- },
- {
- id: '9',
- name: 'Style'
- },
- {
- id: '10',
- name: 'Sports'
- }
- ],
- title: 'Category',
- type: 'select'
- },
- ads_language: {
- defaultValue: {
- id: '',
- name: 'None'
- },
- optionId: 'code',
- options: i,
- title: 'Ads Language',
- type: 'select'
- },
- adult_content: {
- computeValue: function (e) {
- return 'true' === e
- },
- title: 'Adult Content',
- type: 'checkbox'
- }
- }),
- TS = Object.freeze({
- _order: [
- 'organization_id',
- 'organization_yesterday_pageviews',
- 'org_largest_forum_shortname',
- 'org_largest_forum_website',
- 'deactivation_date',
- 'open_to_ads',
- 'hub_answer_detail',
- 'suggested_exception_id',
- 'exception_granted'
- ],
- organization_id: {
- title: 'Org ID',
- type: 'text'
- },
- organization_yesterday_pageviews: {
- title: 'Total Daily Engage Loads',
- type: 'text'
- },
- org_largest_forum_shortname: {
- title: 'Largest Forum in Org (deactivated from campaign) or Forum (deactivated from Reveal)',
- type: 'text'
- },
- org_largest_forum_website: {
- title: 'Website URL for largest forum shortname by traffic',
- type: 'link'
- },
- deactivation_date: {
- title: 'Deactivation Date',
- type: 'text'
- },
- open_to_ads: {
- computeValue: function (e) {
- return !0 === e ? 'Y' : 'N'
- },
- title: 'Open to Ads?',
- type: 'text'
- },
- hub_answer_detail: {
- title: 'Hub Question: Answer Detail',
- type: 'text'
- },
- suggested_exception_id: {
- computeValue: function (t) {
- return '' === t ? '' : DS.filter(function (e) {
- return e.id === t
- }) [0].name
- },
- title: 'Suggested Exception (if available)',
- type: 'text'
- },
- exception_granted: {
- defaultValue: {
- id: '',
- name: 'To Be Reviewed'
- },
- options: DS,
- title: 'Exception',
- type: 'select'
- }
- });
- function IS(e) {
- return (IS = 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator ? function (e) {
- return typeof e
- }
- : function (e) {
- return e && 'function' == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? 'symbol' : typeof e
- }) (e)
- }
- function qS() {
- return (qS = Object.assign || function (e) {
- for (var t = 1; t < arguments.length; t++) {
- var n,
- a = arguments[t];
- for (n in a) Object.prototype.hasOwnProperty.call(a, n) && (e[n] = a[n])
- }
- return e
- }).apply(this, arguments)
- }
- function FS(e) {
- return function (e) {
- if (Array.isArray(e)) return LS(e)
- }(e) || function (e) {
- if ('undefined' != typeof Symbol && null != e[Symbol.iterator] || null != e['@@iterator']) return Array.from(e)
- }(e) || function (e, t) {
- if (e) {
- if ('string' == typeof e) return LS(e, t);
- var n = Object.prototype.toString.call(e).slice(8, - 1);
- return 'Map' === (n = 'Object' === n && e.constructor ? e.constructor.name : n) || 'Set' === n ? Array.from(e) : 'Arguments' === n || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n) ? LS(e, t) : void 0
- }
- }(e) || function () {
- throw new TypeError('Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.')
- }()
- }
- function LS(e, t) {
- for (var n = 0, a = Array(t = null == t || e.length < t ? e.length : t); n < t; n++) a[n] = e[n];
- return a
- }
- function US(e, t) {
- for (var n = 0; n < t.length; n++) {
- var a = t[n];
- a.enumerable = a.enumerable || !1,
- a.configurable = !0,
- 'value' in a && (a.writable = !0),
- Object.defineProperty(e, a.key, a)
- }
- }
- function MS(e, t) {
- return (MS = Object.setPrototypeOf || function (e, t) {
- return e.__proto__ = t,
- e
- }) (e, t)
- }
- function BS(n) {
- var a = function () {
- if ('undefined' == typeof Reflect || !Reflect.construct) return !1;
- if (Reflect.construct.sham) return !1;
- if ('function' == typeof Proxy) return !0;
- try {
- return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [
- ], function () {
- })),
- !0
- } catch (e) {
- return !1
- }
- }();
- return function () {
- var e,
- t = HS(n);
- return e = a ? (e = HS(this).constructor, Reflect.construct(t, arguments, e)) : t.apply(this, arguments),
- t = this,
- !(e = e) || 'object' !== IS(e) && 'function' != typeof e ? zS(t) : e
- }
- }
- function zS(e) {
- if (void 0 === e) throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called');
- return e
- }
- function HS(e) {
- return (HS = Object.setPrototypeOf ? Object.getPrototypeOf : function (e) {
- return e.__proto__ || Object.getPrototypeOf(e)
- }) (e)
- }
- function GS(e, t, n) {
- return t in e ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n,
- e
- }
- Qs = function () {
- !function (e, t) {
- if ('function' != typeof t && null !== t) throw new TypeError('Super expression must either be null or a function');
- e.prototype = Object.create(t && t.prototype, {
- constructor: {
- value: e,
- writable: !0,
- configurable: !0
- }
- }),
- t && MS(e, t)
- }(o, A);
- var e,
- t,
- n,
- a = BS(o);
- function o() {
- var r;
- !function (e, t) {
- if (!(e instanceof t)) throw new TypeError('Cannot call a class as a function')
- }(this, o);
- for (var e = arguments.length, t = Array(e), n = 0; n < e; n++) t[n] = arguments[n];
- return GS(zS(r = a.call.apply(a, [
- this
- ].concat(t))), 'state', {
- forums: [
- ],
- isFetching: !1,
- error: null
- }),
- GS(zS(r), 'fetchData', function (e) {
- r.setState({
- isFetching: !0,
- error: null
- });
- e = xS[e || r.props.params.tab],
- e = r.isExceptionTool() ? 'internal/exceptionManagement/list' : ''.concat(CS).concat(e, '.json');
- io.a.call(e).done(r.onFetch).fail(r.onFail)
- }),
- GS(zS(r), 'onFetch', function (e) {
- r.isExceptionTool() ? r.onExceptionFetch(e) : r.onOnboardingFetch(e)
- }),
- GS(zS(r), 'onExceptionFetch', function (e) {
- r.setState({
- forums: e.response,
- isFetching: !1
- })
- }),
- GS(zS(r), 'onOnboardingFetch', function (e) {
- e.length && e[0].looker_error ? r.setError(e[0].looker_error) : r.setState({
- forums: e.map(function (t) {
- return Object.keys(t).map(function (e) {
- return [e.split('.') [1],
- t[e]]
- }).reduce(function (e, t) {
- return e[t[0]] = t[1],
- e
- }, {
- })
- }),
- isFetching: !1
- })
- }),
- GS(zS(r), 'onFail', function (e) {
- r.setError(r.parseErrorResponse(e))
- }),
- GS(zS(r), 'setError', function (e) {
- r.setState({
- error: e,
- isFetching: !1
- })
- }),
- GS(zS(r), 'parseErrorResponse', function (e) {
- var t;
- try {
- t = JSON.parse(e.responseText).response
- } catch (e) {
- t = 'There was an error loading the report'
- }
- return t
- }),
- GS(zS(r), 'onUpdate', function (e, t) {
- r.updateForumKey(e, t, 'saving', !1)
- }),
- GS(zS(r), 'formatDataForUpdate', function (e) {
- return r.isExceptionTool() ? {
- organization: e.organization_id,
- adsExceptionReason: 'null' === e.exception_granted ? null : + ('' + e.exception_granted)
- }
- : {
- adsLanguage: e.ads_language,
- adsReviewStatus: e.ads_review_status,
- adsReviewNotes: e.ads_review_notes,
- adsAnalyticsViewable: 'true' === e.ads_settings_and_analytics_viewable ? 1 : 0,
- adsSettingsViewable: 'true' === e.ads_settings_and_analytics_viewable ? 1 : 0,
- adultContent: 'true' === e.adult_content ? 1 : 0,
- forum: e.url,
- forumCategory: e.forum_category_id
- }
- }),
- GS(zS(r), 'updateForum', function (e, t) {
- r.updateForumKey(e, t, 'saving', !0);
- var n = r.formatDataForUpdate(e);
- (r.isExceptionTool() ? r.props.orgUpdateOnUpdateOrg(n, {
- useInternal: !0
- }) : r.props.forumUpdateOnSave(n, {
- useInternal: !0
- })).done(r.onUpdate.bind(zS(r), e, t))
- }),
- GS(zS(r), 'updateForumKey', function (e, t, n, a) {
- r.setState({
- forums: [
- ].concat(FS(r.state.forums.slice(0, t)), [
- r.getDownstreamState(e, n, a)
- ], FS(r.state.forums.slice(t + 1)))
- })
- }),
- GS(zS(r), 'isExceptionTool', function () {
- return /exception/.test(r.props.route.path)
- }),
- GS(zS(r), 'getDownstreamState', function (e, t, n) {
- var a = !('saving' === t && !n),
- e = qS({
- }, e, (GS(e = {
- }, t, n), GS(e, 'isDirty', a), e));
- return 'ads_review_status' === t && n === AS.QUALIFIED ? r.getDownstreamState(e, 'ads_settings_and_analytics_viewable', 'true') : 'adult_content' === t && 'true' === n ? r.getDownstreamState(e, 'ads_review_status', AS.DISQUALIFIED) : e
- }),
- GS(zS(r), 'getComponentProps', function () {
- return {
- onboardingToolForums: r.state.forums,
- onboardingToolIsFetching: r.state.isFetching,
- onboardingToolError: r.state.error,
- onboardingToolFetchData: r.fetchData,
- onboardingToolUpdateForum: r.updateForum,
- onboardingToolUpdateForumKey: r.updateForumKey,
- isExceptionTool: r.isExceptionTool()
- }
- }),
- r
- }
- return e = o,
- (t = [
- {
- key: 'componentDidMount',
- value: function () {
- this.fetchData()
- }
- },
- {
- key: 'componentWillUpdate',
- value: function (e) {
- e.params.tab !== this.props.params.tab && this.fetchData(e.params.tab)
- }
- },
- {
- key: 'componentWillUnmount',
- value: function () {
- this.apiCall && 'pending' === this.apiCall.state() && this.apiCall.abort()
- }
- }
- ]) && US(e.prototype, t),
- n && US(e, n),
- o
- }();
- GS(Qs, 'displayName', 'OnboardingToolDriver'),
- GS(Qs, 'propTypes', {
- params: b.a.object.isRequired,
- orgUpdateOnUpdateOrg: b.a.func.isRequired,
- forumUpdateOnSave: b.a.func.isRequired,
- route: b.a.object.isRequired
- });
- go = Object(ki.attachDrivers) (Object(ki.createDriver) (Qs), [
- Pc,
- m
- ]);
- function VS(e) {
- return (VS = 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator ? function (e) {
- return typeof e
- }
- : function (e) {
- return e && 'function' == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? 'symbol' : typeof e
- }) (e)
- }
- function WS(e, t) {
- for (var n = 0; n < t.length; n++) {
- var a = t[n];
- a.enumerable = a.enumerable || !1,
- a.configurable = !0,
- 'value' in a && (a.writable = !0),
- Object.defineProperty(e, a.key, a)
- }
- }
- function YS(e, t) {
- return (YS = Object.setPrototypeOf || function (e, t) {
- return e.__proto__ = t,
- e
- }) (e, t)
- }
- function QS(n) {
- var a = function () {
- if ('undefined' == typeof Reflect || !Reflect.construct) return !1;
- if (Reflect.construct.sham) return !1;
- if ('function' == typeof Proxy) return !0;
- try {
- return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [
- ], function () {
- })),
- !0
- } catch (e) {
- return !1
- }
- }();
- return function () {
- var e,
- t = JS(n);
- return e = a ? (e = JS(this).constructor, Reflect.construct(t, arguments, e)) : t.apply(this, arguments),
- t = this,
- !(e = e) || 'object' !== VS(e) && 'function' != typeof e ? KS(t) : e
- }
- }
- function KS(e) {
- if (void 0 === e) throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called');
- return e
- }
- function JS(e) {
- return (JS = Object.setPrototypeOf ? Object.getPrototypeOf : function (e) {
- return e.__proto__ || Object.getPrototypeOf(e)
- }) (e)
- }
- function $S(e, t, n) {
- return t in e ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n,
- e
- }
- var ZS = Object.freeze({
- text: function (e) {
- return C.a.createElement('td', {
- key: e.forumKey,
- className: 'onboarding-table__text-cell'
- }, e.forumKeyValue)
- },
- link: function (e) {
- var t = e.forumKeyValue.match(/^https?:\/\//) ? e.forumKeyValue : 'http://'.concat(e.forumKeyValue);
- return C.a.createElement('td', {
- key: e.forumKey,
- className: 'onboarding-table__text-cell'
- }, C.a.createElement('a', {
- href: t,
- target: '_blank'
- }, e.forumKeyValue))
- },
- select: function (e, t) {
- var n,
- a = e.forumKeyStatic.optionId || 'id';
- return e.forumKeyStatic.defaultValue && (n = C.a.createElement('option', {
- value: e.forumKeyStatic.defaultValue.id
- }, e.forumKeyStatic.defaultValue.name)),
- C.a.createElement('td', {
- key: e.forumKey
- }, C.a.createElement('select', {
- value: e.forumKeyValue,
- className: 'onboarding-table__select',
- onChange: t.bind(null, e.forum, e.forumIndex, e.forumKey)
- }, n, e.forumKeyStatic.options.map(function (e) {
- return C.a.createElement('option', {
- key: e[a],
- value: e[a]
- }, e.name)
- })))
- },
- input: function (e, t) {
- return C.a.createElement('td', {
- key: e.forumKey
- }, C.a.createElement('input', {
- onChange: t.bind(null, e.forum, e.forumIndex, e.forumKey),
- className: 'onboarding-table__input',
- value: e.forumKeyValue
- }))
- },
- checkbox: function (e, t) {
- return C.a.createElement('td', {
- key: e.forumKey
- }, C.a.createElement('input', {
- type: 'checkbox',
- checked: e.forumKeyValue,
- onChange: t.bind(null, e.forum, e.forumIndex, e.forumKey)
- }))
- }
- }),
- Ls = function () {
- !function (e, t) {
- if ('function' != typeof t && null !== t) throw new TypeError('Super expression must either be null or a function');
- e.prototype = Object.create(t && t.prototype, {
- constructor: {
- value: e,
- writable: !0,
- configurable: !0
- }
- }),
- t && YS(e, t)
- }(r, A);
- var e,
- t,
- n,
- a = QS(r);
- function r() {
- var l;
- !function (e, t) {
- if (!(e instanceof t)) throw new TypeError('Cannot call a class as a function')
- }(this, r);
- for (var e = arguments.length, t = Array(e), n = 0; n < e; n++) t[n] = arguments[n];
- return $S(KS(l = a.call.apply(a, [
- this
- ].concat(t))), 'getDynamicKeys', function () {
- return je.a.isEmpty(l.props.forums) ? [
- ] : Object.keys(l.props.forums[0]).filter(function (e) {
- return l.props.isExceptionTool ? TS[e] : !!~RS.indexOf(e)
- })
- }),
- $S(KS(l), 'updateForum', function (e, t) {
- l.props.updateForum(e, t)
- }),
- $S(KS(l), 'onInputChange', function (e, t, n, a) {
- l.props.updateForumKey(e, t, n, a.target.value)
- }),
- $S(KS(l), 'onCheckboxChange', function (e, t, n, a) {
- l.props.updateForumKey(e, t, n, a.target.checked ? 'true' : '')
- }),
- $S(KS(l), 'generateTableHeaders', function (t) {
- return t._order.map(function (e) {
- return C.a.createElement('th', {
- key: e
- }, t[e].title)
- })
- }),
- $S(KS(l), 'generateTableElements', function (o, i, s) {
- return o._order.map(function (e) {
- var t,
- n = o[e],
- a = null,
- r = null;
- return n && (t = null === i[e] ? '' : i[e], n.computeValue && (t = n.computeValue(t)), 'input' !== n.type && 'select' !== n.type || (r = l.onInputChange), a = ZS[n.type]({
- forumKey: e,
- forumKeyValue: t,
- forumKeyStatic: n,
- forum: i,
- forumIndex: s
- }, r = 'checkbox' === n.type ? l.onCheckboxChange : r)),
- a
- })
- }),
- l
- }
- return e = r,
- (t = [
- {
- key: 'render',
- value: function () {
- var e,
- a = this;
- return !1 === this.props.isExceptionTool && (e = this.getDynamicKeys().map(function (e) {
- return C.a.createElement('th', {
- key: e
- }, e.replace(/_/g, ' ').split(' ').map(function (e) {
- return (e[0] || '').toUpperCase() + e.slice(1)
- }).join(' '))
- })),
- C.a.createElement('div', {
- style: {
- overflowX: 'scroll'
- }
- }, C.a.createElement('table', {
- className: 'padding-top zebra-striped',
- style: {
- width: 'auto'
- }
- }, C.a.createElement('thead', null, C.a.createElement('tr', null, C.a.createElement('th', {
- style: {
- minWidth: '100px'
- }
- }), this.generateTableHeaders(this.props.isExceptionTool ? TS : jS), e)), C.a.createElement('tbody', null, this.props.forums.map(function (t, e) {
- var n;
- return !1 === a.props.isExceptionTool && (n = a.getDynamicKeys().map(function (e) {
- return C.a.createElement('td', {
- key: ''.concat(t.forum_id, '_').concat(e),
- style: {
- minWidth: '100px'
- }
- }, t[e])
- })),
- C.a.createElement('tr', {
- key: t.organization_id
- }, C.a.createElement('td', {
- style: {
- textAlign: 'center'
- }
- }, C.a.createElement('button', {
- value: 'submit',
- className: 'button button-fill--brand button-small',
- disabled: t.saving || !t.isDirty,
- onClick: a.updateForum.bind(a, t, e)
- }, t.saving ? 'Saving...' : 'Save')), a.generateTableElements(a.props.isExceptionTool ? TS : jS, t, e), n)
- }, this))))
- }
- }
- ]) && WS(e.prototype, t),
- n && WS(e, n),
- r
- }();
- $S(Ls, 'propTypes', {
- forums: b.a.array.isRequired,
- isExceptionTool: b.a.bool.isRequired,
- updateForum: b.a.func.isRequired,
- updateForumKey: b.a.func.isRequired
- });
- var XS = Ls;
- function ew(e) {
- return (ew = 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator ? function (e) {
- return typeof e
- }
- : function (e) {
- return e && 'function' == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? 'symbol' : typeof e
- }) (e)
- }
- function tw(e, t) {
- for (var n = 0; n < t.length; n++) {
- var a = t[n];
- a.enumerable = a.enumerable || !1,
- a.configurable = !0,
- 'value' in a && (a.writable = !0),
- Object.defineProperty(e, a.key, a)
- }
- }
- function nw(e, t) {
- return (nw = Object.setPrototypeOf || function (e, t) {
- return e.__proto__ = t,
- e
- }) (e, t)
- }
- function aw(n) {
- var a = function () {
- if ('undefined' == typeof Reflect || !Reflect.construct) return !1;
- if (Reflect.construct.sham) return !1;
- if ('function' == typeof Proxy) return !0;
- try {
- return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [
- ], function () {
- })),
- !0
- } catch (e) {
- return !1
- }
- }();
- return function () {
- var e,
- t = ow(n);
- return e = a ? (e = ow(this).constructor, Reflect.construct(t, arguments, e)) : t.apply(this, arguments),
- t = this,
- !(e = e) || 'object' !== ew(e) && 'function' != typeof e ? rw(t) : e
- }
- }
- function rw(e) {
- if (void 0 === e) throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called');
- return e
- }
- function ow(e) {
- return (ow = Object.setPrototypeOf ? Object.getPrototypeOf : function (e) {
- return e.__proto__ || Object.getPrototypeOf(e)
- }) (e)
- }
- function iw(e, t, n) {
- return t in e ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n,
- e
- }
- Mo = function () {
- !function (e, t) {
- if ('function' != typeof t && null !== t) throw new TypeError('Super expression must either be null or a function');
- e.prototype = Object.create(t && t.prototype, {
- constructor: {
- value: e,
- writable: !0,
- configurable: !0
- }
- }),
- t && nw(e, t)
- }(o, A);
- var e,
- t,
- n,
- r = aw(o);
- function o() {
- var t;
- !function (e, t) {
- if (!(e instanceof t)) throw new TypeError('Cannot call a class as a function')
- }(this, o);
- for (var e = arguments.length, n = Array(e), a = 0; a < e; a++) n[a] = arguments[a];
- return iw(rw(t = r.call.apply(r, [
- this
- ].concat(n))), 'state', {
- isExpanded: !1
- }),
- iw(rw(t), 'fetchData', function (e) {
- t.props.onboardingToolFetchData(e)
- }),
- iw(rw(t), 'toggleExpanded', function () {
- t.setState({
- isExpanded: !t.state.isExpanded
- })
- }),
- t
- }
- return e = o,
- (t = [
- {
- key: 'render',
- value: function () {
- if (!this.props.auth.staff) return C.a.createElement('div', {
- className: 'section-contained'
- }, C.a.createElement('div', null, ' You aren\'t allowed to access this page '));
- var e,
- t = this.state.isExpanded ? '' : 'section-contained section-contained-expanded';
- return !1 === this.props.isExceptionTool && (e = C.a.createElement('div', {
- className: 'spacing-bottom-double align align--between'
- }, C.a.createElement('ul', {
- className: 'nav-tabs -small -inline'
- }, Object.keys(xS).map(function (e) {
- return C.a.createElement('li', {
- key: e
- }, C.a.createElement(v.Link, {
- to: '/tools/onboarding/'.concat(e, '/'),
- activeClassName: 'active'
- }, e.replace(/-/g, ' ')))
- })), C.a.createElement('div', {
- className: 'align align--middle'
- }, C.a.createElement('button', {
- onClick: this.toggleExpanded,
- className: 'button button-fill button-small spacing-right'
- }, this.state.isExpanded ? 'Make narrower' : 'Make wider'), C.a.createElement('button', {
- className: 'button button-fill button-small',
- onClick: this.fetchData.bind(this, this.props.params.tab)
- }, 'Refresh')))),
- C.a.createElement('div', {
- className: t
- }, C.a.createElement('div', {
- className: 'layout content__wrap admin_content'
- }, e, this.props.onboardingToolIsFetching ? C.a.createElement('div', {
- className: 'spinner'
- }) : C.a.createElement('div', null, this.props.onboardingToolForums && 0 < this.props.onboardingToolForums.length ? C.a.createElement(XS, {
- fetchData: this.props.onboardingToolFetchData,
- forums: this.props.onboardingToolForums,
- tab: this.props.params.tab,
- updateForum: this.props.onboardingToolUpdateForum,
- updateForumKey: this.props.onboardingToolUpdateForumKey,
- isExceptionTool: this.props.isExceptionTool
- }) : C.a.createElement('div', null, this.props.onboardingToolError ? C.a.createElement(Ki, {
- message: this.props.onboardingToolError,
- alertType: 'error'
- }) : 'No rows returned.', C.a.createElement('a', {
- href: '#',
- onClick: this.fetchData.bind(this, this.props.params.tab)
- }, 'Try again')))))
- }
- }
- ]) && tw(e.prototype, t),
- n && tw(e, n),
- o
- }();
- iw(Mo, 'propTypes', {
- auth: b.a.object,
- isExceptionTool: b.a.bool,
- onboardingToolForums: b.a.array.isRequired,
- onboardingToolFetchData: b.a.func.isRequired,
- onboardingToolIsFetching: b.a.bool.isRequired,
- onboardingToolUpdateForum: b.a.func.isRequired,
- onboardingToolUpdateForumKey: b.a.func.isRequired,
- onboardingToolError: b.a.string,
- params: b.a.shape({
- tab: b.a.string
- }).isRequired
- });
- Vi = Object(u.connect) (function (e) {
- return {
- auth: e.auth.auth,
- selection: e.selection
- }
- }) (Ni.a.attachDrivers(Mo, [
- go
- ]));
- function sw(e) {
- return (sw = 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator ? function (e) {
- return typeof e
- }
- : function (e) {
- return e && 'function' == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? 'symbol' : typeof e
- }) (e)
- }
- function lw(e, t) {
- for (var n = 0; n < t.length; n++) {
- var a = t[n];
- a.enumerable = a.enumerable || !1,
- a.configurable = !0,
- 'value' in a && (a.writable = !0),
- Object.defineProperty(e, a.key, a)
- }
- }
- function cw(e, t) {
- return (cw = Object.setPrototypeOf || function (e, t) {
- return e.__proto__ = t,
- e
- }) (e, t)
- }
- function uw(n) {
- var a = function () {
- if ('undefined' == typeof Reflect || !Reflect.construct) return !1;
- if (Reflect.construct.sham) return !1;
- if ('function' == typeof Proxy) return !0;
- try {
- return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [
- ], function () {
- })),
- !0
- } catch (e) {
- return !1
- }
- }();
- return function () {
- var e,
- t = dw(n);
- return e = a ? (e = dw(this).constructor, Reflect.construct(t, arguments, e)) : t.apply(this, arguments),
- t = this,
- !(e = e) || 'object' !== sw(e) && 'function' != typeof e ? pw(t) : e
- }
- }
- function pw(e) {
- if (void 0 === e) throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called');
- return e
- }
- function dw(e) {
- return (dw = Object.setPrototypeOf ? Object.getPrototypeOf : function (e) {
- return e.__proto__ || Object.getPrototypeOf(e)
- }) (e)
- }
- function mw(e, t, n) {
- return t in e ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n,
- e
- }
- Yc = function (i) {
- var e = (i[0] || '').toUpperCase() + i.substring(1),
- t = 'ForumFlag'.concat(e, 'Driver'),
- s = 'forumFlag'.concat(e),
- e = function () {
- !function (e, t) {
- if ('function' != typeof t && null !== t) throw new TypeError('Super expression must either be null or a function');
- e.prototype = Object.create(t && t.prototype, {
- constructor: {
- value: e,
- writable: !0,
- configurable: !0
- }
- }),
- t && cw(e, t)
- }(o, A);
- var e,
- t,
- n,
- r = uw(o);
- function o() {
- var t;
- !function (e, t) {
- if (!(e instanceof t)) throw new TypeError('Cannot call a class as a function')
- }(this, o);
- for (var e = arguments.length, n = Array(e), a = 0; a < e; a++) n[a] = arguments[a];
- return mw(pw(t = r.call.apply(r, [
- this
- ].concat(n))), 'state', mw({
- }, s, null)),
- mw(pw(t), 'fetchData', function () {
- var e = {
- forum: t.props.selection.forum.shortname
- };
- t.apiCall = io.a.call('forums/'.concat(i), {
- data: e
- }).done(t.onFetch)
- }),
- mw(pw(t), 'onFetch', function (e) {
- null !== e.response && t.setState(mw({
- }, s, e.response))
- }),
- mw(pw(t), 'getComponentProps', function () {
- return mw({
- }, s, t.state[s])
- }),
- t
- }
- return e = o,
- (t = [
- {
- key: 'componentDidMount',
- value: function () {
- this.props.selection.type === ft.forum && this.fetchData()
- }
- },
- {
- key: 'componentWillUnmount',
- value: function () {
- this.apiCall && 'pending' === this.apiCall.state() && this.apiCall.abort()
- }
- }
- ]) && lw(e.prototype, t),
- n && lw(e, n),
- o
- }();
- return mw(e, 'displayName', t),
- mw(e, 'propTypes', {
- selection: ht.isRequired
- }),
- Object(ki.createDriver) (e, function (e) {
- return {
- selection: e.selection
- }
- })
- };
- function fw(e) {
- return (fw = 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator ? function (e) {
- return typeof e
- }
- : function (e) {
- return e && 'function' == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? 'symbol' : typeof e
- }) (e)
- }
- function hw() {
- return (hw = Object.assign || function (e) {
- for (var t = 1; t < arguments.length; t++) {
- var n,
- a = arguments[t];
- for (n in a) Object.prototype.hasOwnProperty.call(a, n) && (e[n] = a[n])
- }
- return e
- }).apply(this, arguments)
- }
- function gw(e, t) {
- for (var n = 0; n < t.length; n++) {
- var a = t[n];
- a.enumerable = a.enumerable || !1,
- a.configurable = !0,
- 'value' in a && (a.writable = !0),
- Object.defineProperty(e, a.key, a)
- }
- }
- function yw(e, t) {
- return (yw = Object.setPrototypeOf || function (e, t) {
- return e.__proto__ = t,
- e
- }) (e, t)
- }
- function bw(n) {
- var a = function () {
- if ('undefined' == typeof Reflect || !Reflect.construct) return !1;
- if (Reflect.construct.sham) return !1;
- if ('function' == typeof Proxy) return !0;
- try {
- return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [
- ], function () {
- })),
- !0
- } catch (e) {
- return !1
- }
- }();
- return function () {
- var e,
- t = _w(n);
- return e = a ? (e = _w(this).constructor, Reflect.construct(t, arguments, e)) : t.apply(this, arguments),
- t = this,
- !(e = e) || 'object' !== fw(e) && 'function' != typeof e ? vw(t) : e
- }
- }
- function vw(e) {
- if (void 0 === e) throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called');
- return e
- }
- function _w(e) {
- return (_w = Object.setPrototypeOf ? Object.getPrototypeOf : function (e) {
- return e.__proto__ || Object.getPrototypeOf(e)
- }) (e)
- }
- function Ew(e, t, n) {
- return t in e ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n,
- e
- }
- var Ow = 100,
- yl = function () {
- !function (e, t) {
- if ('function' != typeof t && null !== t) throw new TypeError('Super expression must either be null or a function');
- e.prototype = Object.create(t && t.prototype, {
- constructor: {
- value: e,
- writable: !0,
- configurable: !0
- }
- }),
- t && yw(e, t)
- }(o, A);
- var e,
- t,
- n,
- r = bw(o);
- function o() {
- var n;
- !function (e, t) {
- if (!(e instanceof t)) throw new TypeError('Cannot call a class as a function')
- }(this, o);
- for (var e = arguments.length, t = Array(e), a = 0; a < e; a++) t[a] = arguments[a];
- return Ew(vw(n = r.call.apply(r, [
- this
- ].concat(t))), 'state', {
- revenue: null,
- revenueErrorCode: null,
- revenueLoading: null
- }),
- Ew(vw(n), 'shouldFetch', function () {
- return null !== n.props.forumFlagHasCustomTerms && !n.props.forumFlagHasCustomTerms && (!n.state.revenue && !n.state.revenueLoading && (!n.props.selection.organization || !n.props.selection.organization.activeGuarantee))
- }),
- Ew(vw(n), 'fetchData', function () {
- var e = {
- forum: n.props.selection.forum.shortname
- };
- n.setState({
- revenueLoading: !0,
- revenueErrorCode: null
- }),
- n.apiCall = io.a.call('discovery/reports/revenueReport.json', {
- data: e
- }).done(n.onFetch).error(n.onError)
- }),
- Ew(vw(n), 'onFetch', function (e) {
- e.response && n.setState({
- revenue: e.response.earnings.map(function (e) {
- return hw({
- }, e, {
- payDateStart: ct.a.utc(e.payDateStart),
- payDateEnd: ct.a.utc(e.payDateEnd),
- periodStart: ct.a.utc(e.periodStart),
- periodEnd: ct.a.utc(e.periodEnd),
- isLessThanMinimum: e.amount < Ow
- })
- }),
- revenueErrorCode: null,
- revenueLoading: !1
- })
- }),
- Ew(vw(n), 'onError', function (e) {
- try {
- var t = JSON.parse(e.responseText).code
- } catch (e) {
- t = !0
- }
- n.setState({
- revenueErrorCode: t,
- revenueLoading: !1
- })
- }),
- Ew(vw(n), 'getComponentProps', function () {
- return {
- revenue: n.state.revenue,
- revenueErrorCode: n.state.revenueErrorCode,
- revenueLoading: n.state.revenueLoading
- }
- }),
- n
- }
- return e = o,
- (t = [
- {
- key: 'componentDidMount',
- value: function () {
- this.shouldFetch() && this.fetchData()
- }
- },
- {
- key: 'componentWillReceiveProps',
- value: function () {
- this.shouldFetch() && this.fetchData()
- }
- }
- ]) && gw(e.prototype, t),
- n && gw(e, n),
- o
- }();
- Ew(yl, 'displayName', 'RevenueDriver'),
- Ew(yl, 'propTypes', {
- forumFlagHasCustomTerms: b.a.bool,
- forumFlagHasPaymentInfo: b.a.bool,
- selection: ht.isRequired
- });
- function Sw() {
- var e = (e = br.shortname && window._v5Config.forums[br.shortname]) && e.tipaltiUrl;
- return C.a.createElement('div', {
- className: 'alert alert--warning-light spacing-bottom'
- }, C.a.createElement('div', {
- className: 'spacing-narrow'
- }, C.a.createElement('h2', {
- className: 'spacing-bottom-narrow'
- }, C.a.createElement('span', {
- className: 'icon__position spacing-right-small'
- }, C.a.createElement('img', {
- src: '//c.disquscdn.com/next/current/publisher-admin/assets/img/icons/vip-info.png',
- width: '20'
- })), 'We need more info to pay you!'), C.a.createElement('p', {
- className: 'text-medium'
- }, 'You\'ve earned money that we\'d like to send you. Be sure to fill out your ', C.a.createElement('strong', null, C.a.createElement('a', {
- href: e,
- target: '_blank'
- }, 'payment information')), ' so we can pay you soon.')))
- }
- h = Object(ki.attachDrivers) (Object(ki.createDriver) (yl), [
- Yc('hasPaymentInfo'),
- Yc('hasCustomTerms')
- ]);
- function ww(e) {
- return (ww = 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator ? function (e) {
- return typeof e
- }
- : function (e) {
- return e && 'function' == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? 'symbol' : typeof e
- }) (e)
- }
- function Pw(e, t) {
- for (var n = 0; n < t.length; n++) {
- var a = t[n];
- a.enumerable = a.enumerable || !1,
- a.configurable = !0,
- 'value' in a && (a.writable = !0),
- Object.defineProperty(e, a.key, a)
- }
- }
- function kw(e, t) {
- return (kw = Object.setPrototypeOf || function (e, t) {
- return e.__proto__ = t,
- e
- }) (e, t)
- }
- function Nw(n) {
- var a = function () {
- if ('undefined' == typeof Reflect || !Reflect.construct) return !1;
- if (Reflect.construct.sham) return !1;
- if ('function' == typeof Proxy) return !0;
- try {
- return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [
- ], function () {
- })),
- !0
- } catch (e) {
- return !1
- }
- }();
- return function () {
- var e,
- t = Rw(n);
- return e = a ? (e = Rw(this).constructor, Reflect.construct(t, arguments, e)) : t.apply(this, arguments),
- t = this,
- !(e = e) || 'object' !== ww(e) && 'function' != typeof e ? Cw(t) : e
- }
- }
- function Cw(e) {
- if (void 0 === e) throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called');
- return e
- }
- function Rw(e) {
- return (Rw = Object.setPrototypeOf ? Object.getPrototypeOf : function (e) {
- return e.__proto__ || Object.getPrototypeOf(e)
- }) (e)
- }
- function xw(e, t, n) {
- return t in e ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n,
- e
- }
- i = b.a.shape({
- periodStart: s.moment,
- periodEnd: s.moment,
- payDateStart: s.moment,
- payDateEnd: s.moment
- }),
- Qs = function n(e) {
- var a = e.icon;
- return C.a.createElement('table', {
- className: 'table--no-border -inner-no-border earnings-table'
- }, C.a.createElement('thead', {
- className: 'earnings-table__subtext text-subheading'
- }, C.a.createElement('tr', null, C.a.createElement('th', {
- className: 'earnings-timeline__indicator'
- }), C.a.createElement('th', null, 'Earnings Period'), C.a.createElement('th', null, 'Estimated Pay Date'), C.a.createElement('th', null, 'Amount'))), C.a.createElement('tbody', null, e.rows.map(function (e) {
- var t = ct() (e.periodStart).format('MMDDYY');
- return C.a.createElement(n.Row, {
- key: t,
- row: e,
- icon: a
- })
- }), e.total ? C.a.createElement('tr', {
- className: 'earnings-table__subtext text-subheading'
- }, C.a.createElement('td', null), C.a.createElement('td', {
- colSpan: '2'
- }, 'Total'), C.a.createElement('td', null, '$', Dp.addThousandsSeparator(e.total.toFixed(2)))) : null))
- };
- Qs.displayName = 'EarningsTable',
- Qs.propTypes = {
- icon: b.a.string.isRequired,
- rows: b.a.arrayOf(i).isRequired,
- total: b.a.number
- },
- Qs.Row = (Ls = Pc = function () {
- !function (e, t) {
- if ('function' != typeof t && null !== t) throw new TypeError('Super expression must either be null or a function');
- e.prototype = Object.create(t && t.prototype, {
- constructor: {
- value: e,
- writable: !0,
- configurable: !0
- }
- }),
- t && kw(e, t)
- }(o, A);
- var e,
- t,
- n,
- r = Nw(o);
- function o() {
- var e;
- !function (e, t) {
- if (!(e instanceof t)) throw new TypeError('Cannot call a class as a function')
- }(this, o);
- for (var t = arguments.length, n = Array(t), a = 0; a < t; a++) n[a] = arguments[a];
- return xw(Cw(e = r.call.apply(r, [
- this
- ].concat(n))), 'formatDate', function (e) {
- return e.utc().format('MM/D/YY')
- }),
- e
- }
- return e = o,
- (t = [
- {
- key: 'render',
- value: function () {
- var e = this.props.row.periodStart.utc().format('MMM'),
- t = this.formatDate(this.props.row.periodStart),
- n = this.formatDate(this.props.row.periodEnd),
- a = this.formatDate(this.props.row.payDateStart),
- r = this.formatDate(this.props.row.payDateEnd);
- return C.a.createElement('tr', null, C.a.createElement('td', {
- className: 'earnings-timeline__indicator'
- }, C.a.createElement('span', {
- className: 'earnings-timeline__date'
- }, e), C.a.createElement('img', {
- src: '//c.disquscdn.com/next/current/publisher-admin/assets/'.concat(this.props.icon)
- })), C.a.createElement('td', null, t, ' - ', n), C.a.createElement('td', null, this.props.row.isLessThanMinimum ? C.a.createElement(Md, {
- tooltipKey: 'payment',
- content: 'Payment dates can be estimated for upcoming payments of $100 or more.',
- direction: 'top'
- }) : ''.concat(a, ' - ').concat(r)), C.a.createElement('td', null, '$', Dp.addThousandsSeparator(this.props.row.amount.toFixed(2))))
- }
- }
- ]) && Pw(e.prototype, t),
- n && Pw(e, n),
- o
- }(), xw(Pc, 'propTypes', {
- icon: b.a.string.isRequired,
- row: i.isRequired
- }), Ls),
- Qs.ROW_SHAPE = i;
- var Aw = Qs,
- Mo = function (e) {
- var t,
- n,
- a,
- r = 'earnings-timeline earnings-timeline--first';
- return 0 === e.rows.length && (r += ' earnings-timeline--empty'),
- 0 === e.total ? a = C.a.createElement('p', null, 'You don\'t have any upcoming payments. ', C.a.createElement('a', {
- href: 'https://help.disqus.com/customer/portal/articles/1208081-receiving-payments-from-disqus'
- }, 'Learn more'), '.') : e.total < 100 ? a = C.a.createElement('p', {
- className: 'text-error spacing-narrow'
- }, 'Payment minimum not met. Payment will be scheduled when the balance reaches $100.') : 100 <= e.total && (n = e.rows[0], t = ct() (n.payDateStart).format('MMMM DD, YYYY'), n = ct() (n.payDateEnd).format('MMMM DD, YYYY'), a = C.a.createElement('p', {
- className: 'spacing-bottom'
- }, 'Estimated delivery ', t, ' - ', n)),
- C.a.createElement('div', null, C.a.createElement('div', {
- className: r
- }, C.a.createElement('div', {
- className: 'earnings-timeline__indicator pull-left'
- }, C.a.createElement('span', {
- className: 'earnings-timeline__date'
- }), C.a.createElement('img', {
- src: '//c.disquscdn.com/next/current/publisher-admin/assets/img/icons/icon-analytics-mail.png'
- })), C.a.createElement('div', {
- className: 'earnings-timeline__header'
- }, C.a.createElement('h3', {
- className: 'spacing-bottom-narrow'
- }, C.a.createElement('strong', null, 'Upcoming Payment: '), C.a.createElement('span', {
- className: 'text-success'
- }, '$', Dp.addThousandsSeparator(e.total.toFixed(2)))), a), e.rows && 0 < e.rows.length ? C.a.createElement(Aw, {
- rows: e.rows,
- icon: '/img/icons/icon-analytics-check.png'
- }) : null))
- };
- Mo.displayName = 'UpcomingPayments',
- Mo.propTypes = {
- total: b.a.number.isRequired,
- rows: b.a.arrayOf(Aw.ROW_SHAPE).isRequired
- };
- var Dw = Mo,
- go = function (e) {
- var t = 'earnings-timeline earnings-timeline--last';
- return 0 === e.rows.length && (t += ' earnings-timeline--empty'),
- C.a.createElement('div', null, C.a.createElement('div', {
- className: t
- }, C.a.createElement('div', {
- className: 'earnings-timeline__indicator pull-left'
- }), C.a.createElement('div', {
- className: 'earnings-timeline__header'
- }, C.a.createElement('h3', {
- className: 'spacing-bottom-narrow'
- }, C.a.createElement('strong', null, 'Unpaid Earnings: '), C.a.createElement('span', {
- className: 'text-warning'
- }, '$', Dp.addThousandsSeparator(e.total.toFixed(2)))), 0 < e.total ? null : C.a.createElement('p', null, 'You don\'t have any unpaid earnings. ', C.a.createElement('a', {
- href: 'https://help.disqus.com/customer/portal/articles/1208081-receiving-payments-from-disqus'
- }, 'Learn more'), '.')), e.rows && 0 < e.rows.length ? C.a.createElement(Aw, {
- rows: e.rows,
- total: e.total,
- icon: '/img/icons/icon-analytics-clock.png'
- }) : null))
- };
- go.displayName = 'UnpaidEarnings',
- go.propTypes = {
- total: b.a.number.isRequired,
- rows: b.a.arrayOf(Aw.ROW_SHAPE).isRequired
- };
- var jw = go;
- function Tw(e) {
- return (Tw = 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator ? function (e) {
- return typeof e
- }
- : function (e) {
- return e && 'function' == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? 'symbol' : typeof e
- }) (e)
- }
- function Iw(e, t) {
- for (var n = 0; n < t.length; n++) {
- var a = t[n];
- a.enumerable = a.enumerable || !1,
- a.configurable = !0,
- 'value' in a && (a.writable = !0),
- Object.defineProperty(e, a.key, a)
- }
- }
- function qw(e, t) {
- return (qw = Object.setPrototypeOf || function (e, t) {
- return e.__proto__ = t,
- e
- }) (e, t)
- }
- function Fw(n) {
- var a = function () {
- if ('undefined' == typeof Reflect || !Reflect.construct) return !1;
- if (Reflect.construct.sham) return !1;
- if ('function' == typeof Proxy) return !0;
- try {
- return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [
- ], function () {
- })),
- !0
- } catch (e) {
- return !1
- }
- }();
- return function () {
- var e,
- t = Uw(n);
- return e = a ? (e = Uw(this).constructor, Reflect.construct(t, arguments, e)) : t.apply(this, arguments),
- t = this,
- !(e = e) || 'object' !== Tw(e) && 'function' != typeof e ? Lw(t) : e
- }
- }
- function Lw(e) {
- if (void 0 === e) throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called');
- return e
- }
- function Uw(e) {
- return (Uw = Object.setPrototypeOf ? Object.getPrototypeOf : function (e) {
- return e.__proto__ || Object.getPrototypeOf(e)
- }) (e)
- }
- function Mw(e, t, n) {
- return t in e ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n,
- e
- }
- yl = function () {
- !function (e, t) {
- if ('function' != typeof t && null !== t) throw new TypeError('Super expression must either be null or a function');
- e.prototype = Object.create(t && t.prototype, {
- constructor: {
- value: e,
- writable: !0,
- configurable: !0
- }
- }),
- t && qw(e, t)
- }(o, A);
- var e,
- t,
- n,
- r = Fw(o);
- function o() {
- var t;
- !function (e, t) {
- if (!(e instanceof t)) throw new TypeError('Cannot call a class as a function')
- }(this, o);
- for (var e = arguments.length, n = Array(e), a = 0; a < e; a++) n[a] = arguments[a];
- return Mw(Lw(t = r.call.apply(r, [
- this
- ].concat(n))), 'state', {
- showHistory: !1
- }),
- Mw(Lw(t), 'onShowHistory', function (e) {
- e.preventDefault(),
- t.setState({
- showHistory: !0
- })
- }),
- t
- }
- return e = o,
- (t = [
- {
- key: 'render',
- value: function () {
- if (null === this.props.forumFlagHasPaymentInfo || null === this.props.forumFlagHasCustomTerms) return C.a.createElement('div', {
- className: 'admin_content'
- }, C.a.createElement(o.Header, {
- selection: this.props.selection
- }), C.a.createElement(Ji, null));
- if (this.props.forumFlagHasCustomTerms) return C.a.createElement('div', {
- className: 'admin_content'
- }, C.a.createElement(o.Header, {
- selection: this.props.selection
- }), C.a.createElement(o.SpecialTermsAlert, null));
- var e = je.a.where(this.props.revenue, {
- status: 'upcoming'
- }),
- t = e.reduce(function (e, t) {
- return e + t.amount
- }, 0),
- n = je.a.where(this.props.revenue, {
- status: 'unpaid'
- }),
- a = n.reduce(function (e, t) {
- return e + t.amount
- }, 0),
- r = this.props.selection.organization && this.props.selection.organization.activeGuarantee;
- return C.a.createElement('div', {
- className: 'admin_content'
- }, C.a.createElement(o.Header, {
- selection: this.props.selection
- }), !this.props.forumFlagHasPaymentInfo && 75 <= t ? C.a.createElement(Sw, null) : null, this.props.revenueErrorCode ? C.a.createElement(dd, {
- isPermissionError: 22 === this.props.revenueErrorCode
- }) : null, r ? C.a.createElement(pd, {
- secondaryMessageType: 'payments',
- startDate: ct() (r.start),
- endDate: ct() (r.end),
- amount: r.amount
- }) : null, this.props.revenueLoading ? C.a.createElement(Ji, null) : null, this.props.revenueErrorCode || this.props.revenueLoading || r ? null : C.a.createElement('div', null, C.a.createElement(Dw, {
- rows: e,
- total: t
- }), C.a.createElement(jw, {
- rows: n,
- total: a
- })))
- }
- }
- ]) && Iw(e.prototype, t),
- n && Iw(e, n),
- o
- }();
- Mw(yl, 'propTypes', {
- forumFlagHasCustomTerms: b.a.bool,
- forumFlagHasPaymentInfo: b.a.bool,
- revenue: b.a.array,
- revenueErrorCode: b.a.number,
- revenueLoading: b.a.bool,
- selection: ht.isRequired
- }),
- yl.Header = function (e) {
- return C.a.createElement('div', {
- className: 'spacing-bottom'
- }, C.a.createElement('h2', {
- className: 'text-larger text-gray-darker'
- }, 'Your Site\'s Payment Schedule', C.a.createElement('div', {
- className: 'tooltip-ct label--gray label--payments-tooltip'
- }, 'What\'s This?', C.a.createElement('span', {
- className: 'tooltip'
- }, 'Disqus pays out monthly on a 90-day trailing basis and with a $100 minimum. Be sure to fill out your ', C.a.createElement('a', {
- href: e.selection.forum.tipaltiUrl,
- target: '_blank'
- }, 'payment method and other information'), ' needed for your payment to reach you.'))))
- },
- yl.Header.displayName = 'PaymentsHeader',
- yl.Header.propTypes = {
- selection: ht.isRequired
- },
- yl.SpecialTermsAlert = function () {
- return C.a.createElement('div', {
- className: 'alert alert--warning-light spacing-bottom'
- }, C.a.createElement('div', {
- className: 'spacing-narrow'
- }, C.a.createElement('h2', {
- className: 'spacing-bottom-narrow'
- }, C.a.createElement('span', {
- className: 'icon__position spacing-right-small'
- }, C.a.createElement('img', {
- src: '//c.disquscdn.com/next/current/publisher-admin/assets/img/icons/credentials.png',
- width: '20'
- })), 'You have special payment terms!'), C.a.createElement('p', {
- className: 'text-medium'
- }, 'You can download your Earnings and Payments. Please ', C.a.createElement('strong', null, C.a.createElement('a', {
- href: Pn.revealContact
- }, 'contact our Publisher Support Team')), ' for further assistance.')))
- },
- yl.SpecialTermsAlert.displayName = 'PaymentsSpecialTermsAlert';
- var Bw = Ni.a.attachDrivers(yl, [
- h,
- Yc('hasPaymentInfo'),
- Yc('hasCustomTerms')
- ]),
- Pc = n(493),
- zw = n.n(Pc);
- function Hw(e) {
- return (Hw = 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator ? function (e) {
- return typeof e
- }
- : function (e) {
- return e && 'function' == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? 'symbol' : typeof e
- }) (e)
- }
- function Gw(e, t) {
- for (var n = 0; n < t.length; n++) {
- var a = t[n];
- a.enumerable = a.enumerable || !1,
- a.configurable = !0,
- 'value' in a && (a.writable = !0),
- Object.defineProperty(e, a.key, a)
- }
- }
- function Vw(e, t) {
- return (Vw = Object.setPrototypeOf || function (e, t) {
- return e.__proto__ = t,
- e
- }) (e, t)
- }
- function Ww(n) {
- var a = function () {
- if ('undefined' == typeof Reflect || !Reflect.construct) return !1;
- if (Reflect.construct.sham) return !1;
- if ('function' == typeof Proxy) return !0;
- try {
- return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [
- ], function () {
- })),
- !0
- } catch (e) {
- return !1
- }
- }();
- return function () {
- var e,
- t = Qw(n);
- return e = a ? (e = Qw(this).constructor, Reflect.construct(t, arguments, e)) : t.apply(this, arguments),
- t = this,
- !(e = e) || 'object' !== Hw(e) && 'function' != typeof e ? Yw(t) : e
- }
- }
- function Yw(e) {
- if (void 0 === e) throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called');
- return e
- }
- function Qw(e) {
- return (Qw = Object.setPrototypeOf ? Object.getPrototypeOf : function (e) {
- return e.__proto__ || Object.getPrototypeOf(e)
- }) (e)
- }
- function Kw(e, t, n) {
- return t in e ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n,
- e
- }
- Ls = function () {
- !function (e, t) {
- if ('function' != typeof t && null !== t) throw new TypeError('Super expression must either be null or a function');
- e.prototype = Object.create(t && t.prototype, {
- constructor: {
- value: e,
- writable: !0,
- configurable: !0
- }
- }),
- t && Vw(e, t)
- }(o, A);
- var e,
- t,
- n,
- r = Ww(o);
- function o() {
- var e;
- !function (e, t) {
- if (!(e instanceof t)) throw new TypeError('Cannot call a class as a function')
- }(this, o);
- for (var t = arguments.length, n = Array(t), a = 0; a < t; a++) n[a] = arguments[a];
- return Kw(Yw(e = r.call.apply(r, [
- this
- ].concat(n))), 'state', {
- isOpen: !1
- }),
- Kw(Yw(e), 'handleClick', function () {
- e.setState({
- isOpen: !e.state.isOpen
- })
- }),
- e
- }
- return e = o,
- (t = [
- {
- key: 'render',
- value: function () {
- var e = this.state.isOpen ? 'nav__item dropdown-open' : 'nav__item';
- return C.a.createElement('nav', {
- className: 'layout__nav'
- }, C.a.createElement('div', {
- onClick: this.handleClick,
- className: 'nav--mobile-dropdown'
- }, C.a.createElement(ri, {
- linkClassName: e,
- linkActiveClassName: 'active',
- path: '/analytics/revenue/',
- selection: this.props.selection
- }, C.a.createElement('div', {
- className: 'nav-lnk -color-muted'
- }, C.a.createElement('div', {
- className: 'nav-lnk__blk'
- }, C.a.createElement('span', {
- className: 'button__text'
- }, 'Analyze revenue')), C.a.createElement('div', {
- className: 'nav-lnk__pointer'
- }, C.a.createElement('span', {
- className: 'icon icon-right-bracket'
- })))), C.a.createElement(Uo, {
- linkClassName: e,
- linkActiveClassName: 'active',
- path: '/analytics/payments/',
- selection: this.props.selection
- }, C.a.createElement('div', {
- className: 'nav-lnk -color-muted'
- }, C.a.createElement('div', {
- className: 'nav-lnk__blk'
- }, C.a.createElement('span', {
- className: 'button__text'
- }, 'Payments')), C.a.createElement('div', {
- className: 'nav-lnk__pointer'
- }, C.a.createElement('span', {
- className: 'icon icon-right-bracket'
- }))))), C.a.createElement(Uo, {
- linkClassName: 'button button-fill--brand text-medium button-wide hidden-md',
- linkActiveClassName: 'active',
- path: '/settings/ads/',
- selection: this.props.selection
- }, C.a.createElement('span', {
- className: 'icon-cog icon__position text-smaller spacing-right-small'
- }), 'Ad Settings'))
- }
- }
- ]) && Gw(e.prototype, t),
- n && Gw(e, n),
- o
- }();
- Kw(Ls, 'propTypes', {
- selection: ht.isRequired
- });
- var Jw = Ls,
- i = function (e) {
- var t = {
- selection: e.selection,
- initialQuestionGroup: CO.deactivationHubOrg
- };
- return C.a.createElement('div', {
- className: 'section-contained'
- }, C.a.createElement('div', {
- className: 'layout layout--publishers'
- }, C.a.createElement('div', {
- className: 'layout__main'
- }, C.a.createElement(Jw, {
- selection: e.selection
- }), C.a.createElement('div', {
- className: 'layout__content'
- }, C.a.cloneElement(e.children, t)))))
- };
- i.displayName = 'Reveal',
- i.propTypes = {
- children: b.a.node.isRequired,
- selection: ht.isRequired
- };
- var $w = Object(u.connect) (function (e) {
- return {
- selection: e.selection
- }
- }) (i),
- Qs = function (e) {
- return C.a.createElement('div', {
- className: 'content__wrap spacing-bottom-double'
- }, e.header ? C.a.createElement('header', {
- className: 'settings__header'
- }, e.header) : null, C.a.createElement('section', {
- className: 'settings__content'
- }, e.children), e.footer ? C.a.createElement('footer', {
- className: 'settings__footer'
- }, C.a.createElement('div', {
- className: 'fieldset__block'
- }, e.footer)) : null)
- };
- Qs.displayName = 'DeactivationBasePanel',
- Qs.propTypes = {
- header: b.a.node,
- footer: b.a.node,
- children: b.a.node.isRequired
- };
- var Zw = Qs,
- Mo = function (t) {
- return C.a.createElement(Zw, {
- header: [
- C.a.createElement('h1', {
- key: 'header',
- className: 'text-semibold text-larger text-gray-darker spacing-bottom-small'
- }, t.header),
- C.a.createElement('div', {
- key: 'description',
- className: 'text-gray'
- }, t.description)
- ],
- footer: [
- t.goBackButton,
- C.a.createElement('button', {
- key: 'submitButton',
- onClick: t.onAnswerSubmit,
- className: 'button button-fill--brand button-medium button-padding-taller pull-right',
- disabled: t.submitDisabled
- }, C.a.createElement('span', {
- className: 'spacing-left-small'
- }, t.submitContent), C.a.createElement('span', {
- className: 'icon-right-bracket icon__position -md spacing-left-small'
- }))
- ]
- }, C.a.createElement('div', {
- className: 'spacing-top-narrow'
- }, t.formHeader ? C.a.createElement('div', {
- className: 'border-bottom spacing-bottom padding-bottom'
- }, C.a.createElement('strong', null, t.formHeader)) : null, t.choices.map(function (e) {
- return C.a.createElement('label', {
- key: e.choice,
- className: 'align spacing-bottom-narrow text-medium'
- }, C.a.createElement('input', {
- type: 'radio',
- name: t.name,
- className: 'spacing-right',
- value: e.choice,
- onChange: t.onAnswerSelected,
- checked: e.choice === t.selectedAnswer
- }), e.choice, e.has_arbitrary_text ? C.a.createElement('input', {
- type: 'text',
- className: 'input--textbox -text-small spacing-left deactivation-input--other',
- value: t.selectedAnswerArbitraryText,
- onChange: t.onAnswerArbitraryTextChange,
- disabled: e.choice !== t.selectedAnswer
- }) : null)
- })))
- };
- Mo.displayName = 'DeactivationAnswerForm',
- Mo.propTypes = {
- onAnswerSelected: b.a.func.isRequired,
- onAnswerArbitraryTextChange: b.a.func.isRequired,
- onAnswerSubmit: b.a.func.isRequired,
- header: b.a.string.isRequired,
- name: b.a.string.isRequired,
- goBackButton: b.a.element.isRequired,
- submitContent: b.a.string.isRequired,
- submitDisabled: b.a.bool,
- description: b.a.oneOfType([b.a.string,
- b.a.element]).isRequired,
- formHeader: b.a.string.isRequired,
- choices: b.a.arrayOf(b.a.shape({
- choice: b.a.string.isRequired,
- has_arbitrary_text: b.a.bool.isRequired
- })).isRequired,
- selectedAnswer: b.a.string,
- selectedAnswerArbitraryText: b.a.string
- };
- var Xw = Mo,
- go = function (e) {
- return C.a.createElement(Zw, {
- header: [
- C.a.createElement('span', {
- key: 'icon',
- className: 'text-green icon-checkmark text-large icon__position -md spacing-right'
- }),
- C.a.createElement('span', {
- key: 'answer',
- className: 'text-gray'
- }, e.answer)
- ],
- footer: [
- C.a.createElement('button', {
- key: 'back',
- onClick: e.onGoBack,
- className: 'button button-outline text-medium button-padding-taller'
- }, C.a.createElement('span', {
- className: 'icon-right-bracket icon-flipped spacing-right-small'
- }), C.a.createElement('span', {
- className: 'spacing-right'
- }, 'Go back')),
- C.a.createElement('button', {
- key: 'continue',
- onClick: e.onContinue,
- className: 'button button-fill--brand button-medium button-padding-taller pull-right'
- }, C.a.createElement('span', {
- className: 'spacing-left-small'
- }, 'Continue Deactivating Ads'), C.a.createElement('span', {
- className: 'icon-right-bracket icon__position -md spacing-left-small'
- }))
- ]
- }, C.a.createElement('div', {
- className: 'spacing-top'
- }, C.a.createElement('p', null, C.a.createElement('strong', null, e.followUpText)), e.followUpButton))
- };
- go.displayName = 'DeactivationFollowup',
- go.propTypes = {
- onGoBack: b.a.func.isRequired,
- onContinue: b.a.func.isRequired,
- answer: b.a.string.isRequired,
- followUpText: b.a.string.isRequired,
- followUpButton: b.a.element.isRequired
- };
- var eP = go,
- yl = function (e) {
- return C.a.createElement(Zw, {
- header: [
- C.a.createElement('h1', {
- key: 'header',
- className: 'text-semibold text-larger text-gray-darker spacing-bottom-small'
- }, 'Please confirm that you’d like to deactivate Reveal'),
- C.a.createElement('div', {
- key: 'description',
- className: 'text-gray'
- }, 'Thanks again for your input! Please confirm that you’d like to deactivate Reveal on the following:')
- ],
- footer: [
- C.a.createElement('button', {
- key: 'back',
- onClick: e.onGoBack,
- className: 'button button-outline text-medium button-padding-taller'
- }, C.a.createElement('span', {
- className: 'icon-right-bracket icon-flipped spacing-right-small'
- }), C.a.createElement('span', {
- className: 'spacing-right'
- }, 'Go back')),
- C.a.createElement('button', {
- key: 'continue',
- onClick: e.onConfirm,
- className: 'button button-fill--brand button-medium button-padding-taller spacing-right pull-right'
- }, 'Deactivate Ads Now')
- ]
- }, C.a.createElement('div', {
- className: 'spacing-top'
- }, 'organization' === e.selection.type ? C.a.createElement('div', {
- className: 'media spacing-top'
- }, C.a.createElement('div', {
- className: 'media-left'
- }, C.a.createElement('span', {
- className: 'icon-organization text-gray text-larger'
- })), C.a.createElement('div', {
- className: 'media-body'
- }, C.a.createElement('p', {
- className: 'text-large spacing-bottom'
- }, C.a.createElement('strong', {
- className: 'spacing-right-small'
- }, e.selection.organization.name || 'Your Organization'), '(', function (e) {
- e = e.length;
- return 1 === e ? '1 site' : ''.concat(e, ' sites')
- }(e.hubQualifiedForums), ')'), C.a.createElement('ul', {
- className: 'list-bullet'
- }, e.hubQualifiedForums.map(function (e) {
- return C.a.createElement('li', {
- key: e.id
- }, e.name)
- })))) : C.a.createElement('div', {
- className: 'media spacing-top'
- }, C.a.createElement('div', {
- className: 'media-body'
- }, C.a.createElement('p', {
- className: 'text-large spacing-bottom'
- }, C.a.createElement('strong', null, e.selection.forum.name))))))
- };
- yl.propTypes = {
- selection: ht.isRequired,
- onConfirm: b.a.func.isRequired,
- onGoBack: b.a.func.isRequired,
- hubQualifiedForums: b.a.array
- },
- yl.displayName = 'DeactivationConfirmation';
- var tP = yl,
- h = function (e) {
- return C.a.createElement(Zw, {
- footer: [
- C.a.createElement(Uo, {
- key: 'back',
- path: '/settings/ads/',
- linkClassName: 'button button-fill--brand button-medium button-padding-taller',
- selection: e.selection
- }, 'Ad Settings'),
- C.a.createElement('a', {
- key: 'contact',
- href: e.contactUrl,
- target: '_blank',
- className: 'button button-outline button-medium spacing-left button-padding-taller'
- }, 'Contact Support')
- ]
- }, C.a.createElement('h1', {
- className: 'text-semibold text-larger text-gray-darker spacing-top spacing-bottom'
- }, 'You’ve successfully deactivated Reveal'), C.a.createElement('p', {
- className: 'text-gray'
- }, 'Thanks again for your responses. If you had Reveal ads running, please allow some time for your sites to update, as the system may take several minutes to remove your ads. Our publisher success team may follow up with you soon. In the meantime, if you have any questions about Reveal, please get in touch with us. Thanks again for using Disqus!'))
- };
- h.propTypes = {
- selection: ht.isRequired,
- contactUrl: b.a.string.isRequired
- },
- h.displayName = 'DeactivationComplete';
- var nP = h;
- function aP(e) {
- return (aP = 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator ? function (e) {
- return typeof e
- }
- : function (e) {
- return e && 'function' == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? 'symbol' : typeof e
- }) (e)
- }
- function rP() {
- return (rP = Object.assign || function (e) {
- for (var t = 1; t < arguments.length; t++) {
- var n,
- a = arguments[t];
- for (n in a) Object.prototype.hasOwnProperty.call(a, n) && (e[n] = a[n])
- }
- return e
- }).apply(this, arguments)
- }
- function oP(t, e) {
- var n,
- a = Object.keys(t);
- return Object.getOwnPropertySymbols && (n = Object.getOwnPropertySymbols(t), e && (n = n.filter(function (e) {
- return Object.getOwnPropertyDescriptor(t, e).enumerable
- })), a.push.apply(a, n)),
- a
- }
- function iP(t) {
- for (var e = 1; e < arguments.length; e++) {
- var n = null != arguments[e] ? arguments[e] : {
- };
- e % 2 ? oP(Object(n), !0).forEach(function (e) {
- fP(t, e, n[e])
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(n)) : oP(Object(n)).forEach(function (e) {
- Object.defineProperty(t, e, Object.getOwnPropertyDescriptor(n, e))
- })
- }
- return t
- }
- function sP(e) {
- return function (e) {
- if (Array.isArray(e)) return lP(e)
- }(e) || function (e) {
- if ('undefined' != typeof Symbol && null != e[Symbol.iterator] || null != e['@@iterator']) return Array.from(e)
- }(e) || function (e, t) {
- if (e) {
- if ('string' == typeof e) return lP(e, t);
- var n = Object.prototype.toString.call(e).slice(8, - 1);
- return 'Map' === (n = 'Object' === n && e.constructor ? e.constructor.name : n) || 'Set' === n ? Array.from(e) : 'Arguments' === n || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n) ? lP(e, t) : void 0
- }
- }(e) || function () {
- throw new TypeError('Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.')
- }()
- }
- function lP(e, t) {
- for (var n = 0, a = Array(t = null == t || e.length < t ? e.length : t); n < t; n++) a[n] = e[n];
- return a
- }
- function cP(e, t) {
- for (var n = 0; n < t.length; n++) {
- var a = t[n];
- a.enumerable = a.enumerable || !1,
- a.configurable = !0,
- 'value' in a && (a.writable = !0),
- Object.defineProperty(e, a.key, a)
- }
- }
- function uP(e, t) {
- return (uP = Object.setPrototypeOf || function (e, t) {
- return e.__proto__ = t,
- e
- }) (e, t)
- }
- function pP(n) {
- var a = function () {
- if ('undefined' == typeof Reflect || !Reflect.construct) return !1;
- if (Reflect.construct.sham) return !1;
- if ('function' == typeof Proxy) return !0;
- try {
- return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [
- ], function () {
- })),
- !0
- } catch (e) {
- return !1
- }
- }();
- return function () {
- var e,
- t = mP(n);
- return e = a ? (e = mP(this).constructor, Reflect.construct(t, arguments, e)) : t.apply(this, arguments),
- t = this,
- !(e = e) || 'object' !== aP(e) && 'function' != typeof e ? dP(t) : e
- }
- }
- function dP(e) {
- if (void 0 === e) throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called');
- return e
- }
- function mP(e) {
- return (mP = Object.setPrototypeOf ? Object.getPrototypeOf : function (e) {
- return e.__proto__ || Object.getPrototypeOf(e)
- }) (e)
- }
- function fP(e, t, n) {
- return t in e ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n,
- e
- }
- Yc = function () {
- !function (e, t) {
- if ('function' != typeof t && null !== t) throw new TypeError('Super expression must either be null or a function');
- e.prototype = Object.create(t && t.prototype, {
- constructor: {
- value: e,
- writable: !0,
- configurable: !0
- }
- }),
- t && uP(e, t)
- }(o, A);
- var e,
- t,
- n,
- a = pP(o);
- function o() {
- var r;
- !function (e, t) {
- if (!(e instanceof t)) throw new TypeError('Cannot call a class as a function')
- }(this, o);
- for (var e = arguments.length, t = Array(e), n = 0; n < e; n++) t[n] = arguments[n];
- return fP(dP(r = a.call.apply(a, [
- this
- ].concat(t))), 'state', {
- currentQuestion: null,
- currentAnswer: null,
- currentAnswerArbitraryText: null,
- previousAnswers: [
- ],
- previousQuestions: [
- ],
- followup: null,
- hasCompletedFirstQuestion: !1,
- hasDismissedFollowup: !1,
- hasCompletedDeactivation: !1
- }),
- fP(dP(r), 'handleGoBack', function () {
- var e,
- t = sP(r.state.previousQuestions),
- n = r.state.previousAnswers.slice(0, - 1),
- a = t.pop().id;
- a === r.props.questions[0].question.id ? r.setInitialQuestion(r.props.questions) : (e = {
- }, e = r.state.hasDismissedFollowup ? {
- hasDismissedFollowup: !1
- }
- : {
- followup: null,
- previousQuestions: t,
- previousAnswers: n
- }, r.setState(iP(iP({
- }, r.parseQuestionId(a)), e)))
- }),
- fP(dP(r), 'setInitialQuestion', function (e) {
- var t = e[0],
- e = r.parseAnswer(t.answer);
- r.setState({
- currentQuestion: t.question,
- currentAnswer: e.choice,
- currentAnswerArbitraryText: e.text
- })
- }),
- fP(dP(r), 'handleConfirmDeactivate', function () {
- var e = r.props.params;
- r.props.deactivateOnPerformAction(e.campaign, 'user-opt-out', e.hubspotCompanyId, r.jesterEmit),
- r.setState({
- hasCompletedDeactivation: !0
- })
- }),
- fP(dP(r), 'jesterEmit', function (e) {
- var t,
- n,
- a;
- r.props.selection.type === ft.forum && (t = r.props.forumDetails.settings, n = e.response.settings, a = Jo.ADS_KEYS),
- Jo.trackSettingsChanges({
- selection: r.props.selection,
- jesterData: {
- verb: 'update',
- zone: 'settings',
- section: 'deactivation_hub'
- },
- oldState: Jo.ensureBooleans(t),
- newState: Jo.ensureBooleans(n),
- keys: a
- })
- }),
- fP(dP(r), 'getFollowupButton', function (e) {
- e = e.extra_data;
- if (e.link_text) {
- if (e.forum_admin_link_path) return C.a.createElement(Uo, {
- path: e.forum_admin_link_path,
- selection: r.props.selection,
- linkClassName: 'button button-fill--brand button-medium button-padding-taller spacing-top'
- }, e.link_text);
- if (e.button_link) return C.a.createElement('a', {
- className: 'button button-fill--brand button-medium button-padding-taller spacing-top',
- href: e.button_link,
- target: '_blank',
- rel: 'noopener noreferrer'
- }, e.link_text)
- }
- return C.a.createElement('a', {
- href: ho.getRoot(),
- className: 'button button-outline button-medium'
- }, 'Back to Disqus')
- }),
- fP(dP(r), 'handleAnswerSelected', function (e) {
- r.setState({
- currentAnswer: e.target.value
- })
- }),
- fP(dP(r), 'handleAnswerArbitraryTextChange', function (e) {
- r.setState({
- currentAnswerArbitraryText: e.target.value
- })
- }),
- fP(dP(r), 'handleSaveAnswer', function () {
- var e = r.findOptionForAnswer(r.state.currentQuestion, r.state.currentAnswer),
- t = JSON.stringify({
- choice: r.state.currentAnswer,
- text: e.has_arbitrary_text ? r.state.currentAnswerArbitraryText : ''
- });
- r.props.updateAnswer(r.state.currentQuestion.id, t);
- t = {
- previousAnswers: [
- ].concat(sP(r.state.previousAnswers), [
- r.state.currentAnswer
- ]),
- previousQuestions: [
- ].concat(sP(r.state.previousQuestions), [
- r.state.currentQuestion
- ])
- };
- r.state.currentQuestion.id === r.props.questions[0].question.id && (t.hasCompletedFirstQuestion = !0),
- e.extra_data.follow_up_text && (t.followup = {
- text: e.extra_data.follow_up_text,
- button: r.getFollowupButton(e)
- }),
- e.extra_data.next_question_id ? rP(t, r.parseQuestionId(e.extra_data.next_question_id)) : (t.currentQuestion = null, t.currentAnswer = null, t.currentAnswerArbitraryText = null),
- r.setState(t)
- }),
- fP(dP(r), 'findOptionForAnswer', function (e, t) {
- return t ? je.a.findWhere(e.typeContext, {
- choice: t
- }) : null
- }),
- fP(dP(r), 'parseAnswer', function (e) {
- if (~(e = e || '').indexOf(': ')) {
- var t = e.split(':');
- return {
- choice: t[0],
- text: t[1].trim()
- }
- }
- return {
- choice: e,
- text: ''
- }
- }),
- fP(dP(r), 'parseQuestionId', function (t) {
- var e = je.a.find(r.props.questions, function (e) {
- return e.question.id === t
- }),
- n = r.parseAnswer(e.answer);
- return {
- currentQuestion: e.question,
- currentAnswer: n.choice,
- currentAnswerArbitraryText: n.text
- }
- }),
- fP(dP(r), 'dismissFollowup', function () {
- r.setState({
- hasDismissedFollowup: !0
- })
- }),
- r
- }
- return e = o,
- (t = [
- {
- key: 'componentDidMount',
- value: function () {
- this.props.emitTrackingEvent({
- verb: 'view',
- section: this.props.selection.type === ft.forum ? 'forum' : 'organization'
- }),
- this.props.fetchCampaignData(this.props.params.campaign),
- this.props.fetchForumDetails(),
- this.props.fetchOrgForums()
- }
- },
- {
- key: 'componentWillReceiveProps',
- value: function (e) {
- e.questions && !this.props.questions && this.setInitialQuestion(e.questions)
- }
- },
- {
- key: 'render',
- value: function () {
- if (!this.props.campaign.canParticipate) return C.a.createElement('section', {
- className: 'content__wrap'
- }, C.a.createElement('header', {
- className: 'settings__header'
- }, C.a.createElement('h2', {
- className: 'text-larger text-gray-darker'
- }, 'Uh-oh – this link is no longer valid.')), C.a.createElement('div', {
- className: 'settings__content'
- }, C.a.createElement('p', {
- className: 'spacing-top spacing-bottom'
- }, 'This link is no longer valid. If you’d like to make changes to your ad settings, visit the Revenue Settings page for your Disqus site(s).'), C.a.createElement(Uo, {
- path: '/settings/ads/',
- selection: this.props.selection,
- linkClassName: 'button button-outline button-medium button-padding-taller'
- }, 'View your Ad Settings')));
- if (!this.props.questions) return C.a.createElement(Ji, null);
- if (!this.state.hasCompletedFirstQuestion) return C.a.createElement(Xw, {
- name: 'initial',
- onAnswerSelected: this.handleAnswerSelected,
- onAnswerArbitraryTextChange: this.handleAnswerArbitraryTextChange,
- onAnswerSubmit: this.handleSaveAnswer,
- header: 'Reveal ads may not be a good fit',
- goBackButton: C.a.createElement(Uo, {
- key: 'back',
- path: '/settings/ads/',
- selection: this.props.selection,
- linkClassName: 'button button-outline button-medium button-padding-taller'
- }, 'Go to Ad Settings'),
- submitContent: 'Continue Deactivating Ads',
- submitDisabled: !this.state.currentAnswer,
- description: C.a.createElement('div', {
- className: 'settings__description--nested align-min-tablet align--between align--row-reverse'
- }, C.a.createElement('div', {
- className: 'padding-default text-center'
- }, C.a.createElement('img', {
- src: '//c.disquscdn.com/next/current/publisher-admin/assets/img/engage-reveal-no-bg.svg',
- className: 'img-responsive',
- width: '250'
- })), C.a.createElement('div', {
- className: 'align__item--flex-1 text-gray text-medium spacing-right-large spacing-top spacing-bottom'
- }, C.a.createElement('p', null, 'The Disqus platform helps publishers grow successfully with two products that go hand in hand:'), C.a.createElement('ol', {
- className: 'spacing-left-large spacing-top-small spacing-bottom'
- }, C.a.createElement('li', null, 'Engage: the Internet’s most popular comment system.'), C.a.createElement('li', null, 'Reveal: integrated native ads that help you earn money.')), C.a.createElement('p', null, 'Engage and Reveal work together to keep Disqus free and to help you earn money from your engaged audience. Smaller, non-commercial sites can turn off Reveal.'))),
- formHeader: this.state.currentQuestion.text,
- selectedAnswer: this.state.currentAnswer,
- selectedAnswerArbitraryText: this.state.currentAnswerArbitraryText,
- choices: this.state.currentQuestion.typeContext
- });
- if (this.state.followup && !this.state.hasDismissedFollowup) return C.a.createElement(eP, {
- onGoBack: this.handleGoBack,
- onContinue: this.dismissFollowup,
- answer: C.a.createElement('span', null, 'You picked: ', C.a.createElement('em', null, this.state.previousAnswers[this.state.previousAnswers.length - 1])),
- followUpText: this.state.followup.text,
- followUpButton: this.state.followup.button
- });
- if (this.state.currentQuestion) {
- var e = this.findOptionForAnswer(this.state.currentQuestion, this.state.currentAnswer),
- e = e && e.has_arbitrary_text ? !(!this.state.currentAnswer || !this.state.currentAnswerArbitraryText) : !!this.state.currentAnswer;
- return C.a.createElement(Xw, {
- name: 'secondary',
- onAnswerSelected: this.handleAnswerSelected,
- onAnswerArbitraryTextChange: this.handleAnswerArbitraryTextChange,
- onAnswerSubmit: this.handleSaveAnswer,
- header: this.state.currentQuestion.text,
- goBackButton: C.a.createElement('button', {
- key: 'back',
- onClick: this.handleGoBack,
- className: 'button button-outline text-medium button-padding-taller'
- }, C.a.createElement('span', {
- className: 'icon-right-bracket icon-flipped spacing-right-small'
- }), C.a.createElement('span', {
- className: 'spacing-right'
- }, 'Go back')),
- submitContent: 'Continue Deactivating Ads',
- submitDisabled: !e,
- description: C.a.createElement('span', null, 'You picked: ', C.a.createElement('em', null, this.state.previousAnswers[this.state.previousAnswers.length - 1])),
- formHeader: 'Select one',
- selectedAnswer: this.state.currentAnswer,
- selectedAnswerArbitraryText: this.state.currentAnswerArbitraryText,
- choices: this.state.currentQuestion.typeContext
- })
- }
- var t;
- return this.state.hasCompletedDeactivation ? C.a.createElement(nP, {
- contactUrl: Pn.revealDeactivationContact,
- selection: this.props.selection
- }) : (this.props.selection.type === ft.organization && (t = this.props.orgForumsList.filter(function (e) {
- return !e.settings.adsEnabled
- })), C.a.createElement(tP, {
- selection: this.props.selection,
- onConfirm: this.handleConfirmDeactivate,
- onGoBack: this.handleGoBack,
- hubQualifiedForums: t
- }))
- }
- }
- ]) && cP(e.prototype, t),
- n && cP(e, n),
- o
- }();
- fP(Yc, 'displayName', 'RevealSettingsDeactivate'),
- fP(Yc, 'propTypes', {
- emitTrackingEvent: b.a.func.isRequired,
- fetchCampaignData: b.a.func.isRequired,
- selection: ht.isRequired,
- updateAnswer: b.a.func.isRequired,
- deactivateOnPerformAction: b.a.func.isRequired,
- campaign: b.a.shape({
- canParticipate: b.a.bool.isRequired
- }).isRequired,
- orgForumsList: b.a.array,
- params: b.a.shape({
- campaign: b.a.string,
- hubspotCompanyId: b.a.string,
- id: b.a.string,
- name: b.a.string
- }).isRequired,
- forumDetails: $c,
- fetchForumDetails: b.a.func.isRequired,
- fetchOrgForums: b.a.func.isRequired,
- questions: b.a.arrayOf(b.a.shape({
- question: b.a.shape({
- id: b.a.number.isRequired,
- order: b.a.number.isRequired,
- text: b.a.string.isRequired,
- type: b.a.number.isRequired,
- typeContext: b.a.arrayOf(b.a.shape({
- choice: b.a.string.isRequired,
- has_arbitrary_text: b.a.bool.isRequired,
- extra_data: b.a.shape({
- follow_up_text: b.a.string,
- forum_admin_link_path: b.a.string,
- mailto_link: b.a.string,
- link_text: b.a.string
- }).isRequired
- })),
- typeName: b.a.oneOf(['MULTIPLE_CHOICE',
- 'MULTIPLE_CHOICE_WITH_ARBITRARY_TEXT'])
- }),
- answer: b.a.string
- }))
- });
- Pc = Object(u.connect) (function (e) {
- return iP(iP({
- campaign: e.campaign,
- forumDetails: e.forumDetails.forumDetails
- }, e.orgForums), {
- }, {
- defaultEventData: {
- zone: 'deactivation_hub'
- }
- })
- }, iP({
- deactivateOnPerformAction: function (r, o, i, s) {
- return function (e, t) {
- var n,
- a,
- t = t().selection;
- return t.type === ft.forum ? (a = 'forums/update', n = {
- forum: t.forum.shortname,
- adsPositionTopEnabled: 0,
- adsPositionBottomEnabled: 0,
- adsPositionInthreadEnabled: 0,
- adsPositionRecommendationsEnabled: 0
- }) : t.type === ft.organization && (a = 'organizations/campaigns/performAction', n = {
- organization: t.organization.id,
- campaign: r,
- action: o,
- hubspotCompanyId: i
- }),
- io.a.call(a, {
- data: n,
- method: 'POST'
- }).done(s)
- }
- },
- emitTrackingEvent: Xo({
- zone: 'deactivation_hub'
- }),
- fetchCampaignData: function (o) {
- return function (t, e) {
- var n,
- a,
- r = e().selection;
- return r.type === ft.forum ? (n = 'forums/update', a = {
- data: {
- forum: r.forum.shortname
- },
- method: 'POST'
- }) : r.type === ft.organization && (n = 'organizations/campaigns/details', a = {
- data: {
- campaign: o,
- organization: r.organization.id
- }
- }),
- io.a.call(n, a).done(function (e) {
- t({
- type: G.onFetch,
- response: e.response,
- selection: r
- })
- }).fail(function () {
- t({
- type: G.onError
- })
- })
- }
- },
- fetchForumDetails: ig
- }, Ru)) (Ni.a.attachDrivers(Yc, [
- sl
- ]));
- function hP(e) {
- return (hP = 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator ? function (e) {
- return typeof e
- }
- : function (e) {
- return e && 'function' == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? 'symbol' : typeof e
- }) (e)
- }
- function gP(e, t) {
- for (var n = 0; n < t.length; n++) {
- var a = t[n];
- a.enumerable = a.enumerable || !1,
- a.configurable = !0,
- 'value' in a && (a.writable = !0),
- Object.defineProperty(e, a.key, a)
- }
- }
- function yP(e, t) {
- return (yP = Object.setPrototypeOf || function (e, t) {
- return e.__proto__ = t,
- e
- }) (e, t)
- }
- function bP(n) {
- var a = function () {
- if ('undefined' == typeof Reflect || !Reflect.construct) return !1;
- if (Reflect.construct.sham) return !1;
- if ('function' == typeof Proxy) return !0;
- try {
- return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [
- ], function () {
- })),
- !0
- } catch (e) {
- return !1
- }
- }();
- return function () {
- var e,
- t = vP(n);
- return e = a ? (e = vP(this).constructor, Reflect.construct(t, arguments, e)) : t.apply(this, arguments),
- t = this,
- !(e = e) || 'object' !== hP(e) && 'function' != typeof e ? function (e) {
- if (void 0 !== e) return e;
- throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called')
- }(t) : e
- }
- }
- function vP(e) {
- return (vP = Object.setPrototypeOf ? Object.getPrototypeOf : function (e) {
- return e.__proto__ || Object.getPrototypeOf(e)
- }) (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
- }
- Ls = function () {
- !function (e, t) {
- if ('function' != typeof t && null !== t) throw new TypeError('Super expression must either be null or a function');
- e.prototype = Object.create(t && t.prototype, {
- constructor: {
- value: e,
- writable: !0,
- configurable: !0
- }
- }),
- t && yP(e, t)
- }(r, A);
- var e,
- t,
- n,
- a = bP(r);
- function r() {
- return function (e, t) {
- if (!(e instanceof t)) throw new TypeError('Cannot call a class as a function')
- }(this, r),
- a.apply(this, arguments)
- }
- return e = r,
- (t = [
- {
- key: 'render',
- value: function () {
- var e = this.props.selection.type === ft.global ? C.a.createElement('div', {
- className: 'start__icon -larger icon-group'
- }) : this.props.isLoading ? C.a.createElement('div', {
- className: 'start-stats__loading-wrapper'
- }, C.a.createElement('div', {
- className: 'spinner'
- })) : C.a.createElement('div', null, C.a.createElement('div', {
- className: 'start-stats__metric'
- }, (this.props.data || 0).toLocaleString()), C.a.createElement('div', {
- className: 'start-stats__label'
- }, 'Total Active Polls'));
- return C.a.createElement('div', {
- className: 'start-stats__block align__item--grow'
- }, C.a.createElement(Uo, {
- path: '/polls/list/',
- selection: this.props.selection,
- linkClassName: 'start-stats__content -moderate'
- }, e, C.a.createElement('button', {
- className: 'button button-large button-padding-wide button-wide--mobile button-outline'
- }, 'View Polls')))
- }
- }
- ]) && gP(e.prototype, t),
- n && gP(e, n),
- r
- }();
- _P(Ls, 'displayName', 'StartActivePollsButton'),
- _P(Ls, 'propTypes', {
- selection: ht.isRequired,
- data: b.a.number,
- isLoading: b.a.bool
- });
- function EP() {
- return ct.a.utc().startOf('day')
- }
- var OP = Ls;
- function SP(e) {
- return (SP = 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator ? function (e) {
- return typeof e
- }
- : function (e) {
- return e && 'function' == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? 'symbol' : typeof e
- }) (e)
- }
- function wP(e, t) {
- for (var n = 0; n < t.length; n++) {
- var a = t[n];
- a.enumerable = a.enumerable || !1,
- a.configurable = !0,
- 'value' in a && (a.writable = !0),
- Object.defineProperty(e, a.key, a)
- }
- }
- function PP(e, t) {
- return (PP = Object.setPrototypeOf || function (e, t) {
- return e.__proto__ = t,
- e
- }) (e, t)
- }
- function kP(n) {
- var a = function () {
- if ('undefined' == typeof Reflect || !Reflect.construct) return !1;
- if (Reflect.construct.sham) return !1;
- if ('function' == typeof Proxy) return !0;
- try {
- return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [
- ], function () {
- })),
- !0
- } catch (e) {
- return !1
- }
- }();
- return function () {
- var e,
- t = NP(n);
- return e = a ? (e = NP(this).constructor, Reflect.construct(t, arguments, e)) : t.apply(this, arguments),
- t = this,
- !(e = e) || 'object' !== SP(e) && 'function' != typeof e ? function (e) {
- if (void 0 !== e) return e;
- throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called')
- }(t) : e
- }
- }
- function NP(e) {
- return (NP = Object.setPrototypeOf ? Object.getPrototypeOf : function (e) {
- return e.__proto__ || Object.getPrototypeOf(e)
- }) (e)
- }
- function CP(e, t, n) {
- return t in e ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n,
- e
- }
- i = function () {
- !function (e, t) {
- if ('function' != typeof t && null !== t) throw new TypeError('Super expression must either be null or a function');
- e.prototype = Object.create(t && t.prototype, {
- constructor: {
- value: e,
- writable: !0,
- configurable: !0
- }
- }),
- t && PP(e, t)
- }(r, A);
- var e,
- t,
- n,
- a = kP(r);
- function r() {
- return function (e, t) {
- if (!(e instanceof t)) throw new TypeError('Cannot call a class as a function')
- }(this, r),
- a.apply(this, arguments)
- }
- return e = r,
- (t = [
- {
- key: 'componentDidMount',
- value: function () {
- this.props.selection.type !== ft.global && this.props.fetchCommentCounts()
- }
- },
- {
- key: 'render',
- value: function () {
- var e;
- return e = this.props.selection.type === ft.global ? C.a.createElement('div', {
- className: 'start__icon -larger icon-graph'
- }) : this.props.commentCounts ? (e = je.a.reduce(this.props.commentCounts, function (e, t) {
- return e + t[1]
- }, 0), C.a.createElement('div', null, C.a.createElement('div', {
- className: 'start-stats__metric'
- }, e.toLocaleString()), C.a.createElement('div', {
- className: 'start-stats__label'
- }, 'Comments This Week'))) : C.a.createElement('div', {
- className: 'start-stats__loading-wrapper'
- }, C.a.createElement('div', {
- className: 'spinner'
- })),
- C.a.createElement('div', {
- className: 'start-stats__block align__item--grow'
- }, C.a.createElement(ri, {
- path: '/analytics/comments/',
- selection: this.props.selection,
- linkClassName: 'start-stats__content -moderate'
- }, e, C.a.createElement('button', {
- className: 'button button-large button-padding-wide button-wide--mobile button-outline'
- }, 'Analyze Engagement')))
- }
- }
- ]) && wP(e.prototype, t),
- n && wP(e, n),
- r
- }();
- CP(i, 'displayName', 'StartEngagementButton'),
- CP(i, 'propTypes', {
- selection: ht.isRequired,
- commentCounts: b.a.array
- });
- function RP(e) {
- return 1 === e ? 'One comment' : ''.concat(e, ' comments')
- }
- var xP = Object(u.connect) (function (e) {
- return {
- commentCounts: e.commentCounts.commentCounts,
- selection: e.selection
- }
- }, {
- fetchCommentCounts: function () {
- return function (t, e) {
- var n,
- a = e().selection,
- r = ct() (EP()).subtract(1, 'week'),
- e = EP(),
- e = {
- start: r.toISOString(),
- end: e.toISOString()
- };
- return a.type === ft.organization ? (e.organization = a.organization.id, n = 'organizations/admin/reports/interactionReport') : a.type === ft.forum && (e.forum = a.forum.shortname, n = 'forums/admin/reports/interactionReport'),
- io.a.call(n, {
- data: e
- }).done(function (e) {
- t({
- type: V.onFetch,
- response: e.response
- })
- })
- }
- }
- }) (i),
- AP = 'default_moderation_time',
- DP = [
- {
- key: 'day',
- label: 'Past Day'
- },
- {
- key: 'week',
- label: 'Past Week'
- },
- {
- key: 'month',
- label: 'Past Month'
- },
- {
- key: 'year',
- label: 'Past Year'
- },
- {
- key: 'all',
- label: 'All Time'
- },
- {
- key: 'custom',
- label: 'Custom'
- }
- ],
- jP = {
- maxDate: ct() ().endOf('day'),
- minDate: ct() ('01 01 2007', 'MM DD YYYY').startOf('day')
- },
- TP = 2000,
- IP = {
- all: [
- 'approved',
- 'unapproved',
- 'spam',
- 'deleted'
- ],
- approved: 'approved',
- pending: [
- 'unapproved',
- 'flagged'
- ],
- spam: 'spam',
- deleted: 'deleted'
- },
- qP = 'default_moderation_order',
- FP = [
- {
- key: 'desc',
- label: 'Newest'
- },
- {
- key: 'asc',
- label: 'Oldest'
- },
- {
- key: 'worst',
- label: 'Priority'
- }
- ],
- LP = Is.a.get(AP);
- 'custom' !== LP && je.a.find(DP, function (e) {
- return e.key === LP
- }) || (LP = 'year');
- var UP = Is.a.get(qP),
- MP = {
- page: 'pending',
- perPage: 25,
- expandComments: !1,
- fetchSize: 25,
- lang: 'en',
- sortOrder: UP = !je.a.find(FP, function (e) {
- return e.key === UP
- }) ? 'desc' : UP,
- startDate: 'all' === LP ? jP.minDate : ct() ().startOf('day').subtract(1, LP),
- endDate: ct() ().endOf('day')
- },
- BP = {
- approve: {
- apiPath: 'posts/approve',
- status: 'approved',
- successMessage: function (e) {
- return ''.concat(RP(e), ' approved')
- }
- },
- unapprove: {
- apiPath: 'posts/unapprove',
- status: 'unapproved',
- successMessage: function (e) {
- return ''.concat(RP(e), ' unapproved')
- }
- },
- spam: {
- apiPath: 'posts/spam',
- status: 'spam',
- successMessage: function (e) {
- return ''.concat(RP(e), ' marked as spam')
- }
- },
- delete : {
- apiPath: 'posts/remove',
- status: 'deleted',
- successMessage: function (e) {
- return ''.concat(RP(e), ' deleted')
- }
- }
- },
- zP = je.a.chain(BP).map(function (e, t) {
- return [e.status,
- t]
- }).object().value(),
- HP = {
- ']': {
- callbackName: 'tabOver',
- callbackArgs: [
- 1
- ]
- },
- '[': {
- callbackName: 'tabOver',
- callbackArgs: [
- - 1
- ]
- },
- 1: {
- callbackName: 'tab',
- callbackArgs: [
- 0
- ]
- },
- 2: {
- callbackName: 'tab',
- callbackArgs: [
- 1
- ]
- },
- 3: {
- callbackName: 'tab',
- callbackArgs: [
- 2
- ]
- },
- 4: {
- callbackName: 'tab',
- callbackArgs: [
- 3
- ]
- },
- 5: {
- callbackName: 'tab',
- callbackArgs: [
- 4
- ]
- },
- j: 'activateNextPost',
- k: 'activatePreviousPost',
- n: 'fetchMorePosts',
- p: 'prevPage',
- '/': 'focusSearch',
- x: 'toggleActivePostChecked',
- a: 'markCheckedPostsApproved',
- s: 'markCheckedPostsSpam',
- d: 'markCheckedPostsTrash',
- z: 'undoAction',
- o: 'toggleActivePostPanelVisible',
- '?': 'toggleHelpVisible',
- R: 'refreshCurrentPage',
- Esc: {
- callbackName: 'removeFocus',
- options: {
- exclude: [
- ]
- }
- }
- };
- je.a.extend(HP, {
- '{': HP['['],
- '}': HP[']'],
- '>': HP.n,
- '<': HP.p,
- b: HP.p,
- '!': HP.s,
- '#': HP.d,
- '.': HP.o,
- Enter: HP.o
- });
- var GP = {
- r: 'startReplyHotkey',
- e: 'startEditHotkey',
- Esc: 'removeFocus'
- },
- VP = {
- posts: {
- approve: {
- text: 'Approve',
- icon: 'checkmark'
- },
- unapprove: {
- text: 'Mark Post as Pending',
- icon: 'spam'
- },
- delete : {
- text: 'Delete',
- icon: 'delete'
- },
- spam: {
- text: 'Mark as Spam',
- icon: 'spam'
- }
- },
- users: {
- permaban: {
- text: 'Ban Author',
- banType: Wn.BAN_TYPES.PERMANENT
- },
- tempban: {
- text: 'Timeout Author',
- banType: Wn.BAN_TYPES.TEMP
- },
- shadowban: {
- text: 'Shadowban Author',
- banType: Wn.BAN_TYPES.SHADOW
- }
- }
- },
- WP = {
- approve: 'icon-checkmark',
- approved: 'icon-checkmark',
- spam: 'icon-spam',
- delete : 'icon-delete',
- deleted: 'icon-delete',
- pending: 'icon-pending'
- },
- Qs = {
- forum: b.a.object.isRequired,
- thread: b.a.object.isRequired,
- id: b.a.string.isRequired,
- url: b.a.string.isRequired,
- author: b.a.object.isRequired,
- ipAddress: b.a.string,
- isDeletedByAuthor: b.a.bool.isRequired,
- message: b.a.string.isRequired,
- modMessage: b.a.string.isRequired,
- media: b.a.array.isRequired,
- createdAt: b.a.string.isRequired,
- editableUntil: b.a.string.isRequired,
- likes: b.a.number.isRequired,
- dislikes: b.a.number.isRequired,
- userScore: b.a.number.isRequired,
- raw_message: b.a.string.isRequired,
- moderationLabels: b.a.arrayOf(b.a.string).isRequired,
- numReports: b.a.number.isRequired,
- shadowBanned: b.a.bool,
- child: b.a.object,
- isFlagged: b.a.bool,
- isApproved: b.a.bool,
- isHighlighted: b.a.bool,
- flaggers: b.a.arrayOf(b.a.shape({
- name: b.a.string.isRequired,
- username: b.a.string.isRequired,
- profileUrl: b.a.string.isRequired
- })),
- rule: b.a.object,
- isNewUserNeedsApproval: b.a.bool
- },
- YP = Object.keys(window._v5Config.moderated_forums.reduce(function (e, t) {
- return e[window._v5Config.forums[t].organization] = !0,
- e
- }, {
- })).some(function (e) {
- return yo.a.isFeatureActive('suggested_actions', {
- organization: e
- })
- }),
- QP = {
- approveModalIsOpen: !1,
- approveModalPostId: null,
- approveModalAuthor: null
- };
- function KP(e) {
- return (KP = 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator ? function (e) {
- return typeof e
- }
- : function (e) {
- return e && 'function' == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? 'symbol' : typeof e
- }) (e)
- }
- function JP(e, t) {
- for (var n = 0; n < t.length; n++) {
- var a = t[n];
- a.enumerable = a.enumerable || !1,
- a.configurable = !0,
- 'value' in a && (a.writable = !0),
- Object.defineProperty(e, a.key, a)
- }
- }
- function $P(e, t) {
- return ($P = Object.setPrototypeOf || function (e, t) {
- return e.__proto__ = t,
- e
- }) (e, t)
- }
- function ZP(n) {
- var a = function () {
- if ('undefined' == typeof Reflect || !Reflect.construct) return !1;
- if (Reflect.construct.sham) return !1;
- if ('function' == typeof Proxy) return !0;
- try {
- return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [
- ], function () {
- })),
- !0
- } catch (e) {
- return !1
- }
- }();
- return function () {
- var e,
- t = ek(n);
- return e = a ? (e = ek(this).constructor, Reflect.construct(t, arguments, e)) : t.apply(this, arguments),
- t = this,
- !(e = e) || 'object' !== KP(e) && 'function' != typeof e ? XP(t) : e
- }
- }
- function XP(e) {
- if (void 0 === e) throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called');
- return e
- }
- function ek(e) {
- return (ek = Object.setPrototypeOf ? Object.getPrototypeOf : function (e) {
- return e.__proto__ || Object.getPrototypeOf(e)
- }) (e)
- }
- function tk(e, t, n) {
- return t in e ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n,
- e
- }
- Mo = function () {
- !function (e, t) {
- if ('function' != typeof t && null !== t) throw new TypeError('Super expression must either be null or a function');
- e.prototype = Object.create(t && t.prototype, {
- constructor: {
- value: e,
- writable: !0,
- configurable: !0
- }
- }),
- t && $P(e, t)
- }(o, A);
- var e,
- t,
- n,
- r = ZP(o);
- function o() {
- var t;
- !function (e, t) {
- if (!(e instanceof t)) throw new TypeError('Cannot call a class as a function')
- }(this, o);
- for (var e = arguments.length, n = Array(e), a = 0; a < e; a++) n[a] = arguments[a];
- return tk(XP(t = r.call.apply(r, [
- this
- ].concat(n))), 'state', {
- pendingCounts: {
- total: 0,
- hasBadWords: 0,
- hasLinks: 0,
- hasLowRep: 0,
- isFlagged: 0,
- isAtFlagLimit: 0,
- isAnonymous: 0,
- isToxic: 0,
- hasMedia: 0
- },
- isFetching: !1
- }),
- tk(XP(t), 'fetchData', function (e) {
- e = e || {
- },
- t.setState({
- isFetching: !0
- }),
- t.props.selection.type === ft.forum && (e.forum = t.props.selection.forum.shortname),
- t.apiCall = io.a.call('posts/countPending', {
- data: e
- }).done(t.onFetch)
- }),
- tk(XP(t), 'onFetch', function (e) {
- e = e.response;
- e && t.setState({
- pendingCounts: e,
- isFetching: !1
- })
- }),
- tk(XP(t), 'getComponentProps', function () {
- return {
- pendingCounts: t.state.pendingCounts,
- refreshPendingCommentsCount: t.fetchData,
- pendingCountsIsFetching: t.state.isFetching
- }
- }),
- t
- }
- return e = o,
- (t = [
- {
- key: 'componentWillUnmount',
- value: function () {
- this.apiCall && 'pending' === this.apiCall.state() && this.apiCall.abort()
- }
- }
- ]) && JP(e.prototype, t),
- n && JP(e, n),
- o
- }();
- tk(Mo, 'displayName', 'PendingCommentsCountDriver'),
- tk(Mo, 'propTypes', {
- selection: ht.isRequired
- });
- go = Object(ki.createDriver) (Mo);
- function nk(e) {
- return (nk = 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator ? function (e) {
- return typeof e
- }
- : function (e) {
- return e && 'function' == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? 'symbol' : typeof e
- }) (e)
- }
- function ak(e, t) {
- for (var n = 0; n < t.length; n++) {
- var a = t[n];
- a.enumerable = a.enumerable || !1,
- a.configurable = !0,
- 'value' in a && (a.writable = !0),
- Object.defineProperty(e, a.key, a)
- }
- }
- function rk(e, t) {
- return (rk = Object.setPrototypeOf || function (e, t) {
- return e.__proto__ = t,
- e
- }) (e, t)
- }
- function ok(n) {
- var a = function () {
- if ('undefined' == typeof Reflect || !Reflect.construct) return !1;
- if (Reflect.construct.sham) return !1;
- if ('function' == typeof Proxy) return !0;
- try {
- return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [
- ], function () {
- })),
- !0
- } catch (e) {
- return !1
- }
- }();
- return function () {
- var e,
- t = ik(n);
- return e = a ? (e = ik(this).constructor, Reflect.construct(t, arguments, e)) : t.apply(this, arguments),
- t = this,
- !(e = e) || 'object' !== nk(e) && 'function' != typeof e ? function (e) {
- if (void 0 !== e) return e;
- throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called')
- }(t) : e
- }
- }
- function ik(e) {
- return (ik = Object.setPrototypeOf ? Object.getPrototypeOf : function (e) {
- return e.__proto__ || Object.getPrototypeOf(e)
- }) (e)
- }
- function sk(e, t, n) {
- return t in e ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n,
- e
- }
- yl = function () {
- !function (e, t) {
- if ('function' != typeof t && null !== t) throw new TypeError('Super expression must either be null or a function');
- e.prototype = Object.create(t && t.prototype, {
- constructor: {
- value: e,
- writable: !0,
- configurable: !0
- }
- }),
- t && rk(e, t)
- }(r, A);
- var e,
- t,
- n,
- a = ok(r);
- function r() {
- return function (e, t) {
- if (!(e instanceof t)) throw new TypeError('Cannot call a class as a function')
- }(this, r),
- a.apply(this, arguments)
- }
- return e = r,
- (t = [
- {
- key: 'componentDidMount',
- value: function () {
- this.props.refreshPendingCommentsCount({
- start: MP.startDate.toISOString(),
- end: MP.endDate.toISOString()
- })
- }
- },
- {
- key: 'render',
- value: function () {
- var e = this.props.selection.type === ft.global ? C.a.createElement('div', {
- className: 'start__icon -larger icon-moderate'
- }) : this.props.pendingCountsIsFetching ? C.a.createElement('div', {
- className: 'start-stats__loading-wrapper'
- }, C.a.createElement('div', {
- className: 'spinner'
- })) : C.a.createElement('div', null, C.a.createElement('div', {
- className: 'start-stats__metric'
- }, TP <= this.props.pendingCounts.total ? ''.concat(TP.toLocaleString(), '+') : this.props.pendingCounts.total.toLocaleString()), C.a.createElement('div', {
- className: 'start-stats__label'
- }, 'Pending Comments For All Sites'));
- return C.a.createElement('div', {
- className: 'start-stats__block align__item--grow'
- }, C.a.createElement(v.Link, {
- to: ho.getRoute('/moderate/'),
- className: 'start-stats__content -moderate'
- }, e, C.a.createElement('button', {
- className: 'button button-large button-padding-wide button-wide--mobile button-outline'
- }, 'Moderate Comments')))
- }
- }
- ]) && ak(e.prototype, t),
- n && ak(e, n),
- r
- }();
- sk(yl, 'displayName', 'StartModerateButton'),
- sk(yl, 'propTypes', {
- pendingCountsIsFetching: b.a.bool.isRequired,
- pendingCounts: b.a.shape({
- total: b.a.number
- }),
- refreshPendingCommentsCount: b.a.func.isRequired,
- selection: ht.isRequired
- });
- var lk = Ni.a.attachDrivers(yl, [
- go
- ]);
- function ck(e) {
- return (ck = 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator ? function (e) {
- return typeof e
- }
- : function (e) {
- return e && 'function' == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? 'symbol' : typeof e
- }) (e)
- }
- function uk(e, t) {
- for (var n = 0; n < t.length; n++) {
- var a = t[n];
- a.enumerable = a.enumerable || !1,
- a.configurable = !0,
- 'value' in a && (a.writable = !0),
- Object.defineProperty(e, a.key, a)
- }
- }
- function pk(e, t) {
- return (pk = Object.setPrototypeOf || function (e, t) {
- return e.__proto__ = t,
- e
- }) (e, t)
- }
- function dk(n) {
- var a = function () {
- if ('undefined' == typeof Reflect || !Reflect.construct) return !1;
- if (Reflect.construct.sham) return !1;
- if ('function' == typeof Proxy) return !0;
- try {
- return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [
- ], function () {
- })),
- !0
- } catch (e) {
- return !1
- }
- }();
- return function () {
- var e,
- t = mk(n);
- return e = a ? (e = mk(this).constructor, Reflect.construct(t, arguments, e)) : t.apply(this, arguments),
- t = this,
- !(e = e) || 'object' !== ck(e) && 'function' != typeof e ? function (e) {
- if (void 0 !== e) return e;
- throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called')
- }(t) : e
- }
- }
- function mk(e) {
- return (mk = Object.setPrototypeOf ? Object.getPrototypeOf : function (e) {
- return e.__proto__ || Object.getPrototypeOf(e)
- }) (e)
- }
- function fk(e, t, n) {
- return t in e ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n,
- e
- }
- h = function () {
- !function (e, t) {
- if ('function' != typeof t && null !== t) throw new TypeError('Super expression must either be null or a function');
- e.prototype = Object.create(t && t.prototype, {
- constructor: {
- value: e,
- writable: !0,
- configurable: !0
- }
- }),
- t && pk(e, t)
- }(r, A);
- var e,
- t,
- n,
- a = dk(r);
- function r() {
- return function (e, t) {
- if (!(e instanceof t)) throw new TypeError('Cannot call a class as a function')
- }(this, r),
- a.apply(this, arguments)
- }
- return e = r,
- (t = [
- {
- key: 'render',
- value: function () {
- var e = this.props.selection.type === ft.global ? C.a.createElement('div', {
- className: 'start__icon -larger icon-graph'
- }) : this.props.isLoading ? C.a.createElement('div', {
- className: 'start-stats__loading-wrapper'
- }, C.a.createElement('div', {
- className: 'spinner'
- })) : C.a.createElement('div', null, C.a.createElement('div', {
- className: 'start-stats__metric'
- }, (this.props.data || 0).toLocaleString()), C.a.createElement('div', {
- className: 'start-stats__label'
- }, 'Total Respondents'));
- return C.a.createElement('div', {
- className: 'start-stats__block align__item--grow'
- }, C.a.createElement(Uo, {
- path: '/polls/insights/',
- selection: this.props.selection,
- linkClassName: 'start-stats__content -moderate'
- }, e, C.a.createElement('button', {
- className: 'button button-large button-padding-wide button-wide--mobile button-outline'
- }, 'View ', this.props.selection.type === ft.global || this.props.selection.type === ft.organization ? 'Poll' : '', ' Insights')))
- }
- }
- ]) && uk(e.prototype, t),
- n && uk(e, n),
- r
- }();
- fk(h, 'displayName', 'StartPollsRespondentsButton'),
- fk(h, 'propTypes', {
- selection: ht.isRequired,
- data: b.a.number,
- isLoading: b.a.bool
- });
- var hk = h;
- function gk(e) {
- return (gk = 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator ? function (e) {
- return typeof e
- }
- : function (e) {
- return e && 'function' == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? 'symbol' : typeof e
- }) (e)
- }
- function yk(e, t) {
- for (var n = 0; n < t.length; n++) {
- var a = t[n];
- a.enumerable = a.enumerable || !1,
- a.configurable = !0,
- 'value' in a && (a.writable = !0),
- Object.defineProperty(e, a.key, a)
- }
- }
- function bk(e, t) {
- return (bk = Object.setPrototypeOf || function (e, t) {
- return e.__proto__ = t,
- e
- }) (e, t)
- }
- function vk(n) {
- var a = function () {
- if ('undefined' == typeof Reflect || !Reflect.construct) return !1;
- if (Reflect.construct.sham) return !1;
- if ('function' == typeof Proxy) return !0;
- try {
- return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [
- ], function () {
- })),
- !0
- } catch (e) {
- return !1
- }
- }();
- return function () {
- var e,
- t = _k(n);
- return e = a ? (e = _k(this).constructor, Reflect.construct(t, arguments, e)) : t.apply(this, arguments),
- t = this,
- !(e = e) || 'object' !== gk(e) && 'function' != typeof e ? function (e) {
- if (void 0 !== e) return e;
- throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called')
- }(t) : e
- }
- }
- function _k(e) {
- return (_k = Object.setPrototypeOf ? Object.getPrototypeOf : function (e) {
- return e.__proto__ || Object.getPrototypeOf(e)
- }) (e)
- }
- function Ek(e, t, n) {
- return t in e ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n,
- e
- }
- Ru = function () {
- !function (e, t) {
- if ('function' != typeof t && null !== t) throw new TypeError('Super expression must either be null or a function');
- e.prototype = Object.create(t && t.prototype, {
- constructor: {
- value: e,
- writable: !0,
- configurable: !0
- }
- }),
- t && bk(e, t)
- }(r, A);
- var e,
- t,
- n,
- a = vk(r);
- function r() {
- return function (e, t) {
- if (!(e instanceof t)) throw new TypeError('Cannot call a class as a function')
- }(this, r),
- a.apply(this, arguments)
- }
- return e = r,
- (t = [
- {
- key: 'render',
- value: function () {
- var e = this.props.selection.type === ft.global ? C.a.createElement('div', {
- className: 'start__icon -larger icon-graph'
- }) : this.props.isLoading ? C.a.createElement('div', {
- className: 'start-stats__loading-wrapper'
- }, C.a.createElement('div', {
- className: 'spinner'
- })) : C.a.createElement('div', null, C.a.createElement('div', {
- className: 'start-stats__metric'
- }, (this.props.data || 0).toLocaleString(void 0, {
- style: 'percent',
- minimumFractionDigits: 2
- })), C.a.createElement('div', {
- className: 'start-stats__label'
- }, 'Avg. Overall Response Rate'));
- return C.a.createElement('div', {
- className: 'start-stats__block align__item--grow'
- }, C.a.createElement(Uo, {
- path: '/polls/insights/',
- selection: this.props.selection,
- linkClassName: 'start-stats__content -moderate'
- }, e, C.a.createElement('button', {
- className: 'button button-large button-padding-wide button-wide--mobile button-outline'
- }, 'View ', this.props.selection.type === ft.global || this.props.selection.type === ft.organization ? 'Poll' : '', ' Insights')))
- }
- }
- ]) && yk(e.prototype, t),
- n && yk(e, n),
- r
- }();
- Ek(Ru, 'displayName', 'StartPollsResponseRateButton'),
- Ek(Ru, 'propTypes', {
- selection: ht.isRequired,
- data: b.a.number,
- isLoading: b.a.bool
- });
- var Ok = Ru;
- function Sk(t, e) {
- var n,
- a = Object.keys(t);
- return Object.getOwnPropertySymbols && (n = Object.getOwnPropertySymbols(t), e && (n = n.filter(function (e) {
- return Object.getOwnPropertyDescriptor(t, e).enumerable
- })), a.push.apply(a, n)),
- a
- }
- function wk(a) {
- for (var e = 1; e < arguments.length; e++) {
- var r = null != arguments[e] ? arguments[e] : {
- };
- e % 2 ? Sk(Object(r), !0).forEach(function (e) {
- var t,
- n;
- n = r[t = e],
- t in (e = a) ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(a, Object.getOwnPropertyDescriptors(r)) : Sk(Object(r)).forEach(function (e) {
- Object.defineProperty(a, e, Object.getOwnPropertyDescriptor(r, e))
- })
- }
- return a
- }
- function Pk() {
- return ct.a.utc().startOf('day')
- }
- function kk(e) {
- return (kk = 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator ? function (e) {
- return typeof e
- }
- : function (e) {
- return e && 'function' == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? 'symbol' : typeof e
- }) (e)
- }
- function Nk(e, t) {
- for (var n = 0; n < t.length; n++) {
- var a = t[n];
- a.enumerable = a.enumerable || !1,
- a.configurable = !0,
- 'value' in a && (a.writable = !0),
- Object.defineProperty(e, a.key, a)
- }
- }
- function Ck(e, t) {
- return (Ck = Object.setPrototypeOf || function (e, t) {
- return e.__proto__ = t,
- e
- }) (e, t)
- }
- function Rk(n) {
- var a = function () {
- if ('undefined' == typeof Reflect || !Reflect.construct) return !1;
- if (Reflect.construct.sham) return !1;
- if ('function' == typeof Proxy) return !0;
- try {
- return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [
- ], function () {
- })),
- !0
- } catch (e) {
- return !1
- }
- }();
- return function () {
- var e,
- t = Ak(n);
- return e = a ? (e = Ak(this).constructor, Reflect.construct(t, arguments, e)) : t.apply(this, arguments),
- t = this,
- !(e = e) || 'object' !== kk(e) && 'function' != typeof e ? xk(t) : e
- }
- }
- function xk(e) {
- if (void 0 === e) throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called');
- return e
- }
- function Ak(e) {
- return (Ak = Object.setPrototypeOf ? Object.getPrototypeOf : function (e) {
- return e.__proto__ || Object.getPrototypeOf(e)
- }) (e)
- }
- function Dk(e, t, n) {
- return t in e ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n,
- e
- }
- Yc = function () {
- !function (e, t) {
- if ('function' != typeof t && null !== t) throw new TypeError('Super expression must either be null or a function');
- e.prototype = Object.create(t && t.prototype, {
- constructor: {
- value: e,
- writable: !0,
- configurable: !0
- }
- }),
- t && Ck(e, t)
- }(o, A);
- var e,
- t,
- n,
- r = Rk(o);
- function o() {
- var t;
- !function (e, t) {
- if (!(e instanceof t)) throw new TypeError('Cannot call a class as a function')
- }(this, o);
- for (var e = arguments.length, n = Array(e), a = 0; a < e; a++) n[a] = arguments[a];
- return Dk(xk(t = r.call.apply(r, [
- this
- ].concat(n))), 'orgHasActiveGuarantee', function () {
- return t.props.selection.organization && t.props.selection.organization.activeGuarantee
- }),
- Dk(xk(t), 'getMetric', function () {
- if (t.orgHasActiveGuarantee()) return ct() (t.props.selection.organization.activeGuarantee.end).utc().diff(ct.a.utc(), 'days');
- var e = t.props.earnings ? t.props.earnings.reduce(function (e, t) {
- return e + t.earnings
- }, 0) : 0;
- return '$'.concat(e.toFixed(2).replace(/(\d)(?=(\d{3})+\.)/g, '$1,'))
- }),
- Dk(xk(t), 'getLabel', function () {
- return t.orgHasActiveGuarantee() ? 'Days Left of Reveal Promotional Period' : 'Revenue this week'
- }),
- t
- }
- return e = o,
- (t = [
- {
- key: 'componentDidMount',
- value: function () {
- this.props.fetchEarningsData()
- }
- },
- {
- key: 'render',
- value: function () {
- var e = '/analytics/revenue/',
- t = 'start-stats__content -revenue',
- n = this.props.selection.isRevealVisible ? this.props.selection.type === ft.global ? C.a.createElement('div', {
- className: 'start__icon -larger icon-revenue'
- }) : this.props.earnings || this.orgHasActiveGuarantee() ? C.a.createElement('div', null, C.a.createElement('div', {
- className: 'start-stats__metric'
- }, this.getMetric()), C.a.createElement('div', {
- className: 'start-stats__label'
- }, this.getLabel())) : C.a.createElement('div', {
- className: 'start-stats__loading-wrapper'
- }, C.a.createElement('div', {
- className: 'spinner'
- })) : (e = 'https://publishers.disqus.com/reveal/', t += ' inactive', C.a.createElement('div', null, C.a.createElement('div', {
- className: 'start-stats__metric'
- }, '$0.00'), C.a.createElement('div', {
- className: 'start-stats__label'
- }, 'Reveal is not enabled. Monetize your content with Reveal.')));
- return C.a.createElement('div', {
- className: 'start-stats__block align__item--grow'
- }, this.props.selection.isRevealVisible ? C.a.createElement(ri, {
- path: e,
- linkClassName: t,
- selection: this.props.selection
- }, n, C.a.createElement('button', {
- className: 'button button-large button-padding-wide button-wide--mobile button-outline'
- }, 'Analyze Revenue')) : C.a.createElement('a', {
- href: e,
- className: t
- }, n, C.a.createElement('button', {
- className: 'button button-large button-padding-wide button-wide--mobile button-outline text-gray -border-muted'
- }, 'Learn More')))
- }
- }
- ]) && Nk(e.prototype, t),
- n && Nk(e, n),
- o
- }();
- Dk(Yc, 'propTypes', {
- earnings: b.a.array,
- selection: ht.isRequired
- });
- var jk = Object(u.connect) (function (e) {
- return {
- earnings: e.earnings.earnings,
- selection: e.selection
- }
- }, {
- fetchEarningsData: function () {
- return function (t, e) {
- var n = e().selection;
- if (n && n.isRevealVisible && n.type !== ft.global && (n.type !== ft.organization || !n.organization.activeGuarantee)) {
- var a,
- e = {
- start: ct() (Pk()).subtract(1, 'week'),
- end: Pk()
- };
- return n.type === ft.organization ? (e.organization = n.organization.id, a = 'organizationRevealStats') : n.type === ft.forum && (e.forum = n.forum.shortname, a = 'revealStats'),
- io.a.call('discovery/reports/'.concat(a), {
- data: e
- }).done(function (e) {
- return t(wk({
- type: Y.onFetch
- }, e.response))
- })
- }
- }
- }
- }) (Yc);
- function Tk(e) {
- return (Tk = 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator ? function (e) {
- return typeof e
- }
- : function (e) {
- return e && 'function' == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? 'symbol' : typeof e
- }) (e)
- }
- function Ik(e, t) {
- for (var n = 0; n < t.length; n++) {
- var a = t[n];
- a.enumerable = a.enumerable || !1,
- a.configurable = !0,
- 'value' in a && (a.writable = !0),
- Object.defineProperty(e, a.key, a)
- }
- }
- function qk(e, t) {
- return (qk = Object.setPrototypeOf || function (e, t) {
- return e.__proto__ = t,
- e
- }) (e, t)
- }
- function Fk(n) {
- var a = function () {
- if ('undefined' == typeof Reflect || !Reflect.construct) return !1;
- if (Reflect.construct.sham) return !1;
- if ('function' == typeof Proxy) return !0;
- try {
- return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [
- ], function () {
- })),
- !0
- } catch (e) {
- return !1
- }
- }();
- return function () {
- var e,
- t = Lk(n);
- return e = a ? (e = Lk(this).constructor, Reflect.construct(t, arguments, e)) : t.apply(this, arguments),
- t = this,
- !(e = e) || 'object' !== Tk(e) && 'function' != typeof e ? function (e) {
- if (void 0 !== e) return e;
- throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called')
- }(t) : e
- }
- }
- function Lk(e) {
- return (Lk = Object.setPrototypeOf ? Object.getPrototypeOf : function (e) {
- return e.__proto__ || Object.getPrototypeOf(e)
- }) (e)
- }
- function Uk(e, t, n) {
- return t in e ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n,
- e
- }
- sl = function () {
- !function (e, t) {
- if ('function' != typeof t && null !== t) throw new TypeError('Super expression must either be null or a function');
- e.prototype = Object.create(t && t.prototype, {
- constructor: {
- value: e,
- writable: !0,
- configurable: !0
- }
- }),
- t && qk(e, t)
- }(r, A);
- var e,
- t,
- n,
- a = Fk(r);
- function r() {
- return function (e, t) {
- if (!(e instanceof t)) throw new TypeError('Cannot call a class as a function')
- }(this, r),
- a.apply(this, arguments)
- }
- return e = r,
- (t = [
- {
- key: 'render',
- value: function () {
- return C.a.createElement('div', {
- className: 'resubscribe content__wrap align align--column align--middle align--center'
- }, C.a.createElement('img', {
- src: '//c.disquscdn.com/next/current/publisher-admin/assets/img/astronauts.svg',
- className: 'astronauts'
- }), C.a.createElement('div', {
- className: 'resubscribe'
- }, 'Don\'t miss out — re-subscribe now to regain full access to Polls and continue engaging your audiences.'), this.props.organization ? C.a.createElement(Us, {
- path: '/settings/subscription/',
- orgId: this.props.organization.id,
- orgSlug: this.props.organization.slug,
- linkClassName: 'button button-fill--brand button-padding-wider text-medium'
- }, 'Re-Subscribe') : C.a.createElement(v.Link, {
- to: '/settings/subscription',
- className: 'button button-fill--brand button-padding-wider text-medium'
- }, 'Re-Subscribe'))
- }
- }
- ]) && Ik(e.prototype, t),
- n && Ik(e, n),
- r
- }();
- Uk(sl, 'displayName', 'Resubscribe'),
- Uk(sl, 'propTypes', {
- organization: b.a.shape({
- id: b.a.number.isRequired,
- slug: b.a.string.isRequired
- })
- });
- var Mk = sl;
- function Bk(e) {
- return (Bk = 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator ? function (e) {
- return typeof e
- }
- : function (e) {
- return e && 'function' == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? 'symbol' : typeof e
- }) (e)
- }
- function zk(e, t) {
- for (var n = 0; n < t.length; n++) {
- var a = t[n];
- a.enumerable = a.enumerable || !1,
- a.configurable = !0,
- 'value' in a && (a.writable = !0),
- Object.defineProperty(e, a.key, a)
- }
- }
- function Hk(e, t) {
- return (Hk = Object.setPrototypeOf || function (e, t) {
- return e.__proto__ = t,
- e
- }) (e, t)
- }
- function Gk(n) {
- var a = function () {
- if ('undefined' == typeof Reflect || !Reflect.construct) return !1;
- if (Reflect.construct.sham) return !1;
- if ('function' == typeof Proxy) return !0;
- try {
- return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [
- ], function () {
- })),
- !0
- } catch (e) {
- return !1
- }
- }();
- return function () {
- var e,
- t = Wk(n);
- return e = a ? (e = Wk(this).constructor, Reflect.construct(t, arguments, e)) : t.apply(this, arguments),
- t = this,
- !(e = e) || 'object' !== Bk(e) && 'function' != typeof e ? Vk(t) : e
- }
- }
- function Vk(e) {
- if (void 0 === e) throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called');
- return e
- }
- function Wk(e) {
- return (Wk = Object.setPrototypeOf ? Object.getPrototypeOf : function (e) {
- return e.__proto__ || Object.getPrototypeOf(e)
- }) (e)
- }
- function Yk(e, t, n) {
- return t in e ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n,
- e
- }
- Ls = {
- zone: 'welcome'
- },
- i = function () {
- !function (e, t) {
- if ('function' != typeof t && null !== t) throw new TypeError('Super expression must either be null or a function');
- e.prototype = Object.create(t && t.prototype, {
- constructor: {
- value: e,
- writable: !0,
- configurable: !0
- }
- }),
- t && Hk(e, t)
- }(o, A);
- var e,
- t,
- n,
- r = Gk(o);
- function o() {
- var t;
- !function (e, t) {
- if (!(e instanceof t)) throw new TypeError('Cannot call a class as a function')
- }(this, o);
- for (var e = arguments.length, n = Array(e), a = 0; a < e; a++) n[a] = arguments[a];
- return Yk(Vk(t = r.call.apply(r, [
- this
- ].concat(n))), 'state', {
- showVerifiedAlert: !!fE() ().email_verified
- }),
- Yk(Vk(t), 'handleDismissVerification', function () {
- t.setState({
- showVerifiedAlert: !1
- })
- }),
- Yk(Vk(t), 'handleClickEvent', function (e) {
- t.props.emitTrackingEvent({
- verb: 'click',
- object_type: 'section',
- object_id: e
- })
- }),
- t
- }
- return e = o,
- (t = [
- {
- key: 'componentDidMount',
- value: function () {
- yo.a.isFeatureActive('polls_pub_admin') && (this.props.selection.type === ft.forum && this.props.fetchPollForumStats(), this.props.selection.type === ft.organization && this.props.fetchPollOrgStats())
- }
- },
- {
- key: 'render',
- value: function () {
- var e,
- t,
- n,
- a = this;
- this.props.selection.organization ? (r = this.props.selection.organization.pollsActivationDate, t = Ur.SAAS_PRODUCT_PLAN_ACTIVE_STATUSES_SET.has(this.props.selection.organization.pollsSubscriptionStatus), n = !this.props.selection.organization.pollsOnly) : window._v5Config && window._v5Config.organizations && (t = r = (e = Object.values(window._v5Config.organizations)).some(function (e) {
- return e.pollsActivationDate
- }), n = e.some(function (e) {
- return !e.pollsOnly
- }));
- var r = r && !t && !n;
- return C.a.createElement('div', {
- className: 'admin-layout admin-home'
- }, C.a.createElement('div', {
- className: 'layout section-contained'
- }, C.a.createElement('div', {
- className: 'layout__content'
- }, this.state.showVerifiedAlert ? C.a.createElement(Ki, {
- alertType: 'success',
- message: C.a.createElement('strong', null, 'Your email has been verified successfully!'),
- onRequestClose: this.handleDismissVerification
- }) : null, C.a.createElement('div', {
- className: 'box clearfix'
- }, C.a.createElement('div', {
- className: 'text-gray-darker align-min-tablet align--between spacing-bottom'
- }, C.a.createElement('div', {
- className: 'spacing-narrow start-welcome__intro'
- }, C.a.createElement(o.Intro, {
- selection: this.props.selection,
- forums: this.props.forums,
- user: this.props.user
- })), this.props.selection.isSettingsVisible ? C.a.createElement('div', {
- className: 'spacing-narrow start-welcome__link'
- }, C.a.createElement(Uo, {
- path: '/settings/general/',
- selection: this.props.selection
- }, 'Edit Settings')) : null), !yo.a.isFeatureActive('polls_pub_admin') && C.a.createElement(C.a.Fragment, null, C.a.createElement('div', {
- className: 'start-stats__wrapper'
- }, C.a.createElement(lk, {
- selection: this.props.selection
- }), C.a.createElement(xP, {
- selection: this.props.selection
- }), this.props.selection.isRevealVisible ? C.a.createElement(jk, {
- selection: this.props.selection,
- forums: this.props.forums
- }) : null), C.a.createElement('div', {
- className: 'start-help'
- }, C.a.createElement('div', {
- className: 'start-help__block'
- }, C.a.createElement(v.Link, {
- to: '/install/',
- onClick: function () {
- return a.handleClickEvent('platform_list')
- }
- }, C.a.createElement('div', {
- className: 'start__icon -large icon icon-install'
- }), 'Installing Disqus', C.a.createElement('span', {
- className: 'start__icon -right-bracket icon-right-bracket'
- }))), C.a.createElement(o.SecondaryButton, {
- id: 'disqus',
- url: 'https://about.disqus.com/disqus-101',
- label: 'Disqus 101'
- }), C.a.createElement(o.SecondaryButton, {
- id: 'flag-tilted',
- url: 'https://help.disqus.com/customer/portal/articles/466238',
- label: 'Moderating your community'
- }), C.a.createElement(o.SecondaryButton, {
- id: 'conversation',
- url: Pn.contactSupport,
- label: 'Need Help?'
- }))), yo.a.isFeatureActive('polls_pub_admin') && n && C.a.createElement('div', {
- className: 'start-stats__wrapper'
- }, C.a.createElement(lk, {
- selection: this.props.selection
- }), C.a.createElement(xP, {
- selection: this.props.selection
- }), this.props.selection.isRevealVisible ? C.a.createElement(jk, {
- selection: this.props.selection,
- forums: this.props.forums
- }) : null), yo.a.isFeatureActive('polls_pub_admin') && t && C.a.createElement('div', {
- className: 'start-stats__wrapper'
- }, C.a.createElement(OP, {
- data: this.props.pollStats && this.props.pollStats.activePolls,
- selection: this.props.selection,
- isLoading: this.props.pollStatsIsFetching
- }), C.a.createElement(hk, {
- data: this.props.pollStats && this.props.pollStats.respondents,
- selection: this.props.selection,
- isLoading: this.props.pollStatsIsFetching
- }), C.a.createElement(Ok, {
- data: this.props.pollStats && this.props.pollStats.responseRate,
- selection: this.props.selection,
- isLoading: this.props.pollStatsIsFetching
- }), this.props.selection.isRevealVisible && !n ? C.a.createElement(jk, {
- selection: this.props.selection,
- forums: this.props.forums
- }) : null), yo.a.isFeatureActive('polls_pub_admin') && r && C.a.createElement(Mk, {
- organization: this.props.selection.organization
- })))))
- }
- }
- ]) && zk(e.prototype, t),
- n && zk(e, n),
- o
- }();
- Yk(i, 'propTypes', {
- forums: b.a.object.isRequired,
- selection: ht.isRequired,
- user: b.a.shape({
- name: b.a.string
- }),
- emitTrackingEvent: b.a.func.isRequired,
- emitDefaultViewEvent: b.a.func.isRequired,
- pollStats: b.a.shape({
- activePolls: b.a.number,
- respondents: b.a.number,
- responseRate: b.a.number
- }).isRequired,
- fetchPollForumStats: b.a.func.isRequired,
- fetchPollOrgStats: b.a.func.isRequired
- }),
- i.Intro = function (e) {
- var t = e.selection,
- t = t.type === ft.organization ? ''.concat(t.organization.name || 'your organization', '.') : t.type === ft.forum ? ''.concat(t.forum.name || t.forum.shortname, '.') : C.a.createElement('span', null, 'your ', Object.keys(e.forums).length, ' sites. ', C.a.createElement(bO, {
- path: '/'
- }, 'Select a specific site.'));
- return C.a.createElement('div', null, C.a.createElement('strong', null, 'Hey', e.user ? ' '.concat(e.user.name) : null, ', check out what\'s been happening on ', t))
- },
- i.Intro.displayName = 'StartIntro',
- i.Intro.propTypes = {
- forums: b.a.object.isRequired,
- selection: ht.isRequired,
- user: b.a.shape({
- name: b.a.string
- })
- },
- i.SecondaryButton = function (e) {
- return C.a.createElement('div', {
- className: 'start-help__block'
- }, C.a.createElement('a', {
- href: e.url
- }, C.a.createElement('div', {
- className: 'start__icon -large icon icon-'.concat(e.id)
- }), e.label, C.a.createElement('span', {
- className: 'start__icon -right-bracket icon-right-bracket'
- })))
- },
- i.SecondaryButton.displayName = 'StartSecondaryButton',
- i.SecondaryButton.propTypes = {
- url: b.a.string.isRequired,
- id: b.a.string.isRequired,
- label: b.a.string.isRequired
- };
- Mo = Object(u.connect) (function (e) {
- var t = e.pollStats;
- return {
- selection: e.selection,
- pollStats: t.pollStats,
- pollStatsIsFetching: t.isFetching,
- subscription: e.subscription
- }
- }, {
- emitTrackingEvent: Xo(Ls),
- emitDefaultViewEvent: ei(Ls),
- fetchPollForumStats: function () {
- return function (t, e) {
- e = e().selection;
- return t({
- type: pe.isFetching
- }),
- io.a.call('polls/overviewForum', {
- data: {
- forum: e.forum.shortname
- }
- }).done(function (e) {
- t({
- type: pe.onFetch,
- response: e.response
- })
- })
- }
- },
- fetchPollOrgStats: function () {
- return function (t, e) {
- e = e().selection;
- return t({
- type: pe.isFetching
- }),
- io.a.call('polls/overviewOrg', {
- data: {
- organization: e.organization.id
- }
- }).done(function (e) {
- t({
- type: pe.onFetch,
- response: e.response
- })
- })
- }
- }
- }) (Ni.a.attachDrivers(i, [
- rc
- ]));
- function Qk(e) {
- return (Qk = 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator ? function (e) {
- return typeof e
- }
- : function (e) {
- return e && 'function' == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? 'symbol' : typeof e
- }) (e)
- }
- function Kk(e, t) {
- for (var n = 0; n < t.length; n++) {
- var a = t[n];
- a.enumerable = a.enumerable || !1,
- a.configurable = !0,
- 'value' in a && (a.writable = !0),
- Object.defineProperty(e, a.key, a)
- }
- }
- function Jk(e, t) {
- return (Jk = Object.setPrototypeOf || function (e, t) {
- return e.__proto__ = t,
- e
- }) (e, t)
- }
- function $k(n) {
- var a = function () {
- if ('undefined' == typeof Reflect || !Reflect.construct) return !1;
- if (Reflect.construct.sham) return !1;
- if ('function' == typeof Proxy) return !0;
- try {
- return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [
- ], function () {
- })),
- !0
- } catch (e) {
- return !1
- }
- }();
- return function () {
- var e,
- t = Xk(n);
- return e = a ? (e = Xk(this).constructor, Reflect.construct(t, arguments, e)) : t.apply(this, arguments),
- t = this,
- !(e = e) || 'object' !== Qk(e) && 'function' != typeof e ? Zk(t) : e
- }
- }
- function Zk(e) {
- if (void 0 === e) throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called');
- return e
- }
- function Xk(e) {
- return (Xk = Object.setPrototypeOf ? Object.getPrototypeOf : function (e) {
- return e.__proto__ || Object.getPrototypeOf(e)
- }) (e)
- }
- function eN(e, t, n) {
- return t in e ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n,
- e
- }
- yl = function () {
- !function (e, t) {
- if ('function' != typeof t && null !== t) throw new TypeError('Super expression must either be null or a function');
- e.prototype = Object.create(t && t.prototype, {
- constructor: {
- value: e,
- writable: !0,
- configurable: !0
- }
- }),
- t && Jk(e, t)
- }(o, A);
- var e,
- t,
- n,
- r = $k(o);
- function o() {
- var e;
- !function (e, t) {
- if (!(e instanceof t)) throw new TypeError('Cannot call a class as a function')
- }(this, o);
- for (var t = arguments.length, n = Array(t), a = 0; a < t; a++) n[a] = arguments[a];
- return eN(Zk(e = r.call.apply(r, [
- this
- ].concat(n))), 'handleDismiss', function () {
- Is.a.set('engageFeaturedMessage', !0),
- e.setState({
- engageFeaturedMessage: !0
- })
- }),
- e
- }
- return e = o,
- (t = [
- {
- key: 'render',
- value: function () {
- return Is.a.get('engageFeaturedMessage') ? null : C.a.createElement('div', {
- className: 'content__wrap padding-small text-center'
- }, C.a.createElement('img', {
- className: 'img-responsive',
- width: '120',
- src: '//c.disquscdn.com/next/current/publisher-admin/assets/img/logos/logo-engage-black.png'
- }), C.a.createElement('p', {
- className: 'text-large spacing-bottom'
- }, C.a.createElement('strong', null, 'Commenting platform for publishers')), C.a.createElement('p', {
- className: 'text-medium spacing-narrow'
- }, 'As you start to build a community, you may have questions on how to moderate or how to get started.'), C.a.createElement('a', {
- href: 'https://disqus.com/features/',
- className: 'button button-fill--brand text-medium spacing-narrow spacing-right'
- }, 'Learn More'), C.a.createElement('button', {
- className: 'button button-fill--brand text-medium spacing-narrow spacing-right',
- onClick: this.handleDismiss
- }, 'Dismiss'))
- }
- }
- ]) && Kk(e.prototype, t),
- n && Kk(e, n),
- o
- }();
- eN(yl, 'displayName', 'EngageFeaturedMessage');
- h = yl;
- function tN(e) {
- return (tN = 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator ? function (e) {
- return typeof e
- }
- : function (e) {
- return e && 'function' == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? 'symbol' : typeof e
- }) (e)
- }
- function nN(e, t) {
- if (!(e instanceof t)) throw new TypeError('Cannot call a class as a function')
- }
- function aN(e, t) {
- for (var n = 0; n < t.length; n++) {
- var a = t[n];
- a.enumerable = a.enumerable || !1,
- a.configurable = !0,
- 'value' in a && (a.writable = !0),
- Object.defineProperty(e, a.key, a)
- }
- }
- function rN(e, t, n) {
- return t && aN(e.prototype, t),
- n && aN(e, n),
- e
- }
- function oN(e, t) {
- if ('function' != typeof t && null !== t) throw new TypeError('Super expression must either be null or a function');
- e.prototype = Object.create(t && t.prototype, {
- constructor: {
- value: e,
- writable: !0,
- configurable: !0
- }
- }),
- t && iN(e, t)
- }
- function iN(e, t) {
- return (iN = Object.setPrototypeOf || function (e, t) {
- return e.__proto__ = t,
- e
- }) (e, t)
- }
- function sN(n) {
- var a = function () {
- if ('undefined' == typeof Reflect || !Reflect.construct) return !1;
- if (Reflect.construct.sham) return !1;
- if ('function' == typeof Proxy) return !0;
- try {
- return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [
- ], function () {
- })),
- !0
- } catch (e) {
- return !1
- }
- }();
- return function () {
- var e,
- t = cN(n);
- return e = a ? (e = cN(this).constructor, Reflect.construct(t, arguments, e)) : t.apply(this, arguments),
- t = this,
- !(e = e) || 'object' !== tN(e) && 'function' != typeof e ? lN(t) : e
- }
- }
- function lN(e) {
- if (void 0 === e) throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called');
- return e
- }
- function cN(e) {
- return (cN = Object.setPrototypeOf ? Object.getPrototypeOf : function (e) {
- return e.__proto__ || Object.getPrototypeOf(e)
- }) (e)
- }
- function uN(e, t, n) {
- return t in e ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n,
- e
- }
- var pN = Object(u.connect) (null, {
- emitTrackingEvent: Xo({
- zone: 'moderation_panel',
- area: 'suggested_action_sidebar',
- section: 'welcome',
- product: 'publisher_admin'
- })
- }) (Ni.a.attachDrivers((Yc = Ru = function () {
- oN(o, A);
- var r = sN(o);
- function o() {
- var t;
- nN(this, o);
- for (var e = arguments.length, n = Array(e), a = 0; a < e; a++) n[a] = arguments[a];
- return uN(lN(t = r.call.apply(r, [
- this
- ].concat(n))), 'trackButtonClick', function (e) {
- t.props.emitTrackingEvent({
- verb: 'click',
- object_type: 'button',
- object_id: e
- })
- }),
- t
- }
- return rN(o, [
- {
- key: 'render',
- value: function () {
- return this.props.selection.organization && this.props.selection.organization.pollsOnly ? null : C.a.createElement(C.a.Fragment, null, C.a.createElement('span', {
- className: 'text-larger text-semibold'
- }, 'Suggested actions are new to the moderation panel! Here are the basics:'), C.a.createElement('div', {
- className: 'suggested-actions__module'
- }, C.a.createElement('div', {
- className: 'spacing-narrow spacing-bottom'
- }, C.a.createElement('ul', {
- className: 'suggested-actions__list'
- }, C.a.createElement('li', {
- className: 'suggested-actions__item'
- }, C.a.createElement('span', {
- className: 'icon-lightning'
- }), C.a.createElement('span', {
- className: 'text'
- }, 'Suggested actions were made to help you moderate faster and more consistently.')), C.a.createElement('li', {
- className: 'suggested-actions__item'
- }, C.a.createElement('span', {
- className: 'icon-lightning'
- }), C.a.createElement('span', {
- className: 'text'
- }, 'If you take a different action than the suggestion, we\'ll use that information to improve our algorithm.')), C.a.createElement('li', {
- className: 'suggested-actions__item'
- }, C.a.createElement('span', {
- className: 'icon-lightning'
- }), C.a.createElement('span', {
- className: 'text'
- }, 'You can select multiple comments and accept all the suggested actions at once.')))), C.a.createElement('a', {
- href: 'https://www.surveymonkey.com/r/8LWBQS3'.concat(this.props.user ? '?username='.concat(this.props.user.username) : ''),
- className: 'button button-large button-fill--white text-medium spacing-narrow spacing-right',
- target: '_blank',
- rel: 'noopener noreferrer',
- onClick: this.trackButtonClick.bind(null, 'leave_us_feedback')
- }, 'Leave us Feedback'), C.a.createElement('a', {
- href: Pn.suggestedActions,
- className: 'button button-large button-fill--brand text-medium spacing-narrow spacing-right',
- target: '_blank',
- rel: 'noopener noreferrer',
- onClick: this.trackButtonClick.bind(null, 'learn_more')
- }, 'Learn more'), C.a.createElement('button', {
- className: 'button button-large button-fill--brand text-medium spacing-narrow',
- target: '_blank',
- rel: 'noopener noreferrer',
- onClick: this.props.handleDismiss
- }, 'Dismiss')))
- }
- }
- ]),
- o
- }(), uN(Ru, 'propTypes', {
- emitTrackingEvent: b.a.func.isRequired,
- user: b.a.shape({
- username: b.a.string
- }),
- handleDismiss: b.a.func.isRequired
- }), Yc), [
- rc
- ])),
- dN = Object(u.connect) (null, {
- emitTrackingEvent: Xo({
- zone: 'moderation_panel',
- area: 'moderation_rules_sidebar',
- section: 'welcome',
- product: 'publisher_admin'
- }),
- addIntercomScript: D,
- intercomInitWithUser: I,
- removeIntercomScript: F
- }) (Ni.a.attachDrivers((Ls = sl = function () {
- oN(o, A);
- var r = sN(o);
- function o() {
- var t;
- nN(this, o);
- for (var e = arguments.length, n = Array(e), a = 0; a < e; a++) n[a] = arguments[a];
- return uN(lN(t = r.call.apply(r, [
- this
- ].concat(n))), 'componentWillMount', function () {
- t.props.addIntercomScript()
- }),
- uN(lN(t), 'componentWillUnmount', function () {
- t.props.removeIntercomScript()
- }),
- uN(lN(t), 'handleIntercomClick', function (e) {
- t.trackButtonClick(e),
- t.props.intercomInitWithUser(t.props.user)
- }),
- uN(lN(t), 'trackButtonClick', function (e) {
- t.props.emitTrackingEvent({
- verb: 'click',
- object_type: 'button',
- object_id: e
- })
- }),
- t
- }
- return rN(o, [
- {
- key: 'render',
- value: function () {
- return this.props.selection.organization && this.props.selection.organization.pollsOnly ? null : C.a.createElement(C.a.Fragment, null, C.a.createElement('span', {
- className: 'text-larger text-semibold'
- }, 'Moderation rules have been added to the moderation panel!'), C.a.createElement('div', {
- className: 'suggested-actions__module'
- }, C.a.createElement('div', {
- className: 'spacing-narrow spacing-bottom'
- }, C.a.createElement('ul', {
- className: 'suggested-actions__list'
- }, C.a.createElement('li', {
- className: 'moderation-rules__item'
- }, C.a.createElement('span', {
- className: 'icon-lightning'
- }), C.a.createElement('span', {
- className: 'text'
- }, 'Moderation rules were made to help you moderate more efficiently while maintaining your moderation preferences.')), C.a.createElement('li', {
- className: 'moderation-rules__item'
- }, C.a.createElement('span', {
- className: 'icon-lightning'
- }), C.a.createElement('span', {
- className: 'text'
- }, 'Comments affected by a moderation rule will be marked with a reason like:', C.a.createElement('br', null), C.a.createElement('span', {
- className: 'icon-pending'
- }), C.a.createElement('strong', null, ' In Pending'), ' ', 'because ', C.a.createElement('strong', null, 'Toxic'))), C.a.createElement('li', {
- className: 'moderation-rules__item'
- }, C.a.createElement('span', {
- className: 'icon-lightning'
- }), C.a.createElement('span', {
- className: 'text'
- }, 'This feature is optional and you can choose not to use it.')))), C.a.createElement('button', {
- className: 'button button-large button-fill--white text-medium spacing-narrow spacing-right',
- target: '_blank',
- rel: 'noopener noreferrer',
- onClick: this.handleIntercomClick.bind(null, 'talk_to_support')
- }, 'Talk to Support'), C.a.createElement('a', {
- href: Pn.moderationRules,
- className: 'button button-large button-fill--brand text-medium spacing-narrow spacing-right',
- target: '_blank',
- rel: 'noopener noreferrer',
- onClick: this.trackButtonClick.bind(null, 'learn_more')
- }, 'Learn more'), C.a.createElement('button', {
- className: 'button button-large button-fill--brand text-medium spacing-narrow',
- target: '_blank',
- rel: 'noopener noreferrer',
- onClick: this.props.handleDismiss
- }, 'Dismiss')))
- }
- }
- ]),
- o
- }(), uN(sl, 'propTypes', {
- emitTrackingEvent: b.a.func.isRequired,
- addIntercomScript: b.a.func.isRequired,
- intercomInitWithUser: b.a.func.isRequired,
- removeIntercomScript: b.a.func.isRequired,
- user: b.a.shape({
- id: b.a.string.isRequired,
- username: b.a.string.isRequired,
- email: b.a.string.isRequired,
- name: b.a.string.isRequired
- }),
- handleDismiss: b.a.func.isRequired
- }), Ls), [
- rc
- ])),
- i = function () {
- oN(o, A);
- var r = sN(o);
- function o() {
- var t;
- nN(this, o);
- for (var e = arguments.length, n = Array(e), a = 0; a < e; a++) n[a] = arguments[a];
- return uN(lN(t = r.call.apply(r, [
- this
- ].concat(n))), 'handleDismiss', function (e) {
- e && (Is.a.set(e, !0), t.setState(uN({
- }, e, !0)))
- }),
- t
- }
- return rN(o, [
- {
- key: 'render',
- value: function () {
- if (this.props.selection.organization && this.props.selection.organization.pollsOnly) return null;
- var e,
- t = this.props,
- n = t.selection,
- t = t.saasFeatures[(n.organization || {
- }).id] || {
- };
- return yo.a.isFeatureActive('moderationRulesMessage', {
- forum: pt.a.currentForum
- }) && n.organization && t.isFetched && t.allModRules && !Is.a.get('moderationRulesMessage') ? e = C.a.createElement(dN, {
- handleDismiss: this.handleDismiss.bind(this, 'moderationRulesMessage')
- }) : YP && !Is.a.get('suggestedActionsMessage') && (e = C.a.createElement(pN, {
- handleDismiss: this.handleDismiss.bind(this, 'suggestedActionsMessage')
- })),
- C.a.createElement('div', null, e ? C.a.createElement(Ki, {
- alertType: 'brand-new',
- topMarginClass: 'spacing-top-none',
- message: e
- }) : null, C.a.createElement('p', {
- className: 'spacing-top-bottom text-small text-gray'
- }, 'Type ', C.a.createElement('code', null, '?'), ' to see shortcuts'))
- }
- }
- ]),
- o
- }();
- uN(i, 'propTypes', {
- selection: ht.isRequired,
- saasFeatures: b.a.objectOf(b.a.objectOf(b.a.bool)).isRequired
- });
- var yl = Object(u.connect) (function (e) {
- return {
- selection: e.selection,
- saasFeatures: e.saasFeatures
- }
- }) (i),
- mN = [
- {
- module: C.a.createElement(yl, null),
- routes: [
- /^\/moderate/,
- /^\/settings\/rules/
- ]
- },
- {
- module: C.a.createElement(h, null),
- routes: [
- '/discussions/migrate/',
- '/discussions/export/',
- /^\/discussions\/import\//
- ]
- },
- {
- module: null,
- routes: [
- '/discussions/',
- /^\/discussions\/history\//,
- '/tools/migrate-map/'
- ]
- }
- ],
- Ru = function (e) {
- var t = {
- auth: e.auth,
- forums: e.forums,
- location: e.location,
- organizations: e.organizations,
- selection: e.selection
- },
- n = fo(),
- a = je.a.find(mN, function (e) {
- return e.routes.some(function (e) {
- return e.test ? e.test(n) : e === n
- })
- });
- return C.a.createElement('div', {
- className: 'section-contained'
- }, C.a.createElement('div', {
- className: 'layout layout--stacked-tablet'
- }, C.a.createElement('div', {
- className: (a = a && a.module) ? '' : 'layout__main'
- }, C.a.createElement(Si, {
- selection: e.selection,
- pollsOnly: e.selection.organization && e.selection.organization.pollsOnly
- }), C.a.createElement('div', {
- className: 'layout__content'
- }, a || null, C.a.cloneElement(e.children, t)))))
- };
- Ru.displayName = 'EngageLayout',
- Ru.propTypes = {
- auth: b.a.object.isRequired,
- children: b.a.node.isRequired,
- forums: b.a.object.isRequired,
- location: b.a.object.isRequired,
- organizations: b.a.object.isRequired,
- selection: ht.isRequired
- };
- Yc = Object(u.connect) (function (e) {
- return {
- selection: e.selection
- }
- }) (Ru);
- Yc.supportedRoutes = mN.reduce(function (e, t) {
- return e.concat(t.routes)
- }, [
- ]);
- var fN = Yc,
- D = {
- updateBadgesModal: function (e) {
- return {
- type: z.updateModal,
- isOpen: e.isOpen,
- forum: e.forum,
- user: e.author
- }
- },
- awardBadge: function (e, n, a) {
- return function (t) {
- t({
- type: z.awarding
- }),
- io.a.call('badges/award', {
- type: 'POST',
- data: e,
- success: function (e) {
- e = e.response;
- t({
- type: z.onAward,
- badge: e
- }),
- n(e)
- },
- error: function () {
- var e = 'An error occurred trying to award this badge. Try again.';
- t({
- type: z.onAwardError,
- error: e
- }),
- a(e)
- }
- })
- }
- },
- removeBadge: function (e, n, a) {
- return function (t) {
- t({
- type: z.removing
- }),
- io.a.call('badges/remove', {
- type: 'POST',
- data: e,
- success: function (e) {
- e = e.response;
- t({
- type: z.onRemove,
- badge: e
- }),
- n(e)
- },
- error: function () {
- var e = 'An error occurred trying to remove this badge. Try again.';
- t({
- type: z.onRemoveError,
- error: e
- }),
- a(e)
- }
- })
- }
- }
- },
- I = {
- updateLocalQuery: function (e) {
- return {
- type: ne.update,
- search: e
- }
- },
- changeActive: function (e) {
- return {
- type: ne.changeActive,
- isActive: e
- }
- }
- },
- F = {
- fetch: function (r) {
- return function (t, n) {
- var a = n();
- return r.every(function (e) {
- return !!a.suggestedActions[e]
- }) ? vo.a.Deferred().resolve({
- suggestedActions: a.suggestedActions
- }).promise() : io.a.call('apothecary/suggest', {
- data: {
- posts: r
- }
- }).done(function (e) {
- return t({
- type: ae.onFetch,
- suggestedActions: e.response,
- postIds: r
- }),
- {
- suggestedActions: n().suggestedActions
- }
- })
- }
- }
- },
- hN = {
- normalizeReputation: function (e) {
- var t = e.toFixed(2),
- n = {
- raw: e,
- rounded: t
- },
- e = '';
- return n.verboseName = {
- low1: 'Low Rep',
- low2: 'Low Rep',
- average: 'Average',
- high: 'High Rep'
- }
- [
- e = t < 0.25 ? 'low1' : t < 0.8 ? 'low2' : t < 2.9 ? 'average' : 'high'
- ],
- n.shortName = {
- low1: 'Low',
- low2: 'Low',
- average: 'Avg',
- high: 'High'
- }
- [
- e
- ],
- n.type = e,
- n
- },
- getUrl: function (e) {
- var t = e.search,
- n = e.filters;
- return ho.getRoute('/moderate/' + e.tab + (1 === n.length ? '/filter/'.concat(n[0]) : '') + (t ? '/search/'.concat(t) : ''))
- }
- };
- function gN(e) {
- return (gN = 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator ? function (e) {
- return typeof e
- }
- : function (e) {
- return e && 'function' == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? 'symbol' : typeof e
- }) (e)
- }
- function yN() {
- return (yN = Object.assign || function (e) {
- for (var t = 1; t < arguments.length; t++) {
- var n,
- a = arguments[t];
- for (n in a) Object.prototype.hasOwnProperty.call(a, n) && (e[n] = a[n])
- }
- return e
- }).apply(this, arguments)
- }
- function bN(t, e) {
- var n,
- a = Object.keys(t);
- return Object.getOwnPropertySymbols && (n = Object.getOwnPropertySymbols(t), e && (n = n.filter(function (e) {
- return Object.getOwnPropertyDescriptor(t, e).enumerable
- })), a.push.apply(a, n)),
- a
- }
- function vN(t) {
- for (var e = 1; e < arguments.length; e++) {
- var n = null != arguments[e] ? arguments[e] : {
- };
- e % 2 ? bN(Object(n), !0).forEach(function (e) {
- PN(t, e, n[e])
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(n)) : bN(Object(n)).forEach(function (e) {
- Object.defineProperty(t, e, Object.getOwnPropertyDescriptor(n, e))
- })
- }
- return t
- }
- function _N(e, t) {
- for (var n = 0; n < t.length; n++) {
- var a = t[n];
- a.enumerable = a.enumerable || !1,
- a.configurable = !0,
- 'value' in a && (a.writable = !0),
- Object.defineProperty(e, a.key, a)
- }
- }
- function EN(e, t) {
- return (EN = Object.setPrototypeOf || function (e, t) {
- return e.__proto__ = t,
- e
- }) (e, t)
- }
- function ON(n) {
- var a = function () {
- if ('undefined' == typeof Reflect || !Reflect.construct) return !1;
- if (Reflect.construct.sham) return !1;
- if ('function' == typeof Proxy) return !0;
- try {
- return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [
- ], function () {
- })),
- !0
- } catch (e) {
- return !1
- }
- }();
- return function () {
- var e,
- t = wN(n);
- return e = a ? (e = wN(this).constructor, Reflect.construct(t, arguments, e)) : t.apply(this, arguments),
- t = this,
- !(e = e) || 'object' !== gN(e) && 'function' != typeof e ? SN(t) : e
- }
- }
- function SN(e) {
- if (void 0 === e) throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called');
- return e
- }
- function wN(e) {
- return (wN = Object.setPrototypeOf ? Object.getPrototypeOf : function (e) {
- return e.__proto__ || Object.getPrototypeOf(e)
- }) (e)
- }
- function PN(e, t, n) {
- return t in e ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n,
- e
- }
- var kN = {
- isAnonymous: 1,
- hasLinks: 2,
- hasLowRep: 3,
- hasBadWords: 4,
- isFlagged: 5,
- noIssue: 6,
- isToxic: 7,
- modifiedByRule: 8,
- hasMedia: 10,
- isAtFlagLimit: 11,
- isNewUserNeedsApproval: 13,
- isSexual: 14,
- isHate: 15,
- isBullying: 16,
- isViolence: 17,
- isPromotion: 18
- },
- sl = function () {
- !function (e, t) {
- if ('function' != typeof t && null !== t) throw new TypeError('Super expression must either be null or a function');
- e.prototype = Object.create(t && t.prototype, {
- constructor: {
- value: e,
- writable: !0,
- configurable: !0
- }
- }),
- t && EN(e, t)
- }(r, A);
- var e,
- t,
- n,
- a = ON(r);
- function r() {
- var l;
- !function (e, t) {
- if (!(e instanceof t)) throw new TypeError('Cannot call a class as a function')
- }(this, r);
- for (var e = arguments.length, t = Array(e), n = 0; n < e; n++) t[n] = arguments[n];
- return PN(SN(l = a.call.apply(a, [
- this
- ].concat(t))), 'state', {
- cursor: {
- },
- posts: {
- },
- message: null,
- include: null,
- sortOrder: MP.sortOrder,
- fetchingAmount: 0,
- isPerformingAction: !1,
- filters: l.props.params.filter ? [
- l.props.params.filter
- ] : [
- ],
- searchQuery: l.props.params.search ? window.decodeURIComponent(l.props.params.search) : '',
- startDate: MP.startDate,
- endDate: MP.endDate
- }),
- PN(SN(l), 'fetchMore', function (e) {
- l.state.cursor && !l.state.cursor.hasNext || l.fetchData({
- cursor: l.state.cursor.next
- }, e, !0)
- }),
- PN(SN(l), 'getFetchData', function (e, t) {
- t = t || l.props;
- var n = je.a.extend({
- attach: [
- 'postModHtml',
- 'postAuthorRep'
- ],
- limit: MP.fetchSize,
- include: l.state.include,
- order: l.state.sortOrder,
- related: [
- 'thread',
- 'forum'
- ],
- filters: l.state.filters.map(function (e) {
- return kN[e]
- })
- }, e);
- 'worst' === n.order && (n.order = 'desc', n.sortType = 'priority'),
- l.state.searchQuery && (n.query = window.decodeURIComponent(l.state.searchQuery));
- e = t.saasFeatures[(t.selection.organization || {
- }).id] || {
- };
- t.selection.organization && e.isFetched && e.allModRules && n.attach.push('postRule'),
- t.selection.organization && t.selection.forum && e.unapproveNewUsers && yo.a.isFeatureActive('new_user_premoderation', {
- forum: t.selection.forum.name
- }) && n.attach.push('postAuthorNewBypass');
- e = Ve.a.getFromCookie();
- if (t.selection.type === ft.organization) n.forum = je.a.intersection(t.selection.organization.forums, window._v5Config.moderated_forums);
- else if (t.selection.type === ft.forum) n.forum = t.selection.forum.shortname;
- else if (e.staff) n.forum = ':all';
- else {
- if (!e.isModerator) return;
- n.forum = ':moderated'
- }
- return l.state.startDate && l.state.endDate && (n.start = l.state.startDate.toISOString(), n.end = l.state.endDate.toISOString()),
- n
- }),
- PN(SN(l), 'fetchData', function (e, t, n, a) {
- if ((a = a || l.props).selection && l.state.include) {
- var r = a.saasFeatures[(a.selection.organization || {
- }).id] || {
- };
- if (r.isFetching && !r.isFetched) return l.onSaasFeaturesFetched = l.onSaasFeaturesFetched || [
- ],
- void l.onSaasFeaturesFetched.push(l.fetchData.bind(SN(l), e, t, n));
- var o = l.getFetchData(e, a);
- o && l.setState({
- fetchingAmount: l.state.fetchingAmount + 1
- }, function () {
- l.apiCall = io.a.call('posts/list', {
- cache: !1,
- data: o
- }).done(je.a.partial(l.onFetch, je.a, t, n)).fail(l.onFetchError)
- })
- }
- }),
- PN(SN(l), 'onFetch', function (e, t, n) {
- var a,
- r;
- null !== e.response && (a = l.state.fetchingAmount - 1, r = je.a.chain(e.response).map(function (e) {
- return e.forum.badges && e.forum.badges.length && e.author.badges && e.author.badges.length && (e.author.badges = l.getPostBadges(e)),
- [
- e.id,
- e
- ]
- }).object().value(), l.fetchFlaggers(r), n && je.a.extend(r, l.state.posts), a <= 0 ? l.setState({
- fetchingAmount: 0,
- cursor: e.cursor,
- posts: r
- }, t) : l.setState({
- fetchingAmount: a
- }))
- }),
- PN(SN(l), 'onFetchError', function () {
- l.setState({
- fetchingAmount: l.state.fetchingAmount - 1
- })
- }),
- PN(SN(l), 'fetchFlaggers', function (n, e) {
- var t = Object.keys(n).reduce(function (e, t) {
- return n[t].numReports && e.push(t),
- e
- }, [
- ]);
- t.length && io.a.call('posts/listReporters', {
- data: {
- posts: t,
- numberPerPost: e = e || 1
- }
- }).done(l.onFetchFlaggers)
- }),
- PN(SN(l), 'onFetchFlaggers', function (e) {
- var n = e.response;
- l.setState({
- posts: Object.keys(n).reduce(function (e, t) {
- return e[t] = vN(vN({
- }, e[t]), {
- }, {
- flaggers: n[t]
- }),
- e
- }, vN({
- }, l.state.posts))
- })
- }),
- PN(SN(l), 'updateFetchData', function (t, e) {
- var n = [
- 'filters',
- 'include',
- 'searchQuery',
- 'sortOrder',
- 'startDate',
- 'endDate'
- ];
- je.a.all(n, function (e) {
- return void 0 === t[e] || je.a.isEqual(t[e], this.state[e])
- }, SN(l)) ? 'function' == typeof e && e() : l.setState(je.a.chain(t).pick(n).defaults(l.state).value(), je.a.partial(l.fetchData, {
- }, e))
- }),
- PN(SN(l), 'getPostBadges', function (e) {
- var n = {
- };
- return e.forum.badges.forEach(function (e) {
- n[e.id] = e
- }),
- e.author.badges.reduce(function (e, t) {
- return 'string' == typeof t && e.push(n[t]),
- e
- }, [
- ])
- }),
- PN(SN(l), 'performAction', function (e, t, n, a) {
- e.length && (n = n || je.a.noop, l.setState({
- isPerformingAction: !0
- }), io.a.call(BP[t].apiPath, {
- data: {
- post: e,
- attach: [
- 'postAuthorNewBypass'
- ],
- newUserPremodBypass: a && a.newUserPremodBypass
- },
- method: 'POST'
- }).done(je.a.partial(l.onPerformAction, je.a, n)))
- }),
- PN(SN(l), 'onPerformAction', function (e, t) {
- var a = l.state.posts,
- e = e.response.reduce(function (e, t) {
- var n = a[t.id];
- return yN(e, PN({
- }, t.id, yN(n, t, {
- thread: n.thread,
- forum: n.forum
- })))
- }, {
- });
- l.setState({
- isPerformingAction: !1,
- posts: yN(l.state.posts, e)
- }),
- t.call(SN(l))
- }),
- PN(SN(l), 'getPostParents', function (e) {
- var t = l.state.posts[e];
- t && t.parent && io.a.call('posts/getContext', {
- data: {
- attach: [
- 'postModHtml',
- 'postAuthorRep'
- ],
- post: t.parent,
- depth: 4
- }
- }).done(je.a.partial(l.onFetchPostParents, je.a, e))
- }),
- PN(SN(l), 'onFetchPostParents', function (e, t) {
- var n = l.state.posts[t];
- n && (e = je.a.defaults({
- parents: je.a.chain(e.response).map(function (e) {
- return [e.id,
- je.a.defaults({
- forum: n.forum,
- thread: n.thread
- }, e)]
- }).object().value()
- }, n), l.setState({
- posts: je.a.defaults(PN({
- }, t, e), l.state.posts)
- }))
- }),
- PN(SN(l), 'fetchThreadReactionsEnabled', function (e) {
- return io.a.call('threadReactions/loadReactions', {
- data: {
- thread: e
- },
- method: 'GET'
- }).done(je.a.partial(l.onFetchThreadReactions, je.a, e))
- }),
- PN(SN(l), 'onFetchThreadReactions', function (t, e) {
- l.setState({
- posts: l.applyPostsWithThreadId(e, function (e) {
- return je.a.defaults({
- thread: je.a.defaults({
- reactionsEnabled: !!t.response.reactions.length,
- reactionsEligible: t.response.eligible
- }, e.thread)
- }, e)
- })
- })
- }),
- PN(SN(l), 'toggleReactions', function (e, t) {
- io.a.call('threadReactions/disableForThread', {
- data: {
- thread: e,
- enable: t ? 1 : 0
- },
- method: 'POST'
- }).done(je.a.partial(l.onToggleReactions, je.a, t))
- }),
- PN(SN(l), 'onToggleReactions', function (t, n) {
- l.setState({
- posts: l.applyPostsWithThreadId(t.response.id, function (e) {
- return je.a.defaults({
- thread: je.a.defaults(je.a.defaults({
- reactionsEnabled: n
- }, t.response), e.thread),
- forum: je.a.defaults({
- settings: je.a.defaults({
- threadReactionsEnabled: n
- }, e.forum.settings)
- }, e.forum)
- }, e)
- })
- })
- }),
- PN(SN(l), 'toggleThreadClosed', function (e, t) {
- l.setState({
- isTogglingClosed: !0
- }),
- io.a.call(t ? 'threads/close' : 'threads/open', {
- data: {
- thread: e
- },
- method: 'POST'
- }).done(je.a.partial(l.onToggleThreadClosed, je.a, t))
- }),
- PN(SN(l), 'onToggleThreadClosed', function (e, t) {
- l.setState({
- isTogglingClosed: !1,
- posts: l.applyPostsWithThreadId(e.response[0].id, function (e) {
- return je.a.defaults({
- thread: je.a.defaults({
- isClosed: t
- }, e.thread)
- }, e)
- })
- })
- }),
- PN(SN(l), 'applyPostsWithThreadId', function (n, a) {
- return je.a.chain(l.state.posts).map(function (e, t) {
- return e.thread.id !== n ? [
- t,
- e
- ] : [
- t,
- a(e)
- ]
- }).object().value()
- }),
- PN(SN(l), 'toggleThreadPremoderation', function (e, t) {
- io.a.call('threads/update', {
- data: {
- thread: e,
- validateAllPosts: t ? 1 : 0
- },
- method: 'POST'
- }).then(l.onToggleThreadPremoderation)
- }),
- PN(SN(l), 'onToggleThreadPremoderation', function (e) {
- var a = e.response;
- l.setState({
- posts: Object.keys(l.state.posts).reduce(function (e, t) {
- var n = l.state.posts[t];
- return e[t] = n.thread.id !== a.id ? n : vN(vN({
- }, n), {
- }, {
- thread: vN(vN({
- }, n.thread), a)
- }),
- e
- }, {
- })
- })
- }),
- PN(SN(l), 'updateVote', function (e, t) {
- var n,
- a,
- r = l.state.posts[e],
- o = t === r.userScore,
- i = t === - 1 * r.userScore,
- s = o ? 0 : t;
- io.a.call('posts/vote', {
- data: {
- post: e,
- vote: s
- },
- method: 'POST'
- }),
- 1 === t ? (n = o ? - 1 : 1, a = i ? - 1 : 0) : - 1 === t && (n = i ? - 1 : 0, a = o ? - 1 : 1);
- r = je.a.defaults({
- likes: r.likes + n,
- dislikes: r.dislikes + a,
- userScore: s
- }, r);
- l.setState({
- posts: je.a.defaults(PN({
- }, e, r), l.state.posts)
- })
- }),
- PN(SN(l), 'updatePostMessage', function (e, t, n) {
- io.a.call('posts/update', {
- data: {
- post: e,
- message: t,
- attach: [
- 'postModHtml',
- 'postAuthorRep'
- ]
- },
- method: 'POST'
- }).done(je.a.partial(l.onUpdatePostMessage, je.a, n))
- }),
- PN(SN(l), 'onUpdatePostMessage', function (e, t) {
- t = t || je.a.noop;
- var n = e.response.id,
- e = je.a.defaults({
- modMessage: e.response.modMessage,
- message: e.response.message,
- raw_message: e.response.raw_message
- }, l.state.posts[n]);
- l.setState({
- posts: je.a.defaults(PN({
- }, n, e), l.state.posts)
- }, t)
- }),
- PN(SN(l), 'savePostReply', function (e, t, n, a) {
- io.a.call('posts/create', {
- data: {
- parent: e,
- message: t,
- attach: [
- 'postModHtml',
- 'postAuthorRep'
- ]
- },
- method: 'POST'
- }).done(je.a.partial(l.onSavePostReply, je.a, n)).fail(a)
- }),
- PN(SN(l), 'onSavePostReply', function (e, t) {
- e = e.response;
- io.a.call('posts/approve', {
- data: {
- post: e.id
- },
- method: 'POST'
- }).done(je.a.partial(l.onApprovePostReply, e, t))
- }),
- PN(SN(l), 'onApprovePostReply', function (e, t) {
- var n = e.parent,
- e = je.a.defaults({
- child: e
- }, l.state.posts[n]);
- l.setState({
- posts: je.a.defaults(PN({
- }, n, e), l.state.posts)
- }, t)
- }),
- PN(SN(l), 'updateUserBadges', function (n, a) {
- var r = {
- },
- o = l.state.posts;
- Object.keys(o).forEach(function (e) {
- var t = o[e];
- n.id === t.author.id && (t.author.badges = a),
- r[e] = t
- }),
- l.setState({
- posts: r
- })
- }),
- PN(SN(l), 'getComponentProps', function () {
- return {
- posts: l.state.posts,
- searchQuery: l.state.searchQuery,
- updateFetchData: l.updateFetchData,
- performAction: l.performAction,
- message: l.state.message,
- updateVote: l.updateVote,
- updatePostMessage: l.updatePostMessage,
- savePostReply: l.savePostReply,
- sortOrder: l.state.sortOrder,
- searchFilters: l.state.filters,
- hasMorePosts: l.state.cursor.hasNext,
- refreshPosts: l.fetchData,
- fetchMorePosts: l.fetchMore,
- postsAreFetching: !!l.state.fetchingAmount,
- postsAreUpdating: l.state.isPerformingAction,
- fetchThreadReactionsEnabled: l.fetchThreadReactionsEnabled,
- toggleReactions: l.toggleReactions,
- toggleThreadClosed: l.toggleThreadClosed,
- toggleThreadPremoderation: l.toggleThreadPremoderation,
- isTogglingClosed: l.state.isTogglingClosed,
- getPostParents: l.getPostParents,
- startDate: l.state.startDate,
- endDate: l.state.endDate,
- fetchFlaggers: l.fetchFlaggers,
- updateUserBadges: l.updateUserBadges
- }
- }),
- l
- }
- return e = r,
- (t = [
- {
- key: 'componentWillUnmount',
- value: function () {
- this.apiCall && 'pending' === this.apiCall.state() && this.apiCall.abort()
- }
- },
- {
- key: 'componentWillReceiveProps',
- value: function (t) {
- !(this.props.saasFeatures[(this.props.selection.organization || {
- }).id] || {
- }).isFetched && (t.saasFeatures[(this.props.selection.organization || {
- }).id] || {
- }).isFetched && this.onSaasFeaturesFetched && this.onSaasFeaturesFetched.forEach(function (e) {
- e(t)
- })
- }
- }
- ]) && _N(e.prototype, t),
- n && _N(e, n),
- r
- }();
- PN(sl, 'displayName', 'PostListDriver'),
- PN(sl, 'propTypes', {
- selection: ht.isRequired,
- saasFeatures: b.a.objectOf(b.a.objectOf(b.a.bool)).isRequired,
- params: b.a.object.isRequired
- });
- Ls = Object(ki.createDriver) (sl, function (e) {
- return {
- saasFeatures: e.saasFeatures
- }
- });
- function NN(e) {
- return (NN = 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator ? function (e) {
- return typeof e
- }
- : function (e) {
- return e && 'function' == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? 'symbol' : typeof e
- }) (e)
- }
- function CN(t, e) {
- var n,
- a = Object.keys(t);
- return Object.getOwnPropertySymbols && (n = Object.getOwnPropertySymbols(t), e && (n = n.filter(function (e) {
- return Object.getOwnPropertyDescriptor(t, e).enumerable
- })), a.push.apply(a, n)),
- a
- }
- function RN(t) {
- for (var e = 1; e < arguments.length; e++) {
- var n = null != arguments[e] ? arguments[e] : {
- };
- e % 2 ? CN(Object(n), !0).forEach(function (e) {
- IN(t, e, n[e])
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(n)) : CN(Object(n)).forEach(function (e) {
- Object.defineProperty(t, e, Object.getOwnPropertyDescriptor(n, e))
- })
- }
- return t
- }
- function xN(e, t) {
- for (var n = 0; n < t.length; n++) {
- var a = t[n];
- a.enumerable = a.enumerable || !1,
- a.configurable = !0,
- 'value' in a && (a.writable = !0),
- Object.defineProperty(e, a.key, a)
- }
- }
- function AN(e, t) {
- return (AN = Object.setPrototypeOf || function (e, t) {
- return e.__proto__ = t,
- e
- }) (e, t)
- }
- function DN(n) {
- var a = function () {
- if ('undefined' == typeof Reflect || !Reflect.construct) return !1;
- if (Reflect.construct.sham) return !1;
- if ('function' == typeof Proxy) return !0;
- try {
- return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [
- ], function () {
- })),
- !0
- } catch (e) {
- return !1
- }
- }();
- return function () {
- var e,
- t = TN(n);
- return e = a ? (e = TN(this).constructor, Reflect.construct(t, arguments, e)) : t.apply(this, arguments),
- t = this,
- !(e = e) || 'object' !== NN(e) && 'function' != typeof e ? jN(t) : e
- }
- }
- function jN(e) {
- if (void 0 === e) throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called');
- return e
- }
- function TN(e) {
- return (TN = Object.setPrototypeOf ? Object.getPrototypeOf : function (e) {
- return e.__proto__ || Object.getPrototypeOf(e)
- }) (e)
- }
- function IN(e, t, n) {
- return t in e ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n,
- e
- }
- var qN = {
- enter: 13,
- return : 13,
- esc: 27,
- escape: 27,
- backspace: 8
- },
- FN = je.a.chain(qN).values().reduce(function (e, t) {
- return e[t] = !0,
- e
- }, {
- }).value(),
- i = function () {
- !function (e, t) {
- if ('function' != typeof t && null !== t) throw new TypeError('Super expression must either be null or a function');
- e.prototype = Object.create(t && t.prototype, {
- constructor: {
- value: e,
- writable: !0,
- configurable: !0
- }
- }),
- t && AN(e, t)
- }(o, A);
- var e,
- t,
- n,
- a = DN(o);
- function o() {
- var r;
- !function (e, t) {
- if (!(e instanceof t)) throw new TypeError('Cannot call a class as a function')
- }(this, o);
- for (var e = arguments.length, t = Array(e), n = 0; n < e; n++) t[n] = arguments[n];
- return IN(jN(r = a.call.apply(a, [
- this
- ].concat(t))), 'defaults', {
- exclude: [
- 'input',
- 'textarea'
- ]
- }),
- IN(jN(r), 'state', {
- shortcuts: {
- }
- }),
- IN(jN(r), 'addMultiple', function (e) {
- je.a.reduce(e, function (e, t) {
- return je.a.partial(this.add, t.keyName, t.callback, t.options, e)
- }, je.a.noop, jN(r)) ()
- }),
- IN(jN(r), 'add', function (e, t, n, a) {
- 1 === e.split(/\s+/).length && (n = RN(RN({
- }, r.defaults), n), e = qN.hasOwnProperty(e.toLowerCase()) ? qN[e.toLowerCase()] : e.charCodeAt(0), (n = r.state.shortcuts[e] || {
- callbacks: [
- ],
- options: n
- }).callbacks.push(t), r.setState({
- shortcuts: je.a.defaults(IN({
- }, e, n), r.state.shortcuts)
- }, a))
- }),
- IN(jN(r), 'remove', function (e) {
- e = e.toLowerCase(),
- r.state.shortcuts.hasOwnProperty(e) && r.setState({
- shortcuts: je.a.defaults(IN({
- }, e, void 0), r.state.shortcuts)
- })
- }),
- IN(jN(r), 'handleKeyEvent', function (t) {
- var n,
- a;
- t.ctrlKey || t.altKey || t.metaKey || !je.a.size(r.state.shortcuts) || (n = t.which, 'keydown' === t.type && !FN.hasOwnProperty(n) || 'keypress' === t.type && FN.hasOwnProperty(n) || r.state.shortcuts.hasOwnProperty(n) && (a = r.state.shortcuts[n].options || r.defaults, je.a.each(r.state.shortcuts[n].callbacks, function (e) {
- 27 !== n && a.exclude.some(function (e) {
- return e.toLowerCase() == t.target.tagName.toLowerCase()
- }) || (e(t), t.preventDefault())
- })))
- }),
- IN(jN(r), 'getComponentProps', function () {
- return {
- addHotkeys: r.addMultiple,
- removeHotkey: r.remove
- }
- }),
- r
- }
- return e = o,
- (t = [
- {
- key: 'componentDidMount',
- value: function () {
- var e = window.document;
- e.addEventListener('keydown', this.handleKeyEvent),
- e.addEventListener('keypress', this.handleKeyEvent)
- }
- },
- {
- key: 'componentWillUnmount',
- value: function () {
- var e = window.document;
- e.removeEventListener('keydown', this.handleKeyEvent),
- e.removeEventListener('keypress', this.handleKeyEvent)
- }
- }
- ]) && xN(e.prototype, t),
- n && xN(e, n),
- o
- }();
- IN(i, 'displayName', 'HotkeysDriver');
- yl = Object(ki.createDriver) (i);
- function LN(e) {
- return (LN = 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator ? function (e) {
- return typeof e
- }
- : function (e) {
- return e && 'function' == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? 'symbol' : typeof e
- }) (e)
- }
- function UN(e, t) {
- for (var n = 0; n < t.length; n++) {
- var a = t[n];
- a.enumerable = a.enumerable || !1,
- a.configurable = !0,
- 'value' in a && (a.writable = !0),
- Object.defineProperty(e, a.key, a)
- }
- }
- function MN(e, t) {
- return (MN = Object.setPrototypeOf || function (e, t) {
- return e.__proto__ = t,
- e
- }) (e, t)
- }
- function BN(n) {
- var a = function () {
- if ('undefined' == typeof Reflect || !Reflect.construct) return !1;
- if (Reflect.construct.sham) return !1;
- if ('function' == typeof Proxy) return !0;
- try {
- return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [
- ], function () {
- })),
- !0
- } catch (e) {
- return !1
- }
- }();
- return function () {
- var e,
- t = HN(n);
- return e = a ? (e = HN(this).constructor, Reflect.construct(t, arguments, e)) : t.apply(this, arguments),
- t = this,
- !(e = e) || 'object' !== LN(e) && 'function' != typeof e ? zN(t) : e
- }
- }
- function zN(e) {
- if (void 0 === e) throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called');
- return e
- }
- function HN(e) {
- return (HN = Object.setPrototypeOf ? Object.getPrototypeOf : function (e) {
- return e.__proto__ || Object.getPrototypeOf(e)
- }) (e)
- }
- function GN(e, t, n) {
- return t in e ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n,
- e
- }
- h = function () {
- !function (e, t) {
- if ('function' != typeof t && null !== t) throw new TypeError('Super expression must either be null or a function');
- e.prototype = Object.create(t && t.prototype, {
- constructor: {
- value: e,
- writable: !0,
- configurable: !0
- }
- }),
- t && MN(e, t)
- }(o, A);
- var e,
- t,
- n,
- r = BN(o);
- function o() {
- var t;
- !function (e, t) {
- if (!(e instanceof t)) throw new TypeError('Cannot call a class as a function')
- }(this, o);
- for (var e = arguments.length, n = Array(e), a = 0; a < e; a++) n[a] = arguments[a];
- return GN(zN(t = r.call.apply(r, [
- this
- ].concat(n))), 'onOpen', function () {
- t.props.emitTrackingEvent({
- verb: 'view',
- object_type: 'area'
- })
- }),
- GN(zN(t), 'onButtonClick', function (e) {
- t.props.emitTrackingEvent({
- verb: 'click',
- object_type: 'button',
- adverb: e
- })
- }),
- t
- }
- return e = o,
- (t = [
- {
- key: 'componentDidMount',
- value: function () {
- this.props.isOpen && this.onOpen()
- }
- },
- {
- key: 'componentWillReceiveProps',
- value: function (e) {
- !this.props.isOpen && e.isOpen && this.onOpen()
- }
- },
- {
- key: 'render',
- value: function () {
- var e = this;
- return C.a.createElement('section', {
- className: 'featured-message__moderation-rules'
- }, C.a.createElement('div', {
- className: 'icon icon-star-fourpoint -one'
- }), C.a.createElement('div', {
- className: 'icon icon-star-fourpoint -two'
- }), C.a.createElement('div', {
- className: 'icon icon-star-fourpoint -three'
- }), C.a.createElement('div', {
- className: 'icon icon-star-fourpoint -four'
- }), C.a.createElement('div', {
- className: 'icon icon-star-fourpoint -five'
- }), C.a.createElement('div', {
- className: 'icon icon-star-fourpoint -six'
- }), C.a.createElement('div', {
- className: 'icon icon-star-fourpoint -seven'
- }), C.a.createElement('div', {
- className: 'icon icon-star-fourpoint -eight'
- }), C.a.createElement('div', {
- className: 'icon icon-star-fourpoint -nine'
- }), C.a.createElement('div', {
- className: 'icon icon-star-fourpoint -ten'
- }), C.a.createElement('div', {
- className: 'icon icon-star-fourpoint -eleven'
- }), C.a.createElement('div', {
- className: 'admin-modal__header align align--column align--middle',
- key: 'header'
- }, C.a.createElement('h3', {
- className: 'text-large'
- }, 'New for You!'), C.a.createElement('img', {
- className: 'img-responsive spacing-top-small',
- style: {
- marginLeft: '55px'
- },
- src: '//c.disquscdn.com/next/current/publisher-admin/assets/img/pam-new.svg'
- })), C.a.createElement('div', {
- className: 'admin-modal__content text-gray',
- key: 'content'
- }, C.a.createElement('p', {
- className: 'spacing-bottom spacing-top'
- }, C.a.createElement('strong', null, 'Moderation Rules are new to the moderation panel!')), C.a.createElement('p', {
- className: 'spacing-bottom'
- }, 'Tired of moderating the same types of comments the same way over and over? You can now create a moderation rule that will automatically perform an action based on the comment criteria that you choose.'), C.a.createElement('p', null, 'We plan to make updates and continually improve this feature, so be sure to leave us feedback via the Pam widget on the right!')), C.a.createElement('div', {
- className: 'admin-modal__footer align align--between',
- key: 'footer'
- }, C.a.createElement('button', {
- className: 'button button-fill button-small button-wide spacing-right-large',
- onClick: function () {
- e.onButtonClick('dismiss'),
- e.props.onClose()
- }
- }, 'Thanks, I\'ll check it out later'), C.a.createElement(v.Link, {
- className: 'button button-fill--brand button-small button-wide',
- to: '/settings/moderation/',
- onClick: this.onButtonClick.bind(this, 'continue')
- }, 'Take me to the Moderation Rules')))
- }
- }
- ]) && UN(e.prototype, t),
- n && UN(e, n),
- o
- }();
- GN(h, 'propTypes', {
- onClose: b.a.func.isRequired,
- isOpen: b.a.bool.isRequired,
- emitTrackingEvent: b.a.func.isRequired
- });
- var VN = {
- moderationRules: {
- modalContent: Object(u.connect) (null, {
- emitTrackingEvent: Xo({
- zone: 'moderation_panel',
- section: 'welcome',
- area: 'modal',
- product: 'publisher_admin',
- object_id: 'moderation_rules',
- adjective: 'new_feature'
- })
- }) (h)
- }
- };
- function WN(e) {
- return function (t) {
- io.a.call('announcements/messages/checkViewed', {
- data: {
- message: e.messageIds
- }
- }).success(function (e) {
- t({
- type: Q.onFetchViewStatus,
- response: e.response
- })
- })
- }
- }
- function YN(r) {
- return function (a) {
- io.a.call('announcements/messages/view', {
- method: 'POST',
- data: {
- message: r.messageId
- }
- }).success(function () {
- var e,
- t,
- n;
- a({
- type: Q.onFetchViewStatus,
- response: (n = !0, (t = r.messageId) in (e = {
- }) ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n, e)
- })
- })
- }
- }
- function QN(e) {
- return (QN = 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator ? function (e) {
- return typeof e
- }
- : function (e) {
- return e && 'function' == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? 'symbol' : typeof e
- }) (e)
- }
- function KN(e, t) {
- for (var n = 0; n < t.length; n++) {
- var a = t[n];
- a.enumerable = a.enumerable || !1,
- a.configurable = !0,
- 'value' in a && (a.writable = !0),
- Object.defineProperty(e, a.key, a)
- }
- }
- function JN(e, t) {
- return (JN = Object.setPrototypeOf || function (e, t) {
- return e.__proto__ = t,
- e
- }) (e, t)
- }
- function $N(n) {
- var a = function () {
- if ('undefined' == typeof Reflect || !Reflect.construct) return !1;
- if (Reflect.construct.sham) return !1;
- if ('function' == typeof Proxy) return !0;
- try {
- return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [
- ], function () {
- })),
- !0
- } catch (e) {
- return !1
- }
- }();
- return function () {
- var e,
- t = XN(n);
- return e = a ? (e = XN(this).constructor, Reflect.construct(t, arguments, e)) : t.apply(this, arguments),
- t = this,
- !(e = e) || 'object' !== QN(e) && 'function' != typeof e ? ZN(t) : e
- }
- }
- function ZN(e) {
- if (void 0 === e) throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called');
- return e
- }
- function XN(e) {
- return (XN = Object.setPrototypeOf ? Object.getPrototypeOf : function (e) {
- return e.__proto__ || Object.getPrototypeOf(e)
- }) (e)
- }
- function eC(t, e) {
- var n,
- a = Object.keys(t);
- return Object.getOwnPropertySymbols && (n = Object.getOwnPropertySymbols(t), e && (n = n.filter(function (e) {
- return Object.getOwnPropertyDescriptor(t, e).enumerable
- })), a.push.apply(a, n)),
- a
- }
- function tC(t) {
- for (var e = 1; e < arguments.length; e++) {
- var n = null != arguments[e] ? arguments[e] : {
- };
- e % 2 ? eC(Object(n), !0).forEach(function (e) {
- nC(t, e, n[e])
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(n)) : eC(Object(n)).forEach(function (e) {
- Object.defineProperty(t, e, Object.getOwnPropertyDescriptor(n, e))
- })
- }
- return t
- }
- function nC(e, t, n) {
- return t in e ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n,
- e
- }
- var Ru = function (i) {
- function e(a) {
- var e,
- t;
- return Object(u.connect) (function (e) {
- return tC({
- }, e.featuredMessages)
- }, {
- fetchFeaturedMessagesViewStatuses: WN,
- markFeaturedMessageAsViewed: YN
- }) ((t = e = function () {
- !function (e, t) {
- if ('function' != typeof t && null !== t) throw new TypeError('Super expression must either be null or a function');
- e.prototype = Object.create(t && t.prototype, {
- constructor: {
- value: e,
- writable: !0,
- configurable: !0
- }
- }),
- t && JN(e, t)
- }(o, A);
- var e,
- t,
- n,
- r = $N(o);
- function o() {
- var e;
- !function (e, t) {
- if (!(e instanceof t)) throw new TypeError('Cannot call a class as a function')
- }(this, o);
- for (var t = arguments.length, n = Array(t), a = 0; a < t; a++) n[a] = arguments[a];
- return nC(ZN(e = r.call.apply(r, [
- this
- ].concat(n))), 'state', {
- isOpen: !1,
- currentMessageId: null,
- messageViewable: i.reduce(function (e, t) {
- return tC(tC({
- }, e), {
- }, nC({
- }, t, !1))
- }, {
- })
- }),
- nC(ZN(e), 'getComponentProps', function () {
- return {
- showFeaturedMessage: e.showFeaturedMessage
- }
- }),
- nC(ZN(e), 'onClose', function () {
- e.setState({
- isOpen: !1
- })
- }),
- nC(ZN(e), 'onOpen', function () {
- e.props.markFeaturedMessageAsViewed({
- messageId: e.state.currentMessageId
- })
- }),
- nC(ZN(e), 'showFeaturedMessage', function (a, r) {
- return (r = r || e.props).isFetched ? void e.setState(function (n) {
- var t = i.reduce(function (e, t) {
- return tC(tC({
- }, e), {
- }, nC({
- }, t, VN[t] && (n.messageViewable[t] || !!~a.indexOf(t))))
- }, {
- }),
- e = a.filter(function (e) {
- return !1 === r.userHasViewedMessages[e] && t[e]
- }) [0];
- return {
- isOpen: void 0 !== e,
- currentMessageId: e,
- messageViewable: t
- }
- }) : (e.onFetchFeaturedMessagesViewStatuses = e.onFetchFeaturedMessagesViewStatuses || [
- ], void e.onFetchFeaturedMessagesViewStatuses.push(e.showFeaturedMessage.bind(ZN(e), a)))
- }),
- e
- }
- return e = o,
- (t = [
- {
- key: 'componentDidMount',
- value: function () {
- this.props.fetchFeaturedMessagesViewStatuses({
- messageIds: i
- })
- }
- },
- {
- key: 'componentWillReceiveProps',
- value: function (t) {
- t.isFetched && !this.props.isFetched && this.onFetchFeaturedMessagesViewStatuses && (this.onFetchFeaturedMessagesViewStatuses.forEach(function (e) {
- e(t)
- }), this.onFetchFeaturedMessagesViewStatuses = null)
- }
- },
- {
- key: 'render',
- value: function () {
- var e = tC(tC({
- }, this.props), this.getComponentProps()),
- t = (VN[this.state.currentMessageId] || {
- }).modalContent;
- return C.a.createElement('section', null, C.a.createElement(_.a, {
- isOpen: this.state.isOpen,
- onRequestClose: this.onClose,
- onAfterOpen: this.onOpen,
- className: 'admin-modal -clipped -wider padding-double '.concat(this.state.modalClass || ''),
- overlayClassName: 'modal-overlay -dark'
- }, t ? C.a.createElement(t, {
- isOpen: this.state.isOpen,
- onClose: this.onClose
- }) : null), C.a.createElement(a, e))
- }
- }
- ]) && KN(e.prototype, t),
- n && KN(e, n),
- o
- }(), nC(e, 'displayName', ''.concat(a.displayName, ':').concat(n)), nC(e, 'propTypes', {
- userHasViewedMessages: function (e, t, n, a, r) {
- var o;
- if (Object.keys(o = e[t]).some(function (e) {
- return 'boolean' != typeof o[e]
- })) return Error('The '.concat(a, ' `').concat(r || t, '` in `').concat(n, '` is expected to map string keys to boolean values.'))
- },
- isFetched: b.a.bool.isRequired,
- fetchFeaturedMessagesViewStatuses: b.a.func.isRequired,
- markFeaturedMessageAsViewed: b.a.func.isRequired
- }), t))
- }
- var n = 'FeaturedMessageDriver';
- return e.driverName = n,
- e.isDriver = !0,
- e
- },
- Yc = n(494),
- aC = n.n(Yc);
- function rC(e, t) {
- for (var n = 0, a = Array(t = null == t || e.length < t ? e.length : t); n < t; n++) a[n] = e[n];
- return a
- }
- function oC(e) {
- var t = e.badge,
- n = e.user;
- return C.a.createElement('span', {
- id: ''.concat(e.context, '-badge_').concat(n.id, '-').concat(t.id),
- className: 'user-badge badge-tooltip__wrapper',
- 'data-role': 'user-badge',
- onClick: function (e) {
- return e.stopPropagation()
- },
- tabIndex: 0
- }, C.a.createElement('img', {
- className: 'user-badge-image',
- src: t.image,
- alt: t.name
- }), C.a.createElement('div', {
- className: 'badge-tooltip__container'
- }, C.a.createElement('div', {
- className: 'tooltip show badge-tooltip'
- }, C.a.createElement('span', {
- className: 'badge-tooltip__content'
- }, t.name))))
- }
- var iC,
- sC = 99999,
- lC = 25000,
- cC = 0,
- uC = 1,
- pC = 2,
- dC = [
- {
- key: We.BADGES_CRITERIA.MANUAL,
- value: We.BADGES_CRITERIA.MANUAL,
- label: 'Manual'
- },
- {
- key: We.BADGES_CRITERIA.COMMENTS,
- value: We.BADGES_CRITERIA.COMMENTS,
- label: 'Number of comments'
- },
- {
- key: We.BADGES_CRITERIA.FEATURED_COMMENTS,
- value: We.BADGES_CRITERIA.FEATURED_COMMENTS,
- label: 'Number of featured comments'
- },
- {
- key: We.BADGES_CRITERIA.COMMENT_UPVOTES,
- value: We.BADGES_CRITERIA.COMMENT_UPVOTES,
- label: 'Number of upvotes on a comment'
- }
- ],
- sl = {
- id: b.a.number.isRequired,
- image: b.a.string,
- name: b.a.string,
- criteria: b.a.oneOf([].concat(function (e) {
- if (Array.isArray(e)) return rC(e)
- }(iC = Object.values(We.BADGES_CRITERIA)) || function (e) {
- if ('undefined' != typeof Symbol && null != e[Symbol.iterator] || null != e['@@iterator']) return Array.from(e)
- }(iC) || function (e, t) {
- if (e) {
- if ('string' == typeof e) return rC(e, t);
- var n = Object.prototype.toString.call(e).slice(8, - 1);
- return 'Map' === (n = 'Object' === n && e.constructor ? e.constructor.name : n) || 'Set' === n ? Array.from(e) : 'Arguments' === n || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n) ? rC(e, t) : void 0
- }
- }(iC) || function () {
- throw new TypeError('Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.')
- }(), [
- ''
- ])),
- target: b.a.number
- },
- mC = {
- image: '',
- name: '',
- criteria: '',
- target: 0,
- imageFile: null,
- isNew: !0,
- isInvalid: !0,
- hasChanges: !1,
- imageErrors: [
- ]
- };
- oC.propTypes = {
- badge: b.a.shape(sl).isRequired,
- user: b.a.shape({
- id: b.a.string.isRequired
- }).isRequired,
- context: b.a.string.isRequired
- };
- i = function (e) {
- var n = e.forum,
- a = e.user,
- r = e.context,
- t = e.limit;
- if (!n.settings.badgesEnabled || !a || a.isAnonymous || !a.badges || !a.badges.length) return null;
- var e = t < a.badges.length,
- o = e ? t - 1 : t;
- return C.a.createElement('span', {
- 'data-role': 'badges',
- className: 'user-badges-collection'
- }, a.badges.map(function (e, t) {
- return t < o ? C.a.createElement(oC, {
- key: t,
- badge: e,
- user: a,
- forumId: n.id,
- context: r
- }) : null
- }), e ? C.a.createElement('span', {
- className: 'user-badge truncate-badge publisher-background-color',
- 'data-role': 'user-badge',
- tabIndex: 0
- }, C.a.createElement('span', {
- className: 'user-badge-more'
- }, '+', a.badges.length - o)) : null)
- };
- i.propTypes = {
- forum: b.a.shape({
- id: b.a.string.isRequired,
- settings: b.a.shape({
- badgesEnabled: b.a.bool.isRequired
- }).isRequired
- }).isRequired,
- user: b.a.shape({
- id: b.a.string,
- badges: b.a.arrayOf(b.a.shape(sl))
- }).isRequired,
- context: b.a.string.isRequired,
- limit: b.a.number.isRequired
- };
- var fC = i;
- function hC(e) {
- return (hC = 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator ? function (e) {
- return typeof e
- }
- : function (e) {
- return e && 'function' == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? 'symbol' : typeof e
- }) (e)
- }
- function gC(e, t) {
- for (var n = 0; n < t.length; n++) {
- var a = t[n];
- a.enumerable = a.enumerable || !1,
- a.configurable = !0,
- 'value' in a && (a.writable = !0),
- Object.defineProperty(e, a.key, a)
- }
- }
- function yC(e, t) {
- return (yC = Object.setPrototypeOf || function (e, t) {
- return e.__proto__ = t,
- e
- }) (e, t)
- }
- function bC(n) {
- var a = function () {
- if ('undefined' == typeof Reflect || !Reflect.construct) return !1;
- if (Reflect.construct.sham) return !1;
- if ('function' == typeof Proxy) return !0;
- try {
- return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [
- ], function () {
- })),
- !0
- } catch (e) {
- return !1
- }
- }();
- return function () {
- var e,
- t = _C(n);
- return e = a ? (e = _C(this).constructor, Reflect.construct(t, arguments, e)) : t.apply(this, arguments),
- t = this,
- !(e = e) || 'object' !== hC(e) && 'function' != typeof e ? vC(t) : e
- }
- }
- function vC(e) {
- if (void 0 === e) throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called');
- return e
- }
- function _C(e) {
- return (_C = Object.setPrototypeOf ? Object.getPrototypeOf : function (e) {
- return e.__proto__ || Object.getPrototypeOf(e)
- }) (e)
- }
- function EC(e, t, n) {
- return t in e ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n,
- e
- }
- h = function () {
- !function (e, t) {
- if ('function' != typeof t && null !== t) throw new TypeError('Super expression must either be null or a function');
- e.prototype = Object.create(t && t.prototype, {
- constructor: {
- value: e,
- writable: !0,
- configurable: !0
- }
- }),
- t && yC(e, t)
- }(o, A);
- var e,
- t,
- n,
- r = bC(o);
- function o() {
- var t;
- !function (e, t) {
- if (!(e instanceof t)) throw new TypeError('Cannot call a class as a function')
- }(this, o);
- for (var e = arguments.length, n = Array(e), a = 0; a < e; a++) n[a] = arguments[a];
- return EC(vC(t = r.call.apply(r, [
- this
- ].concat(n))), 'handleClick', function (e) {
- if (!e || !e.nativeEvent || 1 === e.nativeEvent.which) return e.preventDefault(),
- t.props.showUserPanel(t.props.post),
- !1
- }),
- t
- }
- return e = o,
- (t = [
- {
- key: 'render',
- value: function () {
- return C.a.createElement('a', {
- href: this.props.post.author.profileUrl,
- className: 'profile-launcher',
- onClick: this.handleClick
- }, this.props.contents)
- }
- }
- ]) && gC(e.prototype, t),
- n && gC(e, n),
- o
- }();
- EC(h, 'propTypes', {
- contents: b.a.object.isRequired,
- showUserPanel: b.a.func.isRequired,
- post: b.a.shape({
- author: b.a.object.isRequired,
- ipAddress: b.a.string
- }).isRequired
- });
- var OC = h;
- function SC(e) {
- return (SC = 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator ? function (e) {
- return typeof e
- }
- : function (e) {
- return e && 'function' == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? 'symbol' : typeof e
- }) (e)
- }
- function wC(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) {
- var a,
- r,
- o = [
- ],
- i = !0,
- s = !1;
- try {
- for (n = n.call(e); !(i = (a = n.next()).done) && (o.push(a.value), !t || o.length !== t); i = !0);
- } catch (e) {
- s = !0,
- r = e
- } finally {
- try {
- i || null == n.return || n.return()
- } finally {
- if (s) throw r
- }
- }
- return o
- }
- }(e, t) || function (e, t) {
- if (e) {
- if ('string' == typeof e) return PC(e, t);
- var n = Object.prototype.toString.call(e).slice(8, - 1);
- return 'Map' === (n = 'Object' === n && e.constructor ? e.constructor.name : n) || 'Set' === n ? Array.from(e) : 'Arguments' === n || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n) ? PC(e, t) : void 0
- }
- }(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 PC(e, t) {
- for (var n = 0, a = Array(t = null == t || e.length < t ? e.length : t); n < t; n++) a[n] = e[n];
- return a
- }
- function kC(e, t) {
- for (var n = 0; n < t.length; n++) {
- var a = t[n];
- a.enumerable = a.enumerable || !1,
- a.configurable = !0,
- 'value' in a && (a.writable = !0),
- Object.defineProperty(e, a.key, a)
- }
- }
- function NC(e, t) {
- return (NC = Object.setPrototypeOf || function (e, t) {
- return e.__proto__ = t,
- e
- }) (e, t)
- }
- function CC(n) {
- var a = function () {
- if ('undefined' == typeof Reflect || !Reflect.construct) return !1;
- if (Reflect.construct.sham) return !1;
- if ('function' == typeof Proxy) return !0;
- try {
- return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [
- ], function () {
- })),
- !0
- } catch (e) {
- return !1
- }
- }();
- return function () {
- var e,
- t = xC(n);
- return e = a ? (e = xC(this).constructor, Reflect.construct(t, arguments, e)) : t.apply(this, arguments),
- t = this,
- !(e = e) || 'object' !== SC(e) && 'function' != typeof e ? RC(t) : e
- }
- }
- function RC(e) {
- if (void 0 === e) throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called');
- return e
- }
- function xC(e) {
- return (xC = Object.setPrototypeOf ? Object.getPrototypeOf : function (e) {
- return e.__proto__ || Object.getPrototypeOf(e)
- }) (e)
- }
- function AC(e, t, n) {
- return t in e ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n,
- e
- }
- var DC = {
- badWords: 'Restricted Word',
- links: 'Contains Link',
- anonymous: 'Guest Comment',
- media: 'Contains Media',
- toxic: 'Toxic',
- bullying: 'Bullying',
- hate: 'Hate Speech',
- violent: 'Violence',
- sexual: 'Sexual',
- promotion: 'Promotion',
- spam: 'Spam',
- shadowBannedGlobal: 'Shadow Banned Globally',
- isNewUserNeedsApproval: 'New Commenter'
- },
- jC = [
- 'bullying',
- 'hate',
- 'violent',
- 'sexual',
- 'promotion'
- ],
- Yc = function () {
- !function (e, t) {
- if ('function' != typeof t && null !== t) throw new TypeError('Super expression must either be null or a function');
- e.prototype = Object.create(t && t.prototype, {
- constructor: {
- value: e,
- writable: !0,
- configurable: !0
- }
- }),
- t && NC(e, t)
- }(o, A);
- var e,
- t,
- n,
- r = CC(o);
- function o() {
- var n;
- !function (e, t) {
- if (!(e instanceof t)) throw new TypeError('Cannot call a class as a function')
- }(this, o);
- for (var e = arguments.length, t = Array(e), a = 0; a < e; a++) t[a] = arguments[a];
- return AC(RC(n = r.call.apply(r, [
- this
- ].concat(t))), 'handleFlaggercardAfterShow', function () {
- n.props.emitTrackingEvent({
- verb: 'hover',
- object_type: 'label',
- object_id: 'flagged_post',
- extra_data: JSON.stringify({
- number_of_flags: n.props.numReports
- })
- })
- }),
- AC(RC(n), 'handleFlaggerClick', function (e) {
- n.props.emitTrackingEvent({
- verb: 'click',
- object_type: 'user',
- object_id: e.username
- })
- }),
- AC(RC(n), 'getPostLabels', function () {
- var e,
- t = [
- ];
- return !n.props.reputationLabel || 'Average' !== (e = n.props.reputationLabel.split(' ') [0]) && t.push({
- key: ''.concat(e.toLowerCase(), 'Rep'),
- content: ''.concat(e, ' Rep')
- }),
- n.props.shadowBanned && t.push({
- key: 'shadowBanned',
- content: 'Shadow Banned'
- }),
- n.props.moderationLabels && (0 === n.props.moderationLabels.length ? t.push({
- key: 'noIssue',
- content: 'No issue detected'
- }) : t = t.concat(n.props.moderationLabels.filter(function (e) {
- var t = n.props.hasAllModRules || yo.a.isFeatureActive('thehive', {
- forum: n.props.forum.id
- });
- return !(~jC.indexOf(e) && !t) && DC[e.split(':').shift()]
- }).map(function (e) {
- var t = wC(e.split(':'), 2),
- n = t[0],
- e = t[1],
- t = DC[n];
- return e && (t += ' - '.concat(e)),
- {
- key: n,
- className: e ? '-severity'.concat(e) : '',
- content: t
- }
- }))),
- n.props.numReports ? t.push({
- key: 'flagged',
- className: 'flaggercard-trigger',
- content: [
- C.a.createElement(Md, {
- key: 'flaggerCard',
- tooltipKey: 'flaggerCard',
- direction: 'top',
- additionalClass: 'hovercard flagger-card',
- onShow: function () {
- n.props.flaggers && n.props.numReports === n.props.flaggers.length || n.props.fetchAllFlaggers(),
- n.handleFlaggercardAfterShow()
- },
- content: C.a.createElement(C.a.Fragment, null, C.a.createElement('div', {
- className: 'hovercard__content flagger-card__content',
- onClick: function (e) {
- e.stopPropagation()
- }
- }, 'Flagged by ', n.props.flaggers && n.props.flaggers.length ? n.props.flaggers.map(function (e) {
- return e.name ? C.a.createElement('a', {
- className: 'flagger-card__link',
- href: e.profileUrl,
- target: '_blank',
- rel: 'noopener noreferrer',
- onClick: n.handleFlaggerClick.bind(RC(n), e),
- key: e.name
- }, e.name) : null
- }) : 'Unknown'))
- }, C.a.createElement('span', {
- key: 'flaggercardTrigger',
- 'data-tip': !0,
- 'data-for': 'flaggerCard-'.concat(n.props.postId)
- }, C.a.createElement('span', {
- className: 'icon-person icon__position spacing-right-small'
- }), 1 === n.props.numReports ? 'Flagged once' : 'Flagged '.concat(n.props.numReports, ' times')))
- ]
- }) : n.props.numReports && t.push({
- key: 'flagged',
- content: 'Flagged '.concat(n.props.numReports, ' times')
- }),
- t
- }),
- n
- }
- return e = o,
- (t = [
- {
- key: 'render',
- value: function () {
- return C.a.createElement('ul', {
- className: 'badge--post-label__list'
- }, this.getPostLabels().map(function (e) {
- return C.a.createElement('li', {
- key: e.key,
- className: 'badge--post-label -'.concat(e.key, ' ').concat(e.className || '').trim()
- }, e.content)
- }))
- }
- }
- ]) && kC(e.prototype, t),
- n && kC(e, n),
- o
- }();
- AC(Yc, 'propTypes', {
- moderationLabels: b.a.arrayOf(b.a.string),
- numReports: b.a.number.isRequired,
- shadowBanned: b.a.bool.isRequired,
- postId: b.a.string.isRequired,
- emitTrackingEvent: b.a.func.isRequired,
- reputationLabel: b.a.string,
- flaggers: b.a.arrayOf(b.a.shape({
- name: b.a.string.isRequired,
- username: b.a.string.isRequired,
- profileUrl: b.a.string.isRequired
- })),
- fetchAllFlaggers: b.a.func.isRequired,
- forum: b.a.shape({
- id: b.a.string.isRequired
- }).isRequired,
- hasAllModRules: b.a.bool.isRequired
- });
- var TC = Object(u.connect) (null, {
- emitTrackingEvent: Xo({
- zone: 'moderation_panel',
- area: 'post_label'
- })
- }) (Yc),
- i = n(100),
- IC = n.n(i);
- function qC(e) {
- return (qC = 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator ? function (e) {
- return typeof e
- }
- : function (e) {
- return e && 'function' == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? 'symbol' : typeof e
- }) (e)
- }
- function FC(t, e) {
- var n,
- a = Object.keys(t);
- return Object.getOwnPropertySymbols && (n = Object.getOwnPropertySymbols(t), e && (n = n.filter(function (e) {
- return Object.getOwnPropertyDescriptor(t, e).enumerable
- })), a.push.apply(a, n)),
- a
- }
- function LC(t) {
- for (var e = 1; e < arguments.length; e++) {
- var n = null != arguments[e] ? arguments[e] : {
- };
- e % 2 ? FC(Object(n), !0).forEach(function (e) {
- YC(t, e, n[e])
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(n)) : FC(Object(n)).forEach(function (e) {
- Object.defineProperty(t, e, Object.getOwnPropertyDescriptor(n, e))
- })
- }
- return t
- }
- function UC() {
- return (UC = Object.assign || function (e) {
- for (var t = 1; t < arguments.length; t++) {
- var n,
- a = arguments[t];
- for (n in a) Object.prototype.hasOwnProperty.call(a, n) && (e[n] = a[n])
- }
- return e
- }).apply(this, arguments)
- }
- function MC(e) {
- return function (e) {
- if (Array.isArray(e)) return BC(e)
- }(e) || function (e) {
- if ('undefined' != typeof Symbol && null != e[Symbol.iterator] || null != e['@@iterator']) return Array.from(e)
- }(e) || function (e, t) {
- if (e) {
- if ('string' == typeof e) return BC(e, t);
- var n = Object.prototype.toString.call(e).slice(8, - 1);
- return 'Map' === (n = 'Object' === n && e.constructor ? e.constructor.name : n) || 'Set' === n ? Array.from(e) : 'Arguments' === n || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n) ? BC(e, t) : void 0
- }
- }(e) || function () {
- throw new TypeError('Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.')
- }()
- }
- function BC(e, t) {
- for (var n = 0, a = Array(t = null == t || e.length < t ? e.length : t); n < t; n++) a[n] = e[n];
- return a
- }
- function zC(e, t) {
- for (var n = 0; n < t.length; n++) {
- var a = t[n];
- a.enumerable = a.enumerable || !1,
- a.configurable = !0,
- 'value' in a && (a.writable = !0),
- Object.defineProperty(e, a.key, a)
- }
- }
- function HC(e, t) {
- return (HC = Object.setPrototypeOf || function (e, t) {
- return e.__proto__ = t,
- e
- }) (e, t)
- }
- function GC(n) {
- var a = function () {
- if ('undefined' == typeof Reflect || !Reflect.construct) return !1;
- if (Reflect.construct.sham) return !1;
- if ('function' == typeof Proxy) return !0;
- try {
- return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [
- ], function () {
- })),
- !0
- } catch (e) {
- return !1
- }
- }();
- return function () {
- var e,
- t = WC(n);
- return e = a ? (e = WC(this).constructor, Reflect.construct(t, arguments, e)) : t.apply(this, arguments),
- t = this,
- !(e = e) || 'object' !== qC(e) && 'function' != typeof e ? VC(t) : e
- }
- }
- function VC(e) {
- if (void 0 === e) throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called');
- return e
- }
- function WC(e) {
- return (WC = Object.setPrototypeOf ? Object.getPrototypeOf : function (e) {
- return e.__proto__ || Object.getPrototypeOf(e)
- }) (e)
- }
- function YC(e, t, n) {
- return t in e ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n,
- e
- }
- h = function () {
- !function (e, t) {
- if ('function' != typeof t && null !== t) throw new TypeError('Super expression must either be null or a function');
- e.prototype = Object.create(t && t.prototype, {
- constructor: {
- value: e,
- writable: !0,
- configurable: !0
- }
- }),
- t && HC(e, t)
- }(o, A);
- var e,
- t,
- n,
- r = GC(o);
- function o() {
- var a;
- !function (e, t) {
- if (!(e instanceof t)) throw new TypeError('Cannot call a class as a function')
- }(this, o);
- for (var e = arguments.length, t = Array(e), n = 0; n < e; n++) t[n] = arguments[n];
- return YC(VC(a = r.call.apply(r, [
- this
- ].concat(t))), 'state', {
- isEditing: !1,
- isSaving: !1,
- isReplying: !1,
- isExpanded: a.props.allExpanded,
- isCollapsible: !1,
- editInputContent: a.props.raw_message
- }),
- YC(VC(a), 'messageRef', C.a.createRef()),
- YC(VC(a), 'editInput', C.a.createRef()),
- YC(VC(a), 'replyInput', C.a.createRef()),
- YC(VC(a), 'node', C.a.createRef()),
- YC(VC(a), 'scrollToNode', function () {
- var e,
- t = a.node.current.getBoundingClientRect(),
- n = window.innerHeight || window.document.documentElement.clientHeight;
- 0 <= t.top && t.bottom <= n || (e = t.top - window.document.body.getBoundingClientRect().top, window.scroll(0, Math.min(e - n / 2 + (t.bottom - t.top) / 2, e)))
- }),
- YC(VC(a), 'updateChecked', function (e) {
- a.props.updateChecked(a.props.id, e.target.checked)
- }),
- YC(VC(a), 'toggleExpanded', function () {
- var e = !a.state.isExpanded;
- a.props.allExpanded && !e && a.props.updateExpanded(e),
- a.setState({
- isExpanded: e
- })
- }),
- YC(VC(a), 'vote', function (e, t, n) {
- e.preventDefault(),
- a.props.updateVote(t, n)
- }),
- YC(VC(a), 'searchByIp', function (e) {
- e.preventDefault(),
- a.props.updateFetchData({
- searchQuery: 'post_ip_lookup:'.concat(a.props.id)
- })
- }),
- YC(VC(a), 'searchByEmail', function (e) {
- e.preventDefault(),
- a.props.updateFetchData({
- searchQuery: 'post_email_lookup:'.concat(a.props.id)
- })
- }),
- YC(VC(a), 'setPostActive', function (e) {
- var t;
- o.isActionableElement(e.target, a.node.current) || (t = je.a.partial(a.props.togglePostPanelVisible, a.props.id)),
- a.props.updateActivePost(a.props.id, t)
- }),
- YC(VC(a), 'startEdit', function (e) {
- 'deleted' !== a.props.status && 'spam' !== a.props.status && (e && e.preventDefault(), a.props.emitTrackingEvent({
- verb: 'click',
- adjective: 'edit',
- object_type: 'link',
- object_id: a.props.id,
- thread_id: a.props.thread.id,
- page_url: a.props.url,
- extra_data: JSON.stringify({
- tab: a.props.activePage
- })
- }), a.state.isEditing ? a.getTextarea('edit').focus() : a.setState({
- isEditing: !0
- }))
- }),
- YC(VC(a), 'startEditHotkey', function (e) {
- a.props.isActive && a.startEdit(e)
- }),
- YC(VC(a), 'saveEdit', function (e) {
- e.preventDefault();
- var t = a.cleanMessage(a.editInput.current.value),
- e = a.validateEdit(t);
- e ? a.showPostError(e) : (a.setState({
- isSaving: !0
- }), a.props.updateMessage(a.props.id, t, a.finishEdit))
- }),
- YC(VC(a), 'finishEdit', function () {
- a.editInput.current.value = '',
- a.clearPostError(),
- a.setState({
- isEditing: !1,
- isSaving: !1
- }),
- a.props.emitTrackingEvent({
- verb: 'update',
- object_type: 'post',
- object_id: a.props.id,
- thread_id: a.props.thread.id,
- page_url: a.props.url,
- extra_data: JSON.stringify({
- tab: a.props.activePage
- })
- })
- }),
- YC(VC(a), 'startReply', function (e) {
- 'deleted' !== a.props.status && 'spam' !== a.props.status && (e && e.preventDefault(), a.state.isReplying ? a.getTextarea('reply').focus() : a.setState({
- isReplying: !0
- }))
- }),
- YC(VC(a), 'startReplyHotkey', function (e) {
- a.props.isActive && a.startReply(e)
- }),
- YC(VC(a), 'saveReply', function (e) {
- e.preventDefault();
- var t = a.cleanMessage(a.replyInput.current.value),
- e = a.validateMessage(t);
- e ? a.showPostError(e) : (a.setState({
- isSaving: !0
- }), a.props.saveReply(a.props.id, t, a.finishReply, je.a.partial(a.showPostError, null, je.a)))
- }),
- YC(VC(a), 'showPostError', function (t, e) {
- try {
- t = t || JSON.parse(e.responseText).response
- } catch (e) {
- t = 'There was an error posting your comment.'
- }
- je.a.isString(t) && ~t.indexOf('verify your email') && (t = C.a.createElement('a', {
- href: 'https://disqus.com/verify',
- target: '_blank',
- rel: 'noopener noreferrer'
- }, t)),
- a.setState({
- isSaving: !1,
- error: t
- })
- }),
- YC(VC(a), 'clearPostError', function () {
- a.setState({
- error: null
- })
- }),
- YC(VC(a), 'finishReply', function () {
- a.replyInput.current.value = '',
- a.clearPostError(),
- a.setState({
- isReplying: !1,
- isSaving: !1
- })
- }),
- YC(VC(a), 'validateMessage', function (e) {
- if (je.a.isString(e)) return '' === e ? 'Comments can\'t be blank.' : e.length < 2 ? 'Comments must have at least 2 characters.' : void 0
- }),
- YC(VC(a), 'validateEdit', function (e) {
- var t = (new Date).toISOString();
- return a.props.editableUntil < t ? C.a.createElement('span', null, 'You can no longer edit this comment. Comments can only be edited within 7 days after posting. ', C.a.createElement('a', {
- href: 'https://help.disqus.com/commenting/remove-and-edit-your-comments',
- target: '_blank',
- rel: 'noopener noreferrer',
- style: {
- color: 'white ! important',
- textDecoration: 'underline'
- }
- }, 'Learn more')) : a.validateMessage(e)
- }),
- YC(VC(a), 'cleanMessage', function (e) {
- return e.replace(/^\s+|\s+$/g, '')
- }),
- YC(VC(a), 'setCollapsibility', function () {
- window.setTimeout(function () {
- a._styles || (a._styles = window.getComputedStyle(a.messageRef.current));
- var e = a.messageRef.current.clientHeight > 2 * ('' + a._styles['line-height'].slice(0, - 2));
- a.setState({
- isCollapsible: e
- })
- }, 0)
- }),
- YC(VC(a), 'getTextarea', function (e) {
- return a[''.concat(e, 'Input')].current
- }),
- YC(VC(a), 'removeFocus', function () {
- a.state.isEditing && a.getTextarea('edit').blur(),
- a.state.isReplying && a.getTextarea('reply').blur()
- }),
- YC(VC(a), 'performSuggestedUserAction', function () {
- var e;
- a.props.suggestedAction && yo.a.isFeatureActive('suggested_user_actions') && ((e = (VP.users[a.props.suggestedAction.userAction] || {
- }).banType) && (a.props.showUserPanel(a.props), a.props.updateBanFormType(e), a.props.updateUserListsModal({
- isOpen: !0,
- listType: 'blacklist'
- })))
- }),
- YC(VC(a), 'hasFeature', function (e) {
- return !!(a.props.saasFeatures && a.props.selection.organization && a.props.saasFeatures[a.props.selection.organization.id] && a.props.saasFeatures[a.props.selection.organization.id][e])
- }),
- a
- }
- return e = o,
- n = [
- {
- key: 'isActionableElement',
- value: function (n, a) {
- return ['a',
- 'button',
- 'input',
- 'textarea'].some(function (e) {
- var t = n;
- do {
- if (t.nodeName.toLowerCase() === e) return !0
- } while ((t = t.parentNode) && t !== a);
- return !1
- })
- }
- }
- ],
- (t = [
- {
- key: 'componentWillReceiveProps',
- value: function (e) {
- e.isActive && !this.props.isActive && this.scrollToNode(),
- e.allExpanded !== this.props.allExpanded && e.allExpanded !== this.state.isExpanded && this.setState({
- isExpanded: e.allExpanded
- })
- }
- },
- {
- key: 'componentDidUpdate',
- value: function (e, t) {
- this.state.isEditing && !t.isEditing && this.getTextarea('edit').focus(),
- this.state.isReplying && !t.isReplying && this.getTextarea('reply').focus(),
- e.message !== this.props.message && this.setCollapsibility()
- }
- },
- {
- key: 'componentDidMount',
- value: function () {
- this.props.selection.organization && this.props.fetchSaasFeatures(this.props.selection.organization.id),
- this.setCollapsibility(),
- this.props.addHotkeys(je.a.map(GP, function (e, t) {
- return je.a.isString(e) && (e = {
- callbackName: e
- }),
- je.a.extend({
- keyName: t,
- callback: je.a.partial.apply(je.a, [
- this[e.callbackName]
- ].concat(MC(e.callbackArgs || [
- ]))),
- options: {
- }
- }, e)
- }, this))
- }
- },
- {
- key: 'getUrl',
- value: function (e) {
- var t = e.tab,
- n = e.search,
- e = e.filters;
- return '/admin'.concat(hN.getUrl({
- tab: t = void 0 === t ? this.props.activePage : t,
- search: n = void 0 === n ? this.props.searchQuery : n,
- filters: e = void 0 === e ? this.props.searchFilters : e
- }))
- }
- },
- {
- key: 'render',
- value: function () {
- var t = this,
- e = {
- },
- n = {
- };
- this.state.isSaving && (n.disabled = e.disabled = !0);
- var a,
- r,
- o,
- i = Ve.a.getFromCookie().staff,
- s = !i && 'deleted' === this.props.status && this.props.isDeletedByAuthor,
- l = window._v5Config.forums[this.props.forum.id],
- c = (new Date).toISOString() < this.props.editableUntil,
- u = l && (l.permissions.canEdit || i) && c && !this.props.thread.isClosed && !this.props.isHighlighted,
- p = i && !u,
- d = Os.prettyDatetime(''.concat(this.props.createdAt, ' GMT')),
- m = Os.prettyDatetime(this.props.createdAt, 'absolute'),
- f = this.props.allExpanded || this.state.isExpanded,
- h = this.props.suggestedAction && (yo.a.isFeatureActive('suggested_user_actions') || VP.posts[this.props.suggestedAction.postAction]);
- this.props.child && (a = Os.prettyDatetime(''.concat(this.props.child.createdAt, ' GMT')), r = Os.prettyDatetime(this.props.child.createdAt, 'absolute')),
- o = ct() ().format(aC.a.ISO_8601) < this.props.editableUntil ? (b = Os.prettyDatetime(''.concat(this.props.editableUntil, ' GMT')), 'You have until '.concat(b, ' to edit this comment. ')) : 'The edit period for this comment has expired. ';
- var g = [
- 'comment-moderate__card',
- this.props.status
- ];
- f || g.push('-collapsed'),
- this.props.hidden && g.push('hidden'),
- this.props.isActive && g.push('has-notch'),
- this.props.isApproved && 'unapproved' === this.props.status && (g = g.filter(function (e) {
- return 'unapproved' !== e
- })).push('approved');
- var g = g.join(' '),
- l = this.state.error ? C.a.createElement(Ki, {
- message: this.state.error,
- alertType: 'error',
- topMarginClass: 'spacing-top-narrow',
- onRequestClose: this.clearPostError
- }) : null,
- y = f ? 'url' : 'thumbnailURL',
- c = C.a.createElement('div', {
- className: this.state.isEditing ? 'hidden' : ''
- }, C.a.createElement('div', {
- className: 'message-wrapper'
- }, C.a.createElement('div', {
- className: 'message',
- ref: this.messageRef,
- dangerouslySetInnerHTML: {
- __html: this.props.modMessage || this.props.message
- }
- })), 0 < this.props.media.length ? C.a.createElement('div', {
- className: 'comment-attachments'
- }, this.props.media.map(function (e, t) {
- return C.a.createElement('button', {
- className: f ? '' : 'more',
- key: t,
- onClick: this.toggleExpanded
- }, e.mediaType === IC.a.MEDIA_TYPES.MP4_VIDEO ? C.a.createElement('video', {
- autoPlay: !0,
- muted: !0,
- loop: !0,
- className: 'img-responsive border-radius-sm',
- src: e[y]
- }) : C.a.createElement('img', {
- className: 'img-responsive border-radius-sm',
- src: e[y]
- }))
- }, this)) : null, this.state.isCollapsible ? C.a.createElement('button', {
- className: 'text-small',
- onClick: this.toggleExpanded
- }, f ? 'less' : 'more') : null),
- i = this.props.selection.type === ft.forum && yo.a.isFeatureActive('spam_and_ban_moderation', {
- forum: this.props.selection.forum.name
- }),
- b = this.hasFeature('unapproveNewUsers') && this.props.forum.settings.unapproveNewUsersEnabled && this.props.isNewUserNeedsApproval && !this.props.author.isNewUserBypassed && this.props.selection.type === ft.forum && yo.a.isFeatureActive('new_user_premoderation', {
- forum: this.props.selection.forum.name
- });
- return C.a.createElement('li', {
- className: g,
- id: 'comment-'.concat(this.props.id),
- onClick: this.setPostActive,
- ref: this.node
- }, C.a.createElement('div', {
- className: 'align align--between align--wrap-mobile'
- }, C.a.createElement('div', {
- className: 'comment-moderate__title truncate-line'
- }, C.a.createElement('span', {
- className: 'spacing-right'
- }, s ? null : C.a.createElement('input', {
- className: 'post-checkbox',
- type: 'checkbox',
- checked: this.props.checked,
- onChange: this.updateChecked
- })), C.a.createElement('a', {
- href: this.props.url,
- target: 'new'
- }, this.props.thread.clean_title)), C.a.createElement(TC, {
- reputationLabel: this.props.author.reputationLabel,
- numReports: this.props.numReports,
- moderationLabels: this.props.moderationLabels,
- shadowBanned: this.props.shadowBanned,
- postId: this.props.id,
- flaggers: this.props.flaggers,
- fetchAllFlaggers: this.props.fetchAllFlaggers,
- forum: this.props.forum,
- hasAllModRules: this.hasFeature('allModRules')
- })), C.a.createElement('div', {
- className: 'comment-moderate__body'
- }, C.a.createElement('div', {
- className: 'spacing-top-narrow spacing-bottom align'
- }, C.a.createElement('div', {
- className: 'spacing-right spacing-top-small'
- }, C.a.createElement(OC, {
- contents: C.a.createElement('img', {
- src: this.props.author.avatar.permalink,
- className: 'comment-moderate__avatar border-radius-sm'
- }),
- showUserPanel: this.props.showUserPanel,
- post: this.props
- })), C.a.createElement('div', {
- className: 'comment-moderate__content'
- }, C.a.createElement('div', {
- className: 'align-min-tablet align--between align--wrap'
- }, C.a.createElement('div', null, C.a.createElement(OC, {
- contents: C.a.createElement('strong', null, this.props.author.name),
- showUserPanel: this.props.showUserPanel,
- post: this.props
- }), C.a.createElement(fC, {
- forum: this.props.forum,
- user: this.props.author,
- context: 'moderation',
- limit: 4
- }), C.a.createElement('a', {
- href: this.props.url,
- target: 'new',
- title: m,
- className: 'link-gray bullet'
- }, C.a.createElement('time', {
- className: 'time-ago'
- }, d)), this.props.isEdited ? C.a.createElement('span', {
- className: 'has-edit bullet'
- }, 'edited') : null), C.a.createElement('div', {
- className: 'spacing-right'
- }, C.a.createElement('span', {
- className: 'comment-author-info'
- }, this.props.author.email ? C.a.createElement('a', {
- href: this.getUrl({
- search: 'post_email_lookup:'.concat(this.props.id)
- }),
- onClick: this.searchByEmail
- }, this.props.author.email) : 'email not available'), C.a.createElement('span', {
- className: 'bullet',
- 'aria-hidden': 'true'
- }), C.a.createElement('a', {
- href: this.getUrl({
- search: 'post_ip_lookup:'.concat(this.props.id)
- }),
- onClick: this.searchByIp
- }, this.props.ipAddress))), C.a.createElement('div', {
- className: 'comment-moderate__message'
- }, C.a.createElement('span', {
- className: 'flag'
- }), c, C.a.createElement('div', {
- className: 'spacing-narrow'.concat(this.state.isEditing ? '' : ' hidden')
- }, C.a.createElement('textarea', {
- className: 'comment-moderate__textarea',
- ref: this.editInput,
- rows: '5',
- value: this.state.editInputContent,
- onChange: function (e) {
- return t.setState({
- editInputContent: e.target.value
- })
- }
- }), this.props.isApproved ? null : C.a.createElement('p', {
- className: 'reply-notice'
- }, 'Editing this comment will also approve it.'), C.a.createElement('div', {
- className: 'time-ago'
- }, o, C.a.createElement('a', {
- href: 'https://help.disqus.com/commenting/remove-and-edit-your-comments',
- target: '_blank',
- rel: 'noopener noreferrer',
- style: {
- color: 'inherit',
- textDecoration: 'underline',
- textAlign: 'center'
- }
- }, 'Learn more')), C.a.createElement('div', null, C.a.createElement('button', {
- className: 'button button-small button-fill--brand spacing-right-small',
- onClick: this.saveEdit
- }, this.state.isSaving ? 'Saving...' : 'Save Edit'), C.a.createElement('button', UC({
- className: 'button button-small button-fill -dark-hover',
- onClick: this.finishEdit
- }, e), 'Cancel'), l)), 'deleted' === this.props.status || 'spam' === this.props.status || this.state.isEditing || this.state.isReplying ? null : C.a.createElement('div', {
- className: 'comment-moderate__vote'
- }, C.a.createElement('a', {
- href: '#',
- className: 'vote-up spacing-right link-gray'.concat(1 === this.props.userScore ? ' active' : ''),
- onClick: je.a.partial(this.vote, je.a, this.props.id, 1)
- }, C.a.createElement('span', {
- className: 'icon-arrow-up icon-tiny'
- }), ' ', C.a.createElement('span', {
- className: 'vote__count text-gray'
- }, this.props.likes)), C.a.createElement('a', {
- href: '#',
- className: 'vote-down spacing-right link-gray'.concat( - 1 === this.props.userScore ? ' active' : ''),
- onClick: je.a.partial(this.vote, je.a, this.props.id, - 1)
- }, C.a.createElement('span', {
- className: 'icon-arrow-down icon-tiny'
- }), ' ', C.a.createElement('span', {
- className: 'vote__count text-gray',
- 'data-role': 'downvotes'
- }, this.props.dislikes)), u ? C.a.createElement('a', {
- href: '#',
- className: 'spacing-right '.concat(p ? ' is-staff-only' : ''),
- onClick: this.startEdit
- }, 'Edit') : null, C.a.createElement('a', {
- href: '#',
- className: 'spacing-right',
- onClick: this.startReply
- }, 'Reply')), this.props.child ? C.a.createElement('div', {
- className: 'spacing-top spacing-bottom align'
- }, C.a.createElement('div', {
- className: 'avatar spacing-top-small'
- }, C.a.createElement(OC, {
- contents: C.a.createElement('img', {
- src: this.props.child.author.avatar.permalink,
- className: 'comment-moderate__avatar border-radius-sm'
- }),
- showUserPanel: this.props.showUserPanel,
- post: this.props.child
- })), C.a.createElement('div', {
- className: 'comment-moderate__content'
- }, C.a.createElement('span', {
- className: 'comment-name'
- }, C.a.createElement(OC, {
- contents: C.a.createElement('strong', null, this.props.child.author.name),
- showUserPanel: this.props.showUserPanel,
- post: this.props.child
- })), C.a.createElement('span', {
- className: 'bullet',
- 'aria-hidden': 'true'
- }), C.a.createElement('a', {
- href: this.props.child.url,
- target: 'new',
- title: r,
- className: 'link-gray'
- }, C.a.createElement('time', {
- className: 'time-ago'
- }, a)), C.a.createElement('div', {
- className: 'reply-summary',
- dangerouslySetInnerHTML: {
- __html: this.props.child.modMessage || this.props.child.message
- }
- }))) : null, C.a.createElement('div', {
- className: 'spacing-narrow spacing-top'.concat(this.state.isReplying ? '' : ' hidden')
- }, C.a.createElement('textarea', {
- className: 'comment-moderate__textarea',
- ref: this.replyInput,
- rows: '5'
- }), this.props.isApproved ? null : C.a.createElement('p', {
- className: 'reply-notice'
- }, 'This comment will be automatically approved.'), C.a.createElement('div', null, C.a.createElement('button', {
- className: 'button button-small button-fill--brand spacing-right-small',
- onClick: this.saveReply
- }, this.state.isSaving ? 'Posting...' : 'Post Reply'), C.a.createElement('button', UC({
- className: 'button button-small button-fill -dark-hover',
- onClick: this.finishReply
- }, n), 'Cancel'), l))), C.a.createElement('div', {
- className: 'comment-moderate__action'
- }, this.props.isDeletedByAuthor ? C.a.createElement('em', null, ' This comment has been deleted by the user and can\'t be changed.') : C.a.createElement('div', null, C.a.createElement('button', {
- onClick: b ? function () {
- return t.props.updateApproveModal({
- approveModalIsOpen: !0,
- approveModalPostId: t.props.id,
- approveModalAuthor: t.props.author
- })
- }
- : this.props.performActionOnPost.bind(null, 'approve', this.props.id, !1),
- className: 'action'.concat('approved' === this.props.status || s ? ' button-disabled' : ''),
- disabled: 'approved' === this.props.status || s
- }, C.a.createElement('span', {
- className: 'icon '.concat(WP.approve)
- }), 'Approve'), C.a.createElement('button', i ? {
- onClick: function () {
- return t.props.updateUserListsModal({
- isOpen: !0,
- listType: 'blacklist',
- formValues: LC(LC({
- }, Wn.DEFAULT_FORM_VALUES), {
- }, {
- retroactiveAction: Wn.RETROACTIVE_ACTION_TYPES.MARK_AS_SPAM,
- type: 'permanent',
- replaceCancel: !0,
- username: t.props.author.name,
- email: t.props.author.email,
- reason: 'Spam'
- }),
- postId: t.props.id,
- author: t.props.author
- })
- },
- className: 'action'.concat('spam' === this.props.status ? ' button-disabled' : ''),
- disabled: 'spam' === this.props.status
- }
- : {
- onClick: this.props.performActionOnPost.bind(null, 'spam', this.props.id, !1),
- className: 'action'.concat('spam' === this.props.status ? ' button-disabled' : ''),
- disabled: 'spam' === this.props.status
- }, C.a.createElement('span', {
- className: 'icon '.concat(WP.spam)
- }), 'Spam'), C.a.createElement('button', {
- onClick: this.props.performActionOnPost.bind(null, 'delete', this.props.id, !1),
- className: 'action'.concat('deleted' === this.props.status ? ' disabled' : ''),
- disabled: 'deleted' === this.props.status
- }, C.a.createElement('span', {
- className: 'icon '.concat(WP.delete)
- }), 'Delete'), YP && 'pending' === this.props.activePage ? C.a.createElement('div', {
- className: 'comment-moderate__suggested-action'.concat(h ? '' : ' disabled')
- }, C.a.createElement('span', {
- className: 'icon icon-lightning'
- }), C.a.createElement('span', null, h ? 'Suggested Action:' : 'No Suggested Action'), h ? C.a.createElement('span', {
- className: 'action -'.concat(this.props.suggestedAction.postAction),
- onClick: this.performSuggestedUserAction
- }, C.a.createElement('span', {
- className: [
- 'icon',
- 'icon-'.concat(VP.posts[this.props.suggestedAction.postAction].icon)
- ].join(' ')
- }), [
- (VP.posts[this.props.suggestedAction.postAction] || {
- }).text,
- yo.a.isFeatureActive('suggested_user_actions') ? (VP.users[this.props.suggestedAction.userAction] || {
- }).text : null
- ].filter(function (e) {
- return e
- }).join(' & ')) : null) : null), this.props.rule && jn[this.props.rule.action] && Dn[In[this.props.rule.filterName]] ? C.a.createElement('div', {
- className: 'comment-moderate__rule'
- }, C.a.createElement('strong', {
- className: '-'.concat(this.props.rule.action)
- }, C.a.createElement('span', {
- className: 'icon '.concat(WP[this.props.rule.action])
- }), jn[this.props.rule.action].past), ' because ', C.a.createElement(v.Link, {
- to: 'settings/moderation'
- }, Dn[In[this.props.rule.filterName]][this.props.rule.filterName].title)) : null)))))
- }
- }
- ]) && zC(e.prototype, t),
- n && zC(e, n),
- o
- }();
- YC(h, 'propTypes', LC(LC({
- }, Qs), {
- }, {
- showUserPanel: b.a.func.isRequired,
- togglePostPanelVisible: b.a.func.isRequired,
- activePage: b.a.oneOf(['pending',
- 'approved',
- 'spam',
- 'deleted',
- 'all']).isRequired,
- checked: b.a.bool.isRequired,
- updateChecked: b.a.func.isRequired,
- status: b.a.oneOf(['deleted',
- 'spam',
- 'approved',
- 'unapproved']).isRequired,
- hidden: b.a.bool.isRequired,
- updateVote: b.a.func.isRequired,
- updateMessage: b.a.func.isRequired,
- saveReply: b.a.func.isRequired,
- performActionOnPost: b.a.func.isRequired,
- isActive: b.a.bool.isRequired,
- updateActivePost: b.a.func.isRequired,
- updateExpanded: b.a.func.isRequired,
- allExpanded: b.a.bool.isRequired,
- updateFetchData: b.a.func.isRequired,
- suggestedAction: b.a.shape({
- userAction: b.a.string,
- postAction: b.a.string,
- reasons: b.a.arrayOf(b.a.string).isRequired
- }),
- searchFilters: b.a.arrayOf(b.a.string).isRequired,
- selection: ht,
- searchQuery: b.a.string,
- fetchAllFlaggers: b.a.func.isRequired,
- saasFeatures: b.a.objectOf(b.a.objectOf(b.a.bool)).isRequired,
- fetchSaasFeatures: b.a.func.isRequired,
- updateUserListsModal: b.a.func.isRequired,
- updateBanFormType: b.a.func.isRequired,
- addHotkeys: b.a.func.isRequired,
- emitTrackingEvent: b.a.func.isRequired
- }));
- var QC = Ni.a.attachDrivers(Object(u.connect) (function (e) {
- return {
- saasFeatures: e.saasFeatures,
- selection: e.selection
- }
- }, {
- fetchSaasFeatures: so.fetch,
- updateUserListsModal: Js.updateUserListsModal,
- updateBanFormType: Js.updateBanFormType,
- emitTrackingEvent: Xo({
- zone: 'moderation_panel',
- section: 'welcome',
- product: 'publisher_admin',
- area: 'card'
- })
- }) (h), [
- yl
- ]),
- Yc = function (e) {
- var t = e.children,
- n = e.message;
- return C.a.createElement('div', {
- className: ''.concat(e.className || '', ' mod-bar__alert align--between align--middle')
- }, C.a.createElement('p', {
- className: 'mod-bar__alert-message spacing-left'
- }, C.a.createElement('strong', null, n)), C.a.createElement('div', {
- className: 'mod-bar__actions'
- }, t))
- };
- Yc.displayName = 'ActionBar',
- Yc.propTypes = {
- children: b.a.node.isRequired,
- className: b.a.string,
- message: b.a.node.isRequired
- };
- var KC = Yc;
- function JC(e) {
- return (JC = 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator ? function (e) {
- return typeof e
- }
- : function (e) {
- return e && 'function' == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? 'symbol' : typeof e
- }) (e)
- }
- function $C(e, t) {
- for (var n = 0; n < t.length; n++) {
- var a = t[n];
- a.enumerable = a.enumerable || !1,
- a.configurable = !0,
- 'value' in a && (a.writable = !0),
- Object.defineProperty(e, a.key, a)
- }
- }
- function ZC(e, t) {
- return (ZC = Object.setPrototypeOf || function (e, t) {
- return e.__proto__ = t,
- e
- }) (e, t)
- }
- function XC(n) {
- var a = function () {
- if ('undefined' == typeof Reflect || !Reflect.construct) return !1;
- if (Reflect.construct.sham) return !1;
- if ('function' == typeof Proxy) return !0;
- try {
- return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [
- ], function () {
- })),
- !0
- } catch (e) {
- return !1
- }
- }();
- return function () {
- var e,
- t = tR(n);
- return e = a ? (e = tR(this).constructor, Reflect.construct(t, arguments, e)) : t.apply(this, arguments),
- t = this,
- !(e = e) || 'object' !== JC(e) && 'function' != typeof e ? eR(t) : e
- }
- }
- function eR(e) {
- if (void 0 === e) throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called');
- return e
- }
- function tR(e) {
- return (tR = Object.setPrototypeOf ? Object.getPrototypeOf : function (e) {
- return e.__proto__ || Object.getPrototypeOf(e)
- }) (e)
- }
- function nR(e, t, n) {
- return t in e ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n,
- e
- }
- var aR = {
- user: {
- description: 'search by username'
- },
- ip: {
- description: 'search by IP address'
- },
- email: {
- description: 'search by email address'
- },
- thread: {
- description: 'search by thread ID#'
- },
- id: {
- description: 'search by comment ID#'
- }
- },
- i = function () {
- !function (e, t) {
- if ('function' != typeof t && null !== t) throw new TypeError('Super expression must either be null or a function');
- e.prototype = Object.create(t && t.prototype, {
- constructor: {
- value: e,
- writable: !0,
- configurable: !0
- }
- }),
- t && ZC(e, t)
- }(o, A);
- var e,
- t,
- n,
- r = XC(o);
- function o() {
- var t;
- !function (e, t) {
- if (!(e instanceof t)) throw new TypeError('Cannot call a class as a function')
- }(this, o);
- for (var e = arguments.length, n = Array(e), a = 0; a < e; a++) n[a] = arguments[a];
- return nR(eR(t = r.call.apply(r, [
- this
- ].concat(n))), 'activate', function () {
- t.props.changeActive(!0)
- }),
- nR(eR(t), 'focus', function () {
- t.searchInput.focus()
- }),
- nR(eR(t), 'clearSearch', function () {
- t.props.updateFetchData({
- searchQuery: ''
- })
- }),
- nR(eR(t), 'fetchQuery', function () {
- var e = t.props.localSearchQuery.replace(/\//g, '%2F');
- t.props.updateFetchData({
- searchQuery: e
- }),
- t.props.changeActive(!1)
- }),
- nR(eR(t), 'updateQueryTag', function (e) {
- e = t.props.localSearchQuery.match(/^\s*\w+:/) ? t.props.localSearchQuery.replace(/^\s*\w*:/, ''.concat(e, ':')) : ''.concat(e, ':').concat(t.props.localSearchQuery);
- t.props.updateLocalQuery(e)
- }),
- nR(eR(t), 'handleChange', function (e) {
- t.props.updateLocalQuery(e.target.value)
- }),
- nR(eR(t), 'handleKeyDown', function (e) {
- 13 === e.keyCode && t.fetchQuery()
- }),
- nR(eR(t), 'handleBlur', function (e) {
- t.searchDropdown && t.searchDropdown.contains(e.relatedTarget) || t.props.changeActive(!1)
- }),
- t
- }
- return e = o,
- (t = [
- {
- key: 'componentDidMount',
- value: function () {
- this.props.searchQuery && this.props.updateLocalQuery(this.props.searchQuery)
- }
- },
- {
- key: 'componentWillReceiveProps',
- value: function (e) {
- this.props.searchQuery !== e.searchQuery && this.props.updateLocalQuery(e.searchQuery)
- }
- },
- {
- key: 'componentDidUpdate',
- value: function () {
- this.props.isActive ? this.focus() : this.searchInput.blur()
- }
- },
- {
- key: 'render',
- value: function () {
- var t = this,
- e = this.props.isActive && !/[\w:]\s/.test(this.props.localSearchQuery);
- return C.a.createElement('div', {
- className: 'align align__item--grow'
- }, C.a.createElement('input', {
- ref: function (e) {
- t.searchInput = e
- },
- 'aria-label': 'Search all',
- placeholder: 'Search all...',
- value: window.decodeURIComponent(this.props.localSearchQuery),
- onChange: this.handleChange,
- onKeyDown: this.handleKeyDown,
- onFocus: this.activate,
- onBlur: this.handleBlur,
- className: 'input--textbox mod-bar__search align__item--grow'
- }), C.a.createElement('button', {
- className: 'mod-bar__search-icon icon-mod-search',
- onClick: this.fetchQuery
- }), this.props.searchQuery ? C.a.createElement('span', {
- className: 'mod-bar__clear',
- onClick: this.clearSearch
- }, '×') : null, e ? C.a.createElement('div', {
- tabIndex: '1',
- ref: function (e) {
- t.searchDropdown = e
- },
- className: 'mod-bar__search-dropdown',
- onClick: this.focus
- }, C.a.createElement('strong', null, 'Try searching with one of these search parameters:'), C.a.createElement('ul', {
- className: 'spacing-bottom'
- }, Object.keys(aR).map(function (e) {
- return C.a.createElement('li', {
- className: 'mod-bar__search-dropdown-item',
- key: e
- }, C.a.createElement('button', {
- className: 'mod-bar__search-dropdown-button',
- onClick: t.updateQueryTag.bind(t, e),
- tabIndex: '-1'
- }, e, ':'), C.a.createElement('span', {
- className: 'hidden-sm'
- }, aR[e].description))
- }))) : null)
- }
- }
- ]) && $C(e.prototype, t),
- n && $C(e, n),
- o
- }();
- nR(i, 'displayName', 'ModerateSearch'),
- nR(i, 'propTypes', {
- localSearchQuery: b.a.string.isRequired,
- isActive: b.a.bool.isRequired,
- updateLocalQuery: b.a.func.isRequired,
- changeActive: b.a.func.isRequired,
- searchQuery: b.a.string.isRequired,
- updateFetchData: b.a.func.isRequired
- });
- function rR(e) {
- var a = e.selected,
- r = e.onChange;
- return C.a.createElement('ul', {
- className: 'mod-bar__dropdown-menu'
- }, e.options.map(function (e) {
- var t = e.key,
- n = e.label,
- e = !!~a.indexOf(t);
- return C.a.createElement('li', {
- key: t
- }, C.a.createElement('button', {
- onClick: function () {
- return r(t)
- },
- className: [
- 'mod-bar__dropdown-menu-item mod-bar__section align align--middle',
- e ? 'active' : ''
- ].join(' ')
- }, C.a.createElement('span', {
- className: [
- 'icon-mod-check text-gray-dark text-small mod-bar__dropdown-icon align__item',
- e ? '' : '-no-icon'
- ].join(' ')
- }), C.a.createElement('span', {
- className: 'align__item'
- }, n)))
- }))
- }
- var oR = Object(u.connect) (function (e) {
- return e.moderateSearch
- }, I) (i),
- h = b.a.arrayOf(b.a.shape({
- key: b.a.string,
- label: b.a.string
- })).isRequired;
- rR.propTypes = {
- options: h,
- selected: b.a.arrayOf(b.a.string).isRequired,
- onChange: b.a.func.isRequired
- };
- Yc = function (t) {
- var e,
- n = t.buttonLabel || '';
- return n || !t.selected.length || (e = je.a.find(t.options, function (e) {
- return e.key === t.selected[0]
- })) && (n = e.label),
- C.a.createElement(Qc.a, {
- className: 'mod-bar__item mod-bar__section',
- buttonChildren: C.a.createElement('div', {
- className: 'align align--middle'
- }, C.a.createElement('span', {
- className: ''.concat(t.icon, ' mod-bar__dropdown-icon align__item')
- }), C.a.createElement('span', {
- className: 'align__item align__item--grow'
- }, n), C.a.createElement('span', {
- className: 'icon-arrow mod-bar__dropdown-icon align__item'
- })),
- dropdownClassName: 'mod-bar__dropdown align__item--grow',
- autoClose: t.autoClose,
- onOpen: t.onOpen,
- onClose: t.onClose
- }, C.a.createElement(rR, {
- options: t.options,
- selected: t.selected,
- onChange: t.onChange
- }))
- };
- Yc.defaultProps = {
- autoClose: !0
- },
- Yc.propTypes = {
- buttonLabel: b.a.node,
- icon: b.a.string.isRequired,
- options: h,
- selected: b.a.arrayOf(b.a.string).isRequired,
- onChange: b.a.func.isRequired,
- autoClose: b.a.bool,
- onOpen: b.a.func,
- onClose: b.a.func
- };
- var iR,
- sR = Yc;
- function lR(e) {
- return (lR = 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator ? function (e) {
- return typeof e
- }
- : function (e) {
- return e && 'function' == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? 'symbol' : typeof e
- }) (e)
- }
- function cR() {
- return (cR = Object.assign || function (e) {
- for (var t = 1; t < arguments.length; t++) {
- var n,
- a = arguments[t];
- for (n in a) Object.prototype.hasOwnProperty.call(a, n) && (e[n] = a[n])
- }
- return e
- }).apply(this, arguments)
- }
- function uR(e) {
- return function (e) {
- if (Array.isArray(e)) return pR(e)
- }(e) || function (e) {
- if ('undefined' != typeof Symbol && null != e[Symbol.iterator] || null != e['@@iterator']) return Array.from(e)
- }(e) || function (e, t) {
- if (e) {
- if ('string' == typeof e) return pR(e, t);
- var n = Object.prototype.toString.call(e).slice(8, - 1);
- return 'Map' === (n = 'Object' === n && e.constructor ? e.constructor.name : n) || 'Set' === n ? Array.from(e) : 'Arguments' === n || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n) ? pR(e, t) : void 0
- }
- }(e) || function () {
- throw new TypeError('Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.')
- }()
- }
- function pR(e, t) {
- for (var n = 0, a = Array(t = null == t || e.length < t ? e.length : t); n < t; n++) a[n] = e[n];
- return a
- }
- function dR(e, t) {
- for (var n = 0; n < t.length; n++) {
- var a = t[n];
- a.enumerable = a.enumerable || !1,
- a.configurable = !0,
- 'value' in a && (a.writable = !0),
- Object.defineProperty(e, a.key, a)
- }
- }
- function mR(e, t) {
- return (mR = Object.setPrototypeOf || function (e, t) {
- return e.__proto__ = t,
- e
- }) (e, t)
- }
- function fR(n) {
- var a = function () {
- if ('undefined' == typeof Reflect || !Reflect.construct) return !1;
- if (Reflect.construct.sham) return !1;
- if ('function' == typeof Proxy) return !0;
- try {
- return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [
- ], function () {
- })),
- !0
- } catch (e) {
- return !1
- }
- }();
- return function () {
- var e,
- t = gR(n);
- return e = a ? (e = gR(this).constructor, Reflect.construct(t, arguments, e)) : t.apply(this, arguments),
- t = this,
- !(e = e) || 'object' !== lR(e) && 'function' != typeof e ? hR(t) : e
- }
- }
- function hR(e) {
- if (void 0 === e) throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called');
- return e
- }
- function gR(e) {
- return (gR = Object.setPrototypeOf ? Object.getPrototypeOf : function (e) {
- return e.__proto__ || Object.getPrototypeOf(e)
- }) (e)
- }
- function yR(e, t, n) {
- return t in e ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n,
- e
- }
- var bR = 750,
- i = function () {
- !function (e, t) {
- if ('function' != typeof t && null !== t) throw new TypeError('Super expression must either be null or a function');
- e.prototype = Object.create(t && t.prototype, {
- constructor: {
- value: e,
- writable: !0,
- configurable: !0
- }
- }),
- t && mR(e, t)
- }(o, A);
- var e,
- t,
- n,
- r = fR(o);
- function o(e) {
- var a,
- t,
- n;
- return function (e, t) {
- if (!(e instanceof t)) throw new TypeError('Cannot call a class as a function')
- }(this, o),
- yR(hR(a = r.call(this, e)), 'toggleChecked', function (e) {
- a.props.updatePostsChecked(a.props.postIds, e.target.checked)
- }),
- yR(hR(a), 'toggleExpanded', function () {
- a.props.updateExpanded(!a.props.allExpanded)
- }),
- yR(hR(a), 'updateDate', function (e, t) {
- a.props.updateFetchData({
- startDate: e,
- endDate: t.endOf('day')
- })
- }),
- yR(hR(a), 'hideDatePicker', function () {
- a.setState({
- showDatePicker: !1
- })
- }),
- yR(hR(a), 'onDateChange', function (e) {
- var t = a.props.startDate;
- switch (e) {
- case 'day':
- case 'week':
- case 'month':
- case 'year':
- t = ct() ().startOf('day').subtract(1, e);
- break;
- case 'custom':
- return void a.setState({
- dateRange: e,
- showDatePicker: !0
- });
- case 'all':
- default:
- t = a.props.minDate
- }
- 'custom' !== e && Is.a.set(AP, e),
- a.setState({
- dateRange: e
- }),
- a.updateDate(t, ct() ().endOf('day'))
- }),
- yR(hR(a), 'handleFilterToggle', function (e) {
- clearTimeout(iR);
- var t = uR(a.state.filters),
- n = t.indexOf(e);
- 0 <= n ? t.splice(n, 1) : t.push(e),
- a.setState({
- filters: t
- }),
- iR = setTimeout(a.handleFiltersClose, bR)
- }),
- yR(hR(a), 'handleFiltersClose', function () {
- clearTimeout(iR),
- a.props.updateFetchData({
- filters: a.state.filters
- })
- }),
- yR(hR(a), 'handleScroll', function () {
- var e;
- a.actionBarContainer && (e = a.actionBarContainer.getBoundingClientRect().top <= 0, a.setState({
- isFixed: e,
- actionBarFillerHeight: e ? a.actionBarHolder.clientHeight : 0
- }))
- }),
- yR(hR(a), 'undoAction', function (e) {
- e.preventDefault(),
- a.props.undoAction()
- }),
- yR(hR(a), 'updateSortOrder', function (e) {
- a.props.updateFetchData({
- sortOrder: e
- }),
- Is.a.set(qP, e)
- }),
- yR(hR(a), 'handleGoToTop', function () {
- window.scroll(0, 0)
- }),
- n = a.props.endDate.isSame(ct() ().endOf('day')) ? a.props.startDate.isSame(a.props.minDate) ? 'all' : (t = a.props.startDate, (n = je.a.find(DP, function (e) {
- return t.isSame(ct() ().startOf('day').subtract(1, e.key))
- })) ? n.key : 'custom') : 'custom',
- a.state = {
- dateRange: n,
- showDatePicker: !1,
- filters: a.props.searchFilters,
- isFixed: !1,
- actionBarFillerHeight: 0
- },
- a
- }
- return e = o,
- (t = [
- {
- key: 'componentDidMount',
- value: function () {
- this.handleScroll = je.a.throttle(this.handleScroll, 250),
- window.addEventListener('scroll', this.handleScroll)
- }
- },
- {
- key: 'componentWillReceiveProps',
- value: function (e) {
- this.props.searchFilters !== e.searchFilters && this.setState({
- filters: e.searchFilters
- })
- }
- },
- {
- key: 'componentWillUnmount',
- value: function () {
- window.removeEventListener('scroll', this.handleScroll)
- }
- },
- {
- key: 'render',
- value: function () {
- var t = this,
- e = this.state.isFixed,
- n = {
- };
- this.props.allChecked && (n.checked = !0);
- var a = 'mod-bar__wrapper',
- r = this.props.panelOpen ? 'align-min-desktop' : 'align-min-tablet',
- o = null;
- e && (o = C.a.createElement('button', {
- className: 'button button-link visible-sm padding',
- onClick: this.handleGoToTop
- }, 'Back to Top'), a += ' fixed');
- var i = null;
- this.props.actionCompleteMessage ? i = C.a.createElement(KC, {
- className: r,
- message: this.props.actionCompleteMessage
- }, C.a.createElement('span', null, this.props.canUndo ? C.a.createElement('button', {
- key: 'undo',
- className: 'mod-bar__button -secondary',
- onClick: this.undoAction
- }, 'Undo') : null, C.a.createElement('button', {
- key: 'ok',
- className: 'mod-bar__button -gray',
- onClick: this.props.dismissMessage
- }, 'OK'))) : this.props.numChecked && (i = C.a.createElement(KC, {
- className: r,
- message: ''.concat(RP(this.props.numChecked), ' selected')
- }, YP && 'pending' === this.props.activePage ? C.a.createElement('span', null, C.a.createElement('button', {
- key: 'suggestions',
- className: 'mod-bar__button -gray spacing-right',
- onClick: this.props.performSuggestedActions
- }, 'Accept Suggested Actions')) : null, C.a.createElement('span', null, C.a.createElement('button', {
- key: 'approve',
- className: 'mod-bar__button -gray -grouped',
- onClick: je.a.partial(this.props.performAction, 'approve')
- }, 'Approve'), C.a.createElement('button', {
- key: 'spam',
- className: 'mod-bar__button -gray -grouped',
- onClick: je.a.partial(this.props.performAction, 'spam')
- }, 'Spam'), C.a.createElement('button', {
- key: 'delete',
- className: 'mod-bar__button -gray -grouped',
- onClick: je.a.partial(this.props.performAction, 'delete')
- }, 'Delete'))));
- var s,
- l = null;
- return 'custom' === this.state.dateRange && (s = this.props.startDate.format('M/D/YY'), r = this.props.endDate.format('M/D/YY'), l = ''.concat(s, ' - ').concat(r)),
- C.a.createElement('div', {
- ref: function (e) {
- t.actionBarContainer = e
- }
- }, C.a.createElement('div', {
- style: {
- height: this.state.actionBarFillerHeight
- }
- }), C.a.createElement('div', {
- ref: function (e) {
- t.actionBarHolder = e
- },
- className: a
- }, C.a.createElement('div', {
- className: 'mod-bar__filters align align--between align--middle'
- }, o, C.a.createElement('div', {
- className: 'align align--wrap align__item--grow'.concat(e ? ' hidden-sm' : '')
- }, C.a.createElement('div', {
- className: 'align align__item--grow'
- }, C.a.createElement('span', {
- className: 'mod-bar__item mod-bar__check align align--middle align--center'
- }, C.a.createElement('input', cR({
- type: 'checkbox',
- checked: n.checked || !1,
- onChange: this.toggleChecked
- }, n))), C.a.createElement('div', {
- className: 'mod-bar__item mod-bar__search-wrapper relative__wrapper align align__item--grow'
- }, C.a.createElement(oR, {
- searchQuery: this.props.searchQuery,
- updateFetchData: this.props.updateFetchData
- }))), C.a.createElement('button', {
- className: 'mod-bar__section mod-bar__item -expand -no-icon',
- onClick: this.toggleExpanded
- }, this.props.allExpanded ? 'Collapse' : 'Expand'), C.a.createElement('div', {
- className: 'align align__item--grow'
- }, C.a.createElement(sR, {
- buttonLabel: 'Filter '.concat(this.props.searchFilters.length ? '('.concat(this.props.searchFilters.length, ')') : 'by'),
- options: this.props.searchFilterOptions,
- selected: this.state.filters,
- icon: 'icon-filter',
- onChange: this.handleFilterToggle,
- onClose: this.handleFiltersClose,
- autoClose: !1
- })), C.a.createElement('div', {
- className: 'align align__item--grow'
- }, C.a.createElement(sR, {
- buttonLabel: l,
- options: DP,
- selected: [
- this.state.dateRange
- ],
- icon: 'icon-calendar',
- onChange: this.onDateChange
- }), C.a.createElement(zp.a, {
- onOutsideClick: this.hideDatePicker,
- className: 'mod-bar__date '.concat(this.state.showDatePicker && !e ? '' : 'hidden'),
- active: this.state.showDatePicker
- }, C.a.createElement(Zp, {
- maxDate: this.props.maxDate,
- minDate: this.props.minDate,
- startDate: this.props.startDate,
- endDate: this.props.endDate,
- onDateChange: this.updateDate,
- alwaysOpen: !0
- })), C.a.createElement(sR, {
- options: FP,
- selected: [
- this.props.sortOrder
- ],
- icon: 'icon-sort',
- onChange: this.updateSortOrder
- })))), i))
- }
- }
- ]) && dR(e.prototype, t),
- n && dR(e, n),
- o
- }();
- yR(i, 'propTypes', {
- postIds: b.a.array,
- performAction: b.a.func.isRequired,
- undoAction: b.a.func.isRequired,
- canUndo: b.a.bool.isRequired,
- updatePostsChecked: b.a.func.isRequired,
- updateExpanded: b.a.func.isRequired,
- dismissMessage: b.a.func.isRequired,
- actionCompleteMessage: b.a.string,
- allChecked: b.a.bool,
- allExpanded: b.a.bool,
- activePage: b.a.string,
- sortOrder: b.a.string,
- searchQuery: b.a.string.isRequired,
- searchFilters: b.a.arrayOf(b.a.string).isRequired,
- searchFilterOptions: b.a.arrayOf(b.a.object).isRequired,
- updateFetchData: b.a.func.isRequired,
- performSuggestedActions: b.a.func.isRequired,
- numChecked: b.a.number.isRequired,
- panelOpen: b.a.bool.isRequired,
- startDate: s.moment.isRequired,
- endDate: s.moment.isRequired,
- maxDate: s.moment.isRequired,
- minDate: s.moment.isRequired
- });
- var vR = i;
- function _R(e) {
- return (_R = 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator ? function (e) {
- return typeof e
- }
- : function (e) {
- return e && 'function' == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? 'symbol' : typeof e
- }) (e)
- }
- function ER(t, e) {
- var n,
- a = Object.keys(t);
- return Object.getOwnPropertySymbols && (n = Object.getOwnPropertySymbols(t), e && (n = n.filter(function (e) {
- return Object.getOwnPropertyDescriptor(t, e).enumerable
- })), a.push.apply(a, n)),
- a
- }
- function OR(t) {
- for (var e = 1; e < arguments.length; e++) {
- var n = null != arguments[e] ? arguments[e] : {
- };
- e % 2 ? ER(Object(n), !0).forEach(function (e) {
- CR(t, e, n[e])
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(n)) : ER(Object(n)).forEach(function (e) {
- Object.defineProperty(t, e, Object.getOwnPropertyDescriptor(n, e))
- })
- }
- return t
- }
- function SR(e, t) {
- for (var n = 0; n < t.length; n++) {
- var a = t[n];
- a.enumerable = a.enumerable || !1,
- a.configurable = !0,
- 'value' in a && (a.writable = !0),
- Object.defineProperty(e, a.key, a)
- }
- }
- function wR(e, t) {
- return (wR = Object.setPrototypeOf || function (e, t) {
- return e.__proto__ = t,
- e
- }) (e, t)
- }
- function PR(n) {
- var a = function () {
- if ('undefined' == typeof Reflect || !Reflect.construct) return !1;
- if (Reflect.construct.sham) return !1;
- if ('function' == typeof Proxy) return !0;
- try {
- return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [
- ], function () {
- })),
- !0
- } catch (e) {
- return !1
- }
- }();
- return function () {
- var e,
- t = NR(n);
- return e = a ? (e = NR(this).constructor, Reflect.construct(t, arguments, e)) : t.apply(this, arguments),
- t = this,
- !(e = e) || 'object' !== _R(e) && 'function' != typeof e ? kR(t) : e
- }
- }
- function kR(e) {
- if (void 0 === e) throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called');
- return e
- }
- function NR(e) {
- return (NR = Object.setPrototypeOf ? Object.getPrototypeOf : function (e) {
- return e.__proto__ || Object.getPrototypeOf(e)
- }) (e)
- }
- function CR(e, t, n) {
- return t in e ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n,
- e
- }
- h = function () {
- !function (e, t) {
- if ('function' != typeof t && null !== t) throw new TypeError('Super expression must either be null or a function');
- e.prototype = Object.create(t && t.prototype, {
- constructor: {
- value: e,
- writable: !0,
- configurable: !0
- }
- }),
- t && wR(e, t)
- }(o, A);
- var e,
- t,
- n,
- r = PR(o);
- function o() {
- var n;
- !function (e, t) {
- if (!(e instanceof t)) throw new TypeError('Cannot call a class as a function')
- }(this, o);
- for (var e = arguments.length, t = Array(e), a = 0; a < e; a++) t[a] = arguments[a];
- return CR(kR(n = r.call.apply(r, [
- this
- ].concat(t))), 'state', {
- userItems: null,
- postItems: null,
- objects: {
- }
- }),
- CR(kR(n), 'updateUserHistory', function (e, t) {
- n.setState({
- userItems: null
- }),
- n.userAPICall = io.a.call('forums/listUserModerationHistory', {
- data: {
- forum: t,
- user: e,
- limit: 10
- }
- }).done(function (t) {
- n.setState(function (e) {
- return {
- userItems: t.response.items,
- objects: OR(OR({
- }, e.objects), t.response.objects)
- }
- })
- })
- }),
- CR(kR(n), 'updatePostHistory', function (e) {
- n.setState({
- postItems: null
- }),
- n.postAPICall = io.a.call('posts/listModerationHistory', {
- data: {
- post: e,
- limit: 10
- }
- }).done(function (t) {
- n.setState(function (e) {
- return {
- postItems: t.response.items,
- objects: OR(OR({
- }, e.objects), t.response.objects)
- }
- })
- })
- }),
- CR(kR(n), 'getComponentProps', function () {
- function e(e) {
- return OR(OR({
- }, e = t[e]), {
- }, {
- forum: t[e.forum],
- post: OR(OR({
- }, t[e.post]), {
- }, {
- thread: t[t[e.post].thread]
- }),
- targetUser: t[e.targetUser],
- thread: t[e.thread],
- user: t[e.user]
- })
- }
- var t = n.state.objects;
- return {
- userModerationHistory: n.state.userItems ? n.state.userItems.filter(function (e) {
- return t[e].post && t[e].thread
- }).map(e) : null,
- postModerationHistory: n.state.postItems ? n.state.postItems.filter(function (e) {
- return t[e].post && t[e].thread
- }).map(e) : null,
- updateUserHistory: n.updateUserHistory,
- updatePostHistory: n.updatePostHistory
- }
- }),
- n
- }
- return e = o,
- (t = [
- {
- key: 'componentWillUnmount',
- value: function () {
- this.userAPICall && 'pending' === this.userAPICall.state() && this.userAPICall.abort(),
- this.postAPICall && 'pending' === this.postAPICall.state() && this.postAPICall.abort()
- }
- }
- ]) && SR(e.prototype, t),
- n && SR(e, n),
- o
- }();
- CR(h, 'displayName', 'ModerationHistoryDriver');
- Yc = Object(ki.createDriver) (h);
- function RR(e) {
- return (RR = 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator ? function (e) {
- return typeof e
- }
- : function (e) {
- return e && 'function' == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? 'symbol' : typeof e
- }) (e)
- }
- function xR(e, t) {
- for (var n = 0; n < t.length; n++) {
- var a = t[n];
- a.enumerable = a.enumerable || !1,
- a.configurable = !0,
- 'value' in a && (a.writable = !0),
- Object.defineProperty(e, a.key, a)
- }
- }
- function AR(e, t) {
- return (AR = Object.setPrototypeOf || function (e, t) {
- return e.__proto__ = t,
- e
- }) (e, t)
- }
- function DR(n) {
- var a = function () {
- if ('undefined' == typeof Reflect || !Reflect.construct) return !1;
- if (Reflect.construct.sham) return !1;
- if ('function' == typeof Proxy) return !0;
- try {
- return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [
- ], function () {
- })),
- !0
- } catch (e) {
- return !1
- }
- }();
- return function () {
- var e,
- t = jR(n);
- return e = a ? (e = jR(this).constructor, Reflect.construct(t, arguments, e)) : t.apply(this, arguments),
- t = this,
- !(e = e) || 'object' !== RR(e) && 'function' != typeof e ? function (e) {
- if (void 0 !== e) return e;
- throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called')
- }(t) : e
- }
- }
- function jR(e) {
- return (jR = Object.setPrototypeOf ? Object.getPrototypeOf : function (e) {
- return e.__proto__ || Object.getPrototypeOf(e)
- }) (e)
- }
- function TR(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) {
- var a,
- r,
- o = [
- ],
- i = !0,
- s = !1;
- try {
- for (n = n.call(e); !(i = (a = n.next()).done) && (o.push(a.value), !t || o.length !== t); i = !0);
- } catch (e) {
- s = !0,
- r = e
- } finally {
- try {
- i || null == n.return || n.return()
- } finally {
- if (s) throw r
- }
- }
- return o
- }
- }(e, t) || function (e, t) {
- if (e) {
- if ('string' == typeof e) return IR(e, t);
- var n = Object.prototype.toString.call(e).slice(8, - 1);
- return 'Map' === (n = 'Object' === n && e.constructor ? e.constructor.name : n) || 'Set' === n ? Array.from(e) : 'Arguments' === n || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n) ? IR(e, t) : void 0
- }
- }(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 IR(e, t) {
- for (var n = 0, a = Array(t = null == t || e.length < t ? e.length : t); n < t; n++) a[n] = e[n];
- return a
- }
- function qR(e) {
- var t = e.action,
- n = e.activePage,
- a = e.updateSearch,
- r = Os.prettyDatetime(''.concat(t.dateAdded, ' GMT')),
- o = Os.prettyDatetime(t.dateAdded, 'absolute'),
- i = (s = TR(FR[t.type], 2)) [0],
- e = s[1],
- s = t.deletedUser ? C.a.createElement('p', null, t.deletedUser.name || t.deletedUser.username) : C.a.createElement('a', {
- href: '//'.concat(pt.a.disqusHost, '/by/').concat(t.user.username),
- target: '_blank',
- rel: 'noopener noreferrer'
- }, t.user.name || t.user.username);
- return C.a.createElement('li', {
- className: 'user-mod-history__item'
- }, C.a.createElement('time', {
- className: 'time-ago pull-right',
- title: o
- }, r), s, C.a.createElement('p', null, i, C.a.createElement('a', {
- href: '/admin/moderate/'.concat(n, '/search/id:').concat(t.post.id),
- onClick: function (e) {
- e.preventDefault(),
- a({
- searchQuery: 'id:'.concat(t.post.id)
- })
- }
- }, 'Comment #', t.post.id), e))
- }
- var FR = {
- 1: [
- 'Moved ',
- ' to approved'
- ],
- 2: [
- 'Unapproved ',
- ''
- ],
- 3: [
- 'Marked ',
- ' as spam'
- ],
- 4: [
- 'Unmarked ',
- ' as spam'
- ],
- 5: [
- 'Undeleted ',
- ''
- ],
- 6: [
- 'Deleted ',
- ''
- ],
- 7: [
- 'Highlighted ',
- ''
- ],
- 8: [
- 'Unhighlighted ',
- ''
- ],
- 17: [
- 'Excluded ',
- ' from new user pre-moderation'
- ]
- },
- i = b.a.shape({
- name: b.a.string,
- username: b.a.string.isRequired
- }),
- h = b.a.shape({
- dateAdded: b.a.string.isRequired,
- id: b.a.number.isRequired,
- type: b.a.oneOf(Object.keys(FR).map(Number)).isRequired,
- deletedUser: i,
- user: i
- });
- qR.propTypes = {
- action: h.isRequired,
- activePage: b.a.string.isRequired,
- updateSearch: b.a.func.isRequired
- };
- var LR,
- UR,
- MR,
- i = function () {
- !function (e, t) {
- if ('function' != typeof t && null !== t) throw new TypeError('Super expression must either be null or a function');
- e.prototype = Object.create(t && t.prototype, {
- constructor: {
- value: e,
- writable: !0,
- configurable: !0
- }
- }),
- t && AR(e, t)
- }(r, A);
- var e,
- t,
- n,
- a = DR(r);
- function r() {
- return function (e, t) {
- if (!(e instanceof t)) throw new TypeError('Cannot call a class as a function')
- }(this, r),
- a.apply(this, arguments)
- }
- return e = r,
- (t = [
- {
- key: 'componentDidMount',
- value: function () {
- this.props.updatePostHistory(this.props.post.id),
- this.props.post.author.id && this.props.updateUserHistory(this.props.post.author.id, this.props.post.forum.id)
- }
- },
- {
- key: 'componentWillReceiveProps',
- value: function (e) {
- e.post.id !== this.props.post.id && this.props.updatePostHistory(e.post.id),
- !e.post.author.id || e.post.author.id === this.props.post.author.id && e.post.forum.id === this.props.post.forum.id || this.props.updateUserHistory(e.post.author.id, e.post.forum.id)
- }
- },
- {
- key: 'render',
- value: function () {
- function e(e) {
- return C.a.createElement(qR, {
- key: e.id,
- action: e,
- activePage: t.props.activePage,
- updateSearch: t.props.updateSearch
- })
- }
- var t = this,
- n = C.a.createElement('div', {
- className: 'spinner -sm spacing-top spacing-bottom'
- }),
- a = this.props.postModerationHistory ? this.props.postModerationHistory.length ? C.a.createElement('ul', null, this.props.postModerationHistory.map(e)) : C.a.createElement('p', {
- className: 'user-mod-history__item'
- }, 'This comment has no moderation history.') : n,
- n = void 0 === this.props.post.author.id ? C.a.createElement('p', {
- className: 'user-mod-history__item'
- }, 'Cannot load moderation history for guest user.') : this.props.userModerationHistory ? this.props.userModerationHistory.length ? C.a.createElement('ul', null, this.props.userModerationHistory.map(e)) : C.a.createElement('p', {
- className: 'user-mod-history__item'
- }, 'This user has no comments with moderation history.') : n;
- return C.a.createElement('div', {
- className: 'user-mod-history side-panel__content overflow_panel fill_height'
- }, C.a.createElement('p', {
- className: 'user-mod-history__item'
- }, 'Moderation actions on ', C.a.createElement('strong', null, 'this comment'), ':'), a, C.a.createElement('hr', {
- className: 'user-mod-history__item'
- }), C.a.createElement('p', {
- className: 'user-mod-history__item'
- }, 'Moderation actions on ', C.a.createElement('strong', null, 'all comments by this user'), ':'), n)
- }
- }
- ]) && xR(e.prototype, t),
- n && xR(e, n),
- r
- }();
- LR = i,
- UR = 'propTypes',
- MR = {
- activePage: b.a.string.isRequired,
- post: b.a.shape({
- author: b.a.shape({
- id: b.a.string
- }).isRequired,
- id: b.a.string.isRequired,
- forum: b.a.shape({
- id: b.a.string.isRequired
- }).isRequired
- }).isRequired,
- updateSearch: b.a.func.isRequired,
- userModerationHistory: b.a.arrayOf(h),
- updateUserHistory: b.a.func.isRequired,
- postModerationHistory: b.a.arrayOf(h),
- updatePostHistory: b.a.func.isRequired
- },
- UR in LR ? Object.defineProperty(LR, UR, {
- value: MR,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : LR[UR] = MR;
- var BR = Ni.a.attachDrivers(i, [
- Yc
- ]);
- function zR(e) {
- return (zR = 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator ? function (e) {
- return typeof e
- }
- : function (e) {
- return e && 'function' == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? 'symbol' : typeof e
- }) (e)
- }
- function HR(e, t) {
- for (var n = 0; n < t.length; n++) {
- var a = t[n];
- a.enumerable = a.enumerable || !1,
- a.configurable = !0,
- 'value' in a && (a.writable = !0),
- Object.defineProperty(e, a.key, a)
- }
- }
- function GR(e, t) {
- return (GR = Object.setPrototypeOf || function (e, t) {
- return e.__proto__ = t,
- e
- }) (e, t)
- }
- function VR(n) {
- var a = function () {
- if ('undefined' == typeof Reflect || !Reflect.construct) return !1;
- if (Reflect.construct.sham) return !1;
- if ('function' == typeof Proxy) return !0;
- try {
- return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [
- ], function () {
- })),
- !0
- } catch (e) {
- return !1
- }
- }();
- return function () {
- var e,
- t = YR(n);
- return e = a ? (e = YR(this).constructor, Reflect.construct(t, arguments, e)) : t.apply(this, arguments),
- t = this,
- !(e = e) || 'object' !== zR(e) && 'function' != typeof e ? WR(t) : e
- }
- }
- function WR(e) {
- if (void 0 === e) throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called');
- return e
- }
- function YR(e) {
- return (YR = Object.setPrototypeOf ? Object.getPrototypeOf : function (e) {
- return e.__proto__ || Object.getPrototypeOf(e)
- }) (e)
- }
- function QR(e, t, n) {
- return t in e ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n,
- e
- }
- i = function () {
- !function (e, t) {
- if ('function' != typeof t && null !== t) throw new TypeError('Super expression must either be null or a function');
- e.prototype = Object.create(t && t.prototype, {
- constructor: {
- value: e,
- writable: !0,
- configurable: !0
- }
- }),
- t && GR(e, t)
- }(o, A);
- var e,
- t,
- n,
- r = VR(o);
- function o() {
- var a;
- !function (e, t) {
- if (!(e instanceof t)) throw new TypeError('Cannot call a class as a function')
- }(this, o);
- for (var e = arguments.length, t = Array(e), n = 0; n < e; n++) t[n] = arguments[n];
- return QR(WR(a = r.call.apply(r, [
- this
- ].concat(t))), 'state', {
- cursor: {
- },
- posts: null,
- user: null,
- isFetching: !1
- }),
- QR(WR(a), 'updateUser', function (e) {
- je.a.isEqual(a.state.user, e) || a.setState({
- user: e,
- cursor: {
- },
- posts: null
- }, a.fetchData)
- }),
- QR(WR(a), 'fetchUserPosts', function (e, t) {
- var n,
- e = a.state.user.isPrivate ? (n = je.a.extend({
- limit: 10,
- related: [
- 'forum',
- 'thread'
- ],
- include: 'approved',
- order: 'desc',
- query: 'user:'.concat(a.state.user.username)
- }, e), 'posts/list') : (n = je.a.extend({
- limit: 10,
- related: [
- 'forum',
- 'thread'
- ],
- user: 'username:'.concat(a.state.user.username)
- }, e), 'users/listPosts');
- a.setState({
- isFetching: !0
- }),
- a.apiCall = io.a.call(e, {
- data: n
- }).done(je.a.partial(a.onFetchPosts, je.a, t))
- }),
- QR(WR(a), 'fetchAnonPosts', function (e, t) {
- var n = je.a.extend({
- query: 'email:'.concat(a.state.user.email),
- related: [
- 'thread',
- 'forum'
- ]
- }, e),
- e = Ve.a.getFromCookie();
- if (a.props.selection.type === ft.organization) n.forum = a.props.selection.organization.forums;
- else if (a.props.selection.type === ft.forum) n.forum = a.props.selection.forum.shortname;
- else if (e.staff) n.forum = ':all';
- else {
- if (!e.isModerator) return;
- n.forum = ':moderated'
- }
- a.setState({
- isFetching: !0
- }),
- a.apiCall = io.a.call('posts/list', {
- data: n
- }).done(je.a.partial(a.onFetchPosts, je.a, t))
- }),
- QR(WR(a), 'onFetchPosts', function (e, t) {
- t = t ? a.state.posts.concat(e.response) : e.response;
- a.setState({
- posts: t,
- isFetching: !1,
- cursor: e.cursor
- })
- }),
- QR(WR(a), 'fetchData', function (e, t) {
- a.state.user.username ? a.fetchUserPosts(e, t) : a.state.user.email && a.fetchAnonPosts(e, t)
- }),
- QR(WR(a), 'fetchMore', function () {
- a.state.cursor && !a.state.cursor.hasNext || a.fetchData({
- cursor: a.state.cursor.next
- }, !0)
- }),
- QR(WR(a), 'getComponentProps', function () {
- return {
- userPosts: a.state.posts,
- userHasMorePosts: !!a.state.cursor.hasNext,
- userPostsFetching: a.state.isFetching,
- fetchMore: a.fetchMore,
- updateUser: a.updateUser
- }
- }),
- a
- }
- return e = o,
- (t = [
- {
- key: 'componentWillUnmount',
- value: function () {
- this.apiCall && 'pending' === this.apiCall.state() && this.apiCall.abort()
- }
- }
- ]) && HR(e.prototype, t),
- n && HR(e, n),
- o
- }();
- QR(i, 'displayName', 'UserPostListDriver'),
- QR(i, 'propTypes', {
- selection: ht.isRequired
- });
- Yc = Object(ki.createDriver) (i);
- function KR(e) {
- return (KR = 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator ? function (e) {
- return typeof e
- }
- : function (e) {
- return e && 'function' == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? 'symbol' : typeof e
- }) (e)
- }
- function JR(e, t) {
- for (var n = 0; n < t.length; n++) {
- var a = t[n];
- a.enumerable = a.enumerable || !1,
- a.configurable = !0,
- 'value' in a && (a.writable = !0),
- Object.defineProperty(e, a.key, a)
- }
- }
- function $R(e, t) {
- return ($R = Object.setPrototypeOf || function (e, t) {
- return e.__proto__ = t,
- e
- }) (e, t)
- }
- function ZR(n) {
- var a = function () {
- if ('undefined' == typeof Reflect || !Reflect.construct) return !1;
- if (Reflect.construct.sham) return !1;
- if ('function' == typeof Proxy) return !0;
- try {
- return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [
- ], function () {
- })),
- !0
- } catch (e) {
- return !1
- }
- }();
- return function () {
- var e,
- t = ex(n);
- return e = a ? (e = ex(this).constructor, Reflect.construct(t, arguments, e)) : t.apply(this, arguments),
- t = this,
- !(e = e) || 'object' !== KR(e) && 'function' != typeof e ? XR(t) : e
- }
- }
- function XR(e) {
- if (void 0 === e) throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called');
- return e
- }
- function ex(e) {
- return (ex = Object.setPrototypeOf ? Object.getPrototypeOf : function (e) {
- return e.__proto__ || Object.getPrototypeOf(e)
- }) (e)
- }
- function tx(e, t, n) {
- return t in e ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n,
- e
- }
- i = function () {
- !function (e, t) {
- if ('function' != typeof t && null !== t) throw new TypeError('Super expression must either be null or a function');
- e.prototype = Object.create(t && t.prototype, {
- constructor: {
- value: e,
- writable: !0,
- configurable: !0
- }
- }),
- t && $R(e, t)
- }(o, A);
- var e,
- t,
- n,
- r = ZR(o);
- function o() {
- var t;
- !function (e, t) {
- if (!(e instanceof t)) throw new TypeError('Cannot call a class as a function')
- }(this, o);
- for (var e = arguments.length, n = Array(e), a = 0; a < e; a++) n[a] = arguments[a];
- return tx(XR(t = r.call.apply(r, [
- this
- ].concat(n))), 'state', {
- maxContentHeight: 0
- }),
- tx(XR(t), 'fetchMore', function (e) {
- e.preventDefault(),
- t.props.fetchMore()
- }),
- tx(XR(t), 'searchForUser', function (e) {
- e.preventDefault(),
- t.props.updateSearch({
- searchQuery: t.props.post.author.username ? 'user:'.concat(encodeURIComponent(t.props.post.author.username)) : t.props.post.author.email ? 'post_email_lookup:'.concat(t.props.post.id) : ''
- })
- }),
- t
- }
- return e = o,
- (t = [
- {
- key: 'componentDidMount',
- value: function () {
- this.props.updateUser(this.props.post.author)
- }
- },
- {
- key: 'componentWillReceiveProps',
- value: function (e) {
- je.a.isEqual(e.post.author, this.props.post.author) || this.props.updateUser(e.post.author)
- }
- },
- {
- key: 'render',
- value: function () {
- var e = '/admin/moderate/'.concat(this.props.activePage, '/search/');
- this.props.post.author.username ? e += 'user:'.concat(encodeURIComponent(this.props.post.author.username)) : this.props.post.author.email ? e += 'post_email_lookup:'.concat(this.props.post.id) : e = '';
- var t = this.props.post.forum.settings.validateAllPosts,
- n = null;
- return this.props.post.thread.isClosed ? n = 'This discussion is closed' : this.props.post.thread.validateAllPosts && !t && (n = 'This discussion is premoderated'),
- C.a.createElement('div', {
- className: 'side-panel__content__container overflow_panel spacing-top'
- }, n ? C.a.createElement('div', {
- className: 'alert alert--muted-dark spacing-left spacing-right spacing-bottom'
- }, C.a.createElement('strong', null, n)) : null, C.a.createElement('div', {
- className: 'side-panel__content overflow_panel fill_height'
- }, this.props.userPosts ? C.a.createElement('div', null, je.a.map(this.props.userPosts, function (e) {
- return C.a.createElement('ul', {
- key: e.id
- }, C.a.createElement('li', {
- className: 'user-activity__item'
- }, C.a.createElement('div', {
- className: 'pull-right'
- }, C.a.createElement('img', {
- src: e.forum.favicon.cache,
- width: '16',
- height: '16',
- alt: ''
- })), C.a.createElement('div', null, C.a.createElement('p', {
- className: 'text-smaller'
- }, C.a.createElement('a', {
- href: e.url,
- target: '_blank',
- rel: 'noopener noreferrer',
- className: 'comment',
- 'data-comment-id': e.id
- }, e.thread.clean_title)), C.a.createElement('p', {
- dangerouslySetInnerHTML: {
- __html: e.message
- }
- }), C.a.createElement('p', {
- className: 'text-smaller text-gray'
- }, Os.prettyDatetime(''.concat(e.createdAt, ' GMT'))))))
- }), this.props.userHasMorePosts ? C.a.createElement('a', {
- href: '#',
- className: 'spacing-bottom',
- onClick: this.fetchMore
- }, 'Load more comments') : null) : C.a.createElement('p', null, 'This person\'s activity is still being updated.'), this.props.userPostsFetching ? C.a.createElement('div', {
- className: 'spinner -sm spacing-top spacing-bottom'
- }) : null), e ? C.a.createElement('a', {
- className: 'side-panel__button text-small',
- href: e,
- onClick: this.searchForUser
- }, 'Moderate ', 'all' === this.props.activePage ? '' : ''.concat(this.props.activePage, ' '), 'comments from this user') : null, this.props.post.forum.settings.badgesEnabled && this.props.post.author.id ? C.a.createElement('button', {
- className: 'side-panel__button text-small',
- onClick: this.props.showBadgesModal
- }, 'Manage user badges') : null, t ? null : C.a.createElement('button', {
- className: 'side-panel__button text-small',
- onClick: this.props.toggleThreadPremoderation
- }, this.props.post.thread.validateAllPosts ? 'Don\'t premoderate this discussion' : 'Premoderate this discussion'), C.a.createElement('button', {
- className: 'side-panel__button text-small',
- onClick: this.props.toggleThreadClosed
- }, this.props.post.thread.isClosed ? 'Open this discussion' : 'Close this discussion'))
- }
- }
- ]) && JR(e.prototype, t),
- n && JR(e, n),
- o
- }();
- tx(i, 'propTypes', {
- post: b.a.shape(Qs).isRequired,
- activePage: b.a.string.isRequired,
- showBadgesModal: b.a.func.isRequired,
- toggleThreadClosed: b.a.func.isRequired,
- toggleThreadPremoderation: b.a.func.isRequired,
- updateSearch: b.a.func.isRequired,
- userPosts: b.a.array,
- userHasMorePosts: b.a.bool.isRequired,
- userPostsFetching: b.a.bool.isRequired,
- updateUser: b.a.func.isRequired,
- fetchMore: b.a.func.isRequired
- });
- var nx = Ni.a.attachDrivers(i, [
- Yc
- ]);
- function ax(e) {
- return (ax = 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator ? function (e) {
- return typeof e
- }
- : function (e) {
- return e && 'function' == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? 'symbol' : typeof e
- }) (e)
- }
- function rx(e, t) {
- for (var n = 0; n < t.length; n++) {
- var a = t[n];
- a.enumerable = a.enumerable || !1,
- a.configurable = !0,
- 'value' in a && (a.writable = !0),
- Object.defineProperty(e, a.key, a)
- }
- }
- function ox(e, t) {
- return (ox = Object.setPrototypeOf || function (e, t) {
- return e.__proto__ = t,
- e
- }) (e, t)
- }
- function ix(n) {
- var a = function () {
- if ('undefined' == typeof Reflect || !Reflect.construct) return !1;
- if (Reflect.construct.sham) return !1;
- if ('function' == typeof Proxy) return !0;
- try {
- return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [
- ], function () {
- })),
- !0
- } catch (e) {
- return !1
- }
- }();
- return function () {
- var e,
- t = lx(n);
- return e = a ? (e = lx(this).constructor, Reflect.construct(t, arguments, e)) : t.apply(this, arguments),
- t = this,
- !(e = e) || 'object' !== ax(e) && 'function' != typeof e ? sx(t) : e
- }
- }
- function sx(e) {
- if (void 0 === e) throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called');
- return e
- }
- function lx(e) {
- return (lx = Object.setPrototypeOf ? Object.getPrototypeOf : function (e) {
- return e.__proto__ || Object.getPrototypeOf(e)
- }) (e)
- }
- function cx(e, t, n) {
- return t in e ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n,
- e
- }
- i = function () {
- !function (e, t) {
- if ('function' != typeof t && null !== t) throw new TypeError('Super expression must either be null or a function');
- e.prototype = Object.create(t && t.prototype, {
- constructor: {
- value: e,
- writable: !0,
- configurable: !0
- }
- }),
- t && ox(e, t)
- }(o, A);
- var e,
- t,
- n,
- r = ix(o);
- function o() {
- var t;
- !function (e, t) {
- if (!(e instanceof t)) throw new TypeError('Cannot call a class as a function')
- }(this, o);
- for (var e = arguments.length, n = Array(e), a = 0; a < e; a++) n[a] = arguments[a];
- return cx(sx(t = r.call.apply(r, [
- this
- ].concat(n))), 'state', {
- counts: null
- }),
- cx(sx(t), 'fetchData', function (e) {
- e && e.id && (e = {
- user: e.id
- }, t.props.selection.type === ft.forum ? e.forum = t.props.selection.forum.shortname : t.props.auth.isModerator && (e.network = 'username:'.concat(t.props.auth.username)), t.apiCall = io.a.call('internal/users/moderationDetails', {
- data: e
- }).done(t.onFetch))
- }),
- cx(sx(t), 'onFetch', function (e) {
- t.setState({
- counts: e.response.counts
- })
- }),
- cx(sx(t), 'getComponentProps', function () {
- return {
- moderationDetailsCounts: t.state.counts
- }
- }),
- t
- }
- return e = o,
- (t = [
- {
- key: 'componentDidMount',
- value: function () {
- this.fetchData(this.props.author)
- }
- },
- {
- key: 'componentWillReceiveProps',
- value: function (e) {
- e.author && this.props.author.id !== e.author.id && (this.setState({
- counts: null
- }), this.fetchData(e.author))
- }
- },
- {
- key: 'componentWillUnmount',
- value: function () {
- this.apiCall && 'pending' === this.apiCall.state() && this.apiCall.abort()
- }
- }
- ]) && rx(e.prototype, t),
- n && rx(e, n),
- o
- }();
- cx(i, 'displayName', 'ModerationDetailsDriver'),
- cx(i, 'propTypes', {
- auth: b.a.object.isRequired,
- author: b.a.object,
- selection: ht.isRequired
- });
- Yc = Object(ki.createDriver) (i);
- function ux(e) {
- return (ux = 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator ? function (e) {
- return typeof e
- }
- : function (e) {
- return e && 'function' == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? 'symbol' : typeof e
- }) (e)
- }
- function px(e, t) {
- for (var n = 0; n < t.length; n++) {
- var a = t[n];
- a.enumerable = a.enumerable || !1,
- a.configurable = !0,
- 'value' in a && (a.writable = !0),
- Object.defineProperty(e, a.key, a)
- }
- }
- function dx(e, t) {
- return (dx = Object.setPrototypeOf || function (e, t) {
- return e.__proto__ = t,
- e
- }) (e, t)
- }
- function mx(n) {
- var a = function () {
- if ('undefined' == typeof Reflect || !Reflect.construct) return !1;
- if (Reflect.construct.sham) return !1;
- if ('function' == typeof Proxy) return !0;
- try {
- return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [
- ], function () {
- })),
- !0
- } catch (e) {
- return !1
- }
- }();
- return function () {
- var e,
- t = hx(n);
- return e = a ? (e = hx(this).constructor, Reflect.construct(t, arguments, e)) : t.apply(this, arguments),
- t = this,
- !(e = e) || 'object' !== ux(e) && 'function' != typeof e ? fx(t) : e
- }
- }
- function fx(e) {
- if (void 0 === e) throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called');
- return e
- }
- function hx(e) {
- return (hx = Object.setPrototypeOf ? Object.getPrototypeOf : function (e) {
- return e.__proto__ || Object.getPrototypeOf(e)
- }) (e)
- }
- function gx(e, t, n) {
- return t in e ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n,
- e
- }
- var yx = {
- twitter: '//c.disquscdn.com/next/current/publisher-admin/assets/img/services/twitter-x.png',
- facebook: '//c.disquscdn.com/next/current/publisher-admin/assets/img/services/facebook.png',
- google: '//c.disquscdn.com/next/current/publisher-admin/assets/img/services/googleplus.png',
- disqus: '//c.disquscdn.com/next/current/publisher-admin/assets/img/services/disqus.png',
- guest: '//c.disquscdn.com/next/current/publisher-admin/assets/img/services/user.png'
- },
- bx = {
- twitter: 'X (Twitter) user',
- facebook: 'Facebook user',
- google: 'Google user',
- disqus: 'Disqus user',
- guest: 'Guest user'
- },
- i = function () {
- !function (e, t) {
- if ('function' != typeof t && null !== t) throw new TypeError('Super expression must either be null or a function');
- e.prototype = Object.create(t && t.prototype, {
- constructor: {
- value: e,
- writable: !0,
- configurable: !0
- }
- }),
- t && dx(e, t)
- }(o, A);
- var e,
- t,
- n,
- r = mx(o);
- function o() {
- var n;
- !function (e, t) {
- if (!(e instanceof t)) throw new TypeError('Cannot call a class as a function')
- }(this, o);
- for (var e = arguments.length, t = Array(e), a = 0; a < e; a++) t[a] = arguments[a];
- return gx(fx(n = r.call.apply(r, [
- this
- ].concat(t))), 'showWhitelistForm', function () {
- n.props.updateUserListsModal({
- isOpen: !0,
- listType: 'whitelist',
- postId: n.props.postId,
- author: n.props.author
- })
- }),
- gx(fx(n), 'showBlacklistForm', function () {
- n.props.updateUserListsModal({
- isOpen: !0,
- listType: 'blacklist',
- postId: n.props.postId,
- author: n.props.author
- })
- }),
- gx(fx(n), 'updateSearchQuery', function (e, t) {
- t && t.nativeEvent && 1 !== t.nativeEvent.which || (t && t.preventDefault(), n.props.updateActivePage('all', je.a.partial(n.props.updateFetchData, {
- searchQuery: e
- })))
- }),
- n
- }
- return e = o,
- (t = [
- {
- key: 'render',
- value: function () {
- var e,
- t = this.props.author.remote ? this.props.author.remote.domain : this.props.author.username ? 'disqus' : 'guest';
- return this.props.author.reputation && (e = hN.normalizeReputation(this.props.author.reputation)),
- C.a.createElement('div', {
- className: 'side-panel__footer'
- }, C.a.createElement('div', {
- className: 'align align--between spacing-top-small'
- }, C.a.createElement('div', {
- className: 'align align--column spacing-bottom user-info__wrapper'
- }, C.a.createElement('div', {
- className: 'align align--middle'
- }, C.a.createElement('div', {
- className: 'user-info__avatar spacing-right'
- }, C.a.createElement('img', {
- className: 'border-radius-sm',
- src: this.props.author.avatar ? this.props.author.avatar.cache : '//c.disquscdn.com/next/current/publisher-admin/assets/img/noavatar32.png',
- width: '32',
- height: '32'
- }), yx[t] ? C.a.createElement('img', {
- className: 'service '.concat(t),
- width: '16',
- height: '16',
- src: yx[t],
- alt: bx[t]
- }) : null), C.a.createElement('div', {
- className: 'user-info__name'
- }, C.a.createElement('strong', {
- className: 'text-medium text-gray-darker text-bold'
- }, this.props.author.name), C.a.createElement('p', {
- className: 'text-gray text-smaller truncate-line'
- }, this.props.author.email))), C.a.createElement(fC, {
- forum: this.props.forum,
- user: this.props.author,
- context: 'moderation-side-panel',
- limit: We.MAX_BADGE_COUNT
- })), C.a.createElement('div', null, C.a.createElement('div', {
- className: 'align align--row-reverse dropdown--side-panel'
- }, C.a.createElement(Qc.a, {
- ref: 'userDropdown',
- className: 'button padding-small button-fill--gray-light dropdown-toggle',
- buttonChildren: C.a.createElement('img', {
- className: 'service',
- src: '//c.disquscdn.com/next/current/publisher-admin/assets/img/services/user.png',
- alt: 'Guest user'
- })
- }, C.a.createElement('ul', {
- className: 'dropdown-menu'
- }, this.props.author.username ? C.a.createElement('li', null, C.a.createElement('a', {
- href: '/admin/moderate/all/search/user:'.concat(this.props.author.username),
- onClick: this.updateSearchQuery.bind(this, 'user:'.concat(this.props.author.username))
- }, 'View all from ', this.props.author.username)) : null, this.props.author.email ? C.a.createElement('li', null, C.a.createElement('a', {
- href: '/admin/moderate/all/search/post_email_lookup:'.concat(this.props.postId),
- onClick: this.updateSearchQuery.bind(this, 'post_email_lookup:'.concat(this.props.postId))
- }, 'View all from ', this.props.author.email)) : null, this.props.ipAddress ? C.a.createElement('li', null, C.a.createElement('a', {
- href: '/admin/moderate/all/search/post_ip_lookup:'.concat(this.props.postId),
- onClick: this.updateSearchQuery.bind(this, 'post_ip_lookup:'.concat(this.props.postId))
- }, 'View all from ', this.props.ipAddress)) : null)), C.a.createElement('button', {
- onClick: this.showBlacklistForm,
- className: 'button button-fill--gray-light panel-blacklist spacing-right-small'
- }, 'Ban User'), C.a.createElement('button', {
- onClick: this.showWhitelistForm,
- className: 'button button-fill--gray-light panel-whitelist'
- }, 'Trust User')))), C.a.createElement('div', null, C.a.createElement('div', {
- className: 'clearfix'
- }, e ? C.a.createElement('div', {
- className: 'user-stat__block'
- }, C.a.createElement('span', {
- className: 'user-info__label'
- }, C.a.createElement('span', {
- className: 'icon-trophy icon__position text-gray-light'
- })), C.a.createElement('span', {
- className: 'badge--reputation '.concat(e.type)
- }, e.verboseName)) : null, C.a.createElement('div', {
- className: 'user-stat__block'
- }, C.a.createElement('span', {
- className: 'user-info__label text-smallest text-gray'
- }, ' joined '), C.a.createElement('span', {
- className: 'text-gray-darker'
- }, ct() ().diff(ct() (this.props.author.joinedAt), 'days'), C.a.createElement('span', {
- className: 'text-smallest text-uppercase spacing-left-small'
- }, 'days ago'))), C.a.createElement('div', {
- className: 'user-stat__block'
- }, C.a.createElement('span', {
- className: 'user-info__label'
- }, C.a.createElement('span', {
- className: 'icon-globe icon__position text-gray-light'
- })), C.a.createElement('span', {
- className: 'text-gray-darker text-small'
- }, this.props.ipAddress)), this.props.moderationDetailsCounts ? C.a.createElement('div', null, C.a.createElement('div', {
- className: 'user-stat__block'
- }, C.a.createElement('span', {
- className: 'user-info__label text-smallest text-gray'
- }, 'posted'), C.a.createElement('span', {
- className: 'text-gray-darker'
- }, this.props.moderationDetailsCounts.global.all, C.a.createElement('span', {
- className: 'text-smallest text-uppercase spacing-left-small'
- }, 'comments'))), C.a.createElement('div', {
- className: 'user-stat__block'
- }, C.a.createElement('span', {
- className: 'user-info__label text-smallest text-gray'
- }, 'got'), C.a.createElement('span', {
- className: 'text-gray-darker'
- }, this.props.moderationDetailsCounts.global.flagged, C.a.createElement('span', {
- className: 'text-smallest text-uppercase spacing-left-small'
- }, 'flags'))), C.a.createElement('div', {
- className: 'user-stat__block'
- }, C.a.createElement('span', {
- className: 'user-info__label text-smallest text-gray'
- }, 'made'), C.a.createElement('span', {
- className: 'text-gray-darker'
- }, this.props.moderationDetailsCounts.global.spam, C.a.createElement('span', {
- className: 'text-smallest text-uppercase spacing-left-small'
- }, 'spam')))) : null)))
- }
- }
- ]) && px(e.prototype, t),
- n && px(e, n),
- o
- }();
- gx(i, 'propTypes', {
- author: b.a.object.isRequired,
- postId: b.a.string,
- forum: b.a.object,
- ipAddress: b.a.string,
- moderationDetailsCounts: b.a.shape({
- global: b.a.object
- }),
- selection: ht.isRequired,
- updateFetchData: b.a.func.isRequired,
- updateActivePage: b.a.func.isRequired,
- updateUserListsModal: b.a.func.isRequired
- });
- var vx = Ni.a.attachDrivers(Object(u.connect) (null, {
- updateUserListsModal: Js.updateUserListsModal
- }) (i), [
- Yc
- ]),
- Yc = function (e) {
- return C.a.createElement('div', {
- className: 'side-panel__header align align--between align--middle'
- }, C.a.createElement('div', {
- className: 'side-panel__header__title align__item--grow '.concat(e.status)
- }, C.a.createElement('p', null, e.children)), C.a.createElement('div', {
- className: 'spacing-right-small'
- }, C.a.createElement('button', {
- id: 'close-panel',
- className: 'link-gray spacing-right',
- onClick: e.onRequestClose
- }, C.a.createElement('span', {
- className: 'icon-cancel icon__position icon-small'
- }))))
- };
- Yc.propTypes = {
- children: b.a.node.isRequired,
- onRequestClose: b.a.func.isRequired,
- status: b.a.string.isRequired
- };
- var _x = Yc,
- Yc = function (n) {
- var e = Os.prettyDatetime(''.concat(n.post.createdAt, ' GMT')),
- t = [
- ];
- if (n.post.parents) for (var a, r = n.post; a = n.post.parents[r.parent]; ) t.push(a),
- r = a;
- var o = n.post.forum.settings.validateAllPosts,
- i = null;
- n.post.thread.isClosed ? i = 'This discussion is closed' : n.post.thread.validateAllPosts && !o && (i = 'This discussion is premoderated');
- return C.a.createElement('div', {
- className: 'side-panel__content__container overflow_panel spacing-top'
- }, i ? C.a.createElement('div', {
- className: 'alert alert--muted-dark spacing-left spacing-right spacing-bottom'
- }, C.a.createElement('strong', null, i)) : null, n.post.thread.reactionsEnabled || !n.post.thread.reactionsEligible ? null : C.a.createElement('div', {
- className: 'alert alert--muted-dark spacing-left spacing-right spacing-bottom'
- }, C.a.createElement('strong', null, 'Reactions for this discussion are removed')), C.a.createElement('div', {
- className: 'side-panel__content overflow_panel fill_height'
- }, C.a.createElement('div', {
- className: 'comment-thread'
- }, C.a.createElement(OC, {
- contents: C.a.createElement('strong', null, n.post.author.name),
- showUserPanel: n.showUserPanelFromThread,
- post: n.post
- }), C.a.createElement('time', {
- className: 'bullet text-smaller text-gray text-normal'
- }, e), C.a.createElement('div', {
- className: 'message'
- }, C.a.createElement('span', {
- dangerouslySetInnerHTML: {
- __html: n.post.modMessage || n.post.message
- }
- }), 0 < n.post.media.length ? C.a.createElement('div', {
- className: 'comment-attachments'
- }, n.post.media.map(function (e) {
- return C.a.createElement('a', {
- key: e.thumbnailURL,
- href: e.url,
- target: '_blank ',
- rel: 'noopener noreferrer'
- }, e.mediaType === IC.a.MEDIA_TYPES.MP4_VIDEO ? C.a.createElement('video', {
- autoPlay: !0,
- loop: !0,
- muted: !0,
- src: e.thumbnailURL,
- width: '50'
- }) : C.a.createElement('img', {
- src: e.thumbnailURL,
- width: '50'
- }))
- })) : null), je.a.map(t, function (e, t) {
- return C.a.createElement('div', {
- className: 'comment-thread parent parent-'.concat(t),
- key: e.id
- }, C.a.createElement(OC, {
- contents: C.a.createElement('strong', null, e.author.name),
- showUserPanel: n.showUserPanelFromThread,
- post: e
- }), C.a.createElement('time', {
- className: 'bullet text-smaller text-gray text-normal'
- }, Os.prettyDatetime(''.concat(e.createdAt, ' GMT'))), C.a.createElement('div', {
- className: 'message'
- }, C.a.createElement('span', {
- dangerouslySetInnerHTML: {
- __html: e.modMessage || e.message
- }
- })))
- }, void 0))), C.a.createElement('div', {
- className: 'side-panel__content spacing-top text-small spacing-bottom'
- }, n.post.isApproved ? C.a.createElement('a', {
- href: n.post.url,
- target: 'new'
- }, 'View on original page') : null), n.post.forum.settings.badgesEnabled && n.post.author.id ? C.a.createElement('button', {
- className: 'side-panel__button text-small',
- onClick: n.showBadgesModal
- }, 'Manage user badges') : null, C.a.createElement('a', {
- className: 'side-panel__button text-small',
- href: '/admin/moderate/'.concat(n.activePage, '/search/thread:').concat(n.post.thread.id),
- onClick: function (e) {
- e.preventDefault(),
- n.updateSearch({
- searchQuery: 'thread:'.concat(n.post.thread.id)
- })
- }
- }, 'Moderate ', 'all' === n.activePage ? '' : ''.concat(n.activePage, ' '), 'comments from this discussion'), n.post.thread.isClosed || !n.post.thread.reactionsEligible ? null : C.a.createElement('button', {
- className: 'side-panel__button text-small',
- onClick: n.toggleReactions
- }, n.post.thread.reactionsEnabled ? 'Remove reactions from this discussion' : 'Restore reactions to this discussion'), o ? null : C.a.createElement('button', {
- className: 'side-panel__button text-small',
- onClick: n.toggleThreadPremoderation
- }, n.post.thread.validateAllPosts ? 'Don\'t premoderate this discussion' : 'Premoderate this discussion'), C.a.createElement('button', {
- className: 'side-panel__button text-small',
- onClick: n.toggleThreadClosed
- }, n.post.thread.isClosed ? 'Open this discussion' : 'Close this discussion'))
- };
- Yc.propTypes = {
- post: b.a.shape({
- id: b.a.string.isRequired,
- thread: b.a.shape({
- id: b.a.string.isRequired,
- isClosed: b.a.bool,
- validateAllPosts: b.a.bool,
- reactionsEnabled: b.a.bool,
- reactionsEligible: b.a.bool
- }).isRequired,
- author: b.a.object.isRequired,
- createdAt: b.a.string.isRequired,
- url: b.a.string.isRequired,
- ipAddress: b.a.string,
- message: b.a.string.isRequired,
- modMessage: b.a.string.isRequired,
- media: b.a.array.isRequired,
- parents: b.a.object,
- isFlagged: b.a.bool,
- isApproved: b.a.bool,
- forum: b.a.shape({
- id: b.a.string.isRequired,
- settings: b.a.objectOf(b.a.bool).isRequired
- }).isRequired
- }).isRequired,
- activePage: b.a.string.isRequired,
- showBadgesModal: b.a.func.isRequired,
- showUserPanelFromThread: b.a.func.isRequired,
- toggleReactions: b.a.func.isRequired,
- toggleThreadClosed: b.a.func.isRequired,
- toggleThreadPremoderation: b.a.func.isRequired,
- updateSearch: b.a.func.isRequired
- };
- var Ex = Yc,
- Yc = function (e) {
- return C.a.createElement(_.a, {
- isOpen: !0,
- onRequestClose: e.closeModal,
- className: 'admin-modal',
- overlayClassName: 'modal-overlay'
- }, C.a.createElement('div', {
- className: 'admin-modal__header align align--between'
- }, C.a.createElement('h3', {
- className: 'text-large'
- }, 'Keyboard Shortcuts'), C.a.createElement('button', {
- className: 'link-gray',
- onClick: e.closeModal
- }, C.a.createElement('span', {
- className: 'icon-cancel icon__position'
- }))), C.a.createElement('div', {
- className: 'admin-modal__content'
- }, C.a.createElement('table', {
- cellPadding: 0,
- cellSpacing: 0,
- className: 'admin-modal__table'
- }, C.a.createElement('tbody', null, C.a.createElement('tr', null, C.a.createElement('td', null, C.a.createElement('p', null, C.a.createElement('span', null, C.a.createElement('code', null, '?')))), C.a.createElement('td', null, C.a.createElement('p', null, C.a.createElement('span', null, 'Open/close keyboard shortcut cheat sheet modal')))), C.a.createElement('tr', null, C.a.createElement('td', null, C.a.createElement('p', null, C.a.createElement('span', null, C.a.createElement('code', null, '] or }')))), C.a.createElement('td', null, C.a.createElement('p', null, C.a.createElement('span', null, 'Tab right (pending / approved / spam / deleted)')))), C.a.createElement('tr', null, C.a.createElement('td', null, C.a.createElement('p', null, C.a.createElement('span', null, C.a.createElement('code', null, '[ or {')))), C.a.createElement('td', null, C.a.createElement('p', null, C.a.createElement('span', null, 'Tab left (pending / approved / spam / deleted)')))), C.a.createElement('tr', null, C.a.createElement('td', null, C.a.createElement('p', null, C.a.createElement('span', null, C.a.createElement('code', null, 'j')))), C.a.createElement('td', null, C.a.createElement('p', null, C.a.createElement('span', null, 'Move cursor down one comment')))), C.a.createElement('tr', null, C.a.createElement('td', null, C.a.createElement('p', null, C.a.createElement('span', null, C.a.createElement('code', null, 'k')))), C.a.createElement('td', null, C.a.createElement('p', null, C.a.createElement('span', null, 'Move cursor up one comment')))), C.a.createElement('tr', null, C.a.createElement('td', null, C.a.createElement('p', null, C.a.createElement('span', null, C.a.createElement('code', null, 'x')))), C.a.createElement('td', null, C.a.createElement('p', null, C.a.createElement('span', null, 'Select comment (if cursor is located on it)')))), C.a.createElement('tr', null, C.a.createElement('td', null, C.a.createElement('p', null, C.a.createElement('span', null, C.a.createElement('code', null, 'o or Enter or .')))), C.a.createElement('td', null, C.a.createElement('p', null, C.a.createElement('span', null, 'Open active comment')))), C.a.createElement('tr', null, C.a.createElement('td', null, C.a.createElement('p', null, C.a.createElement('span', null, C.a.createElement('code', null, 'r')))), C.a.createElement('td', null, C.a.createElement('p', null, C.a.createElement('span', null, 'Reply to active comment')))), C.a.createElement('tr', null, C.a.createElement('td', null, C.a.createElement('p', null, C.a.createElement('span', null, C.a.createElement('code', null, 'e')))), C.a.createElement('td', null, C.a.createElement('p', null, C.a.createElement('span', null, 'Edit active comment')))), C.a.createElement('tr', null, C.a.createElement('td', null, C.a.createElement('p', null, C.a.createElement('span', null, C.a.createElement('code', null, 'd or #')))), C.a.createElement('td', null, C.a.createElement('p', null, C.a.createElement('span', null, 'Mark selected comments as deleted')))), C.a.createElement('tr', null, C.a.createElement('td', null, C.a.createElement('p', null, C.a.createElement('span', null, C.a.createElement('code', null, 's or !')))), C.a.createElement('td', null, C.a.createElement('p', null, C.a.createElement('span', null, 'Mark selected comments as spam')))), C.a.createElement('tr', null, C.a.createElement('td', null, C.a.createElement('p', null, C.a.createElement('span', null, C.a.createElement('code', null, 'a')))), C.a.createElement('td', null, C.a.createElement('p', null, C.a.createElement('span', null, 'Mark selected comments as approved')))), C.a.createElement('tr', null, C.a.createElement('td', null, C.a.createElement('p', null, C.a.createElement('span', null, C.a.createElement('code', null, 'n or >')))), C.a.createElement('td', null, C.a.createElement('p', null, C.a.createElement('span', null, 'Next page')))), C.a.createElement('tr', null, C.a.createElement('td', null, C.a.createElement('p', null, C.a.createElement('span', null, C.a.createElement('code', null, 'p or < or b')))), C.a.createElement('td', null, C.a.createElement('p', null, C.a.createElement('span', null, 'Previous page')))), C.a.createElement('tr', null, C.a.createElement('td', null, C.a.createElement('p', null, C.a.createElement('span', null, C.a.createElement('code', null, 'z')))), C.a.createElement('td', null, C.a.createElement('p', null, C.a.createElement('span', null, 'Undo last action')))), C.a.createElement('tr', null, C.a.createElement('td', null, C.a.createElement('p', null, C.a.createElement('span', null, C.a.createElement('code', null, 'R')))), C.a.createElement('td', null, C.a.createElement('p', null, C.a.createElement('span', null, 'Refresh comments')))), C.a.createElement('tr', null, C.a.createElement('td', null, C.a.createElement('p', null, C.a.createElement('span', null, C.a.createElement('code', null, '/')))), C.a.createElement('td', null, C.a.createElement('p', null, C.a.createElement('span', null, 'Search')))), C.a.createElement('tr', null, C.a.createElement('td', null, C.a.createElement('p', null, C.a.createElement('span', null, C.a.createElement('code', null, 'Esc')))), C.a.createElement('td', null, C.a.createElement('p', null, C.a.createElement('span', null, 'Depending on context, close modal or remove focus'))))))))
- };
- Yc.propTypes = {
- closeModal: b.a.func.isRequired
- };
- var Ox = Yc;
- function Sx(e) {
- return (Sx = 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator ? function (e) {
- return typeof e
- }
- : function (e) {
- return e && 'function' == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? 'symbol' : typeof e
- }) (e)
- }
- function wx(e, t) {
- for (var n = 0; n < t.length; n++) {
- var a = t[n];
- a.enumerable = a.enumerable || !1,
- a.configurable = !0,
- 'value' in a && (a.writable = !0),
- Object.defineProperty(e, a.key, a)
- }
- }
- function Px(e, t) {
- return (Px = Object.setPrototypeOf || function (e, t) {
- return e.__proto__ = t,
- e
- }) (e, t)
- }
- function kx(n) {
- var a = function () {
- if ('undefined' == typeof Reflect || !Reflect.construct) return !1;
- if (Reflect.construct.sham) return !1;
- if ('function' == typeof Proxy) return !0;
- try {
- return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [
- ], function () {
- })),
- !0
- } catch (e) {
- return !1
- }
- }();
- return function () {
- var e,
- t = Cx(n);
- return e = a ? (e = Cx(this).constructor, Reflect.construct(t, arguments, e)) : t.apply(this, arguments),
- t = this,
- !(e = e) || 'object' !== Sx(e) && 'function' != typeof e ? Nx(t) : e
- }
- }
- function Nx(e) {
- if (void 0 === e) throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called');
- return e
- }
- function Cx(e) {
- return (Cx = Object.setPrototypeOf ? Object.getPrototypeOf : function (e) {
- return e.__proto__ || Object.getPrototypeOf(e)
- }) (e)
- }
- function Rx(e, t, n) {
- return t in e ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n,
- e
- }
- Yc = function () {
- !function (e, t) {
- if ('function' != typeof t && null !== t) throw new TypeError('Super expression must either be null or a function');
- e.prototype = Object.create(t && t.prototype, {
- constructor: {
- value: e,
- writable: !0,
- configurable: !0
- }
- }),
- t && Px(e, t)
- }(o, A);
- var e,
- t,
- n,
- r = kx(o);
- function o() {
- var t;
- !function (e, t) {
- if (!(e instanceof t)) throw new TypeError('Cannot call a class as a function')
- }(this, o);
- for (var e = arguments.length, n = Array(e), a = 0; a < e; a++) n[a] = arguments[a];
- return Rx(Nx(t = r.call.apply(r, [
- this
- ].concat(n))), 'onOpen', function (e) {
- t.props.emitTrackingEvent({
- verb: 'view',
- object_type: 'modal',
- object_id: t.props.postId
- }),
- e.forum || t.handleClose({
- skipAction: !0
- })
- }),
- Rx(Nx(t), 'handleClose', function (n) {
- var a,
- r;
- n.skipAction || (a = t.props.user.id, r = t.props.forum.id, n = je.a.extend({
- callback: function () {
- var t = this;
- n.newUserPremodBypass && Object.keys(this.props.posts).filter(function (e) {
- return t.props.posts[e].author.id === a && t.props.posts[e].forum.id === r
- }).forEach(function (e) {
- t.props.posts[e].author.isNewUserBypassed = !!n.newUserPremodBypass
- })
- }
- }, n || {
- }), t.props.performAction('approve', t.props.postId, !1, n)),
- t.props.isOpen && t.props.close()
- }),
- Rx(Nx(t), 'handleSubmit', function (e) {
- e.preventDefault(),
- t.props.emitTrackingEvent({
- verb: 'click',
- object_type: 'button',
- object_id: t.props.postId
- }),
- t.handleClose({
- newUserPremodBypass: 1
- })
- }),
- t
- }
- return e = o,
- (t = [
- {
- key: 'componentDidMount',
- value: function () {
- this.props.isOpen && this.onOpen(this.props)
- }
- },
- {
- key: 'componentWillReceiveProps',
- value: function (e) {
- e.isOpen && !this.props.isOpen && this.onOpen(e)
- }
- },
- {
- key: 'componentWillUnmount',
- value: function () {
- this.handleClose({
- skipAction: !0
- })
- }
- },
- {
- key: 'render',
- value: function () {
- return C.a.createElement(_.a, {
- isOpen: this.props.isOpen,
- onRequestClose: this.handleClose,
- className: 'admin-modal -mobile',
- overlayClassName: 'modal-overlay'
- }, C.a.createElement('div', {
- className: 'admin-modal__header align align--between'
- }, C.a.createElement('h3', {
- className: 'text-large text-capitalized'
- }, 'Exclude from new user pre-moderation'), C.a.createElement('button', {
- className: 'link-gray',
- onClick: this.handleClose
- }, C.a.createElement('span', {
- className: 'icon-cancel icon__position'
- }))), C.a.createElement('form', {
- className: 'whitelist-form'
- }, C.a.createElement('div', {
- className: 'admin-modal__content'
- }, C.a.createElement('div', null, C.a.createElement('div', {
- className: 'modal__description ban__description'
- }, C.a.createElement('p', {
- className: 'text-small modal__option-subtext ban__option-subtext'
- }, 'Allow this user to bypass the new user pre-moderation filter', this.props.forum.name ? ' on '.concat(this.props.forum.name) : null, '. This will not affect comments caught for other reasons (ex. violating a moderation rule).'), C.a.createElement('p', {
- className: 'text-small modal__option-subtext ban__option-subtext'
- }, C.a.createElement('b', null, 'Note:'), ' All previous comments flagged by the pre-moderation filter still need to be manually approved.')))), C.a.createElement('div', {
- className: 'admin-modal__footer clearfix'
- }, C.a.createElement('div', null, C.a.createElement('button', {
- className: 'button button-fill--brand button-small text-capitalized spacing-right',
- disabled: !1,
- onClick: this.handleSubmit
- }, 'Exclude'), C.a.createElement('button', {
- className: 'button button-fill button-small text-capitalized',
- onClick: this.handleClose
- }, 'Skip')))))
- }
- }
- ]) && wx(e.prototype, t),
- n && wx(e, n),
- o
- }();
- Rx(Yc, 'displayName', 'ModerationUserListsModal'),
- Rx(Yc, 'propTypes', {
- emitTrackingEvent: b.a.func.isRequired,
- user: b.a.object,
- postId: b.a.string,
- forum: b.a.object,
- isOpen: b.a.bool.isRequired,
- close: b.a.func.isRequired,
- performAction: b.a.func.isRequired
- });
- var xx = Object(u.connect) (null, {
- emitTrackingEvent: Xo({
- zone: 'moderation_panel',
- section: 'bypass_new_user_premoderation',
- area: 'user_sidebar'
- })
- }) (Yc),
- Yc = n(495),
- Ax = n.n(Yc);
- function Dx(e) {
- return (Dx = 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator ? function (e) {
- return typeof e
- }
- : function (e) {
- return e && 'function' == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? 'symbol' : typeof e
- }) (e)
- }
- function jx() {
- return (jx = Object.assign || function (e) {
- for (var t = 1; t < arguments.length; t++) {
- var n,
- a = arguments[t];
- for (n in a) Object.prototype.hasOwnProperty.call(a, n) && (e[n] = a[n])
- }
- return e
- }).apply(this, arguments)
- }
- function Tx(t, e) {
- var n,
- a = Object.keys(t);
- return Object.getOwnPropertySymbols && (n = Object.getOwnPropertySymbols(t), e && (n = n.filter(function (e) {
- return Object.getOwnPropertyDescriptor(t, e).enumerable
- })), a.push.apply(a, n)),
- a
- }
- function Ix(t) {
- for (var e = 1; e < arguments.length; e++) {
- var n = null != arguments[e] ? arguments[e] : {
- };
- e % 2 ? Tx(Object(n), !0).forEach(function (e) {
- Bx(t, e, n[e])
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(n)) : Tx(Object(n)).forEach(function (e) {
- Object.defineProperty(t, e, Object.getOwnPropertyDescriptor(n, e))
- })
- }
- return t
- }
- function qx(e, t) {
- for (var n = 0; n < t.length; n++) {
- var a = t[n];
- a.enumerable = a.enumerable || !1,
- a.configurable = !0,
- 'value' in a && (a.writable = !0),
- Object.defineProperty(e, a.key, a)
- }
- }
- function Fx(e, t) {
- return (Fx = Object.setPrototypeOf || function (e, t) {
- return e.__proto__ = t,
- e
- }) (e, t)
- }
- function Lx(n) {
- var a = function () {
- if ('undefined' == typeof Reflect || !Reflect.construct) return !1;
- if (Reflect.construct.sham) return !1;
- if ('function' == typeof Proxy) return !0;
- try {
- return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [
- ], function () {
- })),
- !0
- } catch (e) {
- return !1
- }
- }();
- return function () {
- var e,
- t = Mx(n);
- return e = a ? (e = Mx(this).constructor, Reflect.construct(t, arguments, e)) : t.apply(this, arguments),
- t = this,
- !(e = e) || 'object' !== Dx(e) && 'function' != typeof e ? Ux(t) : e
- }
- }
- function Ux(e) {
- if (void 0 === e) throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called');
- return e
- }
- function Mx(e) {
- return (Mx = Object.setPrototypeOf ? Object.getPrototypeOf : function (e) {
- return e.__proto__ || Object.getPrototypeOf(e)
- }) (e)
- }
- function Bx(e, t, n) {
- return t in e ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n,
- e
- }
- var zx = {
- actionType: We.ACTION_TYPES.AWARD,
- selectedBadgeId: null,
- errorMessage: null
- },
- Yc = function () {
- !function (e, t) {
- if ('function' != typeof t && null !== t) throw new TypeError('Super expression must either be null or a function');
- e.prototype = Object.create(t && t.prototype, {
- constructor: {
- value: e,
- writable: !0,
- configurable: !0
- }
- }),
- t && Fx(e, t)
- }(o, A);
- var e,
- t,
- n,
- a = Lx(o);
- function o() {
- var r;
- !function (e, t) {
- if (!(e instanceof t)) throw new TypeError('Cannot call a class as a function')
- }(this, o);
- for (var e = arguments.length, t = Array(e), n = 0; n < e; n++) t[n] = arguments[n];
- return Bx(Ux(r = a.call.apply(a, [
- this
- ].concat(t))), 'state', Ix({
- }, zx)),
- Bx(Ux(r), 'onOpen', function (e) {
- r.emitActionEvent({
- action: 'view',
- forum: e.forum,
- user: e.user
- }),
- e.forum && e.forum !== r.props.forum ? (e = r.getForumBadges(e.forum), r.setState(Ix(Ix({
- }, zx), {
- }, {
- forumBadges: e
- }))) : r.handleClose()
- }),
- Bx(Ux(r), 'getForumBadges', function (e) {
- var t = {
- };
- return e.badges.forEach(function (e) {
- t[e.id] = Ix({
- }, e)
- }),
- t
- }),
- Bx(Ux(r), 'updateBadgeAction', function (e) {
- r.setState({
- actionType: e.target.value,
- selectedBadgeId: null,
- errorMessage: null
- })
- }),
- Bx(Ux(r), 'updateBadgeSelection', function (e) {
- e.target.disabled || r.setState({
- selectedBadgeId: e.target.value
- })
- }),
- Bx(Ux(r), 'getUpdatedUserBadges', function (n) {
- var a,
- e = r.props.user.badges || [
- ];
- return r.state.actionType === We.ACTION_TYPES.AWARD ? e.unshift(n) : r.state.actionType === We.ACTION_TYPES.REMOVE && (a = null, e.forEach(function (e, t) {
- e.id === n.id && (a = t)
- }), e.splice(a, 1)),
- e
- }),
- Bx(Ux(r), 'getAwardableBadges', function () {
- var t = [
- ],
- n = [
- ],
- e = r.props.forum.badges.map(function (e) {
- return Ix({
- }, e)
- }),
- a = r.props.user.badges ? r.props.user.badges.map(function (e) {
- return parseInt(e.id, 10)
- }) : [
- ];
- return e.forEach(function (e) {
- e.criteria === We.BADGES_CRITERIA.MANUAL && (~a.indexOf(e.id) ? (e.disabled = !0, n.push(e)) : (e.disabled = !1, t.push(e)))
- }),
- [
- ].concat(t, n)
- }),
- Bx(Ux(r), 'getRemovableBadges', function () {
- var t = [
- ],
- n = [
- ];
- return (r.props.user.badges || [
- ]).forEach(function (e) {
- e.criteria === We.BADGES_CRITERIA.MANUAL ? (e.disabled = !1, t.push(e)) : (e.disabled = !0, n.push(e))
- }),
- [
- ].concat(t, n)
- }),
- Bx(Ux(r), 'getBadgeOptions', function () {
- var e = r.state.actionType;
- if (r.props.forum && r.props.user) {
- if (e === We.ACTION_TYPES.AWARD) return r.getAwardableBadges();
- if (e === We.ACTION_TYPES.REMOVE) return r.getRemovableBadges()
- }
- return []
- }),
- Bx(Ux(r), 'handleSubmit', function (e) {
- e.preventDefault();
- function t(e) {
- r.setState({
- errorMessage: e
- })
- }
- var n,
- a;
- r.state.selectedBadgeId ? (n = {
- badge: r.state.selectedBadgeId,
- forum: r.props.forum.id,
- user: r.props.user.id
- }, e = function (e) {
- r.emitActionEvent({
- action: a,
- badge: e
- })
- }, (a = r.state.actionType) === We.ACTION_TYPES.AWARD ? r.props.awardBadge(n, e, t) : a === We.ACTION_TYPES.REMOVE && r.props.removeBadge(n, e, t)) : t('You must select a badge to '.concat(r.state.actionType, '.'))
- }),
- Bx(Ux(r), 'handleClose', function () {
- r.setState(Ix({
- }, zx)),
- r.props.isOpen && r.props.close()
- }),
- Bx(Ux(r), 'getFormValues', function () {
- return {
- forum: r.props.forum,
- user: r.props.user,
- badge: r.state.selectedBadgeId,
- errorMessage: r.state.errorMessage
- }
- }),
- Bx(Ux(r), 'emitActionEvent', function (e) {
- var t = e.forum || r.props.forum,
- n = e.user || r.props.user;
- e.action && t && n && ((e = {
- zone: 'moderation_panel',
- section: 'manage_badges',
- area: 'user_sidebar',
- verb: e.action,
- object_id: t.id,
- extra_data: {
- user: n.id,
- badge: e.badge || null
- }
- }).extra_data = JSON.stringify(e.extra_data), r.props.emitTrackingEvent(e))
- }),
- r
- }
- return e = o,
- (t = [
- {
- key: 'componentDidMount',
- value: function () {
- this.props.isOpen && this.onOpen(this.props)
- }
- },
- {
- key: 'componentWillReceiveProps',
- value: function (e) {
- var t;
- (this.props.isAwarding && e.isAwarded || this.props.isRemoving && e.isRemoved && e.targetBadge) && (t = this.getUpdatedUserBadges(e.targetBadge), this.props.updateUserBadges(this.props.user, t), this.handleClose()),
- e.isOpen && !this.props.isOpen && this.onOpen(e)
- }
- },
- {
- key: 'componentWillUnmount',
- value: function () {
- this.handleClose()
- }
- },
- {
- key: 'render',
- value: function () {
- return C.a.createElement(_.a, {
- isOpen: this.props.isOpen,
- onRequestClose: this.handleClose,
- className: 'admin-modal -mobile',
- overlayClassName: 'modal-overlay'
- }, C.a.createElement('div', {
- className: 'admin-modal__header align align--between'
- }, C.a.createElement('h3', {
- className: 'text-large text-capitalized'
- }, 'Manage user badges'), C.a.createElement('button', {
- className: 'link-gray',
- onClick: this.handleClose
- }, C.a.createElement('span', {
- className: 'icon-cancel icon__position'
- }))), C.a.createElement(Ax.a, jx({
- badgeAction: this.state.actionType,
- formValues: this.getFormValues(),
- badgeOptions: this.getBadgeOptions(),
- updateBadgeAction: this.updateBadgeAction,
- updateBadgeSelection: this.updateBadgeSelection,
- handleSubmit: this.handleSubmit.bind(this),
- handleClose: this.handleClose.bind(this)
- }, this.props)))
- }
- }
- ]) && qx(e.prototype, t),
- n && qx(e, n),
- o
- }();
- Bx(Yc, 'displayName', 'ModerateBadgesModal'),
- Bx(Yc, 'propTypes', {
- emitTrackingEvent: b.a.func.isRequired,
- isOpen: b.a.bool.isRequired,
- user: b.a.shape({
- id: b.a.string,
- badges: b.a.arrayOf(b.a.shape(sl))
- }),
- forum: b.a.shape({
- id: b.a.string,
- badges: b.a.arrayOf(b.a.shape(sl))
- }),
- targetBadge: b.a.shape(sl),
- updateUserBadges: b.a.func.isRequired,
- close: b.a.func.isRequired,
- selection: ht,
- isAwarding: b.a.bool,
- isAwarded: b.a.bool,
- isRemoving: b.a.bool,
- isRemoved: b.a.bool,
- error: b.a.string,
- awardBadge: b.a.func.isRequired,
- removeBadge: b.a.func.isRequired
- });
- var Hx = Object(u.connect) (function (e) {
- return Ix({
- }, e.badgesManage)
- }, Ix(Ix({
- }, D), {
- }, {
- emitTrackingEvent: Xo({
- zone: 'moderation_panel',
- section: 'manage_badges',
- area: 'user_sidebar'
- })
- })) (Yc);
- function Gx(e) {
- return (Gx = 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator ? function (e) {
- return typeof e
- }
- : function (e) {
- return e && 'function' == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? 'symbol' : typeof e
- }) (e)
- }
- function Vx() {
- return (Vx = Object.assign || function (e) {
- for (var t = 1; t < arguments.length; t++) {
- var n,
- a = arguments[t];
- for (n in a) Object.prototype.hasOwnProperty.call(a, n) && (e[n] = a[n])
- }
- return e
- }).apply(this, arguments)
- }
- function Wx(e) {
- return function (e) {
- if (Array.isArray(e)) return Yx(e)
- }(e) || function (e) {
- if ('undefined' != typeof Symbol && null != e[Symbol.iterator] || null != e['@@iterator']) return Array.from(e)
- }(e) || function (e, t) {
- if (e) {
- if ('string' == typeof e) return Yx(e, t);
- var n = Object.prototype.toString.call(e).slice(8, - 1);
- return 'Map' === (n = 'Object' === n && e.constructor ? e.constructor.name : n) || 'Set' === n ? Array.from(e) : 'Arguments' === n || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n) ? Yx(e, t) : void 0
- }
- }(e) || function () {
- throw new TypeError('Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.')
- }()
- }
- function Yx(e, t) {
- for (var n = 0, a = Array(t = null == t || e.length < t ? e.length : t); n < t; n++) a[n] = e[n];
- return a
- }
- function Qx(t, e) {
- var n,
- a = Object.keys(t);
- return Object.getOwnPropertySymbols && (n = Object.getOwnPropertySymbols(t), e && (n = n.filter(function (e) {
- return Object.getOwnPropertyDescriptor(t, e).enumerable
- })), a.push.apply(a, n)),
- a
- }
- function Kx(t) {
- for (var e = 1; e < arguments.length; e++) {
- var n = null != arguments[e] ? arguments[e] : {
- };
- e % 2 ? Qx(Object(n), !0).forEach(function (e) {
- tA(t, e, n[e])
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(n)) : Qx(Object(n)).forEach(function (e) {
- Object.defineProperty(t, e, Object.getOwnPropertyDescriptor(n, e))
- })
- }
- return t
- }
- function Jx(e, t) {
- for (var n = 0; n < t.length; n++) {
- var a = t[n];
- a.enumerable = a.enumerable || !1,
- a.configurable = !0,
- 'value' in a && (a.writable = !0),
- Object.defineProperty(e, a.key, a)
- }
- }
- function $x(e, t) {
- return ($x = Object.setPrototypeOf || function (e, t) {
- return e.__proto__ = t,
- e
- }) (e, t)
- }
- function Zx(n) {
- var a = function () {
- if ('undefined' == typeof Reflect || !Reflect.construct) return !1;
- if (Reflect.construct.sham) return !1;
- if ('function' == typeof Proxy) return !0;
- try {
- return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [
- ], function () {
- })),
- !0
- } catch (e) {
- return !1
- }
- }();
- return function () {
- var e,
- t = eA(n);
- return e = a ? (e = eA(this).constructor, Reflect.construct(t, arguments, e)) : t.apply(this, arguments),
- t = this,
- !(e = e) || 'object' !== Gx(e) && 'function' != typeof e ? Xx(t) : e
- }
- }
- function Xx(e) {
- if (void 0 === e) throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called');
- return e
- }
- function eA(e) {
- return (eA = Object.setPrototypeOf ? Object.getPrototypeOf : function (e) {
- return e.__proto__ || Object.getPrototypeOf(e)
- }) (e)
- }
- function tA(e, t, n) {
- return t in e ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n,
- e
- }
- var nA = {
- USER: 'user',
- POST: 'post',
- HISTORY: 'history'
- },
- aA = {
- postsChecked: {
- },
- postsHidden: {
- },
- lastPostsUpdated: [
- ],
- lastActionName: null,
- message: null,
- allChecked: !1,
- allExpanded: Is.a.get('moderationExpandAll') || !1,
- activePostIndex: 0,
- isHelpVisible: !1,
- panelOpen: !1
- },
- Yc = function () {
- !function (e, t) {
- if ('function' != typeof t && null !== t) throw new TypeError('Super expression must either be null or a function');
- e.prototype = Object.create(t && t.prototype, {
- constructor: {
- value: e,
- writable: !0,
- configurable: !0
- }
- }),
- t && $x(e, t)
- }(r, A);
- var e,
- t,
- n,
- a = Zx(r);
- function r() {
- var u;
- !function (e, t) {
- if (!(e instanceof t)) throw new TypeError('Cannot call a class as a function')
- }(this, r);
- for (var e = arguments.length, t = Array(e), n = 0; n < e; n++) t[n] = arguments[n];
- return tA(Xx(u = a.call.apply(a, [
- this
- ].concat(t))), 'state', Kx(Kx(Kx(Kx({
- }, jP), aA), QP), {
- }, {
- activePageIndex: u.props.pages.indexOf(u.props.params.tab || MP.page),
- postStatuses: {
- },
- sortedPosts: [
- ],
- panelType: null,
- panelFixed: !1,
- panelContentMaxHeight: 0,
- paginatorIndex: 0,
- panelAuthor: {
- },
- panelIpAddress: {
- },
- panelPostId: null,
- panelForum: null
- })),
- tA(Xx(u), 'panel', C.a.createRef()),
- tA(Xx(u), 'panelContainer', C.a.createRef()),
- tA(Xx(u), 'getActivePostId', function () {
- return u.state.sortedPosts[u.state.activePostIndex]
- }),
- tA(Xx(u), 'getActivePageName', function () {
- return u.props.pages[u.state.activePageIndex] || MP.page
- }),
- tA(Xx(u), 'toggleHelpVisible', function () {
- u.setState({
- isHelpVisible: !u.state.isHelpVisible
- })
- }),
- tA(Xx(u), 'getUrl', function (e) {
- var t = e.tab,
- n = e.search,
- e = e.filters;
- return hN.getUrl({
- tab: t = void 0 === t ? u.props.pages[u.state.activePageIndex] : t,
- search: n = void 0 === n ? u.props.searchQuery : n,
- filters: e = void 0 === e ? u.props.searchFilters : e
- })
- }),
- tA(Xx(u), 'updateUrl', function (e) {
- var t = e.tab,
- n = e.search,
- e = e.filters;
- (void 0 !== t && u.props.params.tab !== t || void 0 !== n && u.props.searchQuery !== n || void 0 !== e && !je.a.isEqual(u.props.searchFilters, e)) && u.props.history.push(u.getUrl({
- tab: t,
- search: n,
- filters: e
- }))
- }),
- tA(Xx(u), 'jesterEmitTabChange', function (e, t, n) {
- if (u._readyToEmitTabEvents) {
- if (e !== t) {
- var a = je.a.pick(u.getJesterExtraData(), 'num_comments', 'tab');
- if ('pending' === a.tab && YP) {
- if (u.suggestedActionsPromise && 'pending' === u.suggestedActionsPromise.state()) return void u.suggestedActionsPromise.then(u.jesterEmitTabChange.bind(Xx(u), e, t));
- a.suggested_actions = u.getSuggestedActionCounts(n)
- }
- u.props.emitTrackingEvent({
- verb: 'click',
- area: 'toolbar',
- object_type: 'tab',
- object_id: a.tab,
- extra_data: JSON.stringify(a)
- })
- }
- } else u._readyToEmitTabEvents = !0
- }),
- tA(Xx(u), 'getJesterExtraData', function () {
- return {
- num_comments: Object.keys(u.props.posts).length - Object.keys(u.state.postsHidden).filter(function (e) {
- return u.state.postsHidden[e]
- }).length,
- filter: je.a.sortBy(u.props.searchFilters || [
- ], je.a.identity),
- sort: u.props.sortOrder || '',
- tab: u.getActivePageName()
- }
- }),
- tA(Xx(u), 'updateActivePage', function (e, t) {
- return je.a.has(IP, e) ? (u.setState({
- activePageIndex: je.a.indexOf(u.props.pages, e),
- paginatorIndex: 0,
- allChecked: !1,
- postsChecked: {
- }
- }, t), !0) : (window.alert('This is not a valid URL.'), !1)
- }),
- tA(Xx(u), 'emitWelcomeEvent', function (t) {
- var n;
- u._hasEmitWelcomeEvent || (u._hasEmitWelcomeEvent = !0, vo.a.when.apply(vo.a, (n = 'pending' === t.tab && YP) ? [
- u.suggestedActionsPromise
- ] : [
- ]).then(function (e) {
- n && (t.suggested_actions = u.getSuggestedActionCounts(e)),
- u.props.emitTrackingEvent({
- verb: 'view',
- object_type: 'product',
- object_id: 'publisher_admin',
- area: '' + u.state.paginatorIndex,
- extra_data: JSON.stringify(t)
- })
- }))
- }),
- tA(Xx(u), 'getPostsSuggestedActions', function (e) {
- return e.reduce(function (e, t) {
- var n = (u.props.suggestedActions[t] || {
- }).postAction;
- return n && e.push({
- post_id: t,
- suggested_action: n
- }),
- e
- }, [
- ])
- }),
- tA(Xx(u), 'getSuggestedActionCounts', function (e) {
- var a = e && e.suggestedActions || u.props.suggestedActions || {
- };
- return Object.keys(a).reduce(function (e, t) {
- var n = a[t].postAction;
- return u.props.posts[t] && n && !u.state.postsHidden[t] && (e[n] += 1),
- e
- }, {
- delete : 0,
- spam: 0,
- approve: 0
- })
- }),
- tA(Xx(u), 'updateFetchData', function (n, a) {
- n = n || {
- };
- var r = u.props.searchFilters,
- o = u.props.searchQuery;
- u.resetViewStates(),
- u.props.updateFetchData(Kx({
- include: IP[n.pageType]
- }, n), function () {
- var e,
- t;
- a && a(),
- u.emitWelcomeEvent(je.a.pick(u.getJesterExtraData(), 'num_comments', 'tab')),
- je.a.has(n, 'filters') && !je.a.isEqual(n.filters, r) && (e = n.filters.filter(function (e) {
- return !~r.indexOf(e)
- }), u.props.emitTrackingEvent({
- verb: 'click',
- area: 'toolbar',
- object_type: 'filter',
- object_id: e.length ? e[0] : '',
- extra_data: JSON.stringify(u.getJesterExtraData())
- })),
- je.a.has(n, 'sortOrder') && (t = u.getJesterExtraData(), u.props.emitTrackingEvent({
- verb: 'click',
- object_type: 'sort',
- object_id: t.sort,
- extra_data: JSON.stringify(t)
- })),
- je.a.has(n, 'startDate') && je.a.has(n, 'endDate') && u.props.emitTrackingEvent({
- verb: 'click',
- area: 'toolbar',
- object_type: 'filter',
- object_id: 'date',
- extra_data: JSON.stringify(Kx(Kx({
- }, u.getJesterExtraData()), {
- }, {
- filter_start_date: n.startDate.toISOString(),
- filter_end_date: n.endDate.toISOString()
- }))
- }),
- je.a.has(n, 'searchQuery') && n.searchQuery !== o && (t = n.searchQuery && n.searchQuery.match(/\b(user|ip|email|thread|id):/), u.props.emitTrackingEvent({
- verb: 'click',
- area: 'toolbar',
- object_type: 'search',
- object_id: (t = t ? t[1] : '') ? 'keyword_enabled' : 'no_keywords',
- extra_data: JSON.stringify(Kx(Kx({
- }, u.getJesterExtraData()), {
- }, {
- search_keyword: t
- }))
- }))
- })
- }),
- tA(Xx(u), 'resetViewStates', function () {
- u.setState(aA, u.hidePanel)
- }),
- tA(Xx(u), 'refreshCurrentPage', function () {
- u.props.refreshPosts({
- }, u.resetViewStates)
- }),
- tA(Xx(u), 'focusSearch', function () {
- u.props.searchChangeActive(!0)
- }),
- tA(Xx(u), 'removeFocus', function () {
- u.props.searchChangeActive(!1),
- u.hidePanel()
- }),
- tA(Xx(u), 'tab', function (e) {
- u.navigateToPage(u.props.pages[e])
- }),
- tA(Xx(u), 'tabOver', function (e) {
- var t = u.props.pages.length;
- u.tab((u.state.activePageIndex + e + t) % t)
- }),
- tA(Xx(u), 'checkPostSetsDifferent', function (e, t) {
- return !e || !t || je.a.keys(e).length !== je.a.keys(t).length || !je.a.isEqual(je.a.keys(e).sort(), je.a.keys(t).sort())
- }),
- tA(Xx(u), 'checkFeatureMessage', function (e) {
- var t = (e = e || u.props).saasFeatures[(e.selection.organization || {
- }).id] || {
- };
- e.selection.organization && t.isFetched && t.allModRules && u.props.showFeaturedMessage(['moderationRules'])
- }),
- tA(Xx(u), 'refreshPendingCommentsCount', function (e) {
- e = e || u.props,
- u.props.pendingCountsIsFetching || u.props.refreshPendingCommentsCount({
- start: e.startDate.toISOString(),
- end: e.endDate.toISOString()
- })
- }),
- tA(Xx(u), 'getPostStatuses', function (e) {
- return je.a.chain(e).map(function (e) {
- var t = this.state.postStatuses[e.id] || {
- };
- return t.current = e.isDeleted ? 'deleted' : e.isSpam ? 'spam' : e.isApproved && !e.isFlagged ? 'approved' : 'unapproved',
- [
- e.id,
- t
- ]
- }, Xx(u)).object().value()
- }),
- tA(Xx(u), 'anchorPanel', function () {
- var e = u.panelContainer.current.getBoundingClientRect().top <= 0;
- e !== u.state.panelFixed && u.setState({
- panelFixed: e
- })
- }),
- tA(Xx(u), 'resizePanel', function () {
- var e,
- t;
- u.state.panelOpen && (e = u.panel.current.getBoundingClientRect(), t = window.innerHeight || window.document.documentElement.clientHeight, u.setState({
- panelMaxHeight: t - Math.max(e.top, 0)
- }))
- }),
- tA(Xx(u), 'showUserPanel', function (e) {
- u.setState({
- panelOpen: !0,
- panelType: nA.USER,
- panelAuthor: e.author,
- panelIpAddress: e.ipAddress,
- panelPostId: e.id,
- panelForum: e.forum
- })
- }),
- tA(Xx(u), 'showUserPanelFromThread', function (e) {
- u.setState({
- panelType: nA.USER,
- panelAuthor: e.author,
- panelIpAddress: e.ipAddress
- })
- }),
- tA(Xx(u), 'toggleActivePostPanelVisible', function () {
- u.togglePostPanelVisible(u.getActivePostId())
- }),
- tA(Xx(u), 'handlePostClick', function (e) {
- u.togglePostPanelVisible(e),
- u.props.emitTrackingEvent({
- verb: 'click',
- area: 'card',
- object_type: 'area',
- object_id: 'card',
- extra_data: JSON.stringify(je.a.pick(u.getJesterExtraData(), 'tab'))
- })
- }),
- tA(Xx(u), 'togglePostPanelVisible', function (e) {
- u.state.panelOpen && u.state.panelType === nA.POST && u.state.panelPostId === e ? u.hidePanel() : u.showPostPanel(e)
- }),
- tA(Xx(u), 'showPostPanel', function (e) {
- var t = u.props.posts[e];
- t && u.props.fetchThreadReactionsEnabled(t.thread.id).then(function () {
- return u.setState({
- panelOpen: !0,
- panelPostId: e,
- panelType: nA.POST,
- panelAuthor: t.author,
- panelIpAddress: t.ipAddress,
- panelForum: t.forum
- }, je.a.partial(u.props.getPostParents, e))
- })
- }),
- tA(Xx(u), 'hidePanel', function () {
- u.setState({
- panelOpen: !1,
- panelAuthor: null,
- panelIpAddress: null,
- panelPostId: null,
- panelForum: null
- })
- }),
- tA(Xx(u), 'handlePostMessageUpdate', function (e) {
- for (var t, n = arguments.length, a = Array(1 < n ? n - 1 : 0), r = 1; r < n; r++) a[r - 1] = arguments[r];
- (t = u.props).updatePostMessage.apply(t, [
- e
- ].concat(a)),
- u.props.emitTrackingEvent({
- verb: 'update',
- area: 'card',
- object_type: 'post',
- object_id: e,
- extra_data: JSON.stringify(je.a.pick(u.getJesterExtraData(), 'filter', 'sort', 'tab'))
- })
- }),
- tA(Xx(u), 'handlePostAction', function (e, t, n, a) {
- u.performActionOnPosts(e, t, n, a);
- n = je.a.pick(u.getJesterExtraData(), 'filter', 'sort', 'tab');
- YP && 'pending' === n.tab && (n.suggested_actions = u.getPostsSuggestedActions([t])),
- a && a.newUserPremodBypass && (n.newUserPremodBypass = a.newUserPremodBypass),
- u.props.emitTrackingEvent({
- verb: 'mark',
- adverb: e,
- area: 'card',
- object_type: 'post',
- object_id: t,
- extra_data: JSON.stringify(n)
- })
- }),
- tA(Xx(u), 'sortPosts', function (e, r) {
- return je.a.chain(e || {
- }).values().sort(function (e, t) {
- var n = Os.parseISO8601(''.concat(e.createdAt, ' GMT')).getTime(),
- a = Os.parseISO8601(''.concat(t.createdAt, ' GMT')).getTime();
- return 'asc' === r ? n - a : 'desc' === r ? a - n : e.isFlagged && !t.isFlagged ? - 1 : !e.isFlagged && t.isFlagged ? 1 : a - n
- }).pluck('id').value()
- }),
- tA(Xx(u), 'prevPage', function () {
- u.updateActivePostIndex(Math.max(u.state.activePostIndex - MP.perPage, 0))
- }),
- tA(Xx(u), 'updateActivePost', function (e, t) {
- u.updateActivePostIndex(je.a.indexOf(u.state.sortedPosts, e), t)
- }),
- tA(Xx(u), 'activateNextPost', function () {
- u.updateActivePostIndex(u.state.activePostIndex + 1)
- }),
- tA(Xx(u), 'activatePreviousPost', function () {
- u.updateActivePostIndex(u.state.activePostIndex - 1)
- }),
- tA(Xx(u), 'updateActivePostIndex', function (e, t) {
- e < 0 || e === u.state.sortedPosts.length || u.setState({
- activePostIndex: e
- }, t)
- }),
- tA(Xx(u), 'savePostReply', function (e, t, n, a) {
- u.props.savePostReply(e, t, je.a.bind(function () {
- this.setState({
- postStatuses: je.a.defaults(tA({
- }, e, {
- current: 'approved'
- }), this.state.postStatuses)
- }, n),
- 'pending' === this.getActivePageName() && this.refreshPendingCommentsCount()
- }, Xx(u)), a)
- }),
- tA(Xx(u), 'toggleActivePostChecked', function () {
- var e = u.getActivePostId();
- u.updatePostsChecked(e, !u.state.postsChecked[e])
- }),
- tA(Xx(u), 'updatePostsChecked', function (n, a) {
- je.a.isArray(n) || (n = [
- n
- ]),
- n = je.a.reject(n, function (e) {
- return u.state.postsHidden[e]
- }),
- u.setState(function (e) {
- var t = je.a.defaults(je.a.object(n, n.map(function () {
- return a
- })), e.postsChecked);
- return {
- postsChecked: t,
- allChecked: je.a.every(this.props.posts, function (e) {
- return t[e.id]
- })
- }
- })
- }),
- tA(Xx(u), 'updateExpanded', function (e) {
- Is.a.set('moderationExpandAll', e),
- u.setState({
- allExpanded: e
- })
- }),
- tA(Xx(u), 'markCheckedPostsApproved', function () {
- u.performActionOnCheckedPosts('approve')
- }),
- tA(Xx(u), 'markCheckedPostsSpam', function () {
- u.performActionOnCheckedPosts('spam')
- }),
- tA(Xx(u), 'markCheckedPostsTrash', function () {
- u.performActionOnCheckedPosts('delete')
- }),
- tA(Xx(u), 'getCheckedPostsIds', function () {
- return je.a.chain(u.state.postsChecked).pick(je.a.identity).keys().value()
- }),
- tA(Xx(u), 'performActionOnCheckedPosts', function (e) {
- var t = u.getCheckedPostsIds();
- u.performActionOnPosts(e, t);
- var n = Object.keys(u.state.postsChecked).reduce(function (e, t) {
- return e + (u.state.postsChecked[t] ? 1 : 0)
- }, 0),
- n = Kx(Kx({
- }, u.getJesterExtraData()), {
- }, {
- num_comments: n
- });
- YP && 'pending' === n.tab && (n.suggested_actions = u.getPostsSuggestedActions(t)),
- u.props.emitTrackingEvent({
- verb: 'mark',
- adverb: e,
- area: 'actionbar',
- object_type: 'area',
- object_id: 'actionbar',
- extra_data: JSON.stringify(n)
- })
- }),
- tA(Xx(u), 'performSuggestedActionsOnCheckedPosts', function () {
- var n = 0,
- a = {
- },
- r = [
- ];
- u.getCheckedPostsIds().forEach(function (e) {
- var t = (u.props.suggestedActions[e] || {
- }).postAction;
- t && VP.posts[t] && (n += 1, a[t] = a[t] || [
- ], a[t].push(e), r.push({
- post_id: e,
- suggested_action: t
- }))
- }),
- u.props.emitTrackingEvent({
- verb: 'click',
- object_type: 'button',
- object_id: 'accept_suggested_actions',
- extra_data: JSON.stringify({
- suggested_actions: r
- })
- }),
- u.performActions(a, !1),
- u.setState({
- message: 1 === n ? 'One suggested action accepted' : ''.concat(n || 'No', ' suggested actions accepted'),
- lastActionName: 'accept_suggested_actions'
- })
- }),
- tA(Xx(u), 'performRetroactiveAction', function (t, n, e) {
- e === Wn.RETROACTIVE_ACTION_TYPES.MARK_AS_SPAM ? u.performActions({
- spam: je.a.keys(u.props.posts).filter(function (e) {
- return u.props.posts[e].author.id === n && e !== t
- })
- }, !0) : e === Wn.RETROACTIVE_ACTION_TYPES.DELETE && u.performActions({
- delete : je.a.keys(u.props.posts).filter(function (e) {
- return u.props.posts[e].author.id === n && e !== t
- })
- }, !0)
- }),
- tA(Xx(u), 'performActionOnPosts', function (e, t, n, a) {
- je.a.isArray(t) || (t = [
- t
- ]);
- var r = BP[e],
- t = je.a.chain(u.props.posts).pick(t).filter(function (e) {
- return this.state.postStatuses[e.id].current !== r.status
- }, Xx(u)).pluck('id').value();
- u.performActions(tA({
- }, e, t), n, a),
- u.setState({
- message: r.successMessage(t.length),
- lastActionName: e
- })
- }),
- tA(Xx(u), 'performActions', function (e, t, a) {
- var r,
- o,
- i,
- s,
- l,
- c = u.getActivePageName(),
- n = je.a.chain(e).values().flatten().value();
- n.length && (je.a.isArray(r = IP[c]) || (r = [
- r
- ]), o = {
- }, i = {
- }, s = 0, je.a.each(e, function (e, t) {
- var n = !je.a.contains(r, (l = BP[t]).status);
- je.a.each(e, function (e) {
- o[e] = {
- current: l.status,
- previous: this.state.postStatuses[e].current
- },
- (i[e] = n) && (s += 1)
- }, this),
- this.props.performAction(e, t, je.a.bind(function () {
- 'pending' === c && this.refreshPendingCommentsCount(),
- a && a.callback && a.callback.call(this)
- }, this), a)
- }, Xx(u)), u.setState({
- allChecked: !1,
- postsChecked: je.a.defaults(je.a.object(n, n.map(function () {
- return !1
- })), u.state.postsChecked),
- postStatuses: je.a.defaults(o, u.state.postStatuses),
- postsHidden: je.a.defaults(i, u.state.postsHidden),
- lastPostsUpdated: t ? [
- ] : n,
- message: t ? null : u.state.message
- }), u.state.sortedPosts.length - s <= 0 && u.fetchMorePosts(function () {
- var t = je.a.pick(u.getJesterExtraData(), 'num_comments', 'tab'),
- n = 'pending' === t.tab && YP;
- vo.a.when.apply(vo.a, n ? [
- u.suggestedActionsPromise
- ] : [
- ]).then(function (e) {
- n && (t.suggested_actions = u.getSuggestedActionCounts(e)),
- u.props.emitTrackingEvent({
- verb: 'view',
- object_type: 'zone',
- object_id: 'moderation_panel',
- adverb: 'auto',
- area: '' + u.state.paginatorIndex,
- extra_data: JSON.stringify(t)
- })
- })
- }))
- }),
- tA(Xx(u), 'undoAction', function () {
- var e,
- t = je.a.groupBy(u.state.lastPostsUpdated, function (e) {
- return zP[this.state.postStatuses[e].previous]
- }, Xx(u));
- 'accept_suggested_actions' === u.state.lastActionName ? e = {
- verb: 'click',
- object_type: 'button',
- object_id: 'undo_accept_suggested_actions',
- extra_data: {
- suggested_actions: u.getPostsSuggestedActions(u.state.lastPostsUpdated)
- }
- }
- : (e = {
- verb: 'mark',
- adverb: 'undo_'.concat(u.state.lastActionName),
- area: 'actionbar',
- extra_data: je.a.pick(u.getJesterExtraData(), 'filter', 'sort', 'tab')
- }, YP && 'pending' === u.getActivePageName() && (e.extra_data.suggested_actions = u.getPostsSuggestedActions(u.state.lastPostsUpdated)), 1 === u.state.lastPostsUpdated.length ? (e.object_type = 'post', e.object_id = u.state.lastPostsUpdated[0]) : (e.object_type = 'area', e.object_id = 'actionbar', e.extra_data.num_comments = u.state.lastPostsUpdated.length)),
- u.props.emitTrackingEvent(Kx(Kx({
- }, e), {
- }, {
- extra_data: JSON.stringify(e.extra_data)
- })),
- u.performActions(t, !0)
- }),
- tA(Xx(u), 'dismissMessage', function () {
- u.setState({
- message: null
- })
- }),
- tA(Xx(u), 'handleFetchMoreClick', function (e) {
- e.preventDefault(),
- u.fetchMorePosts(function () {
- var t = je.a.pick(u.getJesterExtraData(), 'num_comments', 'tab'),
- n = 'pending' === t.tab && YP;
- vo.a.when.apply(vo.a, n ? [
- u.suggestedActionsPromise
- ] : [
- ]).then(function (e) {
- n && (t.suggested_actions = u.getSuggestedActionCounts(e)),
- u.props.emitTrackingEvent({
- verb: 'click',
- object_type: 'button',
- object_id: 'show_more_comments',
- area: '' + u.state.paginatorIndex,
- extra_data: JSON.stringify(t)
- })
- })
- })
- }),
- tA(Xx(u), 'fetchMorePosts', function (e) {
- var t;
- u.props.hasMorePosts && (t = u.state.sortedPosts.length, u.props.fetchMorePosts(function () {
- u.updateActivePostIndex(t),
- u.setState(function (e) {
- return {
- paginatorIndex: e.paginatorIndex + 1
- }
- }, e)
- }))
- }),
- tA(Xx(u), 'getSearchFilterOptions', function () {
- var e,
- t = [
- {
- key: 'noIssue',
- label: 'No Issue'
- },
- {
- key: 'isAnonymous',
- label: 'Guest'
- },
- {
- key: 'isNewUserNeedsApproval',
- label: 'New Commenter'
- },
- {
- key: 'hasLinks',
- label: 'Contains Link'
- },
- {
- key: 'hasLowRep',
- label: 'Low Rep.'
- },
- {
- key: 'hasBadWords',
- label: 'Restricted Word'
- },
- {
- key: 'isFlagged',
- label: 'Flagged'
- },
- {
- key: 'isAtFlagLimit',
- label: 'Flagged At Threshold'
- },
- {
- key: 'hasMedia',
- label: 'Contains Media'
- },
- {
- key: 'isToxic',
- label: 'Toxic'
- }
- ],
- n = u.props.saasFeatures[(u.props.selection.organization || {
- }).id] || {
- };
- return u.props.selection.type === ft.forum ? e = yo.a.isFeatureActive('thehive', {
- forum: u.props.selection.forum.shortname
- }) : u.props.selection.type === ft.organization && (e = Object.keys(u.props.selection.organizationForums).some(function (e) {
- return yo.a.isFeatureActive('thehive', {
- forum: e
- })
- })),
- u.props.selection.organization && n.isFetched && (n.allModRules || e) && t.push({
- key: 'isHate',
- label: 'Hate Speech'
- }, {
- key: 'isBullying',
- label: 'Bullying'
- }, {
- key: 'isSexual',
- label: 'Sexual'
- }, {
- key: 'isViolence',
- label: 'Violence'
- }, {
- key: 'isPromotion',
- label: 'Promotion'
- }),
- t.push({
- key: 'modifiedByRule',
- label: 'Moderation Rules'
- }),
- 'pending' === u.getActivePageName() && t.forEach(function (e) {
- var t = u.props.pendingCounts[e.key];
- je.a.isNumber(t) && (e.label += ' ('.concat(u.getPendingCount(t), ')'))
- }),
- t
- }),
- tA(Xx(u), 'getPendingCount', function (e) {
- return TP <= e ? ''.concat(TP, '+') : e
- }),
- tA(Xx(u), 'toggleReactions', function (e) {
- e && e.preventDefault();
- e = u.props.posts[u.state.panelPostId].thread;
- u.props.toggleReactions(e.id, !e.reactionsEnabled)
- }),
- tA(Xx(u), 'toggleThreadClosed', function (e) {
- e && e.preventDefault(),
- u.props.isTogglingClosed || u.props.toggleThreadClosed((e = u.props.posts[u.state.panelPostId].thread).id, !e.isClosed)
- }),
- tA(Xx(u), 'toggleThreadPremoderation', function (e) {
- e && e.preventDefault(),
- u.props.emitTrackingEvent({
- verb: 'click',
- section: 'default',
- area: 'user_sidebar',
- object_type: 'button',
- object_id: 'premoderate_thread'
- });
- e = u.props.posts[u.state.panelPostId].thread;
- u.props.toggleThreadPremoderation(e.id, !e.validateAllPosts)
- }),
- tA(Xx(u), 'showBadgesModal', function (e) {
- u.props.updateBadgesModal({
- isOpen: !0,
- forum: e.forum || u.state.panelForum,
- author: u.state.panelAuthor || u.props.author
- })
- }),
- tA(Xx(u), 'handleUpdateBadges', function (e, t) {
- u.setState(function (e) {
- return {
- panelAuthor: je.a.defaults({
- badges: t
- }, e.panelAuthor)
- }
- }, function () {
- return u.props.updateUserBadges(e, t)
- })
- }),
- tA(Xx(u), 'sidePanelSearch', function (e) {
- e = e.searchQuery;
- u.updateUrl({
- search: e
- }),
- u.updateFetchData({
- searchQuery: e
- })
- }),
- tA(Xx(u), 'updateApproveModal', function (e) {
- var t = e.approveModalIsOpen,
- n = e.approveModalPostId,
- a = e.approveModalAuthor;
- u.setState(function (e) {
- return {
- approveModalIsOpen: 'boolean' == typeof t ? t : e.approveModalIsOpen,
- approveModalPostId: n || e.approveModalPostId,
- approveModalAuthor: a || e.approveModalAuthor
- }
- })
- }),
- u
- }
- return e = r,
- (t = [
- {
- key: 'navigateToPage',
- value: function (e) {
- var t = this;
- this.updateUrl({
- tab: e = e || MP.page
- });
- var n = this.getActivePageName();
- return this.updateActivePage(e, function () {
- t.updateFetchData({
- pageType: e
- }, function () {
- t.jesterEmitTabChange(e, n)
- })
- })
- }
- },
- {
- key: 'componentDidMount',
- value: function () {
- this.props.params.tab || this.props.history.push(ho.getRoute('/moderate/'.concat(this.props.pages[this.state.activePageIndex]))),
- this._hasEmitWelcomeEvent = !1,
- this._readyToEmitTabEvents = !1,
- this.refreshPendingCommentsCount(),
- this.checkFeatureMessage(),
- this.navigateToPage(this.props.pages[this.state.activePageIndex]),
- this.props.addHotkeys(je.a.map(HP, function (e, t) {
- return je.a.isString(e) && (e = {
- callbackName: e
- }),
- je.a.extend({
- keyName: t,
- callback: je.a.partial.apply(je.a, [
- this[e.callbackName]
- ].concat(Wx(e.callbackArgs || [
- ]))),
- options: {
- }
- }, e)
- }, this)),
- this.anchorPanel = je.a.throttle(this.anchorPanel, 250),
- this.resizePanel = je.a.debounce(this.resizePanel, 100),
- window.addEventListener('scroll', this.anchorPanel),
- window.addEventListener('resize', this.resizePanel)
- }
- },
- {
- key: 'componentWillUnmount',
- value: function () {
- window.removeEventListener('scroll', this.anchorPanel),
- window.removeEventListener('resize', this.resizePanel)
- }
- },
- {
- key: 'componentWillReceiveProps',
- value: function (e) {
- var t,
- n;
- this.props.saasFeatures !== e.saasFeatures && this.checkFeatureMessage(e),
- this.props.postsAreFetching && !e.postsAreFetching || this.checkPostSetsDifferent(this.props.posts, e.posts) ? (t = this.getPostStatuses(e.posts), this.setState({
- postStatuses: t,
- sortedPosts: this.sortPosts(e.posts, e.sortOrder),
- activePostIndex: null
- }, je.a.partial(this.updateActivePostIndex, 0)), YP && (this.suggestedActionsPromise = this.props.fetchSuggestedActions(Object.keys(e.posts).filter(function (e) {
- return 'unapproved' === t[e].current
- })))) : this.props.postsAreUpdating && !e.postsAreUpdating ? (n = this.getPostStatuses(e.posts), this.setState({
- postStatuses: n
- })) : e.sortOrder !== this.props.sortOrder ? this.setState({
- sortedPosts: this.sortPosts(e.posts, e.sortOrder),
- activePostIndex: null
- }, je.a.partial(this.updateActivePostIndex, 0)) : e.searchQuery !== this.props.searchQuery ? this.updateUrl({
- search: e.searchQuery
- }) : e.startDate !== this.props.startDate || e.endDate !== this.props.endDate ? this.refreshPendingCommentsCount(e) : this.props.params.tab !== e.params.tab ? this.navigateToPage(e.params.tab) : je.a.isEqual(this.props.searchFilters, e.searchFilters) || this.updateUrl({
- filters: e.searchFilters
- })
- }
- },
- {
- key: 'componentDidUpdate',
- value: function (e, t) {
- this.state.panelOpen && !t.panelOpen && this.anchorPanel(),
- this.state.panelFixed === t.panelFixed && je.a.isEqual(this.state.panelAuthor, t.panelAuthor) || this.resizePanel()
- }
- },
- {
- key: 'render',
- value: function () {
- var n = this;
- if (this.props.selection.organization && this.props.selection.organization.pollsOnly) return C.a.createElement(Cm, {
- isPolls: !1,
- organization: this.props.selection.organization
- });
- var e,
- t = !!this.state.sortedPosts[this.state.activePostIndex] && this.props.posts[this.state.sortedPosts[this.state.activePostIndex]],
- a = Object.keys(this.state.postsChecked).reduce(function (e, t) {
- return e + (n.state.postsChecked[t] ? 1 : 0)
- }, 0),
- r = this.getActivePageName(),
- o = {
- all: 'All',
- approved: 'Approved',
- pending: 'Pending ('.concat(this.getPendingCount(this.props.pendingCounts.total), ')'),
- spam: 'Spam',
- deleted: 'Deleted'
- },
- i = C.a.createElement('div', {
- className: 'mod-bar'
- }, C.a.createElement(vR, {
- postIds: Object.keys(this.props.posts).filter(function (e) {
- return !n.props.posts[e].isDeletedByAuthor
- }),
- performAction: this.performActionOnCheckedPosts,
- performSuggestedActions: this.performSuggestedActionsOnCheckedPosts,
- canUndo: !!this.state.lastPostsUpdated.length,
- undoAction: this.undoAction,
- updatePostsChecked: this.updatePostsChecked,
- allChecked: this.state.allChecked,
- updateExpanded: this.updateExpanded,
- allExpanded: this.state.allExpanded,
- dismissMessage: this.dismissMessage,
- actionCompleteMessage: this.state.message,
- activePage: r,
- sortOrder: this.props.sortOrder,
- searchQuery: this.props.searchQuery,
- updateFetchData: this.updateFetchData,
- startDate: this.props.startDate,
- endDate: this.props.endDate,
- maxDate: this.state.maxDate,
- minDate: this.state.minDate,
- numChecked: a,
- panelOpen: this.state.panelOpen,
- searchFilters: this.props.searchFilters,
- searchFilterOptions: this.getSearchFilterOptions()
- }));
- e = this.props.postsAreFetching ? C.a.createElement(Ji, null) : 0 < this.state.sortedPosts.length ? null : 'pending' === r && 0 === this.props.pendingCounts.total ? C.a.createElement('div', {
- className: 'text-medium padding-default'
- }, C.a.createElement('img', {
- className: 'moderation__empty',
- src: '//c.disquscdn.com/next/current/publisher-admin/assets/img/empty.png'
- }), C.a.createElement('div', {
- className: 'text-bold text-largest text-gray-darker text-center spacing-bottom-narrow'
- }, 'Nice work! You\'ve moderated all Pending comments.'), C.a.createElement('div', {
- className: 'text-gray-darker text-center'
- }, 'Want to learn more about fostering a thriving community? Check out our ', C.a.createElement('a', {
- href: 'https://help.disqus.com/customer/en/portal/topics/637329-community-tips/articles'
- }, 'Community Tips'))) : C.a.createElement('div', {
- className: 'text-medium padding-default'
- }, C.a.createElement('img', {
- className: 'moderation__empty',
- src: '//c.disquscdn.com/next/current/publisher-admin/assets/img/empty.png'
- }), C.a.createElement('div', {
- className: 'text-bold text-largest text-gray-darker text-center spacing-bottom-narrow'
- }, 'No comments match this status, filter, or search.'), C.a.createElement('div', {
- className: 'text-gray-darker text-center'
- }, 'Click another status tab, or adjust your search or filtering method.'));
- function s(e) {
- var t = e.panelType,
- e = e.label;
- return C.a.createElement('button', {
- className: 'side-panel__tab'.concat(n.state.panelType === t ? ' -active' : ''),
- onClick: function () {
- return n.setState({
- panelType: t
- })
- }
- }, e)
- }
- var l = null,
- c = null;
- return this.state.panelOpen && (l = C.a.createElement(_x, {
- onRequestClose: this.hidePanel,
- status: a = this.state.postStatuses[this.state.panelPostId].current
- }, 'This comment is ', 'unapproved' === a ? 'pending' : a), this.state.panelType === nA.USER && (c = C.a.createElement(nx, {
- key: 'user-panel',
- post: this.props.posts[this.state.panelPostId],
- selection: this.props.selection,
- activePage: r,
- showBadgesModal: this.showBadgesModal,
- toggleThreadClosed: this.toggleThreadClosed,
- toggleThreadPremoderation: this.toggleThreadPremoderation,
- updateSearch: this.sidePanelSearch
- })), this.state.panelType === nA.POST && (c = C.a.createElement(Ex, {
- key: 'post-panel',
- post: this.props.posts[this.state.panelPostId],
- activePage: r,
- showUserPanelFromThread: this.showUserPanelFromThread,
- showBadgesModal: this.showBadgesModal,
- toggleReactions: this.toggleReactions,
- toggleThreadClosed: this.toggleThreadClosed,
- toggleThreadPremoderation: this.toggleThreadPremoderation,
- updateSearch: this.sidePanelSearch
- })), this.state.panelType === nA.HISTORY && (c = C.a.createElement(BR, {
- key: 'history-panel',
- activePage: r,
- post: this.props.posts[this.state.panelPostId],
- updateSearch: this.sidePanelSearch
- }))),
- C.a.createElement('div', {
- className: 'moderation__wrapper'
- }, C.a.createElement('div', {
- id: 'primary',
- className: 'moderation__content'.concat(this.state.panelOpen ? ' panel-open' : '')
- }, C.a.createElement('ul', {
- className: 'nav-tab-rounded'
- }, this.props.pages.map(function (e) {
- return C.a.createElement('li', {
- className: r === e ? 'nav-tab-rounded__item active' : 'nav-tab-rounded__item',
- key: e
- }, C.a.createElement(v.Link, {
- to: n.getUrl({
- tab: e
- }),
- className: 'nav-tab-rounded__link'
- }, C.a.createElement('span', {
- className: 'align align--middle'
- }, WP[e] ? C.a.createElement('span', {
- className: 'spacing-right-small icon '.concat(WP[e])
- }) : null, o[e])))
- })), i, C.a.createElement('div', {
- id: 'new-comments',
- className: 'alert-message info',
- style: {
- display: 'none'
- }
- }, C.a.createElement('span', {
- className: 'pull-right'
- }, C.a.createElement('a', {
- href: '#',
- className: 'btn small'
- }, 'Show comments')), C.a.createElement('p', null, '2 new comments')), C.a.createElement('ul', {
- className: 'comment-moderate__wrapper'
- }, e, this.state.sortedPosts.map(function (e, t) {
- var n = this.props.posts[e];
- return C.a.createElement(QC, Vx({
- key: e,
- shadowBanned: n.sb,
- showUserPanel: this.showUserPanel,
- activePage: r,
- togglePostPanelVisible: this.handlePostClick,
- checked: !!this.state.postsChecked[e],
- updateChecked: this.updatePostsChecked,
- updateExpanded: this.updateExpanded,
- allExpanded: this.state.allExpanded,
- status: this.state.postStatuses[e].current,
- hidden: !!this.state.postsHidden[e],
- updateVote: this.props.updateVote,
- updateMessage: this.handlePostMessageUpdate,
- saveReply: this.savePostReply,
- performActionOnPost: this.handlePostAction,
- isActive: t === this.state.activePostIndex,
- updateActivePost: this.updateActivePost,
- updateFetchData: this.updateFetchData,
- suggestedAction: 'pending' === r ? this.props.suggestedActions[e] : null,
- searchQuery: this.props.searchQuery,
- searchFilters: this.props.searchFilters,
- selection: this.props.selection,
- fetchAllFlaggers: this.props.fetchFlaggers.bind(this, tA({
- }, n.id, n), n.numReports),
- updateApproveModal: this.updateApproveModal
- }, n))
- }, this)), C.a.createElement('div', {
- className: 'moderation__footer'
- }, this.props.posts && 0 < this.state.sortedPosts.length ? C.a.createElement('button', {
- className: 'button button-wide button-outline button-medium',
- disabled: !0 !== this.props.hasMorePosts,
- onClick: this.handleFetchMoreClick
- }, 'Show more comments') : null)), C.a.createElement('div', {
- id: 'secondary',
- ref: this.panelContainer,
- className: 'moderation__panel'.concat(this.state.panelOpen ? ' panel-open' : '')
- }, this.state.panelOpen ? C.a.createElement('div', {
- className: 'side-panel__wrapper'.concat(this.state.panelFixed ? ' fixed' : ''),
- ref: this.panel
- }, C.a.createElement('div', {
- className: 'side-panel',
- style: {
- maxHeight: this.state.panelMaxHeight
- }
- }, l, C.a.createElement(vx, {
- key: this.state.panelPostId,
- auth: this.props.auth,
- author: this.state.panelAuthor,
- postId: this.state.panelPostId,
- forum: this.state.panelForum,
- ipAddress: this.state.panelIpAddress,
- selection: this.props.selection,
- updateFetchData: this.updateFetchData,
- updateActivePage: this.updateActivePage
- }), C.a.createElement('div', {
- className: 'align side-panel__tab-container'
- }, s({
- panelType: nA.POST,
- label: 'Thread'
- }), s({
- panelType: nA.USER,
- label: 'Comments'
- }), s({
- panelType: nA.HISTORY,
- label: 'History'
- })), c)) : null, t ? C.a.createElement(xx, {
- postId: this.state.approveModalPostId || t.id,
- user: this.state.approveModalAuthor || t.author,
- isOpen: this.state.approveModalIsOpen,
- forum: this.state.panelForum || t.forum,
- close: function () {
- return n.updateApproveModal({
- approveModalIsOpen: !1,
- approveModalPostId: n.state.approveModalPostId || t.id,
- approveModalAuthor: n.state.approveModalAuthor || t.author
- })
- },
- performAction: this.handlePostAction
- }) : null, t ? C.a.createElement(ll, {
- postId: this.state.panelPostId || t.id,
- user: this.state.panelAuthor || t.author,
- ipAddress: this.state.panelIpAddress || t.ipAddress,
- selection: this.props.selection,
- forum: this.state.panelForum || t.forum,
- addUserToBlacklist: this.props.addUserToBlacklist,
- performRetroactiveAction: this.performRetroactiveAction,
- addUserToWhitelist: this.props.addUserToWhitelist,
- close: function () {
- return n.props.updateUserListsModal({
- isOpen: !1,
- postId: n.state.panelPostId || t.id,
- author: n.state.panelAuthor || t.author
- })
- },
- performActionOnReplacedCancel: this.handlePostAction
- }) : null, C.a.createElement(Hx, {
- user: this.state.panelAuthor || t.author,
- forum: this.state.panelForum || t.forum,
- selection: this.props.selection,
- updateUserBadges: this.handleUpdateBadges,
- close: function () {
- return n.props.updateBadgesModal({
- isOpen: !1,
- author: n.state.panelAuthor || t.author
- })
- }
- })), this.state.isHelpVisible ? C.a.createElement(Ox, {
- closeModal: this.toggleHelpVisible
- }) : null)
- }
- }
- ]) && Jx(e.prototype, t),
- n && Jx(e, n),
- r
- }();
- tA(Yc, 'propTypes', {
- posts: b.a.objectOf(b.a.shape(Qs)),
- searchQuery: b.a.string,
- updateFetchData: b.a.func.isRequired,
- performAction: b.a.func.isRequired,
- updateVote: b.a.func.isRequired,
- updatePostMessage: b.a.func.isRequired,
- savePostReply: b.a.func.isRequired,
- sortOrder: b.a.string.isRequired,
- hasMorePosts: b.a.bool,
- fetchMorePosts: b.a.func.isRequired,
- refreshPosts: b.a.func.isRequired,
- postsAreFetching: b.a.bool,
- postsAreUpdating: b.a.bool,
- fetchThreadReactionsEnabled: b.a.func.isRequired,
- toggleReactions: b.a.func.isRequired,
- toggleThreadClosed: b.a.func.isRequired,
- toggleThreadPremoderation: b.a.func.isRequired,
- isTogglingClosed: b.a.bool,
- getPostParents: b.a.func.isRequired,
- searchFilters: b.a.arrayOf(b.a.string).isRequired,
- startDate: s.moment,
- endDate: s.moment,
- fetchFlaggers: b.a.func.isRequired,
- updateUserBadges: b.a.func.isRequired,
- pendingCounts: b.a.objectOf(b.a.number).isRequired,
- refreshPendingCommentsCount: b.a.func.isRequired,
- addHotkeys: b.a.func.isRequired,
- emitTrackingEvent: b.a.func.isRequired,
- addUserToWhitelist: b.a.func.isRequired,
- addUserToBlacklist: b.a.func.isRequired,
- showFeaturedMessage: b.a.func.isRequired,
- history: b.a.shape({
- push: b.a.func.isRequired
- }).isRequired,
- pages: b.a.array.isRequired,
- params: b.a.object.isRequired,
- auth: b.a.object.isRequired,
- selection: ht.isRequired,
- searchChangeActive: b.a.func.isRequired,
- fetchSuggestedActions: b.a.func.isRequired,
- updateUserListsModal: b.a.func.isRequired,
- updateBadgesModal: b.a.func.isRequired,
- suggestedActions: b.a.objectOf(b.a.shape({
- reasons: b.a.arrayOf(b.a.string).isRequired,
- postAction: b.a.oneOf(['approve',
- 'delete',
- 'spam',
- 'unapprove']),
- userAction: b.a.oneOf(['permaban',
- 'tempban',
- 'shadowban'])
- })),
- saasFeatures: b.a.objectOf(b.a.objectOf(b.a.bool)).isRequired
- }),
- tA(Yc, 'defaultProps', {
- pages: [
- 'pending',
- 'approved',
- 'spam',
- 'deleted',
- 'all'
- ]
- });
- I = Ni.a.attachDrivers(Object(u.connect) (function (e) {
- return {
- suggestedActions: e.suggestedActions,
- saasFeatures: e.saasFeatures,
- selection: e.selection
- }
- }, {
- updateBadgesModal: D.updateBadgesModal,
- updateUserListsModal: Js.updateUserListsModal,
- searchChangeActive: I.changeActive,
- fetchSuggestedActions: F.fetch,
- emitTrackingEvent: Xo({
- zone: 'moderation_panel',
- section: 'welcome',
- product: 'publisher_admin'
- })
- }) (Fo() (Yc)), [
- Ru(['moderationRules']),
- Wi,
- go,
- Ls,
- yl
- ]);
- function rA(e) {
- return (rA = 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator ? function (e) {
- return typeof e
- }
- : function (e) {
- return e && 'function' == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? 'symbol' : typeof e
- }) (e)
- }
- function oA(e, t) {
- for (var n = 0; n < t.length; n++) {
- var a = t[n];
- a.enumerable = a.enumerable || !1,
- a.configurable = !0,
- 'value' in a && (a.writable = !0),
- Object.defineProperty(e, a.key, a)
- }
- }
- function iA(e, t) {
- return (iA = Object.setPrototypeOf || function (e, t) {
- return e.__proto__ = t,
- e
- }) (e, t)
- }
- function sA(n) {
- var a = function () {
- if ('undefined' == typeof Reflect || !Reflect.construct) return !1;
- if (Reflect.construct.sham) return !1;
- if ('function' == typeof Proxy) return !0;
- try {
- return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [
- ], function () {
- })),
- !0
- } catch (e) {
- return !1
- }
- }();
- return function () {
- var e,
- t = lA(n);
- return e = a ? (e = lA(this).constructor, Reflect.construct(t, arguments, e)) : t.apply(this, arguments),
- t = this,
- !(e = e) || 'object' !== rA(e) && 'function' != typeof e ? function (e) {
- if (void 0 !== e) return e;
- throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called')
- }(t) : e
- }
- }
- function lA(e) {
- return (lA = Object.setPrototypeOf ? Object.getPrototypeOf : function (e) {
- return e.__proto__ || Object.getPrototypeOf(e)
- }) (e)
- }
- function cA(e, t, n) {
- return t in e ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n,
- e
- }
- F = function () {
- !function (e, t) {
- if ('function' != typeof t && null !== t) throw new TypeError('Super expression must either be null or a function');
- e.prototype = Object.create(t && t.prototype, {
- constructor: {
- value: e,
- writable: !0,
- configurable: !0
- }
- }),
- t && iA(e, t)
- }(r, A);
- var e,
- t,
- n,
- a = sA(r);
- function r() {
- return function (e, t) {
- if (!(e instanceof t)) throw new TypeError('Cannot call a class as a function')
- }(this, r),
- a.apply(this, arguments)
- }
- return e = r,
- (t = [
- {
- key: 'render',
- value: function () {
- return C.a.createElement('div', {
- className: 'section-contained padding-top'
- }, C.a.createElement('div', {
- className: 'layout layout__content--narrow'
- }, C.a.createElement(wE, {
- selection: this.props.selection,
- history: this.props.history
- })))
- }
- }
- ]) && oA(e.prototype, t),
- n && oA(e, n),
- r
- }();
- cA(F, 'displayName', 'SetupPolicy'),
- cA(F, 'propTypes', {
- history: b.a.object.isRequired,
- selection: ht.isRequired
- });
- Yc = Object(u.connect) (function (e) {
- return {
- selection: e.selection
- }
- }) (Ni.a.attachDrivers(Fo() (F), [
- rc
- ]));
- function uA(e) {
- return (uA = 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator ? function (e) {
- return typeof e
- }
- : function (e) {
- return e && 'function' == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? 'symbol' : typeof e
- }) (e)
- }
- function pA(e, t) {
- for (var n = 0; n < t.length; n++) {
- var a = t[n];
- a.enumerable = a.enumerable || !1,
- a.configurable = !0,
- 'value' in a && (a.writable = !0),
- Object.defineProperty(e, a.key, a)
- }
- }
- function dA(e, t) {
- return (dA = Object.setPrototypeOf || function (e, t) {
- return e.__proto__ = t,
- e
- }) (e, t)
- }
- function mA(n) {
- var a = function () {
- if ('undefined' == typeof Reflect || !Reflect.construct) return !1;
- if (Reflect.construct.sham) return !1;
- if ('function' == typeof Proxy) return !0;
- try {
- return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [
- ], function () {
- })),
- !0
- } catch (e) {
- return !1
- }
- }();
- return function () {
- var e,
- t = fA(n);
- return e = a ? (e = fA(this).constructor, Reflect.construct(t, arguments, e)) : t.apply(this, arguments),
- t = this,
- !(e = e) || 'object' !== uA(e) && 'function' != typeof e ? function (e) {
- if (void 0 !== e) return e;
- throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called')
- }(t) : e
- }
- }
- function fA(e) {
- return (fA = Object.setPrototypeOf ? Object.getPrototypeOf : function (e) {
- return e.__proto__ || Object.getPrototypeOf(e)
- }) (e)
- }
- var hA,
- gA,
- yA,
- bA = function () {
- !function (e, t) {
- if ('function' != typeof t && null !== t) throw new TypeError('Super expression must either be null or a function');
- e.prototype = Object.create(t && t.prototype, {
- constructor: {
- value: e,
- writable: !0,
- configurable: !0
- }
- }),
- t && dA(e, t)
- }(r, A);
- var e,
- t,
- n,
- a = mA(r);
- function r() {
- return function (e, t) {
- if (!(e instanceof t)) throw new TypeError('Cannot call a class as a function')
- }(this, r),
- a.apply(this, arguments)
- }
- return e = r,
- (t = [
- {
- key: 'componentDidMount',
- value: function () {
- window._v5Config.moderated_forums.length || (window.location = '/pricing/'),
- Au.openCurrentInstance(this.props.adminPath)
- }
- },
- {
- key: 'render',
- value: function () {
- var e = uo.getSupportedSelections(this.props.adminPath),
- t = [
- ];
- return e.forum && t.push('site'),
- e.organization && t.push('organization'),
- C.a.createElement('div', {
- className: 'layout'
- }, C.a.createElement('div', {
- className: 'admin_content'
- }, C.a.createElement('h2', {
- className: 'text-gray-darker text-larger spacing-bottom-small'
- }, this.props.route.title || this.props.children && this.props.children.props.route.title), C.a.createElement(bO, {
- path: this.props.adminPath
- }, 'You must select a', 'organization' === t[0] ? 'n' : '', ' ', t.join(' or '), ' for this page')))
- }
- }
- ]) && pA(e.prototype, t),
- n && pA(e, n),
- r
- }();
- function vA(e) {
- return (vA = 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator ? function (e) {
- return typeof e
- }
- : function (e) {
- return e && 'function' == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? 'symbol' : typeof e
- }) (e)
- }
- function _A(e, t) {
- for (var n = 0; n < t.length; n++) {
- var a = t[n];
- a.enumerable = a.enumerable || !1,
- a.configurable = !0,
- 'value' in a && (a.writable = !0),
- Object.defineProperty(e, a.key, a)
- }
- }
- function EA(e, t) {
- return (EA = Object.setPrototypeOf || function (e, t) {
- return e.__proto__ = t,
- e
- }) (e, t)
- }
- function OA(n) {
- var a = function () {
- if ('undefined' == typeof Reflect || !Reflect.construct) return !1;
- if (Reflect.construct.sham) return !1;
- if ('function' == typeof Proxy) return !0;
- try {
- return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [
- ], function () {
- })),
- !0
- } catch (e) {
- return !1
- }
- }();
- return function () {
- var e,
- t = wA(n);
- return e = a ? (e = wA(this).constructor, Reflect.construct(t, arguments, e)) : t.apply(this, arguments),
- t = this,
- !(e = e) || 'object' !== vA(e) && 'function' != typeof e ? SA(t) : e
- }
- }
- function SA(e) {
- if (void 0 === e) throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called');
- return e
- }
- function wA(e) {
- return (wA = Object.setPrototypeOf ? Object.getPrototypeOf : function (e) {
- return e.__proto__ || Object.getPrototypeOf(e)
- }) (e)
- }
- function PA(e, t, n) {
- return t in e ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n,
- e
- }
- hA = bA,
- gA = 'propTypes',
- yA = {
- adminPath: b.a.string.isRequired,
- route: b.a.shape({
- title: b.a.string
- }).isRequired,
- children: b.a.element
- },
- gA in hA ? Object.defineProperty(hA, gA, {
- value: yA,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : hA[gA] = yA;
- Ru = function () {
- !function (e, t) {
- if ('function' != typeof t && null !== t) throw new TypeError('Super expression must either be null or a function');
- e.prototype = Object.create(t && t.prototype, {
- constructor: {
- value: e,
- writable: !0,
- configurable: !0
- }
- }),
- t && EA(e, t)
- }(o, A);
- var e,
- t,
- n,
- r = OA(o);
- function o() {
- var e;
- !function (e, t) {
- if (!(e instanceof t)) throw new TypeError('Cannot call a class as a function')
- }(this, o);
- for (var t = arguments.length, n = Array(t), a = 0; a < t; a++) n[a] = arguments[a];
- return PA(SA(e = r.call.apply(r, [
- this
- ].concat(n))), 'handleDismiss', function () {
- Is.a.set('audienceAnalyticsMessage', !0),
- e.setState({
- audienceAnalyticsMessage: !0
- })
- }),
- e
- }
- return e = o,
- (t = [
- {
- key: 'render',
- value: function () {
- var e = this;
- return Is.a.get('audienceAnalyticsMessage') ? null : C.a.createElement(Ki, {
- alertType: 'brand-new',
- topMarginClass: 'spacing-top-none',
- message: C.a.createElement(C.a.Fragment, null, C.a.createElement('span', {
- className: 'text-larger text-semibold'
- }, 'Explore Audience Analytics'), C.a.createElement('div', {
- className: 'suggested-actions__module'
- }, C.a.createElement('div', {
- className: 'spacing-narrow spacing-bottom'
- }, C.a.createElement('ul', {
- className: 'suggested-actions__list'
- }, C.a.createElement('li', {
- className: 'suggested-actions__item'
- }, C.a.createElement('span', {
- className: 'icon-lightning'
- }), C.a.createElement('span', {
- className: 'text'
- }, 'Identify the most active and loyal members of your community')), C.a.createElement('li', {
- className: 'suggested-actions__item'
- }, C.a.createElement('span', {
- className: 'icon-lightning'
- }), C.a.createElement('span', {
- className: 'text'
- }, 'Track the growth of your community over time')), C.a.createElement('li', {
- className: 'suggested-actions__item'
- }, C.a.createElement('span', {
- className: 'icon-lightning'
- }), C.a.createElement('span', {
- className: 'text'
- }, 'Develop engagement insights about different audience segments')))), C.a.createElement('a', {
- href: Pn.audienceAnalytics,
- className: 'button button-large button-fill--white text-medium spacing-narrow spacing-right',
- target: '_blank',
- rel: 'noopener noreferrer',
- onClick: function () {
- e.props.emitTrackingEvent({
- verb: 'click',
- object_type: 'link',
- object_id: Pn.audienceAnalytics,
- adverb: 'learn_more',
- area: 'welcome'
- })
- }
- }, 'Learn more'), C.a.createElement('button', {
- className: 'button button-large button-fill--brand text-medium spacing-narrow',
- target: '_blank',
- rel: 'noopener noreferrer',
- onClick: this.handleDismiss
- }, 'Dismiss')))
- })
- }
- }
- ]) && _A(e.prototype, t),
- n && _A(e, n),
- o
- }();
- PA(Ru, 'displayName', 'AudienceAnalyticsFeaturedMessage'),
- PA(Ru, 'propTypes', {
- emitTrackingEvent: b.a.func.isRequired
- });
- Wi = Ni.a.attachDrivers(Ru, [
- rc
- ]);
- function kA(e) {
- return (kA = 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator ? function (e) {
- return typeof e
- }
- : function (e) {
- return e && 'function' == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? 'symbol' : typeof e
- }) (e)
- }
- function NA(t, e) {
- var n,
- a = Object.keys(t);
- return Object.getOwnPropertySymbols && (n = Object.getOwnPropertySymbols(t), e && (n = n.filter(function (e) {
- return Object.getOwnPropertyDescriptor(t, e).enumerable
- })), a.push.apply(a, n)),
- a
- }
- function CA(t) {
- for (var e = 1; e < arguments.length; e++) {
- var n = null != arguments[e] ? arguments[e] : {
- };
- e % 2 ? NA(Object(n), !0).forEach(function (e) {
- TA(t, e, n[e])
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(n)) : NA(Object(n)).forEach(function (e) {
- Object.defineProperty(t, e, Object.getOwnPropertyDescriptor(n, e))
- })
- }
- return t
- }
- function RA(e, t) {
- for (var n = 0; n < t.length; n++) {
- var a = t[n];
- a.enumerable = a.enumerable || !1,
- a.configurable = !0,
- 'value' in a && (a.writable = !0),
- Object.defineProperty(e, a.key, a)
- }
- }
- function xA(e, t) {
- return (xA = Object.setPrototypeOf || function (e, t) {
- return e.__proto__ = t,
- e
- }) (e, t)
- }
- function AA(n) {
- var a = function () {
- if ('undefined' == typeof Reflect || !Reflect.construct) return !1;
- if (Reflect.construct.sham) return !1;
- if ('function' == typeof Proxy) return !0;
- try {
- return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [
- ], function () {
- })),
- !0
- } catch (e) {
- return !1
- }
- }();
- return function () {
- var e,
- t = jA(n);
- return e = a ? (e = jA(this).constructor, Reflect.construct(t, arguments, e)) : t.apply(this, arguments),
- t = this,
- !(e = e) || 'object' !== kA(e) && 'function' != typeof e ? DA(t) : e
- }
- }
- function DA(e) {
- if (void 0 === e) throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called');
- return e
- }
- function jA(e) {
- return (jA = Object.setPrototypeOf ? Object.getPrototypeOf : function (e) {
- return e.__proto__ || Object.getPrototypeOf(e)
- }) (e)
- }
- function TA(e, t, n) {
- return t in e ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n,
- e
- }
- go = function () {
- !function (e, t) {
- if ('function' != typeof t && null !== t) throw new TypeError('Super expression must either be null or a function');
- e.prototype = Object.create(t && t.prototype, {
- constructor: {
- value: e,
- writable: !0,
- configurable: !0
- }
- }),
- t && xA(e, t)
- }(o, A);
- var e,
- t,
- n,
- r = AA(o);
- function o() {
- var t;
- !function (e, t) {
- if (!(e instanceof t)) throw new TypeError('Cannot call a class as a function')
- }(this, o);
- for (var e = arguments.length, n = Array(e), a = 0; a < e; a++) n[a] = arguments[a];
- return TA(DA(t = r.call.apply(r, [
- this
- ].concat(n))), 'emitTrackingEvent', function (e) {
- return t.props.orgCurrentPackage && t.props.forumDetails ? void t.props.emitTrackingEvent(CA({
- extra_data: JSON.stringify({
- package: t.props.orgCurrentPackage.name,
- aetBannerEnabled: t.props.forumDetails.aetBannerEnabled
- })
- }, e)) : (t.trackingQueue || (t.trackingQueue = [
- ]), void t.trackingQueue.push(t.emitTrackingEvent.bind(DA(t), e)))
- }),
- t
- }
- return e = o,
- (t = [
- {
- key: 'componentDidMount',
- value: function () {
- this.props.fetchSubscription(),
- this.props.fetchForumDetails()
- }
- },
- {
- key: 'componentDidUpdate',
- value: function () {
- if (this.trackingQueue && this.props.orgCurrentPackage && this.props.forumDetails) {
- for (var e; e = this.trackingQueue.shift(); ) e();
- delete this.trackingQueue
- }
- }
- },
- {
- key: 'render',
- value: function () {
- return C.a.cloneElement(this.props.children, CA(CA({
- }, this.props), {
- }, {
- emitTrackingEvent: this.emitTrackingEvent
- }))
- }
- }
- ]) && RA(e.prototype, t),
- n && RA(e, n),
- o
- }();
- TA(go, 'propTypes', {
- children: b.a.node,
- selection: ht,
- fetchSubscription: b.a.func.isRequired,
- fetchForumDetails: b.a.func.isRequired,
- emitTrackingEvent: b.a.func.isRequired,
- forumDetails: $c,
- orgCurrentPackage: Ur.PACKAGE_SHAPE
- });
- var IA = Object(u.connect) (function (e) {
- var t = e.subscription;
- return CA(CA({
- }, e.forumDetails), t)
- }, CA(CA(CA({
- }, r), a), {
- }, {
- emitTrackingEvent: Xo({
- zone: 'analytics',
- section: 'audience_user_table'
- })
- })) (Ni.a.attachDrivers(go, [
- bc
- ])),
- qA = Object(u.connect) (function (e) {
- var t = e.subscription;
- return CA(CA({
- }, e.forumDetails), t)
- }, CA(CA(CA({
- }, r), a), {
- }, {
- emitTrackingEvent: Xo({
- zone: 'analytics',
- section: 'reaction_analytics'
- })
- })) (Ni.a.attachDrivers(go, [
- bc
- ]));
- function FA(e) {
- return (FA = 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator ? function (e) {
- return typeof e
- }
- : function (e) {
- return e && 'function' == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? 'symbol' : typeof e
- }) (e)
- }
- function LA(e, t) {
- for (var n = 0; n < t.length; n++) {
- var a = t[n];
- a.enumerable = a.enumerable || !1,
- a.configurable = !0,
- 'value' in a && (a.writable = !0),
- Object.defineProperty(e, a.key, a)
- }
- }
- function UA(e, t) {
- return (UA = Object.setPrototypeOf || function (e, t) {
- return e.__proto__ = t,
- e
- }) (e, t)
- }
- function MA(n) {
- var a = function () {
- if ('undefined' == typeof Reflect || !Reflect.construct) return !1;
- if (Reflect.construct.sham) return !1;
- if ('function' == typeof Proxy) return !0;
- try {
- return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [
- ], function () {
- })),
- !0
- } catch (e) {
- return !1
- }
- }();
- return function () {
- var e,
- t = zA(n);
- return e = a ? (e = zA(this).constructor, Reflect.construct(t, arguments, e)) : t.apply(this, arguments),
- t = this,
- !(e = e) || 'object' !== FA(e) && 'function' != typeof e ? BA(t) : e
- }
- }
- function BA(e) {
- if (void 0 === e) throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called');
- return e
- }
- function zA(e) {
- return (zA = Object.setPrototypeOf ? Object.getPrototypeOf : function (e) {
- return e.__proto__ || Object.getPrototypeOf(e)
- }) (e)
- }
- function HA(e, t, n) {
- return t in e ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n,
- e
- }
- Ls = function () {
- !function (e, t) {
- if ('function' != typeof t && null !== t) throw new TypeError('Super expression must either be null or a function');
- e.prototype = Object.create(t && t.prototype, {
- constructor: {
- value: e,
- writable: !0,
- configurable: !0
- }
- }),
- t && UA(e, t)
- }(o, A);
- var e,
- t,
- n,
- r = MA(o);
- function o() {
- var e;
- !function (e, t) {
- if (!(e instanceof t)) throw new TypeError('Cannot call a class as a function')
- }(this, o);
- for (var t = arguments.length, n = Array(t), a = 0; a < t; a++) n[a] = arguments[a];
- return HA(BA(e = r.call.apply(r, [
- this
- ].concat(n))), 'handleDismiss', function () {
- Is.a.set('reactionsAnalyticsMessage', !0),
- e.setState({
- reactionsAnalyticsMessage: !0
- })
- }),
- e
- }
- return e = o,
- (t = [
- {
- key: 'render',
- value: function () {
- var e = this;
- return Is.a.get('reactionsAnalyticsMessage') ? null : C.a.createElement(Ki, {
- alertType: 'brand-new',
- topMarginClass: 'spacing-top-none',
- message: C.a.createElement(C.a.Fragment, null, C.a.createElement('span', {
- className: 'text-larger text-semibold'
- }, 'Reactions Analytics!'), C.a.createElement('div', {
- className: 'suggested-actions__module'
- }, C.a.createElement('div', {
- className: 'spacing-narrow spacing-bottom'
- }, C.a.createElement('ul', {
- className: 'suggested-actions__list'
- }, C.a.createElement('li', {
- className: 'suggested-actions__item'
- }, C.a.createElement('span', {
- className: 'icon-lightning'
- }), C.a.createElement('span', {
- className: 'text'
- }, 'Develop insights about how your audience is reacting to your content')), C.a.createElement('li', {
- className: 'suggested-actions__item'
- }, C.a.createElement('span', {
- className: 'icon-lightning'
- }), C.a.createElement('span', {
- className: 'text'
- }, 'From a bird\'s-eye view, compare anonymous and authenticated reactions across different time periods by date or by thread title')), C.a.createElement('li', {
- className: 'suggested-actions__item'
- }, C.a.createElement('span', {
- className: 'icon-lightning'
- }), C.a.createElement('span', {
- className: 'text'
- }, 'See a time period or thread that catches your eye? Use the bottom graph to take a closer look!')), C.a.createElement('li', {
- className: 'suggested-actions__item'
- }, C.a.createElement('span', {
- className: 'icon-lightning'
- }), C.a.createElement('span', {
- className: 'text'
- }, 'Don\'t have Reactions activated yet for your forum? Enable them by ', C.a.createElement('a', {
- className: 'hyperlink',
- href: 'https://help.disqus.com/en/articles/2199501-reactions',
- target: '_blank',
- rel: 'noopener noreferrer'
- }, 'following the directions here'), '!')))), C.a.createElement('a', {
- href: Pn.reactionsAnalytics,
- className: 'button button-large button-fill--white text-medium spacing-narrow spacing-right',
- target: '_blank',
- rel: 'noopener noreferrer',
- onClick: function () {
- e.props.emitTrackingEvent({
- verb: 'click',
- object_type: 'link',
- object_id: Pn.reactionsAnalytics,
- adverb: 'learn_more',
- area: 'welcome'
- })
- }
- }, 'Learn more'), C.a.createElement('button', {
- className: 'button button-large button-fill--brand text-medium spacing-narrow',
- target: '_blank',
- rel: 'noopener noreferrer',
- onClick: this.handleDismiss
- }, 'Dismiss')))
- })
- }
- }
- ]) && LA(e.prototype, t),
- n && LA(e, n),
- o
- }();
- HA(Ls, 'displayName', 'ReactionsAnalyticsFeaturedMessage'),
- HA(Ls, 'propTypes', {
- emitTrackingEvent: b.a.func.isRequired
- });
- function GA() {
- return yo.a.isFeatureActive('analytics_intercom') ? C.a.createElement('div', {
- className: 'content__wrap text-center padding-default'
- }, C.a.createElement('p', {
- className: 'text-large spacing-narrow spacing-bottom'
- }, C.a.createElement('strong', null, 'Have feedback about your analytics?')), C.a.createElement(Mg, null, 'Talk to Us')) : null
- }
- var yl = Ni.a.attachDrivers(Ls, [
- rc
- ]),
- VA = [
- {
- module: C.a.createElement(IA, null, C.a.createElement(Wi, null)),
- routes: [
- '/analytics/audience/'
- ]
- },
- {
- module: null,
- routes: [
- '/analytics/top_comments/'
- ]
- },
- {
- module: C.a.createElement(qA, null, C.a.createElement(yl, null)),
- routes: [
- '/analytics/reactions/'
- ]
- }
- ],
- F = function (e) {
- var t = e.children,
- n = e.selection,
- a = e.history,
- r = fo(),
- e = je.a.find(VA, function (e) {
- return e.routes.some(function (e) {
- return e.test ? e.test(r) : e === r
- })
- });
- return C.a.createElement('div', {
- className: 'section-contained'
- }, C.a.createElement('div', {
- className: 'layout layout--stacked-tablet'
- }, C.a.createElement('div', {
- className: (e = !n.organization.pollsOnly && e && e.module) ? '' : 'layout__main'
- }, yo.a.isFeatureActive('polls_pub_admin') ? C.a.createElement(Si, {
- selection: n,
- pollsOnly: n.organization.pollsOnly
- }) : C.a.createElement(mi, {
- selection: n,
- pollsOnly: n.organization.pollsOnly
- }), C.a.createElement('div', {
- className: 'layout__content'
- }, e || null, C.a.cloneElement(t, {
- selection: n,
- history: a
- }), C.a.createElement(GA, null)))))
- };
- F.propTypes = {
- children: b.a.element.isRequired,
- selection: ht.isRequired,
- history: b.a.object.isRequired
- };
- var WA = Object(u.connect) (function (e) {
- return {
- selection: e.selection
- }
- }) (Ni.a.attachDrivers(Fo() (F), [
- bc
- ])),
- YA = {
- engagements: 'engagements',
- totalCommenters: 'commenters',
- newCommenters: 'new_commenters',
- date_published: 'date_published',
- comments: 'comments'
- },
- Ru = b.a.shape({
- isFetching: b.a.bool.isRequired,
- items: b.a.arrayOf(b.a.shape({
- thread_id: b.a.number,
- downvotes: b.a.number,
- title: b.a.string,
- newCommenters: b.a.number,
- totalCommenters: b.a.number,
- date_published: b.a.string,
- signedLink: b.a.string,
- link: b.a.string,
- comments: b.a.number,
- upvotes: b.a.number,
- engagements: b.a.number
- })),
- cursor: b.a.shape({
- prev: b.a.string,
- hasNext: b.a.bool,
- next: b.a.string,
- hasPrev: b.a.bool,
- total: b.a.string,
- id: b.a.string,
- more: b.a.bool
- }),
- hasMore: b.a.bool,
- reportData: b.a.shape({
- forum: b.a.string,
- start: b.a.string,
- end: b.a.string,
- limit: b.a.number,
- order: b.a.string,
- sort: b.a.string,
- api_key: b.a.string
- })
- });
- function QA(t, e) {
- var n,
- a = Object.keys(t);
- return Object.getOwnPropertySymbols && (n = Object.getOwnPropertySymbols(t), e && (n = n.filter(function (e) {
- return Object.getOwnPropertyDescriptor(t, e).enumerable
- })), a.push.apply(a, n)),
- a
- }
- function KA(a) {
- for (var e = 1; e < arguments.length; e++) {
- var r = null != arguments[e] ? arguments[e] : {
- };
- e % 2 ? QA(Object(r), !0).forEach(function (e) {
- var t,
- n;
- n = r[t = e],
- t in (e = a) ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(a, Object.getOwnPropertyDescriptors(r)) : QA(Object(r)).forEach(function (e) {
- Object.defineProperty(a, e, Object.getOwnPropertyDescriptor(r, e))
- })
- }
- return a
- }
- function JA() {
- return (JA = Object.assign || function (e) {
- for (var t = 1; t < arguments.length; t++) {
- var n,
- a = arguments[t];
- for (n in a) Object.prototype.hasOwnProperty.call(a, n) && (e[n] = a[n])
- }
- return e
- }).apply(this, arguments)
- }
- function $A(e, t) {
- if (null == e) return {
- };
- var n,
- a = function (e, t) {
- if (null == e) return {
- };
- var n,
- a,
- r = {
- },
- o = Object.keys(e);
- for (a = 0; a < o.length; a++) ~t.indexOf(n = o[a]) || (r[n] = e[n]);
- return r
- }(e, t);
- if (Object.getOwnPropertySymbols) for (var r = Object.getOwnPropertySymbols(e), o = 0; o < r.length; o++) ~t.indexOf(n = r[o]) || Object.prototype.propertyIsEnumerable.call(e, n) && (a[n] = e[n]);
- return a
- }
- function ZA(e) {
- var t = e.headers,
- n = e.rows,
- a = e.onSort,
- o = e.reportClick;
- return C.a.createElement('table', {
- className: 'analytics-table'
- }, C.a.createElement('thead', null, C.a.createElement('tr', null, t.map(function (e) {
- var t = e.key,
- n = e.colClass,
- e = $A(e, [
- 'key',
- 'colClass'
- ]);
- return C.a.createElement('th', {
- key: t,
- className: n
- }, C.a.createElement(nD, JA({
- onSort: a,
- sortKey: t,
- colClass: n
- }, e)))
- }))), C.a.createElement('tbody', null, n.map(function (r) {
- return C.a.createElement('tr', {
- key: r.id
- }, t.map(function (e) {
- var t = e.formatFn,
- n = e.key,
- a = e.urlFn,
- a = void 0 === a ? function () {
- return ''
- }
- : a,
- e = e.colClass,
- e = void 0 === e ? '' : e,
- t = (void 0 === t ? function (e) {
- return e
- }
- : t) (r[n]),
- a = a(r);
- return a && (t = C.a.createElement('a', {
- href: a,
- target: '_blank',
- rel: 'noopener noreferrer',
- onClick: o ? o.bind(null, {
- object_type: 'thread',
- object_id: r.id
- }) : null
- }, t)),
- C.a.createElement('td', {
- key: n,
- className: e
- }, C.a.createElement('span', null, t))
- }))
- })))
- }
- var XA = 'asc',
- eD = 'desc',
- tD = {
- SORT_NONE: '',
- SORT_ASC: XA,
- SORT_DESC: eD
- };
- ZA.propTypes = {
- headers: b.a.arrayOf(b.a.shape({
- key: b.a.any.isRequired,
- content: b.a.node.isRequired,
- formatFn: b.a.func,
- urlFn: b.a.func,
- sortable: b.a.bool,
- sortDir: b.a.oneOf(['',
- XA,
- eD])
- })).isRequired,
- rows: b.a.arrayOf(b.a.object).isRequired,
- onSort: b.a.func.isRequired,
- reportClick: b.a.func
- };
- var nD = function (e) {
- var t = e.content,
- n = e.onSort,
- a = e.sortable,
- r = void 0 === a || a,
- o = e.sortKey,
- i = e.description,
- s = e.sortDir,
- l = void 0 === s ? '' : s,
- a = e.onShowDescription,
- s = l === XA ? C.a.createElement('span', {
- className: 'icon icon__position icon-small icon-arrow-up'
- }) : l === eD ? C.a.createElement('span', {
- className: 'icon icon__position icon-small icon-arrow-down'
- }) : r ? C.a.createElement('span', {
- className: 'icon icon__position icon-small icon-arrow-up icon-hidden'
- }) : null,
- e = '' === l ? '' : '-sorted',
- a = i ? C.a.createElement(Md, {
- tooltipKey: o,
- content: i,
- onShow: a,
- direction: 'top'
- }) : null;
- return r ? C.a.createElement('div', {
- className: e
- }, C.a.createElement('button', {
- onClick: function () {
- return n(o, l === eD ? XA : eD)
- }
- }, s, ' ', t), a) : C.a.createElement('div', {
- className: e
- }, s, ' ', t, ' ', a)
- };
- function aD(e) {
- return (aD = 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator ? function (e) {
- return typeof e
- }
- : function (e) {
- return e && 'function' == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? 'symbol' : typeof e
- }) (e)
- }
- function rD(t, e) {
- var n,
- a = Object.keys(t);
- return Object.getOwnPropertySymbols && (n = Object.getOwnPropertySymbols(t), e && (n = n.filter(function (e) {
- return Object.getOwnPropertyDescriptor(t, e).enumerable
- })), a.push.apply(a, n)),
- a
- }
- function oD(t) {
- for (var e = 1; e < arguments.length; e++) {
- var n = null != arguments[e] ? arguments[e] : {
- };
- e % 2 ? rD(Object(n), !0).forEach(function (e) {
- pD(t, e, n[e])
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(n)) : rD(Object(n)).forEach(function (e) {
- Object.defineProperty(t, e, Object.getOwnPropertyDescriptor(n, e))
- })
- }
- return t
- }
- function iD(e, t) {
- for (var n = 0; n < t.length; n++) {
- var a = t[n];
- a.enumerable = a.enumerable || !1,
- a.configurable = !0,
- 'value' in a && (a.writable = !0),
- Object.defineProperty(e, a.key, a)
- }
- }
- function sD(e, t) {
- return (sD = Object.setPrototypeOf || function (e, t) {
- return e.__proto__ = t,
- e
- }) (e, t)
- }
- function lD(n) {
- var a = function () {
- if ('undefined' == typeof Reflect || !Reflect.construct) return !1;
- if (Reflect.construct.sham) return !1;
- if ('function' == typeof Proxy) return !0;
- try {
- return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [
- ], function () {
- })),
- !0
- } catch (e) {
- return !1
- }
- }();
- return function () {
- var e,
- t = uD(n);
- return e = a ? (e = uD(this).constructor, Reflect.construct(t, arguments, e)) : t.apply(this, arguments),
- t = this,
- !(e = e) || 'object' !== aD(e) && 'function' != typeof e ? cD(t) : e
- }
- }
- function cD(e) {
- if (void 0 === e) throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called');
- return e
- }
- function uD(e) {
- return (uD = Object.setPrototypeOf ? Object.getPrototypeOf : function (e) {
- return e.__proto__ || Object.getPrototypeOf(e)
- }) (e)
- }
- function pD(e, t, n) {
- return t in e ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n,
- e
- }
- nD.propTypes = {
- content: b.a.node.isRequired,
- sortable: b.a.bool,
- sortKey: b.a.string.isRequired,
- sortDir: b.a.oneOf(['',
- XA,
- eD]),
- onSort: b.a.func.isRequired,
- description: b.a.node,
- onShowDescription: b.a.func
- };
- r = function () {
- !function (e, t) {
- if ('function' != typeof t && null !== t) throw new TypeError('Super expression must either be null or a function');
- e.prototype = Object.create(t && t.prototype, {
- constructor: {
- value: e,
- writable: !0,
- configurable: !0
- }
- }),
- t && sD(e, t)
- }(o, A);
- var e,
- t,
- n,
- r = lD(o);
- function o() {
- var n;
- !function (e, t) {
- if (!(e instanceof t)) throw new TypeError('Cannot call a class as a function')
- }(this, o);
- for (var e = arguments.length, t = Array(e), a = 0; a < e; a++) t[a] = arguments[a];
- return pD(cD(n = r.call.apply(r, [
- this
- ].concat(t))), 'state', {
- sortColumn: 'engagements',
- sortDir: tD.SORT_DESC,
- startDate: ct() ().subtract(1, 'month'),
- endDate: ct() ()
- }),
- pD(cD(n), 'isAdvancedAnalyticsSupported', function () {
- if (!n.props.selection.organization) return !1;
- var e = n.props.saasFeatures[n.props.selection.organization.id];
- return e && e.advancedAnalytics
- }),
- pD(cD(n), 'getExportUrl', function () {
- var e = io.a.getURL('forums/admin/reports/threadReport.csv');
- return Eo() (e, {
- api_key: pt.a.keys.api,
- forum: pt.a.currentForum,
- start: ct.a.utc(n.state.startDate).format(),
- end: ct.a.utc(n.state.endDate).format()
- })
- }),
- pD(cD(n), 'reportExport', function () {
- n.props.emitTrackingEvent({
- verb: 'export',
- object_type: 'file',
- object_id: 'csv'
- })
- }),
- pD(cD(n), 'handleSort', function (e, t) {
- n.setState({
- sortColumn: e,
- sortDir: t
- }, function () {
- return n.fetch()
- }),
- n.reportClick({
- object_type: 'sort',
- object_id: 'column',
- extra_data: JSON.stringify({
- column: e,
- sort: t
- })
- })
- }),
- pD(cD(n), 'handleDateChange', function (e, t) {
- n.setState({
- startDate: e,
- endDate: t
- }, function () {
- return n.fetch()
- }),
- n.reportClick({
- object_type: 'filter',
- object_id: 'date',
- extra_data: JSON.stringify({
- filter_start_date: ct.a.utc(e).format(),
- filter_end_date: ct.a.utc(t).format()
- })
- })
- }),
- pD(cD(n), 'fetch', function () {
- n.props.fetchAnalyticsContent({
- forum: pt.a.currentForum,
- start: n.state.startDate.toISOString(),
- end: n.state.endDate.toISOString(),
- sortKey: n.state.sortColumn,
- sortOrder: n.state.sortDir
- })
- }),
- pD(cD(n), 'fetchMore', function () {
- n.props.fetchAnalyticsContentMore(),
- n.reportClick({
- object_type: 'button',
- object_id: 'show_more'
- })
- }),
- pD(cD(n), 'reportClick', function (e) {
- e.verb = 'click',
- n.props.emitTrackingEvent(e)
- }),
- n
- }
- return e = o,
- (t = [
- {
- key: 'componentDidMount',
- value: function () {
- this.isAdvancedAnalyticsSupported() ? (this.fetch(), this.props.emitTrackingEvent({
- verb: 'view',
- object_type: 'page',
- object_id: ''.concat(window.document.location.host).concat(window.document.location.pathname)
- })) : this.props.history.push(ho.getRoute('/analytics/comments/'))
- }
- },
- {
- key: 'render',
- value: function () {
- var t = this;
- if (!this.isAdvancedAnalyticsSupported()) return null;
- if (this.props.organization && this.props.organization.pollsOnly) return C.a.createElement(Cm, {
- isPolls: !1,
- organization: this.props.organization
- });
- var e = C.a.createElement('div', {
- className: 'card__header-right'
- }, C.a.createElement('a', {
- href: this.getExportUrl(),
- target: '_blank',
- rel: 'noopener noreferrer',
- className: 'card__header-content-item -button -right -left text-semibold text-gray-dark',
- onClick: this.reportExport
- }, C.a.createElement('span', {
- className: 'icon-download text-large spacing-right text-gray'
- }), 'Download CSV'), C.a.createElement(Zp, {
- minDate: gt,
- maxDate: ct() (),
- startDate: this.state.startDate,
- endDate: this.state.endDate,
- onDateChange: this.handleDateChange,
- dateWrapperClass: 'card__header-datepicker',
- shortcuts: yt
- })),
- n = function (e) {
- return e.toLocaleString()
- },
- a = this.props.analyticsContent.isFetching ? C.a.createElement(Ji, null) : this.props.analyticsContent.items && 0 !== this.props.analyticsContent.items.length ? null : C.a.createElement('div', {
- className: 'empty-content-message'
- }, 'No items');
- return C.a.createElement('div', null, C.a.createElement(Bp, {
- className: 'spacing-bottom',
- leftTitle: 'Top Articles',
- rightTitle: e,
- bodyClassName: '-overflow-scroll analytics-content text-medium padding-default'
- }, C.a.createElement(ZA, {
- headers: [
- {
- key: 'title',
- content: 'Title',
- urlFn: function (e) {
- return e.signedLink
- },
- sortable: !1
- },
- {
- key: 'date_published',
- content: 'Date Published',
- formatFn: function (e) {
- return ct() (e).format('MM/DD/YY')
- }
- },
- {
- key: 'engagements',
- content: 'Total Engagements',
- formatFn: n
- },
- {
- key: 'comments',
- content: 'Comments',
- formatFn: n
- },
- {
- key: 'totalCommenters',
- content: 'Commenters',
- formatFn: n
- },
- {
- key: 'newCommenters',
- content: 'New Commenters',
- formatFn: n
- }
- ].map(function (e) {
- return oD(oD({
- }, e), {
- }, {
- sortDir: t.state.sortColumn === e.key ? t.state.sortDir : tD.SORT_NONE
- })
- }),
- rows: (this.props.analyticsContent.items || [
- ]).map(function (e) {
- return oD({
- id: e.thread_id
- }, e)
- }),
- onSort: this.handleSort,
- reportClick: this.reportClick
- }), a, !this.props.analyticsContent.isFetching && this.props.analyticsContent.hasMore ? C.a.createElement('button', {
- className: 'button button-wide button-outline button-medium',
- onClick: this.fetchMore
- }, 'Show more results') : null))
- }
- }
- ]) && iD(e.prototype, t),
- n && iD(e, n),
- o
- }();
- pD(r, 'propTypes', {
- analyticsContent: Ru.isRequired,
- fetchAnalyticsContent: b.a.func.isRequired,
- fetchAnalyticsContentMore: b.a.func.isRequired,
- emitTrackingEvent: b.a.func.isRequired,
- history: b.a.shape({
- push: b.a.func.isRequired
- }).isRequired,
- selection: ht.isRequired,
- saasFeatures: b.a.objectOf(b.a.objectOf(b.a.bool)).isRequired
- });
- a = Object(u.connect) (function (e) {
- return {
- analyticsContent: e.analyticsContent,
- saasFeatures: e.saasFeatures,
- organization: e.selection.organization
- }
- }, {
- emitTrackingEvent: Xo({
- zone: 'analytics',
- section: 'content'
- }),
- fetchAnalyticsContent: function (e) {
- return function (t) {
- var n = {
- forum: e.forum,
- start: e.start,
- end: e.end,
- limit: 25,
- order: 'desc' === e.sortOrder ? 'desc' : 'asc',
- sort: YA[e.sortKey] || 'engagements'
- };
- t({
- type: U.fetching
- }),
- io.a.call('forums/admin/reports/threadReport', {
- data: n
- }).done(function (e) {
- t({
- type: U.onFetch,
- cursor: e.cursor,
- isFetching: !1,
- items: e.response,
- reportData: n
- })
- })
- }
- },
- fetchAnalyticsContentMore: function () {
- return function (t, e) {
- var n = e().analyticsContent,
- a = n.reportData,
- e = n.cursor,
- r = n.items;
- e && e.hasNext && (t({
- type: U.fetching
- }), io.a.call('forums/admin/reports/threadReport', {
- data: KA(KA({
- }, a), {
- }, {
- cursor: e.next
- })
- }).done(function (e) {
- t({
- type: U.onFetchMore,
- cursor: e.cursor,
- isFetching: !1,
- items: r.concat(e.response)
- })
- }))
- }
- }
- }) (Fo() (r));
- function dD(e) {
- return (dD = 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator ? function (e) {
- return typeof e
- }
- : function (e) {
- return e && 'function' == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? 'symbol' : typeof e
- }) (e)
- }
- function mD(e, t) {
- for (var n = 0; n < t.length; n++) {
- var a = t[n];
- a.enumerable = a.enumerable || !1,
- a.configurable = !0,
- 'value' in a && (a.writable = !0),
- Object.defineProperty(e, a.key, a)
- }
- }
- function fD(e, t) {
- return (fD = Object.setPrototypeOf || function (e, t) {
- return e.__proto__ = t,
- e
- }) (e, t)
- }
- function hD(n) {
- var a = function () {
- if ('undefined' == typeof Reflect || !Reflect.construct) return !1;
- if (Reflect.construct.sham) return !1;
- if ('function' == typeof Proxy) return !0;
- try {
- return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [
- ], function () {
- })),
- !0
- } catch (e) {
- return !1
- }
- }();
- return function () {
- var e,
- t = yD(n);
- return e = a ? (e = yD(this).constructor, Reflect.construct(t, arguments, e)) : t.apply(this, arguments),
- t = this,
- !(e = e) || 'object' !== dD(e) && 'function' != typeof e ? gD(t) : e
- }
- }
- function gD(e) {
- if (void 0 === e) throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called');
- return e
- }
- function yD(e) {
- return (yD = Object.setPrototypeOf ? Object.getPrototypeOf : function (e) {
- return e.__proto__ || Object.getPrototypeOf(e)
- }) (e)
- }
- function bD(e, t, n) {
- return t in e ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n,
- e
- }
- go = function () {
- !function (e, t) {
- if ('function' != typeof t && null !== t) throw new TypeError('Super expression must either be null or a function');
- e.prototype = Object.create(t && t.prototype, {
- constructor: {
- value: e,
- writable: !0,
- configurable: !0
- }
- }),
- t && fD(e, t)
- }(o, A);
- var e,
- t,
- n,
- r = hD(o);
- function o() {
- var t;
- !function (e, t) {
- if (!(e instanceof t)) throw new TypeError('Cannot call a class as a function')
- }(this, o);
- for (var e = arguments.length, n = Array(e), a = 0; a < e; a++) n[a] = arguments[a];
- return bD(gD(t = r.call.apply(r, [
- this
- ].concat(n))), 'customerPulseSrc', 'https://disqus.com/customer_pulse'),
- bD(gD(t), 'state', {
- iframeHeight: '1000px'
- }),
- bD(gD(t), 'resizeIframe', function (e) {
- e.data.cp_iframe_height && t.setState({
- iframeHeight: ''.concat(e.data.cp_iframe_height, 'px')
- })
- }),
- t
- }
- return e = o,
- (t = [
- {
- key: 'componentDidMount',
- value: function () {
- this.props.emitTrackingEvent({
- verb: 'view',
- object_type: 'page',
- object_id: ''.concat(window.document.location.host).concat(window.document.location.pathname)
- }),
- window.addEventListener('message', this.resizeIframe)
- }
- },
- {
- key: 'componentWillUnmount',
- value: function () {
- window.removeEventListener('message', this.resizeIframe)
- }
- },
- {
- key: 'render',
- value: function () {
- return C.a.createElement('div', {
- className: 'admin_content'
- }, C.a.createElement('iframe', {
- src: this.customerPulseSrc,
- width: '100%',
- height: this.state.iframeHeight,
- scrolling: 'no'
- }))
- }
- }
- ]) && mD(e.prototype, t),
- n && mD(e, n),
- o
- }(),
- Ls = Object(u.connect) (function (e) {
- return {
- saasFeatures: e.saasFeatures
- }
- }, {
- emitTrackingEvent: Xo({
- zone: 'analytics',
- section: 'pulse'
- })
- }) (Fo() (go));
- function vD(e) {
- return (vD = 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator ? function (e) {
- return typeof e
- }
- : function (e) {
- return e && 'function' == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? 'symbol' : typeof e
- }) (e)
- }
- function _D(e, t) {
- return (_D = Object.setPrototypeOf || function (e, t) {
- return e.__proto__ = t,
- e
- }) (e, t)
- }
- function ED(n) {
- var a = function () {
- if ('undefined' == typeof Reflect || !Reflect.construct) return !1;
- if (Reflect.construct.sham) return !1;
- if ('function' == typeof Proxy) return !0;
- try {
- return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [
- ], function () {
- })),
- !0
- } catch (e) {
- return !1
- }
- }();
- return function () {
- var e,
- t = SD(n);
- return e = a ? (e = SD(this).constructor, Reflect.construct(t, arguments, e)) : t.apply(this, arguments),
- t = this,
- !(e = e) || 'object' !== vD(e) && 'function' != typeof e ? OD(t) : e
- }
- }
- function OD(e) {
- if (void 0 === e) throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called');
- return e
- }
- function SD(e) {
- return (SD = Object.setPrototypeOf ? Object.getPrototypeOf : function (e) {
- return e.__proto__ || Object.getPrototypeOf(e)
- }) (e)
- }
- function wD(e, t, n) {
- return t in e ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n,
- e
- }
- rc = function () {
- !function (e, t) {
- if ('function' != typeof t && null !== t) throw new TypeError('Super expression must either be null or a function');
- e.prototype = Object.create(t && t.prototype, {
- constructor: {
- value: e,
- writable: !0,
- configurable: !0
- }
- }),
- t && _D(e, t)
- }(o, A);
- var r = ED(o);
- function o() {
- var a;
- !function (e, t) {
- if (!(e instanceof t)) throw new TypeError('Cannot call a class as a function')
- }(this, o);
- for (var e = arguments.length, t = Array(e), n = 0; n < e; n++) t[n] = arguments[n];
- return wD(OD(a = r.call.apply(r, [
- this
- ].concat(t))), 'state', {
- articleReads: 0,
- articleReadsDelta: 0,
- commentReads: 0,
- commentReadsDelta: 0,
- engagements: 0,
- engagementsDelta: 0,
- topArticle: null,
- topArticlePrevious: null,
- loading: !0
- }),
- wD(OD(a), 'fetch', function (e) {
- e = e.forum;
- a.setState({
- loading: !0
- }),
- io.a.call('forums/admin/reports/overviewStats', {
- data: {
- forum: e
- }
- }).done(function (e) {
- var t = e.response,
- n = !!t.current,
- e = !!t.previous;
- a.setState({
- articleReads: n ? t.current.pageViews : 0,
- articleReadsDelta: n && e ? Math.round((t.current.pageViews - t.previous.pageViews) / t.previous.pageViews * 100) : 0,
- commentReads: n ? t.current.embedViews : 0,
- commentReadsDelta: n && e ? Math.round((t.current.embedViews - t.previous.embedViews) / t.previous.embedViews * 100) : 0,
- engagements: n ? t.current.engagements : 0,
- engagementsDelta: n && e ? Math.round((t.current.engagements - t.previous.engagements) / t.previous.engagements * 100) : 0
- })
- }),
- io.a.call('forums/admin/reports/threadReport', {
- data: {
- forum: e,
- sort: 'engagements',
- limit: 1,
- start: ct() ().subtract(1, 'month').format('X'),
- end: ct() ().format('X')
- }
- }).done(function (e) {
- a.setState({
- topArticle: e.response[0]
- })
- }),
- io.a.call('forums/admin/reports/threadReport', {
- data: {
- forum: e,
- sort: 'engagements',
- limit: 1,
- start: ct() ().subtract(2, 'month').format('X'),
- end: ct() ().subtract(1, 'month').format('X')
- }
- }).done(function (e) {
- a.setState({
- topArticlePrevious: e.response[0],
- loading: !1
- })
- })
- }),
- wD(OD(a), 'handleDismiss', function () {
- Is.a.set('analyticsWelcome', !0),
- a.setState({
- analyticsWelcome: !0
- })
- }),
- wD(OD(a), 'getComponentProps', function () {
- return {
- articleReads: a.state.articleReads,
- articleReadsDelta: a.state.articleReadsDelta,
- commentReads: a.state.commentReads,
- commentReadsDelta: a.state.commentReadsDelta,
- engagements: a.state.engagements,
- engagementsDelta: a.state.engagementsDelta,
- topArticle: a.state.topArticle,
- topArticlePrevious: a.state.topArticlePrevious,
- handleDismiss: a.handleDismiss,
- overviewContentFetch: a.fetch,
- overviewContentLoading: a.state.loading
- }
- }),
- a
- }
- return o
- }();
- wD(rc, 'displayName', 'OverviewDriver');
- Wi = Object(ki.createDriver) (rc),
- yl = function (e) {
- var t = Math.round(e.delta),
- n = t < 0 ? '↓ ' : 0 < t ? '↑ +' : '',
- a = t < 0 ? 'text-red' : 0 < t ? 'text-green' : 'text-gray',
- t = [
- ];
- return 'number' == typeof e.metric && t.push(C.a.createElement('p', {
- className: 'text-huge',
- key: 'metric'
- }, e.metric.toLocaleString())),
- 'number' == typeof e.delta && t.push(C.a.createElement('p', {
- className: a,
- key: 'delta'
- }, n, e.delta, '%', 0 === e.delta ? ' - No change' : null)),
- C.a.createElement('div', {
- className: 'admin-metric'
- }, C.a.createElement('div', {
- className: 'text-semibold'
- }, e.title, e.tooltip ? C.a.createElement(Md, {
- tooltipKey: e.title,
- content: e.tooltip,
- direction: 'bottom'
- }) : null), e.tooltip ? null : C.a.createElement('div', {
- className: 'text-medium text-gray'
- }, e.children), t.length ? C.a.createElement('div', {
- className: 'admin-metric__bottom'
- }, t) : null)
- };
- yl.displayName = 'Metric',
- yl.propTypes = {
- title: b.a.node.isRequired,
- metric: b.a.number,
- delta: b.a.number,
- tooltip: b.a.node,
- children: b.a.node
- };
- var PD = yl;
- function kD(e) {
- return (kD = 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator ? function (e) {
- return typeof e
- }
- : function (e) {
- return e && 'function' == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? 'symbol' : typeof e
- }) (e)
- }
- function ND(e, t) {
- for (var n = 0; n < t.length; n++) {
- var a = t[n];
- a.enumerable = a.enumerable || !1,
- a.configurable = !0,
- 'value' in a && (a.writable = !0),
- Object.defineProperty(e, a.key, a)
- }
- }
- function CD(e, t) {
- return (CD = Object.setPrototypeOf || function (e, t) {
- return e.__proto__ = t,
- e
- }) (e, t)
- }
- function RD(n) {
- var a = function () {
- if ('undefined' == typeof Reflect || !Reflect.construct) return !1;
- if (Reflect.construct.sham) return !1;
- if ('function' == typeof Proxy) return !0;
- try {
- return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [
- ], function () {
- })),
- !0
- } catch (e) {
- return !1
- }
- }();
- return function () {
- var e,
- t = AD(n);
- return e = a ? (e = AD(this).constructor, Reflect.construct(t, arguments, e)) : t.apply(this, arguments),
- t = this,
- !(e = e) || 'object' !== kD(e) && 'function' != typeof e ? xD(t) : e
- }
- }
- function xD(e) {
- if (void 0 === e) throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called');
- return e
- }
- function AD(e) {
- return (AD = Object.setPrototypeOf ? Object.getPrototypeOf : function (e) {
- return e.__proto__ || Object.getPrototypeOf(e)
- }) (e)
- }
- function DD(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 = {
- day: 'day',
- month: 'month'
- },
- jD = (DD(Ru = {
- }, F.day, 'YYYY-MM-DD'), DD(Ru, F.month, 'YYYY-MM'), Ru),
- TD = ct.a.utc().startOf('day').subtract(1, 'year').add(1, 'day'),
- ID = ct.a.utc().startOf('day'),
- r = function () {
- !function (e, t) {
- if ('function' != typeof t && null !== t) throw new TypeError('Super expression must either be null or a function');
- e.prototype = Object.create(t && t.prototype, {
- constructor: {
- value: e,
- writable: !0,
- configurable: !0
- }
- }),
- t && CD(e, t)
- }(r, A);
- var e,
- t,
- n,
- a = RD(r);
- function r() {
- var c;
- !function (e, t) {
- if (!(e instanceof t)) throw new TypeError('Cannot call a class as a function')
- }(this, r);
- for (var e = arguments.length, t = Array(e), n = 0; n < e; n++) t[n] = arguments[n];
- return DD(xD(c = a.call.apply(a, [
- this
- ].concat(t))), 'state', {
- series: {
- votes: [
- ],
- comments: [
- ],
- pageViews: [
- ],
- embedViews: [
- ]
- },
- loading: !0,
- errorCode: null
- }),
- DD(xD(c), 'fetchData', function () {
- c.setState({
- loading: !0
- });
- var e = c.props.startDate.clone().startOf('month').subtract(1, 'day'),
- t = c.props.endDate.clone().endOf('month').startOf('day');
- c.apiCall = io.a.call('forums/admin/reports/interactionReport', {
- data: {
- start: ct.a.max(TD, e).toISOString(),
- end: ct.a.min(ID, t).toISOString(),
- forum: c.props.selection.forum.shortname
- },
- success: c.onFetch,
- error: c.onError
- })
- }),
- DD(xD(c), 'onFetch', function (e) {
- c.setState({
- series: {
- votes: (e = e.response ? e.response : e).votes_series,
- comments: e.comments_series,
- pageViews: e.page_view_series,
- embedViews: e.embed_view_series
- },
- loading: !1,
- errorCode: null
- })
- }),
- DD(xD(c), 'onError', function (e) {
- c.setState({
- errorCode: e,
- loading: !1
- })
- }),
- DD(xD(c), 'getRows', function () {
- for (var e = c.props.startDate.clone().startOf(c.props.interval), t = c.props.endDate.clone().endOf(c.props.interval), n = c.formatDataByInterval(c.state.series.comments.concat(c.state.series.votes)), a = c.formatDataByInterval(c.state.series.comments), r = c.formatDataByInterval(c.state.series.pageViews), o = c.formatDataByInterval(c.state.series.embedViews), i = [
- ], s = e; s.isBefore(t); s.add(1, c.props.interval)) {
- var l = s.format(jD[c.props.interval]);
- i.push({
- date_utc: s.clone(),
- engagements: n[l] || 0,
- comments: a[l] || 0,
- articleReads: r[l] || 0,
- embedReads: o[l] || 0
- })
- }
- e = i.length - 1;
- return c.isRowZero(i[e]) && i.splice(e, 1),
- i
- }),
- DD(xD(c), 'isRowZero', function (e) {
- return 0 === e.engagements && 0 === e.articleReads && 0 === e.embedReads
- }),
- DD(xD(c), 'formatDataByInterval', function (e) {
- if (!e) return [];
- var a = jD[c.props.interval];
- return je.a.chain(e).reduce(function (e, t) {
- var n = ct.a.utc(t[0]).format(a);
- return e[n] = e[n] ? e[n] + t[1] : t[1],
- e
- }, {
- }).value()
- }),
- DD(xD(c), 'getComponentProps', function () {
- return {
- overviewStartDate: c.props.startDate,
- overviewEndDate: c.props.endDate,
- overviewRows: c.getRows(),
- overviewLoading: c.state.loading,
- overviewErrorCode: c.state.errorCode,
- overviewMinDate: TD,
- overviewMaxDate: ID
- }
- }),
- c
- }
- return e = r,
- (t = [
- {
- key: 'componentWillMount',
- value: function () {
- this.fetchData()
- }
- },
- {
- key: 'componentWillUnmount',
- value: function () {
- this.apiCall && 'pending' === this.apiCall.state() && this.apiCall.abort()
- }
- },
- {
- key: 'componentDidUpdate',
- value: function (e) {
- this.props.startDate === e.startDate && this.props.endDate === e.endDate || this.fetchData()
- }
- }
- ]) && ND(e.prototype, t),
- n && ND(e, n),
- r
- }();
- DD(r, 'displayName', 'OverviewGraphDriver'),
- DD(r, 'propTypes', {
- startDate: s.moment.isRequired,
- endDate: s.moment.isRequired,
- interval: b.a.oneOf(je.a.values(F)).isRequired,
- selection: ht.isRequired
- });
- go = Object(ki.createDriver) (r, function (e) {
- return {
- selection: e.selection
- }
- });
- function qD(e) {
- return (qD = 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator ? function (e) {
- return typeof e
- }
- : function (e) {
- return e && 'function' == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? 'symbol' : typeof e
- }) (e)
- }
- function FD() {
- return (FD = Object.assign || function (e) {
- for (var t = 1; t < arguments.length; t++) {
- var n,
- a = arguments[t];
- for (n in a) Object.prototype.hasOwnProperty.call(a, n) && (e[n] = a[n])
- }
- return e
- }).apply(this, arguments)
- }
- function LD(t, e) {
- var n,
- a = Object.keys(t);
- return Object.getOwnPropertySymbols && (n = Object.getOwnPropertySymbols(t), e && (n = n.filter(function (e) {
- return Object.getOwnPropertyDescriptor(t, e).enumerable
- })), a.push.apply(a, n)),
- a
- }
- function UD(t) {
- for (var e = 1; e < arguments.length; e++) {
- var n = null != arguments[e] ? arguments[e] : {
- };
- e % 2 ? LD(Object(n), !0).forEach(function (e) {
- VD(t, e, n[e])
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(n)) : LD(Object(n)).forEach(function (e) {
- Object.defineProperty(t, e, Object.getOwnPropertyDescriptor(n, e))
- })
- }
- return t
- }
- function MD(e, t) {
- for (var n = 0; n < t.length; n++) {
- var a = t[n];
- a.enumerable = a.enumerable || !1,
- a.configurable = !0,
- 'value' in a && (a.writable = !0),
- Object.defineProperty(e, a.key, a)
- }
- }
- function BD(e, t) {
- return (BD = Object.setPrototypeOf || function (e, t) {
- return e.__proto__ = t,
- e
- }) (e, t)
- }
- function zD(n) {
- var a = function () {
- if ('undefined' == typeof Reflect || !Reflect.construct) return !1;
- if (Reflect.construct.sham) return !1;
- if ('function' == typeof Proxy) return !0;
- try {
- return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [
- ], function () {
- })),
- !0
- } catch (e) {
- return !1
- }
- }();
- return function () {
- var e,
- t = GD(n);
- return e = a ? (e = GD(this).constructor, Reflect.construct(t, arguments, e)) : t.apply(this, arguments),
- t = this,
- !(e = e) || 'object' !== qD(e) && 'function' != typeof e ? HD(t) : e
- }
- }
- function HD(e) {
- if (void 0 === e) throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called');
- return e
- }
- function GD(e) {
- return (GD = Object.setPrototypeOf ? Object.getPrototypeOf : function (e) {
- return e.__proto__ || Object.getPrototypeOf(e)
- }) (e)
- }
- function VD(e, t, n) {
- return t in e ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n,
- e
- }
- function WD(e) {
- return e.toLocaleString()
- }
- var YD = {
- key: 'date_utc',
- name: 'Date (UTC)',
- formatter: function (e) {
- return ct.a.utc(e).format('MMM D YYYY')
- }
- },
- QD = {
- x: 'date_utc',
- keys: {
- value: [
- 'date_utc',
- 'articleReads',
- 'embedReads',
- 'engagements',
- 'comments'
- ]
- },
- names: {
- articleReads: 'Article Reads',
- embedReads: 'Comment Reads',
- engagements: 'Engagements',
- comments: 'Comments'
- },
- axes: {
- articleReads: 'y',
- embedReads: 'y',
- engagements: 'y2',
- comments: 'y2'
- }
- },
- KD = function () {
- !function (e, t) {
- if ('function' != typeof t && null !== t) throw new TypeError('Super expression must either be null or a function');
- e.prototype = Object.create(t && t.prototype, {
- constructor: {
- value: e,
- writable: !0,
- configurable: !0
- }
- }),
- t && BD(e, t)
- }(o, A);
- var e,
- t,
- n,
- r = zD(o);
- function o() {
- var e;
- !function (e, t) {
- if (!(e instanceof t)) throw new TypeError('Cannot call a class as a function')
- }(this, o);
- for (var t = arguments.length, n = Array(t), a = 0; a < t; a++) n[a] = arguments[a];
- return VD(HD(e = r.call.apply(r, [
- this
- ].concat(n))), 'getGraphData', function () {
- return UD({
- json: e.props.rows.map(function (e) {
- return UD(UD({
- }, e), {
- }, {
- date_utc: e.date_utc.toDate()
- })
- })
- }, e.props.graphData || QD)
- }),
- e
- }
- return e = o,
- (t = [
- {
- key: 'componentDidMount',
- value: function () {
- this.chart = Ed.a.generate({
- bindto: this.ref.graph,
- data: this.getGraphData(),
- color: {
- pattern: [
- '#752C85',
- '#8B020E',
- '#E56C00',
- '#FDBE13'
- ]
- },
- transition: {
- duration: 0
- },
- axis: {
- y: {
- min: 0,
- padding: {
- bottom: 0
- },
- tick: {
- format: WD
- }
- },
- y2: {
- show: !0,
- tick: {
- format: WD
- }
- },
- x: {
- type: 'timeseries',
- tick: {
- format: YD.formatter
- }
- }
- },
- point: {
- show: !1
- }
- })
- }
- },
- {
- key: 'componentDidUpdate',
- value: function () {
- this.chart.load(this.getGraphData())
- }
- },
- {
- key: 'componentWillUnmount',
- value: function () {
- this.chart && (this.chart = this.chart.destroy())
- }
- },
- {
- key: 'render',
- value: function () {
- var t = this;
- return C.a.createElement('div', {
- ref: function (e) {
- t.ref = t.ref || {
- },
- t.ref.graph = e
- }
- })
- }
- }
- ]) && MD(e.prototype, t),
- n && MD(e, n),
- o
- }();
- VD(KD, 'propTypes', {
- rows: b.a.arrayOf(b.a.shape({
- date_utc: s.moment.isRequired,
- engagements: b.a.number.isRequired,
- comments: b.a.number.isRequired,
- articleReads: b.a.number.isRequired,
- embedReads: b.a.number.isRequired
- })),
- startDate: s.moment.isRequired,
- endDate: s.moment.isRequired,
- minDate: s.moment.isRequired,
- maxDate: s.moment.isRequired,
- graphData: b.a.object
- });
- rc = function (e) {
- e = UD(UD({
- }, {
- startDate: e.overviewStartDate,
- endDate: e.overviewEndDate,
- minDate: e.overviewMinDate,
- maxDate: e.overviewMaxDate
- }), {
- }, {
- rows: e.overviewRows
- });
- return C.a.createElement(KD, FD({
- graphData: QD
- }, e))
- };
- rc.propTypes = {
- overviewStartDate: s.moment.isRequired,
- overviewEndDate: s.moment.isRequired,
- overviewMinDate: s.moment.isRequired,
- overviewMaxDate: s.moment.isRequired,
- overviewRows: b.a.arrayOf(b.a.shape({
- date_utc: s.moment.isRequired,
- engagements: b.a.number.isRequired,
- comments: b.a.number.isRequired,
- articleReads: b.a.number.isRequired,
- embedReads: b.a.number.isRequired
- }))
- };
- var JD = Ni.a.attachDrivers(rc, [
- go
- ]);
- function $D(e) {
- return ($D = 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator ? function (e) {
- return typeof e
- }
- : function (e) {
- return e && 'function' == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? 'symbol' : typeof e
- }) (e)
- }
- function ZD(t, e) {
- var n,
- a = Object.keys(t);
- return Object.getOwnPropertySymbols && (n = Object.getOwnPropertySymbols(t), e && (n = n.filter(function (e) {
- return Object.getOwnPropertyDescriptor(t, e).enumerable
- })), a.push.apply(a, n)),
- a
- }
- function XD(t) {
- for (var e = 1; e < arguments.length; e++) {
- var n = null != arguments[e] ? arguments[e] : {
- };
- e % 2 ? ZD(Object(n), !0).forEach(function (e) {
- oj(t, e, n[e])
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(n)) : ZD(Object(n)).forEach(function (e) {
- Object.defineProperty(t, e, Object.getOwnPropertyDescriptor(n, e))
- })
- }
- return t
- }
- function ej(e, t) {
- for (var n = 0; n < t.length; n++) {
- var a = t[n];
- a.enumerable = a.enumerable || !1,
- a.configurable = !0,
- 'value' in a && (a.writable = !0),
- Object.defineProperty(e, a.key, a)
- }
- }
- function tj(e, t) {
- return (tj = Object.setPrototypeOf || function (e, t) {
- return e.__proto__ = t,
- e
- }) (e, t)
- }
- function nj(n) {
- var a = function () {
- if ('undefined' == typeof Reflect || !Reflect.construct) return !1;
- if (Reflect.construct.sham) return !1;
- if ('function' == typeof Proxy) return !0;
- try {
- return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [
- ], function () {
- })),
- !0
- } catch (e) {
- return !1
- }
- }();
- return function () {
- var e,
- t = rj(n);
- return e = a ? (e = rj(this).constructor, Reflect.construct(t, arguments, e)) : t.apply(this, arguments),
- t = this,
- !(e = e) || 'object' !== $D(e) && 'function' != typeof e ? aj(t) : e
- }
- }
- function aj(e) {
- if (void 0 === e) throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called');
- return e
- }
- function rj(e) {
- return (rj = Object.setPrototypeOf ? Object.getPrototypeOf : function (e) {
- return e.__proto__ || Object.getPrototypeOf(e)
- }) (e)
- }
- function oj(e, t, n) {
- return t in e ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n,
- e
- }
- yl = function () {
- !function (e, t) {
- if ('function' != typeof t && null !== t) throw new TypeError('Super expression must either be null or a function');
- e.prototype = Object.create(t && t.prototype, {
- constructor: {
- value: e,
- writable: !0,
- configurable: !0
- }
- }),
- t && tj(e, t)
- }(o, A);
- var e,
- t,
- n,
- r = nj(o);
- function o() {
- var n;
- !function (e, t) {
- if (!(e instanceof t)) throw new TypeError('Cannot call a class as a function')
- }(this, o);
- for (var e = arguments.length, t = Array(e), a = 0; a < e; a++) t[a] = arguments[a];
- return oj(aj(n = r.call.apply(r, [
- this
- ].concat(t))), 'state', {
- startDate: ct() ().subtract(1, 'month'),
- endDate: ct() (),
- metricStart: ct() ().subtract(1, 'month').format('MM/DD/YY'),
- metricEnd: ct() ().format('MM/DD/YY'),
- interval: 'day'
- }),
- oj(aj(n), 'getExportUrl', function () {
- var e = io.a.getURL('forums/admin/reports/interactionReport.csv');
- return Eo() (e, {
- api_key: pt.a.keys.api,
- forum: pt.a.currentForum,
- start: ct.a.utc(n.state.startDate).toISOString(),
- end: ct.a.utc(n.state.endDate).toISOString()
- })
- }),
- oj(aj(n), 'reportExport', function () {
- n.props.emitTrackingEvent({
- verb: 'export',
- object_type: 'file',
- object_id: 'csv'
- })
- }),
- oj(aj(n), 'handleDateChange', function (e, t) {
- n.setState({
- startDate: e,
- endDate: t
- }),
- n.reportClick({
- object_type: 'filter',
- object_id: 'date',
- extra_data: JSON.stringify({
- filter_start_date: ct.a.utc(e).format(),
- filter_end_date: ct.a.utc(t).format()
- })
- })
- }),
- oj(aj(n), 'onGroupChange', function (e) {
- n.setState({
- interval: e
- }),
- n.reportClick({
- object_type: 'filter',
- object_id: 'group',
- extra_data: JSON.stringify({
- filter_group: e
- })
- })
- }),
- oj(aj(n), 'handleDismiss', function () {
- n.reportClick({
- adverb: 'dismiss',
- object_type: 'note',
- object_id: 'welcome'
- }),
- n.props.handleDismiss()
- }),
- oj(aj(n), 'reportClick', function (e) {
- n.props.emitTrackingEvent(XD(XD({
- }, e), {
- }, {
- verb: 'click'
- }))
- }),
- oj(aj(n), 'fetch', function () {
- n.props.overviewContentFetch({
- forum: pt.a.currentForum
- })
- }),
- n
- }
- return e = o,
- (t = [
- {
- key: 'componentDidMount',
- value: function () {
- this.fetch(),
- this.props.emitTrackingEvent({
- verb: 'view',
- object_type: 'page',
- object_id: ''.concat(window.document.location.host).concat(window.document.location.pathname)
- })
- }
- },
- {
- key: 'render',
- value: function () {
- if (this.props.organization && this.props.organization.pollsOnly) return C.a.createElement(Cm, {
- isPolls: !1,
- organization: this.props.organization
- });
- var e = Is.a.get('analyticsWelcome') ? null : C.a.createElement(Ki, {
- alertType: 'brand-new',
- topMarginClass: 'spacing-top-none',
- message: C.a.createElement(C.a.Fragment, null, C.a.createElement('span', {
- className: 'text-larger text-semibold'
- }, 'Get started with Disqus Pro Analytics'), C.a.createElement('div', null, C.a.createElement('p', {
- className: 'text-large spacing-narrow spacing-bottom'
- }, 'Uncover insights about your audience including top performing stories by engagement, the growth of your community over time, and more!'), C.a.createElement('a', {
- href: 'https://blog.disqus.com/unlock-content-engagement-insights-in-the-new-disqus-analytics',
- target: '_blank',
- rel: 'noopener noreferrer',
- onClick: this.reportClick.bind(this, {
- adverb: 'learn_more',
- object_type: 'note',
- object_id: 'welcome'
- })
- }, C.a.createElement('button', {
- className: 'button button-large button-fill--white text-medium spacing-narrow spacing-right'
- }, 'Learn More')), C.a.createElement('button', {
- className: 'button button-large button-fill--brand text-medium spacing-narrow',
- onClick: this.handleDismiss
- }, 'Dismiss')))
- });
- return this.props.overviewContentLoading ? C.a.createElement(Ji, null) : C.a.createElement('div', {
- className: 'section-contained'
- }, e, C.a.createElement(Bp, {
- className: 'spacing-bottom',
- leftTitle: 'Topline Metrics',
- rightTitle: C.a.createElement('div', null, C.a.createElement('b', null, 'Past 30 days'), ' (', this.state.metricStart, ' - ', this.state.metricEnd, ')')
- }, C.a.createElement(PD, {
- title: 'Article Reads',
- metric: this.props.articleReads,
- delta: this.props.articleReadsDelta,
- tooltip: 'The number of times people view an article where Disqus is installed.'
- }), C.a.createElement(PD, {
- title: 'Comment Reads',
- metric: this.props.commentReads,
- delta: this.props.commentReadsDelta,
- tooltip: 'The number of times people read the comments section.'
- }), C.a.createElement(PD, {
- title: 'Total Engagements',
- metric: this.props.engagements,
- delta: this.props.engagementsDelta,
- tooltip: 'Total number of comments and votes by readers.'
- })), C.a.createElement(Bp, {
- className: 'spacing-bottom',
- leftTitle: 'Traffic Overview',
- rightTitle: C.a.createElement('div', {
- className: 'card__header-right'
- }, C.a.createElement('a', {
- href: this.getExportUrl(),
- target: '_blank',
- rel: 'noopener noreferrer',
- className: 'card__header-content-item -button -right text-gray-dark text-semibold',
- onClick: this.reportExport
- }, C.a.createElement('span', {
- className: 'icon-download text-large spacing-right text-gray'
- }), 'Download CSV'), C.a.createElement(Zp, {
- dateWrapperClass: 'card__header-datepicker',
- minDate: gt,
- maxDate: ct() (),
- startDate: this.state.startDate,
- endDate: this.state.endDate,
- onDateChange: this.handleDateChange,
- shortcuts: yt,
- group: this.state.interval,
- onGroupChange: this.onGroupChange
- }))
- }, C.a.createElement(JD, {
- startDate: this.state.startDate,
- endDate: this.state.endDate,
- interval: this.state.interval
- })), this.props.topArticle || this.props.topArticlePrevious ? C.a.createElement(Bp, {
- className: 'spacing-bottom',
- leftTitle: 'Want to learn more?'
- }, C.a.createElement('div', {
- className: 'padding-default truncate-line'
- }, this.props.topArticle ? C.a.createElement('div', null, C.a.createElement('div', {
- className: 'text-medium text-semibold'
- }, 'Top article in the past 30 days'), C.a.createElement('a', {
- href: this.props.topArticle.signedLink,
- target: '_blank',
- rel: 'noopener noreferrer',
- className: 'text-larger text-semibold truncate-line'
- }, this.props.topArticle.title), C.a.createElement('div', {
- className: 'text-medium text-gray spacing-bottom'
- }, C.a.createElement('span', {
- className: 'text-semibold'
- }, 'Total Engagements:'), ' ', this.props.topArticle.engagements)) : null, this.props.topArticlePrevious ? C.a.createElement('div', null, C.a.createElement('div', {
- className: 'text-medium text-semibold'
- }, 'Top article in the 30-day period prior to this one'), C.a.createElement('a', {
- href: this.props.topArticlePrevious.signedLink,
- target: '_blank',
- rel: 'noopener noreferrer',
- className: 'text-larger text-semibold truncate-line'
- }, this.props.topArticlePrevious.title), C.a.createElement('div', {
- className: 'text-medium text-gray spacing-bottom'
- }, C.a.createElement('span', {
- className: 'text-semibold'
- }, 'Total Engagements:'), ' ', this.props.topArticlePrevious.engagements)) : null)) : null, C.a.createElement('div', {
- className: 'card__more-info'
- }, C.a.createElement('div', null, C.a.createElement('p', {
- className: 'text-larger text-semibold spacing-bottom-large'
- }, 'How to grow total engagements:'), C.a.createElement('ol', null, C.a.createElement('li', null, 'Ask people to comment with a strong call-to-action.'), C.a.createElement('li', null, 'Be active and present in the comments by replying to readers (especially first-time commenters). Author participation makes a huge difference.'), C.a.createElement('li', null, 'Moderate the comments and establish a set of community guidelines for participation.')), C.a.createElement('a', {
- href: 'https://help.disqus.com/customer/en/portal/topics/637329-community-tips/articles',
- target: '_blank',
- rel: 'noopener noreferrer',
- onClick: this.reportClick.bind(this, {
- adverb: 'learn_more',
- area: 'footer',
- object_type: 'area',
- object_id: 'footer'
- })
- }, C.a.createElement('button', {
- className: 'button button-large button-fill--brand text-medium spacing-top-double'
- }, 'Learn More')))))
- }
- }
- ]) && ej(e.prototype, t),
- n && ej(e, n),
- o
- }();
- oj(yl, 'propTypes', {
- overviewContentFetch: b.a.func.isRequired,
- handleDismiss: b.a.func.isRequired,
- articleReads: b.a.number.isRequired,
- articleReadsDelta: b.a.number.isRequired,
- commentReads: b.a.number.isRequired,
- commentReadsDelta: b.a.number.isRequired,
- engagements: b.a.number.isRequired,
- engagementsDelta: b.a.number.isRequired,
- topArticle: b.a.object,
- topArticlePrevious: b.a.object,
- emitTrackingEvent: b.a.func.isRequired,
- overviewContentLoading: b.a.bool
- });
- var ij = Object(u.connect) (function (e) {
- return {
- organization: e.selection.organization
- }
- }, {
- emitTrackingEvent: Xo({
- zone: 'analytics',
- section: 'welcome'
- })
- }) (Ni.a.attachDrivers(yl, [
- Wi
- ]));
- function sj(t, e) {
- var n,
- a = Object.keys(t);
- return Object.getOwnPropertySymbols && (n = Object.getOwnPropertySymbols(t), e && (n = n.filter(function (e) {
- return Object.getOwnPropertyDescriptor(t, e).enumerable
- })), a.push.apply(a, n)),
- a
- }
- function lj(a) {
- for (var e = 1; e < arguments.length; e++) {
- var r = null != arguments[e] ? arguments[e] : {
- };
- e % 2 ? sj(Object(r), !0).forEach(function (e) {
- var t,
- n;
- n = r[t = e],
- t in (e = a) ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(a, Object.getOwnPropertyDescriptors(r)) : sj(Object(r)).forEach(function (e) {
- Object.defineProperty(a, e, Object.getOwnPropertyDescriptor(r, e))
- })
- }
- return a
- }
- function cj(e, t, n) {
- t.selection.forum && n(e = {
- data: lj({
- forum: t.selection.forum.shortname
- }, e)
- })
- }
- var uj = 5,
- pj = function (e, t) {
- return 0 === e ? 0 === t ? 0 : 100 : Math.round((t - e) / e * 100)
- },
- dj = {
- new : '#8BCF93',
- returning: '#2E9FFF',
- recovered: '#7E919F'
- },
- mj = [
- 'new',
- 'returning',
- 'recovered'
- ],
- Ru = b.a.shape({
- periodDays: b.a.number.isRequired,
- commentReaders: b.a.number.isRequired,
- subscribedReaders: b.a.number.isRequired,
- engagedReaders: b.a.shape({
- new : b.a.number.isRequired,
- returning: b.a.number.isRequired,
- recovered: b.a.number.isRequired
- }).isRequired
- }),
- F = b.a.shape({
- current: Ru.isRequired,
- previous: Ru.isRequired,
- userExportEmail: b.a.bool.isRequired
- }),
- r = b.a.shape({
- displayName: b.a.string,
- username: b.a.string.isRequired,
- engagements: b.a.number.isRequired,
- comments: b.a.number.isRequired,
- firstEngagement: b.a.string.isRequired,
- lastEngagement: b.a.string.isRequired,
- subscribedOn: b.a.string,
- type: b.a.oneOf([].concat(mj, [
- 're-engaged',
- 'inactive'
- ]))
- }),
- s = function (e, t, n, a, r) {
- t = e[t];
- if (!Array.isArray(t) || 2 !== t.length || 'string' != typeof t[0] || 'number' != typeof t[1]) return Error('The '.concat(a, ' `').concat(r, '` in `').concat(n, '` is expected to be of the form [\'YYYY-MM-DD\', count].'))
- },
- rc = b.a.shape({
- new : b.a.arrayOf(s).isRequired,
- returning: b.a.arrayOf(s).isRequired,
- recovered: b.a.arrayOf(s).isRequired,
- inactive: b.a.arrayOf(s).isRequired
- }),
- fj = {
- transition: {
- duration: 0
- },
- interaction: {
- enabled: !1
- },
- axis: {
- rotated: !0,
- x: {
- show: !1
- },
- y: {
- show: !1
- }
- },
- legend: {
- show: !1
- },
- bar: {
- width: 50
- },
- size: {
- width: 350
- },
- point: {
- show: !1
- }
- };
- function hj(e) {
- return (hj = 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator ? function (e) {
- return typeof e
- }
- : function (e) {
- return e && 'function' == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? 'symbol' : typeof e
- }) (e)
- }
- function gj(t, e) {
- var n,
- a = Object.keys(t);
- return Object.getOwnPropertySymbols && (n = Object.getOwnPropertySymbols(t), e && (n = n.filter(function (e) {
- return Object.getOwnPropertyDescriptor(t, e).enumerable
- })), a.push.apply(a, n)),
- a
- }
- function yj(t) {
- for (var e = 1; e < arguments.length; e++) {
- var n = null != arguments[e] ? arguments[e] : {
- };
- e % 2 ? gj(Object(n), !0).forEach(function (e) {
- Sj(t, e, n[e])
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(n)) : gj(Object(n)).forEach(function (e) {
- Object.defineProperty(t, e, Object.getOwnPropertyDescriptor(n, e))
- })
- }
- return t
- }
- function bj(e, t) {
- for (var n = 0; n < t.length; n++) {
- var a = t[n];
- a.enumerable = a.enumerable || !1,
- a.configurable = !0,
- 'value' in a && (a.writable = !0),
- Object.defineProperty(e, a.key, a)
- }
- }
- function vj(e, t) {
- return (vj = Object.setPrototypeOf || function (e, t) {
- return e.__proto__ = t,
- e
- }) (e, t)
- }
- function _j(n) {
- var a = function () {
- if ('undefined' == typeof Reflect || !Reflect.construct) return !1;
- if (Reflect.construct.sham) return !1;
- if ('function' == typeof Proxy) return !0;
- try {
- return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [
- ], function () {
- })),
- !0
- } catch (e) {
- return !1
- }
- }();
- return function () {
- var e,
- t = Oj(n);
- return e = a ? (e = Oj(this).constructor, Reflect.construct(t, arguments, e)) : t.apply(this, arguments),
- t = this,
- !(e = e) || 'object' !== hj(e) && 'function' != typeof e ? Ej(t) : e
- }
- }
- function Ej(e) {
- if (void 0 === e) throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called');
- return e
- }
- function Oj(e) {
- return (Oj = Object.setPrototypeOf ? Object.getPrototypeOf : function (e) {
- return e.__proto__ || Object.getPrototypeOf(e)
- }) (e)
- }
- function Sj(e, t, n) {
- return t in e ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n,
- e
- }
- go = function () {
- !function (e, t) {
- if ('function' != typeof t && null !== t) throw new TypeError('Super expression must either be null or a function');
- e.prototype = Object.create(t && t.prototype, {
- constructor: {
- value: e,
- writable: !0,
- configurable: !0
- }
- }),
- t && vj(e, t)
- }(o, A);
- var e,
- t,
- n,
- r = _j(o);
- function o() {
- var n;
- !function (e, t) {
- if (!(e instanceof t)) throw new TypeError('Cannot call a class as a function')
- }(this, o);
- for (var e = arguments.length, t = Array(e), a = 0; a < e; a++) t[a] = arguments[a];
- return Sj(Ej(n = r.call.apply(r, [
- this
- ].concat(t))), 'state', {
- sortColumn: 'engagements',
- sortDir: tD.SORT_DESC,
- modalIsOpen: !1,
- isDisabled: !1
- }),
- Sj(Ej(n), 'getExportUrl', function () {
- if (n.props.shouldEmailCsv) return '#';
- var e = io.a.getURL('forums/admin/reports/userReportExport.csv');
- return Eo() (e, {
- api_key: pt.a.keys.api,
- forum: pt.a.currentForum
- })
- }),
- Sj(Ej(n), 'exportCSV', function (e) {
- var t = {
- verb: 'export',
- object_type: 'file',
- object_id: 'csv',
- area: 'community_members',
- adjectvie: 'community_members'
- };
- n.props.shouldEmailCsv ? (e.preventDefault(), n.props.exportUserReportCsv(), n.props.emitTrackingEvent(yj(yj({
- }, t), {
- }, {
- adverb: 'email'
- })), n.setState({
- modalIsOpen: !0
- })) : n.props.emitTrackingEvent(yj(yj({
- }, t), {
- }, {
- adverb: 'direct'
- }))
- }),
- Sj(Ej(n), 'closeModal', function () {
- n.setState({
- modalIsOpen: !1
- })
- }),
- Sj(Ej(n), 'handleSort', function (e, t) {
- n.setState({
- sortColumn: e,
- sortDir: t,
- isDisabled: !0
- }, function () {
- return n.fetch()
- }),
- n.props.emitTrackingEvent({
- verb: 'click',
- object_type: 'sort',
- object_id: e,
- adjectvie: t,
- area: 'community_members'
- })
- }),
- Sj(Ej(n), 'fetch', function (e) {
- n.props.fetchUserReport(yj({
- forum: pt.a.currentForum,
- sort: n.state.sortColumn,
- order: n.state.sortDir
- }, e))
- }),
- Sj(Ej(n), 'fetchMore', function () {
- n.props.userReport.cursor.hasNext && (n.props.emitTrackingEvent({
- verb: 'click',
- object_type: 'button',
- object_id: 'show_more_results',
- area: 'community_members'
- }), n.fetch({
- cursor: n.props.userReport.cursor.next
- }))
- }),
- Sj(Ej(n), 'getModerationUserFilterUrl', function (e) {
- return '/admin/moderate/all/search/user%3A'.concat(e.username)
- }),
- n
- }
- return e = o,
- (t = [
- {
- key: 'componentDidMount',
- value: function () {
- this.fetch()
- }
- },
- {
- key: 'componentWillReceiveProps',
- value: function (e) {
- this.props.userReport.isFetching && !e.userReport.isFetching && this.setState({
- isDisabled: !1
- })
- }
- },
- {
- key: 'render',
- value: function () {
- var e,
- t = this,
- n = C.a.createElement('div', {
- className: 'card__header-right'
- }, C.a.createElement('a', {
- href: this.getExportUrl(),
- onClick: this.exportCSV,
- target: '_blank',
- rel: 'noopener noreferrer',
- className: 'card__header-content-item -button -right text-semibold text-gray-dark'
- }, C.a.createElement('span', {
- className: 'icon-download text-large spacing-right text-gray'
- }), 'Export .csv')),
- a = function (e) {
- return e ? ct() (e).format('MM/DD/YY') : ''
- },
- r = function (e) {
- return e.toLocaleString()
- },
- o = 0 === this.props.userReport.users.length ? C.a.createElement('div', {
- className: 'empty-content-message'
- }, 'No items') : null;
- this.state.isDisabled || (this.props.userReport.isFetching ? e = C.a.createElement('div', {
- className: 'spinner'
- }) : this.props.userReport.cursor.hasNext && (e = C.a.createElement('button', {
- className: 'button button-wide button-outline button-medium',
- onClick: this.fetchMore
- }, C.a.createElement('span', null, 'Show more results'))));
- var i = C.a.createElement('span', null, 'Readers logged-in to Disqus who subscribed to your email list using the ', C.a.createElement(v.Link, {
- to: 'settings/email-subscriptions/',
- onClick: function () {
- t.props.emitTrackingEvent({
- verb: 'click',
- object_type: 'link',
- object_id: 'email_subscriptions',
- area: 'community_members'
- })
- }
- }, 'Email Subscriptions'), ' feature.');
- return C.a.createElement('div', {
- className: 'community-table'
- }, this.state.isDisabled ? C.a.createElement('div', {
- className: 'overlay'
- }, C.a.createElement('div', {
- className: 'spinner'
- })) : null, C.a.createElement(Bp, {
- className: 'spacing-bottom',
- leftTitle: 'Community Members',
- rightTitle: n,
- bodyClassName: 'text-medium -overflow-scroll'
- }, C.a.createElement(ZA, {
- headers: [
- {
- key: 'displayName',
- content: 'Display Name',
- urlFn: this.getModerationUserFilterUrl,
- sortable: !1,
- colClass: 'text-semibold'
- },
- {
- key: 'engagements',
- content: 'Engagements',
- formatFn: r
- },
- {
- key: 'comments',
- content: 'Comments',
- formatFn: r
- },
- {
- key: 'firstEngagement',
- content: 'First Engagement',
- formatFn: a
- },
- {
- key: 'lastEngagement',
- content: 'Last Engagement',
- formatFn: a
- },
- {
- key: 'subscribedOn',
- content: 'Subscribed On',
- formatFn: a,
- description: i,
- onShowDescription: function () {
- t.props.emitTrackingEvent({
- verb: 'hover',
- object_type: 'button',
- object_id: 'subscribed_on',
- area: 'community_members'
- })
- }
- },
- {
- key: 'type',
- colClass: 'col__type',
- content: 'Type',
- formatFn: function (e) {
- return C.a.createElement('span', {
- className: 'badge--user-label -'.concat(e)
- }, 're-engaged' === e ? 'Recovered' : e)
- },
- sortable: !1
- }
- ].map(function (e) {
- return yj(yj({
- }, e), {
- }, {
- sortDir: t.state.sortColumn === e.key ? t.state.sortDir : tD.SORT_NONE
- })
- }),
- rows: this.props.userReport.users.map(function (e) {
- return yj(yj({
- }, e), {
- }, {
- id: e.username
- })
- }),
- onSort: this.handleSort,
- reportClick: function (e) {
- t.props.emitTrackingEvent({
- verb: 'click',
- object_type: 'link',
- object_id: t.getModerationUserFilterUrl({
- username: e.object_id
- }),
- area: 'community_members'
- })
- }
- }), o, e), C.a.createElement(_.a, {
- className: 'admin-modal -clipped -wider',
- overlayClassName: 'modal-overlay',
- isOpen: this.state.modalIsOpen,
- onRequestClose: this.closeModal
- }, C.a.createElement('div', {
- className: 'modal-content'
- }, C.a.createElement('div', {
- className: 'modal-header align align--between'
- }, C.a.createElement('h4', {
- className: 'modal-title'
- }, 'Export audience'), C.a.createElement('button', {
- className: 'link-gray',
- onClick: this.closeModal
- }, C.a.createElement('span', {
- className: 'icon-cancel icon__position'
- }))), C.a.createElement('div', {
- className: 'modal-body'
- }, 'We\'re processing your export request! You\'ll receive an email with a link to your export data when it\'s ready. The time it takes to receive this email may vary based on the size of your audience.'))))
- }
- }
- ]) && bj(e.prototype, t),
- n && bj(e, n),
- o
- }();
- Sj(go, 'propTypes', {
- userReport: b.a.shape({
- users: b.a.arrayOf(r).isRequired,
- cursor: b.a.object.isRequired,
- isFetching: b.a.bool
- }).isRequired,
- fetchUserReport: b.a.func.isRequired,
- shouldEmailCsv: b.a.bool,
- exportUserReportCsv: b.a.func.isRequired,
- emitTrackingEvent: b.a.func.isRequired
- });
- var wj = go,
- yl = function (e) {
- var t = e.startDate,
- n = e.endDate,
- a = e.overviewMetrics,
- r = e.isAudienceEmailSubscriptionSupported,
- o = e.emitTrackingEvent,
- i = function (e) {
- return e.new + e.returning + e.recovered
- },
- e = i(a.current.engagedReaders),
- i = i(a.previous.engagedReaders);
- return C.a.createElement(Bp, {
- className: 'spacing-bottom',
- leftTitle: 'Overview',
- rightTitle: C.a.createElement('div', null, C.a.createElement('b', null, 'Past 30 days'), ' (', t, ' - ', n, ')')
- }, C.a.createElement(PD, {
- title: 'Comment Readers',
- metric: a.current.commentReaders,
- delta: pj(a.previous.commentReaders, a.current.commentReaders),
- tooltip: 'The number of readers who read the comments section on an article on your site.'
- }), C.a.createElement(PD, {
- title: 'Engaged Readers',
- metric: e,
- delta: pj(i, e),
- tooltip: 'Readers who commented or voted on a comment on an article in the past 30 days.'
- }), C.a.createElement(PD, {
- title: 'Email Subscribers',
- metric: r ? a.current.subscribedReaders : null,
- delta: r ? pj(a.previous.subscribedReaders, a.current.subscribedReaders) : null,
- tooltip: C.a.createElement(C.a.Fragment, null, 'Readers who subscribed to emails via', C.a.createElement(v.Link, {
- to: 'settings/email-subscriptions/',
- onClick: function () {
- o({
- verb: 'click',
- object_type: 'link',
- object_id: 'email_subscriptions',
- area: 'topline_audience_metrics'
- })
- }
- }, ' Disqus Email Subscriptions '), 'in the past 30 days.', r ? null : C.a.createElement('div', {
- className: 'admin-metric__bottom'
- }, C.a.createElement('p', {
- className: 'text-gray-light text-huge'
- }, '0'), C.a.createElement('p', {
- className: 'admin-metric__delta text-gray-light'
- }, 'Not enabled for your site')))
- }))
- };
- yl.propTypes = {
- startDate: b.a.string.isRequired,
- endDate: b.a.string.isRequired,
- overviewMetrics: F.isRequired,
- isAudienceEmailSubscriptionSupported: b.a.bool,
- emitTrackingEvent: b.a.func.isRequired
- };
- var Pj = yl;
- function kj(e) {
- return (kj = 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator ? function (e) {
- return typeof e
- }
- : function (e) {
- return e && 'function' == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? 'symbol' : typeof e
- }) (e)
- }
- function Nj(t, e) {
- var n,
- a = Object.keys(t);
- return Object.getOwnPropertySymbols && (n = Object.getOwnPropertySymbols(t), e && (n = n.filter(function (e) {
- return Object.getOwnPropertyDescriptor(t, e).enumerable
- })), a.push.apply(a, n)),
- a
- }
- function Cj(t) {
- for (var e = 1; e < arguments.length; e++) {
- var n = null != arguments[e] ? arguments[e] : {
- };
- e % 2 ? Nj(Object(n), !0).forEach(function (e) {
- Tj(t, e, n[e])
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(n)) : Nj(Object(n)).forEach(function (e) {
- Object.defineProperty(t, e, Object.getOwnPropertyDescriptor(n, e))
- })
- }
- return t
- }
- function Rj(e, t) {
- for (var n = 0; n < t.length; n++) {
- var a = t[n];
- a.enumerable = a.enumerable || !1,
- a.configurable = !0,
- 'value' in a && (a.writable = !0),
- Object.defineProperty(e, a.key, a)
- }
- }
- function xj(e, t) {
- return (xj = Object.setPrototypeOf || function (e, t) {
- return e.__proto__ = t,
- e
- }) (e, t)
- }
- function Aj(n) {
- var a = function () {
- if ('undefined' == typeof Reflect || !Reflect.construct) return !1;
- if (Reflect.construct.sham) return !1;
- if ('function' == typeof Proxy) return !0;
- try {
- return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [
- ], function () {
- })),
- !0
- } catch (e) {
- return !1
- }
- }();
- return function () {
- var e,
- t = jj(n);
- return e = a ? (e = jj(this).constructor, Reflect.construct(t, arguments, e)) : t.apply(this, arguments),
- t = this,
- !(e = e) || 'object' !== kj(e) && 'function' != typeof e ? Dj(t) : e
- }
- }
- function Dj(e) {
- if (void 0 === e) throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called');
- return e
- }
- function jj(e) {
- return (jj = Object.setPrototypeOf ? Object.getPrototypeOf : function (e) {
- return e.__proto__ || Object.getPrototypeOf(e)
- }) (e)
- }
- function Tj(e, t, n) {
- return t in e ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n,
- e
- }
- Wi = function () {
- !function (e, t) {
- if ('function' != typeof t && null !== t) throw new TypeError('Super expression must either be null or a function');
- e.prototype = Object.create(t && t.prototype, {
- constructor: {
- value: e,
- writable: !0,
- configurable: !0
- }
- }),
- t && xj(e, t)
- }(o, A);
- var e,
- t,
- n,
- r = Aj(o);
- function o() {
- var a;
- !function (e, t) {
- if (!(e instanceof t)) throw new TypeError('Cannot call a class as a function')
- }(this, o);
- for (var e = arguments.length, t = Array(e), n = 0; n < e; n++) t[n] = arguments[n];
- return Tj(Dj(a = r.call.apply(r, [
- this
- ].concat(t))), 'graph-new', C.a.createRef()),
- Tj(Dj(a), 'graph-returning', C.a.createRef()),
- Tj(Dj(a), 'graph-recovered', C.a.createRef()),
- Tj(Dj(a), 'initCharts', function (e) {
- var n;
- !a['graph-new'].current.parentElement.clientHeight && (e || 0) < uj ? setTimeout(a.initCharts.bind(Dj(a), (e || 0) + 1), 0) : (n = Math.max.apply(null, Object.keys(a.props.overviewMetrics.current.engagedReaders).map(function (e) {
- return a.props.overviewMetrics.current.engagedReaders[e]
- })), a.charts = mj.reduce(Function.bind.call(function (e, t) {
- return e[t] = Ed.a.generate(Cj(Cj({
- }, fj), {
- }, {
- axis: Cj(Cj({
- }, fj.axis), {
- }, {
- y: Cj(Cj({
- }, fj.axis.y), {
- }, {
- max: n
- })
- }),
- bindto: a['graph-'.concat(t)].current,
- data: a.getGraphData(t)
- })),
- e
- }, Dj(a)), {
- }))
- }),
- Tj(Dj(a), 'getGraphData', function (e) {
- return {
- columns: [
- [''.concat(e, 'EngagedReaders'),
- a.props.overviewMetrics.current.engagedReaders[e]]
- ],
- type: 'bar',
- labels: !0,
- colors: Tj({
- }, ''.concat(e, 'EngagedReaders'), dj[e])
- }
- }),
- Tj(Dj(a), 'getEngagementReadersDelta', function (e) {
- return pj(a.props.overviewMetrics.previous.engagedReaders[e], a.props.overviewMetrics.current.engagedReaders[e])
- }),
- a
- }
- return e = o,
- (t = [
- {
- key: 'componentDidMount',
- value: function () {
- this.initCharts()
- }
- },
- {
- key: 'componentDidUpdate',
- value: function () {
- var t = this;
- this.charts && Object.keys(this.charts).forEach(function (e) {
- t.charts[e].load(t.getGraphData(e))
- })
- }
- },
- {
- key: 'componentWillUnmount',
- value: function () {
- var t = this;
- this.charts && Object.keys(this.charts).forEach(function (e) {
- t.charts[e].destroy()
- })
- }
- },
- {
- key: 'render',
- value: function () {
- return C.a.createElement(Bp, {
- className: 'spacing-bottom',
- leftTitle: 'Snapshot of Engaged Readers',
- rightTitle: C.a.createElement('div', null, C.a.createElement('b', null, 'Past 30 days'), ' (', this.props.startDate, ' - ', this.props.endDate, ')')
- }, C.a.createElement('div', {
- className: 'readers-snapshot'
- }, C.a.createElement('div', null, C.a.createElement(PD, {
- title: 'New',
- delta: this.getEngagementReadersDelta('new')
- }, 'Readers who engaged for the first time in the past 30 days.'), C.a.createElement('div', {
- className: 'readers-snapshot__graph'
- }, C.a.createElement('div', {
- ref: this['graph-new']
- }))), C.a.createElement('div', null, C.a.createElement(PD, {
- title: 'Returning',
- delta: this.getEngagementReadersDelta('returning')
- }, 'Readers who engaged in the past 30 days and prior 30 days.'), C.a.createElement('div', {
- className: 'readers-snapshot__graph'
- }, C.a.createElement('div', {
- ref: this['graph-returning']
- }))), C.a.createElement('div', null, C.a.createElement(PD, {
- title: 'Recovered',
- delta: this.getEngagementReadersDelta('recovered')
- }, 'Readers who engaged in the past 30 days but not in the prior 30 days.'), C.a.createElement('div', {
- className: 'readers-snapshot__graph'
- }, C.a.createElement('div', {
- ref: this['graph-recovered']
- })))))
- }
- }
- ]) && Rj(e.prototype, t),
- n && Rj(e, n),
- o
- }();
- Tj(Wi, 'propTypes', {
- startDate: b.a.string.isRequired,
- endDate: b.a.string.isRequired,
- overviewMetrics: F.isRequired
- });
- var Ij = Wi;
- function qj(e) {
- return (qj = 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator ? function (e) {
- return typeof e
- }
- : function (e) {
- return e && 'function' == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? 'symbol' : typeof e
- }) (e)
- }
- function Fj(e) {
- return function (e) {
- if (Array.isArray(e)) return Lj(e)
- }(e) || function (e) {
- if ('undefined' != typeof Symbol && null != e[Symbol.iterator] || null != e['@@iterator']) return Array.from(e)
- }(e) || function (e, t) {
- if (e) {
- if ('string' == typeof e) return Lj(e, t);
- var n = Object.prototype.toString.call(e).slice(8, - 1);
- return 'Map' === (n = 'Object' === n && e.constructor ? e.constructor.name : n) || 'Set' === n ? Array.from(e) : 'Arguments' === n || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n) ? Lj(e, t) : void 0
- }
- }(e) || function () {
- throw new TypeError('Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.')
- }()
- }
- function Lj(e, t) {
- for (var n = 0, a = Array(t = null == t || e.length < t ? e.length : t); n < t; n++) a[n] = e[n];
- return a
- }
- function Uj(e, t) {
- for (var n = 0; n < t.length; n++) {
- var a = t[n];
- a.enumerable = a.enumerable || !1,
- a.configurable = !0,
- 'value' in a && (a.writable = !0),
- Object.defineProperty(e, a.key, a)
- }
- }
- function Mj(e, t) {
- return (Mj = Object.setPrototypeOf || function (e, t) {
- return e.__proto__ = t,
- e
- }) (e, t)
- }
- function Bj(n) {
- var a = function () {
- if ('undefined' == typeof Reflect || !Reflect.construct) return !1;
- if (Reflect.construct.sham) return !1;
- if ('function' == typeof Proxy) return !0;
- try {
- return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [
- ], function () {
- })),
- !0
- } catch (e) {
- return !1
- }
- }();
- return function () {
- var e,
- t = Hj(n);
- return e = a ? (e = Hj(this).constructor, Reflect.construct(t, arguments, e)) : t.apply(this, arguments),
- t = this,
- !(e = e) || 'object' !== qj(e) && 'function' != typeof e ? zj(t) : e
- }
- }
- function zj(e) {
- if (void 0 === e) throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called');
- return e
- }
- function Hj(e) {
- return (Hj = Object.setPrototypeOf ? Object.getPrototypeOf : function (e) {
- return e.__proto__ || Object.getPrototypeOf(e)
- }) (e)
- }
- function Gj(e, t, n) {
- return t in e ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n,
- e
- }
- var Vj = function (e) {
- return e.toLocaleString()
- },
- Wj = {
- key: 'date_utc',
- name: 'Date (UTC)',
- formatter: function (e) {
- return ct.a.utc(e).format('MMM Do YYYY')
- }
- },
- Ru = function () {
- !function (e, t) {
- if ('function' != typeof t && null !== t) throw new TypeError('Super expression must either be null or a function');
- e.prototype = Object.create(t && t.prototype, {
- constructor: {
- value: e,
- writable: !0,
- configurable: !0
- }
- }),
- t && Mj(e, t)
- }(o, A);
- var e,
- t,
- n,
- r = Bj(o);
- function o() {
- var n;
- !function (e, t) {
- if (!(e instanceof t)) throw new TypeError('Cannot call a class as a function')
- }(this, o);
- for (var e = arguments.length, t = Array(e), a = 0; a < e; a++) t[a] = arguments[a];
- return Gj(zj(n = r.call.apply(r, [
- this
- ].concat(t))), 'state', {
- group: 'day',
- startDate: ct() ().utc().subtract(1, 'month'),
- endDate: ct() ().utc()
- }),
- Gj(zj(n), 'initGraph', function (e) {
- n.ref && (!n.ref.graph.parentElement.clientWidth && (e || 0) < uj ? setTimeout(n.initGraph.bind(zj(n), (e || 0) + 1), 0) : n.chart = Ed.a.generate({
- bindto: n.ref.graph,
- data: n.getGraphData(),
- color: {
- pattern: [
- dj.new,
- dj.returning,
- dj.recovered
- ]
- },
- transition: {
- duration: 0
- },
- axis: {
- y: {
- min: 0,
- padding: {
- bottom: 0
- },
- tick: {
- format: Vj
- }
- },
- x: {
- type: 'timeseries',
- tick: {
- format: Wj.formatter
- }
- }
- },
- point: {
- show: !1
- }
- }))
- }),
- Gj(zj(n), 'trackHover', function () {
- n.isHoverTracked || (n.props.emitTrackingEvent({
- verb: 'hover',
- object_type: 'area',
- object_id: 'community_growth',
- adjectvie: 'engagements_over_time',
- area: 'engaged_readers'
- }), n.isHoverTracked = !0)
- }),
- Gj(zj(n), 'getGraphData', function () {
- return {
- x: 'dates',
- columns: [
- ['dates'].concat(Fj(n.props.engagementReport.new.map(function (e) {
- return e[0]
- })))
- ].concat(Fj(mj.map(function (e) {
- return [e].concat(Fj(n.props.engagementReport[e].map(function (e) {
- return e[1]
- })))
- }))),
- names: {
- new : 'New',
- returning: 'Returning',
- recovered: 'Recovered'
- },
- onmouseover: n.trackHover
- }
- }),
- Gj(zj(n), 'fetchUserEngagementReport', function () {
- n.props.fetchUserEngagementReport({
- interval: 'day' === n.state.group ? 'daily' : 'monthly',
- start: n.state.startDate.toISOString(),
- end: n.state.endDate.toISOString()
- })
- }),
- Gj(zj(n), 'onGroupChange', function (e) {
- n.props.emitTrackingEvent({
- verb: 'click',
- object_type: 'option',
- object_id: 'day' === e ? 'daily' : 'monthly',
- area: 'engaged_readers'
- }),
- n.setState({
- group: e,
- startDate: 'day' === e ? ct() ().utc().subtract(1, 'month') : ct() ().utc().subtract(1, 'year').startOf('month')
- }, n.fetchUserEngagementReport)
- }),
- Gj(zj(n), 'onDateChange', function (e, t) {
- n.setState({
- startDate: e,
- endDate: t
- }, n.fetchUserEngagementReport)
- }),
- n
- }
- return e = o,
- (t = [
- {
- key: 'componentDidMount',
- value: function () {
- this.fetchUserEngagementReport(),
- this.initGraph()
- }
- },
- {
- key: 'componentDidUpdate',
- value: function () {
- this.chart ? this.chart.load(this.getGraphData()) : this.initGraph()
- }
- },
- {
- key: 'componentWillUnmount',
- value: function () {
- this.chart && (this.chart = this.chart.destroy())
- }
- },
- {
- key: 'render',
- value: function () {
- var t = this;
- return Object.keys(this.props.engagementReport).some(function (e) {
- return t.props.engagementReport[e].length
- }) ? C.a.createElement(Bp, {
- className: 'engaged-readers spacing-bottom',
- leftTitle: 'Engaged Readers Over Time',
- rightTitle: C.a.createElement('div', {
- className: 'card__header-right'
- }, C.a.createElement(Zp, {
- dateWrapperClass: 'card__header-datepicker',
- minDate: ct() ().utc().subtract(1, 'year'),
- maxDate: ct() ().utc(),
- startDate: this.state.startDate,
- endDate: this.state.endDate,
- group: this.state.group,
- onGroupChange: this.onGroupChange,
- onDateChange: this.onDateChange
- }))
- }, C.a.createElement('div', {
- ref: function (e) {
- t.ref = t.ref || {
- },
- t.ref.graph = e
- }
- })) : null
- }
- }
- ]) && Uj(e.prototype, t),
- n && Uj(e, n),
- o
- }();
- Gj(Ru, 'propTypes', {
- engagementReport: rc.isRequired,
- fetchUserEngagementReport: b.a.func.isRequired,
- emitTrackingEvent: b.a.func.isRequired
- });
- var Yj = Ru;
- function Qj(e) {
- return (Qj = 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator ? function (e) {
- return typeof e
- }
- : function (e) {
- return e && 'function' == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? 'symbol' : typeof e
- }) (e)
- }
- function Kj(t, e) {
- var n,
- a = Object.keys(t);
- return Object.getOwnPropertySymbols && (n = Object.getOwnPropertySymbols(t), e && (n = n.filter(function (e) {
- return Object.getOwnPropertyDescriptor(t, e).enumerable
- })), a.push.apply(a, n)),
- a
- }
- function Jj(t) {
- for (var e = 1; e < arguments.length; e++) {
- var n = null != arguments[e] ? arguments[e] : {
- };
- e % 2 ? Kj(Object(n), !0).forEach(function (e) {
- nT(t, e, n[e])
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(n)) : Kj(Object(n)).forEach(function (e) {
- Object.defineProperty(t, e, Object.getOwnPropertyDescriptor(n, e))
- })
- }
- return t
- }
- function $j(e, t) {
- for (var n = 0; n < t.length; n++) {
- var a = t[n];
- a.enumerable = a.enumerable || !1,
- a.configurable = !0,
- 'value' in a && (a.writable = !0),
- Object.defineProperty(e, a.key, a)
- }
- }
- function Zj(e, t) {
- return (Zj = Object.setPrototypeOf || function (e, t) {
- return e.__proto__ = t,
- e
- }) (e, t)
- }
- function Xj(n) {
- var a = function () {
- if ('undefined' == typeof Reflect || !Reflect.construct) return !1;
- if (Reflect.construct.sham) return !1;
- if ('function' == typeof Proxy) return !0;
- try {
- return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [
- ], function () {
- })),
- !0
- } catch (e) {
- return !1
- }
- }();
- return function () {
- var e,
- t = tT(n);
- return e = a ? (e = tT(this).constructor, Reflect.construct(t, arguments, e)) : t.apply(this, arguments),
- t = this,
- !(e = e) || 'object' !== Qj(e) && 'function' != typeof e ? eT(t) : e
- }
- }
- function eT(e) {
- if (void 0 === e) throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called');
- return e
- }
- function tT(e) {
- return (tT = Object.setPrototypeOf ? Object.getPrototypeOf : function (e) {
- return e.__proto__ || Object.getPrototypeOf(e)
- }) (e)
- }
- function nT(e, t, n) {
- return t in e ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n,
- e
- }
- var aT = 200,
- s = function () {
- !function (e, t) {
- if ('function' != typeof t && null !== t) throw new TypeError('Super expression must either be null or a function');
- e.prototype = Object.create(t && t.prototype, {
- constructor: {
- value: e,
- writable: !0,
- configurable: !0
- }
- }),
- t && Zj(e, t)
- }(o, A);
- var e,
- t,
- n,
- r = Xj(o);
- function o() {
- var a;
- !function (e, t) {
- if (!(e instanceof t)) throw new TypeError('Cannot call a class as a function')
- }(this, o);
- for (var e = arguments.length, t = Array(e), n = 0; n < e; n++) t[n] = arguments[n];
- return nT(eT(a = r.call.apply(r, [
- this
- ].concat(t))), 'initViewEvents', function () {
- a.onScroll = je.a.debounce(a.onScroll, 100),
- window.addEventListener('scroll', a.onScroll);
- var e = {
- verb: 'view',
- object_type: 'area'
- };
- a.viewEvents = [
- {
- ref: 'readersTimeline',
- onView: a.props.emitTrackingEvent.bind(eT(a), Jj(Jj({
- }, e), {
- }, {
- object_id: 'community_growth',
- area: 'engaged_readers'
- }))
- },
- {
- ref: 'community',
- onView: a.props.emitTrackingEvent.bind(eT(a), Jj(Jj({
- }, e), {
- }, {
- object_id: 'community_members',
- area: 'community_members'
- }))
- }
- ]
- }),
- nT(eT(a), 'onScroll', function () {
- a.viewEvents = a.viewEvents.filter(function (e) {
- var t = window.innerHeight || window.document.documentElement.clientHeight,
- n = a.ref[e.ref] && l.a.findDOMNode(a.ref[e.ref]),
- n = n && n.getBoundingClientRect();
- return !n || t - n.top < aT || n.bottom < aT || (e.onView(), !1)
- }),
- a.viewEvents.length || window.removeEventListener('scroll', a.onScroll)
- }),
- nT(eT(a), 'isSaasFeatureSupported', function (e) {
- if (!a.props.selection.organization) return !1;
- var t = a.props.saasFeatures[a.props.selection.organization.id];
- return t && t[e]
- }),
- a
- }
- return e = o,
- (t = [
- {
- key: 'componentDidMount',
- value: function () {
- this.isSaasFeatureSupported('advancedAnalytics') ? (this.props.fetchOverviewMetrics(), this.props.emitTrackingEvent({
- verb: 'view',
- object_type: 'page',
- object_id: ''.concat(window.document.location.host).concat(window.document.location.pathname)
- }), this.initViewEvents()) : this.props.history.push(ho.getRoute('/analytics/comments/'))
- }
- },
- {
- key: 'componentWillUnmount',
- value: function () {
- window.removeEventListener('scroll', this.onScroll)
- }
- },
- {
- key: 'render',
- value: function () {
- var t = this;
- if (!this.props.overviewMetrics && !this.props.engagementReport && !this.props.userReport.users.length) return C.a.createElement('div', {
- className: 'section-contained'
- }, C.a.createElement('div', {
- className: 'loading-container'
- }, C.a.createElement(Ji, null)));
- if (this.props.organization && this.props.organization.pollsOnly) return C.a.createElement(Cm, {
- isPolls: !1,
- organization: this.props.organization
- });
- var e = ct() ().subtract(1, 'month').format('MM/DD/YY'),
- n = ct() ().format('MM/DD/YY');
- return C.a.createElement('div', {
- className: 'section-contained audience-analytics'
- }, this.props.overviewMetrics ? C.a.createElement(Pj, {
- startDate: e,
- endDate: n,
- overviewMetrics: this.props.overviewMetrics,
- isAudienceEmailSubscriptionSupported: this.isSaasFeatureSupported('audienceEmailTransfer'),
- emitTrackingEvent: this.props.emitTrackingEvent
- }) : null, this.props.overviewMetrics ? C.a.createElement(Ij, {
- startDate: e,
- endDate: n,
- overviewMetrics: this.props.overviewMetrics
- }) : null, C.a.createElement(Yj, {
- engagementReport: this.props.engagementReport,
- fetchUserEngagementReport: this.props.fetchUserEngagementReport,
- emitTrackingEvent: this.props.emitTrackingEvent,
- ref: function (e) {
- t.ref = t.ref || {
- },
- t.ref.readersTimeline = e
- }
- }), C.a.createElement(wj, {
- userReport: this.props.userReport,
- fetchUserReport: this.props.fetchUserReport,
- shouldEmailCsv: this.props.overviewMetrics && this.props.overviewMetrics.userExportEmail,
- exportUserReportCsv: this.props.exportUserReportCsv,
- emitTrackingEvent: this.props.emitTrackingEvent,
- ref: function (e) {
- t.ref = t.ref || {
- },
- t.ref.community = e
- }
- }))
- }
- }
- ]) && $j(e.prototype, t),
- n && $j(e, n),
- o
- }();
- nT(s, 'propTypes', {
- overviewMetrics: F,
- engagementReport: rc.isRequired,
- userReport: b.a.shape({
- users: b.a.arrayOf(r).isRequired,
- cursor: b.a.object.isRequired,
- isFetching: b.a.bool
- }).isRequired,
- fetchOverviewMetrics: b.a.func.isRequired,
- fetchUserReport: b.a.func.isRequired,
- fetchUserEngagementReport: b.a.func.isRequired,
- saasFeatures: b.a.objectOf(b.a.objectOf(b.a.bool)).isRequired,
- exportUserReportCsv: b.a.func.isRequired,
- emitTrackingEvent: b.a.func.isRequired,
- history: b.a.object.isRequired,
- selection: ht.isRequired
- });
- var rT = Object(u.connect) (function (e) {
- var t = e.saasFeatures,
- n = e.selection;
- return Jj(Jj({
- }, e.audienceAnalytics), {
- }, {
- saasFeatures: t,
- organization: n.organization
- })
- }, {
- fetchOverviewMetrics: function (n) {
- return function (t, e) {
- cj(n, e(), function (e) {
- io.a.call('forums/admin/reports/userOverview', e).success(function (e) {
- t({
- type: M.onFetchOverviewMetrics,
- response: e.response
- })
- })
- })
- }
- },
- fetchUserReport: function (n) {
- return function (t, e) {
- t({
- type: M.fetchingUserReport
- }),
- cj(n, e(), function (e) {
- io.a.call('forums/admin/reports/userReport', e).success(function (e) {
- t({
- type: M.onFetchUserReport,
- response: e.response,
- cursor: e.cursor,
- fetchMore: !!n.cursor
- })
- })
- })
- }
- },
- fetchUserEngagementReport: function (n) {
- return function (t, e) {
- cj(n, e(), function (e) {
- io.a.call('forums/admin/reports/userEngagementReport', e).success(function (e) {
- t({
- type: M.onFetchEngagementReport,
- response: e.response,
- start: n.start,
- end: n.end
- })
- })
- })
- }
- },
- exportUserReportCsv: function () {
- return function (e, t) {
- cj({
- }, t(), function (e) {
- io.a.call('forums/admin/reports/userReportEmailExport', e)
- })
- }
- }
- }) (Fo() (s));
- function oT(t, e) {
- var n,
- a = Object.keys(t);
- return Object.getOwnPropertySymbols && (n = Object.getOwnPropertySymbols(t), e && (n = n.filter(function (e) {
- return Object.getOwnPropertyDescriptor(t, e).enumerable
- })), a.push.apply(a, n)),
- a
- }
- function iT(a) {
- for (var e = 1; e < arguments.length; e++) {
- var r = null != arguments[e] ? arguments[e] : {
- };
- e % 2 ? oT(Object(r), !0).forEach(function (e) {
- var t,
- n;
- n = r[t = e],
- t in (e = a) ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(a, Object.getOwnPropertyDescriptors(r)) : oT(Object(r)).forEach(function (e) {
- Object.defineProperty(a, e, Object.getOwnPropertyDescriptor(r, e))
- })
- }
- return a
- }
- function sT(e, t, n) {
- t.selection.forum && n(e = {
- data: iT({
- forum: t.selection.forum.shortname
- }, e)
- })
- }
- function lT(e) {
- var n = {
- };
- return e.standard_series.forEach(function (e) {
- var t = e[2];
- 'https' != t.substring(0, 5) && (n[t] || (n[t] = {
- date: '',
- reactions: [
- ],
- authenticated: [
- ],
- anonymous: [
- ],
- threadId: null
- }), (t = n[t]).date || (t.date = e[0].split('T') [0]), t.threadId || (t.threadId = e[1]), t.reactions.push(e[3]), t.authenticated.push(e[4]), t.anonymous.push(e[5]))
- }),
- n
- }
- var cT = 5,
- uT = {
- authenticated: '#8BCF93',
- anonymous: '#2E9FFF'
- },
- pT = [
- 'anon_series',
- 'logged_in_series'
- ],
- go = function (e, t, n, a, r) {
- t = e[t];
- if (!Array.isArray(t) || 2 !== t.length || 'string' != typeof t[0] || 'number' != typeof t[1]) return Error('The '.concat(a, ' `').concat(r, '` in `').concat(n, '` is expected to be of the form [\'YYYY-MM-DD\', count].'))
- },
- yl = b.a.shape({
- authenticated: b.a.arrayOf(go),
- anonymous: b.a.arrayOf(go)
- }),
- Wi = b.a.object,
- Ru = b.a.object;
- function dT(e) {
- return (dT = 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator ? function (e) {
- return typeof e
- }
- : function (e) {
- return e && 'function' == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? 'symbol' : typeof e
- }) (e)
- }
- function mT(e) {
- return function (e) {
- if (Array.isArray(e)) return fT(e)
- }(e) || function (e) {
- if ('undefined' != typeof Symbol && null != e[Symbol.iterator] || null != e['@@iterator']) return Array.from(e)
- }(e) || function (e, t) {
- if (e) {
- if ('string' == typeof e) return fT(e, t);
- var n = Object.prototype.toString.call(e).slice(8, - 1);
- return 'Map' === (n = 'Object' === n && e.constructor ? e.constructor.name : n) || 'Set' === n ? Array.from(e) : 'Arguments' === n || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n) ? fT(e, t) : void 0
- }
- }(e) || function () {
- throw new TypeError('Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.')
- }()
- }
- function fT(e, t) {
- for (var n = 0, a = Array(t = null == t || e.length < t ? e.length : t); n < t; n++) a[n] = e[n];
- return a
- }
- function hT(e, t) {
- for (var n = 0; n < t.length; n++) {
- var a = t[n];
- a.enumerable = a.enumerable || !1,
- a.configurable = !0,
- 'value' in a && (a.writable = !0),
- Object.defineProperty(e, a.key, a)
- }
- }
- function gT(e, t) {
- return (gT = Object.setPrototypeOf || function (e, t) {
- return e.__proto__ = t,
- e
- }) (e, t)
- }
- function yT(n) {
- var a = function () {
- if ('undefined' == typeof Reflect || !Reflect.construct) return !1;
- if (Reflect.construct.sham) return !1;
- if ('function' == typeof Proxy) return !0;
- try {
- return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [
- ], function () {
- })),
- !0
- } catch (e) {
- return !1
- }
- }();
- return function () {
- var e,
- t = vT(n);
- return e = a ? (e = vT(this).constructor, Reflect.construct(t, arguments, e)) : t.apply(this, arguments),
- t = this,
- !(e = e) || 'object' !== dT(e) && 'function' != typeof e ? bT(t) : e
- }
- }
- function bT(e) {
- if (void 0 === e) throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called');
- return e
- }
- function vT(e) {
- return (vT = Object.setPrototypeOf ? Object.getPrototypeOf : function (e) {
- return e.__proto__ || Object.getPrototypeOf(e)
- }) (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 ET = function (e) {
- return e.toLocaleString()
- },
- OT = {
- key: 'date_utc',
- name: 'Date (UTC)',
- formatter: function (e) {
- return ct.a.utc(e).format('MMM Do YYYY')
- }
- },
- F = function () {
- !function (e, t) {
- if ('function' != typeof t && null !== t) throw new TypeError('Super expression must either be null or a function');
- e.prototype = Object.create(t && t.prototype, {
- constructor: {
- value: e,
- writable: !0,
- configurable: !0
- }
- }),
- t && gT(e, t)
- }(r, A);
- var e,
- t,
- n,
- a = yT(r);
- function r() {
- var i;
- !function (e, t) {
- if (!(e instanceof t)) throw new TypeError('Cannot call a class as a function')
- }(this, r);
- for (var e = arguments.length, t = Array(e), n = 0; n < e; n++) t[n] = arguments[n];
- return _T(bT(i = a.call.apply(a, [
- this
- ].concat(t))), 'state', {
- group: 'day',
- startDate: ct() ().utc().subtract(1, 'month'),
- endDate: ct() ().utc()
- }),
- _T(bT(i), 'initGraph', function (e) {
- i.ref && (!i.ref.graph.parentElement.clientWidth && (e || 0) < cT ? setTimeout(i.initGraph.bind(bT(i), (e || 0) + 1), 0) : (e = {
- date: {
- padding: {
- left: - 0.5
- },
- label: {
- text: 'Sorted by Dates',
- position: 'inner-left'
- },
- type: 'timeseries',
- tick: {
- format: OT.formatter
- }
- },
- thread: {
- padding: {
- left: - 0.5,
- bottom: 100
- },
- label: {
- text: 'Up to Last 30 Threads (Hover for Titles)',
- position: 'inner-left'
- },
- tick: {
- centered: !0,
- fit: !1,
- rotate: - 45,
- values: [
- ],
- outer: !1
- },
- type: 'category'
- }
- }, i.chart = Ed.a.generate({
- bindto: i.ref.graph,
- data: 'thread' === i.state.group ? i.getThreadGraphData() : i.getDateGraphData(),
- color: {
- pattern: [
- uT.anonymous,
- uT.authenticated
- ]
- },
- transition: {
- duration: 0
- },
- legend: {
- position: 'inset'
- },
- padding: {
- bottom: 'thread' === i.state.group ? 75 : 0,
- right: 'thread' === i.state.group ? 0 : 20
- },
- axis: {
- y: {
- min: 0,
- padding: {
- bottom: 1.5,
- right: 5
- },
- tick: {
- format: ET
- },
- label: {
- text: 'Total Reactions Count',
- position: 'outer-bottom'
- }
- },
- x: 'thread' === i.state.group ? e.thread : e.date
- },
- point: {
- show: !1
- }
- })))
- }),
- _T(bT(i), 'trackHover', function () {
- i.isHoverTracked || (i.props.emitTrackingEvent({
- verb: 'hover',
- object_type: 'area',
- object_id: 'reactions_analytics',
- adjective: 'total_reactions_by_date_or_thread',
- area: 'total_reactions_section'
- }), i.isHoverTracked = !0)
- }),
- _T(bT(i), 'getDateGraphData', function () {
- return {
- x: 'dates',
- columns: [
- ['dates'].concat(mT(i.props.totalReactionsReportByDate.anon_series.map(function (e) {
- return e[0]
- })))
- ].concat(mT(pT.map(function (e) {
- return [e].concat(mT(i.props.totalReactionsReportByDate[e].map(function (e) {
- return e[1]
- })))
- }))),
- types: {
- anon_series: 'area',
- logged_in_series: 'area'
- },
- names: {
- logged_in_series: 'Authenticated',
- anon_series: 'Anonymous'
- },
- groups: [
- ['logged_in_series',
- 'anon_series']
- ],
- onmouseover: i.trackHover
- }
- }),
- _T(bT(i), 'formatThreadTitle', function (e) {
- var n = e.split('_');
- return n.map(function (e, t) {
- e && (n[t] = e[0].toUpperCase() + e.slice(1))
- }),
- n.join(' ')
- }),
- _T(bT(i), 'getThreadGraphData', function () {
- var n = i.props.totalReactionsReportByThread,
- a = Object.keys(n),
- r = [
- 'anonymous'
- ],
- o = [
- 'authenticated'
- ];
- return a.map(function (e, t) {
- r.push(n[e].anonymous),
- o.push(n[e].authenticated),
- a[t] = ''.concat(n[e].date, ': ').concat(i.formatThreadTitle(e))
- }),
- {
- x: 'threads',
- columns: [
- ['threads'].concat(mT(a)),
- r,
- o
- ],
- types: {
- anonymous: 'area',
- authenticated: 'area'
- },
- names: {
- authenticated: 'Authenticated',
- anonymous: 'Anonymous'
- },
- groups: [
- ['anonymous',
- 'authenticated']
- ],
- onmouseover: i.trackHover
- }
- }),
- _T(bT(i), 'fetchTotalReactionsReportByDate', function () {
- i.props.fetchTotalReactionsReportByDate({
- start: i.state.startDate.toISOString(),
- end: i.state.endDate.toISOString()
- })
- }),
- _T(bT(i), 'fetchTotalReactionsReportByThread', function () {
- i.props.fetchTotalReactionsReportByThread({
- start: i.state.startDate.toISOString(),
- end: i.state.endDate.toISOString()
- })
- }),
- _T(bT(i), 'onGroupChange', function (e) {
- i.props.emitTrackingEvent({
- verb: 'click',
- object_type: 'option',
- object_id: 'day' === e ? 'daily' : 'by thread',
- area: 'total_reactions_section'
- }),
- i.setState({
- group: e,
- startDate: 'day' === e ? ct() ().utc().subtract(1, 'month') : ct() ().utc().subtract(1, 'year').startOf('month')
- }, 'thread' === e ? i.fetchTotalReactionsReportByThread : i.fetchTotalReactionsReportByDate)
- }),
- _T(bT(i), 'onDateChange', function (e, t) {
- i.setState({
- startDate: e,
- endDate: t
- }, 'thread' === i.state.group ? i.fetchTotalReactionsReportByThread : i.fetchTotalReactionsReportByDate)
- }),
- i
- }
- return e = r,
- (t = [
- {
- key: 'componentDidMount',
- value: function () {
- this.fetchTotalReactionsReportByDate(),
- this.initGraph()
- }
- },
- {
- key: 'componentDidUpdate',
- value: function () {
- this.initGraph()
- }
- },
- {
- key: 'componentWillUnmount',
- value: function () {
- this.chart && (this.chart = this.chart.destroy())
- }
- },
- {
- key: 'render',
- value: function () {
- var t = this;
- return Object.keys(this.props.totalReactionsReportByDate).some(function (e) {
- return t.props.totalReactionsReportByDate[e].length
- }) ? C.a.createElement('div', null, C.a.createElement(Bp, {
- className: 'engaged-readers spacing-bottom',
- leftTitle: C.a.createElement('div', null, 'Total Reactions', C.a.createElement(Md, {
- content: 'Total reaction count sorted by date or by thread. Sorting by date is customizable via date range while sorting by thread displays the last 30 threads from your site.'
- })),
- rightTitle: C.a.createElement('div', {
- className: 'card__header-right'
- }, C.a.createElement(Zp, {
- sortByThread: !0,
- dateWrapperClass: 'card__header-datepicker',
- minDate: ct() ().utc().subtract(1, 'year'),
- maxDate: ct() ().utc(),
- startDate: this.state.startDate,
- endDate: this.state.endDate,
- group: this.state.group,
- onGroupChange: this.onGroupChange,
- onDateChange: this.onDateChange,
- hideInput: 'thread' === this.state.group
- }))
- }, C.a.createElement('div', {
- ref: function (e) {
- t.ref = t.ref || {
- },
- t.ref.graph = e
- }
- }))) : null
- }
- }
- ]) && hT(e.prototype, t),
- n && hT(e, n),
- r
- }();
- _T(F, 'propTypes', {
- totalReactionsReportByDate: yl.isRequired,
- totalReactionsReportByThread: Wi.isRequired,
- fetchTotalReactionsReportByDate: b.a.func.isRequired,
- fetchTotalReactionsReportByThread: b.a.func.isRequired,
- emitTrackingEvent: b.a.func.isRequired
- });
- var ST = F;
- function wT(e) {
- return (wT = 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator ? function (e) {
- return typeof e
- }
- : function (e) {
- return e && 'function' == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? 'symbol' : typeof e
- }) (e)
- }
- function PT(e) {
- return function (e) {
- if (Array.isArray(e)) return kT(e)
- }(e) || function (e) {
- if ('undefined' != typeof Symbol && null != e[Symbol.iterator] || null != e['@@iterator']) return Array.from(e)
- }(e) || function (e, t) {
- if (e) {
- if ('string' == typeof e) return kT(e, t);
- var n = Object.prototype.toString.call(e).slice(8, - 1);
- return 'Map' === (n = 'Object' === n && e.constructor ? e.constructor.name : n) || 'Set' === n ? Array.from(e) : 'Arguments' === n || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n) ? kT(e, t) : void 0
- }
- }(e) || function () {
- throw new TypeError('Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.')
- }()
- }
- function kT(e, t) {
- for (var n = 0, a = Array(t = null == t || e.length < t ? e.length : t); n < t; n++) a[n] = e[n];
- return a
- }
- function NT(e, t) {
- for (var n = 0; n < t.length; n++) {
- var a = t[n];
- a.enumerable = a.enumerable || !1,
- a.configurable = !0,
- 'value' in a && (a.writable = !0),
- Object.defineProperty(e, a.key, a)
- }
- }
- function CT(e, t) {
- return (CT = Object.setPrototypeOf || function (e, t) {
- return e.__proto__ = t,
- e
- }) (e, t)
- }
- function RT(n) {
- var a = function () {
- if ('undefined' == typeof Reflect || !Reflect.construct) return !1;
- if (Reflect.construct.sham) return !1;
- if ('function' == typeof Proxy) return !0;
- try {
- return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [
- ], function () {
- })),
- !0
- } catch (e) {
- return !1
- }
- }();
- return function () {
- var e,
- t = AT(n);
- return e = a ? (e = AT(this).constructor, Reflect.construct(t, arguments, e)) : t.apply(this, arguments),
- t = this,
- !(e = e) || 'object' !== wT(e) && 'function' != typeof e ? xT(t) : e
- }
- }
- function xT(e) {
- if (void 0 === e) throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called');
- return e
- }
- function AT(e) {
- return (AT = Object.setPrototypeOf ? Object.getPrototypeOf : function (e) {
- return e.__proto__ || Object.getPrototypeOf(e)
- }) (e)
- }
- function DT(e, t, n) {
- return t in e ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n,
- e
- }
- var jT = function (e) {
- return e.toLocaleString()
- },
- rc = function () {
- !function (e, t) {
- if ('function' != typeof t && null !== t) throw new TypeError('Super expression must either be null or a function');
- e.prototype = Object.create(t && t.prototype, {
- constructor: {
- value: e,
- writable: !0,
- configurable: !0
- }
- }),
- t && CT(e, t)
- }(o, A);
- var e,
- t,
- n,
- r = RT(o);
- function o() {
- var a;
- !function (e, t) {
- if (!(e instanceof t)) throw new TypeError('Cannot call a class as a function')
- }(this, o);
- for (var e = arguments.length, t = Array(e), n = 0; n < e; n++) t[n] = arguments[n];
- return DT(xT(a = r.call.apply(r, [
- this
- ].concat(t))), 'state', {
- thread: '',
- threadList: [
- ],
- startDate: ct() ().utc().subtract(3, 'month'),
- endDate: ct() ().utc()
- }),
- DT(xT(a), 'initGraph', function (e, t) {
- a.ref && a.props.threadSpecificReactionsReport !== {
- }
- && a.ref.graph && (!a.ref.graph.parentElement.clientWidth && (e || 0) < cT ? setTimeout(a.initGraph.bind(xT(a), (e || 0) + 1), 0) : a.chart = Ed.a.generate({
- bindto: a.ref.graph,
- data: a.getGraphData(a.state.thread),
- color: {
- pattern: [
- uT.anonymous,
- uT.authenticated
- ]
- },
- transition: {
- duration: 0
- },
- padding: {
- bottom: 2
- },
- axis: {
- y: {
- min: 0,
- padding: {
- bottom: 1.5
- },
- tick: {
- format: jT
- },
- label: {
- text: '# of Reactions',
- position: 'outer-bottom'
- }
- },
- x: {
- tick: {
- centered: !0,
- fit: !0
- },
- type: 'categories',
- categories: [
- 'Like',
- 'Dislike',
- 'Surprise',
- 'Cry',
- 'Angry',
- 'Sad'
- ]
- }
- },
- point: {
- show: !1
- }
- }))
- }),
- DT(xT(a), 'trackHover', function () {
- a.isHoverTracked || (a.props.emitTrackingEvent({
- verb: 'hover',
- object_type: 'area',
- object_id: 'reactions_analytics',
- adjective: 'thread_specific_reactions',
- area: 'thread_specific_reactions_section'
- }), a.isHoverTracked = !0)
- }),
- DT(xT(a), 'generateColumns', function (e) {
- if (!a.props.threadSpecificReactionsReport[e]) return [['reactions',
- 'No threads in given time period'],
- [
- 'anonymous',
- 0,
- 0,
- 0,
- 0,
- 0,
- 0
- ],
- [
- 'authenticated',
- 0,
- 0,
- 0,
- 0,
- 0,
- 0
- ]];
- var n = [
- 'reactions'
- ];
- return a.props.threadSpecificReactionsReport[e].reactions.forEach(function (e, t) {
- n.push('Reaction #'.concat(t + 1))
- }),
- [
- n,
- [
- 'anonymous'
- ].concat(PT(a.props.threadSpecificReactionsReport[e].anonymous)),
- [
- 'authenticated'
- ].concat(PT(a.props.threadSpecificReactionsReport[e].authenticated))
- ]
- }),
- DT(xT(a), 'getGraphData', function (e) {
- return {
- x: 'reactions',
- columns: a.generateColumns(e),
- type: 'bar',
- names: {
- anonymous: 'Anonymous',
- authenticated: 'Authenticated'
- },
- groups: [
- ['anonymous',
- 'authenticated']
- ],
- onmouseover: a.trackHover
- }
- }),
- DT(xT(a), 'fetchThreadSpecificReactionsReport', function () {
- a.props.fetchThreadSpecificReactionsReport({
- start: a.state.startDate.toISOString(),
- end: a.state.endDate.toISOString()
- })
- }),
- DT(xT(a), 'onThreadChange', function (e) {
- a.props.emitTrackingEvent({
- verb: 'click',
- object_type: 'option',
- object_id: e,
- area: 'thread_specific_reactions_section'
- }),
- a.setState({
- thread: e
- })
- }),
- DT(xT(a), 'onDateChange', function (e, t) {
- a.setState({
- startDate: e,
- endDate: t
- }, a.fetchThreadSpecificReactionsReport)
- }),
- a
- }
- return e = o,
- n = [
- {
- key: 'getDerivedStateFromProps',
- value: function (e, t) {
- return t.threadList !== e.threadList ? {
- threadList: e.threadList,
- thread: e.threadList[0]
- }
- : null
- }
- }
- ],
- (t = [
- {
- key: 'componentDidMount',
- value: function () {
- this.fetchThreadSpecificReactionsReport(),
- this.initGraph()
- }
- },
- {
- key: 'componentDidUpdate',
- value: function () {
- this.chart ? this.chart.load(this.getGraphData(this.state.thread)) : this.initGraph(this.state.thread)
- }
- },
- {
- key: 'componentWillUnmount',
- value: function () {
- this.chart && (this.chart = this.chart.destroy())
- }
- },
- {
- key: 'render',
- value: function () {
- var t = this,
- n = [
- ];
- return 1 <= Object.keys(this.props.threadSpecificReactionsReport).length ? this.props.threadSpecificReactionsReport[this.state.thread].reactions.forEach(function (e, t) {
- n.push(C.a.createElement('div', {
- className: 'reaction-image',
- key: 'Reaction #'.concat(t, ' div')
- }, C.a.createElement('img', {
- src: e,
- key: 'Reaction #'.concat(t, ' img'),
- alt: 'Reaction #'.concat(t),
- width: 100,
- height: 100
- }), C.a.createElement('h3', {
- key: 'Reaction #'.concat(t, ' header')
- }, 'Reaction #', t + 1)))
- }) : n.push(C.a.createElement('div', {
- key: 'No Reaction Display'
- }, 'No reactions data for the below date range.')),
- C.a.createElement('div', null, C.a.createElement(Bp, {
- className: 'reactions-display spacing-bottom',
- leftTitle: C.a.createElement('div', null, 'Thread Reactions Display', C.a.createElement(Md, {
- content: 'The reactions from the thread chosen below'
- }))
- }, C.a.createElement('div', {
- className: 'card__body'
- }, n)), C.a.createElement(Bp, {
- className: 'engaged-readers spacing-bottom',
- leftTitle: C.a.createElement('div', null, 'Thread-Specific Reactions', C.a.createElement(Md, {
- content: 'Reactions from a specific thread. The thread-selection menu displays up to 30 threads in the given time period.'
- })),
- rightTitle: C.a.createElement('div', {
- className: 'card__header-right'
- }, C.a.createElement(Zp, {
- threadSpecificReactionsList: this.props.threadList,
- threadSpecificReactionsReport: this.props.threadSpecificReactionsReport,
- dateWrapperClass: 'card__header-datepicker',
- minDate: ct() ().utc().subtract(1, 'year'),
- maxDate: ct() ().utc(),
- startDate: this.state.startDate,
- endDate: this.state.endDate,
- group: this.state.thread,
- onGroupChange: this.onThreadChange,
- onDateChange: this.onDateChange
- }))
- }, C.a.createElement('div', {
- ref: function (e) {
- t.ref = t.ref || {
- },
- t.ref.graph = e
- }
- })))
- }
- }
- ]) && NT(e.prototype, t),
- n && NT(e, n),
- o
- }();
- DT(rc, 'propTypes', {
- threadSpecificReactionsReport: Ru.isRequired,
- threadList: b.a.arrayOf(b.a.string),
- fetchThreadSpecificReactionsReport: b.a.func.isRequired,
- emitTrackingEvent: b.a.func.isRequired
- });
- var TT = rc;
- function IT(e) {
- return (IT = 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator ? function (e) {
- return typeof e
- }
- : function (e) {
- return e && 'function' == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? 'symbol' : typeof e
- }) (e)
- }
- function qT(t, e) {
- var n,
- a = Object.keys(t);
- return Object.getOwnPropertySymbols && (n = Object.getOwnPropertySymbols(t), e && (n = n.filter(function (e) {
- return Object.getOwnPropertyDescriptor(t, e).enumerable
- })), a.push.apply(a, n)),
- a
- }
- function FT(t) {
- for (var e = 1; e < arguments.length; e++) {
- var n = null != arguments[e] ? arguments[e] : {
- };
- e % 2 ? qT(Object(n), !0).forEach(function (e) {
- HT(t, e, n[e])
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(n)) : qT(Object(n)).forEach(function (e) {
- Object.defineProperty(t, e, Object.getOwnPropertyDescriptor(n, e))
- })
- }
- return t
- }
- function LT(e, t) {
- for (var n = 0; n < t.length; n++) {
- var a = t[n];
- a.enumerable = a.enumerable || !1,
- a.configurable = !0,
- 'value' in a && (a.writable = !0),
- Object.defineProperty(e, a.key, a)
- }
- }
- function UT(e, t) {
- return (UT = Object.setPrototypeOf || function (e, t) {
- return e.__proto__ = t,
- e
- }) (e, t)
- }
- function MT(n) {
- var a = function () {
- if ('undefined' == typeof Reflect || !Reflect.construct) return !1;
- if (Reflect.construct.sham) return !1;
- if ('function' == typeof Proxy) return !0;
- try {
- return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [
- ], function () {
- })),
- !0
- } catch (e) {
- return !1
- }
- }();
- return function () {
- var e,
- t = zT(n);
- return e = a ? (e = zT(this).constructor, Reflect.construct(t, arguments, e)) : t.apply(this, arguments),
- t = this,
- !(e = e) || 'object' !== IT(e) && 'function' != typeof e ? BT(t) : e
- }
- }
- function BT(e) {
- if (void 0 === e) throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called');
- return e
- }
- function zT(e) {
- return (zT = Object.setPrototypeOf ? Object.getPrototypeOf : function (e) {
- return e.__proto__ || Object.getPrototypeOf(e)
- }) (e)
- }
- function HT(e, t, n) {
- return t in e ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n,
- e
- }
- var GT = 200,
- r = function () {
- !function (e, t) {
- if ('function' != typeof t && null !== t) throw new TypeError('Super expression must either be null or a function');
- e.prototype = Object.create(t && t.prototype, {
- constructor: {
- value: e,
- writable: !0,
- configurable: !0
- }
- }),
- t && UT(e, t)
- }(o, A);
- var e,
- t,
- n,
- r = MT(o);
- function o() {
- var a;
- !function (e, t) {
- if (!(e instanceof t)) throw new TypeError('Cannot call a class as a function')
- }(this, o);
- for (var e = arguments.length, t = Array(e), n = 0; n < e; n++) t[n] = arguments[n];
- return HT(BT(a = r.call.apply(r, [
- this
- ].concat(t))), 'initViewEvents', function () {
- a.onScroll = je.a.debounce(a.onScroll, 100),
- window.addEventListener('scroll', a.onScroll);
- a.viewEvents = [
- {
- ref: 'reactionsAnalytics',
- onView: a.props.emitTrackingEvent.bind(BT(a), FT(FT({
- }, {
- verb: 'view',
- object_type: 'area'
- }), {
- }, {
- object_id: 'reactions_analytics',
- area: 'reactions_analytics'
- }))
- }
- ]
- }),
- HT(BT(a), 'onScroll', function () {
- a.viewEvents = a.viewEvents.filter(function (e) {
- var t = window.innerHeight || window.document.documentElement.clientHeight,
- n = a.ref[e.ref] && l.a.findDOMNode(a.ref[e.ref]),
- n = n && n.getBoundingClientRect();
- return !n || t - n.top < GT || n.bottom < GT || (e.onView(), !1)
- }),
- a.viewEvents.length || window.removeEventListener('scroll', a.onScroll)
- }),
- a
- }
- return e = o,
- (t = [
- {
- key: 'componentDidMount',
- value: function () {
- this.props.emitTrackingEvent({
- verb: 'view',
- object_type: 'page',
- object_id: ''.concat(window.document.location.host).concat(window.document.location.pathname)
- }),
- this.initViewEvents()
- }
- },
- {
- key: 'componentWillUnmount',
- value: function () {
- window.removeEventListener('scroll', this.onScroll)
- }
- },
- {
- key: 'render',
- value: function () {
- var t = this;
- return this.props.totalReactionsReportByDate || this.props.threadSpecificReactionsReport ? this.props.organization && this.props.organization.pollsOnly ? C.a.createElement(Cm, {
- isPolls: !1,
- organization: this.props.organization
- }) : C.a.createElement('div', null, C.a.createElement('div', {
- className: 'section-contained audience-analytics'
- }, C.a.createElement(ST, {
- totalReactionsReportByDate: this.props.totalReactionsReportByDate,
- fetchTotalReactionsReportByDate: this.props.fetchTotalReactionsReportByDate,
- totalReactionsReportByThread: this.props.totalReactionsReportByThread,
- fetchTotalReactionsReportByThread: this.props.fetchTotalReactionsReportByThread,
- emitTrackingEvent: this.props.emitTrackingEvent,
- ref: function (e) {
- t.ref = t.ref || {
- },
- t.ref.totalReactionsSection = e
- }
- })), C.a.createElement('div', {
- className: 'section-contained audience-analytics'
- }, C.a.createElement(TT, {
- threadSpecificReactionsReport: this.props.threadSpecificReactionsReport,
- fetchThreadSpecificReactionsReport: this.props.fetchThreadSpecificReactionsReport,
- threadList: Object.keys(this.props.threadSpecificReactionsReport),
- emitTrackingEvent: this.props.emitTrackingEvent,
- ref: function (e) {
- t.ref = t.ref || {
- },
- t.ref.threadSpecificReactionsSection = e
- }
- }))) : C.a.createElement('div', {
- className: 'section-contained'
- }, C.a.createElement('div', {
- className: 'loading-container'
- }, C.a.createElement(Ji, null)))
- }
- }
- ]) && LT(e.prototype, t),
- n && LT(e, n),
- o
- }();
- HT(r, 'propTypes', {
- totalReactionsReportByDate: yl.isRequired,
- totalReactionsReportByThread: Wi.isRequired,
- fetchTotalReactionsReportByDate: b.a.func.isRequired,
- fetchThreadSpecificReactionsReport: b.a.func.isRequired,
- threadSpecificReactionsReport: Ru.isRequired,
- saasFeatures: b.a.objectOf(b.a.objectOf(b.a.bool)).isRequired,
- emitTrackingEvent: b.a.func.isRequired,
- history: b.a.object.isRequired,
- selection: ht.isRequired
- });
- var VT = Object(u.connect) (function (e) {
- var t = e.saasFeatures,
- n = e.selection;
- return FT(FT({
- }, e.reactionsAnalytics), {
- }, {
- saasFeatures: t,
- organization: n.organization
- })
- }, {
- fetchTotalReactionsReportByDate: function (n) {
- return function (t, e) {
- sT(n, e(), function (e) {
- io.a.call('forums/admin/reports/totalReactionsReport', e).success(function (e) {
- t({
- type: fe.onFetchTotalReactionsReportByDate,
- response: (je.a.mapObject(e = e.response, function (e) {
- e.map(function (n) {
- n.map(function (e, t) {
- 0 === t && (n[0] = e.split('T') [0])
- })
- })
- }), e)
- })
- })
- })
- }
- },
- fetchTotalReactionsReportByThread: function (n) {
- return function (t, e) {
- sT(n, e(), function (e) {
- io.a.call('forums/admin/reports/threadReactionsReport', e).success(function (e) {
- t({
- type: fe.onFetchTotalReactionsReportByThread,
- response: (e = iT({
- }, lT(e.response)), je.a.mapObject(e, function (e) {
- e.anonymous = e.anonymous.reduce(function (e, t) {
- return e + t
- }, 0),
- e.authenticated = e.authenticated.reduce(function (e, t) {
- return e + t
- }, 0),
- delete e.reactions
- }), e)
- })
- })
- })
- }
- },
- fetchThreadSpecificReactionsReport: function (n) {
- return function (t, e) {
- sT(n, e(), function (e) {
- io.a.call('forums/admin/reports/threadReactionsReport', e).success(function (e) {
- t({
- type: fe.onFetchThreadSpecificReactionsReport,
- response: lT(e.response)
- })
- })
- })
- }
- }
- }) (Fo() (r)),
- s = n(171),
- WT = n.n(s),
- go = n(516),
- YT = n.n(go),
- F = function (e) {
- e = e.onClose;
- return C.a.createElement(_.a, {
- isOpen: !0,
- onRequestClose: e,
- className: 'admin-modal -clipped -wider padding-double',
- overlayClassName: 'modal-overlay -dark'
- }, C.a.createElement('h3', {
- className: 'text-larger text-center spacing-bottom'
- }, 'Cancel Paid Subscription'), C.a.createElement('p', {
- className: 'spacing-bottom-double'
- }, 'If you’d like to cancel your paid subscription and downgrade to our free, Ad-Supported plan, please email us at ', C.a.createElement('a', {
- href: 'mailto:cancellation@disqus.com'
- }, 'cancellation@disqus.com'), '. By downgrading to our Ad-Supported plan, you’ll lose access to all of your advanced features.'), C.a.createElement('div', {
- className: 'align align--between align--center'
- }, C.a.createElement('button', {
- className: 'button button-fill--brand text-small button-wide',
- onClick: e
- }, 'OK')))
- };
- F.propTypes = {
- onClose: b.a.func.isRequired
- };
- var QT = F,
- rc = function (e) {
- e = e.onClose;
- return C.a.createElement(_.a, {
- isOpen: !0,
- onRequestClose: e,
- className: 'admin-modal -clipped -wider padding-double',
- overlayClassName: 'modal-overlay -dark'
- }, C.a.createElement('h3', {
- className: 'text-larger text-center spacing-bottom'
- }, 'Thank You!'), C.a.createElement('p', {
- className: 'spacing-bottom-double subscription-modal__paragraph-middle text-center'
- }, 'Our sales team will get back to you soon about using Disqus for Business for your site.'), C.a.createElement('div', {
- className: 'align align--between align--center'
- }, C.a.createElement('button', {
- className: 'button button-fill--brand text-small button-padding-wide',
- onClick: e
- }, 'Return to Subscription & Billing')))
- };
- rc.propTypes = {
- onClose: b.a.func
- };
- var KT = rc;
- function JT(e) {
- return (JT = 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator ? function (e) {
- return typeof e
- }
- : function (e) {
- return e && 'function' == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? 'symbol' : typeof e
- }) (e)
- }
- function $T(e, t) {
- for (var n = 0; n < t.length; n++) {
- var a = t[n];
- a.enumerable = a.enumerable || !1,
- a.configurable = !0,
- 'value' in a && (a.writable = !0),
- Object.defineProperty(e, a.key, a)
- }
- }
- function ZT(e, t) {
- return (ZT = Object.setPrototypeOf || function (e, t) {
- return e.__proto__ = t,
- e
- }) (e, t)
- }
- function XT(n) {
- var a = function () {
- if ('undefined' == typeof Reflect || !Reflect.construct) return !1;
- if (Reflect.construct.sham) return !1;
- if ('function' == typeof Proxy) return !0;
- try {
- return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [
- ], function () {
- })),
- !0
- } catch (e) {
- return !1
- }
- }();
- return function () {
- var e,
- t = tI(n);
- return e = a ? (e = tI(this).constructor, Reflect.construct(t, arguments, e)) : t.apply(this, arguments),
- t = this,
- !(e = e) || 'object' !== JT(e) && 'function' != typeof e ? eI(t) : e
- }
- }
- function eI(e) {
- if (void 0 === e) throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called');
- return e
- }
- function tI(e) {
- return (tI = Object.setPrototypeOf ? Object.getPrototypeOf : function (e) {
- return e.__proto__ || Object.getPrototypeOf(e)
- }) (e)
- }
- function nI(e, t, n) {
- return t in e ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n,
- e
- }
- yl = function () {
- !function (e, t) {
- if ('function' != typeof t && null !== t) throw new TypeError('Super expression must either be null or a function');
- e.prototype = Object.create(t && t.prototype, {
- constructor: {
- value: e,
- writable: !0,
- configurable: !0
- }
- }),
- t && ZT(e, t)
- }(o, A);
- var e,
- t,
- n,
- r = XT(o);
- function o() {
- var t;
- !function (e, t) {
- if (!(e instanceof t)) throw new TypeError('Cannot call a class as a function')
- }(this, o);
- for (var e = arguments.length, n = Array(e), a = 0; a < e; a++) n[a] = arguments[a];
- return nI(eI(t = r.call.apply(r, [
- this
- ].concat(n))), 'state', {
- value: '',
- error: ''
- }),
- nI(eI(t), 'handleChange', function (e) {
- return t.setState({
- value: e.target.value
- })
- }),
- nI(eI(t), 'handleSubmit', function (e) {
- return e.preventDefault(),
- t.state.value ? void t.props.applyCoupon(t.state.value).then(t.props.onClose).catch(t.handleError) : t.setState({
- error: 'You must enter a valid coupon.'
- })
- }),
- nI(eI(t), 'handleError', function (e) {
- e = e && e.responseText && je.a.isString(e.responseText) && JSON.parse(e.responseText),
- e = je.a.isObject(e) && e.response;
- e ? e.indexOf('Invalid argument, \'coupon\'') ? e.indexOf('Flat rate "amount off" coupons are not currently supported') ? t.setState({
- error: e
- }) : t.setState({
- error: 'This coupon code is not valid.'
- }) : t.setState({
- error: 'This coupon code does not exist.'
- }) : t.setState({
- error: 'There was an unknown error.'
- })
- }),
- t
- }
- return e = o,
- (t = [
- {
- key: 'render',
- value: function () {
- return C.a.createElement(_.a, {
- className: 'admin-modal coupon-modal',
- overlayClassName: 'modal-overlay -dark',
- isOpen: !0,
- onRequestClose: this.props.onClose
- }, C.a.createElement('header', {
- role: 'banner',
- className: 'coupon-modal__header'
- }, C.a.createElement('div', {
- className: 'coupon-modal__header-icon'
- }, C.a.createElement('div', {
- className: 'coupon-modal__header-icon-container'
- }, C.a.createElement('div', {
- className: 'coupon-modal__header-icon-bevel'
- }), C.a.createElement('div', {
- className: 'coupon-modal__header-icon-border'
- }), C.a.createElement('div', {
- className: 'coupon-modal__header-icon-image'
- }))), C.a.createElement('h1', null, ' Disqus '), C.a.createElement('h2', null, ' Apply a coupon ')), C.a.createElement('form', {
- className: 'coupon-modal__form',
- onSubmit: this.handleSubmit
- }, C.a.createElement('div', {
- className: 'coupon-modal__input-container'
- }, C.a.createElement('input', {
- className: [
- 'input--textbox',
- this.state.error ? 'is-error' : ''
- ].join(' '),
- type: 'text',
- value: this.state.value,
- placeholder: 'Coupon code',
- onChange: this.handleChange
- })), this.state.error ? C.a.createElement('div', {
- className: 'text-error'
- }, this.state.error) : null, C.a.createElement('div', {
- className: 'coupon-modal__submit-container'
- }, C.a.createElement('button', {
- className: 'button button-fill--brand button-medium button-wide',
- type: 'submit'
- }, 'Apply coupon'))))
- }
- }
- ]) && $T(e.prototype, t),
- n && $T(e, n),
- o
- }();
- nI(yl, 'propTypes', {
- applyCoupon: b.a.func.isRequired,
- onClose: b.a.func.isRequired
- });
- var aI = yl,
- Wi = n(101),
- rI = n.n(Wi),
- Ru = n(102),
- oI = n.n(Ru);
- function iI() {
- return (iI = Object.assign || function (e) {
- for (var t = 1; t < arguments.length; t++) {
- var n,
- a = arguments[t];
- for (n in a) Object.prototype.hasOwnProperty.call(a, n) && (e[n] = a[n])
- }
- return e
- }).apply(this, arguments)
- }
- r = function (e) {
- var t,
- n,
- a = e.basicPackage,
- r = e.filterInvoices,
- o = e.isTrialActive,
- i = e.onRequestInfo,
- s = e.onStartTrial,
- l = e.onSubscribe,
- c = e.orgAvailableDiscount,
- u = e.orgBilling,
- p = e.orgCurrentPackage,
- d = e.orgCurrentPackageWillCancel,
- m = e.orgPackages,
- f = e.orgTrial,
- h = e.newSubscriptionFlow,
- g = e.pollsOrgCurrentPackage,
- y = e.pollsOrgAvailableDiscount,
- b = e.pollsOrgCurrentPackageWillCancel,
- v = e.pollsOrgTrial,
- _ = e.organization,
- E = e.pollsPlanStatus,
- O = e.orgAvailableTrials,
- S = g && je.a.find(g.plans, function (e) {
- return e.isSubscribed
- }),
- w = null;
- _.pollsOnly || (n = je.a.find(m, function (e) {
- return e.id === Ur.DISQUS_PLUS_PACKAGE_ID
- }), t = je.a.find(m, function (e) {
- return e.id === Ur.DISQUS_PRO_PACKAGE_ID
- }), e = je.a.find(p.plans, function (e) {
- return e.isSubscribed
- }), c = {
- orgAvailableDiscount: c,
- orgBilling: u,
- orgCurrentPackage: p,
- orgCurrentPackageWillCancel: d,
- orgTrial: f,
- onRequestInfo: i,
- onSubscribe: l,
- onStartTrial: s,
- basicPackage: a,
- subscribedPlan: !0,
- newSubscriptionFlow: h,
- organization: _
- }, r = u && u.invoiceHistory.some(function (e) {
- return 0 === parseFloat(e.total)
- }) && p.id === Ur.DISQUS_BASIC_PACKAGE_ID && !r(u.invoiceHistory).length && (!O || !O.some(function (e) {
- return 0 == e.indexOf('plus')
- }) || !O.some(function (e) {
- return 0 == e.indexOf('pro')
- })), P = null, O = h ? null : C.a.createElement('p', {
- className: 'text-gray text-medium spacing-bottom'
- }, 'Your site will revert back to the Ad-Supported plan at the end of the trial unless you subscribe before the trial ends.'), o(f) ? P = C.a.createElement('div', null, C.a.createElement('p', {
- className: 'spacing-top'
- }, 'You are currently on a Comments ', p.name, ' trial ending in ', ct() (f.endDate).diff(ct() (), 'days'), ' days.'), d ? C.a.createElement('p', {
- className: 'text-gray text-medium'
- }, 'Your site will revert back to the Ad-Supported plan at the end of the trial.') : u && u.paymentInfo ? C.a.createElement('p', {
- className: 'text-gray text-medium'
- }, 'Your subscription to Comments ', p.name, ' will begin at the end of the trial.') : O) : r ? P = C.a.createElement('p', {
- className: 'spacing-top'
- }, 'Your trial has ended and your site is now on the Ad-Supported plan. Please subscribe to one of the plans below if you would like to continue using those features.') : d && (P = C.a.createElement('p', {
- className: 'spacing-top'
- }, 'You have canceled your subscription to ', p.name, ' and your organization will revert back to Ad-Supported at the end of the billing period.')), w = _.pollsOnly ? null : p.id === Ur.DISQUS_PLUS_FREE_PACKAGE_ID && n ? (n = je.a.find(m, function (e) {
- return e.id === Ur.DISQUS_PLUS_FREE_PACKAGE_ID
- }), C.a.createElement('section', {
- className: 'align align--column'
- }, C.a.createElement(oI.a, iI({
- plan: je.a.find(n.plans, function (e) {
- return e.id === Ur.DISQUS_PLUS_FREE_PLAN_ID
- }),
- package: n,
- features: Object(Tl.getPackageFeatureList) (m, Ur.DISQUS_PLUS_PACKAGE_ID, {
- showCustom: !0
- }),
- learnMoreLink: C.a.createElement(rI.a, {
- package: n
- }),
- maxButtons: 0
- }, c)), P)) : C.a.createElement('section', {
- className: 'align align--column'
- }, C.a.createElement(oI.a, iI({
- plan: e,
- package: p,
- features: Object(Tl.getPackageFeatureList) (m, p.id, {
- showCustom: !0
- }),
- learnMoreLink: C.a.createElement(rI.a, p.id === Ur.DISQUS_PREFERRED_CUSTOMER_PACKAGE_ID && t ? {
- package: t
- }
- : {
- package: p
- }),
- isCurrentPlan: !0
- }, c)), P));
- var P = null;
- return _.pollsActivationDate && g && (s = {
- pollsOrgAvailableDiscount: y,
- orgBilling: u,
- pollsOrgCurrentPackage: g,
- pollsOrgCurrentPackageWillCancel: b,
- pollsOrgTrial: v,
- onRequestInfo: i,
- onSubscribe: l,
- onStartTrial: s,
- basicPackage: a,
- subscribedPlan: !0,
- newSubscriptionFlow: h,
- organization: _,
- pollsPlanStatus: E
- }, a = _.pollsActivationDate && !g, h = null, o(v) ? h = C.a.createElement('div', null, C.a.createElement('p', {
- className: 'spacing-top'
- }, 'You are currently on a Polls ', g.name, ' trial ending in ', ct() (v.endDate).diff(ct() (), 'days'), ' days.'), !b && u && u.paymentInfo ? C.a.createElement('p', {
- className: 'text-gray text-medium'
- }, 'Your subscription to Polls ', g.name, ' will continue at the end of the trial.') : C.a.createElement('p', {
- className: 'text-gray text-medium spacing-top'
- }, 'Your subscription to Polls ', g.name, ' will conclude at the end of your trial.')) : b ? h = C.a.createElement('p', {
- className: 'spacing-top'
- }, 'Your subscription will be cancelled at the end of the billing period.') : a && (h = C.a.createElement('p', {
- className: 'spacing-top'
- }, 'Your subscription has been cancelled. Please subscribe to one of the plans below if you would like to continue using Polls.')), P = C.a.createElement('section', {
- className: 'align align--column'
- }, C.a.createElement(oI.a, iI({
- plan: S,
- package: g,
- features: Object(Tl.getPollsPackageFeatureList) (g.id),
- isCurrentPlan: !0
- }, s)), h)),
- C.a.createElement('div', {
- className: 'fieldset'
- }, C.a.createElement('span', {
- className: 'fieldset__label text-gray spacing-right'
- }, 'Your'.concat(_.pollsOnly && E === Ur.SAAS_PRODUCT_PLAN_CANCELLED_STATUS ? ' previous' : '', ' plan')), C.a.createElement('div', {
- className: 'fieldset__block spacing-bottom-double subscription-package__current'
- }, w, P))
- };
- r.propTypes = {
- basicPackage: Ur.PACKAGE_SHAPE.isRequired,
- filterInvoices: b.a.func.isRequired,
- isTrialActive: b.a.func.isRequired,
- onRequestInfo: b.a.func.isRequired,
- onStartTrial: b.a.func.isRequired,
- onSubscribe: b.a.func.isRequired,
- orgAvailableDiscount: b.a.number,
- orgBilling: Ur.ORG_BILLING_SHAPE,
- orgCurrentPackage: Ur.PACKAGE_SHAPE.isRequired,
- orgCurrentPackageWillCancel: b.a.bool,
- orgPackages: b.a.arrayOf(Ur.PACKAGE_SHAPE).isRequired,
- orgTrial: Ur.TRIAL_SHAPE,
- newSubscriptionFlow: b.a.bool,
- pollsOrgCurrentPackage: Ur.PACKAGE_SHAPE,
- pollsOrgAvailableDiscount: b.a.number,
- pollsOrgCurrentPackageWillCancel: b.a.bool,
- pollsOrgTrial: Ur.TRIAL_SHAPE,
- organization: b.a.object,
- pollsPlanStatus: b.a.oneOf(Ur.SAAS_PRODUCT_PLANS),
- orgAvailableTrials: b.a.arrayOf(b.a.string)
- };
- var sI = Object(u.connect) (function (e) {
- var t = e.subscription;
- return {
- organization: e.selection.organization,
- orgAvailableDiscount: t.orgAvailableDiscount,
- pollsPlanStatus: t.pollsPlanStatus,
- orgAvailableTrials: t.orgAvailableTrials
- }
- }) (r),
- s = function (e) {
- var t = e.message,
- e = e.onClose;
- return C.a.createElement(_.a, {
- isOpen: !0,
- onRequestClose: e,
- className: 'admin-modal -clipped -wider padding-double',
- overlayClassName: 'modal-overlay -dark'
- }, C.a.createElement('h3', {
- className: 'text-large text-center spacing-bottom'
- }, C.a.createElement('span', {
- className: 'icon icon-warning icon__position spacing-right subscription-modal__warning'
- }), 'Payment Error'), C.a.createElement('p', {
- className: 'spacing-bottom-double subscription-modal__paragraph-middle text-center'
- }, t), C.a.createElement('div', {
- className: 'align align--between align--center'
- }, C.a.createElement('button', {
- className: 'button button-fill--brand text-small button-padding-wide',
- onClick: e
- }, 'Return to Subscription & Billing')))
- };
- s.propTypes = {
- message: b.a.string.isRequired,
- onClose: b.a.func.isRequired
- };
- var lI = s,
- go = n(517),
- cI = n.n(go);
- function uI(e) {
- return (uI = 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator ? function (e) {
- return typeof e
- }
- : function (e) {
- return e && 'function' == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? 'symbol' : typeof e
- }) (e)
- }
- function pI(t, e) {
- var n,
- a = Object.keys(t);
- return Object.getOwnPropertySymbols && (n = Object.getOwnPropertySymbols(t), e && (n = n.filter(function (e) {
- return Object.getOwnPropertyDescriptor(t, e).enumerable
- })), a.push.apply(a, n)),
- a
- }
- function dI(t) {
- for (var e = 1; e < arguments.length; e++) {
- var n = null != arguments[e] ? arguments[e] : {
- };
- e % 2 ? pI(Object(n), !0).forEach(function (e) {
- bI(t, e, n[e])
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(n)) : pI(Object(n)).forEach(function (e) {
- Object.defineProperty(t, e, Object.getOwnPropertyDescriptor(n, e))
- })
- }
- return t
- }
- function mI(e, t) {
- for (var n = 0; n < t.length; n++) {
- var a = t[n];
- a.enumerable = a.enumerable || !1,
- a.configurable = !0,
- 'value' in a && (a.writable = !0),
- Object.defineProperty(e, a.key, a)
- }
- }
- function fI(e, t) {
- return (fI = Object.setPrototypeOf || function (e, t) {
- return e.__proto__ = t,
- e
- }) (e, t)
- }
- function hI(n) {
- var a = function () {
- if ('undefined' == typeof Reflect || !Reflect.construct) return !1;
- if (Reflect.construct.sham) return !1;
- if ('function' == typeof Proxy) return !0;
- try {
- return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [
- ], function () {
- })),
- !0
- } catch (e) {
- return !1
- }
- }();
- return function () {
- var e,
- t = yI(n);
- return e = a ? (e = yI(this).constructor, Reflect.construct(t, arguments, e)) : t.apply(this, arguments),
- t = this,
- !(e = e) || 'object' !== uI(e) && 'function' != typeof e ? gI(t) : e
- }
- }
- function gI(e) {
- if (void 0 === e) throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called');
- return e
- }
- function yI(e) {
- return (yI = Object.setPrototypeOf ? Object.getPrototypeOf : function (e) {
- return e.__proto__ || Object.getPrototypeOf(e)
- }) (e)
- }
- function bI(e, t, n) {
- return t in e ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n,
- e
- }
- F = function () {
- !function (e, t) {
- if ('function' != typeof t && null !== t) throw new TypeError('Super expression must either be null or a function');
- e.prototype = Object.create(t && t.prototype, {
- constructor: {
- value: e,
- writable: !0,
- configurable: !0
- }
- }),
- t && fI(e, t)
- }(o, A);
- var e,
- t,
- n,
- r = hI(o);
- function o() {
- var a;
- !function (e, t) {
- if (!(e instanceof t)) throw new TypeError('Cannot call a class as a function')
- }(this, o);
- for (var e = arguments.length, t = Array(e), n = 0; n < e; n++) t[n] = arguments[n];
- return bI(gI(a = r.call.apply(r, [
- this
- ].concat(t))), 'state', dI({
- isDirty: !1,
- isSaved: !1,
- saveErr: null
- }, Ur.INVOICE_FIELDS.reduce(function (e, t) {
- return dI(dI({
- }, e), {
- }, bI({
- }, t, (a.props.syncedInvoiceFields || {
- }) [t] || ''))
- }, {
- }))),
- bI(gI(a), 'onFieldChange', function (e, t) {
- var n = bI({
- isDirty: !0,
- isSaved: !1
- }, e, t.target.value);
- 'country' === e && (n.countryId = t.target.key),
- a.setState(n)
- }),
- bI(gI(a), 'getCountryOptions', function () {
- return cI.a.getAllCountries().map(function (e) {
- return {
- key: e.id,
- value: e.sortname,
- label: e.name
- }
- })
- }),
- bI(gI(a), 'getStateOptions', function () {
- var e = cI.a.getStatesOfCountry(a.state.countryId);
- return 1 < e.length ? e.map(function (e) {
- return {
- key: e.id,
- value: e.name,
- label: e.name
- }
- }) : [
- ]
- }),
- bI(gI(a), 'save', function () {
- a.props.onSave(Ur.INVOICE_FIELDS.reduce(function (e, t) {
- return dI(dI({
- }, e), {
- }, bI({
- }, t, a.state[t]))
- }, {
- }))
- }),
- a
- }
- return e = o,
- (t = [
- {
- key: 'componentWillReceiveProps',
- value: function (e) {
- var t,
- n = this;
- this.props.isInvoiceUpdating && !e.isInvoiceUpdating && (t = e.syncedInvoiceFields || {
- }, e = Ur.INVOICE_FIELDS.every(function (e) {
- return !n.state[e] && !t[e] || n.state[e] === t[e]
- }), this.setState({
- isDirty: !e,
- isSaved: e,
- saveErr: e ? null : 'We were unable to save your changes. Please try again later.'
- }))
- }
- },
- {
- key: 'render',
- value: function () {
- var e = this.getCountryOptions(),
- t = this.getStateOptions();
- return C.a.createElement(_.a, {
- className: 'admin-modal -clipped -wider invoice-modal',
- overlayClassName: 'modal-overlay -dark',
- isOpen: !0,
- onRequestClose: this.props.onClose
- }, C.a.createElement('div', {
- className: 'admin-modal__header'
- }, C.a.createElement('div', {
- className: 'align align--between'
- }, C.a.createElement('h3', {
- className: 'text-larger spacing-bottom-small'
- }, 'Customize Invoices'), C.a.createElement('button', {
- className: 'link-gray',
- onClick: this.props.onClose
- }, C.a.createElement('span', {
- className: 'icon-cancel icon__position'
- }))), C.a.createElement('div', {
- className: 'text-gray'
- }, 'Add information to the invoices you receive from Disqus. This information will be stored securely.')), C.a.createElement('div', {
- className: 'admin-modal__content spacing-bottom-narrow padding-default'
- }, C.a.createElement('div', {
- className: 'spacing-bottom'
- }, C.a.createElement('label', {
- className: 'text-semibold text-gray text-base'
- }, 'Company Name', C.a.createElement('input', {
- className: 'input--textbox',
- type: 'text',
- placeholder: 'Acme Inc.',
- onChange: this.onFieldChange.bind(this, 'companyName'),
- value: this.state.companyName
- }))), C.a.createElement('div', {
- className: 'spacing-bottom'
- }, C.a.createElement('label', {
- className: 'text-semibold text-gray text-base'
- }, 'Tax ID', C.a.createElement('input', {
- className: 'input--textbox',
- type: 'text',
- placeholder: '123-45-6789',
- onChange: this.onFieldChange.bind(this, 'taxId'),
- value: this.state.taxId
- }))), C.a.createElement('div', {
- className: 'text-base text-semibold text-gray spacing-top spacing-bottom-small'
- }, 'Address'), C.a.createElement('div', {
- className: 'align align--between spacing-top-small spacing-bottom-small'
- }, C.a.createElement('label', {
- className: 'text-semibold text-gray fieldset-item__input align align--column spacing-right'
- }, 'Country', C.a.createElement(Mf, {
- name: 'country',
- placeholder: 'Select a Country',
- options: e,
- value: this.state.country,
- onChange: this.onFieldChange.bind(this, 'country'),
- searchable: !0,
- inline: !0,
- width: 290
- })), C.a.createElement('label', {
- className: 'text-semibold text-gray fieldset-item__input align align--column spacing-right'.concat(this.state.country && !t.length ? ' hidden' : '')
- }, 'State/Province', C.a.createElement(Mf, {
- name: 'state',
- placeholder: 'Select a State',
- options: t,
- value: this.state.state,
- onChange: this.onFieldChange.bind(this, 'state'),
- searchable: !0,
- inline: !0,
- width: 240
- }))), C.a.createElement('div', {
- className: 'align align--between spacing-top spacing-bottom-small'
- }, C.a.createElement('label', {
- className: 'text-semibold text-gray align align--column fieldset-item__input spacing-right'
- }, 'Street Address', C.a.createElement('input', {
- className: 'input--textbox',
- type: 'text',
- placeholder: '1234 N. Broadway St.',
- onChange: this.onFieldChange.bind(this, 'street'),
- value: this.state.street
- })), C.a.createElement('label', {
- className: 'text-semibold text-gray align align--column'
- }, 'City', C.a.createElement('input', {
- className: 'input--textbox',
- type: 'text',
- placeholder: 'New York',
- onChange: this.onFieldChange.bind(this, 'city'),
- value: this.state.city
- }))), C.a.createElement('div', {
- className: 'align align--between spacing-top spacing-bottom-small'
- }, C.a.createElement('label', {
- className: 'text-semibold text-gray align align--column fieldset-item__input'
- }, 'Zip/Postal Code', C.a.createElement('input', {
- className: 'input--textbox',
- type: 'text',
- placeholder: '98765',
- onChange: this.onFieldChange.bind(this, 'zipCode'),
- value: this.state.zipCode,
- style: {
- width: '120px'
- }
- })))), C.a.createElement('div', {
- className: 'admin-modal__footer'
- }, C.a.createElement(Bh, {
- disabled: !this.state.isDirty,
- onClick: this.save,
- isSaving: this.props.isInvoiceUpdating,
- isSaved: this.state.isSaved,
- saveErr: !!this.state.saveErr
- }, this.state.saveErr ? C.a.createElement('div', {
- className: 'spacing-top-narrow'
- }, this.state.saveErr) : null, this.state.isSaved ? C.a.createElement('div', {
- className: 'spacing-top-narrow save-message'
- }, 'Your information was updated') : null)))
- }
- }
- ]) && mI(e.prototype, t),
- n && mI(e, n),
- o
- }();
- bI(F, 'propTypes', {
- onClose: b.a.func.isRequired,
- onSave: b.a.func.isRequired,
- isInvoiceUpdating: b.a.bool,
- syncedInvoiceFields: b.a.shape(Ur.INVOICE_SHAPE)
- });
- var vI = F,
- rc = function (e) {
- return C.a.createElement(_.a, {
- className: 'admin-modal subscription-updating-modal -clipped padding-double padding-bottom-none',
- overlayClassName: 'modal-overlay -dark',
- isOpen: e.isOpen
- }, C.a.createElement('h3', {
- className: 'text-larger text-center spacing-bottom'
- }, 'Launching Your Subscription!'), C.a.createElement('div', {
- className: 'align'
- }, C.a.createElement('div', {
- className: 'align__item--flex-1'
- }, C.a.createElement('img', {
- src: '//c.disquscdn.com/next/current/publisher-admin/assets/img/rocket.svg',
- className: 'img-responsive'
- }))))
- };
- rc.propTypes = {
- isOpen: b.a.bool
- };
- var _I = rc,
- yl = function (e) {
- var o = e.formatPaymentDate,
- t = e.orgBilling,
- r = e.orgCurrentPackage,
- n = e.orgCurrentPackageWillCancel,
- a = e.currentSubscription,
- i = e.onUpdatePaymentInfo,
- s = e.onSubscribe,
- l = e.showInvoiceCustomizationModal,
- c = e.orgAvailableDiscount,
- u = e.currentPollsSubscription,
- p = e.pollsOrgCurrentPackageWillCancel,
- d = e.pollsOrgCurrentPackage,
- m = e.pollsOrgAvailableDiscount,
- f = e.organization,
- h = e.pollsPlanStatus,
- g = null;
- a && (a.status === Ur.SAAS_PRODUCT_PLAN_TRIALING_STATUS ? g = a.trialEnd : a.status !== Ur.SAAS_PRODUCT_PLAN_ACTIVE_STATUS && a.status !== Ur.SAAS_PRODUCT_PLAN_PAST_DUE_STATUS || (g = a.currentPeriodEnd));
- var y = null;
- u && (u.status === Ur.SAAS_PRODUCT_PLAN_TRIALING_STATUS ? y = u.trialEnd : u.status !== Ur.SAAS_PRODUCT_PLAN_ACTIVE_STATUS && u.status !== Ur.SAAS_PRODUCT_PLAN_PAST_DUE_STATUS || (y = u.currentPeriodEnd));
- var b,
- v,
- _,
- E,
- O = t.invoiceHistory.filter(function (e) {
- return parseInt(e.total, 10)
- }),
- S = null !== g && !n && a.amount,
- w = null !== y && !p && u.amount,
- P = r && je.a.find(r.plans, function (e) {
- return e.isSubscribed
- }),
- k = d && je.a.find(d.plans, function (e) {
- return e.isSubscribed
- }),
- N = t.paymentInfo && '' + t.paymentInfo.expMonth,
- e = t.paymentInfo && '' + t.paymentInfo.expYear,
- p = function (e) {
- e.preventDefault();
- var t = !f.pollsOnly && P && P.interval || k && k.interval || 'month',
- n = 'year' === t ? P.id.replace('yearly', 'monthly') : P.id.replace('monthly', 'yearly'),
- e = n !== P.id && je.a.find(r.plans, function (e) {
- return e.id === n && e.amount
- }),
- a = k && ('year' === t ? k.id.replace('yearly', 'monthly') : k.id.replace('monthly', 'yearly')),
- t = d && a !== k.id && je.a.find(d.plans, function (e) {
- return e.id === a && e.amount
- });
- e && t ? s(e, r, t, d) : t ? s(t, d) : s(e, r)
- },
- e = C.a.createElement('div', {
- className: 'subscription__billing-info'
- }, t.paymentInfo ? C.a.createElement('div', {
- className: 'subscription__card'
- }, C.a.createElement('section', null, C.a.createElement('p', {
- className: 'card-info text-bold'
- }, C.a.createElement('span', null, '************', t.paymentInfo.last4)), C.a.createElement('p', {
- className: 'card-info'
- }, C.a.createElement('span', {
- className: 'card-info card-info__brand'
- }, t.paymentInfo.brand), C.a.createElement('span', null, 1 === N.length ? '0' : '', N, '/', e.substr(e.length - 2, e.length))))) : C.a.createElement('div', {
- className: 'subscription__card --no-card-info'
- }, C.a.createElement('section', null, C.a.createElement('p', {
- className: 'card-info'
- }, 'No credit card found'))), C.a.createElement('a', {
- className: 'update-card',
- href: '#',
- onClick: function (e) {
- e.preventDefault(),
- i()
- }
- }, 'Update payment info', t.paymentInfo ? '' : ' to continue your subscription'));
- O.length && !O[0].paid && (b = _ = 'We attempted to charge your credit card on '.concat(o(O[0].date), ' but it was declined.'), a && a.status === Ur.SAAS_PRODUCT_PLAN_PAST_DUE_STATUS ? b += ' Please update your payment method to prevent being reverted to an Ad-Supported plan.' : r.id === Ur.DISQUS_BASIC_PACKAGE_ID && (b += ' You have been reverted to an Ad-Supported plan. Please re-subscribe to a plan with an updated payment method.'), u && u.status === Ur.SAAS_PRODUCT_PLAN_PAST_DUE_STATUS ? _ += ' Please update your payment method to prevent your subscription being cancelled.' : d && d.id || (_ += ' Your subscription to Polls has been cancelled for non-payment. To continue using Polls, please re-subscribe to a plan with an updated payment method.'));
- g = S ? 'Your next charge is on '.concat(o(g)) : 'You have no upcoming payments due.',
- y = w ? 'Your next charge is on '.concat(o(y)) : 'You have no upcoming payments due.';
- f.pollsOnly || (v = r.id === Ur.DISQUS_BUSINESS_PACKAGE_ID ? C.a.createElement('span', {
- className: 'text-bold'
- }, 'Custom Pricing') : P.amount ? c ? C.a.createElement(C.a.Fragment, null, C.a.createElement('span', {
- className: 'text-strikethrough text-bold spacing-right-small'
- }, '$', Object(Tl.formatPlanAmount) (P.amount)), C.a.createElement('span', {
- className: 'text-bold'
- }, '$', Object(Tl.formatPlanAmount) (c))) : C.a.createElement('span', {
- className: 'text-bold'
- }, '$', Object(Tl.formatPlanAmount) (P.amount)) : C.a.createElement('span', {
- className: 'text-bold'
- }, 'Free')),
- f.pollsActivationDate && d && (E = d.id === Ur.DISQUS_POLLS_BUSINESS_PACKAGE_ID ? C.a.createElement('span', {
- className: 'text-bold'
- }, 'Custom Pricing') : k.amount ? m ? C.a.createElement(C.a.Fragment, null, C.a.createElement('span', {
- className: 'text-strikethrough text-bold spacing-right-small'
- }, '$', Object(Tl.formatPlanAmount) (k.amount)), C.a.createElement('span', {
- className: 'text-bold'
- }, '$', Object(Tl.formatPlanAmount) (m))) : C.a.createElement('span', {
- className: 'text-bold'
- }, '$', Object(Tl.formatPlanAmount) (k.amount)) : C.a.createElement('span', {
- className: 'text-bold'
- }, 'Free'));
- p = C.a.createElement('div', {
- className: 'subscription__billing-info next-payment'
- }, !f.pollsOnly && C.a.createElement(C.a.Fragment, null, C.a.createElement('div', {
- className: 'align align--between'
- }, C.a.createElement('p', {
- className: 'text-bold'
- }, 'Comments'), C.a.createElement('p', null, v, S && C.a.createElement('span', {
- className: 'text-small'
- }, ' Billed ', 'year' === P.interval ? 'Yearly' : 'Monthly'))), C.a.createElement('div', {
- className: 'text-small spacing-top'
- }, b || g), C.a.createElement('div', {
- className: 'next-payment--divider'
- })), h === Ur.SAAS_PRODUCT_PLAN_CANCELLED_STATUS ? null : f.pollsActivationDate && d && C.a.createElement(C.a.Fragment, null, C.a.createElement('div', {
- className: 'align align--between'
- }, C.a.createElement('p', {
- className: 'text-bold'
- }, 'Polls'), C.a.createElement('p', null, E, w && C.a.createElement('span', {
- className: 'text-small'
- }, ' Billed ', 'year' === k.interval ? 'Yearly' : 'Monthly'))), C.a.createElement('div', {
- className: 'text-small spacing-top'
- }, _ || y), C.a.createElement('div', {
- className: 'next-payment--divider'
- })), C.a.createElement('a', {
- className: 'switch-interval',
- href: '#',
- onClick: p
- }, 'Switch to ', f.pollsOnly ? 'year' === k.interval ? 'Monthly' : 'Yearly' : 'year' === P.interval ? 'Monthly' : 'Yearly', ' billing')),
- n = C.a.createElement('p', {
- className: 'text-gray text-small spacing-top'
- }, t.paymentInfo ? null : C.a.createElement('span', null, 'We have no payment info on file.', n ? null : ' If you would like to continue your subscription, please enter payment info before your next charge.', ' ', 'Having no working payment method at the start of the billing cycle will result in your subscription being cancelled.'));
- return C.a.createElement('section', null, C.a.createElement('div', {
- className: 'fieldset spacing-bottom-double'
- }, C.a.createElement('span', {
- className: 'fieldset__label text-gray spacing-right padding-top-none '
- }, 'Billing'), C.a.createElement('div', {
- className: 'fieldset__block'
- }, C.a.createElement('div', {
- className: 'payment-info'
- }, e, p), n)), C.a.createElement('div', {
- className: 'fieldset subscription-payment'
- }, C.a.createElement('span', {
- className: 'fieldset__label text-gray spacing-right'
- }, 'Invoice History'), C.a.createElement('div', {
- className: 'fieldset__block spacing-top-narrow text-medium'
- }, C.a.createElement('div', {
- className: 'spacing-bottom'
- }, 'Invoices are delivered to your organization\'s admin\'s email address.', ' ', C.a.createElement('a', {
- href: '#',
- onClick: l
- }, 'Customize your invoices'), '.'), O.length ? C.a.createElement('ul', {
- className: 'subscription-payment-list'
- }, C.a.createElement('li', {
- className: 'subscription-payment-list__list-item'
- }, C.a.createElement('span', {
- className: 'subscription-payment-list__header'
- }, 'Invoice Date'), C.a.createElement('span', {
- className: 'subscription-payment-list__header'
- }, 'Total')), O.map(function (e, t) {
- var n = e.total,
- a = e.paid,
- r = e.invoicePdf;
- return C.a.createElement('li', {
- key: t,
- className: 'subscription-payment-list__list-item'
- }, C.a.createElement('span', {
- className: 'subscription-payment-list__payment-date'
- }, o(e.date)), C.a.createElement('span', {
- className: 'subscription-payment-list__payment-'.concat(a ? 'paid' : 'error')
- }, a ? '$'.concat(n) : 'Payment declined', ' ', r ? C.a.createElement('a', {
- href: r
- }, C.a.createElement('span', {
- className: 'icon-download'
- })) : null))
- })) : C.a.createElement('div', {
- className: 'spacing-bottom'
- }, 'Your organization has no payment history.'))))
- };
- yl.propTypes = {
- formatPaymentDate: b.a.func.isRequired,
- orgBilling: Ur.ORG_BILLING_SHAPE.isRequired,
- orgCurrentPackage: Ur.PACKAGE_SHAPE.isRequired,
- orgCurrentPackageWillCancel: b.a.bool,
- currentSubscription: Ur.CURRENT_SUBSCRIPTION_SHAPE,
- onUpdatePaymentInfo: b.a.func,
- onSubscribe: b.a.func.isRequired,
- showInvoiceCustomizationModal: b.a.func.isRequired,
- orgAvailableDiscount: b.a.number,
- currentPollsSubscription: Ur.CURRENT_SUBSCRIPTION_SHAPE,
- pollsOrgCurrentPackageWillCancel: b.a.bool,
- pollsOrgCurrentPackage: Ur.PACKAGE_SHAPE.isRequired,
- pollsOrgAvailableDiscount: b.a.number,
- organization: b.a.object.isRequired,
- pollsPlanStatus: b.a.oneOf([Ur.SAAS_PRODUCT_PLAN_CANCELLED_STATUS,
- Ur.SAAS_PRODUCT_PLAN_ACTIVE_STATUS,
- Ur.SAAS_PRODUCT_PLAN_TRIALING_STATUS])
- };
- var EI = Object(u.connect) (function (e) {
- var t = e.subscription;
- return {
- organization: e.selection.organization,
- orgAvailableDiscount: t.orgAvailableDiscount,
- pollsOrgAvailableDiscount: t.pollsOrgAvailableDiscount,
- pollsPlanStatus: t.pollsPlanStatus
- }
- }) (yl);
- function OI(e) {
- return (OI = 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator ? function (e) {
- return typeof e
- }
- : function (e) {
- return e && 'function' == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? 'symbol' : typeof e
- }) (e)
- }
- function SI(e, t) {
- for (var n = 0; n < t.length; n++) {
- var a = t[n];
- a.enumerable = a.enumerable || !1,
- a.configurable = !0,
- 'value' in a && (a.writable = !0),
- Object.defineProperty(e, a.key, a)
- }
- }
- function wI(e, t) {
- return (wI = Object.setPrototypeOf || function (e, t) {
- return e.__proto__ = t,
- e
- }) (e, t)
- }
- function PI(n) {
- var a = function () {
- if ('undefined' == typeof Reflect || !Reflect.construct) return !1;
- if (Reflect.construct.sham) return !1;
- if ('function' == typeof Proxy) return !0;
- try {
- return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [
- ], function () {
- })),
- !0
- } catch (e) {
- return !1
- }
- }();
- return function () {
- var e,
- t = NI(n);
- return e = a ? (e = NI(this).constructor, Reflect.construct(t, arguments, e)) : t.apply(this, arguments),
- t = this,
- !(e = e) || 'object' !== OI(e) && 'function' != typeof e ? kI(t) : e
- }
- }
- function kI(e) {
- if (void 0 === e) throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called');
- return e
- }
- function NI(e) {
- return (NI = Object.setPrototypeOf ? Object.getPrototypeOf : function (e) {
- return e.__proto__ || Object.getPrototypeOf(e)
- }) (e)
- }
- var CI = function () {
- !function (e, t) {
- if ('function' != typeof t && null !== t) throw new TypeError('Super expression must either be null or a function');
- e.prototype = Object.create(t && t.prototype, {
- constructor: {
- value: e,
- writable: !0,
- configurable: !0
- }
- }),
- t && wI(e, t)
- }(l, A);
- var e,
- t,
- n,
- s = PI(l);
- function l() {
- var e;
- !function (e, t) {
- if (!(e instanceof t)) throw new TypeError('Cannot call a class as a function')
- }(this, l);
- for (var t, n, a, r = arguments.length, o = Array(r), i = 0; i < r; i++) o[i] = arguments[i];
- return e = s.call.apply(s, [
- this
- ].concat(o)),
- t = kI(e),
- a = 'cancellation@disqus.com',
- (n = 'email') in t ? Object.defineProperty(t, n, {
- value: a,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : t[n] = a,
- e
- }
- return e = l,
- (t = [
- {
- key: 'render',
- value: function () {
- return C.a.createElement('header', {
- className: 'settings__header settings-inline-section align align--between align--middle'
- }, C.a.createElement('div', {
- className: 'align align--column spacing-right-large'
- }, C.a.createElement('h2', {
- className: 'text-gray-darker text-larger spacing-bottom-small'
- }, 'Cancel your subscription'), C.a.createElement('p', {
- className: 'text-gray spacing-bottom'
- }, 'You may change or cancel your Disqus subscription at any time by emailing ', C.a.createElement('a', {
- href: 'mailto:'.concat(this.email)
- }, this.email), '.')))
- }
- }
- ]) && SI(e.prototype, t),
- n && SI(e, n),
- l
- }(),
- RI = n(175),
- Wi = function (e) {
- var t = e.onSubscribe,
- n = e.onClose,
- a = e.curPackage,
- r = e.newPackage,
- o = e.newPlan,
- i = e.amountRemaining,
- s = e.secondCurPackage,
- l = e.secondNewPackage,
- c = e.secondNewPlan,
- u = e.secondAmountRemaining,
- p = e.coupon,
- d = e.orgAvailableDiscount,
- m = e.paymentInfoAvailable,
- f = e.organization,
- h = function (e) {
- return e.id === Ur.DISQUS_PLUS_FREE_PACKAGE_ID ? 'Plus Free' : e.name
- },
- g = a && h(a),
- y = h(r),
- b = g && g !== y,
- v = o.amount && p && Object(Tl.isNewPackageCouponEligible) (a, r) ? Object(Tl.getDiscountedAmount) (o.amount, p) : o.amount,
- e = c && (c.amount && p && Object(Tl.isNewPackageCouponEligible) (s, l) ? Object(Tl.getDiscountedAmount) (c.amount, p) : c.amount),
- h = a && a.productName === Ur.SAAS_PRODUCT_COMMENTS && f && f.pollsOnly,
- p = !a || h ? 'You are subscribing to '.concat(y, '.') : b ? 'You are unsubscribing from '.concat(g, ' and subscribing to ').concat(y, '.') : a && s ? 'You are updating your subscriptions.' : 'You are updating your subscription to '.concat(g, '.'),
- f = '';
- return o.amount && c && c.amount ? f = 'Your monthly subscription cost will now be $'.concat(Object(Tl.formatPlanAmount) ('year' === o.interval ? v / RI.MONTHS_PER_YEAR : v), ' for ').concat(o.productName, ' and $').concat(Object(Tl.formatPlanAmount) ('year' === c.interval ? e / RI.MONTHS_PER_YEAR : e), ' for ').concat(c.productName, '.') : o.amount && (f = 'Your monthly subscription cost will now be $'.concat(Object(Tl.formatPlanAmount) ('year' === o.interval ? v / RI.MONTHS_PER_YEAR : v), '.').concat(o.hasTrialAvailable ? ' You will not be charged until your trial ends.' : '')),
- (i || u) && (u = (Number.parseFloat(i || 0) + Number.parseFloat(u || 0)).toFixed(2), f += ' The remaining amount of $'.concat(u, ' from your current').concat(a && s ? '' : ' '.concat(a.name), ' plan will be added as credit ').concat(o.amount ? ' towards your new'.concat(r && l ? '' : ' '.concat(r.name), ' plan.') : ' to your account. You can use this credit towards future subscriptions.')),
- d && (f += ' Upon updating, any previously applied Coupons will be no longer be honored.'),
- C.a.createElement(_.a, {
- className: 'admin-modal -clipped -wider padding-double',
- overlayClassName: 'modal-overlay -dark',
- isOpen: !0,
- onRequestClose: n
- }, C.a.createElement('h3', {
- className: 'text-larger text-center spacing-bottom'
- }, m ? 'Billing Update' : 'Subscribe to '.concat(y)), C.a.createElement('div', {
- className: 'spacing-bottom text-large'
- }, C.a.createElement('p', {
- className: 'text-semibold spacing-bottom-narrow'
- }, p), C.a.createElement('div', null, f)), C.a.createElement('div', {
- className: 'align align--between'
- }, C.a.createElement('button', {
- className: 'button button-fill text-small button-wide',
- onClick: n
- }, b && !h ? 'Stay on '.concat(g) : 'Cancel'), C.a.createElement('button', {
- className: 'button button-fill--brand text-small button-wide spacing-left-large',
- onClick: function () {
- n(),
- t()
- }
- }, b ? 'Subscribe to '.concat(y) : 'Confirm')))
- };
- Wi.propTypes = {
- onSubscribe: b.a.func,
- onClose: b.a.func.isRequired,
- curPackage: Ur.PACKAGE_SHAPE.isRequired,
- newPackage: Ur.PACKAGE_SHAPE.isRequired,
- newPlan: Ur.PLAN_SHAPE.isRequired,
- amountRemaining: b.a.string,
- secondCurPackage: Ur.PACKAGE_SHAPE,
- secondNewPackage: Ur.PACKAGE_SHAPE,
- secondNewPlan: Ur.PLAN_SHAPE,
- secondAmountRemaining: b.a.string,
- coupon: Ur.COUPON_SHAPE,
- orgAvailableDiscount: b.a.number,
- paymentInfoAvailable: b.a.bool,
- organization: b.a.object
- };
- var xI = Wi;
- function AI(e) {
- return (AI = 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator ? function (e) {
- return typeof e
- }
- : function (e) {
- return e && 'function' == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? 'symbol' : typeof e
- }) (e)
- }
- function DI(e, t) {
- for (var n = 0; n < t.length; n++) {
- var a = t[n];
- a.enumerable = a.enumerable || !1,
- a.configurable = !0,
- 'value' in a && (a.writable = !0),
- Object.defineProperty(e, a.key, a)
- }
- }
- function jI(e, t) {
- return (jI = Object.setPrototypeOf || function (e, t) {
- return e.__proto__ = t,
- e
- }) (e, t)
- }
- function TI(n) {
- var a = function () {
- if ('undefined' == typeof Reflect || !Reflect.construct) return !1;
- if (Reflect.construct.sham) return !1;
- if ('function' == typeof Proxy) return !0;
- try {
- return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [
- ], function () {
- })),
- !0
- } catch (e) {
- return !1
- }
- }();
- return function () {
- var e,
- t = qI(n);
- return e = a ? (e = qI(this).constructor, Reflect.construct(t, arguments, e)) : t.apply(this, arguments),
- t = this,
- !(e = e) || 'object' !== AI(e) && 'function' != typeof e ? II(t) : e
- }
- }
- function II(e) {
- if (void 0 === e) throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called');
- return e
- }
- function qI(e) {
- return (qI = Object.setPrototypeOf ? Object.getPrototypeOf : function (e) {
- return e.__proto__ || Object.getPrototypeOf(e)
- }) (e)
- }
- function FI(e, t, n) {
- return t in e ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n,
- e
- }
- function LI(e) {
- return e && e.isActive
- }
- function UI(e) {
- return e.filter(function (e) {
- return 0 < parseFloat(e.total) && e.paid
- })
- }
- function MI(e) {
- return ct() (e).format('MM/DD/YY')
- }
- var BI = 0,
- zI = 1,
- HI = 2,
- GI = 4,
- VI = 5,
- WI = 6,
- YI = 7,
- QI = 8,
- Ru = {
- zone: 'install',
- section: 'plan'
- },
- KI = '/install/welcome',
- JI = '/polls/list/',
- r = function () {
- !function (e, t) {
- if ('function' != typeof t && null !== t) throw new TypeError('Super expression must either be null or a function');
- e.prototype = Object.create(t && t.prototype, {
- constructor: {
- value: e,
- writable: !0,
- configurable: !0
- }
- }),
- t && jI(e, t)
- }(o, A);
- var e,
- t,
- n,
- a = TI(o);
- function o(e) {
- var r;
- return function (e, t) {
- if (!(e instanceof t)) throw new TypeError('Cannot call a class as a function')
- }(this, o),
- FI(II(r = a.call(this, e)), 'handleCloseModal', function () {
- r.setState({
- modal: {
- type: BI,
- data: null
- }
- })
- }),
- FI(II(r), 'trackButtonClick', function (e) {
- return r.props.emitTrackingEvent({
- verb: 'click',
- object_type: 'button',
- object_id: e && e.id !== Ur.DISQUS_BASIC_PLAN_ID ? e.id : 'basic'
- })
- }),
- FI(II(r), 'trackModalView', function () {
- r.props.orgCurrentPackage && r.props.emitTrackingEvent({
- verb: 'view',
- section: 'plan_selected_modal',
- extra_data: JSON.stringify({
- package: r.props.orgCurrentPackage.id
- })
- })
- }),
- FI(II(r), 'handleConfirmSubscribe', function (e, t) {
- var n = je.a.find(r.props.orgPackages, function (e) {
- return e.id === Ur.DISQUS_BASIC_PACKAGE_ID
- });
- n.isSubscribed || t !== n ? (e.productName === Ur.SAAS_PRODUCT_POLLS ? !e.isSubscribed && !r.props.pollsOrgCurrentPackageWillCancel : r.props.selection.organization.pollsOnly ? t.id !== Ur.DISQUS_BASIC_PACKAGE_ID : !e.isSubscribed && !n.isSubscribed && !r.props.orgCurrentPackageWillCancel) ? r.setState({
- modal: {
- type: GI,
- data: {
- plan: e,
- package: t
- }
- }
- }) : r.handleSubscribe(e) : r.setState({
- modal: {
- type: YI
- }
- })
- }),
- FI(II(r), 'handleConfirmToggleInterval', function (e, t, n, a) {
- e.isSubscribed || r.props.orgCurrentPackageWillCancel ? r.handleSubscribe(e, n) : r.setState({
- modal: {
- type: GI,
- data: {
- plan: e,
- package: t,
- secondPlan: n,
- secondPackage: a
- }
- }
- })
- }),
- FI(II(r), 'handleSubscribe', function (e, t) {
- var n = r.getReturnUrl(e);
- return r.trackButtonClick(e),
- r.props.onSubscribe(e, r.props.history, n, t)
- }),
- FI(II(r), 'handleRequestInfo', function (e) {
- var t = je.a.find(je.a.flatten(r.props.orgPackages.map(function (e) {
- return e.plans
- }), !0), function (e) {
- return e.id === Il.a.getCurrentPlusPlanId()
- });
- vo.a.when(t && r.props.orgCurrentPackage.id === Ur.DISQUS_BASIC_PACKAGE_ID && t.hasTrialAvailable && r.props.onSubscribe(t, r.state.coupon), r.trackButtonClick(e)).then(function () {
- r.setState({
- modal: {
- type: HI,
- data: null
- }
- })
- })
- }),
- FI(II(r), 'getReturnUrl', function (e) {
- var t = r.props.selection.organization;
- return e.productName === Ur.SAAS_PRODUCT_COMMENTS && t && t.pollsOnly ? ''.concat(window.location.origin, '/admin').concat(KI) : e.productName !== Ur.SAAS_PRODUCT_POLLS || r.props.pollsOrgCurrentPackage || !t || t.pollsActivationDate ? window.location.href : ''.concat(window.location.origin, '/admin').concat(JI, '?').concat(Ur.CHECKOUT_SUCCESS_QUERY_PARAM, '=').concat(Ur.CHECKOUT_SUCCESS_QUERY_PARAM_VALUE_POLLS)
- }),
- FI(II(r), 'showInvoiceCustomizationModal', function (e) {
- e.preventDefault(),
- r.setState({
- modal: {
- type: VI,
- data: null
- }
- })
- }),
- FI(II(r), 'openCouponModal', function (e) {
- e.preventDefault(),
- r.setState({
- modal: {
- type: WI,
- data: null
- }
- })
- }),
- FI(II(r), 'applyCoupon', function (e) {
- return Promise.resolve(io.a.call('organizations/saas/validateCoupon', {
- data: {
- organization: r.props.selection.organization && r.props.selection.organization.id,
- coupon: e
- }
- }).then(function (e) {
- return r.setState({
- coupon: e.response
- })
- }))
- }),
- FI(II(r), 'removeCoupon', function () {
- return r.setState({
- coupon: null
- })
- }),
- r.state = {
- modal: r.props.location.query[Ur.CHECKOUT_SUCCESS_QUERY_PARAM] === Ur.CHECKOUT_SUCCESS_QUERY_PARAM_VALUE_COMMENTS ? {
- type: zI,
- data: null
- }
- : r.props.location.query[Ur.CHECKOUT_SUCCESS_QUERY_PARAM] === Ur.CHECKOUT_SUCCESS_QUERY_PARAM_VALUE_POLLS ? {
- type: QI,
- data: null
- }
- : {
- type: BI,
- data: null
- },
- coupon: null
- },
- r
- }
- return e = o,
- (t = [
- {
- key: 'componentDidMount',
- value: function () {
- ql(this.props.selection) || this.props.history.push(ho.getRoute('/settings/general/')),
- this.props.fetchSubscription()
- }
- },
- {
- key: 'componentWillReceiveProps',
- value: function (e) {
- var t = this;
- this.props.orgCurrentPackage && e.orgCurrentPackage && this.props.orgCurrentPackage.id !== e.orgCurrentPackage.id && e.orgCurrentPackage.id !== Ur.DISQUS_BASIC_PACKAGE_ID && 3 !== this.state.modal.type ? this.setState({
- modal: {
- type: zI,
- data: this.props.selection.organization && this.props.selection.organization.pollsOnly ? {
- redirectTo: '/install/'
- }
- : null
- }
- }, function () {
- return t.trackModalView()
- }) : !this.props.pollsOrgCurrentPackage && e.pollsOrgCurrentPackage && this.props.selection.organization && !this.props.selection.organization.pollsActivationDate && 3 !== this.state.modal.type ? this.setState({
- modal: {
- type: QI,
- data: {
- redirectTo: JI
- }
- }
- }, function () {
- return t.trackModalView()
- }) : e.pollsOrgCurrentPackage && this.props.pollsOrgCurrentPackage && (this.props.pollsOrgCurrentPackage.id !== e.pollsOrgCurrentPackage.id || this.props.pollsPlanStatus === Ur.SAAS_PRODUCT_PLAN_CANCELLED_STATUS && e.pollsPlanStatus !== Ur.SAAS_PRODUCT_PLAN_CANCELLED_STATUS) && 3 !== this.state.modal.type && this.setState({
- modal: {
- type: QI,
- data: null
- }
- }, function () {
- return t.trackModalView()
- })
- }
- },
- {
- key: 'render',
- value: function () {
- var e = this;
- if (!ql(this.props.selection)) return null;
- if (this.props.orgSubscriptionIsFetching || !this.props.orgPackages) return C.a.createElement(Qi, null);
- var t,
- n,
- t = (t = (o = this.props).orgBilling, n = o.orgCurrentPackage, r = o.pollsOrgCurrentPackage, (!LI(o.orgTrial) || t.paymentInfo) && n && n.id !== Ur.DISQUS_BASIC_PACKAGE_ID && n.id !== Ur.DISQUS_BUSINESS_PACKAGE_ID && !o.orgCurrentPackageWillCancel || (!LI(o.pollsOrgTrial) || t.paymentInfo) && r && r.id !== Ur.DISQUS_POLLS_AD_SUPPORTED_PACKAGE_ID && r.id !== Ur.DISQUS_POLLS_BUSINESS_PACKAGE_ID && !o.pollsOrgCurrentPackageWillCancel),
- a = Il.a.isNewFlow('cc_v2', {
- orgId: br.orgId,
- trial: this.props.orgTrial || {
- }
- }),
- r = je.a.find(this.props.orgCurrentPackage.plans, function (e) {
- return e.isSubscribed
- }),
- o = this.props.pollsOrgCurrentPackage && je.a.find(this.props.pollsOrgCurrentPackage.plans, function (e) {
- return e.isSubscribed
- }),
- r = r && r.amount && !this.props.orgCurrentPackageWillCancel,
- o = o && o.amount && !this.props.pollsOrgCurrentPackageWillCancel,
- r = !this.props.selection.organization.pollsOnly && this.props.orgCurrentPackage.id !== Ur.DISQUS_BUSINESS_PACKAGE_ID && (UI(this.props.orgBilling.invoiceHistory).length || r || this.props.orgBilling.paymentInfo) || this.props.selection.organization.pollsActivationDate && this.props.pollsPlanStatus !== Ur.SAAS_PRODUCT_PLAN_CANCELLED_STATUS && this.props.pollsOrgCurrentPackage && this.props.pollsOrgCurrentPackage.id !== Ur.DISQUS_POLLS_BUSINESS_PACKAGE_ID && (UI(this.props.orgBilling.invoiceHistory).length || o || this.props.orgBilling.paymentInfo);
- switch (this.state.modal.type) {
- case zI:
- u = C.a.createElement(Ty, {
- package: this.props.orgCurrentPackage,
- isTrial: LI(this.props.orgTrial),
- onClose: function () {
- e.handleCloseModal(),
- e.state.modal.data && e.state.modal.data.redirectTo && e.props.history.push(e.state.modal.data.redirectTo)
- },
- newSubscriptionFlow: a
- });
- break;
- case QI:
- u = C.a.createElement(Ty, {
- package: this.props.pollsOrgCurrentPackage,
- isTrial: LI(this.props.pollsOrgTrial),
- onClose: function () {
- e.handleCloseModal(),
- e.state.modal.data && e.state.modal.data.redirectTo && e.props.history.push(e.state.modal.data.redirectTo)
- },
- newSubscriptionFlow: a
- });
- break;
- case HI:
- u = C.a.createElement(KT, {
- onClose: this.handleCloseModal
- });
- break;
- case 3:
- u = C.a.createElement(lI, {
- message: this.state.modal.data.errorMessage,
- onClose: this.handleCloseModal
- });
- break;
- case GI:
- var i = this.state.modal.data.package.productName === Ur.SAAS_PRODUCT_POLLS ? this.props.pollsOrgCurrentPackage : this.props.orgCurrentPackage,
- s = this.props.orgBilling && (this.state.modal.data.package.productName === Ur.SAAS_PRODUCT_POLLS ? this.props.orgBilling.currentPollsSubscription : this.props.orgBilling.currentSubscription),
- l = this.state.modal.data.secondPackage && (this.state.modal.data.secondPackage.productName === Ur.SAAS_PRODUCT_POLLS ? this.props.pollsOrgCurrentPackage : this.props.orgCurrentPackage),
- c = this.state.modal.data.secondPackage && this.props.orgBilling && (this.state.modal.data.secondPackage.productName === Ur.SAAS_PRODUCT_POLLS ? this.props.orgBilling.currentPollsSubscription : this.props.orgBilling.currentSubscription),
- u = C.a.createElement(xI, {
- onSubscribe: this.handleSubscribe.bind(this, this.state.modal.data.plan, this.state.modal.data.secondPlan),
- onClose: this.handleCloseModal,
- curPackage: i,
- newPackage: this.state.modal.data.package,
- newPlan: this.state.modal.data.plan,
- amountRemaining: s && s.amountRemaining,
- secondCurPackage: l,
- secondNewPackage: this.state.modal.data.secondPackage,
- secondNewPlan: this.state.modal.data.secondPlan,
- secondAmountRemaining: c && c.amountRemaining,
- coupon: this.state.coupon,
- orgAvailableDiscount: this.props.orgAvailableDiscount,
- paymentInfoAvailable: !!this.props.orgBilling.paymentInfo,
- organization: this.props.selection.organization
- });
- break;
- case VI:
- u = C.a.createElement(vI, {
- onClose: this.handleCloseModal,
- onSave: this.props.onUpdateInvoiceInfo,
- syncedInvoiceFields: this.props.orgBilling.invoiceInfo,
- isInvoiceUpdating: this.props.isInvoiceUpdating
- });
- break;
- case WI:
- u = C.a.createElement(aI, {
- applyCoupon: this.applyCoupon,
- onClose: this.handleCloseModal
- });
- break;
- case YI:
- u = C.a.createElement(QT, {
- onClose: this.handleCloseModal
- });
- break;
- default:
- u = null
- }
- o = je.a.find(this.props.orgPackages, function (e) {
- return e.id === Ur.DISQUS_BASIC_PACKAGE_ID
- });
- return C.a.createElement('div', null, u, this.props.orgBilling.currentSubscription && this.props.orgBilling.currentSubscription.status === Ur.SAAS_PRODUCT_PLAN_PAST_DUE_STATUS ? C.a.createElement('div', {
- className: 'content__wrap payment_error'
- }, C.a.createElement('div', {
- className: 'spacing-right-large'
- }, C.a.createElement('h2', {
- className: 'text-large text-red spacing-bottom-small'
- }, 'Your credit card has been declined'), C.a.createElement('p', {
- className: 'text-gray'
- }, 'Your payment is now overdue. Please update your payment method to prevent being reverted to an Ad-Supported plan.')), C.a.createElement('span', {
- className: 'icon icon-declined-card text-red spacing-left-large text-huge'
- })) : null, C.a.createElement('div', {
- className: 'content__wrap'
- }, C.a.createElement(nE, {
- headline: 'Your Plan and Billing',
- description: C.a.createElement('span', null, 'Review the Disqus plan to which your organization is currently subscribed, manage your billing, and see your past invoices.')
- }), C.a.createElement('section', {
- className: 'settings__content'
- }, C.a.createElement(sI, {
- filterInvoices: UI,
- isTrialActive: LI,
- orgCurrentPackage: this.props.orgCurrentPackage,
- basicPackage: o,
- orgPackages: this.props.orgPackages,
- orgBilling: this.props.orgBilling,
- orgCurrentPackageWillCancel: this.props.orgCurrentPackageWillCancel,
- orgTrial: this.props.orgTrial,
- onRequestInfo: this.handleRequestInfo,
- onSubscribe: this.handleConfirmSubscribe,
- onStartTrial: this.handleConfirmSubscribe,
- newSubscriptionFlow: a,
- pollsOrgCurrentPackage: this.props.pollsOrgCurrentPackage,
- pollsOrgAvailableDiscount: this.props.pollsOrgAvailableDiscount,
- pollsOrgCurrentPackageWillCancel: this.props.pollsOrgCurrentPackageWillCancel,
- pollsOrgTrial: this.props.pollsOrgTrial,
- pollsPlanStatus: this.props.pollsPlanStatus
- }), r ? C.a.createElement(EI, {
- formatPaymentDate: MI,
- orgBilling: this.props.orgBilling,
- orgCurrentPackage: this.props.orgCurrentPackage,
- orgCurrentPackageWillCancel: this.props.orgCurrentPackageWillCancel,
- currentSubscription: this.props.orgBilling.currentSubscription,
- onUpdatePaymentInfo: this.props.onUpdatePaymentInfo,
- onSubscribe: this.handleConfirmToggleInterval,
- showInvoiceCustomizationModal: this.showInvoiceCustomizationModal,
- currentPollsSubscription: this.props.orgBilling.currentPollsSubscription,
- pollsOrgCurrentPackageWillCancel: this.props.pollsOrgCurrentPackageWillCancel,
- pollsOrgCurrentPackage: this.props.pollsOrgCurrentPackage
- }) : null)), this.props.orgCurrentPackage.id === Ur.DISQUS_BUSINESS_PACKAGE_ID || this.props.pollsOrgCurrentPackage && this.props.pollsOrgCurrentPackage.id === Ur.DISQUS_POLLS_BUSINESS_PACKAGE_ID ? null : C.a.createElement('div', {
- className: 'content__wrap'
- }, C.a.createElement(nE, {
- headline: 'Other Subscription Plans',
- description: C.a.createElement('span', null, 'Manage your subscription and billing for your organization. Your organization\'s plan affects ', C.a.createElement('em', null, 'all'), ' sites in your organization. ', C.a.createElement('a', {
- href: Pn.pricingAndPlans
- }, 'Learn more about plans'), '.')
- }), C.a.createElement('section', {
- className: 'settings__content'
- }, C.a.createElement(WT.a, {
- onRequestInfo: this.handleRequestInfo,
- onStartTrial: this.handleConfirmSubscribe,
- onSubscribe: this.handleConfirmSubscribe,
- orgBilling: this.props.orgBilling,
- orgCurrentPackage: this.props.orgCurrentPackage,
- orgCurrentPackageWillCancel: this.props.orgCurrentPackageWillCancel,
- orgTrial: this.props.orgTrial,
- orgAvailableDiscount: this.props.orgAvailableDiscount,
- pollsOrgCurrentPackage: this.props.pollsOrgCurrentPackage,
- pollsOrgCurrentPackageWillCancel: this.props.pollsOrgCurrentPackageWillCancel,
- pollsOrgTrial: this.props.pollsOrgTrial,
- pollsOrgAvailableDiscount: this.props.pollsOrgAvailableDiscount,
- packages: this.props.orgPackages.reduce(function (e, t) {
- return e[t.id] = t,
- e
- }, {
- }),
- openCouponModal: this.openCouponModal,
- coupon: this.state.coupon,
- removeCoupon: this.removeCoupon,
- newSubscriptionFlow: a,
- useAdSupportedCard: !0,
- organization: this.props.selection.organization
- }), C.a.createElement(_I, {
- isOpen: this.props.isSubscriptionUpdating && this.state.modal.type === BI
- }))), C.a.createElement('div', {
- className: 'content__wrap'
- }, C.a.createElement(YT.a, {
- newSubscriptionFlow: a
- })), C.a.createElement(Bg, null), t ? C.a.createElement('div', {
- className: 'content__wrap'
- }, C.a.createElement(CI, null)) : null)
- }
- }
- ]) && DI(e.prototype, t),
- n && DI(e, n),
- o
- }();
- FI(r, 'propTypes', {
- fetchSubscription: b.a.func.isRequired,
- onSubscribe: b.a.func.isRequired,
- onUpdateInvoiceInfo: b.a.func.isRequired,
- onUpdatePaymentInfo: b.a.func.isRequired,
- orgSubscriptionIsFetching: b.a.bool.isRequired,
- isSubscriptionUpdating: b.a.bool.isRequired,
- isInvoiceUpdating: b.a.bool.isRequired,
- orgBilling: Ur.ORG_BILLING_SHAPE,
- orgCurrentPackage: Ur.PACKAGE_SHAPE,
- orgCurrentPackageWillCancel: b.a.bool,
- orgCurrentPlan: Ur.PLAN_SHAPE,
- orgPackages: b.a.arrayOf(Ur.PACKAGE_SHAPE),
- orgTrial: Ur.TRIAL_SHAPE,
- orgAvailableDiscount: b.a.number,
- pollsOrgTrial: Ur.TRIAL_SHAPE,
- pollsOrgCurrentPlan: Ur.PLAN_SHAPE,
- pollsOrgAvailableDiscount: b.a.number,
- pollsOrgCurrentPackageWillCancel: b.a.bool,
- pollsOrgCurrentPackage: Ur.PACKAGE_SHAPE,
- pollsPlanStatus: b.a.oneOf([Ur.SAAS_PRODUCT_PLAN_CANCELLED_STATUS,
- Ur.SAAS_PRODUCT_PLAN_ACTIVE_STATUS]),
- history: b.a.shape({
- push: b.a.func.isRequired
- }).isRequired,
- location: kh.locationShape,
- selection: ht.isRequired,
- emitTrackingEvent: b.a.func.isRequired,
- emitDefaultViewEvent: b.a.func.isRequired
- });
- s = Object(u.connect) (function (e) {
- var t = e.subscription;
- return {
- isInvoiceUpdating: t.isInvoiceUpdating,
- isSubscriptionUpdating: t.isSubscriptionUpdating,
- orgBilling: t.orgBilling,
- orgCurrentPackage: t.orgCurrentPackage,
- orgCurrentPackageWillCancel: t.orgCurrentPackageWillCancel,
- orgCurrentPlan: t.orgCurrentPlan,
- orgPackages: t.orgPackages,
- orgSubscriptionIsFetching: t.orgSubscriptionIsFetching,
- orgTrial: t.orgTrial,
- pollsOrgCurrentPackageWillCancel: t.pollsOrgCurrentPackageWillCancel,
- pollsOrgCurrentPackage: t.pollsOrgCurrentPackage,
- pollsPlanStatus: t.pollsPlanStatus,
- pollsOrgTrial: t.pollsOrgTrial,
- pollsOrgCurrentPlan: t.pollsOrgCurrentPlan,
- selection: e.selection,
- orgAvailableDiscount: t.orgAvailableDiscount,
- pollsOrgAvailableDiscount: t.pollsOrgAvailableDiscount
- }
- }, {
- fetchSubscription: Hl,
- onSubscribe: Wl,
- onUpdatePaymentInfo: Kl,
- onUpdateInvoiceInfo: Vl,
- emitTrackingEvent: Xo(Ru),
- emitDefaultViewEvent: ei(Ru)
- }) (Ni.a.attachDrivers(Fo() (r), [
- bc
- ]));
- function $I(t, e, n, a) {
- t({
- type: W.fetchingDiscussions
- }),
- a = {
- forum: e().selection.forum.shortname,
- related: [
- 'author'
- ],
- after: n,
- since: a
- },
- (e = e().discussionsEdit.cursor) && (a.cursor = e.next),
- io.a.call('forums/listThreads', {
- data: a,
- success: function (e) {
- t({
- type: W.fetchedDiscussions,
- threads: e.response,
- cursor: e.cursor
- })
- },
- error: function () {
- t({
- type: W.onFetchError
- })
- }
- })
- }
- function ZI(e, t, n, a, r) {
- var o = r.response.id ? r.response : r.response[0];
- (a = (r = a().discussionsEdit.threads).findIndex(function (e) {
- return e.id === o.id
- })) < 0 ? n({
- type: W.threadUpdateError
- }) : ('isClosed' === e && ((o = r[a]).isClosed = t), o.author = 'author' === e ? {
- username: t,
- id: o.author
- }
- : r[a].author, n({
- method: 'POST',
- type: W.updatedThread,
- threads: r.slice(0, a).concat([o]).concat(r.slice(a + 1))
- }), setTimeout(function () {
- n({
- type: W.clearAlert
- })
- }, 5000))
- }
- function XI(e, t) {
- var n;
- try {
- n = JSON.parse(t.responseText).response
- } catch (e) {
- n = 'There was an error making these changes.'
- }
- e({
- type: W.updateThreadError,
- errorMessage: n
- }),
- setTimeout(function () {
- e({
- type: W.clearAlert
- })
- }, 5000)
- }
- go = {
- fetchCategories: function () {
- return function (t, e) {
- io.a.call('categories/list', {
- data: {
- forum: e().selection.forum.shortname
- },
- success: function (e) {
- t({
- type: W.fetchedCategories,
- categories: e.response
- })
- },
- error: function () {
- t({
- type: W.onFetchError
- })
- }
- }),
- $I(t, e)
- }
- },
- fetchMoreDiscussions: function (n, a) {
- return function (e, t) {
- $I(e, t, n, a)
- }
- },
- resetDiscussions: function (n, a) {
- return function (e, t) {
- e({
- type: W.resetDiscussions
- }),
- $I(e, t, n, a)
- }
- },
- updateThreadField: function (o, i, s) {
- return function (e, t) {
- var n,
- a,
- r;
- e({
- type: W.clearAlert
- }),
- io.a.call('threads/update', {
- method: 'POST',
- data: (n = {
- thread: o
- }, r = 'author' === (a = i) ? 'username:'.concat(s) : s, a in n ? Object.defineProperty(n, a, {
- value: r,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : n[a] = r, n),
- success: ZI.bind(null, i, s, e, t),
- error: XI.bind(null, e)
- })
- }
- },
- toggleThreadClosed: function (a) {
- return function (e, t) {
- var n = t().discussionsEdit.threads.find(function (e) {
- return e.id === a
- });
- n ? (e({
- type: W.clearAlert
- }), io.a.call(n.isClosed ? 'threads/open' : 'threads/close', {
- method: 'POST',
- data: {
- thread: a
- },
- success: ZI.bind(null, 'isClosed', !n.isClosed, e, t),
- error: XI.bind(null, e)
- })) : XI(e)
- }
- }
- };
- function eq(e) {
- return (eq = 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator ? function (e) {
- return typeof e
- }
- : function (e) {
- return e && 'function' == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? 'symbol' : typeof e
- }) (e)
- }
- function tq(t, e) {
- var n,
- a = Object.keys(t);
- return Object.getOwnPropertySymbols && (n = Object.getOwnPropertySymbols(t), e && (n = n.filter(function (e) {
- return Object.getOwnPropertyDescriptor(t, e).enumerable
- })), a.push.apply(a, n)),
- a
- }
- function nq(t) {
- for (var e = 1; e < arguments.length; e++) {
- var n = null != arguments[e] ? arguments[e] : {
- };
- e % 2 ? tq(Object(n), !0).forEach(function (e) {
- lq(t, e, n[e])
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(n)) : tq(Object(n)).forEach(function (e) {
- Object.defineProperty(t, e, Object.getOwnPropertyDescriptor(n, e))
- })
- }
- return t
- }
- function aq(e, t) {
- for (var n = 0; n < t.length; n++) {
- var a = t[n];
- a.enumerable = a.enumerable || !1,
- a.configurable = !0,
- 'value' in a && (a.writable = !0),
- Object.defineProperty(e, a.key, a)
- }
- }
- function rq(e, t) {
- return (rq = Object.setPrototypeOf || function (e, t) {
- return e.__proto__ = t,
- e
- }) (e, t)
- }
- function oq(n) {
- var a = function () {
- if ('undefined' == typeof Reflect || !Reflect.construct) return !1;
- if (Reflect.construct.sham) return !1;
- if ('function' == typeof Proxy) return !0;
- try {
- return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [
- ], function () {
- })),
- !0
- } catch (e) {
- return !1
- }
- }();
- return function () {
- var e,
- t = sq(n);
- return e = a ? (e = sq(this).constructor, Reflect.construct(t, arguments, e)) : t.apply(this, arguments),
- t = this,
- !(e = e) || 'object' !== eq(e) && 'function' != typeof e ? iq(t) : e
- }
- }
- function iq(e) {
- if (void 0 === e) throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called');
- return e
- }
- function sq(e) {
- return (sq = Object.setPrototypeOf ? Object.getPrototypeOf : function (e) {
- return e.__proto__ || Object.getPrototypeOf(e)
- }) (e)
- }
- function lq(e, t, n) {
- return t in e ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n,
- e
- }
- F = function () {
- !function (e, t) {
- if ('function' != typeof t && null !== t) throw new TypeError('Super expression must either be null or a function');
- e.prototype = Object.create(t && t.prototype, {
- constructor: {
- value: e,
- writable: !0,
- configurable: !0
- }
- }),
- t && rq(e, t)
- }(o, A);
- var e,
- t,
- n,
- r = oq(o);
- function o() {
- var a;
- !function (e, t) {
- if (!(e instanceof t)) throw new TypeError('Cannot call a class as a function')
- }(this, o);
- for (var e = arguments.length, t = Array(e), n = 0; n < e; n++) t[n] = arguments[n];
- return lq(iq(a = r.call.apply(r, [
- this
- ].concat(t))), 'state', {
- editing: {
- },
- dateRange: 'all',
- startDate: ct() ().startOf('day').subtract(1, 'month'),
- endDate: ct() ().endOf('day'),
- modalData: null
- }),
- lq(iq(a), 'toggleEdit', function (e, t) {
- a.setState({
- editing: nq(nq({
- }, a.state.editing), {
- }, lq({
- }, e, nq(nq({
- }, a.state.editing[e]), {
- }, lq({
- }, t, !(a.state.editing[e] || {
- }) [t]))))
- })
- }),
- lq(iq(a), 'updateField', function (e, t, n) {
- a.props.updateThreadField(e, t, n.target.value),
- a.toggleEdit(e, t)
- }),
- lq(iq(a), 'onInputKeyPress', function (e, t, n) {
- 13 === n.charCode && a.updateField(e, t, n)
- }),
- lq(iq(a), 'getEditableTextCell', function (e, t, n) {
- return C.a.createElement('td', {
- onClick: a.toggleEdit.bind(iq(a), e.id, t)
- }, a.state.editing[e.id] && a.state.editing[e.id][t] ? C.a.createElement('input', {
- type: 'text',
- defaultValue: n || e[t],
- onBlur: a.updateField.bind(iq(a), e.id, t),
- onKeyPress: a.onInputKeyPress.bind(iq(a), e.id, t),
- autoFocus: !0
- }) : C.a.createElement('span', null, n || e[t]))
- }),
- lq(iq(a), 'onDateRangeChange', function (e) {
- var t = 'custom' === e;
- e === a.state.dateRange ? a.setState({
- showDatePicker: t
- }) : a.setState({
- dateRange: e,
- showDatePicker: t
- }, a.fetchDiscussions.bind(iq(a), !0))
- }),
- lq(iq(a), 'onDateChange', function (e, t) {
- a.setState({
- startDate: e,
- endDate: t.endOf('day')
- }, a.fetchDiscussions.bind(iq(a), !0))
- }),
- lq(iq(a), 'hideDatePicker', function () {
- a.setState({
- showDatePicker: !1
- })
- }),
- lq(iq(a), 'fetchDiscussions', function (e) {
- e = e ? a.props.resetDiscussions : a.props.fetchMoreDiscussions;
- 'all' === a.state.dateRange ? e() : e(a.state.startDate.toISOString(), a.state.endDate.toISOString())
- }),
- lq(iq(a), 'handleOpenModal', function (e) {
- a.setState({
- modalData: e
- })
- }),
- lq(iq(a), 'handleCloseModal', function () {
- a.setState({
- modalData: null
- })
- }),
- a
- }
- return e = o,
- (t = [
- {
- key: 'componentDidMount',
- value: function () {
- this.props.selection.forum && this.props.fetchCategories()
- }
- },
- {
- key: 'render',
- value: function () {
- var t = this;
- if (this.props.selection.organization && this.props.selection.organization.pollsOnly) return C.a.createElement(Cm, {
- isPolls: !1,
- organization: this.props.selection.organization
- });
- var e,
- n,
- a = null;
- return 'custom' === this.state.dateRange && (e = this.state.startDate.format('M/D/YY'), n = this.state.endDate.format('M/D/YY'), a = ''.concat(e, ' - ').concat(n)),
- C.a.createElement('div', {
- className: 'admin_content _discussions_'
- }, this.state.modalData ? C.a.createElement(_.a, {
- className: 'admin-modal thread-identifiers-modal',
- overlayClassName: 'modal-overlay -dark',
- isOpen: !0,
- onRequestClose: this.handleCloseModal
- }, C.a.createElement('div', {
- className: 'admin-modal__header align align--between'
- }, C.a.createElement('h3', {
- className: 'text-large text-capitalized'
- }, 'Thread Identifiers'), C.a.createElement('button', {
- className: 'link-gray',
- onClick: this.handleCloseModal
- }, C.a.createElement('span', {
- className: 'icon-cancel icon__position'
- }))), C.a.createElement('ul', {
- className: 'thread-identifiers-list text-small'
- }, this.state.modalData.map(function (e) {
- return C.a.createElement('li', {
- key: e,
- className: 'thread-identifiers-list--item'
- }, e)
- }))) : null, C.a.createElement('div', {
- className: 'page-header'
- }, C.a.createElement('h2', null, 'Edit Discussions', C.a.createElement('div', {
- className: 'settings-subheading'
- }, 'Set specific authors for each post, update titles, and close old discussions. ', C.a.createElement('a', {
- href: Pn.discussionsEdit,
- target: '_blank',
- rel: 'noopener noreferrer'
- }, 'Learn more »')))), this.props.alert ? C.a.createElement(Ki, {
- message: this.props.alert.message,
- alertType: this.props.alert.status
- }) : null, C.a.createElement('div', {
- className: 'align align__item--grow mod-bar'
- }, C.a.createElement(sR, {
- buttonLabel: a,
- options: o.DATE_RANGE_OPTIONS,
- selected: [
- this.state.dateRange
- ],
- icon: 'icon-calendar',
- onChange: this.onDateRangeChange
- }), C.a.createElement(zp.a, {
- onOutsideClick: this.hideDatePicker,
- className: 'mod-bar__date '.concat(this.state.showDatePicker ? '' : 'hidden'),
- active: this.state.showDatePicker
- }, C.a.createElement(Zp, {
- maxDate: o.maxDate,
- minDate: o.minDate,
- startDate: this.state.startDate,
- endDate: this.state.endDate,
- onDateChange: this.onDateChange,
- alwaysOpen: !0
- }))), C.a.createElement('table', {
- className: 'zebra-striped'
- }, C.a.createElement('thead', null, C.a.createElement('tr', null, C.a.createElement('th', null, 'Title'), C.a.createElement('th', null, 'Link'), C.a.createElement('th', {
- width: '105'
- }, 'Thread ID'), C.a.createElement('th', null, 'Author ', C.a.createElement(Md, {
- tooltipKey: 'author',
- content: 'Change who receives moderation notifications for this discussion by default. You must specify a registered Disqus username.',
- direction: 'top'
- })), C.a.createElement('th', {
- width: '110'
- }, 'Category ', C.a.createElement(Md, {
- tooltipKey: 'category',
- content: 'Categories are used with our API for results filtering; categories are not used for moderation.',
- direction: 'top'
- })), C.a.createElement('th', {
- width: '125'
- }, 'Created'), C.a.createElement('th', {
- width: '90'
- }, 'Identifiers'), C.a.createElement('th', {
- width: '80'
- }, 'Status'))), C.a.createElement('tbody', null, this.props.threads.map(function (e) {
- return C.a.createElement('tr', {
- key: e.id
- }, t.getEditableTextCell(e, 'title'), t.getEditableTextCell(e, 'url', e.link), C.a.createElement('td', null, e.id), t.getEditableTextCell(e, 'author', e.author.username || e.author.name || 'Unknown'), C.a.createElement('td', null, C.a.createElement('select', {
- defaultValue: e.category,
- onChange: t.updateField.bind(t, e.id, 'category')
- }, t.props.categories.map(function (e) {
- return C.a.createElement('option', {
- key: e.id,
- value: e.id
- }, e.title)
- }))), C.a.createElement('td', {
- title: e.createdAt
- }, Os.prettyDatetime(e.createdAt, 'relative')), C.a.createElement('td', null, e.identifiers.length && C.a.createElement('a', {
- className: 'thread-identifiers-count',
- onClick: function () {
- return t.handleOpenModal(e.identifiers)
- }
- }, e.identifiers.length)), C.a.createElement('td', {
- className: 'editable-switch '.concat(e.isClosed ? 'closed' : 'open'),
- title: e.isClosed ? 'Open this discussion' : 'Close this discussion',
- onClick: function () {
- t.props.toggleThreadClosed(e.id)
- }
- }))
- }))), C.a.createElement('div', null, this.props.threads ? C.a.createElement('button', {
- className: 'button button-wide button-outline button-medium',
- disabled: this.props.isFetchingThreads || !this.props.hasNextPage,
- onClick: this.fetchDiscussions.bind(this, !1)
- }, 'Show more discussions') : null), C.a.createElement('p', null, C.a.createElement('br', null), 'Links cannot be updated to a URL that already exists in your forum. Use the ', C.a.createElement(Uo, {
- path: '/discussions/migrate/',
- selection: this.props.selection
- }, 'URL Mapper tool'), ' to batch edit or merge discussions.'))
- }
- }
- ]) && aq(e.prototype, t),
- n && aq(e, n),
- o
- }();
- lq(F, 'propTypes', {
- categories: b.a.arrayOf(b.a.shape({
- id: b.a.string.isRequired,
- title: b.a.string.isRequired
- })).isRequired,
- threads: b.a.arrayOf(b.a.shape({
- title: b.a.string.isRequired,
- link: b.a.string.isRequired,
- author: b.a.shape({
- username: b.a.string.isRequired
- }).isRequired,
- category: b.a.string.isRequired,
- createdAt: b.a.string.isRequired,
- isClosed: b.a.bool.isRequired
- })).isRequired,
- hasNextPage: b.a.bool.isRequired,
- numPerPage: b.a.number.isRequired,
- isFetchingThreads: b.a.bool.isRequired,
- fetchCategories: b.a.func.isRequired,
- fetchMoreDiscussions: b.a.func.isRequired,
- resetDiscussions: b.a.func.isRequired,
- updateThreadField: b.a.func.isRequired,
- toggleThreadClosed: b.a.func.isRequired,
- selection: ht.isRequired,
- alert: b.a.shape({
- message: b.a.string.isRequired,
- status: b.a.string.isRequired
- })
- }),
- lq(F, 'DATE_RANGE_OPTIONS', [
- {
- key: 'all',
- label: 'All Time'
- },
- {
- key: 'custom',
- label: 'Custom'
- }
- ]),
- lq(F, 'minDate', ct() ('01 01 2007', 'MM DD YYYY').startOf('day')),
- lq(F, 'maxDate', ct() ().endOf('day'));
- var rc = Object(u.connect) (function (e) {
- return nq({
- selection: e.selection
- }, e.discussionsEdit)
- }, nq({
- }, go)) (F),
- yl = n(176),
- cq = n.n(yl);
- function uq(t, e) {
- var n,
- a = Object.keys(t);
- return Object.getOwnPropertySymbols && (n = Object.getOwnPropertySymbols(t), e && (n = n.filter(function (e) {
- return Object.getOwnPropertyDescriptor(t, e).enumerable
- })), a.push.apply(a, n)),
- a
- }
- function pq(a) {
- for (var e = 1; e < arguments.length; e++) {
- var r = null != arguments[e] ? arguments[e] : {
- };
- e % 2 ? uq(Object(r), !0).forEach(function (e) {
- var t,
- n;
- n = r[t = e],
- t in (e = a) ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(a, Object.getOwnPropertyDescriptors(r)) : uq(Object(r)).forEach(function (e) {
- Object.defineProperty(a, e, Object.getOwnPropertyDescriptor(r, e))
- })
- }
- return a
- }
- var Wi = {
- toggleBadges: function (e) {
- var n = e.forum,
- a = e.data,
- r = e.onSuccess;
- return function (t) {
- t({
- type: B.toggling
- }),
- io.a.call('forums/update', {
- type: 'POST',
- data: pq({
- forum: n
- }, a),
- success: function (e) {
- t({
- type: B.onToggle,
- badgesEnabled: e.response.settings.badgesEnabled
- }),
- r({
- badgesEnabled: e.response.settings.badgesEnabled
- })
- },
- error: function () {
- t({
- type: B.onToggleError,
- message: 'An error occurred trying to '.concat(a.badgesEnabled ? 'disable' : 'enable', ' the badges feature')
- })
- }
- })
- }
- },
- fetchBadges: function (e) {
- return function (t) {
- t({
- type: B.fetching
- }),
- io.a.call('badges/list', {
- data: {
- forum: e
- },
- success: function (e) {
- t({
- type: B.onFetch,
- badgesEnabled: e.response.enabled,
- badges: e.response.badges
- })
- },
- error: function () {
- t({
- type: B.onFetchError,
- message: 'We couldn\'t retrieve the badges for your website. Try again.'
- })
- }
- })
- }
- },
- uploadImages: function (e) {
- var r = e.data,
- o = e.onSuccess;
- return function (n) {
- var e = r.options || {
- },
- a = !1;
- n({
- type: B.uploading
- });
- var t = r.badges.map(function (t) {
- return t.imageFile && 'blob' === t.image.split(':') [0] ? cq.a.uploadMediaUrl([t.imageFile], e).then(function (e) {
- return pq(pq({
- }, t), {
- }, {
- image: e.get('url'),
- imageFile: null,
- imageErrors: [
- ]
- })
- }).catch(function () {
- a = !0,
- n({
- type: B.onUploadError,
- message: 'We weren\'t able to upload the provided badge images. Try again.'
- })
- }) : t
- });
- Promise.all(t).then(function (e) {
- a || (n({
- type: B.onUpload,
- badges: e
- }), o(e))
- })
- }
- },
- saveBadges: function (e) {
- var n = e.forum,
- a = e.data,
- r = e.onSuccess;
- return function (t) {
- t({
- type: B.saving
- }),
- io.a.call('badges/update', {
- type: 'POST',
- data: {
- forum: n,
- badges: JSON.stringify(a.badges)
- },
- success: function (e) {
- e = {
- badgesEnabled: e.response.enabled,
- badges: e.response.badges
- };
- t(pq({
- type: B.onSave
- }, e)),
- r(e)
- },
- error: function () {
- t({
- type: B.onSaveError,
- message: 'An error occurred trying to save your badges. Try again.'
- })
- }
- })
- }
- }
- },
- dq = window.URL || window.webkitURL,
- mq = function (e) {
- return e ? dq.createObjectURL(e) : null
- },
- fq = function (e) {
- return e ? dq.revokeObjectURL(e) : null
- },
- hq = function (e, t) {
- return !!e && (!t || e.size <= t)
- };
- function gq(e) {
- return (gq = 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator ? function (e) {
- return typeof e
- }
- : function (e) {
- return e && 'function' == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? 'symbol' : typeof e
- }) (e)
- }
- function yq(t, e) {
- var n,
- a = Object.keys(t);
- return Object.getOwnPropertySymbols && (n = Object.getOwnPropertySymbols(t), e && (n = n.filter(function (e) {
- return Object.getOwnPropertyDescriptor(t, e).enumerable
- })), a.push.apply(a, n)),
- a
- }
- function bq(t) {
- for (var e = 1; e < arguments.length; e++) {
- var n = null != arguments[e] ? arguments[e] : {
- };
- e % 2 ? yq(Object(n), !0).forEach(function (e) {
- wq(t, e, n[e])
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(n)) : yq(Object(n)).forEach(function (e) {
- Object.defineProperty(t, e, Object.getOwnPropertyDescriptor(n, e))
- })
- }
- return t
- }
- function vq(e, t) {
- for (var n = 0; n < t.length; n++) {
- var a = t[n];
- a.enumerable = a.enumerable || !1,
- a.configurable = !0,
- 'value' in a && (a.writable = !0),
- Object.defineProperty(e, a.key, a)
- }
- }
- function _q(e, t) {
- return (_q = Object.setPrototypeOf || function (e, t) {
- return e.__proto__ = t,
- e
- }) (e, t)
- }
- function Eq(n) {
- var a = function () {
- if ('undefined' == typeof Reflect || !Reflect.construct) return !1;
- if (Reflect.construct.sham) return !1;
- if ('function' == typeof Proxy) return !0;
- try {
- return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [
- ], function () {
- })),
- !0
- } catch (e) {
- return !1
- }
- }();
- return function () {
- var e,
- t = Sq(n);
- return e = a ? (e = Sq(this).constructor, Reflect.construct(t, arguments, e)) : t.apply(this, arguments),
- t = this,
- !(e = e) || 'object' !== gq(e) && 'function' != typeof e ? Oq(t) : e
- }
- }
- function Oq(e) {
- if (void 0 === e) throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called');
- return e
- }
- function Sq(e) {
- return (Sq = Object.setPrototypeOf ? Object.getPrototypeOf : function (e) {
- return e.__proto__ || Object.getPrototypeOf(e)
- }) (e)
- }
- function wq(e, t, n) {
- return t in e ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n,
- e
- }
- var Pq = function () {
- !function (e, t) {
- if ('function' != typeof t && null !== t) throw new TypeError('Super expression must either be null or a function');
- e.prototype = Object.create(t && t.prototype, {
- constructor: {
- value: e,
- writable: !0,
- configurable: !0
- }
- }),
- t && _q(e, t)
- }(o, A);
- var e,
- t,
- n,
- a = Eq(o);
- function o() {
- var r;
- !function (e, t) {
- if (!(e instanceof t)) throw new TypeError('Cannot call a class as a function')
- }(this, o);
- for (var e = arguments.length, t = Array(e), n = 0; n < e; n++) t[n] = arguments[n];
- return wq(Oq(r = a.call.apply(a, [
- this
- ].concat(t))), 'handleChange', function (e, t) {
- var n,
- a = {
- };
- 'image' === e && t.target.files ? (n = t.target.files[0], r.props.image && 'blob' === r.props.image.split(':') [0] && fq(r.props.image), a.imageFile = n, a.image = mq(n), a.imageErrors = hq(n, lC) ? [
- ] : [
- 'The image must be less than '.concat(lC / 1000, 'KB')
- ], a.isInvalid = 0 < a.imageErrors.length) : 'criteria' === e ? (a.criteria = t.target.value, a.criteria === We.BADGES_CRITERIA.MANUAL ? a.target = 0 : r.props.target && r.props.target || (a.target = 1)) : 'target' === e ? a.target = parseInt(t.target.value, 10) : a[e] = t.target.value,
- r.props.onChange(a)
- }),
- wq(Oq(r), 'isManuallyAssigned', function () {
- return r.props.criteria === We.BADGES_CRITERIA.MANUAL
- }),
- wq(Oq(r), 'hasValidTarget', function () {
- return r.isManuallyAssigned() ? 0 === r.props.target : 0 < r.props.target && r.props.target <= sC
- }),
- r
- }
- return e = o,
- (t = [
- {
- key: 'render',
- value: function () {
- var e = this.props.imageErrors && 0 < this.props.imageErrors.length;
- return C.a.createElement('div', {
- className: 'badge row'
- }, C.a.createElement('div', {
- className: 'row__header'.concat(this.props.hasChanges ? ' settings__highlighted' : '')
- }, C.a.createElement('div', {
- className: 'align row__header-left text-gray'
- }, C.a.createElement('div', {
- className: 'badge-inputs-wrapper align align--middle align--wrap'
- }, C.a.createElement('span', {
- className: 'image-wrapper align--wrap'
- }, C.a.createElement('input', {
- type: 'file',
- id: 'badge-image-input__'.concat(this.props.id),
- className: 'input--display-label',
- onChange: this.handleChange.bind(this, 'image'),
- accept: '.png, .jpg, .jpeg'
- }), C.a.createElement('label', {
- htmlFor: 'badge-image-input__'.concat(this.props.id),
- className: 'badge-image-label'.concat(this.props.image ? ' has-image' : '').concat(this.props.highlightInvalid && !this.props.image || e ? ' is-error' : '')
- }, C.a.createElement('div', {
- className: 'badge-image-mask'
- }, this.props.image ? C.a.createElement('img', {
- className: 'badge-image-content',
- src: this.props.image,
- alt: ''.concat(this.props.name, ' badge')
- }) : C.a.createElement('span', {
- className: 'badge-image-placeholder'
- }, C.a.createElement('img', {
- className: 'image-upload-icon',
- src: '//c.disquscdn.com/next/current/publisher-admin/assets/img/image-upload.svg',
- alt: 'Upload a badge'
- }))))), C.a.createElement('span', {
- className: 'badge-input-group'
- }, C.a.createElement('span', {
- className: 'name-wrapper align--wrap spacing-left'
- }, C.a.createElement($h, {
- name: 'name',
- idNamespace: 'badge__'.concat(this.props.id),
- value: this.props.name,
- placeholder: 'Name',
- className: 'input--textbox'.concat(this.props.highlightInvalid && !this.props.name ? ' is-error' : ''),
- onChange: this.handleChange.bind(this, 'name'),
- maxLength: 20,
- inline: !0,
- showLimit: !0,
- width: 210,
- autocomplete: !1
- })), C.a.createElement('span', {
- className: 'criteria-wrapper align--wrap spacing-left'
- }, C.a.createElement(Mf, {
- name: 'criteria',
- className: 'select__criteria'.concat(this.props.highlightInvalid && !this.props.criteria ? ' is-error' : ''),
- options: dC,
- value: this.props.criteria || '',
- placeholder: 'Select a criteria',
- onChange: this.handleChange.bind(this, 'criteria'),
- width: 275,
- inline: !0
- })), C.a.createElement('span', {
- className: 'target-wrapper align--wrap spacing-left'
- }, C.a.createElement('input', {
- type: 'number',
- name: 'target',
- id: 'badge_target_'.concat(this.props.id),
- className: 'input--textbox -inline'.concat(this.props.highlightInvalid && !this.hasValidTarget() ? ' is-error' : ''),
- min: 0,
- max: sC,
- value: this.props.target || 0,
- onChange: this.handleChange.bind(this, 'target'),
- readOnly: this.isManuallyAssigned() || !this.props.criteria,
- disabled: this.isManuallyAssigned() || !this.props.criteria
- }))))), C.a.createElement('div', {
- className: 'align row__header-right'
- }, C.a.createElement('button', {
- className: 'button button-outline button-small',
- onClick: this.props.removeBadge
- }, 'Remove'))), C.a.createElement('ul', {
- className: 'badge-error-list text-small'
- }, e && this.props.imageErrors.map(function (e, t) {
- return C.a.createElement('li', {
- key: t,
- className: 'badge-error'
- }, e)
- })))
- }
- }
- ]) && vq(e.prototype, t),
- n && vq(e, n),
- o
- }();
- wq(Pq, 'propTypes', bq(bq({
- }, sl), {
- }, {
- hasChanges: b.a.bool,
- highlightInvalid: b.a.bool,
- imageErrors: b.a.arrayOf(b.a.string),
- onChange: b.a.func.isRequired,
- removeBadge: b.a.func.isRequired
- }));
- Ru = function (e) {
- var t,
- n = e.type,
- a = e.badge,
- r = e.onConfirm,
- e = e.onClose;
- return n === uC ? t = {
- title: 'Are you sure you want to change the criteria for this badge?',
- message: C.a.createElement('div', null, 'Changing the criteria for this badge will not remove it from commenters that have already received it.', ' ', a.criteria === We.BADGES_CRITERIA.MANUAL ? null : C.a.createElement('span', null, 'Additionally, all progress made towards this badge criteria will be reset.', C.a.createElement('p', {
- className: 'text-bold'
- }, 'This action will take effect once the changes are saved and cannot be undone.'))),
- closeButton: 'Don\'t change this badge',
- confirmButton: 'Change this badge'
- }
- : n === cC && (t = {
- title: 'Are you sure you want to remove this badge?',
- message: C.a.createElement('div', null, 'Removing this badge will permanently remove it from all commenters that have received it.', ' ', a.criteria === We.BADGES_CRITERIA.MANUAL ? null : C.a.createElement('span', null, 'Additionally, all progress made towards this badge criteria will be reset.'), C.a.createElement('p', {
- className: 'text-bold'
- }, 'This action will take effect once the changes are saved and cannot be undone.')),
- closeButton: 'Keep this badge',
- confirmButton: 'Remove this badge'
- }),
- C.a.createElement(_.a, {
- isOpen: !0,
- shouldCloseOnEsc: !1,
- className: 'admin-modal -clipped -wider -centered',
- overlayClassName: 'modal-overlay -dark'
- }, C.a.createElement('div', {
- className: 'admin-modal__header align align--between padding-gutter'
- }, C.a.createElement('h3', {
- className: 'text-large'
- }, t.title), C.a.createElement('button', {
- className: 'link-gray',
- onClick: e
- }, C.a.createElement('span', {
- className: 'icon-cancel icon__position'
- }))), C.a.createElement('div', {
- className: 'admin-modal__content padding-gutter'
- }, t.message, C.a.createElement('div', {
- className: 'spacing-top-double align align--between'
- }, C.a.createElement('button', {
- className: 'button button-medium button-fill',
- onClick: e
- }, t.closeButton), C.a.createElement('button', {
- className: 'button button-medium button-fill--red',
- onClick: r
- }, t.confirmButton))))
- };
- Ru.propTypes = {
- type: b.a.number.isRequired,
- badge: b.a.shape(sl).isRequired,
- onConfirm: b.a.func.isRequired,
- onClose: b.a.func.isRequired
- };
- var kq = Ru,
- r = function (e) {
- var t = e.onConfirm,
- e = e.onClose;
- return C.a.createElement(_.a, {
- isOpen: !0,
- onRequestClose: e,
- shouldCloseOnEsc: !1,
- className: 'admin-modal -clipped -wider -centered',
- overlayClassName: 'modal-overlay -dark'
- }, C.a.createElement('div', {
- className: 'admin-modal__header align align--between padding-gutter'
- }, C.a.createElement('h3', {
- className: 'text-large'
- }, 'Are you sure you want to disable badges?'), C.a.createElement('button', {
- className: 'link-gray',
- onClick: e
- }, C.a.createElement('span', {
- className: 'icon-cancel icon__position'
- }))), C.a.createElement('div', {
- className: 'admin-modal__content padding-gutter'
- }, C.a.createElement('div', null, 'All assigned badges will be removed from users on your site. This will also reset any progress that commenters have made towards each badge criteria.', C.a.createElement('p', {
- className: 'text-bold'
- }, 'This cannot be undone.')), C.a.createElement('div', {
- className: 'spacing-top-double align align--between'
- }, C.a.createElement('button', {
- className: 'button button-medium button-fill',
- onClick: e
- }, 'Keep Badges on'), C.a.createElement('button', {
- className: 'button button-medium button-fill--red',
- onClick: t
- }, 'Yes, turn Badges off'))))
- };
- r.propTypes = {
- onConfirm: b.a.func.isRequired,
- onClose: b.a.func.isRequired
- };
- var Nq = r;
- function Cq(e) {
- return (Cq = 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator ? function (e) {
- return typeof e
- }
- : function (e) {
- return e && 'function' == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? 'symbol' : typeof e
- }) (e)
- }
- function Rq() {
- return (Rq = Object.assign || function (e) {
- for (var t = 1; t < arguments.length; t++) {
- var n,
- a = arguments[t];
- for (n in a) Object.prototype.hasOwnProperty.call(a, n) && (e[n] = a[n])
- }
- return e
- }).apply(this, arguments)
- }
- function xq(e) {
- return function (e) {
- if (Array.isArray(e)) return Aq(e)
- }(e) || function (e) {
- if ('undefined' != typeof Symbol && null != e[Symbol.iterator] || null != e['@@iterator']) return Array.from(e)
- }(e) || function (e, t) {
- if (e) {
- if ('string' == typeof e) return Aq(e, t);
- var n = Object.prototype.toString.call(e).slice(8, - 1);
- return 'Map' === (n = 'Object' === n && e.constructor ? e.constructor.name : n) || 'Set' === n ? Array.from(e) : 'Arguments' === n || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n) ? Aq(e, t) : void 0
- }
- }(e) || function () {
- throw new TypeError('Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.')
- }()
- }
- function Aq(e, t) {
- for (var n = 0, a = Array(t = null == t || e.length < t ? e.length : t); n < t; n++) a[n] = e[n];
- return a
- }
- function Dq(t, e) {
- var n,
- a = Object.keys(t);
- return Object.getOwnPropertySymbols && (n = Object.getOwnPropertySymbols(t), e && (n = n.filter(function (e) {
- return Object.getOwnPropertyDescriptor(t, e).enumerable
- })), a.push.apply(a, n)),
- a
- }
- function jq(t) {
- for (var e = 1; e < arguments.length; e++) {
- var n = null != arguments[e] ? arguments[e] : {
- };
- e % 2 ? Dq(Object(n), !0).forEach(function (e) {
- Uq(t, e, n[e])
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(n)) : Dq(Object(n)).forEach(function (e) {
- Object.defineProperty(t, e, Object.getOwnPropertyDescriptor(n, e))
- })
- }
- return t
- }
- function Tq(e, t) {
- for (var n = 0; n < t.length; n++) {
- var a = t[n];
- a.enumerable = a.enumerable || !1,
- a.configurable = !0,
- 'value' in a && (a.writable = !0),
- Object.defineProperty(e, a.key, a)
- }
- }
- function Iq(e, t) {
- return (Iq = Object.setPrototypeOf || function (e, t) {
- return e.__proto__ = t,
- e
- }) (e, t)
- }
- function qq(n) {
- var a = function () {
- if ('undefined' == typeof Reflect || !Reflect.construct) return !1;
- if (Reflect.construct.sham) return !1;
- if ('function' == typeof Proxy) return !0;
- try {
- return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [
- ], function () {
- })),
- !0
- } catch (e) {
- return !1
- }
- }();
- return function () {
- var e,
- t = Lq(n);
- return e = a ? (e = Lq(this).constructor, Reflect.construct(t, arguments, e)) : t.apply(this, arguments),
- t = this,
- !(e = e) || 'object' !== Cq(e) && 'function' != typeof e ? Fq(t) : e
- }
- }
- function Fq(e) {
- if (void 0 === e) throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called');
- return e
- }
- function Lq(e) {
- return (Lq = Object.setPrototypeOf ? Object.getPrototypeOf : function (e) {
- return e.__proto__ || Object.getPrototypeOf(e)
- }) (e)
- }
- function Uq(e, t, n) {
- return t in e ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n,
- e
- }
- var Mq = function (e) {
- return !!(e.image && e.name && e.criteria && 0 === e.imageErrors.length) && (e.criteria === We.BADGES_CRITERIA.MANUAL && 0 === e.target || e.criteria !== We.BADGES_CRITERIA.MANUAL && 0 < e.target && e.target <= sC)
- },
- go = function () {
- !function (e, t) {
- if ('function' != typeof t && null !== t) throw new TypeError('Super expression must either be null or a function');
- e.prototype = Object.create(t && t.prototype, {
- constructor: {
- value: e,
- writable: !0,
- configurable: !0
- }
- }),
- t && Iq(e, t)
- }(r, A);
- var e,
- t,
- n,
- a = qq(r);
- function r() {
- var i;
- !function (e, t) {
- if (!(e instanceof t)) throw new TypeError('Cannot call a class as a function')
- }(this, r);
- for (var e = arguments.length, t = Array(e), n = 0; n < e; n++) t[n] = arguments[n];
- return Uq(Fq(i = a.call.apply(a, [
- this
- ].concat(t))), 'state', {
- badgesEnabled: !1,
- badges: i.props.badges,
- highlightInvalidFields: null,
- hasInvalidBadges: !1,
- hasNewImages: !1,
- hasRemovedBadge: !1,
- savedBadges: [
- ],
- errors: [
- ],
- modal: {
- }
- }),
- Uq(Fq(i), 'confirmNavigationIfUnsaved', function () {
- if (i.hasUnsavedChanges()) return 'You have unsaved changes. Do you want to leave this page?'
- }),
- Uq(Fq(i), 'hasUnsavedChanges', function () {
- return i.state.badges.some(function (e) {
- return e.hasChanges
- }) || i.state.hasRemovedBadge
- }),
- Uq(Fq(i), 'hasBadgesFeature', function () {
- return !!(i.props.forumDetails && i.props.forumDetails.features && i.props.forumDetails.features.badges)
- }),
- Uq(Fq(i), 'getBadgeById', function (t) {
- var e = i.state.badges.filter(function (e) {
- return e.id === t
- });
- return e.length ? e[0] : null
- }),
- Uq(Fq(i), 'getChangedFields', function (t) {
- var e = [
- 'image',
- 'name',
- 'criteria',
- 'target'
- ];
- if (t.isNew) return e;
- var n = i.state.savedBadges.filter(function (e) {
- return e.id === t.id
- }).pop() || {
- };
- return e.filter(function (e) {
- return n[e] !== t[e]
- })
- }),
- Uq(Fq(i), 'updateBadgesData', function (e) {
- return e.length ? e.map(function (e) {
- return jq(jq({
- }, e), {
- }, {
- imageFile: null,
- imageErrors: [
- ],
- isNew: !1,
- isInvalid: !1,
- hasChanges: !1
- })
- }) : i.state.badges.length ? i.state.badges : [
- jq(jq({
- }, mC), {
- }, {
- id: i.generateBadgeId()
- })
- ]
- }),
- Uq(Fq(i), 'generateBadgeId', function () {
- for (var e = null; !e || i.getBadgeById(e); ) e = Math.floor(10 * Math.random()) + We.MAX_BADGE_COUNT;
- return e
- }),
- Uq(Fq(i), 'getTrackingData', function () {
- var e = i.state.badges.map(function (e) {
- return je.a.pick(e, 'id', 'image', 'name', 'criteria', 'target', 'forum')
- });
- return {
- zone: 'badges',
- section: 'settings',
- verb: 'update',
- object_type: 'forum',
- object_id: i.props.selection.forum.id,
- area: 'modal',
- extra_data: {
- badgesEnabled: {
- before: i.state.badgesEnabled,
- after: null
- },
- badges: {
- before: e,
- after: null
- }
- }
- }
- }),
- Uq(Fq(i), 'emitEvent', function (e) {
- e.extra_data = JSON.stringify(e.extra_data),
- i.props.emitTrackingEvent(e)
- }),
- Uq(Fq(i), 'createBadge', function () {
- var t = i.generateBadgeId();
- i.setState(function (e) {
- return {
- badges: [
- ].concat(xq(e.badges), [
- jq(jq({
- }, mC), {
- }, {
- id: t,
- hasChanges: !1
- })
- ]),
- hasInvalidBadges: !0,
- highlightInvalidFields: !1
- }
- })
- }),
- Uq(Fq(i), 'removeBadge', function (a, e) {
- var r = i.getBadgeById(a);
- r || e ? i.setState(function (e) {
- var t = e.badges.filter(function (e) {
- return e.id !== a
- }),
- n = t.some(function (e) {
- return e.isInvalid
- });
- return {
- hasInvalidBadges: n,
- badges: t,
- modal: {
- },
- hasRemovedBadge: e.hasRemovedBadge || !r.isNew,
- errors: n ? e.errors : [
- ]
- }
- }) : i.openModal(cC, r, i.removeBadge.bind(Fq(i), a, !0))
- }),
- Uq(Fq(i), 'handleBadgeChange', function (n, e, t) {
- var a = i.getBadgeById(n),
- r = jq(jq({
- }, a), e),
- o = i.getChangedFields(r);
- !e.criteria || r.isNew || !~o.indexOf('criteria') || t ? i.setState(function (e) {
- var t = e.badges.findIndex(function (e) {
- return e.id === n
- }),
- t = [
- ].concat(xq(e.badges.slice(0, t)), [
- jq(jq({
- imageErrors: [
- ]
- }, r), {
- }, {
- isInvalid: !Mq(r),
- hasChanges: 0 < o.length
- })
- ], xq(e.badges.slice(t + 1)));
- return {
- badges: t,
- hasNewImages: e.hasNewImages || !!~o.indexOf('image'),
- hasInvalidBadges: t.some(function (e) {
- return e.isInvalid
- }),
- modal: {
- },
- errors: [
- ]
- }
- }) : i.openModal(uC, a, i.handleBadgeChange.bind(Fq(i), a.id, e, !0))
- }),
- Uq(Fq(i), 'uploadBadgeImages', function () {
- i.props.uploadImages({
- data: {
- badges: i.state.badges
- },
- onSuccess: function (n) {
- var e = n.length ? i.state.badges.map(function (e, t) {
- return jq(jq({
- }, e), n[t])
- }) : i.state.badges;
- i.setState({
- badges: e,
- hasNewImages: !1,
- hasInvalidBadges: !1
- }, i.saveBadges)
- }
- })
- }),
- Uq(Fq(i), 'saveBadges', function () {
- var t;
- i.state.badgesEnabled ? i.state.hasInvalidBadges ? i.setState(function () {
- return {
- highlightInvalidFields: !0,
- errors: [
- 'Unable to save these changes because you have one or more invalid badge field. Fix the highlighted fields and try again.'
- ]
- }
- }) : i.state.hasNewImages ? i.uploadBadgeImages() : (t = i.getTrackingData(), i.setState(function () {
- i.props.saveBadges({
- forum: i.props.selection.forum.shortname,
- data: {
- badges: i.state.badges.map(function (e) {
- return {
- id: e.isNew ? null : e.id,
- name: e.name,
- image: e.image,
- criteria: e.criteria,
- target: e.target
- }
- })
- },
- onSuccess: function (e) {
- t.extra_data.badgesEnabled.after = e.badgesEnabled,
- t.extra_data.badges.after = e.badges,
- i.emitEvent(t)
- }
- })
- })) : i.toggleBadgesEnabled(!1)
- }),
- Uq(Fq(i), 'toggleBadgesEnabled', function (e) {
- var t;
- i.state.badgesEnabled && !e ? i.openModal(pC, null, i.toggleBadgesEnabled.bind(Fq(i), !0)) : (t = i.getTrackingData(), i.props.toggleBadges({
- forum: i.props.selection.forum.shortname,
- data: {
- badgesEnabled: i.state.badgesEnabled ? 0 : 1
- },
- onSuccess: function (e) {
- t.verb = e.badgesEnabled ? 'enable' : 'disable',
- t.extra_data.badgesEnabled.after = e.badgesEnabled,
- i.emitEvent(t)
- }
- }))
- }),
- Uq(Fq(i), 'openModal', function (e, t, n) {
- i.setState({
- modal: {
- type: e,
- badge: t,
- onConfirm: n
- }
- })
- }),
- Uq(Fq(i), 'closeModal', function () {
- i.setState({
- modal: {
- }
- })
- }),
- Uq(Fq(i), 'getBadgesModal', function () {
- return i.state.modal.type === cC || i.state.modal.type === uC ? C.a.createElement(kq, Rq({
- }, i.state.modal, {
- onClose: i.closeModal
- })) : i.state.modal.type === pC ? C.a.createElement(Nq, Rq({
- }, i.state.modal, {
- onClose: i.closeModal
- })) : void 0
- }),
- i
- }
- return e = r,
- (t = [
- {
- key: 'componentDidMount',
- value: function () {
- this.props.history.setRouteLeaveHook(this.props.route, this.confirmNavigationIfUnsaved),
- window.onbeforeunload = this.confirmNavigationIfUnsaved,
- this.props.emitTrackingEvent({
- verb: 'view',
- object_type: 'page',
- object_id: ''.concat(window.document.location.host).concat(window.document.location.pathname)
- }),
- this.props.forumDetails ? this.hasBadgesFeature() && this.props.fetchBadges(this.props.selection.forum.shortname) : this.props.fetchForumDetails()
- }
- },
- {
- key: 'componentWillReceiveProps',
- value: function (t) {
- var n = {
- };
- !this.hasBadgesFeature() || t.isFetching || this.props.isFetched || t.isFetched || this.props.fetchBadges(this.props.selection.forum.shortname),
- this.props.isFetching && !t.isFetching ? n.savedBadges = t.badgesSynced : this.props.isToggling && !t.isToggled && t.badgesEnabledSynced && this.hasUnsavedChanges() ? this.saveBadges() : this.props.isSaving && t.isSaved && (n.savedBadges = t.badgesSynced, n.hasRemovedBadge = !1),
- (t.errors || t.forumDetailsError) && (n.errors = t.errors, t.forumDetailsError && n.errors.push(t.forumDetailsError)),
- n.badges = this.updateBadgesData(t.badgesSynced),
- this.setState(function (e) {
- return jq(jq({
- }, n), {
- }, {
- badgesEnabled: void 0 === t.badgesEnabledSynced ? e.badgesEnabled : t.badgesEnabledSynced,
- highlightInvalidFields: !1,
- errors: t.errors,
- modal: {
- }
- })
- })
- }
- },
- {
- key: 'render',
- value: function () {
- var t = this;
- if (!this.props.forumDetails && !this.props.forumDetailsError || this.props.forumDetailsIsFetching || this.props.isFetching) return C.a.createElement(Ji, null);
- var e = this.hasUnsavedChanges() && !(this.state.highlightInvalidFields && this.state.hasInvalidBadges),
- n = this.hasBadgesFeature();
- return C.a.createElement('div', null, n ? null : C.a.createElement(ch, {
- headline: 'Looking to create badges for your website?',
- promotionalPlan: 'Disqus Pro',
- planDetailsUrl: 'https://disqus.com/pricing/',
- upsellMessageLeft: 'Upgrade to',
- upsellMessageRight: ' to create and award badges for your audience.',
- selection: this.props.selection,
- emitTrackingEvent: this.props.emitTrackingEvent
- }), C.a.createElement('div', {
- className: 'settings-badges'
- }, C.a.createElement('div', {
- className: 'content__wrap spacing-bottom-double'
- }, C.a.createElement('header', {
- className: 'settings__header'
- }, C.a.createElement('h2', {
- className: 'text-larger text-gray-darker spacing-bottom-small'
- }, 'Configure Badges'), C.a.createElement('p', {
- className: 'text-gray'
- }, 'Create custom badges to reward engagement on your site. ', C.a.createElement('a', {
- href: Pn.badges,
- target: '_blank',
- rel: 'noopener noreferrer'
- }, 'Learn more »'))), C.a.createElement('section', {
- className: 'settings__content'
- }, C.a.createElement('header', null, C.a.createElement('p', {
- className: 'text-gray text-medium'
- }, 'Define up to ', We.MAX_BADGE_COUNT, ' badges that you would like to award to commenters on your website. A badge can be awarded manually or automatically based on one of the provided criteria.'), C.a.createElement('p', {
- className: 'text-gray text-medium'
- }, C.a.createElement('b', null, 'Having trouble coming up with badge images?'), ' You can download a collection of images ', C.a.createElement('a', {
- href: Pn.badgesImageCollection,
- target: '_blank',
- rel: 'noopener noreferrer'
- }, 'here'), '.')), this.state.errors && this.state.errors.length || this.props.error ? C.a.createElement(Ki, {
- message: this.state.errors && this.state.errors.length ? C.a.createElement('span', null, this.state.errors.map(function (e, t) {
- return C.a.createElement('span', {
- key: t
- }, e, C.a.createElement('br', null))
- })) : this.props.error,
- alertType: 'error'
- }) : null, C.a.createElement('div', {
- className: 'badges-section spacing-top'
- }, C.a.createElement('div', {
- className: 'rows__container'
- }, C.a.createElement('div', {
- className: 'badges-input-header row text-gray-dark text-medium'
- }, C.a.createElement('span', {
- className: 'image-header align--wrap'
- }, 'Image', C.a.createElement(Md, {
- tooltipKey: 'badge_images',
- content: 'We recommend a small, distinctive image to make sure the badge is discernible when displayed next to a username.\n (Max size: '.concat(lC / 1000, 'KB)')
- })), C.a.createElement('span', {
- className: 'badges-header-group'
- }, C.a.createElement('span', {
- className: 'name-header align--wrap spacing-left'
- }, 'Name'), C.a.createElement('span', {
- className: 'criteria-header align--wrap spacing-left'
- }, 'Criteria', C.a.createElement(Md, {
- tooltipKey: 'badge_criteria',
- content: 'The criteria will only apply to future engagement and will not reflect activity prior to the badge creation.'
- })), C.a.createElement('span', {
- className: 'target-header align--wrap spacing-left'
- }, 'Target', C.a.createElement(Md, {
- tooltipKey: 'badge_target',
- content: 'Changing the target will not remove the badge from users that have already received it.'
- })))), this.state.badges ? this.state.badges.map(function (e) {
- return C.a.createElement(Pq, Rq({
- }, e, {
- key: e.id,
- onChange: t.handleBadgeChange.bind(t, e.id),
- removeBadge: t.removeBadge.bind(t, e.id, !1),
- isBadgeValid: Mq.bind(t, e),
- highlightInvalid: t.state.highlightInvalidFields
- }))
- }) : null, C.a.createElement('div', {
- className: 'add-row align spacing-top-narrow'
- }, C.a.createElement('button', {
- className: 'button button-fill--brand button-small',
- onClick: this.createBadge,
- disabled: We.MAX_BADGE_COUNT <= this.state.badges.length
- }, '+ Add badge'))))), C.a.createElement('footer', {
- className: 'settings__footer'
- }, C.a.createElement(Bh, {
- onClick: this.saveBadges,
- buttonLabel: this.state.badgesEnabled && n ? 'Save' : 'Enable Badges on your site',
- disabled: this.state.badgesEnabled ? !e : !n,
- fieldsetAdditionalClass: 'unset-width',
- isSaving: this.props.isSaving,
- isSaved: this.props.isSaved,
- saveErr: !!this.state.errors.length
- }))), this.state.badgesEnabled ? C.a.createElement('div', {
- className: 'content__wrap'
- }, C.a.createElement('header', {
- className: 'settings__header disable-section align align--between align--middle'
- }, C.a.createElement('div', {
- className: 'spacing-right-large'
- }, C.a.createElement('h2', {
- className: 'text-larger text-gray-darker spacing-bottom-small'
- }, 'Disable Badges'), C.a.createElement('p', {
- className: 'text-gray'
- }, 'The badges will be removed from all commenters on your site.')), C.a.createElement('div', {
- className: 'align__item--no-shrink'
- }, C.a.createElement('button', {
- className: 'button button-fill--red button-medium',
- onClick: this.toggleBadgesEnabled.bind(this, !1)
- }, 'Turn Badges off')))) : null, this.getBadgesModal()))
- }
- }
- ]) && Tq(e.prototype, t),
- n && Tq(e, n),
- r
- }();
- Uq(go, 'displayName', 'ForumSettingsBadges'),
- Uq(go, 'propTypes', {
- selection: ht.isRequired,
- badgesEnabledSynced: b.a.bool,
- badgesSynced: b.a.arrayOf(b.a.shape(sl)),
- isFetching: b.a.bool,
- isFetched: b.a.bool,
- isSaving: b.a.bool,
- isSaved: b.a.bool,
- error: b.a.string,
- toggleBadges: b.a.func.isRequired,
- fetchBadges: b.a.func.isRequired,
- uploadImages: b.a.func.isRequired,
- saveBadges: b.a.func.isRequired,
- emitTrackingEvent: b.a.func.isRequired,
- forumDetails: $c,
- forumDetailsError: b.a.string,
- forumDetailsIsFetching: b.a.bool,
- fetchForumDetails: b.a.func.isRequired,
- saasFeatures: b.a.objectOf(b.a.objectOf(b.a.bool)).isRequired,
- history: b.a.shape({
- push: b.a.func.isRequired,
- setRouteLeaveHook: b.a.func.isRequired
- }).isRequired,
- route: b.a.object
- });
- var F = Object(u.connect) (function (e) {
- var t = e.badges,
- n = e.saasFeatures,
- a = e.selection;
- return jq(jq({
- forumDetails: e.forumDetails.forumDetails
- }, t), {
- }, {
- badgesEnabledSynced: t.badgesEnabled,
- badgesSynced: t.badges,
- saasFeatures: n,
- selection: a
- })
- }, jq(jq({
- fetchForumDetails: ig
- }, Wi), {
- }, {
- emitTrackingEvent: Xo({
- zone: 'badges',
- section: 'settings'
- })
- })) (Fo() (go)),
- yl = n(520),
- Bq = n.n(yl),
- Ru = n(521),
- zq = n.n(Ru),
- Hq = n(54),
- Gq = 10,
- Vq = 20,
- r = b.a.shape({
- text: b.a.string.isRequired,
- votes: b.a.number,
- imageUrl: b.a.string,
- imageID: b.a.number,
- isSelected: b.a.bool,
- errs: b.a.shape({
- text: b.a.bool,
- imageUrl: b.a.bool,
- imageID: b.a.bool
- })
- }),
- sl = b.a.shape({
- imageUrl: b.a.string.isRequired,
- imageID: b.a.number.isRequired
- }),
- Wq = 'You must have least 2 reactions',
- Yq = 'You may not have more than 6 reactions',
- Qq = 'You must select an image for each reaction',
- Kq = 'You must enter a description for each reaction',
- Jq = 'You may not use the same image more than once',
- $q = 'You may not use the same description more than once';
- function Zq(t, e) {
- var n,
- a = Object.keys(t);
- return Object.getOwnPropertySymbols && (n = Object.getOwnPropertySymbols(t), e && (n = n.filter(function (e) {
- return Object.getOwnPropertyDescriptor(t, e).enumerable
- })), a.push.apply(a, n)),
- a
- }
- function Xq(a) {
- for (var e = 1; e < arguments.length; e++) {
- var r = null != arguments[e] ? arguments[e] : {
- };
- e % 2 ? Zq(Object(r), !0).forEach(function (e) {
- var t,
- n;
- n = r[t = e],
- t in (e = a) ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(a, Object.getOwnPropertyDescriptors(r)) : Zq(Object(r)).forEach(function (e) {
- Object.defineProperty(a, e, Object.getOwnPropertyDescriptor(r, e))
- })
- }
- return a
- }
- function eF(e) {
- return (e().selection.forum || {
- }).shortname
- }
- Wi = {
- fetchReactions: function () {
- return function (t, e) {
- e = eF(e);
- e && (t({
- type: me.fetchReactions
- }), io.a.call('threadReactions/loadTemplateAndImages', {
- data: {
- forum: e
- },
- success: function (e) {
- t(Xq({
- type: me.onFetch
- }, e.response))
- },
- error: function () {
- t({
- type: me.onError,
- message: 'An unknown error occurred trying to fetch your reactions'
- })
- }
- }))
- }
- },
- fetchDefaultReactions: function () {
- return function (t) {
- io.a.call('threadReactions/getDefaultImages', {
- success: function (e) {
- var n;
- t({
- type: me.onFetchDefaultReactions,
- payload: Object.keys(n = e.response).map(function (e, t) {
- return {
- imageID: t + 1,
- imageUrl: n[e].url,
- text: n[e].reaction_text
- }
- })
- })
- },
- error: function () {
- t({
- type: me.onError,
- message: 'An unknown error occurred fetching default reactions'
- })
- }
- })
- }
- },
- validateReactions: function (e) {
- var l = e.reactions,
- c = e.existingErrors;
- return function () {
- var a,
- r,
- e,
- o,
- i,
- s,
- n = {
- },
- t = void 0 !== c;
- return t || l.forEach(function (e) {
- e.errors = {
- }
- }),
- l.length < 2 ? n[Wq] = !0 : 6 < l.length && (n[Yq] = !0),
- r = 'imageUrl',
- e = t,
- o = [
- ],
- i = [
- ],
- s = {
- },
- (a = l).forEach(function (e, t) {
- var n = 'imageUrl' === r ? je.a.last(e[r].split('/')).split('-') [0].split('.') [0] : e[r];
- n && n.trim() || (o.push('imageUrl' === r ? Qq : Kq), i.push(e)),
- s.hasOwnProperty(n) ? (o.push('imageUrl' === r ? Jq : $q), i.push(e), (e = a[s[n]]) && i.push(e)) : s[n] = t
- }),
- e ? a.forEach(function (e) {
- e.errors && e.errors[r] && !~i.indexOf(e) && (e.errors[r] = !1)
- }) : i.forEach(function (e) {
- e.errors = e.errors || {
- },
- e.errors[r] = !0
- }),
- o.forEach(function (e) {
- n[e] = !0
- }),
- Object.keys(n).length ? t ? c && c.reduce(function (e, t) {
- return n[t] && e.push(t),
- e
- }, [
- ]) : Object.keys(n) : null
- }
- },
- saveReactions: function (e) {
- var n = e.data,
- a = e.onSuccess,
- r = e.onError;
- return function (t, e) {
- e = eF(e);
- e && (t({
- type: me.saveReactions
- }), io.a.call('threadReactions/saveTemplate', {
- type: 'POST',
- data: Xq({
- forum: e
- }, n),
- success: function (e) {
- t({
- type: me.onSave
- }),
- a && a(e)
- },
- error: function (e) {
- t({
- type: me.onError,
- message: 'An error occurred trying to save your reactions'
- }),
- r && r(e)
- }
- }))
- }
- },
- setReactionsEnabled: function (e) {
- var n = e.enabled,
- a = e.onSuccess,
- r = e.onError;
- return function (t, e) {
- e = eF(e);
- e && (t({
- type: me.saveReactions
- }), io.a.call('threadReactions/enableForForum', {
- type: 'POST',
- data: {
- forum: e,
- disable: n ? 0 : 1
- },
- success: function (e) {
- t({
- type: me.onSave
- }),
- a && a(e)
- },
- error: function (e) {
- t({
- type: me.onError,
- message: 'An error occurred trying to '.concat(n ? 'enable' : 'disable', ' your reactions')
- }),
- r && r(e)
- }
- }))
- }
- }
- };
- function tF(e) {
- return (tF = 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator ? function (e) {
- return typeof e
- }
- : function (e) {
- return e && 'function' == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? 'symbol' : typeof e
- }) (e)
- }
- function nF(e, t) {
- for (var n = 0; n < t.length; n++) {
- var a = t[n];
- a.enumerable = a.enumerable || !1,
- a.configurable = !0,
- 'value' in a && (a.writable = !0),
- Object.defineProperty(e, a.key, a)
- }
- }
- function aF(e, t) {
- return (aF = Object.setPrototypeOf || function (e, t) {
- return e.__proto__ = t,
- e
- }) (e, t)
- }
- function rF(n) {
- var a = function () {
- if ('undefined' == typeof Reflect || !Reflect.construct) return !1;
- if (Reflect.construct.sham) return !1;
- if ('function' == typeof Proxy) return !0;
- try {
- return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [
- ], function () {
- })),
- !0
- } catch (e) {
- return !1
- }
- }();
- return function () {
- var e,
- t = iF(n);
- return e = a ? (e = iF(this).constructor, Reflect.construct(t, arguments, e)) : t.apply(this, arguments),
- t = this,
- !(e = e) || 'object' !== tF(e) && 'function' != typeof e ? oF(t) : e
- }
- }
- function oF(e) {
- if (void 0 === e) throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called');
- return e
- }
- function iF(e) {
- return (iF = Object.setPrototypeOf ? Object.getPrototypeOf : function (e) {
- return e.__proto__ || Object.getPrototypeOf(e)
- }) (e)
- }
- function sF(e, t, n) {
- return t in e ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n,
- e
- }
- go = function () {
- !function (e, t) {
- if ('function' != typeof t && null !== t) throw new TypeError('Super expression must either be null or a function');
- e.prototype = Object.create(t && t.prototype, {
- constructor: {
- value: e,
- writable: !0,
- configurable: !0
- }
- }),
- t && aF(e, t)
- }(o, A);
- var e,
- t,
- n,
- r = rF(o);
- function o() {
- var e;
- !function (e, t) {
- if (!(e instanceof t)) throw new TypeError('Cannot call a class as a function')
- }(this, o);
- for (var t = arguments.length, n = Array(t), a = 0; a < t; a++) n[a] = arguments[a];
- return sF(oF(e = r.call.apply(r, [
- this
- ].concat(n))), 'onDelete', function () {
- e.props.closeModal(),
- e.props.deleteImages()
- }),
- e
- }
- return e = o,
- (t = [
- {
- key: 'render',
- value: function () {
- return C.a.createElement('div', null, C.a.createElement(_.a, {
- isOpen: this.props.isOpen,
- onRequestClose: this.props.closeModal,
- contentLabel: 'Delete Confirmation',
- className: 'admin-modal__custom-images padding-double'
- }, C.a.createElement('h2', null, 'Do you want to delete '.concat(this.props.isMultiple ? 'these reactions' : 'this reaction', '?')), C.a.createElement('div', null, C.a.createElement('button', {
- onClick: this.onDelete,
- className: 'button button-fill--red button-small'
- }, 'Delete'), C.a.createElement('button', {
- onClick: this.props.closeModal,
- className: 'button button-fill--brand button-small'
- }, 'Cancel'))))
- }
- }
- ]) && nF(e.prototype, t),
- n && nF(e, n),
- o
- }();
- sF(go, 'propTypes', {
- deleteImages: b.a.func.isRequired,
- isOpen: b.a.bool.isRequired,
- closeModal: b.a.func.isRequired,
- isMultiple: b.a.bool.isRequired
- });
- var lF = go;
- function cF(e) {
- return (cF = 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator ? function (e) {
- return typeof e
- }
- : function (e) {
- return e && 'function' == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? 'symbol' : typeof e
- }) (e)
- }
- function uF(e, t) {
- for (var n = 0; n < t.length; n++) {
- var a = t[n];
- a.enumerable = a.enumerable || !1,
- a.configurable = !0,
- 'value' in a && (a.writable = !0),
- Object.defineProperty(e, a.key, a)
- }
- }
- function pF(e, t) {
- return (pF = Object.setPrototypeOf || function (e, t) {
- return e.__proto__ = t,
- e
- }) (e, t)
- }
- function dF(n) {
- var a = function () {
- if ('undefined' == typeof Reflect || !Reflect.construct) return !1;
- if (Reflect.construct.sham) return !1;
- if ('function' == typeof Proxy) return !0;
- try {
- return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [
- ], function () {
- })),
- !0
- } catch (e) {
- return !1
- }
- }();
- return function () {
- var e,
- t = fF(n);
- return e = a ? (e = fF(this).constructor, Reflect.construct(t, arguments, e)) : t.apply(this, arguments),
- t = this,
- !(e = e) || 'object' !== cF(e) && 'function' != typeof e ? mF(t) : e
- }
- }
- function mF(e) {
- if (void 0 === e) throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called');
- return e
- }
- function fF(e) {
- return (fF = Object.setPrototypeOf ? Object.getPrototypeOf : function (e) {
- return e.__proto__ || Object.getPrototypeOf(e)
- }) (e)
- }
- function hF(e, t, n) {
- return t in e ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n,
- e
- }
- yl = function () {
- !function (e, t) {
- if ('function' != typeof t && null !== t) throw new TypeError('Super expression must either be null or a function');
- e.prototype = Object.create(t && t.prototype, {
- constructor: {
- value: e,
- writable: !0,
- configurable: !0
- }
- }),
- t && pF(e, t)
- }(o, A);
- var e,
- t,
- n,
- r = dF(o);
- function o() {
- var e;
- !function (e, t) {
- if (!(e instanceof t)) throw new TypeError('Cannot call a class as a function')
- }(this, o);
- for (var t = arguments.length, n = Array(t), a = 0; a < t; a++) n[a] = arguments[a];
- return hF(mF(e = r.call.apply(r, [
- this
- ].concat(n))), 'onClickDeletableReactions', function () {
- e.props.toggleImageSelection(e.props.id),
- e.props.clearHighlight(e.props.id),
- e.props.numHighlightedImages || e.props.updateErrorMessage('')
- }),
- hF(mF(e), 'onClickNoneDeletableReaction', function () {
- return e.props.updateErrorMessage('You may not delete images currently used in the template.')
- }),
- e
- }
- return e = o,
- (t = [
- {
- key: 'componentWillReceiveProps',
- value: function (e) {
- this.props.isDeletable !== e.isDeletable && !e.isDeletable && e.selected && this.props.toggleImageSelection(this.props.id)
- }
- },
- {
- key: 'render',
- value: function () {
- return C.a.createElement('div', {
- className: 'custom-image'.concat(this.props.selected && this.props.isDeletable ? '-selected' : this.props.highlighted ? '-highlighted' : ''),
- key: this.props.id
- }, C.a.createElement('img', {
- src: this.props.url,
- onClick: this.props.isDeletable ? this.onClickDeletableReactions : this.onClickNoneDeletableReaction
- }))
- }
- }
- ]) && uF(e.prototype, t),
- n && uF(e, n),
- o
- }();
- hF(yl, 'propTypes', {
- id: b.a.number.isRequired,
- url: b.a.string.isRequired,
- toggleImageSelection: b.a.func.isRequired,
- clearHighlight: b.a.func.isRequired,
- isDeletable: b.a.bool.isRequired,
- updateErrorMessage: b.a.func.isRequired,
- selected: b.a.bool.isRequired,
- highlighted: b.a.bool.isRequired,
- numHighlightedImages: b.a.number.isRequired
- });
- var gF = yl;
- function yF(e) {
- return (yF = 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator ? function (e) {
- return typeof e
- }
- : function (e) {
- return e && 'function' == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? 'symbol' : typeof e
- }) (e)
- }
- function bF(e, t) {
- for (var n = 0; n < t.length; n++) {
- var a = t[n];
- a.enumerable = a.enumerable || !1,
- a.configurable = !0,
- 'value' in a && (a.writable = !0),
- Object.defineProperty(e, a.key, a)
- }
- }
- function vF(e, t) {
- return (vF = Object.setPrototypeOf || function (e, t) {
- return e.__proto__ = t,
- e
- }) (e, t)
- }
- function _F(n) {
- var a = function () {
- if ('undefined' == typeof Reflect || !Reflect.construct) return !1;
- if (Reflect.construct.sham) return !1;
- if ('function' == typeof Proxy) return !0;
- try {
- return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [
- ], function () {
- })),
- !0
- } catch (e) {
- return !1
- }
- }();
- return function () {
- var e,
- t = OF(n);
- return e = a ? (e = OF(this).constructor, Reflect.construct(t, arguments, e)) : t.apply(this, arguments),
- t = this,
- !(e = e) || 'object' !== yF(e) && 'function' != typeof e ? EF(t) : e
- }
- }
- function EF(e) {
- if (void 0 === e) throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called');
- return e
- }
- function OF(e) {
- return (OF = Object.setPrototypeOf ? Object.getPrototypeOf : function (e) {
- return e.__proto__ || Object.getPrototypeOf(e)
- }) (e)
- }
- function SF(e, t, n) {
- return t in e ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n,
- e
- }
- Ru = function () {
- !function (e, t) {
- if ('function' != typeof t && null !== t) throw new TypeError('Super expression must either be null or a function');
- e.prototype = Object.create(t && t.prototype, {
- constructor: {
- value: e,
- writable: !0,
- configurable: !0
- }
- }),
- t && vF(e, t)
- }(o, A);
- var e,
- t,
- n,
- a = _F(o);
- function o() {
- var r;
- !function (e, t) {
- if (!(e instanceof t)) throw new TypeError('Cannot call a class as a function')
- }(this, o);
- for (var e = arguments.length, t = Array(e), n = 0; n < e; n++) t[n] = arguments[n];
- return SF(EF(r = a.call.apply(a, [
- this
- ].concat(t))), 'state', {
- isLoading: !1,
- enabled: !0
- }),
- SF(EF(r), 'fileSelectedHandler', function (e) {
- if (e.target.files.length) {
- var t = [
- ],
- n = e.target.files.length;
- if (Gq < n + r.props.numImages) r.props.updateErrorMessage('You can have up to '.concat(Gq, ' images'));
- else {
- r.setState({
- isLoading: !0,
- enabled: !1
- });
- for (var a = 0; a < n; a++) cq.a.uploadMediaUrl([e.target.files[a]]).then(function (e) {
- t.push(e.get('url')),
- t.length === n && r.saveUrlsToDb(t)
- }).catch(function (e) {
- var t = (t = e && e.code ? Hq.UPLOAD_IMAGE_ERROR_MESSAGES[e.code] : t) || JSON.parse(e.responseText).response;
- r.props.updateErrorMessage(t),
- r.setState({
- isLoading: !1
- })
- })
- }
- }
- }),
- SF(EF(r), 'saveUrlsToDb', function (e) {
- io.a.call('threadReactions/createImages', {
- type: 'POST',
- data: {
- urls: e,
- forum: r.props.forum
- },
- success: function (e) {
- e = e.response;
- e.images.length && (t = e.images.map(function (e) {
- return {
- imageID: e.id,
- imageUrl: e.url
- }
- }), r.props.addNewCustomImages(t));
- var t = '';
- e.duplicateImageIds.length ? (t = 'Duplicate reactions are not allowed.', r.props.highlightDuplicateImages(e.duplicateImageIds)) : e.invalidUrls.length && (t = 'Invalid image url(s)'),
- t && r.props.updateErrorMessage(t)
- },
- error: function (e) {
- r.props.updateErrorMessage(JSON.parse(e.responseText).response)
- }
- }),
- r.setState(function (e) {
- return {
- isLoading: !1,
- enabled: e.numImages < Gq
- }
- })
- }),
- SF(EF(r), 'onClick', function (e) {
- r.props.updateErrorMessage(''),
- r.props.clearHighlights(),
- r.props.clearSelectedIDs(),
- (e.target || e.srcElement).value.length || r.setState({
- enabled: !0
- })
- }),
- r
- }
- return e = o,
- (t = [
- {
- key: 'componentWillReceiveProps',
- value: function (e) {
- this.setState({
- enabled: e.numImages < Gq
- })
- }
- },
- {
- key: 'render',
- value: function () {
- return C.a.createElement(C.a.Fragment, null, C.a.createElement('div', {
- className: 'loading'.concat(this.state.isLoading ? '-show' : '-hide')
- }), C.a.createElement('div', {
- className: 'upload-button'.concat(this.state.enabled ? '' : '-disabled')
- }, C.a.createElement('input', {
- type: 'file',
- id: 'custom-reaction-input',
- className: 'custom-reaction-input',
- onChange: this.fileSelectedHandler,
- onClick: this.onClick,
- disabled: !this.state.enabled,
- accept: 'image/*',
- multiple: !0,
- value: ''
- }), C.a.createElement('label', {
- htmlFor: 'custom-reaction-input'
- }, C.a.createElement('img', {
- src: '//c.disquscdn.com/next/current/publisher-admin/assets/img/add-avatar-plus.svg',
- className: 'custom-reaction-upload-icon',
- alt: 'Upload a Custom Reaction'
- }))))
- }
- }
- ]) && bF(e.prototype, t),
- n && bF(e, n),
- o
- }();
- SF(Ru, 'propTypes', {
- forum: b.a.string.isRequired,
- updateErrorMessage: b.a.func.isRequired,
- addNewCustomImages: b.a.func.isRequired,
- highlightDuplicateImages: b.a.func.isRequired,
- clearHighlights: b.a.func.isRequired,
- numImages: b.a.number.isRequired,
- clearSelectedIDs: b.a.func.isRequired
- });
- var wF = Ru;
- function PF(e) {
- return (PF = 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator ? function (e) {
- return typeof e
- }
- : function (e) {
- return e && 'function' == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? 'symbol' : typeof e
- }) (e)
- }
- function kF(e) {
- return function (e) {
- if (Array.isArray(e)) return NF(e)
- }(e) || function (e) {
- if ('undefined' != typeof Symbol && null != e[Symbol.iterator] || null != e['@@iterator']) return Array.from(e)
- }(e) || function (e, t) {
- if (e) {
- if ('string' == typeof e) return NF(e, t);
- var n = Object.prototype.toString.call(e).slice(8, - 1);
- return 'Map' === (n = 'Object' === n && e.constructor ? e.constructor.name : n) || 'Set' === n ? Array.from(e) : 'Arguments' === n || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n) ? NF(e, t) : void 0
- }
- }(e) || function () {
- throw new TypeError('Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.')
- }()
- }
- function NF(e, t) {
- for (var n = 0, a = Array(t = null == t || e.length < t ? e.length : t); n < t; n++) a[n] = e[n];
- return a
- }
- function CF(e, t) {
- for (var n = 0; n < t.length; n++) {
- var a = t[n];
- a.enumerable = a.enumerable || !1,
- a.configurable = !0,
- 'value' in a && (a.writable = !0),
- Object.defineProperty(e, a.key, a)
- }
- }
- function RF(e, t) {
- return (RF = Object.setPrototypeOf || function (e, t) {
- return e.__proto__ = t,
- e
- }) (e, t)
- }
- function xF(n) {
- var a = function () {
- if ('undefined' == typeof Reflect || !Reflect.construct) return !1;
- if (Reflect.construct.sham) return !1;
- if ('function' == typeof Proxy) return !0;
- try {
- return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [
- ], function () {
- })),
- !0
- } catch (e) {
- return !1
- }
- }();
- return function () {
- var e,
- t = DF(n);
- return e = a ? (e = DF(this).constructor, Reflect.construct(t, arguments, e)) : t.apply(this, arguments),
- t = this,
- !(e = e) || 'object' !== PF(e) && 'function' != typeof e ? AF(t) : e
- }
- }
- function AF(e) {
- if (void 0 === e) throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called');
- return e
- }
- function DF(e) {
- return (DF = Object.setPrototypeOf ? Object.getPrototypeOf : function (e) {
- return e.__proto__ || Object.getPrototypeOf(e)
- }) (e)
- }
- function jF(e, t, n) {
- return t in e ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n,
- e
- }
- go = function () {
- !function (e, t) {
- if ('function' != typeof t && null !== t) throw new TypeError('Super expression must either be null or a function');
- e.prototype = Object.create(t && t.prototype, {
- constructor: {
- value: e,
- writable: !0,
- configurable: !0
- }
- }),
- t && RF(e, t)
- }(o, A);
- var e,
- t,
- n,
- r = xF(o);
- function o() {
- var n;
- !function (e, t) {
- if (!(e instanceof t)) throw new TypeError('Cannot call a class as a function')
- }(this, o);
- for (var e = arguments.length, t = Array(e), a = 0; a < e; a++) t[a] = arguments[a];
- return jF(AF(n = r.call.apply(r, [
- this
- ].concat(t))), 'state', {
- selectedIDs: [
- ],
- duplicateIDs: [
- ],
- errorMessage: '',
- isOpenConfirmDialog: !1
- }),
- jF(AF(n), 'toggleImageSelection', function (t) {
- n.state.selectedIDs.includes(t) ? n.setState(function (e) {
- return {
- selectedIDs: e.selectedIDs.filter(function (e) {
- return e !== t
- })
- }
- }) : n.setState(function (e) {
- return {
- selectedIDs: [
- ].concat(kF(e.selectedIDs), [
- t
- ])
- }
- })
- }),
- jF(AF(n), 'openConfirmDialog', function () {
- return n.setState({
- isOpenConfirmDialog: !0
- })
- }),
- jF(AF(n), 'closeConfirmDialog', function () {
- return n.setState({
- isOpenConfirmDialog: !1
- })
- }),
- jF(AF(n), 'deleteImages', function () {
- io.a.call('threadReactions/deleteImages', {
- type: 'POST',
- data: {
- imageIds: n.state.selectedIDs,
- forum: n.props.forum
- },
- success: function () {
- n.props.updateRemainingCustomImages(n.props.images.filter(function (t) {
- return !n.state.selectedIDs.some(function (e) {
- return e === t.imageID
- })
- })),
- n.resetSelectedIDs()
- },
- error: function (e) {
- n.updateErrorMessage(JSON.parse(e.responseText).response)
- }
- })
- }),
- jF(AF(n), 'resetSelectedIDs', function () {
- return n.setState({
- selectedIDs: [
- ]
- })
- }),
- jF(AF(n), 'resetDuplicateIDs', function () {
- return n.setState({
- duplicateIDs: [
- ]
- })
- }),
- jF(AF(n), 'updateErrorMessage', function (e) {
- return n.setState({
- errorMessage: e
- })
- }),
- jF(AF(n), 'highlightDuplicateImages', function (e) {
- return n.setState({
- duplicateIDs: e
- })
- }),
- jF(AF(n), 'clearHighlight', function (t) {
- n.state.duplicateIDs.includes(t) && n.setState(function (e) {
- return {
- duplicateIDs: e.duplicateIDs.filter(function (e) {
- return e !== t
- })
- }
- })
- }),
- jF(AF(n), 'closeAlertBar', function () {
- n.updateErrorMessage(''),
- n.resetDuplicateIDs()
- }),
- jF(AF(n), 'isImageDeletable', function (t) {
- return !(n.props.reactions.some(function (e) {
- return e.imageID === t.imageID || e.imageUrl === t.imageUrl
- }) || n.props.templateReactions.some(function (e) {
- return e.imageID === t.imageID || e.imageUrl === t.imageUrl
- }))
- }),
- n
- }
- return e = o,
- (t = [
- {
- key: 'render',
- value: function () {
- var t = this;
- return this.props.canEnableCustomReactions ? C.a.createElement('div', {
- className: 'content__wrap spacing-bottom-double'
- }, C.a.createElement('header', {
- className: 'settings__header'
- }, C.a.createElement('h2', {
- className: 'text-larger text-gray-darker spacing-bottom-small'
- }, 'Customize your Reactions'), C.a.createElement('p', {
- className: 'text-gray'
- }, 'Personalize reactions with your own images.')), C.a.createElement('section', {
- className: 'settings__content custom-images'
- }, this.state.errorMessage.length ? C.a.createElement(Ki, {
- message: this.state.errorMessage,
- alertType: 'error',
- onRequestClose: function () {
- return t.closeAlertBar()
- }
- }) : null, C.a.createElement(kf, {
- label: 'Custom Images',
- blockAdditionalClass: 'text-medium',
- tooltip: 'We recommend a square, distinctive image that is larger than 42x42px.'
- }, C.a.createElement('div', {
- className: 'spacing-top-narrow'
- }, C.a.createElement('div', {
- className: 'images-and-upload-button-block'
- }, this.props.images.map(function (e) {
- return C.a.createElement(gF, {
- key: e.imageID,
- id: e.imageID,
- url: e.imageUrl,
- toggleImageSelection: t.toggleImageSelection,
- isDeletable: t.isImageDeletable(e),
- updateErrorMessage: t.updateErrorMessage,
- selected: t.state.selectedIDs.includes(e.imageID),
- highlighted: t.state.duplicateIDs.includes(e.imageID),
- clearHighlight: t.clearHighlight,
- numHighlightedImages: t.state.duplicateIDs.length
- })
- }), C.a.createElement(wF, {
- forum: this.props.forum,
- addNewCustomImages: this.props.addNewCustomImages,
- updateErrorMessage: this.updateErrorMessage,
- numImages: this.props.images.length,
- clearSelectedIDs: this.resetSelectedIDs,
- highlightDuplicateImages: this.highlightDuplicateImages,
- clearHighlights: this.resetDuplicateIDs
- })), C.a.createElement('div', {
- className: 'delete-custom-image-btn'
- }, C.a.createElement('button', {
- onClick: this.openConfirmDialog,
- className: this.props.images.length ? 'button button-fill--red button-medium' : 'hide-btn',
- disabled: 0 === this.state.selectedIDs.length
- }, 'Delete'), C.a.createElement('p', {
- className: 'num-images-status text-gray'
- }, ''.concat(this.props.images.length, '/').concat(Gq))), C.a.createElement(lF, {
- deleteImages: this.deleteImages,
- isOpen: this.state.isOpenConfirmDialog,
- closeModal: this.closeConfirmDialog,
- isMultiple: 1 < this.state.selectedIDs.length
- }))))) : null
- }
- }
- ]) && CF(e.prototype, t),
- n && CF(e, n),
- o
- }();
- jF(go, 'propTypes', {
- images: b.a.arrayOf(sl).isRequired,
- forum: b.a.string.isRequired,
- updateRemainingCustomImages: b.a.func.isRequired,
- addNewCustomImages: b.a.func.isRequired,
- reactions: b.a.arrayOf(r).isRequired,
- templateReactions: b.a.arrayOf(r).isRequired,
- canEnableCustomReactions: b.a.bool.isRequired
- });
- var TF = go,
- yl = function (e) {
- var t = e.onConfirm,
- e = e.onClose;
- return C.a.createElement(_.a, {
- isOpen: !0,
- onRequestClose: e,
- className: 'admin-modal -clipped -wider',
- overlayClassName: 'modal-overlay -dark'
- }, C.a.createElement('div', {
- className: 'admin-modal__header align align--between padding-gutter'
- }, C.a.createElement('h3', {
- className: 'text-large'
- }, 'Turn Reactions off'), C.a.createElement('button', {
- className: 'link-gray',
- onClick: e
- }, C.a.createElement('span', {
- className: 'icon-cancel icon__position'
- }))), C.a.createElement('div', {
- className: 'admin-modal__content padding-gutter'
- }, C.a.createElement('div', null, 'Are you sure you want to turn reactions off? The Reactions widget will be removed from all new and prior articles on your site. Readers will no longer be able to add Reactions on articles.'), C.a.createElement('div', {
- className: 'spacing-top align align--between'
- }, C.a.createElement('button', {
- className: 'button button-medium button-fill',
- onClick: e
- }, 'Keep Reactions on'), C.a.createElement('button', {
- className: 'button button-medium button-fill--red',
- onClick: function () {
- return t({
- disableConfirmed: !0
- })
- }
- }, 'Yes, turn Reactions off'))))
- };
- yl.propTypes = {
- onConfirm: b.a.func.isRequired,
- onClose: b.a.func.isRequired
- };
- var IF = yl;
- function qF(e) {
- return (qF = 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator ? function (e) {
- return typeof e
- }
- : function (e) {
- return e && 'function' == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? 'symbol' : typeof e
- }) (e)
- }
- function FF(e, t) {
- for (var n = 0; n < t.length; n++) {
- var a = t[n];
- a.enumerable = a.enumerable || !1,
- a.configurable = !0,
- 'value' in a && (a.writable = !0),
- Object.defineProperty(e, a.key, a)
- }
- }
- function LF(e, t) {
- return (LF = Object.setPrototypeOf || function (e, t) {
- return e.__proto__ = t,
- e
- }) (e, t)
- }
- function UF(n) {
- var a = function () {
- if ('undefined' == typeof Reflect || !Reflect.construct) return !1;
- if (Reflect.construct.sham) return !1;
- if ('function' == typeof Proxy) return !0;
- try {
- return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [
- ], function () {
- })),
- !0
- } catch (e) {
- return !1
- }
- }();
- return function () {
- var e,
- t = BF(n);
- return e = a ? (e = BF(this).constructor, Reflect.construct(t, arguments, e)) : t.apply(this, arguments),
- t = this,
- !(e = e) || 'object' !== qF(e) && 'function' != typeof e ? MF(t) : e
- }
- }
- function MF(e) {
- if (void 0 === e) throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called');
- return e
- }
- function BF(e) {
- return (BF = Object.setPrototypeOf ? Object.getPrototypeOf : function (e) {
- return e.__proto__ || Object.getPrototypeOf(e)
- }) (e)
- }
- function zF(e, t, n) {
- return t in e ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n,
- e
- }
- Ru = function () {
- !function (e, t) {
- if ('function' != typeof t && null !== t) throw new TypeError('Super expression must either be null or a function');
- e.prototype = Object.create(t && t.prototype, {
- constructor: {
- value: e,
- writable: !0,
- configurable: !0
- }
- }),
- t && LF(e, t)
- }(o, A);
- var e,
- t,
- n,
- r = UF(o);
- function o() {
- var e;
- !function (e, t) {
- if (!(e instanceof t)) throw new TypeError('Cannot call a class as a function')
- }(this, o);
- for (var t = arguments.length, n = Array(t), a = 0; a < t; a++) n[a] = arguments[a];
- return zF(MF(e = r.call.apply(r, [
- this
- ].concat(n))), 'state', {
- applyRetroactively: !1
- }),
- zF(MF(e), 'toggleRetroactive', function () {
- e.setState(function (e) {
- return {
- applyRetroactively: !e.applyRetroactively
- }
- })
- }),
- zF(MF(e), 'onConfirm', function () {
- e.props.onConfirm({
- saveConfirmed: !0,
- applyRetroactively: e.state.applyRetroactively
- })
- }),
- e
- }
- return e = o,
- (t = [
- {
- key: 'render',
- value: function () {
- return C.a.createElement(_.a, {
- isOpen: !0,
- onRequestClose: this.props.onClose,
- className: 'admin-modal -clipped -wider ',
- overlayClassName: 'modal-overlay -dark'
- }, C.a.createElement('div', {
- className: 'admin-modal__header align align--between padding-gutter'
- }, C.a.createElement('h3', {
- className: 'text-large'
- }, 'Save new Reactions'), C.a.createElement('button', {
- className: 'link-gray',
- onClick: this.props.onClose
- }, C.a.createElement('span', {
- className: 'icon-cancel icon__position'
- }))), C.a.createElement('div', {
- className: 'admin-modal__content padding-gutter'
- }, C.a.createElement('div', null, 'Apply new reactions to ', C.a.createElement('strong', null, 'future'), ' articles on your site. Existing articles will not updated and will keep their existing reactions.'), C.a.createElement('div', {
- className: 'spacing-top align text-gray'
- }, C.a.createElement('input', {
- type: 'checkbox',
- onChange: this.toggleRetroactive,
- value: this.state.applyRetroactively,
- id: 'apply-retroactive'
- }), C.a.createElement('label', {
- htmlFor: 'apply-retroactive',
- className: 'spacing-left'
- }, 'Also apply new reactions to ', C.a.createElement('strong', null, 'existing articles with reactions'), '. This overwrites all reactions people have made on existing articles. ', C.a.createElement('span', {
- className: 'text-red'
- }, 'All reaction counts will be set to 0, this cannot be reverted.'))), C.a.createElement('div', {
- className: 'spacing-top align align--row-reverse'
- }, C.a.createElement('button', {
- className: 'button button-fill--brand button-medium',
- onClick: this.onConfirm
- }, 'Save new Reactions'))))
- }
- }
- ]) && FF(e.prototype, t),
- n && FF(e, n),
- o
- }();
- zF(Ru, 'propTypes', {
- onConfirm: b.a.func.isRequired,
- onClose: b.a.func.isRequired
- });
- var HF = Ru;
- function GF(e) {
- return (GF = 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator ? function (e) {
- return typeof e
- }
- : function (e) {
- return e && 'function' == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? 'symbol' : typeof e
- }) (e)
- }
- function VF(e) {
- return function (e) {
- if (Array.isArray(e)) return WF(e)
- }(e) || function (e) {
- if ('undefined' != typeof Symbol && null != e[Symbol.iterator] || null != e['@@iterator']) return Array.from(e)
- }(e) || function (e, t) {
- if (e) {
- if ('string' == typeof e) return WF(e, t);
- var n = Object.prototype.toString.call(e).slice(8, - 1);
- return 'Map' === (n = 'Object' === n && e.constructor ? e.constructor.name : n) || 'Set' === n ? Array.from(e) : 'Arguments' === n || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n) ? WF(e, t) : void 0
- }
- }(e) || function () {
- throw new TypeError('Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.')
- }()
- }
- function WF(e, t) {
- for (var n = 0, a = Array(t = null == t || e.length < t ? e.length : t); n < t; n++) a[n] = e[n];
- return a
- }
- function YF(t, e) {
- var n,
- a = Object.keys(t);
- return Object.getOwnPropertySymbols && (n = Object.getOwnPropertySymbols(t), e && (n = n.filter(function (e) {
- return Object.getOwnPropertyDescriptor(t, e).enumerable
- })), a.push.apply(a, n)),
- a
- }
- function QF(t) {
- for (var e = 1; e < arguments.length; e++) {
- var n = null != arguments[e] ? arguments[e] : {
- };
- e % 2 ? YF(Object(n), !0).forEach(function (e) {
- eL(t, e, n[e])
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(n)) : YF(Object(n)).forEach(function (e) {
- Object.defineProperty(t, e, Object.getOwnPropertyDescriptor(n, e))
- })
- }
- return t
- }
- function KF(e, t) {
- for (var n = 0; n < t.length; n++) {
- var a = t[n];
- a.enumerable = a.enumerable || !1,
- a.configurable = !0,
- 'value' in a && (a.writable = !0),
- Object.defineProperty(e, a.key, a)
- }
- }
- function JF(e, t) {
- return (JF = Object.setPrototypeOf || function (e, t) {
- return e.__proto__ = t,
- e
- }) (e, t)
- }
- function $F(n) {
- var a = function () {
- if ('undefined' == typeof Reflect || !Reflect.construct) return !1;
- if (Reflect.construct.sham) return !1;
- if ('function' == typeof Proxy) return !0;
- try {
- return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [
- ], function () {
- })),
- !0
- } catch (e) {
- return !1
- }
- }();
- return function () {
- var e,
- t = XF(n);
- return e = a ? (e = XF(this).constructor, Reflect.construct(t, arguments, e)) : t.apply(this, arguments),
- t = this,
- !(e = e) || 'object' !== GF(e) && 'function' != typeof e ? ZF(t) : e
- }
- }
- function ZF(e) {
- if (void 0 === e) throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called');
- return e
- }
- function XF(e) {
- return (XF = Object.setPrototypeOf ? Object.getPrototypeOf : function (e) {
- return e.__proto__ || Object.getPrototypeOf(e)
- }) (e)
- }
- function eL(e, t, n) {
- return t in e ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n,
- e
- }
- var tL = 0,
- nL = 1,
- aL = 100,
- go = function () {
- !function (e, t) {
- if ('function' != typeof t && null !== t) throw new TypeError('Super expression must either be null or a function');
- e.prototype = Object.create(t && t.prototype, {
- constructor: {
- value: e,
- writable: !0,
- configurable: !0
- }
- }),
- t && JF(e, t)
- }(r, A);
- var e,
- t,
- n,
- a = $F(r);
- function r() {
- var o;
- !function (e, t) {
- if (!(e instanceof t)) throw new TypeError('Cannot call a class as a function')
- }(this, r);
- for (var e = arguments.length, t = Array(e), n = 0; n < e; n++) t[n] = arguments[n];
- return eL(ZF(o = a.call.apply(a, [
- this
- ].concat(t))), 'state', {
- templateId: null,
- prompt: null,
- customImages: [
- ],
- reactions: [
- ],
- templateReactions: [
- ],
- reactionsEnabled: !1,
- reactionIndexImagesExpanded: - 1,
- isPreviewVisible: !0,
- previewSelection: null,
- modalType: null,
- validationError: null,
- errorMessage: null,
- savedFields: {
- reactions: [
- ],
- prompt: null
- }
- }),
- eL(ZF(o), 'confirmNavigationIfUnsaved', function () {
- if (o.hasUnsavedChanges()) return 'You have unsaved changes. Do you want to leave this page?'
- }),
- eL(ZF(o), 'handlePromptChange', function (e) {
- o.setState({
- prompt: e.target.value
- })
- }),
- eL(ZF(o), 'resetDefaults', function (e) {
- e.preventDefault();
- e = o.props.defaultReactions.map(function (e) {
- return QF(QF({
- }, e), {
- }, {
- votes: Math.floor(Math.random() * aL)
- })
- });
- o.setState({
- prompt: Hq.DEFAULT_PROMPT,
- validationError: null,
- reactions: e
- })
- }),
- eL(ZF(o), 'backfillReactionImages', function (e) {
- var t = {
- };
- o.props.defaultReactions.forEach(function (e) {
- t[e.text] = e.imageUrl
- });
- var n,
- a,
- r = [
- ];
- return e.forEach(function (e) {
- e.imageUrl || (t[e.text] ? (e.imageUrl = t[e.text], delete t[e.text]) : r.push(e))
- }),
- r.length && (n = Object.values(t), a = 0, r.forEach(function (e) {
- e.imageUrl = n[a],
- a += 1
- })),
- e
- }),
- eL(ZF(o), 'toggleImagesExpanded', function (t, e) {
- e.preventDefault(),
- o.setState(function (e) {
- e = e.reactionIndexImagesExpanded !== t;
- return e ? window.document.body.addEventListener('click', o.blurImagesDropdown) : window.document.body.removeEventListener('click', o.blurImagesDropdown),
- {
- reactionIndexImagesExpanded: e ? t : - 1
- }
- })
- }),
- eL(ZF(o), 'blurImagesDropdown', function (t) {
- o.state.reactionIndexImagesExpanded < 0 || o.imageDropdownRefs && o.imageDropdownRefs.some(function (e) {
- return e && e.contains(t.target)
- }) || (window.document.body.removeEventListener('click', o.blurImagesDropdown), o.setState({
- reactionIndexImagesExpanded: - 1
- }))
- }),
- eL(ZF(o), 'handleImageSelection', function (n, a, r) {
- o.setState(function (e) {
- var t = {
- reactions: [
- ].concat(VF(e.reactions.slice(0, n)), [
- QF(QF({
- }, e.reactions[n]), {
- }, {
- imageID: a,
- imageUrl: r,
- errs: QF(QF({
- }, e.reactions[n].errs), {
- }, {
- imageUrl: null,
- imageID: null
- })
- })
- ], VF(e.reactions.slice(n + 1)))
- };
- return t.validationError = o.props.validateReactions({
- reactions: t.reactions,
- existingErrs: e.validationError
- }),
- t
- })
- }),
- eL(ZF(o), 'handleTextChange', function (n, a) {
- Vq < a.target.value.length || (a.persist(), o.setState(function (e) {
- var t = {
- reactions: [
- ].concat(VF(e.reactions.slice(0, n)), [
- QF(QF({
- }, e.reactions[n]), {
- }, {
- text: a.target.value,
- errs: QF(QF({
- }, e.reactions[n].errs), {
- }, {
- text: null
- })
- })
- ], VF(e.reactions.slice(n + 1)))
- };
- return t.validationError = o.props.validateReactions({
- reactions: t.reactions,
- existingErrs: e.validationError
- }),
- t
- }))
- }),
- eL(ZF(o), 'addReaction', function () {
- var n = o.props.defaultReactions.find(function (t) {
- return !o.state.reactions.some(function (e) {
- return e.imageID === t.imageID || e.imageUrl === t.imageUrl
- })
- });
- n && o.setState(function (e) {
- var t = {
- reactions: [
- ].concat(VF(e.reactions), [
- {
- text: '',
- imageUrl: n.imageUrl,
- imageID: n.imageID,
- votes: 0
- }
- ])
- };
- return t.validationError = o.props.validateReactions({
- reactions: t.reactions,
- existingErrs: e.validationError
- }),
- t
- })
- }),
- eL(ZF(o), 'removeReaction', function (n) {
- o.setState(function (e) {
- var t = {
- reactions: [
- ].concat(VF(e.reactions.slice(0, n)), VF(e.reactions.slice(n + 1)))
- };
- return t.validationError = o.props.validateReactions({
- reactions: t.reactions,
- existingErrs: e.validationError
- }),
- t
- })
- }),
- eL(ZF(o), 'hasReactionChanged', function (e) {
- return o.state.reactions[e] && !o.state.savedFields.reactions[e] || !o.state.reactions[e] && o.state.savedFields.reactions[e] || o.state.reactions[e] && o.state.savedFields.reactions[e] && (o.state.reactions[e].text !== o.state.savedFields.reactions[e].text || o.state.reactions[e].imageUrl !== o.state.savedFields.reactions[e].imageUrl || o.state.reactions[e].imageId !== o.state.savedFields.reactions[e].imageId)
- }),
- eL(ZF(o), 'hasFieldChanged', function (e) {
- return 'reactions' === e ? o.state.savedFields.reactions.some(function (e, t) {
- return o.hasReactionChanged(t)
- }) : o.state[e] !== o.state.savedFields[e] && !(null === o.state.savedFields[e] && '' === o.state[e])
- }),
- eL(ZF(o), 'togglePreview', function () {
- o.setState(function (e) {
- return {
- isPreviewVisible: !e.isPreviewVisible
- }
- })
- }),
- eL(ZF(o), 'selectPreviewReaction', function (a) {
- o.setState(function (e) {
- return {
- reactions: e.reactions.map(function (e, t) {
- var n = t === a,
- t = e.votes;
- return n && (t += 1),
- e.isSelected && --t,
- QF(QF({
- }, e), {
- }, {
- isSelected: n,
- votes: t
- })
- })
- }
- })
- }),
- eL(ZF(o), 'getUpdateTrackData', function () {
- return {
- verb: 'update',
- object_type: 'forum',
- object_id: o.props.selection.forum.id,
- area: 'modal',
- extra_data: {
- reactionsEnabled: {
- before: o.state.reactionsEnabled
- },
- template_id: {
- before: o.state.templateId,
- after: null
- }
- }
- }
- }),
- eL(ZF(o), 'enableReactions', function () {
- var e = o.getUpdateTrackData();
- e.verb = 'enable',
- o.props.setReactionsEnabled({
- enabled: !0,
- onSuccess: function () {
- o.setState({
- reactionsEnabled: !0
- }),
- e.extra_data.reactionsEnabled.after = !0,
- e.extra_data.template_id.after = o.state.templateId,
- e.extra_data = JSON.stringify(e.extra_data),
- o.props.emitTrackingEvent(e)
- },
- onError: function () {
- e.adverb = 'errored',
- e.extra_data.reactionsEnabled.after = null,
- e.extra_data.imagesEnabled.after = null,
- e.extra_data.template_id.after = null,
- e.extra_data = JSON.stringify(e.extra_data),
- o.props.emitTrackingEvent(e)
- }
- })
- }),
- eL(ZF(o), 'hasUnsavedChanges', function () {
- return Object.keys(o.state.savedFields).some(function (e) {
- return o.hasFieldChanged(e)
- })
- }),
- eL(ZF(o), 'saveReactions', function (e) {
- var a,
- t = e.saveConfirmed,
- r = e.applyRetroactively;
- o.setState({
- errorMessage: null
- }),
- o.state.reactionsEnabled || !o.props.hadPreviousReactions || o.hasUnsavedChanges() ? (e = o.props.validateReactions({
- reactions: o.state.reactions
- }), o.setState({
- validationError: e
- }), e && e.length || (!o.props.hadPreviousReactions || t ? ((a = o.getUpdateTrackData()).verb = 'enable', o.setState({
- modalType: null
- }, function () {
- var n = this;
- this.props.saveReactions({
- data: {
- reactionsData: JSON.stringify(this.state.reactions.map(function (e) {
- return {
- text: e.text,
- imageUrl: e.imageUrl,
- imageID: e.imageID
- }
- })),
- prompt: this.state.prompt.trim(),
- applyRetroactively: r ? 1 : 0
- },
- onSuccess: function (e) {
- var t = e.response.reactions[0].template;
- n.setState(function (e) {
- return {
- reactionsEnabled: !0,
- templateId: t,
- templateReactions: e.reactions,
- savedFields: {
- reactions: e.reactions,
- prompt: e.prompt
- }
- }
- }),
- a.extra_data.reactionsEnabled.after = !0,
- a.extra_data.template_id.after = n.state.templateId,
- a.extra_data = JSON.stringify(a.extra_data),
- n.props.emitTrackingEvent(a)
- },
- onError: function (e) {
- n.setState({
- errorMessage: JSON.parse(e.responseText).response
- }),
- a.adverb = 'errored',
- a.extra_data.reactionsEnabled.after = null,
- a.extra_data.imagesEnabled.after = null,
- a.extra_data.template_id.after = null,
- a.extra_data = JSON.stringify(a.extra_data),
- n.props.emitTrackingEvent(a)
- }
- })
- })) : o.openModal(tL))) : o.enableReactions()
- }),
- eL(ZF(o), 'openModal', function (e) {
- o.setState({
- modalType: e
- })
- }),
- eL(ZF(o), 'closeModal', function () {
- o.setState({
- modalType: null
- })
- }),
- eL(ZF(o), 'handleDisable', function (e) {
- var t;
- e.disableConfirmed ? ((t = o.getUpdateTrackData()).verb = 'disable', o.setState({
- modalType: null
- }, function () {
- var e = this;
- this.props.setReactionsEnabled({
- enabled: !1,
- onSuccess: function () {
- e.setState({
- reactionsEnabled: !1,
- modalType: null
- }),
- t.extra_data.reactionsEnabled.after = !1,
- t.extra_data.imagesEnabled.after = !1,
- t.extra_data = JSON.stringify(t.extra_data),
- e.props.emitTrackingEvent(t)
- },
- onError: function () {
- t.adverb = 'errored',
- t.extra_data.reactionsEnabled.after = null,
- t.extra_data.imagesEnabled.after = null,
- t.extra_data = JSON.stringify(t.extra_data),
- e.props.emitTrackingEvent(t)
- }
- })
- })) : o.openModal(nL)
- }),
- eL(ZF(o), 'updateRemainingCustomImages', function (e) {
- o.setState({
- customImages: e
- })
- }),
- eL(ZF(o), 'addNewCustomImages', function (t) {
- o.setState(function (e) {
- return {
- customImages: [
- ].concat(VF(e.customImages), VF(t))
- }
- })
- }),
- eL(ZF(o), 'renderIconsForDropdownMenu', function (e, t, n) {
- var a = {
- };
- o.state.reactions.forEach(function (e) {
- a[e.imageID] = e.imageID !== t.imageID
- });
- e = e.filter(function (e) {
- return e.imageID !== t.imageID && e.imageUrl !== t.imageUrl
- });
- return e.unshift(t),
- e.map(function (e) {
- return C.a.createElement('span', {
- key: e.imageID,
- className: ('image--dropdown__item' + (a[e.imageID] ? ' invalid' : '') + (e.imageUrl === t.imageUrl || e.imageID === t.imageID ? ' checked' : '')).trim()
- }, C.a.createElement('img', {
- src: e.imageUrl,
- onClick: n === o.state.reactionIndexImagesExpanded ? o.handleImageSelection.bind(ZF(o), n, e.imageID, e.imageUrl) : null
- }))
- })
- }),
- o
- }
- return e = r,
- (t = [
- {
- key: 'componentDidMount',
- value: function () {
- this.props.history.setRouteLeaveHook(this.props.route, this.confirmNavigationIfUnsaved),
- window.onbeforeunload = this.confirmNavigationIfUnsaved,
- this.props.fetchReactions(),
- this.props.fetchForumDetails(),
- this.props.fetchDefaultReactions(),
- Bq.a.attachReactionsListener(this)
- }
- },
- {
- key: 'componentWillUnmount',
- value: function () {
- window.document.body.removeEventListener('click', this.blurImagesDropdown),
- window.onbeforeunload = null,
- Bq.a.detachReactionsListener(this)
- }
- },
- {
- key: 'componentDidUpdate',
- value: function (e, t) {
- this.state.reactions !== t.reactions && Bq.a.formatReactionsItems()
- }
- },
- {
- key: 'componentWillReceiveProps',
- value: function (t) {
- var n,
- a;
- this.props.isFetching && !t.isFetching && (n = (t.reactionsSynced.length ? t.reactionsSynced : t.defaultReactions).map(function (e) {
- return QF(QF({
- }, e), {
- }, {
- votes: Math.floor(Math.random() * aL)
- })
- }), a = t.includesImagesSynced ? n : this.backfillReactionImages(n.map(function (e) {
- return QF({
- }, e)
- })), this.setState(function (e) {
- return {
- customImages: t.customImagesSynced.length ? t.customImagesSynced : e.customImages,
- templateId: t.templateIdSynced,
- prompt: t.promptSynced || Hq.DEFAULT_PROMPT,
- reactionsEnabled: t.reactionsEnabledSynced,
- templateReactions: a,
- reactions: a,
- savedFields: {
- reactions: n,
- prompt: t.promptSynced || Hq.DEFAULT_PROMPT
- }
- }
- }), this.props.emitTrackingEvent({
- verb: 'view',
- object_type: 'zone',
- object_id: 'reactions',
- extra_data: JSON.stringify({
- reactionsEnabled: t.reactionsEnabledSynced
- })
- }))
- }
- },
- {
- key: 'render',
- value: function () {
- var n = this;
- if (this.props.selection.organization && this.props.selection.organization.pollsOnly) return C.a.createElement(Cm, {
- isPolls: !1,
- organization: this.props.selection.organization
- });
- var e,
- t = !!(this.props.forumDetails && this.props.forumDetails.features && this.props.forumDetails.features.customReactions),
- a = t ? this.state.customImages.concat(this.props.defaultReactions) : this.props.defaultReactions,
- r = !t && yo.a.isFeatureActive('custom_reactions'),
- o = this.state.validationError && this.state.validationError.length ? C.a.createElement('span', null, this.state.validationError.map(function (e, t) {
- return C.a.createElement('span', {
- key: t
- }, e, C.a.createElement('br', null))
- })) : this.props.error;
- if (this.props.isFetching) return C.a.createElement(Ji, null);
- switch (this.state.modalType) {
- case tL:
- e = C.a.createElement(HF, {
- onConfirm: this.saveReactions,
- onClose: this.closeModal
- });
- break;
- case nL:
- e = C.a.createElement(IF, {
- onConfirm: this.handleDisable,
- onClose: this.closeModal
- })
- }
- return C.a.createElement('div', {
- className: 'settings-reactions'
- }, r ? C.a.createElement(ch, {
- headline: 'Looking to make your Reactions more unique?',
- promotionalPlan: 'Disqus Pro',
- planDetailsUrl: 'https://about.disqus.com/pro',
- upsellMessageLeft: 'Upgrade to',
- upsellMessageRight: ' to access Custom Reactions, allowing even more creative freedom and customization to match your site.',
- selection: this.props.selection,
- emitTrackingEvent: this.props.emitTrackingEvent
- }) : null, e, C.a.createElement(TF, {
- images: this.state.customImages,
- forum: this.props.selection.forum.shortname,
- updateRemainingCustomImages: this.updateRemainingCustomImages,
- addNewCustomImages: this.addNewCustomImages,
- reactions: this.state.reactions,
- templateReactions: this.state.templateReactions,
- canEnableCustomReactions: t
- }), C.a.createElement('div', {
- className: 'content__wrap spacing-bottom-double'
- }, C.a.createElement('header', {
- className: 'settings__header'
- }, C.a.createElement('h2', {
- className: 'text-larger text-gray-darker spacing-bottom-small'
- }, 'Configure and enable Reactions'), C.a.createElement('p', {
- className: 'text-gray'
- }, 'Increase audience engagement beyond comments with Article Reactions. ', C.a.createElement('a', {
- href: Pn.adminArticles,
- target: '_blank',
- rel: 'noopener noreferrer'
- }, 'Learn more »'))), C.a.createElement('section', {
- className: 'settings__content'
- }, this.state.validationError && this.state.validationError.length || this.props.error ? C.a.createElement(Ki, {
- message: this.state.errorMessage || o,
- alertType: 'error'
- }) : null, C.a.createElement($h, {
- name: 'prompt',
- value: this.state.prompt,
- label: 'Prompt',
- onChange: this.handlePromptChange,
- idNamespace: this.constructor.displayName,
- maxLength: 60,
- showLimit: !0,
- shouldHighlight: this.hasFieldChanged('prompt')
- }), C.a.createElement(kf, {
- label: 'Reactions',
- blockAdditionalClass: 'text-medium',
- shouldHighlight: this.state.savedFields.reactions.some(function (e, t) {
- return n.hasReactionChanged(t)
- })
- }, C.a.createElement('div', {
- className: 'spacing-top-small'
- }, 'Define the set of reactions you would like your readers to be able to react with. You can also ', C.a.createElement('a', {
- href: '#',
- onClick: this.resetDefaults
- }, 'Reset to Default Reactions.'), ' Need ideas? We also have a post for ', C.a.createElement('a', {
- href: '//help.disqus.com/moderation/reactions',
- rel: 'noopener noreferrer',
- target: '_blank'
- }, 'How to Use Reactions.')), C.a.createElement('div', {
- className: 'spacing-top align align--middle reactions-list__header'
- }, C.a.createElement('span', {
- className: 'spacing-right'
- }, 'Image'), C.a.createElement('span', null, 'Description')), C.a.createElement('div', {
- className: 'spacing-top-small'
- }, this.state.reactions.map(function (e, t) {
- return C.a.createElement('div', {
- key: t,
- className: 'align align--middle spacing-top-small'.concat(n.hasReactionChanged(t) ? ' settings__highlighted' : '')
- }, C.a.createElement('div', {
- className: 'image--dropdown spacing-right',
- onClick: n.toggleImagesExpanded.bind(n, t),
- ref: function (e) {
- n.imageDropdownRefs = n.imageDropdownRefs || [
- ],
- n.imageDropdownRefs[t] = e
- }
- }, C.a.createElement('img', {
- src: e.imageUrl,
- className: 'template-reaction'
- }), C.a.createElement('div', {
- className: [
- 'image--dropdown__menu',
- e.errs && (e.errs.imageID || e.errs.imageUrl) ? 'err' : '',
- t === n.state.reactionIndexImagesExpanded ? 'expanded' : ''
- ].join(' ').trim()
- }, t === n.state.reactionIndexImagesExpanded ? n.renderIconsForDropdownMenu(a, e, t) : null)), C.a.createElement('div', {
- className: 'reactions__text-input-wrapper'
- }, C.a.createElement('input', {
- className: 'input--textbox'.concat(e.errs && e.errs.text ? ' err' : ''),
- type: 'text',
- value: e.text,
- onChange: n.handleTextChange.bind(n, t)
- }), C.a.createElement('span', {
- className: 'reactions__char-count text-gray'
- }, e.text.length, '/', Vq)), C.a.createElement('div', {
- className: 'remove-button'
- }, C.a.createElement('button', {
- onClick: 1 < t ? n.removeReaction.bind(n, t) : function () {
- },
- className: [
- 'button button-outline spacing-left button-medium',
- 1 < t ? '' : 'invisible'
- ].join(' ')
- }, 'Remove')))
- })), C.a.createElement('div', {
- className: 'spacing-top'
- }, C.a.createElement('button', {
- className: 'button button-fill--gray-light button-medium',
- onClick: this.addReaction,
- disabled: 6 <= this.state.reactions.length
- }, '+ Add reaction'), C.a.createElement('div', {
- className: 'text-gray text-small spacing-top-small'
- }, 'You can have a maximum of 6 reactions. Do not select the same image more than once.'))), C.a.createElement('div', {
- className: 'spacing-top-double'
- }, C.a.createElement(Bh, {
- buttonLabel: this.state.reactionsEnabled ? 'Save' : 'Enable Reactions on your site',
- disabled: this.state.reactionsEnabled && !this.hasUnsavedChanges(),
- isSaving: this.props.isSaving,
- saveErr: !!this.props.error,
- isSaved: this.props.isSaved,
- onClick: this.saveReactions
- }), C.a.createElement('div', {
- className: 'fieldset fieldset--save spacing-top'
- }, C.a.createElement('div', {
- className: 'fieldset__label'
- }), C.a.createElement('div', {
- className: 'fieldset__block'
- }, C.a.createElement('button', {
- className: 'button button-fill button-medium',
- onClick: this.togglePreview
- }, this.state.isPreviewVisible ? 'Hide Preview' : 'Show Preview', C.a.createElement('span', {
- className: 'spacing-left-small icon icon-arrow'
- }))))), this.state.isPreviewVisible ? C.a.createElement('div', {
- className: 'spacing-top-double reactions__preview'
- }, C.a.createElement(zq.a, {
- reactionsList: this.state.reactions,
- prompt: this.state.prompt,
- CDN_ROOT: '//c.disquscdn.com/next/current/publisher-admin',
- onSubmitReaction: this.selectPreviewReaction
- }), C.a.createElement('div', {
- className: 'embed_preview'
- }, C.a.createElement('img', {
- className: 'email_preview__wide',
- src: '//c.disquscdn.com/next/current/publisher-admin/assets/img/email_preview/logged_in_wide.png'
- }), C.a.createElement('img', {
- className: 'email_preview__narrow',
- src: '//c.disquscdn.com/next/current/publisher-admin/assets/img/email_preview/logged_in_narrow.png'
- }), C.a.createElement('img', {
- src: '//c.disquscdn.com/next/current/publisher-admin/assets/img/email_preview/below.png'
- }))) : null)), this.state.reactionsEnabled ? C.a.createElement('div', {
- className: 'content__wrap'
- }, C.a.createElement('header', {
- className: 'settings__header settings-inline-section align align--between align--middle'
- }, C.a.createElement('div', {
- className: 'spacing-right-large'
- }, C.a.createElement('h2', {
- className: 'text-larger text-gray-darker spacing-bottom-small'
- }, 'Turn Reactions off'), C.a.createElement('p', {
- className: 'text-gray'
- }, 'The Reactions widget will be removed from all new and prior articles on your site.')), C.a.createElement('div', {
- className: 'align__item--no-shrink'
- }, C.a.createElement('button', {
- className: 'button button-fill--red button-medium',
- onClick: this.handleDisable
- }, 'Turn Reactions off')))) : null)
- }
- }
- ]) && KF(e.prototype, t),
- n && KF(e, n),
- r
- }();
- eL(go, 'propTypes', {
- selection: ht.isRequired,
- forumDetails: $c,
- fetchForumDetails: b.a.func.isRequired,
- templateIdSynced: b.a.number,
- reactionsSynced: b.a.arrayOf(r).isRequired,
- defaultReactions: b.a.arrayOf(r).isRequired,
- customImagesSynced: b.a.arrayOf(sl).isRequired,
- promptSynced: b.a.string,
- hadPreviousReactions: b.a.bool,
- isFetching: b.a.bool,
- isSaving: b.a.bool,
- isSaved: b.a.bool,
- error: b.a.string,
- reactionsEnabledSynced: b.a.bool,
- includesImagesSynced: b.a.bool,
- validationError: b.a.string,
- fetchReactions: b.a.func.isRequired,
- fetchDefaultReactions: b.a.func.isRequired,
- saveReactions: b.a.func.isRequired,
- setReactionsEnabled: b.a.func.isRequired,
- validateReactions: b.a.func.isRequired,
- emitTrackingEvent: b.a.func.isRequired,
- history: b.a.shape({
- push: b.a.func.isRequired,
- setRouteLeaveHook: b.a.func.isRequired
- }).isRequired,
- route: b.a.object
- });
- yl = Object(u.connect) (function (e) {
- var t = e.reactions;
- return QF(QF({
- forumDetails: e.forumDetails.forumDetails,
- selection: e.selection
- }, t), {
- }, {
- templateIdSynced: t.templateId,
- reactionsSynced: t.reactions,
- defaultReactions: t.defaultReactions,
- customImagesSynced: t.customImages,
- promptSynced: t.prompt,
- reactionsEnabledSynced: t.reactionsEnabled,
- includesImagesSynced: t.includesImages
- })
- }, QF(QF({
- fetchForumDetails: ig
- }, Wi), {
- }, {
- emitTrackingEvent: Xo({
- zone: 'reactions',
- section: 'settings'
- })
- })) (Fo() (go));
- function rL(t, e) {
- var n,
- a = Object.keys(t);
- return Object.getOwnPropertySymbols && (n = Object.getOwnPropertySymbols(t), e && (n = n.filter(function (e) {
- return Object.getOwnPropertyDescriptor(t, e).enumerable
- })), a.push.apply(a, n)),
- a
- }
- function oL(a) {
- for (var e = 1; e < arguments.length; e++) {
- var r = null != arguments[e] ? arguments[e] : {
- };
- e % 2 ? rL(Object(r), !0).forEach(function (e) {
- var t,
- n;
- n = r[t = e],
- t in (e = a) ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(a, Object.getOwnPropertyDescriptors(r)) : rL(Object(r)).forEach(function (e) {
- Object.defineProperty(a, e, Object.getOwnPropertyDescriptor(r, e))
- })
- }
- return a
- }
- Ru = {
- toggleRecommendations: function (e) {
- var n = e.forum,
- a = e.data,
- r = e.onSuccess,
- o = e.onError;
- return function (t) {
- t({
- type: he.enabling
- }),
- io.a.call('forums/update', {
- type: 'POST',
- data: oL({
- forum: n
- }, a),
- success: function (e) {
- t({
- type: he.onEnable
- }),
- r(e)
- },
- error: function (e) {
- t({
- type: he.onEnableError,
- message: 'An error occurred trying to '.concat(a.organicDiscoveryEnabled ? 'disable' : 'enable', ' Recommendations')
- }),
- o(e)
- }
- })
- }
- },
- fetchSettings: function (e) {
- return function (t) {
- t({
- type: he.fetching
- }),
- io.a.call('discovery/details', {
- data: {
- forum: e
- },
- success: function (e) {
- t(oL({
- type: he.onFetch
- }, e.response))
- },
- error: function () {
- t({
- type: he.onFetchError,
- message: 'An error occurred trying to fetch your Recommendations settings'
- })
- }
- })
- }
- },
- saveSettings: function (e) {
- var n = e.data,
- a = e.forum,
- r = e.onSuccess,
- o = e.onError;
- return function (t) {
- t({
- type: he.saving
- }),
- io.a.call('discovery/update', {
- type: 'POST',
- data: {
- forum: a,
- contentPreview: n.contentPreview ? 1 : 0,
- disableOverlay: n.disableOverlay ? 1 : 0,
- maxAgeDays: n.maxAgeDays,
- metaComments: n.metaComments ? 1 : 0,
- metaDate: n.metaDate ? 1 : 0,
- placement: n.placement,
- titleHidden: n.titleHidden ? 1 : 0
- },
- success: function (e) {
- t({
- type: he.onSave
- }),
- r(e)
- },
- error: function (e) {
- t({
- type: he.onSaveError,
- message: 'An error occurred trying to save your Recommendations settings'
- }),
- o(e)
- }
- })
- }
- }
- };
- function iL(e) {
- return (iL = 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator ? function (e) {
- return typeof e
- }
- : function (e) {
- return e && 'function' == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? 'symbol' : typeof e
- }) (e)
- }
- function sL() {
- return (sL = Object.assign || function (e) {
- for (var t = 1; t < arguments.length; t++) {
- var n,
- a = arguments[t];
- for (n in a) Object.prototype.hasOwnProperty.call(a, n) && (e[n] = a[n])
- }
- return e
- }).apply(this, arguments)
- }
- function lL(e, t) {
- if (!(e instanceof t)) throw new TypeError('Cannot call a class as a function')
- }
- function cL(e, t) {
- for (var n = 0; n < t.length; n++) {
- var a = t[n];
- a.enumerable = a.enumerable || !1,
- a.configurable = !0,
- 'value' in a && (a.writable = !0),
- Object.defineProperty(e, a.key, a)
- }
- }
- function uL(e, t, n) {
- return t && cL(e.prototype, t),
- n && cL(e, n),
- e
- }
- function pL(e, t) {
- if ('function' != typeof t && null !== t) throw new TypeError('Super expression must either be null or a function');
- e.prototype = Object.create(t && t.prototype, {
- constructor: {
- value: e,
- writable: !0,
- configurable: !0
- }
- }),
- t && dL(e, t)
- }
- function dL(e, t) {
- return (dL = Object.setPrototypeOf || function (e, t) {
- return e.__proto__ = t,
- e
- }) (e, t)
- }
- function mL(n) {
- var a = function () {
- if ('undefined' == typeof Reflect || !Reflect.construct) return !1;
- if (Reflect.construct.sham) return !1;
- if ('function' == typeof Proxy) return !0;
- try {
- return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [
- ], function () {
- })),
- !0
- } catch (e) {
- return !1
- }
- }();
- return function () {
- var e,
- t = hL(n);
- return e = a ? (e = hL(this).constructor, Reflect.construct(t, arguments, e)) : t.apply(this, arguments),
- t = this,
- !(e = e) || 'object' !== iL(e) && 'function' != typeof e ? fL(t) : e
- }
- }
- function fL(e) {
- if (void 0 === e) throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called');
- return e
- }
- function hL(e) {
- return (hL = Object.setPrototypeOf ? Object.getPrototypeOf : function (e) {
- return e.__proto__ || Object.getPrototypeOf(e)
- }) (e)
- }
- function gL(e, t, n) {
- return t in e ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n,
- e
- }
- function yL(e) {
- return C.a.createElement('div', {
- className: 'content-preview-wrapper'
- }, C.a.createElement('div', {
- className: 'recommend-content'
- }, e.settings.titleHidden || !e.settings.disableOverlay ? C.a.createElement('span', {
- 'data-role': 'recommend-description-snippet',
- className: 'line-truncate',
- 'data-line-truncate': '5'
- }, e.description) : C.a.createElement('h3', {
- className: 'recommend-post-title',
- title: e.title
- }, C.a.createElement('span', {
- 'data-role': 'recommend-thread-title',
- className: 'title line-truncate',
- 'data-line-truncate': 3,
- 'data-content': e.title,
- dangerouslySetInnerHTML: {
- __html: e.title
- }
- }))))
- }
- yL.propTypes = {
- title: b.a.string.isRequired,
- description: b.a.string.isRequired,
- settings: b.a.shape({
- titleHidden: b.a.bool.isRequired,
- disableOverlay: b.a.bool.isRequired
- }).isRequired
- };
- var bL = function () {
- pL(a, A);
- var n = mL(a);
- function a(e) {
- var t;
- return lL(this, a),
- gL(fL(t = n.call(this, e)), 'adjustMetaPlacement', function () {
- var e;
- t.title.current ? t.meta.current.style.bottom = e = ''.concat('' + (t.title.current.offsetHeight + 18), 'px') : e = '10px',
- t.meta.current.style.bottom = e
- }),
- t.meta = C.a.createRef(),
- t.title = C.a.createRef(),
- t
- }
- return uL(a, [
- {
- key: 'componentDidMount',
- value: function () {
- this.adjustMetaPlacement()
- }
- },
- {
- key: 'componentDidUpdate',
- value: function () {
- this.adjustMetaPlacement()
- }
- },
- {
- key: 'render',
- value: function () {
- var e = this.props.settings;
- return C.a.createElement('div', {
- key: this.props.title,
- className: 'recommend-post',
- id: 'recommend-link',
- 'data-role': 'recommended-post',
- 'data-link': this.props.recommendationsLink
- }, C.a.createElement('header', {
- className: 'recommend-post-header'
- }, C.a.createElement('div', {
- className: 'recommend-image-wrapper'
- }, C.a.createElement('img', {
- src: this.props.images[0].url,
- alt: this.props.title,
- title: this.props.title
- }), C.a.createElement('span', {
- className: 'overlay'
- })), e.disableOverlay ? null : C.a.createElement('h3', {
- className: 'recommend-post-title',
- title: this.props.title,
- ref: this.title
- }, C.a.createElement('span', {
- 'data-role': 'recommend-thread-title',
- className: 'title line-truncate',
- 'data-line-truncate': 3,
- 'data-content': this.props.title,
- dangerouslySetInnerHTML: {
- __html: this.props.title
- }
- }))), C.a.createElement('ul', {
- className: 'meta',
- ref: this.meta
- }, e.metaDate ? C.a.createElement('li', {
- className: 'time'
- }, this.props.createdAgo) : null, ' ', e.metaComments && 0 < this.props.posts ? C.a.createElement('li', {
- className: 'comments'
- }, 1 === this.props.posts ? '1 comment' : ''.concat(this.props.posts, ' comments'), ' ') : null), e.contentPreview ? C.a.createElement(yL, this.props) : null)
- }
- }
- ]),
- a
- }();
- bL.propTypes = {
- createdAgo: b.a.string.isRequired,
- description: b.a.string.isRequired,
- recommendationsLink: b.a.string.isRequired,
- forumName: b.a.string.isRequired,
- images: b.a.arrayOf(b.a.shape({
- url: b.a.string.isRequired
- })).isRequired,
- posts: b.a.number.isRequired,
- settings: b.a.shape({
- contentPreview: b.a.bool.isRequired,
- metaDate: b.a.bool.isRequired,
- metaComments: b.a.bool.isRequired,
- disableOverlay: b.a.bool.isRequired,
- titleHidden: b.a.bool.isRequired
- }).isRequired,
- title: b.a.string.isRequired
- };
- var vL = function () {
- pL(n, A);
- var t = mL(n);
- function n(e) {
- var o;
- return lL(this, n),
- gL(fL(o = t.call(this, e)), 'clickScrollLeft', function () {
- o.scroll( - 1)
- }),
- gL(fL(o), 'clickScrollRight', function () {
- o.scroll(1)
- }),
- gL(fL(o), 'scroll', function (e) {
- var t = vo() (o.wrapper.current),
- n = vo() (o.postList.current).width() / o.postCount,
- a = 2 * n,
- r = 700;
- t.width() < a && (a = n, r /= 2);
- e = t.scrollLeft() + a * e;
- t.animate({
- scrollLeft: e
- }, r)
- }),
- o.postCount = e.collection.length,
- o.wrapper = C.a.createRef(),
- o.postList = C.a.createRef(),
- o
- }
- return uL(n, [
- {
- key: 'render',
- value: function () {
- var n = this,
- e = this.props.settings,
- t = e.contentPreview ? 'has-preview' : 'no-preview',
- a = e.metaDate || e.metaComments ? '' : 'no-meta';
- return C.a.createElement('div', {
- className: 'recommend-main '.concat(t = e.titleHidden || !e.disableOverlay ? t : 'has-preview-title', ' ').concat(a)
- }, C.a.createElement('section', {
- className: 'col-organic'
- }, C.a.createElement('header', {
- className: 'recommend-col-header'
- }, C.a.createElement('h2', null, 'Also on ', C.a.createElement('strong', null, 'The Disqus Blog'))), C.a.createElement('div', {
- className: 'recommendation-container'
- }, C.a.createElement('button', {
- className: 'scroll-btn scroll-left',
- 'data-action': 'scroll-left',
- onClick: function () {
- return n.clickScrollLeft()
- }
- }, '❮'), C.a.createElement('div', {
- className: 'recommend-wrapper',
- ref: this.wrapper
- }, C.a.createElement('div', {
- className: 'recommend-posts',
- 'data-role': 'recommend-posts',
- ref: this.postList
- }, Object(De.map) (this.props.collection, function (e, t) {
- return C.a.createElement(bL, sL({
- key: t
- }, Object(De.extend) (e, n.props)))
- }))), C.a.createElement('button', {
- className: 'scroll-btn scroll-right',
- 'data-action': 'scroll-right',
- onClick: function () {
- return n.clickScrollRight()
- }
- }, '❯'))))
- }
- }
- ]),
- n
- }();
- function _L(e) {
- return (_L = 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator ? function (e) {
- return typeof e
- }
- : function (e) {
- return e && 'function' == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? 'symbol' : typeof e
- }) (e)
- }
- function EL(t, e) {
- var n,
- a = Object.keys(t);
- return Object.getOwnPropertySymbols && (n = Object.getOwnPropertySymbols(t), e && (n = n.filter(function (e) {
- return Object.getOwnPropertyDescriptor(t, e).enumerable
- })), a.push.apply(a, n)),
- a
- }
- function OL(t) {
- for (var e = 1; e < arguments.length; e++) {
- var n = null != arguments[e] ? arguments[e] : {
- };
- e % 2 ? EL(Object(n), !0).forEach(function (e) {
- CL(t, e, n[e])
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(n)) : EL(Object(n)).forEach(function (e) {
- Object.defineProperty(t, e, Object.getOwnPropertyDescriptor(n, e))
- })
- }
- return t
- }
- function SL(e, t) {
- for (var n = 0; n < t.length; n++) {
- var a = t[n];
- a.enumerable = a.enumerable || !1,
- a.configurable = !0,
- 'value' in a && (a.writable = !0),
- Object.defineProperty(e, a.key, a)
- }
- }
- function wL(e, t) {
- return (wL = Object.setPrototypeOf || function (e, t) {
- return e.__proto__ = t,
- e
- }) (e, t)
- }
- function PL(n) {
- var a = function () {
- if ('undefined' == typeof Reflect || !Reflect.construct) return !1;
- if (Reflect.construct.sham) return !1;
- if ('function' == typeof Proxy) return !0;
- try {
- return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [
- ], function () {
- })),
- !0
- } catch (e) {
- return !1
- }
- }();
- return function () {
- var e,
- t = NL(n);
- return e = a ? (e = NL(this).constructor, Reflect.construct(t, arguments, e)) : t.apply(this, arguments),
- t = this,
- !(e = e) || 'object' !== _L(e) && 'function' != typeof e ? kL(t) : e
- }
- }
- function kL(e) {
- if (void 0 === e) throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called');
- return e
- }
- function NL(e) {
- return (NL = Object.setPrototypeOf ? Object.getPrototypeOf : function (e) {
- return e.__proto__ || Object.getPrototypeOf(e)
- }) (e)
- }
- function CL(e, t, n) {
- return t in e ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n,
- e
- }
- vL.propTypes = {
- collection: b.a.arrayOf(b.a.shape({
- title: b.a.string.isRequired,
- description: b.a.string.isRequired,
- forumName: b.a.string.isRequired,
- createdAgo: b.a.string.isRequired,
- posts: b.a.number.isRequired
- })).isRequired,
- settings: b.a.shape({
- contentPreview: b.a.bool.isRequired,
- metaDate: b.a.bool.isRequired,
- metaComments: b.a.bool.isRequired,
- disableOverlay: b.a.bool.isRequired,
- titleHidden: b.a.bool.isRequired
- }).isRequired
- };
- r = function () {
- !function (e, t) {
- if ('function' != typeof t && null !== t) throw new TypeError('Super expression must either be null or a function');
- e.prototype = Object.create(t && t.prototype, {
- constructor: {
- value: e,
- writable: !0,
- configurable: !0
- }
- }),
- t && wL(e, t)
- }(o, A);
- var e,
- t,
- n,
- r = PL(o);
- function o() {
- var n;
- !function (e, t) {
- if (!(e instanceof t)) throw new TypeError('Cannot call a class as a function')
- }(this, o);
- for (var e = arguments.length, t = Array(e), a = 0; a < e; a++) t[a] = arguments[a];
- return CL(kL(n = r.call.apply(r, [
- this
- ].concat(t))), 'state', OL(OL({
- recommendationsEnabled: !!(n.props.forumDetails && n.props.forumDetails.features && n.props.forumDetails.features.recommendations)
- }, rr), {
- }, {
- selectedLayout: 0,
- isPreviewVisible: !0,
- validationError: [
- ],
- savedFields: rr
- })),
- CL(kL(n), 'confirmNavigationIfUnsaved', function () {
- if (n.hasUnsavedChanges()) return 'You have unsaved changes. Do you want to leave this page?'
- }),
- CL(kL(n), 'hasUnsavedChanges', function () {
- return Object.keys(n.state.savedFields).some(function (e) {
- return n.hasFieldChanged(e)
- })
- }),
- CL(kL(n), 'saveRecommendations', function () {
- n.state.recommendationsEnabled ? n.hasUnsavedChanges() && n.setState(function () {
- n.props.saveSettings({
- forum: n.props.selection.forum.shortname,
- data: {
- contentPreview: n.state.contentPreview,
- disableOverlay: n.state.disableOverlay,
- maxAgeDays: n.state.maxAgeDays,
- metaComments: n.state.metaComments,
- metaDate: n.state.metaDate,
- placement: n.state.placement,
- titleHidden: n.state.titleHidden
- },
- onSuccess: function () {
- n.setState(function (e) {
- return {
- validationError: [
- ],
- savedFields: {
- recommendationsEnabled: e.recommendationsEnabled,
- contentPreview: e.contentPreview,
- disableOverlay: e.disableOverlay,
- maxAgeDays: e.maxAgeDays,
- metaComments: e.metaComments,
- metaDate: e.metaDate,
- placement: e.placement,
- selectedLayout: e.selectedLayout
- }
- }
- })
- },
- onError: function (t) {
- n.setState(function (e) {
- return {
- validationError: e.validationError.push(t)
- }
- })
- }
- })
- }) : n.toggleRecommendationsEnabled()
- }),
- CL(kL(n), 'toggleRecommendationsEnabled', function () {
- n.setState(function (t) {
- n.props.toggleRecommendations({
- forum: n.props.selection.forum.shortname,
- data: {
- organicDiscoveryEnabled: t.recommendationsEnabled ? 0 : 1
- },
- onSuccess: function () {
- n.setState({
- recommendationsEnabled: !t.recommendationsEnabled,
- validationError: [
- ]
- }),
- t.recommendationsEnabled || n.saveRecommendations()
- },
- onError: function (e) {
- n.setState({
- validationError: t.validationError.push(e)
- })
- }
- })
- })
- }),
- CL(kL(n), 'handleCheckboxChange', function (e) {
- n.setState(CL({
- }, e.target.name, e.target.checked))
- }),
- CL(kL(n), 'resolveLayout', function (t) {
- var e = or.filter(function (e) {
- return t.disableOverlay === e.value.disableOverlay && t.titleHidden === e.value.titleHidden && t.contentPreview === e.value.contentPreview
- });
- return e.length ? e[0].key : - 1
- }),
- CL(kL(n), 'handleLayoutChange', function (e) {
- e = parseInt(e.target.parentElement.getAttribute('index'), 10);
- n.setState(OL({
- selectedLayout: e
- }, or[e].value))
- }),
- CL(kL(n), 'handleDateThresholdChange', function (e) {
- n.setState({
- maxAgeDays: parseInt(e.target.value, 10)
- })
- }),
- CL(kL(n), 'handlePlacementChange', function (e) {
- n.setState({
- placement: e.target.value
- })
- }),
- CL(kL(n), 'hasFieldChanged', function (e) {
- return n.state[e] !== n.state.savedFields[e] && !(null === n.state.savedFields[e] && '' === n.state[e])
- }),
- CL(kL(n), 'togglePreview', function () {
- n.setState(function (e) {
- return {
- isPreviewVisible: !e.isPreviewVisible
- }
- })
- }),
- CL(kL(n), 'recsOutsideAllowed', function () {
- return yo.a.isFeatureActive('recs_outside_embed', {
- forum: n.props.selection.forum.shortname
- })
- }),
- CL(kL(n), 'filterPlacementOptions', function () {
- return n.recsOutsideAllowed() ? ir : ir.filter(function (e) {
- return 'standalone' !== e.key
- })
- }),
- n
- }
- return e = o,
- (t = [
- {
- key: 'componentDidMount',
- value: function () {
- window.onbeforeunload = this.confirmNavigationIfUnsaved,
- this.props.fetchSettings(this.props.selection.forum.shortname),
- this.props.fetchForumDetails()
- }
- },
- {
- key: 'componentWillReceiveProps',
- value: function (e) {
- var t;
- this.props.isFetching && !e.isFetching && (t = this.resolveLayout(e), this.setState({
- recommendationsEnabled: e.recommendationsEnabledSynced,
- contentPreview: e.contentPreviewSynced,
- disableOverlay: e.disableOverlaySynced,
- maxAgeDays: e.maxAgeDaysSynced,
- metaComments: e.metaCommentsSynced,
- metaDate: e.metaDateSynced,
- placement: e.placementSynced,
- selectedLayout: t,
- titleHidden: e.titleHiddenSynced,
- savedFields: {
- recommendationsEnabled: e.recommendationsEnabledSynced,
- contentPreview: e.contentPreviewSynced,
- disableOverlay: e.disableOverlaySynced,
- maxAgeDays: e.maxAgeDaysSynced,
- metaComments: e.metaCommentsSynced,
- metaDate: e.metaDateSynced,
- placement: e.placementSynced,
- selectedLayout: t
- }
- }))
- }
- },
- {
- key: 'render',
- value: function () {
- return this.props.selection.organization && this.props.selection.organization.pollsOnly ? C.a.createElement(Cm, {
- isPolls: !1,
- organization: this.props.selection.organization
- }) : this.props.isFetching ? C.a.createElement(Ji, null) : (lr.settings = this.state, C.a.createElement('div', {
- className: 'settings-recommendations'
- }, this.recsOutsideAllowed() ? C.a.createElement(sh, {
- type: 'info',
- icon: 'info-badge',
- headline: C.a.createElement(C.a.Fragment, null, C.a.createElement('span', {
- className: 'dialog_box-tag',
- style: {
- background: '#5cb767'
- }
- }, 'BETA'), 'Looking to bring Recommendations outside the comments?'),
- detailsUrl: Pn.standaloneRecommendations,
- message: 'You can now display Recommendations as a standalone unit, anywhere on your site. Giving you the freedom to cultivate your audience and engage readers anywhere!',
- buttonText: 'Get started now',
- selection: this.props.selection
- }) : null, C.a.createElement('div', {
- className: 'content__wrap spacing-bottom-double'
- }, C.a.createElement('header', {
- className: 'settings__header'
- }, C.a.createElement('h2', {
- className: 'text-larger text-gray-darker spacing-bottom-small'
- }, 'Configure Recommendations'), C.a.createElement('p', {
- className: 'text-gray'
- }, 'Show links to discussions taking place on your site. ', C.a.createElement('a', {
- href: Pn.recommendations,
- target: '_blank',
- rel: 'noopener noreferrer'
- }, 'Learn more »'))), C.a.createElement('section', {
- className: 'settings__content'
- }, this.state.validationError && this.state.validationError.length || this.props.error ? C.a.createElement(Ki, {
- message: this.state.validationError && this.state.validationError.length ? C.a.createElement('span', null, this.state.validationError.map(function (e, t) {
- return C.a.createElement('span', {
- key: t
- }, e, C.a.createElement('br', null))
- })) : this.props.error,
- alertType: 'error'
- }) : null, C.a.createElement('div', {
- className: 'spacing-top'
- }, C.a.createElement(qv, {
- name: 'layout',
- label: 'Layout',
- idNamespace: 'recommendation-layout',
- additionalClass: 'recommendation-layout-image',
- options: or,
- value: this.state.selectedLayout,
- onChange: this.handleLayoutChange,
- shouldHighlight: this.hasFieldChanged('selectedLayout')
- })), C.a.createElement('div', {
- className: 'spacing-top'
- }, C.a.createElement(Ob, {
- name: 'metaDate',
- label: 'Meta Content',
- secondaryLabel: 'Show Publish Date',
- fieldsetAdditionalClass: 'fieldset__list',
- checked: this.state.metaDate,
- onChange: this.handleCheckboxChange,
- shouldHighlight: this.hasFieldChanged('metaDate') || this.hasFieldChanged('metaComments')
- }, C.a.createElement(Ob, {
- name: 'metaComments',
- secondaryLabel: 'Show Comment Count',
- fieldsetAdditionalClass: 'fieldset__list',
- checked: this.state.metaComments,
- onChange: this.handleCheckboxChange,
- ignoreFieldset: !0
- }))), C.a.createElement('div', {
- className: 'spacing-top'
- }, C.a.createElement(Mf, {
- name: 'dateThreshold',
- idNamespace: 'date-threshold',
- label: 'Date Threshold',
- options: sr,
- value: this.state.maxAgeDays,
- onChange: this.handleDateThresholdChange,
- readOnly: this.props.isSaving,
- disabled: this.props.isSaving,
- shouldHighlight: this.hasFieldChanged('maxAgeDays'),
- tooltip: 'Set a limit for the recommended article selection.'
- })), C.a.createElement('div', {
- className: 'spacing-top'
- }, C.a.createElement(Mf, {
- name: 'placement',
- idNamespace: 'placement',
- label: 'Placement',
- options: this.filterPlacementOptions(),
- value: this.state.placement,
- onChange: this.handlePlacementChange,
- width: 180,
- readOnly: this.props.isSaving,
- disabled: this.props.isSaving,
- shouldHighlight: this.hasFieldChanged('placement'),
- tooltip: 'Specify whether recommendations will appear above or below the comment thread.'
- })), C.a.createElement('div', {
- className: 'spacing-top-double'
- }, C.a.createElement(Bh, {
- buttonLabel: this.state.recommendationsEnabled ? 'Save' : 'Enable Recommendations on your site',
- disabled: this.state.recommendationsEnabled && !this.hasUnsavedChanges(),
- isSaving: this.props.isSaving,
- saveErr: !!this.props.error,
- isSaved: this.props.isSaved,
- onClick: this.saveRecommendations
- }), C.a.createElement('div', {
- className: 'fieldset fieldset--save spacing-top'
- }, C.a.createElement('div', {
- className: 'fieldset__label'
- }), C.a.createElement('div', {
- className: 'fieldset__block'
- }, C.a.createElement('button', {
- className: 'button button-fill button-medium',
- onClick: this.togglePreview
- }, this.state.isPreviewVisible ? 'Hide Preview' : 'Show Preview', C.a.createElement('span', {
- className: 'spacing-left-small icon icon-arrow'
- }))))), this.state.isPreviewVisible ? C.a.createElement('div', {
- className: 'spacing-top-double preview_container'
- }, C.a.createElement('div', {
- className: 'preview-heading text-gray'
- }, 'Desktop'), C.a.createElement(vL, lr)) : null, this.state.isPreviewVisible ? C.a.createElement('div', {
- className: 'spacing-top-double preview_container recommendations-mobile-preview'
- }, C.a.createElement('div', {
- className: 'preview-heading text-gray'
- }, 'Mobile'), C.a.createElement(vL, lr)) : null)), this.state.recommendationsEnabled ? C.a.createElement('div', {
- className: 'content__wrap'
- }, C.a.createElement('header', {
- className: 'settings__header settings-inline-section align align--between align--middle'
- }, C.a.createElement('div', {
- className: 'spacing-right-large'
- }, C.a.createElement('h2', {
- className: 'text-larger text-gray-darker spacing-bottom-small'
- }, 'Turn Recommendations off'), C.a.createElement('p', {
- className: 'text-gray'
- }, 'The Recommendations widget will be removed from all articles on your site.')), C.a.createElement('div', {
- className: 'align__item--no-shrink'
- }, C.a.createElement('button', {
- className: 'button button-fill--red button-medium',
- onClick: this.toggleRecommendationsEnabled
- }, 'Turn Recommendations off')))) : null))
- }
- }
- ]) && SL(e.prototype, t),
- n && SL(e, n),
- o
- }();
- CL(r, 'displayName', 'ForumSettingsRecommendations'),
- CL(r, 'propTypes', {
- selection: ht.isRequired,
- recommendationsEnabledSynced: b.a.bool,
- contentPreviewSynced: b.a.bool,
- disableOverlaySynced: b.a.bool,
- maxAgeDaysSynced: b.a.number,
- metaCommentsSynced: b.a.bool,
- metaDateSynced: b.a.bool,
- placementSynced: b.a.string,
- titleHiddenSynced: b.a.bool,
- isFetching: b.a.bool,
- isSaving: b.a.bool,
- isSaved: b.a.bool,
- error: b.a.string,
- toggleRecommendations: b.a.func.isRequired,
- fetchSettings: b.a.func.isRequired,
- saveSettings: b.a.func.isRequired,
- emitTrackingEvent: b.a.func.isRequired,
- forumDetails: $c,
- fetchForumDetails: b.a.func.isRequired
- });
- var sl = Object(u.connect) (function (e) {
- var t = e.recommendations;
- return OL(OL({
- forumDetails: e.forumDetails.forumDetails,
- selection: e.selection
- }, t), {
- }, {
- recommendationsEnabledSynced: t.recommendationsEnabled,
- contentPreviewSynced: t.contentPreview,
- disableOverlaySynced: t.disableOverlay,
- maxAgeDaysSynced: t.maxAgeDays,
- metaCommentsSynced: t.metaComments,
- metaDateSynced: t.metaDate,
- placementSynced: t.placement,
- titleHiddenSynced: t.titleHidden
- })
- }, OL(OL({
- fetchForumDetails: ig
- }, Ru), {
- }, {
- emitTrackingEvent: Xo({
- zone: 'recommendations',
- section: 'settings'
- })
- })) (Fo() (r)),
- RL = n(177),
- Wi = n(523),
- xL = n.n(Wi);
- function AL(t, e) {
- var n,
- a = Object.keys(t);
- return Object.getOwnPropertySymbols && (n = Object.getOwnPropertySymbols(t), e && (n = n.filter(function (e) {
- return Object.getOwnPropertyDescriptor(t, e).enumerable
- })), a.push.apply(a, n)),
- a
- }
- function DL(a) {
- for (var e = 1; e < arguments.length; e++) {
- var r = null != arguments[e] ? arguments[e] : {
- };
- e % 2 ? AL(Object(r), !0).forEach(function (e) {
- var t,
- n;
- n = r[t = e],
- t in (e = a) ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(a, Object.getOwnPropertyDescriptors(r)) : AL(Object(r)).forEach(function (e) {
- Object.defineProperty(a, e, Object.getOwnPropertyDescriptor(r, e))
- })
- }
- return a
- }
- go = {
- fetchSettings: function (e) {
- return function (t) {
- t({
- type: H.fetching
- }),
- io.a.call('forums/behindClick/details', {
- data: {
- forum: e
- },
- success: function (e) {
- t(DL({
- type: H.onFetch
- }, e.response))
- },
- error: function () {
- t({
- type: H.onFetchError,
- message: 'An error occurred trying to fetch your Behind a Click settings'
- })
- }
- })
- }
- },
- saveSettings: function (e) {
- var n = e.data,
- a = e.shortname,
- r = e.onSuccess,
- o = e.onError;
- return function (t) {
- t({
- type: H.saving
- }),
- io.a.call('forums/behindClick/update', {
- type: 'POST',
- data: {
- forum: a,
- titleEnabled: n.titleEnabled ? 1 : 0,
- titleText: n.titleText,
- titleCSS: n.titleCSS,
- buttonText: n.buttonText,
- buttonCSS: n.buttonCSS
- },
- success: function (e) {
- t({
- type: H.onSave
- }),
- r(e)
- },
- error: function (e) {
- t({
- type: H.onSaveError,
- message: 'An error occured trying to save your Behind a Click settings'
- }),
- o(e)
- }
- })
- }
- }
- };
- function jL(e) {
- return (jL = 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator ? function (e) {
- return typeof e
- }
- : function (e) {
- return e && 'function' == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? 'symbol' : typeof e
- }) (e)
- }
- function TL(t, e) {
- var n,
- a = Object.keys(t);
- return Object.getOwnPropertySymbols && (n = Object.getOwnPropertySymbols(t), e && (n = n.filter(function (e) {
- return Object.getOwnPropertyDescriptor(t, e).enumerable
- })), a.push.apply(a, n)),
- a
- }
- function IL(t) {
- for (var e = 1; e < arguments.length; e++) {
- var n = null != arguments[e] ? arguments[e] : {
- };
- e % 2 ? TL(Object(n), !0).forEach(function (e) {
- BL(t, e, n[e])
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(n)) : TL(Object(n)).forEach(function (e) {
- Object.defineProperty(t, e, Object.getOwnPropertyDescriptor(n, e))
- })
- }
- return t
- }
- function qL(e, t) {
- for (var n = 0; n < t.length; n++) {
- var a = t[n];
- a.enumerable = a.enumerable || !1,
- a.configurable = !0,
- 'value' in a && (a.writable = !0),
- Object.defineProperty(e, a.key, a)
- }
- }
- function FL(e, t) {
- return (FL = Object.setPrototypeOf || function (e, t) {
- return e.__proto__ = t,
- e
- }) (e, t)
- }
- function LL(n) {
- var a = function () {
- if ('undefined' == typeof Reflect || !Reflect.construct) return !1;
- if (Reflect.construct.sham) return !1;
- if ('function' == typeof Proxy) return !0;
- try {
- return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [
- ], function () {
- })),
- !0
- } catch (e) {
- return !1
- }
- }();
- return function () {
- var e,
- t = ML(n);
- return e = a ? (e = ML(this).constructor, Reflect.construct(t, arguments, e)) : t.apply(this, arguments),
- t = this,
- !(e = e) || 'object' !== jL(e) && 'function' != typeof e ? UL(t) : e
- }
- }
- function UL(e) {
- if (void 0 === e) throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called');
- return e
- }
- function ML(e) {
- return (ML = Object.setPrototypeOf ? Object.getPrototypeOf : function (e) {
- return e.__proto__ || Object.getPrototypeOf(e)
- }) (e)
- }
- function BL(e, t, n) {
- return t in e ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n,
- e
- }
- Ru = function () {
- !function (e, t) {
- if ('function' != typeof t && null !== t) throw new TypeError('Super expression must either be null or a function');
- e.prototype = Object.create(t && t.prototype, {
- constructor: {
- value: e,
- writable: !0,
- configurable: !0
- }
- }),
- t && FL(e, t)
- }(o, A);
- var e,
- t,
- n,
- r = LL(o);
- function o() {
- var n;
- !function (e, t) {
- if (!(e instanceof t)) throw new TypeError('Cannot call a class as a function')
- }(this, o);
- for (var e = arguments.length, t = Array(e), a = 0; a < e; a++) t[a] = arguments[a];
- return BL(UL(n = r.call.apply(r, [
- this
- ].concat(t))), 'state', {
- titleEnabled: !1,
- titleText: null,
- titleCSS: null,
- buttonText: null,
- buttonCSS: null,
- isPreviewVisible: !0,
- isDirty: !1,
- validationError: [
- ]
- }),
- BL(UL(n), 'confirmNavigationIfUnsaved', function () {
- if (n.state.isDirty) return 'You have unsaved changes. Do you want to leave this page?'
- }),
- BL(UL(n), 'resetDefaults', function (e) {
- e.preventDefault(),
- n.setState({
- buttonText: null,
- buttonCSS: null,
- isDirty: !0
- })
- }),
- BL(UL(n), 'togglePreview', function () {
- n.setState(function (e) {
- return {
- isPreviewVisible: !e.isPreviewVisible
- }
- })
- }),
- BL(UL(n), 'saveBehindClick', function () {
- var e;
- n.state.isDirty && (e = {
- titleEnabled: n.state.titleEnabled,
- titleText: n.state.titleText,
- titleCSS: n.state.titleCSS,
- buttonText: n.state.buttonText,
- buttonCSS: n.state.buttonCSS
- }, n.setState(function () {
- n.props.saveSettings({
- data: e,
- shortname: n.props.selection.forum.shortname,
- onSuccess: function () {
- n.setState({
- isDirty: !1,
- validationError: [
- ]
- })
- },
- onError: function (t) {
- n.setState(function (e) {
- return {
- isDirty: !0,
- validationError: e.validationError.push(t)
- }
- })
- }
- })
- }))
- }),
- BL(UL(n), 'handleTitleEnabledChange', function (e) {
- n.setState({
- titleEnabled: 'true' === e.target.value,
- isDirty: !0
- })
- }),
- BL(UL(n), 'handleTitleTextChange', function (e) {
- n.setState({
- titleText: e.target.value,
- isDirty: !0
- })
- }),
- BL(UL(n), 'handleTitleCSSChange', function (e) {
- n.setState({
- titleCSS: e.target.value,
- isDirty: !0
- })
- }),
- BL(UL(n), 'handleButtonTextChange', function (e) {
- n.setState({
- buttonText: e.target.value,
- isDirty: !0
- })
- }),
- BL(UL(n), 'handleButtonCSSChange', function (e) {
- n.setState({
- buttonCSS: e.target.value,
- isDirty: !0
- })
- }),
- n
- }
- return e = o,
- (t = [
- {
- key: 'componentDidMount',
- value: function () {
- window.onbeforeunload = this.confirmNavigationIfUnsaved,
- this.props.fetchSettings(this.props.selection.forum.shortname)
- }
- },
- {
- key: 'componentWillReceiveProps',
- value: function (e) {
- this.props.isFetching && !e.isFetching && this.setState({
- titleEnabled: e.titleEnabledSynced || !1,
- titleText: e.titleTextSynced,
- titleCSS: e.titleCSSSynced,
- buttonText: e.buttonTextSynced,
- buttonCSS: e.buttonCSSSynced
- })
- }
- },
- {
- key: 'render',
- value: function () {
- return this.props.isFetching ? C.a.createElement(Ji, null) : C.a.createElement('div', {
- className: 'settings-behind-click'
- }, C.a.createElement('div', {
- className: 'content__wrap spacing-bottom-double'
- }, C.a.createElement('header', {
- className: 'settings__header'
- }, C.a.createElement('h2', {
- className: 'text-larger text-gray-darker spacing-bottom-small'
- }, 'Behind a Click Configuration'), C.a.createElement('p', {
- className: 'text-gray'
- }, 'Improve page-loading by placing your comment section behind a button.')), C.a.createElement('section', {
- className: 'settings__content'
- }, this.state.validationError && this.state.validationError.length || this.props.error ? C.a.createElement(Ki, {
- message: this.state.validationError && this.state.validationError.length ? C.a.createElement('span', null, this.state.validationError.map(function (e, t) {
- return C.a.createElement('span', {
- key: t
- }, e, C.a.createElement('br', null))
- })) : this.props.error,
- alertType: 'error'
- }) : null, C.a.createElement(kf, {
- label: 'Enable Title',
- blockAdditionalClass: 'text-medium'
- }, C.a.createElement('p', {
- className: 'spacing-top-small'
- }, C.a.createElement('label', null, C.a.createElement('input', {
- type: 'radio',
- name: 'enable-title',
- value: !0,
- checked: this.state.titleEnabled,
- onChange: this.handleTitleEnabledChange
- }), 'Yes')), C.a.createElement('p', {
- className: 'spacing-top-small'
- }, C.a.createElement('label', null, C.a.createElement('input', {
- type: 'radio',
- name: 'enable-title',
- value: !1,
- checked: !this.state.titleEnabled,
- onChange: this.handleTitleEnabledChange
- }), 'No'))), this.state.titleEnabled ? C.a.createElement('div', {
- className: 'spacing-top'
- }, C.a.createElement($h, {
- name: 'title-text',
- value: this.state.titleText,
- label: 'Title',
- onChange: this.handleTitleTextChange,
- idNamespace: this.constructor.displayName
- }, C.a.createElement('p', {
- className: 'text-gray text-small spacing-top-small'
- }, 'You can use {postCount} to display the current number of comments.')), C.a.createElement($h, {
- name: 'button-css',
- value: this.state.titleCSS,
- label: 'CSS',
- onChange: this.handleTitleCSSChange,
- idNamespace: this.constructor.displayName,
- useTextarea: !0,
- rows: 5
- })) : null, C.a.createElement(kf, {
- label: 'Customize Button',
- blockAdditionalClass: 'text-medium'
- }, C.a.createElement('div', {
- className: 'spacing-top-small'
- }, 'The following options can be used to customize the appearance of the button that will be displayed on your site. You can also ', C.a.createElement('a', {
- href: '#',
- onClick: this.resetDefaults
- }, 'Reset to Default.'))), C.a.createElement('div', {
- className: 'spacing-top'
- }, C.a.createElement($h, {
- name: 'button-text',
- value: this.state.buttonText,
- label: 'Text',
- placeholder: RL.DEFAULT_BUTTON_TEXT,
- onChange: this.handleButtonTextChange,
- idNamespace: this.constructor.displayName
- }, C.a.createElement('p', {
- className: 'text-gray text-small spacing-top-small'
- }, 'You can use {postCount} to display the current number of comments.')), C.a.createElement($h, {
- name: 'button-css',
- value: this.state.buttonCSS,
- label: 'CSS',
- onChange: this.handleButtonCSSChange,
- idNamespace: this.constructor.displayName,
- useTextarea: !0,
- rows: 5
- })), C.a.createElement('div', {
- className: 'spacing-top-double'
- }, C.a.createElement(Bh, {
- buttonLabel: 'Save',
- disabled: !this.state.isDirty,
- isSaving: this.props.isSaving,
- saveErr: !!this.props.error,
- isSaved: this.props.isSaved,
- onClick: this.saveBehindClick
- }), C.a.createElement('div', {
- className: 'fieldset fieldset--save spacing-top'
- }, C.a.createElement('div', {
- className: 'fieldset__label'
- }), C.a.createElement('div', {
- className: 'fieldset__block'
- }, C.a.createElement('button', {
- className: 'button button-fill button-medium',
- onClick: this.togglePreview
- }, this.state.isPreviewVisible ? 'Hide Preview' : 'Show Preview', C.a.createElement('span', {
- className: 'spacing-left-small icon icon-arrow'
- }))))), this.state.isPreviewVisible ? C.a.createElement('div', {
- className: 'spacing-top-double behindclick__preview'
- }, C.a.createElement(xL.a, {
- postCount: 1337,
- buttonText: this.state.buttonText,
- buttonCSS: this.state.buttonCSS,
- titleEnabled: this.state.titleEnabled,
- titleText: this.state.titleText,
- titleCSS: this.state.titleCSS
- })) : null)))
- }
- }
- ]) && qL(e.prototype, t),
- n && qL(e, n),
- o
- }();
- BL(Ru, 'displayName', 'ForumSettingsBehindClick'),
- BL(Ru, 'propTypes', {
- selection: ht.isRequired,
- titleEnabledSynced: b.a.bool,
- titleTextSynced: b.a.string,
- titleCSSSynced: b.a.string,
- buttonTextSynced: b.a.string,
- buttonCSSSynced: b.a.string,
- isFetching: b.a.bool,
- isSaving: b.a.bool,
- isSaved: b.a.bool,
- error: b.a.string,
- fetchSettings: b.a.func.isRequired,
- saveSettings: b.a.func.isRequired,
- route: b.a.object
- });
- r = Object(u.connect) (function (e) {
- var t = e.selection,
- e = e.behindClick;
- return IL(IL({
- }, e), {
- }, {
- titleEnabledSynced: e.titleEnabled,
- titleTextSynced: e.titleText,
- titleCSSSynced: e.titleCSS,
- buttonTextSynced: e.buttonText,
- buttonCSSSynced: e.buttonCSS,
- selection: t
- })
- }, go) (Fo() (Ru));
- function zL(e) {
- return (zL = 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator ? function (e) {
- return typeof e
- }
- : function (e) {
- return e && 'function' == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? 'symbol' : typeof e
- }) (e)
- }
- function HL(e, t) {
- for (var n = 0; n < t.length; n++) {
- var a = t[n];
- a.enumerable = a.enumerable || !1,
- a.configurable = !0,
- 'value' in a && (a.writable = !0),
- Object.defineProperty(e, a.key, a)
- }
- }
- function GL(e, t) {
- return (GL = Object.setPrototypeOf || function (e, t) {
- return e.__proto__ = t,
- e
- }) (e, t)
- }
- function VL(n) {
- var a = function () {
- if ('undefined' == typeof Reflect || !Reflect.construct) return !1;
- if (Reflect.construct.sham) return !1;
- if ('function' == typeof Proxy) return !0;
- try {
- return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [
- ], function () {
- })),
- !0
- } catch (e) {
- return !1
- }
- }();
- return function () {
- var e,
- t = YL(n);
- return e = a ? (e = YL(this).constructor, Reflect.construct(t, arguments, e)) : t.apply(this, arguments),
- t = this,
- !(e = e) || 'object' !== zL(e) && 'function' != typeof e ? WL(t) : e
- }
- }
- function WL(e) {
- if (void 0 === e) throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called');
- return e
- }
- function YL(e) {
- return (YL = Object.setPrototypeOf ? Object.getPrototypeOf : function (e) {
- return e.__proto__ || Object.getPrototypeOf(e)
- }) (e)
- }
- function QL(e, t, n) {
- return t in e ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n,
- e
- }
- Wi = function () {
- !function (e, t) {
- if ('function' != typeof t && null !== t) throw new TypeError('Super expression must either be null or a function');
- e.prototype = Object.create(t && t.prototype, {
- constructor: {
- value: e,
- writable: !0,
- configurable: !0
- }
- }),
- t && GL(e, t)
- }(o, A);
- var e,
- t,
- n,
- r = VL(o);
- function o() {
- var t;
- !function (e, t) {
- if (!(e instanceof t)) throw new TypeError('Cannot call a class as a function')
- }(this, o);
- for (var e = arguments.length, n = Array(e), a = 0; a < e; a++) n[a] = arguments[a];
- return QL(WL(t = r.call.apply(r, [
- this
- ].concat(n))), 'handleChange', function (e) {
- t.props.editWords(e.target.value)
- }),
- t
- }
- return e = o,
- (t = [
- {
- key: 'componentDidMount',
- value: function () {
- this.props.fetchWords(this.props.selection.forum.shortname)
- }
- },
- {
- key: 'render',
- value: function () {
- return this.props.isFetching ? C.a.createElement(Ji, null) : C.a.createElement('div', null, C.a.createElement('div', {
- className: 'content__wrap spacing-bottom-double'
- }, C.a.createElement('header', {
- className: 'settings__header'
- }, C.a.createElement('h2', {
- className: 'text-larger text-gray-darker spacing-bottom-small'
- }, 'Set the tone for discussions in your community.'), C.a.createElement('p', {
- className: 'text-gray text-medium'
- }, 'Automatically approve/reject specific phrases and users.', C.a.createElement('a', {
- href: Pn.restrictedWordsHelp,
- target: '_blank'
- }, 'Learn more »'))), C.a.createElement('section', {
- className: 'section-contained clearfix text-gray settings__content text-medium'
- }, C.a.createElement($h, {
- useTextarea: !0,
- name: 'restricted-words',
- label: C.a.createElement('div', null, C.a.createElement('h2', null, 'Restricted Words'), C.a.createElement('p', {
- className: 'text-normal text-small'
- }, 'Comments containing these words will require moderator approval before being published.')),
- idNamespace: 'settings',
- value: this.props.words,
- inputOverrideClassName: 'input--textbox -taller',
- onChange: this.handleChange
- }, C.a.createElement('p', {
- className: 'text-gray text-small spacing-top-small spacing-bottom-narrow'
- }, 'Separate words with commas. You may use ', C.a.createElement('code', null, '.*'), ' (dot asterisk) as a wildcard, but be careful not to be too aggressive. For example, ', C.a.createElement('code', null, 's.*ck'), ' will match ', C.a.createElement('em', null, 'suck'), ', but also ', C.a.createElement('em', null, 'sock'), ' and ', C.a.createElement('em', null, 'stack'), '.'), C.a.createElement('p', {
- className: 'text-gray text-small spacing-top-small spacing-bottom-narrow'
- }, C.a.createElement('a', {
- href: Pn.sampleBadwords,
- target: '_blank'
- }, 'Here is a sample list of restricted words.')))), C.a.createElement('footer', {
- className: 'settings__footer'
- }, C.a.createElement(Bh, {
- onClick: this.props.updateWords.bind(this, this.props.selection.forum.shortname),
- isSaving: this.props.isSaving,
- isSaved: this.props.isSaved,
- disabled: !this.props.wordsChanged
- }), this.props.error ? C.a.createElement(Ki, {
- message: this.props.error,
- alertType: 'error',
- onRequestClose: this.props.clearError
- }) : null)))
- }
- }
- ]) && HL(e.prototype, t),
- n && HL(e, n),
- o
- }();
- QL(Wi, 'displayName', 'ForumSettingsRestrictedWords'),
- QL(Wi, 'propTypes', {
- selection: ht.isRequired,
- fetchWords: b.a.func.isRequired,
- editWords: b.a.func.isRequired,
- updateWords: b.a.func.isRequired,
- clearError: b.a.func.isRequired,
- words: b.a.string.isRequired,
- wordsChanged: b.a.bool.isRequired,
- isSaved: b.a.bool.isRequired,
- isSaving: b.a.bool.isRequired,
- isFetching: b.a.bool.isRequired,
- error: b.a.string
- });
- function KL(e) {
- var t = vo.a.Deferred();
- if (e.forum && e.entries) if (0 === e.entries.length) t.resolve();
- else {
- var n = e.checkErrors && e.checkErrors(e.entries);
- if (!n) return io.a.call(e.endpoint, {
- data: {
- forum: e.forum,
- word: e.entries
- },
- method: 'POST'
- });
- t.reject(n)
- } else t.reject();
- return t.promise()
- }
- go = {
- fetch: function (e) {
- return function (t) {
- t({
- type: ge.fetching
- }),
- io.a.call('blacklists/list', {
- data: {
- forum: e,
- type: 'word',
- limit: 0
- },
- success: function (e) {
- t({
- type: ge.update,
- entries: e.response.map(function (e) {
- return e.value
- })
- })
- },
- error: function () {
- t({
- type: ge.fetchFailed,
- message: 'An unknown error occurred trying to fetch your restricted words.'
- })
- }
- })
- }
- },
- save: function (s) {
- return function (t, e) {
- var n = e().restrictedWords,
- a = s,
- e = n.wordArr,
- r = e.reduce(function (e, t) {
- return e[t] = !0,
- e
- }, {
- }),
- o = je.a.uniq(je.a.escape(n.words.trim()).split(/\s*,\s*/)),
- i = o.reduce(function (e, t) {
- return e[t] = !0,
- e
- }, {
- }),
- n = o.filter(function (e) {
- return e && !r[e]
- }),
- e = e.filter(function (e) {
- return e && !i[e]
- });
- t({
- type: ge.saving
- }),
- KL({
- forum: a,
- entries: e,
- endpoint: 'blacklists/remove'
- }).then(function (e, t) {
- return KL({
- forum: e,
- entries: t,
- endpoint: 'blacklists/add',
- checkErrors: function (e) {
- for (var t = 0; t < e.length; t++) if (200 < e[t].length) return Error('Blacklist word '.concat(e[t], ' is too long. Only words of at most 200 characters can be added to the blacklist.'))
- }
- })
- }.bind(void 0, a, n)).then(function () {
- t({
- type: ge.saved,
- entries: o
- })
- }).fail(function (e) {
- t({
- type: ge.saveFailed,
- message: (e.length ? e[0] : e).message || 'An unknown error occurred trying to save your restricted words.'
- })
- })
- }
- },
- edit: function (e) {
- return {
- type: ge.edit,
- words: e
- }
- },
- clearError: function () {
- return {
- type: ge.clearError
- }
- }
- };
- function JL(t, e) {
- var n,
- a = Object.keys(t);
- return Object.getOwnPropertySymbols && (n = Object.getOwnPropertySymbols(t), e && (n = n.filter(function (e) {
- return Object.getOwnPropertyDescriptor(t, e).enumerable
- })), a.push.apply(a, n)),
- a
- }
- function $L(a) {
- for (var e = 1; e < arguments.length; e++) {
- var r = null != arguments[e] ? arguments[e] : {
- };
- e % 2 ? JL(Object(r), !0).forEach(function (e) {
- var t,
- n;
- n = r[t = e],
- t in (e = a) ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(a, Object.getOwnPropertyDescriptors(r)) : JL(Object(r)).forEach(function (e) {
- Object.defineProperty(a, e, Object.getOwnPropertyDescriptor(r, e))
- })
- }
- return a
- }
- function ZL(e, t) {
- if (null == e) return {
- };
- var n,
- a = function (e, t) {
- if (null == e) return {
- };
- var n,
- a,
- r = {
- },
- o = Object.keys(e);
- for (a = 0; a < o.length; a++) ~t.indexOf(n = o[a]) || (r[n] = e[n]);
- return r
- }(e, t);
- if (Object.getOwnPropertySymbols) for (var r = Object.getOwnPropertySymbols(e), o = 0; o < r.length; o++) ~t.indexOf(n = r[o]) || Object.prototype.propertyIsEnumerable.call(e, n) && (a[n] = e[n]);
- return a
- }
- Ru = Object(u.connect) (function (e) {
- var t = e.restrictedWords,
- t = ZL(t, [
- 'wordArr'
- ]),
- e = e.selection;
- return $L($L({
- }, t), {
- }, {
- selection: e
- })
- }, {
- fetchWords: go.fetch,
- editWords: go.edit,
- updateWords: go.save,
- clearError: go.clearError
- }) (Wi),
- go = function () {
- return C.a.createElement('div', {
- className: 'layout__content'
- }, C.a.createElement('div', {
- className: 'box clearfix'
- }, C.a.createElement('div', {
- className: 'admin_content'
- }, C.a.createElement('h1', null, '404'), C.a.createElement('p', null, 'Huh, this page is not available. Did you type the address correctly?'))))
- };
- function XL(e) {
- return (XL = 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator ? function (e) {
- return typeof e
- }
- : function (e) {
- return e && 'function' == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? 'symbol' : typeof e
- }) (e)
- }
- function eU(e, t) {
- for (var n = 0; n < t.length; n++) {
- var a = t[n];
- a.enumerable = a.enumerable || !1,
- a.configurable = !0,
- 'value' in a && (a.writable = !0),
- Object.defineProperty(e, a.key, a)
- }
- }
- function tU(e, t) {
- return (tU = Object.setPrototypeOf || function (e, t) {
- return e.__proto__ = t,
- e
- }) (e, t)
- }
- function nU(n) {
- var a = function () {
- if ('undefined' == typeof Reflect || !Reflect.construct) return !1;
- if (Reflect.construct.sham) return !1;
- if ('function' == typeof Proxy) return !0;
- try {
- return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [
- ], function () {
- })),
- !0
- } catch (e) {
- return !1
- }
- }();
- return function () {
- var e,
- t = rU(n);
- return e = a ? (e = rU(this).constructor, Reflect.construct(t, arguments, e)) : t.apply(this, arguments),
- t = this,
- !(e = e) || 'object' !== XL(e) && 'function' != typeof e ? aU(t) : e
- }
- }
- function aU(e) {
- if (void 0 === e) throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called');
- return e
- }
- function rU(e) {
- return (rU = Object.setPrototypeOf ? Object.getPrototypeOf : function (e) {
- return e.__proto__ || Object.getPrototypeOf(e)
- }) (e)
- }
- function oU(e, t, n) {
- return t in e ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n,
- e
- }
- var Wi = function () {
- !function (e, t) {
- if ('function' != typeof t && null !== t) throw new TypeError('Super expression must either be null or a function');
- e.prototype = Object.create(t && t.prototype, {
- constructor: {
- value: e,
- writable: !0,
- configurable: !0
- }
- }),
- t && tU(e, t)
- }(o, A);
- var e,
- t,
- n,
- r = nU(o);
- function o() {
- var e;
- !function (e, t) {
- if (!(e instanceof t)) throw new TypeError('Cannot call a class as a function')
- }(this, o);
- for (var t = arguments.length, n = Array(t), a = 0; a < t; a++) n[a] = arguments[a];
- return oU(aU(e = r.call.apply(r, [
- this
- ].concat(n))), 'state', {
- isOpen: !1
- }),
- oU(aU(e), 'handleClick', function () {
- e.setState({
- isOpen: !e.state.isOpen
- })
- }),
- e
- }
- return e = o,
- (t = [
- {
- key: 'render',
- value: function () {
- var e = Gc.test(window.location.pathname),
- t = Vc.test(window.location.pathname),
- n = this.state.isOpen ? 'nav__item dropdown-open' : 'nav__item';
- return C.a.createElement('nav', {
- className: 'layout__nav spacing-bottom'
- }, C.a.createElement('div', {
- className: 'nav--tablet-dropdown'
- }, C.a.createElement(v.Link, {
- className: n,
- activeClassName: 'active',
- to: ho.getRoute(Wc.LIST),
- onClick: this.handleClick,
- disabled: !this.props.organization.pollsActivationDate
- }, C.a.createElement('div', {
- className: 'nav-lnk -color-muted'
- }, C.a.createElement('div', {
- className: 'nav-lnk__blk'
- }, C.a.createElement('span', {
- className: 'button__text'
- }, 'My Polls')), C.a.createElement('div', {
- className: 'nav-lnk__pointer'
- }, C.a.createElement('span', {
- className: 'icon icon-right-bracket'
- })))), C.a.createElement(v.Link, {
- className: ''.concat(n).concat(e ? ' active' : ''),
- to: ho.getRoute(Wc.EDITOR),
- onClick: this.handleClick,
- disabled: !this.props.organization.pollsActivationDate
- }, C.a.createElement('div', {
- className: 'nav-lnk -color-muted'
- }, C.a.createElement('div', {
- className: 'nav-lnk__blk'
- }, C.a.createElement('span', {
- className: 'button__text'
- }, 'Editor')), C.a.createElement('div', {
- className: 'nav-lnk__pointer'
- }, C.a.createElement('span', {
- className: 'icon icon-right-bracket'
- })))), C.a.createElement(v.Link, {
- className: ''.concat(n).concat(t ? ' active' : ''),
- activeClassName: 'active',
- to: ho.getRoute(Wc.INSIGHTS),
- onClick: this.handleClick,
- disabled: !this.props.organization.pollsActivationDate
- }, C.a.createElement('div', {
- className: 'nav-lnk -color-muted'
- }, C.a.createElement('div', {
- className: 'nav-lnk__blk'
- }, C.a.createElement('span', {
- className: 'button__text'
- }, 'Analytics')), C.a.createElement('div', {
- className: 'nav-lnk__pointer'
- }, C.a.createElement('span', {
- className: 'icon icon-right-bracket'
- }))))))
- }
- }
- ]) && eU(e.prototype, t),
- n && eU(e, n),
- o
- }(),
- iU = Object(u.connect) (function (e) {
- return {
- organization: e.selection.organization
- }
- }) (Wi);
- function sU(e, t) {
- if (null == e) return {
- };
- var n,
- a = function (e, t) {
- if (null == e) return {
- };
- var n,
- a,
- r = {
- },
- o = Object.keys(e);
- for (a = 0; a < o.length; a++) ~t.indexOf(n = o[a]) || (r[n] = e[n]);
- return r
- }(e, t);
- if (Object.getOwnPropertySymbols) for (var r = Object.getOwnPropertySymbols(e), o = 0; o < r.length; o++) ~t.indexOf(n = r[o]) || Object.prototype.propertyIsEnumerable.call(e, n) && (a[n] = e[n]);
- return a
- }
- Wi = function (e) {
- var t = e.children,
- e = sU(e, [
- 'children'
- ]);
- return C.a.createElement('div', {
- className: 'section-contained'
- }, C.a.createElement('div', {
- className: 'layout layout--stacked-tablet'
- }, C.a.createElement('div', {
- className: 'layout__main'
- }, C.a.createElement(iU, null), C.a.createElement('div', {
- className: 'layout__content'
- }, C.a.cloneElement(t, e)))))
- };
- Wi.propTypes = {
- children: b.a.element.isRequired
- };
- var lU = Fo() (Wi);
- function cU(e) {
- return (cU = 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator ? function (e) {
- return typeof e
- }
- : function (e) {
- return e && 'function' == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? 'symbol' : typeof e
- }) (e)
- }
- function uU(t, e) {
- var n,
- a = Object.keys(t);
- return Object.getOwnPropertySymbols && (n = Object.getOwnPropertySymbols(t), e && (n = n.filter(function (e) {
- return Object.getOwnPropertyDescriptor(t, e).enumerable
- })), a.push.apply(a, n)),
- a
- }
- function pU(t) {
- for (var e = 1; e < arguments.length; e++) {
- var n = null != arguments[e] ? arguments[e] : {
- };
- e % 2 ? uU(Object(n), !0).forEach(function (e) {
- vU(t, e, n[e])
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(n)) : uU(Object(n)).forEach(function (e) {
- Object.defineProperty(t, e, Object.getOwnPropertyDescriptor(n, e))
- })
- }
- return t
- }
- function dU(e) {
- return function (e) {
- if (Array.isArray(e)) return mU(e)
- }(e) || function (e) {
- if ('undefined' != typeof Symbol && null != e[Symbol.iterator] || null != e['@@iterator']) return Array.from(e)
- }(e) || function (e, t) {
- if (e) {
- if ('string' == typeof e) return mU(e, t);
- var n = Object.prototype.toString.call(e).slice(8, - 1);
- return 'Map' === (n = 'Object' === n && e.constructor ? e.constructor.name : n) || 'Set' === n ? Array.from(e) : 'Arguments' === n || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n) ? mU(e, t) : void 0
- }
- }(e) || function () {
- throw new TypeError('Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.')
- }()
- }
- function mU(e, t) {
- for (var n = 0, a = Array(t = null == t || e.length < t ? e.length : t); n < t; n++) a[n] = e[n];
- return a
- }
- function fU(e, t) {
- for (var n = 0; n < t.length; n++) {
- var a = t[n];
- a.enumerable = a.enumerable || !1,
- a.configurable = !0,
- 'value' in a && (a.writable = !0),
- Object.defineProperty(e, a.key, a)
- }
- }
- function hU(e, t) {
- return (hU = Object.setPrototypeOf || function (e, t) {
- return e.__proto__ = t,
- e
- }) (e, t)
- }
- function gU(n) {
- var a = function () {
- if ('undefined' == typeof Reflect || !Reflect.construct) return !1;
- if (Reflect.construct.sham) return !1;
- if ('function' == typeof Proxy) return !0;
- try {
- return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [
- ], function () {
- })),
- !0
- } catch (e) {
- return !1
- }
- }();
- return function () {
- var e,
- t = bU(n);
- return e = a ? (e = bU(this).constructor, Reflect.construct(t, arguments, e)) : t.apply(this, arguments),
- t = this,
- !(e = e) || 'object' !== cU(e) && 'function' != typeof e ? yU(t) : e
- }
- }
- function yU(e) {
- if (void 0 === e) throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called');
- return e
- }
- function bU(e) {
- return (bU = Object.setPrototypeOf ? Object.getPrototypeOf : function (e) {
- return e.__proto__ || Object.getPrototypeOf(e)
- }) (e)
- }
- function vU(e, t, n) {
- return t in e ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n,
- e
- }
- Wi = function () {
- !function (e, t) {
- if ('function' != typeof t && null !== t) throw new TypeError('Super expression must either be null or a function');
- e.prototype = Object.create(t && t.prototype, {
- constructor: {
- value: e,
- writable: !0,
- configurable: !0
- }
- }),
- t && hU(e, t)
- }(o, A);
- var e,
- t,
- n,
- a = gU(o);
- function o() {
- var r;
- !function (e, t) {
- if (!(e instanceof t)) throw new TypeError('Cannot call a class as a function')
- }(this, o);
- for (var e = arguments.length, t = Array(e), n = 0; n < e; n++) t[n] = arguments[n];
- return vU(yU(r = a.call.apply(a, [
- this
- ].concat(t))), 'inputRef', C.a.createRef()),
- vU(yU(r), 'handleFocus', function () {
- r.inputRef.current && r.inputRef.current.focus()
- }),
- vU(yU(r), 'handleAddAnswer', function (e) {
- var t = {
- answers: [
- ].concat(dU(r.props.questions[e].answers), [
- {
- text: ''
- }
- ])
- };
- r.props.updateQuestion(e, t, r.handleFocus)
- }),
- vU(yU(r), 'handleUpdateAnswer', function (e, n, a) {
- var t = r.props.questions[e],
- t = t.answers && t.answers.map(function (e, t) {
- return t === n ? pU(pU({
- }, e), a) : e
- });
- r.props.updateQuestion(e, {
- answers: t
- })
- }),
- vU(yU(r), 'handleDeleteAnswer', function (e, n) {
- var t = r.props.questions[e],
- t = t && t.answers.filter(function (e, t) {
- return t !== n
- });
- r.props.updateQuestion(e, {
- answers: t
- })
- }),
- r
- }
- return e = o,
- (t = [
- {
- key: 'render',
- value: function () {
- var r = this;
- return C.a.createElement('div', {
- className: 'poll-creator__container'
- }, C.a.createElement('header', {
- className: 'polls__section-header'
- }, C.a.createElement('h2', {
- className: 'text-larger text-gray-darker spacing-bottom-small'
- }, 'Poll Questions')), C.a.createElement('table', {
- className: 'poll-creator__table'
- }, C.a.createElement('colgroup', null, C.a.createElement('col', {
- span: '1',
- className: 'poll-creator__table-label-col'
- }), C.a.createElement('col', {
- span: '1',
- className: 'poll-creator__table-input-col'
- }), C.a.createElement('col', {
- span: '1',
- className: 'poll-creator__table-type-col'
- })), C.a.createElement('tbody', null, this.props.questions.map(function (n, a) {
- return C.a.createElement(C.a.Fragment, {
- key: a
- }, C.a.createElement('tr', {
- className: 'poll-creator__table-row'
- }, C.a.createElement('td', {
- className: 'question-label-cell --mobile'
- }, C.a.createElement('label', {
- htmlFor: 'question-'.concat(a + 1),
- className: 'fieldset__label text-gray'
- }, 'Question ', a + 1))), C.a.createElement('tr', {
- className: 'poll-creator__table-row'
- }, C.a.createElement('td', {
- className: 'question-type-cell --mobile'
- }, C.a.createElement(Mf, {
- name: 'question-type',
- options: jc,
- value: n.type,
- onChange: function (e) {
- return r.props.updateQuestion(a, {
- type: e.target.value
- })
- },
- idNamespace: r.constructor.displayName,
- disabled: r.props.isSyncing || r.props.isPublished
- }), !r.props.isPublished && C.a.createElement('button', {
- className: 'delete-button'.concat(r.props.questions.length <= Cc.MIN_QUESTIONS ? ' --hidden' : '').concat(r.props.isSyncing ? ' -disabled' : ''),
- onClick: function () {
- return r.props.deleteQuestion(a)
- },
- disabled: r.props.isSyncing
- }, C.a.createElement('span', {
- className: 'icon-delete'
- })))), C.a.createElement('tr', {
- className: 'poll-creator__table-row'
- }, C.a.createElement('td', {
- className: 'question-label-cell --desktop'
- }, C.a.createElement('label', {
- htmlFor: 'question-'.concat(a + 1),
- className: 'fieldset__label text-gray'
- }, 'Question ', a + 1)), C.a.createElement('td', {
- className: 'question-input-cell'
- }, C.a.createElement($h, {
- name: 'question-'.concat(a),
- value: n.text,
- placeholder: 'What\'s your question?',
- labelAdditionalClass: 'hidden',
- fieldsetAdditionalClass: 'spacing-top-none',
- onChange: function (e) {
- return r.props.updateQuestion(a, {
- text: e.target.value
- })
- },
- maxLength: Cc.MAX_QUESTION_LENGTH,
- disabled: r.props.isSyncing || r.props.isPublished,
- inputState: r.props.errors[a] && r.props.errors[a].text ? 'error' : 'none',
- showLimit: Cc.MAX_QUESTION_LENGTH - 10 <= n.text.length,
- spellCheck: !0
- })), C.a.createElement('td', {
- className: 'question-type-cell --desktop'
- }, C.a.createElement(Mf, {
- name: 'question-type',
- options: jc,
- value: n.type,
- onChange: function (e) {
- return r.props.updateQuestion(a, {
- type: e.target.value
- })
- },
- idNamespace: r.constructor.displayName,
- disabled: r.props.isSyncing || r.props.isPublished
- }), !r.props.isPublished && C.a.createElement('button', {
- className: 'delete-button'.concat(r.props.questions.length <= Cc.MIN_QUESTIONS ? ' --hidden' : '').concat(r.props.isSyncing ? ' -disabled' : ''),
- onClick: function () {
- return r.props.deleteQuestion(a)
- },
- disabled: r.props.isSyncing
- }, C.a.createElement('span', {
- className: 'icon-delete'
- })))), n.answers.map(function (e, t) {
- return C.a.createElement('tr', {
- className: 'poll-creator__table-row',
- key: t
- }, C.a.createElement('td', null), C.a.createElement('td', null, C.a.createElement('div', {
- className: 'poll-creator__question-answer__container'
- }, C.a.createElement($h, {
- name: 'answer',
- value: e.text,
- placeholder: 'Answer '.concat(t + 1),
- inputOverrideClassName: 'input--textbox poll-creator__answer-input',
- fieldsetAdditionalClass: 'spacing-top-none',
- onChange: function (e) {
- return r.handleUpdateAnswer(a, t, {
- text: e.target.value
- })
- },
- maxLength: Cc.MAX_ANSWER_LENGTH,
- inputRef: r.inputRef,
- disabled: r.props.isSyncing || r.props.isPublished,
- inputState: r.props.errors[a] && r.props.errors[a].answers && r.props.errors[a].answers.has(t) ? 'error' : 'none',
- showLimit: Cc.MAX_ANSWER_LENGTH - 10 <= e.text.length,
- spellCheck: !0
- }), C.a.createElement('input', {
- type: n.type === xc.MULTI ? 'checkbox' : 'radio',
- className: 'poll-creator__answer-icon',
- disabled: !0
- }))), C.a.createElement('td', null, !r.props.isPublished && C.a.createElement('button', {
- className: 'delete-button'.concat(n.answers.length <= Cc.MIN_ANSWERS ? ' --hidden' : '').concat(r.props.isSyncing ? ' -disabled' : ''),
- onClick: function () {
- return r.handleDeleteAnswer(a, t)
- },
- disabled: r.props.isSyncing
- }, C.a.createElement('span', {
- className: 'icon-delete'
- }))))
- }), r.props.questions[a].answers.length < Cc.MAX_ANSWERS && !r.props.isPublished ? C.a.createElement('tr', {
- className: 'poll-creator__table-row'
- }, C.a.createElement('td', null), C.a.createElement('td', null, C.a.createElement('div', {
- className: 'poll-creator__question-answer__container'
- }, C.a.createElement($h, {
- name: 'answer',
- placeholder: 'Add Answer',
- fieldsetAdditionalClass: 'spacing-top-none',
- onChange: function () {
- return r.handleAddAnswer(a)
- },
- onClick: function () {
- return r.handleAddAnswer(a)
- },
- disabled: r.props.isSyncing,
- readOnly: !0
- }))), C.a.createElement('td', null)) : null)
- }), this.props.questions.length < Cc.MAX_QUESTIONS && !this.props.isPublished && C.a.createElement('tr', null, C.a.createElement('td', null), C.a.createElement('td', null, C.a.createElement('button', {
- id: 'add-question-button',
- className: 'poll-creator__add-question button button-fill--brand button-padding-wider button-medium',
- onClick: this.props.addQuestion,
- disabled: this.props.isSyncing
- }, '+ Add another question')), C.a.createElement('td', null)))))
- }
- }
- ]) && fU(e.prototype, t),
- n && fU(e, n),
- o
- }();
- vU(Wi, 'displayName', 'PollQuestionsEditor'),
- vU(Wi, 'propTypes', {
- questions: b.a.arrayOf(Lc).isRequired,
- updateQuestion: b.a.func.isRequired,
- addQuestion: b.a.func.isRequired,
- deleteQuestion: b.a.func.isRequired,
- isSyncing: b.a.bool.isRequired,
- isPublished: b.a.bool.isRequired,
- errors: b.a.arrayOf(Mc)
- });
- var _U = Wi,
- EU = function (e, t) {
- return '<div class="disqus_poll" data-disqus-poll-id="'.concat(t, '"></div>\n<script>\n (function() {\n if (document.getElementById(\'disqus_polls_script\'))\n // polls.js script already loaded, don\'t load a second time\n return;\n var d = document, s = d.createElement(\'script\');\n s.id = \'disqus_polls_script\';\n s.src = \'https://').concat(e, '.disqus.com/polls.js\';\n (d.head || d.body).appendChild(s);\n })();\n</script>\n<noscript>\n Please enable JavaScript to view the poll powered by Disqus.\n</noscript>')
- };
- function OU(e) {
- return (OU = 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator ? function (e) {
- return typeof e
- }
- : function (e) {
- return e && 'function' == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? 'symbol' : typeof e
- }) (e)
- }
- function SU(e, t) {
- for (var n = 0; n < t.length; n++) {
- var a = t[n];
- a.enumerable = a.enumerable || !1,
- a.configurable = !0,
- 'value' in a && (a.writable = !0),
- Object.defineProperty(e, a.key, a)
- }
- }
- function wU(e, t) {
- return (wU = Object.setPrototypeOf || function (e, t) {
- return e.__proto__ = t,
- e
- }) (e, t)
- }
- function PU(n) {
- var a = function () {
- if ('undefined' == typeof Reflect || !Reflect.construct) return !1;
- if (Reflect.construct.sham) return !1;
- if ('function' == typeof Proxy) return !0;
- try {
- return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [
- ], function () {
- })),
- !0
- } catch (e) {
- return !1
- }
- }();
- return function () {
- var e,
- t = NU(n);
- return e = a ? (e = NU(this).constructor, Reflect.construct(t, arguments, e)) : t.apply(this, arguments),
- t = this,
- !(e = e) || 'object' !== OU(e) && 'function' != typeof e ? kU(t) : e
- }
- }
- function kU(e) {
- if (void 0 === e) throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called');
- return e
- }
- function NU(e) {
- return (NU = Object.setPrototypeOf ? Object.getPrototypeOf : function (e) {
- return e.__proto__ || Object.getPrototypeOf(e)
- }) (e)
- }
- function CU(e, t, n) {
- return t in e ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n,
- e
- }
- Mc = function () {
- !function (e, t) {
- if ('function' != typeof t && null !== t) throw new TypeError('Super expression must either be null or a function');
- e.prototype = Object.create(t && t.prototype, {
- constructor: {
- value: e,
- writable: !0,
- configurable: !0
- }
- }),
- t && wU(e, t)
- }(o, A);
- var e,
- t,
- n,
- r = PU(o);
- function o() {
- var e;
- !function (e, t) {
- if (!(e instanceof t)) throw new TypeError('Cannot call a class as a function')
- }(this, o);
- for (var t = arguments.length, n = Array(t), a = 0; a < t; a++) n[a] = arguments[a];
- return CU(kU(e = r.call.apply(r, [
- this
- ].concat(n))), 'state', {
- isOpen: !0,
- isChecked: !1
- }),
- CU(kU(e), 'open', function () {
- e.setState({
- isOpen: !0
- })
- }),
- CU(kU(e), 'close', function () {
- e.setState({
- isOpen: !1
- }),
- Is.a.set(Hc, e.state.isChecked),
- e.props.handleShowPollTagInstructions(!1)
- }),
- CU(kU(e), 'handleCheck', function () {
- e.setState(function (e) {
- return {
- isChecked: !e.isChecked
- }
- })
- }),
- e
- }
- return e = o,
- (t = [
- {
- key: 'render',
- value: function () {
- return C.a.createElement('div', null, C.a.createElement(_.a, {
- isOpen: this.state.isOpen,
- onRequestClose: this.close,
- 'admin-modal': 'admin-modal',
- portalClassName: 'ReactModalPortal --poll-tag-instructions'
- }, C.a.createElement('div', {
- className: 'modal-content'
- }, C.a.createElement('div', {
- className: 'modal-header'
- }, C.a.createElement('h4', {
- className: 'modal-title'
- }, C.a.createElement('span', null, 'Disqus Poll Tag Installation'))), C.a.createElement('div', {
- className: 'modal-body'
- }, C.a.createElement('p', null, 'Your copied Disqus Poll Tags include a snippet of code that can be placed in your page source code. More specifically, placed in the page ', C.a.createElement('code', null, '<body/>'), ' ', C.a.createElement('span', {
- className: 'hljs-emphasis'
- }, '(ex. In-article, side rail)'), ' essentially wherever you want the poll to load.'), C.a.createElement('p', null, 'We recommend that you copy and paste the tags to your page source, save, and then preview the page to confirm desired poll placement prior to launching. Any modification of these tags may impact the functionality of the poll itself, including engagement metrics.'), C.a.createElement('p', null, 'For a more detailed guide on how to install Disqus Poll Tags, reference our ', C.a.createElement('a', {
- href: 'https://help.disqus.com/en/',
- target: '_blank',
- rel: 'noopener noreferrer'
- }, 'Help FAQ'), '.'), C.a.createElement(YE, {
- language: 'html'
- }, EU(this.props.forum, this.props.pollId || 'universal'))), C.a.createElement('div', {
- className: 'modal-footer'
- }, C.a.createElement(Ob, {
- name: 'pollTagInstructionsCheckbox',
- checked: this.state.isChecked,
- secondaryLabel: 'Do not show this to me again',
- onChange: this.handleCheck
- }), C.a.createElement('button', {
- type: 'button',
- className: 'button button-link button-outline -border-blue-dark',
- onClick: this.close
- }, 'Close')))))
- }
- }
- ]) && SU(e.prototype, t),
- n && SU(e, n),
- o
- }();
- CU(Mc, 'displayName', 'PollTagInstructions');
- var RU = Mc,
- Wi = n(524);
- function xU(t, e) {
- var n,
- a = Object.keys(t);
- return Object.getOwnPropertySymbols && (n = Object.getOwnPropertySymbols(t), e && (n = n.filter(function (e) {
- return Object.getOwnPropertyDescriptor(t, e).enumerable
- })), a.push.apply(a, n)),
- a
- }
- function AU(a) {
- for (var e = 1; e < arguments.length; e++) {
- var r = null != arguments[e] ? arguments[e] : {
- };
- e % 2 ? xU(Object(r), !0).forEach(function (e) {
- var t,
- n;
- n = r[t = e],
- t in (e = a) ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(a, Object.getOwnPropertyDescriptors(r)) : xU(Object(r)).forEach(function (e) {
- Object.defineProperty(a, e, Object.getOwnPropertyDescriptor(r, e))
- })
- }
- return a
- }
- var DU = new (n.n(Wi).a) ('previewed_polls_cache', 86400);
- DU.getAll();
- function jU(e) {
- return ct.a.utc(e).local().format()
- }
- Mc = {
- fetchPollDetails: function (t) {
- return function (a, e) {
- e = (e().selection.forum || {
- }).shortname;
- return a({
- type: ce.isFetching
- }),
- io.a.call('polls/details', {
- data: {
- forum: e,
- pollId: t
- }
- }).then(function (e) {
- var t = jU(e.response.startDate),
- n = jU(e.response.endDate),
- n = AU(AU({
- }, e.response), {
- }, {
- startDate: t,
- endDate: n
- });
- a({
- type: ce.onFetch,
- response: n
- })
- })
- }
- },
- save: function (n) {
- return function (a, e) {
- var t = n.id ? 'polls/update' : 'polls/create',
- e = (e().selection.forum || {
- }).shortname;
- return a({
- type: ce.isSyncing
- }),
- io.a.call(t, {
- data: {
- forum: e,
- poll: JSON.stringify(n)
- },
- method: 'POST'
- }).then(function (e) {
- var t = jU(e.response.startDate),
- n = jU(e.response.endDate),
- n = AU(AU({
- }, e.response), {
- }, {
- startDate: t,
- endDate: n
- });
- return a({
- type: ce.onSave,
- response: n
- }),
- n
- })
- }
- },
- delete : function (n) {
- return function (e, t) {
- t = (t().selection.forum || {
- }).shortname;
- return e({
- type: ce.isSyncing
- }),
- io.a.call('polls/delete', {
- data: {
- pollId: n,
- forum: t
- },
- method: 'POST'
- }).then(function () {
- e({
- type: ce.onDelete,
- pollId: n
- })
- })
- }
- },
- publish: function (n) {
- return function (e, t) {
- t = (t().selection.forum || {
- }).shortname;
- return e({
- type: ce.isSyncing
- }),
- io.a.call('polls/publish', {
- data: {
- pollId: n,
- forum: t
- },
- method: 'POST'
- }).then(function () {
- e({
- type: ce.onPublish,
- pollId: n
- })
- })
- }
- },
- preview: function (r) {
- return function (n, e) {
- var t,
- a = (e().selection.forum || {
- }).shortname;
- return n({
- type: ce.isSyncing
- }),
- (e = DU.getItem((t = r).id) || DU.getItem(zc)) && JSON.stringify(e.lastPreviewedPollState.questions) === JSON.stringify(t.questions) && e.lastPreviewedPollState.name === t.name && e.lastPreviewedPollState.id === t.id ? Promise.resolve({
- previewId: DU.getItem(r.id || zc).previewId
- }).then(function (e) {
- return n({
- type: ce.onPreview
- }),
- e
- }) : io.a.call('polls/preview', {
- data: {
- forum: a,
- poll: JSON.stringify(r)
- },
- method: 'POST'
- }).then(function (e) {
- var t = e.response;
- return DU.setItem((e = r).id || zc, {
- lastPreviewedPollState: e,
- previewId: t.previewId
- }),
- n({
- type: ce.onPreview
- }),
- t
- })
- }
- },
- resetSyncedPoll: function () {
- return function (e) {
- e({
- type: ce.reset
- })
- }
- }
- };
- function TU(e) {
- return (TU = 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator ? function (e) {
- return typeof e
- }
- : function (e) {
- return e && 'function' == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? 'symbol' : typeof e
- }) (e)
- }
- function IU(e) {
- return function (e) {
- if (Array.isArray(e)) return qU(e)
- }(e) || function (e) {
- if ('undefined' != typeof Symbol && null != e[Symbol.iterator] || null != e['@@iterator']) return Array.from(e)
- }(e) || function (e, t) {
- if (e) {
- if ('string' == typeof e) return qU(e, t);
- var n = Object.prototype.toString.call(e).slice(8, - 1);
- return 'Map' === (n = 'Object' === n && e.constructor ? e.constructor.name : n) || 'Set' === n ? Array.from(e) : 'Arguments' === n || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n) ? qU(e, t) : void 0
- }
- }(e) || function () {
- throw new TypeError('Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.')
- }()
- }
- function qU(e, t) {
- for (var n = 0, a = Array(t = null == t || e.length < t ? e.length : t); n < t; n++) a[n] = e[n];
- return a
- }
- function FU(t, e) {
- var n,
- a = Object.keys(t);
- return Object.getOwnPropertySymbols && (n = Object.getOwnPropertySymbols(t), e && (n = n.filter(function (e) {
- return Object.getOwnPropertyDescriptor(t, e).enumerable
- })), a.push.apply(a, n)),
- a
- }
- function LU(t) {
- for (var e = 1; e < arguments.length; e++) {
- var n = null != arguments[e] ? arguments[e] : {
- };
- e % 2 ? FU(Object(n), !0).forEach(function (e) {
- GU(t, e, n[e])
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(n)) : FU(Object(n)).forEach(function (e) {
- Object.defineProperty(t, e, Object.getOwnPropertyDescriptor(n, e))
- })
- }
- return t
- }
- function UU(e, t) {
- for (var n = 0; n < t.length; n++) {
- var a = t[n];
- a.enumerable = a.enumerable || !1,
- a.configurable = !0,
- 'value' in a && (a.writable = !0),
- Object.defineProperty(e, a.key, a)
- }
- }
- function MU(e, t) {
- return (MU = Object.setPrototypeOf || function (e, t) {
- return e.__proto__ = t,
- e
- }) (e, t)
- }
- function BU(n) {
- var a = function () {
- if ('undefined' == typeof Reflect || !Reflect.construct) return !1;
- if (Reflect.construct.sham) return !1;
- if ('function' == typeof Proxy) return !0;
- try {
- return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [
- ], function () {
- })),
- !0
- } catch (e) {
- return !1
- }
- }();
- return function () {
- var e,
- t = HU(n);
- return e = a ? (e = HU(this).constructor, Reflect.construct(t, arguments, e)) : t.apply(this, arguments),
- t = this,
- !(e = e) || 'object' !== TU(e) && 'function' != typeof e ? zU(t) : e
- }
- }
- function zU(e) {
- if (void 0 === e) throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called');
- return e
- }
- function HU(e) {
- return (HU = Object.setPrototypeOf ? Object.getPrototypeOf : function (e) {
- return e.__proto__ || Object.getPrototypeOf(e)
- }) (e)
- }
- function GU(e, t, n) {
- return t in e ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n,
- e
- }
- var VU = 'error_',
- WU = 'success_',
- Wi = function () {
- !function (e, t) {
- if ('function' != typeof t && null !== t) throw new TypeError('Super expression must either be null or a function');
- e.prototype = Object.create(t && t.prototype, {
- constructor: {
- value: e,
- writable: !0,
- configurable: !0
- }
- }),
- t && MU(e, t)
- }(r, A);
- var e,
- t,
- n,
- a = BU(r);
- function r() {
- var o;
- !function (e, t) {
- if (!(e instanceof t)) throw new TypeError('Cannot call a class as a function')
- }(this, r);
- for (var e = arguments.length, t = Array(e), n = 0; n < e; n++) t[n] = arguments[n];
- return GU(zU(o = a.call.apply(a, [
- this
- ].concat(t))), 'state', {
- hasChanges: !1,
- hasCopied: !1,
- pollHasChanged: !1,
- id: null,
- name: '',
- startDate: ct() ().startOf('day'),
- endDate: ct() ().add(1, 'week').endOf('day'),
- nonUniversal: !1,
- published: !1,
- requireAuth: !1,
- voteInterval: null,
- questions: [
- {
- text: '',
- type: Ac,
- answers: [
- {
- text: ''
- },
- {
- text: ''
- }
- ]
- }
- ],
- errors: {
- pollName: !1,
- questions: [
- ]
- },
- showPollTagInstructions: !1
- }),
- GU(zU(o), 'syncPollState', function () {
- o.setState(LU(LU({
- }, o.props.syncedPoll), {
- }, {
- startDate: ct() (o.props.syncedPoll.startDate),
- endDate: ct() (o.props.syncedPoll.endDate),
- hasChanges: !1,
- pollHasChanged: !0
- })),
- o.props.history.push(ho.getRoute('/polls/editor/'.concat(o.props.syncedPoll.id)))
- }),
- GU(zU(o), 'resetPollState', function () {
- o.setState({
- hasChanges: !1,
- hasCopied: !1,
- pollHasChanged: !1,
- id: null,
- name: '',
- startDate: ct() ().startOf('day'),
- endDate: ct() ().add(1, 'week').endOf('day'),
- published: !1,
- requireAuth: !1,
- voteInterval: null,
- questions: [
- {
- text: '',
- type: Ac,
- answers: [
- {
- text: ''
- },
- {
- text: ''
- }
- ]
- }
- ]
- })
- }),
- GU(zU(o), 'handleDateChange', function (e, t) {
- o.setState({
- startDate: e.startOf('day'),
- endDate: t.endOf('day'),
- hasChanges: !0
- })
- }),
- GU(zU(o), 'handleInputChange', function (e, t) {
- var n = (GU(n = {
- }, e, 'checkbox' === t.target.type ? t.target.checked : t.target.value), GU(n, VU + e, null), GU(n, WU + e, null), GU(n, 'hasChanges', !0), n);
- o.setState(n)
- }),
- GU(zU(o), 'handleVoteIntervalToggle', function (e) {
- o.setState({
- voteInterval: e.target.checked ? Ic : null,
- hasChanges: !0
- })
- }),
- GU(zU(o), 'handleUpdateQuestion', function (n, a, e) {
- var t = o.state.questions.map(function (e, t) {
- return t === n ? LU(LU({
- }, e), a) : e
- });
- o.setState({
- questions: t,
- hasChanges: !0
- }, e)
- }),
- GU(zU(o), 'handleAddQuestion', function () {
- var e = {
- text: '',
- type: Ac,
- answers: [
- {
- text: ''
- },
- {
- text: ''
- }
- ]
- },
- e = [
- ].concat(IU(o.state.questions), [
- e
- ]);
- o.setState({
- questions: e,
- hasChanges: !0
- })
- }),
- GU(zU(o), 'handleDeleteQuestion', function (n) {
- var e = o.state.questions.filter(function (e, t) {
- return t !== n
- });
- o.setState({
- questions: e,
- hasChanges: !0
- })
- }),
- GU(zU(o), 'validateEntries', function () {
- var a = {
- pollName: !1,
- questions: [
- ]
- },
- r = !0;
- return o.state.name || (r = !(a.pollName = !0)),
- o.state.questions.forEach(function (e, t) {
- var n = {
- text: !1,
- answers: new Set
- };
- e.text || (r = !(n.text = !0)),
- e.answers.forEach(function (e, t) {
- e.text || (n.answers.add(t), r = !1)
- }),
- (n.text || 0 < n.answers.size) && (a.questions[t] = n)
- }),
- o.setState({
- errors: a
- }),
- r
- }),
- GU(zU(o), 'handleSave', function () {
- o.validateEntries() && o.props.save({
- id: o.state.id,
- name: o.state.name,
- startDate: o.state.startDate,
- endDate: o.state.endDate,
- published: o.state.published,
- requireAuth: o.state.requireAuth,
- voteInterval: o.state.voteInterval,
- questions: o.state.questions,
- nonUniversal: o.state.nonUniversal
- }).then(o.syncPollState.bind(zU(o)))
- }),
- GU(zU(o), 'handlePublish', function () {
- o.props.publish(o.state.id).then(function () {
- o.setState({
- published: !0
- });
- var e = o.props.selection.organization && o.props.selection.organization.id || o.props.selection.forum && o.props.selection.forum.organization;
- !bc.hasSeenPublishedPoll && e && o.state.id && (o.props.onSegmentCall('group', '' + e, {
- pollId: o.state.id
- }), bc.hasSeenPublishedPoll = !0)
- })
- }),
- GU(zU(o), 'previewPoll', function () {
- o.validateEntries() && o.props.preview({
- id: o.state.id,
- name: o.state.name,
- startDate: o.state.startDate,
- endDate: o.state.endDate,
- published: o.state.published,
- requireAuth: o.state.requireAuth,
- voteInterval: o.state.voteInterval,
- questions: o.state.questions
- }).then(function (e) {
- o.showPreview(e.previewId)
- })
- }),
- GU(zU(o), 'showPreview', function (e) {
- e && window.open(Bc + e, '_blank')
- }),
- GU(zU(o), 'handleShowPollTagInstructions', function () {
- o.setState({
- showPollTagInstructions: !o.state.showPollTagInstructions
- })
- }),
- GU(zU(o), 'handleCopyTags', function () {
- var e = EU(o.props.selection && o.props.selection.forum && o.props.selection.forum.shortname, o.state.id);
- Object(Dl.copyToClipboard) (e),
- o.setState({
- hasCopied: !0,
- showPollTagInstructions: !Is.a.get(Hc)
- }),
- setTimeout(function () {
- o.setState({
- hasCopied: !1
- })
- }, 2000)
- }),
- GU(zU(o), 'handleDeletePoll', function () {
- window.confirm('Are you sure you want to delete this poll?') && o.props.delete(o.state.id).then(o.props.history.push(ho.getRoute('/polls/list/')))
- }),
- GU(zU(o), 'confirmNavigationIfUnsaved', function () {
- if (o.state.hasChanges) return 'Are you sure you want to leave without saving changes?'
- }),
- o
- }
- return e = r,
- (t = [
- {
- key: 'componentDidMount',
- value: function () {
- this.props.pollsOrgCurrentPackage || this.props.fetchSubscription(),
- this.props.history.setRouteLeaveHook(this.props.route, this.confirmNavigationIfUnsaved),
- this.props.resetSyncedPoll(),
- this.props.params && this.props.params.pollId && this.props.fetchPollDetails(this.props.params.pollId).then(this.syncPollState.bind(this))
- }
- },
- {
- key: 'componentDidUpdate',
- value: function (e) {
- e.location.pathname !== this.props.location.pathname && '/polls/editor/new/' === this.props.location.pathname && this.state.pollHasChanged && (this.props.resetSyncedPoll(), this.resetPollState())
- }
- },
- {
- key: 'render',
- value: function () {
- var t = this,
- e = this.props.selection.organization && this.props.selection.organization.pollsActivationDate,
- n = this.props.selection.organization && Ur.SAAS_PRODUCT_PLAN_ACTIVE_STATUSES_SET.has(this.props.selection.organization.pollsSubscriptionStatus);
- return e ? this.props.isFetching ? C.a.createElement(Ji, null) : n ? (n = this.state.id && this.state.published ? 'Published' : this.state.id ? 'Draft' : 'Pending', C.a.createElement('div', {
- className: 'polls__wrapper polls-editor__container'
- }, this.state.showPollTagInstructions && C.a.createElement(RU, {
- handleShowPollTagInstructions: this.handleShowPollTagInstructions,
- forum: this.props.selection && this.props.selection.forum && this.props.selection.forum.shortname,
- pollId: this.state.id
- }), C.a.createElement('div', {
- className: 'content__wrap spacing-bottom-double'
- }, C.a.createElement('header', {
- className: 'polls__section-header'
- }, C.a.createElement('h2', {
- className: 'text-larger text-gray-darker spacing-bottom-small'
- }, 'Create a new poll')), C.a.createElement('section', {
- className: 'polls-editor__content'
- }, C.a.createElement($h, {
- name: 'name',
- value: this.state.name,
- placeholder: 'Example: Opinions on Star Wars Characters',
- label: 'Give the poll a name',
- onChange: function (e) {
- return t.handleInputChange('name', e)
- },
- tooltip: 'Your poll\'s name will not be visible to participants.',
- disabled: this.props.isSyncing,
- inputState: this.state.errors.pollName ? 'error' : 'none',
- maxLength: Cc.MAX_POLL_NAME_LENGTH,
- showLimit: Cc.MAX_POLL_NAME_LENGTH / 2 <= this.state.name.length,
- spellCheck: !0,
- childIsInput: !0
- }), C.a.createElement('div', {
- className: 'fieldset'
- }, C.a.createElement('label', {
- className: 'fieldset__label text-gray'
- }, 'Start and end date'), C.a.createElement(Zp, {
- key: this.state.startDate,
- dateWrapperClass: 'polls-editor__datepicker select__control',
- minDate: ct.a.min(ct() ().startOf('day'), this.state.startDate),
- maxDate: this.state.startDate.clone().add(90, 'days'),
- startDate: this.state.startDate,
- endDate: this.state.endDate,
- onDateChange: this.handleDateChange,
- persistLocalTime: !0
- })), C.a.createElement('div', {
- className: 'fieldset'
- }, C.a.createElement('label', {
- className: 'fieldset__label text-gray'
- }, 'Status'), C.a.createElement('span', {
- className: 'label status-label '.concat(this.state.published ? ' status-label__success' : '')
- }, n)), C.a.createElement(Ob, {
- name: 'requireAuth',
- checked: !!this.state.requireAuth,
- secondaryLabel: 'Require login to submit response',
- onChange: function (e) {
- return t.handleInputChange('requireAuth', e)
- },
- idNamespace: this.constructor.displayName,
- readOnly: this.props.isSyncing
- }), C.a.createElement(Ob, {
- name: 'voteIntervalCheckbox',
- checked: !!this.state.voteInterval,
- secondaryLabel: this.state.voteInterval ? C.a.createElement('span', null, 'Allow user to take poll again after ', C.a.createElement(Mf, {
- name: 'voteInterval',
- options: Tc,
- value: this.state.voteInterval,
- onChange: function (e) {
- return t.handleInputChange('voteInterval', e)
- },
- idNamespace: this.constructor.displayName,
- disabled: this.props.isSyncing,
- inline: !0
- })) : 'Allow user to take poll again',
- onChange: this.handleVoteIntervalToggle,
- idNamespace: this.constructor.displayName,
- readOnly: this.props.isSyncing,
- fieldsetAdditionalClass: 'polls-editor__vote-interval-checkbox'
- }), C.a.createElement(Ob, {
- name: 'excludeFromUniversalCheckbox',
- checked: !!this.state.nonUniversal,
- secondaryLabel: 'Exclude from Universal Tag',
- onChange: function (e) {
- return t.handleInputChange('nonUniversal', e)
- },
- idNamespace: this.constructor.displayName,
- disabled: this.props.isSyncing
- })), C.a.createElement(_U, {
- questions: this.state.questions,
- addQuestion: this.handleAddQuestion,
- updateQuestion: this.handleUpdateQuestion,
- deleteQuestion: this.handleDeleteQuestion,
- isSyncing: this.props.isSyncing,
- isPublished: this.state.published,
- errors: this.state.errors.questions
- }), C.a.createElement('p', {
- className: 'text-medium text-error text-semibold polls-editor__error'.concat(this.state.errors.pollName || 0 < this.state.errors.questions.length ? '' : ' --placeholder')
- }, 'Error: All text input fields must have an entry before saving or previewing.'), C.a.createElement('footer', {
- className: 'polls-editor__footer align align--between'
- }, C.a.createElement('div', {
- className: 'polls-editor__footer-button__container-left align'
- }, C.a.createElement('button', {
- className: 'button button-fill--brand button-padding-wider button-medium',
- onClick: this.handleSave,
- disabled: this.props.isSyncing || !this.state.hasChanges
- }, 'Save'), this.state.published ? C.a.createElement('button', {
- className: 'button button-fill--brand button-padding-wider button-medium polls__copy-tags',
- onClick: this.handleCopyTags
- }, 'Tags', this.state.hasCopied && C.a.createElement('span', {
- className: 'polls__copy-tags-success'
- }, 'Copied to clipboard')) : C.a.createElement('button', {
- className: 'button button-fill--brand button-padding-wider button-medium',
- onClick: this.handlePublish,
- disabled: this.props.isSyncing || !this.state.id || this.state.hasChanges
- }, 'Publish'), C.a.createElement('button', {
- className: 'button button-fill button-padding-wider button-medium',
- onClick: this.previewPoll
- }, 'Preview')), C.a.createElement('div', {
- className: 'polls-editor__footer-button__container-right'
- }, this.state.id && !this.state.published && C.a.createElement('button', {
- className: 'button button-outline -border-gray button-medium nav-lnk',
- onClick: this.handleDeletePoll
- }, C.a.createElement('div', {
- className: 'nav-lnk__blk'
- }, C.a.createElement('span', {
- className: 'button__text'
- }, 'Delete'))), C.a.createElement(v.Link, {
- activeClassName: 'active',
- to: ho.getRoute('/polls/list/')
- }, C.a.createElement('div', {
- className: 'button button-outline -border-blue-dark button-medium nav-lnk'
- }, C.a.createElement('div', {
- className: 'nav-lnk__blk'
- }, C.a.createElement('span', {
- className: 'button__text'
- }, 'Cancel'))))))))) : C.a.createElement(Mk, {
- organization: this.props.organization
- }) : C.a.createElement(Cm, {
- isPolls: !0,
- organization: this.props.selection.organization
- })
- }
- }
- ]) && UU(e.prototype, t),
- n && UU(e, n),
- r
- }();
- GU(Wi, 'displayName', 'PollsEditor'),
- GU(Wi, 'propTypes', {
- params: b.a.shape({
- pollId: b.a.string
- }),
- history: b.a.shape({
- push: b.a.func.isRequired
- }).isRequired,
- onSegmentCall: b.a.func.isRequired,
- syncedPoll: Uc,
- isSyncing: b.a.bool.isRequired,
- isFetching: b.a.bool.isRequired,
- selection: ht,
- fetchPollDetails: b.a.func.isRequired,
- save: b.a.func.isRequired,
- delete : b.a.func.isRequired,
- publish: b.a.func.isRequired,
- preview: b.a.func.isRequired
- });
- var YU = Object(u.connect) (function (e) {
- var t = e.pollsEditor;
- return {
- syncedPoll: t.poll,
- isSyncing: t.isSyncing,
- isFetching: t.isFetching,
- selection: e.selection,
- pollsOrgCurrentPackage: e.subscription.pollsOrgCurrentPackage
- }
- }, {
- fetchPollDetails: Mc.fetchPollDetails,
- save: Mc.save,
- delete : Mc.delete,
- publish: Mc.publish,
- resetSyncedPoll: Mc.resetSyncedPoll,
- preview: Mc.preview,
- fetchSubscription: Hl
- }) (Ni.a.attachDrivers(Wi, [
- bc
- ]));
- function QU(e) {
- return (QU = 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator ? function (e) {
- return typeof e
- }
- : function (e) {
- return e && 'function' == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? 'symbol' : typeof e
- }) (e)
- }
- function KU(e, t) {
- for (var n = 0; n < t.length; n++) {
- var a = t[n];
- a.enumerable = a.enumerable || !1,
- a.configurable = !0,
- 'value' in a && (a.writable = !0),
- Object.defineProperty(e, a.key, a)
- }
- }
- function JU(e, t) {
- return (JU = Object.setPrototypeOf || function (e, t) {
- return e.__proto__ = t,
- e
- }) (e, t)
- }
- function $U(n) {
- var a = function () {
- if ('undefined' == typeof Reflect || !Reflect.construct) return !1;
- if (Reflect.construct.sham) return !1;
- if ('function' == typeof Proxy) return !0;
- try {
- return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [
- ], function () {
- })),
- !0
- } catch (e) {
- return !1
- }
- }();
- return function () {
- var e,
- t = XU(n);
- return e = a ? (e = XU(this).constructor, Reflect.construct(t, arguments, e)) : t.apply(this, arguments),
- t = this,
- !(e = e) || 'object' !== QU(e) && 'function' != typeof e ? ZU(t) : e
- }
- }
- function ZU(e) {
- if (void 0 === e) throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called');
- return e
- }
- function XU(e) {
- return (XU = Object.setPrototypeOf ? Object.getPrototypeOf : function (e) {
- return e.__proto__ || Object.getPrototypeOf(e)
- }) (e)
- }
- function eM(e, t, n) {
- return t in e ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n,
- e
- }
- Mc = function () {
- !function (e, t) {
- if ('function' != typeof t && null !== t) throw new TypeError('Super expression must either be null or a function');
- e.prototype = Object.create(t && t.prototype, {
- constructor: {
- value: e,
- writable: !0,
- configurable: !0
- }
- }),
- t && JU(e, t)
- }(o, A);
- var e,
- t,
- n,
- r = $U(o);
- function o() {
- var e;
- !function (e, t) {
- if (!(e instanceof t)) throw new TypeError('Cannot call a class as a function')
- }(this, o);
- for (var t = arguments.length, n = Array(t), a = 0; a < t; a++) n[a] = arguments[a];
- return eM(ZU(e = r.call.apply(r, [
- this
- ].concat(n))), 'handleBackToPollsList', function () {
- e.props.fetchPolls()
- }),
- e
- }
- return e = o,
- (t = [
- {
- key: 'render',
- value: function () {
- return this.props.noPollData ? C.a.createElement('div', {
- className: 'no-polls__container align align--column align--middle align--center'
- }, C.a.createElement('span', {
- className: 'no_poll_data__img'
- }), C.a.createElement('div', {
- className: 'no-polls__prompt'
- }, 'No poll data available (...yet)')) : C.a.createElement('div', {
- className: 'no-polls__container align align--column align--middle align--center'
- }, C.a.createElement('span', {
- className: 'no-polls__img'
- }), this.props.noSearchResults ? C.a.createElement(C.a.Fragment, null, C.a.createElement('div', null, 'No poll names containing ', C.a.createElement('strong', null, this.props.query), ' found belonging to shortname ', C.a.createElement('strong', null, this.props.forum), '.'), C.a.createElement('div', null, 'Refine your search and try again!'), C.a.createElement('button', {
- className: 'button button-fill--brand button-padding-wider text-medium',
- onClick: this.handleBackToPollsList
- }, C.a.createElement('div', {
- className: 'nav-lnk'
- }, C.a.createElement('div', {
- className: 'nav-lnk__blk'
- }, C.a.createElement('span', {
- className: 'button__text'
- }, 'Back to Polls List'))))) : C.a.createElement(C.a.Fragment, null, C.a.createElement('div', {
- className: 'no-polls__prompt'
- }, 'You don\'t have any polls yet. Click below to begin!'), C.a.createElement(v.Link, {
- className: 'button button-fill--brand button-padding-wider text-medium',
- activeClassName: 'active',
- to: ho.getRoute('/polls/editor/new/')
- }, C.a.createElement('div', {
- className: 'nav-lnk'
- }, C.a.createElement('div', {
- className: 'nav-lnk__blk'
- }, C.a.createElement('span', {
- className: 'button__text'
- }, '+ Poll'))))))
- }
- }
- ]) && KU(e.prototype, t),
- n && KU(e, n),
- o
- }();
- eM(Mc, 'displayName', 'NoPolls'),
- eM(Mc, 'propTypes', {
- noSearchResults: b.a.bool,
- fetchPolls: b.a.func,
- query: b.a.string,
- forum: b.a.string,
- noPollData: b.a.bool
- });
- var tM = Mc,
- Wi = {
- updateSearchQuery: function (e) {
- return {
- type: ue.updateSearchQuery,
- searchQuery: e
- }
- },
- fetchPolls: function () {
- var e = 0 < arguments.length && void 0 !== arguments[0] ? arguments[0] : {
- limit: 10
- },
- r = e.limit,
- o = e.query;
- return function (t, e) {
- var n = e().pollsList,
- a = (o = 'string' != typeof o ? n.searchQuery : o) === n.searchQuery,
- e = (e().selection.forum || {
- }).shortname;
- return t({
- type: ue.isFetching
- }),
- io.a.call('polls/list', {
- data: {
- forum: e,
- query: o,
- limit: r,
- cursor: a ? n.cursor.next : void 0
- }
- }).then(function (e) {
- t({
- type: ue.onFetch,
- response: e.response,
- cursor: e.cursor,
- query: o,
- shouldAppend: a
- })
- })
- }
- },
- delete : function (n) {
- return function (e, t) {
- return io.a.call('polls/delete', {
- data: {
- pollId: n,
- forum: (t().selection.forum || {
- }).shortname
- },
- method: 'POST'
- }).then(function () {
- e({
- type: ue.onDelete,
- pollId: n
- })
- })
- }
- },
- resetList: function () {
- return function (e) {
- e({
- type: ue.reset
- })
- }
- },
- previewPoll: function (n) {
- return function (e, t) {
- t = (t().selection.forum || {
- }).shortname;
- return io.a.call('polls/preview', {
- data: {
- forum: t,
- poll: JSON.stringify({
- id: n
- })
- },
- method: 'POST'
- }).then(function (e) {
- return e.response
- })
- }
- }
- };
- function nM(e) {
- return (nM = 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator ? function (e) {
- return typeof e
- }
- : function (e) {
- return e && 'function' == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? 'symbol' : typeof e
- }) (e)
- }
- function aM(e, t) {
- for (var n = 0; n < t.length; n++) {
- var a = t[n];
- a.enumerable = a.enumerable || !1,
- a.configurable = !0,
- 'value' in a && (a.writable = !0),
- Object.defineProperty(e, a.key, a)
- }
- }
- function rM(e, t) {
- return (rM = Object.setPrototypeOf || function (e, t) {
- return e.__proto__ = t,
- e
- }) (e, t)
- }
- function oM(n) {
- var a = function () {
- if ('undefined' == typeof Reflect || !Reflect.construct) return !1;
- if (Reflect.construct.sham) return !1;
- if ('function' == typeof Proxy) return !0;
- try {
- return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [
- ], function () {
- })),
- !0
- } catch (e) {
- return !1
- }
- }();
- return function () {
- var e,
- t = sM(n);
- return e = a ? (e = sM(this).constructor, Reflect.construct(t, arguments, e)) : t.apply(this, arguments),
- t = this,
- !(e = e) || 'object' !== nM(e) && 'function' != typeof e ? iM(t) : e
- }
- }
- function iM(e) {
- if (void 0 === e) throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called');
- return e
- }
- function sM(e) {
- return (sM = Object.setPrototypeOf ? Object.getPrototypeOf : function (e) {
- return e.__proto__ || Object.getPrototypeOf(e)
- }) (e)
- }
- function lM(e, t, n) {
- return t in e ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n,
- e
- }
- Mc = function () {
- !function (e, t) {
- if ('function' != typeof t && null !== t) throw new TypeError('Super expression must either be null or a function');
- e.prototype = Object.create(t && t.prototype, {
- constructor: {
- value: e,
- writable: !0,
- configurable: !0
- }
- }),
- t && rM(e, t)
- }(r, A);
- var e,
- t,
- n,
- a = oM(r);
- function r(e) {
- var n;
- return function (e, t) {
- if (!(e instanceof t)) throw new TypeError('Cannot call a class as a function')
- }(this, r),
- lM(iM(n = a.call(this, e)), 'handleChangeSearch', function (e) {
- n.setState({
- localSearchQuery: e.target.value
- })
- }),
- lM(iM(n), 'handleSearch', function () {
- n.state.localSearchQuery !== n.props.searchQuery && n.props.fetchPolls({
- query: n.state.localSearchQuery
- })
- }),
- lM(iM(n), 'handleLoadMore', function () {
- return n.props.fetchPolls({
- query: n.props.searchQuery
- })
- }),
- lM(iM(n), 'handleKeyDownSearch', function (e) {
- 13 === e.keyCode && n.handleSearch()
- }),
- lM(iM(n), 'handlePreviewPoll', function (e) {
- n.props.previewPoll(e).then(function (e) {
- return n.showPreview(e.previewId)
- })
- }),
- lM(iM(n), 'showPreview', function (e) {
- e && window.open(Bc + e, '_blank')
- }),
- lM(iM(n), 'handleShowPollTagInstructions', function () {
- n.setState({
- showPollTagInstructions: !n.state.showPollTagInstructions
- })
- }),
- lM(iM(n), 'handleCopyTags', function (e) {
- var t = EU(n.props.selection && n.props.selection.forum && n.props.selection.forum.shortname, e = e || 'universal');
- Object(Dl.copyToClipboard) (t),
- n.setState({
- copiedPoll: e,
- showPollTagInstructions: !Is.a.get(Hc)
- }),
- setTimeout(function () {
- n.setState({
- copiedPoll: null
- })
- }, 2000)
- }),
- lM(iM(n), 'handleDeletePoll', function (e) {
- window.confirm('Are you sure you want to delete this poll?') && n.props.deletePoll(e)
- }),
- n.state = {
- localSearchQuery: '',
- copiedPoll: null,
- showPollTagInstructions: !1,
- subscribeModalOpen: n.props.location.query[Ur.CHECKOUT_SUCCESS_QUERY_PARAM] === Ur.CHECKOUT_SUCCESS_QUERY_PARAM_VALUE_POLLS
- },
- n
- }
- return e = r,
- (t = [
- {
- key: 'componentDidMount',
- value: function () {
- this.props.pollsOrgCurrentPackage || this.props.fetchSubscription(),
- this.props.resetList(),
- this.props.fetchPolls()
- }
- },
- {
- key: 'render',
- value: function () {
- var t = this,
- e = this.props.selection.organization && this.props.selection.organization.pollsActivationDate,
- n = this.props.selection.organization && Ur.SAAS_PRODUCT_PLAN_ACTIVE_STATUSES_SET.has(this.props.selection.organization.pollsSubscriptionStatus);
- return e ? this.props.isFetching ? C.a.createElement(Ji, null) : n ? C.a.createElement('div', {
- className: 'polls__wrapper'
- }, this.state.subscribeModalOpen && this.props.pollsOrgCurrentPackage && C.a.createElement(Ty, {
- package: this.props.pollsOrgCurrentPackage,
- onClose: function () {
- return t.setState({
- subscribeModalOpen: !1
- })
- }
- }), this.state.showPollTagInstructions && C.a.createElement(RU, {
- handleShowPollTagInstructions: this.handleShowPollTagInstructions,
- forum: this.props.selection && this.props.selection.forum && this.props.selection.forum.shortname,
- pollId: this.state.copiedPoll
- }), C.a.createElement('div', {
- className: 'content__wrap spacing-bottom-double'
- }, C.a.createElement('header', {
- className: 'polls__section-header'
- }, C.a.createElement('h2', {
- className: 'text-largest text-gray-darker spacing-bottom-small'
- }, 'Polls Configuration')), C.a.createElement('div', {
- className: 'polls-list__container'
- }, C.a.createElement('div', {
- className: 'polls-list__top-container align align--between align--middle'
- }, C.a.createElement('div', {
- className: 'relative__wrapper'
- }, C.a.createElement('input', {
- 'aria-label': 'Search for a poll',
- placeholder: 'Search for a poll',
- value: this.state.localSearchQuery,
- onChange: this.handleChangeSearch,
- onKeyDown: this.handleKeyDownSearch,
- className: 'input--textbox poll-search align__item--grow',
- spellCheck: !0
- }), C.a.createElement('button', {
- className: 'poll-search-icon icon-mod-search',
- onClick: this.handleSearch
- })), C.a.createElement('div', {
- className: 'polls-list__general-actions-container'
- }, C.a.createElement('div', {
- className: 'copy-universal-tag-container'
- }, C.a.createElement('button', {
- className: 'create-poll-btn button button-fill--brand text-large polls__copy-tags',
- onClick: this.handleCopyTags.bind(this, 'universal')
- }, C.a.createElement('div', {
- className: 'nav-lnk'
- }, C.a.createElement('div', {
- className: 'nav-lnk__blk'
- }, C.a.createElement('span', {
- className: 'button__text'
- }, 'Copy Universal Tags'), 'universal' === this.state.copiedPoll && C.a.createElement('span', {
- className: 'polls__copy-tags-success'
- }, 'Copied to clipboard')))), C.a.createElement(Md, {
- content: C.a.createElement(C.a.Fragment, null, 'Universal tags let you deploy new polls to your site without having to update your code each time. Learn more ', C.a.createElement('a', {
- href: _l.a.contactSupport,
- target: '_blank',
- rel: 'noopener noreferrer'
- }, 'here'), '.'),
- direction: 'top-left'
- })), C.a.createElement(v.Link, {
- className: 'create-poll-btn button button-fill--brand text-large',
- activeClassName: 'active',
- to: ho.getRoute('/polls/editor/new/')
- }, C.a.createElement('div', {
- className: 'nav-lnk'
- }, C.a.createElement('div', {
- className: 'nav-lnk__blk'
- }, C.a.createElement('span', {
- className: 'button__text'
- }, '+ Poll')))))), !(!this.props.polls.length || this.state.localSearchQuery !== this.props.searchQuery && this.props.isFetching) && C.a.createElement('table', {
- className: 'polls-list__table'
- }, C.a.createElement('thead', null, C.a.createElement('tr', null, Rc.map(function (e, t) {
- return C.a.createElement('th', {
- key: t,
- className: 'polls-list__table__header --'.concat(e.split(' ') [0].toLowerCase())
- }, C.a.createElement('div', {
- className: 'polls-list__table__header__item'
- }, e))
- }))), C.a.createElement('tbody', null, this.props.polls.map(function (e) {
- return C.a.createElement('tr', {
- key: e.id
- }, C.a.createElement('td', {
- className: 'polls-list__table__data --id'
- }, e.id), C.a.createElement('td', {
- className: 'polls-list__table__data --name'
- }, C.a.createElement(v.Link, {
- className: 'polls-list__action-button',
- to: ho.getRoute('/polls/editor/'.concat(e.id)),
- title: e.name
- }, e.name)), C.a.createElement('td', {
- className: 'polls-list__table__data --status'
- }, C.a.createElement('span', {
- className: 'poll-status '.concat(e.published ? '--published' : '--draft')
- }, e.published ? 'Published' : 'Draft')), C.a.createElement('td', {
- className: 'polls-list__table__data --responses'
- }, e.responses || '--'), C.a.createElement('td', {
- className: 'polls-list__table__data --created'
- }, ct() (e.createdAt).format('MMMM DD, YYYY')), C.a.createElement('td', {
- className: 'polls-list__table__data --exclude'
- }, e.nonUniversal ? 'Yes' : 'No'), C.a.createElement('td', {
- className: 'polls-list__table__data --actions'
- }, C.a.createElement('div', {
- className: 'buttons__container align align--middle'
- }, C.a.createElement(v.Link, {
- className: 'polls-list__action-button',
- to: ho.getRoute('/polls/editor/'.concat(e.id)),
- title: 'Edit'
- }, C.a.createElement('span', {
- className: 'icon-pencil-thin'
- })), C.a.createElement('button', {
- className: 'polls-list__action-button',
- onClick: t.handlePreviewPoll.bind(t, e.id),
- title: 'Preview'
- }, C.a.createElement('span', {
- className: 'icon-eye'
- })), C.a.createElement('button', {
- className: 'polls-list__action-button polls__copy-tags'.concat(e.published ? '' : ' -disabled'),
- onClick: t.handleCopyTags.bind(t, e.id),
- title: 'Copy Tags',
- disabled: !e.published
- }, C.a.createElement('span', {
- className: 'icon-universal-code'
- }), t.state.copiedPoll === e.id && C.a.createElement('span', {
- className: 'polls__copy-tags-success'
- }, 'Copied to clipboard')), C.a.createElement('button', {
- className: 'polls-list__action-button'.concat(e.published ? ' -disabled' : ''),
- onClick: t.handleDeletePoll.bind(t, e.id),
- title: 'Delete',
- disabled: e.published
- }, C.a.createElement('span', {
- className: 'icon-delete'
- })))))
- }))), !this.props.isFetching && !this.props.polls.length && C.a.createElement(tM, {
- noSearchResults: !!this.props.searchQuery,
- fetchPolls: this.props.fetchPolls,
- query: this.props.searchQuery,
- forum: this.props.selection && this.props.selection.forum && this.props.selection.forum.shortname
- }), this.props.isFetching && C.a.createElement(Ji, null), !this.props.isFetching && !!this.props.polls.length && C.a.createElement(C.a.Fragment, null, this.props.hasMorePolls && C.a.createElement(C.a.Fragment, null, C.a.createElement('p', {
- className: 'spacing-top-bottom text-small text-gray text-center'
- }, 'Showing ', this.props.polls.length, ' of ', this.props.totalPolls, ' polls'), C.a.createElement('button', {
- className: 'button button-wide button-outline button-medium',
- disabled: !this.props.hasMorePolls,
- onClick: this.handleLoadMore
- }, 'Show more polls')))))) : C.a.createElement(Mk, {
- organization: this.props.organization
- }) : C.a.createElement(Cm, {
- isPolls: !0,
- organization: this.props.selection.organization
- })
- }
- }
- ]) && aM(e.prototype, t),
- n && aM(e, n),
- r
- }();
- lM(Mc, 'displayName', 'PollsList'),
- lM(Mc, 'propTypes', {
- searchQuery: b.a.string.isRequired,
- polls: qc,
- isFetching: b.a.bool.isRequired,
- hasMorePolls: b.a.bool.isRequired,
- totalPolls: b.a.number.isRequired,
- selection: ht,
- pollsOrgCurrentPackage: Ur.PACKAGE_SHAPE,
- fetchPolls: b.a.func.isRequired,
- updateSearchQuery: b.a.func.isRequired,
- deletePoll: b.a.func.isRequired,
- previewPoll: b.a.func.isRequired,
- location: kh.locationShape.isRequired
- });
- var cM = Object(u.connect) (function (e) {
- var t = e.pollsList;
- return {
- searchQuery: t.searchQuery,
- polls: t.polls,
- isFetching: t.isFetching,
- hasMorePolls: t.hasNext,
- totalPolls: t.total,
- selection: e.selection,
- pollsOrgCurrentPackage: e.subscription.pollsOrgCurrentPackage
- }
- }, {
- search: Wi.search,
- updateSearchQuery: Wi.updateSearchQuery,
- fetchPolls: Wi.fetchPolls,
- deletePoll: Wi.delete,
- resetList: Wi.resetList,
- previewPoll: Wi.previewPoll,
- fetchSubscription: Hl
- }) (Mc),
- Mc = function (e) {
- return C.a.createElement('div', {
- className: 'section-contained'
- }, C.a.createElement('div', {
- className: 'layout layout--publishers'
- }, C.a.createElement('div', {
- className: 'layout__main'
- }, C.a.createElement(ob, {
- auth: e.auth,
- selection: e.selection
- }), C.a.createElement('div', {
- className: 'layout__content'
- }, C.a.cloneElement(e.children, e)))))
- };
- Mc.displayName = 'PollsSettings',
- Mc.propTypes = {
- auth: Nc.isRequired,
- children: b.a.node.isRequired,
- selection: ht.isRequired
- };
- Nc = Object(u.connect) (function (e) {
- return {
- selection: e.selection
- }
- }) (Ni.a.attachDrivers(Mc, [
- bc
- ]));
- function uM(e) {
- return (uM = 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator ? function (e) {
- return typeof e
- }
- : function (e) {
- return e && 'function' == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? 'symbol' : typeof e
- }) (e)
- }
- function pM(t, e) {
- var n,
- a = Object.keys(t);
- return Object.getOwnPropertySymbols && (n = Object.getOwnPropertySymbols(t), e && (n = n.filter(function (e) {
- return Object.getOwnPropertyDescriptor(t, e).enumerable
- })), a.push.apply(a, n)),
- a
- }
- function dM(t) {
- for (var e = 1; e < arguments.length; e++) {
- var n = null != arguments[e] ? arguments[e] : {
- };
- e % 2 ? pM(Object(n), !0).forEach(function (e) {
- bM(t, e, n[e])
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(n)) : pM(Object(n)).forEach(function (e) {
- Object.defineProperty(t, e, Object.getOwnPropertyDescriptor(n, e))
- })
- }
- return t
- }
- function mM(e, t) {
- for (var n = 0; n < t.length; n++) {
- var a = t[n];
- a.enumerable = a.enumerable || !1,
- a.configurable = !0,
- 'value' in a && (a.writable = !0),
- Object.defineProperty(e, a.key, a)
- }
- }
- function fM(e, t) {
- return (fM = Object.setPrototypeOf || function (e, t) {
- return e.__proto__ = t,
- e
- }) (e, t)
- }
- function hM(n) {
- var a = function () {
- if ('undefined' == typeof Reflect || !Reflect.construct) return !1;
- if (Reflect.construct.sham) return !1;
- if ('function' == typeof Proxy) return !0;
- try {
- return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [
- ], function () {
- })),
- !0
- } catch (e) {
- return !1
- }
- }();
- return function () {
- var e,
- t = yM(n);
- return e = a ? (e = yM(this).constructor, Reflect.construct(t, arguments, e)) : t.apply(this, arguments),
- t = this,
- !(e = e) || 'object' !== uM(e) && 'function' != typeof e ? gM(t) : e
- }
- }
- function gM(e) {
- if (void 0 === e) throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called');
- return e
- }
- function yM(e) {
- return (yM = Object.setPrototypeOf ? Object.getPrototypeOf : function (e) {
- return e.__proto__ || Object.getPrototypeOf(e)
- }) (e)
- }
- function bM(e, t, n) {
- return t in e ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n,
- e
- }
- Mc = function () {
- !function (e, t) {
- if ('function' != typeof t && null !== t) throw new TypeError('Super expression must either be null or a function');
- e.prototype = Object.create(t && t.prototype, {
- constructor: {
- value: e,
- writable: !0,
- configurable: !0
- }
- }),
- t && fM(e, t)
- }(r, A);
- var e,
- t,
- n,
- a = hM(r);
- function r() {
- var o;
- !function (e, t) {
- if (!(e instanceof t)) throw new TypeError('Cannot call a class as a function')
- }(this, r);
- for (var e = arguments.length, t = Array(e), n = 0; n < e; n++) t[n] = arguments[n];
- return bM(gM(o = a.call.apply(a, [
- this
- ].concat(t))), 'state', dM(dM({
- }, r.getEditableFieldsFromForum(o.props.forumDetails)), {
- }, {
- selectedFaviconIndex: 0,
- faviconOptions: [
- ],
- hasPendingFaviconChange: !1,
- fontOptionList: r.getFontOptionsList(),
- savedFields: dM(dM({
- }, r.getEditableFieldsFromForum(o.props.forumDetails)), {
- }, {
- hasPendingFaviconChange: !1
- })
- })),
- bM(gM(o), 'faviconFileInput', C.a.createRef()),
- bM(gM(o), 'confirmNavigationIfUnsaved', function () {
- if (o.hasUnsavedChanges()) return 'You have unsaved changes. Do you want to leave this page?'
- }),
- bM(gM(o), 'getUploadedFaviconFile', function () {
- var e = o.faviconFileInput.current && o.faviconFileInput.current.files;
- return e && e[0]
- }),
- bM(gM(o), 'getFaviconOptions', function () {
- return o.state.faviconOptions.map(function (e, t) {
- return {
- key: t,
- value: t,
- image: e
- }
- })
- }),
- bM(gM(o), 'getFontCategory', function (t) {
- return o.state.fontOptionList.filter(function (e) {
- return e.name === t
- }) [0].category
- }),
- bM(gM(o), 'handleFontSelection', function (r) {
- return function (e) {
- var t,
- n = o.state.customFont,
- a = o.state.typeface;
- 'typeface' === r ? (a = e.target.value, t = o.getFontCategory(n), 'auto' !== a && 'auto' !== t && a !== t && (n = cf.name)) : 'auto' !== o.getFontCategory(n = e.target.value) && (a = o.getFontCategory(n)),
- o.setState({
- typeface: a,
- customFont: n
- })
- }
- }),
- bM(gM(o), 'hasValidFavicon', function () {
- var e = o.getUploadedFaviconFile();
- return !!(e ? o.props.forumFaviconValidateImageFile(e) : o.lastValidFavicon)
- }),
- bM(gM(o), 'isNewFaviconSelected', function () {
- return o.hasValidFavicon() && 1 === o.state.selectedFaviconIndex
- }),
- bM(gM(o), 'handleFaviconTypeChange', function (e) {
- var t = parseInt(e.target.parentElement.getAttribute('index'), 10),
- e = o.getUploadedFaviconFile() || 0 !== t;
- o.setState({
- selectedFaviconIndex: t,
- hasNewFavicon: o.hasValidFavicon(),
- hasPendingFaviconChange: e
- })
- }),
- bM(gM(o), 'handleInputChange', function (a) {
- return function (e) {
- var e = e.target,
- n = 'checkbox' === e.type ? e.checked : e.value;
- 'radio' === e.type ? n = 'true' === n : 'text' === e.type || 'boolean' == typeof n || '' === n || isNaN(n) || (n = parseInt(n, 10)),
- o.setState(function (e) {
- var t = {
- };
- return bM(t, a, n),
- bM(t, 'hasPendingFaviconChange', 'hasNewFavicon' === a || e.hasPendingFaviconChange),
- t
- })
- }
- }),
- bM(gM(o), 'hasFieldChanged', function (e) {
- return o.state[e] !== o.state.savedFields[e] && !(null === o.state.savedFields[e] && '' === o.state[e])
- }),
- bM(gM(o), 'handleFaviconFileInputChange', function () {
- var e,
- t;
- o.hasValidFavicon() ? (o.props.forumFaviconOnDismissError(), e = o.state.faviconOptions, t = o.getUploadedFaviconFile(), e[1] = URL.createObjectURL(t), o.setState({
- hasNewFavicon: !0,
- hasPendingFaviconChange: !0,
- faviconOptions: e,
- selectedFaviconIndex: 1
- })) : o.setState({
- hasNewFavicon: !1
- })
- }),
- bM(gM(o), 'hasUnsavedChanges', function () {
- return Object.keys(o.state.savedFields).some(function (e) {
- return o.hasFieldChanged(e)
- })
- }),
- bM(gM(o), 'handleSaveChanges', function () {
- var e;
- o.state.hasPendingFaviconChange ? o.handleSaveFavicon() : (e = {
- name: o.state.name,
- website: o.state.website,
- forumCategory: o.state.category,
- adultContent: o.state.adultContent ? 1 : 0,
- description: o.state.description,
- colorScheme: o.state.colorScheme,
- typeface: o.state.typeface,
- translationLanguage: o.state.language,
- disableDisqusBrandingOnPolls: o.state.enableDisqusBranding ? 0 : 1
- }, o.hasFeature('customFonts') && (e.customFont = o.state.customFont), o.props.forumUpdateOnSave(e).done(function () {
- o.setState(function (e) {
- return {
- savedFields: {
- name: e.name,
- website: e.website,
- category: e.category,
- adultContent: e.adultContent,
- colorScheme: e.colorScheme,
- typeface: e.typeface,
- customFont: e.customFont,
- description: e.description,
- language: e.language,
- enableDisqusBranding: e.enableDisqusBranding,
- hasPendingFaviconChange: !1
- }
- }
- })
- }))
- }),
- bM(gM(o), 'handleSaveFavicon', function () {
- var e = o.getUploadedFaviconFile();
- e && o.isNewFaviconSelected() ? o.props.forumFaviconOnSave(e).done(function () {
- this.faviconFileInput.current.value = '',
- this.lastValidFavicon = this.props.forumFaviconNewUrl,
- this.setState({
- hasPendingFaviconChange: !1,
- faviconOptions: [
- this.props.forumFaviconNewUrl
- ]
- }, this.handleSaveChanges)
- }.bind(gM(o))) : o.setState({
- hasPendingFaviconChange: !1
- }, o.handleSaveChanges)
- }),
- bM(gM(o), 'hasFeature', function (e) {
- return !!(o.props.forumDetails && o.props.forumDetails.features && o.props.forumDetails.features[e])
- }),
- bM(gM(o), 'getInputId', function (e) {
- return ''.concat(o.constructor.displayName, '_').concat(e)
- }),
- o
- }
- return e = r,
- (t = [
- {
- key: 'componentDidMount',
- value: function () {
- this.props.pollsOrgCurrentPackage || this.props.fetchSubscription(),
- this.props.history.setRouteLeaveHook(this.props.route, this.confirmNavigationIfUnsaved),
- this.props.emitTrackingEvent({
- verb: 'view',
- object_type: 'page',
- object_id: ''.concat(window.document.location.host).concat(window.document.location.pathname)
- }),
- this.props.fetchForumCategories(),
- this.props.fetchForumDetails(),
- this.props.fetchForumLanguages()
- }
- },
- {
- key: 'componentWillReceiveProps',
- value: function (t) {
- var n;
- !this.props.forumDetails && t.forumDetails && (n = r.getEditableFieldsFromForum(t.forumDetails), this.setState(function (e) {
- return dM(dM({
- }, n), {
- }, {
- savedFields: dM(dM({
- }, r.getEditableFieldsFromForum(t.forumDetails)), {
- }, {
- hasPendingFaviconChange: !1
- }),
- faviconOptions: !e.faviconOptions.length && t.forumDetails.favicon.permalink ? [
- t.forumDetails.favicon.permalink
- ] : e.faviconOptions
- })
- }, Function.bind.call(function () {
- var e;
- this.state.hasNewFavicon && (this.lastValidFavicon = (e = t.forumDetails.favicon) && e.permalink)
- }, this)))
- }
- },
- {
- key: 'componentWillUnmount',
- value: function () {
- this.props.abortUpdateForumFaviconApiCall()
- }
- },
- {
- key: 'render',
- value: function () {
- var t = this,
- e = this.props.selection.organization && this.props.selection.organization.pollsActivationDate,
- n = this.props.selection.organization && Ur.SAAS_PRODUCT_PLAN_ACTIVE_STATUSES_SET.has(this.props.selection.organization.pollsSubscriptionStatus),
- a = this.props.pollsOrgCurrentPackage && this.props.pollsOrgCurrentPackage.id === Ur.DISQUS_POLLS_BUSINESS_PACKAGE_ID;
- if (!e) return C.a.createElement(Cm, {
- isPolls: !0,
- organization: this.props.selection.organization
- });
- if (this.props.forumDetailsIsFetching) return C.a.createElement(Ji, null);
- if (!n) return C.a.createElement(Mk, {
- organization: this.props.organization
- });
- if (!this.props.forumDetailsIsFetching && this.props.forumDetailsError) return C.a.createElement('div', {
- className: 'content__wrap spacing-bottom-double'
- }, C.a.createElement(Ki, {
- message: this.props.forumDetailsError,
- alertType: 'error'
- }));
- var r = this.props.forumDetails,
- o = this.props.organizations[this.props.selection.forum.organization],
- i = this.props.forumCategories.allCategories.map(function (e) {
- return {
- key: e.id,
- value: e.id,
- label: e.name
- }
- }),
- s = this.props.forumLanguages.map(function (e) {
- return {
- key: e.code,
- value: e.code,
- label: e.name
- }
- }),
- l = this.getInputId('colorScheme'),
- c = this.getInputId('typeface'),
- u = this.hasFeature('pollsBrandingOptional'),
- e = yo.a.isFeatureActive('custom_fonts', {
- forum: (this.props.selection.forum || {
- }).shortname
- }),
- n = u || ql(this.props.selection);
- return C.a.createElement('div', null, C.a.createElement('div', {
- className: 'content__wrap spacing-bottom-double'
- }, C.a.createElement('header', {
- className: 'settings__header'
- }, C.a.createElement('h2', {
- className: 'text-larger text-gray-darker spacing-bottom-small'
- }, 'Configure Disqus for Your Site'), C.a.createElement('p', {
- className: 'text-gray'
- }, 'Disqus automatically adapts to your community and offers powerful customization options. ', C.a.createElement('a', {
- href: Pn.adminArticles,
- target: '_blank',
- rel: 'noopener noreferrer'
- }, 'Learn more »'))), C.a.createElement('section', {
- className: 'settings__content'
- }, this.props.forumUpdateError ? C.a.createElement(Ki, {
- message: this.props.forumUpdateError,
- onRequestClose: this.props.forumUpdateOnDismissError,
- alertType: 'error'
- }) : null, C.a.createElement(kf, {
- label: 'Organization',
- blockAdditionalClass: 'text-medium',
- tooltip: o.name ? C.a.createElement(C.a.Fragment, null, 'Organizations are used to manage multiple sites, and this is the organization this site belongs to.', C.a.createElement('span', null, ' ', C.a.createElement(Us, {
- path: '/settings/general/',
- orgId: o.id,
- orgSlug: o.slug
- }, 'Edit organization settings.'))) : null
- }, C.a.createElement('div', null, o.name ? C.a.createElement('h4', {
- className: 'spacing-top-narrow'
- }, o.name) : C.a.createElement('p', {
- className: 'spacing-top-small'
- }, 'Organizations are used to manage multiple sites, and this is the organization this site belongs to.', C.a.createElement('span', null, ' ', C.a.createElement(Us, {
- path: '/settings/general/',
- orgId: o.id,
- orgSlug: o.slug
- }, 'Edit organization settings.'))))), C.a.createElement(kf, {
- label: 'Shortname',
- fieldsetAdditionalClass: 'spacing-top-narrow',
- blockAdditionalClass: 'text-medium',
- tooltip: 'This is used to uniquely identify your website on Disqus. It cannot be changed.'
- }, r ? C.a.createElement('div', {
- className: 'spacing-top-narrow'
- }, C.a.createElement('h4', null, r.id)) : null), C.a.createElement($h, {
- name: 'name',
- value: this.state.name,
- label: 'Website Name',
- onChange: this.handleInputChange('name'),
- idNamespace: this.constructor.displayName,
- readOnly: this.props.forumUpdateIsSaving,
- disabled: this.props.forumUpdateIsSaving,
- shouldHighlight: this.hasFieldChanged('name'),
- maxLength: '64'
- }), C.a.createElement($h, {
- name: 'website',
- value: this.state.website,
- label: 'Website URL',
- onChange: this.handleInputChange('website'),
- idNamespace: this.constructor.displayName,
- readOnly: this.props.forumUpdateIsSaving,
- disabled: this.props.forumUpdateIsSaving,
- shouldHighlight: this.hasFieldChanged('website'),
- tooltip: C.a.createElement(C.a.Fragment, null, 'Changing domains? ', C.a.createElement('a', {
- href: '/admin/discussions/migrate/'
- }, 'Learn how'), '.')
- }), C.a.createElement(qv, {
- name: 'forum-favicon',
- label: 'Website Favicon',
- idNamespace: 'forum-favicon',
- className: 'spacing-bottom-large',
- options: this.getFaviconOptions(),
- value: this.state.selectedFaviconIndex,
- onChange: this.handleFaviconTypeChange,
- error: this.props.forumFaviconError,
- shouldHighlight: this.hasFieldChanged('hasPendingFaviconChange'),
- width: '48px',
- height: '48px',
- tooltip: C.a.createElement(C.a.Fragment, null, 'This will be the image for your site, which will appear at the top of your ', C.a.createElement('a', {
- href: '//disqus.com/home/forum/'.concat(r && r.id)
- }, 'forum profile'), '.')
- }, C.a.createElement('input', {
- type: 'file',
- id: 'custom-favicon-input',
- className: 'input--display-label',
- ref: this.faviconFileInput,
- onChange: this.handleFaviconFileInputChange
- }), C.a.createElement('label', {
- htmlFor: 'custom-favicon-input'
- }, C.a.createElement('img', {
- src: '//c.disquscdn.com/next/current/publisher-admin/assets/img/add-avatar-plus.svg',
- alt: 'Upload a favicon'
- }))), C.a.createElement(Mf, {
- name: 'category',
- label: 'Category',
- value: this.state.category,
- options: i,
- placeholder: 'Please select a category',
- onChange: this.handleInputChange('category'),
- idNamespace: this.constructor.displayName,
- readOnly: this.props.forumUpdateIsSaving,
- disabled: !i.length || this.props.forumUpdateIsSaving,
- shouldHighlight: this.hasFieldChanged('category')
- }), C.a.createElement($h, {
- name: 'description',
- value: this.state.description,
- label: 'Description',
- onChange: this.handleInputChange('description'),
- idNamespace: this.constructor.displayName,
- useTextarea: !0,
- readOnly: this.props.forumUpdateIsSaving,
- disabled: this.props.forumUpdateIsSaving,
- shouldHighlight: this.hasFieldChanged('description'),
- maxLength: '300'
- }), C.a.createElement(Mf, {
- name: 'language',
- label: 'Language',
- value: this.state.language,
- options: s,
- placeholder: 'Select a Language',
- onChange: this.handleInputChange('language'),
- disabled: !s.length,
- idNamespace: this.constructor.displayName,
- shouldHighlight: this.hasFieldChanged('language'),
- tooltip: C.a.createElement(C.a.Fragment, null, C.a.createElement('a', {
- href: Pn.translate
- }, 'Make Disqus available in your language.'))
- }), n ? C.a.createElement(Ob, {
- name: 'enableDisqusBranding',
- checked: this.state.enableDisqusBranding,
- label: C.a.createElement('span', null, u ? null : C.a.createElement(Ks, {
- emitEvent: function (e) {
- return t.props.emitTrackingEvent(dM({
- area: 'disqus_branding'
- }, e))
- },
- organization: o,
- iconClass: 'spacing-right-small',
- plan: !a && Ur.DISQUS_POLLS_BUSINESS_PLAN_ID
- }), 'Disqus Branding'),
- secondaryLabel: 'Show "Powered by Disqus" banner at the bottom of polls',
- onChange: this.handleInputChange('enableDisqusBranding'),
- idNamespace: this.constructor.displayName,
- readOnly: !u || this.props.forumUpdateIsSaving,
- shouldHighlight: this.hasFieldChanged('enableDisqusBranding')
- }, u ? null : C.a.createElement('p', {
- className: 'fieldset__description text-small text-gray'
- }, 'This feature is only available to publishers on a Disqus Polls Business plan.', ' ', C.a.createElement(Us, {
- path: '/settings/subscription/?product=polls',
- orgId: o.id,
- orgSlug: o.slug
- }, 'View upgrade options'), '.')) : null, C.a.createElement(Ob, {
- name: 'adultContent',
- checked: this.state.adultContent,
- label: 'Adult Content',
- secondaryLabel: 'Flag my site as adult oriented or NSFW',
- onChange: this.handleInputChange('adultContent'),
- idNamespace: this.constructor.displayName,
- readOnly: this.props.forumUpdateIsSaving,
- shouldHighlight: this.hasFieldChanged('adultContent'),
- tooltip: C.a.createElement(C.a.Fragment, null, C.a.createElement('a', {
- href: Pn.nsfwContent
- }, 'What does this mean?'))
- }), e ? C.a.createElement('span', null, C.a.createElement(Mf, {
- id: l,
- name: 'colorScheme',
- label: 'Color scheme',
- className: 'fieldset-item__select',
- value: this.state.colorScheme,
- options: pf,
- onChange: this.handleInputChange('colorScheme'),
- readOnly: this.props.forumUpdateIsSaving,
- loading: this.props.forumUpdateIsSaving,
- shouldHighlight: this.hasFieldChanged('colorScheme')
- }), C.a.createElement(kf, {
- label: 'Typeface',
- labelId: c,
- blockAdditionalClass: '-text text-medium align align--wrap',
- shouldHighlight: this.hasFieldChanged('typeface') || this.hasFieldChanged('customFont')
- }, C.a.createElement(Mf, {
- id: c,
- name: 'typeface',
- secondaryLabel: 'Category',
- className: 'fieldset-item__select',
- value: this.state.typeface,
- options: lf,
- onChange: this.handleFontSelection('typeface'),
- inline: !0,
- readOnly: this.props.forumUpdateIsSaving,
- loading: this.props.forumUpdateIsSaving
- }))) : C.a.createElement(kf, {
- label: 'Appearance',
- labelId: l,
- blockAdditionalClass: '-text text-medium align align--wrap',
- shouldHighlight: this.hasFieldChanged('colorScheme') || this.hasFieldChanged('typeface')
- }, C.a.createElement(Mf, {
- id: l,
- name: 'colorScheme',
- secondaryLabel: 'Color scheme',
- className: 'fieldset-item__select',
- value: this.state.colorScheme,
- options: pf,
- onChange: this.handleInputChange('colorScheme'),
- inline: !0,
- readOnly: this.props.forumUpdateIsSaving,
- loading: this.props.forumUpdateIsSaving
- }), C.a.createElement(Mf, {
- id: c,
- name: 'typeface',
- secondaryLabel: 'Typeface',
- className: 'fieldset-item__select',
- value: this.state.typeface,
- options: lf,
- onChange: this.handleInputChange('typeface'),
- inline: !0,
- readOnly: this.props.forumUpdateIsSaving,
- loading: this.props.forumUpdateIsSaving
- }))), C.a.createElement('footer', {
- className: 'settings__footer'
- }, C.a.createElement(Bh, {
- disabled: !this.hasUnsavedChanges(),
- onClick: this.handleSaveChanges,
- isSaving: this.props.forumUpdateIsSaving || this.props.forumFaviconIsSaving,
- isSaved: this.props.forumUpdateIsSaved
- }))))
- }
- }
- ]) && mM(e.prototype, t),
- n && mM(e, n),
- r
- }();
- bM(Mc, 'displayName', 'PollsSettingsGeneral'),
- bM(Mc, 'propTypes', {
- history: b.a.shape({
- setRouteLeaveHook: b.a.func.isRequired
- }).isRequired,
- route: b.a.object.isRequired,
- organizations: b.a.object.isRequired,
- selection: ht.isRequired,
- forumDetails: $c,
- forumDetailsError: b.a.string,
- forumDetailsIsFetching: b.a.bool,
- fetchForumDetails: b.a.func.isRequired,
- forumUpdateError: b.a.string,
- forumUpdateIsSaving: b.a.bool,
- forumUpdateIsSaved: b.a.bool,
- forumUpdateOnSave: b.a.func.isRequired,
- forumUpdateOnDismissError: b.a.func.isRequired,
- forumCategories: b.a.shape({
- allCategories: b.a.arrayOf(vl)
- }).isRequired,
- forumLanguages: b.a.arrayOf(xl).isRequired,
- emitTrackingEvent: b.a.func.isRequired,
- fetchForumCategories: b.a.func.isRequired,
- fetchForumLanguages: b.a.func.isRequired,
- abortUpdateForumFaviconApiCall: b.a.func.isRequired,
- forumFaviconValidateImageFile: b.a.func.isRequired,
- forumFaviconOnSave: b.a.func.isRequired,
- forumFaviconOnDismissError: b.a.func.isRequired,
- forumFaviconError: b.a.string,
- forumFaviconIsSaving: b.a.bool,
- forumFaviconNewUrl: b.a.string
- }),
- bM(Mc, 'getEditableFieldsFromForum', function (e) {
- return {
- name: (e = e || {
- }).name,
- website: e.url,
- category: e.forumCategory && e.forumCategory.id || null,
- adultContent: !!(e.settings || {
- }).adultContent,
- typeface: e.typeface,
- customFont: e.customFont || cf.name,
- colorScheme: e.colorScheme,
- description: e.raw_description,
- lastValidFavicon: e.favicon && e.favicon.permalink,
- language: e.language,
- enableDisqusBranding: !e.disableDisqusBrandingOnPolls
- }
- }),
- bM(Mc, 'getFontOptionsList', function () {
- var e = (Sb.a.lounge || {
- }).font_options;
- return e[0] !== cf && e.unshift(cf),
- e
- });
- bp = Object(u.connect) (function (e) {
- var t = e.forumDetails,
- n = e.forumUpdateFavicon;
- return {
- forumCategories: e.forumCategories,
- forumLanguages: e.forumLanguages.languages,
- forumDetails: t.forumDetails,
- forumDetailsError: t.forumDetailsError,
- forumDetailsIsFetching: t.forumDetailsIsFetching,
- forumFaviconError: n.error,
- forumFaviconIsSaving: n.isSaving,
- forumFaviconNewUrl: n.forumFaviconNewUrl,
- selection: e.selection,
- pollsOrgCurrentPackage: e.subscription.pollsOrgCurrentPackage
- }
- }, {
- emitTrackingEvent: Xo({
- zone: 'settings',
- section: 'polls/general'
- }),
- fetchForumCategories: Nh,
- fetchForumLanguages: vu,
- fetchForumDetails: ig,
- abortUpdateForumFaviconApiCall: Zu,
- forumFaviconValidateImageFile: hv,
- forumFaviconOnSave: cp,
- forumFaviconOnDismissError: bp,
- fetchSubscription: Hl
- }) (Ni.a.attachDrivers(Fo() (Mc), [
- m
- ]));
- function vM(t, e) {
- var n,
- a = Object.keys(t);
- return Object.getOwnPropertySymbols && (n = Object.getOwnPropertySymbols(t), e && (n = n.filter(function (e) {
- return Object.getOwnPropertyDescriptor(t, e).enumerable
- })), a.push.apply(a, n)),
- a
- }
- function _M(a) {
- for (var e = 1; e < arguments.length; e++) {
- var r = null != arguments[e] ? arguments[e] : {
- };
- e % 2 ? vM(Object(r), !0).forEach(function (e) {
- var t,
- n;
- n = r[t = e],
- t in (e = a) ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(a, Object.getOwnPropertyDescriptors(r)) : vM(Object(r)).forEach(function (e) {
- Object.defineProperty(a, e, Object.getOwnPropertyDescriptor(r, e))
- })
- }
- return a
- }
- function EM() {
- return (EM = Object.assign || function (e) {
- for (var t = 1; t < arguments.length; t++) {
- var n,
- a = arguments[t];
- for (n in a) Object.prototype.hasOwnProperty.call(a, n) && (e[n] = a[n])
- }
- return e
- }).apply(this, arguments)
- }
- Mc = {
- fetchModeratorList: function () {
- return function (t, e) {
- t({
- type: X.fetching
- });
- e = e().selection.forum.shortname;
- io.a.call('polls/listModerators', {
- type: 'GET',
- data: {
- forum: e
- },
- success: function (e) {
- t({
- type: X.onFetch,
- moderatorList: e.response
- })
- },
- error: function (e) {
- t({
- type: X.onFetchError,
- data: e
- })
- }
- })
- }
- },
- addModerator: function (n, a) {
- return function (t, e) {
- t({
- type: X.saving
- });
- e = e().selection.forum.shortname,
- e = EM({
- user: 'username:'.concat(n),
- forum: e
- }, a);
- io.a.call('polls/addModerator', {
- type: 'POST',
- data: e,
- success: function () {
- t({
- type: X.onSave
- })
- },
- error: function (e) {
- t({
- type: X.onSaveError,
- data: e
- })
- }
- })
- }
- },
- removeModerator: function (e) {
- var n = e.userId,
- a = e.forumId;
- return function (t) {
- t({
- type: X.saving
- }),
- io.a.call('polls/removeModerator', {
- type: 'POST',
- data: {
- forum: a,
- user: n
- },
- success: function () {
- t({
- type: X.onSave
- })
- },
- error: function (e) {
- t({
- type: X.onSaveError,
- data: e
- })
- }
- })
- }
- },
- updateModeratorPermissions: function (n, a) {
- return function (t, e) {
- t({
- type: X.updating,
- username: n,
- permissions: {
- isSaving: !0
- }
- });
- e = e().selection.forum.shortname,
- e = EM({
- user: 'username:'.concat(n),
- forum: e
- }, a);
- io.a.call('polls/addModerator', {
- type: 'POST',
- data: e,
- success: function (e) {
- t({
- type: X.onUpdate,
- username: n,
- permissions: _M(_M({
- }, e.response), {
- }, {
- isSaving: !1
- })
- })
- },
- error: function (e) {
- t(_M({
- type: X.onUpdateError,
- username: n,
- permissions: {
- isSaving: !1
- }
- }, e))
- }
- })
- }
- }
- };
- function OM(e) {
- return (OM = 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator ? function (e) {
- return typeof e
- }
- : function (e) {
- return e && 'function' == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? 'symbol' : typeof e
- }) (e)
- }
- function SM(t, e) {
- var n,
- a = Object.keys(t);
- return Object.getOwnPropertySymbols && (n = Object.getOwnPropertySymbols(t), e && (n = n.filter(function (e) {
- return Object.getOwnPropertyDescriptor(t, e).enumerable
- })), a.push.apply(a, n)),
- a
- }
- function wM(t) {
- for (var e = 1; e < arguments.length; e++) {
- var n = null != arguments[e] ? arguments[e] : {
- };
- e % 2 ? SM(Object(n), !0).forEach(function (e) {
- xM(t, e, n[e])
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(n)) : SM(Object(n)).forEach(function (e) {
- Object.defineProperty(t, e, Object.getOwnPropertyDescriptor(n, e))
- })
- }
- return t
- }
- function PM(e, t) {
- for (var n = 0; n < t.length; n++) {
- var a = t[n];
- a.enumerable = a.enumerable || !1,
- a.configurable = !0,
- 'value' in a && (a.writable = !0),
- Object.defineProperty(e, a.key, a)
- }
- }
- function kM(e, t) {
- return (kM = Object.setPrototypeOf || function (e, t) {
- return e.__proto__ = t,
- e
- }) (e, t)
- }
- function NM(n) {
- var a = function () {
- if ('undefined' == typeof Reflect || !Reflect.construct) return !1;
- if (Reflect.construct.sham) return !1;
- if ('function' == typeof Proxy) return !0;
- try {
- return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [
- ], function () {
- })),
- !0
- } catch (e) {
- return !1
- }
- }();
- return function () {
- var e,
- t = RM(n);
- return e = a ? (e = RM(this).constructor, Reflect.construct(t, arguments, e)) : t.apply(this, arguments),
- t = this,
- !(e = e) || 'object' !== OM(e) && 'function' != typeof e ? CM(t) : e
- }
- }
- function CM(e) {
- if (void 0 === e) throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called');
- return e
- }
- function RM(e) {
- return (RM = Object.setPrototypeOf ? Object.getPrototypeOf : function (e) {
- return e.__proto__ || Object.getPrototypeOf(e)
- }) (e)
- }
- function xM(e, t, n) {
- return t in e ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n,
- e
- }
- m = function () {
- !function (e, t) {
- if ('function' != typeof t && null !== t) throw new TypeError('Super expression must either be null or a function');
- e.prototype = Object.create(t && t.prototype, {
- constructor: {
- value: e,
- writable: !0,
- configurable: !0
- }
- }),
- t && kM(e, t)
- }(o, A);
- var e,
- t,
- n,
- r = NM(o);
- function o() {
- var a;
- !function (e, t) {
- if (!(e instanceof t)) throw new TypeError('Cannot call a class as a function')
- }(this, o);
- for (var e = arguments.length, t = Array(e), n = 0; n < e; n++) t[n] = arguments[n];
- return xM(CM(a = r.call.apply(r, [
- this
- ].concat(t))), 'state', {
- newUsername: ''
- }),
- xM(CM(a), 'handleAddModerator', function () {
- var e = a.state.newUsername.trim();
- e && a.props.addModerator(e)
- }),
- xM(CM(a), 'handlePermissionChange', function (e, t, n) {
- a.props.updateModeratorPermissions(e.user.username, xM({
- }, t, n.target.checked ? 1 : 0))
- }),
- xM(CM(a), 'getOrgAdminPermissions', function (e) {
- var t = [
- ];
- e.isAdmin && t.push('can edit organization info'),
- e.isModerator && t.push('can moderate all organization polls');
- e = t.join(', ');
- return t.length ? (e[0] || '').toUpperCase() + e.slice(1) : ''
- }),
- a
- }
- return e = o,
- (t = [
- {
- key: 'componentDidMount',
- value: function () {
- this.props.pollsOrgCurrentPackage || this.props.fetchSubscription(),
- this.props.fetchModeratorList(),
- this.props.selection.organization && this.props.fetchOrgAdminList()
- }
- },
- {
- key: 'componentWillReceiveProps',
- value: function (e) {
- var t = {
- };
- !e.isSaving && this.props.isSaving && (this.props.fetchModeratorList(), t.newUsername = ''),
- this.setState(t)
- }
- },
- {
- key: 'render',
- value: function () {
- var r = this,
- e = this.props.selection.organization && this.props.selection.organization.pollsActivationDate,
- t = this.props.selection.organization && Ur.SAAS_PRODUCT_PLAN_ACTIVE_STATUSES_SET.has(this.props.selection.organization.pollsSubscriptionStatus);
- return e ? this.props.isFetching || this.props.orgAdminIsFetching ? C.a.createElement(Ji, null) : t ? C.a.createElement('div', null, this.props.fetchError || this.props.updateError && C.a.createElement(Ki, {
- message: this.props.fetchError || this.props.updateError,
- alertType: 'error'
- }), C.a.createElement('div', {
- className: 'content__wrap spacing-bottom-double'
- }, C.a.createElement('header', {
- className: 'settings__header'
- }, C.a.createElement('h2', {
- className: 'text-larger text-gray-darker spacing-bottom-small'
- }, 'Poll Moderators'), C.a.createElement('p', {
- className: 'text-gray text-medium'
- }, 'Add people to help moderate your polls.', C.a.createElement('a', {
- href: Pn.modArticles,
- target: '_blank',
- rel: 'noopener noreferrer'
- }, ' Learn more » '))), C.a.createElement('section', null, this.props.isFetching && !this.props.pollModeratorList ? C.a.createElement(Ji, null) : null, (this.props.pollModeratorList || [
- ]).map(function (e) {
- var t = e.user.username === r.props.selection.forum.founder.username,
- n = '//'.concat(pt.a.disqusHost, '/by/').concat(e.user.username, '/'),
- a = r.props.isSaving || e.isSaving;
- return C.a.createElement('div', {
- key: e.user.id,
- className: 'settings-list__item',
- style: {
- opacity: e.isSaving ? '0.7' : '1'
- }
- }, C.a.createElement('div', {
- className: 'align align--between'
- }, C.a.createElement('div', {
- className: 'spacing-right align align--middle'
- }, C.a.createElement('div', {
- className: 'spacing-right spacing-top-small'
- }, C.a.createElement('img', {
- className: 'block__item border-radius-base',
- src: e.user.avatar.cache,
- width: '40',
- height: '40'
- })), C.a.createElement('div', null, C.a.createElement('a', {
- href: n,
- className: 'text-medium text-semibold'
- }, e.user.name), t && C.a.createElement('p', {
- className: 'text-small text-gray spacing-top-tiny'
- }, 'Primary moderator has full permissions. ', C.a.createElement('a', {
- href: Pn.changePrimaryMod,
- target: '_blank',
- rel: 'noopener noreferrer'
- }, 'Need to change the primary moderator?')))), t ? null : C.a.createElement('div', {
- className: 'align-min-tablet align--middle spacing-top-small spacing-bottom-small'
- }, C.a.createElement('button', {
- className: 'button button-outline text-medium',
- onClick: r.props.removeModerator.bind(null, {
- forumId: e.forum,
- userId: e.user.id
- }),
- disabled: a
- }, 'Remove'))))
- }), C.a.createElement('div', {
- className: 'settings-list__item'
- }, C.a.createElement('form', {
- onSubmit: function (e) {
- return e.preventDefault()
- }
- }, C.a.createElement('div', {
- className: 'align spacing-top-small'
- }, C.a.createElement('div', {
- className: 'spacing-right align__item--grow'
- }, C.a.createElement('input', {
- type: 'text',
- className: 'input--textbox',
- placeholder: 'Add a new poll moderator by their username',
- onChange: function (e) {
- return r.setState({
- newUsername: e.target.value
- })
- },
- value: this.state.newUsername,
- disabled: this.props.isSaving
- })), C.a.createElement('button', {
- className: 'button button-outline text-medium',
- onClick: this.handleAddModerator,
- disabled: this.props.isSaving || !this.state.newUsername
- }, 'Add')), C.a.createElement('p', {
- className: 'fieldset__description spacing-bottom-small text-small text-gray spacing-top-tiny'
- }, 'Moderators require a Disqus account.', C.a.createElement('a', {
- href: Pn.modArticles,
- target: '_blank',
- rel: 'noopener noreferrer'
- }, ' Learn more » ')), this.props.saveError && C.a.createElement('p', {
- className: 'text-medium text-error text-semibold spacing-narrow'
- }, this.props.saveError))))), this.props.selection.organization && C.a.createElement('div', {
- className: 'content__wrap spacing-bottom-double'
- }, C.a.createElement('header', {
- className: 'settings__header'
- }, C.a.createElement('h2', {
- className: 'text-larger text-gray-darker spacing-bottom-small'
- }, 'Organization Admins'), C.a.createElement('p', {
- className: 'text-gray text-medium'
- }, 'Organization admins have full moderation permissions on each of the polls in the organization.', ' ', C.a.createElement(Us, {
- path: '/settings/admins/',
- orgId: this.props.selection.organization.id,
- orgSlug: this.props.selection.organization.slug
- }, 'Manage Admins »'))), C.a.createElement('section', null, this.props.orgAdminListIsFetching && !this.props.orgAdminList && C.a.createElement(Ji, null), (this.props.orgAdminList || [
- ]).map(function (e) {
- var t = r.props.selection.organization && e.user.username === r.props.selection.organization.owner,
- n = '//'.concat(pt.a.disqusHost, '/by/').concat(e.user.username, '/');
- return C.a.createElement('div', {
- className: 'settings-list__item',
- key: e.id
- }, C.a.createElement('div', {
- className: 'align align--between'
- }, C.a.createElement('div', {
- className: 'spacing-right align'
- }, C.a.createElement('div', {
- className: 'spacing-right spacing-top-small'
- }, C.a.createElement('img', {
- className: 'border-radius-base',
- src: e.user.avatar.cache,
- width: '40',
- height: '40'
- })), C.a.createElement('div', null, C.a.createElement('a', {
- href: n,
- className: 'text-medium text-semibold'
- }, e.user.name), C.a.createElement('p', {
- className: 'text-small text-gray spacing-top-tiny'
- }, t ? 'Organization owner has full permissions.' : r.getOrgAdminPermissions(e))))))
- })))) : C.a.createElement(Mk, {
- organization: this.props.organization
- }) : C.a.createElement(Cm, {
- isPolls: !0,
- organization: this.props.selection.organization
- })
- }
- }
- ]) && PM(e.prototype, t),
- n && PM(e, n),
- o
- }();
- xM(m, 'displayName', 'PollsSettingsModerators'),
- xM(m, 'propTypes', {
- selection: ht.isRequired,
- pollModeratorList: b.a.arrayOf(b.a.shape({
- user: b.a.shape({
- id: b.a.string,
- username: b.a.string,
- name: b.a.string,
- avatar: b.a.shape({
- cache: b.a.string
- })
- }),
- id: b.a.string,
- forum: b.a.string
- })),
- isFetching: b.a.bool,
- isSaving: b.a.bool,
- isUpdating: b.a.bool,
- fetchError: b.a.string,
- saveError: b.a.string,
- updateError: b.a.string,
- orgAdminList: b.a.arrayOf(b.a.shape({
- id: b.a.number.isRequired,
- organizationId: b.a.number.isRequired,
- isAdmin: b.a.bool.isRequired,
- isModerator: b.a.bool.isRequired,
- user: To
- })),
- orgAdminIsFetching: b.a.bool,
- fetchOrgAdminList: b.a.func.isRequired,
- fetchModeratorList: b.a.func.isRequired,
- addModerator: b.a.func.isRequired,
- removeModerator: b.a.func.isRequired,
- updateModeratorPermissions: b.a.func.isRequired
- });
- To = Object(u.connect) (function (e) {
- var t = e.orgAdmin,
- n = e.subscription;
- return wM(wM(wM({
- selection: e.selection
- }, e.pollModerator), t), {
- }, {
- pollsOrgCurrentPackage: n.pollsOrgCurrentPackage
- })
- }, wM(wM(wM({
- }, Mc), Ss), {
- }, {
- fetchSubscription: Hl
- })) (Fo() (m));
- function AM(t, e) {
- var n,
- a = Object.keys(t);
- return Object.getOwnPropertySymbols && (n = Object.getOwnPropertySymbols(t), e && (n = n.filter(function (e) {
- return Object.getOwnPropertyDescriptor(t, e).enumerable
- })), a.push.apply(a, n)),
- a
- }
- function DM(a) {
- for (var e = 1; e < arguments.length; e++) {
- var r = null != arguments[e] ? arguments[e] : {
- };
- e % 2 ? AM(Object(r), !0).forEach(function (e) {
- var t,
- n;
- n = r[t = e],
- t in (e = a) ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(a, Object.getOwnPropertyDescriptors(r)) : AM(Object(r)).forEach(function (e) {
- Object.defineProperty(a, e, Object.getOwnPropertyDescriptor(r, e))
- })
- }
- return a
- }
- function jM(e, t, n) {
- t.selection.forum && n(e = {
- data: DM({
- forum: t.selection.forum.shortname
- }, e)
- })
- }
- var Mc = n(525),
- TM = n.n(Mc);
- function IM(e, t, n) {
- return t in e ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n,
- e
- }
- var qM = - 1,
- Ss = b.a.shape({
- impressions: b.a.number,
- responses: b.a.number,
- response_rate: b.a.number,
- respondents: b.a.number,
- impressions_series: b.a.arrayOf(b.a.array),
- responses_series: b.a.arrayOf(b.a.array),
- response_rate_series: b.a.arrayOf(b.a.array)
- }),
- m = b.a.shape({
- totalResponses: b.a.number,
- questions: b.a.arrayOf(b.a.shape({
- text: b.a.string,
- answers: b.a.arrayOf(b.a.shape({
- text: b.a.string,
- count: b.a.number
- }))
- }))
- }),
- Mc = b.a.objectOf(Uc),
- FM = 5,
- LM = {
- DAY: 'day',
- MONTH: 'month'
- },
- UM = (IM(Uc = {
- }, LM.DAY, 'daily'), IM(Uc, LM.MONTH, 'monthly'), Uc),
- MM = (IM(Uc = {
- }, LM.DAY, 'YYYY-MM-DD'), IM(Uc, LM.MONTH, 'YYYY-MM'), Uc),
- BM = {
- IMPRESSIONS: 'impressions',
- RESPONSES: 'responses',
- RESPONSE_RATE: 'response_rate',
- RESPONDENTS: 'respondents'
- },
- zM = (IM(Uc = {
- }, BM.IMPRESSIONS, 'impressions_series'), IM(Uc, BM.RESPONSES, 'responses_series'), IM(Uc, BM.RESPONSE_RATE, 'response_rate_series'), IM(Uc, BM.RESPONDENTS, 'respondents_series'), Uc),
- HM = [
- BM.IMPRESSIONS,
- BM.RESPONSES,
- BM.RESPONSE_RATE
- ],
- GM = [
- BM.IMPRESSIONS,
- BM.RESPONSES,
- BM.RESPONDENTS,
- BM.RESPONSE_RATE
- ],
- VM = (IM(Uc = {
- }, BM.IMPRESSIONS, '#F66B1D'), IM(Uc, BM.RESPONSES, '#2E9FFF'), IM(Uc, BM.RESPONSE_RATE, '#3DC51B'), IM(Uc, BM.RESPONDENTS, '#FF006E'), Uc),
- WM = [
- '#FF006E',
- '#FFBE0C',
- '#3A86FE',
- '#D0D0DA'
- ],
- YM = (IM(Uc = {
- }, BM.IMPRESSIONS, 'Impressions'), IM(Uc, BM.RESPONSES, 'Responses'), IM(Uc, BM.RESPONSE_RATE, 'Response Rate'), IM(Uc, BM.RESPONDENTS, 'Respondents'), Uc),
- QM = (IM(Uc = {
- }, BM.IMPRESSIONS, 'Total Impressions'), IM(Uc, BM.RESPONSES, 'Total Responses'), IM(Uc, BM.RESPONSE_RATE, 'Avg. Overall Response Rate'), IM(Uc, BM.RESPONDENTS, 'Total Respondents'), Uc),
- KM = {
- color: {
- pattern: [
- VM[BM.RESPONSES],
- VM[BM.IMPRESSIONS]
- ]
- },
- legend: {
- show: !1
- },
- padding: {
- bottom: 16,
- top: 16
- },
- axis: {
- y: {
- min: 0,
- default:
- [
- 0,
- 100
- ],
- padding: {
- bottom: 0,
- right: 20
- },
- tick: {
- format: function (e) {
- return e.toLocaleString(void 0, {
- maximumFractionDigits: 0
- })
- }
- }
- },
- y2: {
- min: 0,
- max: 1,
- show: !0,
- default:
- [
- 0,
- 1
- ],
- tick: {
- format: TM.a
- },
- padding: {
- top: 0,
- bottom: 0
- }
- },
- x: {
- padding: {
- left: 0,
- top: 20
- },
- type: 'timeseries',
- tick: {
- culling: !0
- }
- }
- },
- grid: {
- x: {
- show: !0
- },
- y: {
- show: !0
- }
- },
- point: {
- show: !1
- },
- size: {
- height: 400
- },
- tooltip: {
- format: {
- value: function (e, t, n) {
- return n === BM.RESPONSE_RATE ? TM() (e) : e.toLocaleString()
- }
- }
- }
- },
- JM = {
- legend: {
- show: !1
- },
- size: {
- width: 100,
- height: 140
- },
- padding: {
- top: - 5,
- bottom: - 10
- },
- pie: {
- label: {
- show: !1
- }
- }
- };
- function $M(e) {
- return ($M = 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator ? function (e) {
- return typeof e
- }
- : function (e) {
- return e && 'function' == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? 'symbol' : typeof e
- }) (e)
- }
- function ZM(e) {
- return function (e) {
- if (Array.isArray(e)) return XM(e)
- }(e) || function (e) {
- if ('undefined' != typeof Symbol && null != e[Symbol.iterator] || null != e['@@iterator']) return Array.from(e)
- }(e) || function (e, t) {
- if (e) {
- if ('string' == typeof e) return XM(e, t);
- var n = Object.prototype.toString.call(e).slice(8, - 1);
- return 'Map' === (n = 'Object' === n && e.constructor ? e.constructor.name : n) || 'Set' === n ? Array.from(e) : 'Arguments' === n || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n) ? XM(e, t) : void 0
- }
- }(e) || function () {
- throw new TypeError('Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.')
- }()
- }
- function XM(e, t) {
- for (var n = 0, a = Array(t = null == t || e.length < t ? e.length : t); n < t; n++) a[n] = e[n];
- return a
- }
- function eB(t, e) {
- var n,
- a = Object.keys(t);
- return Object.getOwnPropertySymbols && (n = Object.getOwnPropertySymbols(t), e && (n = n.filter(function (e) {
- return Object.getOwnPropertyDescriptor(t, e).enumerable
- })), a.push.apply(a, n)),
- a
- }
- function tB(t) {
- for (var e = 1; e < arguments.length; e++) {
- var n = null != arguments[e] ? arguments[e] : {
- };
- e % 2 ? eB(Object(n), !0).forEach(function (e) {
- sB(t, e, n[e])
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(n)) : eB(Object(n)).forEach(function (e) {
- Object.defineProperty(t, e, Object.getOwnPropertyDescriptor(n, e))
- })
- }
- return t
- }
- function nB(e, t) {
- for (var n = 0; n < t.length; n++) {
- var a = t[n];
- a.enumerable = a.enumerable || !1,
- a.configurable = !0,
- 'value' in a && (a.writable = !0),
- Object.defineProperty(e, a.key, a)
- }
- }
- function aB(e, t) {
- return (aB = Object.setPrototypeOf || function (e, t) {
- return e.__proto__ = t,
- e
- }) (e, t)
- }
- function rB(n) {
- var a = function () {
- if ('undefined' == typeof Reflect || !Reflect.construct) return !1;
- if (Reflect.construct.sham) return !1;
- if ('function' == typeof Proxy) return !0;
- try {
- return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [
- ], function () {
- })),
- !0
- } catch (e) {
- return !1
- }
- }();
- return function () {
- var e,
- t = iB(n);
- return e = a ? (e = iB(this).constructor, Reflect.construct(t, arguments, e)) : t.apply(this, arguments),
- t = this,
- !(e = e) || 'object' !== $M(e) && 'function' != typeof e ? oB(t) : e
- }
- }
- function oB(e) {
- if (void 0 === e) throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called');
- return e
- }
- function iB(e) {
- return (iB = Object.setPrototypeOf ? Object.getPrototypeOf : function (e) {
- return e.__proto__ || Object.getPrototypeOf(e)
- }) (e)
- }
- function sB(e, t, n) {
- return t in e ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n,
- e
- }
- Uc = function () {
- !function (e, t) {
- if ('function' != typeof t && null !== t) throw new TypeError('Super expression must either be null or a function');
- e.prototype = Object.create(t && t.prototype, {
- constructor: {
- value: e,
- writable: !0,
- configurable: !0
- }
- }),
- t && aB(e, t)
- }(o, A);
- var e,
- t,
- n,
- a = rB(o);
- function o() {
- var r;
- !function (e, t) {
- if (!(e instanceof t)) throw new TypeError('Cannot call a class as a function')
- }(this, o);
- for (var e = arguments.length, t = Array(e), n = 0; n < e; n++) t[n] = arguments[n];
- return sB(oB(r = a.call.apply(a, [
- this
- ].concat(t))), 'initGraph', function (e) {
- r.ref && (!r.ref.graph.parentElement.clientWidth && (e || 0) < FM ? setTimeout(r.initGraph.bind(oB(r), (e || 0) + 1), 0) : (e = r.getDateGraphData(), r.chart = Ed.a.generate(tB(tB({
- }, KM), {
- }, {
- axis: tB(tB({
- }, KM.axis), {
- }, {
- x: tB(tB({
- }, KM.axis.x), {
- }, {
- tick: tB(tB({
- }, KM.axis.x.tick), {
- }, {
- format: r.props.groupBy === LM.DAY ? '%b %d %Y' : '%b %Y'
- })
- })
- }),
- point: tB(tB({
- }, KM.point), {
- }, {
- show: e.columns[0].length < 3
- }),
- data: e,
- bindto: r.ref.graph
- }))))
- }),
- sB(oB(r), 'getDateGraphData', function () {
- var e = r.formatDataByInterval(r.props.report[zM[BM.IMPRESSIONS]]),
- t = r.formatDataByInterval(r.props.report[zM[BM.RESPONSES]]),
- n = r.formatDataByInterval(r.props.report[zM[BM.RESPONDENTS]]),
- a = r.formatDataByInterval(r.props.report[zM[BM.RESPONSE_RATE]]);
- return {
- x: 'dates',
- xFormat: r.props.groupBy === LM.DAY ? '%Y-%m-%d' : '%Y-%m',
- columns: [
- ['dates'].concat(ZM(Object.keys(e))),
- [
- BM.IMPRESSIONS
- ].concat(ZM(Object.values(e))),
- [
- BM.RESPONSES
- ].concat(ZM(Object.values(t)))
- ].concat(ZM(r.props.isMultiSubmission ? [
- [BM.RESPONDENTS].concat(ZM(Object.values(n)))
- ] : [
- ]), [
- [BM.RESPONSE_RATE].concat(ZM(Object.values(a)))
- ]),
- axes: (sB(a = {
- }, BM.IMPRESSIONS, 'y'), sB(a, BM.RESPONSES, 'y'), sB(a, BM.RESPONDENTS, 'y'), sB(a, BM.RESPONSE_RATE, 'y2'), a),
- types: (sB(a = {
- }, BM.IMPRESSIONS, 'area'), sB(a, BM.RESPONSES, 'area'), sB(a, BM.RESPONDENTS, 'area'), sB(a, BM.RESPONSE_RATE, 'line'), a),
- names: YM,
- colors: VM
- }
- }),
- sB(oB(r), 'formatDataByInterval', function (e) {
- if (!e) return [];
- var a = MM[r.props.groupBy];
- return e.reduce(function (e, t) {
- var n = ct.a.utc(t[0]).format(a);
- return e[n] = e[n] ? e[n] + t[1] : t[1],
- e
- }, {
- })
- }),
- r
- }
- return e = o,
- (t = [
- {
- key: 'componentDidMount',
- value: function () {
- this.initGraph()
- }
- },
- {
- key: 'componentDidUpdate',
- value: function () {
- this.initGraph()
- }
- },
- {
- key: 'componentWillUnmount',
- value: function () {
- this.chart && (this.chart = this.chart.destroy())
- }
- },
- {
- key: 'render',
- value: function () {
- var t = this,
- n = this.props.isTotal ? QM : YM;
- return C.a.createElement('div', {
- className: 'poll-responses-chart'
- }, C.a.createElement('div', {
- className: 'poll-responses-chart__metrics'
- }, (this.props.isMultiSubmission ? GM : HM).map(function (e) {
- return C.a.createElement('div', {
- key: e,
- className: 'poll-responses-chart__metric'
- }, C.a.createElement('div', {
- className: 'poll-responses-chart__metric-inner'
- }, C.a.createElement('div', {
- className: 'poll-responses-chart__metric-name'
- }, C.a.createElement('span', {
- className: 'poll-responses-chart__legend',
- style: {
- background: VM[e]
- }
- }), n[e], 'response_rate' === e && C.a.createElement(Md, {
- content: C.a.createElement(C.a.Fragment, null, 'The number of completions divided by the number of users who viewed or started the poll(s).'),
- direction: 'top'
- })), C.a.createElement('div', {
- className: 'poll-responses-chart__metric-value'
- }, function () {
- var e = 0 < arguments.length && void 0 !== arguments[0] ? arguments[0] : 0;
- return BM.RESPONSE_RATE === (1 < arguments.length ? arguments[1] : void 0) ? TM() (e) : e.toLocaleString()
- }(t.props.report[e], e))))
- })), C.a.createElement('div', {
- className: 'poll-responses-chart__plot',
- ref: function (e) {
- t.ref = t.ref || {
- },
- t.ref.graph = e
- }
- }))
- }
- }
- ]) && nB(e.prototype, t),
- n && nB(e, n),
- o
- }();
- sB(Uc, 'propTypes', {
- report: Ss.isRequired,
- groupBy: b.a.string,
- isTotal: b.a.bool,
- isMultiSubmission: b.a.bool
- }),
- sB(Uc, 'defaultProps', {
- report: {
- },
- groupBy: LM.DAY,
- isTotal: !1
- });
- var lB = Uc;
- function cB(e) {
- return (cB = 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator ? function (e) {
- return typeof e
- }
- : function (e) {
- return e && 'function' == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? 'symbol' : typeof e
- }) (e)
- }
- function uB(t, e) {
- var n,
- a = Object.keys(t);
- return Object.getOwnPropertySymbols && (n = Object.getOwnPropertySymbols(t), e && (n = n.filter(function (e) {
- return Object.getOwnPropertyDescriptor(t, e).enumerable
- })), a.push.apply(a, n)),
- a
- }
- function pB(t) {
- for (var e = 1; e < arguments.length; e++) {
- var n = null != arguments[e] ? arguments[e] : {
- };
- e % 2 ? uB(Object(n), !0).forEach(function (e) {
- yB(t, e, n[e])
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(n)) : uB(Object(n)).forEach(function (e) {
- Object.defineProperty(t, e, Object.getOwnPropertyDescriptor(n, e))
- })
- }
- return t
- }
- function dB(e, t) {
- for (var n = 0; n < t.length; n++) {
- var a = t[n];
- a.enumerable = a.enumerable || !1,
- a.configurable = !0,
- 'value' in a && (a.writable = !0),
- Object.defineProperty(e, a.key, a)
- }
- }
- function mB(e, t) {
- return (mB = Object.setPrototypeOf || function (e, t) {
- return e.__proto__ = t,
- e
- }) (e, t)
- }
- function fB(n) {
- var a = function () {
- if ('undefined' == typeof Reflect || !Reflect.construct) return !1;
- if (Reflect.construct.sham) return !1;
- if ('function' == typeof Proxy) return !0;
- try {
- return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [
- ], function () {
- })),
- !0
- } catch (e) {
- return !1
- }
- }();
- return function () {
- var e,
- t = gB(n);
- return e = a ? (e = gB(this).constructor, Reflect.construct(t, arguments, e)) : t.apply(this, arguments),
- t = this,
- !(e = e) || 'object' !== cB(e) && 'function' != typeof e ? hB(t) : e
- }
- }
- function hB(e) {
- if (void 0 === e) throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called');
- return e
- }
- function gB(e) {
- return (gB = Object.setPrototypeOf ? Object.getPrototypeOf : function (e) {
- return e.__proto__ || Object.getPrototypeOf(e)
- }) (e)
- }
- function yB(e, t, n) {
- return t in e ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n,
- e
- }
- Uc = function () {
- !function (e, t) {
- if ('function' != typeof t && null !== t) throw new TypeError('Super expression must either be null or a function');
- e.prototype = Object.create(t && t.prototype, {
- constructor: {
- value: e,
- writable: !0,
- configurable: !0
- }
- }),
- t && mB(e, t)
- }(o, A);
- var e,
- t,
- n,
- r = fB(o);
- function o() {
- var t;
- !function (e, t) {
- if (!(e instanceof t)) throw new TypeError('Cannot call a class as a function')
- }(this, o);
- for (var e = arguments.length, n = Array(e), a = 0; a < e; a++) n[a] = arguments[a];
- return yB(hB(t = r.call.apply(r, [
- this
- ].concat(n))), 'initGraph', function (e) {
- t.ref && (!t.ref.graph.parentElement.clientWidth && (e || 0) < FM ? setTimeout(t.initGraph.bind(hB(t), (e || 0) + 1), 0) : t.chart = Ed.a.generate(pB(pB({
- }, JM), {
- }, {
- bindto: t.ref.graph,
- data: t.getDateGraphData()
- })))
- }),
- yB(hB(t), 'getDateGraphData', function () {
- return {
- type: 'pie',
- columns: t.props.question.answers.map(function (e, t) {
- return ['' + (t + 1),
- e.count]
- }),
- names: t.props.question.answers.reduce(function (e, t, n) {
- return pB(pB({
- }, e), {
- }, yB({
- }, '' + (n + 1), t.text))
- }, {
- }),
- colors: WM.reduce(function (e, t, n) {
- return pB(pB({
- }, e), {
- }, yB({
- }, '' + (n + 1), t))
- }, {
- })
- }
- }),
- t
- }
- return e = o,
- (t = [
- {
- key: 'componentDidMount',
- value: function () {
- this.initGraph()
- }
- },
- {
- key: 'componentDidUpdate',
- value: function () {
- this.initGraph()
- }
- },
- {
- key: 'componentWillUnmount',
- value: function () {
- this.chart && (this.chart = this.chart.destroy())
- }
- },
- {
- key: 'render',
- value: function () {
- var t = this;
- return C.a.createElement('div', {
- className: 'poll-breakdown-chart'
- }, C.a.createElement('div', {
- className: 'poll-breakdown-chart__header'
- }, C.a.createElement('div', {
- className: 'poll-breakdown-chart__title'
- }, 'Question ', this.props.index), C.a.createElement('div', {
- className: 'poll-breakdown-chart__question'
- }, this.props.question.text), C.a.createElement('span', {
- className: 'poll-breakdown-chart__answers-count'
- }, this.props.totalResponses.toLocaleString()), ' ', C.a.createElement('span', {
- className: 'poll-breakdown-chart__answers-label'
- }, 'answers')), C.a.createElement('div', {
- className: 'poll-breakdown-chart__plot',
- ref: function (e) {
- t.ref = t.ref || {
- },
- t.ref.graph = e
- }
- }), C.a.createElement('div', {
- className: 'poll-breakdown-chart__legend'
- }, this.props.question.answers.map(function (e, t) {
- return C.a.createElement('div', {
- key: t,
- className: 'poll-breakdown-chart__legend-item'
- }, C.a.createElement('span', {
- className: 'poll-breakdown-chart__legend-point',
- style: {
- background: WM[t]
- }
- }), C.a.createElement('span', {
- className: 'poll-breakdown-chart__legend-text'
- }, e.text), C.a.createElement('span', {
- className: 'poll-breakdown-chart__legend-count'
- }, e.count.toLocaleString()))
- })))
- }
- }
- ]) && dB(e.prototype, t),
- n && dB(e, n),
- o
- }();
- yB(Uc, 'propTypes', {
- index: b.a.number,
- question: b.a.shape({
- text: b.a.string,
- answers: b.a.arrayOf(b.a.shape({
- text: b.a.string,
- count: b.a.number
- }))
- }),
- totalResponses: b.a.number
- });
- var bB = Uc;
- function vB(e) {
- return (vB = 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator ? function (e) {
- return typeof e
- }
- : function (e) {
- return e && 'function' == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? 'symbol' : typeof e
- }) (e)
- }
- function _B(t, e) {
- var n,
- a = Object.keys(t);
- return Object.getOwnPropertySymbols && (n = Object.getOwnPropertySymbols(t), e && (n = n.filter(function (e) {
- return Object.getOwnPropertyDescriptor(t, e).enumerable
- })), a.push.apply(a, n)),
- a
- }
- function EB(t) {
- for (var e = 1; e < arguments.length; e++) {
- var n = null != arguments[e] ? arguments[e] : {
- };
- e % 2 ? _B(Object(n), !0).forEach(function (e) {
- RB(t, e, n[e])
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(n)) : _B(Object(n)).forEach(function (e) {
- Object.defineProperty(t, e, Object.getOwnPropertyDescriptor(n, e))
- })
- }
- return t
- }
- function OB(e) {
- return function (e) {
- if (Array.isArray(e)) return SB(e)
- }(e) || function (e) {
- if ('undefined' != typeof Symbol && null != e[Symbol.iterator] || null != e['@@iterator']) return Array.from(e)
- }(e) || function (e, t) {
- if (e) {
- if ('string' == typeof e) return SB(e, t);
- var n = Object.prototype.toString.call(e).slice(8, - 1);
- return 'Map' === (n = 'Object' === n && e.constructor ? e.constructor.name : n) || 'Set' === n ? Array.from(e) : 'Arguments' === n || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n) ? SB(e, t) : void 0
- }
- }(e) || function () {
- throw new TypeError('Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.')
- }()
- }
- function SB(e, t) {
- for (var n = 0, a = Array(t = null == t || e.length < t ? e.length : t); n < t; n++) a[n] = e[n];
- return a
- }
- function wB(e, t) {
- for (var n = 0; n < t.length; n++) {
- var a = t[n];
- a.enumerable = a.enumerable || !1,
- a.configurable = !0,
- 'value' in a && (a.writable = !0),
- Object.defineProperty(e, a.key, a)
- }
- }
- function PB(e, t) {
- return (PB = Object.setPrototypeOf || function (e, t) {
- return e.__proto__ = t,
- e
- }) (e, t)
- }
- function kB(n) {
- var a = function () {
- if ('undefined' == typeof Reflect || !Reflect.construct) return !1;
- if (Reflect.construct.sham) return !1;
- if ('function' == typeof Proxy) return !0;
- try {
- return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [
- ], function () {
- })),
- !0
- } catch (e) {
- return !1
- }
- }();
- return function () {
- var e,
- t = CB(n);
- return e = a ? (e = CB(this).constructor, Reflect.construct(t, arguments, e)) : t.apply(this, arguments),
- t = this,
- !(e = e) || 'object' !== vB(e) && 'function' != typeof e ? NB(t) : e
- }
- }
- function NB(e) {
- if (void 0 === e) throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called');
- return e
- }
- function CB(e) {
- return (CB = Object.setPrototypeOf ? Object.getPrototypeOf : function (e) {
- return e.__proto__ || Object.getPrototypeOf(e)
- }) (e)
- }
- function RB(e, t, n) {
- return t in e ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n,
- e
- }
- Uc = function () {
- !function (e, t) {
- if ('function' != typeof t && null !== t) throw new TypeError('Super expression must either be null or a function');
- e.prototype = Object.create(t && t.prototype, {
- constructor: {
- value: e,
- writable: !0,
- configurable: !0
- }
- }),
- t && PB(e, t)
- }(o, A);
- var e,
- t,
- n,
- a = kB(o);
- function o() {
- var r;
- !function (e, t) {
- if (!(e instanceof t)) throw new TypeError('Cannot call a class as a function')
- }(this, o);
- for (var e = arguments.length, t = Array(e), n = 0; n < e; n++) t[n] = arguments[n];
- return RB(NB(r = a.call.apply(a, [
- this
- ].concat(t))), 'state', {
- pollId: + ('' + (r.props.params.pollId || qM)),
- groupBy: LM.DAY,
- startDate: ct() ().utc().subtract(1, 'month'),
- endDate: ct() ().utc()
- }),
- RB(NB(r), 'handlePollChange', function (e) {
- e = e.target.value;
- r.setState({
- pollId: e
- }, r.fetchReport),
- r.props.history.push({
- pathname: ''.concat(Wc.INSIGHTS).concat(e === qM ? '' : ''.concat(e))
- })
- }),
- RB(NB(r), 'onGroupChange', function (e) {
- r.setState({
- groupBy: e
- }, r.fetchReport)
- }),
- RB(NB(r), 'onDateChange', function (e, t) {
- r.setState({
- startDate: e,
- endDate: t
- }, r.fetchReport)
- }),
- RB(NB(r), 'getResponsesReportData', function () {
- return 1 === r.state.pollId ? r.props.totalResponsesReport : r.props.pollResponsesReport
- }),
- RB(NB(r), 'fetchReport', function () {
- return r.state.pollId === qM ? r.fetchTotalReport() : r.fetchPollReport()
- }),
- RB(NB(r), 'fetchTotalReport', function () {
- return r.props.fetchTotalResponsesReport({
- start: r.state.startDate.toISOString(),
- end: r.state.endDate.endOf('day').toISOString(),
- agg_period: UM[r.state.groupBy]
- })
- }),
- RB(NB(r), 'fetchPollReport', function () {
- var e = r.state,
- t = e.groupBy,
- n = e.endDate,
- a = e.pollId,
- e = e.startDate.toISOString(),
- n = n.endOf('day').toISOString();
- r.props.pollDetails[a] || r.props.fetchPollDetails(a),
- r.props.fetchPollResponsesReport({
- agg_period: UM[t],
- start: e,
- end: n,
- pollId: a
- }),
- r.props.fetchPollBreakdownReport({
- start: e,
- end: n,
- pollId: a
- })
- }),
- RB(NB(r), 'isFetching', function () {
- return r.props.isFetching || r.props.isFetchingDetails
- }),
- RB(NB(r), 'getExportUrl', function () {
- var e = io.a.getURL('polls/export.xlsx');
- return Eo() (e, {
- api_key: pt.a.keys.api,
- forum: pt.a.currentForum,
- start: r.state.startDate.toISOString(),
- end: r.state.endDate.endOf('day').toISOString(),
- pollId: r.state.pollId
- })
- }),
- r
- }
- return e = o,
- (t = [
- {
- key: 'componentDidMount',
- value: function () {
- this.props.pollsOrgCurrentPackage || this.props.fetchSubscription(),
- this.fetchReport(),
- this.props.resetList(),
- this.props.fetchPolls({
- limit: 25
- })
- }
- },
- {
- key: 'componentWillUnmount',
- value: function () {
- window.removeEventListener('scroll', this.onScroll)
- }
- },
- {
- key: 'render',
- value: function () {
- var n = this,
- e = this.props.organization && this.props.organization.pollsActivationDate,
- t = this.props.organization && Ur.SAAS_PRODUCT_PLAN_ACTIVE_STATUSES_SET.has(this.props.organization.pollsSubscriptionStatus);
- if (!e) return C.a.createElement(Cm, {
- isPolls: !0,
- organization: this.props.selection.organization
- });
- if (this.isFetching()) return C.a.createElement(Ji, null);
- if (!t) return C.a.createElement(Mk, {
- organization: this.props.organization
- });
- var a = this.state.pollId === qM,
- r = !!(this.state.pollId && this.props.pollDetails[this.state.pollId] && 0 < this.props.pollDetails[this.state.pollId].voteInterval),
- e = [
- {
- key: qM,
- value: qM,
- label: 'All polls'
- }
- ].concat(OB(this.props.polls.map(function (e) {
- return {
- key: e.id,
- value: e.id,
- label: e.name
- }
- }))),
- t = a && 0 < this.props.totalResponsesReport.impressions || !a && 0 < this.props.pollResponsesReport.impressions ? C.a.createElement('div', {
- className: 'polls-analytics__section-content'
- }, C.a.createElement(lB, {
- groupBy: this.state.groupBy,
- report: a ? this.props.totalResponsesReport : this.props.pollResponsesReport,
- isTotal: a,
- isMultiSubmission: r
- })) : C.a.createElement(tM, {
- noPollData: !0
- }),
- r = !this.isFetching() && !a && 0 < this.props.pollBreakdownReport.questions.length;
- return C.a.createElement('div', {
- className: 'content__wrap spacing-bottom-double polls-analytics'
- }, C.a.createElement('header', {
- className: 'polls__section-header'
- }, C.a.createElement('h2', {
- className: 'text-largest text-gray-darker'
- }, 'Poll Insights')), C.a.createElement('div', {
- className: 'polls-analytics__poll-selector'
- }, C.a.createElement(Mf, {
- name: 'poll-id',
- label: 'Select poll',
- value: this.state.pollId,
- options: e,
- placeholder: 'All polls',
- onChange: this.handlePollChange,
- idNamespace: this.constructor.displayName,
- readOnly: this.props.isFetchingPolls,
- disabled: !e.length || this.props.isFetchingPolls
- })), C.a.createElement(C.a.Fragment, null, C.a.createElement('section', {
- className: 'polls-analytics__section'
- }, C.a.createElement('div', {
- className: 'polls-analytics__section-header'
- }, C.a.createElement('div', {
- className: 'polls-analytics__section-title'
- }, 'Engagement Data Overview'), C.a.createElement('div', {
- className: 'polls-analytics__filters'
- }, !a && C.a.createElement('div', {
- className: 'polls-analytics__filters-item'
- }, C.a.createElement('a', {
- href: this.getExportUrl(),
- className: 'polls-analytics__button -button -right text-gray-dark text-semibold'
- }, C.a.createElement('span', {
- className: 'icon-download text-large spacing-right text-gray'
- }), 'Export Data')), C.a.createElement('div', {
- className: 'polls-analytics__filters-item'
- }, C.a.createElement(Zp, {
- dateWrapperClass: 'card__header-datepicker',
- minDate: ct() ().utc().subtract(1, 'year'),
- maxDate: ct() ().utc(),
- startDate: this.state.startDate,
- endDate: this.state.endDate,
- onDateChange: this.onDateChange,
- group: this.state.groupBy,
- onGroupChange: this.onGroupChange
- })))), this.isFetching() ? C.a.createElement(Ji, null) : t), r && C.a.createElement('section', {
- className: 'polls-analytics__section'
- }, C.a.createElement('div', {
- className: 'polls-analytics__section-header'
- }, C.a.createElement('div', {
- className: 'polls-analytics__section-title'
- }, 'Responses: Answers Breakdown')), C.a.createElement('div', {
- className: 'polls-analytics__section-content poll-breakdown'
- }, this.props.pollBreakdownReport.questions.map(function (e, t) {
- return C.a.createElement(bB, {
- key: t,
- index: t + 1,
- question: e,
- totalResponses: n.props.pollBreakdownReport.total_responses
- })
- })))))
- }
- }
- ]) && wB(e.prototype, t),
- n && wB(e, n),
- o
- }();
- RB(Uc, 'propTypes', {
- isFetching: b.a.bool,
- isFetchingDetails: b.a.bool,
- totalResponsesReport: Ss.isRequired,
- pollResponsesReport: Ss.isRequired,
- pollBreakdownReport: m.isRequired,
- pollDetails: Mc.isRequired,
- fetchTotalResponsesReport: b.a.func.isRequired,
- fetchPollResponsesReport: b.a.func.isRequired,
- fetchPollBreakdownReport: b.a.func.isRequired,
- fetchPollDetails: b.a.func.isRequired,
- isFetchingPolls: b.a.bool.isRequired,
- polls: qc.isRequired,
- fetchPolls: b.a.func.isRequired,
- resetList: b.a.func.isRequired,
- organization: b.a.shape({
- id: b.a.number.isRequired,
- slug: b.a.string.isRequired,
- pollsActivationDate: b.a.string
- })
- });
- var xB = Object(u.connect) (function (e) {
- var t = e.pollsList,
- n = e.selection,
- a = e.subscription;
- return EB(EB({
- }, e.pollAnalytics), {
- }, {
- polls: t.polls,
- isFetchingPolls: t.isFetching,
- organization: n.organization,
- pollsOrgCurrentPackage: a.pollsOrgCurrentPackage
- })
- }, {
- fetchTotalResponsesReport: function (n) {
- return function (t, e) {
- jM(n, e(), function (e) {
- return t({
- type: de.isFetching
- }),
- io.a.call('polls/statsTimelines', e).success(function (e) {
- t({
- type: de.onFetchTotalResponsesReport,
- response: e.response
- })
- })
- })
- }
- },
- fetchPollResponsesReport: function (n) {
- return function (t, e) {
- jM(n, e(), function (e) {
- return t({
- type: de.isFetching
- }),
- io.a.call('polls/statsTimelines', e).success(function (e) {
- t({
- type: de.onFetchPollResponsesReport,
- response: e.response
- })
- })
- })
- }
- },
- fetchPollBreakdownReport: function (n) {
- return function (t, e) {
- jM(n, e(), function (e) {
- return t({
- type: de.isFetching
- }),
- io.a.call('polls/statsBreakdown', e).success(function (e) {
- t({
- type: de.onFetchPollBreakdownReport,
- response: e.response
- })
- })
- })
- }
- },
- fetchPollDetails: function (n) {
- return function (t, e) {
- jM({
- pollId: n
- }, e(), function (e) {
- return t({
- type: de.isFetchingDetails
- }),
- io.a.call('polls/details', e).success(function (e) {
- t({
- type: de.onFetchPollDetails,
- response: e.response
- })
- })
- })
- }
- },
- fetchPolls: Wi.fetchPolls,
- resetList: Wi.resetList,
- fetchSubscription: Hl
- }) (Fo() (Uc));
- function AB(e) {
- return (AB = 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator ? function (e) {
- return typeof e
- }
- : function (e) {
- return e && 'function' == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? 'symbol' : typeof e
- }) (e)
- }
- function DB(e, t) {
- for (var n = 0; n < t.length; n++) {
- var a = t[n];
- a.enumerable = a.enumerable || !1,
- a.configurable = !0,
- 'value' in a && (a.writable = !0),
- Object.defineProperty(e, a.key, a)
- }
- }
- function jB(e, t) {
- return (jB = Object.setPrototypeOf || function (e, t) {
- return e.__proto__ = t,
- e
- }) (e, t)
- }
- function TB(n) {
- var a = function () {
- if ('undefined' == typeof Reflect || !Reflect.construct) return !1;
- if (Reflect.construct.sham) return !1;
- if ('function' == typeof Proxy) return !0;
- try {
- return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [
- ], function () {
- })),
- !0
- } catch (e) {
- return !1
- }
- }();
- return function () {
- var e,
- t = qB(n);
- return e = a ? (e = qB(this).constructor, Reflect.construct(t, arguments, e)) : t.apply(this, arguments),
- t = this,
- !(e = e) || 'object' !== AB(e) && 'function' != typeof e ? IB(t) : e
- }
- }
- function IB(e) {
- if (void 0 === e) throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called');
- return e
- }
- function qB(e) {
- return (qB = Object.setPrototypeOf ? Object.getPrototypeOf : function (e) {
- return e.__proto__ || Object.getPrototypeOf(e)
- }) (e)
- }
- function FB(e, t, n) {
- return t in e ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n,
- e
- }
- function LB(e) {
- return e.orgCurrentPackage && e.orgCurrentPackage.id !== Ur.DISQUS_BASIC_PACKAGE_ID
- }
- Wi = {
- zone: 'install',
- section: 'plan'
- },
- Uc = function () {
- !function (e, t) {
- if ('function' != typeof t && null !== t) throw new TypeError('Super expression must either be null or a function');
- e.prototype = Object.create(t && t.prototype, {
- constructor: {
- value: e,
- writable: !0,
- configurable: !0
- }
- }),
- t && jB(e, t)
- }(o, A);
- var e,
- t,
- n,
- r = TB(o);
- function o() {
- var t;
- !function (e, t) {
- if (!(e instanceof t)) throw new TypeError('Cannot call a class as a function')
- }(this, o);
- for (var e = arguments.length, n = Array(e), a = 0; a < e; a++) n[a] = arguments[a];
- return FB(IB(t = r.call.apply(r, [
- this
- ].concat(n))), 'advanceStep', function () {
- t.props.history.push(ho.getRoute('/install/welcome/'))
- }),
- FB(IB(t), 'trackButtonClick', function (e) {
- return t.props.emitTrackingEvent({
- verb: 'click',
- object_type: 'button',
- object_id: e && e.id !== Ur.DISQUS_BASIC_PLAN_ID ? e.id : 'basic'
- })
- }),
- FB(IB(t), 'handleSubscribe', function (e) {
- t.trackButtonClick(e),
- t.props.onSubscribe(e, t.props.history, ''.concat(window.location.origin, '/admin/install/welcome'))
- }),
- t
- }
- return e = o,
- (t = [
- {
- key: 'componentDidMount',
- value: function () {
- this.props.fetchSubscription(),
- LB(this.props) && this.advanceStep()
- }
- },
- {
- key: 'componentWillReceiveProps',
- value: function (e) {
- LB(e) && this.advanceStep()
- }
- },
- {
- key: 'render',
- value: function () {
- return C.a.createElement('section', null, C.a.createElement('div', {
- className: 'content__wrap'
- }, C.a.createElement('header', {
- className: 'basic-acknowledge'
- }, C.a.createElement('img', {
- src: '//c.disquscdn.com/next/current/publisher-admin/assets/img/disqus-logo-blue-transparent.png',
- width: '174',
- height: '32',
- alt: 'Disqus',
- title: 'Disqus'
- }), C.a.createElement('h2', {
- className: 'basic-acknowledge__header'
- }, 'Confirm your Plan'), C.a.createElement('div', {
- className: 'basic-acknowledge__body'
- }, C.a.createElement('p', null, 'You\'ve selected a plan that is free and ad-supported. We place every ad-supported site under review.'), C.a.createElement('p', null, 'To use our free-plan, sites must have ads properly enabled and viewable on page load and meet the quality standards of the Disqus advertising network.'), C.a.createElement('p', null, 'For more info on eligiblity requirements, ', C.a.createElement('a', {
- href: 'https://help.disqus.com/en/articles/4555311-disqus-advertising-qualification'
- }, 'see here'), '.')), C.a.createElement('button', {
- className: 'basic-acknowledge__button',
- onClick: this.advanceStep
- }, 'Acknowledge'), C.a.createElement('div', {
- className: 'basic-acknowledge__separator'
- }, 'or'), C.a.createElement('div', {
- className: 'basic-acknowledge__plan-text'
- }, 'If your site won\'t be eligible for our free, ad-supported plan, you\'ll need to select a paid plan below:')), C.a.createElement('section', {
- className: 'settings__content'
- }, this.props.orgPackages ? C.a.createElement(WT.a, {
- packages: this.props.orgPackages.reduce(function (e, t) {
- return e[t.id] = t,
- e
- }, {
- }),
- onSubscribe: this.handleSubscribe,
- onStartTrial: this.handleSubscribe,
- newSubscriptionFlow: Object(Tl.isNewFlow) ('cc_v2', {
- orgId: (this.props.selection.organization || {
- }).id
- }),
- hideAdSupported: !0
- }) : C.a.createElement(Qi, null))))
- }
- }
- ]) && DB(e.prototype, t),
- n && DB(e, n),
- o
- }();
- FB(Uc, 'propTypes', {
- history: b.a.shape({
- push: b.a.func.isRequired
- }).isRequired,
- orgBilling: Ur.ORG_BILLING_SHAPE,
- orgCurrentPackage: Ur.PACKAGE_SHAPE,
- orgPackages: b.a.arrayOf(Ur.PACKAGE_SHAPE),
- onSubscribe: b.a.func.isRequired,
- selection: ht.isRequired,
- emitTrackingEvent: b.a.func.isRequired,
- emitDefaultViewEvent: b.a.func.isRequired
- });
- Ni = Object(u.connect) (function (e) {
- var t = e.subscription;
- return {
- orgBilling: t.orgBilling,
- orgCurrentPackage: t.orgCurrentPackage,
- orgPackages: t.orgPackages,
- selection: e.selection
- }
- }, {
- onSubscribe: Wl,
- fetchSubscription: Hl,
- emitTrackingEvent: Xo(Wi),
- emitDefaultViewEvent: ei(Wi)
- }) (Ni.a.attachDrivers(Fo() (Uc), [
- bc
- ]));
- function UB(e) {
- return (UB = 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator ? function (e) {
- return typeof e
- }
- : function (e) {
- return e && 'function' == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? 'symbol' : typeof e
- }) (e)
- }
- function MB(e, t, n) {
- return t in e ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n,
- e
- }
- function BB() {
- return (BB = Object.assign || function (e) {
- for (var t = 1; t < arguments.length; t++) {
- var n,
- a = arguments[t];
- for (n in a) Object.prototype.hasOwnProperty.call(a, n) && (e[n] = a[n])
- }
- return e
- }).apply(this, arguments)
- }
- function zB(e, t) {
- for (var n = 0; n < t.length; n++) {
- var a = t[n];
- a.enumerable = a.enumerable || !1,
- a.configurable = !0,
- 'value' in a && (a.writable = !0),
- Object.defineProperty(e, a.key, a)
- }
- }
- function HB(e, t) {
- return (HB = Object.setPrototypeOf || function (e, t) {
- return e.__proto__ = t,
- e
- }) (e, t)
- }
- function GB(n) {
- var a = function () {
- if ('undefined' == typeof Reflect || !Reflect.construct) return !1;
- if (Reflect.construct.sham) return !1;
- if ('function' == typeof Proxy) return !0;
- try {
- return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [
- ], function () {
- })),
- !0
- } catch (e) {
- return !1
- }
- }();
- return function () {
- var e,
- t = VB(n);
- return e = a ? (e = VB(this).constructor, Reflect.construct(t, arguments, e)) : t.apply(this, arguments),
- t = this,
- !(e = e) || 'object' !== UB(e) && 'function' != typeof e ? function (e) {
- if (void 0 !== e) return e;
- throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called')
- }(t) : e
- }
- }
- function VB(e) {
- return (VB = Object.setPrototypeOf ? Object.getPrototypeOf : function (e) {
- return e.__proto__ || Object.getPrototypeOf(e)
- }) (e)
- }
- pt.a.debug && yo.a.forceFeature('polls_pub_admin');
- Fo = window.document.getElementById('app-root');
- _.a.setAppElement('#app-root');
- var Uc = Object(v.useRouterHistory) (o.createHistory) ({
- basename: '/admin'
- }),
- o = ro(),
- ro = o.getState(),
- WB = ro.selection,
- YB = ro.saasFeatures;
- o.dispatch(so.fetch());
- var so = window.document.getElementsByClassName('admin_content') [0] || window.document.querySelector('article#error'),
- QB = {
- __html: so && so.innerHTML
- },
- KB = ho.getAdminPath(window.location.pathname),
- so = window.document.title;
- function JB(i, a) {
- return function (e, t) {
- var o,
- n;
- ho.getAdminPath(e.location.basename + e.location.pathname) === KB ? (o = 'admin_content '.concat(KB.replace(/\//g, '_')), n = function () {
- !function (e, t) {
- if ('function' != typeof t && null !== t) throw new TypeError('Super expression must either be null or a function');
- e.prototype = Object.create(t && t.prototype, {
- constructor: {
- value: e,
- writable: !0,
- configurable: !0
- }
- }),
- t && HB(e, t)
- }(r, A);
- var e,
- t,
- n,
- a = GB(r);
- function r() {
- return function (e, t) {
- if (!(e instanceof t)) throw new TypeError('Cannot call a class as a function')
- }(this, r),
- a.apply(this, arguments)
- }
- return e = r,
- (t = [
- {
- key: 'componentDidMount',
- value: function () {
- i && i()
- }
- },
- {
- key: 'render',
- value: function () {
- return C.a.createElement('div', {
- className: o,
- dangerouslySetInnerHTML: QB
- })
- }
- }
- ]) && zB(e.prototype, t),
- n && zB(e, n),
- r
- }(), t(null, function (e) {
- return a ? C.a.createElement(a, e, C.a.createElement(n, null)) : C.a.createElement(n, null)
- })) : t(null, zw.a)
- }
- }
- function $B(r) {
- return function (e, t) {
- var n = ho.getAdminPath(e.location.basename + e.location.pathname),
- a = fN.supportedRoutes.some(function (e) {
- return e.test ? e.test(n) : e === n
- });
- JB(r, a ? fN : null) (e, t)
- }
- }
- function ZB(a) {
- return function (e, t) {
- var n = ho.getAdminPath(e.location.basename + e.location.pathname);
- uo.addSupportedSelections(ho.getAdminPath(n), a);
- e = a[WB.type];
- e && window._v5Config.httpStatusCode !== g.a.FORBIDDEN ? t(null, e) : t(null, function (e) {
- return C.a.createElement(bA, BB({
- }, e, {
- adminPath: n
- }))
- })
- }
- }
- function XB(e) {
- return ZB(MB({
- }, ft.forum, e))
- }
- function ez(e) {
- return ZB(MB({
- }, ft.organization, e))
- }
- function tz(e) {
- var t;
- return ZB((MB(t = {
- }, ft.global, e), MB(t, ft.forum, e), t))
- }
- function nz(e, t) {
- var n;
- return ZB((MB(n = {
- }, ft.forum, e), MB(n, ft.organization, t || e), n))
- }
- function az(e) {
- var t;
- return ZB((MB(t = {
- }, ft.forum, e), MB(t, ft.organization, e), MB(t, ft.global, e), t))
- }
- function rz(e) {
- return C.a.createElement(WA, e, C.a.createElement(wh, null))
- }
- function oz(e) {
- return C.a.createElement(WA, e, C.a.createElement(ij, null))
- }
- ac = C.a.createElement(v.Route, {
- path: 'tools'
- }, C.a.createElement(v.Route, {
- getComponent: XB(fN)
- }, C.a.createElement(v.IndexRoute, {
- component: zw.a
- }), C.a.createElement(v.Route, {
- path: 'import/details/:groupId',
- component: ac,
- title: 'Import Details'
- })), C.a.createElement(v.Route, {
- path: 'migrate-map',
- getComponent: $B(function () {
- n.e(4).then(n.bind(null, 526))
- }),
- title: 'Migrate Discussions'
- })),
- s = C.a.createElement(v.Route, {
- path: 'settings',
- getComponent: ez(AO)
- }, C.a.createElement(v.Route, {
- path: 'sites',
- component: ut,
- title: 'Organization Sites'
- }), C.a.createElement(v.Route, {
- path: 'admins',
- component: wi,
- title: 'Organization Admins'
- }), C.a.createElement(v.Route, {
- path: 'subscription',
- component: s,
- title: 'Site Subscription Settings'
- })),
- qn = [
- {
- path: 'universalcode',
- component: Fc,
- title: 'Install instructions for Universal Code'
- },
- {
- path: 'wordpress',
- component: cu,
- title: 'Install instructions for Wordpress',
- requiresForum: !0
- },
- {
- path: 'blogger',
- component: xu,
- title: 'Install instructions for Blogger'
- },
- {
- path: 'tumblr',
- component: y,
- title: 'Install instructions for Tumblr'
- },
- {
- path: 'squarespace',
- component: p,
- title: 'Install instructions for Squarespace'
- },
- {
- path: 'typepad',
- component: Sn,
- title: 'Install instructions for TypePad'
- },
- {
- path: 'movabletype',
- component: Ln,
- title: 'Install instructions for Movable Type'
- },
- {
- path: 'drupal',
- component: c,
- title: 'Install instructions for Drupal'
- },
- {
- path: 'joomla',
- component: bo,
- title: 'Install instructions for Joomla'
- },
- {
- path: 'weebly',
- component: Ts,
- title: 'Install instructions for Weebly'
- },
- {
- path: 'strikingly',
- component: cs,
- title: 'Install instructions for Strikingly'
- },
- {
- path: 'jekyll',
- component: Lo,
- title: 'Install instructions for Jekyll'
- },
- {
- path: 'ghost',
- component: di,
- title: 'Install instructions for Ghost'
- },
- {
- path: 'hubspot',
- component: Fi,
- title: 'Install instructions for HubSpot'
- },
- {
- path: 'shopify',
- component: yc,
- title: 'Install instructions for Shopify'
- },
- {
- path: 'amp',
- component: Cl,
- title: 'Install instructions for AMP'
- },
- {
- path: 'adobemuse',
- component: lh,
- title: 'Install instructions for Adobe Muse'
- },
- {
- path: 'jimdo',
- component: Vb,
- title: 'Install instructions for Jimdo'
- },
- {
- path: 'postachio',
- component: Jc,
- title: 'Install instructions for Postach.io'
- },
- {
- path: 'gatsby',
- component: Bu,
- title: 'Install instructions for Gatsby'
- },
- {
- path: 'pattern',
- component: lt,
- title: 'Install instructions for Pattern'
- },
- {
- path: 'react',
- component: qn,
- title: 'Install instructions for React'
- }
- ].map(function (e) {
- return C.a.createElement(v.Route, {
- key: e.path,
- path: e.path,
- getComponent: (e.requiresForum ? XB : tz) (e.component),
- title: e.title
- })
- }),
- Ds = C.a.createElement(v.Route, {
- path: 'install',
- getComponent: az(wn)
- }, C.a.createElement(v.IndexRoute, {
- getComponent: tz(Oi),
- title: 'Choose a platform'
- }), C.a.createElement(v.Route, {
- path: 'welcome',
- getComponent: XB(Oi),
- title: 'Choose a platform'
- }), C.a.createElement(v.Route, {
- path: 'settings',
- getComponent: XB(_o),
- title: 'Configure Disqus'
- }), C.a.createElement(v.Route, {
- path: 'moderation',
- getComponent: XB(ti),
- title: 'Configure Moderation'
- }), C.a.createElement(v.Route, {
- path: 'complete',
- getComponent: XB(Ds),
- title: 'Setup Complete!'
- }), C.a.createElement(v.Route, {
- path: 'platforms'
- }, C.a.createElement(v.IndexRedirect, {
- to: '/install/'
- }), qn)),
- bl = C.a.createElement(v.Route, {
- path: 'access',
- getComponent: XB(Pi)
- }, C.a.createElement(v.Route, {
- path: 'banned',
- component: bl,
- accessListType: 'blacklist',
- title: 'Banned/Trusted Users'
- }), C.a.createElement(v.Route, {
- path: 'trusted',
- component: bl,
- accessListType: 'whitelist',
- title: 'Banned/Trusted Users'
- })),
- qn = C.a.createElement(v.Route, {
- path: 'settings',
- getComponent: XB(ib)
- }, C.a.createElement(v.Route, {
- path: 'community',
- component: Sh,
- title: 'Site Community Settings'
- }), C.a.createElement(v.Route, {
- path: 'moderation',
- component: oo,
- title: 'Site Moderation Settings'
- }), yo.a.isFeatureActive('polls_pub_admin') && C.a.createElement(v.Route, {
- path: 'moderators',
- component: qs,
- title: 'Moderator Settings'
- }), C.a.createElement(v.Route, {
- path: 'ads',
- component: ai,
- title: 'Site Ad Settings'
- }), C.a.createElement(v.Route, {
- path: 'email-subscriptions',
- component: Ju,
- title: 'Email Subscriptions'
- }), C.a.createElement(v.Route, {
- path: 'advanced',
- component: vh,
- title: 'Site Advanced Settings'
- }), C.a.createElement(v.Route, {
- path: 'webhooks',
- component: Li,
- title: 'Site Webhooks'
- }), C.a.createElement(v.Route, {
- path: 'reactions',
- component: yl,
- title: 'Site Reactions'
- }), C.a.createElement(v.Route, {
- path: 'recommendations',
- component: sl,
- title: 'Site Recommendations'
- }), C.a.createElement(v.Route, {
- path: 'badges',
- component: F,
- title: 'Site Badges'
- }), C.a.createElement(v.Route, {
- path: 'behind-click',
- component: r,
- title: 'Site Behind a Click'
- }), C.a.createElement(v.Route, {
- path: 'install',
- component: Yi,
- title: 'Choose a platform'
- }), ',', qn, C.a.createElement(v.Redirect, {
- from: 'revenue',
- to: 'ads'
- }), C.a.createElement(v.Redirect, {
- path: 'revenue/hub/:campaign/:hubspotCompanyId',
- to: 'revenue'
- })),
- Ru = C.a.createElement(v.Route, {
- path: 'settings',
- getComponent: XB(fN)
- }, !yo.a.isFeatureActive('polls_pub_admin') && C.a.createElement(v.Route, {
- path: 'moderators',
- component: qs,
- title: 'Moderator Settings'
- }), C.a.createElement(v.Route, {
- path: 'access',
- component: Ru,
- title: 'Restricted Words Settings'
- })),
- bp = C.a.createElement(v.Route, {
- path: 'settings/polls',
- getComponent: XB(Nc)
- }, C.a.createElement(v.Route, {
- path: 'general',
- component: bp,
- title: 'General Settings'
- }), C.a.createElement(v.Route, {
- path: 'pollsters',
- component: To,
- title: 'Poll Moderator Settings'
- })),
- To = C.a.createElement(v.Route, {
- path: 'settings',
- getComponent: az($w)
- }, C.a.createElement(v.Route, {
- path: 'revenue/hub/:campaign/:hubspotCompanyId',
- title: 'Deactivate Reveal ads',
- getComponent: ez(Pc)
- })),
- Dc = C.a.createElement(v.Route, {
- path: 'internal/tools',
- getComponent: az(qo)
- }, C.a.createElement(v.Route, {
- path: 'bulk',
- component: Dc,
- title: 'Bulk Actions Tool'
- }), C.a.createElement(v.Route, {
- path: 'onboarding/:tab',
- component: Vi,
- title: 'Onboarding Tool'
- })),
- Vi = C.a.createElement(v.Route, {
- path: 'tools'
- }, C.a.createElement(v.Route, {
- path: 'onboarding/:tab',
- getComponent: az(Vi),
- title: 'Onboarding Tool'
- }), C.a.createElement(v.Route, {
- path: 'exception',
- getComponent: az(Vi),
- title: 'Exception Tool'
- })),
- I = C.a.createElement(v.Route, {
- path: 'moderate(/:tab)(/filter/:filter)(/search/:search)',
- getComponent: az(fN)
- }, C.a.createElement(v.IndexRoute, {
- component: I,
- title: 'Moderate'
- })),
- Ph = C.a.createElement(v.Route, {
- path: 'create',
- getComponent: az(Ph)
- }, C.a.createElement(v.IndexRoute, {
- component: Ap,
- title: 'Register Site'
- })),
- Ap = C.a.createElement(v.Route, {
- path: 'settings',
- getComponent: XB($w)
- }, C.a.createElement(v.Route, {
- path: 'revenue/hub/',
- component: Pc,
- title: 'Deactivate Reveal ads'
- })),
- Pc = C.a.createElement(v.Route, {
- path: 'discussions',
- getComponent: XB(fN)
- }, C.a.createElement(v.IndexRoute, {
- component: rc,
- title: 'Edit Discussions'
- }), C.a.createElement(v.Route, {
- path: 'migrate',
- getComponent: JB(function () {
- n.e(0).then(n.bind(null, 527)).then(function (e) {
- e.default.migrate.init()
- })
- }),
- title: 'Migrate Discussions'
- }), C.a.createElement(v.Route, {
- path: 'history',
- getComponent: JB(function () {
- window.document.querySelectorAll('.paging a').forEach(function (e) {
- e.className += ' btn'
- }),
- window.document.querySelectorAll('.paging span').forEach(function (e) {
- e.className += ' btn',
- e.setAttribute('disabled', 'disabled')
- })
- }),
- title: 'Discussions History'
- }), C.a.createElement(v.Route, {
- path: 'import/platform/blogger',
- getComponent: JB(function () {
- n.e(0).then(n.bind(null, 527)).then(function (e) {
- e.default.importexport.bloggerSync(pt.a.bloggerSyncOauthUrl)
- })
- }),
- title: 'Import Discussions'
- }), C.a.createElement(v.Route, {
- path: 'export',
- getComponent: JB(function () {
- n.e(0).then(n.bind(null, 527)).then(function (e) {
- e.default.importexport.init()
- })
- }),
- title: 'Import Discussions'
- })),
- rc = function (e) {
- return C.a.createElement(lU, e, C.a.createElement(YU, null))
- },
- so = C.a.createElement(u.Provider, {
- store: o
- }, C.a.createElement(v.Router, {
- history: Uc,
- onUpdate: function () {
- j.a.updateTitle(this.state, 'title', 'Disqus Admin'),
- this.router.isActive('/install/platforms/') && window.scrollTo(0, 0)
- }
- }, C.a.createElement(v.Route, {
- path: '/',
- component: t
- }, C.a.createElement(v.IndexRoute, {
- component: Mo,
- title: 'Start'
- }), C.a.createElement(v.Route, {
- path: '(orgs/:id/:name)'
- }, C.a.createElement(v.IndexRoute, {
- getComponent: az(Mo),
- title: 'Start'
- }), I, C.a.createElement(v.Route, {
- path: 'analytics/top_comments',
- title: 'Top Comments',
- getComponent: az(function (e) {
- return C.a.createElement(WA, e, C.a.createElement(qm, null))
- })
- }), C.a.createElement(v.Route, {
- path: 'analytics/revenue',
- title: 'Revenue',
- getComponent: nz(function (e) {
- return C.a.createElement($w, e, C.a.createElement(mm, null))
- })
- }), C.a.createElement(v.Route, {
- path: 'analytics/comments',
- title: 'Analytics Overview',
- getComponent: function (e, t) {
- return (WB.organization && (YB[WB.organization.id] || {
- }).advancedAnalytics ? XB(oz) : nz(rz)) (e, t)
- }
- }), C.a.createElement(v.Route, {
- path: 'settings/general',
- title: 'General Settings',
- getComponent: nz(function (e) {
- return C.a.createElement(ib, e, C.a.createElement(Wv, null))
- }, function (e) {
- return C.a.createElement(AO, e, C.a.createElement(yS, null))
- })
- }), C.a.createElement(v.Route, {
- path: 'setup',
- title: 'Setup',
- getComponent: nz(Yc)
- }), s, To, ac, qn, bl, Ru, Ap, Pc, C.a.createElement(v.Route, {
- path: 'analytics/payments',
- title: 'Payments',
- getComponent: XB(function (e) {
- return C.a.createElement($w, e, C.a.createElement(Bw, null))
- })
- }), C.a.createElement(v.Route, {
- path: 'analytics',
- component: WA
- }, C.a.createElement(v.Route, {
- path: 'content',
- title: 'Content Analysis',
- getComponent: XB(a)
- }), C.a.createElement(v.Route, {
- path: 'audience',
- title: 'Audience Analysis',
- getComponent: XB(function (e) {
- return C.a.createElement(IA, e, C.a.createElement(rT, null))
- })
- }), C.a.createElement(v.Route, {
- path: 'reactions',
- title: 'Reactions Analysis',
- getComponent: XB(function (e) {
- return C.a.createElement(qA, e, C.a.createElement(VT, null))
- })
- }), C.a.createElement(v.Route, {
- path: 'pulse',
- title: 'Attention Analytics',
- getComponent: XB(Ls)
- })), Ds, Ph, Dc, Vi, yo.a.isFeatureActive('polls_pub_admin') && C.a.createElement(C.a.Fragment, null, C.a.createElement(v.Redirect, {
- path: 'polls',
- to: 'polls/list/'
- }), C.a.createElement(v.Redirect, {
- path: 'settings/polls',
- to: 'settings/polls/general/'
- }), C.a.createElement(v.Route, {
- path: 'polls/list',
- title: 'My Polls',
- getComponent: XB(function (e) {
- return C.a.createElement(lU, e, C.a.createElement(cM, null))
- })
- }), C.a.createElement(v.Route, {
- path: 'polls/editor/new/',
- title: 'Polls Editor - New Poll',
- getComponent: XB(rc)
- }), C.a.createElement(v.Route, {
- path: 'polls/editor/(:pollId)',
- title: 'Polls Editor',
- getComponent: XB(rc)
- }), bp, C.a.createElement(v.Route, {
- path: 'polls/insights/(:pollId)',
- title: 'Polls Insights',
- getComponent: XB(function (e) {
- return C.a.createElement(lU, e, C.a.createElement(xB, null))
- })
- })), C.a.createElement(v.Route, {
- path: 'checkout',
- getComponent: az(Io),
- title: 'Checkout'
- })), C.a.createElement(v.Route, {
- path: 'acknowledge',
- getComponent: XB(Ni),
- title: 'Confirm your Plan'
- }), C.a.createElement(v.Redirect, {
- path: 'analytics/overview',
- to: '/analytics/comments/'
- }), C.a.createElement(v.Redirect, {
- path: 'orgs/:id/:name/analytics/overview',
- to: '/orgs/:id/:name/analytics/comments/'
- }), C.a.createElement(v.Redirect, {
- from: 'create/*',
- to: '/'
- }), C.a.createElement(v.Redirect, {
- from: 'install/*',
- to: '/install/'
- }), C.a.createElement(v.Route, {
- path: '(internal/)tools/*',
- component: go,
- title: 'Page Not Found'
- }), C.a.createElement(v.Route, {
- path: '*',
- getComponent: $B(),
- title: so
- }))));
- f() (d.a.loadCSS('//c.disquscdn.com/next/current/publisher-admin/css/main.css'), l.a.render.bind(l.a, so, Fo))
- },
- 265: function (e, t, n) {
- 'use strict';
- var a = {
- updateTitle: function (e, t, n) {
- t = (e = e.routes) [e.length - 1][t],
- n = n ? ' - '.concat(n) : '';
- window.document.title = ''.concat(t).concat(n)
- }
- };
- e.exports = a
- },
- 268: function (e, t, n) {
- t = function () {
- 'use strict';
- return {
- isIE: function () {
- return !!window.document.documentMode
- },
- isSafari: function () {
- var e = window.navigator.userAgent.toLowerCase();
- return !!~e.indexOf('safari') && !~e.indexOf('chrome')
- },
- isFirefox: function () {
- var e = window.navigator.userAgent.toLowerCase();
- return !!~e.indexOf('firefox') && !~e.indexOf('chrome')
- },
- isChrome: function () {
- var e = window.navigator.userAgent.toLowerCase();
- return !!~e.indexOf('crios') || !!window.chrome && 'Google Inc.' === window.navigator.vendor && void 0 === window.opr && !~e.indexOf('edge')
- },
- isEdge: function () {
- return !!~window.navigator.userAgent.toLowerCase().indexOf('edge')
- },
- isOpera: function () {
- var e = window.navigator.userAgent.toLowerCase();
- return !!~e.indexOf('opera') || !!~e.indexOf('opr')
- },
- isCrawler: function (e) {
- return void 0 === e && (e = window),
- /bot|crawl|slurp|spider|facebookexternalhit|embedly|feedly|pinterest/i.test(e.navigator.userAgent)
- }
- }
- }.apply(t, [
- ]);
- void 0 === t || (e.exports = t)
- },
- 269: function (e, t, n) {
- var a = function () {
- 'use strict';
- return function (e) {
- return e = e || window,
- /Mobile|iP(hone|od|ad)|Android|BlackBerry|IEMobile|Kindle|NetFront|Silk-Accelerated|(hpw|web)OS|Fennec|Minimo|Opera M(obi|ini)|Blazer|Dolfin|Dolphin|Skyfire|Zune/i.test(e.navigator.userAgent || e.navigator.vendor || e.opera)
- }
- }();
- e.exports = a
- },
- 270: function (e, t, n) {
- !function (e) {
- 'use strict';
- var t = n(145);
- e.exports = function (e) {
- var n = [
- ];
- return t(e, function (e, t) {
- void 0 !== e && n.push(encodeURIComponent(t) + (null === e ? '' : '=' + encodeURIComponent(e)))
- }),
- n.join('&')
- }
- }(e)
- },
- 271: function (e, t, n) {
- var a = function () {
- 'use strict';
- return function (e, t) {
- return Object.prototype.hasOwnProperty.call(e, t)
- }
- }();
- e.exports = a
- },
- 272: function (e, t, n) {
- 'use strict';
- t = function () {
- return {
- jester: 'https://referrer.disqus.com/juggler'
- }
- }.apply(t, [
- ]);
- void 0 === t || (e.exports = t)
- },
- 273: function (e, t, n) {
- 'use strict';
- var n = [
- n(25),
- n(7),
- n(61),
- n(51)
- ],
- n = function (S, w, e, t) {
- var P = this,
- k = e.gettext,
- N = t.LIST_TYPES,
- C = t.BAN_TYPES,
- R = t.RETROACTIVE_ACTION_TYPES,
- x = [
- {
- label: k('1 day'),
- durationHours: '24'
- },
- {
- label: k('1 week'),
- durationHours: '168'
- },
- {
- label: k('2 weeks'),
- durationHours: '336'
- }
- ];
- return function (e) {
- var t = e.user,
- n = e.listName,
- a = e.ipAddress,
- r = e.formValues,
- o = e.supportsShadowBanning,
- i = e.supportsTempBanning,
- s = e.selectRetroactiveAction,
- l = e.toggleBanTypeCallback,
- c = e.toggleUserValueChecked,
- u = e.toggleIpAddressChecked,
- p = e.updateDuration,
- d = e.updateCustomDurationAmount,
- m = e.updateCustomDurationScale,
- f = e.updateReason,
- h = e.handleSubmit,
- g = e.handleClose,
- y = e.handleChangeValue,
- b = e.closeText,
- v = e.getPlaceholderForValue,
- _ = e.itemTypes,
- E = e.itemType,
- O = e.UpgradeIcon,
- e = e.itemValue;
- return n ? S.createElement('form', {
- className: ''.concat(n, '-form')
- }, S.createElement('div', {
- className: 'admin-modal__content padding-bottom'
- }, S.createElement('div', null, n === N.WHITELIST ? S.createElement('p', {
- className: 'spacing-default'
- }, k('Adding this person to the whitelist will automatically approve his or her new comments from now on.')) : S.createElement('div', {
- className: 'align align--stretch align--wrap'
- }, S.createElement('label', {
- className: [
- 'padding-default align align__item--grow align__item--equal align--center align--column modal__option ban__option',
- i ? null : '-disabled',
- r.type === C.TEMP ? '-selected' : null
- ].join(' ')
- }, S.createElement('input', {
- type: 'radio',
- name: 'ban_type',
- value: C.TEMP,
- checked: r.type === C.TEMP,
- onChange: l,
- disabled: !i
- }), S.createElement('p', {
- className: 'text-semibold text-center modal__option-text ban__option-text'
- }, k('Timeout'), i ? null : S.createElement(O, {
- tooltipClass: 'tooltip-timeout'
- }))), n === N.BLACKLIST && r.type === C.TEMP ? S.createElement('div', {
- className: 'padding-default modal__description ban__description border-bottom-dark'
- }, S.createElement('div', {
- className: 'text-small modal__option-subtext ban__option-subtext'
- }, k('Restrict a user\'s ability to comment for a period of time. This notifies the user of their timeout. If discussions get heated, enforce timeouts so that users cool off and improve their behavior.'), x.map(function (e) {
- return S.createElement('label', {
- className: 'fieldset__block--checkbox text-medium spacing-bottom-small text-semibold text-gray-dark',
- key: e.durationHours
- }, S.createElement('input', {
- type: 'radio',
- name: 'duration',
- checked: r.durationHours === e.durationHours,
- onChange: p,
- value: e.durationHours,
- className: 'spacing-right-small'
- }), e.label)
- }), S.createElement('div', null, S.createElement('label', {
- className: 'text-medium spacing-bottom-small inline__item spacing-right text-semibold text-gray-dark'
- }, S.createElement('input', {
- type: 'radio',
- name: 'duration',
- checked: 'custom' === r.durationHours,
- onChange: p,
- value: 'custom',
- className: 'spacing-right-small'
- }), k('Custom')), S.createElement('input', {
- name: 'customDurationAmount',
- type: 'number',
- value: r.customDurationAmount,
- onChange: d,
- onFocus: d,
- onKeyPress: d,
- className: 'spacing-right-small -text-small',
- maxLength: '2',
- style: {
- width: '50px'
- },
- min: '0'
- }), S.createElement('select', {
- value: r.customDurationScale,
- onChange: m
- }, S.createElement('option', {
- value: '1'
- }, 'Hour(s)'), S.createElement('option', {
- value: '24'
- }, 'Day(s)'), S.createElement('option', {
- value: '168'
- }, 'Week(s)'))))) : null, S.createElement('label', {
- className: [
- 'padding-default align align__item--grow align__item--equal align--center align--column modal__option ban__option',
- o ? null : '-disabled',
- r.type === C.SHADOW ? '-selected' : null
- ].join(' ')
- }, S.createElement('input', {
- type: 'radio',
- name: 'ban_type',
- value: C.SHADOW,
- checked: r.type === C.SHADOW,
- onChange: l,
- disabled: !o
- }), S.createElement('p', {
- className: 'text-semibold text-center modal__option-text ban__option-text'
- }, k('Shadow Ban'), o ? null : S.createElement(O, null))), n === N.BLACKLIST && r.type === C.SHADOW ? S.createElement('div', {
- className: 'modal__description ban__description border-bottom-dark'
- }, S.createElement('p', {
- className: 'text-small modal__option-subtext ban__option-subtext'
- }, k('Ban a user without them knowing. The user can still comment, however, their posts will only be visible to themselves. Use it against trolls and spammers who attempt to circumvent a ban with new accounts.'))) : null, S.createElement('label', {
- className: [
- 'padding-default align align__item--grow align__item--equal align--center align--column modal__option ban__option',
- r.type === C.PERMANENT ? '-selected' : null
- ].join(' ')
- }, S.createElement('input', {
- type: 'radio',
- name: 'ban_type',
- value: C.PERMANENT,
- checked: r.type === C.PERMANENT,
- onChange: l
- }), S.createElement('p', {
- className: 'text-semibold text-center modal__option-text ban__option-text'
- }, 'Permanent Ban')), n === N.BLACKLIST && r.type === C.PERMANENT ? S.createElement('div', {
- className: 'modal__description ban__description border-bottom-dark'
- }, S.createElement('p', {
- className: 'text-small modal__option-subtext ban__option-subtext'
- }, k('Permanently ban the user so they can no longer post, vote, or flag comments on your site. If the user repeatedly violates your comment policy, revoke their ability to participate.'), S.createElement('label', {
- className: 'fieldset__block--checkbox text-medium spacing-bottom-small'
- }, S.createElement('span', {
- className: 'text-semibold text-gray-dark'
- }, k('Last 30 days of comments:'), ' '), S.createElement('select', {
- value: r.retroactiveAction,
- onChange: s,
- className: 'custom-select'
- }, S.createElement('option', {
- value: R.DO_NOTHING
- }, k('Do nothing')), S.createElement('option', {
- value: R.DELETE
- }, k('Delete')), S.createElement('option', {
- value: R.MARK_AS_SPAM
- }, k('Mark as spam')))))) : null)), S.createElement('div', {
- className: 'padding-default modal__config ban__config'
- }, !t || t.isAnonymous ? null : S.createElement('div', {
- className: 'align align--stretch access__block spacing-bottom embed-hidden'
- }, S.createElement('a', {
- href: t.profileUrl,
- className: 'spacing-right'
- }, S.createElement('img', {
- src: t.avatar.cache,
- alt: t.name,
- className: 'comment-__avatar border-radius-sm'
- })), S.createElement('div', {
- className: 'access__value'
- }, S.createElement('h4', null, t.name), S.createElement('p', {
- className: 'text-gray text-small'
- }, ' ', t.username, ' '))), t ? S.createElement('label', {
- className: 'fieldset__block--checkbox text-medium spacing-bottom-small'
- }, S.createElement('input', {
- type: 'checkbox',
- checked: !!r.username,
- onChange: w.partial(c, w, 'username'),
- className: 'spacing-right-small'
- }), k('User:'), ' ', ' ', S.createElement('strong', null, ' ', t.username, ' ')) : S.createElement(S.Fragment, null, S.createElement('div', {
- className: 'spacing-top spacing-bottom form-attribute-input'
- }, S.createElement('div', null, S.createElement('h3', {
- className: 'text-gray-darker'
- }, 'Type')), S.createElement('select', {
- name: 'itemType',
- className: 'input--select',
- value: P.itemType,
- onChange: y,
- disabled: _.length <= 1
- }, _.map(function (e) {
- return S.createElement('option', {
- key: e.value,
- value: e.value
- }, ' ', e.displayName, ' ')
- }))), S.createElement('div', {
- className: 'spacing-top spacing-bottom form-attribute-input'
- }, S.createElement('h3', {
- className: 'text-gray-darker'
- }, 'Value'), S.createElement('div', null, S.createElement('input', {
- className: 'input--textbox',
- name: 'itemValue',
- type: 'text',
- placeholder: v(E),
- value: e,
- onChange: y
- })))), t && n === N.BLACKLIST ? S.createElement('label', {
- className: 'fieldset__block--checkbox text-medium spacing-bottom-small'
- }, S.createElement('input', {
- type: 'checkbox',
- checked: !!r.email,
- onChange: w.partial(c, w, 'email'),
- className: 'spacing-right-small'
- }), k('Email:'), ' ', S.createElement('strong', null, ' ', t.email, ' ')) : null, n === N.BLACKLIST && a ? S.createElement('label', {
- className: 'fieldset__block--checkbox text-medium spacing-bottom-small'
- }, S.createElement('input', {
- type: 'checkbox',
- checked: !!r.ipAddress,
- onChange: u,
- className: 'spacing-right-small'
- }), k('IP Address:'), ' ', S.createElement('strong', null, ' ', a, ' '), S.createElement('div', {
- className: 'spacing-default-narrow text-small text-gray spacing-left-large embed-hidden'
- }, S.createElement('strong', null, k('Note:'), ' '), k('Adding an IP address to the banned list may also unintentionally block others who may share this IP address.'))) : null, n === N.BLACKLIST ? S.createElement('div', null, S.createElement('div', {
- className: 'spacing-bottom-small spacing-top-narrow'
- }, S.createElement('label', {
- className: 'modal__reason ban__reason'
- }, k('Reason for banning:'), S.createElement('input', {
- name: 'reason',
- type: 'text',
- value: r.reason || '',
- onChange: f,
- className: 'input--textbox -text-small border-gray-light',
- maxLength: '50'
- }))), S.createElement('p', {
- className: 'text-small modal__option-subtext ban__option-subtext'
- }, k('You can remove the user from the banned list at any time.'))) : null)), S.createElement('div', {
- className: 'admin-modal__footer clearfix'
- }, S.createElement('div', null, S.createElement('button', {
- className: 'button button-fill--brand button-small text-capitalized',
- disabled: !(r.email || r.username || r.ipAddress || e),
- onClick: h
- }, k(n === N.WHITELIST ? 'Add to Trusted List' : 'Add to Banned List')), n === N.BLACKLIST ? S.createElement('button', {
- className: 'button button-fill button-small text-capitalized',
- onClick: g
- }, k(b)) : null))) : null
- }
- }.apply(t, n);
- void 0 === n || (e.exports = n)
- },
- 275: function (e, t, n) {
- 'use strict';
- var a = {
- };
- e.exports = a
- },
- 276: function (e, t, n) {
- 'use strict';
- function r(e) {
- return (r = 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator ? function (e) {
- return typeof e
- }
- : function (e) {
- return e && 'function' == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? 'symbol' : typeof e
- }) (e)
- }
- function s(e, t) {
- for (var n = 0; n < t.length; n++) {
- var a = t[n];
- a.enumerable = a.enumerable || !1,
- a.configurable = !0,
- 'value' in a && (a.writable = !0),
- Object.defineProperty(e, a.key, a)
- }
- }
- function l(e, t) {
- return (l = Object.setPrototypeOf || function (e, t) {
- return e.__proto__ = t,
- e
- }) (e, t)
- }
- function c(n) {
- var a = function () {
- if ('undefined' == typeof Reflect || !Reflect.construct) return !1;
- if (Reflect.construct.sham) return !1;
- if ('function' == typeof Proxy) return !0;
- try {
- return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [
- ], function () {
- })),
- !0
- } catch (e) {
- return !1
- }
- }();
- return function () {
- var e,
- t = o(n);
- return e = a ? (e = o(this).constructor, Reflect.construct(t, arguments, e)) : t.apply(this, arguments),
- t = this,
- !(e = e) || 'object' !== r(e) && 'function' != typeof e ? function (e) {
- if (void 0 !== e) return e;
- throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called')
- }(t) : e
- }
- }
- function o(e) {
- return (o = Object.setPrototypeOf ? Object.getPrototypeOf : function (e) {
- return e.__proto__ || Object.getPrototypeOf(e)
- }) (e)
- }
- n = [
- n(25),
- n(26),
- n(29),
- n(277)
- ],
- void 0 === (n = function (o, e, t, n) {
- var i = Object.freeze({
- admin: 'admin',
- home: 'home',
- marketing: 'marketing'
- }),
- a = function () {
- !function (e, t) {
- if ('function' != typeof t && null !== t) throw new TypeError('Super expression must either be null or a function');
- e.prototype = Object.create(t && t.prototype, {
- constructor: {
- value: e,
- writable: !0,
- configurable: !0
- }
- }),
- t && l(e, t)
- }(r, o.Component);
- var e,
- t,
- n,
- a = c(r);
- function r() {
- return function (e, t) {
- if (!(e instanceof t)) throw new TypeError('Cannot call a class as a function')
- }(this, r),
- a.apply(this, arguments)
- }
- return e = r,
- (t = [
- {
- key: 'render',
- value: function () {
- if (this.props.motdDismissed || !this.props.motdTitle || !this.props.motdUrl || !this.props.motdCTA) return null;
- var e = 'motd-alert alert--';
- return e += this.props.zone === i.marketing ? 'success-light' : 'brand',
- this.props.isNewMotdBar && (e += ' motd-alert--updated'),
- o.createElement('div', {
- id: 'motd-bar',
- className: e
- }, o.createElement('div', {
- className: this.props.isNewMotdBar ? '' : 'padding-default'
- }, o.createElement('div', {
- className: 'text-center'.concat(this.props.isNewMotdBar ? '' : ' spacing-narrow')
- }, this.props.isNewMotdBar ? null : o.createElement('span', {
- className: 'icon-megaphone icon__position spacing-right'
- }), o.createElement(this.props.isNewMotdBar ? 'span' : 'strong', {
- className: 'spacing-right'
- }, this.props.motdTitle), o.createElement('a', {
- href: this.props.motdUrl,
- className: 'text-underline '.concat(this.props.isNewMotdBar ? 'motd-cta' : 'link-inverted-opaque text-semibold'),
- target: '_blank',
- rel: 'noopener noreferrer'
- }, this.props.motdCTA), this.props.canDismiss ? o.createElement('button', {
- className: 'link-inverted-opaque spacing-left-large',
- onClick: this.props.motdOnDismiss
- }, o.createElement('span', {
- className: 'icon-cancel'
- })) : null)))
- }
- }
- ]) && s(e.prototype, t),
- n && s(e, n),
- r
- }();
- return a.displayName = 'MotdBar',
- a.propTypes = {
- zone: e.oneOf(Object.keys(i)).isRequired,
- motdUrl: e.string.isRequired,
- motdTitle: e.string.isRequired,
- motdCTA: e.string.isRequired,
- motdOnDismiss: e.func.isRequired,
- motdDismissed: e.bool,
- canDismiss: e.bool,
- isNewMotdBar: e.bool
- },
- a.defaultProps = {
- zone: i.admin
- },
- t.attachDrivers(a, [
- n
- ])
- }.apply(t, n)) || (e.exports = n)
- },
- 277: function (e, t, n) {
- 'use strict';
- function r(e) {
- return (r = 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator ? function (e) {
- return typeof e
- }
- : function (e) {
- return e && 'function' == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? 'symbol' : typeof e
- }) (e)
- }
- function c(e, t) {
- for (var n = 0; n < t.length; n++) {
- var a = t[n];
- a.enumerable = a.enumerable || !1,
- a.configurable = !0,
- 'value' in a && (a.writable = !0),
- Object.defineProperty(e, a.key, a)
- }
- }
- function u(e, t) {
- return (u = Object.setPrototypeOf || function (e, t) {
- return e.__proto__ = t,
- e
- }) (e, t)
- }
- function p(n) {
- var a = function () {
- if ('undefined' == typeof Reflect || !Reflect.construct) return !1;
- if (Reflect.construct.sham) return !1;
- if ('function' == typeof Proxy) return !0;
- try {
- return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [
- ], function () {
- })),
- !0
- } catch (e) {
- return !1
- }
- }();
- return function () {
- var e,
- t = o(n);
- return e = a ? (e = o(this).constructor, Reflect.construct(t, arguments, e)) : t.apply(this, arguments),
- t = this,
- !(e = e) || 'object' !== r(e) && 'function' != typeof e ? d(t) : e
- }
- }
- function d(e) {
- if (void 0 === e) throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called');
- return e
- }
- function o(e) {
- return (o = Object.setPrototypeOf ? Object.getPrototypeOf : function (e) {
- return e.__proto__ || Object.getPrototypeOf(e)
- }) (e)
- }
- n = [
- n(25),
- n(26),
- n(29),
- n(39),
- n(8)
- ],
- void 0 === (n = function (o, e, t, i, n) {
- var s = n.lounge || {
- },
- l = 'motd',
- n = function () {
- !function (e, t) {
- if ('function' != typeof t && null !== t) throw new TypeError('Super expression must either be null or a function');
- e.prototype = Object.create(t && t.prototype, {
- constructor: {
- value: e,
- writable: !0,
- configurable: !0
- }
- }),
- t && u(e, t)
- }(r, o.Component);
- var e,
- t,
- n,
- a = p(r);
- function r(e) {
- var t;
- !function (e, t) {
- if (!(e instanceof t)) throw new TypeError('Cannot call a class as a function')
- }(this, r),
- (t = a.call(this, e)).getDataForZone = t.getDataForZone.bind(d(t)),
- t.handleDismiss = t.handleDismiss.bind(d(t)),
- t.getComponentProps = t.getComponentProps.bind(d(t));
- e = t.getDataForZone(t.props.zone);
- return t.state = {
- dismissed: !(!t.props.canDismiss || !i.get(l)) && i.get(l) [e.url],
- url: e.url,
- title: e.title,
- cta: e.cta
- },
- t
- }
- return e = r,
- (t = [
- {
- key: 'getDataForZone',
- value: function (e) {
- var t = s['motd_'.concat(e, '_url')];
- return {
- title: (s['motd_'.concat(e, '_title')] || '').replace('&', '&'),
- url: t,
- cta: (s['motd_'.concat(e, '_cta')] || '').replace('&', '&')
- }
- }
- },
- {
- key: 'handleDismiss',
- value: function () {
- var e = this.getDataForZone(this.props.zone),
- t = i.get(l) ? i.get(l) : {
- };
- t[e.url] = !0,
- i.set(l, t),
- this.setState({
- dismissed: !0
- })
- }
- },
- {
- key: 'getComponentProps',
- value: function () {
- return {
- motdUrl: this.state.url,
- motdTitle: this.state.title,
- motdCTA: this.state.cta || 'Learn more »',
- motdDismissed: this.state.dismissed,
- motdOnDismiss: this.handleDismiss
- }
- }
- }
- ]) && c(e.prototype, t),
- n && c(e, n),
- r
- }();
- return n.displayName = 'MotdDriver',
- n.propTypes = {
- zone: e.oneOf(['admin',
- 'home',
- 'marketing']).isRequired,
- canDismiss: e.bool.isRequired
- },
- n.defaultProps = {
- canDismiss: !0
- },
- t.createDriver(n)
- }.apply(t, n)) || (e.exports = n)
- },
- 278: function (e, t, n) {
- 'use strict';
- function a(e, t, n) {
- return t in e ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n,
- e
- }
- n = [
- t,
- n(33)
- ],
- void 0 === (n = function (e, t) {
- var n;
- e.DISPLAY_SUBSCRIPTIONS_PACKAGES_FEATURES = (a(n = {
- }, t.DISQUS_PLUS_PACKAGE_ID, [
- '1',
- '-14'
- ]), a(n, t.DISQUS_PRO_PACKAGE_ID, [
- '1',
- '-18',
- '2',
- '10',
- '3',
- '14',
- '15',
- '19',
- '4'
- ]), a(n, t.DISQUS_BUSINESS_PACKAGE_ID, [
- '6',
- '5',
- '-13',
- '-11',
- '-3',
- '-20'
- ]), a(n, t.DISQUS_BASIC_PACKAGE_ID, [
- '-34',
- '-14'
- ]), n),
- e.DISPLAY_SUBSCRIPTIONS_PACKAGES_FEATURES_ALT = (a(n = {
- }, t.DISQUS_PLUS_PACKAGE_ID, [
- '-22',
- '-23',
- '-29',
- '-30'
- ]), a(n, t.DISQUS_PRO_PACKAGE_ID, [
- '-31',
- '-32',
- '4',
- '-33',
- '3'
- ]), a(n, t.DISQUS_BUSINESS_PACKAGE_ID, [
- '6',
- '-3',
- '5',
- '-13',
- '-27'
- ]), a(n, t.DISQUS_BASIC_PACKAGE_ID, [
- '-34',
- '-14'
- ]), n),
- e.DISPLAY_POLLS_SUBSCRIPTIONS_PACKAGES_FEATURES = (a(e = {
- }, t.DISQUS_POLLS_PRO_PACKAGE_ID, [
- '-35',
- '-36',
- '-37',
- '4'
- ]), a(e, t.DISQUS_POLLS_BUSINESS_PACKAGE_ID, [
- '6',
- '-39',
- '-38',
- '-40'
- ]), a(e, t.DISQUS_POLLS_ADS_SUPPORTED_PACKAGE_ID, [
- '-34',
- '-14'
- ]), e)
- }.apply(t, n)) || (e.exports = n)
- },
- 279: function (e, t, n) {
- 'use strict';
- function r(e) {
- return (r = 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator ? function (e) {
- return typeof e
- }
- : function (e) {
- return e && 'function' == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? 'symbol' : typeof e
- }) (e)
- }
- function s(e, t) {
- for (var n = 0; n < t.length; n++) {
- var a = t[n];
- a.enumerable = a.enumerable || !1,
- a.configurable = !0,
- 'value' in a && (a.writable = !0),
- Object.defineProperty(e, a.key, a)
- }
- }
- function l(e, t) {
- return (l = Object.setPrototypeOf || function (e, t) {
- return e.__proto__ = t,
- e
- }) (e, t)
- }
- function c(n) {
- var a = function () {
- if ('undefined' == typeof Reflect || !Reflect.construct) return !1;
- if (Reflect.construct.sham) return !1;
- if ('function' == typeof Proxy) return !0;
- try {
- return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [
- ], function () {
- })),
- !0
- } catch (e) {
- return !1
- }
- }();
- return function () {
- var e,
- t = o(n);
- return e = a ? (e = o(this).constructor, Reflect.construct(t, arguments, e)) : t.apply(this, arguments),
- t = this,
- !(e = e) || 'object' !== r(e) && 'function' != typeof e ? u(t) : e
- }
- }
- function u(e) {
- if (void 0 === e) throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called');
- return e
- }
- function o(e) {
- return (o = Object.setPrototypeOf ? Object.getPrototypeOf : function (e) {
- return e.__proto__ || Object.getPrototypeOf(e)
- }) (e)
- }
- n = [
- n(25),
- n(26),
- n(73)
- ],
- void 0 === (n = function (o, e, i) {
- var t = function () {
- !function (e, t) {
- if ('function' != typeof t && null !== t) throw new TypeError('Super expression must either be null or a function');
- e.prototype = Object.create(t && t.prototype, {
- constructor: {
- value: e,
- writable: !0,
- configurable: !0
- }
- }),
- t && l(e, t)
- }(r, o.Component);
- var e,
- t,
- n,
- a = c(r);
- function r(e) {
- return function (e, t) {
- if (!(e instanceof t)) throw new TypeError('Cannot call a class as a function')
- }(this, r),
- (e = a.call(this, e)).handleToggleDropdown = e.handleToggleDropdown.bind(u(e)),
- e.handleKeyDown = e.handleKeyDown.bind(u(e)),
- e.listenToKeyDown = e.listenToKeyDown.bind(u(e)),
- e
- }
- return e = r,
- (t = [
- {
- key: 'componentDidMount',
- value: function () {
- this.props.isOpen && this.listenToKeyDown(!0)
- }
- },
- {
- key: 'componentWillUnmount',
- value: function () {
- this.listenToKeyDown(!1)
- }
- },
- {
- key: 'componentWillReceiveProps',
- value: function (e) {
- this.props.isOpen !== e.isOpen && this.listenToKeyDown(e.isOpen)
- }
- },
- {
- key: 'listenToKeyDown',
- value: function (e) {
- e ? window.document.addEventListener('keydown', this.handleKeyDown) : window.document.removeEventListener('keydown', this.handleKeyDown)
- }
- },
- {
- key: 'handleToggleDropdown',
- value: function () {
- this.props.isOpen ? this.props.onClose() : this.props.onOpen()
- }
- },
- {
- key: 'handleKeyDown',
- value: function (e) {
- 27 === e.keyCode && this.props.onClose()
- }
- },
- {
- key: 'render',
- value: function () {
- return o.createElement(i, {
- active: this.props.isOpen,
- onOutsideClick: this.props.onClose,
- className: (this.props.dropdownClassName || 'dropdown') + (this.props.isOpen ? ' open' : '')
- }, o.createElement('button', {
- onClick: this.handleToggleDropdown,
- className: this.props.className || 'dropdown-toggle'
- }, this.props.buttonChildren), this.props.children)
- }
- }
- ]) && s(e.prototype, t),
- n && s(e, n),
- r
- }();
- return t.displayName = 'DropdownStateless',
- t.propTypes = {
- className: e.string,
- dropdownClassName: e.string,
- children: e.node.isRequired,
- buttonChildren: e.node.isRequired,
- onOpen: e.func.isRequired,
- onClose: e.func.isRequired,
- isOpen: e.bool.isRequired
- },
- t
- }.apply(t, n)) || (e.exports = n)
- },
- 28: function (e, t, n) {
- var n = [
- n(37),
- n(7),
- n(65),
- n(35),
- n(60)
- ],
- n = function (n, r, e, a, o) {
- 'use strict';
- var t = window.document.createElement('a');
- function i(e) {
- return t.href = e,
- t.origin || t.protocol + '//' + t.hostname + (t.port ? ':' + t.port : '')
- }
- var s = {
- };
- function l(e) {
- return e.replace(/^(http:)?\/\//, 'https://')
- }
- function c(e) {
- (e = r.defaults(e, s)).traditional = !0,
- i(window.location.href) !== i(e.url) && (e.xhrFields = {
- withCredentials: !0
- }),
- e.omitDisqusApiKey || (e.data = e.data || {
- }, window.FormData && e.data instanceof window.FormData ? e.url = o.serialize(e.url, {
- api_key: a.keys.api
- }) : e.data.api_key = a.keys.api);
- var t = e.error;
- return e.error = function (e) {
- p.trigger('error', e),
- r.isFunction(t) && t(e)
- },
- n.ajax(e)
- }
- function u(e) {
- return /(https?:)?\/\//.test(e) ? l(e) : a.urls.api + e
- }
- var p = {
- ERROR_CODES: {
- OBJ_NOT_FOUND: 8,
- MAX_ITEMS_REACHED: 24
- },
- ajax: c,
- call: function (e, t) {
- return (t = t || {
- }).url = u(e),
- t.omitDisqusApiKey || (t.data = r.extend(t.data || {
- }, {
- api_key: a.keys.api
- })),
- p.trigger('call', t),
- c(t).always(r.bind(this.trigger, this, 'complete', t))
- },
- getURL: u,
- defaults: function (a) {
- Object.keys(a).forEach(function (e) {
- var t = a[e],
- n = s[e];
- r.isObject(t) && r.isObject(n) ? r.extend(n, t) : s[e] = t
- })
- },
- headers: function (e) {
- e = r.extend({
- }, s.headers, e);
- return s.headers = r.pick(e, Boolean),
- s.headers
- },
- makeHttps: l
- };
- return r.extend(p, e.Events),
- p
- }.apply(t, n);
- void 0 === n || (e.exports = n)
- },
- 29: function (e, t, n) {
- 'use strict';
- function r(e) {
- return (r = 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator ? function (e) {
- return typeof e
- }
- : function (e) {
- return e && 'function' == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? 'symbol' : typeof e
- }) (e)
- }
- function c(e, t) {
- for (var n = 0; n < t.length; n++) {
- var a = t[n];
- a.enumerable = a.enumerable || !1,
- a.configurable = !0,
- 'value' in a && (a.writable = !0),
- Object.defineProperty(e, a.key, a)
- }
- }
- function u(e, t) {
- return (u = Object.setPrototypeOf || function (e, t) {
- return e.__proto__ = t,
- e
- }) (e, t)
- }
- function p(n) {
- var a = function () {
- if ('undefined' == typeof Reflect || !Reflect.construct) return !1;
- if (Reflect.construct.sham) return !1;
- if ('function' == typeof Proxy) return !0;
- try {
- return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [
- ], function () {
- })),
- !0
- } catch (e) {
- return !1
- }
- }();
- return function () {
- var e,
- t = o(n);
- return e = a ? (e = o(this).constructor, Reflect.construct(t, arguments, e)) : t.apply(this, arguments),
- t = this,
- !(e = e) || 'object' !== r(e) && 'function' != typeof e ? function (e) {
- if (void 0 !== e) return e;
- throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called')
- }(t) : e
- }
- }
- function o(e) {
- return (o = Object.setPrototypeOf ? Object.getPrototypeOf : function (e) {
- return e.__proto__ || Object.getPrototypeOf(e)
- }) (e)
- }
- n = [
- n(7),
- n(25),
- n(27)
- ],
- void 0 === (n = function (s, l, a) {
- function n(e, t, n) {
- return s.isArray(e) && (e = s.chain(e[1]).map(function (t) {
- return s.findIndex(n, function (e) {
- return s.isArray(e) ? e[0].driverName === t.driverName : e.driverName === t.driverName
- })
- }).map(function (e) {
- return - 1 < e ? e : t
- }).min().value()) < t ? e - 1 : t
- }
- function r(t, e, n) {
- return s.findLastIndex(n, function (e) {
- return t.driverName === e.driverName
- }) !== e
- }
- function o(e, t) {
- return t(e)
- }
- function i(t, e) {
- e.forEach(function (e) {
- t.propTypes = s.extend({
- }, e.propTypes, t.propTypes)
- })
- }
- return {
- createDriver: function (i, t, n) {
- function e(o) {
- var e = s.isFunction(i) ? ((e = function () {
- !function (e, t) {
- if ('function' != typeof t && null !== t) throw new TypeError('Super expression must either be null or a function');
- e.prototype = Object.create(t && t.prototype, {
- constructor: {
- value: e,
- writable: !0,
- configurable: !0
- }
- }),
- t && u(e, t)
- }(r, i);
- var e,
- t,
- n,
- a = p(r);
- function r() {
- return function (e, t) {
- if (!(e instanceof t)) throw new TypeError('Cannot call a class as a function')
- }(this, r),
- a.apply(this, arguments)
- }
- return e = r,
- (t = [
- {
- key: 'render',
- value: function () {
- var e = s.extend({
- }, this.props, this.getComponentProps());
- return l.createElement(o, e)
- }
- }
- ]) && c(e.prototype, t),
- n && c(e, n),
- r
- }()).displayName = ''.concat(o.displayName, ':').concat(i.displayName), e) : l.createClass(s.extend({
- }, i, {
- displayName: ''.concat(o.displayName, ':').concat(i.displayName),
- render: function () {
- var e = s.extend({
- }, this.props, this.getComponentProps());
- return l.createElement(o, e)
- }
- }));
- return t || n ? a.connect(t, n) (e) : e
- }
- return e.driverName = i.displayName,
- e.isDriver = !0,
- e
- },
- attachDrivers: function (e, t) {
- return e.isDriver ? [
- e,
- t
- ] : s.chain(t).sortBy(n).flatten().reject(r).tap(s.partial(i, e)).reduce(o, e).value()
- }
- }
- }.apply(t, n)) || (e.exports = n)
- },
- 317: function (e, t, n) {
- 'use strict';
- var n = [
- n(25),
- n(34)
- ],
- n = function (r, o) {
- return function (e) {
- var t = e.forum,
- n = e.isVerified,
- a = e.onDismiss;
- return r.createElement('div', {
- className: 'newsletter-box spacing-bottom-large text-center'
- }, r.createElement('div', {
- className: o.isFeatureActive('embed_refresh', {
- forum: t.name
- }) ? 'text-large spacing-bottom-small' : 'text-medium spacing-bottom-small'
- }, r.createElement('strong', null, 'Thanks for subscribing!')), n ? r.createElement('div', {
- className: 'spacing-bottom-small'
- }, (t.aetBannerConfirmation || '').split('\n').map(function (e, t) {
- return r.createElement('div', {
- key: t
- }, e)
- })) : r.createElement('div', {
- className: 'spacing-bottom-small'
- }, 'To begin receiving email updates from ', t.name, ', please click the link in the confirmation email we\'ve sent to your inbox.'), r.createElement('a', {
- className: 'newsletter-box__hide',
- href: '#',
- onClick: function (e) {
- e.preventDefault(),
- a()
- }
- }, 'Dismiss this message'))
- }
- }.apply(t, n);
- void 0 === n || (e.exports = n)
- },
- 318: function (e, t, n) {
- 'use strict';
- var n = [
- n(25),
- n(61),
- n(34)
- ],
- n = function (s, e, l) {
- var c = e.gettext;
- return function (e) {
- var t = e.forum,
- n = e.isLoading,
- a = e.isLoggedIn,
- r = e.onDismiss,
- o = e.onSubscribe,
- i = e.allowEmpty;
- return s.createElement('div', {
- className: 'newsletter-box spacing-bottom-large'
- }, s.createElement('div', {
- className: l.isFeatureActive('embed_refresh', {
- forum: t.name
- }) ? 'text-large spacing-bottom-small' : 'text-medium spacing-bottom-small'
- }, s.createElement('strong', null, t.aetBannerTitle)), a ? s.createElement('button', {
- className: 'button button-fill--brand button-padding-wider pull-right',
- disabled: n,
- onClick: function () {
- o && o()
- }
- }, 'Subscribe') : null, s.createElement('div', {
- className: 'spacing-bottom'
- }, (t.aetBannerDescription || '').split('\n').map(function (e, t) {
- return s.createElement('div', {
- key: t
- }, e)
- })), s.createElement('div', {
- className: 'align align--wrap'
- }, a ? null : s.createElement('form', {
- className: 'align__item--grow',
- onSubmit: function (e) {
- e.preventDefault();
- e = e.target.elements.email.value.trim();
- (e || i) && o && o(e)
- }
- }, s.createElement('div', {
- className: 'newsletter-box__input-group'
- }, s.createElement('span', {
- className: 'icon icon-mail text-large newsletter-box__input-group__icon'
- }), s.createElement('input', {
- type: 'email',
- name: 'email',
- placeholder: c('Enter email address'),
- 'aria-label': 'Enter your email address here to opt into receiving a weekly digest of the latest articles from this publisher'
- })), s.createElement('input', {
- type: 'submit',
- className: 'button button-fill--brand button-padding-wider newsletter-box__submit',
- disabled: n,
- value: c('Subscribe'),
- 'aria-label': 'Submit your email address'
- })), s.createElement('a', {
- href: '#',
- className: 'newsletter-box__hide publisher-anchor-color',
- onClick: function (e) {
- e.preventDefault(),
- r && r()
- }
- }, c('Hide this message'))))
- }
- }.apply(t, n);
- void 0 === n || (e.exports = n)
- },
- 32: function (e, t, n) {
- 'use strict';
- function o() {
- return (o = Object.assign || function (e) {
- for (var t = 1; t < arguments.length; t++) {
- var n,
- a = arguments[t];
- for (n in a) Object.prototype.hasOwnProperty.call(a, n) && (e[n] = a[n])
- }
- return e
- }).apply(this, arguments)
- }
- function i(e, t) {
- if (null == e) return {
- };
- var n,
- a = function (e, t) {
- if (null == e) return {
- };
- var n,
- a,
- r = {
- },
- o = Object.keys(e);
- for (a = 0; a < o.length; a++) ~t.indexOf(n = o[a]) || (r[n] = e[n]);
- return r
- }(e, t);
- if (Object.getOwnPropertySymbols) for (var r = Object.getOwnPropertySymbols(e), o = 0; o < r.length; o++) ~t.indexOf(n = r[o]) || Object.prototype.propertyIsEnumerable.call(e, n) && (a[n] = e[n]);
- return a
- }
- n = [
- n(25),
- n(26),
- n(49)
- ],
- void 0 === (n = function (r, t, n) {
- return function (a) {
- function e(e, t) {
- var n = t.router,
- t = e.wrappedComponentRef,
- e = i(e, [
- 'wrappedComponentRef'
- ]);
- return r.createElement(a, o({
- }, e, {
- history: n,
- ref: t
- }))
- }
- return e.displayName = 'withRouter('.concat(a.displayName || a.name, ')'),
- e.WrappedComponent = a,
- e.contextTypes = {
- router: n.routerShape.isRequired
- },
- e.propTypes = {
- wrappedComponentRef: t.func
- },
- e
- }
- }.apply(t, n)) || (e.exports = n)
- },
- 33: function (e, t, n) {
- 'use strict';
- function a(t, e) {
- var n,
- a = Object.keys(t);
- return Object.getOwnPropertySymbols && (n = Object.getOwnPropertySymbols(t), e && (n = n.filter(function (e) {
- return Object.getOwnPropertyDescriptor(t, e).enumerable
- })), a.push.apply(a, n)),
- a
- }
- function r(t) {
- for (var e = 1; e < arguments.length; e++) {
- var n = null != arguments[e] ? arguments[e] : {
- };
- e % 2 ? a(Object(n), !0).forEach(function (e) {
- o(t, e, n[e])
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(n)) : a(Object(n)).forEach(function (e) {
- Object.defineProperty(t, e, Object.getOwnPropertyDescriptor(n, e))
- })
- }
- return t
- }
- function o(e, t, n) {
- return t in e ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n,
- e
- }
- n = [
- t,
- n(26)
- ],
- void 0 === (n = function (e, n) {
- e.SAAS_PRODUCT_COMMENTS = 'comments',
- e.SAAS_PRODUCT_POLLS = 'polls',
- e.SAAS_PRODUCT_PLAN_CANCELLED_STATUS = 'canceled',
- e.SAAS_PRODUCT_PLAN_ACTIVE_STATUS = 'active',
- e.SAAS_PRODUCT_PLAN_TRIALING_STATUS = 'trialing',
- e.SAAS_PRODUCT_PLAN_PAST_DUE_STATUS = 'past_due',
- e.SAAS_PRODUCT_PLAN_UNPAID_STATUS = 'unpaid',
- e.SAAS_PRODUCT_PLANS = [
- e.SAAS_PRODUCT_PLAN_CANCELLED_STATUS,
- e.SAAS_PRODUCT_PLAN_ACTIVE_STATUS,
- e.SAAS_PRODUCT_PLAN_TRIALING_STATUS,
- e.SAAS_PRODUCT_PLAN_PAST_DUE_STATUS
- ],
- e.SAAS_PRODUCT_PLAN_ACTIVE_STATUSES_SET = new Set([e.SAAS_PRODUCT_PLAN_ACTIVE_STATUS,
- e.SAAS_PRODUCT_PLAN_TRIALING_STATUS,
- e.SAAS_PRODUCT_PLAN_PAST_DUE_STATUS]),
- e.DISQUS_BASIC_PACKAGE_ID = - 10,
- e.DISQUS_PLUS_PACKAGE_ID = 1,
- e.DISQUS_PLUS_FREE_PACKAGE_ID = 4,
- e.DISQUS_BUSINESS_PACKAGE_ID = 2,
- e.DISQUS_PRO_PACKAGE_ID = 3,
- e.DISQUS_PREFERRED_CUSTOMER_PACKAGE_ID = 5,
- e.DISQUS_BASIC_PLAN_ID = 'basic__plan',
- e.DISQUS_PLUS_PLAN_ID = 'plus',
- e.DISQUS_PLUS_ANNUAL_PLAN_ID = 'plus-yearly',
- e.DISQUS_PLUS_2021_PLAN_ID = 'plus-2021',
- e.DISQUS_PLUS_ANNUAL_2021_PLAN_ID = 'plus-yearly-2021',
- e.DISQUS_PLUS_100K_PLAN_ID = 'plus-100k-monthly',
- e.DISQUS_PLUS_100K_YEARLY_PLAN_ID = 'plus-100k-yearly',
- e.DISQUS_PLUS_350K_PLAN_ID = 'plus-350k-monthly',
- e.DISQUS_PLUS_350K_YEARLY_PLAN_ID = 'plus-350k-yearly',
- e.DISQUS_PLUS_900K_PLAN_ID = 'plus-900k-monthly',
- e.DISQUS_PLUS_900K_YEARLY_PLAN_ID = 'plus-900k-yearly',
- e.DISQUS_PLUS_FREE_PLAN_ID = 'non-commercial-free',
- e.DISQUS_PRO_PLAN_ID = 'pro',
- e.DISQUS_PRO_ANNUAL_PLAN_ID = 'pro-yearly',
- e.DISQUS_PRO_2021_PLAN_ID = 'pro-2021',
- e.DISQUS_PRO_ANNUAL_2021_PLAN_ID = 'pro-yearly-2021',
- e.DISQUS_PRO_1M_PLAN_ID = 'pro-1m-monthly',
- e.DISQUS_PRO_1M_YEARLY_PLAN_ID = 'pro-1m-yearly',
- e.DISQUS_PRO_2_5M_PLAN_ID = 'pro-2_5m-monthly',
- e.DISQUS_PRO_2_5M_YEARLY_PLAN_ID = 'pro-2_5m-yearly',
- e.DISQUS_PRO_5M_PLAN_ID = 'pro-5m-monthly',
- e.DISQUS_PRO_5M_YEARLY_PLAN_ID = 'pro-5m-yearly',
- e.DISQUS_BUSINESS_PLAN_ID = 'business',
- e.DISQUS_POLLS_PRO_PACKAGE_ID = 6,
- e.DISQUS_POLLS_BUSINESS_PACKAGE_ID = 7,
- e.DISQUS_POLLS_AD_SUPPORTED_PACKAGE_ID = 8,
- e.DISQUS_POLLS_AD_SUPPORTED_PLAN_ID = 'polls-ad-supported',
- e.DISQUS_POLLS_PRO_250K_PLAN_ID = 'polls-pro-250k-monthly',
- e.DISQUS_POLLS_PRO_ANNUAL_250K_PLAN_ID = 'polls-pro-250k-yearly',
- e.DISQUS_POLLS_PRO_1_5M_PLAN_ID = 'polls-pro-1_5m-monthly',
- e.DISQUS_POLLS_PRO_1_5M_YEARLY_PLAN_ID = 'polls-pro-1_5m-yearly',
- e.DISQUS_POLLS_PRO_3M_PLAN_ID = 'polls-pro-3m-monthly',
- e.DISQUS_POLLS_PRO_3M_YEARLY_PLAN_ID = 'polls-pro-3m-yearly',
- e.DISQUS_POLLS_PRO_10M_PLAN_ID = 'polls-pro-10m-monthly',
- e.DISQUS_POLLS_PRO_10M_YEARLY_PLAN_ID = 'polls-pro-10m-yearly',
- e.DISQUS_POLLS_BUSINESS_PLAN_ID = 'polls-business',
- e.PAYMENT_INTERVAL = {
- month: 'monthly',
- year: 'annual'
- },
- e.OLD_PLAN_IDS = [
- e.DISQUS_PLUS_PLAN_ID,
- e.DISQUS_PLUS_ANNUAL_PLAN_ID,
- e.DISQUS_PRO_PLAN_ID,
- e.DISQUS_PRO_ANNUAL_PLAN_ID
- ],
- e.PLUS_MONTHLY_SLIDER_PLAN_IDS = [
- e.DISQUS_PLUS_100K_PLAN_ID,
- e.DISQUS_PLUS_350K_PLAN_ID,
- e.DISQUS_PLUS_900K_PLAN_ID
- ],
- e.PLUS_YEARLY_SLIDER_PLAN_IDS = [
- e.DISQUS_PLUS_100K_YEARLY_PLAN_ID,
- e.DISQUS_PLUS_350K_YEARLY_PLAN_ID,
- e.DISQUS_PLUS_900K_YEARLY_PLAN_ID
- ],
- e.PRO_MONTHLY_SLIDER_PLAN_IDS = [
- e.DISQUS_PRO_1M_PLAN_ID,
- e.DISQUS_PRO_2_5M_PLAN_ID,
- e.DISQUS_PRO_5M_PLAN_ID
- ],
- e.PRO_YEARLY_SLIDER_PLAN_IDS = [
- e.DISQUS_PRO_1M_YEARLY_PLAN_ID,
- e.DISQUS_PRO_2_5M_YEARLY_PLAN_ID,
- e.DISQUS_PRO_5M_YEARLY_PLAN_ID
- ],
- e.POLLS_PRO_MONTHLY_SLIDER_PLAN_IDS = [
- e.DISQUS_POLLS_PRO_250K_PLAN_ID,
- e.DISQUS_POLLS_PRO_1_5M_PLAN_ID,
- e.DISQUS_POLLS_PRO_3M_PLAN_ID,
- e.DISQUS_POLLS_PRO_10M_PLAN_ID
- ],
- e.POLLS_PRO_YEARLY_SLIDER_PLAN_IDS = [
- e.DISQUS_POLLS_PRO_ANNUAL_250K_PLAN_ID,
- e.DISQUS_POLLS_PRO_1_5M_YEARLY_PLAN_ID,
- e.DISQUS_POLLS_PRO_3M_YEARLY_PLAN_ID,
- e.DISQUS_POLLS_PRO_10M_YEARLY_PLAN_ID
- ],
- e.ADS_OPTIONAL_FEATURE_ID = 1,
- e.AD_SUPPORTED_FEATURE_ID = - 19,
- e.SERVER_FEATURES = {
- ADS_OPTIONAL: {
- id: 1,
- name: 'Ads Optional'
- },
- SHADOW_BANNING: {
- id: 2,
- name: 'Shadow Banning'
- },
- ADVANCED_ANALYTICS: {
- id: 3,
- name: 'Advanced Analytics'
- },
- PRIORITY_SUPPORT: {
- id: 4,
- name: 'Priority Support'
- },
- BRANDING_OPTIONAL: {
- id: 5,
- name: 'Branding Optional'
- },
- SSO: {
- id: 6,
- name: 'Single Sign-On'
- },
- PARTNER_KEY: {
- id: 8,
- name: 'Unlimited API Access'
- },
- TEMPORARY_BANNING: {
- id: 10,
- name: 'Timeouts'
- },
- DIRECT_SUPPORT: {
- id: 11,
- name: 'Direct Support'
- },
- AUDIENCE_EMAIL_TRANSFER: {
- id: 12,
- name: 'Email Subscriptions'
- },
- ALL_MOD_RULES: {
- id: 13,
- name: 'All Moderation Rules'
- },
- THREAD_RATINGS: {
- id: 14,
- name: 'Star Ratings'
- },
- CUSTOM_REACTIONS: {
- id: 15,
- name: 'Custom Reactions'
- },
- EMBED_CUSTOMIZATIONS: {
- id: 16,
- name: 'Embed Customizations'
- },
- BADGES: {
- id: 19,
- name: 'Commenter Badges'
- }
- },
- e.DISPLAY_FEATURES = {
- EVERYTHING_BASIC: {
- id: - 1,
- name: 'Everything in Basic',
- isBold: !0
- },
- EVERYTHING_PLUS: {
- id: - 2,
- name: 'Everything in Plus',
- isBold: !0
- },
- DIRECT_ACCOUNT_MANAGER: {
- id: - 3,
- name: 'Direct Account Manager'
- },
- COMMENTS_PLUG_IN: {
- id: - 4,
- name: 'Comments Plug-in'
- },
- ADVANCED_SPAM_FILTERS: {
- id: - 5,
- name: 'Advanced Spam Filters'
- },
- MODERATION_TOOLS: {
- id: - 6,
- name: 'Moderation Tools'
- },
- BASIC_ANALYTICS: {
- id: - 7,
- name: 'Basic Analytics'
- },
- CONFIGURABLE_ADS: {
- id: - 8,
- name: 'Configurable Ads'
- },
- REACTIONS: {
- id: - 9,
- name: 'Reactions'
- },
- EVERYTHING_PRO: {
- id: - 10,
- name: 'Everything in Pro',
- isBold: !0
- },
- LIGHTBOXES_PROMPTS: {
- id: - 11,
- name: 'Targeted Lightboxes and Sign-up Prompts'
- },
- AI_RECOMMENDATIONS: {
- id: - 12,
- name: 'AI-powered Content Recommendations'
- },
- EMAIL_PERSONALIZATION: {
- id: - 13,
- name: 'Branded Email Notifications'
- },
- DISQUS_CORE_FEATURES: {
- id: - 14,
- name: 'Disqus Core Features'
- },
- FORUM_LIMIT_PLUS: {
- id: - 15,
- name: 'Supports up to 3 Websites'
- },
- FORUM_LIMIT_PRO: {
- id: - 16,
- name: 'Supports up to 20 Websites'
- },
- FORUM_LIMIT_BUSINESS: {
- id: - 17,
- name: 'Supports Unlimited Websites'
- },
- ADVANCED_MODERATION: {
- id: - 18,
- name: 'Advanced Moderation Tools'
- },
- AD_SUPPORTED: {
- id: - 19,
- name: 'Ad Supported'
- },
- CUSTOM_FONTS: {
- id: - 20,
- name: 'Custom Fonts'
- },
- CUSTOM_BRANDING: {
- id: - 27,
- name: 'Custom Branding & Optimizations'
- },
- DIRECT_EMAIL_SUPPORT: {
- id: - 28,
- name: 'Direct Email Support'
- }
- },
- e.RENDER_FEATURE_TEXT = {
- 1: 'Ad-Free',
- 2: 'Shadow Banning',
- 3: 'Advanced Analytics',
- 4: 'Priority Support',
- 5: 'Whitelabeling',
- 6: 'SSO Integration',
- 8: 'Unlimited API Access',
- 10: 'Timeouts',
- 11: 'Direct Support',
- 12: 'Email Subscriptions',
- 13: 'All Moderation Rules',
- 14: 'Star Ratings',
- 15: 'Custom Reactions',
- 19: 'Commenter Badges',
- '-1': 'Everything in Basic',
- '-2': 'Everything in Plus',
- '-3': 'Direct Account Manager',
- '-4': 'Comments Plug-in',
- '-5': 'Advanced Spam Filters',
- '-6': 'Moderation Tools',
- '-7': 'Basic Analytics',
- '-8': 'Configurable Ads',
- '-9': 'Reactions',
- '-10': 'Everything in Pro',
- '-11': 'Targeted Lightboxes',
- '-12': 'AI-powered Content Recommendations',
- '-13': 'Branded Email Notifications',
- '-14': 'Disqus Core Features',
- '-15': 'Supports up to 3 Websites',
- '-16': 'Supports up to 20 Websites',
- '-17': 'Supports Unlimited Websites',
- '-18': 'Advanced Moderation Tools',
- '-19': 'Ad-Supported',
- '-20': 'Custom Fonts',
- '-21': 'Disqus Comment Platform',
- '-22': 'Core Engagement Features',
- '-23': 'Easy Installation',
- '-24': 'Basic Reporting and Analytics',
- '-25': 'Simple Moderation Tools',
- '-26': 'Cross-site and Email Notifications',
- '-27': 'Custom Branding & Optimizations',
- '-28': 'Direct Email Support',
- '-29': 'Essential Moderation Tools',
- '-30': '3 Moderator Seats',
- '-31': 'AI Moderation Features',
- '-32': 'Customizable Engagement Tools',
- '-33': 'Unlimited Moderator Seats',
- '-34': 'Free',
- '-35': 'Customizable question formats',
- '-36': 'Flexible poll placements',
- '-37': 'Real-time Results & Analytics',
- '-38': 'Custom Integrations',
- '-39': 'Dedicated Account Management',
- '-40': 'Remove Disqus Branding'
- },
- e.BASIC_PLAN = {
- id: e.DISQUS_BASIC_PLAN_ID,
- description: null,
- interval: null,
- amount: 0,
- trialLengthDays: null,
- isEligible: !0,
- productName: e.SAAS_PRODUCT_COMMENTS
- },
- e.BASIC_PACKAGE = {
- id: e.DISQUS_BASIC_PACKAGE_ID,
- name: 'Ad-Supported',
- color: '#494E58',
- pageViewRange: {
- min: 0,
- max: null
- },
- features: [
- e.DISPLAY_FEATURES.COMMENTS_PLUG_IN,
- e.DISPLAY_FEATURES.ADVANCED_SPAM_FILTERS,
- e.DISPLAY_FEATURES.MODERATION_TOOLS,
- e.DISPLAY_FEATURES.BASIC_ANALYTICS,
- e.DISPLAY_FEATURES.CONFIGURABLE_ADS,
- e.DISPLAY_FEATURES.REACTIONS
- ],
- plans: [
- e.BASIC_PLAN
- ],
- productName: e.SAAS_PRODUCT_COMMENTS
- },
- e.BASIC_SUBSCRIPTION = {
- amount: '0.00',
- amountRemaining: '0.00',
- currentPeriodEnd: null,
- currentPeriodStart: null,
- status: e.SAAS_PRODUCT_PLAN_ACTIVE_STATUS,
- trialEnd: null,
- trialStart: null
- },
- e.POLLS_BUSINESS_PLAN = {
- id: e.DISQUS_POLLS_BUSINESS_PLAN_ID,
- description: null,
- interval: null,
- amount: 0,
- trialLengthDays: null,
- isEligible: !0,
- productName: e.SAAS_PRODUCT_POLLS
- },
- e.POLLS_AD_SUPPORTED_PLAN = {
- id: e.DISQUS_POLLS_AD_SUPPORTED_PLAN_ID,
- description: null,
- interval: null,
- amount: 0,
- trialLengthDays: null,
- isEligible: !0,
- productName: e.SAAS_PRODUCT_POLLS
- },
- e.COUPON_SHAPE = n.shape({
- amountOff: n.number,
- percentOff: n.number,
- duration: n.string.isRequired,
- durationInMonths: n.number,
- stripeId: n.string.isRequired
- }),
- e.PLAN_SHAPE = n.shape({
- id: n.string.isRequired,
- description: n.node,
- amount: n.number,
- hasTrialAvailable: n.bool,
- isSubscribed: n.bool,
- interval: n.oneOf(['month',
- 'year']),
- trialLengthDays: n.number,
- isEligible: n.bool,
- productName: n.oneOf([e.SAAS_PRODUCT_COMMENTS,
- e.SAAS_PRODUCT_POLLS])
- }),
- e.FEATURE_SHAPE = n.shape({
- id: n.number.isRequired,
- name: n.string.isRequired,
- isCustom: n.bool,
- isBold: n.bool
- }),
- e.PACKAGE_SHAPE = n.shape({
- id: n.number.isRequired,
- name: n.string.isRequired,
- color: n.string.isRequired,
- isSubscribed: n.bool.isRequired,
- plans: n.arrayOf(e.PLAN_SHAPE).isRequired,
- pageViewRange: n.shape({
- min: n.number,
- max: n.number
- }).isRequired,
- features: n.arrayOf(e.FEATURE_SHAPE).isRequired
- }),
- e.TRIAL_SHAPE = n.shape({
- startDate: n.string,
- endDate: n.string,
- isActive: n.bool.isRequired
- }),
- e.CURRENT_SUBSCRIPTION_SHAPE = n.shape({
- amount: n.string,
- amountRemaining: n.string,
- currentPeriodEnd: n.string,
- currentPeriodStart: n.string,
- status: n.oneOf([e.SAAS_PRODUCT_PLAN_TRIALING_STATUS,
- e.SAAS_PRODUCT_PLAN_ACTIVE_STATUS,
- e.SAAS_PRODUCT_PLAN_PAST_DUE_STATUS,
- e.SAAS_PRODUCT_PLAN_CANCELLED_STATUS,
- e.SAAS_PRODUCT_PLAN_UNPAID_STATUS]).isRequired,
- trialEnd: n.string,
- trialStart: n.string
- }),
- e.INVOICE_FIELDS = [
- 'companyName',
- 'taxId',
- 'street',
- 'city',
- 'state',
- 'country',
- 'zipCode'
- ],
- e.INVOICE_SHAPE = e.INVOICE_FIELDS.reduce(function (e, t) {
- return r(r({
- }, e), {
- }, o({
- }, t, n.string))
- }, {
- }),
- e.ORG_BILLING_SHAPE = n.shape({
- currentSubscription: e.CURRENT_SUBSCRIPTION_SHAPE,
- invoiceHistory: n.arrayOf(n.shape({
- date: n.string.isRequired,
- total: n.string.isRequired,
- paid: n.bool.isRequired
- })).isRequired,
- paymentInfo: n.shape({
- last4: n.string.isRequired,
- expMonth: n.number.isRequired,
- expYear: n.number.isRequired,
- brand: n.string
- }),
- invoiceInfo: n.shape(e.INVOICE_SHAPE)
- }),
- e.CHECKOUT_SUCCESS_QUERY_PARAM = 'checkout',
- e.CHECKOUT_SUCCESS_QUERY_PARAM_VALUE_COMMENTS = '1',
- e.CHECKOUT_SUCCESS_QUERY_PARAM_VALUE_POLLS = '2'
- }.apply(t, n)) || (e.exports = n)
- },
- 34: function (e, t, n) {
- var n = [
- n(7),
- n(8),
- n(2),
- n(39),
- n(42)
- ],
- n = function (r, n, o, a, i) {
- 'use strict';
- var s = {
- },
- l = {
- _getKey: function (e) {
- return 'switch:' + e
- },
- disableFeature: function (e) {
- s[e] = !1
- },
- resetFeature: function (e) {
- s[e] = null
- },
- forceFeature: function (e) {
- s[e] = !0
- },
- getSwitchContext: function (e) {
- var t = a.get(this._getKey(e));
- if (null !== t) return t;
- t = s[e];
- return null != t ? t : (n.lounge && n.lounge.switches || {
- }) [e]
- },
- isFeatureActive: function (e, t) {
- var n = l.getSwitchContext(e);
- if (r.isBoolean(n)) return n;
- if (!n) return !1;
- var e = i.getFromCookie(),
- e = {
- percent: o.clientPercent(),
- user_id: e.id,
- username: e.username,
- is_staff: e.staff,
- is_moderator: e.isModerator
- },
- a = r.defaults(t || {
- }, e);
- return r.any(n, function (e, t) {
- var n = a[t];
- if (/percent$/.test(t) && r.isNumber(e)) {
- if (r.isNumber(n)) return n < e;
- if (r.isString(n)) {
- t = 0;
- return e !== Math.round(e) && (t = ('' + e).split('.').pop().length),
- e > o.getPercentBucketForString(n, t)
- }
- return !1
- }
- return r.isArray(e) ? r.contains(e, n) : e === n
- })
- }
- };
- return l
- }.apply(t, n);
- void 0 === n || (e.exports = n)
- },
- 35: function (e, t, n) {
- 'use strict';
- var a,
- r,
- o,
- i,
- s;
- a = /(^|\.)disqus\.com$/.test(window.location.host) ? 'disqus.com' : 'dev.disqus.org:8000',
- o = (r = 'disqus.com' == a ? 'https://' : 'http://') + a,
- i = window.location.host.split(a) [0].replace('.', ''),
- s = r + window.location.host,
- o = {
- urls: {
- api: ''.concat(r).concat(a, '/api/3.0/'),
- createSite: ''.concat(o, '/admin/create/'),
- cdnCurrent: 'https://c.disquscdn.com/next/current/embed/'
- },
- disqusHost: a,
- currentForum: i,
- keys: {
- api: 'Y1S1wGIzdc63qnZ5rhHfjqEABGA4ZTDncauWFFWWTUBqkmLjdxloTb7ilhGnZ7z1',
- stripe: 'pk_live_XiH6fxBBLXCOH7KF6K7fDlGf',
- segmentIO: 'WskYYFRdZvvOmLhuFN9r7ZygELBNKkvH'
- },
- debug: !1,
- disqusUrl: o,
- resync_forum_url: ''.concat(s, '/admin/discussions/import/platform/blogger/resync/'),
- bloggerSyncOauthUrl: ''.concat(o, '/_ax/blogger/begin'),
- intercomAppId: 'x2byp8hg',
- feedApiVersion: '12'
- },
- e.exports = o
- },
- 37: function (Ht, e) {
- !function (f, O) {
- function t(e, t) {
- return t.toUpperCase()
- }
- function a(e) {
- !g.addEventListener && 'load' !== e.type && 'complete' !== g.readyState || (x(), de.ready())
- }
- var r,
- h = typeof O,
- g = f.document,
- e = f.location,
- n = f.jQuery,
- o = f.$,
- i = {
- },
- p = [
- ],
- y = p.concat,
- s = p.push,
- u = p.slice,
- l = p.indexOf,
- c = i.toString,
- b = i.hasOwnProperty,
- d = '1.9.1'.trim,
- de = function (e, t) {
- return new de.fn.init(e, t, D)
- },
- m = '[+-]?(?:\\d*\\.|)\\d+(?:[eE][+-]?\\d+|)',
- S = /\S+/g,
- v = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,
- _ = /^(?:(<[\w\W]+>)[^>]*|#([\w-]*))$/,
- E = /^<(\w+)\s*\/?>(?:<\/\1>|)$/,
- w = /^[\],:{}\s]*$/,
- P = /(?:^|:|,)(?:\s*\[)+/g,
- k = /\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,
- N = /"[^"\\\r\n]*"|true|false|null|-?(?:\d+\.|)\d+(?:[eE][+-]?\d+|)/g,
- C = /^-ms-/,
- R = /-([\da-z])/gi,
- x = function () {
- g.addEventListener ? (g.removeEventListener('DOMContentLoaded', a, !1), f.removeEventListener('load', a, !1)) : (g.detachEvent('onreadystatechange', a), f.detachEvent('onload', a))
- };
- function A(e) {
- var t = e.length,
- n = de.type(e);
- return !de.isWindow(e) && (!(1 !== e.nodeType || !t) || ('array' === n || 'function' !== n && (0 === t || 'number' == typeof t && 0 < t && t - 1 in e)))
- }
- de.fn = de.prototype = {
- jquery: '1.9.1',
- constructor: de,
- init: function (e, t, n) {
- var a,
- r;
- if (!e) return this;
- if ('string' != typeof e) return e.nodeType ? (this.context = this[0] = e, this.length = 1, this) : de.isFunction(e) ? n.ready(e) : (e.selector !== O && (this.selector = e.selector, this.context = e.context), de.makeArray(e, this));
- if (!(a = '<' == (e[0] || '') && '>' == (e[0 | e.length - 1] || '') && 3 <= e.length ? [
- null,
- e,
- null
- ] : _.exec(e)) || !a[1] && t) return (!t || t.jquery ? t || n : this.constructor(t)).find(e);
- if (a[1]) {
- if (de.merge(this, de.parseHTML(a[1], (t = t instanceof de ? t[0] : t) && t.nodeType ? t.ownerDocument || t : g, !0)), E.test(a[1]) && de.isPlainObject(t)) for (a in t) de.isFunction(this[a]) ? this[a](t[a]) : this.attr(a, t[a]);
- return this
- }
- if ((r = g.getElementById(a[2])) && r.parentNode) {
- if (r.id !== a[2]) return n.find(e);
- this.length = 1,
- this[0] = r
- }
- return this.context = g,
- this.selector = e,
- this
- },
- selector: '',
- length: 0,
- size: function () {
- return this.length
- },
- toArray: function () {
- return u.call(this)
- },
- get: function (e) {
- return null == e ? this.toArray() : e < 0 ? this[this.length + e] : this[e]
- },
- pushStack: function (e) {
- e = de.merge(this.constructor(), e);
- return e.prevObject = this,
- e.context = this.context,
- e
- },
- each: function (e, t) {
- return de.each(this, e, t)
- },
- ready: function (e) {
- return de.ready.promise().done(e),
- this
- },
- slice: function () {
- return this.pushStack(u.apply(this, arguments))
- },
- first: function () {
- return this.eq(0)
- },
- last: function () {
- return this.eq( - 1)
- },
- eq: function (e) {
- var t = this.length,
- e = + e + (e < 0 ? t : 0);
- return this.pushStack(0 <= e && e < t ? [
- this[e]
- ] : [
- ])
- },
- map: function (n) {
- return this.pushStack(de.map(this, function (e, t) {
- return n.call(e, t, e)
- }))
- },
- end: function () {
- return this.prevObject || this.constructor(null)
- },
- push: s,
- sort: [
- ].sort,
- splice: [
- ].splice
- },
- de.fn.init.prototype = de.fn,
- de.extend = de.fn.extend = function () {
- var e,
- t,
- n,
- a,
- r,
- o = arguments[0] || {
- },
- i = 1,
- s = arguments.length,
- l = !1;
- for ('boolean' == typeof o && (l = o, o = arguments[1] || {
- }, i = 2), 'object' == typeof o || de.isFunction(o) || (o = {
- }), s === i && (o = this, --i); i < s; i++) if (null != (a = arguments[i])) for (n in a) r = o[n],
- o !== (t = a[n]) && (l && t && (de.isPlainObject(t) || (e = de.isArray(t))) ? (r = e ? (e = !1, r && de.isArray(r) ? r : [
- ]) : r && de.isPlainObject(r) ? r : {
- }, o[n] = de.extend(l, r, t)) : t !== O && (o[n] = t));
- return o
- },
- de.extend({
- noConflict: function (e) {
- return f.$ === de && (f.$ = o),
- e && f.jQuery === de && (f.jQuery = n),
- de
- },
- isReady: !1,
- readyWait: 1,
- holdReady: function (e) {
- e ? de.readyWait++ : de.ready(!0)
- },
- ready: function (e) {
- if (!0 === e ? !--de.readyWait : !de.isReady) {
- if (!g.body) return setTimeout(de.ready);
- (de.isReady = !0) !== e && 0 < --de.readyWait || (r.resolveWith(g, [
- de
- ]), de.fn.trigger && de(g).trigger('ready').off('ready'))
- }
- },
- isFunction: function (e) {
- return 'function' === de.type(e)
- },
- isArray: Array.isArray || function (e) {
- return 'array' === de.type(e)
- },
- isWindow: function (e) {
- return null != e && e == e.window
- },
- isNumeric: function (e) {
- return !isNaN(parseFloat(e)) && isFinite(e)
- },
- type: function (e) {
- return null == e ? '' + e : 'object' == typeof e || 'function' == typeof e ? i[c.call(e)] || 'object' : typeof e
- },
- isPlainObject: function (e) {
- if (!e || 'object' !== de.type(e) || e.nodeType || de.isWindow(e)) return !1;
- try {
- if (e.constructor && !b.call(e, 'constructor') && !b.call(e.constructor.prototype, 'isPrototypeOf')) return !1
- } catch (e) {
- return !1
- }
- for (var t in e);
- return t === O || b.call(e, t)
- },
- isEmptyObject: function (e) {
- for (var t in e) return !1;
- return !0
- },
- error: function (e) {
- throw Error(e)
- },
- parseHTML: function (e, t, n) {
- if (!e || 'string' != typeof e) return null;
- 'boolean' == typeof t && (n = t, t = !1),
- t = t || g;
- var a = E.exec(e),
- n = !n && [
- ];
- return a ? [
- t.createElement(a[1])
- ] : (a = de.buildFragment([e], t, n), n && de(n).remove(), de.merge([], a.childNodes))
- },
- parseJSON: function (e) {
- return f.JSON && f.JSON.parse ? f.JSON.parse(e) : null === e ? e : 'string' == typeof e && (e = de.trim(e)) && w.test(e.replace(k, '@').replace(N, ']').replace(P, '')) ? Function('return ' + e) () : void de.error('Invalid JSON: ' + e)
- },
- parseXML: function (e) {
- var t;
- if (!e || 'string' != typeof e) return null;
- try {
- f.DOMParser ? t = (new DOMParser).parseFromString(e, 'text/xml') : ((t = new ActiveXObject('Microsoft.XMLDOM')).async = 'false', t.loadXML(e))
- } catch (e) {
- t = O
- }
- return t && t.documentElement && !t.getElementsByTagName('parsererror').length || de.error('Invalid XML: ' + e),
- t
- },
- noop: function () {
- },
- globalEval: function (e) {
- e && de.trim(e) && (f.execScript || function (e) {
- f.eval.call(f, e)
- }) (e)
- },
- camelCase: function (e) {
- return e.replace(C, 'ms-').replace(R, t)
- },
- nodeName: function (e, t) {
- return e.nodeName && e.nodeName.toLowerCase() == t.toLowerCase()
- },
- each: function (e, t, n) {
- var a = 0,
- r = e.length,
- o = A(e);
- if (n) {
- if (o) for (; a < r && !1 !== t.apply(e[a], n); a++);
- else for (a in e) if (!1 === t.apply(e[a], n)) break
- } else if (o) for (; a < r && !1 !== t.call(e[a], a, e[a]); a++);
- else for (a in e) if (!1 === t.call(e[a], a, e[a])) break;
- return e
- },
- trim: d && !d.call(' ') ? function (e) {
- return null == e ? '' : d.call(e)
- }
- : function (e) {
- return null == e ? '' : (e + '').replace(v, '')
- },
- makeArray: function (e, t) {
- t = t || [
- ];
- return null != e && (A(Object(e)) ? de.merge(t, 'string' == typeof e ? [
- e
- ] : e) : s.call(t, e)),
- t
- },
- inArray: function (e, t, n) {
- var a;
- if (t) {
- if (l) return l.call(t, e, n);
- for (a = t.length, n = n ? n < 0 ? Math.max(0, a + n) : n : 0; n < a; n++) if (n in t && t[n] === e) return n
- }
- return - 1
- },
- merge: function (e, t) {
- var n = t.length,
- a = e.length,
- r = 0;
- if ('number' == typeof n) for (; r < n; r++) e[a++] = t[r];
- else for (; t[r] !== O; ) e[a++] = t[r++];
- return e.length = a,
- e
- },
- grep: function (e, t, n) {
- var a = [
- ],
- r = 0,
- o = e.length;
- for (n = !!n; r < o; r++) n !== !!t(e[r], r) && a.push(e[r]);
- return a
- },
- map: function (e, t, n) {
- var a,
- r = 0,
- o = e.length,
- i = [
- ];
- if (A(e)) for (; r < o; r++) null != (a = t(e[r], r, n)) && (i[i.length] = a);
- else for (r in e) null != (a = t(e[r], r, n)) && (i[i.length] = a);
- return y.apply([], i)
- },
- guid: 1,
- proxy: function (e, t) {
- var n,
- a;
- return 'string' == typeof t && (a = e[t], t = e, e = a),
- de.isFunction(e) ? (n = u.call(arguments, 2), (a = function () {
- return e.apply(t || this, n.concat(u.call(arguments)))
- }).guid = e.guid = e.guid || de.guid++, a) : O
- },
- access: function (e, t, n, a, r, o, i) {
- var s = 0,
- l = e.length,
- c = null == n;
- if ('object' === de.type(n)) for (s in r = !0, n) de.access(e, t, s, n[s], !0, o, i);
- else if (a !== O && (r = !0, de.isFunction(a) || (i = !0), t = c ? i ? (t.call(e, a), null) : (c = t, function (e, t, n) {
- return c.call(de(e), n)
- }) : t)) for (; s < l; s++) t(e[s], n, i ? a : a.call(e[s], s, t(e[s], n)));
- return r ? e : c ? t.call(e) : l ? t(e[0], n) : o
- },
- now: function () {
- return (new Date).getTime()
- }
- }),
- de.ready.promise = function (e) {
- if (!r) if (r = de.Deferred(), 'complete' === g.readyState) setTimeout(de.ready);
- else if (g.addEventListener) g.addEventListener('DOMContentLoaded', a, !1),
- f.addEventListener('load', a, !1);
- else {
- g.attachEvent('onreadystatechange', a),
- f.attachEvent('onload', a);
- var n = !1;
- try {
- n = null == f.frameElement && g.documentElement
- } catch (e) {
- }
- n && n.doScroll && !function t() {
- if (!de.isReady) {
- try {
- n.doScroll('left')
- } catch (e) {
- return setTimeout(t, 50)
- }
- x(),
- de.ready()
- }
- }()
- }
- return r.promise(e)
- },
- de.each('Boolean Number String Function Array Date RegExp Object Error'.split(' '), function (e, t) {
- i['[object ' + t + ']'] = t.toLowerCase()
- });
- var D = de(g),
- j = {
- };
- de.Callbacks = function (r) {
- var e,
- n;
- r = 'string' == typeof r ? j[r] || (n = j[e = r] = {
- }, de.each(e.match(S) || [
- ], function (e, t) {
- n[t] = !0
- }), n) : de.extend({
- }, r);
- var a,
- t,
- o,
- i,
- s,
- l,
- c = [
- ],
- u = !r.once && [
- ],
- p = function (e) {
- for (t = r.memory && e, o = !0, s = l || 0, i = c.length, a = !(l = 0); c && s < i; s++) if (!1 === c[s].apply(e[0], e[1]) && r.stopOnFalse) {
- t = !1;
- break
- }
- a = !1,
- c && (u ? u.length && p(u.shift()) : t ? c = [
- ] : d.disable())
- },
- d = {
- add: function () {
- var e;
- return c && (e = c.length, function a(e) {
- de.each(e, function (e, t) {
- var n = de.type(t);
- 'function' === n ? r.unique && d.has(t) || c.push(t) : t && t.length && 'string' !== n && a(t)
- })
- }(arguments), a ? i = c.length : t && (l = e, p(t))),
- this
- },
- remove: function () {
- return c && de.each(arguments, function (e, t) {
- for (var n; - 1 < (n = de.inArray(t, c, n)); ) c.splice(n, 1),
- a && (n <= i && i--, n <= s && s--)
- }),
- this
- },
- has: function (e) {
- return e ? - 1 < de.inArray(e, c) : !(!c || !c.length)
- },
- empty: function () {
- return c = [
- ],
- this
- },
- disable: function () {
- return c = u = t = O,
- this
- },
- disabled: function () {
- return !c
- },
- lock: function () {
- return u = O,
- t || d.disable(),
- this
- },
- locked: function () {
- return !u
- },
- fireWith: function (e, t) {
- return t = [
- e,
- (t = t || [
- ]).slice ? t.slice() : t
- ],
- !c || o && !u || (a ? u.push(t) : p(t)),
- this
- },
- fire: function () {
- return d.fireWith(this, arguments),
- this
- },
- fired: function () {
- return !!o
- }
- };
- return d
- },
- de.extend({
- Deferred: function (e) {
- var i = [
- ['resolve',
- 'done',
- de.Callbacks('once memory'),
- 'resolved'],
- [
- 'reject',
- 'fail',
- de.Callbacks('once memory'),
- 'rejected'
- ],
- [
- 'notify',
- 'progress',
- de.Callbacks('memory')
- ]
- ],
- r = 'pending',
- s = {
- state: function () {
- return r
- },
- always: function () {
- return l.done(arguments).fail(arguments),
- this
- },
- then: function () {
- var o = arguments;
- return de.Deferred(function (r) {
- de.each(i, function (e, t) {
- var n = t[0],
- a = de.isFunction(o[e]) && o[e];
- l[t[1]](function () {
- var e = a && a.apply(this, arguments);
- e && de.isFunction(e.promise) ? e.promise().done(r.resolve).fail(r.reject).progress(r.notify) : r[n + 'With'](this === s ? r.promise() : this, a ? [
- e
- ] : arguments)
- })
- }),
- o = null
- }).promise()
- },
- promise: function (e) {
- return null != e ? de.extend(e, s) : s
- }
- },
- l = {
- };
- return s.pipe = s.then,
- de.each(i, function (e, t) {
- var n = t[2],
- a = t[3];
- s[t[1]] = n.add,
- a && n.add(function () {
- r = a
- }, i[1 ^ e][2].disable, i[2][2].lock),
- l[t[0]] = function () {
- return l[t[0] + 'With'](this === l ? s : this, arguments),
- this
- },
- l[t[0] + 'With'] = n.fireWith
- }),
- s.promise(l),
- e && e.call(l, l),
- l
- },
- when: function (e) {
- function t(t, n, a) {
- return function (e) {
- n[t] = this,
- a[t] = 1 < arguments.length ? u.call(arguments) : e,
- a === r ? c.notifyWith(n, a) : --l || c.resolveWith(n, a)
- }
- }
- var r,
- n,
- a,
- o = 0,
- i = u.call(arguments),
- s = i.length,
- l = 1 !== s || e && de.isFunction(e.promise) ? s : 0,
- c = 1 === l ? e : de.Deferred();
- if (1 < s) for (r = Array(s), n = Array(s), a = Array(s); o < s; o++) i[o] && de.isFunction(i[o].promise) ? i[o].promise().done(t(o, a, i)).fail(c.reject).progress(t(o, n, r)) : --l;
- return l || c.resolveWith(a, i),
- c.promise()
- }
- }),
- de.support = function () {
- var o,
- e,
- t,
- n,
- a,
- r,
- i,
- s,
- l,
- c,
- u = g.createElement('div');
- if (u.setAttribute('className', 't'), u.innerHTML = ' <link/><table></table><a href=\'/a\'>a</a><input type=\'checkbox\'/>', e = u.getElementsByTagName('*'), t = u.getElementsByTagName('a') [0], !e || !t || !e.length) return {
- };
- i = (a = g.createElement('select')).appendChild(g.createElement('option')),
- n = u.getElementsByTagName('input') [0],
- t.style.cssText = 'top:1px;float:left;opacity:.5',
- o = {
- getSetAttribute: 't' !== u.className,
- leadingWhitespace: 3 === u.firstChild.nodeType,
- tbody: !u.getElementsByTagName('tbody').length,
- htmlSerialize: !!u.getElementsByTagName('link').length,
- style: /top/.test(t.getAttribute('style')),
- hrefNormalized: '/a' === t.getAttribute('href'),
- opacity: /^0.5/.test(t.style.opacity),
- cssFloat: !!t.style.cssFloat,
- checkOn: !!n.value,
- optSelected: i.selected,
- enctype: !!g.createElement('form').enctype,
- html5Clone: '<:nav></:nav>' !== g.createElement('nav').cloneNode(!0).outerHTML,
- boxModel: 'CSS1Compat' === g.compatMode,
- deleteExpando: !0,
- noCloneEvent: !0,
- inlineBlockNeedsLayout: !1,
- shrinkWrapBlocks: !1,
- reliableMarginRight: !0,
- boxSizingReliable: !0,
- pixelPosition: !1
- },
- n.checked = !0,
- o.noCloneChecked = n.cloneNode(!0).checked,
- a.disabled = !0,
- o.optDisabled = !i.disabled;
- try {
- delete u.test
- } catch (e) {
- o.deleteExpando = !1
- }
- for (c in (n = g.createElement('input')).setAttribute('value', ''), o.input = '' === n.getAttribute('value'), n.value = 't', n.setAttribute('type', 'radio'), o.radioValue = 't' === n.value, n.setAttribute('checked', 't'), n.setAttribute('name', 't'), (r = g.createDocumentFragment()).appendChild(n), o.appendChecked = n.checked, o.checkClone = r.cloneNode(!0).cloneNode(!0).lastChild.checked, u.attachEvent && (u.attachEvent('onclick', function () {
- o.noCloneEvent = !1
- }), u.cloneNode(!0).click()), {
- submit: !0,
- change: !0,
- focusin: !0
- }) u.setAttribute(s = 'on' + c, 't'),
- o[c + 'Bubbles'] = s in f || !1 === u.attributes[s].expando;
- return u.style.backgroundClip = 'content-box',
- u.cloneNode(!0).style.backgroundClip = '',
- o.clearCloneStyle = 'content-box' === u.style.backgroundClip,
- de(function () {
- var e,
- t,
- n,
- a = 'padding:0;margin:0;border:0;display:block;box-sizing:content-box;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;',
- r = g.getElementsByTagName('body') [0];
- r && ((e = g.createElement('div')).style.cssText = 'border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px', r.appendChild(e).appendChild(u), u.innerHTML = '<table><tr><td></td><td>t</td></tr></table>', (n = u.getElementsByTagName('td')) [0].style.cssText = 'padding:0;margin:0;border:0;display:none', l = 0 === n[0].offsetHeight, n[0].style.display = '', n[1].style.display = 'none', o.reliableHiddenOffsets = l && 0 === n[0].offsetHeight, u.innerHTML = '', u.style.cssText = 'box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;', o.boxSizing = 4 === u.offsetWidth, o.doesNotIncludeMarginInBodyOffset = 1 !== r.offsetTop, f.getComputedStyle && (o.pixelPosition = '1%' !== (f.getComputedStyle(u, null) || {
- }).top, o.boxSizingReliable = '4px' === (f.getComputedStyle(u, null) || {
- width: '4px'
- }).width, (t = u.appendChild(g.createElement('div'))).style.cssText = u.style.cssText = a, t.style.marginRight = t.style.width = '0', u.style.width = '1px', o.reliableMarginRight = !parseFloat((f.getComputedStyle(t, null) || {
- }).marginRight)), typeof u.style.zoom !== h && (u.innerHTML = '', u.style.cssText = a + 'width:1px;padding:1px;display:inline;zoom:1', o.inlineBlockNeedsLayout = 3 === u.offsetWidth, u.style.display = 'block', u.innerHTML = '<div></div>', u.firstChild.style.width = '5px', o.shrinkWrapBlocks = 3 !== u.offsetWidth, o.inlineBlockNeedsLayout && (r.style.zoom = 1)), r.removeChild(e), e = u = n = t = null)
- }),
- e = a = r = t = n = null,
- o
- }();
- var T = /(?:\{[\s\S]*\}|\[[\s\S]*\])$/,
- I = /([A-Z])/g;
- function q(e, t, n, a) {
- if (de.acceptData(e)) {
- var r,
- o = de.expando,
- i = 'string' == typeof t,
- s = e.nodeType,
- l = s ? de.cache : e,
- c = s ? e[o] : e[o] && o;
- if (c && l[c] && (a || l[c].data) || !i || n !== O) return c || (s ? e[o] = c = p.pop() || de.guid++ : c = o),
- l[c] || (l[c] = {
- }, s || (l[c].toJSON = de.noop)),
- 'object' != typeof t && 'function' != typeof t || (a ? l[c] = de.extend(l[c], t) : l[c].data = de.extend(l[c].data, t)),
- c = l[c],
- a || (c.data || (c.data = {
- }), c = c.data),
- n !== O && (c[de.camelCase(t)] = n),
- i ? null == (r = c[t]) && (r = c[de.camelCase(t)]) : r = c,
- r
- }
- }
- function F(e, t, n) {
- if (de.acceptData(e)) {
- var a,
- r,
- o,
- i = e.nodeType,
- s = i ? de.cache : e,
- l = i ? e[de.expando] : de.expando;
- if (s[l]) {
- if (t && (o = n ? s[l] : s[l].data)) {
- for ((a = 0, r = (t = de.isArray(t) ? t.concat(de.map(t, de.camelCase)) : t in o || (t = de.camelCase(t)) in o ? [
- t
- ] : t.split(' ')).length); a < r; a++) delete o[t[a]];
- if (!(n ? U : de.isEmptyObject) (o)) return
- }(n || (delete s[l].data, U(s[l]))) && (i ? de.cleanData([e], !0) : de.support.deleteExpando || s != s.window ? delete s[l] : s[l] = null)
- }
- }
- }
- function L(e, t, n) {
- if (n === O && 1 === e.nodeType) {
- var a = 'data-' + t.replace(I, '-$1').toLowerCase();
- if ('string' == typeof (n = e.getAttribute(a))) {
- try {
- n = 'true' === n || 'false' !== n && ('null' === n ? null : + n + '' === n ? + n : T.test(n) ? de.parseJSON(n) : n)
- } catch (e) {
- }
- de.data(e, t, n)
- } else n = O
- }
- return n
- }
- function U(e) {
- for (var t in e) if (('data' !== t || !de.isEmptyObject(e[t])) && 'toJSON' !== t) return !1;
- return !0
- }
- de.extend({
- cache: {
- },
- expando: 'jQuery' + ('1.9.1' + Math.random()).replace(/\D/g, ''),
- noData: {
- embed: !0,
- object: 'clsid:D27CDB6E-AE6D-11cf-96B8-444553540000',
- applet: !0
- },
- hasData: function (e) {
- return !!(e = e.nodeType ? de.cache[e[de.expando]] : e[de.expando]) && !U(e)
- },
- data: function (e, t, n) {
- return q(e, t, n)
- },
- removeData: function (e, t) {
- return F(e, t)
- },
- _data: function (e, t, n) {
- return q(e, t, n, !0)
- },
- _removeData: function (e, t) {
- return F(e, t, !0)
- },
- acceptData: function (e) {
- if (e.nodeType && 1 !== e.nodeType && 9 !== e.nodeType) return !1;
- var t = e.nodeName && de.noData[e.nodeName.toLowerCase()];
- return !t || !0 !== t && e.getAttribute('classid') === t
- }
- }),
- de.fn.extend({
- data: function (t, e) {
- var n,
- a,
- r = this[0],
- o = 0,
- i = null;
- if (t !== O) return 'object' == typeof t ? this.each(function () {
- de.data(this, t)
- }) : de.access(this, function (e) {
- return e === O ? r ? L(r, t, de.data(r, t)) : null : void this.each(function () {
- de.data(this, t, e)
- })
- }, null, e, 1 < arguments.length, null, !0);
- if (this.length && (i = de.data(r), 1 === r.nodeType && !de._data(r, 'parsedAttrs'))) {
- for (n = r.attributes; o < n.length; o++) (a = n[o].name).indexOf('data-') || (a = de.camelCase(a.slice(5)), L(r, a, i[a]));
- de._data(r, 'parsedAttrs', !0)
- }
- return i
- },
- removeData: function (e) {
- return this.each(function () {
- de.removeData(this, e)
- })
- }
- }),
- de.extend({
- queue: function (e, t, n) {
- var a;
- if (e) return a = de._data(e, t = (t || 'fx') + 'queue'),
- n && (!a || de.isArray(n) ? a = de._data(e, t, de.makeArray(n)) : a.push(n)),
- a || [
- ]
- },
- dequeue: function (e, t) {
- var n = de.queue(e, t = t || 'fx'),
- a = n.length,
- r = n.shift(),
- o = de._queueHooks(e, t);
- 'inprogress' === r && (r = n.shift(), a--),
- (o.cur = r) && ('fx' === t && n.unshift('inprogress'), delete o.stop, r.call(e, function () {
- de.dequeue(e, t)
- }, o)),
- !a && o && o.empty.fire()
- },
- _queueHooks: function (e, t) {
- var n = t + 'queueHooks';
- return de._data(e, n) || de._data(e, n, {
- empty: de.Callbacks('once memory').add(function () {
- de._removeData(e, t + 'queue'),
- de._removeData(e, n)
- })
- })
- }
- }),
- de.fn.extend({
- queue: function (t, n) {
- var e = 2;
- return 'string' != typeof t && (n = t, t = 'fx', e--),
- arguments.length < e ? de.queue(this[0], t) : n === O ? this : this.each(function () {
- var e = de.queue(this, t, n);
- de._queueHooks(this, t),
- 'fx' === t && 'inprogress' !== e[0] && de.dequeue(this, t)
- })
- },
- dequeue: function (e) {
- return this.each(function () {
- de.dequeue(this, e)
- })
- },
- delay: function (a, e) {
- return a = de.fx && de.fx.speeds[a] || a,
- this.queue(e = e || 'fx', function (e, t) {
- var n = setTimeout(e, a);
- t.stop = function () {
- clearTimeout(n)
- }
- })
- },
- clearQueue: function (e) {
- return this.queue(e || 'fx', [
- ])
- },
- promise: function (e, t) {
- function n() {
- --r || o.resolveWith(i, [
- i
- ])
- }
- var a,
- r = 1,
- o = de.Deferred(),
- i = this,
- s = this.length;
- for ('string' != typeof e && (t = e, e = O), e = e || 'fx'; s--; ) (a = de._data(i[s], e + 'queueHooks')) && a.empty && (r++, a.empty.add(n));
- return n(),
- o.promise(t)
- }
- });
- var M,
- B,
- z = /[\t\r\n]/g,
- H = /\r/g,
- G = /^(?:input|select|textarea|button|object)$/i,
- V = /^(?:a|area)$/i,
- W = /^(?:checked|selected|autofocus|autoplay|async|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped)$/i,
- Y = /^(?:checked|selected)$/i,
- Q = de.support.getSetAttribute,
- K = de.support.input;
- de.fn.extend({
- attr: function (e, t) {
- return de.access(this, de.attr, e, t, 1 < arguments.length)
- },
- removeAttr: function (e) {
- return this.each(function () {
- de.removeAttr(this, e)
- })
- },
- prop: function (e, t) {
- return de.access(this, de.prop, e, t, 1 < arguments.length)
- },
- removeProp: function (e) {
- return e = de.propFix[e] || e,
- this.each(function () {
- try {
- this[e] = O,
- delete this[e]
- } catch (e) {
- }
- })
- },
- addClass: function (t) {
- var e,
- n,
- a,
- r,
- o,
- i = 0,
- s = this.length,
- l = 'string' == typeof t && t;
- if (de.isFunction(t)) return this.each(function (e) {
- de(this).addClass(t.call(this, e, this.className))
- });
- if (l) for (e = (t || '').match(S) || [
- ]; i < s; i++) if (a = 1 === (n = this[i]).nodeType && (n.className ? (' ' + n.className + ' ').replace(z, ' ') : ' ')) {
- for (o = 0; r = e[o++]; ) ~a.indexOf(' ' + r + ' ') || (a += r + ' ');
- n.className = de.trim(a)
- }
- return this
- },
- removeClass: function (t) {
- var e,
- n,
- a,
- r,
- o,
- i = 0,
- s = this.length,
- l = 0 === arguments.length || 'string' == typeof t && t;
- if (de.isFunction(t)) return this.each(function (e) {
- de(this).removeClass(t.call(this, e, this.className))
- });
- if (l) for (e = (t || '').match(S) || [
- ]; i < s; i++) if (a = 1 === (n = this[i]).nodeType && (n.className ? (' ' + n.className + ' ').replace(z, ' ') : '')) {
- for (o = 0; r = e[o++]; ) for (; ~a.indexOf(' ' + r + ' '); ) a = a.replace(' ' + r + ' ', ' ');
- n.className = t ? de.trim(a) : ''
- }
- return this
- },
- toggleClass: function (o, i) {
- var s = typeof o,
- l = 'boolean' == typeof i;
- return de.isFunction(o) ? this.each(function (e) {
- de(this).toggleClass(o.call(this, e, this.className, i), i)
- }) : this.each(function () {
- if ('string' == s) for (var e, t = 0, n = de(this), a = i, r = o.match(S) || [
- ]; e = r[t++]; ) a = l ? a : !n.hasClass(e),
- n[a ? 'addClass' : 'removeClass'](e);
- else s !== h && 'boolean' != s || (this.className && de._data(this, '__className__', this.className), this.className = !this.className && !1 !== o && de._data(this, '__className__') || '')
- })
- },
- hasClass: function (e) {
- for (var t = ' ' + e + ' ', n = 0, a = this.length; n < a; n++) if (1 === this[n].nodeType && ~(' ' + this[n].className + ' ').replace(z, ' ').indexOf(t)) return !0;
- return !1
- },
- val: function (n) {
- var e,
- a,
- r,
- t = this[0];
- return arguments.length ? (r = de.isFunction(n), this.each(function (e) {
- var t = de(this);
- 1 === this.nodeType && (null == (t = r ? n.call(this, e, t.val()) : n) ? t = '' : 'number' == typeof t ? t += '' : de.isArray(t) && (t = de.map(t, function (e) {
- return null == e ? '' : e + ''
- })), (a = de.valHooks[this.type] || de.valHooks[this.nodeName.toLowerCase()]) && 'set' in a && a.set(this, t, 'value') !== O || (this.value = t))
- })) : t ? (a = de.valHooks[t.type] || de.valHooks[t.nodeName.toLowerCase()]) && 'get' in a && (e = a.get(t, 'value')) !== O ? e : 'string' == typeof (e = t.value) ? e.replace(H, '') : null == e ? '' : e : void 0
- }
- }),
- de.extend({
- valHooks: {
- option: {
- get: function (e) {
- var t = e.attributes.value;
- return !t || t.specified ? e.value : e.text
- }
- },
- select: {
- get: function (e) {
- for (var t, n = e.options, a = e.selectedIndex, r = 'select-one' === e.type || a < 0, o = r ? null : [
- ], i = r ? a + 1 : n.length, s = a < 0 ? i : r ? a : 0; s < i; s++) if (((t = n[s]).selected || s === a) && (de.support.optDisabled ? !t.disabled : null === t.getAttribute('disabled')) && (!t.parentNode.disabled || !de.nodeName(t.parentNode, 'optgroup'))) {
- if (t = de(t).val(), r) return t;
- o.push(t)
- }
- return o
- },
- set: function (e, t) {
- var n = de.makeArray(t);
- return de(e).find('option').each(function () {
- this.selected = 0 <= de.inArray(de(this).val(), n)
- }),
- n.length || (e.selectedIndex = - 1),
- n
- }
- }
- },
- attr: function (e, t, n) {
- var a,
- r,
- o = e.nodeType;
- if (e && 3 !== o && 8 !== o && 2 !== o) return typeof e.getAttribute === h ? de.prop(e, t, n) : ((o = 1 !== o || !de.isXMLDoc(e)) && (t = t.toLowerCase(), a = de.attrHooks[t] || (W.test(t) ? B : M)), n === O ? !(a && o && 'get' in a && null !== (r = a.get(e, t))) && null == (r = typeof e.getAttribute !== h ? e.getAttribute(t) : r) ? O : r : null !== n ? a && o && 'set' in a && (r = a.set(e, n, t)) !== O ? r : (e.setAttribute(t, n + ''), n) : void de.removeAttr(e, t))
- },
- removeAttr: function (e, t) {
- var n,
- a,
- r = 0,
- o = t && t.match(S);
- if (o && 1 === e.nodeType) for (; n = o[r++]; ) a = de.propFix[n] || n,
- W.test(n) ? !Q && Y.test(n) ? e[de.camelCase('default-' + n)] = e[a] = !1 : e[a] = !1 : de.attr(e, n, ''),
- e.removeAttribute(Q ? n : a)
- },
- attrHooks: {
- type: {
- set: function (e, t) {
- if (!de.support.radioValue && 'radio' === t && de.nodeName(e, 'input')) {
- var n = e.value;
- return e.setAttribute('type', t),
- n && (e.value = n),
- t
- }
- }
- }
- },
- propFix: {
- tabindex: 'tabIndex',
- readonly: 'readOnly',
- for : 'htmlFor',
- class : 'className',
- maxlength: 'maxLength',
- cellspacing: 'cellSpacing',
- cellpadding: 'cellPadding',
- rowspan: 'rowSpan',
- colspan: 'colSpan',
- usemap: 'useMap',
- frameborder: 'frameBorder',
- contenteditable: 'contentEditable'
- },
- prop: function (e, t, n) {
- var a,
- r,
- o = e.nodeType;
- if (e && 3 !== o && 8 !== o && 2 !== o) return (1 !== o || !de.isXMLDoc(e)) && (r = de.propHooks[t = de.propFix[t] || t]),
- n !== O ? r && 'set' in r && (a = r.set(e, n, t)) !== O ? a : e[t] = n : r && 'get' in r && null !== (a = r.get(e, t)) ? a : e[t]
- },
- propHooks: {
- tabIndex: {
- get: function (e) {
- var t = e.getAttributeNode('tabindex');
- return t && t.specified ? parseInt(t.value, 10) : G.test(e.nodeName) || V.test(e.nodeName) && e.href ? 0 : O
- }
- }
- }
- }),
- B = {
- get: function (e, t) {
- var n = de.prop(e, t),
- a = 'boolean' == typeof n && e.getAttribute(t),
- e = 'boolean' == typeof n ? K && Q ? null != a : Y.test(t) ? e[de.camelCase('default-' + t)] : !!a : e.getAttributeNode(t);
- return e && !1 !== e.value ? t.toLowerCase() : O
- },
- set: function (e, t, n) {
- return !1 === t ? de.removeAttr(e, n) : K && Q || !Y.test(n) ? e.setAttribute(!Q && de.propFix[n] || n, n) : e[de.camelCase('default-' + n)] = e[n] = !0,
- n
- }
- },
- K && Q || (de.attrHooks.value = {
- get: function (e, t) {
- t = e.getAttributeNode(t);
- return de.nodeName(e, 'input') ? e.defaultValue : t && t.specified ? t.value : O
- },
- set: function (e, t, n) {
- if (!de.nodeName(e, 'input')) return M && M.set(e, t, n);
- e.defaultValue = t
- }
- }),
- Q || (M = de.valHooks.button = {
- get: function (e, t) {
- e = e.getAttributeNode(t);
- return e && ('id' === t || 'name' === t || 'coords' === t ? '' !== e.value : e.specified) ? e.value : O
- },
- set: function (e, t, n) {
- var a = e.getAttributeNode(n);
- return a || e.setAttributeNode(a = e.ownerDocument.createAttribute(n)),
- a.value = t += '',
- 'value' === n || t === e.getAttribute(n) ? t : O
- }
- }, de.attrHooks.contenteditable = {
- get: M.get,
- set: function (e, t, n) {
- M.set(e, '' !== t && t, n)
- }
- }, de.each(['width',
- 'height'], function (e, n) {
- de.attrHooks[n] = de.extend(de.attrHooks[n], {
- set: function (e, t) {
- if ('' === t) return e.setAttribute(n, 'auto'),
- t
- }
- })
- })),
- de.support.hrefNormalized || (de.each(['href',
- 'src',
- 'width',
- 'height'], function (e, t) {
- de.attrHooks[t] = de.extend(de.attrHooks[t], {
- get: function (e) {
- e = e.getAttribute(t, 2);
- return null == e ? O : e
- }
- })
- }), de.each(['href',
- 'src'], function (e, t) {
- de.propHooks[t] = {
- get: function (e) {
- return e.getAttribute(t, 4)
- }
- }
- })),
- de.support.style || (de.attrHooks.style = {
- get: function (e) {
- return e.style.cssText || O
- },
- set: function (e, t) {
- return e.style.cssText = t + ''
- }
- }),
- de.support.optSelected || (de.propHooks.selected = de.extend(de.propHooks.selected, {
- get: function (e) {
- return null
- }
- })),
- de.support.enctype || (de.propFix.enctype = 'encoding'),
- de.support.checkOn || de.each(['radio',
- 'checkbox'], function () {
- de.valHooks[this] = {
- get: function (e) {
- return null === e.getAttribute('value') ? 'on' : e.value
- }
- }
- }),
- de.each(['radio',
- 'checkbox'], function () {
- de.valHooks[this] = de.extend(de.valHooks[this], {
- set: function (e, t) {
- if (de.isArray(t)) return e.checked = 0 <= de.inArray(de(e).val(), t)
- }
- })
- });
- var J = /^(?:input|select|textarea)$/i,
- $ = /^key/,
- Z = /^(?:mouse|contextmenu)|click/,
- X = /^(?:focusinfocus|focusoutblur)$/,
- ee = /^([^.]*)(?:\.(.+)|)$/;
- function te() {
- return !0
- }
- function ne() {
- return !1
- }
- de.event = {
- global: {
- },
- add: function (e, t, n, a, r) {
- var o,
- i,
- s,
- l,
- c,
- u,
- p,
- d,
- m,
- f = de._data(e);
- if (f) {
- for (n.handler && (n = (s = n).handler, r = s.selector), n.guid || (n.guid = de.guid++), (o = f.events) || (o = f.events = {
- }), (c = f.handle) || ((c = f.handle = function (e) {
- return typeof de === h || e && de.event.triggered === e.type ? O : de.event.dispatch.apply(c.elem, arguments)
- }).elem = e), i = (t = (t || '').match(S) || [
- ''
- ]).length; i--; ) p = m = (u = ee.exec(t[i]) || [
- ]) [1],
- d = (u[2] || '').split('.').sort(),
- l = de.event.special[p] || {
- },
- l = de.event.special[p = (r ? l.delegateType : l.bindType) || p] || {
- },
- u = de.extend({
- type: p,
- origType: m,
- data: a,
- handler: n,
- guid: n.guid,
- selector: r,
- needsContext: r && de.expr.match.needsContext.test(r),
- namespace: d.join('.')
- }, s),
- (m = o[p]) || ((m = o[p] = [
- ]).delegateCount = 0, l.setup && !1 !== l.setup.call(e, a, d, c) || (e.addEventListener ? e.addEventListener(p, c, !1) : e.attachEvent && e.attachEvent('on' + p, c))),
- l.add && (l.add.call(e, u), u.handler.guid || (u.handler.guid = n.guid)),
- r ? m.splice(m.delegateCount++, 0, u) : m.push(u),
- de.event.global[p] = !0;
- e = null
- }
- },
- remove: function (e, t, n, a, r) {
- var o,
- i,
- s,
- l,
- c,
- u,
- p,
- d,
- m,
- f,
- h,
- g = de.hasData(e) && de._data(e);
- if (g && (u = g.events)) {
- for (c = (t = (t || '').match(S) || [
- ''
- ]).length; c--; ) if (m = h = (s = ee.exec(t[c]) || [
- ]) [1], f = (s[2] || '').split('.').sort(), m) {
- for (p = de.event.special[m] || {
- }, d = u[m = (a ? p.delegateType : p.bindType) || m] || [
- ], s = s[2] && RegExp('(^|\\.)' + f.join('\\.(?:.*\\.|)') + '(\\.|$)'), l = o = d.length; o--; ) i = d[o],
- !r && h !== i.origType || n && n.guid !== i.guid || s && !s.test(i.namespace) || a && a !== i.selector && ('**' !== a || !i.selector) || (d.splice(o, 1), i.selector && d.delegateCount--, p.remove && p.remove.call(e, i));
- l && !d.length && (p.teardown && !1 !== p.teardown.call(e, f, g.handle) || de.removeEvent(e, m, g.handle), delete u[m])
- } else for (m in u) de.event.remove(e, m + t[c], n, a, !0);
- de.isEmptyObject(u) && (delete g.handle, de._removeData(e, 'events'))
- }
- },
- trigger: function (e, t, n, a) {
- var r,
- o,
- i,
- s,
- l,
- c,
- u = [
- n || g
- ],
- p = b.call(e, 'type') ? e.type : e,
- d = b.call(e, 'namespace') ? e.namespace.split('.') : [
- ],
- m = l = n = n || g;
- if (3 !== n.nodeType && 8 !== n.nodeType && !X.test(p + de.event.triggered) && (~p.indexOf('.') && (p = (d = p.split('.')).shift(), d.sort()), o = !~p.indexOf(':') && 'on' + p, (e = e[de.expando] ? e : new de.Event(p, 'object' == typeof e && e)).isTrigger = !0, e.namespace = d.join('.'), e.namespace_re = e.namespace ? RegExp('(^|\\.)' + d.join('\\.(?:.*\\.|)') + '(\\.|$)') : null, e.result = O, e.target || (e.target = n), t = null == t ? [
- e
- ] : de.makeArray(t, [
- e
- ]), s = de.event.special[p] || {
- }, a || !s.trigger || !1 !== s.trigger.apply(n, t))) {
- if (!a && !s.noBubble && !de.isWindow(n)) {
- for (X.test((i = s.delegateType || p) + p) || (m = m.parentNode); m; m = m.parentNode) u.push(m),
- l = m;
- l === (n.ownerDocument || g) && u.push(l.defaultView || l.parentWindow || f)
- }
- for (c = 0; (m = u[c++]) && !e.isPropagationStopped(); ) e.type = 1 < c ? i : s.bindType || p,
- (r = (de._data(m, 'events') || {
- }) [e.type] && de._data(m, 'handle')) && r.apply(m, t),
- (r = o && m[o]) && de.acceptData(m) && r.apply && !1 === r.apply(m, t) && e.preventDefault();
- if (e.type = p, !a && !e.isDefaultPrevented() && (!s._default || !1 === s._default.apply(n.ownerDocument, t)) && ('click' !== p || !de.nodeName(n, 'a')) && de.acceptData(n) && o && n[p] && !de.isWindow(n)) {
- (l = n[o]) && (n[o] = null),
- de.event.triggered = p;
- try {
- n[p]()
- } catch (e) {
- }
- de.event.triggered = O,
- l && (n[o] = l)
- }
- return e.result
- }
- },
- dispatch: function (e) {
- e = de.event.fix(e);
- var t,
- n,
- a,
- r,
- o,
- i = u.call(arguments),
- s = (de._data(this, 'events') || {
- }) [e.type] || [
- ],
- l = de.event.special[e.type] || {
- };
- if ((i[0] = e).delegateTarget = this, !l.preDispatch || !1 !== l.preDispatch.call(this, e)) {
- for (o = de.event.handlers.call(this, e, s), t = 0; (a = o[t++]) && !e.isPropagationStopped(); ) for (e.currentTarget = a.elem, r = 0; (n = a.handlers[r++]) && !e.isImmediatePropagationStopped(); ) e.namespace_re && !e.namespace_re.test(n.namespace) || (e.handleObj = n, e.data = n.data, (n = ((de.event.special[n.origType] || {
- }).handle || n.handler).apply(a.elem, i)) !== O && !1 === (e.result = n) && (e.preventDefault(), e.stopPropagation()));
- return l.postDispatch && l.postDispatch.call(this, e),
- e.result
- }
- },
- handlers: function (e, t) {
- var n,
- a,
- r,
- o,
- i = [
- ],
- s = t.delegateCount,
- l = e.target;
- if (s && l.nodeType && (!e.button || 'click' !== e.type)) for (; l != this; l = l.parentNode || this) if (1 === l.nodeType && (!0 !== l.disabled || 'click' !== e.type)) {
- for (r = [
- ], o = 0; o < s; o++) r[n = (a = t[o]).selector + ' '] === O && (r[n] = a.needsContext ? 0 <= de(n, this).index(l) : de.find(n, this, null, [
- l
- ]).length),
- r[n] && r.push(a);
- r.length && i.push({
- elem: l,
- handlers: r
- })
- }
- return s < t.length && i.push({
- elem: this,
- handlers: t.slice(s)
- }),
- i
- },
- fix: function (e) {
- if (e[de.expando]) return e;
- var t,
- n,
- a,
- r = e.type,
- o = e,
- i = this.fixHooks[r];
- for (i || (this.fixHooks[r] = i = Z.test(r) ? this.mouseHooks : $.test(r) ? this.keyHooks : {
- }), a = i.props ? this.props.concat(i.props) : this.props, e = new de.Event(o), t = a.length; t--; ) e[n = a[t]] = o[n];
- return e.target || (e.target = o.srcElement || g),
- 3 === e.target.nodeType && (e.target = e.target.parentNode),
- e.metaKey = !!e.metaKey,
- i.filter ? i.filter(e, o) : e
- },
- props: 'altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which'.split(' '),
- fixHooks: {
- },
- keyHooks: {
- props: 'char charCode key keyCode'.split(' '),
- filter: function (e, t) {
- return null == e.which && (e.which = null != t.charCode ? t.charCode : t.keyCode),
- e
- }
- },
- mouseHooks: {
- props: 'button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement'.split(' '),
- filter: function (e, t) {
- var n,
- a,
- r = t.button,
- o = t.fromElement;
- return null == e.pageX && null != t.clientX && (n = (a = e.target.ownerDocument || g).body, e.pageX = t.clientX + ((a = a.documentElement) && a.scrollLeft || n && n.scrollLeft || 0) - (a && a.clientLeft || n && n.clientLeft || 0), e.pageY = t.clientY + (a && a.scrollTop || n && n.scrollTop || 0) - (a && a.clientTop || n && n.clientTop || 0)),
- !e.relatedTarget && o && (e.relatedTarget = o === e.target ? t.toElement : o),
- e.which || r === O || (e.which = 1 & r ? 1 : 2 & r ? 3 : 4 & r ? 2 : 0),
- e
- }
- },
- special: {
- load: {
- noBubble: !0
- },
- click: {
- trigger: function () {
- if (de.nodeName(this, 'input') && 'checkbox' === this.type && this.click) return this.click(),
- !1
- }
- },
- focus: {
- trigger: function () {
- if (this !== g.activeElement && this.focus) try {
- return this.focus(),
- !1
- } catch (e) {
- }
- },
- delegateType: 'focusin'
- },
- blur: {
- trigger: function () {
- if (this === g.activeElement && this.blur) return this.blur(),
- !1
- },
- delegateType: 'focusout'
- },
- beforeunload: {
- postDispatch: function (e) {
- e.result !== O && (e.originalEvent.returnValue = e.result)
- }
- }
- },
- simulate: function (e, t, n, a) {
- e = de.extend(new de.Event, n, {
- type: e,
- isSimulated: !0,
- originalEvent: {
- }
- });
- a ? de.event.trigger(e, null, t) : de.event.dispatch.call(t, e),
- e.isDefaultPrevented() && n.preventDefault()
- }
- },
- de.removeEvent = g.removeEventListener ? function (e, t, n) {
- e.removeEventListener && e.removeEventListener(t, n, !1)
- }
- : function (e, t, n) {
- t = 'on' + t;
- e.detachEvent && (typeof e[t] === h && (e[t] = null), e.detachEvent(t, n))
- },
- de.Event = function (e, t) {
- if (!(this instanceof de.Event)) return new de.Event(e, t);
- e && e.type ? (this.originalEvent = e, this.type = e.type, this.isDefaultPrevented = e.defaultPrevented || !1 === e.returnValue || e.getPreventDefault && e.getPreventDefault() ? te : ne) : this.type = e,
- t && de.extend(this, t),
- this.timeStamp = e && e.timeStamp || de.now(),
- this[de.expando] = !0
- },
- de.Event.prototype = {
- isDefaultPrevented: ne,
- isPropagationStopped: ne,
- isImmediatePropagationStopped: ne,
- preventDefault: function () {
- var e = this.originalEvent;
- this.isDefaultPrevented = te,
- e && (e.preventDefault ? e.preventDefault() : e.returnValue = !1)
- },
- stopPropagation: function () {
- var e = this.originalEvent;
- this.isPropagationStopped = te,
- e && (e.stopPropagation && e.stopPropagation(), e.cancelBubble = !0)
- },
- stopImmediatePropagation: function () {
- this.isImmediatePropagationStopped = te,
- this.stopPropagation()
- }
- },
- de.each({
- mouseenter: 'mouseover',
- mouseleave: 'mouseout'
- }, function (e, r) {
- de.event.special[e] = {
- delegateType: r,
- bindType: r,
- handle: function (e) {
- var t,
- n = e.relatedTarget,
- a = e.handleObj;
- return n && (n === this || de.contains(this, n)) || (e.type = a.origType, t = a.handler.apply(this, arguments), e.type = r),
- t
- }
- }
- }),
- de.support.submitBubbles || (de.event.special.submit = {
- setup: function () {
- if (de.nodeName(this, 'form')) return !1;
- de.event.add(this, 'click._submit keypress._submit', function (e) {
- e = e.target,
- e = de.nodeName(e, 'input') || de.nodeName(e, 'button') ? e.form : O;
- e && !de._data(e, 'submitBubbles') && (de.event.add(e, 'submit._submit', function (e) {
- e._submit_bubble = !0
- }), de._data(e, 'submitBubbles', !0))
- })
- },
- postDispatch: function (e) {
- e._submit_bubble && (delete e._submit_bubble, this.parentNode && !e.isTrigger && de.event.simulate('submit', this.parentNode, e, !0))
- },
- teardown: function () {
- if (de.nodeName(this, 'form')) return !1;
- de.event.remove(this, '._submit')
- }
- }),
- de.support.changeBubbles || (de.event.special.change = {
- setup: function () {
- if (J.test(this.nodeName)) return 'checkbox' !== this.type && 'radio' !== this.type || (de.event.add(this, 'propertychange._change', function (e) {
- 'checked' === e.originalEvent.propertyName && (this._just_changed = !0)
- }), de.event.add(this, 'click._change', function (e) {
- this._just_changed && !e.isTrigger && (this._just_changed = !1),
- de.event.simulate('change', this, e, !0)
- })),
- !1;
- de.event.add(this, 'beforeactivate._change', function (e) {
- e = e.target;
- J.test(e.nodeName) && !de._data(e, 'changeBubbles') && (de.event.add(e, 'change._change', function (e) {
- !this.parentNode || e.isSimulated || e.isTrigger || de.event.simulate('change', this.parentNode, e, !0)
- }), de._data(e, 'changeBubbles', !0))
- })
- },
- handle: function (e) {
- var t = e.target;
- if (this !== t || e.isSimulated || e.isTrigger || 'radio' !== t.type && 'checkbox' !== t.type) return e.handleObj.handler.apply(this, arguments)
- },
- teardown: function () {
- return de.event.remove(this, '._change'),
- !J.test(this.nodeName)
- }
- }),
- de.support.focusinBubbles || de.each({
- focus: 'focusin',
- blur: 'focusout'
- }, function (e, t) {
- function n(e) {
- de.event.simulate(t, e.target, de.event.fix(e), !0)
- }
- var a = 0;
- de.event.special[t] = {
- setup: function () {
- 0 == a++ && g.addEventListener(e, n, !0)
- },
- teardown: function () {
- 0 == --a && g.removeEventListener(e, n, !0)
- }
- }
- }),
- de.fn.extend({
- on: function (e, t, n, a, r) {
- var o,
- i;
- if ('object' == typeof e) {
- for (o in 'string' != typeof t && (n = n || t, t = O), e) this.on(o, t, n, e[o], r);
- return this
- }
- if (null == n && null == a ? (a = t, n = t = O) : null == a && ('string' == typeof t ? (a = n, n = O) : (a = n, n = t, t = O)), !1 === a) a = ne;
- else if (!a) return this;
- return 1 === r && (i = a, (a = function (e) {
- return de().off(e),
- i.apply(this, arguments)
- }).guid = i.guid || (i.guid = de.guid++)),
- this.each(function () {
- de.event.add(this, e, a, n, t)
- })
- },
- one: function (e, t, n, a) {
- return this.on(e, t, n, a, 1)
- },
- off: function (e, t, n) {
- var a,
- r;
- if (e && e.preventDefault && e.handleObj) return a = e.handleObj,
- de(e.delegateTarget).off(a.namespace ? a.origType + '.' + a.namespace : a.origType, a.selector, a.handler),
- this;
- if ('object' != typeof e) return !1 !== t && 'function' != typeof t || (n = t, t = O),
- !1 === n && (n = ne),
- this.each(function () {
- de.event.remove(this, e, n, t)
- });
- for (r in e) this.off(r, t, e[r]);
- return this
- },
- bind: function (e, t, n) {
- return this.on(e, null, t, n)
- },
- unbind: function (e, t) {
- return this.off(e, null, t)
- },
- delegate: function (e, t, n, a) {
- return this.on(t, e, n, a)
- },
- undelegate: function (e, t, n) {
- return 1 === arguments.length ? this.off(e, '**') : this.off(t, e || '**', n)
- },
- trigger: function (e, t) {
- return this.each(function () {
- de.event.trigger(e, t, this)
- })
- },
- triggerHandler: function (e, t) {
- var n = this[0];
- if (n) return de.event.trigger(e, t, n, !0)
- }
- }),
- function (n) {
- var e,
- E,
- O,
- o,
- t,
- p,
- c,
- S,
- d,
- w,
- a,
- m,
- f,
- r,
- i,
- h,
- s,
- v = 'sizzle' + - new Date,
- g = n.document,
- y = {
- },
- P = 0,
- b = 0,
- l = Z(),
- u = Z(),
- _ = Z(),
- k = 'undefined',
- N = [
- ],
- C = N.pop,
- R = N.push,
- x = N.slice,
- A = N.indexOf || function (e) {
- for (var t = 0, n = this.length; t < n; t++) if (this[t] === e) return t;
- return - 1
- },
- D = '[\\x20\\t\\r\\n\\f]',
- j = '(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+',
- T = j.replace('w', 'w#'),
- N = '\\[' + D + '*(' + j + ')' + D + '*(?:([*^$|!~]?=)' + D + '*(?:([\'"])((?:\\\\.|[^\\\\])*?)\\3|(' + T + ')|)|)' + D + '*\\]',
- I = ':(' + j + ')(?:\\((([\'"])((?:\\\\.|[^\\\\])*?)\\3|((?:\\\\.|[^\\\\()[\\]]|' + N.replace(3, 8) + ')*)|.*)\\)|)',
- q = /^[\x20\t\r\n\f]+|((?:^|[^\\])(?:\\.)*)[\x20\t\r\n\f]+$/g,
- F = RegExp('^' + D + '*,' + D + '*'),
- L = RegExp('^' + D + '*([\\x20\\t\\r\\n\\f>+~])' + D + '*'),
- U = RegExp(I),
- M = RegExp('^' + T + '$'),
- B = {
- ID: RegExp('^#(' + j + ')'),
- CLASS: RegExp('^\\.(' + j + ')'),
- NAME: RegExp('^\\[name=[\'"]?(' + j + ')[\'"]?\\]'),
- TAG: /^((?:\\.|[\w*-]|[^\x00-\xa0])+)/,
- ATTR: RegExp('^' + N),
- PSEUDO: RegExp('^' + I),
- CHILD: RegExp('^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(' + D + '*(even|odd|(([+-]|)(\\d*)n|)' + D + '*(?:([+-]|)' + D + '*(\\d+)|))' + D + '*\\)|)', 'i'),
- needsContext: RegExp('^' + D + '*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(' + D + '*((?:-\\d)?\\d*)' + D + '*\\)|)(?=[^-]|$)', 'i')
- },
- z = /[\x20\t\r\n\f]*[+~]/,
- H = /^[^{]+\{\s*\[native code/,
- G = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,
- V = /^(?:input|select|textarea|button)$/i,
- W = /^h\d$/i,
- Y = /'|\\/g,
- Q = /\=[\x20\t\r\n\f]*([^'"\]]*)[\x20\t\r\n\f]*\]/g,
- K = /\\([\da-fA-F]{1,6}[\x20\t\r\n\f]?|.)/g,
- J = function (e, t) {
- var n = '0x' + t - 65536;
- return n != n ? t : n < 0 ? String.fromCharCode(65536 + n) : String.fromCharCode(n >> 10 | 55296, 1023 & n | 56320)
- };
- try {
- x.call(g.documentElement.childNodes, 0)
- } catch (e) {
- x = function (e) {
- for (var t, n = [
- ]; t = this[e++]; ) n.push(t);
- return n
- }
- }
- function $(e) {
- return H.test(e + '')
- }
- function Z() {
- var n,
- a = [
- ];
- return n = function (e, t) {
- return a.push(e += ' ') > O.cacheLength && delete n[a.shift()],
- n[e] = t
- }
- }
- function X(e) {
- return e[v] = !0,
- e
- }
- function ee(e) {
- var t = w.createElement('div');
- try {
- return e(t)
- } catch (e) {
- return !1
- } finally {
- t = null
- }
- }
- function te(e, t, n, a) {
- var r,
- o,
- i,
- s,
- l,
- c,
- u;
- if ((t ? t.ownerDocument || t : g) !== w && d(t), n = n || [
- ], !e || 'string' != typeof e) return n;
- if (1 !== (r = (t = t || w).nodeType) && 9 !== r) return [];
- if (!m && !a) {
- if (c = G.exec(e)) if (u = c[1]) {
- if (9 === r) {
- if (!(s = t.getElementById(u)) || !s.parentNode) return n;
- if (s.id === u) return n.push(s),
- n
- } else if (t.ownerDocument && (s = t.ownerDocument.getElementById(u)) && h(t, s) && s.id === u) return n.push(s),
- n
- } else {
- if (c[2]) return R.apply(n, x.call(t.getElementsByTagName(e), 0)),
- n;
- if ((u = c[3]) && y.getByClassName && t.getElementsByClassName) return R.apply(n, x.call(t.getElementsByClassName(u), 0)),
- n
- }
- if (y.qsa && !f.test(e)) {
- if (s = !0, l = v, c = t, u = 9 === r && e, 1 === r && 'object' != t.nodeName.toLowerCase()) {
- for (i = re(e), (s = t.getAttribute('id')) ? l = s.replace(Y, '\\$&') : t.setAttribute('id', l), l = '[id=\'' + l + '\'] ', o = i.length; o--; ) i[o] = l + oe(i[o]);
- c = z.test(e) && t.parentNode || t,
- u = i.join(',')
- }
- if (u) try {
- return R.apply(n, x.call(c.querySelectorAll(u), 0)),
- n
- } catch (e) {
- } finally {
- s || t.removeAttribute('id')
- }
- }
- }
- return function (e, t, n, a) {
- var r,
- o,
- i,
- s,
- l,
- c = re(e);
- if (!a && 1 === c.length) {
- if (2 < (o = c[0] = c[0].slice(0)).length && 'ID' === (i = o[0]).type && 9 === t.nodeType && !m && O.relative[o[1].type]) {
- if (!(t = O.find.ID(i.matches[0].replace(K, J), t) [0])) return n;
- e = e.slice(o.shift().value.length)
- }
- for (r = B.needsContext.test(e) ? 0 : o.length; r-- && !O.relative[s = (i = o[r]).type]; ) if ((l = O.find[s]) && (a = l(i.matches[0].replace(K, J), z.test(o[0].type) && t.parentNode || t))) {
- if (o.splice(r, 1), !(e = a.length && oe(o))) return R.apply(n, x.call(a, 0)),
- n;
- break
- }
- }
- return p(e, c) (a, t, m, n, z.test(e)),
- n
- }(e.replace(q, '$1'), t, n, a)
- }
- function ne(e, t) {
- var n = t && e,
- a = n && (~t.sourceIndex || 1 << 31) - (~e.sourceIndex || 1 << 31);
- if (a) return a;
- if (n) for (; n = n.nextSibling; ) if (n === t) return - 1;
- return e ? 1 : - 1
- }
- function ae(i) {
- return X(function (o) {
- return o = + o,
- X(function (e, t) {
- for (var n, a = i([], e.length, o), r = a.length; r--; ) e[n = a[r]] && (e[n] = !(t[n] = e[n]))
- })
- })
- }
- for (e in t = te.isXML = function (e) {
- e = e && (e.ownerDocument || e).documentElement;
- return !!e && 'HTML' !== e.nodeName
- }, d = te.setDocument = function (e) {
- var l = e ? e.ownerDocument || e : g;
- return l !== w && 9 === l.nodeType && l.documentElement && (a = (w = l).documentElement, m = t(l), y.tagNameNoComments = ee(function (e) {
- return e.appendChild(l.createComment('')),
- !e.getElementsByTagName('*').length
- }), y.attributes = ee(function (e) {
- e.innerHTML = '<select></select>';
- e = typeof e.lastChild.getAttribute('multiple');
- return 'boolean' != e && 'string' != e
- }), y.getByClassName = ee(function (e) {
- return e.innerHTML = '<div class=\'hidden e\'></div><div class=\'hidden\'></div>',
- !(!e.getElementsByClassName || !e.getElementsByClassName('e').length) && (e.lastChild.className = 'e', 2 === e.getElementsByClassName('e').length)
- }), y.getByName = ee(function (e) {
- e.id = v + 0,
- e.innerHTML = '<a name=\'' + v + '\'></a><div name=\'' + v + '\'></div>',
- a.insertBefore(e, a.firstChild);
- var t = l.getElementsByName && l.getElementsByName(v).length === 2 + l.getElementsByName(v + 0).length;
- return y.getIdNotName = !l.getElementById(v),
- a.removeChild(e),
- t
- }), O.attrHandle = ee(function (e) {
- return e.innerHTML = '<a href=\'#\'></a>',
- e.firstChild && typeof e.firstChild.getAttribute != k && '#' === e.firstChild.getAttribute('href')
- }) ? {
- }
- : {
- href: function (e) {
- return e.getAttribute('href', 2)
- },
- type: function (e) {
- return e.getAttribute('type')
- }
- }, y.getIdNotName ? (O.find.ID = function (e, t) {
- if (typeof t.getElementById != k && !m) {
- e = t.getElementById(e);
- return e && e.parentNode ? [
- e
- ] : [
- ]
- }
- }, O.filter.ID = function (e) {
- var t = e.replace(K, J);
- return function (e) {
- return e.getAttribute('id') === t
- }
- }) : (O.find.ID = function (e, t) {
- if (typeof t.getElementById != k && !m) {
- t = t.getElementById(e);
- return t ? t.id === e || typeof t.getAttributeNode != k && t.getAttributeNode('id').value === e ? [
- t
- ] : void 0 : [
- ]
- }
- }, O.filter.ID = function (e) {
- var t = e.replace(K, J);
- return function (e) {
- e = typeof e.getAttributeNode != k && e.getAttributeNode('id');
- return e && e.value === t
- }
- }), O.find.TAG = y.tagNameNoComments ? function (e, t) {
- if (typeof t.getElementsByTagName != k) return t.getElementsByTagName(e)
- }
- : function (e, t) {
- var n,
- a = [
- ],
- r = 0,
- o = t.getElementsByTagName(e);
- if ('*' !== e) return o;
- for (; n = o[r++]; ) 1 === n.nodeType && a.push(n);
- return a
- }, O.find.NAME = y.getByName && function (e, t) {
- if (typeof t.getElementsByName != k) return t.getElementsByName(name)
- }, O.find.CLASS = y.getByClassName && function (e, t) {
- if (typeof t.getElementsByClassName != k && !m) return t.getElementsByClassName(e)
- }, r = [
- ], f = [
- ':focus'
- ], (y.qsa = $(l.querySelectorAll)) && (ee(function (e) {
- e.innerHTML = '<select><option selected=\'\'></option></select>',
- e.querySelectorAll('[selected]').length || f.push('\\[' + D + '*(?:checked|disabled|ismap|multiple|readonly|selected|value)'),
- e.querySelectorAll(':checked').length || f.push(':checked')
- }), ee(function (e) {
- e.innerHTML = '<input type=\'hidden\' i=\'\'/>',
- e.querySelectorAll('[i^=\'\']').length && f.push('[*^$]=' + D + '*(?:""|\'\')'),
- e.querySelectorAll(':enabled').length || f.push(':enabled', ':disabled'),
- e.querySelectorAll('*,:x'),
- f.push(',.*:')
- })), (y.matchesSelector = $(i = a.matchesSelector || a.mozMatchesSelector || a.webkitMatchesSelector || a.oMatchesSelector || a.msMatchesSelector)) && ee(function (e) {
- y.disconnectedMatch = i.call(e, 'div'),
- i.call(e, '[s!=\'\']:x'),
- r.push('!=', I)
- }), f = RegExp(f.join('|')), r = RegExp(r.join('|')), h = $(a.contains) || a.compareDocumentPosition ? function (e, t) {
- var n = 9 === e.nodeType ? e.documentElement : e,
- t = t && t.parentNode;
- return e === t || !(!t || 1 !== t.nodeType || !(n.contains ? n.contains(t) : e.compareDocumentPosition && 16 & e.compareDocumentPosition(t)))
- }
- : function (e, t) {
- if (t) for (; t = t.parentNode; ) if (t === e) return !0;
- return !1
- }, s = a.compareDocumentPosition ? function (e, t) {
- var n;
- return e === t ? (c = !0, 0) : (n = t.compareDocumentPosition && e.compareDocumentPosition && e.compareDocumentPosition(t)) ? 1 & n || e.parentNode && 11 === e.parentNode.nodeType ? e === l || h(g, e) ? - 1 : t === l || h(g, t) ? 1 : 0 : 4 & n ? - 1 : 1 : e.compareDocumentPosition ? - 1 : 1
- }
- : function (e, t) {
- var n,
- a = 0,
- r = e.parentNode,
- o = t.parentNode,
- i = [
- e
- ],
- s = [
- t
- ];
- if (e === t) return c = !0,
- 0;
- if (!r || !o) return e === l ? - 1 : t === l ? 1 : r ? - 1 : o ? 1 : 0;
- if (r === o) return ne(e, t);
- for (n = e; n = n.parentNode; ) i.unshift(n);
- for (n = t; n = n.parentNode; ) s.unshift(n);
- for (; i[a] === s[a]; ) a++;
- return a ? ne(i[a], s[a]) : i[a] === g ? - 1 : s[a] === g ? 1 : 0
- }, c = !1, [
- 0,
- 0
- ].sort(s), y.detectDuplicates = c),
- w
- }, te.matches = function (e, t) {
- return te(e, null, null, t)
- }, te.matchesSelector = function (e, t) {
- if ((e.ownerDocument || e) !== w && d(e), t = t.replace(Q, '=\'$1\']'), y.matchesSelector && !m && (!r || !r.test(t)) && !f.test(t)) try {
- var n = i.call(e, t);
- if (n || y.disconnectedMatch || e.document && 11 !== e.document.nodeType) return n
- } catch (e) {
- }
- return 0 < te(t, w, null, [
- e
- ]).length
- }, te.contains = function (e, t) {
- return (e.ownerDocument || e) !== w && d(e),
- h(e, t)
- }, te.attr = function (e, t) {
- var n;
- return (e.ownerDocument || e) !== w && d(e),
- m || (t = t.toLowerCase()),
- (n = O.attrHandle[t]) ? n(e) : m || y.attributes ? e.getAttribute(t) : ((n = e.getAttributeNode(t)) || e.getAttribute(t)) && !0 === e[t] ? t : n && n.specified ? n.value : null
- }, te.error = function (e) {
- throw Error('Syntax error, unrecognized expression: ' + e)
- }, te.uniqueSort = function (e) {
- var t,
- n = [
- ],
- a = 1,
- r = 0;
- if (c = !y.detectDuplicates, e.sort(s), c) {
- for (; t = e[a]; a++) t === e[a - 1] && (r = n.push(a));
- for (; r--; ) e.splice(n[r], 1)
- }
- return e
- }, o = te.getText = function (e) {
- var t,
- n = '',
- a = 0,
- r = e.nodeType;
- if (r) {
- if (1 === r || 9 === r || 11 === r) {
- if ('string' == typeof e.textContent) return e.textContent;
- for (e = e.firstChild; e; e = e.nextSibling) n += o(e)
- } else if (3 === r || 4 === r) return e.nodeValue
- } else for (; t = e[a]; a++) n += o(t);
- return n
- }, O = te.selectors = {
- cacheLength: 50,
- createPseudo: X,
- match: B,
- find: {
- },
- relative: {
- '>': {
- dir: 'parentNode',
- first: !0
- },
- ' ': {
- dir: 'parentNode'
- },
- '+': {
- dir: 'previousSibling',
- first: !0
- },
- '~': {
- dir: 'previousSibling'
- }
- },
- preFilter: {
- ATTR: function (e) {
- return e[1] = e[1].replace(K, J),
- e[3] = (e[4] || e[5] || '').replace(K, J),
- '~=' === e[2] && (e[3] = ' ' + e[3] + ' '),
- e.slice(0, 4)
- },
- CHILD: function (e) {
- return e[1] = e[1].toLowerCase(),
- 'nth' === e[1].slice(0, 3) ? (e[3] || te.error(e[0]), e[4] = + (e[4] ? e[5] + (e[6] || 1) : 2 * ('even' === e[3] || 'odd' === e[3])), e[5] = + (e[7] + e[8] || 'odd' === e[3])) : e[3] && te.error(e[0]),
- e
- },
- PSEUDO: function (e) {
- var t,
- n = !e[5] && e[2];
- return B.CHILD.test(e[0]) ? null : (e[4] ? e[2] = e[4] : n && U.test(n) && (t = re(n, !0)) && (t = n.indexOf(')', n.length - t) - n.length) && (e[0] = e[0].slice(0, t), e[2] = n.slice(0, t)), e.slice(0, 3))
- }
- },
- filter: {
- TAG: function (t) {
- return '*' === t ? function () {
- return !0
- }
- : (t = t.replace(K, J).toLowerCase(), function (e) {
- return e.nodeName && e.nodeName.toLowerCase() === t
- })
- },
- CLASS: function (e) {
- var t = l[e + ' '];
- return t || (t = RegExp('(^|' + D + ')' + e + '(' + D + '|$)')) && l(e, function (e) {
- return t.test(e.className || typeof e.getAttribute != k && e.getAttribute('class') || '')
- })
- },
- ATTR: function (t, n, a) {
- return function (e) {
- e = te.attr(e, t);
- return null == e ? '!=' === n : !n || (e += '', '=' === n ? e === a : '!=' === n ? e !== a : '^=' === n ? a && 0 == e.indexOf(a) : '*=' === n ? a && !!~e.indexOf(a) : '$=' === n ? a && e.slice( - a.length) === a : '~=' === n ? !!~(' ' + e + ' ').indexOf(a) : '|=' === n && (e === a || e.slice(0, a.length + 1) === a + '-'))
- }
- },
- CHILD: function (m, e, t, f, h) {
- var g = 'nth' !== m.slice(0, 3),
- y = 'last' !== m.slice( - 4),
- b = 'of-type' === e;
- return 1 === f && 0 === h ? function (e) {
- return !!e.parentNode
- }
- : function (e, t, n) {
- var a,
- r,
- o,
- i,
- s,
- l,
- c = g != y ? 'nextSibling' : 'previousSibling',
- u = e.parentNode,
- p = b && e.nodeName.toLowerCase(),
- d = !n && !b;
- if (u) {
- if (g) {
- for (; c; ) {
- for (o = e; o = o[c]; ) if (b ? o.nodeName.toLowerCase() === p : 1 === o.nodeType) return !1;
- l = c = 'only' === m && !l && 'nextSibling'
- }
- return !0
- }
- if (l = [
- y ? u.firstChild : u.lastChild
- ], y && d) {
- for (i = (a = (r = u[v] || (u[v] = {
- })) [m] || [
- ]) [0] === P && a[2], o = (s = a[0] === P && a[1]) && u.childNodes[s]; o = ++s && o && o[c] || (i = s = 0) || l.pop(); ) if (1 === o.nodeType && ++i && o === e) {
- r[m] = [
- P,
- s,
- i
- ];
- break
- }
- } else if (d && (a = (e[v] || (e[v] = {
- })) [m]) && a[0] === P) i = a[1];
- else for (; (o = ++s && o && o[c] || (i = s = 0) || l.pop()) && ((b ? o.nodeName.toLowerCase() !== p : 1 !== o.nodeType) || !++i || (d && ((o[v] || (o[v] = {
- })) [m] = [
- P,
- i
- ]), o !== e)); );
- return (i -= h) === f || i % f == 0 && 0 <= i / f
- }
- }
- },
- PSEUDO: function (e, o) {
- var t,
- i = O.pseudos[e] || O.setFilters[e.toLowerCase()] || te.error('unsupported pseudo: ' + e);
- return i[v] ? i(o) : 1 < i.length ? (t = [
- e,
- e,
- '',
- o
- ], O.setFilters.hasOwnProperty(e.toLowerCase()) ? X(function (e, t) {
- for (var n, a = i(e, o), r = a.length; r--; ) e[n = A.call(e, a[r])] = !(t[n] = a[r])
- }) : function (e) {
- return i(e, 0, t)
- }) : i
- }
- },
- pseudos: {
- not: X(function (e) {
- var a = [
- ],
- r = [
- ],
- s = p(e.replace(q, '$1'));
- return s[v] ? X(function (e, t, n, a) {
- for (var r, o = s(e, null, a, [
- ]), i = e.length; i--; ) (r = o[i]) && (e[i] = !(t[i] = r))
- }) : function (e, t, n) {
- return a[0] = e,
- s(a, null, n, r),
- !r.pop()
- }
- }),
- has: X(function (t) {
- return function (e) {
- return 0 < te(t, e).length
- }
- }),
- contains: X(function (t) {
- return function (e) {
- return !!~(e.textContent || e.innerText || o(e)).indexOf(t)
- }
- }),
- lang: X(function (n) {
- return M.test(n || '') || te.error('unsupported lang: ' + n),
- n = n.replace(K, J).toLowerCase(),
- function (e) {
- var t;
- do {
- if (t = m ? e.getAttribute('xml:lang') || e.getAttribute('lang') : e.lang) return (t = t.toLowerCase()) === n || 0 == t.indexOf(n + '-')
- } while ((e = e.parentNode) && 1 === e.nodeType);
- return !1
- }
- }),
- target: function (e) {
- var t = n.location && n.location.hash;
- return t && t.slice(1) === e.id
- },
- root: function (e) {
- return e === a
- },
- focus: function (e) {
- return e === w.activeElement && (!w.hasFocus || w.hasFocus()) && !!(e.type || e.href || ~e.tabIndex)
- },
- enabled: function (e) {
- return !1 === e.disabled
- },
- disabled: function (e) {
- return !0 === e.disabled
- },
- checked: function (e) {
- var t = e.nodeName.toLowerCase();
- return 'input' == t && !!e.checked || 'option' == t && !!e.selected
- },
- selected: function (e) {
- return !0 === e.selected
- },
- empty: function (e) {
- for (e = e.firstChild; e; e = e.nextSibling) if ('@' < e.nodeName || 3 === e.nodeType || 4 === e.nodeType) return !1;
- return !0
- },
- parent: function (e) {
- return !O.pseudos.empty(e)
- },
- header: function (e) {
- return W.test(e.nodeName)
- },
- input: function (e) {
- return V.test(e.nodeName)
- },
- button: function (e) {
- var t = e.nodeName.toLowerCase();
- return 'input' == t && 'button' === e.type || 'button' == t
- },
- text: function (e) {
- var t;
- return 'input' == e.nodeName.toLowerCase() && 'text' === e.type && (null == (t = e.getAttribute('type')) || t.toLowerCase() === e.type)
- },
- first: ae(function () {
- return [0]
- }),
- last: ae(function (e, t) {
- return [t - 1]
- }),
- eq: ae(function (e, t, n) {
- return [n < 0 ? n + t : n]
- }),
- even: ae(function (e, t) {
- for (var n = 0; n < t; n += 2) e.push(n);
- return e
- }),
- odd: ae(function (e, t) {
- for (var n = 1; n < t; n += 2) e.push(n);
- return e
- }),
- lt: ae(function (e, t, n) {
- for (var a = n < 0 ? n + t : n; 0 <= --a; ) e.push(a);
- return e
- }),
- gt: ae(function (e, t, n) {
- for (var a = n < 0 ? n + t : n; ++a < t; ) e.push(a);
- return e
- })
- }
- }, {
- radio: !0,
- checkbox: !0,
- file: !0,
- password: !0,
- image: !0
- }) O.pseudos[e] = function (t) {
- return function (e) {
- return 'input' == e.nodeName.toLowerCase() && e.type === t
- }
- }(e);
- for (e in {
- submit: !0,
- reset: !0
- }) O.pseudos[e] = function (n) {
- return function (e) {
- var t = e.nodeName.toLowerCase();
- return ('input' == t || 'button' == t) && e.type === n
- }
- }(e);
- function re(e, t) {
- var n,
- a,
- r,
- o,
- i,
- s,
- l,
- c = u[e + ' '];
- if (c) return t ? 0 : c.slice(0);
- for (i = e, s = [
- ], l = O.preFilter; i; ) {
- for (o in n && !(a = F.exec(i)) || (a && (i = i.slice(a[0].length) || i), s.push(r = [
- ])), n = !1, (a = L.exec(i)) && (n = a.shift(), r.push({
- value: n,
- type: a[0].replace(q, ' ')
- }), i = i.slice(n.length)), O.filter) !(a = B[o].exec(i)) || l[o] && !(a = l[o](a)) || (n = a.shift(), r.push({
- value: n,
- type: o,
- matches: a
- }), i = i.slice(n.length));
- if (!n) break
- }
- return t ? i.length : i ? te.error(e) : u(e, s).slice(0)
- }
- function oe(e) {
- for (var t = 0, n = e.length, a = ''; t < n; t++) a += e[t].value;
- return a
- }
- function ie(s, e, t) {
- var l = e.dir,
- c = t && 'parentNode' === l,
- u = b++;
- return e.first ? function (e, t, n) {
- for (; e = e[l]; ) if (1 === e.nodeType || c) return s(e, t, n)
- }
- : function (e, t, n) {
- var a,
- r,
- o,
- i = P + ' ' + u;
- if (n) {
- for (; e = e[l]; ) if ((1 === e.nodeType || c) && s(e, t, n)) return !0
- } else for (; e = e[l]; ) if (1 === e.nodeType || c) if ((r = (o = e[v] || (e[v] = {
- })) [l]) && r[0] === i) {
- if (!0 === (a = r[1]) || a === E) return !0 === a
- } else if ((r = o[l] = [
- i
- ]) [1] = s(e, t, n) || E, !0 === r[1]) return !0
- }
- }
- function se(r) {
- return 1 < r.length ? function (e, t, n) {
- for (var a = r.length; a--; ) if (!r[a](e, t, n)) return !1;
- return !0
- }
- : r[0]
- }
- function le(e, t, n, a, r) {
- for (var o, i = [
- ], s = 0, l = e.length, c = null != t; s < l; s++) (o = e[s]) && (n && !n(o, a, r) || (i.push(o), c && t.push(s)));
- return i
- }
- function ce(m, f, h, g, y, e) {
- return g && !g[v] && (g = ce(g)),
- y && !y[v] && (y = ce(y, e)),
- X(function (e, t, n, a) {
- var r,
- o,
- i,
- s = [
- ],
- l = [
- ],
- c = t.length,
- u = e || function (e, t, n) {
- for (var a = 0, r = t.length; a < r; a++) te(e, t[a], n);
- return n
- }(f || '*', n.nodeType ? [
- n
- ] : n, [
- ]),
- p = !m || !e && f ? u : le(u, s, m, n, a),
- d = h ? y || (e ? m : c || g) ? [
- ] : t : p;
- if (h && h(p, d, n, a), g) for (r = le(d, l), g(r, [
- ], n, a), o = r.length; o--; ) (i = r[o]) && (d[l[o]] = !(p[l[o]] = i));
- if (e) {
- if (y || m) {
- if (y) {
- for (r = [
- ], o = d.length; o--; ) (i = d[o]) && r.push(p[o] = i);
- y(null, d = [
- ], r, a)
- }
- for (o = d.length; o--; ) (i = d[o]) && - 1 < (r = y ? A.call(e, i) : s[o]) && (e[r] = !(t[r] = i))
- }
- } else d = le(d === t ? d.splice(c, d.length) : d),
- y ? y(null, t, d, a) : R.apply(t, d)
- })
- }
- function ue(g, y) {
- function e(e, t, n, a, r) {
- var o,
- i,
- s,
- l = [
- ],
- c = 0,
- u = '0',
- p = e && [
- ],
- d = null != r,
- m = S,
- f = e || _ && O.find.TAG('*', r && t.parentNode || t),
- h = P += null == m ? 1 : Math.random() || 0.1;
- for (d && (S = t !== w && t, E = b); null != (o = f[u]); u++) {
- if (_ && o) {
- for (i = 0; s = g[i++]; ) if (s(o, t, n)) {
- a.push(o);
- break
- }
- d && (P = h, E = ++b)
- }
- v && ((o = !s && o) && c--, e && p.push(o))
- }
- if (c += u, v && u !== c) {
- for (i = 0; s = y[i++]; ) s(p, l, t, n);
- if (e) {
- if (0 < c) for (; u--; ) p[u] || l[u] || (l[u] = C.call(a));
- l = le(l)
- }
- R.apply(a, l),
- d && !e && 0 < l.length && 1 < c + y.length && te.uniqueSort(a)
- }
- return d && (P = h, S = m),
- p
- }
- var b = 0,
- v = 0 < y.length,
- _ = 0 < g.length;
- return v ? X(e) : e
- }
- function pe() {
- }
- p = te.compile = function (e, t) {
- var n,
- a = [
- ],
- r = [
- ],
- o = _[e + ' '];
- if (!o) {
- for (n = (t = t || re(e)).length; n--; ) ((o = function e(t) {
- for (var a, n, r, o = t.length, i = O.relative[t[0].type], s = i || O.relative[' '], l = i ? 1 : 0, c = ie(function (e) {
- return e === a
- }, s, !0), u = ie(function (e) {
- return - 1 < A.call(a, e)
- }, s, !0), p = [
- function (e, t, n) {
- return !i && (n || t !== S) || ((a = t).nodeType ? c : u) (e, t, n)
- }
- ]; l < o; l++) if (n = O.relative[t[l].type]) p = [
- ie(se(p), n)
- ];
- else {
- if ((n = O.filter[t[l].type].apply(null, t[l].matches)) [v]) {
- for (r = ++l; r < o && !O.relative[t[r].type]; r++);
- return ce(1 < l && se(p), 1 < l && oe(t.slice(0, l - 1)).replace(q, '$1'), n, l < r && e(t.slice(l, r)), r < o && e(t = t.slice(r)), r < o && oe(t))
- }
- p.push(n)
- }
- return se(p)
- }(t[n])) [v] ? a : r).push(o);
- o = _(e, ue(r, a))
- }
- return o
- },
- O.pseudos.nth = O.pseudos.eq,
- O.filters = pe.prototype = O.pseudos,
- O.setFilters = new pe,
- d(),
- te.attr = de.attr,
- de.find = te,
- de.expr = te.selectors,
- de.expr[':'] = de.expr.pseudos,
- de.unique = te.uniqueSort,
- de.text = te.getText,
- de.isXMLDoc = te.isXML,
- de.contains = te.contains
- }(f);
- var ae = /Until$/,
- re = /^(?:parents|prev(?:Until|All))/,
- oe = /^.[^:#\[\.,]*$/,
- ie = de.expr.match.needsContext,
- se = {
- children: !0,
- contents: !0,
- next: !0,
- prev: !0
- };
- function le(e, t) {
- for (; (e = e[t]) && 1 !== e.nodeType; );
- return e
- }
- function ce(e, n, a) {
- if (de.isFunction(n = n || 0)) return de.grep(e, function (e, t) {
- return !!n.call(e, t, e) === a
- });
- if (n.nodeType) return de.grep(e, function (e) {
- return e === n === a
- });
- if ('string' == typeof n) {
- var t = de.grep(e, function (e) {
- return 1 === e.nodeType
- });
- if (oe.test(n)) return de.filter(n, t, !a);
- n = de.filter(n, t)
- }
- return de.grep(e, function (e) {
- return 0 <= de.inArray(e, n) === a
- })
- }
- function ue(e) {
- var t = pe.split('|'),
- n = e.createDocumentFragment();
- if (n.createElement) for (; t.length; ) n.createElement(t.pop());
- return n
- }
- de.fn.extend({
- find: function (e) {
- var t,
- n,
- a,
- r = this.length;
- if ('string' != typeof e) return (a = this).pushStack(de(e).filter(function () {
- for (t = 0; t < r; t++) if (de.contains(a[t], this)) return !0
- }));
- for (n = [
- ], t = 0; t < r; t++) de.find(e, this[t], n);
- return (n = this.pushStack(1 < r ? de.unique(n) : n)).selector = (this.selector ? this.selector + ' ' : '') + e,
- n
- },
- has: function (e) {
- var t,
- n = de(e, this),
- a = n.length;
- return this.filter(function () {
- for (t = 0; t < a; t++) if (de.contains(this, n[t])) return !0
- })
- },
- not: function (e) {
- return this.pushStack(ce(this, e, !1))
- },
- filter: function (e) {
- return this.pushStack(ce(this, e, !0))
- },
- is: function (e) {
- return !!e && ('string' == typeof e ? ie.test(e) ? 0 <= de(e, this.context).index(this[0]) : 0 < de.filter(e, this).length : 0 < this.filter(e).length)
- },
- closest: function (e, t) {
- for (var n, a = 0, r = this.length, o = [
- ], i = ie.test(e) || 'string' != typeof e ? de(e, t || this.context) : 0; a < r; a++) for (n = this[a]; n && n.ownerDocument && n !== t && 11 !== n.nodeType; ) {
- if (i ? - 1 < i.index(n) : de.find.matchesSelector(n, e)) {
- o.push(n);
- break
- }
- n = n.parentNode
- }
- return this.pushStack(1 < o.length ? de.unique(o) : o)
- },
- index: function (e) {
- return e ? 'string' == typeof e ? de.inArray(this[0], de(e)) : de.inArray(e.jquery ? e[0] : e, this) : this[0] && this[0].parentNode ? this.first().prevAll().length : - 1
- },
- add: function (e, t) {
- e = 'string' == typeof e ? de(e, t) : de.makeArray(e && e.nodeType ? [
- e
- ] : e),
- e = de.merge(this.get(), e);
- return this.pushStack(de.unique(e))
- },
- addBack: function (e) {
- return this.add(null == e ? this.prevObject : this.prevObject.filter(e))
- }
- }),
- de.fn.andSelf = de.fn.addBack,
- de.each({
- parent: function (e) {
- e = e.parentNode;
- return e && 11 !== e.nodeType ? e : null
- },
- parents: function (e) {
- return de.dir(e, 'parentNode')
- },
- parentsUntil: function (e, t, n) {
- return de.dir(e, 'parentNode', n)
- },
- next: function (e) {
- return le(e, 'nextSibling')
- },
- prev: function (e) {
- return le(e, 'previousSibling')
- },
- nextAll: function (e) {
- return de.dir(e, 'nextSibling')
- },
- prevAll: function (e) {
- return de.dir(e, 'previousSibling')
- },
- nextUntil: function (e, t, n) {
- return de.dir(e, 'nextSibling', n)
- },
- prevUntil: function (e, t, n) {
- return de.dir(e, 'previousSibling', n)
- },
- siblings: function (e) {
- return de.sibling((e.parentNode || {
- }).firstChild, e)
- },
- children: function (e) {
- return de.sibling(e.firstChild)
- },
- contents: function (e) {
- return de.nodeName(e, 'iframe') ? e.contentDocument || e.contentWindow.document : de.merge([], e.childNodes)
- }
- }, function (a, r) {
- de.fn[a] = function (e, t) {
- var n = de.map(this, r, e);
- return (t = !ae.test(a) ? e : t) && 'string' == typeof t && (n = de.filter(t, n)),
- n = 1 < this.length && !se[a] ? de.unique(n) : n,
- 1 < this.length && re.test(a) && (n = n.reverse()),
- this.pushStack(n)
- }
- }),
- de.extend({
- filter: function (e, t, n) {
- return n && (e = ':not(' + e + ')'),
- 1 === t.length ? de.find.matchesSelector(t[0], e) ? [
- t[0]
- ] : [
- ] : de.find.matches(e, t)
- },
- dir: function (e, t, n) {
- for (var a = [
- ], r = e[t]; r && 9 !== r.nodeType && (n === O || 1 !== r.nodeType || !de(r).is(n)); ) 1 === r.nodeType && a.push(r),
- r = r[t];
- return a
- },
- sibling: function (e, t) {
- for (var n = [
- ]; e; e = e.nextSibling) 1 === e.nodeType && e !== t && n.push(e);
- return n
- }
- });
- var pe = 'abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video',
- me = / jQuery\d+="(?:null|\d+)"/g,
- fe = RegExp('<(?:' + pe + ')[\\s/>]', 'i'),
- he = /^\s+/,
- ge = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,
- ye = /<([\w:]+)/,
- be = /<tbody/i,
- ve = /<|&#?\w+;/,
- _e = /<(?:script|style|link)/i,
- Ee = /^(?:checkbox|radio)$/i,
- Oe = /checked\s*(?:[^=]|=\s*.checked.)/i,
- Se = /^$|\/(?:java|ecma)script/i,
- we = /^true\/(.*)/,
- Pe = /^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,
- ke = {
- option: [
- 1,
- '<select multiple=\'multiple\'>',
- '</select>'
- ],
- legend: [
- 1,
- '<fieldset>',
- '</fieldset>'
- ],
- area: [
- 1,
- '<map>',
- '</map>'
- ],
- param: [
- 1,
- '<object>',
- '</object>'
- ],
- thead: [
- 1,
- '<table>',
- '</table>'
- ],
- tr: [
- 2,
- '<table><tbody>',
- '</tbody></table>'
- ],
- col: [
- 2,
- '<table><tbody></tbody><colgroup>',
- '</colgroup></table>'
- ],
- td: [
- 3,
- '<table><tbody><tr>',
- '</tr></tbody></table>'
- ],
- _default: de.support.htmlSerialize ? [
- 0,
- '',
- ''
- ] : [
- 1,
- 'X<div>',
- '</div>'
- ]
- },
- Ne = ue(g).appendChild(g.createElement('div'));
- function Ce(e) {
- var t = e.getAttributeNode('type');
- return e.type = (t && t.specified) + '/' + e.type,
- e
- }
- function Re(e) {
- var t = we.exec(e.type);
- return t ? e.type = t[1] : e.removeAttribute('type'),
- e
- }
- function xe(e, t) {
- for (var n, a = 0; null != (n = e[a]); a++) de._data(n, 'globalEval', !t || de._data(t[a], 'globalEval'))
- }
- function Ae(e, t) {
- if (1 === t.nodeType && de.hasData(e)) {
- var n,
- a,
- r,
- o = de._data(e),
- e = de._data(t, o),
- i = o.events;
- if (i) for (n in delete e.handle, e.events = {
- }, i) for (a = 0, r = i[n].length; a < r; a++) de.event.add(t, n, i[n][a]);
- e.data && (e.data = de.extend({
- }, e.data))
- }
- }
- function De(e, t) {
- var n,
- a,
- r = 0,
- o = typeof e.getElementsByTagName !== h ? e.getElementsByTagName(t || '*') : typeof e.querySelectorAll !== h ? e.querySelectorAll(t || '*') : O;
- if (!o) for (o = [
- ], n = e.childNodes || e; null != (a = n[r]); r++) !t || de.nodeName(a, t) ? o.push(a) : de.merge(o, De(a, t));
- return t === O || t && de.nodeName(e, t) ? de.merge([e], o) : o
- }
- function je(e) {
- Ee.test(e.type) && (e.defaultChecked = e.checked)
- }
- ke.optgroup = ke.option,
- ke.tbody = ke.tfoot = ke.colgroup = ke.caption = ke.thead,
- ke.th = ke.td,
- de.fn.extend({
- text: function (e) {
- return de.access(this, function (e) {
- return e === O ? de.text(this) : this.empty().append((this[0] && this[0].ownerDocument || g).createTextNode(e))
- }, null, e, arguments.length)
- },
- wrapAll: function (t) {
- return de.isFunction(t) ? this.each(function (e) {
- de(this).wrapAll(t.call(this, e))
- }) : (this[0] && (e = de(t, this[0].ownerDocument).eq(0).clone(!0), this[0].parentNode && e.insertBefore(this[0]), e.map(function () {
- for (var e = this; e.firstChild && 1 === e.firstChild.nodeType; ) e = e.firstChild;
- return e
- }).append(this)), this);
- var e
- },
- wrapInner: function (n) {
- return de.isFunction(n) ? this.each(function (e) {
- de(this).wrapInner(n.call(this, e))
- }) : this.each(function () {
- var e = de(this),
- t = e.contents();
- t.length ? t.wrapAll(n) : e.append(n)
- })
- },
- wrap: function (t) {
- var n = de.isFunction(t);
- return this.each(function (e) {
- de(this).wrapAll(n ? t.call(this, e) : t)
- })
- },
- unwrap: function () {
- return this.parent().each(function () {
- de.nodeName(this, 'body') || de(this).replaceWith(this.childNodes)
- }).end()
- },
- append: function () {
- return this.domManip(arguments, !0, function (e) {
- 1 !== this.nodeType && 11 !== this.nodeType && 9 !== this.nodeType || this.appendChild(e)
- })
- },
- prepend: function () {
- return this.domManip(arguments, !0, function (e) {
- 1 !== this.nodeType && 11 !== this.nodeType && 9 !== this.nodeType || this.insertBefore(e, this.firstChild)
- })
- },
- before: function () {
- return this.domManip(arguments, !1, function (e) {
- this.parentNode && this.parentNode.insertBefore(e, this)
- })
- },
- after: function () {
- return this.domManip(arguments, !1, function (e) {
- this.parentNode && this.parentNode.insertBefore(e, this.nextSibling)
- })
- },
- remove: function (e, t) {
- for (var n, a = 0; null != (n = this[a]); a++) (!e || 0 < de.filter(e, [
- n
- ]).length) && (t || 1 !== n.nodeType || de.cleanData(De(n)), n.parentNode && (t && de.contains(n.ownerDocument, n) && xe(De(n, 'script')), n.parentNode.removeChild(n)));
- return this
- },
- empty: function () {
- for (var e, t = 0; null != (e = this[t]); t++) {
- for (1 === e.nodeType && de.cleanData(De(e, !1)); e.firstChild; ) e.removeChild(e.firstChild);
- e.options && de.nodeName(e, 'select') && (e.options.length = 0)
- }
- return this
- },
- clone: function (e, t) {
- return e = null != e && e,
- t = null == t ? e : t,
- this.map(function () {
- return de.clone(this, e, t)
- })
- },
- html: function (e) {
- return de.access(this, function (e) {
- var t = this[0] || {
- },
- n = 0,
- a = this.length;
- if (e === O) return 1 === t.nodeType ? t.innerHTML.replace(me, '') : O;
- if ('string' == typeof e && !_e.test(e) && (de.support.htmlSerialize || !fe.test(e)) && (de.support.leadingWhitespace || !he.test(e)) && !ke[(ye.exec(e) || [
- '',
- ''
- ]) [1].toLowerCase()]) {
- e = e.replace(ge, '<$1></$2>');
- try {
- for (; n < a; n++) 1 === (t = this[n] || {
- }).nodeType && (de.cleanData(De(t, !1)), t.innerHTML = e);
- t = 0
- } catch (e) {
- }
- }
- t && this.empty().append(e)
- }, null, e, arguments.length)
- },
- replaceWith: function (e) {
- return de.isFunction(e) || 'string' == typeof e || (e = de(e).not(this).detach()),
- this.domManip([e], !0, function (e) {
- var t = this.nextSibling,
- n = this.parentNode;
- n && (de(this).remove(), n.insertBefore(e, t))
- })
- },
- detach: function (e) {
- return this.remove(e, !0)
- },
- domManip: function (n, a, r) {
- n = y.apply([], n);
- var e,
- t,
- o,
- i,
- s,
- l,
- c,
- u,
- p = 0,
- d = this.length,
- m = this,
- f = d - 1,
- h = n[0],
- g = de.isFunction(h);
- if (g || !(d <= 1 || 'string' != typeof h || de.support.checkClone) && Oe.test(h)) return this.each(function (e) {
- var t = m.eq(e);
- g && (n[0] = h.call(this, e, a ? t.html() : O)),
- t.domManip(n, a, r)
- });
- if (d && (e = (l = de.buildFragment(n, this[0].ownerDocument, !1, this)).firstChild, 1 === l.childNodes.length && (l = e), e)) {
- for (a = a && de.nodeName(e, 'tr'), o = (i = de.map(De(l, 'script'), Ce)).length; p < d; p++) t = l,
- p !== f && (t = de.clone(t, !0, !0), o && de.merge(i, De(t, 'script'))),
- r.call(a && de.nodeName(this[p], 'table') ? (c = this[p]).getElementsByTagName(u = 'tbody') [0] || c.appendChild(c.ownerDocument.createElement(u)) : this[p], t, p);
- if (o) for (s = i[i.length - 1].ownerDocument, de.map(i, Re), p = 0; p < o; p++) Se.test((t = i[p]).type || '') && !de._data(t, 'globalEval') && de.contains(s, t) && (t.src ? de.ajax({
- url: t.src,
- type: 'GET',
- dataType: 'script',
- async: !1,
- global: !1,
- throws: !0
- }) : de.globalEval((t.text || t.textContent || t.innerHTML || '').replace(Pe, '')));
- l = e = null
- }
- return this
- }
- }),
- de.each({
- appendTo: 'append',
- prependTo: 'prepend',
- insertBefore: 'before',
- insertAfter: 'after',
- replaceAll: 'replaceWith'
- }, function (e, i) {
- de.fn[e] = function (e) {
- for (var t, n = 0, a = [
- ], r = de(e), o = r.length - 1; n <= o; n++) t = n === o ? this : this.clone(!0),
- de(r[n]) [i](t),
- s.apply(a, t.get());
- return this.pushStack(a)
- }
- }),
- de.extend({
- clone: function (e, t, n) {
- var a,
- r,
- o,
- i,
- s,
- l = de.contains(e.ownerDocument, e);
- if (de.support.html5Clone || de.isXMLDoc(e) || !fe.test('<' + e.nodeName + '>') ? o = e.cloneNode(!0) : (Ne.innerHTML = e.outerHTML, Ne.removeChild(o = Ne.firstChild)), !(de.support.noCloneEvent && de.support.noCloneChecked || 1 !== e.nodeType && 11 !== e.nodeType || de.isXMLDoc(e))) for (a = De(o), s = De(e), i = 0; null != (r = s[i]); ++i) a[i] && function (e, t) {
- var n,
- a,
- r;
- if (1 === t.nodeType) {
- if (n = t.nodeName.toLowerCase(), !de.support.noCloneEvent && t[de.expando]) {
- for (a in (r = de._data(t)).events) de.removeEvent(t, a, r.handle);
- t.removeAttribute(de.expando)
- }
- 'script' == n && t.text !== e.text ? (Ce(t).text = e.text, Re(t)) : 'object' == n ? (t.parentNode && (t.outerHTML = e.outerHTML), de.support.html5Clone && e.innerHTML && !de.trim(t.innerHTML) && (t.innerHTML = e.innerHTML)) : 'input' == n && Ee.test(e.type) ? (t.defaultChecked = t.checked = e.checked, t.value !== e.value && (t.value = e.value)) : 'option' == n ? t.defaultSelected = t.selected = e.defaultSelected : 'input' != n && 'textarea' != n || (t.defaultValue = e.defaultValue)
- }
- }(r, a[i]);
- if (t) if (n) for (s = s || De(e), a = a || De(o), i = 0; null != (r = s[i]); i++) Ae(r, a[i]);
- else Ae(e, o);
- return 0 < (a = De(o, 'script')).length && xe(a, !l && De(e, 'script')),
- a = s = r = null,
- o
- },
- buildFragment: function (e, t, n, a) {
- for (var r, o, i, s, l, c, u, p = e.length, d = ue(t), m = [
- ], f = 0; f < p; f++) if ((o = e[f]) || 0 === o) if ('object' === de.type(o)) de.merge(m, o.nodeType ? [
- o
- ] : o);
- else if (ve.test(o)) {
- for (s = s || d.appendChild(t.createElement('div')), l = (ye.exec(o) || [
- '',
- ''
- ]) [1].toLowerCase(), s.innerHTML = (u = ke[l] || ke._default) [1] + o.replace(ge, '<$1></$2>') + u[2], r = u[0]; r--; ) s = s.lastChild;
- if (!de.support.leadingWhitespace && he.test(o) && m.push(t.createTextNode(he.exec(o) [0])), !de.support.tbody) for (r = (o = 'table' != l || be.test(o) ? '<table>' !== u[1] || be.test(o) ? 0 : s : s.firstChild) && o.childNodes.length; r--; ) de.nodeName(c = o.childNodes[r], 'tbody') && !c.childNodes.length && o.removeChild(c);
- for (de.merge(m, s.childNodes), s.textContent = ''; s.firstChild; ) s.removeChild(s.firstChild);
- s = d.lastChild
- } else m.push(t.createTextNode(o));
- for (s && d.removeChild(s), de.support.appendChecked || de.grep(De(m, 'input'), je), f = 0; o = m[f++]; ) if ((!a || - 1 === de.inArray(o, a)) && (i = de.contains(o.ownerDocument, o), s = De(d.appendChild(o), 'script'), i && xe(s), n)) for (r = 0; o = s[r++]; ) Se.test(o.type || '') && n.push(o);
- return s = null,
- d
- },
- cleanData: function (e, t) {
- for (var n, a, r, o, i = 0, s = de.expando, l = de.cache, c = de.support.deleteExpando, u = de.event.special; null != (n = e[i]); i++) if ((t || de.acceptData(n)) && (o = (r = n[s]) && l[r])) {
- if (o.events) for (a in o.events) u[a] ? de.event.remove(n, a) : de.removeEvent(n, a, o.handle);
- l[r] && (delete l[r], c ? delete n[s] : typeof n.removeAttribute !== h ? n.removeAttribute(s) : n[s] = null, p.push(r))
- }
- }
- });
- var Te,
- Ie,
- qe,
- Fe = /alpha\([^)]*\)/i,
- Le = /opacity\s*=\s*([^)]*)/,
- Ue = /^(top|right|bottom|left)$/,
- Me = /^(none|table(?!-c[ea]).+)/,
- Be = /^margin/,
- ze = RegExp('^(' + m + ')(.*)$', 'i'),
- He = RegExp('^(' + m + ')(?!px)[a-z%]+$', 'i'),
- Ge = RegExp('^([+-])=(' + m + ')', 'i'),
- Ve = {
- BODY: 'block'
- },
- We = {
- position: 'absolute',
- visibility: 'hidden',
- display: 'block'
- },
- Ye = {
- letterSpacing: 0,
- fontWeight: 400
- },
- Qe = [
- 'Top',
- 'Right',
- 'Bottom',
- 'Left'
- ],
- Ke = [
- 'Webkit',
- 'O',
- 'Moz',
- 'ms'
- ];
- function Je(e, t) {
- if (t in e) return t;
- for (var n = (t[0] || '').toUpperCase() + t.slice(1), a = t, r = 4; r--; ) if ((t = Ke[r] + n) in e) return t;
- return a
- }
- function $e(e, t) {
- return 'none' === de.css(e = t || e, 'display') || !de.contains(e.ownerDocument, e)
- }
- function Ze(e, t) {
- for (var n, a, r, o = [
- ], i = 0, s = e.length; i < s; i++) (a = e[i]).style && (o[i] = de._data(a, 'olddisplay'), n = a.style.display, t ? (o[i] || 'none' !== n || (a.style.display = ''), '' === a.style.display && $e(a) && (o[i] = de._data(a, 'olddisplay', nt(a.nodeName)))) : o[i] || (r = $e(a), (n && 'none' !== n || !r) && de._data(a, 'olddisplay', r ? n : de.css(a, 'display'))));
- for (i = 0; i < s; i++) (a = e[i]).style && (t && 'none' !== a.style.display && '' !== a.style.display || (a.style.display = t ? o[i] || '' : 'none'));
- return e
- }
- function Xe(e, t, n) {
- var a = ze.exec(t);
- return a ? Math.max(0, a[1] - (n || 0)) + (a[2] || 'px') : t
- }
- function et(e, t, n, a, r) {
- for (var o = n === (a ? 'border' : 'content') ? 4 : 'width' === t ? 1 : 0, i = 0; o < 4; o += 2) 'margin' === n && (i += de.css(e, n + Qe[o], !0, r)),
- a ? ('content' === n && (i -= de.css(e, 'padding' + Qe[o], !0, r)), 'margin' !== n && (i -= de.css(e, 'border' + Qe[o] + 'Width', !0, r))) : (i += de.css(e, 'padding' + Qe[o], !0, r), 'padding' !== n && (i += de.css(e, 'border' + Qe[o] + 'Width', !0, r)));
- return i
- }
- function tt(e, t, n) {
- var a = !0,
- r = 'width' === t ? e.offsetWidth : e.offsetHeight,
- o = Ie(e),
- i = de.support.boxSizing && 'border-box' === de.css(e, 'boxSizing', !1, o);
- if (r <= 0 || null == r) {
- if (r = qe(e, t, o), He.test(r = r < 0 || null == r ? e.style[t] : r)) return r;
- a = i && (de.support.boxSizingReliable || r === e.style[t]),
- r = parseFloat(r) || 0
- }
- return r + et(e, t, n || (i ? 'border' : 'content'), a, o) + 'px'
- }
- function nt(e) {
- var t = g,
- n = Ve[e];
- return n || ('none' !== (n = at(e, t)) && n || ((t = ((Te = (Te || de('<iframe frameborder=\'0\' width=\'0\' height=\'0\'/>').css('cssText', 'display:block !important')).appendTo(t.documentElement)) [0].contentWindow || Te[0].contentDocument).document).write('<!doctype html><html><body>'), t.close(), n = at(e, t), Te.detach()), Ve[e] = n),
- n
- }
- function at(e, t) {
- e = de(t.createElement(e)).appendTo(t.body),
- t = de.css(e[0], 'display');
- return e.remove(),
- t
- }
- de.fn.extend({
- css: function (e, t) {
- return de.access(this, function (e, t, n) {
- var a,
- r,
- o = {
- },
- i = 0;
- if (de.isArray(t)) {
- for (r = Ie(e), a = t.length; i < a; i++) o[t[i]] = de.css(e, t[i], !1, r);
- return o
- }
- return n !== O ? de.style(e, t, n) : de.css(e, t)
- }, e, t, 1 < arguments.length)
- },
- show: function () {
- return Ze(this, !0)
- },
- hide: function () {
- return Ze(this)
- },
- toggle: function (e) {
- var t = 'boolean' == typeof e;
- return this.each(function () {
- (t ? e : $e(this)) ? de(this).show() : de(this).hide()
- })
- }
- }),
- de.extend({
- cssHooks: {
- opacity: {
- get: function (e, t) {
- if (t) {
- e = qe(e, 'opacity');
- return '' === e ? '1' : e
- }
- }
- }
- },
- cssNumber: {
- columnCount: !0,
- fillOpacity: !0,
- fontWeight: !0,
- lineHeight: !0,
- opacity: !0,
- orphans: !0,
- widows: !0,
- zIndex: !0,
- zoom: !0
- },
- cssProps: {
- float: de.support.cssFloat ? 'cssFloat' : 'styleFloat'
- },
- style: function (e, t, n, a) {
- if (e && 3 !== e.nodeType && 8 !== e.nodeType && e.style) {
- var r,
- o,
- i,
- s = de.camelCase(t),
- l = e.style;
- if (t = de.cssProps[s] || (de.cssProps[s] = Je(l, s)), i = de.cssHooks[t] || de.cssHooks[s], n === O) return i && 'get' in i && (r = i.get(e, !1, a)) !== O ? r : l[t];
- if ('string' === (o = typeof n) && (r = Ge.exec(n)) && (n = (r[1] + 1) * r[2] + parseFloat(de.css(e, t)), o = 'number'), !(null == n || 'number' === o && isNaN(n) || ('number' !== o || de.cssNumber[s] || (n += 'px'), de.support.clearCloneStyle || '' !== n || t.indexOf('background') || (l[t] = 'inherit'), i && 'set' in i && (n = i.set(e, n, a)) === O))) try {
- l[t] = n
- } catch (e) {
- }
- }
- },
- css: function (e, t, n, a) {
- var r,
- o = de.camelCase(t);
- return t = de.cssProps[o] || (de.cssProps[o] = Je(e.style, o)),
- 'normal' === (r = (r = (o = de.cssHooks[t] || de.cssHooks[o]) && 'get' in o ? o.get(e, !0, n) : r) === O ? qe(e, t, a) : r) && t in Ye && (r = Ye[t]),
- '' === n || n ? (t = parseFloat(r), !0 === n || de.isNumeric(t) ? t || 0 : r) : r
- },
- swap: function (e, t, n, a) {
- var r,
- o = {
- };
- for (r in t) o[r] = e.style[r],
- e.style[r] = t[r];
- for (r in a = n.apply(e, a || [
- ]), t) e.style[r] = o[r];
- return a
- }
- }),
- f.getComputedStyle ? (Ie = function (e) {
- return f.getComputedStyle(e, null)
- }, qe = function (e, t, n) {
- var a = n || Ie(e),
- r = a ? a.getPropertyValue(t) || a[t] : O,
- o = e.style;
- return a && ('' !== r || de.contains(e.ownerDocument, e) || (r = de.style(e, t)), He.test(r) && Be.test(t) && (n = o.width, e = o.minWidth, t = o.maxWidth, o.minWidth = o.maxWidth = o.width = r, r = a.width, o.width = n, o.minWidth = e, o.maxWidth = t)),
- r
- }) : g.documentElement.currentStyle && (Ie = function (e) {
- return e.currentStyle
- }, qe = function (e, t, n) {
- var a,
- r = n || Ie(e),
- o = r ? r[t] : O,
- i = e.style;
- return He.test(o = null == o && i && i[t] ? i[t] : o) && !Ue.test(t) && (a = i.left, (r = (n = e.runtimeStyle) && n.left) && (n.left = e.currentStyle.left), i.left = 'fontSize' === t ? '1em' : o, o = i.pixelLeft + 'px', i.left = a, r && (n.left = r)),
- '' === o ? 'auto' : o
- }),
- de.each(['height',
- 'width'], function (e, r) {
- de.cssHooks[r] = {
- get: function (e, t, n) {
- if (t) return 0 === e.offsetWidth && Me.test(de.css(e, 'display')) ? de.swap(e, We, function () {
- return tt(e, r, n)
- }) : tt(e, r, n)
- },
- set: function (e, t, n) {
- var a = n && Ie(e);
- return Xe(0, t, n ? et(e, r, n, de.support.boxSizing && 'border-box' === de.css(e, 'boxSizing', !1, a), a) : 0)
- }
- }
- }),
- de.support.opacity || (de.cssHooks.opacity = {
- get: function (e, t) {
- return Le.test((t && e.currentStyle ? e.currentStyle : e.style).filter || '') ? 0.01 * parseFloat(RegExp.$1) + '' : t ? '1' : ''
- },
- set: function (e, t) {
- var n = e.style,
- a = e.currentStyle,
- r = de.isNumeric(t) ? 'alpha(opacity=' + 100 * t + ')' : '',
- e = a && a.filter || n.filter || '';
- ((n.zoom = 1) <= t || '' === t) && !de.trim(e.replace(Fe, '')) && n.removeAttribute && (n.removeAttribute('filter'), '' === t || a && !a.filter) || (n.filter = Fe.test(e) ? e.replace(Fe, r) : e + ' ' + r)
- }
- }),
- de(function () {
- de.support.reliableMarginRight || (de.cssHooks.marginRight = {
- get: function (e, t) {
- if (t) return de.swap(e, {
- display: 'inline-block'
- }, qe, [
- e,
- 'marginRight'
- ])
- }
- }),
- !de.support.pixelPosition && de.fn.position && de.each(['top',
- 'left'], function (e, n) {
- de.cssHooks[n] = {
- get: function (e, t) {
- if (t) return t = qe(e, n),
- He.test(t) ? de(e).position() [n] + 'px' : t
- }
- }
- })
- }),
- de.expr && de.expr.filters && (de.expr.filters.hidden = function (e) {
- return e.offsetWidth <= 0 && e.offsetHeight <= 0 || !de.support.reliableHiddenOffsets && 'none' === (e.style && e.style.display || de.css(e, 'display'))
- }, de.expr.filters.visible = function (e) {
- return !de.expr.filters.hidden(e)
- }),
- de.each({
- margin: '',
- padding: '',
- border: 'Width'
- }, function (r, o) {
- de.cssHooks[r + o] = {
- expand: function (e) {
- for (var t = 0, n = {
- }, a = 'string' == typeof e ? e.split(' ') : [
- e
- ]; t < 4; t++) n[r + Qe[t] + o] = a[t] || a[t - 2] || a[0];
- return n
- }
- },
- Be.test(r) || (de.cssHooks[r + o].set = Xe)
- });
- var rt = /%20/g,
- ot = /\[\]$/,
- it = /\r?\n/g,
- st = /^(?:submit|button|image|reset|file)$/i,
- lt = /^(?:input|select|textarea|keygen)/i;
- de.fn.extend({
- serialize: function () {
- return de.param(this.serializeArray())
- },
- serializeArray: function () {
- return this.map(function () {
- var e = de.prop(this, 'elements');
- return e ? de.makeArray(e) : this
- }).filter(function () {
- var e = this.type;
- return this.name && !de(this).is(':disabled') && lt.test(this.nodeName) && !st.test(e) && (this.checked || !Ee.test(e))
- }).map(function (e, t) {
- var n = de(this).val();
- return null == n ? null : de.isArray(n) ? de.map(n, function (e) {
- return {
- name: t.name,
- value: e.replace(it, '\r\n')
- }
- }) : {
- name: t.name,
- value: n.replace(it, '\r\n')
- }
- }).get()
- }
- }),
- de.param = function (e, t) {
- function n(e, t) {
- t = de.isFunction(t) ? t() : null == t ? '' : t,
- r[r.length] = encodeURIComponent(e) + '=' + encodeURIComponent(t)
- }
- var a,
- r = [
- ];
- if (t === O && (t = de.ajaxSettings && de.ajaxSettings.traditional), de.isArray(e) || e.jquery && !de.isPlainObject(e)) de.each(e, function () {
- n(this.name, this.value)
- });
- else for (a in e) !function n(a, e, r, o) {
- if (de.isArray(e)) de.each(e, function (e, t) {
- r || ot.test(a) ? o(a, t) : n(a + '[' + ('object' == typeof t ? e : '') + ']', t, r, o)
- });
- else if (r || 'object' !== de.type(e)) o(a, e);
- else for (var t in e) n(a + '[' + t + ']', e[t], r, o)
- }(a, e[a], t, n);
- return r.join('&').replace(rt, '+')
- },
- de.each('blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu'.split(' '), function (e, n) {
- de.fn[n] = function (e, t) {
- return 0 < arguments.length ? this.on(n, null, e, t) : this.trigger(n)
- }
- }),
- de.fn.hover = function (e, t) {
- return this.mouseenter(e).mouseleave(t || e)
- };
- var ct,
- ut,
- pt = de.now(),
- dt = /\?/,
- mt = /#.*$/,
- ft = /([?&])_=[^&]*/,
- ht = /^(.*?):[ \t]*([^\r\n]*)\r?$/gm,
- gt = /^(?:GET|HEAD)$/,
- yt = /^\/\//,
- bt = /^([\w.+-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,
- vt = de.fn.load,
- _t = {
- },
- Et = {
- };
- try {
- ut = e.href
- } catch (e) {
- (ut = g.createElement('a')).href = '',
- ut = ut.href
- }
- function Ot(o) {
- return function (e, t) {
- 'string' != typeof e && (t = e, e = '*');
- var n,
- a = 0,
- r = e.toLowerCase().match(S) || [
- ];
- if (de.isFunction(t)) for (; n = r[a++]; ) '+' === n[0] ? (n = n.slice(1) || '*', (o[n] = o[n] || [
- ]).unshift(t)) : (o[n] = o[n] || [
- ]).push(t)
- }
- }
- function St(t, a, r, o) {
- var i = {
- },
- s = t === Et;
- function l(e) {
- var n;
- return i[e] = !0,
- de.each(t[e] || [
- ], function (e, t) {
- t = t(a, r, o);
- return 'string' != typeof t || s || i[t] ? s ? !(n = t) : void 0 : (a.dataTypes.unshift(t), l(t), !1)
- }),
- n
- }
- return l(a.dataTypes[0]) || !i['*'] && l('*')
- }
- function wt(e, t) {
- var n,
- a,
- r = de.ajaxSettings.flatOptions || {
- };
- for (a in t) t[a] !== O && ((r[a] ? e : n = n || {
- }) [a] = t[a]);
- return n && de.extend(!0, e, n),
- e
- }
- ct = bt.exec(ut.toLowerCase()) || [
- ],
- de.fn.load = function (e, t, n) {
- if ('string' != typeof e && vt) return vt.apply(this, arguments);
- var a,
- r,
- o,
- i = this,
- s = e.indexOf(' ');
- return 0 <= s && (a = e.slice(s, e.length), e = e.slice(0, s)),
- de.isFunction(t) ? (n = t, t = O) : t && 'object' == typeof t && (o = 'POST'),
- 0 < i.length && de.ajax({
- url: e,
- type: o,
- dataType: 'html',
- data: t
- }).done(function (e) {
- r = arguments,
- i.html(a ? de('<div>').append(de.parseHTML(e)).find(a) : e)
- }).complete(n && function (e, t) {
- i.each(n, r || [
- e.responseText,
- t,
- e
- ])
- }),
- this
- },
- de.each(['ajaxStart',
- 'ajaxStop',
- 'ajaxComplete',
- 'ajaxError',
- 'ajaxSuccess',
- 'ajaxSend'], function (e, t) {
- de.fn[t] = function (e) {
- return this.on(t, e)
- }
- }),
- de.each(['get',
- 'post'], function (e, r) {
- de[r] = function (e, t, n, a) {
- return de.isFunction(t) && (a = a || n, n = t, t = O),
- de.ajax({
- url: e,
- type: r,
- dataType: a,
- data: t,
- success: n
- })
- }
- }),
- de.extend({
- active: 0,
- lastModified: {
- },
- etag: {
- },
- ajaxSettings: {
- url: ut,
- type: 'GET',
- isLocal: /^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(ct[1]),
- global: !0,
- processData: !0,
- async: !0,
- contentType: 'application/x-www-form-urlencoded; charset=UTF-8',
- accepts: {
- '*': '*/*',
- text: 'text/plain',
- html: 'text/html',
- xml: 'application/xml, text/xml',
- json: 'application/json, text/javascript'
- },
- contents: {
- xml: /xml/,
- html: /html/,
- json: /json/
- },
- responseFields: {
- xml: 'responseXML',
- text: 'responseText'
- },
- converters: {
- '* text': f.String,
- 'text html': !0,
- 'text json': de.parseJSON,
- 'text xml': de.parseXML
- },
- flatOptions: {
- url: !0,
- context: !0
- }
- },
- ajaxSetup: function (e, t) {
- return t ? wt(wt(e, de.ajaxSettings), t) : wt(de.ajaxSettings, e)
- },
- ajaxPrefilter: Ot(_t),
- ajaxTransport: Ot(Et),
- ajax: function (e, t) {
- 'object' == typeof e && (t = e, e = O);
- var n,
- c,
- u,
- p,
- d,
- m,
- a,
- f = de.ajaxSetup({
- }, t = t || {
- }),
- h = f.context || f,
- g = f.context && (h.nodeType || h.jquery) ? de(h) : de.event,
- y = de.Deferred(),
- b = de.Callbacks('once memory'),
- v = f.statusCode || {
- },
- r = {
- },
- o = {
- },
- _ = 0,
- i = 'canceled',
- E = {
- readyState: 0,
- getResponseHeader: function (e) {
- var t;
- if (2 === _) {
- if (!a) for (a = {
- }; t = ht.exec(u); ) a[t[1].toLowerCase()] = t[2];
- t = a[e.toLowerCase()]
- }
- return null == t ? null : t
- },
- getAllResponseHeaders: function () {
- return 2 === _ ? u : null
- },
- setRequestHeader: function (e, t) {
- var n = e.toLowerCase();
- return _ || (e = o[n] = o[n] || e, r[e] = t),
- this
- },
- overrideMimeType: function (e) {
- return _ || (f.mimeType = e),
- this
- },
- statusCode: function (e) {
- if (e) if (_ < 2) for (var t in e) v[t] = [
- v[t],
- e[t]
- ];
- else E.always(e[E.status]);
- return this
- },
- abort: function (e) {
- e = e || i;
- return m && m.abort(e),
- s(0, e),
- this
- }
- };
- if (y.promise(E).complete = b.add, E.success = E.done, E.error = E.fail, f.url = ((e || f.url || ut) + '').replace(mt, '').replace(yt, ct[1] + '//'), f.type = t.method || t.type || f.method || f.type, f.dataTypes = de.trim(f.dataType || '*').toLowerCase().match(S) || [
- ''
- ], null == f.crossDomain && (e = bt.exec(f.url.toLowerCase()), f.crossDomain = !(!e || e[1] === ct[1] && e[2] === ct[2] && (e[3] || ('http:' === e[1] ? 80 : 443)) == (ct[3] || ('http:' === ct[1] ? 80 : 443)))), f.data && f.processData && 'string' != typeof f.data && (f.data = de.param(f.data, f.traditional)), St(_t, f, t, E), 2 === _) return E;
- for (n in (d = f.global) && 0 == de.active++ && de.event.trigger('ajaxStart'), f.type = f.type.toUpperCase(), f.hasContent = !gt.test(f.type), c = f.url, f.hasContent || (f.data && (c = f.url += (dt.test(c) ? '&' : '?') + f.data, delete f.data), !1 === f.cache && (f.url = ft.test(c) ? c.replace(ft, '$1_=' + pt++) : c + (dt.test(c) ? '&' : '?') + '_=' + pt++)), f.ifModified && (de.lastModified[c] && E.setRequestHeader('If-Modified-Since', de.lastModified[c]), de.etag[c] && E.setRequestHeader('If-None-Match', de.etag[c])), (f.data && f.hasContent && !1 !== f.contentType || t.contentType) && E.setRequestHeader('Content-Type', f.contentType), E.setRequestHeader('Accept', f.dataTypes[0] && f.accepts[f.dataTypes[0]] ? f.accepts[f.dataTypes[0]] + ('*' !== f.dataTypes[0] ? ', */*; q=0.01' : '') : f.accepts['*']), f.headers) E.setRequestHeader(n, f.headers[n]);
- if (f.beforeSend && (!1 === f.beforeSend.call(h, E, f) || 2 === _)) return E.abort();
- for (n in i = 'abort', {
- success: 1,
- error: 1,
- complete: 1
- }) E[n](f[n]);
- if (m = St(Et, f, t, E)) {
- E.readyState = 1,
- d && g.trigger('ajaxSend', [
- E,
- f
- ]),
- f.async && 0 < f.timeout && (p = setTimeout(function () {
- E.abort('timeout')
- }, f.timeout));
- try {
- _ = 1,
- m.send(r, s)
- } catch (e) {
- if (!(_ < 2)) throw e;
- s( - 1, e)
- }
- } else s( - 1, 'No Transport');
- function s(e, t, n, a) {
- var r,
- o,
- i,
- s,
- l = t;
- 2 !== _ && (_ = 2, p && clearTimeout(p), m = O, u = a || '', E.readyState = 0 < e ? 4 : 0, n && (s = function (e, t, n) {
- var a,
- r,
- o,
- i,
- s = e.contents,
- l = e.dataTypes,
- c = e.responseFields;
- for (i in c) i in n && (t[c[i]] = n[i]);
- for (; '*' === l[0]; ) l.shift(),
- r === O && (r = e.mimeType || t.getResponseHeader('Content-Type'));
- if (r) for (i in s) if (s[i] && s[i].test(r)) {
- l.unshift(i);
- break
- }
- if (l[0] in n) o = l[0];
- else {
- for (i in n) {
- if (!l[0] || e.converters[i + ' ' + l[0]]) {
- o = i;
- break
- }
- a = a || i
- }
- o = o || a
- }
- if (o) return o !== l[0] && l.unshift(o),
- n[o]
- }(f, E, n)), 200 <= e && e < 300 || 304 === e ? (f.ifModified && ((n = E.getResponseHeader('Last-Modified')) && (de.lastModified[c] = n), (n = E.getResponseHeader('etag')) && (de.etag[c] = n)), 204 === e ? (r = !0, l = 'nocontent') : 304 === e ? (r = !0, l = 'notmodified') : (l = (r = function (e, t) {
- var n,
- a,
- r,
- o,
- i = {
- },
- s = 0,
- l = e.dataTypes.slice(),
- c = l[0];
- e.dataFilter && (t = e.dataFilter(t, e.dataType));
- if (l[1]) for (r in e.converters) i[r.toLowerCase()] = e.converters[r];
- for (; a = l[++s]; ) if ('*' !== a) {
- if ('*' !== c && c !== a) {
- if (!(r = i[c + ' ' + a] || i['* ' + a])) for (n in i) if ((o = n.split(' ')) [1] === a && (r = i[c + ' ' + o[0]] || i['* ' + o[0]])) {
- !0 === r ? r = i[n] : !0 !== i[n] && l.splice(s--, 0, a = o[0]);
- break
- }
- if (!0 !== r) if (r && e.throws) t = r(t);
- else try {
- t = r(t)
- } catch (e) {
- return {
- state: 'parsererror',
- error: r ? e : 'No conversion from ' + c + ' to ' + a
- }
- }
- }
- c = a
- }
- return {
- state: 'success',
- data: t
- }
- }(f, s)).state, o = r.data, r = !(i = r.error))) : (i = l, !e && l || (l = 'error', e < 0 && (e = 0))), E.status = e, E.statusText = (t || l) + '', r ? y.resolveWith(h, [
- o,
- l,
- E
- ]) : y.rejectWith(h, [
- E,
- l,
- i
- ]), E.statusCode(v), v = O, d && g.trigger(r ? 'ajaxSuccess' : 'ajaxError', [
- E,
- f,
- r ? o : i
- ]), b.fireWith(h, [
- E,
- l
- ]), d && (g.trigger('ajaxComplete', [
- E,
- f
- ]), --de.active || de.event.trigger('ajaxStop')))
- }
- return E
- },
- getScript: function (e, t) {
- return de.get(e, O, t, 'script')
- },
- getJSON: function (e, t, n) {
- return de.get(e, t, n, 'json')
- }
- }),
- de.ajaxSetup({
- accepts: {
- script: 'text/javascript, application/javascript, application/ecmascript, application/x-ecmascript'
- },
- contents: {
- script: /(?:java|ecma)script/
- },
- converters: {
- 'text script': function (e) {
- return de.globalEval(e),
- e
- }
- }
- }),
- de.ajaxPrefilter('script', function (e) {
- e.cache === O && (e.cache = !1),
- e.crossDomain && (e.type = 'GET', e.global = !1)
- }),
- de.ajaxTransport('script', function (t) {
- if (t.crossDomain) {
- var a,
- r = g.head || de('head') [0] || g.documentElement;
- return {
- send: function (e, n) {
- (a = g.createElement('script')).async = !0,
- t.scriptCharset && (a.charset = t.scriptCharset),
- a.src = t.url,
- a.onload = a.onreadystatechange = function (e, t) {
- !t && a.readyState && !/loaded|complete/.test(a.readyState) || (a.onload = a.onreadystatechange = null, a.parentNode && a.parentNode.removeChild(a), a = null, t || n(200, 'success'))
- },
- r.insertBefore(a, r.firstChild)
- },
- abort: function () {
- a && a.onload(O, !0)
- }
- }
- }
- });
- var Pt = [
- ],
- kt = /(=)\?(?=&|$)|\?\?/;
- de.ajaxSetup({
- jsonp: 'callback',
- jsonpCallback: function () {
- var e = Pt.pop() || de.expando + '_' + pt++;
- return this[e] = !0,
- e
- }
- }),
- de.ajaxPrefilter('json jsonp', function (e, t, n) {
- var a,
- r,
- o,
- i = !1 !== e.jsonp && (kt.test(e.url) ? 'url' : 'string' == typeof e.data && !(e.contentType || '').indexOf('application/x-www-form-urlencoded') && kt.test(e.data) && 'data');
- if (i || 'jsonp' === e.dataTypes[0]) return a = e.jsonpCallback = de.isFunction(e.jsonpCallback) ? e.jsonpCallback() : e.jsonpCallback,
- i ? e[i] = e[i].replace(kt, '$1' + a) : !1 !== e.jsonp && (e.url += (dt.test(e.url) ? '&' : '?') + e.jsonp + '=' + a),
- e.converters['script json'] = function () {
- return o || de.error(a + ' was not called'),
- o[0]
- },
- e.dataTypes[0] = 'json',
- r = f[a],
- f[a] = function () {
- o = arguments
- },
- n.always(function () {
- f[a] = r,
- e[a] && (e.jsonpCallback = t.jsonpCallback, Pt.push(a)),
- o && de.isFunction(r) && r(o[0]),
- o = r = O
- }),
- 'script'
- });
- var Nt,
- Ct = 0,
- Rt = f.ActiveXObject && function () {
- for (var e in Nt) Nt[e](O, !0)
- };
- function xt() {
- try {
- return new f.XMLHttpRequest
- } catch (e) {
- }
- }
- de.ajaxSettings.xhr = f.ActiveXObject ? function () {
- return !this.isLocal && xt() || function () {
- try {
- return new f.ActiveXObject('Microsoft.XMLHTTP')
- } catch (e) {
- }
- }()
- }
- : xt,
- e = de.ajaxSettings.xhr(),
- de.support.cors = !!e && 'withCredentials' in e,
- (e = de.support.ajax = !!e) && de.ajaxTransport(function (c) {
- var u;
- if (!c.crossDomain || de.support.cors) return {
- send: function (e, i) {
- var s,
- t,
- l = c.xhr();
- if (c.username ? l.open(c.type, c.url, c.async, c.username, c.password) : l.open(c.type, c.url, c.async), c.xhrFields) for (t in c.xhrFields) l[t] = c.xhrFields[t];
- c.mimeType && l.overrideMimeType && l.overrideMimeType(c.mimeType),
- c.crossDomain || e['X-Requested-With'] || (e['X-Requested-With'] = 'XMLHttpRequest');
- try {
- for (t in e) l.setRequestHeader(t, e[t])
- } catch (e) {
- }
- l.send(c.hasContent && c.data || null),
- u = function (e, t) {
- var n,
- a,
- r,
- o;
- try {
- if (u && (t || 4 === l.readyState)) if (u = O, s && (l.onreadystatechange = de.noop, Rt && delete Nt[s]), t) 4 !== l.readyState && l.abort();
- else {
- o = {
- },
- n = l.status,
- a = l.getAllResponseHeaders(),
- 'string' == typeof l.responseText && (o.text = l.responseText);
- try {
- r = l.statusText
- } catch (e) {
- r = ''
- }
- n || !c.isLocal || c.crossDomain ? 1223 === n && (n = 204) : n = o.text ? 200 : 404
- }
- } catch (e) {
- t || i( - 1, e)
- }
- o && i(n, r, o, a)
- },
- c.async ? 4 === l.readyState ? setTimeout(u) : (s = ++Ct, Rt && (Nt || (Nt = {
- }, de(f).unload(Rt)), Nt[s] = u), l.onreadystatechange = u) : u()
- },
- abort: function () {
- u && u(O, !0)
- }
- }
- });
- var At,
- Dt,
- jt = /^(?:toggle|show|hide)$/,
- Tt = RegExp('^(?:([+-])=|)(' + m + ')([a-z%]*)$', 'i'),
- It = /queueHooks$/,
- qt = [
- function (t, e, n) {
- var a,
- r,
- o,
- i,
- s,
- l,
- c,
- u,
- p,
- d = this,
- m = t.style,
- f = {
- },
- h = [
- ],
- g = t.nodeType && $e(t);
- n.queue || (null == (u = de._queueHooks(t, 'fx')).unqueued && (u.unqueued = 0, p = u.empty.fire, u.empty.fire = function () {
- u.unqueued || p()
- }), u.unqueued++, d.always(function () {
- d.always(function () {
- u.unqueued--,
- de.queue(t, 'fx').length || u.empty.fire()
- })
- }));
- 1 === t.nodeType && ('height' in e || 'width' in e) && (n.overflow = [
- m.overflow,
- m.overflowX,
- m.overflowY
- ], 'inline' === de.css(t, 'display') && 'none' === de.css(t, 'float') && (de.support.inlineBlockNeedsLayout && 'inline' !== nt(t.nodeName) ? m.zoom = 1 : m.display = 'inline-block'));
- n.overflow && (m.overflow = 'hidden', de.support.shrinkWrapBlocks || d.always(function () {
- m.overflow = n.overflow[0],
- m.overflowX = n.overflow[1],
- m.overflowY = n.overflow[2]
- }));
- for (r in e) jt.exec(i = e[r]) && (delete e[r], l = l || 'toggle' === i, i !== (g ? 'hide' : 'show') && h.push(r));
- if (o = h.length) {
- 'hidden' in (s = de._data(t, 'fxshow') || de._data(t, 'fxshow', {
- })) && (g = s.hidden),
- l && (s.hidden = !g),
- g ? de(t).show() : d.done(function () {
- de(t).hide()
- }),
- d.done(function () {
- for (var e in de._removeData(t, 'fxshow'), f) de.style(t, e, f[e])
- });
- for (r = 0; r < o; r++) c = d.createTween(a = h[r], g ? s[a] : 0),
- f[a] = s[a] || de.style(t, a),
- a in s || (s[a] = c.start, g && (c.end = c.start, c.start = 'width' === a || 'height' === a ? 1 : 0))
- }
- }
- ],
- Ft = {
- '*': [
- function (e, t) {
- var n,
- a = this.createTween(e, t),
- r = Tt.exec(t),
- o = a.cur(),
- i = + o || 0,
- s = 1,
- l = 20;
- if (r) {
- if (t = + r[2], 'px' !== (n = r[3] || (de.cssNumber[e] ? '' : 'px')) && i) for (i = de.css(a.elem, e, !0) || t || 1; de.style(a.elem, e, (i /= s = s || '.5') + n), s !== (s = a.cur() / o) && 1 !== s && --l; );
- a.unit = n,
- a.start = i,
- a.end = r[1] ? i + (r[1] + 1) * t : t
- }
- return a
- }
- ]
- };
- function Lt() {
- return setTimeout(function () {
- At = O
- }),
- At = de.now()
- }
- function Ut(r, e, t) {
- var n,
- o,
- i,
- a = 0,
- s = qt.length,
- l = de.Deferred().always(function () {
- delete c.elem
- }),
- c = function () {
- if (o) return !1;
- for (var e = At || Lt(), e = Math.max(0, u.startTime + u.duration - e), t = 1 - (e / u.duration || 0), n = 0, a = u.tweens.length; n < a; n++) u.tweens[n].run(t);
- return l.notifyWith(r, [
- u,
- t,
- e
- ]),
- t < 1 && a ? e : (l.resolveWith(r, [
- u
- ]), !1)
- },
- u = l.promise({
- elem: r,
- props: de.extend({
- }, e),
- opts: de.extend(!0, {
- specialEasing: {
- }
- }, t),
- originalProperties: e,
- originalOptions: t,
- startTime: At || Lt(),
- duration: t.duration,
- tweens: [
- ],
- createTween: function (e, t) {
- e = de.Tween(r, u.opts, e, t, u.opts.specialEasing[e] || u.opts.easing);
- return u.tweens.push(e),
- e
- },
- stop: function (e) {
- var t = 0,
- n = e ? u.tweens.length : 0;
- if (o) return this;
- for (o = !0; t < n; t++) u.tweens[t].run(1);
- return e ? l.resolveWith(r, [
- u,
- e
- ]) : l.rejectWith(r, [
- u,
- e
- ]),
- this
- }
- }),
- p = u.props;
- for (!function (e, t) {
- var n,
- a,
- r,
- o,
- i;
- for (r in e) if (a = de.camelCase(r), o = t[a], de.isArray(n = e[r]) && (o = n[1], n = e[r] = n[0]), r !== a && (e[a] = n, delete e[r]), (i = de.cssHooks[a]) && 'expand' in i) for (r in n = i.expand(n), delete e[a], n) r in e || (e[r] = n[r], t[r] = o);
- else t[a] = o
- }(p, u.opts.specialEasing); a < s; a++) if (n = qt[a].call(u, r, p, u.opts)) return n;
- return i = u,
- de.each(p, function (e, t) {
- for (var n = (Ft[e] || [
- ]).concat(Ft['*']), a = 0, r = n.length; a < r; a++) if (n[a].call(i, e, t)) return
- }),
- de.isFunction(u.opts.start) && u.opts.start.call(r, u),
- de.fx.timer(de.extend(c, {
- elem: r,
- anim: u,
- queue: u.opts.queue
- })),
- u.progress(u.opts.progress).done(u.opts.done, u.opts.complete).fail(u.opts.fail).always(u.opts.always)
- }
- function Mt(e, t, n, a, r) {
- return new Mt.prototype.init(e, t, n, a, r)
- }
- function Bt(e, t) {
- var n,
- a = {
- height: e
- },
- r = 0;
- for (t = t ? 1 : 0; r < 4; r += 2 - t) a['margin' + (n = Qe[r])] = a['padding' + n] = e;
- return t && (a.opacity = a.width = e),
- a
- }
- function zt(e) {
- return de.isWindow(e) ? e : 9 === e.nodeType && (e.defaultView || e.parentWindow)
- }
- de.Animation = de.extend(Ut, {
- tweener: function (e, t) {
- for (var n, a = 0, r = (e = de.isFunction(e) ? (t = e, [
- '*'
- ]) : e.split(' ')).length; a < r; a++) Ft[n = e[a]] = Ft[n] || [
- ],
- Ft[n].unshift(t)
- },
- prefilter: function (e, t) {
- t ? qt.unshift(e) : qt.push(e)
- }
- }),
- (de.Tween = Mt).prototype = {
- constructor: Mt,
- init: function (e, t, n, a, r, o) {
- this.elem = e,
- this.prop = n,
- this.easing = r || 'swing',
- this.options = t,
- this.start = this.now = this.cur(),
- this.end = a,
- this.unit = o || (de.cssNumber[n] ? '' : 'px')
- },
- cur: function () {
- var e = Mt.propHooks[this.prop];
- return (e && e.get ? e : Mt.propHooks._default).get(this)
- },
- run: function (e) {
- var t = Mt.propHooks[this.prop];
- return this.pos = e = this.options.duration ? de.easing[this.easing](e, this.options.duration * e, 0, 1, this.options.duration) : e,
- this.now = (this.end - this.start) * e + this.start,
- this.options.step && this.options.step.call(this.elem, this.now, this),
- (t && t.set ? t : Mt.propHooks._default).set(this),
- this
- }
- },
- Mt.prototype.init.prototype = Mt.prototype,
- Mt.propHooks = {
- _default: {
- get: function (e) {
- var t;
- return null == e.elem[e.prop] || e.elem.style && null != e.elem.style[e.prop] ? (t = de.css(e.elem, e.prop, '')) && 'auto' !== t ? t : 0 : e.elem[e.prop]
- },
- set: function (e) {
- de.fx.step[e.prop] ? de.fx.step[e.prop](e) : e.elem.style && (null != e.elem.style[de.cssProps[e.prop]] || de.cssHooks[e.prop]) ? de.style(e.elem, e.prop, e.now + e.unit) : e.elem[e.prop] = e.now
- }
- }
- },
- Mt.propHooks.scrollTop = Mt.propHooks.scrollLeft = {
- set: function (e) {
- e.elem.nodeType && e.elem.parentNode && (e.elem[e.prop] = e.now)
- }
- },
- de.each(['toggle',
- 'show',
- 'hide'], function (e, a) {
- var r = de.fn[a];
- de.fn[a] = function (e, t, n) {
- return null == e || 'boolean' == typeof e ? r.apply(this, arguments) : this.animate(Bt(a, !0), e, t, n)
- }
- }),
- de.fn.extend({
- fadeTo: function (e, t, n, a) {
- return this.filter($e).css('opacity', 0).show().end().animate({
- opacity: t
- }, e, n, a)
- },
- animate: function (t, e, n, a) {
- var r = de.isEmptyObject(t),
- o = de.speed(e, n, a),
- i = function () {
- var e = Ut(this, de.extend({
- }, t), o);
- i.finish = function () {
- e.stop(!0)
- },
- (r || de._data(this, 'finish')) && e.stop(!0)
- };
- return i.finish = i,
- r || !1 === o.queue ? this.each(i) : this.queue(o.queue, i)
- },
- stop: function (r, e, o) {
- function i(e) {
- var t = e.stop;
- delete e.stop,
- t(o)
- }
- return 'string' != typeof r && (o = e, e = r, r = O),
- e && !1 !== r && this.queue(r || 'fx', [
- ]),
- this.each(function () {
- var e = !0,
- t = null != r && r + 'queueHooks',
- n = de.timers,
- a = de._data(this);
- if (t) a[t] && a[t].stop && i(a[t]);
- else for (t in a) a[t] && a[t].stop && It.test(t) && i(a[t]);
- for (t = n.length; t--; ) n[t].elem !== this || null != r && n[t].queue !== r || (n[t].anim.stop(o), e = !1, n.splice(t, 1));
- !e && o || de.dequeue(this, r)
- })
- },
- finish: function (i) {
- return !1 !== i && (i = i || 'fx'),
- this.each(function () {
- var e,
- t = de._data(this),
- n = t[i + 'queue'],
- a = t[i + 'queueHooks'],
- r = de.timers,
- o = n ? n.length : 0;
- for (t.finish = !0, de.queue(this, i, [
- ]), a && a.cur && a.cur.finish && a.cur.finish.call(this), e = r.length; e--; ) r[e].elem === this && r[e].queue === i && (r[e].anim.stop(!0), r.splice(e, 1));
- for (e = 0; e < o; e++) n[e] && n[e].finish && n[e].finish.call(this);
- delete t.finish
- })
- }
- }),
- de.each({
- slideDown: Bt('show'),
- slideUp: Bt('hide'),
- slideToggle: Bt('toggle'),
- fadeIn: {
- opacity: 'show'
- },
- fadeOut: {
- opacity: 'hide'
- },
- fadeToggle: {
- opacity: 'toggle'
- }
- }, function (e, a) {
- de.fn[e] = function (e, t, n) {
- return this.animate(a, e, t, n)
- }
- }),
- de.speed = function (e, t, n) {
- var a = e && 'object' == typeof e ? de.extend({
- }, e) : {
- complete: n || !n && t || de.isFunction(e) && e,
- duration: e,
- easing: n && t || t && !de.isFunction(t) && t
- };
- return a.duration = de.fx.off ? 0 : 'number' == typeof a.duration ? a.duration : a.duration in de.fx.speeds ? de.fx.speeds[a.duration] : de.fx.speeds._default,
- null != a.queue && !0 !== a.queue || (a.queue = 'fx'),
- a.old = a.complete,
- a.complete = function () {
- de.isFunction(a.old) && a.old.call(this),
- a.queue && de.dequeue(this, a.queue)
- },
- a
- },
- de.easing = {
- linear: function (e) {
- return e
- },
- swing: function (e) {
- return 0.5 - Math.cos(e * Math.PI) / 2
- }
- },
- de.timers = [
- ],
- de.fx = Mt.prototype.init,
- de.fx.tick = function () {
- var e,
- t = de.timers,
- n = 0;
- for (At = de.now(); n < t.length; n++) (e = t[n]) () || t[n] !== e || t.splice(n--, 1);
- t.length || de.fx.stop(),
- At = O
- },
- de.fx.timer = function (e) {
- e() && de.timers.push(e) && de.fx.start()
- },
- de.fx.interval = 13,
- de.fx.start = function () {
- Dt = Dt || setInterval(de.fx.tick, de.fx.interval)
- },
- de.fx.stop = function () {
- clearInterval(Dt),
- Dt = null
- },
- de.fx.speeds = {
- slow: 600,
- fast: 200,
- _default: 400
- },
- de.fx.step = {
- },
- de.expr && de.expr.filters && (de.expr.filters.animated = function (t) {
- return de.grep(de.timers, function (e) {
- return t === e.elem
- }).length
- }),
- de.fn.offset = function (t) {
- if (arguments.length) return t === O ? this : this.each(function (e) {
- de.offset.setOffset(this, t, e)
- });
- var e,
- n = {
- top: 0,
- left: 0
- },
- a = this[0],
- r = a && a.ownerDocument;
- return r ? de.contains(e = r.documentElement, a) ? (typeof a.getBoundingClientRect !== h && (n = a.getBoundingClientRect()), r = zt(r), {
- top: n.top + (r.pageYOffset || e.scrollTop) - (e.clientTop || 0),
- left: n.left + (r.pageXOffset || e.scrollLeft) - (e.clientLeft || 0)
- }) : n : void 0
- },
- de.offset = {
- setOffset: function (e, t, n) {
- var a = de.css(e, 'position');
- 'static' === a && (e.style.position = 'relative');
- var r,
- o,
- i = de(e),
- s = i.offset(),
- l = de.css(e, 'top'),
- c = de.css(e, 'left'),
- u = {
- },
- c = ('absolute' === a || 'fixed' === a) && - 1 < de.inArray('auto', [
- l,
- c
- ]) ? (o = (r = i.position()).top, r.left) : (o = parseFloat(l) || 0, parseFloat(c) || 0);
- null != (t = de.isFunction(t) ? t.call(e, n, s) : t).top && (u.top = t.top - s.top + o),
- null != t.left && (u.left = t.left - s.left + c),
- 'using' in t ? t.using.call(e, u) : i.css(u)
- }
- },
- de.fn.extend({
- position: function () {
- if (this[0]) {
- var e,
- t,
- n = {
- top: 0,
- left: 0
- },
- a = this[0];
- return 'fixed' === de.css(a, 'position') ? t = a.getBoundingClientRect() : (e = this.offsetParent(), t = this.offset(), (n = !de.nodeName(e[0], 'html') ? e.offset() : n).top += de.css(e[0], 'borderTopWidth', !0), n.left += de.css(e[0], 'borderLeftWidth', !0)),
- {
- top: t.top - n.top - de.css(a, 'marginTop', !0),
- left: t.left - n.left - de.css(a, 'marginLeft', !0)
- }
- }
- },
- offsetParent: function () {
- return this.map(function () {
- for (var e = this.offsetParent || g.documentElement; e && !de.nodeName(e, 'html') && 'static' === de.css(e, 'position'); ) e = e.offsetParent;
- return e || g.documentElement
- })
- }
- }),
- de.each({
- scrollLeft: 'pageXOffset',
- scrollTop: 'pageYOffset'
- }, function (t, r) {
- var o = /Y/.test(r);
- de.fn[t] = function (e) {
- return de.access(this, function (e, t, n) {
- var a = zt(e);
- if (n === O) return a ? r in a ? a[r] : a.document.documentElement[t] : e[t];
- a ? a.scrollTo(o ? de(a).scrollLeft() : n, o ? n : de(a).scrollTop()) : e[t] = n
- }, t, e, arguments.length, null)
- }
- }),
- de.each({
- Height: 'height',
- Width: 'width'
- }, function (o, i) {
- de.each({
- padding: 'inner' + o,
- content: i,
- '': 'outer' + o
- }, function (a, e) {
- de.fn[e] = function (e, t) {
- var n = arguments.length && (a || 'boolean' != typeof e),
- r = a || (!0 === e || !0 === t ? 'margin' : 'border');
- return de.access(this, function (e, t, n) {
- var a;
- return de.isWindow(e) ? e.document.documentElement['client' + o] : 9 === e.nodeType ? Math.max(e.body['scroll' + o], (a = e.documentElement) ['scroll' + o], e.body['offset' + o], a['offset' + o], a['client' + o]) : n === O ? de.css(e, t, r) : de.style(e, t, n, r)
- }, i, n ? e : O, n, null)
- }
- })
- }),
- Ht.exports = de
- }(window)
- },
- 39: function (e, t, n) {
- t = function () {
- 'use strict';
- var n,
- e = function (e) {
- var t = '_dsqstorage_';
- try {
- return e.localStorage.setItem(t, t),
- e.localStorage.getItem(t),
- e.localStorage.removeItem(t),
- !0
- } catch (e) {
- return !1
- }
- }(window),
- t = (n = {
- }, {
- getItem: function (e) {
- return n.hasOwnProperty(e) ? n[e] : null
- },
- setItem: function (e, t) {
- n[e] = '' + t
- },
- removeItem: function (e) {
- delete n[e]
- },
- clear: function () {
- n = {
- }
- }
- });
- return {
- get: function (e) {
- var t = null;
- try {
- return t = this.backend.getItem(e),
- JSON.parse(t)
- } catch (e) {
- return t
- }
- },
- set: function (e, t) {
- try {
- this.backend.setItem(e, JSON.stringify(t))
- } catch (e) {
- }
- },
- remove: function (e) {
- try {
- this.backend.removeItem(e)
- } catch (e) {
- }
- },
- clear: function () {
- try {
- this.backend.clear()
- } catch (e) {
- }
- },
- backend: e ? window.localStorage : t,
- isPersistent: e
- }
- }.apply(t, [
- ]);
- void 0 === t || (e.exports = t)
- },
- 42: function (e, t, n) {
- var n = [
- n(9)
- ],
- n = function (n) {
- 'use strict';
- var e = {
- },
- a = 'disqusauth';
- return e.getFromCookie = function () {
- var e = (n.read(a) || '').replace(/"/g, '').split('|');
- !e || e[1] && e[6] || (e = [
- ], n.erase(a, {
- }));
- var t = parseInt(e[6] || '0', 10);
- return {
- avatarUrl: e[7] ? decodeURIComponent(e[7]) : void 0,
- datetimeFormatting: parseInt(e[4], 10) ? 'absolute' : 'relative',
- id: t,
- isModerator: 0 < parseInt(e[8], 10),
- staff: !!parseInt(e[2], 10),
- tzOffset: e[5],
- username: e[1],
- isAuthenticated: !(!t || '0' === t)
- }
- },
- e
- }.apply(t, n);
- void 0 === n || (e.exports = n)
- },
- 43: function (e, t, n) {
- 'use strict';
- var n = [
- n(7),
- n(30),
- n(34),
- n(8),
- n(33),
- n(278)
- ],
- n = function (r, a, o, i, s, l) {
- function n(e) {
- return e.id === t
- }
- function c(e) {
- return e.id === f
- }
- function u(e) {
- return e.id === h
- }
- function p(t) {
- return O.some(function (e) {
- return t.id === e
- })
- }
- function d(t) {
- return S.some(function (e) {
- return t.id === e
- })
- }
- var m = s.BASIC_PLAN,
- t = s.DISQUS_BASIC_PACKAGE_ID,
- f = s.DISQUS_PLUS_PACKAGE_ID,
- h = s.DISQUS_PRO_PACKAGE_ID,
- g = s.DISQUS_PREFERRED_CUSTOMER_PACKAGE_ID,
- y = s.DISQUS_BASIC_PLAN_ID,
- e = s.DISQUS_PLUS_2021_PLAN_ID,
- b = s.DISQUS_PLUS_ANNUAL_2021_PLAN_ID,
- v = s.DISQUS_PRO_2021_PLAN_ID,
- _ = s.DISQUS_PRO_ANNUAL_2021_PLAN_ID,
- E = s.PAYMENT_INTERVAL,
- O = [
- s.DISQUS_PLUS_PLAN_ID,
- s.DISQUS_PLUS_ANNUAL_PLAN_ID,
- e,
- b
- ],
- S = [
- s.DISQUS_PRO_PLAN_ID,
- s.DISQUS_PRO_ANNUAL_PLAN_ID,
- v,
- _
- ];
- return {
- getPackageFeatureList: function (e, t, n) {
- var a = r.find(e, function (e) {
- return e.id === h
- }) || {
- },
- e = [
- ];
- t === g && (e = a.features.filter(function (e) {
- return !('Ads Optional' === e.name && !e.isCustom)
- }));
- n = n ? l.DISPLAY_SUBSCRIPTIONS_PACKAGES_FEATURES_ALT : l.DISPLAY_SUBSCRIPTIONS_PACKAGES_FEATURES;
- return e = n[t] ? n[t].map(function (e) {
- return {
- id: parseInt(e, 10),
- name: s.RENDER_FEATURE_TEXT[e]
- }
- }) : e
- },
- getPollsPackageFeatureList: function (e) {
- var t = [
- ],
- n = l.DISPLAY_POLLS_SUBSCRIPTIONS_PACKAGES_FEATURES;
- return t = n[e] ? n[e].map(function (e) {
- return {
- id: parseInt(e, 10),
- name: s.RENDER_FEATURE_TEXT[e]
- }
- }) : t
- },
- getDiscountedAmount: function (e, t) {
- return t ? t.amountOff ? Math.max(0, e - t.amountOff) : e * (1 - t.percentOff / 100) : e
- },
- formatPlanAmount: function (e) {
- return (e / 100).toFixed()
- },
- formatPageViews: function (e) {
- return Intl.NumberFormat('en', {
- notation: 'compact'
- }).format(e)
- },
- isNewPlanCouponEligible: function (e, t) {
- return !!t && ((e = e || m).id === y && (p(t) || d(t)) || p(e) && d(t))
- },
- isCurrentPackageCouponEligible: function (e) {
- return n(e) || c(e)
- },
- isNewPackageCouponEligible: function (e, t) {
- return !!t && (n(e) && (c(t) || u(t)) || c(e) && u(t))
- },
- getCurrentPlusPlanId: function () {
- return e
- },
- getCurrentPlusAnnualPlanId: function () {
- return b
- },
- getCurrentProPlanId: function () {
- return v
- },
- getCurrentProAnnualPlanId: function () {
- return _
- },
- getGtmEvent: function (e) {
- var t,
- t = p(t = e) ? 'plus' : d(t) ? 'pro' : '',
- e = E[e.interval] || '';
- return ''.concat(t).concat(e, 'subscribe')
- },
- isNewFlow: function () {
- var e = 0 < arguments.length && void 0 !== arguments[0] ? arguments[0] : 'cc_v2',
- t = 1 < arguments.length && void 0 !== arguments[1] ? arguments[1] : {
- orgId: '',
- trial: {
- isActive: !1,
- startDate: ''
- }
- },
- n = {
- };
- return t.orgId && (n.organization = t.orgId),
- !!o.isFeatureActive(e, n) && (!(t.trial && t.trial.isActive && t.trial.startDate && i.lounge.cc_v2_start) || a(t.trial.startDate).isAfter(a(i.lounge.cc_v2_start)))
- }
- }
- }.apply(t, n);
- void 0 === n || (e.exports = n)
- },
- 493: function (e, t, n) {
- 'use strict';
- function r(e) {
- return (r = 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator ? function (e) {
- return typeof e
- }
- : function (e) {
- return e && 'function' == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? 'symbol' : typeof e
- }) (e)
- }
- function s(e, t) {
- for (var n = 0; n < t.length; n++) {
- var a = t[n];
- a.enumerable = a.enumerable || !1,
- a.configurable = !0,
- 'value' in a && (a.writable = !0),
- Object.defineProperty(e, a.key, a)
- }
- }
- function l(e, t) {
- return (l = Object.setPrototypeOf || function (e, t) {
- return e.__proto__ = t,
- e
- }) (e, t)
- }
- function c(n) {
- var a = function () {
- if ('undefined' == typeof Reflect || !Reflect.construct) return !1;
- if (Reflect.construct.sham) return !1;
- if ('function' == typeof Proxy) return !0;
- try {
- return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [
- ], function () {
- })),
- !0
- } catch (e) {
- return !1
- }
- }();
- return function () {
- var e,
- t = o(n);
- return e = a ? (e = o(this).constructor, Reflect.construct(t, arguments, e)) : t.apply(this, arguments),
- t = this,
- !(e = e) || 'object' !== r(e) && 'function' != typeof e ? function (e) {
- if (void 0 !== e) return e;
- throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called')
- }(t) : e
- }
- }
- function o(e) {
- return (o = Object.setPrototypeOf ? Object.getPrototypeOf : function (e) {
- return e.__proto__ || Object.getPrototypeOf(e)
- }) (e)
- }
- n = [
- n(37),
- n(25)
- ],
- void 0 === (n = function (o, i) {
- return function () {
- !function (e, t) {
- if ('function' != typeof t && null !== t) throw new TypeError('Super expression must either be null or a function');
- e.prototype = Object.create(t && t.prototype, {
- constructor: {
- value: e,
- writable: !0,
- configurable: !0
- }
- }),
- t && l(e, t)
- }(r, i.Component);
- var e,
- t,
- n,
- a = c(r);
- function r() {
- return function (e, t) {
- if (!(e instanceof t)) throw new TypeError('Cannot call a class as a function')
- }(this, r),
- a.apply(this, arguments)
- }
- return e = r,
- (t = [
- {
- key: 'componentWillMount',
- value: function () {
- o(window.document.body).hide(),
- window.document.location.reload()
- }
- },
- {
- key: 'render',
- value: function () {
- return null
- }
- }
- ]) && s(e.prototype, t),
- n && s(e, n),
- r
- }()
- }.apply(t, n)) || (e.exports = n)
- },
- 494: function (e, t, n) {
- var a = {
- ISO_8601: 'YYYY-MM-DDTHH:mm:ssZ',
- assureTzOffset: function (e) {
- return ~e.indexOf('+') ? e : e + '+00:00'
- }
- };
- e.exports = a
- },
- 495: function (e, t, n) {
- 'use strict';
- var n = [
- n(25),
- n(7),
- n(61),
- n(59)
- ],
- n = function (l, e, t, n) {
- function c(e) {
- var t = e.text,
- n = e.value,
- a = e.selected,
- r = e.handleChange;
- return l.createElement('label', {
- className: 'padding-default align align__item--grow align__item--equal align--center align--column modal__option'.concat(a ? ' -selected' : ''),
- tabIndex: '0',
- onKeyPress: function (e) {
- 13 === e.keyCode && r(e)
- },
- onChange: r
- }, l.createElement('input', {
- type: 'radio',
- name: 'badge_action',
- value: n,
- checked: a
- }), l.createElement('p', {
- className: 'text-semibold text-center modal__option-text'
- }, t))
- }
- function u(e) {
- var t = e.badge,
- n = e.selectedBadge,
- e = e.handleChange;
- return l.createElement('span', {
- key: t.id,
- className: 'badge-option spacing-right '.concat(n && n === t.id ? ' selected' : '').concat(t.disabled ? ' disabled' : '')
- }, l.createElement('input', {
- id: 'badge-'.concat(t.id, '-input'),
- name: 'badge',
- type: 'radio',
- className: 'badge-option_input',
- value: t.id,
- onChange: e,
- disabled: t.disabled,
- tabIndex: '0'
- }), l.createElement('label', {
- htmlFor: 'badge-'.concat(t.id, '-input'),
- className: 'badge-option_label'
- }, l.createElement('span', {
- className: 'badge-option_image-wrapper'
- }, l.createElement('img', {
- className: 'badge-option_image',
- src: t.image,
- alt: t.name
- })), l.createElement('span', {
- className: 'badge-option_title'
- }, t.name)))
- }
- var p = t.gettext,
- d = n.ACTION_TYPES;
- return function (e) {
- var t = e.badgeAction,
- n = e.formValues,
- a = e.badgeOptions,
- r = e.updateBadgeAction,
- o = e.updateBadgeSelection,
- i = e.handleSubmit,
- s = e.handleClose,
- e = 'https://'.concat(n.forum, '.disqus.com/admin/settings/badges');
- return l.createElement('form', {
- className: 'badges-manage-form'
- }, l.createElement('div', {
- className: 'admin-modal__content padding-bottom'
- }, l.createElement('div', null, l.createElement('div', {
- className: 'align align--stretch align--wrap'
- }, l.createElement(c, {
- text: p('Award a Badge'),
- value: d.AWARD,
- selected: t === d.AWARD,
- handleChange: r
- }), l.createElement(c, {
- text: p('Remove a Badge'),
- value: d.REMOVE,
- selected: t === d.REMOVE,
- handleChange: r
- })), l.createElement('div', {
- className: 'modal__description border-bottom-dark'
- }, l.createElement('p', {
- className: 'modal__option-subtext'
- }, p(t === d.AWARD ? 'Select a badge below to award it to this commenter.' : 'Select one of the manually awarded badges below to remove it from this commenter. Automatically awarded badges can only be removed by removing the badge from your site entirely.'), l.createElement('br', null), p('You can manage your site\'s badges using the '), l.createElement('a', {
- href: e,
- target: '_blank',
- rel: 'noopener noreferrer'
- }, p('Badges settings')), p(' in the Disqus Admin.'))), l.createElement('div', {
- className: 'modal__config'
- }, l.createElement('div', {
- className: 'badge-options_list'
- }, a.map(function (e) {
- return l.createElement(u, {
- key: e.id,
- badge: e,
- selectedBadge: n.badge,
- handleChange: o
- })
- }), t === d.AWARD ? l.createElement('span', {
- className: 'badge-option spacing-right create-badge'
- }, l.createElement('a', {
- className: 'badge-option_link',
- href: e,
- target: '_blank',
- rel: 'noopener noreferrer'
- }, l.createElement('span', {
- className: 'badge-option_image-wrapper'
- }, l.createElement('span', {
- className: 'icon icon-plus badge-option_add-icon'
- })), l.createElement('span', {
- className: 'badge-option_title'
- }, p('Create a new badge')))) : null), t !== d.REMOVE || a.length ? null : l.createElement('div', {
- className: 'badge-options_empty'
- }, p('This user doesn\'t have any badges.')), n.errorMessage ? l.createElement('div', {
- className: 'spacing-top-narrow'
- }, l.createElement('p', {
- className: 'text-small modal__option-subtext modal__error'
- }, n.errorMessage)) : null))), l.createElement('div', {
- className: 'admin-modal__footer clearfix'
- }, l.createElement('button', {
- className: 'button button-fill--brand button-small text-capitalized',
- onClick: i
- }, p(t === d.AWARD ? 'Award badge' : 'Remove badge')), l.createElement('button', {
- className: 'button button-fill button-small text-capitalized',
- onClick: s
- }, p('Cancel'))))
- }
- }.apply(t, n);
- void 0 === n || (e.exports = n)
- },
- 496: function (e, t, n) {
- 'use strict';
- function r(e) {
- return (r = 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator ? function (e) {
- return typeof e
- }
- : function (e) {
- return e && 'function' == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? 'symbol' : typeof e
- }) (e)
- }
- function I() {
- return (I = Object.assign || function (e) {
- for (var t = 1; t < arguments.length; t++) {
- var n,
- a = arguments[t];
- for (n in a) Object.prototype.hasOwnProperty.call(a, n) && (e[n] = a[n])
- }
- return e
- }).apply(this, arguments)
- }
- function q(e) {
- return function (e) {
- if (Array.isArray(e)) return a(e)
- }(e) || function (e) {
- if ('undefined' != typeof Symbol && null != e[Symbol.iterator] || null != e['@@iterator']) return Array.from(e)
- }(e) || function (e, t) {
- if (e) {
- if ('string' == typeof e) return a(e, t);
- var n = Object.prototype.toString.call(e).slice(8, - 1);
- return 'Map' === (n = 'Object' === n && e.constructor ? e.constructor.name : n) || 'Set' === n ? Array.from(e) : 'Arguments' === n || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n) ? a(e, t) : void 0
- }
- }(e) || function () {
- throw new TypeError('Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.')
- }()
- }
- function a(e, t) {
- for (var n = 0, a = Array(t = null == t || e.length < t ? e.length : t); n < t; n++) a[n] = e[n];
- return a
- }
- function o(t, e) {
- var n,
- a = Object.keys(t);
- return Object.getOwnPropertySymbols && (n = Object.getOwnPropertySymbols(t), e && (n = n.filter(function (e) {
- return Object.getOwnPropertyDescriptor(t, e).enumerable
- })), a.push.apply(a, n)),
- a
- }
- function F(t) {
- for (var e = 1; e < arguments.length; e++) {
- var n = null != arguments[e] ? arguments[e] : {
- };
- e % 2 ? o(Object(n), !0).forEach(function (e) {
- z(t, e, n[e])
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(n)) : o(Object(n)).forEach(function (e) {
- Object.defineProperty(t, e, Object.getOwnPropertyDescriptor(n, e))
- })
- }
- return t
- }
- function L(e, t) {
- for (var n = 0; n < t.length; n++) {
- var a = t[n];
- a.enumerable = a.enumerable || !1,
- a.configurable = !0,
- 'value' in a && (a.writable = !0),
- Object.defineProperty(e, a.key, a)
- }
- }
- function U(e, t) {
- return (U = Object.setPrototypeOf || function (e, t) {
- return e.__proto__ = t,
- e
- }) (e, t)
- }
- function M(n) {
- var a = function () {
- if ('undefined' == typeof Reflect || !Reflect.construct) return !1;
- if (Reflect.construct.sham) return !1;
- if ('function' == typeof Proxy) return !0;
- try {
- return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [
- ], function () {
- })),
- !0
- } catch (e) {
- return !1
- }
- }();
- return function () {
- var e,
- t = i(n);
- return e = a ? (e = i(this).constructor, Reflect.construct(t, arguments, e)) : t.apply(this, arguments),
- t = this,
- !(e = e) || 'object' !== r(e) && 'function' != typeof e ? B(t) : e
- }
- }
- function B(e) {
- if (void 0 === e) throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called');
- return e
- }
- function i(e) {
- return (i = Object.setPrototypeOf ? Object.getPrototypeOf : function (e) {
- return e.__proto__ || Object.getPrototypeOf(e)
- }) (e)
- }
- function z(e, t, n) {
- return t in e ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n,
- e
- }
- n = [
- n(25),
- n(26),
- n(7),
- n(33),
- n(172),
- n(101),
- n(102),
- n(43)
- ],
- void 0 === (n = function (s, e, c, t, l, u, p, n) {
- var a = t.ORG_BILLING_SHAPE,
- r = t.TRIAL_SHAPE,
- d = t.PACKAGE_SHAPE,
- m = t.DISQUS_BASIC_PACKAGE_ID,
- f = t.DISQUS_PLUS_PACKAGE_ID,
- o = t.DISQUS_PLUS_FREE_PACKAGE_ID,
- h = t.DISQUS_PRO_PACKAGE_ID,
- g = t.DISQUS_BUSINESS_PACKAGE_ID,
- y = t.DISQUS_BASIC_PLAN_ID,
- i = t.DISQUS_PLUS_100K_PLAN_ID,
- b = t.DISQUS_PLUS_100K_YEARLY_PLAN_ID,
- v = t.DISQUS_PLUS_350K_PLAN_ID,
- _ = t.DISQUS_PLUS_350K_YEARLY_PLAN_ID,
- E = t.DISQUS_PLUS_900K_PLAN_ID,
- O = t.DISQUS_PLUS_900K_YEARLY_PLAN_ID,
- S = t.DISQUS_PLUS_FREE_PLAN_ID,
- w = t.DISQUS_PRO_1M_PLAN_ID,
- P = t.DISQUS_PRO_1M_YEARLY_PLAN_ID,
- k = t.DISQUS_PRO_2_5M_PLAN_ID,
- N = t.DISQUS_PRO_2_5M_YEARLY_PLAN_ID,
- C = t.DISQUS_PRO_5M_PLAN_ID,
- R = t.DISQUS_PRO_5M_YEARLY_PLAN_ID,
- x = t.DISQUS_BUSINESS_PLAN_ID,
- A = n.getPackageFeatureList,
- D = n.getCurrentPlusAnnualPlanId,
- j = n.getCurrentProAnnualPlanId,
- T = (z(n = {
- }, m, [
- y
- ]), z(n, f, [
- b,
- _,
- O,
- i,
- v,
- E
- ]), z(n, o, [
- S
- ]), z(n, h, [
- P,
- N,
- R,
- w,
- k,
- C
- ]), z(n, g, [
- x
- ]), n),
- n = function () {
- !function (e, t) {
- if ('function' != typeof t && null !== t) throw new TypeError('Super expression must either be null or a function');
- e.prototype = Object.create(t && t.prototype, {
- constructor: {
- value: e,
- writable: !0,
- configurable: !0
- }
- }),
- t && U(e, t)
- }(i, s.Component);
- var e,
- t,
- n,
- o = M(i);
- function i(e) {
- !function (e, t) {
- if (!(e instanceof t)) throw new TypeError('Cannot call a class as a function')
- }(this, i);
- var t = o.call(this, e),
- n = e.orgCurrentPackage,
- a = n && n.plans.find(function (e) {
- return e.isSubscribed
- }),
- r = !1;
- return a ? r = 'year' === a.interval : e.pollsOrgCurrentPackage && (r = (e = e.pollsOrgCurrentPackage.plans.find(function (e) {
- return e.isSubscribed
- })) && 'year' === e.interval),
- t.state = {
- expandedPackageId: f,
- selectedProPlanId: n && n.id === h && a ? a.id : r ? N : k,
- selectedPlusPlanId: n && n.id === f && a ? a.id : r ? _ : v
- },
- t.expandPackageId = t.expandPackageId.bind(B(t)),
- t.selectProPlan = t.selectProPlan.bind(B(t)),
- t.selectPlusPlan = t.selectPlusPlan.bind(B(t)),
- t
- }
- return e = i,
- (t = [
- {
- key: 'expandPackageId',
- value: function (e) {
- this.setState({
- expandedPackageId: e
- })
- }
- },
- {
- key: 'selectProPlan',
- value: function (e) {
- this.setState({
- selectedProPlanId: e
- })
- }
- },
- {
- key: 'selectPlusPlan',
- value: function (e) {
- this.setState({
- selectedPlusPlanId: e
- })
- }
- },
- {
- key: 'render',
- value: function () {
- var t = this,
- e = this.props.packages[m],
- n = this.props.packages[f],
- a = this.props.packages[h],
- r = this.props.packages[g],
- o = F(F({
- }, this.props), {
- }, {
- basicPackage: e,
- maxButtons: 1
- }),
- i = this.props.orgCurrentPackage;
- return s.createElement(s.Fragment, null, s.createElement('section', {
- className: 'subscription-packages__all'
- }, s.createElement(p, I({
- package: F(F({
- }, n), {
- }, {
- features: [
- ].concat(q(e.features), q(n.features))
- }),
- plan: c.find(n.plans, function (e) {
- return e.id === (t.state.selectedPlusPlanId || D())
- }),
- features: A(this.props.packages, f, !0),
- isCollapsed: this.state.expandedPackageId !== f,
- onCollapse: this.expandPackageId.bind(this, null),
- onExpand: this.expandPackageId.bind(this, f),
- selectPlan: this.selectPlusPlan,
- showSlider: !0
- }, o)), s.createElement(p, I({
- package: a,
- plan: c.find(a.plans, function (e) {
- return e.id === (t.state.selectedProPlanId || j())
- }),
- features: A(this.props.packages, h, !0),
- includesFeaturesFrom: 'Plus',
- learnMoreLink: s.createElement(u, {
- package: a,
- useNewText: !0
- }),
- isCollapsed: this.state.expandedPackageId !== h,
- onCollapse: this.expandPackageId.bind(this, null),
- onExpand: this.expandPackageId.bind(this, h),
- selectPlan: this.selectProPlan,
- showSlider: !0
- }, o)), s.createElement(p, I({
- package: r,
- plan: c.find(r.plans, function (e) {
- return e.id === x
- }),
- features: A(this.props.packages, g, !0),
- includesFeaturesFrom: 'Pro',
- learnMoreLink: s.createElement(u, {
- package: r,
- useNewText: !0
- }),
- isCollapsed: this.state.expandedPackageId !== g,
- onCollapse: this.expandPackageId.bind(this, null),
- onExpand: this.expandPackageId.bind(this, g)
- }, o))), !this.props.hideAdSupported && this.props.useAdSupportedCard && s.createElement('div', {
- className: 'subscription-packages__all spacing-top-double'
- }, s.createElement(p, I({
- package: e,
- plan: c.find(e.plans, function (e) {
- return e.id === y
- }),
- features: A(this.props.packages, m),
- learnMoreLink: s.createElement('div', {
- className: 'subscription-package__info'
- }, 'We offer a free, ad-supported version of Disqus Comments to eligible publishers.'),
- subscribeText: i && i.id !== m ? 'Downgrade Now' : void 0,
- isCollapsed: this.state.expandedPackageId !== m,
- onCollapse: this.expandPackageId.bind(this, null),
- onExpand: this.expandPackageId.bind(this, m)
- }, o))), !this.props.hideAdSupported && !this.props.useAdSupportedCard && s.createElement(l, I({
- package: e,
- plan: c.find(e.plans, function (e) {
- return e.id === y
- })
- }, o)))
- }
- }
- ]) && L(e.prototype, t),
- n && L(e, n),
- i
- }();
- return n.propTypes = {
- packages: function (e, t, a, r, o) {
- for (var i, n = arguments.length, s = Array(5 < n ? n - 5 : 0), l = 5; l < n; l++) s[l - 5] = arguments[l];
- return o = o || t,
- (i = e[t]) ? c.chain(T).map(function (e, n) {
- return d.isRequired.apply(d, [
- i,
- n,
- ''.concat(a),
- r,
- ''.concat(o, '[').concat(n, ']')
- ].concat(s)) || c.chain(e).map(function (t) {
- return c.find(i[n].plans, function (e) {
- return e.id === t
- }) ? null : Error('A plan with id '.concat(t, ' is required in `').concat(a, '`, prop `').concat(o, '[').concat(n, ']`, but its value is `null`.'))
- }).compact().value() [0]
- }).compact().value() [0] : Error('The '.concat(r, ' `').concat(o, '` is required in `').concat(a, '`, but its value is `null`.'))
- },
- orgBilling: a,
- orgCurrentPackage: d,
- pollsOrgCurrentPackage: d,
- orgCurrentPackageWillCancel: e.bool,
- orgTrial: r,
- subscribeText: e.string,
- onRequestInfo: e.func,
- onSubscribe: e.func,
- onStartTrial: e.func,
- newSubscriptionFlow: e.bool,
- useAdSupportedCard: e.bool,
- hideAdSupported: e.bool,
- organization: e.object.isRequired
- },
- n
- }.apply(t, n)) || (e.exports = n)
- },
- 51: function (e, t, n) {
- var n = [
- t,
- n(30)
- ],
- n = function (n, t) {
- 'use strict';
- n.LIST_TYPES = {
- WHITELIST: 'whitelist',
- BLACKLIST: 'blacklist'
- },
- n.BAN_TYPES = {
- SHADOW: 'shadowban',
- PERMANENT: 'permanent',
- TEMP: 'temp'
- },
- n.RETROACTIVE_ACTION_TYPES = {
- DO_NOTHING: '',
- DELETE: '1',
- MARK_AS_SPAM: '2'
- },
- n.DEFAULT_FORM_VALUES = {
- durationHours: '24',
- customDurationAmount: '1',
- customDurationScale: '1'
- },
- n.STORAGE_KEY_BAN_TYPE = 'defaultBan',
- n.getDateExpires = function (e) {
- return 'custom' === e.durationHours && (e.durationHours = parseInt(e.customDurationAmount, 10) * parseInt(e.customDurationScale, 10)),
- t().add(e.durationHours, 'hours').toISOString()
- },
- n.isBanTypeSupported = function (e, t) {
- return !!t && (e === n.BAN_TYPES.SHADOW ? t.shadowBanning : e === n.BAN_TYPES.TEMP ? t.temporaryBanning : !!e)
- }
- }.apply(t, n);
- void 0 === n || (e.exports = n)
- },
- 513: function (e, t, n) {
- 'use strict';
- function r(e) {
- return (r = 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator ? function (e) {
- return typeof e
- }
- : function (e) {
- return e && 'function' == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? 'symbol' : typeof e
- }) (e)
- }
- function s(e, t) {
- for (var n = 0; n < t.length; n++) {
- var a = t[n];
- a.enumerable = a.enumerable || !1,
- a.configurable = !0,
- 'value' in a && (a.writable = !0),
- Object.defineProperty(e, a.key, a)
- }
- }
- function l(e, t) {
- return (l = Object.setPrototypeOf || function (e, t) {
- return e.__proto__ = t,
- e
- }) (e, t)
- }
- function c(n) {
- var a = function () {
- if ('undefined' == typeof Reflect || !Reflect.construct) return !1;
- if (Reflect.construct.sham) return !1;
- if ('function' == typeof Proxy) return !0;
- try {
- return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [
- ], function () {
- })),
- !0
- } catch (e) {
- return !1
- }
- }();
- return function () {
- var e,
- t = o(n);
- return e = a ? (e = o(this).constructor, Reflect.construct(t, arguments, e)) : t.apply(this, arguments),
- t = this,
- !(e = e) || 'object' !== r(e) && 'function' != typeof e ? function (e) {
- if (void 0 !== e) return e;
- throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called')
- }(t) : e
- }
- }
- function o(e) {
- return (o = Object.setPrototypeOf ? Object.getPrototypeOf : function (e) {
- return e.__proto__ || Object.getPrototypeOf(e)
- }) (e)
- }
- n = [
- n(25),
- n(26),
- n(514)
- ],
- void 0 === (n = function (o, e, i) {
- var t = function () {
- !function (e, t) {
- if ('function' != typeof t && null !== t) throw new TypeError('Super expression must either be null or a function');
- e.prototype = Object.create(t && t.prototype, {
- constructor: {
- value: e,
- writable: !0,
- configurable: !0
- }
- }),
- t && l(e, t)
- }(r, o.Component);
- var e,
- t,
- n,
- a = c(r);
- function r(e) {
- return function (e, t) {
- if (!(e instanceof t)) throw new TypeError('Cannot call a class as a function')
- }(this, r),
- (e = a.call(this, e)).state = {
- isOpen: !1
- },
- e
- }
- return e = r,
- (t = [
- {
- key: 'open',
- value: function (e) {
- e.preventDefault(),
- this.setState({
- isOpen: !0
- })
- }
- },
- {
- key: 'close',
- value: function () {
- this.setState({
- isOpen: !1
- })
- }
- },
- {
- key: 'render',
- value: function () {
- return o.createElement('div', {
- className: 'trial-terms '.concat(this.props.className)
- }, o.createElement('div', {
- className: 'trial-terms__single-line'
- }, o.createElement('a', {
- href: '#',
- onClick: this.open.bind(this),
- className: 'spacing-bottom-narrow inline__item'
- }, 'See Free Trial Terms'), o.createElement('div', {
- className: 'spacing-bottom inline__item'
- }, ' | Cancel anytime')), o.createElement('div', {
- className: 'trial-terms__multi-line'
- }, o.createElement('a', {
- href: '#',
- onClick: this.open.bind(this),
- className: 'spacing-bottom-narrow'
- }, 'See Free Trial Terms'), o.createElement('div', {
- className: 'spacing-bottom'
- }, 'Cancel anytime')), o.createElement(i, {
- isOpen: this.state.isOpen,
- onClose: this.close.bind(this)
- }))
- }
- }
- ]) && s(e.prototype, t),
- n && s(e, n),
- r
- }();
- return t.propTypes = {
- className: e.string
- },
- t
- }.apply(t, n)) || (e.exports = n)
- },
- 514: function (e, t, n) {
- 'use strict';
- var n = [
- n(25),
- n(36),
- n(26)
- ],
- n = function (t, n, e) {
- function a(e) {
- return t.createElement(n, {
- isOpen: e.isOpen,
- onRequestClose: e.onClose,
- className: 'terms-modal modal-frame',
- ariaHideApp: !1,
- overlayClassName: 'modal-overlay -dark'
- }, t.createElement('div', {
- className: 'terms-modal-body'
- }, t.createElement('h3', {
- className: 'text-center spacing-bottom'
- }, 'Disqus Free Trial Terms'), t.createElement('p', {
- className: 'spacing-bottom'
- }, '30-day free trial: *First month of subscription to Disqus Plus or Disqus Pro (as applicable) (each, a "Monthly Plan" or “Annual Plan”), starting from the date of enrollment, is free. Valid payment information must be provided at the time of enrollment. You will be notified via e-mail of the approaching expiration of your trial period prior to the expiration date. You can cancel your free trial at any time. To continue using the selected Monthly Plan after your 30-day trial, you\'ll be charged on a monthly basis at the then-current fee for the service(s) you\'ve selected until you cancel or change to a free plan. To continue using the selected Annual Plan after your 30-day trial, you\'ll be charged yearly amount according to the then-current fee for the service(s) you\'ve selected until you cancel or change to a free plan. You can cancel your subscription and request a refund within 7 days after your trial expires.')))
- }
- return a.propTypes = {
- isOpen: e.bool,
- onClose: e.func
- },
- a
- }.apply(t, n);
- void 0 === n || (e.exports = n)
- },
- 515: function (e, t, n) {
- 'use strict';
- function r(e) {
- return (r = 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator ? function (e) {
- return typeof e
- }
- : function (e) {
- return e && 'function' == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? 'symbol' : typeof e
- }) (e)
- }
- function N() {
- return (N = Object.assign || function (e) {
- for (var t = 1; t < arguments.length; t++) {
- var n,
- a = arguments[t];
- for (n in a) Object.prototype.hasOwnProperty.call(a, n) && (e[n] = a[n])
- }
- return e
- }).apply(this, arguments)
- }
- function a(t, e) {
- var n,
- a = Object.keys(t);
- return Object.getOwnPropertySymbols && (n = Object.getOwnPropertySymbols(t), e && (n = n.filter(function (e) {
- return Object.getOwnPropertyDescriptor(t, e).enumerable
- })), a.push.apply(a, n)),
- a
- }
- function C(t) {
- for (var e = 1; e < arguments.length; e++) {
- var n = null != arguments[e] ? arguments[e] : {
- };
- e % 2 ? a(Object(n), !0).forEach(function (e) {
- j(t, e, n[e])
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(n)) : a(Object(n)).forEach(function (e) {
- Object.defineProperty(t, e, Object.getOwnPropertyDescriptor(n, e))
- })
- }
- return t
- }
- function R(e, t) {
- for (var n = 0; n < t.length; n++) {
- var a = t[n];
- a.enumerable = a.enumerable || !1,
- a.configurable = !0,
- 'value' in a && (a.writable = !0),
- Object.defineProperty(e, a.key, a)
- }
- }
- function x(e, t) {
- return (x = Object.setPrototypeOf || function (e, t) {
- return e.__proto__ = t,
- e
- }) (e, t)
- }
- function A(n) {
- var a = function () {
- if ('undefined' == typeof Reflect || !Reflect.construct) return !1;
- if (Reflect.construct.sham) return !1;
- if ('function' == typeof Proxy) return !0;
- try {
- return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [
- ], function () {
- })),
- !0
- } catch (e) {
- return !1
- }
- }();
- return function () {
- var e,
- t = o(n);
- return e = a ? (e = o(this).constructor, Reflect.construct(t, arguments, e)) : t.apply(this, arguments),
- t = this,
- !(e = e) || 'object' !== r(e) && 'function' != typeof e ? D(t) : e
- }
- }
- function D(e) {
- if (void 0 === e) throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called');
- return e
- }
- function o(e) {
- return (o = Object.setPrototypeOf ? Object.getPrototypeOf : function (e) {
- return e.__proto__ || Object.getPrototypeOf(e)
- }) (e)
- }
- function j(e, t, n) {
- return t in e ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n,
- e
- }
- n = [
- n(25),
- n(26),
- n(7),
- n(33),
- n(172),
- n(101),
- n(102),
- n(43)
- ],
- void 0 === (n = function (s, e, c, t, l, u, p, n) {
- var a = t.ORG_BILLING_SHAPE,
- r = t.TRIAL_SHAPE,
- d = t.PACKAGE_SHAPE,
- m = t.DISQUS_POLLS_AD_SUPPORTED_PACKAGE_ID,
- f = t.DISQUS_POLLS_BUSINESS_PACKAGE_ID,
- h = t.DISQUS_POLLS_PRO_PACKAGE_ID,
- g = t.DISQUS_POLLS_AD_SUPPORTED_PLAN_ID,
- o = t.DISQUS_POLLS_PRO_250K_PLAN_ID,
- i = t.DISQUS_POLLS_PRO_ANNUAL_250K_PLAN_ID,
- y = t.DISQUS_POLLS_PRO_1_5M_PLAN_ID,
- b = t.DISQUS_POLLS_PRO_1_5M_YEARLY_PLAN_ID,
- v = t.DISQUS_POLLS_PRO_3M_PLAN_ID,
- _ = t.DISQUS_POLLS_PRO_3M_YEARLY_PLAN_ID,
- E = t.DISQUS_POLLS_PRO_10M_PLAN_ID,
- O = t.DISQUS_POLLS_PRO_10M_YEARLY_PLAN_ID,
- S = t.DISQUS_POLLS_BUSINESS_PLAN_ID,
- w = n.getPollsPackageFeatureList,
- P = n.getCurrentProAnnualPlanId,
- k = (j(n = {
- }, m, [
- g
- ]), j(n, h, [
- o,
- i,
- y,
- b,
- v,
- _,
- E,
- O
- ]), j(n, f, [
- S
- ]), n),
- n = function () {
- !function (e, t) {
- if ('function' != typeof t && null !== t) throw new TypeError('Super expression must either be null or a function');
- e.prototype = Object.create(t && t.prototype, {
- constructor: {
- value: e,
- writable: !0,
- configurable: !0
- }
- }),
- t && x(e, t)
- }(i, s.Component);
- var e,
- t,
- n,
- o = A(i);
- function i(e) {
- !function (e, t) {
- if (!(e instanceof t)) throw new TypeError('Cannot call a class as a function')
- }(this, i);
- var t = o.call(this, e),
- n = e.pollsOrgCurrentPackage,
- a = n && n.plans.find(function (e) {
- return e.isSubscribed
- }),
- r = !1;
- return a ? r = 'year' === a.interval : e.orgCurrentPackage && (r = (e = e.orgCurrentPackage.plans.find(function (e) {
- return e.isSubscribed
- })) && 'year' === e.interval),
- t.state = {
- expandedPackageId: h,
- selectedProPlanId: n && n.id === h && a ? a.id : r ? _ : v
- },
- t.expandPackageId = t.expandPackageId.bind(D(t)),
- t.selectProPlan = t.selectProPlan.bind(D(t)),
- t
- }
- return e = i,
- (t = [
- {
- key: 'expandPackageId',
- value: function (e) {
- this.setState({
- expandedPackageId: e
- })
- }
- },
- {
- key: 'selectProPlan',
- value: function (e) {
- this.setState({
- selectedProPlanId: e
- })
- }
- },
- {
- key: 'render',
- value: function () {
- var t = this,
- e = this.props.packages[m],
- n = this.props.packages[h],
- a = this.props.packages[f],
- r = C(C({
- }, this.props), {
- }, {
- basicPackage: e,
- maxButtons: 1
- });
- return s.createElement(s.Fragment, null, s.createElement('section', {
- className: 'subscription-packages__all'
- }, s.createElement(p, N({
- package: n,
- plan: c.find(n.plans, function (e) {
- return e.id === (t.state.selectedProPlanId || P())
- }),
- features: w(h),
- learnMoreLink: s.createElement(u, {
- package: n,
- useNewText: !0
- }),
- isCollapsed: this.state.expandedPackageId !== h,
- onCollapse: this.expandPackageId.bind(this, null),
- onExpand: this.expandPackageId.bind(this, h),
- selectPlan: this.selectProPlan,
- showSlider: !0
- }, r)), s.createElement(p, N({
- package: a,
- plan: c.find(a.plans, function (e) {
- return e.id === S
- }),
- features: w(f),
- includesFeaturesFrom: 'Pro',
- learnMoreLink: s.createElement(u, {
- package: a,
- useNewText: !0
- }),
- isCollapsed: this.state.expandedPackageId !== f,
- onCollapse: this.expandPackageId.bind(this, null),
- onExpand: this.expandPackageId.bind(this, f)
- }, r))), !this.props.hideAdSupported && this.props.useAdSupportedCard && s.createElement('div', {
- className: 'subscription-packages__all spacing-top-double'
- }, s.createElement(p, N({
- package: e,
- plan: c.find(e.plans, function (e) {
- return e.id === g
- }),
- features: w(e),
- learnMoreLink: s.createElement('div', {
- className: 'subscription-package__info'
- }, 'We offer a free, ad-supported version of Disqus Polls to eligible publishers.'),
- subscribeText: 'Subscribe',
- isCollapsed: this.state.expandedPackageId !== e,
- onCollapse: this.expandPackageId.bind(this, null),
- onExpand: this.expandPackageId.bind(this, e)
- }, r))), !this.props.hideAdSupported && !this.props.useAdSupportedCard && s.createElement(l, N({
- package: e,
- plan: c.find(e.plans, function (e) {
- return e.id === g
- })
- }, r)))
- }
- }
- ]) && R(e.prototype, t),
- n && R(e, n),
- i
- }();
- return n.propTypes = {
- packages: function (e, t, a, r, o) {
- for (var i, n = arguments.length, s = Array(5 < n ? n - 5 : 0), l = 5; l < n; l++) s[l - 5] = arguments[l];
- return o = o || t,
- (i = e[t]) ? c.chain(k).map(function (e, n) {
- return d.isRequired.apply(d, [
- i,
- n,
- ''.concat(a),
- r,
- ''.concat(o, '[').concat(n, ']')
- ].concat(s)) || c.chain(e).map(function (t) {
- return c.find(i[n].plans, function (e) {
- return e.id === t
- }) ? null : Error('A plan with id '.concat(t, ' is required in `').concat(a, '`, prop `').concat(o, '[').concat(n, ']`, but its value is `null`.'))
- }).compact().value() [0]
- }).compact().value() [0] : Error('The '.concat(r, ' `').concat(o, '` is required in `').concat(a, '`, but its value is `null`.'))
- },
- orgBilling: a,
- orgCurrentPackage: d,
- pollsOrgCurrentPackage: d,
- pollsOrgCurrentPackageWillCancel: e.bool,
- pollsOrgTrial: r,
- subscribeText: e.string,
- onRequestInfo: e.func,
- onSubscribe: e.func,
- onStartTrial: e.func,
- newSubscriptionFlow: e.bool,
- useAdSupportedCard: e.bool,
- hideAdSupported: e.bool,
- organization: e.object.isRequired
- },
- n
- }.apply(t, n)) || (e.exports = n)
- },
- 516: function (e, t, n) {
- 'use strict';
- function r(e) {
- return (r = 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator ? function (e) {
- return typeof e
- }
- : function (e) {
- return e && 'function' == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? 'symbol' : typeof e
- }) (e)
- }
- function s(e, t) {
- for (var n = 0; n < t.length; n++) {
- var a = t[n];
- a.enumerable = a.enumerable || !1,
- a.configurable = !0,
- 'value' in a && (a.writable = !0),
- Object.defineProperty(e, a.key, a)
- }
- }
- function l(e, t) {
- return (l = Object.setPrototypeOf || function (e, t) {
- return e.__proto__ = t,
- e
- }) (e, t)
- }
- function c(n) {
- var a = function () {
- if ('undefined' == typeof Reflect || !Reflect.construct) return !1;
- if (Reflect.construct.sham) return !1;
- if ('function' == typeof Proxy) return !0;
- try {
- return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [
- ], function () {
- })),
- !0
- } catch (e) {
- return !1
- }
- }();
- return function () {
- var e,
- t = o(n);
- return e = a ? (e = o(this).constructor, Reflect.construct(t, arguments, e)) : t.apply(this, arguments),
- t = this,
- !(e = e) || 'object' !== r(e) && 'function' != typeof e ? function (e) {
- if (void 0 !== e) return e;
- throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called')
- }(t) : e
- }
- }
- function o(e) {
- return (o = Object.setPrototypeOf ? Object.getPrototypeOf : function (e) {
- return e.__proto__ || Object.getPrototypeOf(e)
- }) (e)
- }
- n = [
- n(25),
- n(26)
- ],
- void 0 === (n = function (o, e) {
- function i(e) {
- var t = e.question,
- n = e.answer,
- a = e.expanded,
- e = e.onToggleExpanded;
- return o.createElement('li', {
- className: 'subscriptions-faq__item'.concat(a ? ' expanded' : '')
- }, o.createElement('div', {
- className: 'fieldset align--between'
- }, o.createElement('div', null, o.createElement('h4', {
- className: 'question text-large spacing-bottom-small',
- onClick: e
- }, t), o.createElement('p', {
- className: 'answer text-medium'
- }, n)), o.createElement('span', {
- className: 'icon '.concat(a ? 'icon-arrow' : 'icon-right-bracket'),
- onClick: e
- })))
- }
- i.propTypes = {
- question: e.string.isRequired,
- answer: e.node.isRequired,
- expanded: e.bool,
- onToggleExpanded: e.func.isRequired
- };
- var t = function () {
- !function (e, t) {
- if ('function' != typeof t && null !== t) throw new TypeError('Super expression must either be null or a function');
- e.prototype = Object.create(t && t.prototype, {
- constructor: {
- value: e,
- writable: !0,
- configurable: !0
- }
- }),
- t && l(e, t)
- }(r, o.Component);
- var e,
- t,
- n,
- a = c(r);
- function r(e) {
- return function (e, t) {
- if (!(e instanceof t)) throw new TypeError('Cannot call a class as a function')
- }(this, r),
- (e = a.call(this, e)).state = {
- expandedIndex: 0
- },
- e
- }
- return e = r,
- (t = [
- {
- key: 'render',
- value: function () {
- var n = this,
- e = [
- {
- question: 'How does Disqus pricing work?',
- answer: o.createElement(o.Fragment, null, 'Pricing for Disqus Comments and Polls is based on the number of monthly pageviews for your website (for multi-website organizations, we use the ', o.createElement('i', null, 'cumulative'), ' number of monthly pageviews for all of the sites you add Disqus to). Please choose the price point that most accurately reflects your site or sites’ monthly pageviews number. Sites that regularly exceed their monthly pageview limit will be contacted to upgrade to an appropriate plan tier. Business plans feature custom pricing. Please reach out to us at ', o.createElement('a', {
- href: 'mailto:publisher-success@disqus.com'
- }, 'publisher-success@disqus.com'), ' with any questions.')
- },
- {
- question: 'How does Disqus measure traffic for our site?',
- answer: o.createElement(o.Fragment, null, o.createElement('div', null, 'Disqus measures traffic by the number of times the Disqus comment embed or poll module loads on your site, which happens on every page load where Disqus Comments or Polls are enabled. Page loads that do not have Disqus do not count towards the traffic measured by Disqus.'), o.createElement('div', {
- className: 'spacing-top-small'
- }, 'For publishers who use both Disqus Comments and Polls, traffic is measured separately for each product. '))
- },
- {
- question: 'I don’t see the Basic plan anywhere. Can I still use Disqus for free?',
- answer: o.createElement(o.Fragment, null, o.createElement('div', null, 'Yes, we still offer free, ad-supported versions of Disqus for publishers who meet certain eligibility requirements. In order to be eligible for our free, ad-supported plans, your site must A) have ads properly enabled and viewable upon page load, and B) meet the quality standards of the Disqus advertising network. For more info on eligibility requirements, ', o.createElement('a', {
- href: 'https://help.disqus.com/en/articles/4555311-disqus-advertising-qualification'
- }, 'see here'), '.'), o.createElement('div', {
- className: 'spacing-top-small'
- }, 'We also offer a revenue-sharing program for eligible sites who want to earn a portion of the revenue generated by ad placements in the Disqus comment embed. To learn more, please get in touch with us directly by emailing ', o.createElement('a', {
- href: 'mailto:publisher-success@disqus.com'
- }, 'publisher-success@disqus.com'), '.'), o.createElement('div', {
- className: 'spacing-top-small'
- }, 'Publishers looking to choose the free, ad-supported Polls plan will have to undergo a review process to determine eligibility. Publishers not deemed eligible will need to choose a paid plan to use Disqus Polls.'))
- },
- {
- question: 'How does the free trial work?',
- answer: 'We offer 30-day free trial periods for Disqus Comments Plus, Disqus Comments Pro, and Polls Pro. Submitting a valid payment method is required to begin a free trial. You can cancel anytime during your free trial period. At the conclusion of the free trial period, you will be charged the monthly or annual fee for the plan you selected.'
- },
- {
- question: 'Will I get access to Polls as part of my current Disqus Comments plan?',
- answer: 'No, Polls is a completely standalone product and must be purchased separately.'
- },
- {
- question: 'Do I need to use Disqus Comments to use Disqus Polls?',
- answer: 'No, any publisher can use Disqus Polls, regardless of whether they use Disqus Comments, another provider’s comment tool, or no comments at all. Disqus Polls is a separate, standalone product available to all publishers.'
- },
- {
- question: 'What forms of payment do you accept?',
- answer: 'We accept all major credit cards.'
- },
- {
- question: 'Does Disqus offer a discount for nonprofits?',
- answer: o.createElement(o.Fragment, null, 'If you are a small, nonprofit site, you may be eligible for a free subscription to our Comments Plus plan. You can learn more by emailing ', o.createElement('a', {
- href: 'mailto:publisher-success@disqus.com'
- }, 'publisher-success@disqus.com'), '.')
- },
- {
- question: 'How do I switch to a different plan?',
- answer: 'You can switch to a new plan at any time by going to the Subscription & Billing page in your account. Select the plan you’d like to switch to and immediately start using new features.'
- },
- {
- question: 'How do I cancel my Disqus subscription?',
- answer: o.createElement(o.Fragment, null, 'You can cancel your Disqus subscription at any time by emailing ', o.createElement('a', {
- href: 'mailto:cancellation@disqus.com'
- }, 'cancellation@disqus.com'), '.')
- }
- ];
- return o.createElement('div', null, o.createElement('header', {
- className: 'settings__header'
- }, o.createElement('h2', {
- className: 'text-gray-darker text-larger spacing-bottom-small'
- }, 'Frequently Asked Questions'), o.createElement('p', {
- className: 'text-gray'
- }, 'Your question not answered here?', ' ', o.createElement('a', {
- href: 'mailto:publisher-success@disqus.com'
- }, 'Contact our support team'), ' for help.')), o.createElement('div', {
- className: 'settings__content'
- }, o.createElement('ul', {
- className: 'subscriptions-faq'
- }, e.map(function (e, t) {
- return o.createElement(i, {
- key: t,
- question: e.question,
- answer: e.answer,
- expanded: t === n.state.expandedIndex,
- onToggleExpanded: function () {
- n.setState({
- expandedIndex: n.state.expandedIndex === t ? - 1 : t
- })
- }
- })
- })), o.createElement('a', {
- className: 'button button-medium button-fill--brand marketing-button button-padding-wider spacing-top',
- href: 'https://help.disqus.com/customer/en/portal/articles/2744736-subscription-payments-faq'
- }, 'Read All FAQs')))
- }
- }
- ]) && s(e.prototype, t),
- n && s(e, n),
- r
- }();
- return t.displayName = 'FAQs',
- t.propTypes = {
- newSubscriptionFlow: e.bool
- },
- t
- }.apply(t, n)) || (e.exports = n)
- },
- 520: function (e, t, n) {
- var n = [
- n(37),
- n(7),
- n(34)
- ],
- n = function (d, t, m) {
- 'use strict';
- function n(e) {
- for (var n = m.isFeatureActive('embed_refresh', {
- forum: e
- }), t = n && m.isFeatureActive('embed_refresh_v2', {
- forum: e
- }), a = d('#reactions').width(), r = d('.reaction-item').map(function (e, t) {
- return n ? Math.ceil(d(t) [0].getBoundingClientRect().width) : d(t).width()
- }).get(), o = 0, i = [
- ]; !s && o < d('.reaction-item').length; ) for (var s = !0, l = Math.ceil(r.length / (o += 1)), i = [
- ], c = 0; c < o; c++) {
- var u = r.slice(l * c, l * (c + 1)),
- p = 24 * (u.length - 1),
- p = u.reduce(function (e, t) {
- return e + t
- }, 0) + (n && !t ? p : 0);
- if (a <= p) {
- s = !1;
- break
- }
- i.push(p)
- }
- n && d('.reaction-tooltip').each(function (e, t) {
- 16 < d(t).height() && (t.style.top = '-68px')
- }),
- d('.reaction-items__container').width(Math.max.apply(null, i) + 1)
- }
- function a(e) {
- var t = d('.reaction-items').width();
- t !== e._lastReactionsWidth && (e._lastReactionsWidth = t, n(e.forum))
- }
- return {
- attachReactionsListener: function (e) {
- e._lastReactionsWidth = d('.reaction-items').width();
- e._reactionsResizeListener = t.debounce(t.partial(a, e), 200),
- d(window).resize(e._reactionsResizeListener)
- },
- formatReactionsItems: n,
- detachReactionsListener: function (e) {
- e._reactionsResizeListener && d(window).off('resize', e._reactionsResizeListener)
- }
- }
- }.apply(t, n);
- void 0 === n || (e.exports = n)
- },
- 521: function (e, t, n) {
- 'use strict';
- var n = [
- n(25),
- n(61),
- n(522),
- n(54),
- n(34)
- ],
- n = function (p, d, m, f, h) {
- return function (e) {
- var t = e.reactionsList,
- n = e.prompt,
- a = e.onSubmitReaction,
- r = e.error,
- o = e.readonly,
- i = e.userCanModerate,
- s = e.forum,
- l = h.isFeatureActive('embed_refresh', {
- forum: s
- }),
- c = l && h.isFeatureActive('embed_refresh_v2', {
- forum: s
- }),
- u = l ? 'reactions-refresh' : '',
- e = t.reduce(function (e, t) {
- return e + ('number' == typeof t.votes ? t.votes : 0)
- }, 0),
- s = t.some(function (e) {
- return e.isSelected
- });
- return p.createElement('div', {
- id: 'reactions',
- className: u
- }, p.createElement('div', {
- className: 'text-bold align align--center spacing-bottom-small prompt'
- }, n && n.trim() || f.DEFAULT_PROMPT), p.createElement('div', {
- className: 'align align--center spacing-bottom'
- }, 1 === e ? d.gettext('1 Response') : d.gettext('%(voteCount)s Responses', {
- voteCount: e
- })), p.createElement('div', {
- className: [
- 'reaction-items',
- o ? 'readonly' : '',
- s ? 'has-selection' : '',
- i || s || o ? 'counts-visible' : ''
- ].join(' ').trim()
- }, p.createElement(m, {
- reactionsList: t,
- onSubmitReaction: a,
- showVoteCount: i || s || o,
- readonly: o,
- isRefreshEnabled: l,
- isRefreshV2Enabled: c
- })), p.createElement('div', {
- className: 'err text-semibold'
- }, r || ''))
- }
- }.apply(t, n);
- void 0 === n || (e.exports = n)
- },
- 522: function (e, t, n) {
- 'use strict';
- function o(t, e) {
- var n,
- a = Object.keys(t);
- return Object.getOwnPropertySymbols && (n = Object.getOwnPropertySymbols(t), e && (n = n.filter(function (e) {
- return Object.getOwnPropertyDescriptor(t, e).enumerable
- })), a.push.apply(a, n)),
- a
- }
- function g(a) {
- for (var e = 1; e < arguments.length; e++) {
- var r = null != arguments[e] ? arguments[e] : {
- };
- e % 2 ? o(Object(r), !0).forEach(function (e) {
- var t,
- n;
- n = r[t = e],
- t in (e = a) ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(a, Object.getOwnPropertyDescriptors(r)) : o(Object(r)).forEach(function (e) {
- Object.defineProperty(a, e, Object.getOwnPropertyDescriptor(r, e))
- })
- }
- return a
- }
- n = [
- n(25),
- n(54)
- ],
- void 0 === (n = function (h, r) {
- return function (e) {
- function o(e, t) {
- n && !i && n(e, t)
- }
- var n = e.onSubmitReaction,
- t = e.showVoteCount,
- i = e.readonly,
- s = e.isRefreshEnabled,
- l = e.isRefreshV2Enabled,
- a = s ? 'reaction-items__container--refresh' : '',
- c = s ? 'reaction-item reaction-item--refresh' : 'reaction-item align align--column align--middle spacing-bottom-narrow',
- u = s ? 'reaction-item__button reaction-item__button--refresh' : 'align align--middle align--column reaction-item__button',
- p = s ? 'reaction-item__votes reaction-item__votes--refresh' : 'reaction-item__votes',
- d = s ? 'reaction-item__votes-wrapper reaction-item__votes-wrapper--refresh' : 'reaction-item__votes-wrapper',
- m = s ? 'reaction-item__image-wrapper reaction-item__image-wrapper--refresh' : 'reaction-item__image-wrapper',
- f = s ? 'reaction-item__image reaction-item__image--refresh' : 'reaction-item__image',
- e = e.reactionsList.map(function (e) {
- if (!e.imageUrl) return e;
- var t = e.imageUrl.split('/'),
- n = r.DEFAULT_REACTIONS.filter(function (e) {
- e = e.imageUrl.split('/');
- return e[e.length - 1].split('-') [0].split('.') [0] === t[t.length - 1].split('-') [0].split('.') [0]
- }),
- n = (n.length ? n[0] : e).imageUrl;
- return g(g({
- }, e), {
- }, {
- imageUrl: n
- })
- });
- return h.createElement('div', {
- className: 'align align--center align--wrap reaction-items__container '.concat(a)
- }, e.map(function (a, r) {
- return h.createElement('div', {
- key: r,
- className: [
- c,
- n ? 'reaction-item__enabled' : 'reaction-item__disabled',
- a.isSelected ? 'reaction-item__selected' : ''
- ].join(' ').trim()
- }, h.createElement('div', {
- className: u,
- tabIndex: i ? '-1' : '0',
- onKeyPress: function (e) {
- var t,
- n;
- t = r,
- n = a,
- 13 === e.keyCode && o(t, n)
- },
- onClick: function () {
- return o(r, a)
- }
- }, h.createElement('div', {
- className: m
- }, a.imageUrl ? h.createElement('img', {
- className: f,
- src: a.imageUrl,
- title: a.text || 'reaction '.concat(r),
- alt: a.text || 'reaction '.concat(r)
- }) : null, !l && t ? h.createElement('div', {
- className: d
- }, h.createElement('div', {
- className: p
- }, void 0 !== a.votes && t ? a.votes || 0 : ' ')) : null), l ? h.createElement('div', {
- className: 'reaction-vote'
- }, t ? h.createElement('div', {
- className: d
- }, h.createElement('div', {
- className: p
- }, void 0 !== a.votes && t ? function (e) {
- if (999 < e) {
- var t = '' + e;
- return e < 9999 ? ''.concat(t[0], '.').concat(t[1], 'k') : e < 99999 ? ''.concat(t.slice(0, 2), '.').concat(t[2], 'k') : e < 999999 ? ''.concat(t.slice(0, 3), '.').concat(t[3], 'k') : ''.concat(t[0], '.').concat(t[1], 'm')
- }
- return e
- }(a.votes) || 0 : ' ')) : null) : null, (e = a, (!s || l) && e.text && e.text.trim() ? h.createElement('div', {
- className: 'reaction-item__text'
- }, a.text) : null)), s && !l ? h.createElement('div', {
- className: 'reaction-tooltip'
- }, h.createElement('span', {
- className: 'reaction-tooltip__text'
- }, a.text), h.createElement('div', {
- className: 'reaction-tooltip__triangle'
- }, h.createElement('div', {
- className: 'reaction-tooltip__inner-triangle'
- }))) : null);
- var e
- }))
- }
- }.apply(t, n)) || (e.exports = n)
- },
- 523: function (e, t, n) {
- 'use strict';
- var n = [
- n(25),
- n(177)
- ],
- n = function (o, i) {
- function s(e) {
- if (!e || !~e.indexOf(':')) return {
- };
- var n = {
- };
- return e.split(';').forEach(function (e) {
- var t = e.split(':').map(function (e) {
- return e.trim()
- });
- 0 < t[0].indexOf('-') && (e = t[0].split('-'), t[0] = e[0] + (e[1][0] || '').toUpperCase() + e[1].slice(1)),
- n[t.splice(0, 1) [0]] = t.join(':')
- }),
- n
- }
- function l(e, t) {
- return e && e.replace('{postCount}', t.toLocaleString())
- }
- return function (e) {
- var t = e.postCount,
- n = e.buttonText,
- a = e.buttonCSS,
- r = e.titleText;
- return o.createElement('div', {
- id: 'behind-click__container'
- }, e.titleEnabled ? o.createElement('h3', {
- id: 'behind-click__title',
- style: s(e.titleCSS)
- }, l(r, t)) : null, o.createElement('button', {
- id: 'thread-visibility__button',
- className: 'btn alert',
- 'data-action': 'toggle-thread-visibility',
- style: s(a)
- }, l(n || i.DEFAULT_BUTTON_TEXT, t)))
- }
- }.apply(t, n);
- void 0 === n || (e.exports = n)
- },
- 524: function (e, t, n) {
- var n = [
- n(7),
- n(39)
- ],
- n = function (t, n) {
- 'use strict';
- function e(e, t) {
- this.namespace = e,
- this.ttl = t || 300,
- this.cache = this.getFromStorage()
- }
- return t.extend(e.prototype, {
- getItem: function (e) {
- var t = this.cache[e];
- if (t) {
- if (!this.isExpired(t)) return t.value;
- delete this.cache[e]
- }
- },
- getCurrentTime: function () {
- return Math.floor((new Date).getTime() / 1000)
- },
- persist: function () {
- n.set(this.namespace, this.cache)
- },
- getFromStorage: function () {
- var e = n.get(this.namespace);
- return t.isObject(e) ? e : {
- }
- },
- isExpired: function (e) {
- return this.getCurrentTime() > e.expiry
- },
- setItem: function (e, t) {
- this.cache[e] = {
- value: t,
- expiry: this.getCurrentTime() + this.ttl
- },
- this.persist()
- },
- removeItem: function (e) {
- delete this.cache[e],
- this.persist()
- },
- getAll: function () {
- var e = t.chain(this.cache).map(function (e, t) {
- return this.getItem(t)
- }, this).compact().value();
- return this.persist(),
- e
- }
- }),
- e
- }.apply(t, n);
- void 0 === n || (e.exports = n)
- },
- 525: function (e, t, n) {
- var a = function (e) {
- return (e || 0).toLocaleString(void 0, {
- style: 'percent',
- maximumFractionDigits: 2
- })
- };
- e.exports = a
- },
- 54: function (e, t, n) {
- var n = [
- t,
- n(61)
- ],
- n = function (e, t) {
- 'use strict';
- var n = t.get,
- t = '//c.disquscdn.com/next/current/publisher-admin/assets/img/emoji/';
- e.DEFAULT_REACTIONS = [
- {
- text: 'Upvote',
- imageUrl: t + 'upvote-512x512.png'
- },
- {
- text: 'Funny',
- imageUrl: t + 'funny-512x512.png'
- },
- {
- text: 'Love',
- imageUrl: t + 'love-512x512.png'
- },
- {
- text: 'Surprised',
- imageUrl: t + 'surprised-512x512.png'
- },
- {
- text: 'Angry',
- imageUrl: t + 'angry-512x512.png'
- },
- {
- text: 'Sad',
- imageUrl: t + 'sad-512x512.png'
- }
- ],
- e.DEFAULT_PROMPT = n('What do you think?'),
- e.DEFAULT_DESCRIPTIONS = [
- 'Upvote',
- 'Funny',
- 'Love',
- 'Surprised',
- 'Angry',
- 'Sad'
- ],
- e.UPLOAD_IMAGE_ERROR_MESSAGES = {
- 'invalid-image-file': 'Unfortunately your image upload failed. Please verify that the file is valid and in a supported format (JPEG, PNG, or GIF).',
- 'invalid-content-type': 'Unfortunately your image upload failed. Please verify that the file is in a supported format (JPEG, PNG, or GIF).',
- 'file-too-large': 'Unfortunately your image upload failed. Please verify that your image is under 5MB.',
- 'not-authenticated': 'You must be logged in to upload an image.',
- default:
- 'Unfortunately your image upload failed. Please verify that your image is in a supported format (JPEG, PNG, or GIF) and under 5MB. If you continue seeing this error, please try again later.'
- }
- }.apply(t, n);
- void 0 === n || (e.exports = n)
- },
- 59: function (e, t, n) {
- t = function (e) {
- 'use strict';
- e.ACTION_TYPES = {
- AWARD: 'award',
- REMOVE: 'remove'
- },
- e.BADGES_CRITERIA = {
- MANUAL: 'MANUAL',
- COMMENTS: 'COMMENTS',
- FEATURED_COMMENTS: 'FEATURED_COMMENTS',
- COMMENT_UPVOTES: 'COMMENT_UPVOTES'
- },
- e.MAX_BADGE_COUNT = 8
- }.apply(t, [
- t
- ]);
- void 0 === t || (e.exports = t)
- },
- 60: function (e, t, n) {
- var n = [
- n(37),
- n(7),
- n(35),
- n(268),
- n(269)
- ],
- n = function (n, a, e, t, r) {
- 'use strict';
- var o,
- i = window.document,
- s = /^[a-zA-Z0-9.!#$%&'*+-/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/,
- l = RegExp('([^@.]|^)\\b(?:\\w[\\w-]*:/{0,3}(?:(?:\\w+:)?\\w+@)?)?([\\w-]+\\.)+(?:' + (e.TLDS || 'zw|zuerich|zone|zm|zip|za|yt|youtube|yokohama|yoga|yodobashi|ye|yandex|yachts|xyz|xxx|xin|xerox|wtf|wtc|ws|world|works|work|wme|win|williamhill|wiki|wien|whoswho|wf|weir|wedding|wed|website|webcam|watch|wang|wales|vu|voyage|voto|voting|vote|vodka|vn|vlaanderen|vision|villas|video|viajes|vi|vg|vet|versicherung|ventures|vegas|ve|vc|vacations|va|uz|uy|us|uol|uno|university|uk|ug|ua|tz|tw|tv|tui|tt|trust|travel|training|trading|trade|tr|toys|town|tours|toshiba|toray|top|tools|tokyo|today|to|tn|tm|tl|tk|tj|tirol|tires|tips|tienda|tickets|theater|th|tg|tf|tennis|temasek|tel|technology|tech|team|td|tc|taxi|tax|tattoo|tatar|taipei|sz|systems|sydney|sy|sx|swiss|sv|suzuki|surgery|surf|support|supply|supplies|sucks|su|style|study|st|sr|spreadbetting|spiegel|space|soy|sony|solutions|solar|sohu|software|social|so|sn|sm|sl|sky|sk|sj|site|singles|si|shriram|show|shoes|shiksha|sh|sg|sexy|sex|sew|services|sener|seat|se|sd|scot|science|schwarz|schule|school|scholarships|schmidt|scb|sca|sc|sb|saxo|sarl|sap|samsung|sale|saarland|sa|ryukyu|rw|run|ruhr|ru|rsvp|rs|rodeo|rocks|ro|rip|rio|rich|reviews|review|restaurant|rest|republican|report|repair|rentals|rent|ren|reit|reisen|reise|rehab|redstone|red|recipes|realtor|re|racing|quebec|qpon|qa|py|pw|pub|pt|ps|property|properties|prof|productions|prod|pro|press|praxi|pr|post|porn|poker|pohl|pn|pm|plus|plumbing|place|pl|pk|pizza|pink|pictures|pictet|pics|piaget|physio|photos|photography|photo|philips|pharmacy|ph|pg|pf|pe|party|parts|partners|paris|panerai|page|pa|ovh|otsuka|osaka|organic|org|oracle|ooo|online|onl|ong|one|om|okinawa|nz|nyc|nu|ntt|nrw|nra|nr|np|no|nl|nissan|ninja|nico|ni|nhk|ngo|ng|nf|nexus|news|new|neustar|network|net|nec|ne|nc|navy|name|nagoya|nadex|na|mz|my|mx|mw|mv|museum|mu|mtpc|mtn|mt|ms|mr|mq|mp|movie|mov|motorcycles|moscow|mortgage|mormon|money|monash|moe|moda|mobi|mo|mn|mma|mm|ml|mk|mini|mil|miami|mh|mg|menu|memorial|meme|melbourne|meet|media|me|md|mc|marriott|markets|marketing|market|mango|management|maison|maif|madrid|ma|ly|lv|luxury|luxe|lu|ltda|lt|ls|lr|love|lotto|lotte|london|lol|loans|loan|lk|link|limo|limited|lighting|life|lidl|liaison|li|lgbt|legal|leclerc|lease|lds|lc|lb|lawyer|latrobe|lat|land|lacaixa|la|kz|kyoto|ky|kw|kred|krd|kr|kp|komatsu|koeln|kn|km|kiwi|kitchen|kim|ki|kh|kg|ke|kddi|kaufen|juegos|jp|joburg|jobs|jo|jm|jewelry|jetzt|je|jcb|java|iwc|it|is|irish|ir|iq|io|investments|international|int|insure|institute|ink|ing|info|infiniti|industries|in|immobilien|immo|im|il|ifm|ie|id|icu|ibm|hu|ht|hr|how|house|hosting|host|horse|honda|homes|holiday|holdings|hockey|hn|hm|hk|hiv|hitachi|hiphop|hermes|here|help|healthcare|haus|hangout|hamburg|gy|gw|guru|guitars|guide|guge|gu|gt|gs|gripe|green|gratis|graphics|gr|gq|gp|gov|gop|google|goog|goo|golf|goldpoint|gold|gn|gmx|gmo|gmail|gm|globo|global|gle|glass|gl|gives|gifts|gift|gi|gh|ggee|gg|gf|gent|ge|gdn|gd|gbiz|gb|garden|gallery|gal|ga|futbol|furniture|fund|frogans|frl|fr|foundation|forsale|forex|football|foo|fo|fm|fly|flsmidth|flowers|florist|flights|fk|fj|fitness|fit|fishing|fish|firmdale|financial|finance|film|fi|feedback|fashion|farm|fans|fan|faith|fail|express|exposed|expert|exchange|everbank|events|eus|eurovision|eu|et|estate|esq|es|erni|er|equipment|epson|enterprises|engineering|engineer|energy|emerck|email|eg|ee|education|edu|ec|eat|dz|dvag|durban|download|doosan|domains|doha|dog|docs|do|dnp|dm|dk|dj|discount|directory|direct|digital|diet|diamonds|dev|design|desi|dentist|dental|democrat|delivery|degree|deals|de|dclk|day|datsun|dating|date|dance|dad|dabur|cz|cyou|cymru|cy|cx|cw|cv|cuisinella|cu|cruises|crs|cricket|creditcard|credit|cr|courses|country|coop|cool|cooking|contractors|consulting|construction|condos|computer|company|community|com|cologne|college|coffee|codes|coach|co|cn|cm|club|clothing|clinic|click|cleaning|claims|cl|ck|city|citic|ci|church|chrome|christmas|chloe|cheap|chat|channel|ch|cg|cfd|cfa|cf|cern|ceo|center|cd|cc|cbn|catering|cat|casino|cash|casa|cartier|cars|careers|career|care|cards|caravan|capital|capetown|canon|cancerresearch|camp|camera|cal|cafe|cab|ca|bzh|bz|by|bw|bv|buzz|business|builders|build|budapest|bt|bs|brussels|brother|broker|bridgestone|br|boutique|boo|bond|boats|bo|bnpparibas|bn|bmw|bm|blue|bloomberg|blackfriday|black|bj|biz|bio|bingo|bike|bid|bi|bh|bg|bf|best|berlin|beer|be|bd|bbc|bb|bayern|bauhaus|bargains|barclays|barclaycard|bar|bank|band|ba|az|axa|ax|aw|autos|auto|audio|auction|au|attorney|at|associates|asia|as|arpa|army|archi|ar|aquarelle|aq|apartments|ao|android|an|amsterdam|am|alsace|allfinanz|al|airforce|aig|ai|agency|ag|afl|af|aero|ae|adult|ads|ad|actor|active|accountants|accountant|accenture|academy|ac|abogado|abbott|abb') + ')(?!\\.\\w)\\b(?::\\d+)?(?:[/?][^\\s\\{\\}\\|\\\\\\^\\[\\]`<>"\\x80-\\xFF\\x00-\\x1F\\x7F]*)?', 'g'),
- c = /^[\w-]+:\/{0,3}/,
- u = /([.,]+)$/g,
- p = /[\u0021-\u002F\u003A-\u0040\u005B-\u0060\u007B-\u007E\u00A1-\u00BF\u2010-\u2027\u2030-\u205E\u2300-\u23FF\u2E00-\u2E7F\u3001-\u303F\uFE10-\uFE19\uFE30-\uFE4F\uFE50-\uFE6B\uFF01-\uFF0F\uFF1A-\uFF20\uFF3B-\uFF40\uFF5B-\uFF60\uFF5F-\uFF64]+$/,
- d = (o = i.createElement('fakeelement'), function (e, t) {
- return void 0 !== o.style[t]
- }),
- e = a.find({
- transition: 'transitionend',
- OTransition: 'otransitionend',
- MozTransition: 'transitionend',
- WebkitTransition: 'webkitTransitionEnd'
- }, d) || null,
- d = a.find({
- animation: 'animationend',
- OAnimation: 'oAnimationEnd',
- MozAnimation: 'animationend',
- WebkitAnimation: 'webkitAnimationEnd'
- }, d) || null;
- function m(t) {
- return function (e) {
- return e && e.preventDefault && e.preventDefault(),
- t.apply(this, arguments)
- }
- }
- function f(t) {
- return function (e) {
- return e && e.stopPropagation && e.stopPropagation(),
- t.apply(this, arguments)
- }
- }
- var h,
- g;
- return {
- validateEmail: function (e) {
- return s.test(e)
- },
- isUrl: function (e) {
- return !!e.match(l)
- },
- bleachFindUrls: function (e) {
- var t,
- n,
- a = [
- ];
- if (!e) return a;
- for (; t = l.exec(e); ) {
- n = (n = t[0]).slice((o = t[1]).length),
- u.lastIndex = 0,
- (r = u.exec(n)) && (n = n.slice(0, n.length - r[0].length));
- var r = c.test(n) ? n : 'http://' + n,
- o = t.index + o.length;
- a.push({
- text: n,
- url: r,
- index: o,
- endIndex: o + n.length
- })
- }
- return a
- },
- niceTruncate: function (e, t) {
- if (e.length <= t) return e;
- var n = e = e.slice(0, t - 1),
- t = /(^.*\S)\s/.exec(e),
- t = p.exec(e = t ? t[1] : e);
- return (e = (e = t ? e.slice(0, e.length - t[0].length) : e).length < 0.5 * n.length ? n : e) + '…'
- },
- transitionEndEvent: e,
- animationEndEvent: d,
- isMobileUserAgent: r,
- preventDefaultHandler: m,
- stopPropagationHandler: f,
- stopEventHandler: function (e) {
- return m(f(e))
- },
- getDomain: function (e) {
- if (!e) return '';
- e = 'http://' + e.replace(/^([a-z+.-]+:)?\/+/i, '');
- var t = i.createElement('a');
- return t.href = e,
- t.hostname.replace(/^www\d*\./i, '').toLowerCase()
- },
- serializeArgs: function (e) {
- var n = [
- ];
- return a.each(e, function (e, t) {
- void 0 !== e && n.push(t + (null === e ? '' : '=' + encodeURIComponent(e)))
- }),
- n.join('&')
- },
- serialize: function (e, t, n) {
- if (t && (~e.indexOf('?') ? '&' != (e[0 | e.length - 1] || '') && (e += '&') : e += '?', e += this.serializeArgs(t)), n) {
- var a = {
- };
- return a[(new Date).getTime()] = null,
- this.serialize(e, a)
- }
- return '&' == (e[0 | (a = e.length) - 1] || '') ? e.slice(0, a - 1) : e
- },
- openWindow: function (e, t, n) {
- return n ? a.extend(n, {
- location: 1,
- status: 1,
- resizable: 1,
- scrollbars: 1
- }) : n = {
- },
- n.width && n.height && a.defaults(n, {
- left: window.screen.width / 2 - n.width / 2,
- top: window.screen.height / 2 - n.height / 2
- }),
- n = a.map(n, function (e, t) {
- return t + '=' + e
- }).join(','),
- window.open(e, t, n)
- },
- insertWithWhitespace: function (e, t, n) {
- var a = e.substring(0, t = t < 0 ? 0 : t),
- t = e.substring(t);
- return a.length && !/\s$/.test(a) && (a += ' '),
- a + n + (t = !/^\s/.test(t) ? ' ' + t : t)
- },
- willOpenNewWindow: function (e, t) {
- return '_blank' === (t = t || n(e.currentTarget)).attr('target') || e.ctrlKey || e.metaKey || e.shiftKey || e.altKey
- },
- clickShouldBeLogged: (h = {
- }, g = /#.*$/, function (e, t) {
- if (e.isDefaultPrevented()) return !1;
- if (!t.is('a')) return !1;
- if (!(t.attr('href') || '').replace(g, '')) return !1;
- (t = (e = t).attr('data-tid')) || (t = a.uniqueId(), e.attr('data-tid', t)),
- e = t,
- t = (new Date).getTime();
- return !(h[e] && t - h[e] < 500) && (h[e] = t, !0)
- }),
- deepClone: function (e) {
- return void 0 === e ? null : JSON.parse(JSON.stringify(e))
- },
- browser: t,
- getInitials: function (e) {
- return e.split(' ').slice(0, 2).map(function (e) {
- return (e[0] || '').toUpperCase()
- }).join('')
- },
- isDefaultAvatar: function (e) {
- var t = 'noavatar92.png';
- return (e = e || '').slice(e.length - 14) === t
- },
- copyToClipboard: function (e) {
- const t = window.document.createElement('textarea');
- t.value = e,
- t.setAttribute('readonly', ''),
- t.style.position = 'absolute',
- t.style.left = '-9999px',
- window.document.body.appendChild(t),
- t.select(),
- window.document.execCommand('copy'),
- t.remove()
- }
- }
- }.apply(t, n);
- void 0 === n || (e.exports = n)
- },
- 61: function (e, t, n) {
- var n = [
- n(274),
- n(275)
- ],
- n = function (r, e) {
- 'use strict';
- var o = {
- translations: e,
- get: function (e) {
- var t = o.translations[e];
- return void 0 === t ? e : t
- }
- };
- return o.interpolate = function (n, a) {
- return n.replace(/%\(\w+\)s/g, function (e) {
- return t = e.slice(2, - 2),
- e = '',
- t in a ? e = null != a[t] ? '' + a[t] : '' : r.error('Key `' + t + '` not found in context for: ', n),
- e;
- var t
- })
- },
- o.gettext = function (n, a) {
- return n = o.get(n),
- a = a || {
- },
- n.split(/(%\(\w+\)s)/g).map(function (e) {
- var t = e.match(/%\((\w+)\)s/);
- return t && (t[1] in a ? e = a[t[1]] : r.error('Key `' + t[1] + '` not found in context for: ' + n)),
- '' === e ? null : e
- })
- },
- o
- }.apply(t, n);
- void 0 === n || (e.exports = n)
- },
- 66: function (e, t, n) {
- !function (e) {
- 'use strict';
- var o = n(270);
- e.exports = function e(t, n, a) {
- if (n && (~t.indexOf('?') ? '&' != (t[0 | t.length - 1] || '') && (t += '&') : t += '?', t += o(n)), a) {
- var r = {
- };
- return r[(new Date).getTime()] = null,
- e(t, r)
- }
- r = t.length;
- return '&' == (t[0 | r - 1] || '') ? t.slice(0, r - 1) : t
- }
- }(e)
- },
- 72: function (e, t, n) {
- 'use strict';
- function r(e) {
- return (r = 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator ? function (e) {
- return typeof e
- }
- : function (e) {
- return e && 'function' == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? 'symbol' : typeof e
- }) (e)
- }
- function s(e, t) {
- for (var n = 0; n < t.length; n++) {
- var a = t[n];
- a.enumerable = a.enumerable || !1,
- a.configurable = !0,
- 'value' in a && (a.writable = !0),
- Object.defineProperty(e, a.key, a)
- }
- }
- function l(e, t) {
- return (l = Object.setPrototypeOf || function (e, t) {
- return e.__proto__ = t,
- e
- }) (e, t)
- }
- function c(n) {
- var a = function () {
- if ('undefined' == typeof Reflect || !Reflect.construct) return !1;
- if (Reflect.construct.sham) return !1;
- if ('function' == typeof Proxy) return !0;
- try {
- return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [
- ], function () {
- })),
- !0
- } catch (e) {
- return !1
- }
- }();
- return function () {
- var e,
- t = o(n);
- return e = a ? (e = o(this).constructor, Reflect.construct(t, arguments, e)) : t.apply(this, arguments),
- t = this,
- !(e = e) || 'object' !== r(e) && 'function' != typeof e ? u(t) : e
- }
- }
- function u(e) {
- if (void 0 === e) throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called');
- return e
- }
- function o(e) {
- return (o = Object.setPrototypeOf ? Object.getPrototypeOf : function (e) {
- return e.__proto__ || Object.getPrototypeOf(e)
- }) (e)
- }
- n = [
- n(25),
- n(26),
- n(279)
- ],
- void 0 === (n = function (o, e, i) {
- var t = function () {
- !function (e, t) {
- if ('function' != typeof t && null !== t) throw new TypeError('Super expression must either be null or a function');
- e.prototype = Object.create(t && t.prototype, {
- constructor: {
- value: e,
- writable: !0,
- configurable: !0
- }
- }),
- t && l(e, t)
- }(r, o.Component);
- var e,
- t,
- n,
- a = c(r);
- function r(e) {
- return function (e, t) {
- if (!(e instanceof t)) throw new TypeError('Cannot call a class as a function')
- }(this, r),
- (e = a.call(this, e)).state = {
- isDropdownOpen: !1
- },
- e.openDropdown = e.openDropdown.bind(u(e)),
- e.closeDropdown = e.closeDropdown.bind(u(e)),
- e.handleListClick = e.handleListClick.bind(u(e)),
- e
- }
- return e = r,
- (t = [
- {
- key: 'openDropdown',
- value: function () {
- this.props.onOpen && this.props.onOpen(),
- this.setState({
- isDropdownOpen: !0
- })
- }
- },
- {
- key: 'closeDropdown',
- value: function () {
- this.props.onClose && this.props.onClose(),
- this.setState({
- isDropdownOpen: !1
- })
- }
- },
- {
- key: 'handleListClick',
- value: function () {
- this.props.autoClose && this.closeDropdown()
- }
- },
- {
- key: 'render',
- value: function () {
- return o.createElement(i, {
- className: this.props.className,
- dropdownClassName: this.props.dropdownClassName,
- buttonChildren: this.props.buttonChildren,
- onOpen: this.openDropdown,
- onClose: this.closeDropdown,
- isOpen: this.state.isDropdownOpen
- }, o.createElement('div', {
- onClick: this.handleListClick
- }, this.props.children))
- }
- }
- ]) && s(e.prototype, t),
- n && s(e, n),
- r
- }();
- return t.displayName = 'Dropdown',
- t.propTypes = {
- className: e.string,
- dropdownClassName: e.string,
- children: e.node,
- buttonChildren: e.node,
- onOpen: e.func,
- onClose: e.func,
- autoClose: e.bool
- },
- t
- }.apply(t, n)) || (e.exports = n)
- },
- 73: function (e, t, n) {
- 'use strict';
- function r(e) {
- return (r = 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator ? function (e) {
- return typeof e
- }
- : function (e) {
- return e && 'function' == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? 'symbol' : typeof e
- }) (e)
- }
- function i() {
- return (i = Object.assign || function (e) {
- for (var t = 1; t < arguments.length; t++) {
- var n,
- a = arguments[t];
- for (n in a) Object.prototype.hasOwnProperty.call(a, n) && (e[n] = a[n])
- }
- return e
- }).apply(this, arguments)
- }
- function s(e, t) {
- if (null == e) return {
- };
- var n,
- a = function (e, t) {
- if (null == e) return {
- };
- var n,
- a,
- r = {
- },
- o = Object.keys(e);
- for (a = 0; a < o.length; a++) ~t.indexOf(n = o[a]) || (r[n] = e[n]);
- return r
- }(e, t);
- if (Object.getOwnPropertySymbols) for (var r = Object.getOwnPropertySymbols(e), o = 0; o < r.length; o++) ~t.indexOf(n = r[o]) || Object.prototype.propertyIsEnumerable.call(e, n) && (a[n] = e[n]);
- return a
- }
- function l(e, t) {
- for (var n = 0; n < t.length; n++) {
- var a = t[n];
- a.enumerable = a.enumerable || !1,
- a.configurable = !0,
- 'value' in a && (a.writable = !0),
- Object.defineProperty(e, a.key, a)
- }
- }
- function c(e, t) {
- return (c = Object.setPrototypeOf || function (e, t) {
- return e.__proto__ = t,
- e
- }) (e, t)
- }
- function u(n) {
- var a = function () {
- if ('undefined' == typeof Reflect || !Reflect.construct) return !1;
- if (Reflect.construct.sham) return !1;
- if ('function' == typeof Proxy) return !0;
- try {
- return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [
- ], function () {
- })),
- !0
- } catch (e) {
- return !1
- }
- }();
- return function () {
- var e,
- t = o(n);
- return e = a ? (e = o(this).constructor, Reflect.construct(t, arguments, e)) : t.apply(this, arguments),
- t = this,
- !(e = e) || 'object' !== r(e) && 'function' != typeof e ? p(t) : e
- }
- }
- function p(e) {
- if (void 0 === e) throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called');
- return e
- }
- function o(e) {
- return (o = Object.setPrototypeOf ? Object.getPrototypeOf : function (e) {
- return e.__proto__ || Object.getPrototypeOf(e)
- }) (e)
- }
- n = [
- n(25),
- n(26)
- ],
- void 0 === (n = function (o, e) {
- var t = function () {
- !function (e, t) {
- if ('function' != typeof t && null !== t) throw new TypeError('Super expression must either be null or a function');
- e.prototype = Object.create(t && t.prototype, {
- constructor: {
- value: e,
- writable: !0,
- configurable: !0
- }
- }),
- t && c(e, t)
- }(r, o.Component);
- var e,
- t,
- n,
- a = u(r);
- function r(e) {
- return function (e, t) {
- if (!(e instanceof t)) throw new TypeError('Cannot call a class as a function')
- }(this, r),
- (e = a.call(this, e)).addListeners = e.addListeners.bind(p(e)),
- e.removeListeners = e.removeListeners.bind(p(e)),
- e.handleClick = e.handleClick.bind(p(e)),
- e
- }
- return e = r,
- (t = [
- {
- key: 'componentDidMount',
- value: function () {
- this.props.active && this.addListeners()
- }
- },
- {
- key: 'componentWillUnmount',
- value: function () {
- this.removeListeners()
- }
- },
- {
- key: 'componentWillReceiveProps',
- value: function (e) {
- this.props.active !== e.active && (e.active ? this.addListeners() : this.removeListeners())
- }
- },
- {
- key: 'addListeners',
- value: function () {
- window.document.addEventListener('click', this.handleClick),
- window.document.addEventListener('touchstart', this.handleClick)
- }
- },
- {
- key: 'removeListeners',
- value: function () {
- window.document.removeEventListener('click', this.handleClick),
- window.document.removeEventListener('touchstart', this.handleClick)
- }
- },
- {
- key: 'handleClick',
- value: function (e) {
- this.container && !this.container.contains(e.target) && this.props.onOutsideClick(e)
- }
- },
- {
- key: 'render',
- value: function () {
- var t = this,
- e = this.props,
- n = e.children,
- e = s(e, [
- 'children',
- 'onOutsideClick',
- 'active'
- ]);
- return o.createElement('div', i({
- }, e, {
- ref: function (e) {
- t.container = e
- }
- }), n)
- }
- }
- ]) && l(e.prototype, t),
- n && l(e, n),
- r
- }();
- return t.displayName = 'OutsideClick',
- t.propTypes = {
- active: e.bool,
- onOutsideClick: e.func.isRequired,
- children: e.node.isRequired
- },
- t.defaultProps = {
- active: !0
- },
- t
- }.apply(t, n)) || (e.exports = n)
- },
- 92: function (e, t, n) {
- t = function () {
- 'use strict';
- var e = 'https://',
- t = window.marketing_config && window.marketing_config.disqus_domain || 'disqus.com';
- return {
- accountSettings: e.concat(t, '/home/settings/account/'),
- accountSettingsMobile: e.concat(t, '/home/settings/'),
- admin: e.concat(t, '/admin/'),
- api: e.concat(t, '/api/docs/'),
- blog: 'https://blog.disqus.com/',
- brand: e.concat(t, '/brand/'),
- caseStudies: 'https://about.disqus.com/case-studies',
- channels: 'https://www.disqus.com/channels/',
- companyFacebook: 'https://www.facebook.com/disqus/',
- companyTwitter: 'https://twitter.com/disqus',
- companyInstagram: 'https://www.instagram.com/disqus',
- companyLinkedIn: 'https://www.linkedin.com/company/disqus',
- contactSupport: 'https://help.disqus.com',
- cookies: 'https://help.disqus.com/en/articles/1944034-cookies-and-data-recipients',
- advertiseOnDisqus: 'https://disqusads.com',
- data: 'https://data.disqus.com',
- disqus101: 'https://about.disqus.com/disqus-101',
- disqusContact: 'https://about.disqus.com/contact',
- disqusPro: 'https://disqus.com/landing/disqus-pro',
- disqusBusiness: 'https://disqus.com/landing/disqus-business',
- disqusBusinessContact: 'https://about.disqus.com/disqus-for-business-contact-form',
- disqusPollsAdSupportedContact: 'https://about.disqus.com/apply-for-ad-supported-polls',
- disqusPollsBusinessContact: 'https://about.disqus.com/disqus-polls-for-business-contact',
- disqusZetaSSP: 'https://disqus.com/landing/zeta-ssp',
- discussDisqus: 'https://disqus.com/channel/discussdisqus/',
- doNotSell: 'https://disqus.com/data-sharing-settings/',
- help: 'https://help.disqus.com/',
- home: e.concat(t, '/home/'),
- inbox: e.concat(t, '/home/notifications/'),
- installEngage: e.concat(t, '/admin/settings/install/'),
- learn: {
- howDoesDisqusWork: 'https://help.disqus.com/en/articles/1717050-how-does-disqus-work',
- communityTips: 'https://help.disqus.com/en/collections/191659-community-tips',
- increaseEngagement: 'https://help.disqus.com/en/articles/1717197-how-to-increase-reader-engagement-and-retention',
- moderating101: 'https://help.disqus.com/en/articles/1717078-moderating-101',
- developers: 'https://help.disqus.com/en/collections/191735-developer',
- otherIntegrations: 'https://help.disqus.com/en/collections/191781-other-integrations'
- },
- logIn: e.concat(t, '/profile/login/'),
- logInPublisher: e.concat(t, '/publishers/login/'),
- logOut: e.concat(t, '/logout/'),
- signUp: e.concat(t, '/profile/signup/'),
- signUpPublisher: e.concat(t, '/publishers/signup/'),
- pages: e.concat(t, '/pages/'),
- pricingPolls: e.concat(t, '/pricing/?product=polls'),
- profileUrlPrefix: e.concat(t, '/by'),
- privacy: 'https://disqus.com/privacy-policy',
- terms: 'https://help.disqus.com/customer/portal/articles/466260-terms-of-service',
- iosApp: 'https://itunes.apple.com/app/apple-store/id1006908426?pt=103468801&ct=Disqus.com%20Marketing%20Pages&mt=8',
- windowsApp: 'https://www.microsoft.com/store/apps/9WZDNCRDGCTR?cid=Disqus.com%20Marketing%20Pages'
- }
- }.apply(t, [
- ]);
- void 0 === t || (e.exports = t)
- },
- 94: function (e) {
- e.exports = JSON.parse('{"data":[{"id":"l:aa_DJ","type":"languages","attributes":{"code":"aa_DJ","name":"Afar (Djibouti)","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:aa_DJ"}},{"id":"l:ab","type":"languages","attributes":{"code":"ab","name":"Abkhaz","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:ab"}},{"id":"l:ace","type":"languages","attributes":{"code":"ace","name":"Acehnese","rtl":false,"plural_equation":"0","plural_rules":{"other":"everything"}},"links":{"self":"https://rest.api.transifex.com/languages/l:ace"}},{"id":"l:ach","type":"languages","attributes":{"code":"ach","name":"Acoli","rtl":false,"plural_equation":"(n > 1)","plural_rules":{"one":"n in 0..1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:ach"}},{"id":"l:ady","type":"languages","attributes":{"code":"ady","name":"Adyghe","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:ady"}},{"id":"l:aeb","type":"languages","attributes":{"code":"aeb","name":"Tunisian Arabic","rtl":true,"plural_equation":"n==0 ? 0 : n==1 ? 1 : n==2 ? 2 : n%100>=3 && n%100<=10 ? 3 : n%100>=11 && n%100<=99 ? 4 : 5","plural_rules":{"zero":"n is 0","one":"n is 1","two":"n is 2","many":"n mod 100 in 11..99","few":"n mod 100 in 3..10","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:aeb"}},{"id":"l:af","type":"languages","attributes":{"code":"af","name":"Afrikaans","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:af"}},{"id":"l:af_ZA","type":"languages","attributes":{"code":"af_ZA","name":"Afrikaans (South Africa)","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:af_ZA"}},{"id":"l:ak","type":"languages","attributes":{"code":"ak","name":"Akan","rtl":false,"plural_equation":"n > 1","plural_rules":{"one":"n in 0..1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:ak"}},{"id":"l:aln","type":"languages","attributes":{"code":"aln","name":"Albanian Gheg","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:aln"}},{"id":"l:am","type":"languages","attributes":{"code":"am","name":"Amharic","rtl":false,"plural_equation":"(n > 1)","plural_rules":{"one":"n in 0..1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:am"}},{"id":"l:am_ET","type":"languages","attributes":{"code":"am_ET","name":"Amharic (Ethiopia)","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:am_ET"}},{"id":"l:an","type":"languages","attributes":{"code":"an","name":"Aragonese","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:an"}},{"id":"l:ang","type":"languages","attributes":{"code":"ang","name":"Old English","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:ang"}},{"id":"l:ar","type":"languages","attributes":{"code":"ar","name":"Arabic","rtl":true,"plural_equation":"n==0 ? 0 : n==1 ? 1 : n==2 ? 2 : n%100>=3 && n%100<=10 ? 3 : n%100>=11 && n%100<=99 ? 4 : 5","plural_rules":{"zero":"n is 0","one":"n is 1","two":"n is 2","many":"n mod 100 in 11..99","few":"n mod 100 in 3..10","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:ar"}},{"id":"l:ar_AA","type":"languages","attributes":{"code":"ar_AA","name":"Arabic (Unitag)","rtl":true,"plural_equation":"n==0 ? 0 : n==1 ? 1 : n==2 ? 2 : n%100>=3 && n%100<=10 ? 3 : n%100>=11 && n%100<=99 ? 4 : 5","plural_rules":{"zero":"n is 0","one":"n is 1","two":"n is 2","many":"n mod 100 in 11..99","few":"n mod 100 in 3..10","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:ar_AA"}},{"id":"l:ar_AE","type":"languages","attributes":{"code":"ar_AE","name":"Arabic (U.A.E.)","rtl":true,"plural_equation":"n==0 ? 0 : n==1 ? 1 : n==2 ? 2 : n%100>=3 && n%100<=10 ? 3 : n%100>=11 && n%100<=99 ? 4 : 5","plural_rules":{"zero":"n is 0","one":"n is 1","two":"n is 2","many":"n mod 100 in 11..99","few":"n mod 100 in 3..10","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:ar_AE"}},{"id":"l:arb","type":"languages","attributes":{"code":"arb","name":"Modern Standard Arabic (MSA)","rtl":true,"plural_equation":"n==0 ? 0 : n==1 ? 1 : n==2 ? 2 : n%100>=3 && n%100<=10 ? 3 : n%100>=11 && n%100<=99 ? 4 : 5","plural_rules":{"zero":"n is 0","one":"n is 1","two":"n is 2","many":"n mod 100 in 11..99","few":"n mod 100 in 3..10","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:arb"}},{"id":"l:arc","type":"languages","attributes":{"code":"arc","name":"Aramaic","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:arc"}},{"id":"l:ar_DZ","type":"languages","attributes":{"code":"ar_DZ","name":"Arabic (Algeria)","rtl":true,"plural_equation":"n==0 ? 0 : n==1 ? 1 : n==2 ? 2 : n%100>=3 && n%100<=10 ? 3 : n%100>=11 && n%100<=99 ? 4 : 5","plural_rules":{"zero":"n is 0","one":"n is 1","two":"n is 2","many":"n mod 100 in 11..99","few":"n mod 100 in 3..10","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:ar_DZ"}},{"id":"l:ar_EG","type":"languages","attributes":{"code":"ar_EG","name":"Arabic (Egypt)","rtl":true,"plural_equation":"n==0 ? 0 : n==1 ? 1 : n==2 ? 2 : n%100>=3 && n%100<=10 ? 3 : n%100>=11 && n%100<=99 ? 4 : 5","plural_rules":{"zero":"n is 0","one":"n is 1","two":"n is 2","many":"n mod 100 in 11..99","few":"n mod 100 in 3..10","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:ar_EG"}},{"id":"l:ar_IQ","type":"languages","attributes":{"code":"ar_IQ","name":"Arabic (Iraq)","rtl":true,"plural_equation":"n==0 ? 0 : n==1 ? 1 : n==2 ? 2 : n%100>=3 && n%100<=10 ? 3 : n%100>=11 && n%100<=99 ? 4 : 5","plural_rules":{"zero":"n is 0","one":"n is 1","two":"n is 2","many":"n mod 100 in 11..99","few":"n mod 100 in 3..10","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:ar_IQ"}},{"id":"l:ar_JO","type":"languages","attributes":{"code":"ar_JO","name":"Arabic (Jordan)","rtl":true,"plural_equation":"n==0 ? 0 : n==1 ? 1 : n==2 ? 2 : n%100>=3 && n%100<=10 ? 3 : n%100>=11 && n%100<=99 ? 4 : 5","plural_rules":{"zero":"n is 0","one":"n is 1","two":"n is 2","many":"n mod 100 in 11..99","few":"n mod 100 in 3..10","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:ar_JO"}},{"id":"l:ar_LB","type":"languages","attributes":{"code":"ar_LB","name":"Arabic (Lebanon)","rtl":true,"plural_equation":"n==0 ? 0 : n==1 ? 1 : n==2 ? 2 : n%100>=3 && n%100<=10 ? 3 : n%100>=11 && n%100<=99 ? 4 : 5","plural_rules":{"zero":"n is 0","one":"n is 1","two":"n is 2","many":"n mod 100 in 11..99","few":"n mod 100 in 3..10","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:ar_LB"}},{"id":"l:arn","type":"languages","attributes":{"code":"arn","name":"Mapudungun","rtl":false,"plural_equation":"n > 1","plural_rules":{"one":"n in 0..1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:arn"}},{"id":"l:ar_QA","type":"languages","attributes":{"code":"ar_QA","name":"Arabic (Qatar)","rtl":false,"plural_equation":"n==0 ? 0 : n==1 ? 1 : n==2 ? 2 : n%100>=3 && n%100<=10 ? 3 : n%100>=11 && n%100<=99 ? 4 : 5","plural_rules":{"zero":"n is 0","one":"n is 1","two":"n is 2","many":"n mod 100 in 11..99","few":"n mod 100 in 3..10","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:ar_QA"}},{"id":"l:ar_SA","type":"languages","attributes":{"code":"ar_SA","name":"Arabic (Saudi Arabia)","rtl":true,"plural_equation":"(n==0 ? 0 : n==1 ? 1 : n==2 ? 2 : n%100>=3 && n%100<=10 ? 3 : n%100>=11 && n%100<=99 ? 4 : 5)","plural_rules":{"zero":"n is 0","one":"n is 1","two":"n is 2","many":"n mod 100 in 11..99","few":"n mod 100 in 3..10","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:ar_SA"}},{"id":"l:ar_SD","type":"languages","attributes":{"code":"ar_SD","name":"Arabic (Sudan)","rtl":true,"plural_equation":"n==0 ? 0 : n==1 ? 1 : n==2 ? 2 : n%100>=3 && n%100<=10 ? 3 : n%100>=11 && n%100<=99 ? 4 : 5","plural_rules":{"zero":"n is 0","one":"n is 1","two":"n is 2","many":"n mod 100 in 11..99","few":"n mod 100 in 3..10","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:ar_SD"}},{"id":"l:ar_SY","type":"languages","attributes":{"code":"ar_SY","name":"Arabic (Syria)","rtl":true,"plural_equation":"n==0 ? 0 : n==1 ? 1 : n==2 ? 2 : n%100>=3 && n%100<=10 ? 3 : n%100>=11 && n%100<=99 ? 4 : 5","plural_rules":{"zero":"n is 0","one":"n is 1","two":"n is 2","many":"n mod 100 in 11..99","few":"n mod 100 in 3..10","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:ar_SY"}},{"id":"l:ary","type":"languages","attributes":{"code":"ary","name":"Moroccan Arabic","rtl":false,"plural_equation":"n==0 ? 0 : n==1 ? 1 : n==2 ? 2 : n%100>=3 && n%100<=10 ? 3 : n%100>=11 && n%100<=99 ? 4 : 5","plural_rules":{"zero":"n is 0","one":"n is 1","two":"n is 2","many":"n mod 100 in 11..99","few":"n mod 100 in 3..10","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:ary"}},{"id":"l:as","type":"languages","attributes":{"code":"as","name":"Assamese","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:as"}},{"id":"l:as_IN","type":"languages","attributes":{"code":"as_IN","name":"Assamese (India)","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:as_IN"}},{"id":"l:ast","type":"languages","attributes":{"code":"ast","name":"Asturian","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:ast"}},{"id":"l:ast_ES","type":"languages","attributes":{"code":"ast_ES","name":"Asturian (Spain)","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:ast_ES"}},{"id":"l:ay","type":"languages","attributes":{"code":"ay","name":"Aymara","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:ay"}},{"id":"l:ayl","type":"languages","attributes":{"code":"ayl","name":"Libyan Arabic","rtl":false,"plural_equation":"n==0 ? 0 : n==1 ? 1 : n==2 ? 2 : n%100>=3 && n%100<=10 ? 3 : n%100>=11 && n%100<=99 ? 4 : 5","plural_rules":{"zero":"n is 0","one":"n is 1","two":"n is 2","many":"n mod 100 in 11..99","few":"n mod 100 in 3..10","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:ayl"}},{"id":"l:az","type":"languages","attributes":{"code":"az","name":"Azerbaijani","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:az"}},{"id":"l:az@Arab","type":"languages","attributes":{"code":"az@Arab","name":"Azerbaijani (Arabic)","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:az@Arab"}},{"id":"l:az_AZ","type":"languages","attributes":{"code":"az_AZ","name":"Azerbaijani (Azerbaijan)","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:az_AZ"}},{"id":"l:az_IR","type":"languages","attributes":{"code":"az_IR","name":"Azerbaijani (Iran)","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:az_IR"}},{"id":"l:az@latin","type":"languages","attributes":{"code":"az@latin","name":"Azerbaijani (Latin)","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:az@latin"}},{"id":"l:ba","type":"languages","attributes":{"code":"ba","name":"Bashkir","rtl":false,"plural_equation":"0","plural_rules":{"other":"everything"}},"links":{"self":"https://rest.api.transifex.com/languages/l:ba"}},{"id":"l:bal","type":"languages","attributes":{"code":"bal","name":"Balochi","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:bal"}},{"id":"l:bar","type":"languages","attributes":{"code":"bar","name":"Bavarian","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:bar"}},{"id":"l:bcq","type":"languages","attributes":{"code":"bcq","name":"Bench","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:bcq"}},{"id":"l:be","type":"languages","attributes":{"code":"be","name":"Belarusian","rtl":false,"plural_equation":"(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<12 || n%100>14) ? 1 : n%10==0 || (n%10>=5 && n%10<=9) || (n%100>=11 && n%100<=14)? 2 : 3)","plural_rules":{"one":"n mod 10 is 1 and n mod 100 is not 11","many":"n mod 10 is 0 or n mod 10 in 5..9 or n mod 100 in 11..14","few":"n mod 10 in 2..4 and n mod 100 not in 12..14","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:be"}},{"id":"l:be_BY","type":"languages","attributes":{"code":"be_BY","name":"Belarusian (Belarus)","rtl":false,"plural_equation":"(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<12 || n%100>14) ? 1 : n%10==0 || (n%10>=5 && n%10<=9) || (n%100>=11 && n%100<=14)? 2 : 3)","plural_rules":{"one":"n mod 10 is 1 and n mod 100 is not 11","many":"n mod 10 is 0 or n mod 10 in 5..9 or n mod 100 in 11..14","few":"n mod 10 in 2..4 and n mod 100 not in 12..14","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:be_BY"}},{"id":"l:bem","type":"languages","attributes":{"code":"bem","name":"Bemba","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:bem"}},{"id":"l:bem_ZM","type":"languages","attributes":{"code":"bem_ZM","name":"Bemba (Zambia)","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:bem_ZM"}},{"id":"l:ber","type":"languages","attributes":{"code":"ber","name":"Berber","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:ber"}},{"id":"l:be@tarask","type":"languages","attributes":{"code":"be@tarask","name":"Belarusian (Tarask)","rtl":false,"plural_equation":"(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<12 || n%100>14) ? 1 : n%10==0 || (n%10>=5 && n%10<=9) || (n%100>=11 && n%100<=14)? 2 : 3)","plural_rules":{"one":"n mod 10 is 1 and n mod 100 is not 11","many":"n mod 10 is 0 or n mod 10 in 5..9 or n mod 100 in 11..14","few":"n mod 10 in 2..4 and n mod 100 not in 12..14","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:be@tarask"}},{"id":"l:bg","type":"languages","attributes":{"code":"bg","name":"Bulgarian","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:bg"}},{"id":"l:bg_BG","type":"languages","attributes":{"code":"bg_BG","name":"Bulgarian (Bulgaria)","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:bg_BG"}},{"id":"l:bg@Cyrl","type":"languages","attributes":{"code":"bg@Cyrl","name":"Bulgarian (Cyrillic)","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:bg@Cyrl"}},{"id":"l:bg_US","type":"languages","attributes":{"code":"bg_US","name":"Bulgarian (United States)","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:bg_US"}},{"id":"l:bho","type":"languages","attributes":{"code":"bho","name":"Bhojpuri","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:bho"}},{"id":"l:bi","type":"languages","attributes":{"code":"bi","name":"Bislama","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:bi"}},{"id":"l:bm","type":"languages","attributes":{"code":"bm","name":"Bambara","rtl":false,"plural_equation":"0","plural_rules":{"other":"everything"}},"links":{"self":"https://rest.api.transifex.com/languages/l:bm"}},{"id":"l:bn","type":"languages","attributes":{"code":"bn","name":"Bengali","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:bn"}},{"id":"l:bn_BD","type":"languages","attributes":{"code":"bn_BD","name":"Bengali (Bangladesh)","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:bn_BD"}},{"id":"l:bn_IN","type":"languages","attributes":{"code":"bn_IN","name":"Bengali (India)","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:bn_IN"}},{"id":"l:bo","type":"languages","attributes":{"code":"bo","name":"Tibetan","rtl":false,"plural_equation":"0","plural_rules":{"other":"everything"}},"links":{"self":"https://rest.api.transifex.com/languages/l:bo"}},{"id":"l:bo_CN","type":"languages","attributes":{"code":"bo_CN","name":"Tibetan (China)","rtl":false,"plural_equation":"0","plural_rules":{"other":"everything"}},"links":{"self":"https://rest.api.transifex.com/languages/l:bo_CN"}},{"id":"l:bqi","type":"languages","attributes":{"code":"bqi","name":"Luri (Bakhtiari)","rtl":true,"plural_equation":"(n > 1)","plural_rules":{"one":"n <=1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:bqi"}},{"id":"l:bqi_IR","type":"languages","attributes":{"code":"bqi_IR","name":"Luri Bakhtiari (Iran)","rtl":true,"plural_equation":"(n > 1)","plural_rules":{"one":"n <=1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:bqi_IR"}},{"id":"l:br","type":"languages","attributes":{"code":"br","name":"Breton","rtl":false,"plural_equation":"((n%10 == 1) && (n%100 != 11) && (n%100 !=71) && (n%100 !=91) ? 0 :(n%10 == 2) && (n%100 != 12) && (n%100 !=72) && (n%100 !=92) ? 1 :(n%10 ==3 || n%10==4 || n%10==9) && (n%100 < 10 || n% 100 > 19) && (n%100 < 70 || n%100 > 79) && (n%100 < 90 || n%100 > 99) ? 2 :(n != 0 && n % 1000000 == 0) ? 3 : 4)","plural_rules":{"one":"n mod 10 is 1 and n mod 100 is not 11,71,91","two":"n mod 10 is 2 and n mod 100 is not 12,72,92","many":"n is not 0 and n mod 1000000 is 0","few":"n mod 10 is 3 or 4 or 9 and n mod 100 is not in 10..19 or 70..79 or 90..99","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:br"}},{"id":"l:br_FR","type":"languages","attributes":{"code":"br_FR","name":"Breton (France)","rtl":false,"plural_equation":"((n%10 == 1) && (n%100 != 11) && (n%100 !=71) && (n%100 !=91) ? 0 :(n%10 == 2) && (n%100 != 12) && (n%100 !=72) && (n%100 !=92) ? 1 :(n%10 ==3 || n%10==4 || n%10==9) && (n%100 < 10 || n% 100 > 19) && (n%100 < 70 || n%100 > 79) && (n%100 < 90 || n%100 > 99) ? 2 :(n != 0 && n % 1000000 == 0) ? 3 : 4)","plural_rules":{"one":"n mod 10 is 1 and n mod 100 is not 11,71,91","two":"n mod 10 is 2 and n mod 100 is not 12,72,92","many":"n is not 0 and n mod 1000000 is 0","few":"n mod 10 is 3 or 4 or 9 and n mod 100 is not in 10..19 or 70..79 or 90..99","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:br_FR"}},{"id":"l:brx","type":"languages","attributes":{"code":"brx","name":"Bodo","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:brx"}},{"id":"l:bs","type":"languages","attributes":{"code":"bs","name":"Bosnian","rtl":false,"plural_equation":"(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2)","plural_rules":{"one":"n mod 10 is 1 and n mod 100 is not 11","few":"n mod 10 in 2..4 and n mod 100 not in 11..20","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:bs"}},{"id":"l:bs_BA","type":"languages","attributes":{"code":"bs_BA","name":"Bosnian (Bosnia and Herzegovina)","rtl":false,"plural_equation":"(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2)","plural_rules":{"one":"n mod 10 is 1 and n mod 100 is not 11","few":"n mod 10 in 2..4 and n mod 100 not in 11..20","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:bs_BA"}},{"id":"l:bs_BA-SRP","type":"languages","attributes":{"code":"bs_BA-SRP","name":"Bosnian (Republika Srpska)","rtl":false,"plural_equation":"(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2)","plural_rules":{"one":"n mod 10 is 1 and n mod 100 is not 11","few":"n mod 10 in 2..4 and n mod 100 not in 11..20","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:bs_BA-SRP"}},{"id":"l:bua","type":"languages","attributes":{"code":"bua","name":"Buryat","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:bua"}},{"id":"l:ca","type":"languages","attributes":{"code":"ca","name":"Catalan","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:ca"}},{"id":"l:ca_ES","type":"languages","attributes":{"code":"ca_ES","name":"Catalan (Spain)","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:ca_ES"}},{"id":"l:cak","type":"languages","attributes":{"code":"cak","name":"Kaqchikel","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:cak"}},{"id":"l:ca@valencia","type":"languages","attributes":{"code":"ca@valencia","name":"Catalan (Valencian)","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:ca@valencia"}},{"id":"l:cdo","type":"languages","attributes":{"code":"cdo","name":"Chinese (Min Dong)","rtl":false,"plural_equation":"0","plural_rules":{"other":"everything"}},"links":{"self":"https://rest.api.transifex.com/languages/l:cdo"}},{"id":"l:ce","type":"languages","attributes":{"code":"ce","name":"Chechen","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:ce"}},{"id":"l:ceb","type":"languages","attributes":{"code":"ceb","name":"Cebuano","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:ceb"}},{"id":"l:cgg","type":"languages","attributes":{"code":"cgg","name":"Chiga","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:cgg"}},{"id":"l:ch","type":"languages","attributes":{"code":"ch","name":"Chamorro","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:ch"}},{"id":"l:chk","type":"languages","attributes":{"code":"chk","name":"Chuukese","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:chk"}},{"id":"l:chr","type":"languages","attributes":{"code":"chr","name":"Cherokee","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:chr"}},{"id":"l:cjy","type":"languages","attributes":{"code":"cjy","name":"Chinese (Jinyu)","rtl":false,"plural_equation":"0","plural_rules":{"other":"everything"}},"links":{"self":"https://rest.api.transifex.com/languages/l:cjy"}},{"id":"l:ckb","type":"languages","attributes":{"code":"ckb","name":"Central Kurdish","rtl":true,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:ckb"}},{"id":"l:cmn","type":"languages","attributes":{"code":"cmn","name":"Chinese (Mandarin)","rtl":false,"plural_equation":"0","plural_rules":{"other":"everything"}},"links":{"self":"https://rest.api.transifex.com/languages/l:cmn"}},{"id":"l:cnr","type":"languages","attributes":{"code":"cnr","name":"Montenegrin","rtl":false,"plural_equation":"(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2)","plural_rules":{"one":"n mod 10 is 1 and n mod 100 is not 11","few":"n mod 10 in 2..4 and n mod 100 not in 12..14","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:cnr"}},{"id":"l:cnx","type":"languages","attributes":{"code":"cnx","name":"Middle Cornish","rtl":false,"plural_equation":"n==0 ? 0 : n==1 ? 1 : (n % 100 ==2 || n % 100 ==22 || n % 100 ==42 || n % 100 ==62 || n % 100 ==82 || n % 1000 ==0) && (n mod 100000 in 1000..20000 || n % 100000 ==40000 || n % 100000 ==60000 || n % 100000 ==80000 or n!=0) && (n % 1000000 == 100000) ? 2 : n % 100 ==3 || n % 100 ==23 || n % 100 ==43 || n % 100 ==63 || n % 100 ==83 ? 3 : n!=1 && (n % 100 ==1 || n % 100 ==21 || n % 100 ==41 || n % 100 ==61 || n % 100 ==81) ? 4: 5","plural_rules":{"zero":"n is 0","one":"n is 1","two":"(n % 100 ==2 || n % 100 ==22 || n % 100 ==42 || n % 100 ==62 || n % 100 ==82 || n % 1000 ==0) && (n mod 100000 in 1000..20000 || n % 100000 ==40000 || n % 100000 ==60000 || n % 100000 ==80000 or n!=0) && (n % 1000000 == 100000)","many":"n!=1 && (n % 100 ==1 || n % 100 ==21 || n % 100 ==41 || n % 100 ==61 || n % 100 ==81)","few":"n % 100 ==3 || n % 100 ==23 || n % 100 ==43 || n % 100 ==63 || n % 100 ==83","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:cnx"}},{"id":"l:co","type":"languages","attributes":{"code":"co","name":"Corsican","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:co"}},{"id":"l:cpx","type":"languages","attributes":{"code":"cpx","name":"Chinese (Pu-Xian)","rtl":false,"plural_equation":"0","plural_rules":{"other":"everything"}},"links":{"self":"https://rest.api.transifex.com/languages/l:cpx"}},{"id":"l:crh","type":"languages","attributes":{"code":"crh","name":"Crimean Turkish","rtl":false,"plural_equation":"(n > 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:crh"}},{"id":"l:cs","type":"languages","attributes":{"code":"cs","name":"Czech","rtl":false,"plural_equation":"(n == 1 && n % 1 == 0) ? 0 : (n >= 2 && n <= 4 && n % 1 == 0) ? 1: (n % 1 != 0 ) ? 2 : 3","plural_rules":{"one":"n is 1","many":"n is decimal","few":"n in 2..4","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:cs"}},{"id":"l:csb","type":"languages","attributes":{"code":"csb","name":"Kashubian","rtl":false,"plural_equation":"n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2","plural_rules":{"one":"n is 1","few":"n mod 10 in 2..4 and n mod 100 not in 12..14","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:csb"}},{"id":"l:cs_CZ","type":"languages","attributes":{"code":"cs_CZ","name":"Czech (Czech Republic)","rtl":false,"plural_equation":"(n == 1 && n % 1 == 0) ? 0 : (n >= 2 && n <= 4 && n % 1 == 0) ? 1: (n % 1 != 0 ) ? 2 : 3","plural_rules":{"one":"n is 1","many":"n is decimal","few":"n in 2..4","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:cs_CZ"}},{"id":"l:cs@qtfiletype","type":"languages","attributes":{"code":"cs@qtfiletype","name":"Czech (QT FILETYPE)","rtl":false,"plural_equation":"(n == 1 && n % 1 == 0) ? 0 : (n >= 2 && n <= 4 && n % 1 == 0) ? 1 : 2","plural_rules":{"one":"n is 1","few":"n in 2..4","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:cs@qtfiletype"}},{"id":"l:cv","type":"languages","attributes":{"code":"cv","name":"Chuvash","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:cv"}},{"id":"l:cy","type":"languages","attributes":{"code":"cy","name":"Welsh","rtl":false,"plural_equation":"(n==1) ? 0 : (n==2) ? 1 : (n != 8 && n != 11) ? 2 : 3","plural_rules":{"one":"n is 1","two":"n is 2","many":"n is 8 or n is 11","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:cy"}},{"id":"l:cy_GB","type":"languages","attributes":{"code":"cy_GB","name":"Welsh (United Kingdom)","rtl":false,"plural_equation":"(n==1) ? 0 : (n==2) ? 1 : (n != 8 && n != 11) ? 2 : 3","plural_rules":{"one":"n is 1","two":"n is 2","many":"n is 8 or n is 11","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:cy_GB"}},{"id":"l:czh","type":"languages","attributes":{"code":"czh","name":"Chinese (Huizhou)","rtl":false,"plural_equation":"0","plural_rules":{"other":"everything"}},"links":{"self":"https://rest.api.transifex.com/languages/l:czh"}},{"id":"l:czo","type":"languages","attributes":{"code":"czo","name":"Chinese (Min Zhong)","rtl":false,"plural_equation":"0","plural_rules":{"other":"everything"}},"links":{"self":"https://rest.api.transifex.com/languages/l:czo"}},{"id":"l:da","type":"languages","attributes":{"code":"da","name":"Danish","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:da"}},{"id":"l:da_DK","type":"languages","attributes":{"code":"da_DK","name":"Danish (Denmark)","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:da_DK"}},{"id":"l:de","type":"languages","attributes":{"code":"de","name":"German","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:de"}},{"id":"l:de_AT","type":"languages","attributes":{"code":"de_AT","name":"German (Austria)","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:de_AT"}},{"id":"l:de_CH","type":"languages","attributes":{"code":"de_CH","name":"German (Switzerland)","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:de_CH"}},{"id":"l:de_DE","type":"languages","attributes":{"code":"de_DE","name":"German (Germany)","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:de_DE"}},{"id":"l:de_LU","type":"languages","attributes":{"code":"de_LU","name":"German (Luxembourg)","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:de_LU"}},{"id":"l:doi","type":"languages","attributes":{"code":"doi","name":"Dogri","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:doi"}},{"id":"l:dsb","type":"languages","attributes":{"code":"dsb","name":"Lower Sorbian","rtl":false,"plural_equation":"(n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || n%100==4 ? 2 : 3)","plural_rules":{"one":"n mod 100 is 1","two":"n mod 100 is 2","few":"n mod 100 in 3..4 ","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:dsb"}},{"id":"l:dtp","type":"languages","attributes":{"code":"dtp","name":"Kadazandusun","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:dtp"}},{"id":"l:dv","type":"languages","attributes":{"code":"dv","name":"Divehi","rtl":true,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:dv"}},{"id":"l:dz","type":"languages","attributes":{"code":"dz","name":"Dzongkha","rtl":false,"plural_equation":"0","plural_rules":{"other":"everything"}},"links":{"self":"https://rest.api.transifex.com/languages/l:dz"}},{"id":"l:dz_BT","type":"languages","attributes":{"code":"dz_BT","name":"Dzongkha (Bhutan)","rtl":false,"plural_equation":"0","plural_rules":{"other":"everything"}},"links":{"self":"https://rest.api.transifex.com/languages/l:dz_BT"}},{"id":"l:ee","type":"languages","attributes":{"code":"ee","name":"Ewe","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:ee"}},{"id":"l:el","type":"languages","attributes":{"code":"el","name":"Greek","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:el"}},{"id":"l:el_CY","type":"languages","attributes":{"code":"el_CY","name":"Greek (Cyprus)","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:el_CY"}},{"id":"l:el_DE","type":"languages","attributes":{"code":"el_DE","name":"Greek (Germany)","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:el_DE"}},{"id":"l:el_GR","type":"languages","attributes":{"code":"el_GR","name":"Greek (Greece)","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:el_GR"}},{"id":"l:en","type":"languages","attributes":{"code":"en","name":"English","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:en"}},{"id":"l:en_150","type":"languages","attributes":{"code":"en_150","name":"English (Europe)","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:en_150"}},{"id":"l:en_AE","type":"languages","attributes":{"code":"en_AE","name":"English (United Arab Emirates)","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:en_AE"}},{"id":"l:en_AL","type":"languages","attributes":{"code":"en_AL","name":"English (Albania)","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:en_AL"}},{"id":"l:en_AO","type":"languages","attributes":{"code":"en_AO","name":"English (Angola)","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:en_AO"}},{"id":"l:en_AR","type":"languages","attributes":{"code":"en_AR","name":"English (Argentina)","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:en_AR"}},{"id":"l:en_AR-B","type":"languages","attributes":{"code":"en_AR-B","name":"English (Argentina - Buenos Aires)","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:en_AR-B"}},{"id":"l:en_AR-C","type":"languages","attributes":{"code":"en_AR-C","name":"English (Argentina - Buenos Aires City)","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:en_AR-C"}},{"id":"l:en_AT","type":"languages","attributes":{"code":"en_AT","name":"English (Austria)","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:en_AT"}},{"id":"l:en_AU","type":"languages","attributes":{"code":"en_AU","name":"English (Australia)","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:en_AU"}},{"id":"l:en_BA","type":"languages","attributes":{"code":"en_BA","name":"English (Bosnia and Herzegovina)","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:en_BA"}},{"id":"l:en_BA-SRP","type":"languages","attributes":{"code":"en_BA-SRP","name":"English (Republika Srpska)","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:en_BA-SRP"}},{"id":"l:en_BB","type":"languages","attributes":{"code":"en_BB","name":"English (Barbados)","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:en_BB"}},{"id":"l:en_BD","type":"languages","attributes":{"code":"en_BD","name":"English (Bangladesh)","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:en_BD"}},{"id":"l:en_BE","type":"languages","attributes":{"code":"en_BE","name":"English (Belgium)","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:en_BE"}},{"id":"l:en_BG","type":"languages","attributes":{"code":"en_BG","name":"English (Bulgaria)","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:en_BG"}},{"id":"l:en_BH","type":"languages","attributes":{"code":"en_BH","name":"English (Bahrain)","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:en_BH"}},{"id":"l:en_BM","type":"languages","attributes":{"code":"en_BM","name":"English (Bermuda)","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:en_BM"}},{"id":"l:en_BN","type":"languages","attributes":{"code":"en_BN","name":"English (Brunei)","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:en_BN"}},{"id":"l:en_BO","type":"languages","attributes":{"code":"en_BO","name":"English (Bolivia)","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:en_BO"}},{"id":"l:en_BR","type":"languages","attributes":{"code":"en_BR","name":"English (Brazil)","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:en_BR"}},{"id":"l:en_BS","type":"languages","attributes":{"code":"en_BS","name":"English (Bahamas)","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:en_BS"}},{"id":"l:en_BW","type":"languages","attributes":{"code":"en_BW","name":"English (Botswana)","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:en_BW"}},{"id":"l:en_CA","type":"languages","attributes":{"code":"en_CA","name":"English (Canada)","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:en_CA"}},{"id":"l:en_CD","type":"languages","attributes":{"code":"en_CD","name":"English (Democratic Republic of the Congo)","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:en_CD"}},{"id":"l:en_CG","type":"languages","attributes":{"code":"en_CG","name":"English (Congo - Brazzaville)","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:en_CG"}},{"id":"l:en_CH","type":"languages","attributes":{"code":"en_CH","name":"English (Switzerland)","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:en_CH"}},{"id":"l:en_CI","type":"languages","attributes":{"code":"en_CI","name":"English (Côte d\'Ivoire)","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:en_CI"}},{"id":"l:en_CL","type":"languages","attributes":{"code":"en_CL","name":"English (Chile)","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:en_CL"}},{"id":"l:en_CM","type":"languages","attributes":{"code":"en_CM","name":"English (Cameroon)","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:en_CM"}},{"id":"l:en_CO","type":"languages","attributes":{"code":"en_CO","name":"English (Colombia)","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:en_CO"}},{"id":"l:en_CR","type":"languages","attributes":{"code":"en_CR","name":"English (Costa Rica)","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:en_CR"}},{"id":"l:en_CW","type":"languages","attributes":{"code":"en_CW","name":"English (CURAÇAO)","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:en_CW"}},{"id":"l:en_CY","type":"languages","attributes":{"code":"en_CY","name":"English (Cyprus)","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:en_CY"}},{"id":"l:en_CZ","type":"languages","attributes":{"code":"en_CZ","name":"English (Czech Republic)","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:en_CZ"}},{"id":"l:en_DE","type":"languages","attributes":{"code":"en_DE","name":"English (Germany)","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:en_DE"}},{"id":"l:en_DK","type":"languages","attributes":{"code":"en_DK","name":"English (Denmark)","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:en_DK"}},{"id":"l:en_DO","type":"languages","attributes":{"code":"en_DO","name":"English (Dominican Republic)","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:en_DO"}},{"id":"l:en_DZ","type":"languages","attributes":{"code":"en_DZ","name":"English (Algeria)","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:en_DZ"}},{"id":"l:en_EC","type":"languages","attributes":{"code":"en_EC","name":"English (Ecuador)","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:en_EC"}},{"id":"l:en_ee","type":"languages","attributes":{"code":"en_ee","name":"English (Estonia)","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:en_ee"}},{"id":"l:en_EG","type":"languages","attributes":{"code":"en_EG","name":"English (Egypt)","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:en_EG"}},{"id":"l:en_ES","type":"languages","attributes":{"code":"en_ES","name":"English (Spain)","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:en_ES"}},{"id":"l:en_FI","type":"languages","attributes":{"code":"en_FI","name":"English (Finland)","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:en_FI"}},{"id":"l:en_FJ","type":"languages","attributes":{"code":"en_FJ","name":"English (Fiji)","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:en_FJ"}},{"id":"l:en_FR","type":"languages","attributes":{"code":"en_FR","name":"English (France)","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:en_FR"}},{"id":"l:en_GA","type":"languages","attributes":{"code":"en_GA","name":"English (Gabon)","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:en_GA"}},{"id":"l:en_GB","type":"languages","attributes":{"code":"en_GB","name":"English (United Kingdom)","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:en_GB"}},{"id":"l:en_GF","type":"languages","attributes":{"code":"en_GF","name":"English (French Guiana)","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:en_GF"}},{"id":"l:en_GH","type":"languages","attributes":{"code":"en_GH","name":"English (Ghana)","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:en_GH"}},{"id":"l:en_GM","type":"languages","attributes":{"code":"en_GM","name":"English (Gambia)","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:en_GM"}},{"id":"l:en_GN","type":"languages","attributes":{"code":"en_GN","name":"English (Guinea)","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:en_GN"}},{"id":"l:en_GR","type":"languages","attributes":{"code":"en_GR","name":"English (Greece)","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:en_GR"}},{"id":"l:en_GT","type":"languages","attributes":{"code":"en_GT","name":"English (Guatemala)","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:en_GT"}},{"id":"l:en_HK","type":"languages","attributes":{"code":"en_HK","name":"English (Hong Kong)","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:en_HK"}},{"id":"l:en_HN","type":"languages","attributes":{"code":"en_HN","name":"English (Honduras)","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:en_HN"}},{"id":"l:en_HR","type":"languages","attributes":{"code":"en_HR","name":"English (Croatia)","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:en_HR"}},{"id":"l:en_HT","type":"languages","attributes":{"code":"en_HT","name":"English (Haiti)","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:en_HT"}},{"id":"l:en_HU","type":"languages","attributes":{"code":"en_HU","name":"English (Hungary)","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:en_HU"}},{"id":"l:en_ID","type":"languages","attributes":{"code":"en_ID","name":"English (Indonesia)","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:en_ID"}},{"id":"l:en_IE","type":"languages","attributes":{"code":"en_IE","name":"English (Ireland)","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:en_IE"}},{"id":"l:en_IL","type":"languages","attributes":{"code":"en_IL","name":"English (Israel)","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:en_IL"}},{"id":"l:en_IN","type":"languages","attributes":{"code":"en_IN","name":"English (India)","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:en_IN"}},{"id":"l:en_IQ","type":"languages","attributes":{"code":"en_IQ","name":"English (Iraq)","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:en_IQ"}},{"id":"l:en_IS","type":"languages","attributes":{"code":"en_IS","name":"English (Icelandic)","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:en_IS"}},{"id":"l:en_IT","type":"languages","attributes":{"code":"en_IT","name":"English (Italy)","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:en_IT"}},{"id":"l:en_JM","type":"languages","attributes":{"code":"en_JM","name":"English (Jamaica)","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:en_JM"}},{"id":"l:en_JO","type":"languages","attributes":{"code":"en_JO","name":"English (Jordan)","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:en_JO"}},{"id":"l:en_JP","type":"languages","attributes":{"code":"en_JP","name":"English (Japan)","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:en_JP"}},{"id":"l:en_KE","type":"languages","attributes":{"code":"en_KE","name":"English (Kenya)","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:en_KE"}},{"id":"l:en_KR","type":"languages","attributes":{"code":"en_KR","name":"English (Korea)","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:en_KR"}},{"id":"l:en_KW","type":"languages","attributes":{"code":"en_KW","name":"English (Kuwait)","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:en_KW"}},{"id":"l:en_KY","type":"languages","attributes":{"code":"en_KY","name":"English (Cayman Islands)","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:en_KY"}},{"id":"l:en_LA","type":"languages","attributes":{"code":"en_LA","name":"English (Laos)","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:en_LA"}},{"id":"l:en_LB","type":"languages","attributes":{"code":"en_LB","name":"English (Lebanon)","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:en_LB"}},{"id":"l:en_LK","type":"languages","attributes":{"code":"en_LK","name":"English (Sri Lanka)","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:en_LK"}},{"id":"l:en@lolcat","type":"languages","attributes":{"code":"en@lolcat","name":"LOLCAT English","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:en@lolcat"}},{"id":"l:en_LR","type":"languages","attributes":{"code":"en_LR","name":"English (Liberia)","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:en_LR"}},{"id":"l:en_LS","type":"languages","attributes":{"code":"en_LS","name":"English (Lesotho)","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:en_LS"}},{"id":"l:en_lt","type":"languages","attributes":{"code":"en_lt","name":"English (Lithuania)","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:en_lt"}},{"id":"l:en_LU","type":"languages","attributes":{"code":"en_LU","name":"English (Luxembourg)","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:en_LU"}},{"id":"l:en_lv","type":"languages","attributes":{"code":"en_lv","name":"English (Latvia)","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:en_lv"}},{"id":"l:en_MA","type":"languages","attributes":{"code":"en_MA","name":"English (Morocco)","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:en_MA"}},{"id":"l:en_MG","type":"languages","attributes":{"code":"en_MG","name":"English (Madagascar)","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:en_MG"}},{"id":"l:en_MK","type":"languages","attributes":{"code":"en_MK","name":"English (Macedonia)","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:en_MK"}},{"id":"l:en_ML","type":"languages","attributes":{"code":"en_ML","name":"English (Mali)","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:en_ML"}},{"id":"l:en_MM","type":"languages","attributes":{"code":"en_MM","name":"English (Myanmar)","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:en_MM"}},{"id":"l:en_MT","type":"languages","attributes":{"code":"en_MT","name":"English (Malta)","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:en_MT"}},{"id":"l:en_MU","type":"languages","attributes":{"code":"en_MU","name":"English (Mauritius)","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:en_MU"}},{"id":"l:en_MW","type":"languages","attributes":{"code":"en_MW","name":"English (Malawi)","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:en_MW"}},{"id":"l:en_MX","type":"languages","attributes":{"code":"en_MX","name":"English (Mexico)","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:en_MX"}},{"id":"l:en_MY","type":"languages","attributes":{"code":"en_MY","name":"English (Malaysia)","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:en_MY"}},{"id":"l:en_MZ","type":"languages","attributes":{"code":"en_MZ","name":"English (Mozambique)","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:en_MZ"}},{"id":"l:en_NA","type":"languages","attributes":{"code":"en_NA","name":"English (Namibia)","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:en_NA"}},{"id":"l:en_NE","type":"languages","attributes":{"code":"en_NE","name":"English (Niger)","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:en_NE"}},{"id":"l:en_NG","type":"languages","attributes":{"code":"en_NG","name":"English (Nigeria)","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:en_NG"}},{"id":"l:en_NI","type":"languages","attributes":{"code":"en_NI","name":"English (Nicaragua)","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:en_NI"}},{"id":"l:en_NL","type":"languages","attributes":{"code":"en_NL","name":"English (Netherlands)","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:en_NL"}},{"id":"l:en_NO","type":"languages","attributes":{"code":"en_NO","name":"English (Norway)","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:en_NO"}},{"id":"l:en_NP","type":"languages","attributes":{"code":"en_NP","name":"English (Nepal)","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:en_NP"}},{"id":"l:en_NZ","type":"languages","attributes":{"code":"en_NZ","name":"English (New Zealand)","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:en_NZ"}},{"id":"l:en@Ontario","type":"languages","attributes":{"code":"en@Ontario","name":"English (Ontario)","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:en@Ontario"}},{"id":"l:en_PE","type":"languages","attributes":{"code":"en_PE","name":"English (Peru)","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:en_PE"}},{"id":"l:en_PG","type":"languages","attributes":{"code":"en_PG","name":"English (Papua New Guinea)","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:en_PG"}},{"id":"l:en_PH","type":"languages","attributes":{"code":"en_PH","name":"English (Philippines)","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:en_PH"}},{"id":"l:en@pirate","type":"languages","attributes":{"code":"en@pirate","name":"Pirate English","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:en@pirate"}},{"id":"l:en_PK","type":"languages","attributes":{"code":"en_PK","name":"English (Pakistan)","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:en_PK"}},{"id":"l:en_PL","type":"languages","attributes":{"code":"en_PL","name":"English (Poland)","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:en_PL"}},{"id":"l:en_PR","type":"languages","attributes":{"code":"en_PR","name":"English (Puerto Rico)","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:en_PR"}},{"id":"l:en_PT","type":"languages","attributes":{"code":"en_PT","name":"English (Portugal)","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:en_PT"}},{"id":"l:en_PY","type":"languages","attributes":{"code":"en_PY","name":"English (Paraguay)","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:en_PY"}},{"id":"l:en_QA","type":"languages","attributes":{"code":"en_QA","name":"English (Qatar)","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:en_QA"}},{"id":"l:en_RO","type":"languages","attributes":{"code":"en_RO","name":"English (Romania)","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:en_RO"}},{"id":"l:en_RS","type":"languages","attributes":{"code":"en_RS","name":"English (Serbia)","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:en_RS"}},{"id":"l:en_SA","type":"languages","attributes":{"code":"en_SA","name":"English (Saudi Arabia)","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:en_SA"}},{"id":"l:en_SE","type":"languages","attributes":{"code":"en_SE","name":"English (Sweden)","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:en_SE"}},{"id":"l:en_SG","type":"languages","attributes":{"code":"en_SG","name":"English (Singapore)","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:en_SG"}},{"id":"l:en@shaw","type":"languages","attributes":{"code":"en@shaw","name":"English (Shavian)","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:en@shaw"}},{"id":"l:en_SI","type":"languages","attributes":{"code":"en_SI","name":"English (Slovenia)","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:en_SI"}},{"id":"l:en_SK","type":"languages","attributes":{"code":"en_SK","name":"English (Slovakia)","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:en_SK"}},{"id":"l:en_SN","type":"languages","attributes":{"code":"en_SN","name":"English (Senegal)","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:en_SN"}},{"id":"l:en_SV","type":"languages","attributes":{"code":"en_SV","name":"English (El Salvador)","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:en_SV"}},{"id":"l:en_SZ","type":"languages","attributes":{"code":"en_SZ","name":"English (Swaziland)","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:en_SZ"}},{"id":"l:en_TG","type":"languages","attributes":{"code":"en_TG","name":"English (Togo)","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:en_TG"}},{"id":"l:en_TH","type":"languages","attributes":{"code":"en_TH","name":"English (Thailand)","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:en_TH"}},{"id":"l:en_TR","type":"languages","attributes":{"code":"en_TR","name":"English (Turkey)","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:en_TR"}},{"id":"l:en_TT","type":"languages","attributes":{"code":"en_TT","name":"English (Trinidad & Tobago)","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:en_TT"}},{"id":"l:en_TW","type":"languages","attributes":{"code":"en_TW","name":"English (Taiwan)","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:en_TW"}},{"id":"l:en_TZ","type":"languages","attributes":{"code":"en_TZ","name":"English (Tanzania)","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:en_TZ"}},{"id":"l:en_UA","type":"languages","attributes":{"code":"en_UA","name":"English (Ukraine)","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:en_UA"}},{"id":"l:en_UG","type":"languages","attributes":{"code":"en_UG","name":"English (Uganda)","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:en_UG"}},{"id":"l:en_US","type":"languages","attributes":{"code":"en_US","name":"English (United States)","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:en_US"}},{"id":"l:en_UY","type":"languages","attributes":{"code":"en_UY","name":"English (Uruguay)","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:en_UY"}},{"id":"l:en_VE","type":"languages","attributes":{"code":"en_VE","name":"English (Venezuela)","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:en_VE"}},{"id":"l:en_VG","type":"languages","attributes":{"code":"en_VG","name":"English (British Virgin Islands)","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:en_VG"}},{"id":"l:en_VN","type":"languages","attributes":{"code":"en_VN","name":"English (Viet Nam)","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:en_VN"}},{"id":"l:en@ysv","type":"languages","attributes":{"code":"en@ysv","name":"Yeshivish English","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:en@ysv"}},{"id":"l:en_ZA","type":"languages","attributes":{"code":"en_ZA","name":"English (South Africa)","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:en_ZA"}},{"id":"l:en_ZM","type":"languages","attributes":{"code":"en_ZM","name":"English (Zambia)","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:en_ZM"}},{"id":"l:en_ZW","type":"languages","attributes":{"code":"en_ZW","name":"English (Zimbabwe)","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:en_ZW"}},{"id":"l:eo","type":"languages","attributes":{"code":"eo","name":"Esperanto","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:eo"}},{"id":"l:es","type":"languages","attributes":{"code":"es","name":"Spanish","rtl":false,"plural_equation":"n == 1 ? 0 : n != 0 && n % 1000000 == 0 ? 1 : 2","plural_rules":{"one":"n is 1","many":"n is not 0 and n mod 1000000 == 0","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:es"}},{"id":"l:es_150","type":"languages","attributes":{"code":"es_150","name":"Spanish (Europe)","rtl":false,"plural_equation":"n == 1 ? 0 : n != 0 && n % 1000000 == 0 ? 1 : 2","plural_rules":{"one":"n is 1","many":"n is not 0 and n mod 1000000 == 0","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:es_150"}},{"id":"l:es_419","type":"languages","attributes":{"code":"es_419","name":"Spanish (Latin America)","rtl":false,"plural_equation":"n == 1 ? 0 : n != 0 && n % 1000000 == 0 ? 1 : 2","plural_rules":{"one":"n is 1","many":"n is not 0 and n mod 1000000 == 0","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:es_419"}},{"id":"l:es_AR","type":"languages","attributes":{"code":"es_AR","name":"Spanish (Argentina)","rtl":false,"plural_equation":"n == 1 ? 0 : n != 0 && n % 1000000 == 0 ? 1 : 2","plural_rules":{"one":"n is 1","many":"n is not 0 and n mod 1000000 == 0","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:es_AR"}},{"id":"l:es_AR-B","type":"languages","attributes":{"code":"es_AR-B","name":"Spanish (Argentina - Buenos Aires)","rtl":false,"plural_equation":"n == 1 ? 0 : n != 0 && n % 1000000 == 0 ? 1 : 2","plural_rules":{"one":"n is 1","many":"n is not 0 and n mod 1000000 == 0","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:es_AR-B"}},{"id":"l:es_AR-C","type":"languages","attributes":{"code":"es_AR-C","name":"Spanish (Argentina - Buenos Aires City)","rtl":false,"plural_equation":"n == 1 ? 0 : n != 0 && n % 1000000 == 0 ? 1 : 2","plural_rules":{"one":"n is 1","many":"n is not 0 and n mod 1000000 == 0","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:es_AR-C"}},{"id":"l:es_BO","type":"languages","attributes":{"code":"es_BO","name":"Spanish (Bolivia)","rtl":false,"plural_equation":"n == 1 ? 0 : n != 0 && n % 1000000 == 0 ? 1 : 2","plural_rules":{"one":"n is 1","many":"n is not 0 and n mod 1000000 == 0","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:es_BO"}},{"id":"l:es_BR","type":"languages","attributes":{"code":"es_BR","name":"Spanish (Brazil)","rtl":false,"plural_equation":"n == 1 ? 0 : n != 0 && n % 1000000 == 0 ? 1 : 2","plural_rules":{"one":"n is 1","many":"n is not 0 and n mod 1000000 == 0","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:es_BR"}},{"id":"l:es_CL","type":"languages","attributes":{"code":"es_CL","name":"Spanish (Chile)","rtl":false,"plural_equation":"n == 1 ? 0 : n != 0 && n % 1000000 == 0 ? 1 : 2","plural_rules":{"one":"n is 1","many":"n is not 0 and n mod 1000000 == 0","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:es_CL"}},{"id":"l:es_CO","type":"languages","attributes":{"code":"es_CO","name":"Spanish (Colombia)","rtl":false,"plural_equation":"n == 1 ? 0 : n != 0 && n % 1000000 == 0 ? 1 : 2","plural_rules":{"one":"n is 1","many":"n is not 0 and n mod 1000000 == 0","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:es_CO"}},{"id":"l:es_CR","type":"languages","attributes":{"code":"es_CR","name":"Spanish (Costa Rica)","rtl":false,"plural_equation":"n == 1 ? 0 : n != 0 && n % 1000000 == 0 ? 1 : 2","plural_rules":{"one":"n is 1","many":"n is not 0 and n mod 1000000 == 0","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:es_CR"}},{"id":"l:es_CU","type":"languages","attributes":{"code":"es_CU","name":"Spanish (Cuba)","rtl":false,"plural_equation":"n == 1 ? 0 : n != 0 && n % 1000000 == 0 ? 1 : 2","plural_rules":{"one":"n is 1","many":"n is not 0 and n mod 1000000 == 0","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:es_CU"}},{"id":"l:es_CW","type":"languages","attributes":{"code":"es_CW","name":"Spanish (CURAÇAO)","rtl":false,"plural_equation":"n == 1 ? 0 : n != 0 && n % 1000000 == 0 ? 1 : 2","plural_rules":{"one":"n is 1","many":"n is not 0 and n mod 1000000 == 0","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:es_CW"}},{"id":"l:es_DO","type":"languages","attributes":{"code":"es_DO","name":"Spanish (Dominican Republic)","rtl":false,"plural_equation":"n == 1 ? 0 : n != 0 && n % 1000000 == 0 ? 1 : 2","plural_rules":{"one":"n is 1","many":"n is not 0 and n mod 1000000 == 0","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:es_DO"}},{"id":"l:es_EC","type":"languages","attributes":{"code":"es_EC","name":"Spanish (Ecuador)","rtl":false,"plural_equation":"n == 1 ? 0 : n != 0 && n % 1000000 == 0 ? 1 : 2","plural_rules":{"one":"n is 1","many":"n is not 0 and n mod 1000000 == 0","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:es_EC"}},{"id":"l:es_ES","type":"languages","attributes":{"code":"es_ES","name":"Spanish (Spain)","rtl":false,"plural_equation":"n == 1 ? 0 : n != 0 && n % 1000000 == 0 ? 1 : 2","plural_rules":{"one":"n is 1","many":"n is not 0 and n mod 1000000 == 0","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:es_ES"}},{"id":"l:es_GQ","type":"languages","attributes":{"code":"es_GQ","name":"Spanish (Equatorial Guinea)","rtl":false,"plural_equation":"n == 1 ? 0 : n != 0 && n % 1000000 == 0 ? 1 : 2","plural_rules":{"one":"n is 1","many":"n is not 0 and n mod 1000000 == 0","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:es_GQ"}},{"id":"l:es_GT","type":"languages","attributes":{"code":"es_GT","name":"Spanish (Guatemala)","rtl":false,"plural_equation":"n == 1 ? 0 : n != 0 && n % 1000000 == 0 ? 1 : 2","plural_rules":{"one":"n is 1","many":"n is not 0 and n mod 1000000 == 0","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:es_GT"}},{"id":"l:es_HN","type":"languages","attributes":{"code":"es_HN","name":"Spanish (Honduras)","rtl":false,"plural_equation":"n == 1 ? 0 : n != 0 && n % 1000000 == 0 ? 1 : 2","plural_rules":{"one":"n is 1","many":"n is not 0 and n mod 1000000 == 0","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:es_HN"}},{"id":"l:es_MX","type":"languages","attributes":{"code":"es_MX","name":"Spanish (Mexico)","rtl":false,"plural_equation":"n == 1 ? 0 : n != 0 && n % 1000000 == 0 ? 1 : 2","plural_rules":{"one":"n is 1","many":"n is not 0 and n mod 1000000 == 0","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:es_MX"}},{"id":"l:es_NI","type":"languages","attributes":{"code":"es_NI","name":"Spanish (Nicaragua)","rtl":false,"plural_equation":"n == 1 ? 0 : n != 0 && n % 1000000 == 0 ? 1 : 2","plural_rules":{"one":"n is 1","many":"n is not 0 and n mod 1000000 == 0","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:es_NI"}},{"id":"l:es_PA","type":"languages","attributes":{"code":"es_PA","name":"Spanish (Panama)","rtl":false,"plural_equation":"n == 1 ? 0 : n != 0 && n % 1000000 == 0 ? 1 : 2","plural_rules":{"one":"n is 1","many":"n is not 0 and n mod 1000000 == 0","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:es_PA"}},{"id":"l:es_PE","type":"languages","attributes":{"code":"es_PE","name":"Spanish (Peru)","rtl":false,"plural_equation":"n == 1 ? 0 : n != 0 && n % 1000000 == 0 ? 1 : 2","plural_rules":{"one":"n is 1","many":"n is not 0 and n mod 1000000 == 0","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:es_PE"}},{"id":"l:es_PR","type":"languages","attributes":{"code":"es_PR","name":"Spanish (Puerto Rico)","rtl":false,"plural_equation":"n == 1 ? 0 : n != 0 && n % 1000000 == 0 ? 1 : 2","plural_rules":{"one":"n is 1","many":"n is not 0 and n mod 1000000 == 0","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:es_PR"}},{"id":"l:es_PY","type":"languages","attributes":{"code":"es_PY","name":"Spanish (Paraguay)","rtl":false,"plural_equation":"n == 1 ? 0 : n != 0 && n % 1000000 == 0 ? 1 : 2","plural_rules":{"one":"n is 1","many":"n is not 0 and n mod 1000000 == 0","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:es_PY"}},{"id":"l:es@qtfiletype","type":"languages","attributes":{"code":"es@qtfiletype","name":"Spanish (QT FILETYPE)","rtl":false,"plural_equation":"n != 1","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:es@qtfiletype"}},{"id":"l:es_SA","type":"languages","attributes":{"code":"es_SA","name":"Spanish (Saudi Arabia)","rtl":false,"plural_equation":"n == 1 ? 0 : n != 0 && n % 1000000 == 0 ? 1 : 2","plural_rules":{"one":"n is 1","many":"n is not 0 and n mod 1000000 == 0","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:es_SA"}},{"id":"l:es_SV","type":"languages","attributes":{"code":"es_SV","name":"Spanish (El Salvador)","rtl":false,"plural_equation":"n == 1 ? 0 : n != 0 && n % 1000000 == 0 ? 1 : 2","plural_rules":{"one":"n is 1","many":"n is not 0 and n mod 1000000 == 0","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:es_SV"}},{"id":"l:es_US","type":"languages","attributes":{"code":"es_US","name":"Spanish (United States)","rtl":false,"plural_equation":"n == 1 ? 0 : n != 0 && n % 1000000 == 0 ? 1 : 2","plural_rules":{"one":"n is 1","many":"n is not 0 and n mod 1000000 == 0","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:es_US"}},{"id":"l:es_UY","type":"languages","attributes":{"code":"es_UY","name":"Spanish (Uruguay)","rtl":false,"plural_equation":"n == 1 ? 0 : n != 0 && n % 1000000 == 0 ? 1 : 2","plural_rules":{"one":"n is 1","many":"n is not 0 and n mod 1000000 == 0","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:es_UY"}},{"id":"l:es_VE","type":"languages","attributes":{"code":"es_VE","name":"Spanish (Venezuela)","rtl":false,"plural_equation":"n == 1 ? 0 : n != 0 && n % 1000000 == 0 ? 1 : 2","plural_rules":{"one":"n is 1","many":"n is not 0 and n mod 1000000 == 0","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:es_VE"}},{"id":"l:es_VG","type":"languages","attributes":{"code":"es_VG","name":"Spanish (British Virgin Islands)","rtl":false,"plural_equation":"n == 1 ? 0 : n != 0 && n % 1000000 == 0 ? 1 : 2","plural_rules":{"one":"n is 1","many":"n is not 0 and n mod 1000000 == 0","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:es_VG"}},{"id":"l:et","type":"languages","attributes":{"code":"et","name":"Estonian","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:et"}},{"id":"l:et_EE","type":"languages","attributes":{"code":"et_EE","name":"Estonian (Estonia)","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:et_EE"}},{"id":"l:eu","type":"languages","attributes":{"code":"eu","name":"Basque","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:eu"}},{"id":"l:eu_ES","type":"languages","attributes":{"code":"eu_ES","name":"Basque (Spain)","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:eu_ES"}},{"id":"l:fa","type":"languages","attributes":{"code":"fa","name":"Persian","rtl":true,"plural_equation":"(n > 1)","plural_rules":{"one":"n <=1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:fa"}},{"id":"l:fa_AF","type":"languages","attributes":{"code":"fa_AF","name":"Persian (Afghanistan)","rtl":true,"plural_equation":"(n > 1)","plural_rules":{"one":"n <=1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:fa_AF"}},{"id":"l:fa_IR","type":"languages","attributes":{"code":"fa_IR","name":"Persian (Iran)","rtl":true,"plural_equation":"(n > 1)","plural_rules":{"one":"n <=1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:fa_IR"}},{"id":"l:ff","type":"languages","attributes":{"code":"ff","name":"Fulah","rtl":false,"plural_equation":"(n >= 2)","plural_rules":{"one":"n in 0..2 and n is not 2","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:ff"}},{"id":"l:ff_SN","type":"languages","attributes":{"code":"ff_SN","name":"Fulah (Senegal)","rtl":false,"plural_equation":"(n > 1)","plural_rules":{"one":"n in 0..1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:ff_SN"}},{"id":"l:fi","type":"languages","attributes":{"code":"fi","name":"Finnish","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:fi"}},{"id":"l:fi_FI","type":"languages","attributes":{"code":"fi_FI","name":"Finnish (Finland)","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:fi_FI"}},{"id":"l:fil","type":"languages","attributes":{"code":"fil","name":"Filipino","rtl":false,"plural_equation":"(n == 1 || n==2 || n==3) || (n % 10 != 4 || n % 10 != 6 || n % 10 != 9)","plural_rules":{"one":"n in 1,2,3 or n mod 10 not in 4,6,9","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:fil"}},{"id":"l:fil_PH","type":"languages","attributes":{"code":"fil_PH","name":"Filipino (Philippines)","rtl":false,"plural_equation":"(n == 1 || n==2 || n==3) || (n % 10 != 4 || n % 10 != 6 || n % 10 != 9)","plural_rules":{"one":"n in 1,2,3 or n mod 10 not in 4,6,9","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:fil_PH"}},{"id":"l:fo","type":"languages","attributes":{"code":"fo","name":"Faroese","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:fo"}},{"id":"l:fo_FO","type":"languages","attributes":{"code":"fo_FO","name":"Faroese (Faroe Islands)","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:fo_FO"}},{"id":"l:fr","type":"languages","attributes":{"code":"fr","name":"French","rtl":false,"plural_equation":"(n == 0 || n == 1) ? 0 : n != 0 && n % 1000000 == 0 ? 1 : 2","plural_rules":{"one":"n is 0 or n is 1","many":"n is not 0 and n mod 1000000 == 0","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:fr"}},{"id":"l:fr_150","type":"languages","attributes":{"code":"fr_150","name":"French (Europe)","rtl":false,"plural_equation":"(n == 0 || n == 1) ? 0 : n != 0 && n % 1000000 == 0 ? 1 : 2","plural_rules":{"one":"n is 0 or n is 1","many":"n is not 0 and n mod 1000000 == 0","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:fr_150"}},{"id":"l:fr_BE","type":"languages","attributes":{"code":"fr_BE","name":"French (Belgium)","rtl":false,"plural_equation":"(n == 0 || n == 1) ? 0 : n != 0 && n % 1000000 == 0 ? 1 : 2","plural_rules":{"one":"n is 0 or n is 1","many":"n is not 0 and n mod 1000000 == 0","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:fr_BE"}},{"id":"l:fr_BF","type":"languages","attributes":{"code":"fr_BF","name":"French (Burkina Faso)","rtl":false,"plural_equation":"(n == 0 || n == 1) ? 0 : n != 0 && n % 1000000 == 0 ? 1 : 2","plural_rules":{"one":"n is 0 or n is 1","many":"n is not 0 and n mod 1000000 == 0","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:fr_BF"}},{"id":"l:fr_BJ","type":"languages","attributes":{"code":"fr_BJ","name":"French (Benin)","rtl":false,"plural_equation":"(n == 0 || n == 1) ? 0 : n != 0 && n % 1000000 == 0 ? 1 : 2","plural_rules":{"one":"n is 0 or n is 1","many":"n is not 0 and n mod 1000000 == 0","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:fr_BJ"}},{"id":"l:fr_CA","type":"languages","attributes":{"code":"fr_CA","name":"French (Canada)","rtl":false,"plural_equation":"(n == 0 || n == 1) ? 0 : n != 0 && n % 1000000 == 0 ? 1 : 2","plural_rules":{"one":"n is 0 or n is 1","many":"n is not 0 and n mod 1000000 == 0","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:fr_CA"}},{"id":"l:fr_CD","type":"languages","attributes":{"code":"fr_CD","name":"French (Democratic Republic of the Congo)","rtl":false,"plural_equation":"(n == 0 || n == 1) ? 0 : n != 0 && n % 1000000 == 0 ? 1 : 2","plural_rules":{"one":"n is 0 or n is 1","many":"n is not 0 and n mod 1000000 == 0","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:fr_CD"}},{"id":"l:fr_CG","type":"languages","attributes":{"code":"fr_CG","name":"French (Congo - Brazzaville)","rtl":false,"plural_equation":"(n == 0 || n == 1) ? 0 : n != 0 && n % 1000000 == 0 ? 1 : 2","plural_rules":{"one":"n is 0 or n is 1","many":"n is not 0 and n mod 1000000 == 0","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:fr_CG"}},{"id":"l:fr_CH","type":"languages","attributes":{"code":"fr_CH","name":"French (Switzerland)","rtl":false,"plural_equation":"(n == 0 || n == 1) ? 0 : n != 0 && n % 1000000 == 0 ? 1 : 2","plural_rules":{"one":"n is 0 or n is 1","many":"n is not 0 and n mod 1000000 == 0","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:fr_CH"}},{"id":"l:fr_CI","type":"languages","attributes":{"code":"fr_CI","name":"French (Côte d\'Ivoire)","rtl":false,"plural_equation":"(n == 0 || n == 1) ? 0 : n != 0 && n % 1000000 == 0 ? 1 : 2","plural_rules":{"one":"n is 0 or n is 1","many":"n is not 0 and n mod 1000000 == 0","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:fr_CI"}},{"id":"l:fr_CM","type":"languages","attributes":{"code":"fr_CM","name":"French (Cameroon)","rtl":false,"plural_equation":"(n == 0 || n == 1) ? 0 : n != 0 && n % 1000000 == 0 ? 1 : 2","plural_rules":{"one":"n is 0 or n is 1","many":"n is not 0 and n mod 1000000 == 0","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:fr_CM"}},{"id":"l:fr_DZ","type":"languages","attributes":{"code":"fr_DZ","name":"French (Algeria)","rtl":false,"plural_equation":"(n == 0 || n == 1) ? 0 : n != 0 && n % 1000000 == 0 ? 1 : 2","plural_rules":{"one":"n is 0 or n is 1","many":"n is not 0 and n mod 1000000 == 0","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:fr_DZ"}},{"id":"l:fr_FR","type":"languages","attributes":{"code":"fr_FR","name":"French (France)","rtl":false,"plural_equation":"(n == 0 || n == 1) ? 0 : n != 0 && n % 1000000 == 0 ? 1 : 2","plural_rules":{"one":"n is 0 or n is 1","many":"n is not 0 and n mod 1000000 == 0","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:fr_FR"}},{"id":"l:fr_GA","type":"languages","attributes":{"code":"fr_GA","name":"French (Gabon)","rtl":false,"plural_equation":"(n == 0 || n == 1) ? 0 : n != 0 && n % 1000000 == 0 ? 1 : 2","plural_rules":{"one":"n is 0 or n is 1","many":"n is not 0 and n mod 1000000 == 0","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:fr_GA"}},{"id":"l:fr_GF","type":"languages","attributes":{"code":"fr_GF","name":"French (French Guiana)","rtl":false,"plural_equation":"(n == 0 || n == 1) ? 0 : n != 0 && n % 1000000 == 0 ? 1 : 2","plural_rules":{"one":"n is 0 or n is 1","many":"n is not 0 and n mod 1000000 == 0","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:fr_GF"}},{"id":"l:fr_GN","type":"languages","attributes":{"code":"fr_GN","name":"French (Guinea)","rtl":false,"plural_equation":"(n == 0 || n == 1) ? 0 : n != 0 && n % 1000000 == 0 ? 1 : 2","plural_rules":{"one":"n is 0 or n is 1","many":"n is not 0 and n mod 1000000 == 0","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:fr_GN"}},{"id":"l:fr_GP","type":"languages","attributes":{"code":"fr_GP","name":"French (Guadeloupe)","rtl":false,"plural_equation":"(n == 0 || n == 1) ? 0 : n != 0 && n % 1000000 == 0 ? 1 : 2","plural_rules":{"one":"n is 0 or n is 1","many":"n is not 0 and n mod 1000000 == 0","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:fr_GP"}},{"id":"l:fr_HT","type":"languages","attributes":{"code":"fr_HT","name":"French (Haiti)","rtl":false,"plural_equation":"(n == 0 || n == 1) ? 0 : n != 0 && n % 1000000 == 0 ? 1 : 2","plural_rules":{"one":"n is 0 or n is 1","many":"n is not 0 and n mod 1000000 == 0","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:fr_HT"}},{"id":"l:fr_LR","type":"languages","attributes":{"code":"fr_LR","name":"French (Liberia)","rtl":false,"plural_equation":"(n == 0 || n == 1) ? 0 : n != 0 && n % 1000000 == 0 ? 1 : 2","plural_rules":{"one":"n is 0 or n is 1","many":"n is not 0 and n mod 1000000 == 0","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:fr_LR"}},{"id":"l:fr_LU","type":"languages","attributes":{"code":"fr_LU","name":"French (Luxembourg)","rtl":false,"plural_equation":"(n == 0 || n == 1) ? 0 : n != 0 && n % 1000000 == 0 ? 1 : 2","plural_rules":{"one":"n is 0 or n is 1","many":"n is not 0 and n mod 1000000 == 0","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:fr_LU"}},{"id":"l:fr_MA","type":"languages","attributes":{"code":"fr_MA","name":"French (Morocco)","rtl":false,"plural_equation":"(n == 0 || n == 1) ? 0 : n != 0 && n % 1000000 == 0 ? 1 : 2","plural_rules":{"one":"n is 0 or n is 1","many":"n is not 0 and n mod 1000000 == 0","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:fr_MA"}},{"id":"l:fr_MG","type":"languages","attributes":{"code":"fr_MG","name":"French (Madagascar)","rtl":false,"plural_equation":"(n == 0 || n == 1) ? 0 : n != 0 && n % 1000000 == 0 ? 1 : 2","plural_rules":{"one":"n is 0 or n is 1","many":"n is not 0 and n mod 1000000 == 0","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:fr_MG"}},{"id":"l:fr_ML","type":"languages","attributes":{"code":"fr_ML","name":"French (Mali)","rtl":false,"plural_equation":"(n == 0 || n == 1) ? 0 : n != 0 && n % 1000000 == 0 ? 1 : 2","plural_rules":{"one":"n is 0 or n is 1","many":"n is not 0 and n mod 1000000 == 0","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:fr_ML"}},{"id":"l:fr_MQ","type":"languages","attributes":{"code":"fr_MQ","name":"French (Martinique)","rtl":false,"plural_equation":"(n == 0 || n == 1) ? 0 : n != 0 && n % 1000000 == 0 ? 1 : 2","plural_rules":{"one":"n is 0 or n is 1","many":"n is not 0 and n mod 1000000 == 0","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:fr_MQ"}},{"id":"l:fr_NE","type":"languages","attributes":{"code":"fr_NE","name":"French (Niger)","rtl":false,"plural_equation":"(n == 0 || n == 1) ? 0 : n != 0 && n % 1000000 == 0 ? 1 : 2","plural_rules":{"one":"n is 0 or n is 1","many":"n is not 0 and n mod 1000000 == 0","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:fr_NE"}},{"id":"l:fr@Ontario","type":"languages","attributes":{"code":"fr@Ontario","name":"French (Ontario)","rtl":false,"plural_equation":"(n == 0 || n == 1) ? 0 : n != 0 && n % 1000000 == 0 ? 1 : 2","plural_rules":{"one":"n is 0 or n is 1","many":"n is not 0 and n mod 1000000 == 0","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:fr@Ontario"}},{"id":"l:frp","type":"languages","attributes":{"code":"frp","name":"Franco-Provençal (Arpitan)","rtl":false,"plural_equation":"(n > 1)","plural_rules":{"one":"n in 0..1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:frp"}},{"id":"l:fr@qtfiletype","type":"languages","attributes":{"code":"fr@qtfiletype","name":"French (QT FILETYPE)","rtl":false,"plural_equation":"(n > 1)","plural_rules":{"one":"n within 0..2 and n is not 2","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:fr@qtfiletype"}},{"id":"l:fr_RE","type":"languages","attributes":{"code":"fr_RE","name":"French (Réunion)","rtl":false,"plural_equation":"(n == 0 || n == 1) ? 0 : n != 0 && n % 1000000 == 0 ? 1 : 2","plural_rules":{"one":"n is 0 or n is 1","many":"n is not 0 and n mod 1000000 == 0","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:fr_RE"}},{"id":"l:fr_SN","type":"languages","attributes":{"code":"fr_SN","name":"French (Senegal)","rtl":false,"plural_equation":"(n == 0 || n == 1) ? 0 : n != 0 && n % 1000000 == 0 ? 1 : 2","plural_rules":{"one":"n is 0 or n is 1","many":"n is not 0 and n mod 1000000 == 0","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:fr_SN"}},{"id":"l:fr_TG","type":"languages","attributes":{"code":"fr_TG","name":"French (Togo)","rtl":false,"plural_equation":"(n == 0 || n == 1) ? 0 : n != 0 && n % 1000000 == 0 ? 1 : 2","plural_rules":{"one":"n is 0 or n is 1","many":"n is not 0 and n mod 1000000 == 0","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:fr_TG"}},{"id":"l:fur","type":"languages","attributes":{"code":"fur","name":"Friulian","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:fur"}},{"id":"l:fy","type":"languages","attributes":{"code":"fy","name":"Western Frisian","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:fy"}},{"id":"l:fy_NL","type":"languages","attributes":{"code":"fy_NL","name":"Western Frisian (Netherlands)","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:fy_NL"}},{"id":"l:ga","type":"languages","attributes":{"code":"ga","name":"Irish","rtl":false,"plural_equation":"(n==1 ? 0 : n==2 ? 1 : n<7 ? 2 : n<11 ? 3 : 4)","plural_rules":{"one":"n is 1","two":"n is 2","many":"n in 7..10","few":"n in 3..6","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:ga"}},{"id":"l:ga_IE","type":"languages","attributes":{"code":"ga_IE","name":"Irish (Ireland)","rtl":false,"plural_equation":"(n==1 ? 0 : n==2 ? 1 : n<7 ? 2 : n<11 ? 3 : 4)","plural_rules":{"one":"n is 1","two":"n is 2","many":"n in 7..10","few":"n in 3..6","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:ga_IE"}},{"id":"l:gan","type":"languages","attributes":{"code":"gan","name":"Chinese (Gan)","rtl":false,"plural_equation":"0","plural_rules":{"other":"everything"}},"links":{"self":"https://rest.api.transifex.com/languages/l:gan"}},{"id":"l:gd","type":"languages","attributes":{"code":"gd","name":"Gaelic, Scottish","rtl":false,"plural_equation":"(n==1 || n==11) ? 0 : (n==2 || n==12) ? 1 : (n > 2 && n < 20) ? 2 : 3","plural_rules":{"one":"n in 1,11","two":"n in 2,12","few":"n in 3..10,13..19","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:gd"}},{"id":"l:gl","type":"languages","attributes":{"code":"gl","name":"Galician","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:gl"}},{"id":"l:gl_ES","type":"languages","attributes":{"code":"gl_ES","name":"Galician (Spain)","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:gl_ES"}},{"id":"l:gos","type":"languages","attributes":{"code":"gos","name":"Gronings","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:gos"}},{"id":"l:grc","type":"languages","attributes":{"code":"grc","name":"Ancient Greek","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:grc"}},{"id":"l:grt","type":"languages","attributes":{"code":"grt","name":"Garo","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:grt"}},{"id":"l:gsw","type":"languages","attributes":{"code":"gsw","name":"Swiss German","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:gsw"}},{"id":"l:gu","type":"languages","attributes":{"code":"gu","name":"Gujarati","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:gu"}},{"id":"l:guc","type":"languages","attributes":{"code":"guc","name":"Wayuu","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:guc"}},{"id":"l:gug_PY","type":"languages","attributes":{"code":"gug_PY","name":"Guarani (Paraguay)","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:gug_PY"}},{"id":"l:gu_IN","type":"languages","attributes":{"code":"gu_IN","name":"Gujarati (India)","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:gu_IN"}},{"id":"l:gum","type":"languages","attributes":{"code":"gum","name":"Guambiano","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:gum"}},{"id":"l:gun","type":"languages","attributes":{"code":"gun","name":"Gun","rtl":false,"plural_equation":"(n > 1)","plural_rules":{"one":"n in 0..1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:gun"}},{"id":"l:ha","type":"languages","attributes":{"code":"ha","name":"Hausa","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:ha"}},{"id":"l:hak","type":"languages","attributes":{"code":"hak","name":"Chinese (Hakka)","rtl":false,"plural_equation":"0","plural_rules":{"other":"everything"}},"links":{"self":"https://rest.api.transifex.com/languages/l:hak"}},{"id":"l:haw","type":"languages","attributes":{"code":"haw","name":"Hawaiian","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:haw"}},{"id":"l:he","type":"languages","attributes":{"code":"he","name":"Hebrew","rtl":true,"plural_equation":"(n == 1 && n % 1 == 0) ? 0 : (n == 2 && n % 1 == 0) ? 1: 2","plural_rules":{"one":"n is 1","two":"n is 2","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:he"}},{"id":"l:he@female","type":"languages","attributes":{"code":"he@female","name":"Hebrew (female)","rtl":true,"plural_equation":"(n == 1 && n % 1 == 0) ? 0 : (n == 2 && n % 1 == 0) ? 1: 2","plural_rules":{"one":"n is 1","two":"n is 2","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:he@female"}},{"id":"l:he_IL","type":"languages","attributes":{"code":"he_IL","name":"Hebrew (Israel)","rtl":true,"plural_equation":"(n == 1 && n % 1 == 0) ? 0 : (n == 2 && n % 1 == 0) ? 1: 2","plural_rules":{"one":"n is 1","two":"n is 2","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:he_IL"}},{"id":"l:he@male","type":"languages","attributes":{"code":"he@male","name":"Hebrew (male)","rtl":true,"plural_equation":"(n == 1 && n % 1 == 0) ? 0 : (n == 2 && n % 1 == 0) ? 1: 2","plural_rules":{"one":"n is 1","two":"n is 2","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:he@male"}},{"id":"l:hi","type":"languages","attributes":{"code":"hi","name":"Hindi","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n in 0..1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:hi"}},{"id":"l:hi_IN","type":"languages","attributes":{"code":"hi_IN","name":"Hindi (India)","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n in 0..1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:hi_IN"}},{"id":"l:hne","type":"languages","attributes":{"code":"hne","name":"Chhattisgarhi","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:hne"}},{"id":"l:hr","type":"languages","attributes":{"code":"hr","name":"Croatian","rtl":false,"plural_equation":"n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2","plural_rules":{"one":"n mod 10 is 1 and n mod 100 is not 11","few":"n mod 10 in 3..4 and n mod 100 not in 11..20","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:hr"}},{"id":"l:hr_BA","type":"languages","attributes":{"code":"hr_BA","name":"Croatian (Bosnia and Herzegovina)","rtl":false,"plural_equation":"n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2","plural_rules":{"one":"n mod 10 is 1 and n mod 100 is not 11","few":"n mod 10 in 3..4 and n mod 100 not in 11..20","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:hr_BA"}},{"id":"l:hr_BA-SRP","type":"languages","attributes":{"code":"hr_BA-SRP","name":"Croatian (Republika Srpska)","rtl":false,"plural_equation":"n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2","plural_rules":{"one":"n mod 10 is 1 and n mod 100 is not 11","few":"n mod 10 in 3..4 and n mod 100 not in 11..20","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:hr_BA-SRP"}},{"id":"l:hr_HR","type":"languages","attributes":{"code":"hr_HR","name":"Croatian (Croatia)","rtl":false,"plural_equation":"n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2","plural_rules":{"one":"n mod 10 is 1 and n mod 100 is not 11","few":"n mod 10 in 3..4 and n mod 100 not in 11..20","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:hr_HR"}},{"id":"l:hrx","type":"languages","attributes":{"code":"hrx","name":"Hunsrik","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:hrx"}},{"id":"l:hsb","type":"languages","attributes":{"code":"hsb","name":"Upper Sorbian","rtl":false,"plural_equation":"(n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || n%100==4 ? 2 : 3)","plural_rules":{"one":"n mod 100 is 1","two":"n mod 100 is 2","few":"n mod 100 in 3..4 ","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:hsb"}},{"id":"l:hsn","type":"languages","attributes":{"code":"hsn","name":"Chinese (Xiang)","rtl":false,"plural_equation":"0","plural_rules":{"other":"everything"}},"links":{"self":"https://rest.api.transifex.com/languages/l:hsn"}},{"id":"l:ht","type":"languages","attributes":{"code":"ht","name":"Haitian (Haitian Creole)","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:ht"}},{"id":"l:ht_HT","type":"languages","attributes":{"code":"ht_HT","name":"Haitian (Haitian Creole) (Haiti)","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:ht_HT"}},{"id":"l:hu","type":"languages","attributes":{"code":"hu","name":"Hungarian","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:hu"}},{"id":"l:hu_HU","type":"languages","attributes":{"code":"hu_HU","name":"Hungarian (Hungary)","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:hu_HU"}},{"id":"l:hu_RO","type":"languages","attributes":{"code":"hu_RO","name":"Hungarian (Romanian)","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:hu_RO"}},{"id":"l:hu_SK","type":"languages","attributes":{"code":"hu_SK","name":"Hungarian (Slovakia)","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:hu_SK"}},{"id":"l:hy","type":"languages","attributes":{"code":"hy","name":"Armenian","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:hy"}},{"id":"l:hy_AM","type":"languages","attributes":{"code":"hy_AM","name":"Armenian (Armenia)","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:hy_AM"}},{"id":"l:hye","type":"languages","attributes":{"code":"hye","name":"Eastern Armenian","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:hye"}},{"id":"l:hye_RU","type":"languages","attributes":{"code":"hye_RU","name":"Eastern Armenian (Russia)","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:hye_RU"}},{"id":"l:hy_RU","type":"languages","attributes":{"code":"hy_RU","name":"Armenian (Russia)","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:hy_RU"}},{"id":"l:ia","type":"languages","attributes":{"code":"ia","name":"Interlingua","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:ia"}},{"id":"l:id","type":"languages","attributes":{"code":"id","name":"Indonesian","rtl":false,"plural_equation":"0","plural_rules":{"other":"everything"}},"links":{"self":"https://rest.api.transifex.com/languages/l:id"}},{"id":"l:id_ID","type":"languages","attributes":{"code":"id_ID","name":"Indonesian (Indonesia)","rtl":false,"plural_equation":"0","plural_rules":{"other":"everything"}},"links":{"self":"https://rest.api.transifex.com/languages/l:id_ID"}},{"id":"l:ie","type":"languages","attributes":{"code":"ie","name":"Interlingue","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:ie"}},{"id":"l:ig","type":"languages","attributes":{"code":"ig","name":"Igbo","rtl":false,"plural_equation":"0","plural_rules":{"other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:ig"}},{"id":"l:ilo","type":"languages","attributes":{"code":"ilo","name":"Iloko","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:ilo"}},{"id":"l:io","type":"languages","attributes":{"code":"io","name":"Ido","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:io"}},{"id":"l:is","type":"languages","attributes":{"code":"is","name":"Icelandic","rtl":false,"plural_equation":"(n % 10 != 1 || n % 100 == 11)","plural_rules":{"one":"n mod 10 is 1 or n mod 100 is not 11","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:is"}},{"id":"l:is_IS","type":"languages","attributes":{"code":"is_IS","name":"Icelandic (Iceland)","rtl":false,"plural_equation":"(n % 10 != 1 || n % 100 == 11)","plural_rules":{"one":"n mod 10 is 1 or n mod 100 is not 11","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:is_IS"}},{"id":"l:it","type":"languages","attributes":{"code":"it","name":"Italian","rtl":false,"plural_equation":"n == 1 ? 0 : n != 0 && n % 1000000 == 0 ? 1 : 2","plural_rules":{"one":"n is 1","many":"n is not 0 and n mod 1000000 == 0","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:it"}},{"id":"l:it_CH","type":"languages","attributes":{"code":"it_CH","name":"Italian (Switzerland)","rtl":false,"plural_equation":"n == 1 ? 0 : n != 0 && n % 1000000 == 0 ? 1 : 2","plural_rules":{"one":"n is 1","many":"n is not 0 and n mod 1000000 == 0","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:it_CH"}},{"id":"l:it_IT","type":"languages","attributes":{"code":"it_IT","name":"Italian (Italy)","rtl":false,"plural_equation":"n == 1 ? 0 : n != 0 && n % 1000000 == 0 ? 1 : 2","plural_rules":{"one":"n is 1","many":"n is not 0 and n mod 1000000 == 0","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:it_IT"}},{"id":"l:it@qtfiletype","type":"languages","attributes":{"code":"it@qtfiletype","name":"Italian (QT FILETYPE)","rtl":false,"plural_equation":"n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:it@qtfiletype"}},{"id":"l:iu","type":"languages","attributes":{"code":"iu","name":"Inuktitut","rtl":false,"plural_equation":"n == 1 ? 0 : n == 2 ? 1 : 2","plural_rules":{"one":"n is 1","two":"n is 2","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:iu"}},{"id":"l:ja","type":"languages","attributes":{"code":"ja","name":"Japanese","rtl":false,"plural_equation":"0","plural_rules":{"other":"everything"}},"links":{"self":"https://rest.api.transifex.com/languages/l:ja"}},{"id":"l:ja-Hira","type":"languages","attributes":{"code":"ja-Hira","name":"Japanese (Hiragana)","rtl":false,"plural_equation":"0","plural_rules":{"other":"everything"}},"links":{"self":"https://rest.api.transifex.com/languages/l:ja-Hira"}},{"id":"l:ja_JP","type":"languages","attributes":{"code":"ja_JP","name":"Japanese (Japan)","rtl":false,"plural_equation":"0","plural_rules":{"other":"everything"}},"links":{"self":"https://rest.api.transifex.com/languages/l:ja_JP"}},{"id":"l:jam","type":"languages","attributes":{"code":"jam","name":"Jamaican Patois","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:jam"}},{"id":"l:jbo","type":"languages","attributes":{"code":"jbo","name":"Lojban","rtl":false,"plural_equation":"0","plural_rules":{"other":"everything"}},"links":{"self":"https://rest.api.transifex.com/languages/l:jbo"}},{"id":"l:jv","type":"languages","attributes":{"code":"jv","name":"Javanese","rtl":false,"plural_equation":"0","plural_rules":{"other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:jv"}},{"id":"l:ka","type":"languages","attributes":{"code":"ka","name":"Georgian","rtl":false,"plural_equation":"(n!=1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:ka"}},{"id":"l:kaa","type":"languages","attributes":{"code":"kaa","name":"Karakalpak","rtl":false,"plural_equation":"(n!=1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:kaa"}},{"id":"l:kab","type":"languages","attributes":{"code":"kab","name":"Kabyle","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:kab"}},{"id":"l:ka_GE","type":"languages","attributes":{"code":"ka_GE","name":"Georgian (Georgia)","rtl":false,"plural_equation":"(n!=1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:ka_GE"}},{"id":"l:kbd","type":"languages","attributes":{"code":"kbd","name":"Kabardian","rtl":false,"plural_equation":"0","plural_rules":{"other":"everything"}},"links":{"self":"https://rest.api.transifex.com/languages/l:kbd"}},{"id":"l:kha","type":"languages","attributes":{"code":"kha","name":"Khasi","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:kha"}},{"id":"l:ki","type":"languages","attributes":{"code":"ki","name":"Kikuyu","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:ki"}},{"id":"l:kk","type":"languages","attributes":{"code":"kk","name":"Kazakh","rtl":false,"plural_equation":"(n!=1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:kk"}},{"id":"l:kk@Arab","type":"languages","attributes":{"code":"kk@Arab","name":"Kazakh (Arabic)","rtl":false,"plural_equation":"(n!=1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:kk@Arab"}},{"id":"l:kk@Cyrl","type":"languages","attributes":{"code":"kk@Cyrl","name":"Kazakh (Cyrillic)","rtl":false,"plural_equation":"(n!=1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:kk@Cyrl"}},{"id":"l:kk_KZ","type":"languages","attributes":{"code":"kk_KZ","name":"Kazakh (Kazakhstan)","rtl":false,"plural_equation":"(n!=1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:kk_KZ"}},{"id":"l:kk@latin","type":"languages","attributes":{"code":"kk@latin","name":"Kazakh (Latin)","rtl":false,"plural_equation":"(n!=1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:kk@latin"}},{"id":"l:kl","type":"languages","attributes":{"code":"kl","name":"Greenlandic","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:kl"}},{"id":"l:km","type":"languages","attributes":{"code":"km","name":"Khmer","rtl":false,"plural_equation":"0","plural_rules":{"other":"everything"}},"links":{"self":"https://rest.api.transifex.com/languages/l:km"}},{"id":"l:km_KH","type":"languages","attributes":{"code":"km_KH","name":"Khmer (Cambodia)","rtl":false,"plural_equation":"0","plural_rules":{"other":"everything"}},"links":{"self":"https://rest.api.transifex.com/languages/l:km_KH"}},{"id":"l:kmr","type":"languages","attributes":{"code":"kmr","name":"Kurmanji","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:kmr"}},{"id":"l:kn","type":"languages","attributes":{"code":"kn","name":"Kannada","rtl":false,"plural_equation":"(n > 1)","plural_rules":{"one":"(n is decimal and n < 1) or n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:kn"}},{"id":"l:kn_IN","type":"languages","attributes":{"code":"kn_IN","name":"Kannada (India)","rtl":false,"plural_equation":"(n > 1)","plural_rules":{"one":"(n is decimal and n < 1) or n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:kn_IN"}},{"id":"l:ko","type":"languages","attributes":{"code":"ko","name":"Korean","rtl":false,"plural_equation":"0","plural_rules":{"other":"everything"}},"links":{"self":"https://rest.api.transifex.com/languages/l:ko"}},{"id":"l:kog","type":"languages","attributes":{"code":"kog","name":"Kogi","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:kog"}},{"id":"l:kok","type":"languages","attributes":{"code":"kok","name":"Konkani","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:kok"}},{"id":"l:ko_KR","type":"languages","attributes":{"code":"ko_KR","name":"Korean (Korea)","rtl":false,"plural_equation":"0","plural_rules":{"other":"everything"}},"links":{"self":"https://rest.api.transifex.com/languages/l:ko_KR"}},{"id":"l:kqn","type":"languages","attributes":{"code":"kqn","name":"Kaonde","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:kqn"}},{"id":"l:krc","type":"languages","attributes":{"code":"krc","name":"Karachay-Balkar","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:krc"}},{"id":"l:krl","type":"languages","attributes":{"code":"krl","name":"Karelian","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:krl"}},{"id":"l:ks","type":"languages","attributes":{"code":"ks","name":"Kashmiri","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:ks"}},{"id":"l:ksh","type":"languages","attributes":{"code":"ksh","name":"Colognian","rtl":false,"plural_equation":"(n==0) ? 0 : (n==1) ? 1 : 2","plural_rules":{"zero":"n is 0","one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:ksh"}},{"id":"l:ks_IN","type":"languages","attributes":{"code":"ks_IN","name":"Kashmiri (India)","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:ks_IN"}},{"id":"l:ku","type":"languages","attributes":{"code":"ku","name":"Kurdish","rtl":true,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:ku"}},{"id":"l:ku_IQ","type":"languages","attributes":{"code":"ku_IQ","name":"Kurdish (Iraq)","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:ku_IQ"}},{"id":"l:kw","type":"languages","attributes":{"code":"kw","name":"Cornish","rtl":false,"plural_equation":"n == 0 ? 0 : n == 1 ? 1 : (n % 100 == 2 || n % 100 == 22 || n % 100 == 42 || n % 100 == 62 || n % 100 == 82) || n % 1000 == 0 && (n % 100000 >= 1000 && n % 100000 <= 20000 || n % 100000 == 40000 || n % 100000 == 60000 || n % 100000 == 80000) || n != 0 && n % 1000000 == 100000 ? 2 : (n % 100 == 3 || n % 100 == 23 || n % 100 == 43 || n % 100 == 63 || n % 100 == 83) ? 3 : n != 1 && (n % 100 == 1 || n % 100 == 21 || n % 100 == 41 || n % 100 == 61 || n % 100 == 81) ? 4 : 5","plural_rules":{"zero":"n is 0","one":"n is 1","two":"n mod 100 is 2,22,42,62,82 or n mod 1000 is 0 and (n mod 100000 in 1000..20000 or n % 100000 is 40000,60000,80000 or n is not 0 and && n mod 1000000 is 100000)","many":"n is not 1 and n mod 100 is 1,21,41,61,81","few":"n mod 100 is 3,23,43,63,83","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:kw"}},{"id":"l:ky","type":"languages","attributes":{"code":"ky","name":"Kyrgyz","rtl":false,"plural_equation":"0","plural_rules":{"other":"everything"}},"links":{"self":"https://rest.api.transifex.com/languages/l:ky"}},{"id":"l:ky@Arab","type":"languages","attributes":{"code":"ky@Arab","name":"Kyrgyz (Arabic)","rtl":false,"plural_equation":"0","plural_rules":{"other":"everything"}},"links":{"self":"https://rest.api.transifex.com/languages/l:ky@Arab"}},{"id":"l:la","type":"languages","attributes":{"code":"la","name":"Latin","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:la"}},{"id":"l:lad","type":"languages","attributes":{"code":"lad","name":"Ladino","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:lad"}},{"id":"l:lb","type":"languages","attributes":{"code":"lb","name":"Luxembourgish","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:lb"}},{"id":"l:lez","type":"languages","attributes":{"code":"lez","name":"Lezghian","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:lez"}},{"id":"l:lfn","type":"languages","attributes":{"code":"lfn","name":"Lingua Franca Nova","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:lfn"}},{"id":"l:lg","type":"languages","attributes":{"code":"lg","name":"Luganda","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:lg"}},{"id":"l:lg_UG","type":"languages","attributes":{"code":"lg_UG","name":"Ganda (Uganda)","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:lg_UG"}},{"id":"l:li","type":"languages","attributes":{"code":"li","name":"Limburgian","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:li"}},{"id":"l:lij","type":"languages","attributes":{"code":"lij","name":"Ligurian","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:lij"}},{"id":"l:lkt","type":"languages","attributes":{"code":"lkt","name":"Lakota","rtl":false,"plural_equation":"0","plural_rules":{"other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:lkt"}},{"id":"l:lmo","type":"languages","attributes":{"code":"lmo","name":"Lombard","rtl":false,"plural_equation":"n==0 ? 0 : n==1 ? 1 : 2","plural_rules":{"zero":"n is 0","one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:lmo"}},{"id":"l:ln","type":"languages","attributes":{"code":"ln","name":"Lingala","rtl":false,"plural_equation":"(n > 1)","plural_rules":{"one":"n in 0..1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:ln"}},{"id":"l:lo","type":"languages","attributes":{"code":"lo","name":"Lao","rtl":false,"plural_equation":"0","plural_rules":{"other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:lo"}},{"id":"l:lo_LA","type":"languages","attributes":{"code":"lo_LA","name":"Lao (Laos)","rtl":false,"plural_equation":"0","plural_rules":{"other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:lo_LA"}},{"id":"l:loz_ZM","type":"languages","attributes":{"code":"loz_ZM","name":"Lozi (Zambia)","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:loz_ZM"}},{"id":"l:lrc","type":"languages","attributes":{"code":"lrc","name":"Northern Luri","rtl":true,"plural_equation":"(n > 1)","plural_rules":{"one":"n <=1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:lrc"}},{"id":"l:lt","type":"languages","attributes":{"code":"lt","name":"Lithuanian","rtl":false,"plural_equation":"(n % 10 == 1 && (n % 100 > 19 || n % 100 < 11) ? 0 : (n % 10 >= 2 && n % 10 <=9) && (n % 100 > 19 || n % 100 < 11) ? 1 : n % 1 != 0 ? 2: 3)","plural_rules":{"one":"n mod 10 is 1 and n mod 100 not in 11..19","many":"n is decimal","few":"n mod 10 in 2..9 and n mod 100 not in 11..19","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:lt"}},{"id":"l:ltg","type":"languages","attributes":{"code":"ltg","name":"Latgalian","rtl":false,"plural_equation":"(n%10==1 && n%100!=11 ? 0 : n != 0 ? 1 : 2)","plural_rules":{"zero":"n mod 10 is 1 and n mod 100 is not 11","one":"n != 0","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:ltg"}},{"id":"l:lt_LT","type":"languages","attributes":{"code":"lt_LT","name":"Lithuanian (Lithuania)","rtl":false,"plural_equation":"(n % 10 == 1 && (n % 100 > 19 || n % 100 < 11) ? 0 : (n % 10 >= 2 && n % 10 <=9) && (n % 100 > 19 || n % 100 < 11) ? 1 : n % 1 != 0 ? 2: 3)","plural_rules":{"one":"n mod 10 is 1 and n mod 100 not in 11..19","many":"n is decimal","few":"n mod 10 in 2..9 and n mod 100 not in 11..19","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:lt_LT"}},{"id":"l:lue","type":"languages","attributes":{"code":"lue","name":"Luvale","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:lue"}},{"id":"l:lus","type":"languages","attributes":{"code":"lus","name":"Mizo","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:lus"}},{"id":"l:luz","type":"languages","attributes":{"code":"luz","name":"Southern Luri","rtl":true,"plural_equation":"(n > 1)","plural_rules":{"one":"n <=1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:luz"}},{"id":"l:lv","type":"languages","attributes":{"code":"lv","name":"Latvian","rtl":false,"plural_equation":"(n%10==1 && n%100!=11 ? 0 : n != 0 ? 1 : 2)","plural_rules":{"zero":"n is 0","one":"n mod 10 is 1 and n mod 100 is not 11","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:lv"}},{"id":"l:lv_LV","type":"languages","attributes":{"code":"lv_LV","name":"Latvian (Latvia)","rtl":false,"plural_equation":"(n%10==1 && n%100!=11 ? 0 : n != 0 ? 1 : 2)","plural_rules":{"zero":"n is 0","one":"n mod 10 is 1 and n mod 100 is not 11","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:lv_LV"}},{"id":"l:lzh","type":"languages","attributes":{"code":"lzh","name":"Chinese (Literary)","rtl":false,"plural_equation":"0","plural_rules":{"other":"everything"}},"links":{"self":"https://rest.api.transifex.com/languages/l:lzh"}},{"id":"l:mai","type":"languages","attributes":{"code":"mai","name":"Maithili","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:mai"}},{"id":"l:mfe","type":"languages","attributes":{"code":"mfe","name":"Mauritian Creole","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:mfe"}},{"id":"l:mg","type":"languages","attributes":{"code":"mg","name":"Malagasy","rtl":false,"plural_equation":"(n > 1)","plural_rules":{"one":"n in 0..1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:mg"}},{"id":"l:mh","type":"languages","attributes":{"code":"mh","name":"Marshallese","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:mh"}},{"id":"l:mhr","type":"languages","attributes":{"code":"mhr","name":"Meadow Mari","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:mhr"}},{"id":"l:mhr_RU","type":"languages","attributes":{"code":"mhr_RU","name":"Eastern Mari (Russia)","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:mhr_RU"}},{"id":"l:mi","type":"languages","attributes":{"code":"mi","name":"Maori","rtl":false,"plural_equation":"(n > 1)","plural_rules":{"one":"n in 0..1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:mi"}},{"id":"l:min","type":"languages","attributes":{"code":"min","name":"Minangkabau","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:min"}},{"id":"l:mk","type":"languages","attributes":{"code":"mk","name":"Macedonian","rtl":false,"plural_equation":"(n % 10 == 1 && n % 100 != 11) ? 0 : 1","plural_rules":{"one":"n mod 10 is 1 and n is not 11","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:mk"}},{"id":"l:mk_MK","type":"languages","attributes":{"code":"mk_MK","name":"Macedonian (Macedonia)","rtl":false,"plural_equation":"(n % 10 == 1 && n % 100 != 11) ? 0 : 1","plural_rules":{"one":"n mod 10 is 1 and n is not 11","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:mk_MK"}},{"id":"l:ml","type":"languages","attributes":{"code":"ml","name":"Malayalam","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:ml"}},{"id":"l:ml_IN","type":"languages","attributes":{"code":"ml_IN","name":"Malayalam (India)","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:ml_IN"}},{"id":"l:mn","type":"languages","attributes":{"code":"mn","name":"Mongolian","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:mn"}},{"id":"l:mni","type":"languages","attributes":{"code":"mni","name":"Manipuri","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:mni"}},{"id":"l:mn_MN","type":"languages","attributes":{"code":"mn_MN","name":"Mongolian (Mongolia)","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:mn_MN"}},{"id":"l:mnp","type":"languages","attributes":{"code":"mnp","name":"Chinese (Min Bei)","rtl":false,"plural_equation":"0","plural_rules":{"other":"everything"}},"links":{"self":"https://rest.api.transifex.com/languages/l:mnp"}},{"id":"l:mr","type":"languages","attributes":{"code":"mr","name":"Marathi","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:mr"}},{"id":"l:mr_IN","type":"languages","attributes":{"code":"mr_IN","name":"Marathi (India)","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:mr_IN"}},{"id":"l:ms","type":"languages","attributes":{"code":"ms","name":"Malay","rtl":false,"plural_equation":"0","plural_rules":{"other":"everything"}},"links":{"self":"https://rest.api.transifex.com/languages/l:ms"}},{"id":"l:ms@Arab","type":"languages","attributes":{"code":"ms@Arab","name":"Malay (Arabic)","rtl":false,"plural_equation":"0","plural_rules":{"other":"everything"}},"links":{"self":"https://rest.api.transifex.com/languages/l:ms@Arab"}},{"id":"l:ms_BN","type":"languages","attributes":{"code":"ms_BN","name":"Malay (Brunei)","rtl":false,"plural_equation":"0","plural_rules":{"other":"everything"}},"links":{"self":"https://rest.api.transifex.com/languages/l:ms_BN"}},{"id":"l:ms_MY","type":"languages","attributes":{"code":"ms_MY","name":"Malay (Malaysia)","rtl":false,"plural_equation":"0","plural_rules":{"other":"everything"}},"links":{"self":"https://rest.api.transifex.com/languages/l:ms_MY"}},{"id":"l:mt","type":"languages","attributes":{"code":"mt","name":"Maltese","rtl":false,"plural_equation":"(n==1 ? 0 : n==0 || ( n%100>1 && n%100<11) ? 1 : (n%100>10 && n%100<20 ) ? 2 : 3)","plural_rules":{"one":"n is 1","many":"n mod 100 in 11..19","few":"n is 0 or n mod 100 in 2..10","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:mt"}},{"id":"l:mt_MT","type":"languages","attributes":{"code":"mt_MT","name":"Maltese (Malta)","rtl":false,"plural_equation":"(n==1 ? 0 : n==0 || ( n%100>1 && n%100<11) ? 1 : (n%100>10 && n%100<20 ) ? 2 : 3)","plural_rules":{"one":"n is 1","many":"n mod 100 in 11..19","few":"n is 0 or n mod 100 in 2..10","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:mt_MT"}},{"id":"l:mus","type":"languages","attributes":{"code":"mus","name":"Muscogee","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:mus"}},{"id":"l:mw1","type":"languages","attributes":{"code":"mw1","name":"Mirandese","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:mw1"}},{"id":"l:mxp","type":"languages","attributes":{"code":"mxp","name":"Tlahuitoltepec Mixe","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:mxp"}},{"id":"l:my","type":"languages","attributes":{"code":"my","name":"Burmese","rtl":false,"plural_equation":"0","plural_rules":{"other":"everything"}},"links":{"self":"https://rest.api.transifex.com/languages/l:my"}},{"id":"l:my_MM","type":"languages","attributes":{"code":"my_MM","name":"Burmese (Myanmar)","rtl":false,"plural_equation":"0","plural_rules":{"other":"everything"}},"links":{"self":"https://rest.api.transifex.com/languages/l:my_MM"}},{"id":"l:myv","type":"languages","attributes":{"code":"myv","name":"Erzya","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:myv"}},{"id":"l:nah","type":"languages","attributes":{"code":"nah","name":"Nahuatl","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:nah"}},{"id":"l:nan","type":"languages","attributes":{"code":"nan","name":"Chinese (Min Nan)","rtl":false,"plural_equation":"0","plural_rules":{"other":"everything"}},"links":{"self":"https://rest.api.transifex.com/languages/l:nan"}},{"id":"l:nap","type":"languages","attributes":{"code":"nap","name":"Neapolitan","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n in 0..1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:nap"}},{"id":"l:nb","type":"languages","attributes":{"code":"nb","name":"Norwegian Bokmål","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:nb"}},{"id":"l:nb_NO","type":"languages","attributes":{"code":"nb_NO","name":"Norwegian Bokmål (Norway)","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:nb_NO"}},{"id":"l:nd","type":"languages","attributes":{"code":"nd","name":"Ndebele, North","rtl":false,"plural_equation":"(n == 1 ? 0 : 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:nd"}},{"id":"l:nds","type":"languages","attributes":{"code":"nds","name":"Low German","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:nds"}},{"id":"l:ne","type":"languages","attributes":{"code":"ne","name":"Nepali","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:ne"}},{"id":"l:ne_NP","type":"languages","attributes":{"code":"ne_NP","name":"Nepali (Nepal)","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:ne_NP"}},{"id":"l:nia","type":"languages","attributes":{"code":"nia","name":"Nias","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:nia"}},{"id":"l:nl","type":"languages","attributes":{"code":"nl","name":"Dutch","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:nl"}},{"id":"l:nl_BE","type":"languages","attributes":{"code":"nl_BE","name":"Dutch (Belgium)","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:nl_BE"}},{"id":"l:nl_CW","type":"languages","attributes":{"code":"nl_CW","name":"Dutch (CURAÇAO)","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:nl_CW"}},{"id":"l:nl_NL","type":"languages","attributes":{"code":"nl_NL","name":"Dutch (Netherlands)","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:nl_NL"}},{"id":"l:nn","type":"languages","attributes":{"code":"nn","name":"Norwegian Nynorsk","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:nn"}},{"id":"l:nn_NO","type":"languages","attributes":{"code":"nn_NO","name":"Norwegian Nynorsk (Norway)","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:nn_NO"}},{"id":"l:no","type":"languages","attributes":{"code":"no","name":"Norwegian","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:no"}},{"id":"l:no_NO","type":"languages","attributes":{"code":"no_NO","name":"Norwegian (Norway)","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:no_NO"}},{"id":"l:nqo","type":"languages","attributes":{"code":"nqo","name":"N\'ko","rtl":true,"plural_equation":"0","plural_rules":{"other":"everything"}},"links":{"self":"https://rest.api.transifex.com/languages/l:nqo"}},{"id":"l:nr","type":"languages","attributes":{"code":"nr","name":"Ndebele, South","rtl":false,"plural_equation":"(n == 1 ? 0 : 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:nr"}},{"id":"l:nso","type":"languages","attributes":{"code":"nso","name":"Northern Sotho","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:nso"}},{"id":"l:nv","type":"languages","attributes":{"code":"nv","name":"Navajo","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:nv"}},{"id":"l:ny","type":"languages","attributes":{"code":"ny","name":"Nyanja","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:ny"}},{"id":"l:ny_MW","type":"languages","attributes":{"code":"ny_MW","name":"Nyanja (Malawi)","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:ny_MW"}},{"id":"l:oc","type":"languages","attributes":{"code":"oc","name":"Occitan (post 1500)","rtl":false,"plural_equation":"(n > 1)","plural_rules":{"one":"n in 0..1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:oc"}},{"id":"l:oc-aranes","type":"languages","attributes":{"code":"oc-aranes","name":"Aranese","rtl":false,"plural_equation":"(n > 1)","plural_rules":{"one":"n in 0..1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:oc-aranes"}},{"id":"l:oc-auvern","type":"languages","attributes":{"code":"oc-auvern","name":"Occitan (Auvergnat)","rtl":false,"plural_equation":"(n > 1)","plural_rules":{"one":"n in 0..1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:oc-auvern"}},{"id":"l:oc-cisaup","type":"languages","attributes":{"code":"oc-cisaup","name":"Occitan (Cisalpine)","rtl":false,"plural_equation":"(n > 1)","plural_rules":{"one":"n in 0..1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:oc-cisaup"}},{"id":"l:oc-gascon","type":"languages","attributes":{"code":"oc-gascon","name":"Occitan (Gascon)","rtl":false,"plural_equation":"(n > 1)","plural_rules":{"one":"n in 0..1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:oc-gascon"}},{"id":"l:oc-lemosin","type":"languages","attributes":{"code":"oc-lemosin","name":"Occitan (Limousin)","rtl":false,"plural_equation":"(n > 1)","plural_rules":{"one":"n in 0..1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:oc-lemosin"}},{"id":"l:oc-lengadoc","type":"languages","attributes":{"code":"oc-lengadoc","name":"Occitan (Languedocien)","rtl":false,"plural_equation":"(n > 1)","plural_rules":{"one":"n in 0..1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:oc-lengadoc"}},{"id":"l:oc-nicard","type":"languages","attributes":{"code":"oc-nicard","name":"Occitan (Niçard)","rtl":false,"plural_equation":"(n > 1)","plural_rules":{"one":"n in 0..1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:oc-nicard"}},{"id":"l:oc-provenc","type":"languages","attributes":{"code":"oc-provenc","name":"Occitan (Provençal)","rtl":false,"plural_equation":"(n > 1)","plural_rules":{"one":"n in 0..1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:oc-provenc"}},{"id":"l:oc-vivaraup","type":"languages","attributes":{"code":"oc-vivaraup","name":"Occitan (Vivaro-Alpine)","rtl":false,"plural_equation":"(n > 1)","plural_rules":{"one":"n in 0..1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:oc-vivaraup"}},{"id":"l:om","type":"languages","attributes":{"code":"om","name":"Oromo","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:om"}},{"id":"l:or","type":"languages","attributes":{"code":"or","name":"Odia","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:or"}},{"id":"l:or_IN","type":"languages","attributes":{"code":"or_IN","name":"Odia (India)","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:or_IN"}},{"id":"l:os","type":"languages","attributes":{"code":"os","name":"Ossetic","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:os"}},{"id":"l:pa","type":"languages","attributes":{"code":"pa","name":"Panjabi (Punjabi)","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:pa"}},{"id":"l:pa_IN","type":"languages","attributes":{"code":"pa_IN","name":"Panjabi (Punjabi) (India)","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:pa_IN"}},{"id":"l:pam","type":"languages","attributes":{"code":"pam","name":"Kapampangan","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:pam"}},{"id":"l:pap","type":"languages","attributes":{"code":"pap","name":"Papiamento","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:pap"}},{"id":"l:pap_AW","type":"languages","attributes":{"code":"pap_AW","name":"Papiamento (ARUBA)","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:pap_AW"}},{"id":"l:pap_CW","type":"languages","attributes":{"code":"pap_CW","name":"Papiamento (CURAÇAO)","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:pap_CW"}},{"id":"l:pa_PK","type":"languages","attributes":{"code":"pa_PK","name":"Panjabi (Pakistan)","rtl":true,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:pa_PK"}},{"id":"l:pbb","type":"languages","attributes":{"code":"pbb","name":"Páez","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:pbb"}},{"id":"l:pcm","type":"languages","attributes":{"code":"pcm","name":"Nigerian Pidgin","rtl":false,"plural_equation":"(n > 1)","plural_rules":{"one":"n <=1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:pcm"}},{"id":"l:pfl","type":"languages","attributes":{"code":"pfl","name":"Palatinate German","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:pfl"}},{"id":"l:pl","type":"languages","attributes":{"code":"pl","name":"Polish","rtl":false,"plural_equation":"(n==1 ? 0 : (n%10>=2 && n%10<=4) && (n%100<12 || n%100>14) ? 1 : n!=1 && (n%10>=0 && n%10<=1) || (n%10>=5 && n%10<=9) || (n%100>=12 && n%100<=14) ? 2 : 3)","plural_rules":{"one":"n is 1","many":"n is not 1 and n mod 10 in 0..1 or n mod 10 in 5..9 or n mod 100 in 12..14","few":"n mod 10 in 2..4 and n mod 100 not in 12..14","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:pl"}},{"id":"l:pl_PL","type":"languages","attributes":{"code":"pl_PL","name":"Polish (Poland)","rtl":false,"plural_equation":"(n==1 ? 0 : (n%10>=2 && n%10<=4) && (n%100<12 || n%100>14) ? 1 : n!=1 && (n%10>=0 && n%10<=1) || (n%10>=5 && n%10<=9) || (n%100>=12 && n%100<=14) ? 2 : 3)","plural_rules":{"one":"n is 1","many":"n is not 1 and n mod 10 in 0..1 or n mod 10 in 5..9 or n mod 100 in 12..14","few":"n mod 10 in 2..4 and n mod 100 not in 12..14","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:pl_PL"}},{"id":"l:pl@qtfiletype","type":"languages","attributes":{"code":"pl@qtfiletype","name":"Polish (QT FILETYPE)","rtl":false,"plural_equation":"(n==1 ? 0 : (n%10>=2 && n%10<=4) && (n%100<10 || n%100>20) ? 1 : 2)","plural_rules":{"one":"n is 1","few":"n mod 10 in 2..4 and n mod 100 not in 10..20","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:pl@qtfiletype"}},{"id":"l:pms","type":"languages","attributes":{"code":"pms","name":"Piemontese","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:pms"}},{"id":"l:ps","type":"languages","attributes":{"code":"ps","name":"Pashto","rtl":true,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:ps"}},{"id":"l:ps_AF","type":"languages","attributes":{"code":"ps_AF","name":"Pashto (Afghanistan)","rtl":true,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:ps_AF"}},{"id":"l:pt","type":"languages","attributes":{"code":"pt","name":"Portuguese","rtl":false,"plural_equation":"(n == 0 || n == 1) ? 0 : n != 0 && n % 1000000 == 0 ? 1 : 2","plural_rules":{"one":"n is 0 or n is 1","many":"n is not 0 and n mod 1000000 == 0","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:pt"}},{"id":"l:pt_AO","type":"languages","attributes":{"code":"pt_AO","name":"Portuguese (Angola)","rtl":false,"plural_equation":"(n == 0 || n == 1) ? 0 : n != 0 && n % 1000000 == 0 ? 1 : 2","plural_rules":{"one":"n is 0 or n is 1","many":"n is not 0 and n mod 1000000 == 0","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:pt_AO"}},{"id":"l:pt_BR","type":"languages","attributes":{"code":"pt_BR","name":"Portuguese (Brazil)","rtl":false,"plural_equation":"(n == 0 || n == 1) ? 0 : n != 0 && n % 1000000 == 0 ? 1 : 2","plural_rules":{"one":"n is 0 or n is 1","many":"n is not 0 and n mod 1000000 == 0","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:pt_BR"}},{"id":"l:pt_CL","type":"languages","attributes":{"code":"pt_CL","name":"Portuguese (Chile)","rtl":false,"plural_equation":"(n == 0 || n == 1) ? 0 : n != 0 && n % 1000000 == 0 ? 1 : 2","plural_rules":{"one":"n is 0 or n is 1","many":"n is not 0 and n mod 1000000 == 0","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:pt_CL"}},{"id":"l:pt_CO","type":"languages","attributes":{"code":"pt_CO","name":"Portuguese (Colombia)","rtl":false,"plural_equation":"(n == 0 || n == 1) ? 0 : n != 0 && n % 1000000 == 0 ? 1 : 2","plural_rules":{"one":"n is 0 or n is 1","many":"n is not 0 and n mod 1000000 == 0","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:pt_CO"}},{"id":"l:pt_MX","type":"languages","attributes":{"code":"pt_MX","name":"Portuguese (Mexico)","rtl":false,"plural_equation":"(n == 0 || n == 1) ? 0 : n != 0 && n % 1000000 == 0 ? 1 : 2","plural_rules":{"one":"n is 0 or n is 1","many":"n is not 0 and n mod 1000000 == 0","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:pt_MX"}},{"id":"l:pt_MZ","type":"languages","attributes":{"code":"pt_MZ","name":"Portuguese (Mozambique)","rtl":false,"plural_equation":"(n == 0 || n == 1) ? 0 : n != 0 && n % 1000000 == 0 ? 1 : 2","plural_rules":{"one":"n is 0 or n is 1","many":"n is not 0 and n mod 1000000 == 0","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:pt_MZ"}},{"id":"l:pt_PE","type":"languages","attributes":{"code":"pt_PE","name":"Portuguese (Peru)","rtl":false,"plural_equation":"(n == 0 || n == 1) ? 0 : n != 0 && n % 1000000 == 0 ? 1 : 2","plural_rules":{"one":"n is 0 or n is 1","many":"n is not 0 and n mod 1000000 == 0","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:pt_PE"}},{"id":"l:pt_PT","type":"languages","attributes":{"code":"pt_PT","name":"Portuguese (Portugal)","rtl":false,"plural_equation":"(n == 0 || n == 1) ? 0 : n != 0 && n % 1000000 == 0 ? 1 : 2","plural_rules":{"one":"n is 0 or n is 1","many":"n is not 0 and n mod 1000000 == 0","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:pt_PT"}},{"id":"l:pt@qtfiletype","type":"languages","attributes":{"code":"pt@qtfiletype","name":"Portuguese (QT FILETYPE)","rtl":false,"plural_equation":"n != 1","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:pt@qtfiletype"}},{"id":"l:qji","type":"languages","attributes":{"code":"qji","name":"Atanque","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:qji"}},{"id":"l:qu","type":"languages","attributes":{"code":"qu","name":"Quechua","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:qu"}},{"id":"l:quc","type":"languages","attributes":{"code":"quc","name":"K\'iche\'","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:quc"}},{"id":"l:qu_EC","type":"languages","attributes":{"code":"qu_EC","name":"Quechua (Ecuador)","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:qu_EC"}},{"id":"l:quh","type":"languages","attributes":{"code":"quh","name":"South Bolivian Quechua","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:quh"}},{"id":"l:rap","type":"languages","attributes":{"code":"rap","name":"Rapa Nui","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:rap"}},{"id":"l:rif","type":"languages","attributes":{"code":"rif","name":"Tarifit","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:rif"}},{"id":"l:rm","type":"languages","attributes":{"code":"rm","name":"Romansh","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:rm"}},{"id":"l:rn","type":"languages","attributes":{"code":"rn","name":"Kirundi","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:rn"}},{"id":"l:ro","type":"languages","attributes":{"code":"ro","name":"Romanian","rtl":false,"plural_equation":"(n==1?0:(((n%100>19)||((n%100==0)&&(n!=0)))?2:1))","plural_rules":{"one":"n is 1","few":"n is 0 OR n is not 1 AND n mod 100 in 1..19","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:ro"}},{"id":"l:ro_MD","type":"languages","attributes":{"code":"ro_MD","name":"Romanian (Moldova)","rtl":false,"plural_equation":"(n==1?0:(((n%100>19)||((n%100==0)&&(n!=0)))?2:1))","plural_rules":{"one":"n is 1","few":"n is 0 OR n is not 1 AND n mod 100 in 1..19","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:ro_MD"}},{"id":"l:ro_RO","type":"languages","attributes":{"code":"ro_RO","name":"Romanian (Romania)","rtl":false,"plural_equation":"(n==1?0:(((n%100>19)||((n%100==0)&&(n!=0)))?2:1))","plural_rules":{"one":"n is 1","few":"n is 0 OR n is not 1 AND n mod 100 in 1..19","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:ro_RO"}},{"id":"l:ru","type":"languages","attributes":{"code":"ru","name":"Russian","rtl":false,"plural_equation":"(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<12 || n%100>14) ? 1 : n%10==0 || (n%10>=5 && n%10<=9) || (n%100>=11 && n%100<=14)? 2 : 3)","plural_rules":{"one":"n mod 10 is 1 and n mod 100 is not 11","many":"n mod 10 == 0 OR n mod 10 in 5..9 OR n mod 100 in 11..14","few":"n mod 10 in 2..4 and n mod 100 not in 12..14","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:ru"}},{"id":"l:rue","type":"languages","attributes":{"code":"rue","name":"Rusyn","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:rue"}},{"id":"l:ru_ee","type":"languages","attributes":{"code":"ru_ee","name":"Russian (Estonia)","rtl":false,"plural_equation":"(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<12 || n%100>14) ? 1 : n%10==0 || (n%10>=5 && n%10<=9) || (n%100>=11 && n%100<=14)? 2 : 3)","plural_rules":{"one":"n mod 10 is 1 and n mod 100 is not 11","many":"n mod 10 == 0 OR n mod 10 in 5..9 OR n mod 100 in 11..14","few":"n mod 10 in 2..4 and n mod 100 not in 12..14","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:ru_ee"}},{"id":"l:ru_KZ","type":"languages","attributes":{"code":"ru_KZ","name":"Russian (Kazakhstan)","rtl":false,"plural_equation":"(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<12 || n%100>14) ? 1 : n%10==0 || (n%10>=5 && n%10<=9) || (n%100>=11 && n%100<=14)? 2 : 3)","plural_rules":{"one":"n mod 10 is 1 and n mod 100 is not 11","many":"n mod 10 == 0 OR n mod 10 in 5..9 OR n mod 100 in 11..14","few":"n mod 10 in 2..4 and n mod 100 not in 12..14","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:ru_KZ"}},{"id":"l:ru_lt","type":"languages","attributes":{"code":"ru_lt","name":"Russian (Lithuania)","rtl":false,"plural_equation":"(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<12 || n%100>14) ? 1 : n%10==0 || (n%10>=5 && n%10<=9) || (n%100>=11 && n%100<=14)? 2 : 3)","plural_rules":{"one":"n mod 10 is 1 and n mod 100 is not 11","many":"n mod 10 == 0 OR n mod 10 in 5..9 OR n mod 100 in 11..14","few":"n mod 10 in 2..4 and n mod 100 not in 12..14","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:ru_lt"}},{"id":"l:ru_lv","type":"languages","attributes":{"code":"ru_lv","name":"Russian (Latvia)","rtl":false,"plural_equation":"(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<12 || n%100>14) ? 1 : n%10==0 || (n%10>=5 && n%10<=9) || (n%100>=11 && n%100<=14)? 2 : 3)","plural_rules":{"one":"n mod 10 is 1 and n mod 100 is not 11","many":"n mod 10 == 0 OR n mod 10 in 5..9 OR n mod 100 in 11..14","few":"n mod 10 in 2..4 and n mod 100 not in 12..14","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:ru_lv"}},{"id":"l:ru@petr1708","type":"languages","attributes":{"code":"ru@petr1708","name":"Russian Petrine orthography","rtl":false,"plural_equation":"(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<12 || n%100>14) ? 1 : n%10==0 || (n%10>=5 && n%10<=9) || (n%100>=11 && n%100<=14)? 2 : 3)","plural_rules":{"one":"n mod 10 is 1 and n mod 100 is not 11","many":"n mod 10 == 0 OR n mod 10 in 5..9 OR n mod 100 in 11..14","few":"n mod 10 in 2..4 and n mod 100 not in 12..14","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:ru@petr1708"}},{"id":"l:ru@qtfiletype","type":"languages","attributes":{"code":"ru@qtfiletype","name":"Russian (QT FILETYPE)","rtl":false,"plural_equation":"(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>20) ? 1 : 2)","plural_rules":{"one":"n mod 10 is 1 and n mod 100 is not 11","few":"n mod 10 in 2..4 and n mod 100 not in 10..20","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:ru@qtfiletype"}},{"id":"l:ru_RU","type":"languages","attributes":{"code":"ru_RU","name":"Russian (Russia)","rtl":false,"plural_equation":"(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<12 || n%100>14) ? 1 : n%10==0 || (n%10>=5 && n%10<=9) || (n%100>=11 && n%100<=14)? 2 : 3)","plural_rules":{"one":"n mod 10 is 1 and n mod 100 is not 11","many":"n mod 10 == 0 OR n mod 10 in 5..9 OR n mod 100 in 11..14","few":"n mod 10 in 2..4 and n mod 100 not in 12..14","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:ru_RU"}},{"id":"l:ru_UA","type":"languages","attributes":{"code":"ru_UA","name":"Russian (Ukraine)","rtl":false,"plural_equation":"(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<12 || n%100>14) ? 1 : n%10==0 || (n%10>=5 && n%10<=9) || (n%100>=11 && n%100<=14)? 2 : 3)","plural_rules":{"one":"n mod 10 is 1 and n mod 100 is not 11","many":"n mod 10 == 0 OR n mod 10 in 5..9 OR n mod 100 in 11..14","few":"n mod 10 in 2..4 and n mod 100 not in 12..14","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:ru_UA"}},{"id":"l:rw","type":"languages","attributes":{"code":"rw","name":"Kinyarwanda","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:rw"}},{"id":"l:sa","type":"languages","attributes":{"code":"sa","name":"Sanskrit","rtl":false,"plural_equation":"(n==1 ? 0 : n==2 ? 1:2)","plural_rules":{"one":"n is 1","two":"n is 2","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:sa"}},{"id":"l:sah","type":"languages","attributes":{"code":"sah","name":"Sakha (Yakut)","rtl":false,"plural_equation":"0","plural_rules":{"other":"everything"}},"links":{"self":"https://rest.api.transifex.com/languages/l:sah"}},{"id":"l:saq","type":"languages","attributes":{"code":"saq","name":"Samburu","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:saq"}},{"id":"l:sat","type":"languages","attributes":{"code":"sat","name":"Santali","rtl":false,"plural_equation":"n == 1 ? 0 : n == 2 ? 1 : 2","plural_rules":{"one":"n is 1","two":"n is 2","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:sat"}},{"id":"l:sc","type":"languages","attributes":{"code":"sc","name":"Sardinian","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:sc"}},{"id":"l:scn","type":"languages","attributes":{"code":"scn","name":"Sicilian","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:scn"}},{"id":"l:sco","type":"languages","attributes":{"code":"sco","name":"Scots","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:sco"}},{"id":"l:sd","type":"languages","attributes":{"code":"sd","name":"Sindhi","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:sd"}},{"id":"l:sdh","type":"languages","attributes":{"code":"sdh","name":"Southern Kurdish","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:sdh"}},{"id":"l:se","type":"languages","attributes":{"code":"se","name":"Northern Sami","rtl":false,"plural_equation":"(n == 1 ? 0 : n == 2 ? 1 : 2)","plural_rules":{"one":"n is 1","two":"n is 2","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:se"}},{"id":"l:sg","type":"languages","attributes":{"code":"sg","name":"Sango","rtl":false,"plural_equation":"0","plural_rules":{"other":"everything"}},"links":{"self":"https://rest.api.transifex.com/languages/l:sg"}},{"id":"l:shi","type":"languages","attributes":{"code":"shi","name":"Tachelhit","rtl":false,"plural_equation":"(n == 1) ? 0 : (n >= 2 && n <= 10) ? 1 : 2)","plural_rules":{"one":"n is 1","few":"n in 2..10","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:shi"}},{"id":"l:shy","type":"languages","attributes":{"code":"shy","name":"Tachawit","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:shy"}},{"id":"l:si","type":"languages","attributes":{"code":"si","name":"Sinhala","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:si"}},{"id":"l:sid","type":"languages","attributes":{"code":"sid","name":"Sidama","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:sid"}},{"id":"l:si_LK","type":"languages","attributes":{"code":"si_LK","name":"Sinhala (Sri Lanka)","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:si_LK"}},{"id":"l:sk","type":"languages","attributes":{"code":"sk","name":"Slovak","rtl":false,"plural_equation":"(n % 1 == 0 && n == 1 ? 0 : n % 1 == 0 && n >= 2 && n <= 4 ? 1 : n % 1 != 0 ? 2: 3)","plural_rules":{"one":"n is 1","many":"n is decimal","few":"n in 2..4","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:sk"}},{"id":"l:skr","type":"languages","attributes":{"code":"skr","name":"Saraiki","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:skr"}},{"id":"l:sk_SK","type":"languages","attributes":{"code":"sk_SK","name":"Slovak (Slovakia)","rtl":false,"plural_equation":"(n % 1 == 0 && n == 1 ? 0 : n % 1 == 0 && n >= 2 && n <= 4 ? 1 : n % 1 != 0 ? 2: 3)","plural_rules":{"one":"n is 1","many":"n is decimal","few":"n in 2..4","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:sk_SK"}},{"id":"l:sl","type":"languages","attributes":{"code":"sl","name":"Slovenian","rtl":false,"plural_equation":"(n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || n%100==4 ? 2 : 3)","plural_rules":{"one":"n mod 100 is 1","two":"n mod 100 is 2","few":"n mod 100 in 3..4","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:sl"}},{"id":"l:sl_SI","type":"languages","attributes":{"code":"sl_SI","name":"Slovenian (Slovenia)","rtl":false,"plural_equation":"(n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || n%100==4 ? 2 : 3)","plural_rules":{"one":"n mod 100 is 1","two":"n mod 100 is 2","few":"n mod 100 in 3..4","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:sl_SI"}},{"id":"l:sm","type":"languages","attributes":{"code":"sm","name":"Samoan","rtl":false,"plural_equation":"0","plural_rules":{"other":"everything"}},"links":{"self":"https://rest.api.transifex.com/languages/l:sm"}},{"id":"l:sma","type":"languages","attributes":{"code":"sma","name":"Southern Sami","rtl":false,"plural_equation":"(n==1 ? 0 : n==2 ? 1 : 2)","plural_rules":{"one":"n is 1","two":"n is 2","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:sma"}},{"id":"l:sn","type":"languages","attributes":{"code":"sn","name":"Shona","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:sn"}},{"id":"l:so","type":"languages","attributes":{"code":"so","name":"Somali","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:so"}},{"id":"l:son","type":"languages","attributes":{"code":"son","name":"Songhay","rtl":false,"plural_equation":"0","plural_rules":{"other":"everything"}},"links":{"self":"https://rest.api.transifex.com/languages/l:son"}},{"id":"l:sq","type":"languages","attributes":{"code":"sq","name":"Albanian","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:sq"}},{"id":"l:sq_AL","type":"languages","attributes":{"code":"sq_AL","name":"Albanian (Albania)","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:sq_AL"}},{"id":"l:sr","type":"languages","attributes":{"code":"sr","name":"Serbian","rtl":false,"plural_equation":"(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2)","plural_rules":{"one":"n mod 10 is 1 and n mod 100 is not 11","few":"n mod 10 in 2..4 and n mod 100 not in 12..14","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:sr"}},{"id":"l:sr_BA@latin","type":"languages","attributes":{"code":"sr_BA@latin","name":"Serbian (Latin) (Bosnia and Herzegovina)","rtl":false,"plural_equation":"(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2)","plural_rules":{"one":"n mod 10 is 1 and n mod 100 is not 11","few":"n mod 10 in 2..4 and n mod 100 not in 12..14","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:sr_BA@latin"}},{"id":"l:sr_BA-SRP","type":"languages","attributes":{"code":"sr_BA-SRP","name":"Serbian (Republika Srpska)","rtl":false,"plural_equation":"(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2)","plural_rules":{"one":"n mod 10 is 1 and n mod 100 is not 11","few":"n mod 10 in 2..4 and n mod 100 not in 12..14","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:sr_BA-SRP"}},{"id":"l:sr@Cyrl","type":"languages","attributes":{"code":"sr@Cyrl","name":"Serbian (Cyrillic)","rtl":false,"plural_equation":"(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2)","plural_rules":{"one":"n mod 10 is 1 and n mod 100 is not 11","few":"n mod 10 in 2..4 and n mod 100 not in 12..14","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:sr@Cyrl"}},{"id":"l:sr@Ijekavian","type":"languages","attributes":{"code":"sr@Ijekavian","name":"Serbian (Ijekavian)","rtl":false,"plural_equation":"(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2)","plural_rules":{"one":"n mod 10 is 1 and n mod 100 is not 11","few":"n mod 10 in 2..4 and n mod 100 not in 12..14","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:sr@Ijekavian"}},{"id":"l:sr@ijekavianlatin","type":"languages","attributes":{"code":"sr@ijekavianlatin","name":"Serbian (Ijekavian Latin)","rtl":false,"plural_equation":"(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2)","plural_rules":{"one":"n mod 10 is 1 and n mod 100 is not 11","few":"n mod 10 in 2..4 and n mod 100 not in 12..14","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:sr@ijekavianlatin"}},{"id":"l:sr@latin","type":"languages","attributes":{"code":"sr@latin","name":"Serbian (Latin)","rtl":false,"plural_equation":"(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2)","plural_rules":{"one":"n mod 10 is 1 and n mod 100 is not 11","few":"n mod 10 in 2..4 and n mod 100 not in 12..14","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:sr@latin"}},{"id":"l:sr_ME","type":"languages","attributes":{"code":"sr_ME","name":"Serbian (Montenegro)","rtl":false,"plural_equation":"(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2)","plural_rules":{"one":"n mod 10 is 1 and n mod 100 is not 11","few":"n mod 10 in 2..4 and n mod 100 not in 12..14","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:sr_ME"}},{"id":"l:sr_ME@latin","type":"languages","attributes":{"code":"sr_ME@latin","name":"Serbian (Latin) (Montenegro)","rtl":false,"plural_equation":"(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2)","plural_rules":{"one":"n mod 10 is 1 and n mod 100 is not 11","few":"n mod 10 in 2..4 and n mod 100 not in 12..14","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:sr_ME@latin"}},{"id":"l:sr_RS","type":"languages","attributes":{"code":"sr_RS","name":"Serbian (Serbia)","rtl":false,"plural_equation":"(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2)","plural_rules":{"one":"n mod 10 is 1 and n mod 100 is not 11","few":"n mod 10 in 2..4 and n mod 100 not in 12..14","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:sr_RS"}},{"id":"l:sr_RS@latin","type":"languages","attributes":{"code":"sr_RS@latin","name":"Serbian (Latin) (Serbia)","rtl":false,"plural_equation":"(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2)","plural_rules":{"one":"n mod 10 is 1 and n mod 100 is not 11","few":"n mod 10 in 2..4 and n mod 100 not in 12..14","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:sr_RS@latin"}},{"id":"l:ss","type":"languages","attributes":{"code":"ss","name":"Swati","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:ss"}},{"id":"l:st","type":"languages","attributes":{"code":"st","name":"Sotho, Southern","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:st"}},{"id":"l:st_ZA","type":"languages","attributes":{"code":"st_ZA","name":"Sotho, Southern (South Africa)","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:st_ZA"}},{"id":"l:su","type":"languages","attributes":{"code":"su","name":"Sundanese","rtl":false,"plural_equation":"0","plural_rules":{"other":"everything"}},"links":{"self":"https://rest.api.transifex.com/languages/l:su"}},{"id":"l:sv","type":"languages","attributes":{"code":"sv","name":"Swedish","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:sv"}},{"id":"l:sv_FI","type":"languages","attributes":{"code":"sv_FI","name":"Swedish (Finland)","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:sv_FI"}},{"id":"l:sv_SE","type":"languages","attributes":{"code":"sv_SE","name":"Swedish (Sweden)","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:sv_SE"}},{"id":"l:sw","type":"languages","attributes":{"code":"sw","name":"Swahili","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:sw"}},{"id":"l:sw_CD","type":"languages","attributes":{"code":"sw_CD","name":"Swahili (Democratic Republic of the Congo)","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:sw_CD"}},{"id":"l:swg","type":"languages","attributes":{"code":"swg","name":"Swabian","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:swg"}},{"id":"l:sw_KE","type":"languages","attributes":{"code":"sw_KE","name":"Swahili (Kenya)","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:sw_KE"}},{"id":"l:sw_TZ","type":"languages","attributes":{"code":"sw_TZ","name":"Swahili (Tanzania)","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:sw_TZ"}},{"id":"l:sw_UG","type":"languages","attributes":{"code":"sw_UG","name":"Swahili (Uganda)","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:sw_UG"}},{"id":"l:szl","type":"languages","attributes":{"code":"szl","name":"Silesian","rtl":false,"plural_equation":"(n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2)","plural_rules":{"one":"n is 1","few":"n mod 10 in 2..4 and n mod 100 not in 12..14","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:szl"}},{"id":"l:ta","type":"languages","attributes":{"code":"ta","name":"Tamil","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:ta"}},{"id":"l:ta_IN","type":"languages","attributes":{"code":"ta_IN","name":"Tamil (India)","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:ta_IN"}},{"id":"l:ta_LK","type":"languages","attributes":{"code":"ta_LK","name":"Tamil (Sri-Lanka)","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:ta_LK"}},{"id":"l:te","type":"languages","attributes":{"code":"te","name":"Telugu","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:te"}},{"id":"l:te_IN","type":"languages","attributes":{"code":"te_IN","name":"Telugu (India)","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:te_IN"}},{"id":"l:tet","type":"languages","attributes":{"code":"tet","name":"Tetum (Tetun)","rtl":false,"plural_equation":"0","plural_rules":{"other":"everything"}},"links":{"self":"https://rest.api.transifex.com/languages/l:tet"}},{"id":"l:tg","type":"languages","attributes":{"code":"tg","name":"Tajik","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:tg"}},{"id":"l:tg_TJ","type":"languages","attributes":{"code":"tg_TJ","name":"Tajik (Tajikistan)","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:tg_TJ"}},{"id":"l:th","type":"languages","attributes":{"code":"th","name":"Thai","rtl":false,"plural_equation":"0","plural_rules":{"other":"everything"}},"links":{"self":"https://rest.api.transifex.com/languages/l:th"}},{"id":"l:th_TH","type":"languages","attributes":{"code":"th_TH","name":"Thai (Thailand)","rtl":false,"plural_equation":"0","plural_rules":{"other":"everything"}},"links":{"self":"https://rest.api.transifex.com/languages/l:th_TH"}},{"id":"l:ti","type":"languages","attributes":{"code":"ti","name":"Tigrinya","rtl":false,"plural_equation":"(n > 1)","plural_rules":{"one":"n in 0..1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:ti"}},{"id":"l:tk","type":"languages","attributes":{"code":"tk","name":"Turkmen","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:tk"}},{"id":"l:tk_TM","type":"languages","attributes":{"code":"tk_TM","name":"Turkmen (Turkmenistan)","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:tk_TM"}},{"id":"l:tl","type":"languages","attributes":{"code":"tl","name":"Tagalog","rtl":false,"plural_equation":"(n > 1)","plural_rules":{"one":"n in 0..1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:tl"}},{"id":"l:tlh","type":"languages","attributes":{"code":"tlh","name":"Klingon","rtl":false,"plural_equation":"(n > 1)","plural_rules":{"one":"n in 0..1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:tlh"}},{"id":"l:tl_PH","type":"languages","attributes":{"code":"tl_PH","name":"Tagalog (Philippines)","rtl":false,"plural_equation":"(n > 1)","plural_rules":{"one":"n in 0..1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:tl_PH"}},{"id":"l:tn","type":"languages","attributes":{"code":"tn","name":"Tswana","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:tn"}},{"id":"l:to","type":"languages","attributes":{"code":"to","name":"Tongan","rtl":false,"plural_equation":"0","plural_rules":{"other":"everything"}},"links":{"self":"https://rest.api.transifex.com/languages/l:to"}},{"id":"l:tok","type":"languages","attributes":{"code":"tok","name":"Toki Pona","rtl":false,"plural_equation":"0","plural_rules":{"other":"everything"}},"links":{"self":"https://rest.api.transifex.com/languages/l:tok"}},{"id":"l:tpi","type":"languages","attributes":{"code":"tpi","name":"Tok Pisin","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:tpi"}},{"id":"l:tr","type":"languages","attributes":{"code":"tr","name":"Turkish","rtl":false,"plural_equation":"(n > 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:tr"}},{"id":"l:tr_CY","type":"languages","attributes":{"code":"tr_CY","name":"Turkish (Cyprus)","rtl":false,"plural_equation":"(n > 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:tr_CY"}},{"id":"l:tr_DE","type":"languages","attributes":{"code":"tr_DE","name":"Turkish (Germany)","rtl":false,"plural_equation":"(n > 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:tr_DE"}},{"id":"l:tr_TR","type":"languages","attributes":{"code":"tr_TR","name":"Turkish (Turkey)","rtl":false,"plural_equation":"(n > 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:tr_TR"}},{"id":"l:ts","type":"languages","attributes":{"code":"ts","name":"Tsonga","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:ts"}},{"id":"l:tsi","type":"languages","attributes":{"code":"tsi","name":"Tsimshian","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:tsi"}},{"id":"l:tt","type":"languages","attributes":{"code":"tt","name":"Tatar","rtl":false,"plural_equation":"0","plural_rules":{"other":"everything"}},"links":{"self":"https://rest.api.transifex.com/languages/l:tt"}},{"id":"l:tum","type":"languages","attributes":{"code":"tum","name":"Tumbuka","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:tum"}},{"id":"l:tuv","type":"languages","attributes":{"code":"tuv","name":"Turkana","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:tuv"}},{"id":"l:twd","type":"languages","attributes":{"code":"twd","name":"Tweants","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:twd"}},{"id":"l:tzj","type":"languages","attributes":{"code":"tzj","name":"Tz’utujil","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:tzj"}},{"id":"l:tzl","type":"languages","attributes":{"code":"tzl","name":"Talossan","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:tzl"}},{"id":"l:tzm","type":"languages","attributes":{"code":"tzm","name":"Central Atlas Tamazight","rtl":false,"plural_equation":"(n == 0 || n == 1 || (n > 10 && n < 100) ? 0 : 1","plural_rules":{"one":"n in 0..1 or n in 11..99","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:tzm"}},{"id":"l:udm","type":"languages","attributes":{"code":"udm","name":"Udmurt","rtl":false,"plural_equation":"0","plural_rules":{"other":"everything"}},"links":{"self":"https://rest.api.transifex.com/languages/l:udm"}},{"id":"l:ug","type":"languages","attributes":{"code":"ug","name":"Uyghur","rtl":true,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:ug"}},{"id":"l:ug@Arab","type":"languages","attributes":{"code":"ug@Arab","name":"Uighur (Arabic)","rtl":true,"plural_equation":"0","plural_rules":{"other":"everything"}},"links":{"self":"https://rest.api.transifex.com/languages/l:ug@Arab"}},{"id":"l:ug@Cyrl","type":"languages","attributes":{"code":"ug@Cyrl","name":"Uighur (Cyrillic)","rtl":false,"plural_equation":"0","plural_rules":{"other":"everything"}},"links":{"self":"https://rest.api.transifex.com/languages/l:ug@Cyrl"}},{"id":"l:ug@Latin","type":"languages","attributes":{"code":"ug@Latin","name":"Uighur (Latin)","rtl":false,"plural_equation":"0","plural_rules":{"other":"everything"}},"links":{"self":"https://rest.api.transifex.com/languages/l:ug@Latin"}},{"id":"l:uk","type":"languages","attributes":{"code":"uk","name":"Ukrainian","rtl":false,"plural_equation":"(n % 1 == 0 && n % 10 == 1 && n % 100 != 11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % 100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || (n % 100 >=11 && n % 100 <=14 )) ? 2: 3)","plural_rules":{"one":"n mod 1 is 0 and n mod 10 is 1 and n mod 100 is not 11","many":"n mod 1 is 0 and (n mod 10 is 0 or n mod 10 in 5..9 or n mod 100 in 11..14)","few":"n mod 1 is 0 and n mod 10 in 2..4 and n mod 100 not in 12..14","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:uk"}},{"id":"l:uk_UA","type":"languages","attributes":{"code":"uk_UA","name":"Ukrainian (Ukraine)","rtl":false,"plural_equation":"(n % 1 == 0 && n % 10 == 1 && n % 100 != 11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % 100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || (n % 100 >=11 && n % 100 <=14 )) ? 2: 3)","plural_rules":{"one":"n mod 1 is 0 and n mod 10 is 1 and n mod 100 is not 11","many":"n mod 1 is 0 and (n mod 10 is 0 or n mod 10 in 5..9 or n mod 100 in 11..14)","few":"n mod 1 is 0 and n mod 10 in 2..4 and n mod 100 not in 12..14","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:uk_UA"}},{"id":"l:ur","type":"languages","attributes":{"code":"ur","name":"Urdu","rtl":true,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:ur"}},{"id":"l:ur_PK","type":"languages","attributes":{"code":"ur_PK","name":"Urdu (Pakistan)","rtl":true,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:ur_PK"}},{"id":"l:uz","type":"languages","attributes":{"code":"uz","name":"Uzbek","rtl":false,"plural_equation":"0","plural_rules":{"other":"everything"}},"links":{"self":"https://rest.api.transifex.com/languages/l:uz"}},{"id":"l:uz@Arab","type":"languages","attributes":{"code":"uz@Arab","name":"Uzbek (Arabic)","rtl":false,"plural_equation":"0","plural_rules":{"other":"everything"}},"links":{"self":"https://rest.api.transifex.com/languages/l:uz@Arab"}},{"id":"l:uz@Cyrl","type":"languages","attributes":{"code":"uz@Cyrl","name":"Uzbek (Cyrillic)","rtl":false,"plural_equation":"0","plural_rules":{"other":"everything"}},"links":{"self":"https://rest.api.transifex.com/languages/l:uz@Cyrl"}},{"id":"l:uz@Latn","type":"languages","attributes":{"code":"uz@Latn","name":"Uzbek (Latin)","rtl":false,"plural_equation":"0","plural_rules":{"other":"everything"}},"links":{"self":"https://rest.api.transifex.com/languages/l:uz@Latn"}},{"id":"l:uz_UZ","type":"languages","attributes":{"code":"uz_UZ","name":"Uzbek (Uzbekistan)","rtl":false,"plural_equation":"0","plural_rules":{"other":"everything"}},"links":{"self":"https://rest.api.transifex.com/languages/l:uz_UZ"}},{"id":"l:ve","type":"languages","attributes":{"code":"ve","name":"Venda","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:ve"}},{"id":"l:vec","type":"languages","attributes":{"code":"vec","name":"Venetian","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:vec"}},{"id":"l:vep","type":"languages","attributes":{"code":"vep","name":"Vepsian","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:vep"}},{"id":"l:vi","type":"languages","attributes":{"code":"vi","name":"Vietnamese","rtl":false,"plural_equation":"0","plural_rules":{"other":"everything"}},"links":{"self":"https://rest.api.transifex.com/languages/l:vi"}},{"id":"l:vi_VN","type":"languages","attributes":{"code":"vi_VN","name":"Vietnamese (Viet Nam)","rtl":false,"plural_equation":"0","plural_rules":{"other":"everything"}},"links":{"self":"https://rest.api.transifex.com/languages/l:vi_VN"}},{"id":"l:vls","type":"languages","attributes":{"code":"vls","name":"Vlaams","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:vls"}},{"id":"l:vmf","type":"languages","attributes":{"code":"vmf","name":"Upper Franconian","rtl":false,"plural_equation":"n==0 ? 0 : n==1 ? 1 : 2","plural_rules":{"zero":"n is 0","one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:vmf"}},{"id":"l:vo","type":"languages","attributes":{"code":"vo","name":"Volapük","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:vo"}},{"id":"l:wa","type":"languages","attributes":{"code":"wa","name":"Walloon","rtl":false,"plural_equation":"(n > 1)","plural_rules":{"one":"n in 0..1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:wa"}},{"id":"l:war","type":"languages","attributes":{"code":"war","name":"Wáray-Wáray","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:war"}},{"id":"l:wo","type":"languages","attributes":{"code":"wo","name":"Wolof","rtl":false,"plural_equation":"0","plural_rules":{"other":"everything"}},"links":{"self":"https://rest.api.transifex.com/languages/l:wo"}},{"id":"l:wo_SN","type":"languages","attributes":{"code":"wo_SN","name":"Wolof (Senegal)","rtl":false,"plural_equation":"0","plural_rules":{"other":"everything"}},"links":{"self":"https://rest.api.transifex.com/languages/l:wo_SN"}},{"id":"l:wuu","type":"languages","attributes":{"code":"wuu","name":"Chinese (Wu)","rtl":false,"plural_equation":"0","plural_rules":{"other":"everything"}},"links":{"self":"https://rest.api.transifex.com/languages/l:wuu"}},{"id":"l:wuu-Hans","type":"languages","attributes":{"code":"wuu-Hans","name":"Chinese Simplified (Wu)","rtl":false,"plural_equation":"0","plural_rules":{"other":"everything"}},"links":{"self":"https://rest.api.transifex.com/languages/l:wuu-Hans"}},{"id":"l:wuu-Hant","type":"languages","attributes":{"code":"wuu-Hant","name":"Chinese Traditional (Wu)","rtl":false,"plural_equation":"0","plural_rules":{"other":"everything"}},"links":{"self":"https://rest.api.transifex.com/languages/l:wuu-Hant"}},{"id":"l:xcl","type":"languages","attributes":{"code":"xcl","name":"Classical Armenian","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:xcl"}},{"id":"l:xh","type":"languages","attributes":{"code":"xh","name":"Xhosa","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:xh"}},{"id":"l:yi","type":"languages","attributes":{"code":"yi","name":"Yiddish","rtl":true,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:yi"}},{"id":"l:yo","type":"languages","attributes":{"code":"yo","name":"Yoruba","rtl":false,"plural_equation":"0","plural_rules":{"other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:yo"}},{"id":"l:yue","type":"languages","attributes":{"code":"yue","name":"Cantonese","rtl":false,"plural_equation":"0","plural_rules":{"other":"everything"}},"links":{"self":"https://rest.api.transifex.com/languages/l:yue"}},{"id":"l:yue_CN","type":"languages","attributes":{"code":"yue_CN","name":"Cantonese (China)","rtl":false,"plural_equation":"0","plural_rules":{"other":"everything"}},"links":{"self":"https://rest.api.transifex.com/languages/l:yue_CN"}},{"id":"l:zgh","type":"languages","attributes":{"code":"zgh","name":"Standard Moroccan Tamazight","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:zgh"}},{"id":"l:zh","type":"languages","attributes":{"code":"zh","name":"Chinese","rtl":false,"plural_equation":"0","plural_rules":{"other":"everything"}},"links":{"self":"https://rest.api.transifex.com/languages/l:zh"}},{"id":"l:zh_CN","type":"languages","attributes":{"code":"zh_CN","name":"Chinese (China)","rtl":false,"plural_equation":"0","plural_rules":{"other":"everything"}},"links":{"self":"https://rest.api.transifex.com/languages/l:zh_CN"}},{"id":"l:zh_CN.GB2312","type":"languages","attributes":{"code":"zh_CN.GB2312","name":"Chinese (China) (GB2312)","rtl":false,"plural_equation":"0","plural_rules":{"other":"everything"}},"links":{"self":"https://rest.api.transifex.com/languages/l:zh_CN.GB2312"}},{"id":"l:zh-Hans","type":"languages","attributes":{"code":"zh-Hans","name":"Chinese Simplified","rtl":false,"plural_equation":"0","plural_rules":{"other":"everything"}},"links":{"self":"https://rest.api.transifex.com/languages/l:zh-Hans"}},{"id":"l:zh-Hant","type":"languages","attributes":{"code":"zh-Hant","name":"Chinese Traditional","rtl":false,"plural_equation":"0","plural_rules":{"other":"everything"}},"links":{"self":"https://rest.api.transifex.com/languages/l:zh-Hant"}},{"id":"l:zh_HK","type":"languages","attributes":{"code":"zh_HK","name":"Chinese (Hong Kong)","rtl":false,"plural_equation":"0","plural_rules":{"other":"everything"}},"links":{"self":"https://rest.api.transifex.com/languages/l:zh_HK"}},{"id":"l:zh_SG","type":"languages","attributes":{"code":"zh_SG","name":"Chinese (Singapore)","rtl":false,"plural_equation":"0","plural_rules":{"other":"everything"}},"links":{"self":"https://rest.api.transifex.com/languages/l:zh_SG"}},{"id":"l:zh_TW","type":"languages","attributes":{"code":"zh_TW","name":"Chinese (Taiwan)","rtl":false,"plural_equation":"0","plural_rules":{"other":"everything"}},"links":{"self":"https://rest.api.transifex.com/languages/l:zh_TW"}},{"id":"l:zh_TW.Big5","type":"languages","attributes":{"code":"zh_TW.Big5","name":"Chinese (Taiwan) (Big5) ","rtl":false,"plural_equation":"0","plural_rules":{"other":"everything"}},"links":{"self":"https://rest.api.transifex.com/languages/l:zh_TW.Big5"}},{"id":"l:zu","type":"languages","attributes":{"code":"zu","name":"Zulu","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:zu"}},{"id":"l:zu_ZA","type":"languages","attributes":{"code":"zu_ZA","name":"Zulu (South Africa)","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:zu_ZA"}},{"id":"l:zza","type":"languages","attributes":{"code":"zza","name":"Zaza","rtl":false,"plural_equation":"(n != 1)","plural_rules":{"one":"n is 1","other":"everything else"}},"links":{"self":"https://rest.api.transifex.com/languages/l:zza"}}]}')
- }
- }
- ]);
- https://c.disquscdn.com/next/publisher-admin/js/3.0db1cfd53e3db2eac5e9.js