@mjhls/mjh-framework 1.0.178 → 1.0.180
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.es.js +1465 -1227
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +1464 -1226
- package/dist/index.js.map +1 -1
- package/package.json +3 -2
package/dist/index.es.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React__default, { Component, useState, useEffect, useRef,
|
|
1
|
+
import React__default, { Component, useState, useEffect, useRef, createElement, createContext } from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import reactDom from 'react-dom';
|
|
4
4
|
import Container from 'react-bootstrap/Container';
|
|
@@ -9743,533 +9743,1029 @@ var main_47 = main.osName;
|
|
|
9743
9743
|
var main_48 = main.osVersion;
|
|
9744
9744
|
var main_49 = main.withOrientationChange;
|
|
9745
9745
|
|
|
9746
|
-
var
|
|
9747
|
-
if (!(instance instanceof Constructor)) {
|
|
9748
|
-
throw new TypeError("Cannot call a class as a function");
|
|
9749
|
-
}
|
|
9750
|
-
};
|
|
9746
|
+
var striptags = createCommonjsModule(function (module) {
|
|
9751
9747
|
|
|
9752
|
-
|
|
9753
|
-
|
|
9754
|
-
|
|
9755
|
-
|
|
9756
|
-
|
|
9757
|
-
|
|
9758
|
-
|
|
9759
|
-
|
|
9748
|
+
(function (global) {
|
|
9749
|
+
|
|
9750
|
+
// minimal symbol polyfill for IE11 and others
|
|
9751
|
+
if (typeof Symbol !== 'function') {
|
|
9752
|
+
var Symbol = function(name) {
|
|
9753
|
+
return name;
|
|
9754
|
+
};
|
|
9755
|
+
|
|
9756
|
+
Symbol.nonNative = true;
|
|
9760
9757
|
}
|
|
9761
|
-
}
|
|
9762
9758
|
|
|
9763
|
-
|
|
9764
|
-
|
|
9765
|
-
|
|
9766
|
-
return Constructor;
|
|
9767
|
-
};
|
|
9768
|
-
}();
|
|
9759
|
+
const STATE_PLAINTEXT = Symbol('plaintext');
|
|
9760
|
+
const STATE_HTML = Symbol('html');
|
|
9761
|
+
const STATE_COMMENT = Symbol('comment');
|
|
9769
9762
|
|
|
9770
|
-
|
|
9771
|
-
|
|
9772
|
-
var source = arguments[i];
|
|
9763
|
+
const ALLOWED_TAGS_REGEX = /<(\w*)>/g;
|
|
9764
|
+
const NORMALIZE_TAG_REGEX = /<\/?([^\s\/>]+)/;
|
|
9773
9765
|
|
|
9774
|
-
|
|
9775
|
-
|
|
9776
|
-
|
|
9777
|
-
|
|
9766
|
+
function striptags(html, allowable_tags, tag_replacement) {
|
|
9767
|
+
html = html || '';
|
|
9768
|
+
allowable_tags = allowable_tags || [];
|
|
9769
|
+
tag_replacement = tag_replacement || '';
|
|
9770
|
+
|
|
9771
|
+
let context = init_context(allowable_tags, tag_replacement);
|
|
9772
|
+
|
|
9773
|
+
return striptags_internal(html, context);
|
|
9778
9774
|
}
|
|
9779
|
-
}
|
|
9780
9775
|
|
|
9781
|
-
|
|
9782
|
-
|
|
9776
|
+
function init_striptags_stream(allowable_tags, tag_replacement) {
|
|
9777
|
+
allowable_tags = allowable_tags || [];
|
|
9778
|
+
tag_replacement = tag_replacement || '';
|
|
9783
9779
|
|
|
9784
|
-
|
|
9785
|
-
if (typeof superClass !== "function" && superClass !== null) {
|
|
9786
|
-
throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
|
|
9787
|
-
}
|
|
9780
|
+
let context = init_context(allowable_tags, tag_replacement);
|
|
9788
9781
|
|
|
9789
|
-
|
|
9790
|
-
|
|
9791
|
-
|
|
9792
|
-
enumerable: false,
|
|
9793
|
-
writable: true,
|
|
9794
|
-
configurable: true
|
|
9782
|
+
return function striptags_stream(html) {
|
|
9783
|
+
return striptags_internal(html || '', context);
|
|
9784
|
+
};
|
|
9795
9785
|
}
|
|
9796
|
-
});
|
|
9797
|
-
if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
|
|
9798
|
-
};
|
|
9799
|
-
|
|
9800
|
-
var possibleConstructorReturn = function (self, call) {
|
|
9801
|
-
if (!self) {
|
|
9802
|
-
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
9803
|
-
}
|
|
9804
9786
|
|
|
9805
|
-
|
|
9806
|
-
};
|
|
9787
|
+
striptags.init_streaming_mode = init_striptags_stream;
|
|
9807
9788
|
|
|
9808
|
-
|
|
9809
|
-
|
|
9810
|
-
var _arr = [];
|
|
9811
|
-
var _n = true;
|
|
9812
|
-
var _d = false;
|
|
9813
|
-
var _e = undefined;
|
|
9789
|
+
function init_context(allowable_tags, tag_replacement) {
|
|
9790
|
+
allowable_tags = parse_allowable_tags(allowable_tags);
|
|
9814
9791
|
|
|
9815
|
-
|
|
9816
|
-
|
|
9817
|
-
|
|
9792
|
+
return {
|
|
9793
|
+
allowable_tags : allowable_tags,
|
|
9794
|
+
tag_replacement: tag_replacement,
|
|
9818
9795
|
|
|
9819
|
-
|
|
9820
|
-
|
|
9821
|
-
|
|
9822
|
-
|
|
9823
|
-
|
|
9824
|
-
} finally {
|
|
9825
|
-
try {
|
|
9826
|
-
if (!_n && _i["return"]) _i["return"]();
|
|
9827
|
-
} finally {
|
|
9828
|
-
if (_d) throw _e;
|
|
9829
|
-
}
|
|
9796
|
+
state : STATE_PLAINTEXT,
|
|
9797
|
+
tag_buffer : '',
|
|
9798
|
+
depth : 0,
|
|
9799
|
+
in_quote_char : ''
|
|
9800
|
+
};
|
|
9830
9801
|
}
|
|
9831
9802
|
|
|
9832
|
-
|
|
9833
|
-
|
|
9803
|
+
function striptags_internal(html, context) {
|
|
9804
|
+
let allowable_tags = context.allowable_tags;
|
|
9805
|
+
let tag_replacement = context.tag_replacement;
|
|
9834
9806
|
|
|
9835
|
-
|
|
9836
|
-
|
|
9837
|
-
|
|
9838
|
-
|
|
9839
|
-
|
|
9840
|
-
} else {
|
|
9841
|
-
throw new TypeError("Invalid attempt to destructure non-iterable instance");
|
|
9842
|
-
}
|
|
9843
|
-
};
|
|
9844
|
-
}();
|
|
9807
|
+
let state = context.state;
|
|
9808
|
+
let tag_buffer = context.tag_buffer;
|
|
9809
|
+
let depth = context.depth;
|
|
9810
|
+
let in_quote_char = context.in_quote_char;
|
|
9811
|
+
let output = '';
|
|
9845
9812
|
|
|
9846
|
-
|
|
9847
|
-
|
|
9848
|
-
for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) arr2[i] = arr[i];
|
|
9813
|
+
for (let idx = 0, length = html.length; idx < length; idx++) {
|
|
9814
|
+
let char = html[idx];
|
|
9849
9815
|
|
|
9850
|
-
|
|
9851
|
-
|
|
9852
|
-
|
|
9853
|
-
|
|
9854
|
-
|
|
9816
|
+
if (state === STATE_PLAINTEXT) {
|
|
9817
|
+
switch (char) {
|
|
9818
|
+
case '<':
|
|
9819
|
+
state = STATE_HTML;
|
|
9820
|
+
tag_buffer += char;
|
|
9821
|
+
break;
|
|
9855
9822
|
|
|
9856
|
-
|
|
9857
|
-
|
|
9823
|
+
default:
|
|
9824
|
+
output += char;
|
|
9825
|
+
break;
|
|
9826
|
+
}
|
|
9827
|
+
}
|
|
9858
9828
|
|
|
9859
|
-
|
|
9860
|
-
|
|
9829
|
+
else if (state === STATE_HTML) {
|
|
9830
|
+
switch (char) {
|
|
9831
|
+
case '<':
|
|
9832
|
+
// ignore '<' if inside a quote
|
|
9833
|
+
if (in_quote_char) {
|
|
9834
|
+
break;
|
|
9835
|
+
}
|
|
9861
9836
|
|
|
9862
|
-
|
|
9837
|
+
// we're seeing a nested '<'
|
|
9838
|
+
depth++;
|
|
9839
|
+
break;
|
|
9863
9840
|
|
|
9864
|
-
|
|
9841
|
+
case '>':
|
|
9842
|
+
// ignore '>' if inside a quote
|
|
9843
|
+
if (in_quote_char) {
|
|
9844
|
+
break;
|
|
9845
|
+
}
|
|
9865
9846
|
|
|
9866
|
-
|
|
9867
|
-
|
|
9868
|
-
|
|
9847
|
+
// something like this is happening: '<<>>'
|
|
9848
|
+
if (depth) {
|
|
9849
|
+
depth--;
|
|
9869
9850
|
|
|
9870
|
-
|
|
9871
|
-
|
|
9872
|
-
dataKeptToCompareNewDatarecord: _this.data,
|
|
9873
|
-
per: _this.params ? _this.params.to : 2,
|
|
9874
|
-
page: _this.props.currentPage || 1,
|
|
9875
|
-
from: _this.params ? _this.params.from : 0,
|
|
9876
|
-
to: _this.params ? _this.params.to : 2,
|
|
9877
|
-
total_pages: null,
|
|
9878
|
-
scrolling: true,
|
|
9879
|
-
query: _this.query,
|
|
9880
|
-
currentPage: _this.props.currentPage || 1
|
|
9881
|
-
}, _this.loadMore = debounce_1(function () {
|
|
9882
|
-
_this.setState(function (state) {
|
|
9883
|
-
var page = state.page,
|
|
9884
|
-
from = state.from,
|
|
9885
|
-
per = state.per,
|
|
9886
|
-
to = state.to;
|
|
9851
|
+
break;
|
|
9852
|
+
}
|
|
9887
9853
|
|
|
9888
|
-
|
|
9889
|
-
|
|
9890
|
-
|
|
9891
|
-
|
|
9892
|
-
};
|
|
9893
|
-
}, _this.loadData);
|
|
9894
|
-
}, 0), _this.loadData = function () {
|
|
9895
|
-
var _this$state = _this.state,
|
|
9896
|
-
from = _this$state.from,
|
|
9897
|
-
to = _this$state.to,
|
|
9898
|
-
data = _this$state.data,
|
|
9899
|
-
query = _this$state.query,
|
|
9900
|
-
page = _this$state.page;
|
|
9901
|
-
var client = _this.props.client;
|
|
9854
|
+
// this is closing the tag in tag_buffer
|
|
9855
|
+
in_quote_char = '';
|
|
9856
|
+
state = STATE_PLAINTEXT;
|
|
9857
|
+
tag_buffer += '>';
|
|
9902
9858
|
|
|
9859
|
+
if (allowable_tags.has(normalize_tag(tag_buffer))) {
|
|
9860
|
+
output += tag_buffer;
|
|
9861
|
+
} else {
|
|
9862
|
+
output += tag_replacement;
|
|
9863
|
+
}
|
|
9903
9864
|
|
|
9904
|
-
|
|
9905
|
-
|
|
9906
|
-
// const query = '*[_type == "article" && defined(title) && defined(thumbnail)][$from...$to] { title, summary, thumbnail { asset-> }, url }'
|
|
9907
|
-
});client.fetch(query, params).then(function (dataArr) {
|
|
9908
|
-
if (_this.pointer && _this.pointerArray) {
|
|
9909
|
-
var pointer = _this.pointer;
|
|
9910
|
-
dataArr = dataArr[_this.pointerArray][pointer];
|
|
9911
|
-
}
|
|
9912
|
-
dataArr = dataArr.map(function (item) {
|
|
9913
|
-
return _extends({}, item, {
|
|
9914
|
-
pageNumber: page
|
|
9915
|
-
});
|
|
9916
|
-
});
|
|
9865
|
+
tag_buffer = '';
|
|
9866
|
+
break;
|
|
9917
9867
|
|
|
9918
|
-
|
|
9919
|
-
|
|
9920
|
-
|
|
9921
|
-
data: [].concat(toConsumableArray(data), toConsumableArray(dataArr)),
|
|
9922
|
-
scrolling: true
|
|
9923
|
-
};
|
|
9924
|
-
} else {
|
|
9925
|
-
return {
|
|
9926
|
-
scrolling: false
|
|
9927
|
-
};
|
|
9928
|
-
}
|
|
9929
|
-
});
|
|
9930
|
-
});
|
|
9931
|
-
}, _this.urlFor = function (source) {
|
|
9932
|
-
var client = _this.props.client;
|
|
9868
|
+
case '"':
|
|
9869
|
+
case '\'':
|
|
9870
|
+
// catch both single and double quotes
|
|
9933
9871
|
|
|
9934
|
-
|
|
9935
|
-
|
|
9936
|
-
|
|
9937
|
-
|
|
9938
|
-
|
|
9939
|
-
if (_this.props.imageHeight) url = url.height(_this.props.imageHeight);
|
|
9940
|
-
if (_this.props.imageWidth) url = url.width(_this.props.imageWidth);
|
|
9941
|
-
return url.url();
|
|
9942
|
-
} else {
|
|
9943
|
-
return _this.defaultImage;
|
|
9944
|
-
}
|
|
9945
|
-
}, _this.changePageNumber = function (pageNumber) {
|
|
9946
|
-
var _this$props = _this.props,
|
|
9947
|
-
seoPaginate = _this$props.seoPaginate,
|
|
9948
|
-
pageview = _this$props.pageview,
|
|
9949
|
-
router = _this$props.router;
|
|
9950
|
-
var currentPage = _this.state.currentPage;
|
|
9872
|
+
if (char === in_quote_char) {
|
|
9873
|
+
in_quote_char = '';
|
|
9874
|
+
} else {
|
|
9875
|
+
in_quote_char = in_quote_char || char;
|
|
9876
|
+
}
|
|
9951
9877
|
|
|
9952
|
-
|
|
9953
|
-
|
|
9954
|
-
var qrIndex = path.indexOf('?');
|
|
9955
|
-
var pathname = router.pathname;
|
|
9956
|
-
var queryString = '';
|
|
9878
|
+
tag_buffer += char;
|
|
9879
|
+
break;
|
|
9957
9880
|
|
|
9958
|
-
|
|
9959
|
-
|
|
9881
|
+
case '-':
|
|
9882
|
+
if (tag_buffer === '<!-') {
|
|
9883
|
+
state = STATE_COMMENT;
|
|
9884
|
+
}
|
|
9960
9885
|
|
|
9961
|
-
|
|
9962
|
-
|
|
9886
|
+
tag_buffer += char;
|
|
9887
|
+
break;
|
|
9963
9888
|
|
|
9964
|
-
|
|
9965
|
-
|
|
9966
|
-
|
|
9967
|
-
|
|
9968
|
-
|
|
9889
|
+
case ' ':
|
|
9890
|
+
case '\n':
|
|
9891
|
+
if (tag_buffer === '<') {
|
|
9892
|
+
state = STATE_PLAINTEXT;
|
|
9893
|
+
output += '< ';
|
|
9894
|
+
tag_buffer = '';
|
|
9969
9895
|
|
|
9970
|
-
|
|
9971
|
-
|
|
9896
|
+
break;
|
|
9897
|
+
}
|
|
9898
|
+
|
|
9899
|
+
tag_buffer += char;
|
|
9900
|
+
break;
|
|
9901
|
+
|
|
9902
|
+
default:
|
|
9903
|
+
tag_buffer += char;
|
|
9904
|
+
break;
|
|
9905
|
+
}
|
|
9972
9906
|
}
|
|
9973
|
-
});
|
|
9974
|
-
}
|
|
9975
9907
|
|
|
9976
|
-
|
|
9977
|
-
|
|
9908
|
+
else if (state === STATE_COMMENT) {
|
|
9909
|
+
switch (char) {
|
|
9910
|
+
case '>':
|
|
9911
|
+
if (tag_buffer.slice(-2) == '--') {
|
|
9912
|
+
// close the comment
|
|
9913
|
+
state = STATE_PLAINTEXT;
|
|
9914
|
+
}
|
|
9915
|
+
|
|
9916
|
+
tag_buffer = '';
|
|
9917
|
+
break;
|
|
9918
|
+
|
|
9919
|
+
default:
|
|
9920
|
+
tag_buffer += char;
|
|
9921
|
+
break;
|
|
9922
|
+
}
|
|
9923
|
+
}
|
|
9978
9924
|
}
|
|
9979
9925
|
|
|
9980
|
-
|
|
9926
|
+
// save the context for future iterations
|
|
9927
|
+
context.state = state;
|
|
9928
|
+
context.tag_buffer = tag_buffer;
|
|
9929
|
+
context.depth = depth;
|
|
9930
|
+
context.in_quote_char = in_quote_char;
|
|
9981
9931
|
|
|
9982
|
-
|
|
9983
|
-
|
|
9984
|
-
if (pageview) {
|
|
9985
|
-
_this.setState({
|
|
9986
|
-
currentPage: pageNumber
|
|
9987
|
-
}, function () {
|
|
9988
|
-
if (path[0] !== '/') {
|
|
9989
|
-
path = '/' + path;
|
|
9990
|
-
}
|
|
9932
|
+
return output;
|
|
9933
|
+
}
|
|
9991
9934
|
|
|
9992
|
-
|
|
9935
|
+
function parse_allowable_tags(allowable_tags) {
|
|
9936
|
+
let tag_set = new Set();
|
|
9993
9937
|
|
|
9994
|
-
|
|
9995
|
-
|
|
9996
|
-
currentPage: currentPage,
|
|
9997
|
-
pageNumber: pageNumber,
|
|
9998
|
-
pathname: pathname,
|
|
9999
|
-
path: path,
|
|
10000
|
-
newPath: newPath,
|
|
10001
|
-
firstPage: pageNumber === 1,
|
|
10002
|
-
queryString: queryString
|
|
10003
|
-
}) */
|
|
9938
|
+
if (typeof allowable_tags === 'string') {
|
|
9939
|
+
let match;
|
|
10004
9940
|
|
|
10005
|
-
|
|
9941
|
+
while ((match = ALLOWED_TAGS_REGEX.exec(allowable_tags))) {
|
|
9942
|
+
tag_set.add(match[1]);
|
|
9943
|
+
}
|
|
9944
|
+
}
|
|
10006
9945
|
|
|
10007
|
-
|
|
10008
|
-
|
|
10009
|
-
});
|
|
10010
|
-
});
|
|
10011
|
-
}
|
|
10012
|
-
}
|
|
10013
|
-
}
|
|
10014
|
-
}, _this.renderAuthor = function (authorDetail, index$$1, length) {
|
|
10015
|
-
if (authorDetail) {
|
|
10016
|
-
var _id = authorDetail._id,
|
|
10017
|
-
displayName = authorDetail.displayName,
|
|
10018
|
-
url = authorDetail.url;
|
|
9946
|
+
else if (!Symbol.nonNative &&
|
|
9947
|
+
typeof allowable_tags[Symbol.iterator] === 'function') {
|
|
10019
9948
|
|
|
10020
|
-
|
|
10021
|
-
return React__default.createElement(
|
|
10022
|
-
'div',
|
|
10023
|
-
{ key: _id },
|
|
10024
|
-
index$$1 === 0 && React__default.createElement(
|
|
10025
|
-
'span',
|
|
10026
|
-
{ className: 'pr-1' },
|
|
10027
|
-
'By'
|
|
10028
|
-
),
|
|
10029
|
-
React__default.createElement(
|
|
10030
|
-
Link,
|
|
10031
|
-
{ href: '/authors/[url]', as: '/authors/' + url.current },
|
|
10032
|
-
React__default.createElement(
|
|
10033
|
-
'a',
|
|
10034
|
-
{ className: 'text-muted' },
|
|
10035
|
-
displayName,
|
|
10036
|
-
length !== index$$1 + 1 && React__default.createElement('br', null)
|
|
10037
|
-
)
|
|
10038
|
-
)
|
|
10039
|
-
);
|
|
10040
|
-
} else if (displayName) {
|
|
10041
|
-
return React__default.createElement(
|
|
10042
|
-
'div',
|
|
10043
|
-
{ key: _id },
|
|
10044
|
-
index$$1 === 0 && React__default.createElement(
|
|
10045
|
-
'span',
|
|
10046
|
-
{ className: 'pr-1' },
|
|
10047
|
-
'By'
|
|
10048
|
-
),
|
|
10049
|
-
React__default.createElement(
|
|
10050
|
-
'span',
|
|
10051
|
-
{ className: 'text-muted' },
|
|
10052
|
-
displayName,
|
|
10053
|
-
length !== index$$1 + 1 && React__default.createElement('br', null)
|
|
10054
|
-
)
|
|
10055
|
-
);
|
|
9949
|
+
tag_set = new Set(allowable_tags);
|
|
10056
9950
|
}
|
|
10057
|
-
} else return null;
|
|
10058
|
-
}, _this.cardLoader = function (page, columns, variant) {
|
|
10059
|
-
var mode = variant && variant === 'bottom' ? 'column-reverse' : 'column';
|
|
10060
|
-
|
|
10061
|
-
var itemCounter = 0;
|
|
10062
|
-
var lgVar = 12;
|
|
10063
|
-
var numberOfItemsBeforeAd = 6;
|
|
10064
|
-
return React__default.createElement(
|
|
10065
|
-
Row,
|
|
10066
|
-
null,
|
|
10067
|
-
_this.state.data && _this.state.data.map(function (row, index$$1) {
|
|
10068
|
-
if (columns === 'rotate' && itemCounter % 3 === 0) {
|
|
10069
|
-
lgVar = 12;
|
|
10070
|
-
} else if (columns && columns !== 'rotate') {
|
|
10071
|
-
lgVar = Math.floor(12 / columns);
|
|
10072
|
-
} else {
|
|
10073
|
-
lgVar = 6;
|
|
10074
|
-
}
|
|
10075
|
-
|
|
10076
|
-
var pageNumber = row.pageNumber || _this.state.page;
|
|
10077
|
-
var contentCategoryName = row.contentCategory && row.contentCategory.name && _this.mapping[row.contentCategory.name] ? row.contentCategory.name : 'Articles';
|
|
10078
|
-
return React__default.createElement(
|
|
10079
|
-
React__default.Fragment,
|
|
10080
|
-
{ key: itemCounter },
|
|
10081
|
-
React__default.createElement(
|
|
10082
|
-
VisibilitySensor,
|
|
10083
|
-
{
|
|
10084
|
-
onChange: function onChange(isVisible) {
|
|
10085
|
-
isVisible && _this.changePageNumber(pageNumber);
|
|
10086
|
-
} },
|
|
10087
|
-
React__default.createElement(
|
|
10088
|
-
Col,
|
|
10089
|
-
{ md: 12, lg: lgVar, counter: itemCounter++, style: { display: 'flex', flex: '1 0 auto' } },
|
|
10090
|
-
React__default.createElement(
|
|
10091
|
-
Card,
|
|
10092
|
-
{ className: 'content-card', style: { flexDirection: mode } },
|
|
10093
|
-
(row.thumbnail && row.thumbnail.asset || _this.props.defaultImage) && React__default.createElement(
|
|
10094
|
-
Link,
|
|
10095
|
-
{ href: _this.mapping[contentCategoryName] + '/[url]', as: _this.mapping[contentCategoryName] + '/' + row.url.current },
|
|
10096
|
-
React__default.createElement(
|
|
10097
|
-
'a',
|
|
10098
|
-
null,
|
|
10099
|
-
React__default.createElement(
|
|
10100
|
-
LazyLoad,
|
|
10101
|
-
{ height: _this.props.imageHeight },
|
|
10102
|
-
React__default.createElement(Card.Img, {
|
|
10103
|
-
variant: 'top',
|
|
10104
|
-
src: _this.renderCardImage(row, page),
|
|
10105
|
-
alt: row.thumbnail && row.thumbnail.asset ? row.thumbnail.asset.originalFilename : ''
|
|
10106
|
-
})
|
|
10107
|
-
)
|
|
10108
|
-
)
|
|
10109
|
-
),
|
|
10110
|
-
React__default.createElement(
|
|
10111
|
-
Card.Body,
|
|
10112
|
-
null,
|
|
10113
|
-
React__default.createElement(
|
|
10114
|
-
Link,
|
|
10115
|
-
{ href: _this.mapping[contentCategoryName] + '/[url]', as: _this.mapping[contentCategoryName] + '/' + row.url.current },
|
|
10116
|
-
React__default.createElement(
|
|
10117
|
-
'a',
|
|
10118
|
-
null,
|
|
10119
|
-
React__default.createElement(
|
|
10120
|
-
Card.Title,
|
|
10121
|
-
null,
|
|
10122
|
-
row.title
|
|
10123
|
-
)
|
|
10124
|
-
)
|
|
10125
|
-
),
|
|
10126
|
-
_this.props.showPublished && row.published && React__default.createElement(
|
|
10127
|
-
Card.Subtitle,
|
|
10128
|
-
null,
|
|
10129
|
-
moment(row.published).format('MMMM DD, YYYY')
|
|
10130
|
-
),
|
|
10131
|
-
_this.props.showAuthor && row.authorMapping && row.authorMapping.length > 0 && row.authorMapping.map(function (authorDetail, index$$1) {
|
|
10132
|
-
return _this.renderAuthor(authorDetail, index$$1, row.authorMapping.length);
|
|
10133
|
-
}),
|
|
10134
|
-
React__default.createElement(
|
|
10135
|
-
Card.Text,
|
|
10136
|
-
null,
|
|
10137
|
-
row.summary
|
|
10138
|
-
)
|
|
10139
|
-
)
|
|
10140
|
-
)
|
|
10141
|
-
)
|
|
10142
|
-
),
|
|
10143
|
-
main_36 && _this.props.rightItems && (index$$1 + 1) % numberOfItemsBeforeAd === 0 && _this.renderMobileAd(index$$1, numberOfItemsBeforeAd)
|
|
10144
|
-
);
|
|
10145
|
-
})
|
|
10146
|
-
);
|
|
10147
|
-
}, _this.renderMobileAd = function (index$$1, numberOfItemsBeforeAd) {
|
|
10148
|
-
var rightItems = _this.props.rightItems;
|
|
10149
|
-
|
|
10150
|
-
var i = ((index$$1 + 1) / numberOfItemsBeforeAd - 1) % rightItems.length;
|
|
10151
|
-
return React__default.createElement(
|
|
10152
|
-
Col,
|
|
10153
|
-
{ md: 12, style: { display: 'flex', flex: '1 0 auto' } },
|
|
10154
|
-
rightItems[i].component
|
|
10155
|
-
);
|
|
10156
|
-
}, _this.renderManualPagination = function () {
|
|
10157
|
-
var currentPage = _this.state.currentPage;
|
|
10158
9951
|
|
|
10159
|
-
|
|
10160
|
-
|
|
10161
|
-
|
|
10162
|
-
|
|
10163
|
-
'a',
|
|
10164
|
-
{ href: '?page=' + (currentPage - 1) },
|
|
10165
|
-
'<< Previous'
|
|
10166
|
-
),
|
|
10167
|
-
React__default.createElement(
|
|
10168
|
-
'a',
|
|
10169
|
-
{ href: '?page=' + (currentPage + 1) },
|
|
10170
|
-
'Next >>'
|
|
10171
|
-
)
|
|
10172
|
-
);
|
|
10173
|
-
}, _temp), possibleConstructorReturn(_this, _ret);
|
|
10174
|
-
}
|
|
9952
|
+
else if (typeof allowable_tags.forEach === 'function') {
|
|
9953
|
+
// IE11 compatible
|
|
9954
|
+
allowable_tags.forEach(tag_set.add, tag_set);
|
|
9955
|
+
}
|
|
10175
9956
|
|
|
10176
|
-
|
|
10177
|
-
key: 'componentDidUpdate',
|
|
10178
|
-
value: function componentDidUpdate(prevProps, prevState) {
|
|
10179
|
-
if (this.state.dataKeptToCompareNewDatarecord !== this.props.dataRecord) {
|
|
10180
|
-
// eslint-disable-next-line react/no-did-update-set-state
|
|
10181
|
-
this.setState({
|
|
10182
|
-
data: this.props.dataRecord,
|
|
10183
|
-
dataKeptToCompareNewDatarecord: this.props.dataRecord,
|
|
10184
|
-
per: this.props.params ? this.props.params.to : 2,
|
|
10185
|
-
page: 1,
|
|
10186
|
-
from: this.props.params ? this.props.params.from : 0,
|
|
10187
|
-
to: this.props.params ? this.props.params.to : 2,
|
|
10188
|
-
total_pages: null,
|
|
10189
|
-
scrolling: true,
|
|
10190
|
-
query: this.props.query
|
|
10191
|
-
});
|
|
10192
|
-
}
|
|
10193
|
-
}
|
|
10194
|
-
}, {
|
|
10195
|
-
key: 'componentDidMount',
|
|
10196
|
-
value: function componentDidMount() {
|
|
10197
|
-
// this.loadData();
|
|
9957
|
+
return tag_set;
|
|
10198
9958
|
}
|
|
10199
|
-
}, {
|
|
10200
|
-
key: 'render',
|
|
10201
|
-
value: function render() {
|
|
10202
|
-
var _this2 = this;
|
|
10203
9959
|
|
|
10204
|
-
|
|
10205
|
-
|
|
10206
|
-
variant = _props.variant,
|
|
10207
|
-
autoScroll = _props.autoScroll,
|
|
10208
|
-
page = _props.page;
|
|
9960
|
+
function normalize_tag(tag_buffer) {
|
|
9961
|
+
let match = NORMALIZE_TAG_REGEX.exec(tag_buffer);
|
|
10209
9962
|
|
|
9963
|
+
return match ? match[1].toLowerCase() : null;
|
|
9964
|
+
}
|
|
10210
9965
|
|
|
10211
|
-
|
|
10212
|
-
|
|
10213
|
-
|
|
10214
|
-
autoScroll ? React__default.createElement(
|
|
10215
|
-
React__default.Fragment,
|
|
10216
|
-
null,
|
|
10217
|
-
React__default.createElement(
|
|
10218
|
-
InfiniteScroll,
|
|
10219
|
-
{ dataLength: this.state.data.length, next: this.loadMore, hasMore: this.state.scrolling, scrollThreshold: 0.9 },
|
|
10220
|
-
React__default.createElement(
|
|
10221
|
-
Container,
|
|
10222
|
-
null,
|
|
10223
|
-
this.cardLoader(page, columns, variant)
|
|
10224
|
-
)
|
|
10225
|
-
),
|
|
10226
|
-
React__default.createElement(
|
|
10227
|
-
'noscript',
|
|
10228
|
-
null,
|
|
10229
|
-
this.renderManualPagination()
|
|
10230
|
-
)
|
|
10231
|
-
) : React__default.createElement(
|
|
10232
|
-
React__default.Fragment,
|
|
10233
|
-
null,
|
|
10234
|
-
React__default.createElement(
|
|
10235
|
-
Container,
|
|
10236
|
-
null,
|
|
10237
|
-
this.cardLoader(page, columns, variant)
|
|
10238
|
-
),
|
|
10239
|
-
React__default.createElement(
|
|
10240
|
-
'div',
|
|
10241
|
-
{ style: { padding: '0px 10px' } },
|
|
10242
|
-
this.state.scrolling ? React__default.createElement(
|
|
10243
|
-
'button',
|
|
10244
|
-
{
|
|
10245
|
-
style: { margin: 'auto', width: '100%' },
|
|
10246
|
-
onClick: function onClick(e) {
|
|
10247
|
-
_this2.loadMore();
|
|
10248
|
-
} },
|
|
10249
|
-
'Load More'
|
|
10250
|
-
) : React__default.createElement(
|
|
10251
|
-
'p',
|
|
10252
|
-
{ style: { textAlign: 'center' } },
|
|
10253
|
-
React__default.createElement(
|
|
10254
|
-
'b',
|
|
10255
|
-
null,
|
|
10256
|
-
'End of data'
|
|
10257
|
-
)
|
|
10258
|
-
)
|
|
10259
|
-
),
|
|
10260
|
-
React__default.createElement(
|
|
10261
|
-
'noscript',
|
|
10262
|
-
null,
|
|
10263
|
-
this.renderManualPagination()
|
|
10264
|
-
)
|
|
10265
|
-
)
|
|
10266
|
-
);
|
|
9966
|
+
if (module.exports) {
|
|
9967
|
+
// Node
|
|
9968
|
+
module.exports = striptags;
|
|
10267
9969
|
}
|
|
10268
|
-
}]);
|
|
10269
|
-
return DeckContent;
|
|
10270
|
-
}(React__default.Component);
|
|
10271
9970
|
|
|
10272
|
-
|
|
9971
|
+
else {
|
|
9972
|
+
// Browser
|
|
9973
|
+
global.striptags = striptags;
|
|
9974
|
+
}
|
|
9975
|
+
}(commonjsGlobal));
|
|
9976
|
+
});
|
|
9977
|
+
|
|
9978
|
+
var html_map = {
|
|
9979
|
+
"'": "'",
|
|
9980
|
+
"<": "<",
|
|
9981
|
+
">": ">",
|
|
9982
|
+
" ": " ",
|
|
9983
|
+
"¡": "¡",
|
|
9984
|
+
"¢": "¢",
|
|
9985
|
+
"£": "£",
|
|
9986
|
+
"¤": "¤",
|
|
9987
|
+
"¥": "¥",
|
|
9988
|
+
"¦": "¦",
|
|
9989
|
+
"§": "§",
|
|
9990
|
+
"¨": "¨",
|
|
9991
|
+
"©": "©",
|
|
9992
|
+
"ª": "ª",
|
|
9993
|
+
"«": "«",
|
|
9994
|
+
"¬": "¬",
|
|
9995
|
+
"®": "®",
|
|
9996
|
+
"¯": "¯",
|
|
9997
|
+
"°": "°",
|
|
9998
|
+
"±": "±",
|
|
9999
|
+
"²": "²",
|
|
10000
|
+
"³": "³",
|
|
10001
|
+
"´": "´",
|
|
10002
|
+
"µ": "µ",
|
|
10003
|
+
"¶": "¶",
|
|
10004
|
+
"·": "·",
|
|
10005
|
+
"¸": "¸",
|
|
10006
|
+
"¹": "¹",
|
|
10007
|
+
"º": "º",
|
|
10008
|
+
"»": "»",
|
|
10009
|
+
"¼": "¼",
|
|
10010
|
+
"½": "½",
|
|
10011
|
+
"¾": "¾",
|
|
10012
|
+
"¿": "¿",
|
|
10013
|
+
"À": "À",
|
|
10014
|
+
"Á": "Á",
|
|
10015
|
+
"Â": "Â",
|
|
10016
|
+
"Ã": "Ã",
|
|
10017
|
+
"Ä": "Ä",
|
|
10018
|
+
"Å": "Å",
|
|
10019
|
+
"Æ": "Æ",
|
|
10020
|
+
"Ç": "Ç",
|
|
10021
|
+
"È": "È",
|
|
10022
|
+
"É": "É",
|
|
10023
|
+
"Ê": "Ê",
|
|
10024
|
+
"Ë": "Ë",
|
|
10025
|
+
"Ì": "Ì",
|
|
10026
|
+
"Í": "Í",
|
|
10027
|
+
"Î": "Î",
|
|
10028
|
+
"Ï": "Ï",
|
|
10029
|
+
"Ð": "Ð",
|
|
10030
|
+
"Ñ": "Ñ",
|
|
10031
|
+
"Ò": "Ò",
|
|
10032
|
+
"Ó": "Ó",
|
|
10033
|
+
"Ô": "Ô",
|
|
10034
|
+
"Õ": "Õ",
|
|
10035
|
+
"Ö": "Ö",
|
|
10036
|
+
"×": "×",
|
|
10037
|
+
"Ø": "Ø",
|
|
10038
|
+
"Ù": "Ù",
|
|
10039
|
+
"Ú": "Ú",
|
|
10040
|
+
"Û": "Û",
|
|
10041
|
+
"Ü": "Ü",
|
|
10042
|
+
"Ý": "Ý",
|
|
10043
|
+
"Þ": "Þ",
|
|
10044
|
+
"ß": "ß",
|
|
10045
|
+
"à": "à",
|
|
10046
|
+
"á": "á",
|
|
10047
|
+
"â": "â",
|
|
10048
|
+
"ã": "ã",
|
|
10049
|
+
"ä": "ä",
|
|
10050
|
+
"å": "å",
|
|
10051
|
+
"æ": "æ",
|
|
10052
|
+
"ç": "ç",
|
|
10053
|
+
"è": "è",
|
|
10054
|
+
"é": "é",
|
|
10055
|
+
"ê": "ê",
|
|
10056
|
+
"ë": "ë",
|
|
10057
|
+
"ì": "ì",
|
|
10058
|
+
"í": "í",
|
|
10059
|
+
"î": "î",
|
|
10060
|
+
"ï": "ï",
|
|
10061
|
+
"ð": "ð",
|
|
10062
|
+
"ñ": "ñ",
|
|
10063
|
+
"ò": "ò",
|
|
10064
|
+
"ó": "ó",
|
|
10065
|
+
"ô": "ô",
|
|
10066
|
+
"õ": "õ",
|
|
10067
|
+
"ö": "ö",
|
|
10068
|
+
"÷": "÷",
|
|
10069
|
+
"ø": "ø",
|
|
10070
|
+
"ù": "ù",
|
|
10071
|
+
"ú": "ú",
|
|
10072
|
+
"û": "û",
|
|
10073
|
+
"ü": "ü",
|
|
10074
|
+
"ý": "ý",
|
|
10075
|
+
"þ": "þ",
|
|
10076
|
+
"ÿ": "ÿ",
|
|
10077
|
+
"Œ": "Œ",
|
|
10078
|
+
"œ": "œ",
|
|
10079
|
+
"Š": "Š",
|
|
10080
|
+
"š": "š",
|
|
10081
|
+
"Ÿ": "Ÿ",
|
|
10082
|
+
"ƒ": "ƒ",
|
|
10083
|
+
"ˆ": "ˆ",
|
|
10084
|
+
"˜": "˜",
|
|
10085
|
+
"Α": "Α",
|
|
10086
|
+
"Β": "Β",
|
|
10087
|
+
"Γ": "Γ",
|
|
10088
|
+
"Δ": "Δ",
|
|
10089
|
+
"Ε": "Ε",
|
|
10090
|
+
"Ζ": "Ζ",
|
|
10091
|
+
"Η": "Η",
|
|
10092
|
+
"Θ": "Θ",
|
|
10093
|
+
"Ι": "Ι",
|
|
10094
|
+
"Κ": "Κ",
|
|
10095
|
+
"Λ": "Λ",
|
|
10096
|
+
"Μ": "Μ",
|
|
10097
|
+
"Ν": "Ν",
|
|
10098
|
+
"Ξ": "Ξ",
|
|
10099
|
+
"Ο": "Ο",
|
|
10100
|
+
"Π": "Π",
|
|
10101
|
+
"Ρ": "Ρ",
|
|
10102
|
+
"Σ": "Σ",
|
|
10103
|
+
"Τ": "Τ",
|
|
10104
|
+
"Υ": "Υ",
|
|
10105
|
+
"Φ": "Φ",
|
|
10106
|
+
"Χ": "Χ",
|
|
10107
|
+
"Ψ": "Ψ",
|
|
10108
|
+
"Ω": "Ω",
|
|
10109
|
+
"α": "α",
|
|
10110
|
+
"β": "β",
|
|
10111
|
+
"γ": "γ",
|
|
10112
|
+
"δ": "δ",
|
|
10113
|
+
"ε": "ε",
|
|
10114
|
+
"ζ": "ζ",
|
|
10115
|
+
"η": "η",
|
|
10116
|
+
"θ": "θ",
|
|
10117
|
+
"ι": "ι",
|
|
10118
|
+
"κ": "κ",
|
|
10119
|
+
"λ": "λ",
|
|
10120
|
+
"μ": "μ",
|
|
10121
|
+
"ν": "ν",
|
|
10122
|
+
"ξ": "ξ",
|
|
10123
|
+
"ο": "ο",
|
|
10124
|
+
"π": "π",
|
|
10125
|
+
"ρ": "ρ",
|
|
10126
|
+
"ς": "ς",
|
|
10127
|
+
"σ": "σ",
|
|
10128
|
+
"τ": "τ",
|
|
10129
|
+
"υ": "υ",
|
|
10130
|
+
"φ": "φ",
|
|
10131
|
+
"χ": "χ",
|
|
10132
|
+
"ψ": "ψ",
|
|
10133
|
+
"ω": "ω",
|
|
10134
|
+
"ϑ": "ϑ",
|
|
10135
|
+
"ϒ": "&Upsih;",
|
|
10136
|
+
"ϖ": "ϖ",
|
|
10137
|
+
"–": "–",
|
|
10138
|
+
"—": "—",
|
|
10139
|
+
"‘": "‘",
|
|
10140
|
+
"’": "’",
|
|
10141
|
+
"‚": "‚",
|
|
10142
|
+
"“": "“",
|
|
10143
|
+
"”": "”",
|
|
10144
|
+
"„": "„",
|
|
10145
|
+
"†": "†",
|
|
10146
|
+
"‡": "‡",
|
|
10147
|
+
"•": "•",
|
|
10148
|
+
"…": "…",
|
|
10149
|
+
"‰": "‰",
|
|
10150
|
+
"′": "′",
|
|
10151
|
+
"″": "″",
|
|
10152
|
+
"‹": "‹",
|
|
10153
|
+
"›": "›",
|
|
10154
|
+
"‾": "‾",
|
|
10155
|
+
"⁄": "⁄",
|
|
10156
|
+
"€": "€",
|
|
10157
|
+
"ℑ": "ℑ",
|
|
10158
|
+
"℘": "℘",
|
|
10159
|
+
"ℜ": "ℜ",
|
|
10160
|
+
"™": "™",
|
|
10161
|
+
"ℵ": "ℵ",
|
|
10162
|
+
"←": "←",
|
|
10163
|
+
"↑": "↑",
|
|
10164
|
+
"→": "→",
|
|
10165
|
+
"↓": "↓",
|
|
10166
|
+
"↔": "↔",
|
|
10167
|
+
"↵": "↵",
|
|
10168
|
+
"⇐": "⇐",
|
|
10169
|
+
"⇑": "&UArr;",
|
|
10170
|
+
"⇒": "⇒",
|
|
10171
|
+
"⇓": "⇓",
|
|
10172
|
+
"⇔": "⇔",
|
|
10173
|
+
"∀": "∀",
|
|
10174
|
+
"∂": "∂",
|
|
10175
|
+
"∃": "∃",
|
|
10176
|
+
"∅": "∅",
|
|
10177
|
+
"∇": "∇",
|
|
10178
|
+
"∈": "∈",
|
|
10179
|
+
"∉": "∉",
|
|
10180
|
+
"∋": "∋",
|
|
10181
|
+
"∏": "∏",
|
|
10182
|
+
"∑": "∑",
|
|
10183
|
+
"−": "−",
|
|
10184
|
+
"∗": "∗",
|
|
10185
|
+
"√": "√",
|
|
10186
|
+
"∝": "∝",
|
|
10187
|
+
"∞": "∞",
|
|
10188
|
+
"∠": "∠",
|
|
10189
|
+
"∧": "∧",
|
|
10190
|
+
"∨": "∨",
|
|
10191
|
+
"∩": "∩",
|
|
10192
|
+
"∪": "∪",
|
|
10193
|
+
"∫": "∫",
|
|
10194
|
+
"∴": "∴",
|
|
10195
|
+
"∼": "∼",
|
|
10196
|
+
"≅": "≅",
|
|
10197
|
+
"≈": "≈",
|
|
10198
|
+
"≠": "≠",
|
|
10199
|
+
"≡": "≡",
|
|
10200
|
+
"≤": "≤",
|
|
10201
|
+
"≥": "≥",
|
|
10202
|
+
"⊂": "⊂",
|
|
10203
|
+
"⊃": "⊃",
|
|
10204
|
+
"⊄": "⊄",
|
|
10205
|
+
"⊆": "⊆",
|
|
10206
|
+
"⊇": "⊇",
|
|
10207
|
+
"⊕": "⊕",
|
|
10208
|
+
"⊗": "⊗",
|
|
10209
|
+
"⊥": "⊥",
|
|
10210
|
+
"⋅": "⋅",
|
|
10211
|
+
"⌈": "⌈",
|
|
10212
|
+
"⌉": "⌉",
|
|
10213
|
+
"⌊": "⌊",
|
|
10214
|
+
"⌋": "⌋",
|
|
10215
|
+
"⟨": "⟨",
|
|
10216
|
+
"⟩": "⟩",
|
|
10217
|
+
"◊": "◊",
|
|
10218
|
+
"♠": "♠",
|
|
10219
|
+
"♣": "♣",
|
|
10220
|
+
"♥": "♥",
|
|
10221
|
+
"♦": "♦"
|
|
10222
|
+
};
|
|
10223
|
+
|
|
10224
|
+
var html_decode = function html_decode(string) {
|
|
10225
|
+
var entityMap = html_map;
|
|
10226
|
+
for (var key in entityMap) {
|
|
10227
|
+
var entity = entityMap[key];
|
|
10228
|
+
var regex = new RegExp(entity, 'g');
|
|
10229
|
+
string = string.replace(regex, key);
|
|
10230
|
+
}
|
|
10231
|
+
string = string.replace(/"/g, '"');
|
|
10232
|
+
string = string.replace(/&/g, '&');
|
|
10233
|
+
return string;
|
|
10234
|
+
};
|
|
10235
|
+
|
|
10236
|
+
var clean_html = function clean_html(string) {
|
|
10237
|
+
return striptags(html_decode(string));
|
|
10238
|
+
};
|
|
10239
|
+
var html_decode_1 = html_decode;
|
|
10240
|
+
var clean_html_1 = clean_html;
|
|
10241
|
+
|
|
10242
|
+
var classCallCheck = function (instance, Constructor) {
|
|
10243
|
+
if (!(instance instanceof Constructor)) {
|
|
10244
|
+
throw new TypeError("Cannot call a class as a function");
|
|
10245
|
+
}
|
|
10246
|
+
};
|
|
10247
|
+
|
|
10248
|
+
var createClass = function () {
|
|
10249
|
+
function defineProperties(target, props) {
|
|
10250
|
+
for (var i = 0; i < props.length; i++) {
|
|
10251
|
+
var descriptor = props[i];
|
|
10252
|
+
descriptor.enumerable = descriptor.enumerable || false;
|
|
10253
|
+
descriptor.configurable = true;
|
|
10254
|
+
if ("value" in descriptor) descriptor.writable = true;
|
|
10255
|
+
Object.defineProperty(target, descriptor.key, descriptor);
|
|
10256
|
+
}
|
|
10257
|
+
}
|
|
10258
|
+
|
|
10259
|
+
return function (Constructor, protoProps, staticProps) {
|
|
10260
|
+
if (protoProps) defineProperties(Constructor.prototype, protoProps);
|
|
10261
|
+
if (staticProps) defineProperties(Constructor, staticProps);
|
|
10262
|
+
return Constructor;
|
|
10263
|
+
};
|
|
10264
|
+
}();
|
|
10265
|
+
|
|
10266
|
+
var _extends = Object.assign || function (target) {
|
|
10267
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
10268
|
+
var source = arguments[i];
|
|
10269
|
+
|
|
10270
|
+
for (var key in source) {
|
|
10271
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
10272
|
+
target[key] = source[key];
|
|
10273
|
+
}
|
|
10274
|
+
}
|
|
10275
|
+
}
|
|
10276
|
+
|
|
10277
|
+
return target;
|
|
10278
|
+
};
|
|
10279
|
+
|
|
10280
|
+
var inherits = function (subClass, superClass) {
|
|
10281
|
+
if (typeof superClass !== "function" && superClass !== null) {
|
|
10282
|
+
throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
|
|
10283
|
+
}
|
|
10284
|
+
|
|
10285
|
+
subClass.prototype = Object.create(superClass && superClass.prototype, {
|
|
10286
|
+
constructor: {
|
|
10287
|
+
value: subClass,
|
|
10288
|
+
enumerable: false,
|
|
10289
|
+
writable: true,
|
|
10290
|
+
configurable: true
|
|
10291
|
+
}
|
|
10292
|
+
});
|
|
10293
|
+
if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
|
|
10294
|
+
};
|
|
10295
|
+
|
|
10296
|
+
var possibleConstructorReturn = function (self, call) {
|
|
10297
|
+
if (!self) {
|
|
10298
|
+
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
10299
|
+
}
|
|
10300
|
+
|
|
10301
|
+
return call && (typeof call === "object" || typeof call === "function") ? call : self;
|
|
10302
|
+
};
|
|
10303
|
+
|
|
10304
|
+
var slicedToArray = function () {
|
|
10305
|
+
function sliceIterator(arr, i) {
|
|
10306
|
+
var _arr = [];
|
|
10307
|
+
var _n = true;
|
|
10308
|
+
var _d = false;
|
|
10309
|
+
var _e = undefined;
|
|
10310
|
+
|
|
10311
|
+
try {
|
|
10312
|
+
for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
|
|
10313
|
+
_arr.push(_s.value);
|
|
10314
|
+
|
|
10315
|
+
if (i && _arr.length === i) break;
|
|
10316
|
+
}
|
|
10317
|
+
} catch (err) {
|
|
10318
|
+
_d = true;
|
|
10319
|
+
_e = err;
|
|
10320
|
+
} finally {
|
|
10321
|
+
try {
|
|
10322
|
+
if (!_n && _i["return"]) _i["return"]();
|
|
10323
|
+
} finally {
|
|
10324
|
+
if (_d) throw _e;
|
|
10325
|
+
}
|
|
10326
|
+
}
|
|
10327
|
+
|
|
10328
|
+
return _arr;
|
|
10329
|
+
}
|
|
10330
|
+
|
|
10331
|
+
return function (arr, i) {
|
|
10332
|
+
if (Array.isArray(arr)) {
|
|
10333
|
+
return arr;
|
|
10334
|
+
} else if (Symbol.iterator in Object(arr)) {
|
|
10335
|
+
return sliceIterator(arr, i);
|
|
10336
|
+
} else {
|
|
10337
|
+
throw new TypeError("Invalid attempt to destructure non-iterable instance");
|
|
10338
|
+
}
|
|
10339
|
+
};
|
|
10340
|
+
}();
|
|
10341
|
+
|
|
10342
|
+
var toConsumableArray = function (arr) {
|
|
10343
|
+
if (Array.isArray(arr)) {
|
|
10344
|
+
for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) arr2[i] = arr[i];
|
|
10345
|
+
|
|
10346
|
+
return arr2;
|
|
10347
|
+
} else {
|
|
10348
|
+
return Array.from(arr);
|
|
10349
|
+
}
|
|
10350
|
+
};
|
|
10351
|
+
|
|
10352
|
+
var DeckContent = function (_React$Component) {
|
|
10353
|
+
inherits(DeckContent, _React$Component);
|
|
10354
|
+
|
|
10355
|
+
function DeckContent() {
|
|
10356
|
+
var _ref;
|
|
10357
|
+
|
|
10358
|
+
var _temp, _this, _ret;
|
|
10359
|
+
|
|
10360
|
+
classCallCheck(this, DeckContent);
|
|
10361
|
+
|
|
10362
|
+
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
|
|
10363
|
+
args[_key] = arguments[_key];
|
|
10364
|
+
}
|
|
10365
|
+
|
|
10366
|
+
return _ret = (_temp = (_this = possibleConstructorReturn(this, (_ref = DeckContent.__proto__ || Object.getPrototypeOf(DeckContent)).call.apply(_ref, [this].concat(args))), _this), _this.mapping = _this.props.mapping, _this.data = _this.props.dataRecord || [], _this.query = _this.props.query, _this.params = _this.props.params, _this.pointer = _this.props.pointer ? _this.props.pointer : false, _this.pointerArray = _this.props.pointerArray ? _this.props.pointerArray : false, _this.defaultImage = _this.props.defaultImage ? _this.props.defaultImage : '/placeholder.jpg', _this.state = {
|
|
10367
|
+
data: _this.data,
|
|
10368
|
+
dataKeptToCompareNewDatarecord: _this.data,
|
|
10369
|
+
per: _this.params ? _this.params.to : 2,
|
|
10370
|
+
page: _this.props.currentPage || 1,
|
|
10371
|
+
from: _this.params ? _this.params.from : 0,
|
|
10372
|
+
to: _this.params ? _this.params.to : 2,
|
|
10373
|
+
total_pages: null,
|
|
10374
|
+
scrolling: true,
|
|
10375
|
+
query: _this.query,
|
|
10376
|
+
currentPage: _this.props.currentPage || 1
|
|
10377
|
+
}, _this.loadMore = debounce_1(function () {
|
|
10378
|
+
_this.setState(function (state) {
|
|
10379
|
+
var page = state.page,
|
|
10380
|
+
from = state.from,
|
|
10381
|
+
per = state.per,
|
|
10382
|
+
to = state.to;
|
|
10383
|
+
|
|
10384
|
+
return {
|
|
10385
|
+
page: page + 1,
|
|
10386
|
+
from: from + per,
|
|
10387
|
+
to: to + per
|
|
10388
|
+
};
|
|
10389
|
+
}, _this.loadData);
|
|
10390
|
+
}, 0), _this.loadData = function () {
|
|
10391
|
+
var _this$state = _this.state,
|
|
10392
|
+
from = _this$state.from,
|
|
10393
|
+
to = _this$state.to,
|
|
10394
|
+
data = _this$state.data,
|
|
10395
|
+
query = _this$state.query,
|
|
10396
|
+
page = _this$state.page;
|
|
10397
|
+
var client = _this.props.client;
|
|
10398
|
+
|
|
10399
|
+
|
|
10400
|
+
var params = _extends({}, _this.params, { from: from, to: to
|
|
10401
|
+
// const queryUpdated = query.replace('$from', params.from).replace('$to', params.to)
|
|
10402
|
+
// const query = '*[_type == "article" && defined(title) && defined(thumbnail)][$from...$to] { title, summary, thumbnail { asset-> }, url }'
|
|
10403
|
+
});client.fetch(query, params).then(function (dataArr) {
|
|
10404
|
+
if (_this.pointer && _this.pointerArray) {
|
|
10405
|
+
var pointer = _this.pointer;
|
|
10406
|
+
dataArr = dataArr[_this.pointerArray][pointer];
|
|
10407
|
+
}
|
|
10408
|
+
dataArr = dataArr.map(function (item) {
|
|
10409
|
+
return _extends({}, item, {
|
|
10410
|
+
pageNumber: page
|
|
10411
|
+
});
|
|
10412
|
+
});
|
|
10413
|
+
|
|
10414
|
+
_this.setState(function () {
|
|
10415
|
+
if (dataArr.length > 0) {
|
|
10416
|
+
return {
|
|
10417
|
+
data: [].concat(toConsumableArray(data), toConsumableArray(dataArr)),
|
|
10418
|
+
scrolling: true
|
|
10419
|
+
};
|
|
10420
|
+
} else {
|
|
10421
|
+
return {
|
|
10422
|
+
scrolling: false
|
|
10423
|
+
};
|
|
10424
|
+
}
|
|
10425
|
+
});
|
|
10426
|
+
});
|
|
10427
|
+
}, _this.urlFor = function (source) {
|
|
10428
|
+
var client = _this.props.client;
|
|
10429
|
+
|
|
10430
|
+
var builder = imageUrlBuilder(client);
|
|
10431
|
+
return builder.image(source).auto('format');
|
|
10432
|
+
}, _this.renderCardImage = function (row, page) {
|
|
10433
|
+
if (row.thumbnail && row.thumbnail.asset) {
|
|
10434
|
+
var url = _this.urlFor(row.thumbnail);
|
|
10435
|
+
if (_this.props.imageHeight) url = url.height(_this.props.imageHeight);
|
|
10436
|
+
if (_this.props.imageWidth) url = url.width(_this.props.imageWidth);
|
|
10437
|
+
return url.url();
|
|
10438
|
+
} else {
|
|
10439
|
+
return _this.defaultImage;
|
|
10440
|
+
}
|
|
10441
|
+
}, _this.changePageNumber = function (pageNumber) {
|
|
10442
|
+
var _this$props = _this.props,
|
|
10443
|
+
seoPaginate = _this$props.seoPaginate,
|
|
10444
|
+
pageview = _this$props.pageview,
|
|
10445
|
+
router = _this$props.router;
|
|
10446
|
+
var currentPage = _this.state.currentPage;
|
|
10447
|
+
|
|
10448
|
+
if (seoPaginate) {
|
|
10449
|
+
var path = router.asPath;
|
|
10450
|
+
var qrIndex = path.indexOf('?');
|
|
10451
|
+
var pathname = router.pathname;
|
|
10452
|
+
var queryString = '';
|
|
10453
|
+
|
|
10454
|
+
if (qrIndex > 0) {
|
|
10455
|
+
path = path.substring(1, qrIndex);
|
|
10456
|
+
|
|
10457
|
+
var partialQS = router.asPath.substring(qrIndex + 1);
|
|
10458
|
+
var partialQSArr = partialQS.split('&');
|
|
10459
|
+
|
|
10460
|
+
// exclude page=xxx from query string
|
|
10461
|
+
partialQSArr.map(function (item) {
|
|
10462
|
+
var itemArr = item.split('=');
|
|
10463
|
+
var key = itemArr[0];
|
|
10464
|
+
var val = itemArr[1];
|
|
10465
|
+
|
|
10466
|
+
if (key !== 'page') {
|
|
10467
|
+
queryString += (queryString.length === 0 ? '' : '&') + key + '=' + val;
|
|
10468
|
+
}
|
|
10469
|
+
});
|
|
10470
|
+
}
|
|
10471
|
+
|
|
10472
|
+
if (queryString.length > 0) {
|
|
10473
|
+
path += '?' + queryString;
|
|
10474
|
+
}
|
|
10475
|
+
|
|
10476
|
+
pageNumber = parseInt(pageNumber);
|
|
10477
|
+
|
|
10478
|
+
if (currentPage !== pageNumber) {
|
|
10479
|
+
lib_3.refresh();
|
|
10480
|
+
if (pageview) {
|
|
10481
|
+
_this.setState({
|
|
10482
|
+
currentPage: pageNumber
|
|
10483
|
+
}, function () {
|
|
10484
|
+
if (path[0] !== '/') {
|
|
10485
|
+
path = '/' + path;
|
|
10486
|
+
}
|
|
10487
|
+
|
|
10488
|
+
var newPath = pageNumber === 1 ? '' + path : path + '?page=' + pageNumber;
|
|
10489
|
+
|
|
10490
|
+
// please leave this for later debug purpose : Yong Jun.
|
|
10491
|
+
/* console.log('page change reported', {
|
|
10492
|
+
currentPage: currentPage,
|
|
10493
|
+
pageNumber: pageNumber,
|
|
10494
|
+
pathname: pathname,
|
|
10495
|
+
path: path,
|
|
10496
|
+
newPath: newPath,
|
|
10497
|
+
firstPage: pageNumber === 1,
|
|
10498
|
+
queryString: queryString
|
|
10499
|
+
}) */
|
|
10500
|
+
|
|
10501
|
+
pageview(newPath);
|
|
10502
|
+
|
|
10503
|
+
router.push(pathname, newPath, {
|
|
10504
|
+
shallow: true
|
|
10505
|
+
});
|
|
10506
|
+
});
|
|
10507
|
+
}
|
|
10508
|
+
}
|
|
10509
|
+
}
|
|
10510
|
+
}, _this.renderAuthor = function (authorDetail, index$$1, length) {
|
|
10511
|
+
if (authorDetail) {
|
|
10512
|
+
var _id = authorDetail._id,
|
|
10513
|
+
displayName = authorDetail.displayName,
|
|
10514
|
+
url = authorDetail.url;
|
|
10515
|
+
|
|
10516
|
+
if (displayName && url && url.current) {
|
|
10517
|
+
return React__default.createElement(
|
|
10518
|
+
'div',
|
|
10519
|
+
{ key: _id },
|
|
10520
|
+
index$$1 === 0 && React__default.createElement(
|
|
10521
|
+
'span',
|
|
10522
|
+
{ className: 'pr-1' },
|
|
10523
|
+
'By'
|
|
10524
|
+
),
|
|
10525
|
+
React__default.createElement(
|
|
10526
|
+
Link,
|
|
10527
|
+
{ href: '/authors/[url]', as: '/authors/' + url.current },
|
|
10528
|
+
React__default.createElement(
|
|
10529
|
+
'a',
|
|
10530
|
+
{ className: 'text-muted' },
|
|
10531
|
+
displayName,
|
|
10532
|
+
length !== index$$1 + 1 && React__default.createElement('br', null)
|
|
10533
|
+
)
|
|
10534
|
+
)
|
|
10535
|
+
);
|
|
10536
|
+
} else if (displayName) {
|
|
10537
|
+
return React__default.createElement(
|
|
10538
|
+
'div',
|
|
10539
|
+
{ key: _id },
|
|
10540
|
+
index$$1 === 0 && React__default.createElement(
|
|
10541
|
+
'span',
|
|
10542
|
+
{ className: 'pr-1' },
|
|
10543
|
+
'By'
|
|
10544
|
+
),
|
|
10545
|
+
React__default.createElement(
|
|
10546
|
+
'span',
|
|
10547
|
+
{ className: 'text-muted' },
|
|
10548
|
+
displayName,
|
|
10549
|
+
length !== index$$1 + 1 && React__default.createElement('br', null)
|
|
10550
|
+
)
|
|
10551
|
+
);
|
|
10552
|
+
}
|
|
10553
|
+
} else return null;
|
|
10554
|
+
}, _this.cardLoader = function (page, columns, variant) {
|
|
10555
|
+
var mode = variant && variant === 'bottom' ? 'column-reverse' : 'column';
|
|
10556
|
+
|
|
10557
|
+
var itemCounter = 0;
|
|
10558
|
+
var lgVar = 12;
|
|
10559
|
+
var numberOfItemsBeforeAd = 6;
|
|
10560
|
+
return React__default.createElement(
|
|
10561
|
+
Row,
|
|
10562
|
+
null,
|
|
10563
|
+
_this.state.data && _this.state.data.map(function (row, index$$1) {
|
|
10564
|
+
if (columns === 'rotate' && itemCounter % 3 === 0) {
|
|
10565
|
+
lgVar = 12;
|
|
10566
|
+
} else if (columns && columns !== 'rotate') {
|
|
10567
|
+
lgVar = Math.floor(12 / columns);
|
|
10568
|
+
} else {
|
|
10569
|
+
lgVar = 6;
|
|
10570
|
+
}
|
|
10571
|
+
|
|
10572
|
+
var pageNumber = row.pageNumber || _this.state.page;
|
|
10573
|
+
var contentCategoryName = row.contentCategory && row.contentCategory.name && _this.mapping[row.contentCategory.name] ? row.contentCategory.name : 'Articles';
|
|
10574
|
+
return React__default.createElement(
|
|
10575
|
+
React__default.Fragment,
|
|
10576
|
+
{ key: itemCounter },
|
|
10577
|
+
React__default.createElement(
|
|
10578
|
+
VisibilitySensor,
|
|
10579
|
+
{
|
|
10580
|
+
onChange: function onChange(isVisible) {
|
|
10581
|
+
isVisible && _this.changePageNumber(pageNumber);
|
|
10582
|
+
} },
|
|
10583
|
+
React__default.createElement(
|
|
10584
|
+
Col,
|
|
10585
|
+
{ md: 12, lg: lgVar, counter: itemCounter++, style: { display: 'flex', flex: '1 0 auto' } },
|
|
10586
|
+
React__default.createElement(
|
|
10587
|
+
Card,
|
|
10588
|
+
{ className: 'content-card', style: { flexDirection: mode } },
|
|
10589
|
+
(row.thumbnail && row.thumbnail.asset || _this.props.defaultImage) && React__default.createElement(
|
|
10590
|
+
Link,
|
|
10591
|
+
{ href: _this.mapping[contentCategoryName] + '/[url]', as: _this.mapping[contentCategoryName] + '/' + row.url.current },
|
|
10592
|
+
React__default.createElement(
|
|
10593
|
+
'a',
|
|
10594
|
+
null,
|
|
10595
|
+
React__default.createElement(
|
|
10596
|
+
LazyLoad,
|
|
10597
|
+
{ height: _this.props.imageHeight },
|
|
10598
|
+
React__default.createElement(Card.Img, {
|
|
10599
|
+
variant: 'top',
|
|
10600
|
+
src: _this.renderCardImage(row, page),
|
|
10601
|
+
alt: row.thumbnail && row.thumbnail.asset ? row.thumbnail.asset.originalFilename : ''
|
|
10602
|
+
})
|
|
10603
|
+
)
|
|
10604
|
+
)
|
|
10605
|
+
),
|
|
10606
|
+
React__default.createElement(
|
|
10607
|
+
Card.Body,
|
|
10608
|
+
null,
|
|
10609
|
+
React__default.createElement(
|
|
10610
|
+
Link,
|
|
10611
|
+
{ href: _this.mapping[contentCategoryName] + '/[url]', as: _this.mapping[contentCategoryName] + '/' + row.url.current },
|
|
10612
|
+
React__default.createElement(
|
|
10613
|
+
'a',
|
|
10614
|
+
null,
|
|
10615
|
+
React__default.createElement(
|
|
10616
|
+
Card.Title,
|
|
10617
|
+
null,
|
|
10618
|
+
row.title
|
|
10619
|
+
)
|
|
10620
|
+
)
|
|
10621
|
+
),
|
|
10622
|
+
_this.props.showPublished && row.published && React__default.createElement(
|
|
10623
|
+
Card.Subtitle,
|
|
10624
|
+
null,
|
|
10625
|
+
moment(row.published).format('MMMM DD, YYYY')
|
|
10626
|
+
),
|
|
10627
|
+
_this.props.showAuthor && row.authorMapping && row.authorMapping.length > 0 && row.authorMapping.map(function (authorDetail, index$$1) {
|
|
10628
|
+
return _this.renderAuthor(authorDetail, index$$1, row.authorMapping.length);
|
|
10629
|
+
}),
|
|
10630
|
+
React__default.createElement(
|
|
10631
|
+
Card.Text,
|
|
10632
|
+
null,
|
|
10633
|
+
clean_html_1(row.summary)
|
|
10634
|
+
)
|
|
10635
|
+
)
|
|
10636
|
+
)
|
|
10637
|
+
)
|
|
10638
|
+
),
|
|
10639
|
+
main_36 && _this.props.rightItems && (index$$1 + 1) % numberOfItemsBeforeAd === 0 && _this.renderMobileAd(index$$1, numberOfItemsBeforeAd)
|
|
10640
|
+
);
|
|
10641
|
+
})
|
|
10642
|
+
);
|
|
10643
|
+
}, _this.renderMobileAd = function (index$$1, numberOfItemsBeforeAd) {
|
|
10644
|
+
var rightItems = _this.props.rightItems;
|
|
10645
|
+
|
|
10646
|
+
var i = ((index$$1 + 1) / numberOfItemsBeforeAd - 1) % rightItems.length;
|
|
10647
|
+
return React__default.createElement(
|
|
10648
|
+
Col,
|
|
10649
|
+
{ md: 12, style: { display: 'flex', flex: '1 0 auto' } },
|
|
10650
|
+
rightItems[i].component
|
|
10651
|
+
);
|
|
10652
|
+
}, _this.renderManualPagination = function () {
|
|
10653
|
+
var currentPage = _this.state.currentPage;
|
|
10654
|
+
|
|
10655
|
+
return React__default.createElement(
|
|
10656
|
+
'div',
|
|
10657
|
+
{ className: 'd-flex justify-content-between' },
|
|
10658
|
+
currentPage && currentPage > 1 && React__default.createElement(
|
|
10659
|
+
'a',
|
|
10660
|
+
{ href: '?page=' + (currentPage - 1) },
|
|
10661
|
+
'<< Previous'
|
|
10662
|
+
),
|
|
10663
|
+
React__default.createElement(
|
|
10664
|
+
'a',
|
|
10665
|
+
{ href: '?page=' + (currentPage + 1) },
|
|
10666
|
+
'Next >>'
|
|
10667
|
+
)
|
|
10668
|
+
);
|
|
10669
|
+
}, _temp), possibleConstructorReturn(_this, _ret);
|
|
10670
|
+
}
|
|
10671
|
+
|
|
10672
|
+
createClass(DeckContent, [{
|
|
10673
|
+
key: 'componentDidUpdate',
|
|
10674
|
+
value: function componentDidUpdate(prevProps, prevState) {
|
|
10675
|
+
if (this.state.dataKeptToCompareNewDatarecord !== this.props.dataRecord) {
|
|
10676
|
+
// eslint-disable-next-line react/no-did-update-set-state
|
|
10677
|
+
this.setState({
|
|
10678
|
+
data: this.props.dataRecord,
|
|
10679
|
+
dataKeptToCompareNewDatarecord: this.props.dataRecord,
|
|
10680
|
+
per: this.props.params ? this.props.params.to : 2,
|
|
10681
|
+
page: 1,
|
|
10682
|
+
from: this.props.params ? this.props.params.from : 0,
|
|
10683
|
+
to: this.props.params ? this.props.params.to : 2,
|
|
10684
|
+
total_pages: null,
|
|
10685
|
+
scrolling: true,
|
|
10686
|
+
query: this.props.query
|
|
10687
|
+
});
|
|
10688
|
+
}
|
|
10689
|
+
}
|
|
10690
|
+
}, {
|
|
10691
|
+
key: 'componentDidMount',
|
|
10692
|
+
value: function componentDidMount() {
|
|
10693
|
+
// this.loadData();
|
|
10694
|
+
}
|
|
10695
|
+
}, {
|
|
10696
|
+
key: 'render',
|
|
10697
|
+
value: function render() {
|
|
10698
|
+
var _this2 = this;
|
|
10699
|
+
|
|
10700
|
+
var _props = this.props,
|
|
10701
|
+
columns = _props.columns,
|
|
10702
|
+
variant = _props.variant,
|
|
10703
|
+
autoScroll = _props.autoScroll,
|
|
10704
|
+
page = _props.page;
|
|
10705
|
+
|
|
10706
|
+
|
|
10707
|
+
return React__default.createElement(
|
|
10708
|
+
'div',
|
|
10709
|
+
{ className: 'contentDeck' },
|
|
10710
|
+
autoScroll ? React__default.createElement(
|
|
10711
|
+
React__default.Fragment,
|
|
10712
|
+
null,
|
|
10713
|
+
React__default.createElement(
|
|
10714
|
+
InfiniteScroll,
|
|
10715
|
+
{ dataLength: this.state.data.length, next: this.loadMore, hasMore: this.state.scrolling, scrollThreshold: 0.9 },
|
|
10716
|
+
React__default.createElement(
|
|
10717
|
+
Container,
|
|
10718
|
+
null,
|
|
10719
|
+
this.cardLoader(page, columns, variant)
|
|
10720
|
+
)
|
|
10721
|
+
),
|
|
10722
|
+
React__default.createElement(
|
|
10723
|
+
'noscript',
|
|
10724
|
+
null,
|
|
10725
|
+
this.renderManualPagination()
|
|
10726
|
+
)
|
|
10727
|
+
) : React__default.createElement(
|
|
10728
|
+
React__default.Fragment,
|
|
10729
|
+
null,
|
|
10730
|
+
React__default.createElement(
|
|
10731
|
+
Container,
|
|
10732
|
+
null,
|
|
10733
|
+
this.cardLoader(page, columns, variant)
|
|
10734
|
+
),
|
|
10735
|
+
React__default.createElement(
|
|
10736
|
+
'div',
|
|
10737
|
+
{ style: { padding: '0px 10px' } },
|
|
10738
|
+
this.state.scrolling ? React__default.createElement(
|
|
10739
|
+
'button',
|
|
10740
|
+
{
|
|
10741
|
+
style: { margin: 'auto', width: '100%' },
|
|
10742
|
+
onClick: function onClick(e) {
|
|
10743
|
+
_this2.loadMore();
|
|
10744
|
+
} },
|
|
10745
|
+
'Load More'
|
|
10746
|
+
) : React__default.createElement(
|
|
10747
|
+
'p',
|
|
10748
|
+
{ style: { textAlign: 'center' } },
|
|
10749
|
+
React__default.createElement(
|
|
10750
|
+
'b',
|
|
10751
|
+
null,
|
|
10752
|
+
'End of data'
|
|
10753
|
+
)
|
|
10754
|
+
)
|
|
10755
|
+
),
|
|
10756
|
+
React__default.createElement(
|
|
10757
|
+
'noscript',
|
|
10758
|
+
null,
|
|
10759
|
+
this.renderManualPagination()
|
|
10760
|
+
)
|
|
10761
|
+
)
|
|
10762
|
+
);
|
|
10763
|
+
}
|
|
10764
|
+
}]);
|
|
10765
|
+
return DeckContent;
|
|
10766
|
+
}(React__default.Component);
|
|
10767
|
+
|
|
10768
|
+
var ContentCard = withRouter(DeckContent);
|
|
10273
10769
|
|
|
10274
10770
|
/**
|
|
10275
10771
|
* Checks if `value` is classified as an `Array` object.
|
|
@@ -11553,7 +12049,7 @@ var GridContent = function (_React$Component) {
|
|
|
11553
12049
|
React__default.createElement(
|
|
11554
12050
|
Card.Text,
|
|
11555
12051
|
null,
|
|
11556
|
-
row.summary
|
|
12052
|
+
clean_html_1(row.summary)
|
|
11557
12053
|
)
|
|
11558
12054
|
)
|
|
11559
12055
|
)
|
|
@@ -11623,7 +12119,7 @@ var GridContent = function (_React$Component) {
|
|
|
11623
12119
|
React__default.createElement(
|
|
11624
12120
|
Card.Text,
|
|
11625
12121
|
{ className: index$$1 === 0 || index$$1 % 4 === 0 ? '' : 'card-subtext' },
|
|
11626
|
-
row.summary
|
|
12122
|
+
clean_html_1(row.summary)
|
|
11627
12123
|
)
|
|
11628
12124
|
)
|
|
11629
12125
|
)
|
|
@@ -11692,7 +12188,7 @@ var GridContent = function (_React$Component) {
|
|
|
11692
12188
|
React__default.createElement(
|
|
11693
12189
|
Card.Text,
|
|
11694
12190
|
{ className: index$$1 === 0 || index$$1 % 4 === 0 ? '' : 'card-subtext' },
|
|
11695
|
-
row.summary
|
|
12191
|
+
clean_html_1(row.summary)
|
|
11696
12192
|
)
|
|
11697
12193
|
)
|
|
11698
12194
|
)
|
|
@@ -11762,7 +12258,7 @@ var GridContent = function (_React$Component) {
|
|
|
11762
12258
|
React__default.createElement(
|
|
11763
12259
|
Card.Text,
|
|
11764
12260
|
{ className: index$$1 === 0 || index$$1 % 4 === 0 ? '' : 'card-subtext' },
|
|
11765
|
-
row.summary
|
|
12261
|
+
clean_html_1(row.summary)
|
|
11766
12262
|
)
|
|
11767
12263
|
)
|
|
11768
12264
|
)
|
|
@@ -12099,7 +12595,7 @@ var DeckQueue = function (_React$Component) {
|
|
|
12099
12595
|
React__default.createElement(
|
|
12100
12596
|
Link,
|
|
12101
12597
|
{ href: _this2.page + '/[url]', as: _this2.page + '/' + get_1(row, 'url.current') },
|
|
12102
|
-
row.summary
|
|
12598
|
+
clean_html_1(row.summary)
|
|
12103
12599
|
)
|
|
12104
12600
|
)
|
|
12105
12601
|
)
|
|
@@ -12214,7 +12710,7 @@ var ThumbnailCard = function ThumbnailCard(_ref) {
|
|
|
12214
12710
|
React__default.createElement(
|
|
12215
12711
|
'p',
|
|
12216
12712
|
null,
|
|
12217
|
-
item.summary
|
|
12713
|
+
clean_html_1(item.summary)
|
|
12218
12714
|
)
|
|
12219
12715
|
)
|
|
12220
12716
|
);
|
|
@@ -12314,7 +12810,7 @@ var TaxonomyCard = function TaxonomyCard(props) {
|
|
|
12314
12810
|
React__default.createElement(
|
|
12315
12811
|
Card.Text,
|
|
12316
12812
|
null,
|
|
12317
|
-
row.summary
|
|
12813
|
+
clean_html_1(row.summary)
|
|
12318
12814
|
)
|
|
12319
12815
|
)
|
|
12320
12816
|
),
|
|
@@ -12917,7 +13413,7 @@ var cardLoader = function cardLoader(data, builder, mapping, values, seoPaginate
|
|
|
12917
13413
|
article.summary && React__default.createElement(
|
|
12918
13414
|
'p',
|
|
12919
13415
|
{ className: 'pt-2 card-text' },
|
|
12920
|
-
article.summary
|
|
13416
|
+
clean_html_1(article.summary)
|
|
12921
13417
|
)
|
|
12922
13418
|
)
|
|
12923
13419
|
)
|
|
@@ -12998,7 +13494,7 @@ var cardLoader = function cardLoader(data, builder, mapping, values, seoPaginate
|
|
|
12998
13494
|
article.summary && React__default.createElement(
|
|
12999
13495
|
'p',
|
|
13000
13496
|
{ className: 'pt-2 card-text' },
|
|
13001
|
-
article.summary
|
|
13497
|
+
clean_html_1(article.summary)
|
|
13002
13498
|
)
|
|
13003
13499
|
)
|
|
13004
13500
|
)
|
|
@@ -13080,7 +13576,7 @@ var cardLoader = function cardLoader(data, builder, mapping, values, seoPaginate
|
|
|
13080
13576
|
article.summary && React__default.createElement(
|
|
13081
13577
|
'p',
|
|
13082
13578
|
{ className: 'pt-2 card-text' },
|
|
13083
|
-
article.summary
|
|
13579
|
+
clean_html_1(article.summary)
|
|
13084
13580
|
)
|
|
13085
13581
|
)
|
|
13086
13582
|
)
|
|
@@ -27635,792 +28131,533 @@ var ReactPlayer = /*#__PURE__*/function (_Component) {
|
|
|
27635
28131
|
light: light,
|
|
27636
28132
|
playIcon: playIcon,
|
|
27637
28133
|
onClick: this.handleClickPreview
|
|
27638
|
-
});
|
|
27639
|
-
|
|
27640
|
-
return /*#__PURE__*/_react["default"].createElement(Wrapper, _extends({
|
|
27641
|
-
ref: this.wrapperRef,
|
|
27642
|
-
style: _objectSpread({}, style, {
|
|
27643
|
-
width: width,
|
|
27644
|
-
height: height
|
|
27645
|
-
})
|
|
27646
|
-
}, otherProps), showPreview ? preview : players$$1);
|
|
27647
|
-
}
|
|
27648
|
-
}]);
|
|
27649
|
-
|
|
27650
|
-
return ReactPlayer;
|
|
27651
|
-
}(_react.Component);
|
|
27652
|
-
|
|
27653
|
-
exports["default"] = ReactPlayer;
|
|
27654
|
-
|
|
27655
|
-
_defineProperty(ReactPlayer, "addCustomPlayer", function (player) {
|
|
27656
|
-
customPlayers.push(player);
|
|
27657
|
-
});
|
|
27658
|
-
|
|
27659
|
-
_defineProperty(ReactPlayer, "removeCustomPlayers", function () {
|
|
27660
|
-
customPlayers = [];
|
|
27661
|
-
});
|
|
27662
|
-
|
|
27663
|
-
_defineProperty(ReactPlayer, "displayName", 'ReactPlayer');
|
|
27664
|
-
|
|
27665
|
-
_defineProperty(ReactPlayer, "propTypes", props.propTypes);
|
|
27666
|
-
|
|
27667
|
-
_defineProperty(ReactPlayer, "defaultProps", props.defaultProps);
|
|
27668
|
-
|
|
27669
|
-
_defineProperty(ReactPlayer, "canPlay", function (url) {
|
|
27670
|
-
for (var _i2 = 0, _arr2 = [].concat(_toConsumableArray(customPlayers), _toConsumableArray(_players["default"])); _i2 < _arr2.length; _i2++) {
|
|
27671
|
-
var _Player2 = _arr2[_i2];
|
|
27672
|
-
|
|
27673
|
-
if (_Player2.canPlay(url)) {
|
|
27674
|
-
return true;
|
|
27675
|
-
}
|
|
27676
|
-
}
|
|
27677
|
-
|
|
27678
|
-
return false;
|
|
27679
|
-
});
|
|
27680
|
-
|
|
27681
|
-
_defineProperty(ReactPlayer, "canEnablePIP", function (url) {
|
|
27682
|
-
for (var _i3 = 0, _arr3 = [].concat(_toConsumableArray(customPlayers), _toConsumableArray(_players["default"])); _i3 < _arr3.length; _i3++) {
|
|
27683
|
-
var _Player3 = _arr3[_i3];
|
|
27684
|
-
|
|
27685
|
-
if (_Player3.canEnablePIP && _Player3.canEnablePIP(url)) {
|
|
27686
|
-
return true;
|
|
27687
|
-
}
|
|
27688
|
-
}
|
|
27689
|
-
|
|
27690
|
-
return false;
|
|
27691
|
-
});
|
|
27692
|
-
});
|
|
27693
|
-
|
|
27694
|
-
var ReactPlayer = unwrapExports(ReactPlayer_1);
|
|
27695
|
-
|
|
27696
|
-
var Audio = function Audio(_ref) {
|
|
27697
|
-
var node = _ref.node;
|
|
27698
|
-
|
|
27699
|
-
if (node.uploadAudio) {
|
|
27700
|
-
return React__default.createElement(
|
|
27701
|
-
'div',
|
|
27702
|
-
{ className: 'audio d-block text-center mb-3' },
|
|
27703
|
-
React__default.createElement(
|
|
27704
|
-
'audio',
|
|
27705
|
-
{ controls: true, controlsList: 'nodownload', className: 'audio' },
|
|
27706
|
-
React__default.createElement('source', { src: node.uploadAudio.asset.url, type: 'audio/ogg' }),
|
|
27707
|
-
React__default.createElement('source', { src: node.uploadAudio.asset.url, type: 'audio/mpeg' }),
|
|
27708
|
-
'Your browser does not support the audio element.'
|
|
27709
|
-
)
|
|
27710
|
-
);
|
|
27711
|
-
} else if (node.audioFilePth) {
|
|
27712
|
-
var hostname = new URL(node.audioFilePth).hostname;
|
|
27713
|
-
if (hostname === 'embeds.audioboom.com') {
|
|
27714
|
-
return React__default.createElement('iframe', { src: node.audioFilePth, width: '100%', height: '300', className: 'audio', style: { border: 'none' } });
|
|
27715
|
-
}
|
|
27716
|
-
return React__default.createElement(
|
|
27717
|
-
'div',
|
|
27718
|
-
{ className: 'audio' },
|
|
27719
|
-
React__default.createElement(ReactPlayer, { url: node.audioFilePth, controls: true, width: '100%', height: '100%' })
|
|
27720
|
-
);
|
|
27721
|
-
}
|
|
27722
|
-
|
|
27723
|
-
return null;
|
|
27724
|
-
};
|
|
27725
|
-
|
|
27726
|
-
var YouTubeGallery = function YouTubeGallery(_ref) {
|
|
27727
|
-
var nodes = _ref.nodes,
|
|
27728
|
-
client = _ref.client;
|
|
27729
|
-
|
|
27730
|
-
var router = useRouter();
|
|
27731
|
-
//state
|
|
27732
|
-
|
|
27733
|
-
var _useState = useState(''),
|
|
27734
|
-
_useState2 = slicedToArray(_useState, 2),
|
|
27735
|
-
vidUrl = _useState2[0],
|
|
27736
|
-
setVidUrl = _useState2[1];
|
|
27737
|
-
|
|
27738
|
-
var _useState3 = useState(''),
|
|
27739
|
-
_useState4 = slicedToArray(_useState3, 2),
|
|
27740
|
-
series = _useState4[0],
|
|
27741
|
-
setSeries = _useState4[1];
|
|
27742
|
-
|
|
27743
|
-
var _useState5 = useState([]),
|
|
27744
|
-
_useState6 = slicedToArray(_useState5, 2),
|
|
27745
|
-
seriesData = _useState6[0],
|
|
27746
|
-
setData = _useState6[1];
|
|
27747
|
-
//variables
|
|
27748
|
-
|
|
27749
|
-
|
|
27750
|
-
var get2 = router && router.asPath ? router.asPath.split('/')[1] : '';
|
|
27751
|
-
var get3 = router && router.asPath ? router.asPath.split('/')[2].split('?')[0] : '';
|
|
27752
|
-
|
|
27753
|
-
// Once component mounts, set the variables
|
|
27754
|
-
useEffect(function () {
|
|
27755
|
-
var params = new URL(document.location).searchParams;
|
|
27756
|
-
var seriesVid = params.get('seriesVid') || 1;
|
|
27757
|
-
var data = [];
|
|
27758
|
-
nodes.videos.forEach(function (vid) {
|
|
27759
|
-
data.push({ title: vid.title, thumbnail: 'http://img.youtube.com/vi/' + getYoutubeId(vid.url) + '/hqdefault.jpg', url: vid.url });
|
|
27760
|
-
});
|
|
27761
|
-
// if series number doesn't exist, route back to first vid of series
|
|
27762
|
-
if (data.length < seriesVid) {
|
|
27763
|
-
setSeries(1);
|
|
27764
|
-
setVidUrl(nodes.videos[0].url);
|
|
27765
|
-
var newPath = '/' + get2 + '/' + get3 + '?seriesVid=1';
|
|
27766
|
-
var vidState = { vid_id: seriesVid };
|
|
27767
|
-
window.history.pushState(vidState, '', newPath);
|
|
27768
|
-
} else {
|
|
27769
|
-
setSeries(seriesVid);
|
|
27770
|
-
setVidUrl(nodes.videos[seriesVid - 1].url);
|
|
27771
|
-
}
|
|
27772
|
-
setData(data);
|
|
27773
|
-
}, []);
|
|
27774
|
-
|
|
27775
|
-
function toggleSeries() {
|
|
27776
|
-
var series = document.querySelector('.vid-series');
|
|
27777
|
-
if (series.classList.contains('active')) {
|
|
27778
|
-
series.style.bottom = '-100%';
|
|
27779
|
-
} else {
|
|
27780
|
-
series.style.bottom = '6px';
|
|
27781
|
-
}
|
|
27782
|
-
series.classList.toggle('active');
|
|
27783
|
-
}
|
|
27784
|
-
// This function is passed to the GroupDeck to change the youtube iframe src
|
|
27785
|
-
function setState(url, vidIndex) {
|
|
27786
|
-
setVidUrl(url);
|
|
27787
|
-
toggleSeries();
|
|
27788
|
-
lib_3.refresh();
|
|
27789
|
-
var newPath = '/' + get2 + '/' + get3 + ('?seriesVid=' + vidIndex);
|
|
27790
|
-
var vidState = { vid_id: vidIndex };
|
|
27791
|
-
window.history.pushState(vidState, '', newPath);
|
|
27792
|
-
setSeries(vidIndex);
|
|
27793
|
-
}
|
|
27794
|
-
|
|
27795
|
-
// Handle video end
|
|
27796
|
-
function handleOnEnd(e) {
|
|
27797
|
-
var currentVid = void 0;
|
|
27798
|
-
var nextVid = void 0;
|
|
27799
|
-
//Find index of video currently playing
|
|
27800
|
-
seriesData.forEach(function (vid, index$$1) {
|
|
27801
|
-
if (vid.url === vidUrl) {
|
|
27802
|
-
currentVid = index$$1;
|
|
27803
|
-
}
|
|
27804
|
-
});
|
|
27805
|
-
//increment +1, or if at the end of the series list, go back to the beginning
|
|
27806
|
-
if (currentVid + 1 >= seriesData.length) {
|
|
27807
|
-
nextVid = 0;
|
|
27808
|
-
} else {
|
|
27809
|
-
nextVid = currentVid + 1;
|
|
27810
|
-
}
|
|
27811
|
-
// set the new Video URL
|
|
27812
|
-
setState(nodes.videos[nextVid].url, nextVid + 1);
|
|
27813
|
-
var newPath = '/' + get2 + '/' + get3 + ('?seriesVid=' + (nextVid + 1));
|
|
27814
|
-
var vidState = { vid_id: nextVid + 1 };
|
|
27815
|
-
var title = '';
|
|
27816
|
-
window.history.pushState(vidState, title, newPath);
|
|
27817
|
-
|
|
27818
|
-
//Small pause before starting next video
|
|
27819
|
-
setTimeout(function () {
|
|
27820
|
-
//Youtube API to start video playing automatically
|
|
27821
|
-
var id = getYoutubeId(nodes.videos['' + nextVid].url);
|
|
27822
|
-
e.target.loadVideoById(id);
|
|
27823
|
-
toggleSeries();
|
|
27824
|
-
}, 1000);
|
|
27825
|
-
}
|
|
27826
|
-
// Youtube Options
|
|
27827
|
-
var opts = {
|
|
27828
|
-
width: '100%',
|
|
27829
|
-
playerVars: {
|
|
27830
|
-
rel: 0
|
|
28134
|
+
});
|
|
28135
|
+
|
|
28136
|
+
return /*#__PURE__*/_react["default"].createElement(Wrapper, _extends({
|
|
28137
|
+
ref: this.wrapperRef,
|
|
28138
|
+
style: _objectSpread({}, style, {
|
|
28139
|
+
width: width,
|
|
28140
|
+
height: height
|
|
28141
|
+
})
|
|
28142
|
+
}, otherProps), showPreview ? preview : players$$1);
|
|
27831
28143
|
}
|
|
27832
|
-
};
|
|
28144
|
+
}]);
|
|
27833
28145
|
|
|
27834
|
-
return
|
|
27835
|
-
|
|
27836
|
-
{ className: 'video-container', style: { marginBottom: '2rem' } },
|
|
27837
|
-
React__default.createElement(
|
|
27838
|
-
'div',
|
|
27839
|
-
{ className: 'video-block', style: { position: 'relative', overflow: 'hidden' } },
|
|
27840
|
-
vidUrl && React__default.createElement(YouTube, { videoId: getYoutubeId(vidUrl), opts: opts, onEnd: function onEnd(e) {
|
|
27841
|
-
return handleOnEnd(e);
|
|
27842
|
-
} }),
|
|
27843
|
-
React__default.createElement(
|
|
27844
|
-
'div',
|
|
27845
|
-
{
|
|
27846
|
-
className: 'vid-series',
|
|
27847
|
-
style: {
|
|
27848
|
-
position: 'absolute',
|
|
27849
|
-
width: '100%',
|
|
27850
|
-
height: '250px',
|
|
27851
|
-
background: 'linear-gradient(to bottom, transparent,black)',
|
|
27852
|
-
bottom: '-100%',
|
|
27853
|
-
transition: 'all .5s ease',
|
|
27854
|
-
padding: '0 1rem',
|
|
27855
|
-
left: '0'
|
|
27856
|
-
} },
|
|
27857
|
-
vidUrl && React__default.createElement(GroupDeck, { dark: true, dataset: seriesData, setState: setState, seriesVid: series, current: vidUrl })
|
|
27858
|
-
)
|
|
27859
|
-
),
|
|
27860
|
-
React__default.createElement(
|
|
27861
|
-
'div',
|
|
27862
|
-
{ className: 'vid-controls', style: { width: '100%', background: 'transparent', display: 'flex', justifyContent: 'center' } },
|
|
27863
|
-
React__default.createElement(
|
|
27864
|
-
'button',
|
|
27865
|
-
{
|
|
27866
|
-
'aria-label': 'Toggles video series',
|
|
27867
|
-
id: 'vid-series-btn',
|
|
27868
|
-
onClick: toggleSeries,
|
|
27869
|
-
className: 'btn btn-block btn-lg ',
|
|
27870
|
-
style: { borderRadius: '0', background: 'rgb(241,185,63)', color: 'white' } },
|
|
27871
|
-
'View Series'
|
|
27872
|
-
)
|
|
27873
|
-
),
|
|
27874
|
-
React__default.createElement(
|
|
27875
|
-
'div',
|
|
27876
|
-
{ className: 'my-5' },
|
|
27877
|
-
series && React__default.createElement(
|
|
27878
|
-
'h3',
|
|
27879
|
-
null,
|
|
27880
|
-
'Episode ',
|
|
27881
|
-
series
|
|
27882
|
-
),
|
|
27883
|
-
nodes.videos[series - 1] && React__default.createElement(
|
|
27884
|
-
'h2',
|
|
27885
|
-
{ className: 'mb-3' },
|
|
27886
|
-
nodes.videos[series - 1].title
|
|
27887
|
-
),
|
|
27888
|
-
nodes.videos[series - 1] && React__default.createElement(BlockContent, _extends({ serializers: getSerializers$1(client), blocks: nodes.videos[series - 1].text, imageOptions: { w: 320, h: 240, fit: 'max' } }, client.config()))
|
|
27889
|
-
),
|
|
27890
|
-
React__default.createElement(
|
|
27891
|
-
'style',
|
|
27892
|
-
{ jsx: 'true' },
|
|
27893
|
-
'\n .vid-series .video-detail iframe {\n height: 415px !important;\n }\n span.btn {\n margin: 0 1rem;\n }\n '
|
|
27894
|
-
)
|
|
27895
|
-
);
|
|
27896
|
-
};
|
|
28146
|
+
return ReactPlayer;
|
|
28147
|
+
}(_react.Component);
|
|
27897
28148
|
|
|
27898
|
-
|
|
27899
|
-
var node = _ref.node,
|
|
27900
|
-
client = _ref.client,
|
|
27901
|
-
pageview = _ref.pageview,
|
|
27902
|
-
videoAccountIDs = _ref.videoAccountIDs,
|
|
27903
|
-
onVote = _ref.onVote,
|
|
27904
|
-
_ref$showVotes = _ref.showVotes,
|
|
27905
|
-
showVotes = _ref$showVotes === undefined ? false : _ref$showVotes;
|
|
28149
|
+
exports["default"] = ReactPlayer;
|
|
27906
28150
|
|
|
27907
|
-
|
|
27908
|
-
|
|
27909
|
-
|
|
27910
|
-
setSelectedChoice = _useState2[1];
|
|
28151
|
+
_defineProperty(ReactPlayer, "addCustomPlayer", function (player) {
|
|
28152
|
+
customPlayers.push(player);
|
|
28153
|
+
});
|
|
27911
28154
|
|
|
27912
|
-
|
|
27913
|
-
|
|
27914
|
-
|
|
27915
|
-
setShowAnswer = _useState4[1];
|
|
28155
|
+
_defineProperty(ReactPlayer, "removeCustomPlayers", function () {
|
|
28156
|
+
customPlayers = [];
|
|
28157
|
+
});
|
|
27916
28158
|
|
|
27917
|
-
|
|
27918
|
-
question = node.question,
|
|
27919
|
-
response = node.response;
|
|
28159
|
+
_defineProperty(ReactPlayer, "displayName", 'ReactPlayer');
|
|
27920
28160
|
|
|
28161
|
+
_defineProperty(ReactPlayer, "propTypes", props.propTypes);
|
|
27921
28162
|
|
|
27922
|
-
|
|
27923
|
-
e.preventDefault();
|
|
27924
|
-
onVote(node._key, selectedChoice);
|
|
27925
|
-
setShowAnswer(true);
|
|
27926
|
-
};
|
|
28163
|
+
_defineProperty(ReactPlayer, "defaultProps", props.defaultProps);
|
|
27927
28164
|
|
|
27928
|
-
|
|
27929
|
-
|
|
27930
|
-
|
|
27931
|
-
|
|
27932
|
-
|
|
27933
|
-
|
|
27934
|
-
|
|
27935
|
-
|
|
27936
|
-
|
|
27937
|
-
|
|
27938
|
-
|
|
27939
|
-
|
|
27940
|
-
|
|
27941
|
-
|
|
27942
|
-
|
|
27943
|
-
|
|
27944
|
-
|
|
27945
|
-
|
|
27946
|
-
|
|
27947
|
-
|
|
27948
|
-
|
|
27949
|
-
|
|
27950
|
-
|
|
27951
|
-
|
|
27952
|
-
|
|
27953
|
-
|
|
27954
|
-
|
|
27955
|
-
|
|
27956
|
-
|
|
27957
|
-
|
|
27958
|
-
|
|
28165
|
+
_defineProperty(ReactPlayer, "canPlay", function (url) {
|
|
28166
|
+
for (var _i2 = 0, _arr2 = [].concat(_toConsumableArray(customPlayers), _toConsumableArray(_players["default"])); _i2 < _arr2.length; _i2++) {
|
|
28167
|
+
var _Player2 = _arr2[_i2];
|
|
28168
|
+
|
|
28169
|
+
if (_Player2.canPlay(url)) {
|
|
28170
|
+
return true;
|
|
28171
|
+
}
|
|
28172
|
+
}
|
|
28173
|
+
|
|
28174
|
+
return false;
|
|
28175
|
+
});
|
|
28176
|
+
|
|
28177
|
+
_defineProperty(ReactPlayer, "canEnablePIP", function (url) {
|
|
28178
|
+
for (var _i3 = 0, _arr3 = [].concat(_toConsumableArray(customPlayers), _toConsumableArray(_players["default"])); _i3 < _arr3.length; _i3++) {
|
|
28179
|
+
var _Player3 = _arr3[_i3];
|
|
28180
|
+
|
|
28181
|
+
if (_Player3.canEnablePIP && _Player3.canEnablePIP(url)) {
|
|
28182
|
+
return true;
|
|
28183
|
+
}
|
|
28184
|
+
}
|
|
28185
|
+
|
|
28186
|
+
return false;
|
|
28187
|
+
});
|
|
28188
|
+
});
|
|
28189
|
+
|
|
28190
|
+
var ReactPlayer = unwrapExports(ReactPlayer_1);
|
|
28191
|
+
|
|
28192
|
+
var Audio = function Audio(_ref) {
|
|
28193
|
+
var node = _ref.node;
|
|
28194
|
+
|
|
28195
|
+
if (node.uploadAudio) {
|
|
28196
|
+
return React__default.createElement(
|
|
28197
|
+
'div',
|
|
28198
|
+
{ className: 'audio d-block text-center mb-3' },
|
|
27959
28199
|
React__default.createElement(
|
|
27960
|
-
|
|
27961
|
-
{
|
|
27962
|
-
'
|
|
28200
|
+
'audio',
|
|
28201
|
+
{ controls: true, controlsList: 'nodownload', className: 'audio' },
|
|
28202
|
+
React__default.createElement('source', { src: node.uploadAudio.asset.url, type: 'audio/ogg' }),
|
|
28203
|
+
React__default.createElement('source', { src: node.uploadAudio.asset.url, type: 'audio/mpeg' }),
|
|
28204
|
+
'Your browser does not support the audio element.'
|
|
27963
28205
|
)
|
|
27964
|
-
)
|
|
27965
|
-
|
|
28206
|
+
);
|
|
28207
|
+
} else if (node.audioFilePth) {
|
|
28208
|
+
var hostname = new URL(node.audioFilePth).hostname;
|
|
28209
|
+
if (hostname === 'embeds.audioboom.com') {
|
|
28210
|
+
return React__default.createElement('iframe', { src: node.audioFilePth, width: '100%', height: '300', className: 'audio', style: { border: 'none' } });
|
|
28211
|
+
}
|
|
28212
|
+
return React__default.createElement(
|
|
27966
28213
|
'div',
|
|
27967
|
-
{ className: '
|
|
27968
|
-
|
|
27969
|
-
|
|
27970
|
-
|
|
27971
|
-
'div',
|
|
27972
|
-
{ key: choice._key, className: 'mb-3' },
|
|
27973
|
-
React__default.createElement(
|
|
27974
|
-
'span',
|
|
27975
|
-
null,
|
|
27976
|
-
choice.choiceText
|
|
27977
|
-
),
|
|
27978
|
-
React__default.createElement(ProgressBar, { now: percentage }),
|
|
27979
|
-
React__default.createElement(
|
|
27980
|
-
'span',
|
|
27981
|
-
{ className: 'float-right' },
|
|
27982
|
-
percentage,
|
|
27983
|
-
'% (',
|
|
27984
|
-
choice.choiceCount,
|
|
27985
|
-
' Votes)'
|
|
27986
|
-
)
|
|
27987
|
-
);
|
|
27988
|
-
})
|
|
27989
|
-
),
|
|
27990
|
-
showAnswer && React__default.createElement(
|
|
27991
|
-
'h4',
|
|
27992
|
-
{ className: 'text-center small p-3' },
|
|
27993
|
-
'Total Votes: ',
|
|
27994
|
-
choicesTotalCount
|
|
27995
|
-
),
|
|
27996
|
-
showAnswer && response && React__default.createElement(BlockContent, { blocks: response, serializers: getSerializers$1(client, pageview, videoAccountIDs) }),
|
|
27997
|
-
React__default.createElement(
|
|
27998
|
-
'style',
|
|
27999
|
-
{ jsx: 'true' },
|
|
28000
|
-
'\n .progress-bar {\n color: #fff;\n }\n '
|
|
28001
|
-
)
|
|
28002
|
-
);
|
|
28003
|
-
};
|
|
28214
|
+
{ className: 'audio' },
|
|
28215
|
+
React__default.createElement(ReactPlayer, { url: node.audioFilePth, controls: true, width: '100%', height: '100%' })
|
|
28216
|
+
);
|
|
28217
|
+
}
|
|
28004
28218
|
|
|
28005
|
-
|
|
28219
|
+
return null;
|
|
28220
|
+
};
|
|
28006
28221
|
|
|
28007
|
-
var
|
|
28008
|
-
var
|
|
28009
|
-
|
|
28222
|
+
var YouTubeGallery = function YouTubeGallery(_ref) {
|
|
28223
|
+
var nodes = _ref.nodes,
|
|
28224
|
+
client = _ref.client;
|
|
28010
28225
|
|
|
28011
|
-
var
|
|
28226
|
+
var router = useRouter();
|
|
28227
|
+
//state
|
|
28012
28228
|
|
|
28013
|
-
var _useState = useState(
|
|
28229
|
+
var _useState = useState(''),
|
|
28014
28230
|
_useState2 = slicedToArray(_useState, 2),
|
|
28015
|
-
|
|
28016
|
-
|
|
28231
|
+
vidUrl = _useState2[0],
|
|
28232
|
+
setVidUrl = _useState2[1];
|
|
28017
28233
|
|
|
28018
|
-
var _useState3 = useState(
|
|
28234
|
+
var _useState3 = useState(''),
|
|
28019
28235
|
_useState4 = slicedToArray(_useState3, 2),
|
|
28020
|
-
|
|
28021
|
-
|
|
28236
|
+
series = _useState4[0],
|
|
28237
|
+
setSeries = _useState4[1];
|
|
28022
28238
|
|
|
28023
|
-
var _useState5 = useState(
|
|
28239
|
+
var _useState5 = useState([]),
|
|
28024
28240
|
_useState6 = slicedToArray(_useState5, 2),
|
|
28025
|
-
|
|
28026
|
-
|
|
28241
|
+
seriesData = _useState6[0],
|
|
28242
|
+
setData = _useState6[1];
|
|
28243
|
+
//variables
|
|
28027
28244
|
|
|
28028
|
-
var _useState7 = useState(numberOfPaginations - 1),
|
|
28029
|
-
_useState8 = slicedToArray(_useState7, 2),
|
|
28030
|
-
endIndex = _useState8[0],
|
|
28031
|
-
setEndIndex = _useState8[1];
|
|
28032
28245
|
|
|
28033
|
-
var
|
|
28034
|
-
|
|
28035
|
-
pages = _useState10[0],
|
|
28036
|
-
setPages = _useState10[1];
|
|
28246
|
+
var get2 = router && router.asPath ? router.asPath.split('/')[1] : '';
|
|
28247
|
+
var get3 = router && router.asPath ? router.asPath.split('/')[2].split('?')[0] : '';
|
|
28037
28248
|
|
|
28249
|
+
// Once component mounts, set the variables
|
|
28038
28250
|
useEffect(function () {
|
|
28039
|
-
var
|
|
28040
|
-
|
|
28251
|
+
var params = new URL(document.location).searchParams;
|
|
28252
|
+
var seriesVid = params.get('seriesVid') || 1;
|
|
28253
|
+
var data = [];
|
|
28254
|
+
nodes.videos.forEach(function (vid) {
|
|
28255
|
+
data.push({ title: vid.title, thumbnail: 'http://img.youtube.com/vi/' + getYoutubeId(vid.url) + '/hqdefault.jpg', url: vid.url });
|
|
28041
28256
|
});
|
|
28042
|
-
|
|
28043
|
-
|
|
28044
|
-
|
|
28045
|
-
|
|
28046
|
-
|
|
28047
|
-
|
|
28048
|
-
|
|
28257
|
+
// if series number doesn't exist, route back to first vid of series
|
|
28258
|
+
if (data.length < seriesVid) {
|
|
28259
|
+
setSeries(1);
|
|
28260
|
+
setVidUrl(nodes.videos[0].url);
|
|
28261
|
+
var newPath = '/' + get2 + '/' + get3 + '?seriesVid=1';
|
|
28262
|
+
var vidState = { vid_id: seriesVid };
|
|
28263
|
+
window.history.pushState(vidState, '', newPath);
|
|
28264
|
+
} else {
|
|
28265
|
+
setSeries(seriesVid);
|
|
28266
|
+
setVidUrl(nodes.videos[seriesVid - 1].url);
|
|
28267
|
+
}
|
|
28268
|
+
setData(data);
|
|
28269
|
+
}, []);
|
|
28049
28270
|
|
|
28050
|
-
|
|
28051
|
-
|
|
28052
|
-
|
|
28053
|
-
|
|
28054
|
-
|
|
28055
|
-
|
|
28056
|
-
setEndIndex(numberOfPaginations - 1);
|
|
28057
|
-
break;
|
|
28058
|
-
case 'last':
|
|
28059
|
-
setCurrentPage(pageCount);
|
|
28060
|
-
setStartIndex(pageCount - pageCount % numberOfPaginations);
|
|
28061
|
-
setEndIndex(pageCount - pageCount % numberOfPaginations + numberOfPaginations - 1);
|
|
28062
|
-
break;
|
|
28063
|
-
case 'next':
|
|
28064
|
-
setCurrentPage(currentPage + 1);
|
|
28065
|
-
if (currentPage % numberOfPaginations === 0) {
|
|
28066
|
-
setStartIndex(startIndex + numberOfPaginations);
|
|
28067
|
-
setEndIndex(endIndex + numberOfPaginations);
|
|
28068
|
-
}
|
|
28069
|
-
break;
|
|
28070
|
-
case 'prev':
|
|
28071
|
-
setCurrentPage(currentPage - 1);
|
|
28072
|
-
if (currentPage % numberOfPaginations === 1) {
|
|
28073
|
-
setStartIndex(startIndex - numberOfPaginations);
|
|
28074
|
-
setEndIndex(endIndex - numberOfPaginations);
|
|
28075
|
-
}
|
|
28076
|
-
break;
|
|
28077
|
-
default:
|
|
28078
|
-
setCurrentPage(control);
|
|
28271
|
+
function toggleSeries() {
|
|
28272
|
+
var series = document.querySelector('.vid-series');
|
|
28273
|
+
if (series.classList.contains('active')) {
|
|
28274
|
+
series.style.bottom = '-100%';
|
|
28275
|
+
} else {
|
|
28276
|
+
series.style.bottom = '6px';
|
|
28079
28277
|
}
|
|
28080
|
-
|
|
28278
|
+
series.classList.toggle('active');
|
|
28279
|
+
}
|
|
28280
|
+
// This function is passed to the GroupDeck to change the youtube iframe src
|
|
28281
|
+
function setState(url, vidIndex) {
|
|
28282
|
+
setVidUrl(url);
|
|
28283
|
+
toggleSeries();
|
|
28284
|
+
lib_3.refresh();
|
|
28285
|
+
var newPath = '/' + get2 + '/' + get3 + ('?seriesVid=' + vidIndex);
|
|
28286
|
+
var vidState = { vid_id: vidIndex };
|
|
28287
|
+
window.history.pushState(vidState, '', newPath);
|
|
28288
|
+
setSeries(vidIndex);
|
|
28289
|
+
}
|
|
28081
28290
|
|
|
28082
|
-
|
|
28083
|
-
|
|
28084
|
-
|
|
28085
|
-
|
|
28086
|
-
|
|
28087
|
-
|
|
28088
|
-
|
|
28291
|
+
// Handle video end
|
|
28292
|
+
function handleOnEnd(e) {
|
|
28293
|
+
var currentVid = void 0;
|
|
28294
|
+
var nextVid = void 0;
|
|
28295
|
+
//Find index of video currently playing
|
|
28296
|
+
seriesData.forEach(function (vid, index$$1) {
|
|
28297
|
+
if (vid.url === vidUrl) {
|
|
28298
|
+
currentVid = index$$1;
|
|
28299
|
+
}
|
|
28300
|
+
});
|
|
28301
|
+
//increment +1, or if at the end of the series list, go back to the beginning
|
|
28302
|
+
if (currentVid + 1 >= seriesData.length) {
|
|
28303
|
+
nextVid = 0;
|
|
28304
|
+
} else {
|
|
28305
|
+
nextVid = currentVid + 1;
|
|
28089
28306
|
}
|
|
28090
|
-
|
|
28307
|
+
// set the new Video URL
|
|
28308
|
+
setState(nodes.videos[nextVid].url, nextVid + 1);
|
|
28309
|
+
var newPath = '/' + get2 + '/' + get3 + ('?seriesVid=' + (nextVid + 1));
|
|
28310
|
+
var vidState = { vid_id: nextVid + 1 };
|
|
28311
|
+
var title = '';
|
|
28312
|
+
window.history.pushState(vidState, title, newPath);
|
|
28091
28313
|
|
|
28092
|
-
|
|
28093
|
-
|
|
28094
|
-
|
|
28095
|
-
|
|
28096
|
-
|
|
28097
|
-
|
|
28098
|
-
|
|
28099
|
-
|
|
28100
|
-
|
|
28101
|
-
|
|
28102
|
-
|
|
28103
|
-
|
|
28104
|
-
|
|
28105
|
-
|
|
28106
|
-
return React__default.createElement(
|
|
28107
|
-
Pagination.Item,
|
|
28108
|
-
{ key: page, active: page === currentPage, onClick: function onClick() {
|
|
28109
|
-
return changePage(page);
|
|
28110
|
-
} },
|
|
28111
|
-
page
|
|
28112
|
-
);
|
|
28113
|
-
}),
|
|
28114
|
-
React__default.createElement(Pagination.Ellipsis, { onClick: function onClick() {
|
|
28115
|
-
return renderNewPages('next');
|
|
28116
|
-
}, disabled: !validateIndex(startIndex + numberOfPaginations) }),
|
|
28117
|
-
React__default.createElement(Pagination.Next, { onClick: function onClick() {
|
|
28118
|
-
return changePage('next');
|
|
28119
|
-
}, disabled: currentPage === pageCount }),
|
|
28120
|
-
React__default.createElement(Pagination.Last, { onClick: function onClick() {
|
|
28121
|
-
return changePage('last');
|
|
28122
|
-
}, disabled: currentPage === pageCount })
|
|
28123
|
-
);
|
|
28314
|
+
//Small pause before starting next video
|
|
28315
|
+
setTimeout(function () {
|
|
28316
|
+
//Youtube API to start video playing automatically
|
|
28317
|
+
var id = getYoutubeId(nodes.videos['' + nextVid].url);
|
|
28318
|
+
e.target.loadVideoById(id);
|
|
28319
|
+
toggleSeries();
|
|
28320
|
+
}, 1000);
|
|
28321
|
+
}
|
|
28322
|
+
// Youtube Options
|
|
28323
|
+
var opts = {
|
|
28324
|
+
width: '100%',
|
|
28325
|
+
playerVars: {
|
|
28326
|
+
rel: 0
|
|
28327
|
+
}
|
|
28124
28328
|
};
|
|
28125
28329
|
|
|
28126
28330
|
return React__default.createElement(
|
|
28127
|
-
|
|
28128
|
-
|
|
28129
|
-
|
|
28130
|
-
|
|
28131
|
-
|
|
28132
|
-
{
|
|
28133
|
-
return
|
|
28134
|
-
}
|
|
28135
|
-
|
|
28331
|
+
'div',
|
|
28332
|
+
{ className: 'video-container', style: { marginBottom: '2rem' } },
|
|
28333
|
+
React__default.createElement(
|
|
28334
|
+
'div',
|
|
28335
|
+
{ className: 'video-block', style: { position: 'relative', overflow: 'hidden' } },
|
|
28336
|
+
vidUrl && React__default.createElement(YouTube, { videoId: getYoutubeId(vidUrl), opts: opts, onEnd: function onEnd(e) {
|
|
28337
|
+
return handleOnEnd(e);
|
|
28338
|
+
} }),
|
|
28339
|
+
React__default.createElement(
|
|
28340
|
+
'div',
|
|
28341
|
+
{
|
|
28342
|
+
className: 'vid-series',
|
|
28343
|
+
style: {
|
|
28344
|
+
position: 'absolute',
|
|
28345
|
+
width: '100%',
|
|
28346
|
+
height: '250px',
|
|
28347
|
+
background: 'linear-gradient(to bottom, transparent,black)',
|
|
28348
|
+
bottom: '-100%',
|
|
28349
|
+
transition: 'all .5s ease',
|
|
28350
|
+
padding: '0 1rem',
|
|
28351
|
+
left: '0'
|
|
28352
|
+
} },
|
|
28353
|
+
vidUrl && React__default.createElement(GroupDeck, { dark: true, dataset: seriesData, setState: setState, seriesVid: series, current: vidUrl })
|
|
28354
|
+
)
|
|
28136
28355
|
),
|
|
28137
|
-
|
|
28138
|
-
|
|
28139
|
-
|
|
28356
|
+
React__default.createElement(
|
|
28357
|
+
'div',
|
|
28358
|
+
{ className: 'vid-controls', style: { width: '100%', background: 'transparent', display: 'flex', justifyContent: 'center' } },
|
|
28140
28359
|
React__default.createElement(
|
|
28141
|
-
'
|
|
28360
|
+
'button',
|
|
28361
|
+
{
|
|
28362
|
+
'aria-label': 'Toggles video series',
|
|
28363
|
+
id: 'vid-series-btn',
|
|
28364
|
+
onClick: toggleSeries,
|
|
28365
|
+
className: 'btn btn-block btn-lg ',
|
|
28366
|
+
style: { borderRadius: '0', background: 'rgb(241,185,63)', color: 'white' } },
|
|
28367
|
+
'View Series'
|
|
28368
|
+
)
|
|
28369
|
+
),
|
|
28370
|
+
React__default.createElement(
|
|
28371
|
+
'div',
|
|
28372
|
+
{ className: 'my-5' },
|
|
28373
|
+
series && React__default.createElement(
|
|
28374
|
+
'h3',
|
|
28142
28375
|
null,
|
|
28143
|
-
'
|
|
28376
|
+
'Episode ',
|
|
28377
|
+
series
|
|
28144
28378
|
),
|
|
28145
|
-
|
|
28379
|
+
nodes.videos[series - 1] && React__default.createElement(
|
|
28380
|
+
'h2',
|
|
28381
|
+
{ className: 'mb-3' },
|
|
28382
|
+
nodes.videos[series - 1].title
|
|
28383
|
+
),
|
|
28384
|
+
nodes.videos[series - 1] && React__default.createElement(BlockContent, _extends({ serializers: getSerializers$1(client), blocks: nodes.videos[series - 1].text, imageOptions: { w: 320, h: 240, fit: 'max' } }, client.config()))
|
|
28146
28385
|
),
|
|
28147
|
-
React__default.createElement(
|
|
28148
|
-
|
|
28149
|
-
'
|
|
28150
|
-
{
|
|
28151
|
-
renderPagination()
|
|
28386
|
+
React__default.createElement(
|
|
28387
|
+
'style',
|
|
28388
|
+
{ jsx: 'true' },
|
|
28389
|
+
'\n .vid-series .video-detail iframe {\n height: 415px !important;\n }\n span.btn {\n margin: 0 1rem;\n }\n '
|
|
28152
28390
|
)
|
|
28153
28391
|
);
|
|
28154
28392
|
};
|
|
28155
28393
|
|
|
28156
|
-
var
|
|
28157
|
-
var
|
|
28158
|
-
|
|
28159
|
-
|
|
28160
|
-
|
|
28161
|
-
|
|
28162
|
-
|
|
28163
|
-
|
|
28164
|
-
};
|
|
28394
|
+
var Poll = function Poll(_ref) {
|
|
28395
|
+
var node = _ref.node,
|
|
28396
|
+
client = _ref.client,
|
|
28397
|
+
pageview = _ref.pageview,
|
|
28398
|
+
videoAccountIDs = _ref.videoAccountIDs,
|
|
28399
|
+
onVote = _ref.onVote,
|
|
28400
|
+
_ref$showVotes = _ref.showVotes,
|
|
28401
|
+
showVotes = _ref$showVotes === undefined ? false : _ref$showVotes;
|
|
28165
28402
|
|
|
28166
|
-
var
|
|
28167
|
-
|
|
28168
|
-
|
|
28169
|
-
|
|
28170
|
-
|
|
28171
|
-
|
|
28172
|
-
|
|
28173
|
-
|
|
28174
|
-
|
|
28175
|
-
|
|
28176
|
-
|
|
28177
|
-
|
|
28178
|
-
|
|
28179
|
-
|
|
28180
|
-
|
|
28181
|
-
|
|
28182
|
-
|
|
28183
|
-
|
|
28184
|
-
|
|
28185
|
-
|
|
28186
|
-
|
|
28187
|
-
|
|
28188
|
-
|
|
28189
|
-
|
|
28190
|
-
|
|
28191
|
-
|
|
28192
|
-
|
|
28193
|
-
|
|
28194
|
-
|
|
28195
|
-
|
|
28196
|
-
|
|
28197
|
-
|
|
28198
|
-
|
|
28199
|
-
|
|
28200
|
-
|
|
28201
|
-
|
|
28202
|
-
|
|
28203
|
-
|
|
28204
|
-
|
|
28205
|
-
|
|
28206
|
-
|
|
28207
|
-
|
|
28208
|
-
|
|
28209
|
-
|
|
28210
|
-
|
|
28211
|
-
|
|
28212
|
-
|
|
28213
|
-
|
|
28214
|
-
|
|
28215
|
-
|
|
28216
|
-
|
|
28217
|
-
|
|
28218
|
-
|
|
28219
|
-
|
|
28220
|
-
|
|
28221
|
-
|
|
28222
|
-
|
|
28223
|
-
|
|
28224
|
-
|
|
28225
|
-
|
|
28226
|
-
|
|
28227
|
-
|
|
28228
|
-
|
|
28229
|
-
|
|
28230
|
-
|
|
28231
|
-
|
|
28232
|
-
|
|
28233
|
-
|
|
28234
|
-
|
|
28235
|
-
|
|
28236
|
-
|
|
28237
|
-
|
|
28238
|
-
|
|
28239
|
-
|
|
28240
|
-
|
|
28241
|
-
|
|
28242
|
-
|
|
28243
|
-
|
|
28244
|
-
|
|
28245
|
-
|
|
28246
|
-
|
|
28247
|
-
|
|
28248
|
-
|
|
28249
|
-
|
|
28250
|
-
|
|
28251
|
-
|
|
28252
|
-
|
|
28253
|
-
|
|
28254
|
-
|
|
28255
|
-
|
|
28256
|
-
|
|
28257
|
-
|
|
28258
|
-
|
|
28259
|
-
|
|
28260
|
-
|
|
28261
|
-
|
|
28262
|
-
"ý": "ý",
|
|
28263
|
-
"þ": "þ",
|
|
28264
|
-
"ÿ": "ÿ",
|
|
28265
|
-
"Œ": "Œ",
|
|
28266
|
-
"œ": "œ",
|
|
28267
|
-
"Š": "Š",
|
|
28268
|
-
"š": "š",
|
|
28269
|
-
"Ÿ": "Ÿ",
|
|
28270
|
-
"ƒ": "ƒ",
|
|
28271
|
-
"ˆ": "ˆ",
|
|
28272
|
-
"˜": "˜",
|
|
28273
|
-
"Α": "Α",
|
|
28274
|
-
"Β": "Β",
|
|
28275
|
-
"Γ": "Γ",
|
|
28276
|
-
"Δ": "Δ",
|
|
28277
|
-
"Ε": "Ε",
|
|
28278
|
-
"Ζ": "Ζ",
|
|
28279
|
-
"Η": "Η",
|
|
28280
|
-
"Θ": "Θ",
|
|
28281
|
-
"Ι": "Ι",
|
|
28282
|
-
"Κ": "Κ",
|
|
28283
|
-
"Λ": "Λ",
|
|
28284
|
-
"Μ": "Μ",
|
|
28285
|
-
"Ν": "Ν",
|
|
28286
|
-
"Ξ": "Ξ",
|
|
28287
|
-
"Ο": "Ο",
|
|
28288
|
-
"Π": "Π",
|
|
28289
|
-
"Ρ": "Ρ",
|
|
28290
|
-
"Σ": "Σ",
|
|
28291
|
-
"Τ": "Τ",
|
|
28292
|
-
"Υ": "Υ",
|
|
28293
|
-
"Φ": "Φ",
|
|
28294
|
-
"Χ": "Χ",
|
|
28295
|
-
"Ψ": "Ψ",
|
|
28296
|
-
"Ω": "Ω",
|
|
28297
|
-
"α": "α",
|
|
28298
|
-
"β": "β",
|
|
28299
|
-
"γ": "γ",
|
|
28300
|
-
"δ": "δ",
|
|
28301
|
-
"ε": "ε",
|
|
28302
|
-
"ζ": "ζ",
|
|
28303
|
-
"η": "η",
|
|
28304
|
-
"θ": "θ",
|
|
28305
|
-
"ι": "ι",
|
|
28306
|
-
"κ": "κ",
|
|
28307
|
-
"λ": "λ",
|
|
28308
|
-
"μ": "μ",
|
|
28309
|
-
"ν": "ν",
|
|
28310
|
-
"ξ": "ξ",
|
|
28311
|
-
"ο": "ο",
|
|
28312
|
-
"π": "π",
|
|
28313
|
-
"ρ": "ρ",
|
|
28314
|
-
"ς": "ς",
|
|
28315
|
-
"σ": "σ",
|
|
28316
|
-
"τ": "τ",
|
|
28317
|
-
"υ": "υ",
|
|
28318
|
-
"φ": "φ",
|
|
28319
|
-
"χ": "χ",
|
|
28320
|
-
"ψ": "ψ",
|
|
28321
|
-
"ω": "ω",
|
|
28322
|
-
"ϑ": "ϑ",
|
|
28323
|
-
"ϒ": "&Upsih;",
|
|
28324
|
-
"ϖ": "ϖ",
|
|
28325
|
-
"–": "–",
|
|
28326
|
-
"—": "—",
|
|
28327
|
-
"‘": "‘",
|
|
28328
|
-
"’": "’",
|
|
28329
|
-
"‚": "‚",
|
|
28330
|
-
"“": "“",
|
|
28331
|
-
"”": "”",
|
|
28332
|
-
"„": "„",
|
|
28333
|
-
"†": "†",
|
|
28334
|
-
"‡": "‡",
|
|
28335
|
-
"•": "•",
|
|
28336
|
-
"…": "…",
|
|
28337
|
-
"‰": "‰",
|
|
28338
|
-
"′": "′",
|
|
28339
|
-
"″": "″",
|
|
28340
|
-
"‹": "‹",
|
|
28341
|
-
"›": "›",
|
|
28342
|
-
"‾": "‾",
|
|
28343
|
-
"⁄": "⁄",
|
|
28344
|
-
"€": "€",
|
|
28345
|
-
"ℑ": "ℑ",
|
|
28346
|
-
"℘": "℘",
|
|
28347
|
-
"ℜ": "ℜ",
|
|
28348
|
-
"™": "™",
|
|
28349
|
-
"ℵ": "ℵ",
|
|
28350
|
-
"←": "←",
|
|
28351
|
-
"↑": "↑",
|
|
28352
|
-
"→": "→",
|
|
28353
|
-
"↓": "↓",
|
|
28354
|
-
"↔": "↔",
|
|
28355
|
-
"↵": "↵",
|
|
28356
|
-
"⇐": "⇐",
|
|
28357
|
-
"⇑": "&UArr;",
|
|
28358
|
-
"⇒": "⇒",
|
|
28359
|
-
"⇓": "⇓",
|
|
28360
|
-
"⇔": "⇔",
|
|
28361
|
-
"∀": "∀",
|
|
28362
|
-
"∂": "∂",
|
|
28363
|
-
"∃": "∃",
|
|
28364
|
-
"∅": "∅",
|
|
28365
|
-
"∇": "∇",
|
|
28366
|
-
"∈": "∈",
|
|
28367
|
-
"∉": "∉",
|
|
28368
|
-
"∋": "∋",
|
|
28369
|
-
"∏": "∏",
|
|
28370
|
-
"∑": "∑",
|
|
28371
|
-
"−": "−",
|
|
28372
|
-
"∗": "∗",
|
|
28373
|
-
"√": "√",
|
|
28374
|
-
"∝": "∝",
|
|
28375
|
-
"∞": "∞",
|
|
28376
|
-
"∠": "∠",
|
|
28377
|
-
"∧": "∧",
|
|
28378
|
-
"∨": "∨",
|
|
28379
|
-
"∩": "∩",
|
|
28380
|
-
"∪": "∪",
|
|
28381
|
-
"∫": "∫",
|
|
28382
|
-
"∴": "∴",
|
|
28383
|
-
"∼": "∼",
|
|
28384
|
-
"≅": "≅",
|
|
28385
|
-
"≈": "≈",
|
|
28386
|
-
"≠": "≠",
|
|
28387
|
-
"≡": "≡",
|
|
28388
|
-
"≤": "≤",
|
|
28389
|
-
"≥": "≥",
|
|
28390
|
-
"⊂": "⊂",
|
|
28391
|
-
"⊃": "⊃",
|
|
28392
|
-
"⊄": "⊄",
|
|
28393
|
-
"⊆": "⊆",
|
|
28394
|
-
"⊇": "⊇",
|
|
28395
|
-
"⊕": "⊕",
|
|
28396
|
-
"⊗": "⊗",
|
|
28397
|
-
"⊥": "⊥",
|
|
28398
|
-
"⋅": "⋅",
|
|
28399
|
-
"⌈": "⌈",
|
|
28400
|
-
"⌉": "⌉",
|
|
28401
|
-
"⌊": "⌊",
|
|
28402
|
-
"⌋": "⌋",
|
|
28403
|
-
"⟨": "⟨",
|
|
28404
|
-
"⟩": "⟩",
|
|
28405
|
-
"◊": "◊",
|
|
28406
|
-
"♠": "♠",
|
|
28407
|
-
"♣": "♣",
|
|
28408
|
-
"♥": "♥",
|
|
28409
|
-
"♦": "♦"
|
|
28403
|
+
var _useState = useState(null),
|
|
28404
|
+
_useState2 = slicedToArray(_useState, 2),
|
|
28405
|
+
selectedChoice = _useState2[0],
|
|
28406
|
+
setSelectedChoice = _useState2[1];
|
|
28407
|
+
|
|
28408
|
+
var _useState3 = useState(showVotes),
|
|
28409
|
+
_useState4 = slicedToArray(_useState3, 2),
|
|
28410
|
+
showAnswer = _useState4[0],
|
|
28411
|
+
setShowAnswer = _useState4[1];
|
|
28412
|
+
|
|
28413
|
+
var choices = node.choices,
|
|
28414
|
+
question = node.question,
|
|
28415
|
+
response = node.response;
|
|
28416
|
+
|
|
28417
|
+
|
|
28418
|
+
var onSubmitPoll = function onSubmitPoll(e, setShowAnswer) {
|
|
28419
|
+
e.preventDefault();
|
|
28420
|
+
onVote(node._key, selectedChoice);
|
|
28421
|
+
setShowAnswer(true);
|
|
28422
|
+
};
|
|
28423
|
+
|
|
28424
|
+
var choicesTotalCount = choices && choices.reduce(function (acc, choice) {
|
|
28425
|
+
acc = acc + parseInt(choice.choiceCount);
|
|
28426
|
+
return acc;
|
|
28427
|
+
}, 0);
|
|
28428
|
+
return React__default.createElement(
|
|
28429
|
+
React__default.Fragment,
|
|
28430
|
+
null,
|
|
28431
|
+
question && React__default.createElement(
|
|
28432
|
+
'p',
|
|
28433
|
+
{ className: 'font-weight-bold' },
|
|
28434
|
+
question
|
|
28435
|
+
),
|
|
28436
|
+
!showAnswer && choices && choices.length > 0 && React__default.createElement(
|
|
28437
|
+
'form',
|
|
28438
|
+
{ onSubmit: function onSubmit(e) {
|
|
28439
|
+
return onSubmitPoll(e, setShowAnswer);
|
|
28440
|
+
} },
|
|
28441
|
+
choices && choices.map(function (choice) {
|
|
28442
|
+
return React__default.createElement(
|
|
28443
|
+
'div',
|
|
28444
|
+
{ key: choice._key },
|
|
28445
|
+
React__default.createElement('input', { type: 'radio', id: 'male', name: choice._type, value: choice._key, onChange: function onChange(e) {
|
|
28446
|
+
return setSelectedChoice(e.target.value);
|
|
28447
|
+
} }),
|
|
28448
|
+
React__default.createElement(
|
|
28449
|
+
'label',
|
|
28450
|
+
{ className: 'pl-2' },
|
|
28451
|
+
choice.choiceText
|
|
28452
|
+
)
|
|
28453
|
+
);
|
|
28454
|
+
}),
|
|
28455
|
+
React__default.createElement(
|
|
28456
|
+
Button$1,
|
|
28457
|
+
{ disabled: !selectedChoice, type: 'submit' },
|
|
28458
|
+
'Vote'
|
|
28459
|
+
)
|
|
28460
|
+
),
|
|
28461
|
+
React__default.createElement(
|
|
28462
|
+
'div',
|
|
28463
|
+
{ className: 'progress-container' },
|
|
28464
|
+
showAnswer && choices && choices.length > 0 && choices.map(function (choice) {
|
|
28465
|
+
var percentage = choicesTotalCount && choicesTotalCount > 0 ? Math.floor(choice.choiceCount * 100 / choicesTotalCount) : 0;
|
|
28466
|
+
return React__default.createElement(
|
|
28467
|
+
'div',
|
|
28468
|
+
{ key: choice._key, className: 'mb-3' },
|
|
28469
|
+
React__default.createElement(
|
|
28470
|
+
'span',
|
|
28471
|
+
null,
|
|
28472
|
+
choice.choiceText
|
|
28473
|
+
),
|
|
28474
|
+
React__default.createElement(ProgressBar, { now: percentage }),
|
|
28475
|
+
React__default.createElement(
|
|
28476
|
+
'span',
|
|
28477
|
+
{ className: 'float-right' },
|
|
28478
|
+
percentage,
|
|
28479
|
+
'% (',
|
|
28480
|
+
choice.choiceCount,
|
|
28481
|
+
' Votes)'
|
|
28482
|
+
)
|
|
28483
|
+
);
|
|
28484
|
+
})
|
|
28485
|
+
),
|
|
28486
|
+
showAnswer && React__default.createElement(
|
|
28487
|
+
'h4',
|
|
28488
|
+
{ className: 'text-center small p-3' },
|
|
28489
|
+
'Total Votes: ',
|
|
28490
|
+
choicesTotalCount
|
|
28491
|
+
),
|
|
28492
|
+
showAnswer && response && React__default.createElement(BlockContent, { blocks: response, serializers: getSerializers$1(client, pageview, videoAccountIDs) }),
|
|
28493
|
+
React__default.createElement(
|
|
28494
|
+
'style',
|
|
28495
|
+
{ jsx: 'true' },
|
|
28496
|
+
'\n .progress-bar {\n color: #fff;\n }\n '
|
|
28497
|
+
)
|
|
28498
|
+
);
|
|
28410
28499
|
};
|
|
28411
28500
|
|
|
28412
|
-
var
|
|
28413
|
-
|
|
28414
|
-
|
|
28415
|
-
|
|
28416
|
-
|
|
28417
|
-
|
|
28501
|
+
var numberOfPaginations = main_35 ? 4 : 10;
|
|
28502
|
+
|
|
28503
|
+
var Quiz = function Quiz(_ref) {
|
|
28504
|
+
var quizzes = _ref.quizzes,
|
|
28505
|
+
serializerArguments = _ref.serializerArguments;
|
|
28506
|
+
|
|
28507
|
+
var pageCount = quizzes.length;
|
|
28508
|
+
|
|
28509
|
+
var _useState = useState(1),
|
|
28510
|
+
_useState2 = slicedToArray(_useState, 2),
|
|
28511
|
+
currentPage = _useState2[0],
|
|
28512
|
+
setCurrentPage = _useState2[1];
|
|
28513
|
+
|
|
28514
|
+
var _useState3 = useState(false),
|
|
28515
|
+
_useState4 = slicedToArray(_useState3, 2),
|
|
28516
|
+
showAnswer = _useState4[0],
|
|
28517
|
+
setShowAnswer = _useState4[1];
|
|
28518
|
+
|
|
28519
|
+
var _useState5 = useState(0),
|
|
28520
|
+
_useState6 = slicedToArray(_useState5, 2),
|
|
28521
|
+
startIndex = _useState6[0],
|
|
28522
|
+
setStartIndex = _useState6[1];
|
|
28523
|
+
|
|
28524
|
+
var _useState7 = useState(numberOfPaginations - 1),
|
|
28525
|
+
_useState8 = slicedToArray(_useState7, 2),
|
|
28526
|
+
endIndex = _useState8[0],
|
|
28527
|
+
setEndIndex = _useState8[1];
|
|
28528
|
+
|
|
28529
|
+
var _useState9 = useState([]),
|
|
28530
|
+
_useState10 = slicedToArray(_useState9, 2),
|
|
28531
|
+
pages = _useState10[0],
|
|
28532
|
+
setPages = _useState10[1];
|
|
28533
|
+
|
|
28534
|
+
useEffect(function () {
|
|
28535
|
+
var totalPages = Array.from({ length: pageCount }, function (v, k) {
|
|
28536
|
+
return k + 1;
|
|
28537
|
+
});
|
|
28538
|
+
var filteredPages = totalPages.slice(startIndex, endIndex + 1);
|
|
28539
|
+
setPages(filteredPages);
|
|
28540
|
+
}, [startIndex, endIndex, pageCount]);
|
|
28541
|
+
|
|
28542
|
+
var validateIndex = function validateIndex(index) {
|
|
28543
|
+
return index >= 0 && index <= pageCount - 1;
|
|
28544
|
+
};
|
|
28545
|
+
|
|
28546
|
+
var changePage = function changePage(control) {
|
|
28547
|
+
setShowAnswer(false);
|
|
28548
|
+
switch (control) {
|
|
28549
|
+
case 'first':
|
|
28550
|
+
setCurrentPage(1);
|
|
28551
|
+
setStartIndex(0);
|
|
28552
|
+
setEndIndex(numberOfPaginations - 1);
|
|
28553
|
+
break;
|
|
28554
|
+
case 'last':
|
|
28555
|
+
setCurrentPage(pageCount);
|
|
28556
|
+
setStartIndex(pageCount - pageCount % numberOfPaginations);
|
|
28557
|
+
setEndIndex(pageCount - pageCount % numberOfPaginations + numberOfPaginations - 1);
|
|
28558
|
+
break;
|
|
28559
|
+
case 'next':
|
|
28560
|
+
setCurrentPage(currentPage + 1);
|
|
28561
|
+
if (currentPage % numberOfPaginations === 0) {
|
|
28562
|
+
setStartIndex(startIndex + numberOfPaginations);
|
|
28563
|
+
setEndIndex(endIndex + numberOfPaginations);
|
|
28564
|
+
}
|
|
28565
|
+
break;
|
|
28566
|
+
case 'prev':
|
|
28567
|
+
setCurrentPage(currentPage - 1);
|
|
28568
|
+
if (currentPage % numberOfPaginations === 1) {
|
|
28569
|
+
setStartIndex(startIndex - numberOfPaginations);
|
|
28570
|
+
setEndIndex(endIndex - numberOfPaginations);
|
|
28571
|
+
}
|
|
28572
|
+
break;
|
|
28573
|
+
default:
|
|
28574
|
+
setCurrentPage(control);
|
|
28418
28575
|
}
|
|
28419
|
-
|
|
28420
|
-
|
|
28421
|
-
|
|
28576
|
+
};
|
|
28577
|
+
|
|
28578
|
+
var renderNewPages = function renderNewPages(section) {
|
|
28579
|
+
if (section === 'prev') {
|
|
28580
|
+
setStartIndex(startIndex - numberOfPaginations);
|
|
28581
|
+
setEndIndex(endIndex - numberOfPaginations);
|
|
28582
|
+
} else if (section === 'next') {
|
|
28583
|
+
setStartIndex(startIndex + numberOfPaginations);
|
|
28584
|
+
setEndIndex(endIndex + numberOfPaginations);
|
|
28585
|
+
}
|
|
28586
|
+
};
|
|
28587
|
+
|
|
28588
|
+
var renderPagination = function renderPagination() {
|
|
28589
|
+
return React__default.createElement(
|
|
28590
|
+
Pagination,
|
|
28591
|
+
{ className: 'p-0 m-0', size: main_35 && 'sm' },
|
|
28592
|
+
React__default.createElement(Pagination.First, { onClick: function onClick() {
|
|
28593
|
+
return changePage('first');
|
|
28594
|
+
}, disabled: currentPage === 1 }),
|
|
28595
|
+
React__default.createElement(Pagination.Prev, { onClick: function onClick() {
|
|
28596
|
+
return changePage('prev');
|
|
28597
|
+
}, disabled: currentPage === 1 }),
|
|
28598
|
+
React__default.createElement(Pagination.Ellipsis, { onClick: function onClick() {
|
|
28599
|
+
return renderNewPages('prev');
|
|
28600
|
+
}, disabled: !validateIndex(startIndex - numberOfPaginations) }),
|
|
28601
|
+
pages.map(function (page) {
|
|
28602
|
+
return React__default.createElement(
|
|
28603
|
+
Pagination.Item,
|
|
28604
|
+
{ key: page, active: page === currentPage, onClick: function onClick() {
|
|
28605
|
+
return changePage(page);
|
|
28606
|
+
} },
|
|
28607
|
+
page
|
|
28608
|
+
);
|
|
28609
|
+
}),
|
|
28610
|
+
React__default.createElement(Pagination.Ellipsis, { onClick: function onClick() {
|
|
28611
|
+
return renderNewPages('next');
|
|
28612
|
+
}, disabled: !validateIndex(startIndex + numberOfPaginations) }),
|
|
28613
|
+
React__default.createElement(Pagination.Next, { onClick: function onClick() {
|
|
28614
|
+
return changePage('next');
|
|
28615
|
+
}, disabled: currentPage === pageCount }),
|
|
28616
|
+
React__default.createElement(Pagination.Last, { onClick: function onClick() {
|
|
28617
|
+
return changePage('last');
|
|
28618
|
+
}, disabled: currentPage === pageCount })
|
|
28619
|
+
);
|
|
28620
|
+
};
|
|
28621
|
+
|
|
28622
|
+
return React__default.createElement(
|
|
28623
|
+
React__default.Fragment,
|
|
28624
|
+
null,
|
|
28625
|
+
quizzes[currentPage - 1] && React__default.createElement(BlockContent, { blocks: quizzes[currentPage - 1].question, serializers: getSerializers$1(serializerArguments) }),
|
|
28626
|
+
!showAnswer && React__default.createElement(
|
|
28627
|
+
Button,
|
|
28628
|
+
{ onClick: function onClick() {
|
|
28629
|
+
return setShowAnswer(true);
|
|
28630
|
+
}, variant: 'info', block: true },
|
|
28631
|
+
'Please click here for answer'
|
|
28632
|
+
),
|
|
28633
|
+
quizzes[currentPage - 1] && showAnswer && React__default.createElement(
|
|
28634
|
+
React__default.Fragment,
|
|
28635
|
+
null,
|
|
28636
|
+
React__default.createElement(
|
|
28637
|
+
'h4',
|
|
28638
|
+
null,
|
|
28639
|
+
'Answer:'
|
|
28640
|
+
),
|
|
28641
|
+
React__default.createElement(BlockContent, { blocks: quizzes[currentPage - 1].answer, serializers: getSerializers$1(serializerArguments) })
|
|
28642
|
+
),
|
|
28643
|
+
React__default.createElement('br', null),
|
|
28644
|
+
pageCount > 1 && React__default.createElement(
|
|
28645
|
+
'div',
|
|
28646
|
+
{ className: 'd-flex justify-content-center' },
|
|
28647
|
+
renderPagination()
|
|
28648
|
+
)
|
|
28649
|
+
);
|
|
28650
|
+
};
|
|
28651
|
+
|
|
28652
|
+
var Leads = function Leads(_ref) {
|
|
28653
|
+
var url = _ref.url;
|
|
28654
|
+
|
|
28655
|
+
return React__default.createElement(
|
|
28656
|
+
'div',
|
|
28657
|
+
{ className: 'd-block text-center mb-3' },
|
|
28658
|
+
url && React__default.createElement('iframe', { className: 'w-100 h-100 leads-block', scrolling: 'no', src: url, frameBorder: '0', allow: 'fullscreen' })
|
|
28659
|
+
);
|
|
28422
28660
|
};
|
|
28423
|
-
var html_decode_1 = html_decode;
|
|
28424
28661
|
|
|
28425
28662
|
var urlFor$3 = function urlFor(source, builder) {
|
|
28426
28663
|
return builder.image(source);
|
|
@@ -29057,7 +29294,7 @@ var Hero = function Hero(_ref) {
|
|
|
29057
29294
|
summary && React__default.createElement(
|
|
29058
29295
|
Card$1.Footer,
|
|
29059
29296
|
{ className: 'h6' },
|
|
29060
|
-
summary
|
|
29297
|
+
clean_html_1(summary)
|
|
29061
29298
|
)
|
|
29062
29299
|
)
|
|
29063
29300
|
)
|
|
@@ -29679,7 +29916,7 @@ var OncliveLargeHero = function OncliveLargeHero(props) {
|
|
|
29679
29916
|
React__default.createElement(
|
|
29680
29917
|
'p',
|
|
29681
29918
|
null,
|
|
29682
|
-
topArticle.summary
|
|
29919
|
+
clean_html_1(topArticle.summary)
|
|
29683
29920
|
)
|
|
29684
29921
|
)
|
|
29685
29922
|
)
|
|
@@ -29841,7 +30078,7 @@ var YahooHero = function YahooHero(props) {
|
|
|
29841
30078
|
React__default.createElement(
|
|
29842
30079
|
'p',
|
|
29843
30080
|
null,
|
|
29844
|
-
topArticle.summary
|
|
30081
|
+
clean_html_1(topArticle.summary)
|
|
29845
30082
|
)
|
|
29846
30083
|
)
|
|
29847
30084
|
)
|
|
@@ -29922,7 +30159,8 @@ Sample usage
|
|
|
29922
30159
|
var RelatedContent = function RelatedContent(props) {
|
|
29923
30160
|
var client = props.client,
|
|
29924
30161
|
dataRecord = props.dataRecord,
|
|
29925
|
-
_props$defaultImage = props.defaultImage
|
|
30162
|
+
_props$defaultImage = props.defaultImage,
|
|
30163
|
+
defaultImage = _props$defaultImage === undefined ? '' : _props$defaultImage;
|
|
29926
30164
|
|
|
29927
30165
|
var builder = imageUrlBuilder(client);
|
|
29928
30166
|
function urlFor(source) {
|
|
@@ -29951,7 +30189,7 @@ var RelatedContent = function RelatedContent(props) {
|
|
|
29951
30189
|
'figure',
|
|
29952
30190
|
null,
|
|
29953
30191
|
React__default.createElement('img', {
|
|
29954
|
-
src: urlFor(article.thumbnail.asset).width(500).url(),
|
|
30192
|
+
src: article.thumbnail ? urlFor(article.thumbnail.asset).width(500).url() : defaultImage,
|
|
29955
30193
|
alt: article.title
|
|
29956
30194
|
})
|
|
29957
30195
|
),
|