@micromerce/media-fileuploader 1.0.1893 → 1.0.1900

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cjs/index.js CHANGED
@@ -1,1382 +1,8 @@
1
1
  'use strict';
2
2
 
3
+ var jsxRuntime = require('react/jsx-runtime');
3
4
  var r$1 = require('react');
4
5
 
5
- var global$1 = (typeof global !== "undefined" ? global :
6
- typeof self !== "undefined" ? self :
7
- typeof window !== "undefined" ? window : {});
8
-
9
- var env = {};
10
-
11
- // from https://github.com/kumavis/browser-process-hrtime/blob/master/index.js
12
- var performance = global$1.performance || {};
13
- performance.now ||
14
- performance.mozNow ||
15
- performance.msNow ||
16
- performance.oNow ||
17
- performance.webkitNow ||
18
- function(){ return (new Date()).getTime() };
19
-
20
- var browser$1 = {
21
- env: env};
22
-
23
- var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
24
-
25
- function getDefaultExportFromCjs (x) {
26
- return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
27
- }
28
-
29
- function getAugmentedNamespace(n) {
30
- if (n.__esModule) return n;
31
- var f = n.default;
32
- if (typeof f == "function") {
33
- var a = function a () {
34
- if (this instanceof a) {
35
- return Reflect.construct(f, arguments, this.constructor);
36
- }
37
- return f.apply(this, arguments);
38
- };
39
- a.prototype = f.prototype;
40
- } else a = {};
41
- Object.defineProperty(a, '__esModule', {value: true});
42
- Object.keys(n).forEach(function (k) {
43
- var d = Object.getOwnPropertyDescriptor(n, k);
44
- Object.defineProperty(a, k, d.get ? d : {
45
- enumerable: true,
46
- get: function () {
47
- return n[k];
48
- }
49
- });
50
- });
51
- return a;
52
- }
53
-
54
- var jsxRuntime = {exports: {}};
55
-
56
- var reactJsxRuntime_production_min = {};
57
-
58
- /**
59
- * @license React
60
- * react-jsx-runtime.production.min.js
61
- *
62
- * Copyright (c) Facebook, Inc. and its affiliates.
63
- *
64
- * This source code is licensed under the MIT license found in the
65
- * LICENSE file in the root directory of this source tree.
66
- */
67
-
68
- var hasRequiredReactJsxRuntime_production_min;
69
-
70
- function requireReactJsxRuntime_production_min () {
71
- if (hasRequiredReactJsxRuntime_production_min) return reactJsxRuntime_production_min;
72
- hasRequiredReactJsxRuntime_production_min = 1;
73
- var f=r$1,k=Symbol.for("react.element"),l=Symbol.for("react.fragment"),m=Object.prototype.hasOwnProperty,n=f.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,p={key:true,ref:true,__self:true,__source:true};
74
- function q(c,a,g){var b,d={},e=null,h=null;void 0!==g&&(e=""+g);void 0!==a.key&&(e=""+a.key);void 0!==a.ref&&(h=a.ref);for(b in a)m.call(a,b)&&!p.hasOwnProperty(b)&&(d[b]=a[b]);if(c&&c.defaultProps)for(b in a=c.defaultProps,a) void 0===d[b]&&(d[b]=a[b]);return {$$typeof:k,type:c,key:e,ref:h,props:d,_owner:n.current}}reactJsxRuntime_production_min.Fragment=l;reactJsxRuntime_production_min.jsx=q;reactJsxRuntime_production_min.jsxs=q;
75
- return reactJsxRuntime_production_min;
76
- }
77
-
78
- var reactJsxRuntime_development = {};
79
-
80
- var hasRequiredReactJsxRuntime_development;
81
-
82
- function requireReactJsxRuntime_development () {
83
- if (hasRequiredReactJsxRuntime_development) return reactJsxRuntime_development;
84
- hasRequiredReactJsxRuntime_development = 1;
85
-
86
- if (browser$1.env.NODE_ENV !== "production") {
87
- (function() {
88
-
89
- var React = r$1;
90
-
91
- // ATTENTION
92
- // When adding new symbols to this file,
93
- // Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols'
94
- // The Symbol used to tag the ReactElement-like types.
95
- var REACT_ELEMENT_TYPE = Symbol.for('react.element');
96
- var REACT_PORTAL_TYPE = Symbol.for('react.portal');
97
- var REACT_FRAGMENT_TYPE = Symbol.for('react.fragment');
98
- var REACT_STRICT_MODE_TYPE = Symbol.for('react.strict_mode');
99
- var REACT_PROFILER_TYPE = Symbol.for('react.profiler');
100
- var REACT_PROVIDER_TYPE = Symbol.for('react.provider');
101
- var REACT_CONTEXT_TYPE = Symbol.for('react.context');
102
- var REACT_FORWARD_REF_TYPE = Symbol.for('react.forward_ref');
103
- var REACT_SUSPENSE_TYPE = Symbol.for('react.suspense');
104
- var REACT_SUSPENSE_LIST_TYPE = Symbol.for('react.suspense_list');
105
- var REACT_MEMO_TYPE = Symbol.for('react.memo');
106
- var REACT_LAZY_TYPE = Symbol.for('react.lazy');
107
- var REACT_OFFSCREEN_TYPE = Symbol.for('react.offscreen');
108
- var MAYBE_ITERATOR_SYMBOL = Symbol.iterator;
109
- var FAUX_ITERATOR_SYMBOL = '@@iterator';
110
- function getIteratorFn(maybeIterable) {
111
- if (maybeIterable === null || typeof maybeIterable !== 'object') {
112
- return null;
113
- }
114
-
115
- var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL];
116
-
117
- if (typeof maybeIterator === 'function') {
118
- return maybeIterator;
119
- }
120
-
121
- return null;
122
- }
123
-
124
- var ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
125
-
126
- function error(format) {
127
- {
128
- {
129
- for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
130
- args[_key2 - 1] = arguments[_key2];
131
- }
132
-
133
- printWarning('error', format, args);
134
- }
135
- }
136
- }
137
-
138
- function printWarning(level, format, args) {
139
- // When changing this logic, you might want to also
140
- // update consoleWithStackDev.www.js as well.
141
- {
142
- var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
143
- var stack = ReactDebugCurrentFrame.getStackAddendum();
144
-
145
- if (stack !== '') {
146
- format += '%s';
147
- args = args.concat([stack]);
148
- } // eslint-disable-next-line react-internal/safe-string-coercion
149
-
150
-
151
- var argsWithFormat = args.map(function (item) {
152
- return String(item);
153
- }); // Careful: RN currently depends on this prefix
154
-
155
- argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it
156
- // breaks IE9: https://github.com/facebook/react/issues/13610
157
- // eslint-disable-next-line react-internal/no-production-logging
158
-
159
- Function.prototype.apply.call(console[level], console, argsWithFormat);
160
- }
161
- }
162
-
163
- // -----------------------------------------------------------------------------
164
-
165
- var enableScopeAPI = false; // Experimental Create Event Handle API.
166
- var enableCacheElement = false;
167
- var enableTransitionTracing = false; // No known bugs, but needs performance testing
168
-
169
- var enableLegacyHidden = false; // Enables unstable_avoidThisFallback feature in Fiber
170
- // stuff. Intended to enable React core members to more easily debug scheduling
171
- // issues in DEV builds.
172
-
173
- var enableDebugTracing = false; // Track which Fiber(s) schedule render work.
174
-
175
- var REACT_MODULE_REFERENCE;
176
-
177
- {
178
- REACT_MODULE_REFERENCE = Symbol.for('react.module.reference');
179
- }
180
-
181
- function isValidElementType(type) {
182
- if (typeof type === 'string' || typeof type === 'function') {
183
- return true;
184
- } // Note: typeof might be other than 'symbol' or 'number' (e.g. if it's a polyfill).
185
-
186
-
187
- 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 ) {
188
- return true;
189
- }
190
-
191
- if (typeof type === 'object' && type !== null) {
192
- 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
193
- // types supported by any Flight configuration anywhere since
194
- // we don't know which Flight build this will end up being used
195
- // with.
196
- type.$$typeof === REACT_MODULE_REFERENCE || type.getModuleId !== undefined) {
197
- return true;
198
- }
199
- }
200
-
201
- return false;
202
- }
203
-
204
- function getWrappedName(outerType, innerType, wrapperName) {
205
- var displayName = outerType.displayName;
206
-
207
- if (displayName) {
208
- return displayName;
209
- }
210
-
211
- var functionName = innerType.displayName || innerType.name || '';
212
- return functionName !== '' ? wrapperName + "(" + functionName + ")" : wrapperName;
213
- } // Keep in sync with react-reconciler/getComponentNameFromFiber
214
-
215
-
216
- function getContextName(type) {
217
- return type.displayName || 'Context';
218
- } // Note that the reconciler package should generally prefer to use getComponentNameFromFiber() instead.
219
-
220
-
221
- function getComponentNameFromType(type) {
222
- if (type == null) {
223
- // Host root, text node or just invalid type.
224
- return null;
225
- }
226
-
227
- {
228
- if (typeof type.tag === 'number') {
229
- error('Received an unexpected object in getComponentNameFromType(). ' + 'This is likely a bug in React. Please file an issue.');
230
- }
231
- }
232
-
233
- if (typeof type === 'function') {
234
- return type.displayName || type.name || null;
235
- }
236
-
237
- if (typeof type === 'string') {
238
- return type;
239
- }
240
-
241
- switch (type) {
242
- case REACT_FRAGMENT_TYPE:
243
- return 'Fragment';
244
-
245
- case REACT_PORTAL_TYPE:
246
- return 'Portal';
247
-
248
- case REACT_PROFILER_TYPE:
249
- return 'Profiler';
250
-
251
- case REACT_STRICT_MODE_TYPE:
252
- return 'StrictMode';
253
-
254
- case REACT_SUSPENSE_TYPE:
255
- return 'Suspense';
256
-
257
- case REACT_SUSPENSE_LIST_TYPE:
258
- return 'SuspenseList';
259
-
260
- }
261
-
262
- if (typeof type === 'object') {
263
- switch (type.$$typeof) {
264
- case REACT_CONTEXT_TYPE:
265
- var context = type;
266
- return getContextName(context) + '.Consumer';
267
-
268
- case REACT_PROVIDER_TYPE:
269
- var provider = type;
270
- return getContextName(provider._context) + '.Provider';
271
-
272
- case REACT_FORWARD_REF_TYPE:
273
- return getWrappedName(type, type.render, 'ForwardRef');
274
-
275
- case REACT_MEMO_TYPE:
276
- var outerName = type.displayName || null;
277
-
278
- if (outerName !== null) {
279
- return outerName;
280
- }
281
-
282
- return getComponentNameFromType(type.type) || 'Memo';
283
-
284
- case REACT_LAZY_TYPE:
285
- {
286
- var lazyComponent = type;
287
- var payload = lazyComponent._payload;
288
- var init = lazyComponent._init;
289
-
290
- try {
291
- return getComponentNameFromType(init(payload));
292
- } catch (x) {
293
- return null;
294
- }
295
- }
296
-
297
- // eslint-disable-next-line no-fallthrough
298
- }
299
- }
300
-
301
- return null;
302
- }
303
-
304
- var assign = Object.assign;
305
-
306
- // Helpers to patch console.logs to avoid logging during side-effect free
307
- // replaying on render function. This currently only patches the object
308
- // lazily which won't cover if the log function was extracted eagerly.
309
- // We could also eagerly patch the method.
310
- var disabledDepth = 0;
311
- var prevLog;
312
- var prevInfo;
313
- var prevWarn;
314
- var prevError;
315
- var prevGroup;
316
- var prevGroupCollapsed;
317
- var prevGroupEnd;
318
-
319
- function disabledLog() {}
320
-
321
- disabledLog.__reactDisabledLog = true;
322
- function disableLogs() {
323
- {
324
- if (disabledDepth === 0) {
325
- /* eslint-disable react-internal/no-production-logging */
326
- prevLog = console.log;
327
- prevInfo = console.info;
328
- prevWarn = console.warn;
329
- prevError = console.error;
330
- prevGroup = console.group;
331
- prevGroupCollapsed = console.groupCollapsed;
332
- prevGroupEnd = console.groupEnd; // https://github.com/facebook/react/issues/19099
333
-
334
- var props = {
335
- configurable: true,
336
- enumerable: true,
337
- value: disabledLog,
338
- writable: true
339
- }; // $FlowFixMe Flow thinks console is immutable.
340
-
341
- Object.defineProperties(console, {
342
- info: props,
343
- log: props,
344
- warn: props,
345
- error: props,
346
- group: props,
347
- groupCollapsed: props,
348
- groupEnd: props
349
- });
350
- /* eslint-enable react-internal/no-production-logging */
351
- }
352
-
353
- disabledDepth++;
354
- }
355
- }
356
- function reenableLogs() {
357
- {
358
- disabledDepth--;
359
-
360
- if (disabledDepth === 0) {
361
- /* eslint-disable react-internal/no-production-logging */
362
- var props = {
363
- configurable: true,
364
- enumerable: true,
365
- writable: true
366
- }; // $FlowFixMe Flow thinks console is immutable.
367
-
368
- Object.defineProperties(console, {
369
- log: assign({}, props, {
370
- value: prevLog
371
- }),
372
- info: assign({}, props, {
373
- value: prevInfo
374
- }),
375
- warn: assign({}, props, {
376
- value: prevWarn
377
- }),
378
- error: assign({}, props, {
379
- value: prevError
380
- }),
381
- group: assign({}, props, {
382
- value: prevGroup
383
- }),
384
- groupCollapsed: assign({}, props, {
385
- value: prevGroupCollapsed
386
- }),
387
- groupEnd: assign({}, props, {
388
- value: prevGroupEnd
389
- })
390
- });
391
- /* eslint-enable react-internal/no-production-logging */
392
- }
393
-
394
- if (disabledDepth < 0) {
395
- error('disabledDepth fell below zero. ' + 'This is a bug in React. Please file an issue.');
396
- }
397
- }
398
- }
399
-
400
- var ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher;
401
- var prefix;
402
- function describeBuiltInComponentFrame(name, source, ownerFn) {
403
- {
404
- if (prefix === undefined) {
405
- // Extract the VM specific prefix used by each line.
406
- try {
407
- throw Error();
408
- } catch (x) {
409
- var match = x.stack.trim().match(/\n( *(at )?)/);
410
- prefix = match && match[1] || '';
411
- }
412
- } // We use the prefix to ensure our stacks line up with native stack frames.
413
-
414
-
415
- return '\n' + prefix + name;
416
- }
417
- }
418
- var reentry = false;
419
- var componentFrameCache;
420
-
421
- {
422
- var PossiblyWeakMap = typeof WeakMap === 'function' ? WeakMap : Map;
423
- componentFrameCache = new PossiblyWeakMap();
424
- }
425
-
426
- function describeNativeComponentFrame(fn, construct) {
427
- // If something asked for a stack inside a fake render, it should get ignored.
428
- if ( !fn || reentry) {
429
- return '';
430
- }
431
-
432
- {
433
- var frame = componentFrameCache.get(fn);
434
-
435
- if (frame !== undefined) {
436
- return frame;
437
- }
438
- }
439
-
440
- var control;
441
- reentry = true;
442
- var previousPrepareStackTrace = Error.prepareStackTrace; // $FlowFixMe It does accept undefined.
443
-
444
- Error.prepareStackTrace = undefined;
445
- var previousDispatcher;
446
-
447
- {
448
- previousDispatcher = ReactCurrentDispatcher.current; // Set the dispatcher in DEV because this might be call in the render function
449
- // for warnings.
450
-
451
- ReactCurrentDispatcher.current = null;
452
- disableLogs();
453
- }
454
-
455
- try {
456
- // This should throw.
457
- if (construct) {
458
- // Something should be setting the props in the constructor.
459
- var Fake = function () {
460
- throw Error();
461
- }; // $FlowFixMe
462
-
463
-
464
- Object.defineProperty(Fake.prototype, 'props', {
465
- set: function () {
466
- // We use a throwing setter instead of frozen or non-writable props
467
- // because that won't throw in a non-strict mode function.
468
- throw Error();
469
- }
470
- });
471
-
472
- if (typeof Reflect === 'object' && Reflect.construct) {
473
- // We construct a different control for this case to include any extra
474
- // frames added by the construct call.
475
- try {
476
- Reflect.construct(Fake, []);
477
- } catch (x) {
478
- control = x;
479
- }
480
-
481
- Reflect.construct(fn, [], Fake);
482
- } else {
483
- try {
484
- Fake.call();
485
- } catch (x) {
486
- control = x;
487
- }
488
-
489
- fn.call(Fake.prototype);
490
- }
491
- } else {
492
- try {
493
- throw Error();
494
- } catch (x) {
495
- control = x;
496
- }
497
-
498
- fn();
499
- }
500
- } catch (sample) {
501
- // This is inlined manually because closure doesn't do it for us.
502
- if (sample && control && typeof sample.stack === 'string') {
503
- // This extracts the first frame from the sample that isn't also in the control.
504
- // Skipping one frame that we assume is the frame that calls the two.
505
- var sampleLines = sample.stack.split('\n');
506
- var controlLines = control.stack.split('\n');
507
- var s = sampleLines.length - 1;
508
- var c = controlLines.length - 1;
509
-
510
- while (s >= 1 && c >= 0 && sampleLines[s] !== controlLines[c]) {
511
- // We expect at least one stack frame to be shared.
512
- // Typically this will be the root most one. However, stack frames may be
513
- // cut off due to maximum stack limits. In this case, one maybe cut off
514
- // earlier than the other. We assume that the sample is longer or the same
515
- // and there for cut off earlier. So we should find the root most frame in
516
- // the sample somewhere in the control.
517
- c--;
518
- }
519
-
520
- for (; s >= 1 && c >= 0; s--, c--) {
521
- // Next we find the first one that isn't the same which should be the
522
- // frame that called our sample function and the control.
523
- if (sampleLines[s] !== controlLines[c]) {
524
- // In V8, the first line is describing the message but other VMs don't.
525
- // If we're about to return the first line, and the control is also on the same
526
- // line, that's a pretty good indicator that our sample threw at same line as
527
- // the control. I.e. before we entered the sample frame. So we ignore this result.
528
- // This can happen if you passed a class to function component, or non-function.
529
- if (s !== 1 || c !== 1) {
530
- do {
531
- s--;
532
- c--; // We may still have similar intermediate frames from the construct call.
533
- // The next one that isn't the same should be our match though.
534
-
535
- if (c < 0 || sampleLines[s] !== controlLines[c]) {
536
- // V8 adds a "new" prefix for native classes. Let's remove it to make it prettier.
537
- var _frame = '\n' + sampleLines[s].replace(' at new ', ' at '); // If our component frame is labeled "<anonymous>"
538
- // but we have a user-provided "displayName"
539
- // splice it in to make the stack more readable.
540
-
541
-
542
- if (fn.displayName && _frame.includes('<anonymous>')) {
543
- _frame = _frame.replace('<anonymous>', fn.displayName);
544
- }
545
-
546
- {
547
- if (typeof fn === 'function') {
548
- componentFrameCache.set(fn, _frame);
549
- }
550
- } // Return the line we found.
551
-
552
-
553
- return _frame;
554
- }
555
- } while (s >= 1 && c >= 0);
556
- }
557
-
558
- break;
559
- }
560
- }
561
- }
562
- } finally {
563
- reentry = false;
564
-
565
- {
566
- ReactCurrentDispatcher.current = previousDispatcher;
567
- reenableLogs();
568
- }
569
-
570
- Error.prepareStackTrace = previousPrepareStackTrace;
571
- } // Fallback to just using the name if we couldn't make it throw.
572
-
573
-
574
- var name = fn ? fn.displayName || fn.name : '';
575
- var syntheticFrame = name ? describeBuiltInComponentFrame(name) : '';
576
-
577
- {
578
- if (typeof fn === 'function') {
579
- componentFrameCache.set(fn, syntheticFrame);
580
- }
581
- }
582
-
583
- return syntheticFrame;
584
- }
585
- function describeFunctionComponentFrame(fn, source, ownerFn) {
586
- {
587
- return describeNativeComponentFrame(fn, false);
588
- }
589
- }
590
-
591
- function shouldConstruct(Component) {
592
- var prototype = Component.prototype;
593
- return !!(prototype && prototype.isReactComponent);
594
- }
595
-
596
- function describeUnknownElementTypeFrameInDEV(type, source, ownerFn) {
597
-
598
- if (type == null) {
599
- return '';
600
- }
601
-
602
- if (typeof type === 'function') {
603
- {
604
- return describeNativeComponentFrame(type, shouldConstruct(type));
605
- }
606
- }
607
-
608
- if (typeof type === 'string') {
609
- return describeBuiltInComponentFrame(type);
610
- }
611
-
612
- switch (type) {
613
- case REACT_SUSPENSE_TYPE:
614
- return describeBuiltInComponentFrame('Suspense');
615
-
616
- case REACT_SUSPENSE_LIST_TYPE:
617
- return describeBuiltInComponentFrame('SuspenseList');
618
- }
619
-
620
- if (typeof type === 'object') {
621
- switch (type.$$typeof) {
622
- case REACT_FORWARD_REF_TYPE:
623
- return describeFunctionComponentFrame(type.render);
624
-
625
- case REACT_MEMO_TYPE:
626
- // Memo may contain any component type so we recursively resolve it.
627
- return describeUnknownElementTypeFrameInDEV(type.type, source, ownerFn);
628
-
629
- case REACT_LAZY_TYPE:
630
- {
631
- var lazyComponent = type;
632
- var payload = lazyComponent._payload;
633
- var init = lazyComponent._init;
634
-
635
- try {
636
- // Lazy may contain any component type so we recursively resolve it.
637
- return describeUnknownElementTypeFrameInDEV(init(payload), source, ownerFn);
638
- } catch (x) {}
639
- }
640
- }
641
- }
642
-
643
- return '';
644
- }
645
-
646
- var hasOwnProperty = Object.prototype.hasOwnProperty;
647
-
648
- var loggedTypeFailures = {};
649
- var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
650
-
651
- function setCurrentlyValidatingElement(element) {
652
- {
653
- if (element) {
654
- var owner = element._owner;
655
- var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);
656
- ReactDebugCurrentFrame.setExtraStackFrame(stack);
657
- } else {
658
- ReactDebugCurrentFrame.setExtraStackFrame(null);
659
- }
660
- }
661
- }
662
-
663
- function checkPropTypes(typeSpecs, values, location, componentName, element) {
664
- {
665
- // $FlowFixMe This is okay but Flow doesn't know it.
666
- var has = Function.call.bind(hasOwnProperty);
667
-
668
- for (var typeSpecName in typeSpecs) {
669
- if (has(typeSpecs, typeSpecName)) {
670
- var error$1 = void 0; // Prop type validation may throw. In case they do, we don't want to
671
- // fail the render phase where it didn't fail before. So we log it.
672
- // After these have been cleaned up, we'll let them throw.
673
-
674
- try {
675
- // This is intentionally an invariant that gets caught. It's the same
676
- // behavior as without this statement except with a better message.
677
- if (typeof typeSpecs[typeSpecName] !== 'function') {
678
- // eslint-disable-next-line react-internal/prod-error-codes
679
- 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`.');
680
- err.name = 'Invariant Violation';
681
- throw err;
682
- }
683
-
684
- error$1 = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED');
685
- } catch (ex) {
686
- error$1 = ex;
687
- }
688
-
689
- if (error$1 && !(error$1 instanceof Error)) {
690
- setCurrentlyValidatingElement(element);
691
-
692
- 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);
693
-
694
- setCurrentlyValidatingElement(null);
695
- }
696
-
697
- if (error$1 instanceof Error && !(error$1.message in loggedTypeFailures)) {
698
- // Only monitor this failure once because there tends to be a lot of the
699
- // same error.
700
- loggedTypeFailures[error$1.message] = true;
701
- setCurrentlyValidatingElement(element);
702
-
703
- error('Failed %s type: %s', location, error$1.message);
704
-
705
- setCurrentlyValidatingElement(null);
706
- }
707
- }
708
- }
709
- }
710
- }
711
-
712
- var isArrayImpl = Array.isArray; // eslint-disable-next-line no-redeclare
713
-
714
- function isArray(a) {
715
- return isArrayImpl(a);
716
- }
717
-
718
- /*
719
- * The `'' + value` pattern (used in in perf-sensitive code) throws for Symbol
720
- * and Temporal.* types. See https://github.com/facebook/react/pull/22064.
721
- *
722
- * The functions in this module will throw an easier-to-understand,
723
- * easier-to-debug exception with a clear errors message message explaining the
724
- * problem. (Instead of a confusing exception thrown inside the implementation
725
- * of the `value` object).
726
- */
727
- // $FlowFixMe only called in DEV, so void return is not possible.
728
- function typeName(value) {
729
- {
730
- // toStringTag is needed for namespaced types like Temporal.Instant
731
- var hasToStringTag = typeof Symbol === 'function' && Symbol.toStringTag;
732
- var type = hasToStringTag && value[Symbol.toStringTag] || value.constructor.name || 'Object';
733
- return type;
734
- }
735
- } // $FlowFixMe only called in DEV, so void return is not possible.
736
-
737
-
738
- function willCoercionThrow(value) {
739
- {
740
- try {
741
- testStringCoercion(value);
742
- return false;
743
- } catch (e) {
744
- return true;
745
- }
746
- }
747
- }
748
-
749
- function testStringCoercion(value) {
750
- // If you ended up here by following an exception call stack, here's what's
751
- // happened: you supplied an object or symbol value to React (as a prop, key,
752
- // DOM attribute, CSS property, string ref, etc.) and when React tried to
753
- // coerce it to a string using `'' + value`, an exception was thrown.
754
- //
755
- // The most common types that will cause this exception are `Symbol` instances
756
- // and Temporal objects like `Temporal.Instant`. But any object that has a
757
- // `valueOf` or `[Symbol.toPrimitive]` method that throws will also cause this
758
- // exception. (Library authors do this to prevent users from using built-in
759
- // numeric operators like `+` or comparison operators like `>=` because custom
760
- // methods are needed to perform accurate arithmetic or comparison.)
761
- //
762
- // To fix the problem, coerce this object or symbol value to a string before
763
- // passing it to React. The most reliable way is usually `String(value)`.
764
- //
765
- // To find which value is throwing, check the browser or debugger console.
766
- // Before this exception was thrown, there should be `console.error` output
767
- // that shows the type (Symbol, Temporal.PlainDate, etc.) that caused the
768
- // problem and how that type was used: key, atrribute, input value prop, etc.
769
- // In most cases, this console output also shows the component and its
770
- // ancestor components where the exception happened.
771
- //
772
- // eslint-disable-next-line react-internal/safe-string-coercion
773
- return '' + value;
774
- }
775
- function checkKeyStringCoercion(value) {
776
- {
777
- if (willCoercionThrow(value)) {
778
- error('The provided key is an unsupported type %s.' + ' This value must be coerced to a string before before using it here.', typeName(value));
779
-
780
- return testStringCoercion(value); // throw (to help callers find troubleshooting comments)
781
- }
782
- }
783
- }
784
-
785
- var ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner;
786
- var RESERVED_PROPS = {
787
- key: true,
788
- ref: true,
789
- __self: true,
790
- __source: true
791
- };
792
- var specialPropKeyWarningShown;
793
- var specialPropRefWarningShown;
794
-
795
- function hasValidRef(config) {
796
- {
797
- if (hasOwnProperty.call(config, 'ref')) {
798
- var getter = Object.getOwnPropertyDescriptor(config, 'ref').get;
799
-
800
- if (getter && getter.isReactWarning) {
801
- return false;
802
- }
803
- }
804
- }
805
-
806
- return config.ref !== undefined;
807
- }
808
-
809
- function hasValidKey(config) {
810
- {
811
- if (hasOwnProperty.call(config, 'key')) {
812
- var getter = Object.getOwnPropertyDescriptor(config, 'key').get;
813
-
814
- if (getter && getter.isReactWarning) {
815
- return false;
816
- }
817
- }
818
- }
819
-
820
- return config.key !== undefined;
821
- }
822
-
823
- function warnIfStringRefCannotBeAutoConverted(config, self) {
824
- {
825
- if (typeof config.ref === 'string' && ReactCurrentOwner.current && self) ;
826
- }
827
- }
828
-
829
- function defineKeyPropWarningGetter(props, displayName) {
830
- {
831
- var warnAboutAccessingKey = function () {
832
- if (!specialPropKeyWarningShown) {
833
- specialPropKeyWarningShown = true;
834
-
835
- 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);
836
- }
837
- };
838
-
839
- warnAboutAccessingKey.isReactWarning = true;
840
- Object.defineProperty(props, 'key', {
841
- get: warnAboutAccessingKey,
842
- configurable: true
843
- });
844
- }
845
- }
846
-
847
- function defineRefPropWarningGetter(props, displayName) {
848
- {
849
- var warnAboutAccessingRef = function () {
850
- if (!specialPropRefWarningShown) {
851
- specialPropRefWarningShown = true;
852
-
853
- 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);
854
- }
855
- };
856
-
857
- warnAboutAccessingRef.isReactWarning = true;
858
- Object.defineProperty(props, 'ref', {
859
- get: warnAboutAccessingRef,
860
- configurable: true
861
- });
862
- }
863
- }
864
- /**
865
- * Factory method to create a new React element. This no longer adheres to
866
- * the class pattern, so do not use new to call it. Also, instanceof check
867
- * will not work. Instead test $$typeof field against Symbol.for('react.element') to check
868
- * if something is a React Element.
869
- *
870
- * @param {*} type
871
- * @param {*} props
872
- * @param {*} key
873
- * @param {string|object} ref
874
- * @param {*} owner
875
- * @param {*} self A *temporary* helper to detect places where `this` is
876
- * different from the `owner` when React.createElement is called, so that we
877
- * can warn. We want to get rid of owner and replace string `ref`s with arrow
878
- * functions, and as long as `this` and owner are the same, there will be no
879
- * change in behavior.
880
- * @param {*} source An annotation object (added by a transpiler or otherwise)
881
- * indicating filename, line number, and/or other information.
882
- * @internal
883
- */
884
-
885
-
886
- var ReactElement = function (type, key, ref, self, source, owner, props) {
887
- var element = {
888
- // This tag allows us to uniquely identify this as a React Element
889
- $$typeof: REACT_ELEMENT_TYPE,
890
- // Built-in properties that belong on the element
891
- type: type,
892
- key: key,
893
- ref: ref,
894
- props: props,
895
- // Record the component responsible for creating this element.
896
- _owner: owner
897
- };
898
-
899
- {
900
- // The validation flag is currently mutative. We put it on
901
- // an external backing store so that we can freeze the whole object.
902
- // This can be replaced with a WeakMap once they are implemented in
903
- // commonly used development environments.
904
- element._store = {}; // To make comparing ReactElements easier for testing purposes, we make
905
- // the validation flag non-enumerable (where possible, which should
906
- // include every environment we run tests in), so the test framework
907
- // ignores it.
908
-
909
- Object.defineProperty(element._store, 'validated', {
910
- configurable: false,
911
- enumerable: false,
912
- writable: true,
913
- value: false
914
- }); // self and source are DEV only properties.
915
-
916
- Object.defineProperty(element, '_self', {
917
- configurable: false,
918
- enumerable: false,
919
- writable: false,
920
- value: self
921
- }); // Two elements created in two different places should be considered
922
- // equal for testing purposes and therefore we hide it from enumeration.
923
-
924
- Object.defineProperty(element, '_source', {
925
- configurable: false,
926
- enumerable: false,
927
- writable: false,
928
- value: source
929
- });
930
-
931
- if (Object.freeze) {
932
- Object.freeze(element.props);
933
- Object.freeze(element);
934
- }
935
- }
936
-
937
- return element;
938
- };
939
- /**
940
- * https://github.com/reactjs/rfcs/pull/107
941
- * @param {*} type
942
- * @param {object} props
943
- * @param {string} key
944
- */
945
-
946
- function jsxDEV(type, config, maybeKey, source, self) {
947
- {
948
- var propName; // Reserved names are extracted
949
-
950
- var props = {};
951
- var key = null;
952
- var ref = null; // Currently, key can be spread in as a prop. This causes a potential
953
- // issue if key is also explicitly declared (ie. <div {...props} key="Hi" />
954
- // or <div key="Hi" {...props} /> ). We want to deprecate key spread,
955
- // but as an intermediary step, we will use jsxDEV for everything except
956
- // <div {...props} key="Hi" />, because we aren't currently able to tell if
957
- // key is explicitly declared to be undefined or not.
958
-
959
- if (maybeKey !== undefined) {
960
- {
961
- checkKeyStringCoercion(maybeKey);
962
- }
963
-
964
- key = '' + maybeKey;
965
- }
966
-
967
- if (hasValidKey(config)) {
968
- {
969
- checkKeyStringCoercion(config.key);
970
- }
971
-
972
- key = '' + config.key;
973
- }
974
-
975
- if (hasValidRef(config)) {
976
- ref = config.ref;
977
- warnIfStringRefCannotBeAutoConverted(config, self);
978
- } // Remaining properties are added to a new props object
979
-
980
-
981
- for (propName in config) {
982
- if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
983
- props[propName] = config[propName];
984
- }
985
- } // Resolve default props
986
-
987
-
988
- if (type && type.defaultProps) {
989
- var defaultProps = type.defaultProps;
990
-
991
- for (propName in defaultProps) {
992
- if (props[propName] === undefined) {
993
- props[propName] = defaultProps[propName];
994
- }
995
- }
996
- }
997
-
998
- if (key || ref) {
999
- var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;
1000
-
1001
- if (key) {
1002
- defineKeyPropWarningGetter(props, displayName);
1003
- }
1004
-
1005
- if (ref) {
1006
- defineRefPropWarningGetter(props, displayName);
1007
- }
1008
- }
1009
-
1010
- return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);
1011
- }
1012
- }
1013
-
1014
- var ReactCurrentOwner$1 = ReactSharedInternals.ReactCurrentOwner;
1015
- var ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame;
1016
-
1017
- function setCurrentlyValidatingElement$1(element) {
1018
- {
1019
- if (element) {
1020
- var owner = element._owner;
1021
- var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);
1022
- ReactDebugCurrentFrame$1.setExtraStackFrame(stack);
1023
- } else {
1024
- ReactDebugCurrentFrame$1.setExtraStackFrame(null);
1025
- }
1026
- }
1027
- }
1028
-
1029
- var propTypesMisspellWarningShown;
1030
-
1031
- {
1032
- propTypesMisspellWarningShown = false;
1033
- }
1034
- /**
1035
- * Verifies the object is a ReactElement.
1036
- * See https://reactjs.org/docs/react-api.html#isvalidelement
1037
- * @param {?object} object
1038
- * @return {boolean} True if `object` is a ReactElement.
1039
- * @final
1040
- */
1041
-
1042
-
1043
- function isValidElement(object) {
1044
- {
1045
- return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
1046
- }
1047
- }
1048
-
1049
- function getDeclarationErrorAddendum() {
1050
- {
1051
- if (ReactCurrentOwner$1.current) {
1052
- var name = getComponentNameFromType(ReactCurrentOwner$1.current.type);
1053
-
1054
- if (name) {
1055
- return '\n\nCheck the render method of `' + name + '`.';
1056
- }
1057
- }
1058
-
1059
- return '';
1060
- }
1061
- }
1062
-
1063
- function getSourceInfoErrorAddendum(source) {
1064
- {
1065
-
1066
- return '';
1067
- }
1068
- }
1069
- /**
1070
- * Warn if there's no key explicitly set on dynamic arrays of children or
1071
- * object keys are not valid. This allows us to keep track of children between
1072
- * updates.
1073
- */
1074
-
1075
-
1076
- var ownerHasKeyUseWarning = {};
1077
-
1078
- function getCurrentComponentErrorInfo(parentType) {
1079
- {
1080
- var info = getDeclarationErrorAddendum();
1081
-
1082
- if (!info) {
1083
- var parentName = typeof parentType === 'string' ? parentType : parentType.displayName || parentType.name;
1084
-
1085
- if (parentName) {
1086
- info = "\n\nCheck the top-level render call using <" + parentName + ">.";
1087
- }
1088
- }
1089
-
1090
- return info;
1091
- }
1092
- }
1093
- /**
1094
- * Warn if the element doesn't have an explicit key assigned to it.
1095
- * This element is in an array. The array could grow and shrink or be
1096
- * reordered. All children that haven't already been validated are required to
1097
- * have a "key" property assigned to it. Error statuses are cached so a warning
1098
- * will only be shown once.
1099
- *
1100
- * @internal
1101
- * @param {ReactElement} element Element that requires a key.
1102
- * @param {*} parentType element's parent's type.
1103
- */
1104
-
1105
-
1106
- function validateExplicitKey(element, parentType) {
1107
- {
1108
- if (!element._store || element._store.validated || element.key != null) {
1109
- return;
1110
- }
1111
-
1112
- element._store.validated = true;
1113
- var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType);
1114
-
1115
- if (ownerHasKeyUseWarning[currentComponentErrorInfo]) {
1116
- return;
1117
- }
1118
-
1119
- ownerHasKeyUseWarning[currentComponentErrorInfo] = true; // Usually the current owner is the offender, but if it accepts children as a
1120
- // property, it may be the creator of the child that's responsible for
1121
- // assigning it a key.
1122
-
1123
- var childOwner = '';
1124
-
1125
- if (element && element._owner && element._owner !== ReactCurrentOwner$1.current) {
1126
- // Give the component that originally created this child.
1127
- childOwner = " It was passed a child from " + getComponentNameFromType(element._owner.type) + ".";
1128
- }
1129
-
1130
- setCurrentlyValidatingElement$1(element);
1131
-
1132
- 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);
1133
-
1134
- setCurrentlyValidatingElement$1(null);
1135
- }
1136
- }
1137
- /**
1138
- * Ensure that every element either is passed in a static location, in an
1139
- * array with an explicit keys property defined, or in an object literal
1140
- * with valid key property.
1141
- *
1142
- * @internal
1143
- * @param {ReactNode} node Statically passed child of any type.
1144
- * @param {*} parentType node's parent's type.
1145
- */
1146
-
1147
-
1148
- function validateChildKeys(node, parentType) {
1149
- {
1150
- if (typeof node !== 'object') {
1151
- return;
1152
- }
1153
-
1154
- if (isArray(node)) {
1155
- for (var i = 0; i < node.length; i++) {
1156
- var child = node[i];
1157
-
1158
- if (isValidElement(child)) {
1159
- validateExplicitKey(child, parentType);
1160
- }
1161
- }
1162
- } else if (isValidElement(node)) {
1163
- // This element was passed in a valid location.
1164
- if (node._store) {
1165
- node._store.validated = true;
1166
- }
1167
- } else if (node) {
1168
- var iteratorFn = getIteratorFn(node);
1169
-
1170
- if (typeof iteratorFn === 'function') {
1171
- // Entry iterators used to provide implicit keys,
1172
- // but now we print a separate warning for them later.
1173
- if (iteratorFn !== node.entries) {
1174
- var iterator = iteratorFn.call(node);
1175
- var step;
1176
-
1177
- while (!(step = iterator.next()).done) {
1178
- if (isValidElement(step.value)) {
1179
- validateExplicitKey(step.value, parentType);
1180
- }
1181
- }
1182
- }
1183
- }
1184
- }
1185
- }
1186
- }
1187
- /**
1188
- * Given an element, validate that its props follow the propTypes definition,
1189
- * provided by the type.
1190
- *
1191
- * @param {ReactElement} element
1192
- */
1193
-
1194
-
1195
- function validatePropTypes(element) {
1196
- {
1197
- var type = element.type;
1198
-
1199
- if (type === null || type === undefined || typeof type === 'string') {
1200
- return;
1201
- }
1202
-
1203
- var propTypes;
1204
-
1205
- if (typeof type === 'function') {
1206
- propTypes = type.propTypes;
1207
- } else if (typeof type === 'object' && (type.$$typeof === REACT_FORWARD_REF_TYPE || // Note: Memo only checks outer props here.
1208
- // Inner props are checked in the reconciler.
1209
- type.$$typeof === REACT_MEMO_TYPE)) {
1210
- propTypes = type.propTypes;
1211
- } else {
1212
- return;
1213
- }
1214
-
1215
- if (propTypes) {
1216
- // Intentionally inside to avoid triggering lazy initializers:
1217
- var name = getComponentNameFromType(type);
1218
- checkPropTypes(propTypes, element.props, 'prop', name, element);
1219
- } else if (type.PropTypes !== undefined && !propTypesMisspellWarningShown) {
1220
- propTypesMisspellWarningShown = true; // Intentionally inside to avoid triggering lazy initializers:
1221
-
1222
- var _name = getComponentNameFromType(type);
1223
-
1224
- error('Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?', _name || 'Unknown');
1225
- }
1226
-
1227
- if (typeof type.getDefaultProps === 'function' && !type.getDefaultProps.isReactClassApproved) {
1228
- error('getDefaultProps is only used on classic React.createClass ' + 'definitions. Use a static property named `defaultProps` instead.');
1229
- }
1230
- }
1231
- }
1232
- /**
1233
- * Given a fragment, validate that it can only be provided with fragment props
1234
- * @param {ReactElement} fragment
1235
- */
1236
-
1237
-
1238
- function validateFragmentProps(fragment) {
1239
- {
1240
- var keys = Object.keys(fragment.props);
1241
-
1242
- for (var i = 0; i < keys.length; i++) {
1243
- var key = keys[i];
1244
-
1245
- if (key !== 'children' && key !== 'key') {
1246
- setCurrentlyValidatingElement$1(fragment);
1247
-
1248
- error('Invalid prop `%s` supplied to `React.Fragment`. ' + 'React.Fragment can only have `key` and `children` props.', key);
1249
-
1250
- setCurrentlyValidatingElement$1(null);
1251
- break;
1252
- }
1253
- }
1254
-
1255
- if (fragment.ref !== null) {
1256
- setCurrentlyValidatingElement$1(fragment);
1257
-
1258
- error('Invalid attribute `ref` supplied to `React.Fragment`.');
1259
-
1260
- setCurrentlyValidatingElement$1(null);
1261
- }
1262
- }
1263
- }
1264
-
1265
- function jsxWithValidation(type, props, key, isStaticChildren, source, self) {
1266
- {
1267
- var validType = isValidElementType(type); // We warn in this case but don't throw. We expect the element creation to
1268
- // succeed and there will likely be errors in render.
1269
-
1270
- if (!validType) {
1271
- var info = '';
1272
-
1273
- if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) {
1274
- 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.";
1275
- }
1276
-
1277
- var sourceInfo = getSourceInfoErrorAddendum();
1278
-
1279
- if (sourceInfo) {
1280
- info += sourceInfo;
1281
- } else {
1282
- info += getDeclarationErrorAddendum();
1283
- }
1284
-
1285
- var typeString;
1286
-
1287
- if (type === null) {
1288
- typeString = 'null';
1289
- } else if (isArray(type)) {
1290
- typeString = 'array';
1291
- } else if (type !== undefined && type.$$typeof === REACT_ELEMENT_TYPE) {
1292
- typeString = "<" + (getComponentNameFromType(type.type) || 'Unknown') + " />";
1293
- info = ' Did you accidentally export a JSX literal instead of a component?';
1294
- } else {
1295
- typeString = typeof type;
1296
- }
1297
-
1298
- error('React.jsx: type is invalid -- expected a string (for ' + 'built-in components) or a class/function (for composite ' + 'components) but got: %s.%s', typeString, info);
1299
- }
1300
-
1301
- var element = jsxDEV(type, props, key, source, self); // The result can be nullish if a mock or a custom function is used.
1302
- // TODO: Drop this when these are no longer allowed as the type argument.
1303
-
1304
- if (element == null) {
1305
- return element;
1306
- } // Skip key warning if the type isn't valid since our key validation logic
1307
- // doesn't expect a non-string/function type and can throw confusing errors.
1308
- // We don't want exception behavior to differ between dev and prod.
1309
- // (Rendering will throw with a helpful message and as soon as the type is
1310
- // fixed, the key warnings will appear.)
1311
-
1312
-
1313
- if (validType) {
1314
- var children = props.children;
1315
-
1316
- if (children !== undefined) {
1317
- if (isStaticChildren) {
1318
- if (isArray(children)) {
1319
- for (var i = 0; i < children.length; i++) {
1320
- validateChildKeys(children[i], type);
1321
- }
1322
-
1323
- if (Object.freeze) {
1324
- Object.freeze(children);
1325
- }
1326
- } else {
1327
- error('React.jsx: Static children should always be an array. ' + 'You are likely explicitly calling React.jsxs or React.jsxDEV. ' + 'Use the Babel transform instead.');
1328
- }
1329
- } else {
1330
- validateChildKeys(children, type);
1331
- }
1332
- }
1333
- }
1334
-
1335
- if (type === REACT_FRAGMENT_TYPE) {
1336
- validateFragmentProps(element);
1337
- } else {
1338
- validatePropTypes(element);
1339
- }
1340
-
1341
- return element;
1342
- }
1343
- } // These two functions exist to still get child warnings in dev
1344
- // even with the prod transform. This means that jsxDEV is purely
1345
- // opt-in behavior for better messages but that we won't stop
1346
- // giving you warnings if you use production apis.
1347
-
1348
- function jsxWithValidationStatic(type, props, key) {
1349
- {
1350
- return jsxWithValidation(type, props, key, true);
1351
- }
1352
- }
1353
- function jsxWithValidationDynamic(type, props, key) {
1354
- {
1355
- return jsxWithValidation(type, props, key, false);
1356
- }
1357
- }
1358
-
1359
- var jsx = jsxWithValidationDynamic ; // we may want to special case jsxs internally to take advantage of static children.
1360
- // for now we can ship identical prod functions
1361
-
1362
- var jsxs = jsxWithValidationStatic ;
1363
-
1364
- reactJsxRuntime_development.Fragment = REACT_FRAGMENT_TYPE;
1365
- reactJsxRuntime_development.jsx = jsx;
1366
- reactJsxRuntime_development.jsxs = jsxs;
1367
- })();
1368
- }
1369
- return reactJsxRuntime_development;
1370
- }
1371
-
1372
- if (browser$1.env.NODE_ENV === 'production') {
1373
- jsxRuntime.exports = requireReactJsxRuntime_production_min();
1374
- } else {
1375
- jsxRuntime.exports = requireReactJsxRuntime_development();
1376
- }
1377
-
1378
- var jsxRuntimeExports = jsxRuntime.exports;
1379
-
1380
6
  function _typeof$9(o) {
1381
7
  "@babel/helpers - typeof";
1382
8
 
@@ -4025,6 +2651,37 @@ instance.hasLoadedNamespace;
4025
2651
  instance.loadNamespaces;
4026
2652
  instance.loadLanguages;
4027
2653
 
2654
+ var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
2655
+
2656
+ function getDefaultExportFromCjs (x) {
2657
+ return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
2658
+ }
2659
+
2660
+ function getAugmentedNamespace(n) {
2661
+ if (n.__esModule) return n;
2662
+ var f = n.default;
2663
+ if (typeof f == "function") {
2664
+ var a = function a () {
2665
+ if (this instanceof a) {
2666
+ return Reflect.construct(f, arguments, this.constructor);
2667
+ }
2668
+ return f.apply(this, arguments);
2669
+ };
2670
+ a.prototype = f.prototype;
2671
+ } else a = {};
2672
+ Object.defineProperty(a, '__esModule', {value: true});
2673
+ Object.keys(n).forEach(function (k) {
2674
+ var d = Object.getOwnPropertyDescriptor(n, k);
2675
+ Object.defineProperty(a, k, d.get ? d : {
2676
+ enumerable: true,
2677
+ get: function () {
2678
+ return n[k];
2679
+ }
2680
+ });
2681
+ });
2682
+ return a;
2683
+ }
2684
+
4028
2685
  function warn() {
4029
2686
  if (console && console.warn) {
4030
2687
  var _console;
@@ -8326,6 +6983,10 @@ class UIPlugin extends BasePlugin {
8326
6983
  onUnmount() {}
8327
6984
  }
8328
6985
 
6986
+ var global$1 = (typeof global !== "undefined" ? global :
6987
+ typeof self !== "undefined" ? self :
6988
+ typeof window !== "undefined" ? window : {});
6989
+
8329
6990
  var lookup = [];
8330
6991
  var revLookup = [];
8331
6992
  var Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array;
@@ -14115,6 +12776,20 @@ function prettyBytes(number, options) {
14115
12776
  return prefix + numberString + separator + unit;
14116
12777
  }
14117
12778
 
12779
+ var env = {};
12780
+
12781
+ // from https://github.com/kumavis/browser-process-hrtime/blob/master/index.js
12782
+ var performance = global$1.performance || {};
12783
+ performance.now ||
12784
+ performance.mozNow ||
12785
+ performance.msNow ||
12786
+ performance.oNow ||
12787
+ performance.webkitNow ||
12788
+ function(){ return (new Date()).getTime() };
12789
+
12790
+ var browser$1 = {
12791
+ env: env};
12792
+
14118
12793
  var reactIs$3 = {exports: {}};
14119
12794
 
14120
12795
  var reactIs_production_min$2 = {};
@@ -15742,12 +14417,12 @@ const StyledSelect = He.select `
15742
14417
  const EndpointSelector = ({ connectorUrl, endpoints, infoText, changeEndpoint }) => {
15743
14418
  const noMediaServiceAvailable = !(connectorUrl || endpoints?.length > 0);
15744
14419
  if (noMediaServiceAvailable)
15745
- return jsxRuntimeExports.jsxs(StyledSpan, { "data-testid": 'fileuploader__infotext--no-endpoint', children: [jsxRuntimeExports.jsx(StyledIconWrapper$1, { children: jsxRuntimeExports.jsx(FaExclamationCircle_1, {}) }), infoText] });
14420
+ return jsxRuntime.jsxs(StyledSpan, { "data-testid": 'fileuploader__infotext--no-endpoint', children: [jsxRuntime.jsx(StyledIconWrapper$1, { children: jsxRuntime.jsx(FaExclamationCircle_1, {}) }), infoText] });
15746
14421
  if (!connectorUrl) {
15747
- return (jsxRuntimeExports.jsxs(StyledSelectWrapper, { children: [endpoints?.length > 1
15748
- //@ts-ignore
15749
- ? jsxRuntimeExports.jsx(StyledSelect, { "data-testid": 'fileuploader__selector', role: 'listbox', onChange: event => changeEndpoint(event.target.value), children: endpoints.map((endpoint, i) => jsxRuntimeExports.jsx("option", { "data-testid": `fileuploader__selector--option-${i}`, value: endpoint.url, children: endpoint.name }, i)) })
15750
- : jsxRuntimeExports.jsxs(StyledSpan, { "data-testid": 'fileuploader__infotext', children: [endpoints?.length === 0 && jsxRuntimeExports.jsx(StyledIconWrapper$1, { children: jsxRuntimeExports.jsx(FaExclamationCircle_1, {}) }), infoText] }), endpoints?.length > 1 && (jsxRuntimeExports.jsx("div", { style: { position: 'absolute', top: 9, right: 12, pointerEvents: 'none' }, children: jsxRuntimeExports.jsx(FaChevronDown_1, { color: 'rgb(167, 168, 169)' }) }))] }));
14422
+ return (jsxRuntime.jsxs(StyledSelectWrapper, { children: [endpoints?.length > 1
14423
+ // @ts-ignore
14424
+ ? jsxRuntime.jsx(StyledSelect, { "data-testid": 'fileuploader__selector', role: 'listbox', onChange: event => changeEndpoint(event.target.value), children: endpoints.map((endpoint, i) => jsxRuntime.jsx("option", { "data-testid": `fileuploader__selector--option-${i}`, value: endpoint.url, children: endpoint.name }, i)) })
14425
+ : jsxRuntime.jsxs(StyledSpan, { "data-testid": 'fileuploader__infotext', children: [endpoints?.length === 0 && jsxRuntime.jsx(StyledIconWrapper$1, { children: jsxRuntime.jsx(FaExclamationCircle_1, {}) }), infoText] }), endpoints?.length > 1 && (jsxRuntime.jsx("div", { style: { position: 'absolute', top: 9, right: 12, pointerEvents: 'none' }, children: jsxRuntime.jsx(FaChevronDown_1, { color: 'rgb(167, 168, 169)' }) }))] }));
15751
14426
  }
15752
14427
  };
15753
14428
 
@@ -17764,7 +16439,7 @@ const StyledErrorMessage = He.label `
17764
16439
  `;
17765
16440
 
17766
16441
  const Error$1 = ({ mode, errorMessage }) => {
17767
- return (jsxRuntimeExports.jsx(StyledErrorWrapper, { visible: Boolean(errorMessage), children: jsxRuntimeExports.jsxs(StyledErrorContainer, { mode: mode, children: [jsxRuntimeExports.jsx(StyledIconWrapper, { "data-testid": 'fileuploader__error--message-icon', children: jsxRuntimeExports.jsx(FaExclamationCircle_1, {}) }), jsxRuntimeExports.jsx(StyledErrorMessage, { "data-testid": 'fileuploader__error--message', children: errorMessage })] }) }));
16442
+ return (jsxRuntime.jsx(StyledErrorWrapper, { visible: Boolean(errorMessage), children: jsxRuntime.jsxs(StyledErrorContainer, { mode: mode, children: [jsxRuntime.jsx(StyledIconWrapper, { "data-testid": 'fileuploader__error--message-icon', children: jsxRuntime.jsx(FaExclamationCircle_1, {}) }), jsxRuntime.jsx(StyledErrorMessage, { "data-testid": 'fileuploader__error--message', children: errorMessage })] }) }));
17768
16443
  };
17769
16444
 
17770
16445
  const StyledFilenametext = He.span `
@@ -17787,11 +16462,11 @@ const StyledLink = He.a `
17787
16462
  const FilenameText = ({ decodedFileName, type, previewUrl }) => {
17788
16463
  if (!decodedFileName)
17789
16464
  return (null);
17790
- const Text = jsxRuntimeExports.jsx(StyledFilenametext, { "data-testid": 'fileuploader__file-name', type: type, children: decodedFileName });
16465
+ const Text = jsxRuntime.jsx(StyledFilenametext, { "data-testid": 'fileuploader__file-name', type: type, children: decodedFileName });
17791
16466
  if (type === 'pdf' && previewUrl) {
17792
- return jsxRuntimeExports.jsx(StyledLink, { href: previewUrl, target: "_blank", rel: "noreferrer", "data-testid": "fileuploader__pdf-preview-link", children: Text });
16467
+ return jsxRuntime.jsx(StyledLink, { href: previewUrl, target: "_blank", rel: "noreferrer", "data-testid": "fileuploader__pdf-preview-link", children: Text });
17793
16468
  }
17794
- return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: Text });
16469
+ return jsxRuntime.jsx(jsxRuntime.Fragment, { children: Text });
17795
16470
  };
17796
16471
 
17797
16472
  const StyledHover = He.img `
@@ -17840,7 +16515,7 @@ const ImagePreview = ({ previewUrl, type, decodedFileName }) => {
17840
16515
  const isSvg = decodedFileName.toLowerCase().endsWith('.svg');
17841
16516
  const iconSrc = isSvg ? previewUrl : withWidth(previewUrl, 150);
17842
16517
  const hoverSrc = isSvg ? previewUrl : withWidth(previewUrl, 450);
17843
- return (jsxRuntimeExports.jsxs(StyledImagePreviewWrapper, { "data-testid": 'fileuploader__preview-image', children: [jsxRuntimeExports.jsx(StyledIcon, { "data-testid": 'fileuploader__preview-image__icon', className: 'lazyload', src: iconSrc, "data-sizes": 'auto' }), jsxRuntimeExports.jsx(StyledHover, { className: 'lazyload', src: hoverSrc, "data-sizes": 'auto' })] }));
16518
+ return (jsxRuntime.jsxs(StyledImagePreviewWrapper, { "data-testid": 'fileuploader__preview-image', children: [jsxRuntime.jsx(StyledIcon, { "data-testid": 'fileuploader__preview-image__icon', className: 'lazyload', src: iconSrc, "data-sizes": 'auto' }), jsxRuntime.jsx(StyledHover, { className: 'lazyload', src: hoverSrc, "data-sizes": 'auto' })] }));
17844
16519
  };
17845
16520
 
17846
16521
  const StyledProgressbar = He(StyledVisibilityContainerProgress) `
@@ -17916,17 +16591,17 @@ const StyledProgressSubline = He.div `
17916
16591
  `;
17917
16592
 
17918
16593
  const CustomProgressbar = () => {
17919
- return (jsxRuntimeExports.jsx(StyledProgressContainer, { children: jsxRuntimeExports.jsxs(StyledProgressSlider, { children: [jsxRuntimeExports.jsx(StyledProgressLine, {}), jsxRuntimeExports.jsx(StyledProgressSubline, { state: 1 }), jsxRuntimeExports.jsx(StyledProgressSubline, { state: -1 })] }) }));
16594
+ return (jsxRuntime.jsx(StyledProgressContainer, { children: jsxRuntime.jsxs(StyledProgressSlider, { children: [jsxRuntime.jsx(StyledProgressLine, {}), jsxRuntime.jsx(StyledProgressSubline, { state: 1 }), jsxRuntime.jsx(StyledProgressSubline, { state: -1 })] }) }));
17920
16595
  };
17921
16596
 
17922
16597
  const Progressbar = ({ loaded }) => {
17923
- return loaded === 100 ? jsxRuntimeExports.jsx(CustomProgressbar, {}) : jsxRuntimeExports.jsx(StyledProgressbar, { role: 'progressbar', value: loaded, max: '100', visible: loaded > 0 });
16598
+ return loaded === 100 ? jsxRuntime.jsx(CustomProgressbar, {}) : jsxRuntime.jsx(StyledProgressbar, { role: 'progressbar', value: loaded, max: '100', visible: loaded > 0 });
17924
16599
  };
17925
16600
 
17926
16601
  const UploadIcon = () => {
17927
16602
  return (
17928
- //@ts-ignore
17929
- jsxRuntimeExports.jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: "14", height: "15", viewBox: "0 0 14 15", style: { marginRight: 7 }, dangerouslySetInnerHTML: {
16603
+ // @ts-ignore
16604
+ jsxRuntime.jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: "14", height: "15", viewBox: "0 0 14 15", style: { marginRight: 7 }, dangerouslySetInnerHTML: {
17930
16605
  __html: '<path id="Pfad_590" data-name="Pfad 590" d="M19,8.294H15V3H9V8.294H5l7,6.176ZM5,16.235V18H19V16.235Z" transform="translate(-5 -3)" fill="rgb(51,51,51)"/>'
17931
16606
  } }));
17932
16607
  };
@@ -18100,9 +16775,9 @@ const Uploader = ({ type, errorMessage, inputType, loaded, previewUrl, uploaderM
18100
16775
  const defaultUploaderLabel = MEDIA_TYPE[type] ? t('uploaderLabel', { type }) : t('defaultUploaderLabel');
18101
16776
  const defaultLabel = mode !== MODE.STATEFUL && defaultUploaderLabel;
18102
16777
  const uploadLabelText = defaultLabel || uploaderMessage || defaultUploaderLabel;
18103
- return (jsxRuntimeExports.jsxs(StyledUploaderWrapper, { visible: inputType === 'file', error: errorMessage, mode: mode, height: height, children: [mode === MODE.STATELESS &&
18104
- jsxRuntimeExports.jsxs(StyledLabelWrapper, { mode: mode, visible: true, children: [jsxRuntimeExports.jsx(UploadIcon$1, {}), jsxRuntimeExports.jsx(StyledLabelText, { "data-testid": 'fileuploader__label', children: uploadLabelText })] }), mode === MODE.STATEFUL &&
18105
- jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [jsxRuntimeExports.jsx(StyledMediaIconWrapper, { children: jsxRuntimeExports.jsx(UploaderIcon, { color: '#4a96d0' }) }), jsxRuntimeExports.jsx(StyledLabelWrapper, { mode: mode, visible: Boolean(!file.url), children: jsxRuntimeExports.jsx(StyledLabelText, { "data-testid": 'fileuploader__label', children: uploadLabelText }) }), jsxRuntimeExports.jsxs(StyledExistingFile, { visible: Boolean(file.url), "data-testid": 'existing-file', children: [jsxRuntimeExports.jsx(ImagePreview, { type: type, previewUrl: previewUrl, decodedFileName: decodedFileName }), jsxRuntimeExports.jsx(FilenameText, { decodedFileName: decodedFileName, type: type, previewUrl: previewUrl }), jsxRuntimeExports.jsx(StyledDeleteIconWrapper, { role: 'button', "data-testid": 'fileuploader__delete-icon', onClick: () => onDeleteFile(), children: jsxRuntimeExports.jsx(FaRegTrashAlt_1, {}) })] })] }), jsxRuntimeExports.jsx(DragDrop, { uppy: uppy,
16778
+ return (jsxRuntime.jsxs(StyledUploaderWrapper, { "data-testid": 'fileuploader__uploader', visible: inputType === 'file', error: errorMessage, mode: mode, height: height, children: [mode === MODE.STATELESS &&
16779
+ jsxRuntime.jsxs(StyledLabelWrapper, { mode: mode, visible: true, children: [jsxRuntime.jsx(UploadIcon$1, {}), jsxRuntime.jsx(StyledLabelText, { "data-testid": 'fileuploader__label', children: uploadLabelText })] }), mode === MODE.STATEFUL &&
16780
+ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(StyledMediaIconWrapper, { children: jsxRuntime.jsx(UploaderIcon, { color: '#4a96d0' }) }), jsxRuntime.jsx(StyledLabelWrapper, { mode: mode, visible: Boolean(!file.url), children: jsxRuntime.jsx(StyledLabelText, { "data-testid": 'fileuploader__label', children: uploadLabelText }) }), jsxRuntime.jsxs(StyledExistingFile, { visible: Boolean(file.url), "data-testid": 'existing-file', children: [jsxRuntime.jsx(ImagePreview, { type: type, previewUrl: previewUrl, decodedFileName: decodedFileName }), jsxRuntime.jsx(FilenameText, { decodedFileName: decodedFileName, type: type, previewUrl: previewUrl }), jsxRuntime.jsx(StyledDeleteIconWrapper, { role: 'button', "data-testid": 'fileuploader__delete-icon', onClick: () => onDeleteFile(), children: jsxRuntime.jsx(FaRegTrashAlt_1, {}) })] })] }), jsxRuntime.jsx(DragDrop, { uppy: uppy,
18106
16781
  // @ts-ignore
18107
16782
  className: selectFileClass, inputName: '', style: {
18108
16783
  display: dragDropIsHidden ? 'none' : 'block',
@@ -18111,7 +16786,7 @@ const Uploader = ({ type, errorMessage, inputType, loaded, previewUrl, uploaderM
18111
16786
  strings: {
18112
16787
  dropHereOr: ''
18113
16788
  }
18114
- } }), jsxRuntimeExports.jsx(Progressbar, { loaded: loaded }), jsxRuntimeExports.jsx(Error$1, { mode: mode, errorMessage: errorMessage })] }));
16789
+ } }), jsxRuntime.jsx(Progressbar, { loaded: loaded }), jsxRuntime.jsx(Error$1, { mode: mode, errorMessage: errorMessage })] }));
18115
16790
  };
18116
16791
 
18117
16792
  var uniqueId = () => Math.random().toString(36).substring(2, 15) + Math.random().toString(36).substring(2, 15);
@@ -18304,11 +16979,15 @@ const FileUploader = ({ ...props }) => {
18304
16979
  uppy?.removePlugin(instance);
18305
16980
  setEndpointUrl(url);
18306
16981
  };
18307
- return (jsxRuntimeExports.jsx(StyledFileUploader, { readOnly: readOnly, children: jsxRuntimeExports.jsxs(StyledFileUploaderContainer, { "data-testid": 'fileuploader__container', "data-id": id, children: [jsxRuntimeExports.jsx(StyledInput, { id: id, className: className, name: id, "data-testid": 'fileuploader__input-control', type: 'url', "data-type": 'url', value: value || '', placeholder: !connectorUrl ? 'Url...' : '', readOnly: true, required: required, inputType: inputType, "data-disabled": !mediaServiceAvailable }), uppy &&
18308
- jsxRuntimeExports.jsx(Uploader, { errorMessage: errorMessage, file: file, height: height, inputType: inputType, loaded: loaded, mode: mode, previewUrl: preview, type: type, uploaderMessage: uploaderMessage, uppy: uppy, onDeleteFile: onDeleteFile }), !connectorUrl &&
18309
- jsxRuntimeExports.jsx(EndpointSelector, { connectorUrl: connectorUrl, endpoints: endpoints, infoText: infoText, changeEndpoint: changeEndpoint })] }) }));
16982
+ return (jsxRuntime.jsx(StyledFileUploader, { readOnly: readOnly, children: jsxRuntime.jsxs(StyledFileUploaderContainer, { "data-testid": 'fileuploader__container', "data-id": id, children: [jsxRuntime.jsx(StyledInput, { id: id, className: className, name: id, "data-testid": 'fileuploader__input-control', type: 'url', "data-type": 'url', value: value || '', placeholder: !connectorUrl ? 'Url...' : '', readOnly: true, required: required, inputType: inputType, "data-disabled": !mediaServiceAvailable }), uppy &&
16983
+ jsxRuntime.jsx(Uploader, { errorMessage: errorMessage, file: file, height: height, inputType: inputType, loaded: loaded, mode: mode, previewUrl: preview, type: type, uploaderMessage: uploaderMessage, uppy: uppy, onDeleteFile: onDeleteFile }), !connectorUrl &&
16984
+ jsxRuntime.jsx(EndpointSelector, { connectorUrl: connectorUrl, endpoints: endpoints, infoText: infoText, changeEndpoint: changeEndpoint })] }) }));
18310
16985
  };
18311
16986
 
16987
+ // The return type is annotated on purpose: inferred, it emits `JSX.Element` into
16988
+ // dist/index.d.ts, and React 19 scoped the JSX namespace to React.JSX and dropped
16989
+ // the global one — so consumers on @types/react 19 fail with
16990
+ // "TS2503: Cannot find namespace 'JSX'". ReactElement is stable across 18 and 19.
18312
16991
  const FileUploaderComponent = (props) => {
18313
16992
  const { language } = props;
18314
16993
  // i18n
@@ -18317,7 +16996,7 @@ const FileUploaderComponent = (props) => {
18317
16996
  instance.changeLanguage(language.toLowerCase());
18318
16997
  }, [language]);
18319
16998
  //
18320
- return jsxRuntimeExports.jsx(FileUploader, { ...props, language: instance.language });
16999
+ return jsxRuntime.jsx(FileUploader, { ...props, language: instance.language });
18321
17000
  };
18322
17001
 
18323
17002
  exports.FileUploader = FileUploaderComponent;