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