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