bianic-ui 0.2.58

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.
@@ -0,0 +1,3091 @@
1
+ 'use strict';
2
+
3
+ /******************************************************************************
4
+ Copyright (c) Microsoft Corporation.
5
+
6
+ Permission to use, copy, modify, and/or distribute this software for any
7
+ purpose with or without fee is hereby granted.
8
+
9
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
10
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
11
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
12
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
13
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
14
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
15
+ PERFORMANCE OF THIS SOFTWARE.
16
+ ***************************************************************************** */
17
+ /* global Reflect, Promise, SuppressedError, Symbol */
18
+
19
+
20
+ var __assign = function() {
21
+ __assign = Object.assign || function __assign(t) {
22
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
23
+ s = arguments[i];
24
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
25
+ }
26
+ return t;
27
+ };
28
+ return __assign.apply(this, arguments);
29
+ };
30
+
31
+ function __rest(s, e) {
32
+ var t = {};
33
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
34
+ t[p] = s[p];
35
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
36
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
37
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
38
+ t[p[i]] = s[p[i]];
39
+ }
40
+ return t;
41
+ }
42
+
43
+ typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
44
+ var e = new Error(message);
45
+ return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
46
+ };
47
+
48
+ function getDefaultExportFromCjs (x) {
49
+ return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
50
+ }
51
+
52
+ var react = {exports: {}};
53
+
54
+ var react_production_min = {};
55
+
56
+ /**
57
+ * @license React
58
+ * react.production.min.js
59
+ *
60
+ * Copyright (c) Facebook, Inc. and its affiliates.
61
+ *
62
+ * This source code is licensed under the MIT license found in the
63
+ * LICENSE file in the root directory of this source tree.
64
+ */
65
+
66
+ var hasRequiredReact_production_min;
67
+
68
+ function requireReact_production_min () {
69
+ if (hasRequiredReact_production_min) return react_production_min;
70
+ hasRequiredReact_production_min = 1;
71
+ var l=Symbol.for("react.element"),n=Symbol.for("react.portal"),p=Symbol.for("react.fragment"),q=Symbol.for("react.strict_mode"),r=Symbol.for("react.profiler"),t=Symbol.for("react.provider"),u=Symbol.for("react.context"),v=Symbol.for("react.forward_ref"),w=Symbol.for("react.suspense"),x=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),z=Symbol.iterator;function A(a){if(null===a||"object"!==typeof a)return null;a=z&&a[z]||a["@@iterator"];return "function"===typeof a?a:null}
72
+ var B={isMounted:function(){return !1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},C=Object.assign,D={};function E(a,b,e){this.props=a;this.context=b;this.refs=D;this.updater=e||B;}E.prototype.isReactComponent={};
73
+ E.prototype.setState=function(a,b){if("object"!==typeof a&&"function"!==typeof a&&null!=a)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,a,b,"setState");};E.prototype.forceUpdate=function(a){this.updater.enqueueForceUpdate(this,a,"forceUpdate");};function F(){}F.prototype=E.prototype;function G(a,b,e){this.props=a;this.context=b;this.refs=D;this.updater=e||B;}var H=G.prototype=new F;
74
+ H.constructor=G;C(H,E.prototype);H.isPureReactComponent=!0;var I=Array.isArray,J=Object.prototype.hasOwnProperty,K={current:null},L={key:!0,ref:!0,__self:!0,__source:!0};
75
+ function M(a,b,e){var d,c={},k=null,h=null;if(null!=b)for(d in void 0!==b.ref&&(h=b.ref),void 0!==b.key&&(k=""+b.key),b)J.call(b,d)&&!L.hasOwnProperty(d)&&(c[d]=b[d]);var g=arguments.length-2;if(1===g)c.children=e;else if(1<g){for(var f=Array(g),m=0;m<g;m++)f[m]=arguments[m+2];c.children=f;}if(a&&a.defaultProps)for(d in g=a.defaultProps,g)void 0===c[d]&&(c[d]=g[d]);return {$$typeof:l,type:a,key:k,ref:h,props:c,_owner:K.current}}
76
+ function N(a,b){return {$$typeof:l,type:a.type,key:b,ref:a.ref,props:a.props,_owner:a._owner}}function O(a){return "object"===typeof a&&null!==a&&a.$$typeof===l}function escape(a){var b={"=":"=0",":":"=2"};return "$"+a.replace(/[=:]/g,function(a){return b[a]})}var P=/\/+/g;function Q(a,b){return "object"===typeof a&&null!==a&&null!=a.key?escape(""+a.key):b.toString(36)}
77
+ function R(a,b,e,d,c){var k=typeof a;if("undefined"===k||"boolean"===k)a=null;var h=!1;if(null===a)h=!0;else switch(k){case "string":case "number":h=!0;break;case "object":switch(a.$$typeof){case l:case n:h=!0;}}if(h)return h=a,c=c(h),a=""===d?"."+Q(h,0):d,I(c)?(e="",null!=a&&(e=a.replace(P,"$&/")+"/"),R(c,b,e,"",function(a){return a})):null!=c&&(O(c)&&(c=N(c,e+(!c.key||h&&h.key===c.key?"":(""+c.key).replace(P,"$&/")+"/")+a)),b.push(c)),1;h=0;d=""===d?".":d+":";if(I(a))for(var g=0;g<a.length;g++){k=
78
+ a[g];var f=d+Q(k,g);h+=R(k,b,e,f,c);}else if(f=A(a),"function"===typeof f)for(a=f.call(a),g=0;!(k=a.next()).done;)k=k.value,f=d+Q(k,g++),h+=R(k,b,e,f,c);else if("object"===k)throw b=String(a),Error("Objects are not valid as a React child (found: "+("[object Object]"===b?"object with keys {"+Object.keys(a).join(", ")+"}":b)+"). If you meant to render a collection of children, use an array instead.");return h}
79
+ function S(a,b,e){if(null==a)return a;var d=[],c=0;R(a,d,"","",function(a){return b.call(e,a,c++)});return d}function T(a){if(-1===a._status){var b=a._result;b=b();b.then(function(b){if(0===a._status||-1===a._status)a._status=1,a._result=b;},function(b){if(0===a._status||-1===a._status)a._status=2,a._result=b;});-1===a._status&&(a._status=0,a._result=b);}if(1===a._status)return a._result.default;throw a._result;}
80
+ var U={current:null},V={transition:null},W={ReactCurrentDispatcher:U,ReactCurrentBatchConfig:V,ReactCurrentOwner:K};react_production_min.Children={map:S,forEach:function(a,b,e){S(a,function(){b.apply(this,arguments);},e);},count:function(a){var b=0;S(a,function(){b++;});return b},toArray:function(a){return S(a,function(a){return a})||[]},only:function(a){if(!O(a))throw Error("React.Children.only expected to receive a single React element child.");return a}};react_production_min.Component=E;react_production_min.Fragment=p;
81
+ react_production_min.Profiler=r;react_production_min.PureComponent=G;react_production_min.StrictMode=q;react_production_min.Suspense=w;react_production_min.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=W;
82
+ react_production_min.cloneElement=function(a,b,e){if(null===a||void 0===a)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+a+".");var d=C({},a.props),c=a.key,k=a.ref,h=a._owner;if(null!=b){void 0!==b.ref&&(k=b.ref,h=K.current);void 0!==b.key&&(c=""+b.key);if(a.type&&a.type.defaultProps)var g=a.type.defaultProps;for(f in b)J.call(b,f)&&!L.hasOwnProperty(f)&&(d[f]=void 0===b[f]&&void 0!==g?g[f]:b[f]);}var f=arguments.length-2;if(1===f)d.children=e;else if(1<f){g=Array(f);
83
+ for(var m=0;m<f;m++)g[m]=arguments[m+2];d.children=g;}return {$$typeof:l,type:a.type,key:c,ref:k,props:d,_owner:h}};react_production_min.createContext=function(a){a={$$typeof:u,_currentValue:a,_currentValue2:a,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null};a.Provider={$$typeof:t,_context:a};return a.Consumer=a};react_production_min.createElement=M;react_production_min.createFactory=function(a){var b=M.bind(null,a);b.type=a;return b};react_production_min.createRef=function(){return {current:null}};
84
+ react_production_min.forwardRef=function(a){return {$$typeof:v,render:a}};react_production_min.isValidElement=O;react_production_min.lazy=function(a){return {$$typeof:y,_payload:{_status:-1,_result:a},_init:T}};react_production_min.memo=function(a,b){return {$$typeof:x,type:a,compare:void 0===b?null:b}};react_production_min.startTransition=function(a){var b=V.transition;V.transition={};try{a();}finally{V.transition=b;}};react_production_min.unstable_act=function(){throw Error("act(...) is not supported in production builds of React.");};
85
+ react_production_min.useCallback=function(a,b){return U.current.useCallback(a,b)};react_production_min.useContext=function(a){return U.current.useContext(a)};react_production_min.useDebugValue=function(){};react_production_min.useDeferredValue=function(a){return U.current.useDeferredValue(a)};react_production_min.useEffect=function(a,b){return U.current.useEffect(a,b)};react_production_min.useId=function(){return U.current.useId()};react_production_min.useImperativeHandle=function(a,b,e){return U.current.useImperativeHandle(a,b,e)};
86
+ react_production_min.useInsertionEffect=function(a,b){return U.current.useInsertionEffect(a,b)};react_production_min.useLayoutEffect=function(a,b){return U.current.useLayoutEffect(a,b)};react_production_min.useMemo=function(a,b){return U.current.useMemo(a,b)};react_production_min.useReducer=function(a,b,e){return U.current.useReducer(a,b,e)};react_production_min.useRef=function(a){return U.current.useRef(a)};react_production_min.useState=function(a){return U.current.useState(a)};react_production_min.useSyncExternalStore=function(a,b,e){return U.current.useSyncExternalStore(a,b,e)};
87
+ react_production_min.useTransition=function(){return U.current.useTransition()};react_production_min.version="18.2.0";
88
+ return react_production_min;
89
+ }
90
+
91
+ var react_development = {exports: {}};
92
+
93
+ /**
94
+ * @license React
95
+ * react.development.js
96
+ *
97
+ * Copyright (c) Facebook, Inc. and its affiliates.
98
+ *
99
+ * This source code is licensed under the MIT license found in the
100
+ * LICENSE file in the root directory of this source tree.
101
+ */
102
+ react_development.exports;
103
+
104
+ var hasRequiredReact_development;
105
+
106
+ function requireReact_development () {
107
+ if (hasRequiredReact_development) return react_development.exports;
108
+ hasRequiredReact_development = 1;
109
+ (function (module, exports) {
110
+
111
+ if (process.env.NODE_ENV !== "production") {
112
+ (function() {
113
+
114
+ /* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */
115
+ if (
116
+ typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined' &&
117
+ typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart ===
118
+ 'function'
119
+ ) {
120
+ __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error());
121
+ }
122
+ var ReactVersion = '18.2.0';
123
+
124
+ // ATTENTION
125
+ // When adding new symbols to this file,
126
+ // Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols'
127
+ // The Symbol used to tag the ReactElement-like types.
128
+ var REACT_ELEMENT_TYPE = Symbol.for('react.element');
129
+ var REACT_PORTAL_TYPE = Symbol.for('react.portal');
130
+ var REACT_FRAGMENT_TYPE = Symbol.for('react.fragment');
131
+ var REACT_STRICT_MODE_TYPE = Symbol.for('react.strict_mode');
132
+ var REACT_PROFILER_TYPE = Symbol.for('react.profiler');
133
+ var REACT_PROVIDER_TYPE = Symbol.for('react.provider');
134
+ var REACT_CONTEXT_TYPE = Symbol.for('react.context');
135
+ var REACT_FORWARD_REF_TYPE = Symbol.for('react.forward_ref');
136
+ var REACT_SUSPENSE_TYPE = Symbol.for('react.suspense');
137
+ var REACT_SUSPENSE_LIST_TYPE = Symbol.for('react.suspense_list');
138
+ var REACT_MEMO_TYPE = Symbol.for('react.memo');
139
+ var REACT_LAZY_TYPE = Symbol.for('react.lazy');
140
+ var REACT_OFFSCREEN_TYPE = Symbol.for('react.offscreen');
141
+ var MAYBE_ITERATOR_SYMBOL = Symbol.iterator;
142
+ var FAUX_ITERATOR_SYMBOL = '@@iterator';
143
+ function getIteratorFn(maybeIterable) {
144
+ if (maybeIterable === null || typeof maybeIterable !== 'object') {
145
+ return null;
146
+ }
147
+
148
+ var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL];
149
+
150
+ if (typeof maybeIterator === 'function') {
151
+ return maybeIterator;
152
+ }
153
+
154
+ return null;
155
+ }
156
+
157
+ /**
158
+ * Keeps track of the current dispatcher.
159
+ */
160
+ var ReactCurrentDispatcher = {
161
+ /**
162
+ * @internal
163
+ * @type {ReactComponent}
164
+ */
165
+ current: null
166
+ };
167
+
168
+ /**
169
+ * Keeps track of the current batch's configuration such as how long an update
170
+ * should suspend for if it needs to.
171
+ */
172
+ var ReactCurrentBatchConfig = {
173
+ transition: null
174
+ };
175
+
176
+ var ReactCurrentActQueue = {
177
+ current: null,
178
+ // Used to reproduce behavior of `batchedUpdates` in legacy mode.
179
+ isBatchingLegacy: false,
180
+ didScheduleLegacyUpdate: false
181
+ };
182
+
183
+ /**
184
+ * Keeps track of the current owner.
185
+ *
186
+ * The current owner is the component who should own any components that are
187
+ * currently being constructed.
188
+ */
189
+ var ReactCurrentOwner = {
190
+ /**
191
+ * @internal
192
+ * @type {ReactComponent}
193
+ */
194
+ current: null
195
+ };
196
+
197
+ var ReactDebugCurrentFrame = {};
198
+ var currentExtraStackFrame = null;
199
+ function setExtraStackFrame(stack) {
200
+ {
201
+ currentExtraStackFrame = stack;
202
+ }
203
+ }
204
+
205
+ {
206
+ ReactDebugCurrentFrame.setExtraStackFrame = function (stack) {
207
+ {
208
+ currentExtraStackFrame = stack;
209
+ }
210
+ }; // Stack implementation injected by the current renderer.
211
+
212
+
213
+ ReactDebugCurrentFrame.getCurrentStack = null;
214
+
215
+ ReactDebugCurrentFrame.getStackAddendum = function () {
216
+ var stack = ''; // Add an extra top frame while an element is being validated
217
+
218
+ if (currentExtraStackFrame) {
219
+ stack += currentExtraStackFrame;
220
+ } // Delegate to the injected renderer-specific implementation
221
+
222
+
223
+ var impl = ReactDebugCurrentFrame.getCurrentStack;
224
+
225
+ if (impl) {
226
+ stack += impl() || '';
227
+ }
228
+
229
+ return stack;
230
+ };
231
+ }
232
+
233
+ // -----------------------------------------------------------------------------
234
+
235
+ var enableScopeAPI = false; // Experimental Create Event Handle API.
236
+ var enableCacheElement = false;
237
+ var enableTransitionTracing = false; // No known bugs, but needs performance testing
238
+
239
+ var enableLegacyHidden = false; // Enables unstable_avoidThisFallback feature in Fiber
240
+ // stuff. Intended to enable React core members to more easily debug scheduling
241
+ // issues in DEV builds.
242
+
243
+ var enableDebugTracing = false; // Track which Fiber(s) schedule render work.
244
+
245
+ var ReactSharedInternals = {
246
+ ReactCurrentDispatcher: ReactCurrentDispatcher,
247
+ ReactCurrentBatchConfig: ReactCurrentBatchConfig,
248
+ ReactCurrentOwner: ReactCurrentOwner
249
+ };
250
+
251
+ {
252
+ ReactSharedInternals.ReactDebugCurrentFrame = ReactDebugCurrentFrame;
253
+ ReactSharedInternals.ReactCurrentActQueue = ReactCurrentActQueue;
254
+ }
255
+
256
+ // by calls to these methods by a Babel plugin.
257
+ //
258
+ // In PROD (or in packages without access to React internals),
259
+ // they are left as they are instead.
260
+
261
+ function warn(format) {
262
+ {
263
+ {
264
+ for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
265
+ args[_key - 1] = arguments[_key];
266
+ }
267
+
268
+ printWarning('warn', format, args);
269
+ }
270
+ }
271
+ }
272
+ function error(format) {
273
+ {
274
+ {
275
+ for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
276
+ args[_key2 - 1] = arguments[_key2];
277
+ }
278
+
279
+ printWarning('error', format, args);
280
+ }
281
+ }
282
+ }
283
+
284
+ function printWarning(level, format, args) {
285
+ // When changing this logic, you might want to also
286
+ // update consoleWithStackDev.www.js as well.
287
+ {
288
+ var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
289
+ var stack = ReactDebugCurrentFrame.getStackAddendum();
290
+
291
+ if (stack !== '') {
292
+ format += '%s';
293
+ args = args.concat([stack]);
294
+ } // eslint-disable-next-line react-internal/safe-string-coercion
295
+
296
+
297
+ var argsWithFormat = args.map(function (item) {
298
+ return String(item);
299
+ }); // Careful: RN currently depends on this prefix
300
+
301
+ argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it
302
+ // breaks IE9: https://github.com/facebook/react/issues/13610
303
+ // eslint-disable-next-line react-internal/no-production-logging
304
+
305
+ Function.prototype.apply.call(console[level], console, argsWithFormat);
306
+ }
307
+ }
308
+
309
+ var didWarnStateUpdateForUnmountedComponent = {};
310
+
311
+ function warnNoop(publicInstance, callerName) {
312
+ {
313
+ var _constructor = publicInstance.constructor;
314
+ var componentName = _constructor && (_constructor.displayName || _constructor.name) || 'ReactClass';
315
+ var warningKey = componentName + "." + callerName;
316
+
317
+ if (didWarnStateUpdateForUnmountedComponent[warningKey]) {
318
+ return;
319
+ }
320
+
321
+ error("Can't call %s on a component that is not yet mounted. " + 'This is a no-op, but it might indicate a bug in your application. ' + 'Instead, assign to `this.state` directly or define a `state = {};` ' + 'class property with the desired state in the %s component.', callerName, componentName);
322
+
323
+ didWarnStateUpdateForUnmountedComponent[warningKey] = true;
324
+ }
325
+ }
326
+ /**
327
+ * This is the abstract API for an update queue.
328
+ */
329
+
330
+
331
+ var ReactNoopUpdateQueue = {
332
+ /**
333
+ * Checks whether or not this composite component is mounted.
334
+ * @param {ReactClass} publicInstance The instance we want to test.
335
+ * @return {boolean} True if mounted, false otherwise.
336
+ * @protected
337
+ * @final
338
+ */
339
+ isMounted: function (publicInstance) {
340
+ return false;
341
+ },
342
+
343
+ /**
344
+ * Forces an update. This should only be invoked when it is known with
345
+ * certainty that we are **not** in a DOM transaction.
346
+ *
347
+ * You may want to call this when you know that some deeper aspect of the
348
+ * component's state has changed but `setState` was not called.
349
+ *
350
+ * This will not invoke `shouldComponentUpdate`, but it will invoke
351
+ * `componentWillUpdate` and `componentDidUpdate`.
352
+ *
353
+ * @param {ReactClass} publicInstance The instance that should rerender.
354
+ * @param {?function} callback Called after component is updated.
355
+ * @param {?string} callerName name of the calling function in the public API.
356
+ * @internal
357
+ */
358
+ enqueueForceUpdate: function (publicInstance, callback, callerName) {
359
+ warnNoop(publicInstance, 'forceUpdate');
360
+ },
361
+
362
+ /**
363
+ * Replaces all of the state. Always use this or `setState` to mutate state.
364
+ * You should treat `this.state` as immutable.
365
+ *
366
+ * There is no guarantee that `this.state` will be immediately updated, so
367
+ * accessing `this.state` after calling this method may return the old value.
368
+ *
369
+ * @param {ReactClass} publicInstance The instance that should rerender.
370
+ * @param {object} completeState Next state.
371
+ * @param {?function} callback Called after component is updated.
372
+ * @param {?string} callerName name of the calling function in the public API.
373
+ * @internal
374
+ */
375
+ enqueueReplaceState: function (publicInstance, completeState, callback, callerName) {
376
+ warnNoop(publicInstance, 'replaceState');
377
+ },
378
+
379
+ /**
380
+ * Sets a subset of the state. This only exists because _pendingState is
381
+ * internal. This provides a merging strategy that is not available to deep
382
+ * properties which is confusing. TODO: Expose pendingState or don't use it
383
+ * during the merge.
384
+ *
385
+ * @param {ReactClass} publicInstance The instance that should rerender.
386
+ * @param {object} partialState Next partial state to be merged with state.
387
+ * @param {?function} callback Called after component is updated.
388
+ * @param {?string} Name of the calling function in the public API.
389
+ * @internal
390
+ */
391
+ enqueueSetState: function (publicInstance, partialState, callback, callerName) {
392
+ warnNoop(publicInstance, 'setState');
393
+ }
394
+ };
395
+
396
+ var assign = Object.assign;
397
+
398
+ var emptyObject = {};
399
+
400
+ {
401
+ Object.freeze(emptyObject);
402
+ }
403
+ /**
404
+ * Base class helpers for the updating state of a component.
405
+ */
406
+
407
+
408
+ function Component(props, context, updater) {
409
+ this.props = props;
410
+ this.context = context; // If a component has string refs, we will assign a different object later.
411
+
412
+ this.refs = emptyObject; // We initialize the default updater but the real one gets injected by the
413
+ // renderer.
414
+
415
+ this.updater = updater || ReactNoopUpdateQueue;
416
+ }
417
+
418
+ Component.prototype.isReactComponent = {};
419
+ /**
420
+ * Sets a subset of the state. Always use this to mutate
421
+ * state. You should treat `this.state` as immutable.
422
+ *
423
+ * There is no guarantee that `this.state` will be immediately updated, so
424
+ * accessing `this.state` after calling this method may return the old value.
425
+ *
426
+ * There is no guarantee that calls to `setState` will run synchronously,
427
+ * as they may eventually be batched together. You can provide an optional
428
+ * callback that will be executed when the call to setState is actually
429
+ * completed.
430
+ *
431
+ * When a function is provided to setState, it will be called at some point in
432
+ * the future (not synchronously). It will be called with the up to date
433
+ * component arguments (state, props, context). These values can be different
434
+ * from this.* because your function may be called after receiveProps but before
435
+ * shouldComponentUpdate, and this new state, props, and context will not yet be
436
+ * assigned to this.
437
+ *
438
+ * @param {object|function} partialState Next partial state or function to
439
+ * produce next partial state to be merged with current state.
440
+ * @param {?function} callback Called after state is updated.
441
+ * @final
442
+ * @protected
443
+ */
444
+
445
+ Component.prototype.setState = function (partialState, callback) {
446
+ if (typeof partialState !== 'object' && typeof partialState !== 'function' && partialState != null) {
447
+ throw new Error('setState(...): takes an object of state variables to update or a ' + 'function which returns an object of state variables.');
448
+ }
449
+
450
+ this.updater.enqueueSetState(this, partialState, callback, 'setState');
451
+ };
452
+ /**
453
+ * Forces an update. This should only be invoked when it is known with
454
+ * certainty that we are **not** in a DOM transaction.
455
+ *
456
+ * You may want to call this when you know that some deeper aspect of the
457
+ * component's state has changed but `setState` was not called.
458
+ *
459
+ * This will not invoke `shouldComponentUpdate`, but it will invoke
460
+ * `componentWillUpdate` and `componentDidUpdate`.
461
+ *
462
+ * @param {?function} callback Called after update is complete.
463
+ * @final
464
+ * @protected
465
+ */
466
+
467
+
468
+ Component.prototype.forceUpdate = function (callback) {
469
+ this.updater.enqueueForceUpdate(this, callback, 'forceUpdate');
470
+ };
471
+ /**
472
+ * Deprecated APIs. These APIs used to exist on classic React classes but since
473
+ * we would like to deprecate them, we're not going to move them over to this
474
+ * modern base class. Instead, we define a getter that warns if it's accessed.
475
+ */
476
+
477
+
478
+ {
479
+ var deprecatedAPIs = {
480
+ isMounted: ['isMounted', 'Instead, make sure to clean up subscriptions and pending requests in ' + 'componentWillUnmount to prevent memory leaks.'],
481
+ replaceState: ['replaceState', 'Refactor your code to use setState instead (see ' + 'https://github.com/facebook/react/issues/3236).']
482
+ };
483
+
484
+ var defineDeprecationWarning = function (methodName, info) {
485
+ Object.defineProperty(Component.prototype, methodName, {
486
+ get: function () {
487
+ warn('%s(...) is deprecated in plain JavaScript React classes. %s', info[0], info[1]);
488
+
489
+ return undefined;
490
+ }
491
+ });
492
+ };
493
+
494
+ for (var fnName in deprecatedAPIs) {
495
+ if (deprecatedAPIs.hasOwnProperty(fnName)) {
496
+ defineDeprecationWarning(fnName, deprecatedAPIs[fnName]);
497
+ }
498
+ }
499
+ }
500
+
501
+ function ComponentDummy() {}
502
+
503
+ ComponentDummy.prototype = Component.prototype;
504
+ /**
505
+ * Convenience component with default shallow equality check for sCU.
506
+ */
507
+
508
+ function PureComponent(props, context, updater) {
509
+ this.props = props;
510
+ this.context = context; // If a component has string refs, we will assign a different object later.
511
+
512
+ this.refs = emptyObject;
513
+ this.updater = updater || ReactNoopUpdateQueue;
514
+ }
515
+
516
+ var pureComponentPrototype = PureComponent.prototype = new ComponentDummy();
517
+ pureComponentPrototype.constructor = PureComponent; // Avoid an extra prototype jump for these methods.
518
+
519
+ assign(pureComponentPrototype, Component.prototype);
520
+ pureComponentPrototype.isPureReactComponent = true;
521
+
522
+ // an immutable object with a single mutable value
523
+ function createRef() {
524
+ var refObject = {
525
+ current: null
526
+ };
527
+
528
+ {
529
+ Object.seal(refObject);
530
+ }
531
+
532
+ return refObject;
533
+ }
534
+
535
+ var isArrayImpl = Array.isArray; // eslint-disable-next-line no-redeclare
536
+
537
+ function isArray(a) {
538
+ return isArrayImpl(a);
539
+ }
540
+
541
+ /*
542
+ * The `'' + value` pattern (used in in perf-sensitive code) throws for Symbol
543
+ * and Temporal.* types. See https://github.com/facebook/react/pull/22064.
544
+ *
545
+ * The functions in this module will throw an easier-to-understand,
546
+ * easier-to-debug exception with a clear errors message message explaining the
547
+ * problem. (Instead of a confusing exception thrown inside the implementation
548
+ * of the `value` object).
549
+ */
550
+ // $FlowFixMe only called in DEV, so void return is not possible.
551
+ function typeName(value) {
552
+ {
553
+ // toStringTag is needed for namespaced types like Temporal.Instant
554
+ var hasToStringTag = typeof Symbol === 'function' && Symbol.toStringTag;
555
+ var type = hasToStringTag && value[Symbol.toStringTag] || value.constructor.name || 'Object';
556
+ return type;
557
+ }
558
+ } // $FlowFixMe only called in DEV, so void return is not possible.
559
+
560
+
561
+ function willCoercionThrow(value) {
562
+ {
563
+ try {
564
+ testStringCoercion(value);
565
+ return false;
566
+ } catch (e) {
567
+ return true;
568
+ }
569
+ }
570
+ }
571
+
572
+ function testStringCoercion(value) {
573
+ // If you ended up here by following an exception call stack, here's what's
574
+ // happened: you supplied an object or symbol value to React (as a prop, key,
575
+ // DOM attribute, CSS property, string ref, etc.) and when React tried to
576
+ // coerce it to a string using `'' + value`, an exception was thrown.
577
+ //
578
+ // The most common types that will cause this exception are `Symbol` instances
579
+ // and Temporal objects like `Temporal.Instant`. But any object that has a
580
+ // `valueOf` or `[Symbol.toPrimitive]` method that throws will also cause this
581
+ // exception. (Library authors do this to prevent users from using built-in
582
+ // numeric operators like `+` or comparison operators like `>=` because custom
583
+ // methods are needed to perform accurate arithmetic or comparison.)
584
+ //
585
+ // To fix the problem, coerce this object or symbol value to a string before
586
+ // passing it to React. The most reliable way is usually `String(value)`.
587
+ //
588
+ // To find which value is throwing, check the browser or debugger console.
589
+ // Before this exception was thrown, there should be `console.error` output
590
+ // that shows the type (Symbol, Temporal.PlainDate, etc.) that caused the
591
+ // problem and how that type was used: key, atrribute, input value prop, etc.
592
+ // In most cases, this console output also shows the component and its
593
+ // ancestor components where the exception happened.
594
+ //
595
+ // eslint-disable-next-line react-internal/safe-string-coercion
596
+ return '' + value;
597
+ }
598
+ function checkKeyStringCoercion(value) {
599
+ {
600
+ if (willCoercionThrow(value)) {
601
+ error('The provided key is an unsupported type %s.' + ' This value must be coerced to a string before before using it here.', typeName(value));
602
+
603
+ return testStringCoercion(value); // throw (to help callers find troubleshooting comments)
604
+ }
605
+ }
606
+ }
607
+
608
+ function getWrappedName(outerType, innerType, wrapperName) {
609
+ var displayName = outerType.displayName;
610
+
611
+ if (displayName) {
612
+ return displayName;
613
+ }
614
+
615
+ var functionName = innerType.displayName || innerType.name || '';
616
+ return functionName !== '' ? wrapperName + "(" + functionName + ")" : wrapperName;
617
+ } // Keep in sync with react-reconciler/getComponentNameFromFiber
618
+
619
+
620
+ function getContextName(type) {
621
+ return type.displayName || 'Context';
622
+ } // Note that the reconciler package should generally prefer to use getComponentNameFromFiber() instead.
623
+
624
+
625
+ function getComponentNameFromType(type) {
626
+ if (type == null) {
627
+ // Host root, text node or just invalid type.
628
+ return null;
629
+ }
630
+
631
+ {
632
+ if (typeof type.tag === 'number') {
633
+ error('Received an unexpected object in getComponentNameFromType(). ' + 'This is likely a bug in React. Please file an issue.');
634
+ }
635
+ }
636
+
637
+ if (typeof type === 'function') {
638
+ return type.displayName || type.name || null;
639
+ }
640
+
641
+ if (typeof type === 'string') {
642
+ return type;
643
+ }
644
+
645
+ switch (type) {
646
+ case REACT_FRAGMENT_TYPE:
647
+ return 'Fragment';
648
+
649
+ case REACT_PORTAL_TYPE:
650
+ return 'Portal';
651
+
652
+ case REACT_PROFILER_TYPE:
653
+ return 'Profiler';
654
+
655
+ case REACT_STRICT_MODE_TYPE:
656
+ return 'StrictMode';
657
+
658
+ case REACT_SUSPENSE_TYPE:
659
+ return 'Suspense';
660
+
661
+ case REACT_SUSPENSE_LIST_TYPE:
662
+ return 'SuspenseList';
663
+
664
+ }
665
+
666
+ if (typeof type === 'object') {
667
+ switch (type.$$typeof) {
668
+ case REACT_CONTEXT_TYPE:
669
+ var context = type;
670
+ return getContextName(context) + '.Consumer';
671
+
672
+ case REACT_PROVIDER_TYPE:
673
+ var provider = type;
674
+ return getContextName(provider._context) + '.Provider';
675
+
676
+ case REACT_FORWARD_REF_TYPE:
677
+ return getWrappedName(type, type.render, 'ForwardRef');
678
+
679
+ case REACT_MEMO_TYPE:
680
+ var outerName = type.displayName || null;
681
+
682
+ if (outerName !== null) {
683
+ return outerName;
684
+ }
685
+
686
+ return getComponentNameFromType(type.type) || 'Memo';
687
+
688
+ case REACT_LAZY_TYPE:
689
+ {
690
+ var lazyComponent = type;
691
+ var payload = lazyComponent._payload;
692
+ var init = lazyComponent._init;
693
+
694
+ try {
695
+ return getComponentNameFromType(init(payload));
696
+ } catch (x) {
697
+ return null;
698
+ }
699
+ }
700
+
701
+ // eslint-disable-next-line no-fallthrough
702
+ }
703
+ }
704
+
705
+ return null;
706
+ }
707
+
708
+ var hasOwnProperty = Object.prototype.hasOwnProperty;
709
+
710
+ var RESERVED_PROPS = {
711
+ key: true,
712
+ ref: true,
713
+ __self: true,
714
+ __source: true
715
+ };
716
+ var specialPropKeyWarningShown, specialPropRefWarningShown, didWarnAboutStringRefs;
717
+
718
+ {
719
+ didWarnAboutStringRefs = {};
720
+ }
721
+
722
+ function hasValidRef(config) {
723
+ {
724
+ if (hasOwnProperty.call(config, 'ref')) {
725
+ var getter = Object.getOwnPropertyDescriptor(config, 'ref').get;
726
+
727
+ if (getter && getter.isReactWarning) {
728
+ return false;
729
+ }
730
+ }
731
+ }
732
+
733
+ return config.ref !== undefined;
734
+ }
735
+
736
+ function hasValidKey(config) {
737
+ {
738
+ if (hasOwnProperty.call(config, 'key')) {
739
+ var getter = Object.getOwnPropertyDescriptor(config, 'key').get;
740
+
741
+ if (getter && getter.isReactWarning) {
742
+ return false;
743
+ }
744
+ }
745
+ }
746
+
747
+ return config.key !== undefined;
748
+ }
749
+
750
+ function defineKeyPropWarningGetter(props, displayName) {
751
+ var warnAboutAccessingKey = function () {
752
+ {
753
+ if (!specialPropKeyWarningShown) {
754
+ specialPropKeyWarningShown = true;
755
+
756
+ error('%s: `key` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://reactjs.org/link/special-props)', displayName);
757
+ }
758
+ }
759
+ };
760
+
761
+ warnAboutAccessingKey.isReactWarning = true;
762
+ Object.defineProperty(props, 'key', {
763
+ get: warnAboutAccessingKey,
764
+ configurable: true
765
+ });
766
+ }
767
+
768
+ function defineRefPropWarningGetter(props, displayName) {
769
+ var warnAboutAccessingRef = function () {
770
+ {
771
+ if (!specialPropRefWarningShown) {
772
+ specialPropRefWarningShown = true;
773
+
774
+ error('%s: `ref` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://reactjs.org/link/special-props)', displayName);
775
+ }
776
+ }
777
+ };
778
+
779
+ warnAboutAccessingRef.isReactWarning = true;
780
+ Object.defineProperty(props, 'ref', {
781
+ get: warnAboutAccessingRef,
782
+ configurable: true
783
+ });
784
+ }
785
+
786
+ function warnIfStringRefCannotBeAutoConverted(config) {
787
+ {
788
+ if (typeof config.ref === 'string' && ReactCurrentOwner.current && config.__self && ReactCurrentOwner.current.stateNode !== config.__self) {
789
+ var componentName = getComponentNameFromType(ReactCurrentOwner.current.type);
790
+
791
+ if (!didWarnAboutStringRefs[componentName]) {
792
+ error('Component "%s" contains the string ref "%s". ' + 'Support for string refs will be removed in a future major release. ' + 'This case cannot be automatically converted to an arrow function. ' + 'We ask you to manually fix this case by using useRef() or createRef() instead. ' + 'Learn more about using refs safely here: ' + 'https://reactjs.org/link/strict-mode-string-ref', componentName, config.ref);
793
+
794
+ didWarnAboutStringRefs[componentName] = true;
795
+ }
796
+ }
797
+ }
798
+ }
799
+ /**
800
+ * Factory method to create a new React element. This no longer adheres to
801
+ * the class pattern, so do not use new to call it. Also, instanceof check
802
+ * will not work. Instead test $$typeof field against Symbol.for('react.element') to check
803
+ * if something is a React Element.
804
+ *
805
+ * @param {*} type
806
+ * @param {*} props
807
+ * @param {*} key
808
+ * @param {string|object} ref
809
+ * @param {*} owner
810
+ * @param {*} self A *temporary* helper to detect places where `this` is
811
+ * different from the `owner` when React.createElement is called, so that we
812
+ * can warn. We want to get rid of owner and replace string `ref`s with arrow
813
+ * functions, and as long as `this` and owner are the same, there will be no
814
+ * change in behavior.
815
+ * @param {*} source An annotation object (added by a transpiler or otherwise)
816
+ * indicating filename, line number, and/or other information.
817
+ * @internal
818
+ */
819
+
820
+
821
+ var ReactElement = function (type, key, ref, self, source, owner, props) {
822
+ var element = {
823
+ // This tag allows us to uniquely identify this as a React Element
824
+ $$typeof: REACT_ELEMENT_TYPE,
825
+ // Built-in properties that belong on the element
826
+ type: type,
827
+ key: key,
828
+ ref: ref,
829
+ props: props,
830
+ // Record the component responsible for creating this element.
831
+ _owner: owner
832
+ };
833
+
834
+ {
835
+ // The validation flag is currently mutative. We put it on
836
+ // an external backing store so that we can freeze the whole object.
837
+ // This can be replaced with a WeakMap once they are implemented in
838
+ // commonly used development environments.
839
+ element._store = {}; // To make comparing ReactElements easier for testing purposes, we make
840
+ // the validation flag non-enumerable (where possible, which should
841
+ // include every environment we run tests in), so the test framework
842
+ // ignores it.
843
+
844
+ Object.defineProperty(element._store, 'validated', {
845
+ configurable: false,
846
+ enumerable: false,
847
+ writable: true,
848
+ value: false
849
+ }); // self and source are DEV only properties.
850
+
851
+ Object.defineProperty(element, '_self', {
852
+ configurable: false,
853
+ enumerable: false,
854
+ writable: false,
855
+ value: self
856
+ }); // Two elements created in two different places should be considered
857
+ // equal for testing purposes and therefore we hide it from enumeration.
858
+
859
+ Object.defineProperty(element, '_source', {
860
+ configurable: false,
861
+ enumerable: false,
862
+ writable: false,
863
+ value: source
864
+ });
865
+
866
+ if (Object.freeze) {
867
+ Object.freeze(element.props);
868
+ Object.freeze(element);
869
+ }
870
+ }
871
+
872
+ return element;
873
+ };
874
+ /**
875
+ * Create and return a new ReactElement of the given type.
876
+ * See https://reactjs.org/docs/react-api.html#createelement
877
+ */
878
+
879
+ function createElement(type, config, children) {
880
+ var propName; // Reserved names are extracted
881
+
882
+ var props = {};
883
+ var key = null;
884
+ var ref = null;
885
+ var self = null;
886
+ var source = null;
887
+
888
+ if (config != null) {
889
+ if (hasValidRef(config)) {
890
+ ref = config.ref;
891
+
892
+ {
893
+ warnIfStringRefCannotBeAutoConverted(config);
894
+ }
895
+ }
896
+
897
+ if (hasValidKey(config)) {
898
+ {
899
+ checkKeyStringCoercion(config.key);
900
+ }
901
+
902
+ key = '' + config.key;
903
+ }
904
+
905
+ self = config.__self === undefined ? null : config.__self;
906
+ source = config.__source === undefined ? null : config.__source; // Remaining properties are added to a new props object
907
+
908
+ for (propName in config) {
909
+ if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
910
+ props[propName] = config[propName];
911
+ }
912
+ }
913
+ } // Children can be more than one argument, and those are transferred onto
914
+ // the newly allocated props object.
915
+
916
+
917
+ var childrenLength = arguments.length - 2;
918
+
919
+ if (childrenLength === 1) {
920
+ props.children = children;
921
+ } else if (childrenLength > 1) {
922
+ var childArray = Array(childrenLength);
923
+
924
+ for (var i = 0; i < childrenLength; i++) {
925
+ childArray[i] = arguments[i + 2];
926
+ }
927
+
928
+ {
929
+ if (Object.freeze) {
930
+ Object.freeze(childArray);
931
+ }
932
+ }
933
+
934
+ props.children = childArray;
935
+ } // Resolve default props
936
+
937
+
938
+ if (type && type.defaultProps) {
939
+ var defaultProps = type.defaultProps;
940
+
941
+ for (propName in defaultProps) {
942
+ if (props[propName] === undefined) {
943
+ props[propName] = defaultProps[propName];
944
+ }
945
+ }
946
+ }
947
+
948
+ {
949
+ if (key || ref) {
950
+ var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;
951
+
952
+ if (key) {
953
+ defineKeyPropWarningGetter(props, displayName);
954
+ }
955
+
956
+ if (ref) {
957
+ defineRefPropWarningGetter(props, displayName);
958
+ }
959
+ }
960
+ }
961
+
962
+ return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);
963
+ }
964
+ function cloneAndReplaceKey(oldElement, newKey) {
965
+ var newElement = ReactElement(oldElement.type, newKey, oldElement.ref, oldElement._self, oldElement._source, oldElement._owner, oldElement.props);
966
+ return newElement;
967
+ }
968
+ /**
969
+ * Clone and return a new ReactElement using element as the starting point.
970
+ * See https://reactjs.org/docs/react-api.html#cloneelement
971
+ */
972
+
973
+ function cloneElement(element, config, children) {
974
+ if (element === null || element === undefined) {
975
+ throw new Error("React.cloneElement(...): The argument must be a React element, but you passed " + element + ".");
976
+ }
977
+
978
+ var propName; // Original props are copied
979
+
980
+ var props = assign({}, element.props); // Reserved names are extracted
981
+
982
+ var key = element.key;
983
+ var ref = element.ref; // Self is preserved since the owner is preserved.
984
+
985
+ var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a
986
+ // transpiler, and the original source is probably a better indicator of the
987
+ // true owner.
988
+
989
+ var source = element._source; // Owner will be preserved, unless ref is overridden
990
+
991
+ var owner = element._owner;
992
+
993
+ if (config != null) {
994
+ if (hasValidRef(config)) {
995
+ // Silently steal the ref from the parent.
996
+ ref = config.ref;
997
+ owner = ReactCurrentOwner.current;
998
+ }
999
+
1000
+ if (hasValidKey(config)) {
1001
+ {
1002
+ checkKeyStringCoercion(config.key);
1003
+ }
1004
+
1005
+ key = '' + config.key;
1006
+ } // Remaining properties override existing props
1007
+
1008
+
1009
+ var defaultProps;
1010
+
1011
+ if (element.type && element.type.defaultProps) {
1012
+ defaultProps = element.type.defaultProps;
1013
+ }
1014
+
1015
+ for (propName in config) {
1016
+ if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
1017
+ if (config[propName] === undefined && defaultProps !== undefined) {
1018
+ // Resolve default props
1019
+ props[propName] = defaultProps[propName];
1020
+ } else {
1021
+ props[propName] = config[propName];
1022
+ }
1023
+ }
1024
+ }
1025
+ } // Children can be more than one argument, and those are transferred onto
1026
+ // the newly allocated props object.
1027
+
1028
+
1029
+ var childrenLength = arguments.length - 2;
1030
+
1031
+ if (childrenLength === 1) {
1032
+ props.children = children;
1033
+ } else if (childrenLength > 1) {
1034
+ var childArray = Array(childrenLength);
1035
+
1036
+ for (var i = 0; i < childrenLength; i++) {
1037
+ childArray[i] = arguments[i + 2];
1038
+ }
1039
+
1040
+ props.children = childArray;
1041
+ }
1042
+
1043
+ return ReactElement(element.type, key, ref, self, source, owner, props);
1044
+ }
1045
+ /**
1046
+ * Verifies the object is a ReactElement.
1047
+ * See https://reactjs.org/docs/react-api.html#isvalidelement
1048
+ * @param {?object} object
1049
+ * @return {boolean} True if `object` is a ReactElement.
1050
+ * @final
1051
+ */
1052
+
1053
+ function isValidElement(object) {
1054
+ return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
1055
+ }
1056
+
1057
+ var SEPARATOR = '.';
1058
+ var SUBSEPARATOR = ':';
1059
+ /**
1060
+ * Escape and wrap key so it is safe to use as a reactid
1061
+ *
1062
+ * @param {string} key to be escaped.
1063
+ * @return {string} the escaped key.
1064
+ */
1065
+
1066
+ function escape(key) {
1067
+ var escapeRegex = /[=:]/g;
1068
+ var escaperLookup = {
1069
+ '=': '=0',
1070
+ ':': '=2'
1071
+ };
1072
+ var escapedString = key.replace(escapeRegex, function (match) {
1073
+ return escaperLookup[match];
1074
+ });
1075
+ return '$' + escapedString;
1076
+ }
1077
+ /**
1078
+ * TODO: Test that a single child and an array with one item have the same key
1079
+ * pattern.
1080
+ */
1081
+
1082
+
1083
+ var didWarnAboutMaps = false;
1084
+ var userProvidedKeyEscapeRegex = /\/+/g;
1085
+
1086
+ function escapeUserProvidedKey(text) {
1087
+ return text.replace(userProvidedKeyEscapeRegex, '$&/');
1088
+ }
1089
+ /**
1090
+ * Generate a key string that identifies a element within a set.
1091
+ *
1092
+ * @param {*} element A element that could contain a manual key.
1093
+ * @param {number} index Index that is used if a manual key is not provided.
1094
+ * @return {string}
1095
+ */
1096
+
1097
+
1098
+ function getElementKey(element, index) {
1099
+ // Do some typechecking here since we call this blindly. We want to ensure
1100
+ // that we don't block potential future ES APIs.
1101
+ if (typeof element === 'object' && element !== null && element.key != null) {
1102
+ // Explicit key
1103
+ {
1104
+ checkKeyStringCoercion(element.key);
1105
+ }
1106
+
1107
+ return escape('' + element.key);
1108
+ } // Implicit key determined by the index in the set
1109
+
1110
+
1111
+ return index.toString(36);
1112
+ }
1113
+
1114
+ function mapIntoArray(children, array, escapedPrefix, nameSoFar, callback) {
1115
+ var type = typeof children;
1116
+
1117
+ if (type === 'undefined' || type === 'boolean') {
1118
+ // All of the above are perceived as null.
1119
+ children = null;
1120
+ }
1121
+
1122
+ var invokeCallback = false;
1123
+
1124
+ if (children === null) {
1125
+ invokeCallback = true;
1126
+ } else {
1127
+ switch (type) {
1128
+ case 'string':
1129
+ case 'number':
1130
+ invokeCallback = true;
1131
+ break;
1132
+
1133
+ case 'object':
1134
+ switch (children.$$typeof) {
1135
+ case REACT_ELEMENT_TYPE:
1136
+ case REACT_PORTAL_TYPE:
1137
+ invokeCallback = true;
1138
+ }
1139
+
1140
+ }
1141
+ }
1142
+
1143
+ if (invokeCallback) {
1144
+ var _child = children;
1145
+ var mappedChild = callback(_child); // If it's the only child, treat the name as if it was wrapped in an array
1146
+ // so that it's consistent if the number of children grows:
1147
+
1148
+ var childKey = nameSoFar === '' ? SEPARATOR + getElementKey(_child, 0) : nameSoFar;
1149
+
1150
+ if (isArray(mappedChild)) {
1151
+ var escapedChildKey = '';
1152
+
1153
+ if (childKey != null) {
1154
+ escapedChildKey = escapeUserProvidedKey(childKey) + '/';
1155
+ }
1156
+
1157
+ mapIntoArray(mappedChild, array, escapedChildKey, '', function (c) {
1158
+ return c;
1159
+ });
1160
+ } else if (mappedChild != null) {
1161
+ if (isValidElement(mappedChild)) {
1162
+ {
1163
+ // The `if` statement here prevents auto-disabling of the safe
1164
+ // coercion ESLint rule, so we must manually disable it below.
1165
+ // $FlowFixMe Flow incorrectly thinks React.Portal doesn't have a key
1166
+ if (mappedChild.key && (!_child || _child.key !== mappedChild.key)) {
1167
+ checkKeyStringCoercion(mappedChild.key);
1168
+ }
1169
+ }
1170
+
1171
+ mappedChild = cloneAndReplaceKey(mappedChild, // Keep both the (mapped) and old keys if they differ, just as
1172
+ // traverseAllChildren used to do for objects as children
1173
+ escapedPrefix + ( // $FlowFixMe Flow incorrectly thinks React.Portal doesn't have a key
1174
+ mappedChild.key && (!_child || _child.key !== mappedChild.key) ? // $FlowFixMe Flow incorrectly thinks existing element's key can be a number
1175
+ // eslint-disable-next-line react-internal/safe-string-coercion
1176
+ escapeUserProvidedKey('' + mappedChild.key) + '/' : '') + childKey);
1177
+ }
1178
+
1179
+ array.push(mappedChild);
1180
+ }
1181
+
1182
+ return 1;
1183
+ }
1184
+
1185
+ var child;
1186
+ var nextName;
1187
+ var subtreeCount = 0; // Count of children found in the current subtree.
1188
+
1189
+ var nextNamePrefix = nameSoFar === '' ? SEPARATOR : nameSoFar + SUBSEPARATOR;
1190
+
1191
+ if (isArray(children)) {
1192
+ for (var i = 0; i < children.length; i++) {
1193
+ child = children[i];
1194
+ nextName = nextNamePrefix + getElementKey(child, i);
1195
+ subtreeCount += mapIntoArray(child, array, escapedPrefix, nextName, callback);
1196
+ }
1197
+ } else {
1198
+ var iteratorFn = getIteratorFn(children);
1199
+
1200
+ if (typeof iteratorFn === 'function') {
1201
+ var iterableChildren = children;
1202
+
1203
+ {
1204
+ // Warn about using Maps as children
1205
+ if (iteratorFn === iterableChildren.entries) {
1206
+ if (!didWarnAboutMaps) {
1207
+ warn('Using Maps as children is not supported. ' + 'Use an array of keyed ReactElements instead.');
1208
+ }
1209
+
1210
+ didWarnAboutMaps = true;
1211
+ }
1212
+ }
1213
+
1214
+ var iterator = iteratorFn.call(iterableChildren);
1215
+ var step;
1216
+ var ii = 0;
1217
+
1218
+ while (!(step = iterator.next()).done) {
1219
+ child = step.value;
1220
+ nextName = nextNamePrefix + getElementKey(child, ii++);
1221
+ subtreeCount += mapIntoArray(child, array, escapedPrefix, nextName, callback);
1222
+ }
1223
+ } else if (type === 'object') {
1224
+ // eslint-disable-next-line react-internal/safe-string-coercion
1225
+ var childrenString = String(children);
1226
+ throw new Error("Objects are not valid as a React child (found: " + (childrenString === '[object Object]' ? 'object with keys {' + Object.keys(children).join(', ') + '}' : childrenString) + "). " + 'If you meant to render a collection of children, use an array ' + 'instead.');
1227
+ }
1228
+ }
1229
+
1230
+ return subtreeCount;
1231
+ }
1232
+
1233
+ /**
1234
+ * Maps children that are typically specified as `props.children`.
1235
+ *
1236
+ * See https://reactjs.org/docs/react-api.html#reactchildrenmap
1237
+ *
1238
+ * The provided mapFunction(child, index) will be called for each
1239
+ * leaf child.
1240
+ *
1241
+ * @param {?*} children Children tree container.
1242
+ * @param {function(*, int)} func The map function.
1243
+ * @param {*} context Context for mapFunction.
1244
+ * @return {object} Object containing the ordered map of results.
1245
+ */
1246
+ function mapChildren(children, func, context) {
1247
+ if (children == null) {
1248
+ return children;
1249
+ }
1250
+
1251
+ var result = [];
1252
+ var count = 0;
1253
+ mapIntoArray(children, result, '', '', function (child) {
1254
+ return func.call(context, child, count++);
1255
+ });
1256
+ return result;
1257
+ }
1258
+ /**
1259
+ * Count the number of children that are typically specified as
1260
+ * `props.children`.
1261
+ *
1262
+ * See https://reactjs.org/docs/react-api.html#reactchildrencount
1263
+ *
1264
+ * @param {?*} children Children tree container.
1265
+ * @return {number} The number of children.
1266
+ */
1267
+
1268
+
1269
+ function countChildren(children) {
1270
+ var n = 0;
1271
+ mapChildren(children, function () {
1272
+ n++; // Don't return anything
1273
+ });
1274
+ return n;
1275
+ }
1276
+
1277
+ /**
1278
+ * Iterates through children that are typically specified as `props.children`.
1279
+ *
1280
+ * See https://reactjs.org/docs/react-api.html#reactchildrenforeach
1281
+ *
1282
+ * The provided forEachFunc(child, index) will be called for each
1283
+ * leaf child.
1284
+ *
1285
+ * @param {?*} children Children tree container.
1286
+ * @param {function(*, int)} forEachFunc
1287
+ * @param {*} forEachContext Context for forEachContext.
1288
+ */
1289
+ function forEachChildren(children, forEachFunc, forEachContext) {
1290
+ mapChildren(children, function () {
1291
+ forEachFunc.apply(this, arguments); // Don't return anything.
1292
+ }, forEachContext);
1293
+ }
1294
+ /**
1295
+ * Flatten a children object (typically specified as `props.children`) and
1296
+ * return an array with appropriately re-keyed children.
1297
+ *
1298
+ * See https://reactjs.org/docs/react-api.html#reactchildrentoarray
1299
+ */
1300
+
1301
+
1302
+ function toArray(children) {
1303
+ return mapChildren(children, function (child) {
1304
+ return child;
1305
+ }) || [];
1306
+ }
1307
+ /**
1308
+ * Returns the first child in a collection of children and verifies that there
1309
+ * is only one child in the collection.
1310
+ *
1311
+ * See https://reactjs.org/docs/react-api.html#reactchildrenonly
1312
+ *
1313
+ * The current implementation of this function assumes that a single child gets
1314
+ * passed without a wrapper, but the purpose of this helper function is to
1315
+ * abstract away the particular structure of children.
1316
+ *
1317
+ * @param {?object} children Child collection structure.
1318
+ * @return {ReactElement} The first and only `ReactElement` contained in the
1319
+ * structure.
1320
+ */
1321
+
1322
+
1323
+ function onlyChild(children) {
1324
+ if (!isValidElement(children)) {
1325
+ throw new Error('React.Children.only expected to receive a single React element child.');
1326
+ }
1327
+
1328
+ return children;
1329
+ }
1330
+
1331
+ function createContext(defaultValue) {
1332
+ // TODO: Second argument used to be an optional `calculateChangedBits`
1333
+ // function. Warn to reserve for future use?
1334
+ var context = {
1335
+ $$typeof: REACT_CONTEXT_TYPE,
1336
+ // As a workaround to support multiple concurrent renderers, we categorize
1337
+ // some renderers as primary and others as secondary. We only expect
1338
+ // there to be two concurrent renderers at most: React Native (primary) and
1339
+ // Fabric (secondary); React DOM (primary) and React ART (secondary).
1340
+ // Secondary renderers store their context values on separate fields.
1341
+ _currentValue: defaultValue,
1342
+ _currentValue2: defaultValue,
1343
+ // Used to track how many concurrent renderers this context currently
1344
+ // supports within in a single renderer. Such as parallel server rendering.
1345
+ _threadCount: 0,
1346
+ // These are circular
1347
+ Provider: null,
1348
+ Consumer: null,
1349
+ // Add these to use same hidden class in VM as ServerContext
1350
+ _defaultValue: null,
1351
+ _globalName: null
1352
+ };
1353
+ context.Provider = {
1354
+ $$typeof: REACT_PROVIDER_TYPE,
1355
+ _context: context
1356
+ };
1357
+ var hasWarnedAboutUsingNestedContextConsumers = false;
1358
+ var hasWarnedAboutUsingConsumerProvider = false;
1359
+ var hasWarnedAboutDisplayNameOnConsumer = false;
1360
+
1361
+ {
1362
+ // A separate object, but proxies back to the original context object for
1363
+ // backwards compatibility. It has a different $$typeof, so we can properly
1364
+ // warn for the incorrect usage of Context as a Consumer.
1365
+ var Consumer = {
1366
+ $$typeof: REACT_CONTEXT_TYPE,
1367
+ _context: context
1368
+ }; // $FlowFixMe: Flow complains about not setting a value, which is intentional here
1369
+
1370
+ Object.defineProperties(Consumer, {
1371
+ Provider: {
1372
+ get: function () {
1373
+ if (!hasWarnedAboutUsingConsumerProvider) {
1374
+ hasWarnedAboutUsingConsumerProvider = true;
1375
+
1376
+ error('Rendering <Context.Consumer.Provider> is not supported and will be removed in ' + 'a future major release. Did you mean to render <Context.Provider> instead?');
1377
+ }
1378
+
1379
+ return context.Provider;
1380
+ },
1381
+ set: function (_Provider) {
1382
+ context.Provider = _Provider;
1383
+ }
1384
+ },
1385
+ _currentValue: {
1386
+ get: function () {
1387
+ return context._currentValue;
1388
+ },
1389
+ set: function (_currentValue) {
1390
+ context._currentValue = _currentValue;
1391
+ }
1392
+ },
1393
+ _currentValue2: {
1394
+ get: function () {
1395
+ return context._currentValue2;
1396
+ },
1397
+ set: function (_currentValue2) {
1398
+ context._currentValue2 = _currentValue2;
1399
+ }
1400
+ },
1401
+ _threadCount: {
1402
+ get: function () {
1403
+ return context._threadCount;
1404
+ },
1405
+ set: function (_threadCount) {
1406
+ context._threadCount = _threadCount;
1407
+ }
1408
+ },
1409
+ Consumer: {
1410
+ get: function () {
1411
+ if (!hasWarnedAboutUsingNestedContextConsumers) {
1412
+ hasWarnedAboutUsingNestedContextConsumers = true;
1413
+
1414
+ error('Rendering <Context.Consumer.Consumer> is not supported and will be removed in ' + 'a future major release. Did you mean to render <Context.Consumer> instead?');
1415
+ }
1416
+
1417
+ return context.Consumer;
1418
+ }
1419
+ },
1420
+ displayName: {
1421
+ get: function () {
1422
+ return context.displayName;
1423
+ },
1424
+ set: function (displayName) {
1425
+ if (!hasWarnedAboutDisplayNameOnConsumer) {
1426
+ warn('Setting `displayName` on Context.Consumer has no effect. ' + "You should set it directly on the context with Context.displayName = '%s'.", displayName);
1427
+
1428
+ hasWarnedAboutDisplayNameOnConsumer = true;
1429
+ }
1430
+ }
1431
+ }
1432
+ }); // $FlowFixMe: Flow complains about missing properties because it doesn't understand defineProperty
1433
+
1434
+ context.Consumer = Consumer;
1435
+ }
1436
+
1437
+ {
1438
+ context._currentRenderer = null;
1439
+ context._currentRenderer2 = null;
1440
+ }
1441
+
1442
+ return context;
1443
+ }
1444
+
1445
+ var Uninitialized = -1;
1446
+ var Pending = 0;
1447
+ var Resolved = 1;
1448
+ var Rejected = 2;
1449
+
1450
+ function lazyInitializer(payload) {
1451
+ if (payload._status === Uninitialized) {
1452
+ var ctor = payload._result;
1453
+ var thenable = ctor(); // Transition to the next state.
1454
+ // This might throw either because it's missing or throws. If so, we treat it
1455
+ // as still uninitialized and try again next time. Which is the same as what
1456
+ // happens if the ctor or any wrappers processing the ctor throws. This might
1457
+ // end up fixing it if the resolution was a concurrency bug.
1458
+
1459
+ thenable.then(function (moduleObject) {
1460
+ if (payload._status === Pending || payload._status === Uninitialized) {
1461
+ // Transition to the next state.
1462
+ var resolved = payload;
1463
+ resolved._status = Resolved;
1464
+ resolved._result = moduleObject;
1465
+ }
1466
+ }, function (error) {
1467
+ if (payload._status === Pending || payload._status === Uninitialized) {
1468
+ // Transition to the next state.
1469
+ var rejected = payload;
1470
+ rejected._status = Rejected;
1471
+ rejected._result = error;
1472
+ }
1473
+ });
1474
+
1475
+ if (payload._status === Uninitialized) {
1476
+ // In case, we're still uninitialized, then we're waiting for the thenable
1477
+ // to resolve. Set it as pending in the meantime.
1478
+ var pending = payload;
1479
+ pending._status = Pending;
1480
+ pending._result = thenable;
1481
+ }
1482
+ }
1483
+
1484
+ if (payload._status === Resolved) {
1485
+ var moduleObject = payload._result;
1486
+
1487
+ {
1488
+ if (moduleObject === undefined) {
1489
+ error('lazy: Expected the result of a dynamic imp' + 'ort() call. ' + 'Instead received: %s\n\nYour code should look like: \n ' + // Break up imports to avoid accidentally parsing them as dependencies.
1490
+ 'const MyComponent = lazy(() => imp' + "ort('./MyComponent'))\n\n" + 'Did you accidentally put curly braces around the import?', moduleObject);
1491
+ }
1492
+ }
1493
+
1494
+ {
1495
+ if (!('default' in moduleObject)) {
1496
+ error('lazy: Expected the result of a dynamic imp' + 'ort() call. ' + 'Instead received: %s\n\nYour code should look like: \n ' + // Break up imports to avoid accidentally parsing them as dependencies.
1497
+ 'const MyComponent = lazy(() => imp' + "ort('./MyComponent'))", moduleObject);
1498
+ }
1499
+ }
1500
+
1501
+ return moduleObject.default;
1502
+ } else {
1503
+ throw payload._result;
1504
+ }
1505
+ }
1506
+
1507
+ function lazy(ctor) {
1508
+ var payload = {
1509
+ // We use these fields to store the result.
1510
+ _status: Uninitialized,
1511
+ _result: ctor
1512
+ };
1513
+ var lazyType = {
1514
+ $$typeof: REACT_LAZY_TYPE,
1515
+ _payload: payload,
1516
+ _init: lazyInitializer
1517
+ };
1518
+
1519
+ {
1520
+ // In production, this would just set it on the object.
1521
+ var defaultProps;
1522
+ var propTypes; // $FlowFixMe
1523
+
1524
+ Object.defineProperties(lazyType, {
1525
+ defaultProps: {
1526
+ configurable: true,
1527
+ get: function () {
1528
+ return defaultProps;
1529
+ },
1530
+ set: function (newDefaultProps) {
1531
+ error('React.lazy(...): It is not supported to assign `defaultProps` to ' + 'a lazy component import. Either specify them where the component ' + 'is defined, or create a wrapping component around it.');
1532
+
1533
+ defaultProps = newDefaultProps; // Match production behavior more closely:
1534
+ // $FlowFixMe
1535
+
1536
+ Object.defineProperty(lazyType, 'defaultProps', {
1537
+ enumerable: true
1538
+ });
1539
+ }
1540
+ },
1541
+ propTypes: {
1542
+ configurable: true,
1543
+ get: function () {
1544
+ return propTypes;
1545
+ },
1546
+ set: function (newPropTypes) {
1547
+ error('React.lazy(...): It is not supported to assign `propTypes` to ' + 'a lazy component import. Either specify them where the component ' + 'is defined, or create a wrapping component around it.');
1548
+
1549
+ propTypes = newPropTypes; // Match production behavior more closely:
1550
+ // $FlowFixMe
1551
+
1552
+ Object.defineProperty(lazyType, 'propTypes', {
1553
+ enumerable: true
1554
+ });
1555
+ }
1556
+ }
1557
+ });
1558
+ }
1559
+
1560
+ return lazyType;
1561
+ }
1562
+
1563
+ function forwardRef(render) {
1564
+ {
1565
+ if (render != null && render.$$typeof === REACT_MEMO_TYPE) {
1566
+ error('forwardRef requires a render function but received a `memo` ' + 'component. Instead of forwardRef(memo(...)), use ' + 'memo(forwardRef(...)).');
1567
+ } else if (typeof render !== 'function') {
1568
+ error('forwardRef requires a render function but was given %s.', render === null ? 'null' : typeof render);
1569
+ } else {
1570
+ if (render.length !== 0 && render.length !== 2) {
1571
+ error('forwardRef render functions accept exactly two parameters: props and ref. %s', render.length === 1 ? 'Did you forget to use the ref parameter?' : 'Any additional parameter will be undefined.');
1572
+ }
1573
+ }
1574
+
1575
+ if (render != null) {
1576
+ if (render.defaultProps != null || render.propTypes != null) {
1577
+ error('forwardRef render functions do not support propTypes or defaultProps. ' + 'Did you accidentally pass a React component?');
1578
+ }
1579
+ }
1580
+ }
1581
+
1582
+ var elementType = {
1583
+ $$typeof: REACT_FORWARD_REF_TYPE,
1584
+ render: render
1585
+ };
1586
+
1587
+ {
1588
+ var ownName;
1589
+ Object.defineProperty(elementType, 'displayName', {
1590
+ enumerable: false,
1591
+ configurable: true,
1592
+ get: function () {
1593
+ return ownName;
1594
+ },
1595
+ set: function (name) {
1596
+ ownName = name; // The inner component shouldn't inherit this display name in most cases,
1597
+ // because the component may be used elsewhere.
1598
+ // But it's nice for anonymous functions to inherit the name,
1599
+ // so that our component-stack generation logic will display their frames.
1600
+ // An anonymous function generally suggests a pattern like:
1601
+ // React.forwardRef((props, ref) => {...});
1602
+ // This kind of inner function is not used elsewhere so the side effect is okay.
1603
+
1604
+ if (!render.name && !render.displayName) {
1605
+ render.displayName = name;
1606
+ }
1607
+ }
1608
+ });
1609
+ }
1610
+
1611
+ return elementType;
1612
+ }
1613
+
1614
+ var REACT_MODULE_REFERENCE;
1615
+
1616
+ {
1617
+ REACT_MODULE_REFERENCE = Symbol.for('react.module.reference');
1618
+ }
1619
+
1620
+ function isValidElementType(type) {
1621
+ if (typeof type === 'string' || typeof type === 'function') {
1622
+ return true;
1623
+ } // Note: typeof might be other than 'symbol' or 'number' (e.g. if it's a polyfill).
1624
+
1625
+
1626
+ if (type === REACT_FRAGMENT_TYPE || type === REACT_PROFILER_TYPE || enableDebugTracing || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || enableLegacyHidden || type === REACT_OFFSCREEN_TYPE || enableScopeAPI || enableCacheElement || enableTransitionTracing ) {
1627
+ return true;
1628
+ }
1629
+
1630
+ if (typeof type === 'object' && type !== null) {
1631
+ if (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 || // This needs to include all possible module reference object
1632
+ // types supported by any Flight configuration anywhere since
1633
+ // we don't know which Flight build this will end up being used
1634
+ // with.
1635
+ type.$$typeof === REACT_MODULE_REFERENCE || type.getModuleId !== undefined) {
1636
+ return true;
1637
+ }
1638
+ }
1639
+
1640
+ return false;
1641
+ }
1642
+
1643
+ function memo(type, compare) {
1644
+ {
1645
+ if (!isValidElementType(type)) {
1646
+ error('memo: The first argument must be a component. Instead ' + 'received: %s', type === null ? 'null' : typeof type);
1647
+ }
1648
+ }
1649
+
1650
+ var elementType = {
1651
+ $$typeof: REACT_MEMO_TYPE,
1652
+ type: type,
1653
+ compare: compare === undefined ? null : compare
1654
+ };
1655
+
1656
+ {
1657
+ var ownName;
1658
+ Object.defineProperty(elementType, 'displayName', {
1659
+ enumerable: false,
1660
+ configurable: true,
1661
+ get: function () {
1662
+ return ownName;
1663
+ },
1664
+ set: function (name) {
1665
+ ownName = name; // The inner component shouldn't inherit this display name in most cases,
1666
+ // because the component may be used elsewhere.
1667
+ // But it's nice for anonymous functions to inherit the name,
1668
+ // so that our component-stack generation logic will display their frames.
1669
+ // An anonymous function generally suggests a pattern like:
1670
+ // React.memo((props) => {...});
1671
+ // This kind of inner function is not used elsewhere so the side effect is okay.
1672
+
1673
+ if (!type.name && !type.displayName) {
1674
+ type.displayName = name;
1675
+ }
1676
+ }
1677
+ });
1678
+ }
1679
+
1680
+ return elementType;
1681
+ }
1682
+
1683
+ function resolveDispatcher() {
1684
+ var dispatcher = ReactCurrentDispatcher.current;
1685
+
1686
+ {
1687
+ if (dispatcher === null) {
1688
+ error('Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for' + ' one of the following reasons:\n' + '1. You might have mismatching versions of React and the renderer (such as React DOM)\n' + '2. You might be breaking the Rules of Hooks\n' + '3. You might have more than one copy of React in the same app\n' + 'See https://reactjs.org/link/invalid-hook-call for tips about how to debug and fix this problem.');
1689
+ }
1690
+ } // Will result in a null access error if accessed outside render phase. We
1691
+ // intentionally don't throw our own error because this is in a hot path.
1692
+ // Also helps ensure this is inlined.
1693
+
1694
+
1695
+ return dispatcher;
1696
+ }
1697
+ function useContext(Context) {
1698
+ var dispatcher = resolveDispatcher();
1699
+
1700
+ {
1701
+ // TODO: add a more generic warning for invalid values.
1702
+ if (Context._context !== undefined) {
1703
+ var realContext = Context._context; // Don't deduplicate because this legitimately causes bugs
1704
+ // and nobody should be using this in existing code.
1705
+
1706
+ if (realContext.Consumer === Context) {
1707
+ error('Calling useContext(Context.Consumer) is not supported, may cause bugs, and will be ' + 'removed in a future major release. Did you mean to call useContext(Context) instead?');
1708
+ } else if (realContext.Provider === Context) {
1709
+ error('Calling useContext(Context.Provider) is not supported. ' + 'Did you mean to call useContext(Context) instead?');
1710
+ }
1711
+ }
1712
+ }
1713
+
1714
+ return dispatcher.useContext(Context);
1715
+ }
1716
+ function useState(initialState) {
1717
+ var dispatcher = resolveDispatcher();
1718
+ return dispatcher.useState(initialState);
1719
+ }
1720
+ function useReducer(reducer, initialArg, init) {
1721
+ var dispatcher = resolveDispatcher();
1722
+ return dispatcher.useReducer(reducer, initialArg, init);
1723
+ }
1724
+ function useRef(initialValue) {
1725
+ var dispatcher = resolveDispatcher();
1726
+ return dispatcher.useRef(initialValue);
1727
+ }
1728
+ function useEffect(create, deps) {
1729
+ var dispatcher = resolveDispatcher();
1730
+ return dispatcher.useEffect(create, deps);
1731
+ }
1732
+ function useInsertionEffect(create, deps) {
1733
+ var dispatcher = resolveDispatcher();
1734
+ return dispatcher.useInsertionEffect(create, deps);
1735
+ }
1736
+ function useLayoutEffect(create, deps) {
1737
+ var dispatcher = resolveDispatcher();
1738
+ return dispatcher.useLayoutEffect(create, deps);
1739
+ }
1740
+ function useCallback(callback, deps) {
1741
+ var dispatcher = resolveDispatcher();
1742
+ return dispatcher.useCallback(callback, deps);
1743
+ }
1744
+ function useMemo(create, deps) {
1745
+ var dispatcher = resolveDispatcher();
1746
+ return dispatcher.useMemo(create, deps);
1747
+ }
1748
+ function useImperativeHandle(ref, create, deps) {
1749
+ var dispatcher = resolveDispatcher();
1750
+ return dispatcher.useImperativeHandle(ref, create, deps);
1751
+ }
1752
+ function useDebugValue(value, formatterFn) {
1753
+ {
1754
+ var dispatcher = resolveDispatcher();
1755
+ return dispatcher.useDebugValue(value, formatterFn);
1756
+ }
1757
+ }
1758
+ function useTransition() {
1759
+ var dispatcher = resolveDispatcher();
1760
+ return dispatcher.useTransition();
1761
+ }
1762
+ function useDeferredValue(value) {
1763
+ var dispatcher = resolveDispatcher();
1764
+ return dispatcher.useDeferredValue(value);
1765
+ }
1766
+ function useId() {
1767
+ var dispatcher = resolveDispatcher();
1768
+ return dispatcher.useId();
1769
+ }
1770
+ function useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot) {
1771
+ var dispatcher = resolveDispatcher();
1772
+ return dispatcher.useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot);
1773
+ }
1774
+
1775
+ // Helpers to patch console.logs to avoid logging during side-effect free
1776
+ // replaying on render function. This currently only patches the object
1777
+ // lazily which won't cover if the log function was extracted eagerly.
1778
+ // We could also eagerly patch the method.
1779
+ var disabledDepth = 0;
1780
+ var prevLog;
1781
+ var prevInfo;
1782
+ var prevWarn;
1783
+ var prevError;
1784
+ var prevGroup;
1785
+ var prevGroupCollapsed;
1786
+ var prevGroupEnd;
1787
+
1788
+ function disabledLog() {}
1789
+
1790
+ disabledLog.__reactDisabledLog = true;
1791
+ function disableLogs() {
1792
+ {
1793
+ if (disabledDepth === 0) {
1794
+ /* eslint-disable react-internal/no-production-logging */
1795
+ prevLog = console.log;
1796
+ prevInfo = console.info;
1797
+ prevWarn = console.warn;
1798
+ prevError = console.error;
1799
+ prevGroup = console.group;
1800
+ prevGroupCollapsed = console.groupCollapsed;
1801
+ prevGroupEnd = console.groupEnd; // https://github.com/facebook/react/issues/19099
1802
+
1803
+ var props = {
1804
+ configurable: true,
1805
+ enumerable: true,
1806
+ value: disabledLog,
1807
+ writable: true
1808
+ }; // $FlowFixMe Flow thinks console is immutable.
1809
+
1810
+ Object.defineProperties(console, {
1811
+ info: props,
1812
+ log: props,
1813
+ warn: props,
1814
+ error: props,
1815
+ group: props,
1816
+ groupCollapsed: props,
1817
+ groupEnd: props
1818
+ });
1819
+ /* eslint-enable react-internal/no-production-logging */
1820
+ }
1821
+
1822
+ disabledDepth++;
1823
+ }
1824
+ }
1825
+ function reenableLogs() {
1826
+ {
1827
+ disabledDepth--;
1828
+
1829
+ if (disabledDepth === 0) {
1830
+ /* eslint-disable react-internal/no-production-logging */
1831
+ var props = {
1832
+ configurable: true,
1833
+ enumerable: true,
1834
+ writable: true
1835
+ }; // $FlowFixMe Flow thinks console is immutable.
1836
+
1837
+ Object.defineProperties(console, {
1838
+ log: assign({}, props, {
1839
+ value: prevLog
1840
+ }),
1841
+ info: assign({}, props, {
1842
+ value: prevInfo
1843
+ }),
1844
+ warn: assign({}, props, {
1845
+ value: prevWarn
1846
+ }),
1847
+ error: assign({}, props, {
1848
+ value: prevError
1849
+ }),
1850
+ group: assign({}, props, {
1851
+ value: prevGroup
1852
+ }),
1853
+ groupCollapsed: assign({}, props, {
1854
+ value: prevGroupCollapsed
1855
+ }),
1856
+ groupEnd: assign({}, props, {
1857
+ value: prevGroupEnd
1858
+ })
1859
+ });
1860
+ /* eslint-enable react-internal/no-production-logging */
1861
+ }
1862
+
1863
+ if (disabledDepth < 0) {
1864
+ error('disabledDepth fell below zero. ' + 'This is a bug in React. Please file an issue.');
1865
+ }
1866
+ }
1867
+ }
1868
+
1869
+ var ReactCurrentDispatcher$1 = ReactSharedInternals.ReactCurrentDispatcher;
1870
+ var prefix;
1871
+ function describeBuiltInComponentFrame(name, source, ownerFn) {
1872
+ {
1873
+ if (prefix === undefined) {
1874
+ // Extract the VM specific prefix used by each line.
1875
+ try {
1876
+ throw Error();
1877
+ } catch (x) {
1878
+ var match = x.stack.trim().match(/\n( *(at )?)/);
1879
+ prefix = match && match[1] || '';
1880
+ }
1881
+ } // We use the prefix to ensure our stacks line up with native stack frames.
1882
+
1883
+
1884
+ return '\n' + prefix + name;
1885
+ }
1886
+ }
1887
+ var reentry = false;
1888
+ var componentFrameCache;
1889
+
1890
+ {
1891
+ var PossiblyWeakMap = typeof WeakMap === 'function' ? WeakMap : Map;
1892
+ componentFrameCache = new PossiblyWeakMap();
1893
+ }
1894
+
1895
+ function describeNativeComponentFrame(fn, construct) {
1896
+ // If something asked for a stack inside a fake render, it should get ignored.
1897
+ if ( !fn || reentry) {
1898
+ return '';
1899
+ }
1900
+
1901
+ {
1902
+ var frame = componentFrameCache.get(fn);
1903
+
1904
+ if (frame !== undefined) {
1905
+ return frame;
1906
+ }
1907
+ }
1908
+
1909
+ var control;
1910
+ reentry = true;
1911
+ var previousPrepareStackTrace = Error.prepareStackTrace; // $FlowFixMe It does accept undefined.
1912
+
1913
+ Error.prepareStackTrace = undefined;
1914
+ var previousDispatcher;
1915
+
1916
+ {
1917
+ previousDispatcher = ReactCurrentDispatcher$1.current; // Set the dispatcher in DEV because this might be call in the render function
1918
+ // for warnings.
1919
+
1920
+ ReactCurrentDispatcher$1.current = null;
1921
+ disableLogs();
1922
+ }
1923
+
1924
+ try {
1925
+ // This should throw.
1926
+ if (construct) {
1927
+ // Something should be setting the props in the constructor.
1928
+ var Fake = function () {
1929
+ throw Error();
1930
+ }; // $FlowFixMe
1931
+
1932
+
1933
+ Object.defineProperty(Fake.prototype, 'props', {
1934
+ set: function () {
1935
+ // We use a throwing setter instead of frozen or non-writable props
1936
+ // because that won't throw in a non-strict mode function.
1937
+ throw Error();
1938
+ }
1939
+ });
1940
+
1941
+ if (typeof Reflect === 'object' && Reflect.construct) {
1942
+ // We construct a different control for this case to include any extra
1943
+ // frames added by the construct call.
1944
+ try {
1945
+ Reflect.construct(Fake, []);
1946
+ } catch (x) {
1947
+ control = x;
1948
+ }
1949
+
1950
+ Reflect.construct(fn, [], Fake);
1951
+ } else {
1952
+ try {
1953
+ Fake.call();
1954
+ } catch (x) {
1955
+ control = x;
1956
+ }
1957
+
1958
+ fn.call(Fake.prototype);
1959
+ }
1960
+ } else {
1961
+ try {
1962
+ throw Error();
1963
+ } catch (x) {
1964
+ control = x;
1965
+ }
1966
+
1967
+ fn();
1968
+ }
1969
+ } catch (sample) {
1970
+ // This is inlined manually because closure doesn't do it for us.
1971
+ if (sample && control && typeof sample.stack === 'string') {
1972
+ // This extracts the first frame from the sample that isn't also in the control.
1973
+ // Skipping one frame that we assume is the frame that calls the two.
1974
+ var sampleLines = sample.stack.split('\n');
1975
+ var controlLines = control.stack.split('\n');
1976
+ var s = sampleLines.length - 1;
1977
+ var c = controlLines.length - 1;
1978
+
1979
+ while (s >= 1 && c >= 0 && sampleLines[s] !== controlLines[c]) {
1980
+ // We expect at least one stack frame to be shared.
1981
+ // Typically this will be the root most one. However, stack frames may be
1982
+ // cut off due to maximum stack limits. In this case, one maybe cut off
1983
+ // earlier than the other. We assume that the sample is longer or the same
1984
+ // and there for cut off earlier. So we should find the root most frame in
1985
+ // the sample somewhere in the control.
1986
+ c--;
1987
+ }
1988
+
1989
+ for (; s >= 1 && c >= 0; s--, c--) {
1990
+ // Next we find the first one that isn't the same which should be the
1991
+ // frame that called our sample function and the control.
1992
+ if (sampleLines[s] !== controlLines[c]) {
1993
+ // In V8, the first line is describing the message but other VMs don't.
1994
+ // If we're about to return the first line, and the control is also on the same
1995
+ // line, that's a pretty good indicator that our sample threw at same line as
1996
+ // the control. I.e. before we entered the sample frame. So we ignore this result.
1997
+ // This can happen if you passed a class to function component, or non-function.
1998
+ if (s !== 1 || c !== 1) {
1999
+ do {
2000
+ s--;
2001
+ c--; // We may still have similar intermediate frames from the construct call.
2002
+ // The next one that isn't the same should be our match though.
2003
+
2004
+ if (c < 0 || sampleLines[s] !== controlLines[c]) {
2005
+ // V8 adds a "new" prefix for native classes. Let's remove it to make it prettier.
2006
+ var _frame = '\n' + sampleLines[s].replace(' at new ', ' at '); // If our component frame is labeled "<anonymous>"
2007
+ // but we have a user-provided "displayName"
2008
+ // splice it in to make the stack more readable.
2009
+
2010
+
2011
+ if (fn.displayName && _frame.includes('<anonymous>')) {
2012
+ _frame = _frame.replace('<anonymous>', fn.displayName);
2013
+ }
2014
+
2015
+ {
2016
+ if (typeof fn === 'function') {
2017
+ componentFrameCache.set(fn, _frame);
2018
+ }
2019
+ } // Return the line we found.
2020
+
2021
+
2022
+ return _frame;
2023
+ }
2024
+ } while (s >= 1 && c >= 0);
2025
+ }
2026
+
2027
+ break;
2028
+ }
2029
+ }
2030
+ }
2031
+ } finally {
2032
+ reentry = false;
2033
+
2034
+ {
2035
+ ReactCurrentDispatcher$1.current = previousDispatcher;
2036
+ reenableLogs();
2037
+ }
2038
+
2039
+ Error.prepareStackTrace = previousPrepareStackTrace;
2040
+ } // Fallback to just using the name if we couldn't make it throw.
2041
+
2042
+
2043
+ var name = fn ? fn.displayName || fn.name : '';
2044
+ var syntheticFrame = name ? describeBuiltInComponentFrame(name) : '';
2045
+
2046
+ {
2047
+ if (typeof fn === 'function') {
2048
+ componentFrameCache.set(fn, syntheticFrame);
2049
+ }
2050
+ }
2051
+
2052
+ return syntheticFrame;
2053
+ }
2054
+ function describeFunctionComponentFrame(fn, source, ownerFn) {
2055
+ {
2056
+ return describeNativeComponentFrame(fn, false);
2057
+ }
2058
+ }
2059
+
2060
+ function shouldConstruct(Component) {
2061
+ var prototype = Component.prototype;
2062
+ return !!(prototype && prototype.isReactComponent);
2063
+ }
2064
+
2065
+ function describeUnknownElementTypeFrameInDEV(type, source, ownerFn) {
2066
+
2067
+ if (type == null) {
2068
+ return '';
2069
+ }
2070
+
2071
+ if (typeof type === 'function') {
2072
+ {
2073
+ return describeNativeComponentFrame(type, shouldConstruct(type));
2074
+ }
2075
+ }
2076
+
2077
+ if (typeof type === 'string') {
2078
+ return describeBuiltInComponentFrame(type);
2079
+ }
2080
+
2081
+ switch (type) {
2082
+ case REACT_SUSPENSE_TYPE:
2083
+ return describeBuiltInComponentFrame('Suspense');
2084
+
2085
+ case REACT_SUSPENSE_LIST_TYPE:
2086
+ return describeBuiltInComponentFrame('SuspenseList');
2087
+ }
2088
+
2089
+ if (typeof type === 'object') {
2090
+ switch (type.$$typeof) {
2091
+ case REACT_FORWARD_REF_TYPE:
2092
+ return describeFunctionComponentFrame(type.render);
2093
+
2094
+ case REACT_MEMO_TYPE:
2095
+ // Memo may contain any component type so we recursively resolve it.
2096
+ return describeUnknownElementTypeFrameInDEV(type.type, source, ownerFn);
2097
+
2098
+ case REACT_LAZY_TYPE:
2099
+ {
2100
+ var lazyComponent = type;
2101
+ var payload = lazyComponent._payload;
2102
+ var init = lazyComponent._init;
2103
+
2104
+ try {
2105
+ // Lazy may contain any component type so we recursively resolve it.
2106
+ return describeUnknownElementTypeFrameInDEV(init(payload), source, ownerFn);
2107
+ } catch (x) {}
2108
+ }
2109
+ }
2110
+ }
2111
+
2112
+ return '';
2113
+ }
2114
+
2115
+ var loggedTypeFailures = {};
2116
+ var ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame;
2117
+
2118
+ function setCurrentlyValidatingElement(element) {
2119
+ {
2120
+ if (element) {
2121
+ var owner = element._owner;
2122
+ var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);
2123
+ ReactDebugCurrentFrame$1.setExtraStackFrame(stack);
2124
+ } else {
2125
+ ReactDebugCurrentFrame$1.setExtraStackFrame(null);
2126
+ }
2127
+ }
2128
+ }
2129
+
2130
+ function checkPropTypes(typeSpecs, values, location, componentName, element) {
2131
+ {
2132
+ // $FlowFixMe This is okay but Flow doesn't know it.
2133
+ var has = Function.call.bind(hasOwnProperty);
2134
+
2135
+ for (var typeSpecName in typeSpecs) {
2136
+ if (has(typeSpecs, typeSpecName)) {
2137
+ var error$1 = void 0; // Prop type validation may throw. In case they do, we don't want to
2138
+ // fail the render phase where it didn't fail before. So we log it.
2139
+ // After these have been cleaned up, we'll let them throw.
2140
+
2141
+ try {
2142
+ // This is intentionally an invariant that gets caught. It's the same
2143
+ // behavior as without this statement except with a better message.
2144
+ if (typeof typeSpecs[typeSpecName] !== 'function') {
2145
+ // eslint-disable-next-line react-internal/prod-error-codes
2146
+ var err = Error((componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' + 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.' + 'This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.');
2147
+ err.name = 'Invariant Violation';
2148
+ throw err;
2149
+ }
2150
+
2151
+ error$1 = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED');
2152
+ } catch (ex) {
2153
+ error$1 = ex;
2154
+ }
2155
+
2156
+ if (error$1 && !(error$1 instanceof Error)) {
2157
+ setCurrentlyValidatingElement(element);
2158
+
2159
+ error('%s: type specification of %s' + ' `%s` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a %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).', componentName || 'React class', location, typeSpecName, typeof error$1);
2160
+
2161
+ setCurrentlyValidatingElement(null);
2162
+ }
2163
+
2164
+ if (error$1 instanceof Error && !(error$1.message in loggedTypeFailures)) {
2165
+ // Only monitor this failure once because there tends to be a lot of the
2166
+ // same error.
2167
+ loggedTypeFailures[error$1.message] = true;
2168
+ setCurrentlyValidatingElement(element);
2169
+
2170
+ error('Failed %s type: %s', location, error$1.message);
2171
+
2172
+ setCurrentlyValidatingElement(null);
2173
+ }
2174
+ }
2175
+ }
2176
+ }
2177
+ }
2178
+
2179
+ function setCurrentlyValidatingElement$1(element) {
2180
+ {
2181
+ if (element) {
2182
+ var owner = element._owner;
2183
+ var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);
2184
+ setExtraStackFrame(stack);
2185
+ } else {
2186
+ setExtraStackFrame(null);
2187
+ }
2188
+ }
2189
+ }
2190
+
2191
+ var propTypesMisspellWarningShown;
2192
+
2193
+ {
2194
+ propTypesMisspellWarningShown = false;
2195
+ }
2196
+
2197
+ function getDeclarationErrorAddendum() {
2198
+ if (ReactCurrentOwner.current) {
2199
+ var name = getComponentNameFromType(ReactCurrentOwner.current.type);
2200
+
2201
+ if (name) {
2202
+ return '\n\nCheck the render method of `' + name + '`.';
2203
+ }
2204
+ }
2205
+
2206
+ return '';
2207
+ }
2208
+
2209
+ function getSourceInfoErrorAddendum(source) {
2210
+ if (source !== undefined) {
2211
+ var fileName = source.fileName.replace(/^.*[\\\/]/, '');
2212
+ var lineNumber = source.lineNumber;
2213
+ return '\n\nCheck your code at ' + fileName + ':' + lineNumber + '.';
2214
+ }
2215
+
2216
+ return '';
2217
+ }
2218
+
2219
+ function getSourceInfoErrorAddendumForProps(elementProps) {
2220
+ if (elementProps !== null && elementProps !== undefined) {
2221
+ return getSourceInfoErrorAddendum(elementProps.__source);
2222
+ }
2223
+
2224
+ return '';
2225
+ }
2226
+ /**
2227
+ * Warn if there's no key explicitly set on dynamic arrays of children or
2228
+ * object keys are not valid. This allows us to keep track of children between
2229
+ * updates.
2230
+ */
2231
+
2232
+
2233
+ var ownerHasKeyUseWarning = {};
2234
+
2235
+ function getCurrentComponentErrorInfo(parentType) {
2236
+ var info = getDeclarationErrorAddendum();
2237
+
2238
+ if (!info) {
2239
+ var parentName = typeof parentType === 'string' ? parentType : parentType.displayName || parentType.name;
2240
+
2241
+ if (parentName) {
2242
+ info = "\n\nCheck the top-level render call using <" + parentName + ">.";
2243
+ }
2244
+ }
2245
+
2246
+ return info;
2247
+ }
2248
+ /**
2249
+ * Warn if the element doesn't have an explicit key assigned to it.
2250
+ * This element is in an array. The array could grow and shrink or be
2251
+ * reordered. All children that haven't already been validated are required to
2252
+ * have a "key" property assigned to it. Error statuses are cached so a warning
2253
+ * will only be shown once.
2254
+ *
2255
+ * @internal
2256
+ * @param {ReactElement} element Element that requires a key.
2257
+ * @param {*} parentType element's parent's type.
2258
+ */
2259
+
2260
+
2261
+ function validateExplicitKey(element, parentType) {
2262
+ if (!element._store || element._store.validated || element.key != null) {
2263
+ return;
2264
+ }
2265
+
2266
+ element._store.validated = true;
2267
+ var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType);
2268
+
2269
+ if (ownerHasKeyUseWarning[currentComponentErrorInfo]) {
2270
+ return;
2271
+ }
2272
+
2273
+ ownerHasKeyUseWarning[currentComponentErrorInfo] = true; // Usually the current owner is the offender, but if it accepts children as a
2274
+ // property, it may be the creator of the child that's responsible for
2275
+ // assigning it a key.
2276
+
2277
+ var childOwner = '';
2278
+
2279
+ if (element && element._owner && element._owner !== ReactCurrentOwner.current) {
2280
+ // Give the component that originally created this child.
2281
+ childOwner = " It was passed a child from " + getComponentNameFromType(element._owner.type) + ".";
2282
+ }
2283
+
2284
+ {
2285
+ setCurrentlyValidatingElement$1(element);
2286
+
2287
+ error('Each child in a list should have a unique "key" prop.' + '%s%s See https://reactjs.org/link/warning-keys for more information.', currentComponentErrorInfo, childOwner);
2288
+
2289
+ setCurrentlyValidatingElement$1(null);
2290
+ }
2291
+ }
2292
+ /**
2293
+ * Ensure that every element either is passed in a static location, in an
2294
+ * array with an explicit keys property defined, or in an object literal
2295
+ * with valid key property.
2296
+ *
2297
+ * @internal
2298
+ * @param {ReactNode} node Statically passed child of any type.
2299
+ * @param {*} parentType node's parent's type.
2300
+ */
2301
+
2302
+
2303
+ function validateChildKeys(node, parentType) {
2304
+ if (typeof node !== 'object') {
2305
+ return;
2306
+ }
2307
+
2308
+ if (isArray(node)) {
2309
+ for (var i = 0; i < node.length; i++) {
2310
+ var child = node[i];
2311
+
2312
+ if (isValidElement(child)) {
2313
+ validateExplicitKey(child, parentType);
2314
+ }
2315
+ }
2316
+ } else if (isValidElement(node)) {
2317
+ // This element was passed in a valid location.
2318
+ if (node._store) {
2319
+ node._store.validated = true;
2320
+ }
2321
+ } else if (node) {
2322
+ var iteratorFn = getIteratorFn(node);
2323
+
2324
+ if (typeof iteratorFn === 'function') {
2325
+ // Entry iterators used to provide implicit keys,
2326
+ // but now we print a separate warning for them later.
2327
+ if (iteratorFn !== node.entries) {
2328
+ var iterator = iteratorFn.call(node);
2329
+ var step;
2330
+
2331
+ while (!(step = iterator.next()).done) {
2332
+ if (isValidElement(step.value)) {
2333
+ validateExplicitKey(step.value, parentType);
2334
+ }
2335
+ }
2336
+ }
2337
+ }
2338
+ }
2339
+ }
2340
+ /**
2341
+ * Given an element, validate that its props follow the propTypes definition,
2342
+ * provided by the type.
2343
+ *
2344
+ * @param {ReactElement} element
2345
+ */
2346
+
2347
+
2348
+ function validatePropTypes(element) {
2349
+ {
2350
+ var type = element.type;
2351
+
2352
+ if (type === null || type === undefined || typeof type === 'string') {
2353
+ return;
2354
+ }
2355
+
2356
+ var propTypes;
2357
+
2358
+ if (typeof type === 'function') {
2359
+ propTypes = type.propTypes;
2360
+ } else if (typeof type === 'object' && (type.$$typeof === REACT_FORWARD_REF_TYPE || // Note: Memo only checks outer props here.
2361
+ // Inner props are checked in the reconciler.
2362
+ type.$$typeof === REACT_MEMO_TYPE)) {
2363
+ propTypes = type.propTypes;
2364
+ } else {
2365
+ return;
2366
+ }
2367
+
2368
+ if (propTypes) {
2369
+ // Intentionally inside to avoid triggering lazy initializers:
2370
+ var name = getComponentNameFromType(type);
2371
+ checkPropTypes(propTypes, element.props, 'prop', name, element);
2372
+ } else if (type.PropTypes !== undefined && !propTypesMisspellWarningShown) {
2373
+ propTypesMisspellWarningShown = true; // Intentionally inside to avoid triggering lazy initializers:
2374
+
2375
+ var _name = getComponentNameFromType(type);
2376
+
2377
+ error('Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?', _name || 'Unknown');
2378
+ }
2379
+
2380
+ if (typeof type.getDefaultProps === 'function' && !type.getDefaultProps.isReactClassApproved) {
2381
+ error('getDefaultProps is only used on classic React.createClass ' + 'definitions. Use a static property named `defaultProps` instead.');
2382
+ }
2383
+ }
2384
+ }
2385
+ /**
2386
+ * Given a fragment, validate that it can only be provided with fragment props
2387
+ * @param {ReactElement} fragment
2388
+ */
2389
+
2390
+
2391
+ function validateFragmentProps(fragment) {
2392
+ {
2393
+ var keys = Object.keys(fragment.props);
2394
+
2395
+ for (var i = 0; i < keys.length; i++) {
2396
+ var key = keys[i];
2397
+
2398
+ if (key !== 'children' && key !== 'key') {
2399
+ setCurrentlyValidatingElement$1(fragment);
2400
+
2401
+ error('Invalid prop `%s` supplied to `React.Fragment`. ' + 'React.Fragment can only have `key` and `children` props.', key);
2402
+
2403
+ setCurrentlyValidatingElement$1(null);
2404
+ break;
2405
+ }
2406
+ }
2407
+
2408
+ if (fragment.ref !== null) {
2409
+ setCurrentlyValidatingElement$1(fragment);
2410
+
2411
+ error('Invalid attribute `ref` supplied to `React.Fragment`.');
2412
+
2413
+ setCurrentlyValidatingElement$1(null);
2414
+ }
2415
+ }
2416
+ }
2417
+ function createElementWithValidation(type, props, children) {
2418
+ var validType = isValidElementType(type); // We warn in this case but don't throw. We expect the element creation to
2419
+ // succeed and there will likely be errors in render.
2420
+
2421
+ if (!validType) {
2422
+ var info = '';
2423
+
2424
+ if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) {
2425
+ info += ' You likely forgot to export your component from the file ' + "it's defined in, or you might have mixed up default and named imports.";
2426
+ }
2427
+
2428
+ var sourceInfo = getSourceInfoErrorAddendumForProps(props);
2429
+
2430
+ if (sourceInfo) {
2431
+ info += sourceInfo;
2432
+ } else {
2433
+ info += getDeclarationErrorAddendum();
2434
+ }
2435
+
2436
+ var typeString;
2437
+
2438
+ if (type === null) {
2439
+ typeString = 'null';
2440
+ } else if (isArray(type)) {
2441
+ typeString = 'array';
2442
+ } else if (type !== undefined && type.$$typeof === REACT_ELEMENT_TYPE) {
2443
+ typeString = "<" + (getComponentNameFromType(type.type) || 'Unknown') + " />";
2444
+ info = ' Did you accidentally export a JSX literal instead of a component?';
2445
+ } else {
2446
+ typeString = typeof type;
2447
+ }
2448
+
2449
+ {
2450
+ error('React.createElement: type is invalid -- expected a string (for ' + 'built-in components) or a class/function (for composite ' + 'components) but got: %s.%s', typeString, info);
2451
+ }
2452
+ }
2453
+
2454
+ var element = createElement.apply(this, arguments); // The result can be nullish if a mock or a custom function is used.
2455
+ // TODO: Drop this when these are no longer allowed as the type argument.
2456
+
2457
+ if (element == null) {
2458
+ return element;
2459
+ } // Skip key warning if the type isn't valid since our key validation logic
2460
+ // doesn't expect a non-string/function type and can throw confusing errors.
2461
+ // We don't want exception behavior to differ between dev and prod.
2462
+ // (Rendering will throw with a helpful message and as soon as the type is
2463
+ // fixed, the key warnings will appear.)
2464
+
2465
+
2466
+ if (validType) {
2467
+ for (var i = 2; i < arguments.length; i++) {
2468
+ validateChildKeys(arguments[i], type);
2469
+ }
2470
+ }
2471
+
2472
+ if (type === REACT_FRAGMENT_TYPE) {
2473
+ validateFragmentProps(element);
2474
+ } else {
2475
+ validatePropTypes(element);
2476
+ }
2477
+
2478
+ return element;
2479
+ }
2480
+ var didWarnAboutDeprecatedCreateFactory = false;
2481
+ function createFactoryWithValidation(type) {
2482
+ var validatedFactory = createElementWithValidation.bind(null, type);
2483
+ validatedFactory.type = type;
2484
+
2485
+ {
2486
+ if (!didWarnAboutDeprecatedCreateFactory) {
2487
+ didWarnAboutDeprecatedCreateFactory = true;
2488
+
2489
+ warn('React.createFactory() is deprecated and will be removed in ' + 'a future major release. Consider using JSX ' + 'or use React.createElement() directly instead.');
2490
+ } // Legacy hook: remove it
2491
+
2492
+
2493
+ Object.defineProperty(validatedFactory, 'type', {
2494
+ enumerable: false,
2495
+ get: function () {
2496
+ warn('Factory.type is deprecated. Access the class directly ' + 'before passing it to createFactory.');
2497
+
2498
+ Object.defineProperty(this, 'type', {
2499
+ value: type
2500
+ });
2501
+ return type;
2502
+ }
2503
+ });
2504
+ }
2505
+
2506
+ return validatedFactory;
2507
+ }
2508
+ function cloneElementWithValidation(element, props, children) {
2509
+ var newElement = cloneElement.apply(this, arguments);
2510
+
2511
+ for (var i = 2; i < arguments.length; i++) {
2512
+ validateChildKeys(arguments[i], newElement.type);
2513
+ }
2514
+
2515
+ validatePropTypes(newElement);
2516
+ return newElement;
2517
+ }
2518
+
2519
+ function startTransition(scope, options) {
2520
+ var prevTransition = ReactCurrentBatchConfig.transition;
2521
+ ReactCurrentBatchConfig.transition = {};
2522
+ var currentTransition = ReactCurrentBatchConfig.transition;
2523
+
2524
+ {
2525
+ ReactCurrentBatchConfig.transition._updatedFibers = new Set();
2526
+ }
2527
+
2528
+ try {
2529
+ scope();
2530
+ } finally {
2531
+ ReactCurrentBatchConfig.transition = prevTransition;
2532
+
2533
+ {
2534
+ if (prevTransition === null && currentTransition._updatedFibers) {
2535
+ var updatedFibersCount = currentTransition._updatedFibers.size;
2536
+
2537
+ if (updatedFibersCount > 10) {
2538
+ warn('Detected a large number of updates inside startTransition. ' + 'If this is due to a subscription please re-write it to use React provided hooks. ' + 'Otherwise concurrent mode guarantees are off the table.');
2539
+ }
2540
+
2541
+ currentTransition._updatedFibers.clear();
2542
+ }
2543
+ }
2544
+ }
2545
+ }
2546
+
2547
+ var didWarnAboutMessageChannel = false;
2548
+ var enqueueTaskImpl = null;
2549
+ function enqueueTask(task) {
2550
+ if (enqueueTaskImpl === null) {
2551
+ try {
2552
+ // read require off the module object to get around the bundlers.
2553
+ // we don't want them to detect a require and bundle a Node polyfill.
2554
+ var requireString = ('require' + Math.random()).slice(0, 7);
2555
+ var nodeRequire = module && module[requireString]; // assuming we're in node, let's try to get node's
2556
+ // version of setImmediate, bypassing fake timers if any.
2557
+
2558
+ enqueueTaskImpl = nodeRequire.call(module, 'timers').setImmediate;
2559
+ } catch (_err) {
2560
+ // we're in a browser
2561
+ // we can't use regular timers because they may still be faked
2562
+ // so we try MessageChannel+postMessage instead
2563
+ enqueueTaskImpl = function (callback) {
2564
+ {
2565
+ if (didWarnAboutMessageChannel === false) {
2566
+ didWarnAboutMessageChannel = true;
2567
+
2568
+ if (typeof MessageChannel === 'undefined') {
2569
+ error('This browser does not have a MessageChannel implementation, ' + 'so enqueuing tasks via await act(async () => ...) will fail. ' + 'Please file an issue at https://github.com/facebook/react/issues ' + 'if you encounter this warning.');
2570
+ }
2571
+ }
2572
+ }
2573
+
2574
+ var channel = new MessageChannel();
2575
+ channel.port1.onmessage = callback;
2576
+ channel.port2.postMessage(undefined);
2577
+ };
2578
+ }
2579
+ }
2580
+
2581
+ return enqueueTaskImpl(task);
2582
+ }
2583
+
2584
+ var actScopeDepth = 0;
2585
+ var didWarnNoAwaitAct = false;
2586
+ function act(callback) {
2587
+ {
2588
+ // `act` calls can be nested, so we track the depth. This represents the
2589
+ // number of `act` scopes on the stack.
2590
+ var prevActScopeDepth = actScopeDepth;
2591
+ actScopeDepth++;
2592
+
2593
+ if (ReactCurrentActQueue.current === null) {
2594
+ // This is the outermost `act` scope. Initialize the queue. The reconciler
2595
+ // will detect the queue and use it instead of Scheduler.
2596
+ ReactCurrentActQueue.current = [];
2597
+ }
2598
+
2599
+ var prevIsBatchingLegacy = ReactCurrentActQueue.isBatchingLegacy;
2600
+ var result;
2601
+
2602
+ try {
2603
+ // Used to reproduce behavior of `batchedUpdates` in legacy mode. Only
2604
+ // set to `true` while the given callback is executed, not for updates
2605
+ // triggered during an async event, because this is how the legacy
2606
+ // implementation of `act` behaved.
2607
+ ReactCurrentActQueue.isBatchingLegacy = true;
2608
+ result = callback(); // Replicate behavior of original `act` implementation in legacy mode,
2609
+ // which flushed updates immediately after the scope function exits, even
2610
+ // if it's an async function.
2611
+
2612
+ if (!prevIsBatchingLegacy && ReactCurrentActQueue.didScheduleLegacyUpdate) {
2613
+ var queue = ReactCurrentActQueue.current;
2614
+
2615
+ if (queue !== null) {
2616
+ ReactCurrentActQueue.didScheduleLegacyUpdate = false;
2617
+ flushActQueue(queue);
2618
+ }
2619
+ }
2620
+ } catch (error) {
2621
+ popActScope(prevActScopeDepth);
2622
+ throw error;
2623
+ } finally {
2624
+ ReactCurrentActQueue.isBatchingLegacy = prevIsBatchingLegacy;
2625
+ }
2626
+
2627
+ if (result !== null && typeof result === 'object' && typeof result.then === 'function') {
2628
+ var thenableResult = result; // The callback is an async function (i.e. returned a promise). Wait
2629
+ // for it to resolve before exiting the current scope.
2630
+
2631
+ var wasAwaited = false;
2632
+ var thenable = {
2633
+ then: function (resolve, reject) {
2634
+ wasAwaited = true;
2635
+ thenableResult.then(function (returnValue) {
2636
+ popActScope(prevActScopeDepth);
2637
+
2638
+ if (actScopeDepth === 0) {
2639
+ // We've exited the outermost act scope. Recursively flush the
2640
+ // queue until there's no remaining work.
2641
+ recursivelyFlushAsyncActWork(returnValue, resolve, reject);
2642
+ } else {
2643
+ resolve(returnValue);
2644
+ }
2645
+ }, function (error) {
2646
+ // The callback threw an error.
2647
+ popActScope(prevActScopeDepth);
2648
+ reject(error);
2649
+ });
2650
+ }
2651
+ };
2652
+
2653
+ {
2654
+ if (!didWarnNoAwaitAct && typeof Promise !== 'undefined') {
2655
+ // eslint-disable-next-line no-undef
2656
+ Promise.resolve().then(function () {}).then(function () {
2657
+ if (!wasAwaited) {
2658
+ didWarnNoAwaitAct = true;
2659
+
2660
+ error('You called act(async () => ...) without await. ' + 'This could lead to unexpected testing behaviour, ' + 'interleaving multiple act calls and mixing their ' + 'scopes. ' + 'You should - await act(async () => ...);');
2661
+ }
2662
+ });
2663
+ }
2664
+ }
2665
+
2666
+ return thenable;
2667
+ } else {
2668
+ var returnValue = result; // The callback is not an async function. Exit the current scope
2669
+ // immediately, without awaiting.
2670
+
2671
+ popActScope(prevActScopeDepth);
2672
+
2673
+ if (actScopeDepth === 0) {
2674
+ // Exiting the outermost act scope. Flush the queue.
2675
+ var _queue = ReactCurrentActQueue.current;
2676
+
2677
+ if (_queue !== null) {
2678
+ flushActQueue(_queue);
2679
+ ReactCurrentActQueue.current = null;
2680
+ } // Return a thenable. If the user awaits it, we'll flush again in
2681
+ // case additional work was scheduled by a microtask.
2682
+
2683
+
2684
+ var _thenable = {
2685
+ then: function (resolve, reject) {
2686
+ // Confirm we haven't re-entered another `act` scope, in case
2687
+ // the user does something weird like await the thenable
2688
+ // multiple times.
2689
+ if (ReactCurrentActQueue.current === null) {
2690
+ // Recursively flush the queue until there's no remaining work.
2691
+ ReactCurrentActQueue.current = [];
2692
+ recursivelyFlushAsyncActWork(returnValue, resolve, reject);
2693
+ } else {
2694
+ resolve(returnValue);
2695
+ }
2696
+ }
2697
+ };
2698
+ return _thenable;
2699
+ } else {
2700
+ // Since we're inside a nested `act` scope, the returned thenable
2701
+ // immediately resolves. The outer scope will flush the queue.
2702
+ var _thenable2 = {
2703
+ then: function (resolve, reject) {
2704
+ resolve(returnValue);
2705
+ }
2706
+ };
2707
+ return _thenable2;
2708
+ }
2709
+ }
2710
+ }
2711
+ }
2712
+
2713
+ function popActScope(prevActScopeDepth) {
2714
+ {
2715
+ if (prevActScopeDepth !== actScopeDepth - 1) {
2716
+ error('You seem to have overlapping act() calls, this is not supported. ' + 'Be sure to await previous act() calls before making a new one. ');
2717
+ }
2718
+
2719
+ actScopeDepth = prevActScopeDepth;
2720
+ }
2721
+ }
2722
+
2723
+ function recursivelyFlushAsyncActWork(returnValue, resolve, reject) {
2724
+ {
2725
+ var queue = ReactCurrentActQueue.current;
2726
+
2727
+ if (queue !== null) {
2728
+ try {
2729
+ flushActQueue(queue);
2730
+ enqueueTask(function () {
2731
+ if (queue.length === 0) {
2732
+ // No additional work was scheduled. Finish.
2733
+ ReactCurrentActQueue.current = null;
2734
+ resolve(returnValue);
2735
+ } else {
2736
+ // Keep flushing work until there's none left.
2737
+ recursivelyFlushAsyncActWork(returnValue, resolve, reject);
2738
+ }
2739
+ });
2740
+ } catch (error) {
2741
+ reject(error);
2742
+ }
2743
+ } else {
2744
+ resolve(returnValue);
2745
+ }
2746
+ }
2747
+ }
2748
+
2749
+ var isFlushing = false;
2750
+
2751
+ function flushActQueue(queue) {
2752
+ {
2753
+ if (!isFlushing) {
2754
+ // Prevent re-entrance.
2755
+ isFlushing = true;
2756
+ var i = 0;
2757
+
2758
+ try {
2759
+ for (; i < queue.length; i++) {
2760
+ var callback = queue[i];
2761
+
2762
+ do {
2763
+ callback = callback(true);
2764
+ } while (callback !== null);
2765
+ }
2766
+
2767
+ queue.length = 0;
2768
+ } catch (error) {
2769
+ // If something throws, leave the remaining callbacks on the queue.
2770
+ queue = queue.slice(i + 1);
2771
+ throw error;
2772
+ } finally {
2773
+ isFlushing = false;
2774
+ }
2775
+ }
2776
+ }
2777
+ }
2778
+
2779
+ var createElement$1 = createElementWithValidation ;
2780
+ var cloneElement$1 = cloneElementWithValidation ;
2781
+ var createFactory = createFactoryWithValidation ;
2782
+ var Children = {
2783
+ map: mapChildren,
2784
+ forEach: forEachChildren,
2785
+ count: countChildren,
2786
+ toArray: toArray,
2787
+ only: onlyChild
2788
+ };
2789
+
2790
+ exports.Children = Children;
2791
+ exports.Component = Component;
2792
+ exports.Fragment = REACT_FRAGMENT_TYPE;
2793
+ exports.Profiler = REACT_PROFILER_TYPE;
2794
+ exports.PureComponent = PureComponent;
2795
+ exports.StrictMode = REACT_STRICT_MODE_TYPE;
2796
+ exports.Suspense = REACT_SUSPENSE_TYPE;
2797
+ exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = ReactSharedInternals;
2798
+ exports.cloneElement = cloneElement$1;
2799
+ exports.createContext = createContext;
2800
+ exports.createElement = createElement$1;
2801
+ exports.createFactory = createFactory;
2802
+ exports.createRef = createRef;
2803
+ exports.forwardRef = forwardRef;
2804
+ exports.isValidElement = isValidElement;
2805
+ exports.lazy = lazy;
2806
+ exports.memo = memo;
2807
+ exports.startTransition = startTransition;
2808
+ exports.unstable_act = act;
2809
+ exports.useCallback = useCallback;
2810
+ exports.useContext = useContext;
2811
+ exports.useDebugValue = useDebugValue;
2812
+ exports.useDeferredValue = useDeferredValue;
2813
+ exports.useEffect = useEffect;
2814
+ exports.useId = useId;
2815
+ exports.useImperativeHandle = useImperativeHandle;
2816
+ exports.useInsertionEffect = useInsertionEffect;
2817
+ exports.useLayoutEffect = useLayoutEffect;
2818
+ exports.useMemo = useMemo;
2819
+ exports.useReducer = useReducer;
2820
+ exports.useRef = useRef;
2821
+ exports.useState = useState;
2822
+ exports.useSyncExternalStore = useSyncExternalStore;
2823
+ exports.useTransition = useTransition;
2824
+ exports.version = ReactVersion;
2825
+ /* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */
2826
+ if (
2827
+ typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined' &&
2828
+ typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop ===
2829
+ 'function'
2830
+ ) {
2831
+ __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error());
2832
+ }
2833
+
2834
+ })();
2835
+ }
2836
+ } (react_development, react_development.exports));
2837
+ return react_development.exports;
2838
+ }
2839
+
2840
+ if (process.env.NODE_ENV === 'production') {
2841
+ react.exports = requireReact_production_min();
2842
+ } else {
2843
+ react.exports = requireReact_development();
2844
+ }
2845
+
2846
+ var reactExports = react.exports;
2847
+ var React = /*@__PURE__*/getDefaultExportFromCjs(reactExports);
2848
+
2849
+ var Button = function (_a) {
2850
+ var label = _a.label, variant = _a.variant, size = _a.size; _a.state; var rounded = _a.rounded, left = _a.left, right = _a.right, rest = __rest(_a, ["label", "variant", "size", "state", "rounded", "left", "right"]);
2851
+ var radius; // size
2852
+ var text;
2853
+ var border = "";
2854
+ var padding;
2855
+ var color;
2856
+ var shadow = "";
2857
+ // variant
2858
+ if (variant === "danger") {
2859
+ color = "active:bg-bia-red-active hover:bg-bia-red-hover disabled:bg-bia-red-disabled bg-bia-red";
2860
+ text = "text-primary-light";
2861
+ shadow = "shadow-[0_6px_18px_1px_rgba(0,0,0,0.5)] shadow-bia-red-disabled";
2862
+ }
2863
+ else if (variant === "info") {
2864
+ color = "active:bg-bia-teal-active hover:bg-bia-teal-hover disabled:bg-bia-teal-disabled bg-bia-teal ";
2865
+ text = "text-primary-light";
2866
+ shadow = "shadow-[0_6px_18px_1px_rgba(0,0,0,0.5)] shadow-bia-teal-disabled";
2867
+ }
2868
+ else if (variant === "primary") {
2869
+ color = "hover:bg-bia-blue-hover disabled:bg-bia-blue-disabled bg-bia-blue active:bg-bia-blue-active";
2870
+ text = "text-primary-light";
2871
+ shadow = "shadow-[0_6px_18px_1px_rgba(0,0,0,0.5)] shadow-bia-blue-disabled";
2872
+ }
2873
+ else if (variant === "warning") {
2874
+ color = "hover:bg-bia-orange-hover disabled:bg-bia-orange-disabled bg-bia-orange active:bg-bia-orange-active";
2875
+ text = "text-primary-light";
2876
+ shadow = "shadow-[0_6px_18px_1px_rgba(0,0,0,0.5)] shadow-bia-orange-disabled";
2877
+ }
2878
+ else if (variant === "success") {
2879
+ color = "hover:bg-bia-green-hover disabled:bg-bia-green-disabled bg-bia-green active:bg-bia-green-active";
2880
+ text = "text-primary-light";
2881
+ shadow = "shadow-[0_6px_18px_1px_rgba(0,0,0,0.5)] shadow-bia-green-disabled";
2882
+ }
2883
+ else if (variant === "link") {
2884
+ color = "bg-transparent";
2885
+ text = "hover:text-bia-blue-hover text-bia-blue";
2886
+ }
2887
+ else if (variant === "subtle-link") {
2888
+ color = "bg-transparent";
2889
+ text = "hover:text-bia-blue-hover text-bia-darkgray";
2890
+ }
2891
+ else if (variant === "subtle") {
2892
+ color = "bg-bia-gray-disabled";
2893
+ text = "hover:bg-bia-gray-hover text-bia-darkgray";
2894
+ }
2895
+ else {
2896
+ color = "hover:bg-bia-gray-hover bg-bia-gray active:bg-bia-gray-active";
2897
+ text = "text-primary-dark";
2898
+ shadow = "shadow-[0_6px_18px_1px_rgba(0,0,0,0.5)] shadow-bia-gray-disabled";
2899
+ }
2900
+ if (variant === "danger-outlined") {
2901
+ text = "text-bia-red active:text-bia-red-active hover:text-bia-red-hover";
2902
+ border = "border-solid border border-bia-red active:border-bia-red-active hover:border-bia-red-hover";
2903
+ color = "active:bg-bia-red-pastel bg-primary-light";
2904
+ }
2905
+ else if (variant === "info-outlined") {
2906
+ text = "text-bia-teal active:text-bia-teal-active hover:text-bia-teal-hover";
2907
+ border = "border-solid border border-bia-teal active:border-bia-teal-active hover:border-bia-teal-hover";
2908
+ color = "active:bg-bia-teal-pastel bg-primary-light";
2909
+ }
2910
+ else if (variant === "primary-outlined") {
2911
+ text = "text-bia-blue active:text-bia-blue-active hover:text-bia-blue-hover";
2912
+ border = "border-solid border border-bia-blue active:border-bia-blue-active hover:border-bia-blue-hover";
2913
+ color = "active:bg-bia-blue-pastel bg-primary-light";
2914
+ }
2915
+ else if (variant === "warning-outlined") {
2916
+ text = "text-bia-orange active:text-bia-orange-active hover:text-bia-orange-hover";
2917
+ border = "border-solid border border-bia-orange active:border-bia-orange-active hover:border-bia-orange-hover";
2918
+ color = "active:bg-bia-orange-pastel bg-primary-light";
2919
+ }
2920
+ else if (variant === "success-outlined") {
2921
+ text = "text-bia-green active:text-bia-green-active hover:text-bia-green-hover";
2922
+ border = "border-solid border border-bia-green active:border-bia-green-active hover:border-bia-green-hover";
2923
+ color = "active:bg-bia-green-pastel bg-primary-light";
2924
+ }
2925
+ else if (variant === "default-outlined") {
2926
+ text = "text-primary-dark";
2927
+ border = "border-solid border border-bia-darkgray";
2928
+ color = "hover:bg-bia-darkgray-pastel bg-primary-light";
2929
+ }
2930
+ // type
2931
+ rounded ? radius = "rounded-[1.5rem]" : radius = "rounded-[0.19rem]";
2932
+ // size
2933
+ if (size === "large") {
2934
+ text += " text-2xl";
2935
+ padding = "p-[0.81rem]";
2936
+ }
2937
+ else if (size === "small") {
2938
+ text += " text-xs";
2939
+ padding = "py-[0.44rem] px-[0.63rem]";
2940
+ }
2941
+ else if (size === "tiny") {
2942
+ text += " text-xs";
2943
+ padding = "py-[0.13rem] px-1";
2944
+ }
2945
+ else {
2946
+ text += " text-sm";
2947
+ padding = "py-[0.62rem] px-[0.63rem]";
2948
+ }
2949
+ // state
2950
+ if (rest.disabled) {
2951
+ shadow = "";
2952
+ }
2953
+ return React.createElement("button", __assign({}, rest, { className: "button flex p- justify-center align-middle gap-[5px] font-semibold font-['Segoe UI'] ".concat(radius, " ").concat(text, " ").concat(padding, " ").concat(color, " ").concat(border, " ").concat(shadow) }),
2954
+ left,
2955
+ label,
2956
+ right);
2957
+ };
2958
+
2959
+ var Dump = function () {
2960
+ return (React.createElement("div", null,
2961
+ React.createElement("div", { className: "bg-bia-red text-bia-red" }),
2962
+ React.createElement("div", { className: "bg-bia-red-hover text-bia-red-hover" }),
2963
+ React.createElement("div", { className: "bg-bia-red-active text-bia-red-active" }),
2964
+ React.createElement("div", { className: "bg-bia-red-pastel text-bia-red-pastel" }),
2965
+ React.createElement("div", { className: "bg-bia-red-disabled text-bia-red-disabled" }),
2966
+ React.createElement("div", { className: "bg-bia-blue text-bia-blue" }),
2967
+ React.createElement("div", { className: "bg-bia-blue-hover text-bia-blue-hover" }),
2968
+ React.createElement("div", { className: "bg-bia-blue-active text-bia-blue-active" }),
2969
+ React.createElement("div", { className: "bg-bia-blue-pastel text-bia-blue-pastel" }),
2970
+ React.createElement("div", { className: "bg-bia-blue-disabled text-bia-blue-disabled" }),
2971
+ React.createElement("div", { className: "bg-bia-yellow" }),
2972
+ React.createElement("div", { className: "bg-bia-yellow-hover" }),
2973
+ React.createElement("div", { className: "bg-bia-yellow-active" }),
2974
+ React.createElement("div", { className: "bg-bia-yellow-pastel" }),
2975
+ React.createElement("div", { className: "bg-bia-yellow-disabled" }),
2976
+ React.createElement("div", { className: "bg-bia-green" }),
2977
+ React.createElement("div", { className: "bg-bia-green-hover" }),
2978
+ React.createElement("div", { className: "bg-bia-green-active" }),
2979
+ React.createElement("div", { className: "bg-bia-green-pastel" }),
2980
+ React.createElement("div", { className: "bg-bia-green-disabled" }),
2981
+ React.createElement("div", { className: "bg-bia-teal" }),
2982
+ React.createElement("div", { className: "bg-bia-teal-hover" }),
2983
+ React.createElement("div", { className: "bg-bia-teal-active" }),
2984
+ React.createElement("div", { className: "bg-bia-teal-pastel" }),
2985
+ React.createElement("div", { className: "bg-bia-teal-disabled" }),
2986
+ React.createElement("div", { className: "bg-bia-purple" }),
2987
+ React.createElement("div", { className: "bg-bia-purple-hover" }),
2988
+ React.createElement("div", { className: "bg-bia-purple-active" }),
2989
+ React.createElement("div", { className: "bg-bia-purple-pastel" }),
2990
+ React.createElement("div", { className: "bg-bia-purple-disabled" }),
2991
+ React.createElement("div", { className: "bg-bia-gray" }),
2992
+ React.createElement("div", { className: "bg-bia-gray-hover" }),
2993
+ React.createElement("div", { className: "bg-bia-gray-active" }),
2994
+ React.createElement("div", { className: "bg-bia-gray-pastel" }),
2995
+ React.createElement("div", { className: "bg-bia-gray-disabled" }),
2996
+ React.createElement("div", { className: "bg-bia-darkgray" }),
2997
+ React.createElement("div", { className: "bg-bia-darkgray-hover" }),
2998
+ React.createElement("div", { className: "bg-bia-darkgray-active" }),
2999
+ React.createElement("div", { className: "bg-bia-darkgray-pastel" }),
3000
+ React.createElement("div", { className: "bg-bia-darkgray-disabled" }),
3001
+ React.createElement("div", { className: "bg-bia-sky" }),
3002
+ React.createElement("div", { className: "bg-bia-sky-hover" }),
3003
+ React.createElement("div", { className: "bg-bia-sky-active" }),
3004
+ React.createElement("div", { className: "bg-bia-sky-pastel" }),
3005
+ React.createElement("div", { className: "bg-bia-sky-disabled" }),
3006
+ React.createElement("div", { className: "bg-bia-orange" }),
3007
+ React.createElement("div", { className: "bg-bia-orange-hover" }),
3008
+ React.createElement("div", { className: "bg-bia-orange-active" }),
3009
+ React.createElement("div", { className: "bg-bia-orange-pastel" }),
3010
+ React.createElement("div", { className: "bg-bia-orange-disabled" }),
3011
+ React.createElement("div", { className: "bg-bia-olympicblue" }),
3012
+ React.createElement("div", { className: "bg-bia-olympicblue-hover" }),
3013
+ React.createElement("div", { className: "bg-bia-olympicblue-active" }),
3014
+ React.createElement("div", { className: "bg-bia-olympicblue-pastel" }),
3015
+ React.createElement("div", { className: "bg-bia-olympicblue-disabled" }),
3016
+ React.createElement("div", { className: "bg-bia-verdantgreen" }),
3017
+ React.createElement("div", { className: "bg-bia-verdantgreen-hover" }),
3018
+ React.createElement("div", { className: "bg-bia-verdantgreen-active" }),
3019
+ React.createElement("div", { className: "bg-bia-verdantgreen-pastel" }),
3020
+ React.createElement("div", { className: "bg-bia-verdantgreen-disabled" }),
3021
+ React.createElement("div", { className: "bg-bia-marquetteblue" }),
3022
+ React.createElement("div", { className: "bg-bia-marquetteblue-hover" }),
3023
+ React.createElement("div", { className: "bg-bia-marquetteblue-active" }),
3024
+ React.createElement("div", { className: "bg-bia-marquetteblue-pastel" }),
3025
+ React.createElement("div", { className: "bg-bia-marquetteblue-disabled" }),
3026
+ React.createElement("div", { className: "bg-primary-dark" }),
3027
+ React.createElement("div", { className: "bg-primary-cool" }),
3028
+ React.createElement("div", { className: "bg-primary-warm" }),
3029
+ React.createElement("div", { className: "bg-primary-light" })));
3030
+ };
3031
+
3032
+ var TextInput = function (_a) {
3033
+ _a.variant; var label = _a.label; _a.important; var descText = _a.descText, errText = _a.errText, icon = _a.icon, rest = __rest(_a, ["variant", "label", "important", "descText", "errText", "icon"]);
3034
+ var iconPic;
3035
+ var iconColor;
3036
+ var pad = true;
3037
+ if (errText) {
3038
+ React.createElement("span", { className: "error-text text-xs" }, errText);
3039
+ }
3040
+ if (rest.placeholder === undefined) {
3041
+ rest.placeholder = label;
3042
+ }
3043
+ if (rest.disabled) {
3044
+ iconColor = "#8b8ba6";
3045
+ }
3046
+ else if (rest.readOnly) {
3047
+ iconColor = "#cbd0e0";
3048
+ }
3049
+ else {
3050
+ iconColor = "#CBD0E0";
3051
+ }
3052
+ if (rest.type === "password") {
3053
+ iconPic = React.createElement("button", { type: "button", onClick: function () { } },
3054
+ React.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: "18", height: "18", viewBox: "0 0 18 18", fill: "none" },
3055
+ React.createElement("path", { d: "M15 8.99994C15 7.64244 12.18 6.01119 8.99475 5.99994C5.83125 5.98869 3 7.63344 3 8.99994C3 10.3687 5.8155 12.0044 8.99775 11.9999C12.189 11.9954 15 10.3649 15 8.99994ZM9 13.4999C5.2185 13.5052 1.5 11.4854 1.5 8.99994C1.5 6.51444 5.238 4.48719 9 4.49994C12.762 4.51269 16.5 6.51444 16.5 8.99994C16.5 11.4854 12.7815 13.4947 9 13.4999ZM9 11.9999C8.20435 11.9999 7.44129 11.6839 6.87868 11.1213C6.31607 10.5587 6 9.79559 6 8.99994C6 8.20429 6.31607 7.44123 6.87868 6.87862C7.44129 6.31601 8.20435 5.99994 9 5.99994C9.79565 5.99994 10.5587 6.31601 11.1213 6.87862C11.6839 7.44123 12 8.20429 12 8.99994C12 9.79559 11.6839 10.5587 11.1213 11.1213C10.5587 11.6839 9.79565 11.9999 9 11.9999ZM9 10.4999C9.39782 10.4999 9.77936 10.3419 10.0607 10.0606C10.342 9.77929 10.5 9.39776 10.5 8.99994C10.5 8.60211 10.342 8.22058 10.0607 7.93928C9.77936 7.65797 9.39782 7.49994 9 7.49994C8.60218 7.49994 8.22064 7.65797 7.93934 7.93928C7.65804 8.22058 7.5 8.60211 7.5 8.99994C7.5 9.39776 7.65804 9.77929 7.93934 10.0606C8.22064 10.3419 8.60218 10.4999 9 10.4999Z", fill: iconColor })));
3056
+ }
3057
+ else if (rest.type === "number" || rest.type === "date") {
3058
+ pad = false;
3059
+ }
3060
+ else if (icon === undefined) {
3061
+ iconPic =
3062
+ React.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: "18", height: "18", viewBox: "0 0 18 18", fill: "none" },
3063
+ React.createElement("path", { d: "M4.5 3C4.10218 3 3.72064 3.15804 3.43934 3.43934C3.15804 3.72064 3 4.10218 3 4.5V13.5C3 13.8978 3.15804 14.2794 3.43934 14.5607C3.72064 14.842 4.10218 15 4.5 15H13.5C13.8978 15 14.2794 14.842 14.5607 14.5607C14.842 14.2794 15 13.8978 15 13.5V4.5C15 4.10218 14.842 3.72064 14.5607 3.43934C14.2794 3.15804 13.8978 3 13.5 3H4.5ZM4.5 1.5H13.5C14.2956 1.5 15.0587 1.81607 15.6213 2.37868C16.1839 2.94129 16.5 3.70435 16.5 4.5V13.5C16.5 14.2956 16.1839 15.0587 15.6213 15.6213C15.0587 16.1839 14.2956 16.5 13.5 16.5H4.5C3.70435 16.5 2.94129 16.1839 2.37868 15.6213C1.81607 15.0587 1.5 14.2956 1.5 13.5V4.5C1.5 3.70435 1.81607 2.94129 2.37868 2.37868C2.94129 1.81607 3.70435 1.5 4.5 1.5V1.5Z", fill: iconColor }));
3064
+ }
3065
+ else {
3066
+ iconPic = icon;
3067
+ }
3068
+ return (React.createElement("div", { className: "field-group w-full flex flex-col" },
3069
+ React.createElement("label", { htmlFor: rest.id, className: "label pb-2" },
3070
+ label,
3071
+ rest.required && React.createElement("span", { className: "p-1 text-bia-red" }, "*")),
3072
+ React.createElement("div", { className: "w-full h-full" },
3073
+ React.createElement("input", __assign({ className: "field bg-primary-light disabled:bg-[#ebecf0] disabled:text-bia-gray-active read-only:border-bia-gray-disabled read-only:pointer-events-none p-2 ".concat(pad && "pe-8", " w-full border border-[#cbd0e0] enabled:hover:border-b-bia-blue enabled:hover:rounded-b-none enabled:focus:border-b-bia-blue enabled:focus:rounded-b-none focus-visible:outline-none rounded") }, rest)),
3074
+ React.createElement("div", { className: "absolute inset-y-0 right-2 pl-3 flex items-center ".concat(rest.type === "password" ? "" : "pointer-events-none") }, iconPic)),
3075
+ React.createElement("span", { className: "desc text-primary-cool text-xs" }, descText)));
3076
+ };
3077
+
3078
+ var Radio = function (_a) {
3079
+ var label = _a.label; _a.data; __rest(_a, ["label", "data"]);
3080
+ return (React.createElement("div", { className: "flex items-center" },
3081
+ React.createElement("div", { className: "bg-white rounded-full w-6 h-6 flex flex-shrink-0 justify-center items-center relative" },
3082
+ React.createElement("input", { "aria-labelledby": "label1", type: "radio", name: "radio", className: "peer checkbox box-content appearance-none focus:opacity-100 focus:ring-1 focus:ring-offset-2 focus:ring-bia-blue focus:outline-none rounded-full border-bia-gray checked:border-bia-blue hover:border-bia-blue-hover border-2 absolute cursor-pointer w-full h-full checked:border-none" }),
3083
+ React.createElement("div", { className: "check-icon hidden peer-checked:block border-2 border-bia-blue peer-checked:hover:border-bia-blue-hover bg-primary-light outline-2 peer-checked:hover:outline-bia-blue-hover outline-bia-blue rounded-full w-full h-full z-1" },
3084
+ React.createElement("div", { className: "w-full h-full bg-bia-blue peer-checked:hover:bg-bia-blue-hover rounded-full border-primary-light border-2" }))),
3085
+ React.createElement("label", { id: "label1", className: "ml-2 text-sm leading-4 font-normal text-gray-800" }, label)));
3086
+ };
3087
+
3088
+ exports.Button = Button;
3089
+ exports.Color = Dump;
3090
+ exports.Radio = Radio;
3091
+ exports.TextInput = TextInput;