mui-drawer 1.0.19 → 1.0.22
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.
- package/dist/mui-drawer.es.js +11 -3600
- package/package.json +12 -3
package/dist/mui-drawer.es.js
CHANGED
|
@@ -1,163 +1,10 @@
|
|
|
1
|
-
!function(){"use strict";try{if("undefined"!=typeof document){var e=document.createElement("style");e.appendChild(document.createTextNode(".vi-drawer .h-fill{height:-webkit-fill-available}.vi-drawer .safari-flex-container{display:flex;flex-direction:column;height:100%!important}.vi-drawer .d-f{display:flex}.vi-drawer .ai-c{align-items:center}.vi-drawer .jc-sb{justify-content:space-between}.vi-drawer .fd-col{flex-direction:column}.vi-drawer .gap-8{gap:8px}.vi-drawer .MuiDrawer-paper{overflow-y:hidden;max-width:100%}.vi-drawer .drawer-body-pt{padding-top:0}.vi-drawer .drawer-body-pb{padding-bottom:0}.vi-drawer .close-icon{cursor:pointer;color:#717371}.vi-drawer .vi-drawer-actions{position:sticky;bottom:0;padding:24px;background-color:#fff;z-index:50;display:flex;align-items:center;justify-content:flex-end}.vi-drawer .vi-drawer-actions .vi-drawer-action-ctas{display:flex;align-items:center;justify-content:flex-end;gap:16px}.vi-drawer .vi-drawer-actions .vi-drawer-cta{width:50%;align-self:flex-end}.vi-drawer .vi-drawer-actions .vi-drawer-cta.destructive{background-color:#ed1d31}.vi-drawer .vi-drawer-actions.tertiary-cta{justify-content:space-between;gap:16px}.vi-drawer .vi-drawer-actions.tertiary-cta .tertiary-cta-destructive{color:#ed1d31}.vi-drawer .vi-drawer-actions.divider{border-top:1px solid #e9e9e9}.vi-drawer .vi-drawer-title{position:sticky;top:0;padding:24px 24px 28px;background-color:#fff;z-index:50}.vi-drawer .vi-drawer-title .description{margin-top:16px!important}.vi-drawer .drawer-children{padding:24px;overflow-y:auto;height:100%}.vi-drawer .drawer-children.with-header-footer{padding-top:0;padding-bottom:28px;height:calc(100% - 173px)}.vi-drawer .drawer-children.with-header{padding-top:0;height:calc(100% - 80px)}.vi-drawer .drawer-children.with-footer{padding-bottom:28px;height:calc(100% - 93px)}.vi-drawer .drawer-children.no-divider{padding-bottom:0}@media only screen and (max-width:
|
|
2
|
-
import
|
|
3
|
-
import * as React from 'react';
|
|
4
|
-
import { useState, useRef, useEffect } from 'react';
|
|
5
|
-
import { createTheme, Drawer, Typography, Tooltip } from '@mui/material';
|
|
6
|
-
import { createSvgIcon, unstable_useId, capitalize } from '@mui/material/utils';
|
|
7
|
-
import { styled, useTheme, ThemeProvider } from '@mui/material/styles';
|
|
8
|
-
import { useDefaultProps } from '@mui/material/DefaultPropsProvider';
|
|
9
|
-
import Button from '@mui/material/Button';
|
|
10
|
-
import { ButtonGroupContext } from '@mui/material/ButtonGroup';
|
|
11
|
-
import CircularProgress from '@mui/material/CircularProgress';
|
|
12
|
-
|
|
13
|
-
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
14
|
-
|
|
15
|
-
function getDefaultExportFromCjs (x) {
|
|
16
|
-
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
var classnames = {exports: {}};
|
|
20
|
-
|
|
1
|
+
!function(){"use strict";try{if("undefined"!=typeof document){var e=document.createElement("style");e.appendChild(document.createTextNode(".vi-drawer .h-fill{height:-webkit-fill-available}.vi-drawer .safari-flex-container{display:flex;flex-direction:column;height:100%!important}.vi-drawer .d-f{display:flex}.vi-drawer .ai-c{align-items:center}.vi-drawer .jc-sb{justify-content:space-between}.vi-drawer .fd-col{flex-direction:column}.vi-drawer .gap-8{gap:8px}.vi-drawer .MuiDrawer-paper{overflow-y:hidden;max-width:100%}.vi-drawer .drawer-body-pt{padding-top:0}.vi-drawer .drawer-body-pb{padding-bottom:0}.vi-drawer .close-icon{cursor:pointer;color:#717371}.vi-drawer .vi-drawer-actions{position:sticky;bottom:0;padding:24px;background-color:#fff;z-index:50;display:flex;align-items:center;justify-content:flex-end}.vi-drawer .vi-drawer-actions .vi-drawer-action-ctas{display:flex;align-items:center;justify-content:flex-end;gap:16px}.vi-drawer .vi-drawer-actions .vi-drawer-cta{width:50%;align-self:flex-end}.vi-drawer .vi-drawer-actions .vi-drawer-cta.destructive{background-color:#ed1d31}.vi-drawer .vi-drawer-actions.tertiary-cta{justify-content:space-between;gap:16px}.vi-drawer .vi-drawer-actions.tertiary-cta .tertiary-cta-destructive{color:#ed1d31}.vi-drawer .vi-drawer-actions.divider{border-top:1px solid #e9e9e9}.vi-drawer .vi-drawer-title{position:sticky;top:0;padding:24px 24px 28px;background-color:#fff;z-index:50}.vi-drawer .vi-drawer-title .description{margin-top:16px!important}.vi-drawer .drawer-children{padding:24px;overflow-y:auto;height:100%}.vi-drawer .drawer-children.with-header-footer{padding-top:0;padding-bottom:28px;height:calc(100% - 173px)}.vi-drawer .drawer-children.with-header{padding-top:0;height:calc(100% - 80px)}.vi-drawer .drawer-children.with-footer{padding-bottom:28px;height:calc(100% - 93px)}.vi-drawer .drawer-children.no-divider{padding-bottom:0}@media only screen and (max-width:600px){.vi-drawer .MuiPaper-root{margin:0;width:100%;height:100%}.vi-drawer .vi-drawer-actions-wrapper,.vi-drawer .vi-drawer-actions{flex-direction:column-reverse;gap:12px}.vi-drawer .vi-drawer-actions .vi-drawer-action-ctas{flex-direction:column-reverse;width:100%!important;gap:12px}.vi-drawer .vi-drawer-actions .vi-drawer-cta{width:100%}.vi-drawer .drawer-children.one-cta.with-header-footer{height:calc(100% - 170px)}.vi-drawer .drawer-children.one-cta.with-header{height:calc(100% - 80px)}.vi-drawer .drawer-children.one-cta.with-footer{height:calc(100% - 90px)}.vi-drawer .drawer-children.two-ctas.with-header-footer{height:calc(100% - 222px)}.vi-drawer .drawer-children.two-ctas.with-header{height:calc(100% - 80px)}.vi-drawer .drawer-children.two-ctas.with-footer{height:calc(100% - 142px)}.vi-drawer .drawer-children.three-ctas.with-header-footer{height:calc(100% - 259px)}.vi-drawer .drawer-children.three-ctas.with-header{height:calc(100% - 80px)}.vi-drawer .drawer-children.three-ctas.with-footer{height:calc(100% - 179px)}}")),document.head.appendChild(e)}}catch(r){console.error("vite-plugin-css-injected-by-js",r)}}();
|
|
2
|
+
import{jsx as e,jsxs as t}from"react/jsx-runtime";import*as n from"react";import{useState as r,useRef as o,useEffect as i}from"react";import{createTheme as a,Drawer as c,Typography as u,Tooltip as l}from"@mui/material";import{createSvgIcon as s,unstable_useId as f,capitalize as p}from"@mui/material/utils";import{styled as d,useTheme as y,ThemeProvider as g}from"@mui/material/styles";import{useDefaultProps as b}from"@mui/material/DefaultPropsProvider";import h from"@mui/material/Button";import{ButtonGroupContext as m}from"@mui/material/ButtonGroup";import v from"@mui/material/CircularProgress";var S="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function x(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var O,j={exports:{}};
|
|
21
3
|
/*!
|
|
22
4
|
Copyright (c) 2018 Jed Watson.
|
|
23
5
|
Licensed under the MIT License (MIT), see
|
|
24
6
|
http://jedwatson.github.io/classnames
|
|
25
|
-
*/
|
|
26
|
-
|
|
27
|
-
var hasRequiredClassnames;
|
|
28
|
-
|
|
29
|
-
function requireClassnames () {
|
|
30
|
-
if (hasRequiredClassnames) return classnames.exports;
|
|
31
|
-
hasRequiredClassnames = 1;
|
|
32
|
-
(function (module) {
|
|
33
|
-
/* global define */
|
|
34
|
-
|
|
35
|
-
(function () {
|
|
36
|
-
|
|
37
|
-
var hasOwn = {}.hasOwnProperty;
|
|
38
|
-
|
|
39
|
-
function classNames () {
|
|
40
|
-
var classes = '';
|
|
41
|
-
|
|
42
|
-
for (var i = 0; i < arguments.length; i++) {
|
|
43
|
-
var arg = arguments[i];
|
|
44
|
-
if (arg) {
|
|
45
|
-
classes = appendClass(classes, parseValue(arg));
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
return classes;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
function parseValue (arg) {
|
|
53
|
-
if (typeof arg === 'string' || typeof arg === 'number') {
|
|
54
|
-
return arg;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
if (typeof arg !== 'object') {
|
|
58
|
-
return '';
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
if (Array.isArray(arg)) {
|
|
62
|
-
return classNames.apply(null, arg);
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
if (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes('[native code]')) {
|
|
66
|
-
return arg.toString();
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
var classes = '';
|
|
70
|
-
|
|
71
|
-
for (var key in arg) {
|
|
72
|
-
if (hasOwn.call(arg, key) && arg[key]) {
|
|
73
|
-
classes = appendClass(classes, key);
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
return classes;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
function appendClass (value, newClass) {
|
|
81
|
-
if (!newClass) {
|
|
82
|
-
return value;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
if (value) {
|
|
86
|
-
return value + ' ' + newClass;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
return value + newClass;
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
if (module.exports) {
|
|
93
|
-
classNames.default = classNames;
|
|
94
|
-
module.exports = classNames;
|
|
95
|
-
} else {
|
|
96
|
-
window.classNames = classNames;
|
|
97
|
-
}
|
|
98
|
-
}());
|
|
99
|
-
} (classnames));
|
|
100
|
-
return classnames.exports;
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
var classnamesExports = requireClassnames();
|
|
104
|
-
const classNames = /*@__PURE__*/getDefaultExportFromCjs(classnamesExports);
|
|
105
|
-
|
|
106
|
-
const CloseIcon = createSvgIcon(/*#__PURE__*/jsx("path", {
|
|
107
|
-
d: "M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"
|
|
108
|
-
}), 'Close');
|
|
109
|
-
|
|
110
|
-
function _objectWithoutPropertiesLoose(r, e) {
|
|
111
|
-
if (null == r) return {};
|
|
112
|
-
var t = {};
|
|
113
|
-
for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
|
|
114
|
-
if (-1 !== e.indexOf(n)) continue;
|
|
115
|
-
t[n] = r[n];
|
|
116
|
-
}
|
|
117
|
-
return t;
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
function _extends() {
|
|
121
|
-
return _extends = Object.assign ? Object.assign.bind() : function (n) {
|
|
122
|
-
for (var e = 1; e < arguments.length; e++) {
|
|
123
|
-
var t = arguments[e];
|
|
124
|
-
for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
|
|
125
|
-
}
|
|
126
|
-
return n;
|
|
127
|
-
}, _extends.apply(null, arguments);
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
var propTypes = {exports: {}};
|
|
131
|
-
|
|
132
|
-
var reactIs = {exports: {}};
|
|
133
|
-
|
|
134
|
-
var reactIs_production_min = {};
|
|
135
|
-
|
|
136
|
-
/** @license React v16.13.1
|
|
137
|
-
* react-is.production.min.js
|
|
138
|
-
*
|
|
139
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
140
|
-
*
|
|
141
|
-
* This source code is licensed under the MIT license found in the
|
|
142
|
-
* LICENSE file in the root directory of this source tree.
|
|
143
|
-
*/
|
|
144
|
-
|
|
145
|
-
var hasRequiredReactIs_production_min;
|
|
146
|
-
|
|
147
|
-
function requireReactIs_production_min () {
|
|
148
|
-
if (hasRequiredReactIs_production_min) return reactIs_production_min;
|
|
149
|
-
hasRequiredReactIs_production_min = 1;
|
|
150
|
-
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?
|
|
151
|
-
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;
|
|
152
|
-
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;
|
|
153
|
-
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};
|
|
154
|
-
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};
|
|
155
|
-
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;
|
|
156
|
-
return reactIs_production_min;
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
var reactIs_development = {};
|
|
160
|
-
|
|
7
|
+
*/var w,I=(O||(O=1,w=j,function(){var e={}.hasOwnProperty;function t(){for(var e="",t=0;t<arguments.length;t++){var o=arguments[t];o&&(e=r(e,n(o)))}return e}function n(n){if("string"==typeof n||"number"==typeof n)return n;if("object"!=typeof n)return"";if(Array.isArray(n))return t.apply(null,n);if(n.toString!==Object.prototype.toString&&!n.toString.toString().includes("[native code]"))return n.toString();var o="";for(var i in n)e.call(n,i)&&n[i]&&(o=r(o,i));return o}function r(e,t){return t?e?e+" "+t:e+t:e}w.exports?(t.default=t,w.exports=t):window.classNames=t}()),j.exports);const E=/*@__PURE__*/x(I),T=s(/*#__PURE__*/e("path",{d:"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}),"Close");function P(){return P=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},P.apply(null,arguments)}var C,$={exports:{}},L={exports:{}},M={};var N,W,k,z,A,D,R,H,_,B,F,V,U,q,X,G={};
|
|
161
8
|
/** @license React v16.13.1
|
|
162
9
|
* react-is.development.js
|
|
163
10
|
*
|
|
@@ -165,3451 +12,15 @@ var reactIs_development = {};
|
|
|
165
12
|
*
|
|
166
13
|
* This source code is licensed under the MIT license found in the
|
|
167
14
|
* LICENSE file in the root directory of this source tree.
|
|
168
|
-
*/
|
|
169
|
-
|
|
170
|
-
var hasRequiredReactIs_development;
|
|
171
|
-
|
|
172
|
-
function requireReactIs_development () {
|
|
173
|
-
if (hasRequiredReactIs_development) return reactIs_development;
|
|
174
|
-
hasRequiredReactIs_development = 1;
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
if (process.env.NODE_ENV !== "production") {
|
|
179
|
-
(function() {
|
|
180
|
-
|
|
181
|
-
// The Symbol used to tag the ReactElement-like types. If there is no native Symbol
|
|
182
|
-
// nor polyfill, then a plain number is used for performance.
|
|
183
|
-
var hasSymbol = typeof Symbol === 'function' && Symbol.for;
|
|
184
|
-
var REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for('react.element') : 0xeac7;
|
|
185
|
-
var REACT_PORTAL_TYPE = hasSymbol ? Symbol.for('react.portal') : 0xeaca;
|
|
186
|
-
var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for('react.fragment') : 0xeacb;
|
|
187
|
-
var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for('react.strict_mode') : 0xeacc;
|
|
188
|
-
var REACT_PROFILER_TYPE = hasSymbol ? Symbol.for('react.profiler') : 0xead2;
|
|
189
|
-
var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for('react.provider') : 0xeacd;
|
|
190
|
-
var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for('react.context') : 0xeace; // TODO: We don't use AsyncMode or ConcurrentMode anymore. They were temporary
|
|
191
|
-
// (unstable) APIs that have been removed. Can we remove the symbols?
|
|
192
|
-
|
|
193
|
-
var REACT_ASYNC_MODE_TYPE = hasSymbol ? Symbol.for('react.async_mode') : 0xeacf;
|
|
194
|
-
var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for('react.concurrent_mode') : 0xeacf;
|
|
195
|
-
var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for('react.forward_ref') : 0xead0;
|
|
196
|
-
var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for('react.suspense') : 0xead1;
|
|
197
|
-
var REACT_SUSPENSE_LIST_TYPE = hasSymbol ? Symbol.for('react.suspense_list') : 0xead8;
|
|
198
|
-
var REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3;
|
|
199
|
-
var REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 0xead4;
|
|
200
|
-
var REACT_BLOCK_TYPE = hasSymbol ? Symbol.for('react.block') : 0xead9;
|
|
201
|
-
var REACT_FUNDAMENTAL_TYPE = hasSymbol ? Symbol.for('react.fundamental') : 0xead5;
|
|
202
|
-
var REACT_RESPONDER_TYPE = hasSymbol ? Symbol.for('react.responder') : 0xead6;
|
|
203
|
-
var REACT_SCOPE_TYPE = hasSymbol ? Symbol.for('react.scope') : 0xead7;
|
|
204
|
-
|
|
205
|
-
function isValidElementType(type) {
|
|
206
|
-
return typeof type === 'string' || typeof type === 'function' || // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill.
|
|
207
|
-
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);
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
function typeOf(object) {
|
|
211
|
-
if (typeof object === 'object' && object !== null) {
|
|
212
|
-
var $$typeof = object.$$typeof;
|
|
213
|
-
|
|
214
|
-
switch ($$typeof) {
|
|
215
|
-
case REACT_ELEMENT_TYPE:
|
|
216
|
-
var type = object.type;
|
|
217
|
-
|
|
218
|
-
switch (type) {
|
|
219
|
-
case REACT_ASYNC_MODE_TYPE:
|
|
220
|
-
case REACT_CONCURRENT_MODE_TYPE:
|
|
221
|
-
case REACT_FRAGMENT_TYPE:
|
|
222
|
-
case REACT_PROFILER_TYPE:
|
|
223
|
-
case REACT_STRICT_MODE_TYPE:
|
|
224
|
-
case REACT_SUSPENSE_TYPE:
|
|
225
|
-
return type;
|
|
226
|
-
|
|
227
|
-
default:
|
|
228
|
-
var $$typeofType = type && type.$$typeof;
|
|
229
|
-
|
|
230
|
-
switch ($$typeofType) {
|
|
231
|
-
case REACT_CONTEXT_TYPE:
|
|
232
|
-
case REACT_FORWARD_REF_TYPE:
|
|
233
|
-
case REACT_LAZY_TYPE:
|
|
234
|
-
case REACT_MEMO_TYPE:
|
|
235
|
-
case REACT_PROVIDER_TYPE:
|
|
236
|
-
return $$typeofType;
|
|
237
|
-
|
|
238
|
-
default:
|
|
239
|
-
return $$typeof;
|
|
240
|
-
}
|
|
241
|
-
|
|
242
|
-
}
|
|
243
|
-
|
|
244
|
-
case REACT_PORTAL_TYPE:
|
|
245
|
-
return $$typeof;
|
|
246
|
-
}
|
|
247
|
-
}
|
|
248
|
-
|
|
249
|
-
return undefined;
|
|
250
|
-
} // AsyncMode is deprecated along with isAsyncMode
|
|
251
|
-
|
|
252
|
-
var AsyncMode = REACT_ASYNC_MODE_TYPE;
|
|
253
|
-
var ConcurrentMode = REACT_CONCURRENT_MODE_TYPE;
|
|
254
|
-
var ContextConsumer = REACT_CONTEXT_TYPE;
|
|
255
|
-
var ContextProvider = REACT_PROVIDER_TYPE;
|
|
256
|
-
var Element = REACT_ELEMENT_TYPE;
|
|
257
|
-
var ForwardRef = REACT_FORWARD_REF_TYPE;
|
|
258
|
-
var Fragment = REACT_FRAGMENT_TYPE;
|
|
259
|
-
var Lazy = REACT_LAZY_TYPE;
|
|
260
|
-
var Memo = REACT_MEMO_TYPE;
|
|
261
|
-
var Portal = REACT_PORTAL_TYPE;
|
|
262
|
-
var Profiler = REACT_PROFILER_TYPE;
|
|
263
|
-
var StrictMode = REACT_STRICT_MODE_TYPE;
|
|
264
|
-
var Suspense = REACT_SUSPENSE_TYPE;
|
|
265
|
-
var hasWarnedAboutDeprecatedIsAsyncMode = false; // AsyncMode should be deprecated
|
|
266
|
-
|
|
267
|
-
function isAsyncMode(object) {
|
|
268
|
-
{
|
|
269
|
-
if (!hasWarnedAboutDeprecatedIsAsyncMode) {
|
|
270
|
-
hasWarnedAboutDeprecatedIsAsyncMode = true; // Using console['warn'] to evade Babel and ESLint
|
|
271
|
-
|
|
272
|
-
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.');
|
|
273
|
-
}
|
|
274
|
-
}
|
|
275
|
-
|
|
276
|
-
return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;
|
|
277
|
-
}
|
|
278
|
-
function isConcurrentMode(object) {
|
|
279
|
-
return typeOf(object) === REACT_CONCURRENT_MODE_TYPE;
|
|
280
|
-
}
|
|
281
|
-
function isContextConsumer(object) {
|
|
282
|
-
return typeOf(object) === REACT_CONTEXT_TYPE;
|
|
283
|
-
}
|
|
284
|
-
function isContextProvider(object) {
|
|
285
|
-
return typeOf(object) === REACT_PROVIDER_TYPE;
|
|
286
|
-
}
|
|
287
|
-
function isElement(object) {
|
|
288
|
-
return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
|
|
289
|
-
}
|
|
290
|
-
function isForwardRef(object) {
|
|
291
|
-
return typeOf(object) === REACT_FORWARD_REF_TYPE;
|
|
292
|
-
}
|
|
293
|
-
function isFragment(object) {
|
|
294
|
-
return typeOf(object) === REACT_FRAGMENT_TYPE;
|
|
295
|
-
}
|
|
296
|
-
function isLazy(object) {
|
|
297
|
-
return typeOf(object) === REACT_LAZY_TYPE;
|
|
298
|
-
}
|
|
299
|
-
function isMemo(object) {
|
|
300
|
-
return typeOf(object) === REACT_MEMO_TYPE;
|
|
301
|
-
}
|
|
302
|
-
function isPortal(object) {
|
|
303
|
-
return typeOf(object) === REACT_PORTAL_TYPE;
|
|
304
|
-
}
|
|
305
|
-
function isProfiler(object) {
|
|
306
|
-
return typeOf(object) === REACT_PROFILER_TYPE;
|
|
307
|
-
}
|
|
308
|
-
function isStrictMode(object) {
|
|
309
|
-
return typeOf(object) === REACT_STRICT_MODE_TYPE;
|
|
310
|
-
}
|
|
311
|
-
function isSuspense(object) {
|
|
312
|
-
return typeOf(object) === REACT_SUSPENSE_TYPE;
|
|
313
|
-
}
|
|
314
|
-
|
|
315
|
-
reactIs_development.AsyncMode = AsyncMode;
|
|
316
|
-
reactIs_development.ConcurrentMode = ConcurrentMode;
|
|
317
|
-
reactIs_development.ContextConsumer = ContextConsumer;
|
|
318
|
-
reactIs_development.ContextProvider = ContextProvider;
|
|
319
|
-
reactIs_development.Element = Element;
|
|
320
|
-
reactIs_development.ForwardRef = ForwardRef;
|
|
321
|
-
reactIs_development.Fragment = Fragment;
|
|
322
|
-
reactIs_development.Lazy = Lazy;
|
|
323
|
-
reactIs_development.Memo = Memo;
|
|
324
|
-
reactIs_development.Portal = Portal;
|
|
325
|
-
reactIs_development.Profiler = Profiler;
|
|
326
|
-
reactIs_development.StrictMode = StrictMode;
|
|
327
|
-
reactIs_development.Suspense = Suspense;
|
|
328
|
-
reactIs_development.isAsyncMode = isAsyncMode;
|
|
329
|
-
reactIs_development.isConcurrentMode = isConcurrentMode;
|
|
330
|
-
reactIs_development.isContextConsumer = isContextConsumer;
|
|
331
|
-
reactIs_development.isContextProvider = isContextProvider;
|
|
332
|
-
reactIs_development.isElement = isElement;
|
|
333
|
-
reactIs_development.isForwardRef = isForwardRef;
|
|
334
|
-
reactIs_development.isFragment = isFragment;
|
|
335
|
-
reactIs_development.isLazy = isLazy;
|
|
336
|
-
reactIs_development.isMemo = isMemo;
|
|
337
|
-
reactIs_development.isPortal = isPortal;
|
|
338
|
-
reactIs_development.isProfiler = isProfiler;
|
|
339
|
-
reactIs_development.isStrictMode = isStrictMode;
|
|
340
|
-
reactIs_development.isSuspense = isSuspense;
|
|
341
|
-
reactIs_development.isValidElementType = isValidElementType;
|
|
342
|
-
reactIs_development.typeOf = typeOf;
|
|
343
|
-
})();
|
|
344
|
-
}
|
|
345
|
-
return reactIs_development;
|
|
346
|
-
}
|
|
347
|
-
|
|
348
|
-
var hasRequiredReactIs;
|
|
349
|
-
|
|
350
|
-
function requireReactIs () {
|
|
351
|
-
if (hasRequiredReactIs) return reactIs.exports;
|
|
352
|
-
hasRequiredReactIs = 1;
|
|
353
|
-
|
|
354
|
-
if (process.env.NODE_ENV === 'production') {
|
|
355
|
-
reactIs.exports = requireReactIs_production_min();
|
|
356
|
-
} else {
|
|
357
|
-
reactIs.exports = requireReactIs_development();
|
|
358
|
-
}
|
|
359
|
-
return reactIs.exports;
|
|
360
|
-
}
|
|
361
|
-
|
|
15
|
+
*/function Y(){return W||(W=1,"production"===process.env.NODE_ENV?L.exports=function(){if(C)return M;C=1;var e="function"==typeof Symbol&&Symbol.for,t=e?Symbol.for("react.element"):60103,n=e?Symbol.for("react.portal"):60106,r=e?Symbol.for("react.fragment"):60107,o=e?Symbol.for("react.strict_mode"):60108,i=e?Symbol.for("react.profiler"):60114,a=e?Symbol.for("react.provider"):60109,c=e?Symbol.for("react.context"):60110,u=e?Symbol.for("react.async_mode"):60111,l=e?Symbol.for("react.concurrent_mode"):60111,s=e?Symbol.for("react.forward_ref"):60112,f=e?Symbol.for("react.suspense"):60113,p=e?Symbol.for("react.suspense_list"):60120,d=e?Symbol.for("react.memo"):60115,y=e?Symbol.for("react.lazy"):60116,g=e?Symbol.for("react.block"):60121,b=e?Symbol.for("react.fundamental"):60117,h=e?Symbol.for("react.responder"):60118,m=e?Symbol.for("react.scope"):60119;function v(e){if("object"==typeof e&&null!==e){var p=e.$$typeof;switch(p){case t:switch(e=e.type){case u:case l:case r:case i:case o:case f:return e;default:switch(e=e&&e.$$typeof){case c:case s:case y:case d:case a:return e;default:return p}}case n:return p}}}function S(e){return v(e)===l}return M.AsyncMode=u,M.ConcurrentMode=l,M.ContextConsumer=c,M.ContextProvider=a,M.Element=t,M.ForwardRef=s,M.Fragment=r,M.Lazy=y,M.Memo=d,M.Portal=n,M.Profiler=i,M.StrictMode=o,M.Suspense=f,M.isAsyncMode=function(e){return S(e)||v(e)===u},M.isConcurrentMode=S,M.isContextConsumer=function(e){return v(e)===c},M.isContextProvider=function(e){return v(e)===a},M.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===t},M.isForwardRef=function(e){return v(e)===s},M.isFragment=function(e){return v(e)===r},M.isLazy=function(e){return v(e)===y},M.isMemo=function(e){return v(e)===d},M.isPortal=function(e){return v(e)===n},M.isProfiler=function(e){return v(e)===i},M.isStrictMode=function(e){return v(e)===o},M.isSuspense=function(e){return v(e)===f},M.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===r||e===l||e===i||e===o||e===f||e===p||"object"==typeof e&&null!==e&&(e.$$typeof===y||e.$$typeof===d||e.$$typeof===a||e.$$typeof===c||e.$$typeof===s||e.$$typeof===b||e.$$typeof===h||e.$$typeof===m||e.$$typeof===g)},M.typeOf=v,M}():L.exports=(N||(N=1,"production"!==process.env.NODE_ENV&&function(){var e="function"==typeof Symbol&&Symbol.for,t=e?Symbol.for("react.element"):60103,n=e?Symbol.for("react.portal"):60106,r=e?Symbol.for("react.fragment"):60107,o=e?Symbol.for("react.strict_mode"):60108,i=e?Symbol.for("react.profiler"):60114,a=e?Symbol.for("react.provider"):60109,c=e?Symbol.for("react.context"):60110,u=e?Symbol.for("react.async_mode"):60111,l=e?Symbol.for("react.concurrent_mode"):60111,s=e?Symbol.for("react.forward_ref"):60112,f=e?Symbol.for("react.suspense"):60113,p=e?Symbol.for("react.suspense_list"):60120,d=e?Symbol.for("react.memo"):60115,y=e?Symbol.for("react.lazy"):60116,g=e?Symbol.for("react.block"):60121,b=e?Symbol.for("react.fundamental"):60117,h=e?Symbol.for("react.responder"):60118,m=e?Symbol.for("react.scope"):60119;function v(e){if("object"==typeof e&&null!==e){var p=e.$$typeof;switch(p){case t:var g=e.type;switch(g){case u:case l:case r:case i:case o:case f:return g;default:var b=g&&g.$$typeof;switch(b){case c:case s:case y:case d:case a:return b;default:return p}}case n:return p}}}var S=u,x=l,O=c,j=a,w=t,I=s,E=r,T=y,P=d,C=n,$=i,L=o,M=f,N=!1;function W(e){return v(e)===l}G.AsyncMode=S,G.ConcurrentMode=x,G.ContextConsumer=O,G.ContextProvider=j,G.Element=w,G.ForwardRef=I,G.Fragment=E,G.Lazy=T,G.Memo=P,G.Portal=C,G.Profiler=$,G.StrictMode=L,G.Suspense=M,G.isAsyncMode=function(e){return N||(N=!0),W(e)||v(e)===u},G.isConcurrentMode=W,G.isContextConsumer=function(e){return v(e)===c},G.isContextProvider=function(e){return v(e)===a},G.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===t},G.isForwardRef=function(e){return v(e)===s},G.isFragment=function(e){return v(e)===r},G.isLazy=function(e){return v(e)===y},G.isMemo=function(e){return v(e)===d},G.isPortal=function(e){return v(e)===n},G.isProfiler=function(e){return v(e)===i},G.isStrictMode=function(e){return v(e)===o},G.isSuspense=function(e){return v(e)===f},G.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===r||e===l||e===i||e===o||e===f||e===p||"object"==typeof e&&null!==e&&(e.$$typeof===y||e.$$typeof===d||e.$$typeof===a||e.$$typeof===c||e.$$typeof===s||e.$$typeof===b||e.$$typeof===h||e.$$typeof===m||e.$$typeof===g)},G.typeOf=v}()),G)),L.exports}
|
|
362
16
|
/*
|
|
363
17
|
object-assign
|
|
364
18
|
(c) Sindre Sorhus
|
|
365
19
|
@license MIT
|
|
366
|
-
*/
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
hasRequiredObjectAssign = 1;
|
|
374
|
-
/* eslint-disable no-unused-vars */
|
|
375
|
-
var getOwnPropertySymbols = Object.getOwnPropertySymbols;
|
|
376
|
-
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
377
|
-
var propIsEnumerable = Object.prototype.propertyIsEnumerable;
|
|
378
|
-
|
|
379
|
-
function toObject(val) {
|
|
380
|
-
if (val === null || val === undefined) {
|
|
381
|
-
throw new TypeError('Object.assign cannot be called with null or undefined');
|
|
382
|
-
}
|
|
383
|
-
|
|
384
|
-
return Object(val);
|
|
385
|
-
}
|
|
386
|
-
|
|
387
|
-
function shouldUseNative() {
|
|
388
|
-
try {
|
|
389
|
-
if (!Object.assign) {
|
|
390
|
-
return false;
|
|
391
|
-
}
|
|
392
|
-
|
|
393
|
-
// Detect buggy property enumeration order in older V8 versions.
|
|
394
|
-
|
|
395
|
-
// https://bugs.chromium.org/p/v8/issues/detail?id=4118
|
|
396
|
-
var test1 = new String('abc'); // eslint-disable-line no-new-wrappers
|
|
397
|
-
test1[5] = 'de';
|
|
398
|
-
if (Object.getOwnPropertyNames(test1)[0] === '5') {
|
|
399
|
-
return false;
|
|
400
|
-
}
|
|
401
|
-
|
|
402
|
-
// https://bugs.chromium.org/p/v8/issues/detail?id=3056
|
|
403
|
-
var test2 = {};
|
|
404
|
-
for (var i = 0; i < 10; i++) {
|
|
405
|
-
test2['_' + String.fromCharCode(i)] = i;
|
|
406
|
-
}
|
|
407
|
-
var order2 = Object.getOwnPropertyNames(test2).map(function (n) {
|
|
408
|
-
return test2[n];
|
|
409
|
-
});
|
|
410
|
-
if (order2.join('') !== '0123456789') {
|
|
411
|
-
return false;
|
|
412
|
-
}
|
|
413
|
-
|
|
414
|
-
// https://bugs.chromium.org/p/v8/issues/detail?id=3056
|
|
415
|
-
var test3 = {};
|
|
416
|
-
'abcdefghijklmnopqrst'.split('').forEach(function (letter) {
|
|
417
|
-
test3[letter] = letter;
|
|
418
|
-
});
|
|
419
|
-
if (Object.keys(Object.assign({}, test3)).join('') !==
|
|
420
|
-
'abcdefghijklmnopqrst') {
|
|
421
|
-
return false;
|
|
422
|
-
}
|
|
423
|
-
|
|
424
|
-
return true;
|
|
425
|
-
} catch (err) {
|
|
426
|
-
// We don't expect any of the above to throw, but better to be safe.
|
|
427
|
-
return false;
|
|
428
|
-
}
|
|
429
|
-
}
|
|
430
|
-
|
|
431
|
-
objectAssign = shouldUseNative() ? Object.assign : function (target, source) {
|
|
432
|
-
var from;
|
|
433
|
-
var to = toObject(target);
|
|
434
|
-
var symbols;
|
|
435
|
-
|
|
436
|
-
for (var s = 1; s < arguments.length; s++) {
|
|
437
|
-
from = Object(arguments[s]);
|
|
438
|
-
|
|
439
|
-
for (var key in from) {
|
|
440
|
-
if (hasOwnProperty.call(from, key)) {
|
|
441
|
-
to[key] = from[key];
|
|
442
|
-
}
|
|
443
|
-
}
|
|
444
|
-
|
|
445
|
-
if (getOwnPropertySymbols) {
|
|
446
|
-
symbols = getOwnPropertySymbols(from);
|
|
447
|
-
for (var i = 0; i < symbols.length; i++) {
|
|
448
|
-
if (propIsEnumerable.call(from, symbols[i])) {
|
|
449
|
-
to[symbols[i]] = from[symbols[i]];
|
|
450
|
-
}
|
|
451
|
-
}
|
|
452
|
-
}
|
|
453
|
-
}
|
|
454
|
-
|
|
455
|
-
return to;
|
|
456
|
-
};
|
|
457
|
-
return objectAssign;
|
|
458
|
-
}
|
|
459
|
-
|
|
460
|
-
/**
|
|
461
|
-
* Copyright (c) 2013-present, Facebook, Inc.
|
|
462
|
-
*
|
|
463
|
-
* This source code is licensed under the MIT license found in the
|
|
464
|
-
* LICENSE file in the root directory of this source tree.
|
|
465
|
-
*/
|
|
466
|
-
|
|
467
|
-
var ReactPropTypesSecret_1;
|
|
468
|
-
var hasRequiredReactPropTypesSecret;
|
|
469
|
-
|
|
470
|
-
function requireReactPropTypesSecret () {
|
|
471
|
-
if (hasRequiredReactPropTypesSecret) return ReactPropTypesSecret_1;
|
|
472
|
-
hasRequiredReactPropTypesSecret = 1;
|
|
473
|
-
|
|
474
|
-
var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
|
|
475
|
-
|
|
476
|
-
ReactPropTypesSecret_1 = ReactPropTypesSecret;
|
|
477
|
-
return ReactPropTypesSecret_1;
|
|
478
|
-
}
|
|
479
|
-
|
|
480
|
-
var has;
|
|
481
|
-
var hasRequiredHas;
|
|
482
|
-
|
|
483
|
-
function requireHas () {
|
|
484
|
-
if (hasRequiredHas) return has;
|
|
485
|
-
hasRequiredHas = 1;
|
|
486
|
-
has = Function.call.bind(Object.prototype.hasOwnProperty);
|
|
487
|
-
return has;
|
|
488
|
-
}
|
|
489
|
-
|
|
490
|
-
/**
|
|
491
|
-
* Copyright (c) 2013-present, Facebook, Inc.
|
|
492
|
-
*
|
|
493
|
-
* This source code is licensed under the MIT license found in the
|
|
494
|
-
* LICENSE file in the root directory of this source tree.
|
|
495
|
-
*/
|
|
496
|
-
|
|
497
|
-
var checkPropTypes_1;
|
|
498
|
-
var hasRequiredCheckPropTypes;
|
|
499
|
-
|
|
500
|
-
function requireCheckPropTypes () {
|
|
501
|
-
if (hasRequiredCheckPropTypes) return checkPropTypes_1;
|
|
502
|
-
hasRequiredCheckPropTypes = 1;
|
|
503
|
-
|
|
504
|
-
var printWarning = function() {};
|
|
505
|
-
|
|
506
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
507
|
-
var ReactPropTypesSecret = /*@__PURE__*/ requireReactPropTypesSecret();
|
|
508
|
-
var loggedTypeFailures = {};
|
|
509
|
-
var has = /*@__PURE__*/ requireHas();
|
|
510
|
-
|
|
511
|
-
printWarning = function(text) {
|
|
512
|
-
var message = 'Warning: ' + text;
|
|
513
|
-
if (typeof console !== 'undefined') {
|
|
514
|
-
console.error(message);
|
|
515
|
-
}
|
|
516
|
-
try {
|
|
517
|
-
// --- Welcome to debugging React ---
|
|
518
|
-
// This error was thrown as a convenience so that you can use this stack
|
|
519
|
-
// to find the callsite that caused this warning to fire.
|
|
520
|
-
throw new Error(message);
|
|
521
|
-
} catch (x) { /**/ }
|
|
522
|
-
};
|
|
523
|
-
}
|
|
524
|
-
|
|
525
|
-
/**
|
|
526
|
-
* Assert that the values match with the type specs.
|
|
527
|
-
* Error messages are memorized and will only be shown once.
|
|
528
|
-
*
|
|
529
|
-
* @param {object} typeSpecs Map of name to a ReactPropType
|
|
530
|
-
* @param {object} values Runtime values that need to be type-checked
|
|
531
|
-
* @param {string} location e.g. "prop", "context", "child context"
|
|
532
|
-
* @param {string} componentName Name of the component for error messages.
|
|
533
|
-
* @param {?Function} getStack Returns the component stack.
|
|
534
|
-
* @private
|
|
535
|
-
*/
|
|
536
|
-
function checkPropTypes(typeSpecs, values, location, componentName, getStack) {
|
|
537
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
538
|
-
for (var typeSpecName in typeSpecs) {
|
|
539
|
-
if (has(typeSpecs, typeSpecName)) {
|
|
540
|
-
var error;
|
|
541
|
-
// Prop type validation may throw. In case they do, we don't want to
|
|
542
|
-
// fail the render phase where it didn't fail before. So we log it.
|
|
543
|
-
// After these have been cleaned up, we'll let them throw.
|
|
544
|
-
try {
|
|
545
|
-
// This is intentionally an invariant that gets caught. It's the same
|
|
546
|
-
// behavior as without this statement except with a better message.
|
|
547
|
-
if (typeof typeSpecs[typeSpecName] !== 'function') {
|
|
548
|
-
var err = Error(
|
|
549
|
-
(componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' +
|
|
550
|
-
'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.' +
|
|
551
|
-
'This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.'
|
|
552
|
-
);
|
|
553
|
-
err.name = 'Invariant Violation';
|
|
554
|
-
throw err;
|
|
555
|
-
}
|
|
556
|
-
error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret);
|
|
557
|
-
} catch (ex) {
|
|
558
|
-
error = ex;
|
|
559
|
-
}
|
|
560
|
-
if (error && !(error instanceof Error)) {
|
|
561
|
-
printWarning(
|
|
562
|
-
(componentName || 'React class') + ': type specification of ' +
|
|
563
|
-
location + ' `' + typeSpecName + '` is invalid; the type checker ' +
|
|
564
|
-
'function must return `null` or an `Error` but returned a ' + typeof error + '. ' +
|
|
565
|
-
'You may have forgotten to pass an argument to the type checker ' +
|
|
566
|
-
'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' +
|
|
567
|
-
'shape all require an argument).'
|
|
568
|
-
);
|
|
569
|
-
}
|
|
570
|
-
if (error instanceof Error && !(error.message in loggedTypeFailures)) {
|
|
571
|
-
// Only monitor this failure once because there tends to be a lot of the
|
|
572
|
-
// same error.
|
|
573
|
-
loggedTypeFailures[error.message] = true;
|
|
574
|
-
|
|
575
|
-
var stack = getStack ? getStack() : '';
|
|
576
|
-
|
|
577
|
-
printWarning(
|
|
578
|
-
'Failed ' + location + ' type: ' + error.message + (stack != null ? stack : '')
|
|
579
|
-
);
|
|
580
|
-
}
|
|
581
|
-
}
|
|
582
|
-
}
|
|
583
|
-
}
|
|
584
|
-
}
|
|
585
|
-
|
|
586
|
-
/**
|
|
587
|
-
* Resets warning cache when testing.
|
|
588
|
-
*
|
|
589
|
-
* @private
|
|
590
|
-
*/
|
|
591
|
-
checkPropTypes.resetWarningCache = function() {
|
|
592
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
593
|
-
loggedTypeFailures = {};
|
|
594
|
-
}
|
|
595
|
-
};
|
|
596
|
-
|
|
597
|
-
checkPropTypes_1 = checkPropTypes;
|
|
598
|
-
return checkPropTypes_1;
|
|
599
|
-
}
|
|
600
|
-
|
|
601
|
-
/**
|
|
602
|
-
* Copyright (c) 2013-present, Facebook, Inc.
|
|
603
|
-
*
|
|
604
|
-
* This source code is licensed under the MIT license found in the
|
|
605
|
-
* LICENSE file in the root directory of this source tree.
|
|
606
|
-
*/
|
|
607
|
-
|
|
608
|
-
var factoryWithTypeCheckers;
|
|
609
|
-
var hasRequiredFactoryWithTypeCheckers;
|
|
610
|
-
|
|
611
|
-
function requireFactoryWithTypeCheckers () {
|
|
612
|
-
if (hasRequiredFactoryWithTypeCheckers) return factoryWithTypeCheckers;
|
|
613
|
-
hasRequiredFactoryWithTypeCheckers = 1;
|
|
614
|
-
|
|
615
|
-
var ReactIs = requireReactIs();
|
|
616
|
-
var assign = requireObjectAssign();
|
|
617
|
-
|
|
618
|
-
var ReactPropTypesSecret = /*@__PURE__*/ requireReactPropTypesSecret();
|
|
619
|
-
var has = /*@__PURE__*/ requireHas();
|
|
620
|
-
var checkPropTypes = /*@__PURE__*/ requireCheckPropTypes();
|
|
621
|
-
|
|
622
|
-
var printWarning = function() {};
|
|
623
|
-
|
|
624
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
625
|
-
printWarning = function(text) {
|
|
626
|
-
var message = 'Warning: ' + text;
|
|
627
|
-
if (typeof console !== 'undefined') {
|
|
628
|
-
console.error(message);
|
|
629
|
-
}
|
|
630
|
-
try {
|
|
631
|
-
// --- Welcome to debugging React ---
|
|
632
|
-
// This error was thrown as a convenience so that you can use this stack
|
|
633
|
-
// to find the callsite that caused this warning to fire.
|
|
634
|
-
throw new Error(message);
|
|
635
|
-
} catch (x) {}
|
|
636
|
-
};
|
|
637
|
-
}
|
|
638
|
-
|
|
639
|
-
function emptyFunctionThatReturnsNull() {
|
|
640
|
-
return null;
|
|
641
|
-
}
|
|
642
|
-
|
|
643
|
-
factoryWithTypeCheckers = function(isValidElement, throwOnDirectAccess) {
|
|
644
|
-
/* global Symbol */
|
|
645
|
-
var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
|
|
646
|
-
var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec.
|
|
647
|
-
|
|
648
|
-
/**
|
|
649
|
-
* Returns the iterator method function contained on the iterable object.
|
|
650
|
-
*
|
|
651
|
-
* Be sure to invoke the function with the iterable as context:
|
|
652
|
-
*
|
|
653
|
-
* var iteratorFn = getIteratorFn(myIterable);
|
|
654
|
-
* if (iteratorFn) {
|
|
655
|
-
* var iterator = iteratorFn.call(myIterable);
|
|
656
|
-
* ...
|
|
657
|
-
* }
|
|
658
|
-
*
|
|
659
|
-
* @param {?object} maybeIterable
|
|
660
|
-
* @return {?function}
|
|
661
|
-
*/
|
|
662
|
-
function getIteratorFn(maybeIterable) {
|
|
663
|
-
var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]);
|
|
664
|
-
if (typeof iteratorFn === 'function') {
|
|
665
|
-
return iteratorFn;
|
|
666
|
-
}
|
|
667
|
-
}
|
|
668
|
-
|
|
669
|
-
/**
|
|
670
|
-
* Collection of methods that allow declaration and validation of props that are
|
|
671
|
-
* supplied to React components. Example usage:
|
|
672
|
-
*
|
|
673
|
-
* var Props = require('ReactPropTypes');
|
|
674
|
-
* var MyArticle = React.createClass({
|
|
675
|
-
* propTypes: {
|
|
676
|
-
* // An optional string prop named "description".
|
|
677
|
-
* description: Props.string,
|
|
678
|
-
*
|
|
679
|
-
* // A required enum prop named "category".
|
|
680
|
-
* category: Props.oneOf(['News','Photos']).isRequired,
|
|
681
|
-
*
|
|
682
|
-
* // A prop named "dialog" that requires an instance of Dialog.
|
|
683
|
-
* dialog: Props.instanceOf(Dialog).isRequired
|
|
684
|
-
* },
|
|
685
|
-
* render: function() { ... }
|
|
686
|
-
* });
|
|
687
|
-
*
|
|
688
|
-
* A more formal specification of how these methods are used:
|
|
689
|
-
*
|
|
690
|
-
* type := array|bool|func|object|number|string|oneOf([...])|instanceOf(...)
|
|
691
|
-
* decl := ReactPropTypes.{type}(.isRequired)?
|
|
692
|
-
*
|
|
693
|
-
* Each and every declaration produces a function with the same signature. This
|
|
694
|
-
* allows the creation of custom validation functions. For example:
|
|
695
|
-
*
|
|
696
|
-
* var MyLink = React.createClass({
|
|
697
|
-
* propTypes: {
|
|
698
|
-
* // An optional string or URI prop named "href".
|
|
699
|
-
* href: function(props, propName, componentName) {
|
|
700
|
-
* var propValue = props[propName];
|
|
701
|
-
* if (propValue != null && typeof propValue !== 'string' &&
|
|
702
|
-
* !(propValue instanceof URI)) {
|
|
703
|
-
* return new Error(
|
|
704
|
-
* 'Expected a string or an URI for ' + propName + ' in ' +
|
|
705
|
-
* componentName
|
|
706
|
-
* );
|
|
707
|
-
* }
|
|
708
|
-
* }
|
|
709
|
-
* },
|
|
710
|
-
* render: function() {...}
|
|
711
|
-
* });
|
|
712
|
-
*
|
|
713
|
-
* @internal
|
|
714
|
-
*/
|
|
715
|
-
|
|
716
|
-
var ANONYMOUS = '<<anonymous>>';
|
|
717
|
-
|
|
718
|
-
// Important!
|
|
719
|
-
// Keep this list in sync with production version in `./factoryWithThrowingShims.js`.
|
|
720
|
-
var ReactPropTypes = {
|
|
721
|
-
array: createPrimitiveTypeChecker('array'),
|
|
722
|
-
bigint: createPrimitiveTypeChecker('bigint'),
|
|
723
|
-
bool: createPrimitiveTypeChecker('boolean'),
|
|
724
|
-
func: createPrimitiveTypeChecker('function'),
|
|
725
|
-
number: createPrimitiveTypeChecker('number'),
|
|
726
|
-
object: createPrimitiveTypeChecker('object'),
|
|
727
|
-
string: createPrimitiveTypeChecker('string'),
|
|
728
|
-
symbol: createPrimitiveTypeChecker('symbol'),
|
|
729
|
-
|
|
730
|
-
any: createAnyTypeChecker(),
|
|
731
|
-
arrayOf: createArrayOfTypeChecker,
|
|
732
|
-
element: createElementTypeChecker(),
|
|
733
|
-
elementType: createElementTypeTypeChecker(),
|
|
734
|
-
instanceOf: createInstanceTypeChecker,
|
|
735
|
-
node: createNodeChecker(),
|
|
736
|
-
objectOf: createObjectOfTypeChecker,
|
|
737
|
-
oneOf: createEnumTypeChecker,
|
|
738
|
-
oneOfType: createUnionTypeChecker,
|
|
739
|
-
shape: createShapeTypeChecker,
|
|
740
|
-
exact: createStrictShapeTypeChecker,
|
|
741
|
-
};
|
|
742
|
-
|
|
743
|
-
/**
|
|
744
|
-
* inlined Object.is polyfill to avoid requiring consumers ship their own
|
|
745
|
-
* https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is
|
|
746
|
-
*/
|
|
747
|
-
/*eslint-disable no-self-compare*/
|
|
748
|
-
function is(x, y) {
|
|
749
|
-
// SameValue algorithm
|
|
750
|
-
if (x === y) {
|
|
751
|
-
// Steps 1-5, 7-10
|
|
752
|
-
// Steps 6.b-6.e: +0 != -0
|
|
753
|
-
return x !== 0 || 1 / x === 1 / y;
|
|
754
|
-
} else {
|
|
755
|
-
// Step 6.a: NaN == NaN
|
|
756
|
-
return x !== x && y !== y;
|
|
757
|
-
}
|
|
758
|
-
}
|
|
759
|
-
/*eslint-enable no-self-compare*/
|
|
760
|
-
|
|
761
|
-
/**
|
|
762
|
-
* We use an Error-like object for backward compatibility as people may call
|
|
763
|
-
* PropTypes directly and inspect their output. However, we don't use real
|
|
764
|
-
* Errors anymore. We don't inspect their stack anyway, and creating them
|
|
765
|
-
* is prohibitively expensive if they are created too often, such as what
|
|
766
|
-
* happens in oneOfType() for any type before the one that matched.
|
|
767
|
-
*/
|
|
768
|
-
function PropTypeError(message, data) {
|
|
769
|
-
this.message = message;
|
|
770
|
-
this.data = data && typeof data === 'object' ? data: {};
|
|
771
|
-
this.stack = '';
|
|
772
|
-
}
|
|
773
|
-
// Make `instanceof Error` still work for returned errors.
|
|
774
|
-
PropTypeError.prototype = Error.prototype;
|
|
775
|
-
|
|
776
|
-
function createChainableTypeChecker(validate) {
|
|
777
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
778
|
-
var manualPropTypeCallCache = {};
|
|
779
|
-
var manualPropTypeWarningCount = 0;
|
|
780
|
-
}
|
|
781
|
-
function checkType(isRequired, props, propName, componentName, location, propFullName, secret) {
|
|
782
|
-
componentName = componentName || ANONYMOUS;
|
|
783
|
-
propFullName = propFullName || propName;
|
|
784
|
-
|
|
785
|
-
if (secret !== ReactPropTypesSecret) {
|
|
786
|
-
if (throwOnDirectAccess) {
|
|
787
|
-
// New behavior only for users of `prop-types` package
|
|
788
|
-
var err = new Error(
|
|
789
|
-
'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +
|
|
790
|
-
'Use `PropTypes.checkPropTypes()` to call them. ' +
|
|
791
|
-
'Read more at http://fb.me/use-check-prop-types'
|
|
792
|
-
);
|
|
793
|
-
err.name = 'Invariant Violation';
|
|
794
|
-
throw err;
|
|
795
|
-
} else if (process.env.NODE_ENV !== 'production' && typeof console !== 'undefined') {
|
|
796
|
-
// Old behavior for people using React.PropTypes
|
|
797
|
-
var cacheKey = componentName + ':' + propName;
|
|
798
|
-
if (
|
|
799
|
-
!manualPropTypeCallCache[cacheKey] &&
|
|
800
|
-
// Avoid spamming the console because they are often not actionable except for lib authors
|
|
801
|
-
manualPropTypeWarningCount < 3
|
|
802
|
-
) {
|
|
803
|
-
printWarning(
|
|
804
|
-
'You are manually calling a React.PropTypes validation ' +
|
|
805
|
-
'function for the `' + propFullName + '` prop on `' + componentName + '`. This is deprecated ' +
|
|
806
|
-
'and will throw in the standalone `prop-types` package. ' +
|
|
807
|
-
'You may be seeing this warning due to a third-party PropTypes ' +
|
|
808
|
-
'library. See https://fb.me/react-warning-dont-call-proptypes ' + 'for details.'
|
|
809
|
-
);
|
|
810
|
-
manualPropTypeCallCache[cacheKey] = true;
|
|
811
|
-
manualPropTypeWarningCount++;
|
|
812
|
-
}
|
|
813
|
-
}
|
|
814
|
-
}
|
|
815
|
-
if (props[propName] == null) {
|
|
816
|
-
if (isRequired) {
|
|
817
|
-
if (props[propName] === null) {
|
|
818
|
-
return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required ' + ('in `' + componentName + '`, but its value is `null`.'));
|
|
819
|
-
}
|
|
820
|
-
return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required in ' + ('`' + componentName + '`, but its value is `undefined`.'));
|
|
821
|
-
}
|
|
822
|
-
return null;
|
|
823
|
-
} else {
|
|
824
|
-
return validate(props, propName, componentName, location, propFullName);
|
|
825
|
-
}
|
|
826
|
-
}
|
|
827
|
-
|
|
828
|
-
var chainedCheckType = checkType.bind(null, false);
|
|
829
|
-
chainedCheckType.isRequired = checkType.bind(null, true);
|
|
830
|
-
|
|
831
|
-
return chainedCheckType;
|
|
832
|
-
}
|
|
833
|
-
|
|
834
|
-
function createPrimitiveTypeChecker(expectedType) {
|
|
835
|
-
function validate(props, propName, componentName, location, propFullName, secret) {
|
|
836
|
-
var propValue = props[propName];
|
|
837
|
-
var propType = getPropType(propValue);
|
|
838
|
-
if (propType !== expectedType) {
|
|
839
|
-
// `propValue` being instance of, say, date/regexp, pass the 'object'
|
|
840
|
-
// check, but we can offer a more precise error message here rather than
|
|
841
|
-
// 'of type `object`'.
|
|
842
|
-
var preciseType = getPreciseType(propValue);
|
|
843
|
-
|
|
844
|
-
return new PropTypeError(
|
|
845
|
-
'Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.'),
|
|
846
|
-
{expectedType: expectedType}
|
|
847
|
-
);
|
|
848
|
-
}
|
|
849
|
-
return null;
|
|
850
|
-
}
|
|
851
|
-
return createChainableTypeChecker(validate);
|
|
852
|
-
}
|
|
853
|
-
|
|
854
|
-
function createAnyTypeChecker() {
|
|
855
|
-
return createChainableTypeChecker(emptyFunctionThatReturnsNull);
|
|
856
|
-
}
|
|
857
|
-
|
|
858
|
-
function createArrayOfTypeChecker(typeChecker) {
|
|
859
|
-
function validate(props, propName, componentName, location, propFullName) {
|
|
860
|
-
if (typeof typeChecker !== 'function') {
|
|
861
|
-
return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside arrayOf.');
|
|
862
|
-
}
|
|
863
|
-
var propValue = props[propName];
|
|
864
|
-
if (!Array.isArray(propValue)) {
|
|
865
|
-
var propType = getPropType(propValue);
|
|
866
|
-
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an array.'));
|
|
867
|
-
}
|
|
868
|
-
for (var i = 0; i < propValue.length; i++) {
|
|
869
|
-
var error = typeChecker(propValue, i, componentName, location, propFullName + '[' + i + ']', ReactPropTypesSecret);
|
|
870
|
-
if (error instanceof Error) {
|
|
871
|
-
return error;
|
|
872
|
-
}
|
|
873
|
-
}
|
|
874
|
-
return null;
|
|
875
|
-
}
|
|
876
|
-
return createChainableTypeChecker(validate);
|
|
877
|
-
}
|
|
878
|
-
|
|
879
|
-
function createElementTypeChecker() {
|
|
880
|
-
function validate(props, propName, componentName, location, propFullName) {
|
|
881
|
-
var propValue = props[propName];
|
|
882
|
-
if (!isValidElement(propValue)) {
|
|
883
|
-
var propType = getPropType(propValue);
|
|
884
|
-
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement.'));
|
|
885
|
-
}
|
|
886
|
-
return null;
|
|
887
|
-
}
|
|
888
|
-
return createChainableTypeChecker(validate);
|
|
889
|
-
}
|
|
890
|
-
|
|
891
|
-
function createElementTypeTypeChecker() {
|
|
892
|
-
function validate(props, propName, componentName, location, propFullName) {
|
|
893
|
-
var propValue = props[propName];
|
|
894
|
-
if (!ReactIs.isValidElementType(propValue)) {
|
|
895
|
-
var propType = getPropType(propValue);
|
|
896
|
-
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement type.'));
|
|
897
|
-
}
|
|
898
|
-
return null;
|
|
899
|
-
}
|
|
900
|
-
return createChainableTypeChecker(validate);
|
|
901
|
-
}
|
|
902
|
-
|
|
903
|
-
function createInstanceTypeChecker(expectedClass) {
|
|
904
|
-
function validate(props, propName, componentName, location, propFullName) {
|
|
905
|
-
if (!(props[propName] instanceof expectedClass)) {
|
|
906
|
-
var expectedClassName = expectedClass.name || ANONYMOUS;
|
|
907
|
-
var actualClassName = getClassName(props[propName]);
|
|
908
|
-
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + actualClassName + '` supplied to `' + componentName + '`, expected ') + ('instance of `' + expectedClassName + '`.'));
|
|
909
|
-
}
|
|
910
|
-
return null;
|
|
911
|
-
}
|
|
912
|
-
return createChainableTypeChecker(validate);
|
|
913
|
-
}
|
|
914
|
-
|
|
915
|
-
function createEnumTypeChecker(expectedValues) {
|
|
916
|
-
if (!Array.isArray(expectedValues)) {
|
|
917
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
918
|
-
if (arguments.length > 1) {
|
|
919
|
-
printWarning(
|
|
920
|
-
'Invalid arguments supplied to oneOf, expected an array, got ' + arguments.length + ' arguments. ' +
|
|
921
|
-
'A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z]).'
|
|
922
|
-
);
|
|
923
|
-
} else {
|
|
924
|
-
printWarning('Invalid argument supplied to oneOf, expected an array.');
|
|
925
|
-
}
|
|
926
|
-
}
|
|
927
|
-
return emptyFunctionThatReturnsNull;
|
|
928
|
-
}
|
|
929
|
-
|
|
930
|
-
function validate(props, propName, componentName, location, propFullName) {
|
|
931
|
-
var propValue = props[propName];
|
|
932
|
-
for (var i = 0; i < expectedValues.length; i++) {
|
|
933
|
-
if (is(propValue, expectedValues[i])) {
|
|
934
|
-
return null;
|
|
935
|
-
}
|
|
936
|
-
}
|
|
937
|
-
|
|
938
|
-
var valuesString = JSON.stringify(expectedValues, function replacer(key, value) {
|
|
939
|
-
var type = getPreciseType(value);
|
|
940
|
-
if (type === 'symbol') {
|
|
941
|
-
return String(value);
|
|
942
|
-
}
|
|
943
|
-
return value;
|
|
944
|
-
});
|
|
945
|
-
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of value `' + String(propValue) + '` ' + ('supplied to `' + componentName + '`, expected one of ' + valuesString + '.'));
|
|
946
|
-
}
|
|
947
|
-
return createChainableTypeChecker(validate);
|
|
948
|
-
}
|
|
949
|
-
|
|
950
|
-
function createObjectOfTypeChecker(typeChecker) {
|
|
951
|
-
function validate(props, propName, componentName, location, propFullName) {
|
|
952
|
-
if (typeof typeChecker !== 'function') {
|
|
953
|
-
return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside objectOf.');
|
|
954
|
-
}
|
|
955
|
-
var propValue = props[propName];
|
|
956
|
-
var propType = getPropType(propValue);
|
|
957
|
-
if (propType !== 'object') {
|
|
958
|
-
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an object.'));
|
|
959
|
-
}
|
|
960
|
-
for (var key in propValue) {
|
|
961
|
-
if (has(propValue, key)) {
|
|
962
|
-
var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
|
|
963
|
-
if (error instanceof Error) {
|
|
964
|
-
return error;
|
|
965
|
-
}
|
|
966
|
-
}
|
|
967
|
-
}
|
|
968
|
-
return null;
|
|
969
|
-
}
|
|
970
|
-
return createChainableTypeChecker(validate);
|
|
971
|
-
}
|
|
972
|
-
|
|
973
|
-
function createUnionTypeChecker(arrayOfTypeCheckers) {
|
|
974
|
-
if (!Array.isArray(arrayOfTypeCheckers)) {
|
|
975
|
-
process.env.NODE_ENV !== 'production' ? printWarning('Invalid argument supplied to oneOfType, expected an instance of array.') : void 0;
|
|
976
|
-
return emptyFunctionThatReturnsNull;
|
|
977
|
-
}
|
|
978
|
-
|
|
979
|
-
for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
|
|
980
|
-
var checker = arrayOfTypeCheckers[i];
|
|
981
|
-
if (typeof checker !== 'function') {
|
|
982
|
-
printWarning(
|
|
983
|
-
'Invalid argument supplied to oneOfType. Expected an array of check functions, but ' +
|
|
984
|
-
'received ' + getPostfixForTypeWarning(checker) + ' at index ' + i + '.'
|
|
985
|
-
);
|
|
986
|
-
return emptyFunctionThatReturnsNull;
|
|
987
|
-
}
|
|
988
|
-
}
|
|
989
|
-
|
|
990
|
-
function validate(props, propName, componentName, location, propFullName) {
|
|
991
|
-
var expectedTypes = [];
|
|
992
|
-
for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
|
|
993
|
-
var checker = arrayOfTypeCheckers[i];
|
|
994
|
-
var checkerResult = checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret);
|
|
995
|
-
if (checkerResult == null) {
|
|
996
|
-
return null;
|
|
997
|
-
}
|
|
998
|
-
if (checkerResult.data && has(checkerResult.data, 'expectedType')) {
|
|
999
|
-
expectedTypes.push(checkerResult.data.expectedType);
|
|
1000
|
-
}
|
|
1001
|
-
}
|
|
1002
|
-
var expectedTypesMessage = (expectedTypes.length > 0) ? ', expected one of type [' + expectedTypes.join(', ') + ']': '';
|
|
1003
|
-
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`' + expectedTypesMessage + '.'));
|
|
1004
|
-
}
|
|
1005
|
-
return createChainableTypeChecker(validate);
|
|
1006
|
-
}
|
|
1007
|
-
|
|
1008
|
-
function createNodeChecker() {
|
|
1009
|
-
function validate(props, propName, componentName, location, propFullName) {
|
|
1010
|
-
if (!isNode(props[propName])) {
|
|
1011
|
-
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a ReactNode.'));
|
|
1012
|
-
}
|
|
1013
|
-
return null;
|
|
1014
|
-
}
|
|
1015
|
-
return createChainableTypeChecker(validate);
|
|
1016
|
-
}
|
|
1017
|
-
|
|
1018
|
-
function invalidValidatorError(componentName, location, propFullName, key, type) {
|
|
1019
|
-
return new PropTypeError(
|
|
1020
|
-
(componentName || 'React class') + ': ' + location + ' type `' + propFullName + '.' + key + '` is invalid; ' +
|
|
1021
|
-
'it must be a function, usually from the `prop-types` package, but received `' + type + '`.'
|
|
1022
|
-
);
|
|
1023
|
-
}
|
|
1024
|
-
|
|
1025
|
-
function createShapeTypeChecker(shapeTypes) {
|
|
1026
|
-
function validate(props, propName, componentName, location, propFullName) {
|
|
1027
|
-
var propValue = props[propName];
|
|
1028
|
-
var propType = getPropType(propValue);
|
|
1029
|
-
if (propType !== 'object') {
|
|
1030
|
-
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
|
|
1031
|
-
}
|
|
1032
|
-
for (var key in shapeTypes) {
|
|
1033
|
-
var checker = shapeTypes[key];
|
|
1034
|
-
if (typeof checker !== 'function') {
|
|
1035
|
-
return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker));
|
|
1036
|
-
}
|
|
1037
|
-
var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
|
|
1038
|
-
if (error) {
|
|
1039
|
-
return error;
|
|
1040
|
-
}
|
|
1041
|
-
}
|
|
1042
|
-
return null;
|
|
1043
|
-
}
|
|
1044
|
-
return createChainableTypeChecker(validate);
|
|
1045
|
-
}
|
|
1046
|
-
|
|
1047
|
-
function createStrictShapeTypeChecker(shapeTypes) {
|
|
1048
|
-
function validate(props, propName, componentName, location, propFullName) {
|
|
1049
|
-
var propValue = props[propName];
|
|
1050
|
-
var propType = getPropType(propValue);
|
|
1051
|
-
if (propType !== 'object') {
|
|
1052
|
-
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
|
|
1053
|
-
}
|
|
1054
|
-
// We need to check all keys in case some are required but missing from props.
|
|
1055
|
-
var allKeys = assign({}, props[propName], shapeTypes);
|
|
1056
|
-
for (var key in allKeys) {
|
|
1057
|
-
var checker = shapeTypes[key];
|
|
1058
|
-
if (has(shapeTypes, key) && typeof checker !== 'function') {
|
|
1059
|
-
return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker));
|
|
1060
|
-
}
|
|
1061
|
-
if (!checker) {
|
|
1062
|
-
return new PropTypeError(
|
|
1063
|
-
'Invalid ' + location + ' `' + propFullName + '` key `' + key + '` supplied to `' + componentName + '`.' +
|
|
1064
|
-
'\nBad object: ' + JSON.stringify(props[propName], null, ' ') +
|
|
1065
|
-
'\nValid keys: ' + JSON.stringify(Object.keys(shapeTypes), null, ' ')
|
|
1066
|
-
);
|
|
1067
|
-
}
|
|
1068
|
-
var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
|
|
1069
|
-
if (error) {
|
|
1070
|
-
return error;
|
|
1071
|
-
}
|
|
1072
|
-
}
|
|
1073
|
-
return null;
|
|
1074
|
-
}
|
|
1075
|
-
|
|
1076
|
-
return createChainableTypeChecker(validate);
|
|
1077
|
-
}
|
|
1078
|
-
|
|
1079
|
-
function isNode(propValue) {
|
|
1080
|
-
switch (typeof propValue) {
|
|
1081
|
-
case 'number':
|
|
1082
|
-
case 'string':
|
|
1083
|
-
case 'undefined':
|
|
1084
|
-
return true;
|
|
1085
|
-
case 'boolean':
|
|
1086
|
-
return !propValue;
|
|
1087
|
-
case 'object':
|
|
1088
|
-
if (Array.isArray(propValue)) {
|
|
1089
|
-
return propValue.every(isNode);
|
|
1090
|
-
}
|
|
1091
|
-
if (propValue === null || isValidElement(propValue)) {
|
|
1092
|
-
return true;
|
|
1093
|
-
}
|
|
1094
|
-
|
|
1095
|
-
var iteratorFn = getIteratorFn(propValue);
|
|
1096
|
-
if (iteratorFn) {
|
|
1097
|
-
var iterator = iteratorFn.call(propValue);
|
|
1098
|
-
var step;
|
|
1099
|
-
if (iteratorFn !== propValue.entries) {
|
|
1100
|
-
while (!(step = iterator.next()).done) {
|
|
1101
|
-
if (!isNode(step.value)) {
|
|
1102
|
-
return false;
|
|
1103
|
-
}
|
|
1104
|
-
}
|
|
1105
|
-
} else {
|
|
1106
|
-
// Iterator will provide entry [k,v] tuples rather than values.
|
|
1107
|
-
while (!(step = iterator.next()).done) {
|
|
1108
|
-
var entry = step.value;
|
|
1109
|
-
if (entry) {
|
|
1110
|
-
if (!isNode(entry[1])) {
|
|
1111
|
-
return false;
|
|
1112
|
-
}
|
|
1113
|
-
}
|
|
1114
|
-
}
|
|
1115
|
-
}
|
|
1116
|
-
} else {
|
|
1117
|
-
return false;
|
|
1118
|
-
}
|
|
1119
|
-
|
|
1120
|
-
return true;
|
|
1121
|
-
default:
|
|
1122
|
-
return false;
|
|
1123
|
-
}
|
|
1124
|
-
}
|
|
1125
|
-
|
|
1126
|
-
function isSymbol(propType, propValue) {
|
|
1127
|
-
// Native Symbol.
|
|
1128
|
-
if (propType === 'symbol') {
|
|
1129
|
-
return true;
|
|
1130
|
-
}
|
|
1131
|
-
|
|
1132
|
-
// falsy value can't be a Symbol
|
|
1133
|
-
if (!propValue) {
|
|
1134
|
-
return false;
|
|
1135
|
-
}
|
|
1136
|
-
|
|
1137
|
-
// 19.4.3.5 Symbol.prototype[@@toStringTag] === 'Symbol'
|
|
1138
|
-
if (propValue['@@toStringTag'] === 'Symbol') {
|
|
1139
|
-
return true;
|
|
1140
|
-
}
|
|
1141
|
-
|
|
1142
|
-
// Fallback for non-spec compliant Symbols which are polyfilled.
|
|
1143
|
-
if (typeof Symbol === 'function' && propValue instanceof Symbol) {
|
|
1144
|
-
return true;
|
|
1145
|
-
}
|
|
1146
|
-
|
|
1147
|
-
return false;
|
|
1148
|
-
}
|
|
1149
|
-
|
|
1150
|
-
// Equivalent of `typeof` but with special handling for array and regexp.
|
|
1151
|
-
function getPropType(propValue) {
|
|
1152
|
-
var propType = typeof propValue;
|
|
1153
|
-
if (Array.isArray(propValue)) {
|
|
1154
|
-
return 'array';
|
|
1155
|
-
}
|
|
1156
|
-
if (propValue instanceof RegExp) {
|
|
1157
|
-
// Old webkits (at least until Android 4.0) return 'function' rather than
|
|
1158
|
-
// 'object' for typeof a RegExp. We'll normalize this here so that /bla/
|
|
1159
|
-
// passes PropTypes.object.
|
|
1160
|
-
return 'object';
|
|
1161
|
-
}
|
|
1162
|
-
if (isSymbol(propType, propValue)) {
|
|
1163
|
-
return 'symbol';
|
|
1164
|
-
}
|
|
1165
|
-
return propType;
|
|
1166
|
-
}
|
|
1167
|
-
|
|
1168
|
-
// This handles more types than `getPropType`. Only used for error messages.
|
|
1169
|
-
// See `createPrimitiveTypeChecker`.
|
|
1170
|
-
function getPreciseType(propValue) {
|
|
1171
|
-
if (typeof propValue === 'undefined' || propValue === null) {
|
|
1172
|
-
return '' + propValue;
|
|
1173
|
-
}
|
|
1174
|
-
var propType = getPropType(propValue);
|
|
1175
|
-
if (propType === 'object') {
|
|
1176
|
-
if (propValue instanceof Date) {
|
|
1177
|
-
return 'date';
|
|
1178
|
-
} else if (propValue instanceof RegExp) {
|
|
1179
|
-
return 'regexp';
|
|
1180
|
-
}
|
|
1181
|
-
}
|
|
1182
|
-
return propType;
|
|
1183
|
-
}
|
|
1184
|
-
|
|
1185
|
-
// Returns a string that is postfixed to a warning about an invalid type.
|
|
1186
|
-
// For example, "undefined" or "of type array"
|
|
1187
|
-
function getPostfixForTypeWarning(value) {
|
|
1188
|
-
var type = getPreciseType(value);
|
|
1189
|
-
switch (type) {
|
|
1190
|
-
case 'array':
|
|
1191
|
-
case 'object':
|
|
1192
|
-
return 'an ' + type;
|
|
1193
|
-
case 'boolean':
|
|
1194
|
-
case 'date':
|
|
1195
|
-
case 'regexp':
|
|
1196
|
-
return 'a ' + type;
|
|
1197
|
-
default:
|
|
1198
|
-
return type;
|
|
1199
|
-
}
|
|
1200
|
-
}
|
|
1201
|
-
|
|
1202
|
-
// Returns class name of the object, if any.
|
|
1203
|
-
function getClassName(propValue) {
|
|
1204
|
-
if (!propValue.constructor || !propValue.constructor.name) {
|
|
1205
|
-
return ANONYMOUS;
|
|
1206
|
-
}
|
|
1207
|
-
return propValue.constructor.name;
|
|
1208
|
-
}
|
|
1209
|
-
|
|
1210
|
-
ReactPropTypes.checkPropTypes = checkPropTypes;
|
|
1211
|
-
ReactPropTypes.resetWarningCache = checkPropTypes.resetWarningCache;
|
|
1212
|
-
ReactPropTypes.PropTypes = ReactPropTypes;
|
|
1213
|
-
|
|
1214
|
-
return ReactPropTypes;
|
|
1215
|
-
};
|
|
1216
|
-
return factoryWithTypeCheckers;
|
|
1217
|
-
}
|
|
1218
|
-
|
|
1219
|
-
/**
|
|
1220
|
-
* Copyright (c) 2013-present, Facebook, Inc.
|
|
1221
|
-
*
|
|
1222
|
-
* This source code is licensed under the MIT license found in the
|
|
1223
|
-
* LICENSE file in the root directory of this source tree.
|
|
1224
|
-
*/
|
|
1225
|
-
|
|
1226
|
-
var factoryWithThrowingShims;
|
|
1227
|
-
var hasRequiredFactoryWithThrowingShims;
|
|
1228
|
-
|
|
1229
|
-
function requireFactoryWithThrowingShims () {
|
|
1230
|
-
if (hasRequiredFactoryWithThrowingShims) return factoryWithThrowingShims;
|
|
1231
|
-
hasRequiredFactoryWithThrowingShims = 1;
|
|
1232
|
-
|
|
1233
|
-
var ReactPropTypesSecret = /*@__PURE__*/ requireReactPropTypesSecret();
|
|
1234
|
-
|
|
1235
|
-
function emptyFunction() {}
|
|
1236
|
-
function emptyFunctionWithReset() {}
|
|
1237
|
-
emptyFunctionWithReset.resetWarningCache = emptyFunction;
|
|
1238
|
-
|
|
1239
|
-
factoryWithThrowingShims = function() {
|
|
1240
|
-
function shim(props, propName, componentName, location, propFullName, secret) {
|
|
1241
|
-
if (secret === ReactPropTypesSecret) {
|
|
1242
|
-
// It is still safe when called from React.
|
|
1243
|
-
return;
|
|
1244
|
-
}
|
|
1245
|
-
var err = new Error(
|
|
1246
|
-
'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +
|
|
1247
|
-
'Use PropTypes.checkPropTypes() to call them. ' +
|
|
1248
|
-
'Read more at http://fb.me/use-check-prop-types'
|
|
1249
|
-
);
|
|
1250
|
-
err.name = 'Invariant Violation';
|
|
1251
|
-
throw err;
|
|
1252
|
-
} shim.isRequired = shim;
|
|
1253
|
-
function getShim() {
|
|
1254
|
-
return shim;
|
|
1255
|
-
} // Important!
|
|
1256
|
-
// Keep this list in sync with production version in `./factoryWithTypeCheckers.js`.
|
|
1257
|
-
var ReactPropTypes = {
|
|
1258
|
-
array: shim,
|
|
1259
|
-
bigint: shim,
|
|
1260
|
-
bool: shim,
|
|
1261
|
-
func: shim,
|
|
1262
|
-
number: shim,
|
|
1263
|
-
object: shim,
|
|
1264
|
-
string: shim,
|
|
1265
|
-
symbol: shim,
|
|
1266
|
-
|
|
1267
|
-
any: shim,
|
|
1268
|
-
arrayOf: getShim,
|
|
1269
|
-
element: shim,
|
|
1270
|
-
elementType: shim,
|
|
1271
|
-
instanceOf: getShim,
|
|
1272
|
-
node: shim,
|
|
1273
|
-
objectOf: getShim,
|
|
1274
|
-
oneOf: getShim,
|
|
1275
|
-
oneOfType: getShim,
|
|
1276
|
-
shape: getShim,
|
|
1277
|
-
exact: getShim,
|
|
1278
|
-
|
|
1279
|
-
checkPropTypes: emptyFunctionWithReset,
|
|
1280
|
-
resetWarningCache: emptyFunction
|
|
1281
|
-
};
|
|
1282
|
-
|
|
1283
|
-
ReactPropTypes.PropTypes = ReactPropTypes;
|
|
1284
|
-
|
|
1285
|
-
return ReactPropTypes;
|
|
1286
|
-
};
|
|
1287
|
-
return factoryWithThrowingShims;
|
|
1288
|
-
}
|
|
1289
|
-
|
|
1290
|
-
/**
|
|
1291
|
-
* Copyright (c) 2013-present, Facebook, Inc.
|
|
1292
|
-
*
|
|
1293
|
-
* This source code is licensed under the MIT license found in the
|
|
1294
|
-
* LICENSE file in the root directory of this source tree.
|
|
1295
|
-
*/
|
|
1296
|
-
|
|
1297
|
-
var hasRequiredPropTypes;
|
|
1298
|
-
|
|
1299
|
-
function requirePropTypes () {
|
|
1300
|
-
if (hasRequiredPropTypes) return propTypes.exports;
|
|
1301
|
-
hasRequiredPropTypes = 1;
|
|
1302
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
1303
|
-
var ReactIs = requireReactIs();
|
|
1304
|
-
|
|
1305
|
-
// By explicitly using `prop-types` you are opting into new development behavior.
|
|
1306
|
-
// http://fb.me/prop-types-in-prod
|
|
1307
|
-
var throwOnDirectAccess = true;
|
|
1308
|
-
propTypes.exports = /*@__PURE__*/ requireFactoryWithTypeCheckers()(ReactIs.isElement, throwOnDirectAccess);
|
|
1309
|
-
} else {
|
|
1310
|
-
// By explicitly using `prop-types` you are opting into new production behavior.
|
|
1311
|
-
// http://fb.me/prop-types-in-prod
|
|
1312
|
-
propTypes.exports = /*@__PURE__*/ requireFactoryWithThrowingShims()();
|
|
1313
|
-
}
|
|
1314
|
-
return propTypes.exports;
|
|
1315
|
-
}
|
|
1316
|
-
|
|
1317
|
-
var propTypesExports = /*@__PURE__*/ requirePropTypes();
|
|
1318
|
-
const PropTypes = /*@__PURE__*/getDefaultExportFromCjs(propTypesExports);
|
|
1319
|
-
|
|
1320
|
-
function chainPropTypes(propType1, propType2) {
|
|
1321
|
-
if (process.env.NODE_ENV === 'production') {
|
|
1322
|
-
return () => null;
|
|
1323
|
-
}
|
|
1324
|
-
return function validate(...args) {
|
|
1325
|
-
return propType1(...args) || propType2(...args);
|
|
1326
|
-
};
|
|
1327
|
-
}
|
|
1328
|
-
|
|
1329
|
-
/**
|
|
1330
|
-
* Add keys, values of `defaultProps` that does not exist in `props`
|
|
1331
|
-
* @param {object} defaultProps
|
|
1332
|
-
* @param {object} props
|
|
1333
|
-
* @returns {object} resolved props
|
|
1334
|
-
*/
|
|
1335
|
-
function resolveProps(defaultProps, props) {
|
|
1336
|
-
const output = _extends({}, props);
|
|
1337
|
-
Object.keys(defaultProps).forEach(propName => {
|
|
1338
|
-
if (propName.toString().match(/^(components|slots)$/)) {
|
|
1339
|
-
output[propName] = _extends({}, defaultProps[propName], output[propName]);
|
|
1340
|
-
} else if (propName.toString().match(/^(componentsProps|slotProps)$/)) {
|
|
1341
|
-
const defaultSlotProps = defaultProps[propName] || {};
|
|
1342
|
-
const slotProps = props[propName];
|
|
1343
|
-
output[propName] = {};
|
|
1344
|
-
if (!slotProps || !Object.keys(slotProps)) {
|
|
1345
|
-
// Reduce the iteration if the slot props is empty
|
|
1346
|
-
output[propName] = defaultSlotProps;
|
|
1347
|
-
} else if (!defaultSlotProps || !Object.keys(defaultSlotProps)) {
|
|
1348
|
-
// Reduce the iteration if the default slot props is empty
|
|
1349
|
-
output[propName] = slotProps;
|
|
1350
|
-
} else {
|
|
1351
|
-
output[propName] = _extends({}, slotProps);
|
|
1352
|
-
Object.keys(defaultSlotProps).forEach(slotPropName => {
|
|
1353
|
-
output[propName][slotPropName] = resolveProps(defaultSlotProps[slotPropName], slotProps[slotPropName]);
|
|
1354
|
-
});
|
|
1355
|
-
}
|
|
1356
|
-
} else if (output[propName] === undefined) {
|
|
1357
|
-
output[propName] = defaultProps[propName];
|
|
1358
|
-
}
|
|
1359
|
-
});
|
|
1360
|
-
return output;
|
|
1361
|
-
}
|
|
1362
|
-
|
|
1363
|
-
function composeClasses(slots, getUtilityClass, classes = undefined) {
|
|
1364
|
-
const output = {};
|
|
1365
|
-
Object.keys(slots).forEach(
|
|
1366
|
-
// `Object.keys(slots)` can't be wider than `T` because we infer `T` from `slots`.
|
|
1367
|
-
// @ts-expect-error https://github.com/microsoft/TypeScript/pull/12253#issuecomment-263132208
|
|
1368
|
-
slot => {
|
|
1369
|
-
output[slot] = slots[slot].reduce((acc, key) => {
|
|
1370
|
-
if (key) {
|
|
1371
|
-
const utilityClass = getUtilityClass(key);
|
|
1372
|
-
if (utilityClass !== '') {
|
|
1373
|
-
acc.push(utilityClass);
|
|
1374
|
-
}
|
|
1375
|
-
if (classes && classes[key]) {
|
|
1376
|
-
acc.push(classes[key]);
|
|
1377
|
-
}
|
|
1378
|
-
}
|
|
1379
|
-
return acc;
|
|
1380
|
-
}, []).join(' ');
|
|
1381
|
-
});
|
|
1382
|
-
return output;
|
|
1383
|
-
}
|
|
1384
|
-
|
|
1385
|
-
const defaultGenerator = componentName => componentName;
|
|
1386
|
-
const createClassNameGenerator = () => {
|
|
1387
|
-
let generate = defaultGenerator;
|
|
1388
|
-
return {
|
|
1389
|
-
configure(generator) {
|
|
1390
|
-
generate = generator;
|
|
1391
|
-
},
|
|
1392
|
-
generate(componentName) {
|
|
1393
|
-
return generate(componentName);
|
|
1394
|
-
},
|
|
1395
|
-
reset() {
|
|
1396
|
-
generate = defaultGenerator;
|
|
1397
|
-
}
|
|
1398
|
-
};
|
|
1399
|
-
};
|
|
1400
|
-
const ClassNameGenerator = createClassNameGenerator();
|
|
1401
|
-
|
|
1402
|
-
const globalStateClasses = {
|
|
1403
|
-
active: 'active',
|
|
1404
|
-
checked: 'checked',
|
|
1405
|
-
completed: 'completed',
|
|
1406
|
-
disabled: 'disabled',
|
|
1407
|
-
error: 'error',
|
|
1408
|
-
expanded: 'expanded',
|
|
1409
|
-
focused: 'focused',
|
|
1410
|
-
focusVisible: 'focusVisible',
|
|
1411
|
-
open: 'open',
|
|
1412
|
-
readOnly: 'readOnly',
|
|
1413
|
-
required: 'required',
|
|
1414
|
-
selected: 'selected'
|
|
1415
|
-
};
|
|
1416
|
-
function generateUtilityClass(componentName, slot, globalStatePrefix = 'Mui') {
|
|
1417
|
-
const globalStateClass = globalStateClasses[slot];
|
|
1418
|
-
return globalStateClass ? `${globalStatePrefix}-${globalStateClass}` : `${ClassNameGenerator.generate(componentName)}-${slot}`;
|
|
1419
|
-
}
|
|
1420
|
-
|
|
1421
|
-
function generateUtilityClasses(componentName, slots, globalStatePrefix = 'Mui') {
|
|
1422
|
-
const result = {};
|
|
1423
|
-
slots.forEach(slot => {
|
|
1424
|
-
result[slot] = generateUtilityClass(componentName, slot, globalStatePrefix);
|
|
1425
|
-
});
|
|
1426
|
-
return result;
|
|
1427
|
-
}
|
|
1428
|
-
|
|
1429
|
-
function getLoadingButtonUtilityClass(slot) {
|
|
1430
|
-
return generateUtilityClass('MuiLoadingButton', slot);
|
|
1431
|
-
}
|
|
1432
|
-
const loadingButtonClasses = generateUtilityClasses('MuiLoadingButton', ['root', 'loading', 'loadingIndicator', 'loadingIndicatorCenter', 'loadingIndicatorStart', 'loadingIndicatorEnd', 'endIconLoadingEnd', 'startIconLoadingStart']);
|
|
1433
|
-
|
|
1434
|
-
const _excluded = ["children", "disabled", "id", "loading", "loadingIndicator", "loadingPosition", "variant"];
|
|
1435
|
-
const useUtilityClasses = ownerState => {
|
|
1436
|
-
const {
|
|
1437
|
-
loading,
|
|
1438
|
-
loadingPosition,
|
|
1439
|
-
classes
|
|
1440
|
-
} = ownerState;
|
|
1441
|
-
const slots = {
|
|
1442
|
-
root: ['root', loading && 'loading'],
|
|
1443
|
-
startIcon: [loading && `startIconLoading${capitalize(loadingPosition)}`],
|
|
1444
|
-
endIcon: [loading && `endIconLoading${capitalize(loadingPosition)}`],
|
|
1445
|
-
loadingIndicator: ['loadingIndicator', loading && `loadingIndicator${capitalize(loadingPosition)}`]
|
|
1446
|
-
};
|
|
1447
|
-
const composedClasses = composeClasses(slots, getLoadingButtonUtilityClass, classes);
|
|
1448
|
-
return _extends({}, classes, composedClasses);
|
|
1449
|
-
};
|
|
1450
|
-
|
|
1451
|
-
// TODO use `import { rootShouldForwardProp } from '../styles/styled';` once move to core
|
|
1452
|
-
const rootShouldForwardProp = prop => prop !== 'ownerState' && prop !== 'theme' && prop !== 'sx' && prop !== 'as' && prop !== 'classes';
|
|
1453
|
-
const LoadingButtonRoot = styled(Button, {
|
|
1454
|
-
shouldForwardProp: prop => rootShouldForwardProp(prop) || prop === 'classes',
|
|
1455
|
-
name: 'MuiLoadingButton',
|
|
1456
|
-
slot: 'Root',
|
|
1457
|
-
overridesResolver: (props, styles) => {
|
|
1458
|
-
return [styles.root, styles.startIconLoadingStart && {
|
|
1459
|
-
[`& .${loadingButtonClasses.startIconLoadingStart}`]: styles.startIconLoadingStart
|
|
1460
|
-
}, styles.endIconLoadingEnd && {
|
|
1461
|
-
[`& .${loadingButtonClasses.endIconLoadingEnd}`]: styles.endIconLoadingEnd
|
|
1462
|
-
}];
|
|
1463
|
-
}
|
|
1464
|
-
})(({
|
|
1465
|
-
ownerState,
|
|
1466
|
-
theme
|
|
1467
|
-
}) => _extends({
|
|
1468
|
-
[`& .${loadingButtonClasses.startIconLoadingStart}, & .${loadingButtonClasses.endIconLoadingEnd}`]: {
|
|
1469
|
-
transition: theme.transitions.create(['opacity'], {
|
|
1470
|
-
duration: theme.transitions.duration.short
|
|
1471
|
-
}),
|
|
1472
|
-
opacity: 0
|
|
1473
|
-
}
|
|
1474
|
-
}, ownerState.loadingPosition === 'center' && {
|
|
1475
|
-
transition: theme.transitions.create(['background-color', 'box-shadow', 'border-color'], {
|
|
1476
|
-
duration: theme.transitions.duration.short
|
|
1477
|
-
}),
|
|
1478
|
-
[`&.${loadingButtonClasses.loading}`]: {
|
|
1479
|
-
color: 'transparent'
|
|
1480
|
-
}
|
|
1481
|
-
}, ownerState.loadingPosition === 'start' && ownerState.fullWidth && {
|
|
1482
|
-
[`& .${loadingButtonClasses.startIconLoadingStart}, & .${loadingButtonClasses.endIconLoadingEnd}`]: {
|
|
1483
|
-
transition: theme.transitions.create(['opacity'], {
|
|
1484
|
-
duration: theme.transitions.duration.short
|
|
1485
|
-
}),
|
|
1486
|
-
opacity: 0,
|
|
1487
|
-
marginRight: -8
|
|
1488
|
-
}
|
|
1489
|
-
}, ownerState.loadingPosition === 'end' && ownerState.fullWidth && {
|
|
1490
|
-
[`& .${loadingButtonClasses.startIconLoadingStart}, & .${loadingButtonClasses.endIconLoadingEnd}`]: {
|
|
1491
|
-
transition: theme.transitions.create(['opacity'], {
|
|
1492
|
-
duration: theme.transitions.duration.short
|
|
1493
|
-
}),
|
|
1494
|
-
opacity: 0,
|
|
1495
|
-
marginLeft: -8
|
|
1496
|
-
}
|
|
1497
|
-
}));
|
|
1498
|
-
const LoadingButtonLoadingIndicator = styled('span', {
|
|
1499
|
-
name: 'MuiLoadingButton',
|
|
1500
|
-
slot: 'LoadingIndicator',
|
|
1501
|
-
overridesResolver: (props, styles) => {
|
|
1502
|
-
const {
|
|
1503
|
-
ownerState
|
|
1504
|
-
} = props;
|
|
1505
|
-
return [styles.loadingIndicator, styles[`loadingIndicator${capitalize(ownerState.loadingPosition)}`]];
|
|
1506
|
-
}
|
|
1507
|
-
})(({
|
|
1508
|
-
theme,
|
|
1509
|
-
ownerState
|
|
1510
|
-
}) => _extends({
|
|
1511
|
-
position: 'absolute',
|
|
1512
|
-
visibility: 'visible',
|
|
1513
|
-
display: 'flex'
|
|
1514
|
-
}, ownerState.loadingPosition === 'start' && (ownerState.variant === 'outlined' || ownerState.variant === 'contained') && {
|
|
1515
|
-
left: ownerState.size === 'small' ? 10 : 14
|
|
1516
|
-
}, ownerState.loadingPosition === 'start' && ownerState.variant === 'text' && {
|
|
1517
|
-
left: 6
|
|
1518
|
-
}, ownerState.loadingPosition === 'center' && {
|
|
1519
|
-
left: '50%',
|
|
1520
|
-
transform: 'translate(-50%)',
|
|
1521
|
-
color: (theme.vars || theme).palette.action.disabled
|
|
1522
|
-
}, ownerState.loadingPosition === 'end' && (ownerState.variant === 'outlined' || ownerState.variant === 'contained') && {
|
|
1523
|
-
right: ownerState.size === 'small' ? 10 : 14
|
|
1524
|
-
}, ownerState.loadingPosition === 'end' && ownerState.variant === 'text' && {
|
|
1525
|
-
right: 6
|
|
1526
|
-
}, ownerState.loadingPosition === 'start' && ownerState.fullWidth && {
|
|
1527
|
-
position: 'relative',
|
|
1528
|
-
left: -10
|
|
1529
|
-
}, ownerState.loadingPosition === 'end' && ownerState.fullWidth && {
|
|
1530
|
-
position: 'relative',
|
|
1531
|
-
right: -10
|
|
1532
|
-
}));
|
|
1533
|
-
const LoadingButton = /*#__PURE__*/React.forwardRef(function LoadingButton(inProps, ref) {
|
|
1534
|
-
const contextProps = React.useContext(ButtonGroupContext);
|
|
1535
|
-
const resolvedProps = resolveProps(contextProps, inProps);
|
|
1536
|
-
const props = useDefaultProps({
|
|
1537
|
-
props: resolvedProps,
|
|
1538
|
-
name: 'MuiLoadingButton'
|
|
1539
|
-
});
|
|
1540
|
-
const {
|
|
1541
|
-
children,
|
|
1542
|
-
disabled = false,
|
|
1543
|
-
id: idProp,
|
|
1544
|
-
loading = false,
|
|
1545
|
-
loadingIndicator: loadingIndicatorProp,
|
|
1546
|
-
loadingPosition = 'center',
|
|
1547
|
-
variant = 'text'
|
|
1548
|
-
} = props,
|
|
1549
|
-
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
1550
|
-
const id = unstable_useId(idProp);
|
|
1551
|
-
const loadingIndicator = loadingIndicatorProp != null ? loadingIndicatorProp : /*#__PURE__*/jsx(CircularProgress, {
|
|
1552
|
-
"aria-labelledby": id,
|
|
1553
|
-
color: "inherit",
|
|
1554
|
-
size: 16
|
|
1555
|
-
});
|
|
1556
|
-
const ownerState = _extends({}, props, {
|
|
1557
|
-
disabled,
|
|
1558
|
-
loading,
|
|
1559
|
-
loadingIndicator,
|
|
1560
|
-
loadingPosition,
|
|
1561
|
-
variant
|
|
1562
|
-
});
|
|
1563
|
-
const classes = useUtilityClasses(ownerState);
|
|
1564
|
-
const loadingButtonLoadingIndicator = loading ? /*#__PURE__*/jsx(LoadingButtonLoadingIndicator, {
|
|
1565
|
-
className: classes.loadingIndicator,
|
|
1566
|
-
ownerState: ownerState,
|
|
1567
|
-
children: loadingIndicator
|
|
1568
|
-
}) : null;
|
|
1569
|
-
return /*#__PURE__*/jsxs(LoadingButtonRoot, _extends({
|
|
1570
|
-
disabled: disabled || loading,
|
|
1571
|
-
id: id,
|
|
1572
|
-
ref: ref
|
|
1573
|
-
}, other, {
|
|
1574
|
-
variant: variant,
|
|
1575
|
-
classes: classes,
|
|
1576
|
-
ownerState: ownerState,
|
|
1577
|
-
children: [ownerState.loadingPosition === 'end' ? children : loadingButtonLoadingIndicator, ownerState.loadingPosition === 'end' ? loadingButtonLoadingIndicator : children]
|
|
1578
|
-
}));
|
|
1579
|
-
});
|
|
1580
|
-
process.env.NODE_ENV !== "production" ? LoadingButton.propTypes /* remove-proptypes */ = {
|
|
1581
|
-
// ┌────────────────────────────── Warning ──────────────────────────────┐
|
|
1582
|
-
// │ These PropTypes are generated from the TypeScript type definitions. │
|
|
1583
|
-
// │ To update them, edit the d.ts file and run `pnpm proptypes`. │
|
|
1584
|
-
// └─────────────────────────────────────────────────────────────────────┘
|
|
1585
|
-
/**
|
|
1586
|
-
* The content of the component.
|
|
1587
|
-
*/
|
|
1588
|
-
children: PropTypes.node,
|
|
1589
|
-
/**
|
|
1590
|
-
* Override or extend the styles applied to the component.
|
|
1591
|
-
*/
|
|
1592
|
-
classes: PropTypes.object,
|
|
1593
|
-
/**
|
|
1594
|
-
* If `true`, the component is disabled.
|
|
1595
|
-
* @default false
|
|
1596
|
-
*/
|
|
1597
|
-
disabled: PropTypes.bool,
|
|
1598
|
-
/**
|
|
1599
|
-
* @ignore
|
|
1600
|
-
*/
|
|
1601
|
-
id: PropTypes.string,
|
|
1602
|
-
/**
|
|
1603
|
-
* If `true`, the loading indicator is shown and the button becomes disabled.
|
|
1604
|
-
* @default false
|
|
1605
|
-
*/
|
|
1606
|
-
loading: PropTypes.bool,
|
|
1607
|
-
/**
|
|
1608
|
-
* Element placed before the children if the button is in loading state.
|
|
1609
|
-
* The node should contain an element with `role="progressbar"` with an accessible name.
|
|
1610
|
-
* By default we render a `CircularProgress` that is labelled by the button itself.
|
|
1611
|
-
* @default <CircularProgress color="inherit" size={16} />
|
|
1612
|
-
*/
|
|
1613
|
-
loadingIndicator: PropTypes.node,
|
|
1614
|
-
/**
|
|
1615
|
-
* The loading indicator can be positioned on the start, end, or the center of the button.
|
|
1616
|
-
* @default 'center'
|
|
1617
|
-
*/
|
|
1618
|
-
loadingPosition: chainPropTypes(PropTypes.oneOf(['start', 'end', 'center']), props => {
|
|
1619
|
-
if (props.loadingPosition === 'start' && !props.startIcon) {
|
|
1620
|
-
return new Error(`MUI: The loadingPosition="start" should be used in combination with startIcon.`);
|
|
1621
|
-
}
|
|
1622
|
-
if (props.loadingPosition === 'end' && !props.endIcon) {
|
|
1623
|
-
return new Error(`MUI: The loadingPosition="end" should be used in combination with endIcon.`);
|
|
1624
|
-
}
|
|
1625
|
-
return null;
|
|
1626
|
-
}),
|
|
1627
|
-
/**
|
|
1628
|
-
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
1629
|
-
*/
|
|
1630
|
-
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
|
|
1631
|
-
/**
|
|
1632
|
-
* The variant to use.
|
|
1633
|
-
* @default 'text'
|
|
1634
|
-
*/
|
|
1635
|
-
variant: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([PropTypes.oneOf(['contained', 'outlined', 'text']), PropTypes.string])
|
|
1636
|
-
} : void 0;
|
|
1637
|
-
|
|
1638
|
-
/**
|
|
1639
|
-
* This method returns `undefined`.
|
|
1640
|
-
*
|
|
1641
|
-
* @static
|
|
1642
|
-
* @memberOf _
|
|
1643
|
-
* @since 2.3.0
|
|
1644
|
-
* @category Util
|
|
1645
|
-
* @example
|
|
1646
|
-
*
|
|
1647
|
-
* _.times(2, _.noop);
|
|
1648
|
-
* // => [undefined, undefined]
|
|
1649
|
-
*/
|
|
1650
|
-
|
|
1651
|
-
var noop_1;
|
|
1652
|
-
var hasRequiredNoop;
|
|
1653
|
-
|
|
1654
|
-
function requireNoop () {
|
|
1655
|
-
if (hasRequiredNoop) return noop_1;
|
|
1656
|
-
hasRequiredNoop = 1;
|
|
1657
|
-
function noop() {
|
|
1658
|
-
// No operation performed.
|
|
1659
|
-
}
|
|
1660
|
-
|
|
1661
|
-
noop_1 = noop;
|
|
1662
|
-
return noop_1;
|
|
1663
|
-
}
|
|
1664
|
-
|
|
1665
|
-
var noopExports = requireNoop();
|
|
1666
|
-
const _noop = /*@__PURE__*/getDefaultExportFromCjs(noopExports);
|
|
1667
|
-
|
|
1668
|
-
/** Used for built-in method references. */
|
|
1669
|
-
|
|
1670
|
-
var _isPrototype;
|
|
1671
|
-
var hasRequired_isPrototype;
|
|
1672
|
-
|
|
1673
|
-
function require_isPrototype () {
|
|
1674
|
-
if (hasRequired_isPrototype) return _isPrototype;
|
|
1675
|
-
hasRequired_isPrototype = 1;
|
|
1676
|
-
var objectProto = Object.prototype;
|
|
1677
|
-
|
|
1678
|
-
/**
|
|
1679
|
-
* Checks if `value` is likely a prototype object.
|
|
1680
|
-
*
|
|
1681
|
-
* @private
|
|
1682
|
-
* @param {*} value The value to check.
|
|
1683
|
-
* @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
|
|
1684
|
-
*/
|
|
1685
|
-
function isPrototype(value) {
|
|
1686
|
-
var Ctor = value && value.constructor,
|
|
1687
|
-
proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;
|
|
1688
|
-
|
|
1689
|
-
return value === proto;
|
|
1690
|
-
}
|
|
1691
|
-
|
|
1692
|
-
_isPrototype = isPrototype;
|
|
1693
|
-
return _isPrototype;
|
|
1694
|
-
}
|
|
1695
|
-
|
|
1696
|
-
/**
|
|
1697
|
-
* Creates a unary function that invokes `func` with its argument transformed.
|
|
1698
|
-
*
|
|
1699
|
-
* @private
|
|
1700
|
-
* @param {Function} func The function to wrap.
|
|
1701
|
-
* @param {Function} transform The argument transform.
|
|
1702
|
-
* @returns {Function} Returns the new function.
|
|
1703
|
-
*/
|
|
1704
|
-
|
|
1705
|
-
var _overArg;
|
|
1706
|
-
var hasRequired_overArg;
|
|
1707
|
-
|
|
1708
|
-
function require_overArg () {
|
|
1709
|
-
if (hasRequired_overArg) return _overArg;
|
|
1710
|
-
hasRequired_overArg = 1;
|
|
1711
|
-
function overArg(func, transform) {
|
|
1712
|
-
return function(arg) {
|
|
1713
|
-
return func(transform(arg));
|
|
1714
|
-
};
|
|
1715
|
-
}
|
|
1716
|
-
|
|
1717
|
-
_overArg = overArg;
|
|
1718
|
-
return _overArg;
|
|
1719
|
-
}
|
|
1720
|
-
|
|
1721
|
-
var _nativeKeys;
|
|
1722
|
-
var hasRequired_nativeKeys;
|
|
1723
|
-
|
|
1724
|
-
function require_nativeKeys () {
|
|
1725
|
-
if (hasRequired_nativeKeys) return _nativeKeys;
|
|
1726
|
-
hasRequired_nativeKeys = 1;
|
|
1727
|
-
var overArg = require_overArg();
|
|
1728
|
-
|
|
1729
|
-
/* Built-in method references for those with the same name as other `lodash` methods. */
|
|
1730
|
-
var nativeKeys = overArg(Object.keys, Object);
|
|
1731
|
-
|
|
1732
|
-
_nativeKeys = nativeKeys;
|
|
1733
|
-
return _nativeKeys;
|
|
1734
|
-
}
|
|
1735
|
-
|
|
1736
|
-
var _baseKeys;
|
|
1737
|
-
var hasRequired_baseKeys;
|
|
1738
|
-
|
|
1739
|
-
function require_baseKeys () {
|
|
1740
|
-
if (hasRequired_baseKeys) return _baseKeys;
|
|
1741
|
-
hasRequired_baseKeys = 1;
|
|
1742
|
-
var isPrototype = require_isPrototype(),
|
|
1743
|
-
nativeKeys = require_nativeKeys();
|
|
1744
|
-
|
|
1745
|
-
/** Used for built-in method references. */
|
|
1746
|
-
var objectProto = Object.prototype;
|
|
1747
|
-
|
|
1748
|
-
/** Used to check objects for own properties. */
|
|
1749
|
-
var hasOwnProperty = objectProto.hasOwnProperty;
|
|
1750
|
-
|
|
1751
|
-
/**
|
|
1752
|
-
* The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
|
|
1753
|
-
*
|
|
1754
|
-
* @private
|
|
1755
|
-
* @param {Object} object The object to query.
|
|
1756
|
-
* @returns {Array} Returns the array of property names.
|
|
1757
|
-
*/
|
|
1758
|
-
function baseKeys(object) {
|
|
1759
|
-
if (!isPrototype(object)) {
|
|
1760
|
-
return nativeKeys(object);
|
|
1761
|
-
}
|
|
1762
|
-
var result = [];
|
|
1763
|
-
for (var key in Object(object)) {
|
|
1764
|
-
if (hasOwnProperty.call(object, key) && key != 'constructor') {
|
|
1765
|
-
result.push(key);
|
|
1766
|
-
}
|
|
1767
|
-
}
|
|
1768
|
-
return result;
|
|
1769
|
-
}
|
|
1770
|
-
|
|
1771
|
-
_baseKeys = baseKeys;
|
|
1772
|
-
return _baseKeys;
|
|
1773
|
-
}
|
|
1774
|
-
|
|
1775
|
-
/** Detect free variable `global` from Node.js. */
|
|
1776
|
-
|
|
1777
|
-
var _freeGlobal;
|
|
1778
|
-
var hasRequired_freeGlobal;
|
|
1779
|
-
|
|
1780
|
-
function require_freeGlobal () {
|
|
1781
|
-
if (hasRequired_freeGlobal) return _freeGlobal;
|
|
1782
|
-
hasRequired_freeGlobal = 1;
|
|
1783
|
-
var freeGlobal = typeof commonjsGlobal == 'object' && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal;
|
|
1784
|
-
|
|
1785
|
-
_freeGlobal = freeGlobal;
|
|
1786
|
-
return _freeGlobal;
|
|
1787
|
-
}
|
|
1788
|
-
|
|
1789
|
-
var _root;
|
|
1790
|
-
var hasRequired_root;
|
|
1791
|
-
|
|
1792
|
-
function require_root () {
|
|
1793
|
-
if (hasRequired_root) return _root;
|
|
1794
|
-
hasRequired_root = 1;
|
|
1795
|
-
var freeGlobal = require_freeGlobal();
|
|
1796
|
-
|
|
1797
|
-
/** Detect free variable `self`. */
|
|
1798
|
-
var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
|
|
1799
|
-
|
|
1800
|
-
/** Used as a reference to the global object. */
|
|
1801
|
-
var root = freeGlobal || freeSelf || Function('return this')();
|
|
1802
|
-
|
|
1803
|
-
_root = root;
|
|
1804
|
-
return _root;
|
|
1805
|
-
}
|
|
1806
|
-
|
|
1807
|
-
var _Symbol;
|
|
1808
|
-
var hasRequired_Symbol;
|
|
1809
|
-
|
|
1810
|
-
function require_Symbol () {
|
|
1811
|
-
if (hasRequired_Symbol) return _Symbol;
|
|
1812
|
-
hasRequired_Symbol = 1;
|
|
1813
|
-
var root = require_root();
|
|
1814
|
-
|
|
1815
|
-
/** Built-in value references. */
|
|
1816
|
-
var Symbol = root.Symbol;
|
|
1817
|
-
|
|
1818
|
-
_Symbol = Symbol;
|
|
1819
|
-
return _Symbol;
|
|
1820
|
-
}
|
|
1821
|
-
|
|
1822
|
-
var _getRawTag;
|
|
1823
|
-
var hasRequired_getRawTag;
|
|
1824
|
-
|
|
1825
|
-
function require_getRawTag () {
|
|
1826
|
-
if (hasRequired_getRawTag) return _getRawTag;
|
|
1827
|
-
hasRequired_getRawTag = 1;
|
|
1828
|
-
var Symbol = require_Symbol();
|
|
1829
|
-
|
|
1830
|
-
/** Used for built-in method references. */
|
|
1831
|
-
var objectProto = Object.prototype;
|
|
1832
|
-
|
|
1833
|
-
/** Used to check objects for own properties. */
|
|
1834
|
-
var hasOwnProperty = objectProto.hasOwnProperty;
|
|
1835
|
-
|
|
1836
|
-
/**
|
|
1837
|
-
* Used to resolve the
|
|
1838
|
-
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
|
|
1839
|
-
* of values.
|
|
1840
|
-
*/
|
|
1841
|
-
var nativeObjectToString = objectProto.toString;
|
|
1842
|
-
|
|
1843
|
-
/** Built-in value references. */
|
|
1844
|
-
var symToStringTag = Symbol ? Symbol.toStringTag : undefined;
|
|
1845
|
-
|
|
1846
|
-
/**
|
|
1847
|
-
* A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
|
|
1848
|
-
*
|
|
1849
|
-
* @private
|
|
1850
|
-
* @param {*} value The value to query.
|
|
1851
|
-
* @returns {string} Returns the raw `toStringTag`.
|
|
1852
|
-
*/
|
|
1853
|
-
function getRawTag(value) {
|
|
1854
|
-
var isOwn = hasOwnProperty.call(value, symToStringTag),
|
|
1855
|
-
tag = value[symToStringTag];
|
|
1856
|
-
|
|
1857
|
-
try {
|
|
1858
|
-
value[symToStringTag] = undefined;
|
|
1859
|
-
var unmasked = true;
|
|
1860
|
-
} catch (e) {}
|
|
1861
|
-
|
|
1862
|
-
var result = nativeObjectToString.call(value);
|
|
1863
|
-
if (unmasked) {
|
|
1864
|
-
if (isOwn) {
|
|
1865
|
-
value[symToStringTag] = tag;
|
|
1866
|
-
} else {
|
|
1867
|
-
delete value[symToStringTag];
|
|
1868
|
-
}
|
|
1869
|
-
}
|
|
1870
|
-
return result;
|
|
1871
|
-
}
|
|
1872
|
-
|
|
1873
|
-
_getRawTag = getRawTag;
|
|
1874
|
-
return _getRawTag;
|
|
1875
|
-
}
|
|
1876
|
-
|
|
1877
|
-
/** Used for built-in method references. */
|
|
1878
|
-
|
|
1879
|
-
var _objectToString;
|
|
1880
|
-
var hasRequired_objectToString;
|
|
1881
|
-
|
|
1882
|
-
function require_objectToString () {
|
|
1883
|
-
if (hasRequired_objectToString) return _objectToString;
|
|
1884
|
-
hasRequired_objectToString = 1;
|
|
1885
|
-
var objectProto = Object.prototype;
|
|
1886
|
-
|
|
1887
|
-
/**
|
|
1888
|
-
* Used to resolve the
|
|
1889
|
-
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
|
|
1890
|
-
* of values.
|
|
1891
|
-
*/
|
|
1892
|
-
var nativeObjectToString = objectProto.toString;
|
|
1893
|
-
|
|
1894
|
-
/**
|
|
1895
|
-
* Converts `value` to a string using `Object.prototype.toString`.
|
|
1896
|
-
*
|
|
1897
|
-
* @private
|
|
1898
|
-
* @param {*} value The value to convert.
|
|
1899
|
-
* @returns {string} Returns the converted string.
|
|
1900
|
-
*/
|
|
1901
|
-
function objectToString(value) {
|
|
1902
|
-
return nativeObjectToString.call(value);
|
|
1903
|
-
}
|
|
1904
|
-
|
|
1905
|
-
_objectToString = objectToString;
|
|
1906
|
-
return _objectToString;
|
|
1907
|
-
}
|
|
1908
|
-
|
|
1909
|
-
var _baseGetTag;
|
|
1910
|
-
var hasRequired_baseGetTag;
|
|
1911
|
-
|
|
1912
|
-
function require_baseGetTag () {
|
|
1913
|
-
if (hasRequired_baseGetTag) return _baseGetTag;
|
|
1914
|
-
hasRequired_baseGetTag = 1;
|
|
1915
|
-
var Symbol = require_Symbol(),
|
|
1916
|
-
getRawTag = require_getRawTag(),
|
|
1917
|
-
objectToString = require_objectToString();
|
|
1918
|
-
|
|
1919
|
-
/** `Object#toString` result references. */
|
|
1920
|
-
var nullTag = '[object Null]',
|
|
1921
|
-
undefinedTag = '[object Undefined]';
|
|
1922
|
-
|
|
1923
|
-
/** Built-in value references. */
|
|
1924
|
-
var symToStringTag = Symbol ? Symbol.toStringTag : undefined;
|
|
1925
|
-
|
|
1926
|
-
/**
|
|
1927
|
-
* The base implementation of `getTag` without fallbacks for buggy environments.
|
|
1928
|
-
*
|
|
1929
|
-
* @private
|
|
1930
|
-
* @param {*} value The value to query.
|
|
1931
|
-
* @returns {string} Returns the `toStringTag`.
|
|
1932
|
-
*/
|
|
1933
|
-
function baseGetTag(value) {
|
|
1934
|
-
if (value == null) {
|
|
1935
|
-
return value === undefined ? undefinedTag : nullTag;
|
|
1936
|
-
}
|
|
1937
|
-
return (symToStringTag && symToStringTag in Object(value))
|
|
1938
|
-
? getRawTag(value)
|
|
1939
|
-
: objectToString(value);
|
|
1940
|
-
}
|
|
1941
|
-
|
|
1942
|
-
_baseGetTag = baseGetTag;
|
|
1943
|
-
return _baseGetTag;
|
|
1944
|
-
}
|
|
1945
|
-
|
|
1946
|
-
/**
|
|
1947
|
-
* Checks if `value` is the
|
|
1948
|
-
* [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
|
|
1949
|
-
* of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
|
|
1950
|
-
*
|
|
1951
|
-
* @static
|
|
1952
|
-
* @memberOf _
|
|
1953
|
-
* @since 0.1.0
|
|
1954
|
-
* @category Lang
|
|
1955
|
-
* @param {*} value The value to check.
|
|
1956
|
-
* @returns {boolean} Returns `true` if `value` is an object, else `false`.
|
|
1957
|
-
* @example
|
|
1958
|
-
*
|
|
1959
|
-
* _.isObject({});
|
|
1960
|
-
* // => true
|
|
1961
|
-
*
|
|
1962
|
-
* _.isObject([1, 2, 3]);
|
|
1963
|
-
* // => true
|
|
1964
|
-
*
|
|
1965
|
-
* _.isObject(_.noop);
|
|
1966
|
-
* // => true
|
|
1967
|
-
*
|
|
1968
|
-
* _.isObject(null);
|
|
1969
|
-
* // => false
|
|
1970
|
-
*/
|
|
1971
|
-
|
|
1972
|
-
var isObject_1;
|
|
1973
|
-
var hasRequiredIsObject;
|
|
1974
|
-
|
|
1975
|
-
function requireIsObject () {
|
|
1976
|
-
if (hasRequiredIsObject) return isObject_1;
|
|
1977
|
-
hasRequiredIsObject = 1;
|
|
1978
|
-
function isObject(value) {
|
|
1979
|
-
var type = typeof value;
|
|
1980
|
-
return value != null && (type == 'object' || type == 'function');
|
|
1981
|
-
}
|
|
1982
|
-
|
|
1983
|
-
isObject_1 = isObject;
|
|
1984
|
-
return isObject_1;
|
|
1985
|
-
}
|
|
1986
|
-
|
|
1987
|
-
var isFunction_1;
|
|
1988
|
-
var hasRequiredIsFunction;
|
|
1989
|
-
|
|
1990
|
-
function requireIsFunction () {
|
|
1991
|
-
if (hasRequiredIsFunction) return isFunction_1;
|
|
1992
|
-
hasRequiredIsFunction = 1;
|
|
1993
|
-
var baseGetTag = require_baseGetTag(),
|
|
1994
|
-
isObject = requireIsObject();
|
|
1995
|
-
|
|
1996
|
-
/** `Object#toString` result references. */
|
|
1997
|
-
var asyncTag = '[object AsyncFunction]',
|
|
1998
|
-
funcTag = '[object Function]',
|
|
1999
|
-
genTag = '[object GeneratorFunction]',
|
|
2000
|
-
proxyTag = '[object Proxy]';
|
|
2001
|
-
|
|
2002
|
-
/**
|
|
2003
|
-
* Checks if `value` is classified as a `Function` object.
|
|
2004
|
-
*
|
|
2005
|
-
* @static
|
|
2006
|
-
* @memberOf _
|
|
2007
|
-
* @since 0.1.0
|
|
2008
|
-
* @category Lang
|
|
2009
|
-
* @param {*} value The value to check.
|
|
2010
|
-
* @returns {boolean} Returns `true` if `value` is a function, else `false`.
|
|
2011
|
-
* @example
|
|
2012
|
-
*
|
|
2013
|
-
* _.isFunction(_);
|
|
2014
|
-
* // => true
|
|
2015
|
-
*
|
|
2016
|
-
* _.isFunction(/abc/);
|
|
2017
|
-
* // => false
|
|
2018
|
-
*/
|
|
2019
|
-
function isFunction(value) {
|
|
2020
|
-
if (!isObject(value)) {
|
|
2021
|
-
return false;
|
|
2022
|
-
}
|
|
2023
|
-
// The use of `Object#toString` avoids issues with the `typeof` operator
|
|
2024
|
-
// in Safari 9 which returns 'object' for typed arrays and other constructors.
|
|
2025
|
-
var tag = baseGetTag(value);
|
|
2026
|
-
return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
|
|
2027
|
-
}
|
|
2028
|
-
|
|
2029
|
-
isFunction_1 = isFunction;
|
|
2030
|
-
return isFunction_1;
|
|
2031
|
-
}
|
|
2032
|
-
|
|
2033
|
-
var _coreJsData;
|
|
2034
|
-
var hasRequired_coreJsData;
|
|
2035
|
-
|
|
2036
|
-
function require_coreJsData () {
|
|
2037
|
-
if (hasRequired_coreJsData) return _coreJsData;
|
|
2038
|
-
hasRequired_coreJsData = 1;
|
|
2039
|
-
var root = require_root();
|
|
2040
|
-
|
|
2041
|
-
/** Used to detect overreaching core-js shims. */
|
|
2042
|
-
var coreJsData = root['__core-js_shared__'];
|
|
2043
|
-
|
|
2044
|
-
_coreJsData = coreJsData;
|
|
2045
|
-
return _coreJsData;
|
|
2046
|
-
}
|
|
2047
|
-
|
|
2048
|
-
var _isMasked;
|
|
2049
|
-
var hasRequired_isMasked;
|
|
2050
|
-
|
|
2051
|
-
function require_isMasked () {
|
|
2052
|
-
if (hasRequired_isMasked) return _isMasked;
|
|
2053
|
-
hasRequired_isMasked = 1;
|
|
2054
|
-
var coreJsData = require_coreJsData();
|
|
2055
|
-
|
|
2056
|
-
/** Used to detect methods masquerading as native. */
|
|
2057
|
-
var maskSrcKey = (function() {
|
|
2058
|
-
var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
|
|
2059
|
-
return uid ? ('Symbol(src)_1.' + uid) : '';
|
|
2060
|
-
}());
|
|
2061
|
-
|
|
2062
|
-
/**
|
|
2063
|
-
* Checks if `func` has its source masked.
|
|
2064
|
-
*
|
|
2065
|
-
* @private
|
|
2066
|
-
* @param {Function} func The function to check.
|
|
2067
|
-
* @returns {boolean} Returns `true` if `func` is masked, else `false`.
|
|
2068
|
-
*/
|
|
2069
|
-
function isMasked(func) {
|
|
2070
|
-
return !!maskSrcKey && (maskSrcKey in func);
|
|
2071
|
-
}
|
|
2072
|
-
|
|
2073
|
-
_isMasked = isMasked;
|
|
2074
|
-
return _isMasked;
|
|
2075
|
-
}
|
|
2076
|
-
|
|
2077
|
-
/** Used for built-in method references. */
|
|
2078
|
-
|
|
2079
|
-
var _toSource;
|
|
2080
|
-
var hasRequired_toSource;
|
|
2081
|
-
|
|
2082
|
-
function require_toSource () {
|
|
2083
|
-
if (hasRequired_toSource) return _toSource;
|
|
2084
|
-
hasRequired_toSource = 1;
|
|
2085
|
-
var funcProto = Function.prototype;
|
|
2086
|
-
|
|
2087
|
-
/** Used to resolve the decompiled source of functions. */
|
|
2088
|
-
var funcToString = funcProto.toString;
|
|
2089
|
-
|
|
2090
|
-
/**
|
|
2091
|
-
* Converts `func` to its source code.
|
|
2092
|
-
*
|
|
2093
|
-
* @private
|
|
2094
|
-
* @param {Function} func The function to convert.
|
|
2095
|
-
* @returns {string} Returns the source code.
|
|
2096
|
-
*/
|
|
2097
|
-
function toSource(func) {
|
|
2098
|
-
if (func != null) {
|
|
2099
|
-
try {
|
|
2100
|
-
return funcToString.call(func);
|
|
2101
|
-
} catch (e) {}
|
|
2102
|
-
try {
|
|
2103
|
-
return (func + '');
|
|
2104
|
-
} catch (e) {}
|
|
2105
|
-
}
|
|
2106
|
-
return '';
|
|
2107
|
-
}
|
|
2108
|
-
|
|
2109
|
-
_toSource = toSource;
|
|
2110
|
-
return _toSource;
|
|
2111
|
-
}
|
|
2112
|
-
|
|
2113
|
-
var _baseIsNative;
|
|
2114
|
-
var hasRequired_baseIsNative;
|
|
2115
|
-
|
|
2116
|
-
function require_baseIsNative () {
|
|
2117
|
-
if (hasRequired_baseIsNative) return _baseIsNative;
|
|
2118
|
-
hasRequired_baseIsNative = 1;
|
|
2119
|
-
var isFunction = requireIsFunction(),
|
|
2120
|
-
isMasked = require_isMasked(),
|
|
2121
|
-
isObject = requireIsObject(),
|
|
2122
|
-
toSource = require_toSource();
|
|
2123
|
-
|
|
2124
|
-
/**
|
|
2125
|
-
* Used to match `RegExp`
|
|
2126
|
-
* [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
|
|
2127
|
-
*/
|
|
2128
|
-
var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
|
|
2129
|
-
|
|
2130
|
-
/** Used to detect host constructors (Safari). */
|
|
2131
|
-
var reIsHostCtor = /^\[object .+?Constructor\]$/;
|
|
2132
|
-
|
|
2133
|
-
/** Used for built-in method references. */
|
|
2134
|
-
var funcProto = Function.prototype,
|
|
2135
|
-
objectProto = Object.prototype;
|
|
2136
|
-
|
|
2137
|
-
/** Used to resolve the decompiled source of functions. */
|
|
2138
|
-
var funcToString = funcProto.toString;
|
|
2139
|
-
|
|
2140
|
-
/** Used to check objects for own properties. */
|
|
2141
|
-
var hasOwnProperty = objectProto.hasOwnProperty;
|
|
2142
|
-
|
|
2143
|
-
/** Used to detect if a method is native. */
|
|
2144
|
-
var reIsNative = RegExp('^' +
|
|
2145
|
-
funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
|
|
2146
|
-
.replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
|
|
2147
|
-
);
|
|
2148
|
-
|
|
2149
|
-
/**
|
|
2150
|
-
* The base implementation of `_.isNative` without bad shim checks.
|
|
2151
|
-
*
|
|
2152
|
-
* @private
|
|
2153
|
-
* @param {*} value The value to check.
|
|
2154
|
-
* @returns {boolean} Returns `true` if `value` is a native function,
|
|
2155
|
-
* else `false`.
|
|
2156
|
-
*/
|
|
2157
|
-
function baseIsNative(value) {
|
|
2158
|
-
if (!isObject(value) || isMasked(value)) {
|
|
2159
|
-
return false;
|
|
2160
|
-
}
|
|
2161
|
-
var pattern = isFunction(value) ? reIsNative : reIsHostCtor;
|
|
2162
|
-
return pattern.test(toSource(value));
|
|
2163
|
-
}
|
|
2164
|
-
|
|
2165
|
-
_baseIsNative = baseIsNative;
|
|
2166
|
-
return _baseIsNative;
|
|
2167
|
-
}
|
|
2168
|
-
|
|
2169
|
-
/**
|
|
2170
|
-
* Gets the value at `key` of `object`.
|
|
2171
|
-
*
|
|
2172
|
-
* @private
|
|
2173
|
-
* @param {Object} [object] The object to query.
|
|
2174
|
-
* @param {string} key The key of the property to get.
|
|
2175
|
-
* @returns {*} Returns the property value.
|
|
2176
|
-
*/
|
|
2177
|
-
|
|
2178
|
-
var _getValue;
|
|
2179
|
-
var hasRequired_getValue;
|
|
2180
|
-
|
|
2181
|
-
function require_getValue () {
|
|
2182
|
-
if (hasRequired_getValue) return _getValue;
|
|
2183
|
-
hasRequired_getValue = 1;
|
|
2184
|
-
function getValue(object, key) {
|
|
2185
|
-
return object == null ? undefined : object[key];
|
|
2186
|
-
}
|
|
2187
|
-
|
|
2188
|
-
_getValue = getValue;
|
|
2189
|
-
return _getValue;
|
|
2190
|
-
}
|
|
2191
|
-
|
|
2192
|
-
var _getNative;
|
|
2193
|
-
var hasRequired_getNative;
|
|
2194
|
-
|
|
2195
|
-
function require_getNative () {
|
|
2196
|
-
if (hasRequired_getNative) return _getNative;
|
|
2197
|
-
hasRequired_getNative = 1;
|
|
2198
|
-
var baseIsNative = require_baseIsNative(),
|
|
2199
|
-
getValue = require_getValue();
|
|
2200
|
-
|
|
2201
|
-
/**
|
|
2202
|
-
* Gets the native function at `key` of `object`.
|
|
2203
|
-
*
|
|
2204
|
-
* @private
|
|
2205
|
-
* @param {Object} object The object to query.
|
|
2206
|
-
* @param {string} key The key of the method to get.
|
|
2207
|
-
* @returns {*} Returns the function if it's native, else `undefined`.
|
|
2208
|
-
*/
|
|
2209
|
-
function getNative(object, key) {
|
|
2210
|
-
var value = getValue(object, key);
|
|
2211
|
-
return baseIsNative(value) ? value : undefined;
|
|
2212
|
-
}
|
|
2213
|
-
|
|
2214
|
-
_getNative = getNative;
|
|
2215
|
-
return _getNative;
|
|
2216
|
-
}
|
|
2217
|
-
|
|
2218
|
-
var _DataView;
|
|
2219
|
-
var hasRequired_DataView;
|
|
2220
|
-
|
|
2221
|
-
function require_DataView () {
|
|
2222
|
-
if (hasRequired_DataView) return _DataView;
|
|
2223
|
-
hasRequired_DataView = 1;
|
|
2224
|
-
var getNative = require_getNative(),
|
|
2225
|
-
root = require_root();
|
|
2226
|
-
|
|
2227
|
-
/* Built-in method references that are verified to be native. */
|
|
2228
|
-
var DataView = getNative(root, 'DataView');
|
|
2229
|
-
|
|
2230
|
-
_DataView = DataView;
|
|
2231
|
-
return _DataView;
|
|
2232
|
-
}
|
|
2233
|
-
|
|
2234
|
-
var _Map;
|
|
2235
|
-
var hasRequired_Map;
|
|
2236
|
-
|
|
2237
|
-
function require_Map () {
|
|
2238
|
-
if (hasRequired_Map) return _Map;
|
|
2239
|
-
hasRequired_Map = 1;
|
|
2240
|
-
var getNative = require_getNative(),
|
|
2241
|
-
root = require_root();
|
|
2242
|
-
|
|
2243
|
-
/* Built-in method references that are verified to be native. */
|
|
2244
|
-
var Map = getNative(root, 'Map');
|
|
2245
|
-
|
|
2246
|
-
_Map = Map;
|
|
2247
|
-
return _Map;
|
|
2248
|
-
}
|
|
2249
|
-
|
|
2250
|
-
var _Promise;
|
|
2251
|
-
var hasRequired_Promise;
|
|
2252
|
-
|
|
2253
|
-
function require_Promise () {
|
|
2254
|
-
if (hasRequired_Promise) return _Promise;
|
|
2255
|
-
hasRequired_Promise = 1;
|
|
2256
|
-
var getNative = require_getNative(),
|
|
2257
|
-
root = require_root();
|
|
2258
|
-
|
|
2259
|
-
/* Built-in method references that are verified to be native. */
|
|
2260
|
-
var Promise = getNative(root, 'Promise');
|
|
2261
|
-
|
|
2262
|
-
_Promise = Promise;
|
|
2263
|
-
return _Promise;
|
|
2264
|
-
}
|
|
2265
|
-
|
|
2266
|
-
var _Set;
|
|
2267
|
-
var hasRequired_Set;
|
|
2268
|
-
|
|
2269
|
-
function require_Set () {
|
|
2270
|
-
if (hasRequired_Set) return _Set;
|
|
2271
|
-
hasRequired_Set = 1;
|
|
2272
|
-
var getNative = require_getNative(),
|
|
2273
|
-
root = require_root();
|
|
2274
|
-
|
|
2275
|
-
/* Built-in method references that are verified to be native. */
|
|
2276
|
-
var Set = getNative(root, 'Set');
|
|
2277
|
-
|
|
2278
|
-
_Set = Set;
|
|
2279
|
-
return _Set;
|
|
2280
|
-
}
|
|
2281
|
-
|
|
2282
|
-
var _WeakMap;
|
|
2283
|
-
var hasRequired_WeakMap;
|
|
2284
|
-
|
|
2285
|
-
function require_WeakMap () {
|
|
2286
|
-
if (hasRequired_WeakMap) return _WeakMap;
|
|
2287
|
-
hasRequired_WeakMap = 1;
|
|
2288
|
-
var getNative = require_getNative(),
|
|
2289
|
-
root = require_root();
|
|
2290
|
-
|
|
2291
|
-
/* Built-in method references that are verified to be native. */
|
|
2292
|
-
var WeakMap = getNative(root, 'WeakMap');
|
|
2293
|
-
|
|
2294
|
-
_WeakMap = WeakMap;
|
|
2295
|
-
return _WeakMap;
|
|
2296
|
-
}
|
|
2297
|
-
|
|
2298
|
-
var _getTag;
|
|
2299
|
-
var hasRequired_getTag;
|
|
2300
|
-
|
|
2301
|
-
function require_getTag () {
|
|
2302
|
-
if (hasRequired_getTag) return _getTag;
|
|
2303
|
-
hasRequired_getTag = 1;
|
|
2304
|
-
var DataView = require_DataView(),
|
|
2305
|
-
Map = require_Map(),
|
|
2306
|
-
Promise = require_Promise(),
|
|
2307
|
-
Set = require_Set(),
|
|
2308
|
-
WeakMap = require_WeakMap(),
|
|
2309
|
-
baseGetTag = require_baseGetTag(),
|
|
2310
|
-
toSource = require_toSource();
|
|
2311
|
-
|
|
2312
|
-
/** `Object#toString` result references. */
|
|
2313
|
-
var mapTag = '[object Map]',
|
|
2314
|
-
objectTag = '[object Object]',
|
|
2315
|
-
promiseTag = '[object Promise]',
|
|
2316
|
-
setTag = '[object Set]',
|
|
2317
|
-
weakMapTag = '[object WeakMap]';
|
|
2318
|
-
|
|
2319
|
-
var dataViewTag = '[object DataView]';
|
|
2320
|
-
|
|
2321
|
-
/** Used to detect maps, sets, and weakmaps. */
|
|
2322
|
-
var dataViewCtorString = toSource(DataView),
|
|
2323
|
-
mapCtorString = toSource(Map),
|
|
2324
|
-
promiseCtorString = toSource(Promise),
|
|
2325
|
-
setCtorString = toSource(Set),
|
|
2326
|
-
weakMapCtorString = toSource(WeakMap);
|
|
2327
|
-
|
|
2328
|
-
/**
|
|
2329
|
-
* Gets the `toStringTag` of `value`.
|
|
2330
|
-
*
|
|
2331
|
-
* @private
|
|
2332
|
-
* @param {*} value The value to query.
|
|
2333
|
-
* @returns {string} Returns the `toStringTag`.
|
|
2334
|
-
*/
|
|
2335
|
-
var getTag = baseGetTag;
|
|
2336
|
-
|
|
2337
|
-
// Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.
|
|
2338
|
-
if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||
|
|
2339
|
-
(Map && getTag(new Map) != mapTag) ||
|
|
2340
|
-
(Promise && getTag(Promise.resolve()) != promiseTag) ||
|
|
2341
|
-
(Set && getTag(new Set) != setTag) ||
|
|
2342
|
-
(WeakMap && getTag(new WeakMap) != weakMapTag)) {
|
|
2343
|
-
getTag = function(value) {
|
|
2344
|
-
var result = baseGetTag(value),
|
|
2345
|
-
Ctor = result == objectTag ? value.constructor : undefined,
|
|
2346
|
-
ctorString = Ctor ? toSource(Ctor) : '';
|
|
2347
|
-
|
|
2348
|
-
if (ctorString) {
|
|
2349
|
-
switch (ctorString) {
|
|
2350
|
-
case dataViewCtorString: return dataViewTag;
|
|
2351
|
-
case mapCtorString: return mapTag;
|
|
2352
|
-
case promiseCtorString: return promiseTag;
|
|
2353
|
-
case setCtorString: return setTag;
|
|
2354
|
-
case weakMapCtorString: return weakMapTag;
|
|
2355
|
-
}
|
|
2356
|
-
}
|
|
2357
|
-
return result;
|
|
2358
|
-
};
|
|
2359
|
-
}
|
|
2360
|
-
|
|
2361
|
-
_getTag = getTag;
|
|
2362
|
-
return _getTag;
|
|
2363
|
-
}
|
|
2364
|
-
|
|
2365
|
-
/**
|
|
2366
|
-
* Checks if `value` is object-like. A value is object-like if it's not `null`
|
|
2367
|
-
* and has a `typeof` result of "object".
|
|
2368
|
-
*
|
|
2369
|
-
* @static
|
|
2370
|
-
* @memberOf _
|
|
2371
|
-
* @since 4.0.0
|
|
2372
|
-
* @category Lang
|
|
2373
|
-
* @param {*} value The value to check.
|
|
2374
|
-
* @returns {boolean} Returns `true` if `value` is object-like, else `false`.
|
|
2375
|
-
* @example
|
|
2376
|
-
*
|
|
2377
|
-
* _.isObjectLike({});
|
|
2378
|
-
* // => true
|
|
2379
|
-
*
|
|
2380
|
-
* _.isObjectLike([1, 2, 3]);
|
|
2381
|
-
* // => true
|
|
2382
|
-
*
|
|
2383
|
-
* _.isObjectLike(_.noop);
|
|
2384
|
-
* // => false
|
|
2385
|
-
*
|
|
2386
|
-
* _.isObjectLike(null);
|
|
2387
|
-
* // => false
|
|
2388
|
-
*/
|
|
2389
|
-
|
|
2390
|
-
var isObjectLike_1;
|
|
2391
|
-
var hasRequiredIsObjectLike;
|
|
2392
|
-
|
|
2393
|
-
function requireIsObjectLike () {
|
|
2394
|
-
if (hasRequiredIsObjectLike) return isObjectLike_1;
|
|
2395
|
-
hasRequiredIsObjectLike = 1;
|
|
2396
|
-
function isObjectLike(value) {
|
|
2397
|
-
return value != null && typeof value == 'object';
|
|
2398
|
-
}
|
|
2399
|
-
|
|
2400
|
-
isObjectLike_1 = isObjectLike;
|
|
2401
|
-
return isObjectLike_1;
|
|
2402
|
-
}
|
|
2403
|
-
|
|
2404
|
-
var _baseIsArguments;
|
|
2405
|
-
var hasRequired_baseIsArguments;
|
|
2406
|
-
|
|
2407
|
-
function require_baseIsArguments () {
|
|
2408
|
-
if (hasRequired_baseIsArguments) return _baseIsArguments;
|
|
2409
|
-
hasRequired_baseIsArguments = 1;
|
|
2410
|
-
var baseGetTag = require_baseGetTag(),
|
|
2411
|
-
isObjectLike = requireIsObjectLike();
|
|
2412
|
-
|
|
2413
|
-
/** `Object#toString` result references. */
|
|
2414
|
-
var argsTag = '[object Arguments]';
|
|
2415
|
-
|
|
2416
|
-
/**
|
|
2417
|
-
* The base implementation of `_.isArguments`.
|
|
2418
|
-
*
|
|
2419
|
-
* @private
|
|
2420
|
-
* @param {*} value The value to check.
|
|
2421
|
-
* @returns {boolean} Returns `true` if `value` is an `arguments` object,
|
|
2422
|
-
*/
|
|
2423
|
-
function baseIsArguments(value) {
|
|
2424
|
-
return isObjectLike(value) && baseGetTag(value) == argsTag;
|
|
2425
|
-
}
|
|
2426
|
-
|
|
2427
|
-
_baseIsArguments = baseIsArguments;
|
|
2428
|
-
return _baseIsArguments;
|
|
2429
|
-
}
|
|
2430
|
-
|
|
2431
|
-
var isArguments_1;
|
|
2432
|
-
var hasRequiredIsArguments;
|
|
2433
|
-
|
|
2434
|
-
function requireIsArguments () {
|
|
2435
|
-
if (hasRequiredIsArguments) return isArguments_1;
|
|
2436
|
-
hasRequiredIsArguments = 1;
|
|
2437
|
-
var baseIsArguments = require_baseIsArguments(),
|
|
2438
|
-
isObjectLike = requireIsObjectLike();
|
|
2439
|
-
|
|
2440
|
-
/** Used for built-in method references. */
|
|
2441
|
-
var objectProto = Object.prototype;
|
|
2442
|
-
|
|
2443
|
-
/** Used to check objects for own properties. */
|
|
2444
|
-
var hasOwnProperty = objectProto.hasOwnProperty;
|
|
2445
|
-
|
|
2446
|
-
/** Built-in value references. */
|
|
2447
|
-
var propertyIsEnumerable = objectProto.propertyIsEnumerable;
|
|
2448
|
-
|
|
2449
|
-
/**
|
|
2450
|
-
* Checks if `value` is likely an `arguments` object.
|
|
2451
|
-
*
|
|
2452
|
-
* @static
|
|
2453
|
-
* @memberOf _
|
|
2454
|
-
* @since 0.1.0
|
|
2455
|
-
* @category Lang
|
|
2456
|
-
* @param {*} value The value to check.
|
|
2457
|
-
* @returns {boolean} Returns `true` if `value` is an `arguments` object,
|
|
2458
|
-
* else `false`.
|
|
2459
|
-
* @example
|
|
2460
|
-
*
|
|
2461
|
-
* _.isArguments(function() { return arguments; }());
|
|
2462
|
-
* // => true
|
|
2463
|
-
*
|
|
2464
|
-
* _.isArguments([1, 2, 3]);
|
|
2465
|
-
* // => false
|
|
2466
|
-
*/
|
|
2467
|
-
var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {
|
|
2468
|
-
return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&
|
|
2469
|
-
!propertyIsEnumerable.call(value, 'callee');
|
|
2470
|
-
};
|
|
2471
|
-
|
|
2472
|
-
isArguments_1 = isArguments;
|
|
2473
|
-
return isArguments_1;
|
|
2474
|
-
}
|
|
2475
|
-
|
|
2476
|
-
/**
|
|
2477
|
-
* Checks if `value` is classified as an `Array` object.
|
|
2478
|
-
*
|
|
2479
|
-
* @static
|
|
2480
|
-
* @memberOf _
|
|
2481
|
-
* @since 0.1.0
|
|
2482
|
-
* @category Lang
|
|
2483
|
-
* @param {*} value The value to check.
|
|
2484
|
-
* @returns {boolean} Returns `true` if `value` is an array, else `false`.
|
|
2485
|
-
* @example
|
|
2486
|
-
*
|
|
2487
|
-
* _.isArray([1, 2, 3]);
|
|
2488
|
-
* // => true
|
|
2489
|
-
*
|
|
2490
|
-
* _.isArray(document.body.children);
|
|
2491
|
-
* // => false
|
|
2492
|
-
*
|
|
2493
|
-
* _.isArray('abc');
|
|
2494
|
-
* // => false
|
|
2495
|
-
*
|
|
2496
|
-
* _.isArray(_.noop);
|
|
2497
|
-
* // => false
|
|
2498
|
-
*/
|
|
2499
|
-
|
|
2500
|
-
var isArray_1;
|
|
2501
|
-
var hasRequiredIsArray;
|
|
2502
|
-
|
|
2503
|
-
function requireIsArray () {
|
|
2504
|
-
if (hasRequiredIsArray) return isArray_1;
|
|
2505
|
-
hasRequiredIsArray = 1;
|
|
2506
|
-
var isArray = Array.isArray;
|
|
2507
|
-
|
|
2508
|
-
isArray_1 = isArray;
|
|
2509
|
-
return isArray_1;
|
|
2510
|
-
}
|
|
2511
|
-
|
|
2512
|
-
/** Used as references for various `Number` constants. */
|
|
2513
|
-
|
|
2514
|
-
var isLength_1;
|
|
2515
|
-
var hasRequiredIsLength;
|
|
2516
|
-
|
|
2517
|
-
function requireIsLength () {
|
|
2518
|
-
if (hasRequiredIsLength) return isLength_1;
|
|
2519
|
-
hasRequiredIsLength = 1;
|
|
2520
|
-
var MAX_SAFE_INTEGER = 9007199254740991;
|
|
2521
|
-
|
|
2522
|
-
/**
|
|
2523
|
-
* Checks if `value` is a valid array-like length.
|
|
2524
|
-
*
|
|
2525
|
-
* **Note:** This method is loosely based on
|
|
2526
|
-
* [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
|
|
2527
|
-
*
|
|
2528
|
-
* @static
|
|
2529
|
-
* @memberOf _
|
|
2530
|
-
* @since 4.0.0
|
|
2531
|
-
* @category Lang
|
|
2532
|
-
* @param {*} value The value to check.
|
|
2533
|
-
* @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
|
|
2534
|
-
* @example
|
|
2535
|
-
*
|
|
2536
|
-
* _.isLength(3);
|
|
2537
|
-
* // => true
|
|
2538
|
-
*
|
|
2539
|
-
* _.isLength(Number.MIN_VALUE);
|
|
2540
|
-
* // => false
|
|
2541
|
-
*
|
|
2542
|
-
* _.isLength(Infinity);
|
|
2543
|
-
* // => false
|
|
2544
|
-
*
|
|
2545
|
-
* _.isLength('3');
|
|
2546
|
-
* // => false
|
|
2547
|
-
*/
|
|
2548
|
-
function isLength(value) {
|
|
2549
|
-
return typeof value == 'number' &&
|
|
2550
|
-
value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
|
|
2551
|
-
}
|
|
2552
|
-
|
|
2553
|
-
isLength_1 = isLength;
|
|
2554
|
-
return isLength_1;
|
|
2555
|
-
}
|
|
2556
|
-
|
|
2557
|
-
var isArrayLike_1;
|
|
2558
|
-
var hasRequiredIsArrayLike;
|
|
2559
|
-
|
|
2560
|
-
function requireIsArrayLike () {
|
|
2561
|
-
if (hasRequiredIsArrayLike) return isArrayLike_1;
|
|
2562
|
-
hasRequiredIsArrayLike = 1;
|
|
2563
|
-
var isFunction = requireIsFunction(),
|
|
2564
|
-
isLength = requireIsLength();
|
|
2565
|
-
|
|
2566
|
-
/**
|
|
2567
|
-
* Checks if `value` is array-like. A value is considered array-like if it's
|
|
2568
|
-
* not a function and has a `value.length` that's an integer greater than or
|
|
2569
|
-
* equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
|
|
2570
|
-
*
|
|
2571
|
-
* @static
|
|
2572
|
-
* @memberOf _
|
|
2573
|
-
* @since 4.0.0
|
|
2574
|
-
* @category Lang
|
|
2575
|
-
* @param {*} value The value to check.
|
|
2576
|
-
* @returns {boolean} Returns `true` if `value` is array-like, else `false`.
|
|
2577
|
-
* @example
|
|
2578
|
-
*
|
|
2579
|
-
* _.isArrayLike([1, 2, 3]);
|
|
2580
|
-
* // => true
|
|
2581
|
-
*
|
|
2582
|
-
* _.isArrayLike(document.body.children);
|
|
2583
|
-
* // => true
|
|
2584
|
-
*
|
|
2585
|
-
* _.isArrayLike('abc');
|
|
2586
|
-
* // => true
|
|
2587
|
-
*
|
|
2588
|
-
* _.isArrayLike(_.noop);
|
|
2589
|
-
* // => false
|
|
2590
|
-
*/
|
|
2591
|
-
function isArrayLike(value) {
|
|
2592
|
-
return value != null && isLength(value.length) && !isFunction(value);
|
|
2593
|
-
}
|
|
2594
|
-
|
|
2595
|
-
isArrayLike_1 = isArrayLike;
|
|
2596
|
-
return isArrayLike_1;
|
|
2597
|
-
}
|
|
2598
|
-
|
|
2599
|
-
var isBuffer = {exports: {}};
|
|
2600
|
-
|
|
2601
|
-
/**
|
|
2602
|
-
* This method returns `false`.
|
|
2603
|
-
*
|
|
2604
|
-
* @static
|
|
2605
|
-
* @memberOf _
|
|
2606
|
-
* @since 4.13.0
|
|
2607
|
-
* @category Util
|
|
2608
|
-
* @returns {boolean} Returns `false`.
|
|
2609
|
-
* @example
|
|
2610
|
-
*
|
|
2611
|
-
* _.times(2, _.stubFalse);
|
|
2612
|
-
* // => [false, false]
|
|
2613
|
-
*/
|
|
2614
|
-
|
|
2615
|
-
var stubFalse_1;
|
|
2616
|
-
var hasRequiredStubFalse;
|
|
2617
|
-
|
|
2618
|
-
function requireStubFalse () {
|
|
2619
|
-
if (hasRequiredStubFalse) return stubFalse_1;
|
|
2620
|
-
hasRequiredStubFalse = 1;
|
|
2621
|
-
function stubFalse() {
|
|
2622
|
-
return false;
|
|
2623
|
-
}
|
|
2624
|
-
|
|
2625
|
-
stubFalse_1 = stubFalse;
|
|
2626
|
-
return stubFalse_1;
|
|
2627
|
-
}
|
|
2628
|
-
|
|
2629
|
-
isBuffer.exports;
|
|
2630
|
-
|
|
2631
|
-
var hasRequiredIsBuffer;
|
|
2632
|
-
|
|
2633
|
-
function requireIsBuffer () {
|
|
2634
|
-
if (hasRequiredIsBuffer) return isBuffer.exports;
|
|
2635
|
-
hasRequiredIsBuffer = 1;
|
|
2636
|
-
(function (module, exports) {
|
|
2637
|
-
var root = require_root(),
|
|
2638
|
-
stubFalse = requireStubFalse();
|
|
2639
|
-
|
|
2640
|
-
/** Detect free variable `exports`. */
|
|
2641
|
-
var freeExports = exports && !exports.nodeType && exports;
|
|
2642
|
-
|
|
2643
|
-
/** Detect free variable `module`. */
|
|
2644
|
-
var freeModule = freeExports && 'object' == 'object' && module && !module.nodeType && module;
|
|
2645
|
-
|
|
2646
|
-
/** Detect the popular CommonJS extension `module.exports`. */
|
|
2647
|
-
var moduleExports = freeModule && freeModule.exports === freeExports;
|
|
2648
|
-
|
|
2649
|
-
/** Built-in value references. */
|
|
2650
|
-
var Buffer = moduleExports ? root.Buffer : undefined;
|
|
2651
|
-
|
|
2652
|
-
/* Built-in method references for those with the same name as other `lodash` methods. */
|
|
2653
|
-
var nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined;
|
|
2654
|
-
|
|
2655
|
-
/**
|
|
2656
|
-
* Checks if `value` is a buffer.
|
|
2657
|
-
*
|
|
2658
|
-
* @static
|
|
2659
|
-
* @memberOf _
|
|
2660
|
-
* @since 4.3.0
|
|
2661
|
-
* @category Lang
|
|
2662
|
-
* @param {*} value The value to check.
|
|
2663
|
-
* @returns {boolean} Returns `true` if `value` is a buffer, else `false`.
|
|
2664
|
-
* @example
|
|
2665
|
-
*
|
|
2666
|
-
* _.isBuffer(new Buffer(2));
|
|
2667
|
-
* // => true
|
|
2668
|
-
*
|
|
2669
|
-
* _.isBuffer(new Uint8Array(2));
|
|
2670
|
-
* // => false
|
|
2671
|
-
*/
|
|
2672
|
-
var isBuffer = nativeIsBuffer || stubFalse;
|
|
2673
|
-
|
|
2674
|
-
module.exports = isBuffer;
|
|
2675
|
-
} (isBuffer, isBuffer.exports));
|
|
2676
|
-
return isBuffer.exports;
|
|
2677
|
-
}
|
|
2678
|
-
|
|
2679
|
-
var _baseIsTypedArray;
|
|
2680
|
-
var hasRequired_baseIsTypedArray;
|
|
2681
|
-
|
|
2682
|
-
function require_baseIsTypedArray () {
|
|
2683
|
-
if (hasRequired_baseIsTypedArray) return _baseIsTypedArray;
|
|
2684
|
-
hasRequired_baseIsTypedArray = 1;
|
|
2685
|
-
var baseGetTag = require_baseGetTag(),
|
|
2686
|
-
isLength = requireIsLength(),
|
|
2687
|
-
isObjectLike = requireIsObjectLike();
|
|
2688
|
-
|
|
2689
|
-
/** `Object#toString` result references. */
|
|
2690
|
-
var argsTag = '[object Arguments]',
|
|
2691
|
-
arrayTag = '[object Array]',
|
|
2692
|
-
boolTag = '[object Boolean]',
|
|
2693
|
-
dateTag = '[object Date]',
|
|
2694
|
-
errorTag = '[object Error]',
|
|
2695
|
-
funcTag = '[object Function]',
|
|
2696
|
-
mapTag = '[object Map]',
|
|
2697
|
-
numberTag = '[object Number]',
|
|
2698
|
-
objectTag = '[object Object]',
|
|
2699
|
-
regexpTag = '[object RegExp]',
|
|
2700
|
-
setTag = '[object Set]',
|
|
2701
|
-
stringTag = '[object String]',
|
|
2702
|
-
weakMapTag = '[object WeakMap]';
|
|
2703
|
-
|
|
2704
|
-
var arrayBufferTag = '[object ArrayBuffer]',
|
|
2705
|
-
dataViewTag = '[object DataView]',
|
|
2706
|
-
float32Tag = '[object Float32Array]',
|
|
2707
|
-
float64Tag = '[object Float64Array]',
|
|
2708
|
-
int8Tag = '[object Int8Array]',
|
|
2709
|
-
int16Tag = '[object Int16Array]',
|
|
2710
|
-
int32Tag = '[object Int32Array]',
|
|
2711
|
-
uint8Tag = '[object Uint8Array]',
|
|
2712
|
-
uint8ClampedTag = '[object Uint8ClampedArray]',
|
|
2713
|
-
uint16Tag = '[object Uint16Array]',
|
|
2714
|
-
uint32Tag = '[object Uint32Array]';
|
|
2715
|
-
|
|
2716
|
-
/** Used to identify `toStringTag` values of typed arrays. */
|
|
2717
|
-
var typedArrayTags = {};
|
|
2718
|
-
typedArrayTags[float32Tag] = typedArrayTags[float64Tag] =
|
|
2719
|
-
typedArrayTags[int8Tag] = typedArrayTags[int16Tag] =
|
|
2720
|
-
typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =
|
|
2721
|
-
typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =
|
|
2722
|
-
typedArrayTags[uint32Tag] = true;
|
|
2723
|
-
typedArrayTags[argsTag] = typedArrayTags[arrayTag] =
|
|
2724
|
-
typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =
|
|
2725
|
-
typedArrayTags[dataViewTag] = typedArrayTags[dateTag] =
|
|
2726
|
-
typedArrayTags[errorTag] = typedArrayTags[funcTag] =
|
|
2727
|
-
typedArrayTags[mapTag] = typedArrayTags[numberTag] =
|
|
2728
|
-
typedArrayTags[objectTag] = typedArrayTags[regexpTag] =
|
|
2729
|
-
typedArrayTags[setTag] = typedArrayTags[stringTag] =
|
|
2730
|
-
typedArrayTags[weakMapTag] = false;
|
|
2731
|
-
|
|
2732
|
-
/**
|
|
2733
|
-
* The base implementation of `_.isTypedArray` without Node.js optimizations.
|
|
2734
|
-
*
|
|
2735
|
-
* @private
|
|
2736
|
-
* @param {*} value The value to check.
|
|
2737
|
-
* @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
|
|
2738
|
-
*/
|
|
2739
|
-
function baseIsTypedArray(value) {
|
|
2740
|
-
return isObjectLike(value) &&
|
|
2741
|
-
isLength(value.length) && !!typedArrayTags[baseGetTag(value)];
|
|
2742
|
-
}
|
|
2743
|
-
|
|
2744
|
-
_baseIsTypedArray = baseIsTypedArray;
|
|
2745
|
-
return _baseIsTypedArray;
|
|
2746
|
-
}
|
|
2747
|
-
|
|
2748
|
-
/**
|
|
2749
|
-
* The base implementation of `_.unary` without support for storing metadata.
|
|
2750
|
-
*
|
|
2751
|
-
* @private
|
|
2752
|
-
* @param {Function} func The function to cap arguments for.
|
|
2753
|
-
* @returns {Function} Returns the new capped function.
|
|
2754
|
-
*/
|
|
2755
|
-
|
|
2756
|
-
var _baseUnary;
|
|
2757
|
-
var hasRequired_baseUnary;
|
|
2758
|
-
|
|
2759
|
-
function require_baseUnary () {
|
|
2760
|
-
if (hasRequired_baseUnary) return _baseUnary;
|
|
2761
|
-
hasRequired_baseUnary = 1;
|
|
2762
|
-
function baseUnary(func) {
|
|
2763
|
-
return function(value) {
|
|
2764
|
-
return func(value);
|
|
2765
|
-
};
|
|
2766
|
-
}
|
|
2767
|
-
|
|
2768
|
-
_baseUnary = baseUnary;
|
|
2769
|
-
return _baseUnary;
|
|
2770
|
-
}
|
|
2771
|
-
|
|
2772
|
-
var _nodeUtil = {exports: {}};
|
|
2773
|
-
|
|
2774
|
-
_nodeUtil.exports;
|
|
2775
|
-
|
|
2776
|
-
var hasRequired_nodeUtil;
|
|
2777
|
-
|
|
2778
|
-
function require_nodeUtil () {
|
|
2779
|
-
if (hasRequired_nodeUtil) return _nodeUtil.exports;
|
|
2780
|
-
hasRequired_nodeUtil = 1;
|
|
2781
|
-
(function (module, exports) {
|
|
2782
|
-
var freeGlobal = require_freeGlobal();
|
|
2783
|
-
|
|
2784
|
-
/** Detect free variable `exports`. */
|
|
2785
|
-
var freeExports = exports && !exports.nodeType && exports;
|
|
2786
|
-
|
|
2787
|
-
/** Detect free variable `module`. */
|
|
2788
|
-
var freeModule = freeExports && 'object' == 'object' && module && !module.nodeType && module;
|
|
2789
|
-
|
|
2790
|
-
/** Detect the popular CommonJS extension `module.exports`. */
|
|
2791
|
-
var moduleExports = freeModule && freeModule.exports === freeExports;
|
|
2792
|
-
|
|
2793
|
-
/** Detect free variable `process` from Node.js. */
|
|
2794
|
-
var freeProcess = moduleExports && freeGlobal.process;
|
|
2795
|
-
|
|
2796
|
-
/** Used to access faster Node.js helpers. */
|
|
2797
|
-
var nodeUtil = (function() {
|
|
2798
|
-
try {
|
|
2799
|
-
// Use `util.types` for Node.js 10+.
|
|
2800
|
-
var types = freeModule && freeModule.require && freeModule.require('util').types;
|
|
2801
|
-
|
|
2802
|
-
if (types) {
|
|
2803
|
-
return types;
|
|
2804
|
-
}
|
|
2805
|
-
|
|
2806
|
-
// Legacy `process.binding('util')` for Node.js < 10.
|
|
2807
|
-
return freeProcess && freeProcess.binding && freeProcess.binding('util');
|
|
2808
|
-
} catch (e) {}
|
|
2809
|
-
}());
|
|
2810
|
-
|
|
2811
|
-
module.exports = nodeUtil;
|
|
2812
|
-
} (_nodeUtil, _nodeUtil.exports));
|
|
2813
|
-
return _nodeUtil.exports;
|
|
2814
|
-
}
|
|
2815
|
-
|
|
2816
|
-
var isTypedArray_1;
|
|
2817
|
-
var hasRequiredIsTypedArray;
|
|
2818
|
-
|
|
2819
|
-
function requireIsTypedArray () {
|
|
2820
|
-
if (hasRequiredIsTypedArray) return isTypedArray_1;
|
|
2821
|
-
hasRequiredIsTypedArray = 1;
|
|
2822
|
-
var baseIsTypedArray = require_baseIsTypedArray(),
|
|
2823
|
-
baseUnary = require_baseUnary(),
|
|
2824
|
-
nodeUtil = require_nodeUtil();
|
|
2825
|
-
|
|
2826
|
-
/* Node.js helper references. */
|
|
2827
|
-
var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
|
|
2828
|
-
|
|
2829
|
-
/**
|
|
2830
|
-
* Checks if `value` is classified as a typed array.
|
|
2831
|
-
*
|
|
2832
|
-
* @static
|
|
2833
|
-
* @memberOf _
|
|
2834
|
-
* @since 3.0.0
|
|
2835
|
-
* @category Lang
|
|
2836
|
-
* @param {*} value The value to check.
|
|
2837
|
-
* @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
|
|
2838
|
-
* @example
|
|
2839
|
-
*
|
|
2840
|
-
* _.isTypedArray(new Uint8Array);
|
|
2841
|
-
* // => true
|
|
2842
|
-
*
|
|
2843
|
-
* _.isTypedArray([]);
|
|
2844
|
-
* // => false
|
|
2845
|
-
*/
|
|
2846
|
-
var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
|
|
2847
|
-
|
|
2848
|
-
isTypedArray_1 = isTypedArray;
|
|
2849
|
-
return isTypedArray_1;
|
|
2850
|
-
}
|
|
2851
|
-
|
|
2852
|
-
var isEmpty_1;
|
|
2853
|
-
var hasRequiredIsEmpty;
|
|
2854
|
-
|
|
2855
|
-
function requireIsEmpty () {
|
|
2856
|
-
if (hasRequiredIsEmpty) return isEmpty_1;
|
|
2857
|
-
hasRequiredIsEmpty = 1;
|
|
2858
|
-
var baseKeys = require_baseKeys(),
|
|
2859
|
-
getTag = require_getTag(),
|
|
2860
|
-
isArguments = requireIsArguments(),
|
|
2861
|
-
isArray = requireIsArray(),
|
|
2862
|
-
isArrayLike = requireIsArrayLike(),
|
|
2863
|
-
isBuffer = requireIsBuffer(),
|
|
2864
|
-
isPrototype = require_isPrototype(),
|
|
2865
|
-
isTypedArray = requireIsTypedArray();
|
|
2866
|
-
|
|
2867
|
-
/** `Object#toString` result references. */
|
|
2868
|
-
var mapTag = '[object Map]',
|
|
2869
|
-
setTag = '[object Set]';
|
|
2870
|
-
|
|
2871
|
-
/** Used for built-in method references. */
|
|
2872
|
-
var objectProto = Object.prototype;
|
|
2873
|
-
|
|
2874
|
-
/** Used to check objects for own properties. */
|
|
2875
|
-
var hasOwnProperty = objectProto.hasOwnProperty;
|
|
2876
|
-
|
|
2877
|
-
/**
|
|
2878
|
-
* Checks if `value` is an empty object, collection, map, or set.
|
|
2879
|
-
*
|
|
2880
|
-
* Objects are considered empty if they have no own enumerable string keyed
|
|
2881
|
-
* properties.
|
|
2882
|
-
*
|
|
2883
|
-
* Array-like values such as `arguments` objects, arrays, buffers, strings, or
|
|
2884
|
-
* jQuery-like collections are considered empty if they have a `length` of `0`.
|
|
2885
|
-
* Similarly, maps and sets are considered empty if they have a `size` of `0`.
|
|
2886
|
-
*
|
|
2887
|
-
* @static
|
|
2888
|
-
* @memberOf _
|
|
2889
|
-
* @since 0.1.0
|
|
2890
|
-
* @category Lang
|
|
2891
|
-
* @param {*} value The value to check.
|
|
2892
|
-
* @returns {boolean} Returns `true` if `value` is empty, else `false`.
|
|
2893
|
-
* @example
|
|
2894
|
-
*
|
|
2895
|
-
* _.isEmpty(null);
|
|
2896
|
-
* // => true
|
|
2897
|
-
*
|
|
2898
|
-
* _.isEmpty(true);
|
|
2899
|
-
* // => true
|
|
2900
|
-
*
|
|
2901
|
-
* _.isEmpty(1);
|
|
2902
|
-
* // => true
|
|
2903
|
-
*
|
|
2904
|
-
* _.isEmpty([1, 2, 3]);
|
|
2905
|
-
* // => false
|
|
2906
|
-
*
|
|
2907
|
-
* _.isEmpty({ 'a': 1 });
|
|
2908
|
-
* // => false
|
|
2909
|
-
*/
|
|
2910
|
-
function isEmpty(value) {
|
|
2911
|
-
if (value == null) {
|
|
2912
|
-
return true;
|
|
2913
|
-
}
|
|
2914
|
-
if (isArrayLike(value) &&
|
|
2915
|
-
(isArray(value) || typeof value == 'string' || typeof value.splice == 'function' ||
|
|
2916
|
-
isBuffer(value) || isTypedArray(value) || isArguments(value))) {
|
|
2917
|
-
return !value.length;
|
|
2918
|
-
}
|
|
2919
|
-
var tag = getTag(value);
|
|
2920
|
-
if (tag == mapTag || tag == setTag) {
|
|
2921
|
-
return !value.size;
|
|
2922
|
-
}
|
|
2923
|
-
if (isPrototype(value)) {
|
|
2924
|
-
return !baseKeys(value).length;
|
|
2925
|
-
}
|
|
2926
|
-
for (var key in value) {
|
|
2927
|
-
if (hasOwnProperty.call(value, key)) {
|
|
2928
|
-
return false;
|
|
2929
|
-
}
|
|
2930
|
-
}
|
|
2931
|
-
return true;
|
|
2932
|
-
}
|
|
2933
|
-
|
|
2934
|
-
isEmpty_1 = isEmpty;
|
|
2935
|
-
return isEmpty_1;
|
|
2936
|
-
}
|
|
2937
|
-
|
|
2938
|
-
var isEmptyExports = requireIsEmpty();
|
|
2939
|
-
const _isEmpty = /*@__PURE__*/getDefaultExportFromCjs(isEmptyExports);
|
|
2940
|
-
|
|
2941
|
-
const textStyles = {
|
|
2942
|
-
fontWeight: {
|
|
2943
|
-
semibold: 590,
|
|
2944
|
-
regular: 400
|
|
2945
|
-
},
|
|
2946
|
-
letterSpacing: {
|
|
2947
|
-
default: "normal"
|
|
2948
|
-
}
|
|
2949
|
-
};
|
|
2950
|
-
|
|
2951
|
-
const drawerTypography = {
|
|
2952
|
-
fontFamily: "-apple-system,system-ui,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Fira Sans,Ubuntu,Oxygen,Oxygen Sans,Cantarell,Droid Sans,Apple Color Emoji,Segoe UI Emoji,Segoe UI Emoji,Segoe UI Symbol,Lucida Grande,Helvetica,Arial,sans-serif",
|
|
2953
|
-
displayL: {
|
|
2954
|
-
fontSize: "80px",
|
|
2955
|
-
fontWeight: textStyles.fontWeight.semibold,
|
|
2956
|
-
lineHeight: "92px",
|
|
2957
|
-
letterSpacing: textStyles.letterSpacing.default
|
|
2958
|
-
},
|
|
2959
|
-
displayM: {
|
|
2960
|
-
fontSize: "40px",
|
|
2961
|
-
fontWeight: textStyles.fontWeight.semibold,
|
|
2962
|
-
lineHeight: "52px",
|
|
2963
|
-
letterSpacing: textStyles.letterSpacing.default
|
|
2964
|
-
},
|
|
2965
|
-
headingL: {
|
|
2966
|
-
fontSize: "32px",
|
|
2967
|
-
fontWeight: textStyles.fontWeight.semibold,
|
|
2968
|
-
lineHeight: "44px",
|
|
2969
|
-
letterSpacing: textStyles.letterSpacing.default
|
|
2970
|
-
},
|
|
2971
|
-
headingM: {
|
|
2972
|
-
fontSize: "28px",
|
|
2973
|
-
fontWeight: textStyles.fontWeight.semibold,
|
|
2974
|
-
lineHeight: "40px",
|
|
2975
|
-
letterSpacing: textStyles.letterSpacing.default
|
|
2976
|
-
},
|
|
2977
|
-
headingS: {
|
|
2978
|
-
fontSize: "24px",
|
|
2979
|
-
fontWeight: textStyles.fontWeight.semibold,
|
|
2980
|
-
lineHeight: "36px",
|
|
2981
|
-
letterSpacing: textStyles.letterSpacing.default
|
|
2982
|
-
},
|
|
2983
|
-
semiBoldLabelL: {
|
|
2984
|
-
fontSize: "20px",
|
|
2985
|
-
lineHeight: "28px",
|
|
2986
|
-
fontWeight: textStyles.fontWeight.semibold,
|
|
2987
|
-
letterSpacing: textStyles.letterSpacing.default
|
|
2988
|
-
},
|
|
2989
|
-
semiBoldLabelM: {
|
|
2990
|
-
fontSize: "16px",
|
|
2991
|
-
lineHeight: "24px",
|
|
2992
|
-
fontWeight: textStyles.fontWeight.semibold,
|
|
2993
|
-
letterSpacing: textStyles.letterSpacing.default
|
|
2994
|
-
},
|
|
2995
|
-
semiBoldLabelS: {
|
|
2996
|
-
fontSize: "14px",
|
|
2997
|
-
lineHeight: "20px",
|
|
2998
|
-
fontWeight: textStyles.fontWeight.semibold,
|
|
2999
|
-
letterSpacing: textStyles.letterSpacing.default
|
|
3000
|
-
},
|
|
3001
|
-
semiBoldLabelXs: {
|
|
3002
|
-
fontSize: "12px",
|
|
3003
|
-
lineHeight: "16px",
|
|
3004
|
-
fontWeight: textStyles.fontWeight.semibold,
|
|
3005
|
-
letterSpacing: textStyles.letterSpacing.default
|
|
3006
|
-
},
|
|
3007
|
-
semiBoldLabelXxs: {
|
|
3008
|
-
fontSize: "10px",
|
|
3009
|
-
lineHeight: "14px",
|
|
3010
|
-
fontWeight: textStyles.fontWeight.semibold,
|
|
3011
|
-
letterSpacing: textStyles.letterSpacing.default
|
|
3012
|
-
},
|
|
3013
|
-
regularLabelL: {
|
|
3014
|
-
fontSize: "20px",
|
|
3015
|
-
lineHeight: "28px",
|
|
3016
|
-
fontWeight: textStyles.fontWeight.regular,
|
|
3017
|
-
letterSpacing: textStyles.letterSpacing.default
|
|
3018
|
-
},
|
|
3019
|
-
regularLabelM: {
|
|
3020
|
-
fontSize: "16px",
|
|
3021
|
-
lineHeight: "24px",
|
|
3022
|
-
fontWeight: textStyles.fontWeight.regular,
|
|
3023
|
-
letterSpacing: textStyles.letterSpacing.default
|
|
3024
|
-
},
|
|
3025
|
-
regularLabelS: {
|
|
3026
|
-
fontSize: "14px",
|
|
3027
|
-
lineHeight: "20px",
|
|
3028
|
-
fontWeight: textStyles.fontWeight.regular,
|
|
3029
|
-
letterSpacing: textStyles.letterSpacing.default
|
|
3030
|
-
},
|
|
3031
|
-
regularLabelXs: {
|
|
3032
|
-
fontSize: "12px",
|
|
3033
|
-
lineHeight: "16px",
|
|
3034
|
-
fontWeight: textStyles.fontWeight.regular,
|
|
3035
|
-
letterSpacing: textStyles.letterSpacing.default
|
|
3036
|
-
},
|
|
3037
|
-
regularLabelXxs: {
|
|
3038
|
-
fontSize: "10px",
|
|
3039
|
-
lineHeight: "14px",
|
|
3040
|
-
fontWeight: textStyles.fontWeight.regular,
|
|
3041
|
-
letterSpacing: textStyles.letterSpacing.default
|
|
3042
|
-
},
|
|
3043
|
-
textXl: {
|
|
3044
|
-
fontSize: "20px",
|
|
3045
|
-
fontWeight: textStyles.fontWeight.regular,
|
|
3046
|
-
lineHeight: "28px",
|
|
3047
|
-
letterSpacing: textStyles.letterSpacing.default
|
|
3048
|
-
},
|
|
3049
|
-
textL: {
|
|
3050
|
-
fontSize: "16px",
|
|
3051
|
-
fontWeight: textStyles.fontWeight.regular,
|
|
3052
|
-
lineHeight: "24px",
|
|
3053
|
-
letterSpacing: textStyles.letterSpacing.default
|
|
3054
|
-
},
|
|
3055
|
-
textM: {
|
|
3056
|
-
fontSize: "14px",
|
|
3057
|
-
fontWeight: textStyles.fontWeight.regular,
|
|
3058
|
-
lineHeight: "20px",
|
|
3059
|
-
letterSpacing: textStyles.letterSpacing.default
|
|
3060
|
-
},
|
|
3061
|
-
subtextM: {
|
|
3062
|
-
fontSize: "12px",
|
|
3063
|
-
fontWeight: textStyles.fontWeight.regular,
|
|
3064
|
-
lineHeight: "16px",
|
|
3065
|
-
letterSpacing: textStyles.letterSpacing.default
|
|
3066
|
-
},
|
|
3067
|
-
subtextS: {
|
|
3068
|
-
fontSize: "10px",
|
|
3069
|
-
fontWeight: textStyles.fontWeight.regular,
|
|
3070
|
-
lineHeight: "14px",
|
|
3071
|
-
letterSpacing: textStyles.letterSpacing.default
|
|
3072
|
-
},
|
|
3073
|
-
semiBoldLinkXL: {
|
|
3074
|
-
fontSize: "20px",
|
|
3075
|
-
fontWeight: textStyles.fontWeight.semibold,
|
|
3076
|
-
lineHeight: "28px",
|
|
3077
|
-
letterSpacing: textStyles.letterSpacing.default,
|
|
3078
|
-
textDecoration: "underline"
|
|
3079
|
-
},
|
|
3080
|
-
semiBoldLinkL: {
|
|
3081
|
-
fontSize: "16px",
|
|
3082
|
-
fontWeight: textStyles.fontWeight.semibold,
|
|
3083
|
-
lineHeight: "24px",
|
|
3084
|
-
letterSpacing: textStyles.letterSpacing.default,
|
|
3085
|
-
textDecoration: "underline"
|
|
3086
|
-
},
|
|
3087
|
-
semiBoldLinkM: {
|
|
3088
|
-
fontSize: "14px",
|
|
3089
|
-
fontWeight: textStyles.fontWeight.semibold,
|
|
3090
|
-
lineHeight: "20px",
|
|
3091
|
-
letterSpacing: textStyles.letterSpacing.default,
|
|
3092
|
-
textDecoration: "underline"
|
|
3093
|
-
},
|
|
3094
|
-
semiBoldLinkS: {
|
|
3095
|
-
fontSize: "12px",
|
|
3096
|
-
fontWeight: textStyles.fontWeight.semibold,
|
|
3097
|
-
lineHeight: "16px",
|
|
3098
|
-
letterSpacing: textStyles.letterSpacing.default,
|
|
3099
|
-
textDecoration: "underline"
|
|
3100
|
-
},
|
|
3101
|
-
semiBoldLinkXs: {
|
|
3102
|
-
fontSize: "10px",
|
|
3103
|
-
fontWeight: textStyles.fontWeight.semibold,
|
|
3104
|
-
lineHeight: "14px",
|
|
3105
|
-
letterSpacing: textStyles.letterSpacing.default,
|
|
3106
|
-
textDecoration: "underline"
|
|
3107
|
-
},
|
|
3108
|
-
regularLinkXL: {
|
|
3109
|
-
fontSize: "20px",
|
|
3110
|
-
fontWeight: textStyles.fontWeight.regular,
|
|
3111
|
-
lineHeight: "20px",
|
|
3112
|
-
letterSpacing: textStyles.letterSpacing.default,
|
|
3113
|
-
textDecoration: "underline"
|
|
3114
|
-
},
|
|
3115
|
-
regularLinkL: {
|
|
3116
|
-
fontSize: "16px",
|
|
3117
|
-
fontWeight: textStyles.fontWeight.regular,
|
|
3118
|
-
lineHeight: "24px",
|
|
3119
|
-
letterSpacing: textStyles.letterSpacing.default,
|
|
3120
|
-
textDecoration: "underline"
|
|
3121
|
-
},
|
|
3122
|
-
h1: {
|
|
3123
|
-
fontSize: "26px",
|
|
3124
|
-
fontWeight: 590,
|
|
3125
|
-
lineHeight: "32px"
|
|
3126
|
-
},
|
|
3127
|
-
h2: {
|
|
3128
|
-
fontSize: "22px",
|
|
3129
|
-
fontWeight: 590,
|
|
3130
|
-
lineHeight: "26px"
|
|
3131
|
-
},
|
|
3132
|
-
h3: {
|
|
3133
|
-
fontSize: "17px",
|
|
3134
|
-
fontWeight: 590,
|
|
3135
|
-
lineHeight: "22px"
|
|
3136
|
-
},
|
|
3137
|
-
h4: {
|
|
3138
|
-
fontSize: "15px",
|
|
3139
|
-
fontWeight: 590,
|
|
3140
|
-
lineHeight: "20px"
|
|
3141
|
-
},
|
|
3142
|
-
h5: {
|
|
3143
|
-
fontSize: "14px",
|
|
3144
|
-
fontWeight: 590,
|
|
3145
|
-
lineHeight: "20px"
|
|
3146
|
-
},
|
|
3147
|
-
headline: {
|
|
3148
|
-
fontSize: "13px",
|
|
3149
|
-
fontWeight: 590,
|
|
3150
|
-
lineHeight: "16px"
|
|
3151
|
-
},
|
|
3152
|
-
body: {
|
|
3153
|
-
fontSize: "13px",
|
|
3154
|
-
lineHeight: "16px",
|
|
3155
|
-
fontWeight: 400
|
|
3156
|
-
},
|
|
3157
|
-
callout: {
|
|
3158
|
-
fontSize: "13px",
|
|
3159
|
-
fontWeight: 510,
|
|
3160
|
-
lineHeight: "15px"
|
|
3161
|
-
},
|
|
3162
|
-
subHeadline1: {
|
|
3163
|
-
fontSize: "14px",
|
|
3164
|
-
lineHeight: "20px",
|
|
3165
|
-
fontWeight: 400
|
|
3166
|
-
},
|
|
3167
|
-
subHeadline2: {
|
|
3168
|
-
fontSize: "13px",
|
|
3169
|
-
lineHeight: "20px",
|
|
3170
|
-
fontWeight: 400
|
|
3171
|
-
},
|
|
3172
|
-
footNote: {
|
|
3173
|
-
fontSize: "12px",
|
|
3174
|
-
lineHeight: "13px",
|
|
3175
|
-
fontWeight: 400
|
|
3176
|
-
},
|
|
3177
|
-
caption1: {
|
|
3178
|
-
fontSize: "10px",
|
|
3179
|
-
lineHeight: "13px",
|
|
3180
|
-
fontWeight: 400
|
|
3181
|
-
},
|
|
3182
|
-
caption2: {
|
|
3183
|
-
fontSize: "10px",
|
|
3184
|
-
lineHeight: "13px",
|
|
3185
|
-
fontWeight: 510
|
|
3186
|
-
}
|
|
3187
|
-
};
|
|
3188
|
-
const muiTheme = createTheme({
|
|
3189
|
-
palette: {
|
|
3190
|
-
primary: {
|
|
3191
|
-
main: "#1E221E",
|
|
3192
|
-
contrastText: "#ffffff"
|
|
3193
|
-
},
|
|
3194
|
-
secondary: {
|
|
3195
|
-
main: "#0A9083",
|
|
3196
|
-
contrastText: "#000000"
|
|
3197
|
-
},
|
|
3198
|
-
error: {
|
|
3199
|
-
main: "#ED1D31",
|
|
3200
|
-
contrastText: "#ffffff"
|
|
3201
|
-
},
|
|
3202
|
-
warning: {
|
|
3203
|
-
main: "#F3800D",
|
|
3204
|
-
contrastText: "#000000"
|
|
3205
|
-
},
|
|
3206
|
-
info: {
|
|
3207
|
-
main: "#0881EA",
|
|
3208
|
-
contrastText: "#000000"
|
|
3209
|
-
},
|
|
3210
|
-
success: {
|
|
3211
|
-
main: "#0AB22C",
|
|
3212
|
-
contrastText: "#000000"
|
|
3213
|
-
},
|
|
3214
|
-
background: {
|
|
3215
|
-
default: "#F7F9FC"
|
|
3216
|
-
}
|
|
3217
|
-
},
|
|
3218
|
-
typography: drawerTypography,
|
|
3219
|
-
components: {
|
|
3220
|
-
MuiTypography: {
|
|
3221
|
-
defaultProps: {
|
|
3222
|
-
variantMapping: {
|
|
3223
|
-
h1: "h1",
|
|
3224
|
-
h2: "h2",
|
|
3225
|
-
h3: "h3",
|
|
3226
|
-
h4: "h4",
|
|
3227
|
-
headline: "h5",
|
|
3228
|
-
body: "span",
|
|
3229
|
-
callout: "span",
|
|
3230
|
-
subHeadline1: "span",
|
|
3231
|
-
subHeadline2: "span",
|
|
3232
|
-
footNote: "span",
|
|
3233
|
-
caption1: "span",
|
|
3234
|
-
caption2: "span"
|
|
3235
|
-
}
|
|
3236
|
-
}
|
|
3237
|
-
},
|
|
3238
|
-
MuiButton: {
|
|
3239
|
-
defaultProps: {
|
|
3240
|
-
disableElevation: true,
|
|
3241
|
-
size: "large"
|
|
3242
|
-
},
|
|
3243
|
-
styleOverrides: {
|
|
3244
|
-
root: {
|
|
3245
|
-
textTransform: "none",
|
|
3246
|
-
fontSize: "14px",
|
|
3247
|
-
borderRadius: "8px"
|
|
3248
|
-
},
|
|
3249
|
-
text: {
|
|
3250
|
-
textDecoration: "underline",
|
|
3251
|
-
"&:hover": {
|
|
3252
|
-
backgroundColor: "transparent",
|
|
3253
|
-
textDecoration: "underline"
|
|
3254
|
-
},
|
|
3255
|
-
padding: "0px 8px",
|
|
3256
|
-
textAlign: "left"
|
|
3257
|
-
}
|
|
3258
|
-
}
|
|
3259
|
-
},
|
|
3260
|
-
MuiTab: {
|
|
3261
|
-
styleOverrides: {
|
|
3262
|
-
root: {
|
|
3263
|
-
textTransform: "none",
|
|
3264
|
-
fontSize: "14px"
|
|
3265
|
-
}
|
|
3266
|
-
}
|
|
3267
|
-
},
|
|
3268
|
-
MuiChip: {
|
|
3269
|
-
defaultProps: {
|
|
3270
|
-
size: "small"
|
|
3271
|
-
},
|
|
3272
|
-
styleOverrides: {
|
|
3273
|
-
root: {
|
|
3274
|
-
paddingLeft: "5px",
|
|
3275
|
-
paddingRight: "5px"
|
|
3276
|
-
}
|
|
3277
|
-
}
|
|
3278
|
-
},
|
|
3279
|
-
MuiPaper: {
|
|
3280
|
-
styleOverrides: {
|
|
3281
|
-
root: {
|
|
3282
|
-
borderRadius: "16px"
|
|
3283
|
-
}
|
|
3284
|
-
}
|
|
3285
|
-
},
|
|
3286
|
-
MuiCard: {
|
|
3287
|
-
defaultProps: {
|
|
3288
|
-
variant: "outlined"
|
|
3289
|
-
},
|
|
3290
|
-
styleOverrides: {
|
|
3291
|
-
root: {
|
|
3292
|
-
borderRadius: "16px"
|
|
3293
|
-
}
|
|
3294
|
-
}
|
|
3295
|
-
},
|
|
3296
|
-
MuiAutocomplete: {
|
|
3297
|
-
styleOverrides: {
|
|
3298
|
-
root: {
|
|
3299
|
-
"& .MuiAutocomplete-inputRoot": {
|
|
3300
|
-
paddingLeft: "14px"
|
|
3301
|
-
}
|
|
3302
|
-
}
|
|
3303
|
-
}
|
|
3304
|
-
},
|
|
3305
|
-
MuiLink: {
|
|
3306
|
-
styleOverrides: {
|
|
3307
|
-
root: {
|
|
3308
|
-
fontWeight: "bold",
|
|
3309
|
-
"&:hover": {
|
|
3310
|
-
cursor: "pointer"
|
|
3311
|
-
}
|
|
3312
|
-
}
|
|
3313
|
-
},
|
|
3314
|
-
defaultProps: {
|
|
3315
|
-
variant: "body"
|
|
3316
|
-
}
|
|
3317
|
-
},
|
|
3318
|
-
MuiTextField: {
|
|
3319
|
-
styleOverrides: {
|
|
3320
|
-
root: {
|
|
3321
|
-
"& .MuiInputBase-root": {
|
|
3322
|
-
borderRadius: "8px"
|
|
3323
|
-
}
|
|
3324
|
-
}
|
|
3325
|
-
}
|
|
3326
|
-
},
|
|
3327
|
-
MuiFormControl: {
|
|
3328
|
-
styleOverrides: {
|
|
3329
|
-
root: {
|
|
3330
|
-
"& .MuiInputBase-root": {
|
|
3331
|
-
borderRadius: "8px"
|
|
3332
|
-
}
|
|
3333
|
-
}
|
|
3334
|
-
}
|
|
3335
|
-
},
|
|
3336
|
-
MuiDrawer: {
|
|
3337
|
-
styleOverrides: {
|
|
3338
|
-
paper: {
|
|
3339
|
-
borderRadius: 0
|
|
3340
|
-
}
|
|
3341
|
-
}
|
|
3342
|
-
}
|
|
3343
|
-
}
|
|
3344
|
-
});
|
|
3345
|
-
|
|
3346
|
-
const DRAWER_TYPES = {
|
|
3347
|
-
INFORMATION: "information",
|
|
3348
|
-
INPUT: "input"
|
|
3349
|
-
};
|
|
3350
|
-
const INFORMATION_SUBTYPES = {
|
|
3351
|
-
PROGRESS: "progress",
|
|
3352
|
-
PASSIVE: "passive"
|
|
3353
|
-
};
|
|
3354
|
-
const INPUT_SUBTYPES = {
|
|
3355
|
-
DEFAULT: "default",
|
|
3356
|
-
DESTRUCTIVE: "destructive"
|
|
3357
|
-
};
|
|
3358
|
-
const DRAWER_CONFIGS = {
|
|
3359
|
-
[DRAWER_TYPES.INFORMATION]: {
|
|
3360
|
-
[INFORMATION_SUBTYPES.PROGRESS]: {
|
|
3361
|
-
DISMISSIBLE: "partial"
|
|
3362
|
-
},
|
|
3363
|
-
[INFORMATION_SUBTYPES.PASSIVE]: {
|
|
3364
|
-
DISMISSIBLE: "full"
|
|
3365
|
-
}
|
|
3366
|
-
},
|
|
3367
|
-
[DRAWER_TYPES.INPUT]: {
|
|
3368
|
-
[INPUT_SUBTYPES.DEFAULT]: {
|
|
3369
|
-
DISMISSIBLE: "partial"
|
|
3370
|
-
},
|
|
3371
|
-
[INPUT_SUBTYPES.DESTRUCTIVE]: {
|
|
3372
|
-
DISMISSIBLE: "partial"
|
|
3373
|
-
}
|
|
3374
|
-
}
|
|
3375
|
-
};
|
|
3376
|
-
const TERTIARY_CTA_TYPES = {
|
|
3377
|
-
DEFAULT: "default",
|
|
3378
|
-
DESTRUCTIVE: "destructive"
|
|
3379
|
-
};
|
|
3380
|
-
|
|
3381
|
-
const IS_SAFARI = /^((?!chrome|android).)*safari/i.test(navigator.userAgent);
|
|
3382
|
-
|
|
3383
|
-
const MuiDrawer = (props) => {
|
|
3384
|
-
const [isOpen, setIsOpen] = useState(false);
|
|
3385
|
-
const [actionsMaxWidth, setActionsMaxWidth] = useState("50%");
|
|
3386
|
-
const drawerRef = useRef(null);
|
|
3387
|
-
const parentTheme = useTheme();
|
|
3388
|
-
const currentTheme = _isEmpty(parentTheme) ? muiTheme : {
|
|
3389
|
-
...parentTheme,
|
|
3390
|
-
typography: {
|
|
3391
|
-
...parentTheme.typography,
|
|
3392
|
-
...drawerTypography
|
|
3393
|
-
}
|
|
3394
|
-
};
|
|
3395
|
-
const subtype = props.type === DRAWER_TYPES.INFORMATION ? props.subtype : props.type === DRAWER_TYPES.INPUT ? props.subtype : "default";
|
|
3396
|
-
const {
|
|
3397
|
-
anchor = "right",
|
|
3398
|
-
wrapperClassName,
|
|
3399
|
-
bodyWrapperClassName,
|
|
3400
|
-
open,
|
|
3401
|
-
type,
|
|
3402
|
-
title,
|
|
3403
|
-
subTitle,
|
|
3404
|
-
description,
|
|
3405
|
-
onClose,
|
|
3406
|
-
children,
|
|
3407
|
-
actions,
|
|
3408
|
-
width,
|
|
3409
|
-
maxWidth,
|
|
3410
|
-
showActions = true,
|
|
3411
|
-
showDivider = true,
|
|
3412
|
-
showCloseIcon = true,
|
|
3413
|
-
tertiaryCtaType = "default",
|
|
3414
|
-
...rest
|
|
3415
|
-
} = props;
|
|
3416
|
-
const {
|
|
3417
|
-
primaryCtaTitle,
|
|
3418
|
-
primaryCtaClassName,
|
|
3419
|
-
secondaryCtaTitle,
|
|
3420
|
-
secondaryCtaClassName,
|
|
3421
|
-
secondaryCtaStartIcon,
|
|
3422
|
-
isPrimaryCtaLoading = false,
|
|
3423
|
-
isPrimaryCtaDisabled,
|
|
3424
|
-
isSecondaryCtaLoading = false,
|
|
3425
|
-
isSecondaryCtaDisabled,
|
|
3426
|
-
onPrimaryCtaClick = _noop,
|
|
3427
|
-
onSecondaryCtaClick = _noop,
|
|
3428
|
-
tertiaryCtaTitle,
|
|
3429
|
-
tertiaryCtaClassName,
|
|
3430
|
-
tertiaryCtaStartIcon,
|
|
3431
|
-
isTertiaryCtaLoading = false,
|
|
3432
|
-
isTertiaryCtaDisabled,
|
|
3433
|
-
onTertiaryCtaClick = _noop,
|
|
3434
|
-
primaryCtaTooltipText,
|
|
3435
|
-
secondaryCtaTooltipText,
|
|
3436
|
-
tertiaryCtaTooltipText,
|
|
3437
|
-
showPrimaryCtaTooltipMsg = false,
|
|
3438
|
-
showSecondaryCtaTooltipMsg = false,
|
|
3439
|
-
showTertiaryCtaTooltipMsg = false,
|
|
3440
|
-
primaryCtaButtonProps,
|
|
3441
|
-
secondaryCtaButtonProps,
|
|
3442
|
-
tertiaryCtaButtonProps
|
|
3443
|
-
} = actions || {};
|
|
3444
|
-
const config = DRAWER_CONFIGS[type][subtype] || DRAWER_CONFIGS[type].default;
|
|
3445
|
-
const showFooter = showActions && (primaryCtaTitle || secondaryCtaTitle || tertiaryCtaTitle);
|
|
3446
|
-
const footerCtaCount = [
|
|
3447
|
-
primaryCtaTitle,
|
|
3448
|
-
secondaryCtaTitle,
|
|
3449
|
-
tertiaryCtaTitle
|
|
3450
|
-
].filter(Boolean).length;
|
|
3451
|
-
const primaryCtaTooltipTitle = isPrimaryCtaDisabled || showPrimaryCtaTooltipMsg ? primaryCtaTooltipText : "";
|
|
3452
|
-
const secondaryCtaTooltipTitle = isSecondaryCtaDisabled || showSecondaryCtaTooltipMsg ? secondaryCtaTooltipText : "";
|
|
3453
|
-
const tertiaryCtaTooltipTitle = isTertiaryCtaDisabled || showTertiaryCtaTooltipMsg ? tertiaryCtaTooltipText : "";
|
|
3454
|
-
const handleClose = () => {
|
|
3455
|
-
if (config?.DISMISSIBLE === "full") {
|
|
3456
|
-
onClose();
|
|
3457
|
-
}
|
|
3458
|
-
};
|
|
3459
|
-
useEffect(() => {
|
|
3460
|
-
const timer = setTimeout(() => {
|
|
3461
|
-
if (drawerRef.current) {
|
|
3462
|
-
const width2 = drawerRef.current.getBoundingClientRect().width;
|
|
3463
|
-
if (width2 < 600) setActionsMaxWidth("100%");
|
|
3464
|
-
if (width2 >= 600) setActionsMaxWidth("50%");
|
|
3465
|
-
if (width2 >= 900) setActionsMaxWidth("33%");
|
|
3466
|
-
if (width2 >= 1200) setActionsMaxWidth("25%");
|
|
3467
|
-
}
|
|
3468
|
-
}, 0);
|
|
3469
|
-
return () => clearTimeout(timer);
|
|
3470
|
-
}, [drawerRef.current]);
|
|
3471
|
-
useEffect(() => setIsOpen(open), [open]);
|
|
3472
|
-
return /* @__PURE__ */ jsx(ThemeProvider, { theme: currentTheme, children: /* @__PURE__ */ jsx(
|
|
3473
|
-
Drawer,
|
|
3474
|
-
{
|
|
3475
|
-
className: classNames("vi-drawer", wrapperClassName),
|
|
3476
|
-
open: isOpen,
|
|
3477
|
-
anchor,
|
|
3478
|
-
onClose: handleClose,
|
|
3479
|
-
transitionDuration: 300,
|
|
3480
|
-
...rest,
|
|
3481
|
-
children: /* @__PURE__ */ jsxs("div", { ref: drawerRef, style: { width, maxWidth }, className: classNames("h-fill", IS_SAFARI && "safari-flex-container"), children: [
|
|
3482
|
-
title && /* @__PURE__ */ jsxs("div", { className: "vi-drawer-title", children: [
|
|
3483
|
-
/* @__PURE__ */ jsxs("div", { className: "d-f ai-c jc-sb", children: [
|
|
3484
|
-
/* @__PURE__ */ jsxs("div", { className: "d-f fd-col gap-8", children: [
|
|
3485
|
-
/* @__PURE__ */ jsx(Typography, { variant: "semiBoldLabelL", children: title }),
|
|
3486
|
-
subTitle && /* @__PURE__ */ jsx(Typography, { variant: "subtextM", children: subTitle })
|
|
3487
|
-
] }),
|
|
3488
|
-
showCloseIcon && /* @__PURE__ */ jsx(
|
|
3489
|
-
CloseIcon,
|
|
3490
|
-
{
|
|
3491
|
-
fontSize: "small",
|
|
3492
|
-
className: "close-icon",
|
|
3493
|
-
"aria-label": "Close drawer",
|
|
3494
|
-
onClick: onClose
|
|
3495
|
-
}
|
|
3496
|
-
)
|
|
3497
|
-
] }),
|
|
3498
|
-
description && /* @__PURE__ */ jsx(
|
|
3499
|
-
Typography,
|
|
3500
|
-
{
|
|
3501
|
-
component: "div",
|
|
3502
|
-
className: "description",
|
|
3503
|
-
variant: "subtextM",
|
|
3504
|
-
children: description
|
|
3505
|
-
}
|
|
3506
|
-
)
|
|
3507
|
-
] }),
|
|
3508
|
-
/* @__PURE__ */ jsx(
|
|
3509
|
-
"div",
|
|
3510
|
-
{
|
|
3511
|
-
className: classNames(
|
|
3512
|
-
"drawer-children",
|
|
3513
|
-
title && showFooter ? "with-header-footer" : title ? "with-header" : showFooter ? "with-footer" : "",
|
|
3514
|
-
footerCtaCount === 3 ? "three-ctas" : "",
|
|
3515
|
-
footerCtaCount === 2 ? "two-ctas" : "",
|
|
3516
|
-
footerCtaCount === 1 ? "one-cta" : "",
|
|
3517
|
-
showFooter && !showDivider ? "no-divider" : "",
|
|
3518
|
-
bodyWrapperClassName
|
|
3519
|
-
),
|
|
3520
|
-
children
|
|
3521
|
-
}
|
|
3522
|
-
),
|
|
3523
|
-
showFooter && /* @__PURE__ */ jsxs(
|
|
3524
|
-
"div",
|
|
3525
|
-
{
|
|
3526
|
-
className: classNames(
|
|
3527
|
-
"vi-drawer-actions",
|
|
3528
|
-
showDivider ? "divider" : "",
|
|
3529
|
-
tertiaryCtaTitle ? "tertiary-cta" : ""
|
|
3530
|
-
),
|
|
3531
|
-
children: [
|
|
3532
|
-
tertiaryCtaTitle && /* @__PURE__ */ jsx(
|
|
3533
|
-
Tooltip,
|
|
3534
|
-
{
|
|
3535
|
-
title: tertiaryCtaTooltipTitle,
|
|
3536
|
-
arrow: true,
|
|
3537
|
-
children: /* @__PURE__ */ jsx(
|
|
3538
|
-
LoadingButton,
|
|
3539
|
-
{
|
|
3540
|
-
className: classNames(
|
|
3541
|
-
tertiaryCtaType === TERTIARY_CTA_TYPES.DESTRUCTIVE ? "tertiary-cta-destructive" : "",
|
|
3542
|
-
tertiaryCtaClassName
|
|
3543
|
-
),
|
|
3544
|
-
variant: "text",
|
|
3545
|
-
onClick: onTertiaryCtaClick,
|
|
3546
|
-
startIcon: tertiaryCtaStartIcon,
|
|
3547
|
-
loading: isTertiaryCtaLoading,
|
|
3548
|
-
disabled: isTertiaryCtaDisabled !== void 0 ? isTertiaryCtaDisabled : !!(isPrimaryCtaLoading || isSecondaryCtaLoading),
|
|
3549
|
-
...tertiaryCtaButtonProps,
|
|
3550
|
-
children: tertiaryCtaTitle
|
|
3551
|
-
}
|
|
3552
|
-
)
|
|
3553
|
-
}
|
|
3554
|
-
),
|
|
3555
|
-
/* @__PURE__ */ jsxs(
|
|
3556
|
-
"div",
|
|
3557
|
-
{
|
|
3558
|
-
style: { width: actionsMaxWidth },
|
|
3559
|
-
className: "vi-drawer-action-ctas",
|
|
3560
|
-
children: [
|
|
3561
|
-
secondaryCtaTitle && /* @__PURE__ */ jsx(
|
|
3562
|
-
Tooltip,
|
|
3563
|
-
{
|
|
3564
|
-
title: secondaryCtaTooltipTitle,
|
|
3565
|
-
arrow: true,
|
|
3566
|
-
children: /* @__PURE__ */ jsx(
|
|
3567
|
-
LoadingButton,
|
|
3568
|
-
{
|
|
3569
|
-
className: classNames("vi-drawer-cta", secondaryCtaClassName),
|
|
3570
|
-
variant: "outlined",
|
|
3571
|
-
onClick: onSecondaryCtaClick,
|
|
3572
|
-
startIcon: secondaryCtaStartIcon,
|
|
3573
|
-
loading: isSecondaryCtaLoading,
|
|
3574
|
-
disabled: isSecondaryCtaDisabled !== void 0 ? isSecondaryCtaDisabled : !!(isPrimaryCtaLoading || isTertiaryCtaLoading),
|
|
3575
|
-
...secondaryCtaButtonProps,
|
|
3576
|
-
children: secondaryCtaTitle
|
|
3577
|
-
}
|
|
3578
|
-
)
|
|
3579
|
-
}
|
|
3580
|
-
),
|
|
3581
|
-
primaryCtaTitle && /* @__PURE__ */ jsx(
|
|
3582
|
-
Tooltip,
|
|
3583
|
-
{
|
|
3584
|
-
title: primaryCtaTooltipTitle,
|
|
3585
|
-
arrow: true,
|
|
3586
|
-
children: /* @__PURE__ */ jsx(
|
|
3587
|
-
LoadingButton,
|
|
3588
|
-
{
|
|
3589
|
-
className: classNames(
|
|
3590
|
-
"vi-drawer-cta",
|
|
3591
|
-
subtype === "destructive" ? "destructive" : "",
|
|
3592
|
-
primaryCtaClassName
|
|
3593
|
-
),
|
|
3594
|
-
variant: "contained",
|
|
3595
|
-
onClick: onPrimaryCtaClick,
|
|
3596
|
-
loading: isPrimaryCtaLoading,
|
|
3597
|
-
disabled: isPrimaryCtaDisabled !== void 0 ? isPrimaryCtaDisabled : !!(isSecondaryCtaLoading || isTertiaryCtaLoading),
|
|
3598
|
-
...primaryCtaButtonProps,
|
|
3599
|
-
children: primaryCtaTitle
|
|
3600
|
-
}
|
|
3601
|
-
)
|
|
3602
|
-
}
|
|
3603
|
-
)
|
|
3604
|
-
]
|
|
3605
|
-
}
|
|
3606
|
-
)
|
|
3607
|
-
]
|
|
3608
|
-
}
|
|
3609
|
-
)
|
|
3610
|
-
] })
|
|
3611
|
-
}
|
|
3612
|
-
) });
|
|
3613
|
-
};
|
|
3614
|
-
|
|
3615
|
-
export { DRAWER_CONFIGS, DRAWER_TYPES, INFORMATION_SUBTYPES, INPUT_SUBTYPES, MuiDrawer, TERTIARY_CTA_TYPES };
|
|
20
|
+
*/function J(){if(z)return k;z=1;var e=Object.getOwnPropertySymbols,t=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable;return k=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map(function(e){return t[e]}).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach(function(e){r[e]=e}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(o){return!1}}()?Object.assign:function(r,o){for(var i,a,c=function(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}(r),u=1;u<arguments.length;u++){for(var l in i=Object(arguments[u]))t.call(i,l)&&(c[l]=i[l]);if(e){a=e(i);for(var s=0;s<a.length;s++)n.call(i,a[s])&&(c[a[s]]=i[a[s]])}}return c},k}function K(){if(D)return A;D=1;return A="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"}function Q(){return H?R:(H=1,R=Function.call.bind(Object.prototype.hasOwnProperty))}function Z(){if(B)return _;B=1;var e=function(){};if("production"!==process.env.NODE_ENV){var t=/*@__PURE__*/K(),n={},r=/*@__PURE__*/Q();e=function(e){var t="Warning: "+e;try{throw new Error(t)}catch(n){}}}function o(o,i,a,c,u){if("production"!==process.env.NODE_ENV)for(var l in o)if(r(o,l)){var s;try{if("function"!=typeof o[l]){var f=Error((c||"React class")+": "+a+" type `"+l+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof o[l]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw f.name="Invariant Violation",f}s=o[l](i,l,c,a,null,t)}catch(d){s=d}if(!s||s instanceof Error||e((c||"React class")+": type specification of "+a+" `"+l+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof s+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),s instanceof Error&&!(s.message in n)){n[s.message]=!0;var p=u?u():"";e("Failed "+a+" type: "+s.message+(null!=p?p:""))}}}return o.resetWarningCache=function(){"production"!==process.env.NODE_ENV&&(n={})},_=o}function ee(){if(V)return F;V=1;var e=Y(),t=J(),n=/*@__PURE__*/K(),r=/*@__PURE__*/Q(),o=/*@__PURE__*/Z(),i=function(){};function a(){return null}return"production"!==process.env.NODE_ENV&&(i=function(e){var t="Warning: "+e;try{throw new Error(t)}catch(n){}}),F=function(c,u){var l="function"==typeof Symbol&&Symbol.iterator;var s="<<anonymous>>",f={array:g("array"),bigint:g("bigint"),bool:g("boolean"),func:g("function"),number:g("number"),object:g("object"),string:g("string"),symbol:g("symbol"),any:y(a),arrayOf:function(e){return y(function(t,r,o,i,a){if("function"!=typeof e)return new d("Property `"+a+"` of component `"+o+"` has invalid PropType notation inside arrayOf.");var c=t[r];if(!Array.isArray(c))return new d("Invalid "+i+" `"+a+"` of type `"+m(c)+"` supplied to `"+o+"`, expected an array.");for(var u=0;u<c.length;u++){var l=e(c,u,o,i,a+"["+u+"]",n);if(l instanceof Error)return l}return null})},element:y(function(e,t,n,r,o){var i=e[t];return c(i)?null:new d("Invalid "+r+" `"+o+"` of type `"+m(i)+"` supplied to `"+n+"`, expected a single ReactElement.")}),elementType:y(function(t,n,r,o,i){var a=t[n];return e.isValidElementType(a)?null:new d("Invalid "+o+" `"+i+"` of type `"+m(a)+"` supplied to `"+r+"`, expected a single ReactElement type.")}),instanceOf:function(e){return y(function(t,n,r,o,i){if(!(t[n]instanceof e)){var a=e.name||s;return new d("Invalid "+o+" `"+i+"` of type `"+(((c=t[n]).constructor&&c.constructor.name?c.constructor.name:s)+"` supplied to `")+r+"`, expected instance of `"+a+"`.")}var c;return null})},node:y(function(e,t,n,r,o){return h(e[t])?null:new d("Invalid "+r+" `"+o+"` supplied to `"+n+"`, expected a ReactNode.")}),objectOf:function(e){return y(function(t,o,i,a,c){if("function"!=typeof e)return new d("Property `"+c+"` of component `"+i+"` has invalid PropType notation inside objectOf.");var u=t[o],l=m(u);if("object"!==l)return new d("Invalid "+a+" `"+c+"` of type `"+l+"` supplied to `"+i+"`, expected an object.");for(var s in u)if(r(u,s)){var f=e(u,s,i,a,c+"."+s,n);if(f instanceof Error)return f}return null})},oneOf:function(e){if(!Array.isArray(e))return"production"!==process.env.NODE_ENV&&i(arguments.length>1?"Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z]).":"Invalid argument supplied to oneOf, expected an array."),a;return y(function(t,n,r,o,i){for(var a=t[n],c=0;c<e.length;c++)if(p(a,e[c]))return null;var u=JSON.stringify(e,function(e,t){return"symbol"===v(t)?String(t):t});return new d("Invalid "+o+" `"+i+"` of value `"+String(a)+"` supplied to `"+r+"`, expected one of "+u+".")})},oneOfType:function(e){if(!Array.isArray(e))return"production"!==process.env.NODE_ENV&&i("Invalid argument supplied to oneOfType, expected an instance of array."),a;for(var t=0;t<e.length;t++){var o=e[t];if("function"!=typeof o)return i("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+S(o)+" at index "+t+"."),a}return y(function(t,o,i,a,c){for(var u=[],l=0;l<e.length;l++){var s=(0,e[l])(t,o,i,a,c,n);if(null==s)return null;s.data&&r(s.data,"expectedType")&&u.push(s.data.expectedType)}return new d("Invalid "+a+" `"+c+"` supplied to `"+i+"`"+(u.length>0?", expected one of type ["+u.join(", ")+"]":"")+".")})},shape:function(e){return y(function(t,r,o,i,a){var c=t[r],u=m(c);if("object"!==u)return new d("Invalid "+i+" `"+a+"` of type `"+u+"` supplied to `"+o+"`, expected `object`.");for(var l in e){var s=e[l];if("function"!=typeof s)return b(o,i,a,l,v(s));var f=s(c,l,o,i,a+"."+l,n);if(f)return f}return null})},exact:function(e){return y(function(o,i,a,c,u){var l=o[i],s=m(l);if("object"!==s)return new d("Invalid "+c+" `"+u+"` of type `"+s+"` supplied to `"+a+"`, expected `object`.");var f=t({},o[i],e);for(var p in f){var y=e[p];if(r(e,p)&&"function"!=typeof y)return b(a,c,u,p,v(y));if(!y)return new d("Invalid "+c+" `"+u+"` key `"+p+"` supplied to `"+a+"`.\nBad object: "+JSON.stringify(o[i],null," ")+"\nValid keys: "+JSON.stringify(Object.keys(e),null," "));var g=y(l,p,a,c,u+"."+p,n);if(g)return g}return null})}};function p(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}function d(e,t){this.message=e,this.data=t&&"object"==typeof t?t:{},this.stack=""}function y(e){if("production"!==process.env.NODE_ENV)var t={},r=0;function o(o,a,c,l,f,p,y){if(l=l||s,p=p||c,y!==n){if(u){var g=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw g.name="Invariant Violation",g}if("production"!==process.env.NODE_ENV&&"undefined"!=typeof console){var b=l+":"+c;!t[b]&&r<3&&(i("You are manually calling a React.PropTypes validation function for the `"+p+"` prop on `"+l+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),t[b]=!0,r++)}}return null==a[c]?o?null===a[c]?new d("The "+f+" `"+p+"` is marked as required in `"+l+"`, but its value is `null`."):new d("The "+f+" `"+p+"` is marked as required in `"+l+"`, but its value is `undefined`."):null:e(a,c,l,f,p)}var a=o.bind(null,!1);return a.isRequired=o.bind(null,!0),a}function g(e){return y(function(t,n,r,o,i,a){var c=t[n];return m(c)!==e?new d("Invalid "+o+" `"+i+"` of type `"+v(c)+"` supplied to `"+r+"`, expected `"+e+"`.",{expectedType:e}):null})}function b(e,t,n,r,o){return new d((e||"React class")+": "+t+" type `"+n+"."+r+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+o+"`.")}function h(e){switch(typeof e){case"number":case"string":case"undefined":return!0;case"boolean":return!e;case"object":if(Array.isArray(e))return e.every(h);if(null===e||c(e))return!0;var t=function(e){var t=e&&(l&&e[l]||e["@@iterator"]);if("function"==typeof t)return t}(e);if(!t)return!1;var n,r=t.call(e);if(t!==e.entries){for(;!(n=r.next()).done;)if(!h(n.value))return!1}else for(;!(n=r.next()).done;){var o=n.value;if(o&&!h(o[1]))return!1}return!0;default:return!1}}function m(e){var t=typeof e;return Array.isArray(e)?"array":e instanceof RegExp?"object":function(e,t){return"symbol"===e||!!t&&("Symbol"===t["@@toStringTag"]||"function"==typeof Symbol&&t instanceof Symbol)}(t,e)?"symbol":t}function v(e){if(null==e)return""+e;var t=m(e);if("object"===t){if(e instanceof Date)return"date";if(e instanceof RegExp)return"regexp"}return t}function S(e){var t=v(e);switch(t){case"array":case"object":return"an "+t;case"boolean":case"date":case"regexp":return"a "+t;default:return t}}return d.prototype=Error.prototype,f.checkPropTypes=o,f.resetWarningCache=o.resetWarningCache,f.PropTypes=f,f},F}function te(){if(q)return U;q=1;var e=/*@__PURE__*/K();function t(){}function n(){}return n.resetWarningCache=t,U=function(){function r(t,n,r,o,i,a){if(a!==e){var c=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw c.name="Invariant Violation",c}}function o(){return r}r.isRequired=r;var i={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:o,element:r,elementType:r,instanceOf:o,node:r,objectOf:o,oneOf:o,oneOfType:o,shape:o,exact:o,checkPropTypes:n,resetWarningCache:t};return i.PropTypes=i,i}}function ne(){if(X)return $.exports;if(X=1,"production"!==process.env.NODE_ENV){var e=Y();$.exports=/*@__PURE__*/ee()(e.isElement,true)}else $.exports=/*@__PURE__*/te()();return $.exports}const re=/*@__PURE__*/x(/*@__PURE__*/ne());function oe(e,t){const n=P({},t);return Object.keys(e).forEach(r=>{if(r.toString().match(/^(components|slots)$/))n[r]=P({},e[r],n[r]);else if(r.toString().match(/^(componentsProps|slotProps)$/)){const o=e[r]||{},i=t[r];n[r]={},i&&Object.keys(i)?o&&Object.keys(o)?(n[r]=P({},i),Object.keys(o).forEach(e=>{n[r][e]=oe(o[e],i[e])})):n[r]=i:n[r]=o}else void 0===n[r]&&(n[r]=e[r])}),n}const ie=e=>e,ae=(()=>{let e=ie;return{configure(t){e=t},generate:t=>e(t),reset(){e=ie}}})(),ce={active:"active",checked:"checked",completed:"completed",disabled:"disabled",error:"error",expanded:"expanded",focused:"focused",focusVisible:"focusVisible",open:"open",readOnly:"readOnly",required:"required",selected:"selected"};function ue(e,t,n="Mui"){const r=ce[t];return r?`${n}-${r}`:`${ae.generate(e)}-${t}`}function le(e){return ue("MuiLoadingButton",e)}const se=function(e,t,n="Mui"){const r={};return t.forEach(t=>{r[t]=ue(e,t,n)}),r}("MuiLoadingButton",["root","loading","loadingIndicator","loadingIndicatorCenter","loadingIndicatorStart","loadingIndicatorEnd","endIconLoadingEnd","startIconLoadingStart"]),fe=["children","disabled","id","loading","loadingIndicator","loadingPosition","variant"],pe=e=>{const{loading:t,loadingPosition:n,classes:r}=e,o=function(e,t,n){const r={};return Object.keys(e).forEach(o=>{r[o]=e[o].reduce((e,r)=>{if(r){const o=t(r);""!==o&&e.push(o),n&&n[r]&&e.push(n[r])}return e},[]).join(" ")}),r}({root:["root",t&&"loading"],startIcon:[t&&`startIconLoading${p(n)}`],endIcon:[t&&`endIconLoading${p(n)}`],loadingIndicator:["loadingIndicator",t&&`loadingIndicator${p(n)}`]},le,r);return P({},r,o)},de=d(h,{shouldForwardProp:e=>(e=>"ownerState"!==e&&"theme"!==e&&"sx"!==e&&"as"!==e&&"classes"!==e)(e)||"classes"===e,name:"MuiLoadingButton",slot:"Root",overridesResolver:(e,t)=>[t.root,t.startIconLoadingStart&&{[`& .${se.startIconLoadingStart}`]:t.startIconLoadingStart},t.endIconLoadingEnd&&{[`& .${se.endIconLoadingEnd}`]:t.endIconLoadingEnd}]})(({ownerState:e,theme:t})=>P({[`& .${se.startIconLoadingStart}, & .${se.endIconLoadingEnd}`]:{transition:t.transitions.create(["opacity"],{duration:t.transitions.duration.short}),opacity:0}},"center"===e.loadingPosition&&{transition:t.transitions.create(["background-color","box-shadow","border-color"],{duration:t.transitions.duration.short}),[`&.${se.loading}`]:{color:"transparent"}},"start"===e.loadingPosition&&e.fullWidth&&{[`& .${se.startIconLoadingStart}, & .${se.endIconLoadingEnd}`]:{transition:t.transitions.create(["opacity"],{duration:t.transitions.duration.short}),opacity:0,marginRight:-8}},"end"===e.loadingPosition&&e.fullWidth&&{[`& .${se.startIconLoadingStart}, & .${se.endIconLoadingEnd}`]:{transition:t.transitions.create(["opacity"],{duration:t.transitions.duration.short}),opacity:0,marginLeft:-8}})),ye=d("span",{name:"MuiLoadingButton",slot:"LoadingIndicator",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.loadingIndicator,t[`loadingIndicator${p(n.loadingPosition)}`]]}})(({theme:e,ownerState:t})=>P({position:"absolute",visibility:"visible",display:"flex"},"start"===t.loadingPosition&&("outlined"===t.variant||"contained"===t.variant)&&{left:"small"===t.size?10:14},"start"===t.loadingPosition&&"text"===t.variant&&{left:6},"center"===t.loadingPosition&&{left:"50%",transform:"translate(-50%)",color:(e.vars||e).palette.action.disabled},"end"===t.loadingPosition&&("outlined"===t.variant||"contained"===t.variant)&&{right:"small"===t.size?10:14},"end"===t.loadingPosition&&"text"===t.variant&&{right:6},"start"===t.loadingPosition&&t.fullWidth&&{position:"relative",left:-10},"end"===t.loadingPosition&&t.fullWidth&&{position:"relative",right:-10})),ge=/*#__PURE__*/n.forwardRef(function(r,o){const i=oe(n.useContext(m),r),a=b({props:i,name:"MuiLoadingButton"}),{children:c,disabled:u=!1,id:l,loading:s=!1,loadingIndicator:p,loadingPosition:d="center",variant:y="text"}=a,g=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(a,fe),h=f(l),S=null!=p?p:/*#__PURE__*/e(v,{"aria-labelledby":h,color:"inherit",size:16}),x=P({},a,{disabled:u,loading:s,loadingIndicator:S,loadingPosition:d,variant:y}),O=pe(x),j=s?/*#__PURE__*/e(ye,{className:O.loadingIndicator,ownerState:x,children:S}):null;/*#__PURE__*/
|
|
21
|
+
return t(de,P({disabled:u||s,id:h,ref:o},g,{variant:y,classes:O,ownerState:x,children:["end"===x.loadingPosition?c:j,"end"===x.loadingPosition?j:c]}))});var be,he,me,ve;"production"!==process.env.NODE_ENV&&(ge.propTypes={children:re.node,classes:re.object,disabled:re.bool,id:re.string,loading:re.bool,loadingIndicator:re.node,loadingPosition:(be=re.oneOf(["start","end","center"]),he=e=>"start"!==e.loadingPosition||e.startIcon?"end"!==e.loadingPosition||e.endIcon?null:new Error('MUI: The loadingPosition="end" should be used in combination with endIcon.'):new Error('MUI: The loadingPosition="start" should be used in combination with startIcon.'),"production"===process.env.NODE_ENV?()=>null:function(...e){return be(...e)||he(...e)}),sx:re.oneOfType([re.arrayOf(re.oneOfType([re.func,re.object,re.bool])),re.func,re.object]),variant:re.oneOfType([re.oneOf(["contained","outlined","text"]),re.string])});const Se=/*@__PURE__*/x(ve?me:(ve=1,me=function(){}));var xe,Oe,je,we,Ie,Ee,Te,Pe,Ce,$e,Le,Me,Ne,We,ke,ze,Ae,De,Re,He,_e,Be,Fe,Ve,Ue,qe,Xe,Ge,Ye,Je,Ke,Qe,Ze,et,tt,nt,rt,ot,it,at,ct,ut,lt,st,ft,pt,dt,yt,gt,bt,ht,mt,vt,St,xt,Ot,jt,wt,It,Et;function Tt(){if(Oe)return xe;Oe=1;var e=Object.prototype;return xe=function(t){var n=t&&t.constructor;return t===("function"==typeof n&&n.prototype||e)}}function Pt(){if(Ee)return Ie;Ee=1;var e=(we?je:(we=1,je=function(e,t){return function(n){return e(t(n))}}))(Object.keys,Object);return Ie=e}function Ct(){if($e)return Ce;$e=1;var e="object"==typeof S&&S&&S.Object===Object&&S;return Ce=e}function $t(){if(Me)return Le;Me=1;var e=Ct(),t="object"==typeof self&&self&&self.Object===Object&&self,n=e||t||Function("return this")();return Le=n}function Lt(){if(We)return Ne;We=1;var e=$t().Symbol;return Ne=e}function Mt(){if(He)return Re;He=1;var e=Lt(),t=function(){if(ze)return ke;ze=1;var e=Lt(),t=Object.prototype,n=t.hasOwnProperty,r=t.toString,o=e?e.toStringTag:void 0;return ke=function(e){var t=n.call(e,o),i=e[o];try{e[o]=void 0;var a=!0}catch(u){}var c=r.call(e);return a&&(t?e[o]=i:delete e[o]),c}}(),n=function(){if(De)return Ae;De=1;var e=Object.prototype.toString;return Ae=function(t){return e.call(t)}}(),r=e?e.toStringTag:void 0;return Re=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":r&&r in Object(e)?t(e):n(e)}}function Nt(){if(Be)return _e;return Be=1,_e=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}}function Wt(){if(Ve)return Fe;Ve=1;var e=Mt(),t=Nt();return Fe=function(n){if(!t(n))return!1;var r=e(n);return"[object Function]"==r||"[object GeneratorFunction]"==r||"[object AsyncFunction]"==r||"[object Proxy]"==r}}function kt(){if(Ge)return Xe;Ge=1;var e,t=function(){if(qe)return Ue;qe=1;var e=$t()["__core-js_shared__"];return Ue=e}(),n=(e=/[^.]+$/.exec(t&&t.keys&&t.keys.IE_PROTO||""))?"Symbol(src)_1."+e:"";return Xe=function(e){return!!n&&n in e}}function zt(){if(Je)return Ye;Je=1;var e=Function.prototype.toString;return Ye=function(t){if(null!=t){try{return e.call(t)}catch(n){}try{return t+""}catch(n){}}return""}}function At(){if(nt)return tt;nt=1;var e=function(){if(Qe)return Ke;Qe=1;var e=Wt(),t=kt(),n=Nt(),r=zt(),o=/^\[object .+?Constructor\]$/,i=Function.prototype,a=Object.prototype,c=i.toString,u=a.hasOwnProperty,l=RegExp("^"+c.call(u).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");return Ke=function(i){return!(!n(i)||t(i))&&(e(i)?l:o).test(r(i))}}(),t=et?Ze:(et=1,Ze=function(e,t){return null==e?void 0:e[t]});return tt=function(n,r){var o=t(n,r);return e(o)?o:void 0}}function Dt(){if(yt)return dt;yt=1;var e=function(){if(ot)return rt;ot=1;var e=At()($t(),"DataView");return rt=e}(),t=function(){if(at)return it;at=1;var e=At()($t(),"Map");return it=e}(),n=function(){if(ut)return ct;ut=1;var e=At()($t(),"Promise");return ct=e}(),r=function(){if(st)return lt;st=1;var e=At()($t(),"Set");return lt=e}(),o=function(){if(pt)return ft;pt=1;var e=At()($t(),"WeakMap");return ft=e}(),i=Mt(),a=zt(),c="[object Map]",u="[object Promise]",l="[object Set]",s="[object WeakMap]",f="[object DataView]",p=a(e),d=a(t),y=a(n),g=a(r),b=a(o),h=i;return(e&&h(new e(new ArrayBuffer(1)))!=f||t&&h(new t)!=c||n&&h(n.resolve())!=u||r&&h(new r)!=l||o&&h(new o)!=s)&&(h=function(e){var t=i(e),n="[object Object]"==t?e.constructor:void 0,r=n?a(n):"";if(r)switch(r){case p:return f;case d:return c;case y:return u;case g:return l;case b:return s}return t}),dt=h}function Rt(){if(bt)return gt;return bt=1,gt=function(e){return null!=e&&"object"==typeof e}}function Ht(){if(St)return vt;St=1;var e=function(){if(mt)return ht;mt=1;var e=Mt(),t=Rt();return ht=function(n){return t(n)&&"[object Arguments]"==e(n)}}(),t=Rt(),n=Object.prototype,r=n.hasOwnProperty,o=n.propertyIsEnumerable,i=e(function(){return arguments}())?e:function(e){return t(e)&&r.call(e,"callee")&&!o.call(e,"callee")};return vt=i}function _t(){if(wt)return jt;wt=1;return jt=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}}var Bt,Ft,Vt,Ut,qt,Xt,Gt,Yt={exports:{}};function Jt(){return Vt||(Vt=1,function(e,t){var n=$t(),r=Ft?Bt:(Ft=1,Bt=function(){return!1}),o=t&&!t.nodeType&&t,i=o&&e&&!e.nodeType&&e,a=i&&i.exports===o?n.Buffer:void 0,c=(a?a.isBuffer:void 0)||r;e.exports=c}(Yt,Yt.exports)),Yt.exports}var Kt,Qt,Zt,en,tn,nn={exports:{}};function rn(){if(Zt)return Qt;Zt=1;var e=function(){if(qt)return Ut;qt=1;var e=Mt(),t=_t(),n=Rt(),r={};return r["[object Float32Array]"]=r["[object Float64Array]"]=r["[object Int8Array]"]=r["[object Int16Array]"]=r["[object Int32Array]"]=r["[object Uint8Array]"]=r["[object Uint8ClampedArray]"]=r["[object Uint16Array]"]=r["[object Uint32Array]"]=!0,r["[object Arguments]"]=r["[object Array]"]=r["[object ArrayBuffer]"]=r["[object Boolean]"]=r["[object DataView]"]=r["[object Date]"]=r["[object Error]"]=r["[object Function]"]=r["[object Map]"]=r["[object Number]"]=r["[object Object]"]=r["[object RegExp]"]=r["[object Set]"]=r["[object String]"]=r["[object WeakMap]"]=!1,Ut=function(o){return n(o)&&t(o.length)&&!!r[e(o)]}}(),t=Gt?Xt:(Gt=1,Xt=function(e){return function(t){return e(t)}}),n=(Kt||(Kt=1,function(e,t){var n=Ct(),r=t&&!t.nodeType&&t,o=r&&e&&!e.nodeType&&e,i=o&&o.exports===r&&n.process,a=function(){try{return o&&o.require&&o.require("util").types||i&&i.binding&&i.binding("util")}catch(e){}}();e.exports=a}(nn,nn.exports)),nn.exports),r=n&&n.isTypedArray,o=r?t(r):e;return Qt=o}var on=function(){if(tn)return en;tn=1;var e=function(){if(Pe)return Te;Pe=1;var e=Tt(),t=Pt(),n=Object.prototype.hasOwnProperty;return Te=function(r){if(!e(r))return t(r);var o=[];for(var i in Object(r))n.call(r,i)&&"constructor"!=i&&o.push(i);return o}}(),t=Dt(),n=Ht(),r=function(){if(Ot)return xt;Ot=1;var e=Array.isArray;return xt=e}(),o=function(){if(Et)return It;Et=1;var e=Wt(),t=_t();return It=function(n){return null!=n&&t(n.length)&&!e(n)}}(),i=Jt(),a=Tt(),c=rn(),u=Object.prototype.hasOwnProperty;return en=function(l){if(null==l)return!0;if(o(l)&&(r(l)||"string"==typeof l||"function"==typeof l.splice||i(l)||c(l)||n(l)))return!l.length;var s=t(l);if("[object Map]"==s||"[object Set]"==s)return!l.size;if(a(l))return!e(l).length;for(var f in l)if(u.call(l,f))return!1;return!0}}();const an=/*@__PURE__*/x(on),cn={semibold:590,regular:400},un={default:"normal"},ln={fontFamily:"-apple-system,system-ui,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Fira Sans,Ubuntu,Oxygen,Oxygen Sans,Cantarell,Droid Sans,Apple Color Emoji,Segoe UI Emoji,Segoe UI Emoji,Segoe UI Symbol,Lucida Grande,Helvetica,Arial,sans-serif",displayL:{fontSize:"80px",fontWeight:cn.semibold,lineHeight:"92px",letterSpacing:un.default},displayM:{fontSize:"40px",fontWeight:cn.semibold,lineHeight:"52px",letterSpacing:un.default},headingL:{fontSize:"32px",fontWeight:cn.semibold,lineHeight:"44px",letterSpacing:un.default},headingM:{fontSize:"28px",fontWeight:cn.semibold,lineHeight:"40px",letterSpacing:un.default},headingS:{fontSize:"24px",fontWeight:cn.semibold,lineHeight:"36px",letterSpacing:un.default},semiBoldLabelL:{fontSize:"20px",lineHeight:"28px",fontWeight:cn.semibold,letterSpacing:un.default},semiBoldLabelM:{fontSize:"16px",lineHeight:"24px",fontWeight:cn.semibold,letterSpacing:un.default},semiBoldLabelS:{fontSize:"14px",lineHeight:"20px",fontWeight:cn.semibold,letterSpacing:un.default},semiBoldLabelXs:{fontSize:"12px",lineHeight:"16px",fontWeight:cn.semibold,letterSpacing:un.default},semiBoldLabelXxs:{fontSize:"10px",lineHeight:"14px",fontWeight:cn.semibold,letterSpacing:un.default},regularLabelL:{fontSize:"20px",lineHeight:"28px",fontWeight:cn.regular,letterSpacing:un.default},regularLabelM:{fontSize:"16px",lineHeight:"24px",fontWeight:cn.regular,letterSpacing:un.default},regularLabelS:{fontSize:"14px",lineHeight:"20px",fontWeight:cn.regular,letterSpacing:un.default},regularLabelXs:{fontSize:"12px",lineHeight:"16px",fontWeight:cn.regular,letterSpacing:un.default},regularLabelXxs:{fontSize:"10px",lineHeight:"14px",fontWeight:cn.regular,letterSpacing:un.default},textXl:{fontSize:"20px",fontWeight:cn.regular,lineHeight:"28px",letterSpacing:un.default},textL:{fontSize:"16px",fontWeight:cn.regular,lineHeight:"24px",letterSpacing:un.default},textM:{fontSize:"14px",fontWeight:cn.regular,lineHeight:"20px",letterSpacing:un.default},subtextM:{fontSize:"12px",fontWeight:cn.regular,lineHeight:"16px",letterSpacing:un.default},subtextS:{fontSize:"10px",fontWeight:cn.regular,lineHeight:"14px",letterSpacing:un.default},semiBoldLinkXL:{fontSize:"20px",fontWeight:cn.semibold,lineHeight:"28px",letterSpacing:un.default,textDecoration:"underline"},semiBoldLinkL:{fontSize:"16px",fontWeight:cn.semibold,lineHeight:"24px",letterSpacing:un.default,textDecoration:"underline"},semiBoldLinkM:{fontSize:"14px",fontWeight:cn.semibold,lineHeight:"20px",letterSpacing:un.default,textDecoration:"underline"},semiBoldLinkS:{fontSize:"12px",fontWeight:cn.semibold,lineHeight:"16px",letterSpacing:un.default,textDecoration:"underline"},semiBoldLinkXs:{fontSize:"10px",fontWeight:cn.semibold,lineHeight:"14px",letterSpacing:un.default,textDecoration:"underline"},regularLinkXL:{fontSize:"20px",fontWeight:cn.regular,lineHeight:"20px",letterSpacing:un.default,textDecoration:"underline"},regularLinkL:{fontSize:"16px",fontWeight:cn.regular,lineHeight:"24px",letterSpacing:un.default,textDecoration:"underline"},h1:{fontSize:"26px",fontWeight:590,lineHeight:"32px"},h2:{fontSize:"22px",fontWeight:590,lineHeight:"26px"},h3:{fontSize:"17px",fontWeight:590,lineHeight:"22px"},h4:{fontSize:"15px",fontWeight:590,lineHeight:"20px"},h5:{fontSize:"14px",fontWeight:590,lineHeight:"20px"},headline:{fontSize:"13px",fontWeight:590,lineHeight:"16px"},body:{fontSize:"13px",lineHeight:"16px",fontWeight:400},callout:{fontSize:"13px",fontWeight:510,lineHeight:"15px"},subHeadline1:{fontSize:"14px",lineHeight:"20px",fontWeight:400},subHeadline2:{fontSize:"13px",lineHeight:"20px",fontWeight:400},footNote:{fontSize:"12px",lineHeight:"13px",fontWeight:400},caption1:{fontSize:"10px",lineHeight:"13px",fontWeight:400},caption2:{fontSize:"10px",lineHeight:"13px",fontWeight:510}},sn=a({palette:{primary:{main:"#1E221E",contrastText:"#ffffff"},secondary:{main:"#0A9083",contrastText:"#000000"},error:{main:"#ED1D31",contrastText:"#ffffff"},warning:{main:"#F3800D",contrastText:"#000000"},info:{main:"#0881EA",contrastText:"#000000"},success:{main:"#0AB22C",contrastText:"#000000"},background:{default:"#F7F9FC"}},typography:ln,components:{MuiTypography:{defaultProps:{variantMapping:{h1:"h1",h2:"h2",h3:"h3",h4:"h4",headline:"h5",body:"span",callout:"span",subHeadline1:"span",subHeadline2:"span",footNote:"span",caption1:"span",caption2:"span"}}},MuiButton:{defaultProps:{disableElevation:!0,size:"large"},styleOverrides:{root:{textTransform:"none",fontSize:"14px",borderRadius:"8px"},text:{textDecoration:"underline","&:hover":{backgroundColor:"transparent",textDecoration:"underline"},padding:"0px 8px",textAlign:"left"}}},MuiTab:{styleOverrides:{root:{textTransform:"none",fontSize:"14px"}}},MuiChip:{defaultProps:{size:"small"},styleOverrides:{root:{paddingLeft:"5px",paddingRight:"5px"}}},MuiPaper:{styleOverrides:{root:{borderRadius:"16px"}}},MuiCard:{defaultProps:{variant:"outlined"},styleOverrides:{root:{borderRadius:"16px"}}},MuiAutocomplete:{styleOverrides:{root:{"& .MuiAutocomplete-inputRoot":{paddingLeft:"14px"}}}},MuiLink:{styleOverrides:{root:{fontWeight:"bold","&:hover":{cursor:"pointer"}}},defaultProps:{variant:"body"}},MuiTextField:{styleOverrides:{root:{"& .MuiInputBase-root":{borderRadius:"8px"}}}},MuiFormControl:{styleOverrides:{root:{"& .MuiInputBase-root":{borderRadius:"8px"}}}},MuiDrawer:{styleOverrides:{paper:{borderRadius:0}}}}}),fn={INFORMATION:"information",INPUT:"input"},pn={PROGRESS:"progress",PASSIVE:"passive"},dn={DEFAULT:"default",DESTRUCTIVE:"destructive"},yn={[fn.INFORMATION]:{[pn.PROGRESS]:{DISMISSIBLE:"partial"},[pn.PASSIVE]:{DISMISSIBLE:"full"}},[fn.INPUT]:{[dn.DEFAULT]:{DISMISSIBLE:"partial"},[dn.DESTRUCTIVE]:{DISMISSIBLE:"partial"}}},gn={DEFAULT:"default",DESTRUCTIVE:"destructive"},bn=/^((?!chrome|android).)*safari/i.test(navigator.userAgent),hn=n=>{const[a,s]=r(!1),[f,p]=r("50%"),d=o(null),b=y(),h=an(b)?sn:{...b,typography:{...b.typography,...ln}},m=n.type===fn.INFORMATION||n.type===fn.INPUT?n.subtype:"default",{anchor:v="right",wrapperClassName:S,bodyWrapperClassName:x,open:O,type:j,title:w,subTitle:I,description:P,onClose:C,children:$,actions:L,width:M,maxWidth:N,showActions:W=!0,showDivider:k=!0,showCloseIcon:z=!0,tertiaryCtaType:A="default",...D}=n,{primaryCtaTitle:R,primaryCtaClassName:H,secondaryCtaTitle:_,secondaryCtaClassName:B,secondaryCtaStartIcon:F,isPrimaryCtaLoading:V=!1,isPrimaryCtaDisabled:U,isSecondaryCtaLoading:q=!1,isSecondaryCtaDisabled:X,onPrimaryCtaClick:G=Se,onSecondaryCtaClick:Y=Se,tertiaryCtaTitle:J,tertiaryCtaClassName:K,tertiaryCtaStartIcon:Q,isTertiaryCtaLoading:Z=!1,isTertiaryCtaDisabled:ee,onTertiaryCtaClick:te=Se,primaryCtaTooltipText:ne,secondaryCtaTooltipText:re,tertiaryCtaTooltipText:oe,showPrimaryCtaTooltipMsg:ie=!1,showSecondaryCtaTooltipMsg:ae=!1,showTertiaryCtaTooltipMsg:ce=!1,primaryCtaButtonProps:ue,secondaryCtaButtonProps:le,tertiaryCtaButtonProps:se}=L||{},fe=yn[j][m]||yn[j].default,pe=W&&(R||_||J),de=[R,_,J].filter(Boolean).length,ye=U||ie?ne:"",be=X||ae?re:"",he=ee||ce?oe:"";return i(()=>{const e=setTimeout(()=>{if(d.current){const e=d.current.getBoundingClientRect().width;e<600&&p("100%"),e>=600&&p("50%"),e>=900&&p("33%"),e>=1200&&p("25%")}},0);return()=>clearTimeout(e)},[d.current]),i(()=>s(O),[O]),/* @__PURE__ */e(g,{theme:h,children:/* @__PURE__ */e(c,{className:E("vi-drawer",S),open:a,anchor:v,onClose:()=>{"full"===fe?.DISMISSIBLE&&C()},transitionDuration:300,...D,children:/* @__PURE__ */t("div",{ref:d,style:{width:M,maxWidth:N},className:E("h-fill",bn&&"safari-flex-container"),children:[w&&/* @__PURE__ */t("div",{className:"vi-drawer-title",children:[
|
|
22
|
+
/* @__PURE__ */t("div",{className:"d-f ai-c jc-sb",children:[
|
|
23
|
+
/* @__PURE__ */t("div",{className:"d-f fd-col gap-8",children:[
|
|
24
|
+
/* @__PURE__ */e(u,{variant:"semiBoldLabelL",children:w}),I&&/* @__PURE__ */e(u,{variant:"subtextM",children:I})]}),z&&/* @__PURE__ */e(T,{fontSize:"small",className:"close-icon","aria-label":"Close drawer",onClick:C})]}),P&&/* @__PURE__ */e(u,{component:"div",className:"description",variant:"subtextM",children:P})]}),
|
|
25
|
+
/* @__PURE__ */e("div",{className:E("drawer-children",w&&pe?"with-header-footer":w?"with-header":pe?"with-footer":"",3===de?"three-ctas":"",2===de?"two-ctas":"",1===de?"one-cta":"",pe&&!k?"no-divider":"",x),children:$}),pe&&/* @__PURE__ */t("div",{className:E("vi-drawer-actions",k?"divider":"",J?"tertiary-cta":""),children:[J&&/* @__PURE__ */e(l,{title:he,arrow:!0,children:/* @__PURE__ */e(ge,{className:E(A===gn.DESTRUCTIVE?"tertiary-cta-destructive":"",K),variant:"text",onClick:te,startIcon:Q,loading:Z,disabled:void 0!==ee?ee:!(!V&&!q),...se,children:J})}),
|
|
26
|
+
/* @__PURE__ */t("div",{style:{width:f},className:"vi-drawer-action-ctas",children:[_&&/* @__PURE__ */e(l,{title:be,arrow:!0,children:/* @__PURE__ */e(ge,{className:E("vi-drawer-cta",B),variant:"outlined",onClick:Y,startIcon:F,loading:q,disabled:void 0!==X?X:!(!V&&!Z),...le,children:_})}),R&&/* @__PURE__ */e(l,{title:ye,arrow:!0,children:/* @__PURE__ */e(ge,{className:E("vi-drawer-cta","destructive"===m?"destructive":"",H),variant:"contained",onClick:G,loading:V,disabled:void 0!==U?U:!(!q&&!Z),...ue,children:R})})]})]})]})})})};export{yn as DRAWER_CONFIGS,fn as DRAWER_TYPES,pn as INFORMATION_SUBTYPES,dn as INPUT_SUBTYPES,hn as MuiDrawer,gn as TERTIARY_CTA_TYPES};
|