@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
package/rows/Listicles/index.js
CHANGED
|
@@ -1,2235 +1,48 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
function _next(value) {
|
|
33
|
-
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
function _throw(err) {
|
|
37
|
-
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
_next(undefined);
|
|
41
|
-
});
|
|
42
|
-
};
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
function _defineProperty(obj, key, value) {
|
|
46
|
-
if (key in obj) {
|
|
47
|
-
Object.defineProperty(obj, key, {
|
|
48
|
-
value: value,
|
|
49
|
-
enumerable: true,
|
|
50
|
-
configurable: true,
|
|
51
|
-
writable: true
|
|
52
|
-
});
|
|
53
|
-
} else {
|
|
54
|
-
obj[key] = value;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
return obj;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
function _arrayWithHoles(arr) {
|
|
61
|
-
if (Array.isArray(arr)) return arr;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
function _iterableToArrayLimit(arr, i) {
|
|
65
|
-
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
66
|
-
|
|
67
|
-
if (_i == null) return;
|
|
68
|
-
var _arr = [];
|
|
69
|
-
var _n = true;
|
|
70
|
-
var _d = false;
|
|
71
|
-
|
|
72
|
-
var _s, _e;
|
|
73
|
-
|
|
74
|
-
try {
|
|
75
|
-
for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {
|
|
76
|
-
_arr.push(_s.value);
|
|
77
|
-
|
|
78
|
-
if (i && _arr.length === i) break;
|
|
79
|
-
}
|
|
80
|
-
} catch (err) {
|
|
81
|
-
_d = true;
|
|
82
|
-
_e = err;
|
|
83
|
-
} finally {
|
|
84
|
-
try {
|
|
85
|
-
if (!_n && _i["return"] != null) _i["return"]();
|
|
86
|
-
} finally {
|
|
87
|
-
if (_d) throw _e;
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
return _arr;
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
function _arrayLikeToArray(arr, len) {
|
|
95
|
-
if (len == null || len > arr.length) len = arr.length;
|
|
96
|
-
|
|
97
|
-
for (var i = 0, arr2 = new Array(len); i < len; i++) {
|
|
98
|
-
arr2[i] = arr[i];
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
return arr2;
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
function _unsupportedIterableToArray(o, minLen) {
|
|
105
|
-
if (!o) return;
|
|
106
|
-
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
|
|
107
|
-
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
108
|
-
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
109
|
-
if (n === "Map" || n === "Set") return Array.from(o);
|
|
110
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
function _nonIterableRest() {
|
|
114
|
-
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
function _slicedToArray(arr, i) {
|
|
118
|
-
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
122
|
-
|
|
123
|
-
function getDefaultExportFromCjs (x) {
|
|
124
|
-
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
function createCommonjsModule(fn) {
|
|
128
|
-
var module = { exports: {} };
|
|
129
|
-
return fn(module, module.exports), module.exports;
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
/**
|
|
133
|
-
* Copyright (c) 2014-present, Facebook, Inc.
|
|
134
|
-
*
|
|
135
|
-
* This source code is licensed under the MIT license found in the
|
|
136
|
-
* LICENSE file in the root directory of this source tree.
|
|
137
|
-
*/
|
|
138
|
-
|
|
139
|
-
var runtime_1 = createCommonjsModule(function (module) {
|
|
140
|
-
var runtime = (function (exports) {
|
|
141
|
-
|
|
142
|
-
var Op = Object.prototype;
|
|
143
|
-
var hasOwn = Op.hasOwnProperty;
|
|
144
|
-
var undefined$1; // More compressible than void 0.
|
|
145
|
-
var $Symbol = typeof Symbol === "function" ? Symbol : {};
|
|
146
|
-
var iteratorSymbol = $Symbol.iterator || "@@iterator";
|
|
147
|
-
var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator";
|
|
148
|
-
var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
|
|
149
|
-
|
|
150
|
-
function define(obj, key, value) {
|
|
151
|
-
Object.defineProperty(obj, key, {
|
|
152
|
-
value: value,
|
|
153
|
-
enumerable: true,
|
|
154
|
-
configurable: true,
|
|
155
|
-
writable: true
|
|
156
|
-
});
|
|
157
|
-
return obj[key];
|
|
158
|
-
}
|
|
159
|
-
try {
|
|
160
|
-
// IE 8 has a broken Object.defineProperty that only works on DOM objects.
|
|
161
|
-
define({}, "");
|
|
162
|
-
} catch (err) {
|
|
163
|
-
define = function(obj, key, value) {
|
|
164
|
-
return obj[key] = value;
|
|
165
|
-
};
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
function wrap(innerFn, outerFn, self, tryLocsList) {
|
|
169
|
-
// If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.
|
|
170
|
-
var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;
|
|
171
|
-
var generator = Object.create(protoGenerator.prototype);
|
|
172
|
-
var context = new Context(tryLocsList || []);
|
|
173
|
-
|
|
174
|
-
// The ._invoke method unifies the implementations of the .next,
|
|
175
|
-
// .throw, and .return methods.
|
|
176
|
-
generator._invoke = makeInvokeMethod(innerFn, self, context);
|
|
177
|
-
|
|
178
|
-
return generator;
|
|
179
|
-
}
|
|
180
|
-
exports.wrap = wrap;
|
|
181
|
-
|
|
182
|
-
// Try/catch helper to minimize deoptimizations. Returns a completion
|
|
183
|
-
// record like context.tryEntries[i].completion. This interface could
|
|
184
|
-
// have been (and was previously) designed to take a closure to be
|
|
185
|
-
// invoked without arguments, but in all the cases we care about we
|
|
186
|
-
// already have an existing method we want to call, so there's no need
|
|
187
|
-
// to create a new function object. We can even get away with assuming
|
|
188
|
-
// the method takes exactly one argument, since that happens to be true
|
|
189
|
-
// in every case, so we don't have to touch the arguments object. The
|
|
190
|
-
// only additional allocation required is the completion record, which
|
|
191
|
-
// has a stable shape and so hopefully should be cheap to allocate.
|
|
192
|
-
function tryCatch(fn, obj, arg) {
|
|
193
|
-
try {
|
|
194
|
-
return { type: "normal", arg: fn.call(obj, arg) };
|
|
195
|
-
} catch (err) {
|
|
196
|
-
return { type: "throw", arg: err };
|
|
197
|
-
}
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
var GenStateSuspendedStart = "suspendedStart";
|
|
201
|
-
var GenStateSuspendedYield = "suspendedYield";
|
|
202
|
-
var GenStateExecuting = "executing";
|
|
203
|
-
var GenStateCompleted = "completed";
|
|
204
|
-
|
|
205
|
-
// Returning this object from the innerFn has the same effect as
|
|
206
|
-
// breaking out of the dispatch switch statement.
|
|
207
|
-
var ContinueSentinel = {};
|
|
208
|
-
|
|
209
|
-
// Dummy constructor functions that we use as the .constructor and
|
|
210
|
-
// .constructor.prototype properties for functions that return Generator
|
|
211
|
-
// objects. For full spec compliance, you may wish to configure your
|
|
212
|
-
// minifier not to mangle the names of these two functions.
|
|
213
|
-
function Generator() {}
|
|
214
|
-
function GeneratorFunction() {}
|
|
215
|
-
function GeneratorFunctionPrototype() {}
|
|
216
|
-
|
|
217
|
-
// This is a polyfill for %IteratorPrototype% for environments that
|
|
218
|
-
// don't natively support it.
|
|
219
|
-
var IteratorPrototype = {};
|
|
220
|
-
define(IteratorPrototype, iteratorSymbol, function () {
|
|
221
|
-
return this;
|
|
222
|
-
});
|
|
223
|
-
|
|
224
|
-
var getProto = Object.getPrototypeOf;
|
|
225
|
-
var NativeIteratorPrototype = getProto && getProto(getProto(values([])));
|
|
226
|
-
if (NativeIteratorPrototype &&
|
|
227
|
-
NativeIteratorPrototype !== Op &&
|
|
228
|
-
hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {
|
|
229
|
-
// This environment has a native %IteratorPrototype%; use it instead
|
|
230
|
-
// of the polyfill.
|
|
231
|
-
IteratorPrototype = NativeIteratorPrototype;
|
|
232
|
-
}
|
|
233
|
-
|
|
234
|
-
var Gp = GeneratorFunctionPrototype.prototype =
|
|
235
|
-
Generator.prototype = Object.create(IteratorPrototype);
|
|
236
|
-
GeneratorFunction.prototype = GeneratorFunctionPrototype;
|
|
237
|
-
define(Gp, "constructor", GeneratorFunctionPrototype);
|
|
238
|
-
define(GeneratorFunctionPrototype, "constructor", GeneratorFunction);
|
|
239
|
-
GeneratorFunction.displayName = define(
|
|
240
|
-
GeneratorFunctionPrototype,
|
|
241
|
-
toStringTagSymbol,
|
|
242
|
-
"GeneratorFunction"
|
|
243
|
-
);
|
|
244
|
-
|
|
245
|
-
// Helper for defining the .next, .throw, and .return methods of the
|
|
246
|
-
// Iterator interface in terms of a single ._invoke method.
|
|
247
|
-
function defineIteratorMethods(prototype) {
|
|
248
|
-
["next", "throw", "return"].forEach(function(method) {
|
|
249
|
-
define(prototype, method, function(arg) {
|
|
250
|
-
return this._invoke(method, arg);
|
|
251
|
-
});
|
|
252
|
-
});
|
|
253
|
-
}
|
|
254
|
-
|
|
255
|
-
exports.isGeneratorFunction = function(genFun) {
|
|
256
|
-
var ctor = typeof genFun === "function" && genFun.constructor;
|
|
257
|
-
return ctor
|
|
258
|
-
? ctor === GeneratorFunction ||
|
|
259
|
-
// For the native GeneratorFunction constructor, the best we can
|
|
260
|
-
// do is to check its .name property.
|
|
261
|
-
(ctor.displayName || ctor.name) === "GeneratorFunction"
|
|
262
|
-
: false;
|
|
263
|
-
};
|
|
264
|
-
|
|
265
|
-
exports.mark = function(genFun) {
|
|
266
|
-
if (Object.setPrototypeOf) {
|
|
267
|
-
Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);
|
|
268
|
-
} else {
|
|
269
|
-
genFun.__proto__ = GeneratorFunctionPrototype;
|
|
270
|
-
define(genFun, toStringTagSymbol, "GeneratorFunction");
|
|
271
|
-
}
|
|
272
|
-
genFun.prototype = Object.create(Gp);
|
|
273
|
-
return genFun;
|
|
274
|
-
};
|
|
275
|
-
|
|
276
|
-
// Within the body of any async function, `await x` is transformed to
|
|
277
|
-
// `yield regeneratorRuntime.awrap(x)`, so that the runtime can test
|
|
278
|
-
// `hasOwn.call(value, "__await")` to determine if the yielded value is
|
|
279
|
-
// meant to be awaited.
|
|
280
|
-
exports.awrap = function(arg) {
|
|
281
|
-
return { __await: arg };
|
|
282
|
-
};
|
|
283
|
-
|
|
284
|
-
function AsyncIterator(generator, PromiseImpl) {
|
|
285
|
-
function invoke(method, arg, resolve, reject) {
|
|
286
|
-
var record = tryCatch(generator[method], generator, arg);
|
|
287
|
-
if (record.type === "throw") {
|
|
288
|
-
reject(record.arg);
|
|
289
|
-
} else {
|
|
290
|
-
var result = record.arg;
|
|
291
|
-
var value = result.value;
|
|
292
|
-
if (value &&
|
|
293
|
-
typeof value === "object" &&
|
|
294
|
-
hasOwn.call(value, "__await")) {
|
|
295
|
-
return PromiseImpl.resolve(value.__await).then(function(value) {
|
|
296
|
-
invoke("next", value, resolve, reject);
|
|
297
|
-
}, function(err) {
|
|
298
|
-
invoke("throw", err, resolve, reject);
|
|
299
|
-
});
|
|
300
|
-
}
|
|
301
|
-
|
|
302
|
-
return PromiseImpl.resolve(value).then(function(unwrapped) {
|
|
303
|
-
// When a yielded Promise is resolved, its final value becomes
|
|
304
|
-
// the .value of the Promise<{value,done}> result for the
|
|
305
|
-
// current iteration.
|
|
306
|
-
result.value = unwrapped;
|
|
307
|
-
resolve(result);
|
|
308
|
-
}, function(error) {
|
|
309
|
-
// If a rejected Promise was yielded, throw the rejection back
|
|
310
|
-
// into the async generator function so it can be handled there.
|
|
311
|
-
return invoke("throw", error, resolve, reject);
|
|
312
|
-
});
|
|
313
|
-
}
|
|
314
|
-
}
|
|
315
|
-
|
|
316
|
-
var previousPromise;
|
|
317
|
-
|
|
318
|
-
function enqueue(method, arg) {
|
|
319
|
-
function callInvokeWithMethodAndArg() {
|
|
320
|
-
return new PromiseImpl(function(resolve, reject) {
|
|
321
|
-
invoke(method, arg, resolve, reject);
|
|
322
|
-
});
|
|
323
|
-
}
|
|
324
|
-
|
|
325
|
-
return previousPromise =
|
|
326
|
-
// If enqueue has been called before, then we want to wait until
|
|
327
|
-
// all previous Promises have been resolved before calling invoke,
|
|
328
|
-
// so that results are always delivered in the correct order. If
|
|
329
|
-
// enqueue has not been called before, then it is important to
|
|
330
|
-
// call invoke immediately, without waiting on a callback to fire,
|
|
331
|
-
// so that the async generator function has the opportunity to do
|
|
332
|
-
// any necessary setup in a predictable way. This predictability
|
|
333
|
-
// is why the Promise constructor synchronously invokes its
|
|
334
|
-
// executor callback, and why async functions synchronously
|
|
335
|
-
// execute code before the first await. Since we implement simple
|
|
336
|
-
// async functions in terms of async generators, it is especially
|
|
337
|
-
// important to get this right, even though it requires care.
|
|
338
|
-
previousPromise ? previousPromise.then(
|
|
339
|
-
callInvokeWithMethodAndArg,
|
|
340
|
-
// Avoid propagating failures to Promises returned by later
|
|
341
|
-
// invocations of the iterator.
|
|
342
|
-
callInvokeWithMethodAndArg
|
|
343
|
-
) : callInvokeWithMethodAndArg();
|
|
344
|
-
}
|
|
345
|
-
|
|
346
|
-
// Define the unified helper method that is used to implement .next,
|
|
347
|
-
// .throw, and .return (see defineIteratorMethods).
|
|
348
|
-
this._invoke = enqueue;
|
|
349
|
-
}
|
|
350
|
-
|
|
351
|
-
defineIteratorMethods(AsyncIterator.prototype);
|
|
352
|
-
define(AsyncIterator.prototype, asyncIteratorSymbol, function () {
|
|
353
|
-
return this;
|
|
354
|
-
});
|
|
355
|
-
exports.AsyncIterator = AsyncIterator;
|
|
356
|
-
|
|
357
|
-
// Note that simple async functions are implemented on top of
|
|
358
|
-
// AsyncIterator objects; they just return a Promise for the value of
|
|
359
|
-
// the final result produced by the iterator.
|
|
360
|
-
exports.async = function(innerFn, outerFn, self, tryLocsList, PromiseImpl) {
|
|
361
|
-
if (PromiseImpl === void 0) PromiseImpl = Promise;
|
|
362
|
-
|
|
363
|
-
var iter = new AsyncIterator(
|
|
364
|
-
wrap(innerFn, outerFn, self, tryLocsList),
|
|
365
|
-
PromiseImpl
|
|
366
|
-
);
|
|
367
|
-
|
|
368
|
-
return exports.isGeneratorFunction(outerFn)
|
|
369
|
-
? iter // If outerFn is a generator, return the full iterator.
|
|
370
|
-
: iter.next().then(function(result) {
|
|
371
|
-
return result.done ? result.value : iter.next();
|
|
372
|
-
});
|
|
373
|
-
};
|
|
374
|
-
|
|
375
|
-
function makeInvokeMethod(innerFn, self, context) {
|
|
376
|
-
var state = GenStateSuspendedStart;
|
|
377
|
-
|
|
378
|
-
return function invoke(method, arg) {
|
|
379
|
-
if (state === GenStateExecuting) {
|
|
380
|
-
throw new Error("Generator is already running");
|
|
381
|
-
}
|
|
382
|
-
|
|
383
|
-
if (state === GenStateCompleted) {
|
|
384
|
-
if (method === "throw") {
|
|
385
|
-
throw arg;
|
|
386
|
-
}
|
|
387
|
-
|
|
388
|
-
// Be forgiving, per 25.3.3.3.3 of the spec:
|
|
389
|
-
// https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume
|
|
390
|
-
return doneResult();
|
|
391
|
-
}
|
|
392
|
-
|
|
393
|
-
context.method = method;
|
|
394
|
-
context.arg = arg;
|
|
395
|
-
|
|
396
|
-
while (true) {
|
|
397
|
-
var delegate = context.delegate;
|
|
398
|
-
if (delegate) {
|
|
399
|
-
var delegateResult = maybeInvokeDelegate(delegate, context);
|
|
400
|
-
if (delegateResult) {
|
|
401
|
-
if (delegateResult === ContinueSentinel) continue;
|
|
402
|
-
return delegateResult;
|
|
403
|
-
}
|
|
404
|
-
}
|
|
405
|
-
|
|
406
|
-
if (context.method === "next") {
|
|
407
|
-
// Setting context._sent for legacy support of Babel's
|
|
408
|
-
// function.sent implementation.
|
|
409
|
-
context.sent = context._sent = context.arg;
|
|
410
|
-
|
|
411
|
-
} else if (context.method === "throw") {
|
|
412
|
-
if (state === GenStateSuspendedStart) {
|
|
413
|
-
state = GenStateCompleted;
|
|
414
|
-
throw context.arg;
|
|
415
|
-
}
|
|
416
|
-
|
|
417
|
-
context.dispatchException(context.arg);
|
|
418
|
-
|
|
419
|
-
} else if (context.method === "return") {
|
|
420
|
-
context.abrupt("return", context.arg);
|
|
421
|
-
}
|
|
422
|
-
|
|
423
|
-
state = GenStateExecuting;
|
|
424
|
-
|
|
425
|
-
var record = tryCatch(innerFn, self, context);
|
|
426
|
-
if (record.type === "normal") {
|
|
427
|
-
// If an exception is thrown from innerFn, we leave state ===
|
|
428
|
-
// GenStateExecuting and loop back for another invocation.
|
|
429
|
-
state = context.done
|
|
430
|
-
? GenStateCompleted
|
|
431
|
-
: GenStateSuspendedYield;
|
|
432
|
-
|
|
433
|
-
if (record.arg === ContinueSentinel) {
|
|
434
|
-
continue;
|
|
435
|
-
}
|
|
436
|
-
|
|
437
|
-
return {
|
|
438
|
-
value: record.arg,
|
|
439
|
-
done: context.done
|
|
440
|
-
};
|
|
441
|
-
|
|
442
|
-
} else if (record.type === "throw") {
|
|
443
|
-
state = GenStateCompleted;
|
|
444
|
-
// Dispatch the exception by looping back around to the
|
|
445
|
-
// context.dispatchException(context.arg) call above.
|
|
446
|
-
context.method = "throw";
|
|
447
|
-
context.arg = record.arg;
|
|
448
|
-
}
|
|
449
|
-
}
|
|
450
|
-
};
|
|
451
|
-
}
|
|
452
|
-
|
|
453
|
-
// Call delegate.iterator[context.method](context.arg) and handle the
|
|
454
|
-
// result, either by returning a { value, done } result from the
|
|
455
|
-
// delegate iterator, or by modifying context.method and context.arg,
|
|
456
|
-
// setting context.delegate to null, and returning the ContinueSentinel.
|
|
457
|
-
function maybeInvokeDelegate(delegate, context) {
|
|
458
|
-
var method = delegate.iterator[context.method];
|
|
459
|
-
if (method === undefined$1) {
|
|
460
|
-
// A .throw or .return when the delegate iterator has no .throw
|
|
461
|
-
// method always terminates the yield* loop.
|
|
462
|
-
context.delegate = null;
|
|
463
|
-
|
|
464
|
-
if (context.method === "throw") {
|
|
465
|
-
// Note: ["return"] must be used for ES3 parsing compatibility.
|
|
466
|
-
if (delegate.iterator["return"]) {
|
|
467
|
-
// If the delegate iterator has a return method, give it a
|
|
468
|
-
// chance to clean up.
|
|
469
|
-
context.method = "return";
|
|
470
|
-
context.arg = undefined$1;
|
|
471
|
-
maybeInvokeDelegate(delegate, context);
|
|
472
|
-
|
|
473
|
-
if (context.method === "throw") {
|
|
474
|
-
// If maybeInvokeDelegate(context) changed context.method from
|
|
475
|
-
// "return" to "throw", let that override the TypeError below.
|
|
476
|
-
return ContinueSentinel;
|
|
477
|
-
}
|
|
478
|
-
}
|
|
479
|
-
|
|
480
|
-
context.method = "throw";
|
|
481
|
-
context.arg = new TypeError(
|
|
482
|
-
"The iterator does not provide a 'throw' method");
|
|
483
|
-
}
|
|
484
|
-
|
|
485
|
-
return ContinueSentinel;
|
|
486
|
-
}
|
|
487
|
-
|
|
488
|
-
var record = tryCatch(method, delegate.iterator, context.arg);
|
|
489
|
-
|
|
490
|
-
if (record.type === "throw") {
|
|
491
|
-
context.method = "throw";
|
|
492
|
-
context.arg = record.arg;
|
|
493
|
-
context.delegate = null;
|
|
494
|
-
return ContinueSentinel;
|
|
495
|
-
}
|
|
496
|
-
|
|
497
|
-
var info = record.arg;
|
|
498
|
-
|
|
499
|
-
if (! info) {
|
|
500
|
-
context.method = "throw";
|
|
501
|
-
context.arg = new TypeError("iterator result is not an object");
|
|
502
|
-
context.delegate = null;
|
|
503
|
-
return ContinueSentinel;
|
|
504
|
-
}
|
|
505
|
-
|
|
506
|
-
if (info.done) {
|
|
507
|
-
// Assign the result of the finished delegate to the temporary
|
|
508
|
-
// variable specified by delegate.resultName (see delegateYield).
|
|
509
|
-
context[delegate.resultName] = info.value;
|
|
510
|
-
|
|
511
|
-
// Resume execution at the desired location (see delegateYield).
|
|
512
|
-
context.next = delegate.nextLoc;
|
|
513
|
-
|
|
514
|
-
// If context.method was "throw" but the delegate handled the
|
|
515
|
-
// exception, let the outer generator proceed normally. If
|
|
516
|
-
// context.method was "next", forget context.arg since it has been
|
|
517
|
-
// "consumed" by the delegate iterator. If context.method was
|
|
518
|
-
// "return", allow the original .return call to continue in the
|
|
519
|
-
// outer generator.
|
|
520
|
-
if (context.method !== "return") {
|
|
521
|
-
context.method = "next";
|
|
522
|
-
context.arg = undefined$1;
|
|
523
|
-
}
|
|
524
|
-
|
|
525
|
-
} else {
|
|
526
|
-
// Re-yield the result returned by the delegate method.
|
|
527
|
-
return info;
|
|
528
|
-
}
|
|
529
|
-
|
|
530
|
-
// The delegate iterator is finished, so forget it and continue with
|
|
531
|
-
// the outer generator.
|
|
532
|
-
context.delegate = null;
|
|
533
|
-
return ContinueSentinel;
|
|
534
|
-
}
|
|
535
|
-
|
|
536
|
-
// Define Generator.prototype.{next,throw,return} in terms of the
|
|
537
|
-
// unified ._invoke helper method.
|
|
538
|
-
defineIteratorMethods(Gp);
|
|
539
|
-
|
|
540
|
-
define(Gp, toStringTagSymbol, "Generator");
|
|
541
|
-
|
|
542
|
-
// A Generator should always return itself as the iterator object when the
|
|
543
|
-
// @@iterator function is called on it. Some browsers' implementations of the
|
|
544
|
-
// iterator prototype chain incorrectly implement this, causing the Generator
|
|
545
|
-
// object to not be returned from this call. This ensures that doesn't happen.
|
|
546
|
-
// See https://github.com/facebook/regenerator/issues/274 for more details.
|
|
547
|
-
define(Gp, iteratorSymbol, function() {
|
|
548
|
-
return this;
|
|
549
|
-
});
|
|
550
|
-
|
|
551
|
-
define(Gp, "toString", function() {
|
|
552
|
-
return "[object Generator]";
|
|
553
|
-
});
|
|
554
|
-
|
|
555
|
-
function pushTryEntry(locs) {
|
|
556
|
-
var entry = { tryLoc: locs[0] };
|
|
557
|
-
|
|
558
|
-
if (1 in locs) {
|
|
559
|
-
entry.catchLoc = locs[1];
|
|
560
|
-
}
|
|
561
|
-
|
|
562
|
-
if (2 in locs) {
|
|
563
|
-
entry.finallyLoc = locs[2];
|
|
564
|
-
entry.afterLoc = locs[3];
|
|
565
|
-
}
|
|
566
|
-
|
|
567
|
-
this.tryEntries.push(entry);
|
|
568
|
-
}
|
|
569
|
-
|
|
570
|
-
function resetTryEntry(entry) {
|
|
571
|
-
var record = entry.completion || {};
|
|
572
|
-
record.type = "normal";
|
|
573
|
-
delete record.arg;
|
|
574
|
-
entry.completion = record;
|
|
575
|
-
}
|
|
576
|
-
|
|
577
|
-
function Context(tryLocsList) {
|
|
578
|
-
// The root entry object (effectively a try statement without a catch
|
|
579
|
-
// or a finally block) gives us a place to store values thrown from
|
|
580
|
-
// locations where there is no enclosing try statement.
|
|
581
|
-
this.tryEntries = [{ tryLoc: "root" }];
|
|
582
|
-
tryLocsList.forEach(pushTryEntry, this);
|
|
583
|
-
this.reset(true);
|
|
584
|
-
}
|
|
585
|
-
|
|
586
|
-
exports.keys = function(object) {
|
|
587
|
-
var keys = [];
|
|
588
|
-
for (var key in object) {
|
|
589
|
-
keys.push(key);
|
|
590
|
-
}
|
|
591
|
-
keys.reverse();
|
|
592
|
-
|
|
593
|
-
// Rather than returning an object with a next method, we keep
|
|
594
|
-
// things simple and return the next function itself.
|
|
595
|
-
return function next() {
|
|
596
|
-
while (keys.length) {
|
|
597
|
-
var key = keys.pop();
|
|
598
|
-
if (key in object) {
|
|
599
|
-
next.value = key;
|
|
600
|
-
next.done = false;
|
|
601
|
-
return next;
|
|
602
|
-
}
|
|
603
|
-
}
|
|
604
|
-
|
|
605
|
-
// To avoid creating an additional object, we just hang the .value
|
|
606
|
-
// and .done properties off the next function object itself. This
|
|
607
|
-
// also ensures that the minifier will not anonymize the function.
|
|
608
|
-
next.done = true;
|
|
609
|
-
return next;
|
|
610
|
-
};
|
|
611
|
-
};
|
|
612
|
-
|
|
613
|
-
function values(iterable) {
|
|
614
|
-
if (iterable) {
|
|
615
|
-
var iteratorMethod = iterable[iteratorSymbol];
|
|
616
|
-
if (iteratorMethod) {
|
|
617
|
-
return iteratorMethod.call(iterable);
|
|
618
|
-
}
|
|
619
|
-
|
|
620
|
-
if (typeof iterable.next === "function") {
|
|
621
|
-
return iterable;
|
|
622
|
-
}
|
|
623
|
-
|
|
624
|
-
if (!isNaN(iterable.length)) {
|
|
625
|
-
var i = -1, next = function next() {
|
|
626
|
-
while (++i < iterable.length) {
|
|
627
|
-
if (hasOwn.call(iterable, i)) {
|
|
628
|
-
next.value = iterable[i];
|
|
629
|
-
next.done = false;
|
|
630
|
-
return next;
|
|
631
|
-
}
|
|
632
|
-
}
|
|
633
|
-
|
|
634
|
-
next.value = undefined$1;
|
|
635
|
-
next.done = true;
|
|
636
|
-
|
|
637
|
-
return next;
|
|
638
|
-
};
|
|
639
|
-
|
|
640
|
-
return next.next = next;
|
|
641
|
-
}
|
|
642
|
-
}
|
|
643
|
-
|
|
644
|
-
// Return an iterator with no values.
|
|
645
|
-
return { next: doneResult };
|
|
646
|
-
}
|
|
647
|
-
exports.values = values;
|
|
648
|
-
|
|
649
|
-
function doneResult() {
|
|
650
|
-
return { value: undefined$1, done: true };
|
|
651
|
-
}
|
|
652
|
-
|
|
653
|
-
Context.prototype = {
|
|
654
|
-
constructor: Context,
|
|
655
|
-
|
|
656
|
-
reset: function(skipTempReset) {
|
|
657
|
-
this.prev = 0;
|
|
658
|
-
this.next = 0;
|
|
659
|
-
// Resetting context._sent for legacy support of Babel's
|
|
660
|
-
// function.sent implementation.
|
|
661
|
-
this.sent = this._sent = undefined$1;
|
|
662
|
-
this.done = false;
|
|
663
|
-
this.delegate = null;
|
|
664
|
-
|
|
665
|
-
this.method = "next";
|
|
666
|
-
this.arg = undefined$1;
|
|
667
|
-
|
|
668
|
-
this.tryEntries.forEach(resetTryEntry);
|
|
669
|
-
|
|
670
|
-
if (!skipTempReset) {
|
|
671
|
-
for (var name in this) {
|
|
672
|
-
// Not sure about the optimal order of these conditions:
|
|
673
|
-
if (name.charAt(0) === "t" &&
|
|
674
|
-
hasOwn.call(this, name) &&
|
|
675
|
-
!isNaN(+name.slice(1))) {
|
|
676
|
-
this[name] = undefined$1;
|
|
677
|
-
}
|
|
678
|
-
}
|
|
679
|
-
}
|
|
680
|
-
},
|
|
681
|
-
|
|
682
|
-
stop: function() {
|
|
683
|
-
this.done = true;
|
|
684
|
-
|
|
685
|
-
var rootEntry = this.tryEntries[0];
|
|
686
|
-
var rootRecord = rootEntry.completion;
|
|
687
|
-
if (rootRecord.type === "throw") {
|
|
688
|
-
throw rootRecord.arg;
|
|
689
|
-
}
|
|
690
|
-
|
|
691
|
-
return this.rval;
|
|
692
|
-
},
|
|
693
|
-
|
|
694
|
-
dispatchException: function(exception) {
|
|
695
|
-
if (this.done) {
|
|
696
|
-
throw exception;
|
|
697
|
-
}
|
|
698
|
-
|
|
699
|
-
var context = this;
|
|
700
|
-
function handle(loc, caught) {
|
|
701
|
-
record.type = "throw";
|
|
702
|
-
record.arg = exception;
|
|
703
|
-
context.next = loc;
|
|
704
|
-
|
|
705
|
-
if (caught) {
|
|
706
|
-
// If the dispatched exception was caught by a catch block,
|
|
707
|
-
// then let that catch block handle the exception normally.
|
|
708
|
-
context.method = "next";
|
|
709
|
-
context.arg = undefined$1;
|
|
710
|
-
}
|
|
711
|
-
|
|
712
|
-
return !! caught;
|
|
713
|
-
}
|
|
714
|
-
|
|
715
|
-
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
716
|
-
var entry = this.tryEntries[i];
|
|
717
|
-
var record = entry.completion;
|
|
718
|
-
|
|
719
|
-
if (entry.tryLoc === "root") {
|
|
720
|
-
// Exception thrown outside of any try block that could handle
|
|
721
|
-
// it, so set the completion value of the entire function to
|
|
722
|
-
// throw the exception.
|
|
723
|
-
return handle("end");
|
|
724
|
-
}
|
|
725
|
-
|
|
726
|
-
if (entry.tryLoc <= this.prev) {
|
|
727
|
-
var hasCatch = hasOwn.call(entry, "catchLoc");
|
|
728
|
-
var hasFinally = hasOwn.call(entry, "finallyLoc");
|
|
729
|
-
|
|
730
|
-
if (hasCatch && hasFinally) {
|
|
731
|
-
if (this.prev < entry.catchLoc) {
|
|
732
|
-
return handle(entry.catchLoc, true);
|
|
733
|
-
} else if (this.prev < entry.finallyLoc) {
|
|
734
|
-
return handle(entry.finallyLoc);
|
|
735
|
-
}
|
|
736
|
-
|
|
737
|
-
} else if (hasCatch) {
|
|
738
|
-
if (this.prev < entry.catchLoc) {
|
|
739
|
-
return handle(entry.catchLoc, true);
|
|
740
|
-
}
|
|
741
|
-
|
|
742
|
-
} else if (hasFinally) {
|
|
743
|
-
if (this.prev < entry.finallyLoc) {
|
|
744
|
-
return handle(entry.finallyLoc);
|
|
745
|
-
}
|
|
746
|
-
|
|
747
|
-
} else {
|
|
748
|
-
throw new Error("try statement without catch or finally");
|
|
749
|
-
}
|
|
750
|
-
}
|
|
751
|
-
}
|
|
752
|
-
},
|
|
753
|
-
|
|
754
|
-
abrupt: function(type, arg) {
|
|
755
|
-
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
756
|
-
var entry = this.tryEntries[i];
|
|
757
|
-
if (entry.tryLoc <= this.prev &&
|
|
758
|
-
hasOwn.call(entry, "finallyLoc") &&
|
|
759
|
-
this.prev < entry.finallyLoc) {
|
|
760
|
-
var finallyEntry = entry;
|
|
761
|
-
break;
|
|
762
|
-
}
|
|
763
|
-
}
|
|
764
|
-
|
|
765
|
-
if (finallyEntry &&
|
|
766
|
-
(type === "break" ||
|
|
767
|
-
type === "continue") &&
|
|
768
|
-
finallyEntry.tryLoc <= arg &&
|
|
769
|
-
arg <= finallyEntry.finallyLoc) {
|
|
770
|
-
// Ignore the finally entry if control is not jumping to a
|
|
771
|
-
// location outside the try/catch block.
|
|
772
|
-
finallyEntry = null;
|
|
773
|
-
}
|
|
774
|
-
|
|
775
|
-
var record = finallyEntry ? finallyEntry.completion : {};
|
|
776
|
-
record.type = type;
|
|
777
|
-
record.arg = arg;
|
|
778
|
-
|
|
779
|
-
if (finallyEntry) {
|
|
780
|
-
this.method = "next";
|
|
781
|
-
this.next = finallyEntry.finallyLoc;
|
|
782
|
-
return ContinueSentinel;
|
|
783
|
-
}
|
|
784
|
-
|
|
785
|
-
return this.complete(record);
|
|
786
|
-
},
|
|
787
|
-
|
|
788
|
-
complete: function(record, afterLoc) {
|
|
789
|
-
if (record.type === "throw") {
|
|
790
|
-
throw record.arg;
|
|
791
|
-
}
|
|
792
|
-
|
|
793
|
-
if (record.type === "break" ||
|
|
794
|
-
record.type === "continue") {
|
|
795
|
-
this.next = record.arg;
|
|
796
|
-
} else if (record.type === "return") {
|
|
797
|
-
this.rval = this.arg = record.arg;
|
|
798
|
-
this.method = "return";
|
|
799
|
-
this.next = "end";
|
|
800
|
-
} else if (record.type === "normal" && afterLoc) {
|
|
801
|
-
this.next = afterLoc;
|
|
802
|
-
}
|
|
803
|
-
|
|
804
|
-
return ContinueSentinel;
|
|
805
|
-
},
|
|
806
|
-
|
|
807
|
-
finish: function(finallyLoc) {
|
|
808
|
-
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
809
|
-
var entry = this.tryEntries[i];
|
|
810
|
-
if (entry.finallyLoc === finallyLoc) {
|
|
811
|
-
this.complete(entry.completion, entry.afterLoc);
|
|
812
|
-
resetTryEntry(entry);
|
|
813
|
-
return ContinueSentinel;
|
|
814
|
-
}
|
|
815
|
-
}
|
|
816
|
-
},
|
|
817
|
-
|
|
818
|
-
"catch": function(tryLoc) {
|
|
819
|
-
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
820
|
-
var entry = this.tryEntries[i];
|
|
821
|
-
if (entry.tryLoc === tryLoc) {
|
|
822
|
-
var record = entry.completion;
|
|
823
|
-
if (record.type === "throw") {
|
|
824
|
-
var thrown = record.arg;
|
|
825
|
-
resetTryEntry(entry);
|
|
826
|
-
}
|
|
827
|
-
return thrown;
|
|
828
|
-
}
|
|
829
|
-
}
|
|
830
|
-
|
|
831
|
-
// The context.catch method must only be called with a location
|
|
832
|
-
// argument that corresponds to a known catch block.
|
|
833
|
-
throw new Error("illegal catch attempt");
|
|
834
|
-
},
|
|
835
|
-
|
|
836
|
-
delegateYield: function(iterable, resultName, nextLoc) {
|
|
837
|
-
this.delegate = {
|
|
838
|
-
iterator: values(iterable),
|
|
839
|
-
resultName: resultName,
|
|
840
|
-
nextLoc: nextLoc
|
|
841
|
-
};
|
|
842
|
-
|
|
843
|
-
if (this.method === "next") {
|
|
844
|
-
// Deliberately forget the last sent value so that we don't
|
|
845
|
-
// accidentally pass it on to the delegate.
|
|
846
|
-
this.arg = undefined$1;
|
|
847
|
-
}
|
|
848
|
-
|
|
849
|
-
return ContinueSentinel;
|
|
850
|
-
}
|
|
851
|
-
};
|
|
852
|
-
|
|
853
|
-
// Regardless of whether this script is executing as a CommonJS module
|
|
854
|
-
// or not, return the runtime object so that we can declare the variable
|
|
855
|
-
// regeneratorRuntime in the outer scope, which allows this module to be
|
|
856
|
-
// injected easily by `bin/regenerator --include-runtime script.js`.
|
|
857
|
-
return exports;
|
|
858
|
-
|
|
859
|
-
}(
|
|
860
|
-
// If this script is executing as a CommonJS module, use module.exports
|
|
861
|
-
// as the regeneratorRuntime namespace. Otherwise create a new empty
|
|
862
|
-
// object. Either way, the resulting object will be used to initialize
|
|
863
|
-
// the regeneratorRuntime variable at the top of this file.
|
|
864
|
-
module.exports
|
|
865
|
-
));
|
|
866
|
-
|
|
867
|
-
try {
|
|
868
|
-
regeneratorRuntime = runtime;
|
|
869
|
-
} catch (accidentalStrictMode) {
|
|
870
|
-
// This module should not be running in strict mode, so the above
|
|
871
|
-
// assignment should always work unless something is misconfigured. Just
|
|
872
|
-
// in case runtime.js accidentally runs in strict mode, in modern engines
|
|
873
|
-
// we can explicitly access globalThis. In older engines we can escape
|
|
874
|
-
// strict mode using a global Function call. This could conceivably fail
|
|
875
|
-
// if a Content Security Policy forbids using Function, but in that case
|
|
876
|
-
// the proper solution is to fix the accidental strict mode problem. If
|
|
877
|
-
// you've misconfigured your bundler to force strict mode and applied a
|
|
878
|
-
// CSP to forbid Function, and you're not willing to fix either of those
|
|
879
|
-
// problems, please detail your unique predicament in a GitHub issue.
|
|
880
|
-
if (typeof globalThis === "object") {
|
|
881
|
-
globalThis.regeneratorRuntime = runtime;
|
|
882
|
-
} else {
|
|
883
|
-
Function("r", "regeneratorRuntime = r")(runtime);
|
|
884
|
-
}
|
|
885
|
-
}
|
|
886
|
-
});
|
|
887
|
-
|
|
888
|
-
var regenerator = runtime_1;
|
|
889
|
-
|
|
890
|
-
var optionsDefaults_1 = createCommonjsModule(function (module, exports) {
|
|
891
|
-
|
|
892
|
-
Object.defineProperty(exports, "__esModule", {
|
|
893
|
-
value: true
|
|
894
|
-
});
|
|
895
|
-
exports["default"] = void 0;
|
|
896
|
-
var optionsDefaults = {
|
|
897
|
-
attributeNames: {
|
|
898
|
-
styleName: 'className'
|
|
899
|
-
},
|
|
900
|
-
generateScopedName: '[path]___[name]__[local]___[hash:base64:5]',
|
|
901
|
-
handleMissingStyleName: 'throw'
|
|
902
|
-
};
|
|
903
|
-
var _default = optionsDefaults;
|
|
904
|
-
exports["default"] = _default;
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
});
|
|
908
|
-
|
|
909
|
-
var getClassName = createCommonjsModule(function (module, exports) {
|
|
910
|
-
|
|
911
|
-
Object.defineProperty(exports, "__esModule", {
|
|
912
|
-
value: true
|
|
913
|
-
});
|
|
914
|
-
exports["default"] = void 0;
|
|
915
|
-
|
|
916
|
-
var _optionsDefaults = _interopRequireDefault(optionsDefaults_1);
|
|
917
|
-
|
|
918
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
919
|
-
|
|
920
|
-
var isNamespacedStyleName = function isNamespacedStyleName(styleName) {
|
|
921
|
-
return styleName.indexOf('.') !== -1;
|
|
922
|
-
};
|
|
923
|
-
|
|
924
|
-
var handleError = function handleError(message, handleMissingStyleName) {
|
|
925
|
-
if (handleMissingStyleName === 'throw') {
|
|
926
|
-
throw new Error(message);
|
|
927
|
-
} else if (handleMissingStyleName === 'warn') {
|
|
928
|
-
// eslint-disable-next-line no-console
|
|
929
|
-
console.warn(message);
|
|
930
|
-
}
|
|
931
|
-
|
|
932
|
-
return null;
|
|
933
|
-
};
|
|
934
|
-
|
|
935
|
-
var getClassNameForNamespacedStyleName = function getClassNameForNamespacedStyleName(styleName, styleModuleImportMap, handleMissingStyleNameOption) {
|
|
936
|
-
// Note:
|
|
937
|
-
// Do not use the desctructing syntax with Babel.
|
|
938
|
-
// Desctructing adds _slicedToArray helper.
|
|
939
|
-
var styleNameParts = styleName.split('.');
|
|
940
|
-
var importName = styleNameParts[0];
|
|
941
|
-
var moduleName = styleNameParts[1];
|
|
942
|
-
var handleMissingStyleName = handleMissingStyleNameOption || _optionsDefaults["default"].handleMissingStyleName;
|
|
943
|
-
|
|
944
|
-
if (!moduleName) {
|
|
945
|
-
return handleError('Invalid style name: ' + styleName, handleMissingStyleName);
|
|
946
|
-
}
|
|
947
|
-
|
|
948
|
-
if (!styleModuleImportMap[importName]) {
|
|
949
|
-
return handleError('CSS module import does not exist: ' + importName, handleMissingStyleName);
|
|
950
|
-
}
|
|
951
|
-
|
|
952
|
-
if (!styleModuleImportMap[importName][moduleName]) {
|
|
953
|
-
return handleError('CSS module does not exist: ' + moduleName, handleMissingStyleName);
|
|
954
|
-
}
|
|
955
|
-
|
|
956
|
-
return styleModuleImportMap[importName][moduleName];
|
|
957
|
-
};
|
|
958
|
-
|
|
959
|
-
var getClassNameFromMultipleImports = function getClassNameFromMultipleImports(styleName, styleModuleImportMap, handleMissingStyleNameOption) {
|
|
960
|
-
var handleMissingStyleName = handleMissingStyleNameOption || _optionsDefaults["default"].handleMissingStyleName;
|
|
961
|
-
var importKeysWithMatches = Object.keys(styleModuleImportMap).map(function (importKey) {
|
|
962
|
-
return styleModuleImportMap[importKey][styleName] && importKey;
|
|
963
|
-
}).filter(function (importKey) {
|
|
964
|
-
return importKey;
|
|
965
|
-
});
|
|
966
|
-
|
|
967
|
-
if (importKeysWithMatches.length > 1) {
|
|
968
|
-
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');
|
|
969
|
-
}
|
|
970
|
-
|
|
971
|
-
if (importKeysWithMatches.length === 0) {
|
|
972
|
-
return handleError('Could not resolve the styleName \'' + styleName + '\'.', handleMissingStyleName);
|
|
973
|
-
}
|
|
974
|
-
|
|
975
|
-
return styleModuleImportMap[importKeysWithMatches[0]][styleName];
|
|
976
|
-
};
|
|
977
|
-
|
|
978
|
-
var _default = function _default(styleNameValue, styleModuleImportMap, options) {
|
|
979
|
-
var styleModuleImportMapKeys = Object.keys(styleModuleImportMap);
|
|
980
|
-
|
|
981
|
-
var _ref = options || {},
|
|
982
|
-
_ref$handleMissingSty = _ref.handleMissingStyleName,
|
|
983
|
-
handleMissingStyleName = _ref$handleMissingSty === void 0 ? _optionsDefaults["default"].handleMissingStyleName : _ref$handleMissingSty,
|
|
984
|
-
_ref$autoResolveMulti = _ref.autoResolveMultipleImports,
|
|
985
|
-
autoResolveMultipleImports = _ref$autoResolveMulti === void 0 ? _optionsDefaults["default"].autoResolveMultipleImports : _ref$autoResolveMulti;
|
|
986
|
-
|
|
987
|
-
if (!styleNameValue) {
|
|
988
|
-
return '';
|
|
989
|
-
}
|
|
990
|
-
|
|
991
|
-
return styleNameValue.split(' ').filter(function (styleName) {
|
|
992
|
-
return styleName;
|
|
993
|
-
}).map(function (styleName) {
|
|
994
|
-
if (isNamespacedStyleName(styleName)) {
|
|
995
|
-
return getClassNameForNamespacedStyleName(styleName, styleModuleImportMap, handleMissingStyleName);
|
|
996
|
-
}
|
|
997
|
-
|
|
998
|
-
if (styleModuleImportMapKeys.length === 0) {
|
|
999
|
-
throw new Error('Cannot use styleName attribute for style name \'' + styleName + '\' without importing at least one stylesheet.');
|
|
1000
|
-
}
|
|
1001
|
-
|
|
1002
|
-
if (styleModuleImportMapKeys.length > 1) {
|
|
1003
|
-
if (!autoResolveMultipleImports) {
|
|
1004
|
-
throw new Error('Cannot use anonymous style name \'' + styleName + '\' with more than one stylesheet import without setting \'autoResolveMultipleImports\' to true.');
|
|
1005
|
-
}
|
|
1006
|
-
|
|
1007
|
-
return getClassNameFromMultipleImports(styleName, styleModuleImportMap, handleMissingStyleName);
|
|
1008
|
-
}
|
|
1009
|
-
|
|
1010
|
-
var styleModuleMap = styleModuleImportMap[styleModuleImportMapKeys[0]];
|
|
1011
|
-
|
|
1012
|
-
if (!styleModuleMap[styleName]) {
|
|
1013
|
-
return handleError('Could not resolve the styleName \'' + styleName + '\'.', handleMissingStyleName);
|
|
1014
|
-
}
|
|
1015
|
-
|
|
1016
|
-
return styleModuleMap[styleName];
|
|
1017
|
-
}).filter(function (className) {
|
|
1018
|
-
// Remove any styles which could not be found (if handleMissingStyleName === 'ignore')
|
|
1019
|
-
return className;
|
|
1020
|
-
}).join(' ');
|
|
1021
|
-
};
|
|
1022
|
-
|
|
1023
|
-
exports["default"] = _default;
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
});
|
|
1027
|
-
|
|
1028
|
-
var _getClassName = /*@__PURE__*/getDefaultExportFromCjs(getClassName);
|
|
1029
|
-
|
|
1030
|
-
/**
|
|
1031
|
-
* Checks if `value` is classified as an `Array` object.
|
|
1032
|
-
*
|
|
1033
|
-
* @static
|
|
1034
|
-
* @memberOf _
|
|
1035
|
-
* @since 0.1.0
|
|
1036
|
-
* @category Lang
|
|
1037
|
-
* @param {*} value The value to check.
|
|
1038
|
-
* @returns {boolean} Returns `true` if `value` is an array, else `false`.
|
|
1039
|
-
* @example
|
|
1040
|
-
*
|
|
1041
|
-
* _.isArray([1, 2, 3]);
|
|
1042
|
-
* // => true
|
|
1043
|
-
*
|
|
1044
|
-
* _.isArray(document.body.children);
|
|
1045
|
-
* // => false
|
|
1046
|
-
*
|
|
1047
|
-
* _.isArray('abc');
|
|
1048
|
-
* // => false
|
|
1049
|
-
*
|
|
1050
|
-
* _.isArray(_.noop);
|
|
1051
|
-
* // => false
|
|
1052
|
-
*/
|
|
1053
|
-
var isArray = Array.isArray;
|
|
1054
|
-
|
|
1055
|
-
var isArray_1 = isArray;
|
|
1056
|
-
|
|
1057
|
-
/** Detect free variable `global` from Node.js. */
|
|
1058
|
-
|
|
1059
|
-
var freeGlobal = typeof commonjsGlobal == 'object' && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal;
|
|
1060
|
-
|
|
1061
|
-
var _freeGlobal = freeGlobal;
|
|
1062
|
-
|
|
1063
|
-
/** Detect free variable `self`. */
|
|
1064
|
-
var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
|
|
1065
|
-
|
|
1066
|
-
/** Used as a reference to the global object. */
|
|
1067
|
-
var root = _freeGlobal || freeSelf || Function('return this')();
|
|
1068
|
-
|
|
1069
|
-
var _root = root;
|
|
1070
|
-
|
|
1071
|
-
/** Built-in value references. */
|
|
1072
|
-
var Symbol$1 = _root.Symbol;
|
|
1073
|
-
|
|
1074
|
-
var _Symbol = Symbol$1;
|
|
1075
|
-
|
|
1076
|
-
/** Used for built-in method references. */
|
|
1077
|
-
var objectProto$4 = Object.prototype;
|
|
1078
|
-
|
|
1079
|
-
/** Used to check objects for own properties. */
|
|
1080
|
-
var hasOwnProperty$3 = objectProto$4.hasOwnProperty;
|
|
1081
|
-
|
|
1082
|
-
/**
|
|
1083
|
-
* Used to resolve the
|
|
1084
|
-
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
|
|
1085
|
-
* of values.
|
|
1086
|
-
*/
|
|
1087
|
-
var nativeObjectToString$1 = objectProto$4.toString;
|
|
1088
|
-
|
|
1089
|
-
/** Built-in value references. */
|
|
1090
|
-
var symToStringTag$1 = _Symbol ? _Symbol.toStringTag : undefined;
|
|
1091
|
-
|
|
1092
|
-
/**
|
|
1093
|
-
* A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
|
|
1094
|
-
*
|
|
1095
|
-
* @private
|
|
1096
|
-
* @param {*} value The value to query.
|
|
1097
|
-
* @returns {string} Returns the raw `toStringTag`.
|
|
1098
|
-
*/
|
|
1099
|
-
function getRawTag(value) {
|
|
1100
|
-
var isOwn = hasOwnProperty$3.call(value, symToStringTag$1),
|
|
1101
|
-
tag = value[symToStringTag$1];
|
|
1102
|
-
|
|
1103
|
-
try {
|
|
1104
|
-
value[symToStringTag$1] = undefined;
|
|
1105
|
-
var unmasked = true;
|
|
1106
|
-
} catch (e) {}
|
|
1107
|
-
|
|
1108
|
-
var result = nativeObjectToString$1.call(value);
|
|
1109
|
-
if (unmasked) {
|
|
1110
|
-
if (isOwn) {
|
|
1111
|
-
value[symToStringTag$1] = tag;
|
|
1112
|
-
} else {
|
|
1113
|
-
delete value[symToStringTag$1];
|
|
1114
|
-
}
|
|
1115
|
-
}
|
|
1116
|
-
return result;
|
|
1117
|
-
}
|
|
1118
|
-
|
|
1119
|
-
var _getRawTag = getRawTag;
|
|
1120
|
-
|
|
1121
|
-
/** Used for built-in method references. */
|
|
1122
|
-
var objectProto$3 = Object.prototype;
|
|
1123
|
-
|
|
1124
|
-
/**
|
|
1125
|
-
* Used to resolve the
|
|
1126
|
-
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
|
|
1127
|
-
* of values.
|
|
1128
|
-
*/
|
|
1129
|
-
var nativeObjectToString = objectProto$3.toString;
|
|
1130
|
-
|
|
1131
|
-
/**
|
|
1132
|
-
* Converts `value` to a string using `Object.prototype.toString`.
|
|
1133
|
-
*
|
|
1134
|
-
* @private
|
|
1135
|
-
* @param {*} value The value to convert.
|
|
1136
|
-
* @returns {string} Returns the converted string.
|
|
1137
|
-
*/
|
|
1138
|
-
function objectToString(value) {
|
|
1139
|
-
return nativeObjectToString.call(value);
|
|
1140
|
-
}
|
|
1141
|
-
|
|
1142
|
-
var _objectToString = objectToString;
|
|
1143
|
-
|
|
1144
|
-
/** `Object#toString` result references. */
|
|
1145
|
-
var nullTag = '[object Null]',
|
|
1146
|
-
undefinedTag = '[object Undefined]';
|
|
1147
|
-
|
|
1148
|
-
/** Built-in value references. */
|
|
1149
|
-
var symToStringTag = _Symbol ? _Symbol.toStringTag : undefined;
|
|
1150
|
-
|
|
1151
|
-
/**
|
|
1152
|
-
* The base implementation of `getTag` without fallbacks for buggy environments.
|
|
1153
|
-
*
|
|
1154
|
-
* @private
|
|
1155
|
-
* @param {*} value The value to query.
|
|
1156
|
-
* @returns {string} Returns the `toStringTag`.
|
|
1157
|
-
*/
|
|
1158
|
-
function baseGetTag(value) {
|
|
1159
|
-
if (value == null) {
|
|
1160
|
-
return value === undefined ? undefinedTag : nullTag;
|
|
1161
|
-
}
|
|
1162
|
-
return (symToStringTag && symToStringTag in Object(value))
|
|
1163
|
-
? _getRawTag(value)
|
|
1164
|
-
: _objectToString(value);
|
|
1165
|
-
}
|
|
1166
|
-
|
|
1167
|
-
var _baseGetTag = baseGetTag;
|
|
1168
|
-
|
|
1169
|
-
/**
|
|
1170
|
-
* Checks if `value` is object-like. A value is object-like if it's not `null`
|
|
1171
|
-
* and has a `typeof` result of "object".
|
|
1172
|
-
*
|
|
1173
|
-
* @static
|
|
1174
|
-
* @memberOf _
|
|
1175
|
-
* @since 4.0.0
|
|
1176
|
-
* @category Lang
|
|
1177
|
-
* @param {*} value The value to check.
|
|
1178
|
-
* @returns {boolean} Returns `true` if `value` is object-like, else `false`.
|
|
1179
|
-
* @example
|
|
1180
|
-
*
|
|
1181
|
-
* _.isObjectLike({});
|
|
1182
|
-
* // => true
|
|
1183
|
-
*
|
|
1184
|
-
* _.isObjectLike([1, 2, 3]);
|
|
1185
|
-
* // => true
|
|
1186
|
-
*
|
|
1187
|
-
* _.isObjectLike(_.noop);
|
|
1188
|
-
* // => false
|
|
1189
|
-
*
|
|
1190
|
-
* _.isObjectLike(null);
|
|
1191
|
-
* // => false
|
|
1192
|
-
*/
|
|
1193
|
-
function isObjectLike(value) {
|
|
1194
|
-
return value != null && typeof value == 'object';
|
|
1195
|
-
}
|
|
1196
|
-
|
|
1197
|
-
var isObjectLike_1 = isObjectLike;
|
|
1198
|
-
|
|
1199
|
-
/** `Object#toString` result references. */
|
|
1200
|
-
var symbolTag = '[object Symbol]';
|
|
1201
|
-
|
|
1202
|
-
/**
|
|
1203
|
-
* Checks if `value` is classified as a `Symbol` primitive or object.
|
|
1204
|
-
*
|
|
1205
|
-
* @static
|
|
1206
|
-
* @memberOf _
|
|
1207
|
-
* @since 4.0.0
|
|
1208
|
-
* @category Lang
|
|
1209
|
-
* @param {*} value The value to check.
|
|
1210
|
-
* @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
|
|
1211
|
-
* @example
|
|
1212
|
-
*
|
|
1213
|
-
* _.isSymbol(Symbol.iterator);
|
|
1214
|
-
* // => true
|
|
1215
|
-
*
|
|
1216
|
-
* _.isSymbol('abc');
|
|
1217
|
-
* // => false
|
|
1218
|
-
*/
|
|
1219
|
-
function isSymbol(value) {
|
|
1220
|
-
return typeof value == 'symbol' ||
|
|
1221
|
-
(isObjectLike_1(value) && _baseGetTag(value) == symbolTag);
|
|
1222
|
-
}
|
|
1223
|
-
|
|
1224
|
-
var isSymbol_1 = isSymbol;
|
|
1225
|
-
|
|
1226
|
-
/** Used to match property names within property paths. */
|
|
1227
|
-
var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
|
|
1228
|
-
reIsPlainProp = /^\w*$/;
|
|
1229
|
-
|
|
1230
|
-
/**
|
|
1231
|
-
* Checks if `value` is a property name and not a property path.
|
|
1232
|
-
*
|
|
1233
|
-
* @private
|
|
1234
|
-
* @param {*} value The value to check.
|
|
1235
|
-
* @param {Object} [object] The object to query keys on.
|
|
1236
|
-
* @returns {boolean} Returns `true` if `value` is a property name, else `false`.
|
|
1237
|
-
*/
|
|
1238
|
-
function isKey(value, object) {
|
|
1239
|
-
if (isArray_1(value)) {
|
|
1240
|
-
return false;
|
|
1241
|
-
}
|
|
1242
|
-
var type = typeof value;
|
|
1243
|
-
if (type == 'number' || type == 'symbol' || type == 'boolean' ||
|
|
1244
|
-
value == null || isSymbol_1(value)) {
|
|
1245
|
-
return true;
|
|
1246
|
-
}
|
|
1247
|
-
return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||
|
|
1248
|
-
(object != null && value in Object(object));
|
|
1249
|
-
}
|
|
1250
|
-
|
|
1251
|
-
var _isKey = isKey;
|
|
1252
|
-
|
|
1253
|
-
/**
|
|
1254
|
-
* Checks if `value` is the
|
|
1255
|
-
* [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
|
|
1256
|
-
* of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
|
|
1257
|
-
*
|
|
1258
|
-
* @static
|
|
1259
|
-
* @memberOf _
|
|
1260
|
-
* @since 0.1.0
|
|
1261
|
-
* @category Lang
|
|
1262
|
-
* @param {*} value The value to check.
|
|
1263
|
-
* @returns {boolean} Returns `true` if `value` is an object, else `false`.
|
|
1264
|
-
* @example
|
|
1265
|
-
*
|
|
1266
|
-
* _.isObject({});
|
|
1267
|
-
* // => true
|
|
1268
|
-
*
|
|
1269
|
-
* _.isObject([1, 2, 3]);
|
|
1270
|
-
* // => true
|
|
1271
|
-
*
|
|
1272
|
-
* _.isObject(_.noop);
|
|
1273
|
-
* // => true
|
|
1274
|
-
*
|
|
1275
|
-
* _.isObject(null);
|
|
1276
|
-
* // => false
|
|
1277
|
-
*/
|
|
1278
|
-
function isObject(value) {
|
|
1279
|
-
var type = typeof value;
|
|
1280
|
-
return value != null && (type == 'object' || type == 'function');
|
|
1281
|
-
}
|
|
1282
|
-
|
|
1283
|
-
var isObject_1 = isObject;
|
|
1284
|
-
|
|
1285
|
-
/** `Object#toString` result references. */
|
|
1286
|
-
var asyncTag = '[object AsyncFunction]',
|
|
1287
|
-
funcTag = '[object Function]',
|
|
1288
|
-
genTag = '[object GeneratorFunction]',
|
|
1289
|
-
proxyTag = '[object Proxy]';
|
|
1290
|
-
|
|
1291
|
-
/**
|
|
1292
|
-
* Checks if `value` is classified as a `Function` object.
|
|
1293
|
-
*
|
|
1294
|
-
* @static
|
|
1295
|
-
* @memberOf _
|
|
1296
|
-
* @since 0.1.0
|
|
1297
|
-
* @category Lang
|
|
1298
|
-
* @param {*} value The value to check.
|
|
1299
|
-
* @returns {boolean} Returns `true` if `value` is a function, else `false`.
|
|
1300
|
-
* @example
|
|
1301
|
-
*
|
|
1302
|
-
* _.isFunction(_);
|
|
1303
|
-
* // => true
|
|
1304
|
-
*
|
|
1305
|
-
* _.isFunction(/abc/);
|
|
1306
|
-
* // => false
|
|
1307
|
-
*/
|
|
1308
|
-
function isFunction(value) {
|
|
1309
|
-
if (!isObject_1(value)) {
|
|
1310
|
-
return false;
|
|
1311
|
-
}
|
|
1312
|
-
// The use of `Object#toString` avoids issues with the `typeof` operator
|
|
1313
|
-
// in Safari 9 which returns 'object' for typed arrays and other constructors.
|
|
1314
|
-
var tag = _baseGetTag(value);
|
|
1315
|
-
return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
|
|
1316
|
-
}
|
|
1317
|
-
|
|
1318
|
-
var isFunction_1 = isFunction;
|
|
1319
|
-
|
|
1320
|
-
/** Used to detect overreaching core-js shims. */
|
|
1321
|
-
var coreJsData = _root['__core-js_shared__'];
|
|
1322
|
-
|
|
1323
|
-
var _coreJsData = coreJsData;
|
|
1324
|
-
|
|
1325
|
-
/** Used to detect methods masquerading as native. */
|
|
1326
|
-
var maskSrcKey = (function() {
|
|
1327
|
-
var uid = /[^.]+$/.exec(_coreJsData && _coreJsData.keys && _coreJsData.keys.IE_PROTO || '');
|
|
1328
|
-
return uid ? ('Symbol(src)_1.' + uid) : '';
|
|
1329
|
-
}());
|
|
1330
|
-
|
|
1331
|
-
/**
|
|
1332
|
-
* Checks if `func` has its source masked.
|
|
1333
|
-
*
|
|
1334
|
-
* @private
|
|
1335
|
-
* @param {Function} func The function to check.
|
|
1336
|
-
* @returns {boolean} Returns `true` if `func` is masked, else `false`.
|
|
1337
|
-
*/
|
|
1338
|
-
function isMasked(func) {
|
|
1339
|
-
return !!maskSrcKey && (maskSrcKey in func);
|
|
1340
|
-
}
|
|
1341
|
-
|
|
1342
|
-
var _isMasked = isMasked;
|
|
1343
|
-
|
|
1344
|
-
/** Used for built-in method references. */
|
|
1345
|
-
var funcProto$1 = Function.prototype;
|
|
1346
|
-
|
|
1347
|
-
/** Used to resolve the decompiled source of functions. */
|
|
1348
|
-
var funcToString$1 = funcProto$1.toString;
|
|
1349
|
-
|
|
1350
|
-
/**
|
|
1351
|
-
* Converts `func` to its source code.
|
|
1352
|
-
*
|
|
1353
|
-
* @private
|
|
1354
|
-
* @param {Function} func The function to convert.
|
|
1355
|
-
* @returns {string} Returns the source code.
|
|
1356
|
-
*/
|
|
1357
|
-
function toSource(func) {
|
|
1358
|
-
if (func != null) {
|
|
1359
|
-
try {
|
|
1360
|
-
return funcToString$1.call(func);
|
|
1361
|
-
} catch (e) {}
|
|
1362
|
-
try {
|
|
1363
|
-
return (func + '');
|
|
1364
|
-
} catch (e) {}
|
|
1365
|
-
}
|
|
1366
|
-
return '';
|
|
1367
|
-
}
|
|
1368
|
-
|
|
1369
|
-
var _toSource = toSource;
|
|
1370
|
-
|
|
1371
|
-
/**
|
|
1372
|
-
* Used to match `RegExp`
|
|
1373
|
-
* [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
|
|
1374
|
-
*/
|
|
1375
|
-
var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
|
|
1376
|
-
|
|
1377
|
-
/** Used to detect host constructors (Safari). */
|
|
1378
|
-
var reIsHostCtor = /^\[object .+?Constructor\]$/;
|
|
1379
|
-
|
|
1380
|
-
/** Used for built-in method references. */
|
|
1381
|
-
var funcProto = Function.prototype,
|
|
1382
|
-
objectProto$2 = Object.prototype;
|
|
1383
|
-
|
|
1384
|
-
/** Used to resolve the decompiled source of functions. */
|
|
1385
|
-
var funcToString = funcProto.toString;
|
|
1386
|
-
|
|
1387
|
-
/** Used to check objects for own properties. */
|
|
1388
|
-
var hasOwnProperty$2 = objectProto$2.hasOwnProperty;
|
|
1389
|
-
|
|
1390
|
-
/** Used to detect if a method is native. */
|
|
1391
|
-
var reIsNative = RegExp('^' +
|
|
1392
|
-
funcToString.call(hasOwnProperty$2).replace(reRegExpChar, '\\$&')
|
|
1393
|
-
.replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
|
|
1394
|
-
);
|
|
1395
|
-
|
|
1396
|
-
/**
|
|
1397
|
-
* The base implementation of `_.isNative` without bad shim checks.
|
|
1398
|
-
*
|
|
1399
|
-
* @private
|
|
1400
|
-
* @param {*} value The value to check.
|
|
1401
|
-
* @returns {boolean} Returns `true` if `value` is a native function,
|
|
1402
|
-
* else `false`.
|
|
1403
|
-
*/
|
|
1404
|
-
function baseIsNative(value) {
|
|
1405
|
-
if (!isObject_1(value) || _isMasked(value)) {
|
|
1406
|
-
return false;
|
|
1407
|
-
}
|
|
1408
|
-
var pattern = isFunction_1(value) ? reIsNative : reIsHostCtor;
|
|
1409
|
-
return pattern.test(_toSource(value));
|
|
1410
|
-
}
|
|
1411
|
-
|
|
1412
|
-
var _baseIsNative = baseIsNative;
|
|
1413
|
-
|
|
1414
|
-
/**
|
|
1415
|
-
* Gets the value at `key` of `object`.
|
|
1416
|
-
*
|
|
1417
|
-
* @private
|
|
1418
|
-
* @param {Object} [object] The object to query.
|
|
1419
|
-
* @param {string} key The key of the property to get.
|
|
1420
|
-
* @returns {*} Returns the property value.
|
|
1421
|
-
*/
|
|
1422
|
-
function getValue(object, key) {
|
|
1423
|
-
return object == null ? undefined : object[key];
|
|
1424
|
-
}
|
|
1425
|
-
|
|
1426
|
-
var _getValue = getValue;
|
|
1427
|
-
|
|
1428
|
-
/**
|
|
1429
|
-
* Gets the native function at `key` of `object`.
|
|
1430
|
-
*
|
|
1431
|
-
* @private
|
|
1432
|
-
* @param {Object} object The object to query.
|
|
1433
|
-
* @param {string} key The key of the method to get.
|
|
1434
|
-
* @returns {*} Returns the function if it's native, else `undefined`.
|
|
1435
|
-
*/
|
|
1436
|
-
function getNative(object, key) {
|
|
1437
|
-
var value = _getValue(object, key);
|
|
1438
|
-
return _baseIsNative(value) ? value : undefined;
|
|
1439
|
-
}
|
|
1440
|
-
|
|
1441
|
-
var _getNative = getNative;
|
|
1442
|
-
|
|
1443
|
-
/* Built-in method references that are verified to be native. */
|
|
1444
|
-
var nativeCreate = _getNative(Object, 'create');
|
|
1445
|
-
|
|
1446
|
-
var _nativeCreate = nativeCreate;
|
|
1447
|
-
|
|
1448
|
-
/**
|
|
1449
|
-
* Removes all key-value entries from the hash.
|
|
1450
|
-
*
|
|
1451
|
-
* @private
|
|
1452
|
-
* @name clear
|
|
1453
|
-
* @memberOf Hash
|
|
1454
|
-
*/
|
|
1455
|
-
function hashClear() {
|
|
1456
|
-
this.__data__ = _nativeCreate ? _nativeCreate(null) : {};
|
|
1457
|
-
this.size = 0;
|
|
1458
|
-
}
|
|
1459
|
-
|
|
1460
|
-
var _hashClear = hashClear;
|
|
1461
|
-
|
|
1462
|
-
/**
|
|
1463
|
-
* Removes `key` and its value from the hash.
|
|
1464
|
-
*
|
|
1465
|
-
* @private
|
|
1466
|
-
* @name delete
|
|
1467
|
-
* @memberOf Hash
|
|
1468
|
-
* @param {Object} hash The hash to modify.
|
|
1469
|
-
* @param {string} key The key of the value to remove.
|
|
1470
|
-
* @returns {boolean} Returns `true` if the entry was removed, else `false`.
|
|
1471
|
-
*/
|
|
1472
|
-
function hashDelete(key) {
|
|
1473
|
-
var result = this.has(key) && delete this.__data__[key];
|
|
1474
|
-
this.size -= result ? 1 : 0;
|
|
1475
|
-
return result;
|
|
1476
|
-
}
|
|
1477
|
-
|
|
1478
|
-
var _hashDelete = hashDelete;
|
|
1479
|
-
|
|
1480
|
-
/** Used to stand-in for `undefined` hash values. */
|
|
1481
|
-
var HASH_UNDEFINED$1 = '__lodash_hash_undefined__';
|
|
1482
|
-
|
|
1483
|
-
/** Used for built-in method references. */
|
|
1484
|
-
var objectProto$1 = Object.prototype;
|
|
1485
|
-
|
|
1486
|
-
/** Used to check objects for own properties. */
|
|
1487
|
-
var hasOwnProperty$1 = objectProto$1.hasOwnProperty;
|
|
1488
|
-
|
|
1489
|
-
/**
|
|
1490
|
-
* Gets the hash value for `key`.
|
|
1491
|
-
*
|
|
1492
|
-
* @private
|
|
1493
|
-
* @name get
|
|
1494
|
-
* @memberOf Hash
|
|
1495
|
-
* @param {string} key The key of the value to get.
|
|
1496
|
-
* @returns {*} Returns the entry value.
|
|
1497
|
-
*/
|
|
1498
|
-
function hashGet(key) {
|
|
1499
|
-
var data = this.__data__;
|
|
1500
|
-
if (_nativeCreate) {
|
|
1501
|
-
var result = data[key];
|
|
1502
|
-
return result === HASH_UNDEFINED$1 ? undefined : result;
|
|
1503
|
-
}
|
|
1504
|
-
return hasOwnProperty$1.call(data, key) ? data[key] : undefined;
|
|
1505
|
-
}
|
|
1506
|
-
|
|
1507
|
-
var _hashGet = hashGet;
|
|
1508
|
-
|
|
1509
|
-
/** Used for built-in method references. */
|
|
1510
|
-
var objectProto = Object.prototype;
|
|
1511
|
-
|
|
1512
|
-
/** Used to check objects for own properties. */
|
|
1513
|
-
var hasOwnProperty = objectProto.hasOwnProperty;
|
|
1514
|
-
|
|
1515
|
-
/**
|
|
1516
|
-
* Checks if a hash value for `key` exists.
|
|
1517
|
-
*
|
|
1518
|
-
* @private
|
|
1519
|
-
* @name has
|
|
1520
|
-
* @memberOf Hash
|
|
1521
|
-
* @param {string} key The key of the entry to check.
|
|
1522
|
-
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
|
|
1523
|
-
*/
|
|
1524
|
-
function hashHas(key) {
|
|
1525
|
-
var data = this.__data__;
|
|
1526
|
-
return _nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);
|
|
1527
|
-
}
|
|
1528
|
-
|
|
1529
|
-
var _hashHas = hashHas;
|
|
1530
|
-
|
|
1531
|
-
/** Used to stand-in for `undefined` hash values. */
|
|
1532
|
-
var HASH_UNDEFINED = '__lodash_hash_undefined__';
|
|
1533
|
-
|
|
1534
|
-
/**
|
|
1535
|
-
* Sets the hash `key` to `value`.
|
|
1536
|
-
*
|
|
1537
|
-
* @private
|
|
1538
|
-
* @name set
|
|
1539
|
-
* @memberOf Hash
|
|
1540
|
-
* @param {string} key The key of the value to set.
|
|
1541
|
-
* @param {*} value The value to set.
|
|
1542
|
-
* @returns {Object} Returns the hash instance.
|
|
1543
|
-
*/
|
|
1544
|
-
function hashSet(key, value) {
|
|
1545
|
-
var data = this.__data__;
|
|
1546
|
-
this.size += this.has(key) ? 0 : 1;
|
|
1547
|
-
data[key] = (_nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
|
|
1548
|
-
return this;
|
|
1549
|
-
}
|
|
1550
|
-
|
|
1551
|
-
var _hashSet = hashSet;
|
|
1552
|
-
|
|
1553
|
-
/**
|
|
1554
|
-
* Creates a hash object.
|
|
1555
|
-
*
|
|
1556
|
-
* @private
|
|
1557
|
-
* @constructor
|
|
1558
|
-
* @param {Array} [entries] The key-value pairs to cache.
|
|
1559
|
-
*/
|
|
1560
|
-
function Hash(entries) {
|
|
1561
|
-
var index = -1,
|
|
1562
|
-
length = entries == null ? 0 : entries.length;
|
|
1563
|
-
|
|
1564
|
-
this.clear();
|
|
1565
|
-
while (++index < length) {
|
|
1566
|
-
var entry = entries[index];
|
|
1567
|
-
this.set(entry[0], entry[1]);
|
|
1568
|
-
}
|
|
1569
|
-
}
|
|
1570
|
-
|
|
1571
|
-
// Add methods to `Hash`.
|
|
1572
|
-
Hash.prototype.clear = _hashClear;
|
|
1573
|
-
Hash.prototype['delete'] = _hashDelete;
|
|
1574
|
-
Hash.prototype.get = _hashGet;
|
|
1575
|
-
Hash.prototype.has = _hashHas;
|
|
1576
|
-
Hash.prototype.set = _hashSet;
|
|
1577
|
-
|
|
1578
|
-
var _Hash = Hash;
|
|
1579
|
-
|
|
1580
|
-
/**
|
|
1581
|
-
* Removes all key-value entries from the list cache.
|
|
1582
|
-
*
|
|
1583
|
-
* @private
|
|
1584
|
-
* @name clear
|
|
1585
|
-
* @memberOf ListCache
|
|
1586
|
-
*/
|
|
1587
|
-
function listCacheClear() {
|
|
1588
|
-
this.__data__ = [];
|
|
1589
|
-
this.size = 0;
|
|
1590
|
-
}
|
|
1591
|
-
|
|
1592
|
-
var _listCacheClear = listCacheClear;
|
|
1593
|
-
|
|
1594
|
-
/**
|
|
1595
|
-
* Performs a
|
|
1596
|
-
* [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
|
|
1597
|
-
* comparison between two values to determine if they are equivalent.
|
|
1598
|
-
*
|
|
1599
|
-
* @static
|
|
1600
|
-
* @memberOf _
|
|
1601
|
-
* @since 4.0.0
|
|
1602
|
-
* @category Lang
|
|
1603
|
-
* @param {*} value The value to compare.
|
|
1604
|
-
* @param {*} other The other value to compare.
|
|
1605
|
-
* @returns {boolean} Returns `true` if the values are equivalent, else `false`.
|
|
1606
|
-
* @example
|
|
1607
|
-
*
|
|
1608
|
-
* var object = { 'a': 1 };
|
|
1609
|
-
* var other = { 'a': 1 };
|
|
1610
|
-
*
|
|
1611
|
-
* _.eq(object, object);
|
|
1612
|
-
* // => true
|
|
1613
|
-
*
|
|
1614
|
-
* _.eq(object, other);
|
|
1615
|
-
* // => false
|
|
1616
|
-
*
|
|
1617
|
-
* _.eq('a', 'a');
|
|
1618
|
-
* // => true
|
|
1619
|
-
*
|
|
1620
|
-
* _.eq('a', Object('a'));
|
|
1621
|
-
* // => false
|
|
1622
|
-
*
|
|
1623
|
-
* _.eq(NaN, NaN);
|
|
1624
|
-
* // => true
|
|
1625
|
-
*/
|
|
1626
|
-
function eq(value, other) {
|
|
1627
|
-
return value === other || (value !== value && other !== other);
|
|
1628
|
-
}
|
|
1629
|
-
|
|
1630
|
-
var eq_1 = eq;
|
|
1631
|
-
|
|
1632
|
-
/**
|
|
1633
|
-
* Gets the index at which the `key` is found in `array` of key-value pairs.
|
|
1634
|
-
*
|
|
1635
|
-
* @private
|
|
1636
|
-
* @param {Array} array The array to inspect.
|
|
1637
|
-
* @param {*} key The key to search for.
|
|
1638
|
-
* @returns {number} Returns the index of the matched value, else `-1`.
|
|
1639
|
-
*/
|
|
1640
|
-
function assocIndexOf(array, key) {
|
|
1641
|
-
var length = array.length;
|
|
1642
|
-
while (length--) {
|
|
1643
|
-
if (eq_1(array[length][0], key)) {
|
|
1644
|
-
return length;
|
|
1645
|
-
}
|
|
1646
|
-
}
|
|
1647
|
-
return -1;
|
|
1648
|
-
}
|
|
1649
|
-
|
|
1650
|
-
var _assocIndexOf = assocIndexOf;
|
|
1651
|
-
|
|
1652
|
-
/** Used for built-in method references. */
|
|
1653
|
-
var arrayProto = Array.prototype;
|
|
1654
|
-
|
|
1655
|
-
/** Built-in value references. */
|
|
1656
|
-
var splice = arrayProto.splice;
|
|
1657
|
-
|
|
1658
|
-
/**
|
|
1659
|
-
* Removes `key` and its value from the list cache.
|
|
1660
|
-
*
|
|
1661
|
-
* @private
|
|
1662
|
-
* @name delete
|
|
1663
|
-
* @memberOf ListCache
|
|
1664
|
-
* @param {string} key The key of the value to remove.
|
|
1665
|
-
* @returns {boolean} Returns `true` if the entry was removed, else `false`.
|
|
1666
|
-
*/
|
|
1667
|
-
function listCacheDelete(key) {
|
|
1668
|
-
var data = this.__data__,
|
|
1669
|
-
index = _assocIndexOf(data, key);
|
|
1670
|
-
|
|
1671
|
-
if (index < 0) {
|
|
1672
|
-
return false;
|
|
1673
|
-
}
|
|
1674
|
-
var lastIndex = data.length - 1;
|
|
1675
|
-
if (index == lastIndex) {
|
|
1676
|
-
data.pop();
|
|
1677
|
-
} else {
|
|
1678
|
-
splice.call(data, index, 1);
|
|
1679
|
-
}
|
|
1680
|
-
--this.size;
|
|
1681
|
-
return true;
|
|
1682
|
-
}
|
|
1683
|
-
|
|
1684
|
-
var _listCacheDelete = listCacheDelete;
|
|
1685
|
-
|
|
1686
|
-
/**
|
|
1687
|
-
* Gets the list cache value for `key`.
|
|
1688
|
-
*
|
|
1689
|
-
* @private
|
|
1690
|
-
* @name get
|
|
1691
|
-
* @memberOf ListCache
|
|
1692
|
-
* @param {string} key The key of the value to get.
|
|
1693
|
-
* @returns {*} Returns the entry value.
|
|
1694
|
-
*/
|
|
1695
|
-
function listCacheGet(key) {
|
|
1696
|
-
var data = this.__data__,
|
|
1697
|
-
index = _assocIndexOf(data, key);
|
|
1698
|
-
|
|
1699
|
-
return index < 0 ? undefined : data[index][1];
|
|
1700
|
-
}
|
|
1701
|
-
|
|
1702
|
-
var _listCacheGet = listCacheGet;
|
|
1703
|
-
|
|
1704
|
-
/**
|
|
1705
|
-
* Checks if a list cache value for `key` exists.
|
|
1706
|
-
*
|
|
1707
|
-
* @private
|
|
1708
|
-
* @name has
|
|
1709
|
-
* @memberOf ListCache
|
|
1710
|
-
* @param {string} key The key of the entry to check.
|
|
1711
|
-
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
|
|
1712
|
-
*/
|
|
1713
|
-
function listCacheHas(key) {
|
|
1714
|
-
return _assocIndexOf(this.__data__, key) > -1;
|
|
1715
|
-
}
|
|
1716
|
-
|
|
1717
|
-
var _listCacheHas = listCacheHas;
|
|
1718
|
-
|
|
1719
|
-
/**
|
|
1720
|
-
* Sets the list cache `key` to `value`.
|
|
1721
|
-
*
|
|
1722
|
-
* @private
|
|
1723
|
-
* @name set
|
|
1724
|
-
* @memberOf ListCache
|
|
1725
|
-
* @param {string} key The key of the value to set.
|
|
1726
|
-
* @param {*} value The value to set.
|
|
1727
|
-
* @returns {Object} Returns the list cache instance.
|
|
1728
|
-
*/
|
|
1729
|
-
function listCacheSet(key, value) {
|
|
1730
|
-
var data = this.__data__,
|
|
1731
|
-
index = _assocIndexOf(data, key);
|
|
1732
|
-
|
|
1733
|
-
if (index < 0) {
|
|
1734
|
-
++this.size;
|
|
1735
|
-
data.push([key, value]);
|
|
1736
|
-
} else {
|
|
1737
|
-
data[index][1] = value;
|
|
1738
|
-
}
|
|
1739
|
-
return this;
|
|
1740
|
-
}
|
|
1741
|
-
|
|
1742
|
-
var _listCacheSet = listCacheSet;
|
|
1743
|
-
|
|
1744
|
-
/**
|
|
1745
|
-
* Creates an list cache object.
|
|
1746
|
-
*
|
|
1747
|
-
* @private
|
|
1748
|
-
* @constructor
|
|
1749
|
-
* @param {Array} [entries] The key-value pairs to cache.
|
|
1750
|
-
*/
|
|
1751
|
-
function ListCache(entries) {
|
|
1752
|
-
var index = -1,
|
|
1753
|
-
length = entries == null ? 0 : entries.length;
|
|
1754
|
-
|
|
1755
|
-
this.clear();
|
|
1756
|
-
while (++index < length) {
|
|
1757
|
-
var entry = entries[index];
|
|
1758
|
-
this.set(entry[0], entry[1]);
|
|
1759
|
-
}
|
|
1760
|
-
}
|
|
1761
|
-
|
|
1762
|
-
// Add methods to `ListCache`.
|
|
1763
|
-
ListCache.prototype.clear = _listCacheClear;
|
|
1764
|
-
ListCache.prototype['delete'] = _listCacheDelete;
|
|
1765
|
-
ListCache.prototype.get = _listCacheGet;
|
|
1766
|
-
ListCache.prototype.has = _listCacheHas;
|
|
1767
|
-
ListCache.prototype.set = _listCacheSet;
|
|
1768
|
-
|
|
1769
|
-
var _ListCache = ListCache;
|
|
1770
|
-
|
|
1771
|
-
/* Built-in method references that are verified to be native. */
|
|
1772
|
-
var Map = _getNative(_root, 'Map');
|
|
1773
|
-
|
|
1774
|
-
var _Map = Map;
|
|
1775
|
-
|
|
1776
|
-
/**
|
|
1777
|
-
* Removes all key-value entries from the map.
|
|
1778
|
-
*
|
|
1779
|
-
* @private
|
|
1780
|
-
* @name clear
|
|
1781
|
-
* @memberOf MapCache
|
|
1782
|
-
*/
|
|
1783
|
-
function mapCacheClear() {
|
|
1784
|
-
this.size = 0;
|
|
1785
|
-
this.__data__ = {
|
|
1786
|
-
'hash': new _Hash,
|
|
1787
|
-
'map': new (_Map || _ListCache),
|
|
1788
|
-
'string': new _Hash
|
|
1789
|
-
};
|
|
1790
|
-
}
|
|
1791
|
-
|
|
1792
|
-
var _mapCacheClear = mapCacheClear;
|
|
1793
|
-
|
|
1794
|
-
/**
|
|
1795
|
-
* Checks if `value` is suitable for use as unique object key.
|
|
1796
|
-
*
|
|
1797
|
-
* @private
|
|
1798
|
-
* @param {*} value The value to check.
|
|
1799
|
-
* @returns {boolean} Returns `true` if `value` is suitable, else `false`.
|
|
1800
|
-
*/
|
|
1801
|
-
function isKeyable(value) {
|
|
1802
|
-
var type = typeof value;
|
|
1803
|
-
return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
|
|
1804
|
-
? (value !== '__proto__')
|
|
1805
|
-
: (value === null);
|
|
1806
|
-
}
|
|
1807
|
-
|
|
1808
|
-
var _isKeyable = isKeyable;
|
|
1809
|
-
|
|
1810
|
-
/**
|
|
1811
|
-
* Gets the data for `map`.
|
|
1812
|
-
*
|
|
1813
|
-
* @private
|
|
1814
|
-
* @param {Object} map The map to query.
|
|
1815
|
-
* @param {string} key The reference key.
|
|
1816
|
-
* @returns {*} Returns the map data.
|
|
1817
|
-
*/
|
|
1818
|
-
function getMapData(map, key) {
|
|
1819
|
-
var data = map.__data__;
|
|
1820
|
-
return _isKeyable(key)
|
|
1821
|
-
? data[typeof key == 'string' ? 'string' : 'hash']
|
|
1822
|
-
: data.map;
|
|
1823
|
-
}
|
|
1824
|
-
|
|
1825
|
-
var _getMapData = getMapData;
|
|
1826
|
-
|
|
1827
|
-
/**
|
|
1828
|
-
* Removes `key` and its value from the map.
|
|
1829
|
-
*
|
|
1830
|
-
* @private
|
|
1831
|
-
* @name delete
|
|
1832
|
-
* @memberOf MapCache
|
|
1833
|
-
* @param {string} key The key of the value to remove.
|
|
1834
|
-
* @returns {boolean} Returns `true` if the entry was removed, else `false`.
|
|
1835
|
-
*/
|
|
1836
|
-
function mapCacheDelete(key) {
|
|
1837
|
-
var result = _getMapData(this, key)['delete'](key);
|
|
1838
|
-
this.size -= result ? 1 : 0;
|
|
1839
|
-
return result;
|
|
1840
|
-
}
|
|
1841
|
-
|
|
1842
|
-
var _mapCacheDelete = mapCacheDelete;
|
|
1843
|
-
|
|
1844
|
-
/**
|
|
1845
|
-
* Gets the map value for `key`.
|
|
1846
|
-
*
|
|
1847
|
-
* @private
|
|
1848
|
-
* @name get
|
|
1849
|
-
* @memberOf MapCache
|
|
1850
|
-
* @param {string} key The key of the value to get.
|
|
1851
|
-
* @returns {*} Returns the entry value.
|
|
1852
|
-
*/
|
|
1853
|
-
function mapCacheGet(key) {
|
|
1854
|
-
return _getMapData(this, key).get(key);
|
|
1855
|
-
}
|
|
1856
|
-
|
|
1857
|
-
var _mapCacheGet = mapCacheGet;
|
|
1858
|
-
|
|
1859
|
-
/**
|
|
1860
|
-
* Checks if a map value for `key` exists.
|
|
1861
|
-
*
|
|
1862
|
-
* @private
|
|
1863
|
-
* @name has
|
|
1864
|
-
* @memberOf MapCache
|
|
1865
|
-
* @param {string} key The key of the entry to check.
|
|
1866
|
-
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
|
|
1867
|
-
*/
|
|
1868
|
-
function mapCacheHas(key) {
|
|
1869
|
-
return _getMapData(this, key).has(key);
|
|
1870
|
-
}
|
|
1871
|
-
|
|
1872
|
-
var _mapCacheHas = mapCacheHas;
|
|
1873
|
-
|
|
1874
|
-
/**
|
|
1875
|
-
* Sets the map `key` to `value`.
|
|
1876
|
-
*
|
|
1877
|
-
* @private
|
|
1878
|
-
* @name set
|
|
1879
|
-
* @memberOf MapCache
|
|
1880
|
-
* @param {string} key The key of the value to set.
|
|
1881
|
-
* @param {*} value The value to set.
|
|
1882
|
-
* @returns {Object} Returns the map cache instance.
|
|
1883
|
-
*/
|
|
1884
|
-
function mapCacheSet(key, value) {
|
|
1885
|
-
var data = _getMapData(this, key),
|
|
1886
|
-
size = data.size;
|
|
1887
|
-
|
|
1888
|
-
data.set(key, value);
|
|
1889
|
-
this.size += data.size == size ? 0 : 1;
|
|
1890
|
-
return this;
|
|
1891
|
-
}
|
|
1892
|
-
|
|
1893
|
-
var _mapCacheSet = mapCacheSet;
|
|
1894
|
-
|
|
1895
|
-
/**
|
|
1896
|
-
* Creates a map cache object to store key-value pairs.
|
|
1897
|
-
*
|
|
1898
|
-
* @private
|
|
1899
|
-
* @constructor
|
|
1900
|
-
* @param {Array} [entries] The key-value pairs to cache.
|
|
1901
|
-
*/
|
|
1902
|
-
function MapCache(entries) {
|
|
1903
|
-
var index = -1,
|
|
1904
|
-
length = entries == null ? 0 : entries.length;
|
|
1905
|
-
|
|
1906
|
-
this.clear();
|
|
1907
|
-
while (++index < length) {
|
|
1908
|
-
var entry = entries[index];
|
|
1909
|
-
this.set(entry[0], entry[1]);
|
|
1910
|
-
}
|
|
1911
|
-
}
|
|
1912
|
-
|
|
1913
|
-
// Add methods to `MapCache`.
|
|
1914
|
-
MapCache.prototype.clear = _mapCacheClear;
|
|
1915
|
-
MapCache.prototype['delete'] = _mapCacheDelete;
|
|
1916
|
-
MapCache.prototype.get = _mapCacheGet;
|
|
1917
|
-
MapCache.prototype.has = _mapCacheHas;
|
|
1918
|
-
MapCache.prototype.set = _mapCacheSet;
|
|
1919
|
-
|
|
1920
|
-
var _MapCache = MapCache;
|
|
1921
|
-
|
|
1922
|
-
/** Error message constants. */
|
|
1923
|
-
var FUNC_ERROR_TEXT = 'Expected a function';
|
|
1924
|
-
|
|
1925
|
-
/**
|
|
1926
|
-
* Creates a function that memoizes the result of `func`. If `resolver` is
|
|
1927
|
-
* provided, it determines the cache key for storing the result based on the
|
|
1928
|
-
* arguments provided to the memoized function. By default, the first argument
|
|
1929
|
-
* provided to the memoized function is used as the map cache key. The `func`
|
|
1930
|
-
* is invoked with the `this` binding of the memoized function.
|
|
1931
|
-
*
|
|
1932
|
-
* **Note:** The cache is exposed as the `cache` property on the memoized
|
|
1933
|
-
* function. Its creation may be customized by replacing the `_.memoize.Cache`
|
|
1934
|
-
* constructor with one whose instances implement the
|
|
1935
|
-
* [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
|
|
1936
|
-
* method interface of `clear`, `delete`, `get`, `has`, and `set`.
|
|
1937
|
-
*
|
|
1938
|
-
* @static
|
|
1939
|
-
* @memberOf _
|
|
1940
|
-
* @since 0.1.0
|
|
1941
|
-
* @category Function
|
|
1942
|
-
* @param {Function} func The function to have its output memoized.
|
|
1943
|
-
* @param {Function} [resolver] The function to resolve the cache key.
|
|
1944
|
-
* @returns {Function} Returns the new memoized function.
|
|
1945
|
-
* @example
|
|
1946
|
-
*
|
|
1947
|
-
* var object = { 'a': 1, 'b': 2 };
|
|
1948
|
-
* var other = { 'c': 3, 'd': 4 };
|
|
1949
|
-
*
|
|
1950
|
-
* var values = _.memoize(_.values);
|
|
1951
|
-
* values(object);
|
|
1952
|
-
* // => [1, 2]
|
|
1953
|
-
*
|
|
1954
|
-
* values(other);
|
|
1955
|
-
* // => [3, 4]
|
|
1956
|
-
*
|
|
1957
|
-
* object.a = 2;
|
|
1958
|
-
* values(object);
|
|
1959
|
-
* // => [1, 2]
|
|
1960
|
-
*
|
|
1961
|
-
* // Modify the result cache.
|
|
1962
|
-
* values.cache.set(object, ['a', 'b']);
|
|
1963
|
-
* values(object);
|
|
1964
|
-
* // => ['a', 'b']
|
|
1965
|
-
*
|
|
1966
|
-
* // Replace `_.memoize.Cache`.
|
|
1967
|
-
* _.memoize.Cache = WeakMap;
|
|
1968
|
-
*/
|
|
1969
|
-
function memoize(func, resolver) {
|
|
1970
|
-
if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) {
|
|
1971
|
-
throw new TypeError(FUNC_ERROR_TEXT);
|
|
1972
|
-
}
|
|
1973
|
-
var memoized = function() {
|
|
1974
|
-
var args = arguments,
|
|
1975
|
-
key = resolver ? resolver.apply(this, args) : args[0],
|
|
1976
|
-
cache = memoized.cache;
|
|
1977
|
-
|
|
1978
|
-
if (cache.has(key)) {
|
|
1979
|
-
return cache.get(key);
|
|
1980
|
-
}
|
|
1981
|
-
var result = func.apply(this, args);
|
|
1982
|
-
memoized.cache = cache.set(key, result) || cache;
|
|
1983
|
-
return result;
|
|
1984
|
-
};
|
|
1985
|
-
memoized.cache = new (memoize.Cache || _MapCache);
|
|
1986
|
-
return memoized;
|
|
1987
|
-
}
|
|
1988
|
-
|
|
1989
|
-
// Expose `MapCache`.
|
|
1990
|
-
memoize.Cache = _MapCache;
|
|
1991
|
-
|
|
1992
|
-
var memoize_1 = memoize;
|
|
1993
|
-
|
|
1994
|
-
/** Used as the maximum memoize cache size. */
|
|
1995
|
-
var MAX_MEMOIZE_SIZE = 500;
|
|
1996
|
-
|
|
1997
|
-
/**
|
|
1998
|
-
* A specialized version of `_.memoize` which clears the memoized function's
|
|
1999
|
-
* cache when it exceeds `MAX_MEMOIZE_SIZE`.
|
|
2000
|
-
*
|
|
2001
|
-
* @private
|
|
2002
|
-
* @param {Function} func The function to have its output memoized.
|
|
2003
|
-
* @returns {Function} Returns the new memoized function.
|
|
2004
|
-
*/
|
|
2005
|
-
function memoizeCapped(func) {
|
|
2006
|
-
var result = memoize_1(func, function(key) {
|
|
2007
|
-
if (cache.size === MAX_MEMOIZE_SIZE) {
|
|
2008
|
-
cache.clear();
|
|
2009
|
-
}
|
|
2010
|
-
return key;
|
|
2011
|
-
});
|
|
2012
|
-
|
|
2013
|
-
var cache = result.cache;
|
|
2014
|
-
return result;
|
|
2015
|
-
}
|
|
2016
|
-
|
|
2017
|
-
var _memoizeCapped = memoizeCapped;
|
|
2018
|
-
|
|
2019
|
-
/** Used to match property names within property paths. */
|
|
2020
|
-
var rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
|
|
2021
|
-
|
|
2022
|
-
/** Used to match backslashes in property paths. */
|
|
2023
|
-
var reEscapeChar = /\\(\\)?/g;
|
|
2024
|
-
|
|
2025
|
-
/**
|
|
2026
|
-
* Converts `string` to a property path array.
|
|
2027
|
-
*
|
|
2028
|
-
* @private
|
|
2029
|
-
* @param {string} string The string to convert.
|
|
2030
|
-
* @returns {Array} Returns the property path array.
|
|
2031
|
-
*/
|
|
2032
|
-
var stringToPath = _memoizeCapped(function(string) {
|
|
2033
|
-
var result = [];
|
|
2034
|
-
if (string.charCodeAt(0) === 46 /* . */) {
|
|
2035
|
-
result.push('');
|
|
2036
|
-
}
|
|
2037
|
-
string.replace(rePropName, function(match, number, quote, subString) {
|
|
2038
|
-
result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match));
|
|
2039
|
-
});
|
|
2040
|
-
return result;
|
|
2041
|
-
});
|
|
2042
|
-
|
|
2043
|
-
var _stringToPath = stringToPath;
|
|
2044
|
-
|
|
2045
|
-
/**
|
|
2046
|
-
* A specialized version of `_.map` for arrays without support for iteratee
|
|
2047
|
-
* shorthands.
|
|
2048
|
-
*
|
|
2049
|
-
* @private
|
|
2050
|
-
* @param {Array} [array] The array to iterate over.
|
|
2051
|
-
* @param {Function} iteratee The function invoked per iteration.
|
|
2052
|
-
* @returns {Array} Returns the new mapped array.
|
|
2053
|
-
*/
|
|
2054
|
-
function arrayMap(array, iteratee) {
|
|
2055
|
-
var index = -1,
|
|
2056
|
-
length = array == null ? 0 : array.length,
|
|
2057
|
-
result = Array(length);
|
|
2058
|
-
|
|
2059
|
-
while (++index < length) {
|
|
2060
|
-
result[index] = iteratee(array[index], index, array);
|
|
2061
|
-
}
|
|
2062
|
-
return result;
|
|
2063
|
-
}
|
|
2064
|
-
|
|
2065
|
-
var _arrayMap = arrayMap;
|
|
2066
|
-
|
|
2067
|
-
/** Used as references for various `Number` constants. */
|
|
2068
|
-
var INFINITY$1 = 1 / 0;
|
|
2069
|
-
|
|
2070
|
-
/** Used to convert symbols to primitives and strings. */
|
|
2071
|
-
var symbolProto = _Symbol ? _Symbol.prototype : undefined,
|
|
2072
|
-
symbolToString = symbolProto ? symbolProto.toString : undefined;
|
|
2073
|
-
|
|
2074
|
-
/**
|
|
2075
|
-
* The base implementation of `_.toString` which doesn't convert nullish
|
|
2076
|
-
* values to empty strings.
|
|
2077
|
-
*
|
|
2078
|
-
* @private
|
|
2079
|
-
* @param {*} value The value to process.
|
|
2080
|
-
* @returns {string} Returns the string.
|
|
2081
|
-
*/
|
|
2082
|
-
function baseToString(value) {
|
|
2083
|
-
// Exit early for strings to avoid a performance hit in some environments.
|
|
2084
|
-
if (typeof value == 'string') {
|
|
2085
|
-
return value;
|
|
2086
|
-
}
|
|
2087
|
-
if (isArray_1(value)) {
|
|
2088
|
-
// Recursively convert values (susceptible to call stack limits).
|
|
2089
|
-
return _arrayMap(value, baseToString) + '';
|
|
2090
|
-
}
|
|
2091
|
-
if (isSymbol_1(value)) {
|
|
2092
|
-
return symbolToString ? symbolToString.call(value) : '';
|
|
2093
|
-
}
|
|
2094
|
-
var result = (value + '');
|
|
2095
|
-
return (result == '0' && (1 / value) == -INFINITY$1) ? '-0' : result;
|
|
2096
|
-
}
|
|
2097
|
-
|
|
2098
|
-
var _baseToString = baseToString;
|
|
2099
|
-
|
|
2100
|
-
/**
|
|
2101
|
-
* Converts `value` to a string. An empty string is returned for `null`
|
|
2102
|
-
* and `undefined` values. The sign of `-0` is preserved.
|
|
2103
|
-
*
|
|
2104
|
-
* @static
|
|
2105
|
-
* @memberOf _
|
|
2106
|
-
* @since 4.0.0
|
|
2107
|
-
* @category Lang
|
|
2108
|
-
* @param {*} value The value to convert.
|
|
2109
|
-
* @returns {string} Returns the converted string.
|
|
2110
|
-
* @example
|
|
2111
|
-
*
|
|
2112
|
-
* _.toString(null);
|
|
2113
|
-
* // => ''
|
|
2114
|
-
*
|
|
2115
|
-
* _.toString(-0);
|
|
2116
|
-
* // => '-0'
|
|
2117
|
-
*
|
|
2118
|
-
* _.toString([1, 2, 3]);
|
|
2119
|
-
* // => '1,2,3'
|
|
2120
|
-
*/
|
|
2121
|
-
function toString(value) {
|
|
2122
|
-
return value == null ? '' : _baseToString(value);
|
|
2123
|
-
}
|
|
2124
|
-
|
|
2125
|
-
var toString_1 = toString;
|
|
2126
|
-
|
|
2127
|
-
/**
|
|
2128
|
-
* Casts `value` to a path array if it's not one.
|
|
2129
|
-
*
|
|
2130
|
-
* @private
|
|
2131
|
-
* @param {*} value The value to inspect.
|
|
2132
|
-
* @param {Object} [object] The object to query keys on.
|
|
2133
|
-
* @returns {Array} Returns the cast property path array.
|
|
2134
|
-
*/
|
|
2135
|
-
function castPath(value, object) {
|
|
2136
|
-
if (isArray_1(value)) {
|
|
2137
|
-
return value;
|
|
2138
|
-
}
|
|
2139
|
-
return _isKey(value, object) ? [value] : _stringToPath(toString_1(value));
|
|
2140
|
-
}
|
|
2141
|
-
|
|
2142
|
-
var _castPath = castPath;
|
|
2143
|
-
|
|
2144
|
-
/** Used as references for various `Number` constants. */
|
|
2145
|
-
var INFINITY = 1 / 0;
|
|
2146
|
-
|
|
2147
|
-
/**
|
|
2148
|
-
* Converts `value` to a string key if it's not a string or symbol.
|
|
2149
|
-
*
|
|
2150
|
-
* @private
|
|
2151
|
-
* @param {*} value The value to inspect.
|
|
2152
|
-
* @returns {string|symbol} Returns the key.
|
|
2153
|
-
*/
|
|
2154
|
-
function toKey(value) {
|
|
2155
|
-
if (typeof value == 'string' || isSymbol_1(value)) {
|
|
2156
|
-
return value;
|
|
2157
|
-
}
|
|
2158
|
-
var result = (value + '');
|
|
2159
|
-
return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
|
|
2160
|
-
}
|
|
2161
|
-
|
|
2162
|
-
var _toKey = toKey;
|
|
2163
|
-
|
|
2164
|
-
/**
|
|
2165
|
-
* The base implementation of `_.get` without support for default values.
|
|
2166
|
-
*
|
|
2167
|
-
* @private
|
|
2168
|
-
* @param {Object} object The object to query.
|
|
2169
|
-
* @param {Array|string} path The path of the property to get.
|
|
2170
|
-
* @returns {*} Returns the resolved value.
|
|
2171
|
-
*/
|
|
2172
|
-
function baseGet(object, path) {
|
|
2173
|
-
path = _castPath(path, object);
|
|
2174
|
-
|
|
2175
|
-
var index = 0,
|
|
2176
|
-
length = path.length;
|
|
2177
|
-
|
|
2178
|
-
while (object != null && index < length) {
|
|
2179
|
-
object = object[_toKey(path[index++])];
|
|
2180
|
-
}
|
|
2181
|
-
return (index && index == length) ? object : undefined;
|
|
2182
|
-
}
|
|
2183
|
-
|
|
2184
|
-
var _baseGet = baseGet;
|
|
2185
|
-
|
|
2186
|
-
/**
|
|
2187
|
-
* Gets the value at `path` of `object`. If the resolved value is
|
|
2188
|
-
* `undefined`, the `defaultValue` is returned in its place.
|
|
2189
|
-
*
|
|
2190
|
-
* @static
|
|
2191
|
-
* @memberOf _
|
|
2192
|
-
* @since 3.7.0
|
|
2193
|
-
* @category Object
|
|
2194
|
-
* @param {Object} object The object to query.
|
|
2195
|
-
* @param {Array|string} path The path of the property to get.
|
|
2196
|
-
* @param {*} [defaultValue] The value returned for `undefined` resolved values.
|
|
2197
|
-
* @returns {*} Returns the resolved value.
|
|
2198
|
-
* @example
|
|
2199
|
-
*
|
|
2200
|
-
* var object = { 'a': [{ 'b': { 'c': 3 } }] };
|
|
2201
|
-
*
|
|
2202
|
-
* _.get(object, 'a[0].b.c');
|
|
2203
|
-
* // => 3
|
|
2204
|
-
*
|
|
2205
|
-
* _.get(object, ['a', '0', 'b', 'c']);
|
|
2206
|
-
* // => 3
|
|
2207
|
-
*
|
|
2208
|
-
* _.get(object, 'a.b.c', 'default');
|
|
2209
|
-
* // => 'default'
|
|
2210
|
-
*/
|
|
2211
|
-
function get(object, path, defaultValue) {
|
|
2212
|
-
var result = object == null ? undefined : _baseGet(object, path);
|
|
2213
|
-
return result === undefined ? defaultValue : result;
|
|
2214
|
-
}
|
|
2215
|
-
|
|
2216
|
-
var get_1 = get;
|
|
2217
|
-
|
|
2218
|
-
var StateContext = /*#__PURE__*/createContext(); // eslint-disable-next-line react/display-name
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var _asyncToGenerator = require('@babel/runtime/helpers/asyncToGenerator');
|
|
6
|
+
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
7
|
+
var _slicedToArray = require('@babel/runtime/helpers/slicedToArray');
|
|
8
|
+
var _regeneratorRuntime = require('@babel/runtime/regenerator');
|
|
9
|
+
var _getClassName = require('babel-plugin-react-css-modules/dist/browser/getClassName');
|
|
10
|
+
var React = require('react');
|
|
11
|
+
var axios = require('axios');
|
|
12
|
+
var PropTypes = require('prop-types');
|
|
13
|
+
var lodash = require('lodash');
|
|
14
|
+
var components = require('@quintype/components');
|
|
15
|
+
var reactRedux = require('react-redux');
|
|
16
|
+
require('@babel/runtime/helpers/typeof');
|
|
17
|
+
require('react-timeago');
|
|
18
|
+
require('date-fns-tz');
|
|
19
|
+
|
|
20
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
21
|
+
|
|
22
|
+
var _asyncToGenerator__default = /*#__PURE__*/_interopDefaultLegacy(_asyncToGenerator);
|
|
23
|
+
var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_defineProperty);
|
|
24
|
+
var _slicedToArray__default = /*#__PURE__*/_interopDefaultLegacy(_slicedToArray);
|
|
25
|
+
var _regeneratorRuntime__default = /*#__PURE__*/_interopDefaultLegacy(_regeneratorRuntime);
|
|
26
|
+
var _getClassName__default = /*#__PURE__*/_interopDefaultLegacy(_getClassName);
|
|
27
|
+
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
28
|
+
var axios__default = /*#__PURE__*/_interopDefaultLegacy(axios);
|
|
29
|
+
var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
|
|
30
|
+
|
|
31
|
+
var StateContext = /*#__PURE__*/React.createContext(); // eslint-disable-next-line react/display-name
|
|
2219
32
|
|
|
2220
33
|
var StateProvider = function StateProvider(RowComponent) {
|
|
2221
34
|
return function (props) {
|
|
2222
35
|
return (
|
|
2223
36
|
/*#__PURE__*/
|
|
2224
37
|
// eslint-disable-next-line react/prop-types
|
|
2225
|
-
|
|
38
|
+
React__default["default"].createElement(StateContext.Provider, {
|
|
2226
39
|
value: props.config
|
|
2227
|
-
}, /*#__PURE__*/
|
|
40
|
+
}, /*#__PURE__*/React__default["default"].createElement(RowComponent, props))
|
|
2228
41
|
);
|
|
2229
42
|
};
|
|
2230
43
|
};
|
|
2231
44
|
var useStateValue = function useStateValue() {
|
|
2232
|
-
return useContext(StateContext);
|
|
45
|
+
return React.useContext(StateContext);
|
|
2233
46
|
};
|
|
2234
47
|
|
|
2235
48
|
var hexToRGB = function hexToRGB(hex) {
|
|
@@ -2260,10 +73,10 @@ var clientWidths = {
|
|
|
2260
73
|
tablet: 1024
|
|
2261
74
|
};
|
|
2262
75
|
var clientWidth = function clientWidth(device) {
|
|
2263
|
-
var foundDeviceWidth =
|
|
76
|
+
var foundDeviceWidth = lodash.get(clientWidths, device);
|
|
2264
77
|
|
|
2265
78
|
if (foundDeviceWidth) {
|
|
2266
|
-
return
|
|
79
|
+
return lodash.get(global, "document.documentElement.clientWidth") <= foundDeviceWidth;
|
|
2267
80
|
}
|
|
2268
81
|
|
|
2269
82
|
return false;
|
|
@@ -2293,7 +106,7 @@ var getSlug = function getSlug(collection) {
|
|
|
2293
106
|
var isSection = collection.template === "section";
|
|
2294
107
|
|
|
2295
108
|
if (isSection) {
|
|
2296
|
-
var sectionId =
|
|
109
|
+
var sectionId = lodash.get(collection, ["metadata", "section", "0", "id"], "");
|
|
2297
110
|
var sections = config.sections;
|
|
2298
111
|
var section = sections && sections.find(function (section) {
|
|
2299
112
|
return section.id === sectionId;
|
|
@@ -2309,21 +122,21 @@ function isExternalStory() {
|
|
|
2309
122
|
storyTemplate = _story$storyTemplate === void 0 ? "" : _story$storyTemplate,
|
|
2310
123
|
_story$metadata = story.metadata,
|
|
2311
124
|
metadata = _story$metadata === void 0 ? {} : _story$metadata;
|
|
2312
|
-
return storyTemplate === "news-elsewhere" ?
|
|
125
|
+
return storyTemplate === "news-elsewhere" ? lodash.get(metadata, ["reference-url"], "") : "";
|
|
2313
126
|
} // Adds target='_blank' attribute to anchor tags if not present
|
|
2314
|
-
|
|
2315
|
-
"sketches-host":
|
|
2316
|
-
"cdn-name":
|
|
2317
|
-
"cdn-image":
|
|
127
|
+
PropTypes__default["default"].shape({
|
|
128
|
+
"sketches-host": PropTypes__default["default"].string,
|
|
129
|
+
"cdn-name": PropTypes__default["default"].string,
|
|
130
|
+
"cdn-image": PropTypes__default["default"].string
|
|
2318
131
|
});
|
|
2319
|
-
|
|
2320
|
-
headline:
|
|
2321
|
-
"last-published-at":
|
|
2322
|
-
subheadline:
|
|
132
|
+
PropTypes__default["default"].shape({
|
|
133
|
+
headline: PropTypes__default["default"].string,
|
|
134
|
+
"last-published-at": PropTypes__default["default"].number,
|
|
135
|
+
subheadline: PropTypes__default["default"].string
|
|
2323
136
|
});
|
|
2324
137
|
var getStoryUrl = function getStoryUrl(story) {
|
|
2325
138
|
var defaultValue = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "";
|
|
2326
|
-
return
|
|
139
|
+
return lodash.get(story, ["story-template"]) === "news-elsewhere" ? lodash.get(story, ["metadata", "reference-url"], "") : story.url || defaultValue;
|
|
2327
140
|
};
|
|
2328
141
|
|
|
2329
142
|
var _styleModuleImportMap$2 = {
|
|
@@ -2351,7 +164,7 @@ var CollectionNameBase = function CollectionNameBase(_ref) {
|
|
|
2351
164
|
_ref$navigate = _ref.navigate,
|
|
2352
165
|
navigate = _ref$navigate === void 0 ? true : _ref$navigate;
|
|
2353
166
|
var collectionTitle = useStateValue() || {};
|
|
2354
|
-
var showRowTitle =
|
|
167
|
+
var showRowTitle = lodash.get(collectionTitle, ["showRowTitle"], true);
|
|
2355
168
|
var supportedTemplates = ["borderLeft", "borderBottom", "crossLine", "borderBottomFull"];
|
|
2356
169
|
var templateStyle = supportedTemplates.includes(collectionNameTemplate) ? " collection-".concat(collectionNameTemplate) : "";
|
|
2357
170
|
var slug = navigate && collection && getSlug(collection, config) || "";
|
|
@@ -2362,7 +175,7 @@ var CollectionNameBase = function CollectionNameBase(_ref) {
|
|
|
2362
175
|
var borderBottomFullStyle = templateStyle.includes("collection-borderBottomFull") ? "4px solid ".concat(CollectionNameBorderColor) : "";
|
|
2363
176
|
|
|
2364
177
|
var borderBottomStyle = function borderBottomStyle() {
|
|
2365
|
-
return templateStyle.includes("collection-borderBottom") && !templateStyle.includes("collection-borderBottomFull") ? /*#__PURE__*/
|
|
178
|
+
return templateStyle.includes("collection-borderBottom") && !templateStyle.includes("collection-borderBottomFull") ? /*#__PURE__*/React__default["default"].createElement("div", {
|
|
2366
179
|
className: "collection-name-m_border-bottom__1MnlV",
|
|
2367
180
|
style: {
|
|
2368
181
|
borderBottom: "4px solid ".concat(CollectionNameBorderColor)
|
|
@@ -2422,40 +235,40 @@ var CollectionNameBase = function CollectionNameBase(_ref) {
|
|
|
2422
235
|
}
|
|
2423
236
|
};
|
|
2424
237
|
|
|
2425
|
-
return /*#__PURE__*/
|
|
238
|
+
return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, showRowTitle && collectionName && /*#__PURE__*/React__default["default"].createElement("div", {
|
|
2426
239
|
style: {
|
|
2427
240
|
borderBottom: borderBottomFullStyle
|
|
2428
241
|
},
|
|
2429
242
|
"data-test-id": "collection-name",
|
|
2430
|
-
className: ("arr--collection-name arrow-component ".concat(templateStyle) ? "arr--collection-name arrow-component ".concat(templateStyle) + " " : "") +
|
|
2431
|
-
}, templateStyle.includes("collection-borderLeft") && /*#__PURE__*/
|
|
243
|
+
className: ("arr--collection-name arrow-component ".concat(templateStyle) ? "arr--collection-name arrow-component ".concat(templateStyle) + " " : "") + _getClassName__default["default"]("collection ".concat(textColor, " ").concat(templateStyle), _styleModuleImportMap$2)
|
|
244
|
+
}, templateStyle.includes("collection-borderLeft") && /*#__PURE__*/React__default["default"].createElement("span", {
|
|
2432
245
|
className: "arr-collection-name-border-left collection-name-m_border-left__3_pYw",
|
|
2433
246
|
style: {
|
|
2434
247
|
color: CollectionNameBorderColor,
|
|
2435
248
|
fontSize: getBorderHeight()
|
|
2436
249
|
}
|
|
2437
|
-
}), slug && !slug.includes(undefined) ? /*#__PURE__*/
|
|
250
|
+
}), slug && !slug.includes(undefined) ? /*#__PURE__*/React__default["default"].createElement(components.Link, {
|
|
2438
251
|
href: slug,
|
|
2439
252
|
"aria-label": "collection-name"
|
|
2440
|
-
}, /*#__PURE__*/
|
|
253
|
+
}, /*#__PURE__*/React__default["default"].createElement(HeaderTag, null, collectionName)) : /*#__PURE__*/React__default["default"].createElement(HeaderTag, null, collectionName), borderBottomStyle()));
|
|
2441
254
|
};
|
|
2442
255
|
CollectionNameBase.propTypes = {
|
|
2443
256
|
/** Collection name border color */
|
|
2444
|
-
collectionNameBorderColor: PropTypes
|
|
257
|
+
collectionNameBorderColor: PropTypes.PropTypes.string,
|
|
2445
258
|
|
|
2446
259
|
/** The Collection Object from the API response */
|
|
2447
|
-
collection: PropTypes
|
|
260
|
+
collection: PropTypes.PropTypes.object,
|
|
2448
261
|
|
|
2449
262
|
/** The publisher config from the API response */
|
|
2450
|
-
config: PropTypes
|
|
263
|
+
config: PropTypes.PropTypes.object,
|
|
2451
264
|
|
|
2452
265
|
/** The style template for the component */
|
|
2453
|
-
collectionNameTemplate: PropTypes
|
|
266
|
+
collectionNameTemplate: PropTypes.PropTypes.oneOf(["", "borderLeft", "borderBottom", "crossLine", "borderBottomFull"]),
|
|
2454
267
|
|
|
2455
268
|
/** Header tags ranging h1-h6, where h[headerLevel] */
|
|
2456
|
-
headerLevel: PropTypes
|
|
2457
|
-
customCollectionName: PropTypes
|
|
2458
|
-
navigate: PropTypes
|
|
269
|
+
headerLevel: PropTypes.PropTypes.string,
|
|
270
|
+
customCollectionName: PropTypes.PropTypes.string,
|
|
271
|
+
navigate: PropTypes.PropTypes.bool
|
|
2459
272
|
};
|
|
2460
273
|
CollectionNameBase.defaultProps = {
|
|
2461
274
|
collectionNameTemplate: "",
|
|
@@ -2464,30 +277,30 @@ CollectionNameBase.defaultProps = {
|
|
|
2464
277
|
|
|
2465
278
|
function mapStateToProps(state) {
|
|
2466
279
|
return {
|
|
2467
|
-
config:
|
|
280
|
+
config: lodash.get(state, ["qt", "config"], {})
|
|
2468
281
|
};
|
|
2469
282
|
}
|
|
2470
283
|
|
|
2471
|
-
var CollectionName = connect(mapStateToProps)(CollectionNameBase);
|
|
284
|
+
var CollectionName = reactRedux.connect(mapStateToProps)(CollectionNameBase);
|
|
2472
285
|
|
|
2473
286
|
var Loading = function Loading(_ref) {
|
|
2474
287
|
_ref.width;
|
|
2475
288
|
_ref.height;
|
|
2476
289
|
_ref.iconColor;
|
|
2477
|
-
return /*#__PURE__*/
|
|
290
|
+
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
2478
291
|
className: "loading-m_loading-indicator__2Dlst"
|
|
2479
|
-
}, /*#__PURE__*/
|
|
292
|
+
}, /*#__PURE__*/React__default["default"].createElement("svg", {
|
|
2480
293
|
width: "40",
|
|
2481
294
|
height: "40",
|
|
2482
295
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2483
296
|
viewBox: "0 0 100 100",
|
|
2484
297
|
preserveAspectRatio: "xMidYMid"
|
|
2485
|
-
}, /*#__PURE__*/
|
|
298
|
+
}, /*#__PURE__*/React__default["default"].createElement("circle", {
|
|
2486
299
|
cx: "84",
|
|
2487
300
|
cy: "50",
|
|
2488
301
|
r: "0",
|
|
2489
302
|
fill: "currentColor"
|
|
2490
|
-
}, /*#__PURE__*/
|
|
303
|
+
}, /*#__PURE__*/React__default["default"].createElement("animate", {
|
|
2491
304
|
attributeName: "r",
|
|
2492
305
|
values: "10;0;0;0;0",
|
|
2493
306
|
keyTimes: "0;0.25;0.5;0.75;1",
|
|
@@ -2496,7 +309,7 @@ var Loading = function Loading(_ref) {
|
|
|
2496
309
|
dur: "2s",
|
|
2497
310
|
repeatCount: "indefinite",
|
|
2498
311
|
begin: "0s"
|
|
2499
|
-
}), /*#__PURE__*/
|
|
312
|
+
}), /*#__PURE__*/React__default["default"].createElement("animate", {
|
|
2500
313
|
attributeName: "cx",
|
|
2501
314
|
values: "84;84;84;84;84",
|
|
2502
315
|
keyTimes: "0;0.25;0.5;0.75;1",
|
|
@@ -2505,12 +318,12 @@ var Loading = function Loading(_ref) {
|
|
|
2505
318
|
dur: "2s",
|
|
2506
319
|
repeatCount: "indefinite",
|
|
2507
320
|
begin: "0s"
|
|
2508
|
-
})), /*#__PURE__*/
|
|
321
|
+
})), /*#__PURE__*/React__default["default"].createElement("circle", {
|
|
2509
322
|
cx: "84",
|
|
2510
323
|
cy: "50",
|
|
2511
324
|
r: ".709",
|
|
2512
325
|
fill: "currentColor"
|
|
2513
|
-
}, /*#__PURE__*/
|
|
326
|
+
}, /*#__PURE__*/React__default["default"].createElement("animate", {
|
|
2514
327
|
attributeName: "r",
|
|
2515
328
|
values: "0;10;10;10;0",
|
|
2516
329
|
keyTimes: "0;0.25;0.5;0.75;1",
|
|
@@ -2519,7 +332,7 @@ var Loading = function Loading(_ref) {
|
|
|
2519
332
|
dur: "2s",
|
|
2520
333
|
repeatCount: "indefinite",
|
|
2521
334
|
begin: "-1s"
|
|
2522
|
-
}), /*#__PURE__*/
|
|
335
|
+
}), /*#__PURE__*/React__default["default"].createElement("animate", {
|
|
2523
336
|
attributeName: "cx",
|
|
2524
337
|
values: "16;16;50;84;84",
|
|
2525
338
|
keyTimes: "0;0.25;0.5;0.75;1",
|
|
@@ -2528,12 +341,12 @@ var Loading = function Loading(_ref) {
|
|
|
2528
341
|
dur: "2s",
|
|
2529
342
|
repeatCount: "indefinite",
|
|
2530
343
|
begin: "-1s"
|
|
2531
|
-
})), /*#__PURE__*/
|
|
344
|
+
})), /*#__PURE__*/React__default["default"].createElement("circle", {
|
|
2532
345
|
cx: "81.59",
|
|
2533
346
|
cy: "50",
|
|
2534
347
|
r: "10",
|
|
2535
348
|
fill: "currentColor"
|
|
2536
|
-
}, /*#__PURE__*/
|
|
349
|
+
}, /*#__PURE__*/React__default["default"].createElement("animate", {
|
|
2537
350
|
attributeName: "r",
|
|
2538
351
|
values: "0;10;10;10;0",
|
|
2539
352
|
keyTimes: "0;0.25;0.5;0.75;1",
|
|
@@ -2542,7 +355,7 @@ var Loading = function Loading(_ref) {
|
|
|
2542
355
|
dur: "2s",
|
|
2543
356
|
repeatCount: "indefinite",
|
|
2544
357
|
begin: "-0.5s"
|
|
2545
|
-
}), /*#__PURE__*/
|
|
358
|
+
}), /*#__PURE__*/React__default["default"].createElement("animate", {
|
|
2546
359
|
attributeName: "cx",
|
|
2547
360
|
values: "16;16;50;84;84",
|
|
2548
361
|
keyTimes: "0;0.25;0.5;0.75;1",
|
|
@@ -2551,12 +364,12 @@ var Loading = function Loading(_ref) {
|
|
|
2551
364
|
dur: "2s",
|
|
2552
365
|
repeatCount: "indefinite",
|
|
2553
366
|
begin: "-0.5s"
|
|
2554
|
-
})), /*#__PURE__*/
|
|
367
|
+
})), /*#__PURE__*/React__default["default"].createElement("circle", {
|
|
2555
368
|
cx: "47.59",
|
|
2556
369
|
cy: "50",
|
|
2557
370
|
r: "10",
|
|
2558
371
|
fill: "currentColor"
|
|
2559
|
-
}, /*#__PURE__*/
|
|
372
|
+
}, /*#__PURE__*/React__default["default"].createElement("animate", {
|
|
2560
373
|
attributeName: "r",
|
|
2561
374
|
values: "0;10;10;10;0",
|
|
2562
375
|
keyTimes: "0;0.25;0.5;0.75;1",
|
|
@@ -2565,7 +378,7 @@ var Loading = function Loading(_ref) {
|
|
|
2565
378
|
dur: "2s",
|
|
2566
379
|
repeatCount: "indefinite",
|
|
2567
380
|
begin: "0s"
|
|
2568
|
-
}), /*#__PURE__*/
|
|
381
|
+
}), /*#__PURE__*/React__default["default"].createElement("animate", {
|
|
2569
382
|
attributeName: "cx",
|
|
2570
383
|
values: "16;16;50;84;84",
|
|
2571
384
|
keyTimes: "0;0.25;0.5;0.75;1",
|
|
@@ -2574,12 +387,12 @@ var Loading = function Loading(_ref) {
|
|
|
2574
387
|
dur: "2s",
|
|
2575
388
|
repeatCount: "indefinite",
|
|
2576
389
|
begin: "0s"
|
|
2577
|
-
})), /*#__PURE__*/
|
|
390
|
+
})), /*#__PURE__*/React__default["default"].createElement("circle", {
|
|
2578
391
|
cx: "16",
|
|
2579
392
|
cy: "50",
|
|
2580
393
|
r: "9.291",
|
|
2581
394
|
fill: "currentColor"
|
|
2582
|
-
}, /*#__PURE__*/
|
|
395
|
+
}, /*#__PURE__*/React__default["default"].createElement("animate", {
|
|
2583
396
|
attributeName: "r",
|
|
2584
397
|
values: "0;0;10;10;10",
|
|
2585
398
|
keyTimes: "0;0.25;0.5;0.75;1",
|
|
@@ -2588,7 +401,7 @@ var Loading = function Loading(_ref) {
|
|
|
2588
401
|
dur: "2s",
|
|
2589
402
|
repeatCount: "indefinite",
|
|
2590
403
|
begin: "0s"
|
|
2591
|
-
}), /*#__PURE__*/
|
|
404
|
+
}), /*#__PURE__*/React__default["default"].createElement("animate", {
|
|
2592
405
|
attributeName: "cx",
|
|
2593
406
|
values: "16;16;16;50;84",
|
|
2594
407
|
keyTimes: "0;0.25;0.5;0.75;1",
|
|
@@ -2600,9 +413,9 @@ var Loading = function Loading(_ref) {
|
|
|
2600
413
|
}))));
|
|
2601
414
|
};
|
|
2602
415
|
Loading.propTypes = {
|
|
2603
|
-
width:
|
|
2604
|
-
height:
|
|
2605
|
-
iconColor:
|
|
416
|
+
width: PropTypes__default["default"].object,
|
|
417
|
+
height: PropTypes__default["default"].object,
|
|
418
|
+
iconColor: PropTypes__default["default"].object
|
|
2606
419
|
};
|
|
2607
420
|
|
|
2608
421
|
var CrownIcon = function CrownIcon(_ref) {
|
|
@@ -2611,7 +424,7 @@ var CrownIcon = function CrownIcon(_ref) {
|
|
|
2611
424
|
_ref$color = _ref.color,
|
|
2612
425
|
color = _ref$color === void 0 ? "#D8D8D8" : _ref$color,
|
|
2613
426
|
positionTop = _ref.positionTop;
|
|
2614
|
-
return /*#__PURE__*/
|
|
427
|
+
return /*#__PURE__*/React__default["default"].createElement("svg", {
|
|
2615
428
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2616
429
|
width: width,
|
|
2617
430
|
height: height,
|
|
@@ -2620,28 +433,28 @@ var CrownIcon = function CrownIcon(_ref) {
|
|
|
2620
433
|
position: "relative",
|
|
2621
434
|
top: positionTop
|
|
2622
435
|
}
|
|
2623
|
-
}, /*#__PURE__*/
|
|
436
|
+
}, /*#__PURE__*/React__default["default"].createElement("g", {
|
|
2624
437
|
fill: "none",
|
|
2625
438
|
fillRule: "evenodd",
|
|
2626
439
|
stroke: "none",
|
|
2627
440
|
strokeWidth: "1"
|
|
2628
|
-
}, /*#__PURE__*/
|
|
441
|
+
}, /*#__PURE__*/React__default["default"].createElement("g", null, /*#__PURE__*/React__default["default"].createElement("g", {
|
|
2629
442
|
transform: "translate(8 8)"
|
|
2630
|
-
}, /*#__PURE__*/
|
|
443
|
+
}, /*#__PURE__*/React__default["default"].createElement("path", {
|
|
2631
444
|
d: "M0 0H24V24H0z"
|
|
2632
|
-
}), /*#__PURE__*/
|
|
445
|
+
}), /*#__PURE__*/React__default["default"].createElement("g", {
|
|
2633
446
|
fill: color,
|
|
2634
447
|
fillRule: "nonzero",
|
|
2635
448
|
transform: "translate(0 2)"
|
|
2636
|
-
}, /*#__PURE__*/
|
|
449
|
+
}, /*#__PURE__*/React__default["default"].createElement("path", {
|
|
2637
450
|
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"
|
|
2638
451
|
}))))));
|
|
2639
452
|
};
|
|
2640
453
|
CrownIcon.propTypes = {
|
|
2641
|
-
height:
|
|
2642
|
-
width:
|
|
2643
|
-
color:
|
|
2644
|
-
positionTop:
|
|
454
|
+
height: PropTypes__default["default"].string,
|
|
455
|
+
width: PropTypes__default["default"].string,
|
|
456
|
+
color: PropTypes__default["default"].string,
|
|
457
|
+
positionTop: PropTypes__default["default"].string
|
|
2645
458
|
};
|
|
2646
459
|
|
|
2647
460
|
var KeyIcon = function KeyIcon(_ref) {
|
|
@@ -2650,7 +463,7 @@ var KeyIcon = function KeyIcon(_ref) {
|
|
|
2650
463
|
_ref$color = _ref.color,
|
|
2651
464
|
color = _ref$color === void 0 ? "#D5D5D5" : _ref$color,
|
|
2652
465
|
positionTop = _ref.positionTop;
|
|
2653
|
-
return /*#__PURE__*/
|
|
466
|
+
return /*#__PURE__*/React__default["default"].createElement("svg", {
|
|
2654
467
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2655
468
|
width: width,
|
|
2656
469
|
height: height,
|
|
@@ -2659,16 +472,16 @@ var KeyIcon = function KeyIcon(_ref) {
|
|
|
2659
472
|
position: "relative",
|
|
2660
473
|
top: positionTop
|
|
2661
474
|
}
|
|
2662
|
-
}, /*#__PURE__*/
|
|
475
|
+
}, /*#__PURE__*/React__default["default"].createElement("g", {
|
|
2663
476
|
fill: "none",
|
|
2664
477
|
fillRule: "evenodd",
|
|
2665
478
|
stroke: "none",
|
|
2666
479
|
strokeWidth: "1"
|
|
2667
|
-
}, /*#__PURE__*/
|
|
480
|
+
}, /*#__PURE__*/React__default["default"].createElement("g", null, /*#__PURE__*/React__default["default"].createElement("g", {
|
|
2668
481
|
transform: "translate(8 8)"
|
|
2669
|
-
}, /*#__PURE__*/
|
|
482
|
+
}, /*#__PURE__*/React__default["default"].createElement("path", {
|
|
2670
483
|
d: "M0 0H24V24H0z"
|
|
2671
|
-
}), /*#__PURE__*/
|
|
484
|
+
}), /*#__PURE__*/React__default["default"].createElement("path", {
|
|
2672
485
|
fill: color,
|
|
2673
486
|
fillRule: "nonzero",
|
|
2674
487
|
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",
|
|
@@ -2676,10 +489,10 @@ var KeyIcon = function KeyIcon(_ref) {
|
|
|
2676
489
|
})))));
|
|
2677
490
|
};
|
|
2678
491
|
KeyIcon.propTypes = {
|
|
2679
|
-
height:
|
|
2680
|
-
width:
|
|
2681
|
-
color:
|
|
2682
|
-
positionTop:
|
|
492
|
+
height: PropTypes__default["default"].string,
|
|
493
|
+
width: PropTypes__default["default"].string,
|
|
494
|
+
color: PropTypes__default["default"].string,
|
|
495
|
+
positionTop: PropTypes__default["default"].string
|
|
2683
496
|
};
|
|
2684
497
|
|
|
2685
498
|
var LockIcon = function LockIcon(_ref) {
|
|
@@ -2688,7 +501,7 @@ var LockIcon = function LockIcon(_ref) {
|
|
|
2688
501
|
_ref$color = _ref.color,
|
|
2689
502
|
color = _ref$color === void 0 ? "#D5D5D5" : _ref$color,
|
|
2690
503
|
positionTop = _ref.positionTop;
|
|
2691
|
-
return /*#__PURE__*/
|
|
504
|
+
return /*#__PURE__*/React__default["default"].createElement("svg", {
|
|
2692
505
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2693
506
|
width: width,
|
|
2694
507
|
height: height,
|
|
@@ -2697,28 +510,28 @@ var LockIcon = function LockIcon(_ref) {
|
|
|
2697
510
|
position: "relative",
|
|
2698
511
|
top: positionTop
|
|
2699
512
|
}
|
|
2700
|
-
}, /*#__PURE__*/
|
|
513
|
+
}, /*#__PURE__*/React__default["default"].createElement("g", {
|
|
2701
514
|
fill: "none",
|
|
2702
515
|
fillRule: "evenodd",
|
|
2703
516
|
stroke: "none",
|
|
2704
517
|
strokeWidth: "1"
|
|
2705
|
-
}, /*#__PURE__*/
|
|
518
|
+
}, /*#__PURE__*/React__default["default"].createElement("g", null, /*#__PURE__*/React__default["default"].createElement("g", {
|
|
2706
519
|
transform: "translate(8 8)"
|
|
2707
|
-
}, /*#__PURE__*/
|
|
520
|
+
}, /*#__PURE__*/React__default["default"].createElement("path", {
|
|
2708
521
|
d: "M0 0H24V24H0z"
|
|
2709
|
-
}), /*#__PURE__*/
|
|
522
|
+
}), /*#__PURE__*/React__default["default"].createElement("g", {
|
|
2710
523
|
fill: color,
|
|
2711
524
|
fillRule: "nonzero",
|
|
2712
525
|
transform: "translate(3)"
|
|
2713
|
-
}, /*#__PURE__*/
|
|
526
|
+
}, /*#__PURE__*/React__default["default"].createElement("path", {
|
|
2714
527
|
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"
|
|
2715
528
|
}))))));
|
|
2716
529
|
};
|
|
2717
530
|
LockIcon.propTypes = {
|
|
2718
|
-
height:
|
|
2719
|
-
width:
|
|
2720
|
-
color:
|
|
2721
|
-
positionTop:
|
|
531
|
+
height: PropTypes__default["default"].string,
|
|
532
|
+
width: PropTypes__default["default"].string,
|
|
533
|
+
color: PropTypes__default["default"].string,
|
|
534
|
+
positionTop: PropTypes__default["default"].string
|
|
2722
535
|
};
|
|
2723
536
|
|
|
2724
537
|
var StarIcon = function StarIcon(_ref) {
|
|
@@ -2728,7 +541,7 @@ var StarIcon = function StarIcon(_ref) {
|
|
|
2728
541
|
color = _ref$color === void 0 ? "#D5D5D5" : _ref$color,
|
|
2729
542
|
_ref$positionTop = _ref.positionTop,
|
|
2730
543
|
positionTop = _ref$positionTop === void 0 ? "" : _ref$positionTop;
|
|
2731
|
-
return /*#__PURE__*/
|
|
544
|
+
return /*#__PURE__*/React__default["default"].createElement("svg", {
|
|
2732
545
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2733
546
|
width: width,
|
|
2734
547
|
height: height,
|
|
@@ -2737,21 +550,21 @@ var StarIcon = function StarIcon(_ref) {
|
|
|
2737
550
|
position: "relative",
|
|
2738
551
|
top: positionTop
|
|
2739
552
|
}
|
|
2740
|
-
}, /*#__PURE__*/
|
|
553
|
+
}, /*#__PURE__*/React__default["default"].createElement("g", {
|
|
2741
554
|
fill: "none",
|
|
2742
555
|
fillRule: "evenodd",
|
|
2743
556
|
stroke: "none",
|
|
2744
557
|
strokeWidth: "1"
|
|
2745
|
-
}, /*#__PURE__*/
|
|
558
|
+
}, /*#__PURE__*/React__default["default"].createElement("g", null, /*#__PURE__*/React__default["default"].createElement("path", {
|
|
2746
559
|
fill: color,
|
|
2747
560
|
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"
|
|
2748
561
|
}))));
|
|
2749
562
|
};
|
|
2750
563
|
StarIcon.propTypes = {
|
|
2751
|
-
height:
|
|
2752
|
-
width:
|
|
2753
|
-
color:
|
|
2754
|
-
positionTop:
|
|
564
|
+
height: PropTypes__default["default"].string,
|
|
565
|
+
width: PropTypes__default["default"].string,
|
|
566
|
+
color: PropTypes__default["default"].string,
|
|
567
|
+
positionTop: PropTypes__default["default"].string
|
|
2755
568
|
};
|
|
2756
569
|
|
|
2757
570
|
var PremiumStoryIcon = function PremiumStoryIcon(_ref) {
|
|
@@ -2763,7 +576,7 @@ var PremiumStoryIcon = function PremiumStoryIcon(_ref) {
|
|
|
2763
576
|
|
|
2764
577
|
switch (iconType) {
|
|
2765
578
|
case "crown":
|
|
2766
|
-
return /*#__PURE__*/
|
|
579
|
+
return /*#__PURE__*/React__default["default"].createElement(CrownIcon, {
|
|
2767
580
|
width: width,
|
|
2768
581
|
height: height,
|
|
2769
582
|
color: color,
|
|
@@ -2771,7 +584,7 @@ var PremiumStoryIcon = function PremiumStoryIcon(_ref) {
|
|
|
2771
584
|
});
|
|
2772
585
|
|
|
2773
586
|
case "lock":
|
|
2774
|
-
return /*#__PURE__*/
|
|
587
|
+
return /*#__PURE__*/React__default["default"].createElement(LockIcon, {
|
|
2775
588
|
width: width,
|
|
2776
589
|
height: height,
|
|
2777
590
|
color: color,
|
|
@@ -2779,7 +592,7 @@ var PremiumStoryIcon = function PremiumStoryIcon(_ref) {
|
|
|
2779
592
|
});
|
|
2780
593
|
|
|
2781
594
|
case "key":
|
|
2782
|
-
return /*#__PURE__*/
|
|
595
|
+
return /*#__PURE__*/React__default["default"].createElement(KeyIcon, {
|
|
2783
596
|
width: width,
|
|
2784
597
|
height: height,
|
|
2785
598
|
color: color,
|
|
@@ -2787,7 +600,7 @@ var PremiumStoryIcon = function PremiumStoryIcon(_ref) {
|
|
|
2787
600
|
});
|
|
2788
601
|
|
|
2789
602
|
default:
|
|
2790
|
-
return /*#__PURE__*/
|
|
603
|
+
return /*#__PURE__*/React__default["default"].createElement(StarIcon, {
|
|
2791
604
|
width: width,
|
|
2792
605
|
height: height,
|
|
2793
606
|
color: color,
|
|
@@ -2796,21 +609,21 @@ var PremiumStoryIcon = function PremiumStoryIcon(_ref) {
|
|
|
2796
609
|
}
|
|
2797
610
|
};
|
|
2798
611
|
PremiumStoryIcon.propTypes = {
|
|
2799
|
-
width:
|
|
2800
|
-
height:
|
|
2801
|
-
color:
|
|
2802
|
-
iconType:
|
|
2803
|
-
positionTop:
|
|
612
|
+
width: PropTypes__default["default"].string,
|
|
613
|
+
height: PropTypes__default["default"].string,
|
|
614
|
+
color: PropTypes__default["default"].string,
|
|
615
|
+
iconType: PropTypes__default["default"].string,
|
|
616
|
+
positionTop: PropTypes__default["default"].string
|
|
2804
617
|
};
|
|
2805
618
|
|
|
2806
619
|
function LiveIcon() {
|
|
2807
|
-
return /*#__PURE__*/
|
|
620
|
+
return /*#__PURE__*/React__default["default"].createElement("svg", {
|
|
2808
621
|
className: "live-icon",
|
|
2809
622
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2810
623
|
width: "25",
|
|
2811
624
|
height: "24",
|
|
2812
625
|
viewBox: "0 0 25 24"
|
|
2813
|
-
}, /*#__PURE__*/
|
|
626
|
+
}, /*#__PURE__*/React__default["default"].createElement("path", {
|
|
2814
627
|
fill: "#ff5858",
|
|
2815
628
|
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"
|
|
2816
629
|
}));
|
|
@@ -2839,8 +652,8 @@ var Headline = function Headline(_ref) {
|
|
|
2839
652
|
enablePremiumStoryIcon = _premiumStoryIconConf3 === void 0 ? false : _premiumStoryIconConf3,
|
|
2840
653
|
_premiumStoryIconConf4 = premiumStoryIconConfig.showLiveIcon,
|
|
2841
654
|
showLiveIcon = _premiumStoryIconConf4 === void 0 ? false : _premiumStoryIconConf4;
|
|
2842
|
-
var alternateHeadline =
|
|
2843
|
-
var premiumStory = enablePremiumStoryIcon &&
|
|
655
|
+
var alternateHeadline = lodash.get(story, ["alternative", "home", "default", "headline"]);
|
|
656
|
+
var premiumStory = enablePremiumStoryIcon && lodash.get(story, ["access"]) === "subscription";
|
|
2844
657
|
var headline = alternateHeadline || story.headline;
|
|
2845
658
|
var HeaderTag = "h" + headerLevel;
|
|
2846
659
|
|
|
@@ -2866,38 +679,38 @@ var Headline = function Headline(_ref) {
|
|
|
2866
679
|
var textColor = getTextColor(configData.theme);
|
|
2867
680
|
var wrapperClass = premiumStory ? "wrapper" : "";
|
|
2868
681
|
var iconSize = "24px";
|
|
2869
|
-
var enableLiveIcon = showLiveIcon && story["story-template"] === "live-blog" && !
|
|
2870
|
-
return /*#__PURE__*/
|
|
682
|
+
var enableLiveIcon = showLiveIcon && story["story-template"] === "live-blog" && !lodash.get(story, ["metadata", "is-closed"], false);
|
|
683
|
+
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
2871
684
|
"data-test-id": "headline",
|
|
2872
|
-
className: "arrow-component arr--headline " +
|
|
2873
|
-
}, premiumStory && /*#__PURE__*/
|
|
685
|
+
className: "arrow-component arr--headline " + _getClassName__default["default"](wrapperClass, _styleModuleImportMap$1)
|
|
686
|
+
}, premiumStory && /*#__PURE__*/React__default["default"].createElement(PremiumStoryIcon, {
|
|
2874
687
|
width: iconSize,
|
|
2875
688
|
height: iconSize,
|
|
2876
689
|
color: iconColor,
|
|
2877
690
|
iconType: iconStyle,
|
|
2878
691
|
positionTop: positionHeadline()
|
|
2879
|
-
}), isLink ? /*#__PURE__*/
|
|
692
|
+
}), isLink ? /*#__PURE__*/React__default["default"].createElement(components.Link, {
|
|
2880
693
|
href: getStoryUrl(story, "/".concat(story.slug)),
|
|
2881
694
|
externalLink: isExternalStory(story),
|
|
2882
695
|
"aria-label": "headline"
|
|
2883
|
-
}, /*#__PURE__*/
|
|
2884
|
-
className:
|
|
2885
|
-
}, enableLiveIcon && /*#__PURE__*/
|
|
2886
|
-
className:
|
|
2887
|
-
}, enableLiveIcon && /*#__PURE__*/
|
|
696
|
+
}, /*#__PURE__*/React__default["default"].createElement(HeaderTag, {
|
|
697
|
+
className: _getClassName__default["default"]("headline ".concat(textColor), _styleModuleImportMap$1)
|
|
698
|
+
}, enableLiveIcon && /*#__PURE__*/React__default["default"].createElement(LiveIcon, null), headline)) : /*#__PURE__*/React__default["default"].createElement(HeaderTag, {
|
|
699
|
+
className: _getClassName__default["default"]("headline ".concat(textColor), _styleModuleImportMap$1)
|
|
700
|
+
}, enableLiveIcon && /*#__PURE__*/React__default["default"].createElement(LiveIcon, null), headline));
|
|
2888
701
|
};
|
|
2889
702
|
Headline.propTypes = {
|
|
2890
703
|
/** The Story Object from the API response */
|
|
2891
|
-
story:
|
|
704
|
+
story: PropTypes__default["default"].object.isRequired,
|
|
2892
705
|
|
|
2893
706
|
/** Header tags ranging h1-h6, where h[headerLevel] */
|
|
2894
|
-
headerLevel:
|
|
2895
|
-
premiumStoryIconConfig:
|
|
2896
|
-
iconColor:
|
|
2897
|
-
iconType:
|
|
2898
|
-
enablePremiumStoryIcon:
|
|
707
|
+
headerLevel: PropTypes__default["default"].string,
|
|
708
|
+
premiumStoryIconConfig: PropTypes__default["default"].shape({
|
|
709
|
+
iconColor: PropTypes__default["default"].string,
|
|
710
|
+
iconType: PropTypes__default["default"].string,
|
|
711
|
+
enablePremiumStoryIcon: PropTypes__default["default"].bool
|
|
2899
712
|
}),
|
|
2900
|
-
isLink:
|
|
713
|
+
isLink: PropTypes__default["default"].bool
|
|
2901
714
|
};
|
|
2902
715
|
Headline.defaultProps = {
|
|
2903
716
|
headerLevel: "6",
|
|
@@ -2926,7 +739,7 @@ var _styleModuleImportMap = {
|
|
|
2926
739
|
|
|
2927
740
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
2928
741
|
|
|
2929
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) {
|
|
742
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty__default["default"](target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
2930
743
|
var ListiclesBase = function ListiclesBase(_ref) {
|
|
2931
744
|
var collection = _ref.collection,
|
|
2932
745
|
_ref$config = _ref.config,
|
|
@@ -2940,27 +753,27 @@ var ListiclesBase = function ListiclesBase(_ref) {
|
|
|
2940
753
|
_config$slotConfig = config.slotConfig,
|
|
2941
754
|
slotConfig = _config$slotConfig === void 0 ? null : _config$slotConfig;
|
|
2942
755
|
|
|
2943
|
-
var _useState = useState([]),
|
|
2944
|
-
_useState2 =
|
|
756
|
+
var _useState = React.useState([]),
|
|
757
|
+
_useState2 = _slicedToArray__default["default"](_useState, 2),
|
|
2945
758
|
subCollectionStories = _useState2[0],
|
|
2946
759
|
handleApiData = _useState2[1];
|
|
2947
760
|
|
|
2948
|
-
var _useState3 = useState({}),
|
|
2949
|
-
_useState4 =
|
|
761
|
+
var _useState3 = React.useState({}),
|
|
762
|
+
_useState4 = _slicedToArray__default["default"](_useState3, 2),
|
|
2950
763
|
cachedStories = _useState4[0],
|
|
2951
764
|
updateCachedStories = _useState4[1];
|
|
2952
765
|
|
|
2953
|
-
var _useState5 = useState(0),
|
|
2954
|
-
_useState6 =
|
|
766
|
+
var _useState5 = React.useState(0),
|
|
767
|
+
_useState6 = _slicedToArray__default["default"](_useState5, 2),
|
|
2955
768
|
active = _useState6[0],
|
|
2956
769
|
handleActive = _useState6[1];
|
|
2957
770
|
|
|
2958
|
-
var _useState7 = useState(true),
|
|
2959
|
-
_useState8 =
|
|
771
|
+
var _useState7 = React.useState(true),
|
|
772
|
+
_useState8 = _slicedToArray__default["default"](_useState7, 2),
|
|
2960
773
|
loading = _useState8[0],
|
|
2961
774
|
handleLoading = _useState8[1];
|
|
2962
775
|
|
|
2963
|
-
var getFilteredCollection =
|
|
776
|
+
var getFilteredCollection = lodash.get(collection, ["items"], []).filter(function (collections) {
|
|
2964
777
|
return collections.type === "collection";
|
|
2965
778
|
});
|
|
2966
779
|
|
|
@@ -2974,7 +787,7 @@ var ListiclesBase = function ListiclesBase(_ref) {
|
|
|
2974
787
|
|
|
2975
788
|
var memoizeStories = function memoizeStories(id, data) {
|
|
2976
789
|
updateCachedStories(function (cachedStories) {
|
|
2977
|
-
return _objectSpread(_objectSpread({}, cachedStories), {},
|
|
790
|
+
return _objectSpread(_objectSpread({}, cachedStories), {}, _defineProperty__default["default"]({}, id, data));
|
|
2978
791
|
});
|
|
2979
792
|
};
|
|
2980
793
|
|
|
@@ -2983,13 +796,13 @@ var ListiclesBase = function ListiclesBase(_ref) {
|
|
|
2983
796
|
}
|
|
2984
797
|
|
|
2985
798
|
function _fetchSubCollectionData() {
|
|
2986
|
-
_fetchSubCollectionData =
|
|
799
|
+
_fetchSubCollectionData = _asyncToGenerator__default["default"]( /*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee() {
|
|
2987
800
|
var id,
|
|
2988
801
|
data,
|
|
2989
802
|
res,
|
|
2990
803
|
childCollectionItems,
|
|
2991
804
|
_args = arguments;
|
|
2992
|
-
return
|
|
805
|
+
return _regeneratorRuntime__default["default"].wrap(function _callee$(_context) {
|
|
2993
806
|
while (1) {
|
|
2994
807
|
switch (_context.prev = _context.next) {
|
|
2995
808
|
case 0:
|
|
@@ -3004,7 +817,7 @@ var ListiclesBase = function ListiclesBase(_ref) {
|
|
|
3004
817
|
}
|
|
3005
818
|
|
|
3006
819
|
_context.next = 7;
|
|
3007
|
-
return
|
|
820
|
+
return axios__default["default"].get("/api/v1/collections/".concat(id, "?limit=9"));
|
|
3008
821
|
|
|
3009
822
|
case 7:
|
|
3010
823
|
res = _context.sent;
|
|
@@ -3017,7 +830,7 @@ var ListiclesBase = function ListiclesBase(_ref) {
|
|
|
3017
830
|
|
|
3018
831
|
case 12:
|
|
3019
832
|
memoizeStories(id, data);
|
|
3020
|
-
childCollectionItems = collectionToStories(data);
|
|
833
|
+
childCollectionItems = components.collectionToStories(data);
|
|
3021
834
|
handleLoading(false);
|
|
3022
835
|
handleApiData(childCollectionItems);
|
|
3023
836
|
_context.next = 21;
|
|
@@ -3039,7 +852,7 @@ var ListiclesBase = function ListiclesBase(_ref) {
|
|
|
3039
852
|
return _fetchSubCollectionData.apply(this, arguments);
|
|
3040
853
|
}
|
|
3041
854
|
|
|
3042
|
-
useEffect(function (id) {
|
|
855
|
+
React.useEffect(function (id) {
|
|
3043
856
|
fetchSubCollectionData(id);
|
|
3044
857
|
}, []);
|
|
3045
858
|
var items = subCollectionStories.slice(0, 9);
|
|
@@ -3056,9 +869,9 @@ var ListiclesBase = function ListiclesBase(_ref) {
|
|
|
3056
869
|
|
|
3057
870
|
var generateOpinions = function generateOpinions() {
|
|
3058
871
|
if (slotConfig) {
|
|
3059
|
-
return /*#__PURE__*/
|
|
872
|
+
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
3060
873
|
className: "listicles-m_six-opinions-container__CbjCC"
|
|
3061
|
-
}, getOpinions(6), /*#__PURE__*/
|
|
874
|
+
}, getOpinions(6), /*#__PURE__*/React__default["default"].createElement("div", null, slotConfig()));
|
|
3062
875
|
}
|
|
3063
876
|
|
|
3064
877
|
return getOpinions();
|
|
@@ -3066,59 +879,59 @@ var ListiclesBase = function ListiclesBase(_ref) {
|
|
|
3066
879
|
|
|
3067
880
|
var getOpinions = function getOpinions() {
|
|
3068
881
|
var numberOfStories = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 9;
|
|
3069
|
-
return /*#__PURE__*/
|
|
882
|
+
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
3070
883
|
className: "listicles-m_opinions-wrapper__2fpO8"
|
|
3071
884
|
}, items.slice(0, numberOfStories).map(function (story, index) {
|
|
3072
|
-
return /*#__PURE__*/
|
|
885
|
+
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
3073
886
|
className: "listicles-m_opinion-wrapper__27oZ8",
|
|
3074
887
|
key: index
|
|
3075
|
-
}, /*#__PURE__*/
|
|
888
|
+
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
3076
889
|
className: "listicles-m_opinion-counter__2ntNh"
|
|
3077
|
-
}, index + 1), /*#__PURE__*/
|
|
890
|
+
}, index + 1), /*#__PURE__*/React__default["default"].createElement(Headline, {
|
|
3078
891
|
story: story
|
|
3079
892
|
}));
|
|
3080
893
|
}));
|
|
3081
894
|
};
|
|
3082
895
|
|
|
3083
|
-
return /*#__PURE__*/
|
|
896
|
+
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
3084
897
|
className: "full-width-with-padding arrow-component",
|
|
3085
898
|
"data-test-id": "collection-filter",
|
|
3086
899
|
style: {
|
|
3087
900
|
backgroundColor: theme,
|
|
3088
901
|
color: textColor
|
|
3089
902
|
}
|
|
3090
|
-
}, /*#__PURE__*/
|
|
3091
|
-
className:
|
|
3092
|
-
}, /*#__PURE__*/
|
|
903
|
+
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
904
|
+
className: _getClassName__default["default"]("wrapper ".concat(getCustomStyleName), _styleModuleImportMap)
|
|
905
|
+
}, /*#__PURE__*/React__default["default"].createElement(CollectionName, {
|
|
3093
906
|
collection: collection,
|
|
3094
907
|
collectionNameTemplate: collectionNameTemplate,
|
|
3095
908
|
collectionNameBorderColor: collectionNameBorderColor
|
|
3096
|
-
}), /*#__PURE__*/
|
|
909
|
+
}), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
3097
910
|
className: "child-collections listicles-m_child-collections__3kb_6"
|
|
3098
911
|
}, getFilteredCollection.map(function (subCollections, index) {
|
|
3099
|
-
return /*#__PURE__*/
|
|
912
|
+
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
3100
913
|
key: index,
|
|
3101
|
-
className: ((index === active ? "open-subchild" : "") ? (index === active ? "open-subchild" : "") + " " : "") +
|
|
3102
|
-
}, /*#__PURE__*/
|
|
914
|
+
className: ((index === active ? "open-subchild" : "") ? (index === active ? "open-subchild" : "") + " " : "") + _getClassName__default["default"]("child-collection-wrapper ".concat(index === active ? "open-subchild" : ""), _styleModuleImportMap)
|
|
915
|
+
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
3103
916
|
onClick: function onClick(event) {
|
|
3104
917
|
return openChildCollectionItems(event, index, subCollections.id);
|
|
3105
918
|
},
|
|
3106
|
-
className:
|
|
919
|
+
className: _getClassName__default["default"]("child-collection ".concat(textColor), _styleModuleImportMap)
|
|
3107
920
|
}, subCollections.name));
|
|
3108
|
-
})), /*#__PURE__*/
|
|
921
|
+
})), /*#__PURE__*/React__default["default"].createElement("div", null, loading ? /*#__PURE__*/React__default["default"].createElement(Loading, null) : generateOpinions())));
|
|
3109
922
|
};
|
|
3110
923
|
ListiclesBase.propTypes = {
|
|
3111
924
|
/** collection is the array of objects which is returning by API */
|
|
3112
|
-
collection:
|
|
925
|
+
collection: PropTypes__default["default"].object.isRequired,
|
|
3113
926
|
|
|
3114
927
|
/** The config for the Row */
|
|
3115
|
-
config:
|
|
928
|
+
config: PropTypes__default["default"].shape({
|
|
3116
929
|
// background color of the row
|
|
3117
|
-
theme:
|
|
930
|
+
theme: PropTypes__default["default"].string,
|
|
3118
931
|
// configure ad slot widget and story
|
|
3119
|
-
slotConfig:
|
|
3120
|
-
collectionNameTemplate:
|
|
3121
|
-
collectionNameBorderColor:
|
|
932
|
+
slotConfig: PropTypes__default["default"].func,
|
|
933
|
+
collectionNameTemplate: PropTypes__default["default"].string,
|
|
934
|
+
collectionNameBorderColor: PropTypes__default["default"].string
|
|
3122
935
|
})
|
|
3123
936
|
};
|
|
3124
937
|
ListiclesBase.defaultProps = {
|
|
@@ -3128,4 +941,5 @@ ListiclesBase.defaultProps = {
|
|
|
3128
941
|
};
|
|
3129
942
|
var Listicles = StateProvider(ListiclesBase);
|
|
3130
943
|
|
|
3131
|
-
|
|
944
|
+
exports.Listicles = Listicles;
|
|
945
|
+
exports.ListiclesBase = ListiclesBase;
|