@quintype/arrow 3.15.1-perf.1 → 3.15.1-perf.4
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/atoms/Author/index.js +48 -2128
- package/atoms/Author/styles.arrow.css +1 -1
- package/atoms/AuthorWithTime/index.js +116 -2556
- package/atoms/AuthorWithTime/styles.arrow.css +1 -1
- package/atoms/CollectionName/index.js +48 -2127
- package/atoms/CollectionName/styles.arrow.css +1 -1
- package/atoms/ExtendedLoadMore/{index-6f8c780e.js → index-0f809dd9.js} +73 -62
- package/atoms/ExtendedLoadMore/index-142f015c.js +476 -0
- package/atoms/ExtendedLoadMore/{index-2d713010.js → index-37a9ccff.js} +63 -47
- package/atoms/ExtendedLoadMore/{index-8345922c.js → index-446679c8.js} +67 -51
- package/atoms/ExtendedLoadMore/{index-6daa674c.js → index-44f97338.js} +86 -68
- package/atoms/ExtendedLoadMore/{index-c8f346d0.js → index-57dd4870.js} +80 -64
- package/atoms/ExtendedLoadMore/{index-7eb05b3d.js → index-66dd4dbd.js} +70 -54
- package/atoms/ExtendedLoadMore/{index-6cb56d1a.js → index-8462c597.js} +93 -80
- package/atoms/ExtendedLoadMore/{index-aa8b8ab8.js → index-93cb06d1.js} +252 -226
- package/atoms/ExtendedLoadMore/index-afd44863.js +95 -0
- package/atoms/ExtendedLoadMore/{index-5a7900ba.js → index-b5754c5d.js} +67 -53
- package/atoms/ExtendedLoadMore/{index-4191a84c.js → index-bbaf526e.js} +78 -62
- package/atoms/ExtendedLoadMore/{index-99af722e.js → index-cfb262ef.js} +65 -48
- package/atoms/ExtendedLoadMore/index.js +20 -5
- package/atoms/ExtendedLoadMore/styles.arrow.css +1 -1
- package/atoms/Headline/index.js +95 -2175
- package/atoms/Headline/styles.arrow.css +1 -1
- package/atoms/HeroImage/index.js +91 -2230
- package/atoms/HeroImage/styles.arrow.css +1 -1
- package/atoms/LoadmoreButton/index.js +40 -2133
- package/atoms/LoadmoreButton/styles.arrow.css +1 -1
- package/atoms/ScrollSnap/index.js +89 -2241
- package/atoms/ScrollSnap/styles.arrow.css +1 -1
- package/atoms/SectionTag/index.js +40 -2120
- package/atoms/SectionTag/styles.arrow.css +1 -1
- package/atoms/Subheadline/index.js +35 -2115
- package/atoms/Subheadline/styles.arrow.css +1 -1
- package/atoms/TimeStamp/index.js +43 -2483
- package/atoms/TimeStamp/styles.arrow.css +1 -1
- package/molecules/KeyEvents/index.js +95 -2606
- package/molecules/KeyEvents/styles.arrow.css +1 -1
- package/molecules/PageIntroductionCard/index.js +59 -2487
- package/molecules/PageIntroductionCard/styles.arrow.css +1 -1
- package/molecules/SocialShareTemplate/index.js +213 -2800
- package/molecules/SocialShareTemplate/styles.arrow.css +1 -1
- package/molecules/StoryCard/index.js +308 -2816
- package/molecules/StoryCard/styles.arrow.css +1 -1
- package/molecules/StoryElementCard/index.js +611 -3352
- package/molecules/StoryElementCard/styles.arrow.css +1 -1
- package/molecules/StorycardContent/index.js +218 -2658
- package/molecules/StorycardContent/styles.arrow.css +1 -1
- package/package.json +1 -1
- package/rows/AlternateCollectionFilter/index.js +438 -2993
- package/rows/AlternateCollectionFilter/styles.arrow.css +1 -1
- package/rows/AsideCollection/index.js +432 -2987
- package/rows/AsideCollection/styles.arrow.css +1 -1
- package/rows/AstrologyCollection/index.js +411 -2966
- package/rows/AstrologyCollection/styles.arrow.css +1 -1
- package/rows/AuthorIntroductionCard/index.js +183 -2890
- package/rows/AuthorIntroductionCard/styles.arrow.css +1 -1
- package/rows/AuthorsList/index.js +217 -2936
- package/rows/AuthorsList/styles.arrow.css +1 -1
- package/rows/CollectionFilter/index.js +453 -3008
- package/rows/CollectionFilter/styles.arrow.css +1 -1
- package/rows/ElevenStories/index.js +439 -2959
- package/rows/ElevenStories/styles.arrow.css +1 -1
- package/rows/FourColFiveStories/index.js +374 -2872
- package/rows/FourColFiveStories/styles.arrow.css +1 -1
- package/rows/FourColGrid/index.js +426 -2927
- package/rows/FourColGrid/styles.arrow.css +1 -1
- package/rows/FourColPortraitStories/index.js +430 -2931
- package/rows/FourColPortraitStories/styles.arrow.css +1 -1
- package/rows/FourColSixteenStories/index.js +368 -2894
- package/rows/FourColSixteenStories/styles.arrow.css +1 -1
- package/rows/FourColTwelveStories/index.js +387 -2900
- package/rows/FourColTwelveStories/styles.arrow.css +1 -1
- package/rows/FourStorySlider/index.js +443 -2963
- package/rows/FourStorySlider/styles.arrow.css +1 -1
- package/rows/FourStorySliderPortrait/index.js +444 -2964
- package/rows/FourStorySliderPortrait/styles.arrow.css +1 -1
- package/rows/FourTabbedBigStorySlider/index.js +403 -2923
- package/rows/FourTabbedBigStorySlider/styles.arrow.css +1 -1
- package/rows/FullScreenSlider/index.js +422 -2942
- package/rows/FullScreenSlider/styles.arrow.css +1 -1
- package/rows/HalfScreenSlider/index.js +390 -2910
- package/rows/HalfScreenSlider/styles.arrow.css +1 -1
- package/rows/ListComponent/index.js +398 -2918
- package/rows/ListComponent/styles.arrow.css +1 -1
- package/rows/Listicles/index.js +189 -2375
- package/rows/Listicles/styles.arrow.css +1 -1
- package/rows/MagazineEditions/index.js +128 -2580
- package/rows/MagazineEditions/styles.arrow.css +1 -1
- package/rows/MagazineHeaderCard/index.js +125 -2577
- package/rows/MagazineHeaderCard/styles.arrow.css +1 -1
- package/rows/MagazineWidget/index.js +408 -2928
- package/rows/MagazineWidget/styles.arrow.css +1 -1
- package/rows/OneColStoryList/index.js +439 -2940
- package/rows/OneColStoryList/styles.arrow.css +1 -1
- package/rows/OpinionCollection/index.js +308 -2800
- package/rows/OpinionCollection/styles.arrow.css +1 -1
- package/rows/SixColSixStories/index.js +405 -2906
- package/rows/SixColSixStories/styles.arrow.css +1 -1
- package/rows/StoryCollection/index.js +432 -2987
- package/rows/StoryCollection/styles.arrow.css +1 -1
- package/rows/TagIntroductionCard/index.js +35 -1833
- package/rows/TagIntroductionCard/styles.arrow.css +1 -1
- package/rows/ThreeColFlexStories/index.js +421 -2922
- package/rows/ThreeColFlexStories/styles.arrow.css +1 -1
- package/rows/ThreeColFourteenStories/index.js +358 -2871
- package/rows/ThreeColFourteenStories/styles.arrow.css +1 -1
- package/rows/ThreeColGrid/index.js +428 -2929
- package/rows/ThreeColGrid/styles.arrow.css +1 -1
- package/rows/ThreeColSevenStory/index.js +406 -2926
- package/rows/ThreeColSevenStory/styles.arrow.css +1 -1
- package/rows/ThreeColSixStories/index.js +400 -2920
- package/rows/ThreeColSixStories/styles.arrow.css +1 -1
- package/rows/ThreeColTwelveStories/index.js +383 -2909
- package/rows/ThreeColTwelveStories/styles.arrow.css +1 -1
- package/rows/TwoColFourStories/index.js +395 -2915
- package/rows/TwoColFourStories/styles.arrow.css +1 -1
- package/rows/TwoColFourStoryHighlight/index.js +398 -2924
- package/rows/TwoColFourStoryHighlight/styles.arrow.css +1 -1
- package/rows/TwoColSevenStories/index.js +400 -2920
- package/rows/TwoColSevenStories/styles.arrow.css +1 -1
- package/rows/TwoColSixStories/index.js +398 -2924
- package/rows/TwoColSixStories/styles.arrow.css +1 -1
- package/rows/TwoColTenStoriesSidebar/index.js +418 -2938
- package/rows/TwoColTenStoriesSidebar/styles.arrow.css +1 -1
- package/rows/TwoColThreeStories/index.js +392 -2912
- package/rows/TwoColThreeStories/styles.arrow.css +1 -1
- package/story-elements/AlsoRead/index.js +92 -2229
- package/story-elements/AlsoRead/styles.arrow.css +1 -1
- package/story-elements/Attachment/index.js +53 -1899
- package/story-elements/Attachment/styles.arrow.css +1 -1
- package/story-elements/BigFact/index.js +49 -1895
- package/story-elements/BigFact/styles.arrow.css +1 -1
- package/story-elements/BlockQuote/index.js +79 -2206
- package/story-elements/BlockQuote/styles.arrow.css +1 -1
- package/story-elements/Blurb/index.js +52 -1957
- package/story-elements/Blurb/styles.arrow.css +1 -1
- package/story-elements/Image/index.js +147 -2329
- package/story-elements/Image/styles.arrow.css +1 -1
- package/story-elements/ImageGallery/index.js +135 -2317
- package/story-elements/ImageGallery/styles.arrow.css +1 -1
- package/story-elements/ImageSlideshow/index.js +173 -2355
- package/story-elements/ImageSlideshow/styles.arrow.css +1 -1
- package/story-elements/QuestionAnswer/index.js +79 -2207
- package/story-elements/QuestionAnswer/styles.arrow.css +1 -1
- package/story-elements/Quote/index.js +52 -1898
- package/story-elements/Quote/styles.arrow.css +1 -1
- package/story-elements/Reference/index.js +53 -1899
- package/story-elements/Reference/styles.arrow.css +1 -1
- package/story-elements/StoryElement/index.js +34 -1738
- package/story-elements/Summary/index.js +56 -1902
- package/story-elements/Summary/styles.arrow.css +1 -1
- package/story-elements/Text/index.js +48 -2176
- package/story-elements/Text/styles.arrow.css +1 -1
- package/story-elements/Video/index.js +35 -1739
- package/story-elements/Video/styles.arrow.css +1 -1
- package/story-templates/ListicleStoryTemplate/index.js +1182 -4038
- package/story-templates/ListicleStoryTemplate/styles.arrow.css +1 -1
- package/story-templates/LiveBlogStoryTemplate/index.js +1377 -4233
- package/story-templates/LiveBlogStoryTemplate/styles.arrow.css +1 -1
- package/story-templates/PhotoStoryTemplate/index.js +1162 -4018
- package/story-templates/PhotoStoryTemplate/styles.arrow.css +1 -1
- package/story-templates/TextStoryTemplate/index.js +1277 -4133
- package/story-templates/TextStoryTemplate/styles.arrow.css +1 -1
- package/story-templates/VideoStoryTemplate/index.js +1231 -4087
- package/story-templates/VideoStoryTemplate/styles.arrow.css +1 -1
- package/atoms/ExtendedLoadMore/index-e39b3ca8.js +0 -3023
- package/atoms/ExtendedLoadMore/index-f6e578e3.js +0 -86
|
@@ -1,2494 +1,68 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
var
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
};
|
|
33
|
-
var _default = optionsDefaults;
|
|
34
|
-
exports["default"] = _default;
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
});
|
|
38
|
-
|
|
39
|
-
var getClassName = createCommonjsModule(function (module, exports) {
|
|
40
|
-
|
|
41
|
-
Object.defineProperty(exports, "__esModule", {
|
|
42
|
-
value: true
|
|
43
|
-
});
|
|
44
|
-
exports["default"] = void 0;
|
|
45
|
-
|
|
46
|
-
var _optionsDefaults = _interopRequireDefault(optionsDefaults_1);
|
|
47
|
-
|
|
48
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
49
|
-
|
|
50
|
-
var isNamespacedStyleName = function isNamespacedStyleName(styleName) {
|
|
51
|
-
return styleName.indexOf('.') !== -1;
|
|
52
|
-
};
|
|
53
|
-
|
|
54
|
-
var handleError = function handleError(message, handleMissingStyleName) {
|
|
55
|
-
if (handleMissingStyleName === 'throw') {
|
|
56
|
-
throw new Error(message);
|
|
57
|
-
} else if (handleMissingStyleName === 'warn') {
|
|
58
|
-
// eslint-disable-next-line no-console
|
|
59
|
-
console.warn(message);
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
return null;
|
|
63
|
-
};
|
|
64
|
-
|
|
65
|
-
var getClassNameForNamespacedStyleName = function getClassNameForNamespacedStyleName(styleName, styleModuleImportMap, handleMissingStyleNameOption) {
|
|
66
|
-
// Note:
|
|
67
|
-
// Do not use the desctructing syntax with Babel.
|
|
68
|
-
// Desctructing adds _slicedToArray helper.
|
|
69
|
-
var styleNameParts = styleName.split('.');
|
|
70
|
-
var importName = styleNameParts[0];
|
|
71
|
-
var moduleName = styleNameParts[1];
|
|
72
|
-
var handleMissingStyleName = handleMissingStyleNameOption || _optionsDefaults["default"].handleMissingStyleName;
|
|
73
|
-
|
|
74
|
-
if (!moduleName) {
|
|
75
|
-
return handleError('Invalid style name: ' + styleName, handleMissingStyleName);
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
if (!styleModuleImportMap[importName]) {
|
|
79
|
-
return handleError('CSS module import does not exist: ' + importName, handleMissingStyleName);
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
if (!styleModuleImportMap[importName][moduleName]) {
|
|
83
|
-
return handleError('CSS module does not exist: ' + moduleName, handleMissingStyleName);
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
return styleModuleImportMap[importName][moduleName];
|
|
87
|
-
};
|
|
88
|
-
|
|
89
|
-
var getClassNameFromMultipleImports = function getClassNameFromMultipleImports(styleName, styleModuleImportMap, handleMissingStyleNameOption) {
|
|
90
|
-
var handleMissingStyleName = handleMissingStyleNameOption || _optionsDefaults["default"].handleMissingStyleName;
|
|
91
|
-
var importKeysWithMatches = Object.keys(styleModuleImportMap).map(function (importKey) {
|
|
92
|
-
return styleModuleImportMap[importKey][styleName] && importKey;
|
|
93
|
-
}).filter(function (importKey) {
|
|
94
|
-
return importKey;
|
|
95
|
-
});
|
|
96
|
-
|
|
97
|
-
if (importKeysWithMatches.length > 1) {
|
|
98
|
-
throw new Error('Cannot resolve styleName "' + styleName + '" because it is present in multiple imports:' + '\n\n\t' + importKeysWithMatches.join('\n\t') + '\n\nYou can resolve this by using a named import, e.g:' + '\n\n\timport foo from "' + importKeysWithMatches[0] + '";' + '\n\t<div styleName="foo.' + styleName + '" />' + '\n\n');
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
if (importKeysWithMatches.length === 0) {
|
|
102
|
-
return handleError('Could not resolve the styleName \'' + styleName + '\'.', handleMissingStyleName);
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
return styleModuleImportMap[importKeysWithMatches[0]][styleName];
|
|
106
|
-
};
|
|
107
|
-
|
|
108
|
-
var _default = function _default(styleNameValue, styleModuleImportMap, options) {
|
|
109
|
-
var styleModuleImportMapKeys = Object.keys(styleModuleImportMap);
|
|
110
|
-
|
|
111
|
-
var _ref = options || {},
|
|
112
|
-
_ref$handleMissingSty = _ref.handleMissingStyleName,
|
|
113
|
-
handleMissingStyleName = _ref$handleMissingSty === void 0 ? _optionsDefaults["default"].handleMissingStyleName : _ref$handleMissingSty,
|
|
114
|
-
_ref$autoResolveMulti = _ref.autoResolveMultipleImports,
|
|
115
|
-
autoResolveMultipleImports = _ref$autoResolveMulti === void 0 ? _optionsDefaults["default"].autoResolveMultipleImports : _ref$autoResolveMulti;
|
|
116
|
-
|
|
117
|
-
if (!styleNameValue) {
|
|
118
|
-
return '';
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
return styleNameValue.split(' ').filter(function (styleName) {
|
|
122
|
-
return styleName;
|
|
123
|
-
}).map(function (styleName) {
|
|
124
|
-
if (isNamespacedStyleName(styleName)) {
|
|
125
|
-
return getClassNameForNamespacedStyleName(styleName, styleModuleImportMap, handleMissingStyleName);
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
if (styleModuleImportMapKeys.length === 0) {
|
|
129
|
-
throw new Error('Cannot use styleName attribute for style name \'' + styleName + '\' without importing at least one stylesheet.');
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
if (styleModuleImportMapKeys.length > 1) {
|
|
133
|
-
if (!autoResolveMultipleImports) {
|
|
134
|
-
throw new Error('Cannot use anonymous style name \'' + styleName + '\' with more than one stylesheet import without setting \'autoResolveMultipleImports\' to true.');
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var _getClassName = require('babel-plugin-react-css-modules/dist/browser/getClassName');
|
|
6
|
+
var React = require('react');
|
|
7
|
+
var PropTypes = require('prop-types');
|
|
8
|
+
var lodash = require('lodash');
|
|
9
|
+
var components = require('@quintype/components');
|
|
10
|
+
var reactRedux = require('react-redux');
|
|
11
|
+
require('@babel/runtime/helpers/asyncToGenerator');
|
|
12
|
+
var _typeof = require('@babel/runtime/helpers/typeof');
|
|
13
|
+
require('@babel/runtime/regenerator');
|
|
14
|
+
var Timeago = require('react-timeago');
|
|
15
|
+
var dateFnsTz = require('date-fns-tz');
|
|
16
|
+
var _slicedToArray = require('@babel/runtime/helpers/slicedToArray');
|
|
17
|
+
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
18
|
+
var ReactDOM = require('react-dom');
|
|
19
|
+
|
|
20
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
21
|
+
|
|
22
|
+
function _interopNamespace(e) {
|
|
23
|
+
if (e && e.__esModule) return e;
|
|
24
|
+
var n = Object.create(null);
|
|
25
|
+
if (e) {
|
|
26
|
+
Object.keys(e).forEach(function (k) {
|
|
27
|
+
if (k !== 'default') {
|
|
28
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
29
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
30
|
+
enumerable: true,
|
|
31
|
+
get: function () { return e[k]; }
|
|
32
|
+
});
|
|
135
33
|
}
|
|
136
|
-
|
|
137
|
-
return getClassNameFromMultipleImports(styleName, styleModuleImportMap, handleMissingStyleName);
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
var styleModuleMap = styleModuleImportMap[styleModuleImportMapKeys[0]];
|
|
141
|
-
|
|
142
|
-
if (!styleModuleMap[styleName]) {
|
|
143
|
-
return handleError('Could not resolve the styleName \'' + styleName + '\'.', handleMissingStyleName);
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
return styleModuleMap[styleName];
|
|
147
|
-
}).filter(function (className) {
|
|
148
|
-
// Remove any styles which could not be found (if handleMissingStyleName === 'ignore')
|
|
149
|
-
return className;
|
|
150
|
-
}).join(' ');
|
|
151
|
-
};
|
|
152
|
-
|
|
153
|
-
exports["default"] = _default;
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
});
|
|
157
|
-
|
|
158
|
-
var _getClassName = /*@__PURE__*/getDefaultExportFromCjs(getClassName);
|
|
159
|
-
|
|
160
|
-
/**
|
|
161
|
-
* Checks if `value` is classified as an `Array` object.
|
|
162
|
-
*
|
|
163
|
-
* @static
|
|
164
|
-
* @memberOf _
|
|
165
|
-
* @since 0.1.0
|
|
166
|
-
* @category Lang
|
|
167
|
-
* @param {*} value The value to check.
|
|
168
|
-
* @returns {boolean} Returns `true` if `value` is an array, else `false`.
|
|
169
|
-
* @example
|
|
170
|
-
*
|
|
171
|
-
* _.isArray([1, 2, 3]);
|
|
172
|
-
* // => true
|
|
173
|
-
*
|
|
174
|
-
* _.isArray(document.body.children);
|
|
175
|
-
* // => false
|
|
176
|
-
*
|
|
177
|
-
* _.isArray('abc');
|
|
178
|
-
* // => false
|
|
179
|
-
*
|
|
180
|
-
* _.isArray(_.noop);
|
|
181
|
-
* // => false
|
|
182
|
-
*/
|
|
183
|
-
var isArray = Array.isArray;
|
|
184
|
-
|
|
185
|
-
var isArray_1 = isArray;
|
|
186
|
-
|
|
187
|
-
/** Detect free variable `global` from Node.js. */
|
|
188
|
-
|
|
189
|
-
var freeGlobal = typeof commonjsGlobal == 'object' && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal;
|
|
190
|
-
|
|
191
|
-
var _freeGlobal = freeGlobal;
|
|
192
|
-
|
|
193
|
-
/** Detect free variable `self`. */
|
|
194
|
-
var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
|
|
195
|
-
|
|
196
|
-
/** Used as a reference to the global object. */
|
|
197
|
-
var root = _freeGlobal || freeSelf || Function('return this')();
|
|
198
|
-
|
|
199
|
-
var _root = root;
|
|
200
|
-
|
|
201
|
-
/** Built-in value references. */
|
|
202
|
-
var Symbol$1 = _root.Symbol;
|
|
203
|
-
|
|
204
|
-
var _Symbol = Symbol$1;
|
|
205
|
-
|
|
206
|
-
/** Used for built-in method references. */
|
|
207
|
-
var objectProto$4 = Object.prototype;
|
|
208
|
-
|
|
209
|
-
/** Used to check objects for own properties. */
|
|
210
|
-
var hasOwnProperty$3 = objectProto$4.hasOwnProperty;
|
|
211
|
-
|
|
212
|
-
/**
|
|
213
|
-
* Used to resolve the
|
|
214
|
-
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
|
|
215
|
-
* of values.
|
|
216
|
-
*/
|
|
217
|
-
var nativeObjectToString$1 = objectProto$4.toString;
|
|
218
|
-
|
|
219
|
-
/** Built-in value references. */
|
|
220
|
-
var symToStringTag$1 = _Symbol ? _Symbol.toStringTag : undefined;
|
|
221
|
-
|
|
222
|
-
/**
|
|
223
|
-
* A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
|
|
224
|
-
*
|
|
225
|
-
* @private
|
|
226
|
-
* @param {*} value The value to query.
|
|
227
|
-
* @returns {string} Returns the raw `toStringTag`.
|
|
228
|
-
*/
|
|
229
|
-
function getRawTag(value) {
|
|
230
|
-
var isOwn = hasOwnProperty$3.call(value, symToStringTag$1),
|
|
231
|
-
tag = value[symToStringTag$1];
|
|
232
|
-
|
|
233
|
-
try {
|
|
234
|
-
value[symToStringTag$1] = undefined;
|
|
235
|
-
var unmasked = true;
|
|
236
|
-
} catch (e) {}
|
|
237
|
-
|
|
238
|
-
var result = nativeObjectToString$1.call(value);
|
|
239
|
-
if (unmasked) {
|
|
240
|
-
if (isOwn) {
|
|
241
|
-
value[symToStringTag$1] = tag;
|
|
242
|
-
} else {
|
|
243
|
-
delete value[symToStringTag$1];
|
|
244
|
-
}
|
|
245
|
-
}
|
|
246
|
-
return result;
|
|
247
|
-
}
|
|
248
|
-
|
|
249
|
-
var _getRawTag = getRawTag;
|
|
250
|
-
|
|
251
|
-
/** Used for built-in method references. */
|
|
252
|
-
var objectProto$3 = Object.prototype;
|
|
253
|
-
|
|
254
|
-
/**
|
|
255
|
-
* Used to resolve the
|
|
256
|
-
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
|
|
257
|
-
* of values.
|
|
258
|
-
*/
|
|
259
|
-
var nativeObjectToString = objectProto$3.toString;
|
|
260
|
-
|
|
261
|
-
/**
|
|
262
|
-
* Converts `value` to a string using `Object.prototype.toString`.
|
|
263
|
-
*
|
|
264
|
-
* @private
|
|
265
|
-
* @param {*} value The value to convert.
|
|
266
|
-
* @returns {string} Returns the converted string.
|
|
267
|
-
*/
|
|
268
|
-
function objectToString(value) {
|
|
269
|
-
return nativeObjectToString.call(value);
|
|
270
|
-
}
|
|
271
|
-
|
|
272
|
-
var _objectToString = objectToString;
|
|
273
|
-
|
|
274
|
-
/** `Object#toString` result references. */
|
|
275
|
-
var nullTag = '[object Null]',
|
|
276
|
-
undefinedTag = '[object Undefined]';
|
|
277
|
-
|
|
278
|
-
/** Built-in value references. */
|
|
279
|
-
var symToStringTag = _Symbol ? _Symbol.toStringTag : undefined;
|
|
280
|
-
|
|
281
|
-
/**
|
|
282
|
-
* The base implementation of `getTag` without fallbacks for buggy environments.
|
|
283
|
-
*
|
|
284
|
-
* @private
|
|
285
|
-
* @param {*} value The value to query.
|
|
286
|
-
* @returns {string} Returns the `toStringTag`.
|
|
287
|
-
*/
|
|
288
|
-
function baseGetTag(value) {
|
|
289
|
-
if (value == null) {
|
|
290
|
-
return value === undefined ? undefinedTag : nullTag;
|
|
291
|
-
}
|
|
292
|
-
return (symToStringTag && symToStringTag in Object(value))
|
|
293
|
-
? _getRawTag(value)
|
|
294
|
-
: _objectToString(value);
|
|
295
|
-
}
|
|
296
|
-
|
|
297
|
-
var _baseGetTag = baseGetTag;
|
|
298
|
-
|
|
299
|
-
/**
|
|
300
|
-
* Checks if `value` is object-like. A value is object-like if it's not `null`
|
|
301
|
-
* and has a `typeof` result of "object".
|
|
302
|
-
*
|
|
303
|
-
* @static
|
|
304
|
-
* @memberOf _
|
|
305
|
-
* @since 4.0.0
|
|
306
|
-
* @category Lang
|
|
307
|
-
* @param {*} value The value to check.
|
|
308
|
-
* @returns {boolean} Returns `true` if `value` is object-like, else `false`.
|
|
309
|
-
* @example
|
|
310
|
-
*
|
|
311
|
-
* _.isObjectLike({});
|
|
312
|
-
* // => true
|
|
313
|
-
*
|
|
314
|
-
* _.isObjectLike([1, 2, 3]);
|
|
315
|
-
* // => true
|
|
316
|
-
*
|
|
317
|
-
* _.isObjectLike(_.noop);
|
|
318
|
-
* // => false
|
|
319
|
-
*
|
|
320
|
-
* _.isObjectLike(null);
|
|
321
|
-
* // => false
|
|
322
|
-
*/
|
|
323
|
-
function isObjectLike(value) {
|
|
324
|
-
return value != null && typeof value == 'object';
|
|
325
|
-
}
|
|
326
|
-
|
|
327
|
-
var isObjectLike_1 = isObjectLike;
|
|
328
|
-
|
|
329
|
-
/** `Object#toString` result references. */
|
|
330
|
-
var symbolTag = '[object Symbol]';
|
|
331
|
-
|
|
332
|
-
/**
|
|
333
|
-
* Checks if `value` is classified as a `Symbol` primitive or object.
|
|
334
|
-
*
|
|
335
|
-
* @static
|
|
336
|
-
* @memberOf _
|
|
337
|
-
* @since 4.0.0
|
|
338
|
-
* @category Lang
|
|
339
|
-
* @param {*} value The value to check.
|
|
340
|
-
* @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
|
|
341
|
-
* @example
|
|
342
|
-
*
|
|
343
|
-
* _.isSymbol(Symbol.iterator);
|
|
344
|
-
* // => true
|
|
345
|
-
*
|
|
346
|
-
* _.isSymbol('abc');
|
|
347
|
-
* // => false
|
|
348
|
-
*/
|
|
349
|
-
function isSymbol(value) {
|
|
350
|
-
return typeof value == 'symbol' ||
|
|
351
|
-
(isObjectLike_1(value) && _baseGetTag(value) == symbolTag);
|
|
352
|
-
}
|
|
353
|
-
|
|
354
|
-
var isSymbol_1 = isSymbol;
|
|
355
|
-
|
|
356
|
-
/** Used to match property names within property paths. */
|
|
357
|
-
var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
|
|
358
|
-
reIsPlainProp = /^\w*$/;
|
|
359
|
-
|
|
360
|
-
/**
|
|
361
|
-
* Checks if `value` is a property name and not a property path.
|
|
362
|
-
*
|
|
363
|
-
* @private
|
|
364
|
-
* @param {*} value The value to check.
|
|
365
|
-
* @param {Object} [object] The object to query keys on.
|
|
366
|
-
* @returns {boolean} Returns `true` if `value` is a property name, else `false`.
|
|
367
|
-
*/
|
|
368
|
-
function isKey(value, object) {
|
|
369
|
-
if (isArray_1(value)) {
|
|
370
|
-
return false;
|
|
371
|
-
}
|
|
372
|
-
var type = typeof value;
|
|
373
|
-
if (type == 'number' || type == 'symbol' || type == 'boolean' ||
|
|
374
|
-
value == null || isSymbol_1(value)) {
|
|
375
|
-
return true;
|
|
376
|
-
}
|
|
377
|
-
return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||
|
|
378
|
-
(object != null && value in Object(object));
|
|
379
|
-
}
|
|
380
|
-
|
|
381
|
-
var _isKey = isKey;
|
|
382
|
-
|
|
383
|
-
/**
|
|
384
|
-
* Checks if `value` is the
|
|
385
|
-
* [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
|
|
386
|
-
* of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
|
|
387
|
-
*
|
|
388
|
-
* @static
|
|
389
|
-
* @memberOf _
|
|
390
|
-
* @since 0.1.0
|
|
391
|
-
* @category Lang
|
|
392
|
-
* @param {*} value The value to check.
|
|
393
|
-
* @returns {boolean} Returns `true` if `value` is an object, else `false`.
|
|
394
|
-
* @example
|
|
395
|
-
*
|
|
396
|
-
* _.isObject({});
|
|
397
|
-
* // => true
|
|
398
|
-
*
|
|
399
|
-
* _.isObject([1, 2, 3]);
|
|
400
|
-
* // => true
|
|
401
|
-
*
|
|
402
|
-
* _.isObject(_.noop);
|
|
403
|
-
* // => true
|
|
404
|
-
*
|
|
405
|
-
* _.isObject(null);
|
|
406
|
-
* // => false
|
|
407
|
-
*/
|
|
408
|
-
function isObject(value) {
|
|
409
|
-
var type = typeof value;
|
|
410
|
-
return value != null && (type == 'object' || type == 'function');
|
|
411
|
-
}
|
|
412
|
-
|
|
413
|
-
var isObject_1 = isObject;
|
|
414
|
-
|
|
415
|
-
/** `Object#toString` result references. */
|
|
416
|
-
var asyncTag = '[object AsyncFunction]',
|
|
417
|
-
funcTag = '[object Function]',
|
|
418
|
-
genTag = '[object GeneratorFunction]',
|
|
419
|
-
proxyTag = '[object Proxy]';
|
|
420
|
-
|
|
421
|
-
/**
|
|
422
|
-
* Checks if `value` is classified as a `Function` object.
|
|
423
|
-
*
|
|
424
|
-
* @static
|
|
425
|
-
* @memberOf _
|
|
426
|
-
* @since 0.1.0
|
|
427
|
-
* @category Lang
|
|
428
|
-
* @param {*} value The value to check.
|
|
429
|
-
* @returns {boolean} Returns `true` if `value` is a function, else `false`.
|
|
430
|
-
* @example
|
|
431
|
-
*
|
|
432
|
-
* _.isFunction(_);
|
|
433
|
-
* // => true
|
|
434
|
-
*
|
|
435
|
-
* _.isFunction(/abc/);
|
|
436
|
-
* // => false
|
|
437
|
-
*/
|
|
438
|
-
function isFunction(value) {
|
|
439
|
-
if (!isObject_1(value)) {
|
|
440
|
-
return false;
|
|
441
|
-
}
|
|
442
|
-
// The use of `Object#toString` avoids issues with the `typeof` operator
|
|
443
|
-
// in Safari 9 which returns 'object' for typed arrays and other constructors.
|
|
444
|
-
var tag = _baseGetTag(value);
|
|
445
|
-
return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
|
|
446
|
-
}
|
|
447
|
-
|
|
448
|
-
var isFunction_1 = isFunction;
|
|
449
|
-
|
|
450
|
-
/** Used to detect overreaching core-js shims. */
|
|
451
|
-
var coreJsData = _root['__core-js_shared__'];
|
|
452
|
-
|
|
453
|
-
var _coreJsData = coreJsData;
|
|
454
|
-
|
|
455
|
-
/** Used to detect methods masquerading as native. */
|
|
456
|
-
var maskSrcKey = (function() {
|
|
457
|
-
var uid = /[^.]+$/.exec(_coreJsData && _coreJsData.keys && _coreJsData.keys.IE_PROTO || '');
|
|
458
|
-
return uid ? ('Symbol(src)_1.' + uid) : '';
|
|
459
|
-
}());
|
|
460
|
-
|
|
461
|
-
/**
|
|
462
|
-
* Checks if `func` has its source masked.
|
|
463
|
-
*
|
|
464
|
-
* @private
|
|
465
|
-
* @param {Function} func The function to check.
|
|
466
|
-
* @returns {boolean} Returns `true` if `func` is masked, else `false`.
|
|
467
|
-
*/
|
|
468
|
-
function isMasked(func) {
|
|
469
|
-
return !!maskSrcKey && (maskSrcKey in func);
|
|
470
|
-
}
|
|
471
|
-
|
|
472
|
-
var _isMasked = isMasked;
|
|
473
|
-
|
|
474
|
-
/** Used for built-in method references. */
|
|
475
|
-
var funcProto$1 = Function.prototype;
|
|
476
|
-
|
|
477
|
-
/** Used to resolve the decompiled source of functions. */
|
|
478
|
-
var funcToString$1 = funcProto$1.toString;
|
|
479
|
-
|
|
480
|
-
/**
|
|
481
|
-
* Converts `func` to its source code.
|
|
482
|
-
*
|
|
483
|
-
* @private
|
|
484
|
-
* @param {Function} func The function to convert.
|
|
485
|
-
* @returns {string} Returns the source code.
|
|
486
|
-
*/
|
|
487
|
-
function toSource(func) {
|
|
488
|
-
if (func != null) {
|
|
489
|
-
try {
|
|
490
|
-
return funcToString$1.call(func);
|
|
491
|
-
} catch (e) {}
|
|
492
|
-
try {
|
|
493
|
-
return (func + '');
|
|
494
|
-
} catch (e) {}
|
|
495
|
-
}
|
|
496
|
-
return '';
|
|
497
|
-
}
|
|
498
|
-
|
|
499
|
-
var _toSource = toSource;
|
|
500
|
-
|
|
501
|
-
/**
|
|
502
|
-
* Used to match `RegExp`
|
|
503
|
-
* [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
|
|
504
|
-
*/
|
|
505
|
-
var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
|
|
506
|
-
|
|
507
|
-
/** Used to detect host constructors (Safari). */
|
|
508
|
-
var reIsHostCtor = /^\[object .+?Constructor\]$/;
|
|
509
|
-
|
|
510
|
-
/** Used for built-in method references. */
|
|
511
|
-
var funcProto = Function.prototype,
|
|
512
|
-
objectProto$2 = Object.prototype;
|
|
513
|
-
|
|
514
|
-
/** Used to resolve the decompiled source of functions. */
|
|
515
|
-
var funcToString = funcProto.toString;
|
|
516
|
-
|
|
517
|
-
/** Used to check objects for own properties. */
|
|
518
|
-
var hasOwnProperty$2 = objectProto$2.hasOwnProperty;
|
|
519
|
-
|
|
520
|
-
/** Used to detect if a method is native. */
|
|
521
|
-
var reIsNative = RegExp('^' +
|
|
522
|
-
funcToString.call(hasOwnProperty$2).replace(reRegExpChar, '\\$&')
|
|
523
|
-
.replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
|
|
524
|
-
);
|
|
525
|
-
|
|
526
|
-
/**
|
|
527
|
-
* The base implementation of `_.isNative` without bad shim checks.
|
|
528
|
-
*
|
|
529
|
-
* @private
|
|
530
|
-
* @param {*} value The value to check.
|
|
531
|
-
* @returns {boolean} Returns `true` if `value` is a native function,
|
|
532
|
-
* else `false`.
|
|
533
|
-
*/
|
|
534
|
-
function baseIsNative(value) {
|
|
535
|
-
if (!isObject_1(value) || _isMasked(value)) {
|
|
536
|
-
return false;
|
|
537
|
-
}
|
|
538
|
-
var pattern = isFunction_1(value) ? reIsNative : reIsHostCtor;
|
|
539
|
-
return pattern.test(_toSource(value));
|
|
540
|
-
}
|
|
541
|
-
|
|
542
|
-
var _baseIsNative = baseIsNative;
|
|
543
|
-
|
|
544
|
-
/**
|
|
545
|
-
* Gets the value at `key` of `object`.
|
|
546
|
-
*
|
|
547
|
-
* @private
|
|
548
|
-
* @param {Object} [object] The object to query.
|
|
549
|
-
* @param {string} key The key of the property to get.
|
|
550
|
-
* @returns {*} Returns the property value.
|
|
551
|
-
*/
|
|
552
|
-
function getValue(object, key) {
|
|
553
|
-
return object == null ? undefined : object[key];
|
|
554
|
-
}
|
|
555
|
-
|
|
556
|
-
var _getValue = getValue;
|
|
557
|
-
|
|
558
|
-
/**
|
|
559
|
-
* Gets the native function at `key` of `object`.
|
|
560
|
-
*
|
|
561
|
-
* @private
|
|
562
|
-
* @param {Object} object The object to query.
|
|
563
|
-
* @param {string} key The key of the method to get.
|
|
564
|
-
* @returns {*} Returns the function if it's native, else `undefined`.
|
|
565
|
-
*/
|
|
566
|
-
function getNative(object, key) {
|
|
567
|
-
var value = _getValue(object, key);
|
|
568
|
-
return _baseIsNative(value) ? value : undefined;
|
|
569
|
-
}
|
|
570
|
-
|
|
571
|
-
var _getNative = getNative;
|
|
572
|
-
|
|
573
|
-
/* Built-in method references that are verified to be native. */
|
|
574
|
-
var nativeCreate = _getNative(Object, 'create');
|
|
575
|
-
|
|
576
|
-
var _nativeCreate = nativeCreate;
|
|
577
|
-
|
|
578
|
-
/**
|
|
579
|
-
* Removes all key-value entries from the hash.
|
|
580
|
-
*
|
|
581
|
-
* @private
|
|
582
|
-
* @name clear
|
|
583
|
-
* @memberOf Hash
|
|
584
|
-
*/
|
|
585
|
-
function hashClear() {
|
|
586
|
-
this.__data__ = _nativeCreate ? _nativeCreate(null) : {};
|
|
587
|
-
this.size = 0;
|
|
588
|
-
}
|
|
589
|
-
|
|
590
|
-
var _hashClear = hashClear;
|
|
591
|
-
|
|
592
|
-
/**
|
|
593
|
-
* Removes `key` and its value from the hash.
|
|
594
|
-
*
|
|
595
|
-
* @private
|
|
596
|
-
* @name delete
|
|
597
|
-
* @memberOf Hash
|
|
598
|
-
* @param {Object} hash The hash to modify.
|
|
599
|
-
* @param {string} key The key of the value to remove.
|
|
600
|
-
* @returns {boolean} Returns `true` if the entry was removed, else `false`.
|
|
601
|
-
*/
|
|
602
|
-
function hashDelete(key) {
|
|
603
|
-
var result = this.has(key) && delete this.__data__[key];
|
|
604
|
-
this.size -= result ? 1 : 0;
|
|
605
|
-
return result;
|
|
606
|
-
}
|
|
607
|
-
|
|
608
|
-
var _hashDelete = hashDelete;
|
|
609
|
-
|
|
610
|
-
/** Used to stand-in for `undefined` hash values. */
|
|
611
|
-
var HASH_UNDEFINED$1 = '__lodash_hash_undefined__';
|
|
612
|
-
|
|
613
|
-
/** Used for built-in method references. */
|
|
614
|
-
var objectProto$1 = Object.prototype;
|
|
615
|
-
|
|
616
|
-
/** Used to check objects for own properties. */
|
|
617
|
-
var hasOwnProperty$1 = objectProto$1.hasOwnProperty;
|
|
618
|
-
|
|
619
|
-
/**
|
|
620
|
-
* Gets the hash value for `key`.
|
|
621
|
-
*
|
|
622
|
-
* @private
|
|
623
|
-
* @name get
|
|
624
|
-
* @memberOf Hash
|
|
625
|
-
* @param {string} key The key of the value to get.
|
|
626
|
-
* @returns {*} Returns the entry value.
|
|
627
|
-
*/
|
|
628
|
-
function hashGet(key) {
|
|
629
|
-
var data = this.__data__;
|
|
630
|
-
if (_nativeCreate) {
|
|
631
|
-
var result = data[key];
|
|
632
|
-
return result === HASH_UNDEFINED$1 ? undefined : result;
|
|
633
|
-
}
|
|
634
|
-
return hasOwnProperty$1.call(data, key) ? data[key] : undefined;
|
|
635
|
-
}
|
|
636
|
-
|
|
637
|
-
var _hashGet = hashGet;
|
|
638
|
-
|
|
639
|
-
/** Used for built-in method references. */
|
|
640
|
-
var objectProto = Object.prototype;
|
|
641
|
-
|
|
642
|
-
/** Used to check objects for own properties. */
|
|
643
|
-
var hasOwnProperty = objectProto.hasOwnProperty;
|
|
644
|
-
|
|
645
|
-
/**
|
|
646
|
-
* Checks if a hash value for `key` exists.
|
|
647
|
-
*
|
|
648
|
-
* @private
|
|
649
|
-
* @name has
|
|
650
|
-
* @memberOf Hash
|
|
651
|
-
* @param {string} key The key of the entry to check.
|
|
652
|
-
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
|
|
653
|
-
*/
|
|
654
|
-
function hashHas(key) {
|
|
655
|
-
var data = this.__data__;
|
|
656
|
-
return _nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);
|
|
657
|
-
}
|
|
658
|
-
|
|
659
|
-
var _hashHas = hashHas;
|
|
660
|
-
|
|
661
|
-
/** Used to stand-in for `undefined` hash values. */
|
|
662
|
-
var HASH_UNDEFINED = '__lodash_hash_undefined__';
|
|
663
|
-
|
|
664
|
-
/**
|
|
665
|
-
* Sets the hash `key` to `value`.
|
|
666
|
-
*
|
|
667
|
-
* @private
|
|
668
|
-
* @name set
|
|
669
|
-
* @memberOf Hash
|
|
670
|
-
* @param {string} key The key of the value to set.
|
|
671
|
-
* @param {*} value The value to set.
|
|
672
|
-
* @returns {Object} Returns the hash instance.
|
|
673
|
-
*/
|
|
674
|
-
function hashSet(key, value) {
|
|
675
|
-
var data = this.__data__;
|
|
676
|
-
this.size += this.has(key) ? 0 : 1;
|
|
677
|
-
data[key] = (_nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
|
|
678
|
-
return this;
|
|
679
|
-
}
|
|
680
|
-
|
|
681
|
-
var _hashSet = hashSet;
|
|
682
|
-
|
|
683
|
-
/**
|
|
684
|
-
* Creates a hash object.
|
|
685
|
-
*
|
|
686
|
-
* @private
|
|
687
|
-
* @constructor
|
|
688
|
-
* @param {Array} [entries] The key-value pairs to cache.
|
|
689
|
-
*/
|
|
690
|
-
function Hash(entries) {
|
|
691
|
-
var index = -1,
|
|
692
|
-
length = entries == null ? 0 : entries.length;
|
|
693
|
-
|
|
694
|
-
this.clear();
|
|
695
|
-
while (++index < length) {
|
|
696
|
-
var entry = entries[index];
|
|
697
|
-
this.set(entry[0], entry[1]);
|
|
698
|
-
}
|
|
699
|
-
}
|
|
700
|
-
|
|
701
|
-
// Add methods to `Hash`.
|
|
702
|
-
Hash.prototype.clear = _hashClear;
|
|
703
|
-
Hash.prototype['delete'] = _hashDelete;
|
|
704
|
-
Hash.prototype.get = _hashGet;
|
|
705
|
-
Hash.prototype.has = _hashHas;
|
|
706
|
-
Hash.prototype.set = _hashSet;
|
|
707
|
-
|
|
708
|
-
var _Hash = Hash;
|
|
709
|
-
|
|
710
|
-
/**
|
|
711
|
-
* Removes all key-value entries from the list cache.
|
|
712
|
-
*
|
|
713
|
-
* @private
|
|
714
|
-
* @name clear
|
|
715
|
-
* @memberOf ListCache
|
|
716
|
-
*/
|
|
717
|
-
function listCacheClear() {
|
|
718
|
-
this.__data__ = [];
|
|
719
|
-
this.size = 0;
|
|
720
|
-
}
|
|
721
|
-
|
|
722
|
-
var _listCacheClear = listCacheClear;
|
|
723
|
-
|
|
724
|
-
/**
|
|
725
|
-
* Performs a
|
|
726
|
-
* [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
|
|
727
|
-
* comparison between two values to determine if they are equivalent.
|
|
728
|
-
*
|
|
729
|
-
* @static
|
|
730
|
-
* @memberOf _
|
|
731
|
-
* @since 4.0.0
|
|
732
|
-
* @category Lang
|
|
733
|
-
* @param {*} value The value to compare.
|
|
734
|
-
* @param {*} other The other value to compare.
|
|
735
|
-
* @returns {boolean} Returns `true` if the values are equivalent, else `false`.
|
|
736
|
-
* @example
|
|
737
|
-
*
|
|
738
|
-
* var object = { 'a': 1 };
|
|
739
|
-
* var other = { 'a': 1 };
|
|
740
|
-
*
|
|
741
|
-
* _.eq(object, object);
|
|
742
|
-
* // => true
|
|
743
|
-
*
|
|
744
|
-
* _.eq(object, other);
|
|
745
|
-
* // => false
|
|
746
|
-
*
|
|
747
|
-
* _.eq('a', 'a');
|
|
748
|
-
* // => true
|
|
749
|
-
*
|
|
750
|
-
* _.eq('a', Object('a'));
|
|
751
|
-
* // => false
|
|
752
|
-
*
|
|
753
|
-
* _.eq(NaN, NaN);
|
|
754
|
-
* // => true
|
|
755
|
-
*/
|
|
756
|
-
function eq(value, other) {
|
|
757
|
-
return value === other || (value !== value && other !== other);
|
|
758
|
-
}
|
|
759
|
-
|
|
760
|
-
var eq_1 = eq;
|
|
761
|
-
|
|
762
|
-
/**
|
|
763
|
-
* Gets the index at which the `key` is found in `array` of key-value pairs.
|
|
764
|
-
*
|
|
765
|
-
* @private
|
|
766
|
-
* @param {Array} array The array to inspect.
|
|
767
|
-
* @param {*} key The key to search for.
|
|
768
|
-
* @returns {number} Returns the index of the matched value, else `-1`.
|
|
769
|
-
*/
|
|
770
|
-
function assocIndexOf(array, key) {
|
|
771
|
-
var length = array.length;
|
|
772
|
-
while (length--) {
|
|
773
|
-
if (eq_1(array[length][0], key)) {
|
|
774
|
-
return length;
|
|
775
|
-
}
|
|
776
|
-
}
|
|
777
|
-
return -1;
|
|
778
|
-
}
|
|
779
|
-
|
|
780
|
-
var _assocIndexOf = assocIndexOf;
|
|
781
|
-
|
|
782
|
-
/** Used for built-in method references. */
|
|
783
|
-
var arrayProto = Array.prototype;
|
|
784
|
-
|
|
785
|
-
/** Built-in value references. */
|
|
786
|
-
var splice = arrayProto.splice;
|
|
787
|
-
|
|
788
|
-
/**
|
|
789
|
-
* Removes `key` and its value from the list cache.
|
|
790
|
-
*
|
|
791
|
-
* @private
|
|
792
|
-
* @name delete
|
|
793
|
-
* @memberOf ListCache
|
|
794
|
-
* @param {string} key The key of the value to remove.
|
|
795
|
-
* @returns {boolean} Returns `true` if the entry was removed, else `false`.
|
|
796
|
-
*/
|
|
797
|
-
function listCacheDelete(key) {
|
|
798
|
-
var data = this.__data__,
|
|
799
|
-
index = _assocIndexOf(data, key);
|
|
800
|
-
|
|
801
|
-
if (index < 0) {
|
|
802
|
-
return false;
|
|
803
|
-
}
|
|
804
|
-
var lastIndex = data.length - 1;
|
|
805
|
-
if (index == lastIndex) {
|
|
806
|
-
data.pop();
|
|
807
|
-
} else {
|
|
808
|
-
splice.call(data, index, 1);
|
|
809
|
-
}
|
|
810
|
-
--this.size;
|
|
811
|
-
return true;
|
|
812
|
-
}
|
|
813
|
-
|
|
814
|
-
var _listCacheDelete = listCacheDelete;
|
|
815
|
-
|
|
816
|
-
/**
|
|
817
|
-
* Gets the list cache value for `key`.
|
|
818
|
-
*
|
|
819
|
-
* @private
|
|
820
|
-
* @name get
|
|
821
|
-
* @memberOf ListCache
|
|
822
|
-
* @param {string} key The key of the value to get.
|
|
823
|
-
* @returns {*} Returns the entry value.
|
|
824
|
-
*/
|
|
825
|
-
function listCacheGet(key) {
|
|
826
|
-
var data = this.__data__,
|
|
827
|
-
index = _assocIndexOf(data, key);
|
|
828
|
-
|
|
829
|
-
return index < 0 ? undefined : data[index][1];
|
|
830
|
-
}
|
|
831
|
-
|
|
832
|
-
var _listCacheGet = listCacheGet;
|
|
833
|
-
|
|
834
|
-
/**
|
|
835
|
-
* Checks if a list cache value for `key` exists.
|
|
836
|
-
*
|
|
837
|
-
* @private
|
|
838
|
-
* @name has
|
|
839
|
-
* @memberOf ListCache
|
|
840
|
-
* @param {string} key The key of the entry to check.
|
|
841
|
-
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
|
|
842
|
-
*/
|
|
843
|
-
function listCacheHas(key) {
|
|
844
|
-
return _assocIndexOf(this.__data__, key) > -1;
|
|
845
|
-
}
|
|
846
|
-
|
|
847
|
-
var _listCacheHas = listCacheHas;
|
|
848
|
-
|
|
849
|
-
/**
|
|
850
|
-
* Sets the list cache `key` to `value`.
|
|
851
|
-
*
|
|
852
|
-
* @private
|
|
853
|
-
* @name set
|
|
854
|
-
* @memberOf ListCache
|
|
855
|
-
* @param {string} key The key of the value to set.
|
|
856
|
-
* @param {*} value The value to set.
|
|
857
|
-
* @returns {Object} Returns the list cache instance.
|
|
858
|
-
*/
|
|
859
|
-
function listCacheSet(key, value) {
|
|
860
|
-
var data = this.__data__,
|
|
861
|
-
index = _assocIndexOf(data, key);
|
|
862
|
-
|
|
863
|
-
if (index < 0) {
|
|
864
|
-
++this.size;
|
|
865
|
-
data.push([key, value]);
|
|
866
|
-
} else {
|
|
867
|
-
data[index][1] = value;
|
|
868
|
-
}
|
|
869
|
-
return this;
|
|
870
|
-
}
|
|
871
|
-
|
|
872
|
-
var _listCacheSet = listCacheSet;
|
|
873
|
-
|
|
874
|
-
/**
|
|
875
|
-
* Creates an list cache object.
|
|
876
|
-
*
|
|
877
|
-
* @private
|
|
878
|
-
* @constructor
|
|
879
|
-
* @param {Array} [entries] The key-value pairs to cache.
|
|
880
|
-
*/
|
|
881
|
-
function ListCache(entries) {
|
|
882
|
-
var index = -1,
|
|
883
|
-
length = entries == null ? 0 : entries.length;
|
|
884
|
-
|
|
885
|
-
this.clear();
|
|
886
|
-
while (++index < length) {
|
|
887
|
-
var entry = entries[index];
|
|
888
|
-
this.set(entry[0], entry[1]);
|
|
889
|
-
}
|
|
890
|
-
}
|
|
891
|
-
|
|
892
|
-
// Add methods to `ListCache`.
|
|
893
|
-
ListCache.prototype.clear = _listCacheClear;
|
|
894
|
-
ListCache.prototype['delete'] = _listCacheDelete;
|
|
895
|
-
ListCache.prototype.get = _listCacheGet;
|
|
896
|
-
ListCache.prototype.has = _listCacheHas;
|
|
897
|
-
ListCache.prototype.set = _listCacheSet;
|
|
898
|
-
|
|
899
|
-
var _ListCache = ListCache;
|
|
900
|
-
|
|
901
|
-
/* Built-in method references that are verified to be native. */
|
|
902
|
-
var Map = _getNative(_root, 'Map');
|
|
903
|
-
|
|
904
|
-
var _Map = Map;
|
|
905
|
-
|
|
906
|
-
/**
|
|
907
|
-
* Removes all key-value entries from the map.
|
|
908
|
-
*
|
|
909
|
-
* @private
|
|
910
|
-
* @name clear
|
|
911
|
-
* @memberOf MapCache
|
|
912
|
-
*/
|
|
913
|
-
function mapCacheClear() {
|
|
914
|
-
this.size = 0;
|
|
915
|
-
this.__data__ = {
|
|
916
|
-
'hash': new _Hash,
|
|
917
|
-
'map': new (_Map || _ListCache),
|
|
918
|
-
'string': new _Hash
|
|
919
|
-
};
|
|
920
|
-
}
|
|
921
|
-
|
|
922
|
-
var _mapCacheClear = mapCacheClear;
|
|
923
|
-
|
|
924
|
-
/**
|
|
925
|
-
* Checks if `value` is suitable for use as unique object key.
|
|
926
|
-
*
|
|
927
|
-
* @private
|
|
928
|
-
* @param {*} value The value to check.
|
|
929
|
-
* @returns {boolean} Returns `true` if `value` is suitable, else `false`.
|
|
930
|
-
*/
|
|
931
|
-
function isKeyable(value) {
|
|
932
|
-
var type = typeof value;
|
|
933
|
-
return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
|
|
934
|
-
? (value !== '__proto__')
|
|
935
|
-
: (value === null);
|
|
936
|
-
}
|
|
937
|
-
|
|
938
|
-
var _isKeyable = isKeyable;
|
|
939
|
-
|
|
940
|
-
/**
|
|
941
|
-
* Gets the data for `map`.
|
|
942
|
-
*
|
|
943
|
-
* @private
|
|
944
|
-
* @param {Object} map The map to query.
|
|
945
|
-
* @param {string} key The reference key.
|
|
946
|
-
* @returns {*} Returns the map data.
|
|
947
|
-
*/
|
|
948
|
-
function getMapData(map, key) {
|
|
949
|
-
var data = map.__data__;
|
|
950
|
-
return _isKeyable(key)
|
|
951
|
-
? data[typeof key == 'string' ? 'string' : 'hash']
|
|
952
|
-
: data.map;
|
|
953
|
-
}
|
|
954
|
-
|
|
955
|
-
var _getMapData = getMapData;
|
|
956
|
-
|
|
957
|
-
/**
|
|
958
|
-
* Removes `key` and its value from the map.
|
|
959
|
-
*
|
|
960
|
-
* @private
|
|
961
|
-
* @name delete
|
|
962
|
-
* @memberOf MapCache
|
|
963
|
-
* @param {string} key The key of the value to remove.
|
|
964
|
-
* @returns {boolean} Returns `true` if the entry was removed, else `false`.
|
|
965
|
-
*/
|
|
966
|
-
function mapCacheDelete(key) {
|
|
967
|
-
var result = _getMapData(this, key)['delete'](key);
|
|
968
|
-
this.size -= result ? 1 : 0;
|
|
969
|
-
return result;
|
|
970
|
-
}
|
|
971
|
-
|
|
972
|
-
var _mapCacheDelete = mapCacheDelete;
|
|
973
|
-
|
|
974
|
-
/**
|
|
975
|
-
* Gets the map value for `key`.
|
|
976
|
-
*
|
|
977
|
-
* @private
|
|
978
|
-
* @name get
|
|
979
|
-
* @memberOf MapCache
|
|
980
|
-
* @param {string} key The key of the value to get.
|
|
981
|
-
* @returns {*} Returns the entry value.
|
|
982
|
-
*/
|
|
983
|
-
function mapCacheGet(key) {
|
|
984
|
-
return _getMapData(this, key).get(key);
|
|
985
|
-
}
|
|
986
|
-
|
|
987
|
-
var _mapCacheGet = mapCacheGet;
|
|
988
|
-
|
|
989
|
-
/**
|
|
990
|
-
* Checks if a map value for `key` exists.
|
|
991
|
-
*
|
|
992
|
-
* @private
|
|
993
|
-
* @name has
|
|
994
|
-
* @memberOf MapCache
|
|
995
|
-
* @param {string} key The key of the entry to check.
|
|
996
|
-
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
|
|
997
|
-
*/
|
|
998
|
-
function mapCacheHas(key) {
|
|
999
|
-
return _getMapData(this, key).has(key);
|
|
1000
|
-
}
|
|
1001
|
-
|
|
1002
|
-
var _mapCacheHas = mapCacheHas;
|
|
1003
|
-
|
|
1004
|
-
/**
|
|
1005
|
-
* Sets the map `key` to `value`.
|
|
1006
|
-
*
|
|
1007
|
-
* @private
|
|
1008
|
-
* @name set
|
|
1009
|
-
* @memberOf MapCache
|
|
1010
|
-
* @param {string} key The key of the value to set.
|
|
1011
|
-
* @param {*} value The value to set.
|
|
1012
|
-
* @returns {Object} Returns the map cache instance.
|
|
1013
|
-
*/
|
|
1014
|
-
function mapCacheSet(key, value) {
|
|
1015
|
-
var data = _getMapData(this, key),
|
|
1016
|
-
size = data.size;
|
|
1017
|
-
|
|
1018
|
-
data.set(key, value);
|
|
1019
|
-
this.size += data.size == size ? 0 : 1;
|
|
1020
|
-
return this;
|
|
1021
|
-
}
|
|
1022
|
-
|
|
1023
|
-
var _mapCacheSet = mapCacheSet;
|
|
1024
|
-
|
|
1025
|
-
/**
|
|
1026
|
-
* Creates a map cache object to store key-value pairs.
|
|
1027
|
-
*
|
|
1028
|
-
* @private
|
|
1029
|
-
* @constructor
|
|
1030
|
-
* @param {Array} [entries] The key-value pairs to cache.
|
|
1031
|
-
*/
|
|
1032
|
-
function MapCache(entries) {
|
|
1033
|
-
var index = -1,
|
|
1034
|
-
length = entries == null ? 0 : entries.length;
|
|
1035
|
-
|
|
1036
|
-
this.clear();
|
|
1037
|
-
while (++index < length) {
|
|
1038
|
-
var entry = entries[index];
|
|
1039
|
-
this.set(entry[0], entry[1]);
|
|
1040
|
-
}
|
|
1041
|
-
}
|
|
1042
|
-
|
|
1043
|
-
// Add methods to `MapCache`.
|
|
1044
|
-
MapCache.prototype.clear = _mapCacheClear;
|
|
1045
|
-
MapCache.prototype['delete'] = _mapCacheDelete;
|
|
1046
|
-
MapCache.prototype.get = _mapCacheGet;
|
|
1047
|
-
MapCache.prototype.has = _mapCacheHas;
|
|
1048
|
-
MapCache.prototype.set = _mapCacheSet;
|
|
1049
|
-
|
|
1050
|
-
var _MapCache = MapCache;
|
|
1051
|
-
|
|
1052
|
-
/** Error message constants. */
|
|
1053
|
-
var FUNC_ERROR_TEXT = 'Expected a function';
|
|
1054
|
-
|
|
1055
|
-
/**
|
|
1056
|
-
* Creates a function that memoizes the result of `func`. If `resolver` is
|
|
1057
|
-
* provided, it determines the cache key for storing the result based on the
|
|
1058
|
-
* arguments provided to the memoized function. By default, the first argument
|
|
1059
|
-
* provided to the memoized function is used as the map cache key. The `func`
|
|
1060
|
-
* is invoked with the `this` binding of the memoized function.
|
|
1061
|
-
*
|
|
1062
|
-
* **Note:** The cache is exposed as the `cache` property on the memoized
|
|
1063
|
-
* function. Its creation may be customized by replacing the `_.memoize.Cache`
|
|
1064
|
-
* constructor with one whose instances implement the
|
|
1065
|
-
* [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
|
|
1066
|
-
* method interface of `clear`, `delete`, `get`, `has`, and `set`.
|
|
1067
|
-
*
|
|
1068
|
-
* @static
|
|
1069
|
-
* @memberOf _
|
|
1070
|
-
* @since 0.1.0
|
|
1071
|
-
* @category Function
|
|
1072
|
-
* @param {Function} func The function to have its output memoized.
|
|
1073
|
-
* @param {Function} [resolver] The function to resolve the cache key.
|
|
1074
|
-
* @returns {Function} Returns the new memoized function.
|
|
1075
|
-
* @example
|
|
1076
|
-
*
|
|
1077
|
-
* var object = { 'a': 1, 'b': 2 };
|
|
1078
|
-
* var other = { 'c': 3, 'd': 4 };
|
|
1079
|
-
*
|
|
1080
|
-
* var values = _.memoize(_.values);
|
|
1081
|
-
* values(object);
|
|
1082
|
-
* // => [1, 2]
|
|
1083
|
-
*
|
|
1084
|
-
* values(other);
|
|
1085
|
-
* // => [3, 4]
|
|
1086
|
-
*
|
|
1087
|
-
* object.a = 2;
|
|
1088
|
-
* values(object);
|
|
1089
|
-
* // => [1, 2]
|
|
1090
|
-
*
|
|
1091
|
-
* // Modify the result cache.
|
|
1092
|
-
* values.cache.set(object, ['a', 'b']);
|
|
1093
|
-
* values(object);
|
|
1094
|
-
* // => ['a', 'b']
|
|
1095
|
-
*
|
|
1096
|
-
* // Replace `_.memoize.Cache`.
|
|
1097
|
-
* _.memoize.Cache = WeakMap;
|
|
1098
|
-
*/
|
|
1099
|
-
function memoize(func, resolver) {
|
|
1100
|
-
if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) {
|
|
1101
|
-
throw new TypeError(FUNC_ERROR_TEXT);
|
|
1102
|
-
}
|
|
1103
|
-
var memoized = function() {
|
|
1104
|
-
var args = arguments,
|
|
1105
|
-
key = resolver ? resolver.apply(this, args) : args[0],
|
|
1106
|
-
cache = memoized.cache;
|
|
1107
|
-
|
|
1108
|
-
if (cache.has(key)) {
|
|
1109
|
-
return cache.get(key);
|
|
1110
|
-
}
|
|
1111
|
-
var result = func.apply(this, args);
|
|
1112
|
-
memoized.cache = cache.set(key, result) || cache;
|
|
1113
|
-
return result;
|
|
1114
|
-
};
|
|
1115
|
-
memoized.cache = new (memoize.Cache || _MapCache);
|
|
1116
|
-
return memoized;
|
|
1117
|
-
}
|
|
1118
|
-
|
|
1119
|
-
// Expose `MapCache`.
|
|
1120
|
-
memoize.Cache = _MapCache;
|
|
1121
|
-
|
|
1122
|
-
var memoize_1 = memoize;
|
|
1123
|
-
|
|
1124
|
-
/** Used as the maximum memoize cache size. */
|
|
1125
|
-
var MAX_MEMOIZE_SIZE = 500;
|
|
1126
|
-
|
|
1127
|
-
/**
|
|
1128
|
-
* A specialized version of `_.memoize` which clears the memoized function's
|
|
1129
|
-
* cache when it exceeds `MAX_MEMOIZE_SIZE`.
|
|
1130
|
-
*
|
|
1131
|
-
* @private
|
|
1132
|
-
* @param {Function} func The function to have its output memoized.
|
|
1133
|
-
* @returns {Function} Returns the new memoized function.
|
|
1134
|
-
*/
|
|
1135
|
-
function memoizeCapped(func) {
|
|
1136
|
-
var result = memoize_1(func, function(key) {
|
|
1137
|
-
if (cache.size === MAX_MEMOIZE_SIZE) {
|
|
1138
|
-
cache.clear();
|
|
1139
|
-
}
|
|
1140
|
-
return key;
|
|
1141
|
-
});
|
|
1142
|
-
|
|
1143
|
-
var cache = result.cache;
|
|
1144
|
-
return result;
|
|
1145
|
-
}
|
|
1146
|
-
|
|
1147
|
-
var _memoizeCapped = memoizeCapped;
|
|
1148
|
-
|
|
1149
|
-
/** Used to match property names within property paths. */
|
|
1150
|
-
var rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
|
|
1151
|
-
|
|
1152
|
-
/** Used to match backslashes in property paths. */
|
|
1153
|
-
var reEscapeChar = /\\(\\)?/g;
|
|
1154
|
-
|
|
1155
|
-
/**
|
|
1156
|
-
* Converts `string` to a property path array.
|
|
1157
|
-
*
|
|
1158
|
-
* @private
|
|
1159
|
-
* @param {string} string The string to convert.
|
|
1160
|
-
* @returns {Array} Returns the property path array.
|
|
1161
|
-
*/
|
|
1162
|
-
var stringToPath = _memoizeCapped(function(string) {
|
|
1163
|
-
var result = [];
|
|
1164
|
-
if (string.charCodeAt(0) === 46 /* . */) {
|
|
1165
|
-
result.push('');
|
|
1166
|
-
}
|
|
1167
|
-
string.replace(rePropName, function(match, number, quote, subString) {
|
|
1168
|
-
result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match));
|
|
1169
|
-
});
|
|
1170
|
-
return result;
|
|
1171
|
-
});
|
|
1172
|
-
|
|
1173
|
-
var _stringToPath = stringToPath;
|
|
1174
|
-
|
|
1175
|
-
/**
|
|
1176
|
-
* A specialized version of `_.map` for arrays without support for iteratee
|
|
1177
|
-
* shorthands.
|
|
1178
|
-
*
|
|
1179
|
-
* @private
|
|
1180
|
-
* @param {Array} [array] The array to iterate over.
|
|
1181
|
-
* @param {Function} iteratee The function invoked per iteration.
|
|
1182
|
-
* @returns {Array} Returns the new mapped array.
|
|
1183
|
-
*/
|
|
1184
|
-
function arrayMap(array, iteratee) {
|
|
1185
|
-
var index = -1,
|
|
1186
|
-
length = array == null ? 0 : array.length,
|
|
1187
|
-
result = Array(length);
|
|
1188
|
-
|
|
1189
|
-
while (++index < length) {
|
|
1190
|
-
result[index] = iteratee(array[index], index, array);
|
|
1191
|
-
}
|
|
1192
|
-
return result;
|
|
1193
|
-
}
|
|
1194
|
-
|
|
1195
|
-
var _arrayMap = arrayMap;
|
|
1196
|
-
|
|
1197
|
-
/** Used as references for various `Number` constants. */
|
|
1198
|
-
var INFINITY$1 = 1 / 0;
|
|
1199
|
-
|
|
1200
|
-
/** Used to convert symbols to primitives and strings. */
|
|
1201
|
-
var symbolProto = _Symbol ? _Symbol.prototype : undefined,
|
|
1202
|
-
symbolToString = symbolProto ? symbolProto.toString : undefined;
|
|
1203
|
-
|
|
1204
|
-
/**
|
|
1205
|
-
* The base implementation of `_.toString` which doesn't convert nullish
|
|
1206
|
-
* values to empty strings.
|
|
1207
|
-
*
|
|
1208
|
-
* @private
|
|
1209
|
-
* @param {*} value The value to process.
|
|
1210
|
-
* @returns {string} Returns the string.
|
|
1211
|
-
*/
|
|
1212
|
-
function baseToString(value) {
|
|
1213
|
-
// Exit early for strings to avoid a performance hit in some environments.
|
|
1214
|
-
if (typeof value == 'string') {
|
|
1215
|
-
return value;
|
|
1216
|
-
}
|
|
1217
|
-
if (isArray_1(value)) {
|
|
1218
|
-
// Recursively convert values (susceptible to call stack limits).
|
|
1219
|
-
return _arrayMap(value, baseToString) + '';
|
|
1220
|
-
}
|
|
1221
|
-
if (isSymbol_1(value)) {
|
|
1222
|
-
return symbolToString ? symbolToString.call(value) : '';
|
|
1223
|
-
}
|
|
1224
|
-
var result = (value + '');
|
|
1225
|
-
return (result == '0' && (1 / value) == -INFINITY$1) ? '-0' : result;
|
|
1226
|
-
}
|
|
1227
|
-
|
|
1228
|
-
var _baseToString = baseToString;
|
|
1229
|
-
|
|
1230
|
-
/**
|
|
1231
|
-
* Converts `value` to a string. An empty string is returned for `null`
|
|
1232
|
-
* and `undefined` values. The sign of `-0` is preserved.
|
|
1233
|
-
*
|
|
1234
|
-
* @static
|
|
1235
|
-
* @memberOf _
|
|
1236
|
-
* @since 4.0.0
|
|
1237
|
-
* @category Lang
|
|
1238
|
-
* @param {*} value The value to convert.
|
|
1239
|
-
* @returns {string} Returns the converted string.
|
|
1240
|
-
* @example
|
|
1241
|
-
*
|
|
1242
|
-
* _.toString(null);
|
|
1243
|
-
* // => ''
|
|
1244
|
-
*
|
|
1245
|
-
* _.toString(-0);
|
|
1246
|
-
* // => '-0'
|
|
1247
|
-
*
|
|
1248
|
-
* _.toString([1, 2, 3]);
|
|
1249
|
-
* // => '1,2,3'
|
|
1250
|
-
*/
|
|
1251
|
-
function toString(value) {
|
|
1252
|
-
return value == null ? '' : _baseToString(value);
|
|
1253
|
-
}
|
|
1254
|
-
|
|
1255
|
-
var toString_1 = toString;
|
|
1256
|
-
|
|
1257
|
-
/**
|
|
1258
|
-
* Casts `value` to a path array if it's not one.
|
|
1259
|
-
*
|
|
1260
|
-
* @private
|
|
1261
|
-
* @param {*} value The value to inspect.
|
|
1262
|
-
* @param {Object} [object] The object to query keys on.
|
|
1263
|
-
* @returns {Array} Returns the cast property path array.
|
|
1264
|
-
*/
|
|
1265
|
-
function castPath(value, object) {
|
|
1266
|
-
if (isArray_1(value)) {
|
|
1267
|
-
return value;
|
|
1268
|
-
}
|
|
1269
|
-
return _isKey(value, object) ? [value] : _stringToPath(toString_1(value));
|
|
1270
|
-
}
|
|
1271
|
-
|
|
1272
|
-
var _castPath = castPath;
|
|
1273
|
-
|
|
1274
|
-
/** Used as references for various `Number` constants. */
|
|
1275
|
-
var INFINITY = 1 / 0;
|
|
1276
|
-
|
|
1277
|
-
/**
|
|
1278
|
-
* Converts `value` to a string key if it's not a string or symbol.
|
|
1279
|
-
*
|
|
1280
|
-
* @private
|
|
1281
|
-
* @param {*} value The value to inspect.
|
|
1282
|
-
* @returns {string|symbol} Returns the key.
|
|
1283
|
-
*/
|
|
1284
|
-
function toKey(value) {
|
|
1285
|
-
if (typeof value == 'string' || isSymbol_1(value)) {
|
|
1286
|
-
return value;
|
|
34
|
+
});
|
|
1287
35
|
}
|
|
1288
|
-
|
|
1289
|
-
return (
|
|
36
|
+
n["default"] = e;
|
|
37
|
+
return Object.freeze(n);
|
|
1290
38
|
}
|
|
1291
39
|
|
|
1292
|
-
var
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
* @returns {*} Returns the resolved value.
|
|
1301
|
-
*/
|
|
1302
|
-
function baseGet(object, path) {
|
|
1303
|
-
path = _castPath(path, object);
|
|
40
|
+
var _getClassName__default = /*#__PURE__*/_interopDefaultLegacy(_getClassName);
|
|
41
|
+
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
42
|
+
var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
|
|
43
|
+
var _typeof__default = /*#__PURE__*/_interopDefaultLegacy(_typeof);
|
|
44
|
+
var Timeago__default = /*#__PURE__*/_interopDefaultLegacy(Timeago);
|
|
45
|
+
var _slicedToArray__default = /*#__PURE__*/_interopDefaultLegacy(_slicedToArray);
|
|
46
|
+
var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_defineProperty);
|
|
47
|
+
var ReactDOM__default = /*#__PURE__*/_interopDefaultLegacy(ReactDOM);
|
|
1304
48
|
|
|
1305
|
-
|
|
1306
|
-
length = path.length;
|
|
1307
|
-
|
|
1308
|
-
while (object != null && index < length) {
|
|
1309
|
-
object = object[_toKey(path[index++])];
|
|
1310
|
-
}
|
|
1311
|
-
return (index && index == length) ? object : undefined;
|
|
1312
|
-
}
|
|
1313
|
-
|
|
1314
|
-
var _baseGet = baseGet;
|
|
1315
|
-
|
|
1316
|
-
/**
|
|
1317
|
-
* Gets the value at `path` of `object`. If the resolved value is
|
|
1318
|
-
* `undefined`, the `defaultValue` is returned in its place.
|
|
1319
|
-
*
|
|
1320
|
-
* @static
|
|
1321
|
-
* @memberOf _
|
|
1322
|
-
* @since 3.7.0
|
|
1323
|
-
* @category Object
|
|
1324
|
-
* @param {Object} object The object to query.
|
|
1325
|
-
* @param {Array|string} path The path of the property to get.
|
|
1326
|
-
* @param {*} [defaultValue] The value returned for `undefined` resolved values.
|
|
1327
|
-
* @returns {*} Returns the resolved value.
|
|
1328
|
-
* @example
|
|
1329
|
-
*
|
|
1330
|
-
* var object = { 'a': [{ 'b': { 'c': 3 } }] };
|
|
1331
|
-
*
|
|
1332
|
-
* _.get(object, 'a[0].b.c');
|
|
1333
|
-
* // => 3
|
|
1334
|
-
*
|
|
1335
|
-
* _.get(object, ['a', '0', 'b', 'c']);
|
|
1336
|
-
* // => 3
|
|
1337
|
-
*
|
|
1338
|
-
* _.get(object, 'a.b.c', 'default');
|
|
1339
|
-
* // => 'default'
|
|
1340
|
-
*/
|
|
1341
|
-
function get(object, path, defaultValue) {
|
|
1342
|
-
var result = object == null ? undefined : _baseGet(object, path);
|
|
1343
|
-
return result === undefined ? defaultValue : result;
|
|
1344
|
-
}
|
|
1345
|
-
|
|
1346
|
-
var get_1 = get;
|
|
1347
|
-
|
|
1348
|
-
var StateContext = /*#__PURE__*/createContext(); // eslint-disable-next-line react/display-name
|
|
49
|
+
var StateContext = /*#__PURE__*/React.createContext(); // eslint-disable-next-line react/display-name
|
|
1349
50
|
|
|
1350
51
|
var StateProvider = function StateProvider(RowComponent) {
|
|
1351
52
|
return function (props) {
|
|
1352
53
|
return (
|
|
1353
54
|
/*#__PURE__*/
|
|
1354
55
|
// eslint-disable-next-line react/prop-types
|
|
1355
|
-
|
|
56
|
+
React__default["default"].createElement(StateContext.Provider, {
|
|
1356
57
|
value: props.config
|
|
1357
|
-
}, /*#__PURE__*/
|
|
58
|
+
}, /*#__PURE__*/React__default["default"].createElement(RowComponent, props))
|
|
1358
59
|
);
|
|
1359
60
|
};
|
|
1360
61
|
};
|
|
1361
62
|
var useStateValue = function useStateValue() {
|
|
1362
|
-
return useContext(StateContext);
|
|
63
|
+
return React.useContext(StateContext);
|
|
1363
64
|
};
|
|
1364
65
|
|
|
1365
|
-
function _typeof(obj) {
|
|
1366
|
-
"@babel/helpers - typeof";
|
|
1367
|
-
|
|
1368
|
-
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
|
|
1369
|
-
return typeof obj;
|
|
1370
|
-
} : function (obj) {
|
|
1371
|
-
return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
|
1372
|
-
}, _typeof(obj);
|
|
1373
|
-
}
|
|
1374
|
-
|
|
1375
|
-
/**
|
|
1376
|
-
* Copyright (c) 2014-present, Facebook, Inc.
|
|
1377
|
-
*
|
|
1378
|
-
* This source code is licensed under the MIT license found in the
|
|
1379
|
-
* LICENSE file in the root directory of this source tree.
|
|
1380
|
-
*/
|
|
1381
|
-
|
|
1382
|
-
createCommonjsModule(function (module) {
|
|
1383
|
-
var runtime = (function (exports) {
|
|
1384
|
-
|
|
1385
|
-
var Op = Object.prototype;
|
|
1386
|
-
var hasOwn = Op.hasOwnProperty;
|
|
1387
|
-
var undefined$1; // More compressible than void 0.
|
|
1388
|
-
var $Symbol = typeof Symbol === "function" ? Symbol : {};
|
|
1389
|
-
var iteratorSymbol = $Symbol.iterator || "@@iterator";
|
|
1390
|
-
var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator";
|
|
1391
|
-
var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
|
|
1392
|
-
|
|
1393
|
-
function define(obj, key, value) {
|
|
1394
|
-
Object.defineProperty(obj, key, {
|
|
1395
|
-
value: value,
|
|
1396
|
-
enumerable: true,
|
|
1397
|
-
configurable: true,
|
|
1398
|
-
writable: true
|
|
1399
|
-
});
|
|
1400
|
-
return obj[key];
|
|
1401
|
-
}
|
|
1402
|
-
try {
|
|
1403
|
-
// IE 8 has a broken Object.defineProperty that only works on DOM objects.
|
|
1404
|
-
define({}, "");
|
|
1405
|
-
} catch (err) {
|
|
1406
|
-
define = function(obj, key, value) {
|
|
1407
|
-
return obj[key] = value;
|
|
1408
|
-
};
|
|
1409
|
-
}
|
|
1410
|
-
|
|
1411
|
-
function wrap(innerFn, outerFn, self, tryLocsList) {
|
|
1412
|
-
// If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.
|
|
1413
|
-
var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;
|
|
1414
|
-
var generator = Object.create(protoGenerator.prototype);
|
|
1415
|
-
var context = new Context(tryLocsList || []);
|
|
1416
|
-
|
|
1417
|
-
// The ._invoke method unifies the implementations of the .next,
|
|
1418
|
-
// .throw, and .return methods.
|
|
1419
|
-
generator._invoke = makeInvokeMethod(innerFn, self, context);
|
|
1420
|
-
|
|
1421
|
-
return generator;
|
|
1422
|
-
}
|
|
1423
|
-
exports.wrap = wrap;
|
|
1424
|
-
|
|
1425
|
-
// Try/catch helper to minimize deoptimizations. Returns a completion
|
|
1426
|
-
// record like context.tryEntries[i].completion. This interface could
|
|
1427
|
-
// have been (and was previously) designed to take a closure to be
|
|
1428
|
-
// invoked without arguments, but in all the cases we care about we
|
|
1429
|
-
// already have an existing method we want to call, so there's no need
|
|
1430
|
-
// to create a new function object. We can even get away with assuming
|
|
1431
|
-
// the method takes exactly one argument, since that happens to be true
|
|
1432
|
-
// in every case, so we don't have to touch the arguments object. The
|
|
1433
|
-
// only additional allocation required is the completion record, which
|
|
1434
|
-
// has a stable shape and so hopefully should be cheap to allocate.
|
|
1435
|
-
function tryCatch(fn, obj, arg) {
|
|
1436
|
-
try {
|
|
1437
|
-
return { type: "normal", arg: fn.call(obj, arg) };
|
|
1438
|
-
} catch (err) {
|
|
1439
|
-
return { type: "throw", arg: err };
|
|
1440
|
-
}
|
|
1441
|
-
}
|
|
1442
|
-
|
|
1443
|
-
var GenStateSuspendedStart = "suspendedStart";
|
|
1444
|
-
var GenStateSuspendedYield = "suspendedYield";
|
|
1445
|
-
var GenStateExecuting = "executing";
|
|
1446
|
-
var GenStateCompleted = "completed";
|
|
1447
|
-
|
|
1448
|
-
// Returning this object from the innerFn has the same effect as
|
|
1449
|
-
// breaking out of the dispatch switch statement.
|
|
1450
|
-
var ContinueSentinel = {};
|
|
1451
|
-
|
|
1452
|
-
// Dummy constructor functions that we use as the .constructor and
|
|
1453
|
-
// .constructor.prototype properties for functions that return Generator
|
|
1454
|
-
// objects. For full spec compliance, you may wish to configure your
|
|
1455
|
-
// minifier not to mangle the names of these two functions.
|
|
1456
|
-
function Generator() {}
|
|
1457
|
-
function GeneratorFunction() {}
|
|
1458
|
-
function GeneratorFunctionPrototype() {}
|
|
1459
|
-
|
|
1460
|
-
// This is a polyfill for %IteratorPrototype% for environments that
|
|
1461
|
-
// don't natively support it.
|
|
1462
|
-
var IteratorPrototype = {};
|
|
1463
|
-
define(IteratorPrototype, iteratorSymbol, function () {
|
|
1464
|
-
return this;
|
|
1465
|
-
});
|
|
1466
|
-
|
|
1467
|
-
var getProto = Object.getPrototypeOf;
|
|
1468
|
-
var NativeIteratorPrototype = getProto && getProto(getProto(values([])));
|
|
1469
|
-
if (NativeIteratorPrototype &&
|
|
1470
|
-
NativeIteratorPrototype !== Op &&
|
|
1471
|
-
hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {
|
|
1472
|
-
// This environment has a native %IteratorPrototype%; use it instead
|
|
1473
|
-
// of the polyfill.
|
|
1474
|
-
IteratorPrototype = NativeIteratorPrototype;
|
|
1475
|
-
}
|
|
1476
|
-
|
|
1477
|
-
var Gp = GeneratorFunctionPrototype.prototype =
|
|
1478
|
-
Generator.prototype = Object.create(IteratorPrototype);
|
|
1479
|
-
GeneratorFunction.prototype = GeneratorFunctionPrototype;
|
|
1480
|
-
define(Gp, "constructor", GeneratorFunctionPrototype);
|
|
1481
|
-
define(GeneratorFunctionPrototype, "constructor", GeneratorFunction);
|
|
1482
|
-
GeneratorFunction.displayName = define(
|
|
1483
|
-
GeneratorFunctionPrototype,
|
|
1484
|
-
toStringTagSymbol,
|
|
1485
|
-
"GeneratorFunction"
|
|
1486
|
-
);
|
|
1487
|
-
|
|
1488
|
-
// Helper for defining the .next, .throw, and .return methods of the
|
|
1489
|
-
// Iterator interface in terms of a single ._invoke method.
|
|
1490
|
-
function defineIteratorMethods(prototype) {
|
|
1491
|
-
["next", "throw", "return"].forEach(function(method) {
|
|
1492
|
-
define(prototype, method, function(arg) {
|
|
1493
|
-
return this._invoke(method, arg);
|
|
1494
|
-
});
|
|
1495
|
-
});
|
|
1496
|
-
}
|
|
1497
|
-
|
|
1498
|
-
exports.isGeneratorFunction = function(genFun) {
|
|
1499
|
-
var ctor = typeof genFun === "function" && genFun.constructor;
|
|
1500
|
-
return ctor
|
|
1501
|
-
? ctor === GeneratorFunction ||
|
|
1502
|
-
// For the native GeneratorFunction constructor, the best we can
|
|
1503
|
-
// do is to check its .name property.
|
|
1504
|
-
(ctor.displayName || ctor.name) === "GeneratorFunction"
|
|
1505
|
-
: false;
|
|
1506
|
-
};
|
|
1507
|
-
|
|
1508
|
-
exports.mark = function(genFun) {
|
|
1509
|
-
if (Object.setPrototypeOf) {
|
|
1510
|
-
Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);
|
|
1511
|
-
} else {
|
|
1512
|
-
genFun.__proto__ = GeneratorFunctionPrototype;
|
|
1513
|
-
define(genFun, toStringTagSymbol, "GeneratorFunction");
|
|
1514
|
-
}
|
|
1515
|
-
genFun.prototype = Object.create(Gp);
|
|
1516
|
-
return genFun;
|
|
1517
|
-
};
|
|
1518
|
-
|
|
1519
|
-
// Within the body of any async function, `await x` is transformed to
|
|
1520
|
-
// `yield regeneratorRuntime.awrap(x)`, so that the runtime can test
|
|
1521
|
-
// `hasOwn.call(value, "__await")` to determine if the yielded value is
|
|
1522
|
-
// meant to be awaited.
|
|
1523
|
-
exports.awrap = function(arg) {
|
|
1524
|
-
return { __await: arg };
|
|
1525
|
-
};
|
|
1526
|
-
|
|
1527
|
-
function AsyncIterator(generator, PromiseImpl) {
|
|
1528
|
-
function invoke(method, arg, resolve, reject) {
|
|
1529
|
-
var record = tryCatch(generator[method], generator, arg);
|
|
1530
|
-
if (record.type === "throw") {
|
|
1531
|
-
reject(record.arg);
|
|
1532
|
-
} else {
|
|
1533
|
-
var result = record.arg;
|
|
1534
|
-
var value = result.value;
|
|
1535
|
-
if (value &&
|
|
1536
|
-
typeof value === "object" &&
|
|
1537
|
-
hasOwn.call(value, "__await")) {
|
|
1538
|
-
return PromiseImpl.resolve(value.__await).then(function(value) {
|
|
1539
|
-
invoke("next", value, resolve, reject);
|
|
1540
|
-
}, function(err) {
|
|
1541
|
-
invoke("throw", err, resolve, reject);
|
|
1542
|
-
});
|
|
1543
|
-
}
|
|
1544
|
-
|
|
1545
|
-
return PromiseImpl.resolve(value).then(function(unwrapped) {
|
|
1546
|
-
// When a yielded Promise is resolved, its final value becomes
|
|
1547
|
-
// the .value of the Promise<{value,done}> result for the
|
|
1548
|
-
// current iteration.
|
|
1549
|
-
result.value = unwrapped;
|
|
1550
|
-
resolve(result);
|
|
1551
|
-
}, function(error) {
|
|
1552
|
-
// If a rejected Promise was yielded, throw the rejection back
|
|
1553
|
-
// into the async generator function so it can be handled there.
|
|
1554
|
-
return invoke("throw", error, resolve, reject);
|
|
1555
|
-
});
|
|
1556
|
-
}
|
|
1557
|
-
}
|
|
1558
|
-
|
|
1559
|
-
var previousPromise;
|
|
1560
|
-
|
|
1561
|
-
function enqueue(method, arg) {
|
|
1562
|
-
function callInvokeWithMethodAndArg() {
|
|
1563
|
-
return new PromiseImpl(function(resolve, reject) {
|
|
1564
|
-
invoke(method, arg, resolve, reject);
|
|
1565
|
-
});
|
|
1566
|
-
}
|
|
1567
|
-
|
|
1568
|
-
return previousPromise =
|
|
1569
|
-
// If enqueue has been called before, then we want to wait until
|
|
1570
|
-
// all previous Promises have been resolved before calling invoke,
|
|
1571
|
-
// so that results are always delivered in the correct order. If
|
|
1572
|
-
// enqueue has not been called before, then it is important to
|
|
1573
|
-
// call invoke immediately, without waiting on a callback to fire,
|
|
1574
|
-
// so that the async generator function has the opportunity to do
|
|
1575
|
-
// any necessary setup in a predictable way. This predictability
|
|
1576
|
-
// is why the Promise constructor synchronously invokes its
|
|
1577
|
-
// executor callback, and why async functions synchronously
|
|
1578
|
-
// execute code before the first await. Since we implement simple
|
|
1579
|
-
// async functions in terms of async generators, it is especially
|
|
1580
|
-
// important to get this right, even though it requires care.
|
|
1581
|
-
previousPromise ? previousPromise.then(
|
|
1582
|
-
callInvokeWithMethodAndArg,
|
|
1583
|
-
// Avoid propagating failures to Promises returned by later
|
|
1584
|
-
// invocations of the iterator.
|
|
1585
|
-
callInvokeWithMethodAndArg
|
|
1586
|
-
) : callInvokeWithMethodAndArg();
|
|
1587
|
-
}
|
|
1588
|
-
|
|
1589
|
-
// Define the unified helper method that is used to implement .next,
|
|
1590
|
-
// .throw, and .return (see defineIteratorMethods).
|
|
1591
|
-
this._invoke = enqueue;
|
|
1592
|
-
}
|
|
1593
|
-
|
|
1594
|
-
defineIteratorMethods(AsyncIterator.prototype);
|
|
1595
|
-
define(AsyncIterator.prototype, asyncIteratorSymbol, function () {
|
|
1596
|
-
return this;
|
|
1597
|
-
});
|
|
1598
|
-
exports.AsyncIterator = AsyncIterator;
|
|
1599
|
-
|
|
1600
|
-
// Note that simple async functions are implemented on top of
|
|
1601
|
-
// AsyncIterator objects; they just return a Promise for the value of
|
|
1602
|
-
// the final result produced by the iterator.
|
|
1603
|
-
exports.async = function(innerFn, outerFn, self, tryLocsList, PromiseImpl) {
|
|
1604
|
-
if (PromiseImpl === void 0) PromiseImpl = Promise;
|
|
1605
|
-
|
|
1606
|
-
var iter = new AsyncIterator(
|
|
1607
|
-
wrap(innerFn, outerFn, self, tryLocsList),
|
|
1608
|
-
PromiseImpl
|
|
1609
|
-
);
|
|
1610
|
-
|
|
1611
|
-
return exports.isGeneratorFunction(outerFn)
|
|
1612
|
-
? iter // If outerFn is a generator, return the full iterator.
|
|
1613
|
-
: iter.next().then(function(result) {
|
|
1614
|
-
return result.done ? result.value : iter.next();
|
|
1615
|
-
});
|
|
1616
|
-
};
|
|
1617
|
-
|
|
1618
|
-
function makeInvokeMethod(innerFn, self, context) {
|
|
1619
|
-
var state = GenStateSuspendedStart;
|
|
1620
|
-
|
|
1621
|
-
return function invoke(method, arg) {
|
|
1622
|
-
if (state === GenStateExecuting) {
|
|
1623
|
-
throw new Error("Generator is already running");
|
|
1624
|
-
}
|
|
1625
|
-
|
|
1626
|
-
if (state === GenStateCompleted) {
|
|
1627
|
-
if (method === "throw") {
|
|
1628
|
-
throw arg;
|
|
1629
|
-
}
|
|
1630
|
-
|
|
1631
|
-
// Be forgiving, per 25.3.3.3.3 of the spec:
|
|
1632
|
-
// https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume
|
|
1633
|
-
return doneResult();
|
|
1634
|
-
}
|
|
1635
|
-
|
|
1636
|
-
context.method = method;
|
|
1637
|
-
context.arg = arg;
|
|
1638
|
-
|
|
1639
|
-
while (true) {
|
|
1640
|
-
var delegate = context.delegate;
|
|
1641
|
-
if (delegate) {
|
|
1642
|
-
var delegateResult = maybeInvokeDelegate(delegate, context);
|
|
1643
|
-
if (delegateResult) {
|
|
1644
|
-
if (delegateResult === ContinueSentinel) continue;
|
|
1645
|
-
return delegateResult;
|
|
1646
|
-
}
|
|
1647
|
-
}
|
|
1648
|
-
|
|
1649
|
-
if (context.method === "next") {
|
|
1650
|
-
// Setting context._sent for legacy support of Babel's
|
|
1651
|
-
// function.sent implementation.
|
|
1652
|
-
context.sent = context._sent = context.arg;
|
|
1653
|
-
|
|
1654
|
-
} else if (context.method === "throw") {
|
|
1655
|
-
if (state === GenStateSuspendedStart) {
|
|
1656
|
-
state = GenStateCompleted;
|
|
1657
|
-
throw context.arg;
|
|
1658
|
-
}
|
|
1659
|
-
|
|
1660
|
-
context.dispatchException(context.arg);
|
|
1661
|
-
|
|
1662
|
-
} else if (context.method === "return") {
|
|
1663
|
-
context.abrupt("return", context.arg);
|
|
1664
|
-
}
|
|
1665
|
-
|
|
1666
|
-
state = GenStateExecuting;
|
|
1667
|
-
|
|
1668
|
-
var record = tryCatch(innerFn, self, context);
|
|
1669
|
-
if (record.type === "normal") {
|
|
1670
|
-
// If an exception is thrown from innerFn, we leave state ===
|
|
1671
|
-
// GenStateExecuting and loop back for another invocation.
|
|
1672
|
-
state = context.done
|
|
1673
|
-
? GenStateCompleted
|
|
1674
|
-
: GenStateSuspendedYield;
|
|
1675
|
-
|
|
1676
|
-
if (record.arg === ContinueSentinel) {
|
|
1677
|
-
continue;
|
|
1678
|
-
}
|
|
1679
|
-
|
|
1680
|
-
return {
|
|
1681
|
-
value: record.arg,
|
|
1682
|
-
done: context.done
|
|
1683
|
-
};
|
|
1684
|
-
|
|
1685
|
-
} else if (record.type === "throw") {
|
|
1686
|
-
state = GenStateCompleted;
|
|
1687
|
-
// Dispatch the exception by looping back around to the
|
|
1688
|
-
// context.dispatchException(context.arg) call above.
|
|
1689
|
-
context.method = "throw";
|
|
1690
|
-
context.arg = record.arg;
|
|
1691
|
-
}
|
|
1692
|
-
}
|
|
1693
|
-
};
|
|
1694
|
-
}
|
|
1695
|
-
|
|
1696
|
-
// Call delegate.iterator[context.method](context.arg) and handle the
|
|
1697
|
-
// result, either by returning a { value, done } result from the
|
|
1698
|
-
// delegate iterator, or by modifying context.method and context.arg,
|
|
1699
|
-
// setting context.delegate to null, and returning the ContinueSentinel.
|
|
1700
|
-
function maybeInvokeDelegate(delegate, context) {
|
|
1701
|
-
var method = delegate.iterator[context.method];
|
|
1702
|
-
if (method === undefined$1) {
|
|
1703
|
-
// A .throw or .return when the delegate iterator has no .throw
|
|
1704
|
-
// method always terminates the yield* loop.
|
|
1705
|
-
context.delegate = null;
|
|
1706
|
-
|
|
1707
|
-
if (context.method === "throw") {
|
|
1708
|
-
// Note: ["return"] must be used for ES3 parsing compatibility.
|
|
1709
|
-
if (delegate.iterator["return"]) {
|
|
1710
|
-
// If the delegate iterator has a return method, give it a
|
|
1711
|
-
// chance to clean up.
|
|
1712
|
-
context.method = "return";
|
|
1713
|
-
context.arg = undefined$1;
|
|
1714
|
-
maybeInvokeDelegate(delegate, context);
|
|
1715
|
-
|
|
1716
|
-
if (context.method === "throw") {
|
|
1717
|
-
// If maybeInvokeDelegate(context) changed context.method from
|
|
1718
|
-
// "return" to "throw", let that override the TypeError below.
|
|
1719
|
-
return ContinueSentinel;
|
|
1720
|
-
}
|
|
1721
|
-
}
|
|
1722
|
-
|
|
1723
|
-
context.method = "throw";
|
|
1724
|
-
context.arg = new TypeError(
|
|
1725
|
-
"The iterator does not provide a 'throw' method");
|
|
1726
|
-
}
|
|
1727
|
-
|
|
1728
|
-
return ContinueSentinel;
|
|
1729
|
-
}
|
|
1730
|
-
|
|
1731
|
-
var record = tryCatch(method, delegate.iterator, context.arg);
|
|
1732
|
-
|
|
1733
|
-
if (record.type === "throw") {
|
|
1734
|
-
context.method = "throw";
|
|
1735
|
-
context.arg = record.arg;
|
|
1736
|
-
context.delegate = null;
|
|
1737
|
-
return ContinueSentinel;
|
|
1738
|
-
}
|
|
1739
|
-
|
|
1740
|
-
var info = record.arg;
|
|
1741
|
-
|
|
1742
|
-
if (! info) {
|
|
1743
|
-
context.method = "throw";
|
|
1744
|
-
context.arg = new TypeError("iterator result is not an object");
|
|
1745
|
-
context.delegate = null;
|
|
1746
|
-
return ContinueSentinel;
|
|
1747
|
-
}
|
|
1748
|
-
|
|
1749
|
-
if (info.done) {
|
|
1750
|
-
// Assign the result of the finished delegate to the temporary
|
|
1751
|
-
// variable specified by delegate.resultName (see delegateYield).
|
|
1752
|
-
context[delegate.resultName] = info.value;
|
|
1753
|
-
|
|
1754
|
-
// Resume execution at the desired location (see delegateYield).
|
|
1755
|
-
context.next = delegate.nextLoc;
|
|
1756
|
-
|
|
1757
|
-
// If context.method was "throw" but the delegate handled the
|
|
1758
|
-
// exception, let the outer generator proceed normally. If
|
|
1759
|
-
// context.method was "next", forget context.arg since it has been
|
|
1760
|
-
// "consumed" by the delegate iterator. If context.method was
|
|
1761
|
-
// "return", allow the original .return call to continue in the
|
|
1762
|
-
// outer generator.
|
|
1763
|
-
if (context.method !== "return") {
|
|
1764
|
-
context.method = "next";
|
|
1765
|
-
context.arg = undefined$1;
|
|
1766
|
-
}
|
|
1767
|
-
|
|
1768
|
-
} else {
|
|
1769
|
-
// Re-yield the result returned by the delegate method.
|
|
1770
|
-
return info;
|
|
1771
|
-
}
|
|
1772
|
-
|
|
1773
|
-
// The delegate iterator is finished, so forget it and continue with
|
|
1774
|
-
// the outer generator.
|
|
1775
|
-
context.delegate = null;
|
|
1776
|
-
return ContinueSentinel;
|
|
1777
|
-
}
|
|
1778
|
-
|
|
1779
|
-
// Define Generator.prototype.{next,throw,return} in terms of the
|
|
1780
|
-
// unified ._invoke helper method.
|
|
1781
|
-
defineIteratorMethods(Gp);
|
|
1782
|
-
|
|
1783
|
-
define(Gp, toStringTagSymbol, "Generator");
|
|
1784
|
-
|
|
1785
|
-
// A Generator should always return itself as the iterator object when the
|
|
1786
|
-
// @@iterator function is called on it. Some browsers' implementations of the
|
|
1787
|
-
// iterator prototype chain incorrectly implement this, causing the Generator
|
|
1788
|
-
// object to not be returned from this call. This ensures that doesn't happen.
|
|
1789
|
-
// See https://github.com/facebook/regenerator/issues/274 for more details.
|
|
1790
|
-
define(Gp, iteratorSymbol, function() {
|
|
1791
|
-
return this;
|
|
1792
|
-
});
|
|
1793
|
-
|
|
1794
|
-
define(Gp, "toString", function() {
|
|
1795
|
-
return "[object Generator]";
|
|
1796
|
-
});
|
|
1797
|
-
|
|
1798
|
-
function pushTryEntry(locs) {
|
|
1799
|
-
var entry = { tryLoc: locs[0] };
|
|
1800
|
-
|
|
1801
|
-
if (1 in locs) {
|
|
1802
|
-
entry.catchLoc = locs[1];
|
|
1803
|
-
}
|
|
1804
|
-
|
|
1805
|
-
if (2 in locs) {
|
|
1806
|
-
entry.finallyLoc = locs[2];
|
|
1807
|
-
entry.afterLoc = locs[3];
|
|
1808
|
-
}
|
|
1809
|
-
|
|
1810
|
-
this.tryEntries.push(entry);
|
|
1811
|
-
}
|
|
1812
|
-
|
|
1813
|
-
function resetTryEntry(entry) {
|
|
1814
|
-
var record = entry.completion || {};
|
|
1815
|
-
record.type = "normal";
|
|
1816
|
-
delete record.arg;
|
|
1817
|
-
entry.completion = record;
|
|
1818
|
-
}
|
|
1819
|
-
|
|
1820
|
-
function Context(tryLocsList) {
|
|
1821
|
-
// The root entry object (effectively a try statement without a catch
|
|
1822
|
-
// or a finally block) gives us a place to store values thrown from
|
|
1823
|
-
// locations where there is no enclosing try statement.
|
|
1824
|
-
this.tryEntries = [{ tryLoc: "root" }];
|
|
1825
|
-
tryLocsList.forEach(pushTryEntry, this);
|
|
1826
|
-
this.reset(true);
|
|
1827
|
-
}
|
|
1828
|
-
|
|
1829
|
-
exports.keys = function(object) {
|
|
1830
|
-
var keys = [];
|
|
1831
|
-
for (var key in object) {
|
|
1832
|
-
keys.push(key);
|
|
1833
|
-
}
|
|
1834
|
-
keys.reverse();
|
|
1835
|
-
|
|
1836
|
-
// Rather than returning an object with a next method, we keep
|
|
1837
|
-
// things simple and return the next function itself.
|
|
1838
|
-
return function next() {
|
|
1839
|
-
while (keys.length) {
|
|
1840
|
-
var key = keys.pop();
|
|
1841
|
-
if (key in object) {
|
|
1842
|
-
next.value = key;
|
|
1843
|
-
next.done = false;
|
|
1844
|
-
return next;
|
|
1845
|
-
}
|
|
1846
|
-
}
|
|
1847
|
-
|
|
1848
|
-
// To avoid creating an additional object, we just hang the .value
|
|
1849
|
-
// and .done properties off the next function object itself. This
|
|
1850
|
-
// also ensures that the minifier will not anonymize the function.
|
|
1851
|
-
next.done = true;
|
|
1852
|
-
return next;
|
|
1853
|
-
};
|
|
1854
|
-
};
|
|
1855
|
-
|
|
1856
|
-
function values(iterable) {
|
|
1857
|
-
if (iterable) {
|
|
1858
|
-
var iteratorMethod = iterable[iteratorSymbol];
|
|
1859
|
-
if (iteratorMethod) {
|
|
1860
|
-
return iteratorMethod.call(iterable);
|
|
1861
|
-
}
|
|
1862
|
-
|
|
1863
|
-
if (typeof iterable.next === "function") {
|
|
1864
|
-
return iterable;
|
|
1865
|
-
}
|
|
1866
|
-
|
|
1867
|
-
if (!isNaN(iterable.length)) {
|
|
1868
|
-
var i = -1, next = function next() {
|
|
1869
|
-
while (++i < iterable.length) {
|
|
1870
|
-
if (hasOwn.call(iterable, i)) {
|
|
1871
|
-
next.value = iterable[i];
|
|
1872
|
-
next.done = false;
|
|
1873
|
-
return next;
|
|
1874
|
-
}
|
|
1875
|
-
}
|
|
1876
|
-
|
|
1877
|
-
next.value = undefined$1;
|
|
1878
|
-
next.done = true;
|
|
1879
|
-
|
|
1880
|
-
return next;
|
|
1881
|
-
};
|
|
1882
|
-
|
|
1883
|
-
return next.next = next;
|
|
1884
|
-
}
|
|
1885
|
-
}
|
|
1886
|
-
|
|
1887
|
-
// Return an iterator with no values.
|
|
1888
|
-
return { next: doneResult };
|
|
1889
|
-
}
|
|
1890
|
-
exports.values = values;
|
|
1891
|
-
|
|
1892
|
-
function doneResult() {
|
|
1893
|
-
return { value: undefined$1, done: true };
|
|
1894
|
-
}
|
|
1895
|
-
|
|
1896
|
-
Context.prototype = {
|
|
1897
|
-
constructor: Context,
|
|
1898
|
-
|
|
1899
|
-
reset: function(skipTempReset) {
|
|
1900
|
-
this.prev = 0;
|
|
1901
|
-
this.next = 0;
|
|
1902
|
-
// Resetting context._sent for legacy support of Babel's
|
|
1903
|
-
// function.sent implementation.
|
|
1904
|
-
this.sent = this._sent = undefined$1;
|
|
1905
|
-
this.done = false;
|
|
1906
|
-
this.delegate = null;
|
|
1907
|
-
|
|
1908
|
-
this.method = "next";
|
|
1909
|
-
this.arg = undefined$1;
|
|
1910
|
-
|
|
1911
|
-
this.tryEntries.forEach(resetTryEntry);
|
|
1912
|
-
|
|
1913
|
-
if (!skipTempReset) {
|
|
1914
|
-
for (var name in this) {
|
|
1915
|
-
// Not sure about the optimal order of these conditions:
|
|
1916
|
-
if (name.charAt(0) === "t" &&
|
|
1917
|
-
hasOwn.call(this, name) &&
|
|
1918
|
-
!isNaN(+name.slice(1))) {
|
|
1919
|
-
this[name] = undefined$1;
|
|
1920
|
-
}
|
|
1921
|
-
}
|
|
1922
|
-
}
|
|
1923
|
-
},
|
|
1924
|
-
|
|
1925
|
-
stop: function() {
|
|
1926
|
-
this.done = true;
|
|
1927
|
-
|
|
1928
|
-
var rootEntry = this.tryEntries[0];
|
|
1929
|
-
var rootRecord = rootEntry.completion;
|
|
1930
|
-
if (rootRecord.type === "throw") {
|
|
1931
|
-
throw rootRecord.arg;
|
|
1932
|
-
}
|
|
1933
|
-
|
|
1934
|
-
return this.rval;
|
|
1935
|
-
},
|
|
1936
|
-
|
|
1937
|
-
dispatchException: function(exception) {
|
|
1938
|
-
if (this.done) {
|
|
1939
|
-
throw exception;
|
|
1940
|
-
}
|
|
1941
|
-
|
|
1942
|
-
var context = this;
|
|
1943
|
-
function handle(loc, caught) {
|
|
1944
|
-
record.type = "throw";
|
|
1945
|
-
record.arg = exception;
|
|
1946
|
-
context.next = loc;
|
|
1947
|
-
|
|
1948
|
-
if (caught) {
|
|
1949
|
-
// If the dispatched exception was caught by a catch block,
|
|
1950
|
-
// then let that catch block handle the exception normally.
|
|
1951
|
-
context.method = "next";
|
|
1952
|
-
context.arg = undefined$1;
|
|
1953
|
-
}
|
|
1954
|
-
|
|
1955
|
-
return !! caught;
|
|
1956
|
-
}
|
|
1957
|
-
|
|
1958
|
-
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
1959
|
-
var entry = this.tryEntries[i];
|
|
1960
|
-
var record = entry.completion;
|
|
1961
|
-
|
|
1962
|
-
if (entry.tryLoc === "root") {
|
|
1963
|
-
// Exception thrown outside of any try block that could handle
|
|
1964
|
-
// it, so set the completion value of the entire function to
|
|
1965
|
-
// throw the exception.
|
|
1966
|
-
return handle("end");
|
|
1967
|
-
}
|
|
1968
|
-
|
|
1969
|
-
if (entry.tryLoc <= this.prev) {
|
|
1970
|
-
var hasCatch = hasOwn.call(entry, "catchLoc");
|
|
1971
|
-
var hasFinally = hasOwn.call(entry, "finallyLoc");
|
|
1972
|
-
|
|
1973
|
-
if (hasCatch && hasFinally) {
|
|
1974
|
-
if (this.prev < entry.catchLoc) {
|
|
1975
|
-
return handle(entry.catchLoc, true);
|
|
1976
|
-
} else if (this.prev < entry.finallyLoc) {
|
|
1977
|
-
return handle(entry.finallyLoc);
|
|
1978
|
-
}
|
|
1979
|
-
|
|
1980
|
-
} else if (hasCatch) {
|
|
1981
|
-
if (this.prev < entry.catchLoc) {
|
|
1982
|
-
return handle(entry.catchLoc, true);
|
|
1983
|
-
}
|
|
1984
|
-
|
|
1985
|
-
} else if (hasFinally) {
|
|
1986
|
-
if (this.prev < entry.finallyLoc) {
|
|
1987
|
-
return handle(entry.finallyLoc);
|
|
1988
|
-
}
|
|
1989
|
-
|
|
1990
|
-
} else {
|
|
1991
|
-
throw new Error("try statement without catch or finally");
|
|
1992
|
-
}
|
|
1993
|
-
}
|
|
1994
|
-
}
|
|
1995
|
-
},
|
|
1996
|
-
|
|
1997
|
-
abrupt: function(type, arg) {
|
|
1998
|
-
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
1999
|
-
var entry = this.tryEntries[i];
|
|
2000
|
-
if (entry.tryLoc <= this.prev &&
|
|
2001
|
-
hasOwn.call(entry, "finallyLoc") &&
|
|
2002
|
-
this.prev < entry.finallyLoc) {
|
|
2003
|
-
var finallyEntry = entry;
|
|
2004
|
-
break;
|
|
2005
|
-
}
|
|
2006
|
-
}
|
|
2007
|
-
|
|
2008
|
-
if (finallyEntry &&
|
|
2009
|
-
(type === "break" ||
|
|
2010
|
-
type === "continue") &&
|
|
2011
|
-
finallyEntry.tryLoc <= arg &&
|
|
2012
|
-
arg <= finallyEntry.finallyLoc) {
|
|
2013
|
-
// Ignore the finally entry if control is not jumping to a
|
|
2014
|
-
// location outside the try/catch block.
|
|
2015
|
-
finallyEntry = null;
|
|
2016
|
-
}
|
|
2017
|
-
|
|
2018
|
-
var record = finallyEntry ? finallyEntry.completion : {};
|
|
2019
|
-
record.type = type;
|
|
2020
|
-
record.arg = arg;
|
|
2021
|
-
|
|
2022
|
-
if (finallyEntry) {
|
|
2023
|
-
this.method = "next";
|
|
2024
|
-
this.next = finallyEntry.finallyLoc;
|
|
2025
|
-
return ContinueSentinel;
|
|
2026
|
-
}
|
|
2027
|
-
|
|
2028
|
-
return this.complete(record);
|
|
2029
|
-
},
|
|
2030
|
-
|
|
2031
|
-
complete: function(record, afterLoc) {
|
|
2032
|
-
if (record.type === "throw") {
|
|
2033
|
-
throw record.arg;
|
|
2034
|
-
}
|
|
2035
|
-
|
|
2036
|
-
if (record.type === "break" ||
|
|
2037
|
-
record.type === "continue") {
|
|
2038
|
-
this.next = record.arg;
|
|
2039
|
-
} else if (record.type === "return") {
|
|
2040
|
-
this.rval = this.arg = record.arg;
|
|
2041
|
-
this.method = "return";
|
|
2042
|
-
this.next = "end";
|
|
2043
|
-
} else if (record.type === "normal" && afterLoc) {
|
|
2044
|
-
this.next = afterLoc;
|
|
2045
|
-
}
|
|
2046
|
-
|
|
2047
|
-
return ContinueSentinel;
|
|
2048
|
-
},
|
|
2049
|
-
|
|
2050
|
-
finish: function(finallyLoc) {
|
|
2051
|
-
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
2052
|
-
var entry = this.tryEntries[i];
|
|
2053
|
-
if (entry.finallyLoc === finallyLoc) {
|
|
2054
|
-
this.complete(entry.completion, entry.afterLoc);
|
|
2055
|
-
resetTryEntry(entry);
|
|
2056
|
-
return ContinueSentinel;
|
|
2057
|
-
}
|
|
2058
|
-
}
|
|
2059
|
-
},
|
|
2060
|
-
|
|
2061
|
-
"catch": function(tryLoc) {
|
|
2062
|
-
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
2063
|
-
var entry = this.tryEntries[i];
|
|
2064
|
-
if (entry.tryLoc === tryLoc) {
|
|
2065
|
-
var record = entry.completion;
|
|
2066
|
-
if (record.type === "throw") {
|
|
2067
|
-
var thrown = record.arg;
|
|
2068
|
-
resetTryEntry(entry);
|
|
2069
|
-
}
|
|
2070
|
-
return thrown;
|
|
2071
|
-
}
|
|
2072
|
-
}
|
|
2073
|
-
|
|
2074
|
-
// The context.catch method must only be called with a location
|
|
2075
|
-
// argument that corresponds to a known catch block.
|
|
2076
|
-
throw new Error("illegal catch attempt");
|
|
2077
|
-
},
|
|
2078
|
-
|
|
2079
|
-
delegateYield: function(iterable, resultName, nextLoc) {
|
|
2080
|
-
this.delegate = {
|
|
2081
|
-
iterator: values(iterable),
|
|
2082
|
-
resultName: resultName,
|
|
2083
|
-
nextLoc: nextLoc
|
|
2084
|
-
};
|
|
2085
|
-
|
|
2086
|
-
if (this.method === "next") {
|
|
2087
|
-
// Deliberately forget the last sent value so that we don't
|
|
2088
|
-
// accidentally pass it on to the delegate.
|
|
2089
|
-
this.arg = undefined$1;
|
|
2090
|
-
}
|
|
2091
|
-
|
|
2092
|
-
return ContinueSentinel;
|
|
2093
|
-
}
|
|
2094
|
-
};
|
|
2095
|
-
|
|
2096
|
-
// Regardless of whether this script is executing as a CommonJS module
|
|
2097
|
-
// or not, return the runtime object so that we can declare the variable
|
|
2098
|
-
// regeneratorRuntime in the outer scope, which allows this module to be
|
|
2099
|
-
// injected easily by `bin/regenerator --include-runtime script.js`.
|
|
2100
|
-
return exports;
|
|
2101
|
-
|
|
2102
|
-
}(
|
|
2103
|
-
// If this script is executing as a CommonJS module, use module.exports
|
|
2104
|
-
// as the regeneratorRuntime namespace. Otherwise create a new empty
|
|
2105
|
-
// object. Either way, the resulting object will be used to initialize
|
|
2106
|
-
// the regeneratorRuntime variable at the top of this file.
|
|
2107
|
-
module.exports
|
|
2108
|
-
));
|
|
2109
|
-
|
|
2110
|
-
try {
|
|
2111
|
-
regeneratorRuntime = runtime;
|
|
2112
|
-
} catch (accidentalStrictMode) {
|
|
2113
|
-
// This module should not be running in strict mode, so the above
|
|
2114
|
-
// assignment should always work unless something is misconfigured. Just
|
|
2115
|
-
// in case runtime.js accidentally runs in strict mode, in modern engines
|
|
2116
|
-
// we can explicitly access globalThis. In older engines we can escape
|
|
2117
|
-
// strict mode using a global Function call. This could conceivably fail
|
|
2118
|
-
// if a Content Security Policy forbids using Function, but in that case
|
|
2119
|
-
// the proper solution is to fix the accidental strict mode problem. If
|
|
2120
|
-
// you've misconfigured your bundler to force strict mode and applied a
|
|
2121
|
-
// CSP to forbid Function, and you're not willing to fix either of those
|
|
2122
|
-
// problems, please detail your unique predicament in a GitHub issue.
|
|
2123
|
-
if (typeof globalThis === "object") {
|
|
2124
|
-
globalThis.regeneratorRuntime = runtime;
|
|
2125
|
-
} else {
|
|
2126
|
-
Function("r", "regeneratorRuntime = r")(runtime);
|
|
2127
|
-
}
|
|
2128
|
-
}
|
|
2129
|
-
});
|
|
2130
|
-
|
|
2131
|
-
/**
|
|
2132
|
-
* A specialized version of `_.reduce` for arrays without support for
|
|
2133
|
-
* iteratee shorthands.
|
|
2134
|
-
*
|
|
2135
|
-
* @private
|
|
2136
|
-
* @param {Array} [array] The array to iterate over.
|
|
2137
|
-
* @param {Function} iteratee The function invoked per iteration.
|
|
2138
|
-
* @param {*} [accumulator] The initial value.
|
|
2139
|
-
* @param {boolean} [initAccum] Specify using the first element of `array` as
|
|
2140
|
-
* the initial value.
|
|
2141
|
-
* @returns {*} Returns the accumulated value.
|
|
2142
|
-
*/
|
|
2143
|
-
function arrayReduce(array, iteratee, accumulator, initAccum) {
|
|
2144
|
-
var index = -1,
|
|
2145
|
-
length = array == null ? 0 : array.length;
|
|
2146
|
-
|
|
2147
|
-
if (initAccum && length) {
|
|
2148
|
-
accumulator = array[++index];
|
|
2149
|
-
}
|
|
2150
|
-
while (++index < length) {
|
|
2151
|
-
accumulator = iteratee(accumulator, array[index], index, array);
|
|
2152
|
-
}
|
|
2153
|
-
return accumulator;
|
|
2154
|
-
}
|
|
2155
|
-
|
|
2156
|
-
var _arrayReduce = arrayReduce;
|
|
2157
|
-
|
|
2158
|
-
/**
|
|
2159
|
-
* The base implementation of `_.propertyOf` without support for deep paths.
|
|
2160
|
-
*
|
|
2161
|
-
* @private
|
|
2162
|
-
* @param {Object} object The object to query.
|
|
2163
|
-
* @returns {Function} Returns the new accessor function.
|
|
2164
|
-
*/
|
|
2165
|
-
function basePropertyOf(object) {
|
|
2166
|
-
return function(key) {
|
|
2167
|
-
return object == null ? undefined : object[key];
|
|
2168
|
-
};
|
|
2169
|
-
}
|
|
2170
|
-
|
|
2171
|
-
var _basePropertyOf = basePropertyOf;
|
|
2172
|
-
|
|
2173
|
-
/** Used to map Latin Unicode letters to basic Latin letters. */
|
|
2174
|
-
var deburredLetters = {
|
|
2175
|
-
// Latin-1 Supplement block.
|
|
2176
|
-
'\xc0': 'A', '\xc1': 'A', '\xc2': 'A', '\xc3': 'A', '\xc4': 'A', '\xc5': 'A',
|
|
2177
|
-
'\xe0': 'a', '\xe1': 'a', '\xe2': 'a', '\xe3': 'a', '\xe4': 'a', '\xe5': 'a',
|
|
2178
|
-
'\xc7': 'C', '\xe7': 'c',
|
|
2179
|
-
'\xd0': 'D', '\xf0': 'd',
|
|
2180
|
-
'\xc8': 'E', '\xc9': 'E', '\xca': 'E', '\xcb': 'E',
|
|
2181
|
-
'\xe8': 'e', '\xe9': 'e', '\xea': 'e', '\xeb': 'e',
|
|
2182
|
-
'\xcc': 'I', '\xcd': 'I', '\xce': 'I', '\xcf': 'I',
|
|
2183
|
-
'\xec': 'i', '\xed': 'i', '\xee': 'i', '\xef': 'i',
|
|
2184
|
-
'\xd1': 'N', '\xf1': 'n',
|
|
2185
|
-
'\xd2': 'O', '\xd3': 'O', '\xd4': 'O', '\xd5': 'O', '\xd6': 'O', '\xd8': 'O',
|
|
2186
|
-
'\xf2': 'o', '\xf3': 'o', '\xf4': 'o', '\xf5': 'o', '\xf6': 'o', '\xf8': 'o',
|
|
2187
|
-
'\xd9': 'U', '\xda': 'U', '\xdb': 'U', '\xdc': 'U',
|
|
2188
|
-
'\xf9': 'u', '\xfa': 'u', '\xfb': 'u', '\xfc': 'u',
|
|
2189
|
-
'\xdd': 'Y', '\xfd': 'y', '\xff': 'y',
|
|
2190
|
-
'\xc6': 'Ae', '\xe6': 'ae',
|
|
2191
|
-
'\xde': 'Th', '\xfe': 'th',
|
|
2192
|
-
'\xdf': 'ss',
|
|
2193
|
-
// Latin Extended-A block.
|
|
2194
|
-
'\u0100': 'A', '\u0102': 'A', '\u0104': 'A',
|
|
2195
|
-
'\u0101': 'a', '\u0103': 'a', '\u0105': 'a',
|
|
2196
|
-
'\u0106': 'C', '\u0108': 'C', '\u010a': 'C', '\u010c': 'C',
|
|
2197
|
-
'\u0107': 'c', '\u0109': 'c', '\u010b': 'c', '\u010d': 'c',
|
|
2198
|
-
'\u010e': 'D', '\u0110': 'D', '\u010f': 'd', '\u0111': 'd',
|
|
2199
|
-
'\u0112': 'E', '\u0114': 'E', '\u0116': 'E', '\u0118': 'E', '\u011a': 'E',
|
|
2200
|
-
'\u0113': 'e', '\u0115': 'e', '\u0117': 'e', '\u0119': 'e', '\u011b': 'e',
|
|
2201
|
-
'\u011c': 'G', '\u011e': 'G', '\u0120': 'G', '\u0122': 'G',
|
|
2202
|
-
'\u011d': 'g', '\u011f': 'g', '\u0121': 'g', '\u0123': 'g',
|
|
2203
|
-
'\u0124': 'H', '\u0126': 'H', '\u0125': 'h', '\u0127': 'h',
|
|
2204
|
-
'\u0128': 'I', '\u012a': 'I', '\u012c': 'I', '\u012e': 'I', '\u0130': 'I',
|
|
2205
|
-
'\u0129': 'i', '\u012b': 'i', '\u012d': 'i', '\u012f': 'i', '\u0131': 'i',
|
|
2206
|
-
'\u0134': 'J', '\u0135': 'j',
|
|
2207
|
-
'\u0136': 'K', '\u0137': 'k', '\u0138': 'k',
|
|
2208
|
-
'\u0139': 'L', '\u013b': 'L', '\u013d': 'L', '\u013f': 'L', '\u0141': 'L',
|
|
2209
|
-
'\u013a': 'l', '\u013c': 'l', '\u013e': 'l', '\u0140': 'l', '\u0142': 'l',
|
|
2210
|
-
'\u0143': 'N', '\u0145': 'N', '\u0147': 'N', '\u014a': 'N',
|
|
2211
|
-
'\u0144': 'n', '\u0146': 'n', '\u0148': 'n', '\u014b': 'n',
|
|
2212
|
-
'\u014c': 'O', '\u014e': 'O', '\u0150': 'O',
|
|
2213
|
-
'\u014d': 'o', '\u014f': 'o', '\u0151': 'o',
|
|
2214
|
-
'\u0154': 'R', '\u0156': 'R', '\u0158': 'R',
|
|
2215
|
-
'\u0155': 'r', '\u0157': 'r', '\u0159': 'r',
|
|
2216
|
-
'\u015a': 'S', '\u015c': 'S', '\u015e': 'S', '\u0160': 'S',
|
|
2217
|
-
'\u015b': 's', '\u015d': 's', '\u015f': 's', '\u0161': 's',
|
|
2218
|
-
'\u0162': 'T', '\u0164': 'T', '\u0166': 'T',
|
|
2219
|
-
'\u0163': 't', '\u0165': 't', '\u0167': 't',
|
|
2220
|
-
'\u0168': 'U', '\u016a': 'U', '\u016c': 'U', '\u016e': 'U', '\u0170': 'U', '\u0172': 'U',
|
|
2221
|
-
'\u0169': 'u', '\u016b': 'u', '\u016d': 'u', '\u016f': 'u', '\u0171': 'u', '\u0173': 'u',
|
|
2222
|
-
'\u0174': 'W', '\u0175': 'w',
|
|
2223
|
-
'\u0176': 'Y', '\u0177': 'y', '\u0178': 'Y',
|
|
2224
|
-
'\u0179': 'Z', '\u017b': 'Z', '\u017d': 'Z',
|
|
2225
|
-
'\u017a': 'z', '\u017c': 'z', '\u017e': 'z',
|
|
2226
|
-
'\u0132': 'IJ', '\u0133': 'ij',
|
|
2227
|
-
'\u0152': 'Oe', '\u0153': 'oe',
|
|
2228
|
-
'\u0149': "'n", '\u017f': 's'
|
|
2229
|
-
};
|
|
2230
|
-
|
|
2231
|
-
/**
|
|
2232
|
-
* Used by `_.deburr` to convert Latin-1 Supplement and Latin Extended-A
|
|
2233
|
-
* letters to basic Latin letters.
|
|
2234
|
-
*
|
|
2235
|
-
* @private
|
|
2236
|
-
* @param {string} letter The matched letter to deburr.
|
|
2237
|
-
* @returns {string} Returns the deburred letter.
|
|
2238
|
-
*/
|
|
2239
|
-
var deburrLetter = _basePropertyOf(deburredLetters);
|
|
2240
|
-
|
|
2241
|
-
var _deburrLetter = deburrLetter;
|
|
2242
|
-
|
|
2243
|
-
/** Used to match Latin Unicode letters (excluding mathematical operators). */
|
|
2244
|
-
var reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g;
|
|
2245
|
-
|
|
2246
|
-
/** Used to compose unicode character classes. */
|
|
2247
|
-
var rsComboMarksRange$1 = '\\u0300-\\u036f',
|
|
2248
|
-
reComboHalfMarksRange$1 = '\\ufe20-\\ufe2f',
|
|
2249
|
-
rsComboSymbolsRange$1 = '\\u20d0-\\u20ff',
|
|
2250
|
-
rsComboRange$1 = rsComboMarksRange$1 + reComboHalfMarksRange$1 + rsComboSymbolsRange$1;
|
|
2251
|
-
|
|
2252
|
-
/** Used to compose unicode capture groups. */
|
|
2253
|
-
var rsCombo$1 = '[' + rsComboRange$1 + ']';
|
|
2254
|
-
|
|
2255
|
-
/**
|
|
2256
|
-
* Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks) and
|
|
2257
|
-
* [combining diacritical marks for symbols](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks_for_Symbols).
|
|
2258
|
-
*/
|
|
2259
|
-
var reComboMark = RegExp(rsCombo$1, 'g');
|
|
2260
|
-
|
|
2261
|
-
/**
|
|
2262
|
-
* Deburrs `string` by converting
|
|
2263
|
-
* [Latin-1 Supplement](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table)
|
|
2264
|
-
* and [Latin Extended-A](https://en.wikipedia.org/wiki/Latin_Extended-A)
|
|
2265
|
-
* letters to basic Latin letters and removing
|
|
2266
|
-
* [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks).
|
|
2267
|
-
*
|
|
2268
|
-
* @static
|
|
2269
|
-
* @memberOf _
|
|
2270
|
-
* @since 3.0.0
|
|
2271
|
-
* @category String
|
|
2272
|
-
* @param {string} [string=''] The string to deburr.
|
|
2273
|
-
* @returns {string} Returns the deburred string.
|
|
2274
|
-
* @example
|
|
2275
|
-
*
|
|
2276
|
-
* _.deburr('déjà vu');
|
|
2277
|
-
* // => 'deja vu'
|
|
2278
|
-
*/
|
|
2279
|
-
function deburr(string) {
|
|
2280
|
-
string = toString_1(string);
|
|
2281
|
-
return string && string.replace(reLatin, _deburrLetter).replace(reComboMark, '');
|
|
2282
|
-
}
|
|
2283
|
-
|
|
2284
|
-
var deburr_1 = deburr;
|
|
2285
|
-
|
|
2286
|
-
/** Used to match words composed of alphanumeric characters. */
|
|
2287
|
-
var reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;
|
|
2288
|
-
|
|
2289
|
-
/**
|
|
2290
|
-
* Splits an ASCII `string` into an array of its words.
|
|
2291
|
-
*
|
|
2292
|
-
* @private
|
|
2293
|
-
* @param {string} The string to inspect.
|
|
2294
|
-
* @returns {Array} Returns the words of `string`.
|
|
2295
|
-
*/
|
|
2296
|
-
function asciiWords(string) {
|
|
2297
|
-
return string.match(reAsciiWord) || [];
|
|
2298
|
-
}
|
|
2299
|
-
|
|
2300
|
-
var _asciiWords = asciiWords;
|
|
2301
|
-
|
|
2302
|
-
/** Used to detect strings that need a more robust regexp to match words. */
|
|
2303
|
-
var reHasUnicodeWord = /[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;
|
|
2304
|
-
|
|
2305
|
-
/**
|
|
2306
|
-
* Checks if `string` contains a word composed of Unicode symbols.
|
|
2307
|
-
*
|
|
2308
|
-
* @private
|
|
2309
|
-
* @param {string} string The string to inspect.
|
|
2310
|
-
* @returns {boolean} Returns `true` if a word is found, else `false`.
|
|
2311
|
-
*/
|
|
2312
|
-
function hasUnicodeWord(string) {
|
|
2313
|
-
return reHasUnicodeWord.test(string);
|
|
2314
|
-
}
|
|
2315
|
-
|
|
2316
|
-
var _hasUnicodeWord = hasUnicodeWord;
|
|
2317
|
-
|
|
2318
|
-
/** Used to compose unicode character classes. */
|
|
2319
|
-
var rsAstralRange = '\\ud800-\\udfff',
|
|
2320
|
-
rsComboMarksRange = '\\u0300-\\u036f',
|
|
2321
|
-
reComboHalfMarksRange = '\\ufe20-\\ufe2f',
|
|
2322
|
-
rsComboSymbolsRange = '\\u20d0-\\u20ff',
|
|
2323
|
-
rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange,
|
|
2324
|
-
rsDingbatRange = '\\u2700-\\u27bf',
|
|
2325
|
-
rsLowerRange = 'a-z\\xdf-\\xf6\\xf8-\\xff',
|
|
2326
|
-
rsMathOpRange = '\\xac\\xb1\\xd7\\xf7',
|
|
2327
|
-
rsNonCharRange = '\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf',
|
|
2328
|
-
rsPunctuationRange = '\\u2000-\\u206f',
|
|
2329
|
-
rsSpaceRange = ' \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000',
|
|
2330
|
-
rsUpperRange = 'A-Z\\xc0-\\xd6\\xd8-\\xde',
|
|
2331
|
-
rsVarRange = '\\ufe0e\\ufe0f',
|
|
2332
|
-
rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange;
|
|
2333
|
-
|
|
2334
|
-
/** Used to compose unicode capture groups. */
|
|
2335
|
-
var rsApos$1 = "['\u2019]",
|
|
2336
|
-
rsBreak = '[' + rsBreakRange + ']',
|
|
2337
|
-
rsCombo = '[' + rsComboRange + ']',
|
|
2338
|
-
rsDigits = '\\d+',
|
|
2339
|
-
rsDingbat = '[' + rsDingbatRange + ']',
|
|
2340
|
-
rsLower = '[' + rsLowerRange + ']',
|
|
2341
|
-
rsMisc = '[^' + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + ']',
|
|
2342
|
-
rsFitz = '\\ud83c[\\udffb-\\udfff]',
|
|
2343
|
-
rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')',
|
|
2344
|
-
rsNonAstral = '[^' + rsAstralRange + ']',
|
|
2345
|
-
rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}',
|
|
2346
|
-
rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]',
|
|
2347
|
-
rsUpper = '[' + rsUpperRange + ']',
|
|
2348
|
-
rsZWJ = '\\u200d';
|
|
2349
|
-
|
|
2350
|
-
/** Used to compose unicode regexes. */
|
|
2351
|
-
var rsMiscLower = '(?:' + rsLower + '|' + rsMisc + ')',
|
|
2352
|
-
rsMiscUpper = '(?:' + rsUpper + '|' + rsMisc + ')',
|
|
2353
|
-
rsOptContrLower = '(?:' + rsApos$1 + '(?:d|ll|m|re|s|t|ve))?',
|
|
2354
|
-
rsOptContrUpper = '(?:' + rsApos$1 + '(?:D|LL|M|RE|S|T|VE))?',
|
|
2355
|
-
reOptMod = rsModifier + '?',
|
|
2356
|
-
rsOptVar = '[' + rsVarRange + ']?',
|
|
2357
|
-
rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*',
|
|
2358
|
-
rsOrdLower = '\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])',
|
|
2359
|
-
rsOrdUpper = '\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])',
|
|
2360
|
-
rsSeq = rsOptVar + reOptMod + rsOptJoin,
|
|
2361
|
-
rsEmoji = '(?:' + [rsDingbat, rsRegional, rsSurrPair].join('|') + ')' + rsSeq;
|
|
2362
|
-
|
|
2363
|
-
/** Used to match complex or compound words. */
|
|
2364
|
-
var reUnicodeWord = RegExp([
|
|
2365
|
-
rsUpper + '?' + rsLower + '+' + rsOptContrLower + '(?=' + [rsBreak, rsUpper, '$'].join('|') + ')',
|
|
2366
|
-
rsMiscUpper + '+' + rsOptContrUpper + '(?=' + [rsBreak, rsUpper + rsMiscLower, '$'].join('|') + ')',
|
|
2367
|
-
rsUpper + '?' + rsMiscLower + '+' + rsOptContrLower,
|
|
2368
|
-
rsUpper + '+' + rsOptContrUpper,
|
|
2369
|
-
rsOrdUpper,
|
|
2370
|
-
rsOrdLower,
|
|
2371
|
-
rsDigits,
|
|
2372
|
-
rsEmoji
|
|
2373
|
-
].join('|'), 'g');
|
|
2374
|
-
|
|
2375
|
-
/**
|
|
2376
|
-
* Splits a Unicode `string` into an array of its words.
|
|
2377
|
-
*
|
|
2378
|
-
* @private
|
|
2379
|
-
* @param {string} The string to inspect.
|
|
2380
|
-
* @returns {Array} Returns the words of `string`.
|
|
2381
|
-
*/
|
|
2382
|
-
function unicodeWords(string) {
|
|
2383
|
-
return string.match(reUnicodeWord) || [];
|
|
2384
|
-
}
|
|
2385
|
-
|
|
2386
|
-
var _unicodeWords = unicodeWords;
|
|
2387
|
-
|
|
2388
|
-
/**
|
|
2389
|
-
* Splits `string` into an array of its words.
|
|
2390
|
-
*
|
|
2391
|
-
* @static
|
|
2392
|
-
* @memberOf _
|
|
2393
|
-
* @since 3.0.0
|
|
2394
|
-
* @category String
|
|
2395
|
-
* @param {string} [string=''] The string to inspect.
|
|
2396
|
-
* @param {RegExp|string} [pattern] The pattern to match words.
|
|
2397
|
-
* @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
|
|
2398
|
-
* @returns {Array} Returns the words of `string`.
|
|
2399
|
-
* @example
|
|
2400
|
-
*
|
|
2401
|
-
* _.words('fred, barney, & pebbles');
|
|
2402
|
-
* // => ['fred', 'barney', 'pebbles']
|
|
2403
|
-
*
|
|
2404
|
-
* _.words('fred, barney, & pebbles', /[^, ]+/g);
|
|
2405
|
-
* // => ['fred', 'barney', '&', 'pebbles']
|
|
2406
|
-
*/
|
|
2407
|
-
function words(string, pattern, guard) {
|
|
2408
|
-
string = toString_1(string);
|
|
2409
|
-
pattern = guard ? undefined : pattern;
|
|
2410
|
-
|
|
2411
|
-
if (pattern === undefined) {
|
|
2412
|
-
return _hasUnicodeWord(string) ? _unicodeWords(string) : _asciiWords(string);
|
|
2413
|
-
}
|
|
2414
|
-
return string.match(pattern) || [];
|
|
2415
|
-
}
|
|
2416
|
-
|
|
2417
|
-
var words_1 = words;
|
|
2418
|
-
|
|
2419
|
-
/** Used to compose unicode capture groups. */
|
|
2420
|
-
var rsApos = "['\u2019]";
|
|
2421
|
-
|
|
2422
|
-
/** Used to match apostrophes. */
|
|
2423
|
-
var reApos = RegExp(rsApos, 'g');
|
|
2424
|
-
|
|
2425
|
-
/**
|
|
2426
|
-
* Creates a function like `_.camelCase`.
|
|
2427
|
-
*
|
|
2428
|
-
* @private
|
|
2429
|
-
* @param {Function} callback The function to combine each word.
|
|
2430
|
-
* @returns {Function} Returns the new compounder function.
|
|
2431
|
-
*/
|
|
2432
|
-
function createCompounder(callback) {
|
|
2433
|
-
return function(string) {
|
|
2434
|
-
return _arrayReduce(words_1(deburr_1(string).replace(reApos, '')), callback, '');
|
|
2435
|
-
};
|
|
2436
|
-
}
|
|
2437
|
-
|
|
2438
|
-
var _createCompounder = createCompounder;
|
|
2439
|
-
|
|
2440
|
-
/**
|
|
2441
|
-
* Converts `string`, as space separated words, to upper case.
|
|
2442
|
-
*
|
|
2443
|
-
* @static
|
|
2444
|
-
* @memberOf _
|
|
2445
|
-
* @since 4.0.0
|
|
2446
|
-
* @category String
|
|
2447
|
-
* @param {string} [string=''] The string to convert.
|
|
2448
|
-
* @returns {string} Returns the upper cased string.
|
|
2449
|
-
* @example
|
|
2450
|
-
*
|
|
2451
|
-
* _.upperCase('--foo-bar');
|
|
2452
|
-
* // => 'FOO BAR'
|
|
2453
|
-
*
|
|
2454
|
-
* _.upperCase('fooBar');
|
|
2455
|
-
* // => 'FOO BAR'
|
|
2456
|
-
*
|
|
2457
|
-
* _.upperCase('__foo_bar__');
|
|
2458
|
-
* // => 'FOO BAR'
|
|
2459
|
-
*/
|
|
2460
|
-
var upperCase = _createCompounder(function(result, word, index) {
|
|
2461
|
-
return result + (index ? ' ' : '') + word.toUpperCase();
|
|
2462
|
-
});
|
|
2463
|
-
|
|
2464
|
-
var upperCase_1 = upperCase;
|
|
2465
|
-
|
|
2466
|
-
/**
|
|
2467
|
-
* Converts `string`, as space separated words, to lower case.
|
|
2468
|
-
*
|
|
2469
|
-
* @static
|
|
2470
|
-
* @memberOf _
|
|
2471
|
-
* @since 4.0.0
|
|
2472
|
-
* @category String
|
|
2473
|
-
* @param {string} [string=''] The string to convert.
|
|
2474
|
-
* @returns {string} Returns the lower cased string.
|
|
2475
|
-
* @example
|
|
2476
|
-
*
|
|
2477
|
-
* _.lowerCase('--Foo-Bar--');
|
|
2478
|
-
* // => 'foo bar'
|
|
2479
|
-
*
|
|
2480
|
-
* _.lowerCase('fooBar');
|
|
2481
|
-
* // => 'foo bar'
|
|
2482
|
-
*
|
|
2483
|
-
* _.lowerCase('__FOO_BAR__');
|
|
2484
|
-
* // => 'foo bar'
|
|
2485
|
-
*/
|
|
2486
|
-
var lowerCase = _createCompounder(function(result, word, index) {
|
|
2487
|
-
return result + (index ? ' ' : '') + word.toLowerCase();
|
|
2488
|
-
});
|
|
2489
|
-
|
|
2490
|
-
var lowerCase_1 = lowerCase;
|
|
2491
|
-
|
|
2492
66
|
function truncate() {
|
|
2493
67
|
var string = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "";
|
|
2494
68
|
var limit = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 60;
|
|
@@ -2515,7 +89,7 @@ var timestampToFormat = function timestampToFormat(value, unit, suffix, timestam
|
|
|
2515
89
|
var localizedMonth = month;
|
|
2516
90
|
|
|
2517
91
|
if (isUpperCase) {
|
|
2518
|
-
localizedMonth =
|
|
92
|
+
localizedMonth = lodash.upperCase(month);
|
|
2519
93
|
}
|
|
2520
94
|
|
|
2521
95
|
var year = dateTime.getFullYear();
|
|
@@ -2528,7 +102,7 @@ var timestampToFormat = function timestampToFormat(value, unit, suffix, timestam
|
|
|
2528
102
|
var timetoShow;
|
|
2529
103
|
|
|
2530
104
|
if (localizedMonths) {
|
|
2531
|
-
localizedMonth =
|
|
105
|
+
localizedMonth = lodash.get(localizedMonths, [lodash.lowerCase(month)]) || month;
|
|
2532
106
|
}
|
|
2533
107
|
|
|
2534
108
|
if (localizedMeridiem) {
|
|
@@ -2558,17 +132,17 @@ function formatter(value, unit, suffix, date, config) {
|
|
|
2558
132
|
var showDateForUnits = ["day", "week", "month", "year"]; // suffix here refers to ago
|
|
2559
133
|
// unit here refers to seconds, minute, minutes,...
|
|
2560
134
|
|
|
2561
|
-
var localizedSuffix =
|
|
135
|
+
var localizedSuffix = lodash.get(config, ["localizedPublishTime", suffix]) || suffix;
|
|
2562
136
|
var localizedUnitOfTime;
|
|
2563
137
|
|
|
2564
138
|
if (unit === "hour" && value > 23 || showDateForUnits.indexOf(unit) !== -1) {
|
|
2565
139
|
return timestampToFormat(value, unit, suffix, date, config);
|
|
2566
140
|
} else if (value > 1) {
|
|
2567
|
-
localizedUnitOfTime =
|
|
141
|
+
localizedUnitOfTime = lodash.get(config, ["localizedPublishTime", "".concat(unit, "s")]) || "".concat(unit, "s");
|
|
2568
142
|
return "".concat(value, " ").concat(localizedUnitOfTime, " ").concat(localizedSuffix);
|
|
2569
143
|
}
|
|
2570
144
|
|
|
2571
|
-
localizedUnitOfTime =
|
|
145
|
+
localizedUnitOfTime = lodash.get(config, ["localizedPublishTime", unit]) || unit;
|
|
2572
146
|
return "".concat(value, " ").concat(localizedUnitOfTime, " ").concat(localizedSuffix, " ");
|
|
2573
147
|
}
|
|
2574
148
|
|
|
@@ -2621,10 +195,10 @@ var clientWidths = {
|
|
|
2621
195
|
tablet: 1024
|
|
2622
196
|
};
|
|
2623
197
|
var clientWidth = function clientWidth(device) {
|
|
2624
|
-
var foundDeviceWidth =
|
|
198
|
+
var foundDeviceWidth = lodash.get(clientWidths, device);
|
|
2625
199
|
|
|
2626
200
|
if (foundDeviceWidth) {
|
|
2627
|
-
return
|
|
201
|
+
return lodash.get(global, "document.documentElement.clientWidth") <= foundDeviceWidth;
|
|
2628
202
|
}
|
|
2629
203
|
|
|
2630
204
|
return false;
|
|
@@ -2654,7 +228,7 @@ var getSlug = function getSlug(collection) {
|
|
|
2654
228
|
var isSection = collection.template === "section";
|
|
2655
229
|
|
|
2656
230
|
if (isSection) {
|
|
2657
|
-
var sectionId =
|
|
231
|
+
var sectionId = lodash.get(collection, ["metadata", "section", "0", "id"], "");
|
|
2658
232
|
var sections = config.sections;
|
|
2659
233
|
var section = sections && sections.find(function (section) {
|
|
2660
234
|
return section.id === sectionId;
|
|
@@ -2670,25 +244,25 @@ function isExternalStory() {
|
|
|
2670
244
|
storyTemplate = _story$storyTemplate === void 0 ? "" : _story$storyTemplate,
|
|
2671
245
|
_story$metadata = story.metadata,
|
|
2672
246
|
metadata = _story$metadata === void 0 ? {} : _story$metadata;
|
|
2673
|
-
return storyTemplate === "news-elsewhere" ?
|
|
247
|
+
return storyTemplate === "news-elsewhere" ? lodash.get(metadata, ["reference-url"], "") : "";
|
|
2674
248
|
} // Adds target='_blank' attribute to anchor tags if not present
|
|
2675
249
|
var isEmpty = function isEmpty(value) {
|
|
2676
250
|
return value == null || // From standard.js: Always use === - but value == null is allowed to check null || undefined
|
|
2677
|
-
|
|
251
|
+
_typeof__default["default"](value) === "object" && Object.entries(value).length === 0 && value.constructor === Object || typeof value === "string" && value.trim().length === 0;
|
|
2678
252
|
};
|
|
2679
|
-
|
|
2680
|
-
"sketches-host":
|
|
2681
|
-
"cdn-name":
|
|
2682
|
-
"cdn-image":
|
|
253
|
+
PropTypes__default["default"].shape({
|
|
254
|
+
"sketches-host": PropTypes__default["default"].string,
|
|
255
|
+
"cdn-name": PropTypes__default["default"].string,
|
|
256
|
+
"cdn-image": PropTypes__default["default"].string
|
|
2683
257
|
});
|
|
2684
|
-
|
|
2685
|
-
headline:
|
|
2686
|
-
"last-published-at":
|
|
2687
|
-
subheadline:
|
|
258
|
+
PropTypes__default["default"].shape({
|
|
259
|
+
headline: PropTypes__default["default"].string,
|
|
260
|
+
"last-published-at": PropTypes__default["default"].number,
|
|
261
|
+
subheadline: PropTypes__default["default"].string
|
|
2688
262
|
});
|
|
2689
263
|
var getStoryUrl = function getStoryUrl(story) {
|
|
2690
264
|
var defaultValue = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "";
|
|
2691
|
-
return
|
|
265
|
+
return lodash.get(story, ["story-template"]) === "news-elsewhere" ? lodash.get(story, ["metadata", "reference-url"], "") : story.url || defaultValue;
|
|
2692
266
|
};
|
|
2693
267
|
var navigateTo = function navigateTo(dispatch) {
|
|
2694
268
|
var url = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "";
|
|
@@ -2728,17 +302,17 @@ var getTimeStamp = function getTimeStamp(date, _formatter) {
|
|
|
2728
302
|
var timezone = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : null;
|
|
2729
303
|
|
|
2730
304
|
if (timezone && template === "story") {
|
|
2731
|
-
var zonedTime = timezone && utcToZonedTime(date, timezone);
|
|
2732
|
-
var formatZonedTime = zonedTime && format(zonedTime, "yyyy-MM-dd'T'HH:mm:ssXXX", {
|
|
305
|
+
var zonedTime = timezone && dateFnsTz.utcToZonedTime(date, timezone);
|
|
306
|
+
var formatZonedTime = zonedTime && dateFnsTz.format(zonedTime, "yyyy-MM-dd'T'HH:mm:ssXXX", {
|
|
2733
307
|
timeZone: timezone
|
|
2734
308
|
});
|
|
2735
309
|
var timeStamp = timestampToFormat("", "", "", date, config);
|
|
2736
|
-
return /*#__PURE__*/
|
|
310
|
+
return /*#__PURE__*/React__default["default"].createElement("time", {
|
|
2737
311
|
dateTime: formatZonedTime
|
|
2738
312
|
}, timeStamp);
|
|
2739
313
|
}
|
|
2740
314
|
|
|
2741
|
-
return /*#__PURE__*/
|
|
315
|
+
return /*#__PURE__*/React__default["default"].createElement(Timeago__default["default"], {
|
|
2742
316
|
date: date,
|
|
2743
317
|
formatter: function formatter(value, unit, suffix, date) {
|
|
2744
318
|
return _formatter(value, unit, suffix, date, config);
|
|
@@ -2771,7 +345,7 @@ var CollectionNameBase = function CollectionNameBase(_ref) {
|
|
|
2771
345
|
_ref$navigate = _ref.navigate,
|
|
2772
346
|
navigate = _ref$navigate === void 0 ? true : _ref$navigate;
|
|
2773
347
|
var collectionTitle = useStateValue() || {};
|
|
2774
|
-
var showRowTitle =
|
|
348
|
+
var showRowTitle = lodash.get(collectionTitle, ["showRowTitle"], true);
|
|
2775
349
|
var supportedTemplates = ["borderLeft", "borderBottom", "crossLine", "borderBottomFull"];
|
|
2776
350
|
var templateStyle = supportedTemplates.includes(collectionNameTemplate) ? " collection-".concat(collectionNameTemplate) : "";
|
|
2777
351
|
var slug = navigate && collection && getSlug(collection, config) || "";
|
|
@@ -2782,7 +356,7 @@ var CollectionNameBase = function CollectionNameBase(_ref) {
|
|
|
2782
356
|
var borderBottomFullStyle = templateStyle.includes("collection-borderBottomFull") ? "4px solid ".concat(CollectionNameBorderColor) : "";
|
|
2783
357
|
|
|
2784
358
|
var borderBottomStyle = function borderBottomStyle() {
|
|
2785
|
-
return templateStyle.includes("collection-borderBottom") && !templateStyle.includes("collection-borderBottomFull") ? /*#__PURE__*/
|
|
359
|
+
return templateStyle.includes("collection-borderBottom") && !templateStyle.includes("collection-borderBottomFull") ? /*#__PURE__*/React__default["default"].createElement("div", {
|
|
2786
360
|
className: "collection-name-m_border-bottom__1MnlV",
|
|
2787
361
|
style: {
|
|
2788
362
|
borderBottom: "4px solid ".concat(CollectionNameBorderColor)
|
|
@@ -2842,40 +416,40 @@ var CollectionNameBase = function CollectionNameBase(_ref) {
|
|
|
2842
416
|
}
|
|
2843
417
|
};
|
|
2844
418
|
|
|
2845
|
-
return /*#__PURE__*/
|
|
419
|
+
return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, showRowTitle && collectionName && /*#__PURE__*/React__default["default"].createElement("div", {
|
|
2846
420
|
style: {
|
|
2847
421
|
borderBottom: borderBottomFullStyle
|
|
2848
422
|
},
|
|
2849
423
|
"data-test-id": "collection-name",
|
|
2850
|
-
className: ("arr--collection-name arrow-component ".concat(templateStyle) ? "arr--collection-name arrow-component ".concat(templateStyle) + " " : "") +
|
|
2851
|
-
}, templateStyle.includes("collection-borderLeft") && /*#__PURE__*/
|
|
424
|
+
className: ("arr--collection-name arrow-component ".concat(templateStyle) ? "arr--collection-name arrow-component ".concat(templateStyle) + " " : "") + _getClassName__default["default"]("collection ".concat(textColor, " ").concat(templateStyle), _styleModuleImportMap$d)
|
|
425
|
+
}, templateStyle.includes("collection-borderLeft") && /*#__PURE__*/React__default["default"].createElement("span", {
|
|
2852
426
|
className: "arr-collection-name-border-left collection-name-m_border-left__3_pYw",
|
|
2853
427
|
style: {
|
|
2854
428
|
color: CollectionNameBorderColor,
|
|
2855
429
|
fontSize: getBorderHeight()
|
|
2856
430
|
}
|
|
2857
|
-
}), slug && !slug.includes(undefined) ? /*#__PURE__*/
|
|
431
|
+
}), slug && !slug.includes(undefined) ? /*#__PURE__*/React__default["default"].createElement(components.Link, {
|
|
2858
432
|
href: slug,
|
|
2859
433
|
"aria-label": "collection-name"
|
|
2860
|
-
}, /*#__PURE__*/
|
|
434
|
+
}, /*#__PURE__*/React__default["default"].createElement(HeaderTag, null, collectionName)) : /*#__PURE__*/React__default["default"].createElement(HeaderTag, null, collectionName), borderBottomStyle()));
|
|
2861
435
|
};
|
|
2862
436
|
CollectionNameBase.propTypes = {
|
|
2863
437
|
/** Collection name border color */
|
|
2864
|
-
collectionNameBorderColor: PropTypes
|
|
438
|
+
collectionNameBorderColor: PropTypes.PropTypes.string,
|
|
2865
439
|
|
|
2866
440
|
/** The Collection Object from the API response */
|
|
2867
|
-
collection: PropTypes
|
|
441
|
+
collection: PropTypes.PropTypes.object,
|
|
2868
442
|
|
|
2869
443
|
/** The publisher config from the API response */
|
|
2870
|
-
config: PropTypes
|
|
444
|
+
config: PropTypes.PropTypes.object,
|
|
2871
445
|
|
|
2872
446
|
/** The style template for the component */
|
|
2873
|
-
collectionNameTemplate: PropTypes
|
|
447
|
+
collectionNameTemplate: PropTypes.PropTypes.oneOf(["", "borderLeft", "borderBottom", "crossLine", "borderBottomFull"]),
|
|
2874
448
|
|
|
2875
449
|
/** Header tags ranging h1-h6, where h[headerLevel] */
|
|
2876
|
-
headerLevel: PropTypes
|
|
2877
|
-
customCollectionName: PropTypes
|
|
2878
|
-
navigate: PropTypes
|
|
450
|
+
headerLevel: PropTypes.PropTypes.string,
|
|
451
|
+
customCollectionName: PropTypes.PropTypes.string,
|
|
452
|
+
navigate: PropTypes.PropTypes.bool
|
|
2879
453
|
};
|
|
2880
454
|
CollectionNameBase.defaultProps = {
|
|
2881
455
|
collectionNameTemplate: "",
|
|
@@ -2884,72 +458,11 @@ CollectionNameBase.defaultProps = {
|
|
|
2884
458
|
|
|
2885
459
|
function mapStateToProps$1(state) {
|
|
2886
460
|
return {
|
|
2887
|
-
config:
|
|
461
|
+
config: lodash.get(state, ["qt", "config"], {})
|
|
2888
462
|
};
|
|
2889
463
|
}
|
|
2890
464
|
|
|
2891
|
-
var CollectionName = connect(mapStateToProps$1)(CollectionNameBase);
|
|
2892
|
-
|
|
2893
|
-
function _arrayWithHoles(arr) {
|
|
2894
|
-
if (Array.isArray(arr)) return arr;
|
|
2895
|
-
}
|
|
2896
|
-
|
|
2897
|
-
function _iterableToArrayLimit(arr, i) {
|
|
2898
|
-
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
2899
|
-
|
|
2900
|
-
if (_i == null) return;
|
|
2901
|
-
var _arr = [];
|
|
2902
|
-
var _n = true;
|
|
2903
|
-
var _d = false;
|
|
2904
|
-
|
|
2905
|
-
var _s, _e;
|
|
2906
|
-
|
|
2907
|
-
try {
|
|
2908
|
-
for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {
|
|
2909
|
-
_arr.push(_s.value);
|
|
2910
|
-
|
|
2911
|
-
if (i && _arr.length === i) break;
|
|
2912
|
-
}
|
|
2913
|
-
} catch (err) {
|
|
2914
|
-
_d = true;
|
|
2915
|
-
_e = err;
|
|
2916
|
-
} finally {
|
|
2917
|
-
try {
|
|
2918
|
-
if (!_n && _i["return"] != null) _i["return"]();
|
|
2919
|
-
} finally {
|
|
2920
|
-
if (_d) throw _e;
|
|
2921
|
-
}
|
|
2922
|
-
}
|
|
2923
|
-
|
|
2924
|
-
return _arr;
|
|
2925
|
-
}
|
|
2926
|
-
|
|
2927
|
-
function _arrayLikeToArray(arr, len) {
|
|
2928
|
-
if (len == null || len > arr.length) len = arr.length;
|
|
2929
|
-
|
|
2930
|
-
for (var i = 0, arr2 = new Array(len); i < len; i++) {
|
|
2931
|
-
arr2[i] = arr[i];
|
|
2932
|
-
}
|
|
2933
|
-
|
|
2934
|
-
return arr2;
|
|
2935
|
-
}
|
|
2936
|
-
|
|
2937
|
-
function _unsupportedIterableToArray(o, minLen) {
|
|
2938
|
-
if (!o) return;
|
|
2939
|
-
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
|
|
2940
|
-
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
2941
|
-
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
2942
|
-
if (n === "Map" || n === "Set") return Array.from(o);
|
|
2943
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
|
2944
|
-
}
|
|
2945
|
-
|
|
2946
|
-
function _nonIterableRest() {
|
|
2947
|
-
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
2948
|
-
}
|
|
2949
|
-
|
|
2950
|
-
function _slicedToArray(arr, i) {
|
|
2951
|
-
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
|
|
2952
|
-
}
|
|
465
|
+
var CollectionName = reactRedux.connect(mapStateToProps$1)(CollectionNameBase);
|
|
2953
466
|
|
|
2954
467
|
var ImageFallbackIcon = function ImageFallbackIcon(_ref) {
|
|
2955
468
|
var _ref$width = _ref.width,
|
|
@@ -2958,27 +471,27 @@ var ImageFallbackIcon = function ImageFallbackIcon(_ref) {
|
|
|
2958
471
|
height = _ref$height === void 0 ? 30 : _ref$height,
|
|
2959
472
|
_ref$iconColor = _ref.iconColor,
|
|
2960
473
|
iconColor = _ref$iconColor === void 0 ? "#99B0CB" : _ref$iconColor;
|
|
2961
|
-
return /*#__PURE__*/
|
|
474
|
+
return /*#__PURE__*/React__default["default"].createElement("svg", {
|
|
2962
475
|
width: width,
|
|
2963
476
|
height: height,
|
|
2964
477
|
viewBox: "0 0 102 76",
|
|
2965
478
|
version: "1.1"
|
|
2966
|
-
}, /*#__PURE__*/
|
|
479
|
+
}, /*#__PURE__*/React__default["default"].createElement("g", {
|
|
2967
480
|
id: "demo-home-copy",
|
|
2968
481
|
stroke: "none",
|
|
2969
482
|
strokeWidth: "1",
|
|
2970
483
|
fill: "none",
|
|
2971
484
|
fillRule: "evenodd",
|
|
2972
485
|
transform: "translate(-377.000000, -314.000000)"
|
|
2973
|
-
}, /*#__PURE__*/
|
|
486
|
+
}, /*#__PURE__*/React__default["default"].createElement("g", {
|
|
2974
487
|
id: "Group-13",
|
|
2975
488
|
transform: "translate(377.000000, 314.000000)"
|
|
2976
|
-
}, /*#__PURE__*/
|
|
489
|
+
}, /*#__PURE__*/React__default["default"].createElement("path", {
|
|
2977
490
|
d: "M43.2,49.7 L62.2,19.2 L87.2,59.4 L17,59.4 L32.8,39.4 L43.2,49.7 Z M29.9,28.6 C25.8683213,28.6 22.6,25.3316787 22.6,21.3 C22.6,17.2683213 25.8683213,14 29.9,14 C33.9316787,14 37.2,17.2683213 37.2,21.3 C37.2,25.3316787 33.9316787,28.6 29.9,28.6 Z",
|
|
2978
491
|
id: "Combined-Shape",
|
|
2979
492
|
fill: iconColor,
|
|
2980
493
|
fillRule: "nonzero"
|
|
2981
|
-
}), /*#__PURE__*/
|
|
494
|
+
}), /*#__PURE__*/React__default["default"].createElement("rect", {
|
|
2982
495
|
id: "Rectangle-19",
|
|
2983
496
|
stroke: iconColor,
|
|
2984
497
|
strokeWidth: "3",
|
|
@@ -2990,24 +503,24 @@ var ImageFallbackIcon = function ImageFallbackIcon(_ref) {
|
|
|
2990
503
|
}))));
|
|
2991
504
|
};
|
|
2992
505
|
ImageFallbackIcon.propTypes = {
|
|
2993
|
-
width:
|
|
2994
|
-
height:
|
|
2995
|
-
iconColor:
|
|
506
|
+
width: PropTypes__default["default"].object,
|
|
507
|
+
height: PropTypes__default["default"].object,
|
|
508
|
+
iconColor: PropTypes__default["default"].object
|
|
2996
509
|
};
|
|
2997
510
|
|
|
2998
511
|
var imageFallback = function imageFallback() {
|
|
2999
|
-
return /*#__PURE__*/
|
|
512
|
+
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
3000
513
|
className: "arr--fallback-image fallback-m_image__1GYCJ fallback-m_image-position__3KddP"
|
|
3001
|
-
}, /*#__PURE__*/
|
|
514
|
+
}, /*#__PURE__*/React__default["default"].createElement("figure", {
|
|
3002
515
|
className: "arr--fallback-svg fallback-m_fallback-svg__tK9fL"
|
|
3003
|
-
}, /*#__PURE__*/
|
|
516
|
+
}, /*#__PURE__*/React__default["default"].createElement(ImageFallbackIcon, null)));
|
|
3004
517
|
};
|
|
3005
518
|
|
|
3006
519
|
var FallbackImage = function FallbackImage(_ref) {
|
|
3007
520
|
var slug = _ref.slug;
|
|
3008
521
|
|
|
3009
522
|
if (slug) {
|
|
3010
|
-
return /*#__PURE__*/
|
|
523
|
+
return /*#__PURE__*/React__default["default"].createElement(components.Link, {
|
|
3011
524
|
href: slug,
|
|
3012
525
|
"aria-label": "image-fallback"
|
|
3013
526
|
}, imageFallback());
|
|
@@ -3016,23 +529,23 @@ var FallbackImage = function FallbackImage(_ref) {
|
|
|
3016
529
|
}
|
|
3017
530
|
};
|
|
3018
531
|
FallbackImage.propTypes = {
|
|
3019
|
-
slug:
|
|
532
|
+
slug: PropTypes__default["default"].string
|
|
3020
533
|
};
|
|
3021
534
|
|
|
3022
535
|
var HyperLinkIcon = function HyperLinkIcon() {
|
|
3023
|
-
return /*#__PURE__*/
|
|
536
|
+
return /*#__PURE__*/React__default["default"].createElement("svg", {
|
|
3024
537
|
xmlns: "http://www.w3.org/2000/svg",
|
|
3025
538
|
width: "36",
|
|
3026
539
|
height: "28"
|
|
3027
|
-
}, /*#__PURE__*/
|
|
540
|
+
}, /*#__PURE__*/React__default["default"].createElement("g", {
|
|
3028
541
|
fill: "none",
|
|
3029
542
|
fillRule: "evenodd"
|
|
3030
|
-
}, /*#__PURE__*/
|
|
543
|
+
}, /*#__PURE__*/React__default["default"].createElement("rect", {
|
|
3031
544
|
width: "36",
|
|
3032
545
|
height: "28",
|
|
3033
546
|
fill: "#3D6FCF",
|
|
3034
547
|
rx: "4"
|
|
3035
|
-
}), /*#__PURE__*/
|
|
548
|
+
}), /*#__PURE__*/React__default["default"].createElement("path", {
|
|
3036
549
|
stroke: "#FFF",
|
|
3037
550
|
strokeLinecap: "round",
|
|
3038
551
|
strokeLinejoin: "round",
|
|
@@ -3045,16 +558,16 @@ var HyperLink = function HyperLink(_ref) {
|
|
|
3045
558
|
var _ref$hyperLink = _ref.hyperLink,
|
|
3046
559
|
hyperLink = _ref$hyperLink === void 0 ? "" : _ref$hyperLink;
|
|
3047
560
|
if (!hyperLink) return null;
|
|
3048
|
-
return /*#__PURE__*/
|
|
561
|
+
return /*#__PURE__*/React__default["default"].createElement(components.Link, {
|
|
3049
562
|
href: hyperLink,
|
|
3050
563
|
"aria-label": "hyperlink-button",
|
|
3051
564
|
className: "arr--hyperlink-button hyperlink-m_hyperlink-button__1CqWx",
|
|
3052
565
|
target: "_blank",
|
|
3053
566
|
rel: "noopener noreferrer"
|
|
3054
|
-
}, /*#__PURE__*/
|
|
567
|
+
}, /*#__PURE__*/React__default["default"].createElement(HyperLinkIcon, null));
|
|
3055
568
|
};
|
|
3056
569
|
HyperLink.propTypes = {
|
|
3057
|
-
hyperLink:
|
|
570
|
+
hyperLink: PropTypes__default["default"].string
|
|
3058
571
|
};
|
|
3059
572
|
|
|
3060
573
|
var _styleModuleImportMap$c = {
|
|
@@ -3090,8 +603,8 @@ var HeroImage = function HeroImage(_ref) {
|
|
|
3090
603
|
StoryTemplateIcon = _config$StoryTemplate === void 0 ? function () {
|
|
3091
604
|
return null;
|
|
3092
605
|
} : _config$StoryTemplate;
|
|
3093
|
-
var showImagePlaceholder = useSelector(function (state) {
|
|
3094
|
-
return
|
|
606
|
+
var showImagePlaceholder = reactRedux.useSelector(function (state) {
|
|
607
|
+
return lodash.get(state, ["qt", "config", "showPlaceholder"]);
|
|
3095
608
|
});
|
|
3096
609
|
var getPlaceholderStyleName = showImagePlaceholder ? "placeholder" : "";
|
|
3097
610
|
var fullBleed = FullBleed ? "" : "with-padding";
|
|
@@ -3100,7 +613,7 @@ var HeroImage = function HeroImage(_ref) {
|
|
|
3100
613
|
var heroImageMobClasses = isHorizontalMobile ? "right-padding-mob" : "";
|
|
3101
614
|
|
|
3102
615
|
var getPadding = function getPadding(aspectRatio) {
|
|
3103
|
-
var _aspectRatio =
|
|
616
|
+
var _aspectRatio = _slicedToArray__default["default"](aspectRatio, 2),
|
|
3104
617
|
height = _aspectRatio[0],
|
|
3105
618
|
width = _aspectRatio[1];
|
|
3106
619
|
|
|
@@ -3112,7 +625,7 @@ var HeroImage = function HeroImage(_ref) {
|
|
|
3112
625
|
return 0;
|
|
3113
626
|
};
|
|
3114
627
|
|
|
3115
|
-
var _aspectRatio2 =
|
|
628
|
+
var _aspectRatio2 = _slicedToArray__default["default"](aspectRatio, 2),
|
|
3116
629
|
mobileAspectRatio = _aspectRatio2[0],
|
|
3117
630
|
_aspectRatio2$ = _aspectRatio2[1],
|
|
3118
631
|
desktopAspectRatio = _aspectRatio2$ === void 0 ? mobileAspectRatio : _aspectRatio2$;
|
|
@@ -3120,43 +633,43 @@ var HeroImage = function HeroImage(_ref) {
|
|
|
3120
633
|
var isMobile = clientWidth("mobile");
|
|
3121
634
|
var imageAspectRatio = isMobile ? mobileAspectRatio : desktopAspectRatio;
|
|
3122
635
|
var imagePadding = isMobile ? getPadding(mobileAspectRatio) : getPadding(desktopAspectRatio);
|
|
3123
|
-
var slug =
|
|
3124
|
-
var hyperLink =
|
|
636
|
+
var slug = lodash.get(story, ["hero-image-s3-key"]) || lodash.get(story, ["alternative", "home", "default", "hero-image", "hero-image-s3-key"]);
|
|
637
|
+
var hyperLink = lodash.get(story, ["hero-image-hyperlink"], "");
|
|
3125
638
|
|
|
3126
639
|
var fallbackImage = function fallbackImage() {
|
|
3127
640
|
if (!slug) {
|
|
3128
641
|
if (fallbackImageUrl && !isStoryPageImage) {
|
|
3129
|
-
return /*#__PURE__*/
|
|
642
|
+
return /*#__PURE__*/React__default["default"].createElement("figure", {
|
|
3130
643
|
style: {
|
|
3131
644
|
paddingTop: imagePadding + "%"
|
|
3132
645
|
},
|
|
3133
|
-
className: "arr--responsive-hero-image " +
|
|
3134
|
-
}, /*#__PURE__*/
|
|
646
|
+
className: "arr--responsive-hero-image " + _getClassName__default["default"]("image ".concat(getPlaceholderStyleName), _styleModuleImportMap$c)
|
|
647
|
+
}, /*#__PURE__*/React__default["default"].createElement("img", {
|
|
3135
648
|
className: "qt-image",
|
|
3136
649
|
"data-src": "".concat(fallbackImageUrl),
|
|
3137
650
|
alt: "image-fallback"
|
|
3138
651
|
}));
|
|
3139
652
|
}
|
|
3140
653
|
|
|
3141
|
-
return /*#__PURE__*/
|
|
654
|
+
return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, defaultFallback ? /*#__PURE__*/React__default["default"].createElement("div", {
|
|
3142
655
|
"data-test-id": "arr--fallback-hero-image",
|
|
3143
656
|
style: {
|
|
3144
657
|
paddingTop: imagePadding + "%"
|
|
3145
658
|
},
|
|
3146
|
-
className: "arr--fallback-hero-image " +
|
|
3147
|
-
}, /*#__PURE__*/
|
|
659
|
+
className: "arr--fallback-hero-image " + _getClassName__default["default"]("image ".concat(getPlaceholderStyleName), _styleModuleImportMap$c)
|
|
660
|
+
}, /*#__PURE__*/React__default["default"].createElement(StoryTemplateIcon, {
|
|
3148
661
|
storyTemplate: story["story-template"]
|
|
3149
|
-
}), /*#__PURE__*/
|
|
662
|
+
}), /*#__PURE__*/React__default["default"].createElement(FallbackImage, null)) : null);
|
|
3150
663
|
}
|
|
3151
664
|
|
|
3152
|
-
return /*#__PURE__*/
|
|
665
|
+
return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement("figure", {
|
|
3153
666
|
style: {
|
|
3154
667
|
paddingTop: imagePadding + "%"
|
|
3155
668
|
},
|
|
3156
|
-
className: "arr--responsive-hero-image " +
|
|
3157
|
-
}, /*#__PURE__*/
|
|
669
|
+
className: "arr--responsive-hero-image " + _getClassName__default["default"]("image ".concat(getPlaceholderStyleName), _styleModuleImportMap$c)
|
|
670
|
+
}, /*#__PURE__*/React__default["default"].createElement(StoryTemplateIcon, {
|
|
3158
671
|
storyTemplate: story["story-template"]
|
|
3159
|
-
}), /*#__PURE__*/
|
|
672
|
+
}), /*#__PURE__*/React__default["default"].createElement(components.ResponsiveHeroImage, {
|
|
3160
673
|
story: story,
|
|
3161
674
|
aspectRatio: imageAspectRatio,
|
|
3162
675
|
defaultWidth: defaultWidth,
|
|
@@ -3165,48 +678,48 @@ var HeroImage = function HeroImage(_ref) {
|
|
|
3165
678
|
auto: ["format", "compress"],
|
|
3166
679
|
fit: "max"
|
|
3167
680
|
}
|
|
3168
|
-
})), isStoryPageImage && hyperLink && /*#__PURE__*/
|
|
681
|
+
})), isStoryPageImage && hyperLink && /*#__PURE__*/React__default["default"].createElement(HyperLink, {
|
|
3169
682
|
hyperLink: hyperLink
|
|
3170
683
|
}));
|
|
3171
684
|
};
|
|
3172
685
|
|
|
3173
|
-
return story && (isStoryPageImage ? /*#__PURE__*/
|
|
686
|
+
return story && (isStoryPageImage ? /*#__PURE__*/React__default["default"].createElement("div", {
|
|
3174
687
|
"data-test-id": "arr--hero-image",
|
|
3175
|
-
className: "arr--hero-image " +
|
|
3176
|
-
}, fallbackImage()) : /*#__PURE__*/
|
|
688
|
+
className: "arr--hero-image " + _getClassName__default["default"]("".concat(heroImageClass, " ").concat(fullBleed, " ").concat(heroImageMobClasses), _styleModuleImportMap$c)
|
|
689
|
+
}, fallbackImage()) : /*#__PURE__*/React__default["default"].createElement(components.Link, {
|
|
3177
690
|
"data-test-id": "arr--hero-image",
|
|
3178
691
|
href: getStoryUrl(story, "/".concat(story.slug)),
|
|
3179
692
|
externalLink: isExternalStory(story),
|
|
3180
693
|
"aria-label": "fallback-hero-image",
|
|
3181
|
-
className: "arr--hero-image " +
|
|
694
|
+
className: "arr--hero-image " + _getClassName__default["default"]("".concat(heroImageClass, " ").concat(fullBleed, " ").concat(heroImageMobClasses), _styleModuleImportMap$c)
|
|
3182
695
|
}, fallbackImage()));
|
|
3183
696
|
};
|
|
3184
697
|
HeroImage.propTypes = {
|
|
3185
698
|
/** The Story Object from the API response */
|
|
3186
|
-
story:
|
|
699
|
+
story: PropTypes__default["default"].object.isRequired,
|
|
3187
700
|
|
|
3188
701
|
/** Removes the Hero Image padding for the image to bleed over the margin */
|
|
3189
|
-
FullBleed:
|
|
702
|
+
FullBleed: PropTypes__default["default"].bool,
|
|
3190
703
|
|
|
3191
704
|
/** The default width for the image, in case the browser does not support srcset */
|
|
3192
|
-
defaultWidth:
|
|
705
|
+
defaultWidth: PropTypes__default["default"].number,
|
|
3193
706
|
|
|
3194
707
|
/** The list of available widths */
|
|
3195
|
-
widths:
|
|
708
|
+
widths: PropTypes__default["default"].array,
|
|
3196
709
|
// fatch the correct hero image
|
|
3197
|
-
aspectRatio:
|
|
710
|
+
aspectRatio: PropTypes__default["default"].array,
|
|
3198
711
|
// Hints for the browser to choose the best size
|
|
3199
712
|
|
|
3200
713
|
/** This prop is responsible for adding padding-right of the image and remove padding bottom of the image */
|
|
3201
|
-
isHorizontal:
|
|
714
|
+
isHorizontal: PropTypes__default["default"].bool,
|
|
3202
715
|
|
|
3203
716
|
/** This prop is responsible for adding padding-bottom in desktop and padding-right in mobile */
|
|
3204
|
-
isHorizontalMobile:
|
|
717
|
+
isHorizontalMobile: PropTypes__default["default"].bool,
|
|
3205
718
|
// this prop is responsive for rendering fallback image on story page
|
|
3206
|
-
defaultFallback:
|
|
3207
|
-
isHorizontalWithImageLast:
|
|
3208
|
-
isStoryPageImage:
|
|
3209
|
-
config:
|
|
719
|
+
defaultFallback: PropTypes__default["default"].bool,
|
|
720
|
+
isHorizontalWithImageLast: PropTypes__default["default"].bool,
|
|
721
|
+
isStoryPageImage: PropTypes__default["default"].bool,
|
|
722
|
+
config: PropTypes__default["default"].object
|
|
3210
723
|
};
|
|
3211
724
|
HeroImage.defaultProps = {
|
|
3212
725
|
FullBleed: true,
|
|
@@ -3227,7 +740,7 @@ var CrownIcon = function CrownIcon(_ref) {
|
|
|
3227
740
|
_ref$color = _ref.color,
|
|
3228
741
|
color = _ref$color === void 0 ? "#D8D8D8" : _ref$color,
|
|
3229
742
|
positionTop = _ref.positionTop;
|
|
3230
|
-
return /*#__PURE__*/
|
|
743
|
+
return /*#__PURE__*/React__default["default"].createElement("svg", {
|
|
3231
744
|
xmlns: "http://www.w3.org/2000/svg",
|
|
3232
745
|
width: width,
|
|
3233
746
|
height: height,
|
|
@@ -3236,28 +749,28 @@ var CrownIcon = function CrownIcon(_ref) {
|
|
|
3236
749
|
position: "relative",
|
|
3237
750
|
top: positionTop
|
|
3238
751
|
}
|
|
3239
|
-
}, /*#__PURE__*/
|
|
752
|
+
}, /*#__PURE__*/React__default["default"].createElement("g", {
|
|
3240
753
|
fill: "none",
|
|
3241
754
|
fillRule: "evenodd",
|
|
3242
755
|
stroke: "none",
|
|
3243
756
|
strokeWidth: "1"
|
|
3244
|
-
}, /*#__PURE__*/
|
|
757
|
+
}, /*#__PURE__*/React__default["default"].createElement("g", null, /*#__PURE__*/React__default["default"].createElement("g", {
|
|
3245
758
|
transform: "translate(8 8)"
|
|
3246
|
-
}, /*#__PURE__*/
|
|
759
|
+
}, /*#__PURE__*/React__default["default"].createElement("path", {
|
|
3247
760
|
d: "M0 0H24V24H0z"
|
|
3248
|
-
}), /*#__PURE__*/
|
|
761
|
+
}), /*#__PURE__*/React__default["default"].createElement("g", {
|
|
3249
762
|
fill: color,
|
|
3250
763
|
fillRule: "nonzero",
|
|
3251
764
|
transform: "translate(0 2)"
|
|
3252
|
-
}, /*#__PURE__*/
|
|
765
|
+
}, /*#__PURE__*/React__default["default"].createElement("path", {
|
|
3253
766
|
d: "M21.043 19.553c0-.743-.601-1.344-1.344-1.344h-15.4a1.343 1.343 0 100 2.688h15.4c.743 0 1.344-.603 1.344-1.344zM1.598 8.673c.022 0 .042 0 .064-.003l2.131 7.713h16.411l2.132-7.713c.022 0 .041.003.063.003a1.599 1.599 0 10-1.52-1.108L17.025 9.82 12.882 2.95a1.599 1.599 0 10-1.765 0L6.976 9.82 3.121 7.565a1.599 1.599 0 10-1.523 1.107z"
|
|
3254
767
|
}))))));
|
|
3255
768
|
};
|
|
3256
769
|
CrownIcon.propTypes = {
|
|
3257
|
-
height:
|
|
3258
|
-
width:
|
|
3259
|
-
color:
|
|
3260
|
-
positionTop:
|
|
770
|
+
height: PropTypes__default["default"].string,
|
|
771
|
+
width: PropTypes__default["default"].string,
|
|
772
|
+
color: PropTypes__default["default"].string,
|
|
773
|
+
positionTop: PropTypes__default["default"].string
|
|
3261
774
|
};
|
|
3262
775
|
|
|
3263
776
|
var KeyIcon = function KeyIcon(_ref) {
|
|
@@ -3266,7 +779,7 @@ var KeyIcon = function KeyIcon(_ref) {
|
|
|
3266
779
|
_ref$color = _ref.color,
|
|
3267
780
|
color = _ref$color === void 0 ? "#D5D5D5" : _ref$color,
|
|
3268
781
|
positionTop = _ref.positionTop;
|
|
3269
|
-
return /*#__PURE__*/
|
|
782
|
+
return /*#__PURE__*/React__default["default"].createElement("svg", {
|
|
3270
783
|
xmlns: "http://www.w3.org/2000/svg",
|
|
3271
784
|
width: width,
|
|
3272
785
|
height: height,
|
|
@@ -3275,16 +788,16 @@ var KeyIcon = function KeyIcon(_ref) {
|
|
|
3275
788
|
position: "relative",
|
|
3276
789
|
top: positionTop
|
|
3277
790
|
}
|
|
3278
|
-
}, /*#__PURE__*/
|
|
791
|
+
}, /*#__PURE__*/React__default["default"].createElement("g", {
|
|
3279
792
|
fill: "none",
|
|
3280
793
|
fillRule: "evenodd",
|
|
3281
794
|
stroke: "none",
|
|
3282
795
|
strokeWidth: "1"
|
|
3283
|
-
}, /*#__PURE__*/
|
|
796
|
+
}, /*#__PURE__*/React__default["default"].createElement("g", null, /*#__PURE__*/React__default["default"].createElement("g", {
|
|
3284
797
|
transform: "translate(8 8)"
|
|
3285
|
-
}, /*#__PURE__*/
|
|
798
|
+
}, /*#__PURE__*/React__default["default"].createElement("path", {
|
|
3286
799
|
d: "M0 0H24V24H0z"
|
|
3287
|
-
}), /*#__PURE__*/
|
|
800
|
+
}), /*#__PURE__*/React__default["default"].createElement("path", {
|
|
3288
801
|
fill: color,
|
|
3289
802
|
fillRule: "nonzero",
|
|
3290
803
|
d: "M12.71 4.364A6.54 6.54 0 000 6.545a6.54 6.54 0 0012.71 2.182h4.745v4.364h4.363V8.727H24V4.364H12.71zM6.544 8.727a2.181 2.181 0 110-4.362 2.181 2.181 0 010 4.362z",
|
|
@@ -3292,10 +805,10 @@ var KeyIcon = function KeyIcon(_ref) {
|
|
|
3292
805
|
})))));
|
|
3293
806
|
};
|
|
3294
807
|
KeyIcon.propTypes = {
|
|
3295
|
-
height:
|
|
3296
|
-
width:
|
|
3297
|
-
color:
|
|
3298
|
-
positionTop:
|
|
808
|
+
height: PropTypes__default["default"].string,
|
|
809
|
+
width: PropTypes__default["default"].string,
|
|
810
|
+
color: PropTypes__default["default"].string,
|
|
811
|
+
positionTop: PropTypes__default["default"].string
|
|
3299
812
|
};
|
|
3300
813
|
|
|
3301
814
|
var LockIcon = function LockIcon(_ref) {
|
|
@@ -3304,7 +817,7 @@ var LockIcon = function LockIcon(_ref) {
|
|
|
3304
817
|
_ref$color = _ref.color,
|
|
3305
818
|
color = _ref$color === void 0 ? "#D5D5D5" : _ref$color,
|
|
3306
819
|
positionTop = _ref.positionTop;
|
|
3307
|
-
return /*#__PURE__*/
|
|
820
|
+
return /*#__PURE__*/React__default["default"].createElement("svg", {
|
|
3308
821
|
xmlns: "http://www.w3.org/2000/svg",
|
|
3309
822
|
width: width,
|
|
3310
823
|
height: height,
|
|
@@ -3313,28 +826,28 @@ var LockIcon = function LockIcon(_ref) {
|
|
|
3313
826
|
position: "relative",
|
|
3314
827
|
top: positionTop
|
|
3315
828
|
}
|
|
3316
|
-
}, /*#__PURE__*/
|
|
829
|
+
}, /*#__PURE__*/React__default["default"].createElement("g", {
|
|
3317
830
|
fill: "none",
|
|
3318
831
|
fillRule: "evenodd",
|
|
3319
832
|
stroke: "none",
|
|
3320
833
|
strokeWidth: "1"
|
|
3321
|
-
}, /*#__PURE__*/
|
|
834
|
+
}, /*#__PURE__*/React__default["default"].createElement("g", null, /*#__PURE__*/React__default["default"].createElement("g", {
|
|
3322
835
|
transform: "translate(8 8)"
|
|
3323
|
-
}, /*#__PURE__*/
|
|
836
|
+
}, /*#__PURE__*/React__default["default"].createElement("path", {
|
|
3324
837
|
d: "M0 0H24V24H0z"
|
|
3325
|
-
}), /*#__PURE__*/
|
|
838
|
+
}), /*#__PURE__*/React__default["default"].createElement("g", {
|
|
3326
839
|
fill: color,
|
|
3327
840
|
fillRule: "nonzero",
|
|
3328
841
|
transform: "translate(3)"
|
|
3329
|
-
}, /*#__PURE__*/
|
|
842
|
+
}, /*#__PURE__*/React__default["default"].createElement("path", {
|
|
3330
843
|
d: "M15.692 9h-.747V6c0-3.31-2.681-6-5.978-6C5.67 0 2.989 2.69 2.989 6v3h-.747A2.249 2.249 0 000 11.25v10.5A2.249 2.249 0 002.242 24h13.45a2.249 2.249 0 002.242-2.25v-10.5A2.249 2.249 0 0015.692 9zM4.982 6c0-2.206 1.787-4 3.985-4s3.985 1.794 3.985 4v3h-7.97V6z"
|
|
3331
844
|
}))))));
|
|
3332
845
|
};
|
|
3333
846
|
LockIcon.propTypes = {
|
|
3334
|
-
height:
|
|
3335
|
-
width:
|
|
3336
|
-
color:
|
|
3337
|
-
positionTop:
|
|
847
|
+
height: PropTypes__default["default"].string,
|
|
848
|
+
width: PropTypes__default["default"].string,
|
|
849
|
+
color: PropTypes__default["default"].string,
|
|
850
|
+
positionTop: PropTypes__default["default"].string
|
|
3338
851
|
};
|
|
3339
852
|
|
|
3340
853
|
var StarIcon = function StarIcon(_ref) {
|
|
@@ -3344,7 +857,7 @@ var StarIcon = function StarIcon(_ref) {
|
|
|
3344
857
|
color = _ref$color === void 0 ? "#D5D5D5" : _ref$color,
|
|
3345
858
|
_ref$positionTop = _ref.positionTop,
|
|
3346
859
|
positionTop = _ref$positionTop === void 0 ? "" : _ref$positionTop;
|
|
3347
|
-
return /*#__PURE__*/
|
|
860
|
+
return /*#__PURE__*/React__default["default"].createElement("svg", {
|
|
3348
861
|
xmlns: "http://www.w3.org/2000/svg",
|
|
3349
862
|
width: width,
|
|
3350
863
|
height: height,
|
|
@@ -3353,21 +866,21 @@ var StarIcon = function StarIcon(_ref) {
|
|
|
3353
866
|
position: "relative",
|
|
3354
867
|
top: positionTop
|
|
3355
868
|
}
|
|
3356
|
-
}, /*#__PURE__*/
|
|
869
|
+
}, /*#__PURE__*/React__default["default"].createElement("g", {
|
|
3357
870
|
fill: "none",
|
|
3358
871
|
fillRule: "evenodd",
|
|
3359
872
|
stroke: "none",
|
|
3360
873
|
strokeWidth: "1"
|
|
3361
|
-
}, /*#__PURE__*/
|
|
874
|
+
}, /*#__PURE__*/React__default["default"].createElement("g", null, /*#__PURE__*/React__default["default"].createElement("path", {
|
|
3362
875
|
fill: color,
|
|
3363
876
|
d: "M20 26L12.946577 29.7082039 14.2936609 21.854102 8.5873218 16.2917961 16.4732885 15.145898 20 8 23.5267115 15.145898 31.4126782 16.2917961 25.7063391 21.854102 27.053423 29.7082039z"
|
|
3364
877
|
}))));
|
|
3365
878
|
};
|
|
3366
879
|
StarIcon.propTypes = {
|
|
3367
|
-
height:
|
|
3368
|
-
width:
|
|
3369
|
-
color:
|
|
3370
|
-
positionTop:
|
|
880
|
+
height: PropTypes__default["default"].string,
|
|
881
|
+
width: PropTypes__default["default"].string,
|
|
882
|
+
color: PropTypes__default["default"].string,
|
|
883
|
+
positionTop: PropTypes__default["default"].string
|
|
3371
884
|
};
|
|
3372
885
|
|
|
3373
886
|
var PremiumStoryIcon = function PremiumStoryIcon(_ref) {
|
|
@@ -3379,7 +892,7 @@ var PremiumStoryIcon = function PremiumStoryIcon(_ref) {
|
|
|
3379
892
|
|
|
3380
893
|
switch (iconType) {
|
|
3381
894
|
case "crown":
|
|
3382
|
-
return /*#__PURE__*/
|
|
895
|
+
return /*#__PURE__*/React__default["default"].createElement(CrownIcon, {
|
|
3383
896
|
width: width,
|
|
3384
897
|
height: height,
|
|
3385
898
|
color: color,
|
|
@@ -3387,7 +900,7 @@ var PremiumStoryIcon = function PremiumStoryIcon(_ref) {
|
|
|
3387
900
|
});
|
|
3388
901
|
|
|
3389
902
|
case "lock":
|
|
3390
|
-
return /*#__PURE__*/
|
|
903
|
+
return /*#__PURE__*/React__default["default"].createElement(LockIcon, {
|
|
3391
904
|
width: width,
|
|
3392
905
|
height: height,
|
|
3393
906
|
color: color,
|
|
@@ -3395,7 +908,7 @@ var PremiumStoryIcon = function PremiumStoryIcon(_ref) {
|
|
|
3395
908
|
});
|
|
3396
909
|
|
|
3397
910
|
case "key":
|
|
3398
|
-
return /*#__PURE__*/
|
|
911
|
+
return /*#__PURE__*/React__default["default"].createElement(KeyIcon, {
|
|
3399
912
|
width: width,
|
|
3400
913
|
height: height,
|
|
3401
914
|
color: color,
|
|
@@ -3403,7 +916,7 @@ var PremiumStoryIcon = function PremiumStoryIcon(_ref) {
|
|
|
3403
916
|
});
|
|
3404
917
|
|
|
3405
918
|
default:
|
|
3406
|
-
return /*#__PURE__*/
|
|
919
|
+
return /*#__PURE__*/React__default["default"].createElement(StarIcon, {
|
|
3407
920
|
width: width,
|
|
3408
921
|
height: height,
|
|
3409
922
|
color: color,
|
|
@@ -3412,21 +925,21 @@ var PremiumStoryIcon = function PremiumStoryIcon(_ref) {
|
|
|
3412
925
|
}
|
|
3413
926
|
};
|
|
3414
927
|
PremiumStoryIcon.propTypes = {
|
|
3415
|
-
width:
|
|
3416
|
-
height:
|
|
3417
|
-
color:
|
|
3418
|
-
iconType:
|
|
3419
|
-
positionTop:
|
|
928
|
+
width: PropTypes__default["default"].string,
|
|
929
|
+
height: PropTypes__default["default"].string,
|
|
930
|
+
color: PropTypes__default["default"].string,
|
|
931
|
+
iconType: PropTypes__default["default"].string,
|
|
932
|
+
positionTop: PropTypes__default["default"].string
|
|
3420
933
|
};
|
|
3421
934
|
|
|
3422
935
|
function LiveIcon() {
|
|
3423
|
-
return /*#__PURE__*/
|
|
936
|
+
return /*#__PURE__*/React__default["default"].createElement("svg", {
|
|
3424
937
|
className: "live-icon",
|
|
3425
938
|
xmlns: "http://www.w3.org/2000/svg",
|
|
3426
939
|
width: "25",
|
|
3427
940
|
height: "24",
|
|
3428
941
|
viewBox: "0 0 25 24"
|
|
3429
|
-
}, /*#__PURE__*/
|
|
942
|
+
}, /*#__PURE__*/React__default["default"].createElement("path", {
|
|
3430
943
|
fill: "#ff5858",
|
|
3431
944
|
d: "M12 18a6 6 0 110-12 6 6 0 010 12zm0 2.5a8.5 8.5 0 110-17 8.5 8.5 0 010 17zm0-1a7.5 7.5 0 100-15 7.5 7.5 0 000 15z"
|
|
3432
945
|
}));
|
|
@@ -3455,8 +968,8 @@ var Headline = function Headline(_ref) {
|
|
|
3455
968
|
enablePremiumStoryIcon = _premiumStoryIconConf3 === void 0 ? false : _premiumStoryIconConf3,
|
|
3456
969
|
_premiumStoryIconConf4 = premiumStoryIconConfig.showLiveIcon,
|
|
3457
970
|
showLiveIcon = _premiumStoryIconConf4 === void 0 ? false : _premiumStoryIconConf4;
|
|
3458
|
-
var alternateHeadline =
|
|
3459
|
-
var premiumStory = enablePremiumStoryIcon &&
|
|
971
|
+
var alternateHeadline = lodash.get(story, ["alternative", "home", "default", "headline"]);
|
|
972
|
+
var premiumStory = enablePremiumStoryIcon && lodash.get(story, ["access"]) === "subscription";
|
|
3460
973
|
var headline = alternateHeadline || story.headline;
|
|
3461
974
|
var HeaderTag = "h" + headerLevel;
|
|
3462
975
|
|
|
@@ -3482,38 +995,38 @@ var Headline = function Headline(_ref) {
|
|
|
3482
995
|
var textColor = getTextColor(configData.theme);
|
|
3483
996
|
var wrapperClass = premiumStory ? "wrapper" : "";
|
|
3484
997
|
var iconSize = "24px";
|
|
3485
|
-
var enableLiveIcon = showLiveIcon && story["story-template"] === "live-blog" && !
|
|
3486
|
-
return /*#__PURE__*/
|
|
998
|
+
var enableLiveIcon = showLiveIcon && story["story-template"] === "live-blog" && !lodash.get(story, ["metadata", "is-closed"], false);
|
|
999
|
+
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
3487
1000
|
"data-test-id": "headline",
|
|
3488
|
-
className: "arrow-component arr--headline " +
|
|
3489
|
-
}, premiumStory && /*#__PURE__*/
|
|
1001
|
+
className: "arrow-component arr--headline " + _getClassName__default["default"](wrapperClass, _styleModuleImportMap$b)
|
|
1002
|
+
}, premiumStory && /*#__PURE__*/React__default["default"].createElement(PremiumStoryIcon, {
|
|
3490
1003
|
width: iconSize,
|
|
3491
1004
|
height: iconSize,
|
|
3492
1005
|
color: iconColor,
|
|
3493
1006
|
iconType: iconStyle,
|
|
3494
1007
|
positionTop: positionHeadline()
|
|
3495
|
-
}), isLink ? /*#__PURE__*/
|
|
1008
|
+
}), isLink ? /*#__PURE__*/React__default["default"].createElement(components.Link, {
|
|
3496
1009
|
href: getStoryUrl(story, "/".concat(story.slug)),
|
|
3497
1010
|
externalLink: isExternalStory(story),
|
|
3498
1011
|
"aria-label": "headline"
|
|
3499
|
-
}, /*#__PURE__*/
|
|
3500
|
-
className:
|
|
3501
|
-
}, enableLiveIcon && /*#__PURE__*/
|
|
3502
|
-
className:
|
|
3503
|
-
}, enableLiveIcon && /*#__PURE__*/
|
|
1012
|
+
}, /*#__PURE__*/React__default["default"].createElement(HeaderTag, {
|
|
1013
|
+
className: _getClassName__default["default"]("headline ".concat(textColor), _styleModuleImportMap$b)
|
|
1014
|
+
}, enableLiveIcon && /*#__PURE__*/React__default["default"].createElement(LiveIcon, null), headline)) : /*#__PURE__*/React__default["default"].createElement(HeaderTag, {
|
|
1015
|
+
className: _getClassName__default["default"]("headline ".concat(textColor), _styleModuleImportMap$b)
|
|
1016
|
+
}, enableLiveIcon && /*#__PURE__*/React__default["default"].createElement(LiveIcon, null), headline));
|
|
3504
1017
|
};
|
|
3505
1018
|
Headline.propTypes = {
|
|
3506
1019
|
/** The Story Object from the API response */
|
|
3507
|
-
story:
|
|
1020
|
+
story: PropTypes__default["default"].object.isRequired,
|
|
3508
1021
|
|
|
3509
1022
|
/** Header tags ranging h1-h6, where h[headerLevel] */
|
|
3510
|
-
headerLevel:
|
|
3511
|
-
premiumStoryIconConfig:
|
|
3512
|
-
iconColor:
|
|
3513
|
-
iconType:
|
|
3514
|
-
enablePremiumStoryIcon:
|
|
1023
|
+
headerLevel: PropTypes__default["default"].string,
|
|
1024
|
+
premiumStoryIconConfig: PropTypes__default["default"].shape({
|
|
1025
|
+
iconColor: PropTypes__default["default"].string,
|
|
1026
|
+
iconType: PropTypes__default["default"].string,
|
|
1027
|
+
enablePremiumStoryIcon: PropTypes__default["default"].bool
|
|
3515
1028
|
}),
|
|
3516
|
-
isLink:
|
|
1029
|
+
isLink: PropTypes__default["default"].bool
|
|
3517
1030
|
};
|
|
3518
1031
|
Headline.defaultProps = {
|
|
3519
1032
|
headerLevel: "6",
|
|
@@ -3537,28 +1050,28 @@ var Subheadline = function Subheadline(_ref) {
|
|
|
3537
1050
|
forceShowAtom = _ref.forceShowAtom,
|
|
3538
1051
|
showFullContent = _ref.showFullContent;
|
|
3539
1052
|
var config = useStateValue() || {};
|
|
3540
|
-
var subheadline = forceShowAtom ||
|
|
1053
|
+
var subheadline = forceShowAtom || lodash.get(config, ["showSubheadline"], true);
|
|
3541
1054
|
if (!subheadline) return null;
|
|
3542
1055
|
var textColor = getTextColor(config.theme);
|
|
3543
|
-
return /*#__PURE__*/
|
|
1056
|
+
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
3544
1057
|
style: {
|
|
3545
1058
|
WebkitLineClamp: lineClamp
|
|
3546
1059
|
},
|
|
3547
1060
|
"data-test-id": "subheadline",
|
|
3548
|
-
className: ("p-alt arr--sub-headline arrow-component ".concat(clazzName) ? "p-alt arr--sub-headline arrow-component ".concat(clazzName) + " " : "") +
|
|
1061
|
+
className: ("p-alt arr--sub-headline arrow-component ".concat(clazzName) ? "p-alt arr--sub-headline arrow-component ".concat(clazzName) + " " : "") + _getClassName__default["default"]("subheadline ".concat(textColor), _styleModuleImportMap$a)
|
|
3549
1062
|
}, showFullContent || typeof lineClamp === "number" ? story.subheadline : truncate(story.subheadline, truncateChars, true));
|
|
3550
1063
|
};
|
|
3551
1064
|
Subheadline.propTypes = {
|
|
3552
1065
|
/** The Story Object from the API response */
|
|
3553
|
-
story:
|
|
1066
|
+
story: PropTypes__default["default"].object.isRequired,
|
|
3554
1067
|
// Restricts the number of lines for subheadline.
|
|
3555
|
-
lineClamp:
|
|
1068
|
+
lineClamp: PropTypes__default["default"].number,
|
|
3556
1069
|
|
|
3557
1070
|
/** Number of characters to truncate the subheadline */
|
|
3558
|
-
truncateChars:
|
|
3559
|
-
clazzName:
|
|
3560
|
-
forceShowAtom:
|
|
3561
|
-
showFullContent:
|
|
1071
|
+
truncateChars: PropTypes__default["default"].number,
|
|
1072
|
+
clazzName: PropTypes__default["default"].string,
|
|
1073
|
+
forceShowAtom: PropTypes__default["default"].bool,
|
|
1074
|
+
showFullContent: PropTypes__default["default"].bool
|
|
3562
1075
|
};
|
|
3563
1076
|
Subheadline.defaultProps = {
|
|
3564
1077
|
forceShowAtom: false,
|
|
@@ -3580,22 +1093,22 @@ var TimeStamp = function TimeStamp(_ref) {
|
|
|
3580
1093
|
_ref$config = _ref.config,
|
|
3581
1094
|
config = _ref$config === void 0 ? {} : _ref$config;
|
|
3582
1095
|
var configState = useStateValue() || {};
|
|
3583
|
-
var isTime =
|
|
1096
|
+
var isTime = lodash.get(config, ["showTime"], lodash.get(configState, ["showTime"], true));
|
|
3584
1097
|
var time = story["last-published-at"] || story["first-published-at"];
|
|
3585
1098
|
var isBottomClasses = isBottom ? "bottom-fix" : "";
|
|
3586
1099
|
var textColor = getTextColor(configState.theme);
|
|
3587
|
-
return /*#__PURE__*/
|
|
1100
|
+
return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, isTime && /*#__PURE__*/React__default["default"].createElement("div", {
|
|
3588
1101
|
"data-test-id": "publish-time",
|
|
3589
|
-
className: "time arr--publish-time " +
|
|
3590
|
-
}, /*#__PURE__*/
|
|
1102
|
+
className: "time arr--publish-time " + _getClassName__default["default"]("time ".concat(textColor, " ").concat(isBottomClasses), _styleModuleImportMap$9)
|
|
1103
|
+
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
3591
1104
|
className: "timestamp-m_time-wrapper__3O2lM"
|
|
3592
1105
|
}, getTimeStamp(time, formatter, config))));
|
|
3593
1106
|
};
|
|
3594
1107
|
TimeStamp.propTypes = {
|
|
3595
1108
|
/** The Story Object from the API response */
|
|
3596
|
-
story:
|
|
3597
|
-
isBottom:
|
|
3598
|
-
config:
|
|
1109
|
+
story: PropTypes__default["default"].object,
|
|
1110
|
+
isBottom: PropTypes__default["default"].bool,
|
|
1111
|
+
config: PropTypes__default["default"].object
|
|
3599
1112
|
};
|
|
3600
1113
|
|
|
3601
1114
|
var _styleModuleImportMap$8 = {
|
|
@@ -3621,9 +1134,9 @@ var AuthorBase = function AuthorBase(_ref) {
|
|
|
3621
1134
|
_ref$config = _ref.config,
|
|
3622
1135
|
config = _ref$config === void 0 ? {} : _ref$config;
|
|
3623
1136
|
var configData = useStateValue() || {};
|
|
3624
|
-
var isAuthor =
|
|
1137
|
+
var isAuthor = lodash.get(configData, ["showAuthor"], true);
|
|
3625
1138
|
|
|
3626
|
-
var _get =
|
|
1139
|
+
var _get = lodash.get(story, ["authors", "0"], ""),
|
|
3627
1140
|
avatarUrl = _get["avatar-url"],
|
|
3628
1141
|
avatarS3Key = _get["avatar-s3-key"],
|
|
3629
1142
|
authorName = _get.name,
|
|
@@ -3631,17 +1144,17 @@ var AuthorBase = function AuthorBase(_ref) {
|
|
|
3631
1144
|
|
|
3632
1145
|
var isBottomClasses = isBottom ? "bottom-fix" : "";
|
|
3633
1146
|
var textColor = getTextColor(configData.theme);
|
|
3634
|
-
var mountAt =
|
|
1147
|
+
var mountAt = lodash.get(config, ["mountAt"], "");
|
|
3635
1148
|
|
|
3636
1149
|
var authorImage = function authorImage(dir) {
|
|
3637
1150
|
if (!avatarUrl && !avatarS3Key) {
|
|
3638
1151
|
return null;
|
|
3639
1152
|
}
|
|
3640
1153
|
|
|
3641
|
-
return /*#__PURE__*/
|
|
1154
|
+
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
3642
1155
|
"data-test-id": "author-image",
|
|
3643
|
-
className:
|
|
3644
|
-
}, /*#__PURE__*/
|
|
1156
|
+
className: _getClassName__default["default"]("author-image ".concat(dir, "-image"), _styleModuleImportMap$8)
|
|
1157
|
+
}, /*#__PURE__*/React__default["default"].createElement("figure", null, avatarS3Key ? /*#__PURE__*/React__default["default"].createElement(components.ResponsiveImage, {
|
|
3645
1158
|
slug: avatarS3Key,
|
|
3646
1159
|
"aspect-ratio": [1, 1],
|
|
3647
1160
|
defaultWidth: 400,
|
|
@@ -3649,49 +1162,49 @@ var AuthorBase = function AuthorBase(_ref) {
|
|
|
3649
1162
|
auto: ["format", "compress"]
|
|
3650
1163
|
},
|
|
3651
1164
|
alt: authorName
|
|
3652
|
-
}) : /*#__PURE__*/
|
|
1165
|
+
}) : /*#__PURE__*/React__default["default"].createElement("img", {
|
|
3653
1166
|
src: avatarUrl
|
|
3654
1167
|
})));
|
|
3655
1168
|
};
|
|
3656
1169
|
|
|
3657
1170
|
var isPrefix = function isPrefix(dir) {
|
|
3658
1171
|
if (prefix) {
|
|
3659
|
-
return /*#__PURE__*/
|
|
3660
|
-
className: "arr-author-prefix " +
|
|
1172
|
+
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
1173
|
+
className: "arr-author-prefix " + _getClassName__default["default"]("prefix ".concat(textColor), _styleModuleImportMap$8)
|
|
3661
1174
|
}, prefix);
|
|
3662
1175
|
}
|
|
3663
1176
|
|
|
3664
1177
|
return !hideAuthorImage && authorImage(dir);
|
|
3665
1178
|
};
|
|
3666
1179
|
|
|
3667
|
-
return /*#__PURE__*/
|
|
1180
|
+
return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, isAuthor && /*#__PURE__*/React__default["default"].createElement(components.Link, {
|
|
3668
1181
|
href: "".concat(mountAt, "/author/") + slug,
|
|
3669
1182
|
"aria-label": "author-name",
|
|
3670
|
-
className: "author-name arr-author-name arrow-component " +
|
|
3671
|
-
}, isPrefix("ltr"), /*#__PURE__*/
|
|
1183
|
+
className: "author-name arr-author-name arrow-component " + _getClassName__default["default"]("author ".concat(isBottomClasses), _styleModuleImportMap$8)
|
|
1184
|
+
}, isPrefix("ltr"), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
3672
1185
|
"data-test-id": "author-name",
|
|
3673
|
-
className: "author-name " +
|
|
1186
|
+
className: "author-name " + _getClassName__default["default"]("author-name ".concat(textColor), _styleModuleImportMap$8)
|
|
3674
1187
|
}, authorName || story["author-name"]), !prefix && isPrefix("rtl")));
|
|
3675
1188
|
};
|
|
3676
1189
|
|
|
3677
1190
|
function mapStateToProps(state) {
|
|
3678
1191
|
return {
|
|
3679
|
-
config:
|
|
1192
|
+
config: lodash.get(state, ["qt", "config"], {})
|
|
3680
1193
|
};
|
|
3681
1194
|
}
|
|
3682
1195
|
|
|
3683
|
-
var Author = connect(mapStateToProps)(AuthorBase);
|
|
1196
|
+
var Author = reactRedux.connect(mapStateToProps)(AuthorBase);
|
|
3684
1197
|
AuthorBase.propTypes = {
|
|
3685
1198
|
/** The Story Object from the API response */
|
|
3686
|
-
story:
|
|
1199
|
+
story: PropTypes__default["default"].object.isRequired,
|
|
3687
1200
|
|
|
3688
1201
|
/** Hide Author Avatar Image */
|
|
3689
|
-
hideAuthorImage:
|
|
1202
|
+
hideAuthorImage: PropTypes__default["default"].bool,
|
|
3690
1203
|
// fix Author bottom of the storyCard
|
|
3691
|
-
isBottom:
|
|
1204
|
+
isBottom: PropTypes__default["default"].bool,
|
|
3692
1205
|
// fix prefix before the author name
|
|
3693
|
-
prefix:
|
|
3694
|
-
config:
|
|
1206
|
+
prefix: PropTypes__default["default"].string,
|
|
1207
|
+
config: PropTypes__default["default"].object
|
|
3695
1208
|
};
|
|
3696
1209
|
AuthorBase.defaultProps = {
|
|
3697
1210
|
hideAuthorImage: false,
|
|
@@ -3712,14 +1225,14 @@ var Dot = function Dot(_ref) {
|
|
|
3712
1225
|
height = _ref$height === void 0 ? "3px" : _ref$height,
|
|
3713
1226
|
_ref$color = _ref.color,
|
|
3714
1227
|
color = _ref$color === void 0 ? "light" : _ref$color;
|
|
3715
|
-
return /*#__PURE__*/
|
|
3716
|
-
className:
|
|
3717
|
-
}, /*#__PURE__*/
|
|
1228
|
+
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
1229
|
+
className: _getClassName__default["default"](color, _styleModuleImportMap$7)
|
|
1230
|
+
}, /*#__PURE__*/React__default["default"].createElement("svg", {
|
|
3718
1231
|
xmlns: "http://www.w3.org/2000/svg",
|
|
3719
1232
|
width: width,
|
|
3720
1233
|
height: height,
|
|
3721
1234
|
viewBox: "0 0 3 3"
|
|
3722
|
-
}, /*#__PURE__*/
|
|
1235
|
+
}, /*#__PURE__*/React__default["default"].createElement("circle", {
|
|
3723
1236
|
cx: "87",
|
|
3724
1237
|
cy: "9",
|
|
3725
1238
|
r: "1",
|
|
@@ -3730,9 +1243,9 @@ var Dot = function Dot(_ref) {
|
|
|
3730
1243
|
};
|
|
3731
1244
|
Dot.propTypes = {
|
|
3732
1245
|
/** height , width and color of the dot icon */
|
|
3733
|
-
color:
|
|
3734
|
-
width:
|
|
3735
|
-
height:
|
|
1246
|
+
color: PropTypes__default["default"].string,
|
|
1247
|
+
width: PropTypes__default["default"].string,
|
|
1248
|
+
height: PropTypes__default["default"].string
|
|
3736
1249
|
};
|
|
3737
1250
|
|
|
3738
1251
|
var _styleModuleImportMap$6 = {
|
|
@@ -3748,22 +1261,22 @@ var Divider = function Divider(_ref) {
|
|
|
3748
1261
|
height = _ref$height === void 0 ? "10" : _ref$height,
|
|
3749
1262
|
_ref$color = _ref.color,
|
|
3750
1263
|
color = _ref$color === void 0 ? "light" : _ref$color;
|
|
3751
|
-
return /*#__PURE__*/
|
|
3752
|
-
className:
|
|
3753
|
-
}, /*#__PURE__*/
|
|
1264
|
+
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
1265
|
+
className: _getClassName__default["default"](color, _styleModuleImportMap$6)
|
|
1266
|
+
}, /*#__PURE__*/React__default["default"].createElement("svg", {
|
|
3754
1267
|
xmlns: "http://www.w3.org/2000/svg",
|
|
3755
1268
|
width: width,
|
|
3756
1269
|
height: height
|
|
3757
|
-
}, /*#__PURE__*/
|
|
1270
|
+
}, /*#__PURE__*/React__default["default"].createElement("path", {
|
|
3758
1271
|
fill: "inherit",
|
|
3759
1272
|
d: "M0 0h1v10H0z"
|
|
3760
1273
|
})));
|
|
3761
1274
|
};
|
|
3762
1275
|
Divider.propTypes = {
|
|
3763
1276
|
/** height , width and color of the dot icon */
|
|
3764
|
-
color:
|
|
3765
|
-
width:
|
|
3766
|
-
height:
|
|
1277
|
+
color: PropTypes__default["default"].string,
|
|
1278
|
+
width: PropTypes__default["default"].string,
|
|
1279
|
+
height: PropTypes__default["default"].string
|
|
3767
1280
|
};
|
|
3768
1281
|
|
|
3769
1282
|
var _styleModuleImportMap$5 = {
|
|
@@ -3781,28 +1294,28 @@ var ReadTime = function ReadTime(_ref) {
|
|
|
3781
1294
|
_ref$isLightTheme = _ref.isLightTheme,
|
|
3782
1295
|
isLightTheme = _ref$isLightTheme === void 0 ? false : _ref$isLightTheme;
|
|
3783
1296
|
var config = useStateValue() || {};
|
|
3784
|
-
var showReadTime =
|
|
3785
|
-
var readTime =
|
|
1297
|
+
var showReadTime = lodash.get(config, ["showReadTime"]) || lodash.get(opts, ["showReadTime"], true);
|
|
1298
|
+
var readTime = lodash.get(story, ["read-time"], 0);
|
|
3786
1299
|
var textColor = isLightTheme ? "light" : getTextColor(config.theme);
|
|
3787
1300
|
if (!showReadTime || !readTime) return null;
|
|
3788
|
-
var timeToRead =
|
|
3789
|
-
return /*#__PURE__*/
|
|
1301
|
+
var timeToRead = lodash.get(opts, ["localizedTimeToRead"]) || "min read";
|
|
1302
|
+
return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
3790
1303
|
"data-test-id": "read-time",
|
|
3791
|
-
className: "arrow-component arr--read-time " +
|
|
3792
|
-
}, /*#__PURE__*/
|
|
1304
|
+
className: "arrow-component arr--read-time " + _getClassName__default["default"]("read-time-wrapper ".concat(textColor), _styleModuleImportMap$5)
|
|
1305
|
+
}, /*#__PURE__*/React__default["default"].createElement("span", {
|
|
3793
1306
|
className: "read-time-indicator read-time-m_dot-indicator__3Sqh2"
|
|
3794
|
-
}, /*#__PURE__*/
|
|
1307
|
+
}, /*#__PURE__*/React__default["default"].createElement(Dot, {
|
|
3795
1308
|
color: textColor
|
|
3796
|
-
})), /*#__PURE__*/
|
|
1309
|
+
})), /*#__PURE__*/React__default["default"].createElement("span", null, readTime, " ", timeToRead)));
|
|
3797
1310
|
};
|
|
3798
1311
|
ReadTime.propTypes = {
|
|
3799
|
-
story:
|
|
3800
|
-
"read-time":
|
|
1312
|
+
story: PropTypes__default["default"].shape({
|
|
1313
|
+
"read-time": PropTypes__default["default"].number
|
|
3801
1314
|
}),
|
|
3802
|
-
opts:
|
|
3803
|
-
showReadTime:
|
|
1315
|
+
opts: PropTypes__default["default"].shape({
|
|
1316
|
+
showReadTime: PropTypes__default["default"].bool
|
|
3804
1317
|
}),
|
|
3805
|
-
isLightTheme:
|
|
1318
|
+
isLightTheme: PropTypes__default["default"].bool
|
|
3806
1319
|
};
|
|
3807
1320
|
|
|
3808
1321
|
var _styleModuleImportMap$4 = {
|
|
@@ -3824,42 +1337,42 @@ var AuthorWithTime = function AuthorWithTime(_ref) {
|
|
|
3824
1337
|
config = _ref$config === void 0 ? {} : _ref$config,
|
|
3825
1338
|
isLightTheme = _ref.isLightTheme;
|
|
3826
1339
|
var configState = useStateValue() || {};
|
|
3827
|
-
var isAuthor =
|
|
3828
|
-
var isTime =
|
|
3829
|
-
var isReadTime =
|
|
1340
|
+
var isAuthor = lodash.get(config, ["showAuthor"], lodash.get(configState, ["showAuthor"], true));
|
|
1341
|
+
var isTime = lodash.get(config, ["showTime"], lodash.get(configState, ["showTime"], true));
|
|
1342
|
+
var isReadTime = lodash.get(configState, ["showReadTime"], true);
|
|
3830
1343
|
var isBottomClasses = isBottom ? "bottom-fix" : "";
|
|
3831
1344
|
var seperatorStyle = separator === "dot" ? "dot" : "dash";
|
|
3832
1345
|
var textColor = isLightTheme ? "light" : getTextColor(configState.theme);
|
|
3833
1346
|
|
|
3834
1347
|
var getSeparator = function getSeparator() {
|
|
3835
1348
|
if (separator === "divider") {
|
|
3836
|
-
return /*#__PURE__*/
|
|
1349
|
+
return /*#__PURE__*/React__default["default"].createElement(Divider, {
|
|
3837
1350
|
color: textColor
|
|
3838
1351
|
});
|
|
3839
1352
|
}
|
|
3840
1353
|
|
|
3841
|
-
return /*#__PURE__*/
|
|
1354
|
+
return /*#__PURE__*/React__default["default"].createElement(Dot, {
|
|
3842
1355
|
color: textColor
|
|
3843
1356
|
});
|
|
3844
1357
|
};
|
|
3845
1358
|
|
|
3846
1359
|
var getTimeStamp = function getTimeStamp() {
|
|
3847
1360
|
if (!isTime) return null;
|
|
3848
|
-
return /*#__PURE__*/
|
|
3849
|
-
className: "arr-separator " +
|
|
3850
|
-
}, getSeparator()), /*#__PURE__*/
|
|
1361
|
+
return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, isAuthor && /*#__PURE__*/React__default["default"].createElement("span", {
|
|
1362
|
+
className: "arr-separator " + _getClassName__default["default"]("".concat(seperatorStyle), _styleModuleImportMap$4)
|
|
1363
|
+
}, getSeparator()), /*#__PURE__*/React__default["default"].createElement(TimeStamp, {
|
|
3851
1364
|
story: story,
|
|
3852
1365
|
config: config
|
|
3853
|
-
}), isReadTime && /*#__PURE__*/
|
|
1366
|
+
}), isReadTime && /*#__PURE__*/React__default["default"].createElement(ReadTime, {
|
|
3854
1367
|
story: story,
|
|
3855
1368
|
opts: config,
|
|
3856
1369
|
isLightTheme: isLightTheme
|
|
3857
1370
|
}));
|
|
3858
1371
|
};
|
|
3859
1372
|
|
|
3860
|
-
return /*#__PURE__*/
|
|
3861
|
-
className: "arr--author-time " +
|
|
3862
|
-
}, isAuthor ? /*#__PURE__*/
|
|
1373
|
+
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
1374
|
+
className: "arr--author-time " + _getClassName__default["default"]("author-time-wrapper ".concat(isBottomClasses), _styleModuleImportMap$4)
|
|
1375
|
+
}, isAuthor ? /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement(Author, {
|
|
3863
1376
|
story: story,
|
|
3864
1377
|
isBottom: true,
|
|
3865
1378
|
hideAuthorImage: hideAuthorImage,
|
|
@@ -3867,19 +1380,19 @@ var AuthorWithTime = function AuthorWithTime(_ref) {
|
|
|
3867
1380
|
}), getTimeStamp()) : getTimeStamp());
|
|
3868
1381
|
};
|
|
3869
1382
|
AuthorWithTime.propTypes = {
|
|
3870
|
-
story:
|
|
1383
|
+
story: PropTypes__default["default"].object,
|
|
3871
1384
|
|
|
3872
1385
|
/** Style of separator between the Author & Timestamp */
|
|
3873
|
-
separator:
|
|
1386
|
+
separator: PropTypes__default["default"].oneOf(["dot", "divider"]),
|
|
3874
1387
|
|
|
3875
1388
|
/** hide the author image */
|
|
3876
|
-
hideAuthorImage:
|
|
1389
|
+
hideAuthorImage: PropTypes__default["default"].bool,
|
|
3877
1390
|
// fix author and time at the end
|
|
3878
|
-
isBottom:
|
|
1391
|
+
isBottom: PropTypes__default["default"].bool,
|
|
3879
1392
|
// fix prefix before the author name
|
|
3880
|
-
prefix:
|
|
3881
|
-
config:
|
|
3882
|
-
isLightTheme:
|
|
1393
|
+
prefix: PropTypes__default["default"].string,
|
|
1394
|
+
config: PropTypes__default["default"].object,
|
|
1395
|
+
isLightTheme: PropTypes__default["default"].bool
|
|
3883
1396
|
};
|
|
3884
1397
|
AuthorWithTime.defaultProps = {
|
|
3885
1398
|
separator: "dot",
|
|
@@ -3909,9 +1422,9 @@ var SectionTag = function SectionTag(_ref) {
|
|
|
3909
1422
|
borderColor = _ref$borderColor === void 0 ? "" : _ref$borderColor,
|
|
3910
1423
|
isLightTheme = _ref.isLightTheme;
|
|
3911
1424
|
var config = useStateValue() || {};
|
|
3912
|
-
var isSection =
|
|
3913
|
-
var templateFromRowContext =
|
|
3914
|
-
var section =
|
|
1425
|
+
var isSection = lodash.get(config, ["showSection"], true);
|
|
1426
|
+
var templateFromRowContext = lodash.get(config, ["sectionTagTemplate"]);
|
|
1427
|
+
var section = lodash.get(story, ["sections", 0], "");
|
|
3915
1428
|
var supportedTemplates = ["borderBottomSml", "borderLeft", "solid"];
|
|
3916
1429
|
var getUrl = section ? section["section-url"] : "/";
|
|
3917
1430
|
var colorToApplyContrast = template === "solid" || templateFromRowContext === "solid" ? borderColor : config.theme;
|
|
@@ -3924,22 +1437,22 @@ var SectionTag = function SectionTag(_ref) {
|
|
|
3924
1437
|
}
|
|
3925
1438
|
|
|
3926
1439
|
if (!isSection) return null;
|
|
3927
|
-
return /*#__PURE__*/
|
|
1440
|
+
return /*#__PURE__*/React__default["default"].createElement(components.Link, {
|
|
3928
1441
|
href: getUrl,
|
|
3929
1442
|
className: "arrow-component arr--section-name",
|
|
3930
1443
|
"aria-label": "section-name"
|
|
3931
|
-
}, /*#__PURE__*/
|
|
1444
|
+
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
3932
1445
|
"data-test-id": "sectionTag",
|
|
3933
1446
|
style: {
|
|
3934
1447
|
backgroundColor: templateStyle.includes("section-solid") ? sectionTagBorderColor : ""
|
|
3935
1448
|
},
|
|
3936
|
-
className: "section-tag arrow-component " +
|
|
3937
|
-
}, templateStyle.includes("section-borderLeft") && /*#__PURE__*/
|
|
1449
|
+
className: "section-tag arrow-component " + _getClassName__default["default"]("".concat(textColor, " ").concat(templateStyle), _styleModuleImportMap$3)
|
|
1450
|
+
}, templateStyle.includes("section-borderLeft") && /*#__PURE__*/React__default["default"].createElement("span", {
|
|
3938
1451
|
className: "section-m_border-left__2oUyp",
|
|
3939
1452
|
style: {
|
|
3940
1453
|
color: sectionTagBorderColor
|
|
3941
1454
|
}
|
|
3942
|
-
}), section["display-name"] || section["name"], /*#__PURE__*/
|
|
1455
|
+
}), section["display-name"] || section["name"], /*#__PURE__*/React__default["default"].createElement("div", {
|
|
3943
1456
|
className: "section-m_border-bottom__3cRoD",
|
|
3944
1457
|
style: {
|
|
3945
1458
|
backgroundColor: "".concat(template === "solid" ? "" : sectionTagBorderColor)
|
|
@@ -3948,13 +1461,13 @@ var SectionTag = function SectionTag(_ref) {
|
|
|
3948
1461
|
};
|
|
3949
1462
|
SectionTag.propTypes = {
|
|
3950
1463
|
/** The Story Object from the API response */
|
|
3951
|
-
story:
|
|
1464
|
+
story: PropTypes__default["default"].object.isRequired,
|
|
3952
1465
|
|
|
3953
1466
|
/** The style template for section tag */
|
|
3954
|
-
template:
|
|
3955
|
-
borderColor:
|
|
3956
|
-
solidBorderColor:
|
|
3957
|
-
isLightTheme:
|
|
1467
|
+
template: PropTypes__default["default"].oneOf(["", "borderBottomSml", "borderLeft", "solid"]),
|
|
1468
|
+
borderColor: PropTypes__default["default"].string,
|
|
1469
|
+
solidBorderColor: PropTypes__default["default"].string,
|
|
1470
|
+
isLightTheme: PropTypes__default["default"].bool
|
|
3958
1471
|
};
|
|
3959
1472
|
SectionTag.defaultProps = {
|
|
3960
1473
|
template: "",
|
|
@@ -4003,7 +1516,7 @@ var StoryCard = function StoryCard(_ref) {
|
|
|
4003
1516
|
prefix = _ref.prefix,
|
|
4004
1517
|
config = _ref.config,
|
|
4005
1518
|
isHorizontalWithImageLast = _ref.isHorizontalWithImageLast;
|
|
4006
|
-
if (!story || isEmpty(story)) return /*#__PURE__*/
|
|
1519
|
+
if (!story || isEmpty(story)) return /*#__PURE__*/React__default["default"].createElement("div", null);
|
|
4007
1520
|
var borderOptions = ["default", "full", "bottom", "boxShadow"];
|
|
4008
1521
|
var borderTemplate = borderOptions.includes(border) ? "border-".concat(border) : ""; // TODO optimize conditions
|
|
4009
1522
|
|
|
@@ -4013,7 +1526,7 @@ var StoryCard = function StoryCard(_ref) {
|
|
|
4013
1526
|
var bgImgContentOverlapClass = bgImgContentOverlap ? "content-overlap" : "";
|
|
4014
1527
|
var textColor = getTextColor(theme);
|
|
4015
1528
|
var horizontalMobileClasses = isHorizontalMobile ? "horizontal-mob" : "";
|
|
4016
|
-
var defaultStorycard = /*#__PURE__*/
|
|
1529
|
+
var defaultStorycard = /*#__PURE__*/React__default["default"].createElement(DefaultStoryCard, {
|
|
4017
1530
|
story: story,
|
|
4018
1531
|
aspectRatio: aspectRatio,
|
|
4019
1532
|
border: border,
|
|
@@ -4027,13 +1540,13 @@ var StoryCard = function StoryCard(_ref) {
|
|
|
4027
1540
|
config: config,
|
|
4028
1541
|
isHorizontalWithImageLast: isHorizontalWithImageLast
|
|
4029
1542
|
});
|
|
4030
|
-
return /*#__PURE__*/
|
|
1543
|
+
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
4031
1544
|
"data-test-id": "story-card",
|
|
4032
1545
|
style: {
|
|
4033
1546
|
backgroundColor: theme,
|
|
4034
1547
|
color: textColor
|
|
4035
1548
|
},
|
|
4036
|
-
className: "arr--story-card " +
|
|
1549
|
+
className: "arr--story-card " + _getClassName__default["default"]("card ".concat(horizontalCardStyle, " ").concat(borderTemplate, " ").concat(textColor, " ").concat(bgImageClasses, " ").concat(bgImgContentOverlapClass, " ").concat(horizontalMobileClasses), _styleModuleImportMap$2)
|
|
4037
1550
|
}, children || defaultStorycard);
|
|
4038
1551
|
};
|
|
4039
1552
|
|
|
@@ -4056,91 +1569,91 @@ var DefaultStoryCard = function DefaultStoryCard(_ref2) {
|
|
|
4056
1569
|
var SectionTagborderColor = rgbToHex(borderColor);
|
|
4057
1570
|
var _config$localizationC = config.localizationConfig,
|
|
4058
1571
|
localizationConfig = _config$localizationC === void 0 ? {} : _config$localizationC;
|
|
4059
|
-
return /*#__PURE__*/
|
|
1572
|
+
return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, isHorizontal ? /*#__PURE__*/React__default["default"].createElement(HeroImage, {
|
|
4060
1573
|
config: config,
|
|
4061
1574
|
story: story,
|
|
4062
1575
|
isHorizontal: true,
|
|
4063
1576
|
isHorizontalMobile: isHorizontalMobile,
|
|
4064
1577
|
aspectRatio: aspectRatio
|
|
4065
|
-
}) : isHorizontalWithImageLast ? /*#__PURE__*/
|
|
1578
|
+
}) : isHorizontalWithImageLast ? /*#__PURE__*/React__default["default"].createElement(HeroImage, {
|
|
4066
1579
|
config: config,
|
|
4067
1580
|
story: story,
|
|
4068
1581
|
isHorizontalWithImageLast: true,
|
|
4069
1582
|
isHorizontalMobile: isHorizontalMobile,
|
|
4070
1583
|
aspectRatio: aspectRatio
|
|
4071
|
-
}) : /*#__PURE__*/
|
|
1584
|
+
}) : /*#__PURE__*/React__default["default"].createElement(HeroImage, {
|
|
4072
1585
|
story: story,
|
|
4073
1586
|
config: config,
|
|
4074
1587
|
isHorizontalMobile: isHorizontalMobile,
|
|
4075
1588
|
aspectRatio: aspectRatio
|
|
4076
|
-
}), /*#__PURE__*/
|
|
4077
|
-
className: "arr--story-content " +
|
|
4078
|
-
}, /*#__PURE__*/
|
|
1589
|
+
}), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
1590
|
+
className: "arr--story-content " + _getClassName__default["default"]("content ".concat(alignment), _styleModuleImportMap$2)
|
|
1591
|
+
}, /*#__PURE__*/React__default["default"].createElement(SectionTag, {
|
|
4079
1592
|
story: story,
|
|
4080
1593
|
borderColor: SectionTagborderColor
|
|
4081
|
-
}), /*#__PURE__*/
|
|
1594
|
+
}), /*#__PURE__*/React__default["default"].createElement(Headline, {
|
|
4082
1595
|
story: story,
|
|
4083
1596
|
headerLevel: headerLevel,
|
|
4084
1597
|
premiumStoryIconConfig: config
|
|
4085
|
-
}), /*#__PURE__*/
|
|
1598
|
+
}), /*#__PURE__*/React__default["default"].createElement(AuthorWithTime, {
|
|
4086
1599
|
config: localizationConfig,
|
|
4087
1600
|
story: story,
|
|
4088
1601
|
isBottom: true,
|
|
4089
1602
|
prefix: prefix,
|
|
4090
1603
|
hideAuthorImage: hideAuthorImage
|
|
4091
|
-
}), /*#__PURE__*/
|
|
1604
|
+
}), /*#__PURE__*/React__default["default"].createElement(Subheadline, {
|
|
4092
1605
|
story: story
|
|
4093
1606
|
})));
|
|
4094
1607
|
};
|
|
4095
1608
|
|
|
4096
1609
|
DefaultStoryCard.propTypes = {
|
|
4097
|
-
story:
|
|
4098
|
-
border:
|
|
4099
|
-
isBottom:
|
|
4100
|
-
isHorizontal:
|
|
4101
|
-
aspectRatio:
|
|
4102
|
-
isHorizontalMobile:
|
|
4103
|
-
centerAlign:
|
|
4104
|
-
headerLevel:
|
|
4105
|
-
borderColor:
|
|
4106
|
-
hideAuthorImage:
|
|
4107
|
-
prefix:
|
|
4108
|
-
config:
|
|
4109
|
-
isHorizontalWithImageLast:
|
|
1610
|
+
story: PropTypes__default["default"].object.isRequired,
|
|
1611
|
+
border: PropTypes__default["default"].oneOfType([PropTypes__default["default"].string]),
|
|
1612
|
+
isBottom: PropTypes__default["default"].bool,
|
|
1613
|
+
isHorizontal: PropTypes__default["default"].bool,
|
|
1614
|
+
aspectRatio: PropTypes__default["default"].oneOfType([PropTypes__default["default"].array]),
|
|
1615
|
+
isHorizontalMobile: PropTypes__default["default"].bool,
|
|
1616
|
+
centerAlign: PropTypes__default["default"].bool,
|
|
1617
|
+
headerLevel: PropTypes__default["default"].string,
|
|
1618
|
+
borderColor: PropTypes__default["default"].string,
|
|
1619
|
+
hideAuthorImage: PropTypes__default["default"].bool,
|
|
1620
|
+
prefix: PropTypes__default["default"].string,
|
|
1621
|
+
config: PropTypes__default["default"].object,
|
|
1622
|
+
isHorizontalWithImageLast: PropTypes__default["default"].bool
|
|
4110
1623
|
};
|
|
4111
1624
|
StoryCard.propTypes = {
|
|
4112
1625
|
/** The Story Object from the API response */
|
|
4113
|
-
story:
|
|
4114
|
-
children:
|
|
1626
|
+
story: PropTypes__default["default"].object.isRequired,
|
|
1627
|
+
children: PropTypes__default["default"].node,
|
|
4115
1628
|
|
|
4116
1629
|
/** Flip the Story Card to Horizonal mode */
|
|
4117
|
-
isHorizontal:
|
|
1630
|
+
isHorizontal: PropTypes__default["default"].bool,
|
|
4118
1631
|
|
|
4119
1632
|
/** Add border to the Story Card */
|
|
4120
|
-
border:
|
|
1633
|
+
border: PropTypes__default["default"].oneOfType([PropTypes__default["default"].string]),
|
|
4121
1634
|
// story card with background image
|
|
4122
|
-
useImageAsBackground:
|
|
1635
|
+
useImageAsBackground: PropTypes__default["default"].bool,
|
|
4123
1636
|
// story card content overlap with image
|
|
4124
|
-
bgImgContentOverlap:
|
|
1637
|
+
bgImgContentOverlap: PropTypes__default["default"].bool,
|
|
4125
1638
|
|
|
4126
1639
|
/** add aspect ratio for hero image */
|
|
4127
|
-
aspectRatio:
|
|
1640
|
+
aspectRatio: PropTypes__default["default"].oneOfType([PropTypes__default["default"].array]),
|
|
4128
1641
|
|
|
4129
1642
|
/** add theme(dark /light/custom color) for storycard */
|
|
4130
|
-
theme:
|
|
1643
|
+
theme: PropTypes__default["default"].string,
|
|
4131
1644
|
|
|
4132
1645
|
/** flip the story card mobile design horizontal */
|
|
4133
|
-
isHorizontalMobile:
|
|
1646
|
+
isHorizontalMobile: PropTypes__default["default"].bool,
|
|
4134
1647
|
// make content center align in desktop and left align in mobile
|
|
4135
|
-
centerAlign:
|
|
4136
|
-
headerLevel:
|
|
4137
|
-
borderColor:
|
|
1648
|
+
centerAlign: PropTypes__default["default"].bool,
|
|
1649
|
+
headerLevel: PropTypes__default["default"].string,
|
|
1650
|
+
borderColor: PropTypes__default["default"].string,
|
|
4138
1651
|
// handle author image through storycard
|
|
4139
|
-
hideAuthorImage:
|
|
1652
|
+
hideAuthorImage: PropTypes__default["default"].bool,
|
|
4140
1653
|
// handle author prefix through storycard
|
|
4141
|
-
prefix:
|
|
4142
|
-
config:
|
|
4143
|
-
isHorizontalWithImageLast:
|
|
1654
|
+
prefix: PropTypes__default["default"].string,
|
|
1655
|
+
config: PropTypes__default["default"].object,
|
|
1656
|
+
isHorizontalWithImageLast: PropTypes__default["default"].bool
|
|
4144
1657
|
};
|
|
4145
1658
|
StoryCard.defaultProps = {
|
|
4146
1659
|
isHorizontal: false,
|
|
@@ -4152,21 +1665,6 @@ StoryCard.defaultProps = {
|
|
|
4152
1665
|
isHorizontalWithImageLast: false
|
|
4153
1666
|
};
|
|
4154
1667
|
|
|
4155
|
-
function _defineProperty(obj, key, value) {
|
|
4156
|
-
if (key in obj) {
|
|
4157
|
-
Object.defineProperty(obj, key, {
|
|
4158
|
-
value: value,
|
|
4159
|
-
enumerable: true,
|
|
4160
|
-
configurable: true,
|
|
4161
|
-
writable: true
|
|
4162
|
-
});
|
|
4163
|
-
} else {
|
|
4164
|
-
obj[key] = value;
|
|
4165
|
-
}
|
|
4166
|
-
|
|
4167
|
-
return obj;
|
|
4168
|
-
}
|
|
4169
|
-
|
|
4170
1668
|
var _styleModuleImportMap$1 = {
|
|
4171
1669
|
"./load-more.m.css": {
|
|
4172
1670
|
"button": "load-more-m_button__1mmf1",
|
|
@@ -4178,7 +1676,7 @@ var _styleModuleImportMap$1 = {
|
|
|
4178
1676
|
|
|
4179
1677
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
4180
1678
|
|
|
4181
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) {
|
|
1679
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty__default["default"](target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
4182
1680
|
var LoadmoreButton = function LoadmoreButton(_ref) {
|
|
4183
1681
|
var _ref$config = _ref.config,
|
|
4184
1682
|
config = _ref$config === void 0 ? {} : _ref$config,
|
|
@@ -4199,26 +1697,26 @@ var LoadmoreButton = function LoadmoreButton(_ref) {
|
|
|
4199
1697
|
if (!showButton) return null;
|
|
4200
1698
|
var textColor = getTextColor(theme);
|
|
4201
1699
|
var slug = customUrlPath ? "/".concat(customUrlPath) : generateNavigateSlug(collection, _objectSpread(_objectSpread({}, qtConfig), config));
|
|
4202
|
-
return template === "SubsequentLoadCount" ? /*#__PURE__*/
|
|
1700
|
+
return template === "SubsequentLoadCount" ? /*#__PURE__*/React__default["default"].createElement("div", {
|
|
4203
1701
|
onClick: onClick,
|
|
4204
1702
|
"data-test-id": "load-more",
|
|
4205
|
-
className: "arr--button " +
|
|
4206
|
-
}, buttonText) : /*#__PURE__*/
|
|
1703
|
+
className: "arr--button " + _getClassName__default["default"]("button ".concat(textColor, " default"), _styleModuleImportMap$1)
|
|
1704
|
+
}, buttonText) : /*#__PURE__*/React__default["default"].createElement(components.LinkBase, {
|
|
4207
1705
|
href: slug,
|
|
4208
1706
|
navigateTo: navigate,
|
|
4209
1707
|
"data-test-id": "load-more",
|
|
4210
1708
|
"aria-label": "load-more"
|
|
4211
|
-
}, /*#__PURE__*/
|
|
4212
|
-
className: "arr--button " +
|
|
1709
|
+
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
1710
|
+
className: "arr--button " + _getClassName__default["default"]("button ".concat(textColor, " default"), _styleModuleImportMap$1)
|
|
4213
1711
|
}, buttonText));
|
|
4214
1712
|
};
|
|
4215
1713
|
LoadmoreButton.propTypes = {
|
|
4216
|
-
collection:
|
|
4217
|
-
template:
|
|
4218
|
-
config:
|
|
4219
|
-
onClick:
|
|
4220
|
-
navigate:
|
|
4221
|
-
qtConfig:
|
|
1714
|
+
collection: PropTypes__default["default"].object,
|
|
1715
|
+
template: PropTypes__default["default"].string,
|
|
1716
|
+
config: PropTypes__default["default"].object,
|
|
1717
|
+
onClick: PropTypes__default["default"].func,
|
|
1718
|
+
navigate: PropTypes__default["default"].func,
|
|
1719
|
+
qtConfig: PropTypes__default["default"].object
|
|
4222
1720
|
};
|
|
4223
1721
|
|
|
4224
1722
|
var isClient = typeof window !== "undefined";
|
|
@@ -4230,7 +1728,7 @@ var hasIntersectionObserverSupport = function hasIntersectionObserverSupport() {
|
|
|
4230
1728
|
|
|
4231
1729
|
|
|
4232
1730
|
var getIntersectionObserver = function getIntersectionObserver() {
|
|
4233
|
-
return Promise.resolve(isClient && !hasIntersectionObserverSupport() &&
|
|
1731
|
+
return Promise.resolve(isClient && !hasIntersectionObserverSupport() && Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require('intersection-observer')); }));
|
|
4234
1732
|
}; // options for intersection observer in order to improve the effect
|
|
4235
1733
|
|
|
4236
1734
|
|
|
@@ -4263,12 +1761,12 @@ var getObserver = function getObserver() {
|
|
|
4263
1761
|
var useNearScreen = (function (_ref) {
|
|
4264
1762
|
var ref = _ref.ref;
|
|
4265
1763
|
|
|
4266
|
-
var _useState = useState(false),
|
|
4267
|
-
_useState2 =
|
|
1764
|
+
var _useState = React.useState(false),
|
|
1765
|
+
_useState2 = _slicedToArray__default["default"](_useState, 2),
|
|
4268
1766
|
show = _useState2[0],
|
|
4269
1767
|
setShow = _useState2[1];
|
|
4270
1768
|
|
|
4271
|
-
useEffect(function () {
|
|
1769
|
+
React.useEffect(function () {
|
|
4272
1770
|
var current = ref.current;
|
|
4273
1771
|
if (!current) return; // get observer async and only when needed
|
|
4274
1772
|
|
|
@@ -4295,36 +1793,36 @@ var EMPTY_HTML = {
|
|
|
4295
1793
|
var isServer = typeof window === "undefined";
|
|
4296
1794
|
var ProgressiveHydration = function ProgressiveHydration(props) {
|
|
4297
1795
|
var children = props.children;
|
|
4298
|
-
var ref = useRef(null);
|
|
1796
|
+
var ref = React.useRef(null);
|
|
4299
1797
|
var isNearScreen = useNearScreen({
|
|
4300
1798
|
ref: ref
|
|
4301
1799
|
});
|
|
4302
|
-
useEffect(function () {
|
|
1800
|
+
React.useEffect(function () {
|
|
4303
1801
|
var el = ref.current; // CLIENT:
|
|
4304
1802
|
// If we want to force the hydration OR the element is near screen
|
|
4305
1803
|
// then we hydrate the content to get the functionality ready
|
|
4306
1804
|
|
|
4307
1805
|
if (isNearScreen) {
|
|
4308
1806
|
var action = el.hasChildNodes() ? "hydrate" : "render";
|
|
4309
|
-
|
|
1807
|
+
ReactDOM__default["default"][action](children, el);
|
|
4310
1808
|
}
|
|
4311
1809
|
}, [children, isNearScreen]); // SERVER: Just render the content as usual
|
|
4312
1810
|
|
|
4313
1811
|
if (isServer) {
|
|
4314
|
-
return /*#__PURE__*/
|
|
1812
|
+
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
4315
1813
|
ref: ref
|
|
4316
1814
|
}, children);
|
|
4317
1815
|
} // CLIENT: Avoid hydration until we say so
|
|
4318
1816
|
|
|
4319
1817
|
|
|
4320
|
-
return /*#__PURE__*/
|
|
1818
|
+
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
4321
1819
|
ref: ref,
|
|
4322
1820
|
suppressHydrationWarning: true,
|
|
4323
1821
|
dangerouslySetInnerHTML: EMPTY_HTML
|
|
4324
1822
|
});
|
|
4325
1823
|
};
|
|
4326
1824
|
ProgressiveHydration.propTypes = {
|
|
4327
|
-
children:
|
|
1825
|
+
children: PropTypes__default["default"].element
|
|
4328
1826
|
};
|
|
4329
1827
|
|
|
4330
1828
|
var LoadMoreTarget = function LoadMoreTarget(_ref) {
|
|
@@ -4332,7 +1830,7 @@ var LoadMoreTarget = function LoadMoreTarget(_ref) {
|
|
|
4332
1830
|
componentName = _ref.componentName,
|
|
4333
1831
|
offset = _ref.offset,
|
|
4334
1832
|
limit = _ref.limit;
|
|
4335
|
-
return /*#__PURE__*/
|
|
1833
|
+
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
4336
1834
|
id: "ELM-".concat(collection.id),
|
|
4337
1835
|
"data-collection-slug": collection["slug"],
|
|
4338
1836
|
"data-component-name": componentName,
|
|
@@ -4341,13 +1839,13 @@ var LoadMoreTarget = function LoadMoreTarget(_ref) {
|
|
|
4341
1839
|
});
|
|
4342
1840
|
};
|
|
4343
1841
|
LoadMoreTarget.propTypes = {
|
|
4344
|
-
collection:
|
|
4345
|
-
id:
|
|
4346
|
-
slug:
|
|
1842
|
+
collection: PropTypes__default["default"].shape({
|
|
1843
|
+
id: PropTypes__default["default"].string,
|
|
1844
|
+
slug: PropTypes__default["default"].string
|
|
4347
1845
|
}),
|
|
4348
|
-
componentName:
|
|
4349
|
-
offset:
|
|
4350
|
-
limit:
|
|
1846
|
+
componentName: PropTypes__default["default"].string,
|
|
1847
|
+
offset: PropTypes__default["default"].number,
|
|
1848
|
+
limit: PropTypes__default["default"].number
|
|
4351
1849
|
};
|
|
4352
1850
|
|
|
4353
1851
|
var _styleModuleImportMap = {
|
|
@@ -4386,7 +1884,7 @@ var SixColSixStoriesBase = function SixColSixStoriesBase(_ref2) {
|
|
|
4386
1884
|
isLoadMoreVisible = _ref2.isLoadMoreVisible,
|
|
4387
1885
|
isLoading = _ref2.isLoading,
|
|
4388
1886
|
isolatedLoadMore = _ref2.isolatedLoadMore;
|
|
4389
|
-
var stories = collectionToStories(collection);
|
|
1887
|
+
var stories = components.collectionToStories(collection);
|
|
4390
1888
|
if (!stories.length) return null;
|
|
4391
1889
|
var _config$collectionNam = config.collectionNameBorderColor,
|
|
4392
1890
|
collectionNameBorderColor = _config$collectionNam === void 0 ? "" : _config$collectionNam,
|
|
@@ -4406,16 +1904,16 @@ var SixColSixStoriesBase = function SixColSixStoriesBase(_ref2) {
|
|
|
4406
1904
|
subsequentLoadCount = _config$subsequentLoa === void 0 ? 6 : _config$subsequentLoa;
|
|
4407
1905
|
var textColor = getTextColor(theme);
|
|
4408
1906
|
var borderStyle = border === "fullBorder" ? "vertical-border" : "";
|
|
4409
|
-
var dispatch = useDispatch();
|
|
4410
|
-
var qtConfig = useSelector(function (state) {
|
|
4411
|
-
return
|
|
1907
|
+
var dispatch = reactRedux.useDispatch();
|
|
1908
|
+
var qtConfig = reactRedux.useSelector(function (state) {
|
|
1909
|
+
return lodash.get(state, ["qt", "config"], {});
|
|
4412
1910
|
});
|
|
4413
1911
|
|
|
4414
1912
|
var getLoadMore = function getLoadMore(opts) {
|
|
4415
1913
|
if (!isLoadMoreVisible) return null;
|
|
4416
1914
|
|
|
4417
1915
|
if (isolatedLoadMore) {
|
|
4418
|
-
return /*#__PURE__*/
|
|
1916
|
+
return /*#__PURE__*/React__default["default"].createElement(LoadMoreTarget, {
|
|
4419
1917
|
collection: collection,
|
|
4420
1918
|
componentName: "SixColSixStories",
|
|
4421
1919
|
offset: stories.length,
|
|
@@ -4424,7 +1922,7 @@ var SixColSixStoriesBase = function SixColSixStoriesBase(_ref2) {
|
|
|
4424
1922
|
}
|
|
4425
1923
|
|
|
4426
1924
|
var url = generateNavigateSlug(collection, qtConfig);
|
|
4427
|
-
return /*#__PURE__*/
|
|
1925
|
+
return /*#__PURE__*/React__default["default"].createElement(ProgressiveHydration, null, /*#__PURE__*/React__default["default"].createElement(LoadmoreButton, {
|
|
4428
1926
|
config: config,
|
|
4429
1927
|
collection: collection,
|
|
4430
1928
|
template: footerButton,
|
|
@@ -4438,43 +1936,43 @@ var SixColSixStoriesBase = function SixColSixStoriesBase(_ref2) {
|
|
|
4438
1936
|
}));
|
|
4439
1937
|
};
|
|
4440
1938
|
|
|
4441
|
-
return /*#__PURE__*/
|
|
1939
|
+
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
4442
1940
|
className: "full-width-with-padding arrow-component",
|
|
4443
1941
|
"data-test-id": "six-col-six-stories",
|
|
4444
1942
|
style: {
|
|
4445
1943
|
backgroundColor: theme,
|
|
4446
1944
|
color: textColor
|
|
4447
1945
|
}
|
|
4448
|
-
}, /*#__PURE__*/
|
|
1946
|
+
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
4449
1947
|
className: "six-col-six-stories-m_wrapper__2k2bf"
|
|
4450
|
-
}, /*#__PURE__*/
|
|
1948
|
+
}, /*#__PURE__*/React__default["default"].createElement(CollectionName, {
|
|
4451
1949
|
collection: collection,
|
|
4452
1950
|
collectionNameTemplate: collectionNameTemplate,
|
|
4453
1951
|
collectionNameBorderColor: collectionNameBorderColor,
|
|
4454
1952
|
headerLevel: "2"
|
|
4455
|
-
}), /*#__PURE__*/
|
|
1953
|
+
}), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
4456
1954
|
className: "six-col-six-stories-m_row-wrapper__2YNUO"
|
|
4457
1955
|
}, stories.map(function (story, index) {
|
|
4458
|
-
return /*#__PURE__*/
|
|
1956
|
+
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
4459
1957
|
key: "six-col-six-stories-".concat(index),
|
|
4460
|
-
className:
|
|
4461
|
-
}, /*#__PURE__*/
|
|
1958
|
+
className: _getClassName__default["default"]("card-wrapper ".concat(borderStyle, " ").concat(textColor), _styleModuleImportMap)
|
|
1959
|
+
}, /*#__PURE__*/React__default["default"].createElement(StoryCard, {
|
|
4462
1960
|
story: story,
|
|
4463
1961
|
theme: theme,
|
|
4464
1962
|
config: config
|
|
4465
|
-
}, /*#__PURE__*/
|
|
1963
|
+
}, /*#__PURE__*/React__default["default"].createElement(HeroImage, {
|
|
4466
1964
|
story: story,
|
|
4467
1965
|
aspectRatio: [[16, 9], [16, 9]]
|
|
4468
|
-
}), /*#__PURE__*/
|
|
1966
|
+
}), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
4469
1967
|
className: "six-col-six-stories-m_content-wrapper__3n5nT"
|
|
4470
|
-
}, /*#__PURE__*/
|
|
1968
|
+
}, /*#__PURE__*/React__default["default"].createElement(SectionTag, {
|
|
4471
1969
|
story: story,
|
|
4472
1970
|
borderColor: borderColor
|
|
4473
|
-
}), /*#__PURE__*/
|
|
1971
|
+
}), /*#__PURE__*/React__default["default"].createElement(Headline, {
|
|
4474
1972
|
story: story,
|
|
4475
1973
|
headerLevel: "6",
|
|
4476
1974
|
premiumStoryIconConfig: config
|
|
4477
|
-
})), /*#__PURE__*/
|
|
1975
|
+
})), /*#__PURE__*/React__default["default"].createElement(AuthorWithTime, {
|
|
4478
1976
|
config: localizationConfig,
|
|
4479
1977
|
story: story
|
|
4480
1978
|
})));
|
|
@@ -4487,23 +1985,23 @@ var SixColSixStoriesBase = function SixColSixStoriesBase(_ref2) {
|
|
|
4487
1985
|
};
|
|
4488
1986
|
SixColSixStoriesBase.propTypes = {
|
|
4489
1987
|
/** collection is the array of objects which is returning by API */
|
|
4490
|
-
collection:
|
|
1988
|
+
collection: PropTypes__default["default"].object.isRequired,
|
|
4491
1989
|
|
|
4492
1990
|
/** The config for the Row */
|
|
4493
|
-
config:
|
|
4494
|
-
borderColor:
|
|
4495
|
-
theme:
|
|
4496
|
-
border:
|
|
4497
|
-
slotConfig:
|
|
4498
|
-
footerButton:
|
|
4499
|
-
collectionNameTemplate:
|
|
4500
|
-
collectionNameBorderColor:
|
|
4501
|
-
subsequentLoadCount:
|
|
1991
|
+
config: PropTypes__default["default"].shape({
|
|
1992
|
+
borderColor: PropTypes__default["default"].string,
|
|
1993
|
+
theme: PropTypes__default["default"].string,
|
|
1994
|
+
border: PropTypes__default["default"].string,
|
|
1995
|
+
slotConfig: PropTypes__default["default"].array,
|
|
1996
|
+
footerButton: PropTypes__default["default"].string,
|
|
1997
|
+
collectionNameTemplate: PropTypes__default["default"].string,
|
|
1998
|
+
collectionNameBorderColor: PropTypes__default["default"].string,
|
|
1999
|
+
subsequentLoadCount: PropTypes__default["default"].number
|
|
4502
2000
|
}),
|
|
4503
|
-
getMoreStories:
|
|
4504
|
-
isLoadMoreVisible:
|
|
4505
|
-
isLoading:
|
|
4506
|
-
isolatedLoadMore:
|
|
2001
|
+
getMoreStories: PropTypes__default["default"].func,
|
|
2002
|
+
isLoadMoreVisible: PropTypes__default["default"].bool,
|
|
2003
|
+
isLoading: PropTypes__default["default"].bool,
|
|
2004
|
+
isolatedLoadMore: PropTypes__default["default"].bool
|
|
4507
2005
|
};
|
|
4508
2006
|
SixColSixStoriesBase.defaultProps = {
|
|
4509
2007
|
getMoreStories: function getMoreStories() {},
|
|
@@ -4512,4 +2010,5 @@ SixColSixStoriesBase.defaultProps = {
|
|
|
4512
2010
|
};
|
|
4513
2011
|
var SixColSixStories = StateProvider(SixColSixStoriesBase);
|
|
4514
2012
|
|
|
4515
|
-
|
|
2013
|
+
exports.SixColSixStories = SixColSixStories;
|
|
2014
|
+
exports.SixColSixStoriesBase = SixColSixStoriesBase;
|