@popsure/dirty-swan 0.27.9 → 0.27.10-alpha.1
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/index.js
CHANGED
|
@@ -53,7 +53,7 @@ var __assign = function() {
|
|
|
53
53
|
return __assign.apply(this, arguments);
|
|
54
54
|
};
|
|
55
55
|
|
|
56
|
-
function __rest(s, e) {
|
|
56
|
+
function __rest$1(s, e) {
|
|
57
57
|
var t = {};
|
|
58
58
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
59
59
|
t[p] = s[p];
|
|
@@ -65,7 +65,7 @@ function __rest(s, e) {
|
|
|
65
65
|
return t;
|
|
66
66
|
}
|
|
67
67
|
|
|
68
|
-
function __awaiter(thisArg, _arguments, P, generator) {
|
|
68
|
+
function __awaiter$1(thisArg, _arguments, P, generator) {
|
|
69
69
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
70
70
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
71
71
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
@@ -75,7 +75,7 @@ function __awaiter(thisArg, _arguments, P, generator) {
|
|
|
75
75
|
});
|
|
76
76
|
}
|
|
77
77
|
|
|
78
|
-
function __generator(thisArg, body) {
|
|
78
|
+
function __generator$1(thisArg, body) {
|
|
79
79
|
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
80
80
|
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
81
81
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
@@ -103,31 +103,7 @@ function __generator(thisArg, body) {
|
|
|
103
103
|
}
|
|
104
104
|
}
|
|
105
105
|
|
|
106
|
-
function
|
|
107
|
-
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
108
|
-
if (!m) return o;
|
|
109
|
-
var i = m.call(o), r, ar = [], e;
|
|
110
|
-
try {
|
|
111
|
-
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
112
|
-
}
|
|
113
|
-
catch (error) { e = { error: error }; }
|
|
114
|
-
finally {
|
|
115
|
-
try {
|
|
116
|
-
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
117
|
-
}
|
|
118
|
-
finally { if (e) throw e.error; }
|
|
119
|
-
}
|
|
120
|
-
return ar;
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
/** @deprecated */
|
|
124
|
-
function __spread() {
|
|
125
|
-
for (var ar = [], i = 0; i < arguments.length; i++)
|
|
126
|
-
ar = ar.concat(__read(arguments[i]));
|
|
127
|
-
return ar;
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
function __spreadArray(to, from, pack) {
|
|
106
|
+
function __spreadArray$1(to, from, pack) {
|
|
131
107
|
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
132
108
|
if (ar || !(i in from)) {
|
|
133
109
|
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
@@ -2324,11 +2300,11 @@ var DateSelector = function (_a) {
|
|
|
2324
2300
|
}, firstDayOfWeek: firstDayOfWeek, locale: (dayjsLocale === null || dayjsLocale === void 0 ? void 0 : dayjsLocale.name) || 'en', months: localizedMonths, weekdaysLong: localizedWeekdays, weekdaysShort: localizedWeekdaysShort }, void 0))] }), void 0))] }), void 0));
|
|
2325
2301
|
};
|
|
2326
2302
|
|
|
2327
|
-
var propTypes = {exports: {}};
|
|
2303
|
+
var propTypes$1 = {exports: {}};
|
|
2328
2304
|
|
|
2329
|
-
var reactIs = {exports: {}};
|
|
2305
|
+
var reactIs$1 = {exports: {}};
|
|
2330
2306
|
|
|
2331
|
-
var reactIs_production_min = {};
|
|
2307
|
+
var reactIs_production_min$1 = {};
|
|
2332
2308
|
|
|
2333
2309
|
/** @license React v16.13.1
|
|
2334
2310
|
* react-is.production.min.js
|
|
@@ -2338,14 +2314,14 @@ var reactIs_production_min = {};
|
|
|
2338
2314
|
* This source code is licensed under the MIT license found in the
|
|
2339
2315
|
* LICENSE file in the root directory of this source tree.
|
|
2340
2316
|
*/
|
|
2341
|
-
var b="function"===typeof Symbol&&Symbol.for,c=b?Symbol.for("react.element"):60103,d=b?Symbol.for("react.portal"):60106,e=b?Symbol.for("react.fragment"):60107,f=b?Symbol.for("react.strict_mode"):60108,g=b?Symbol.for("react.profiler"):60114,h=b?Symbol.for("react.provider"):60109,k=b?Symbol.for("react.context"):60110,l=b?Symbol.for("react.async_mode"):60111,m$
|
|
2342
|
-
Symbol.for("react.suspense_list"):60120,r$
|
|
2343
|
-
function z(a){if("object"===typeof a&&null!==a){var u=a.$$typeof;switch(u){case c:switch(a=a.type,a){case l:case m$
|
|
2344
|
-
reactIs_production_min.Profiler=g;reactIs_production_min.StrictMode=f;reactIs_production_min.Suspense=p;reactIs_production_min.isAsyncMode=function(a){return A(a)||z(a)===l};reactIs_production_min.isConcurrentMode=A;reactIs_production_min.isContextConsumer=function(a){return z(a)===k};reactIs_production_min.isContextProvider=function(a){return z(a)===h};reactIs_production_min.isElement=function(a){return "object"===typeof a&&null!==a&&a.$$typeof===c};reactIs_production_min.isForwardRef=function(a){return z(a)===n};reactIs_production_min.isFragment=function(a){return z(a)===e};reactIs_production_min.isLazy=function(a){return z(a)===t};
|
|
2345
|
-
reactIs_production_min.isMemo=function(a){return z(a)===r$
|
|
2346
|
-
reactIs_production_min.isValidElementType=function(a){return "string"===typeof a||"function"===typeof a||a===e||a===m$
|
|
2317
|
+
var b$1="function"===typeof Symbol&&Symbol.for,c$1=b$1?Symbol.for("react.element"):60103,d$1=b$1?Symbol.for("react.portal"):60106,e$1=b$1?Symbol.for("react.fragment"):60107,f$1=b$1?Symbol.for("react.strict_mode"):60108,g$1=b$1?Symbol.for("react.profiler"):60114,h$1=b$1?Symbol.for("react.provider"):60109,k$1=b$1?Symbol.for("react.context"):60110,l$1=b$1?Symbol.for("react.async_mode"):60111,m$2=b$1?Symbol.for("react.concurrent_mode"):60111,n$1=b$1?Symbol.for("react.forward_ref"):60112,p$1=b$1?Symbol.for("react.suspense"):60113,q$1=b$1?
|
|
2318
|
+
Symbol.for("react.suspense_list"):60120,r$2=b$1?Symbol.for("react.memo"):60115,t$1=b$1?Symbol.for("react.lazy"):60116,v$1=b$1?Symbol.for("react.block"):60121,w$1=b$1?Symbol.for("react.fundamental"):60117,x$1=b$1?Symbol.for("react.responder"):60118,y$2=b$1?Symbol.for("react.scope"):60119;
|
|
2319
|
+
function z$1(a){if("object"===typeof a&&null!==a){var u=a.$$typeof;switch(u){case c$1:switch(a=a.type,a){case l$1:case m$2:case e$1:case g$1:case f$1:case p$1:return a;default:switch(a=a&&a.$$typeof,a){case k$1:case n$1:case t$1:case r$2:case h$1:return a;default:return u}}case d$1:return u}}}function A$1(a){return z$1(a)===m$2}reactIs_production_min$1.AsyncMode=l$1;reactIs_production_min$1.ConcurrentMode=m$2;reactIs_production_min$1.ContextConsumer=k$1;reactIs_production_min$1.ContextProvider=h$1;reactIs_production_min$1.Element=c$1;reactIs_production_min$1.ForwardRef=n$1;reactIs_production_min$1.Fragment=e$1;reactIs_production_min$1.Lazy=t$1;reactIs_production_min$1.Memo=r$2;reactIs_production_min$1.Portal=d$1;
|
|
2320
|
+
reactIs_production_min$1.Profiler=g$1;reactIs_production_min$1.StrictMode=f$1;reactIs_production_min$1.Suspense=p$1;reactIs_production_min$1.isAsyncMode=function(a){return A$1(a)||z$1(a)===l$1};reactIs_production_min$1.isConcurrentMode=A$1;reactIs_production_min$1.isContextConsumer=function(a){return z$1(a)===k$1};reactIs_production_min$1.isContextProvider=function(a){return z$1(a)===h$1};reactIs_production_min$1.isElement=function(a){return "object"===typeof a&&null!==a&&a.$$typeof===c$1};reactIs_production_min$1.isForwardRef=function(a){return z$1(a)===n$1};reactIs_production_min$1.isFragment=function(a){return z$1(a)===e$1};reactIs_production_min$1.isLazy=function(a){return z$1(a)===t$1};
|
|
2321
|
+
reactIs_production_min$1.isMemo=function(a){return z$1(a)===r$2};reactIs_production_min$1.isPortal=function(a){return z$1(a)===d$1};reactIs_production_min$1.isProfiler=function(a){return z$1(a)===g$1};reactIs_production_min$1.isStrictMode=function(a){return z$1(a)===f$1};reactIs_production_min$1.isSuspense=function(a){return z$1(a)===p$1};
|
|
2322
|
+
reactIs_production_min$1.isValidElementType=function(a){return "string"===typeof a||"function"===typeof a||a===e$1||a===m$2||a===g$1||a===f$1||a===p$1||a===q$1||"object"===typeof a&&null!==a&&(a.$$typeof===t$1||a.$$typeof===r$2||a.$$typeof===h$1||a.$$typeof===k$1||a.$$typeof===n$1||a.$$typeof===w$1||a.$$typeof===x$1||a.$$typeof===y$2||a.$$typeof===v$1)};reactIs_production_min$1.typeOf=z$1;
|
|
2347
2323
|
|
|
2348
|
-
var reactIs_development = {};
|
|
2324
|
+
var reactIs_development$1 = {};
|
|
2349
2325
|
|
|
2350
2326
|
/** @license React v16.13.1
|
|
2351
2327
|
* react-is.development.js
|
|
@@ -2495,41 +2471,41 @@ function isSuspense(object) {
|
|
|
2495
2471
|
return typeOf(object) === REACT_SUSPENSE_TYPE;
|
|
2496
2472
|
}
|
|
2497
2473
|
|
|
2498
|
-
reactIs_development.AsyncMode = AsyncMode;
|
|
2499
|
-
reactIs_development.ConcurrentMode = ConcurrentMode;
|
|
2500
|
-
reactIs_development.ContextConsumer = ContextConsumer;
|
|
2501
|
-
reactIs_development.ContextProvider = ContextProvider;
|
|
2502
|
-
reactIs_development.Element = Element;
|
|
2503
|
-
reactIs_development.ForwardRef = ForwardRef;
|
|
2504
|
-
reactIs_development.Fragment = Fragment;
|
|
2505
|
-
reactIs_development.Lazy = Lazy;
|
|
2506
|
-
reactIs_development.Memo = Memo;
|
|
2507
|
-
reactIs_development.Portal = Portal;
|
|
2508
|
-
reactIs_development.Profiler = Profiler;
|
|
2509
|
-
reactIs_development.StrictMode = StrictMode;
|
|
2510
|
-
reactIs_development.Suspense = Suspense;
|
|
2511
|
-
reactIs_development.isAsyncMode = isAsyncMode;
|
|
2512
|
-
reactIs_development.isConcurrentMode = isConcurrentMode;
|
|
2513
|
-
reactIs_development.isContextConsumer = isContextConsumer;
|
|
2514
|
-
reactIs_development.isContextProvider = isContextProvider;
|
|
2515
|
-
reactIs_development.isElement = isElement;
|
|
2516
|
-
reactIs_development.isForwardRef = isForwardRef;
|
|
2517
|
-
reactIs_development.isFragment = isFragment;
|
|
2518
|
-
reactIs_development.isLazy = isLazy;
|
|
2519
|
-
reactIs_development.isMemo = isMemo;
|
|
2520
|
-
reactIs_development.isPortal = isPortal;
|
|
2521
|
-
reactIs_development.isProfiler = isProfiler;
|
|
2522
|
-
reactIs_development.isStrictMode = isStrictMode;
|
|
2523
|
-
reactIs_development.isSuspense = isSuspense;
|
|
2524
|
-
reactIs_development.isValidElementType = isValidElementType;
|
|
2525
|
-
reactIs_development.typeOf = typeOf;
|
|
2474
|
+
reactIs_development$1.AsyncMode = AsyncMode;
|
|
2475
|
+
reactIs_development$1.ConcurrentMode = ConcurrentMode;
|
|
2476
|
+
reactIs_development$1.ContextConsumer = ContextConsumer;
|
|
2477
|
+
reactIs_development$1.ContextProvider = ContextProvider;
|
|
2478
|
+
reactIs_development$1.Element = Element;
|
|
2479
|
+
reactIs_development$1.ForwardRef = ForwardRef;
|
|
2480
|
+
reactIs_development$1.Fragment = Fragment;
|
|
2481
|
+
reactIs_development$1.Lazy = Lazy;
|
|
2482
|
+
reactIs_development$1.Memo = Memo;
|
|
2483
|
+
reactIs_development$1.Portal = Portal;
|
|
2484
|
+
reactIs_development$1.Profiler = Profiler;
|
|
2485
|
+
reactIs_development$1.StrictMode = StrictMode;
|
|
2486
|
+
reactIs_development$1.Suspense = Suspense;
|
|
2487
|
+
reactIs_development$1.isAsyncMode = isAsyncMode;
|
|
2488
|
+
reactIs_development$1.isConcurrentMode = isConcurrentMode;
|
|
2489
|
+
reactIs_development$1.isContextConsumer = isContextConsumer;
|
|
2490
|
+
reactIs_development$1.isContextProvider = isContextProvider;
|
|
2491
|
+
reactIs_development$1.isElement = isElement;
|
|
2492
|
+
reactIs_development$1.isForwardRef = isForwardRef;
|
|
2493
|
+
reactIs_development$1.isFragment = isFragment;
|
|
2494
|
+
reactIs_development$1.isLazy = isLazy;
|
|
2495
|
+
reactIs_development$1.isMemo = isMemo;
|
|
2496
|
+
reactIs_development$1.isPortal = isPortal;
|
|
2497
|
+
reactIs_development$1.isProfiler = isProfiler;
|
|
2498
|
+
reactIs_development$1.isStrictMode = isStrictMode;
|
|
2499
|
+
reactIs_development$1.isSuspense = isSuspense;
|
|
2500
|
+
reactIs_development$1.isValidElementType = isValidElementType;
|
|
2501
|
+
reactIs_development$1.typeOf = typeOf;
|
|
2526
2502
|
})();
|
|
2527
2503
|
}
|
|
2528
2504
|
|
|
2529
2505
|
if (process.env.NODE_ENV === 'production') {
|
|
2530
|
-
reactIs.exports = reactIs_production_min;
|
|
2506
|
+
reactIs$1.exports = reactIs_production_min$1;
|
|
2531
2507
|
} else {
|
|
2532
|
-
reactIs.exports = reactIs_development;
|
|
2508
|
+
reactIs$1.exports = reactIs_development$1;
|
|
2533
2509
|
}
|
|
2534
2510
|
|
|
2535
2511
|
/*
|
|
@@ -2628,9 +2604,11 @@ var objectAssign$1 = shouldUseNative() ? Object.assign : function (target, sourc
|
|
|
2628
2604
|
* LICENSE file in the root directory of this source tree.
|
|
2629
2605
|
*/
|
|
2630
2606
|
|
|
2631
|
-
var ReactPropTypesSecret$
|
|
2607
|
+
var ReactPropTypesSecret$7 = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
|
|
2632
2608
|
|
|
2633
|
-
var ReactPropTypesSecret_1 = ReactPropTypesSecret$
|
|
2609
|
+
var ReactPropTypesSecret_1$1 = ReactPropTypesSecret$7;
|
|
2610
|
+
|
|
2611
|
+
var has$4 = Function.call.bind(Object.prototype.hasOwnProperty);
|
|
2634
2612
|
|
|
2635
2613
|
/**
|
|
2636
2614
|
* Copyright (c) 2013-present, Facebook, Inc.
|
|
@@ -2639,14 +2617,14 @@ var ReactPropTypesSecret_1 = ReactPropTypesSecret$3;
|
|
|
2639
2617
|
* LICENSE file in the root directory of this source tree.
|
|
2640
2618
|
*/
|
|
2641
2619
|
|
|
2642
|
-
var printWarning$
|
|
2620
|
+
var printWarning$3 = function() {};
|
|
2643
2621
|
|
|
2644
2622
|
if (process.env.NODE_ENV !== 'production') {
|
|
2645
|
-
var ReactPropTypesSecret$
|
|
2646
|
-
var loggedTypeFailures = {};
|
|
2647
|
-
var has$
|
|
2623
|
+
var ReactPropTypesSecret$6 = ReactPropTypesSecret_1$1;
|
|
2624
|
+
var loggedTypeFailures$1 = {};
|
|
2625
|
+
var has$3 = has$4;
|
|
2648
2626
|
|
|
2649
|
-
printWarning$
|
|
2627
|
+
printWarning$3 = function(text) {
|
|
2650
2628
|
var message = 'Warning: ' + text;
|
|
2651
2629
|
if (typeof console !== 'undefined') {
|
|
2652
2630
|
console.error(message);
|
|
@@ -2656,7 +2634,7 @@ if (process.env.NODE_ENV !== 'production') {
|
|
|
2656
2634
|
// This error was thrown as a convenience so that you can use this stack
|
|
2657
2635
|
// to find the callsite that caused this warning to fire.
|
|
2658
2636
|
throw new Error(message);
|
|
2659
|
-
} catch (x) {}
|
|
2637
|
+
} catch (x) { /**/ }
|
|
2660
2638
|
};
|
|
2661
2639
|
}
|
|
2662
2640
|
|
|
@@ -2671,10 +2649,10 @@ if (process.env.NODE_ENV !== 'production') {
|
|
|
2671
2649
|
* @param {?Function} getStack Returns the component stack.
|
|
2672
2650
|
* @private
|
|
2673
2651
|
*/
|
|
2674
|
-
function checkPropTypes$
|
|
2652
|
+
function checkPropTypes$3(typeSpecs, values, location, componentName, getStack) {
|
|
2675
2653
|
if (process.env.NODE_ENV !== 'production') {
|
|
2676
2654
|
for (var typeSpecName in typeSpecs) {
|
|
2677
|
-
if (has$
|
|
2655
|
+
if (has$3(typeSpecs, typeSpecName)) {
|
|
2678
2656
|
var error;
|
|
2679
2657
|
// Prop type validation may throw. In case they do, we don't want to
|
|
2680
2658
|
// fail the render phase where it didn't fail before. So we log it.
|
|
@@ -2685,17 +2663,18 @@ function checkPropTypes$1(typeSpecs, values, location, componentName, getStack)
|
|
|
2685
2663
|
if (typeof typeSpecs[typeSpecName] !== 'function') {
|
|
2686
2664
|
var err = Error(
|
|
2687
2665
|
(componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' +
|
|
2688
|
-
'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.'
|
|
2666
|
+
'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.' +
|
|
2667
|
+
'This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.'
|
|
2689
2668
|
);
|
|
2690
2669
|
err.name = 'Invariant Violation';
|
|
2691
2670
|
throw err;
|
|
2692
2671
|
}
|
|
2693
|
-
error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret$
|
|
2672
|
+
error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret$6);
|
|
2694
2673
|
} catch (ex) {
|
|
2695
2674
|
error = ex;
|
|
2696
2675
|
}
|
|
2697
2676
|
if (error && !(error instanceof Error)) {
|
|
2698
|
-
printWarning$
|
|
2677
|
+
printWarning$3(
|
|
2699
2678
|
(componentName || 'React class') + ': type specification of ' +
|
|
2700
2679
|
location + ' `' + typeSpecName + '` is invalid; the type checker ' +
|
|
2701
2680
|
'function must return `null` or an `Error` but returned a ' + typeof error + '. ' +
|
|
@@ -2704,14 +2683,14 @@ function checkPropTypes$1(typeSpecs, values, location, componentName, getStack)
|
|
|
2704
2683
|
'shape all require an argument).'
|
|
2705
2684
|
);
|
|
2706
2685
|
}
|
|
2707
|
-
if (error instanceof Error && !(error.message in loggedTypeFailures)) {
|
|
2686
|
+
if (error instanceof Error && !(error.message in loggedTypeFailures$1)) {
|
|
2708
2687
|
// Only monitor this failure once because there tends to be a lot of the
|
|
2709
2688
|
// same error.
|
|
2710
|
-
loggedTypeFailures[error.message] = true;
|
|
2689
|
+
loggedTypeFailures$1[error.message] = true;
|
|
2711
2690
|
|
|
2712
2691
|
var stack = getStack ? getStack() : '';
|
|
2713
2692
|
|
|
2714
|
-
printWarning$
|
|
2693
|
+
printWarning$3(
|
|
2715
2694
|
'Failed ' + location + ' type: ' + error.message + (stack != null ? stack : '')
|
|
2716
2695
|
);
|
|
2717
2696
|
}
|
|
@@ -2725,13 +2704,13 @@ function checkPropTypes$1(typeSpecs, values, location, componentName, getStack)
|
|
|
2725
2704
|
*
|
|
2726
2705
|
* @private
|
|
2727
2706
|
*/
|
|
2728
|
-
checkPropTypes$
|
|
2707
|
+
checkPropTypes$3.resetWarningCache = function() {
|
|
2729
2708
|
if (process.env.NODE_ENV !== 'production') {
|
|
2730
|
-
loggedTypeFailures = {};
|
|
2709
|
+
loggedTypeFailures$1 = {};
|
|
2731
2710
|
}
|
|
2732
2711
|
};
|
|
2733
2712
|
|
|
2734
|
-
var checkPropTypes_1 = checkPropTypes$
|
|
2713
|
+
var checkPropTypes_1$1 = checkPropTypes$3;
|
|
2735
2714
|
|
|
2736
2715
|
/**
|
|
2737
2716
|
* Copyright (c) 2013-present, Facebook, Inc.
|
|
@@ -2740,17 +2719,17 @@ var checkPropTypes_1 = checkPropTypes$1;
|
|
|
2740
2719
|
* LICENSE file in the root directory of this source tree.
|
|
2741
2720
|
*/
|
|
2742
2721
|
|
|
2743
|
-
var ReactIs$
|
|
2744
|
-
var assign = objectAssign$1;
|
|
2722
|
+
var ReactIs$3 = reactIs$1.exports;
|
|
2723
|
+
var assign$1 = objectAssign$1;
|
|
2745
2724
|
|
|
2746
|
-
var ReactPropTypesSecret$
|
|
2747
|
-
var
|
|
2725
|
+
var ReactPropTypesSecret$5 = ReactPropTypesSecret_1$1;
|
|
2726
|
+
var has$2 = has$4;
|
|
2727
|
+
var checkPropTypes$2 = checkPropTypes_1$1;
|
|
2748
2728
|
|
|
2749
|
-
var
|
|
2750
|
-
var printWarning = function() {};
|
|
2729
|
+
var printWarning$2 = function() {};
|
|
2751
2730
|
|
|
2752
2731
|
if (process.env.NODE_ENV !== 'production') {
|
|
2753
|
-
printWarning = function(text) {
|
|
2732
|
+
printWarning$2 = function(text) {
|
|
2754
2733
|
var message = 'Warning: ' + text;
|
|
2755
2734
|
if (typeof console !== 'undefined') {
|
|
2756
2735
|
console.error(message);
|
|
@@ -2764,11 +2743,11 @@ if (process.env.NODE_ENV !== 'production') {
|
|
|
2764
2743
|
};
|
|
2765
2744
|
}
|
|
2766
2745
|
|
|
2767
|
-
function emptyFunctionThatReturnsNull() {
|
|
2746
|
+
function emptyFunctionThatReturnsNull$1() {
|
|
2768
2747
|
return null;
|
|
2769
2748
|
}
|
|
2770
2749
|
|
|
2771
|
-
var factoryWithTypeCheckers = function(isValidElement, throwOnDirectAccess) {
|
|
2750
|
+
var factoryWithTypeCheckers$1 = function(isValidElement, throwOnDirectAccess) {
|
|
2772
2751
|
/* global Symbol */
|
|
2773
2752
|
var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
|
|
2774
2753
|
var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec.
|
|
@@ -2847,6 +2826,7 @@ var factoryWithTypeCheckers = function(isValidElement, throwOnDirectAccess) {
|
|
|
2847
2826
|
// Keep this list in sync with production version in `./factoryWithThrowingShims.js`.
|
|
2848
2827
|
var ReactPropTypes = {
|
|
2849
2828
|
array: createPrimitiveTypeChecker('array'),
|
|
2829
|
+
bigint: createPrimitiveTypeChecker('bigint'),
|
|
2850
2830
|
bool: createPrimitiveTypeChecker('boolean'),
|
|
2851
2831
|
func: createPrimitiveTypeChecker('function'),
|
|
2852
2832
|
number: createPrimitiveTypeChecker('number'),
|
|
@@ -2892,8 +2872,9 @@ var factoryWithTypeCheckers = function(isValidElement, throwOnDirectAccess) {
|
|
|
2892
2872
|
* is prohibitively expensive if they are created too often, such as what
|
|
2893
2873
|
* happens in oneOfType() for any type before the one that matched.
|
|
2894
2874
|
*/
|
|
2895
|
-
function PropTypeError(message) {
|
|
2875
|
+
function PropTypeError(message, data) {
|
|
2896
2876
|
this.message = message;
|
|
2877
|
+
this.data = data && typeof data === 'object' ? data: {};
|
|
2897
2878
|
this.stack = '';
|
|
2898
2879
|
}
|
|
2899
2880
|
// Make `instanceof Error` still work for returned errors.
|
|
@@ -2908,7 +2889,7 @@ var factoryWithTypeCheckers = function(isValidElement, throwOnDirectAccess) {
|
|
|
2908
2889
|
componentName = componentName || ANONYMOUS;
|
|
2909
2890
|
propFullName = propFullName || propName;
|
|
2910
2891
|
|
|
2911
|
-
if (secret !== ReactPropTypesSecret$
|
|
2892
|
+
if (secret !== ReactPropTypesSecret$5) {
|
|
2912
2893
|
if (throwOnDirectAccess) {
|
|
2913
2894
|
// New behavior only for users of `prop-types` package
|
|
2914
2895
|
var err = new Error(
|
|
@@ -2926,9 +2907,9 @@ var factoryWithTypeCheckers = function(isValidElement, throwOnDirectAccess) {
|
|
|
2926
2907
|
// Avoid spamming the console because they are often not actionable except for lib authors
|
|
2927
2908
|
manualPropTypeWarningCount < 3
|
|
2928
2909
|
) {
|
|
2929
|
-
printWarning(
|
|
2910
|
+
printWarning$2(
|
|
2930
2911
|
'You are manually calling a React.PropTypes validation ' +
|
|
2931
|
-
'function for the `' + propFullName + '` prop on `' + componentName
|
|
2912
|
+
'function for the `' + propFullName + '` prop on `' + componentName + '`. This is deprecated ' +
|
|
2932
2913
|
'and will throw in the standalone `prop-types` package. ' +
|
|
2933
2914
|
'You may be seeing this warning due to a third-party PropTypes ' +
|
|
2934
2915
|
'library. See https://fb.me/react-warning-dont-call-proptypes ' + 'for details.'
|
|
@@ -2967,7 +2948,10 @@ var factoryWithTypeCheckers = function(isValidElement, throwOnDirectAccess) {
|
|
|
2967
2948
|
// 'of type `object`'.
|
|
2968
2949
|
var preciseType = getPreciseType(propValue);
|
|
2969
2950
|
|
|
2970
|
-
return new PropTypeError(
|
|
2951
|
+
return new PropTypeError(
|
|
2952
|
+
'Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.'),
|
|
2953
|
+
{expectedType: expectedType}
|
|
2954
|
+
);
|
|
2971
2955
|
}
|
|
2972
2956
|
return null;
|
|
2973
2957
|
}
|
|
@@ -2975,7 +2959,7 @@ var factoryWithTypeCheckers = function(isValidElement, throwOnDirectAccess) {
|
|
|
2975
2959
|
}
|
|
2976
2960
|
|
|
2977
2961
|
function createAnyTypeChecker() {
|
|
2978
|
-
return createChainableTypeChecker(emptyFunctionThatReturnsNull);
|
|
2962
|
+
return createChainableTypeChecker(emptyFunctionThatReturnsNull$1);
|
|
2979
2963
|
}
|
|
2980
2964
|
|
|
2981
2965
|
function createArrayOfTypeChecker(typeChecker) {
|
|
@@ -2989,7 +2973,7 @@ var factoryWithTypeCheckers = function(isValidElement, throwOnDirectAccess) {
|
|
|
2989
2973
|
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an array.'));
|
|
2990
2974
|
}
|
|
2991
2975
|
for (var i = 0; i < propValue.length; i++) {
|
|
2992
|
-
var error = typeChecker(propValue, i, componentName, location, propFullName + '[' + i + ']', ReactPropTypesSecret$
|
|
2976
|
+
var error = typeChecker(propValue, i, componentName, location, propFullName + '[' + i + ']', ReactPropTypesSecret$5);
|
|
2993
2977
|
if (error instanceof Error) {
|
|
2994
2978
|
return error;
|
|
2995
2979
|
}
|
|
@@ -3014,7 +2998,7 @@ var factoryWithTypeCheckers = function(isValidElement, throwOnDirectAccess) {
|
|
|
3014
2998
|
function createElementTypeTypeChecker() {
|
|
3015
2999
|
function validate(props, propName, componentName, location, propFullName) {
|
|
3016
3000
|
var propValue = props[propName];
|
|
3017
|
-
if (!ReactIs$
|
|
3001
|
+
if (!ReactIs$3.isValidElementType(propValue)) {
|
|
3018
3002
|
var propType = getPropType(propValue);
|
|
3019
3003
|
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement type.'));
|
|
3020
3004
|
}
|
|
@@ -3039,15 +3023,15 @@ var factoryWithTypeCheckers = function(isValidElement, throwOnDirectAccess) {
|
|
|
3039
3023
|
if (!Array.isArray(expectedValues)) {
|
|
3040
3024
|
if (process.env.NODE_ENV !== 'production') {
|
|
3041
3025
|
if (arguments.length > 1) {
|
|
3042
|
-
printWarning(
|
|
3026
|
+
printWarning$2(
|
|
3043
3027
|
'Invalid arguments supplied to oneOf, expected an array, got ' + arguments.length + ' arguments. ' +
|
|
3044
3028
|
'A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z]).'
|
|
3045
3029
|
);
|
|
3046
3030
|
} else {
|
|
3047
|
-
printWarning('Invalid argument supplied to oneOf, expected an array.');
|
|
3031
|
+
printWarning$2('Invalid argument supplied to oneOf, expected an array.');
|
|
3048
3032
|
}
|
|
3049
3033
|
}
|
|
3050
|
-
return emptyFunctionThatReturnsNull;
|
|
3034
|
+
return emptyFunctionThatReturnsNull$1;
|
|
3051
3035
|
}
|
|
3052
3036
|
|
|
3053
3037
|
function validate(props, propName, componentName, location, propFullName) {
|
|
@@ -3081,8 +3065,8 @@ var factoryWithTypeCheckers = function(isValidElement, throwOnDirectAccess) {
|
|
|
3081
3065
|
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an object.'));
|
|
3082
3066
|
}
|
|
3083
3067
|
for (var key in propValue) {
|
|
3084
|
-
if (has(propValue, key)) {
|
|
3085
|
-
var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret$
|
|
3068
|
+
if (has$2(propValue, key)) {
|
|
3069
|
+
var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret$5);
|
|
3086
3070
|
if (error instanceof Error) {
|
|
3087
3071
|
return error;
|
|
3088
3072
|
}
|
|
@@ -3095,30 +3079,35 @@ var factoryWithTypeCheckers = function(isValidElement, throwOnDirectAccess) {
|
|
|
3095
3079
|
|
|
3096
3080
|
function createUnionTypeChecker(arrayOfTypeCheckers) {
|
|
3097
3081
|
if (!Array.isArray(arrayOfTypeCheckers)) {
|
|
3098
|
-
process.env.NODE_ENV !== 'production' ? printWarning('Invalid argument supplied to oneOfType, expected an instance of array.') : void 0;
|
|
3099
|
-
return emptyFunctionThatReturnsNull;
|
|
3082
|
+
process.env.NODE_ENV !== 'production' ? printWarning$2('Invalid argument supplied to oneOfType, expected an instance of array.') : void 0;
|
|
3083
|
+
return emptyFunctionThatReturnsNull$1;
|
|
3100
3084
|
}
|
|
3101
3085
|
|
|
3102
3086
|
for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
|
|
3103
3087
|
var checker = arrayOfTypeCheckers[i];
|
|
3104
3088
|
if (typeof checker !== 'function') {
|
|
3105
|
-
printWarning(
|
|
3089
|
+
printWarning$2(
|
|
3106
3090
|
'Invalid argument supplied to oneOfType. Expected an array of check functions, but ' +
|
|
3107
3091
|
'received ' + getPostfixForTypeWarning(checker) + ' at index ' + i + '.'
|
|
3108
3092
|
);
|
|
3109
|
-
return emptyFunctionThatReturnsNull;
|
|
3093
|
+
return emptyFunctionThatReturnsNull$1;
|
|
3110
3094
|
}
|
|
3111
3095
|
}
|
|
3112
3096
|
|
|
3113
3097
|
function validate(props, propName, componentName, location, propFullName) {
|
|
3098
|
+
var expectedTypes = [];
|
|
3114
3099
|
for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
|
|
3115
3100
|
var checker = arrayOfTypeCheckers[i];
|
|
3116
|
-
|
|
3101
|
+
var checkerResult = checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret$5);
|
|
3102
|
+
if (checkerResult == null) {
|
|
3117
3103
|
return null;
|
|
3118
3104
|
}
|
|
3105
|
+
if (checkerResult.data && has$2(checkerResult.data, 'expectedType')) {
|
|
3106
|
+
expectedTypes.push(checkerResult.data.expectedType);
|
|
3107
|
+
}
|
|
3119
3108
|
}
|
|
3120
|
-
|
|
3121
|
-
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '
|
|
3109
|
+
var expectedTypesMessage = (expectedTypes.length > 0) ? ', expected one of type [' + expectedTypes.join(', ') + ']': '';
|
|
3110
|
+
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`' + expectedTypesMessage + '.'));
|
|
3122
3111
|
}
|
|
3123
3112
|
return createChainableTypeChecker(validate);
|
|
3124
3113
|
}
|
|
@@ -3133,6 +3122,13 @@ var factoryWithTypeCheckers = function(isValidElement, throwOnDirectAccess) {
|
|
|
3133
3122
|
return createChainableTypeChecker(validate);
|
|
3134
3123
|
}
|
|
3135
3124
|
|
|
3125
|
+
function invalidValidatorError(componentName, location, propFullName, key, type) {
|
|
3126
|
+
return new PropTypeError(
|
|
3127
|
+
(componentName || 'React class') + ': ' + location + ' type `' + propFullName + '.' + key + '` is invalid; ' +
|
|
3128
|
+
'it must be a function, usually from the `prop-types` package, but received `' + type + '`.'
|
|
3129
|
+
);
|
|
3130
|
+
}
|
|
3131
|
+
|
|
3136
3132
|
function createShapeTypeChecker(shapeTypes) {
|
|
3137
3133
|
function validate(props, propName, componentName, location, propFullName) {
|
|
3138
3134
|
var propValue = props[propName];
|
|
@@ -3142,10 +3138,10 @@ var factoryWithTypeCheckers = function(isValidElement, throwOnDirectAccess) {
|
|
|
3142
3138
|
}
|
|
3143
3139
|
for (var key in shapeTypes) {
|
|
3144
3140
|
var checker = shapeTypes[key];
|
|
3145
|
-
if (
|
|
3146
|
-
|
|
3141
|
+
if (typeof checker !== 'function') {
|
|
3142
|
+
return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker));
|
|
3147
3143
|
}
|
|
3148
|
-
var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret$
|
|
3144
|
+
var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret$5);
|
|
3149
3145
|
if (error) {
|
|
3150
3146
|
return error;
|
|
3151
3147
|
}
|
|
@@ -3162,19 +3158,21 @@ var factoryWithTypeCheckers = function(isValidElement, throwOnDirectAccess) {
|
|
|
3162
3158
|
if (propType !== 'object') {
|
|
3163
3159
|
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
|
|
3164
3160
|
}
|
|
3165
|
-
// We need to check all keys in case some are required but missing from
|
|
3166
|
-
|
|
3167
|
-
var allKeys = assign({}, props[propName], shapeTypes);
|
|
3161
|
+
// We need to check all keys in case some are required but missing from props.
|
|
3162
|
+
var allKeys = assign$1({}, props[propName], shapeTypes);
|
|
3168
3163
|
for (var key in allKeys) {
|
|
3169
3164
|
var checker = shapeTypes[key];
|
|
3165
|
+
if (has$2(shapeTypes, key) && typeof checker !== 'function') {
|
|
3166
|
+
return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker));
|
|
3167
|
+
}
|
|
3170
3168
|
if (!checker) {
|
|
3171
3169
|
return new PropTypeError(
|
|
3172
3170
|
'Invalid ' + location + ' `' + propFullName + '` key `' + key + '` supplied to `' + componentName + '`.' +
|
|
3173
3171
|
'\nBad object: ' + JSON.stringify(props[propName], null, ' ') +
|
|
3174
|
-
'\nValid keys: ' +
|
|
3172
|
+
'\nValid keys: ' + JSON.stringify(Object.keys(shapeTypes), null, ' ')
|
|
3175
3173
|
);
|
|
3176
3174
|
}
|
|
3177
|
-
var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret$
|
|
3175
|
+
var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret$5);
|
|
3178
3176
|
if (error) {
|
|
3179
3177
|
return error;
|
|
3180
3178
|
}
|
|
@@ -3316,8 +3314,8 @@ var factoryWithTypeCheckers = function(isValidElement, throwOnDirectAccess) {
|
|
|
3316
3314
|
return propValue.constructor.name;
|
|
3317
3315
|
}
|
|
3318
3316
|
|
|
3319
|
-
ReactPropTypes.checkPropTypes = checkPropTypes;
|
|
3320
|
-
ReactPropTypes.resetWarningCache = checkPropTypes.resetWarningCache;
|
|
3317
|
+
ReactPropTypes.checkPropTypes = checkPropTypes$2;
|
|
3318
|
+
ReactPropTypes.resetWarningCache = checkPropTypes$2.resetWarningCache;
|
|
3321
3319
|
ReactPropTypes.PropTypes = ReactPropTypes;
|
|
3322
3320
|
|
|
3323
3321
|
return ReactPropTypes;
|
|
@@ -3330,15 +3328,15 @@ var factoryWithTypeCheckers = function(isValidElement, throwOnDirectAccess) {
|
|
|
3330
3328
|
* LICENSE file in the root directory of this source tree.
|
|
3331
3329
|
*/
|
|
3332
3330
|
|
|
3333
|
-
var ReactPropTypesSecret = ReactPropTypesSecret_1;
|
|
3331
|
+
var ReactPropTypesSecret$4 = ReactPropTypesSecret_1$1;
|
|
3334
3332
|
|
|
3335
|
-
function emptyFunction() {}
|
|
3336
|
-
function emptyFunctionWithReset() {}
|
|
3337
|
-
emptyFunctionWithReset.resetWarningCache = emptyFunction;
|
|
3333
|
+
function emptyFunction$1() {}
|
|
3334
|
+
function emptyFunctionWithReset$1() {}
|
|
3335
|
+
emptyFunctionWithReset$1.resetWarningCache = emptyFunction$1;
|
|
3338
3336
|
|
|
3339
|
-
var factoryWithThrowingShims = function() {
|
|
3337
|
+
var factoryWithThrowingShims$1 = function() {
|
|
3340
3338
|
function shim(props, propName, componentName, location, propFullName, secret) {
|
|
3341
|
-
if (secret === ReactPropTypesSecret) {
|
|
3339
|
+
if (secret === ReactPropTypesSecret$4) {
|
|
3342
3340
|
// It is still safe when called from React.
|
|
3343
3341
|
return;
|
|
3344
3342
|
}
|
|
@@ -3356,6 +3354,7 @@ var factoryWithThrowingShims = function() {
|
|
|
3356
3354
|
// Keep this list in sync with production version in `./factoryWithTypeCheckers.js`.
|
|
3357
3355
|
var ReactPropTypes = {
|
|
3358
3356
|
array: shim,
|
|
3357
|
+
bigint: shim,
|
|
3359
3358
|
bool: shim,
|
|
3360
3359
|
func: shim,
|
|
3361
3360
|
number: shim,
|
|
@@ -3375,8 +3374,8 @@ var factoryWithThrowingShims = function() {
|
|
|
3375
3374
|
shape: getShim,
|
|
3376
3375
|
exact: getShim,
|
|
3377
3376
|
|
|
3378
|
-
checkPropTypes: emptyFunctionWithReset,
|
|
3379
|
-
resetWarningCache: emptyFunction
|
|
3377
|
+
checkPropTypes: emptyFunctionWithReset$1,
|
|
3378
|
+
resetWarningCache: emptyFunction$1
|
|
3380
3379
|
};
|
|
3381
3380
|
|
|
3382
3381
|
ReactPropTypes.PropTypes = ReactPropTypes;
|
|
@@ -3392,34 +3391,183 @@ var factoryWithThrowingShims = function() {
|
|
|
3392
3391
|
*/
|
|
3393
3392
|
|
|
3394
3393
|
if (process.env.NODE_ENV !== 'production') {
|
|
3395
|
-
var ReactIs = reactIs.exports;
|
|
3394
|
+
var ReactIs$2 = reactIs$1.exports;
|
|
3396
3395
|
|
|
3397
3396
|
// By explicitly using `prop-types` you are opting into new development behavior.
|
|
3398
3397
|
// http://fb.me/prop-types-in-prod
|
|
3399
|
-
var throwOnDirectAccess = true;
|
|
3400
|
-
propTypes.exports = factoryWithTypeCheckers(ReactIs.isElement, throwOnDirectAccess);
|
|
3398
|
+
var throwOnDirectAccess$1 = true;
|
|
3399
|
+
propTypes$1.exports = factoryWithTypeCheckers$1(ReactIs$2.isElement, throwOnDirectAccess$1);
|
|
3401
3400
|
} else {
|
|
3402
3401
|
// By explicitly using `prop-types` you are opting into new production behavior.
|
|
3403
3402
|
// http://fb.me/prop-types-in-prod
|
|
3404
|
-
propTypes.exports = factoryWithThrowingShims();
|
|
3403
|
+
propTypes$1.exports = factoryWithThrowingShims$1();
|
|
3405
3404
|
}
|
|
3406
3405
|
|
|
3407
|
-
var PropTypes = propTypes.exports;
|
|
3406
|
+
var PropTypes = propTypes$1.exports;
|
|
3407
|
+
|
|
3408
|
+
/******************************************************************************
|
|
3409
|
+
Copyright (c) Microsoft Corporation.
|
|
3410
|
+
|
|
3411
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
3412
|
+
purpose with or without fee is hereby granted.
|
|
3413
|
+
|
|
3414
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
3415
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
3416
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
3417
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
3418
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
3419
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
3420
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
3421
|
+
***************************************************************************** */
|
|
3422
|
+
|
|
3423
|
+
function __awaiter(thisArg, _arguments, P, generator) {
|
|
3424
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3425
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
3426
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
3427
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
3428
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
3429
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
3430
|
+
});
|
|
3431
|
+
}
|
|
3432
|
+
|
|
3433
|
+
function __generator(thisArg, body) {
|
|
3434
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
3435
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
3436
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
3437
|
+
function step(op) {
|
|
3438
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
3439
|
+
while (_) try {
|
|
3440
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
3441
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
3442
|
+
switch (op[0]) {
|
|
3443
|
+
case 0: case 1: t = op; break;
|
|
3444
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
3445
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
3446
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
3447
|
+
default:
|
|
3448
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
3449
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
3450
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
3451
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
3452
|
+
if (t[2]) _.ops.pop();
|
|
3453
|
+
_.trys.pop(); continue;
|
|
3454
|
+
}
|
|
3455
|
+
op = body.call(thisArg, _);
|
|
3456
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
3457
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
3458
|
+
}
|
|
3459
|
+
}
|
|
3460
|
+
|
|
3461
|
+
function __read(o, n) {
|
|
3462
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
3463
|
+
if (!m) return o;
|
|
3464
|
+
var i = m.call(o), r, ar = [], e;
|
|
3465
|
+
try {
|
|
3466
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
3467
|
+
}
|
|
3468
|
+
catch (error) { e = { error: error }; }
|
|
3469
|
+
finally {
|
|
3470
|
+
try {
|
|
3471
|
+
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
3472
|
+
}
|
|
3473
|
+
finally { if (e) throw e.error; }
|
|
3474
|
+
}
|
|
3475
|
+
return ar;
|
|
3476
|
+
}
|
|
3477
|
+
|
|
3478
|
+
function __spreadArray(to, from, pack) {
|
|
3479
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
3480
|
+
if (ar || !(i in from)) {
|
|
3481
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
3482
|
+
ar[i] = from[i];
|
|
3483
|
+
}
|
|
3484
|
+
}
|
|
3485
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
3486
|
+
}
|
|
3408
3487
|
|
|
3409
3488
|
var COMMON_MIME_TYPES = new Map([
|
|
3410
|
-
|
|
3489
|
+
// https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types
|
|
3490
|
+
['aac', 'audio/aac'],
|
|
3491
|
+
['abw', 'application/x-abiword'],
|
|
3492
|
+
['arc', 'application/x-freearc'],
|
|
3493
|
+
['avif', 'image/avif'],
|
|
3494
|
+
['avi', 'video/x-msvideo'],
|
|
3495
|
+
['azw', 'application/vnd.amazon.ebook'],
|
|
3496
|
+
['bin', 'application/octet-stream'],
|
|
3497
|
+
['bmp', 'image/bmp'],
|
|
3498
|
+
['bz', 'application/x-bzip'],
|
|
3499
|
+
['bz2', 'application/x-bzip2'],
|
|
3500
|
+
['cda', 'application/x-cdf'],
|
|
3501
|
+
['csh', 'application/x-csh'],
|
|
3502
|
+
['css', 'text/css'],
|
|
3503
|
+
['csv', 'text/csv'],
|
|
3504
|
+
['doc', 'application/msword'],
|
|
3505
|
+
['docx', 'application/vnd.openxmlformats-officedocument.wordprocessingml.document'],
|
|
3506
|
+
['eot', 'application/vnd.ms-fontobject'],
|
|
3507
|
+
['epub', 'application/epub+zip'],
|
|
3508
|
+
['gz', 'application/gzip'],
|
|
3411
3509
|
['gif', 'image/gif'],
|
|
3412
|
-
['
|
|
3510
|
+
['heic', 'image/heic'],
|
|
3511
|
+
['heif', 'image/heif'],
|
|
3512
|
+
['htm', 'text/html'],
|
|
3513
|
+
['html', 'text/html'],
|
|
3514
|
+
['ico', 'image/vnd.microsoft.icon'],
|
|
3515
|
+
['ics', 'text/calendar'],
|
|
3516
|
+
['jar', 'application/java-archive'],
|
|
3413
3517
|
['jpeg', 'image/jpeg'],
|
|
3414
3518
|
['jpg', 'image/jpeg'],
|
|
3415
|
-
['
|
|
3416
|
-
['
|
|
3519
|
+
['js', 'text/javascript'],
|
|
3520
|
+
['json', 'application/json'],
|
|
3521
|
+
['jsonld', 'application/ld+json'],
|
|
3522
|
+
['mid', 'audio/midi'],
|
|
3523
|
+
['midi', 'audio/midi'],
|
|
3524
|
+
['mjs', 'text/javascript'],
|
|
3525
|
+
['mp3', 'audio/mpeg'],
|
|
3417
3526
|
['mp4', 'video/mp4'],
|
|
3418
|
-
['
|
|
3527
|
+
['mpeg', 'video/mpeg'],
|
|
3528
|
+
['mpkg', 'application/vnd.apple.installer+xml'],
|
|
3529
|
+
['odp', 'application/vnd.oasis.opendocument.presentation'],
|
|
3530
|
+
['ods', 'application/vnd.oasis.opendocument.spreadsheet'],
|
|
3531
|
+
['odt', 'application/vnd.oasis.opendocument.text'],
|
|
3532
|
+
['oga', 'audio/ogg'],
|
|
3533
|
+
['ogv', 'video/ogg'],
|
|
3534
|
+
['ogx', 'application/ogg'],
|
|
3535
|
+
['opus', 'audio/opus'],
|
|
3536
|
+
['otf', 'font/otf'],
|
|
3419
3537
|
['png', 'image/png'],
|
|
3538
|
+
['pdf', 'application/pdf'],
|
|
3539
|
+
['php', 'application/x-httpd-php'],
|
|
3540
|
+
['ppt', 'application/vnd.ms-powerpoint'],
|
|
3541
|
+
['pptx', 'application/vnd.openxmlformats-officedocument.presentationml.presentation'],
|
|
3542
|
+
['rar', 'application/vnd.rar'],
|
|
3543
|
+
['rtf', 'application/rtf'],
|
|
3544
|
+
['sh', 'application/x-sh'],
|
|
3545
|
+
['svg', 'image/svg+xml'],
|
|
3546
|
+
['swf', 'application/x-shockwave-flash'],
|
|
3547
|
+
['tar', 'application/x-tar'],
|
|
3548
|
+
['tif', 'image/tiff'],
|
|
3549
|
+
['tiff', 'image/tiff'],
|
|
3550
|
+
['ts', 'video/mp2t'],
|
|
3551
|
+
['ttf', 'font/ttf'],
|
|
3552
|
+
['txt', 'text/plain'],
|
|
3553
|
+
['vsd', 'application/vnd.visio'],
|
|
3554
|
+
['wav', 'audio/wav'],
|
|
3555
|
+
['weba', 'audio/webm'],
|
|
3556
|
+
['webm', 'video/webm'],
|
|
3557
|
+
['webp', 'image/webp'],
|
|
3558
|
+
['woff', 'font/woff'],
|
|
3559
|
+
['woff2', 'font/woff2'],
|
|
3560
|
+
['xhtml', 'application/xhtml+xml'],
|
|
3561
|
+
['xls', 'application/vnd.ms-excel'],
|
|
3562
|
+
['xlsx', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'],
|
|
3563
|
+
['xml', 'application/xml'],
|
|
3564
|
+
['xul', 'application/vnd.mozilla.xul+xml'],
|
|
3420
3565
|
['zip', 'application/zip'],
|
|
3421
|
-
['
|
|
3422
|
-
|
|
3566
|
+
['7z', 'application/x-7z-compressed'],
|
|
3567
|
+
// Others
|
|
3568
|
+
['mkv', 'video/x-matroska'],
|
|
3569
|
+
['mov', 'video/quicktime'],
|
|
3570
|
+
['msg', 'application/vnd.ms-outlook']
|
|
3423
3571
|
]);
|
|
3424
3572
|
function toFileWithPath(file, path) {
|
|
3425
3573
|
var f = withMimeType(file);
|
|
@@ -3469,30 +3617,53 @@ var FILES_TO_IGNORE = [
|
|
|
3469
3617
|
* Convert a DragEvent's DataTrasfer object to a list of File objects
|
|
3470
3618
|
* NOTE: If some of the items are folders,
|
|
3471
3619
|
* everything will be flattened and placed in the same list but the paths will be kept as a {path} property.
|
|
3620
|
+
*
|
|
3621
|
+
* EXPERIMENTAL: A list of https://developer.mozilla.org/en-US/docs/Web/API/FileSystemHandle objects can also be passed as an arg
|
|
3622
|
+
* and a list of File objects will be returned.
|
|
3623
|
+
*
|
|
3472
3624
|
* @param evt
|
|
3473
3625
|
*/
|
|
3474
3626
|
function fromEvent(evt) {
|
|
3475
3627
|
return __awaiter(this, void 0, void 0, function () {
|
|
3476
3628
|
return __generator(this, function (_a) {
|
|
3477
|
-
|
|
3478
|
-
|
|
3479
|
-
|
|
3629
|
+
if (isObject$1(evt) && isDataTransfer(evt.dataTransfer)) {
|
|
3630
|
+
return [2 /*return*/, getDataTransferFiles(evt.dataTransfer, evt.type)];
|
|
3631
|
+
}
|
|
3632
|
+
else if (isChangeEvt(evt)) {
|
|
3633
|
+
return [2 /*return*/, getInputFiles(evt)];
|
|
3634
|
+
}
|
|
3635
|
+
else if (Array.isArray(evt) && evt.every(function (item) { return 'getFile' in item && typeof item.getFile === 'function'; })) {
|
|
3636
|
+
return [2 /*return*/, getFsHandleFiles(evt)];
|
|
3637
|
+
}
|
|
3638
|
+
return [2 /*return*/, []];
|
|
3480
3639
|
});
|
|
3481
3640
|
});
|
|
3482
3641
|
}
|
|
3483
|
-
function
|
|
3484
|
-
return
|
|
3642
|
+
function isDataTransfer(value) {
|
|
3643
|
+
return isObject$1(value);
|
|
3644
|
+
}
|
|
3645
|
+
function isChangeEvt(value) {
|
|
3646
|
+
return isObject$1(value) && isObject$1(value.target);
|
|
3647
|
+
}
|
|
3648
|
+
function isObject$1(v) {
|
|
3649
|
+
return typeof v === 'object' && v !== null;
|
|
3485
3650
|
}
|
|
3486
3651
|
function getInputFiles(evt) {
|
|
3487
|
-
|
|
3488
|
-
? evt.target.files
|
|
3489
|
-
? fromList(evt.target.files)
|
|
3490
|
-
: []
|
|
3491
|
-
: [];
|
|
3492
|
-
return files.map(function (file) { return toFileWithPath(file); });
|
|
3652
|
+
return fromList(evt.target.files).map(function (file) { return toFileWithPath(file); });
|
|
3493
3653
|
}
|
|
3494
|
-
|
|
3495
|
-
|
|
3654
|
+
// Ee expect each handle to be https://developer.mozilla.org/en-US/docs/Web/API/FileSystemFileHandle
|
|
3655
|
+
function getFsHandleFiles(handles) {
|
|
3656
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
3657
|
+
var files;
|
|
3658
|
+
return __generator(this, function (_a) {
|
|
3659
|
+
switch (_a.label) {
|
|
3660
|
+
case 0: return [4 /*yield*/, Promise.all(handles.map(function (h) { return h.getFile(); }))];
|
|
3661
|
+
case 1:
|
|
3662
|
+
files = _a.sent();
|
|
3663
|
+
return [2 /*return*/, files.map(function (file) { return toFileWithPath(file); })];
|
|
3664
|
+
}
|
|
3665
|
+
});
|
|
3666
|
+
});
|
|
3496
3667
|
}
|
|
3497
3668
|
function getDataTransferFiles(dt, type) {
|
|
3498
3669
|
return __awaiter(this, void 0, void 0, function () {
|
|
@@ -3526,6 +3697,9 @@ function noIgnoredFiles(files) {
|
|
|
3526
3697
|
// https://developer.mozilla.org/en-US/docs/Web/API/FileList
|
|
3527
3698
|
// https://developer.mozilla.org/en-US/docs/Web/API/DataTransferItemList
|
|
3528
3699
|
function fromList(items) {
|
|
3700
|
+
if (items === null) {
|
|
3701
|
+
return [];
|
|
3702
|
+
}
|
|
3529
3703
|
var files = [];
|
|
3530
3704
|
// tslint:disable: prefer-for-of
|
|
3531
3705
|
for (var i = 0; i < items.length; i++) {
|
|
@@ -3549,12 +3723,12 @@ function toFilePromises(item) {
|
|
|
3549
3723
|
return fromDataTransferItem(item);
|
|
3550
3724
|
}
|
|
3551
3725
|
function flatten(items) {
|
|
3552
|
-
return items.reduce(function (acc, files) { return
|
|
3726
|
+
return items.reduce(function (acc, files) { return __spreadArray(__spreadArray([], __read(acc), false), __read((Array.isArray(files) ? flatten(files) : [files])), false); }, []);
|
|
3553
3727
|
}
|
|
3554
3728
|
function fromDataTransferItem(item) {
|
|
3555
3729
|
var file = item.getAsFile();
|
|
3556
3730
|
if (!file) {
|
|
3557
|
-
return Promise.reject(item
|
|
3731
|
+
return Promise.reject("".concat(item, " is not a File"));
|
|
3558
3732
|
}
|
|
3559
3733
|
var fwp = toFileWithPath(file);
|
|
3560
3734
|
return Promise.resolve(fwp);
|
|
@@ -3650,6 +3824,20 @@ var _default = function (file, acceptedFiles) {
|
|
|
3650
3824
|
return true;
|
|
3651
3825
|
};
|
|
3652
3826
|
|
|
3827
|
+
function _toConsumableArray$1(arr) { return _arrayWithoutHoles$1(arr) || _iterableToArray$1(arr) || _unsupportedIterableToArray$1(arr) || _nonIterableSpread$1(); }
|
|
3828
|
+
|
|
3829
|
+
function _nonIterableSpread$1() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
3830
|
+
|
|
3831
|
+
function _iterableToArray$1(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
3832
|
+
|
|
3833
|
+
function _arrayWithoutHoles$1(arr) { if (Array.isArray(arr)) return _arrayLikeToArray$1(arr); }
|
|
3834
|
+
|
|
3835
|
+
function ownKeys$1(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
3836
|
+
|
|
3837
|
+
function _objectSpread$1(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$1(Object(source), !0).forEach(function (key) { _defineProperty$1(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$1(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
3838
|
+
|
|
3839
|
+
function _defineProperty$1(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
3840
|
+
|
|
3653
3841
|
function _slicedToArray$2(arr, i) { return _arrayWithHoles$1(arr) || _iterableToArrayLimit$1(arr, i) || _unsupportedIterableToArray$1(arr, i) || _nonIterableRest$1(); }
|
|
3654
3842
|
|
|
3655
3843
|
function _nonIterableRest$1() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
@@ -3658,18 +3846,18 @@ function _unsupportedIterableToArray$1(o, minLen) { if (!o) return; if (typeof o
|
|
|
3658
3846
|
|
|
3659
3847
|
function _arrayLikeToArray$1(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
3660
3848
|
|
|
3661
|
-
function _iterableToArrayLimit$1(arr, i) {
|
|
3849
|
+
function _iterableToArrayLimit$1(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
3662
3850
|
|
|
3663
3851
|
function _arrayWithHoles$1(arr) { if (Array.isArray(arr)) return arr; }
|
|
3664
3852
|
|
|
3665
|
-
var FILE_INVALID_TYPE =
|
|
3666
|
-
var FILE_TOO_LARGE =
|
|
3667
|
-
var FILE_TOO_SMALL =
|
|
3668
|
-
var TOO_MANY_FILES =
|
|
3853
|
+
var FILE_INVALID_TYPE = "file-invalid-type";
|
|
3854
|
+
var FILE_TOO_LARGE = "file-too-large";
|
|
3855
|
+
var FILE_TOO_SMALL = "file-too-small";
|
|
3856
|
+
var TOO_MANY_FILES = "too-many-files";
|
|
3669
3857
|
|
|
3670
3858
|
var getInvalidTypeRejectionErr = function getInvalidTypeRejectionErr(accept) {
|
|
3671
3859
|
accept = Array.isArray(accept) && accept.length === 1 ? accept[0] : accept;
|
|
3672
|
-
var messageSuffix = Array.isArray(accept) ? "one of ".concat(accept.join(
|
|
3860
|
+
var messageSuffix = Array.isArray(accept) ? "one of ".concat(accept.join(", ")) : accept;
|
|
3673
3861
|
return {
|
|
3674
3862
|
code: FILE_INVALID_TYPE,
|
|
3675
3863
|
message: "File type must be ".concat(messageSuffix)
|
|
@@ -3678,23 +3866,23 @@ var getInvalidTypeRejectionErr = function getInvalidTypeRejectionErr(accept) {
|
|
|
3678
3866
|
var getTooLargeRejectionErr = function getTooLargeRejectionErr(maxSize) {
|
|
3679
3867
|
return {
|
|
3680
3868
|
code: FILE_TOO_LARGE,
|
|
3681
|
-
message: "File is larger than ".concat(maxSize, " bytes")
|
|
3869
|
+
message: "File is larger than ".concat(maxSize, " ").concat(maxSize === 1 ? "byte" : "bytes")
|
|
3682
3870
|
};
|
|
3683
3871
|
};
|
|
3684
3872
|
var getTooSmallRejectionErr = function getTooSmallRejectionErr(minSize) {
|
|
3685
3873
|
return {
|
|
3686
3874
|
code: FILE_TOO_SMALL,
|
|
3687
|
-
message: "File is smaller than ".concat(minSize, " bytes")
|
|
3875
|
+
message: "File is smaller than ".concat(minSize, " ").concat(minSize === 1 ? "byte" : "bytes")
|
|
3688
3876
|
};
|
|
3689
3877
|
};
|
|
3690
3878
|
var TOO_MANY_FILES_REJECTION = {
|
|
3691
3879
|
code: TOO_MANY_FILES,
|
|
3692
|
-
message:
|
|
3880
|
+
message: "Too many files"
|
|
3693
3881
|
}; // Firefox versions prior to 53 return a bogus MIME type for every file drag, so dragovers with
|
|
3694
3882
|
// that MIME type will always be accepted
|
|
3695
3883
|
|
|
3696
3884
|
function fileAccepted(file, accept) {
|
|
3697
|
-
var isAcceptable = file.type ===
|
|
3885
|
+
var isAcceptable = file.type === "application/x-moz-file" || _default(file, accept);
|
|
3698
3886
|
return [isAcceptable, isAcceptable ? null : getInvalidTypeRejectionErr(accept)];
|
|
3699
3887
|
}
|
|
3700
3888
|
function fileMatchSize(file, minSize, maxSize) {
|
|
@@ -3711,6 +3899,19 @@ function fileMatchSize(file, minSize, maxSize) {
|
|
|
3711
3899
|
function isDefined(value) {
|
|
3712
3900
|
return value !== undefined && value !== null;
|
|
3713
3901
|
}
|
|
3902
|
+
/**
|
|
3903
|
+
*
|
|
3904
|
+
* @param {object} options
|
|
3905
|
+
* @param {File[]} options.files
|
|
3906
|
+
* @param {string|string[]} [options.accept]
|
|
3907
|
+
* @param {number} [options.minSize]
|
|
3908
|
+
* @param {number} [options.maxSize]
|
|
3909
|
+
* @param {boolean} [options.multiple]
|
|
3910
|
+
* @param {number} [options.maxFiles]
|
|
3911
|
+
* @param {(f: File) => FileError|FileError[]|null} [options.validator]
|
|
3912
|
+
* @returns
|
|
3913
|
+
*/
|
|
3914
|
+
|
|
3714
3915
|
|
|
3715
3916
|
function allFilesAccepted(_ref) {
|
|
3716
3917
|
var files = _ref.files,
|
|
@@ -3718,7 +3919,8 @@ function allFilesAccepted(_ref) {
|
|
|
3718
3919
|
minSize = _ref.minSize,
|
|
3719
3920
|
maxSize = _ref.maxSize,
|
|
3720
3921
|
multiple = _ref.multiple,
|
|
3721
|
-
maxFiles = _ref.maxFiles
|
|
3922
|
+
maxFiles = _ref.maxFiles,
|
|
3923
|
+
validator = _ref.validator;
|
|
3722
3924
|
|
|
3723
3925
|
if (!multiple && files.length > 1 || multiple && maxFiles >= 1 && files.length > maxFiles) {
|
|
3724
3926
|
return false;
|
|
@@ -3733,16 +3935,17 @@ function allFilesAccepted(_ref) {
|
|
|
3733
3935
|
_fileMatchSize2 = _slicedToArray$2(_fileMatchSize, 1),
|
|
3734
3936
|
sizeMatch = _fileMatchSize2[0];
|
|
3735
3937
|
|
|
3736
|
-
|
|
3938
|
+
var customErrors = validator ? validator(file) : null;
|
|
3939
|
+
return accepted && sizeMatch && !customErrors;
|
|
3737
3940
|
});
|
|
3738
3941
|
} // React's synthetic events has event.isPropagationStopped,
|
|
3739
3942
|
// but to remain compatibility with other libs (Preact) fall back
|
|
3740
3943
|
// to check event.cancelBubble
|
|
3741
3944
|
|
|
3742
3945
|
function isPropagationStopped(event) {
|
|
3743
|
-
if (typeof event.isPropagationStopped ===
|
|
3946
|
+
if (typeof event.isPropagationStopped === "function") {
|
|
3744
3947
|
return event.isPropagationStopped();
|
|
3745
|
-
} else if (typeof event.cancelBubble !==
|
|
3948
|
+
} else if (typeof event.cancelBubble !== "undefined") {
|
|
3746
3949
|
return event.cancelBubble;
|
|
3747
3950
|
}
|
|
3748
3951
|
|
|
@@ -3756,7 +3959,7 @@ function isEvtWithFiles(event) {
|
|
|
3756
3959
|
|
|
3757
3960
|
|
|
3758
3961
|
return Array.prototype.some.call(event.dataTransfer.types, function (type) {
|
|
3759
|
-
return type ===
|
|
3962
|
+
return type === "Files" || type === "application/x-moz-file";
|
|
3760
3963
|
});
|
|
3761
3964
|
}
|
|
3762
3965
|
|
|
@@ -3765,11 +3968,11 @@ function onDocumentDragOver(event) {
|
|
|
3765
3968
|
}
|
|
3766
3969
|
|
|
3767
3970
|
function isIe(userAgent) {
|
|
3768
|
-
return userAgent.indexOf(
|
|
3971
|
+
return userAgent.indexOf("MSIE") !== -1 || userAgent.indexOf("Trident/") !== -1;
|
|
3769
3972
|
}
|
|
3770
3973
|
|
|
3771
3974
|
function isEdge(userAgent) {
|
|
3772
|
-
return userAgent.indexOf(
|
|
3975
|
+
return userAgent.indexOf("Edge/") !== -1;
|
|
3773
3976
|
}
|
|
3774
3977
|
|
|
3775
3978
|
function isIeOrEdge() {
|
|
@@ -3806,12 +4009,144 @@ function composeEventHandlers() {
|
|
|
3806
4009
|
});
|
|
3807
4010
|
};
|
|
3808
4011
|
}
|
|
4012
|
+
/**
|
|
4013
|
+
* canUseFileSystemAccessAPI checks if the [File System Access API](https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API)
|
|
4014
|
+
* is supported by the browser.
|
|
4015
|
+
* @returns {boolean}
|
|
4016
|
+
*/
|
|
3809
4017
|
|
|
3810
|
-
function
|
|
4018
|
+
function canUseFileSystemAccessAPI() {
|
|
4019
|
+
return "showOpenFilePicker" in window;
|
|
4020
|
+
}
|
|
4021
|
+
/**
|
|
4022
|
+
* Convert the `{accept}` dropzone prop to the
|
|
4023
|
+
* `{types}` option for https://developer.mozilla.org/en-US/docs/Web/API/window/showOpenFilePicker
|
|
4024
|
+
*
|
|
4025
|
+
* @param {AcceptProp} accept
|
|
4026
|
+
* @returns {{accept: string[]}[]}
|
|
4027
|
+
*/
|
|
3811
4028
|
|
|
3812
|
-
function
|
|
4029
|
+
function pickerOptionsFromAccept(accept) {
|
|
4030
|
+
if (isDefined(accept)) {
|
|
4031
|
+
var acceptForPicker = Object.entries(accept).filter(function (_ref2) {
|
|
4032
|
+
var _ref3 = _slicedToArray$2(_ref2, 2),
|
|
4033
|
+
mimeType = _ref3[0],
|
|
4034
|
+
ext = _ref3[1];
|
|
3813
4035
|
|
|
3814
|
-
|
|
4036
|
+
var ok = true;
|
|
4037
|
+
|
|
4038
|
+
if (!isMIMEType(mimeType)) {
|
|
4039
|
+
console.warn("Skipped \"".concat(mimeType, "\" because it is not a valid MIME type. Check https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types for a list of valid MIME types."));
|
|
4040
|
+
ok = false;
|
|
4041
|
+
}
|
|
4042
|
+
|
|
4043
|
+
if (!Array.isArray(ext) || !ext.every(isExt)) {
|
|
4044
|
+
console.warn("Skipped \"".concat(mimeType, "\" because an invalid file extension was provided."));
|
|
4045
|
+
ok = false;
|
|
4046
|
+
}
|
|
4047
|
+
|
|
4048
|
+
return ok;
|
|
4049
|
+
}).reduce(function (agg, _ref4) {
|
|
4050
|
+
var _ref5 = _slicedToArray$2(_ref4, 2),
|
|
4051
|
+
mimeType = _ref5[0],
|
|
4052
|
+
ext = _ref5[1];
|
|
4053
|
+
|
|
4054
|
+
return _objectSpread$1(_objectSpread$1({}, agg), {}, _defineProperty$1({}, mimeType, ext));
|
|
4055
|
+
}, {});
|
|
4056
|
+
return [{
|
|
4057
|
+
accept: acceptForPicker
|
|
4058
|
+
}];
|
|
4059
|
+
}
|
|
4060
|
+
|
|
4061
|
+
return accept;
|
|
4062
|
+
}
|
|
4063
|
+
/**
|
|
4064
|
+
* Convert the `{accept}` dropzone prop to an array of MIME types/extensions.
|
|
4065
|
+
* @param {AcceptProp} accept
|
|
4066
|
+
* @returns {string}
|
|
4067
|
+
*/
|
|
4068
|
+
|
|
4069
|
+
function acceptPropAsAcceptAttr(accept) {
|
|
4070
|
+
if (isDefined(accept)) {
|
|
4071
|
+
return Object.entries(accept).reduce(function (a, _ref6) {
|
|
4072
|
+
var _ref7 = _slicedToArray$2(_ref6, 2),
|
|
4073
|
+
mimeType = _ref7[0],
|
|
4074
|
+
ext = _ref7[1];
|
|
4075
|
+
|
|
4076
|
+
return [].concat(_toConsumableArray$1(a), [mimeType], _toConsumableArray$1(ext));
|
|
4077
|
+
}, []) // Silently discard invalid entries as pickerOptionsFromAccept warns about these
|
|
4078
|
+
.filter(function (v) {
|
|
4079
|
+
return isMIMEType(v) || isExt(v);
|
|
4080
|
+
}).join(",");
|
|
4081
|
+
}
|
|
4082
|
+
|
|
4083
|
+
return undefined;
|
|
4084
|
+
}
|
|
4085
|
+
/**
|
|
4086
|
+
* Check if v is an exception caused by aborting a request (e.g window.showOpenFilePicker()).
|
|
4087
|
+
*
|
|
4088
|
+
* See https://developer.mozilla.org/en-US/docs/Web/API/DOMException.
|
|
4089
|
+
* @param {any} v
|
|
4090
|
+
* @returns {boolean} True if v is an abort exception.
|
|
4091
|
+
*/
|
|
4092
|
+
|
|
4093
|
+
function isAbort(v) {
|
|
4094
|
+
return v instanceof DOMException && (v.name === "AbortError" || v.code === v.ABORT_ERR);
|
|
4095
|
+
}
|
|
4096
|
+
/**
|
|
4097
|
+
* Check if v is a security error.
|
|
4098
|
+
*
|
|
4099
|
+
* See https://developer.mozilla.org/en-US/docs/Web/API/DOMException.
|
|
4100
|
+
* @param {any} v
|
|
4101
|
+
* @returns {boolean} True if v is a security error.
|
|
4102
|
+
*/
|
|
4103
|
+
|
|
4104
|
+
function isSecurityError(v) {
|
|
4105
|
+
return v instanceof DOMException && (v.name === "SecurityError" || v.code === v.SECURITY_ERR);
|
|
4106
|
+
}
|
|
4107
|
+
/**
|
|
4108
|
+
* Check if v is a MIME type string.
|
|
4109
|
+
*
|
|
4110
|
+
* See accepted format: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/file#unique_file_type_specifiers.
|
|
4111
|
+
*
|
|
4112
|
+
* @param {string} v
|
|
4113
|
+
*/
|
|
4114
|
+
|
|
4115
|
+
function isMIMEType(v) {
|
|
4116
|
+
return v === "audio/*" || v === "video/*" || v === "image/*" || v === "text/*" || /\w+\/[-+.\w]+/g.test(v);
|
|
4117
|
+
}
|
|
4118
|
+
/**
|
|
4119
|
+
* Check if v is a file extension.
|
|
4120
|
+
* @param {string} v
|
|
4121
|
+
*/
|
|
4122
|
+
|
|
4123
|
+
function isExt(v) {
|
|
4124
|
+
return /^.*\.[\w]+$/.test(v);
|
|
4125
|
+
}
|
|
4126
|
+
/**
|
|
4127
|
+
* @typedef {Object.<string, string[]>} AcceptProp
|
|
4128
|
+
*/
|
|
4129
|
+
|
|
4130
|
+
/**
|
|
4131
|
+
* @typedef {object} FileError
|
|
4132
|
+
* @property {string} message
|
|
4133
|
+
* @property {ErrorCode|string} code
|
|
4134
|
+
*/
|
|
4135
|
+
|
|
4136
|
+
/**
|
|
4137
|
+
* @typedef {"file-invalid-type"|"file-too-large"|"file-too-small"|"too-many-files"} ErrorCode
|
|
4138
|
+
*/
|
|
4139
|
+
|
|
4140
|
+
var _excluded = ["children"],
|
|
4141
|
+
_excluded2 = ["open"],
|
|
4142
|
+
_excluded3 = ["refKey", "role", "onKeyDown", "onFocus", "onBlur", "onClick", "onDragEnter", "onDragOver", "onDragLeave", "onDrop"],
|
|
4143
|
+
_excluded4 = ["refKey", "onChange", "onClick"];
|
|
4144
|
+
|
|
4145
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
4146
|
+
|
|
4147
|
+
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
4148
|
+
|
|
4149
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
3815
4150
|
|
|
3816
4151
|
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
3817
4152
|
|
|
@@ -3823,13 +4158,13 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
|
|
|
3823
4158
|
|
|
3824
4159
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
3825
4160
|
|
|
3826
|
-
function _iterableToArrayLimit(arr, i) {
|
|
4161
|
+
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
3827
4162
|
|
|
3828
4163
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
3829
4164
|
|
|
3830
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object);
|
|
4165
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
3831
4166
|
|
|
3832
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]
|
|
4167
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
3833
4168
|
|
|
3834
4169
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
3835
4170
|
|
|
@@ -3853,11 +4188,11 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
|
|
|
3853
4188
|
|
|
3854
4189
|
var Dropzone = /*#__PURE__*/require$$0.forwardRef(function (_ref, ref) {
|
|
3855
4190
|
var children = _ref.children,
|
|
3856
|
-
params = _objectWithoutProperties(_ref,
|
|
4191
|
+
params = _objectWithoutProperties(_ref, _excluded);
|
|
3857
4192
|
|
|
3858
4193
|
var _useDropzone = useDropzone(params),
|
|
3859
4194
|
open = _useDropzone.open,
|
|
3860
|
-
props = _objectWithoutProperties(_useDropzone,
|
|
4195
|
+
props = _objectWithoutProperties(_useDropzone, _excluded2);
|
|
3861
4196
|
|
|
3862
4197
|
require$$0.useImperativeHandle(ref, function () {
|
|
3863
4198
|
return {
|
|
@@ -3869,7 +4204,7 @@ var Dropzone = /*#__PURE__*/require$$0.forwardRef(function (_ref, ref) {
|
|
|
3869
4204
|
open: open
|
|
3870
4205
|
})));
|
|
3871
4206
|
});
|
|
3872
|
-
Dropzone.displayName =
|
|
4207
|
+
Dropzone.displayName = "Dropzone"; // Add default props for react-docgen
|
|
3873
4208
|
|
|
3874
4209
|
var defaultProps = {
|
|
3875
4210
|
disabled: false,
|
|
@@ -3883,7 +4218,9 @@ var defaultProps = {
|
|
|
3883
4218
|
noKeyboard: false,
|
|
3884
4219
|
noDrag: false,
|
|
3885
4220
|
noDragEventsBubbling: false,
|
|
3886
|
-
validator: null
|
|
4221
|
+
validator: null,
|
|
4222
|
+
useFsAccessApi: true,
|
|
4223
|
+
autoFocus: false
|
|
3887
4224
|
};
|
|
3888
4225
|
Dropzone.defaultProps = defaultProps;
|
|
3889
4226
|
Dropzone.propTypes = {
|
|
@@ -3899,7 +4236,6 @@ Dropzone.propTypes = {
|
|
|
3899
4236
|
* @param {boolean} params.isDragActive Active drag is in progress
|
|
3900
4237
|
* @param {boolean} params.isDragAccept Dragged files are accepted
|
|
3901
4238
|
* @param {boolean} params.isDragReject Some dragged files are rejected
|
|
3902
|
-
* @param {File[]} params.draggedFiles Files in active drag
|
|
3903
4239
|
* @param {File[]} params.acceptedFiles Accepted files
|
|
3904
4240
|
* @param {FileRejection[]} params.fileRejections Rejected files and why they were rejected
|
|
3905
4241
|
*/
|
|
@@ -3907,13 +4243,12 @@ Dropzone.propTypes = {
|
|
|
3907
4243
|
|
|
3908
4244
|
/**
|
|
3909
4245
|
* Set accepted file types.
|
|
3910
|
-
*
|
|
4246
|
+
* Checkout https://developer.mozilla.org/en-US/docs/Web/API/window/showOpenFilePicker types option for more information.
|
|
3911
4247
|
* Keep in mind that mime type determination is not reliable across platforms. CSV files,
|
|
3912
4248
|
* for example, are reported as text/plain under macOS but as application/vnd.ms-excel under
|
|
3913
|
-
* Windows. In some cases there might not be a mime type set at all.
|
|
3914
|
-
* See: https://github.com/react-dropzone/react-dropzone/issues/276
|
|
4249
|
+
* Windows. In some cases there might not be a mime type set at all (https://github.com/react-dropzone/react-dropzone/issues/276).
|
|
3915
4250
|
*/
|
|
3916
|
-
accept: PropTypes.
|
|
4251
|
+
accept: PropTypes.objectOf(PropTypes.arrayOf(PropTypes.string)),
|
|
3917
4252
|
|
|
3918
4253
|
/**
|
|
3919
4254
|
* Allow drag 'n' drop (or selection from the file dialog) of multiple files
|
|
@@ -3979,6 +4314,22 @@ Dropzone.propTypes = {
|
|
|
3979
4314
|
*/
|
|
3980
4315
|
onFileDialogCancel: PropTypes.func,
|
|
3981
4316
|
|
|
4317
|
+
/**
|
|
4318
|
+
* Cb for when opening the file dialog
|
|
4319
|
+
*/
|
|
4320
|
+
onFileDialogOpen: PropTypes.func,
|
|
4321
|
+
|
|
4322
|
+
/**
|
|
4323
|
+
* Set to true to use the https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API
|
|
4324
|
+
* to open the file picker instead of using an `<input type="file">` click event.
|
|
4325
|
+
*/
|
|
4326
|
+
useFsAccessApi: PropTypes.bool,
|
|
4327
|
+
|
|
4328
|
+
/**
|
|
4329
|
+
* Set to true to focus the root element on render
|
|
4330
|
+
*/
|
|
4331
|
+
autoFocus: PropTypes.bool,
|
|
4332
|
+
|
|
3982
4333
|
/**
|
|
3983
4334
|
* Cb for when the `dragenter` event occurs.
|
|
3984
4335
|
*
|
|
@@ -4051,9 +4402,16 @@ Dropzone.propTypes = {
|
|
|
4051
4402
|
onDropRejected: PropTypes.func,
|
|
4052
4403
|
|
|
4053
4404
|
/**
|
|
4054
|
-
*
|
|
4405
|
+
* Cb for when there's some error from any of the promises.
|
|
4406
|
+
*
|
|
4407
|
+
* @param {Error} error
|
|
4408
|
+
*/
|
|
4409
|
+
onError: PropTypes.func,
|
|
4410
|
+
|
|
4411
|
+
/**
|
|
4412
|
+
* Custom validation function. It must return null if there's no errors.
|
|
4055
4413
|
* @param {File} file
|
|
4056
|
-
* @returns {FileError|FileError[]}
|
|
4414
|
+
* @returns {FileError|FileError[]|null}
|
|
4057
4415
|
*/
|
|
4058
4416
|
validator: PropTypes.func
|
|
4059
4417
|
};
|
|
@@ -4105,29 +4463,33 @@ Dropzone.propTypes = {
|
|
|
4105
4463
|
*/
|
|
4106
4464
|
|
|
4107
4465
|
/**
|
|
4108
|
-
* An object with the current dropzone state
|
|
4466
|
+
* An object with the current dropzone state.
|
|
4109
4467
|
*
|
|
4110
4468
|
* @typedef {object} DropzoneState
|
|
4111
|
-
* @property {Function} getRootProps Returns the props you should apply to the root drop container you render
|
|
4112
|
-
* @property {Function} getInputProps Returns the props you should apply to hidden file input you render
|
|
4113
|
-
* @property {Function} open Open the native file selection dialog
|
|
4114
4469
|
* @property {boolean} isFocused Dropzone area is in focus
|
|
4115
4470
|
* @property {boolean} isFileDialogActive File dialog is opened
|
|
4116
4471
|
* @property {boolean} isDragActive Active drag is in progress
|
|
4117
4472
|
* @property {boolean} isDragAccept Dragged files are accepted
|
|
4118
4473
|
* @property {boolean} isDragReject Some dragged files are rejected
|
|
4119
|
-
* @property {File[]} draggedFiles Files in active drag
|
|
4120
4474
|
* @property {File[]} acceptedFiles Accepted files
|
|
4121
4475
|
* @property {FileRejection[]} fileRejections Rejected files and why they were rejected
|
|
4122
4476
|
*/
|
|
4123
4477
|
|
|
4478
|
+
/**
|
|
4479
|
+
* An object with the dropzone methods.
|
|
4480
|
+
*
|
|
4481
|
+
* @typedef {object} DropzoneMethods
|
|
4482
|
+
* @property {Function} getRootProps Returns the props you should apply to the root drop container you render
|
|
4483
|
+
* @property {Function} getInputProps Returns the props you should apply to hidden file input you render
|
|
4484
|
+
* @property {Function} open Open the native file selection dialog
|
|
4485
|
+
*/
|
|
4486
|
+
|
|
4124
4487
|
var initialState = {
|
|
4125
4488
|
isFocused: false,
|
|
4126
4489
|
isFileDialogActive: false,
|
|
4127
4490
|
isDragActive: false,
|
|
4128
4491
|
isDragAccept: false,
|
|
4129
4492
|
isDragReject: false,
|
|
4130
|
-
draggedFiles: [],
|
|
4131
4493
|
acceptedFiles: [],
|
|
4132
4494
|
fileRejections: []
|
|
4133
4495
|
};
|
|
@@ -4153,12 +4515,11 @@ var initialState = {
|
|
|
4153
4515
|
* @function useDropzone
|
|
4154
4516
|
*
|
|
4155
4517
|
* @param {object} props
|
|
4156
|
-
* @param {
|
|
4157
|
-
*
|
|
4518
|
+
* @param {import("./utils").AcceptProp} [props.accept] Set accepted file types.
|
|
4519
|
+
* Checkout https://developer.mozilla.org/en-US/docs/Web/API/window/showOpenFilePicker types option for more information.
|
|
4158
4520
|
* Keep in mind that mime type determination is not reliable across platforms. CSV files,
|
|
4159
4521
|
* for example, are reported as text/plain under macOS but as application/vnd.ms-excel under
|
|
4160
|
-
* Windows. In some cases there might not be a mime type set at all.
|
|
4161
|
-
* See: https://github.com/react-dropzone/react-dropzone/issues/276
|
|
4522
|
+
* Windows. In some cases there might not be a mime type set at all (https://github.com/react-dropzone/react-dropzone/issues/276).
|
|
4162
4523
|
* @param {boolean} [props.multiple=true] Allow drag 'n' drop (or selection from the file dialog) of multiple files
|
|
4163
4524
|
* @param {boolean} [props.preventDropOnDocument=true] If false, allow dropped items to take over the current browser window
|
|
4164
4525
|
* @param {boolean} [props.noClick=false] If true, disables click to open the native file selection dialog
|
|
@@ -4171,6 +4532,10 @@ var initialState = {
|
|
|
4171
4532
|
* @param {boolean} [props.disabled=false] Enable/disable the dropzone
|
|
4172
4533
|
* @param {getFilesFromEvent} [props.getFilesFromEvent] Use this to provide a custom file aggregator
|
|
4173
4534
|
* @param {Function} [props.onFileDialogCancel] Cb for when closing the file dialog with no selection
|
|
4535
|
+
* @param {boolean} [props.useFsAccessApi] Set to true to use the https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API
|
|
4536
|
+
* to open the file picker instead of using an `<input type="file">` click event.
|
|
4537
|
+
* @param {boolean} autoFocus Set to true to auto focus the root element.
|
|
4538
|
+
* @param {Function} [props.onFileDialogOpen] Cb for when opening the file dialog
|
|
4174
4539
|
* @param {dragCb} [props.onDragEnter] Cb for when the `dragenter` event occurs.
|
|
4175
4540
|
* @param {dragCb} [props.onDragLeave] Cb for when the `dragleave` event occurs
|
|
4176
4541
|
* @param {dragCb} [props.onDragOver] Cb for when the `dragover` event occurs
|
|
@@ -4178,7 +4543,7 @@ var initialState = {
|
|
|
4178
4543
|
* Note that this callback is invoked after the `getFilesFromEvent` callback is done.
|
|
4179
4544
|
*
|
|
4180
4545
|
* Files are accepted or rejected based on the `accept`, `multiple`, `minSize` and `maxSize` props.
|
|
4181
|
-
* `accept` must be a valid [MIME type](http://www.iana.org/assignments/media-types/media-types.xhtml) according to [input element specification](https://www.w3.org/wiki/HTML/Elements/input/file)
|
|
4546
|
+
* `accept` must be an object with keys as a valid [MIME type](http://www.iana.org/assignments/media-types/media-types.xhtml) according to [input element specification](https://www.w3.org/wiki/HTML/Elements/input/file) and the value an array of file extensions (optional).
|
|
4182
4547
|
* If `multiple` is set to false and additional files are dropped,
|
|
4183
4548
|
* all files besides the first will be rejected.
|
|
4184
4549
|
* Any file which does not have a size in the [`minSize`, `maxSize`] range, will be rejected as well.
|
|
@@ -4200,34 +4565,56 @@ var initialState = {
|
|
|
4200
4565
|
* ```
|
|
4201
4566
|
* @param {dropAcceptedCb} [props.onDropAccepted]
|
|
4202
4567
|
* @param {dropRejectedCb} [props.onDropRejected]
|
|
4568
|
+
* @param {(error: Error) => void} [props.onError]
|
|
4203
4569
|
*
|
|
4204
|
-
* @returns {DropzoneState}
|
|
4570
|
+
* @returns {DropzoneState & DropzoneMethods}
|
|
4205
4571
|
*/
|
|
4206
4572
|
|
|
4207
4573
|
function useDropzone() {
|
|
4208
|
-
var
|
|
4209
|
-
|
|
4210
|
-
var _defaultProps$
|
|
4211
|
-
accept = _defaultProps$
|
|
4212
|
-
disabled = _defaultProps$
|
|
4213
|
-
getFilesFromEvent = _defaultProps$
|
|
4214
|
-
maxSize = _defaultProps$
|
|
4215
|
-
minSize = _defaultProps$
|
|
4216
|
-
multiple = _defaultProps$
|
|
4217
|
-
maxFiles = _defaultProps$
|
|
4218
|
-
onDragEnter = _defaultProps$
|
|
4219
|
-
onDragLeave = _defaultProps$
|
|
4220
|
-
onDragOver = _defaultProps$
|
|
4221
|
-
onDrop = _defaultProps$
|
|
4222
|
-
onDropAccepted = _defaultProps$
|
|
4223
|
-
onDropRejected = _defaultProps$
|
|
4224
|
-
onFileDialogCancel = _defaultProps$
|
|
4225
|
-
|
|
4226
|
-
|
|
4227
|
-
|
|
4228
|
-
|
|
4229
|
-
|
|
4230
|
-
|
|
4574
|
+
var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
4575
|
+
|
|
4576
|
+
var _defaultProps$props = _objectSpread(_objectSpread({}, defaultProps), props),
|
|
4577
|
+
accept = _defaultProps$props.accept,
|
|
4578
|
+
disabled = _defaultProps$props.disabled,
|
|
4579
|
+
getFilesFromEvent = _defaultProps$props.getFilesFromEvent,
|
|
4580
|
+
maxSize = _defaultProps$props.maxSize,
|
|
4581
|
+
minSize = _defaultProps$props.minSize,
|
|
4582
|
+
multiple = _defaultProps$props.multiple,
|
|
4583
|
+
maxFiles = _defaultProps$props.maxFiles,
|
|
4584
|
+
onDragEnter = _defaultProps$props.onDragEnter,
|
|
4585
|
+
onDragLeave = _defaultProps$props.onDragLeave,
|
|
4586
|
+
onDragOver = _defaultProps$props.onDragOver,
|
|
4587
|
+
onDrop = _defaultProps$props.onDrop,
|
|
4588
|
+
onDropAccepted = _defaultProps$props.onDropAccepted,
|
|
4589
|
+
onDropRejected = _defaultProps$props.onDropRejected,
|
|
4590
|
+
onFileDialogCancel = _defaultProps$props.onFileDialogCancel,
|
|
4591
|
+
onFileDialogOpen = _defaultProps$props.onFileDialogOpen,
|
|
4592
|
+
useFsAccessApi = _defaultProps$props.useFsAccessApi,
|
|
4593
|
+
autoFocus = _defaultProps$props.autoFocus,
|
|
4594
|
+
preventDropOnDocument = _defaultProps$props.preventDropOnDocument,
|
|
4595
|
+
noClick = _defaultProps$props.noClick,
|
|
4596
|
+
noKeyboard = _defaultProps$props.noKeyboard,
|
|
4597
|
+
noDrag = _defaultProps$props.noDrag,
|
|
4598
|
+
noDragEventsBubbling = _defaultProps$props.noDragEventsBubbling,
|
|
4599
|
+
onError = _defaultProps$props.onError,
|
|
4600
|
+
validator = _defaultProps$props.validator;
|
|
4601
|
+
|
|
4602
|
+
var acceptAttr = require$$0.useMemo(function () {
|
|
4603
|
+
return acceptPropAsAcceptAttr(accept);
|
|
4604
|
+
}, [accept]);
|
|
4605
|
+
var pickerTypes = require$$0.useMemo(function () {
|
|
4606
|
+
return pickerOptionsFromAccept(accept);
|
|
4607
|
+
}, [accept]);
|
|
4608
|
+
var onFileDialogOpenCb = require$$0.useMemo(function () {
|
|
4609
|
+
return typeof onFileDialogOpen === "function" ? onFileDialogOpen : noop;
|
|
4610
|
+
}, [onFileDialogOpen]);
|
|
4611
|
+
var onFileDialogCancelCb = require$$0.useMemo(function () {
|
|
4612
|
+
return typeof onFileDialogCancel === "function" ? onFileDialogCancel : noop;
|
|
4613
|
+
}, [onFileDialogCancel]);
|
|
4614
|
+
/**
|
|
4615
|
+
* @constant
|
|
4616
|
+
* @type {React.MutableRefObject<HTMLElement>}
|
|
4617
|
+
*/
|
|
4231
4618
|
|
|
4232
4619
|
var rootRef = require$$0.useRef(null);
|
|
4233
4620
|
var inputRef = require$$0.useRef(null);
|
|
@@ -4238,34 +4625,21 @@ function useDropzone() {
|
|
|
4238
4625
|
dispatch = _useReducer2[1];
|
|
4239
4626
|
|
|
4240
4627
|
var isFocused = state.isFocused,
|
|
4241
|
-
isFileDialogActive = state.isFileDialogActive
|
|
4242
|
-
|
|
4243
|
-
|
|
4244
|
-
var openFileDialog = require$$0.useCallback(function () {
|
|
4245
|
-
if (inputRef.current) {
|
|
4246
|
-
dispatch({
|
|
4247
|
-
type: 'openDialog'
|
|
4248
|
-
});
|
|
4249
|
-
inputRef.current.value = null;
|
|
4250
|
-
inputRef.current.click();
|
|
4251
|
-
}
|
|
4252
|
-
}, [dispatch]); // Update file dialog active state when the window is focused on
|
|
4628
|
+
isFileDialogActive = state.isFileDialogActive;
|
|
4629
|
+
var fsAccessApiWorksRef = require$$0.useRef(typeof window !== "undefined" && window.isSecureContext && useFsAccessApi && canUseFileSystemAccessAPI()); // Update file dialog active state when the window is focused on
|
|
4253
4630
|
|
|
4254
4631
|
var onWindowFocus = function onWindowFocus() {
|
|
4255
4632
|
// Execute the timeout only if the file dialog is opened in the browser
|
|
4256
|
-
if (isFileDialogActive) {
|
|
4633
|
+
if (!fsAccessApiWorksRef.current && isFileDialogActive) {
|
|
4257
4634
|
setTimeout(function () {
|
|
4258
4635
|
if (inputRef.current) {
|
|
4259
4636
|
var files = inputRef.current.files;
|
|
4260
4637
|
|
|
4261
4638
|
if (!files.length) {
|
|
4262
4639
|
dispatch({
|
|
4263
|
-
type:
|
|
4640
|
+
type: "closeDialog"
|
|
4264
4641
|
});
|
|
4265
|
-
|
|
4266
|
-
if (typeof onFileDialogCancel === 'function') {
|
|
4267
|
-
onFileDialogCancel();
|
|
4268
|
-
}
|
|
4642
|
+
onFileDialogCancelCb();
|
|
4269
4643
|
}
|
|
4270
4644
|
}
|
|
4271
4645
|
}, 300);
|
|
@@ -4273,49 +4647,11 @@ function useDropzone() {
|
|
|
4273
4647
|
};
|
|
4274
4648
|
|
|
4275
4649
|
require$$0.useEffect(function () {
|
|
4276
|
-
window.addEventListener(
|
|
4650
|
+
window.addEventListener("focus", onWindowFocus, false);
|
|
4277
4651
|
return function () {
|
|
4278
|
-
window.removeEventListener(
|
|
4652
|
+
window.removeEventListener("focus", onWindowFocus, false);
|
|
4279
4653
|
};
|
|
4280
|
-
}, [inputRef, isFileDialogActive,
|
|
4281
|
-
|
|
4282
|
-
var onKeyDownCb = require$$0.useCallback(function (event) {
|
|
4283
|
-
// Ignore keyboard events bubbling up the DOM tree
|
|
4284
|
-
if (!rootRef.current || !rootRef.current.isEqualNode(event.target)) {
|
|
4285
|
-
return;
|
|
4286
|
-
}
|
|
4287
|
-
|
|
4288
|
-
if (event.keyCode === 32 || event.keyCode === 13) {
|
|
4289
|
-
event.preventDefault();
|
|
4290
|
-
openFileDialog();
|
|
4291
|
-
}
|
|
4292
|
-
}, [rootRef, inputRef]); // Update focus state for the dropzone
|
|
4293
|
-
|
|
4294
|
-
var onFocusCb = require$$0.useCallback(function () {
|
|
4295
|
-
dispatch({
|
|
4296
|
-
type: 'focus'
|
|
4297
|
-
});
|
|
4298
|
-
}, []);
|
|
4299
|
-
var onBlurCb = require$$0.useCallback(function () {
|
|
4300
|
-
dispatch({
|
|
4301
|
-
type: 'blur'
|
|
4302
|
-
});
|
|
4303
|
-
}, []); // Cb to open the file dialog when click occurs on the dropzone
|
|
4304
|
-
|
|
4305
|
-
var onClickCb = require$$0.useCallback(function () {
|
|
4306
|
-
if (noClick) {
|
|
4307
|
-
return;
|
|
4308
|
-
} // In IE11/Edge the file-browser dialog is blocking, therefore, use setTimeout()
|
|
4309
|
-
// to ensure React can handle state changes
|
|
4310
|
-
// See: https://github.com/react-dropzone/react-dropzone/issues/450
|
|
4311
|
-
|
|
4312
|
-
|
|
4313
|
-
if (isIeOrEdge()) {
|
|
4314
|
-
setTimeout(openFileDialog, 0);
|
|
4315
|
-
} else {
|
|
4316
|
-
openFileDialog();
|
|
4317
|
-
}
|
|
4318
|
-
}, [inputRef, noClick]);
|
|
4654
|
+
}, [inputRef, isFileDialogActive, onFileDialogCancelCb, fsAccessApiWorksRef]);
|
|
4319
4655
|
var dragTargetsRef = require$$0.useRef([]);
|
|
4320
4656
|
|
|
4321
4657
|
var onDocumentDrop = function onDocumentDrop(event) {
|
|
@@ -4330,17 +4666,33 @@ function useDropzone() {
|
|
|
4330
4666
|
|
|
4331
4667
|
require$$0.useEffect(function () {
|
|
4332
4668
|
if (preventDropOnDocument) {
|
|
4333
|
-
document.addEventListener(
|
|
4334
|
-
document.addEventListener(
|
|
4669
|
+
document.addEventListener("dragover", onDocumentDragOver, false);
|
|
4670
|
+
document.addEventListener("drop", onDocumentDrop, false);
|
|
4335
4671
|
}
|
|
4336
4672
|
|
|
4337
4673
|
return function () {
|
|
4338
4674
|
if (preventDropOnDocument) {
|
|
4339
|
-
document.removeEventListener(
|
|
4340
|
-
document.removeEventListener(
|
|
4675
|
+
document.removeEventListener("dragover", onDocumentDragOver);
|
|
4676
|
+
document.removeEventListener("drop", onDocumentDrop);
|
|
4341
4677
|
}
|
|
4342
4678
|
};
|
|
4343
|
-
}, [rootRef, preventDropOnDocument]);
|
|
4679
|
+
}, [rootRef, preventDropOnDocument]); // Auto focus the root when autoFocus is true
|
|
4680
|
+
|
|
4681
|
+
require$$0.useEffect(function () {
|
|
4682
|
+
if (!disabled && autoFocus && rootRef.current) {
|
|
4683
|
+
rootRef.current.focus();
|
|
4684
|
+
}
|
|
4685
|
+
|
|
4686
|
+
return function () {};
|
|
4687
|
+
}, [rootRef, autoFocus, disabled]);
|
|
4688
|
+
var onErrCb = require$$0.useCallback(function (e) {
|
|
4689
|
+
if (onError) {
|
|
4690
|
+
onError(e);
|
|
4691
|
+
} else {
|
|
4692
|
+
// Let the user know something's gone wrong if they haven't provided the onError cb.
|
|
4693
|
+
console.error(e);
|
|
4694
|
+
}
|
|
4695
|
+
}, [onError]);
|
|
4344
4696
|
var onDragEnterCb = require$$0.useCallback(function (event) {
|
|
4345
4697
|
event.preventDefault(); // Persist here because we need the event later after getFilesFromEvent() is done
|
|
4346
4698
|
|
|
@@ -4349,23 +4701,37 @@ function useDropzone() {
|
|
|
4349
4701
|
dragTargetsRef.current = [].concat(_toConsumableArray(dragTargetsRef.current), [event.target]);
|
|
4350
4702
|
|
|
4351
4703
|
if (isEvtWithFiles(event)) {
|
|
4352
|
-
Promise.resolve(getFilesFromEvent(event)).then(function (
|
|
4704
|
+
Promise.resolve(getFilesFromEvent(event)).then(function (files) {
|
|
4353
4705
|
if (isPropagationStopped(event) && !noDragEventsBubbling) {
|
|
4354
4706
|
return;
|
|
4355
4707
|
}
|
|
4356
4708
|
|
|
4709
|
+
var fileCount = files.length;
|
|
4710
|
+
var isDragAccept = fileCount > 0 && allFilesAccepted({
|
|
4711
|
+
files: files,
|
|
4712
|
+
accept: acceptAttr,
|
|
4713
|
+
minSize: minSize,
|
|
4714
|
+
maxSize: maxSize,
|
|
4715
|
+
multiple: multiple,
|
|
4716
|
+
maxFiles: maxFiles,
|
|
4717
|
+
validator: validator
|
|
4718
|
+
});
|
|
4719
|
+
var isDragReject = fileCount > 0 && !isDragAccept;
|
|
4357
4720
|
dispatch({
|
|
4358
|
-
|
|
4721
|
+
isDragAccept: isDragAccept,
|
|
4722
|
+
isDragReject: isDragReject,
|
|
4359
4723
|
isDragActive: true,
|
|
4360
|
-
type:
|
|
4724
|
+
type: "setDraggedFiles"
|
|
4361
4725
|
});
|
|
4362
4726
|
|
|
4363
4727
|
if (onDragEnter) {
|
|
4364
4728
|
onDragEnter(event);
|
|
4365
4729
|
}
|
|
4730
|
+
}).catch(function (e) {
|
|
4731
|
+
return onErrCb(e);
|
|
4366
4732
|
});
|
|
4367
4733
|
}
|
|
4368
|
-
}, [getFilesFromEvent, onDragEnter, noDragEventsBubbling]);
|
|
4734
|
+
}, [getFilesFromEvent, onDragEnter, onErrCb, noDragEventsBubbling, acceptAttr, minSize, maxSize, multiple, maxFiles, validator]);
|
|
4369
4735
|
var onDragOverCb = require$$0.useCallback(function (event) {
|
|
4370
4736
|
event.preventDefault();
|
|
4371
4737
|
event.persist();
|
|
@@ -4374,7 +4740,7 @@ function useDropzone() {
|
|
|
4374
4740
|
|
|
4375
4741
|
if (hasFiles && event.dataTransfer) {
|
|
4376
4742
|
try {
|
|
4377
|
-
event.dataTransfer.dropEffect =
|
|
4743
|
+
event.dataTransfer.dropEffect = "copy";
|
|
4378
4744
|
} catch (_unused) {}
|
|
4379
4745
|
/* eslint-disable-line no-empty */
|
|
4380
4746
|
|
|
@@ -4409,15 +4775,79 @@ function useDropzone() {
|
|
|
4409
4775
|
}
|
|
4410
4776
|
|
|
4411
4777
|
dispatch({
|
|
4778
|
+
type: "setDraggedFiles",
|
|
4412
4779
|
isDragActive: false,
|
|
4413
|
-
|
|
4414
|
-
|
|
4780
|
+
isDragAccept: false,
|
|
4781
|
+
isDragReject: false
|
|
4415
4782
|
});
|
|
4416
4783
|
|
|
4417
4784
|
if (isEvtWithFiles(event) && onDragLeave) {
|
|
4418
4785
|
onDragLeave(event);
|
|
4419
4786
|
}
|
|
4420
4787
|
}, [rootRef, onDragLeave, noDragEventsBubbling]);
|
|
4788
|
+
var setFiles = require$$0.useCallback(function (files, event) {
|
|
4789
|
+
var acceptedFiles = [];
|
|
4790
|
+
var fileRejections = [];
|
|
4791
|
+
files.forEach(function (file) {
|
|
4792
|
+
var _fileAccepted = fileAccepted(file, acceptAttr),
|
|
4793
|
+
_fileAccepted2 = _slicedToArray$1(_fileAccepted, 2),
|
|
4794
|
+
accepted = _fileAccepted2[0],
|
|
4795
|
+
acceptError = _fileAccepted2[1];
|
|
4796
|
+
|
|
4797
|
+
var _fileMatchSize = fileMatchSize(file, minSize, maxSize),
|
|
4798
|
+
_fileMatchSize2 = _slicedToArray$1(_fileMatchSize, 2),
|
|
4799
|
+
sizeMatch = _fileMatchSize2[0],
|
|
4800
|
+
sizeError = _fileMatchSize2[1];
|
|
4801
|
+
|
|
4802
|
+
var customErrors = validator ? validator(file) : null;
|
|
4803
|
+
|
|
4804
|
+
if (accepted && sizeMatch && !customErrors) {
|
|
4805
|
+
acceptedFiles.push(file);
|
|
4806
|
+
} else {
|
|
4807
|
+
var errors = [acceptError, sizeError];
|
|
4808
|
+
|
|
4809
|
+
if (customErrors) {
|
|
4810
|
+
errors = errors.concat(customErrors);
|
|
4811
|
+
}
|
|
4812
|
+
|
|
4813
|
+
fileRejections.push({
|
|
4814
|
+
file: file,
|
|
4815
|
+
errors: errors.filter(function (e) {
|
|
4816
|
+
return e;
|
|
4817
|
+
})
|
|
4818
|
+
});
|
|
4819
|
+
}
|
|
4820
|
+
});
|
|
4821
|
+
|
|
4822
|
+
if (!multiple && acceptedFiles.length > 1 || multiple && maxFiles >= 1 && acceptedFiles.length > maxFiles) {
|
|
4823
|
+
// Reject everything and empty accepted files
|
|
4824
|
+
acceptedFiles.forEach(function (file) {
|
|
4825
|
+
fileRejections.push({
|
|
4826
|
+
file: file,
|
|
4827
|
+
errors: [TOO_MANY_FILES_REJECTION]
|
|
4828
|
+
});
|
|
4829
|
+
});
|
|
4830
|
+
acceptedFiles.splice(0);
|
|
4831
|
+
}
|
|
4832
|
+
|
|
4833
|
+
dispatch({
|
|
4834
|
+
acceptedFiles: acceptedFiles,
|
|
4835
|
+
fileRejections: fileRejections,
|
|
4836
|
+
type: "setFiles"
|
|
4837
|
+
});
|
|
4838
|
+
|
|
4839
|
+
if (onDrop) {
|
|
4840
|
+
onDrop(acceptedFiles, fileRejections, event);
|
|
4841
|
+
}
|
|
4842
|
+
|
|
4843
|
+
if (fileRejections.length > 0 && onDropRejected) {
|
|
4844
|
+
onDropRejected(fileRejections, event);
|
|
4845
|
+
}
|
|
4846
|
+
|
|
4847
|
+
if (acceptedFiles.length > 0 && onDropAccepted) {
|
|
4848
|
+
onDropAccepted(acceptedFiles, event);
|
|
4849
|
+
}
|
|
4850
|
+
}, [dispatch, multiple, acceptAttr, minSize, maxSize, maxFiles, onDrop, onDropAccepted, onDropRejected, validator]);
|
|
4421
4851
|
var onDropCb = require$$0.useCallback(function (event) {
|
|
4422
4852
|
event.preventDefault(); // Persist here because we need the event later after getFilesFromEvent() is done
|
|
4423
4853
|
|
|
@@ -4431,74 +4861,108 @@ function useDropzone() {
|
|
|
4431
4861
|
return;
|
|
4432
4862
|
}
|
|
4433
4863
|
|
|
4434
|
-
|
|
4435
|
-
|
|
4436
|
-
|
|
4437
|
-
|
|
4438
|
-
|
|
4439
|
-
accepted = _fileAccepted2[0],
|
|
4440
|
-
acceptError = _fileAccepted2[1];
|
|
4441
|
-
|
|
4442
|
-
var _fileMatchSize = fileMatchSize(file, minSize, maxSize),
|
|
4443
|
-
_fileMatchSize2 = _slicedToArray$1(_fileMatchSize, 2),
|
|
4444
|
-
sizeMatch = _fileMatchSize2[0],
|
|
4445
|
-
sizeError = _fileMatchSize2[1];
|
|
4446
|
-
|
|
4447
|
-
var customErrors = validator ? validator(file) : null;
|
|
4448
|
-
|
|
4449
|
-
if (accepted && sizeMatch && !customErrors) {
|
|
4450
|
-
acceptedFiles.push(file);
|
|
4451
|
-
} else {
|
|
4452
|
-
var errors = [acceptError, sizeError];
|
|
4453
|
-
|
|
4454
|
-
if (customErrors) {
|
|
4455
|
-
errors = errors.concat(customErrors);
|
|
4456
|
-
}
|
|
4864
|
+
setFiles(files, event);
|
|
4865
|
+
}).catch(function (e) {
|
|
4866
|
+
return onErrCb(e);
|
|
4867
|
+
});
|
|
4868
|
+
}
|
|
4457
4869
|
|
|
4458
|
-
|
|
4459
|
-
|
|
4460
|
-
|
|
4461
|
-
|
|
4462
|
-
})
|
|
4463
|
-
});
|
|
4464
|
-
}
|
|
4465
|
-
});
|
|
4870
|
+
dispatch({
|
|
4871
|
+
type: "reset"
|
|
4872
|
+
});
|
|
4873
|
+
}, [getFilesFromEvent, setFiles, onErrCb, noDragEventsBubbling]); // Fn for opening the file dialog programmatically
|
|
4466
4874
|
|
|
4467
|
-
|
|
4468
|
-
|
|
4469
|
-
|
|
4470
|
-
|
|
4471
|
-
|
|
4472
|
-
|
|
4473
|
-
|
|
4474
|
-
|
|
4475
|
-
acceptedFiles.splice(0);
|
|
4476
|
-
}
|
|
4875
|
+
var openFileDialog = require$$0.useCallback(function () {
|
|
4876
|
+
// No point to use FS access APIs if context is not secure
|
|
4877
|
+
// https://developer.mozilla.org/en-US/docs/Web/Security/Secure_Contexts#feature_detection
|
|
4878
|
+
if (fsAccessApiWorksRef.current) {
|
|
4879
|
+
dispatch({
|
|
4880
|
+
type: "openDialog"
|
|
4881
|
+
});
|
|
4882
|
+
onFileDialogOpenCb(); // https://developer.mozilla.org/en-US/docs/Web/API/window/showOpenFilePicker
|
|
4477
4883
|
|
|
4884
|
+
var opts = {
|
|
4885
|
+
multiple: multiple,
|
|
4886
|
+
types: pickerTypes
|
|
4887
|
+
};
|
|
4888
|
+
window.showOpenFilePicker(opts).then(function (handles) {
|
|
4889
|
+
return getFilesFromEvent(handles);
|
|
4890
|
+
}).then(function (files) {
|
|
4891
|
+
setFiles(files, null);
|
|
4478
4892
|
dispatch({
|
|
4479
|
-
|
|
4480
|
-
fileRejections: fileRejections,
|
|
4481
|
-
type: 'setFiles'
|
|
4893
|
+
type: "closeDialog"
|
|
4482
4894
|
});
|
|
4895
|
+
}).catch(function (e) {
|
|
4896
|
+
// AbortError means the user canceled
|
|
4897
|
+
if (isAbort(e)) {
|
|
4898
|
+
onFileDialogCancelCb(e);
|
|
4899
|
+
dispatch({
|
|
4900
|
+
type: "closeDialog"
|
|
4901
|
+
});
|
|
4902
|
+
} else if (isSecurityError(e)) {
|
|
4903
|
+
fsAccessApiWorksRef.current = false; // CORS, so cannot use this API
|
|
4904
|
+
// Try using the input
|
|
4483
4905
|
|
|
4484
|
-
|
|
4485
|
-
|
|
4486
|
-
|
|
4487
|
-
|
|
4488
|
-
|
|
4489
|
-
|
|
4906
|
+
if (inputRef.current) {
|
|
4907
|
+
inputRef.current.value = null;
|
|
4908
|
+
inputRef.current.click();
|
|
4909
|
+
} else {
|
|
4910
|
+
onErrCb(new Error("Cannot open the file picker because the https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API is not supported and no <input> was provided."));
|
|
4911
|
+
}
|
|
4912
|
+
} else {
|
|
4913
|
+
onErrCb(e);
|
|
4490
4914
|
}
|
|
4915
|
+
});
|
|
4916
|
+
return;
|
|
4917
|
+
}
|
|
4491
4918
|
|
|
4492
|
-
|
|
4493
|
-
|
|
4494
|
-
|
|
4919
|
+
if (inputRef.current) {
|
|
4920
|
+
dispatch({
|
|
4921
|
+
type: "openDialog"
|
|
4495
4922
|
});
|
|
4923
|
+
onFileDialogOpenCb();
|
|
4924
|
+
inputRef.current.value = null;
|
|
4925
|
+
inputRef.current.click();
|
|
4926
|
+
}
|
|
4927
|
+
}, [dispatch, onFileDialogOpenCb, onFileDialogCancelCb, useFsAccessApi, setFiles, onErrCb, pickerTypes, multiple]); // Cb to open the file dialog when SPACE/ENTER occurs on the dropzone
|
|
4928
|
+
|
|
4929
|
+
var onKeyDownCb = require$$0.useCallback(function (event) {
|
|
4930
|
+
// Ignore keyboard events bubbling up the DOM tree
|
|
4931
|
+
if (!rootRef.current || !rootRef.current.isEqualNode(event.target)) {
|
|
4932
|
+
return;
|
|
4933
|
+
}
|
|
4934
|
+
|
|
4935
|
+
if (event.key === " " || event.key === "Enter" || event.keyCode === 32 || event.keyCode === 13) {
|
|
4936
|
+
event.preventDefault();
|
|
4937
|
+
openFileDialog();
|
|
4496
4938
|
}
|
|
4939
|
+
}, [rootRef, openFileDialog]); // Update focus state for the dropzone
|
|
4497
4940
|
|
|
4941
|
+
var onFocusCb = require$$0.useCallback(function () {
|
|
4942
|
+
dispatch({
|
|
4943
|
+
type: "focus"
|
|
4944
|
+
});
|
|
4945
|
+
}, []);
|
|
4946
|
+
var onBlurCb = require$$0.useCallback(function () {
|
|
4498
4947
|
dispatch({
|
|
4499
|
-
type:
|
|
4948
|
+
type: "blur"
|
|
4500
4949
|
});
|
|
4501
|
-
}, [
|
|
4950
|
+
}, []); // Cb to open the file dialog when click occurs on the dropzone
|
|
4951
|
+
|
|
4952
|
+
var onClickCb = require$$0.useCallback(function () {
|
|
4953
|
+
if (noClick) {
|
|
4954
|
+
return;
|
|
4955
|
+
} // In IE11/Edge the file-browser dialog is blocking, therefore, use setTimeout()
|
|
4956
|
+
// to ensure React can handle state changes
|
|
4957
|
+
// See: https://github.com/react-dropzone/react-dropzone/issues/450
|
|
4958
|
+
|
|
4959
|
+
|
|
4960
|
+
if (isIeOrEdge()) {
|
|
4961
|
+
setTimeout(openFileDialog, 0);
|
|
4962
|
+
} else {
|
|
4963
|
+
openFileDialog();
|
|
4964
|
+
}
|
|
4965
|
+
}, [noClick, openFileDialog]);
|
|
4502
4966
|
|
|
4503
4967
|
var composeHandler = function composeHandler(fn) {
|
|
4504
4968
|
return disabled ? null : fn;
|
|
@@ -4522,7 +4986,8 @@ function useDropzone() {
|
|
|
4522
4986
|
return function () {
|
|
4523
4987
|
var _ref2 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
|
|
4524
4988
|
_ref2$refKey = _ref2.refKey,
|
|
4525
|
-
refKey = _ref2$refKey === void 0 ?
|
|
4989
|
+
refKey = _ref2$refKey === void 0 ? "ref" : _ref2$refKey,
|
|
4990
|
+
role = _ref2.role,
|
|
4526
4991
|
onKeyDown = _ref2.onKeyDown,
|
|
4527
4992
|
onFocus = _ref2.onFocus,
|
|
4528
4993
|
onBlur = _ref2.onBlur,
|
|
@@ -4531,7 +4996,7 @@ function useDropzone() {
|
|
|
4531
4996
|
onDragOver = _ref2.onDragOver,
|
|
4532
4997
|
onDragLeave = _ref2.onDragLeave,
|
|
4533
4998
|
onDrop = _ref2.onDrop,
|
|
4534
|
-
rest = _objectWithoutProperties(_ref2,
|
|
4999
|
+
rest = _objectWithoutProperties(_ref2, _excluded3);
|
|
4535
5000
|
|
|
4536
5001
|
return _objectSpread(_objectSpread(_defineProperty({
|
|
4537
5002
|
onKeyDown: composeKeyboardHandler(composeEventHandlers(onKeyDown, onKeyDownCb)),
|
|
@@ -4541,7 +5006,8 @@ function useDropzone() {
|
|
|
4541
5006
|
onDragEnter: composeDragHandler(composeEventHandlers(onDragEnter, onDragEnterCb)),
|
|
4542
5007
|
onDragOver: composeDragHandler(composeEventHandlers(onDragOver, onDragOverCb)),
|
|
4543
5008
|
onDragLeave: composeDragHandler(composeEventHandlers(onDragLeave, onDragLeaveCb)),
|
|
4544
|
-
onDrop: composeDragHandler(composeEventHandlers(onDrop, onDropCb))
|
|
5009
|
+
onDrop: composeDragHandler(composeEventHandlers(onDrop, onDropCb)),
|
|
5010
|
+
role: typeof role === "string" && role !== "" ? role : "presentation"
|
|
4545
5011
|
}, refKey, rootRef), !disabled && !noKeyboard ? {
|
|
4546
5012
|
tabIndex: 0
|
|
4547
5013
|
} : {}), rest);
|
|
@@ -4554,40 +5020,27 @@ function useDropzone() {
|
|
|
4554
5020
|
return function () {
|
|
4555
5021
|
var _ref3 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
|
|
4556
5022
|
_ref3$refKey = _ref3.refKey,
|
|
4557
|
-
refKey = _ref3$refKey === void 0 ?
|
|
5023
|
+
refKey = _ref3$refKey === void 0 ? "ref" : _ref3$refKey,
|
|
4558
5024
|
onChange = _ref3.onChange,
|
|
4559
5025
|
onClick = _ref3.onClick,
|
|
4560
|
-
rest = _objectWithoutProperties(_ref3,
|
|
5026
|
+
rest = _objectWithoutProperties(_ref3, _excluded4);
|
|
4561
5027
|
|
|
4562
5028
|
var inputProps = _defineProperty({
|
|
4563
|
-
accept:
|
|
5029
|
+
accept: acceptAttr,
|
|
4564
5030
|
multiple: multiple,
|
|
4565
|
-
type:
|
|
5031
|
+
type: "file",
|
|
4566
5032
|
style: {
|
|
4567
|
-
display:
|
|
5033
|
+
display: "none"
|
|
4568
5034
|
},
|
|
4569
5035
|
onChange: composeHandler(composeEventHandlers(onChange, onDropCb)),
|
|
4570
5036
|
onClick: composeHandler(composeEventHandlers(onClick, onInputElementClick)),
|
|
4571
|
-
autoComplete: 'off',
|
|
4572
5037
|
tabIndex: -1
|
|
4573
5038
|
}, refKey, inputRef);
|
|
4574
5039
|
|
|
4575
5040
|
return _objectSpread(_objectSpread({}, inputProps), rest);
|
|
4576
5041
|
};
|
|
4577
5042
|
}, [inputRef, accept, multiple, onDropCb, disabled]);
|
|
4578
|
-
var fileCount = draggedFiles.length;
|
|
4579
|
-
var isDragAccept = fileCount > 0 && allFilesAccepted({
|
|
4580
|
-
files: draggedFiles,
|
|
4581
|
-
accept: accept,
|
|
4582
|
-
minSize: minSize,
|
|
4583
|
-
maxSize: maxSize,
|
|
4584
|
-
multiple: multiple,
|
|
4585
|
-
maxFiles: maxFiles
|
|
4586
|
-
});
|
|
4587
|
-
var isDragReject = fileCount > 0 && !isDragAccept;
|
|
4588
5043
|
return _objectSpread(_objectSpread({}, state), {}, {
|
|
4589
|
-
isDragAccept: isDragAccept,
|
|
4590
|
-
isDragReject: isDragReject,
|
|
4591
5044
|
isFocused: isFocused && !disabled,
|
|
4592
5045
|
getRootProps: getRootProps,
|
|
4593
5046
|
getInputProps: getInputProps,
|
|
@@ -4596,59 +5049,58 @@ function useDropzone() {
|
|
|
4596
5049
|
open: composeHandler(openFileDialog)
|
|
4597
5050
|
});
|
|
4598
5051
|
}
|
|
5052
|
+
/**
|
|
5053
|
+
* @param {DropzoneState} state
|
|
5054
|
+
* @param {{type: string} & DropzoneState} action
|
|
5055
|
+
* @returns {DropzoneState}
|
|
5056
|
+
*/
|
|
4599
5057
|
|
|
4600
5058
|
function reducer(state, action) {
|
|
4601
5059
|
/* istanbul ignore next */
|
|
4602
5060
|
switch (action.type) {
|
|
4603
|
-
case
|
|
5061
|
+
case "focus":
|
|
4604
5062
|
return _objectSpread(_objectSpread({}, state), {}, {
|
|
4605
5063
|
isFocused: true
|
|
4606
5064
|
});
|
|
4607
5065
|
|
|
4608
|
-
case
|
|
5066
|
+
case "blur":
|
|
4609
5067
|
return _objectSpread(_objectSpread({}, state), {}, {
|
|
4610
5068
|
isFocused: false
|
|
4611
5069
|
});
|
|
4612
5070
|
|
|
4613
|
-
case
|
|
4614
|
-
return _objectSpread(_objectSpread({},
|
|
5071
|
+
case "openDialog":
|
|
5072
|
+
return _objectSpread(_objectSpread({}, initialState), {}, {
|
|
4615
5073
|
isFileDialogActive: true
|
|
4616
5074
|
});
|
|
4617
5075
|
|
|
4618
|
-
case
|
|
5076
|
+
case "closeDialog":
|
|
4619
5077
|
return _objectSpread(_objectSpread({}, state), {}, {
|
|
4620
5078
|
isFileDialogActive: false
|
|
4621
5079
|
});
|
|
4622
5080
|
|
|
4623
|
-
case
|
|
4624
|
-
/* eslint no-case-declarations: 0 */
|
|
4625
|
-
var isDragActive = action.isDragActive,
|
|
4626
|
-
draggedFiles = action.draggedFiles;
|
|
5081
|
+
case "setDraggedFiles":
|
|
4627
5082
|
return _objectSpread(_objectSpread({}, state), {}, {
|
|
4628
|
-
|
|
4629
|
-
|
|
5083
|
+
isDragActive: action.isDragActive,
|
|
5084
|
+
isDragAccept: action.isDragAccept,
|
|
5085
|
+
isDragReject: action.isDragReject
|
|
4630
5086
|
});
|
|
4631
5087
|
|
|
4632
|
-
case
|
|
5088
|
+
case "setFiles":
|
|
4633
5089
|
return _objectSpread(_objectSpread({}, state), {}, {
|
|
4634
5090
|
acceptedFiles: action.acceptedFiles,
|
|
4635
5091
|
fileRejections: action.fileRejections
|
|
4636
5092
|
});
|
|
4637
5093
|
|
|
4638
|
-
case
|
|
4639
|
-
return _objectSpread(
|
|
4640
|
-
isFileDialogActive: false,
|
|
4641
|
-
isDragActive: false,
|
|
4642
|
-
draggedFiles: [],
|
|
4643
|
-
acceptedFiles: [],
|
|
4644
|
-
fileRejections: []
|
|
4645
|
-
});
|
|
5094
|
+
case "reset":
|
|
5095
|
+
return _objectSpread({}, initialState);
|
|
4646
5096
|
|
|
4647
5097
|
default:
|
|
4648
5098
|
return state;
|
|
4649
5099
|
}
|
|
4650
5100
|
}
|
|
4651
5101
|
|
|
5102
|
+
function noop() {}
|
|
5103
|
+
|
|
4652
5104
|
var css_248z$s = ".style-module_container__BL4SV {\n cursor: pointer;\n background-color: var(--ds-primary-100);\n border-radius: 8px;\n border: 1px dashed var(--ds-primary-500);\n height: 226px;\n width: 100%;\n max-width: 518px;\n transition: 0.3s background-color, 0.3s border-color;\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n}\n.style-module_container__BL4SV:focus {\n outline: none;\n box-shadow: 0 0 0 2px rgba(var(--ds-primary-500), 0.5);\n}\n.style-module_container__BL4SV:hover {\n background-color: var(--ds-primary-300);\n}\n.style-module_container--error__1A9v5 {\n border-color: var(--ds-red-300);\n background-color: var(--ds-red-100);\n}\n.style-module_container--error__1A9v5:hover {\n border-color: var(--ds-red-300);\n background-color: var(--ds-red-100);\n}\n.style-module_container--error__1A9v5:focus {\n outline: none;\n box-shadow: 0 0 0 2px rgba(var(--ds-red-500), 0.5);\n}\n.style-module_container--uploading__R11Jd {\n pointer-events: none;\n}\n.style-module_container--uploaded__1QbKe:hover {\n background-color: var(--ds-primary-100);\n}\n\n.style-module_image__2qnlY {\n width: 88px;\n}\n\n.style-module_progress-container__ZQ0Qa {\n height: 4px;\n width: 85%;\n margin-top: 24px;\n border-radius: 2px;\n background-color: var(--ds-primary-300);\n overflow: hidden;\n}\n.style-module_progress-container__ZQ0Qa .style-module_progress-bar__1_SWA {\n height: 100%;\n background-color: var(--ds-primary-500);\n border-radius: 2px;\n transition: width 0.3s;\n}\n\n.style-module_action__3_5C4 {\n color: var(--ds-primary-500);\n}\n.style-module_action--error__VrIT9 {\n color: var(--ds-red-500);\n}\n.style-module_action--uploaded__320Sq {\n color: var(--ds-primary-500);\n}";
|
|
4653
5105
|
var styles$r = {"container":"style-module_container__BL4SV","container--error":"style-module_container--error__1A9v5","container--uploading":"style-module_container--uploading__R11Jd","container--uploaded":"style-module_container--uploaded__1QbKe","image":"style-module_image__2qnlY","progress-container":"style-module_progress-container__ZQ0Qa","progress-bar":"style-module_progress-bar__1_SWA","action":"style-module_action__3_5C4","action--error":"style-module_action--error__VrIT9","action--uploaded":"style-module_action--uploaded__320Sq"};
|
|
4654
5106
|
styleInject(css_248z$s);
|
|
@@ -7589,7 +8041,7 @@ styleInject(css_248z$p);
|
|
|
7589
8041
|
|
|
7590
8042
|
var Input = require$$0__default['default'].forwardRef(function (_a, ref) {
|
|
7591
8043
|
var _b, _c, _d, _e, _f;
|
|
7592
|
-
var className = _a.className, placeholder = _a.placeholder, prefix = _a.prefix, error = _a.error, disabled = _a.disabled, props = __rest(_a, ["className", "placeholder", "prefix", "error", "disabled"]);
|
|
8044
|
+
var className = _a.className, placeholder = _a.placeholder, prefix = _a.prefix, error = _a.error, disabled = _a.disabled, props = __rest$1(_a, ["className", "placeholder", "prefix", "error", "disabled"]);
|
|
7593
8045
|
return (jsxRuntime.jsxs("div", __assign({ className: styles$o.container + " " + (className !== null && className !== void 0 ? className : '') }, { children: [jsxRuntime.jsx("input", __assign({ "data-testid": "ds-input-input", type: "text", ref: ref, className: classNames(error ? 'p-input--error' : 'p-input', placeholder && placeholder.length > 0
|
|
7594
8046
|
? styles$o.input
|
|
7595
8047
|
: styles$o['input--no-placeholder'], (_b = {}, _b[styles$o['input--with-prefix']] = prefix, _b)), placeholder: " ", disabled: disabled }, props), void 0),
|
|
@@ -7598,7 +8050,7 @@ var Input = require$$0__default['default'].forwardRef(function (_a, ref) {
|
|
|
7598
8050
|
error && (jsxRuntime.jsx("p", __assign({ className: "p-p--small tc-red-500 w100 " + styles$o.error }, { children: error }), void 0))] }), void 0));
|
|
7599
8051
|
});
|
|
7600
8052
|
|
|
7601
|
-
var z7=Object.defineProperty;var V=(t,a)=>{for(var z in a)z7(t,z,{get:a[z],enumerable:!0});};var s=["AF","AL","DZ","AD","AS","AO","AI","AQ","AG","AR","AM","AW","AU","AT","AZ","BS","BH","BD","BB","BY","BE","BZ","BJ","BM","BT","BO","BA","BW","BV","BR","IO","BN","BG","BF","BI","KH","CM","CA","CV","KY","CF","TD","CL","CN","CX","CC","CO","KM","CG","CD","CK","CR","CI","HR","CU","CY","CZ","DK","DJ","DM","DO","EC","EG","SV","GQ","ER","EE","ET","FK","FO","FJ","FI","FR","GF","PF","TF","GA","GM","GE","DE","GH","GI","GR","GL","GD","GP","GU","GT","GN","GW","GY","HT","HM","VA","HN","HK","HU","IS","IN","ID","IR","IQ","IE","IL","IT","JM","JP","JO","KZ","KE","KI","KP","KR","KW","KG","LA","LV","LB","LS","LR","LY","LI","LT","LU","MO","MK","MG","MW","MY","MV","ML","MT","MH","MQ","MR","MU","YT","MX","FM","MD","MC","MN","MS","ME","MA","MZ","MM","NA","NR","NP","NL","NC","NZ","NI","NE","NG","NU","NF","MP","NO","OM","PK","PW","PS","PA","PG","PY","PE","PH","PN","PL","PT","PR","QA","RE","RO","RU","RW","SH","KN","LC","PM","VC","WS","SM","ST","SA","SN","RS","SC","SL","SG","SK","SI","SB","SO","ZA","GS","ES","LK","SD","SR","SJ","SZ","SE","CH","SY","TW","TJ","TZ","TH","TL","TG","TK","TO","TT","TN","TR","TM","TC","TV","UG","UA","AE","GB","US","UM","UY","UZ","VU","VE","VN","VG","VI","WF","EH","YE","ZM","ZW","AX","BQ","CW","GG","IM","JE","BL","MF","SX","XK","SS"];var r={};V(r,{countries:()=>L,default:()=>p7,locale:()=>y});var y="en",L={AF:"Afghanistan",AL:"Albania",DZ:"Algeria",AS:"American Samoa",AD:"Andorra",AO:"Angola",AI:"Anguilla",AQ:"Antarctica",AG:"Antigua and Barbuda",AR:"Argentina",AM:"Armenia",AW:"Aruba",AU:"Australia",AT:"Austria",AZ:"Azerbaijan",BS:"Bahamas",BH:"Bahrain",BD:"Bangladesh",BB:"Barbados",BY:"Belarus",BE:"Belgium",BZ:"Belize",BJ:"Benin",BM:"Bermuda",BT:"Bhutan",BO:"Bolivia",BA:"Bosnia and Herzegovina",BW:"Botswana",BV:"Bouvet Island",BR:"Brazil",IO:"British Indian Ocean Territory",BN:"Brunei Darussalam",BG:"Bulgaria",BF:"Burkina Faso",BI:"Burundi",KH:"Cambodia",CM:"Cameroon",CA:"Canada",CV:"Cape Verde",KY:"Cayman Islands",CF:"Central African Republic",TD:"Chad",CL:"Chile",CN:"China",CX:"Christmas Island",CC:"Cocos (Keeling) Islands",CO:"Colombia",KM:"Comoros",CG:"Republic of the Congo",CD:"Democratic Republic of the Congo",CK:"Cook Islands",CR:"Costa Rica",CI:"Cote D'Ivoire",HR:"Croatia",CU:"Cuba",CY:"Cyprus",CZ:"Czech Republic",DK:"Denmark",DJ:"Djibouti",DM:"Dominica",DO:"Dominican Republic",EC:"Ecuador",EG:"Egypt",SV:"El Salvador",GQ:"Equatorial Guinea",ER:"Eritrea",EE:"Estonia",ET:"Ethiopia",FK:"Falkland Islands (Malvinas)",FO:"Faroe Islands",FJ:"Fiji",FI:"Finland",FR:"France",GF:"French Guiana",PF:"French Polynesia",TF:"French Southern Territories",GA:"Gabon",GM:"Gambia",GE:"Georgia",DE:"Germany",GH:"Ghana",GI:"Gibraltar",GR:"Greece",GL:"Greenland",GD:"Grenada",GP:"Guadeloupe",GU:"Guam",GT:"Guatemala",GN:"Guinea",GW:"Guinea-Bissau",GY:"Guyana",HT:"Haiti",HM:"Heard Island and McDonald Islands",VA:"Holy See (Vatican City State)",HN:"Honduras",HK:"Hong Kong",HU:"Hungary",IS:"Iceland",IN:"India",ID:"Indonesia",IR:"Iran",IQ:"Iraq",IE:"Ireland",IL:"Israel",IT:"Italy",JM:"Jamaica",JP:"Japan",JO:"Jordan",KZ:"Kazakhstan",KE:"Kenya",KI:"Kiribati",KP:"North Korea",KR:"South Korea",KW:"Kuwait",KG:"Kyrgyzstan",LA:"Lao People's Democratic Republic",LV:"Latvia",LB:"Lebanon",LS:"Lesotho",LR:"Liberia",LY:"Libya",LI:"Liechtenstein",LT:"Lithuania",LU:"Luxembourg",MO:"Macao",MG:"Madagascar",MW:"Malawi",MY:"Malaysia",MV:"Maldives",ML:"Mali",MT:"Malta",MH:"Marshall Islands",MQ:"Martinique",MR:"Mauritania",MU:"Mauritius",YT:"Mayotte",MX:"Mexico",FM:"Micronesia, Federated States of",MD:"Moldova, Republic of",MC:"Monaco",MN:"Mongolia",MS:"Montserrat",MA:"Morocco",MZ:"Mozambique",MM:"Myanmar",NA:"Namibia",NR:"Nauru",NP:"Nepal",NL:"Netherlands",NC:"New Caledonia",NZ:"New Zealand",NI:"Nicaragua",NE:"Niger",NG:"Nigeria",NU:"Niue",NF:"Norfolk Island",MK:"North Macedonia",MP:"Northern Mariana Islands",NO:"Norway",OM:"Oman",PK:"Pakistan",PW:"Palau",PS:"Palestine",PA:"Panama",PG:"Papua New Guinea",PY:"Paraguay",PE:"Peru",PH:"Philippines",PN:"Pitcairn",PL:"Poland",PT:"Portugal",PR:"Puerto Rico",QA:"Qatar",RE:"Reunion",RO:"Romania",RU:"Russia",RW:"Rwanda",SH:"Saint Helena",KN:"Saint Kitts and Nevis",LC:"Saint Lucia",PM:"Saint Pierre and Miquelon",VC:"Saint Vincent and the Grenadines",WS:"Samoa",SM:"San Marino",ST:"Sao Tome and Principe",SA:"Saudi Arabia",SN:"Senegal",SC:"Seychelles",SL:"Sierra Leone",SG:"Singapore",SK:"Slovakia",SI:"Slovenia",SB:"Solomon Islands",SO:"Somalia",ZA:"South Africa",GS:"South Georgia and the South Sandwich Islands",ES:"Spain",LK:"Sri Lanka",SD:"Sudan",SR:"Suriname",SJ:"Svalbard and Jan Mayen",SZ:"Eswatini",SE:"Sweden",CH:"Switzerland",SY:"Syrian Arab Republic",TW:"Taiwan",TJ:"Tajikistan",TZ:"Tanzania",TH:"Thailand",TL:"Timor-Leste",TG:"Togo",TK:"Tokelau",TO:"Tonga",TT:"Trinidad and Tobago",TN:"Tunisia",TR:"Turkey",TM:"Turkmenistan",TC:"Turks and Caicos Islands",TV:"Tuvalu",UG:"Uganda",UA:"Ukraine",AE:"United Arab Emirates",GB:"United Kingdom",US:"United States",UM:"United States Minor Outlying Islands",UY:"Uruguay",UZ:"Uzbekistan",VU:"Vanuatu",VE:"Venezuela",VN:"Vietnam",VG:"Virgin Islands, British",VI:"Virgin Islands, U.S.",WF:"Wallis and Futuna",EH:"Western Sahara",YE:"Yemen",ZM:"Zambia",ZW:"Zimbabwe",AX:"\xC5land Islands",BQ:"Bonaire, Sint Eustatius and Saba",CW:"Cura\xE7ao",GG:"Guernsey",IM:"Isle of Man",JE:"Jersey",ME:"Montenegro",BL:"Saint Barth\xE9lemy",MF:"Saint Martin (French part)",RS:"Serbia",SX:"Sint Maarten (Dutch part)",SS:"South Sudan",XK:"Kosovo"},p7={locale:y,countries:L};var m={};V(m,{countries:()=>S,default:()=>M7,locale:()=>B});var B="de",S={AF:"Afghanistan",EG:"\xC4gypten",AX:"\xC5land",AL:"Albanien",DZ:"Algerien",AS:"Amerikanisch-Samoa",VI:"Amerikanische Jungferninseln",AD:"Andorra",AO:"Angola",AI:"Anguilla",AQ:"Antarktis",AG:"Antigua und Barbuda",GQ:"\xC4quatorialguinea",AR:"Argentinien",AM:"Armenien",AW:"Aruba",AZ:"Aserbaidschan",ET:"\xC4thiopien",AU:"Australien",BS:"Bahamas",BH:"Bahrain",BD:"Bangladesch",BB:"Barbados",BY:"Belarus",BE:"Belgien",BZ:"Belize",BJ:"Benin",BM:"Bermuda",BT:"Bhutan",BO:"Bolivien",BQ:"Bonaire",BA:"Bosnien und Herzegowina",BW:"Botswana",BV:"Bouvetinsel",BR:"Brasilien",VG:"Britische Jungferninseln",IO:"Britisches Territorium im Indischen Ozean",BN:"Brunei Darussalam",BG:"Bulgarien",BF:"Burkina Faso",BI:"Burundi",CL:"Chile",CN:"China",CK:"Cookinseln",CR:"Costa Rica",CI:"Elfenbeink\xFCste",CW:"Cura\xE7ao",DK:"D\xE4nemark",DE:"Deutschland",DM:"Dominica",DO:"Dominikanische Republik",DJ:"Dschibuti",EC:"Ecuador",SV:"El Salvador",ER:"Eritrea",EE:"Estland",FK:"Falklandinseln",FO:"F\xE4r\xF6er",FJ:"Fidschi",FI:"Finnland",FR:"Frankreich",GF:"Franz\xF6sisch-Guayana",PF:"Franz\xF6sisch-Polynesien",TF:"Franz\xF6sische S\xFCd- und Antarktisgebiete",GA:"Gabun",GM:"Gambia",GE:"Georgien",GH:"Ghana",GI:"Gibraltar",GD:"Grenada",GR:"Griechenland",GL:"Gr\xF6nland",GP:"Guadeloupe",GU:"Guam",GT:"Guatemala",GG:"Guernsey",GN:"Guinea",GW:"Guinea-Bissau",GY:"Guyana",HT:"Haiti",HM:"Heard und McDonaldinseln",HN:"Honduras",HK:"Hongkong",IN:"Indien",ID:"Indonesien",IM:"Insel Man",IQ:"Irak",IR:"Iran",IE:"Irland",IS:"Island",IL:"Israel",IT:"Italien",JM:"Jamaika",JP:"Japan",YE:"Jemen",JE:"Jersey",JO:"Jordanien",KY:"Kaimaninseln",KH:"Kambodscha",CM:"Kamerun",CA:"Kanada",CV:"Kap Verde",KZ:"Kasachstan",QA:"Katar",KE:"Kenia",KG:"Kirgisistan",KI:"Kiribati",CC:"Kokosinseln",CO:"Kolumbien",KM:"Komoren",CD:"Kongo",KP:"Nordkorea",KR:"S\xFCdkorea",HR:"Kroatien",CU:"Kuba",KW:"Kuwait",LA:"Laos",LS:"Lesotho",LV:"Lettland",LB:"Libanon",LR:"Liberia",LY:"Libyen",LI:"Liechtenstein",LT:"Litauen",LU:"Luxemburg",MO:"Macao",MG:"Madagaskar",MW:"Malawi",MY:"Malaysia",MV:"Malediven",ML:"Mali",MT:"Malta",MA:"Marokko",MH:"Marshallinseln",MQ:"Martinique",MR:"Mauretanien",MU:"Mauritius",YT:"Mayotte",MX:"Mexiko",FM:"Mikronesien",MD:"Moldawien",MC:"Monaco",MN:"Mongolei",ME:"Montenegro",MS:"Montserrat",MZ:"Mosambik",MM:"Myanmar",NA:"Namibia",NR:"Nauru",NP:"Nepal",NC:"Neukaledonien",NZ:"Neuseeland",NI:"Nicaragua",NL:"Niederlande",NE:"Niger",NG:"Nigeria",NU:"Niue",MK:"Nordmazedonien",MP:"N\xF6rdliche Marianen",NF:"Norfolkinsel",NO:"Norwegen",OM:"Oman",AT:"\xD6sterreich",TL:"Osttimor",PK:"Pakistan",PS:"Staat Pal\xE4stina",PW:"Palau",PA:"Panama",PG:"Papua-Neuguinea",PY:"Paraguay",PE:"Peru",PH:"Philippinen",PN:"Pitcairninseln",PL:"Polen",PT:"Portugal",PR:"Puerto Rico",TW:"Taiwan",CG:"Republik Kongo",RE:"R\xE9union",RW:"Ruanda",RO:"Rum\xE4nien",RU:"Russische F\xF6deration",BL:"Saint-Barth\xE9lemy",MF:"Saint-Martin",SB:"Salomonen",ZM:"Sambia",WS:"Samoa",SM:"San Marino",ST:"S\xE3o Tom\xE9 und Pr\xEDncipe",SA:"Saudi-Arabien",SE:"Schweden",CH:"Schweiz",SN:"Senegal",RS:"Serbien",SC:"Seychellen",SL:"Sierra Leone",ZW:"Simbabwe",SG:"Singapur",SX:"Sint Maarten",SK:"Slowakei",SI:"Slowenien",SO:"Somalia",ES:"Spanien",LK:"Sri Lanka",SH:"St. Helena",KN:"St. Kitts und Nevis",LC:"St. Lucia",PM:"Saint-Pierre und Miquelon",VC:"St. Vincent und die Grenadinen",ZA:"S\xFCdafrika",SD:"Sudan",GS:"S\xFCdgeorgien und die S\xFCdlichen Sandwichinseln",SS:"S\xFCdsudan",SR:"Suriname",SJ:"Svalbard und Jan Mayen",SZ:"Eswatini",SY:"Syrien, Arabische Republik",TJ:"Tadschikistan",TZ:"Tansania, Vereinigte Republik",TH:"Thailand",TG:"Togo",TK:"Tokelau",TO:"Tonga",TT:"Trinidad und Tobago",TD:"Tschad",CZ:"Tschechische Republik",TN:"Tunesien",TR:"T\xFCrkei",TM:"Turkmenistan",TC:"Turks- und Caicosinseln",TV:"Tuvalu",UG:"Uganda",UA:"Ukraine",HU:"Ungarn",UM:"United States Minor Outlying Islands",UY:"Uruguay",UZ:"Usbekistan",VU:"Vanuatu",VA:"Vatikanstadt",VE:"Venezuela",AE:"Vereinigte Arabische Emirate",US:"Vereinigte Staaten",GB:"Vereinigtes K\xF6nigreich",VN:"Vietnam",WF:"Wallis und Futuna",CX:"Weihnachtsinsel",EH:"Westsahara",CF:"Zentralafrikanische Republik",CY:"Zypern",XK:"Kosovo"},M7={locale:B,countries:S};var c7={en:r,de:m};function $5(t,a="en"){return c7[a].countries[t]}var f7=(t="en")=>s.map(a=>({name:c7[t].countries[a],code:a}));f7();
|
|
8053
|
+
var z7=Object.defineProperty;var V=(t,a)=>{for(var z in a)z7(t,z,{get:a[z],enumerable:!0});};var s=["AF","AL","DZ","AD","AS","AO","AI","AQ","AG","AR","AM","AW","AU","AT","AZ","BS","BH","BD","BB","BY","BE","BZ","BJ","BM","BT","BO","BA","BW","BV","BR","IO","BN","BG","BF","BI","KH","CM","CA","CV","KY","CF","TD","CL","CN","CX","CC","CO","KM","CG","CD","CK","CR","CI","HR","CU","CY","CZ","DK","DJ","DM","DO","EC","EG","SV","GQ","ER","EE","ET","FK","FO","FJ","FI","FR","GF","PF","TF","GA","GM","GE","DE","GH","GI","GR","GL","GD","GP","GU","GT","GN","GW","GY","HT","HM","VA","HN","HK","HU","IS","IN","ID","IR","IQ","IE","IL","IT","JM","JP","JO","KZ","KE","KI","KP","KR","KW","KG","LA","LV","LB","LS","LR","LY","LI","LT","LU","MO","MK","MG","MW","MY","MV","ML","MT","MH","MQ","MR","MU","YT","MX","FM","MD","MC","MN","MS","ME","MA","MZ","MM","NA","NR","NP","NL","NC","NZ","NI","NE","NG","NU","NF","MP","NO","OM","PK","PW","PS","PA","PG","PY","PE","PH","PN","PL","PT","PR","QA","RE","RO","RU","RW","SH","KN","LC","PM","VC","WS","SM","ST","SA","SN","RS","SC","SL","SG","SK","SI","SB","SO","ZA","GS","ES","LK","SD","SR","SJ","SZ","SE","CH","SY","TW","TJ","TZ","TH","TL","TG","TK","TO","TT","TN","TR","TM","TC","TV","UG","UA","AE","GB","US","UM","UY","UZ","VU","VE","VN","VG","VI","WF","EH","YE","ZM","ZW","AX","BQ","CW","GG","IM","JE","BL","MF","SX","XK","SS"];var r$1={};V(r$1,{countries:()=>L,default:()=>p7,locale:()=>y$1});var y$1="en",L={AF:"Afghanistan",AL:"Albania",DZ:"Algeria",AS:"American Samoa",AD:"Andorra",AO:"Angola",AI:"Anguilla",AQ:"Antarctica",AG:"Antigua and Barbuda",AR:"Argentina",AM:"Armenia",AW:"Aruba",AU:"Australia",AT:"Austria",AZ:"Azerbaijan",BS:"Bahamas",BH:"Bahrain",BD:"Bangladesh",BB:"Barbados",BY:"Belarus",BE:"Belgium",BZ:"Belize",BJ:"Benin",BM:"Bermuda",BT:"Bhutan",BO:"Bolivia",BA:"Bosnia and Herzegovina",BW:"Botswana",BV:"Bouvet Island",BR:"Brazil",IO:"British Indian Ocean Territory",BN:"Brunei Darussalam",BG:"Bulgaria",BF:"Burkina Faso",BI:"Burundi",KH:"Cambodia",CM:"Cameroon",CA:"Canada",CV:"Cape Verde",KY:"Cayman Islands",CF:"Central African Republic",TD:"Chad",CL:"Chile",CN:"China",CX:"Christmas Island",CC:"Cocos (Keeling) Islands",CO:"Colombia",KM:"Comoros",CG:"Republic of the Congo",CD:"Democratic Republic of the Congo",CK:"Cook Islands",CR:"Costa Rica",CI:"Cote D'Ivoire",HR:"Croatia",CU:"Cuba",CY:"Cyprus",CZ:"Czech Republic",DK:"Denmark",DJ:"Djibouti",DM:"Dominica",DO:"Dominican Republic",EC:"Ecuador",EG:"Egypt",SV:"El Salvador",GQ:"Equatorial Guinea",ER:"Eritrea",EE:"Estonia",ET:"Ethiopia",FK:"Falkland Islands (Malvinas)",FO:"Faroe Islands",FJ:"Fiji",FI:"Finland",FR:"France",GF:"French Guiana",PF:"French Polynesia",TF:"French Southern Territories",GA:"Gabon",GM:"Gambia",GE:"Georgia",DE:"Germany",GH:"Ghana",GI:"Gibraltar",GR:"Greece",GL:"Greenland",GD:"Grenada",GP:"Guadeloupe",GU:"Guam",GT:"Guatemala",GN:"Guinea",GW:"Guinea-Bissau",GY:"Guyana",HT:"Haiti",HM:"Heard Island and McDonald Islands",VA:"Holy See (Vatican City State)",HN:"Honduras",HK:"Hong Kong",HU:"Hungary",IS:"Iceland",IN:"India",ID:"Indonesia",IR:"Iran",IQ:"Iraq",IE:"Ireland",IL:"Israel",IT:"Italy",JM:"Jamaica",JP:"Japan",JO:"Jordan",KZ:"Kazakhstan",KE:"Kenya",KI:"Kiribati",KP:"North Korea",KR:"South Korea",KW:"Kuwait",KG:"Kyrgyzstan",LA:"Lao People's Democratic Republic",LV:"Latvia",LB:"Lebanon",LS:"Lesotho",LR:"Liberia",LY:"Libya",LI:"Liechtenstein",LT:"Lithuania",LU:"Luxembourg",MO:"Macao",MG:"Madagascar",MW:"Malawi",MY:"Malaysia",MV:"Maldives",ML:"Mali",MT:"Malta",MH:"Marshall Islands",MQ:"Martinique",MR:"Mauritania",MU:"Mauritius",YT:"Mayotte",MX:"Mexico",FM:"Micronesia, Federated States of",MD:"Moldova, Republic of",MC:"Monaco",MN:"Mongolia",MS:"Montserrat",MA:"Morocco",MZ:"Mozambique",MM:"Myanmar",NA:"Namibia",NR:"Nauru",NP:"Nepal",NL:"Netherlands",NC:"New Caledonia",NZ:"New Zealand",NI:"Nicaragua",NE:"Niger",NG:"Nigeria",NU:"Niue",NF:"Norfolk Island",MK:"North Macedonia",MP:"Northern Mariana Islands",NO:"Norway",OM:"Oman",PK:"Pakistan",PW:"Palau",PS:"Palestine",PA:"Panama",PG:"Papua New Guinea",PY:"Paraguay",PE:"Peru",PH:"Philippines",PN:"Pitcairn",PL:"Poland",PT:"Portugal",PR:"Puerto Rico",QA:"Qatar",RE:"Reunion",RO:"Romania",RU:"Russia",RW:"Rwanda",SH:"Saint Helena",KN:"Saint Kitts and Nevis",LC:"Saint Lucia",PM:"Saint Pierre and Miquelon",VC:"Saint Vincent and the Grenadines",WS:"Samoa",SM:"San Marino",ST:"Sao Tome and Principe",SA:"Saudi Arabia",SN:"Senegal",SC:"Seychelles",SL:"Sierra Leone",SG:"Singapore",SK:"Slovakia",SI:"Slovenia",SB:"Solomon Islands",SO:"Somalia",ZA:"South Africa",GS:"South Georgia and the South Sandwich Islands",ES:"Spain",LK:"Sri Lanka",SD:"Sudan",SR:"Suriname",SJ:"Svalbard and Jan Mayen",SZ:"Eswatini",SE:"Sweden",CH:"Switzerland",SY:"Syrian Arab Republic",TW:"Taiwan",TJ:"Tajikistan",TZ:"Tanzania",TH:"Thailand",TL:"Timor-Leste",TG:"Togo",TK:"Tokelau",TO:"Tonga",TT:"Trinidad and Tobago",TN:"Tunisia",TR:"Turkey",TM:"Turkmenistan",TC:"Turks and Caicos Islands",TV:"Tuvalu",UG:"Uganda",UA:"Ukraine",AE:"United Arab Emirates",GB:"United Kingdom",US:"United States",UM:"United States Minor Outlying Islands",UY:"Uruguay",UZ:"Uzbekistan",VU:"Vanuatu",VE:"Venezuela",VN:"Vietnam",VG:"Virgin Islands, British",VI:"Virgin Islands, U.S.",WF:"Wallis and Futuna",EH:"Western Sahara",YE:"Yemen",ZM:"Zambia",ZW:"Zimbabwe",AX:"\xC5land Islands",BQ:"Bonaire, Sint Eustatius and Saba",CW:"Cura\xE7ao",GG:"Guernsey",IM:"Isle of Man",JE:"Jersey",ME:"Montenegro",BL:"Saint Barth\xE9lemy",MF:"Saint Martin (French part)",RS:"Serbia",SX:"Sint Maarten (Dutch part)",SS:"South Sudan",XK:"Kosovo"},p7={locale:y$1,countries:L};var m$1={};V(m$1,{countries:()=>S,default:()=>M7,locale:()=>B});var B="de",S={AF:"Afghanistan",EG:"\xC4gypten",AX:"\xC5land",AL:"Albanien",DZ:"Algerien",AS:"Amerikanisch-Samoa",VI:"Amerikanische Jungferninseln",AD:"Andorra",AO:"Angola",AI:"Anguilla",AQ:"Antarktis",AG:"Antigua und Barbuda",GQ:"\xC4quatorialguinea",AR:"Argentinien",AM:"Armenien",AW:"Aruba",AZ:"Aserbaidschan",ET:"\xC4thiopien",AU:"Australien",BS:"Bahamas",BH:"Bahrain",BD:"Bangladesch",BB:"Barbados",BY:"Belarus",BE:"Belgien",BZ:"Belize",BJ:"Benin",BM:"Bermuda",BT:"Bhutan",BO:"Bolivien",BQ:"Bonaire",BA:"Bosnien und Herzegowina",BW:"Botswana",BV:"Bouvetinsel",BR:"Brasilien",VG:"Britische Jungferninseln",IO:"Britisches Territorium im Indischen Ozean",BN:"Brunei Darussalam",BG:"Bulgarien",BF:"Burkina Faso",BI:"Burundi",CL:"Chile",CN:"China",CK:"Cookinseln",CR:"Costa Rica",CI:"Elfenbeink\xFCste",CW:"Cura\xE7ao",DK:"D\xE4nemark",DE:"Deutschland",DM:"Dominica",DO:"Dominikanische Republik",DJ:"Dschibuti",EC:"Ecuador",SV:"El Salvador",ER:"Eritrea",EE:"Estland",FK:"Falklandinseln",FO:"F\xE4r\xF6er",FJ:"Fidschi",FI:"Finnland",FR:"Frankreich",GF:"Franz\xF6sisch-Guayana",PF:"Franz\xF6sisch-Polynesien",TF:"Franz\xF6sische S\xFCd- und Antarktisgebiete",GA:"Gabun",GM:"Gambia",GE:"Georgien",GH:"Ghana",GI:"Gibraltar",GD:"Grenada",GR:"Griechenland",GL:"Gr\xF6nland",GP:"Guadeloupe",GU:"Guam",GT:"Guatemala",GG:"Guernsey",GN:"Guinea",GW:"Guinea-Bissau",GY:"Guyana",HT:"Haiti",HM:"Heard und McDonaldinseln",HN:"Honduras",HK:"Hongkong",IN:"Indien",ID:"Indonesien",IM:"Insel Man",IQ:"Irak",IR:"Iran",IE:"Irland",IS:"Island",IL:"Israel",IT:"Italien",JM:"Jamaika",JP:"Japan",YE:"Jemen",JE:"Jersey",JO:"Jordanien",KY:"Kaimaninseln",KH:"Kambodscha",CM:"Kamerun",CA:"Kanada",CV:"Kap Verde",KZ:"Kasachstan",QA:"Katar",KE:"Kenia",KG:"Kirgisistan",KI:"Kiribati",CC:"Kokosinseln",CO:"Kolumbien",KM:"Komoren",CD:"Kongo",KP:"Nordkorea",KR:"S\xFCdkorea",HR:"Kroatien",CU:"Kuba",KW:"Kuwait",LA:"Laos",LS:"Lesotho",LV:"Lettland",LB:"Libanon",LR:"Liberia",LY:"Libyen",LI:"Liechtenstein",LT:"Litauen",LU:"Luxemburg",MO:"Macao",MG:"Madagaskar",MW:"Malawi",MY:"Malaysia",MV:"Malediven",ML:"Mali",MT:"Malta",MA:"Marokko",MH:"Marshallinseln",MQ:"Martinique",MR:"Mauretanien",MU:"Mauritius",YT:"Mayotte",MX:"Mexiko",FM:"Mikronesien",MD:"Moldawien",MC:"Monaco",MN:"Mongolei",ME:"Montenegro",MS:"Montserrat",MZ:"Mosambik",MM:"Myanmar",NA:"Namibia",NR:"Nauru",NP:"Nepal",NC:"Neukaledonien",NZ:"Neuseeland",NI:"Nicaragua",NL:"Niederlande",NE:"Niger",NG:"Nigeria",NU:"Niue",MK:"Nordmazedonien",MP:"N\xF6rdliche Marianen",NF:"Norfolkinsel",NO:"Norwegen",OM:"Oman",AT:"\xD6sterreich",TL:"Osttimor",PK:"Pakistan",PS:"Staat Pal\xE4stina",PW:"Palau",PA:"Panama",PG:"Papua-Neuguinea",PY:"Paraguay",PE:"Peru",PH:"Philippinen",PN:"Pitcairninseln",PL:"Polen",PT:"Portugal",PR:"Puerto Rico",TW:"Taiwan",CG:"Republik Kongo",RE:"R\xE9union",RW:"Ruanda",RO:"Rum\xE4nien",RU:"Russische F\xF6deration",BL:"Saint-Barth\xE9lemy",MF:"Saint-Martin",SB:"Salomonen",ZM:"Sambia",WS:"Samoa",SM:"San Marino",ST:"S\xE3o Tom\xE9 und Pr\xEDncipe",SA:"Saudi-Arabien",SE:"Schweden",CH:"Schweiz",SN:"Senegal",RS:"Serbien",SC:"Seychellen",SL:"Sierra Leone",ZW:"Simbabwe",SG:"Singapur",SX:"Sint Maarten",SK:"Slowakei",SI:"Slowenien",SO:"Somalia",ES:"Spanien",LK:"Sri Lanka",SH:"St. Helena",KN:"St. Kitts und Nevis",LC:"St. Lucia",PM:"Saint-Pierre und Miquelon",VC:"St. Vincent und die Grenadinen",ZA:"S\xFCdafrika",SD:"Sudan",GS:"S\xFCdgeorgien und die S\xFCdlichen Sandwichinseln",SS:"S\xFCdsudan",SR:"Suriname",SJ:"Svalbard und Jan Mayen",SZ:"Eswatini",SY:"Syrien, Arabische Republik",TJ:"Tadschikistan",TZ:"Tansania, Vereinigte Republik",TH:"Thailand",TG:"Togo",TK:"Tokelau",TO:"Tonga",TT:"Trinidad und Tobago",TD:"Tschad",CZ:"Tschechische Republik",TN:"Tunesien",TR:"T\xFCrkei",TM:"Turkmenistan",TC:"Turks- und Caicosinseln",TV:"Tuvalu",UG:"Uganda",UA:"Ukraine",HU:"Ungarn",UM:"United States Minor Outlying Islands",UY:"Uruguay",UZ:"Usbekistan",VU:"Vanuatu",VA:"Vatikanstadt",VE:"Venezuela",AE:"Vereinigte Arabische Emirate",US:"Vereinigte Staaten",GB:"Vereinigtes K\xF6nigreich",VN:"Vietnam",WF:"Wallis und Futuna",CX:"Weihnachtsinsel",EH:"Westsahara",CF:"Zentralafrikanische Republik",CY:"Zypern",XK:"Kosovo"},M7={locale:B,countries:S};var c7={en:r$1,de:m$1};function $5(t,a="en"){return c7[a].countries[t]}var f7=(t="en")=>s.map(a=>({name:c7[t].countries[a],code:a}));f7();
|
|
7602
8054
|
|
|
7603
8055
|
var geocoderAddressComponentToPartialAddress = function (input) {
|
|
7604
8056
|
var mapping = {
|
|
@@ -7793,6 +8245,238 @@ var AutoCompleteAddress = function (_a) {
|
|
|
7793
8245
|
jsxRuntime.jsx("span", __assign({ className: "p-a fw-bold c-pointer", onClick: handleEnterAddressManually }, { children: (manualAddressEntryTexts === null || manualAddressEntryTexts === void 0 ? void 0 : manualAddressEntryTexts.cta) || 'Enter address manually' }), void 0)] }), void 0))] }, void 0));
|
|
7794
8246
|
};
|
|
7795
8247
|
|
|
8248
|
+
var __rest = (undefined && undefined.__rest) || function (s, e) {
|
|
8249
|
+
var t = {};
|
|
8250
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
8251
|
+
t[p] = s[p];
|
|
8252
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
8253
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8254
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8255
|
+
t[p[i]] = s[p[i]];
|
|
8256
|
+
}
|
|
8257
|
+
return t;
|
|
8258
|
+
};
|
|
8259
|
+
// ------------------ Helpers
|
|
8260
|
+
function isNumber(n) {
|
|
8261
|
+
const number = parseFloat(n);
|
|
8262
|
+
return !isNaN(number) && isFinite(number);
|
|
8263
|
+
}
|
|
8264
|
+
function isPercentage(height) {
|
|
8265
|
+
// Percentage height
|
|
8266
|
+
return (typeof height === 'string' &&
|
|
8267
|
+
height[height.length - 1] === '%' &&
|
|
8268
|
+
isNumber(height.substring(0, height.length - 1)));
|
|
8269
|
+
}
|
|
8270
|
+
function hideContent(element, height) {
|
|
8271
|
+
// Check for element?.style is added cause this would fail in tests (react-test-renderer)
|
|
8272
|
+
// Read more here: https://github.com/Stanko/react-animate-height/issues/17
|
|
8273
|
+
if (height === 0 && (element === null || element === void 0 ? void 0 : element.style)) {
|
|
8274
|
+
element.style.display = 'none';
|
|
8275
|
+
}
|
|
8276
|
+
}
|
|
8277
|
+
function showContent(element, height) {
|
|
8278
|
+
// Check for element?.style is added cause this would fail in tests (react-test-renderer)
|
|
8279
|
+
// Read more here: https://github.com/Stanko/react-animate-height/issues/17
|
|
8280
|
+
if (height === 0 && (element === null || element === void 0 ? void 0 : element.style)) {
|
|
8281
|
+
element.style.display = '';
|
|
8282
|
+
}
|
|
8283
|
+
}
|
|
8284
|
+
const ANIMATION_STATE_CLASSES = {
|
|
8285
|
+
animating: 'rah-animating',
|
|
8286
|
+
animatingUp: 'rah-animating--up',
|
|
8287
|
+
animatingDown: 'rah-animating--down',
|
|
8288
|
+
animatingToHeightZero: 'rah-animating--to-height-zero',
|
|
8289
|
+
animatingToHeightAuto: 'rah-animating--to-height-auto',
|
|
8290
|
+
animatingToHeightSpecific: 'rah-animating--to-height-specific',
|
|
8291
|
+
static: 'rah-static',
|
|
8292
|
+
staticHeightZero: 'rah-static--height-zero',
|
|
8293
|
+
staticHeightAuto: 'rah-static--height-auto',
|
|
8294
|
+
staticHeightSpecific: 'rah-static--height-specific',
|
|
8295
|
+
};
|
|
8296
|
+
function getStaticStateClasses(animationStateClasses, height) {
|
|
8297
|
+
return classNames({
|
|
8298
|
+
[animationStateClasses.static]: true,
|
|
8299
|
+
[animationStateClasses.staticHeightZero]: height === 0,
|
|
8300
|
+
[animationStateClasses.staticHeightSpecific]: height > 0,
|
|
8301
|
+
[animationStateClasses.staticHeightAuto]: height === 'auto',
|
|
8302
|
+
});
|
|
8303
|
+
}
|
|
8304
|
+
const AnimateHeight = (_a) => {
|
|
8305
|
+
var { animateOpacity = false, animationStateClasses = {}, applyInlineTransitions = true, children, className = '', contentClassName, delay: userDelay = 0, duration: userDuration = 500, easing = 'ease', height, onHeightAnimationEnd, onHeightAnimationStart, style } = _a, props = __rest(_a, ["animateOpacity", "animationStateClasses", "applyInlineTransitions", "children", "className", "contentClassName", "delay", "duration", "easing", "height", "onHeightAnimationEnd", "onHeightAnimationStart", "style"]);
|
|
8306
|
+
// ------------------ Initialization
|
|
8307
|
+
const prevHeight = require$$0.useRef(height);
|
|
8308
|
+
const contentElement = require$$0.useRef(null);
|
|
8309
|
+
const animationClassesTimeoutID = require$$0.useRef();
|
|
8310
|
+
const timeoutID = require$$0.useRef();
|
|
8311
|
+
const stateClasses = require$$0.useRef(Object.assign(Object.assign({}, ANIMATION_STATE_CLASSES), animationStateClasses));
|
|
8312
|
+
const isBrowser = typeof window !== 'undefined';
|
|
8313
|
+
const prefersReducedMotion = require$$0.useRef(isBrowser && window.matchMedia
|
|
8314
|
+
? window.matchMedia('(prefers-reduced-motion)').matches
|
|
8315
|
+
: false);
|
|
8316
|
+
const delay = prefersReducedMotion.current ? 0 : userDelay;
|
|
8317
|
+
const duration = prefersReducedMotion.current ? 0 : userDuration;
|
|
8318
|
+
let initHeight = height;
|
|
8319
|
+
let initOverflow = 'visible';
|
|
8320
|
+
if (typeof initHeight === 'number') {
|
|
8321
|
+
// Reset negative height to 0
|
|
8322
|
+
initHeight = height < 0 ? 0 : height;
|
|
8323
|
+
initOverflow = 'hidden';
|
|
8324
|
+
}
|
|
8325
|
+
else if (isPercentage(initHeight)) {
|
|
8326
|
+
// If value is string "0%" make sure we convert it to number 0
|
|
8327
|
+
initHeight = height === '0%' ? 0 : height;
|
|
8328
|
+
initOverflow = 'hidden';
|
|
8329
|
+
}
|
|
8330
|
+
const [currentHeight, setCurrentHeight] = require$$0.useState(initHeight);
|
|
8331
|
+
const [overflow, setOverflow] = require$$0.useState(initOverflow);
|
|
8332
|
+
const [useTransitions, setUseTransitions] = require$$0.useState(false);
|
|
8333
|
+
const [animationStateClassNames, setAnimationStateClassNames] = require$$0.useState(getStaticStateClasses(stateClasses.current, height));
|
|
8334
|
+
// ------------------ Did mount
|
|
8335
|
+
require$$0.useEffect(() => {
|
|
8336
|
+
// Hide content if height is 0 (to prevent tabbing into it)
|
|
8337
|
+
hideContent(contentElement.current, currentHeight);
|
|
8338
|
+
// This should be explicitly run only on mount
|
|
8339
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
8340
|
+
}, []);
|
|
8341
|
+
// ------------------ Height update
|
|
8342
|
+
require$$0.useEffect(() => {
|
|
8343
|
+
if (height !== prevHeight.current && contentElement.current) {
|
|
8344
|
+
showContent(contentElement.current, prevHeight.current);
|
|
8345
|
+
// Cache content height
|
|
8346
|
+
contentElement.current.style.overflow = 'hidden';
|
|
8347
|
+
const contentHeight = contentElement.current.offsetHeight;
|
|
8348
|
+
contentElement.current.style.overflow = '';
|
|
8349
|
+
// set total animation time
|
|
8350
|
+
const totalDuration = duration + delay;
|
|
8351
|
+
let newHeight;
|
|
8352
|
+
let timeoutHeight;
|
|
8353
|
+
let timeoutOverflow = 'hidden';
|
|
8354
|
+
let timeoutUseTransitions;
|
|
8355
|
+
const isCurrentHeightAuto = prevHeight.current === 'auto';
|
|
8356
|
+
if (typeof height === 'number') {
|
|
8357
|
+
// Reset negative height to 0
|
|
8358
|
+
newHeight = height < 0 ? 0 : height;
|
|
8359
|
+
timeoutHeight = newHeight;
|
|
8360
|
+
}
|
|
8361
|
+
else if (isPercentage(height)) {
|
|
8362
|
+
// If value is string "0%" make sure we convert it to number 0
|
|
8363
|
+
newHeight = height === '0%' ? 0 : height;
|
|
8364
|
+
timeoutHeight = newHeight;
|
|
8365
|
+
}
|
|
8366
|
+
else {
|
|
8367
|
+
// If not, animate to content height
|
|
8368
|
+
// and then reset to auto
|
|
8369
|
+
newHeight = contentHeight; // TODO solve contentHeight = 0
|
|
8370
|
+
timeoutHeight = 'auto';
|
|
8371
|
+
timeoutOverflow = undefined;
|
|
8372
|
+
}
|
|
8373
|
+
if (isCurrentHeightAuto) {
|
|
8374
|
+
// This is the height to be animated to
|
|
8375
|
+
timeoutHeight = newHeight;
|
|
8376
|
+
// If previous height was 'auto'
|
|
8377
|
+
// set starting height explicitly to be able to use transition
|
|
8378
|
+
newHeight = contentHeight;
|
|
8379
|
+
}
|
|
8380
|
+
// Animation classes
|
|
8381
|
+
const newAnimationStateClassNames = classNames({
|
|
8382
|
+
[stateClasses.current.animating]: true,
|
|
8383
|
+
[stateClasses.current.animatingUp]: prevHeight.current === 'auto' || height < prevHeight.current,
|
|
8384
|
+
[stateClasses.current.animatingDown]: height === 'auto' || height > prevHeight.current,
|
|
8385
|
+
[stateClasses.current.animatingToHeightZero]: timeoutHeight === 0,
|
|
8386
|
+
[stateClasses.current.animatingToHeightAuto]: timeoutHeight === 'auto',
|
|
8387
|
+
[stateClasses.current.animatingToHeightSpecific]: timeoutHeight > 0,
|
|
8388
|
+
});
|
|
8389
|
+
// Animation classes to be put after animation is complete
|
|
8390
|
+
const timeoutAnimationStateClasses = getStaticStateClasses(stateClasses.current, timeoutHeight);
|
|
8391
|
+
// Set starting height and animating classes
|
|
8392
|
+
// When animating from 'auto' we first need to set fixed height
|
|
8393
|
+
// that change should be animated
|
|
8394
|
+
setCurrentHeight(newHeight);
|
|
8395
|
+
setOverflow('hidden');
|
|
8396
|
+
setUseTransitions(!isCurrentHeightAuto);
|
|
8397
|
+
setAnimationStateClassNames(newAnimationStateClassNames);
|
|
8398
|
+
// Clear timeouts
|
|
8399
|
+
clearTimeout(timeoutID.current);
|
|
8400
|
+
clearTimeout(animationClassesTimeoutID.current);
|
|
8401
|
+
if (isCurrentHeightAuto) {
|
|
8402
|
+
// When animating from 'auto' we use a short timeout to start animation
|
|
8403
|
+
// after setting fixed height above
|
|
8404
|
+
timeoutUseTransitions = true;
|
|
8405
|
+
// Short timeout to allow rendering of the initial animation state first
|
|
8406
|
+
timeoutID.current = setTimeout(() => {
|
|
8407
|
+
setCurrentHeight(timeoutHeight);
|
|
8408
|
+
setOverflow(timeoutOverflow);
|
|
8409
|
+
setUseTransitions(timeoutUseTransitions);
|
|
8410
|
+
// ANIMATION STARTS, run a callback if it exists
|
|
8411
|
+
onHeightAnimationStart === null || onHeightAnimationStart === void 0 ? void 0 : onHeightAnimationStart(timeoutHeight);
|
|
8412
|
+
}, 50);
|
|
8413
|
+
// Set static classes and remove transitions when animation ends
|
|
8414
|
+
animationClassesTimeoutID.current = setTimeout(() => {
|
|
8415
|
+
setUseTransitions(false);
|
|
8416
|
+
setAnimationStateClassNames(timeoutAnimationStateClasses);
|
|
8417
|
+
// ANIMATION ENDS
|
|
8418
|
+
// Hide content if height is 0 (to prevent tabbing into it)
|
|
8419
|
+
hideContent(contentElement.current, timeoutHeight);
|
|
8420
|
+
// Run a callback if it exists
|
|
8421
|
+
onHeightAnimationEnd === null || onHeightAnimationEnd === void 0 ? void 0 : onHeightAnimationEnd(timeoutHeight);
|
|
8422
|
+
}, totalDuration);
|
|
8423
|
+
}
|
|
8424
|
+
else {
|
|
8425
|
+
// ANIMATION STARTS, run a callback if it exists
|
|
8426
|
+
onHeightAnimationStart === null || onHeightAnimationStart === void 0 ? void 0 : onHeightAnimationStart(newHeight);
|
|
8427
|
+
// Set end height, classes and remove transitions when animation is complete
|
|
8428
|
+
timeoutID.current = setTimeout(() => {
|
|
8429
|
+
setCurrentHeight(timeoutHeight);
|
|
8430
|
+
setOverflow(timeoutOverflow);
|
|
8431
|
+
setUseTransitions(false);
|
|
8432
|
+
setAnimationStateClassNames(timeoutAnimationStateClasses);
|
|
8433
|
+
// ANIMATION ENDS
|
|
8434
|
+
// If height is auto, don't hide the content
|
|
8435
|
+
// (case when element is empty, therefore height is 0)
|
|
8436
|
+
if (height !== 'auto') {
|
|
8437
|
+
// Hide content if height is 0 (to prevent tabbing into it)
|
|
8438
|
+
hideContent(contentElement.current, newHeight); // TODO solve newHeight = 0
|
|
8439
|
+
}
|
|
8440
|
+
// Run a callback if it exists
|
|
8441
|
+
onHeightAnimationEnd === null || onHeightAnimationEnd === void 0 ? void 0 : onHeightAnimationEnd(newHeight);
|
|
8442
|
+
}, totalDuration);
|
|
8443
|
+
}
|
|
8444
|
+
}
|
|
8445
|
+
prevHeight.current = height;
|
|
8446
|
+
return () => {
|
|
8447
|
+
clearTimeout(timeoutID.current);
|
|
8448
|
+
clearTimeout(animationClassesTimeoutID.current);
|
|
8449
|
+
};
|
|
8450
|
+
// This should be explicitly run only on height change
|
|
8451
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
8452
|
+
}, [height]);
|
|
8453
|
+
// ------------------ Render
|
|
8454
|
+
const componentStyle = Object.assign(Object.assign({}, style), { height: currentHeight, overflow: overflow || (style === null || style === void 0 ? void 0 : style.overflow) });
|
|
8455
|
+
if (useTransitions && applyInlineTransitions) {
|
|
8456
|
+
componentStyle.transition = `height ${duration}ms ${easing} ${delay}ms`;
|
|
8457
|
+
// Include transition passed through styles
|
|
8458
|
+
if (style === null || style === void 0 ? void 0 : style.transition) {
|
|
8459
|
+
componentStyle.transition = `${style.transition}, ${componentStyle.transition}`;
|
|
8460
|
+
}
|
|
8461
|
+
// Add webkit vendor prefix still used by opera, blackberry...
|
|
8462
|
+
componentStyle.WebkitTransition = componentStyle.transition;
|
|
8463
|
+
}
|
|
8464
|
+
const contentStyle = {};
|
|
8465
|
+
if (animateOpacity) {
|
|
8466
|
+
contentStyle.transition = `opacity ${duration}ms ${easing} ${delay}ms`;
|
|
8467
|
+
// Add webkit vendor prefix still used by opera, blackberry...
|
|
8468
|
+
contentStyle.WebkitTransition = contentStyle.transition;
|
|
8469
|
+
if (currentHeight === 0) {
|
|
8470
|
+
contentStyle.opacity = 0;
|
|
8471
|
+
}
|
|
8472
|
+
}
|
|
8473
|
+
// Check if user passed aria-hidden prop
|
|
8474
|
+
const hasAriaHiddenProp = typeof props['aria-hidden'] !== 'undefined';
|
|
8475
|
+
const ariaHidden = hasAriaHiddenProp ? props['aria-hidden'] : height === 0;
|
|
8476
|
+
return (require$$0__default['default'].createElement("div", Object.assign({}, props, { "aria-hidden": ariaHidden, className: `${animationStateClassNames} ${className}`, style: componentStyle }),
|
|
8477
|
+
require$$0__default['default'].createElement("div", { className: contentClassName, style: contentStyle, ref: contentElement }, children)));
|
|
8478
|
+
};
|
|
8479
|
+
|
|
7796
8480
|
var css_248z$n = ".style-module_container__Uyltc {\n background-color: transparent;\n}\n\n.style-module_dropzoneContainer__yZoGP {\n border: 1px dashed var(--ds-primary-500);\n padding: 32px 0;\n background-color: white;\n transition: all 0.6s ease-in-out;\n}\n\n.style-module_img__11JI8 {\n vertical-align: middle;\n margin-right: 8px;\n height: 18px;\n}\n\n.style-module_textInline__2F21z {\n display: inline-flex;\n}\n\n.style-module_dropzoneContainer__yZoGP:focus {\n outline: none;\n}\n\n.style-module_dropzoneContainer__yZoGP:hover {\n background-color: var(--ds-primary-100);\n transition: 0.5s ease;\n}\n\n.style-module_dropzoneContainerDisabled__1X3gP {\n pointer-events: none;\n opacity: 0.4;\n}";
|
|
7797
8481
|
var styles$m = {"container":"style-module_container__Uyltc","dropzoneContainer":"style-module_dropzoneContainer__yZoGP","img":"style-module_img__11JI8","textInline":"style-module_textInline__2F21z","dropzoneContainerDisabled":"style-module_dropzoneContainerDisabled__1X3gP"};
|
|
7798
8482
|
styleInject(css_248z$n);
|
|
@@ -7953,11 +8637,17 @@ var getUploadStatus = function (progress, error) {
|
|
|
7953
8637
|
};
|
|
7954
8638
|
var index$7 = (function (_a) {
|
|
7955
8639
|
var _b;
|
|
7956
|
-
var uploadedFiles = _a.uploadedFiles, onFileSelect = _a.onFileSelect, uploading = _a.uploading, onRemoveFile = _a.onRemoveFile, _c = _a.isCondensed, isCondensed = _c === void 0 ? false : _c;
|
|
7957
|
-
var
|
|
7958
|
-
|
|
8640
|
+
var uploadedFiles = _a.uploadedFiles, onFileSelect = _a.onFileSelect, uploading = _a.uploading, onRemoveFile = _a.onRemoveFile, _c = _a.isCondensed, isCondensed = _c === void 0 ? false : _c, _d = _a.maxFiles, maxFiles = _d === void 0 ? 0 : _d;
|
|
8641
|
+
var _e = require$$0.useState(''), error = _e[0], setError = _e[1];
|
|
8642
|
+
var onDrop = require$$0.useCallback(function (acceptedFiles, filesRejected) {
|
|
8643
|
+
setError('');
|
|
8644
|
+
if (filesRejected.length > 0) {
|
|
8645
|
+
setError(filesRejected[0].errors[0].message);
|
|
8646
|
+
return;
|
|
8647
|
+
}
|
|
8648
|
+
onFileSelect(acceptedFiles);
|
|
7959
8649
|
}, [onFileSelect]);
|
|
7960
|
-
var
|
|
8650
|
+
var _f = useDropzone({ onDrop: onDrop, maxFiles: maxFiles }), getRootProps = _f.getRootProps, getInputProps = _f.getInputProps;
|
|
7961
8651
|
return (jsxRuntime.jsxs("div", __assign({ className: styles$m.container }, { children: [jsxRuntime.jsxs("div", __assign({ className: classNames("w100 ta-center br8 c-pointer " + styles$m.dropzoneContainer, (_b = {},
|
|
7962
8652
|
_b[styles$m['dropzoneContainerDisabled']] = uploading,
|
|
7963
8653
|
_b)) }, getRootProps(), { children: [jsxRuntime.jsx("input", __assign({}, getInputProps()), void 0),
|
|
@@ -7966,6 +8656,7 @@ var index$7 = (function (_a) {
|
|
|
7966
8656
|
? 'Please wait while uploading file...'
|
|
7967
8657
|
: 'Choose file or drag & drop' }), void 0),
|
|
7968
8658
|
jsxRuntime.jsx("div", __assign({ className: "p-p--small tc-grey-500" }, { children: "Supports JPEG, PNG, PDF" }), void 0)] }), void 0),
|
|
8659
|
+
jsxRuntime.jsx(AnimateHeight, __assign({ duration: 300, height: error ? 'auto' : 0 }, { children: jsxRuntime.jsx("p", __assign({ className: "tc-red-500 p-p--small" }, { children: error }), void 0) }), void 0),
|
|
7969
8660
|
uploadedFiles.length > 0 && (jsxRuntime.jsx("div", __assign({ className: "w100 mt16" }, { children: uploadedFiles.map(function (file) {
|
|
7970
8661
|
var uploadStatus = getUploadStatus(file.progress, file.error);
|
|
7971
8662
|
return (jsxRuntime.jsx(UploadFileCell, { uploadStatus: uploadStatus, file: file, onRemoveFile: onRemoveFile, uploading: uploading }, file.id));
|
|
@@ -8021,7 +8712,7 @@ var buttonTypeClassNameMap = {
|
|
|
8021
8712
|
outlineGrey: 'p-btn--outline-grey',
|
|
8022
8713
|
};
|
|
8023
8714
|
var Button = require$$0__default['default'].forwardRef(function (_a, ref) {
|
|
8024
|
-
var className = _a.className, _b = _a.loading, loading = _b === void 0 ? false : _b, buttonTitle = _a.buttonTitle, _c = _a.buttonType, buttonType = _c === void 0 ? 'primary' : _c, leftIcon = _a.leftIcon; _a.type; var props = __rest(_a, ["className", "loading", "buttonTitle", "buttonType", "leftIcon", "type"]);
|
|
8715
|
+
var className = _a.className, _b = _a.loading, loading = _b === void 0 ? false : _b, buttonTitle = _a.buttonTitle, _c = _a.buttonType, buttonType = _c === void 0 ? 'primary' : _c, leftIcon = _a.leftIcon; _a.type; var props = __rest$1(_a, ["className", "loading", "buttonTitle", "buttonType", "leftIcon", "type"]);
|
|
8025
8716
|
var buttonClassName = buttonTypeClassNameMap[buttonType];
|
|
8026
8717
|
var loadingClassName = loading ? 'p-btn--loading' : '';
|
|
8027
8718
|
return (jsxRuntime.jsx("button", __assign({ ref: ref, className: buttonClassName + " " + loadingClassName + " " + (className !== null && className !== void 0 ? className : '') }, props, { children: leftIcon ? (jsxRuntime.jsxs("div", __assign({ className: styles$i['content-container'] }, { children: [jsxRuntime.jsx("img", { width: "20px", height: "20px", className: "mr8", src: leftIcon.src, alt: leftIcon.alt }, void 0),
|
|
@@ -8075,7 +8766,7 @@ var formatIban = function (iban) {
|
|
|
8075
8766
|
};
|
|
8076
8767
|
|
|
8077
8768
|
var IbanInput = function (_a) {
|
|
8078
|
-
var value = _a.value, onChange = _a.onChange, props = __rest(_a, ["value", "onChange"]);
|
|
8769
|
+
var value = _a.value, onChange = _a.onChange, props = __rest$1(_a, ["value", "onChange"]);
|
|
8079
8770
|
return (jsxRuntime.jsx(Input, __assign({ value: formatIban(value), onChange: function (e) { return onChange(formatIban(e.target.value)); } }, props), void 0));
|
|
8080
8771
|
};
|
|
8081
8772
|
|
|
@@ -8095,7 +8786,7 @@ function reverseFormatInput(input) {
|
|
|
8095
8786
|
}
|
|
8096
8787
|
|
|
8097
8788
|
var CurrencyInput = function (_a) {
|
|
8098
|
-
var value = _a.value, onChange = _a.onChange; _a.type; var props = __rest(_a, ["value", "onChange", "type"]);
|
|
8789
|
+
var value = _a.value, onChange = _a.onChange; _a.type; var props = __rest$1(_a, ["value", "onChange", "type"]);
|
|
8099
8790
|
var _b = require$$0.useState(''), shadowValue = _b[0], setShadowValue = _b[1];
|
|
8100
8791
|
var formattedShadowValue = formatInput(shadowValue
|
|
8101
8792
|
.replace(/ /g, '') // remove all whitespace
|
|
@@ -8200,7 +8891,7 @@ var styles$e = {"mobile":"style-module_mobile__3k175","desktop":"style-module_de
|
|
|
8200
8891
|
styleInject(css_248z$f);
|
|
8201
8892
|
|
|
8202
8893
|
var index$5 = (function (_a) {
|
|
8203
|
-
var isOpen = _a.isOpen, props = __rest(_a, ["isOpen"]);
|
|
8894
|
+
var isOpen = _a.isOpen, props = __rest$1(_a, ["isOpen"]);
|
|
8204
8895
|
var mobileRef = require$$0.useRef(null);
|
|
8205
8896
|
var _b = require$$0.useState('desktop'), visibleSize = _b[0], setVisibleSize = _b[1];
|
|
8206
8897
|
var handleResize = function () {
|
|
@@ -8258,7 +8949,7 @@ var containerStyleFromTitleSize = function (titleSize) {
|
|
|
8258
8949
|
}
|
|
8259
8950
|
};
|
|
8260
8951
|
var index$4 = (function (_a) {
|
|
8261
|
-
var className = _a.className, title = _a.title, _b = _a.cardSize, cardSize = _b === void 0 ? 'medium' : _b, children = _a.children, leftIcon = _a.leftIcon, rightIcon = _a.rightIcon, _c = _a.state, state = _c === void 0 ? 'actionable' : _c, _d = _a.dropshadow, dropshadow = _d === void 0 ? true : _d, props = __rest(_a, ["className", "title", "cardSize", "children", "leftIcon", "rightIcon", "state", "dropshadow"]);
|
|
8952
|
+
var className = _a.className, title = _a.title, _b = _a.cardSize, cardSize = _b === void 0 ? 'medium' : _b, children = _a.children, leftIcon = _a.leftIcon, rightIcon = _a.rightIcon, _c = _a.state, state = _c === void 0 ? 'actionable' : _c, _d = _a.dropshadow, dropshadow = _d === void 0 ? true : _d, props = __rest$1(_a, ["className", "title", "cardSize", "children", "leftIcon", "rightIcon", "state", "dropshadow"]);
|
|
8262
8953
|
var cardStyle = className + " " + associatedClassForCardState(state, dropshadow) + " " + styles$d[containerStyleFromTitleSize(cardSize)];
|
|
8263
8954
|
var titleContainerStyle = styles$d['title-container'];
|
|
8264
8955
|
var headingStyle = headingForCardSize(cardSize);
|
|
@@ -8274,126 +8965,1117 @@ var css_248z$d = ".style-module_container__384bg {\n padding: 24px 24px 24px 32
|
|
|
8274
8965
|
var styles$c = {"container":"style-module_container__384bg","container--small":"style-module_container--small__35EZ1","container--xsmall":"style-module_container--xsmall__2DDsN","card-text--small":"style-module_card-text--small__1L_Fe","card-text--medium":"style-module_card-text--medium__qoKv2","card-text--big":"style-module_card-text--big__mMB2v"};
|
|
8275
8966
|
styleInject(css_248z$d);
|
|
8276
8967
|
|
|
8277
|
-
var containerStyleFromCardSize = function (cardSize) {
|
|
8278
|
-
switch (cardSize) {
|
|
8279
|
-
case 'xsmall':
|
|
8280
|
-
return 'container--xsmall';
|
|
8281
|
-
case 'small':
|
|
8282
|
-
return 'container--small';
|
|
8283
|
-
default:
|
|
8284
|
-
return 'container';
|
|
8968
|
+
var containerStyleFromCardSize = function (cardSize) {
|
|
8969
|
+
switch (cardSize) {
|
|
8970
|
+
case 'xsmall':
|
|
8971
|
+
return 'container--xsmall';
|
|
8972
|
+
case 'small':
|
|
8973
|
+
return 'container--small';
|
|
8974
|
+
default:
|
|
8975
|
+
return 'container';
|
|
8976
|
+
}
|
|
8977
|
+
};
|
|
8978
|
+
var cardTextStyleFromCardSize = function (cardSize) {
|
|
8979
|
+
switch (cardSize) {
|
|
8980
|
+
case 'xsmall':
|
|
8981
|
+
case 'small':
|
|
8982
|
+
return 'card-text--small';
|
|
8983
|
+
case 'medium':
|
|
8984
|
+
return 'card-text--medium';
|
|
8985
|
+
default:
|
|
8986
|
+
return 'card-text--big';
|
|
8987
|
+
}
|
|
8988
|
+
};
|
|
8989
|
+
var index$3 = (function (_a) {
|
|
8990
|
+
var _b = _a.className, className = _b === void 0 ? '' : _b, title = _a.title, _c = _a.cardSize, cardSize = _c === void 0 ? 'medium' : _c, children = _a.children, leftIcon = _a.leftIcon, rightIcon = _a.rightIcon, _d = _a.state, state = _d === void 0 ? 'actionable' : _d, _e = _a.dropshadow, dropshadow = _e === void 0 ? true : _e, props = __rest$1(_a, ["className", "title", "cardSize", "children", "leftIcon", "rightIcon", "state", "dropshadow"]);
|
|
8991
|
+
var cardStyle = "d-flex ai-center " + className + " " + associatedClassForCardState(state, dropshadow) + " " + styles$c[containerStyleFromCardSize(cardSize)];
|
|
8992
|
+
var headingStyle = headingForCardSize(cardSize);
|
|
8993
|
+
var iconStyle = cardSize === 'xsmall' ? 'mr16' : 'mr32';
|
|
8994
|
+
var cardTextStyle = "tc-grey-600 " + (cardSize === 'xsmall' ? 'p-p--small' : 'p-p ') + " " + styles$c[cardTextStyleFromCardSize(cardSize)];
|
|
8995
|
+
return (jsxRuntime.jsxs("div", __assign({ className: cardStyle }, props, { children: [leftIcon && (jsxRuntime.jsx("img", { width: "48px", height: "48px", className: iconStyle, src: leftIcon.src, alt: leftIcon.alt }, void 0)),
|
|
8996
|
+
jsxRuntime.jsxs("div", { children: [jsxRuntime.jsxs("div", __assign({ className: "d-flex" }, { children: [jsxRuntime.jsx("div", __assign({ className: headingStyle }, { children: title }), void 0),
|
|
8997
|
+
rightIcon && (jsxRuntime.jsx("img", { className: "ml-auto", width: "24px", height: "24px", src: rightIcon === 'arrow' ? arrowRight.src : rightIcon.src, alt: rightIcon === 'arrow' ? arrowRight.alt : rightIcon.alt }, void 0))] }), void 0),
|
|
8998
|
+
jsxRuntime.jsx("p", __assign({ className: cardTextStyle }, { children: children }), void 0)] }, void 0)] }), void 0));
|
|
8999
|
+
});
|
|
9000
|
+
|
|
9001
|
+
var css_248z$c = ".style-module_container__34kUF {\n padding: 32px 24px 24px 24px;\n display: flex;\n flex-direction: column;\n align-items: center;\n}\n\n.style-module_right-icon__3_kH9 {\n margin-left: 4px;\n}";
|
|
9002
|
+
var styles$b = {"container":"style-module_container__34kUF","right-icon":"style-module_right-icon__3_kH9"};
|
|
9003
|
+
styleInject(css_248z$c);
|
|
9004
|
+
|
|
9005
|
+
var index$2 = (function (_a) {
|
|
9006
|
+
var className = _a.className, title = _a.title, _b = _a.cardSize, cardSize = _b === void 0 ? 'medium' : _b, children = _a.children, topIcon = _a.topIcon, _c = _a.topIconSize, topIconSize = _c === void 0 ? { width: 48, height: 48 } : _c, rightIcon = _a.rightIcon, _d = _a.state, state = _d === void 0 ? 'actionable' : _d, _e = _a.dropshadow, dropshadow = _e === void 0 ? true : _e, props = __rest$1(_a, ["className", "title", "cardSize", "children", "topIcon", "topIconSize", "rightIcon", "state", "dropshadow"]);
|
|
9007
|
+
var cardStyle = "d-flex fd-column ai-center " + className + " " + associatedClassForCardState(state, dropshadow) + " " + styles$b.container;
|
|
9008
|
+
var headingStyle = headingForCardSize(cardSize);
|
|
9009
|
+
var iconStyle = styles$b['right-icon'];
|
|
9010
|
+
return (jsxRuntime.jsx(jsxRuntime.Fragment, { children: jsxRuntime.jsxs("div", __assign({ className: cardStyle }, props, { children: [jsxRuntime.jsx("img", { width: topIconSize.width, height: topIconSize.height, alt: topIcon.alt, src: topIcon.src }, void 0),
|
|
9011
|
+
jsxRuntime.jsxs("div", __assign({ className: "d-flex mt16" }, { children: [jsxRuntime.jsx("div", __assign({ className: headingStyle }, { children: title }), void 0),
|
|
9012
|
+
rightIcon && (jsxRuntime.jsx("img", { className: iconStyle, width: "24px", height: "24px", src: rightIcon === 'arrow' ? arrowRight.src : rightIcon.src, alt: rightIcon === 'arrow' ? arrowRight.alt : rightIcon.alt }, void 0))] }), void 0), children] }), void 0) }, void 0));
|
|
9013
|
+
});
|
|
9014
|
+
|
|
9015
|
+
var css_248z$b = "@keyframes style-module_appear-in__23V7k {\n from {\n opacity: 0;\n }\n to {\n opacity: 1;\n }\n}\n.style-module_root-container__3r_b9 {\n position: relative;\n padding-top: 40px;\n}\n.style-module_root-container__3r_b9:hover .style-module_right-icon__L6sf3 {\n visibility: visible;\n animation-name: style-module_appear-in__23V7k;\n animation-duration: 0.3s;\n animation-fill-mode: both;\n}\n\n.style-module_top-icon__10CJ3 {\n position: absolute;\n left: 50%;\n transform: translateX(-50%) translateY(-40px);\n}\n.style-module_top-icon--muted__3PZ1X {\n opacity: 0.25;\n}\n\n.style-module_right-icon__L6sf3 {\n visibility: hidden;\n position: absolute;\n top: 64px;\n right: 24px;\n}\n\n.style-module_container__19mu2 {\n padding: 0 24px 24px 24px;\n height: 100%;\n}\n@media (max-width: 34rem) {\n .style-module_container__19mu2 {\n height: fit-content;\n }\n}";
|
|
9016
|
+
var styles$a = {"root-container":"style-module_root-container__3r_b9","right-icon":"style-module_right-icon__L6sf3","appear-in":"style-module_appear-in__23V7k","top-icon":"style-module_top-icon__10CJ3","top-icon--muted":"style-module_top-icon--muted__3PZ1X","container":"style-module_container__19mu2"};
|
|
9017
|
+
styleInject(css_248z$b);
|
|
9018
|
+
|
|
9019
|
+
var index$1 = (function (_a) {
|
|
9020
|
+
var className = _a.className, title = _a.title, children = _a.children, topIcon = _a.topIcon, rightIcon = _a.rightIcon, _b = _a.state, state = _b === void 0 ? 'actionable' : _b, _c = _a.dropshadow, dropshadow = _c === void 0 ? true : _c, props = __rest$1(_a, ["className", "title", "children", "topIcon", "rightIcon", "state", "dropshadow"]);
|
|
9021
|
+
return (jsxRuntime.jsxs("div", __assign({ className: styles$a['root-container'] + " " + (className !== null && className !== void 0 ? className : '') }, props, { children: [jsxRuntime.jsx("img", { src: topIcon.src, alt: topIcon.alt, className: styles$a['top-icon'] + " " + (state === 'muted' ? styles$a['top-icon--muted'] : '') + " ", width: "80px", height: "80px" }, void 0),
|
|
9022
|
+
jsxRuntime.jsxs("div", __assign({ className: associatedClassForCardState(state, dropshadow) + " " + styles$a.container }, { children: [rightIcon && (jsxRuntime.jsx("img", { width: "20px", height: "20px", className: styles$a['right-icon'], src: rightIcon === 'info' ? info.src : rightIcon.src, alt: rightIcon === 'info' ? info.alt : rightIcon.alt }, void 0)),
|
|
9023
|
+
jsxRuntime.jsx("div", __assign({ className: "p-h4 ta-center mt64" }, { children: title }), void 0),
|
|
9024
|
+
jsxRuntime.jsx("p", __assign({ className: "p-p mt16 tc-grey-600" }, { children: children }), void 0)] }), void 0)] }), void 0));
|
|
9025
|
+
});
|
|
9026
|
+
|
|
9027
|
+
var css_248z$a = ".style-module_container__2tJCE {\n background-color: white;\n padding: 8px 16px;\n box-shadow: 0px 2px 20px rgba(97, 96, 162, 0.07);\n border-radius: 8px;\n border: 2px solid white;\n transition: border 0.2s ease-in-out;\n display: flex;\n justify-content: space-between;\n align-items: center;\n text-decoration: none;\n}\n.style-module_container__2tJCE:hover {\n border: 2px solid #b1b0f5;\n}\n.style-module_container__2tJCE[disabled] {\n pointer-events: none;\n opacity: 0.25;\n}\n.style-module_container__2tJCE:focus {\n border: 2px solid #8e8cee;\n}";
|
|
9028
|
+
var styles$9 = {"container":"style-module_container__2tJCE"};
|
|
9029
|
+
styleInject(css_248z$a);
|
|
9030
|
+
|
|
9031
|
+
var CardContent = function (_a) {
|
|
9032
|
+
var title = _a.title, description = _a.description;
|
|
9033
|
+
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("div", { children: [jsxRuntime.jsx("div", __assign({ className: "p-p--small" }, { children: title }), void 0),
|
|
9034
|
+
typeof description === 'string' ? (jsxRuntime.jsx("div", __assign({ className: "tc-primary-500 p-p" }, { children: description }), void 0)) : (description)] }, void 0),
|
|
9035
|
+
jsxRuntime.jsx("img", __assign({}, chevronRight, { alt: "Expander icon" }), void 0)] }, void 0));
|
|
9036
|
+
};
|
|
9037
|
+
var CardButton = function (_a) {
|
|
9038
|
+
var title = _a.title, description = _a.description, _b = _a.disabled, disabled = _b === void 0 ? false : _b, onClick = _a.onClick, href = _a.href, className = _a.className;
|
|
9039
|
+
var component = href ? 'a' : 'button';
|
|
9040
|
+
return (jsxRuntime.jsx(jsxRuntime.Fragment, { children: require$$0.createElement(component, __assign({ className: "c-pointer ta-left w100 " + styles$9.container + " " + (className !== null && className !== void 0 ? className : '') + "\n ", children: jsxRuntime.jsx(CardContent, { title: title, description: description }, void 0), disabled: disabled }, (component === 'a' ? { href: href } : { onClick: onClick }))) }, void 0));
|
|
9041
|
+
};
|
|
9042
|
+
|
|
9043
|
+
var headingForCardSize = function (cardSize) {
|
|
9044
|
+
switch (cardSize) {
|
|
9045
|
+
case 'xsmall':
|
|
9046
|
+
case 'small':
|
|
9047
|
+
return 'p-h4';
|
|
9048
|
+
case 'medium':
|
|
9049
|
+
return 'p-h3';
|
|
9050
|
+
case 'big':
|
|
9051
|
+
return 'p-h2';
|
|
9052
|
+
}
|
|
9053
|
+
};
|
|
9054
|
+
var associatedClassForCardState = function (state, dropshadow) {
|
|
9055
|
+
var baseClass = (function () {
|
|
9056
|
+
switch (state) {
|
|
9057
|
+
case 'actionable':
|
|
9058
|
+
return 'ds-card--actionable';
|
|
9059
|
+
case 'muted':
|
|
9060
|
+
return 'ds-card--muted';
|
|
9061
|
+
case 'static':
|
|
9062
|
+
return 'ds-card';
|
|
9063
|
+
}
|
|
9064
|
+
})();
|
|
9065
|
+
if (dropshadow === false) {
|
|
9066
|
+
return baseClass + " ds-card--no-dropshadow";
|
|
9067
|
+
}
|
|
9068
|
+
return baseClass;
|
|
9069
|
+
};
|
|
9070
|
+
|
|
9071
|
+
var css_248z$9 = ".style-module_chip__3LMgV {\n background: var(--ds-primary-100);\n border: 2px solid var(--ds-primary-100);\n border-radius: 8px;\n padding: 4px 8px;\n width: fit-content;\n width: -moz-fit-content;\n display: flex;\n align-items: center;\n animation-name: style-module_appearInAnimation__33Ebn;\n animation-duration: 0.5s;\n animation-fill-mode: both;\n}\n\n.style-module_chip__3LMgV:hover {\n transition: 0.2s ease-in;\n border: 2px solid var(--ds-primary-500);\n}\n\n.style-module_chip-image__2vVqF {\n width: 24px;\n height: 14px;\n}\n\n.style-module_chip-button-container__3gSRY {\n width: 16px;\n height: 16px;\n position: relative;\n}\n\n.style-module_chip-remove-button__3LK7e,\n.style-module_chip-remove-button-highlighted__3DysJ {\n position: absolute;\n}\n\n.style-module_chip-remove-button__3LK7e:hover {\n opacity: 0;\n}\n\n@keyframes style-module_appearInAnimation__33Ebn {\n from {\n opacity: 0;\n transform: translateX(16px);\n }\n to {\n opacity: 1;\n }\n}";
|
|
9072
|
+
var styles$8 = {"chip":"style-module_chip__3LMgV","appearInAnimation":"style-module_appearInAnimation__33Ebn","chip-image":"style-module_chip-image__2vVqF","chip-button-container":"style-module_chip-button-container__3gSRY","chip-remove-button":"style-module_chip-remove-button__3LK7e","chip-remove-button-highlighted":"style-module_chip-remove-button-highlighted__3DysJ"};
|
|
9073
|
+
styleInject(css_248z$9);
|
|
9074
|
+
|
|
9075
|
+
var removeButtonIcon = "data:image/svg+xml,%3Csvg%20width%3D%2217%22%20height%3D%2216%22%20viewBox%3D%220%200%2017%2016%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M12.4167%204L4.41666%2012%22%20stroke%3D%22%23B1B0F5%22%20strokeWidth%3D%222%22%20strokeLinecap%3D%22round%22%20strokeLinejoin%3D%22round%22%2F%3E%3Cpath%20d%3D%22M4.41666%204L12.4167%2012%22%20stroke%3D%22%23B1B0F5%22%20strokeWidth%3D%222%22%20strokeLinecap%3D%22round%22%20strokeLinejoin%3D%22round%22%2F%3E%3C%2Fsvg%3E";
|
|
9076
|
+
|
|
9077
|
+
var removeButtonHighlightedIcon = "data:image/svg+xml,%3Csvg%20width%3D%2216%22%20height%3D%2216%22%20viewBox%3D%220%200%2016%2016%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M12%204L4%2012%22%20stroke%3D%22%238E8CEE%22%20strokeWidth%3D%222%22%20strokeLinecap%3D%22round%22%20strokeLinejoin%3D%22round%22%2F%3E%3Cpath%20d%3D%22M4%204L12%2012%22%20stroke%3D%22%238E8CEE%22%20strokeWidth%3D%222%22%20strokeLinecap%3D%22round%22%20strokeLinejoin%3D%22round%22%2F%3E%3C%2Fsvg%3E";
|
|
9078
|
+
|
|
9079
|
+
var Chip = (function (_a) {
|
|
9080
|
+
var value = _a.value, onRemove = _a.onRemove;
|
|
9081
|
+
return (jsxRuntime.jsxs("div", __assign({ className: "p-p mr8 mb8 d-flex " + styles$8['chip'] }, { children: [value.leftIcon && (jsxRuntime.jsx("img", { className: "mr8 " + styles$8['chip-image'], src: value.leftIcon, alt: value.value }, void 0)),
|
|
9082
|
+
jsxRuntime.jsx("div", __assign({ className: "mr8" }, { children: value.value }), void 0),
|
|
9083
|
+
jsxRuntime.jsxs("div", __assign({ className: "c-pointer " + styles$8['chip-button-container'], onClick: function () { return onRemove(value); } }, { children: [jsxRuntime.jsx("img", { className: styles$8['chip-remove-button-highlighted'], src: removeButtonHighlightedIcon, alt: "removal x button highlighted" }, void 0),
|
|
9084
|
+
jsxRuntime.jsx("img", { className: styles$8['chip-remove-button'], src: removeButtonIcon, alt: "removal x button" }, void 0)] }), void 0)] }), void 0));
|
|
9085
|
+
});
|
|
9086
|
+
|
|
9087
|
+
var Autosuggest = {};
|
|
9088
|
+
|
|
9089
|
+
var propTypes = {exports: {}};
|
|
9090
|
+
|
|
9091
|
+
var reactIs = {exports: {}};
|
|
9092
|
+
|
|
9093
|
+
var reactIs_production_min = {};
|
|
9094
|
+
|
|
9095
|
+
/** @license React v16.13.1
|
|
9096
|
+
* react-is.production.min.js
|
|
9097
|
+
*
|
|
9098
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
9099
|
+
*
|
|
9100
|
+
* This source code is licensed under the MIT license found in the
|
|
9101
|
+
* LICENSE file in the root directory of this source tree.
|
|
9102
|
+
*/
|
|
9103
|
+
var b="function"===typeof Symbol&&Symbol.for,c=b?Symbol.for("react.element"):60103,d=b?Symbol.for("react.portal"):60106,e=b?Symbol.for("react.fragment"):60107,f=b?Symbol.for("react.strict_mode"):60108,g=b?Symbol.for("react.profiler"):60114,h=b?Symbol.for("react.provider"):60109,k=b?Symbol.for("react.context"):60110,l=b?Symbol.for("react.async_mode"):60111,m=b?Symbol.for("react.concurrent_mode"):60111,n=b?Symbol.for("react.forward_ref"):60112,p=b?Symbol.for("react.suspense"):60113,q=b?
|
|
9104
|
+
Symbol.for("react.suspense_list"):60120,r=b?Symbol.for("react.memo"):60115,t=b?Symbol.for("react.lazy"):60116,v=b?Symbol.for("react.block"):60121,w=b?Symbol.for("react.fundamental"):60117,x=b?Symbol.for("react.responder"):60118,y=b?Symbol.for("react.scope"):60119;
|
|
9105
|
+
function z(a){if("object"===typeof a&&null!==a){var u=a.$$typeof;switch(u){case c:switch(a=a.type,a){case l:case m:case e:case g:case f:case p:return a;default:switch(a=a&&a.$$typeof,a){case k:case n:case t:case r:case h:return a;default:return u}}case d:return u}}}function A(a){return z(a)===m}reactIs_production_min.AsyncMode=l;reactIs_production_min.ConcurrentMode=m;reactIs_production_min.ContextConsumer=k;reactIs_production_min.ContextProvider=h;reactIs_production_min.Element=c;reactIs_production_min.ForwardRef=n;reactIs_production_min.Fragment=e;reactIs_production_min.Lazy=t;reactIs_production_min.Memo=r;reactIs_production_min.Portal=d;
|
|
9106
|
+
reactIs_production_min.Profiler=g;reactIs_production_min.StrictMode=f;reactIs_production_min.Suspense=p;reactIs_production_min.isAsyncMode=function(a){return A(a)||z(a)===l};reactIs_production_min.isConcurrentMode=A;reactIs_production_min.isContextConsumer=function(a){return z(a)===k};reactIs_production_min.isContextProvider=function(a){return z(a)===h};reactIs_production_min.isElement=function(a){return "object"===typeof a&&null!==a&&a.$$typeof===c};reactIs_production_min.isForwardRef=function(a){return z(a)===n};reactIs_production_min.isFragment=function(a){return z(a)===e};reactIs_production_min.isLazy=function(a){return z(a)===t};
|
|
9107
|
+
reactIs_production_min.isMemo=function(a){return z(a)===r};reactIs_production_min.isPortal=function(a){return z(a)===d};reactIs_production_min.isProfiler=function(a){return z(a)===g};reactIs_production_min.isStrictMode=function(a){return z(a)===f};reactIs_production_min.isSuspense=function(a){return z(a)===p};
|
|
9108
|
+
reactIs_production_min.isValidElementType=function(a){return "string"===typeof a||"function"===typeof a||a===e||a===m||a===g||a===f||a===p||a===q||"object"===typeof a&&null!==a&&(a.$$typeof===t||a.$$typeof===r||a.$$typeof===h||a.$$typeof===k||a.$$typeof===n||a.$$typeof===w||a.$$typeof===x||a.$$typeof===y||a.$$typeof===v)};reactIs_production_min.typeOf=z;
|
|
9109
|
+
|
|
9110
|
+
var reactIs_development = {};
|
|
9111
|
+
|
|
9112
|
+
/** @license React v16.13.1
|
|
9113
|
+
* react-is.development.js
|
|
9114
|
+
*
|
|
9115
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
9116
|
+
*
|
|
9117
|
+
* This source code is licensed under the MIT license found in the
|
|
9118
|
+
* LICENSE file in the root directory of this source tree.
|
|
9119
|
+
*/
|
|
9120
|
+
|
|
9121
|
+
|
|
9122
|
+
|
|
9123
|
+
if (process.env.NODE_ENV !== "production") {
|
|
9124
|
+
(function() {
|
|
9125
|
+
|
|
9126
|
+
// The Symbol used to tag the ReactElement-like types. If there is no native Symbol
|
|
9127
|
+
// nor polyfill, then a plain number is used for performance.
|
|
9128
|
+
var hasSymbol = typeof Symbol === 'function' && Symbol.for;
|
|
9129
|
+
var REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for('react.element') : 0xeac7;
|
|
9130
|
+
var REACT_PORTAL_TYPE = hasSymbol ? Symbol.for('react.portal') : 0xeaca;
|
|
9131
|
+
var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for('react.fragment') : 0xeacb;
|
|
9132
|
+
var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for('react.strict_mode') : 0xeacc;
|
|
9133
|
+
var REACT_PROFILER_TYPE = hasSymbol ? Symbol.for('react.profiler') : 0xead2;
|
|
9134
|
+
var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for('react.provider') : 0xeacd;
|
|
9135
|
+
var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for('react.context') : 0xeace; // TODO: We don't use AsyncMode or ConcurrentMode anymore. They were temporary
|
|
9136
|
+
// (unstable) APIs that have been removed. Can we remove the symbols?
|
|
9137
|
+
|
|
9138
|
+
var REACT_ASYNC_MODE_TYPE = hasSymbol ? Symbol.for('react.async_mode') : 0xeacf;
|
|
9139
|
+
var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for('react.concurrent_mode') : 0xeacf;
|
|
9140
|
+
var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for('react.forward_ref') : 0xead0;
|
|
9141
|
+
var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for('react.suspense') : 0xead1;
|
|
9142
|
+
var REACT_SUSPENSE_LIST_TYPE = hasSymbol ? Symbol.for('react.suspense_list') : 0xead8;
|
|
9143
|
+
var REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3;
|
|
9144
|
+
var REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 0xead4;
|
|
9145
|
+
var REACT_BLOCK_TYPE = hasSymbol ? Symbol.for('react.block') : 0xead9;
|
|
9146
|
+
var REACT_FUNDAMENTAL_TYPE = hasSymbol ? Symbol.for('react.fundamental') : 0xead5;
|
|
9147
|
+
var REACT_RESPONDER_TYPE = hasSymbol ? Symbol.for('react.responder') : 0xead6;
|
|
9148
|
+
var REACT_SCOPE_TYPE = hasSymbol ? Symbol.for('react.scope') : 0xead7;
|
|
9149
|
+
|
|
9150
|
+
function isValidElementType(type) {
|
|
9151
|
+
return typeof type === 'string' || typeof type === 'function' || // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill.
|
|
9152
|
+
type === REACT_FRAGMENT_TYPE || type === REACT_CONCURRENT_MODE_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || typeof type === 'object' && type !== null && (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_FUNDAMENTAL_TYPE || type.$$typeof === REACT_RESPONDER_TYPE || type.$$typeof === REACT_SCOPE_TYPE || type.$$typeof === REACT_BLOCK_TYPE);
|
|
9153
|
+
}
|
|
9154
|
+
|
|
9155
|
+
function typeOf(object) {
|
|
9156
|
+
if (typeof object === 'object' && object !== null) {
|
|
9157
|
+
var $$typeof = object.$$typeof;
|
|
9158
|
+
|
|
9159
|
+
switch ($$typeof) {
|
|
9160
|
+
case REACT_ELEMENT_TYPE:
|
|
9161
|
+
var type = object.type;
|
|
9162
|
+
|
|
9163
|
+
switch (type) {
|
|
9164
|
+
case REACT_ASYNC_MODE_TYPE:
|
|
9165
|
+
case REACT_CONCURRENT_MODE_TYPE:
|
|
9166
|
+
case REACT_FRAGMENT_TYPE:
|
|
9167
|
+
case REACT_PROFILER_TYPE:
|
|
9168
|
+
case REACT_STRICT_MODE_TYPE:
|
|
9169
|
+
case REACT_SUSPENSE_TYPE:
|
|
9170
|
+
return type;
|
|
9171
|
+
|
|
9172
|
+
default:
|
|
9173
|
+
var $$typeofType = type && type.$$typeof;
|
|
9174
|
+
|
|
9175
|
+
switch ($$typeofType) {
|
|
9176
|
+
case REACT_CONTEXT_TYPE:
|
|
9177
|
+
case REACT_FORWARD_REF_TYPE:
|
|
9178
|
+
case REACT_LAZY_TYPE:
|
|
9179
|
+
case REACT_MEMO_TYPE:
|
|
9180
|
+
case REACT_PROVIDER_TYPE:
|
|
9181
|
+
return $$typeofType;
|
|
9182
|
+
|
|
9183
|
+
default:
|
|
9184
|
+
return $$typeof;
|
|
9185
|
+
}
|
|
9186
|
+
|
|
9187
|
+
}
|
|
9188
|
+
|
|
9189
|
+
case REACT_PORTAL_TYPE:
|
|
9190
|
+
return $$typeof;
|
|
9191
|
+
}
|
|
9192
|
+
}
|
|
9193
|
+
|
|
9194
|
+
return undefined;
|
|
9195
|
+
} // AsyncMode is deprecated along with isAsyncMode
|
|
9196
|
+
|
|
9197
|
+
var AsyncMode = REACT_ASYNC_MODE_TYPE;
|
|
9198
|
+
var ConcurrentMode = REACT_CONCURRENT_MODE_TYPE;
|
|
9199
|
+
var ContextConsumer = REACT_CONTEXT_TYPE;
|
|
9200
|
+
var ContextProvider = REACT_PROVIDER_TYPE;
|
|
9201
|
+
var Element = REACT_ELEMENT_TYPE;
|
|
9202
|
+
var ForwardRef = REACT_FORWARD_REF_TYPE;
|
|
9203
|
+
var Fragment = REACT_FRAGMENT_TYPE;
|
|
9204
|
+
var Lazy = REACT_LAZY_TYPE;
|
|
9205
|
+
var Memo = REACT_MEMO_TYPE;
|
|
9206
|
+
var Portal = REACT_PORTAL_TYPE;
|
|
9207
|
+
var Profiler = REACT_PROFILER_TYPE;
|
|
9208
|
+
var StrictMode = REACT_STRICT_MODE_TYPE;
|
|
9209
|
+
var Suspense = REACT_SUSPENSE_TYPE;
|
|
9210
|
+
var hasWarnedAboutDeprecatedIsAsyncMode = false; // AsyncMode should be deprecated
|
|
9211
|
+
|
|
9212
|
+
function isAsyncMode(object) {
|
|
9213
|
+
{
|
|
9214
|
+
if (!hasWarnedAboutDeprecatedIsAsyncMode) {
|
|
9215
|
+
hasWarnedAboutDeprecatedIsAsyncMode = true; // Using console['warn'] to evade Babel and ESLint
|
|
9216
|
+
|
|
9217
|
+
console['warn']('The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');
|
|
9218
|
+
}
|
|
9219
|
+
}
|
|
9220
|
+
|
|
9221
|
+
return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;
|
|
9222
|
+
}
|
|
9223
|
+
function isConcurrentMode(object) {
|
|
9224
|
+
return typeOf(object) === REACT_CONCURRENT_MODE_TYPE;
|
|
9225
|
+
}
|
|
9226
|
+
function isContextConsumer(object) {
|
|
9227
|
+
return typeOf(object) === REACT_CONTEXT_TYPE;
|
|
9228
|
+
}
|
|
9229
|
+
function isContextProvider(object) {
|
|
9230
|
+
return typeOf(object) === REACT_PROVIDER_TYPE;
|
|
9231
|
+
}
|
|
9232
|
+
function isElement(object) {
|
|
9233
|
+
return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
|
|
9234
|
+
}
|
|
9235
|
+
function isForwardRef(object) {
|
|
9236
|
+
return typeOf(object) === REACT_FORWARD_REF_TYPE;
|
|
9237
|
+
}
|
|
9238
|
+
function isFragment(object) {
|
|
9239
|
+
return typeOf(object) === REACT_FRAGMENT_TYPE;
|
|
9240
|
+
}
|
|
9241
|
+
function isLazy(object) {
|
|
9242
|
+
return typeOf(object) === REACT_LAZY_TYPE;
|
|
9243
|
+
}
|
|
9244
|
+
function isMemo(object) {
|
|
9245
|
+
return typeOf(object) === REACT_MEMO_TYPE;
|
|
9246
|
+
}
|
|
9247
|
+
function isPortal(object) {
|
|
9248
|
+
return typeOf(object) === REACT_PORTAL_TYPE;
|
|
9249
|
+
}
|
|
9250
|
+
function isProfiler(object) {
|
|
9251
|
+
return typeOf(object) === REACT_PROFILER_TYPE;
|
|
9252
|
+
}
|
|
9253
|
+
function isStrictMode(object) {
|
|
9254
|
+
return typeOf(object) === REACT_STRICT_MODE_TYPE;
|
|
9255
|
+
}
|
|
9256
|
+
function isSuspense(object) {
|
|
9257
|
+
return typeOf(object) === REACT_SUSPENSE_TYPE;
|
|
9258
|
+
}
|
|
9259
|
+
|
|
9260
|
+
reactIs_development.AsyncMode = AsyncMode;
|
|
9261
|
+
reactIs_development.ConcurrentMode = ConcurrentMode;
|
|
9262
|
+
reactIs_development.ContextConsumer = ContextConsumer;
|
|
9263
|
+
reactIs_development.ContextProvider = ContextProvider;
|
|
9264
|
+
reactIs_development.Element = Element;
|
|
9265
|
+
reactIs_development.ForwardRef = ForwardRef;
|
|
9266
|
+
reactIs_development.Fragment = Fragment;
|
|
9267
|
+
reactIs_development.Lazy = Lazy;
|
|
9268
|
+
reactIs_development.Memo = Memo;
|
|
9269
|
+
reactIs_development.Portal = Portal;
|
|
9270
|
+
reactIs_development.Profiler = Profiler;
|
|
9271
|
+
reactIs_development.StrictMode = StrictMode;
|
|
9272
|
+
reactIs_development.Suspense = Suspense;
|
|
9273
|
+
reactIs_development.isAsyncMode = isAsyncMode;
|
|
9274
|
+
reactIs_development.isConcurrentMode = isConcurrentMode;
|
|
9275
|
+
reactIs_development.isContextConsumer = isContextConsumer;
|
|
9276
|
+
reactIs_development.isContextProvider = isContextProvider;
|
|
9277
|
+
reactIs_development.isElement = isElement;
|
|
9278
|
+
reactIs_development.isForwardRef = isForwardRef;
|
|
9279
|
+
reactIs_development.isFragment = isFragment;
|
|
9280
|
+
reactIs_development.isLazy = isLazy;
|
|
9281
|
+
reactIs_development.isMemo = isMemo;
|
|
9282
|
+
reactIs_development.isPortal = isPortal;
|
|
9283
|
+
reactIs_development.isProfiler = isProfiler;
|
|
9284
|
+
reactIs_development.isStrictMode = isStrictMode;
|
|
9285
|
+
reactIs_development.isSuspense = isSuspense;
|
|
9286
|
+
reactIs_development.isValidElementType = isValidElementType;
|
|
9287
|
+
reactIs_development.typeOf = typeOf;
|
|
9288
|
+
})();
|
|
9289
|
+
}
|
|
9290
|
+
|
|
9291
|
+
if (process.env.NODE_ENV === 'production') {
|
|
9292
|
+
reactIs.exports = reactIs_production_min;
|
|
9293
|
+
} else {
|
|
9294
|
+
reactIs.exports = reactIs_development;
|
|
9295
|
+
}
|
|
9296
|
+
|
|
9297
|
+
/**
|
|
9298
|
+
* Copyright (c) 2013-present, Facebook, Inc.
|
|
9299
|
+
*
|
|
9300
|
+
* This source code is licensed under the MIT license found in the
|
|
9301
|
+
* LICENSE file in the root directory of this source tree.
|
|
9302
|
+
*/
|
|
9303
|
+
|
|
9304
|
+
var ReactPropTypesSecret$3 = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
|
|
9305
|
+
|
|
9306
|
+
var ReactPropTypesSecret_1 = ReactPropTypesSecret$3;
|
|
9307
|
+
|
|
9308
|
+
/**
|
|
9309
|
+
* Copyright (c) 2013-present, Facebook, Inc.
|
|
9310
|
+
*
|
|
9311
|
+
* This source code is licensed under the MIT license found in the
|
|
9312
|
+
* LICENSE file in the root directory of this source tree.
|
|
9313
|
+
*/
|
|
9314
|
+
|
|
9315
|
+
var printWarning$1 = function() {};
|
|
9316
|
+
|
|
9317
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
9318
|
+
var ReactPropTypesSecret$2 = ReactPropTypesSecret_1;
|
|
9319
|
+
var loggedTypeFailures = {};
|
|
9320
|
+
var has$1 = Function.call.bind(Object.prototype.hasOwnProperty);
|
|
9321
|
+
|
|
9322
|
+
printWarning$1 = function(text) {
|
|
9323
|
+
var message = 'Warning: ' + text;
|
|
9324
|
+
if (typeof console !== 'undefined') {
|
|
9325
|
+
console.error(message);
|
|
9326
|
+
}
|
|
9327
|
+
try {
|
|
9328
|
+
// --- Welcome to debugging React ---
|
|
9329
|
+
// This error was thrown as a convenience so that you can use this stack
|
|
9330
|
+
// to find the callsite that caused this warning to fire.
|
|
9331
|
+
throw new Error(message);
|
|
9332
|
+
} catch (x) {}
|
|
9333
|
+
};
|
|
9334
|
+
}
|
|
9335
|
+
|
|
9336
|
+
/**
|
|
9337
|
+
* Assert that the values match with the type specs.
|
|
9338
|
+
* Error messages are memorized and will only be shown once.
|
|
9339
|
+
*
|
|
9340
|
+
* @param {object} typeSpecs Map of name to a ReactPropType
|
|
9341
|
+
* @param {object} values Runtime values that need to be type-checked
|
|
9342
|
+
* @param {string} location e.g. "prop", "context", "child context"
|
|
9343
|
+
* @param {string} componentName Name of the component for error messages.
|
|
9344
|
+
* @param {?Function} getStack Returns the component stack.
|
|
9345
|
+
* @private
|
|
9346
|
+
*/
|
|
9347
|
+
function checkPropTypes$1(typeSpecs, values, location, componentName, getStack) {
|
|
9348
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
9349
|
+
for (var typeSpecName in typeSpecs) {
|
|
9350
|
+
if (has$1(typeSpecs, typeSpecName)) {
|
|
9351
|
+
var error;
|
|
9352
|
+
// Prop type validation may throw. In case they do, we don't want to
|
|
9353
|
+
// fail the render phase where it didn't fail before. So we log it.
|
|
9354
|
+
// After these have been cleaned up, we'll let them throw.
|
|
9355
|
+
try {
|
|
9356
|
+
// This is intentionally an invariant that gets caught. It's the same
|
|
9357
|
+
// behavior as without this statement except with a better message.
|
|
9358
|
+
if (typeof typeSpecs[typeSpecName] !== 'function') {
|
|
9359
|
+
var err = Error(
|
|
9360
|
+
(componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' +
|
|
9361
|
+
'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.'
|
|
9362
|
+
);
|
|
9363
|
+
err.name = 'Invariant Violation';
|
|
9364
|
+
throw err;
|
|
9365
|
+
}
|
|
9366
|
+
error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret$2);
|
|
9367
|
+
} catch (ex) {
|
|
9368
|
+
error = ex;
|
|
9369
|
+
}
|
|
9370
|
+
if (error && !(error instanceof Error)) {
|
|
9371
|
+
printWarning$1(
|
|
9372
|
+
(componentName || 'React class') + ': type specification of ' +
|
|
9373
|
+
location + ' `' + typeSpecName + '` is invalid; the type checker ' +
|
|
9374
|
+
'function must return `null` or an `Error` but returned a ' + typeof error + '. ' +
|
|
9375
|
+
'You may have forgotten to pass an argument to the type checker ' +
|
|
9376
|
+
'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' +
|
|
9377
|
+
'shape all require an argument).'
|
|
9378
|
+
);
|
|
9379
|
+
}
|
|
9380
|
+
if (error instanceof Error && !(error.message in loggedTypeFailures)) {
|
|
9381
|
+
// Only monitor this failure once because there tends to be a lot of the
|
|
9382
|
+
// same error.
|
|
9383
|
+
loggedTypeFailures[error.message] = true;
|
|
9384
|
+
|
|
9385
|
+
var stack = getStack ? getStack() : '';
|
|
9386
|
+
|
|
9387
|
+
printWarning$1(
|
|
9388
|
+
'Failed ' + location + ' type: ' + error.message + (stack != null ? stack : '')
|
|
9389
|
+
);
|
|
9390
|
+
}
|
|
9391
|
+
}
|
|
9392
|
+
}
|
|
9393
|
+
}
|
|
9394
|
+
}
|
|
9395
|
+
|
|
9396
|
+
/**
|
|
9397
|
+
* Resets warning cache when testing.
|
|
9398
|
+
*
|
|
9399
|
+
* @private
|
|
9400
|
+
*/
|
|
9401
|
+
checkPropTypes$1.resetWarningCache = function() {
|
|
9402
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
9403
|
+
loggedTypeFailures = {};
|
|
9404
|
+
}
|
|
9405
|
+
};
|
|
9406
|
+
|
|
9407
|
+
var checkPropTypes_1 = checkPropTypes$1;
|
|
9408
|
+
|
|
9409
|
+
/**
|
|
9410
|
+
* Copyright (c) 2013-present, Facebook, Inc.
|
|
9411
|
+
*
|
|
9412
|
+
* This source code is licensed under the MIT license found in the
|
|
9413
|
+
* LICENSE file in the root directory of this source tree.
|
|
9414
|
+
*/
|
|
9415
|
+
|
|
9416
|
+
var ReactIs$1 = reactIs.exports;
|
|
9417
|
+
var assign = objectAssign$1;
|
|
9418
|
+
|
|
9419
|
+
var ReactPropTypesSecret$1 = ReactPropTypesSecret_1;
|
|
9420
|
+
var checkPropTypes = checkPropTypes_1;
|
|
9421
|
+
|
|
9422
|
+
var has = Function.call.bind(Object.prototype.hasOwnProperty);
|
|
9423
|
+
var printWarning = function() {};
|
|
9424
|
+
|
|
9425
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
9426
|
+
printWarning = function(text) {
|
|
9427
|
+
var message = 'Warning: ' + text;
|
|
9428
|
+
if (typeof console !== 'undefined') {
|
|
9429
|
+
console.error(message);
|
|
9430
|
+
}
|
|
9431
|
+
try {
|
|
9432
|
+
// --- Welcome to debugging React ---
|
|
9433
|
+
// This error was thrown as a convenience so that you can use this stack
|
|
9434
|
+
// to find the callsite that caused this warning to fire.
|
|
9435
|
+
throw new Error(message);
|
|
9436
|
+
} catch (x) {}
|
|
9437
|
+
};
|
|
9438
|
+
}
|
|
9439
|
+
|
|
9440
|
+
function emptyFunctionThatReturnsNull() {
|
|
9441
|
+
return null;
|
|
9442
|
+
}
|
|
9443
|
+
|
|
9444
|
+
var factoryWithTypeCheckers = function(isValidElement, throwOnDirectAccess) {
|
|
9445
|
+
/* global Symbol */
|
|
9446
|
+
var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
|
|
9447
|
+
var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec.
|
|
9448
|
+
|
|
9449
|
+
/**
|
|
9450
|
+
* Returns the iterator method function contained on the iterable object.
|
|
9451
|
+
*
|
|
9452
|
+
* Be sure to invoke the function with the iterable as context:
|
|
9453
|
+
*
|
|
9454
|
+
* var iteratorFn = getIteratorFn(myIterable);
|
|
9455
|
+
* if (iteratorFn) {
|
|
9456
|
+
* var iterator = iteratorFn.call(myIterable);
|
|
9457
|
+
* ...
|
|
9458
|
+
* }
|
|
9459
|
+
*
|
|
9460
|
+
* @param {?object} maybeIterable
|
|
9461
|
+
* @return {?function}
|
|
9462
|
+
*/
|
|
9463
|
+
function getIteratorFn(maybeIterable) {
|
|
9464
|
+
var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]);
|
|
9465
|
+
if (typeof iteratorFn === 'function') {
|
|
9466
|
+
return iteratorFn;
|
|
9467
|
+
}
|
|
9468
|
+
}
|
|
9469
|
+
|
|
9470
|
+
/**
|
|
9471
|
+
* Collection of methods that allow declaration and validation of props that are
|
|
9472
|
+
* supplied to React components. Example usage:
|
|
9473
|
+
*
|
|
9474
|
+
* var Props = require('ReactPropTypes');
|
|
9475
|
+
* var MyArticle = React.createClass({
|
|
9476
|
+
* propTypes: {
|
|
9477
|
+
* // An optional string prop named "description".
|
|
9478
|
+
* description: Props.string,
|
|
9479
|
+
*
|
|
9480
|
+
* // A required enum prop named "category".
|
|
9481
|
+
* category: Props.oneOf(['News','Photos']).isRequired,
|
|
9482
|
+
*
|
|
9483
|
+
* // A prop named "dialog" that requires an instance of Dialog.
|
|
9484
|
+
* dialog: Props.instanceOf(Dialog).isRequired
|
|
9485
|
+
* },
|
|
9486
|
+
* render: function() { ... }
|
|
9487
|
+
* });
|
|
9488
|
+
*
|
|
9489
|
+
* A more formal specification of how these methods are used:
|
|
9490
|
+
*
|
|
9491
|
+
* type := array|bool|func|object|number|string|oneOf([...])|instanceOf(...)
|
|
9492
|
+
* decl := ReactPropTypes.{type}(.isRequired)?
|
|
9493
|
+
*
|
|
9494
|
+
* Each and every declaration produces a function with the same signature. This
|
|
9495
|
+
* allows the creation of custom validation functions. For example:
|
|
9496
|
+
*
|
|
9497
|
+
* var MyLink = React.createClass({
|
|
9498
|
+
* propTypes: {
|
|
9499
|
+
* // An optional string or URI prop named "href".
|
|
9500
|
+
* href: function(props, propName, componentName) {
|
|
9501
|
+
* var propValue = props[propName];
|
|
9502
|
+
* if (propValue != null && typeof propValue !== 'string' &&
|
|
9503
|
+
* !(propValue instanceof URI)) {
|
|
9504
|
+
* return new Error(
|
|
9505
|
+
* 'Expected a string or an URI for ' + propName + ' in ' +
|
|
9506
|
+
* componentName
|
|
9507
|
+
* );
|
|
9508
|
+
* }
|
|
9509
|
+
* }
|
|
9510
|
+
* },
|
|
9511
|
+
* render: function() {...}
|
|
9512
|
+
* });
|
|
9513
|
+
*
|
|
9514
|
+
* @internal
|
|
9515
|
+
*/
|
|
9516
|
+
|
|
9517
|
+
var ANONYMOUS = '<<anonymous>>';
|
|
9518
|
+
|
|
9519
|
+
// Important!
|
|
9520
|
+
// Keep this list in sync with production version in `./factoryWithThrowingShims.js`.
|
|
9521
|
+
var ReactPropTypes = {
|
|
9522
|
+
array: createPrimitiveTypeChecker('array'),
|
|
9523
|
+
bool: createPrimitiveTypeChecker('boolean'),
|
|
9524
|
+
func: createPrimitiveTypeChecker('function'),
|
|
9525
|
+
number: createPrimitiveTypeChecker('number'),
|
|
9526
|
+
object: createPrimitiveTypeChecker('object'),
|
|
9527
|
+
string: createPrimitiveTypeChecker('string'),
|
|
9528
|
+
symbol: createPrimitiveTypeChecker('symbol'),
|
|
9529
|
+
|
|
9530
|
+
any: createAnyTypeChecker(),
|
|
9531
|
+
arrayOf: createArrayOfTypeChecker,
|
|
9532
|
+
element: createElementTypeChecker(),
|
|
9533
|
+
elementType: createElementTypeTypeChecker(),
|
|
9534
|
+
instanceOf: createInstanceTypeChecker,
|
|
9535
|
+
node: createNodeChecker(),
|
|
9536
|
+
objectOf: createObjectOfTypeChecker,
|
|
9537
|
+
oneOf: createEnumTypeChecker,
|
|
9538
|
+
oneOfType: createUnionTypeChecker,
|
|
9539
|
+
shape: createShapeTypeChecker,
|
|
9540
|
+
exact: createStrictShapeTypeChecker,
|
|
9541
|
+
};
|
|
9542
|
+
|
|
9543
|
+
/**
|
|
9544
|
+
* inlined Object.is polyfill to avoid requiring consumers ship their own
|
|
9545
|
+
* https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is
|
|
9546
|
+
*/
|
|
9547
|
+
/*eslint-disable no-self-compare*/
|
|
9548
|
+
function is(x, y) {
|
|
9549
|
+
// SameValue algorithm
|
|
9550
|
+
if (x === y) {
|
|
9551
|
+
// Steps 1-5, 7-10
|
|
9552
|
+
// Steps 6.b-6.e: +0 != -0
|
|
9553
|
+
return x !== 0 || 1 / x === 1 / y;
|
|
9554
|
+
} else {
|
|
9555
|
+
// Step 6.a: NaN == NaN
|
|
9556
|
+
return x !== x && y !== y;
|
|
9557
|
+
}
|
|
9558
|
+
}
|
|
9559
|
+
/*eslint-enable no-self-compare*/
|
|
9560
|
+
|
|
9561
|
+
/**
|
|
9562
|
+
* We use an Error-like object for backward compatibility as people may call
|
|
9563
|
+
* PropTypes directly and inspect their output. However, we don't use real
|
|
9564
|
+
* Errors anymore. We don't inspect their stack anyway, and creating them
|
|
9565
|
+
* is prohibitively expensive if they are created too often, such as what
|
|
9566
|
+
* happens in oneOfType() for any type before the one that matched.
|
|
9567
|
+
*/
|
|
9568
|
+
function PropTypeError(message) {
|
|
9569
|
+
this.message = message;
|
|
9570
|
+
this.stack = '';
|
|
9571
|
+
}
|
|
9572
|
+
// Make `instanceof Error` still work for returned errors.
|
|
9573
|
+
PropTypeError.prototype = Error.prototype;
|
|
9574
|
+
|
|
9575
|
+
function createChainableTypeChecker(validate) {
|
|
9576
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
9577
|
+
var manualPropTypeCallCache = {};
|
|
9578
|
+
var manualPropTypeWarningCount = 0;
|
|
9579
|
+
}
|
|
9580
|
+
function checkType(isRequired, props, propName, componentName, location, propFullName, secret) {
|
|
9581
|
+
componentName = componentName || ANONYMOUS;
|
|
9582
|
+
propFullName = propFullName || propName;
|
|
9583
|
+
|
|
9584
|
+
if (secret !== ReactPropTypesSecret$1) {
|
|
9585
|
+
if (throwOnDirectAccess) {
|
|
9586
|
+
// New behavior only for users of `prop-types` package
|
|
9587
|
+
var err = new Error(
|
|
9588
|
+
'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +
|
|
9589
|
+
'Use `PropTypes.checkPropTypes()` to call them. ' +
|
|
9590
|
+
'Read more at http://fb.me/use-check-prop-types'
|
|
9591
|
+
);
|
|
9592
|
+
err.name = 'Invariant Violation';
|
|
9593
|
+
throw err;
|
|
9594
|
+
} else if (process.env.NODE_ENV !== 'production' && typeof console !== 'undefined') {
|
|
9595
|
+
// Old behavior for people using React.PropTypes
|
|
9596
|
+
var cacheKey = componentName + ':' + propName;
|
|
9597
|
+
if (
|
|
9598
|
+
!manualPropTypeCallCache[cacheKey] &&
|
|
9599
|
+
// Avoid spamming the console because they are often not actionable except for lib authors
|
|
9600
|
+
manualPropTypeWarningCount < 3
|
|
9601
|
+
) {
|
|
9602
|
+
printWarning(
|
|
9603
|
+
'You are manually calling a React.PropTypes validation ' +
|
|
9604
|
+
'function for the `' + propFullName + '` prop on `' + componentName + '`. This is deprecated ' +
|
|
9605
|
+
'and will throw in the standalone `prop-types` package. ' +
|
|
9606
|
+
'You may be seeing this warning due to a third-party PropTypes ' +
|
|
9607
|
+
'library. See https://fb.me/react-warning-dont-call-proptypes ' + 'for details.'
|
|
9608
|
+
);
|
|
9609
|
+
manualPropTypeCallCache[cacheKey] = true;
|
|
9610
|
+
manualPropTypeWarningCount++;
|
|
9611
|
+
}
|
|
9612
|
+
}
|
|
9613
|
+
}
|
|
9614
|
+
if (props[propName] == null) {
|
|
9615
|
+
if (isRequired) {
|
|
9616
|
+
if (props[propName] === null) {
|
|
9617
|
+
return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required ' + ('in `' + componentName + '`, but its value is `null`.'));
|
|
9618
|
+
}
|
|
9619
|
+
return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required in ' + ('`' + componentName + '`, but its value is `undefined`.'));
|
|
9620
|
+
}
|
|
9621
|
+
return null;
|
|
9622
|
+
} else {
|
|
9623
|
+
return validate(props, propName, componentName, location, propFullName);
|
|
9624
|
+
}
|
|
9625
|
+
}
|
|
9626
|
+
|
|
9627
|
+
var chainedCheckType = checkType.bind(null, false);
|
|
9628
|
+
chainedCheckType.isRequired = checkType.bind(null, true);
|
|
9629
|
+
|
|
9630
|
+
return chainedCheckType;
|
|
9631
|
+
}
|
|
9632
|
+
|
|
9633
|
+
function createPrimitiveTypeChecker(expectedType) {
|
|
9634
|
+
function validate(props, propName, componentName, location, propFullName, secret) {
|
|
9635
|
+
var propValue = props[propName];
|
|
9636
|
+
var propType = getPropType(propValue);
|
|
9637
|
+
if (propType !== expectedType) {
|
|
9638
|
+
// `propValue` being instance of, say, date/regexp, pass the 'object'
|
|
9639
|
+
// check, but we can offer a more precise error message here rather than
|
|
9640
|
+
// 'of type `object`'.
|
|
9641
|
+
var preciseType = getPreciseType(propValue);
|
|
9642
|
+
|
|
9643
|
+
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.'));
|
|
9644
|
+
}
|
|
9645
|
+
return null;
|
|
9646
|
+
}
|
|
9647
|
+
return createChainableTypeChecker(validate);
|
|
9648
|
+
}
|
|
9649
|
+
|
|
9650
|
+
function createAnyTypeChecker() {
|
|
9651
|
+
return createChainableTypeChecker(emptyFunctionThatReturnsNull);
|
|
9652
|
+
}
|
|
9653
|
+
|
|
9654
|
+
function createArrayOfTypeChecker(typeChecker) {
|
|
9655
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
9656
|
+
if (typeof typeChecker !== 'function') {
|
|
9657
|
+
return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside arrayOf.');
|
|
9658
|
+
}
|
|
9659
|
+
var propValue = props[propName];
|
|
9660
|
+
if (!Array.isArray(propValue)) {
|
|
9661
|
+
var propType = getPropType(propValue);
|
|
9662
|
+
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an array.'));
|
|
9663
|
+
}
|
|
9664
|
+
for (var i = 0; i < propValue.length; i++) {
|
|
9665
|
+
var error = typeChecker(propValue, i, componentName, location, propFullName + '[' + i + ']', ReactPropTypesSecret$1);
|
|
9666
|
+
if (error instanceof Error) {
|
|
9667
|
+
return error;
|
|
9668
|
+
}
|
|
9669
|
+
}
|
|
9670
|
+
return null;
|
|
9671
|
+
}
|
|
9672
|
+
return createChainableTypeChecker(validate);
|
|
9673
|
+
}
|
|
9674
|
+
|
|
9675
|
+
function createElementTypeChecker() {
|
|
9676
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
9677
|
+
var propValue = props[propName];
|
|
9678
|
+
if (!isValidElement(propValue)) {
|
|
9679
|
+
var propType = getPropType(propValue);
|
|
9680
|
+
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement.'));
|
|
9681
|
+
}
|
|
9682
|
+
return null;
|
|
9683
|
+
}
|
|
9684
|
+
return createChainableTypeChecker(validate);
|
|
9685
|
+
}
|
|
9686
|
+
|
|
9687
|
+
function createElementTypeTypeChecker() {
|
|
9688
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
9689
|
+
var propValue = props[propName];
|
|
9690
|
+
if (!ReactIs$1.isValidElementType(propValue)) {
|
|
9691
|
+
var propType = getPropType(propValue);
|
|
9692
|
+
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement type.'));
|
|
9693
|
+
}
|
|
9694
|
+
return null;
|
|
9695
|
+
}
|
|
9696
|
+
return createChainableTypeChecker(validate);
|
|
9697
|
+
}
|
|
9698
|
+
|
|
9699
|
+
function createInstanceTypeChecker(expectedClass) {
|
|
9700
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
9701
|
+
if (!(props[propName] instanceof expectedClass)) {
|
|
9702
|
+
var expectedClassName = expectedClass.name || ANONYMOUS;
|
|
9703
|
+
var actualClassName = getClassName(props[propName]);
|
|
9704
|
+
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + actualClassName + '` supplied to `' + componentName + '`, expected ') + ('instance of `' + expectedClassName + '`.'));
|
|
9705
|
+
}
|
|
9706
|
+
return null;
|
|
9707
|
+
}
|
|
9708
|
+
return createChainableTypeChecker(validate);
|
|
9709
|
+
}
|
|
9710
|
+
|
|
9711
|
+
function createEnumTypeChecker(expectedValues) {
|
|
9712
|
+
if (!Array.isArray(expectedValues)) {
|
|
9713
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
9714
|
+
if (arguments.length > 1) {
|
|
9715
|
+
printWarning(
|
|
9716
|
+
'Invalid arguments supplied to oneOf, expected an array, got ' + arguments.length + ' arguments. ' +
|
|
9717
|
+
'A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z]).'
|
|
9718
|
+
);
|
|
9719
|
+
} else {
|
|
9720
|
+
printWarning('Invalid argument supplied to oneOf, expected an array.');
|
|
9721
|
+
}
|
|
9722
|
+
}
|
|
9723
|
+
return emptyFunctionThatReturnsNull;
|
|
9724
|
+
}
|
|
9725
|
+
|
|
9726
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
9727
|
+
var propValue = props[propName];
|
|
9728
|
+
for (var i = 0; i < expectedValues.length; i++) {
|
|
9729
|
+
if (is(propValue, expectedValues[i])) {
|
|
9730
|
+
return null;
|
|
9731
|
+
}
|
|
9732
|
+
}
|
|
9733
|
+
|
|
9734
|
+
var valuesString = JSON.stringify(expectedValues, function replacer(key, value) {
|
|
9735
|
+
var type = getPreciseType(value);
|
|
9736
|
+
if (type === 'symbol') {
|
|
9737
|
+
return String(value);
|
|
9738
|
+
}
|
|
9739
|
+
return value;
|
|
9740
|
+
});
|
|
9741
|
+
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of value `' + String(propValue) + '` ' + ('supplied to `' + componentName + '`, expected one of ' + valuesString + '.'));
|
|
9742
|
+
}
|
|
9743
|
+
return createChainableTypeChecker(validate);
|
|
9744
|
+
}
|
|
9745
|
+
|
|
9746
|
+
function createObjectOfTypeChecker(typeChecker) {
|
|
9747
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
9748
|
+
if (typeof typeChecker !== 'function') {
|
|
9749
|
+
return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside objectOf.');
|
|
9750
|
+
}
|
|
9751
|
+
var propValue = props[propName];
|
|
9752
|
+
var propType = getPropType(propValue);
|
|
9753
|
+
if (propType !== 'object') {
|
|
9754
|
+
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an object.'));
|
|
9755
|
+
}
|
|
9756
|
+
for (var key in propValue) {
|
|
9757
|
+
if (has(propValue, key)) {
|
|
9758
|
+
var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret$1);
|
|
9759
|
+
if (error instanceof Error) {
|
|
9760
|
+
return error;
|
|
9761
|
+
}
|
|
9762
|
+
}
|
|
9763
|
+
}
|
|
9764
|
+
return null;
|
|
9765
|
+
}
|
|
9766
|
+
return createChainableTypeChecker(validate);
|
|
9767
|
+
}
|
|
9768
|
+
|
|
9769
|
+
function createUnionTypeChecker(arrayOfTypeCheckers) {
|
|
9770
|
+
if (!Array.isArray(arrayOfTypeCheckers)) {
|
|
9771
|
+
process.env.NODE_ENV !== 'production' ? printWarning('Invalid argument supplied to oneOfType, expected an instance of array.') : void 0;
|
|
9772
|
+
return emptyFunctionThatReturnsNull;
|
|
9773
|
+
}
|
|
9774
|
+
|
|
9775
|
+
for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
|
|
9776
|
+
var checker = arrayOfTypeCheckers[i];
|
|
9777
|
+
if (typeof checker !== 'function') {
|
|
9778
|
+
printWarning(
|
|
9779
|
+
'Invalid argument supplied to oneOfType. Expected an array of check functions, but ' +
|
|
9780
|
+
'received ' + getPostfixForTypeWarning(checker) + ' at index ' + i + '.'
|
|
9781
|
+
);
|
|
9782
|
+
return emptyFunctionThatReturnsNull;
|
|
9783
|
+
}
|
|
9784
|
+
}
|
|
9785
|
+
|
|
9786
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
9787
|
+
for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
|
|
9788
|
+
var checker = arrayOfTypeCheckers[i];
|
|
9789
|
+
if (checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret$1) == null) {
|
|
9790
|
+
return null;
|
|
9791
|
+
}
|
|
9792
|
+
}
|
|
9793
|
+
|
|
9794
|
+
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`.'));
|
|
9795
|
+
}
|
|
9796
|
+
return createChainableTypeChecker(validate);
|
|
9797
|
+
}
|
|
9798
|
+
|
|
9799
|
+
function createNodeChecker() {
|
|
9800
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
9801
|
+
if (!isNode(props[propName])) {
|
|
9802
|
+
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a ReactNode.'));
|
|
9803
|
+
}
|
|
9804
|
+
return null;
|
|
9805
|
+
}
|
|
9806
|
+
return createChainableTypeChecker(validate);
|
|
9807
|
+
}
|
|
9808
|
+
|
|
9809
|
+
function createShapeTypeChecker(shapeTypes) {
|
|
9810
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
9811
|
+
var propValue = props[propName];
|
|
9812
|
+
var propType = getPropType(propValue);
|
|
9813
|
+
if (propType !== 'object') {
|
|
9814
|
+
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
|
|
9815
|
+
}
|
|
9816
|
+
for (var key in shapeTypes) {
|
|
9817
|
+
var checker = shapeTypes[key];
|
|
9818
|
+
if (!checker) {
|
|
9819
|
+
continue;
|
|
9820
|
+
}
|
|
9821
|
+
var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret$1);
|
|
9822
|
+
if (error) {
|
|
9823
|
+
return error;
|
|
9824
|
+
}
|
|
9825
|
+
}
|
|
9826
|
+
return null;
|
|
9827
|
+
}
|
|
9828
|
+
return createChainableTypeChecker(validate);
|
|
9829
|
+
}
|
|
9830
|
+
|
|
9831
|
+
function createStrictShapeTypeChecker(shapeTypes) {
|
|
9832
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
9833
|
+
var propValue = props[propName];
|
|
9834
|
+
var propType = getPropType(propValue);
|
|
9835
|
+
if (propType !== 'object') {
|
|
9836
|
+
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
|
|
9837
|
+
}
|
|
9838
|
+
// We need to check all keys in case some are required but missing from
|
|
9839
|
+
// props.
|
|
9840
|
+
var allKeys = assign({}, props[propName], shapeTypes);
|
|
9841
|
+
for (var key in allKeys) {
|
|
9842
|
+
var checker = shapeTypes[key];
|
|
9843
|
+
if (!checker) {
|
|
9844
|
+
return new PropTypeError(
|
|
9845
|
+
'Invalid ' + location + ' `' + propFullName + '` key `' + key + '` supplied to `' + componentName + '`.' +
|
|
9846
|
+
'\nBad object: ' + JSON.stringify(props[propName], null, ' ') +
|
|
9847
|
+
'\nValid keys: ' + JSON.stringify(Object.keys(shapeTypes), null, ' ')
|
|
9848
|
+
);
|
|
9849
|
+
}
|
|
9850
|
+
var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret$1);
|
|
9851
|
+
if (error) {
|
|
9852
|
+
return error;
|
|
9853
|
+
}
|
|
9854
|
+
}
|
|
9855
|
+
return null;
|
|
9856
|
+
}
|
|
9857
|
+
|
|
9858
|
+
return createChainableTypeChecker(validate);
|
|
9859
|
+
}
|
|
9860
|
+
|
|
9861
|
+
function isNode(propValue) {
|
|
9862
|
+
switch (typeof propValue) {
|
|
9863
|
+
case 'number':
|
|
9864
|
+
case 'string':
|
|
9865
|
+
case 'undefined':
|
|
9866
|
+
return true;
|
|
9867
|
+
case 'boolean':
|
|
9868
|
+
return !propValue;
|
|
9869
|
+
case 'object':
|
|
9870
|
+
if (Array.isArray(propValue)) {
|
|
9871
|
+
return propValue.every(isNode);
|
|
9872
|
+
}
|
|
9873
|
+
if (propValue === null || isValidElement(propValue)) {
|
|
9874
|
+
return true;
|
|
9875
|
+
}
|
|
9876
|
+
|
|
9877
|
+
var iteratorFn = getIteratorFn(propValue);
|
|
9878
|
+
if (iteratorFn) {
|
|
9879
|
+
var iterator = iteratorFn.call(propValue);
|
|
9880
|
+
var step;
|
|
9881
|
+
if (iteratorFn !== propValue.entries) {
|
|
9882
|
+
while (!(step = iterator.next()).done) {
|
|
9883
|
+
if (!isNode(step.value)) {
|
|
9884
|
+
return false;
|
|
9885
|
+
}
|
|
9886
|
+
}
|
|
9887
|
+
} else {
|
|
9888
|
+
// Iterator will provide entry [k,v] tuples rather than values.
|
|
9889
|
+
while (!(step = iterator.next()).done) {
|
|
9890
|
+
var entry = step.value;
|
|
9891
|
+
if (entry) {
|
|
9892
|
+
if (!isNode(entry[1])) {
|
|
9893
|
+
return false;
|
|
9894
|
+
}
|
|
9895
|
+
}
|
|
9896
|
+
}
|
|
9897
|
+
}
|
|
9898
|
+
} else {
|
|
9899
|
+
return false;
|
|
9900
|
+
}
|
|
9901
|
+
|
|
9902
|
+
return true;
|
|
9903
|
+
default:
|
|
9904
|
+
return false;
|
|
9905
|
+
}
|
|
9906
|
+
}
|
|
9907
|
+
|
|
9908
|
+
function isSymbol(propType, propValue) {
|
|
9909
|
+
// Native Symbol.
|
|
9910
|
+
if (propType === 'symbol') {
|
|
9911
|
+
return true;
|
|
8285
9912
|
}
|
|
8286
|
-
|
|
8287
|
-
|
|
8288
|
-
|
|
8289
|
-
|
|
8290
|
-
case 'small':
|
|
8291
|
-
return 'card-text--small';
|
|
8292
|
-
case 'medium':
|
|
8293
|
-
return 'card-text--medium';
|
|
8294
|
-
default:
|
|
8295
|
-
return 'card-text--big';
|
|
9913
|
+
|
|
9914
|
+
// falsy value can't be a Symbol
|
|
9915
|
+
if (!propValue) {
|
|
9916
|
+
return false;
|
|
8296
9917
|
}
|
|
8297
|
-
};
|
|
8298
|
-
var index$3 = (function (_a) {
|
|
8299
|
-
var _b = _a.className, className = _b === void 0 ? '' : _b, title = _a.title, _c = _a.cardSize, cardSize = _c === void 0 ? 'medium' : _c, children = _a.children, leftIcon = _a.leftIcon, rightIcon = _a.rightIcon, _d = _a.state, state = _d === void 0 ? 'actionable' : _d, _e = _a.dropshadow, dropshadow = _e === void 0 ? true : _e, props = __rest(_a, ["className", "title", "cardSize", "children", "leftIcon", "rightIcon", "state", "dropshadow"]);
|
|
8300
|
-
var cardStyle = "d-flex ai-center " + className + " " + associatedClassForCardState(state, dropshadow) + " " + styles$c[containerStyleFromCardSize(cardSize)];
|
|
8301
|
-
var headingStyle = headingForCardSize(cardSize);
|
|
8302
|
-
var iconStyle = cardSize === 'xsmall' ? 'mr16' : 'mr32';
|
|
8303
|
-
var cardTextStyle = "tc-grey-600 " + (cardSize === 'xsmall' ? 'p-p--small' : 'p-p ') + " " + styles$c[cardTextStyleFromCardSize(cardSize)];
|
|
8304
|
-
return (jsxRuntime.jsxs("div", __assign({ className: cardStyle }, props, { children: [leftIcon && (jsxRuntime.jsx("img", { width: "48px", height: "48px", className: iconStyle, src: leftIcon.src, alt: leftIcon.alt }, void 0)),
|
|
8305
|
-
jsxRuntime.jsxs("div", { children: [jsxRuntime.jsxs("div", __assign({ className: "d-flex" }, { children: [jsxRuntime.jsx("div", __assign({ className: headingStyle }, { children: title }), void 0),
|
|
8306
|
-
rightIcon && (jsxRuntime.jsx("img", { className: "ml-auto", width: "24px", height: "24px", src: rightIcon === 'arrow' ? arrowRight.src : rightIcon.src, alt: rightIcon === 'arrow' ? arrowRight.alt : rightIcon.alt }, void 0))] }), void 0),
|
|
8307
|
-
jsxRuntime.jsx("p", __assign({ className: cardTextStyle }, { children: children }), void 0)] }, void 0)] }), void 0));
|
|
8308
|
-
});
|
|
8309
9918
|
|
|
8310
|
-
|
|
8311
|
-
|
|
8312
|
-
|
|
9919
|
+
// 19.4.3.5 Symbol.prototype[@@toStringTag] === 'Symbol'
|
|
9920
|
+
if (propValue['@@toStringTag'] === 'Symbol') {
|
|
9921
|
+
return true;
|
|
9922
|
+
}
|
|
8313
9923
|
|
|
8314
|
-
|
|
8315
|
-
|
|
8316
|
-
|
|
8317
|
-
|
|
8318
|
-
var iconStyle = styles$b['right-icon'];
|
|
8319
|
-
return (jsxRuntime.jsx(jsxRuntime.Fragment, { children: jsxRuntime.jsxs("div", __assign({ className: cardStyle }, props, { children: [jsxRuntime.jsx("img", { width: topIconSize.width, height: topIconSize.height, alt: topIcon.alt, src: topIcon.src }, void 0),
|
|
8320
|
-
jsxRuntime.jsxs("div", __assign({ className: "d-flex mt16" }, { children: [jsxRuntime.jsx("div", __assign({ className: headingStyle }, { children: title }), void 0),
|
|
8321
|
-
rightIcon && (jsxRuntime.jsx("img", { className: iconStyle, width: "24px", height: "24px", src: rightIcon === 'arrow' ? arrowRight.src : rightIcon.src, alt: rightIcon === 'arrow' ? arrowRight.alt : rightIcon.alt }, void 0))] }), void 0), children] }), void 0) }, void 0));
|
|
8322
|
-
});
|
|
9924
|
+
// Fallback for non-spec compliant Symbols which are polyfilled.
|
|
9925
|
+
if (typeof Symbol === 'function' && propValue instanceof Symbol) {
|
|
9926
|
+
return true;
|
|
9927
|
+
}
|
|
8323
9928
|
|
|
8324
|
-
|
|
8325
|
-
|
|
8326
|
-
styleInject(css_248z$b);
|
|
9929
|
+
return false;
|
|
9930
|
+
}
|
|
8327
9931
|
|
|
8328
|
-
|
|
8329
|
-
|
|
8330
|
-
|
|
8331
|
-
|
|
8332
|
-
|
|
8333
|
-
|
|
8334
|
-
|
|
9932
|
+
// Equivalent of `typeof` but with special handling for array and regexp.
|
|
9933
|
+
function getPropType(propValue) {
|
|
9934
|
+
var propType = typeof propValue;
|
|
9935
|
+
if (Array.isArray(propValue)) {
|
|
9936
|
+
return 'array';
|
|
9937
|
+
}
|
|
9938
|
+
if (propValue instanceof RegExp) {
|
|
9939
|
+
// Old webkits (at least until Android 4.0) return 'function' rather than
|
|
9940
|
+
// 'object' for typeof a RegExp. We'll normalize this here so that /bla/
|
|
9941
|
+
// passes PropTypes.object.
|
|
9942
|
+
return 'object';
|
|
9943
|
+
}
|
|
9944
|
+
if (isSymbol(propType, propValue)) {
|
|
9945
|
+
return 'symbol';
|
|
9946
|
+
}
|
|
9947
|
+
return propType;
|
|
9948
|
+
}
|
|
8335
9949
|
|
|
8336
|
-
|
|
8337
|
-
|
|
8338
|
-
|
|
9950
|
+
// This handles more types than `getPropType`. Only used for error messages.
|
|
9951
|
+
// See `createPrimitiveTypeChecker`.
|
|
9952
|
+
function getPreciseType(propValue) {
|
|
9953
|
+
if (typeof propValue === 'undefined' || propValue === null) {
|
|
9954
|
+
return '' + propValue;
|
|
9955
|
+
}
|
|
9956
|
+
var propType = getPropType(propValue);
|
|
9957
|
+
if (propType === 'object') {
|
|
9958
|
+
if (propValue instanceof Date) {
|
|
9959
|
+
return 'date';
|
|
9960
|
+
} else if (propValue instanceof RegExp) {
|
|
9961
|
+
return 'regexp';
|
|
9962
|
+
}
|
|
9963
|
+
}
|
|
9964
|
+
return propType;
|
|
9965
|
+
}
|
|
8339
9966
|
|
|
8340
|
-
|
|
8341
|
-
|
|
8342
|
-
|
|
8343
|
-
|
|
8344
|
-
|
|
8345
|
-
|
|
8346
|
-
|
|
8347
|
-
|
|
8348
|
-
|
|
8349
|
-
|
|
8350
|
-
|
|
9967
|
+
// Returns a string that is postfixed to a warning about an invalid type.
|
|
9968
|
+
// For example, "undefined" or "of type array"
|
|
9969
|
+
function getPostfixForTypeWarning(value) {
|
|
9970
|
+
var type = getPreciseType(value);
|
|
9971
|
+
switch (type) {
|
|
9972
|
+
case 'array':
|
|
9973
|
+
case 'object':
|
|
9974
|
+
return 'an ' + type;
|
|
9975
|
+
case 'boolean':
|
|
9976
|
+
case 'date':
|
|
9977
|
+
case 'regexp':
|
|
9978
|
+
return 'a ' + type;
|
|
9979
|
+
default:
|
|
9980
|
+
return type;
|
|
9981
|
+
}
|
|
9982
|
+
}
|
|
8351
9983
|
|
|
8352
|
-
|
|
8353
|
-
|
|
8354
|
-
|
|
8355
|
-
|
|
8356
|
-
return 'p-h4';
|
|
8357
|
-
case 'medium':
|
|
8358
|
-
return 'p-h3';
|
|
8359
|
-
case 'big':
|
|
8360
|
-
return 'p-h2';
|
|
9984
|
+
// Returns class name of the object, if any.
|
|
9985
|
+
function getClassName(propValue) {
|
|
9986
|
+
if (!propValue.constructor || !propValue.constructor.name) {
|
|
9987
|
+
return ANONYMOUS;
|
|
8361
9988
|
}
|
|
9989
|
+
return propValue.constructor.name;
|
|
9990
|
+
}
|
|
9991
|
+
|
|
9992
|
+
ReactPropTypes.checkPropTypes = checkPropTypes;
|
|
9993
|
+
ReactPropTypes.resetWarningCache = checkPropTypes.resetWarningCache;
|
|
9994
|
+
ReactPropTypes.PropTypes = ReactPropTypes;
|
|
9995
|
+
|
|
9996
|
+
return ReactPropTypes;
|
|
8362
9997
|
};
|
|
8363
|
-
|
|
8364
|
-
|
|
8365
|
-
|
|
8366
|
-
|
|
8367
|
-
|
|
8368
|
-
|
|
8369
|
-
|
|
8370
|
-
|
|
8371
|
-
|
|
8372
|
-
|
|
8373
|
-
|
|
8374
|
-
|
|
8375
|
-
|
|
9998
|
+
|
|
9999
|
+
/**
|
|
10000
|
+
* Copyright (c) 2013-present, Facebook, Inc.
|
|
10001
|
+
*
|
|
10002
|
+
* This source code is licensed under the MIT license found in the
|
|
10003
|
+
* LICENSE file in the root directory of this source tree.
|
|
10004
|
+
*/
|
|
10005
|
+
|
|
10006
|
+
var ReactPropTypesSecret = ReactPropTypesSecret_1;
|
|
10007
|
+
|
|
10008
|
+
function emptyFunction() {}
|
|
10009
|
+
function emptyFunctionWithReset() {}
|
|
10010
|
+
emptyFunctionWithReset.resetWarningCache = emptyFunction;
|
|
10011
|
+
|
|
10012
|
+
var factoryWithThrowingShims = function() {
|
|
10013
|
+
function shim(props, propName, componentName, location, propFullName, secret) {
|
|
10014
|
+
if (secret === ReactPropTypesSecret) {
|
|
10015
|
+
// It is still safe when called from React.
|
|
10016
|
+
return;
|
|
8376
10017
|
}
|
|
8377
|
-
|
|
8378
|
-
|
|
10018
|
+
var err = new Error(
|
|
10019
|
+
'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +
|
|
10020
|
+
'Use PropTypes.checkPropTypes() to call them. ' +
|
|
10021
|
+
'Read more at http://fb.me/use-check-prop-types'
|
|
10022
|
+
);
|
|
10023
|
+
err.name = 'Invariant Violation';
|
|
10024
|
+
throw err;
|
|
10025
|
+
} shim.isRequired = shim;
|
|
10026
|
+
function getShim() {
|
|
10027
|
+
return shim;
|
|
10028
|
+
} // Important!
|
|
10029
|
+
// Keep this list in sync with production version in `./factoryWithTypeCheckers.js`.
|
|
10030
|
+
var ReactPropTypes = {
|
|
10031
|
+
array: shim,
|
|
10032
|
+
bool: shim,
|
|
10033
|
+
func: shim,
|
|
10034
|
+
number: shim,
|
|
10035
|
+
object: shim,
|
|
10036
|
+
string: shim,
|
|
10037
|
+
symbol: shim,
|
|
8379
10038
|
|
|
8380
|
-
|
|
8381
|
-
|
|
8382
|
-
|
|
10039
|
+
any: shim,
|
|
10040
|
+
arrayOf: getShim,
|
|
10041
|
+
element: shim,
|
|
10042
|
+
elementType: shim,
|
|
10043
|
+
instanceOf: getShim,
|
|
10044
|
+
node: shim,
|
|
10045
|
+
objectOf: getShim,
|
|
10046
|
+
oneOf: getShim,
|
|
10047
|
+
oneOfType: getShim,
|
|
10048
|
+
shape: getShim,
|
|
10049
|
+
exact: getShim,
|
|
8383
10050
|
|
|
8384
|
-
|
|
10051
|
+
checkPropTypes: emptyFunctionWithReset,
|
|
10052
|
+
resetWarningCache: emptyFunction
|
|
10053
|
+
};
|
|
8385
10054
|
|
|
8386
|
-
|
|
10055
|
+
ReactPropTypes.PropTypes = ReactPropTypes;
|
|
8387
10056
|
|
|
8388
|
-
|
|
8389
|
-
|
|
8390
|
-
return (jsxRuntime.jsxs("div", __assign({ className: "p-p mr8 mb8 d-flex " + styles$8['chip'] }, { children: [value.leftIcon && (jsxRuntime.jsx("img", { className: "mr8 " + styles$8['chip-image'], src: value.leftIcon, alt: value.value }, void 0)),
|
|
8391
|
-
jsxRuntime.jsx("div", __assign({ className: "mr8" }, { children: value.value }), void 0),
|
|
8392
|
-
jsxRuntime.jsxs("div", __assign({ className: "c-pointer " + styles$8['chip-button-container'], onClick: function () { return onRemove(value); } }, { children: [jsxRuntime.jsx("img", { className: styles$8['chip-remove-button-highlighted'], src: removeButtonHighlightedIcon, alt: "removal x button highlighted" }, void 0),
|
|
8393
|
-
jsxRuntime.jsx("img", { className: styles$8['chip-remove-button'], src: removeButtonIcon, alt: "removal x button" }, void 0)] }), void 0)] }), void 0));
|
|
8394
|
-
});
|
|
10057
|
+
return ReactPropTypes;
|
|
10058
|
+
};
|
|
8395
10059
|
|
|
8396
|
-
|
|
10060
|
+
/**
|
|
10061
|
+
* Copyright (c) 2013-present, Facebook, Inc.
|
|
10062
|
+
*
|
|
10063
|
+
* This source code is licensed under the MIT license found in the
|
|
10064
|
+
* LICENSE file in the root directory of this source tree.
|
|
10065
|
+
*/
|
|
10066
|
+
|
|
10067
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
10068
|
+
var ReactIs = reactIs.exports;
|
|
10069
|
+
|
|
10070
|
+
// By explicitly using `prop-types` you are opting into new development behavior.
|
|
10071
|
+
// http://fb.me/prop-types-in-prod
|
|
10072
|
+
var throwOnDirectAccess = true;
|
|
10073
|
+
propTypes.exports = factoryWithTypeCheckers(ReactIs.isElement, throwOnDirectAccess);
|
|
10074
|
+
} else {
|
|
10075
|
+
// By explicitly using `prop-types` you are opting into new production behavior.
|
|
10076
|
+
// http://fb.me/prop-types-in-prod
|
|
10077
|
+
propTypes.exports = factoryWithThrowingShims();
|
|
10078
|
+
}
|
|
8397
10079
|
|
|
8398
10080
|
function shallowEqualArrays(arrA, arrB) {
|
|
8399
10081
|
if (arrA === arrB) {
|
|
@@ -10550,7 +12232,7 @@ var index = (function (_a) {
|
|
|
10550
12232
|
var _b = require$$0.useState([]), suggestions = _b[0], setSuggestions = _b[1];
|
|
10551
12233
|
var _c = require$$0.useState(''), currentOption = _c[0], setCurrentOption = _c[1];
|
|
10552
12234
|
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [selectedValues && selectedValues.length > 0 && (jsxRuntime.jsx("div", __assign({ className: "mb8 " + styles$6['chip-container'] + " " + chipsListClassName }, { children: selectedValues.map(function (value, index) { return (jsxRuntime.jsx(Chip, { value: value, onRemove: function (value) {
|
|
10553
|
-
var newValues = __spreadArray([], selectedValues).filter(function (selectedValue) { return selectedValue.value !== value.value; });
|
|
12235
|
+
var newValues = __spreadArray$1([], selectedValues).filter(function (selectedValue) { return selectedValue.value !== value.value; });
|
|
10554
12236
|
setValues(newValues);
|
|
10555
12237
|
} }, value.value + "-" + index)); }) }), void 0)),
|
|
10556
12238
|
jsxRuntime.jsx(AutoSuggestInput, { className: multiSelectClassName, placeholder: placeholder, onChange: setCurrentOption, handleSuggestionSelected: function (value) {
|
|
@@ -12168,8 +13850,8 @@ var ComparisonTable = function (props) {
|
|
|
12168
13850
|
});
|
|
12169
13851
|
}
|
|
12170
13852
|
};
|
|
12171
|
-
var toggleMoreRows = function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
12172
|
-
return __generator(this, function (_a) {
|
|
13853
|
+
var toggleMoreRows = function () { return __awaiter$1(void 0, void 0, void 0, function () {
|
|
13854
|
+
return __generator$1(this, function (_a) {
|
|
12173
13855
|
if (showMore && headerContainer && contentWrapper) {
|
|
12174
13856
|
window.scroll(0, window.scrollY +
|
|
12175
13857
|
(contentWrapper.getBoundingClientRect().y -
|