@daoyi/nmtl-ui 2.0.1-beta.8 → 2.0.1-beta.80

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 (100) hide show
  1. package/lib/components/Autocomplete-cf913b25.js +423 -0
  2. package/lib/components/Autocomplete.js +19 -1
  3. package/lib/components/Avatar.js +53 -1
  4. package/lib/components/BackTop.js +109 -1
  5. package/lib/components/BarChart.js +762 -1
  6. package/lib/components/Breadcrumbs.js +122 -1
  7. package/lib/components/Button-611f1770.js +92 -0
  8. package/lib/components/Button.js +6 -1
  9. package/lib/components/Carousel.js +4654 -1
  10. package/lib/components/Checkbox.js +37 -1
  11. package/lib/components/CollapseContent.js +179 -1
  12. package/lib/components/ContactModal-0a4c67b8.js +12020 -0
  13. package/lib/components/ContactModal.js +22 -3
  14. package/lib/components/Drawer-55c0f66f.js +156 -0
  15. package/lib/components/Drawer.js +11 -1
  16. package/lib/components/Dropdown.js +134 -1
  17. package/lib/components/Empty-67b4d7d7.js +45 -0
  18. package/lib/components/Empty.js +5 -1
  19. package/lib/components/ExportButton.js +112 -1
  20. package/lib/components/ExtraTools-e4f085bc.js +3537 -0
  21. package/lib/components/ExtraTools.js +10 -22
  22. package/lib/components/Filter.js +782 -12
  23. package/lib/components/Footer.js +271 -1
  24. package/lib/components/ForwardLink-edab5061.js +106 -0
  25. package/lib/components/ForwardLink.js +8 -0
  26. package/lib/components/Header.js +194 -1
  27. package/lib/components/Image.js +61 -1
  28. package/lib/components/Input.js +82 -1
  29. package/lib/components/InputMethod.js +33949 -12
  30. package/lib/components/KeywordSearch-0b5681d9.js +144 -0
  31. package/lib/components/KeywordSearch.js +21 -1
  32. package/lib/components/KeywordTicker.js +190 -1
  33. package/lib/components/Keywords.js +317 -1
  34. package/lib/components/Loading.js +28 -1
  35. package/lib/components/MUITheme.js +2624 -1
  36. package/lib/components/Modal-c33b7a7f.js +108 -0
  37. package/lib/components/Modal.js +9 -1
  38. package/lib/components/MoreButton-b2306abb.js +110 -0
  39. package/lib/components/MoreButton.js +6 -1
  40. package/lib/components/Pagination.js +3637 -0
  41. package/lib/components/Radio.js +78 -1
  42. package/lib/components/SNA.js +1691 -22
  43. package/lib/components/Select-9a745e5c.js +115 -0
  44. package/lib/components/Select.js +8 -1
  45. package/lib/components/Spin-96bc2c76.js +75 -0
  46. package/lib/components/Spin.js +6 -1
  47. package/lib/components/Table.js +51 -1
  48. package/lib/components/Tooltip-123cc349.js +70 -0
  49. package/lib/components/Tooltip.js +7 -1
  50. package/lib/components/_commonjsHelpers-70de2c37.js +28 -0
  51. package/lib/components/_rollupPluginBabelHelpers-a52356f6.js +142 -0
  52. package/lib/components/createSvgIcon-ad1104bb.js +576 -0
  53. package/lib/components/dataExport-04b77185.js +93 -0
  54. package/lib/components/debounce-127da66c.js +355 -0
  55. package/lib/components/defaultTheme-ed7746fe.js +1661 -0
  56. package/lib/components/globalConfig.js +175 -0
  57. package/lib/components/hoist-non-react-statics.cjs-3f408ad2.js +105 -0
  58. package/lib/components/index-848f4409.js +61 -0
  59. package/lib/components/index-983dcd15.js +481 -0
  60. package/lib/components/isObjectLike-e111475d.js +190 -0
  61. package/lib/components/style-inject.es-1f59c1d0.js +28 -1
  62. package/lib/components/toConsumableArray-dbe8af76.js +19 -0
  63. package/lib/components/transform-3a04288b.js +5475 -0
  64. package/lib/components/withTheme-2d778133.js +6 -0
  65. package/lib/index.d.ts +2 -0
  66. package/lib/index.js +2 -0
  67. package/lib/utils/_rollupPluginBabelHelpers-8dd26e1a.js +121 -0
  68. package/lib/utils/arrayMerge.js +4953 -1
  69. package/lib/utils/chunkArray.js +15 -1
  70. package/lib/utils/convert2HtmlEntities.js +42 -1
  71. package/lib/utils/domToImage.js +802 -1
  72. package/lib/utils/downloadGephi.js +106 -1
  73. package/lib/utils/exportXlsx.js +219 -1
  74. package/lib/utils/historyAppendSearch.js +502 -1
  75. package/lib/utils/isDevelopMode.js +5 -1
  76. package/lib/utils/parseYMD.js +36 -1
  77. package/lib/utils/removeDuplicateItem.js +11 -1
  78. package/lib/utils/sendEmail.js +39 -1
  79. package/lib/utils/snaDefine-6a2bcd94.js +5 -0
  80. package/lib/utils/snaDefine.js +1 -1
  81. package/lib/utils/snaPreProcess.js +84 -1
  82. package/package.json +17 -21
  83. package/lib/components/Empty-54b79907.js +0 -1
  84. package/lib/components/KeywordSearch-5a393f12.js +0 -1
  85. package/lib/components/Select-f2441b83.js +0 -1
  86. package/lib/components/_rollupPluginBabelHelpers-1b8c042f.js +0 -1
  87. package/lib/components/_rollupPluginBabelHelpers-ec4e2a53.js +0 -1
  88. package/lib/components/createSvgIcon-62b64929.js +0 -1
  89. package/lib/components/createSvgIcon-e24792d4.js +0 -1
  90. package/lib/components/createTheme-7fffa109.js +0 -1
  91. package/lib/components/dataExport-9fccd4f0.js +0 -1
  92. package/lib/components/debounce-c993109b.js +0 -1
  93. package/lib/components/hoist-non-react-statics.cjs-d6a9befd.js +0 -1
  94. package/lib/components/index-11391ca3.js +0 -7
  95. package/lib/components/index-b2745105.js +0 -7
  96. package/lib/components/isObjectLike-2f1983fe.js +0 -1
  97. package/lib/components/style-inject.es-c875d022.js +0 -1
  98. package/lib/components/transform-0eb2d36e.js +0 -1
  99. package/lib/utils/_commonjsHelpers-e2cda605.js +0 -1
  100. package/lib/utils/_rollupPluginBabelHelpers-928a52ce.js +0 -1
@@ -0,0 +1,3637 @@
1
+ import { c as _objectWithoutProperties$1 } from './_rollupPluginBabelHelpers-a52356f6.js';
2
+ import * as React$2 from 'react';
3
+ import React__default, { Children, isValidElement, cloneElement } from 'react';
4
+ import PropTypes from 'prop-types';
5
+ import { d as defaultTheme, k as _objectWithoutProperties, o as _slicedToArray, _ as _extends, q as _objectWithoutPropertiesLoose, r as alpha, j as formatMuiErrorMessage } from './defaultTheme-ed7746fe.js';
6
+ import { u as useControlled, c as clsx, b as useEventCallback, w as withStyles, d as useIsFocusVisible, e as useForkRef, f as createSvgIcon, g as capitalize, h as debounce, r as requireCreateSvgIcon, i as interopRequireDefault, a as interopRequireWildcard } from './createSvgIcon-ad1104bb.js';
7
+ import 'react-is';
8
+ import { useTheme as useTheme$1 } from '@material-ui/styles';
9
+ import './withTheme-2d778133.js';
10
+ import { _ as _toConsumableArray } from './toConsumableArray-dbe8af76.js';
11
+ import * as ReactDOM from 'react-dom';
12
+ import ReactDOM__default from 'react-dom';
13
+ import { c as classNames } from './index-848f4409.js';
14
+ import { IconButton } from '@material-ui/core';
15
+ import { s as styleInject } from './style-inject.es-1f59c1d0.js';
16
+ import './_commonjsHelpers-70de2c37.js';
17
+
18
+ function useTheme() {
19
+ var theme = useTheme$1() || defaultTheme;
20
+
21
+ return theme;
22
+ }
23
+
24
+ function usePagination() {
25
+ var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
26
+
27
+ // keep default values in sync with @default tags in Pagination.propTypes
28
+ var _props$boundaryCount = props.boundaryCount,
29
+ boundaryCount = _props$boundaryCount === void 0 ? 1 : _props$boundaryCount,
30
+ _props$componentName = props.componentName,
31
+ componentName = _props$componentName === void 0 ? 'usePagination' : _props$componentName,
32
+ _props$count = props.count,
33
+ count = _props$count === void 0 ? 1 : _props$count,
34
+ _props$defaultPage = props.defaultPage,
35
+ defaultPage = _props$defaultPage === void 0 ? 1 : _props$defaultPage,
36
+ _props$disabled = props.disabled,
37
+ disabled = _props$disabled === void 0 ? false : _props$disabled,
38
+ _props$hideNextButton = props.hideNextButton,
39
+ hideNextButton = _props$hideNextButton === void 0 ? false : _props$hideNextButton,
40
+ _props$hidePrevButton = props.hidePrevButton,
41
+ hidePrevButton = _props$hidePrevButton === void 0 ? false : _props$hidePrevButton,
42
+ handleChange = props.onChange,
43
+ pageProp = props.page,
44
+ _props$showFirstButto = props.showFirstButton,
45
+ showFirstButton = _props$showFirstButto === void 0 ? false : _props$showFirstButto,
46
+ _props$showLastButton = props.showLastButton,
47
+ showLastButton = _props$showLastButton === void 0 ? false : _props$showLastButton,
48
+ _props$siblingCount = props.siblingCount,
49
+ siblingCount = _props$siblingCount === void 0 ? 1 : _props$siblingCount,
50
+ other = _objectWithoutProperties(props, ["boundaryCount", "componentName", "count", "defaultPage", "disabled", "hideNextButton", "hidePrevButton", "onChange", "page", "showFirstButton", "showLastButton", "siblingCount"]);
51
+
52
+ var _useControlled = useControlled({
53
+ controlled: pageProp,
54
+ default: defaultPage,
55
+ name: componentName,
56
+ state: 'page'
57
+ }),
58
+ _useControlled2 = _slicedToArray(_useControlled, 2),
59
+ page = _useControlled2[0],
60
+ setPageState = _useControlled2[1];
61
+
62
+ var handleClick = function handleClick(event, value) {
63
+ if (!pageProp) {
64
+ setPageState(value);
65
+ }
66
+
67
+ if (handleChange) {
68
+ handleChange(event, value);
69
+ }
70
+ }; // https://dev.to/namirsab/comment/2050
71
+
72
+
73
+ var range = function range(start, end) {
74
+ var length = end - start + 1;
75
+ return Array.from({
76
+ length: length
77
+ }, function (_, i) {
78
+ return start + i;
79
+ });
80
+ };
81
+
82
+ var startPages = range(1, Math.min(boundaryCount, count));
83
+ var endPages = range(Math.max(count - boundaryCount + 1, boundaryCount + 1), count);
84
+ var siblingsStart = Math.max(Math.min( // Natural start
85
+ page - siblingCount, // Lower boundary when page is high
86
+ count - boundaryCount - siblingCount * 2 - 1), // Greater than startPages
87
+ boundaryCount + 2);
88
+ var siblingsEnd = Math.min(Math.max( // Natural end
89
+ page + siblingCount, // Upper boundary when page is low
90
+ boundaryCount + siblingCount * 2 + 2), // Less than endPages
91
+ endPages[0] - 2); // Basic list of items to render
92
+ // e.g. itemList = ['first', 'previous', 1, 'ellipsis', 4, 5, 6, 'ellipsis', 10, 'next', 'last']
93
+
94
+ var itemList = [].concat(_toConsumableArray(showFirstButton ? ['first'] : []), _toConsumableArray(hidePrevButton ? [] : ['previous']), _toConsumableArray(startPages), _toConsumableArray(siblingsStart > boundaryCount + 2 ? ['start-ellipsis'] : boundaryCount + 1 < count - boundaryCount ? [boundaryCount + 1] : []), _toConsumableArray(range(siblingsStart, siblingsEnd)), _toConsumableArray(siblingsEnd < count - boundaryCount - 1 ? ['end-ellipsis'] : count - boundaryCount > boundaryCount ? [count - boundaryCount] : []), _toConsumableArray(endPages), _toConsumableArray(hideNextButton ? [] : ['next']), _toConsumableArray(showLastButton ? ['last'] : [])); // Map the button type to its page number
95
+
96
+ var buttonPage = function buttonPage(type) {
97
+ switch (type) {
98
+ case 'first':
99
+ return 1;
100
+
101
+ case 'previous':
102
+ return page - 1;
103
+
104
+ case 'next':
105
+ return page + 1;
106
+
107
+ case 'last':
108
+ return count;
109
+
110
+ default:
111
+ return null;
112
+ }
113
+ }; // Convert the basic item list to PaginationItem props objects
114
+
115
+
116
+ var items = itemList.map(function (item) {
117
+ return typeof item === 'number' ? {
118
+ onClick: function onClick(event) {
119
+ handleClick(event, item);
120
+ },
121
+ type: 'page',
122
+ page: item,
123
+ selected: item === page,
124
+ disabled: disabled,
125
+ 'aria-current': item === page ? 'true' : undefined
126
+ } : {
127
+ onClick: function onClick(event) {
128
+ handleClick(event, buttonPage(item));
129
+ },
130
+ type: item,
131
+ page: buttonPage(item),
132
+ selected: false,
133
+ disabled: disabled || item.indexOf('ellipsis') === -1 && (item === 'next' || item === 'last' ? page >= count : page <= 1)
134
+ };
135
+ });
136
+ return _extends({
137
+ items: items
138
+ }, other);
139
+ }
140
+
141
+ function _setPrototypeOf(o, p) {
142
+ _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {
143
+ o.__proto__ = p;
144
+ return o;
145
+ };
146
+ return _setPrototypeOf(o, p);
147
+ }
148
+
149
+ function _inheritsLoose(subClass, superClass) {
150
+ subClass.prototype = Object.create(superClass.prototype);
151
+ subClass.prototype.constructor = subClass;
152
+ _setPrototypeOf(subClass, superClass);
153
+ }
154
+
155
+ /**
156
+ * Checks if a given element has a CSS class.
157
+ *
158
+ * @param element the element
159
+ * @param className the CSS class name
160
+ */
161
+ function hasClass(element, className) {
162
+ if (element.classList) return !!className && element.classList.contains(className);
163
+ return (" " + (element.className.baseVal || element.className) + " ").indexOf(" " + className + " ") !== -1;
164
+ }
165
+
166
+ /**
167
+ * Adds a CSS class to a given element.
168
+ *
169
+ * @param element the element
170
+ * @param className the CSS class name
171
+ */
172
+
173
+ function addClass(element, className) {
174
+ if (element.classList) element.classList.add(className);else if (!hasClass(element, className)) if (typeof element.className === 'string') element.className = element.className + " " + className;else element.setAttribute('class', (element.className && element.className.baseVal || '') + " " + className);
175
+ }
176
+
177
+ function replaceClassName(origClass, classToRemove) {
178
+ return origClass.replace(new RegExp("(^|\\s)" + classToRemove + "(?:\\s|$)", 'g'), '$1').replace(/\s+/g, ' ').replace(/^\s*|\s*$/g, '');
179
+ }
180
+ /**
181
+ * Removes a CSS class from a given element.
182
+ *
183
+ * @param element the element
184
+ * @param className the CSS class name
185
+ */
186
+
187
+
188
+ function removeClass$1(element, className) {
189
+ if (element.classList) {
190
+ element.classList.remove(className);
191
+ } else if (typeof element.className === 'string') {
192
+ element.className = replaceClassName(element.className, className);
193
+ } else {
194
+ element.setAttribute('class', replaceClassName(element.className && element.className.baseVal || '', className));
195
+ }
196
+ }
197
+
198
+ var config = {
199
+ disabled: false
200
+ };
201
+
202
+ var TransitionGroupContext = React__default.createContext(null);
203
+
204
+ var forceReflow = function forceReflow(node) {
205
+ return node.scrollTop;
206
+ };
207
+
208
+ var UNMOUNTED = 'unmounted';
209
+ var EXITED = 'exited';
210
+ var ENTERING = 'entering';
211
+ var ENTERED = 'entered';
212
+ var EXITING = 'exiting';
213
+ /**
214
+ * The Transition component lets you describe a transition from one component
215
+ * state to another _over time_ with a simple declarative API. Most commonly
216
+ * it's used to animate the mounting and unmounting of a component, but can also
217
+ * be used to describe in-place transition states as well.
218
+ *
219
+ * ---
220
+ *
221
+ * **Note**: `Transition` is a platform-agnostic base component. If you're using
222
+ * transitions in CSS, you'll probably want to use
223
+ * [`CSSTransition`](https://reactcommunity.org/react-transition-group/css-transition)
224
+ * instead. It inherits all the features of `Transition`, but contains
225
+ * additional features necessary to play nice with CSS transitions (hence the
226
+ * name of the component).
227
+ *
228
+ * ---
229
+ *
230
+ * By default the `Transition` component does not alter the behavior of the
231
+ * component it renders, it only tracks "enter" and "exit" states for the
232
+ * components. It's up to you to give meaning and effect to those states. For
233
+ * example we can add styles to a component when it enters or exits:
234
+ *
235
+ * ```jsx
236
+ * import { Transition } from 'react-transition-group';
237
+ *
238
+ * const duration = 300;
239
+ *
240
+ * const defaultStyle = {
241
+ * transition: `opacity ${duration}ms ease-in-out`,
242
+ * opacity: 0,
243
+ * }
244
+ *
245
+ * const transitionStyles = {
246
+ * entering: { opacity: 1 },
247
+ * entered: { opacity: 1 },
248
+ * exiting: { opacity: 0 },
249
+ * exited: { opacity: 0 },
250
+ * };
251
+ *
252
+ * const Fade = ({ in: inProp }) => (
253
+ * <Transition in={inProp} timeout={duration}>
254
+ * {state => (
255
+ * <div style={{
256
+ * ...defaultStyle,
257
+ * ...transitionStyles[state]
258
+ * }}>
259
+ * I'm a fade Transition!
260
+ * </div>
261
+ * )}
262
+ * </Transition>
263
+ * );
264
+ * ```
265
+ *
266
+ * There are 4 main states a Transition can be in:
267
+ * - `'entering'`
268
+ * - `'entered'`
269
+ * - `'exiting'`
270
+ * - `'exited'`
271
+ *
272
+ * Transition state is toggled via the `in` prop. When `true` the component
273
+ * begins the "Enter" stage. During this stage, the component will shift from
274
+ * its current transition state, to `'entering'` for the duration of the
275
+ * transition and then to the `'entered'` stage once it's complete. Let's take
276
+ * the following example (we'll use the
277
+ * [useState](https://reactjs.org/docs/hooks-reference.html#usestate) hook):
278
+ *
279
+ * ```jsx
280
+ * function App() {
281
+ * const [inProp, setInProp] = useState(false);
282
+ * return (
283
+ * <div>
284
+ * <Transition in={inProp} timeout={500}>
285
+ * {state => (
286
+ * // ...
287
+ * )}
288
+ * </Transition>
289
+ * <button onClick={() => setInProp(true)}>
290
+ * Click to Enter
291
+ * </button>
292
+ * </div>
293
+ * );
294
+ * }
295
+ * ```
296
+ *
297
+ * When the button is clicked the component will shift to the `'entering'` state
298
+ * and stay there for 500ms (the value of `timeout`) before it finally switches
299
+ * to `'entered'`.
300
+ *
301
+ * When `in` is `false` the same thing happens except the state moves from
302
+ * `'exiting'` to `'exited'`.
303
+ */
304
+
305
+ var Transition = /*#__PURE__*/function (_React$Component) {
306
+ _inheritsLoose(Transition, _React$Component);
307
+
308
+ function Transition(props, context) {
309
+ var _this;
310
+
311
+ _this = _React$Component.call(this, props, context) || this;
312
+ var parentGroup = context; // In the context of a TransitionGroup all enters are really appears
313
+
314
+ var appear = parentGroup && !parentGroup.isMounting ? props.enter : props.appear;
315
+ var initialStatus;
316
+ _this.appearStatus = null;
317
+
318
+ if (props.in) {
319
+ if (appear) {
320
+ initialStatus = EXITED;
321
+ _this.appearStatus = ENTERING;
322
+ } else {
323
+ initialStatus = ENTERED;
324
+ }
325
+ } else {
326
+ if (props.unmountOnExit || props.mountOnEnter) {
327
+ initialStatus = UNMOUNTED;
328
+ } else {
329
+ initialStatus = EXITED;
330
+ }
331
+ }
332
+
333
+ _this.state = {
334
+ status: initialStatus
335
+ };
336
+ _this.nextCallback = null;
337
+ return _this;
338
+ }
339
+
340
+ Transition.getDerivedStateFromProps = function getDerivedStateFromProps(_ref, prevState) {
341
+ var nextIn = _ref.in;
342
+
343
+ if (nextIn && prevState.status === UNMOUNTED) {
344
+ return {
345
+ status: EXITED
346
+ };
347
+ }
348
+
349
+ return null;
350
+ } // getSnapshotBeforeUpdate(prevProps) {
351
+ // let nextStatus = null
352
+ // if (prevProps !== this.props) {
353
+ // const { status } = this.state
354
+ // if (this.props.in) {
355
+ // if (status !== ENTERING && status !== ENTERED) {
356
+ // nextStatus = ENTERING
357
+ // }
358
+ // } else {
359
+ // if (status === ENTERING || status === ENTERED) {
360
+ // nextStatus = EXITING
361
+ // }
362
+ // }
363
+ // }
364
+ // return { nextStatus }
365
+ // }
366
+ ;
367
+
368
+ var _proto = Transition.prototype;
369
+
370
+ _proto.componentDidMount = function componentDidMount() {
371
+ this.updateStatus(true, this.appearStatus);
372
+ };
373
+
374
+ _proto.componentDidUpdate = function componentDidUpdate(prevProps) {
375
+ var nextStatus = null;
376
+
377
+ if (prevProps !== this.props) {
378
+ var status = this.state.status;
379
+
380
+ if (this.props.in) {
381
+ if (status !== ENTERING && status !== ENTERED) {
382
+ nextStatus = ENTERING;
383
+ }
384
+ } else {
385
+ if (status === ENTERING || status === ENTERED) {
386
+ nextStatus = EXITING;
387
+ }
388
+ }
389
+ }
390
+
391
+ this.updateStatus(false, nextStatus);
392
+ };
393
+
394
+ _proto.componentWillUnmount = function componentWillUnmount() {
395
+ this.cancelNextCallback();
396
+ };
397
+
398
+ _proto.getTimeouts = function getTimeouts() {
399
+ var timeout = this.props.timeout;
400
+ var exit, enter, appear;
401
+ exit = enter = appear = timeout;
402
+
403
+ if (timeout != null && typeof timeout !== 'number') {
404
+ exit = timeout.exit;
405
+ enter = timeout.enter; // TODO: remove fallback for next major
406
+
407
+ appear = timeout.appear !== undefined ? timeout.appear : enter;
408
+ }
409
+
410
+ return {
411
+ exit: exit,
412
+ enter: enter,
413
+ appear: appear
414
+ };
415
+ };
416
+
417
+ _proto.updateStatus = function updateStatus(mounting, nextStatus) {
418
+ if (mounting === void 0) {
419
+ mounting = false;
420
+ }
421
+
422
+ if (nextStatus !== null) {
423
+ // nextStatus will always be ENTERING or EXITING.
424
+ this.cancelNextCallback();
425
+
426
+ if (nextStatus === ENTERING) {
427
+ if (this.props.unmountOnExit || this.props.mountOnEnter) {
428
+ var node = this.props.nodeRef ? this.props.nodeRef.current : ReactDOM__default.findDOMNode(this); // https://github.com/reactjs/react-transition-group/pull/749
429
+ // With unmountOnExit or mountOnEnter, the enter animation should happen at the transition between `exited` and `entering`.
430
+ // To make the animation happen, we have to separate each rendering and avoid being processed as batched.
431
+
432
+ if (node) forceReflow(node);
433
+ }
434
+
435
+ this.performEnter(mounting);
436
+ } else {
437
+ this.performExit();
438
+ }
439
+ } else if (this.props.unmountOnExit && this.state.status === EXITED) {
440
+ this.setState({
441
+ status: UNMOUNTED
442
+ });
443
+ }
444
+ };
445
+
446
+ _proto.performEnter = function performEnter(mounting) {
447
+ var _this2 = this;
448
+
449
+ var enter = this.props.enter;
450
+ var appearing = this.context ? this.context.isMounting : mounting;
451
+
452
+ var _ref2 = this.props.nodeRef ? [appearing] : [ReactDOM__default.findDOMNode(this), appearing],
453
+ maybeNode = _ref2[0],
454
+ maybeAppearing = _ref2[1];
455
+
456
+ var timeouts = this.getTimeouts();
457
+ var enterTimeout = appearing ? timeouts.appear : timeouts.enter; // no enter animation skip right to ENTERED
458
+ // if we are mounting and running this it means appear _must_ be set
459
+
460
+ if (!mounting && !enter || config.disabled) {
461
+ this.safeSetState({
462
+ status: ENTERED
463
+ }, function () {
464
+ _this2.props.onEntered(maybeNode);
465
+ });
466
+ return;
467
+ }
468
+
469
+ this.props.onEnter(maybeNode, maybeAppearing);
470
+ this.safeSetState({
471
+ status: ENTERING
472
+ }, function () {
473
+ _this2.props.onEntering(maybeNode, maybeAppearing);
474
+
475
+ _this2.onTransitionEnd(enterTimeout, function () {
476
+ _this2.safeSetState({
477
+ status: ENTERED
478
+ }, function () {
479
+ _this2.props.onEntered(maybeNode, maybeAppearing);
480
+ });
481
+ });
482
+ });
483
+ };
484
+
485
+ _proto.performExit = function performExit() {
486
+ var _this3 = this;
487
+
488
+ var exit = this.props.exit;
489
+ var timeouts = this.getTimeouts();
490
+ var maybeNode = this.props.nodeRef ? undefined : ReactDOM__default.findDOMNode(this); // no exit animation skip right to EXITED
491
+
492
+ if (!exit || config.disabled) {
493
+ this.safeSetState({
494
+ status: EXITED
495
+ }, function () {
496
+ _this3.props.onExited(maybeNode);
497
+ });
498
+ return;
499
+ }
500
+
501
+ this.props.onExit(maybeNode);
502
+ this.safeSetState({
503
+ status: EXITING
504
+ }, function () {
505
+ _this3.props.onExiting(maybeNode);
506
+
507
+ _this3.onTransitionEnd(timeouts.exit, function () {
508
+ _this3.safeSetState({
509
+ status: EXITED
510
+ }, function () {
511
+ _this3.props.onExited(maybeNode);
512
+ });
513
+ });
514
+ });
515
+ };
516
+
517
+ _proto.cancelNextCallback = function cancelNextCallback() {
518
+ if (this.nextCallback !== null) {
519
+ this.nextCallback.cancel();
520
+ this.nextCallback = null;
521
+ }
522
+ };
523
+
524
+ _proto.safeSetState = function safeSetState(nextState, callback) {
525
+ // This shouldn't be necessary, but there are weird race conditions with
526
+ // setState callbacks and unmounting in testing, so always make sure that
527
+ // we can cancel any pending setState callbacks after we unmount.
528
+ callback = this.setNextCallback(callback);
529
+ this.setState(nextState, callback);
530
+ };
531
+
532
+ _proto.setNextCallback = function setNextCallback(callback) {
533
+ var _this4 = this;
534
+
535
+ var active = true;
536
+
537
+ this.nextCallback = function (event) {
538
+ if (active) {
539
+ active = false;
540
+ _this4.nextCallback = null;
541
+ callback(event);
542
+ }
543
+ };
544
+
545
+ this.nextCallback.cancel = function () {
546
+ active = false;
547
+ };
548
+
549
+ return this.nextCallback;
550
+ };
551
+
552
+ _proto.onTransitionEnd = function onTransitionEnd(timeout, handler) {
553
+ this.setNextCallback(handler);
554
+ var node = this.props.nodeRef ? this.props.nodeRef.current : ReactDOM__default.findDOMNode(this);
555
+ var doesNotHaveTimeoutOrListener = timeout == null && !this.props.addEndListener;
556
+
557
+ if (!node || doesNotHaveTimeoutOrListener) {
558
+ setTimeout(this.nextCallback, 0);
559
+ return;
560
+ }
561
+
562
+ if (this.props.addEndListener) {
563
+ var _ref3 = this.props.nodeRef ? [this.nextCallback] : [node, this.nextCallback],
564
+ maybeNode = _ref3[0],
565
+ maybeNextCallback = _ref3[1];
566
+
567
+ this.props.addEndListener(maybeNode, maybeNextCallback);
568
+ }
569
+
570
+ if (timeout != null) {
571
+ setTimeout(this.nextCallback, timeout);
572
+ }
573
+ };
574
+
575
+ _proto.render = function render() {
576
+ var status = this.state.status;
577
+
578
+ if (status === UNMOUNTED) {
579
+ return null;
580
+ }
581
+
582
+ var _this$props = this.props,
583
+ children = _this$props.children;
584
+ _this$props.in;
585
+ _this$props.mountOnEnter;
586
+ _this$props.unmountOnExit;
587
+ _this$props.appear;
588
+ _this$props.enter;
589
+ _this$props.exit;
590
+ _this$props.timeout;
591
+ _this$props.addEndListener;
592
+ _this$props.onEnter;
593
+ _this$props.onEntering;
594
+ _this$props.onEntered;
595
+ _this$props.onExit;
596
+ _this$props.onExiting;
597
+ _this$props.onExited;
598
+ _this$props.nodeRef;
599
+ var childProps = _objectWithoutPropertiesLoose(_this$props, ["children", "in", "mountOnEnter", "unmountOnExit", "appear", "enter", "exit", "timeout", "addEndListener", "onEnter", "onEntering", "onEntered", "onExit", "onExiting", "onExited", "nodeRef"]);
600
+
601
+ return (
602
+ /*#__PURE__*/
603
+ // allows for nested Transitions
604
+ React__default.createElement(TransitionGroupContext.Provider, {
605
+ value: null
606
+ }, typeof children === 'function' ? children(status, childProps) : React__default.cloneElement(React__default.Children.only(children), childProps))
607
+ );
608
+ };
609
+
610
+ return Transition;
611
+ }(React__default.Component);
612
+
613
+ Transition.contextType = TransitionGroupContext;
614
+ Transition.propTypes = {}; // Name the function so it is clearer in the documentation
615
+
616
+ function noop() {}
617
+
618
+ Transition.defaultProps = {
619
+ in: false,
620
+ mountOnEnter: false,
621
+ unmountOnExit: false,
622
+ appear: false,
623
+ enter: true,
624
+ exit: true,
625
+ onEnter: noop,
626
+ onEntering: noop,
627
+ onEntered: noop,
628
+ onExit: noop,
629
+ onExiting: noop,
630
+ onExited: noop
631
+ };
632
+ Transition.UNMOUNTED = UNMOUNTED;
633
+ Transition.EXITED = EXITED;
634
+ Transition.ENTERING = ENTERING;
635
+ Transition.ENTERED = ENTERED;
636
+ Transition.EXITING = EXITING;
637
+
638
+ var _addClass = function addClass$1(node, classes) {
639
+ return node && classes && classes.split(' ').forEach(function (c) {
640
+ return addClass(node, c);
641
+ });
642
+ };
643
+
644
+ var removeClass = function removeClass(node, classes) {
645
+ return node && classes && classes.split(' ').forEach(function (c) {
646
+ return removeClass$1(node, c);
647
+ });
648
+ };
649
+ /**
650
+ * A transition component inspired by the excellent
651
+ * [ng-animate](https://docs.angularjs.org/api/ngAnimate) library, you should
652
+ * use it if you're using CSS transitions or animations. It's built upon the
653
+ * [`Transition`](https://reactcommunity.org/react-transition-group/transition)
654
+ * component, so it inherits all of its props.
655
+ *
656
+ * `CSSTransition` applies a pair of class names during the `appear`, `enter`,
657
+ * and `exit` states of the transition. The first class is applied and then a
658
+ * second `*-active` class in order to activate the CSS transition. After the
659
+ * transition, matching `*-done` class names are applied to persist the
660
+ * transition state.
661
+ *
662
+ * ```jsx
663
+ * function App() {
664
+ * const [inProp, setInProp] = useState(false);
665
+ * return (
666
+ * <div>
667
+ * <CSSTransition in={inProp} timeout={200} classNames="my-node">
668
+ * <div>
669
+ * {"I'll receive my-node-* classes"}
670
+ * </div>
671
+ * </CSSTransition>
672
+ * <button type="button" onClick={() => setInProp(true)}>
673
+ * Click to Enter
674
+ * </button>
675
+ * </div>
676
+ * );
677
+ * }
678
+ * ```
679
+ *
680
+ * When the `in` prop is set to `true`, the child component will first receive
681
+ * the class `example-enter`, then the `example-enter-active` will be added in
682
+ * the next tick. `CSSTransition` [forces a
683
+ * reflow](https://github.com/reactjs/react-transition-group/blob/5007303e729a74be66a21c3e2205e4916821524b/src/CSSTransition.js#L208-L215)
684
+ * between before adding the `example-enter-active`. This is an important trick
685
+ * because it allows us to transition between `example-enter` and
686
+ * `example-enter-active` even though they were added immediately one after
687
+ * another. Most notably, this is what makes it possible for us to animate
688
+ * _appearance_.
689
+ *
690
+ * ```css
691
+ * .my-node-enter {
692
+ * opacity: 0;
693
+ * }
694
+ * .my-node-enter-active {
695
+ * opacity: 1;
696
+ * transition: opacity 200ms;
697
+ * }
698
+ * .my-node-exit {
699
+ * opacity: 1;
700
+ * }
701
+ * .my-node-exit-active {
702
+ * opacity: 0;
703
+ * transition: opacity 200ms;
704
+ * }
705
+ * ```
706
+ *
707
+ * `*-active` classes represent which styles you want to animate **to**, so it's
708
+ * important to add `transition` declaration only to them, otherwise transitions
709
+ * might not behave as intended! This might not be obvious when the transitions
710
+ * are symmetrical, i.e. when `*-enter-active` is the same as `*-exit`, like in
711
+ * the example above (minus `transition`), but it becomes apparent in more
712
+ * complex transitions.
713
+ *
714
+ * **Note**: If you're using the
715
+ * [`appear`](http://reactcommunity.org/react-transition-group/transition#Transition-prop-appear)
716
+ * prop, make sure to define styles for `.appear-*` classes as well.
717
+ */
718
+
719
+
720
+ var CSSTransition = /*#__PURE__*/function (_React$Component) {
721
+ _inheritsLoose(CSSTransition, _React$Component);
722
+
723
+ function CSSTransition() {
724
+ var _this;
725
+
726
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
727
+ args[_key] = arguments[_key];
728
+ }
729
+
730
+ _this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;
731
+ _this.appliedClasses = {
732
+ appear: {},
733
+ enter: {},
734
+ exit: {}
735
+ };
736
+
737
+ _this.onEnter = function (maybeNode, maybeAppearing) {
738
+ var _this$resolveArgument = _this.resolveArguments(maybeNode, maybeAppearing),
739
+ node = _this$resolveArgument[0],
740
+ appearing = _this$resolveArgument[1];
741
+
742
+ _this.removeClasses(node, 'exit');
743
+
744
+ _this.addClass(node, appearing ? 'appear' : 'enter', 'base');
745
+
746
+ if (_this.props.onEnter) {
747
+ _this.props.onEnter(maybeNode, maybeAppearing);
748
+ }
749
+ };
750
+
751
+ _this.onEntering = function (maybeNode, maybeAppearing) {
752
+ var _this$resolveArgument2 = _this.resolveArguments(maybeNode, maybeAppearing),
753
+ node = _this$resolveArgument2[0],
754
+ appearing = _this$resolveArgument2[1];
755
+
756
+ var type = appearing ? 'appear' : 'enter';
757
+
758
+ _this.addClass(node, type, 'active');
759
+
760
+ if (_this.props.onEntering) {
761
+ _this.props.onEntering(maybeNode, maybeAppearing);
762
+ }
763
+ };
764
+
765
+ _this.onEntered = function (maybeNode, maybeAppearing) {
766
+ var _this$resolveArgument3 = _this.resolveArguments(maybeNode, maybeAppearing),
767
+ node = _this$resolveArgument3[0],
768
+ appearing = _this$resolveArgument3[1];
769
+
770
+ var type = appearing ? 'appear' : 'enter';
771
+
772
+ _this.removeClasses(node, type);
773
+
774
+ _this.addClass(node, type, 'done');
775
+
776
+ if (_this.props.onEntered) {
777
+ _this.props.onEntered(maybeNode, maybeAppearing);
778
+ }
779
+ };
780
+
781
+ _this.onExit = function (maybeNode) {
782
+ var _this$resolveArgument4 = _this.resolveArguments(maybeNode),
783
+ node = _this$resolveArgument4[0];
784
+
785
+ _this.removeClasses(node, 'appear');
786
+
787
+ _this.removeClasses(node, 'enter');
788
+
789
+ _this.addClass(node, 'exit', 'base');
790
+
791
+ if (_this.props.onExit) {
792
+ _this.props.onExit(maybeNode);
793
+ }
794
+ };
795
+
796
+ _this.onExiting = function (maybeNode) {
797
+ var _this$resolveArgument5 = _this.resolveArguments(maybeNode),
798
+ node = _this$resolveArgument5[0];
799
+
800
+ _this.addClass(node, 'exit', 'active');
801
+
802
+ if (_this.props.onExiting) {
803
+ _this.props.onExiting(maybeNode);
804
+ }
805
+ };
806
+
807
+ _this.onExited = function (maybeNode) {
808
+ var _this$resolveArgument6 = _this.resolveArguments(maybeNode),
809
+ node = _this$resolveArgument6[0];
810
+
811
+ _this.removeClasses(node, 'exit');
812
+
813
+ _this.addClass(node, 'exit', 'done');
814
+
815
+ if (_this.props.onExited) {
816
+ _this.props.onExited(maybeNode);
817
+ }
818
+ };
819
+
820
+ _this.resolveArguments = function (maybeNode, maybeAppearing) {
821
+ return _this.props.nodeRef ? [_this.props.nodeRef.current, maybeNode] // here `maybeNode` is actually `appearing`
822
+ : [maybeNode, maybeAppearing];
823
+ };
824
+
825
+ _this.getClassNames = function (type) {
826
+ var classNames = _this.props.classNames;
827
+ var isStringClassNames = typeof classNames === 'string';
828
+ var prefix = isStringClassNames && classNames ? classNames + "-" : '';
829
+ var baseClassName = isStringClassNames ? "" + prefix + type : classNames[type];
830
+ var activeClassName = isStringClassNames ? baseClassName + "-active" : classNames[type + "Active"];
831
+ var doneClassName = isStringClassNames ? baseClassName + "-done" : classNames[type + "Done"];
832
+ return {
833
+ baseClassName: baseClassName,
834
+ activeClassName: activeClassName,
835
+ doneClassName: doneClassName
836
+ };
837
+ };
838
+
839
+ return _this;
840
+ }
841
+
842
+ var _proto = CSSTransition.prototype;
843
+
844
+ _proto.addClass = function addClass(node, type, phase) {
845
+ var className = this.getClassNames(type)[phase + "ClassName"];
846
+
847
+ var _this$getClassNames = this.getClassNames('enter'),
848
+ doneClassName = _this$getClassNames.doneClassName;
849
+
850
+ if (type === 'appear' && phase === 'done' && doneClassName) {
851
+ className += " " + doneClassName;
852
+ } // This is to force a repaint,
853
+ // which is necessary in order to transition styles when adding a class name.
854
+
855
+
856
+ if (phase === 'active') {
857
+ if (node) forceReflow(node);
858
+ }
859
+
860
+ if (className) {
861
+ this.appliedClasses[type][phase] = className;
862
+
863
+ _addClass(node, className);
864
+ }
865
+ };
866
+
867
+ _proto.removeClasses = function removeClasses(node, type) {
868
+ var _this$appliedClasses$ = this.appliedClasses[type],
869
+ baseClassName = _this$appliedClasses$.base,
870
+ activeClassName = _this$appliedClasses$.active,
871
+ doneClassName = _this$appliedClasses$.done;
872
+ this.appliedClasses[type] = {};
873
+
874
+ if (baseClassName) {
875
+ removeClass(node, baseClassName);
876
+ }
877
+
878
+ if (activeClassName) {
879
+ removeClass(node, activeClassName);
880
+ }
881
+
882
+ if (doneClassName) {
883
+ removeClass(node, doneClassName);
884
+ }
885
+ };
886
+
887
+ _proto.render = function render() {
888
+ var _this$props = this.props;
889
+ _this$props.classNames;
890
+ var props = _objectWithoutPropertiesLoose(_this$props, ["classNames"]);
891
+
892
+ return /*#__PURE__*/React__default.createElement(Transition, _extends({}, props, {
893
+ onEnter: this.onEnter,
894
+ onEntered: this.onEntered,
895
+ onEntering: this.onEntering,
896
+ onExit: this.onExit,
897
+ onExiting: this.onExiting,
898
+ onExited: this.onExited
899
+ }));
900
+ };
901
+
902
+ return CSSTransition;
903
+ }(React__default.Component);
904
+
905
+ CSSTransition.defaultProps = {
906
+ classNames: ''
907
+ };
908
+ CSSTransition.propTypes = {};
909
+
910
+ function _assertThisInitialized(self) {
911
+ if (self === void 0) {
912
+ throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
913
+ }
914
+ return self;
915
+ }
916
+
917
+ /**
918
+ * Given `this.props.children`, return an object mapping key to child.
919
+ *
920
+ * @param {*} children `this.props.children`
921
+ * @return {object} Mapping of key to child
922
+ */
923
+
924
+ function getChildMapping(children, mapFn) {
925
+ var mapper = function mapper(child) {
926
+ return mapFn && isValidElement(child) ? mapFn(child) : child;
927
+ };
928
+
929
+ var result = Object.create(null);
930
+ if (children) Children.map(children, function (c) {
931
+ return c;
932
+ }).forEach(function (child) {
933
+ // run the map function here instead so that the key is the computed one
934
+ result[child.key] = mapper(child);
935
+ });
936
+ return result;
937
+ }
938
+ /**
939
+ * When you're adding or removing children some may be added or removed in the
940
+ * same render pass. We want to show *both* since we want to simultaneously
941
+ * animate elements in and out. This function takes a previous set of keys
942
+ * and a new set of keys and merges them with its best guess of the correct
943
+ * ordering. In the future we may expose some of the utilities in
944
+ * ReactMultiChild to make this easy, but for now React itself does not
945
+ * directly have this concept of the union of prevChildren and nextChildren
946
+ * so we implement it here.
947
+ *
948
+ * @param {object} prev prev children as returned from
949
+ * `ReactTransitionChildMapping.getChildMapping()`.
950
+ * @param {object} next next children as returned from
951
+ * `ReactTransitionChildMapping.getChildMapping()`.
952
+ * @return {object} a key set that contains all keys in `prev` and all keys
953
+ * in `next` in a reasonable order.
954
+ */
955
+
956
+ function mergeChildMappings(prev, next) {
957
+ prev = prev || {};
958
+ next = next || {};
959
+
960
+ function getValueForKey(key) {
961
+ return key in next ? next[key] : prev[key];
962
+ } // For each key of `next`, the list of keys to insert before that key in
963
+ // the combined list
964
+
965
+
966
+ var nextKeysPending = Object.create(null);
967
+ var pendingKeys = [];
968
+
969
+ for (var prevKey in prev) {
970
+ if (prevKey in next) {
971
+ if (pendingKeys.length) {
972
+ nextKeysPending[prevKey] = pendingKeys;
973
+ pendingKeys = [];
974
+ }
975
+ } else {
976
+ pendingKeys.push(prevKey);
977
+ }
978
+ }
979
+
980
+ var i;
981
+ var childMapping = {};
982
+
983
+ for (var nextKey in next) {
984
+ if (nextKeysPending[nextKey]) {
985
+ for (i = 0; i < nextKeysPending[nextKey].length; i++) {
986
+ var pendingNextKey = nextKeysPending[nextKey][i];
987
+ childMapping[nextKeysPending[nextKey][i]] = getValueForKey(pendingNextKey);
988
+ }
989
+ }
990
+
991
+ childMapping[nextKey] = getValueForKey(nextKey);
992
+ } // Finally, add the keys which didn't appear before any key in `next`
993
+
994
+
995
+ for (i = 0; i < pendingKeys.length; i++) {
996
+ childMapping[pendingKeys[i]] = getValueForKey(pendingKeys[i]);
997
+ }
998
+
999
+ return childMapping;
1000
+ }
1001
+
1002
+ function getProp(child, prop, props) {
1003
+ return props[prop] != null ? props[prop] : child.props[prop];
1004
+ }
1005
+
1006
+ function getInitialChildMapping(props, onExited) {
1007
+ return getChildMapping(props.children, function (child) {
1008
+ return cloneElement(child, {
1009
+ onExited: onExited.bind(null, child),
1010
+ in: true,
1011
+ appear: getProp(child, 'appear', props),
1012
+ enter: getProp(child, 'enter', props),
1013
+ exit: getProp(child, 'exit', props)
1014
+ });
1015
+ });
1016
+ }
1017
+ function getNextChildMapping(nextProps, prevChildMapping, onExited) {
1018
+ var nextChildMapping = getChildMapping(nextProps.children);
1019
+ var children = mergeChildMappings(prevChildMapping, nextChildMapping);
1020
+ Object.keys(children).forEach(function (key) {
1021
+ var child = children[key];
1022
+ if (!isValidElement(child)) return;
1023
+ var hasPrev = (key in prevChildMapping);
1024
+ var hasNext = (key in nextChildMapping);
1025
+ var prevChild = prevChildMapping[key];
1026
+ var isLeaving = isValidElement(prevChild) && !prevChild.props.in; // item is new (entering)
1027
+
1028
+ if (hasNext && (!hasPrev || isLeaving)) {
1029
+ // console.log('entering', key)
1030
+ children[key] = cloneElement(child, {
1031
+ onExited: onExited.bind(null, child),
1032
+ in: true,
1033
+ exit: getProp(child, 'exit', nextProps),
1034
+ enter: getProp(child, 'enter', nextProps)
1035
+ });
1036
+ } else if (!hasNext && hasPrev && !isLeaving) {
1037
+ // item is old (exiting)
1038
+ // console.log('leaving', key)
1039
+ children[key] = cloneElement(child, {
1040
+ in: false
1041
+ });
1042
+ } else if (hasNext && hasPrev && isValidElement(prevChild)) {
1043
+ // item hasn't changed transition states
1044
+ // copy over the last transition props;
1045
+ // console.log('unchanged', key)
1046
+ children[key] = cloneElement(child, {
1047
+ onExited: onExited.bind(null, child),
1048
+ in: prevChild.props.in,
1049
+ exit: getProp(child, 'exit', nextProps),
1050
+ enter: getProp(child, 'enter', nextProps)
1051
+ });
1052
+ }
1053
+ });
1054
+ return children;
1055
+ }
1056
+
1057
+ var values = Object.values || function (obj) {
1058
+ return Object.keys(obj).map(function (k) {
1059
+ return obj[k];
1060
+ });
1061
+ };
1062
+
1063
+ var defaultProps = {
1064
+ component: 'div',
1065
+ childFactory: function childFactory(child) {
1066
+ return child;
1067
+ }
1068
+ };
1069
+ /**
1070
+ * The `<TransitionGroup>` component manages a set of transition components
1071
+ * (`<Transition>` and `<CSSTransition>`) in a list. Like with the transition
1072
+ * components, `<TransitionGroup>` is a state machine for managing the mounting
1073
+ * and unmounting of components over time.
1074
+ *
1075
+ * Consider the example below. As items are removed or added to the TodoList the
1076
+ * `in` prop is toggled automatically by the `<TransitionGroup>`.
1077
+ *
1078
+ * Note that `<TransitionGroup>` does not define any animation behavior!
1079
+ * Exactly _how_ a list item animates is up to the individual transition
1080
+ * component. This means you can mix and match animations across different list
1081
+ * items.
1082
+ */
1083
+
1084
+ var TransitionGroup = /*#__PURE__*/function (_React$Component) {
1085
+ _inheritsLoose(TransitionGroup, _React$Component);
1086
+
1087
+ function TransitionGroup(props, context) {
1088
+ var _this;
1089
+
1090
+ _this = _React$Component.call(this, props, context) || this;
1091
+
1092
+ var handleExited = _this.handleExited.bind(_assertThisInitialized(_this)); // Initial children should all be entering, dependent on appear
1093
+
1094
+
1095
+ _this.state = {
1096
+ contextValue: {
1097
+ isMounting: true
1098
+ },
1099
+ handleExited: handleExited,
1100
+ firstRender: true
1101
+ };
1102
+ return _this;
1103
+ }
1104
+
1105
+ var _proto = TransitionGroup.prototype;
1106
+
1107
+ _proto.componentDidMount = function componentDidMount() {
1108
+ this.mounted = true;
1109
+ this.setState({
1110
+ contextValue: {
1111
+ isMounting: false
1112
+ }
1113
+ });
1114
+ };
1115
+
1116
+ _proto.componentWillUnmount = function componentWillUnmount() {
1117
+ this.mounted = false;
1118
+ };
1119
+
1120
+ TransitionGroup.getDerivedStateFromProps = function getDerivedStateFromProps(nextProps, _ref) {
1121
+ var prevChildMapping = _ref.children,
1122
+ handleExited = _ref.handleExited,
1123
+ firstRender = _ref.firstRender;
1124
+ return {
1125
+ children: firstRender ? getInitialChildMapping(nextProps, handleExited) : getNextChildMapping(nextProps, prevChildMapping, handleExited),
1126
+ firstRender: false
1127
+ };
1128
+ } // node is `undefined` when user provided `nodeRef` prop
1129
+ ;
1130
+
1131
+ _proto.handleExited = function handleExited(child, node) {
1132
+ var currentChildMapping = getChildMapping(this.props.children);
1133
+ if (child.key in currentChildMapping) return;
1134
+
1135
+ if (child.props.onExited) {
1136
+ child.props.onExited(node);
1137
+ }
1138
+
1139
+ if (this.mounted) {
1140
+ this.setState(function (state) {
1141
+ var children = _extends({}, state.children);
1142
+
1143
+ delete children[child.key];
1144
+ return {
1145
+ children: children
1146
+ };
1147
+ });
1148
+ }
1149
+ };
1150
+
1151
+ _proto.render = function render() {
1152
+ var _this$props = this.props,
1153
+ Component = _this$props.component,
1154
+ childFactory = _this$props.childFactory,
1155
+ props = _objectWithoutPropertiesLoose(_this$props, ["component", "childFactory"]);
1156
+
1157
+ var contextValue = this.state.contextValue;
1158
+ var children = values(this.state.children).map(childFactory);
1159
+ delete props.appear;
1160
+ delete props.enter;
1161
+ delete props.exit;
1162
+
1163
+ if (Component === null) {
1164
+ return /*#__PURE__*/React__default.createElement(TransitionGroupContext.Provider, {
1165
+ value: contextValue
1166
+ }, children);
1167
+ }
1168
+
1169
+ return /*#__PURE__*/React__default.createElement(TransitionGroupContext.Provider, {
1170
+ value: contextValue
1171
+ }, /*#__PURE__*/React__default.createElement(Component, props, children));
1172
+ };
1173
+
1174
+ return TransitionGroup;
1175
+ }(React__default.Component);
1176
+
1177
+ TransitionGroup.propTypes = {};
1178
+ TransitionGroup.defaultProps = defaultProps;
1179
+
1180
+ /**
1181
+ * The `<ReplaceTransition>` component is a specialized `Transition` component
1182
+ * that animates between two children.
1183
+ *
1184
+ * ```jsx
1185
+ * <ReplaceTransition in>
1186
+ * <Fade><div>I appear first</div></Fade>
1187
+ * <Fade><div>I replace the above</div></Fade>
1188
+ * </ReplaceTransition>
1189
+ * ```
1190
+ */
1191
+
1192
+ var ReplaceTransition = /*#__PURE__*/function (_React$Component) {
1193
+ _inheritsLoose(ReplaceTransition, _React$Component);
1194
+
1195
+ function ReplaceTransition() {
1196
+ var _this;
1197
+
1198
+ for (var _len = arguments.length, _args = new Array(_len), _key = 0; _key < _len; _key++) {
1199
+ _args[_key] = arguments[_key];
1200
+ }
1201
+
1202
+ _this = _React$Component.call.apply(_React$Component, [this].concat(_args)) || this;
1203
+
1204
+ _this.handleEnter = function () {
1205
+ for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
1206
+ args[_key2] = arguments[_key2];
1207
+ }
1208
+
1209
+ return _this.handleLifecycle('onEnter', 0, args);
1210
+ };
1211
+
1212
+ _this.handleEntering = function () {
1213
+ for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
1214
+ args[_key3] = arguments[_key3];
1215
+ }
1216
+
1217
+ return _this.handleLifecycle('onEntering', 0, args);
1218
+ };
1219
+
1220
+ _this.handleEntered = function () {
1221
+ for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
1222
+ args[_key4] = arguments[_key4];
1223
+ }
1224
+
1225
+ return _this.handleLifecycle('onEntered', 0, args);
1226
+ };
1227
+
1228
+ _this.handleExit = function () {
1229
+ for (var _len5 = arguments.length, args = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {
1230
+ args[_key5] = arguments[_key5];
1231
+ }
1232
+
1233
+ return _this.handleLifecycle('onExit', 1, args);
1234
+ };
1235
+
1236
+ _this.handleExiting = function () {
1237
+ for (var _len6 = arguments.length, args = new Array(_len6), _key6 = 0; _key6 < _len6; _key6++) {
1238
+ args[_key6] = arguments[_key6];
1239
+ }
1240
+
1241
+ return _this.handleLifecycle('onExiting', 1, args);
1242
+ };
1243
+
1244
+ _this.handleExited = function () {
1245
+ for (var _len7 = arguments.length, args = new Array(_len7), _key7 = 0; _key7 < _len7; _key7++) {
1246
+ args[_key7] = arguments[_key7];
1247
+ }
1248
+
1249
+ return _this.handleLifecycle('onExited', 1, args);
1250
+ };
1251
+
1252
+ return _this;
1253
+ }
1254
+
1255
+ var _proto = ReplaceTransition.prototype;
1256
+
1257
+ _proto.handleLifecycle = function handleLifecycle(handler, idx, originalArgs) {
1258
+ var _child$props;
1259
+
1260
+ var children = this.props.children;
1261
+ var child = React__default.Children.toArray(children)[idx];
1262
+ if (child.props[handler]) (_child$props = child.props)[handler].apply(_child$props, originalArgs);
1263
+
1264
+ if (this.props[handler]) {
1265
+ var maybeNode = child.props.nodeRef ? undefined : ReactDOM__default.findDOMNode(this);
1266
+ this.props[handler](maybeNode);
1267
+ }
1268
+ };
1269
+
1270
+ _proto.render = function render() {
1271
+ var _this$props = this.props,
1272
+ children = _this$props.children,
1273
+ inProp = _this$props.in,
1274
+ props = _objectWithoutPropertiesLoose(_this$props, ["children", "in"]);
1275
+
1276
+ var _React$Children$toArr = React__default.Children.toArray(children),
1277
+ first = _React$Children$toArr[0],
1278
+ second = _React$Children$toArr[1];
1279
+
1280
+ delete props.onEnter;
1281
+ delete props.onEntering;
1282
+ delete props.onEntered;
1283
+ delete props.onExit;
1284
+ delete props.onExiting;
1285
+ delete props.onExited;
1286
+ return /*#__PURE__*/React__default.createElement(TransitionGroup, props, inProp ? React__default.cloneElement(first, {
1287
+ key: 'first',
1288
+ onEnter: this.handleEnter,
1289
+ onEntering: this.handleEntering,
1290
+ onEntered: this.handleEntered
1291
+ }) : React__default.cloneElement(second, {
1292
+ key: 'second',
1293
+ onEnter: this.handleExit,
1294
+ onEntering: this.handleExiting,
1295
+ onEntered: this.handleExited
1296
+ }));
1297
+ };
1298
+
1299
+ return ReplaceTransition;
1300
+ }(React__default.Component);
1301
+
1302
+ ReplaceTransition.propTypes = {};
1303
+
1304
+ var _leaveRenders, _enterRenders;
1305
+
1306
+ function areChildrenDifferent(oldChildren, newChildren) {
1307
+ if (oldChildren === newChildren) return false;
1308
+
1309
+ if (React__default.isValidElement(oldChildren) && React__default.isValidElement(newChildren) && oldChildren.key != null && oldChildren.key === newChildren.key) {
1310
+ return false;
1311
+ }
1312
+
1313
+ return true;
1314
+ }
1315
+ /**
1316
+ * Enum of modes for SwitchTransition component
1317
+ * @enum { string }
1318
+ */
1319
+
1320
+
1321
+ var modes = {
1322
+ out: 'out-in',
1323
+ in: 'in-out'
1324
+ };
1325
+
1326
+ var callHook = function callHook(element, name, cb) {
1327
+ return function () {
1328
+ var _element$props;
1329
+
1330
+ element.props[name] && (_element$props = element.props)[name].apply(_element$props, arguments);
1331
+ cb();
1332
+ };
1333
+ };
1334
+
1335
+ var leaveRenders = (_leaveRenders = {}, _leaveRenders[modes.out] = function (_ref) {
1336
+ var current = _ref.current,
1337
+ changeState = _ref.changeState;
1338
+ return React__default.cloneElement(current, {
1339
+ in: false,
1340
+ onExited: callHook(current, 'onExited', function () {
1341
+ changeState(ENTERING, null);
1342
+ })
1343
+ });
1344
+ }, _leaveRenders[modes.in] = function (_ref2) {
1345
+ var current = _ref2.current,
1346
+ changeState = _ref2.changeState,
1347
+ children = _ref2.children;
1348
+ return [current, React__default.cloneElement(children, {
1349
+ in: true,
1350
+ onEntered: callHook(children, 'onEntered', function () {
1351
+ changeState(ENTERING);
1352
+ })
1353
+ })];
1354
+ }, _leaveRenders);
1355
+ var enterRenders = (_enterRenders = {}, _enterRenders[modes.out] = function (_ref3) {
1356
+ var children = _ref3.children,
1357
+ changeState = _ref3.changeState;
1358
+ return React__default.cloneElement(children, {
1359
+ in: true,
1360
+ onEntered: callHook(children, 'onEntered', function () {
1361
+ changeState(ENTERED, React__default.cloneElement(children, {
1362
+ in: true
1363
+ }));
1364
+ })
1365
+ });
1366
+ }, _enterRenders[modes.in] = function (_ref4) {
1367
+ var current = _ref4.current,
1368
+ children = _ref4.children,
1369
+ changeState = _ref4.changeState;
1370
+ return [React__default.cloneElement(current, {
1371
+ in: false,
1372
+ onExited: callHook(current, 'onExited', function () {
1373
+ changeState(ENTERED, React__default.cloneElement(children, {
1374
+ in: true
1375
+ }));
1376
+ })
1377
+ }), React__default.cloneElement(children, {
1378
+ in: true
1379
+ })];
1380
+ }, _enterRenders);
1381
+ /**
1382
+ * A transition component inspired by the [vue transition modes](https://vuejs.org/v2/guide/transitions.html#Transition-Modes).
1383
+ * You can use it when you want to control the render between state transitions.
1384
+ * Based on the selected mode and the child's key which is the `Transition` or `CSSTransition` component, the `SwitchTransition` makes a consistent transition between them.
1385
+ *
1386
+ * If the `out-in` mode is selected, the `SwitchTransition` waits until the old child leaves and then inserts a new child.
1387
+ * If the `in-out` mode is selected, the `SwitchTransition` inserts a new child first, waits for the new child to enter and then removes the old child.
1388
+ *
1389
+ * **Note**: If you want the animation to happen simultaneously
1390
+ * (that is, to have the old child removed and a new child inserted **at the same time**),
1391
+ * you should use
1392
+ * [`TransitionGroup`](https://reactcommunity.org/react-transition-group/transition-group)
1393
+ * instead.
1394
+ *
1395
+ * ```jsx
1396
+ * function App() {
1397
+ * const [state, setState] = useState(false);
1398
+ * return (
1399
+ * <SwitchTransition>
1400
+ * <CSSTransition
1401
+ * key={state ? "Goodbye, world!" : "Hello, world!"}
1402
+ * addEndListener={(node, done) => node.addEventListener("transitionend", done, false)}
1403
+ * classNames='fade'
1404
+ * >
1405
+ * <button onClick={() => setState(state => !state)}>
1406
+ * {state ? "Goodbye, world!" : "Hello, world!"}
1407
+ * </button>
1408
+ * </CSSTransition>
1409
+ * </SwitchTransition>
1410
+ * );
1411
+ * }
1412
+ * ```
1413
+ *
1414
+ * ```css
1415
+ * .fade-enter{
1416
+ * opacity: 0;
1417
+ * }
1418
+ * .fade-exit{
1419
+ * opacity: 1;
1420
+ * }
1421
+ * .fade-enter-active{
1422
+ * opacity: 1;
1423
+ * }
1424
+ * .fade-exit-active{
1425
+ * opacity: 0;
1426
+ * }
1427
+ * .fade-enter-active,
1428
+ * .fade-exit-active{
1429
+ * transition: opacity 500ms;
1430
+ * }
1431
+ * ```
1432
+ */
1433
+
1434
+ var SwitchTransition = /*#__PURE__*/function (_React$Component) {
1435
+ _inheritsLoose(SwitchTransition, _React$Component);
1436
+
1437
+ function SwitchTransition() {
1438
+ var _this;
1439
+
1440
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
1441
+ args[_key] = arguments[_key];
1442
+ }
1443
+
1444
+ _this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;
1445
+ _this.state = {
1446
+ status: ENTERED,
1447
+ current: null
1448
+ };
1449
+ _this.appeared = false;
1450
+
1451
+ _this.changeState = function (status, current) {
1452
+ if (current === void 0) {
1453
+ current = _this.state.current;
1454
+ }
1455
+
1456
+ _this.setState({
1457
+ status: status,
1458
+ current: current
1459
+ });
1460
+ };
1461
+
1462
+ return _this;
1463
+ }
1464
+
1465
+ var _proto = SwitchTransition.prototype;
1466
+
1467
+ _proto.componentDidMount = function componentDidMount() {
1468
+ this.appeared = true;
1469
+ };
1470
+
1471
+ SwitchTransition.getDerivedStateFromProps = function getDerivedStateFromProps(props, state) {
1472
+ if (props.children == null) {
1473
+ return {
1474
+ current: null
1475
+ };
1476
+ }
1477
+
1478
+ if (state.status === ENTERING && props.mode === modes.in) {
1479
+ return {
1480
+ status: ENTERING
1481
+ };
1482
+ }
1483
+
1484
+ if (state.current && areChildrenDifferent(state.current, props.children)) {
1485
+ return {
1486
+ status: EXITING
1487
+ };
1488
+ }
1489
+
1490
+ return {
1491
+ current: React__default.cloneElement(props.children, {
1492
+ in: true
1493
+ })
1494
+ };
1495
+ };
1496
+
1497
+ _proto.render = function render() {
1498
+ var _this$props = this.props,
1499
+ children = _this$props.children,
1500
+ mode = _this$props.mode,
1501
+ _this$state = this.state,
1502
+ status = _this$state.status,
1503
+ current = _this$state.current;
1504
+ var data = {
1505
+ children: children,
1506
+ current: current,
1507
+ changeState: this.changeState,
1508
+ status: status
1509
+ };
1510
+ var component;
1511
+
1512
+ switch (status) {
1513
+ case ENTERING:
1514
+ component = enterRenders[mode](data);
1515
+ break;
1516
+
1517
+ case EXITING:
1518
+ component = leaveRenders[mode](data);
1519
+ break;
1520
+
1521
+ case ENTERED:
1522
+ component = current;
1523
+ }
1524
+
1525
+ return /*#__PURE__*/React__default.createElement(TransitionGroupContext.Provider, {
1526
+ value: {
1527
+ isMounting: !this.appeared
1528
+ }
1529
+ }, component);
1530
+ };
1531
+
1532
+ return SwitchTransition;
1533
+ }(React__default.Component);
1534
+
1535
+ SwitchTransition.propTypes = {};
1536
+ SwitchTransition.defaultProps = {
1537
+ mode: modes.out
1538
+ };
1539
+
1540
+ var useEnhancedEffect$2 = typeof window === 'undefined' ? React$2.useEffect : React$2.useLayoutEffect;
1541
+ /**
1542
+ * @ignore - internal component.
1543
+ */
1544
+
1545
+ function Ripple(props) {
1546
+ var classes = props.classes,
1547
+ _props$pulsate = props.pulsate,
1548
+ pulsate = _props$pulsate === void 0 ? false : _props$pulsate,
1549
+ rippleX = props.rippleX,
1550
+ rippleY = props.rippleY,
1551
+ rippleSize = props.rippleSize,
1552
+ inProp = props.in,
1553
+ _props$onExited = props.onExited,
1554
+ onExited = _props$onExited === void 0 ? function () {} : _props$onExited,
1555
+ timeout = props.timeout;
1556
+
1557
+ var _React$useState = React$2.useState(false),
1558
+ leaving = _React$useState[0],
1559
+ setLeaving = _React$useState[1];
1560
+
1561
+ var rippleClassName = clsx(classes.ripple, classes.rippleVisible, pulsate && classes.ripplePulsate);
1562
+ var rippleStyles = {
1563
+ width: rippleSize,
1564
+ height: rippleSize,
1565
+ top: -(rippleSize / 2) + rippleY,
1566
+ left: -(rippleSize / 2) + rippleX
1567
+ };
1568
+ var childClassName = clsx(classes.child, leaving && classes.childLeaving, pulsate && classes.childPulsate);
1569
+ var handleExited = useEventCallback(onExited); // Ripple is used for user feedback (e.g. click or press) so we want to apply styles with the highest priority
1570
+
1571
+ useEnhancedEffect$2(function () {
1572
+ if (!inProp) {
1573
+ // react-transition-group#onExit
1574
+ setLeaving(true); // react-transition-group#onExited
1575
+
1576
+ var timeoutId = setTimeout(handleExited, timeout);
1577
+ return function () {
1578
+ clearTimeout(timeoutId);
1579
+ };
1580
+ }
1581
+
1582
+ return undefined;
1583
+ }, [handleExited, inProp, timeout]);
1584
+ return /*#__PURE__*/React$2.createElement("span", {
1585
+ className: rippleClassName,
1586
+ style: rippleStyles
1587
+ }, /*#__PURE__*/React$2.createElement("span", {
1588
+ className: childClassName
1589
+ }));
1590
+ }
1591
+
1592
+ var DURATION = 550;
1593
+ var DELAY_RIPPLE = 80;
1594
+ var styles$7 = function styles(theme) {
1595
+ return {
1596
+ /* Styles applied to the root element. */
1597
+ root: {
1598
+ overflow: 'hidden',
1599
+ pointerEvents: 'none',
1600
+ position: 'absolute',
1601
+ zIndex: 0,
1602
+ top: 0,
1603
+ right: 0,
1604
+ bottom: 0,
1605
+ left: 0,
1606
+ borderRadius: 'inherit'
1607
+ },
1608
+
1609
+ /* Styles applied to the internal `Ripple` components `ripple` class. */
1610
+ ripple: {
1611
+ opacity: 0,
1612
+ position: 'absolute'
1613
+ },
1614
+
1615
+ /* Styles applied to the internal `Ripple` components `rippleVisible` class. */
1616
+ rippleVisible: {
1617
+ opacity: 0.3,
1618
+ transform: 'scale(1)',
1619
+ animation: "$enter ".concat(DURATION, "ms ").concat(theme.transitions.easing.easeInOut)
1620
+ },
1621
+
1622
+ /* Styles applied to the internal `Ripple` components `ripplePulsate` class. */
1623
+ ripplePulsate: {
1624
+ animationDuration: "".concat(theme.transitions.duration.shorter, "ms")
1625
+ },
1626
+
1627
+ /* Styles applied to the internal `Ripple` components `child` class. */
1628
+ child: {
1629
+ opacity: 1,
1630
+ display: 'block',
1631
+ width: '100%',
1632
+ height: '100%',
1633
+ borderRadius: '50%',
1634
+ backgroundColor: 'currentColor'
1635
+ },
1636
+
1637
+ /* Styles applied to the internal `Ripple` components `childLeaving` class. */
1638
+ childLeaving: {
1639
+ opacity: 0,
1640
+ animation: "$exit ".concat(DURATION, "ms ").concat(theme.transitions.easing.easeInOut)
1641
+ },
1642
+
1643
+ /* Styles applied to the internal `Ripple` components `childPulsate` class. */
1644
+ childPulsate: {
1645
+ position: 'absolute',
1646
+ left: 0,
1647
+ top: 0,
1648
+ animation: "$pulsate 2500ms ".concat(theme.transitions.easing.easeInOut, " 200ms infinite")
1649
+ },
1650
+ '@keyframes enter': {
1651
+ '0%': {
1652
+ transform: 'scale(0)',
1653
+ opacity: 0.1
1654
+ },
1655
+ '100%': {
1656
+ transform: 'scale(1)',
1657
+ opacity: 0.3
1658
+ }
1659
+ },
1660
+ '@keyframes exit': {
1661
+ '0%': {
1662
+ opacity: 1
1663
+ },
1664
+ '100%': {
1665
+ opacity: 0
1666
+ }
1667
+ },
1668
+ '@keyframes pulsate': {
1669
+ '0%': {
1670
+ transform: 'scale(1)'
1671
+ },
1672
+ '50%': {
1673
+ transform: 'scale(0.92)'
1674
+ },
1675
+ '100%': {
1676
+ transform: 'scale(1)'
1677
+ }
1678
+ }
1679
+ };
1680
+ };
1681
+ /**
1682
+ * @ignore - internal component.
1683
+ *
1684
+ * TODO v5: Make private
1685
+ */
1686
+
1687
+ var TouchRipple = /*#__PURE__*/React$2.forwardRef(function TouchRipple(props, ref) {
1688
+ var _props$center = props.center,
1689
+ centerProp = _props$center === void 0 ? false : _props$center,
1690
+ classes = props.classes,
1691
+ className = props.className,
1692
+ other = _objectWithoutProperties(props, ["center", "classes", "className"]);
1693
+
1694
+ var _React$useState = React$2.useState([]),
1695
+ ripples = _React$useState[0],
1696
+ setRipples = _React$useState[1];
1697
+
1698
+ var nextKey = React$2.useRef(0);
1699
+ var rippleCallback = React$2.useRef(null);
1700
+ React$2.useEffect(function () {
1701
+ if (rippleCallback.current) {
1702
+ rippleCallback.current();
1703
+ rippleCallback.current = null;
1704
+ }
1705
+ }, [ripples]); // Used to filter out mouse emulated events on mobile.
1706
+
1707
+ var ignoringMouseDown = React$2.useRef(false); // We use a timer in order to only show the ripples for touch "click" like events.
1708
+ // We don't want to display the ripple for touch scroll events.
1709
+
1710
+ var startTimer = React$2.useRef(null); // This is the hook called once the previous timeout is ready.
1711
+
1712
+ var startTimerCommit = React$2.useRef(null);
1713
+ var container = React$2.useRef(null);
1714
+ React$2.useEffect(function () {
1715
+ return function () {
1716
+ clearTimeout(startTimer.current);
1717
+ };
1718
+ }, []);
1719
+ var startCommit = React$2.useCallback(function (params) {
1720
+ var pulsate = params.pulsate,
1721
+ rippleX = params.rippleX,
1722
+ rippleY = params.rippleY,
1723
+ rippleSize = params.rippleSize,
1724
+ cb = params.cb;
1725
+ setRipples(function (oldRipples) {
1726
+ return [].concat(_toConsumableArray(oldRipples), [/*#__PURE__*/React$2.createElement(Ripple, {
1727
+ key: nextKey.current,
1728
+ classes: classes,
1729
+ timeout: DURATION,
1730
+ pulsate: pulsate,
1731
+ rippleX: rippleX,
1732
+ rippleY: rippleY,
1733
+ rippleSize: rippleSize
1734
+ })]);
1735
+ });
1736
+ nextKey.current += 1;
1737
+ rippleCallback.current = cb;
1738
+ }, [classes]);
1739
+ var start = React$2.useCallback(function () {
1740
+ var event = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
1741
+ var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
1742
+ var cb = arguments.length > 2 ? arguments[2] : undefined;
1743
+ var _options$pulsate = options.pulsate,
1744
+ pulsate = _options$pulsate === void 0 ? false : _options$pulsate,
1745
+ _options$center = options.center,
1746
+ center = _options$center === void 0 ? centerProp || options.pulsate : _options$center,
1747
+ _options$fakeElement = options.fakeElement,
1748
+ fakeElement = _options$fakeElement === void 0 ? false : _options$fakeElement;
1749
+
1750
+ if (event.type === 'mousedown' && ignoringMouseDown.current) {
1751
+ ignoringMouseDown.current = false;
1752
+ return;
1753
+ }
1754
+
1755
+ if (event.type === 'touchstart') {
1756
+ ignoringMouseDown.current = true;
1757
+ }
1758
+
1759
+ var element = fakeElement ? null : container.current;
1760
+ var rect = element ? element.getBoundingClientRect() : {
1761
+ width: 0,
1762
+ height: 0,
1763
+ left: 0,
1764
+ top: 0
1765
+ }; // Get the size of the ripple
1766
+
1767
+ var rippleX;
1768
+ var rippleY;
1769
+ var rippleSize;
1770
+
1771
+ if (center || event.clientX === 0 && event.clientY === 0 || !event.clientX && !event.touches) {
1772
+ rippleX = Math.round(rect.width / 2);
1773
+ rippleY = Math.round(rect.height / 2);
1774
+ } else {
1775
+ var _ref = event.touches ? event.touches[0] : event,
1776
+ clientX = _ref.clientX,
1777
+ clientY = _ref.clientY;
1778
+
1779
+ rippleX = Math.round(clientX - rect.left);
1780
+ rippleY = Math.round(clientY - rect.top);
1781
+ }
1782
+
1783
+ if (center) {
1784
+ rippleSize = Math.sqrt((2 * Math.pow(rect.width, 2) + Math.pow(rect.height, 2)) / 3); // For some reason the animation is broken on Mobile Chrome if the size if even.
1785
+
1786
+ if (rippleSize % 2 === 0) {
1787
+ rippleSize += 1;
1788
+ }
1789
+ } else {
1790
+ var sizeX = Math.max(Math.abs((element ? element.clientWidth : 0) - rippleX), rippleX) * 2 + 2;
1791
+ var sizeY = Math.max(Math.abs((element ? element.clientHeight : 0) - rippleY), rippleY) * 2 + 2;
1792
+ rippleSize = Math.sqrt(Math.pow(sizeX, 2) + Math.pow(sizeY, 2));
1793
+ } // Touche devices
1794
+
1795
+
1796
+ if (event.touches) {
1797
+ // check that this isn't another touchstart due to multitouch
1798
+ // otherwise we will only clear a single timer when unmounting while two
1799
+ // are running
1800
+ if (startTimerCommit.current === null) {
1801
+ // Prepare the ripple effect.
1802
+ startTimerCommit.current = function () {
1803
+ startCommit({
1804
+ pulsate: pulsate,
1805
+ rippleX: rippleX,
1806
+ rippleY: rippleY,
1807
+ rippleSize: rippleSize,
1808
+ cb: cb
1809
+ });
1810
+ }; // Delay the execution of the ripple effect.
1811
+
1812
+
1813
+ startTimer.current = setTimeout(function () {
1814
+ if (startTimerCommit.current) {
1815
+ startTimerCommit.current();
1816
+ startTimerCommit.current = null;
1817
+ }
1818
+ }, DELAY_RIPPLE); // We have to make a tradeoff with this value.
1819
+ }
1820
+ } else {
1821
+ startCommit({
1822
+ pulsate: pulsate,
1823
+ rippleX: rippleX,
1824
+ rippleY: rippleY,
1825
+ rippleSize: rippleSize,
1826
+ cb: cb
1827
+ });
1828
+ }
1829
+ }, [centerProp, startCommit]);
1830
+ var pulsate = React$2.useCallback(function () {
1831
+ start({}, {
1832
+ pulsate: true
1833
+ });
1834
+ }, [start]);
1835
+ var stop = React$2.useCallback(function (event, cb) {
1836
+ clearTimeout(startTimer.current); // The touch interaction occurs too quickly.
1837
+ // We still want to show ripple effect.
1838
+
1839
+ if (event.type === 'touchend' && startTimerCommit.current) {
1840
+ event.persist();
1841
+ startTimerCommit.current();
1842
+ startTimerCommit.current = null;
1843
+ startTimer.current = setTimeout(function () {
1844
+ stop(event, cb);
1845
+ });
1846
+ return;
1847
+ }
1848
+
1849
+ startTimerCommit.current = null;
1850
+ setRipples(function (oldRipples) {
1851
+ if (oldRipples.length > 0) {
1852
+ return oldRipples.slice(1);
1853
+ }
1854
+
1855
+ return oldRipples;
1856
+ });
1857
+ rippleCallback.current = cb;
1858
+ }, []);
1859
+ React$2.useImperativeHandle(ref, function () {
1860
+ return {
1861
+ pulsate: pulsate,
1862
+ start: start,
1863
+ stop: stop
1864
+ };
1865
+ }, [pulsate, start, stop]);
1866
+ return /*#__PURE__*/React$2.createElement("span", _extends({
1867
+ className: clsx(classes.root, className),
1868
+ ref: container
1869
+ }, other), /*#__PURE__*/React$2.createElement(TransitionGroup, {
1870
+ component: null,
1871
+ exit: true
1872
+ }, ripples));
1873
+ });
1874
+ var TouchRipple$1 = withStyles(styles$7, {
1875
+ flip: false,
1876
+ name: 'MuiTouchRipple'
1877
+ })( /*#__PURE__*/React$2.memo(TouchRipple));
1878
+
1879
+ var styles$6 = {
1880
+ /* Styles applied to the root element. */
1881
+ root: {
1882
+ display: 'inline-flex',
1883
+ alignItems: 'center',
1884
+ justifyContent: 'center',
1885
+ position: 'relative',
1886
+ WebkitTapHighlightColor: 'transparent',
1887
+ backgroundColor: 'transparent',
1888
+ // Reset default value
1889
+ // We disable the focus ring for mouse, touch and keyboard users.
1890
+ outline: 0,
1891
+ border: 0,
1892
+ margin: 0,
1893
+ // Remove the margin in Safari
1894
+ borderRadius: 0,
1895
+ padding: 0,
1896
+ // Remove the padding in Firefox
1897
+ cursor: 'pointer',
1898
+ userSelect: 'none',
1899
+ verticalAlign: 'middle',
1900
+ '-moz-appearance': 'none',
1901
+ // Reset
1902
+ '-webkit-appearance': 'none',
1903
+ // Reset
1904
+ textDecoration: 'none',
1905
+ // So we take precedent over the style of a native <a /> element.
1906
+ color: 'inherit',
1907
+ '&::-moz-focus-inner': {
1908
+ borderStyle: 'none' // Remove Firefox dotted outline.
1909
+
1910
+ },
1911
+ '&$disabled': {
1912
+ pointerEvents: 'none',
1913
+ // Disable link interactions
1914
+ cursor: 'default'
1915
+ },
1916
+ '@media print': {
1917
+ colorAdjust: 'exact'
1918
+ }
1919
+ },
1920
+
1921
+ /* Pseudo-class applied to the root element if `disabled={true}`. */
1922
+ disabled: {},
1923
+
1924
+ /* Pseudo-class applied to the root element if keyboard focused. */
1925
+ focusVisible: {}
1926
+ };
1927
+ /**
1928
+ * `ButtonBase` contains as few styles as possible.
1929
+ * It aims to be a simple building block for creating a button.
1930
+ * It contains a load of style reset and some focus/ripple logic.
1931
+ */
1932
+
1933
+ var ButtonBase = /*#__PURE__*/React$2.forwardRef(function ButtonBase(props, ref) {
1934
+ var action = props.action,
1935
+ buttonRefProp = props.buttonRef,
1936
+ _props$centerRipple = props.centerRipple,
1937
+ centerRipple = _props$centerRipple === void 0 ? false : _props$centerRipple,
1938
+ children = props.children,
1939
+ classes = props.classes,
1940
+ className = props.className,
1941
+ _props$component = props.component,
1942
+ component = _props$component === void 0 ? 'button' : _props$component,
1943
+ _props$disabled = props.disabled,
1944
+ disabled = _props$disabled === void 0 ? false : _props$disabled,
1945
+ _props$disableRipple = props.disableRipple,
1946
+ disableRipple = _props$disableRipple === void 0 ? false : _props$disableRipple,
1947
+ _props$disableTouchRi = props.disableTouchRipple,
1948
+ disableTouchRipple = _props$disableTouchRi === void 0 ? false : _props$disableTouchRi,
1949
+ _props$focusRipple = props.focusRipple,
1950
+ focusRipple = _props$focusRipple === void 0 ? false : _props$focusRipple,
1951
+ focusVisibleClassName = props.focusVisibleClassName,
1952
+ onBlur = props.onBlur,
1953
+ onClick = props.onClick,
1954
+ onFocus = props.onFocus,
1955
+ onFocusVisible = props.onFocusVisible,
1956
+ onKeyDown = props.onKeyDown,
1957
+ onKeyUp = props.onKeyUp,
1958
+ onMouseDown = props.onMouseDown,
1959
+ onMouseLeave = props.onMouseLeave,
1960
+ onMouseUp = props.onMouseUp,
1961
+ onTouchEnd = props.onTouchEnd,
1962
+ onTouchMove = props.onTouchMove,
1963
+ onTouchStart = props.onTouchStart,
1964
+ onDragLeave = props.onDragLeave,
1965
+ _props$tabIndex = props.tabIndex,
1966
+ tabIndex = _props$tabIndex === void 0 ? 0 : _props$tabIndex,
1967
+ TouchRippleProps = props.TouchRippleProps,
1968
+ _props$type = props.type,
1969
+ type = _props$type === void 0 ? 'button' : _props$type,
1970
+ other = _objectWithoutProperties(props, ["action", "buttonRef", "centerRipple", "children", "classes", "className", "component", "disabled", "disableRipple", "disableTouchRipple", "focusRipple", "focusVisibleClassName", "onBlur", "onClick", "onFocus", "onFocusVisible", "onKeyDown", "onKeyUp", "onMouseDown", "onMouseLeave", "onMouseUp", "onTouchEnd", "onTouchMove", "onTouchStart", "onDragLeave", "tabIndex", "TouchRippleProps", "type"]);
1971
+
1972
+ var buttonRef = React$2.useRef(null);
1973
+
1974
+ function getButtonNode() {
1975
+ // #StrictMode ready
1976
+ return ReactDOM.findDOMNode(buttonRef.current);
1977
+ }
1978
+
1979
+ var rippleRef = React$2.useRef(null);
1980
+
1981
+ var _React$useState = React$2.useState(false),
1982
+ focusVisible = _React$useState[0],
1983
+ setFocusVisible = _React$useState[1];
1984
+
1985
+ if (disabled && focusVisible) {
1986
+ setFocusVisible(false);
1987
+ }
1988
+
1989
+ var _useIsFocusVisible = useIsFocusVisible(),
1990
+ isFocusVisible = _useIsFocusVisible.isFocusVisible,
1991
+ onBlurVisible = _useIsFocusVisible.onBlurVisible,
1992
+ focusVisibleRef = _useIsFocusVisible.ref;
1993
+
1994
+ React$2.useImperativeHandle(action, function () {
1995
+ return {
1996
+ focusVisible: function focusVisible() {
1997
+ setFocusVisible(true);
1998
+ buttonRef.current.focus();
1999
+ }
2000
+ };
2001
+ }, []);
2002
+ React$2.useEffect(function () {
2003
+ if (focusVisible && focusRipple && !disableRipple) {
2004
+ rippleRef.current.pulsate();
2005
+ }
2006
+ }, [disableRipple, focusRipple, focusVisible]);
2007
+
2008
+ function useRippleHandler(rippleAction, eventCallback) {
2009
+ var skipRippleAction = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : disableTouchRipple;
2010
+ return useEventCallback(function (event) {
2011
+ if (eventCallback) {
2012
+ eventCallback(event);
2013
+ }
2014
+
2015
+ var ignore = skipRippleAction;
2016
+
2017
+ if (!ignore && rippleRef.current) {
2018
+ rippleRef.current[rippleAction](event);
2019
+ }
2020
+
2021
+ return true;
2022
+ });
2023
+ }
2024
+
2025
+ var handleMouseDown = useRippleHandler('start', onMouseDown);
2026
+ var handleDragLeave = useRippleHandler('stop', onDragLeave);
2027
+ var handleMouseUp = useRippleHandler('stop', onMouseUp);
2028
+ var handleMouseLeave = useRippleHandler('stop', function (event) {
2029
+ if (focusVisible) {
2030
+ event.preventDefault();
2031
+ }
2032
+
2033
+ if (onMouseLeave) {
2034
+ onMouseLeave(event);
2035
+ }
2036
+ });
2037
+ var handleTouchStart = useRippleHandler('start', onTouchStart);
2038
+ var handleTouchEnd = useRippleHandler('stop', onTouchEnd);
2039
+ var handleTouchMove = useRippleHandler('stop', onTouchMove);
2040
+ var handleBlur = useRippleHandler('stop', function (event) {
2041
+ if (focusVisible) {
2042
+ onBlurVisible(event);
2043
+ setFocusVisible(false);
2044
+ }
2045
+
2046
+ if (onBlur) {
2047
+ onBlur(event);
2048
+ }
2049
+ }, false);
2050
+ var handleFocus = useEventCallback(function (event) {
2051
+ // Fix for https://github.com/facebook/react/issues/7769
2052
+ if (!buttonRef.current) {
2053
+ buttonRef.current = event.currentTarget;
2054
+ }
2055
+
2056
+ if (isFocusVisible(event)) {
2057
+ setFocusVisible(true);
2058
+
2059
+ if (onFocusVisible) {
2060
+ onFocusVisible(event);
2061
+ }
2062
+ }
2063
+
2064
+ if (onFocus) {
2065
+ onFocus(event);
2066
+ }
2067
+ });
2068
+
2069
+ var isNonNativeButton = function isNonNativeButton() {
2070
+ var button = getButtonNode();
2071
+ return component && component !== 'button' && !(button.tagName === 'A' && button.href);
2072
+ };
2073
+ /**
2074
+ * IE 11 shim for https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/repeat
2075
+ */
2076
+
2077
+
2078
+ var keydownRef = React$2.useRef(false);
2079
+ var handleKeyDown = useEventCallback(function (event) {
2080
+ // Check if key is already down to avoid repeats being counted as multiple activations
2081
+ if (focusRipple && !keydownRef.current && focusVisible && rippleRef.current && event.key === ' ') {
2082
+ keydownRef.current = true;
2083
+ event.persist();
2084
+ rippleRef.current.stop(event, function () {
2085
+ rippleRef.current.start(event);
2086
+ });
2087
+ }
2088
+
2089
+ if (event.target === event.currentTarget && isNonNativeButton() && event.key === ' ') {
2090
+ event.preventDefault();
2091
+ }
2092
+
2093
+ if (onKeyDown) {
2094
+ onKeyDown(event);
2095
+ } // Keyboard accessibility for non interactive elements
2096
+
2097
+
2098
+ if (event.target === event.currentTarget && isNonNativeButton() && event.key === 'Enter' && !disabled) {
2099
+ event.preventDefault();
2100
+
2101
+ if (onClick) {
2102
+ onClick(event);
2103
+ }
2104
+ }
2105
+ });
2106
+ var handleKeyUp = useEventCallback(function (event) {
2107
+ // calling preventDefault in keyUp on a <button> will not dispatch a click event if Space is pressed
2108
+ // https://codesandbox.io/s/button-keyup-preventdefault-dn7f0
2109
+ if (focusRipple && event.key === ' ' && rippleRef.current && focusVisible && !event.defaultPrevented) {
2110
+ keydownRef.current = false;
2111
+ event.persist();
2112
+ rippleRef.current.stop(event, function () {
2113
+ rippleRef.current.pulsate(event);
2114
+ });
2115
+ }
2116
+
2117
+ if (onKeyUp) {
2118
+ onKeyUp(event);
2119
+ } // Keyboard accessibility for non interactive elements
2120
+
2121
+
2122
+ if (onClick && event.target === event.currentTarget && isNonNativeButton() && event.key === ' ' && !event.defaultPrevented) {
2123
+ onClick(event);
2124
+ }
2125
+ });
2126
+ var ComponentProp = component;
2127
+
2128
+ if (ComponentProp === 'button' && other.href) {
2129
+ ComponentProp = 'a';
2130
+ }
2131
+
2132
+ var buttonProps = {};
2133
+
2134
+ if (ComponentProp === 'button') {
2135
+ buttonProps.type = type;
2136
+ buttonProps.disabled = disabled;
2137
+ } else {
2138
+ if (ComponentProp !== 'a' || !other.href) {
2139
+ buttonProps.role = 'button';
2140
+ }
2141
+
2142
+ buttonProps['aria-disabled'] = disabled;
2143
+ }
2144
+
2145
+ var handleUserRef = useForkRef(buttonRefProp, ref);
2146
+ var handleOwnRef = useForkRef(focusVisibleRef, buttonRef);
2147
+ var handleRef = useForkRef(handleUserRef, handleOwnRef);
2148
+
2149
+ var _React$useState2 = React$2.useState(false),
2150
+ mountedState = _React$useState2[0],
2151
+ setMountedState = _React$useState2[1];
2152
+
2153
+ React$2.useEffect(function () {
2154
+ setMountedState(true);
2155
+ }, []);
2156
+ var enableTouchRipple = mountedState && !disableRipple && !disabled;
2157
+
2158
+ return /*#__PURE__*/React$2.createElement(ComponentProp, _extends({
2159
+ className: clsx(classes.root, className, focusVisible && [classes.focusVisible, focusVisibleClassName], disabled && classes.disabled),
2160
+ onBlur: handleBlur,
2161
+ onClick: onClick,
2162
+ onFocus: handleFocus,
2163
+ onKeyDown: handleKeyDown,
2164
+ onKeyUp: handleKeyUp,
2165
+ onMouseDown: handleMouseDown,
2166
+ onMouseLeave: handleMouseLeave,
2167
+ onMouseUp: handleMouseUp,
2168
+ onDragLeave: handleDragLeave,
2169
+ onTouchEnd: handleTouchEnd,
2170
+ onTouchMove: handleTouchMove,
2171
+ onTouchStart: handleTouchStart,
2172
+ ref: handleRef,
2173
+ tabIndex: disabled ? -1 : tabIndex
2174
+ }, buttonProps, other), children, enableTouchRipple ?
2175
+ /*#__PURE__*/
2176
+
2177
+ /* TouchRipple is only needed client-side, x2 boost on the server. */
2178
+ React$2.createElement(TouchRipple$1, _extends({
2179
+ ref: rippleRef,
2180
+ center: centerRipple
2181
+ }, TouchRippleProps)) : null);
2182
+ });
2183
+ var ButtonBase$1 = withStyles(styles$6, {
2184
+ name: 'MuiButtonBase'
2185
+ })(ButtonBase);
2186
+
2187
+ /**
2188
+ * @ignore - internal component.
2189
+ */
2190
+
2191
+ var FirstPageIcon = createSvgIcon( /*#__PURE__*/React$2.createElement("path", {
2192
+ d: "M18.41 16.59L13.82 12l4.59-4.59L17 6l-6 6 6 6zM6 6h2v12H6z"
2193
+ }));
2194
+
2195
+ /**
2196
+ * @ignore - internal component.
2197
+ */
2198
+
2199
+ var LastPageIcon = createSvgIcon( /*#__PURE__*/React$2.createElement("path", {
2200
+ d: "M5.59 7.41L10.18 12l-4.59 4.59L7 18l6-6-6-6zM16 6h2v12h-2z"
2201
+ }));
2202
+
2203
+ /**
2204
+ * @ignore - internal component.
2205
+ */
2206
+
2207
+ var NavigateBeforeIcon = createSvgIcon( /*#__PURE__*/React$2.createElement("path", {
2208
+ d: "M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z"
2209
+ }));
2210
+
2211
+ /**
2212
+ * @ignore - internal component.
2213
+ */
2214
+
2215
+ var NavigateNextIcon = createSvgIcon( /*#__PURE__*/React$2.createElement("path", {
2216
+ d: "M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"
2217
+ }));
2218
+
2219
+ var styles$5 = function styles(theme) {
2220
+ return {
2221
+ /* Styles applied to the root element. */
2222
+ root: _extends({}, theme.typography.body2, {
2223
+ borderRadius: 32 / 2,
2224
+ textAlign: 'center',
2225
+ boxSizing: 'border-box',
2226
+ minWidth: 32,
2227
+ height: 32,
2228
+ padding: '0 6px',
2229
+ margin: '0 3px',
2230
+ color: theme.palette.text.primary
2231
+ }),
2232
+
2233
+ /* Styles applied to the root element if `type="page"`. */
2234
+ page: {
2235
+ transition: theme.transitions.create(['color', 'background-color'], {
2236
+ duration: theme.transitions.duration.short
2237
+ }),
2238
+ '&:hover': {
2239
+ backgroundColor: theme.palette.action.hover,
2240
+ // Reset on touch devices, it doesn't add specificity
2241
+ '@media (hover: none)': {
2242
+ backgroundColor: 'transparent'
2243
+ }
2244
+ },
2245
+ '&$focusVisible': {
2246
+ backgroundColor: theme.palette.action.focus
2247
+ },
2248
+ '&$selected': {
2249
+ backgroundColor: theme.palette.action.selected,
2250
+ '&:hover, &$focusVisible': {
2251
+ backgroundColor: alpha(theme.palette.action.selected, theme.palette.action.selectedOpacity + theme.palette.action.hoverOpacity),
2252
+ // Reset on touch devices, it doesn't add specificity
2253
+ '@media (hover: none)': {
2254
+ backgroundColor: theme.palette.action.selected
2255
+ }
2256
+ },
2257
+ '&$disabled': {
2258
+ opacity: 1,
2259
+ color: theme.palette.action.disabled,
2260
+ backgroundColor: theme.palette.action.selected
2261
+ }
2262
+ },
2263
+ '&$disabled': {
2264
+ opacity: theme.palette.action.disabledOpacity
2265
+ }
2266
+ },
2267
+
2268
+ /* Styles applied applied to the root element if `size="small"`. */
2269
+ sizeSmall: {
2270
+ minWidth: 26,
2271
+ height: 26,
2272
+ borderRadius: 26 / 2,
2273
+ margin: '0 1px',
2274
+ padding: '0 4px',
2275
+ '& $icon': {
2276
+ fontSize: theme.typography.pxToRem(18)
2277
+ }
2278
+ },
2279
+
2280
+ /* Styles applied applied to the root element if `size="large"`. */
2281
+ sizeLarge: {
2282
+ minWidth: 40,
2283
+ height: 40,
2284
+ borderRadius: 40 / 2,
2285
+ padding: '0 10px',
2286
+ fontSize: theme.typography.pxToRem(15),
2287
+ '& $icon': {
2288
+ fontSize: theme.typography.pxToRem(22)
2289
+ }
2290
+ },
2291
+
2292
+ /* Styles applied to the root element if `variant="text"` and `color="primary"`. */
2293
+ textPrimary: {
2294
+ '&$selected': {
2295
+ color: theme.palette.primary.contrastText,
2296
+ backgroundColor: theme.palette.primary.main,
2297
+ '&:hover, &$focusVisible': {
2298
+ backgroundColor: theme.palette.primary.dark,
2299
+ // Reset on touch devices, it doesn't add specificity
2300
+ '@media (hover: none)': {
2301
+ backgroundColor: theme.palette.primary.main
2302
+ }
2303
+ },
2304
+ '&$disabled': {
2305
+ color: theme.palette.action.disabled
2306
+ }
2307
+ }
2308
+ },
2309
+
2310
+ /* Styles applied to the root element if `variant="text"` and `color="secondary"`. */
2311
+ textSecondary: {
2312
+ '&$selected': {
2313
+ color: theme.palette.secondary.contrastText,
2314
+ backgroundColor: theme.palette.secondary.main,
2315
+ '&:hover, &$focusVisible': {
2316
+ backgroundColor: theme.palette.secondary.dark,
2317
+ // Reset on touch devices, it doesn't add specificity
2318
+ '@media (hover: none)': {
2319
+ backgroundColor: theme.palette.secondary.main
2320
+ }
2321
+ },
2322
+ '&$disabled': {
2323
+ color: theme.palette.action.disabled
2324
+ }
2325
+ }
2326
+ },
2327
+
2328
+ /* Styles applied to the root element if `outlined="true"`. */
2329
+ outlined: {
2330
+ border: "1px solid ".concat(theme.palette.type === 'light' ? 'rgba(0, 0, 0, 0.23)' : 'rgba(255, 255, 255, 0.23)'),
2331
+ '&$selected': {
2332
+ '&$disabled': {
2333
+ border: "1px solid ".concat(theme.palette.action.disabledBackground)
2334
+ }
2335
+ }
2336
+ },
2337
+
2338
+ /* Styles applied to the root element if `variant="outlined"` and `color="primary"`. */
2339
+ outlinedPrimary: {
2340
+ '&$selected': {
2341
+ color: theme.palette.primary.main,
2342
+ border: "1px solid ".concat(alpha(theme.palette.primary.main, 0.5)),
2343
+ backgroundColor: alpha(theme.palette.primary.main, theme.palette.action.activatedOpacity),
2344
+ '&:hover, &$focusVisible': {
2345
+ backgroundColor: alpha(theme.palette.primary.main, theme.palette.action.activatedOpacity + theme.palette.action.hoverOpacity),
2346
+ // Reset on touch devices, it doesn't add specificity
2347
+ '@media (hover: none)': {
2348
+ backgroundColor: 'transparent'
2349
+ }
2350
+ },
2351
+ '&$disabled': {
2352
+ color: theme.palette.action.disabled
2353
+ }
2354
+ }
2355
+ },
2356
+
2357
+ /* Styles applied to the root element if `variant="outlined"` and `color="secondary"`. */
2358
+ outlinedSecondary: {
2359
+ '&$selected': {
2360
+ color: theme.palette.secondary.main,
2361
+ border: "1px solid ".concat(alpha(theme.palette.secondary.main, 0.5)),
2362
+ backgroundColor: alpha(theme.palette.secondary.main, theme.palette.action.activatedOpacity),
2363
+ '&:hover, &$focusVisible': {
2364
+ backgroundColor: alpha(theme.palette.secondary.main, theme.palette.action.activatedOpacity + theme.palette.action.hoverOpacity),
2365
+ // Reset on touch devices, it doesn't add specificity
2366
+ '@media (hover: none)': {
2367
+ backgroundColor: 'transparent'
2368
+ }
2369
+ },
2370
+ '&$disabled': {
2371
+ color: theme.palette.action.disabled
2372
+ }
2373
+ }
2374
+ },
2375
+
2376
+ /* Styles applied to the root element if `rounded="true"`. */
2377
+ rounded: {
2378
+ borderRadius: theme.shape.borderRadius
2379
+ },
2380
+
2381
+ /* Styles applied to the root element if `type="start-ellipsis"` or `type="end-ellipsis"`. */
2382
+ ellipsis: {
2383
+ height: 'auto',
2384
+ '&$disabled': {
2385
+ opacity: theme.palette.action.disabledOpacity
2386
+ }
2387
+ },
2388
+
2389
+ /* Pseudo-class applied to the root element if keyboard focused. */
2390
+ focusVisible: {},
2391
+
2392
+ /* Pseudo-class applied to the root element if `disabled={true}`. */
2393
+ disabled: {},
2394
+
2395
+ /* Pseudo-class applied to the root element if `selected={true}`. */
2396
+ selected: {},
2397
+
2398
+ /* Styles applied to the icon element. */
2399
+ icon: {
2400
+ fontSize: theme.typography.pxToRem(20),
2401
+ margin: '0 -8px'
2402
+ }
2403
+ };
2404
+ };
2405
+ var PaginationItem = /*#__PURE__*/React$2.forwardRef(function PaginationItem(props, ref) {
2406
+ var classes = props.classes,
2407
+ className = props.className,
2408
+ _props$color = props.color,
2409
+ color = _props$color === void 0 ? 'standard' : _props$color,
2410
+ component = props.component,
2411
+ _props$disabled = props.disabled,
2412
+ disabled = _props$disabled === void 0 ? false : _props$disabled,
2413
+ page = props.page,
2414
+ _props$selected = props.selected,
2415
+ selected = _props$selected === void 0 ? false : _props$selected,
2416
+ _props$shape = props.shape,
2417
+ shape = _props$shape === void 0 ? 'round' : _props$shape,
2418
+ _props$size = props.size,
2419
+ size = _props$size === void 0 ? 'medium' : _props$size,
2420
+ _props$type = props.type,
2421
+ type = _props$type === void 0 ? 'page' : _props$type,
2422
+ _props$variant = props.variant,
2423
+ variant = _props$variant === void 0 ? 'text' : _props$variant,
2424
+ other = _objectWithoutProperties(props, ["classes", "className", "color", "component", "disabled", "page", "selected", "shape", "size", "type", "variant"]);
2425
+
2426
+ var theme = useTheme();
2427
+ var normalizedIcons = theme.direction === 'rtl' ? {
2428
+ previous: NavigateNextIcon,
2429
+ next: NavigateBeforeIcon,
2430
+ last: FirstPageIcon,
2431
+ first: LastPageIcon
2432
+ } : {
2433
+ previous: NavigateBeforeIcon,
2434
+ next: NavigateNextIcon,
2435
+ first: FirstPageIcon,
2436
+ last: LastPageIcon
2437
+ };
2438
+ var Icon = normalizedIcons[type];
2439
+ return type === 'start-ellipsis' || type === 'end-ellipsis' ? /*#__PURE__*/React$2.createElement("div", {
2440
+ ref: ref,
2441
+ className: clsx(classes.root, classes.ellipsis, disabled && classes.disabled, size !== 'medium' && classes["size".concat(capitalize(size))])
2442
+ }, "\u2026") : /*#__PURE__*/React$2.createElement(ButtonBase$1, _extends({
2443
+ ref: ref,
2444
+ component: component,
2445
+ disabled: disabled,
2446
+ focusVisibleClassName: classes.focusVisible,
2447
+ className: clsx(classes.root, classes.page, classes[variant], classes[shape], className, color !== 'standard' && classes["".concat(variant).concat(capitalize(color))], disabled && classes.disabled, selected && classes.selected, size !== 'medium' && classes["size".concat(capitalize(size))])
2448
+ }, other), type === 'page' && page, Icon ? /*#__PURE__*/React$2.createElement(Icon, {
2449
+ className: classes.icon
2450
+ }) : null);
2451
+ });
2452
+ var PaginationItem$1 = withStyles(styles$5, {
2453
+ name: 'MuiPaginationItem'
2454
+ })(PaginationItem);
2455
+
2456
+ var styles$4 = {
2457
+ /* Styles applied to the root element. */
2458
+ root: {},
2459
+
2460
+ /* Styles applied to the ul element. */
2461
+ ul: {
2462
+ display: 'flex',
2463
+ flexWrap: 'wrap',
2464
+ alignItems: 'center',
2465
+ padding: 0,
2466
+ margin: 0,
2467
+ listStyle: 'none'
2468
+ }
2469
+ };
2470
+
2471
+ function defaultGetAriaLabel(type, page, selected) {
2472
+ if (type === 'page') {
2473
+ return "".concat(selected ? '' : 'Go to ', "page ").concat(page);
2474
+ }
2475
+
2476
+ return "Go to ".concat(type, " page");
2477
+ }
2478
+
2479
+ var Pagination$1 = /*#__PURE__*/React$2.forwardRef(function Pagination(props, ref) {
2480
+ props.boundaryCount;
2481
+ var classes = props.classes,
2482
+ className = props.className,
2483
+ _props$color = props.color,
2484
+ color = _props$color === void 0 ? 'standard' : _props$color;
2485
+ props.count;
2486
+ props.defaultPage;
2487
+ props.disabled;
2488
+ var _props$getItemAriaLab = props.getItemAriaLabel,
2489
+ getItemAriaLabel = _props$getItemAriaLab === void 0 ? defaultGetAriaLabel : _props$getItemAriaLab;
2490
+ props.hideNextButton;
2491
+ props.hidePrevButton;
2492
+ props.onChange;
2493
+ props.page;
2494
+ var _props$renderItem = props.renderItem,
2495
+ renderItem = _props$renderItem === void 0 ? function (item) {
2496
+ return /*#__PURE__*/React$2.createElement(PaginationItem$1, item);
2497
+ } : _props$renderItem,
2498
+ _props$shape = props.shape,
2499
+ shape = _props$shape === void 0 ? 'round' : _props$shape;
2500
+ props.showFirstButton;
2501
+ props.showLastButton;
2502
+ props.siblingCount;
2503
+ var _props$size = props.size,
2504
+ size = _props$size === void 0 ? 'medium' : _props$size,
2505
+ _props$variant = props.variant,
2506
+ variant = _props$variant === void 0 ? 'text' : _props$variant,
2507
+ other = _objectWithoutProperties(props, ["boundaryCount", "classes", "className", "color", "count", "defaultPage", "disabled", "getItemAriaLabel", "hideNextButton", "hidePrevButton", "onChange", "page", "renderItem", "shape", "showFirstButton", "showLastButton", "siblingCount", "size", "variant"]);
2508
+
2509
+ var _usePagination = usePagination(_extends({}, props, {
2510
+ componentName: 'Pagination'
2511
+ })),
2512
+ items = _usePagination.items;
2513
+
2514
+ return /*#__PURE__*/React$2.createElement("nav", _extends({
2515
+ "aria-label": "pagination navigation",
2516
+ className: clsx(classes.root, className),
2517
+ ref: ref
2518
+ }, other), /*#__PURE__*/React$2.createElement("ul", {
2519
+ className: classes.ul
2520
+ }, items.map(function (item, index) {
2521
+ return /*#__PURE__*/React$2.createElement("li", {
2522
+ key: index
2523
+ }, renderItem(_extends({}, item, {
2524
+ color: color,
2525
+ 'aria-label': getItemAriaLabel(item.type, item.page, item.selected),
2526
+ shape: shape,
2527
+ size: size,
2528
+ variant: variant
2529
+ })));
2530
+ })));
2531
+ }); // @default tags synced with default values from usePagination
2532
+ var MUIPagination = withStyles(styles$4, {
2533
+ name: 'MuiPagination'
2534
+ })(Pagination$1);
2535
+
2536
+ /**
2537
+ * @ignore - internal component.
2538
+ */
2539
+
2540
+ var NativeSelectInput = /*#__PURE__*/React$2.forwardRef(function NativeSelectInput(props, ref) {
2541
+ var classes = props.classes,
2542
+ className = props.className,
2543
+ disabled = props.disabled,
2544
+ IconComponent = props.IconComponent,
2545
+ inputRef = props.inputRef,
2546
+ _props$variant = props.variant,
2547
+ variant = _props$variant === void 0 ? 'standard' : _props$variant,
2548
+ other = _objectWithoutProperties(props, ["classes", "className", "disabled", "IconComponent", "inputRef", "variant"]);
2549
+
2550
+ return /*#__PURE__*/React$2.createElement(React$2.Fragment, null, /*#__PURE__*/React$2.createElement("select", _extends({
2551
+ className: clsx(classes.root, // TODO v5: merge root and select
2552
+ classes.select, classes[variant], className, disabled && classes.disabled),
2553
+ disabled: disabled,
2554
+ ref: inputRef || ref
2555
+ }, other)), props.multiple ? null : /*#__PURE__*/React$2.createElement(IconComponent, {
2556
+ className: clsx(classes.icon, classes["icon".concat(capitalize(variant))], disabled && classes.disabled)
2557
+ }));
2558
+ });
2559
+
2560
+ function formControlState(_ref) {
2561
+ var props = _ref.props,
2562
+ states = _ref.states,
2563
+ muiFormControl = _ref.muiFormControl;
2564
+ return states.reduce(function (acc, state) {
2565
+ acc[state] = props[state];
2566
+
2567
+ if (muiFormControl) {
2568
+ if (typeof props[state] === 'undefined') {
2569
+ acc[state] = muiFormControl[state];
2570
+ }
2571
+ }
2572
+
2573
+ return acc;
2574
+ }, {});
2575
+ }
2576
+
2577
+ /**
2578
+ * @ignore - internal component.
2579
+ */
2580
+
2581
+ var FormControlContext = React$2.createContext();
2582
+
2583
+ function useFormControl$1() {
2584
+ return React$2.useContext(FormControlContext);
2585
+ }
2586
+
2587
+ function useFormControl() {
2588
+ return React$2.useContext(FormControlContext);
2589
+ }
2590
+
2591
+ /**
2592
+ * @ignore - internal component.
2593
+ */
2594
+
2595
+ var ArrowDropDownIcon = createSvgIcon( /*#__PURE__*/React$2.createElement("path", {
2596
+ d: "M7 10l5 5 5-5z"
2597
+ }));
2598
+
2599
+ function getStyleValue(computedStyle, property) {
2600
+ return parseInt(computedStyle[property], 10) || 0;
2601
+ }
2602
+
2603
+ var useEnhancedEffect$1 = typeof window !== 'undefined' ? React$2.useLayoutEffect : React$2.useEffect;
2604
+ var styles$3 = {
2605
+ /* Styles applied to the shadow textarea element. */
2606
+ shadow: {
2607
+ // Visibility needed to hide the extra text area on iPads
2608
+ visibility: 'hidden',
2609
+ // Remove from the content flow
2610
+ position: 'absolute',
2611
+ // Ignore the scrollbar width
2612
+ overflow: 'hidden',
2613
+ height: 0,
2614
+ top: 0,
2615
+ left: 0,
2616
+ // Create a new layer, increase the isolation of the computed values
2617
+ transform: 'translateZ(0)'
2618
+ }
2619
+ };
2620
+ var TextareaAutosize = /*#__PURE__*/React$2.forwardRef(function TextareaAutosize(props, ref) {
2621
+ var onChange = props.onChange,
2622
+ rows = props.rows,
2623
+ rowsMax = props.rowsMax,
2624
+ rowsMinProp = props.rowsMin,
2625
+ maxRowsProp = props.maxRows,
2626
+ _props$minRows = props.minRows,
2627
+ minRowsProp = _props$minRows === void 0 ? 1 : _props$minRows,
2628
+ style = props.style,
2629
+ value = props.value,
2630
+ other = _objectWithoutProperties(props, ["onChange", "rows", "rowsMax", "rowsMin", "maxRows", "minRows", "style", "value"]);
2631
+
2632
+ var maxRows = maxRowsProp || rowsMax;
2633
+ var minRows = rows || rowsMinProp || minRowsProp;
2634
+
2635
+ var _React$useRef = React$2.useRef(value != null),
2636
+ isControlled = _React$useRef.current;
2637
+
2638
+ var inputRef = React$2.useRef(null);
2639
+ var handleRef = useForkRef(ref, inputRef);
2640
+ var shadowRef = React$2.useRef(null);
2641
+ var renders = React$2.useRef(0);
2642
+
2643
+ var _React$useState = React$2.useState({}),
2644
+ state = _React$useState[0],
2645
+ setState = _React$useState[1];
2646
+
2647
+ var syncHeight = React$2.useCallback(function () {
2648
+ var input = inputRef.current;
2649
+ var computedStyle = window.getComputedStyle(input);
2650
+ var inputShallow = shadowRef.current;
2651
+ inputShallow.style.width = computedStyle.width;
2652
+ inputShallow.value = input.value || props.placeholder || 'x';
2653
+
2654
+ if (inputShallow.value.slice(-1) === '\n') {
2655
+ // Certain fonts which overflow the line height will cause the textarea
2656
+ // to report a different scrollHeight depending on whether the last line
2657
+ // is empty. Make it non-empty to avoid this issue.
2658
+ inputShallow.value += ' ';
2659
+ }
2660
+
2661
+ var boxSizing = computedStyle['box-sizing'];
2662
+ var padding = getStyleValue(computedStyle, 'padding-bottom') + getStyleValue(computedStyle, 'padding-top');
2663
+ var border = getStyleValue(computedStyle, 'border-bottom-width') + getStyleValue(computedStyle, 'border-top-width'); // The height of the inner content
2664
+
2665
+ var innerHeight = inputShallow.scrollHeight - padding; // Measure height of a textarea with a single row
2666
+
2667
+ inputShallow.value = 'x';
2668
+ var singleRowHeight = inputShallow.scrollHeight - padding; // The height of the outer content
2669
+
2670
+ var outerHeight = innerHeight;
2671
+
2672
+ if (minRows) {
2673
+ outerHeight = Math.max(Number(minRows) * singleRowHeight, outerHeight);
2674
+ }
2675
+
2676
+ if (maxRows) {
2677
+ outerHeight = Math.min(Number(maxRows) * singleRowHeight, outerHeight);
2678
+ }
2679
+
2680
+ outerHeight = Math.max(outerHeight, singleRowHeight); // Take the box sizing into account for applying this value as a style.
2681
+
2682
+ var outerHeightStyle = outerHeight + (boxSizing === 'border-box' ? padding + border : 0);
2683
+ var overflow = Math.abs(outerHeight - innerHeight) <= 1;
2684
+ setState(function (prevState) {
2685
+ // Need a large enough difference to update the height.
2686
+ // This prevents infinite rendering loop.
2687
+ if (renders.current < 20 && (outerHeightStyle > 0 && Math.abs((prevState.outerHeightStyle || 0) - outerHeightStyle) > 1 || prevState.overflow !== overflow)) {
2688
+ renders.current += 1;
2689
+ return {
2690
+ overflow: overflow,
2691
+ outerHeightStyle: outerHeightStyle
2692
+ };
2693
+ }
2694
+
2695
+ return prevState;
2696
+ });
2697
+ }, [maxRows, minRows, props.placeholder]);
2698
+ React$2.useEffect(function () {
2699
+ var handleResize = debounce(function () {
2700
+ renders.current = 0;
2701
+ syncHeight();
2702
+ });
2703
+ window.addEventListener('resize', handleResize);
2704
+ return function () {
2705
+ handleResize.clear();
2706
+ window.removeEventListener('resize', handleResize);
2707
+ };
2708
+ }, [syncHeight]);
2709
+ useEnhancedEffect$1(function () {
2710
+ syncHeight();
2711
+ });
2712
+ React$2.useEffect(function () {
2713
+ renders.current = 0;
2714
+ }, [value]);
2715
+
2716
+ var handleChange = function handleChange(event) {
2717
+ renders.current = 0;
2718
+
2719
+ if (!isControlled) {
2720
+ syncHeight();
2721
+ }
2722
+
2723
+ if (onChange) {
2724
+ onChange(event);
2725
+ }
2726
+ };
2727
+
2728
+ return /*#__PURE__*/React$2.createElement(React$2.Fragment, null, /*#__PURE__*/React$2.createElement("textarea", _extends({
2729
+ value: value,
2730
+ onChange: handleChange,
2731
+ ref: handleRef // Apply the rows prop to get a "correct" first SSR paint
2732
+ ,
2733
+ rows: minRows,
2734
+ style: _extends({
2735
+ height: state.outerHeightStyle,
2736
+ // Need a large enough difference to allow scrolling.
2737
+ // This prevents infinite rendering loop.
2738
+ overflow: state.overflow ? 'hidden' : null
2739
+ }, style)
2740
+ }, other)), /*#__PURE__*/React$2.createElement("textarea", {
2741
+ "aria-hidden": true,
2742
+ className: props.className,
2743
+ readOnly: true,
2744
+ ref: shadowRef,
2745
+ tabIndex: -1,
2746
+ style: _extends({}, styles$3.shadow, style)
2747
+ }));
2748
+ });
2749
+
2750
+ // Supports determination of isControlled().
2751
+ // Controlled input accepts its current value as a prop.
2752
+ //
2753
+ // @see https://facebook.github.io/react/docs/forms.html#controlled-components
2754
+ // @param value
2755
+ // @returns {boolean} true if string (including '') or number (including zero)
2756
+ function hasValue(value) {
2757
+ return value != null && !(Array.isArray(value) && value.length === 0);
2758
+ } // Determine if field is empty or filled.
2759
+ // Response determines if label is presented above field or as placeholder.
2760
+ //
2761
+ // @param obj
2762
+ // @param SSR
2763
+ // @returns {boolean} False when not present or empty string.
2764
+ // True when any number or string with length.
2765
+
2766
+ function isFilled(obj) {
2767
+ var SSR = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
2768
+ return obj && (hasValue(obj.value) && obj.value !== '' || SSR && hasValue(obj.defaultValue) && obj.defaultValue !== '');
2769
+ } // Determine if an Input is adorned on start.
2770
+
2771
+ var styles$2 = function styles(theme) {
2772
+ var light = theme.palette.type === 'light';
2773
+ var placeholder = {
2774
+ color: 'currentColor',
2775
+ opacity: light ? 0.42 : 0.5,
2776
+ transition: theme.transitions.create('opacity', {
2777
+ duration: theme.transitions.duration.shorter
2778
+ })
2779
+ };
2780
+ var placeholderHidden = {
2781
+ opacity: '0 !important'
2782
+ };
2783
+ var placeholderVisible = {
2784
+ opacity: light ? 0.42 : 0.5
2785
+ };
2786
+ return {
2787
+ '@global': {
2788
+ '@keyframes mui-auto-fill': {},
2789
+ '@keyframes mui-auto-fill-cancel': {}
2790
+ },
2791
+
2792
+ /* Styles applied to the root element. */
2793
+ root: _extends({}, theme.typography.body1, {
2794
+ color: theme.palette.text.primary,
2795
+ lineHeight: '1.1876em',
2796
+ // Reset (19px), match the native input line-height
2797
+ boxSizing: 'border-box',
2798
+ // Prevent padding issue with fullWidth.
2799
+ position: 'relative',
2800
+ cursor: 'text',
2801
+ display: 'inline-flex',
2802
+ alignItems: 'center',
2803
+ '&$disabled': {
2804
+ color: theme.palette.text.disabled,
2805
+ cursor: 'default'
2806
+ }
2807
+ }),
2808
+
2809
+ /* Styles applied to the root element if the component is a descendant of `FormControl`. */
2810
+ formControl: {},
2811
+
2812
+ /* Styles applied to the root element if the component is focused. */
2813
+ focused: {},
2814
+
2815
+ /* Styles applied to the root element if `disabled={true}`. */
2816
+ disabled: {},
2817
+
2818
+ /* Styles applied to the root element if `startAdornment` is provided. */
2819
+ adornedStart: {},
2820
+
2821
+ /* Styles applied to the root element if `endAdornment` is provided. */
2822
+ adornedEnd: {},
2823
+
2824
+ /* Pseudo-class applied to the root element if `error={true}`. */
2825
+ error: {},
2826
+
2827
+ /* Styles applied to the `input` element if `margin="dense"`. */
2828
+ marginDense: {},
2829
+
2830
+ /* Styles applied to the root element if `multiline={true}`. */
2831
+ multiline: {
2832
+ padding: "".concat(8 - 2, "px 0 ").concat(8 - 1, "px"),
2833
+ '&$marginDense': {
2834
+ paddingTop: 4 - 1
2835
+ }
2836
+ },
2837
+
2838
+ /* Styles applied to the root element if the color is secondary. */
2839
+ colorSecondary: {},
2840
+
2841
+ /* Styles applied to the root element if `fullWidth={true}`. */
2842
+ fullWidth: {
2843
+ width: '100%'
2844
+ },
2845
+
2846
+ /* Styles applied to the `input` element. */
2847
+ input: {
2848
+ font: 'inherit',
2849
+ letterSpacing: 'inherit',
2850
+ color: 'currentColor',
2851
+ padding: "".concat(8 - 2, "px 0 ").concat(8 - 1, "px"),
2852
+ border: 0,
2853
+ boxSizing: 'content-box',
2854
+ background: 'none',
2855
+ height: '1.1876em',
2856
+ // Reset (19px), match the native input line-height
2857
+ margin: 0,
2858
+ // Reset for Safari
2859
+ WebkitTapHighlightColor: 'transparent',
2860
+ display: 'block',
2861
+ // Make the flex item shrink with Firefox
2862
+ minWidth: 0,
2863
+ width: '100%',
2864
+ // Fix IE 11 width issue
2865
+ animationName: 'mui-auto-fill-cancel',
2866
+ animationDuration: '10ms',
2867
+ '&::-webkit-input-placeholder': placeholder,
2868
+ '&::-moz-placeholder': placeholder,
2869
+ // Firefox 19+
2870
+ '&:-ms-input-placeholder': placeholder,
2871
+ // IE 11
2872
+ '&::-ms-input-placeholder': placeholder,
2873
+ // Edge
2874
+ '&:focus': {
2875
+ outline: 0
2876
+ },
2877
+ // Reset Firefox invalid required input style
2878
+ '&:invalid': {
2879
+ boxShadow: 'none'
2880
+ },
2881
+ '&::-webkit-search-decoration': {
2882
+ // Remove the padding when type=search.
2883
+ '-webkit-appearance': 'none'
2884
+ },
2885
+ // Show and hide the placeholder logic
2886
+ 'label[data-shrink=false] + $formControl &': {
2887
+ '&::-webkit-input-placeholder': placeholderHidden,
2888
+ '&::-moz-placeholder': placeholderHidden,
2889
+ // Firefox 19+
2890
+ '&:-ms-input-placeholder': placeholderHidden,
2891
+ // IE 11
2892
+ '&::-ms-input-placeholder': placeholderHidden,
2893
+ // Edge
2894
+ '&:focus::-webkit-input-placeholder': placeholderVisible,
2895
+ '&:focus::-moz-placeholder': placeholderVisible,
2896
+ // Firefox 19+
2897
+ '&:focus:-ms-input-placeholder': placeholderVisible,
2898
+ // IE 11
2899
+ '&:focus::-ms-input-placeholder': placeholderVisible // Edge
2900
+
2901
+ },
2902
+ '&$disabled': {
2903
+ opacity: 1 // Reset iOS opacity
2904
+
2905
+ },
2906
+ '&:-webkit-autofill': {
2907
+ animationDuration: '5000s',
2908
+ animationName: 'mui-auto-fill'
2909
+ }
2910
+ },
2911
+
2912
+ /* Styles applied to the `input` element if `margin="dense"`. */
2913
+ inputMarginDense: {
2914
+ paddingTop: 4 - 1
2915
+ },
2916
+
2917
+ /* Styles applied to the `input` element if `multiline={true}`. */
2918
+ inputMultiline: {
2919
+ height: 'auto',
2920
+ resize: 'none',
2921
+ padding: 0
2922
+ },
2923
+
2924
+ /* Styles applied to the `input` element if `type="search"`. */
2925
+ inputTypeSearch: {
2926
+ // Improve type search style.
2927
+ '-moz-appearance': 'textfield',
2928
+ '-webkit-appearance': 'textfield'
2929
+ },
2930
+
2931
+ /* Styles applied to the `input` element if `startAdornment` is provided. */
2932
+ inputAdornedStart: {},
2933
+
2934
+ /* Styles applied to the `input` element if `endAdornment` is provided. */
2935
+ inputAdornedEnd: {},
2936
+
2937
+ /* Styles applied to the `input` element if `hiddenLabel={true}`. */
2938
+ inputHiddenLabel: {}
2939
+ };
2940
+ };
2941
+ var useEnhancedEffect = typeof window === 'undefined' ? React$2.useEffect : React$2.useLayoutEffect;
2942
+ /**
2943
+ * `InputBase` contains as few styles as possible.
2944
+ * It aims to be a simple building block for creating an input.
2945
+ * It contains a load of style reset and some state logic.
2946
+ */
2947
+
2948
+ var InputBase = /*#__PURE__*/React$2.forwardRef(function InputBase(props, ref) {
2949
+ var ariaDescribedby = props['aria-describedby'],
2950
+ autoComplete = props.autoComplete,
2951
+ autoFocus = props.autoFocus,
2952
+ classes = props.classes,
2953
+ className = props.className;
2954
+ props.color;
2955
+ var defaultValue = props.defaultValue,
2956
+ disabled = props.disabled,
2957
+ endAdornment = props.endAdornment;
2958
+ props.error;
2959
+ var _props$fullWidth = props.fullWidth,
2960
+ fullWidth = _props$fullWidth === void 0 ? false : _props$fullWidth,
2961
+ id = props.id,
2962
+ _props$inputComponent = props.inputComponent,
2963
+ inputComponent = _props$inputComponent === void 0 ? 'input' : _props$inputComponent,
2964
+ _props$inputProps = props.inputProps,
2965
+ inputPropsProp = _props$inputProps === void 0 ? {} : _props$inputProps,
2966
+ inputRefProp = props.inputRef;
2967
+ props.margin;
2968
+ var _props$multiline = props.multiline,
2969
+ multiline = _props$multiline === void 0 ? false : _props$multiline,
2970
+ name = props.name,
2971
+ onBlur = props.onBlur,
2972
+ onChange = props.onChange,
2973
+ onClick = props.onClick,
2974
+ onFocus = props.onFocus,
2975
+ onKeyDown = props.onKeyDown,
2976
+ onKeyUp = props.onKeyUp,
2977
+ placeholder = props.placeholder,
2978
+ readOnly = props.readOnly,
2979
+ renderSuffix = props.renderSuffix,
2980
+ rows = props.rows,
2981
+ rowsMax = props.rowsMax,
2982
+ rowsMin = props.rowsMin,
2983
+ maxRows = props.maxRows,
2984
+ minRows = props.minRows,
2985
+ startAdornment = props.startAdornment,
2986
+ _props$type = props.type,
2987
+ type = _props$type === void 0 ? 'text' : _props$type,
2988
+ valueProp = props.value,
2989
+ other = _objectWithoutProperties(props, ["aria-describedby", "autoComplete", "autoFocus", "classes", "className", "color", "defaultValue", "disabled", "endAdornment", "error", "fullWidth", "id", "inputComponent", "inputProps", "inputRef", "margin", "multiline", "name", "onBlur", "onChange", "onClick", "onFocus", "onKeyDown", "onKeyUp", "placeholder", "readOnly", "renderSuffix", "rows", "rowsMax", "rowsMin", "maxRows", "minRows", "startAdornment", "type", "value"]);
2990
+
2991
+ var value = inputPropsProp.value != null ? inputPropsProp.value : valueProp;
2992
+
2993
+ var _React$useRef = React$2.useRef(value != null),
2994
+ isControlled = _React$useRef.current;
2995
+
2996
+ var inputRef = React$2.useRef();
2997
+ var handleInputRefWarning = React$2.useCallback(function (instance) {
2998
+ }, []);
2999
+ var handleInputPropsRefProp = useForkRef(inputPropsProp.ref, handleInputRefWarning);
3000
+ var handleInputRefProp = useForkRef(inputRefProp, handleInputPropsRefProp);
3001
+ var handleInputRef = useForkRef(inputRef, handleInputRefProp);
3002
+
3003
+ var _React$useState = React$2.useState(false),
3004
+ focused = _React$useState[0],
3005
+ setFocused = _React$useState[1];
3006
+
3007
+ var muiFormControl = useFormControl$1();
3008
+
3009
+ var fcs = formControlState({
3010
+ props: props,
3011
+ muiFormControl: muiFormControl,
3012
+ states: ['color', 'disabled', 'error', 'hiddenLabel', 'margin', 'required', 'filled']
3013
+ });
3014
+ fcs.focused = muiFormControl ? muiFormControl.focused : focused; // The blur won't fire when the disabled state is set on a focused input.
3015
+ // We need to book keep the focused state manually.
3016
+
3017
+ React$2.useEffect(function () {
3018
+ if (!muiFormControl && disabled && focused) {
3019
+ setFocused(false);
3020
+
3021
+ if (onBlur) {
3022
+ onBlur();
3023
+ }
3024
+ }
3025
+ }, [muiFormControl, disabled, focused, onBlur]);
3026
+ var onFilled = muiFormControl && muiFormControl.onFilled;
3027
+ var onEmpty = muiFormControl && muiFormControl.onEmpty;
3028
+ var checkDirty = React$2.useCallback(function (obj) {
3029
+ if (isFilled(obj)) {
3030
+ if (onFilled) {
3031
+ onFilled();
3032
+ }
3033
+ } else if (onEmpty) {
3034
+ onEmpty();
3035
+ }
3036
+ }, [onFilled, onEmpty]);
3037
+ useEnhancedEffect(function () {
3038
+ if (isControlled) {
3039
+ checkDirty({
3040
+ value: value
3041
+ });
3042
+ }
3043
+ }, [value, checkDirty, isControlled]);
3044
+
3045
+ var handleFocus = function handleFocus(event) {
3046
+ // Fix a bug with IE 11 where the focus/blur events are triggered
3047
+ // while the input is disabled.
3048
+ if (fcs.disabled) {
3049
+ event.stopPropagation();
3050
+ return;
3051
+ }
3052
+
3053
+ if (onFocus) {
3054
+ onFocus(event);
3055
+ }
3056
+
3057
+ if (inputPropsProp.onFocus) {
3058
+ inputPropsProp.onFocus(event);
3059
+ }
3060
+
3061
+ if (muiFormControl && muiFormControl.onFocus) {
3062
+ muiFormControl.onFocus(event);
3063
+ } else {
3064
+ setFocused(true);
3065
+ }
3066
+ };
3067
+
3068
+ var handleBlur = function handleBlur(event) {
3069
+ if (onBlur) {
3070
+ onBlur(event);
3071
+ }
3072
+
3073
+ if (inputPropsProp.onBlur) {
3074
+ inputPropsProp.onBlur(event);
3075
+ }
3076
+
3077
+ if (muiFormControl && muiFormControl.onBlur) {
3078
+ muiFormControl.onBlur(event);
3079
+ } else {
3080
+ setFocused(false);
3081
+ }
3082
+ };
3083
+
3084
+ var handleChange = function handleChange(event) {
3085
+ if (!isControlled) {
3086
+ var element = event.target || inputRef.current;
3087
+
3088
+ if (element == null) {
3089
+ throw new Error(formatMuiErrorMessage(1));
3090
+ }
3091
+
3092
+ checkDirty({
3093
+ value: element.value
3094
+ });
3095
+ }
3096
+
3097
+ for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
3098
+ args[_key - 1] = arguments[_key];
3099
+ }
3100
+
3101
+ if (inputPropsProp.onChange) {
3102
+ inputPropsProp.onChange.apply(inputPropsProp, [event].concat(args));
3103
+ } // Perform in the willUpdate
3104
+
3105
+
3106
+ if (onChange) {
3107
+ onChange.apply(void 0, [event].concat(args));
3108
+ }
3109
+ }; // Check the input state on mount, in case it was filled by the user
3110
+ // or auto filled by the browser before the hydration (for SSR).
3111
+
3112
+
3113
+ React$2.useEffect(function () {
3114
+ checkDirty(inputRef.current);
3115
+ }, []); // eslint-disable-line react-hooks/exhaustive-deps
3116
+
3117
+ var handleClick = function handleClick(event) {
3118
+ if (inputRef.current && event.currentTarget === event.target) {
3119
+ inputRef.current.focus();
3120
+ }
3121
+
3122
+ if (onClick) {
3123
+ onClick(event);
3124
+ }
3125
+ };
3126
+
3127
+ var InputComponent = inputComponent;
3128
+
3129
+ var inputProps = _extends({}, inputPropsProp, {
3130
+ ref: handleInputRef
3131
+ });
3132
+
3133
+ if (typeof InputComponent !== 'string') {
3134
+ inputProps = _extends({
3135
+ // Rename ref to inputRef as we don't know the
3136
+ // provided `inputComponent` structure.
3137
+ inputRef: handleInputRef,
3138
+ type: type
3139
+ }, inputProps, {
3140
+ ref: null
3141
+ });
3142
+ } else if (multiline) {
3143
+ if (rows && !maxRows && !minRows && !rowsMax && !rowsMin) {
3144
+ InputComponent = 'textarea';
3145
+ } else {
3146
+ inputProps = _extends({
3147
+ minRows: rows || minRows,
3148
+ rowsMax: rowsMax,
3149
+ maxRows: maxRows
3150
+ }, inputProps);
3151
+ InputComponent = TextareaAutosize;
3152
+ }
3153
+ } else {
3154
+ inputProps = _extends({
3155
+ type: type
3156
+ }, inputProps);
3157
+ }
3158
+
3159
+ var handleAutoFill = function handleAutoFill(event) {
3160
+ // Provide a fake value as Chrome might not let you access it for security reasons.
3161
+ checkDirty(event.animationName === 'mui-auto-fill-cancel' ? inputRef.current : {
3162
+ value: 'x'
3163
+ });
3164
+ };
3165
+
3166
+ React$2.useEffect(function () {
3167
+ if (muiFormControl) {
3168
+ muiFormControl.setAdornedStart(Boolean(startAdornment));
3169
+ }
3170
+ }, [muiFormControl, startAdornment]);
3171
+ return /*#__PURE__*/React$2.createElement("div", _extends({
3172
+ className: clsx(classes.root, classes["color".concat(capitalize(fcs.color || 'primary'))], className, fcs.disabled && classes.disabled, fcs.error && classes.error, fullWidth && classes.fullWidth, fcs.focused && classes.focused, muiFormControl && classes.formControl, multiline && classes.multiline, startAdornment && classes.adornedStart, endAdornment && classes.adornedEnd, fcs.margin === 'dense' && classes.marginDense),
3173
+ onClick: handleClick,
3174
+ ref: ref
3175
+ }, other), startAdornment, /*#__PURE__*/React$2.createElement(FormControlContext.Provider, {
3176
+ value: null
3177
+ }, /*#__PURE__*/React$2.createElement(InputComponent, _extends({
3178
+ "aria-invalid": fcs.error,
3179
+ "aria-describedby": ariaDescribedby,
3180
+ autoComplete: autoComplete,
3181
+ autoFocus: autoFocus,
3182
+ defaultValue: defaultValue,
3183
+ disabled: fcs.disabled,
3184
+ id: id,
3185
+ onAnimationStart: handleAutoFill,
3186
+ name: name,
3187
+ placeholder: placeholder,
3188
+ readOnly: readOnly,
3189
+ required: fcs.required,
3190
+ rows: rows,
3191
+ value: value,
3192
+ onKeyDown: onKeyDown,
3193
+ onKeyUp: onKeyUp
3194
+ }, inputProps, {
3195
+ className: clsx(classes.input, inputPropsProp.className, fcs.disabled && classes.disabled, multiline && classes.inputMultiline, fcs.hiddenLabel && classes.inputHiddenLabel, startAdornment && classes.inputAdornedStart, endAdornment && classes.inputAdornedEnd, type === 'search' && classes.inputTypeSearch, fcs.margin === 'dense' && classes.inputMarginDense),
3196
+ onBlur: handleBlur,
3197
+ onChange: handleChange,
3198
+ onFocus: handleFocus
3199
+ }))), endAdornment, renderSuffix ? renderSuffix(_extends({}, fcs, {
3200
+ startAdornment: startAdornment
3201
+ })) : null);
3202
+ });
3203
+ var InputBase$1 = withStyles(styles$2, {
3204
+ name: 'MuiInputBase'
3205
+ })(InputBase);
3206
+
3207
+ var styles$1 = function styles(theme) {
3208
+ var light = theme.palette.type === 'light';
3209
+ var bottomLineColor = light ? 'rgba(0, 0, 0, 0.42)' : 'rgba(255, 255, 255, 0.7)';
3210
+ return {
3211
+ /* Styles applied to the root element. */
3212
+ root: {
3213
+ position: 'relative'
3214
+ },
3215
+
3216
+ /* Styles applied to the root element if the component is a descendant of `FormControl`. */
3217
+ formControl: {
3218
+ 'label + &': {
3219
+ marginTop: 16
3220
+ }
3221
+ },
3222
+
3223
+ /* Styles applied to the root element if the component is focused. */
3224
+ focused: {},
3225
+
3226
+ /* Styles applied to the root element if `disabled={true}`. */
3227
+ disabled: {},
3228
+
3229
+ /* Styles applied to the root element if color secondary. */
3230
+ colorSecondary: {
3231
+ '&$underline:after': {
3232
+ borderBottomColor: theme.palette.secondary.main
3233
+ }
3234
+ },
3235
+
3236
+ /* Styles applied to the root element if `disableUnderline={false}`. */
3237
+ underline: {
3238
+ '&:after': {
3239
+ borderBottom: "2px solid ".concat(theme.palette.primary.main),
3240
+ left: 0,
3241
+ bottom: 0,
3242
+ // Doing the other way around crash on IE 11 "''" https://github.com/cssinjs/jss/issues/242
3243
+ content: '""',
3244
+ position: 'absolute',
3245
+ right: 0,
3246
+ transform: 'scaleX(0)',
3247
+ transition: theme.transitions.create('transform', {
3248
+ duration: theme.transitions.duration.shorter,
3249
+ easing: theme.transitions.easing.easeOut
3250
+ }),
3251
+ pointerEvents: 'none' // Transparent to the hover style.
3252
+
3253
+ },
3254
+ '&$focused:after': {
3255
+ transform: 'scaleX(1)'
3256
+ },
3257
+ '&$error:after': {
3258
+ borderBottomColor: theme.palette.error.main,
3259
+ transform: 'scaleX(1)' // error is always underlined in red
3260
+
3261
+ },
3262
+ '&:before': {
3263
+ borderBottom: "1px solid ".concat(bottomLineColor),
3264
+ left: 0,
3265
+ bottom: 0,
3266
+ // Doing the other way around crash on IE 11 "''" https://github.com/cssinjs/jss/issues/242
3267
+ content: '"\\00a0"',
3268
+ position: 'absolute',
3269
+ right: 0,
3270
+ transition: theme.transitions.create('border-bottom-color', {
3271
+ duration: theme.transitions.duration.shorter
3272
+ }),
3273
+ pointerEvents: 'none' // Transparent to the hover style.
3274
+
3275
+ },
3276
+ '&:hover:not($disabled):before': {
3277
+ borderBottom: "2px solid ".concat(theme.palette.text.primary),
3278
+ // Reset on touch devices, it doesn't add specificity
3279
+ '@media (hover: none)': {
3280
+ borderBottom: "1px solid ".concat(bottomLineColor)
3281
+ }
3282
+ },
3283
+ '&$disabled:before': {
3284
+ borderBottomStyle: 'dotted'
3285
+ }
3286
+ },
3287
+
3288
+ /* Pseudo-class applied to the root element if `error={true}`. */
3289
+ error: {},
3290
+
3291
+ /* Styles applied to the `input` element if `margin="dense"`. */
3292
+ marginDense: {},
3293
+
3294
+ /* Styles applied to the root element if `multiline={true}`. */
3295
+ multiline: {},
3296
+
3297
+ /* Styles applied to the root element if `fullWidth={true}`. */
3298
+ fullWidth: {},
3299
+
3300
+ /* Styles applied to the `input` element. */
3301
+ input: {},
3302
+
3303
+ /* Styles applied to the `input` element if `margin="dense"`. */
3304
+ inputMarginDense: {},
3305
+
3306
+ /* Styles applied to the `input` element if `multiline={true}`. */
3307
+ inputMultiline: {},
3308
+
3309
+ /* Styles applied to the `input` element if `type="search"`. */
3310
+ inputTypeSearch: {}
3311
+ };
3312
+ };
3313
+ var Input = /*#__PURE__*/React$2.forwardRef(function Input(props, ref) {
3314
+ var disableUnderline = props.disableUnderline,
3315
+ classes = props.classes,
3316
+ _props$fullWidth = props.fullWidth,
3317
+ fullWidth = _props$fullWidth === void 0 ? false : _props$fullWidth,
3318
+ _props$inputComponent = props.inputComponent,
3319
+ inputComponent = _props$inputComponent === void 0 ? 'input' : _props$inputComponent,
3320
+ _props$multiline = props.multiline,
3321
+ multiline = _props$multiline === void 0 ? false : _props$multiline,
3322
+ _props$type = props.type,
3323
+ type = _props$type === void 0 ? 'text' : _props$type,
3324
+ other = _objectWithoutProperties(props, ["disableUnderline", "classes", "fullWidth", "inputComponent", "multiline", "type"]);
3325
+
3326
+ return /*#__PURE__*/React$2.createElement(InputBase$1, _extends({
3327
+ classes: _extends({}, classes, {
3328
+ root: clsx(classes.root, !disableUnderline && classes.underline),
3329
+ underline: null
3330
+ }),
3331
+ fullWidth: fullWidth,
3332
+ inputComponent: inputComponent,
3333
+ multiline: multiline,
3334
+ ref: ref,
3335
+ type: type
3336
+ }, other));
3337
+ });
3338
+ Input.muiName = 'Input';
3339
+ var Input$1 = withStyles(styles$1, {
3340
+ name: 'MuiInput'
3341
+ })(Input);
3342
+
3343
+ var styles = function styles(theme) {
3344
+ return {
3345
+ /* Styles applied to the select component `root` class. */
3346
+ root: {},
3347
+
3348
+ /* Styles applied to the select component `select` class. */
3349
+ select: {
3350
+ '-moz-appearance': 'none',
3351
+ // Reset
3352
+ '-webkit-appearance': 'none',
3353
+ // Reset
3354
+ // When interacting quickly, the text can end up selected.
3355
+ // Native select can't be selected either.
3356
+ userSelect: 'none',
3357
+ borderRadius: 0,
3358
+ // Reset
3359
+ minWidth: 16,
3360
+ // So it doesn't collapse.
3361
+ cursor: 'pointer',
3362
+ '&:focus': {
3363
+ // Show that it's not an text input
3364
+ backgroundColor: theme.palette.type === 'light' ? 'rgba(0, 0, 0, 0.05)' : 'rgba(255, 255, 255, 0.05)',
3365
+ borderRadius: 0 // Reset Chrome style
3366
+
3367
+ },
3368
+ // Remove IE 11 arrow
3369
+ '&::-ms-expand': {
3370
+ display: 'none'
3371
+ },
3372
+ '&$disabled': {
3373
+ cursor: 'default'
3374
+ },
3375
+ '&[multiple]': {
3376
+ height: 'auto'
3377
+ },
3378
+ '&:not([multiple]) option, &:not([multiple]) optgroup': {
3379
+ backgroundColor: theme.palette.background.paper
3380
+ },
3381
+ '&&': {
3382
+ paddingRight: 24
3383
+ }
3384
+ },
3385
+
3386
+ /* Styles applied to the select component if `variant="filled"`. */
3387
+ filled: {
3388
+ '&&': {
3389
+ paddingRight: 32
3390
+ }
3391
+ },
3392
+
3393
+ /* Styles applied to the select component if `variant="outlined"`. */
3394
+ outlined: {
3395
+ borderRadius: theme.shape.borderRadius,
3396
+ '&&': {
3397
+ paddingRight: 32
3398
+ }
3399
+ },
3400
+
3401
+ /* Styles applied to the select component `selectMenu` class. */
3402
+ selectMenu: {
3403
+ height: 'auto',
3404
+ // Resets for multpile select with chips
3405
+ minHeight: '1.1876em',
3406
+ // Required for select\text-field height consistency
3407
+ textOverflow: 'ellipsis',
3408
+ whiteSpace: 'nowrap',
3409
+ overflow: 'hidden'
3410
+ },
3411
+
3412
+ /* Pseudo-class applied to the select component `disabled` class. */
3413
+ disabled: {},
3414
+
3415
+ /* Styles applied to the icon component. */
3416
+ icon: {
3417
+ // We use a position absolute over a flexbox in order to forward the pointer events
3418
+ // to the input and to support wrapping tags..
3419
+ position: 'absolute',
3420
+ right: 0,
3421
+ top: 'calc(50% - 12px)',
3422
+ // Center vertically
3423
+ pointerEvents: 'none',
3424
+ // Don't block pointer events on the select under the icon.
3425
+ color: theme.palette.action.active,
3426
+ '&$disabled': {
3427
+ color: theme.palette.action.disabled
3428
+ }
3429
+ },
3430
+
3431
+ /* Styles applied to the icon component if the popup is open. */
3432
+ iconOpen: {
3433
+ transform: 'rotate(180deg)'
3434
+ },
3435
+
3436
+ /* Styles applied to the icon component if `variant="filled"`. */
3437
+ iconFilled: {
3438
+ right: 7
3439
+ },
3440
+
3441
+ /* Styles applied to the icon component if `variant="outlined"`. */
3442
+ iconOutlined: {
3443
+ right: 7
3444
+ },
3445
+
3446
+ /* Styles applied to the underlying native input component. */
3447
+ nativeInput: {
3448
+ bottom: 0,
3449
+ left: 0,
3450
+ position: 'absolute',
3451
+ opacity: 0,
3452
+ pointerEvents: 'none',
3453
+ width: '100%'
3454
+ }
3455
+ };
3456
+ };
3457
+ var defaultInput = /*#__PURE__*/React$2.createElement(Input$1, null);
3458
+ /**
3459
+ * An alternative to `<Select native />` with a much smaller bundle size footprint.
3460
+ */
3461
+
3462
+ var NativeSelect = /*#__PURE__*/React$2.forwardRef(function NativeSelect(props, ref) {
3463
+ var children = props.children,
3464
+ classes = props.classes,
3465
+ _props$IconComponent = props.IconComponent,
3466
+ IconComponent = _props$IconComponent === void 0 ? ArrowDropDownIcon : _props$IconComponent,
3467
+ _props$input = props.input,
3468
+ input = _props$input === void 0 ? defaultInput : _props$input,
3469
+ inputProps = props.inputProps;
3470
+ props.variant;
3471
+ var other = _objectWithoutProperties(props, ["children", "classes", "IconComponent", "input", "inputProps", "variant"]);
3472
+
3473
+ var muiFormControl = useFormControl();
3474
+ var fcs = formControlState({
3475
+ props: props,
3476
+ muiFormControl: muiFormControl,
3477
+ states: ['variant']
3478
+ });
3479
+ return /*#__PURE__*/React$2.cloneElement(input, _extends({
3480
+ // Most of the logic is implemented in `NativeSelectInput`.
3481
+ // The `Select` component is a simple API wrapper to expose something better to play with.
3482
+ inputComponent: NativeSelectInput,
3483
+ inputProps: _extends({
3484
+ children: children,
3485
+ classes: classes,
3486
+ IconComponent: IconComponent,
3487
+ variant: fcs.variant,
3488
+ type: undefined
3489
+ }, inputProps, input ? input.props.inputProps : {}),
3490
+ ref: ref
3491
+ }, other));
3492
+ });
3493
+ NativeSelect.muiName = 'Select';
3494
+ var NativeSelect$1 = withStyles(styles, {
3495
+ name: 'MuiNativeSelect'
3496
+ })(NativeSelect);
3497
+
3498
+ var ArrowLeft = {};
3499
+
3500
+ var _interopRequireDefault$1 = interopRequireDefault.exports;
3501
+
3502
+ var _interopRequireWildcard$1 = interopRequireWildcard.exports;
3503
+
3504
+ Object.defineProperty(ArrowLeft, "__esModule", {
3505
+ value: true
3506
+ });
3507
+ var default_1$1 = ArrowLeft.default = void 0;
3508
+
3509
+ var React$1 = _interopRequireWildcard$1(React__default);
3510
+
3511
+ var _createSvgIcon$1 = _interopRequireDefault$1(requireCreateSvgIcon());
3512
+
3513
+ var _default$1 = (0, _createSvgIcon$1.default)( /*#__PURE__*/React$1.createElement("path", {
3514
+ d: "M14 7l-5 5 5 5V7z"
3515
+ }), 'ArrowLeft');
3516
+
3517
+ default_1$1 = ArrowLeft.default = _default$1;
3518
+
3519
+ var ArrowRight = {};
3520
+
3521
+ var _interopRequireDefault = interopRequireDefault.exports;
3522
+
3523
+ var _interopRequireWildcard = interopRequireWildcard.exports;
3524
+
3525
+ Object.defineProperty(ArrowRight, "__esModule", {
3526
+ value: true
3527
+ });
3528
+ var default_1 = ArrowRight.default = void 0;
3529
+
3530
+ var React = _interopRequireWildcard(React__default);
3531
+
3532
+ var _createSvgIcon = _interopRequireDefault(requireCreateSvgIcon());
3533
+
3534
+ var _default = (0, _createSvgIcon.default)( /*#__PURE__*/React.createElement("path", {
3535
+ d: "M10 17l5-5-5-5v10z"
3536
+ }), 'ArrowRight');
3537
+
3538
+ default_1 = ArrowRight.default = _default;
3539
+
3540
+ var css_248z = ".ntml-pagination__center {\n display: flex;\n justify-content: center; }\n .ntml-pagination__center .MuiSvgIcon-colorSecondary {\n color: #509891; }\n\n.ntml-pagination .MuiPaginationItem-root {\n font-size: 1.5rem; }\n\n.ntml-pagination .MuiNativeSelect-select.MuiNativeSelect-select {\n font-size: 1.5rem; }\n\n.ntml-pagination__rightSide {\n position: relative;\n float: right;\n top: -36px; }\n .ntml-pagination__rightSide-showTotal {\n display: flex;\n align-items: center;\n font-size: 1.5rem; }\n .ntml-pagination__rightSide-showTotal .MuiInput-root {\n width: 90px;\n height: 34px;\n margin: 0 8px;\n padding: 2px 8px 3px 20px;\n border-radius: 17px;\n background-color: rgba(222, 219, 202, 0.4);\n border: 0px; }\n .ntml-pagination__rightSide-showTotal .MuiNativeSelect-icon {\n color: #509891; }\n .ntml-pagination__rightSide-showTotal .MuiNativeSelect-select:not([multiple]) option,\n .ntml-pagination__rightSide-showTotal .MuiNativeSelect-select:not([multiple]) optgroup {\n background-color: rgba(222, 219, 202, 0.4); }\n\n@media only screen and (max-width: 1200px) {\n .ntml-pagination__center-page {\n width: 48px;\n height: 48px;\n display: flex;\n background-color: rgba(222, 219, 202, 0.4);\n border-radius: 50%;\n align-items: center;\n justify-content: center; }\n .ntml-pagination__rightSide {\n position: relative;\n float: initial;\n top: 0;\n display: flex;\n justify-content: center;\n margin-top: 28px; } }\n";
3541
+ styleInject(css_248z);
3542
+
3543
+ var _excluded = ["className", "pageSize", "total", "onChange"];
3544
+ var Pagination = function Pagination(_ref) {
3545
+ var className = _ref.className,
3546
+ pageSize = _ref.pageSize,
3547
+ total = _ref.total,
3548
+ _onChange = _ref.onChange,
3549
+ props = _objectWithoutProperties$1(_ref, _excluded);
3550
+ var count = Math.ceil(total / pageSize);
3551
+ var pages = Array.from(Array(count).keys(), function (x) {
3552
+ return x + 1;
3553
+ });
3554
+
3555
+ // eslint-disable-next-line react/destructuring-assignment
3556
+ var current = Number.parseInt(props.current, 10) || 1;
3557
+ // eslint-disable-next-line react/destructuring-assignment
3558
+ var defaultCurrent = Number.parseInt(props.defaultCurrent, 10) || 1;
3559
+ var handlePageSelected = function handlePageSelected(event) {
3560
+ var page = Number.parseInt(event.target.value, 10);
3561
+ _onChange(page);
3562
+ };
3563
+ return /*#__PURE__*/React__default.createElement("div", {
3564
+ className: classNames('ntml-pagination', className)
3565
+ }, /*#__PURE__*/React__default.createElement("div", {
3566
+ className: "ntml-pagination__center"
3567
+ }, /*#__PURE__*/React__default.createElement("div", {
3568
+ style: {
3569
+ display: 'flex',
3570
+ alignItems: 'center'
3571
+ }
3572
+ }, /*#__PURE__*/React__default.createElement(IconButton, {
3573
+ disabled: current === 1,
3574
+ onClick: function onClick() {
3575
+ return _onChange(current - 1);
3576
+ }
3577
+ }, /*#__PURE__*/React__default.createElement(default_1$1, {
3578
+ color: "secondary"
3579
+ })), /*#__PURE__*/React__default.createElement(MUIPagination, {
3580
+ color: "secondary",
3581
+ count: count,
3582
+ boundaryCount: 1,
3583
+ siblingCount: 0,
3584
+ page: current,
3585
+ defaultPage: defaultCurrent,
3586
+ hideNextButton: true,
3587
+ hidePrevButton: true,
3588
+ onChange: function onChange(event, value) {
3589
+ return _onChange(value);
3590
+ }
3591
+ }), /*#__PURE__*/React__default.createElement(IconButton, {
3592
+ disabled: current === count,
3593
+ onClick: function onClick() {
3594
+ return _onChange(current + 1);
3595
+ }
3596
+ }, /*#__PURE__*/React__default.createElement(default_1, {
3597
+ color: "secondary"
3598
+ })))), /*#__PURE__*/React__default.createElement("div", {
3599
+ className: "ntml-pagination__rightSide"
3600
+ }, /*#__PURE__*/React__default.createElement("div", {
3601
+ className: "ntml-pagination__rightSide-showTotal"
3602
+ }, /*#__PURE__*/React__default.createElement("span", null, "\u76EE\u524D\u5728\u7B2C"), /*#__PURE__*/React__default.createElement(NativeSelect$1, {
3603
+ value: current,
3604
+ onChange: handlePageSelected
3605
+ }, pages.map(function (page, idx) {
3606
+ return /*#__PURE__*/React__default.createElement("option", {
3607
+ value: page,
3608
+ key: idx.toString()
3609
+ }, page);
3610
+ })), /*#__PURE__*/React__default.createElement("span", null, "\u9801\uFF0C\u5171"), count, /*#__PURE__*/React__default.createElement("span", null, "\u9801"))));
3611
+ };
3612
+ Pagination.defaultProps = {
3613
+ className: undefined,
3614
+ current: undefined,
3615
+ defaultCurrent: 1,
3616
+ pageSize: 10,
3617
+ total: undefined,
3618
+ onChange: undefined
3619
+ };
3620
+
3621
+ /* Write props detail information and 'npm run updateStory' will help you generate stories's argTypes */
3622
+ Pagination.propTypes = {
3623
+ /** Css Name */
3624
+ className: PropTypes.string,
3625
+ /** 当前页数 */
3626
+ current: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
3627
+ /** 默认的当前页数 */
3628
+ defaultCurrent: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
3629
+ /** 每页条数 */
3630
+ pageSize: PropTypes.number,
3631
+ /** 数据总数 */
3632
+ total: PropTypes.number,
3633
+ /** 页码或 pageSize 改变的回调,参数是改变后的页码及每页条数 */
3634
+ onChange: PropTypes.func
3635
+ };
3636
+
3637
+ export { Pagination as default };