@popmenu/common-ui 0.17.0 → 0.18.3-alpha.0

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 (188) hide show
  1. package/build/components/AudioPlayer/util/index.d.ts +0 -1
  2. package/build/components/AudioPlayer/util/setupAudioRef.d.ts +1 -1
  3. package/build/components/AudioPlayer/util/types.d.ts +6 -3
  4. package/build/components/Box/index.d.ts +7 -2
  5. package/build/components/Table/TableProps.d.ts +2 -0
  6. package/build/esm/components/Accordion/index.d.ts +1 -0
  7. package/build/esm/components/AccordionActions/index.d.ts +1 -0
  8. package/build/esm/components/AccordionDetails/index.d.ts +1 -0
  9. package/build/esm/components/AccordionSummary/index.d.ts +1 -0
  10. package/build/esm/components/Alert/index.d.ts +1 -0
  11. package/build/esm/components/AppBar/index.d.ts +1 -0
  12. package/build/esm/components/AudioPlayer/AudioPlayer.d.ts +3 -0
  13. package/build/esm/components/AudioPlayer/AudioPlayerProps.d.ts +4 -0
  14. package/build/esm/components/AudioPlayer/index.d.ts +2 -0
  15. package/build/esm/components/AudioPlayer/util/audioPlayerReducer.d.ts +11 -0
  16. package/build/esm/components/AudioPlayer/util/formatTime.d.ts +1 -0
  17. package/build/esm/components/AudioPlayer/util/index.d.ts +5 -0
  18. package/build/esm/components/AudioPlayer/util/setupAudioRef.d.ts +8 -0
  19. package/build/esm/components/AudioPlayer/util/types.d.ts +77 -0
  20. package/build/esm/components/AudioPlayer/util/useVolumeIcon.d.ts +2 -0
  21. package/build/esm/components/Avatar/Avatar.d.ts +3 -0
  22. package/build/esm/components/Avatar/AvatarProps.d.ts +15 -0
  23. package/build/esm/components/Avatar/avatar.styles.d.ts +2 -0
  24. package/build/esm/components/Avatar/index.d.ts +2 -0
  25. package/build/esm/components/Avatar/util/useImageProps.d.ts +15 -0
  26. package/build/esm/components/Badge/index.d.ts +1 -0
  27. package/build/esm/components/Box/Box.d.ts +3 -0
  28. package/build/esm/components/Box/BoxProps.d.ts +5 -0
  29. package/build/esm/components/Box/BoxStyles.d.ts +1 -0
  30. package/build/esm/components/Box/index.d.ts +7 -0
  31. package/build/esm/components/Breadcrumbs/index.d.ts +1 -0
  32. package/build/esm/components/Button/Button.d.ts +3 -0
  33. package/build/esm/components/Button/ButtonProps.d.ts +6 -0
  34. package/build/esm/components/Button/ButtonStyles.d.ts +2 -0
  35. package/build/esm/components/Button/index.d.ts +2 -0
  36. package/build/esm/components/ButtonBase/index.d.ts +1 -0
  37. package/build/esm/components/ButtonGroup/index.d.ts +1 -0
  38. package/build/esm/components/Card/index.d.ts +1 -0
  39. package/build/esm/components/CardActionArea/index.d.ts +1 -0
  40. package/build/esm/components/CardActions/index.d.ts +1 -0
  41. package/build/esm/components/CardContent/index.d.ts +1 -0
  42. package/build/esm/components/CardHeader/index.d.ts +1 -0
  43. package/build/esm/components/CardMedia/index.d.ts +1 -0
  44. package/build/esm/components/Checkbox/Checkbox.d.ts +3 -0
  45. package/build/esm/components/Checkbox/CheckboxProps.d.ts +8 -0
  46. package/build/esm/components/Checkbox/index.d.ts +2 -0
  47. package/build/esm/components/Chip/index.d.ts +1 -0
  48. package/build/esm/components/CircularProgress/index.d.ts +1 -0
  49. package/build/esm/components/ClickAwayListener/index.d.ts +1 -0
  50. package/build/esm/components/CollapsibleText/CollapsibleText.d.ts +3 -0
  51. package/build/esm/components/CollapsibleText/CollapsibleTextProps.d.ts +12 -0
  52. package/build/esm/components/CollapsibleText/CollapsibleTextStyles.d.ts +4 -0
  53. package/build/esm/components/CollapsibleText/index.d.ts +2 -0
  54. package/build/esm/components/Dialog/index.d.ts +1 -0
  55. package/build/esm/components/DialogActions/index.d.ts +1 -0
  56. package/build/esm/components/DialogContent/index.d.ts +1 -0
  57. package/build/esm/components/DialogContentText/index.d.ts +1 -0
  58. package/build/esm/components/DialogTitle/index.d.ts +1 -0
  59. package/build/esm/components/Divider/Divider.d.ts +3 -0
  60. package/build/esm/components/Divider/DividerProps.d.ts +17 -0
  61. package/build/esm/components/Divider/index.d.ts +2 -0
  62. package/build/esm/components/Drawer/index.d.ts +1 -0
  63. package/build/esm/components/Fab/index.d.ts +1 -0
  64. package/build/esm/components/FormControl/index.d.ts +1 -0
  65. package/build/esm/components/FormControlLabel/index.d.ts +1 -0
  66. package/build/esm/components/FormLabel/index.d.ts +1 -0
  67. package/build/esm/components/Grid/index.d.ts +1 -0
  68. package/build/esm/components/GridList/index.d.ts +1 -0
  69. package/build/esm/components/Hidden/index.d.ts +1 -0
  70. package/build/esm/components/Icon/Icon.d.ts +4 -0
  71. package/build/esm/components/Icon/IconProps.d.ts +11 -0
  72. package/build/esm/components/Icon/IconStyles.d.ts +2 -0
  73. package/build/esm/components/Icon/index.d.ts +2 -0
  74. package/build/esm/components/IconButton/IconButton.d.ts +3 -0
  75. package/build/esm/components/IconButton/IconButtonProps.d.ts +2 -0
  76. package/build/esm/components/IconButton/index.d.ts +2 -0
  77. package/build/esm/components/InputAdornment/index.d.ts +1 -0
  78. package/build/esm/components/LinearProgress/index.d.ts +1 -0
  79. package/build/esm/components/Link/Link.d.ts +3 -0
  80. package/build/esm/components/Link/LinkProps.d.ts +4 -0
  81. package/build/esm/components/Link/index.d.ts +2 -0
  82. package/build/esm/components/Link/link.styles.d.ts +2 -0
  83. package/build/esm/components/List/index.d.ts +1 -0
  84. package/build/esm/components/ListItem/index.d.ts +1 -0
  85. package/build/esm/components/ListItemIcon/index.d.ts +1 -0
  86. package/build/esm/components/ListItemSecondaryAction/index.d.ts +1 -0
  87. package/build/esm/components/ListItemText/index.d.ts +1 -0
  88. package/build/esm/components/Menu/index.d.ts +1 -0
  89. package/build/esm/components/MenuItem/index.d.ts +1 -0
  90. package/build/esm/components/MenuList/index.d.ts +1 -0
  91. package/build/esm/components/Modal/index.d.ts +1 -0
  92. package/build/esm/components/Paper/Paper.d.ts +6 -0
  93. package/build/esm/components/Paper/index.d.ts +1 -0
  94. package/build/esm/components/PaperContent/PaperContent.d.ts +2 -0
  95. package/build/esm/components/PaperContent/index.d.ts +1 -0
  96. package/build/esm/components/Popover/index.d.ts +1 -0
  97. package/build/esm/components/Popper/index.d.ts +1 -0
  98. package/build/esm/components/Radio/Radio.d.ts +3 -0
  99. package/build/esm/components/Radio/RadioProps.d.ts +8 -0
  100. package/build/esm/components/Radio/index.d.ts +2 -0
  101. package/build/esm/components/SplitInput/SplitInput.d.ts +3 -0
  102. package/build/esm/components/SplitInput/SplitInputProps.d.ts +18 -0
  103. package/build/esm/components/SplitInput/SplitInputStyles.d.ts +2 -0
  104. package/build/esm/components/SplitInput/index.d.ts +2 -0
  105. package/build/esm/components/Step/index.d.ts +1 -0
  106. package/build/esm/components/StepButton/index.d.ts +1 -0
  107. package/build/esm/components/StepConnector/index.d.ts +1 -0
  108. package/build/esm/components/StepContent/index.d.ts +1 -0
  109. package/build/esm/components/StepIcon/index.d.ts +1 -0
  110. package/build/esm/components/StepLabel/index.d.ts +1 -0
  111. package/build/esm/components/Stepper/index.d.ts +1 -0
  112. package/build/esm/components/Switch/Switch.d.ts +3 -0
  113. package/build/esm/components/Switch/SwitchProps.d.ts +8 -0
  114. package/build/esm/components/Switch/index.d.ts +2 -0
  115. package/build/esm/components/Switch/switch.styles.d.ts +2 -0
  116. package/build/esm/components/Tab/index.d.ts +1 -0
  117. package/build/esm/components/Table/Table.d.ts +3 -0
  118. package/build/esm/components/Table/TableProps.d.ts +28 -0
  119. package/build/esm/components/Table/TableStyles.d.ts +2 -0
  120. package/build/esm/components/Table/index.d.ts +2 -0
  121. package/build/esm/components/Table/util/makeColumns.d.ts +7 -0
  122. package/build/esm/components/TableActionsCell/TableActionsCell.d.ts +3 -0
  123. package/build/esm/components/TableActionsCell/TableActionsCellProps.d.ts +10 -0
  124. package/build/esm/components/TableActionsCell/index.d.ts +2 -0
  125. package/build/esm/components/TableBody/TableBody.d.ts +2 -0
  126. package/build/esm/components/TableBody/index.d.ts +1 -0
  127. package/build/esm/components/TableCell/TableCell.d.ts +2 -0
  128. package/build/esm/components/TableCell/TableCellStyles.d.ts +1 -0
  129. package/build/esm/components/TableCell/index.d.ts +1 -0
  130. package/build/esm/components/TableFooter/TableFooter.d.ts +2 -0
  131. package/build/esm/components/TableFooter/index.d.ts +1 -0
  132. package/build/esm/components/TableHeader/TableHeader.d.ts +2 -0
  133. package/build/esm/components/TableHeader/index.d.ts +1 -0
  134. package/build/esm/components/TableHeaderCell/TableHeaderCell.d.ts +3 -0
  135. package/build/esm/components/TableHeaderCell/TableHeaderCellProps.d.ts +8 -0
  136. package/build/esm/components/TableHeaderCell/TableHeaderCellStyles.d.ts +2 -0
  137. package/build/esm/components/TableHeaderCell/index.d.ts +1 -0
  138. package/build/esm/components/TableHeaderRow/TableHeaderRow.d.ts +2 -0
  139. package/build/esm/components/TableHeaderRow/index.d.ts +1 -0
  140. package/build/esm/components/TableRow/TableRow.d.ts +2 -0
  141. package/build/esm/components/TableRow/TableRowStyles.d.ts +1 -0
  142. package/build/esm/components/TableRow/index.d.ts +1 -0
  143. package/build/esm/components/Tabs/index.d.ts +1 -0
  144. package/build/esm/components/TextField/index.d.ts +1 -0
  145. package/build/esm/components/ThemeProvider/index.d.ts +1 -0
  146. package/build/esm/components/ToggleButton/ToggleButton.d.ts +3 -0
  147. package/build/esm/components/ToggleButton/ToggleButtonProps.d.ts +4 -0
  148. package/build/esm/components/ToggleButton/ToggleButtonStyles.d.ts +2 -0
  149. package/build/esm/components/ToggleButton/index.d.ts +2 -0
  150. package/build/esm/components/ToggleButtonGroup/ToggleButtonGroup.d.ts +3 -0
  151. package/build/esm/components/ToggleButtonGroup/ToggleButtonGroupProps.d.ts +6 -0
  152. package/build/esm/components/ToggleButtonGroup/ToggleButtonGroupStyles.d.ts +1 -0
  153. package/build/esm/components/ToggleButtonGroup/index.d.ts +2 -0
  154. package/build/esm/components/Toolbar/index.d.ts +1 -0
  155. package/build/esm/components/Tooltip/Tooltip.d.ts +3 -0
  156. package/build/esm/components/Tooltip/TooltipProps.d.ts +1 -0
  157. package/build/esm/components/Tooltip/TooltipStyles.d.ts +2 -0
  158. package/build/esm/components/Tooltip/index.d.ts +2 -0
  159. package/build/esm/components/Typography/Typography.d.ts +3 -0
  160. package/build/esm/components/Typography/TypographyStyles.d.ts +2 -0
  161. package/build/esm/components/Typography/index.d.ts +2 -0
  162. package/build/esm/components/index.d.ts +75 -0
  163. package/build/esm/hooks/index.d.ts +1 -0
  164. package/build/esm/hooks/useCollapsibleText.d.ts +10 -0
  165. package/build/esm/index.d.ts +3 -0
  166. package/build/esm/index.js +1339 -0
  167. package/build/esm/index.js.map +1 -0
  168. package/build/{index.es.js → esm/react-table-de7bf68c.js} +3 -2544
  169. package/build/esm/react-table-de7bf68c.js.map +1 -0
  170. package/build/esm/types/index.d.ts +2 -0
  171. package/build/esm/util/ServerStyleSheets.d.ts +1 -0
  172. package/build/esm/util/colors/alpha.d.ts +1 -0
  173. package/build/esm/util/colors/darken.d.ts +1 -0
  174. package/build/esm/util/colors/decomposeColor.d.ts +1 -0
  175. package/build/esm/util/colors/getLuminance.d.ts +1 -0
  176. package/build/esm/util/colors/hexToRgb.d.ts +1 -0
  177. package/build/esm/util/colors/index.d.ts +8 -0
  178. package/build/esm/util/colors/lighten.d.ts +1 -0
  179. package/build/esm/util/colors/recomposeColor.d.ts +1 -0
  180. package/build/esm/util/colors/rgbToHex.d.ts +1 -0
  181. package/build/esm/util/createTheme.d.ts +1 -0
  182. package/build/esm/util/index.d.ts +4 -0
  183. package/build/esm/util/makeStyles.d.ts +1 -0
  184. package/build/index.js +272 -1474
  185. package/build/index.js.map +1 -1
  186. package/package.json +4 -3
  187. package/build/components/AudioPlayer/util/usePlaybackIcon.d.ts +0 -2
  188. package/build/index.es.js.map +0 -1
@@ -1,2278 +1,7 @@
1
- export { default as Alert } from '@material-ui/lab/Alert';
2
- import { makeStyles, Box as Box$1, Paper as Paper$1, Popper, Grow, Slider, useTheme as useTheme$1 } from '@material-ui/core';
3
- export { Accordion, AccordionActions, AccordionDetails, AccordionSummary, Breadcrumbs, ButtonBase, ClickAwayListener, Fab, GridList, Hidden, Modal, Popover, Popper, Step, StepButton, StepConnector, StepContent, StepIcon, StepLabel, Stepper, ThemeProvider, Toolbar, alpha, createTheme, darken, decomposeColor, getLuminance, hexToRgb, lighten, makeStyles, recomposeColor, rgbToHex } from '@material-ui/core';
4
- export { default as AppBar } from '@material-ui/core/AppBar';
5
- import * as React from 'react';
6
- import React__default, { createElement, forwardRef, useRef, useState, useReducer, useEffect, Fragment, useMemo } from 'react';
7
- import MuiIconButton from '@material-ui/core/IconButton';
8
- import MuiTypography from '@material-ui/core/Typography';
9
- import { makeStyles as makeStyles$1, useTheme } from '@material-ui/core/styles';
10
- export { ServerStyleSheets } from '@material-ui/core/styles';
11
- import MuiAvatar from '@material-ui/core/Avatar';
12
- export { default as Badge } from '@material-ui/core/Badge';
13
- import MuiButton from '@material-ui/core/Button';
14
- import CircularProgress from '@material-ui/core/CircularProgress';
15
- export { default as CircularProgress } from '@material-ui/core/CircularProgress';
16
- export { default as ButtonGroup } from '@material-ui/core/ButtonGroup';
17
- export { default as Card } from '@material-ui/core/Card';
18
- export { default as CardActionArea } from '@material-ui/core/CardActionArea';
19
- export { default as CardActions } from '@material-ui/core/CardActions';
20
- export { default as CardContent } from '@material-ui/core/CardContent';
21
- export { default as CardHeader } from '@material-ui/core/CardHeader';
22
- export { default as CardMedia } from '@material-ui/core/CardMedia';
23
- import MuiCheckbox from '@material-ui/core/Checkbox';
24
- import FormControlLabel from '@material-ui/core/FormControlLabel';
25
- export { default as FormControlLabel } from '@material-ui/core/FormControlLabel';
26
- export { default as Chip } from '@material-ui/core/Chip';
27
- import Collapse from '@material-ui/core/Collapse';
28
- export { default as Dialog } from '@material-ui/core/Dialog';
29
- export { default as DialogActions } from '@material-ui/core/DialogActions';
30
- export { default as DialogContent } from '@material-ui/core/DialogContent';
31
- export { default as DialogTitle } from '@material-ui/core/DialogTitle';
32
- export { default as Drawer } from '@material-ui/core/Drawer';
33
- export { default as FormControl } from '@material-ui/core/FormControl';
34
- export { default as Grid } from '@material-ui/core/Grid';
35
- export { default as InputAdornment } from '@material-ui/core/InputAdornment';
36
- export { default as LinearProgress } from '@material-ui/core/LinearProgress';
37
- import MuiLink from '@material-ui/core/Link';
38
- export { default as List } from '@material-ui/core/List';
39
- export { default as ListItem } from '@material-ui/core/ListItem';
40
- export { default as ListItemIcon } from '@material-ui/core/ListItemIcon';
41
- export { default as ListItemSecondaryAction } from '@material-ui/core/ListItemSecondaryAction';
42
- export { default as ListItemText } from '@material-ui/core/ListItemText';
43
- import Menu from '@material-ui/core/Menu';
44
- export { default as Menu } from '@material-ui/core/Menu';
45
- import MenuItem from '@material-ui/core/MenuItem';
46
- export { default as MenuItem } from '@material-ui/core/MenuItem';
47
- export { default as MenuList } from '@material-ui/core/MenuList';
48
- import MuiRadio from '@material-ui/core/Radio';
49
- import TextField from '@material-ui/core/TextField';
50
- export { default as TextField } from '@material-ui/core/TextField';
51
- import MuiSwitch from '@material-ui/core/Switch';
52
- import { Pagination } from '@material-ui/lab';
53
- export { default as Tab } from '@material-ui/core/Tab';
54
- export { default as Tabs } from '@material-ui/core/Tabs';
55
- import MuiToggleButton from '@material-ui/lab/ToggleButton';
56
- import MuiToggleButtonGroup from '@material-ui/lab/ToggleButtonGroup';
57
- import MuiTooltip from '@material-ui/core/Tooltip';
58
-
59
- /*! *****************************************************************************
60
- Copyright (c) Microsoft Corporation.
61
-
62
- Permission to use, copy, modify, and/or distribute this software for any
63
- purpose with or without fee is hereby granted.
64
-
65
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
66
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
67
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
68
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
69
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
70
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
71
- PERFORMANCE OF THIS SOFTWARE.
72
- ***************************************************************************** */
73
-
74
- var __assign = function() {
75
- __assign = Object.assign || function __assign(t) {
76
- for (var s, i = 1, n = arguments.length; i < n; i++) {
77
- s = arguments[i];
78
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
79
- }
80
- return t;
81
- };
82
- return __assign.apply(this, arguments);
83
- };
84
-
85
- function __rest(s, e) {
86
- var t = {};
87
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
88
- t[p] = s[p];
89
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
90
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
91
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
92
- t[p[i]] = s[p[i]];
93
- }
94
- return t;
95
- }
96
-
97
- function __spreadArray(to, from, pack) {
98
- if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
99
- if (ar || !(i in from)) {
100
- if (!ar) ar = Array.prototype.slice.call(from, 0, i);
101
- ar[i] = from[i];
102
- }
103
- }
104
- return to.concat(ar || from);
105
- }
1
+ import React__default from 'react';
106
2
 
107
3
  var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
108
4
 
109
- var classnames = {exports: {}};
110
-
111
- /*!
112
- Copyright (c) 2018 Jed Watson.
113
- Licensed under the MIT License (MIT), see
114
- http://jedwatson.github.io/classnames
115
- */
116
-
117
- (function (module) {
118
- /* global define */
119
-
120
- (function () {
121
-
122
- var hasOwn = {}.hasOwnProperty;
123
-
124
- function classNames() {
125
- var classes = [];
126
-
127
- for (var i = 0; i < arguments.length; i++) {
128
- var arg = arguments[i];
129
- if (!arg) continue;
130
-
131
- var argType = typeof arg;
132
-
133
- if (argType === 'string' || argType === 'number') {
134
- classes.push(arg);
135
- } else if (Array.isArray(arg)) {
136
- if (arg.length) {
137
- var inner = classNames.apply(null, arg);
138
- if (inner) {
139
- classes.push(inner);
140
- }
141
- }
142
- } else if (argType === 'object') {
143
- if (arg.toString === Object.prototype.toString) {
144
- for (var key in arg) {
145
- if (hasOwn.call(arg, key) && arg[key]) {
146
- classes.push(key);
147
- }
148
- }
149
- } else {
150
- classes.push(arg.toString());
151
- }
152
- }
153
- }
154
-
155
- return classes.join(' ');
156
- }
157
-
158
- if (module.exports) {
159
- classNames.default = classNames;
160
- module.exports = classNames;
161
- } else {
162
- window.classNames = classNames;
163
- }
164
- }());
165
- }(classnames));
166
-
167
- var classNames = classnames.exports;
168
-
169
- function _defineProperty(obj, key, value) {
170
- if (key in obj) {
171
- Object.defineProperty(obj, key, {
172
- value: value,
173
- enumerable: true,
174
- configurable: true,
175
- writable: true
176
- });
177
- } else {
178
- obj[key] = value;
179
- }
180
-
181
- return obj;
182
- }
183
-
184
- var propTypes = {exports: {}};
185
-
186
- var reactIs = {exports: {}};
187
-
188
- var reactIs_production_min = {};
189
-
190
- /** @license React v16.13.1
191
- * react-is.production.min.js
192
- *
193
- * Copyright (c) Facebook, Inc. and its affiliates.
194
- *
195
- * This source code is licensed under the MIT license found in the
196
- * LICENSE file in the root directory of this source tree.
197
- */
198
- var b="function"===typeof Symbol&&Symbol.for,c=b?Symbol.for("react.element"):60103,d=b?Symbol.for("react.portal"):60106,e=b?Symbol.for("react.fragment"):60107,f=b?Symbol.for("react.strict_mode"):60108,g=b?Symbol.for("react.profiler"):60114,h=b?Symbol.for("react.provider"):60109,k=b?Symbol.for("react.context"):60110,l=b?Symbol.for("react.async_mode"):60111,m=b?Symbol.for("react.concurrent_mode"):60111,n=b?Symbol.for("react.forward_ref"):60112,p=b?Symbol.for("react.suspense"):60113,q=b?
199
- Symbol.for("react.suspense_list"):60120,r=b?Symbol.for("react.memo"):60115,t=b?Symbol.for("react.lazy"):60116,v=b?Symbol.for("react.block"):60121,w=b?Symbol.for("react.fundamental"):60117,x=b?Symbol.for("react.responder"):60118,y=b?Symbol.for("react.scope"):60119;
200
- function z(a){if("object"===typeof a&&null!==a){var u=a.$$typeof;switch(u){case c:switch(a=a.type,a){case l:case m:case e:case g:case f:case p:return a;default:switch(a=a&&a.$$typeof,a){case k:case n:case t:case r:case h:return a;default:return u}}case d:return u}}}function A(a){return z(a)===m}reactIs_production_min.AsyncMode=l;reactIs_production_min.ConcurrentMode=m;reactIs_production_min.ContextConsumer=k;reactIs_production_min.ContextProvider=h;reactIs_production_min.Element=c;reactIs_production_min.ForwardRef=n;reactIs_production_min.Fragment=e;reactIs_production_min.Lazy=t;reactIs_production_min.Memo=r;reactIs_production_min.Portal=d;
201
- reactIs_production_min.Profiler=g;reactIs_production_min.StrictMode=f;reactIs_production_min.Suspense=p;reactIs_production_min.isAsyncMode=function(a){return A(a)||z(a)===l};reactIs_production_min.isConcurrentMode=A;reactIs_production_min.isContextConsumer=function(a){return z(a)===k};reactIs_production_min.isContextProvider=function(a){return z(a)===h};reactIs_production_min.isElement=function(a){return "object"===typeof a&&null!==a&&a.$$typeof===c};reactIs_production_min.isForwardRef=function(a){return z(a)===n};reactIs_production_min.isFragment=function(a){return z(a)===e};reactIs_production_min.isLazy=function(a){return z(a)===t};
202
- reactIs_production_min.isMemo=function(a){return z(a)===r};reactIs_production_min.isPortal=function(a){return z(a)===d};reactIs_production_min.isProfiler=function(a){return z(a)===g};reactIs_production_min.isStrictMode=function(a){return z(a)===f};reactIs_production_min.isSuspense=function(a){return z(a)===p};
203
- reactIs_production_min.isValidElementType=function(a){return "string"===typeof a||"function"===typeof a||a===e||a===m||a===g||a===f||a===p||a===q||"object"===typeof a&&null!==a&&(a.$$typeof===t||a.$$typeof===r||a.$$typeof===h||a.$$typeof===k||a.$$typeof===n||a.$$typeof===w||a.$$typeof===x||a.$$typeof===y||a.$$typeof===v)};reactIs_production_min.typeOf=z;
204
-
205
- var reactIs_development = {};
206
-
207
- /** @license React v16.13.1
208
- * react-is.development.js
209
- *
210
- * Copyright (c) Facebook, Inc. and its affiliates.
211
- *
212
- * This source code is licensed under the MIT license found in the
213
- * LICENSE file in the root directory of this source tree.
214
- */
215
-
216
-
217
-
218
- if (process.env.NODE_ENV !== "production") {
219
- (function() {
220
-
221
- // The Symbol used to tag the ReactElement-like types. If there is no native Symbol
222
- // nor polyfill, then a plain number is used for performance.
223
- var hasSymbol = typeof Symbol === 'function' && Symbol.for;
224
- var REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for('react.element') : 0xeac7;
225
- var REACT_PORTAL_TYPE = hasSymbol ? Symbol.for('react.portal') : 0xeaca;
226
- var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for('react.fragment') : 0xeacb;
227
- var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for('react.strict_mode') : 0xeacc;
228
- var REACT_PROFILER_TYPE = hasSymbol ? Symbol.for('react.profiler') : 0xead2;
229
- var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for('react.provider') : 0xeacd;
230
- var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for('react.context') : 0xeace; // TODO: We don't use AsyncMode or ConcurrentMode anymore. They were temporary
231
- // (unstable) APIs that have been removed. Can we remove the symbols?
232
-
233
- var REACT_ASYNC_MODE_TYPE = hasSymbol ? Symbol.for('react.async_mode') : 0xeacf;
234
- var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for('react.concurrent_mode') : 0xeacf;
235
- var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for('react.forward_ref') : 0xead0;
236
- var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for('react.suspense') : 0xead1;
237
- var REACT_SUSPENSE_LIST_TYPE = hasSymbol ? Symbol.for('react.suspense_list') : 0xead8;
238
- var REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3;
239
- var REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 0xead4;
240
- var REACT_BLOCK_TYPE = hasSymbol ? Symbol.for('react.block') : 0xead9;
241
- var REACT_FUNDAMENTAL_TYPE = hasSymbol ? Symbol.for('react.fundamental') : 0xead5;
242
- var REACT_RESPONDER_TYPE = hasSymbol ? Symbol.for('react.responder') : 0xead6;
243
- var REACT_SCOPE_TYPE = hasSymbol ? Symbol.for('react.scope') : 0xead7;
244
-
245
- function isValidElementType(type) {
246
- return typeof type === 'string' || typeof type === 'function' || // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill.
247
- type === REACT_FRAGMENT_TYPE || type === REACT_CONCURRENT_MODE_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || typeof type === 'object' && type !== null && (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_FUNDAMENTAL_TYPE || type.$$typeof === REACT_RESPONDER_TYPE || type.$$typeof === REACT_SCOPE_TYPE || type.$$typeof === REACT_BLOCK_TYPE);
248
- }
249
-
250
- function typeOf(object) {
251
- if (typeof object === 'object' && object !== null) {
252
- var $$typeof = object.$$typeof;
253
-
254
- switch ($$typeof) {
255
- case REACT_ELEMENT_TYPE:
256
- var type = object.type;
257
-
258
- switch (type) {
259
- case REACT_ASYNC_MODE_TYPE:
260
- case REACT_CONCURRENT_MODE_TYPE:
261
- case REACT_FRAGMENT_TYPE:
262
- case REACT_PROFILER_TYPE:
263
- case REACT_STRICT_MODE_TYPE:
264
- case REACT_SUSPENSE_TYPE:
265
- return type;
266
-
267
- default:
268
- var $$typeofType = type && type.$$typeof;
269
-
270
- switch ($$typeofType) {
271
- case REACT_CONTEXT_TYPE:
272
- case REACT_FORWARD_REF_TYPE:
273
- case REACT_LAZY_TYPE:
274
- case REACT_MEMO_TYPE:
275
- case REACT_PROVIDER_TYPE:
276
- return $$typeofType;
277
-
278
- default:
279
- return $$typeof;
280
- }
281
-
282
- }
283
-
284
- case REACT_PORTAL_TYPE:
285
- return $$typeof;
286
- }
287
- }
288
-
289
- return undefined;
290
- } // AsyncMode is deprecated along with isAsyncMode
291
-
292
- var AsyncMode = REACT_ASYNC_MODE_TYPE;
293
- var ConcurrentMode = REACT_CONCURRENT_MODE_TYPE;
294
- var ContextConsumer = REACT_CONTEXT_TYPE;
295
- var ContextProvider = REACT_PROVIDER_TYPE;
296
- var Element = REACT_ELEMENT_TYPE;
297
- var ForwardRef = REACT_FORWARD_REF_TYPE;
298
- var Fragment = REACT_FRAGMENT_TYPE;
299
- var Lazy = REACT_LAZY_TYPE;
300
- var Memo = REACT_MEMO_TYPE;
301
- var Portal = REACT_PORTAL_TYPE;
302
- var Profiler = REACT_PROFILER_TYPE;
303
- var StrictMode = REACT_STRICT_MODE_TYPE;
304
- var Suspense = REACT_SUSPENSE_TYPE;
305
- var hasWarnedAboutDeprecatedIsAsyncMode = false; // AsyncMode should be deprecated
306
-
307
- function isAsyncMode(object) {
308
- {
309
- if (!hasWarnedAboutDeprecatedIsAsyncMode) {
310
- hasWarnedAboutDeprecatedIsAsyncMode = true; // Using console['warn'] to evade Babel and ESLint
311
-
312
- console['warn']('The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');
313
- }
314
- }
315
-
316
- return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;
317
- }
318
- function isConcurrentMode(object) {
319
- return typeOf(object) === REACT_CONCURRENT_MODE_TYPE;
320
- }
321
- function isContextConsumer(object) {
322
- return typeOf(object) === REACT_CONTEXT_TYPE;
323
- }
324
- function isContextProvider(object) {
325
- return typeOf(object) === REACT_PROVIDER_TYPE;
326
- }
327
- function isElement(object) {
328
- return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
329
- }
330
- function isForwardRef(object) {
331
- return typeOf(object) === REACT_FORWARD_REF_TYPE;
332
- }
333
- function isFragment(object) {
334
- return typeOf(object) === REACT_FRAGMENT_TYPE;
335
- }
336
- function isLazy(object) {
337
- return typeOf(object) === REACT_LAZY_TYPE;
338
- }
339
- function isMemo(object) {
340
- return typeOf(object) === REACT_MEMO_TYPE;
341
- }
342
- function isPortal(object) {
343
- return typeOf(object) === REACT_PORTAL_TYPE;
344
- }
345
- function isProfiler(object) {
346
- return typeOf(object) === REACT_PROFILER_TYPE;
347
- }
348
- function isStrictMode(object) {
349
- return typeOf(object) === REACT_STRICT_MODE_TYPE;
350
- }
351
- function isSuspense(object) {
352
- return typeOf(object) === REACT_SUSPENSE_TYPE;
353
- }
354
-
355
- reactIs_development.AsyncMode = AsyncMode;
356
- reactIs_development.ConcurrentMode = ConcurrentMode;
357
- reactIs_development.ContextConsumer = ContextConsumer;
358
- reactIs_development.ContextProvider = ContextProvider;
359
- reactIs_development.Element = Element;
360
- reactIs_development.ForwardRef = ForwardRef;
361
- reactIs_development.Fragment = Fragment;
362
- reactIs_development.Lazy = Lazy;
363
- reactIs_development.Memo = Memo;
364
- reactIs_development.Portal = Portal;
365
- reactIs_development.Profiler = Profiler;
366
- reactIs_development.StrictMode = StrictMode;
367
- reactIs_development.Suspense = Suspense;
368
- reactIs_development.isAsyncMode = isAsyncMode;
369
- reactIs_development.isConcurrentMode = isConcurrentMode;
370
- reactIs_development.isContextConsumer = isContextConsumer;
371
- reactIs_development.isContextProvider = isContextProvider;
372
- reactIs_development.isElement = isElement;
373
- reactIs_development.isForwardRef = isForwardRef;
374
- reactIs_development.isFragment = isFragment;
375
- reactIs_development.isLazy = isLazy;
376
- reactIs_development.isMemo = isMemo;
377
- reactIs_development.isPortal = isPortal;
378
- reactIs_development.isProfiler = isProfiler;
379
- reactIs_development.isStrictMode = isStrictMode;
380
- reactIs_development.isSuspense = isSuspense;
381
- reactIs_development.isValidElementType = isValidElementType;
382
- reactIs_development.typeOf = typeOf;
383
- })();
384
- }
385
-
386
- if (process.env.NODE_ENV === 'production') {
387
- reactIs.exports = reactIs_production_min;
388
- } else {
389
- reactIs.exports = reactIs_development;
390
- }
391
-
392
- /*
393
- object-assign
394
- (c) Sindre Sorhus
395
- @license MIT
396
- */
397
- /* eslint-disable no-unused-vars */
398
- var getOwnPropertySymbols = Object.getOwnPropertySymbols;
399
- var hasOwnProperty = Object.prototype.hasOwnProperty;
400
- var propIsEnumerable = Object.prototype.propertyIsEnumerable;
401
-
402
- function toObject(val) {
403
- if (val === null || val === undefined) {
404
- throw new TypeError('Object.assign cannot be called with null or undefined');
405
- }
406
-
407
- return Object(val);
408
- }
409
-
410
- function shouldUseNative() {
411
- try {
412
- if (!Object.assign) {
413
- return false;
414
- }
415
-
416
- // Detect buggy property enumeration order in older V8 versions.
417
-
418
- // https://bugs.chromium.org/p/v8/issues/detail?id=4118
419
- var test1 = new String('abc'); // eslint-disable-line no-new-wrappers
420
- test1[5] = 'de';
421
- if (Object.getOwnPropertyNames(test1)[0] === '5') {
422
- return false;
423
- }
424
-
425
- // https://bugs.chromium.org/p/v8/issues/detail?id=3056
426
- var test2 = {};
427
- for (var i = 0; i < 10; i++) {
428
- test2['_' + String.fromCharCode(i)] = i;
429
- }
430
- var order2 = Object.getOwnPropertyNames(test2).map(function (n) {
431
- return test2[n];
432
- });
433
- if (order2.join('') !== '0123456789') {
434
- return false;
435
- }
436
-
437
- // https://bugs.chromium.org/p/v8/issues/detail?id=3056
438
- var test3 = {};
439
- 'abcdefghijklmnopqrst'.split('').forEach(function (letter) {
440
- test3[letter] = letter;
441
- });
442
- if (Object.keys(Object.assign({}, test3)).join('') !==
443
- 'abcdefghijklmnopqrst') {
444
- return false;
445
- }
446
-
447
- return true;
448
- } catch (err) {
449
- // We don't expect any of the above to throw, but better to be safe.
450
- return false;
451
- }
452
- }
453
-
454
- var objectAssign = shouldUseNative() ? Object.assign : function (target, source) {
455
- var from;
456
- var to = toObject(target);
457
- var symbols;
458
-
459
- for (var s = 1; s < arguments.length; s++) {
460
- from = Object(arguments[s]);
461
-
462
- for (var key in from) {
463
- if (hasOwnProperty.call(from, key)) {
464
- to[key] = from[key];
465
- }
466
- }
467
-
468
- if (getOwnPropertySymbols) {
469
- symbols = getOwnPropertySymbols(from);
470
- for (var i = 0; i < symbols.length; i++) {
471
- if (propIsEnumerable.call(from, symbols[i])) {
472
- to[symbols[i]] = from[symbols[i]];
473
- }
474
- }
475
- }
476
- }
477
-
478
- return to;
479
- };
480
-
481
- /**
482
- * Copyright (c) 2013-present, Facebook, Inc.
483
- *
484
- * This source code is licensed under the MIT license found in the
485
- * LICENSE file in the root directory of this source tree.
486
- */
487
-
488
- var ReactPropTypesSecret$3 = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
489
-
490
- var ReactPropTypesSecret_1 = ReactPropTypesSecret$3;
491
-
492
- /**
493
- * Copyright (c) 2013-present, Facebook, Inc.
494
- *
495
- * This source code is licensed under the MIT license found in the
496
- * LICENSE file in the root directory of this source tree.
497
- */
498
-
499
- var printWarning$1 = function() {};
500
-
501
- if (process.env.NODE_ENV !== 'production') {
502
- var ReactPropTypesSecret$2 = ReactPropTypesSecret_1;
503
- var loggedTypeFailures = {};
504
- var has$1 = Function.call.bind(Object.prototype.hasOwnProperty);
505
-
506
- printWarning$1 = function(text) {
507
- var message = 'Warning: ' + text;
508
- if (typeof console !== 'undefined') {
509
- console.error(message);
510
- }
511
- try {
512
- // --- Welcome to debugging React ---
513
- // This error was thrown as a convenience so that you can use this stack
514
- // to find the callsite that caused this warning to fire.
515
- throw new Error(message);
516
- } catch (x) {}
517
- };
518
- }
519
-
520
- /**
521
- * Assert that the values match with the type specs.
522
- * Error messages are memorized and will only be shown once.
523
- *
524
- * @param {object} typeSpecs Map of name to a ReactPropType
525
- * @param {object} values Runtime values that need to be type-checked
526
- * @param {string} location e.g. "prop", "context", "child context"
527
- * @param {string} componentName Name of the component for error messages.
528
- * @param {?Function} getStack Returns the component stack.
529
- * @private
530
- */
531
- function checkPropTypes$1(typeSpecs, values, location, componentName, getStack) {
532
- if (process.env.NODE_ENV !== 'production') {
533
- for (var typeSpecName in typeSpecs) {
534
- if (has$1(typeSpecs, typeSpecName)) {
535
- var error;
536
- // Prop type validation may throw. In case they do, we don't want to
537
- // fail the render phase where it didn't fail before. So we log it.
538
- // After these have been cleaned up, we'll let them throw.
539
- try {
540
- // This is intentionally an invariant that gets caught. It's the same
541
- // behavior as without this statement except with a better message.
542
- if (typeof typeSpecs[typeSpecName] !== 'function') {
543
- var err = Error(
544
- (componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' +
545
- 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.'
546
- );
547
- err.name = 'Invariant Violation';
548
- throw err;
549
- }
550
- error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret$2);
551
- } catch (ex) {
552
- error = ex;
553
- }
554
- if (error && !(error instanceof Error)) {
555
- printWarning$1(
556
- (componentName || 'React class') + ': type specification of ' +
557
- location + ' `' + typeSpecName + '` is invalid; the type checker ' +
558
- 'function must return `null` or an `Error` but returned a ' + typeof error + '. ' +
559
- 'You may have forgotten to pass an argument to the type checker ' +
560
- 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' +
561
- 'shape all require an argument).'
562
- );
563
- }
564
- if (error instanceof Error && !(error.message in loggedTypeFailures)) {
565
- // Only monitor this failure once because there tends to be a lot of the
566
- // same error.
567
- loggedTypeFailures[error.message] = true;
568
-
569
- var stack = getStack ? getStack() : '';
570
-
571
- printWarning$1(
572
- 'Failed ' + location + ' type: ' + error.message + (stack != null ? stack : '')
573
- );
574
- }
575
- }
576
- }
577
- }
578
- }
579
-
580
- /**
581
- * Resets warning cache when testing.
582
- *
583
- * @private
584
- */
585
- checkPropTypes$1.resetWarningCache = function() {
586
- if (process.env.NODE_ENV !== 'production') {
587
- loggedTypeFailures = {};
588
- }
589
- };
590
-
591
- var checkPropTypes_1 = checkPropTypes$1;
592
-
593
- /**
594
- * Copyright (c) 2013-present, Facebook, Inc.
595
- *
596
- * This source code is licensed under the MIT license found in the
597
- * LICENSE file in the root directory of this source tree.
598
- */
599
-
600
- var ReactIs$1 = reactIs.exports;
601
- var assign = objectAssign;
602
-
603
- var ReactPropTypesSecret$1 = ReactPropTypesSecret_1;
604
- var checkPropTypes = checkPropTypes_1;
605
-
606
- var has = Function.call.bind(Object.prototype.hasOwnProperty);
607
- var printWarning = function() {};
608
-
609
- if (process.env.NODE_ENV !== 'production') {
610
- printWarning = function(text) {
611
- var message = 'Warning: ' + text;
612
- if (typeof console !== 'undefined') {
613
- console.error(message);
614
- }
615
- try {
616
- // --- Welcome to debugging React ---
617
- // This error was thrown as a convenience so that you can use this stack
618
- // to find the callsite that caused this warning to fire.
619
- throw new Error(message);
620
- } catch (x) {}
621
- };
622
- }
623
-
624
- function emptyFunctionThatReturnsNull() {
625
- return null;
626
- }
627
-
628
- var factoryWithTypeCheckers = function(isValidElement, throwOnDirectAccess) {
629
- /* global Symbol */
630
- var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
631
- var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec.
632
-
633
- /**
634
- * Returns the iterator method function contained on the iterable object.
635
- *
636
- * Be sure to invoke the function with the iterable as context:
637
- *
638
- * var iteratorFn = getIteratorFn(myIterable);
639
- * if (iteratorFn) {
640
- * var iterator = iteratorFn.call(myIterable);
641
- * ...
642
- * }
643
- *
644
- * @param {?object} maybeIterable
645
- * @return {?function}
646
- */
647
- function getIteratorFn(maybeIterable) {
648
- var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]);
649
- if (typeof iteratorFn === 'function') {
650
- return iteratorFn;
651
- }
652
- }
653
-
654
- /**
655
- * Collection of methods that allow declaration and validation of props that are
656
- * supplied to React components. Example usage:
657
- *
658
- * var Props = require('ReactPropTypes');
659
- * var MyArticle = React.createClass({
660
- * propTypes: {
661
- * // An optional string prop named "description".
662
- * description: Props.string,
663
- *
664
- * // A required enum prop named "category".
665
- * category: Props.oneOf(['News','Photos']).isRequired,
666
- *
667
- * // A prop named "dialog" that requires an instance of Dialog.
668
- * dialog: Props.instanceOf(Dialog).isRequired
669
- * },
670
- * render: function() { ... }
671
- * });
672
- *
673
- * A more formal specification of how these methods are used:
674
- *
675
- * type := array|bool|func|object|number|string|oneOf([...])|instanceOf(...)
676
- * decl := ReactPropTypes.{type}(.isRequired)?
677
- *
678
- * Each and every declaration produces a function with the same signature. This
679
- * allows the creation of custom validation functions. For example:
680
- *
681
- * var MyLink = React.createClass({
682
- * propTypes: {
683
- * // An optional string or URI prop named "href".
684
- * href: function(props, propName, componentName) {
685
- * var propValue = props[propName];
686
- * if (propValue != null && typeof propValue !== 'string' &&
687
- * !(propValue instanceof URI)) {
688
- * return new Error(
689
- * 'Expected a string or an URI for ' + propName + ' in ' +
690
- * componentName
691
- * );
692
- * }
693
- * }
694
- * },
695
- * render: function() {...}
696
- * });
697
- *
698
- * @internal
699
- */
700
-
701
- var ANONYMOUS = '<<anonymous>>';
702
-
703
- // Important!
704
- // Keep this list in sync with production version in `./factoryWithThrowingShims.js`.
705
- var ReactPropTypes = {
706
- array: createPrimitiveTypeChecker('array'),
707
- bool: createPrimitiveTypeChecker('boolean'),
708
- func: createPrimitiveTypeChecker('function'),
709
- number: createPrimitiveTypeChecker('number'),
710
- object: createPrimitiveTypeChecker('object'),
711
- string: createPrimitiveTypeChecker('string'),
712
- symbol: createPrimitiveTypeChecker('symbol'),
713
-
714
- any: createAnyTypeChecker(),
715
- arrayOf: createArrayOfTypeChecker,
716
- element: createElementTypeChecker(),
717
- elementType: createElementTypeTypeChecker(),
718
- instanceOf: createInstanceTypeChecker,
719
- node: createNodeChecker(),
720
- objectOf: createObjectOfTypeChecker,
721
- oneOf: createEnumTypeChecker,
722
- oneOfType: createUnionTypeChecker,
723
- shape: createShapeTypeChecker,
724
- exact: createStrictShapeTypeChecker,
725
- };
726
-
727
- /**
728
- * inlined Object.is polyfill to avoid requiring consumers ship their own
729
- * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is
730
- */
731
- /*eslint-disable no-self-compare*/
732
- function is(x, y) {
733
- // SameValue algorithm
734
- if (x === y) {
735
- // Steps 1-5, 7-10
736
- // Steps 6.b-6.e: +0 != -0
737
- return x !== 0 || 1 / x === 1 / y;
738
- } else {
739
- // Step 6.a: NaN == NaN
740
- return x !== x && y !== y;
741
- }
742
- }
743
- /*eslint-enable no-self-compare*/
744
-
745
- /**
746
- * We use an Error-like object for backward compatibility as people may call
747
- * PropTypes directly and inspect their output. However, we don't use real
748
- * Errors anymore. We don't inspect their stack anyway, and creating them
749
- * is prohibitively expensive if they are created too often, such as what
750
- * happens in oneOfType() for any type before the one that matched.
751
- */
752
- function PropTypeError(message) {
753
- this.message = message;
754
- this.stack = '';
755
- }
756
- // Make `instanceof Error` still work for returned errors.
757
- PropTypeError.prototype = Error.prototype;
758
-
759
- function createChainableTypeChecker(validate) {
760
- if (process.env.NODE_ENV !== 'production') {
761
- var manualPropTypeCallCache = {};
762
- var manualPropTypeWarningCount = 0;
763
- }
764
- function checkType(isRequired, props, propName, componentName, location, propFullName, secret) {
765
- componentName = componentName || ANONYMOUS;
766
- propFullName = propFullName || propName;
767
-
768
- if (secret !== ReactPropTypesSecret$1) {
769
- if (throwOnDirectAccess) {
770
- // New behavior only for users of `prop-types` package
771
- var err = new Error(
772
- 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +
773
- 'Use `PropTypes.checkPropTypes()` to call them. ' +
774
- 'Read more at http://fb.me/use-check-prop-types'
775
- );
776
- err.name = 'Invariant Violation';
777
- throw err;
778
- } else if (process.env.NODE_ENV !== 'production' && typeof console !== 'undefined') {
779
- // Old behavior for people using React.PropTypes
780
- var cacheKey = componentName + ':' + propName;
781
- if (
782
- !manualPropTypeCallCache[cacheKey] &&
783
- // Avoid spamming the console because they are often not actionable except for lib authors
784
- manualPropTypeWarningCount < 3
785
- ) {
786
- printWarning(
787
- 'You are manually calling a React.PropTypes validation ' +
788
- 'function for the `' + propFullName + '` prop on `' + componentName + '`. This is deprecated ' +
789
- 'and will throw in the standalone `prop-types` package. ' +
790
- 'You may be seeing this warning due to a third-party PropTypes ' +
791
- 'library. See https://fb.me/react-warning-dont-call-proptypes ' + 'for details.'
792
- );
793
- manualPropTypeCallCache[cacheKey] = true;
794
- manualPropTypeWarningCount++;
795
- }
796
- }
797
- }
798
- if (props[propName] == null) {
799
- if (isRequired) {
800
- if (props[propName] === null) {
801
- return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required ' + ('in `' + componentName + '`, but its value is `null`.'));
802
- }
803
- return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required in ' + ('`' + componentName + '`, but its value is `undefined`.'));
804
- }
805
- return null;
806
- } else {
807
- return validate(props, propName, componentName, location, propFullName);
808
- }
809
- }
810
-
811
- var chainedCheckType = checkType.bind(null, false);
812
- chainedCheckType.isRequired = checkType.bind(null, true);
813
-
814
- return chainedCheckType;
815
- }
816
-
817
- function createPrimitiveTypeChecker(expectedType) {
818
- function validate(props, propName, componentName, location, propFullName, secret) {
819
- var propValue = props[propName];
820
- var propType = getPropType(propValue);
821
- if (propType !== expectedType) {
822
- // `propValue` being instance of, say, date/regexp, pass the 'object'
823
- // check, but we can offer a more precise error message here rather than
824
- // 'of type `object`'.
825
- var preciseType = getPreciseType(propValue);
826
-
827
- return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.'));
828
- }
829
- return null;
830
- }
831
- return createChainableTypeChecker(validate);
832
- }
833
-
834
- function createAnyTypeChecker() {
835
- return createChainableTypeChecker(emptyFunctionThatReturnsNull);
836
- }
837
-
838
- function createArrayOfTypeChecker(typeChecker) {
839
- function validate(props, propName, componentName, location, propFullName) {
840
- if (typeof typeChecker !== 'function') {
841
- return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside arrayOf.');
842
- }
843
- var propValue = props[propName];
844
- if (!Array.isArray(propValue)) {
845
- var propType = getPropType(propValue);
846
- return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an array.'));
847
- }
848
- for (var i = 0; i < propValue.length; i++) {
849
- var error = typeChecker(propValue, i, componentName, location, propFullName + '[' + i + ']', ReactPropTypesSecret$1);
850
- if (error instanceof Error) {
851
- return error;
852
- }
853
- }
854
- return null;
855
- }
856
- return createChainableTypeChecker(validate);
857
- }
858
-
859
- function createElementTypeChecker() {
860
- function validate(props, propName, componentName, location, propFullName) {
861
- var propValue = props[propName];
862
- if (!isValidElement(propValue)) {
863
- var propType = getPropType(propValue);
864
- return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement.'));
865
- }
866
- return null;
867
- }
868
- return createChainableTypeChecker(validate);
869
- }
870
-
871
- function createElementTypeTypeChecker() {
872
- function validate(props, propName, componentName, location, propFullName) {
873
- var propValue = props[propName];
874
- if (!ReactIs$1.isValidElementType(propValue)) {
875
- var propType = getPropType(propValue);
876
- return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement type.'));
877
- }
878
- return null;
879
- }
880
- return createChainableTypeChecker(validate);
881
- }
882
-
883
- function createInstanceTypeChecker(expectedClass) {
884
- function validate(props, propName, componentName, location, propFullName) {
885
- if (!(props[propName] instanceof expectedClass)) {
886
- var expectedClassName = expectedClass.name || ANONYMOUS;
887
- var actualClassName = getClassName(props[propName]);
888
- return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + actualClassName + '` supplied to `' + componentName + '`, expected ') + ('instance of `' + expectedClassName + '`.'));
889
- }
890
- return null;
891
- }
892
- return createChainableTypeChecker(validate);
893
- }
894
-
895
- function createEnumTypeChecker(expectedValues) {
896
- if (!Array.isArray(expectedValues)) {
897
- if (process.env.NODE_ENV !== 'production') {
898
- if (arguments.length > 1) {
899
- printWarning(
900
- 'Invalid arguments supplied to oneOf, expected an array, got ' + arguments.length + ' arguments. ' +
901
- 'A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z]).'
902
- );
903
- } else {
904
- printWarning('Invalid argument supplied to oneOf, expected an array.');
905
- }
906
- }
907
- return emptyFunctionThatReturnsNull;
908
- }
909
-
910
- function validate(props, propName, componentName, location, propFullName) {
911
- var propValue = props[propName];
912
- for (var i = 0; i < expectedValues.length; i++) {
913
- if (is(propValue, expectedValues[i])) {
914
- return null;
915
- }
916
- }
917
-
918
- var valuesString = JSON.stringify(expectedValues, function replacer(key, value) {
919
- var type = getPreciseType(value);
920
- if (type === 'symbol') {
921
- return String(value);
922
- }
923
- return value;
924
- });
925
- return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of value `' + String(propValue) + '` ' + ('supplied to `' + componentName + '`, expected one of ' + valuesString + '.'));
926
- }
927
- return createChainableTypeChecker(validate);
928
- }
929
-
930
- function createObjectOfTypeChecker(typeChecker) {
931
- function validate(props, propName, componentName, location, propFullName) {
932
- if (typeof typeChecker !== 'function') {
933
- return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside objectOf.');
934
- }
935
- var propValue = props[propName];
936
- var propType = getPropType(propValue);
937
- if (propType !== 'object') {
938
- return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an object.'));
939
- }
940
- for (var key in propValue) {
941
- if (has(propValue, key)) {
942
- var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret$1);
943
- if (error instanceof Error) {
944
- return error;
945
- }
946
- }
947
- }
948
- return null;
949
- }
950
- return createChainableTypeChecker(validate);
951
- }
952
-
953
- function createUnionTypeChecker(arrayOfTypeCheckers) {
954
- if (!Array.isArray(arrayOfTypeCheckers)) {
955
- process.env.NODE_ENV !== 'production' ? printWarning('Invalid argument supplied to oneOfType, expected an instance of array.') : void 0;
956
- return emptyFunctionThatReturnsNull;
957
- }
958
-
959
- for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
960
- var checker = arrayOfTypeCheckers[i];
961
- if (typeof checker !== 'function') {
962
- printWarning(
963
- 'Invalid argument supplied to oneOfType. Expected an array of check functions, but ' +
964
- 'received ' + getPostfixForTypeWarning(checker) + ' at index ' + i + '.'
965
- );
966
- return emptyFunctionThatReturnsNull;
967
- }
968
- }
969
-
970
- function validate(props, propName, componentName, location, propFullName) {
971
- for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
972
- var checker = arrayOfTypeCheckers[i];
973
- if (checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret$1) == null) {
974
- return null;
975
- }
976
- }
977
-
978
- return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`.'));
979
- }
980
- return createChainableTypeChecker(validate);
981
- }
982
-
983
- function createNodeChecker() {
984
- function validate(props, propName, componentName, location, propFullName) {
985
- if (!isNode(props[propName])) {
986
- return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a ReactNode.'));
987
- }
988
- return null;
989
- }
990
- return createChainableTypeChecker(validate);
991
- }
992
-
993
- function createShapeTypeChecker(shapeTypes) {
994
- function validate(props, propName, componentName, location, propFullName) {
995
- var propValue = props[propName];
996
- var propType = getPropType(propValue);
997
- if (propType !== 'object') {
998
- return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
999
- }
1000
- for (var key in shapeTypes) {
1001
- var checker = shapeTypes[key];
1002
- if (!checker) {
1003
- continue;
1004
- }
1005
- var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret$1);
1006
- if (error) {
1007
- return error;
1008
- }
1009
- }
1010
- return null;
1011
- }
1012
- return createChainableTypeChecker(validate);
1013
- }
1014
-
1015
- function createStrictShapeTypeChecker(shapeTypes) {
1016
- function validate(props, propName, componentName, location, propFullName) {
1017
- var propValue = props[propName];
1018
- var propType = getPropType(propValue);
1019
- if (propType !== 'object') {
1020
- return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
1021
- }
1022
- // We need to check all keys in case some are required but missing from
1023
- // props.
1024
- var allKeys = assign({}, props[propName], shapeTypes);
1025
- for (var key in allKeys) {
1026
- var checker = shapeTypes[key];
1027
- if (!checker) {
1028
- return new PropTypeError(
1029
- 'Invalid ' + location + ' `' + propFullName + '` key `' + key + '` supplied to `' + componentName + '`.' +
1030
- '\nBad object: ' + JSON.stringify(props[propName], null, ' ') +
1031
- '\nValid keys: ' + JSON.stringify(Object.keys(shapeTypes), null, ' ')
1032
- );
1033
- }
1034
- var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret$1);
1035
- if (error) {
1036
- return error;
1037
- }
1038
- }
1039
- return null;
1040
- }
1041
-
1042
- return createChainableTypeChecker(validate);
1043
- }
1044
-
1045
- function isNode(propValue) {
1046
- switch (typeof propValue) {
1047
- case 'number':
1048
- case 'string':
1049
- case 'undefined':
1050
- return true;
1051
- case 'boolean':
1052
- return !propValue;
1053
- case 'object':
1054
- if (Array.isArray(propValue)) {
1055
- return propValue.every(isNode);
1056
- }
1057
- if (propValue === null || isValidElement(propValue)) {
1058
- return true;
1059
- }
1060
-
1061
- var iteratorFn = getIteratorFn(propValue);
1062
- if (iteratorFn) {
1063
- var iterator = iteratorFn.call(propValue);
1064
- var step;
1065
- if (iteratorFn !== propValue.entries) {
1066
- while (!(step = iterator.next()).done) {
1067
- if (!isNode(step.value)) {
1068
- return false;
1069
- }
1070
- }
1071
- } else {
1072
- // Iterator will provide entry [k,v] tuples rather than values.
1073
- while (!(step = iterator.next()).done) {
1074
- var entry = step.value;
1075
- if (entry) {
1076
- if (!isNode(entry[1])) {
1077
- return false;
1078
- }
1079
- }
1080
- }
1081
- }
1082
- } else {
1083
- return false;
1084
- }
1085
-
1086
- return true;
1087
- default:
1088
- return false;
1089
- }
1090
- }
1091
-
1092
- function isSymbol(propType, propValue) {
1093
- // Native Symbol.
1094
- if (propType === 'symbol') {
1095
- return true;
1096
- }
1097
-
1098
- // falsy value can't be a Symbol
1099
- if (!propValue) {
1100
- return false;
1101
- }
1102
-
1103
- // 19.4.3.5 Symbol.prototype[@@toStringTag] === 'Symbol'
1104
- if (propValue['@@toStringTag'] === 'Symbol') {
1105
- return true;
1106
- }
1107
-
1108
- // Fallback for non-spec compliant Symbols which are polyfilled.
1109
- if (typeof Symbol === 'function' && propValue instanceof Symbol) {
1110
- return true;
1111
- }
1112
-
1113
- return false;
1114
- }
1115
-
1116
- // Equivalent of `typeof` but with special handling for array and regexp.
1117
- function getPropType(propValue) {
1118
- var propType = typeof propValue;
1119
- if (Array.isArray(propValue)) {
1120
- return 'array';
1121
- }
1122
- if (propValue instanceof RegExp) {
1123
- // Old webkits (at least until Android 4.0) return 'function' rather than
1124
- // 'object' for typeof a RegExp. We'll normalize this here so that /bla/
1125
- // passes PropTypes.object.
1126
- return 'object';
1127
- }
1128
- if (isSymbol(propType, propValue)) {
1129
- return 'symbol';
1130
- }
1131
- return propType;
1132
- }
1133
-
1134
- // This handles more types than `getPropType`. Only used for error messages.
1135
- // See `createPrimitiveTypeChecker`.
1136
- function getPreciseType(propValue) {
1137
- if (typeof propValue === 'undefined' || propValue === null) {
1138
- return '' + propValue;
1139
- }
1140
- var propType = getPropType(propValue);
1141
- if (propType === 'object') {
1142
- if (propValue instanceof Date) {
1143
- return 'date';
1144
- } else if (propValue instanceof RegExp) {
1145
- return 'regexp';
1146
- }
1147
- }
1148
- return propType;
1149
- }
1150
-
1151
- // Returns a string that is postfixed to a warning about an invalid type.
1152
- // For example, "undefined" or "of type array"
1153
- function getPostfixForTypeWarning(value) {
1154
- var type = getPreciseType(value);
1155
- switch (type) {
1156
- case 'array':
1157
- case 'object':
1158
- return 'an ' + type;
1159
- case 'boolean':
1160
- case 'date':
1161
- case 'regexp':
1162
- return 'a ' + type;
1163
- default:
1164
- return type;
1165
- }
1166
- }
1167
-
1168
- // Returns class name of the object, if any.
1169
- function getClassName(propValue) {
1170
- if (!propValue.constructor || !propValue.constructor.name) {
1171
- return ANONYMOUS;
1172
- }
1173
- return propValue.constructor.name;
1174
- }
1175
-
1176
- ReactPropTypes.checkPropTypes = checkPropTypes;
1177
- ReactPropTypes.resetWarningCache = checkPropTypes.resetWarningCache;
1178
- ReactPropTypes.PropTypes = ReactPropTypes;
1179
-
1180
- return ReactPropTypes;
1181
- };
1182
-
1183
- /**
1184
- * Copyright (c) 2013-present, Facebook, Inc.
1185
- *
1186
- * This source code is licensed under the MIT license found in the
1187
- * LICENSE file in the root directory of this source tree.
1188
- */
1189
-
1190
- var ReactPropTypesSecret = ReactPropTypesSecret_1;
1191
-
1192
- function emptyFunction() {}
1193
- function emptyFunctionWithReset() {}
1194
- emptyFunctionWithReset.resetWarningCache = emptyFunction;
1195
-
1196
- var factoryWithThrowingShims = function() {
1197
- function shim(props, propName, componentName, location, propFullName, secret) {
1198
- if (secret === ReactPropTypesSecret) {
1199
- // It is still safe when called from React.
1200
- return;
1201
- }
1202
- var err = new Error(
1203
- 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +
1204
- 'Use PropTypes.checkPropTypes() to call them. ' +
1205
- 'Read more at http://fb.me/use-check-prop-types'
1206
- );
1207
- err.name = 'Invariant Violation';
1208
- throw err;
1209
- } shim.isRequired = shim;
1210
- function getShim() {
1211
- return shim;
1212
- } // Important!
1213
- // Keep this list in sync with production version in `./factoryWithTypeCheckers.js`.
1214
- var ReactPropTypes = {
1215
- array: shim,
1216
- bool: shim,
1217
- func: shim,
1218
- number: shim,
1219
- object: shim,
1220
- string: shim,
1221
- symbol: shim,
1222
-
1223
- any: shim,
1224
- arrayOf: getShim,
1225
- element: shim,
1226
- elementType: shim,
1227
- instanceOf: getShim,
1228
- node: shim,
1229
- objectOf: getShim,
1230
- oneOf: getShim,
1231
- oneOfType: getShim,
1232
- shape: getShim,
1233
- exact: getShim,
1234
-
1235
- checkPropTypes: emptyFunctionWithReset,
1236
- resetWarningCache: emptyFunction
1237
- };
1238
-
1239
- ReactPropTypes.PropTypes = ReactPropTypes;
1240
-
1241
- return ReactPropTypes;
1242
- };
1243
-
1244
- /**
1245
- * Copyright (c) 2013-present, Facebook, Inc.
1246
- *
1247
- * This source code is licensed under the MIT license found in the
1248
- * LICENSE file in the root directory of this source tree.
1249
- */
1250
-
1251
- if (process.env.NODE_ENV !== 'production') {
1252
- var ReactIs = reactIs.exports;
1253
-
1254
- // By explicitly using `prop-types` you are opting into new development behavior.
1255
- // http://fb.me/prop-types-in-prod
1256
- var throwOnDirectAccess = true;
1257
- propTypes.exports = factoryWithTypeCheckers(ReactIs.isElement, throwOnDirectAccess);
1258
- } else {
1259
- // By explicitly using `prop-types` you are opting into new production behavior.
1260
- // http://fb.me/prop-types-in-prod
1261
- propTypes.exports = factoryWithThrowingShims();
1262
- }
1263
-
1264
- var PropTypes = propTypes.exports;
1265
-
1266
- var responsivePropType = process.env.NODE_ENV !== 'production' ? PropTypes.oneOfType([PropTypes.number, PropTypes.string, PropTypes.object, PropTypes.array]) : {};
1267
-
1268
- function _typeof(obj) {
1269
- "@babel/helpers - typeof";
1270
-
1271
- if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
1272
- _typeof = function _typeof(obj) {
1273
- return typeof obj;
1274
- };
1275
- } else {
1276
- _typeof = function _typeof(obj) {
1277
- return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
1278
- };
1279
- }
1280
-
1281
- return _typeof(obj);
1282
- }
1283
-
1284
- // For instance with the first breakpoint xs: [xs, sm[.
1285
-
1286
- var values = {
1287
- xs: 0,
1288
- sm: 600,
1289
- md: 960,
1290
- lg: 1280,
1291
- xl: 1920
1292
- };
1293
- var defaultBreakpoints = {
1294
- // Sorted ASC by size. That's important.
1295
- // It can't be configured as it's used statically for propTypes.
1296
- keys: ['xs', 'sm', 'md', 'lg', 'xl'],
1297
- up: function up(key) {
1298
- return "@media (min-width:".concat(values[key], "px)");
1299
- }
1300
- };
1301
- function handleBreakpoints(props, propValue, styleFromPropValue) {
1302
- if (process.env.NODE_ENV !== 'production') {
1303
- if (!props.theme) {
1304
- console.error('Material-UI: You are calling a style function without a theme value.');
1305
- }
1306
- }
1307
-
1308
- if (Array.isArray(propValue)) {
1309
- var themeBreakpoints = props.theme.breakpoints || defaultBreakpoints;
1310
- return propValue.reduce(function (acc, item, index) {
1311
- acc[themeBreakpoints.up(themeBreakpoints.keys[index])] = styleFromPropValue(propValue[index]);
1312
- return acc;
1313
- }, {});
1314
- }
1315
-
1316
- if (_typeof(propValue) === 'object') {
1317
- var _themeBreakpoints = props.theme.breakpoints || defaultBreakpoints;
1318
-
1319
- return Object.keys(propValue).reduce(function (acc, breakpoint) {
1320
- acc[_themeBreakpoints.up(breakpoint)] = styleFromPropValue(propValue[breakpoint]);
1321
- return acc;
1322
- }, {});
1323
- }
1324
-
1325
- var output = styleFromPropValue(propValue);
1326
- return output;
1327
- }
1328
-
1329
- function getPath(obj, path) {
1330
- if (!path || typeof path !== 'string') {
1331
- return null;
1332
- }
1333
-
1334
- return path.split('.').reduce(function (acc, item) {
1335
- return acc && acc[item] ? acc[item] : null;
1336
- }, obj);
1337
- }
1338
-
1339
- function style(options) {
1340
- var prop = options.prop,
1341
- _options$cssProperty = options.cssProperty,
1342
- cssProperty = _options$cssProperty === void 0 ? options.prop : _options$cssProperty,
1343
- themeKey = options.themeKey,
1344
- transform = options.transform;
1345
-
1346
- var fn = function fn(props) {
1347
- if (props[prop] == null) {
1348
- return null;
1349
- }
1350
-
1351
- var propValue = props[prop];
1352
- var theme = props.theme;
1353
- var themeMapping = getPath(theme, themeKey) || {};
1354
-
1355
- var styleFromPropValue = function styleFromPropValue(propValueFinal) {
1356
- var value;
1357
-
1358
- if (typeof themeMapping === 'function') {
1359
- value = themeMapping(propValueFinal);
1360
- } else if (Array.isArray(themeMapping)) {
1361
- value = themeMapping[propValueFinal] || propValueFinal;
1362
- } else {
1363
- value = getPath(themeMapping, propValueFinal) || propValueFinal;
1364
-
1365
- if (transform) {
1366
- value = transform(value);
1367
- }
1368
- }
1369
-
1370
- if (cssProperty === false) {
1371
- return value;
1372
- }
1373
-
1374
- return _defineProperty({}, cssProperty, value);
1375
- };
1376
-
1377
- return handleBreakpoints(props, propValue, styleFromPropValue);
1378
- };
1379
-
1380
- fn.propTypes = process.env.NODE_ENV !== 'production' ? _defineProperty({}, prop, responsivePropType) : {};
1381
- fn.filterProps = [prop];
1382
- return fn;
1383
- }
1384
-
1385
- var gap = style({
1386
- prop: 'gap',
1387
- themeKey: 'spacing',
1388
- });
1389
- var useBoxStyles = makeStyles(function (theme) { return ({
1390
- root: function (props) { return gap(__assign(__assign({}, props), { theme: theme })); },
1391
- }); });
1392
-
1393
- var Box = function (props) {
1394
- var className = props.className; props.gap; var restProps = __rest(props, ["className", "gap"]);
1395
- var root = useBoxStyles(props).root;
1396
- return React__default.createElement(Box$1, __assign({ className: classNames(root, className) }, restProps));
1397
- };
1398
- Box.displayName = 'Box';
1399
-
1400
- var useIconStyles = makeStyles(function (_a) {
1401
- var spacing = _a.spacing, palette = _a.palette;
1402
- var getFontSize = function (_a) {
1403
- var size = _a.size;
1404
- var sizes = {
1405
- inherit: 'inherit',
1406
- small: spacing(1.5),
1407
- medium: spacing(2),
1408
- large: spacing(2.5),
1409
- 'extra-large': spacing(3),
1410
- };
1411
- return size ? sizes[size] : 'inherit';
1412
- };
1413
- var getColor = function (props) {
1414
- var semanticColors = ['primary', 'secondary', 'info', 'success', 'warning', 'error'];
1415
- var value = 'inherit';
1416
- if (props.color) {
1417
- if (semanticColors.includes(props.color.split('.')[0])) {
1418
- var _a = props.color.split('.'), color = _a[0], _b = _a[1], variant = _b === void 0 ? 'main' : _b;
1419
- value = palette[color][variant];
1420
- }
1421
- else if (props.color.search(/^(rgb|hsla|#)/) !== -1) {
1422
- value = props.color;
1423
- }
1424
- }
1425
- return value;
1426
- };
1427
- return {
1428
- root: {
1429
- color: getColor,
1430
- fontSize: getFontSize,
1431
- strokeWidth: '1.3px',
1432
- },
1433
- };
1434
- });
1435
-
1436
- var iconStaticClassName = 'pop-icon';
1437
- var Icon = function (props) {
1438
- var icon = props.icon, className = props.className, restProps = __rest(props, ["icon", "className"]);
1439
- var classes = useIconStyles(props);
1440
- var isValid = true;
1441
- if (!icon || (typeof icon === 'function' && icon({}) === undefined)) {
1442
- isValid = false;
1443
- }
1444
- return isValid
1445
- ? createElement(icon, __assign({ className: classNames([classes.root, iconStaticClassName, className]) }, restProps))
1446
- : null;
1447
- };
1448
- Icon.defaultProps = {
1449
- size: 'inherit',
1450
- color: 'inherit',
1451
- };
1452
- Icon.displayName = 'Icon';
1453
-
1454
- var IconButton = forwardRef(function (props, ref) {
1455
- return React__default.createElement(MuiIconButton, __assign({ ref: ref }, props));
1456
- });
1457
- IconButton.displayName = 'IconButton';
1458
- IconButton.defaultProps = {
1459
- color: 'secondary',
1460
- };
1461
-
1462
- var useTypographyStyles = makeStyles$1(function () {
1463
- var _a;
1464
- return ({
1465
- root: (_a = {},
1466
- _a["& ." + iconStaticClassName] = {
1467
- position: 'relative',
1468
- top: '0.125em',
1469
- padding: '0 0.125em',
1470
- boxSizing: 'content-box',
1471
- },
1472
- _a),
1473
- caption: {
1474
- display: 'inline',
1475
- },
1476
- overline: {
1477
- display: 'inline',
1478
- },
1479
- });
1480
- });
1481
-
1482
- var Typography = forwardRef(function (props, ref) {
1483
- var classes = useTypographyStyles(props);
1484
- return React__default.createElement(MuiTypography, __assign({ ref: ref, classes: classes }, props));
1485
- });
1486
- Typography.displayName = 'Typography';
1487
-
1488
- var useStyles$1 = makeStyles(function (_a) {
1489
- var spacing = _a.spacing;
1490
- return ({
1491
- root: {
1492
- '&:last-child': {
1493
- marginBottom: 0,
1494
- },
1495
- marginBottom: spacing(4),
1496
- padding: spacing(4),
1497
- },
1498
- });
1499
- });
1500
- var Paper = forwardRef(function (props, ref) {
1501
- var legacyStyles = props.legacyStyles, restProps = __rest(props, ["legacyStyles"]);
1502
- var classes = useStyles$1(props);
1503
- return React__default.createElement(Paper$1, __assign({}, ref, { classes: __assign({}, (legacyStyles && classes)) }, restProps));
1504
- });
1505
- Paper.displayName = 'Paper';
1506
- Paper.defaultProps = {
1507
- legacyStyles: false,
1508
- };
1509
-
1510
- var AUDIO_PLAYER_EVENT_TYPES;
1511
- (function (AUDIO_PLAYER_EVENT_TYPES) {
1512
- AUDIO_PLAYER_EVENT_TYPES["TOGGLE_PLAYBACK"] = "TOGGLE_PLAYBACK";
1513
- AUDIO_PLAYER_EVENT_TYPES["TOGGLE_VOLUME_CONTROL"] = "TOGGLE_VOLUME_CONTROL";
1514
- AUDIO_PLAYER_EVENT_TYPES["TOGGLE_MUTE"] = "TOGGLE_MUTE";
1515
- AUDIO_PLAYER_EVENT_TYPES["VOLUME_CHANGE"] = "VOLUME_CHANGE";
1516
- AUDIO_PLAYER_EVENT_TYPES["TIME_CHANGE"] = "TIME_CHANGE";
1517
- AUDIO_PLAYER_EVENT_TYPES["DURATION_CHANGE"] = "DURATION_CHANGE";
1518
- AUDIO_PLAYER_EVENT_TYPES["SET_TIME"] = "SET_TIME";
1519
- AUDIO_PLAYER_EVENT_TYPES["CAN_PLAY"] = "CAN_PLAY";
1520
- })(AUDIO_PLAYER_EVENT_TYPES || (AUDIO_PLAYER_EVENT_TYPES = {}));
1521
- var PLAYBACK_STATES;
1522
- (function (PLAYBACK_STATES) {
1523
- PLAYBACK_STATES["NONE"] = "NONE";
1524
- PLAYBACK_STATES["PLAYABLE"] = "PLAYABLE";
1525
- PLAYBACK_STATES["PAUSED"] = "PAUSED";
1526
- PLAYBACK_STATES["PLAYING"] = "PLAYING";
1527
- })(PLAYBACK_STATES || (PLAYBACK_STATES = {}));
1528
- var CONTROL_LABELS;
1529
- (function (CONTROL_LABELS) {
1530
- CONTROL_LABELS["PAUSE"] = "PAUSE";
1531
- CONTROL_LABELS["PLAY"] = "PLAY";
1532
- CONTROL_LABELS["MUTE"] = "MUTE";
1533
- CONTROL_LABELS["UNMUTE"] = "UNMUTE";
1534
- })(CONTROL_LABELS || (CONTROL_LABELS = {}));
1535
- var VOLUME_CONTROL_STATES;
1536
- (function (VOLUME_CONTROL_STATES) {
1537
- VOLUME_CONTROL_STATES["SHOW"] = "SHOW";
1538
- VOLUME_CONTROL_STATES["HIDE"] = "HIDE";
1539
- })(VOLUME_CONTROL_STATES || (VOLUME_CONTROL_STATES = {}));
1540
-
1541
- var initialAudioPlayerState = {
1542
- playback: PLAYBACK_STATES.NONE,
1543
- volumeControls: VOLUME_CONTROL_STATES.HIDE,
1544
- context: {
1545
- volume: 100,
1546
- playbackButtonLabel: CONTROL_LABELS.PLAY,
1547
- volumeButtonLabel: CONTROL_LABELS.MUTE,
1548
- },
1549
- };
1550
- var audioPlayerReducer = function (state, event) {
1551
- var _a, _b;
1552
- console.log(event.type);
1553
- var audioRef = state.context.audioRef;
1554
- var nextState = __assign({}, state);
1555
- switch (state.playback) {
1556
- case PLAYBACK_STATES.NONE:
1557
- if (event.type === AUDIO_PLAYER_EVENT_TYPES.CAN_PLAY) {
1558
- nextState.playback = PLAYBACK_STATES.PAUSED;
1559
- return nextState;
1560
- }
1561
- break;
1562
- case PLAYBACK_STATES.PAUSED:
1563
- if (event.type === AUDIO_PLAYER_EVENT_TYPES.TOGGLE_PLAYBACK) {
1564
- (_a = audioRef.current) === null || _a === void 0 ? void 0 : _a.play();
1565
- nextState.playback = PLAYBACK_STATES.PLAYING;
1566
- nextState.context.playbackButtonLabel = CONTROL_LABELS.PAUSE;
1567
- return nextState;
1568
- }
1569
- break;
1570
- case PLAYBACK_STATES.PLAYING:
1571
- if (event.type === AUDIO_PLAYER_EVENT_TYPES.TOGGLE_PLAYBACK) {
1572
- (_b = audioRef.current) === null || _b === void 0 ? void 0 : _b.pause();
1573
- nextState.playback = PLAYBACK_STATES.PAUSED;
1574
- nextState.context.playbackButtonLabel = CONTROL_LABELS.PLAY;
1575
- return nextState;
1576
- }
1577
- if (event.type === AUDIO_PLAYER_EVENT_TYPES.TIME_CHANGE) {
1578
- // time change is managed by audioRef automatically, return state to force re-render so ui stays synced
1579
- return nextState;
1580
- }
1581
- break;
1582
- }
1583
- switch (state.volumeControls) {
1584
- case VOLUME_CONTROL_STATES.SHOW:
1585
- if (event.type === AUDIO_PLAYER_EVENT_TYPES.TOGGLE_VOLUME_CONTROL) {
1586
- nextState.volumeControls = VOLUME_CONTROL_STATES.HIDE;
1587
- return nextState;
1588
- }
1589
- if (event.type === AUDIO_PLAYER_EVENT_TYPES.VOLUME_CHANGE) {
1590
- if (nextState.context.volume !== event.context.volume) {
1591
- nextState.context.volume = event.context.volume;
1592
- if (audioRef.current) {
1593
- audioRef.current.volume = event.context.volume;
1594
- }
1595
- return nextState;
1596
- }
1597
- }
1598
- break;
1599
- case VOLUME_CONTROL_STATES.HIDE:
1600
- if (event.type === AUDIO_PLAYER_EVENT_TYPES.TOGGLE_VOLUME_CONTROL) {
1601
- nextState.volumeControls = VOLUME_CONTROL_STATES.SHOW;
1602
- return nextState;
1603
- }
1604
- break;
1605
- }
1606
- switch (event.type) {
1607
- case AUDIO_PLAYER_EVENT_TYPES.TOGGLE_MUTE:
1608
- if (audioRef.current) {
1609
- audioRef.current.muted = !audioRef.current.muted;
1610
- return nextState;
1611
- }
1612
- break;
1613
- case AUDIO_PLAYER_EVENT_TYPES.SET_TIME:
1614
- if (audioRef.current) {
1615
- audioRef.current.currentTime = event.context.time;
1616
- return nextState;
1617
- }
1618
- break;
1619
- }
1620
- return state;
1621
- };
1622
-
1623
- var _path$3K;
1624
-
1625
- function _extends$3$() { _extends$3$ = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$3$.apply(this, arguments); }
1626
-
1627
- function SvgMore(props) {
1628
- return /*#__PURE__*/React.createElement("svg", _extends$3$({
1629
- viewBox: "0 0 16 16",
1630
- strokeLinecap: "round",
1631
- strokeLinejoin: "round",
1632
- stroke: "currentColor",
1633
- width: "1em",
1634
- height: "1em",
1635
- fill: "none"
1636
- }, props), _path$3K || (_path$3K = /*#__PURE__*/React.createElement("path", {
1637
- d: "M8 8.667a.667.667 0 100-1.334.667.667 0 000 1.334zM8 4a.667.667 0 100-1.333A.667.667 0 008 4zm0 9.333A.667.667 0 108 12a.667.667 0 000 1.333z"
1638
- })));
1639
- }
1640
-
1641
- var _path$2X;
1642
-
1643
- function _extends$3b() { _extends$3b = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$3b.apply(this, arguments); }
1644
-
1645
- function SvgChevronDown(props) {
1646
- return /*#__PURE__*/React.createElement("svg", _extends$3b({
1647
- viewBox: "0 0 16 16",
1648
- strokeLinecap: "round",
1649
- strokeLinejoin: "round",
1650
- stroke: "currentColor",
1651
- width: "1em",
1652
- height: "1em",
1653
- fill: "none"
1654
- }, props), _path$2X || (_path$2X = /*#__PURE__*/React.createElement("path", {
1655
- d: "M4 6l4 4 4-4"
1656
- })));
1657
- }
1658
-
1659
- var _path$2W;
1660
-
1661
- function _extends$3a() { _extends$3a = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$3a.apply(this, arguments); }
1662
-
1663
- function SvgChevronUp(props) {
1664
- return /*#__PURE__*/React.createElement("svg", _extends$3a({
1665
- viewBox: "0 0 16 16",
1666
- strokeLinecap: "round",
1667
- strokeLinejoin: "round",
1668
- stroke: "currentColor",
1669
- width: "1em",
1670
- height: "1em",
1671
- fill: "none"
1672
- }, props), _path$2W || (_path$2W = /*#__PURE__*/React.createElement("path", {
1673
- d: "M12 10L8 6l-4 4"
1674
- })));
1675
- }
1676
-
1677
- var _path$1f;
1678
-
1679
- function _extends$1p() { _extends$1p = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$1p.apply(this, arguments); }
1680
-
1681
- function SvgPause(props) {
1682
- return /*#__PURE__*/React.createElement("svg", _extends$1p({
1683
- viewBox: "0 0 16 16",
1684
- strokeLinecap: "round",
1685
- strokeLinejoin: "round",
1686
- stroke: "currentColor",
1687
- width: "1em",
1688
- height: "1em",
1689
- fill: "none"
1690
- }, props), _path$1f || (_path$1f = /*#__PURE__*/React.createElement("path", {
1691
- d: "M6.667 2.667H4v10.666h2.667V2.667zm5.333 0H9.333v10.666H12V2.667z"
1692
- })));
1693
- }
1694
-
1695
- var _path$1d;
1696
-
1697
- function _extends$1n() { _extends$1n = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$1n.apply(this, arguments); }
1698
-
1699
- function SvgPlay(props) {
1700
- return /*#__PURE__*/React.createElement("svg", _extends$1n({
1701
- viewBox: "0 0 16 16",
1702
- strokeLinecap: "round",
1703
- strokeLinejoin: "round",
1704
- stroke: "currentColor",
1705
- width: "1em",
1706
- height: "1em",
1707
- fill: "none"
1708
- }, props), _path$1d || (_path$1d = /*#__PURE__*/React.createElement("path", {
1709
- d: "M3.333 2l9.334 6-9.334 6V2z"
1710
- })));
1711
- }
1712
-
1713
- var _path$10;
1714
-
1715
- function _extends$1a() { _extends$1a = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$1a.apply(this, arguments); }
1716
-
1717
- function SvgVolumeDown(props) {
1718
- return /*#__PURE__*/React.createElement("svg", _extends$1a({
1719
- viewBox: "0 0 16 16",
1720
- strokeLinecap: "round",
1721
- strokeLinejoin: "round",
1722
- stroke: "currentColor",
1723
- width: "1em",
1724
- height: "1em",
1725
- fill: "none"
1726
- }, props), _path$10 || (_path$10 = /*#__PURE__*/React.createElement("path", {
1727
- d: "M8.999 3.333L5.665 6H3v4h2.666L9 12.667V3.333zm3.026 2.307a3.333 3.333 0 010 4.713"
1728
- })));
1729
- }
1730
-
1731
- var _path$$;
1732
-
1733
- function _extends$19() { _extends$19 = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$19.apply(this, arguments); }
1734
-
1735
- function SvgVolumeMute(props) {
1736
- return /*#__PURE__*/React.createElement("svg", _extends$19({
1737
- viewBox: "0 0 16 16",
1738
- strokeLinecap: "round",
1739
- strokeLinejoin: "round",
1740
- stroke: "currentColor",
1741
- width: "1em",
1742
- height: "1em",
1743
- fill: "none"
1744
- }, props), _path$$ || (_path$$ = /*#__PURE__*/React.createElement("path", {
1745
- d: "M7.333 3.333L4 6H1.333v4H4l3.333 2.667V3.333z"
1746
- })));
1747
- }
1748
-
1749
- var _path$_;
1750
-
1751
- function _extends$18() { _extends$18 = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$18.apply(this, arguments); }
1752
-
1753
- function SvgVolumeOff(props) {
1754
- return /*#__PURE__*/React.createElement("svg", _extends$18({
1755
- viewBox: "0 0 16 16",
1756
- strokeLinecap: "round",
1757
- strokeLinejoin: "round",
1758
- stroke: "currentColor",
1759
- width: "1em",
1760
- height: "1em",
1761
- fill: "none"
1762
- }, props), _path$_ || (_path$_ = /*#__PURE__*/React.createElement("path", {
1763
- d: "M7.333 3.333L4 6H1.333v4H4l3.333 2.667V3.333zm8 2.667l-4 4m0-4l4 4"
1764
- })));
1765
- }
1766
-
1767
- var _path$Z;
1768
-
1769
- function _extends$17() { _extends$17 = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$17.apply(this, arguments); }
1770
-
1771
- function SvgVolumeUp(props) {
1772
- return /*#__PURE__*/React.createElement("svg", _extends$17({
1773
- viewBox: "0 0 16 16",
1774
- strokeLinecap: "round",
1775
- strokeLinejoin: "round",
1776
- stroke: "currentColor",
1777
- width: "1em",
1778
- height: "1em",
1779
- fill: "none"
1780
- }, props), _path$Z || (_path$Z = /*#__PURE__*/React.createElement("path", {
1781
- d: "M7.333 3.333L4 6H1.333v4H4l3.333 2.667V3.333zm5.38-.046a6.667 6.667 0 010 9.426M10.36 5.64a3.333 3.333 0 010 4.713"
1782
- })));
1783
- }
1784
-
1785
- var usePlaybackIcon = function (state) {
1786
- var _a;
1787
- var options = (_a = {},
1788
- _a[PLAYBACK_STATES.PAUSED] = SvgPlay,
1789
- _a[PLAYBACK_STATES.PLAYING] = SvgPause,
1790
- _a[PLAYBACK_STATES.NONE] = SvgPlay,
1791
- _a[PLAYBACK_STATES.PLAYABLE] = SvgPlay,
1792
- _a);
1793
- return options[state.playback];
1794
- };
1795
-
1796
- var useVolumeIcon = function (state) {
1797
- var volumeIcon = SvgVolumeUp;
1798
- if (state.context.volume >= 0.5) {
1799
- volumeIcon = SvgVolumeUp;
1800
- }
1801
- else if (state.context.volume < 0.5 && state.context.volume > 0) {
1802
- volumeIcon = SvgVolumeDown;
1803
- }
1804
- else if (state.context.volume === 0) {
1805
- volumeIcon = SvgVolumeMute;
1806
- }
1807
- if (state.context.audioRef.current) {
1808
- if (state.context.audioRef.current.muted) {
1809
- volumeIcon = SvgVolumeOff;
1810
- }
1811
- }
1812
- return volumeIcon;
1813
- };
1814
-
1815
- var appendZero = function (num) { return (num < 10 ? "0" + num : num); };
1816
- var formatTime = function (time, remaning) {
1817
- if (remaning === void 0) { remaning = false; }
1818
- var dateTime = new Date(0, 0, 0, 0, 0, time, 0);
1819
- var dateTimeH = appendZero(dateTime.getHours());
1820
- var dateTimeM = appendZero(dateTime.getMinutes());
1821
- var dateTimeS = appendZero(dateTime.getSeconds());
1822
- var minus = remaning ? '-' : '';
1823
- return dateTimeH > 0 ? "" + minus + dateTimeH + ":" + dateTimeM + ":" + dateTimeS : "" + minus + dateTimeM + ":" + dateTimeS;
1824
- };
1825
-
1826
- var setupAudioRef = function (config) { return function () {
1827
- var _a, _b, _c;
1828
- var audioRef = config.audioRef, send = config.send;
1829
- var handleDurationChange = function (event) {
1830
- var duration = event.target.duration;
1831
- send({ type: AUDIO_PLAYER_EVENT_TYPES.DURATION_CHANGE, context: { duration: duration } });
1832
- };
1833
- var handleTimeUpdate = function (event) {
1834
- var currentTime = event.target.currentTime;
1835
- send({ type: AUDIO_PLAYER_EVENT_TYPES.TIME_CHANGE, context: { currentTime: currentTime } });
1836
- };
1837
- var handleCanPlay = function () {
1838
- send({ type: AUDIO_PLAYER_EVENT_TYPES.CAN_PLAY });
1839
- };
1840
- (_a = audioRef.current) === null || _a === void 0 ? void 0 : _a.addEventListener('durationchange', handleDurationChange);
1841
- (_b = audioRef.current) === null || _b === void 0 ? void 0 : _b.addEventListener('timeupdate', handleTimeUpdate);
1842
- (_c = audioRef.current) === null || _c === void 0 ? void 0 : _c.addEventListener('canplay', handleCanPlay);
1843
- return function () {
1844
- var _a, _b, _c;
1845
- (_a = audioRef.current) === null || _a === void 0 ? void 0 : _a.removeEventListener('durationchange', handleDurationChange);
1846
- (_b = audioRef.current) === null || _b === void 0 ? void 0 : _b.removeEventListener('timeupdate', handleTimeUpdate);
1847
- (_c = audioRef.current) === null || _c === void 0 ? void 0 : _c.removeEventListener('canplay', handleCanPlay);
1848
- };
1849
- }; };
1850
-
1851
- var AudioPlayer = function (props) {
1852
- var _a, _b, _c, _d;
1853
- var src = props.src;
1854
- var volumeRef = useRef(null);
1855
- var audioRef = useRef(null);
1856
- var _f = useState(false), disableRipple = _f[0], setDisableRipple = _f[1];
1857
- var _g = useReducer(audioPlayerReducer, __assign(__assign({}, initialAudioPlayerState), { context: __assign(__assign({}, initialAudioPlayerState.context), { audioRef: audioRef }) })), state = _g[0], send = _g[1];
1858
- useEffect(setupAudioRef({ audioRef: audioRef, send: send }), [audioRef]);
1859
- var PlaybackIcon = usePlaybackIcon(state);
1860
- var VolumeIcon = useVolumeIcon(state);
1861
- var togglePlayback = function () { return send({ type: AUDIO_PLAYER_EVENT_TYPES.TOGGLE_PLAYBACK }); };
1862
- var toggleVolumeControl = function () { return send({ type: AUDIO_PLAYER_EVENT_TYPES.TOGGLE_VOLUME_CONTROL }); };
1863
- var toggleMute = function () { return send({ type: AUDIO_PLAYER_EVENT_TYPES.TOGGLE_MUTE }); };
1864
- var setTime = function (_e, time) { return send({ type: AUDIO_PLAYER_EVENT_TYPES.SET_TIME, context: { time: time } }); };
1865
- var setVolume = function (_e, volume) { return send({ type: AUDIO_PLAYER_EVENT_TYPES.VOLUME_CHANGE, context: { volume: volume } }); };
1866
- return (React__default.createElement(Box, { display: "flex", alignItems: "center", gap: 1 },
1867
- React__default.createElement("audio", { ref: audioRef, src: src }),
1868
- React__default.createElement(Box, null,
1869
- React__default.createElement(IconButton, { "aria-label": state.context.playbackButtonLabel, disabled: state.playback === PLAYBACK_STATES.NONE, onClick: togglePlayback },
1870
- React__default.createElement(Icon, { icon: PlaybackIcon })),
1871
- React__default.createElement(IconButton, { "aria-label": state.context.volumeButtonLabel, ref: volumeRef, onClick: toggleMute, onMouseEnter: toggleVolumeControl, onMouseLeave: toggleVolumeControl, disableRipple: disableRipple },
1872
- React__default.createElement(Icon, { icon: VolumeIcon }),
1873
- React__default.createElement(Popper, { onClick: function (e) { return e.stopPropagation(); }, onMouseEnter: function () { return setDisableRipple(true); }, onMouseLeave: function () { return setDisableRipple(false); }, open: state.volumeControls === VOLUME_CONTROL_STATES.SHOW, anchorEl: function () { return volumeRef.current; }, transition: true, placement: "top" }, function (_a) {
1874
- var TransitionProps = _a.TransitionProps;
1875
- return (React__default.createElement(Grow, __assign({}, TransitionProps),
1876
- React__default.createElement(Paper, { elevation: 1 },
1877
- React__default.createElement(Box, { py: 1, height: 80 },
1878
- React__default.createElement(Slider, { color: "secondary", orientation: "vertical", value: state.context.volume, onChange: setVolume, max: 1, step: 0.01 })))));
1879
- }))),
1880
- React__default.createElement(Box, { display: "flex", flexGrow: 1, alignItems: "center", gap: 1 },
1881
- React__default.createElement(Box, { flexBasis: 60 },
1882
- React__default.createElement(Typography, null, formatTime(((_a = state.context.audioRef.current) === null || _a === void 0 ? void 0 : _a.currentTime) || 0))),
1883
- React__default.createElement(Slider, { color: "secondary", value: ((_b = state.context.audioRef.current) === null || _b === void 0 ? void 0 : _b.currentTime) || 0, max: ((_c = state.context.audioRef.current) === null || _c === void 0 ? void 0 : _c.duration) || 1, onChange: setTime, disabled: state.playback === PLAYBACK_STATES.NONE }),
1884
- React__default.createElement(Box, { flexBasis: 60, textAlign: "end" },
1885
- React__default.createElement(Typography, null, formatTime(((_d = state.context.audioRef.current) === null || _d === void 0 ? void 0 : _d.duration) || 0))))));
1886
- };
1887
-
1888
- var LoadingStatus;
1889
- (function (LoadingStatus) {
1890
- LoadingStatus["ERROR"] = "ERROR";
1891
- LoadingStatus["LOADED"] = "LOADED";
1892
- LoadingStatus["PENDING"] = "PENDING";
1893
- })(LoadingStatus || (LoadingStatus = {}));
1894
- /**
1895
- * Hook returns [imgProps, loaded]
1896
- * ref: Merged default and provided imgProp object. Includes load and error events for img tag. To be passed to MuiAvatar.
1897
- * loaded: Indicates whether the src supplied to an img within Avatar results in loaded or error
1898
- */
1899
- var useImgProps = function (avatarProps) {
1900
- var _a = React__default.useState(LoadingStatus.PENDING), loaded = _a[0], setLoaded = _a[1];
1901
- var imgProps = __assign(__assign({}, avatarProps.imgProps), { onError: function (event) {
1902
- var _a, _b;
1903
- setLoaded(LoadingStatus.ERROR);
1904
- (_b = (_a = avatarProps.imgProps) === null || _a === void 0 ? void 0 : _a.onError) === null || _b === void 0 ? void 0 : _b.call(_a, event);
1905
- }, onLoad: function (event) {
1906
- var _a, _b;
1907
- setLoaded(LoadingStatus.LOADED);
1908
- (_b = (_a = avatarProps.imgProps) === null || _a === void 0 ? void 0 : _a.onLoad) === null || _b === void 0 ? void 0 : _b.call(_a, event);
1909
- } });
1910
- return { imgProps: imgProps, loaded: loaded };
1911
- };
1912
-
1913
- var getAvatarDimensions = function (theme, props) {
1914
- var factors = {
1915
- 'extra-small': 3,
1916
- small: 4,
1917
- medium: 5,
1918
- large: 6,
1919
- 'extra-large': 12.5,
1920
- };
1921
- var sizeFactor = factors[props.size || 'medium'];
1922
- return theme.spacing(sizeFactor);
1923
- };
1924
- var getAvatarFontSize = function (props) {
1925
- var fontSizes = {
1926
- 'extra-small': '0.75rem',
1927
- small: '1rem',
1928
- medium: '1rem',
1929
- large: '1.25rem',
1930
- 'extra-large': '3.5rem',
1931
- };
1932
- return fontSizes[props.size || 'medium'];
1933
- };
1934
- var getAvatarBackground = function (props) {
1935
- var src = props.src, loaded = props.loaded;
1936
- var background = props.background;
1937
- if (src && loaded === LoadingStatus.LOADED) {
1938
- background = 'transparent';
1939
- }
1940
- return background;
1941
- };
1942
- var useAvatarStyles = makeStyles$1(function (theme) { return ({
1943
- root: {
1944
- width: function (props) { return getAvatarDimensions(theme, props); },
1945
- height: function (props) { return getAvatarDimensions(theme, props); },
1946
- fontSize: function (props) { return getAvatarFontSize(props); },
1947
- backgroundColor: function (props) { return getAvatarBackground(props); },
1948
- color: function (props) { return theme.palette.getContrastText(props.background || '#E0E0E0'); },
1949
- objectFit: function (props) { return props.fit; },
1950
- },
1951
- silhouette: {
1952
- '& path': {
1953
- fill: function (props) { return theme.palette.getContrastText(props.background || '#E0E0E0'); },
1954
- },
1955
- },
1956
- }); });
1957
-
1958
- var _path$2;
1959
-
1960
- function _extends$2() { _extends$2 = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$2.apply(this, arguments); }
1961
-
1962
- function SvgSilhouetteFemale(props) {
1963
- return /*#__PURE__*/React.createElement("svg", _extends$2({
1964
- viewBox: "0 0 300 300",
1965
- fill: "none",
1966
- xmlns: "http://www.w3.org/2000/svg"
1967
- }, props), _path$2 || (_path$2 = /*#__PURE__*/React.createElement("path", {
1968
- d: "M179.417 182.917a3.362 3.362 0 00-2.951 1.076 3.461 3.461 0 00-.875 3.021c1.916 10.069 8.368 23.889 28.173 32.493 2.347 1.014 5.972 1.805 10.57 2.799 17.208 3.722 45.986 9.958 53.055 36.333a3.488 3.488 0 001.622 2.11 3.491 3.491 0 002.639.345 3.488 3.488 0 002.109-1.622 3.473 3.473 0 00.345-2.639c-8.173-30.465-40.777-37.527-58.298-41.319-4.056-.882-7.563-1.639-9.278-2.389-11.903-5.167-19.59-12.833-22.924-22.819 33.07 2.458 48.042-10.716 48.702-11.313a3.469 3.469 0 001.121-2.951 3.478 3.478 0 00-1.732-2.639c-19.084-10.903-19.084-48.577-19.084-62.764 0-39.674-26.722-71.125-60.979-71.618-.326-.011-.652-.018-.979-.021h-.007c-34.757.194-63.035 31.68-63.035 70.194 0 14.188 0 51.868-19.083 62.764a3.5 3.5 0 00-1.73 2.769 3.494 3.494 0 001.313 2.988c.959.743 22.14 16.952 48.202 12.028-3.486 9.569-11.07 16.931-22.625 21.951-1.674.73-5.007 1.528-8.868 2.445-17.64 4.194-50.48 12.007-58.702 42.687a3.481 3.481 0 00.348 2.638 3.475 3.475 0 006.368-.839c7.145-26.694 36.229-33.604 53.597-37.743 4.354-1.035 7.791-1.854 10.028-2.82 19.805-8.604 26.25-22.423 28.173-32.493a3.45 3.45 0 00-1.104-3.243 3.457 3.457 0 00-3.347-.722c-18.799 5.917-36.167-2.222-43.757-6.736 18.132-15.181 18.132-50.118 18.132-65.674 0-34.7 25.18-63.076 56.389-63.263l.736.041c30.778.438 53.986 28.236 53.986 64.667 0 15.562 0 50.576 18.208 65.757-6.271 3.583-20.569 9.382-44.458 6.521z",
1969
- fill: "#2E3042"
1970
- })));
1971
- }
1972
-
1973
- var _path$1;
1974
-
1975
- function _extends$1() { _extends$1 = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$1.apply(this, arguments); }
1976
-
1977
- function SvgSilhouetteMale(props) {
1978
- return /*#__PURE__*/React.createElement("svg", _extends$1({
1979
- viewBox: "0 0 300 300",
1980
- fill: "none",
1981
- xmlns: "http://www.w3.org/2000/svg"
1982
- }, props), _path$1 || (_path$1 = /*#__PURE__*/React.createElement("path", {
1983
- d: "M27.594 261.886a3.513 3.513 0 004.281-2.478c7.204-26.904 36.484-33.877 53.984-38.05 4.386-1.043 7.848-1.869 10.1-2.842 19.935-8.66 26.433-22.592 28.377-32.757a3.493 3.493 0 00-.133-1.81 3.492 3.492 0 00-1.021-1.501c-10.38-8.968-19.137-22.431-24.663-37.917a3.447 3.447 0 00-.72-1.197c-7.31-7.953-11.506-16.361-11.506-23.06 0-3.914 1.475-6.539 4.798-8.52a3.5 3.5 0 001.7-2.857c1.545-35.662 26.922-63.735 58.047-63.917l.749.049c31.279.434 56.495 29.11 57.397 65.275a3.487 3.487 0 001.245 2.584c2.189 1.855 3.211 4.207 3.211 7.4 0 5.607-2.987 12.503-8.401 19.406a3.633 3.633 0 00-.587 1.106c-5.596 17.754-15.64 33.429-27.545 43.02a3.517 3.517 0 00-1.245 3.381c1.945 10.159 8.442 24.083 28.377 32.757 2.357 1.022 6.015 1.821 10.653 2.822 17.325 3.752 46.318 10.046 53.431 36.628a3.503 3.503 0 002.926 2.562 3.494 3.494 0 003.922-3.019 3.52 3.52 0 00-.091-1.363c-8.219-30.713-41.065-37.833-58.705-41.655-4.092-.889-7.625-1.652-9.345-2.408-13.01-5.657-21.026-14.275-23.859-25.658 12.08-10.383 22.187-26.401 27.965-44.365 6.134-7.981 9.505-16.2 9.505-23.221 0-4.684-1.511-8.59-4.504-11.643-1.665-39.232-29.636-70.127-64.35-70.624L150.545 38c-34.085.182-62.175 30.264-64.63 68.818-4.379 3.22-6.603 7.736-6.603 13.47 0 8.282 4.68 18.188 12.87 27.275 5.659 15.563 14.43 29.235 24.873 38.805-2.819 11.426-10.842 20.072-23.88 25.735-1.685.735-5.043 1.541-8.932 2.465-17.773 4.228-50.843 12.104-59.125 43.034a3.501 3.501 0 002.476 4.284z",
1984
- fill: "#2E3042"
1985
- })));
1986
- }
1987
-
1988
- var _path;
1989
-
1990
- function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
1991
-
1992
- function SvgSilhouetteNeutral(props) {
1993
- return /*#__PURE__*/React.createElement("svg", _extends({
1994
- viewBox: "0 0 300 300",
1995
- fill: "none",
1996
- xmlns: "http://www.w3.org/2000/svg"
1997
- }, props), _path || (_path = /*#__PURE__*/React.createElement("path", {
1998
- fillRule: "evenodd",
1999
- clipRule: "evenodd",
2000
- d: "M209 121c0 32.585-26.415 59-59 59s-59-26.415-59-59 26.415-59 59-59 59 26.415 59 59zm8 0c0 37.003-29.997 67-67 67s-67-29.997-67-67 29.997-67 67-67 67 29.997 67 67zm35 137.333V284h8v-25.667c0-13.614-5.821-26.671-16.182-36.298C233.456 212.408 219.403 207 204.75 207H94.25c-14.653 0-28.706 5.408-39.068 15.035C44.821 231.662 39 244.719 39 258.333V284h8v-25.667c0-11.295 4.824-22.257 13.628-30.437C69.45 219.698 81.537 215 94.25 215h110.5c12.714 0 24.799 4.698 33.622 12.896 8.804 8.18 13.628 19.142 13.628 30.437z",
2001
- fill: "#2E3042"
2002
- })));
2003
- }
2004
-
2005
- var silhouettes = {
2006
- female: SvgSilhouetteFemale,
2007
- male: SvgSilhouetteMale,
2008
- neutral: SvgSilhouetteNeutral,
2009
- };
2010
- var Avatar = forwardRef(function (props, ref) {
2011
- var children = props.children, _a = props.silhouette, silhouette = _a === void 0 ? 'neutral' : _a, muiProps = __rest(props, ["children", "silhouette"]);
2012
- var _b = useImgProps(props), imgProps = _b.imgProps, loaded = _b.loaded;
2013
- var classes = useAvatarStyles(__assign(__assign({}, props), { loaded: loaded }));
2014
- var Silhouette = silhouettes[silhouette];
2015
- var fallback = muiProps.src || silhouette === 'none' ? '' : React__default.createElement(Silhouette, { className: classes.silhouette });
2016
- return (React__default.createElement(MuiAvatar, __assign({ ref: ref, classes: { root: classes.root } }, muiProps, imgProps), children || fallback));
2017
- });
2018
- Avatar.defaultProps = {
2019
- size: 'medium',
2020
- fit: 'cover',
2021
- background: '#E0E0E0',
2022
- silhouette: 'neutral',
2023
- };
2024
- Avatar.displayName = 'Avatar';
2025
-
2026
- var useButtonStyles = makeStyles$1(function () { return ({
2027
- root: {
2028
- minWidth: 'unset',
2029
- },
2030
- label: {
2031
- textTransform: function (_a) {
2032
- var textTransform = _a.textTransform;
2033
- return textTransform;
2034
- },
2035
- },
2036
- }); });
2037
-
2038
- var Button = forwardRef(function (props, ref) {
2039
- props.textTransform; var loading = props.loading, classesOverride = props.classes, className = props.className, muiProps = __rest(props, ["textTransform", "loading", "classes", "className"]);
2040
- props.classes; var styleProps = __rest(props, ["classes"]);
2041
- var classes = useButtonStyles(styleProps);
2042
- var typography = useTheme().typography;
2043
- var loadingIndicator = {
2044
- startIcon: React__default.createElement(CircularProgress, { color: "inherit", size: typography.button.fontSize }),
2045
- disabled: true,
2046
- };
2047
- return (React__default.createElement(MuiButton, __assign({ ref: ref, classes: __assign(__assign({}, classes), classesOverride), className: classNames([className, 'pm-button']) }, muiProps, (loading && loadingIndicator))));
2048
- });
2049
- Button.displayName = 'Button';
2050
-
2051
- var Checkbox = forwardRef(function (props, ref) {
2052
- var label = props.label, disabled = props.disabled, LabelProps = props.LabelProps, muiProps = __rest(props, ["label", "disabled", "LabelProps"]);
2053
- var control = React__default.createElement(MuiCheckbox, __assign({ disabled: label ? undefined : disabled }, muiProps));
2054
- return label ? (React__default.createElement(FormControlLabel, __assign({ disabled: disabled, inputRef: ref, control: control, label: label }, LabelProps))) : (control);
2055
- });
2056
- Checkbox.displayName = 'Checkbox';
2057
-
2058
- var getFadeStop = function (_a, typographyVariant) {
2059
- var typography = _a.typography;
2060
- return !isNaN(Number(typography[typographyVariant].lineHeight))
2061
- ? typography[typographyVariant].lineHeight + "rem"
2062
- : typography[typographyVariant].lineHeight;
2063
- };
2064
- var useCollapsibleTextStyles = makeStyles(function (theme) { return ({
2065
- overlay: {
2066
- position: 'absolute',
2067
- top: 0,
2068
- left: 0,
2069
- height: '100%',
2070
- width: '100%',
2071
- background: function (props) { return "linear-gradient(to top, white, #FFF0 " + getFadeStop(theme, props.typographyVariant) + ")"; },
2072
- },
2073
- }); });
2074
-
2075
- var CollapsibleText = function (props) {
2076
- var _a = props, text = _a.text, open = _a.open, previewLines = _a.previewLines, _b = _a.typographyVariant, typographyVariant = _b === void 0 ? 'body1' : _b, collapsible = _a.collapsible, setCollapsible = _a.setCollapsible;
2077
- var classes = useCollapsibleTextStyles(props);
2078
- var typographyRef = useRef(null);
2079
- var typography = useTheme$1().typography;
2080
- var collapsedSize = previewLines * parseFloat(typography[typographyVariant].lineHeight);
2081
- useEffect(function () {
2082
- var typographyNode = typographyRef.current;
2083
- var observer = new ResizeObserver(function (entries) {
2084
- var typographyHeight = entries[0].contentRect.height;
2085
- var collapsedPxSize = collapsedSize * 16;
2086
- var collapsible = typographyHeight > collapsedPxSize;
2087
- setCollapsible(collapsible);
2088
- });
2089
- observer.observe(typographyNode);
2090
- return function () {
2091
- observer.unobserve(typographyNode);
2092
- };
2093
- }, []);
2094
- return (React__default.createElement(Fragment, null,
2095
- React__default.createElement(Box, { position: "relative", overflow: "hidden" },
2096
- React__default.createElement(Collapse, { in: open, collapsedSize: collapsedSize + 'rem' },
2097
- React__default.createElement(Typography, { ref: typographyRef, variant: typographyVariant }, text)),
2098
- collapsible && !open && React__default.createElement(Box, { className: classes.overlay }))));
2099
- };
2100
- CollapsibleText.defaultProps = {
2101
- previewLines: 2,
2102
- typographyVariant: 'body1',
2103
- };
2104
-
2105
- var SemanticColors;
2106
- (function (SemanticColors) {
2107
- SemanticColors["PRIMARY_MAIN"] = "primary.main";
2108
- SemanticColors["PRIMARY_DARK"] = "primary.dark";
2109
- SemanticColors["PRIMARY_LIGHT"] = "primary.light";
2110
- SemanticColors["SECONDARY_MAIN"] = "secondary.main";
2111
- SemanticColors["SECONDARY_DARK"] = "secondary.dark";
2112
- SemanticColors["SECONDARY_LIGHT"] = "secondary.light";
2113
- })(SemanticColors || (SemanticColors = {}));
2114
- var useStyles = makeStyles(function (theme) { return ({
2115
- dividerRoot: {
2116
- gap: theme.spacing(2),
2117
- },
2118
- textRoot: {
2119
- color: function (props) {
2120
- var textColor = props.textColor;
2121
- if (Object.values(SemanticColors).includes(textColor)) {
2122
- var _a = textColor.split('.'), semanticColor = _a[0], shade = _a[1];
2123
- return theme.palette[semanticColor][shade];
2124
- }
2125
- else if (textColor) {
2126
- return textColor;
2127
- }
2128
- else {
2129
- return 'black';
2130
- }
2131
- },
2132
- textTransform: function (props) { return props.textTransform; },
2133
- },
2134
- dividerLine: {
2135
- backgroundColor: function (props) {
2136
- var dividerColor = props.dividerColor;
2137
- if (Object.values(SemanticColors).includes(dividerColor)) {
2138
- var _a = dividerColor.split('.'), semanticColor = _a[0], shade = _a[1];
2139
- return theme.palette[semanticColor][shade];
2140
- }
2141
- else if (dividerColor) {
2142
- return dividerColor;
2143
- }
2144
- else {
2145
- return theme.palette.grey[500];
2146
- }
2147
- },
2148
- },
2149
- }); });
2150
- var Divider = function (props) {
2151
- var className = props.className, text = props.text, textTransform = props.textTransform, TypographyProps = props.TypographyProps;
2152
- var classes = useStyles(props);
2153
- var casingOffset = textTransform === 'lowercase' ? '.25rem' : 'unset';
2154
- return (React__default.createElement(Box, { className: classNames([classes.dividerRoot, className]), display: "flex", alignItems: "center" },
2155
- React__default.createElement(Box, { className: classes.dividerLine, display: "flex", flexGrow: 1, height: "1px", marginTop: casingOffset }),
2156
- text && (React__default.createElement(React__default.Fragment, null,
2157
- React__default.createElement(Typography, __assign({ className: classes.textRoot }, TypographyProps), text),
2158
- React__default.createElement(Box, { className: classes.dividerLine, display: "flex", flexGrow: 1, height: "1px", marginTop: casingOffset })))));
2159
- };
2160
- Divider.displayName = 'Divider';
2161
- Divider.defaultProps = {
2162
- textTransform: 'lowercase',
2163
- };
2164
-
2165
- var getLinkColor = function (_a, _b) {
2166
- var palette = _a.palette;
2167
- var _c = _b.color, color = _c === void 0 ? 'info' : _c;
2168
- var resolved;
2169
- if (['primary', 'secondary', 'info', 'error'].includes(color)) {
2170
- resolved = palette[color].main;
2171
- }
2172
- else if (['textPrimary', 'textSecondary'].includes(color)) {
2173
- resolved = palette.text[color.substring(4).toLowerCase()];
2174
- }
2175
- else if (color === 'inherit') {
2176
- resolved = color;
2177
- }
2178
- return resolved;
2179
- };
2180
- var useLinkStyles = makeStyles$1(function (theme) {
2181
- var _a;
2182
- return ({
2183
- root: (_a = {
2184
- display: 'flex',
2185
- color: function (props) { return getLinkColor(theme, props); }
2186
- },
2187
- _a["& ." + iconStaticClassName] = {
2188
- alignSelf: 'center',
2189
- },
2190
- _a),
2191
- });
2192
- });
2193
-
2194
- var Link = forwardRef(function (props, ref) {
2195
- var children = props.children; props.color; var muiProps = __rest(props, ["children", "color"]);
2196
- var classes = useLinkStyles(props);
2197
- return (React__default.createElement(MuiLink, __assign({ ref: ref, classes: { root: classes.root } }, muiProps), children));
2198
- });
2199
- Link.defaultProps = {
2200
- color: 'info',
2201
- variant: 'body1',
2202
- };
2203
- Link.displayName = 'Link';
2204
-
2205
- var PaperContent = function (props) {
2206
- var children = props.children;
2207
- return React__default.createElement(Box, { padding: 4 }, children);
2208
- };
2209
-
2210
- var Radio = forwardRef(function (props, ref) {
2211
- var label = props.label, disabled = props.disabled, LabelProps = props.LabelProps, muiProps = __rest(props, ["label", "disabled", "LabelProps"]);
2212
- var control = React__default.createElement(MuiRadio, __assign({ disabled: label ? undefined : disabled }, muiProps));
2213
- return label ? (React__default.createElement(FormControlLabel, __assign({ disabled: disabled, inputRef: ref, control: control, label: label }, LabelProps))) : (control);
2214
- });
2215
- Radio.displayName = 'Radio';
2216
-
2217
- var useSplitInputStyles = makeStyles$1(function () { return ({
2218
- textfield: {
2219
- background: function (props) { return (props.backgroundTransparency ? '#FFFFFF44' : 'none'); },
2220
- borderTopLeftRadius: 4,
2221
- borderBottomLeftRadius: 4,
2222
- '& fieldset': {
2223
- borderRight: 'none',
2224
- borderTopRightRadius: 0,
2225
- borderBottomRightRadius: 0,
2226
- },
2227
- },
2228
- button: {
2229
- borderTopLeftRadius: 0,
2230
- borderBottomLeftRadius: 0,
2231
- alignSelf: 'stretch',
2232
- },
2233
- input: {
2234
- color: function (props) { return props.inputTextColor || 'inherit'; },
2235
- '&$focused fieldset': {
2236
- top: -4,
2237
- },
2238
- },
2239
- focused: {},
2240
- }); });
2241
-
2242
- var SplitInput = function (props) {
2243
- var TextFieldProps = props.TextFieldProps, ButtonProps = props.ButtonProps, color = props.color, onChange = props.onChange, onClick = props.onClick;
2244
- var classes = useSplitInputStyles(props);
2245
- return (React__default.createElement(Box, { display: "flex" },
2246
- React__default.createElement(TextField, __assign({ classes: { root: classes.textfield }, InputProps: { classes: { root: classes.input, focused: classes.focused } }, color: color, variant: "outlined", onChange: onChange }, TextFieldProps)),
2247
- React__default.createElement(Button, __assign({ classes: { root: classes.button }, disableElevation: true, color: color, variant: "contained", onClick: onClick }, ButtonProps), "Submit")));
2248
- };
2249
- SplitInput.displayName = 'SplitInput';
2250
- SplitInput.defaultProps = {
2251
- backgroundTransparency: true,
2252
- color: 'primary',
2253
- };
2254
-
2255
- var useSwitchStyles = makeStyles$1(function (theme) { return ({
2256
- checked: {
2257
- '& $thumb': {
2258
- background: theme.palette.success.main,
2259
- },
2260
- '&& + $track': {
2261
- backgroundColor: theme.palette.success.main,
2262
- },
2263
- },
2264
- thumb: {},
2265
- track: {},
2266
- }); });
2267
-
2268
- var Switch = forwardRef(function (props, ref) {
2269
- var label = props.label, disabled = props.disabled, LabelProps = props.LabelProps, muiProps = __rest(props, ["label", "disabled", "LabelProps"]);
2270
- var classes = useSwitchStyles(props);
2271
- var control = React__default.createElement(MuiSwitch, __assign({ classes: classes, disabled: label ? undefined : disabled }, muiProps));
2272
- return label ? (React__default.createElement(FormControlLabel, __assign({ disabled: disabled, inputRef: ref, control: control, label: label }, LabelProps))) : (control);
2273
- });
2274
- Switch.displayName = 'Switch';
2275
-
2276
5
  var reactTable = {exports: {}};
2277
6
 
2278
7
  var reactTable_production_min = {exports: {}};
@@ -6858,275 +4587,5 @@ if (process.env.NODE_ENV === 'production') {
6858
4587
  reactTable.exports = reactTable_development.exports;
6859
4588
  }
6860
4589
 
6861
- var TableFooter = function (props) {
6862
- return (React__default.createElement(Box, { display: "flex", justifyContent: "center", alignItems: "end", paddingTop: 3, paddingBottom: 4, flexGrow: 1 }, props.children));
6863
- };
6864
-
6865
- var TableHeader = function (props) {
6866
- var children = props.children, restProps = __rest(props, ["children"]);
6867
- return React__default.createElement("thead", __assign({}, restProps), children);
6868
- };
6869
-
6870
- var getWidth = function (props) {
6871
- var isActionColumn = props.column.isActionColumn, fullWidth = props.tableProps.fullWidth;
6872
- var width;
6873
- if (fullWidth && isActionColumn) {
6874
- width = '0.0000000001%';
6875
- }
6876
- if (fullWidth && !isActionColumn) {
6877
- width = '1%';
6878
- }
6879
- if (!fullWidth && isActionColumn) {
6880
- width = 72;
6881
- }
6882
- if (!fullWidth && !isActionColumn) {
6883
- width = undefined;
6884
- }
6885
- return width;
6886
- };
6887
- var useTableHeaderCellStyles = makeStyles(function (theme) { return ({
6888
- root: function (props) {
6889
- var width = getWidth(props);
6890
- return {
6891
- borderBottomStyle: 'solid',
6892
- borderBottomWidth: 2,
6893
- borderBottomColor: theme.palette.grey[100],
6894
- padding: theme.spacing(2),
6895
- textAlign: 'left',
6896
- fontWeight: 500,
6897
- width: width,
6898
- };
6899
- },
6900
- }); });
6901
-
6902
- var TableHeaderCell = function (props) {
6903
- var children = props.children, column = props.column; props.tableProps; var restProps = __rest(props, ["children", "column", "tableProps"]);
6904
- var root = useTableHeaderCellStyles(props).root;
6905
- var palette = useTheme$1().palette;
6906
- //@ts-expect-error @types/react-table issue
6907
- var canSort = column.canSort, isSorted = column.isSorted, isSortedDesc = column.isSortedDesc, isActionColumn = column.isActionColumn;
6908
- var showSortIndicator = canSort && !isActionColumn;
6909
- return (React__default.createElement("th", __assign({ className: root }, restProps),
6910
- React__default.createElement(Box, { display: "flex", alignItems: "center", gap: 1 },
6911
- children,
6912
- showSortIndicator && (React__default.createElement(Icon, { icon: isSortedDesc ? SvgChevronDown : SvgChevronUp, color: isSorted ? palette.text.primary : palette.text.disabled, size: "large" })))));
6913
- };
6914
-
6915
- var TableHeaderRow = function (props) {
6916
- var children = props.children, restProps = __rest(props, ["children"]);
6917
- return React__default.createElement("tr", __assign({}, restProps), children);
6918
- };
6919
-
6920
- var useTableRowStyles = makeStyles(function (theme) { return ({
6921
- root: function () { return ({
6922
- '&:nth-child(even)': {
6923
- backgroundColor: theme.palette.grey[100],
6924
- },
6925
- }); },
6926
- }); });
6927
-
6928
- var TableRow = function (props) {
6929
- var children = props.children, restProps = __rest(props, ["children"]);
6930
- var root = useTableRowStyles(props).root;
6931
- return (React__default.createElement("tr", __assign({ className: root }, restProps), children));
6932
- };
6933
-
6934
- var TableBody = function (props) {
6935
- var children = props.children, restProps = __rest(props, ["children"]);
6936
- return React__default.createElement("tbody", __assign({}, restProps), children);
6937
- };
6938
-
6939
- var useTableCellStyles = makeStyles(function (theme) { return ({
6940
- root: function () { return ({
6941
- padding: theme.spacing(2),
6942
- }); },
6943
- }); });
6944
-
6945
- var TableCell = function (props) {
6946
- var children = props.children, restProps = __rest(props, ["children"]);
6947
- var root = useTableCellStyles(props).root;
6948
- return (React__default.createElement("td", __assign({ className: root }, restProps), children));
6949
- };
6950
-
6951
- var useTableStyles = makeStyles(function (_a) {
6952
- var typography = _a.typography;
6953
- return ({
6954
- root: function (_a) {
6955
- var fullWidth = _a.fullWidth;
6956
- return ({
6957
- display: fullWidth ? 'flex' : 'inline-flex',
6958
- flexDirection: 'column',
6959
- });
6960
- },
6961
- table: function (_a) {
6962
- var fullWidth = _a.fullWidth;
6963
- return (__assign(__assign({ borderCollapse: 'collapse' }, (fullWidth && { width: '100%' })), typography.body1));
6964
- },
6965
- tableWrap: function () { return ({
6966
- maxWidth: '100%',
6967
- overflowX: 'scroll',
6968
- overflowY: 'hidden',
6969
- }); },
6970
- });
6971
- });
6972
-
6973
- var TableActionsCell = function (props) {
6974
- var _a = props.actions, primary = _a.primary, secondary = _a.secondary, restActions = __rest(_a, ["primary", "secondary"]);
6975
- var _b = React__default.useState(null), anchorEl = _b[0], setAnchorEl = _b[1];
6976
- var openMenu = function (event) {
6977
- setAnchorEl(event.currentTarget);
6978
- };
6979
- var closeMenu = function () {
6980
- setAnchorEl(null);
6981
- };
6982
- var handleItemClick = function (action) {
6983
- action(props.cell);
6984
- closeMenu();
6985
- };
6986
- return (React__default.createElement(Box, { display: "flex" },
6987
- primary && primary.icon && (React__default.createElement(IconButton, { size: "small", onClick: function () { return primary.action(props.cell); } },
6988
- React__default.createElement(Icon, { icon: primary.icon }))),
6989
- secondary && secondary.icon && (React__default.createElement(IconButton, { size: "small", onClick: function () { return secondary.action(props.cell); } },
6990
- React__default.createElement(Icon, { icon: secondary.icon }))),
6991
- restActions && (React__default.createElement(React__default.Fragment, null,
6992
- React__default.createElement(IconButton, { size: "small", onClick: openMenu },
6993
- React__default.createElement(Icon, { icon: SvgMore })),
6994
- React__default.createElement(Menu, { anchorEl: anchorEl, open: Boolean(anchorEl), onClose: closeMenu }, Object.values(restActions).map(function (_a, i) {
6995
- var label = _a.label, action = _a.action;
6996
- return (React__default.createElement(MenuItem, { key: i, onClick: function () { return handleItemClick(action); } }, label));
6997
- }))))));
6998
- };
6999
-
7000
- var makeColumns = function (config) {
7001
- var columns = config.columns, actions = config.actions, actionColumnId = config.actionColumnId;
7002
- var actionColumn;
7003
- var memoizedColumns = __spreadArray([], columns);
7004
- if (actions) {
7005
- var CellComponent = function (props) { return React__default.createElement(TableActionsCell, __assign({}, props, { actions: actions })); };
7006
- actionColumn = {
7007
- id: actionColumnId,
7008
- Header: function () { return null; },
7009
- Cell: CellComponent,
7010
- };
7011
- memoizedColumns = __spreadArray(__spreadArray([], columns), [actionColumn]);
7012
- }
7013
- return memoizedColumns;
7014
- };
7015
-
7016
- /* eslint-disable react/jsx-key */
7017
- var Table = function (props) {
7018
- var actionColumnId = 'table-actions-column';
7019
- var rawColumns = props.columns, data = props.data, actions = props.actions, sortable = props.sortable, emptyMessage = props.emptyMessage, EmptyImage = props.EmptyImage, isLoading = props.loading;
7020
- var classes = useTableStyles(props);
7021
- var columns = useMemo(function () { return makeColumns({ columns: rawColumns, actions: actions, actionColumnId: actionColumnId }); }, [rawColumns, actions]);
7022
- // @ts-expect-error @types/react-table issue
7023
- var instance = reactTable.exports.useTable({ columns: columns, data: data, disableSortBy: !sortable }, reactTable.exports.useSortBy, reactTable.exports.usePagination);
7024
- // @ts-expect-error @types/react-table issue
7025
- var getTableProps = instance.getTableProps, getTableBodyProps = instance.getTableBodyProps, headerGroups = instance.headerGroups, page = instance.page, prepareRow = instance.prepareRow, pageCount = instance.pageCount, gotoPage = instance.gotoPage, state = instance.state, rows = instance.rows;
7026
- var isPaginated = pageCount > 1;
7027
- var isEmpty = rows.length === 0;
7028
- var handlePagination = function (_e, pageNumber) {
7029
- gotoPage(pageNumber - 1);
7030
- };
7031
- return (React__default.createElement(Box, { className: classes.root, minHeight: 706 },
7032
- React__default.createElement(Box, { className: classes.tableWrap },
7033
- React__default.createElement("table", __assign({ className: classes.table }, getTableProps()),
7034
- React__default.createElement(TableHeader, null, headerGroups.map(function (headerGroup) { return (React__default.createElement(TableHeaderRow, __assign({}, headerGroup.getHeaderGroupProps()), headerGroup.headers.map(function (column) { return (React__default.createElement(TableHeaderCell
7035
- // @ts-expect-error @types/react-table issue
7036
- , __assign({}, column.getHeaderProps(column.getSortByToggleProps()), { column: __assign(__assign({}, column), { isActionColumn: column.id === actionColumnId }), tableProps: props }), column.render('Header'))); }))); })),
7037
- !isEmpty && !isLoading && (React__default.createElement(TableBody, __assign({}, getTableBodyProps()), page.map(function (row) {
7038
- prepareRow(row);
7039
- return (React__default.createElement(TableRow, __assign({}, row.getRowProps()), row.cells.map(function (cell) { return (React__default.createElement(TableCell, __assign({}, cell.getCellProps()), cell.render('Cell'))); })));
7040
- }))))),
7041
- isEmpty && (React__default.createElement(Box, { display: "flex", flexDirection: "column", justifyContent: "center", alignItems: "center", p: 2, flexGrow: 1 },
7042
- EmptyImage && EmptyImage(),
7043
- React__default.createElement(Typography, null, emptyMessage))),
7044
- isLoading && (React__default.createElement(Box, { display: "flex", flexDirection: "column", justifyContent: "center", alignItems: "center", p: 2, flexGrow: 1 },
7045
- React__default.createElement(CircularProgress, { size: 80, color: "inherit" }))),
7046
- isPaginated && !isLoading && (React__default.createElement(TableFooter, null,
7047
- React__default.createElement(Pagination, { count: pageCount, page: state.pageIndex + 1, onChange: handlePagination })))));
7048
- };
7049
- Table.defaultProps = {
7050
- emptyMessage: 'No results.',
7051
- };
7052
-
7053
- var useToggleButtonStyles = makeStyles$1(function (theme) { return ({
7054
- root: {
7055
- color: theme.palette.text.primary,
7056
- },
7057
- selected: {
7058
- '&&': {
7059
- '&:hover': {
7060
- backgroundColor: function (props) { return theme.palette[props.color || 'primary'].dark; },
7061
- },
7062
- backgroundColor: function (props) { return theme.palette[props.color || 'primary'].main; },
7063
- color: 'white',
7064
- },
7065
- },
7066
- }); });
7067
-
7068
- var ToggleButton = forwardRef(function (props, ref) {
7069
- var children = props.children, muiProps = __rest(props, ["children"]);
7070
- var classes = useToggleButtonStyles(props);
7071
- return (React__default.createElement(MuiToggleButton, __assign({ ref: ref, classes: {
7072
- root: classes.root,
7073
- selected: classes.selected,
7074
- } }, muiProps), children));
7075
- });
7076
- ToggleButton.defaultProps = {
7077
- color: 'primary',
7078
- };
7079
- ToggleButton.displayName = 'ToggleButton';
7080
-
7081
- var useToggleButtonGroupStyles = makeStyles$1(function (theme) { return ({
7082
- root: {
7083
- '&&': {
7084
- backgroundColor: theme.palette.grey[300],
7085
- },
7086
- },
7087
- }); });
7088
-
7089
- var ToggleButtonGroup = forwardRef(function (props, ref) {
7090
- var children = props.children, _a = props.color, color = _a === void 0 ? 'primary' : _a, muiProps = __rest(props, ["children", "color"]);
7091
- var classes = useToggleButtonGroupStyles(props);
7092
- var childrenWithProps = React__default.Children.map(children, function (child) {
7093
- if (!React__default.isValidElement(child)) {
7094
- return null;
7095
- }
7096
- return React__default.cloneElement(child, { color: color });
7097
- });
7098
- return (React__default.createElement(MuiToggleButtonGroup, __assign({ ref: ref, classes: { root: classes.root } }, muiProps), childrenWithProps));
7099
- });
7100
- ToggleButtonGroup.displayName = 'ToggleButtonGroup';
7101
-
7102
- var useTooltipStyles = makeStyles$1(function (_a) {
7103
- var typography = _a.typography;
7104
- return ({
7105
- tooltip: {
7106
- fontSize: typography.pxToRem(16),
7107
- },
7108
- });
7109
- });
7110
-
7111
- var Tooltip = forwardRef(function (props, ref) {
7112
- var classes = useTooltipStyles(props);
7113
- return React__default.createElement(MuiTooltip, __assign({ ref: ref, classes: classes }, props));
7114
- });
7115
- Tooltip.displayName = 'Tooltip';
7116
-
7117
- var useCollapsibleText = function () {
7118
- var _a = useState(false), open = _a[0], setOpen = _a[1];
7119
- var _b = useState(false), collapsible = _b[0], setCollapsible = _b[1];
7120
- var toggle = function () { return collapsible && setOpen(!open); };
7121
- return {
7122
- collapsibleText: {
7123
- open: open,
7124
- collapsible: collapsible,
7125
- setCollapsible: setCollapsible,
7126
- },
7127
- toggle: toggle,
7128
- };
7129
- };
7130
-
7131
- export { AudioPlayer, Avatar, Box, Button, Checkbox, CollapsibleText, Divider, Icon, IconButton, Link, Paper, PaperContent, Radio, SplitInput, Switch, Table, ToggleButton, ToggleButtonGroup, Tooltip, Typography, useCollapsibleText };
7132
- //# sourceMappingURL=index.es.js.map
4590
+ export { reactTable as r };
4591
+ //# sourceMappingURL=react-table-de7bf68c.js.map