@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,30 @@
|
|
|
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
|
-
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
|
|
29
|
-
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
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
|
-
/**
|
|
44
|
-
* Checks if `value` is classified as an `Array` object.
|
|
45
|
-
*
|
|
46
|
-
* @static
|
|
47
|
-
* @memberOf _
|
|
48
|
-
* @since 0.1.0
|
|
49
|
-
* @category Lang
|
|
50
|
-
* @param {*} value The value to check.
|
|
51
|
-
* @returns {boolean} Returns `true` if `value` is an array, else `false`.
|
|
52
|
-
* @example
|
|
53
|
-
*
|
|
54
|
-
* _.isArray([1, 2, 3]);
|
|
55
|
-
* // => true
|
|
56
|
-
*
|
|
57
|
-
* _.isArray(document.body.children);
|
|
58
|
-
* // => false
|
|
59
|
-
*
|
|
60
|
-
* _.isArray('abc');
|
|
61
|
-
* // => false
|
|
62
|
-
*
|
|
63
|
-
* _.isArray(_.noop);
|
|
64
|
-
* // => false
|
|
65
|
-
*/
|
|
66
|
-
var isArray = Array.isArray;
|
|
67
|
-
|
|
68
|
-
var isArray_1 = isArray;
|
|
69
|
-
|
|
70
|
-
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
71
|
-
|
|
72
|
-
function getDefaultExportFromCjs (x) {
|
|
73
|
-
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
function createCommonjsModule(fn) {
|
|
77
|
-
var module = { exports: {} };
|
|
78
|
-
return fn(module, module.exports), module.exports;
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
/** Detect free variable `global` from Node.js. */
|
|
82
|
-
|
|
83
|
-
var freeGlobal = typeof commonjsGlobal == 'object' && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal;
|
|
84
|
-
|
|
85
|
-
var _freeGlobal = freeGlobal;
|
|
86
|
-
|
|
87
|
-
/** Detect free variable `self`. */
|
|
88
|
-
var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
|
|
89
|
-
|
|
90
|
-
/** Used as a reference to the global object. */
|
|
91
|
-
var root = _freeGlobal || freeSelf || Function('return this')();
|
|
92
|
-
|
|
93
|
-
var _root = root;
|
|
94
|
-
|
|
95
|
-
/** Built-in value references. */
|
|
96
|
-
var Symbol$1 = _root.Symbol;
|
|
97
|
-
|
|
98
|
-
var _Symbol = Symbol$1;
|
|
99
|
-
|
|
100
|
-
/** Used for built-in method references. */
|
|
101
|
-
var objectProto$4 = Object.prototype;
|
|
102
|
-
|
|
103
|
-
/** Used to check objects for own properties. */
|
|
104
|
-
var hasOwnProperty$3 = objectProto$4.hasOwnProperty;
|
|
105
|
-
|
|
106
|
-
/**
|
|
107
|
-
* Used to resolve the
|
|
108
|
-
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
|
|
109
|
-
* of values.
|
|
110
|
-
*/
|
|
111
|
-
var nativeObjectToString$1 = objectProto$4.toString;
|
|
112
|
-
|
|
113
|
-
/** Built-in value references. */
|
|
114
|
-
var symToStringTag$1 = _Symbol ? _Symbol.toStringTag : undefined;
|
|
115
|
-
|
|
116
|
-
/**
|
|
117
|
-
* A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
|
|
118
|
-
*
|
|
119
|
-
* @private
|
|
120
|
-
* @param {*} value The value to query.
|
|
121
|
-
* @returns {string} Returns the raw `toStringTag`.
|
|
122
|
-
*/
|
|
123
|
-
function getRawTag(value) {
|
|
124
|
-
var isOwn = hasOwnProperty$3.call(value, symToStringTag$1),
|
|
125
|
-
tag = value[symToStringTag$1];
|
|
126
|
-
|
|
127
|
-
try {
|
|
128
|
-
value[symToStringTag$1] = undefined;
|
|
129
|
-
var unmasked = true;
|
|
130
|
-
} catch (e) {}
|
|
131
|
-
|
|
132
|
-
var result = nativeObjectToString$1.call(value);
|
|
133
|
-
if (unmasked) {
|
|
134
|
-
if (isOwn) {
|
|
135
|
-
value[symToStringTag$1] = tag;
|
|
136
|
-
} else {
|
|
137
|
-
delete value[symToStringTag$1];
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
return result;
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
var _getRawTag = getRawTag;
|
|
144
|
-
|
|
145
|
-
/** Used for built-in method references. */
|
|
146
|
-
var objectProto$3 = Object.prototype;
|
|
147
|
-
|
|
148
|
-
/**
|
|
149
|
-
* Used to resolve the
|
|
150
|
-
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
|
|
151
|
-
* of values.
|
|
152
|
-
*/
|
|
153
|
-
var nativeObjectToString = objectProto$3.toString;
|
|
154
|
-
|
|
155
|
-
/**
|
|
156
|
-
* Converts `value` to a string using `Object.prototype.toString`.
|
|
157
|
-
*
|
|
158
|
-
* @private
|
|
159
|
-
* @param {*} value The value to convert.
|
|
160
|
-
* @returns {string} Returns the converted string.
|
|
161
|
-
*/
|
|
162
|
-
function objectToString(value) {
|
|
163
|
-
return nativeObjectToString.call(value);
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
var _objectToString = objectToString;
|
|
167
|
-
|
|
168
|
-
/** `Object#toString` result references. */
|
|
169
|
-
var nullTag = '[object Null]',
|
|
170
|
-
undefinedTag = '[object Undefined]';
|
|
171
|
-
|
|
172
|
-
/** Built-in value references. */
|
|
173
|
-
var symToStringTag = _Symbol ? _Symbol.toStringTag : undefined;
|
|
174
|
-
|
|
175
|
-
/**
|
|
176
|
-
* The base implementation of `getTag` without fallbacks for buggy environments.
|
|
177
|
-
*
|
|
178
|
-
* @private
|
|
179
|
-
* @param {*} value The value to query.
|
|
180
|
-
* @returns {string} Returns the `toStringTag`.
|
|
181
|
-
*/
|
|
182
|
-
function baseGetTag(value) {
|
|
183
|
-
if (value == null) {
|
|
184
|
-
return value === undefined ? undefinedTag : nullTag;
|
|
185
|
-
}
|
|
186
|
-
return (symToStringTag && symToStringTag in Object(value))
|
|
187
|
-
? _getRawTag(value)
|
|
188
|
-
: _objectToString(value);
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
var _baseGetTag = baseGetTag;
|
|
192
|
-
|
|
193
|
-
/**
|
|
194
|
-
* Checks if `value` is object-like. A value is object-like if it's not `null`
|
|
195
|
-
* and has a `typeof` result of "object".
|
|
196
|
-
*
|
|
197
|
-
* @static
|
|
198
|
-
* @memberOf _
|
|
199
|
-
* @since 4.0.0
|
|
200
|
-
* @category Lang
|
|
201
|
-
* @param {*} value The value to check.
|
|
202
|
-
* @returns {boolean} Returns `true` if `value` is object-like, else `false`.
|
|
203
|
-
* @example
|
|
204
|
-
*
|
|
205
|
-
* _.isObjectLike({});
|
|
206
|
-
* // => true
|
|
207
|
-
*
|
|
208
|
-
* _.isObjectLike([1, 2, 3]);
|
|
209
|
-
* // => true
|
|
210
|
-
*
|
|
211
|
-
* _.isObjectLike(_.noop);
|
|
212
|
-
* // => false
|
|
213
|
-
*
|
|
214
|
-
* _.isObjectLike(null);
|
|
215
|
-
* // => false
|
|
216
|
-
*/
|
|
217
|
-
function isObjectLike(value) {
|
|
218
|
-
return value != null && typeof value == 'object';
|
|
219
|
-
}
|
|
220
|
-
|
|
221
|
-
var isObjectLike_1 = isObjectLike;
|
|
222
|
-
|
|
223
|
-
/** `Object#toString` result references. */
|
|
224
|
-
var symbolTag = '[object Symbol]';
|
|
225
|
-
|
|
226
|
-
/**
|
|
227
|
-
* Checks if `value` is classified as a `Symbol` primitive or object.
|
|
228
|
-
*
|
|
229
|
-
* @static
|
|
230
|
-
* @memberOf _
|
|
231
|
-
* @since 4.0.0
|
|
232
|
-
* @category Lang
|
|
233
|
-
* @param {*} value The value to check.
|
|
234
|
-
* @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
|
|
235
|
-
* @example
|
|
236
|
-
*
|
|
237
|
-
* _.isSymbol(Symbol.iterator);
|
|
238
|
-
* // => true
|
|
239
|
-
*
|
|
240
|
-
* _.isSymbol('abc');
|
|
241
|
-
* // => false
|
|
242
|
-
*/
|
|
243
|
-
function isSymbol(value) {
|
|
244
|
-
return typeof value == 'symbol' ||
|
|
245
|
-
(isObjectLike_1(value) && _baseGetTag(value) == symbolTag);
|
|
246
|
-
}
|
|
247
|
-
|
|
248
|
-
var isSymbol_1 = isSymbol;
|
|
249
|
-
|
|
250
|
-
/** Used to match property names within property paths. */
|
|
251
|
-
var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
|
|
252
|
-
reIsPlainProp = /^\w*$/;
|
|
253
|
-
|
|
254
|
-
/**
|
|
255
|
-
* Checks if `value` is a property name and not a property path.
|
|
256
|
-
*
|
|
257
|
-
* @private
|
|
258
|
-
* @param {*} value The value to check.
|
|
259
|
-
* @param {Object} [object] The object to query keys on.
|
|
260
|
-
* @returns {boolean} Returns `true` if `value` is a property name, else `false`.
|
|
261
|
-
*/
|
|
262
|
-
function isKey(value, object) {
|
|
263
|
-
if (isArray_1(value)) {
|
|
264
|
-
return false;
|
|
265
|
-
}
|
|
266
|
-
var type = typeof value;
|
|
267
|
-
if (type == 'number' || type == 'symbol' || type == 'boolean' ||
|
|
268
|
-
value == null || isSymbol_1(value)) {
|
|
269
|
-
return true;
|
|
270
|
-
}
|
|
271
|
-
return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||
|
|
272
|
-
(object != null && value in Object(object));
|
|
273
|
-
}
|
|
274
|
-
|
|
275
|
-
var _isKey = isKey;
|
|
276
|
-
|
|
277
|
-
/**
|
|
278
|
-
* Checks if `value` is the
|
|
279
|
-
* [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
|
|
280
|
-
* of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
|
|
281
|
-
*
|
|
282
|
-
* @static
|
|
283
|
-
* @memberOf _
|
|
284
|
-
* @since 0.1.0
|
|
285
|
-
* @category Lang
|
|
286
|
-
* @param {*} value The value to check.
|
|
287
|
-
* @returns {boolean} Returns `true` if `value` is an object, else `false`.
|
|
288
|
-
* @example
|
|
289
|
-
*
|
|
290
|
-
* _.isObject({});
|
|
291
|
-
* // => true
|
|
292
|
-
*
|
|
293
|
-
* _.isObject([1, 2, 3]);
|
|
294
|
-
* // => true
|
|
295
|
-
*
|
|
296
|
-
* _.isObject(_.noop);
|
|
297
|
-
* // => true
|
|
298
|
-
*
|
|
299
|
-
* _.isObject(null);
|
|
300
|
-
* // => false
|
|
301
|
-
*/
|
|
302
|
-
function isObject(value) {
|
|
303
|
-
var type = typeof value;
|
|
304
|
-
return value != null && (type == 'object' || type == 'function');
|
|
305
|
-
}
|
|
306
|
-
|
|
307
|
-
var isObject_1 = isObject;
|
|
308
|
-
|
|
309
|
-
/** `Object#toString` result references. */
|
|
310
|
-
var asyncTag = '[object AsyncFunction]',
|
|
311
|
-
funcTag = '[object Function]',
|
|
312
|
-
genTag = '[object GeneratorFunction]',
|
|
313
|
-
proxyTag = '[object Proxy]';
|
|
314
|
-
|
|
315
|
-
/**
|
|
316
|
-
* Checks if `value` is classified as a `Function` object.
|
|
317
|
-
*
|
|
318
|
-
* @static
|
|
319
|
-
* @memberOf _
|
|
320
|
-
* @since 0.1.0
|
|
321
|
-
* @category Lang
|
|
322
|
-
* @param {*} value The value to check.
|
|
323
|
-
* @returns {boolean} Returns `true` if `value` is a function, else `false`.
|
|
324
|
-
* @example
|
|
325
|
-
*
|
|
326
|
-
* _.isFunction(_);
|
|
327
|
-
* // => true
|
|
328
|
-
*
|
|
329
|
-
* _.isFunction(/abc/);
|
|
330
|
-
* // => false
|
|
331
|
-
*/
|
|
332
|
-
function isFunction(value) {
|
|
333
|
-
if (!isObject_1(value)) {
|
|
334
|
-
return false;
|
|
335
|
-
}
|
|
336
|
-
// The use of `Object#toString` avoids issues with the `typeof` operator
|
|
337
|
-
// in Safari 9 which returns 'object' for typed arrays and other constructors.
|
|
338
|
-
var tag = _baseGetTag(value);
|
|
339
|
-
return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
|
|
340
|
-
}
|
|
341
|
-
|
|
342
|
-
var isFunction_1 = isFunction;
|
|
343
|
-
|
|
344
|
-
/** Used to detect overreaching core-js shims. */
|
|
345
|
-
var coreJsData = _root['__core-js_shared__'];
|
|
346
|
-
|
|
347
|
-
var _coreJsData = coreJsData;
|
|
348
|
-
|
|
349
|
-
/** Used to detect methods masquerading as native. */
|
|
350
|
-
var maskSrcKey = (function() {
|
|
351
|
-
var uid = /[^.]+$/.exec(_coreJsData && _coreJsData.keys && _coreJsData.keys.IE_PROTO || '');
|
|
352
|
-
return uid ? ('Symbol(src)_1.' + uid) : '';
|
|
353
|
-
}());
|
|
354
|
-
|
|
355
|
-
/**
|
|
356
|
-
* Checks if `func` has its source masked.
|
|
357
|
-
*
|
|
358
|
-
* @private
|
|
359
|
-
* @param {Function} func The function to check.
|
|
360
|
-
* @returns {boolean} Returns `true` if `func` is masked, else `false`.
|
|
361
|
-
*/
|
|
362
|
-
function isMasked(func) {
|
|
363
|
-
return !!maskSrcKey && (maskSrcKey in func);
|
|
364
|
-
}
|
|
365
|
-
|
|
366
|
-
var _isMasked = isMasked;
|
|
367
|
-
|
|
368
|
-
/** Used for built-in method references. */
|
|
369
|
-
var funcProto$1 = Function.prototype;
|
|
370
|
-
|
|
371
|
-
/** Used to resolve the decompiled source of functions. */
|
|
372
|
-
var funcToString$1 = funcProto$1.toString;
|
|
373
|
-
|
|
374
|
-
/**
|
|
375
|
-
* Converts `func` to its source code.
|
|
376
|
-
*
|
|
377
|
-
* @private
|
|
378
|
-
* @param {Function} func The function to convert.
|
|
379
|
-
* @returns {string} Returns the source code.
|
|
380
|
-
*/
|
|
381
|
-
function toSource(func) {
|
|
382
|
-
if (func != null) {
|
|
383
|
-
try {
|
|
384
|
-
return funcToString$1.call(func);
|
|
385
|
-
} catch (e) {}
|
|
386
|
-
try {
|
|
387
|
-
return (func + '');
|
|
388
|
-
} catch (e) {}
|
|
389
|
-
}
|
|
390
|
-
return '';
|
|
391
|
-
}
|
|
392
|
-
|
|
393
|
-
var _toSource = toSource;
|
|
394
|
-
|
|
395
|
-
/**
|
|
396
|
-
* Used to match `RegExp`
|
|
397
|
-
* [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
|
|
398
|
-
*/
|
|
399
|
-
var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
|
|
400
|
-
|
|
401
|
-
/** Used to detect host constructors (Safari). */
|
|
402
|
-
var reIsHostCtor = /^\[object .+?Constructor\]$/;
|
|
403
|
-
|
|
404
|
-
/** Used for built-in method references. */
|
|
405
|
-
var funcProto = Function.prototype,
|
|
406
|
-
objectProto$2 = Object.prototype;
|
|
407
|
-
|
|
408
|
-
/** Used to resolve the decompiled source of functions. */
|
|
409
|
-
var funcToString = funcProto.toString;
|
|
410
|
-
|
|
411
|
-
/** Used to check objects for own properties. */
|
|
412
|
-
var hasOwnProperty$2 = objectProto$2.hasOwnProperty;
|
|
413
|
-
|
|
414
|
-
/** Used to detect if a method is native. */
|
|
415
|
-
var reIsNative = RegExp('^' +
|
|
416
|
-
funcToString.call(hasOwnProperty$2).replace(reRegExpChar, '\\$&')
|
|
417
|
-
.replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
|
|
418
|
-
);
|
|
419
|
-
|
|
420
|
-
/**
|
|
421
|
-
* The base implementation of `_.isNative` without bad shim checks.
|
|
422
|
-
*
|
|
423
|
-
* @private
|
|
424
|
-
* @param {*} value The value to check.
|
|
425
|
-
* @returns {boolean} Returns `true` if `value` is a native function,
|
|
426
|
-
* else `false`.
|
|
427
|
-
*/
|
|
428
|
-
function baseIsNative(value) {
|
|
429
|
-
if (!isObject_1(value) || _isMasked(value)) {
|
|
430
|
-
return false;
|
|
431
|
-
}
|
|
432
|
-
var pattern = isFunction_1(value) ? reIsNative : reIsHostCtor;
|
|
433
|
-
return pattern.test(_toSource(value));
|
|
434
|
-
}
|
|
435
|
-
|
|
436
|
-
var _baseIsNative = baseIsNative;
|
|
437
|
-
|
|
438
|
-
/**
|
|
439
|
-
* Gets the value at `key` of `object`.
|
|
440
|
-
*
|
|
441
|
-
* @private
|
|
442
|
-
* @param {Object} [object] The object to query.
|
|
443
|
-
* @param {string} key The key of the property to get.
|
|
444
|
-
* @returns {*} Returns the property value.
|
|
445
|
-
*/
|
|
446
|
-
function getValue(object, key) {
|
|
447
|
-
return object == null ? undefined : object[key];
|
|
448
|
-
}
|
|
449
|
-
|
|
450
|
-
var _getValue = getValue;
|
|
451
|
-
|
|
452
|
-
/**
|
|
453
|
-
* Gets the native function at `key` of `object`.
|
|
454
|
-
*
|
|
455
|
-
* @private
|
|
456
|
-
* @param {Object} object The object to query.
|
|
457
|
-
* @param {string} key The key of the method to get.
|
|
458
|
-
* @returns {*} Returns the function if it's native, else `undefined`.
|
|
459
|
-
*/
|
|
460
|
-
function getNative(object, key) {
|
|
461
|
-
var value = _getValue(object, key);
|
|
462
|
-
return _baseIsNative(value) ? value : undefined;
|
|
463
|
-
}
|
|
464
|
-
|
|
465
|
-
var _getNative = getNative;
|
|
466
|
-
|
|
467
|
-
/* Built-in method references that are verified to be native. */
|
|
468
|
-
var nativeCreate = _getNative(Object, 'create');
|
|
469
|
-
|
|
470
|
-
var _nativeCreate = nativeCreate;
|
|
471
|
-
|
|
472
|
-
/**
|
|
473
|
-
* Removes all key-value entries from the hash.
|
|
474
|
-
*
|
|
475
|
-
* @private
|
|
476
|
-
* @name clear
|
|
477
|
-
* @memberOf Hash
|
|
478
|
-
*/
|
|
479
|
-
function hashClear() {
|
|
480
|
-
this.__data__ = _nativeCreate ? _nativeCreate(null) : {};
|
|
481
|
-
this.size = 0;
|
|
482
|
-
}
|
|
483
|
-
|
|
484
|
-
var _hashClear = hashClear;
|
|
485
|
-
|
|
486
|
-
/**
|
|
487
|
-
* Removes `key` and its value from the hash.
|
|
488
|
-
*
|
|
489
|
-
* @private
|
|
490
|
-
* @name delete
|
|
491
|
-
* @memberOf Hash
|
|
492
|
-
* @param {Object} hash The hash to modify.
|
|
493
|
-
* @param {string} key The key of the value to remove.
|
|
494
|
-
* @returns {boolean} Returns `true` if the entry was removed, else `false`.
|
|
495
|
-
*/
|
|
496
|
-
function hashDelete(key) {
|
|
497
|
-
var result = this.has(key) && delete this.__data__[key];
|
|
498
|
-
this.size -= result ? 1 : 0;
|
|
499
|
-
return result;
|
|
500
|
-
}
|
|
501
|
-
|
|
502
|
-
var _hashDelete = hashDelete;
|
|
503
|
-
|
|
504
|
-
/** Used to stand-in for `undefined` hash values. */
|
|
505
|
-
var HASH_UNDEFINED$1 = '__lodash_hash_undefined__';
|
|
506
|
-
|
|
507
|
-
/** Used for built-in method references. */
|
|
508
|
-
var objectProto$1 = Object.prototype;
|
|
509
|
-
|
|
510
|
-
/** Used to check objects for own properties. */
|
|
511
|
-
var hasOwnProperty$1 = objectProto$1.hasOwnProperty;
|
|
512
|
-
|
|
513
|
-
/**
|
|
514
|
-
* Gets the hash value for `key`.
|
|
515
|
-
*
|
|
516
|
-
* @private
|
|
517
|
-
* @name get
|
|
518
|
-
* @memberOf Hash
|
|
519
|
-
* @param {string} key The key of the value to get.
|
|
520
|
-
* @returns {*} Returns the entry value.
|
|
521
|
-
*/
|
|
522
|
-
function hashGet(key) {
|
|
523
|
-
var data = this.__data__;
|
|
524
|
-
if (_nativeCreate) {
|
|
525
|
-
var result = data[key];
|
|
526
|
-
return result === HASH_UNDEFINED$1 ? undefined : result;
|
|
527
|
-
}
|
|
528
|
-
return hasOwnProperty$1.call(data, key) ? data[key] : undefined;
|
|
529
|
-
}
|
|
530
|
-
|
|
531
|
-
var _hashGet = hashGet;
|
|
532
|
-
|
|
533
|
-
/** Used for built-in method references. */
|
|
534
|
-
var objectProto = Object.prototype;
|
|
535
|
-
|
|
536
|
-
/** Used to check objects for own properties. */
|
|
537
|
-
var hasOwnProperty = objectProto.hasOwnProperty;
|
|
538
|
-
|
|
539
|
-
/**
|
|
540
|
-
* Checks if a hash value for `key` exists.
|
|
541
|
-
*
|
|
542
|
-
* @private
|
|
543
|
-
* @name has
|
|
544
|
-
* @memberOf Hash
|
|
545
|
-
* @param {string} key The key of the entry to check.
|
|
546
|
-
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
|
|
547
|
-
*/
|
|
548
|
-
function hashHas(key) {
|
|
549
|
-
var data = this.__data__;
|
|
550
|
-
return _nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);
|
|
551
|
-
}
|
|
552
|
-
|
|
553
|
-
var _hashHas = hashHas;
|
|
554
|
-
|
|
555
|
-
/** Used to stand-in for `undefined` hash values. */
|
|
556
|
-
var HASH_UNDEFINED = '__lodash_hash_undefined__';
|
|
557
|
-
|
|
558
|
-
/**
|
|
559
|
-
* Sets the hash `key` to `value`.
|
|
560
|
-
*
|
|
561
|
-
* @private
|
|
562
|
-
* @name set
|
|
563
|
-
* @memberOf Hash
|
|
564
|
-
* @param {string} key The key of the value to set.
|
|
565
|
-
* @param {*} value The value to set.
|
|
566
|
-
* @returns {Object} Returns the hash instance.
|
|
567
|
-
*/
|
|
568
|
-
function hashSet(key, value) {
|
|
569
|
-
var data = this.__data__;
|
|
570
|
-
this.size += this.has(key) ? 0 : 1;
|
|
571
|
-
data[key] = (_nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
|
|
572
|
-
return this;
|
|
573
|
-
}
|
|
574
|
-
|
|
575
|
-
var _hashSet = hashSet;
|
|
576
|
-
|
|
577
|
-
/**
|
|
578
|
-
* Creates a hash object.
|
|
579
|
-
*
|
|
580
|
-
* @private
|
|
581
|
-
* @constructor
|
|
582
|
-
* @param {Array} [entries] The key-value pairs to cache.
|
|
583
|
-
*/
|
|
584
|
-
function Hash(entries) {
|
|
585
|
-
var index = -1,
|
|
586
|
-
length = entries == null ? 0 : entries.length;
|
|
587
|
-
|
|
588
|
-
this.clear();
|
|
589
|
-
while (++index < length) {
|
|
590
|
-
var entry = entries[index];
|
|
591
|
-
this.set(entry[0], entry[1]);
|
|
592
|
-
}
|
|
593
|
-
}
|
|
594
|
-
|
|
595
|
-
// Add methods to `Hash`.
|
|
596
|
-
Hash.prototype.clear = _hashClear;
|
|
597
|
-
Hash.prototype['delete'] = _hashDelete;
|
|
598
|
-
Hash.prototype.get = _hashGet;
|
|
599
|
-
Hash.prototype.has = _hashHas;
|
|
600
|
-
Hash.prototype.set = _hashSet;
|
|
601
|
-
|
|
602
|
-
var _Hash = Hash;
|
|
603
|
-
|
|
604
|
-
/**
|
|
605
|
-
* Removes all key-value entries from the list cache.
|
|
606
|
-
*
|
|
607
|
-
* @private
|
|
608
|
-
* @name clear
|
|
609
|
-
* @memberOf ListCache
|
|
610
|
-
*/
|
|
611
|
-
function listCacheClear() {
|
|
612
|
-
this.__data__ = [];
|
|
613
|
-
this.size = 0;
|
|
614
|
-
}
|
|
615
|
-
|
|
616
|
-
var _listCacheClear = listCacheClear;
|
|
617
|
-
|
|
618
|
-
/**
|
|
619
|
-
* Performs a
|
|
620
|
-
* [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
|
|
621
|
-
* comparison between two values to determine if they are equivalent.
|
|
622
|
-
*
|
|
623
|
-
* @static
|
|
624
|
-
* @memberOf _
|
|
625
|
-
* @since 4.0.0
|
|
626
|
-
* @category Lang
|
|
627
|
-
* @param {*} value The value to compare.
|
|
628
|
-
* @param {*} other The other value to compare.
|
|
629
|
-
* @returns {boolean} Returns `true` if the values are equivalent, else `false`.
|
|
630
|
-
* @example
|
|
631
|
-
*
|
|
632
|
-
* var object = { 'a': 1 };
|
|
633
|
-
* var other = { 'a': 1 };
|
|
634
|
-
*
|
|
635
|
-
* _.eq(object, object);
|
|
636
|
-
* // => true
|
|
637
|
-
*
|
|
638
|
-
* _.eq(object, other);
|
|
639
|
-
* // => false
|
|
640
|
-
*
|
|
641
|
-
* _.eq('a', 'a');
|
|
642
|
-
* // => true
|
|
643
|
-
*
|
|
644
|
-
* _.eq('a', Object('a'));
|
|
645
|
-
* // => false
|
|
646
|
-
*
|
|
647
|
-
* _.eq(NaN, NaN);
|
|
648
|
-
* // => true
|
|
649
|
-
*/
|
|
650
|
-
function eq(value, other) {
|
|
651
|
-
return value === other || (value !== value && other !== other);
|
|
652
|
-
}
|
|
653
|
-
|
|
654
|
-
var eq_1 = eq;
|
|
655
|
-
|
|
656
|
-
/**
|
|
657
|
-
* Gets the index at which the `key` is found in `array` of key-value pairs.
|
|
658
|
-
*
|
|
659
|
-
* @private
|
|
660
|
-
* @param {Array} array The array to inspect.
|
|
661
|
-
* @param {*} key The key to search for.
|
|
662
|
-
* @returns {number} Returns the index of the matched value, else `-1`.
|
|
663
|
-
*/
|
|
664
|
-
function assocIndexOf(array, key) {
|
|
665
|
-
var length = array.length;
|
|
666
|
-
while (length--) {
|
|
667
|
-
if (eq_1(array[length][0], key)) {
|
|
668
|
-
return length;
|
|
669
|
-
}
|
|
670
|
-
}
|
|
671
|
-
return -1;
|
|
672
|
-
}
|
|
673
|
-
|
|
674
|
-
var _assocIndexOf = assocIndexOf;
|
|
675
|
-
|
|
676
|
-
/** Used for built-in method references. */
|
|
677
|
-
var arrayProto = Array.prototype;
|
|
678
|
-
|
|
679
|
-
/** Built-in value references. */
|
|
680
|
-
var splice = arrayProto.splice;
|
|
681
|
-
|
|
682
|
-
/**
|
|
683
|
-
* Removes `key` and its value from the list cache.
|
|
684
|
-
*
|
|
685
|
-
* @private
|
|
686
|
-
* @name delete
|
|
687
|
-
* @memberOf ListCache
|
|
688
|
-
* @param {string} key The key of the value to remove.
|
|
689
|
-
* @returns {boolean} Returns `true` if the entry was removed, else `false`.
|
|
690
|
-
*/
|
|
691
|
-
function listCacheDelete(key) {
|
|
692
|
-
var data = this.__data__,
|
|
693
|
-
index = _assocIndexOf(data, key);
|
|
694
|
-
|
|
695
|
-
if (index < 0) {
|
|
696
|
-
return false;
|
|
697
|
-
}
|
|
698
|
-
var lastIndex = data.length - 1;
|
|
699
|
-
if (index == lastIndex) {
|
|
700
|
-
data.pop();
|
|
701
|
-
} else {
|
|
702
|
-
splice.call(data, index, 1);
|
|
703
|
-
}
|
|
704
|
-
--this.size;
|
|
705
|
-
return true;
|
|
706
|
-
}
|
|
707
|
-
|
|
708
|
-
var _listCacheDelete = listCacheDelete;
|
|
709
|
-
|
|
710
|
-
/**
|
|
711
|
-
* Gets the list cache value for `key`.
|
|
712
|
-
*
|
|
713
|
-
* @private
|
|
714
|
-
* @name get
|
|
715
|
-
* @memberOf ListCache
|
|
716
|
-
* @param {string} key The key of the value to get.
|
|
717
|
-
* @returns {*} Returns the entry value.
|
|
718
|
-
*/
|
|
719
|
-
function listCacheGet(key) {
|
|
720
|
-
var data = this.__data__,
|
|
721
|
-
index = _assocIndexOf(data, key);
|
|
722
|
-
|
|
723
|
-
return index < 0 ? undefined : data[index][1];
|
|
724
|
-
}
|
|
725
|
-
|
|
726
|
-
var _listCacheGet = listCacheGet;
|
|
727
|
-
|
|
728
|
-
/**
|
|
729
|
-
* Checks if a list cache value for `key` exists.
|
|
730
|
-
*
|
|
731
|
-
* @private
|
|
732
|
-
* @name has
|
|
733
|
-
* @memberOf ListCache
|
|
734
|
-
* @param {string} key The key of the entry to check.
|
|
735
|
-
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
|
|
736
|
-
*/
|
|
737
|
-
function listCacheHas(key) {
|
|
738
|
-
return _assocIndexOf(this.__data__, key) > -1;
|
|
739
|
-
}
|
|
740
|
-
|
|
741
|
-
var _listCacheHas = listCacheHas;
|
|
742
|
-
|
|
743
|
-
/**
|
|
744
|
-
* Sets the list cache `key` to `value`.
|
|
745
|
-
*
|
|
746
|
-
* @private
|
|
747
|
-
* @name set
|
|
748
|
-
* @memberOf ListCache
|
|
749
|
-
* @param {string} key The key of the value to set.
|
|
750
|
-
* @param {*} value The value to set.
|
|
751
|
-
* @returns {Object} Returns the list cache instance.
|
|
752
|
-
*/
|
|
753
|
-
function listCacheSet(key, value) {
|
|
754
|
-
var data = this.__data__,
|
|
755
|
-
index = _assocIndexOf(data, key);
|
|
756
|
-
|
|
757
|
-
if (index < 0) {
|
|
758
|
-
++this.size;
|
|
759
|
-
data.push([key, value]);
|
|
760
|
-
} else {
|
|
761
|
-
data[index][1] = value;
|
|
762
|
-
}
|
|
763
|
-
return this;
|
|
764
|
-
}
|
|
765
|
-
|
|
766
|
-
var _listCacheSet = listCacheSet;
|
|
767
|
-
|
|
768
|
-
/**
|
|
769
|
-
* Creates an list cache object.
|
|
770
|
-
*
|
|
771
|
-
* @private
|
|
772
|
-
* @constructor
|
|
773
|
-
* @param {Array} [entries] The key-value pairs to cache.
|
|
774
|
-
*/
|
|
775
|
-
function ListCache(entries) {
|
|
776
|
-
var index = -1,
|
|
777
|
-
length = entries == null ? 0 : entries.length;
|
|
778
|
-
|
|
779
|
-
this.clear();
|
|
780
|
-
while (++index < length) {
|
|
781
|
-
var entry = entries[index];
|
|
782
|
-
this.set(entry[0], entry[1]);
|
|
783
|
-
}
|
|
784
|
-
}
|
|
785
|
-
|
|
786
|
-
// Add methods to `ListCache`.
|
|
787
|
-
ListCache.prototype.clear = _listCacheClear;
|
|
788
|
-
ListCache.prototype['delete'] = _listCacheDelete;
|
|
789
|
-
ListCache.prototype.get = _listCacheGet;
|
|
790
|
-
ListCache.prototype.has = _listCacheHas;
|
|
791
|
-
ListCache.prototype.set = _listCacheSet;
|
|
792
|
-
|
|
793
|
-
var _ListCache = ListCache;
|
|
794
|
-
|
|
795
|
-
/* Built-in method references that are verified to be native. */
|
|
796
|
-
var Map = _getNative(_root, 'Map');
|
|
797
|
-
|
|
798
|
-
var _Map = Map;
|
|
799
|
-
|
|
800
|
-
/**
|
|
801
|
-
* Removes all key-value entries from the map.
|
|
802
|
-
*
|
|
803
|
-
* @private
|
|
804
|
-
* @name clear
|
|
805
|
-
* @memberOf MapCache
|
|
806
|
-
*/
|
|
807
|
-
function mapCacheClear() {
|
|
808
|
-
this.size = 0;
|
|
809
|
-
this.__data__ = {
|
|
810
|
-
'hash': new _Hash,
|
|
811
|
-
'map': new (_Map || _ListCache),
|
|
812
|
-
'string': new _Hash
|
|
813
|
-
};
|
|
814
|
-
}
|
|
815
|
-
|
|
816
|
-
var _mapCacheClear = mapCacheClear;
|
|
817
|
-
|
|
818
|
-
/**
|
|
819
|
-
* Checks if `value` is suitable for use as unique object key.
|
|
820
|
-
*
|
|
821
|
-
* @private
|
|
822
|
-
* @param {*} value The value to check.
|
|
823
|
-
* @returns {boolean} Returns `true` if `value` is suitable, else `false`.
|
|
824
|
-
*/
|
|
825
|
-
function isKeyable(value) {
|
|
826
|
-
var type = typeof value;
|
|
827
|
-
return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
|
|
828
|
-
? (value !== '__proto__')
|
|
829
|
-
: (value === null);
|
|
830
|
-
}
|
|
831
|
-
|
|
832
|
-
var _isKeyable = isKeyable;
|
|
833
|
-
|
|
834
|
-
/**
|
|
835
|
-
* Gets the data for `map`.
|
|
836
|
-
*
|
|
837
|
-
* @private
|
|
838
|
-
* @param {Object} map The map to query.
|
|
839
|
-
* @param {string} key The reference key.
|
|
840
|
-
* @returns {*} Returns the map data.
|
|
841
|
-
*/
|
|
842
|
-
function getMapData(map, key) {
|
|
843
|
-
var data = map.__data__;
|
|
844
|
-
return _isKeyable(key)
|
|
845
|
-
? data[typeof key == 'string' ? 'string' : 'hash']
|
|
846
|
-
: data.map;
|
|
847
|
-
}
|
|
848
|
-
|
|
849
|
-
var _getMapData = getMapData;
|
|
850
|
-
|
|
851
|
-
/**
|
|
852
|
-
* Removes `key` and its value from the map.
|
|
853
|
-
*
|
|
854
|
-
* @private
|
|
855
|
-
* @name delete
|
|
856
|
-
* @memberOf MapCache
|
|
857
|
-
* @param {string} key The key of the value to remove.
|
|
858
|
-
* @returns {boolean} Returns `true` if the entry was removed, else `false`.
|
|
859
|
-
*/
|
|
860
|
-
function mapCacheDelete(key) {
|
|
861
|
-
var result = _getMapData(this, key)['delete'](key);
|
|
862
|
-
this.size -= result ? 1 : 0;
|
|
863
|
-
return result;
|
|
864
|
-
}
|
|
865
|
-
|
|
866
|
-
var _mapCacheDelete = mapCacheDelete;
|
|
867
|
-
|
|
868
|
-
/**
|
|
869
|
-
* Gets the map value for `key`.
|
|
870
|
-
*
|
|
871
|
-
* @private
|
|
872
|
-
* @name get
|
|
873
|
-
* @memberOf MapCache
|
|
874
|
-
* @param {string} key The key of the value to get.
|
|
875
|
-
* @returns {*} Returns the entry value.
|
|
876
|
-
*/
|
|
877
|
-
function mapCacheGet(key) {
|
|
878
|
-
return _getMapData(this, key).get(key);
|
|
879
|
-
}
|
|
880
|
-
|
|
881
|
-
var _mapCacheGet = mapCacheGet;
|
|
882
|
-
|
|
883
|
-
/**
|
|
884
|
-
* Checks if a map value for `key` exists.
|
|
885
|
-
*
|
|
886
|
-
* @private
|
|
887
|
-
* @name has
|
|
888
|
-
* @memberOf MapCache
|
|
889
|
-
* @param {string} key The key of the entry to check.
|
|
890
|
-
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
|
|
891
|
-
*/
|
|
892
|
-
function mapCacheHas(key) {
|
|
893
|
-
return _getMapData(this, key).has(key);
|
|
894
|
-
}
|
|
895
|
-
|
|
896
|
-
var _mapCacheHas = mapCacheHas;
|
|
897
|
-
|
|
898
|
-
/**
|
|
899
|
-
* Sets the map `key` to `value`.
|
|
900
|
-
*
|
|
901
|
-
* @private
|
|
902
|
-
* @name set
|
|
903
|
-
* @memberOf MapCache
|
|
904
|
-
* @param {string} key The key of the value to set.
|
|
905
|
-
* @param {*} value The value to set.
|
|
906
|
-
* @returns {Object} Returns the map cache instance.
|
|
907
|
-
*/
|
|
908
|
-
function mapCacheSet(key, value) {
|
|
909
|
-
var data = _getMapData(this, key),
|
|
910
|
-
size = data.size;
|
|
911
|
-
|
|
912
|
-
data.set(key, value);
|
|
913
|
-
this.size += data.size == size ? 0 : 1;
|
|
914
|
-
return this;
|
|
915
|
-
}
|
|
916
|
-
|
|
917
|
-
var _mapCacheSet = mapCacheSet;
|
|
918
|
-
|
|
919
|
-
/**
|
|
920
|
-
* Creates a map cache object to store key-value pairs.
|
|
921
|
-
*
|
|
922
|
-
* @private
|
|
923
|
-
* @constructor
|
|
924
|
-
* @param {Array} [entries] The key-value pairs to cache.
|
|
925
|
-
*/
|
|
926
|
-
function MapCache(entries) {
|
|
927
|
-
var index = -1,
|
|
928
|
-
length = entries == null ? 0 : entries.length;
|
|
929
|
-
|
|
930
|
-
this.clear();
|
|
931
|
-
while (++index < length) {
|
|
932
|
-
var entry = entries[index];
|
|
933
|
-
this.set(entry[0], entry[1]);
|
|
934
|
-
}
|
|
935
|
-
}
|
|
936
|
-
|
|
937
|
-
// Add methods to `MapCache`.
|
|
938
|
-
MapCache.prototype.clear = _mapCacheClear;
|
|
939
|
-
MapCache.prototype['delete'] = _mapCacheDelete;
|
|
940
|
-
MapCache.prototype.get = _mapCacheGet;
|
|
941
|
-
MapCache.prototype.has = _mapCacheHas;
|
|
942
|
-
MapCache.prototype.set = _mapCacheSet;
|
|
943
|
-
|
|
944
|
-
var _MapCache = MapCache;
|
|
945
|
-
|
|
946
|
-
/** Error message constants. */
|
|
947
|
-
var FUNC_ERROR_TEXT = 'Expected a function';
|
|
948
|
-
|
|
949
|
-
/**
|
|
950
|
-
* Creates a function that memoizes the result of `func`. If `resolver` is
|
|
951
|
-
* provided, it determines the cache key for storing the result based on the
|
|
952
|
-
* arguments provided to the memoized function. By default, the first argument
|
|
953
|
-
* provided to the memoized function is used as the map cache key. The `func`
|
|
954
|
-
* is invoked with the `this` binding of the memoized function.
|
|
955
|
-
*
|
|
956
|
-
* **Note:** The cache is exposed as the `cache` property on the memoized
|
|
957
|
-
* function. Its creation may be customized by replacing the `_.memoize.Cache`
|
|
958
|
-
* constructor with one whose instances implement the
|
|
959
|
-
* [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
|
|
960
|
-
* method interface of `clear`, `delete`, `get`, `has`, and `set`.
|
|
961
|
-
*
|
|
962
|
-
* @static
|
|
963
|
-
* @memberOf _
|
|
964
|
-
* @since 0.1.0
|
|
965
|
-
* @category Function
|
|
966
|
-
* @param {Function} func The function to have its output memoized.
|
|
967
|
-
* @param {Function} [resolver] The function to resolve the cache key.
|
|
968
|
-
* @returns {Function} Returns the new memoized function.
|
|
969
|
-
* @example
|
|
970
|
-
*
|
|
971
|
-
* var object = { 'a': 1, 'b': 2 };
|
|
972
|
-
* var other = { 'c': 3, 'd': 4 };
|
|
973
|
-
*
|
|
974
|
-
* var values = _.memoize(_.values);
|
|
975
|
-
* values(object);
|
|
976
|
-
* // => [1, 2]
|
|
977
|
-
*
|
|
978
|
-
* values(other);
|
|
979
|
-
* // => [3, 4]
|
|
980
|
-
*
|
|
981
|
-
* object.a = 2;
|
|
982
|
-
* values(object);
|
|
983
|
-
* // => [1, 2]
|
|
984
|
-
*
|
|
985
|
-
* // Modify the result cache.
|
|
986
|
-
* values.cache.set(object, ['a', 'b']);
|
|
987
|
-
* values(object);
|
|
988
|
-
* // => ['a', 'b']
|
|
989
|
-
*
|
|
990
|
-
* // Replace `_.memoize.Cache`.
|
|
991
|
-
* _.memoize.Cache = WeakMap;
|
|
992
|
-
*/
|
|
993
|
-
function memoize(func, resolver) {
|
|
994
|
-
if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) {
|
|
995
|
-
throw new TypeError(FUNC_ERROR_TEXT);
|
|
996
|
-
}
|
|
997
|
-
var memoized = function() {
|
|
998
|
-
var args = arguments,
|
|
999
|
-
key = resolver ? resolver.apply(this, args) : args[0],
|
|
1000
|
-
cache = memoized.cache;
|
|
1001
|
-
|
|
1002
|
-
if (cache.has(key)) {
|
|
1003
|
-
return cache.get(key);
|
|
1004
|
-
}
|
|
1005
|
-
var result = func.apply(this, args);
|
|
1006
|
-
memoized.cache = cache.set(key, result) || cache;
|
|
1007
|
-
return result;
|
|
1008
|
-
};
|
|
1009
|
-
memoized.cache = new (memoize.Cache || _MapCache);
|
|
1010
|
-
return memoized;
|
|
1011
|
-
}
|
|
1012
|
-
|
|
1013
|
-
// Expose `MapCache`.
|
|
1014
|
-
memoize.Cache = _MapCache;
|
|
1015
|
-
|
|
1016
|
-
var memoize_1 = memoize;
|
|
1017
|
-
|
|
1018
|
-
/** Used as the maximum memoize cache size. */
|
|
1019
|
-
var MAX_MEMOIZE_SIZE = 500;
|
|
1020
|
-
|
|
1021
|
-
/**
|
|
1022
|
-
* A specialized version of `_.memoize` which clears the memoized function's
|
|
1023
|
-
* cache when it exceeds `MAX_MEMOIZE_SIZE`.
|
|
1024
|
-
*
|
|
1025
|
-
* @private
|
|
1026
|
-
* @param {Function} func The function to have its output memoized.
|
|
1027
|
-
* @returns {Function} Returns the new memoized function.
|
|
1028
|
-
*/
|
|
1029
|
-
function memoizeCapped(func) {
|
|
1030
|
-
var result = memoize_1(func, function(key) {
|
|
1031
|
-
if (cache.size === MAX_MEMOIZE_SIZE) {
|
|
1032
|
-
cache.clear();
|
|
1033
|
-
}
|
|
1034
|
-
return key;
|
|
1035
|
-
});
|
|
1036
|
-
|
|
1037
|
-
var cache = result.cache;
|
|
1038
|
-
return result;
|
|
1039
|
-
}
|
|
1040
|
-
|
|
1041
|
-
var _memoizeCapped = memoizeCapped;
|
|
1042
|
-
|
|
1043
|
-
/** Used to match property names within property paths. */
|
|
1044
|
-
var rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
|
|
1045
|
-
|
|
1046
|
-
/** Used to match backslashes in property paths. */
|
|
1047
|
-
var reEscapeChar = /\\(\\)?/g;
|
|
1048
|
-
|
|
1049
|
-
/**
|
|
1050
|
-
* Converts `string` to a property path array.
|
|
1051
|
-
*
|
|
1052
|
-
* @private
|
|
1053
|
-
* @param {string} string The string to convert.
|
|
1054
|
-
* @returns {Array} Returns the property path array.
|
|
1055
|
-
*/
|
|
1056
|
-
var stringToPath = _memoizeCapped(function(string) {
|
|
1057
|
-
var result = [];
|
|
1058
|
-
if (string.charCodeAt(0) === 46 /* . */) {
|
|
1059
|
-
result.push('');
|
|
1060
|
-
}
|
|
1061
|
-
string.replace(rePropName, function(match, number, quote, subString) {
|
|
1062
|
-
result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match));
|
|
1063
|
-
});
|
|
1064
|
-
return result;
|
|
1065
|
-
});
|
|
1066
|
-
|
|
1067
|
-
var _stringToPath = stringToPath;
|
|
1068
|
-
|
|
1069
|
-
/**
|
|
1070
|
-
* A specialized version of `_.map` for arrays without support for iteratee
|
|
1071
|
-
* shorthands.
|
|
1072
|
-
*
|
|
1073
|
-
* @private
|
|
1074
|
-
* @param {Array} [array] The array to iterate over.
|
|
1075
|
-
* @param {Function} iteratee The function invoked per iteration.
|
|
1076
|
-
* @returns {Array} Returns the new mapped array.
|
|
1077
|
-
*/
|
|
1078
|
-
function arrayMap(array, iteratee) {
|
|
1079
|
-
var index = -1,
|
|
1080
|
-
length = array == null ? 0 : array.length,
|
|
1081
|
-
result = Array(length);
|
|
1082
|
-
|
|
1083
|
-
while (++index < length) {
|
|
1084
|
-
result[index] = iteratee(array[index], index, array);
|
|
1085
|
-
}
|
|
1086
|
-
return result;
|
|
1087
|
-
}
|
|
1088
|
-
|
|
1089
|
-
var _arrayMap = arrayMap;
|
|
1090
|
-
|
|
1091
|
-
/** Used as references for various `Number` constants. */
|
|
1092
|
-
var INFINITY$1 = 1 / 0;
|
|
1093
|
-
|
|
1094
|
-
/** Used to convert symbols to primitives and strings. */
|
|
1095
|
-
var symbolProto = _Symbol ? _Symbol.prototype : undefined,
|
|
1096
|
-
symbolToString = symbolProto ? symbolProto.toString : undefined;
|
|
1097
|
-
|
|
1098
|
-
/**
|
|
1099
|
-
* The base implementation of `_.toString` which doesn't convert nullish
|
|
1100
|
-
* values to empty strings.
|
|
1101
|
-
*
|
|
1102
|
-
* @private
|
|
1103
|
-
* @param {*} value The value to process.
|
|
1104
|
-
* @returns {string} Returns the string.
|
|
1105
|
-
*/
|
|
1106
|
-
function baseToString(value) {
|
|
1107
|
-
// Exit early for strings to avoid a performance hit in some environments.
|
|
1108
|
-
if (typeof value == 'string') {
|
|
1109
|
-
return value;
|
|
1110
|
-
}
|
|
1111
|
-
if (isArray_1(value)) {
|
|
1112
|
-
// Recursively convert values (susceptible to call stack limits).
|
|
1113
|
-
return _arrayMap(value, baseToString) + '';
|
|
1114
|
-
}
|
|
1115
|
-
if (isSymbol_1(value)) {
|
|
1116
|
-
return symbolToString ? symbolToString.call(value) : '';
|
|
1117
|
-
}
|
|
1118
|
-
var result = (value + '');
|
|
1119
|
-
return (result == '0' && (1 / value) == -INFINITY$1) ? '-0' : result;
|
|
1120
|
-
}
|
|
1121
|
-
|
|
1122
|
-
var _baseToString = baseToString;
|
|
1123
|
-
|
|
1124
|
-
/**
|
|
1125
|
-
* Converts `value` to a string. An empty string is returned for `null`
|
|
1126
|
-
* and `undefined` values. The sign of `-0` is preserved.
|
|
1127
|
-
*
|
|
1128
|
-
* @static
|
|
1129
|
-
* @memberOf _
|
|
1130
|
-
* @since 4.0.0
|
|
1131
|
-
* @category Lang
|
|
1132
|
-
* @param {*} value The value to convert.
|
|
1133
|
-
* @returns {string} Returns the converted string.
|
|
1134
|
-
* @example
|
|
1135
|
-
*
|
|
1136
|
-
* _.toString(null);
|
|
1137
|
-
* // => ''
|
|
1138
|
-
*
|
|
1139
|
-
* _.toString(-0);
|
|
1140
|
-
* // => '-0'
|
|
1141
|
-
*
|
|
1142
|
-
* _.toString([1, 2, 3]);
|
|
1143
|
-
* // => '1,2,3'
|
|
1144
|
-
*/
|
|
1145
|
-
function toString(value) {
|
|
1146
|
-
return value == null ? '' : _baseToString(value);
|
|
1147
|
-
}
|
|
1148
|
-
|
|
1149
|
-
var toString_1 = toString;
|
|
1150
|
-
|
|
1151
|
-
/**
|
|
1152
|
-
* Casts `value` to a path array if it's not one.
|
|
1153
|
-
*
|
|
1154
|
-
* @private
|
|
1155
|
-
* @param {*} value The value to inspect.
|
|
1156
|
-
* @param {Object} [object] The object to query keys on.
|
|
1157
|
-
* @returns {Array} Returns the cast property path array.
|
|
1158
|
-
*/
|
|
1159
|
-
function castPath(value, object) {
|
|
1160
|
-
if (isArray_1(value)) {
|
|
1161
|
-
return value;
|
|
1162
|
-
}
|
|
1163
|
-
return _isKey(value, object) ? [value] : _stringToPath(toString_1(value));
|
|
1164
|
-
}
|
|
1165
|
-
|
|
1166
|
-
var _castPath = castPath;
|
|
1167
|
-
|
|
1168
|
-
/** Used as references for various `Number` constants. */
|
|
1169
|
-
var INFINITY = 1 / 0;
|
|
1170
|
-
|
|
1171
|
-
/**
|
|
1172
|
-
* Converts `value` to a string key if it's not a string or symbol.
|
|
1173
|
-
*
|
|
1174
|
-
* @private
|
|
1175
|
-
* @param {*} value The value to inspect.
|
|
1176
|
-
* @returns {string|symbol} Returns the key.
|
|
1177
|
-
*/
|
|
1178
|
-
function toKey(value) {
|
|
1179
|
-
if (typeof value == 'string' || isSymbol_1(value)) {
|
|
1180
|
-
return value;
|
|
1181
|
-
}
|
|
1182
|
-
var result = (value + '');
|
|
1183
|
-
return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
|
|
1184
|
-
}
|
|
1185
|
-
|
|
1186
|
-
var _toKey = toKey;
|
|
1187
|
-
|
|
1188
|
-
/**
|
|
1189
|
-
* The base implementation of `_.get` without support for default values.
|
|
1190
|
-
*
|
|
1191
|
-
* @private
|
|
1192
|
-
* @param {Object} object The object to query.
|
|
1193
|
-
* @param {Array|string} path The path of the property to get.
|
|
1194
|
-
* @returns {*} Returns the resolved value.
|
|
1195
|
-
*/
|
|
1196
|
-
function baseGet(object, path) {
|
|
1197
|
-
path = _castPath(path, object);
|
|
1198
|
-
|
|
1199
|
-
var index = 0,
|
|
1200
|
-
length = path.length;
|
|
1201
|
-
|
|
1202
|
-
while (object != null && index < length) {
|
|
1203
|
-
object = object[_toKey(path[index++])];
|
|
1204
|
-
}
|
|
1205
|
-
return (index && index == length) ? object : undefined;
|
|
1206
|
-
}
|
|
1207
|
-
|
|
1208
|
-
var _baseGet = baseGet;
|
|
1209
|
-
|
|
1210
|
-
/**
|
|
1211
|
-
* Gets the value at `path` of `object`. If the resolved value is
|
|
1212
|
-
* `undefined`, the `defaultValue` is returned in its place.
|
|
1213
|
-
*
|
|
1214
|
-
* @static
|
|
1215
|
-
* @memberOf _
|
|
1216
|
-
* @since 3.7.0
|
|
1217
|
-
* @category Object
|
|
1218
|
-
* @param {Object} object The object to query.
|
|
1219
|
-
* @param {Array|string} path The path of the property to get.
|
|
1220
|
-
* @param {*} [defaultValue] The value returned for `undefined` resolved values.
|
|
1221
|
-
* @returns {*} Returns the resolved value.
|
|
1222
|
-
* @example
|
|
1223
|
-
*
|
|
1224
|
-
* var object = { 'a': [{ 'b': { 'c': 3 } }] };
|
|
1225
|
-
*
|
|
1226
|
-
* _.get(object, 'a[0].b.c');
|
|
1227
|
-
* // => 3
|
|
1228
|
-
*
|
|
1229
|
-
* _.get(object, ['a', '0', 'b', 'c']);
|
|
1230
|
-
* // => 3
|
|
1231
|
-
*
|
|
1232
|
-
* _.get(object, 'a.b.c', 'default');
|
|
1233
|
-
* // => 'default'
|
|
1234
|
-
*/
|
|
1235
|
-
function get(object, path, defaultValue) {
|
|
1236
|
-
var result = object == null ? undefined : _baseGet(object, path);
|
|
1237
|
-
return result === undefined ? defaultValue : result;
|
|
1238
|
-
}
|
|
1239
|
-
|
|
1240
|
-
var get_1 = get;
|
|
1241
|
-
|
|
1242
|
-
function _iterableToArrayLimit(arr, i) {
|
|
1243
|
-
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
1244
|
-
|
|
1245
|
-
if (_i == null) return;
|
|
1246
|
-
var _arr = [];
|
|
1247
|
-
var _n = true;
|
|
1248
|
-
var _d = false;
|
|
1249
|
-
|
|
1250
|
-
var _s, _e;
|
|
1251
|
-
|
|
1252
|
-
try {
|
|
1253
|
-
for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {
|
|
1254
|
-
_arr.push(_s.value);
|
|
1255
|
-
|
|
1256
|
-
if (i && _arr.length === i) break;
|
|
1257
|
-
}
|
|
1258
|
-
} catch (err) {
|
|
1259
|
-
_d = true;
|
|
1260
|
-
_e = err;
|
|
1261
|
-
} finally {
|
|
1262
|
-
try {
|
|
1263
|
-
if (!_n && _i["return"] != null) _i["return"]();
|
|
1264
|
-
} finally {
|
|
1265
|
-
if (_d) throw _e;
|
|
1266
|
-
}
|
|
1267
|
-
}
|
|
1268
|
-
|
|
1269
|
-
return _arr;
|
|
1270
|
-
}
|
|
1271
|
-
|
|
1272
|
-
function _slicedToArray(arr, i) {
|
|
1273
|
-
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
|
|
1274
|
-
}
|
|
1275
|
-
|
|
1276
|
-
var optionsDefaults_1 = createCommonjsModule(function (module, exports) {
|
|
1277
|
-
|
|
1278
|
-
Object.defineProperty(exports, "__esModule", {
|
|
1279
|
-
value: true
|
|
1280
|
-
});
|
|
1281
|
-
exports["default"] = void 0;
|
|
1282
|
-
var optionsDefaults = {
|
|
1283
|
-
attributeNames: {
|
|
1284
|
-
styleName: 'className'
|
|
1285
|
-
},
|
|
1286
|
-
generateScopedName: '[path]___[name]__[local]___[hash:base64:5]',
|
|
1287
|
-
handleMissingStyleName: 'throw'
|
|
1288
|
-
};
|
|
1289
|
-
var _default = optionsDefaults;
|
|
1290
|
-
exports["default"] = _default;
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
});
|
|
1294
|
-
|
|
1295
|
-
var getClassName = createCommonjsModule(function (module, exports) {
|
|
1296
|
-
|
|
1297
|
-
Object.defineProperty(exports, "__esModule", {
|
|
1298
|
-
value: true
|
|
1299
|
-
});
|
|
1300
|
-
exports["default"] = void 0;
|
|
1301
|
-
|
|
1302
|
-
var _optionsDefaults = _interopRequireDefault(optionsDefaults_1);
|
|
1303
|
-
|
|
1304
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
1305
|
-
|
|
1306
|
-
var isNamespacedStyleName = function isNamespacedStyleName(styleName) {
|
|
1307
|
-
return styleName.indexOf('.') !== -1;
|
|
1308
|
-
};
|
|
1309
|
-
|
|
1310
|
-
var handleError = function handleError(message, handleMissingStyleName) {
|
|
1311
|
-
if (handleMissingStyleName === 'throw') {
|
|
1312
|
-
throw new Error(message);
|
|
1313
|
-
} else if (handleMissingStyleName === 'warn') {
|
|
1314
|
-
// eslint-disable-next-line no-console
|
|
1315
|
-
console.warn(message);
|
|
1316
|
-
}
|
|
1317
|
-
|
|
1318
|
-
return null;
|
|
1319
|
-
};
|
|
1320
|
-
|
|
1321
|
-
var getClassNameForNamespacedStyleName = function getClassNameForNamespacedStyleName(styleName, styleModuleImportMap, handleMissingStyleNameOption) {
|
|
1322
|
-
// Note:
|
|
1323
|
-
// Do not use the desctructing syntax with Babel.
|
|
1324
|
-
// Desctructing adds _slicedToArray helper.
|
|
1325
|
-
var styleNameParts = styleName.split('.');
|
|
1326
|
-
var importName = styleNameParts[0];
|
|
1327
|
-
var moduleName = styleNameParts[1];
|
|
1328
|
-
var handleMissingStyleName = handleMissingStyleNameOption || _optionsDefaults["default"].handleMissingStyleName;
|
|
1329
|
-
|
|
1330
|
-
if (!moduleName) {
|
|
1331
|
-
return handleError('Invalid style name: ' + styleName, handleMissingStyleName);
|
|
1332
|
-
}
|
|
1333
|
-
|
|
1334
|
-
if (!styleModuleImportMap[importName]) {
|
|
1335
|
-
return handleError('CSS module import does not exist: ' + importName, handleMissingStyleName);
|
|
1336
|
-
}
|
|
1337
|
-
|
|
1338
|
-
if (!styleModuleImportMap[importName][moduleName]) {
|
|
1339
|
-
return handleError('CSS module does not exist: ' + moduleName, handleMissingStyleName);
|
|
1340
|
-
}
|
|
1341
|
-
|
|
1342
|
-
return styleModuleImportMap[importName][moduleName];
|
|
1343
|
-
};
|
|
1344
|
-
|
|
1345
|
-
var getClassNameFromMultipleImports = function getClassNameFromMultipleImports(styleName, styleModuleImportMap, handleMissingStyleNameOption) {
|
|
1346
|
-
var handleMissingStyleName = handleMissingStyleNameOption || _optionsDefaults["default"].handleMissingStyleName;
|
|
1347
|
-
var importKeysWithMatches = Object.keys(styleModuleImportMap).map(function (importKey) {
|
|
1348
|
-
return styleModuleImportMap[importKey][styleName] && importKey;
|
|
1349
|
-
}).filter(function (importKey) {
|
|
1350
|
-
return importKey;
|
|
1351
|
-
});
|
|
1352
|
-
|
|
1353
|
-
if (importKeysWithMatches.length > 1) {
|
|
1354
|
-
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');
|
|
1355
|
-
}
|
|
1356
|
-
|
|
1357
|
-
if (importKeysWithMatches.length === 0) {
|
|
1358
|
-
return handleError('Could not resolve the styleName \'' + styleName + '\'.', handleMissingStyleName);
|
|
1359
|
-
}
|
|
1360
|
-
|
|
1361
|
-
return styleModuleImportMap[importKeysWithMatches[0]][styleName];
|
|
1362
|
-
};
|
|
1363
|
-
|
|
1364
|
-
var _default = function _default(styleNameValue, styleModuleImportMap, options) {
|
|
1365
|
-
var styleModuleImportMapKeys = Object.keys(styleModuleImportMap);
|
|
1366
|
-
|
|
1367
|
-
var _ref = options || {},
|
|
1368
|
-
_ref$handleMissingSty = _ref.handleMissingStyleName,
|
|
1369
|
-
handleMissingStyleName = _ref$handleMissingSty === void 0 ? _optionsDefaults["default"].handleMissingStyleName : _ref$handleMissingSty,
|
|
1370
|
-
_ref$autoResolveMulti = _ref.autoResolveMultipleImports,
|
|
1371
|
-
autoResolveMultipleImports = _ref$autoResolveMulti === void 0 ? _optionsDefaults["default"].autoResolveMultipleImports : _ref$autoResolveMulti;
|
|
1372
|
-
|
|
1373
|
-
if (!styleNameValue) {
|
|
1374
|
-
return '';
|
|
1375
|
-
}
|
|
1376
|
-
|
|
1377
|
-
return styleNameValue.split(' ').filter(function (styleName) {
|
|
1378
|
-
return styleName;
|
|
1379
|
-
}).map(function (styleName) {
|
|
1380
|
-
if (isNamespacedStyleName(styleName)) {
|
|
1381
|
-
return getClassNameForNamespacedStyleName(styleName, styleModuleImportMap, handleMissingStyleName);
|
|
1382
|
-
}
|
|
1383
|
-
|
|
1384
|
-
if (styleModuleImportMapKeys.length === 0) {
|
|
1385
|
-
throw new Error('Cannot use styleName attribute for style name \'' + styleName + '\' without importing at least one stylesheet.');
|
|
1386
|
-
}
|
|
1387
|
-
|
|
1388
|
-
if (styleModuleImportMapKeys.length > 1) {
|
|
1389
|
-
if (!autoResolveMultipleImports) {
|
|
1390
|
-
throw new Error('Cannot use anonymous style name \'' + styleName + '\' with more than one stylesheet import without setting \'autoResolveMultipleImports\' to true.');
|
|
1391
|
-
}
|
|
1392
|
-
|
|
1393
|
-
return getClassNameFromMultipleImports(styleName, styleModuleImportMap, handleMissingStyleName);
|
|
1394
|
-
}
|
|
1395
|
-
|
|
1396
|
-
var styleModuleMap = styleModuleImportMap[styleModuleImportMapKeys[0]];
|
|
1397
|
-
|
|
1398
|
-
if (!styleModuleMap[styleName]) {
|
|
1399
|
-
return handleError('Could not resolve the styleName \'' + styleName + '\'.', handleMissingStyleName);
|
|
1400
|
-
}
|
|
1401
|
-
|
|
1402
|
-
return styleModuleMap[styleName];
|
|
1403
|
-
}).filter(function (className) {
|
|
1404
|
-
// Remove any styles which could not be found (if handleMissingStyleName === 'ignore')
|
|
1405
|
-
return className;
|
|
1406
|
-
}).join(' ');
|
|
1407
|
-
};
|
|
1408
|
-
|
|
1409
|
-
exports["default"] = _default;
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
});
|
|
1413
|
-
|
|
1414
|
-
var _getClassName = /*@__PURE__*/getDefaultExportFromCjs(getClassName);
|
|
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 React = require('react');
|
|
7
|
+
var PropTypes = require('prop-types');
|
|
8
|
+
var lodash = require('lodash');
|
|
9
|
+
var components = require('@quintype/components');
|
|
10
|
+
var _slicedToArray = require('@babel/runtime/helpers/slicedToArray');
|
|
11
|
+
var _getClassName = require('babel-plugin-react-css-modules/dist/browser/getClassName');
|
|
12
|
+
var reactRedux = require('react-redux');
|
|
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
|
+
|
|
19
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
20
|
+
|
|
21
|
+
var _toArray__default = /*#__PURE__*/_interopDefaultLegacy(_toArray);
|
|
22
|
+
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
23
|
+
var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
|
|
24
|
+
var _slicedToArray__default = /*#__PURE__*/_interopDefaultLegacy(_slicedToArray);
|
|
25
|
+
var _getClassName__default = /*#__PURE__*/_interopDefaultLegacy(_getClassName);
|
|
26
|
+
var _typeof__default = /*#__PURE__*/_interopDefaultLegacy(_typeof);
|
|
27
|
+
var Timeago__default = /*#__PURE__*/_interopDefaultLegacy(Timeago);
|
|
2542
28
|
|
|
2543
29
|
function truncate() {
|
|
2544
30
|
var string = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "";
|
|
@@ -2566,7 +52,7 @@ var timestampToFormat = function timestampToFormat(value, unit, suffix, timestam
|
|
|
2566
52
|
var localizedMonth = month;
|
|
2567
53
|
|
|
2568
54
|
if (isUpperCase) {
|
|
2569
|
-
localizedMonth =
|
|
55
|
+
localizedMonth = lodash.upperCase(month);
|
|
2570
56
|
}
|
|
2571
57
|
|
|
2572
58
|
var year = dateTime.getFullYear();
|
|
@@ -2579,7 +65,7 @@ var timestampToFormat = function timestampToFormat(value, unit, suffix, timestam
|
|
|
2579
65
|
var timetoShow;
|
|
2580
66
|
|
|
2581
67
|
if (localizedMonths) {
|
|
2582
|
-
localizedMonth =
|
|
68
|
+
localizedMonth = lodash.get(localizedMonths, [lodash.lowerCase(month)]) || month;
|
|
2583
69
|
}
|
|
2584
70
|
|
|
2585
71
|
if (localizedMeridiem) {
|
|
@@ -2609,17 +95,17 @@ function formatter(value, unit, suffix, date, config) {
|
|
|
2609
95
|
var showDateForUnits = ["day", "week", "month", "year"]; // suffix here refers to ago
|
|
2610
96
|
// unit here refers to seconds, minute, minutes,...
|
|
2611
97
|
|
|
2612
|
-
var localizedSuffix =
|
|
98
|
+
var localizedSuffix = lodash.get(config, ["localizedPublishTime", suffix]) || suffix;
|
|
2613
99
|
var localizedUnitOfTime;
|
|
2614
100
|
|
|
2615
101
|
if (unit === "hour" && value > 23 || showDateForUnits.indexOf(unit) !== -1) {
|
|
2616
102
|
return timestampToFormat(value, unit, suffix, date, config);
|
|
2617
103
|
} else if (value > 1) {
|
|
2618
|
-
localizedUnitOfTime =
|
|
104
|
+
localizedUnitOfTime = lodash.get(config, ["localizedPublishTime", "".concat(unit, "s")]) || "".concat(unit, "s");
|
|
2619
105
|
return "".concat(value, " ").concat(localizedUnitOfTime, " ").concat(localizedSuffix);
|
|
2620
106
|
}
|
|
2621
107
|
|
|
2622
|
-
localizedUnitOfTime =
|
|
108
|
+
localizedUnitOfTime = lodash.get(config, ["localizedPublishTime", unit]) || unit;
|
|
2623
109
|
return "".concat(value, " ").concat(localizedUnitOfTime, " ").concat(localizedSuffix, " ");
|
|
2624
110
|
}
|
|
2625
111
|
|
|
@@ -2672,10 +158,10 @@ var clientWidths = {
|
|
|
2672
158
|
tablet: 1024
|
|
2673
159
|
};
|
|
2674
160
|
var clientWidth = function clientWidth(device) {
|
|
2675
|
-
var foundDeviceWidth =
|
|
161
|
+
var foundDeviceWidth = lodash.get(clientWidths, device);
|
|
2676
162
|
|
|
2677
163
|
if (foundDeviceWidth) {
|
|
2678
|
-
return
|
|
164
|
+
return lodash.get(global, "document.documentElement.clientWidth") <= foundDeviceWidth;
|
|
2679
165
|
}
|
|
2680
166
|
|
|
2681
167
|
return false;
|
|
@@ -2705,7 +191,7 @@ var getSlug = function getSlug(collection) {
|
|
|
2705
191
|
var isSection = collection.template === "section";
|
|
2706
192
|
|
|
2707
193
|
if (isSection) {
|
|
2708
|
-
var sectionId =
|
|
194
|
+
var sectionId = lodash.get(collection, ["metadata", "section", "0", "id"], "");
|
|
2709
195
|
var sections = config.sections;
|
|
2710
196
|
var section = sections && sections.find(function (section) {
|
|
2711
197
|
return section.id === sectionId;
|
|
@@ -2721,25 +207,25 @@ function isExternalStory() {
|
|
|
2721
207
|
storyTemplate = _story$storyTemplate === void 0 ? "" : _story$storyTemplate,
|
|
2722
208
|
_story$metadata = story.metadata,
|
|
2723
209
|
metadata = _story$metadata === void 0 ? {} : _story$metadata;
|
|
2724
|
-
return storyTemplate === "news-elsewhere" ?
|
|
210
|
+
return storyTemplate === "news-elsewhere" ? lodash.get(metadata, ["reference-url"], "") : "";
|
|
2725
211
|
} // Adds target='_blank' attribute to anchor tags if not present
|
|
2726
212
|
var isEmpty = function isEmpty(value) {
|
|
2727
213
|
return value == null || // From standard.js: Always use === - but value == null is allowed to check null || undefined
|
|
2728
|
-
|
|
214
|
+
_typeof__default["default"](value) === "object" && Object.entries(value).length === 0 && value.constructor === Object || typeof value === "string" && value.trim().length === 0;
|
|
2729
215
|
};
|
|
2730
|
-
|
|
2731
|
-
"sketches-host":
|
|
2732
|
-
"cdn-name":
|
|
2733
|
-
"cdn-image":
|
|
216
|
+
PropTypes__default["default"].shape({
|
|
217
|
+
"sketches-host": PropTypes__default["default"].string,
|
|
218
|
+
"cdn-name": PropTypes__default["default"].string,
|
|
219
|
+
"cdn-image": PropTypes__default["default"].string
|
|
2734
220
|
});
|
|
2735
|
-
|
|
2736
|
-
headline:
|
|
2737
|
-
"last-published-at":
|
|
2738
|
-
subheadline:
|
|
221
|
+
PropTypes__default["default"].shape({
|
|
222
|
+
headline: PropTypes__default["default"].string,
|
|
223
|
+
"last-published-at": PropTypes__default["default"].number,
|
|
224
|
+
subheadline: PropTypes__default["default"].string
|
|
2739
225
|
});
|
|
2740
226
|
var getStoryUrl = function getStoryUrl(story) {
|
|
2741
227
|
var defaultValue = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "";
|
|
2742
|
-
return
|
|
228
|
+
return lodash.get(story, ["story-template"]) === "news-elsewhere" ? lodash.get(story, ["metadata", "reference-url"], "") : story.url || defaultValue;
|
|
2743
229
|
};
|
|
2744
230
|
var getTimeStamp = function getTimeStamp(date, _formatter) {
|
|
2745
231
|
var config = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
@@ -2747,17 +233,17 @@ var getTimeStamp = function getTimeStamp(date, _formatter) {
|
|
|
2747
233
|
var timezone = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : null;
|
|
2748
234
|
|
|
2749
235
|
if (timezone && template === "story") {
|
|
2750
|
-
var zonedTime = timezone && utcToZonedTime(date, timezone);
|
|
2751
|
-
var formatZonedTime = zonedTime && format(zonedTime, "yyyy-MM-dd'T'HH:mm:ssXXX", {
|
|
236
|
+
var zonedTime = timezone && dateFnsTz.utcToZonedTime(date, timezone);
|
|
237
|
+
var formatZonedTime = zonedTime && dateFnsTz.format(zonedTime, "yyyy-MM-dd'T'HH:mm:ssXXX", {
|
|
2752
238
|
timeZone: timezone
|
|
2753
239
|
});
|
|
2754
240
|
var timeStamp = timestampToFormat("", "", "", date, config);
|
|
2755
|
-
return /*#__PURE__*/
|
|
241
|
+
return /*#__PURE__*/React__default["default"].createElement("time", {
|
|
2756
242
|
dateTime: formatZonedTime
|
|
2757
243
|
}, timeStamp);
|
|
2758
244
|
}
|
|
2759
245
|
|
|
2760
|
-
return /*#__PURE__*/
|
|
246
|
+
return /*#__PURE__*/React__default["default"].createElement(Timeago__default["default"], {
|
|
2761
247
|
date: date,
|
|
2762
248
|
formatter: function formatter(value, unit, suffix, date) {
|
|
2763
249
|
return _formatter(value, unit, suffix, date, config);
|
|
@@ -2765,21 +251,21 @@ var getTimeStamp = function getTimeStamp(date, _formatter) {
|
|
|
2765
251
|
});
|
|
2766
252
|
};
|
|
2767
253
|
|
|
2768
|
-
var StateContext = /*#__PURE__*/createContext(); // eslint-disable-next-line react/display-name
|
|
254
|
+
var StateContext = /*#__PURE__*/React.createContext(); // eslint-disable-next-line react/display-name
|
|
2769
255
|
|
|
2770
256
|
var StateProvider = function StateProvider(RowComponent) {
|
|
2771
257
|
return function (props) {
|
|
2772
258
|
return (
|
|
2773
259
|
/*#__PURE__*/
|
|
2774
260
|
// eslint-disable-next-line react/prop-types
|
|
2775
|
-
|
|
261
|
+
React__default["default"].createElement(StateContext.Provider, {
|
|
2776
262
|
value: props.config
|
|
2777
|
-
}, /*#__PURE__*/
|
|
263
|
+
}, /*#__PURE__*/React__default["default"].createElement(RowComponent, props))
|
|
2778
264
|
);
|
|
2779
265
|
};
|
|
2780
266
|
};
|
|
2781
267
|
var useStateValue = function useStateValue() {
|
|
2782
|
-
return useContext(StateContext);
|
|
268
|
+
return React.useContext(StateContext);
|
|
2783
269
|
};
|
|
2784
270
|
|
|
2785
271
|
var ImageFallbackIcon = function ImageFallbackIcon(_ref) {
|
|
@@ -2789,27 +275,27 @@ var ImageFallbackIcon = function ImageFallbackIcon(_ref) {
|
|
|
2789
275
|
height = _ref$height === void 0 ? 30 : _ref$height,
|
|
2790
276
|
_ref$iconColor = _ref.iconColor,
|
|
2791
277
|
iconColor = _ref$iconColor === void 0 ? "#99B0CB" : _ref$iconColor;
|
|
2792
|
-
return /*#__PURE__*/
|
|
278
|
+
return /*#__PURE__*/React__default["default"].createElement("svg", {
|
|
2793
279
|
width: width,
|
|
2794
280
|
height: height,
|
|
2795
281
|
viewBox: "0 0 102 76",
|
|
2796
282
|
version: "1.1"
|
|
2797
|
-
}, /*#__PURE__*/
|
|
283
|
+
}, /*#__PURE__*/React__default["default"].createElement("g", {
|
|
2798
284
|
id: "demo-home-copy",
|
|
2799
285
|
stroke: "none",
|
|
2800
286
|
strokeWidth: "1",
|
|
2801
287
|
fill: "none",
|
|
2802
288
|
fillRule: "evenodd",
|
|
2803
289
|
transform: "translate(-377.000000, -314.000000)"
|
|
2804
|
-
}, /*#__PURE__*/
|
|
290
|
+
}, /*#__PURE__*/React__default["default"].createElement("g", {
|
|
2805
291
|
id: "Group-13",
|
|
2806
292
|
transform: "translate(377.000000, 314.000000)"
|
|
2807
|
-
}, /*#__PURE__*/
|
|
293
|
+
}, /*#__PURE__*/React__default["default"].createElement("path", {
|
|
2808
294
|
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",
|
|
2809
295
|
id: "Combined-Shape",
|
|
2810
296
|
fill: iconColor,
|
|
2811
297
|
fillRule: "nonzero"
|
|
2812
|
-
}), /*#__PURE__*/
|
|
298
|
+
}), /*#__PURE__*/React__default["default"].createElement("rect", {
|
|
2813
299
|
id: "Rectangle-19",
|
|
2814
300
|
stroke: iconColor,
|
|
2815
301
|
strokeWidth: "3",
|
|
@@ -2821,24 +307,24 @@ var ImageFallbackIcon = function ImageFallbackIcon(_ref) {
|
|
|
2821
307
|
}))));
|
|
2822
308
|
};
|
|
2823
309
|
ImageFallbackIcon.propTypes = {
|
|
2824
|
-
width:
|
|
2825
|
-
height:
|
|
2826
|
-
iconColor:
|
|
310
|
+
width: PropTypes__default["default"].object,
|
|
311
|
+
height: PropTypes__default["default"].object,
|
|
312
|
+
iconColor: PropTypes__default["default"].object
|
|
2827
313
|
};
|
|
2828
314
|
|
|
2829
315
|
var imageFallback = function imageFallback() {
|
|
2830
|
-
return /*#__PURE__*/
|
|
316
|
+
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
2831
317
|
className: "arr--fallback-image fallback-m_image__1GYCJ fallback-m_image-position__3KddP"
|
|
2832
|
-
}, /*#__PURE__*/
|
|
318
|
+
}, /*#__PURE__*/React__default["default"].createElement("figure", {
|
|
2833
319
|
className: "arr--fallback-svg fallback-m_fallback-svg__tK9fL"
|
|
2834
|
-
}, /*#__PURE__*/
|
|
320
|
+
}, /*#__PURE__*/React__default["default"].createElement(ImageFallbackIcon, null)));
|
|
2835
321
|
};
|
|
2836
322
|
|
|
2837
323
|
var FallbackImage = function FallbackImage(_ref) {
|
|
2838
324
|
var slug = _ref.slug;
|
|
2839
325
|
|
|
2840
326
|
if (slug) {
|
|
2841
|
-
return /*#__PURE__*/
|
|
327
|
+
return /*#__PURE__*/React__default["default"].createElement(components.Link, {
|
|
2842
328
|
href: slug,
|
|
2843
329
|
"aria-label": "image-fallback"
|
|
2844
330
|
}, imageFallback());
|
|
@@ -2847,23 +333,23 @@ var FallbackImage = function FallbackImage(_ref) {
|
|
|
2847
333
|
}
|
|
2848
334
|
};
|
|
2849
335
|
FallbackImage.propTypes = {
|
|
2850
|
-
slug:
|
|
336
|
+
slug: PropTypes__default["default"].string
|
|
2851
337
|
};
|
|
2852
338
|
|
|
2853
339
|
var HyperLinkIcon = function HyperLinkIcon() {
|
|
2854
|
-
return /*#__PURE__*/
|
|
340
|
+
return /*#__PURE__*/React__default["default"].createElement("svg", {
|
|
2855
341
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2856
342
|
width: "36",
|
|
2857
343
|
height: "28"
|
|
2858
|
-
}, /*#__PURE__*/
|
|
344
|
+
}, /*#__PURE__*/React__default["default"].createElement("g", {
|
|
2859
345
|
fill: "none",
|
|
2860
346
|
fillRule: "evenodd"
|
|
2861
|
-
}, /*#__PURE__*/
|
|
347
|
+
}, /*#__PURE__*/React__default["default"].createElement("rect", {
|
|
2862
348
|
width: "36",
|
|
2863
349
|
height: "28",
|
|
2864
350
|
fill: "#3D6FCF",
|
|
2865
351
|
rx: "4"
|
|
2866
|
-
}), /*#__PURE__*/
|
|
352
|
+
}), /*#__PURE__*/React__default["default"].createElement("path", {
|
|
2867
353
|
stroke: "#FFF",
|
|
2868
354
|
strokeLinecap: "round",
|
|
2869
355
|
strokeLinejoin: "round",
|
|
@@ -2876,16 +362,16 @@ var HyperLink = function HyperLink(_ref) {
|
|
|
2876
362
|
var _ref$hyperLink = _ref.hyperLink,
|
|
2877
363
|
hyperLink = _ref$hyperLink === void 0 ? "" : _ref$hyperLink;
|
|
2878
364
|
if (!hyperLink) return null;
|
|
2879
|
-
return /*#__PURE__*/
|
|
365
|
+
return /*#__PURE__*/React__default["default"].createElement(components.Link, {
|
|
2880
366
|
href: hyperLink,
|
|
2881
367
|
"aria-label": "hyperlink-button",
|
|
2882
368
|
className: "arr--hyperlink-button hyperlink-m_hyperlink-button__1CqWx",
|
|
2883
369
|
target: "_blank",
|
|
2884
370
|
rel: "noopener noreferrer"
|
|
2885
|
-
}, /*#__PURE__*/
|
|
371
|
+
}, /*#__PURE__*/React__default["default"].createElement(HyperLinkIcon, null));
|
|
2886
372
|
};
|
|
2887
373
|
HyperLink.propTypes = {
|
|
2888
|
-
hyperLink:
|
|
374
|
+
hyperLink: PropTypes__default["default"].string
|
|
2889
375
|
};
|
|
2890
376
|
|
|
2891
377
|
var _styleModuleImportMap$b = {
|
|
@@ -2921,8 +407,8 @@ var HeroImage = function HeroImage(_ref) {
|
|
|
2921
407
|
StoryTemplateIcon = _config$StoryTemplate === void 0 ? function () {
|
|
2922
408
|
return null;
|
|
2923
409
|
} : _config$StoryTemplate;
|
|
2924
|
-
var showImagePlaceholder = useSelector(function (state) {
|
|
2925
|
-
return
|
|
410
|
+
var showImagePlaceholder = reactRedux.useSelector(function (state) {
|
|
411
|
+
return lodash.get(state, ["qt", "config", "showPlaceholder"]);
|
|
2926
412
|
});
|
|
2927
413
|
var getPlaceholderStyleName = showImagePlaceholder ? "placeholder" : "";
|
|
2928
414
|
var fullBleed = FullBleed ? "" : "with-padding";
|
|
@@ -2931,7 +417,7 @@ var HeroImage = function HeroImage(_ref) {
|
|
|
2931
417
|
var heroImageMobClasses = isHorizontalMobile ? "right-padding-mob" : "";
|
|
2932
418
|
|
|
2933
419
|
var getPadding = function getPadding(aspectRatio) {
|
|
2934
|
-
var _aspectRatio =
|
|
420
|
+
var _aspectRatio = _slicedToArray__default["default"](aspectRatio, 2),
|
|
2935
421
|
height = _aspectRatio[0],
|
|
2936
422
|
width = _aspectRatio[1];
|
|
2937
423
|
|
|
@@ -2943,7 +429,7 @@ var HeroImage = function HeroImage(_ref) {
|
|
|
2943
429
|
return 0;
|
|
2944
430
|
};
|
|
2945
431
|
|
|
2946
|
-
var _aspectRatio2 =
|
|
432
|
+
var _aspectRatio2 = _slicedToArray__default["default"](aspectRatio, 2),
|
|
2947
433
|
mobileAspectRatio = _aspectRatio2[0],
|
|
2948
434
|
_aspectRatio2$ = _aspectRatio2[1],
|
|
2949
435
|
desktopAspectRatio = _aspectRatio2$ === void 0 ? mobileAspectRatio : _aspectRatio2$;
|
|
@@ -2951,43 +437,43 @@ var HeroImage = function HeroImage(_ref) {
|
|
|
2951
437
|
var isMobile = clientWidth("mobile");
|
|
2952
438
|
var imageAspectRatio = isMobile ? mobileAspectRatio : desktopAspectRatio;
|
|
2953
439
|
var imagePadding = isMobile ? getPadding(mobileAspectRatio) : getPadding(desktopAspectRatio);
|
|
2954
|
-
var slug =
|
|
2955
|
-
var hyperLink =
|
|
440
|
+
var slug = lodash.get(story, ["hero-image-s3-key"]) || lodash.get(story, ["alternative", "home", "default", "hero-image", "hero-image-s3-key"]);
|
|
441
|
+
var hyperLink = lodash.get(story, ["hero-image-hyperlink"], "");
|
|
2956
442
|
|
|
2957
443
|
var fallbackImage = function fallbackImage() {
|
|
2958
444
|
if (!slug) {
|
|
2959
445
|
if (fallbackImageUrl && !isStoryPageImage) {
|
|
2960
|
-
return /*#__PURE__*/
|
|
446
|
+
return /*#__PURE__*/React__default["default"].createElement("figure", {
|
|
2961
447
|
style: {
|
|
2962
448
|
paddingTop: imagePadding + "%"
|
|
2963
449
|
},
|
|
2964
|
-
className: "arr--responsive-hero-image " +
|
|
2965
|
-
}, /*#__PURE__*/
|
|
450
|
+
className: "arr--responsive-hero-image " + _getClassName__default["default"]("image ".concat(getPlaceholderStyleName), _styleModuleImportMap$b)
|
|
451
|
+
}, /*#__PURE__*/React__default["default"].createElement("img", {
|
|
2966
452
|
className: "qt-image",
|
|
2967
453
|
"data-src": "".concat(fallbackImageUrl),
|
|
2968
454
|
alt: "image-fallback"
|
|
2969
455
|
}));
|
|
2970
456
|
}
|
|
2971
457
|
|
|
2972
|
-
return /*#__PURE__*/
|
|
458
|
+
return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, defaultFallback ? /*#__PURE__*/React__default["default"].createElement("div", {
|
|
2973
459
|
"data-test-id": "arr--fallback-hero-image",
|
|
2974
460
|
style: {
|
|
2975
461
|
paddingTop: imagePadding + "%"
|
|
2976
462
|
},
|
|
2977
|
-
className: "arr--fallback-hero-image " +
|
|
2978
|
-
}, /*#__PURE__*/
|
|
463
|
+
className: "arr--fallback-hero-image " + _getClassName__default["default"]("image ".concat(getPlaceholderStyleName), _styleModuleImportMap$b)
|
|
464
|
+
}, /*#__PURE__*/React__default["default"].createElement(StoryTemplateIcon, {
|
|
2979
465
|
storyTemplate: story["story-template"]
|
|
2980
|
-
}), /*#__PURE__*/
|
|
466
|
+
}), /*#__PURE__*/React__default["default"].createElement(FallbackImage, null)) : null);
|
|
2981
467
|
}
|
|
2982
468
|
|
|
2983
|
-
return /*#__PURE__*/
|
|
469
|
+
return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement("figure", {
|
|
2984
470
|
style: {
|
|
2985
471
|
paddingTop: imagePadding + "%"
|
|
2986
472
|
},
|
|
2987
|
-
className: "arr--responsive-hero-image " +
|
|
2988
|
-
}, /*#__PURE__*/
|
|
473
|
+
className: "arr--responsive-hero-image " + _getClassName__default["default"]("image ".concat(getPlaceholderStyleName), _styleModuleImportMap$b)
|
|
474
|
+
}, /*#__PURE__*/React__default["default"].createElement(StoryTemplateIcon, {
|
|
2989
475
|
storyTemplate: story["story-template"]
|
|
2990
|
-
}), /*#__PURE__*/
|
|
476
|
+
}), /*#__PURE__*/React__default["default"].createElement(components.ResponsiveHeroImage, {
|
|
2991
477
|
story: story,
|
|
2992
478
|
aspectRatio: imageAspectRatio,
|
|
2993
479
|
defaultWidth: defaultWidth,
|
|
@@ -2996,48 +482,48 @@ var HeroImage = function HeroImage(_ref) {
|
|
|
2996
482
|
auto: ["format", "compress"],
|
|
2997
483
|
fit: "max"
|
|
2998
484
|
}
|
|
2999
|
-
})), isStoryPageImage && hyperLink && /*#__PURE__*/
|
|
485
|
+
})), isStoryPageImage && hyperLink && /*#__PURE__*/React__default["default"].createElement(HyperLink, {
|
|
3000
486
|
hyperLink: hyperLink
|
|
3001
487
|
}));
|
|
3002
488
|
};
|
|
3003
489
|
|
|
3004
|
-
return story && (isStoryPageImage ? /*#__PURE__*/
|
|
490
|
+
return story && (isStoryPageImage ? /*#__PURE__*/React__default["default"].createElement("div", {
|
|
3005
491
|
"data-test-id": "arr--hero-image",
|
|
3006
|
-
className: "arr--hero-image " +
|
|
3007
|
-
}, fallbackImage()) : /*#__PURE__*/
|
|
492
|
+
className: "arr--hero-image " + _getClassName__default["default"]("".concat(heroImageClass, " ").concat(fullBleed, " ").concat(heroImageMobClasses), _styleModuleImportMap$b)
|
|
493
|
+
}, fallbackImage()) : /*#__PURE__*/React__default["default"].createElement(components.Link, {
|
|
3008
494
|
"data-test-id": "arr--hero-image",
|
|
3009
495
|
href: getStoryUrl(story, "/".concat(story.slug)),
|
|
3010
496
|
externalLink: isExternalStory(story),
|
|
3011
497
|
"aria-label": "fallback-hero-image",
|
|
3012
|
-
className: "arr--hero-image " +
|
|
498
|
+
className: "arr--hero-image " + _getClassName__default["default"]("".concat(heroImageClass, " ").concat(fullBleed, " ").concat(heroImageMobClasses), _styleModuleImportMap$b)
|
|
3013
499
|
}, fallbackImage()));
|
|
3014
500
|
};
|
|
3015
501
|
HeroImage.propTypes = {
|
|
3016
502
|
/** The Story Object from the API response */
|
|
3017
|
-
story:
|
|
503
|
+
story: PropTypes__default["default"].object.isRequired,
|
|
3018
504
|
|
|
3019
505
|
/** Removes the Hero Image padding for the image to bleed over the margin */
|
|
3020
|
-
FullBleed:
|
|
506
|
+
FullBleed: PropTypes__default["default"].bool,
|
|
3021
507
|
|
|
3022
508
|
/** The default width for the image, in case the browser does not support srcset */
|
|
3023
|
-
defaultWidth:
|
|
509
|
+
defaultWidth: PropTypes__default["default"].number,
|
|
3024
510
|
|
|
3025
511
|
/** The list of available widths */
|
|
3026
|
-
widths:
|
|
512
|
+
widths: PropTypes__default["default"].array,
|
|
3027
513
|
// fatch the correct hero image
|
|
3028
|
-
aspectRatio:
|
|
514
|
+
aspectRatio: PropTypes__default["default"].array,
|
|
3029
515
|
// Hints for the browser to choose the best size
|
|
3030
516
|
|
|
3031
517
|
/** This prop is responsible for adding padding-right of the image and remove padding bottom of the image */
|
|
3032
|
-
isHorizontal:
|
|
518
|
+
isHorizontal: PropTypes__default["default"].bool,
|
|
3033
519
|
|
|
3034
520
|
/** This prop is responsible for adding padding-bottom in desktop and padding-right in mobile */
|
|
3035
|
-
isHorizontalMobile:
|
|
521
|
+
isHorizontalMobile: PropTypes__default["default"].bool,
|
|
3036
522
|
// this prop is responsive for rendering fallback image on story page
|
|
3037
|
-
defaultFallback:
|
|
3038
|
-
isHorizontalWithImageLast:
|
|
3039
|
-
isStoryPageImage:
|
|
3040
|
-
config:
|
|
523
|
+
defaultFallback: PropTypes__default["default"].bool,
|
|
524
|
+
isHorizontalWithImageLast: PropTypes__default["default"].bool,
|
|
525
|
+
isStoryPageImage: PropTypes__default["default"].bool,
|
|
526
|
+
config: PropTypes__default["default"].object
|
|
3041
527
|
};
|
|
3042
528
|
HeroImage.defaultProps = {
|
|
3043
529
|
FullBleed: true,
|
|
@@ -3072,9 +558,9 @@ var SectionTag = function SectionTag(_ref) {
|
|
|
3072
558
|
borderColor = _ref$borderColor === void 0 ? "" : _ref$borderColor,
|
|
3073
559
|
isLightTheme = _ref.isLightTheme;
|
|
3074
560
|
var config = useStateValue() || {};
|
|
3075
|
-
var isSection =
|
|
3076
|
-
var templateFromRowContext =
|
|
3077
|
-
var section =
|
|
561
|
+
var isSection = lodash.get(config, ["showSection"], true);
|
|
562
|
+
var templateFromRowContext = lodash.get(config, ["sectionTagTemplate"]);
|
|
563
|
+
var section = lodash.get(story, ["sections", 0], "");
|
|
3078
564
|
var supportedTemplates = ["borderBottomSml", "borderLeft", "solid"];
|
|
3079
565
|
var getUrl = section ? section["section-url"] : "/";
|
|
3080
566
|
var colorToApplyContrast = template === "solid" || templateFromRowContext === "solid" ? borderColor : config.theme;
|
|
@@ -3087,22 +573,22 @@ var SectionTag = function SectionTag(_ref) {
|
|
|
3087
573
|
}
|
|
3088
574
|
|
|
3089
575
|
if (!isSection) return null;
|
|
3090
|
-
return /*#__PURE__*/
|
|
576
|
+
return /*#__PURE__*/React__default["default"].createElement(components.Link, {
|
|
3091
577
|
href: getUrl,
|
|
3092
578
|
className: "arrow-component arr--section-name",
|
|
3093
579
|
"aria-label": "section-name"
|
|
3094
|
-
}, /*#__PURE__*/
|
|
580
|
+
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
3095
581
|
"data-test-id": "sectionTag",
|
|
3096
582
|
style: {
|
|
3097
583
|
backgroundColor: templateStyle.includes("section-solid") ? sectionTagBorderColor : ""
|
|
3098
584
|
},
|
|
3099
|
-
className: "section-tag arrow-component " +
|
|
3100
|
-
}, templateStyle.includes("section-borderLeft") && /*#__PURE__*/
|
|
585
|
+
className: "section-tag arrow-component " + _getClassName__default["default"]("".concat(textColor, " ").concat(templateStyle), _styleModuleImportMap$a)
|
|
586
|
+
}, templateStyle.includes("section-borderLeft") && /*#__PURE__*/React__default["default"].createElement("span", {
|
|
3101
587
|
className: "section-m_border-left__2oUyp",
|
|
3102
588
|
style: {
|
|
3103
589
|
color: sectionTagBorderColor
|
|
3104
590
|
}
|
|
3105
|
-
}), section["display-name"] || section["name"], /*#__PURE__*/
|
|
591
|
+
}), section["display-name"] || section["name"], /*#__PURE__*/React__default["default"].createElement("div", {
|
|
3106
592
|
className: "section-m_border-bottom__3cRoD",
|
|
3107
593
|
style: {
|
|
3108
594
|
backgroundColor: "".concat(template === "solid" ? "" : sectionTagBorderColor)
|
|
@@ -3111,13 +597,13 @@ var SectionTag = function SectionTag(_ref) {
|
|
|
3111
597
|
};
|
|
3112
598
|
SectionTag.propTypes = {
|
|
3113
599
|
/** The Story Object from the API response */
|
|
3114
|
-
story:
|
|
600
|
+
story: PropTypes__default["default"].object.isRequired,
|
|
3115
601
|
|
|
3116
602
|
/** The style template for section tag */
|
|
3117
|
-
template:
|
|
3118
|
-
borderColor:
|
|
3119
|
-
solidBorderColor:
|
|
3120
|
-
isLightTheme:
|
|
603
|
+
template: PropTypes__default["default"].oneOf(["", "borderBottomSml", "borderLeft", "solid"]),
|
|
604
|
+
borderColor: PropTypes__default["default"].string,
|
|
605
|
+
solidBorderColor: PropTypes__default["default"].string,
|
|
606
|
+
isLightTheme: PropTypes__default["default"].bool
|
|
3121
607
|
};
|
|
3122
608
|
SectionTag.defaultProps = {
|
|
3123
609
|
template: "",
|
|
@@ -3139,22 +625,22 @@ var TimeStamp = function TimeStamp(_ref) {
|
|
|
3139
625
|
_ref$config = _ref.config,
|
|
3140
626
|
config = _ref$config === void 0 ? {} : _ref$config;
|
|
3141
627
|
var configState = useStateValue() || {};
|
|
3142
|
-
var isTime =
|
|
628
|
+
var isTime = lodash.get(config, ["showTime"], lodash.get(configState, ["showTime"], true));
|
|
3143
629
|
var time = story["last-published-at"] || story["first-published-at"];
|
|
3144
630
|
var isBottomClasses = isBottom ? "bottom-fix" : "";
|
|
3145
631
|
var textColor = getTextColor(configState.theme);
|
|
3146
|
-
return /*#__PURE__*/
|
|
632
|
+
return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, isTime && /*#__PURE__*/React__default["default"].createElement("div", {
|
|
3147
633
|
"data-test-id": "publish-time",
|
|
3148
|
-
className: "time arr--publish-time " +
|
|
3149
|
-
}, /*#__PURE__*/
|
|
634
|
+
className: "time arr--publish-time " + _getClassName__default["default"]("time ".concat(textColor, " ").concat(isBottomClasses), _styleModuleImportMap$9)
|
|
635
|
+
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
3150
636
|
className: "timestamp-m_time-wrapper__3O2lM"
|
|
3151
637
|
}, getTimeStamp(time, formatter, config))));
|
|
3152
638
|
};
|
|
3153
639
|
TimeStamp.propTypes = {
|
|
3154
640
|
/** The Story Object from the API response */
|
|
3155
|
-
story:
|
|
3156
|
-
isBottom:
|
|
3157
|
-
config:
|
|
641
|
+
story: PropTypes__default["default"].object,
|
|
642
|
+
isBottom: PropTypes__default["default"].bool,
|
|
643
|
+
config: PropTypes__default["default"].object
|
|
3158
644
|
};
|
|
3159
645
|
|
|
3160
646
|
var _styleModuleImportMap$8 = {
|
|
@@ -3180,9 +666,9 @@ var AuthorBase = function AuthorBase(_ref) {
|
|
|
3180
666
|
_ref$config = _ref.config,
|
|
3181
667
|
config = _ref$config === void 0 ? {} : _ref$config;
|
|
3182
668
|
var configData = useStateValue() || {};
|
|
3183
|
-
var isAuthor =
|
|
669
|
+
var isAuthor = lodash.get(configData, ["showAuthor"], true);
|
|
3184
670
|
|
|
3185
|
-
var _get =
|
|
671
|
+
var _get = lodash.get(story, ["authors", "0"], ""),
|
|
3186
672
|
avatarUrl = _get["avatar-url"],
|
|
3187
673
|
avatarS3Key = _get["avatar-s3-key"],
|
|
3188
674
|
authorName = _get.name,
|
|
@@ -3190,17 +676,17 @@ var AuthorBase = function AuthorBase(_ref) {
|
|
|
3190
676
|
|
|
3191
677
|
var isBottomClasses = isBottom ? "bottom-fix" : "";
|
|
3192
678
|
var textColor = getTextColor(configData.theme);
|
|
3193
|
-
var mountAt =
|
|
679
|
+
var mountAt = lodash.get(config, ["mountAt"], "");
|
|
3194
680
|
|
|
3195
681
|
var authorImage = function authorImage(dir) {
|
|
3196
682
|
if (!avatarUrl && !avatarS3Key) {
|
|
3197
683
|
return null;
|
|
3198
684
|
}
|
|
3199
685
|
|
|
3200
|
-
return /*#__PURE__*/
|
|
686
|
+
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
3201
687
|
"data-test-id": "author-image",
|
|
3202
|
-
className:
|
|
3203
|
-
}, /*#__PURE__*/
|
|
688
|
+
className: _getClassName__default["default"]("author-image ".concat(dir, "-image"), _styleModuleImportMap$8)
|
|
689
|
+
}, /*#__PURE__*/React__default["default"].createElement("figure", null, avatarS3Key ? /*#__PURE__*/React__default["default"].createElement(components.ResponsiveImage, {
|
|
3204
690
|
slug: avatarS3Key,
|
|
3205
691
|
"aspect-ratio": [1, 1],
|
|
3206
692
|
defaultWidth: 400,
|
|
@@ -3208,49 +694,49 @@ var AuthorBase = function AuthorBase(_ref) {
|
|
|
3208
694
|
auto: ["format", "compress"]
|
|
3209
695
|
},
|
|
3210
696
|
alt: authorName
|
|
3211
|
-
}) : /*#__PURE__*/
|
|
697
|
+
}) : /*#__PURE__*/React__default["default"].createElement("img", {
|
|
3212
698
|
src: avatarUrl
|
|
3213
699
|
})));
|
|
3214
700
|
};
|
|
3215
701
|
|
|
3216
702
|
var isPrefix = function isPrefix(dir) {
|
|
3217
703
|
if (prefix) {
|
|
3218
|
-
return /*#__PURE__*/
|
|
3219
|
-
className: "arr-author-prefix " +
|
|
704
|
+
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
705
|
+
className: "arr-author-prefix " + _getClassName__default["default"]("prefix ".concat(textColor), _styleModuleImportMap$8)
|
|
3220
706
|
}, prefix);
|
|
3221
707
|
}
|
|
3222
708
|
|
|
3223
709
|
return !hideAuthorImage && authorImage(dir);
|
|
3224
710
|
};
|
|
3225
711
|
|
|
3226
|
-
return /*#__PURE__*/
|
|
712
|
+
return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, isAuthor && /*#__PURE__*/React__default["default"].createElement(components.Link, {
|
|
3227
713
|
href: "".concat(mountAt, "/author/") + slug,
|
|
3228
714
|
"aria-label": "author-name",
|
|
3229
|
-
className: "author-name arr-author-name arrow-component " +
|
|
3230
|
-
}, isPrefix("ltr"), /*#__PURE__*/
|
|
715
|
+
className: "author-name arr-author-name arrow-component " + _getClassName__default["default"]("author ".concat(isBottomClasses), _styleModuleImportMap$8)
|
|
716
|
+
}, isPrefix("ltr"), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
3231
717
|
"data-test-id": "author-name",
|
|
3232
|
-
className: "author-name " +
|
|
718
|
+
className: "author-name " + _getClassName__default["default"]("author-name ".concat(textColor), _styleModuleImportMap$8)
|
|
3233
719
|
}, authorName || story["author-name"]), !prefix && isPrefix("rtl")));
|
|
3234
720
|
};
|
|
3235
721
|
|
|
3236
722
|
function mapStateToProps$1(state) {
|
|
3237
723
|
return {
|
|
3238
|
-
config:
|
|
724
|
+
config: lodash.get(state, ["qt", "config"], {})
|
|
3239
725
|
};
|
|
3240
726
|
}
|
|
3241
727
|
|
|
3242
|
-
var Author = connect(mapStateToProps$1)(AuthorBase);
|
|
728
|
+
var Author = reactRedux.connect(mapStateToProps$1)(AuthorBase);
|
|
3243
729
|
AuthorBase.propTypes = {
|
|
3244
730
|
/** The Story Object from the API response */
|
|
3245
|
-
story:
|
|
731
|
+
story: PropTypes__default["default"].object.isRequired,
|
|
3246
732
|
|
|
3247
733
|
/** Hide Author Avatar Image */
|
|
3248
|
-
hideAuthorImage:
|
|
734
|
+
hideAuthorImage: PropTypes__default["default"].bool,
|
|
3249
735
|
// fix Author bottom of the storyCard
|
|
3250
|
-
isBottom:
|
|
736
|
+
isBottom: PropTypes__default["default"].bool,
|
|
3251
737
|
// fix prefix before the author name
|
|
3252
|
-
prefix:
|
|
3253
|
-
config:
|
|
738
|
+
prefix: PropTypes__default["default"].string,
|
|
739
|
+
config: PropTypes__default["default"].object
|
|
3254
740
|
};
|
|
3255
741
|
AuthorBase.defaultProps = {
|
|
3256
742
|
hideAuthorImage: false,
|
|
@@ -3271,14 +757,14 @@ var Dot = function Dot(_ref) {
|
|
|
3271
757
|
height = _ref$height === void 0 ? "3px" : _ref$height,
|
|
3272
758
|
_ref$color = _ref.color,
|
|
3273
759
|
color = _ref$color === void 0 ? "light" : _ref$color;
|
|
3274
|
-
return /*#__PURE__*/
|
|
3275
|
-
className:
|
|
3276
|
-
}, /*#__PURE__*/
|
|
760
|
+
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
761
|
+
className: _getClassName__default["default"](color, _styleModuleImportMap$7)
|
|
762
|
+
}, /*#__PURE__*/React__default["default"].createElement("svg", {
|
|
3277
763
|
xmlns: "http://www.w3.org/2000/svg",
|
|
3278
764
|
width: width,
|
|
3279
765
|
height: height,
|
|
3280
766
|
viewBox: "0 0 3 3"
|
|
3281
|
-
}, /*#__PURE__*/
|
|
767
|
+
}, /*#__PURE__*/React__default["default"].createElement("circle", {
|
|
3282
768
|
cx: "87",
|
|
3283
769
|
cy: "9",
|
|
3284
770
|
r: "1",
|
|
@@ -3289,9 +775,9 @@ var Dot = function Dot(_ref) {
|
|
|
3289
775
|
};
|
|
3290
776
|
Dot.propTypes = {
|
|
3291
777
|
/** height , width and color of the dot icon */
|
|
3292
|
-
color:
|
|
3293
|
-
width:
|
|
3294
|
-
height:
|
|
778
|
+
color: PropTypes__default["default"].string,
|
|
779
|
+
width: PropTypes__default["default"].string,
|
|
780
|
+
height: PropTypes__default["default"].string
|
|
3295
781
|
};
|
|
3296
782
|
|
|
3297
783
|
var _styleModuleImportMap$6 = {
|
|
@@ -3307,22 +793,22 @@ var Divider = function Divider(_ref) {
|
|
|
3307
793
|
height = _ref$height === void 0 ? "10" : _ref$height,
|
|
3308
794
|
_ref$color = _ref.color,
|
|
3309
795
|
color = _ref$color === void 0 ? "light" : _ref$color;
|
|
3310
|
-
return /*#__PURE__*/
|
|
3311
|
-
className:
|
|
3312
|
-
}, /*#__PURE__*/
|
|
796
|
+
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
797
|
+
className: _getClassName__default["default"](color, _styleModuleImportMap$6)
|
|
798
|
+
}, /*#__PURE__*/React__default["default"].createElement("svg", {
|
|
3313
799
|
xmlns: "http://www.w3.org/2000/svg",
|
|
3314
800
|
width: width,
|
|
3315
801
|
height: height
|
|
3316
|
-
}, /*#__PURE__*/
|
|
802
|
+
}, /*#__PURE__*/React__default["default"].createElement("path", {
|
|
3317
803
|
fill: "inherit",
|
|
3318
804
|
d: "M0 0h1v10H0z"
|
|
3319
805
|
})));
|
|
3320
806
|
};
|
|
3321
807
|
Divider.propTypes = {
|
|
3322
808
|
/** height , width and color of the dot icon */
|
|
3323
|
-
color:
|
|
3324
|
-
width:
|
|
3325
|
-
height:
|
|
809
|
+
color: PropTypes__default["default"].string,
|
|
810
|
+
width: PropTypes__default["default"].string,
|
|
811
|
+
height: PropTypes__default["default"].string
|
|
3326
812
|
};
|
|
3327
813
|
|
|
3328
814
|
var _styleModuleImportMap$5 = {
|
|
@@ -3340,28 +826,28 @@ var ReadTime = function ReadTime(_ref) {
|
|
|
3340
826
|
_ref$isLightTheme = _ref.isLightTheme,
|
|
3341
827
|
isLightTheme = _ref$isLightTheme === void 0 ? false : _ref$isLightTheme;
|
|
3342
828
|
var config = useStateValue() || {};
|
|
3343
|
-
var showReadTime =
|
|
3344
|
-
var readTime =
|
|
829
|
+
var showReadTime = lodash.get(config, ["showReadTime"]) || lodash.get(opts, ["showReadTime"], true);
|
|
830
|
+
var readTime = lodash.get(story, ["read-time"], 0);
|
|
3345
831
|
var textColor = isLightTheme ? "light" : getTextColor(config.theme);
|
|
3346
832
|
if (!showReadTime || !readTime) return null;
|
|
3347
|
-
var timeToRead =
|
|
3348
|
-
return /*#__PURE__*/
|
|
833
|
+
var timeToRead = lodash.get(opts, ["localizedTimeToRead"]) || "min read";
|
|
834
|
+
return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
3349
835
|
"data-test-id": "read-time",
|
|
3350
|
-
className: "arrow-component arr--read-time " +
|
|
3351
|
-
}, /*#__PURE__*/
|
|
836
|
+
className: "arrow-component arr--read-time " + _getClassName__default["default"]("read-time-wrapper ".concat(textColor), _styleModuleImportMap$5)
|
|
837
|
+
}, /*#__PURE__*/React__default["default"].createElement("span", {
|
|
3352
838
|
className: "read-time-indicator read-time-m_dot-indicator__3Sqh2"
|
|
3353
|
-
}, /*#__PURE__*/
|
|
839
|
+
}, /*#__PURE__*/React__default["default"].createElement(Dot, {
|
|
3354
840
|
color: textColor
|
|
3355
|
-
})), /*#__PURE__*/
|
|
841
|
+
})), /*#__PURE__*/React__default["default"].createElement("span", null, readTime, " ", timeToRead)));
|
|
3356
842
|
};
|
|
3357
843
|
ReadTime.propTypes = {
|
|
3358
|
-
story:
|
|
3359
|
-
"read-time":
|
|
844
|
+
story: PropTypes__default["default"].shape({
|
|
845
|
+
"read-time": PropTypes__default["default"].number
|
|
3360
846
|
}),
|
|
3361
|
-
opts:
|
|
3362
|
-
showReadTime:
|
|
847
|
+
opts: PropTypes__default["default"].shape({
|
|
848
|
+
showReadTime: PropTypes__default["default"].bool
|
|
3363
849
|
}),
|
|
3364
|
-
isLightTheme:
|
|
850
|
+
isLightTheme: PropTypes__default["default"].bool
|
|
3365
851
|
};
|
|
3366
852
|
|
|
3367
853
|
var _styleModuleImportMap$4 = {
|
|
@@ -3383,42 +869,42 @@ var AuthorWithTime = function AuthorWithTime(_ref) {
|
|
|
3383
869
|
config = _ref$config === void 0 ? {} : _ref$config,
|
|
3384
870
|
isLightTheme = _ref.isLightTheme;
|
|
3385
871
|
var configState = useStateValue() || {};
|
|
3386
|
-
var isAuthor =
|
|
3387
|
-
var isTime =
|
|
3388
|
-
var isReadTime =
|
|
872
|
+
var isAuthor = lodash.get(config, ["showAuthor"], lodash.get(configState, ["showAuthor"], true));
|
|
873
|
+
var isTime = lodash.get(config, ["showTime"], lodash.get(configState, ["showTime"], true));
|
|
874
|
+
var isReadTime = lodash.get(configState, ["showReadTime"], true);
|
|
3389
875
|
var isBottomClasses = isBottom ? "bottom-fix" : "";
|
|
3390
876
|
var seperatorStyle = separator === "dot" ? "dot" : "dash";
|
|
3391
877
|
var textColor = isLightTheme ? "light" : getTextColor(configState.theme);
|
|
3392
878
|
|
|
3393
879
|
var getSeparator = function getSeparator() {
|
|
3394
880
|
if (separator === "divider") {
|
|
3395
|
-
return /*#__PURE__*/
|
|
881
|
+
return /*#__PURE__*/React__default["default"].createElement(Divider, {
|
|
3396
882
|
color: textColor
|
|
3397
883
|
});
|
|
3398
884
|
}
|
|
3399
885
|
|
|
3400
|
-
return /*#__PURE__*/
|
|
886
|
+
return /*#__PURE__*/React__default["default"].createElement(Dot, {
|
|
3401
887
|
color: textColor
|
|
3402
888
|
});
|
|
3403
889
|
};
|
|
3404
890
|
|
|
3405
891
|
var getTimeStamp = function getTimeStamp() {
|
|
3406
892
|
if (!isTime) return null;
|
|
3407
|
-
return /*#__PURE__*/
|
|
3408
|
-
className: "arr-separator " +
|
|
3409
|
-
}, getSeparator()), /*#__PURE__*/
|
|
893
|
+
return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, isAuthor && /*#__PURE__*/React__default["default"].createElement("span", {
|
|
894
|
+
className: "arr-separator " + _getClassName__default["default"]("".concat(seperatorStyle), _styleModuleImportMap$4)
|
|
895
|
+
}, getSeparator()), /*#__PURE__*/React__default["default"].createElement(TimeStamp, {
|
|
3410
896
|
story: story,
|
|
3411
897
|
config: config
|
|
3412
|
-
}), isReadTime && /*#__PURE__*/
|
|
898
|
+
}), isReadTime && /*#__PURE__*/React__default["default"].createElement(ReadTime, {
|
|
3413
899
|
story: story,
|
|
3414
900
|
opts: config,
|
|
3415
901
|
isLightTheme: isLightTheme
|
|
3416
902
|
}));
|
|
3417
903
|
};
|
|
3418
904
|
|
|
3419
|
-
return /*#__PURE__*/
|
|
3420
|
-
className: "arr--author-time " +
|
|
3421
|
-
}, isAuthor ? /*#__PURE__*/
|
|
905
|
+
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
906
|
+
className: "arr--author-time " + _getClassName__default["default"]("author-time-wrapper ".concat(isBottomClasses), _styleModuleImportMap$4)
|
|
907
|
+
}, isAuthor ? /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement(Author, {
|
|
3422
908
|
story: story,
|
|
3423
909
|
isBottom: true,
|
|
3424
910
|
hideAuthorImage: hideAuthorImage,
|
|
@@ -3426,19 +912,19 @@ var AuthorWithTime = function AuthorWithTime(_ref) {
|
|
|
3426
912
|
}), getTimeStamp()) : getTimeStamp());
|
|
3427
913
|
};
|
|
3428
914
|
AuthorWithTime.propTypes = {
|
|
3429
|
-
story:
|
|
915
|
+
story: PropTypes__default["default"].object,
|
|
3430
916
|
|
|
3431
917
|
/** Style of separator between the Author & Timestamp */
|
|
3432
|
-
separator:
|
|
918
|
+
separator: PropTypes__default["default"].oneOf(["dot", "divider"]),
|
|
3433
919
|
|
|
3434
920
|
/** hide the author image */
|
|
3435
|
-
hideAuthorImage:
|
|
921
|
+
hideAuthorImage: PropTypes__default["default"].bool,
|
|
3436
922
|
// fix author and time at the end
|
|
3437
|
-
isBottom:
|
|
923
|
+
isBottom: PropTypes__default["default"].bool,
|
|
3438
924
|
// fix prefix before the author name
|
|
3439
|
-
prefix:
|
|
3440
|
-
config:
|
|
3441
|
-
isLightTheme:
|
|
925
|
+
prefix: PropTypes__default["default"].string,
|
|
926
|
+
config: PropTypes__default["default"].object,
|
|
927
|
+
isLightTheme: PropTypes__default["default"].bool
|
|
3442
928
|
};
|
|
3443
929
|
AuthorWithTime.defaultProps = {
|
|
3444
930
|
separator: "dot",
|
|
@@ -3473,7 +959,7 @@ var CollectionNameBase = function CollectionNameBase(_ref) {
|
|
|
3473
959
|
_ref$navigate = _ref.navigate,
|
|
3474
960
|
navigate = _ref$navigate === void 0 ? true : _ref$navigate;
|
|
3475
961
|
var collectionTitle = useStateValue() || {};
|
|
3476
|
-
var showRowTitle =
|
|
962
|
+
var showRowTitle = lodash.get(collectionTitle, ["showRowTitle"], true);
|
|
3477
963
|
var supportedTemplates = ["borderLeft", "borderBottom", "crossLine", "borderBottomFull"];
|
|
3478
964
|
var templateStyle = supportedTemplates.includes(collectionNameTemplate) ? " collection-".concat(collectionNameTemplate) : "";
|
|
3479
965
|
var slug = navigate && collection && getSlug(collection, config) || "";
|
|
@@ -3484,7 +970,7 @@ var CollectionNameBase = function CollectionNameBase(_ref) {
|
|
|
3484
970
|
var borderBottomFullStyle = templateStyle.includes("collection-borderBottomFull") ? "4px solid ".concat(CollectionNameBorderColor) : "";
|
|
3485
971
|
|
|
3486
972
|
var borderBottomStyle = function borderBottomStyle() {
|
|
3487
|
-
return templateStyle.includes("collection-borderBottom") && !templateStyle.includes("collection-borderBottomFull") ? /*#__PURE__*/
|
|
973
|
+
return templateStyle.includes("collection-borderBottom") && !templateStyle.includes("collection-borderBottomFull") ? /*#__PURE__*/React__default["default"].createElement("div", {
|
|
3488
974
|
className: "collection-name-m_border-bottom__1MnlV",
|
|
3489
975
|
style: {
|
|
3490
976
|
borderBottom: "4px solid ".concat(CollectionNameBorderColor)
|
|
@@ -3544,40 +1030,40 @@ var CollectionNameBase = function CollectionNameBase(_ref) {
|
|
|
3544
1030
|
}
|
|
3545
1031
|
};
|
|
3546
1032
|
|
|
3547
|
-
return /*#__PURE__*/
|
|
1033
|
+
return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, showRowTitle && collectionName && /*#__PURE__*/React__default["default"].createElement("div", {
|
|
3548
1034
|
style: {
|
|
3549
1035
|
borderBottom: borderBottomFullStyle
|
|
3550
1036
|
},
|
|
3551
1037
|
"data-test-id": "collection-name",
|
|
3552
|
-
className: ("arr--collection-name arrow-component ".concat(templateStyle) ? "arr--collection-name arrow-component ".concat(templateStyle) + " " : "") +
|
|
3553
|
-
}, templateStyle.includes("collection-borderLeft") && /*#__PURE__*/
|
|
1038
|
+
className: ("arr--collection-name arrow-component ".concat(templateStyle) ? "arr--collection-name arrow-component ".concat(templateStyle) + " " : "") + _getClassName__default["default"]("collection ".concat(textColor, " ").concat(templateStyle), _styleModuleImportMap$3)
|
|
1039
|
+
}, templateStyle.includes("collection-borderLeft") && /*#__PURE__*/React__default["default"].createElement("span", {
|
|
3554
1040
|
className: "arr-collection-name-border-left collection-name-m_border-left__3_pYw",
|
|
3555
1041
|
style: {
|
|
3556
1042
|
color: CollectionNameBorderColor,
|
|
3557
1043
|
fontSize: getBorderHeight()
|
|
3558
1044
|
}
|
|
3559
|
-
}), slug && !slug.includes(undefined) ? /*#__PURE__*/
|
|
1045
|
+
}), slug && !slug.includes(undefined) ? /*#__PURE__*/React__default["default"].createElement(components.Link, {
|
|
3560
1046
|
href: slug,
|
|
3561
1047
|
"aria-label": "collection-name"
|
|
3562
|
-
}, /*#__PURE__*/
|
|
1048
|
+
}, /*#__PURE__*/React__default["default"].createElement(HeaderTag, null, collectionName)) : /*#__PURE__*/React__default["default"].createElement(HeaderTag, null, collectionName), borderBottomStyle()));
|
|
3563
1049
|
};
|
|
3564
1050
|
CollectionNameBase.propTypes = {
|
|
3565
1051
|
/** Collection name border color */
|
|
3566
|
-
collectionNameBorderColor: PropTypes
|
|
1052
|
+
collectionNameBorderColor: PropTypes.PropTypes.string,
|
|
3567
1053
|
|
|
3568
1054
|
/** The Collection Object from the API response */
|
|
3569
|
-
collection: PropTypes
|
|
1055
|
+
collection: PropTypes.PropTypes.object,
|
|
3570
1056
|
|
|
3571
1057
|
/** The publisher config from the API response */
|
|
3572
|
-
config: PropTypes
|
|
1058
|
+
config: PropTypes.PropTypes.object,
|
|
3573
1059
|
|
|
3574
1060
|
/** The style template for the component */
|
|
3575
|
-
collectionNameTemplate: PropTypes
|
|
1061
|
+
collectionNameTemplate: PropTypes.PropTypes.oneOf(["", "borderLeft", "borderBottom", "crossLine", "borderBottomFull"]),
|
|
3576
1062
|
|
|
3577
1063
|
/** Header tags ranging h1-h6, where h[headerLevel] */
|
|
3578
|
-
headerLevel: PropTypes
|
|
3579
|
-
customCollectionName: PropTypes
|
|
3580
|
-
navigate: PropTypes
|
|
1064
|
+
headerLevel: PropTypes.PropTypes.string,
|
|
1065
|
+
customCollectionName: PropTypes.PropTypes.string,
|
|
1066
|
+
navigate: PropTypes.PropTypes.bool
|
|
3581
1067
|
};
|
|
3582
1068
|
CollectionNameBase.defaultProps = {
|
|
3583
1069
|
collectionNameTemplate: "",
|
|
@@ -3586,11 +1072,11 @@ CollectionNameBase.defaultProps = {
|
|
|
3586
1072
|
|
|
3587
1073
|
function mapStateToProps(state) {
|
|
3588
1074
|
return {
|
|
3589
|
-
config:
|
|
1075
|
+
config: lodash.get(state, ["qt", "config"], {})
|
|
3590
1076
|
};
|
|
3591
1077
|
}
|
|
3592
1078
|
|
|
3593
|
-
var CollectionName = connect(mapStateToProps)(CollectionNameBase);
|
|
1079
|
+
var CollectionName = reactRedux.connect(mapStateToProps)(CollectionNameBase);
|
|
3594
1080
|
|
|
3595
1081
|
var CrownIcon = function CrownIcon(_ref) {
|
|
3596
1082
|
var height = _ref.height,
|
|
@@ -3598,7 +1084,7 @@ var CrownIcon = function CrownIcon(_ref) {
|
|
|
3598
1084
|
_ref$color = _ref.color,
|
|
3599
1085
|
color = _ref$color === void 0 ? "#D8D8D8" : _ref$color,
|
|
3600
1086
|
positionTop = _ref.positionTop;
|
|
3601
|
-
return /*#__PURE__*/
|
|
1087
|
+
return /*#__PURE__*/React__default["default"].createElement("svg", {
|
|
3602
1088
|
xmlns: "http://www.w3.org/2000/svg",
|
|
3603
1089
|
width: width,
|
|
3604
1090
|
height: height,
|
|
@@ -3607,28 +1093,28 @@ var CrownIcon = function CrownIcon(_ref) {
|
|
|
3607
1093
|
position: "relative",
|
|
3608
1094
|
top: positionTop
|
|
3609
1095
|
}
|
|
3610
|
-
}, /*#__PURE__*/
|
|
1096
|
+
}, /*#__PURE__*/React__default["default"].createElement("g", {
|
|
3611
1097
|
fill: "none",
|
|
3612
1098
|
fillRule: "evenodd",
|
|
3613
1099
|
stroke: "none",
|
|
3614
1100
|
strokeWidth: "1"
|
|
3615
|
-
}, /*#__PURE__*/
|
|
1101
|
+
}, /*#__PURE__*/React__default["default"].createElement("g", null, /*#__PURE__*/React__default["default"].createElement("g", {
|
|
3616
1102
|
transform: "translate(8 8)"
|
|
3617
|
-
}, /*#__PURE__*/
|
|
1103
|
+
}, /*#__PURE__*/React__default["default"].createElement("path", {
|
|
3618
1104
|
d: "M0 0H24V24H0z"
|
|
3619
|
-
}), /*#__PURE__*/
|
|
1105
|
+
}), /*#__PURE__*/React__default["default"].createElement("g", {
|
|
3620
1106
|
fill: color,
|
|
3621
1107
|
fillRule: "nonzero",
|
|
3622
1108
|
transform: "translate(0 2)"
|
|
3623
|
-
}, /*#__PURE__*/
|
|
1109
|
+
}, /*#__PURE__*/React__default["default"].createElement("path", {
|
|
3624
1110
|
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"
|
|
3625
1111
|
}))))));
|
|
3626
1112
|
};
|
|
3627
1113
|
CrownIcon.propTypes = {
|
|
3628
|
-
height:
|
|
3629
|
-
width:
|
|
3630
|
-
color:
|
|
3631
|
-
positionTop:
|
|
1114
|
+
height: PropTypes__default["default"].string,
|
|
1115
|
+
width: PropTypes__default["default"].string,
|
|
1116
|
+
color: PropTypes__default["default"].string,
|
|
1117
|
+
positionTop: PropTypes__default["default"].string
|
|
3632
1118
|
};
|
|
3633
1119
|
|
|
3634
1120
|
var KeyIcon = function KeyIcon(_ref) {
|
|
@@ -3637,7 +1123,7 @@ var KeyIcon = function KeyIcon(_ref) {
|
|
|
3637
1123
|
_ref$color = _ref.color,
|
|
3638
1124
|
color = _ref$color === void 0 ? "#D5D5D5" : _ref$color,
|
|
3639
1125
|
positionTop = _ref.positionTop;
|
|
3640
|
-
return /*#__PURE__*/
|
|
1126
|
+
return /*#__PURE__*/React__default["default"].createElement("svg", {
|
|
3641
1127
|
xmlns: "http://www.w3.org/2000/svg",
|
|
3642
1128
|
width: width,
|
|
3643
1129
|
height: height,
|
|
@@ -3646,16 +1132,16 @@ var KeyIcon = function KeyIcon(_ref) {
|
|
|
3646
1132
|
position: "relative",
|
|
3647
1133
|
top: positionTop
|
|
3648
1134
|
}
|
|
3649
|
-
}, /*#__PURE__*/
|
|
1135
|
+
}, /*#__PURE__*/React__default["default"].createElement("g", {
|
|
3650
1136
|
fill: "none",
|
|
3651
1137
|
fillRule: "evenodd",
|
|
3652
1138
|
stroke: "none",
|
|
3653
1139
|
strokeWidth: "1"
|
|
3654
|
-
}, /*#__PURE__*/
|
|
1140
|
+
}, /*#__PURE__*/React__default["default"].createElement("g", null, /*#__PURE__*/React__default["default"].createElement("g", {
|
|
3655
1141
|
transform: "translate(8 8)"
|
|
3656
|
-
}, /*#__PURE__*/
|
|
1142
|
+
}, /*#__PURE__*/React__default["default"].createElement("path", {
|
|
3657
1143
|
d: "M0 0H24V24H0z"
|
|
3658
|
-
}), /*#__PURE__*/
|
|
1144
|
+
}), /*#__PURE__*/React__default["default"].createElement("path", {
|
|
3659
1145
|
fill: color,
|
|
3660
1146
|
fillRule: "nonzero",
|
|
3661
1147
|
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",
|
|
@@ -3663,10 +1149,10 @@ var KeyIcon = function KeyIcon(_ref) {
|
|
|
3663
1149
|
})))));
|
|
3664
1150
|
};
|
|
3665
1151
|
KeyIcon.propTypes = {
|
|
3666
|
-
height:
|
|
3667
|
-
width:
|
|
3668
|
-
color:
|
|
3669
|
-
positionTop:
|
|
1152
|
+
height: PropTypes__default["default"].string,
|
|
1153
|
+
width: PropTypes__default["default"].string,
|
|
1154
|
+
color: PropTypes__default["default"].string,
|
|
1155
|
+
positionTop: PropTypes__default["default"].string
|
|
3670
1156
|
};
|
|
3671
1157
|
|
|
3672
1158
|
var LockIcon = function LockIcon(_ref) {
|
|
@@ -3675,7 +1161,7 @@ var LockIcon = function LockIcon(_ref) {
|
|
|
3675
1161
|
_ref$color = _ref.color,
|
|
3676
1162
|
color = _ref$color === void 0 ? "#D5D5D5" : _ref$color,
|
|
3677
1163
|
positionTop = _ref.positionTop;
|
|
3678
|
-
return /*#__PURE__*/
|
|
1164
|
+
return /*#__PURE__*/React__default["default"].createElement("svg", {
|
|
3679
1165
|
xmlns: "http://www.w3.org/2000/svg",
|
|
3680
1166
|
width: width,
|
|
3681
1167
|
height: height,
|
|
@@ -3684,28 +1170,28 @@ var LockIcon = function LockIcon(_ref) {
|
|
|
3684
1170
|
position: "relative",
|
|
3685
1171
|
top: positionTop
|
|
3686
1172
|
}
|
|
3687
|
-
}, /*#__PURE__*/
|
|
1173
|
+
}, /*#__PURE__*/React__default["default"].createElement("g", {
|
|
3688
1174
|
fill: "none",
|
|
3689
1175
|
fillRule: "evenodd",
|
|
3690
1176
|
stroke: "none",
|
|
3691
1177
|
strokeWidth: "1"
|
|
3692
|
-
}, /*#__PURE__*/
|
|
1178
|
+
}, /*#__PURE__*/React__default["default"].createElement("g", null, /*#__PURE__*/React__default["default"].createElement("g", {
|
|
3693
1179
|
transform: "translate(8 8)"
|
|
3694
|
-
}, /*#__PURE__*/
|
|
1180
|
+
}, /*#__PURE__*/React__default["default"].createElement("path", {
|
|
3695
1181
|
d: "M0 0H24V24H0z"
|
|
3696
|
-
}), /*#__PURE__*/
|
|
1182
|
+
}), /*#__PURE__*/React__default["default"].createElement("g", {
|
|
3697
1183
|
fill: color,
|
|
3698
1184
|
fillRule: "nonzero",
|
|
3699
1185
|
transform: "translate(3)"
|
|
3700
|
-
}, /*#__PURE__*/
|
|
1186
|
+
}, /*#__PURE__*/React__default["default"].createElement("path", {
|
|
3701
1187
|
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"
|
|
3702
1188
|
}))))));
|
|
3703
1189
|
};
|
|
3704
1190
|
LockIcon.propTypes = {
|
|
3705
|
-
height:
|
|
3706
|
-
width:
|
|
3707
|
-
color:
|
|
3708
|
-
positionTop:
|
|
1191
|
+
height: PropTypes__default["default"].string,
|
|
1192
|
+
width: PropTypes__default["default"].string,
|
|
1193
|
+
color: PropTypes__default["default"].string,
|
|
1194
|
+
positionTop: PropTypes__default["default"].string
|
|
3709
1195
|
};
|
|
3710
1196
|
|
|
3711
1197
|
var StarIcon = function StarIcon(_ref) {
|
|
@@ -3715,7 +1201,7 @@ var StarIcon = function StarIcon(_ref) {
|
|
|
3715
1201
|
color = _ref$color === void 0 ? "#D5D5D5" : _ref$color,
|
|
3716
1202
|
_ref$positionTop = _ref.positionTop,
|
|
3717
1203
|
positionTop = _ref$positionTop === void 0 ? "" : _ref$positionTop;
|
|
3718
|
-
return /*#__PURE__*/
|
|
1204
|
+
return /*#__PURE__*/React__default["default"].createElement("svg", {
|
|
3719
1205
|
xmlns: "http://www.w3.org/2000/svg",
|
|
3720
1206
|
width: width,
|
|
3721
1207
|
height: height,
|
|
@@ -3724,21 +1210,21 @@ var StarIcon = function StarIcon(_ref) {
|
|
|
3724
1210
|
position: "relative",
|
|
3725
1211
|
top: positionTop
|
|
3726
1212
|
}
|
|
3727
|
-
}, /*#__PURE__*/
|
|
1213
|
+
}, /*#__PURE__*/React__default["default"].createElement("g", {
|
|
3728
1214
|
fill: "none",
|
|
3729
1215
|
fillRule: "evenodd",
|
|
3730
1216
|
stroke: "none",
|
|
3731
1217
|
strokeWidth: "1"
|
|
3732
|
-
}, /*#__PURE__*/
|
|
1218
|
+
}, /*#__PURE__*/React__default["default"].createElement("g", null, /*#__PURE__*/React__default["default"].createElement("path", {
|
|
3733
1219
|
fill: color,
|
|
3734
1220
|
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"
|
|
3735
1221
|
}))));
|
|
3736
1222
|
};
|
|
3737
1223
|
StarIcon.propTypes = {
|
|
3738
|
-
height:
|
|
3739
|
-
width:
|
|
3740
|
-
color:
|
|
3741
|
-
positionTop:
|
|
1224
|
+
height: PropTypes__default["default"].string,
|
|
1225
|
+
width: PropTypes__default["default"].string,
|
|
1226
|
+
color: PropTypes__default["default"].string,
|
|
1227
|
+
positionTop: PropTypes__default["default"].string
|
|
3742
1228
|
};
|
|
3743
1229
|
|
|
3744
1230
|
var PremiumStoryIcon = function PremiumStoryIcon(_ref) {
|
|
@@ -3750,7 +1236,7 @@ var PremiumStoryIcon = function PremiumStoryIcon(_ref) {
|
|
|
3750
1236
|
|
|
3751
1237
|
switch (iconType) {
|
|
3752
1238
|
case "crown":
|
|
3753
|
-
return /*#__PURE__*/
|
|
1239
|
+
return /*#__PURE__*/React__default["default"].createElement(CrownIcon, {
|
|
3754
1240
|
width: width,
|
|
3755
1241
|
height: height,
|
|
3756
1242
|
color: color,
|
|
@@ -3758,7 +1244,7 @@ var PremiumStoryIcon = function PremiumStoryIcon(_ref) {
|
|
|
3758
1244
|
});
|
|
3759
1245
|
|
|
3760
1246
|
case "lock":
|
|
3761
|
-
return /*#__PURE__*/
|
|
1247
|
+
return /*#__PURE__*/React__default["default"].createElement(LockIcon, {
|
|
3762
1248
|
width: width,
|
|
3763
1249
|
height: height,
|
|
3764
1250
|
color: color,
|
|
@@ -3766,7 +1252,7 @@ var PremiumStoryIcon = function PremiumStoryIcon(_ref) {
|
|
|
3766
1252
|
});
|
|
3767
1253
|
|
|
3768
1254
|
case "key":
|
|
3769
|
-
return /*#__PURE__*/
|
|
1255
|
+
return /*#__PURE__*/React__default["default"].createElement(KeyIcon, {
|
|
3770
1256
|
width: width,
|
|
3771
1257
|
height: height,
|
|
3772
1258
|
color: color,
|
|
@@ -3774,7 +1260,7 @@ var PremiumStoryIcon = function PremiumStoryIcon(_ref) {
|
|
|
3774
1260
|
});
|
|
3775
1261
|
|
|
3776
1262
|
default:
|
|
3777
|
-
return /*#__PURE__*/
|
|
1263
|
+
return /*#__PURE__*/React__default["default"].createElement(StarIcon, {
|
|
3778
1264
|
width: width,
|
|
3779
1265
|
height: height,
|
|
3780
1266
|
color: color,
|
|
@@ -3783,21 +1269,21 @@ var PremiumStoryIcon = function PremiumStoryIcon(_ref) {
|
|
|
3783
1269
|
}
|
|
3784
1270
|
};
|
|
3785
1271
|
PremiumStoryIcon.propTypes = {
|
|
3786
|
-
width:
|
|
3787
|
-
height:
|
|
3788
|
-
color:
|
|
3789
|
-
iconType:
|
|
3790
|
-
positionTop:
|
|
1272
|
+
width: PropTypes__default["default"].string,
|
|
1273
|
+
height: PropTypes__default["default"].string,
|
|
1274
|
+
color: PropTypes__default["default"].string,
|
|
1275
|
+
iconType: PropTypes__default["default"].string,
|
|
1276
|
+
positionTop: PropTypes__default["default"].string
|
|
3791
1277
|
};
|
|
3792
1278
|
|
|
3793
1279
|
function LiveIcon() {
|
|
3794
|
-
return /*#__PURE__*/
|
|
1280
|
+
return /*#__PURE__*/React__default["default"].createElement("svg", {
|
|
3795
1281
|
className: "live-icon",
|
|
3796
1282
|
xmlns: "http://www.w3.org/2000/svg",
|
|
3797
1283
|
width: "25",
|
|
3798
1284
|
height: "24",
|
|
3799
1285
|
viewBox: "0 0 25 24"
|
|
3800
|
-
}, /*#__PURE__*/
|
|
1286
|
+
}, /*#__PURE__*/React__default["default"].createElement("path", {
|
|
3801
1287
|
fill: "#ff5858",
|
|
3802
1288
|
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"
|
|
3803
1289
|
}));
|
|
@@ -3826,8 +1312,8 @@ var Headline = function Headline(_ref) {
|
|
|
3826
1312
|
enablePremiumStoryIcon = _premiumStoryIconConf3 === void 0 ? false : _premiumStoryIconConf3,
|
|
3827
1313
|
_premiumStoryIconConf4 = premiumStoryIconConfig.showLiveIcon,
|
|
3828
1314
|
showLiveIcon = _premiumStoryIconConf4 === void 0 ? false : _premiumStoryIconConf4;
|
|
3829
|
-
var alternateHeadline =
|
|
3830
|
-
var premiumStory = enablePremiumStoryIcon &&
|
|
1315
|
+
var alternateHeadline = lodash.get(story, ["alternative", "home", "default", "headline"]);
|
|
1316
|
+
var premiumStory = enablePremiumStoryIcon && lodash.get(story, ["access"]) === "subscription";
|
|
3831
1317
|
var headline = alternateHeadline || story.headline;
|
|
3832
1318
|
var HeaderTag = "h" + headerLevel;
|
|
3833
1319
|
|
|
@@ -3853,38 +1339,38 @@ var Headline = function Headline(_ref) {
|
|
|
3853
1339
|
var textColor = getTextColor(configData.theme);
|
|
3854
1340
|
var wrapperClass = premiumStory ? "wrapper" : "";
|
|
3855
1341
|
var iconSize = "24px";
|
|
3856
|
-
var enableLiveIcon = showLiveIcon && story["story-template"] === "live-blog" && !
|
|
3857
|
-
return /*#__PURE__*/
|
|
1342
|
+
var enableLiveIcon = showLiveIcon && story["story-template"] === "live-blog" && !lodash.get(story, ["metadata", "is-closed"], false);
|
|
1343
|
+
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
3858
1344
|
"data-test-id": "headline",
|
|
3859
|
-
className: "arrow-component arr--headline " +
|
|
3860
|
-
}, premiumStory && /*#__PURE__*/
|
|
1345
|
+
className: "arrow-component arr--headline " + _getClassName__default["default"](wrapperClass, _styleModuleImportMap$2)
|
|
1346
|
+
}, premiumStory && /*#__PURE__*/React__default["default"].createElement(PremiumStoryIcon, {
|
|
3861
1347
|
width: iconSize,
|
|
3862
1348
|
height: iconSize,
|
|
3863
1349
|
color: iconColor,
|
|
3864
1350
|
iconType: iconStyle,
|
|
3865
1351
|
positionTop: positionHeadline()
|
|
3866
|
-
}), isLink ? /*#__PURE__*/
|
|
1352
|
+
}), isLink ? /*#__PURE__*/React__default["default"].createElement(components.Link, {
|
|
3867
1353
|
href: getStoryUrl(story, "/".concat(story.slug)),
|
|
3868
1354
|
externalLink: isExternalStory(story),
|
|
3869
1355
|
"aria-label": "headline"
|
|
3870
|
-
}, /*#__PURE__*/
|
|
3871
|
-
className:
|
|
3872
|
-
}, enableLiveIcon && /*#__PURE__*/
|
|
3873
|
-
className:
|
|
3874
|
-
}, enableLiveIcon && /*#__PURE__*/
|
|
1356
|
+
}, /*#__PURE__*/React__default["default"].createElement(HeaderTag, {
|
|
1357
|
+
className: _getClassName__default["default"]("headline ".concat(textColor), _styleModuleImportMap$2)
|
|
1358
|
+
}, enableLiveIcon && /*#__PURE__*/React__default["default"].createElement(LiveIcon, null), headline)) : /*#__PURE__*/React__default["default"].createElement(HeaderTag, {
|
|
1359
|
+
className: _getClassName__default["default"]("headline ".concat(textColor), _styleModuleImportMap$2)
|
|
1360
|
+
}, enableLiveIcon && /*#__PURE__*/React__default["default"].createElement(LiveIcon, null), headline));
|
|
3875
1361
|
};
|
|
3876
1362
|
Headline.propTypes = {
|
|
3877
1363
|
/** The Story Object from the API response */
|
|
3878
|
-
story:
|
|
1364
|
+
story: PropTypes__default["default"].object.isRequired,
|
|
3879
1365
|
|
|
3880
1366
|
/** Header tags ranging h1-h6, where h[headerLevel] */
|
|
3881
|
-
headerLevel:
|
|
3882
|
-
premiumStoryIconConfig:
|
|
3883
|
-
iconColor:
|
|
3884
|
-
iconType:
|
|
3885
|
-
enablePremiumStoryIcon:
|
|
1367
|
+
headerLevel: PropTypes__default["default"].string,
|
|
1368
|
+
premiumStoryIconConfig: PropTypes__default["default"].shape({
|
|
1369
|
+
iconColor: PropTypes__default["default"].string,
|
|
1370
|
+
iconType: PropTypes__default["default"].string,
|
|
1371
|
+
enablePremiumStoryIcon: PropTypes__default["default"].bool
|
|
3886
1372
|
}),
|
|
3887
|
-
isLink:
|
|
1373
|
+
isLink: PropTypes__default["default"].bool
|
|
3888
1374
|
};
|
|
3889
1375
|
Headline.defaultProps = {
|
|
3890
1376
|
headerLevel: "6",
|
|
@@ -3908,28 +1394,28 @@ var Subheadline = function Subheadline(_ref) {
|
|
|
3908
1394
|
forceShowAtom = _ref.forceShowAtom,
|
|
3909
1395
|
showFullContent = _ref.showFullContent;
|
|
3910
1396
|
var config = useStateValue() || {};
|
|
3911
|
-
var subheadline = forceShowAtom ||
|
|
1397
|
+
var subheadline = forceShowAtom || lodash.get(config, ["showSubheadline"], true);
|
|
3912
1398
|
if (!subheadline) return null;
|
|
3913
1399
|
var textColor = getTextColor(config.theme);
|
|
3914
|
-
return /*#__PURE__*/
|
|
1400
|
+
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
3915
1401
|
style: {
|
|
3916
1402
|
WebkitLineClamp: lineClamp
|
|
3917
1403
|
},
|
|
3918
1404
|
"data-test-id": "subheadline",
|
|
3919
|
-
className: ("p-alt arr--sub-headline arrow-component ".concat(clazzName) ? "p-alt arr--sub-headline arrow-component ".concat(clazzName) + " " : "") +
|
|
1405
|
+
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$1)
|
|
3920
1406
|
}, showFullContent || typeof lineClamp === "number" ? story.subheadline : truncate(story.subheadline, truncateChars, true));
|
|
3921
1407
|
};
|
|
3922
1408
|
Subheadline.propTypes = {
|
|
3923
1409
|
/** The Story Object from the API response */
|
|
3924
|
-
story:
|
|
1410
|
+
story: PropTypes__default["default"].object.isRequired,
|
|
3925
1411
|
// Restricts the number of lines for subheadline.
|
|
3926
|
-
lineClamp:
|
|
1412
|
+
lineClamp: PropTypes__default["default"].number,
|
|
3927
1413
|
|
|
3928
1414
|
/** Number of characters to truncate the subheadline */
|
|
3929
|
-
truncateChars:
|
|
3930
|
-
clazzName:
|
|
3931
|
-
forceShowAtom:
|
|
3932
|
-
showFullContent:
|
|
1415
|
+
truncateChars: PropTypes__default["default"].number,
|
|
1416
|
+
clazzName: PropTypes__default["default"].string,
|
|
1417
|
+
forceShowAtom: PropTypes__default["default"].bool,
|
|
1418
|
+
showFullContent: PropTypes__default["default"].bool
|
|
3933
1419
|
};
|
|
3934
1420
|
Subheadline.defaultProps = {
|
|
3935
1421
|
forceShowAtom: false,
|
|
@@ -3978,7 +1464,7 @@ var StoryCard = function StoryCard(_ref) {
|
|
|
3978
1464
|
prefix = _ref.prefix,
|
|
3979
1465
|
config = _ref.config,
|
|
3980
1466
|
isHorizontalWithImageLast = _ref.isHorizontalWithImageLast;
|
|
3981
|
-
if (!story || isEmpty(story)) return /*#__PURE__*/
|
|
1467
|
+
if (!story || isEmpty(story)) return /*#__PURE__*/React__default["default"].createElement("div", null);
|
|
3982
1468
|
var borderOptions = ["default", "full", "bottom", "boxShadow"];
|
|
3983
1469
|
var borderTemplate = borderOptions.includes(border) ? "border-".concat(border) : ""; // TODO optimize conditions
|
|
3984
1470
|
|
|
@@ -3988,7 +1474,7 @@ var StoryCard = function StoryCard(_ref) {
|
|
|
3988
1474
|
var bgImgContentOverlapClass = bgImgContentOverlap ? "content-overlap" : "";
|
|
3989
1475
|
var textColor = getTextColor(theme);
|
|
3990
1476
|
var horizontalMobileClasses = isHorizontalMobile ? "horizontal-mob" : "";
|
|
3991
|
-
var defaultStorycard = /*#__PURE__*/
|
|
1477
|
+
var defaultStorycard = /*#__PURE__*/React__default["default"].createElement(DefaultStoryCard, {
|
|
3992
1478
|
story: story,
|
|
3993
1479
|
aspectRatio: aspectRatio,
|
|
3994
1480
|
border: border,
|
|
@@ -4002,13 +1488,13 @@ var StoryCard = function StoryCard(_ref) {
|
|
|
4002
1488
|
config: config,
|
|
4003
1489
|
isHorizontalWithImageLast: isHorizontalWithImageLast
|
|
4004
1490
|
});
|
|
4005
|
-
return /*#__PURE__*/
|
|
1491
|
+
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
4006
1492
|
"data-test-id": "story-card",
|
|
4007
1493
|
style: {
|
|
4008
1494
|
backgroundColor: theme,
|
|
4009
1495
|
color: textColor
|
|
4010
1496
|
},
|
|
4011
|
-
className: "arr--story-card " +
|
|
1497
|
+
className: "arr--story-card " + _getClassName__default["default"]("card ".concat(horizontalCardStyle, " ").concat(borderTemplate, " ").concat(textColor, " ").concat(bgImageClasses, " ").concat(bgImgContentOverlapClass, " ").concat(horizontalMobileClasses), _styleModuleImportMap)
|
|
4012
1498
|
}, children || defaultStorycard);
|
|
4013
1499
|
};
|
|
4014
1500
|
|
|
@@ -4031,91 +1517,91 @@ var DefaultStoryCard = function DefaultStoryCard(_ref2) {
|
|
|
4031
1517
|
var SectionTagborderColor = rgbToHex(borderColor);
|
|
4032
1518
|
var _config$localizationC = config.localizationConfig,
|
|
4033
1519
|
localizationConfig = _config$localizationC === void 0 ? {} : _config$localizationC;
|
|
4034
|
-
return /*#__PURE__*/
|
|
1520
|
+
return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, isHorizontal ? /*#__PURE__*/React__default["default"].createElement(HeroImage, {
|
|
4035
1521
|
config: config,
|
|
4036
1522
|
story: story,
|
|
4037
1523
|
isHorizontal: true,
|
|
4038
1524
|
isHorizontalMobile: isHorizontalMobile,
|
|
4039
1525
|
aspectRatio: aspectRatio
|
|
4040
|
-
}) : isHorizontalWithImageLast ? /*#__PURE__*/
|
|
1526
|
+
}) : isHorizontalWithImageLast ? /*#__PURE__*/React__default["default"].createElement(HeroImage, {
|
|
4041
1527
|
config: config,
|
|
4042
1528
|
story: story,
|
|
4043
1529
|
isHorizontalWithImageLast: true,
|
|
4044
1530
|
isHorizontalMobile: isHorizontalMobile,
|
|
4045
1531
|
aspectRatio: aspectRatio
|
|
4046
|
-
}) : /*#__PURE__*/
|
|
1532
|
+
}) : /*#__PURE__*/React__default["default"].createElement(HeroImage, {
|
|
4047
1533
|
story: story,
|
|
4048
1534
|
config: config,
|
|
4049
1535
|
isHorizontalMobile: isHorizontalMobile,
|
|
4050
1536
|
aspectRatio: aspectRatio
|
|
4051
|
-
}), /*#__PURE__*/
|
|
4052
|
-
className: "arr--story-content " +
|
|
4053
|
-
}, /*#__PURE__*/
|
|
1537
|
+
}), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
1538
|
+
className: "arr--story-content " + _getClassName__default["default"]("content ".concat(alignment), _styleModuleImportMap)
|
|
1539
|
+
}, /*#__PURE__*/React__default["default"].createElement(SectionTag, {
|
|
4054
1540
|
story: story,
|
|
4055
1541
|
borderColor: SectionTagborderColor
|
|
4056
|
-
}), /*#__PURE__*/
|
|
1542
|
+
}), /*#__PURE__*/React__default["default"].createElement(Headline, {
|
|
4057
1543
|
story: story,
|
|
4058
1544
|
headerLevel: headerLevel,
|
|
4059
1545
|
premiumStoryIconConfig: config
|
|
4060
|
-
}), /*#__PURE__*/
|
|
1546
|
+
}), /*#__PURE__*/React__default["default"].createElement(AuthorWithTime, {
|
|
4061
1547
|
config: localizationConfig,
|
|
4062
1548
|
story: story,
|
|
4063
1549
|
isBottom: true,
|
|
4064
1550
|
prefix: prefix,
|
|
4065
1551
|
hideAuthorImage: hideAuthorImage
|
|
4066
|
-
}), /*#__PURE__*/
|
|
1552
|
+
}), /*#__PURE__*/React__default["default"].createElement(Subheadline, {
|
|
4067
1553
|
story: story
|
|
4068
1554
|
})));
|
|
4069
1555
|
};
|
|
4070
1556
|
|
|
4071
1557
|
DefaultStoryCard.propTypes = {
|
|
4072
|
-
story:
|
|
4073
|
-
border:
|
|
4074
|
-
isBottom:
|
|
4075
|
-
isHorizontal:
|
|
4076
|
-
aspectRatio:
|
|
4077
|
-
isHorizontalMobile:
|
|
4078
|
-
centerAlign:
|
|
4079
|
-
headerLevel:
|
|
4080
|
-
borderColor:
|
|
4081
|
-
hideAuthorImage:
|
|
4082
|
-
prefix:
|
|
4083
|
-
config:
|
|
4084
|
-
isHorizontalWithImageLast:
|
|
1558
|
+
story: PropTypes__default["default"].object.isRequired,
|
|
1559
|
+
border: PropTypes__default["default"].oneOfType([PropTypes__default["default"].string]),
|
|
1560
|
+
isBottom: PropTypes__default["default"].bool,
|
|
1561
|
+
isHorizontal: PropTypes__default["default"].bool,
|
|
1562
|
+
aspectRatio: PropTypes__default["default"].oneOfType([PropTypes__default["default"].array]),
|
|
1563
|
+
isHorizontalMobile: PropTypes__default["default"].bool,
|
|
1564
|
+
centerAlign: PropTypes__default["default"].bool,
|
|
1565
|
+
headerLevel: PropTypes__default["default"].string,
|
|
1566
|
+
borderColor: PropTypes__default["default"].string,
|
|
1567
|
+
hideAuthorImage: PropTypes__default["default"].bool,
|
|
1568
|
+
prefix: PropTypes__default["default"].string,
|
|
1569
|
+
config: PropTypes__default["default"].object,
|
|
1570
|
+
isHorizontalWithImageLast: PropTypes__default["default"].bool
|
|
4085
1571
|
};
|
|
4086
1572
|
StoryCard.propTypes = {
|
|
4087
1573
|
/** The Story Object from the API response */
|
|
4088
|
-
story:
|
|
4089
|
-
children:
|
|
1574
|
+
story: PropTypes__default["default"].object.isRequired,
|
|
1575
|
+
children: PropTypes__default["default"].node,
|
|
4090
1576
|
|
|
4091
1577
|
/** Flip the Story Card to Horizonal mode */
|
|
4092
|
-
isHorizontal:
|
|
1578
|
+
isHorizontal: PropTypes__default["default"].bool,
|
|
4093
1579
|
|
|
4094
1580
|
/** Add border to the Story Card */
|
|
4095
|
-
border:
|
|
1581
|
+
border: PropTypes__default["default"].oneOfType([PropTypes__default["default"].string]),
|
|
4096
1582
|
// story card with background image
|
|
4097
|
-
useImageAsBackground:
|
|
1583
|
+
useImageAsBackground: PropTypes__default["default"].bool,
|
|
4098
1584
|
// story card content overlap with image
|
|
4099
|
-
bgImgContentOverlap:
|
|
1585
|
+
bgImgContentOverlap: PropTypes__default["default"].bool,
|
|
4100
1586
|
|
|
4101
1587
|
/** add aspect ratio for hero image */
|
|
4102
|
-
aspectRatio:
|
|
1588
|
+
aspectRatio: PropTypes__default["default"].oneOfType([PropTypes__default["default"].array]),
|
|
4103
1589
|
|
|
4104
1590
|
/** add theme(dark /light/custom color) for storycard */
|
|
4105
|
-
theme:
|
|
1591
|
+
theme: PropTypes__default["default"].string,
|
|
4106
1592
|
|
|
4107
1593
|
/** flip the story card mobile design horizontal */
|
|
4108
|
-
isHorizontalMobile:
|
|
1594
|
+
isHorizontalMobile: PropTypes__default["default"].bool,
|
|
4109
1595
|
// make content center align in desktop and left align in mobile
|
|
4110
|
-
centerAlign:
|
|
4111
|
-
headerLevel:
|
|
4112
|
-
borderColor:
|
|
1596
|
+
centerAlign: PropTypes__default["default"].bool,
|
|
1597
|
+
headerLevel: PropTypes__default["default"].string,
|
|
1598
|
+
borderColor: PropTypes__default["default"].string,
|
|
4113
1599
|
// handle author image through storycard
|
|
4114
|
-
hideAuthorImage:
|
|
1600
|
+
hideAuthorImage: PropTypes__default["default"].bool,
|
|
4115
1601
|
// handle author prefix through storycard
|
|
4116
|
-
prefix:
|
|
4117
|
-
config:
|
|
4118
|
-
isHorizontalWithImageLast:
|
|
1602
|
+
prefix: PropTypes__default["default"].string,
|
|
1603
|
+
config: PropTypes__default["default"].object,
|
|
1604
|
+
isHorizontalWithImageLast: PropTypes__default["default"].bool
|
|
4119
1605
|
};
|
|
4120
1606
|
StoryCard.defaultProps = {
|
|
4121
1607
|
isHorizontal: false,
|
|
@@ -4132,19 +1618,19 @@ function OtherNewsLinkComp(_ref) {
|
|
|
4132
1618
|
textColor = _ref.textColor,
|
|
4133
1619
|
Icon = _ref.Icon,
|
|
4134
1620
|
text = _ref.text;
|
|
4135
|
-
return /*#__PURE__*/
|
|
1621
|
+
return /*#__PURE__*/React__default["default"].createElement(components.Link, {
|
|
4136
1622
|
href: slug,
|
|
4137
1623
|
"aria-label": "arrow-icon"
|
|
4138
|
-
}, /*#__PURE__*/
|
|
1624
|
+
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
4139
1625
|
className: "four-col-twelve-story-m_other-news-container__37wlp"
|
|
4140
|
-
}, /*#__PURE__*/
|
|
1626
|
+
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
4141
1627
|
className: "four-col-twelve-story-m_other-news-text__1zKt-",
|
|
4142
1628
|
style: {
|
|
4143
1629
|
color: textColor
|
|
4144
1630
|
}
|
|
4145
|
-
}, text), /*#__PURE__*/
|
|
1631
|
+
}, text), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
4146
1632
|
className: "four-col-twelve-story-m_arrow-icon__2u_kA"
|
|
4147
|
-
}, /*#__PURE__*/
|
|
1633
|
+
}, /*#__PURE__*/React__default["default"].createElement(Icon, null))));
|
|
4148
1634
|
}
|
|
4149
1635
|
|
|
4150
1636
|
var SingleCol3Story = function SingleCol3Story(_ref2) {
|
|
@@ -4156,14 +1642,14 @@ var SingleCol3Story = function SingleCol3Story(_ref2) {
|
|
|
4156
1642
|
theme = _ref2.theme,
|
|
4157
1643
|
_ref2$config = _ref2.config,
|
|
4158
1644
|
config = _ref2$config === void 0 ? {} : _ref2$config;
|
|
4159
|
-
var items = collectionToStories(collection);
|
|
1645
|
+
var items = components.collectionToStories(collection);
|
|
4160
1646
|
|
|
4161
1647
|
if (items.length < 1) {
|
|
4162
1648
|
return null;
|
|
4163
1649
|
}
|
|
4164
1650
|
|
|
4165
1651
|
var _ref3 = items || [],
|
|
4166
|
-
_ref4 =
|
|
1652
|
+
_ref4 = _toArray__default["default"](_ref3),
|
|
4167
1653
|
firstStory = _ref4[0],
|
|
4168
1654
|
rest = _ref4.slice(1);
|
|
4169
1655
|
|
|
@@ -4181,62 +1667,62 @@ var SingleCol3Story = function SingleCol3Story(_ref2) {
|
|
|
4181
1667
|
contentPosition = otherTextData.contentPosition || contentPosition;
|
|
4182
1668
|
}
|
|
4183
1669
|
|
|
4184
|
-
return /*#__PURE__*/
|
|
1670
|
+
return /*#__PURE__*/React__default["default"].createElement("div", null, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
4185
1671
|
className: "four-col-twelve-story-m_collection-name-container__1yTXx"
|
|
4186
|
-
}, /*#__PURE__*/
|
|
1672
|
+
}, /*#__PURE__*/React__default["default"].createElement(CollectionName, {
|
|
4187
1673
|
collection: collection,
|
|
4188
1674
|
headerLevel: "4",
|
|
4189
1675
|
collectionNameTemplate: collectionNameTemplate
|
|
4190
|
-
}), contentPosition === "top" && text && Icon && /*#__PURE__*/
|
|
1676
|
+
}), contentPosition === "top" && text && Icon && /*#__PURE__*/React__default["default"].createElement("div", {
|
|
4191
1677
|
className: "four-col-twelve-story-m_other-news-top-container__32-SF"
|
|
4192
|
-
}, /*#__PURE__*/
|
|
1678
|
+
}, /*#__PURE__*/React__default["default"].createElement(OtherNewsLinkComp, {
|
|
4193
1679
|
textColor: textColor,
|
|
4194
1680
|
Icon: Icon,
|
|
4195
1681
|
slug: slug,
|
|
4196
1682
|
text: text
|
|
4197
|
-
}))), /*#__PURE__*/
|
|
1683
|
+
}))), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
4198
1684
|
className: "first-card"
|
|
4199
|
-
}, /*#__PURE__*/
|
|
1685
|
+
}, /*#__PURE__*/React__default["default"].createElement(StoryCard, {
|
|
4200
1686
|
story: firstStory,
|
|
4201
1687
|
border: border,
|
|
4202
1688
|
theme: theme,
|
|
4203
1689
|
config: config
|
|
4204
|
-
}, /*#__PURE__*/
|
|
1690
|
+
}, /*#__PURE__*/React__default["default"].createElement(HeroImage, {
|
|
4205
1691
|
story: firstStory,
|
|
4206
1692
|
aspectRatio: [[16, 9], [16, 9]]
|
|
4207
|
-
}), /*#__PURE__*/
|
|
1693
|
+
}), /*#__PURE__*/React__default["default"].createElement(SectionTag, {
|
|
4208
1694
|
story: firstStory
|
|
4209
|
-
}), /*#__PURE__*/
|
|
1695
|
+
}), /*#__PURE__*/React__default["default"].createElement(Headline, {
|
|
4210
1696
|
story: firstStory,
|
|
4211
1697
|
headerLevel: "4",
|
|
4212
1698
|
premiumStoryIconConfig: config
|
|
4213
|
-
}), /*#__PURE__*/
|
|
1699
|
+
}), /*#__PURE__*/React__default["default"].createElement(AuthorWithTime, {
|
|
4214
1700
|
config: localizationConfig,
|
|
4215
1701
|
story: firstStory
|
|
4216
|
-
}))), /*#__PURE__*/
|
|
1702
|
+
}))), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
4217
1703
|
className: "second-card"
|
|
4218
1704
|
}, rest.slice(0, 2).map(function (story, index) {
|
|
4219
|
-
return /*#__PURE__*/
|
|
1705
|
+
return /*#__PURE__*/React__default["default"].createElement(StoryCard, {
|
|
4220
1706
|
key: index,
|
|
4221
1707
|
story: story,
|
|
4222
1708
|
isHorizontal: true,
|
|
4223
1709
|
theme: theme,
|
|
4224
1710
|
border: border
|
|
4225
|
-
}, /*#__PURE__*/
|
|
1711
|
+
}, /*#__PURE__*/React__default["default"].createElement(HeroImage, {
|
|
4226
1712
|
story: story,
|
|
4227
1713
|
aspectRatio: [[4, 3], [4, 3]]
|
|
4228
|
-
}), /*#__PURE__*/
|
|
1714
|
+
}), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
4229
1715
|
className: "small-card-container four-col-twelve-story-m_small-card-content-container__1Lu7D"
|
|
4230
|
-
}, /*#__PURE__*/
|
|
1716
|
+
}, /*#__PURE__*/React__default["default"].createElement(Headline, {
|
|
4231
1717
|
story: story,
|
|
4232
1718
|
premiumStoryIconConfig: config
|
|
4233
|
-
}), /*#__PURE__*/
|
|
1719
|
+
}), /*#__PURE__*/React__default["default"].createElement(AuthorWithTime, {
|
|
4234
1720
|
config: localizationConfig,
|
|
4235
1721
|
story: story
|
|
4236
1722
|
})));
|
|
4237
|
-
})), contentPosition === "bottom" && text && Icon && /*#__PURE__*/
|
|
1723
|
+
})), contentPosition === "bottom" && text && Icon && /*#__PURE__*/React__default["default"].createElement("div", {
|
|
4238
1724
|
className: "four-col-twelve-story-m_other-news-link__1PEl4"
|
|
4239
|
-
}, /*#__PURE__*/
|
|
1725
|
+
}, /*#__PURE__*/React__default["default"].createElement(OtherNewsLinkComp, {
|
|
4240
1726
|
textColor: textColor,
|
|
4241
1727
|
Icon: Icon,
|
|
4242
1728
|
slug: slug,
|
|
@@ -4262,24 +1748,24 @@ var FourColTwelveStoriesBase = function FourColTwelveStoriesBase(_ref5) {
|
|
|
4262
1748
|
collectionNameTemplate = _config$collectionNam === void 0 ? "" : _config$collectionNam;
|
|
4263
1749
|
var footerSlot = footerSlotConfig.footerSlot;
|
|
4264
1750
|
var footerSlotComp = footerSlot ? footerSlot() : null;
|
|
4265
|
-
var getFilteredCollection =
|
|
1751
|
+
var getFilteredCollection = lodash.get(collection, ["items"], []).filter(function (collections) {
|
|
4266
1752
|
return collections.type === "collection";
|
|
4267
1753
|
}); // if number of collection is less than 4 return null
|
|
4268
1754
|
|
|
4269
1755
|
if (getFilteredCollection.length < 4) return null;
|
|
4270
1756
|
var textColor = getTextColor(theme);
|
|
4271
|
-
return /*#__PURE__*/
|
|
1757
|
+
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
4272
1758
|
className: "full-width-with-padding arrow-component",
|
|
4273
1759
|
"data-test-id": "four-col-twelve-stories",
|
|
4274
1760
|
style: {
|
|
4275
1761
|
backgroundColor: theme,
|
|
4276
1762
|
color: textColor
|
|
4277
1763
|
}
|
|
4278
|
-
}, /*#__PURE__*/
|
|
1764
|
+
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
4279
1765
|
className: "four-col-twelve-story-m_columns-container__1YHu8"
|
|
4280
1766
|
}, getFilteredCollection.slice(0, 4).map(function (collection, index) {
|
|
4281
1767
|
var slugName = getSlug(collection, publisherConfig);
|
|
4282
|
-
return /*#__PURE__*/
|
|
1768
|
+
return /*#__PURE__*/React__default["default"].createElement(SingleCol3Story, {
|
|
4283
1769
|
border: border,
|
|
4284
1770
|
collection: collection,
|
|
4285
1771
|
collectionNameTemplate: collectionNameTemplate,
|
|
@@ -4291,45 +1777,46 @@ var FourColTwelveStoriesBase = function FourColTwelveStoriesBase(_ref5) {
|
|
|
4291
1777
|
})), footerSlotComp);
|
|
4292
1778
|
};
|
|
4293
1779
|
FourColTwelveStoriesBase.propTypes = {
|
|
4294
|
-
collection:
|
|
4295
|
-
publisherConfig:
|
|
4296
|
-
otherTextData:
|
|
4297
|
-
text:
|
|
4298
|
-
Icon:
|
|
4299
|
-
textColor:
|
|
1780
|
+
collection: PropTypes__default["default"].object.isRequired,
|
|
1781
|
+
publisherConfig: PropTypes__default["default"].object,
|
|
1782
|
+
otherTextData: PropTypes__default["default"].shape({
|
|
1783
|
+
text: PropTypes__default["default"].string,
|
|
1784
|
+
Icon: PropTypes__default["default"].func,
|
|
1785
|
+
textColor: PropTypes__default["default"].string
|
|
4300
1786
|
}),
|
|
4301
|
-
config:
|
|
4302
|
-
theme:
|
|
4303
|
-
border:
|
|
4304
|
-
showSection:
|
|
4305
|
-
showSubheadline:
|
|
4306
|
-
showAuthor:
|
|
4307
|
-
showTime:
|
|
4308
|
-
showRowTitle:
|
|
4309
|
-
collectionNameTemplate:
|
|
1787
|
+
config: PropTypes__default["default"].shape({
|
|
1788
|
+
theme: PropTypes__default["default"].string,
|
|
1789
|
+
border: PropTypes__default["default"].string,
|
|
1790
|
+
showSection: PropTypes__default["default"].bool,
|
|
1791
|
+
showSubheadline: PropTypes__default["default"].bool,
|
|
1792
|
+
showAuthor: PropTypes__default["default"].bool,
|
|
1793
|
+
showTime: PropTypes__default["default"].bool,
|
|
1794
|
+
showRowTitle: PropTypes__default["default"].bool,
|
|
1795
|
+
collectionNameTemplate: PropTypes__default["default"].string
|
|
4310
1796
|
})
|
|
4311
1797
|
};
|
|
4312
1798
|
SingleCol3Story.propTypes = {
|
|
4313
|
-
collection:
|
|
4314
|
-
border:
|
|
4315
|
-
collectionNameTemplate:
|
|
4316
|
-
slug:
|
|
4317
|
-
theme:
|
|
4318
|
-
otherTextData:
|
|
4319
|
-
text:
|
|
4320
|
-
Icon:
|
|
4321
|
-
textColor:
|
|
1799
|
+
collection: PropTypes__default["default"].object.isRequired,
|
|
1800
|
+
border: PropTypes__default["default"].string,
|
|
1801
|
+
collectionNameTemplate: PropTypes__default["default"].string,
|
|
1802
|
+
slug: PropTypes__default["default"].string,
|
|
1803
|
+
theme: PropTypes__default["default"].string,
|
|
1804
|
+
otherTextData: PropTypes__default["default"].shape({
|
|
1805
|
+
text: PropTypes__default["default"].string,
|
|
1806
|
+
Icon: PropTypes__default["default"].func,
|
|
1807
|
+
textColor: PropTypes__default["default"].string,
|
|
4322
1808
|
// can be either 'top' or 'bottom'
|
|
4323
|
-
contentPosition:
|
|
1809
|
+
contentPosition: PropTypes__default["default"].string
|
|
4324
1810
|
}),
|
|
4325
|
-
config:
|
|
1811
|
+
config: PropTypes__default["default"].object
|
|
4326
1812
|
};
|
|
4327
1813
|
OtherNewsLinkComp.propTypes = {
|
|
4328
|
-
slug:
|
|
4329
|
-
textColor:
|
|
4330
|
-
Icon:
|
|
4331
|
-
text:
|
|
1814
|
+
slug: PropTypes__default["default"].string,
|
|
1815
|
+
textColor: PropTypes__default["default"].string,
|
|
1816
|
+
Icon: PropTypes__default["default"].func,
|
|
1817
|
+
text: PropTypes__default["default"].string
|
|
4332
1818
|
};
|
|
4333
1819
|
var FourColTwelveStories = StateProvider(FourColTwelveStoriesBase);
|
|
4334
1820
|
|
|
4335
|
-
|
|
1821
|
+
exports.FourColTwelveStories = FourColTwelveStories;
|
|
1822
|
+
exports.FourColTwelveStoriesBase = FourColTwelveStoriesBase;
|