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