@quintype/arrow 3.15.1-perf.2 → 3.15.1-perf.5

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 (166) hide show
  1. package/cjs/index.js +14589 -0
  2. package/package.json +1 -1
  3. package/atoms/Author/index.js +0 -2250
  4. package/atoms/Author/styles.arrow.css +0 -1
  5. package/atoms/AuthorWithTime/index.js +0 -2954
  6. package/atoms/AuthorWithTime/styles.arrow.css +0 -1
  7. package/atoms/CollectionName/index.js +0 -2334
  8. package/atoms/CollectionName/styles.arrow.css +0 -1
  9. package/atoms/ExtendedLoadMore/index-0519e570.js +0 -243
  10. package/atoms/ExtendedLoadMore/index-1256e453.js +0 -175
  11. package/atoms/ExtendedLoadMore/index-1e444d20.js +0 -990
  12. package/atoms/ExtendedLoadMore/index-4356ce04.js +0 -282
  13. package/atoms/ExtendedLoadMore/index-81eb3978.js +0 -86
  14. package/atoms/ExtendedLoadMore/index-aba6b278.js +0 -166
  15. package/atoms/ExtendedLoadMore/index-ad3c83c3.js +0 -3023
  16. package/atoms/ExtendedLoadMore/index-beed3a68.js +0 -240
  17. package/atoms/ExtendedLoadMore/index-c2f73d18.js +0 -199
  18. package/atoms/ExtendedLoadMore/index-c61a16dc.js +0 -350
  19. package/atoms/ExtendedLoadMore/index-d0f6c865.js +0 -181
  20. package/atoms/ExtendedLoadMore/index-e4cf9cb7.js +0 -223
  21. package/atoms/ExtendedLoadMore/index-fd651f70.js +0 -175
  22. package/atoms/ExtendedLoadMore/index.js +0 -5
  23. package/atoms/ExtendedLoadMore/styles.arrow.css +0 -1
  24. package/atoms/Headline/index.js +0 -2459
  25. package/atoms/Headline/styles.arrow.css +0 -1
  26. package/atoms/HeroImage/index.js +0 -2475
  27. package/atoms/HeroImage/styles.arrow.css +0 -1
  28. package/atoms/LoadmoreButton/index.js +0 -2268
  29. package/atoms/LoadmoreButton/styles.arrow.css +0 -1
  30. package/atoms/ScrollSnap/index.js +0 -2531
  31. package/atoms/ScrollSnap/styles.arrow.css +0 -1
  32. package/atoms/SectionTag/index.js +0 -2220
  33. package/atoms/SectionTag/styles.arrow.css +0 -1
  34. package/atoms/Subheadline/index.js +0 -2200
  35. package/atoms/Subheadline/styles.arrow.css +0 -1
  36. package/atoms/TimeStamp/index.js +0 -2661
  37. package/atoms/TimeStamp/styles.arrow.css +0 -1
  38. package/molecules/KeyEvents/index.js +0 -2968
  39. package/molecules/KeyEvents/styles.arrow.css +0 -1
  40. package/molecules/PageIntroductionCard/index.js +0 -2676
  41. package/molecules/PageIntroductionCard/styles.arrow.css +0 -1
  42. package/molecules/SocialShareTemplate/index.js +0 -3093
  43. package/molecules/SocialShareTemplate/styles.arrow.css +0 -1
  44. package/molecules/StoryCard/index.js +0 -3938
  45. package/molecules/StoryCard/styles.arrow.css +0 -1
  46. package/molecules/StoryElementCard/index.js +0 -5832
  47. package/molecules/StoryElementCard/styles.arrow.css +0 -1
  48. package/molecules/StorycardContent/index.js +0 -3416
  49. package/molecules/StorycardContent/styles.arrow.css +0 -1
  50. package/rows/AlternateCollectionFilter/index.js +0 -4744
  51. package/rows/AlternateCollectionFilter/styles.arrow.css +0 -1
  52. package/rows/AsideCollection/index.js +0 -4690
  53. package/rows/AsideCollection/styles.arrow.css +0 -1
  54. package/rows/AstrologyCollection/index.js +0 -4661
  55. package/rows/AstrologyCollection/styles.arrow.css +0 -1
  56. package/rows/AuthorIntroductionCard/index.js +0 -3520
  57. package/rows/AuthorIntroductionCard/styles.arrow.css +0 -1
  58. package/rows/AuthorsList/index.js +0 -3715
  59. package/rows/AuthorsList/styles.arrow.css +0 -1
  60. package/rows/CollectionFilter/index.js +0 -4834
  61. package/rows/CollectionFilter/styles.arrow.css +0 -1
  62. package/rows/ElevenStories/index.js +0 -4638
  63. package/rows/ElevenStories/styles.arrow.css +0 -1
  64. package/rows/FourColFiveStories/index.js +0 -4359
  65. package/rows/FourColFiveStories/styles.arrow.css +0 -1
  66. package/rows/FourColGrid/index.js +0 -4584
  67. package/rows/FourColGrid/styles.arrow.css +0 -1
  68. package/rows/FourColPortraitStories/index.js +0 -4617
  69. package/rows/FourColPortraitStories/styles.arrow.css +0 -1
  70. package/rows/FourColSixteenStories/index.js +0 -4375
  71. package/rows/FourColSixteenStories/styles.arrow.css +0 -1
  72. package/rows/FourColTwelveStories/index.js +0 -4335
  73. package/rows/FourColTwelveStories/styles.arrow.css +0 -1
  74. package/rows/FourStorySlider/index.js +0 -4743
  75. package/rows/FourStorySlider/styles.arrow.css +0 -1
  76. package/rows/FourStorySliderPortrait/index.js +0 -4746
  77. package/rows/FourStorySliderPortrait/styles.arrow.css +0 -1
  78. package/rows/FourTabbedBigStorySlider/index.js +0 -4505
  79. package/rows/FourTabbedBigStorySlider/styles.arrow.css +0 -1
  80. package/rows/FullScreenSlider/index.js +0 -4661
  81. package/rows/FullScreenSlider/styles.arrow.css +0 -1
  82. package/rows/HalfScreenSlider/index.js +0 -4514
  83. package/rows/HalfScreenSlider/styles.arrow.css +0 -1
  84. package/rows/ListComponent/index.js +0 -4462
  85. package/rows/ListComponent/styles.arrow.css +0 -1
  86. package/rows/Listicles/index.js +0 -3131
  87. package/rows/Listicles/styles.arrow.css +0 -1
  88. package/rows/MagazineEditions/index.js +0 -3142
  89. package/rows/MagazineEditions/styles.arrow.css +0 -1
  90. package/rows/MagazineHeaderCard/index.js +0 -3136
  91. package/rows/MagazineHeaderCard/styles.arrow.css +0 -1
  92. package/rows/MagazineWidget/index.js +0 -4514
  93. package/rows/MagazineWidget/styles.arrow.css +0 -1
  94. package/rows/OneColStoryList/index.js +0 -4670
  95. package/rows/OneColStoryList/styles.arrow.css +0 -1
  96. package/rows/OpinionCollection/index.js +0 -4037
  97. package/rows/OpinionCollection/styles.arrow.css +0 -1
  98. package/rows/SixColSixStories/index.js +0 -4515
  99. package/rows/SixColSixStories/styles.arrow.css +0 -1
  100. package/rows/StoryCollection/index.js +0 -4690
  101. package/rows/StoryCollection/styles.arrow.css +0 -1
  102. package/rows/TagIntroductionCard/index.js +0 -1901
  103. package/rows/TagIntroductionCard/styles.arrow.css +0 -1
  104. package/rows/ThreeColFlexStories/index.js +0 -4575
  105. package/rows/ThreeColFlexStories/styles.arrow.css +0 -1
  106. package/rows/ThreeColFourteenStories/index.js +0 -4283
  107. package/rows/ThreeColFourteenStories/styles.arrow.css +0 -1
  108. package/rows/ThreeColGrid/index.js +0 -4605
  109. package/rows/ThreeColGrid/styles.arrow.css +0 -1
  110. package/rows/ThreeColSevenStory/index.js +0 -4502
  111. package/rows/ThreeColSevenStory/styles.arrow.css +0 -1
  112. package/rows/ThreeColSixStories/index.js +0 -4485
  113. package/rows/ThreeColSixStories/styles.arrow.css +0 -1
  114. package/rows/ThreeColTwelveStories/index.js +0 -4380
  115. package/rows/ThreeColTwelveStories/styles.arrow.css +0 -1
  116. package/rows/TwoColFourStories/index.js +0 -4463
  117. package/rows/TwoColFourStories/styles.arrow.css +0 -1
  118. package/rows/TwoColFourStoryHighlight/index.js +0 -4456
  119. package/rows/TwoColFourStoryHighlight/styles.arrow.css +0 -1
  120. package/rows/TwoColSevenStories/index.js +0 -4490
  121. package/rows/TwoColSevenStories/styles.arrow.css +0 -1
  122. package/rows/TwoColSixStories/index.js +0 -4489
  123. package/rows/TwoColSixStories/styles.arrow.css +0 -1
  124. package/rows/TwoColTenStoriesSidebar/index.js +0 -4549
  125. package/rows/TwoColTenStoriesSidebar/styles.arrow.css +0 -1
  126. package/rows/TwoColThreeStories/index.js +0 -4436
  127. package/rows/TwoColThreeStories/styles.arrow.css +0 -1
  128. package/story-elements/AlsoRead/index.js +0 -2457
  129. package/story-elements/AlsoRead/styles.arrow.css +0 -1
  130. package/story-elements/Attachment/index.js +0 -2013
  131. package/story-elements/Attachment/styles.arrow.css +0 -1
  132. package/story-elements/BigFact/index.js +0 -1983
  133. package/story-elements/BigFact/styles.arrow.css +0 -1
  134. package/story-elements/BlockQuote/index.js +0 -2431
  135. package/story-elements/BlockQuote/styles.arrow.css +0 -1
  136. package/story-elements/Blurb/index.js +0 -2094
  137. package/story-elements/Blurb/styles.arrow.css +0 -1
  138. package/story-elements/Image/index.js +0 -2711
  139. package/story-elements/Image/styles.arrow.css +0 -1
  140. package/story-elements/ImageGallery/index.js +0 -2644
  141. package/story-elements/ImageGallery/styles.arrow.css +0 -1
  142. package/story-elements/ImageSlideshow/index.js +0 -2955
  143. package/story-elements/ImageSlideshow/styles.arrow.css +0 -1
  144. package/story-elements/QuestionAnswer/index.js +0 -2395
  145. package/story-elements/QuestionAnswer/styles.arrow.css +0 -1
  146. package/story-elements/Quote/index.js +0 -2012
  147. package/story-elements/Quote/styles.arrow.css +0 -1
  148. package/story-elements/Reference/index.js +0 -2006
  149. package/story-elements/Reference/styles.arrow.css +0 -1
  150. package/story-elements/StoryElement/index.js +0 -1779
  151. package/story-elements/Summary/index.js +0 -2036
  152. package/story-elements/Summary/styles.arrow.css +0 -1
  153. package/story-elements/Text/index.js +0 -2293
  154. package/story-elements/Text/styles.arrow.css +0 -1
  155. package/story-elements/Video/index.js +0 -1785
  156. package/story-elements/Video/styles.arrow.css +0 -1
  157. package/story-templates/ListicleStoryTemplate/index.js +0 -8442
  158. package/story-templates/ListicleStoryTemplate/styles.arrow.css +0 -1
  159. package/story-templates/LiveBlogStoryTemplate/index.js +0 -8618
  160. package/story-templates/LiveBlogStoryTemplate/styles.arrow.css +0 -1
  161. package/story-templates/PhotoStoryTemplate/index.js +0 -8420
  162. package/story-templates/PhotoStoryTemplate/styles.arrow.css +0 -1
  163. package/story-templates/TextStoryTemplate/index.js +0 -8493
  164. package/story-templates/TextStoryTemplate/styles.arrow.css +0 -1
  165. package/story-templates/VideoStoryTemplate/index.js +0 -8352
  166. package/story-templates/VideoStoryTemplate/styles.arrow.css +0 -1
@@ -1,2644 +0,0 @@
1
- import React, { useState, Suspense, lazy } from 'react';
2
- import PropTypes from 'prop-types';
3
- import { Link, ResponsiveImage } from '@quintype/components';
4
- import { useSelector } from 'react-redux';
5
- import 'react-timeago';
6
- import 'date-fns-tz';
7
-
8
- function _extends() {
9
- _extends = Object.assign || function (target) {
10
- for (var i = 1; i < arguments.length; i++) {
11
- var source = arguments[i];
12
-
13
- for (var key in source) {
14
- if (Object.prototype.hasOwnProperty.call(source, key)) {
15
- target[key] = source[key];
16
- }
17
- }
18
- }
19
-
20
- return target;
21
- };
22
-
23
- return _extends.apply(this, arguments);
24
- }
25
-
26
- function _objectWithoutPropertiesLoose(source, excluded) {
27
- if (source == null) return {};
28
- var target = {};
29
- var sourceKeys = Object.keys(source);
30
- var key, i;
31
-
32
- for (i = 0; i < sourceKeys.length; i++) {
33
- key = sourceKeys[i];
34
- if (excluded.indexOf(key) >= 0) continue;
35
- target[key] = source[key];
36
- }
37
-
38
- return target;
39
- }
40
-
41
- function _objectWithoutProperties(source, excluded) {
42
- if (source == null) return {};
43
- var target = _objectWithoutPropertiesLoose(source, excluded);
44
- var key, i;
45
-
46
- if (Object.getOwnPropertySymbols) {
47
- var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
48
-
49
- for (i = 0; i < sourceSymbolKeys.length; i++) {
50
- key = sourceSymbolKeys[i];
51
- if (excluded.indexOf(key) >= 0) continue;
52
- if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
53
- target[key] = source[key];
54
- }
55
- }
56
-
57
- return target;
58
- }
59
-
60
- var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
61
-
62
- function getDefaultExportFromCjs (x) {
63
- return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
64
- }
65
-
66
- function createCommonjsModule(fn) {
67
- var module = { exports: {} };
68
- return fn(module, module.exports), module.exports;
69
- }
70
-
71
- var optionsDefaults_1 = createCommonjsModule(function (module, exports) {
72
-
73
- Object.defineProperty(exports, "__esModule", {
74
- value: true
75
- });
76
- exports["default"] = void 0;
77
- var optionsDefaults = {
78
- attributeNames: {
79
- styleName: 'className'
80
- },
81
- generateScopedName: '[path]___[name]__[local]___[hash:base64:5]',
82
- handleMissingStyleName: 'throw'
83
- };
84
- var _default = optionsDefaults;
85
- exports["default"] = _default;
86
-
87
-
88
- });
89
-
90
- var getClassName = createCommonjsModule(function (module, exports) {
91
-
92
- Object.defineProperty(exports, "__esModule", {
93
- value: true
94
- });
95
- exports["default"] = void 0;
96
-
97
- var _optionsDefaults = _interopRequireDefault(optionsDefaults_1);
98
-
99
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
100
-
101
- var isNamespacedStyleName = function isNamespacedStyleName(styleName) {
102
- return styleName.indexOf('.') !== -1;
103
- };
104
-
105
- var handleError = function handleError(message, handleMissingStyleName) {
106
- if (handleMissingStyleName === 'throw') {
107
- throw new Error(message);
108
- } else if (handleMissingStyleName === 'warn') {
109
- // eslint-disable-next-line no-console
110
- console.warn(message);
111
- }
112
-
113
- return null;
114
- };
115
-
116
- var getClassNameForNamespacedStyleName = function getClassNameForNamespacedStyleName(styleName, styleModuleImportMap, handleMissingStyleNameOption) {
117
- // Note:
118
- // Do not use the desctructing syntax with Babel.
119
- // Desctructing adds _slicedToArray helper.
120
- var styleNameParts = styleName.split('.');
121
- var importName = styleNameParts[0];
122
- var moduleName = styleNameParts[1];
123
- var handleMissingStyleName = handleMissingStyleNameOption || _optionsDefaults["default"].handleMissingStyleName;
124
-
125
- if (!moduleName) {
126
- return handleError('Invalid style name: ' + styleName, handleMissingStyleName);
127
- }
128
-
129
- if (!styleModuleImportMap[importName]) {
130
- return handleError('CSS module import does not exist: ' + importName, handleMissingStyleName);
131
- }
132
-
133
- if (!styleModuleImportMap[importName][moduleName]) {
134
- return handleError('CSS module does not exist: ' + moduleName, handleMissingStyleName);
135
- }
136
-
137
- return styleModuleImportMap[importName][moduleName];
138
- };
139
-
140
- var getClassNameFromMultipleImports = function getClassNameFromMultipleImports(styleName, styleModuleImportMap, handleMissingStyleNameOption) {
141
- var handleMissingStyleName = handleMissingStyleNameOption || _optionsDefaults["default"].handleMissingStyleName;
142
- var importKeysWithMatches = Object.keys(styleModuleImportMap).map(function (importKey) {
143
- return styleModuleImportMap[importKey][styleName] && importKey;
144
- }).filter(function (importKey) {
145
- return importKey;
146
- });
147
-
148
- if (importKeysWithMatches.length > 1) {
149
- 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');
150
- }
151
-
152
- if (importKeysWithMatches.length === 0) {
153
- return handleError('Could not resolve the styleName \'' + styleName + '\'.', handleMissingStyleName);
154
- }
155
-
156
- return styleModuleImportMap[importKeysWithMatches[0]][styleName];
157
- };
158
-
159
- var _default = function _default(styleNameValue, styleModuleImportMap, options) {
160
- var styleModuleImportMapKeys = Object.keys(styleModuleImportMap);
161
-
162
- var _ref = options || {},
163
- _ref$handleMissingSty = _ref.handleMissingStyleName,
164
- handleMissingStyleName = _ref$handleMissingSty === void 0 ? _optionsDefaults["default"].handleMissingStyleName : _ref$handleMissingSty,
165
- _ref$autoResolveMulti = _ref.autoResolveMultipleImports,
166
- autoResolveMultipleImports = _ref$autoResolveMulti === void 0 ? _optionsDefaults["default"].autoResolveMultipleImports : _ref$autoResolveMulti;
167
-
168
- if (!styleNameValue) {
169
- return '';
170
- }
171
-
172
- return styleNameValue.split(' ').filter(function (styleName) {
173
- return styleName;
174
- }).map(function (styleName) {
175
- if (isNamespacedStyleName(styleName)) {
176
- return getClassNameForNamespacedStyleName(styleName, styleModuleImportMap, handleMissingStyleName);
177
- }
178
-
179
- if (styleModuleImportMapKeys.length === 0) {
180
- throw new Error('Cannot use styleName attribute for style name \'' + styleName + '\' without importing at least one stylesheet.');
181
- }
182
-
183
- if (styleModuleImportMapKeys.length > 1) {
184
- if (!autoResolveMultipleImports) {
185
- throw new Error('Cannot use anonymous style name \'' + styleName + '\' with more than one stylesheet import without setting \'autoResolveMultipleImports\' to true.');
186
- }
187
-
188
- return getClassNameFromMultipleImports(styleName, styleModuleImportMap, handleMissingStyleName);
189
- }
190
-
191
- var styleModuleMap = styleModuleImportMap[styleModuleImportMapKeys[0]];
192
-
193
- if (!styleModuleMap[styleName]) {
194
- return handleError('Could not resolve the styleName \'' + styleName + '\'.', handleMissingStyleName);
195
- }
196
-
197
- return styleModuleMap[styleName];
198
- }).filter(function (className) {
199
- // Remove any styles which could not be found (if handleMissingStyleName === 'ignore')
200
- return className;
201
- }).join(' ');
202
- };
203
-
204
- exports["default"] = _default;
205
-
206
-
207
- });
208
-
209
- var _getClassName = /*@__PURE__*/getDefaultExportFromCjs(getClassName);
210
-
211
- var _excluded$1 = ["element", "render"];
212
- var withElementWrapper = function withElementWrapper(StoryElement) {
213
- return function (props) {
214
- var element = props.element,
215
- render = props.render,
216
- restProps = _objectWithoutProperties(props, _excluded$1);
217
-
218
- if (!element) return null;
219
- if (render && typeof render === "function") return render(props);
220
- return /*#__PURE__*/React.createElement(StoryElement, _extends({}, restProps, {
221
- element: element
222
- }));
223
- };
224
- };
225
- withElementWrapper.propTypes = {
226
- StoryElement: PropTypes.element
227
- };
228
-
229
- function _defineProperty(obj, key, value) {
230
- if (key in obj) {
231
- Object.defineProperty(obj, key, {
232
- value: value,
233
- enumerable: true,
234
- configurable: true,
235
- writable: true
236
- });
237
- } else {
238
- obj[key] = value;
239
- }
240
-
241
- return obj;
242
- }
243
-
244
- function _arrayWithHoles(arr) {
245
- if (Array.isArray(arr)) return arr;
246
- }
247
-
248
- function _iterableToArrayLimit(arr, i) {
249
- var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
250
-
251
- if (_i == null) return;
252
- var _arr = [];
253
- var _n = true;
254
- var _d = false;
255
-
256
- var _s, _e;
257
-
258
- try {
259
- for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {
260
- _arr.push(_s.value);
261
-
262
- if (i && _arr.length === i) break;
263
- }
264
- } catch (err) {
265
- _d = true;
266
- _e = err;
267
- } finally {
268
- try {
269
- if (!_n && _i["return"] != null) _i["return"]();
270
- } finally {
271
- if (_d) throw _e;
272
- }
273
- }
274
-
275
- return _arr;
276
- }
277
-
278
- function _arrayLikeToArray(arr, len) {
279
- if (len == null || len > arr.length) len = arr.length;
280
-
281
- for (var i = 0, arr2 = new Array(len); i < len; i++) {
282
- arr2[i] = arr[i];
283
- }
284
-
285
- return arr2;
286
- }
287
-
288
- function _unsupportedIterableToArray(o, minLen) {
289
- if (!o) return;
290
- if (typeof o === "string") return _arrayLikeToArray(o, minLen);
291
- var n = Object.prototype.toString.call(o).slice(8, -1);
292
- if (n === "Object" && o.constructor) n = o.constructor.name;
293
- if (n === "Map" || n === "Set") return Array.from(o);
294
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
295
- }
296
-
297
- function _nonIterableRest() {
298
- throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
299
- }
300
-
301
- function _slicedToArray(arr, i) {
302
- return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
303
- }
304
-
305
- /**
306
- * Checks if `value` is classified as an `Array` object.
307
- *
308
- * @static
309
- * @memberOf _
310
- * @since 0.1.0
311
- * @category Lang
312
- * @param {*} value The value to check.
313
- * @returns {boolean} Returns `true` if `value` is an array, else `false`.
314
- * @example
315
- *
316
- * _.isArray([1, 2, 3]);
317
- * // => true
318
- *
319
- * _.isArray(document.body.children);
320
- * // => false
321
- *
322
- * _.isArray('abc');
323
- * // => false
324
- *
325
- * _.isArray(_.noop);
326
- * // => false
327
- */
328
- var isArray = Array.isArray;
329
-
330
- var isArray_1 = isArray;
331
-
332
- /** Detect free variable `global` from Node.js. */
333
-
334
- var freeGlobal = typeof commonjsGlobal == 'object' && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal;
335
-
336
- var _freeGlobal = freeGlobal;
337
-
338
- /** Detect free variable `self`. */
339
- var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
340
-
341
- /** Used as a reference to the global object. */
342
- var root = _freeGlobal || freeSelf || Function('return this')();
343
-
344
- var _root = root;
345
-
346
- /** Built-in value references. */
347
- var Symbol$1 = _root.Symbol;
348
-
349
- var _Symbol = Symbol$1;
350
-
351
- /** Used for built-in method references. */
352
- var objectProto$4 = Object.prototype;
353
-
354
- /** Used to check objects for own properties. */
355
- var hasOwnProperty$3 = objectProto$4.hasOwnProperty;
356
-
357
- /**
358
- * Used to resolve the
359
- * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
360
- * of values.
361
- */
362
- var nativeObjectToString$1 = objectProto$4.toString;
363
-
364
- /** Built-in value references. */
365
- var symToStringTag$1 = _Symbol ? _Symbol.toStringTag : undefined;
366
-
367
- /**
368
- * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
369
- *
370
- * @private
371
- * @param {*} value The value to query.
372
- * @returns {string} Returns the raw `toStringTag`.
373
- */
374
- function getRawTag(value) {
375
- var isOwn = hasOwnProperty$3.call(value, symToStringTag$1),
376
- tag = value[symToStringTag$1];
377
-
378
- try {
379
- value[symToStringTag$1] = undefined;
380
- var unmasked = true;
381
- } catch (e) {}
382
-
383
- var result = nativeObjectToString$1.call(value);
384
- if (unmasked) {
385
- if (isOwn) {
386
- value[symToStringTag$1] = tag;
387
- } else {
388
- delete value[symToStringTag$1];
389
- }
390
- }
391
- return result;
392
- }
393
-
394
- var _getRawTag = getRawTag;
395
-
396
- /** Used for built-in method references. */
397
- var objectProto$3 = Object.prototype;
398
-
399
- /**
400
- * Used to resolve the
401
- * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
402
- * of values.
403
- */
404
- var nativeObjectToString = objectProto$3.toString;
405
-
406
- /**
407
- * Converts `value` to a string using `Object.prototype.toString`.
408
- *
409
- * @private
410
- * @param {*} value The value to convert.
411
- * @returns {string} Returns the converted string.
412
- */
413
- function objectToString(value) {
414
- return nativeObjectToString.call(value);
415
- }
416
-
417
- var _objectToString = objectToString;
418
-
419
- /** `Object#toString` result references. */
420
- var nullTag = '[object Null]',
421
- undefinedTag = '[object Undefined]';
422
-
423
- /** Built-in value references. */
424
- var symToStringTag = _Symbol ? _Symbol.toStringTag : undefined;
425
-
426
- /**
427
- * The base implementation of `getTag` without fallbacks for buggy environments.
428
- *
429
- * @private
430
- * @param {*} value The value to query.
431
- * @returns {string} Returns the `toStringTag`.
432
- */
433
- function baseGetTag(value) {
434
- if (value == null) {
435
- return value === undefined ? undefinedTag : nullTag;
436
- }
437
- return (symToStringTag && symToStringTag in Object(value))
438
- ? _getRawTag(value)
439
- : _objectToString(value);
440
- }
441
-
442
- var _baseGetTag = baseGetTag;
443
-
444
- /**
445
- * Checks if `value` is object-like. A value is object-like if it's not `null`
446
- * and has a `typeof` result of "object".
447
- *
448
- * @static
449
- * @memberOf _
450
- * @since 4.0.0
451
- * @category Lang
452
- * @param {*} value The value to check.
453
- * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
454
- * @example
455
- *
456
- * _.isObjectLike({});
457
- * // => true
458
- *
459
- * _.isObjectLike([1, 2, 3]);
460
- * // => true
461
- *
462
- * _.isObjectLike(_.noop);
463
- * // => false
464
- *
465
- * _.isObjectLike(null);
466
- * // => false
467
- */
468
- function isObjectLike(value) {
469
- return value != null && typeof value == 'object';
470
- }
471
-
472
- var isObjectLike_1 = isObjectLike;
473
-
474
- /** `Object#toString` result references. */
475
- var symbolTag = '[object Symbol]';
476
-
477
- /**
478
- * Checks if `value` is classified as a `Symbol` primitive or object.
479
- *
480
- * @static
481
- * @memberOf _
482
- * @since 4.0.0
483
- * @category Lang
484
- * @param {*} value The value to check.
485
- * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
486
- * @example
487
- *
488
- * _.isSymbol(Symbol.iterator);
489
- * // => true
490
- *
491
- * _.isSymbol('abc');
492
- * // => false
493
- */
494
- function isSymbol(value) {
495
- return typeof value == 'symbol' ||
496
- (isObjectLike_1(value) && _baseGetTag(value) == symbolTag);
497
- }
498
-
499
- var isSymbol_1 = isSymbol;
500
-
501
- /** Used to match property names within property paths. */
502
- var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
503
- reIsPlainProp = /^\w*$/;
504
-
505
- /**
506
- * Checks if `value` is a property name and not a property path.
507
- *
508
- * @private
509
- * @param {*} value The value to check.
510
- * @param {Object} [object] The object to query keys on.
511
- * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
512
- */
513
- function isKey(value, object) {
514
- if (isArray_1(value)) {
515
- return false;
516
- }
517
- var type = typeof value;
518
- if (type == 'number' || type == 'symbol' || type == 'boolean' ||
519
- value == null || isSymbol_1(value)) {
520
- return true;
521
- }
522
- return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||
523
- (object != null && value in Object(object));
524
- }
525
-
526
- var _isKey = isKey;
527
-
528
- /**
529
- * Checks if `value` is the
530
- * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
531
- * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
532
- *
533
- * @static
534
- * @memberOf _
535
- * @since 0.1.0
536
- * @category Lang
537
- * @param {*} value The value to check.
538
- * @returns {boolean} Returns `true` if `value` is an object, else `false`.
539
- * @example
540
- *
541
- * _.isObject({});
542
- * // => true
543
- *
544
- * _.isObject([1, 2, 3]);
545
- * // => true
546
- *
547
- * _.isObject(_.noop);
548
- * // => true
549
- *
550
- * _.isObject(null);
551
- * // => false
552
- */
553
- function isObject(value) {
554
- var type = typeof value;
555
- return value != null && (type == 'object' || type == 'function');
556
- }
557
-
558
- var isObject_1 = isObject;
559
-
560
- /** `Object#toString` result references. */
561
- var asyncTag = '[object AsyncFunction]',
562
- funcTag = '[object Function]',
563
- genTag = '[object GeneratorFunction]',
564
- proxyTag = '[object Proxy]';
565
-
566
- /**
567
- * Checks if `value` is classified as a `Function` object.
568
- *
569
- * @static
570
- * @memberOf _
571
- * @since 0.1.0
572
- * @category Lang
573
- * @param {*} value The value to check.
574
- * @returns {boolean} Returns `true` if `value` is a function, else `false`.
575
- * @example
576
- *
577
- * _.isFunction(_);
578
- * // => true
579
- *
580
- * _.isFunction(/abc/);
581
- * // => false
582
- */
583
- function isFunction(value) {
584
- if (!isObject_1(value)) {
585
- return false;
586
- }
587
- // The use of `Object#toString` avoids issues with the `typeof` operator
588
- // in Safari 9 which returns 'object' for typed arrays and other constructors.
589
- var tag = _baseGetTag(value);
590
- return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
591
- }
592
-
593
- var isFunction_1 = isFunction;
594
-
595
- /** Used to detect overreaching core-js shims. */
596
- var coreJsData = _root['__core-js_shared__'];
597
-
598
- var _coreJsData = coreJsData;
599
-
600
- /** Used to detect methods masquerading as native. */
601
- var maskSrcKey = (function() {
602
- var uid = /[^.]+$/.exec(_coreJsData && _coreJsData.keys && _coreJsData.keys.IE_PROTO || '');
603
- return uid ? ('Symbol(src)_1.' + uid) : '';
604
- }());
605
-
606
- /**
607
- * Checks if `func` has its source masked.
608
- *
609
- * @private
610
- * @param {Function} func The function to check.
611
- * @returns {boolean} Returns `true` if `func` is masked, else `false`.
612
- */
613
- function isMasked(func) {
614
- return !!maskSrcKey && (maskSrcKey in func);
615
- }
616
-
617
- var _isMasked = isMasked;
618
-
619
- /** Used for built-in method references. */
620
- var funcProto$1 = Function.prototype;
621
-
622
- /** Used to resolve the decompiled source of functions. */
623
- var funcToString$1 = funcProto$1.toString;
624
-
625
- /**
626
- * Converts `func` to its source code.
627
- *
628
- * @private
629
- * @param {Function} func The function to convert.
630
- * @returns {string} Returns the source code.
631
- */
632
- function toSource(func) {
633
- if (func != null) {
634
- try {
635
- return funcToString$1.call(func);
636
- } catch (e) {}
637
- try {
638
- return (func + '');
639
- } catch (e) {}
640
- }
641
- return '';
642
- }
643
-
644
- var _toSource = toSource;
645
-
646
- /**
647
- * Used to match `RegExp`
648
- * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
649
- */
650
- var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
651
-
652
- /** Used to detect host constructors (Safari). */
653
- var reIsHostCtor = /^\[object .+?Constructor\]$/;
654
-
655
- /** Used for built-in method references. */
656
- var funcProto = Function.prototype,
657
- objectProto$2 = Object.prototype;
658
-
659
- /** Used to resolve the decompiled source of functions. */
660
- var funcToString = funcProto.toString;
661
-
662
- /** Used to check objects for own properties. */
663
- var hasOwnProperty$2 = objectProto$2.hasOwnProperty;
664
-
665
- /** Used to detect if a method is native. */
666
- var reIsNative = RegExp('^' +
667
- funcToString.call(hasOwnProperty$2).replace(reRegExpChar, '\\$&')
668
- .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
669
- );
670
-
671
- /**
672
- * The base implementation of `_.isNative` without bad shim checks.
673
- *
674
- * @private
675
- * @param {*} value The value to check.
676
- * @returns {boolean} Returns `true` if `value` is a native function,
677
- * else `false`.
678
- */
679
- function baseIsNative(value) {
680
- if (!isObject_1(value) || _isMasked(value)) {
681
- return false;
682
- }
683
- var pattern = isFunction_1(value) ? reIsNative : reIsHostCtor;
684
- return pattern.test(_toSource(value));
685
- }
686
-
687
- var _baseIsNative = baseIsNative;
688
-
689
- /**
690
- * Gets the value at `key` of `object`.
691
- *
692
- * @private
693
- * @param {Object} [object] The object to query.
694
- * @param {string} key The key of the property to get.
695
- * @returns {*} Returns the property value.
696
- */
697
- function getValue(object, key) {
698
- return object == null ? undefined : object[key];
699
- }
700
-
701
- var _getValue = getValue;
702
-
703
- /**
704
- * Gets the native function at `key` of `object`.
705
- *
706
- * @private
707
- * @param {Object} object The object to query.
708
- * @param {string} key The key of the method to get.
709
- * @returns {*} Returns the function if it's native, else `undefined`.
710
- */
711
- function getNative(object, key) {
712
- var value = _getValue(object, key);
713
- return _baseIsNative(value) ? value : undefined;
714
- }
715
-
716
- var _getNative = getNative;
717
-
718
- /* Built-in method references that are verified to be native. */
719
- var nativeCreate = _getNative(Object, 'create');
720
-
721
- var _nativeCreate = nativeCreate;
722
-
723
- /**
724
- * Removes all key-value entries from the hash.
725
- *
726
- * @private
727
- * @name clear
728
- * @memberOf Hash
729
- */
730
- function hashClear() {
731
- this.__data__ = _nativeCreate ? _nativeCreate(null) : {};
732
- this.size = 0;
733
- }
734
-
735
- var _hashClear = hashClear;
736
-
737
- /**
738
- * Removes `key` and its value from the hash.
739
- *
740
- * @private
741
- * @name delete
742
- * @memberOf Hash
743
- * @param {Object} hash The hash to modify.
744
- * @param {string} key The key of the value to remove.
745
- * @returns {boolean} Returns `true` if the entry was removed, else `false`.
746
- */
747
- function hashDelete(key) {
748
- var result = this.has(key) && delete this.__data__[key];
749
- this.size -= result ? 1 : 0;
750
- return result;
751
- }
752
-
753
- var _hashDelete = hashDelete;
754
-
755
- /** Used to stand-in for `undefined` hash values. */
756
- var HASH_UNDEFINED$1 = '__lodash_hash_undefined__';
757
-
758
- /** Used for built-in method references. */
759
- var objectProto$1 = Object.prototype;
760
-
761
- /** Used to check objects for own properties. */
762
- var hasOwnProperty$1 = objectProto$1.hasOwnProperty;
763
-
764
- /**
765
- * Gets the hash value for `key`.
766
- *
767
- * @private
768
- * @name get
769
- * @memberOf Hash
770
- * @param {string} key The key of the value to get.
771
- * @returns {*} Returns the entry value.
772
- */
773
- function hashGet(key) {
774
- var data = this.__data__;
775
- if (_nativeCreate) {
776
- var result = data[key];
777
- return result === HASH_UNDEFINED$1 ? undefined : result;
778
- }
779
- return hasOwnProperty$1.call(data, key) ? data[key] : undefined;
780
- }
781
-
782
- var _hashGet = hashGet;
783
-
784
- /** Used for built-in method references. */
785
- var objectProto = Object.prototype;
786
-
787
- /** Used to check objects for own properties. */
788
- var hasOwnProperty = objectProto.hasOwnProperty;
789
-
790
- /**
791
- * Checks if a hash value for `key` exists.
792
- *
793
- * @private
794
- * @name has
795
- * @memberOf Hash
796
- * @param {string} key The key of the entry to check.
797
- * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
798
- */
799
- function hashHas(key) {
800
- var data = this.__data__;
801
- return _nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);
802
- }
803
-
804
- var _hashHas = hashHas;
805
-
806
- /** Used to stand-in for `undefined` hash values. */
807
- var HASH_UNDEFINED = '__lodash_hash_undefined__';
808
-
809
- /**
810
- * Sets the hash `key` to `value`.
811
- *
812
- * @private
813
- * @name set
814
- * @memberOf Hash
815
- * @param {string} key The key of the value to set.
816
- * @param {*} value The value to set.
817
- * @returns {Object} Returns the hash instance.
818
- */
819
- function hashSet(key, value) {
820
- var data = this.__data__;
821
- this.size += this.has(key) ? 0 : 1;
822
- data[key] = (_nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
823
- return this;
824
- }
825
-
826
- var _hashSet = hashSet;
827
-
828
- /**
829
- * Creates a hash object.
830
- *
831
- * @private
832
- * @constructor
833
- * @param {Array} [entries] The key-value pairs to cache.
834
- */
835
- function Hash(entries) {
836
- var index = -1,
837
- length = entries == null ? 0 : entries.length;
838
-
839
- this.clear();
840
- while (++index < length) {
841
- var entry = entries[index];
842
- this.set(entry[0], entry[1]);
843
- }
844
- }
845
-
846
- // Add methods to `Hash`.
847
- Hash.prototype.clear = _hashClear;
848
- Hash.prototype['delete'] = _hashDelete;
849
- Hash.prototype.get = _hashGet;
850
- Hash.prototype.has = _hashHas;
851
- Hash.prototype.set = _hashSet;
852
-
853
- var _Hash = Hash;
854
-
855
- /**
856
- * Removes all key-value entries from the list cache.
857
- *
858
- * @private
859
- * @name clear
860
- * @memberOf ListCache
861
- */
862
- function listCacheClear() {
863
- this.__data__ = [];
864
- this.size = 0;
865
- }
866
-
867
- var _listCacheClear = listCacheClear;
868
-
869
- /**
870
- * Performs a
871
- * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
872
- * comparison between two values to determine if they are equivalent.
873
- *
874
- * @static
875
- * @memberOf _
876
- * @since 4.0.0
877
- * @category Lang
878
- * @param {*} value The value to compare.
879
- * @param {*} other The other value to compare.
880
- * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
881
- * @example
882
- *
883
- * var object = { 'a': 1 };
884
- * var other = { 'a': 1 };
885
- *
886
- * _.eq(object, object);
887
- * // => true
888
- *
889
- * _.eq(object, other);
890
- * // => false
891
- *
892
- * _.eq('a', 'a');
893
- * // => true
894
- *
895
- * _.eq('a', Object('a'));
896
- * // => false
897
- *
898
- * _.eq(NaN, NaN);
899
- * // => true
900
- */
901
- function eq(value, other) {
902
- return value === other || (value !== value && other !== other);
903
- }
904
-
905
- var eq_1 = eq;
906
-
907
- /**
908
- * Gets the index at which the `key` is found in `array` of key-value pairs.
909
- *
910
- * @private
911
- * @param {Array} array The array to inspect.
912
- * @param {*} key The key to search for.
913
- * @returns {number} Returns the index of the matched value, else `-1`.
914
- */
915
- function assocIndexOf(array, key) {
916
- var length = array.length;
917
- while (length--) {
918
- if (eq_1(array[length][0], key)) {
919
- return length;
920
- }
921
- }
922
- return -1;
923
- }
924
-
925
- var _assocIndexOf = assocIndexOf;
926
-
927
- /** Used for built-in method references. */
928
- var arrayProto = Array.prototype;
929
-
930
- /** Built-in value references. */
931
- var splice = arrayProto.splice;
932
-
933
- /**
934
- * Removes `key` and its value from the list cache.
935
- *
936
- * @private
937
- * @name delete
938
- * @memberOf ListCache
939
- * @param {string} key The key of the value to remove.
940
- * @returns {boolean} Returns `true` if the entry was removed, else `false`.
941
- */
942
- function listCacheDelete(key) {
943
- var data = this.__data__,
944
- index = _assocIndexOf(data, key);
945
-
946
- if (index < 0) {
947
- return false;
948
- }
949
- var lastIndex = data.length - 1;
950
- if (index == lastIndex) {
951
- data.pop();
952
- } else {
953
- splice.call(data, index, 1);
954
- }
955
- --this.size;
956
- return true;
957
- }
958
-
959
- var _listCacheDelete = listCacheDelete;
960
-
961
- /**
962
- * Gets the list cache value for `key`.
963
- *
964
- * @private
965
- * @name get
966
- * @memberOf ListCache
967
- * @param {string} key The key of the value to get.
968
- * @returns {*} Returns the entry value.
969
- */
970
- function listCacheGet(key) {
971
- var data = this.__data__,
972
- index = _assocIndexOf(data, key);
973
-
974
- return index < 0 ? undefined : data[index][1];
975
- }
976
-
977
- var _listCacheGet = listCacheGet;
978
-
979
- /**
980
- * Checks if a list cache value for `key` exists.
981
- *
982
- * @private
983
- * @name has
984
- * @memberOf ListCache
985
- * @param {string} key The key of the entry to check.
986
- * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
987
- */
988
- function listCacheHas(key) {
989
- return _assocIndexOf(this.__data__, key) > -1;
990
- }
991
-
992
- var _listCacheHas = listCacheHas;
993
-
994
- /**
995
- * Sets the list cache `key` to `value`.
996
- *
997
- * @private
998
- * @name set
999
- * @memberOf ListCache
1000
- * @param {string} key The key of the value to set.
1001
- * @param {*} value The value to set.
1002
- * @returns {Object} Returns the list cache instance.
1003
- */
1004
- function listCacheSet(key, value) {
1005
- var data = this.__data__,
1006
- index = _assocIndexOf(data, key);
1007
-
1008
- if (index < 0) {
1009
- ++this.size;
1010
- data.push([key, value]);
1011
- } else {
1012
- data[index][1] = value;
1013
- }
1014
- return this;
1015
- }
1016
-
1017
- var _listCacheSet = listCacheSet;
1018
-
1019
- /**
1020
- * Creates an list cache object.
1021
- *
1022
- * @private
1023
- * @constructor
1024
- * @param {Array} [entries] The key-value pairs to cache.
1025
- */
1026
- function ListCache(entries) {
1027
- var index = -1,
1028
- length = entries == null ? 0 : entries.length;
1029
-
1030
- this.clear();
1031
- while (++index < length) {
1032
- var entry = entries[index];
1033
- this.set(entry[0], entry[1]);
1034
- }
1035
- }
1036
-
1037
- // Add methods to `ListCache`.
1038
- ListCache.prototype.clear = _listCacheClear;
1039
- ListCache.prototype['delete'] = _listCacheDelete;
1040
- ListCache.prototype.get = _listCacheGet;
1041
- ListCache.prototype.has = _listCacheHas;
1042
- ListCache.prototype.set = _listCacheSet;
1043
-
1044
- var _ListCache = ListCache;
1045
-
1046
- /* Built-in method references that are verified to be native. */
1047
- var Map = _getNative(_root, 'Map');
1048
-
1049
- var _Map = Map;
1050
-
1051
- /**
1052
- * Removes all key-value entries from the map.
1053
- *
1054
- * @private
1055
- * @name clear
1056
- * @memberOf MapCache
1057
- */
1058
- function mapCacheClear() {
1059
- this.size = 0;
1060
- this.__data__ = {
1061
- 'hash': new _Hash,
1062
- 'map': new (_Map || _ListCache),
1063
- 'string': new _Hash
1064
- };
1065
- }
1066
-
1067
- var _mapCacheClear = mapCacheClear;
1068
-
1069
- /**
1070
- * Checks if `value` is suitable for use as unique object key.
1071
- *
1072
- * @private
1073
- * @param {*} value The value to check.
1074
- * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
1075
- */
1076
- function isKeyable(value) {
1077
- var type = typeof value;
1078
- return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
1079
- ? (value !== '__proto__')
1080
- : (value === null);
1081
- }
1082
-
1083
- var _isKeyable = isKeyable;
1084
-
1085
- /**
1086
- * Gets the data for `map`.
1087
- *
1088
- * @private
1089
- * @param {Object} map The map to query.
1090
- * @param {string} key The reference key.
1091
- * @returns {*} Returns the map data.
1092
- */
1093
- function getMapData(map, key) {
1094
- var data = map.__data__;
1095
- return _isKeyable(key)
1096
- ? data[typeof key == 'string' ? 'string' : 'hash']
1097
- : data.map;
1098
- }
1099
-
1100
- var _getMapData = getMapData;
1101
-
1102
- /**
1103
- * Removes `key` and its value from the map.
1104
- *
1105
- * @private
1106
- * @name delete
1107
- * @memberOf MapCache
1108
- * @param {string} key The key of the value to remove.
1109
- * @returns {boolean} Returns `true` if the entry was removed, else `false`.
1110
- */
1111
- function mapCacheDelete(key) {
1112
- var result = _getMapData(this, key)['delete'](key);
1113
- this.size -= result ? 1 : 0;
1114
- return result;
1115
- }
1116
-
1117
- var _mapCacheDelete = mapCacheDelete;
1118
-
1119
- /**
1120
- * Gets the map value for `key`.
1121
- *
1122
- * @private
1123
- * @name get
1124
- * @memberOf MapCache
1125
- * @param {string} key The key of the value to get.
1126
- * @returns {*} Returns the entry value.
1127
- */
1128
- function mapCacheGet(key) {
1129
- return _getMapData(this, key).get(key);
1130
- }
1131
-
1132
- var _mapCacheGet = mapCacheGet;
1133
-
1134
- /**
1135
- * Checks if a map value for `key` exists.
1136
- *
1137
- * @private
1138
- * @name has
1139
- * @memberOf MapCache
1140
- * @param {string} key The key of the entry to check.
1141
- * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
1142
- */
1143
- function mapCacheHas(key) {
1144
- return _getMapData(this, key).has(key);
1145
- }
1146
-
1147
- var _mapCacheHas = mapCacheHas;
1148
-
1149
- /**
1150
- * Sets the map `key` to `value`.
1151
- *
1152
- * @private
1153
- * @name set
1154
- * @memberOf MapCache
1155
- * @param {string} key The key of the value to set.
1156
- * @param {*} value The value to set.
1157
- * @returns {Object} Returns the map cache instance.
1158
- */
1159
- function mapCacheSet(key, value) {
1160
- var data = _getMapData(this, key),
1161
- size = data.size;
1162
-
1163
- data.set(key, value);
1164
- this.size += data.size == size ? 0 : 1;
1165
- return this;
1166
- }
1167
-
1168
- var _mapCacheSet = mapCacheSet;
1169
-
1170
- /**
1171
- * Creates a map cache object to store key-value pairs.
1172
- *
1173
- * @private
1174
- * @constructor
1175
- * @param {Array} [entries] The key-value pairs to cache.
1176
- */
1177
- function MapCache(entries) {
1178
- var index = -1,
1179
- length = entries == null ? 0 : entries.length;
1180
-
1181
- this.clear();
1182
- while (++index < length) {
1183
- var entry = entries[index];
1184
- this.set(entry[0], entry[1]);
1185
- }
1186
- }
1187
-
1188
- // Add methods to `MapCache`.
1189
- MapCache.prototype.clear = _mapCacheClear;
1190
- MapCache.prototype['delete'] = _mapCacheDelete;
1191
- MapCache.prototype.get = _mapCacheGet;
1192
- MapCache.prototype.has = _mapCacheHas;
1193
- MapCache.prototype.set = _mapCacheSet;
1194
-
1195
- var _MapCache = MapCache;
1196
-
1197
- /** Error message constants. */
1198
- var FUNC_ERROR_TEXT = 'Expected a function';
1199
-
1200
- /**
1201
- * Creates a function that memoizes the result of `func`. If `resolver` is
1202
- * provided, it determines the cache key for storing the result based on the
1203
- * arguments provided to the memoized function. By default, the first argument
1204
- * provided to the memoized function is used as the map cache key. The `func`
1205
- * is invoked with the `this` binding of the memoized function.
1206
- *
1207
- * **Note:** The cache is exposed as the `cache` property on the memoized
1208
- * function. Its creation may be customized by replacing the `_.memoize.Cache`
1209
- * constructor with one whose instances implement the
1210
- * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
1211
- * method interface of `clear`, `delete`, `get`, `has`, and `set`.
1212
- *
1213
- * @static
1214
- * @memberOf _
1215
- * @since 0.1.0
1216
- * @category Function
1217
- * @param {Function} func The function to have its output memoized.
1218
- * @param {Function} [resolver] The function to resolve the cache key.
1219
- * @returns {Function} Returns the new memoized function.
1220
- * @example
1221
- *
1222
- * var object = { 'a': 1, 'b': 2 };
1223
- * var other = { 'c': 3, 'd': 4 };
1224
- *
1225
- * var values = _.memoize(_.values);
1226
- * values(object);
1227
- * // => [1, 2]
1228
- *
1229
- * values(other);
1230
- * // => [3, 4]
1231
- *
1232
- * object.a = 2;
1233
- * values(object);
1234
- * // => [1, 2]
1235
- *
1236
- * // Modify the result cache.
1237
- * values.cache.set(object, ['a', 'b']);
1238
- * values(object);
1239
- * // => ['a', 'b']
1240
- *
1241
- * // Replace `_.memoize.Cache`.
1242
- * _.memoize.Cache = WeakMap;
1243
- */
1244
- function memoize(func, resolver) {
1245
- if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) {
1246
- throw new TypeError(FUNC_ERROR_TEXT);
1247
- }
1248
- var memoized = function() {
1249
- var args = arguments,
1250
- key = resolver ? resolver.apply(this, args) : args[0],
1251
- cache = memoized.cache;
1252
-
1253
- if (cache.has(key)) {
1254
- return cache.get(key);
1255
- }
1256
- var result = func.apply(this, args);
1257
- memoized.cache = cache.set(key, result) || cache;
1258
- return result;
1259
- };
1260
- memoized.cache = new (memoize.Cache || _MapCache);
1261
- return memoized;
1262
- }
1263
-
1264
- // Expose `MapCache`.
1265
- memoize.Cache = _MapCache;
1266
-
1267
- var memoize_1 = memoize;
1268
-
1269
- /** Used as the maximum memoize cache size. */
1270
- var MAX_MEMOIZE_SIZE = 500;
1271
-
1272
- /**
1273
- * A specialized version of `_.memoize` which clears the memoized function's
1274
- * cache when it exceeds `MAX_MEMOIZE_SIZE`.
1275
- *
1276
- * @private
1277
- * @param {Function} func The function to have its output memoized.
1278
- * @returns {Function} Returns the new memoized function.
1279
- */
1280
- function memoizeCapped(func) {
1281
- var result = memoize_1(func, function(key) {
1282
- if (cache.size === MAX_MEMOIZE_SIZE) {
1283
- cache.clear();
1284
- }
1285
- return key;
1286
- });
1287
-
1288
- var cache = result.cache;
1289
- return result;
1290
- }
1291
-
1292
- var _memoizeCapped = memoizeCapped;
1293
-
1294
- /** Used to match property names within property paths. */
1295
- var rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
1296
-
1297
- /** Used to match backslashes in property paths. */
1298
- var reEscapeChar = /\\(\\)?/g;
1299
-
1300
- /**
1301
- * Converts `string` to a property path array.
1302
- *
1303
- * @private
1304
- * @param {string} string The string to convert.
1305
- * @returns {Array} Returns the property path array.
1306
- */
1307
- var stringToPath = _memoizeCapped(function(string) {
1308
- var result = [];
1309
- if (string.charCodeAt(0) === 46 /* . */) {
1310
- result.push('');
1311
- }
1312
- string.replace(rePropName, function(match, number, quote, subString) {
1313
- result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match));
1314
- });
1315
- return result;
1316
- });
1317
-
1318
- var _stringToPath = stringToPath;
1319
-
1320
- /**
1321
- * A specialized version of `_.map` for arrays without support for iteratee
1322
- * shorthands.
1323
- *
1324
- * @private
1325
- * @param {Array} [array] The array to iterate over.
1326
- * @param {Function} iteratee The function invoked per iteration.
1327
- * @returns {Array} Returns the new mapped array.
1328
- */
1329
- function arrayMap(array, iteratee) {
1330
- var index = -1,
1331
- length = array == null ? 0 : array.length,
1332
- result = Array(length);
1333
-
1334
- while (++index < length) {
1335
- result[index] = iteratee(array[index], index, array);
1336
- }
1337
- return result;
1338
- }
1339
-
1340
- var _arrayMap = arrayMap;
1341
-
1342
- /** Used as references for various `Number` constants. */
1343
- var INFINITY$1 = 1 / 0;
1344
-
1345
- /** Used to convert symbols to primitives and strings. */
1346
- var symbolProto = _Symbol ? _Symbol.prototype : undefined,
1347
- symbolToString = symbolProto ? symbolProto.toString : undefined;
1348
-
1349
- /**
1350
- * The base implementation of `_.toString` which doesn't convert nullish
1351
- * values to empty strings.
1352
- *
1353
- * @private
1354
- * @param {*} value The value to process.
1355
- * @returns {string} Returns the string.
1356
- */
1357
- function baseToString(value) {
1358
- // Exit early for strings to avoid a performance hit in some environments.
1359
- if (typeof value == 'string') {
1360
- return value;
1361
- }
1362
- if (isArray_1(value)) {
1363
- // Recursively convert values (susceptible to call stack limits).
1364
- return _arrayMap(value, baseToString) + '';
1365
- }
1366
- if (isSymbol_1(value)) {
1367
- return symbolToString ? symbolToString.call(value) : '';
1368
- }
1369
- var result = (value + '');
1370
- return (result == '0' && (1 / value) == -INFINITY$1) ? '-0' : result;
1371
- }
1372
-
1373
- var _baseToString = baseToString;
1374
-
1375
- /**
1376
- * Converts `value` to a string. An empty string is returned for `null`
1377
- * and `undefined` values. The sign of `-0` is preserved.
1378
- *
1379
- * @static
1380
- * @memberOf _
1381
- * @since 4.0.0
1382
- * @category Lang
1383
- * @param {*} value The value to convert.
1384
- * @returns {string} Returns the converted string.
1385
- * @example
1386
- *
1387
- * _.toString(null);
1388
- * // => ''
1389
- *
1390
- * _.toString(-0);
1391
- * // => '-0'
1392
- *
1393
- * _.toString([1, 2, 3]);
1394
- * // => '1,2,3'
1395
- */
1396
- function toString(value) {
1397
- return value == null ? '' : _baseToString(value);
1398
- }
1399
-
1400
- var toString_1 = toString;
1401
-
1402
- /**
1403
- * Casts `value` to a path array if it's not one.
1404
- *
1405
- * @private
1406
- * @param {*} value The value to inspect.
1407
- * @param {Object} [object] The object to query keys on.
1408
- * @returns {Array} Returns the cast property path array.
1409
- */
1410
- function castPath(value, object) {
1411
- if (isArray_1(value)) {
1412
- return value;
1413
- }
1414
- return _isKey(value, object) ? [value] : _stringToPath(toString_1(value));
1415
- }
1416
-
1417
- var _castPath = castPath;
1418
-
1419
- /** Used as references for various `Number` constants. */
1420
- var INFINITY = 1 / 0;
1421
-
1422
- /**
1423
- * Converts `value` to a string key if it's not a string or symbol.
1424
- *
1425
- * @private
1426
- * @param {*} value The value to inspect.
1427
- * @returns {string|symbol} Returns the key.
1428
- */
1429
- function toKey(value) {
1430
- if (typeof value == 'string' || isSymbol_1(value)) {
1431
- return value;
1432
- }
1433
- var result = (value + '');
1434
- return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
1435
- }
1436
-
1437
- var _toKey = toKey;
1438
-
1439
- /**
1440
- * The base implementation of `_.get` without support for default values.
1441
- *
1442
- * @private
1443
- * @param {Object} object The object to query.
1444
- * @param {Array|string} path The path of the property to get.
1445
- * @returns {*} Returns the resolved value.
1446
- */
1447
- function baseGet(object, path) {
1448
- path = _castPath(path, object);
1449
-
1450
- var index = 0,
1451
- length = path.length;
1452
-
1453
- while (object != null && index < length) {
1454
- object = object[_toKey(path[index++])];
1455
- }
1456
- return (index && index == length) ? object : undefined;
1457
- }
1458
-
1459
- var _baseGet = baseGet;
1460
-
1461
- /**
1462
- * Gets the value at `path` of `object`. If the resolved value is
1463
- * `undefined`, the `defaultValue` is returned in its place.
1464
- *
1465
- * @static
1466
- * @memberOf _
1467
- * @since 3.7.0
1468
- * @category Object
1469
- * @param {Object} object The object to query.
1470
- * @param {Array|string} path The path of the property to get.
1471
- * @param {*} [defaultValue] The value returned for `undefined` resolved values.
1472
- * @returns {*} Returns the resolved value.
1473
- * @example
1474
- *
1475
- * var object = { 'a': [{ 'b': { 'c': 3 } }] };
1476
- *
1477
- * _.get(object, 'a[0].b.c');
1478
- * // => 3
1479
- *
1480
- * _.get(object, ['a', '0', 'b', 'c']);
1481
- * // => 3
1482
- *
1483
- * _.get(object, 'a.b.c', 'default');
1484
- * // => 'default'
1485
- */
1486
- function get(object, path, defaultValue) {
1487
- var result = object == null ? undefined : _baseGet(object, path);
1488
- return result === undefined ? defaultValue : result;
1489
- }
1490
-
1491
- var get_1 = get;
1492
-
1493
- var Loading = function Loading(_ref) {
1494
- _ref.width;
1495
- _ref.height;
1496
- _ref.iconColor;
1497
- return /*#__PURE__*/React.createElement("div", {
1498
- className: "loading-m_loading-indicator__2Dlst"
1499
- }, /*#__PURE__*/React.createElement("svg", {
1500
- width: "40",
1501
- height: "40",
1502
- xmlns: "http://www.w3.org/2000/svg",
1503
- viewBox: "0 0 100 100",
1504
- preserveAspectRatio: "xMidYMid"
1505
- }, /*#__PURE__*/React.createElement("circle", {
1506
- cx: "84",
1507
- cy: "50",
1508
- r: "0",
1509
- fill: "currentColor"
1510
- }, /*#__PURE__*/React.createElement("animate", {
1511
- attributeName: "r",
1512
- values: "10;0;0;0;0",
1513
- keyTimes: "0;0.25;0.5;0.75;1",
1514
- keySplines: "0 0.5 0.5 1;0 0.5 0.5 1;0 0.5 0.5 1;0 0.5 0.5 1",
1515
- calcMode: "spline",
1516
- dur: "2s",
1517
- repeatCount: "indefinite",
1518
- begin: "0s"
1519
- }), /*#__PURE__*/React.createElement("animate", {
1520
- attributeName: "cx",
1521
- values: "84;84;84;84;84",
1522
- keyTimes: "0;0.25;0.5;0.75;1",
1523
- keySplines: "0 0.5 0.5 1;0 0.5 0.5 1;0 0.5 0.5 1;0 0.5 0.5 1",
1524
- calcMode: "spline",
1525
- dur: "2s",
1526
- repeatCount: "indefinite",
1527
- begin: "0s"
1528
- })), /*#__PURE__*/React.createElement("circle", {
1529
- cx: "84",
1530
- cy: "50",
1531
- r: ".709",
1532
- fill: "currentColor"
1533
- }, /*#__PURE__*/React.createElement("animate", {
1534
- attributeName: "r",
1535
- values: "0;10;10;10;0",
1536
- keyTimes: "0;0.25;0.5;0.75;1",
1537
- keySplines: "0 0.5 0.5 1;0 0.5 0.5 1;0 0.5 0.5 1;0 0.5 0.5 1",
1538
- calcMode: "spline",
1539
- dur: "2s",
1540
- repeatCount: "indefinite",
1541
- begin: "-1s"
1542
- }), /*#__PURE__*/React.createElement("animate", {
1543
- attributeName: "cx",
1544
- values: "16;16;50;84;84",
1545
- keyTimes: "0;0.25;0.5;0.75;1",
1546
- keySplines: "0 0.5 0.5 1;0 0.5 0.5 1;0 0.5 0.5 1;0 0.5 0.5 1",
1547
- calcMode: "spline",
1548
- dur: "2s",
1549
- repeatCount: "indefinite",
1550
- begin: "-1s"
1551
- })), /*#__PURE__*/React.createElement("circle", {
1552
- cx: "81.59",
1553
- cy: "50",
1554
- r: "10",
1555
- fill: "currentColor"
1556
- }, /*#__PURE__*/React.createElement("animate", {
1557
- attributeName: "r",
1558
- values: "0;10;10;10;0",
1559
- keyTimes: "0;0.25;0.5;0.75;1",
1560
- keySplines: "0 0.5 0.5 1;0 0.5 0.5 1;0 0.5 0.5 1;0 0.5 0.5 1",
1561
- calcMode: "spline",
1562
- dur: "2s",
1563
- repeatCount: "indefinite",
1564
- begin: "-0.5s"
1565
- }), /*#__PURE__*/React.createElement("animate", {
1566
- attributeName: "cx",
1567
- values: "16;16;50;84;84",
1568
- keyTimes: "0;0.25;0.5;0.75;1",
1569
- keySplines: "0 0.5 0.5 1;0 0.5 0.5 1;0 0.5 0.5 1;0 0.5 0.5 1",
1570
- calcMode: "spline",
1571
- dur: "2s",
1572
- repeatCount: "indefinite",
1573
- begin: "-0.5s"
1574
- })), /*#__PURE__*/React.createElement("circle", {
1575
- cx: "47.59",
1576
- cy: "50",
1577
- r: "10",
1578
- fill: "currentColor"
1579
- }, /*#__PURE__*/React.createElement("animate", {
1580
- attributeName: "r",
1581
- values: "0;10;10;10;0",
1582
- keyTimes: "0;0.25;0.5;0.75;1",
1583
- keySplines: "0 0.5 0.5 1;0 0.5 0.5 1;0 0.5 0.5 1;0 0.5 0.5 1",
1584
- calcMode: "spline",
1585
- dur: "2s",
1586
- repeatCount: "indefinite",
1587
- begin: "0s"
1588
- }), /*#__PURE__*/React.createElement("animate", {
1589
- attributeName: "cx",
1590
- values: "16;16;50;84;84",
1591
- keyTimes: "0;0.25;0.5;0.75;1",
1592
- keySplines: "0 0.5 0.5 1;0 0.5 0.5 1;0 0.5 0.5 1;0 0.5 0.5 1",
1593
- calcMode: "spline",
1594
- dur: "2s",
1595
- repeatCount: "indefinite",
1596
- begin: "0s"
1597
- })), /*#__PURE__*/React.createElement("circle", {
1598
- cx: "16",
1599
- cy: "50",
1600
- r: "9.291",
1601
- fill: "currentColor"
1602
- }, /*#__PURE__*/React.createElement("animate", {
1603
- attributeName: "r",
1604
- values: "0;0;10;10;10",
1605
- keyTimes: "0;0.25;0.5;0.75;1",
1606
- keySplines: "0 0.5 0.5 1;0 0.5 0.5 1;0 0.5 0.5 1;0 0.5 0.5 1",
1607
- calcMode: "spline",
1608
- dur: "2s",
1609
- repeatCount: "indefinite",
1610
- begin: "0s"
1611
- }), /*#__PURE__*/React.createElement("animate", {
1612
- attributeName: "cx",
1613
- values: "16;16;16;50;84",
1614
- keyTimes: "0;0.25;0.5;0.75;1",
1615
- keySplines: "0 0.5 0.5 1;0 0.5 0.5 1;0 0.5 0.5 1;0 0.5 0.5 1",
1616
- calcMode: "spline",
1617
- dur: "2s",
1618
- repeatCount: "indefinite",
1619
- begin: "0s"
1620
- }))));
1621
- };
1622
- Loading.propTypes = {
1623
- width: PropTypes.object,
1624
- height: PropTypes.object,
1625
- iconColor: PropTypes.object
1626
- };
1627
-
1628
- var HyperLinkIcon = function HyperLinkIcon() {
1629
- return /*#__PURE__*/React.createElement("svg", {
1630
- xmlns: "http://www.w3.org/2000/svg",
1631
- width: "36",
1632
- height: "28"
1633
- }, /*#__PURE__*/React.createElement("g", {
1634
- fill: "none",
1635
- fillRule: "evenodd"
1636
- }, /*#__PURE__*/React.createElement("rect", {
1637
- width: "36",
1638
- height: "28",
1639
- fill: "#3D6FCF",
1640
- rx: "4"
1641
- }), /*#__PURE__*/React.createElement("path", {
1642
- stroke: "#FFF",
1643
- strokeLinecap: "round",
1644
- strokeLinejoin: "round",
1645
- strokeWidth: "2",
1646
- d: "M22 14.667v4c0 .736-.597 1.333-1.333 1.333h-7.334A1.333 1.333 0 0112 18.667v-7.334c0-.736.597-1.333 1.333-1.333h4M20 8h4v4m-7.333 3.333L24 8"
1647
- })));
1648
- };
1649
-
1650
- var HyperLink = function HyperLink(_ref) {
1651
- var _ref$hyperLink = _ref.hyperLink,
1652
- hyperLink = _ref$hyperLink === void 0 ? "" : _ref$hyperLink;
1653
- if (!hyperLink) return null;
1654
- return /*#__PURE__*/React.createElement(Link, {
1655
- href: hyperLink,
1656
- "aria-label": "hyperlink-button",
1657
- className: "arr--hyperlink-button hyperlink-m_hyperlink-button__1CqWx",
1658
- target: "_blank",
1659
- rel: "noopener noreferrer"
1660
- }, /*#__PURE__*/React.createElement(HyperLinkIcon, null));
1661
- };
1662
- HyperLink.propTypes = {
1663
- hyperLink: PropTypes.string
1664
- };
1665
-
1666
- 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; }
1667
-
1668
- 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; }
1669
- var Lightbox = /*#__PURE__*/lazy(function () {
1670
- return import('react-image-lightbox');
1671
- });
1672
- var FullScreenImages = function FullScreenImages(_ref) {
1673
- var _ref$imageSlug = _ref.imageSlug,
1674
- imageSlug = _ref$imageSlug === void 0 ? "" : _ref$imageSlug,
1675
- template = _ref.template,
1676
- _ref$element = _ref.element,
1677
- element = _ref$element === void 0 ? {} : _ref$element,
1678
- props = _ref.props;
1679
- var cdnImage = useSelector(function (state) {
1680
- return get_1(state, ["qt", "config", "cdn-image"]);
1681
- });
1682
-
1683
- var _useState = useState(0),
1684
- _useState2 = _slicedToArray(_useState, 2),
1685
- photoIndex = _useState2[0],
1686
- handleImage = _useState2[1];
1687
-
1688
- var _useState3 = useState(false),
1689
- _useState4 = _slicedToArray(_useState3, 2),
1690
- isOpen = _useState4[0],
1691
- handleOpen = _useState4[1];
1692
-
1693
- var deviceWidth = get_1(global, ["innerWidth"], 0);
1694
- var hyperlinks = get_1(element, ["story-elements"], []).map(function (image) {
1695
- return image.hyperlink;
1696
- });
1697
- var imageUrlList = [];
1698
-
1699
- if (!imageSlug) {
1700
- imageUrlList = get_1(element, ["story-elements"], []).map(function (image) {
1701
- return "//".concat(cdnImage, "/").concat(image["image-s3-key"], "?w=").concat(deviceWidth);
1702
- });
1703
- }
1704
-
1705
- var onClickHandler = function onClickHandler(index) {
1706
- handleOpen(true);
1707
- handleImage(index);
1708
- };
1709
-
1710
- var onClickKey = imageSlug ? "onClick" : "onClickHandler";
1711
- var imageUrlListLength = imageUrlList.length;
1712
-
1713
- var onMoveNext = function onMoveNext(imageUrlListLength) {
1714
- var next = (photoIndex + 1) % imageUrlListLength;
1715
- handleImage(next);
1716
- };
1717
-
1718
- var onMovePrev = function onMovePrev(imageUrlListLength) {
1719
- var prev = (photoIndex + imageUrlListLength - 1) % imageUrlListLength;
1720
- handleImage(prev);
1721
- };
1722
-
1723
- var onClose = function onClose() {
1724
- handleImage(0);
1725
- handleOpen(false);
1726
- };
1727
-
1728
- var getHyperLink = function getHyperLink() {
1729
- if (element.hyperlink || hyperlinks[photoIndex]) {
1730
- return /*#__PURE__*/React.createElement(HyperLink, {
1731
- hyperLink: element.hyperlink || hyperlinks[photoIndex]
1732
- });
1733
- }
1734
-
1735
- return null;
1736
- };
1737
-
1738
- var lightboxProps = imageSlug ? {
1739
- mainSrc: "//".concat(cdnImage, "/").concat(imageSlug, "?w=").concat(deviceWidth),
1740
- toolbarButtons: [getHyperLink()]
1741
- } : {
1742
- mainSrc: imageUrlList[photoIndex],
1743
- nextSrc: imageUrlList[(photoIndex + 1) % imageUrlListLength],
1744
- prevSrc: imageUrlList[(photoIndex + imageUrlListLength - 1) % imageUrlListLength],
1745
- onMoveNextRequest: function onMoveNextRequest() {
1746
- return onMoveNext(imageUrlListLength);
1747
- },
1748
- onMovePrevRequest: function onMovePrevRequest() {
1749
- return onMovePrev(imageUrlListLength);
1750
- },
1751
- toolbarButtons: [getHyperLink()]
1752
- };
1753
-
1754
- var LoadingScreen = function LoadingScreen() {
1755
- return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Loading, null));
1756
- };
1757
-
1758
- return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(template, _objectSpread(_defineProperty({}, onClickKey, onClickHandler), props)), isOpen ? /*#__PURE__*/React.createElement(Suspense, {
1759
- fallback: /*#__PURE__*/React.createElement(LoadingScreen, null)
1760
- }, /*#__PURE__*/React.createElement(Lightbox, _extends({
1761
- wrapperClassName: "arr--image-lightbox",
1762
- onCloseRequest: onClose
1763
- }, lightboxProps))) : null);
1764
- };
1765
- FullScreenImages.propTypes = {
1766
- imageSlug: PropTypes.string,
1767
- template: PropTypes.func,
1768
- element: PropTypes.shape({
1769
- "story-elements": PropTypes.array
1770
- }),
1771
- props: PropTypes.object
1772
- };
1773
-
1774
- /**
1775
- * Copyright (c) 2014-present, Facebook, Inc.
1776
- *
1777
- * This source code is licensed under the MIT license found in the
1778
- * LICENSE file in the root directory of this source tree.
1779
- */
1780
-
1781
- createCommonjsModule(function (module) {
1782
- var runtime = (function (exports) {
1783
-
1784
- var Op = Object.prototype;
1785
- var hasOwn = Op.hasOwnProperty;
1786
- var undefined$1; // More compressible than void 0.
1787
- var $Symbol = typeof Symbol === "function" ? Symbol : {};
1788
- var iteratorSymbol = $Symbol.iterator || "@@iterator";
1789
- var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator";
1790
- var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
1791
-
1792
- function define(obj, key, value) {
1793
- Object.defineProperty(obj, key, {
1794
- value: value,
1795
- enumerable: true,
1796
- configurable: true,
1797
- writable: true
1798
- });
1799
- return obj[key];
1800
- }
1801
- try {
1802
- // IE 8 has a broken Object.defineProperty that only works on DOM objects.
1803
- define({}, "");
1804
- } catch (err) {
1805
- define = function(obj, key, value) {
1806
- return obj[key] = value;
1807
- };
1808
- }
1809
-
1810
- function wrap(innerFn, outerFn, self, tryLocsList) {
1811
- // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.
1812
- var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;
1813
- var generator = Object.create(protoGenerator.prototype);
1814
- var context = new Context(tryLocsList || []);
1815
-
1816
- // The ._invoke method unifies the implementations of the .next,
1817
- // .throw, and .return methods.
1818
- generator._invoke = makeInvokeMethod(innerFn, self, context);
1819
-
1820
- return generator;
1821
- }
1822
- exports.wrap = wrap;
1823
-
1824
- // Try/catch helper to minimize deoptimizations. Returns a completion
1825
- // record like context.tryEntries[i].completion. This interface could
1826
- // have been (and was previously) designed to take a closure to be
1827
- // invoked without arguments, but in all the cases we care about we
1828
- // already have an existing method we want to call, so there's no need
1829
- // to create a new function object. We can even get away with assuming
1830
- // the method takes exactly one argument, since that happens to be true
1831
- // in every case, so we don't have to touch the arguments object. The
1832
- // only additional allocation required is the completion record, which
1833
- // has a stable shape and so hopefully should be cheap to allocate.
1834
- function tryCatch(fn, obj, arg) {
1835
- try {
1836
- return { type: "normal", arg: fn.call(obj, arg) };
1837
- } catch (err) {
1838
- return { type: "throw", arg: err };
1839
- }
1840
- }
1841
-
1842
- var GenStateSuspendedStart = "suspendedStart";
1843
- var GenStateSuspendedYield = "suspendedYield";
1844
- var GenStateExecuting = "executing";
1845
- var GenStateCompleted = "completed";
1846
-
1847
- // Returning this object from the innerFn has the same effect as
1848
- // breaking out of the dispatch switch statement.
1849
- var ContinueSentinel = {};
1850
-
1851
- // Dummy constructor functions that we use as the .constructor and
1852
- // .constructor.prototype properties for functions that return Generator
1853
- // objects. For full spec compliance, you may wish to configure your
1854
- // minifier not to mangle the names of these two functions.
1855
- function Generator() {}
1856
- function GeneratorFunction() {}
1857
- function GeneratorFunctionPrototype() {}
1858
-
1859
- // This is a polyfill for %IteratorPrototype% for environments that
1860
- // don't natively support it.
1861
- var IteratorPrototype = {};
1862
- define(IteratorPrototype, iteratorSymbol, function () {
1863
- return this;
1864
- });
1865
-
1866
- var getProto = Object.getPrototypeOf;
1867
- var NativeIteratorPrototype = getProto && getProto(getProto(values([])));
1868
- if (NativeIteratorPrototype &&
1869
- NativeIteratorPrototype !== Op &&
1870
- hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {
1871
- // This environment has a native %IteratorPrototype%; use it instead
1872
- // of the polyfill.
1873
- IteratorPrototype = NativeIteratorPrototype;
1874
- }
1875
-
1876
- var Gp = GeneratorFunctionPrototype.prototype =
1877
- Generator.prototype = Object.create(IteratorPrototype);
1878
- GeneratorFunction.prototype = GeneratorFunctionPrototype;
1879
- define(Gp, "constructor", GeneratorFunctionPrototype);
1880
- define(GeneratorFunctionPrototype, "constructor", GeneratorFunction);
1881
- GeneratorFunction.displayName = define(
1882
- GeneratorFunctionPrototype,
1883
- toStringTagSymbol,
1884
- "GeneratorFunction"
1885
- );
1886
-
1887
- // Helper for defining the .next, .throw, and .return methods of the
1888
- // Iterator interface in terms of a single ._invoke method.
1889
- function defineIteratorMethods(prototype) {
1890
- ["next", "throw", "return"].forEach(function(method) {
1891
- define(prototype, method, function(arg) {
1892
- return this._invoke(method, arg);
1893
- });
1894
- });
1895
- }
1896
-
1897
- exports.isGeneratorFunction = function(genFun) {
1898
- var ctor = typeof genFun === "function" && genFun.constructor;
1899
- return ctor
1900
- ? ctor === GeneratorFunction ||
1901
- // For the native GeneratorFunction constructor, the best we can
1902
- // do is to check its .name property.
1903
- (ctor.displayName || ctor.name) === "GeneratorFunction"
1904
- : false;
1905
- };
1906
-
1907
- exports.mark = function(genFun) {
1908
- if (Object.setPrototypeOf) {
1909
- Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);
1910
- } else {
1911
- genFun.__proto__ = GeneratorFunctionPrototype;
1912
- define(genFun, toStringTagSymbol, "GeneratorFunction");
1913
- }
1914
- genFun.prototype = Object.create(Gp);
1915
- return genFun;
1916
- };
1917
-
1918
- // Within the body of any async function, `await x` is transformed to
1919
- // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test
1920
- // `hasOwn.call(value, "__await")` to determine if the yielded value is
1921
- // meant to be awaited.
1922
- exports.awrap = function(arg) {
1923
- return { __await: arg };
1924
- };
1925
-
1926
- function AsyncIterator(generator, PromiseImpl) {
1927
- function invoke(method, arg, resolve, reject) {
1928
- var record = tryCatch(generator[method], generator, arg);
1929
- if (record.type === "throw") {
1930
- reject(record.arg);
1931
- } else {
1932
- var result = record.arg;
1933
- var value = result.value;
1934
- if (value &&
1935
- typeof value === "object" &&
1936
- hasOwn.call(value, "__await")) {
1937
- return PromiseImpl.resolve(value.__await).then(function(value) {
1938
- invoke("next", value, resolve, reject);
1939
- }, function(err) {
1940
- invoke("throw", err, resolve, reject);
1941
- });
1942
- }
1943
-
1944
- return PromiseImpl.resolve(value).then(function(unwrapped) {
1945
- // When a yielded Promise is resolved, its final value becomes
1946
- // the .value of the Promise<{value,done}> result for the
1947
- // current iteration.
1948
- result.value = unwrapped;
1949
- resolve(result);
1950
- }, function(error) {
1951
- // If a rejected Promise was yielded, throw the rejection back
1952
- // into the async generator function so it can be handled there.
1953
- return invoke("throw", error, resolve, reject);
1954
- });
1955
- }
1956
- }
1957
-
1958
- var previousPromise;
1959
-
1960
- function enqueue(method, arg) {
1961
- function callInvokeWithMethodAndArg() {
1962
- return new PromiseImpl(function(resolve, reject) {
1963
- invoke(method, arg, resolve, reject);
1964
- });
1965
- }
1966
-
1967
- return previousPromise =
1968
- // If enqueue has been called before, then we want to wait until
1969
- // all previous Promises have been resolved before calling invoke,
1970
- // so that results are always delivered in the correct order. If
1971
- // enqueue has not been called before, then it is important to
1972
- // call invoke immediately, without waiting on a callback to fire,
1973
- // so that the async generator function has the opportunity to do
1974
- // any necessary setup in a predictable way. This predictability
1975
- // is why the Promise constructor synchronously invokes its
1976
- // executor callback, and why async functions synchronously
1977
- // execute code before the first await. Since we implement simple
1978
- // async functions in terms of async generators, it is especially
1979
- // important to get this right, even though it requires care.
1980
- previousPromise ? previousPromise.then(
1981
- callInvokeWithMethodAndArg,
1982
- // Avoid propagating failures to Promises returned by later
1983
- // invocations of the iterator.
1984
- callInvokeWithMethodAndArg
1985
- ) : callInvokeWithMethodAndArg();
1986
- }
1987
-
1988
- // Define the unified helper method that is used to implement .next,
1989
- // .throw, and .return (see defineIteratorMethods).
1990
- this._invoke = enqueue;
1991
- }
1992
-
1993
- defineIteratorMethods(AsyncIterator.prototype);
1994
- define(AsyncIterator.prototype, asyncIteratorSymbol, function () {
1995
- return this;
1996
- });
1997
- exports.AsyncIterator = AsyncIterator;
1998
-
1999
- // Note that simple async functions are implemented on top of
2000
- // AsyncIterator objects; they just return a Promise for the value of
2001
- // the final result produced by the iterator.
2002
- exports.async = function(innerFn, outerFn, self, tryLocsList, PromiseImpl) {
2003
- if (PromiseImpl === void 0) PromiseImpl = Promise;
2004
-
2005
- var iter = new AsyncIterator(
2006
- wrap(innerFn, outerFn, self, tryLocsList),
2007
- PromiseImpl
2008
- );
2009
-
2010
- return exports.isGeneratorFunction(outerFn)
2011
- ? iter // If outerFn is a generator, return the full iterator.
2012
- : iter.next().then(function(result) {
2013
- return result.done ? result.value : iter.next();
2014
- });
2015
- };
2016
-
2017
- function makeInvokeMethod(innerFn, self, context) {
2018
- var state = GenStateSuspendedStart;
2019
-
2020
- return function invoke(method, arg) {
2021
- if (state === GenStateExecuting) {
2022
- throw new Error("Generator is already running");
2023
- }
2024
-
2025
- if (state === GenStateCompleted) {
2026
- if (method === "throw") {
2027
- throw arg;
2028
- }
2029
-
2030
- // Be forgiving, per 25.3.3.3.3 of the spec:
2031
- // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume
2032
- return doneResult();
2033
- }
2034
-
2035
- context.method = method;
2036
- context.arg = arg;
2037
-
2038
- while (true) {
2039
- var delegate = context.delegate;
2040
- if (delegate) {
2041
- var delegateResult = maybeInvokeDelegate(delegate, context);
2042
- if (delegateResult) {
2043
- if (delegateResult === ContinueSentinel) continue;
2044
- return delegateResult;
2045
- }
2046
- }
2047
-
2048
- if (context.method === "next") {
2049
- // Setting context._sent for legacy support of Babel's
2050
- // function.sent implementation.
2051
- context.sent = context._sent = context.arg;
2052
-
2053
- } else if (context.method === "throw") {
2054
- if (state === GenStateSuspendedStart) {
2055
- state = GenStateCompleted;
2056
- throw context.arg;
2057
- }
2058
-
2059
- context.dispatchException(context.arg);
2060
-
2061
- } else if (context.method === "return") {
2062
- context.abrupt("return", context.arg);
2063
- }
2064
-
2065
- state = GenStateExecuting;
2066
-
2067
- var record = tryCatch(innerFn, self, context);
2068
- if (record.type === "normal") {
2069
- // If an exception is thrown from innerFn, we leave state ===
2070
- // GenStateExecuting and loop back for another invocation.
2071
- state = context.done
2072
- ? GenStateCompleted
2073
- : GenStateSuspendedYield;
2074
-
2075
- if (record.arg === ContinueSentinel) {
2076
- continue;
2077
- }
2078
-
2079
- return {
2080
- value: record.arg,
2081
- done: context.done
2082
- };
2083
-
2084
- } else if (record.type === "throw") {
2085
- state = GenStateCompleted;
2086
- // Dispatch the exception by looping back around to the
2087
- // context.dispatchException(context.arg) call above.
2088
- context.method = "throw";
2089
- context.arg = record.arg;
2090
- }
2091
- }
2092
- };
2093
- }
2094
-
2095
- // Call delegate.iterator[context.method](context.arg) and handle the
2096
- // result, either by returning a { value, done } result from the
2097
- // delegate iterator, or by modifying context.method and context.arg,
2098
- // setting context.delegate to null, and returning the ContinueSentinel.
2099
- function maybeInvokeDelegate(delegate, context) {
2100
- var method = delegate.iterator[context.method];
2101
- if (method === undefined$1) {
2102
- // A .throw or .return when the delegate iterator has no .throw
2103
- // method always terminates the yield* loop.
2104
- context.delegate = null;
2105
-
2106
- if (context.method === "throw") {
2107
- // Note: ["return"] must be used for ES3 parsing compatibility.
2108
- if (delegate.iterator["return"]) {
2109
- // If the delegate iterator has a return method, give it a
2110
- // chance to clean up.
2111
- context.method = "return";
2112
- context.arg = undefined$1;
2113
- maybeInvokeDelegate(delegate, context);
2114
-
2115
- if (context.method === "throw") {
2116
- // If maybeInvokeDelegate(context) changed context.method from
2117
- // "return" to "throw", let that override the TypeError below.
2118
- return ContinueSentinel;
2119
- }
2120
- }
2121
-
2122
- context.method = "throw";
2123
- context.arg = new TypeError(
2124
- "The iterator does not provide a 'throw' method");
2125
- }
2126
-
2127
- return ContinueSentinel;
2128
- }
2129
-
2130
- var record = tryCatch(method, delegate.iterator, context.arg);
2131
-
2132
- if (record.type === "throw") {
2133
- context.method = "throw";
2134
- context.arg = record.arg;
2135
- context.delegate = null;
2136
- return ContinueSentinel;
2137
- }
2138
-
2139
- var info = record.arg;
2140
-
2141
- if (! info) {
2142
- context.method = "throw";
2143
- context.arg = new TypeError("iterator result is not an object");
2144
- context.delegate = null;
2145
- return ContinueSentinel;
2146
- }
2147
-
2148
- if (info.done) {
2149
- // Assign the result of the finished delegate to the temporary
2150
- // variable specified by delegate.resultName (see delegateYield).
2151
- context[delegate.resultName] = info.value;
2152
-
2153
- // Resume execution at the desired location (see delegateYield).
2154
- context.next = delegate.nextLoc;
2155
-
2156
- // If context.method was "throw" but the delegate handled the
2157
- // exception, let the outer generator proceed normally. If
2158
- // context.method was "next", forget context.arg since it has been
2159
- // "consumed" by the delegate iterator. If context.method was
2160
- // "return", allow the original .return call to continue in the
2161
- // outer generator.
2162
- if (context.method !== "return") {
2163
- context.method = "next";
2164
- context.arg = undefined$1;
2165
- }
2166
-
2167
- } else {
2168
- // Re-yield the result returned by the delegate method.
2169
- return info;
2170
- }
2171
-
2172
- // The delegate iterator is finished, so forget it and continue with
2173
- // the outer generator.
2174
- context.delegate = null;
2175
- return ContinueSentinel;
2176
- }
2177
-
2178
- // Define Generator.prototype.{next,throw,return} in terms of the
2179
- // unified ._invoke helper method.
2180
- defineIteratorMethods(Gp);
2181
-
2182
- define(Gp, toStringTagSymbol, "Generator");
2183
-
2184
- // A Generator should always return itself as the iterator object when the
2185
- // @@iterator function is called on it. Some browsers' implementations of the
2186
- // iterator prototype chain incorrectly implement this, causing the Generator
2187
- // object to not be returned from this call. This ensures that doesn't happen.
2188
- // See https://github.com/facebook/regenerator/issues/274 for more details.
2189
- define(Gp, iteratorSymbol, function() {
2190
- return this;
2191
- });
2192
-
2193
- define(Gp, "toString", function() {
2194
- return "[object Generator]";
2195
- });
2196
-
2197
- function pushTryEntry(locs) {
2198
- var entry = { tryLoc: locs[0] };
2199
-
2200
- if (1 in locs) {
2201
- entry.catchLoc = locs[1];
2202
- }
2203
-
2204
- if (2 in locs) {
2205
- entry.finallyLoc = locs[2];
2206
- entry.afterLoc = locs[3];
2207
- }
2208
-
2209
- this.tryEntries.push(entry);
2210
- }
2211
-
2212
- function resetTryEntry(entry) {
2213
- var record = entry.completion || {};
2214
- record.type = "normal";
2215
- delete record.arg;
2216
- entry.completion = record;
2217
- }
2218
-
2219
- function Context(tryLocsList) {
2220
- // The root entry object (effectively a try statement without a catch
2221
- // or a finally block) gives us a place to store values thrown from
2222
- // locations where there is no enclosing try statement.
2223
- this.tryEntries = [{ tryLoc: "root" }];
2224
- tryLocsList.forEach(pushTryEntry, this);
2225
- this.reset(true);
2226
- }
2227
-
2228
- exports.keys = function(object) {
2229
- var keys = [];
2230
- for (var key in object) {
2231
- keys.push(key);
2232
- }
2233
- keys.reverse();
2234
-
2235
- // Rather than returning an object with a next method, we keep
2236
- // things simple and return the next function itself.
2237
- return function next() {
2238
- while (keys.length) {
2239
- var key = keys.pop();
2240
- if (key in object) {
2241
- next.value = key;
2242
- next.done = false;
2243
- return next;
2244
- }
2245
- }
2246
-
2247
- // To avoid creating an additional object, we just hang the .value
2248
- // and .done properties off the next function object itself. This
2249
- // also ensures that the minifier will not anonymize the function.
2250
- next.done = true;
2251
- return next;
2252
- };
2253
- };
2254
-
2255
- function values(iterable) {
2256
- if (iterable) {
2257
- var iteratorMethod = iterable[iteratorSymbol];
2258
- if (iteratorMethod) {
2259
- return iteratorMethod.call(iterable);
2260
- }
2261
-
2262
- if (typeof iterable.next === "function") {
2263
- return iterable;
2264
- }
2265
-
2266
- if (!isNaN(iterable.length)) {
2267
- var i = -1, next = function next() {
2268
- while (++i < iterable.length) {
2269
- if (hasOwn.call(iterable, i)) {
2270
- next.value = iterable[i];
2271
- next.done = false;
2272
- return next;
2273
- }
2274
- }
2275
-
2276
- next.value = undefined$1;
2277
- next.done = true;
2278
-
2279
- return next;
2280
- };
2281
-
2282
- return next.next = next;
2283
- }
2284
- }
2285
-
2286
- // Return an iterator with no values.
2287
- return { next: doneResult };
2288
- }
2289
- exports.values = values;
2290
-
2291
- function doneResult() {
2292
- return { value: undefined$1, done: true };
2293
- }
2294
-
2295
- Context.prototype = {
2296
- constructor: Context,
2297
-
2298
- reset: function(skipTempReset) {
2299
- this.prev = 0;
2300
- this.next = 0;
2301
- // Resetting context._sent for legacy support of Babel's
2302
- // function.sent implementation.
2303
- this.sent = this._sent = undefined$1;
2304
- this.done = false;
2305
- this.delegate = null;
2306
-
2307
- this.method = "next";
2308
- this.arg = undefined$1;
2309
-
2310
- this.tryEntries.forEach(resetTryEntry);
2311
-
2312
- if (!skipTempReset) {
2313
- for (var name in this) {
2314
- // Not sure about the optimal order of these conditions:
2315
- if (name.charAt(0) === "t" &&
2316
- hasOwn.call(this, name) &&
2317
- !isNaN(+name.slice(1))) {
2318
- this[name] = undefined$1;
2319
- }
2320
- }
2321
- }
2322
- },
2323
-
2324
- stop: function() {
2325
- this.done = true;
2326
-
2327
- var rootEntry = this.tryEntries[0];
2328
- var rootRecord = rootEntry.completion;
2329
- if (rootRecord.type === "throw") {
2330
- throw rootRecord.arg;
2331
- }
2332
-
2333
- return this.rval;
2334
- },
2335
-
2336
- dispatchException: function(exception) {
2337
- if (this.done) {
2338
- throw exception;
2339
- }
2340
-
2341
- var context = this;
2342
- function handle(loc, caught) {
2343
- record.type = "throw";
2344
- record.arg = exception;
2345
- context.next = loc;
2346
-
2347
- if (caught) {
2348
- // If the dispatched exception was caught by a catch block,
2349
- // then let that catch block handle the exception normally.
2350
- context.method = "next";
2351
- context.arg = undefined$1;
2352
- }
2353
-
2354
- return !! caught;
2355
- }
2356
-
2357
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
2358
- var entry = this.tryEntries[i];
2359
- var record = entry.completion;
2360
-
2361
- if (entry.tryLoc === "root") {
2362
- // Exception thrown outside of any try block that could handle
2363
- // it, so set the completion value of the entire function to
2364
- // throw the exception.
2365
- return handle("end");
2366
- }
2367
-
2368
- if (entry.tryLoc <= this.prev) {
2369
- var hasCatch = hasOwn.call(entry, "catchLoc");
2370
- var hasFinally = hasOwn.call(entry, "finallyLoc");
2371
-
2372
- if (hasCatch && hasFinally) {
2373
- if (this.prev < entry.catchLoc) {
2374
- return handle(entry.catchLoc, true);
2375
- } else if (this.prev < entry.finallyLoc) {
2376
- return handle(entry.finallyLoc);
2377
- }
2378
-
2379
- } else if (hasCatch) {
2380
- if (this.prev < entry.catchLoc) {
2381
- return handle(entry.catchLoc, true);
2382
- }
2383
-
2384
- } else if (hasFinally) {
2385
- if (this.prev < entry.finallyLoc) {
2386
- return handle(entry.finallyLoc);
2387
- }
2388
-
2389
- } else {
2390
- throw new Error("try statement without catch or finally");
2391
- }
2392
- }
2393
- }
2394
- },
2395
-
2396
- abrupt: function(type, arg) {
2397
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
2398
- var entry = this.tryEntries[i];
2399
- if (entry.tryLoc <= this.prev &&
2400
- hasOwn.call(entry, "finallyLoc") &&
2401
- this.prev < entry.finallyLoc) {
2402
- var finallyEntry = entry;
2403
- break;
2404
- }
2405
- }
2406
-
2407
- if (finallyEntry &&
2408
- (type === "break" ||
2409
- type === "continue") &&
2410
- finallyEntry.tryLoc <= arg &&
2411
- arg <= finallyEntry.finallyLoc) {
2412
- // Ignore the finally entry if control is not jumping to a
2413
- // location outside the try/catch block.
2414
- finallyEntry = null;
2415
- }
2416
-
2417
- var record = finallyEntry ? finallyEntry.completion : {};
2418
- record.type = type;
2419
- record.arg = arg;
2420
-
2421
- if (finallyEntry) {
2422
- this.method = "next";
2423
- this.next = finallyEntry.finallyLoc;
2424
- return ContinueSentinel;
2425
- }
2426
-
2427
- return this.complete(record);
2428
- },
2429
-
2430
- complete: function(record, afterLoc) {
2431
- if (record.type === "throw") {
2432
- throw record.arg;
2433
- }
2434
-
2435
- if (record.type === "break" ||
2436
- record.type === "continue") {
2437
- this.next = record.arg;
2438
- } else if (record.type === "return") {
2439
- this.rval = this.arg = record.arg;
2440
- this.method = "return";
2441
- this.next = "end";
2442
- } else if (record.type === "normal" && afterLoc) {
2443
- this.next = afterLoc;
2444
- }
2445
-
2446
- return ContinueSentinel;
2447
- },
2448
-
2449
- finish: function(finallyLoc) {
2450
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
2451
- var entry = this.tryEntries[i];
2452
- if (entry.finallyLoc === finallyLoc) {
2453
- this.complete(entry.completion, entry.afterLoc);
2454
- resetTryEntry(entry);
2455
- return ContinueSentinel;
2456
- }
2457
- }
2458
- },
2459
-
2460
- "catch": function(tryLoc) {
2461
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
2462
- var entry = this.tryEntries[i];
2463
- if (entry.tryLoc === tryLoc) {
2464
- var record = entry.completion;
2465
- if (record.type === "throw") {
2466
- var thrown = record.arg;
2467
- resetTryEntry(entry);
2468
- }
2469
- return thrown;
2470
- }
2471
- }
2472
-
2473
- // The context.catch method must only be called with a location
2474
- // argument that corresponds to a known catch block.
2475
- throw new Error("illegal catch attempt");
2476
- },
2477
-
2478
- delegateYield: function(iterable, resultName, nextLoc) {
2479
- this.delegate = {
2480
- iterator: values(iterable),
2481
- resultName: resultName,
2482
- nextLoc: nextLoc
2483
- };
2484
-
2485
- if (this.method === "next") {
2486
- // Deliberately forget the last sent value so that we don't
2487
- // accidentally pass it on to the delegate.
2488
- this.arg = undefined$1;
2489
- }
2490
-
2491
- return ContinueSentinel;
2492
- }
2493
- };
2494
-
2495
- // Regardless of whether this script is executing as a CommonJS module
2496
- // or not, return the runtime object so that we can declare the variable
2497
- // regeneratorRuntime in the outer scope, which allows this module to be
2498
- // injected easily by `bin/regenerator --include-runtime script.js`.
2499
- return exports;
2500
-
2501
- }(
2502
- // If this script is executing as a CommonJS module, use module.exports
2503
- // as the regeneratorRuntime namespace. Otherwise create a new empty
2504
- // object. Either way, the resulting object will be used to initialize
2505
- // the regeneratorRuntime variable at the top of this file.
2506
- module.exports
2507
- ));
2508
-
2509
- try {
2510
- regeneratorRuntime = runtime;
2511
- } catch (accidentalStrictMode) {
2512
- // This module should not be running in strict mode, so the above
2513
- // assignment should always work unless something is misconfigured. Just
2514
- // in case runtime.js accidentally runs in strict mode, in modern engines
2515
- // we can explicitly access globalThis. In older engines we can escape
2516
- // strict mode using a global Function call. This could conceivably fail
2517
- // if a Content Security Policy forbids using Function, but in that case
2518
- // the proper solution is to fix the accidental strict mode problem. If
2519
- // you've misconfigured your bundler to force strict mode and applied a
2520
- // CSP to forbid Function, and you're not willing to fix either of those
2521
- // problems, please detail your unique predicament in a GitHub issue.
2522
- if (typeof globalThis === "object") {
2523
- globalThis.regeneratorRuntime = runtime;
2524
- } else {
2525
- Function("r", "regeneratorRuntime = r")(runtime);
2526
- }
2527
- }
2528
- });
2529
-
2530
- var clientWidths = {
2531
- mobile: 767,
2532
- tablet: 1024
2533
- };
2534
- var clientWidth = function clientWidth(device) {
2535
- var foundDeviceWidth = get_1(clientWidths, device);
2536
-
2537
- if (foundDeviceWidth) {
2538
- return get_1(global, "document.documentElement.clientWidth") <= foundDeviceWidth;
2539
- }
2540
-
2541
- return false;
2542
- };
2543
- var shapeConfig = PropTypes.shape({
2544
- "sketches-host": PropTypes.string,
2545
- "cdn-name": PropTypes.string,
2546
- "cdn-image": PropTypes.string
2547
- });
2548
- var shapeStory = PropTypes.shape({
2549
- headline: PropTypes.string,
2550
- "last-published-at": PropTypes.number,
2551
- subheadline: PropTypes.string
2552
- });
2553
-
2554
- var _excluded = ["element", "template", "opts", "story", "config"];
2555
- var _styleModuleImportMap = {
2556
- "./image-gallery.m.css": {
2557
- "viewports": "\"../../../../../assets/stylesheets/viewports.m.css\"",
2558
- "mobile": "768px",
2559
- "image-gallery": "image-gallery-m_image-gallery__1Q7if",
2560
- "image": "image-gallery-m_image__3qwSJ",
2561
- "template-2": "image-gallery-m_template-2__2pjmE",
2562
- "left-images": "image-gallery-m_left-images__34gjv",
2563
- "hyperlink-gallery-image": "image-gallery-m_hyperlink-gallery-image__2qgDp"
2564
- }
2565
- };
2566
-
2567
- var ImageGalleryBase = function ImageGalleryBase(_ref) {
2568
- var element = _ref.element,
2569
- _ref$template = _ref.template,
2570
- template = _ref$template === void 0 ? "" : _ref$template;
2571
- _ref.opts;
2572
- _ref.story;
2573
- _ref.config;
2574
- var restProps = _objectWithoutProperties(_ref, _excluded);
2575
-
2576
- if (!element) return null;
2577
- var isMobile = clientWidth("mobile");
2578
- var imageArr = element["story-elements"];
2579
- var imageBaseOnTemp = template === "template-2" && imageArr.length;
2580
- var renderImageDesktop = imageBaseOnTemp > 6 ? imageArr.slice(0, 6) : imageArr;
2581
- var renderMobile = imageBaseOnTemp > 4 ? imageArr.slice(0, 4) : imageArr;
2582
- var renderImage = isMobile ? renderMobile : renderImageDesktop;
2583
- var classes = template === "template-2" ? "template-2" : "";
2584
-
2585
- var hyperlinkClass = function hyperlinkClass(hyperlink) {
2586
- return hyperlink ? "hyperlink-gallery-image" : "";
2587
- };
2588
-
2589
- var ImageGalleryImagesTemplate = function ImageGalleryImagesTemplate(_ref2) {
2590
- var onClickHandler = _ref2.onClickHandler;
2591
- var images = renderImage.map(function (image, index) {
2592
- return /*#__PURE__*/React.createElement("div", {
2593
- key: index,
2594
- className: _getClassName(hyperlinkClass(image["hyperlink"]), _styleModuleImportMap)
2595
- }, /*#__PURE__*/React.createElement("figure", {
2596
- key: index,
2597
- "data-text-id": "image-".concat(index),
2598
- onClick: function onClick() {
2599
- return onClickHandler && onClickHandler(index);
2600
- },
2601
- className: _getClassName("image ".concat(classes), _styleModuleImportMap)
2602
- }, /*#__PURE__*/React.createElement(ResponsiveImage, {
2603
- slug: image["image-s3-key"],
2604
- metadata: image["image-metadata"],
2605
- alt: image["title"],
2606
- aspectRatio: [1, 1],
2607
- defaultWidth: 640,
2608
- imgParams: {
2609
- auto: ["format", "compress"]
2610
- }
2611
- })), image["hyperlink"] && /*#__PURE__*/React.createElement(HyperLink, {
2612
- hyperLink: image["hyperlink"]
2613
- }));
2614
- });
2615
- return /*#__PURE__*/React.createElement("div", _extends({
2616
- className: " arrow-component arr--image-element image-gallery-m_image-gallery__1Q7if" + (" " + (restProps ? restProps.className || "" : ""))
2617
- }, restProps, {
2618
- "data-test-id": "image-gallery"
2619
- }), images);
2620
- };
2621
-
2622
- ImageGalleryImagesTemplate.propTypes = {
2623
- onClickHandler: PropTypes.func
2624
- };
2625
- return /*#__PURE__*/React.createElement(FullScreenImages, {
2626
- template: ImageGalleryImagesTemplate,
2627
- element: element
2628
- });
2629
- };
2630
-
2631
- ImageGalleryBase.propTypes = {
2632
- element: PropTypes.shape({
2633
- "story-elements": PropTypes.array
2634
- }),
2635
- opts: PropTypes.shape({
2636
- imageWidths: PropTypes.array
2637
- }),
2638
- story: shapeStory,
2639
- config: shapeConfig,
2640
- template: PropTypes.string
2641
- };
2642
- var ImageGallery = withElementWrapper(ImageGalleryBase);
2643
-
2644
- export { ImageGallery };