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