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