@quintype/arrow 3.15.1-perf.1 → 3.15.1-perf.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (167) hide show
  1. package/atoms/Author/index.js +48 -2128
  2. package/atoms/Author/styles.arrow.css +1 -1
  3. package/atoms/AuthorWithTime/index.js +116 -2556
  4. package/atoms/AuthorWithTime/styles.arrow.css +1 -1
  5. package/atoms/CollectionName/index.js +48 -2127
  6. package/atoms/CollectionName/styles.arrow.css +1 -1
  7. package/atoms/ExtendedLoadMore/{index-6f8c780e.js → index-0f809dd9.js} +73 -62
  8. package/atoms/ExtendedLoadMore/index-142f015c.js +476 -0
  9. package/atoms/ExtendedLoadMore/{index-2d713010.js → index-37a9ccff.js} +63 -47
  10. package/atoms/ExtendedLoadMore/{index-8345922c.js → index-446679c8.js} +67 -51
  11. package/atoms/ExtendedLoadMore/{index-6daa674c.js → index-44f97338.js} +86 -68
  12. package/atoms/ExtendedLoadMore/{index-c8f346d0.js → index-57dd4870.js} +80 -64
  13. package/atoms/ExtendedLoadMore/{index-7eb05b3d.js → index-66dd4dbd.js} +70 -54
  14. package/atoms/ExtendedLoadMore/{index-6cb56d1a.js → index-8462c597.js} +93 -80
  15. package/atoms/ExtendedLoadMore/{index-aa8b8ab8.js → index-93cb06d1.js} +252 -226
  16. package/atoms/ExtendedLoadMore/index-afd44863.js +95 -0
  17. package/atoms/ExtendedLoadMore/{index-5a7900ba.js → index-b5754c5d.js} +67 -53
  18. package/atoms/ExtendedLoadMore/{index-4191a84c.js → index-bbaf526e.js} +78 -62
  19. package/atoms/ExtendedLoadMore/{index-99af722e.js → index-cfb262ef.js} +65 -48
  20. package/atoms/ExtendedLoadMore/index.js +20 -5
  21. package/atoms/ExtendedLoadMore/styles.arrow.css +1 -1
  22. package/atoms/Headline/index.js +95 -2175
  23. package/atoms/Headline/styles.arrow.css +1 -1
  24. package/atoms/HeroImage/index.js +91 -2230
  25. package/atoms/HeroImage/styles.arrow.css +1 -1
  26. package/atoms/LoadmoreButton/index.js +40 -2133
  27. package/atoms/LoadmoreButton/styles.arrow.css +1 -1
  28. package/atoms/ScrollSnap/index.js +89 -2241
  29. package/atoms/ScrollSnap/styles.arrow.css +1 -1
  30. package/atoms/SectionTag/index.js +40 -2120
  31. package/atoms/SectionTag/styles.arrow.css +1 -1
  32. package/atoms/Subheadline/index.js +35 -2115
  33. package/atoms/Subheadline/styles.arrow.css +1 -1
  34. package/atoms/TimeStamp/index.js +43 -2483
  35. package/atoms/TimeStamp/styles.arrow.css +1 -1
  36. package/molecules/KeyEvents/index.js +95 -2606
  37. package/molecules/KeyEvents/styles.arrow.css +1 -1
  38. package/molecules/PageIntroductionCard/index.js +59 -2487
  39. package/molecules/PageIntroductionCard/styles.arrow.css +1 -1
  40. package/molecules/SocialShareTemplate/index.js +213 -2800
  41. package/molecules/SocialShareTemplate/styles.arrow.css +1 -1
  42. package/molecules/StoryCard/index.js +308 -2816
  43. package/molecules/StoryCard/styles.arrow.css +1 -1
  44. package/molecules/StoryElementCard/index.js +611 -3352
  45. package/molecules/StoryElementCard/styles.arrow.css +1 -1
  46. package/molecules/StorycardContent/index.js +218 -2658
  47. package/molecules/StorycardContent/styles.arrow.css +1 -1
  48. package/package.json +1 -1
  49. package/rows/AlternateCollectionFilter/index.js +438 -2993
  50. package/rows/AlternateCollectionFilter/styles.arrow.css +1 -1
  51. package/rows/AsideCollection/index.js +432 -2987
  52. package/rows/AsideCollection/styles.arrow.css +1 -1
  53. package/rows/AstrologyCollection/index.js +411 -2966
  54. package/rows/AstrologyCollection/styles.arrow.css +1 -1
  55. package/rows/AuthorIntroductionCard/index.js +183 -2890
  56. package/rows/AuthorIntroductionCard/styles.arrow.css +1 -1
  57. package/rows/AuthorsList/index.js +217 -2936
  58. package/rows/AuthorsList/styles.arrow.css +1 -1
  59. package/rows/CollectionFilter/index.js +453 -3008
  60. package/rows/CollectionFilter/styles.arrow.css +1 -1
  61. package/rows/ElevenStories/index.js +439 -2959
  62. package/rows/ElevenStories/styles.arrow.css +1 -1
  63. package/rows/FourColFiveStories/index.js +374 -2872
  64. package/rows/FourColFiveStories/styles.arrow.css +1 -1
  65. package/rows/FourColGrid/index.js +426 -2927
  66. package/rows/FourColGrid/styles.arrow.css +1 -1
  67. package/rows/FourColPortraitStories/index.js +430 -2931
  68. package/rows/FourColPortraitStories/styles.arrow.css +1 -1
  69. package/rows/FourColSixteenStories/index.js +368 -2894
  70. package/rows/FourColSixteenStories/styles.arrow.css +1 -1
  71. package/rows/FourColTwelveStories/index.js +387 -2900
  72. package/rows/FourColTwelveStories/styles.arrow.css +1 -1
  73. package/rows/FourStorySlider/index.js +443 -2963
  74. package/rows/FourStorySlider/styles.arrow.css +1 -1
  75. package/rows/FourStorySliderPortrait/index.js +444 -2964
  76. package/rows/FourStorySliderPortrait/styles.arrow.css +1 -1
  77. package/rows/FourTabbedBigStorySlider/index.js +403 -2923
  78. package/rows/FourTabbedBigStorySlider/styles.arrow.css +1 -1
  79. package/rows/FullScreenSlider/index.js +422 -2942
  80. package/rows/FullScreenSlider/styles.arrow.css +1 -1
  81. package/rows/HalfScreenSlider/index.js +390 -2910
  82. package/rows/HalfScreenSlider/styles.arrow.css +1 -1
  83. package/rows/ListComponent/index.js +398 -2918
  84. package/rows/ListComponent/styles.arrow.css +1 -1
  85. package/rows/Listicles/index.js +189 -2375
  86. package/rows/Listicles/styles.arrow.css +1 -1
  87. package/rows/MagazineEditions/index.js +128 -2580
  88. package/rows/MagazineEditions/styles.arrow.css +1 -1
  89. package/rows/MagazineHeaderCard/index.js +125 -2577
  90. package/rows/MagazineHeaderCard/styles.arrow.css +1 -1
  91. package/rows/MagazineWidget/index.js +408 -2928
  92. package/rows/MagazineWidget/styles.arrow.css +1 -1
  93. package/rows/OneColStoryList/index.js +439 -2940
  94. package/rows/OneColStoryList/styles.arrow.css +1 -1
  95. package/rows/OpinionCollection/index.js +308 -2800
  96. package/rows/OpinionCollection/styles.arrow.css +1 -1
  97. package/rows/SixColSixStories/index.js +405 -2906
  98. package/rows/SixColSixStories/styles.arrow.css +1 -1
  99. package/rows/StoryCollection/index.js +432 -2987
  100. package/rows/StoryCollection/styles.arrow.css +1 -1
  101. package/rows/TagIntroductionCard/index.js +35 -1833
  102. package/rows/TagIntroductionCard/styles.arrow.css +1 -1
  103. package/rows/ThreeColFlexStories/index.js +421 -2922
  104. package/rows/ThreeColFlexStories/styles.arrow.css +1 -1
  105. package/rows/ThreeColFourteenStories/index.js +358 -2871
  106. package/rows/ThreeColFourteenStories/styles.arrow.css +1 -1
  107. package/rows/ThreeColGrid/index.js +428 -2929
  108. package/rows/ThreeColGrid/styles.arrow.css +1 -1
  109. package/rows/ThreeColSevenStory/index.js +406 -2926
  110. package/rows/ThreeColSevenStory/styles.arrow.css +1 -1
  111. package/rows/ThreeColSixStories/index.js +400 -2920
  112. package/rows/ThreeColSixStories/styles.arrow.css +1 -1
  113. package/rows/ThreeColTwelveStories/index.js +383 -2909
  114. package/rows/ThreeColTwelveStories/styles.arrow.css +1 -1
  115. package/rows/TwoColFourStories/index.js +395 -2915
  116. package/rows/TwoColFourStories/styles.arrow.css +1 -1
  117. package/rows/TwoColFourStoryHighlight/index.js +398 -2924
  118. package/rows/TwoColFourStoryHighlight/styles.arrow.css +1 -1
  119. package/rows/TwoColSevenStories/index.js +400 -2920
  120. package/rows/TwoColSevenStories/styles.arrow.css +1 -1
  121. package/rows/TwoColSixStories/index.js +398 -2924
  122. package/rows/TwoColSixStories/styles.arrow.css +1 -1
  123. package/rows/TwoColTenStoriesSidebar/index.js +418 -2938
  124. package/rows/TwoColTenStoriesSidebar/styles.arrow.css +1 -1
  125. package/rows/TwoColThreeStories/index.js +392 -2912
  126. package/rows/TwoColThreeStories/styles.arrow.css +1 -1
  127. package/story-elements/AlsoRead/index.js +92 -2229
  128. package/story-elements/AlsoRead/styles.arrow.css +1 -1
  129. package/story-elements/Attachment/index.js +53 -1899
  130. package/story-elements/Attachment/styles.arrow.css +1 -1
  131. package/story-elements/BigFact/index.js +49 -1895
  132. package/story-elements/BigFact/styles.arrow.css +1 -1
  133. package/story-elements/BlockQuote/index.js +79 -2206
  134. package/story-elements/BlockQuote/styles.arrow.css +1 -1
  135. package/story-elements/Blurb/index.js +52 -1957
  136. package/story-elements/Blurb/styles.arrow.css +1 -1
  137. package/story-elements/Image/index.js +147 -2329
  138. package/story-elements/Image/styles.arrow.css +1 -1
  139. package/story-elements/ImageGallery/index.js +135 -2317
  140. package/story-elements/ImageGallery/styles.arrow.css +1 -1
  141. package/story-elements/ImageSlideshow/index.js +173 -2355
  142. package/story-elements/ImageSlideshow/styles.arrow.css +1 -1
  143. package/story-elements/QuestionAnswer/index.js +79 -2207
  144. package/story-elements/QuestionAnswer/styles.arrow.css +1 -1
  145. package/story-elements/Quote/index.js +52 -1898
  146. package/story-elements/Quote/styles.arrow.css +1 -1
  147. package/story-elements/Reference/index.js +53 -1899
  148. package/story-elements/Reference/styles.arrow.css +1 -1
  149. package/story-elements/StoryElement/index.js +34 -1738
  150. package/story-elements/Summary/index.js +56 -1902
  151. package/story-elements/Summary/styles.arrow.css +1 -1
  152. package/story-elements/Text/index.js +48 -2176
  153. package/story-elements/Text/styles.arrow.css +1 -1
  154. package/story-elements/Video/index.js +35 -1739
  155. package/story-elements/Video/styles.arrow.css +1 -1
  156. package/story-templates/ListicleStoryTemplate/index.js +1182 -4038
  157. package/story-templates/ListicleStoryTemplate/styles.arrow.css +1 -1
  158. package/story-templates/LiveBlogStoryTemplate/index.js +1377 -4233
  159. package/story-templates/LiveBlogStoryTemplate/styles.arrow.css +1 -1
  160. package/story-templates/PhotoStoryTemplate/index.js +1162 -4018
  161. package/story-templates/PhotoStoryTemplate/styles.arrow.css +1 -1
  162. package/story-templates/TextStoryTemplate/index.js +1277 -4133
  163. package/story-templates/TextStoryTemplate/styles.arrow.css +1 -1
  164. package/story-templates/VideoStoryTemplate/index.js +1231 -4087
  165. package/story-templates/VideoStoryTemplate/styles.arrow.css +1 -1
  166. package/atoms/ExtendedLoadMore/index-e39b3ca8.js +0 -3023
  167. package/atoms/ExtendedLoadMore/index-f6e578e3.js +0 -86
@@ -1,1897 +1,51 @@
1
- import React, { useContext, createContext } from 'react';
2
- import PropTypes from 'prop-types';
3
- import 'react-timeago';
4
- import 'date-fns-tz';
5
- import { Link } from '@quintype/components';
6
-
7
- function _extends() {
8
- _extends = Object.assign || function (target) {
9
- for (var i = 1; i < arguments.length; i++) {
10
- var source = arguments[i];
11
-
12
- for (var key in source) {
13
- if (Object.prototype.hasOwnProperty.call(source, key)) {
14
- target[key] = source[key];
15
- }
16
- }
17
- }
18
-
19
- return target;
20
- };
21
-
22
- return _extends.apply(this, arguments);
23
- }
24
-
25
- function _objectWithoutPropertiesLoose(source, excluded) {
26
- if (source == null) return {};
27
- var target = {};
28
- var sourceKeys = Object.keys(source);
29
- var key, i;
30
-
31
- for (i = 0; i < sourceKeys.length; i++) {
32
- key = sourceKeys[i];
33
- if (excluded.indexOf(key) >= 0) continue;
34
- target[key] = source[key];
35
- }
36
-
37
- return target;
38
- }
39
-
40
- function _objectWithoutProperties(source, excluded) {
41
- if (source == null) return {};
42
- var target = _objectWithoutPropertiesLoose(source, excluded);
43
- var key, i;
44
-
45
- if (Object.getOwnPropertySymbols) {
46
- var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
47
-
48
- for (i = 0; i < sourceSymbolKeys.length; i++) {
49
- key = sourceSymbolKeys[i];
50
- if (excluded.indexOf(key) >= 0) continue;
51
- if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
52
- target[key] = source[key];
53
- }
54
- }
55
-
56
- return target;
57
- }
58
-
59
- var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
60
-
61
- function getDefaultExportFromCjs (x) {
62
- return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
63
- }
64
-
65
- function createCommonjsModule(fn) {
66
- var module = { exports: {} };
67
- return fn(module, module.exports), module.exports;
68
- }
69
-
70
- var optionsDefaults_1 = createCommonjsModule(function (module, exports) {
71
-
72
- Object.defineProperty(exports, "__esModule", {
73
- value: true
74
- });
75
- exports["default"] = void 0;
76
- var optionsDefaults = {
77
- attributeNames: {
78
- styleName: 'className'
79
- },
80
- generateScopedName: '[path]___[name]__[local]___[hash:base64:5]',
81
- handleMissingStyleName: 'throw'
82
- };
83
- var _default = optionsDefaults;
84
- exports["default"] = _default;
85
-
86
-
87
- });
88
-
89
- var getClassName = createCommonjsModule(function (module, exports) {
90
-
91
- Object.defineProperty(exports, "__esModule", {
92
- value: true
93
- });
94
- exports["default"] = void 0;
95
-
96
- var _optionsDefaults = _interopRequireDefault(optionsDefaults_1);
97
-
98
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
99
-
100
- var isNamespacedStyleName = function isNamespacedStyleName(styleName) {
101
- return styleName.indexOf('.') !== -1;
102
- };
103
-
104
- var handleError = function handleError(message, handleMissingStyleName) {
105
- if (handleMissingStyleName === 'throw') {
106
- throw new Error(message);
107
- } else if (handleMissingStyleName === 'warn') {
108
- // eslint-disable-next-line no-console
109
- console.warn(message);
110
- }
111
-
112
- return null;
113
- };
114
-
115
- var getClassNameForNamespacedStyleName = function getClassNameForNamespacedStyleName(styleName, styleModuleImportMap, handleMissingStyleNameOption) {
116
- // Note:
117
- // Do not use the desctructing syntax with Babel.
118
- // Desctructing adds _slicedToArray helper.
119
- var styleNameParts = styleName.split('.');
120
- var importName = styleNameParts[0];
121
- var moduleName = styleNameParts[1];
122
- var handleMissingStyleName = handleMissingStyleNameOption || _optionsDefaults["default"].handleMissingStyleName;
123
-
124
- if (!moduleName) {
125
- return handleError('Invalid style name: ' + styleName, handleMissingStyleName);
126
- }
127
-
128
- if (!styleModuleImportMap[importName]) {
129
- return handleError('CSS module import does not exist: ' + importName, handleMissingStyleName);
130
- }
131
-
132
- if (!styleModuleImportMap[importName][moduleName]) {
133
- return handleError('CSS module does not exist: ' + moduleName, handleMissingStyleName);
134
- }
135
-
136
- return styleModuleImportMap[importName][moduleName];
137
- };
138
-
139
- var getClassNameFromMultipleImports = function getClassNameFromMultipleImports(styleName, styleModuleImportMap, handleMissingStyleNameOption) {
140
- var handleMissingStyleName = handleMissingStyleNameOption || _optionsDefaults["default"].handleMissingStyleName;
141
- var importKeysWithMatches = Object.keys(styleModuleImportMap).map(function (importKey) {
142
- return styleModuleImportMap[importKey][styleName] && importKey;
143
- }).filter(function (importKey) {
144
- return importKey;
145
- });
146
-
147
- if (importKeysWithMatches.length > 1) {
148
- 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');
149
- }
150
-
151
- if (importKeysWithMatches.length === 0) {
152
- return handleError('Could not resolve the styleName \'' + styleName + '\'.', handleMissingStyleName);
153
- }
154
-
155
- return styleModuleImportMap[importKeysWithMatches[0]][styleName];
156
- };
157
-
158
- var _default = function _default(styleNameValue, styleModuleImportMap, options) {
159
- var styleModuleImportMapKeys = Object.keys(styleModuleImportMap);
160
-
161
- var _ref = options || {},
162
- _ref$handleMissingSty = _ref.handleMissingStyleName,
163
- handleMissingStyleName = _ref$handleMissingSty === void 0 ? _optionsDefaults["default"].handleMissingStyleName : _ref$handleMissingSty,
164
- _ref$autoResolveMulti = _ref.autoResolveMultipleImports,
165
- autoResolveMultipleImports = _ref$autoResolveMulti === void 0 ? _optionsDefaults["default"].autoResolveMultipleImports : _ref$autoResolveMulti;
166
-
167
- if (!styleNameValue) {
168
- return '';
169
- }
170
-
171
- return styleNameValue.split(' ').filter(function (styleName) {
172
- return styleName;
173
- }).map(function (styleName) {
174
- if (isNamespacedStyleName(styleName)) {
175
- return getClassNameForNamespacedStyleName(styleName, styleModuleImportMap, handleMissingStyleName);
176
- }
177
-
178
- if (styleModuleImportMapKeys.length === 0) {
179
- throw new Error('Cannot use styleName attribute for style name \'' + styleName + '\' without importing at least one stylesheet.');
180
- }
181
-
182
- if (styleModuleImportMapKeys.length > 1) {
183
- if (!autoResolveMultipleImports) {
184
- throw new Error('Cannot use anonymous style name \'' + styleName + '\' with more than one stylesheet import without setting \'autoResolveMultipleImports\' to true.');
185
- }
186
-
187
- return getClassNameFromMultipleImports(styleName, styleModuleImportMap, handleMissingStyleName);
188
- }
189
-
190
- var styleModuleMap = styleModuleImportMap[styleModuleImportMapKeys[0]];
191
-
192
- if (!styleModuleMap[styleName]) {
193
- return handleError('Could not resolve the styleName \'' + styleName + '\'.', handleMissingStyleName);
194
- }
195
-
196
- return styleModuleMap[styleName];
197
- }).filter(function (className) {
198
- // Remove any styles which could not be found (if handleMissingStyleName === 'ignore')
199
- return className;
200
- }).join(' ');
201
- };
202
-
203
- exports["default"] = _default;
204
-
205
-
206
- });
207
-
208
- var _getClassName = /*@__PURE__*/getDefaultExportFromCjs(getClassName);
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var _extends = require('@babel/runtime/helpers/extends');
6
+ var _objectWithoutProperties = require('@babel/runtime/helpers/objectWithoutProperties');
7
+ var _getClassName = require('babel-plugin-react-css-modules/dist/browser/getClassName');
8
+ var React = require('react');
9
+ var PropTypes = require('prop-types');
10
+ require('@babel/runtime/helpers/asyncToGenerator');
11
+ require('@babel/runtime/helpers/typeof');
12
+ require('@babel/runtime/regenerator');
13
+ require('lodash');
14
+ require('react-timeago');
15
+ require('date-fns-tz');
16
+ var components = require('@quintype/components');
17
+
18
+ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
19
+
20
+ var _extends__default = /*#__PURE__*/_interopDefaultLegacy(_extends);
21
+ var _objectWithoutProperties__default = /*#__PURE__*/_interopDefaultLegacy(_objectWithoutProperties);
22
+ var _getClassName__default = /*#__PURE__*/_interopDefaultLegacy(_getClassName);
23
+ var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
24
+ var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
209
25
 
210
26
  var _excluded$1 = ["element", "render"];
211
27
  var withElementWrapper = function withElementWrapper(StoryElement) {
212
28
  return function (props) {
213
29
  var element = props.element,
214
30
  render = props.render,
215
- restProps = _objectWithoutProperties(props, _excluded$1);
31
+ restProps = _objectWithoutProperties__default["default"](props, _excluded$1);
216
32
 
217
33
  if (!element) return null;
218
34
  if (render && typeof render === "function") return render(props);
219
- return /*#__PURE__*/React.createElement(StoryElement, _extends({}, restProps, {
35
+ return /*#__PURE__*/React__default["default"].createElement(StoryElement, _extends__default["default"]({}, restProps, {
220
36
  element: element
221
37
  }));
222
38
  };
223
39
  };
224
40
  withElementWrapper.propTypes = {
225
- StoryElement: PropTypes.element
41
+ StoryElement: PropTypes__default["default"].element
226
42
  };
227
43
 
228
- var StateContext = /*#__PURE__*/createContext(); // eslint-disable-next-line react/display-name
44
+ var StateContext = /*#__PURE__*/React.createContext(); // eslint-disable-next-line react/display-name
229
45
  var useStateValue = function useStateValue() {
230
- return useContext(StateContext);
46
+ return React.useContext(StateContext);
231
47
  };
232
48
 
233
- /**
234
- * Copyright (c) 2014-present, Facebook, Inc.
235
- *
236
- * This source code is licensed under the MIT license found in the
237
- * LICENSE file in the root directory of this source tree.
238
- */
239
-
240
- createCommonjsModule(function (module) {
241
- var runtime = (function (exports) {
242
-
243
- var Op = Object.prototype;
244
- var hasOwn = Op.hasOwnProperty;
245
- var undefined$1; // More compressible than void 0.
246
- var $Symbol = typeof Symbol === "function" ? Symbol : {};
247
- var iteratorSymbol = $Symbol.iterator || "@@iterator";
248
- var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator";
249
- var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
250
-
251
- function define(obj, key, value) {
252
- Object.defineProperty(obj, key, {
253
- value: value,
254
- enumerable: true,
255
- configurable: true,
256
- writable: true
257
- });
258
- return obj[key];
259
- }
260
- try {
261
- // IE 8 has a broken Object.defineProperty that only works on DOM objects.
262
- define({}, "");
263
- } catch (err) {
264
- define = function(obj, key, value) {
265
- return obj[key] = value;
266
- };
267
- }
268
-
269
- function wrap(innerFn, outerFn, self, tryLocsList) {
270
- // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.
271
- var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;
272
- var generator = Object.create(protoGenerator.prototype);
273
- var context = new Context(tryLocsList || []);
274
-
275
- // The ._invoke method unifies the implementations of the .next,
276
- // .throw, and .return methods.
277
- generator._invoke = makeInvokeMethod(innerFn, self, context);
278
-
279
- return generator;
280
- }
281
- exports.wrap = wrap;
282
-
283
- // Try/catch helper to minimize deoptimizations. Returns a completion
284
- // record like context.tryEntries[i].completion. This interface could
285
- // have been (and was previously) designed to take a closure to be
286
- // invoked without arguments, but in all the cases we care about we
287
- // already have an existing method we want to call, so there's no need
288
- // to create a new function object. We can even get away with assuming
289
- // the method takes exactly one argument, since that happens to be true
290
- // in every case, so we don't have to touch the arguments object. The
291
- // only additional allocation required is the completion record, which
292
- // has a stable shape and so hopefully should be cheap to allocate.
293
- function tryCatch(fn, obj, arg) {
294
- try {
295
- return { type: "normal", arg: fn.call(obj, arg) };
296
- } catch (err) {
297
- return { type: "throw", arg: err };
298
- }
299
- }
300
-
301
- var GenStateSuspendedStart = "suspendedStart";
302
- var GenStateSuspendedYield = "suspendedYield";
303
- var GenStateExecuting = "executing";
304
- var GenStateCompleted = "completed";
305
-
306
- // Returning this object from the innerFn has the same effect as
307
- // breaking out of the dispatch switch statement.
308
- var ContinueSentinel = {};
309
-
310
- // Dummy constructor functions that we use as the .constructor and
311
- // .constructor.prototype properties for functions that return Generator
312
- // objects. For full spec compliance, you may wish to configure your
313
- // minifier not to mangle the names of these two functions.
314
- function Generator() {}
315
- function GeneratorFunction() {}
316
- function GeneratorFunctionPrototype() {}
317
-
318
- // This is a polyfill for %IteratorPrototype% for environments that
319
- // don't natively support it.
320
- var IteratorPrototype = {};
321
- define(IteratorPrototype, iteratorSymbol, function () {
322
- return this;
323
- });
324
-
325
- var getProto = Object.getPrototypeOf;
326
- var NativeIteratorPrototype = getProto && getProto(getProto(values([])));
327
- if (NativeIteratorPrototype &&
328
- NativeIteratorPrototype !== Op &&
329
- hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {
330
- // This environment has a native %IteratorPrototype%; use it instead
331
- // of the polyfill.
332
- IteratorPrototype = NativeIteratorPrototype;
333
- }
334
-
335
- var Gp = GeneratorFunctionPrototype.prototype =
336
- Generator.prototype = Object.create(IteratorPrototype);
337
- GeneratorFunction.prototype = GeneratorFunctionPrototype;
338
- define(Gp, "constructor", GeneratorFunctionPrototype);
339
- define(GeneratorFunctionPrototype, "constructor", GeneratorFunction);
340
- GeneratorFunction.displayName = define(
341
- GeneratorFunctionPrototype,
342
- toStringTagSymbol,
343
- "GeneratorFunction"
344
- );
345
-
346
- // Helper for defining the .next, .throw, and .return methods of the
347
- // Iterator interface in terms of a single ._invoke method.
348
- function defineIteratorMethods(prototype) {
349
- ["next", "throw", "return"].forEach(function(method) {
350
- define(prototype, method, function(arg) {
351
- return this._invoke(method, arg);
352
- });
353
- });
354
- }
355
-
356
- exports.isGeneratorFunction = function(genFun) {
357
- var ctor = typeof genFun === "function" && genFun.constructor;
358
- return ctor
359
- ? ctor === GeneratorFunction ||
360
- // For the native GeneratorFunction constructor, the best we can
361
- // do is to check its .name property.
362
- (ctor.displayName || ctor.name) === "GeneratorFunction"
363
- : false;
364
- };
365
-
366
- exports.mark = function(genFun) {
367
- if (Object.setPrototypeOf) {
368
- Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);
369
- } else {
370
- genFun.__proto__ = GeneratorFunctionPrototype;
371
- define(genFun, toStringTagSymbol, "GeneratorFunction");
372
- }
373
- genFun.prototype = Object.create(Gp);
374
- return genFun;
375
- };
376
-
377
- // Within the body of any async function, `await x` is transformed to
378
- // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test
379
- // `hasOwn.call(value, "__await")` to determine if the yielded value is
380
- // meant to be awaited.
381
- exports.awrap = function(arg) {
382
- return { __await: arg };
383
- };
384
-
385
- function AsyncIterator(generator, PromiseImpl) {
386
- function invoke(method, arg, resolve, reject) {
387
- var record = tryCatch(generator[method], generator, arg);
388
- if (record.type === "throw") {
389
- reject(record.arg);
390
- } else {
391
- var result = record.arg;
392
- var value = result.value;
393
- if (value &&
394
- typeof value === "object" &&
395
- hasOwn.call(value, "__await")) {
396
- return PromiseImpl.resolve(value.__await).then(function(value) {
397
- invoke("next", value, resolve, reject);
398
- }, function(err) {
399
- invoke("throw", err, resolve, reject);
400
- });
401
- }
402
-
403
- return PromiseImpl.resolve(value).then(function(unwrapped) {
404
- // When a yielded Promise is resolved, its final value becomes
405
- // the .value of the Promise<{value,done}> result for the
406
- // current iteration.
407
- result.value = unwrapped;
408
- resolve(result);
409
- }, function(error) {
410
- // If a rejected Promise was yielded, throw the rejection back
411
- // into the async generator function so it can be handled there.
412
- return invoke("throw", error, resolve, reject);
413
- });
414
- }
415
- }
416
-
417
- var previousPromise;
418
-
419
- function enqueue(method, arg) {
420
- function callInvokeWithMethodAndArg() {
421
- return new PromiseImpl(function(resolve, reject) {
422
- invoke(method, arg, resolve, reject);
423
- });
424
- }
425
-
426
- return previousPromise =
427
- // If enqueue has been called before, then we want to wait until
428
- // all previous Promises have been resolved before calling invoke,
429
- // so that results are always delivered in the correct order. If
430
- // enqueue has not been called before, then it is important to
431
- // call invoke immediately, without waiting on a callback to fire,
432
- // so that the async generator function has the opportunity to do
433
- // any necessary setup in a predictable way. This predictability
434
- // is why the Promise constructor synchronously invokes its
435
- // executor callback, and why async functions synchronously
436
- // execute code before the first await. Since we implement simple
437
- // async functions in terms of async generators, it is especially
438
- // important to get this right, even though it requires care.
439
- previousPromise ? previousPromise.then(
440
- callInvokeWithMethodAndArg,
441
- // Avoid propagating failures to Promises returned by later
442
- // invocations of the iterator.
443
- callInvokeWithMethodAndArg
444
- ) : callInvokeWithMethodAndArg();
445
- }
446
-
447
- // Define the unified helper method that is used to implement .next,
448
- // .throw, and .return (see defineIteratorMethods).
449
- this._invoke = enqueue;
450
- }
451
-
452
- defineIteratorMethods(AsyncIterator.prototype);
453
- define(AsyncIterator.prototype, asyncIteratorSymbol, function () {
454
- return this;
455
- });
456
- exports.AsyncIterator = AsyncIterator;
457
-
458
- // Note that simple async functions are implemented on top of
459
- // AsyncIterator objects; they just return a Promise for the value of
460
- // the final result produced by the iterator.
461
- exports.async = function(innerFn, outerFn, self, tryLocsList, PromiseImpl) {
462
- if (PromiseImpl === void 0) PromiseImpl = Promise;
463
-
464
- var iter = new AsyncIterator(
465
- wrap(innerFn, outerFn, self, tryLocsList),
466
- PromiseImpl
467
- );
468
-
469
- return exports.isGeneratorFunction(outerFn)
470
- ? iter // If outerFn is a generator, return the full iterator.
471
- : iter.next().then(function(result) {
472
- return result.done ? result.value : iter.next();
473
- });
474
- };
475
-
476
- function makeInvokeMethod(innerFn, self, context) {
477
- var state = GenStateSuspendedStart;
478
-
479
- return function invoke(method, arg) {
480
- if (state === GenStateExecuting) {
481
- throw new Error("Generator is already running");
482
- }
483
-
484
- if (state === GenStateCompleted) {
485
- if (method === "throw") {
486
- throw arg;
487
- }
488
-
489
- // Be forgiving, per 25.3.3.3.3 of the spec:
490
- // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume
491
- return doneResult();
492
- }
493
-
494
- context.method = method;
495
- context.arg = arg;
496
-
497
- while (true) {
498
- var delegate = context.delegate;
499
- if (delegate) {
500
- var delegateResult = maybeInvokeDelegate(delegate, context);
501
- if (delegateResult) {
502
- if (delegateResult === ContinueSentinel) continue;
503
- return delegateResult;
504
- }
505
- }
506
-
507
- if (context.method === "next") {
508
- // Setting context._sent for legacy support of Babel's
509
- // function.sent implementation.
510
- context.sent = context._sent = context.arg;
511
-
512
- } else if (context.method === "throw") {
513
- if (state === GenStateSuspendedStart) {
514
- state = GenStateCompleted;
515
- throw context.arg;
516
- }
517
-
518
- context.dispatchException(context.arg);
519
-
520
- } else if (context.method === "return") {
521
- context.abrupt("return", context.arg);
522
- }
523
-
524
- state = GenStateExecuting;
525
-
526
- var record = tryCatch(innerFn, self, context);
527
- if (record.type === "normal") {
528
- // If an exception is thrown from innerFn, we leave state ===
529
- // GenStateExecuting and loop back for another invocation.
530
- state = context.done
531
- ? GenStateCompleted
532
- : GenStateSuspendedYield;
533
-
534
- if (record.arg === ContinueSentinel) {
535
- continue;
536
- }
537
-
538
- return {
539
- value: record.arg,
540
- done: context.done
541
- };
542
-
543
- } else if (record.type === "throw") {
544
- state = GenStateCompleted;
545
- // Dispatch the exception by looping back around to the
546
- // context.dispatchException(context.arg) call above.
547
- context.method = "throw";
548
- context.arg = record.arg;
549
- }
550
- }
551
- };
552
- }
553
-
554
- // Call delegate.iterator[context.method](context.arg) and handle the
555
- // result, either by returning a { value, done } result from the
556
- // delegate iterator, or by modifying context.method and context.arg,
557
- // setting context.delegate to null, and returning the ContinueSentinel.
558
- function maybeInvokeDelegate(delegate, context) {
559
- var method = delegate.iterator[context.method];
560
- if (method === undefined$1) {
561
- // A .throw or .return when the delegate iterator has no .throw
562
- // method always terminates the yield* loop.
563
- context.delegate = null;
564
-
565
- if (context.method === "throw") {
566
- // Note: ["return"] must be used for ES3 parsing compatibility.
567
- if (delegate.iterator["return"]) {
568
- // If the delegate iterator has a return method, give it a
569
- // chance to clean up.
570
- context.method = "return";
571
- context.arg = undefined$1;
572
- maybeInvokeDelegate(delegate, context);
573
-
574
- if (context.method === "throw") {
575
- // If maybeInvokeDelegate(context) changed context.method from
576
- // "return" to "throw", let that override the TypeError below.
577
- return ContinueSentinel;
578
- }
579
- }
580
-
581
- context.method = "throw";
582
- context.arg = new TypeError(
583
- "The iterator does not provide a 'throw' method");
584
- }
585
-
586
- return ContinueSentinel;
587
- }
588
-
589
- var record = tryCatch(method, delegate.iterator, context.arg);
590
-
591
- if (record.type === "throw") {
592
- context.method = "throw";
593
- context.arg = record.arg;
594
- context.delegate = null;
595
- return ContinueSentinel;
596
- }
597
-
598
- var info = record.arg;
599
-
600
- if (! info) {
601
- context.method = "throw";
602
- context.arg = new TypeError("iterator result is not an object");
603
- context.delegate = null;
604
- return ContinueSentinel;
605
- }
606
-
607
- if (info.done) {
608
- // Assign the result of the finished delegate to the temporary
609
- // variable specified by delegate.resultName (see delegateYield).
610
- context[delegate.resultName] = info.value;
611
-
612
- // Resume execution at the desired location (see delegateYield).
613
- context.next = delegate.nextLoc;
614
-
615
- // If context.method was "throw" but the delegate handled the
616
- // exception, let the outer generator proceed normally. If
617
- // context.method was "next", forget context.arg since it has been
618
- // "consumed" by the delegate iterator. If context.method was
619
- // "return", allow the original .return call to continue in the
620
- // outer generator.
621
- if (context.method !== "return") {
622
- context.method = "next";
623
- context.arg = undefined$1;
624
- }
625
-
626
- } else {
627
- // Re-yield the result returned by the delegate method.
628
- return info;
629
- }
630
-
631
- // The delegate iterator is finished, so forget it and continue with
632
- // the outer generator.
633
- context.delegate = null;
634
- return ContinueSentinel;
635
- }
636
-
637
- // Define Generator.prototype.{next,throw,return} in terms of the
638
- // unified ._invoke helper method.
639
- defineIteratorMethods(Gp);
640
-
641
- define(Gp, toStringTagSymbol, "Generator");
642
-
643
- // A Generator should always return itself as the iterator object when the
644
- // @@iterator function is called on it. Some browsers' implementations of the
645
- // iterator prototype chain incorrectly implement this, causing the Generator
646
- // object to not be returned from this call. This ensures that doesn't happen.
647
- // See https://github.com/facebook/regenerator/issues/274 for more details.
648
- define(Gp, iteratorSymbol, function() {
649
- return this;
650
- });
651
-
652
- define(Gp, "toString", function() {
653
- return "[object Generator]";
654
- });
655
-
656
- function pushTryEntry(locs) {
657
- var entry = { tryLoc: locs[0] };
658
-
659
- if (1 in locs) {
660
- entry.catchLoc = locs[1];
661
- }
662
-
663
- if (2 in locs) {
664
- entry.finallyLoc = locs[2];
665
- entry.afterLoc = locs[3];
666
- }
667
-
668
- this.tryEntries.push(entry);
669
- }
670
-
671
- function resetTryEntry(entry) {
672
- var record = entry.completion || {};
673
- record.type = "normal";
674
- delete record.arg;
675
- entry.completion = record;
676
- }
677
-
678
- function Context(tryLocsList) {
679
- // The root entry object (effectively a try statement without a catch
680
- // or a finally block) gives us a place to store values thrown from
681
- // locations where there is no enclosing try statement.
682
- this.tryEntries = [{ tryLoc: "root" }];
683
- tryLocsList.forEach(pushTryEntry, this);
684
- this.reset(true);
685
- }
686
-
687
- exports.keys = function(object) {
688
- var keys = [];
689
- for (var key in object) {
690
- keys.push(key);
691
- }
692
- keys.reverse();
693
-
694
- // Rather than returning an object with a next method, we keep
695
- // things simple and return the next function itself.
696
- return function next() {
697
- while (keys.length) {
698
- var key = keys.pop();
699
- if (key in object) {
700
- next.value = key;
701
- next.done = false;
702
- return next;
703
- }
704
- }
705
-
706
- // To avoid creating an additional object, we just hang the .value
707
- // and .done properties off the next function object itself. This
708
- // also ensures that the minifier will not anonymize the function.
709
- next.done = true;
710
- return next;
711
- };
712
- };
713
-
714
- function values(iterable) {
715
- if (iterable) {
716
- var iteratorMethod = iterable[iteratorSymbol];
717
- if (iteratorMethod) {
718
- return iteratorMethod.call(iterable);
719
- }
720
-
721
- if (typeof iterable.next === "function") {
722
- return iterable;
723
- }
724
-
725
- if (!isNaN(iterable.length)) {
726
- var i = -1, next = function next() {
727
- while (++i < iterable.length) {
728
- if (hasOwn.call(iterable, i)) {
729
- next.value = iterable[i];
730
- next.done = false;
731
- return next;
732
- }
733
- }
734
-
735
- next.value = undefined$1;
736
- next.done = true;
737
-
738
- return next;
739
- };
740
-
741
- return next.next = next;
742
- }
743
- }
744
-
745
- // Return an iterator with no values.
746
- return { next: doneResult };
747
- }
748
- exports.values = values;
749
-
750
- function doneResult() {
751
- return { value: undefined$1, done: true };
752
- }
753
-
754
- Context.prototype = {
755
- constructor: Context,
756
-
757
- reset: function(skipTempReset) {
758
- this.prev = 0;
759
- this.next = 0;
760
- // Resetting context._sent for legacy support of Babel's
761
- // function.sent implementation.
762
- this.sent = this._sent = undefined$1;
763
- this.done = false;
764
- this.delegate = null;
765
-
766
- this.method = "next";
767
- this.arg = undefined$1;
768
-
769
- this.tryEntries.forEach(resetTryEntry);
770
-
771
- if (!skipTempReset) {
772
- for (var name in this) {
773
- // Not sure about the optimal order of these conditions:
774
- if (name.charAt(0) === "t" &&
775
- hasOwn.call(this, name) &&
776
- !isNaN(+name.slice(1))) {
777
- this[name] = undefined$1;
778
- }
779
- }
780
- }
781
- },
782
-
783
- stop: function() {
784
- this.done = true;
785
-
786
- var rootEntry = this.tryEntries[0];
787
- var rootRecord = rootEntry.completion;
788
- if (rootRecord.type === "throw") {
789
- throw rootRecord.arg;
790
- }
791
-
792
- return this.rval;
793
- },
794
-
795
- dispatchException: function(exception) {
796
- if (this.done) {
797
- throw exception;
798
- }
799
-
800
- var context = this;
801
- function handle(loc, caught) {
802
- record.type = "throw";
803
- record.arg = exception;
804
- context.next = loc;
805
-
806
- if (caught) {
807
- // If the dispatched exception was caught by a catch block,
808
- // then let that catch block handle the exception normally.
809
- context.method = "next";
810
- context.arg = undefined$1;
811
- }
812
-
813
- return !! caught;
814
- }
815
-
816
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
817
- var entry = this.tryEntries[i];
818
- var record = entry.completion;
819
-
820
- if (entry.tryLoc === "root") {
821
- // Exception thrown outside of any try block that could handle
822
- // it, so set the completion value of the entire function to
823
- // throw the exception.
824
- return handle("end");
825
- }
826
-
827
- if (entry.tryLoc <= this.prev) {
828
- var hasCatch = hasOwn.call(entry, "catchLoc");
829
- var hasFinally = hasOwn.call(entry, "finallyLoc");
830
-
831
- if (hasCatch && hasFinally) {
832
- if (this.prev < entry.catchLoc) {
833
- return handle(entry.catchLoc, true);
834
- } else if (this.prev < entry.finallyLoc) {
835
- return handle(entry.finallyLoc);
836
- }
837
-
838
- } else if (hasCatch) {
839
- if (this.prev < entry.catchLoc) {
840
- return handle(entry.catchLoc, true);
841
- }
842
-
843
- } else if (hasFinally) {
844
- if (this.prev < entry.finallyLoc) {
845
- return handle(entry.finallyLoc);
846
- }
847
-
848
- } else {
849
- throw new Error("try statement without catch or finally");
850
- }
851
- }
852
- }
853
- },
854
-
855
- abrupt: function(type, arg) {
856
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
857
- var entry = this.tryEntries[i];
858
- if (entry.tryLoc <= this.prev &&
859
- hasOwn.call(entry, "finallyLoc") &&
860
- this.prev < entry.finallyLoc) {
861
- var finallyEntry = entry;
862
- break;
863
- }
864
- }
865
-
866
- if (finallyEntry &&
867
- (type === "break" ||
868
- type === "continue") &&
869
- finallyEntry.tryLoc <= arg &&
870
- arg <= finallyEntry.finallyLoc) {
871
- // Ignore the finally entry if control is not jumping to a
872
- // location outside the try/catch block.
873
- finallyEntry = null;
874
- }
875
-
876
- var record = finallyEntry ? finallyEntry.completion : {};
877
- record.type = type;
878
- record.arg = arg;
879
-
880
- if (finallyEntry) {
881
- this.method = "next";
882
- this.next = finallyEntry.finallyLoc;
883
- return ContinueSentinel;
884
- }
885
-
886
- return this.complete(record);
887
- },
888
-
889
- complete: function(record, afterLoc) {
890
- if (record.type === "throw") {
891
- throw record.arg;
892
- }
893
-
894
- if (record.type === "break" ||
895
- record.type === "continue") {
896
- this.next = record.arg;
897
- } else if (record.type === "return") {
898
- this.rval = this.arg = record.arg;
899
- this.method = "return";
900
- this.next = "end";
901
- } else if (record.type === "normal" && afterLoc) {
902
- this.next = afterLoc;
903
- }
904
-
905
- return ContinueSentinel;
906
- },
907
-
908
- finish: function(finallyLoc) {
909
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
910
- var entry = this.tryEntries[i];
911
- if (entry.finallyLoc === finallyLoc) {
912
- this.complete(entry.completion, entry.afterLoc);
913
- resetTryEntry(entry);
914
- return ContinueSentinel;
915
- }
916
- }
917
- },
918
-
919
- "catch": function(tryLoc) {
920
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
921
- var entry = this.tryEntries[i];
922
- if (entry.tryLoc === tryLoc) {
923
- var record = entry.completion;
924
- if (record.type === "throw") {
925
- var thrown = record.arg;
926
- resetTryEntry(entry);
927
- }
928
- return thrown;
929
- }
930
- }
931
-
932
- // The context.catch method must only be called with a location
933
- // argument that corresponds to a known catch block.
934
- throw new Error("illegal catch attempt");
935
- },
936
-
937
- delegateYield: function(iterable, resultName, nextLoc) {
938
- this.delegate = {
939
- iterator: values(iterable),
940
- resultName: resultName,
941
- nextLoc: nextLoc
942
- };
943
-
944
- if (this.method === "next") {
945
- // Deliberately forget the last sent value so that we don't
946
- // accidentally pass it on to the delegate.
947
- this.arg = undefined$1;
948
- }
949
-
950
- return ContinueSentinel;
951
- }
952
- };
953
-
954
- // Regardless of whether this script is executing as a CommonJS module
955
- // or not, return the runtime object so that we can declare the variable
956
- // regeneratorRuntime in the outer scope, which allows this module to be
957
- // injected easily by `bin/regenerator --include-runtime script.js`.
958
- return exports;
959
-
960
- }(
961
- // If this script is executing as a CommonJS module, use module.exports
962
- // as the regeneratorRuntime namespace. Otherwise create a new empty
963
- // object. Either way, the resulting object will be used to initialize
964
- // the regeneratorRuntime variable at the top of this file.
965
- module.exports
966
- ));
967
-
968
- try {
969
- regeneratorRuntime = runtime;
970
- } catch (accidentalStrictMode) {
971
- // This module should not be running in strict mode, so the above
972
- // assignment should always work unless something is misconfigured. Just
973
- // in case runtime.js accidentally runs in strict mode, in modern engines
974
- // we can explicitly access globalThis. In older engines we can escape
975
- // strict mode using a global Function call. This could conceivably fail
976
- // if a Content Security Policy forbids using Function, but in that case
977
- // the proper solution is to fix the accidental strict mode problem. If
978
- // you've misconfigured your bundler to force strict mode and applied a
979
- // CSP to forbid Function, and you're not willing to fix either of those
980
- // problems, please detail your unique predicament in a GitHub issue.
981
- if (typeof globalThis === "object") {
982
- globalThis.regeneratorRuntime = runtime;
983
- } else {
984
- Function("r", "regeneratorRuntime = r")(runtime);
985
- }
986
- }
987
- });
988
-
989
- /** Detect free variable `global` from Node.js. */
990
-
991
- var freeGlobal = typeof commonjsGlobal == 'object' && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal;
992
-
993
- var _freeGlobal = freeGlobal;
994
-
995
- /** Detect free variable `self`. */
996
- var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
997
-
998
- /** Used as a reference to the global object. */
999
- var root = _freeGlobal || freeSelf || Function('return this')();
1000
-
1001
- var _root = root;
1002
-
1003
- /** Built-in value references. */
1004
- var Symbol$1 = _root.Symbol;
1005
-
1006
- var _Symbol = Symbol$1;
1007
-
1008
- /** Used for built-in method references. */
1009
- var objectProto$4 = Object.prototype;
1010
-
1011
- /** Used to check objects for own properties. */
1012
- var hasOwnProperty$3 = objectProto$4.hasOwnProperty;
1013
-
1014
- /**
1015
- * Used to resolve the
1016
- * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
1017
- * of values.
1018
- */
1019
- var nativeObjectToString$1 = objectProto$4.toString;
1020
-
1021
- /** Built-in value references. */
1022
- var symToStringTag$1 = _Symbol ? _Symbol.toStringTag : undefined;
1023
-
1024
- /**
1025
- * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
1026
- *
1027
- * @private
1028
- * @param {*} value The value to query.
1029
- * @returns {string} Returns the raw `toStringTag`.
1030
- */
1031
- function getRawTag(value) {
1032
- var isOwn = hasOwnProperty$3.call(value, symToStringTag$1),
1033
- tag = value[symToStringTag$1];
1034
-
1035
- try {
1036
- value[symToStringTag$1] = undefined;
1037
- var unmasked = true;
1038
- } catch (e) {}
1039
-
1040
- var result = nativeObjectToString$1.call(value);
1041
- if (unmasked) {
1042
- if (isOwn) {
1043
- value[symToStringTag$1] = tag;
1044
- } else {
1045
- delete value[symToStringTag$1];
1046
- }
1047
- }
1048
- return result;
1049
- }
1050
-
1051
- var _getRawTag = getRawTag;
1052
-
1053
- /** Used for built-in method references. */
1054
- var objectProto$3 = Object.prototype;
1055
-
1056
- /**
1057
- * Used to resolve the
1058
- * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
1059
- * of values.
1060
- */
1061
- var nativeObjectToString = objectProto$3.toString;
1062
-
1063
- /**
1064
- * Converts `value` to a string using `Object.prototype.toString`.
1065
- *
1066
- * @private
1067
- * @param {*} value The value to convert.
1068
- * @returns {string} Returns the converted string.
1069
- */
1070
- function objectToString(value) {
1071
- return nativeObjectToString.call(value);
1072
- }
1073
-
1074
- var _objectToString = objectToString;
1075
-
1076
- /** `Object#toString` result references. */
1077
- var nullTag = '[object Null]',
1078
- undefinedTag = '[object Undefined]';
1079
-
1080
- /** Built-in value references. */
1081
- var symToStringTag = _Symbol ? _Symbol.toStringTag : undefined;
1082
-
1083
- /**
1084
- * The base implementation of `getTag` without fallbacks for buggy environments.
1085
- *
1086
- * @private
1087
- * @param {*} value The value to query.
1088
- * @returns {string} Returns the `toStringTag`.
1089
- */
1090
- function baseGetTag(value) {
1091
- if (value == null) {
1092
- return value === undefined ? undefinedTag : nullTag;
1093
- }
1094
- return (symToStringTag && symToStringTag in Object(value))
1095
- ? _getRawTag(value)
1096
- : _objectToString(value);
1097
- }
1098
-
1099
- var _baseGetTag = baseGetTag;
1100
-
1101
- /**
1102
- * Checks if `value` is the
1103
- * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
1104
- * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
1105
- *
1106
- * @static
1107
- * @memberOf _
1108
- * @since 0.1.0
1109
- * @category Lang
1110
- * @param {*} value The value to check.
1111
- * @returns {boolean} Returns `true` if `value` is an object, else `false`.
1112
- * @example
1113
- *
1114
- * _.isObject({});
1115
- * // => true
1116
- *
1117
- * _.isObject([1, 2, 3]);
1118
- * // => true
1119
- *
1120
- * _.isObject(_.noop);
1121
- * // => true
1122
- *
1123
- * _.isObject(null);
1124
- * // => false
1125
- */
1126
- function isObject(value) {
1127
- var type = typeof value;
1128
- return value != null && (type == 'object' || type == 'function');
1129
- }
1130
-
1131
- var isObject_1 = isObject;
1132
-
1133
- /** `Object#toString` result references. */
1134
- var asyncTag = '[object AsyncFunction]',
1135
- funcTag = '[object Function]',
1136
- genTag = '[object GeneratorFunction]',
1137
- proxyTag = '[object Proxy]';
1138
-
1139
- /**
1140
- * Checks if `value` is classified as a `Function` object.
1141
- *
1142
- * @static
1143
- * @memberOf _
1144
- * @since 0.1.0
1145
- * @category Lang
1146
- * @param {*} value The value to check.
1147
- * @returns {boolean} Returns `true` if `value` is a function, else `false`.
1148
- * @example
1149
- *
1150
- * _.isFunction(_);
1151
- * // => true
1152
- *
1153
- * _.isFunction(/abc/);
1154
- * // => false
1155
- */
1156
- function isFunction(value) {
1157
- if (!isObject_1(value)) {
1158
- return false;
1159
- }
1160
- // The use of `Object#toString` avoids issues with the `typeof` operator
1161
- // in Safari 9 which returns 'object' for typed arrays and other constructors.
1162
- var tag = _baseGetTag(value);
1163
- return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
1164
- }
1165
-
1166
- var isFunction_1 = isFunction;
1167
-
1168
- /** Used to detect overreaching core-js shims. */
1169
- var coreJsData = _root['__core-js_shared__'];
1170
-
1171
- var _coreJsData = coreJsData;
1172
-
1173
- /** Used to detect methods masquerading as native. */
1174
- var maskSrcKey = (function() {
1175
- var uid = /[^.]+$/.exec(_coreJsData && _coreJsData.keys && _coreJsData.keys.IE_PROTO || '');
1176
- return uid ? ('Symbol(src)_1.' + uid) : '';
1177
- }());
1178
-
1179
- /**
1180
- * Checks if `func` has its source masked.
1181
- *
1182
- * @private
1183
- * @param {Function} func The function to check.
1184
- * @returns {boolean} Returns `true` if `func` is masked, else `false`.
1185
- */
1186
- function isMasked(func) {
1187
- return !!maskSrcKey && (maskSrcKey in func);
1188
- }
1189
-
1190
- var _isMasked = isMasked;
1191
-
1192
- /** Used for built-in method references. */
1193
- var funcProto$1 = Function.prototype;
1194
-
1195
- /** Used to resolve the decompiled source of functions. */
1196
- var funcToString$1 = funcProto$1.toString;
1197
-
1198
- /**
1199
- * Converts `func` to its source code.
1200
- *
1201
- * @private
1202
- * @param {Function} func The function to convert.
1203
- * @returns {string} Returns the source code.
1204
- */
1205
- function toSource(func) {
1206
- if (func != null) {
1207
- try {
1208
- return funcToString$1.call(func);
1209
- } catch (e) {}
1210
- try {
1211
- return (func + '');
1212
- } catch (e) {}
1213
- }
1214
- return '';
1215
- }
1216
-
1217
- var _toSource = toSource;
1218
-
1219
- /**
1220
- * Used to match `RegExp`
1221
- * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
1222
- */
1223
- var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
1224
-
1225
- /** Used to detect host constructors (Safari). */
1226
- var reIsHostCtor = /^\[object .+?Constructor\]$/;
1227
-
1228
- /** Used for built-in method references. */
1229
- var funcProto = Function.prototype,
1230
- objectProto$2 = Object.prototype;
1231
-
1232
- /** Used to resolve the decompiled source of functions. */
1233
- var funcToString = funcProto.toString;
1234
-
1235
- /** Used to check objects for own properties. */
1236
- var hasOwnProperty$2 = objectProto$2.hasOwnProperty;
1237
-
1238
- /** Used to detect if a method is native. */
1239
- var reIsNative = RegExp('^' +
1240
- funcToString.call(hasOwnProperty$2).replace(reRegExpChar, '\\$&')
1241
- .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
1242
- );
1243
-
1244
- /**
1245
- * The base implementation of `_.isNative` without bad shim checks.
1246
- *
1247
- * @private
1248
- * @param {*} value The value to check.
1249
- * @returns {boolean} Returns `true` if `value` is a native function,
1250
- * else `false`.
1251
- */
1252
- function baseIsNative(value) {
1253
- if (!isObject_1(value) || _isMasked(value)) {
1254
- return false;
1255
- }
1256
- var pattern = isFunction_1(value) ? reIsNative : reIsHostCtor;
1257
- return pattern.test(_toSource(value));
1258
- }
1259
-
1260
- var _baseIsNative = baseIsNative;
1261
-
1262
- /**
1263
- * Gets the value at `key` of `object`.
1264
- *
1265
- * @private
1266
- * @param {Object} [object] The object to query.
1267
- * @param {string} key The key of the property to get.
1268
- * @returns {*} Returns the property value.
1269
- */
1270
- function getValue(object, key) {
1271
- return object == null ? undefined : object[key];
1272
- }
1273
-
1274
- var _getValue = getValue;
1275
-
1276
- /**
1277
- * Gets the native function at `key` of `object`.
1278
- *
1279
- * @private
1280
- * @param {Object} object The object to query.
1281
- * @param {string} key The key of the method to get.
1282
- * @returns {*} Returns the function if it's native, else `undefined`.
1283
- */
1284
- function getNative(object, key) {
1285
- var value = _getValue(object, key);
1286
- return _baseIsNative(value) ? value : undefined;
1287
- }
1288
-
1289
- var _getNative = getNative;
1290
-
1291
- /* Built-in method references that are verified to be native. */
1292
- var nativeCreate = _getNative(Object, 'create');
1293
-
1294
- var _nativeCreate = nativeCreate;
1295
-
1296
- /**
1297
- * Removes all key-value entries from the hash.
1298
- *
1299
- * @private
1300
- * @name clear
1301
- * @memberOf Hash
1302
- */
1303
- function hashClear() {
1304
- this.__data__ = _nativeCreate ? _nativeCreate(null) : {};
1305
- this.size = 0;
1306
- }
1307
-
1308
- var _hashClear = hashClear;
1309
-
1310
- /**
1311
- * Removes `key` and its value from the hash.
1312
- *
1313
- * @private
1314
- * @name delete
1315
- * @memberOf Hash
1316
- * @param {Object} hash The hash to modify.
1317
- * @param {string} key The key of the value to remove.
1318
- * @returns {boolean} Returns `true` if the entry was removed, else `false`.
1319
- */
1320
- function hashDelete(key) {
1321
- var result = this.has(key) && delete this.__data__[key];
1322
- this.size -= result ? 1 : 0;
1323
- return result;
1324
- }
1325
-
1326
- var _hashDelete = hashDelete;
1327
-
1328
- /** Used to stand-in for `undefined` hash values. */
1329
- var HASH_UNDEFINED$1 = '__lodash_hash_undefined__';
1330
-
1331
- /** Used for built-in method references. */
1332
- var objectProto$1 = Object.prototype;
1333
-
1334
- /** Used to check objects for own properties. */
1335
- var hasOwnProperty$1 = objectProto$1.hasOwnProperty;
1336
-
1337
- /**
1338
- * Gets the hash value for `key`.
1339
- *
1340
- * @private
1341
- * @name get
1342
- * @memberOf Hash
1343
- * @param {string} key The key of the value to get.
1344
- * @returns {*} Returns the entry value.
1345
- */
1346
- function hashGet(key) {
1347
- var data = this.__data__;
1348
- if (_nativeCreate) {
1349
- var result = data[key];
1350
- return result === HASH_UNDEFINED$1 ? undefined : result;
1351
- }
1352
- return hasOwnProperty$1.call(data, key) ? data[key] : undefined;
1353
- }
1354
-
1355
- var _hashGet = hashGet;
1356
-
1357
- /** Used for built-in method references. */
1358
- var objectProto = Object.prototype;
1359
-
1360
- /** Used to check objects for own properties. */
1361
- var hasOwnProperty = objectProto.hasOwnProperty;
1362
-
1363
- /**
1364
- * Checks if a hash value for `key` exists.
1365
- *
1366
- * @private
1367
- * @name has
1368
- * @memberOf Hash
1369
- * @param {string} key The key of the entry to check.
1370
- * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
1371
- */
1372
- function hashHas(key) {
1373
- var data = this.__data__;
1374
- return _nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);
1375
- }
1376
-
1377
- var _hashHas = hashHas;
1378
-
1379
- /** Used to stand-in for `undefined` hash values. */
1380
- var HASH_UNDEFINED = '__lodash_hash_undefined__';
1381
-
1382
- /**
1383
- * Sets the hash `key` to `value`.
1384
- *
1385
- * @private
1386
- * @name set
1387
- * @memberOf Hash
1388
- * @param {string} key The key of the value to set.
1389
- * @param {*} value The value to set.
1390
- * @returns {Object} Returns the hash instance.
1391
- */
1392
- function hashSet(key, value) {
1393
- var data = this.__data__;
1394
- this.size += this.has(key) ? 0 : 1;
1395
- data[key] = (_nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
1396
- return this;
1397
- }
1398
-
1399
- var _hashSet = hashSet;
1400
-
1401
- /**
1402
- * Creates a hash object.
1403
- *
1404
- * @private
1405
- * @constructor
1406
- * @param {Array} [entries] The key-value pairs to cache.
1407
- */
1408
- function Hash(entries) {
1409
- var index = -1,
1410
- length = entries == null ? 0 : entries.length;
1411
-
1412
- this.clear();
1413
- while (++index < length) {
1414
- var entry = entries[index];
1415
- this.set(entry[0], entry[1]);
1416
- }
1417
- }
1418
-
1419
- // Add methods to `Hash`.
1420
- Hash.prototype.clear = _hashClear;
1421
- Hash.prototype['delete'] = _hashDelete;
1422
- Hash.prototype.get = _hashGet;
1423
- Hash.prototype.has = _hashHas;
1424
- Hash.prototype.set = _hashSet;
1425
-
1426
- var _Hash = Hash;
1427
-
1428
- /**
1429
- * Removes all key-value entries from the list cache.
1430
- *
1431
- * @private
1432
- * @name clear
1433
- * @memberOf ListCache
1434
- */
1435
- function listCacheClear() {
1436
- this.__data__ = [];
1437
- this.size = 0;
1438
- }
1439
-
1440
- var _listCacheClear = listCacheClear;
1441
-
1442
- /**
1443
- * Performs a
1444
- * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
1445
- * comparison between two values to determine if they are equivalent.
1446
- *
1447
- * @static
1448
- * @memberOf _
1449
- * @since 4.0.0
1450
- * @category Lang
1451
- * @param {*} value The value to compare.
1452
- * @param {*} other The other value to compare.
1453
- * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
1454
- * @example
1455
- *
1456
- * var object = { 'a': 1 };
1457
- * var other = { 'a': 1 };
1458
- *
1459
- * _.eq(object, object);
1460
- * // => true
1461
- *
1462
- * _.eq(object, other);
1463
- * // => false
1464
- *
1465
- * _.eq('a', 'a');
1466
- * // => true
1467
- *
1468
- * _.eq('a', Object('a'));
1469
- * // => false
1470
- *
1471
- * _.eq(NaN, NaN);
1472
- * // => true
1473
- */
1474
- function eq(value, other) {
1475
- return value === other || (value !== value && other !== other);
1476
- }
1477
-
1478
- var eq_1 = eq;
1479
-
1480
- /**
1481
- * Gets the index at which the `key` is found in `array` of key-value pairs.
1482
- *
1483
- * @private
1484
- * @param {Array} array The array to inspect.
1485
- * @param {*} key The key to search for.
1486
- * @returns {number} Returns the index of the matched value, else `-1`.
1487
- */
1488
- function assocIndexOf(array, key) {
1489
- var length = array.length;
1490
- while (length--) {
1491
- if (eq_1(array[length][0], key)) {
1492
- return length;
1493
- }
1494
- }
1495
- return -1;
1496
- }
1497
-
1498
- var _assocIndexOf = assocIndexOf;
1499
-
1500
- /** Used for built-in method references. */
1501
- var arrayProto = Array.prototype;
1502
-
1503
- /** Built-in value references. */
1504
- var splice = arrayProto.splice;
1505
-
1506
- /**
1507
- * Removes `key` and its value from the list cache.
1508
- *
1509
- * @private
1510
- * @name delete
1511
- * @memberOf ListCache
1512
- * @param {string} key The key of the value to remove.
1513
- * @returns {boolean} Returns `true` if the entry was removed, else `false`.
1514
- */
1515
- function listCacheDelete(key) {
1516
- var data = this.__data__,
1517
- index = _assocIndexOf(data, key);
1518
-
1519
- if (index < 0) {
1520
- return false;
1521
- }
1522
- var lastIndex = data.length - 1;
1523
- if (index == lastIndex) {
1524
- data.pop();
1525
- } else {
1526
- splice.call(data, index, 1);
1527
- }
1528
- --this.size;
1529
- return true;
1530
- }
1531
-
1532
- var _listCacheDelete = listCacheDelete;
1533
-
1534
- /**
1535
- * Gets the list cache value for `key`.
1536
- *
1537
- * @private
1538
- * @name get
1539
- * @memberOf ListCache
1540
- * @param {string} key The key of the value to get.
1541
- * @returns {*} Returns the entry value.
1542
- */
1543
- function listCacheGet(key) {
1544
- var data = this.__data__,
1545
- index = _assocIndexOf(data, key);
1546
-
1547
- return index < 0 ? undefined : data[index][1];
1548
- }
1549
-
1550
- var _listCacheGet = listCacheGet;
1551
-
1552
- /**
1553
- * Checks if a list cache value for `key` exists.
1554
- *
1555
- * @private
1556
- * @name has
1557
- * @memberOf ListCache
1558
- * @param {string} key The key of the entry to check.
1559
- * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
1560
- */
1561
- function listCacheHas(key) {
1562
- return _assocIndexOf(this.__data__, key) > -1;
1563
- }
1564
-
1565
- var _listCacheHas = listCacheHas;
1566
-
1567
- /**
1568
- * Sets the list cache `key` to `value`.
1569
- *
1570
- * @private
1571
- * @name set
1572
- * @memberOf ListCache
1573
- * @param {string} key The key of the value to set.
1574
- * @param {*} value The value to set.
1575
- * @returns {Object} Returns the list cache instance.
1576
- */
1577
- function listCacheSet(key, value) {
1578
- var data = this.__data__,
1579
- index = _assocIndexOf(data, key);
1580
-
1581
- if (index < 0) {
1582
- ++this.size;
1583
- data.push([key, value]);
1584
- } else {
1585
- data[index][1] = value;
1586
- }
1587
- return this;
1588
- }
1589
-
1590
- var _listCacheSet = listCacheSet;
1591
-
1592
- /**
1593
- * Creates an list cache object.
1594
- *
1595
- * @private
1596
- * @constructor
1597
- * @param {Array} [entries] The key-value pairs to cache.
1598
- */
1599
- function ListCache(entries) {
1600
- var index = -1,
1601
- length = entries == null ? 0 : entries.length;
1602
-
1603
- this.clear();
1604
- while (++index < length) {
1605
- var entry = entries[index];
1606
- this.set(entry[0], entry[1]);
1607
- }
1608
- }
1609
-
1610
- // Add methods to `ListCache`.
1611
- ListCache.prototype.clear = _listCacheClear;
1612
- ListCache.prototype['delete'] = _listCacheDelete;
1613
- ListCache.prototype.get = _listCacheGet;
1614
- ListCache.prototype.has = _listCacheHas;
1615
- ListCache.prototype.set = _listCacheSet;
1616
-
1617
- var _ListCache = ListCache;
1618
-
1619
- /* Built-in method references that are verified to be native. */
1620
- var Map = _getNative(_root, 'Map');
1621
-
1622
- var _Map = Map;
1623
-
1624
- /**
1625
- * Removes all key-value entries from the map.
1626
- *
1627
- * @private
1628
- * @name clear
1629
- * @memberOf MapCache
1630
- */
1631
- function mapCacheClear() {
1632
- this.size = 0;
1633
- this.__data__ = {
1634
- 'hash': new _Hash,
1635
- 'map': new (_Map || _ListCache),
1636
- 'string': new _Hash
1637
- };
1638
- }
1639
-
1640
- var _mapCacheClear = mapCacheClear;
1641
-
1642
- /**
1643
- * Checks if `value` is suitable for use as unique object key.
1644
- *
1645
- * @private
1646
- * @param {*} value The value to check.
1647
- * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
1648
- */
1649
- function isKeyable(value) {
1650
- var type = typeof value;
1651
- return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
1652
- ? (value !== '__proto__')
1653
- : (value === null);
1654
- }
1655
-
1656
- var _isKeyable = isKeyable;
1657
-
1658
- /**
1659
- * Gets the data for `map`.
1660
- *
1661
- * @private
1662
- * @param {Object} map The map to query.
1663
- * @param {string} key The reference key.
1664
- * @returns {*} Returns the map data.
1665
- */
1666
- function getMapData(map, key) {
1667
- var data = map.__data__;
1668
- return _isKeyable(key)
1669
- ? data[typeof key == 'string' ? 'string' : 'hash']
1670
- : data.map;
1671
- }
1672
-
1673
- var _getMapData = getMapData;
1674
-
1675
- /**
1676
- * Removes `key` and its value from the map.
1677
- *
1678
- * @private
1679
- * @name delete
1680
- * @memberOf MapCache
1681
- * @param {string} key The key of the value to remove.
1682
- * @returns {boolean} Returns `true` if the entry was removed, else `false`.
1683
- */
1684
- function mapCacheDelete(key) {
1685
- var result = _getMapData(this, key)['delete'](key);
1686
- this.size -= result ? 1 : 0;
1687
- return result;
1688
- }
1689
-
1690
- var _mapCacheDelete = mapCacheDelete;
1691
-
1692
- /**
1693
- * Gets the map value for `key`.
1694
- *
1695
- * @private
1696
- * @name get
1697
- * @memberOf MapCache
1698
- * @param {string} key The key of the value to get.
1699
- * @returns {*} Returns the entry value.
1700
- */
1701
- function mapCacheGet(key) {
1702
- return _getMapData(this, key).get(key);
1703
- }
1704
-
1705
- var _mapCacheGet = mapCacheGet;
1706
-
1707
- /**
1708
- * Checks if a map value for `key` exists.
1709
- *
1710
- * @private
1711
- * @name has
1712
- * @memberOf MapCache
1713
- * @param {string} key The key of the entry to check.
1714
- * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
1715
- */
1716
- function mapCacheHas(key) {
1717
- return _getMapData(this, key).has(key);
1718
- }
1719
-
1720
- var _mapCacheHas = mapCacheHas;
1721
-
1722
- /**
1723
- * Sets the map `key` to `value`.
1724
- *
1725
- * @private
1726
- * @name set
1727
- * @memberOf MapCache
1728
- * @param {string} key The key of the value to set.
1729
- * @param {*} value The value to set.
1730
- * @returns {Object} Returns the map cache instance.
1731
- */
1732
- function mapCacheSet(key, value) {
1733
- var data = _getMapData(this, key),
1734
- size = data.size;
1735
-
1736
- data.set(key, value);
1737
- this.size += data.size == size ? 0 : 1;
1738
- return this;
1739
- }
1740
-
1741
- var _mapCacheSet = mapCacheSet;
1742
-
1743
- /**
1744
- * Creates a map cache object to store key-value pairs.
1745
- *
1746
- * @private
1747
- * @constructor
1748
- * @param {Array} [entries] The key-value pairs to cache.
1749
- */
1750
- function MapCache(entries) {
1751
- var index = -1,
1752
- length = entries == null ? 0 : entries.length;
1753
-
1754
- this.clear();
1755
- while (++index < length) {
1756
- var entry = entries[index];
1757
- this.set(entry[0], entry[1]);
1758
- }
1759
- }
1760
-
1761
- // Add methods to `MapCache`.
1762
- MapCache.prototype.clear = _mapCacheClear;
1763
- MapCache.prototype['delete'] = _mapCacheDelete;
1764
- MapCache.prototype.get = _mapCacheGet;
1765
- MapCache.prototype.has = _mapCacheHas;
1766
- MapCache.prototype.set = _mapCacheSet;
1767
-
1768
- var _MapCache = MapCache;
1769
-
1770
- /** Error message constants. */
1771
- var FUNC_ERROR_TEXT = 'Expected a function';
1772
-
1773
- /**
1774
- * Creates a function that memoizes the result of `func`. If `resolver` is
1775
- * provided, it determines the cache key for storing the result based on the
1776
- * arguments provided to the memoized function. By default, the first argument
1777
- * provided to the memoized function is used as the map cache key. The `func`
1778
- * is invoked with the `this` binding of the memoized function.
1779
- *
1780
- * **Note:** The cache is exposed as the `cache` property on the memoized
1781
- * function. Its creation may be customized by replacing the `_.memoize.Cache`
1782
- * constructor with one whose instances implement the
1783
- * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
1784
- * method interface of `clear`, `delete`, `get`, `has`, and `set`.
1785
- *
1786
- * @static
1787
- * @memberOf _
1788
- * @since 0.1.0
1789
- * @category Function
1790
- * @param {Function} func The function to have its output memoized.
1791
- * @param {Function} [resolver] The function to resolve the cache key.
1792
- * @returns {Function} Returns the new memoized function.
1793
- * @example
1794
- *
1795
- * var object = { 'a': 1, 'b': 2 };
1796
- * var other = { 'c': 3, 'd': 4 };
1797
- *
1798
- * var values = _.memoize(_.values);
1799
- * values(object);
1800
- * // => [1, 2]
1801
- *
1802
- * values(other);
1803
- * // => [3, 4]
1804
- *
1805
- * object.a = 2;
1806
- * values(object);
1807
- * // => [1, 2]
1808
- *
1809
- * // Modify the result cache.
1810
- * values.cache.set(object, ['a', 'b']);
1811
- * values(object);
1812
- * // => ['a', 'b']
1813
- *
1814
- * // Replace `_.memoize.Cache`.
1815
- * _.memoize.Cache = WeakMap;
1816
- */
1817
- function memoize(func, resolver) {
1818
- if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) {
1819
- throw new TypeError(FUNC_ERROR_TEXT);
1820
- }
1821
- var memoized = function() {
1822
- var args = arguments,
1823
- key = resolver ? resolver.apply(this, args) : args[0],
1824
- cache = memoized.cache;
1825
-
1826
- if (cache.has(key)) {
1827
- return cache.get(key);
1828
- }
1829
- var result = func.apply(this, args);
1830
- memoized.cache = cache.set(key, result) || cache;
1831
- return result;
1832
- };
1833
- memoized.cache = new (memoize.Cache || _MapCache);
1834
- return memoized;
1835
- }
1836
-
1837
- // Expose `MapCache`.
1838
- memoize.Cache = _MapCache;
1839
-
1840
- var memoize_1 = memoize;
1841
-
1842
- /** Used as the maximum memoize cache size. */
1843
- var MAX_MEMOIZE_SIZE = 500;
1844
-
1845
- /**
1846
- * A specialized version of `_.memoize` which clears the memoized function's
1847
- * cache when it exceeds `MAX_MEMOIZE_SIZE`.
1848
- *
1849
- * @private
1850
- * @param {Function} func The function to have its output memoized.
1851
- * @returns {Function} Returns the new memoized function.
1852
- */
1853
- function memoizeCapped(func) {
1854
- var result = memoize_1(func, function(key) {
1855
- if (cache.size === MAX_MEMOIZE_SIZE) {
1856
- cache.clear();
1857
- }
1858
- return key;
1859
- });
1860
-
1861
- var cache = result.cache;
1862
- return result;
1863
- }
1864
-
1865
- var _memoizeCapped = memoizeCapped;
1866
-
1867
- /** Used to match property names within property paths. */
1868
- var rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
1869
-
1870
- /** Used to match backslashes in property paths. */
1871
- var reEscapeChar = /\\(\\)?/g;
1872
-
1873
- /**
1874
- * Converts `string` to a property path array.
1875
- *
1876
- * @private
1877
- * @param {string} string The string to convert.
1878
- * @returns {Array} Returns the property path array.
1879
- */
1880
- _memoizeCapped(function(string) {
1881
- var result = [];
1882
- if (string.charCodeAt(0) === 46 /* . */) {
1883
- result.push('');
1884
- }
1885
- string.replace(rePropName, function(match, number, quote, subString) {
1886
- result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match));
1887
- });
1888
- return result;
1889
- });
1890
-
1891
- /** Used to convert symbols to primitives and strings. */
1892
- var symbolProto = _Symbol ? _Symbol.prototype : undefined;
1893
- symbolProto ? symbolProto.toString : undefined;
1894
-
1895
49
  var hexToRGB = function hexToRGB(hex) {
1896
50
  var r = parseInt(hex.slice(1, 3), 16);
1897
51
  var g = parseInt(hex.slice(3, 5), 16);
@@ -1922,15 +76,15 @@ var getTextColor = function getTextColor() {
1922
76
  var textColor = getLuminanceOfColor(getHexValue) < 155 ? "light" : "dark";
1923
77
  return textColor;
1924
78
  };
1925
- var shapeConfig = PropTypes.shape({
1926
- "sketches-host": PropTypes.string,
1927
- "cdn-name": PropTypes.string,
1928
- "cdn-image": PropTypes.string
79
+ var shapeConfig = PropTypes__default["default"].shape({
80
+ "sketches-host": PropTypes__default["default"].string,
81
+ "cdn-name": PropTypes__default["default"].string,
82
+ "cdn-image": PropTypes__default["default"].string
1929
83
  });
1930
- PropTypes.shape({
1931
- headline: PropTypes.string,
1932
- "last-published-at": PropTypes.number,
1933
- subheadline: PropTypes.string
84
+ PropTypes__default["default"].shape({
85
+ headline: PropTypes__default["default"].string,
86
+ "last-published-at": PropTypes__default["default"].number,
87
+ subheadline: PropTypes__default["default"].string
1934
88
  });
1935
89
 
1936
90
  var _excluded = ["element", "config", "opts"];
@@ -1952,7 +106,7 @@ var ReferenceBase = function ReferenceBase(_ref) {
1952
106
  _ref.config;
1953
107
  var _ref$opts = _ref.opts,
1954
108
  opts = _ref$opts === void 0 ? {} : _ref$opts,
1955
- restProps = _objectWithoutProperties(_ref, _excluded);
109
+ restProps = _objectWithoutProperties__default["default"](_ref, _excluded);
1956
110
 
1957
111
  if (!element) return null;
1958
112
  var configData = useStateValue() || {};
@@ -1963,7 +117,7 @@ var ReferenceBase = function ReferenceBase(_ref) {
1963
117
  var _opts$showHeadline = opts.showHeadline,
1964
118
  showHeadline = _opts$showHeadline === void 0 ? true : _opts$showHeadline,
1965
119
  headlineText = opts.headlineText;
1966
- return /*#__PURE__*/React.createElement("div", _extends({
120
+ return /*#__PURE__*/React__default["default"].createElement("div", _extends__default["default"]({
1967
121
  className: "arrow-component arr--reference-element"
1968
122
  }, restProps), eleArr && eleArr.map(function (metadata, index) {
1969
123
  var _metadata$name = metadata.name,
@@ -1971,36 +125,36 @@ var ReferenceBase = function ReferenceBase(_ref) {
1971
125
  _metadata$description = metadata.description,
1972
126
  description = _metadata$description === void 0 ? "" : _metadata$description,
1973
127
  url = metadata.url;
1974
- return /*#__PURE__*/React.createElement("div", {
128
+ return /*#__PURE__*/React__default["default"].createElement("div", {
1975
129
  key: index,
1976
- className: _getClassName("wrapper ".concat(textInvertColor), _styleModuleImportMap)
1977
- }, /*#__PURE__*/React.createElement(Link, {
130
+ className: _getClassName__default["default"]("wrapper ".concat(textInvertColor), _styleModuleImportMap)
131
+ }, /*#__PURE__*/React__default["default"].createElement(components.Link, {
1978
132
  href: url,
1979
133
  "aria-label": "reference-headline"
1980
- }, showHeadline && /*#__PURE__*/React.createElement("div", {
134
+ }, showHeadline && /*#__PURE__*/React__default["default"].createElement("div", {
1981
135
  className: "reference-m_name__24IwG",
1982
136
  "data-test-id": "ref-headline"
1983
- }, headlineText || name), /*#__PURE__*/React.createElement("div", {
137
+ }, headlineText || name), /*#__PURE__*/React__default["default"].createElement("div", {
1984
138
  className: "reference-m_description__2x3Io"
1985
139
  }, description)));
1986
140
  }));
1987
141
  };
1988
142
 
1989
143
  ReferenceBase.propTypes = {
1990
- element: PropTypes.shape({
1991
- "story-elements": PropTypes.arrayOf(PropTypes.shape({
1992
- metadata: PropTypes.shape({
1993
- name: PropTypes.string,
1994
- description: PropTypes.string,
1995
- url: PropTypes.string
144
+ element: PropTypes__default["default"].shape({
145
+ "story-elements": PropTypes__default["default"].arrayOf(PropTypes__default["default"].shape({
146
+ metadata: PropTypes__default["default"].shape({
147
+ name: PropTypes__default["default"].string,
148
+ description: PropTypes__default["default"].string,
149
+ url: PropTypes__default["default"].string
1996
150
  })
1997
151
  }))
1998
152
  }),
1999
- opts: PropTypes.shape({
2000
- hideHeadline: PropTypes.bool
153
+ opts: PropTypes__default["default"].shape({
154
+ hideHeadline: PropTypes__default["default"].bool
2001
155
  }),
2002
156
  config: shapeConfig
2003
157
  };
2004
158
  var Reference = withElementWrapper(ReferenceBase);
2005
159
 
2006
- export { Reference };
160
+ exports.Reference = Reference;