@quintype/arrow 3.15.1-perf.3 → 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 +14 -2103
- package/atoms/Author/styles.arrow.css +1 -1
- package/atoms/AuthorWithTime/index.js +32 -2482
- package/atoms/AuthorWithTime/styles.arrow.css +1 -1
- package/atoms/CollectionName/index.js +12 -2101
- package/atoms/CollectionName/styles.arrow.css +1 -1
- package/atoms/ExtendedLoadMore/{index-b22f1843.js → index-0f809dd9.js} +10 -7
- package/atoms/ExtendedLoadMore/index-142f015c.js +476 -0
- package/atoms/ExtendedLoadMore/{index-bc129cb8.js → index-37a9ccff.js} +18 -10
- package/atoms/ExtendedLoadMore/{index-6e083738.js → index-446679c8.js} +20 -12
- package/atoms/ExtendedLoadMore/{index-9e0d32b7.js → index-44f97338.js} +19 -9
- package/atoms/ExtendedLoadMore/{index-b5936059.js → index-57dd4870.js} +15 -7
- package/atoms/ExtendedLoadMore/{index-fee73a14.js → index-66dd4dbd.js} +15 -7
- package/atoms/ExtendedLoadMore/{index-5c8eda4a.js → index-8462c597.js} +21 -16
- package/atoms/ExtendedLoadMore/{index-3c4ac692.js → index-93cb06d1.js} +42 -51
- package/atoms/ExtendedLoadMore/{index-4ddfe28d.js → index-afd44863.js} +6 -4
- package/atoms/ExtendedLoadMore/{index-3976fac4.js → index-b5754c5d.js} +20 -14
- package/atoms/ExtendedLoadMore/{index-a5c95f84.js → index-bbaf526e.js} +16 -8
- package/atoms/ExtendedLoadMore/{index-6ecceae4.js → index-cfb262ef.js} +18 -9
- package/atoms/ExtendedLoadMore/index.js +8 -1
- package/atoms/ExtendedLoadMore/styles.arrow.css +1 -1
- package/atoms/Headline/index.js +14 -2103
- package/atoms/Headline/styles.arrow.css +1 -1
- package/atoms/HeroImage/index.js +22 -2170
- package/atoms/HeroImage/styles.arrow.css +1 -1
- package/atoms/LoadmoreButton/index.js +12 -2114
- package/atoms/LoadmoreButton/styles.arrow.css +1 -1
- package/atoms/ScrollSnap/index.js +17 -2178
- package/atoms/ScrollSnap/styles.arrow.css +1 -1
- package/atoms/SectionTag/index.js +10 -2099
- package/atoms/SectionTag/styles.arrow.css +1 -1
- package/atoms/Subheadline/index.js +8 -2097
- package/atoms/Subheadline/styles.arrow.css +1 -1
- package/atoms/TimeStamp/index.js +13 -2463
- package/atoms/TimeStamp/styles.arrow.css +1 -1
- package/molecules/KeyEvents/index.js +23 -2545
- package/molecules/KeyEvents/styles.arrow.css +1 -1
- package/molecules/PageIntroductionCard/index.js +17 -2454
- package/molecules/PageIntroductionCard/styles.arrow.css +1 -1
- package/molecules/SocialShareTemplate/index.js +144 -2740
- package/molecules/SocialShareTemplate/styles.arrow.css +1 -1
- package/molecules/StoryCard/index.js +64 -2582
- package/molecules/StoryCard/styles.arrow.css +1 -1
- package/molecules/StoryElementCard/index.js +123 -2893
- package/molecules/StoryElementCard/styles.arrow.css +1 -1
- package/molecules/StorycardContent/index.js +45 -2495
- package/molecules/StorycardContent/styles.arrow.css +1 -1
- package/package.json +1 -1
- package/rows/AlternateCollectionFilter/index.js +92 -2659
- package/rows/AlternateCollectionFilter/styles.arrow.css +1 -1
- package/rows/AsideCollection/index.js +92 -2659
- package/rows/AsideCollection/styles.arrow.css +1 -1
- package/rows/AstrologyCollection/index.js +89 -2656
- package/rows/AstrologyCollection/styles.arrow.css +1 -1
- package/rows/AuthorIntroductionCard/index.js +27 -2743
- package/rows/AuthorIntroductionCard/styles.arrow.css +1 -1
- package/rows/AuthorsList/index.js +34 -2763
- package/rows/AuthorsList/styles.arrow.css +1 -1
- package/rows/CollectionFilter/index.js +91 -2658
- package/rows/CollectionFilter/styles.arrow.css +1 -1
- package/rows/ElevenStories/index.js +81 -2612
- package/rows/ElevenStories/styles.arrow.css +1 -1
- package/rows/FourColFiveStories/index.js +75 -2603
- package/rows/FourColFiveStories/styles.arrow.css +1 -1
- package/rows/FourColGrid/index.js +92 -2623
- package/rows/FourColGrid/styles.arrow.css +1 -1
- package/rows/FourColPortraitStories/index.js +91 -2622
- package/rows/FourColPortraitStories/styles.arrow.css +1 -1
- package/rows/FourColSixteenStories/index.js +80 -2617
- package/rows/FourColSixteenStories/styles.arrow.css +1 -1
- package/rows/FourColTwelveStories/index.js +72 -2596
- package/rows/FourColTwelveStories/styles.arrow.css +1 -1
- package/rows/FourStorySlider/index.js +84 -2615
- package/rows/FourStorySlider/styles.arrow.css +1 -1
- package/rows/FourStorySliderPortrait/index.js +84 -2615
- package/rows/FourStorySliderPortrait/styles.arrow.css +1 -1
- package/rows/FourTabbedBigStorySlider/index.js +80 -2611
- package/rows/FourTabbedBigStorySlider/styles.arrow.css +1 -1
- package/rows/FullScreenSlider/index.js +85 -2616
- package/rows/FullScreenSlider/styles.arrow.css +1 -1
- package/rows/HalfScreenSlider/index.js +81 -2612
- package/rows/HalfScreenSlider/styles.arrow.css +1 -1
- package/rows/ListComponent/index.js +75 -2606
- package/rows/ListComponent/styles.arrow.css +1 -1
- package/rows/Listicles/index.js +38 -2235
- package/rows/Listicles/styles.arrow.css +1 -1
- package/rows/MagazineEditions/index.js +24 -2487
- package/rows/MagazineEditions/styles.arrow.css +1 -1
- package/rows/MagazineHeaderCard/index.js +26 -2489
- package/rows/MagazineHeaderCard/styles.arrow.css +1 -1
- package/rows/MagazineWidget/index.js +81 -2612
- package/rows/MagazineWidget/styles.arrow.css +1 -1
- package/rows/OneColStoryList/index.js +92 -2623
- package/rows/OneColStoryList/styles.arrow.css +1 -1
- package/rows/OpinionCollection/index.js +61 -2583
- package/rows/OpinionCollection/styles.arrow.css +1 -1
- package/rows/SixColSixStories/index.js +91 -2622
- package/rows/SixColSixStories/styles.arrow.css +1 -1
- package/rows/StoryCollection/index.js +92 -2659
- package/rows/StoryCollection/styles.arrow.css +1 -1
- package/rows/TagIntroductionCard/index.js +9 -1816
- package/rows/TagIntroductionCard/styles.arrow.css +1 -1
- package/rows/ThreeColFlexStories/index.js +91 -2622
- package/rows/ThreeColFlexStories/styles.arrow.css +1 -1
- package/rows/ThreeColFourteenStories/index.js +72 -2596
- package/rows/ThreeColFourteenStories/styles.arrow.css +1 -1
- package/rows/ThreeColGrid/index.js +94 -2625
- package/rows/ThreeColGrid/styles.arrow.css +1 -1
- package/rows/ThreeColSevenStory/index.js +84 -2615
- package/rows/ThreeColSevenStory/styles.arrow.css +1 -1
- package/rows/ThreeColSixStories/index.js +76 -2607
- package/rows/ThreeColSixStories/styles.arrow.css +1 -1
- package/rows/ThreeColTwelveStories/index.js +80 -2617
- package/rows/ThreeColTwelveStories/styles.arrow.css +1 -1
- package/rows/TwoColFourStories/index.js +78 -2609
- package/rows/TwoColFourStories/styles.arrow.css +1 -1
- package/rows/TwoColFourStoryHighlight/index.js +80 -2617
- package/rows/TwoColFourStoryHighlight/styles.arrow.css +1 -1
- package/rows/TwoColSevenStories/index.js +77 -2608
- package/rows/TwoColSevenStories/styles.arrow.css +1 -1
- package/rows/TwoColSixStories/index.js +82 -2619
- package/rows/TwoColSixStories/styles.arrow.css +1 -1
- package/rows/TwoColTenStoriesSidebar/index.js +79 -2610
- package/rows/TwoColTenStoriesSidebar/styles.arrow.css +1 -1
- package/rows/TwoColThreeStories/index.js +75 -2606
- package/rows/TwoColThreeStories/styles.arrow.css +1 -1
- package/story-elements/AlsoRead/index.js +24 -2170
- package/story-elements/AlsoRead/styles.arrow.css +1 -1
- package/story-elements/Attachment/index.js +15 -1870
- package/story-elements/Attachment/styles.arrow.css +1 -1
- package/story-elements/BigFact/index.js +16 -1871
- package/story-elements/BigFact/styles.arrow.css +1 -1
- package/story-elements/BlockQuote/index.js +20 -2157
- package/story-elements/BlockQuote/styles.arrow.css +1 -1
- package/story-elements/Blurb/index.js +18 -1932
- package/story-elements/Blurb/styles.arrow.css +1 -1
- package/story-elements/Image/index.js +42 -2251
- package/story-elements/Image/styles.arrow.css +1 -1
- package/story-elements/ImageGallery/index.js +45 -2254
- package/story-elements/ImageGallery/styles.arrow.css +1 -1
- package/story-elements/ImageSlideshow/index.js +48 -2257
- package/story-elements/ImageSlideshow/styles.arrow.css +1 -1
- package/story-elements/QuestionAnswer/index.js +26 -2163
- package/story-elements/QuestionAnswer/styles.arrow.css +1 -1
- package/story-elements/Quote/index.js +17 -1872
- package/story-elements/Quote/styles.arrow.css +1 -1
- package/story-elements/Reference/index.js +15 -1870
- package/story-elements/Reference/styles.arrow.css +1 -1
- package/story-elements/StoryElement/index.js +12 -1725
- package/story-elements/Summary/index.js +18 -1873
- package/story-elements/Summary/styles.arrow.css +1 -1
- package/story-elements/Text/index.js +16 -2153
- package/story-elements/Text/styles.arrow.css +1 -1
- package/story-elements/Video/index.js +12 -1725
- package/story-elements/Video/styles.arrow.css +1 -1
- package/story-templates/ListicleStoryTemplate/index.js +282 -3167
- package/story-templates/ListicleStoryTemplate/styles.arrow.css +1 -1
- package/story-templates/LiveBlogStoryTemplate/index.js +504 -3389
- package/story-templates/LiveBlogStoryTemplate/styles.arrow.css +1 -1
- package/story-templates/PhotoStoryTemplate/index.js +287 -3172
- package/story-templates/PhotoStoryTemplate/styles.arrow.css +1 -1
- package/story-templates/TextStoryTemplate/index.js +416 -3301
- package/story-templates/TextStoryTemplate/styles.arrow.css +1 -1
- package/story-templates/VideoStoryTemplate/index.js +382 -3267
- package/story-templates/VideoStoryTemplate/styles.arrow.css +1 -1
- package/atoms/ExtendedLoadMore/index-e7cde739.js +0 -3051
|
@@ -3,1377 +3,49 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var React = require('react');
|
|
6
|
+
var lodash = require('lodash');
|
|
7
|
+
var _getClassName = require('babel-plugin-react-css-modules/dist/browser/getClassName');
|
|
6
8
|
var PropTypes = require('prop-types');
|
|
7
9
|
var components = require('@quintype/components');
|
|
10
|
+
require('@babel/runtime/helpers/asyncToGenerator');
|
|
11
|
+
var _typeof = require('@babel/runtime/helpers/typeof');
|
|
12
|
+
require('@babel/runtime/regenerator');
|
|
8
13
|
var Timeago = require('react-timeago');
|
|
9
14
|
var dateFnsTz = require('date-fns-tz');
|
|
10
15
|
var reactRedux = require('react-redux');
|
|
16
|
+
var _slicedToArray = require('@babel/runtime/helpers/slicedToArray');
|
|
17
|
+
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
11
18
|
var ReactDOM = require('react-dom');
|
|
12
19
|
|
|
13
20
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
14
21
|
|
|
15
22
|
function _interopNamespace(e) {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
23
|
+
if (e && e.__esModule) return e;
|
|
24
|
+
var n = Object.create(null);
|
|
25
|
+
if (e) {
|
|
26
|
+
Object.keys(e).forEach(function (k) {
|
|
27
|
+
if (k !== 'default') {
|
|
28
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
29
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
30
|
+
enumerable: true,
|
|
31
|
+
get: function () { return e[k]; }
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
n["default"] = e;
|
|
37
|
+
return Object.freeze(n);
|
|
31
38
|
}
|
|
32
39
|
|
|
33
40
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
41
|
+
var _getClassName__default = /*#__PURE__*/_interopDefaultLegacy(_getClassName);
|
|
34
42
|
var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
|
|
43
|
+
var _typeof__default = /*#__PURE__*/_interopDefaultLegacy(_typeof);
|
|
35
44
|
var Timeago__default = /*#__PURE__*/_interopDefaultLegacy(Timeago);
|
|
45
|
+
var _slicedToArray__default = /*#__PURE__*/_interopDefaultLegacy(_slicedToArray);
|
|
46
|
+
var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_defineProperty);
|
|
36
47
|
var ReactDOM__default = /*#__PURE__*/_interopDefaultLegacy(ReactDOM);
|
|
37
48
|
|
|
38
|
-
/**
|
|
39
|
-
* Checks if `value` is classified as an `Array` object.
|
|
40
|
-
*
|
|
41
|
-
* @static
|
|
42
|
-
* @memberOf _
|
|
43
|
-
* @since 0.1.0
|
|
44
|
-
* @category Lang
|
|
45
|
-
* @param {*} value The value to check.
|
|
46
|
-
* @returns {boolean} Returns `true` if `value` is an array, else `false`.
|
|
47
|
-
* @example
|
|
48
|
-
*
|
|
49
|
-
* _.isArray([1, 2, 3]);
|
|
50
|
-
* // => true
|
|
51
|
-
*
|
|
52
|
-
* _.isArray(document.body.children);
|
|
53
|
-
* // => false
|
|
54
|
-
*
|
|
55
|
-
* _.isArray('abc');
|
|
56
|
-
* // => false
|
|
57
|
-
*
|
|
58
|
-
* _.isArray(_.noop);
|
|
59
|
-
* // => false
|
|
60
|
-
*/
|
|
61
|
-
var isArray = Array.isArray;
|
|
62
|
-
|
|
63
|
-
var isArray_1 = isArray;
|
|
64
|
-
|
|
65
|
-
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
66
|
-
|
|
67
|
-
function getDefaultExportFromCjs (x) {
|
|
68
|
-
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
function createCommonjsModule(fn) {
|
|
72
|
-
var module = { exports: {} };
|
|
73
|
-
return fn(module, module.exports), module.exports;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
/** Detect free variable `global` from Node.js. */
|
|
77
|
-
|
|
78
|
-
var freeGlobal = typeof commonjsGlobal == 'object' && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal;
|
|
79
|
-
|
|
80
|
-
var _freeGlobal = freeGlobal;
|
|
81
|
-
|
|
82
|
-
/** Detect free variable `self`. */
|
|
83
|
-
var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
|
|
84
|
-
|
|
85
|
-
/** Used as a reference to the global object. */
|
|
86
|
-
var root = _freeGlobal || freeSelf || Function('return this')();
|
|
87
|
-
|
|
88
|
-
var _root = root;
|
|
89
|
-
|
|
90
|
-
/** Built-in value references. */
|
|
91
|
-
var Symbol$1 = _root.Symbol;
|
|
92
|
-
|
|
93
|
-
var _Symbol = Symbol$1;
|
|
94
|
-
|
|
95
|
-
/** Used for built-in method references. */
|
|
96
|
-
var objectProto$4 = Object.prototype;
|
|
97
|
-
|
|
98
|
-
/** Used to check objects for own properties. */
|
|
99
|
-
var hasOwnProperty$3 = objectProto$4.hasOwnProperty;
|
|
100
|
-
|
|
101
|
-
/**
|
|
102
|
-
* Used to resolve the
|
|
103
|
-
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
|
|
104
|
-
* of values.
|
|
105
|
-
*/
|
|
106
|
-
var nativeObjectToString$1 = objectProto$4.toString;
|
|
107
|
-
|
|
108
|
-
/** Built-in value references. */
|
|
109
|
-
var symToStringTag$1 = _Symbol ? _Symbol.toStringTag : undefined;
|
|
110
|
-
|
|
111
|
-
/**
|
|
112
|
-
* A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
|
|
113
|
-
*
|
|
114
|
-
* @private
|
|
115
|
-
* @param {*} value The value to query.
|
|
116
|
-
* @returns {string} Returns the raw `toStringTag`.
|
|
117
|
-
*/
|
|
118
|
-
function getRawTag(value) {
|
|
119
|
-
var isOwn = hasOwnProperty$3.call(value, symToStringTag$1),
|
|
120
|
-
tag = value[symToStringTag$1];
|
|
121
|
-
|
|
122
|
-
try {
|
|
123
|
-
value[symToStringTag$1] = undefined;
|
|
124
|
-
var unmasked = true;
|
|
125
|
-
} catch (e) {}
|
|
126
|
-
|
|
127
|
-
var result = nativeObjectToString$1.call(value);
|
|
128
|
-
if (unmasked) {
|
|
129
|
-
if (isOwn) {
|
|
130
|
-
value[symToStringTag$1] = tag;
|
|
131
|
-
} else {
|
|
132
|
-
delete value[symToStringTag$1];
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
return result;
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
var _getRawTag = getRawTag;
|
|
139
|
-
|
|
140
|
-
/** Used for built-in method references. */
|
|
141
|
-
var objectProto$3 = Object.prototype;
|
|
142
|
-
|
|
143
|
-
/**
|
|
144
|
-
* Used to resolve the
|
|
145
|
-
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
|
|
146
|
-
* of values.
|
|
147
|
-
*/
|
|
148
|
-
var nativeObjectToString = objectProto$3.toString;
|
|
149
|
-
|
|
150
|
-
/**
|
|
151
|
-
* Converts `value` to a string using `Object.prototype.toString`.
|
|
152
|
-
*
|
|
153
|
-
* @private
|
|
154
|
-
* @param {*} value The value to convert.
|
|
155
|
-
* @returns {string} Returns the converted string.
|
|
156
|
-
*/
|
|
157
|
-
function objectToString(value) {
|
|
158
|
-
return nativeObjectToString.call(value);
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
var _objectToString = objectToString;
|
|
162
|
-
|
|
163
|
-
/** `Object#toString` result references. */
|
|
164
|
-
var nullTag = '[object Null]',
|
|
165
|
-
undefinedTag = '[object Undefined]';
|
|
166
|
-
|
|
167
|
-
/** Built-in value references. */
|
|
168
|
-
var symToStringTag = _Symbol ? _Symbol.toStringTag : undefined;
|
|
169
|
-
|
|
170
|
-
/**
|
|
171
|
-
* The base implementation of `getTag` without fallbacks for buggy environments.
|
|
172
|
-
*
|
|
173
|
-
* @private
|
|
174
|
-
* @param {*} value The value to query.
|
|
175
|
-
* @returns {string} Returns the `toStringTag`.
|
|
176
|
-
*/
|
|
177
|
-
function baseGetTag(value) {
|
|
178
|
-
if (value == null) {
|
|
179
|
-
return value === undefined ? undefinedTag : nullTag;
|
|
180
|
-
}
|
|
181
|
-
return (symToStringTag && symToStringTag in Object(value))
|
|
182
|
-
? _getRawTag(value)
|
|
183
|
-
: _objectToString(value);
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
var _baseGetTag = baseGetTag;
|
|
187
|
-
|
|
188
|
-
/**
|
|
189
|
-
* Checks if `value` is object-like. A value is object-like if it's not `null`
|
|
190
|
-
* and has a `typeof` result of "object".
|
|
191
|
-
*
|
|
192
|
-
* @static
|
|
193
|
-
* @memberOf _
|
|
194
|
-
* @since 4.0.0
|
|
195
|
-
* @category Lang
|
|
196
|
-
* @param {*} value The value to check.
|
|
197
|
-
* @returns {boolean} Returns `true` if `value` is object-like, else `false`.
|
|
198
|
-
* @example
|
|
199
|
-
*
|
|
200
|
-
* _.isObjectLike({});
|
|
201
|
-
* // => true
|
|
202
|
-
*
|
|
203
|
-
* _.isObjectLike([1, 2, 3]);
|
|
204
|
-
* // => true
|
|
205
|
-
*
|
|
206
|
-
* _.isObjectLike(_.noop);
|
|
207
|
-
* // => false
|
|
208
|
-
*
|
|
209
|
-
* _.isObjectLike(null);
|
|
210
|
-
* // => false
|
|
211
|
-
*/
|
|
212
|
-
function isObjectLike(value) {
|
|
213
|
-
return value != null && typeof value == 'object';
|
|
214
|
-
}
|
|
215
|
-
|
|
216
|
-
var isObjectLike_1 = isObjectLike;
|
|
217
|
-
|
|
218
|
-
/** `Object#toString` result references. */
|
|
219
|
-
var symbolTag = '[object Symbol]';
|
|
220
|
-
|
|
221
|
-
/**
|
|
222
|
-
* Checks if `value` is classified as a `Symbol` primitive or object.
|
|
223
|
-
*
|
|
224
|
-
* @static
|
|
225
|
-
* @memberOf _
|
|
226
|
-
* @since 4.0.0
|
|
227
|
-
* @category Lang
|
|
228
|
-
* @param {*} value The value to check.
|
|
229
|
-
* @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
|
|
230
|
-
* @example
|
|
231
|
-
*
|
|
232
|
-
* _.isSymbol(Symbol.iterator);
|
|
233
|
-
* // => true
|
|
234
|
-
*
|
|
235
|
-
* _.isSymbol('abc');
|
|
236
|
-
* // => false
|
|
237
|
-
*/
|
|
238
|
-
function isSymbol(value) {
|
|
239
|
-
return typeof value == 'symbol' ||
|
|
240
|
-
(isObjectLike_1(value) && _baseGetTag(value) == symbolTag);
|
|
241
|
-
}
|
|
242
|
-
|
|
243
|
-
var isSymbol_1 = isSymbol;
|
|
244
|
-
|
|
245
|
-
/** Used to match property names within property paths. */
|
|
246
|
-
var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
|
|
247
|
-
reIsPlainProp = /^\w*$/;
|
|
248
|
-
|
|
249
|
-
/**
|
|
250
|
-
* Checks if `value` is a property name and not a property path.
|
|
251
|
-
*
|
|
252
|
-
* @private
|
|
253
|
-
* @param {*} value The value to check.
|
|
254
|
-
* @param {Object} [object] The object to query keys on.
|
|
255
|
-
* @returns {boolean} Returns `true` if `value` is a property name, else `false`.
|
|
256
|
-
*/
|
|
257
|
-
function isKey(value, object) {
|
|
258
|
-
if (isArray_1(value)) {
|
|
259
|
-
return false;
|
|
260
|
-
}
|
|
261
|
-
var type = typeof value;
|
|
262
|
-
if (type == 'number' || type == 'symbol' || type == 'boolean' ||
|
|
263
|
-
value == null || isSymbol_1(value)) {
|
|
264
|
-
return true;
|
|
265
|
-
}
|
|
266
|
-
return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||
|
|
267
|
-
(object != null && value in Object(object));
|
|
268
|
-
}
|
|
269
|
-
|
|
270
|
-
var _isKey = isKey;
|
|
271
|
-
|
|
272
|
-
/**
|
|
273
|
-
* Checks if `value` is the
|
|
274
|
-
* [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
|
|
275
|
-
* of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
|
|
276
|
-
*
|
|
277
|
-
* @static
|
|
278
|
-
* @memberOf _
|
|
279
|
-
* @since 0.1.0
|
|
280
|
-
* @category Lang
|
|
281
|
-
* @param {*} value The value to check.
|
|
282
|
-
* @returns {boolean} Returns `true` if `value` is an object, else `false`.
|
|
283
|
-
* @example
|
|
284
|
-
*
|
|
285
|
-
* _.isObject({});
|
|
286
|
-
* // => true
|
|
287
|
-
*
|
|
288
|
-
* _.isObject([1, 2, 3]);
|
|
289
|
-
* // => true
|
|
290
|
-
*
|
|
291
|
-
* _.isObject(_.noop);
|
|
292
|
-
* // => true
|
|
293
|
-
*
|
|
294
|
-
* _.isObject(null);
|
|
295
|
-
* // => false
|
|
296
|
-
*/
|
|
297
|
-
function isObject(value) {
|
|
298
|
-
var type = typeof value;
|
|
299
|
-
return value != null && (type == 'object' || type == 'function');
|
|
300
|
-
}
|
|
301
|
-
|
|
302
|
-
var isObject_1 = isObject;
|
|
303
|
-
|
|
304
|
-
/** `Object#toString` result references. */
|
|
305
|
-
var asyncTag = '[object AsyncFunction]',
|
|
306
|
-
funcTag = '[object Function]',
|
|
307
|
-
genTag = '[object GeneratorFunction]',
|
|
308
|
-
proxyTag = '[object Proxy]';
|
|
309
|
-
|
|
310
|
-
/**
|
|
311
|
-
* Checks if `value` is classified as a `Function` object.
|
|
312
|
-
*
|
|
313
|
-
* @static
|
|
314
|
-
* @memberOf _
|
|
315
|
-
* @since 0.1.0
|
|
316
|
-
* @category Lang
|
|
317
|
-
* @param {*} value The value to check.
|
|
318
|
-
* @returns {boolean} Returns `true` if `value` is a function, else `false`.
|
|
319
|
-
* @example
|
|
320
|
-
*
|
|
321
|
-
* _.isFunction(_);
|
|
322
|
-
* // => true
|
|
323
|
-
*
|
|
324
|
-
* _.isFunction(/abc/);
|
|
325
|
-
* // => false
|
|
326
|
-
*/
|
|
327
|
-
function isFunction(value) {
|
|
328
|
-
if (!isObject_1(value)) {
|
|
329
|
-
return false;
|
|
330
|
-
}
|
|
331
|
-
// The use of `Object#toString` avoids issues with the `typeof` operator
|
|
332
|
-
// in Safari 9 which returns 'object' for typed arrays and other constructors.
|
|
333
|
-
var tag = _baseGetTag(value);
|
|
334
|
-
return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
|
|
335
|
-
}
|
|
336
|
-
|
|
337
|
-
var isFunction_1 = isFunction;
|
|
338
|
-
|
|
339
|
-
/** Used to detect overreaching core-js shims. */
|
|
340
|
-
var coreJsData = _root['__core-js_shared__'];
|
|
341
|
-
|
|
342
|
-
var _coreJsData = coreJsData;
|
|
343
|
-
|
|
344
|
-
/** Used to detect methods masquerading as native. */
|
|
345
|
-
var maskSrcKey = (function() {
|
|
346
|
-
var uid = /[^.]+$/.exec(_coreJsData && _coreJsData.keys && _coreJsData.keys.IE_PROTO || '');
|
|
347
|
-
return uid ? ('Symbol(src)_1.' + uid) : '';
|
|
348
|
-
}());
|
|
349
|
-
|
|
350
|
-
/**
|
|
351
|
-
* Checks if `func` has its source masked.
|
|
352
|
-
*
|
|
353
|
-
* @private
|
|
354
|
-
* @param {Function} func The function to check.
|
|
355
|
-
* @returns {boolean} Returns `true` if `func` is masked, else `false`.
|
|
356
|
-
*/
|
|
357
|
-
function isMasked(func) {
|
|
358
|
-
return !!maskSrcKey && (maskSrcKey in func);
|
|
359
|
-
}
|
|
360
|
-
|
|
361
|
-
var _isMasked = isMasked;
|
|
362
|
-
|
|
363
|
-
/** Used for built-in method references. */
|
|
364
|
-
var funcProto$1 = Function.prototype;
|
|
365
|
-
|
|
366
|
-
/** Used to resolve the decompiled source of functions. */
|
|
367
|
-
var funcToString$1 = funcProto$1.toString;
|
|
368
|
-
|
|
369
|
-
/**
|
|
370
|
-
* Converts `func` to its source code.
|
|
371
|
-
*
|
|
372
|
-
* @private
|
|
373
|
-
* @param {Function} func The function to convert.
|
|
374
|
-
* @returns {string} Returns the source code.
|
|
375
|
-
*/
|
|
376
|
-
function toSource(func) {
|
|
377
|
-
if (func != null) {
|
|
378
|
-
try {
|
|
379
|
-
return funcToString$1.call(func);
|
|
380
|
-
} catch (e) {}
|
|
381
|
-
try {
|
|
382
|
-
return (func + '');
|
|
383
|
-
} catch (e) {}
|
|
384
|
-
}
|
|
385
|
-
return '';
|
|
386
|
-
}
|
|
387
|
-
|
|
388
|
-
var _toSource = toSource;
|
|
389
|
-
|
|
390
|
-
/**
|
|
391
|
-
* Used to match `RegExp`
|
|
392
|
-
* [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
|
|
393
|
-
*/
|
|
394
|
-
var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
|
|
395
|
-
|
|
396
|
-
/** Used to detect host constructors (Safari). */
|
|
397
|
-
var reIsHostCtor = /^\[object .+?Constructor\]$/;
|
|
398
|
-
|
|
399
|
-
/** Used for built-in method references. */
|
|
400
|
-
var funcProto = Function.prototype,
|
|
401
|
-
objectProto$2 = Object.prototype;
|
|
402
|
-
|
|
403
|
-
/** Used to resolve the decompiled source of functions. */
|
|
404
|
-
var funcToString = funcProto.toString;
|
|
405
|
-
|
|
406
|
-
/** Used to check objects for own properties. */
|
|
407
|
-
var hasOwnProperty$2 = objectProto$2.hasOwnProperty;
|
|
408
|
-
|
|
409
|
-
/** Used to detect if a method is native. */
|
|
410
|
-
var reIsNative = RegExp('^' +
|
|
411
|
-
funcToString.call(hasOwnProperty$2).replace(reRegExpChar, '\\$&')
|
|
412
|
-
.replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
|
|
413
|
-
);
|
|
414
|
-
|
|
415
|
-
/**
|
|
416
|
-
* The base implementation of `_.isNative` without bad shim checks.
|
|
417
|
-
*
|
|
418
|
-
* @private
|
|
419
|
-
* @param {*} value The value to check.
|
|
420
|
-
* @returns {boolean} Returns `true` if `value` is a native function,
|
|
421
|
-
* else `false`.
|
|
422
|
-
*/
|
|
423
|
-
function baseIsNative(value) {
|
|
424
|
-
if (!isObject_1(value) || _isMasked(value)) {
|
|
425
|
-
return false;
|
|
426
|
-
}
|
|
427
|
-
var pattern = isFunction_1(value) ? reIsNative : reIsHostCtor;
|
|
428
|
-
return pattern.test(_toSource(value));
|
|
429
|
-
}
|
|
430
|
-
|
|
431
|
-
var _baseIsNative = baseIsNative;
|
|
432
|
-
|
|
433
|
-
/**
|
|
434
|
-
* Gets the value at `key` of `object`.
|
|
435
|
-
*
|
|
436
|
-
* @private
|
|
437
|
-
* @param {Object} [object] The object to query.
|
|
438
|
-
* @param {string} key The key of the property to get.
|
|
439
|
-
* @returns {*} Returns the property value.
|
|
440
|
-
*/
|
|
441
|
-
function getValue(object, key) {
|
|
442
|
-
return object == null ? undefined : object[key];
|
|
443
|
-
}
|
|
444
|
-
|
|
445
|
-
var _getValue = getValue;
|
|
446
|
-
|
|
447
|
-
/**
|
|
448
|
-
* Gets the native function at `key` of `object`.
|
|
449
|
-
*
|
|
450
|
-
* @private
|
|
451
|
-
* @param {Object} object The object to query.
|
|
452
|
-
* @param {string} key The key of the method to get.
|
|
453
|
-
* @returns {*} Returns the function if it's native, else `undefined`.
|
|
454
|
-
*/
|
|
455
|
-
function getNative(object, key) {
|
|
456
|
-
var value = _getValue(object, key);
|
|
457
|
-
return _baseIsNative(value) ? value : undefined;
|
|
458
|
-
}
|
|
459
|
-
|
|
460
|
-
var _getNative = getNative;
|
|
461
|
-
|
|
462
|
-
/* Built-in method references that are verified to be native. */
|
|
463
|
-
var nativeCreate = _getNative(Object, 'create');
|
|
464
|
-
|
|
465
|
-
var _nativeCreate = nativeCreate;
|
|
466
|
-
|
|
467
|
-
/**
|
|
468
|
-
* Removes all key-value entries from the hash.
|
|
469
|
-
*
|
|
470
|
-
* @private
|
|
471
|
-
* @name clear
|
|
472
|
-
* @memberOf Hash
|
|
473
|
-
*/
|
|
474
|
-
function hashClear() {
|
|
475
|
-
this.__data__ = _nativeCreate ? _nativeCreate(null) : {};
|
|
476
|
-
this.size = 0;
|
|
477
|
-
}
|
|
478
|
-
|
|
479
|
-
var _hashClear = hashClear;
|
|
480
|
-
|
|
481
|
-
/**
|
|
482
|
-
* Removes `key` and its value from the hash.
|
|
483
|
-
*
|
|
484
|
-
* @private
|
|
485
|
-
* @name delete
|
|
486
|
-
* @memberOf Hash
|
|
487
|
-
* @param {Object} hash The hash to modify.
|
|
488
|
-
* @param {string} key The key of the value to remove.
|
|
489
|
-
* @returns {boolean} Returns `true` if the entry was removed, else `false`.
|
|
490
|
-
*/
|
|
491
|
-
function hashDelete(key) {
|
|
492
|
-
var result = this.has(key) && delete this.__data__[key];
|
|
493
|
-
this.size -= result ? 1 : 0;
|
|
494
|
-
return result;
|
|
495
|
-
}
|
|
496
|
-
|
|
497
|
-
var _hashDelete = hashDelete;
|
|
498
|
-
|
|
499
|
-
/** Used to stand-in for `undefined` hash values. */
|
|
500
|
-
var HASH_UNDEFINED$1 = '__lodash_hash_undefined__';
|
|
501
|
-
|
|
502
|
-
/** Used for built-in method references. */
|
|
503
|
-
var objectProto$1 = Object.prototype;
|
|
504
|
-
|
|
505
|
-
/** Used to check objects for own properties. */
|
|
506
|
-
var hasOwnProperty$1 = objectProto$1.hasOwnProperty;
|
|
507
|
-
|
|
508
|
-
/**
|
|
509
|
-
* Gets the hash value for `key`.
|
|
510
|
-
*
|
|
511
|
-
* @private
|
|
512
|
-
* @name get
|
|
513
|
-
* @memberOf Hash
|
|
514
|
-
* @param {string} key The key of the value to get.
|
|
515
|
-
* @returns {*} Returns the entry value.
|
|
516
|
-
*/
|
|
517
|
-
function hashGet(key) {
|
|
518
|
-
var data = this.__data__;
|
|
519
|
-
if (_nativeCreate) {
|
|
520
|
-
var result = data[key];
|
|
521
|
-
return result === HASH_UNDEFINED$1 ? undefined : result;
|
|
522
|
-
}
|
|
523
|
-
return hasOwnProperty$1.call(data, key) ? data[key] : undefined;
|
|
524
|
-
}
|
|
525
|
-
|
|
526
|
-
var _hashGet = hashGet;
|
|
527
|
-
|
|
528
|
-
/** Used for built-in method references. */
|
|
529
|
-
var objectProto = Object.prototype;
|
|
530
|
-
|
|
531
|
-
/** Used to check objects for own properties. */
|
|
532
|
-
var hasOwnProperty = objectProto.hasOwnProperty;
|
|
533
|
-
|
|
534
|
-
/**
|
|
535
|
-
* Checks if a hash value for `key` exists.
|
|
536
|
-
*
|
|
537
|
-
* @private
|
|
538
|
-
* @name has
|
|
539
|
-
* @memberOf Hash
|
|
540
|
-
* @param {string} key The key of the entry to check.
|
|
541
|
-
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
|
|
542
|
-
*/
|
|
543
|
-
function hashHas(key) {
|
|
544
|
-
var data = this.__data__;
|
|
545
|
-
return _nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);
|
|
546
|
-
}
|
|
547
|
-
|
|
548
|
-
var _hashHas = hashHas;
|
|
549
|
-
|
|
550
|
-
/** Used to stand-in for `undefined` hash values. */
|
|
551
|
-
var HASH_UNDEFINED = '__lodash_hash_undefined__';
|
|
552
|
-
|
|
553
|
-
/**
|
|
554
|
-
* Sets the hash `key` to `value`.
|
|
555
|
-
*
|
|
556
|
-
* @private
|
|
557
|
-
* @name set
|
|
558
|
-
* @memberOf Hash
|
|
559
|
-
* @param {string} key The key of the value to set.
|
|
560
|
-
* @param {*} value The value to set.
|
|
561
|
-
* @returns {Object} Returns the hash instance.
|
|
562
|
-
*/
|
|
563
|
-
function hashSet(key, value) {
|
|
564
|
-
var data = this.__data__;
|
|
565
|
-
this.size += this.has(key) ? 0 : 1;
|
|
566
|
-
data[key] = (_nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
|
|
567
|
-
return this;
|
|
568
|
-
}
|
|
569
|
-
|
|
570
|
-
var _hashSet = hashSet;
|
|
571
|
-
|
|
572
|
-
/**
|
|
573
|
-
* Creates a hash object.
|
|
574
|
-
*
|
|
575
|
-
* @private
|
|
576
|
-
* @constructor
|
|
577
|
-
* @param {Array} [entries] The key-value pairs to cache.
|
|
578
|
-
*/
|
|
579
|
-
function Hash(entries) {
|
|
580
|
-
var index = -1,
|
|
581
|
-
length = entries == null ? 0 : entries.length;
|
|
582
|
-
|
|
583
|
-
this.clear();
|
|
584
|
-
while (++index < length) {
|
|
585
|
-
var entry = entries[index];
|
|
586
|
-
this.set(entry[0], entry[1]);
|
|
587
|
-
}
|
|
588
|
-
}
|
|
589
|
-
|
|
590
|
-
// Add methods to `Hash`.
|
|
591
|
-
Hash.prototype.clear = _hashClear;
|
|
592
|
-
Hash.prototype['delete'] = _hashDelete;
|
|
593
|
-
Hash.prototype.get = _hashGet;
|
|
594
|
-
Hash.prototype.has = _hashHas;
|
|
595
|
-
Hash.prototype.set = _hashSet;
|
|
596
|
-
|
|
597
|
-
var _Hash = Hash;
|
|
598
|
-
|
|
599
|
-
/**
|
|
600
|
-
* Removes all key-value entries from the list cache.
|
|
601
|
-
*
|
|
602
|
-
* @private
|
|
603
|
-
* @name clear
|
|
604
|
-
* @memberOf ListCache
|
|
605
|
-
*/
|
|
606
|
-
function listCacheClear() {
|
|
607
|
-
this.__data__ = [];
|
|
608
|
-
this.size = 0;
|
|
609
|
-
}
|
|
610
|
-
|
|
611
|
-
var _listCacheClear = listCacheClear;
|
|
612
|
-
|
|
613
|
-
/**
|
|
614
|
-
* Performs a
|
|
615
|
-
* [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
|
|
616
|
-
* comparison between two values to determine if they are equivalent.
|
|
617
|
-
*
|
|
618
|
-
* @static
|
|
619
|
-
* @memberOf _
|
|
620
|
-
* @since 4.0.0
|
|
621
|
-
* @category Lang
|
|
622
|
-
* @param {*} value The value to compare.
|
|
623
|
-
* @param {*} other The other value to compare.
|
|
624
|
-
* @returns {boolean} Returns `true` if the values are equivalent, else `false`.
|
|
625
|
-
* @example
|
|
626
|
-
*
|
|
627
|
-
* var object = { 'a': 1 };
|
|
628
|
-
* var other = { 'a': 1 };
|
|
629
|
-
*
|
|
630
|
-
* _.eq(object, object);
|
|
631
|
-
* // => true
|
|
632
|
-
*
|
|
633
|
-
* _.eq(object, other);
|
|
634
|
-
* // => false
|
|
635
|
-
*
|
|
636
|
-
* _.eq('a', 'a');
|
|
637
|
-
* // => true
|
|
638
|
-
*
|
|
639
|
-
* _.eq('a', Object('a'));
|
|
640
|
-
* // => false
|
|
641
|
-
*
|
|
642
|
-
* _.eq(NaN, NaN);
|
|
643
|
-
* // => true
|
|
644
|
-
*/
|
|
645
|
-
function eq(value, other) {
|
|
646
|
-
return value === other || (value !== value && other !== other);
|
|
647
|
-
}
|
|
648
|
-
|
|
649
|
-
var eq_1 = eq;
|
|
650
|
-
|
|
651
|
-
/**
|
|
652
|
-
* Gets the index at which the `key` is found in `array` of key-value pairs.
|
|
653
|
-
*
|
|
654
|
-
* @private
|
|
655
|
-
* @param {Array} array The array to inspect.
|
|
656
|
-
* @param {*} key The key to search for.
|
|
657
|
-
* @returns {number} Returns the index of the matched value, else `-1`.
|
|
658
|
-
*/
|
|
659
|
-
function assocIndexOf(array, key) {
|
|
660
|
-
var length = array.length;
|
|
661
|
-
while (length--) {
|
|
662
|
-
if (eq_1(array[length][0], key)) {
|
|
663
|
-
return length;
|
|
664
|
-
}
|
|
665
|
-
}
|
|
666
|
-
return -1;
|
|
667
|
-
}
|
|
668
|
-
|
|
669
|
-
var _assocIndexOf = assocIndexOf;
|
|
670
|
-
|
|
671
|
-
/** Used for built-in method references. */
|
|
672
|
-
var arrayProto = Array.prototype;
|
|
673
|
-
|
|
674
|
-
/** Built-in value references. */
|
|
675
|
-
var splice = arrayProto.splice;
|
|
676
|
-
|
|
677
|
-
/**
|
|
678
|
-
* Removes `key` and its value from the list cache.
|
|
679
|
-
*
|
|
680
|
-
* @private
|
|
681
|
-
* @name delete
|
|
682
|
-
* @memberOf ListCache
|
|
683
|
-
* @param {string} key The key of the value to remove.
|
|
684
|
-
* @returns {boolean} Returns `true` if the entry was removed, else `false`.
|
|
685
|
-
*/
|
|
686
|
-
function listCacheDelete(key) {
|
|
687
|
-
var data = this.__data__,
|
|
688
|
-
index = _assocIndexOf(data, key);
|
|
689
|
-
|
|
690
|
-
if (index < 0) {
|
|
691
|
-
return false;
|
|
692
|
-
}
|
|
693
|
-
var lastIndex = data.length - 1;
|
|
694
|
-
if (index == lastIndex) {
|
|
695
|
-
data.pop();
|
|
696
|
-
} else {
|
|
697
|
-
splice.call(data, index, 1);
|
|
698
|
-
}
|
|
699
|
-
--this.size;
|
|
700
|
-
return true;
|
|
701
|
-
}
|
|
702
|
-
|
|
703
|
-
var _listCacheDelete = listCacheDelete;
|
|
704
|
-
|
|
705
|
-
/**
|
|
706
|
-
* Gets the list cache value for `key`.
|
|
707
|
-
*
|
|
708
|
-
* @private
|
|
709
|
-
* @name get
|
|
710
|
-
* @memberOf ListCache
|
|
711
|
-
* @param {string} key The key of the value to get.
|
|
712
|
-
* @returns {*} Returns the entry value.
|
|
713
|
-
*/
|
|
714
|
-
function listCacheGet(key) {
|
|
715
|
-
var data = this.__data__,
|
|
716
|
-
index = _assocIndexOf(data, key);
|
|
717
|
-
|
|
718
|
-
return index < 0 ? undefined : data[index][1];
|
|
719
|
-
}
|
|
720
|
-
|
|
721
|
-
var _listCacheGet = listCacheGet;
|
|
722
|
-
|
|
723
|
-
/**
|
|
724
|
-
* Checks if a list cache value for `key` exists.
|
|
725
|
-
*
|
|
726
|
-
* @private
|
|
727
|
-
* @name has
|
|
728
|
-
* @memberOf ListCache
|
|
729
|
-
* @param {string} key The key of the entry to check.
|
|
730
|
-
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
|
|
731
|
-
*/
|
|
732
|
-
function listCacheHas(key) {
|
|
733
|
-
return _assocIndexOf(this.__data__, key) > -1;
|
|
734
|
-
}
|
|
735
|
-
|
|
736
|
-
var _listCacheHas = listCacheHas;
|
|
737
|
-
|
|
738
|
-
/**
|
|
739
|
-
* Sets the list cache `key` to `value`.
|
|
740
|
-
*
|
|
741
|
-
* @private
|
|
742
|
-
* @name set
|
|
743
|
-
* @memberOf ListCache
|
|
744
|
-
* @param {string} key The key of the value to set.
|
|
745
|
-
* @param {*} value The value to set.
|
|
746
|
-
* @returns {Object} Returns the list cache instance.
|
|
747
|
-
*/
|
|
748
|
-
function listCacheSet(key, value) {
|
|
749
|
-
var data = this.__data__,
|
|
750
|
-
index = _assocIndexOf(data, key);
|
|
751
|
-
|
|
752
|
-
if (index < 0) {
|
|
753
|
-
++this.size;
|
|
754
|
-
data.push([key, value]);
|
|
755
|
-
} else {
|
|
756
|
-
data[index][1] = value;
|
|
757
|
-
}
|
|
758
|
-
return this;
|
|
759
|
-
}
|
|
760
|
-
|
|
761
|
-
var _listCacheSet = listCacheSet;
|
|
762
|
-
|
|
763
|
-
/**
|
|
764
|
-
* Creates an list cache object.
|
|
765
|
-
*
|
|
766
|
-
* @private
|
|
767
|
-
* @constructor
|
|
768
|
-
* @param {Array} [entries] The key-value pairs to cache.
|
|
769
|
-
*/
|
|
770
|
-
function ListCache(entries) {
|
|
771
|
-
var index = -1,
|
|
772
|
-
length = entries == null ? 0 : entries.length;
|
|
773
|
-
|
|
774
|
-
this.clear();
|
|
775
|
-
while (++index < length) {
|
|
776
|
-
var entry = entries[index];
|
|
777
|
-
this.set(entry[0], entry[1]);
|
|
778
|
-
}
|
|
779
|
-
}
|
|
780
|
-
|
|
781
|
-
// Add methods to `ListCache`.
|
|
782
|
-
ListCache.prototype.clear = _listCacheClear;
|
|
783
|
-
ListCache.prototype['delete'] = _listCacheDelete;
|
|
784
|
-
ListCache.prototype.get = _listCacheGet;
|
|
785
|
-
ListCache.prototype.has = _listCacheHas;
|
|
786
|
-
ListCache.prototype.set = _listCacheSet;
|
|
787
|
-
|
|
788
|
-
var _ListCache = ListCache;
|
|
789
|
-
|
|
790
|
-
/* Built-in method references that are verified to be native. */
|
|
791
|
-
var Map = _getNative(_root, 'Map');
|
|
792
|
-
|
|
793
|
-
var _Map = Map;
|
|
794
|
-
|
|
795
|
-
/**
|
|
796
|
-
* Removes all key-value entries from the map.
|
|
797
|
-
*
|
|
798
|
-
* @private
|
|
799
|
-
* @name clear
|
|
800
|
-
* @memberOf MapCache
|
|
801
|
-
*/
|
|
802
|
-
function mapCacheClear() {
|
|
803
|
-
this.size = 0;
|
|
804
|
-
this.__data__ = {
|
|
805
|
-
'hash': new _Hash,
|
|
806
|
-
'map': new (_Map || _ListCache),
|
|
807
|
-
'string': new _Hash
|
|
808
|
-
};
|
|
809
|
-
}
|
|
810
|
-
|
|
811
|
-
var _mapCacheClear = mapCacheClear;
|
|
812
|
-
|
|
813
|
-
/**
|
|
814
|
-
* Checks if `value` is suitable for use as unique object key.
|
|
815
|
-
*
|
|
816
|
-
* @private
|
|
817
|
-
* @param {*} value The value to check.
|
|
818
|
-
* @returns {boolean} Returns `true` if `value` is suitable, else `false`.
|
|
819
|
-
*/
|
|
820
|
-
function isKeyable(value) {
|
|
821
|
-
var type = typeof value;
|
|
822
|
-
return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
|
|
823
|
-
? (value !== '__proto__')
|
|
824
|
-
: (value === null);
|
|
825
|
-
}
|
|
826
|
-
|
|
827
|
-
var _isKeyable = isKeyable;
|
|
828
|
-
|
|
829
|
-
/**
|
|
830
|
-
* Gets the data for `map`.
|
|
831
|
-
*
|
|
832
|
-
* @private
|
|
833
|
-
* @param {Object} map The map to query.
|
|
834
|
-
* @param {string} key The reference key.
|
|
835
|
-
* @returns {*} Returns the map data.
|
|
836
|
-
*/
|
|
837
|
-
function getMapData(map, key) {
|
|
838
|
-
var data = map.__data__;
|
|
839
|
-
return _isKeyable(key)
|
|
840
|
-
? data[typeof key == 'string' ? 'string' : 'hash']
|
|
841
|
-
: data.map;
|
|
842
|
-
}
|
|
843
|
-
|
|
844
|
-
var _getMapData = getMapData;
|
|
845
|
-
|
|
846
|
-
/**
|
|
847
|
-
* Removes `key` and its value from the map.
|
|
848
|
-
*
|
|
849
|
-
* @private
|
|
850
|
-
* @name delete
|
|
851
|
-
* @memberOf MapCache
|
|
852
|
-
* @param {string} key The key of the value to remove.
|
|
853
|
-
* @returns {boolean} Returns `true` if the entry was removed, else `false`.
|
|
854
|
-
*/
|
|
855
|
-
function mapCacheDelete(key) {
|
|
856
|
-
var result = _getMapData(this, key)['delete'](key);
|
|
857
|
-
this.size -= result ? 1 : 0;
|
|
858
|
-
return result;
|
|
859
|
-
}
|
|
860
|
-
|
|
861
|
-
var _mapCacheDelete = mapCacheDelete;
|
|
862
|
-
|
|
863
|
-
/**
|
|
864
|
-
* Gets the map value for `key`.
|
|
865
|
-
*
|
|
866
|
-
* @private
|
|
867
|
-
* @name get
|
|
868
|
-
* @memberOf MapCache
|
|
869
|
-
* @param {string} key The key of the value to get.
|
|
870
|
-
* @returns {*} Returns the entry value.
|
|
871
|
-
*/
|
|
872
|
-
function mapCacheGet(key) {
|
|
873
|
-
return _getMapData(this, key).get(key);
|
|
874
|
-
}
|
|
875
|
-
|
|
876
|
-
var _mapCacheGet = mapCacheGet;
|
|
877
|
-
|
|
878
|
-
/**
|
|
879
|
-
* Checks if a map value for `key` exists.
|
|
880
|
-
*
|
|
881
|
-
* @private
|
|
882
|
-
* @name has
|
|
883
|
-
* @memberOf MapCache
|
|
884
|
-
* @param {string} key The key of the entry to check.
|
|
885
|
-
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
|
|
886
|
-
*/
|
|
887
|
-
function mapCacheHas(key) {
|
|
888
|
-
return _getMapData(this, key).has(key);
|
|
889
|
-
}
|
|
890
|
-
|
|
891
|
-
var _mapCacheHas = mapCacheHas;
|
|
892
|
-
|
|
893
|
-
/**
|
|
894
|
-
* Sets the map `key` to `value`.
|
|
895
|
-
*
|
|
896
|
-
* @private
|
|
897
|
-
* @name set
|
|
898
|
-
* @memberOf MapCache
|
|
899
|
-
* @param {string} key The key of the value to set.
|
|
900
|
-
* @param {*} value The value to set.
|
|
901
|
-
* @returns {Object} Returns the map cache instance.
|
|
902
|
-
*/
|
|
903
|
-
function mapCacheSet(key, value) {
|
|
904
|
-
var data = _getMapData(this, key),
|
|
905
|
-
size = data.size;
|
|
906
|
-
|
|
907
|
-
data.set(key, value);
|
|
908
|
-
this.size += data.size == size ? 0 : 1;
|
|
909
|
-
return this;
|
|
910
|
-
}
|
|
911
|
-
|
|
912
|
-
var _mapCacheSet = mapCacheSet;
|
|
913
|
-
|
|
914
|
-
/**
|
|
915
|
-
* Creates a map cache object to store key-value pairs.
|
|
916
|
-
*
|
|
917
|
-
* @private
|
|
918
|
-
* @constructor
|
|
919
|
-
* @param {Array} [entries] The key-value pairs to cache.
|
|
920
|
-
*/
|
|
921
|
-
function MapCache(entries) {
|
|
922
|
-
var index = -1,
|
|
923
|
-
length = entries == null ? 0 : entries.length;
|
|
924
|
-
|
|
925
|
-
this.clear();
|
|
926
|
-
while (++index < length) {
|
|
927
|
-
var entry = entries[index];
|
|
928
|
-
this.set(entry[0], entry[1]);
|
|
929
|
-
}
|
|
930
|
-
}
|
|
931
|
-
|
|
932
|
-
// Add methods to `MapCache`.
|
|
933
|
-
MapCache.prototype.clear = _mapCacheClear;
|
|
934
|
-
MapCache.prototype['delete'] = _mapCacheDelete;
|
|
935
|
-
MapCache.prototype.get = _mapCacheGet;
|
|
936
|
-
MapCache.prototype.has = _mapCacheHas;
|
|
937
|
-
MapCache.prototype.set = _mapCacheSet;
|
|
938
|
-
|
|
939
|
-
var _MapCache = MapCache;
|
|
940
|
-
|
|
941
|
-
/** Error message constants. */
|
|
942
|
-
var FUNC_ERROR_TEXT = 'Expected a function';
|
|
943
|
-
|
|
944
|
-
/**
|
|
945
|
-
* Creates a function that memoizes the result of `func`. If `resolver` is
|
|
946
|
-
* provided, it determines the cache key for storing the result based on the
|
|
947
|
-
* arguments provided to the memoized function. By default, the first argument
|
|
948
|
-
* provided to the memoized function is used as the map cache key. The `func`
|
|
949
|
-
* is invoked with the `this` binding of the memoized function.
|
|
950
|
-
*
|
|
951
|
-
* **Note:** The cache is exposed as the `cache` property on the memoized
|
|
952
|
-
* function. Its creation may be customized by replacing the `_.memoize.Cache`
|
|
953
|
-
* constructor with one whose instances implement the
|
|
954
|
-
* [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
|
|
955
|
-
* method interface of `clear`, `delete`, `get`, `has`, and `set`.
|
|
956
|
-
*
|
|
957
|
-
* @static
|
|
958
|
-
* @memberOf _
|
|
959
|
-
* @since 0.1.0
|
|
960
|
-
* @category Function
|
|
961
|
-
* @param {Function} func The function to have its output memoized.
|
|
962
|
-
* @param {Function} [resolver] The function to resolve the cache key.
|
|
963
|
-
* @returns {Function} Returns the new memoized function.
|
|
964
|
-
* @example
|
|
965
|
-
*
|
|
966
|
-
* var object = { 'a': 1, 'b': 2 };
|
|
967
|
-
* var other = { 'c': 3, 'd': 4 };
|
|
968
|
-
*
|
|
969
|
-
* var values = _.memoize(_.values);
|
|
970
|
-
* values(object);
|
|
971
|
-
* // => [1, 2]
|
|
972
|
-
*
|
|
973
|
-
* values(other);
|
|
974
|
-
* // => [3, 4]
|
|
975
|
-
*
|
|
976
|
-
* object.a = 2;
|
|
977
|
-
* values(object);
|
|
978
|
-
* // => [1, 2]
|
|
979
|
-
*
|
|
980
|
-
* // Modify the result cache.
|
|
981
|
-
* values.cache.set(object, ['a', 'b']);
|
|
982
|
-
* values(object);
|
|
983
|
-
* // => ['a', 'b']
|
|
984
|
-
*
|
|
985
|
-
* // Replace `_.memoize.Cache`.
|
|
986
|
-
* _.memoize.Cache = WeakMap;
|
|
987
|
-
*/
|
|
988
|
-
function memoize(func, resolver) {
|
|
989
|
-
if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) {
|
|
990
|
-
throw new TypeError(FUNC_ERROR_TEXT);
|
|
991
|
-
}
|
|
992
|
-
var memoized = function() {
|
|
993
|
-
var args = arguments,
|
|
994
|
-
key = resolver ? resolver.apply(this, args) : args[0],
|
|
995
|
-
cache = memoized.cache;
|
|
996
|
-
|
|
997
|
-
if (cache.has(key)) {
|
|
998
|
-
return cache.get(key);
|
|
999
|
-
}
|
|
1000
|
-
var result = func.apply(this, args);
|
|
1001
|
-
memoized.cache = cache.set(key, result) || cache;
|
|
1002
|
-
return result;
|
|
1003
|
-
};
|
|
1004
|
-
memoized.cache = new (memoize.Cache || _MapCache);
|
|
1005
|
-
return memoized;
|
|
1006
|
-
}
|
|
1007
|
-
|
|
1008
|
-
// Expose `MapCache`.
|
|
1009
|
-
memoize.Cache = _MapCache;
|
|
1010
|
-
|
|
1011
|
-
var memoize_1 = memoize;
|
|
1012
|
-
|
|
1013
|
-
/** Used as the maximum memoize cache size. */
|
|
1014
|
-
var MAX_MEMOIZE_SIZE = 500;
|
|
1015
|
-
|
|
1016
|
-
/**
|
|
1017
|
-
* A specialized version of `_.memoize` which clears the memoized function's
|
|
1018
|
-
* cache when it exceeds `MAX_MEMOIZE_SIZE`.
|
|
1019
|
-
*
|
|
1020
|
-
* @private
|
|
1021
|
-
* @param {Function} func The function to have its output memoized.
|
|
1022
|
-
* @returns {Function} Returns the new memoized function.
|
|
1023
|
-
*/
|
|
1024
|
-
function memoizeCapped(func) {
|
|
1025
|
-
var result = memoize_1(func, function(key) {
|
|
1026
|
-
if (cache.size === MAX_MEMOIZE_SIZE) {
|
|
1027
|
-
cache.clear();
|
|
1028
|
-
}
|
|
1029
|
-
return key;
|
|
1030
|
-
});
|
|
1031
|
-
|
|
1032
|
-
var cache = result.cache;
|
|
1033
|
-
return result;
|
|
1034
|
-
}
|
|
1035
|
-
|
|
1036
|
-
var _memoizeCapped = memoizeCapped;
|
|
1037
|
-
|
|
1038
|
-
/** Used to match property names within property paths. */
|
|
1039
|
-
var rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
|
|
1040
|
-
|
|
1041
|
-
/** Used to match backslashes in property paths. */
|
|
1042
|
-
var reEscapeChar = /\\(\\)?/g;
|
|
1043
|
-
|
|
1044
|
-
/**
|
|
1045
|
-
* Converts `string` to a property path array.
|
|
1046
|
-
*
|
|
1047
|
-
* @private
|
|
1048
|
-
* @param {string} string The string to convert.
|
|
1049
|
-
* @returns {Array} Returns the property path array.
|
|
1050
|
-
*/
|
|
1051
|
-
var stringToPath = _memoizeCapped(function(string) {
|
|
1052
|
-
var result = [];
|
|
1053
|
-
if (string.charCodeAt(0) === 46 /* . */) {
|
|
1054
|
-
result.push('');
|
|
1055
|
-
}
|
|
1056
|
-
string.replace(rePropName, function(match, number, quote, subString) {
|
|
1057
|
-
result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match));
|
|
1058
|
-
});
|
|
1059
|
-
return result;
|
|
1060
|
-
});
|
|
1061
|
-
|
|
1062
|
-
var _stringToPath = stringToPath;
|
|
1063
|
-
|
|
1064
|
-
/**
|
|
1065
|
-
* A specialized version of `_.map` for arrays without support for iteratee
|
|
1066
|
-
* shorthands.
|
|
1067
|
-
*
|
|
1068
|
-
* @private
|
|
1069
|
-
* @param {Array} [array] The array to iterate over.
|
|
1070
|
-
* @param {Function} iteratee The function invoked per iteration.
|
|
1071
|
-
* @returns {Array} Returns the new mapped array.
|
|
1072
|
-
*/
|
|
1073
|
-
function arrayMap(array, iteratee) {
|
|
1074
|
-
var index = -1,
|
|
1075
|
-
length = array == null ? 0 : array.length,
|
|
1076
|
-
result = Array(length);
|
|
1077
|
-
|
|
1078
|
-
while (++index < length) {
|
|
1079
|
-
result[index] = iteratee(array[index], index, array);
|
|
1080
|
-
}
|
|
1081
|
-
return result;
|
|
1082
|
-
}
|
|
1083
|
-
|
|
1084
|
-
var _arrayMap = arrayMap;
|
|
1085
|
-
|
|
1086
|
-
/** Used as references for various `Number` constants. */
|
|
1087
|
-
var INFINITY$1 = 1 / 0;
|
|
1088
|
-
|
|
1089
|
-
/** Used to convert symbols to primitives and strings. */
|
|
1090
|
-
var symbolProto = _Symbol ? _Symbol.prototype : undefined,
|
|
1091
|
-
symbolToString = symbolProto ? symbolProto.toString : undefined;
|
|
1092
|
-
|
|
1093
|
-
/**
|
|
1094
|
-
* The base implementation of `_.toString` which doesn't convert nullish
|
|
1095
|
-
* values to empty strings.
|
|
1096
|
-
*
|
|
1097
|
-
* @private
|
|
1098
|
-
* @param {*} value The value to process.
|
|
1099
|
-
* @returns {string} Returns the string.
|
|
1100
|
-
*/
|
|
1101
|
-
function baseToString(value) {
|
|
1102
|
-
// Exit early for strings to avoid a performance hit in some environments.
|
|
1103
|
-
if (typeof value == 'string') {
|
|
1104
|
-
return value;
|
|
1105
|
-
}
|
|
1106
|
-
if (isArray_1(value)) {
|
|
1107
|
-
// Recursively convert values (susceptible to call stack limits).
|
|
1108
|
-
return _arrayMap(value, baseToString) + '';
|
|
1109
|
-
}
|
|
1110
|
-
if (isSymbol_1(value)) {
|
|
1111
|
-
return symbolToString ? symbolToString.call(value) : '';
|
|
1112
|
-
}
|
|
1113
|
-
var result = (value + '');
|
|
1114
|
-
return (result == '0' && (1 / value) == -INFINITY$1) ? '-0' : result;
|
|
1115
|
-
}
|
|
1116
|
-
|
|
1117
|
-
var _baseToString = baseToString;
|
|
1118
|
-
|
|
1119
|
-
/**
|
|
1120
|
-
* Converts `value` to a string. An empty string is returned for `null`
|
|
1121
|
-
* and `undefined` values. The sign of `-0` is preserved.
|
|
1122
|
-
*
|
|
1123
|
-
* @static
|
|
1124
|
-
* @memberOf _
|
|
1125
|
-
* @since 4.0.0
|
|
1126
|
-
* @category Lang
|
|
1127
|
-
* @param {*} value The value to convert.
|
|
1128
|
-
* @returns {string} Returns the converted string.
|
|
1129
|
-
* @example
|
|
1130
|
-
*
|
|
1131
|
-
* _.toString(null);
|
|
1132
|
-
* // => ''
|
|
1133
|
-
*
|
|
1134
|
-
* _.toString(-0);
|
|
1135
|
-
* // => '-0'
|
|
1136
|
-
*
|
|
1137
|
-
* _.toString([1, 2, 3]);
|
|
1138
|
-
* // => '1,2,3'
|
|
1139
|
-
*/
|
|
1140
|
-
function toString(value) {
|
|
1141
|
-
return value == null ? '' : _baseToString(value);
|
|
1142
|
-
}
|
|
1143
|
-
|
|
1144
|
-
var toString_1 = toString;
|
|
1145
|
-
|
|
1146
|
-
/**
|
|
1147
|
-
* Casts `value` to a path array if it's not one.
|
|
1148
|
-
*
|
|
1149
|
-
* @private
|
|
1150
|
-
* @param {*} value The value to inspect.
|
|
1151
|
-
* @param {Object} [object] The object to query keys on.
|
|
1152
|
-
* @returns {Array} Returns the cast property path array.
|
|
1153
|
-
*/
|
|
1154
|
-
function castPath(value, object) {
|
|
1155
|
-
if (isArray_1(value)) {
|
|
1156
|
-
return value;
|
|
1157
|
-
}
|
|
1158
|
-
return _isKey(value, object) ? [value] : _stringToPath(toString_1(value));
|
|
1159
|
-
}
|
|
1160
|
-
|
|
1161
|
-
var _castPath = castPath;
|
|
1162
|
-
|
|
1163
|
-
/** Used as references for various `Number` constants. */
|
|
1164
|
-
var INFINITY = 1 / 0;
|
|
1165
|
-
|
|
1166
|
-
/**
|
|
1167
|
-
* Converts `value` to a string key if it's not a string or symbol.
|
|
1168
|
-
*
|
|
1169
|
-
* @private
|
|
1170
|
-
* @param {*} value The value to inspect.
|
|
1171
|
-
* @returns {string|symbol} Returns the key.
|
|
1172
|
-
*/
|
|
1173
|
-
function toKey(value) {
|
|
1174
|
-
if (typeof value == 'string' || isSymbol_1(value)) {
|
|
1175
|
-
return value;
|
|
1176
|
-
}
|
|
1177
|
-
var result = (value + '');
|
|
1178
|
-
return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
|
|
1179
|
-
}
|
|
1180
|
-
|
|
1181
|
-
var _toKey = toKey;
|
|
1182
|
-
|
|
1183
|
-
/**
|
|
1184
|
-
* The base implementation of `_.get` without support for default values.
|
|
1185
|
-
*
|
|
1186
|
-
* @private
|
|
1187
|
-
* @param {Object} object The object to query.
|
|
1188
|
-
* @param {Array|string} path The path of the property to get.
|
|
1189
|
-
* @returns {*} Returns the resolved value.
|
|
1190
|
-
*/
|
|
1191
|
-
function baseGet(object, path) {
|
|
1192
|
-
path = _castPath(path, object);
|
|
1193
|
-
|
|
1194
|
-
var index = 0,
|
|
1195
|
-
length = path.length;
|
|
1196
|
-
|
|
1197
|
-
while (object != null && index < length) {
|
|
1198
|
-
object = object[_toKey(path[index++])];
|
|
1199
|
-
}
|
|
1200
|
-
return (index && index == length) ? object : undefined;
|
|
1201
|
-
}
|
|
1202
|
-
|
|
1203
|
-
var _baseGet = baseGet;
|
|
1204
|
-
|
|
1205
|
-
/**
|
|
1206
|
-
* Gets the value at `path` of `object`. If the resolved value is
|
|
1207
|
-
* `undefined`, the `defaultValue` is returned in its place.
|
|
1208
|
-
*
|
|
1209
|
-
* @static
|
|
1210
|
-
* @memberOf _
|
|
1211
|
-
* @since 3.7.0
|
|
1212
|
-
* @category Object
|
|
1213
|
-
* @param {Object} object The object to query.
|
|
1214
|
-
* @param {Array|string} path The path of the property to get.
|
|
1215
|
-
* @param {*} [defaultValue] The value returned for `undefined` resolved values.
|
|
1216
|
-
* @returns {*} Returns the resolved value.
|
|
1217
|
-
* @example
|
|
1218
|
-
*
|
|
1219
|
-
* var object = { 'a': [{ 'b': { 'c': 3 } }] };
|
|
1220
|
-
*
|
|
1221
|
-
* _.get(object, 'a[0].b.c');
|
|
1222
|
-
* // => 3
|
|
1223
|
-
*
|
|
1224
|
-
* _.get(object, ['a', '0', 'b', 'c']);
|
|
1225
|
-
* // => 3
|
|
1226
|
-
*
|
|
1227
|
-
* _.get(object, 'a.b.c', 'default');
|
|
1228
|
-
* // => 'default'
|
|
1229
|
-
*/
|
|
1230
|
-
function get(object, path, defaultValue) {
|
|
1231
|
-
var result = object == null ? undefined : _baseGet(object, path);
|
|
1232
|
-
return result === undefined ? defaultValue : result;
|
|
1233
|
-
}
|
|
1234
|
-
|
|
1235
|
-
var get_1 = get;
|
|
1236
|
-
|
|
1237
|
-
var optionsDefaults_1 = createCommonjsModule(function (module, exports) {
|
|
1238
|
-
|
|
1239
|
-
Object.defineProperty(exports, "__esModule", {
|
|
1240
|
-
value: true
|
|
1241
|
-
});
|
|
1242
|
-
exports["default"] = void 0;
|
|
1243
|
-
var optionsDefaults = {
|
|
1244
|
-
attributeNames: {
|
|
1245
|
-
styleName: 'className'
|
|
1246
|
-
},
|
|
1247
|
-
generateScopedName: '[path]___[name]__[local]___[hash:base64:5]',
|
|
1248
|
-
handleMissingStyleName: 'throw'
|
|
1249
|
-
};
|
|
1250
|
-
var _default = optionsDefaults;
|
|
1251
|
-
exports["default"] = _default;
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
});
|
|
1255
|
-
|
|
1256
|
-
var getClassName = createCommonjsModule(function (module, exports) {
|
|
1257
|
-
|
|
1258
|
-
Object.defineProperty(exports, "__esModule", {
|
|
1259
|
-
value: true
|
|
1260
|
-
});
|
|
1261
|
-
exports["default"] = void 0;
|
|
1262
|
-
|
|
1263
|
-
var _optionsDefaults = _interopRequireDefault(optionsDefaults_1);
|
|
1264
|
-
|
|
1265
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
1266
|
-
|
|
1267
|
-
var isNamespacedStyleName = function isNamespacedStyleName(styleName) {
|
|
1268
|
-
return styleName.indexOf('.') !== -1;
|
|
1269
|
-
};
|
|
1270
|
-
|
|
1271
|
-
var handleError = function handleError(message, handleMissingStyleName) {
|
|
1272
|
-
if (handleMissingStyleName === 'throw') {
|
|
1273
|
-
throw new Error(message);
|
|
1274
|
-
} else if (handleMissingStyleName === 'warn') {
|
|
1275
|
-
// eslint-disable-next-line no-console
|
|
1276
|
-
console.warn(message);
|
|
1277
|
-
}
|
|
1278
|
-
|
|
1279
|
-
return null;
|
|
1280
|
-
};
|
|
1281
|
-
|
|
1282
|
-
var getClassNameForNamespacedStyleName = function getClassNameForNamespacedStyleName(styleName, styleModuleImportMap, handleMissingStyleNameOption) {
|
|
1283
|
-
// Note:
|
|
1284
|
-
// Do not use the desctructing syntax with Babel.
|
|
1285
|
-
// Desctructing adds _slicedToArray helper.
|
|
1286
|
-
var styleNameParts = styleName.split('.');
|
|
1287
|
-
var importName = styleNameParts[0];
|
|
1288
|
-
var moduleName = styleNameParts[1];
|
|
1289
|
-
var handleMissingStyleName = handleMissingStyleNameOption || _optionsDefaults["default"].handleMissingStyleName;
|
|
1290
|
-
|
|
1291
|
-
if (!moduleName) {
|
|
1292
|
-
return handleError('Invalid style name: ' + styleName, handleMissingStyleName);
|
|
1293
|
-
}
|
|
1294
|
-
|
|
1295
|
-
if (!styleModuleImportMap[importName]) {
|
|
1296
|
-
return handleError('CSS module import does not exist: ' + importName, handleMissingStyleName);
|
|
1297
|
-
}
|
|
1298
|
-
|
|
1299
|
-
if (!styleModuleImportMap[importName][moduleName]) {
|
|
1300
|
-
return handleError('CSS module does not exist: ' + moduleName, handleMissingStyleName);
|
|
1301
|
-
}
|
|
1302
|
-
|
|
1303
|
-
return styleModuleImportMap[importName][moduleName];
|
|
1304
|
-
};
|
|
1305
|
-
|
|
1306
|
-
var getClassNameFromMultipleImports = function getClassNameFromMultipleImports(styleName, styleModuleImportMap, handleMissingStyleNameOption) {
|
|
1307
|
-
var handleMissingStyleName = handleMissingStyleNameOption || _optionsDefaults["default"].handleMissingStyleName;
|
|
1308
|
-
var importKeysWithMatches = Object.keys(styleModuleImportMap).map(function (importKey) {
|
|
1309
|
-
return styleModuleImportMap[importKey][styleName] && importKey;
|
|
1310
|
-
}).filter(function (importKey) {
|
|
1311
|
-
return importKey;
|
|
1312
|
-
});
|
|
1313
|
-
|
|
1314
|
-
if (importKeysWithMatches.length > 1) {
|
|
1315
|
-
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');
|
|
1316
|
-
}
|
|
1317
|
-
|
|
1318
|
-
if (importKeysWithMatches.length === 0) {
|
|
1319
|
-
return handleError('Could not resolve the styleName \'' + styleName + '\'.', handleMissingStyleName);
|
|
1320
|
-
}
|
|
1321
|
-
|
|
1322
|
-
return styleModuleImportMap[importKeysWithMatches[0]][styleName];
|
|
1323
|
-
};
|
|
1324
|
-
|
|
1325
|
-
var _default = function _default(styleNameValue, styleModuleImportMap, options) {
|
|
1326
|
-
var styleModuleImportMapKeys = Object.keys(styleModuleImportMap);
|
|
1327
|
-
|
|
1328
|
-
var _ref = options || {},
|
|
1329
|
-
_ref$handleMissingSty = _ref.handleMissingStyleName,
|
|
1330
|
-
handleMissingStyleName = _ref$handleMissingSty === void 0 ? _optionsDefaults["default"].handleMissingStyleName : _ref$handleMissingSty,
|
|
1331
|
-
_ref$autoResolveMulti = _ref.autoResolveMultipleImports,
|
|
1332
|
-
autoResolveMultipleImports = _ref$autoResolveMulti === void 0 ? _optionsDefaults["default"].autoResolveMultipleImports : _ref$autoResolveMulti;
|
|
1333
|
-
|
|
1334
|
-
if (!styleNameValue) {
|
|
1335
|
-
return '';
|
|
1336
|
-
}
|
|
1337
|
-
|
|
1338
|
-
return styleNameValue.split(' ').filter(function (styleName) {
|
|
1339
|
-
return styleName;
|
|
1340
|
-
}).map(function (styleName) {
|
|
1341
|
-
if (isNamespacedStyleName(styleName)) {
|
|
1342
|
-
return getClassNameForNamespacedStyleName(styleName, styleModuleImportMap, handleMissingStyleName);
|
|
1343
|
-
}
|
|
1344
|
-
|
|
1345
|
-
if (styleModuleImportMapKeys.length === 0) {
|
|
1346
|
-
throw new Error('Cannot use styleName attribute for style name \'' + styleName + '\' without importing at least one stylesheet.');
|
|
1347
|
-
}
|
|
1348
|
-
|
|
1349
|
-
if (styleModuleImportMapKeys.length > 1) {
|
|
1350
|
-
if (!autoResolveMultipleImports) {
|
|
1351
|
-
throw new Error('Cannot use anonymous style name \'' + styleName + '\' with more than one stylesheet import without setting \'autoResolveMultipleImports\' to true.');
|
|
1352
|
-
}
|
|
1353
|
-
|
|
1354
|
-
return getClassNameFromMultipleImports(styleName, styleModuleImportMap, handleMissingStyleName);
|
|
1355
|
-
}
|
|
1356
|
-
|
|
1357
|
-
var styleModuleMap = styleModuleImportMap[styleModuleImportMapKeys[0]];
|
|
1358
|
-
|
|
1359
|
-
if (!styleModuleMap[styleName]) {
|
|
1360
|
-
return handleError('Could not resolve the styleName \'' + styleName + '\'.', handleMissingStyleName);
|
|
1361
|
-
}
|
|
1362
|
-
|
|
1363
|
-
return styleModuleMap[styleName];
|
|
1364
|
-
}).filter(function (className) {
|
|
1365
|
-
// Remove any styles which could not be found (if handleMissingStyleName === 'ignore')
|
|
1366
|
-
return className;
|
|
1367
|
-
}).join(' ');
|
|
1368
|
-
};
|
|
1369
|
-
|
|
1370
|
-
exports["default"] = _default;
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
});
|
|
1374
|
-
|
|
1375
|
-
var _getClassName = /*@__PURE__*/getDefaultExportFromCjs(getClassName);
|
|
1376
|
-
|
|
1377
49
|
var StateContext = /*#__PURE__*/React.createContext(); // eslint-disable-next-line react/display-name
|
|
1378
50
|
|
|
1379
51
|
var StateProvider = function StateProvider(RowComponent) {
|
|
@@ -1391,1133 +63,6 @@ var useStateValue = function useStateValue() {
|
|
|
1391
63
|
return React.useContext(StateContext);
|
|
1392
64
|
};
|
|
1393
65
|
|
|
1394
|
-
function _typeof(obj) {
|
|
1395
|
-
"@babel/helpers - typeof";
|
|
1396
|
-
|
|
1397
|
-
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
|
|
1398
|
-
return typeof obj;
|
|
1399
|
-
} : function (obj) {
|
|
1400
|
-
return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
|
1401
|
-
}, _typeof(obj);
|
|
1402
|
-
}
|
|
1403
|
-
|
|
1404
|
-
/**
|
|
1405
|
-
* Copyright (c) 2014-present, Facebook, Inc.
|
|
1406
|
-
*
|
|
1407
|
-
* This source code is licensed under the MIT license found in the
|
|
1408
|
-
* LICENSE file in the root directory of this source tree.
|
|
1409
|
-
*/
|
|
1410
|
-
|
|
1411
|
-
createCommonjsModule(function (module) {
|
|
1412
|
-
var runtime = (function (exports) {
|
|
1413
|
-
|
|
1414
|
-
var Op = Object.prototype;
|
|
1415
|
-
var hasOwn = Op.hasOwnProperty;
|
|
1416
|
-
var undefined$1; // More compressible than void 0.
|
|
1417
|
-
var $Symbol = typeof Symbol === "function" ? Symbol : {};
|
|
1418
|
-
var iteratorSymbol = $Symbol.iterator || "@@iterator";
|
|
1419
|
-
var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator";
|
|
1420
|
-
var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
|
|
1421
|
-
|
|
1422
|
-
function define(obj, key, value) {
|
|
1423
|
-
Object.defineProperty(obj, key, {
|
|
1424
|
-
value: value,
|
|
1425
|
-
enumerable: true,
|
|
1426
|
-
configurable: true,
|
|
1427
|
-
writable: true
|
|
1428
|
-
});
|
|
1429
|
-
return obj[key];
|
|
1430
|
-
}
|
|
1431
|
-
try {
|
|
1432
|
-
// IE 8 has a broken Object.defineProperty that only works on DOM objects.
|
|
1433
|
-
define({}, "");
|
|
1434
|
-
} catch (err) {
|
|
1435
|
-
define = function(obj, key, value) {
|
|
1436
|
-
return obj[key] = value;
|
|
1437
|
-
};
|
|
1438
|
-
}
|
|
1439
|
-
|
|
1440
|
-
function wrap(innerFn, outerFn, self, tryLocsList) {
|
|
1441
|
-
// If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.
|
|
1442
|
-
var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;
|
|
1443
|
-
var generator = Object.create(protoGenerator.prototype);
|
|
1444
|
-
var context = new Context(tryLocsList || []);
|
|
1445
|
-
|
|
1446
|
-
// The ._invoke method unifies the implementations of the .next,
|
|
1447
|
-
// .throw, and .return methods.
|
|
1448
|
-
generator._invoke = makeInvokeMethod(innerFn, self, context);
|
|
1449
|
-
|
|
1450
|
-
return generator;
|
|
1451
|
-
}
|
|
1452
|
-
exports.wrap = wrap;
|
|
1453
|
-
|
|
1454
|
-
// Try/catch helper to minimize deoptimizations. Returns a completion
|
|
1455
|
-
// record like context.tryEntries[i].completion. This interface could
|
|
1456
|
-
// have been (and was previously) designed to take a closure to be
|
|
1457
|
-
// invoked without arguments, but in all the cases we care about we
|
|
1458
|
-
// already have an existing method we want to call, so there's no need
|
|
1459
|
-
// to create a new function object. We can even get away with assuming
|
|
1460
|
-
// the method takes exactly one argument, since that happens to be true
|
|
1461
|
-
// in every case, so we don't have to touch the arguments object. The
|
|
1462
|
-
// only additional allocation required is the completion record, which
|
|
1463
|
-
// has a stable shape and so hopefully should be cheap to allocate.
|
|
1464
|
-
function tryCatch(fn, obj, arg) {
|
|
1465
|
-
try {
|
|
1466
|
-
return { type: "normal", arg: fn.call(obj, arg) };
|
|
1467
|
-
} catch (err) {
|
|
1468
|
-
return { type: "throw", arg: err };
|
|
1469
|
-
}
|
|
1470
|
-
}
|
|
1471
|
-
|
|
1472
|
-
var GenStateSuspendedStart = "suspendedStart";
|
|
1473
|
-
var GenStateSuspendedYield = "suspendedYield";
|
|
1474
|
-
var GenStateExecuting = "executing";
|
|
1475
|
-
var GenStateCompleted = "completed";
|
|
1476
|
-
|
|
1477
|
-
// Returning this object from the innerFn has the same effect as
|
|
1478
|
-
// breaking out of the dispatch switch statement.
|
|
1479
|
-
var ContinueSentinel = {};
|
|
1480
|
-
|
|
1481
|
-
// Dummy constructor functions that we use as the .constructor and
|
|
1482
|
-
// .constructor.prototype properties for functions that return Generator
|
|
1483
|
-
// objects. For full spec compliance, you may wish to configure your
|
|
1484
|
-
// minifier not to mangle the names of these two functions.
|
|
1485
|
-
function Generator() {}
|
|
1486
|
-
function GeneratorFunction() {}
|
|
1487
|
-
function GeneratorFunctionPrototype() {}
|
|
1488
|
-
|
|
1489
|
-
// This is a polyfill for %IteratorPrototype% for environments that
|
|
1490
|
-
// don't natively support it.
|
|
1491
|
-
var IteratorPrototype = {};
|
|
1492
|
-
define(IteratorPrototype, iteratorSymbol, function () {
|
|
1493
|
-
return this;
|
|
1494
|
-
});
|
|
1495
|
-
|
|
1496
|
-
var getProto = Object.getPrototypeOf;
|
|
1497
|
-
var NativeIteratorPrototype = getProto && getProto(getProto(values([])));
|
|
1498
|
-
if (NativeIteratorPrototype &&
|
|
1499
|
-
NativeIteratorPrototype !== Op &&
|
|
1500
|
-
hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {
|
|
1501
|
-
// This environment has a native %IteratorPrototype%; use it instead
|
|
1502
|
-
// of the polyfill.
|
|
1503
|
-
IteratorPrototype = NativeIteratorPrototype;
|
|
1504
|
-
}
|
|
1505
|
-
|
|
1506
|
-
var Gp = GeneratorFunctionPrototype.prototype =
|
|
1507
|
-
Generator.prototype = Object.create(IteratorPrototype);
|
|
1508
|
-
GeneratorFunction.prototype = GeneratorFunctionPrototype;
|
|
1509
|
-
define(Gp, "constructor", GeneratorFunctionPrototype);
|
|
1510
|
-
define(GeneratorFunctionPrototype, "constructor", GeneratorFunction);
|
|
1511
|
-
GeneratorFunction.displayName = define(
|
|
1512
|
-
GeneratorFunctionPrototype,
|
|
1513
|
-
toStringTagSymbol,
|
|
1514
|
-
"GeneratorFunction"
|
|
1515
|
-
);
|
|
1516
|
-
|
|
1517
|
-
// Helper for defining the .next, .throw, and .return methods of the
|
|
1518
|
-
// Iterator interface in terms of a single ._invoke method.
|
|
1519
|
-
function defineIteratorMethods(prototype) {
|
|
1520
|
-
["next", "throw", "return"].forEach(function(method) {
|
|
1521
|
-
define(prototype, method, function(arg) {
|
|
1522
|
-
return this._invoke(method, arg);
|
|
1523
|
-
});
|
|
1524
|
-
});
|
|
1525
|
-
}
|
|
1526
|
-
|
|
1527
|
-
exports.isGeneratorFunction = function(genFun) {
|
|
1528
|
-
var ctor = typeof genFun === "function" && genFun.constructor;
|
|
1529
|
-
return ctor
|
|
1530
|
-
? ctor === GeneratorFunction ||
|
|
1531
|
-
// For the native GeneratorFunction constructor, the best we can
|
|
1532
|
-
// do is to check its .name property.
|
|
1533
|
-
(ctor.displayName || ctor.name) === "GeneratorFunction"
|
|
1534
|
-
: false;
|
|
1535
|
-
};
|
|
1536
|
-
|
|
1537
|
-
exports.mark = function(genFun) {
|
|
1538
|
-
if (Object.setPrototypeOf) {
|
|
1539
|
-
Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);
|
|
1540
|
-
} else {
|
|
1541
|
-
genFun.__proto__ = GeneratorFunctionPrototype;
|
|
1542
|
-
define(genFun, toStringTagSymbol, "GeneratorFunction");
|
|
1543
|
-
}
|
|
1544
|
-
genFun.prototype = Object.create(Gp);
|
|
1545
|
-
return genFun;
|
|
1546
|
-
};
|
|
1547
|
-
|
|
1548
|
-
// Within the body of any async function, `await x` is transformed to
|
|
1549
|
-
// `yield regeneratorRuntime.awrap(x)`, so that the runtime can test
|
|
1550
|
-
// `hasOwn.call(value, "__await")` to determine if the yielded value is
|
|
1551
|
-
// meant to be awaited.
|
|
1552
|
-
exports.awrap = function(arg) {
|
|
1553
|
-
return { __await: arg };
|
|
1554
|
-
};
|
|
1555
|
-
|
|
1556
|
-
function AsyncIterator(generator, PromiseImpl) {
|
|
1557
|
-
function invoke(method, arg, resolve, reject) {
|
|
1558
|
-
var record = tryCatch(generator[method], generator, arg);
|
|
1559
|
-
if (record.type === "throw") {
|
|
1560
|
-
reject(record.arg);
|
|
1561
|
-
} else {
|
|
1562
|
-
var result = record.arg;
|
|
1563
|
-
var value = result.value;
|
|
1564
|
-
if (value &&
|
|
1565
|
-
typeof value === "object" &&
|
|
1566
|
-
hasOwn.call(value, "__await")) {
|
|
1567
|
-
return PromiseImpl.resolve(value.__await).then(function(value) {
|
|
1568
|
-
invoke("next", value, resolve, reject);
|
|
1569
|
-
}, function(err) {
|
|
1570
|
-
invoke("throw", err, resolve, reject);
|
|
1571
|
-
});
|
|
1572
|
-
}
|
|
1573
|
-
|
|
1574
|
-
return PromiseImpl.resolve(value).then(function(unwrapped) {
|
|
1575
|
-
// When a yielded Promise is resolved, its final value becomes
|
|
1576
|
-
// the .value of the Promise<{value,done}> result for the
|
|
1577
|
-
// current iteration.
|
|
1578
|
-
result.value = unwrapped;
|
|
1579
|
-
resolve(result);
|
|
1580
|
-
}, function(error) {
|
|
1581
|
-
// If a rejected Promise was yielded, throw the rejection back
|
|
1582
|
-
// into the async generator function so it can be handled there.
|
|
1583
|
-
return invoke("throw", error, resolve, reject);
|
|
1584
|
-
});
|
|
1585
|
-
}
|
|
1586
|
-
}
|
|
1587
|
-
|
|
1588
|
-
var previousPromise;
|
|
1589
|
-
|
|
1590
|
-
function enqueue(method, arg) {
|
|
1591
|
-
function callInvokeWithMethodAndArg() {
|
|
1592
|
-
return new PromiseImpl(function(resolve, reject) {
|
|
1593
|
-
invoke(method, arg, resolve, reject);
|
|
1594
|
-
});
|
|
1595
|
-
}
|
|
1596
|
-
|
|
1597
|
-
return previousPromise =
|
|
1598
|
-
// If enqueue has been called before, then we want to wait until
|
|
1599
|
-
// all previous Promises have been resolved before calling invoke,
|
|
1600
|
-
// so that results are always delivered in the correct order. If
|
|
1601
|
-
// enqueue has not been called before, then it is important to
|
|
1602
|
-
// call invoke immediately, without waiting on a callback to fire,
|
|
1603
|
-
// so that the async generator function has the opportunity to do
|
|
1604
|
-
// any necessary setup in a predictable way. This predictability
|
|
1605
|
-
// is why the Promise constructor synchronously invokes its
|
|
1606
|
-
// executor callback, and why async functions synchronously
|
|
1607
|
-
// execute code before the first await. Since we implement simple
|
|
1608
|
-
// async functions in terms of async generators, it is especially
|
|
1609
|
-
// important to get this right, even though it requires care.
|
|
1610
|
-
previousPromise ? previousPromise.then(
|
|
1611
|
-
callInvokeWithMethodAndArg,
|
|
1612
|
-
// Avoid propagating failures to Promises returned by later
|
|
1613
|
-
// invocations of the iterator.
|
|
1614
|
-
callInvokeWithMethodAndArg
|
|
1615
|
-
) : callInvokeWithMethodAndArg();
|
|
1616
|
-
}
|
|
1617
|
-
|
|
1618
|
-
// Define the unified helper method that is used to implement .next,
|
|
1619
|
-
// .throw, and .return (see defineIteratorMethods).
|
|
1620
|
-
this._invoke = enqueue;
|
|
1621
|
-
}
|
|
1622
|
-
|
|
1623
|
-
defineIteratorMethods(AsyncIterator.prototype);
|
|
1624
|
-
define(AsyncIterator.prototype, asyncIteratorSymbol, function () {
|
|
1625
|
-
return this;
|
|
1626
|
-
});
|
|
1627
|
-
exports.AsyncIterator = AsyncIterator;
|
|
1628
|
-
|
|
1629
|
-
// Note that simple async functions are implemented on top of
|
|
1630
|
-
// AsyncIterator objects; they just return a Promise for the value of
|
|
1631
|
-
// the final result produced by the iterator.
|
|
1632
|
-
exports.async = function(innerFn, outerFn, self, tryLocsList, PromiseImpl) {
|
|
1633
|
-
if (PromiseImpl === void 0) PromiseImpl = Promise;
|
|
1634
|
-
|
|
1635
|
-
var iter = new AsyncIterator(
|
|
1636
|
-
wrap(innerFn, outerFn, self, tryLocsList),
|
|
1637
|
-
PromiseImpl
|
|
1638
|
-
);
|
|
1639
|
-
|
|
1640
|
-
return exports.isGeneratorFunction(outerFn)
|
|
1641
|
-
? iter // If outerFn is a generator, return the full iterator.
|
|
1642
|
-
: iter.next().then(function(result) {
|
|
1643
|
-
return result.done ? result.value : iter.next();
|
|
1644
|
-
});
|
|
1645
|
-
};
|
|
1646
|
-
|
|
1647
|
-
function makeInvokeMethod(innerFn, self, context) {
|
|
1648
|
-
var state = GenStateSuspendedStart;
|
|
1649
|
-
|
|
1650
|
-
return function invoke(method, arg) {
|
|
1651
|
-
if (state === GenStateExecuting) {
|
|
1652
|
-
throw new Error("Generator is already running");
|
|
1653
|
-
}
|
|
1654
|
-
|
|
1655
|
-
if (state === GenStateCompleted) {
|
|
1656
|
-
if (method === "throw") {
|
|
1657
|
-
throw arg;
|
|
1658
|
-
}
|
|
1659
|
-
|
|
1660
|
-
// Be forgiving, per 25.3.3.3.3 of the spec:
|
|
1661
|
-
// https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume
|
|
1662
|
-
return doneResult();
|
|
1663
|
-
}
|
|
1664
|
-
|
|
1665
|
-
context.method = method;
|
|
1666
|
-
context.arg = arg;
|
|
1667
|
-
|
|
1668
|
-
while (true) {
|
|
1669
|
-
var delegate = context.delegate;
|
|
1670
|
-
if (delegate) {
|
|
1671
|
-
var delegateResult = maybeInvokeDelegate(delegate, context);
|
|
1672
|
-
if (delegateResult) {
|
|
1673
|
-
if (delegateResult === ContinueSentinel) continue;
|
|
1674
|
-
return delegateResult;
|
|
1675
|
-
}
|
|
1676
|
-
}
|
|
1677
|
-
|
|
1678
|
-
if (context.method === "next") {
|
|
1679
|
-
// Setting context._sent for legacy support of Babel's
|
|
1680
|
-
// function.sent implementation.
|
|
1681
|
-
context.sent = context._sent = context.arg;
|
|
1682
|
-
|
|
1683
|
-
} else if (context.method === "throw") {
|
|
1684
|
-
if (state === GenStateSuspendedStart) {
|
|
1685
|
-
state = GenStateCompleted;
|
|
1686
|
-
throw context.arg;
|
|
1687
|
-
}
|
|
1688
|
-
|
|
1689
|
-
context.dispatchException(context.arg);
|
|
1690
|
-
|
|
1691
|
-
} else if (context.method === "return") {
|
|
1692
|
-
context.abrupt("return", context.arg);
|
|
1693
|
-
}
|
|
1694
|
-
|
|
1695
|
-
state = GenStateExecuting;
|
|
1696
|
-
|
|
1697
|
-
var record = tryCatch(innerFn, self, context);
|
|
1698
|
-
if (record.type === "normal") {
|
|
1699
|
-
// If an exception is thrown from innerFn, we leave state ===
|
|
1700
|
-
// GenStateExecuting and loop back for another invocation.
|
|
1701
|
-
state = context.done
|
|
1702
|
-
? GenStateCompleted
|
|
1703
|
-
: GenStateSuspendedYield;
|
|
1704
|
-
|
|
1705
|
-
if (record.arg === ContinueSentinel) {
|
|
1706
|
-
continue;
|
|
1707
|
-
}
|
|
1708
|
-
|
|
1709
|
-
return {
|
|
1710
|
-
value: record.arg,
|
|
1711
|
-
done: context.done
|
|
1712
|
-
};
|
|
1713
|
-
|
|
1714
|
-
} else if (record.type === "throw") {
|
|
1715
|
-
state = GenStateCompleted;
|
|
1716
|
-
// Dispatch the exception by looping back around to the
|
|
1717
|
-
// context.dispatchException(context.arg) call above.
|
|
1718
|
-
context.method = "throw";
|
|
1719
|
-
context.arg = record.arg;
|
|
1720
|
-
}
|
|
1721
|
-
}
|
|
1722
|
-
};
|
|
1723
|
-
}
|
|
1724
|
-
|
|
1725
|
-
// Call delegate.iterator[context.method](context.arg) and handle the
|
|
1726
|
-
// result, either by returning a { value, done } result from the
|
|
1727
|
-
// delegate iterator, or by modifying context.method and context.arg,
|
|
1728
|
-
// setting context.delegate to null, and returning the ContinueSentinel.
|
|
1729
|
-
function maybeInvokeDelegate(delegate, context) {
|
|
1730
|
-
var method = delegate.iterator[context.method];
|
|
1731
|
-
if (method === undefined$1) {
|
|
1732
|
-
// A .throw or .return when the delegate iterator has no .throw
|
|
1733
|
-
// method always terminates the yield* loop.
|
|
1734
|
-
context.delegate = null;
|
|
1735
|
-
|
|
1736
|
-
if (context.method === "throw") {
|
|
1737
|
-
// Note: ["return"] must be used for ES3 parsing compatibility.
|
|
1738
|
-
if (delegate.iterator["return"]) {
|
|
1739
|
-
// If the delegate iterator has a return method, give it a
|
|
1740
|
-
// chance to clean up.
|
|
1741
|
-
context.method = "return";
|
|
1742
|
-
context.arg = undefined$1;
|
|
1743
|
-
maybeInvokeDelegate(delegate, context);
|
|
1744
|
-
|
|
1745
|
-
if (context.method === "throw") {
|
|
1746
|
-
// If maybeInvokeDelegate(context) changed context.method from
|
|
1747
|
-
// "return" to "throw", let that override the TypeError below.
|
|
1748
|
-
return ContinueSentinel;
|
|
1749
|
-
}
|
|
1750
|
-
}
|
|
1751
|
-
|
|
1752
|
-
context.method = "throw";
|
|
1753
|
-
context.arg = new TypeError(
|
|
1754
|
-
"The iterator does not provide a 'throw' method");
|
|
1755
|
-
}
|
|
1756
|
-
|
|
1757
|
-
return ContinueSentinel;
|
|
1758
|
-
}
|
|
1759
|
-
|
|
1760
|
-
var record = tryCatch(method, delegate.iterator, context.arg);
|
|
1761
|
-
|
|
1762
|
-
if (record.type === "throw") {
|
|
1763
|
-
context.method = "throw";
|
|
1764
|
-
context.arg = record.arg;
|
|
1765
|
-
context.delegate = null;
|
|
1766
|
-
return ContinueSentinel;
|
|
1767
|
-
}
|
|
1768
|
-
|
|
1769
|
-
var info = record.arg;
|
|
1770
|
-
|
|
1771
|
-
if (! info) {
|
|
1772
|
-
context.method = "throw";
|
|
1773
|
-
context.arg = new TypeError("iterator result is not an object");
|
|
1774
|
-
context.delegate = null;
|
|
1775
|
-
return ContinueSentinel;
|
|
1776
|
-
}
|
|
1777
|
-
|
|
1778
|
-
if (info.done) {
|
|
1779
|
-
// Assign the result of the finished delegate to the temporary
|
|
1780
|
-
// variable specified by delegate.resultName (see delegateYield).
|
|
1781
|
-
context[delegate.resultName] = info.value;
|
|
1782
|
-
|
|
1783
|
-
// Resume execution at the desired location (see delegateYield).
|
|
1784
|
-
context.next = delegate.nextLoc;
|
|
1785
|
-
|
|
1786
|
-
// If context.method was "throw" but the delegate handled the
|
|
1787
|
-
// exception, let the outer generator proceed normally. If
|
|
1788
|
-
// context.method was "next", forget context.arg since it has been
|
|
1789
|
-
// "consumed" by the delegate iterator. If context.method was
|
|
1790
|
-
// "return", allow the original .return call to continue in the
|
|
1791
|
-
// outer generator.
|
|
1792
|
-
if (context.method !== "return") {
|
|
1793
|
-
context.method = "next";
|
|
1794
|
-
context.arg = undefined$1;
|
|
1795
|
-
}
|
|
1796
|
-
|
|
1797
|
-
} else {
|
|
1798
|
-
// Re-yield the result returned by the delegate method.
|
|
1799
|
-
return info;
|
|
1800
|
-
}
|
|
1801
|
-
|
|
1802
|
-
// The delegate iterator is finished, so forget it and continue with
|
|
1803
|
-
// the outer generator.
|
|
1804
|
-
context.delegate = null;
|
|
1805
|
-
return ContinueSentinel;
|
|
1806
|
-
}
|
|
1807
|
-
|
|
1808
|
-
// Define Generator.prototype.{next,throw,return} in terms of the
|
|
1809
|
-
// unified ._invoke helper method.
|
|
1810
|
-
defineIteratorMethods(Gp);
|
|
1811
|
-
|
|
1812
|
-
define(Gp, toStringTagSymbol, "Generator");
|
|
1813
|
-
|
|
1814
|
-
// A Generator should always return itself as the iterator object when the
|
|
1815
|
-
// @@iterator function is called on it. Some browsers' implementations of the
|
|
1816
|
-
// iterator prototype chain incorrectly implement this, causing the Generator
|
|
1817
|
-
// object to not be returned from this call. This ensures that doesn't happen.
|
|
1818
|
-
// See https://github.com/facebook/regenerator/issues/274 for more details.
|
|
1819
|
-
define(Gp, iteratorSymbol, function() {
|
|
1820
|
-
return this;
|
|
1821
|
-
});
|
|
1822
|
-
|
|
1823
|
-
define(Gp, "toString", function() {
|
|
1824
|
-
return "[object Generator]";
|
|
1825
|
-
});
|
|
1826
|
-
|
|
1827
|
-
function pushTryEntry(locs) {
|
|
1828
|
-
var entry = { tryLoc: locs[0] };
|
|
1829
|
-
|
|
1830
|
-
if (1 in locs) {
|
|
1831
|
-
entry.catchLoc = locs[1];
|
|
1832
|
-
}
|
|
1833
|
-
|
|
1834
|
-
if (2 in locs) {
|
|
1835
|
-
entry.finallyLoc = locs[2];
|
|
1836
|
-
entry.afterLoc = locs[3];
|
|
1837
|
-
}
|
|
1838
|
-
|
|
1839
|
-
this.tryEntries.push(entry);
|
|
1840
|
-
}
|
|
1841
|
-
|
|
1842
|
-
function resetTryEntry(entry) {
|
|
1843
|
-
var record = entry.completion || {};
|
|
1844
|
-
record.type = "normal";
|
|
1845
|
-
delete record.arg;
|
|
1846
|
-
entry.completion = record;
|
|
1847
|
-
}
|
|
1848
|
-
|
|
1849
|
-
function Context(tryLocsList) {
|
|
1850
|
-
// The root entry object (effectively a try statement without a catch
|
|
1851
|
-
// or a finally block) gives us a place to store values thrown from
|
|
1852
|
-
// locations where there is no enclosing try statement.
|
|
1853
|
-
this.tryEntries = [{ tryLoc: "root" }];
|
|
1854
|
-
tryLocsList.forEach(pushTryEntry, this);
|
|
1855
|
-
this.reset(true);
|
|
1856
|
-
}
|
|
1857
|
-
|
|
1858
|
-
exports.keys = function(object) {
|
|
1859
|
-
var keys = [];
|
|
1860
|
-
for (var key in object) {
|
|
1861
|
-
keys.push(key);
|
|
1862
|
-
}
|
|
1863
|
-
keys.reverse();
|
|
1864
|
-
|
|
1865
|
-
// Rather than returning an object with a next method, we keep
|
|
1866
|
-
// things simple and return the next function itself.
|
|
1867
|
-
return function next() {
|
|
1868
|
-
while (keys.length) {
|
|
1869
|
-
var key = keys.pop();
|
|
1870
|
-
if (key in object) {
|
|
1871
|
-
next.value = key;
|
|
1872
|
-
next.done = false;
|
|
1873
|
-
return next;
|
|
1874
|
-
}
|
|
1875
|
-
}
|
|
1876
|
-
|
|
1877
|
-
// To avoid creating an additional object, we just hang the .value
|
|
1878
|
-
// and .done properties off the next function object itself. This
|
|
1879
|
-
// also ensures that the minifier will not anonymize the function.
|
|
1880
|
-
next.done = true;
|
|
1881
|
-
return next;
|
|
1882
|
-
};
|
|
1883
|
-
};
|
|
1884
|
-
|
|
1885
|
-
function values(iterable) {
|
|
1886
|
-
if (iterable) {
|
|
1887
|
-
var iteratorMethod = iterable[iteratorSymbol];
|
|
1888
|
-
if (iteratorMethod) {
|
|
1889
|
-
return iteratorMethod.call(iterable);
|
|
1890
|
-
}
|
|
1891
|
-
|
|
1892
|
-
if (typeof iterable.next === "function") {
|
|
1893
|
-
return iterable;
|
|
1894
|
-
}
|
|
1895
|
-
|
|
1896
|
-
if (!isNaN(iterable.length)) {
|
|
1897
|
-
var i = -1, next = function next() {
|
|
1898
|
-
while (++i < iterable.length) {
|
|
1899
|
-
if (hasOwn.call(iterable, i)) {
|
|
1900
|
-
next.value = iterable[i];
|
|
1901
|
-
next.done = false;
|
|
1902
|
-
return next;
|
|
1903
|
-
}
|
|
1904
|
-
}
|
|
1905
|
-
|
|
1906
|
-
next.value = undefined$1;
|
|
1907
|
-
next.done = true;
|
|
1908
|
-
|
|
1909
|
-
return next;
|
|
1910
|
-
};
|
|
1911
|
-
|
|
1912
|
-
return next.next = next;
|
|
1913
|
-
}
|
|
1914
|
-
}
|
|
1915
|
-
|
|
1916
|
-
// Return an iterator with no values.
|
|
1917
|
-
return { next: doneResult };
|
|
1918
|
-
}
|
|
1919
|
-
exports.values = values;
|
|
1920
|
-
|
|
1921
|
-
function doneResult() {
|
|
1922
|
-
return { value: undefined$1, done: true };
|
|
1923
|
-
}
|
|
1924
|
-
|
|
1925
|
-
Context.prototype = {
|
|
1926
|
-
constructor: Context,
|
|
1927
|
-
|
|
1928
|
-
reset: function(skipTempReset) {
|
|
1929
|
-
this.prev = 0;
|
|
1930
|
-
this.next = 0;
|
|
1931
|
-
// Resetting context._sent for legacy support of Babel's
|
|
1932
|
-
// function.sent implementation.
|
|
1933
|
-
this.sent = this._sent = undefined$1;
|
|
1934
|
-
this.done = false;
|
|
1935
|
-
this.delegate = null;
|
|
1936
|
-
|
|
1937
|
-
this.method = "next";
|
|
1938
|
-
this.arg = undefined$1;
|
|
1939
|
-
|
|
1940
|
-
this.tryEntries.forEach(resetTryEntry);
|
|
1941
|
-
|
|
1942
|
-
if (!skipTempReset) {
|
|
1943
|
-
for (var name in this) {
|
|
1944
|
-
// Not sure about the optimal order of these conditions:
|
|
1945
|
-
if (name.charAt(0) === "t" &&
|
|
1946
|
-
hasOwn.call(this, name) &&
|
|
1947
|
-
!isNaN(+name.slice(1))) {
|
|
1948
|
-
this[name] = undefined$1;
|
|
1949
|
-
}
|
|
1950
|
-
}
|
|
1951
|
-
}
|
|
1952
|
-
},
|
|
1953
|
-
|
|
1954
|
-
stop: function() {
|
|
1955
|
-
this.done = true;
|
|
1956
|
-
|
|
1957
|
-
var rootEntry = this.tryEntries[0];
|
|
1958
|
-
var rootRecord = rootEntry.completion;
|
|
1959
|
-
if (rootRecord.type === "throw") {
|
|
1960
|
-
throw rootRecord.arg;
|
|
1961
|
-
}
|
|
1962
|
-
|
|
1963
|
-
return this.rval;
|
|
1964
|
-
},
|
|
1965
|
-
|
|
1966
|
-
dispatchException: function(exception) {
|
|
1967
|
-
if (this.done) {
|
|
1968
|
-
throw exception;
|
|
1969
|
-
}
|
|
1970
|
-
|
|
1971
|
-
var context = this;
|
|
1972
|
-
function handle(loc, caught) {
|
|
1973
|
-
record.type = "throw";
|
|
1974
|
-
record.arg = exception;
|
|
1975
|
-
context.next = loc;
|
|
1976
|
-
|
|
1977
|
-
if (caught) {
|
|
1978
|
-
// If the dispatched exception was caught by a catch block,
|
|
1979
|
-
// then let that catch block handle the exception normally.
|
|
1980
|
-
context.method = "next";
|
|
1981
|
-
context.arg = undefined$1;
|
|
1982
|
-
}
|
|
1983
|
-
|
|
1984
|
-
return !! caught;
|
|
1985
|
-
}
|
|
1986
|
-
|
|
1987
|
-
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
1988
|
-
var entry = this.tryEntries[i];
|
|
1989
|
-
var record = entry.completion;
|
|
1990
|
-
|
|
1991
|
-
if (entry.tryLoc === "root") {
|
|
1992
|
-
// Exception thrown outside of any try block that could handle
|
|
1993
|
-
// it, so set the completion value of the entire function to
|
|
1994
|
-
// throw the exception.
|
|
1995
|
-
return handle("end");
|
|
1996
|
-
}
|
|
1997
|
-
|
|
1998
|
-
if (entry.tryLoc <= this.prev) {
|
|
1999
|
-
var hasCatch = hasOwn.call(entry, "catchLoc");
|
|
2000
|
-
var hasFinally = hasOwn.call(entry, "finallyLoc");
|
|
2001
|
-
|
|
2002
|
-
if (hasCatch && hasFinally) {
|
|
2003
|
-
if (this.prev < entry.catchLoc) {
|
|
2004
|
-
return handle(entry.catchLoc, true);
|
|
2005
|
-
} else if (this.prev < entry.finallyLoc) {
|
|
2006
|
-
return handle(entry.finallyLoc);
|
|
2007
|
-
}
|
|
2008
|
-
|
|
2009
|
-
} else if (hasCatch) {
|
|
2010
|
-
if (this.prev < entry.catchLoc) {
|
|
2011
|
-
return handle(entry.catchLoc, true);
|
|
2012
|
-
}
|
|
2013
|
-
|
|
2014
|
-
} else if (hasFinally) {
|
|
2015
|
-
if (this.prev < entry.finallyLoc) {
|
|
2016
|
-
return handle(entry.finallyLoc);
|
|
2017
|
-
}
|
|
2018
|
-
|
|
2019
|
-
} else {
|
|
2020
|
-
throw new Error("try statement without catch or finally");
|
|
2021
|
-
}
|
|
2022
|
-
}
|
|
2023
|
-
}
|
|
2024
|
-
},
|
|
2025
|
-
|
|
2026
|
-
abrupt: function(type, arg) {
|
|
2027
|
-
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
2028
|
-
var entry = this.tryEntries[i];
|
|
2029
|
-
if (entry.tryLoc <= this.prev &&
|
|
2030
|
-
hasOwn.call(entry, "finallyLoc") &&
|
|
2031
|
-
this.prev < entry.finallyLoc) {
|
|
2032
|
-
var finallyEntry = entry;
|
|
2033
|
-
break;
|
|
2034
|
-
}
|
|
2035
|
-
}
|
|
2036
|
-
|
|
2037
|
-
if (finallyEntry &&
|
|
2038
|
-
(type === "break" ||
|
|
2039
|
-
type === "continue") &&
|
|
2040
|
-
finallyEntry.tryLoc <= arg &&
|
|
2041
|
-
arg <= finallyEntry.finallyLoc) {
|
|
2042
|
-
// Ignore the finally entry if control is not jumping to a
|
|
2043
|
-
// location outside the try/catch block.
|
|
2044
|
-
finallyEntry = null;
|
|
2045
|
-
}
|
|
2046
|
-
|
|
2047
|
-
var record = finallyEntry ? finallyEntry.completion : {};
|
|
2048
|
-
record.type = type;
|
|
2049
|
-
record.arg = arg;
|
|
2050
|
-
|
|
2051
|
-
if (finallyEntry) {
|
|
2052
|
-
this.method = "next";
|
|
2053
|
-
this.next = finallyEntry.finallyLoc;
|
|
2054
|
-
return ContinueSentinel;
|
|
2055
|
-
}
|
|
2056
|
-
|
|
2057
|
-
return this.complete(record);
|
|
2058
|
-
},
|
|
2059
|
-
|
|
2060
|
-
complete: function(record, afterLoc) {
|
|
2061
|
-
if (record.type === "throw") {
|
|
2062
|
-
throw record.arg;
|
|
2063
|
-
}
|
|
2064
|
-
|
|
2065
|
-
if (record.type === "break" ||
|
|
2066
|
-
record.type === "continue") {
|
|
2067
|
-
this.next = record.arg;
|
|
2068
|
-
} else if (record.type === "return") {
|
|
2069
|
-
this.rval = this.arg = record.arg;
|
|
2070
|
-
this.method = "return";
|
|
2071
|
-
this.next = "end";
|
|
2072
|
-
} else if (record.type === "normal" && afterLoc) {
|
|
2073
|
-
this.next = afterLoc;
|
|
2074
|
-
}
|
|
2075
|
-
|
|
2076
|
-
return ContinueSentinel;
|
|
2077
|
-
},
|
|
2078
|
-
|
|
2079
|
-
finish: function(finallyLoc) {
|
|
2080
|
-
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
2081
|
-
var entry = this.tryEntries[i];
|
|
2082
|
-
if (entry.finallyLoc === finallyLoc) {
|
|
2083
|
-
this.complete(entry.completion, entry.afterLoc);
|
|
2084
|
-
resetTryEntry(entry);
|
|
2085
|
-
return ContinueSentinel;
|
|
2086
|
-
}
|
|
2087
|
-
}
|
|
2088
|
-
},
|
|
2089
|
-
|
|
2090
|
-
"catch": function(tryLoc) {
|
|
2091
|
-
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
2092
|
-
var entry = this.tryEntries[i];
|
|
2093
|
-
if (entry.tryLoc === tryLoc) {
|
|
2094
|
-
var record = entry.completion;
|
|
2095
|
-
if (record.type === "throw") {
|
|
2096
|
-
var thrown = record.arg;
|
|
2097
|
-
resetTryEntry(entry);
|
|
2098
|
-
}
|
|
2099
|
-
return thrown;
|
|
2100
|
-
}
|
|
2101
|
-
}
|
|
2102
|
-
|
|
2103
|
-
// The context.catch method must only be called with a location
|
|
2104
|
-
// argument that corresponds to a known catch block.
|
|
2105
|
-
throw new Error("illegal catch attempt");
|
|
2106
|
-
},
|
|
2107
|
-
|
|
2108
|
-
delegateYield: function(iterable, resultName, nextLoc) {
|
|
2109
|
-
this.delegate = {
|
|
2110
|
-
iterator: values(iterable),
|
|
2111
|
-
resultName: resultName,
|
|
2112
|
-
nextLoc: nextLoc
|
|
2113
|
-
};
|
|
2114
|
-
|
|
2115
|
-
if (this.method === "next") {
|
|
2116
|
-
// Deliberately forget the last sent value so that we don't
|
|
2117
|
-
// accidentally pass it on to the delegate.
|
|
2118
|
-
this.arg = undefined$1;
|
|
2119
|
-
}
|
|
2120
|
-
|
|
2121
|
-
return ContinueSentinel;
|
|
2122
|
-
}
|
|
2123
|
-
};
|
|
2124
|
-
|
|
2125
|
-
// Regardless of whether this script is executing as a CommonJS module
|
|
2126
|
-
// or not, return the runtime object so that we can declare the variable
|
|
2127
|
-
// regeneratorRuntime in the outer scope, which allows this module to be
|
|
2128
|
-
// injected easily by `bin/regenerator --include-runtime script.js`.
|
|
2129
|
-
return exports;
|
|
2130
|
-
|
|
2131
|
-
}(
|
|
2132
|
-
// If this script is executing as a CommonJS module, use module.exports
|
|
2133
|
-
// as the regeneratorRuntime namespace. Otherwise create a new empty
|
|
2134
|
-
// object. Either way, the resulting object will be used to initialize
|
|
2135
|
-
// the regeneratorRuntime variable at the top of this file.
|
|
2136
|
-
module.exports
|
|
2137
|
-
));
|
|
2138
|
-
|
|
2139
|
-
try {
|
|
2140
|
-
regeneratorRuntime = runtime;
|
|
2141
|
-
} catch (accidentalStrictMode) {
|
|
2142
|
-
// This module should not be running in strict mode, so the above
|
|
2143
|
-
// assignment should always work unless something is misconfigured. Just
|
|
2144
|
-
// in case runtime.js accidentally runs in strict mode, in modern engines
|
|
2145
|
-
// we can explicitly access globalThis. In older engines we can escape
|
|
2146
|
-
// strict mode using a global Function call. This could conceivably fail
|
|
2147
|
-
// if a Content Security Policy forbids using Function, but in that case
|
|
2148
|
-
// the proper solution is to fix the accidental strict mode problem. If
|
|
2149
|
-
// you've misconfigured your bundler to force strict mode and applied a
|
|
2150
|
-
// CSP to forbid Function, and you're not willing to fix either of those
|
|
2151
|
-
// problems, please detail your unique predicament in a GitHub issue.
|
|
2152
|
-
if (typeof globalThis === "object") {
|
|
2153
|
-
globalThis.regeneratorRuntime = runtime;
|
|
2154
|
-
} else {
|
|
2155
|
-
Function("r", "regeneratorRuntime = r")(runtime);
|
|
2156
|
-
}
|
|
2157
|
-
}
|
|
2158
|
-
});
|
|
2159
|
-
|
|
2160
|
-
/**
|
|
2161
|
-
* A specialized version of `_.reduce` for arrays without support for
|
|
2162
|
-
* iteratee shorthands.
|
|
2163
|
-
*
|
|
2164
|
-
* @private
|
|
2165
|
-
* @param {Array} [array] The array to iterate over.
|
|
2166
|
-
* @param {Function} iteratee The function invoked per iteration.
|
|
2167
|
-
* @param {*} [accumulator] The initial value.
|
|
2168
|
-
* @param {boolean} [initAccum] Specify using the first element of `array` as
|
|
2169
|
-
* the initial value.
|
|
2170
|
-
* @returns {*} Returns the accumulated value.
|
|
2171
|
-
*/
|
|
2172
|
-
function arrayReduce(array, iteratee, accumulator, initAccum) {
|
|
2173
|
-
var index = -1,
|
|
2174
|
-
length = array == null ? 0 : array.length;
|
|
2175
|
-
|
|
2176
|
-
if (initAccum && length) {
|
|
2177
|
-
accumulator = array[++index];
|
|
2178
|
-
}
|
|
2179
|
-
while (++index < length) {
|
|
2180
|
-
accumulator = iteratee(accumulator, array[index], index, array);
|
|
2181
|
-
}
|
|
2182
|
-
return accumulator;
|
|
2183
|
-
}
|
|
2184
|
-
|
|
2185
|
-
var _arrayReduce = arrayReduce;
|
|
2186
|
-
|
|
2187
|
-
/**
|
|
2188
|
-
* The base implementation of `_.propertyOf` without support for deep paths.
|
|
2189
|
-
*
|
|
2190
|
-
* @private
|
|
2191
|
-
* @param {Object} object The object to query.
|
|
2192
|
-
* @returns {Function} Returns the new accessor function.
|
|
2193
|
-
*/
|
|
2194
|
-
function basePropertyOf(object) {
|
|
2195
|
-
return function(key) {
|
|
2196
|
-
return object == null ? undefined : object[key];
|
|
2197
|
-
};
|
|
2198
|
-
}
|
|
2199
|
-
|
|
2200
|
-
var _basePropertyOf = basePropertyOf;
|
|
2201
|
-
|
|
2202
|
-
/** Used to map Latin Unicode letters to basic Latin letters. */
|
|
2203
|
-
var deburredLetters = {
|
|
2204
|
-
// Latin-1 Supplement block.
|
|
2205
|
-
'\xc0': 'A', '\xc1': 'A', '\xc2': 'A', '\xc3': 'A', '\xc4': 'A', '\xc5': 'A',
|
|
2206
|
-
'\xe0': 'a', '\xe1': 'a', '\xe2': 'a', '\xe3': 'a', '\xe4': 'a', '\xe5': 'a',
|
|
2207
|
-
'\xc7': 'C', '\xe7': 'c',
|
|
2208
|
-
'\xd0': 'D', '\xf0': 'd',
|
|
2209
|
-
'\xc8': 'E', '\xc9': 'E', '\xca': 'E', '\xcb': 'E',
|
|
2210
|
-
'\xe8': 'e', '\xe9': 'e', '\xea': 'e', '\xeb': 'e',
|
|
2211
|
-
'\xcc': 'I', '\xcd': 'I', '\xce': 'I', '\xcf': 'I',
|
|
2212
|
-
'\xec': 'i', '\xed': 'i', '\xee': 'i', '\xef': 'i',
|
|
2213
|
-
'\xd1': 'N', '\xf1': 'n',
|
|
2214
|
-
'\xd2': 'O', '\xd3': 'O', '\xd4': 'O', '\xd5': 'O', '\xd6': 'O', '\xd8': 'O',
|
|
2215
|
-
'\xf2': 'o', '\xf3': 'o', '\xf4': 'o', '\xf5': 'o', '\xf6': 'o', '\xf8': 'o',
|
|
2216
|
-
'\xd9': 'U', '\xda': 'U', '\xdb': 'U', '\xdc': 'U',
|
|
2217
|
-
'\xf9': 'u', '\xfa': 'u', '\xfb': 'u', '\xfc': 'u',
|
|
2218
|
-
'\xdd': 'Y', '\xfd': 'y', '\xff': 'y',
|
|
2219
|
-
'\xc6': 'Ae', '\xe6': 'ae',
|
|
2220
|
-
'\xde': 'Th', '\xfe': 'th',
|
|
2221
|
-
'\xdf': 'ss',
|
|
2222
|
-
// Latin Extended-A block.
|
|
2223
|
-
'\u0100': 'A', '\u0102': 'A', '\u0104': 'A',
|
|
2224
|
-
'\u0101': 'a', '\u0103': 'a', '\u0105': 'a',
|
|
2225
|
-
'\u0106': 'C', '\u0108': 'C', '\u010a': 'C', '\u010c': 'C',
|
|
2226
|
-
'\u0107': 'c', '\u0109': 'c', '\u010b': 'c', '\u010d': 'c',
|
|
2227
|
-
'\u010e': 'D', '\u0110': 'D', '\u010f': 'd', '\u0111': 'd',
|
|
2228
|
-
'\u0112': 'E', '\u0114': 'E', '\u0116': 'E', '\u0118': 'E', '\u011a': 'E',
|
|
2229
|
-
'\u0113': 'e', '\u0115': 'e', '\u0117': 'e', '\u0119': 'e', '\u011b': 'e',
|
|
2230
|
-
'\u011c': 'G', '\u011e': 'G', '\u0120': 'G', '\u0122': 'G',
|
|
2231
|
-
'\u011d': 'g', '\u011f': 'g', '\u0121': 'g', '\u0123': 'g',
|
|
2232
|
-
'\u0124': 'H', '\u0126': 'H', '\u0125': 'h', '\u0127': 'h',
|
|
2233
|
-
'\u0128': 'I', '\u012a': 'I', '\u012c': 'I', '\u012e': 'I', '\u0130': 'I',
|
|
2234
|
-
'\u0129': 'i', '\u012b': 'i', '\u012d': 'i', '\u012f': 'i', '\u0131': 'i',
|
|
2235
|
-
'\u0134': 'J', '\u0135': 'j',
|
|
2236
|
-
'\u0136': 'K', '\u0137': 'k', '\u0138': 'k',
|
|
2237
|
-
'\u0139': 'L', '\u013b': 'L', '\u013d': 'L', '\u013f': 'L', '\u0141': 'L',
|
|
2238
|
-
'\u013a': 'l', '\u013c': 'l', '\u013e': 'l', '\u0140': 'l', '\u0142': 'l',
|
|
2239
|
-
'\u0143': 'N', '\u0145': 'N', '\u0147': 'N', '\u014a': 'N',
|
|
2240
|
-
'\u0144': 'n', '\u0146': 'n', '\u0148': 'n', '\u014b': 'n',
|
|
2241
|
-
'\u014c': 'O', '\u014e': 'O', '\u0150': 'O',
|
|
2242
|
-
'\u014d': 'o', '\u014f': 'o', '\u0151': 'o',
|
|
2243
|
-
'\u0154': 'R', '\u0156': 'R', '\u0158': 'R',
|
|
2244
|
-
'\u0155': 'r', '\u0157': 'r', '\u0159': 'r',
|
|
2245
|
-
'\u015a': 'S', '\u015c': 'S', '\u015e': 'S', '\u0160': 'S',
|
|
2246
|
-
'\u015b': 's', '\u015d': 's', '\u015f': 's', '\u0161': 's',
|
|
2247
|
-
'\u0162': 'T', '\u0164': 'T', '\u0166': 'T',
|
|
2248
|
-
'\u0163': 't', '\u0165': 't', '\u0167': 't',
|
|
2249
|
-
'\u0168': 'U', '\u016a': 'U', '\u016c': 'U', '\u016e': 'U', '\u0170': 'U', '\u0172': 'U',
|
|
2250
|
-
'\u0169': 'u', '\u016b': 'u', '\u016d': 'u', '\u016f': 'u', '\u0171': 'u', '\u0173': 'u',
|
|
2251
|
-
'\u0174': 'W', '\u0175': 'w',
|
|
2252
|
-
'\u0176': 'Y', '\u0177': 'y', '\u0178': 'Y',
|
|
2253
|
-
'\u0179': 'Z', '\u017b': 'Z', '\u017d': 'Z',
|
|
2254
|
-
'\u017a': 'z', '\u017c': 'z', '\u017e': 'z',
|
|
2255
|
-
'\u0132': 'IJ', '\u0133': 'ij',
|
|
2256
|
-
'\u0152': 'Oe', '\u0153': 'oe',
|
|
2257
|
-
'\u0149': "'n", '\u017f': 's'
|
|
2258
|
-
};
|
|
2259
|
-
|
|
2260
|
-
/**
|
|
2261
|
-
* Used by `_.deburr` to convert Latin-1 Supplement and Latin Extended-A
|
|
2262
|
-
* letters to basic Latin letters.
|
|
2263
|
-
*
|
|
2264
|
-
* @private
|
|
2265
|
-
* @param {string} letter The matched letter to deburr.
|
|
2266
|
-
* @returns {string} Returns the deburred letter.
|
|
2267
|
-
*/
|
|
2268
|
-
var deburrLetter = _basePropertyOf(deburredLetters);
|
|
2269
|
-
|
|
2270
|
-
var _deburrLetter = deburrLetter;
|
|
2271
|
-
|
|
2272
|
-
/** Used to match Latin Unicode letters (excluding mathematical operators). */
|
|
2273
|
-
var reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g;
|
|
2274
|
-
|
|
2275
|
-
/** Used to compose unicode character classes. */
|
|
2276
|
-
var rsComboMarksRange$1 = '\\u0300-\\u036f',
|
|
2277
|
-
reComboHalfMarksRange$1 = '\\ufe20-\\ufe2f',
|
|
2278
|
-
rsComboSymbolsRange$1 = '\\u20d0-\\u20ff',
|
|
2279
|
-
rsComboRange$1 = rsComboMarksRange$1 + reComboHalfMarksRange$1 + rsComboSymbolsRange$1;
|
|
2280
|
-
|
|
2281
|
-
/** Used to compose unicode capture groups. */
|
|
2282
|
-
var rsCombo$1 = '[' + rsComboRange$1 + ']';
|
|
2283
|
-
|
|
2284
|
-
/**
|
|
2285
|
-
* Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks) and
|
|
2286
|
-
* [combining diacritical marks for symbols](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks_for_Symbols).
|
|
2287
|
-
*/
|
|
2288
|
-
var reComboMark = RegExp(rsCombo$1, 'g');
|
|
2289
|
-
|
|
2290
|
-
/**
|
|
2291
|
-
* Deburrs `string` by converting
|
|
2292
|
-
* [Latin-1 Supplement](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table)
|
|
2293
|
-
* and [Latin Extended-A](https://en.wikipedia.org/wiki/Latin_Extended-A)
|
|
2294
|
-
* letters to basic Latin letters and removing
|
|
2295
|
-
* [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks).
|
|
2296
|
-
*
|
|
2297
|
-
* @static
|
|
2298
|
-
* @memberOf _
|
|
2299
|
-
* @since 3.0.0
|
|
2300
|
-
* @category String
|
|
2301
|
-
* @param {string} [string=''] The string to deburr.
|
|
2302
|
-
* @returns {string} Returns the deburred string.
|
|
2303
|
-
* @example
|
|
2304
|
-
*
|
|
2305
|
-
* _.deburr('déjà vu');
|
|
2306
|
-
* // => 'deja vu'
|
|
2307
|
-
*/
|
|
2308
|
-
function deburr(string) {
|
|
2309
|
-
string = toString_1(string);
|
|
2310
|
-
return string && string.replace(reLatin, _deburrLetter).replace(reComboMark, '');
|
|
2311
|
-
}
|
|
2312
|
-
|
|
2313
|
-
var deburr_1 = deburr;
|
|
2314
|
-
|
|
2315
|
-
/** Used to match words composed of alphanumeric characters. */
|
|
2316
|
-
var reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;
|
|
2317
|
-
|
|
2318
|
-
/**
|
|
2319
|
-
* Splits an ASCII `string` into an array of its words.
|
|
2320
|
-
*
|
|
2321
|
-
* @private
|
|
2322
|
-
* @param {string} The string to inspect.
|
|
2323
|
-
* @returns {Array} Returns the words of `string`.
|
|
2324
|
-
*/
|
|
2325
|
-
function asciiWords(string) {
|
|
2326
|
-
return string.match(reAsciiWord) || [];
|
|
2327
|
-
}
|
|
2328
|
-
|
|
2329
|
-
var _asciiWords = asciiWords;
|
|
2330
|
-
|
|
2331
|
-
/** Used to detect strings that need a more robust regexp to match words. */
|
|
2332
|
-
var reHasUnicodeWord = /[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;
|
|
2333
|
-
|
|
2334
|
-
/**
|
|
2335
|
-
* Checks if `string` contains a word composed of Unicode symbols.
|
|
2336
|
-
*
|
|
2337
|
-
* @private
|
|
2338
|
-
* @param {string} string The string to inspect.
|
|
2339
|
-
* @returns {boolean} Returns `true` if a word is found, else `false`.
|
|
2340
|
-
*/
|
|
2341
|
-
function hasUnicodeWord(string) {
|
|
2342
|
-
return reHasUnicodeWord.test(string);
|
|
2343
|
-
}
|
|
2344
|
-
|
|
2345
|
-
var _hasUnicodeWord = hasUnicodeWord;
|
|
2346
|
-
|
|
2347
|
-
/** Used to compose unicode character classes. */
|
|
2348
|
-
var rsAstralRange = '\\ud800-\\udfff',
|
|
2349
|
-
rsComboMarksRange = '\\u0300-\\u036f',
|
|
2350
|
-
reComboHalfMarksRange = '\\ufe20-\\ufe2f',
|
|
2351
|
-
rsComboSymbolsRange = '\\u20d0-\\u20ff',
|
|
2352
|
-
rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange,
|
|
2353
|
-
rsDingbatRange = '\\u2700-\\u27bf',
|
|
2354
|
-
rsLowerRange = 'a-z\\xdf-\\xf6\\xf8-\\xff',
|
|
2355
|
-
rsMathOpRange = '\\xac\\xb1\\xd7\\xf7',
|
|
2356
|
-
rsNonCharRange = '\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf',
|
|
2357
|
-
rsPunctuationRange = '\\u2000-\\u206f',
|
|
2358
|
-
rsSpaceRange = ' \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000',
|
|
2359
|
-
rsUpperRange = 'A-Z\\xc0-\\xd6\\xd8-\\xde',
|
|
2360
|
-
rsVarRange = '\\ufe0e\\ufe0f',
|
|
2361
|
-
rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange;
|
|
2362
|
-
|
|
2363
|
-
/** Used to compose unicode capture groups. */
|
|
2364
|
-
var rsApos$1 = "['\u2019]",
|
|
2365
|
-
rsBreak = '[' + rsBreakRange + ']',
|
|
2366
|
-
rsCombo = '[' + rsComboRange + ']',
|
|
2367
|
-
rsDigits = '\\d+',
|
|
2368
|
-
rsDingbat = '[' + rsDingbatRange + ']',
|
|
2369
|
-
rsLower = '[' + rsLowerRange + ']',
|
|
2370
|
-
rsMisc = '[^' + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + ']',
|
|
2371
|
-
rsFitz = '\\ud83c[\\udffb-\\udfff]',
|
|
2372
|
-
rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')',
|
|
2373
|
-
rsNonAstral = '[^' + rsAstralRange + ']',
|
|
2374
|
-
rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}',
|
|
2375
|
-
rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]',
|
|
2376
|
-
rsUpper = '[' + rsUpperRange + ']',
|
|
2377
|
-
rsZWJ = '\\u200d';
|
|
2378
|
-
|
|
2379
|
-
/** Used to compose unicode regexes. */
|
|
2380
|
-
var rsMiscLower = '(?:' + rsLower + '|' + rsMisc + ')',
|
|
2381
|
-
rsMiscUpper = '(?:' + rsUpper + '|' + rsMisc + ')',
|
|
2382
|
-
rsOptContrLower = '(?:' + rsApos$1 + '(?:d|ll|m|re|s|t|ve))?',
|
|
2383
|
-
rsOptContrUpper = '(?:' + rsApos$1 + '(?:D|LL|M|RE|S|T|VE))?',
|
|
2384
|
-
reOptMod = rsModifier + '?',
|
|
2385
|
-
rsOptVar = '[' + rsVarRange + ']?',
|
|
2386
|
-
rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*',
|
|
2387
|
-
rsOrdLower = '\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])',
|
|
2388
|
-
rsOrdUpper = '\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])',
|
|
2389
|
-
rsSeq = rsOptVar + reOptMod + rsOptJoin,
|
|
2390
|
-
rsEmoji = '(?:' + [rsDingbat, rsRegional, rsSurrPair].join('|') + ')' + rsSeq;
|
|
2391
|
-
|
|
2392
|
-
/** Used to match complex or compound words. */
|
|
2393
|
-
var reUnicodeWord = RegExp([
|
|
2394
|
-
rsUpper + '?' + rsLower + '+' + rsOptContrLower + '(?=' + [rsBreak, rsUpper, '$'].join('|') + ')',
|
|
2395
|
-
rsMiscUpper + '+' + rsOptContrUpper + '(?=' + [rsBreak, rsUpper + rsMiscLower, '$'].join('|') + ')',
|
|
2396
|
-
rsUpper + '?' + rsMiscLower + '+' + rsOptContrLower,
|
|
2397
|
-
rsUpper + '+' + rsOptContrUpper,
|
|
2398
|
-
rsOrdUpper,
|
|
2399
|
-
rsOrdLower,
|
|
2400
|
-
rsDigits,
|
|
2401
|
-
rsEmoji
|
|
2402
|
-
].join('|'), 'g');
|
|
2403
|
-
|
|
2404
|
-
/**
|
|
2405
|
-
* Splits a Unicode `string` into an array of its words.
|
|
2406
|
-
*
|
|
2407
|
-
* @private
|
|
2408
|
-
* @param {string} The string to inspect.
|
|
2409
|
-
* @returns {Array} Returns the words of `string`.
|
|
2410
|
-
*/
|
|
2411
|
-
function unicodeWords(string) {
|
|
2412
|
-
return string.match(reUnicodeWord) || [];
|
|
2413
|
-
}
|
|
2414
|
-
|
|
2415
|
-
var _unicodeWords = unicodeWords;
|
|
2416
|
-
|
|
2417
|
-
/**
|
|
2418
|
-
* Splits `string` into an array of its words.
|
|
2419
|
-
*
|
|
2420
|
-
* @static
|
|
2421
|
-
* @memberOf _
|
|
2422
|
-
* @since 3.0.0
|
|
2423
|
-
* @category String
|
|
2424
|
-
* @param {string} [string=''] The string to inspect.
|
|
2425
|
-
* @param {RegExp|string} [pattern] The pattern to match words.
|
|
2426
|
-
* @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
|
|
2427
|
-
* @returns {Array} Returns the words of `string`.
|
|
2428
|
-
* @example
|
|
2429
|
-
*
|
|
2430
|
-
* _.words('fred, barney, & pebbles');
|
|
2431
|
-
* // => ['fred', 'barney', 'pebbles']
|
|
2432
|
-
*
|
|
2433
|
-
* _.words('fred, barney, & pebbles', /[^, ]+/g);
|
|
2434
|
-
* // => ['fred', 'barney', '&', 'pebbles']
|
|
2435
|
-
*/
|
|
2436
|
-
function words(string, pattern, guard) {
|
|
2437
|
-
string = toString_1(string);
|
|
2438
|
-
pattern = guard ? undefined : pattern;
|
|
2439
|
-
|
|
2440
|
-
if (pattern === undefined) {
|
|
2441
|
-
return _hasUnicodeWord(string) ? _unicodeWords(string) : _asciiWords(string);
|
|
2442
|
-
}
|
|
2443
|
-
return string.match(pattern) || [];
|
|
2444
|
-
}
|
|
2445
|
-
|
|
2446
|
-
var words_1 = words;
|
|
2447
|
-
|
|
2448
|
-
/** Used to compose unicode capture groups. */
|
|
2449
|
-
var rsApos = "['\u2019]";
|
|
2450
|
-
|
|
2451
|
-
/** Used to match apostrophes. */
|
|
2452
|
-
var reApos = RegExp(rsApos, 'g');
|
|
2453
|
-
|
|
2454
|
-
/**
|
|
2455
|
-
* Creates a function like `_.camelCase`.
|
|
2456
|
-
*
|
|
2457
|
-
* @private
|
|
2458
|
-
* @param {Function} callback The function to combine each word.
|
|
2459
|
-
* @returns {Function} Returns the new compounder function.
|
|
2460
|
-
*/
|
|
2461
|
-
function createCompounder(callback) {
|
|
2462
|
-
return function(string) {
|
|
2463
|
-
return _arrayReduce(words_1(deburr_1(string).replace(reApos, '')), callback, '');
|
|
2464
|
-
};
|
|
2465
|
-
}
|
|
2466
|
-
|
|
2467
|
-
var _createCompounder = createCompounder;
|
|
2468
|
-
|
|
2469
|
-
/**
|
|
2470
|
-
* Converts `string`, as space separated words, to upper case.
|
|
2471
|
-
*
|
|
2472
|
-
* @static
|
|
2473
|
-
* @memberOf _
|
|
2474
|
-
* @since 4.0.0
|
|
2475
|
-
* @category String
|
|
2476
|
-
* @param {string} [string=''] The string to convert.
|
|
2477
|
-
* @returns {string} Returns the upper cased string.
|
|
2478
|
-
* @example
|
|
2479
|
-
*
|
|
2480
|
-
* _.upperCase('--foo-bar');
|
|
2481
|
-
* // => 'FOO BAR'
|
|
2482
|
-
*
|
|
2483
|
-
* _.upperCase('fooBar');
|
|
2484
|
-
* // => 'FOO BAR'
|
|
2485
|
-
*
|
|
2486
|
-
* _.upperCase('__foo_bar__');
|
|
2487
|
-
* // => 'FOO BAR'
|
|
2488
|
-
*/
|
|
2489
|
-
var upperCase = _createCompounder(function(result, word, index) {
|
|
2490
|
-
return result + (index ? ' ' : '') + word.toUpperCase();
|
|
2491
|
-
});
|
|
2492
|
-
|
|
2493
|
-
var upperCase_1 = upperCase;
|
|
2494
|
-
|
|
2495
|
-
/**
|
|
2496
|
-
* Converts `string`, as space separated words, to lower case.
|
|
2497
|
-
*
|
|
2498
|
-
* @static
|
|
2499
|
-
* @memberOf _
|
|
2500
|
-
* @since 4.0.0
|
|
2501
|
-
* @category String
|
|
2502
|
-
* @param {string} [string=''] The string to convert.
|
|
2503
|
-
* @returns {string} Returns the lower cased string.
|
|
2504
|
-
* @example
|
|
2505
|
-
*
|
|
2506
|
-
* _.lowerCase('--Foo-Bar--');
|
|
2507
|
-
* // => 'foo bar'
|
|
2508
|
-
*
|
|
2509
|
-
* _.lowerCase('fooBar');
|
|
2510
|
-
* // => 'foo bar'
|
|
2511
|
-
*
|
|
2512
|
-
* _.lowerCase('__FOO_BAR__');
|
|
2513
|
-
* // => 'foo bar'
|
|
2514
|
-
*/
|
|
2515
|
-
var lowerCase = _createCompounder(function(result, word, index) {
|
|
2516
|
-
return result + (index ? ' ' : '') + word.toLowerCase();
|
|
2517
|
-
});
|
|
2518
|
-
|
|
2519
|
-
var lowerCase_1 = lowerCase;
|
|
2520
|
-
|
|
2521
66
|
function truncate() {
|
|
2522
67
|
var string = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "";
|
|
2523
68
|
var limit = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 60;
|
|
@@ -2544,7 +89,7 @@ var timestampToFormat = function timestampToFormat(value, unit, suffix, timestam
|
|
|
2544
89
|
var localizedMonth = month;
|
|
2545
90
|
|
|
2546
91
|
if (isUpperCase) {
|
|
2547
|
-
localizedMonth =
|
|
92
|
+
localizedMonth = lodash.upperCase(month);
|
|
2548
93
|
}
|
|
2549
94
|
|
|
2550
95
|
var year = dateTime.getFullYear();
|
|
@@ -2557,7 +102,7 @@ var timestampToFormat = function timestampToFormat(value, unit, suffix, timestam
|
|
|
2557
102
|
var timetoShow;
|
|
2558
103
|
|
|
2559
104
|
if (localizedMonths) {
|
|
2560
|
-
localizedMonth =
|
|
105
|
+
localizedMonth = lodash.get(localizedMonths, [lodash.lowerCase(month)]) || month;
|
|
2561
106
|
}
|
|
2562
107
|
|
|
2563
108
|
if (localizedMeridiem) {
|
|
@@ -2587,17 +132,17 @@ function formatter(value, unit, suffix, date, config) {
|
|
|
2587
132
|
var showDateForUnits = ["day", "week", "month", "year"]; // suffix here refers to ago
|
|
2588
133
|
// unit here refers to seconds, minute, minutes,...
|
|
2589
134
|
|
|
2590
|
-
var localizedSuffix =
|
|
135
|
+
var localizedSuffix = lodash.get(config, ["localizedPublishTime", suffix]) || suffix;
|
|
2591
136
|
var localizedUnitOfTime;
|
|
2592
137
|
|
|
2593
138
|
if (unit === "hour" && value > 23 || showDateForUnits.indexOf(unit) !== -1) {
|
|
2594
139
|
return timestampToFormat(value, unit, suffix, date, config);
|
|
2595
140
|
} else if (value > 1) {
|
|
2596
|
-
localizedUnitOfTime =
|
|
141
|
+
localizedUnitOfTime = lodash.get(config, ["localizedPublishTime", "".concat(unit, "s")]) || "".concat(unit, "s");
|
|
2597
142
|
return "".concat(value, " ").concat(localizedUnitOfTime, " ").concat(localizedSuffix);
|
|
2598
143
|
}
|
|
2599
144
|
|
|
2600
|
-
localizedUnitOfTime =
|
|
145
|
+
localizedUnitOfTime = lodash.get(config, ["localizedPublishTime", unit]) || unit;
|
|
2601
146
|
return "".concat(value, " ").concat(localizedUnitOfTime, " ").concat(localizedSuffix, " ");
|
|
2602
147
|
}
|
|
2603
148
|
|
|
@@ -2650,10 +195,10 @@ var clientWidths = {
|
|
|
2650
195
|
tablet: 1024
|
|
2651
196
|
};
|
|
2652
197
|
var clientWidth = function clientWidth(device) {
|
|
2653
|
-
var foundDeviceWidth =
|
|
198
|
+
var foundDeviceWidth = lodash.get(clientWidths, device);
|
|
2654
199
|
|
|
2655
200
|
if (foundDeviceWidth) {
|
|
2656
|
-
return
|
|
201
|
+
return lodash.get(global, "document.documentElement.clientWidth") <= foundDeviceWidth;
|
|
2657
202
|
}
|
|
2658
203
|
|
|
2659
204
|
return false;
|
|
@@ -2695,7 +240,7 @@ var getSlug = function getSlug(collection) {
|
|
|
2695
240
|
var isSection = collection.template === "section";
|
|
2696
241
|
|
|
2697
242
|
if (isSection) {
|
|
2698
|
-
var sectionId =
|
|
243
|
+
var sectionId = lodash.get(collection, ["metadata", "section", "0", "id"], "");
|
|
2699
244
|
var sections = config.sections;
|
|
2700
245
|
var section = sections && sections.find(function (section) {
|
|
2701
246
|
return section.id === sectionId;
|
|
@@ -2711,11 +256,11 @@ function isExternalStory() {
|
|
|
2711
256
|
storyTemplate = _story$storyTemplate === void 0 ? "" : _story$storyTemplate,
|
|
2712
257
|
_story$metadata = story.metadata,
|
|
2713
258
|
metadata = _story$metadata === void 0 ? {} : _story$metadata;
|
|
2714
|
-
return storyTemplate === "news-elsewhere" ?
|
|
259
|
+
return storyTemplate === "news-elsewhere" ? lodash.get(metadata, ["reference-url"], "") : "";
|
|
2715
260
|
} // Adds target='_blank' attribute to anchor tags if not present
|
|
2716
261
|
var isEmpty = function isEmpty(value) {
|
|
2717
262
|
return value == null || // From standard.js: Always use === - but value == null is allowed to check null || undefined
|
|
2718
|
-
|
|
263
|
+
_typeof__default["default"](value) === "object" && Object.entries(value).length === 0 && value.constructor === Object || typeof value === "string" && value.trim().length === 0;
|
|
2719
264
|
};
|
|
2720
265
|
PropTypes__default["default"].shape({
|
|
2721
266
|
"sketches-host": PropTypes__default["default"].string,
|
|
@@ -2729,7 +274,7 @@ PropTypes__default["default"].shape({
|
|
|
2729
274
|
});
|
|
2730
275
|
var getStoryUrl = function getStoryUrl(story) {
|
|
2731
276
|
var defaultValue = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "";
|
|
2732
|
-
return
|
|
277
|
+
return lodash.get(story, ["story-template"]) === "news-elsewhere" ? lodash.get(story, ["metadata", "reference-url"], "") : story.url || defaultValue;
|
|
2733
278
|
};
|
|
2734
279
|
var navigateTo = function navigateTo(dispatch) {
|
|
2735
280
|
var url = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "";
|
|
@@ -3021,8 +566,8 @@ var Headline = function Headline(_ref) {
|
|
|
3021
566
|
enablePremiumStoryIcon = _premiumStoryIconConf3 === void 0 ? false : _premiumStoryIconConf3,
|
|
3022
567
|
_premiumStoryIconConf4 = premiumStoryIconConfig.showLiveIcon,
|
|
3023
568
|
showLiveIcon = _premiumStoryIconConf4 === void 0 ? false : _premiumStoryIconConf4;
|
|
3024
|
-
var alternateHeadline =
|
|
3025
|
-
var premiumStory = enablePremiumStoryIcon &&
|
|
569
|
+
var alternateHeadline = lodash.get(story, ["alternative", "home", "default", "headline"]);
|
|
570
|
+
var premiumStory = enablePremiumStoryIcon && lodash.get(story, ["access"]) === "subscription";
|
|
3026
571
|
var headline = alternateHeadline || story.headline;
|
|
3027
572
|
var HeaderTag = "h" + headerLevel;
|
|
3028
573
|
|
|
@@ -3048,10 +593,10 @@ var Headline = function Headline(_ref) {
|
|
|
3048
593
|
var textColor = getTextColor(configData.theme);
|
|
3049
594
|
var wrapperClass = premiumStory ? "wrapper" : "";
|
|
3050
595
|
var iconSize = "24px";
|
|
3051
|
-
var enableLiveIcon = showLiveIcon && story["story-template"] === "live-blog" && !
|
|
596
|
+
var enableLiveIcon = showLiveIcon && story["story-template"] === "live-blog" && !lodash.get(story, ["metadata", "is-closed"], false);
|
|
3052
597
|
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
3053
598
|
"data-test-id": "headline",
|
|
3054
|
-
className: "arrow-component arr--headline " +
|
|
599
|
+
className: "arrow-component arr--headline " + _getClassName__default["default"](wrapperClass, _styleModuleImportMap$d)
|
|
3055
600
|
}, premiumStory && /*#__PURE__*/React__default["default"].createElement(PremiumStoryIcon, {
|
|
3056
601
|
width: iconSize,
|
|
3057
602
|
height: iconSize,
|
|
@@ -3063,9 +608,9 @@ var Headline = function Headline(_ref) {
|
|
|
3063
608
|
externalLink: isExternalStory(story),
|
|
3064
609
|
"aria-label": "headline"
|
|
3065
610
|
}, /*#__PURE__*/React__default["default"].createElement(HeaderTag, {
|
|
3066
|
-
className:
|
|
611
|
+
className: _getClassName__default["default"]("headline ".concat(textColor), _styleModuleImportMap$d)
|
|
3067
612
|
}, enableLiveIcon && /*#__PURE__*/React__default["default"].createElement(LiveIcon, null), headline)) : /*#__PURE__*/React__default["default"].createElement(HeaderTag, {
|
|
3068
|
-
className:
|
|
613
|
+
className: _getClassName__default["default"]("headline ".concat(textColor), _styleModuleImportMap$d)
|
|
3069
614
|
}, enableLiveIcon && /*#__PURE__*/React__default["default"].createElement(LiveIcon, null), headline));
|
|
3070
615
|
};
|
|
3071
616
|
Headline.propTypes = {
|
|
@@ -3103,7 +648,7 @@ var Subheadline = function Subheadline(_ref) {
|
|
|
3103
648
|
forceShowAtom = _ref.forceShowAtom,
|
|
3104
649
|
showFullContent = _ref.showFullContent;
|
|
3105
650
|
var config = useStateValue() || {};
|
|
3106
|
-
var subheadline = forceShowAtom ||
|
|
651
|
+
var subheadline = forceShowAtom || lodash.get(config, ["showSubheadline"], true);
|
|
3107
652
|
if (!subheadline) return null;
|
|
3108
653
|
var textColor = getTextColor(config.theme);
|
|
3109
654
|
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
@@ -3111,7 +656,7 @@ var Subheadline = function Subheadline(_ref) {
|
|
|
3111
656
|
WebkitLineClamp: lineClamp
|
|
3112
657
|
},
|
|
3113
658
|
"data-test-id": "subheadline",
|
|
3114
|
-
className: ("p-alt arr--sub-headline arrow-component ".concat(clazzName) ? "p-alt arr--sub-headline arrow-component ".concat(clazzName) + " " : "") +
|
|
659
|
+
className: ("p-alt arr--sub-headline arrow-component ".concat(clazzName) ? "p-alt arr--sub-headline arrow-component ".concat(clazzName) + " " : "") + _getClassName__default["default"]("subheadline ".concat(textColor), _styleModuleImportMap$c)
|
|
3115
660
|
}, showFullContent || typeof lineClamp === "number" ? story.subheadline : truncate(story.subheadline, truncateChars, true));
|
|
3116
661
|
};
|
|
3117
662
|
Subheadline.propTypes = {
|
|
@@ -3146,13 +691,13 @@ var TimeStamp = function TimeStamp(_ref) {
|
|
|
3146
691
|
_ref$config = _ref.config,
|
|
3147
692
|
config = _ref$config === void 0 ? {} : _ref$config;
|
|
3148
693
|
var configState = useStateValue() || {};
|
|
3149
|
-
var isTime =
|
|
694
|
+
var isTime = lodash.get(config, ["showTime"], lodash.get(configState, ["showTime"], true));
|
|
3150
695
|
var time = story["last-published-at"] || story["first-published-at"];
|
|
3151
696
|
var isBottomClasses = isBottom ? "bottom-fix" : "";
|
|
3152
697
|
var textColor = getTextColor(configState.theme);
|
|
3153
698
|
return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, isTime && /*#__PURE__*/React__default["default"].createElement("div", {
|
|
3154
699
|
"data-test-id": "publish-time",
|
|
3155
|
-
className: "time arr--publish-time " +
|
|
700
|
+
className: "time arr--publish-time " + _getClassName__default["default"]("time ".concat(textColor, " ").concat(isBottomClasses), _styleModuleImportMap$b)
|
|
3156
701
|
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
3157
702
|
className: "timestamp-m_time-wrapper__3O2lM"
|
|
3158
703
|
}, getTimeStamp(time, formatter, config))));
|
|
@@ -3187,9 +732,9 @@ var AuthorBase = function AuthorBase(_ref) {
|
|
|
3187
732
|
_ref$config = _ref.config,
|
|
3188
733
|
config = _ref$config === void 0 ? {} : _ref$config;
|
|
3189
734
|
var configData = useStateValue() || {};
|
|
3190
|
-
var isAuthor =
|
|
735
|
+
var isAuthor = lodash.get(configData, ["showAuthor"], true);
|
|
3191
736
|
|
|
3192
|
-
var _get =
|
|
737
|
+
var _get = lodash.get(story, ["authors", "0"], ""),
|
|
3193
738
|
avatarUrl = _get["avatar-url"],
|
|
3194
739
|
avatarS3Key = _get["avatar-s3-key"],
|
|
3195
740
|
authorName = _get.name,
|
|
@@ -3197,7 +742,7 @@ var AuthorBase = function AuthorBase(_ref) {
|
|
|
3197
742
|
|
|
3198
743
|
var isBottomClasses = isBottom ? "bottom-fix" : "";
|
|
3199
744
|
var textColor = getTextColor(configData.theme);
|
|
3200
|
-
var mountAt =
|
|
745
|
+
var mountAt = lodash.get(config, ["mountAt"], "");
|
|
3201
746
|
|
|
3202
747
|
var authorImage = function authorImage(dir) {
|
|
3203
748
|
if (!avatarUrl && !avatarS3Key) {
|
|
@@ -3206,7 +751,7 @@ var AuthorBase = function AuthorBase(_ref) {
|
|
|
3206
751
|
|
|
3207
752
|
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
3208
753
|
"data-test-id": "author-image",
|
|
3209
|
-
className:
|
|
754
|
+
className: _getClassName__default["default"]("author-image ".concat(dir, "-image"), _styleModuleImportMap$a)
|
|
3210
755
|
}, /*#__PURE__*/React__default["default"].createElement("figure", null, avatarS3Key ? /*#__PURE__*/React__default["default"].createElement(components.ResponsiveImage, {
|
|
3211
756
|
slug: avatarS3Key,
|
|
3212
757
|
"aspect-ratio": [1, 1],
|
|
@@ -3223,7 +768,7 @@ var AuthorBase = function AuthorBase(_ref) {
|
|
|
3223
768
|
var isPrefix = function isPrefix(dir) {
|
|
3224
769
|
if (prefix) {
|
|
3225
770
|
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
3226
|
-
className: "arr-author-prefix " +
|
|
771
|
+
className: "arr-author-prefix " + _getClassName__default["default"]("prefix ".concat(textColor), _styleModuleImportMap$a)
|
|
3227
772
|
}, prefix);
|
|
3228
773
|
}
|
|
3229
774
|
|
|
@@ -3233,16 +778,16 @@ var AuthorBase = function AuthorBase(_ref) {
|
|
|
3233
778
|
return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, isAuthor && /*#__PURE__*/React__default["default"].createElement(components.Link, {
|
|
3234
779
|
href: "".concat(mountAt, "/author/") + slug,
|
|
3235
780
|
"aria-label": "author-name",
|
|
3236
|
-
className: "author-name arr-author-name arrow-component " +
|
|
781
|
+
className: "author-name arr-author-name arrow-component " + _getClassName__default["default"]("author ".concat(isBottomClasses), _styleModuleImportMap$a)
|
|
3237
782
|
}, isPrefix("ltr"), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
3238
783
|
"data-test-id": "author-name",
|
|
3239
|
-
className: "author-name " +
|
|
784
|
+
className: "author-name " + _getClassName__default["default"]("author-name ".concat(textColor), _styleModuleImportMap$a)
|
|
3240
785
|
}, authorName || story["author-name"]), !prefix && isPrefix("rtl")));
|
|
3241
786
|
};
|
|
3242
787
|
|
|
3243
788
|
function mapStateToProps$1(state) {
|
|
3244
789
|
return {
|
|
3245
|
-
config:
|
|
790
|
+
config: lodash.get(state, ["qt", "config"], {})
|
|
3246
791
|
};
|
|
3247
792
|
}
|
|
3248
793
|
|
|
@@ -3279,7 +824,7 @@ var Dot = function Dot(_ref) {
|
|
|
3279
824
|
_ref$color = _ref.color,
|
|
3280
825
|
color = _ref$color === void 0 ? "light" : _ref$color;
|
|
3281
826
|
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
3282
|
-
className:
|
|
827
|
+
className: _getClassName__default["default"](color, _styleModuleImportMap$9)
|
|
3283
828
|
}, /*#__PURE__*/React__default["default"].createElement("svg", {
|
|
3284
829
|
xmlns: "http://www.w3.org/2000/svg",
|
|
3285
830
|
width: width,
|
|
@@ -3315,7 +860,7 @@ var Divider = function Divider(_ref) {
|
|
|
3315
860
|
_ref$color = _ref.color,
|
|
3316
861
|
color = _ref$color === void 0 ? "light" : _ref$color;
|
|
3317
862
|
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
3318
|
-
className:
|
|
863
|
+
className: _getClassName__default["default"](color, _styleModuleImportMap$8)
|
|
3319
864
|
}, /*#__PURE__*/React__default["default"].createElement("svg", {
|
|
3320
865
|
xmlns: "http://www.w3.org/2000/svg",
|
|
3321
866
|
width: width,
|
|
@@ -3347,14 +892,14 @@ var ReadTime = function ReadTime(_ref) {
|
|
|
3347
892
|
_ref$isLightTheme = _ref.isLightTheme,
|
|
3348
893
|
isLightTheme = _ref$isLightTheme === void 0 ? false : _ref$isLightTheme;
|
|
3349
894
|
var config = useStateValue() || {};
|
|
3350
|
-
var showReadTime =
|
|
3351
|
-
var readTime =
|
|
895
|
+
var showReadTime = lodash.get(config, ["showReadTime"]) || lodash.get(opts, ["showReadTime"], true);
|
|
896
|
+
var readTime = lodash.get(story, ["read-time"], 0);
|
|
3352
897
|
var textColor = isLightTheme ? "light" : getTextColor(config.theme);
|
|
3353
898
|
if (!showReadTime || !readTime) return null;
|
|
3354
|
-
var timeToRead =
|
|
899
|
+
var timeToRead = lodash.get(opts, ["localizedTimeToRead"]) || "min read";
|
|
3355
900
|
return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
3356
901
|
"data-test-id": "read-time",
|
|
3357
|
-
className: "arrow-component arr--read-time " +
|
|
902
|
+
className: "arrow-component arr--read-time " + _getClassName__default["default"]("read-time-wrapper ".concat(textColor), _styleModuleImportMap$7)
|
|
3358
903
|
}, /*#__PURE__*/React__default["default"].createElement("span", {
|
|
3359
904
|
className: "read-time-indicator read-time-m_dot-indicator__3Sqh2"
|
|
3360
905
|
}, /*#__PURE__*/React__default["default"].createElement(Dot, {
|
|
@@ -3390,9 +935,9 @@ var AuthorWithTime = function AuthorWithTime(_ref) {
|
|
|
3390
935
|
config = _ref$config === void 0 ? {} : _ref$config,
|
|
3391
936
|
isLightTheme = _ref.isLightTheme;
|
|
3392
937
|
var configState = useStateValue() || {};
|
|
3393
|
-
var isAuthor =
|
|
3394
|
-
var isTime =
|
|
3395
|
-
var isReadTime =
|
|
938
|
+
var isAuthor = lodash.get(config, ["showAuthor"], lodash.get(configState, ["showAuthor"], true));
|
|
939
|
+
var isTime = lodash.get(config, ["showTime"], lodash.get(configState, ["showTime"], true));
|
|
940
|
+
var isReadTime = lodash.get(configState, ["showReadTime"], true);
|
|
3396
941
|
var isBottomClasses = isBottom ? "bottom-fix" : "";
|
|
3397
942
|
var seperatorStyle = separator === "dot" ? "dot" : "dash";
|
|
3398
943
|
var textColor = isLightTheme ? "light" : getTextColor(configState.theme);
|
|
@@ -3412,7 +957,7 @@ var AuthorWithTime = function AuthorWithTime(_ref) {
|
|
|
3412
957
|
var getTimeStamp = function getTimeStamp() {
|
|
3413
958
|
if (!isTime) return null;
|
|
3414
959
|
return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, isAuthor && /*#__PURE__*/React__default["default"].createElement("span", {
|
|
3415
|
-
className: "arr-separator " +
|
|
960
|
+
className: "arr-separator " + _getClassName__default["default"]("".concat(seperatorStyle), _styleModuleImportMap$6)
|
|
3416
961
|
}, getSeparator()), /*#__PURE__*/React__default["default"].createElement(TimeStamp, {
|
|
3417
962
|
story: story,
|
|
3418
963
|
config: config
|
|
@@ -3424,7 +969,7 @@ var AuthorWithTime = function AuthorWithTime(_ref) {
|
|
|
3424
969
|
};
|
|
3425
970
|
|
|
3426
971
|
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
3427
|
-
className: "arr--author-time " +
|
|
972
|
+
className: "arr--author-time " + _getClassName__default["default"]("author-time-wrapper ".concat(isBottomClasses), _styleModuleImportMap$6)
|
|
3428
973
|
}, isAuthor ? /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement(Author, {
|
|
3429
974
|
story: story,
|
|
3430
975
|
isBottom: true,
|
|
@@ -3455,67 +1000,6 @@ AuthorWithTime.defaultProps = {
|
|
|
3455
1000
|
isLightTheme: false
|
|
3456
1001
|
};
|
|
3457
1002
|
|
|
3458
|
-
function _arrayWithHoles(arr) {
|
|
3459
|
-
if (Array.isArray(arr)) return arr;
|
|
3460
|
-
}
|
|
3461
|
-
|
|
3462
|
-
function _iterableToArrayLimit(arr, i) {
|
|
3463
|
-
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
3464
|
-
|
|
3465
|
-
if (_i == null) return;
|
|
3466
|
-
var _arr = [];
|
|
3467
|
-
var _n = true;
|
|
3468
|
-
var _d = false;
|
|
3469
|
-
|
|
3470
|
-
var _s, _e;
|
|
3471
|
-
|
|
3472
|
-
try {
|
|
3473
|
-
for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {
|
|
3474
|
-
_arr.push(_s.value);
|
|
3475
|
-
|
|
3476
|
-
if (i && _arr.length === i) break;
|
|
3477
|
-
}
|
|
3478
|
-
} catch (err) {
|
|
3479
|
-
_d = true;
|
|
3480
|
-
_e = err;
|
|
3481
|
-
} finally {
|
|
3482
|
-
try {
|
|
3483
|
-
if (!_n && _i["return"] != null) _i["return"]();
|
|
3484
|
-
} finally {
|
|
3485
|
-
if (_d) throw _e;
|
|
3486
|
-
}
|
|
3487
|
-
}
|
|
3488
|
-
|
|
3489
|
-
return _arr;
|
|
3490
|
-
}
|
|
3491
|
-
|
|
3492
|
-
function _arrayLikeToArray(arr, len) {
|
|
3493
|
-
if (len == null || len > arr.length) len = arr.length;
|
|
3494
|
-
|
|
3495
|
-
for (var i = 0, arr2 = new Array(len); i < len; i++) {
|
|
3496
|
-
arr2[i] = arr[i];
|
|
3497
|
-
}
|
|
3498
|
-
|
|
3499
|
-
return arr2;
|
|
3500
|
-
}
|
|
3501
|
-
|
|
3502
|
-
function _unsupportedIterableToArray(o, minLen) {
|
|
3503
|
-
if (!o) return;
|
|
3504
|
-
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
|
|
3505
|
-
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
3506
|
-
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
3507
|
-
if (n === "Map" || n === "Set") return Array.from(o);
|
|
3508
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
|
3509
|
-
}
|
|
3510
|
-
|
|
3511
|
-
function _nonIterableRest() {
|
|
3512
|
-
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
3513
|
-
}
|
|
3514
|
-
|
|
3515
|
-
function _slicedToArray(arr, i) {
|
|
3516
|
-
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
|
|
3517
|
-
}
|
|
3518
|
-
|
|
3519
1003
|
var ImageFallbackIcon = function ImageFallbackIcon(_ref) {
|
|
3520
1004
|
var _ref$width = _ref.width,
|
|
3521
1005
|
width = _ref$width === void 0 ? 40 : _ref$width,
|
|
@@ -3656,7 +1140,7 @@ var HeroImage = function HeroImage(_ref) {
|
|
|
3656
1140
|
return null;
|
|
3657
1141
|
} : _config$StoryTemplate;
|
|
3658
1142
|
var showImagePlaceholder = reactRedux.useSelector(function (state) {
|
|
3659
|
-
return
|
|
1143
|
+
return lodash.get(state, ["qt", "config", "showPlaceholder"]);
|
|
3660
1144
|
});
|
|
3661
1145
|
var getPlaceholderStyleName = showImagePlaceholder ? "placeholder" : "";
|
|
3662
1146
|
var fullBleed = FullBleed ? "" : "with-padding";
|
|
@@ -3665,7 +1149,7 @@ var HeroImage = function HeroImage(_ref) {
|
|
|
3665
1149
|
var heroImageMobClasses = isHorizontalMobile ? "right-padding-mob" : "";
|
|
3666
1150
|
|
|
3667
1151
|
var getPadding = function getPadding(aspectRatio) {
|
|
3668
|
-
var _aspectRatio =
|
|
1152
|
+
var _aspectRatio = _slicedToArray__default["default"](aspectRatio, 2),
|
|
3669
1153
|
height = _aspectRatio[0],
|
|
3670
1154
|
width = _aspectRatio[1];
|
|
3671
1155
|
|
|
@@ -3677,7 +1161,7 @@ var HeroImage = function HeroImage(_ref) {
|
|
|
3677
1161
|
return 0;
|
|
3678
1162
|
};
|
|
3679
1163
|
|
|
3680
|
-
var _aspectRatio2 =
|
|
1164
|
+
var _aspectRatio2 = _slicedToArray__default["default"](aspectRatio, 2),
|
|
3681
1165
|
mobileAspectRatio = _aspectRatio2[0],
|
|
3682
1166
|
_aspectRatio2$ = _aspectRatio2[1],
|
|
3683
1167
|
desktopAspectRatio = _aspectRatio2$ === void 0 ? mobileAspectRatio : _aspectRatio2$;
|
|
@@ -3685,8 +1169,8 @@ var HeroImage = function HeroImage(_ref) {
|
|
|
3685
1169
|
var isMobile = clientWidth("mobile");
|
|
3686
1170
|
var imageAspectRatio = isMobile ? mobileAspectRatio : desktopAspectRatio;
|
|
3687
1171
|
var imagePadding = isMobile ? getPadding(mobileAspectRatio) : getPadding(desktopAspectRatio);
|
|
3688
|
-
var slug =
|
|
3689
|
-
var hyperLink =
|
|
1172
|
+
var slug = lodash.get(story, ["hero-image-s3-key"]) || lodash.get(story, ["alternative", "home", "default", "hero-image", "hero-image-s3-key"]);
|
|
1173
|
+
var hyperLink = lodash.get(story, ["hero-image-hyperlink"], "");
|
|
3690
1174
|
|
|
3691
1175
|
var fallbackImage = function fallbackImage() {
|
|
3692
1176
|
if (!slug) {
|
|
@@ -3695,7 +1179,7 @@ var HeroImage = function HeroImage(_ref) {
|
|
|
3695
1179
|
style: {
|
|
3696
1180
|
paddingTop: imagePadding + "%"
|
|
3697
1181
|
},
|
|
3698
|
-
className: "arr--responsive-hero-image " +
|
|
1182
|
+
className: "arr--responsive-hero-image " + _getClassName__default["default"]("image ".concat(getPlaceholderStyleName), _styleModuleImportMap$5)
|
|
3699
1183
|
}, /*#__PURE__*/React__default["default"].createElement("img", {
|
|
3700
1184
|
className: "qt-image",
|
|
3701
1185
|
"data-src": "".concat(fallbackImageUrl),
|
|
@@ -3708,7 +1192,7 @@ var HeroImage = function HeroImage(_ref) {
|
|
|
3708
1192
|
style: {
|
|
3709
1193
|
paddingTop: imagePadding + "%"
|
|
3710
1194
|
},
|
|
3711
|
-
className: "arr--fallback-hero-image " +
|
|
1195
|
+
className: "arr--fallback-hero-image " + _getClassName__default["default"]("image ".concat(getPlaceholderStyleName), _styleModuleImportMap$5)
|
|
3712
1196
|
}, /*#__PURE__*/React__default["default"].createElement(StoryTemplateIcon, {
|
|
3713
1197
|
storyTemplate: story["story-template"]
|
|
3714
1198
|
}), /*#__PURE__*/React__default["default"].createElement(FallbackImage, null)) : null);
|
|
@@ -3718,7 +1202,7 @@ var HeroImage = function HeroImage(_ref) {
|
|
|
3718
1202
|
style: {
|
|
3719
1203
|
paddingTop: imagePadding + "%"
|
|
3720
1204
|
},
|
|
3721
|
-
className: "arr--responsive-hero-image " +
|
|
1205
|
+
className: "arr--responsive-hero-image " + _getClassName__default["default"]("image ".concat(getPlaceholderStyleName), _styleModuleImportMap$5)
|
|
3722
1206
|
}, /*#__PURE__*/React__default["default"].createElement(StoryTemplateIcon, {
|
|
3723
1207
|
storyTemplate: story["story-template"]
|
|
3724
1208
|
}), /*#__PURE__*/React__default["default"].createElement(components.ResponsiveHeroImage, {
|
|
@@ -3737,13 +1221,13 @@ var HeroImage = function HeroImage(_ref) {
|
|
|
3737
1221
|
|
|
3738
1222
|
return story && (isStoryPageImage ? /*#__PURE__*/React__default["default"].createElement("div", {
|
|
3739
1223
|
"data-test-id": "arr--hero-image",
|
|
3740
|
-
className: "arr--hero-image " +
|
|
1224
|
+
className: "arr--hero-image " + _getClassName__default["default"]("".concat(heroImageClass, " ").concat(fullBleed, " ").concat(heroImageMobClasses), _styleModuleImportMap$5)
|
|
3741
1225
|
}, fallbackImage()) : /*#__PURE__*/React__default["default"].createElement(components.Link, {
|
|
3742
1226
|
"data-test-id": "arr--hero-image",
|
|
3743
1227
|
href: getStoryUrl(story, "/".concat(story.slug)),
|
|
3744
1228
|
externalLink: isExternalStory(story),
|
|
3745
1229
|
"aria-label": "fallback-hero-image",
|
|
3746
|
-
className: "arr--hero-image " +
|
|
1230
|
+
className: "arr--hero-image " + _getClassName__default["default"]("".concat(heroImageClass, " ").concat(fullBleed, " ").concat(heroImageMobClasses), _styleModuleImportMap$5)
|
|
3747
1231
|
}, fallbackImage()));
|
|
3748
1232
|
};
|
|
3749
1233
|
HeroImage.propTypes = {
|
|
@@ -3806,9 +1290,9 @@ var SectionTag = function SectionTag(_ref) {
|
|
|
3806
1290
|
borderColor = _ref$borderColor === void 0 ? "" : _ref$borderColor,
|
|
3807
1291
|
isLightTheme = _ref.isLightTheme;
|
|
3808
1292
|
var config = useStateValue() || {};
|
|
3809
|
-
var isSection =
|
|
3810
|
-
var templateFromRowContext =
|
|
3811
|
-
var section =
|
|
1293
|
+
var isSection = lodash.get(config, ["showSection"], true);
|
|
1294
|
+
var templateFromRowContext = lodash.get(config, ["sectionTagTemplate"]);
|
|
1295
|
+
var section = lodash.get(story, ["sections", 0], "");
|
|
3812
1296
|
var supportedTemplates = ["borderBottomSml", "borderLeft", "solid"];
|
|
3813
1297
|
var getUrl = section ? section["section-url"] : "/";
|
|
3814
1298
|
var colorToApplyContrast = template === "solid" || templateFromRowContext === "solid" ? borderColor : config.theme;
|
|
@@ -3830,7 +1314,7 @@ var SectionTag = function SectionTag(_ref) {
|
|
|
3830
1314
|
style: {
|
|
3831
1315
|
backgroundColor: templateStyle.includes("section-solid") ? sectionTagBorderColor : ""
|
|
3832
1316
|
},
|
|
3833
|
-
className: "section-tag arrow-component " +
|
|
1317
|
+
className: "section-tag arrow-component " + _getClassName__default["default"]("".concat(textColor, " ").concat(templateStyle), _styleModuleImportMap$4)
|
|
3834
1318
|
}, templateStyle.includes("section-borderLeft") && /*#__PURE__*/React__default["default"].createElement("span", {
|
|
3835
1319
|
className: "section-m_border-left__2oUyp",
|
|
3836
1320
|
style: {
|
|
@@ -3930,7 +1414,7 @@ var StoryCard = function StoryCard(_ref) {
|
|
|
3930
1414
|
backgroundColor: theme,
|
|
3931
1415
|
color: textColor
|
|
3932
1416
|
},
|
|
3933
|
-
className: "arr--story-card " +
|
|
1417
|
+
className: "arr--story-card " + _getClassName__default["default"]("card ".concat(horizontalCardStyle, " ").concat(borderTemplate, " ").concat(textColor, " ").concat(bgImageClasses, " ").concat(bgImgContentOverlapClass, " ").concat(horizontalMobileClasses), _styleModuleImportMap$3)
|
|
3934
1418
|
}, children || defaultStorycard);
|
|
3935
1419
|
};
|
|
3936
1420
|
|
|
@@ -3971,7 +1455,7 @@ var DefaultStoryCard = function DefaultStoryCard(_ref2) {
|
|
|
3971
1455
|
isHorizontalMobile: isHorizontalMobile,
|
|
3972
1456
|
aspectRatio: aspectRatio
|
|
3973
1457
|
}), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
3974
|
-
className: "arr--story-content " +
|
|
1458
|
+
className: "arr--story-content " + _getClassName__default["default"]("content ".concat(alignment), _styleModuleImportMap$3)
|
|
3975
1459
|
}, /*#__PURE__*/React__default["default"].createElement(SectionTag, {
|
|
3976
1460
|
story: story,
|
|
3977
1461
|
borderColor: SectionTagborderColor
|
|
@@ -4076,7 +1560,7 @@ var StorycardContent = function StorycardContent(_ref) {
|
|
|
4076
1560
|
backgroundColor: theme,
|
|
4077
1561
|
color: textColor
|
|
4078
1562
|
},
|
|
4079
|
-
className: "arr--content-wrapper " +
|
|
1563
|
+
className: "arr--content-wrapper " + _getClassName__default["default"]("wrapper ".concat(borderTemplate, " ").concat(horizontalCard), _styleModuleImportMap$2)
|
|
4080
1564
|
}, children || /*#__PURE__*/React__default["default"].createElement(DefaultStoryCardContent, {
|
|
4081
1565
|
story: story,
|
|
4082
1566
|
headerLevel: headerLevel,
|
|
@@ -4153,7 +1637,7 @@ var CollectionNameBase = function CollectionNameBase(_ref) {
|
|
|
4153
1637
|
_ref$navigate = _ref.navigate,
|
|
4154
1638
|
navigate = _ref$navigate === void 0 ? true : _ref$navigate;
|
|
4155
1639
|
var collectionTitle = useStateValue() || {};
|
|
4156
|
-
var showRowTitle =
|
|
1640
|
+
var showRowTitle = lodash.get(collectionTitle, ["showRowTitle"], true);
|
|
4157
1641
|
var supportedTemplates = ["borderLeft", "borderBottom", "crossLine", "borderBottomFull"];
|
|
4158
1642
|
var templateStyle = supportedTemplates.includes(collectionNameTemplate) ? " collection-".concat(collectionNameTemplate) : "";
|
|
4159
1643
|
var slug = navigate && collection && getSlug(collection, config) || "";
|
|
@@ -4229,7 +1713,7 @@ var CollectionNameBase = function CollectionNameBase(_ref) {
|
|
|
4229
1713
|
borderBottom: borderBottomFullStyle
|
|
4230
1714
|
},
|
|
4231
1715
|
"data-test-id": "collection-name",
|
|
4232
|
-
className: ("arr--collection-name arrow-component ".concat(templateStyle) ? "arr--collection-name arrow-component ".concat(templateStyle) + " " : "") +
|
|
1716
|
+
className: ("arr--collection-name arrow-component ".concat(templateStyle) ? "arr--collection-name arrow-component ".concat(templateStyle) + " " : "") + _getClassName__default["default"]("collection ".concat(textColor, " ").concat(templateStyle), _styleModuleImportMap$1)
|
|
4233
1717
|
}, templateStyle.includes("collection-borderLeft") && /*#__PURE__*/React__default["default"].createElement("span", {
|
|
4234
1718
|
className: "arr-collection-name-border-left collection-name-m_border-left__3_pYw",
|
|
4235
1719
|
style: {
|
|
@@ -4266,27 +1750,12 @@ CollectionNameBase.defaultProps = {
|
|
|
4266
1750
|
|
|
4267
1751
|
function mapStateToProps(state) {
|
|
4268
1752
|
return {
|
|
4269
|
-
config:
|
|
1753
|
+
config: lodash.get(state, ["qt", "config"], {})
|
|
4270
1754
|
};
|
|
4271
1755
|
}
|
|
4272
1756
|
|
|
4273
1757
|
var CollectionName = reactRedux.connect(mapStateToProps)(CollectionNameBase);
|
|
4274
1758
|
|
|
4275
|
-
function _defineProperty(obj, key, value) {
|
|
4276
|
-
if (key in obj) {
|
|
4277
|
-
Object.defineProperty(obj, key, {
|
|
4278
|
-
value: value,
|
|
4279
|
-
enumerable: true,
|
|
4280
|
-
configurable: true,
|
|
4281
|
-
writable: true
|
|
4282
|
-
});
|
|
4283
|
-
} else {
|
|
4284
|
-
obj[key] = value;
|
|
4285
|
-
}
|
|
4286
|
-
|
|
4287
|
-
return obj;
|
|
4288
|
-
}
|
|
4289
|
-
|
|
4290
1759
|
var _styleModuleImportMap = {
|
|
4291
1760
|
"./load-more.m.css": {
|
|
4292
1761
|
"button": "load-more-m_button__1mmf1",
|
|
@@ -4298,7 +1767,7 @@ var _styleModuleImportMap = {
|
|
|
4298
1767
|
|
|
4299
1768
|
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; }
|
|
4300
1769
|
|
|
4301
|
-
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) {
|
|
1770
|
+
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; }
|
|
4302
1771
|
var LoadmoreButton = function LoadmoreButton(_ref) {
|
|
4303
1772
|
var _ref$config = _ref.config,
|
|
4304
1773
|
config = _ref$config === void 0 ? {} : _ref$config,
|
|
@@ -4322,14 +1791,14 @@ var LoadmoreButton = function LoadmoreButton(_ref) {
|
|
|
4322
1791
|
return template === "SubsequentLoadCount" ? /*#__PURE__*/React__default["default"].createElement("div", {
|
|
4323
1792
|
onClick: onClick,
|
|
4324
1793
|
"data-test-id": "load-more",
|
|
4325
|
-
className: "arr--button " +
|
|
1794
|
+
className: "arr--button " + _getClassName__default["default"]("button ".concat(textColor, " default"), _styleModuleImportMap)
|
|
4326
1795
|
}, buttonText) : /*#__PURE__*/React__default["default"].createElement(components.LinkBase, {
|
|
4327
1796
|
href: slug,
|
|
4328
1797
|
navigateTo: navigate,
|
|
4329
1798
|
"data-test-id": "load-more",
|
|
4330
1799
|
"aria-label": "load-more"
|
|
4331
1800
|
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
4332
|
-
className: "arr--button " +
|
|
1801
|
+
className: "arr--button " + _getClassName__default["default"]("button ".concat(textColor, " default"), _styleModuleImportMap)
|
|
4333
1802
|
}, buttonText));
|
|
4334
1803
|
};
|
|
4335
1804
|
LoadmoreButton.propTypes = {
|
|
@@ -4384,7 +1853,7 @@ var useNearScreen = (function (_ref) {
|
|
|
4384
1853
|
var ref = _ref.ref;
|
|
4385
1854
|
|
|
4386
1855
|
var _useState = React.useState(false),
|
|
4387
|
-
_useState2 =
|
|
1856
|
+
_useState2 = _slicedToArray__default["default"](_useState, 2),
|
|
4388
1857
|
show = _useState2[0],
|
|
4389
1858
|
setShow = _useState2[1];
|
|
4390
1859
|
|
|
@@ -4514,7 +1983,7 @@ var ThreeColGridBase = function ThreeColGridBase(_ref2) {
|
|
|
4514
1983
|
var footerSlot = footerSlotConfig.footerSlot;
|
|
4515
1984
|
var footerSlotComp = footerSlot ? footerSlot() : null;
|
|
4516
1985
|
|
|
4517
|
-
var _get =
|
|
1986
|
+
var _get = lodash.get(slotConfig, [0], {}),
|
|
4518
1987
|
_get$type = _get.type,
|
|
4519
1988
|
type = _get$type === void 0 ? "" : _get$type,
|
|
4520
1989
|
component = _get.component;
|
|
@@ -4522,7 +1991,7 @@ var ThreeColGridBase = function ThreeColGridBase(_ref2) {
|
|
|
4522
1991
|
var adWidgetSlot = type === "ad" || type === "widget" ? getSlot(type, component) : null;
|
|
4523
1992
|
var dispatch = reactRedux.useDispatch();
|
|
4524
1993
|
var qtConfig = reactRedux.useSelector(function (state) {
|
|
4525
|
-
return
|
|
1994
|
+
return lodash.get(state, ["qt", "config"], {});
|
|
4526
1995
|
});
|
|
4527
1996
|
|
|
4528
1997
|
var getLoadMore = function getLoadMore(opts) {
|
|
@@ -4592,11 +2061,11 @@ var ThreeColGridBase = function ThreeColGridBase(_ref2) {
|
|
|
4592
2061
|
className: "three-col-m_wrapper__20m5m"
|
|
4593
2062
|
}, storyItems.slice(0, 2).map(function (story, index) {
|
|
4594
2063
|
return /*#__PURE__*/React__default["default"].createElement(React.Fragment, {
|
|
4595
|
-
key: "story-3col1-".concat(index, "-").concat(
|
|
2064
|
+
key: "story-3col1-".concat(index, "-").concat(lodash.get(story, ["id"], "0"))
|
|
4596
2065
|
}, storyCard(story));
|
|
4597
2066
|
}), storyItems.length < 2 && /*#__PURE__*/React__default["default"].createElement("div", null), adWidgetSlot, storyItems.slice(2).map(function (story, index) {
|
|
4598
2067
|
return /*#__PURE__*/React__default["default"].createElement(React.Fragment, {
|
|
4599
|
-
key: "story-3col1-".concat(index, "-").concat(
|
|
2068
|
+
key: "story-3col1-".concat(index, "-").concat(lodash.get(story, ["id"], "0"))
|
|
4600
2069
|
}, storyCard(story));
|
|
4601
2070
|
})), getLoadMore({
|
|
4602
2071
|
isLoading: isLoading,
|