seeder-st2110-components 1.7.0 → 1.7.2

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.esm.js CHANGED
@@ -1301,34 +1301,39 @@ const PtpModal = _ref => {
1301
1301
  formProps = {}
1302
1302
  } = _ref;
1303
1303
  const [ptpStatus, setPtpStatus] = useState(null);
1304
+ const [loading, setLoading] = useState(false);
1304
1305
  const [form] = Form.useForm();
1305
1306
  const {
1306
1307
  message
1307
1308
  } = App.useApp();
1308
1309
  useEffect(() => {
1309
1310
  if (open) {
1311
+ setLoading(true);
1310
1312
  getPtpInfo().then(data => {
1311
1313
  if (data !== null && data !== void 0 && data[0]) {
1312
1314
  setPtpStatus(data[0]);
1315
+ // 数据加载后设置表单值
1313
1316
  form.setFieldsValue(data[0]);
1314
1317
  }
1318
+ }).catch(err => {
1319
+ console.error("Failed to fetch ptp", err);
1320
+ }).finally(() => {
1321
+ setLoading(false);
1315
1322
  });
1323
+ } else {
1324
+ // 关闭时重置表单
1325
+ form.resetFields();
1326
+ setPtpStatus(null);
1316
1327
  }
1317
1328
  }, [open, form, getPtpInfo]);
1318
1329
  const ptpStatusArray = useMemo(() => {
1319
1330
  if (!ptpStatus) return [];
1320
1331
  return convertPtpStatusToArray(ptpStatus, fieldConfigs, fieldOrder);
1321
- }, [ptpStatus]);
1322
- const handleValueChange = changedValues => {
1323
- if ('t1_domain_number' in changedValues) {
1324
- setPtpStatus(prev => _objectSpread2(_objectSpread2({}, prev), {}, {
1325
- t1_domain_number: changedValues.t1_domain_number
1326
- }));
1327
- }
1328
- };
1332
+ }, [ptpStatus, fieldConfigs, fieldOrder]);
1329
1333
  const handleSubmit = async () => {
1334
+ const values = await form.getFieldsValue();
1335
+ setLoading(true);
1330
1336
  try {
1331
- const values = await form.validateFields();
1332
1337
  const response = await updatePtpInfo(values);
1333
1338
  if (response) {
1334
1339
  message.success('Success');
@@ -1338,6 +1343,8 @@ const PtpModal = _ref => {
1338
1343
  }
1339
1344
  } catch (error) {
1340
1345
  console.error('Update failed:', error);
1346
+ } finally {
1347
+ setLoading(false);
1341
1348
  }
1342
1349
  };
1343
1350
  const renderFormItem = item => {
@@ -1393,7 +1400,8 @@ const PtpModal = _ref => {
1393
1400
  okText: "Apply",
1394
1401
  cancelText: "Close",
1395
1402
  onCancel: onClose,
1396
- onOk: handleSubmit
1403
+ onOk: handleSubmit,
1404
+ confirmLoading: loading
1397
1405
  }, modalProps);
1398
1406
 
1399
1407
  // 合并默认表单属性和传入的属性
@@ -1406,8 +1414,7 @@ const PtpModal = _ref => {
1406
1414
  wrapperCol: {
1407
1415
  span: 16
1408
1416
  },
1409
- autoComplete: "off",
1410
- onValuesChange: handleValueChange
1417
+ autoComplete: "off"
1411
1418
  }, formProps);
1412
1419
  return /*#__PURE__*/jsx(StyledModal$1, _objectSpread2(_objectSpread2({}, mergedModalProps), {}, {
1413
1420
  children: /*#__PURE__*/jsx(Form, _objectSpread2(_objectSpread2({}, mergedFormProps), {}, {
@@ -1575,7 +1582,9 @@ const RightDetailForm = /*#__PURE__*/memo(_ref3 => {
1575
1582
  editButton: "Edit",
1576
1583
  cancelButton: "Cancel"
1577
1584
  },
1578
- presetChanged // 作用:在切换选中预设时强制触发 Checkbox 的重新初始化
1585
+ presetChanged,
1586
+ // 作用:在切换选中预设时强制触发 Checkbox 的重新初始化
1587
+ enableEdit = true
1579
1588
  } = _ref3;
1580
1589
  const [initialSelected, setInitialSelected] = useState([]);
1581
1590
  const [isEditMode, setIsEditMode] = useState(false); // 是否进入编辑模式
@@ -1758,12 +1767,12 @@ const RightDetailForm = /*#__PURE__*/memo(_ref3 => {
1758
1767
  }, hasCategoryList && {
1759
1768
  disabled: !currentSelected.length
1760
1769
  }), {}, {
1761
- editButtonEle: /*#__PURE__*/jsx(Button, {
1770
+ editButtonEle: enableEdit ? /*#__PURE__*/jsx(Button, {
1762
1771
  type: "default",
1763
1772
  className: "btn-gray",
1764
1773
  onClick: handleEditClick,
1765
1774
  children: texts.editButton
1766
- }),
1775
+ }) : null,
1767
1776
  children: texts.loadButton
1768
1777
  })) : /*#__PURE__*/jsx(SubmitButton, {
1769
1778
  action: onSave,
@@ -1787,6 +1796,7 @@ const Preset = _ref => {
1787
1796
  // 加载成功后的回调
1788
1797
  onLoadError,
1789
1798
  // 加载失败后的回调
1799
+
1790
1800
  // 字段配置
1791
1801
  fields = {
1792
1802
  name: {
@@ -1812,7 +1822,9 @@ const Preset = _ref => {
1812
1822
  // 样式定制
1813
1823
  width = 1000,
1814
1824
  height = 680,
1815
- className = ""
1825
+ className = "",
1826
+ // 功能配置
1827
+ enableEdit = true
1816
1828
  } = _ref;
1817
1829
  const {
1818
1830
  message: AntdMessage,
@@ -2122,7 +2134,8 @@ const Preset = _ref => {
2122
2134
  editButton: texts.editButton,
2123
2135
  cancelButton: texts.cancelButton
2124
2136
  },
2125
- presetChanged: presetChanged
2137
+ presetChanged: presetChanged,
2138
+ enableEdit: enableEdit
2126
2139
  }) : /*#__PURE__*/jsx(Flex, {
2127
2140
  vertical: true,
2128
2141
  justify: "center",
@@ -2183,15 +2196,15 @@ UpgradeManager.defaultProps = {
2183
2196
  };
2184
2197
  var UpgradeManager$1 = UpgradeManager;
2185
2198
 
2186
- function getDefaultExportFromCjs (x) {
2199
+ function getDefaultExportFromCjs$2 (x) {
2187
2200
  return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
2188
2201
  }
2189
2202
 
2190
- var propTypes = {exports: {}};
2203
+ var propTypes$2 = {exports: {}};
2191
2204
 
2192
- var reactIs = {exports: {}};
2205
+ var reactIs$2 = {exports: {}};
2193
2206
 
2194
- var reactIs_production_min = {};
2207
+ var reactIs_production_min$2 = {};
2195
2208
 
2196
2209
  /** @license React v16.13.1
2197
2210
  * react-is.production.min.js
@@ -2202,21 +2215,21 @@ var reactIs_production_min = {};
2202
2215
  * LICENSE file in the root directory of this source tree.
2203
2216
  */
2204
2217
 
2205
- var hasRequiredReactIs_production_min;
2218
+ var hasRequiredReactIs_production_min$2;
2206
2219
 
2207
- function requireReactIs_production_min () {
2208
- if (hasRequiredReactIs_production_min) return reactIs_production_min;
2209
- hasRequiredReactIs_production_min = 1;
2220
+ function requireReactIs_production_min$2 () {
2221
+ if (hasRequiredReactIs_production_min$2) return reactIs_production_min$2;
2222
+ hasRequiredReactIs_production_min$2 = 1;
2210
2223
  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?
2211
2224
  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;
2212
- 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;
2213
- 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};
2214
- 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};
2215
- 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;
2216
- return reactIs_production_min;
2225
+ 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$2.AsyncMode=l;reactIs_production_min$2.ConcurrentMode=m;reactIs_production_min$2.ContextConsumer=k;reactIs_production_min$2.ContextProvider=h;reactIs_production_min$2.Element=c;reactIs_production_min$2.ForwardRef=n;reactIs_production_min$2.Fragment=e;reactIs_production_min$2.Lazy=t;reactIs_production_min$2.Memo=r;reactIs_production_min$2.Portal=d;
2226
+ reactIs_production_min$2.Profiler=g;reactIs_production_min$2.StrictMode=f;reactIs_production_min$2.Suspense=p;reactIs_production_min$2.isAsyncMode=function(a){return A(a)||z(a)===l};reactIs_production_min$2.isConcurrentMode=A;reactIs_production_min$2.isContextConsumer=function(a){return z(a)===k};reactIs_production_min$2.isContextProvider=function(a){return z(a)===h};reactIs_production_min$2.isElement=function(a){return "object"===typeof a&&null!==a&&a.$$typeof===c};reactIs_production_min$2.isForwardRef=function(a){return z(a)===n};reactIs_production_min$2.isFragment=function(a){return z(a)===e};reactIs_production_min$2.isLazy=function(a){return z(a)===t};
2227
+ reactIs_production_min$2.isMemo=function(a){return z(a)===r};reactIs_production_min$2.isPortal=function(a){return z(a)===d};reactIs_production_min$2.isProfiler=function(a){return z(a)===g};reactIs_production_min$2.isStrictMode=function(a){return z(a)===f};reactIs_production_min$2.isSuspense=function(a){return z(a)===p};
2228
+ reactIs_production_min$2.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$2.typeOf=z;
2229
+ return reactIs_production_min$2;
2217
2230
  }
2218
2231
 
2219
- var reactIs_development = {};
2232
+ var reactIs_development$2 = {};
2220
2233
 
2221
2234
  /** @license React v16.13.1
2222
2235
  * react-is.development.js
@@ -2227,11 +2240,11 @@ var reactIs_development = {};
2227
2240
  * LICENSE file in the root directory of this source tree.
2228
2241
  */
2229
2242
 
2230
- var hasRequiredReactIs_development;
2243
+ var hasRequiredReactIs_development$2;
2231
2244
 
2232
- function requireReactIs_development () {
2233
- if (hasRequiredReactIs_development) return reactIs_development;
2234
- hasRequiredReactIs_development = 1;
2245
+ function requireReactIs_development$2 () {
2246
+ if (hasRequiredReactIs_development$2) return reactIs_development$2;
2247
+ hasRequiredReactIs_development$2 = 1;
2235
2248
 
2236
2249
 
2237
2250
 
@@ -2372,51 +2385,51 @@ function requireReactIs_development () {
2372
2385
  return typeOf(object) === REACT_SUSPENSE_TYPE;
2373
2386
  }
2374
2387
 
2375
- reactIs_development.AsyncMode = AsyncMode;
2376
- reactIs_development.ConcurrentMode = ConcurrentMode;
2377
- reactIs_development.ContextConsumer = ContextConsumer;
2378
- reactIs_development.ContextProvider = ContextProvider;
2379
- reactIs_development.Element = Element;
2380
- reactIs_development.ForwardRef = ForwardRef;
2381
- reactIs_development.Fragment = Fragment;
2382
- reactIs_development.Lazy = Lazy;
2383
- reactIs_development.Memo = Memo;
2384
- reactIs_development.Portal = Portal;
2385
- reactIs_development.Profiler = Profiler;
2386
- reactIs_development.StrictMode = StrictMode;
2387
- reactIs_development.Suspense = Suspense;
2388
- reactIs_development.isAsyncMode = isAsyncMode;
2389
- reactIs_development.isConcurrentMode = isConcurrentMode;
2390
- reactIs_development.isContextConsumer = isContextConsumer;
2391
- reactIs_development.isContextProvider = isContextProvider;
2392
- reactIs_development.isElement = isElement;
2393
- reactIs_development.isForwardRef = isForwardRef;
2394
- reactIs_development.isFragment = isFragment;
2395
- reactIs_development.isLazy = isLazy;
2396
- reactIs_development.isMemo = isMemo;
2397
- reactIs_development.isPortal = isPortal;
2398
- reactIs_development.isProfiler = isProfiler;
2399
- reactIs_development.isStrictMode = isStrictMode;
2400
- reactIs_development.isSuspense = isSuspense;
2401
- reactIs_development.isValidElementType = isValidElementType;
2402
- reactIs_development.typeOf = typeOf;
2388
+ reactIs_development$2.AsyncMode = AsyncMode;
2389
+ reactIs_development$2.ConcurrentMode = ConcurrentMode;
2390
+ reactIs_development$2.ContextConsumer = ContextConsumer;
2391
+ reactIs_development$2.ContextProvider = ContextProvider;
2392
+ reactIs_development$2.Element = Element;
2393
+ reactIs_development$2.ForwardRef = ForwardRef;
2394
+ reactIs_development$2.Fragment = Fragment;
2395
+ reactIs_development$2.Lazy = Lazy;
2396
+ reactIs_development$2.Memo = Memo;
2397
+ reactIs_development$2.Portal = Portal;
2398
+ reactIs_development$2.Profiler = Profiler;
2399
+ reactIs_development$2.StrictMode = StrictMode;
2400
+ reactIs_development$2.Suspense = Suspense;
2401
+ reactIs_development$2.isAsyncMode = isAsyncMode;
2402
+ reactIs_development$2.isConcurrentMode = isConcurrentMode;
2403
+ reactIs_development$2.isContextConsumer = isContextConsumer;
2404
+ reactIs_development$2.isContextProvider = isContextProvider;
2405
+ reactIs_development$2.isElement = isElement;
2406
+ reactIs_development$2.isForwardRef = isForwardRef;
2407
+ reactIs_development$2.isFragment = isFragment;
2408
+ reactIs_development$2.isLazy = isLazy;
2409
+ reactIs_development$2.isMemo = isMemo;
2410
+ reactIs_development$2.isPortal = isPortal;
2411
+ reactIs_development$2.isProfiler = isProfiler;
2412
+ reactIs_development$2.isStrictMode = isStrictMode;
2413
+ reactIs_development$2.isSuspense = isSuspense;
2414
+ reactIs_development$2.isValidElementType = isValidElementType;
2415
+ reactIs_development$2.typeOf = typeOf;
2403
2416
  })();
2404
2417
  }
2405
- return reactIs_development;
2418
+ return reactIs_development$2;
2406
2419
  }
2407
2420
 
2408
- var hasRequiredReactIs;
2421
+ var hasRequiredReactIs$2;
2409
2422
 
2410
- function requireReactIs () {
2411
- if (hasRequiredReactIs) return reactIs.exports;
2412
- hasRequiredReactIs = 1;
2423
+ function requireReactIs$2 () {
2424
+ if (hasRequiredReactIs$2) return reactIs$2.exports;
2425
+ hasRequiredReactIs$2 = 1;
2413
2426
 
2414
2427
  if (process.env.NODE_ENV === 'production') {
2415
- reactIs.exports = requireReactIs_production_min();
2428
+ reactIs$2.exports = requireReactIs_production_min$2();
2416
2429
  } else {
2417
- reactIs.exports = requireReactIs_development();
2430
+ reactIs$2.exports = requireReactIs_development$2();
2418
2431
  }
2419
- return reactIs.exports;
2432
+ return reactIs$2.exports;
2420
2433
  }
2421
2434
 
2422
2435
  /*
@@ -2425,12 +2438,12 @@ object-assign
2425
2438
  @license MIT
2426
2439
  */
2427
2440
 
2428
- var objectAssign;
2429
- var hasRequiredObjectAssign;
2441
+ var objectAssign$2;
2442
+ var hasRequiredObjectAssign$2;
2430
2443
 
2431
- function requireObjectAssign () {
2432
- if (hasRequiredObjectAssign) return objectAssign;
2433
- hasRequiredObjectAssign = 1;
2444
+ function requireObjectAssign$2 () {
2445
+ if (hasRequiredObjectAssign$2) return objectAssign$2;
2446
+ hasRequiredObjectAssign$2 = 1;
2434
2447
  /* eslint-disable no-unused-vars */
2435
2448
  var getOwnPropertySymbols = Object.getOwnPropertySymbols;
2436
2449
  var hasOwnProperty = Object.prototype.hasOwnProperty;
@@ -2488,7 +2501,7 @@ function requireObjectAssign () {
2488
2501
  }
2489
2502
  }
2490
2503
 
2491
- objectAssign = shouldUseNative() ? Object.assign : function (target, source) {
2504
+ objectAssign$2 = shouldUseNative() ? Object.assign : function (target, source) {
2492
2505
  var from;
2493
2506
  var to = toObject(target);
2494
2507
  var symbols;
@@ -2514,7 +2527,7 @@ function requireObjectAssign () {
2514
2527
 
2515
2528
  return to;
2516
2529
  };
2517
- return objectAssign;
2530
+ return objectAssign$2;
2518
2531
  }
2519
2532
 
2520
2533
  /**
@@ -2524,27 +2537,27 @@ function requireObjectAssign () {
2524
2537
  * LICENSE file in the root directory of this source tree.
2525
2538
  */
2526
2539
 
2527
- var ReactPropTypesSecret_1;
2528
- var hasRequiredReactPropTypesSecret;
2540
+ var ReactPropTypesSecret_1$2;
2541
+ var hasRequiredReactPropTypesSecret$2;
2529
2542
 
2530
- function requireReactPropTypesSecret () {
2531
- if (hasRequiredReactPropTypesSecret) return ReactPropTypesSecret_1;
2532
- hasRequiredReactPropTypesSecret = 1;
2543
+ function requireReactPropTypesSecret$2 () {
2544
+ if (hasRequiredReactPropTypesSecret$2) return ReactPropTypesSecret_1$2;
2545
+ hasRequiredReactPropTypesSecret$2 = 1;
2533
2546
 
2534
2547
  var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
2535
2548
 
2536
- ReactPropTypesSecret_1 = ReactPropTypesSecret;
2537
- return ReactPropTypesSecret_1;
2549
+ ReactPropTypesSecret_1$2 = ReactPropTypesSecret;
2550
+ return ReactPropTypesSecret_1$2;
2538
2551
  }
2539
2552
 
2540
- var has;
2541
- var hasRequiredHas;
2553
+ var has$2;
2554
+ var hasRequiredHas$2;
2542
2555
 
2543
- function requireHas () {
2544
- if (hasRequiredHas) return has;
2545
- hasRequiredHas = 1;
2546
- has = Function.call.bind(Object.prototype.hasOwnProperty);
2547
- return has;
2556
+ function requireHas$2 () {
2557
+ if (hasRequiredHas$2) return has$2;
2558
+ hasRequiredHas$2 = 1;
2559
+ has$2 = Function.call.bind(Object.prototype.hasOwnProperty);
2560
+ return has$2;
2548
2561
  }
2549
2562
 
2550
2563
  /**
@@ -2554,19 +2567,19 @@ function requireHas () {
2554
2567
  * LICENSE file in the root directory of this source tree.
2555
2568
  */
2556
2569
 
2557
- var checkPropTypes_1;
2558
- var hasRequiredCheckPropTypes;
2570
+ var checkPropTypes_1$2;
2571
+ var hasRequiredCheckPropTypes$2;
2559
2572
 
2560
- function requireCheckPropTypes () {
2561
- if (hasRequiredCheckPropTypes) return checkPropTypes_1;
2562
- hasRequiredCheckPropTypes = 1;
2573
+ function requireCheckPropTypes$2 () {
2574
+ if (hasRequiredCheckPropTypes$2) return checkPropTypes_1$2;
2575
+ hasRequiredCheckPropTypes$2 = 1;
2563
2576
 
2564
2577
  var printWarning = function() {};
2565
2578
 
2566
2579
  if (process.env.NODE_ENV !== 'production') {
2567
- var ReactPropTypesSecret = /*@__PURE__*/ requireReactPropTypesSecret();
2580
+ var ReactPropTypesSecret = /*@__PURE__*/ requireReactPropTypesSecret$2();
2568
2581
  var loggedTypeFailures = {};
2569
- var has = /*@__PURE__*/ requireHas();
2582
+ var has = /*@__PURE__*/ requireHas$2();
2570
2583
 
2571
2584
  printWarning = function(text) {
2572
2585
  var message = 'Warning: ' + text;
@@ -2654,8 +2667,8 @@ function requireCheckPropTypes () {
2654
2667
  }
2655
2668
  };
2656
2669
 
2657
- checkPropTypes_1 = checkPropTypes;
2658
- return checkPropTypes_1;
2670
+ checkPropTypes_1$2 = checkPropTypes;
2671
+ return checkPropTypes_1$2;
2659
2672
  }
2660
2673
 
2661
2674
  /**
@@ -2665,19 +2678,19 @@ function requireCheckPropTypes () {
2665
2678
  * LICENSE file in the root directory of this source tree.
2666
2679
  */
2667
2680
 
2668
- var factoryWithTypeCheckers;
2669
- var hasRequiredFactoryWithTypeCheckers;
2681
+ var factoryWithTypeCheckers$2;
2682
+ var hasRequiredFactoryWithTypeCheckers$2;
2670
2683
 
2671
- function requireFactoryWithTypeCheckers () {
2672
- if (hasRequiredFactoryWithTypeCheckers) return factoryWithTypeCheckers;
2673
- hasRequiredFactoryWithTypeCheckers = 1;
2684
+ function requireFactoryWithTypeCheckers$2 () {
2685
+ if (hasRequiredFactoryWithTypeCheckers$2) return factoryWithTypeCheckers$2;
2686
+ hasRequiredFactoryWithTypeCheckers$2 = 1;
2674
2687
 
2675
- var ReactIs = requireReactIs();
2676
- var assign = requireObjectAssign();
2688
+ var ReactIs = requireReactIs$2();
2689
+ var assign = requireObjectAssign$2();
2677
2690
 
2678
- var ReactPropTypesSecret = /*@__PURE__*/ requireReactPropTypesSecret();
2679
- var has = /*@__PURE__*/ requireHas();
2680
- var checkPropTypes = /*@__PURE__*/ requireCheckPropTypes();
2691
+ var ReactPropTypesSecret = /*@__PURE__*/ requireReactPropTypesSecret$2();
2692
+ var has = /*@__PURE__*/ requireHas$2();
2693
+ var checkPropTypes = /*@__PURE__*/ requireCheckPropTypes$2();
2681
2694
 
2682
2695
  var printWarning = function() {};
2683
2696
 
@@ -2700,7 +2713,7 @@ function requireFactoryWithTypeCheckers () {
2700
2713
  return null;
2701
2714
  }
2702
2715
 
2703
- factoryWithTypeCheckers = function(isValidElement, throwOnDirectAccess) {
2716
+ factoryWithTypeCheckers$2 = function(isValidElement, throwOnDirectAccess) {
2704
2717
  /* global Symbol */
2705
2718
  var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
2706
2719
  var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec.
@@ -3273,7 +3286,7 @@ function requireFactoryWithTypeCheckers () {
3273
3286
 
3274
3287
  return ReactPropTypes;
3275
3288
  };
3276
- return factoryWithTypeCheckers;
3289
+ return factoryWithTypeCheckers$2;
3277
3290
  }
3278
3291
 
3279
3292
  /**
@@ -3283,20 +3296,20 @@ function requireFactoryWithTypeCheckers () {
3283
3296
  * LICENSE file in the root directory of this source tree.
3284
3297
  */
3285
3298
 
3286
- var factoryWithThrowingShims;
3287
- var hasRequiredFactoryWithThrowingShims;
3299
+ var factoryWithThrowingShims$2;
3300
+ var hasRequiredFactoryWithThrowingShims$2;
3288
3301
 
3289
- function requireFactoryWithThrowingShims () {
3290
- if (hasRequiredFactoryWithThrowingShims) return factoryWithThrowingShims;
3291
- hasRequiredFactoryWithThrowingShims = 1;
3302
+ function requireFactoryWithThrowingShims$2 () {
3303
+ if (hasRequiredFactoryWithThrowingShims$2) return factoryWithThrowingShims$2;
3304
+ hasRequiredFactoryWithThrowingShims$2 = 1;
3292
3305
 
3293
- var ReactPropTypesSecret = /*@__PURE__*/ requireReactPropTypesSecret();
3306
+ var ReactPropTypesSecret = /*@__PURE__*/ requireReactPropTypesSecret$2();
3294
3307
 
3295
3308
  function emptyFunction() {}
3296
3309
  function emptyFunctionWithReset() {}
3297
3310
  emptyFunctionWithReset.resetWarningCache = emptyFunction;
3298
3311
 
3299
- factoryWithThrowingShims = function() {
3312
+ factoryWithThrowingShims$2 = function() {
3300
3313
  function shim(props, propName, componentName, location, propFullName, secret) {
3301
3314
  if (secret === ReactPropTypesSecret) {
3302
3315
  // It is still safe when called from React.
@@ -3344,7 +3357,7 @@ function requireFactoryWithThrowingShims () {
3344
3357
 
3345
3358
  return ReactPropTypes;
3346
3359
  };
3347
- return factoryWithThrowingShims;
3360
+ return factoryWithThrowingShims$2;
3348
3361
  }
3349
3362
 
3350
3363
  /**
@@ -3354,28 +3367,28 @@ function requireFactoryWithThrowingShims () {
3354
3367
  * LICENSE file in the root directory of this source tree.
3355
3368
  */
3356
3369
 
3357
- var hasRequiredPropTypes;
3370
+ var hasRequiredPropTypes$2;
3358
3371
 
3359
- function requirePropTypes () {
3360
- if (hasRequiredPropTypes) return propTypes.exports;
3361
- hasRequiredPropTypes = 1;
3372
+ function requirePropTypes$2 () {
3373
+ if (hasRequiredPropTypes$2) return propTypes$2.exports;
3374
+ hasRequiredPropTypes$2 = 1;
3362
3375
  if (process.env.NODE_ENV !== 'production') {
3363
- var ReactIs = requireReactIs();
3376
+ var ReactIs = requireReactIs$2();
3364
3377
 
3365
3378
  // By explicitly using `prop-types` you are opting into new development behavior.
3366
3379
  // http://fb.me/prop-types-in-prod
3367
3380
  var throwOnDirectAccess = true;
3368
- propTypes.exports = /*@__PURE__*/ requireFactoryWithTypeCheckers()(ReactIs.isElement, throwOnDirectAccess);
3381
+ propTypes$2.exports = /*@__PURE__*/ requireFactoryWithTypeCheckers$2()(ReactIs.isElement, throwOnDirectAccess);
3369
3382
  } else {
3370
3383
  // By explicitly using `prop-types` you are opting into new production behavior.
3371
3384
  // http://fb.me/prop-types-in-prod
3372
- propTypes.exports = /*@__PURE__*/ requireFactoryWithThrowingShims()();
3385
+ propTypes$2.exports = /*@__PURE__*/ requireFactoryWithThrowingShims$2()();
3373
3386
  }
3374
- return propTypes.exports;
3387
+ return propTypes$2.exports;
3375
3388
  }
3376
3389
 
3377
- var propTypesExports = /*@__PURE__*/ requirePropTypes();
3378
- var PropTypes = /*@__PURE__*/getDefaultExportFromCjs(propTypesExports);
3390
+ var propTypesExports$2 = /*@__PURE__*/ requirePropTypes$2();
3391
+ var PropTypes$2 = /*@__PURE__*/getDefaultExportFromCjs$2(propTypesExports$2);
3379
3392
 
3380
3393
  const SystemOperations = _ref => {
3381
3394
  let {
@@ -3457,15 +3470,15 @@ const SystemOperations = _ref => {
3457
3470
  });
3458
3471
  };
3459
3472
  SystemOperations.propTypes = {
3460
- onPowerOff: PropTypes.func,
3461
- onRestart: PropTypes.func,
3462
- powerOffLabel: PropTypes.string,
3463
- restartLabel: PropTypes.string,
3464
- iconClassName: PropTypes.string,
3465
- confirmTitle: PropTypes.string,
3466
- cancelText: PropTypes.string,
3467
- okText: PropTypes.string,
3468
- run: PropTypes.func
3473
+ onPowerOff: PropTypes$2.func,
3474
+ onRestart: PropTypes$2.func,
3475
+ powerOffLabel: PropTypes$2.string,
3476
+ restartLabel: PropTypes$2.string,
3477
+ iconClassName: PropTypes$2.string,
3478
+ confirmTitle: PropTypes$2.string,
3479
+ cancelText: PropTypes$2.string,
3480
+ okText: PropTypes$2.string,
3481
+ run: PropTypes$2.func
3469
3482
  };
3470
3483
  var SystemOperations$1 = SystemOperations;
3471
3484
 
@@ -3508,10 +3521,10 @@ const useSpaLogo = function () {
3508
3521
  }, "logo")];
3509
3522
  };
3510
3523
  useSpaLogo.propTypes = {
3511
- logoUrl: PropTypes.string,
3512
- logoWidth: PropTypes.number,
3513
- logoAlt: PropTypes.string,
3514
- onClick: PropTypes.func
3524
+ logoUrl: PropTypes$2.string,
3525
+ logoWidth: PropTypes$2.number,
3526
+ logoAlt: PropTypes$2.string,
3527
+ onClick: PropTypes$2.func
3515
3528
  };
3516
3529
  var useSpaLogo$1 = useSpaLogo;
3517
3530
 
@@ -3557,7 +3570,9 @@ const CommonHeader = _ref => {
3557
3570
  className = '',
3558
3571
  style = {},
3559
3572
  // 新增插槽
3560
- leftContent // 左侧额外内容
3573
+ leftContent = null,
3574
+ // 左侧额外内容
3575
+ rightContent = null // 右侧额外内容
3561
3576
  } = _ref;
3562
3577
  const [logo] = useSpaLogo$1(logoProps);
3563
3578
 
@@ -3591,7 +3606,7 @@ const CommonHeader = _ref => {
3591
3606
  }), /*#__PURE__*/jsxs(Flex, {
3592
3607
  align: "center",
3593
3608
  gap: 10,
3594
- children: [showHardwareUsage && usageElement, /*#__PURE__*/jsxs("div", {
3609
+ children: [rightContent, showHardwareUsage && usageElement, /*#__PURE__*/jsxs("div", {
3595
3610
  className: "header-controls",
3596
3611
  children: [menuElement && /*#__PURE__*/jsx("div", {
3597
3612
  className: "control-icon",
@@ -3611,23 +3626,23 @@ const CommonHeader = _ref => {
3611
3626
 
3612
3627
  // PropTypes 类型检查
3613
3628
  CommonHeader.propTypes = {
3614
- menuElement: PropTypes.node,
3615
- productInfo: PropTypes.shape({
3616
- productName: PropTypes.string,
3617
- version: PropTypes.string
3629
+ menuElement: PropTypes$2.node,
3630
+ productInfo: PropTypes$2.shape({
3631
+ productName: PropTypes$2.string,
3632
+ version: PropTypes$2.string
3618
3633
  }),
3619
- showLogo: PropTypes.bool,
3620
- showProductInfo: PropTypes.bool,
3621
- showHardwareUsage: PropTypes.bool,
3622
- showSystemOperations: PropTypes.bool,
3623
- onPowerOff: PropTypes.func,
3624
- onRestart: PropTypes.func,
3625
- onRun: PropTypes.func,
3626
- hardwareMonitorUrl: PropTypes.string,
3627
- getSocketUrl: PropTypes.func,
3628
- logoProps: PropTypes.object,
3629
- className: PropTypes.string,
3630
- style: PropTypes.object
3634
+ showLogo: PropTypes$2.bool,
3635
+ showProductInfo: PropTypes$2.bool,
3636
+ showHardwareUsage: PropTypes$2.bool,
3637
+ showSystemOperations: PropTypes$2.bool,
3638
+ onPowerOff: PropTypes$2.func,
3639
+ onRestart: PropTypes$2.func,
3640
+ onRun: PropTypes$2.func,
3641
+ hardwareMonitorUrl: PropTypes$2.string,
3642
+ getSocketUrl: PropTypes$2.func,
3643
+ logoProps: PropTypes$2.object,
3644
+ className: PropTypes$2.string,
3645
+ style: PropTypes$2.object
3631
3646
  };
3632
3647
  var CommonHeader$1 = CommonHeader;
3633
3648
 
@@ -3676,6 +3691,2665 @@ const LSMLabelField = props => {
3676
3691
  };
3677
3692
  var LSMLabelField$1 = /*#__PURE__*/memo(LSMLabelField);
3678
3693
 
3694
+ function _defineProperty$1(e, r, t) {
3695
+ return (r = _toPropertyKey$1(r)) in e ? Object.defineProperty(e, r, {
3696
+ value: t,
3697
+ enumerable: !0,
3698
+ configurable: !0,
3699
+ writable: !0
3700
+ }) : e[r] = t, e;
3701
+ }
3702
+ function ownKeys$1(e, r) {
3703
+ var t = Object.keys(e);
3704
+ if (Object.getOwnPropertySymbols) {
3705
+ var o = Object.getOwnPropertySymbols(e);
3706
+ r && (o = o.filter(function (r) {
3707
+ return Object.getOwnPropertyDescriptor(e, r).enumerable;
3708
+ })), t.push.apply(t, o);
3709
+ }
3710
+ return t;
3711
+ }
3712
+ function _objectSpread2$1(e) {
3713
+ for (var r = 1; r < arguments.length; r++) {
3714
+ var t = null != arguments[r] ? arguments[r] : {};
3715
+ r % 2 ? ownKeys$1(Object(t), !0).forEach(function (r) {
3716
+ _defineProperty$1(e, r, t[r]);
3717
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$1(Object(t)).forEach(function (r) {
3718
+ Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
3719
+ });
3720
+ }
3721
+ return e;
3722
+ }
3723
+ function _objectWithoutProperties$1(e, t) {
3724
+ if (null == e) return {};
3725
+ var o,
3726
+ r,
3727
+ i = _objectWithoutPropertiesLoose$1(e, t);
3728
+ if (Object.getOwnPropertySymbols) {
3729
+ var n = Object.getOwnPropertySymbols(e);
3730
+ for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]);
3731
+ }
3732
+ return i;
3733
+ }
3734
+ function _objectWithoutPropertiesLoose$1(r, e) {
3735
+ if (null == r) return {};
3736
+ var t = {};
3737
+ for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
3738
+ if (-1 !== e.indexOf(n)) continue;
3739
+ t[n] = r[n];
3740
+ }
3741
+ return t;
3742
+ }
3743
+ function _toPrimitive$1(t, r) {
3744
+ if ("object" != typeof t || !t) return t;
3745
+ var e = t[Symbol.toPrimitive];
3746
+ if (void 0 !== e) {
3747
+ var i = e.call(t, r || "default");
3748
+ if ("object" != typeof i) return i;
3749
+ throw new TypeError("@@toPrimitive must return a primitive value.");
3750
+ }
3751
+ return ("string" === r ? String : Number)(t);
3752
+ }
3753
+ function _toPropertyKey$1(t) {
3754
+ var i = _toPrimitive$1(t, "string");
3755
+ return "symbol" == typeof i ? i : i + "";
3756
+ }
3757
+ const _excluded$3 = ["width", "okText", "cancelText", "styles"];
3758
+ const StyledModal$2 = props => {
3759
+ const {
3760
+ width = "520px",
3761
+ okText = "Apply",
3762
+ cancelText = "Close",
3763
+ styles: propStyles = {}
3764
+ } = props,
3765
+ restProps = _objectWithoutProperties$1(props, _excluded$3);
3766
+
3767
+ // 基础样式配置
3768
+ const baseStyles = {
3769
+ content: {
3770
+ padding: 0
3771
+ // background: "#282828"
3772
+ },
3773
+ header: {
3774
+ marginBottom: 0,
3775
+ padding: 0,
3776
+ paddingBlock: 16,
3777
+ paddingInlineStart: 24,
3778
+ background: "#000000"
3779
+ },
3780
+ body: {
3781
+ paddingBlock: 20,
3782
+ paddingInline: 24
3783
+ },
3784
+ footer: {
3785
+ marginTop: 0,
3786
+ padding: 0,
3787
+ paddingBlockEnd: 20,
3788
+ paddingInline: 24
3789
+ }
3790
+ };
3791
+
3792
+ // 合并样式
3793
+ const styles = _objectSpread2$1(_objectSpread2$1({}, baseStyles), propStyles);
3794
+ return /*#__PURE__*/jsx(Modal, _objectSpread2$1({
3795
+ width: width,
3796
+ okText: okText,
3797
+ cancelText: cancelText,
3798
+ styles: styles
3799
+ }, restProps));
3800
+ };
3801
+ var StyledModal$3 = StyledModal$2;
3802
+ function getDefaultExportFromCjs$1(x) {
3803
+ return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
3804
+ }
3805
+ var propTypes$1 = {
3806
+ exports: {}
3807
+ };
3808
+ var reactIs$1 = {
3809
+ exports: {}
3810
+ };
3811
+ var reactIs_production_min$1 = {};
3812
+
3813
+ /** @license React v16.13.1
3814
+ * react-is.production.min.js
3815
+ *
3816
+ * Copyright (c) Facebook, Inc. and its affiliates.
3817
+ *
3818
+ * This source code is licensed under the MIT license found in the
3819
+ * LICENSE file in the root directory of this source tree.
3820
+ */
3821
+
3822
+ var hasRequiredReactIs_production_min$1;
3823
+ function requireReactIs_production_min$1() {
3824
+ if (hasRequiredReactIs_production_min$1) return reactIs_production_min$1;
3825
+ hasRequiredReactIs_production_min$1 = 1;
3826
+ var b = "function" === typeof Symbol && Symbol.for,
3827
+ c = b ? Symbol.for("react.element") : 60103,
3828
+ d = b ? Symbol.for("react.portal") : 60106,
3829
+ e = b ? Symbol.for("react.fragment") : 60107,
3830
+ f = b ? Symbol.for("react.strict_mode") : 60108,
3831
+ g = b ? Symbol.for("react.profiler") : 60114,
3832
+ h = b ? Symbol.for("react.provider") : 60109,
3833
+ k = b ? Symbol.for("react.context") : 60110,
3834
+ l = b ? Symbol.for("react.async_mode") : 60111,
3835
+ m = b ? Symbol.for("react.concurrent_mode") : 60111,
3836
+ n = b ? Symbol.for("react.forward_ref") : 60112,
3837
+ p = b ? Symbol.for("react.suspense") : 60113,
3838
+ q = b ? Symbol.for("react.suspense_list") : 60120,
3839
+ r = b ? Symbol.for("react.memo") : 60115,
3840
+ t = b ? Symbol.for("react.lazy") : 60116,
3841
+ v = b ? Symbol.for("react.block") : 60121,
3842
+ w = b ? Symbol.for("react.fundamental") : 60117,
3843
+ x = b ? Symbol.for("react.responder") : 60118,
3844
+ y = b ? Symbol.for("react.scope") : 60119;
3845
+ function z(a) {
3846
+ if ("object" === typeof a && null !== a) {
3847
+ var u = a.$$typeof;
3848
+ switch (u) {
3849
+ case c:
3850
+ switch (a = a.type, a) {
3851
+ case l:
3852
+ case m:
3853
+ case e:
3854
+ case g:
3855
+ case f:
3856
+ case p:
3857
+ return a;
3858
+ default:
3859
+ switch (a = a && a.$$typeof, a) {
3860
+ case k:
3861
+ case n:
3862
+ case t:
3863
+ case r:
3864
+ case h:
3865
+ return a;
3866
+ default:
3867
+ return u;
3868
+ }
3869
+ }
3870
+ case d:
3871
+ return u;
3872
+ }
3873
+ }
3874
+ }
3875
+ function A(a) {
3876
+ return z(a) === m;
3877
+ }
3878
+ reactIs_production_min$1.AsyncMode = l;
3879
+ reactIs_production_min$1.ConcurrentMode = m;
3880
+ reactIs_production_min$1.ContextConsumer = k;
3881
+ reactIs_production_min$1.ContextProvider = h;
3882
+ reactIs_production_min$1.Element = c;
3883
+ reactIs_production_min$1.ForwardRef = n;
3884
+ reactIs_production_min$1.Fragment = e;
3885
+ reactIs_production_min$1.Lazy = t;
3886
+ reactIs_production_min$1.Memo = r;
3887
+ reactIs_production_min$1.Portal = d;
3888
+ reactIs_production_min$1.Profiler = g;
3889
+ reactIs_production_min$1.StrictMode = f;
3890
+ reactIs_production_min$1.Suspense = p;
3891
+ reactIs_production_min$1.isAsyncMode = function (a) {
3892
+ return A(a) || z(a) === l;
3893
+ };
3894
+ reactIs_production_min$1.isConcurrentMode = A;
3895
+ reactIs_production_min$1.isContextConsumer = function (a) {
3896
+ return z(a) === k;
3897
+ };
3898
+ reactIs_production_min$1.isContextProvider = function (a) {
3899
+ return z(a) === h;
3900
+ };
3901
+ reactIs_production_min$1.isElement = function (a) {
3902
+ return "object" === typeof a && null !== a && a.$$typeof === c;
3903
+ };
3904
+ reactIs_production_min$1.isForwardRef = function (a) {
3905
+ return z(a) === n;
3906
+ };
3907
+ reactIs_production_min$1.isFragment = function (a) {
3908
+ return z(a) === e;
3909
+ };
3910
+ reactIs_production_min$1.isLazy = function (a) {
3911
+ return z(a) === t;
3912
+ };
3913
+ reactIs_production_min$1.isMemo = function (a) {
3914
+ return z(a) === r;
3915
+ };
3916
+ reactIs_production_min$1.isPortal = function (a) {
3917
+ return z(a) === d;
3918
+ };
3919
+ reactIs_production_min$1.isProfiler = function (a) {
3920
+ return z(a) === g;
3921
+ };
3922
+ reactIs_production_min$1.isStrictMode = function (a) {
3923
+ return z(a) === f;
3924
+ };
3925
+ reactIs_production_min$1.isSuspense = function (a) {
3926
+ return z(a) === p;
3927
+ };
3928
+ reactIs_production_min$1.isValidElementType = function (a) {
3929
+ 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);
3930
+ };
3931
+ reactIs_production_min$1.typeOf = z;
3932
+ return reactIs_production_min$1;
3933
+ }
3934
+ var reactIs_development$1 = {};
3935
+
3936
+ /** @license React v16.13.1
3937
+ * react-is.development.js
3938
+ *
3939
+ * Copyright (c) Facebook, Inc. and its affiliates.
3940
+ *
3941
+ * This source code is licensed under the MIT license found in the
3942
+ * LICENSE file in the root directory of this source tree.
3943
+ */
3944
+
3945
+ var hasRequiredReactIs_development$1;
3946
+ function requireReactIs_development$1() {
3947
+ if (hasRequiredReactIs_development$1) return reactIs_development$1;
3948
+ hasRequiredReactIs_development$1 = 1;
3949
+ if (process.env.NODE_ENV !== "production") {
3950
+ (function () {
3951
+ // The Symbol used to tag the ReactElement-like types. If there is no native Symbol
3952
+ // nor polyfill, then a plain number is used for performance.
3953
+ var hasSymbol = typeof Symbol === 'function' && Symbol.for;
3954
+ var REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for('react.element') : 0xeac7;
3955
+ var REACT_PORTAL_TYPE = hasSymbol ? Symbol.for('react.portal') : 0xeaca;
3956
+ var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for('react.fragment') : 0xeacb;
3957
+ var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for('react.strict_mode') : 0xeacc;
3958
+ var REACT_PROFILER_TYPE = hasSymbol ? Symbol.for('react.profiler') : 0xead2;
3959
+ var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for('react.provider') : 0xeacd;
3960
+ var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for('react.context') : 0xeace; // TODO: We don't use AsyncMode or ConcurrentMode anymore. They were temporary
3961
+ // (unstable) APIs that have been removed. Can we remove the symbols?
3962
+
3963
+ var REACT_ASYNC_MODE_TYPE = hasSymbol ? Symbol.for('react.async_mode') : 0xeacf;
3964
+ var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for('react.concurrent_mode') : 0xeacf;
3965
+ var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for('react.forward_ref') : 0xead0;
3966
+ var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for('react.suspense') : 0xead1;
3967
+ var REACT_SUSPENSE_LIST_TYPE = hasSymbol ? Symbol.for('react.suspense_list') : 0xead8;
3968
+ var REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3;
3969
+ var REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 0xead4;
3970
+ var REACT_BLOCK_TYPE = hasSymbol ? Symbol.for('react.block') : 0xead9;
3971
+ var REACT_FUNDAMENTAL_TYPE = hasSymbol ? Symbol.for('react.fundamental') : 0xead5;
3972
+ var REACT_RESPONDER_TYPE = hasSymbol ? Symbol.for('react.responder') : 0xead6;
3973
+ var REACT_SCOPE_TYPE = hasSymbol ? Symbol.for('react.scope') : 0xead7;
3974
+ function isValidElementType(type) {
3975
+ return typeof type === 'string' || typeof type === 'function' ||
3976
+ // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill.
3977
+ 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);
3978
+ }
3979
+ function typeOf(object) {
3980
+ if (typeof object === 'object' && object !== null) {
3981
+ var $$typeof = object.$$typeof;
3982
+ switch ($$typeof) {
3983
+ case REACT_ELEMENT_TYPE:
3984
+ var type = object.type;
3985
+ switch (type) {
3986
+ case REACT_ASYNC_MODE_TYPE:
3987
+ case REACT_CONCURRENT_MODE_TYPE:
3988
+ case REACT_FRAGMENT_TYPE:
3989
+ case REACT_PROFILER_TYPE:
3990
+ case REACT_STRICT_MODE_TYPE:
3991
+ case REACT_SUSPENSE_TYPE:
3992
+ return type;
3993
+ default:
3994
+ var $$typeofType = type && type.$$typeof;
3995
+ switch ($$typeofType) {
3996
+ case REACT_CONTEXT_TYPE:
3997
+ case REACT_FORWARD_REF_TYPE:
3998
+ case REACT_LAZY_TYPE:
3999
+ case REACT_MEMO_TYPE:
4000
+ case REACT_PROVIDER_TYPE:
4001
+ return $$typeofType;
4002
+ default:
4003
+ return $$typeof;
4004
+ }
4005
+ }
4006
+ case REACT_PORTAL_TYPE:
4007
+ return $$typeof;
4008
+ }
4009
+ }
4010
+ return undefined;
4011
+ } // AsyncMode is deprecated along with isAsyncMode
4012
+
4013
+ var AsyncMode = REACT_ASYNC_MODE_TYPE;
4014
+ var ConcurrentMode = REACT_CONCURRENT_MODE_TYPE;
4015
+ var ContextConsumer = REACT_CONTEXT_TYPE;
4016
+ var ContextProvider = REACT_PROVIDER_TYPE;
4017
+ var Element = REACT_ELEMENT_TYPE;
4018
+ var ForwardRef = REACT_FORWARD_REF_TYPE;
4019
+ var Fragment = REACT_FRAGMENT_TYPE;
4020
+ var Lazy = REACT_LAZY_TYPE;
4021
+ var Memo = REACT_MEMO_TYPE;
4022
+ var Portal = REACT_PORTAL_TYPE;
4023
+ var Profiler = REACT_PROFILER_TYPE;
4024
+ var StrictMode = REACT_STRICT_MODE_TYPE;
4025
+ var Suspense = REACT_SUSPENSE_TYPE;
4026
+ var hasWarnedAboutDeprecatedIsAsyncMode = false; // AsyncMode should be deprecated
4027
+
4028
+ function isAsyncMode(object) {
4029
+ {
4030
+ if (!hasWarnedAboutDeprecatedIsAsyncMode) {
4031
+ hasWarnedAboutDeprecatedIsAsyncMode = true; // Using console['warn'] to evade Babel and ESLint
4032
+
4033
+ 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.');
4034
+ }
4035
+ }
4036
+ return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;
4037
+ }
4038
+ function isConcurrentMode(object) {
4039
+ return typeOf(object) === REACT_CONCURRENT_MODE_TYPE;
4040
+ }
4041
+ function isContextConsumer(object) {
4042
+ return typeOf(object) === REACT_CONTEXT_TYPE;
4043
+ }
4044
+ function isContextProvider(object) {
4045
+ return typeOf(object) === REACT_PROVIDER_TYPE;
4046
+ }
4047
+ function isElement(object) {
4048
+ return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
4049
+ }
4050
+ function isForwardRef(object) {
4051
+ return typeOf(object) === REACT_FORWARD_REF_TYPE;
4052
+ }
4053
+ function isFragment(object) {
4054
+ return typeOf(object) === REACT_FRAGMENT_TYPE;
4055
+ }
4056
+ function isLazy(object) {
4057
+ return typeOf(object) === REACT_LAZY_TYPE;
4058
+ }
4059
+ function isMemo(object) {
4060
+ return typeOf(object) === REACT_MEMO_TYPE;
4061
+ }
4062
+ function isPortal(object) {
4063
+ return typeOf(object) === REACT_PORTAL_TYPE;
4064
+ }
4065
+ function isProfiler(object) {
4066
+ return typeOf(object) === REACT_PROFILER_TYPE;
4067
+ }
4068
+ function isStrictMode(object) {
4069
+ return typeOf(object) === REACT_STRICT_MODE_TYPE;
4070
+ }
4071
+ function isSuspense(object) {
4072
+ return typeOf(object) === REACT_SUSPENSE_TYPE;
4073
+ }
4074
+ reactIs_development$1.AsyncMode = AsyncMode;
4075
+ reactIs_development$1.ConcurrentMode = ConcurrentMode;
4076
+ reactIs_development$1.ContextConsumer = ContextConsumer;
4077
+ reactIs_development$1.ContextProvider = ContextProvider;
4078
+ reactIs_development$1.Element = Element;
4079
+ reactIs_development$1.ForwardRef = ForwardRef;
4080
+ reactIs_development$1.Fragment = Fragment;
4081
+ reactIs_development$1.Lazy = Lazy;
4082
+ reactIs_development$1.Memo = Memo;
4083
+ reactIs_development$1.Portal = Portal;
4084
+ reactIs_development$1.Profiler = Profiler;
4085
+ reactIs_development$1.StrictMode = StrictMode;
4086
+ reactIs_development$1.Suspense = Suspense;
4087
+ reactIs_development$1.isAsyncMode = isAsyncMode;
4088
+ reactIs_development$1.isConcurrentMode = isConcurrentMode;
4089
+ reactIs_development$1.isContextConsumer = isContextConsumer;
4090
+ reactIs_development$1.isContextProvider = isContextProvider;
4091
+ reactIs_development$1.isElement = isElement;
4092
+ reactIs_development$1.isForwardRef = isForwardRef;
4093
+ reactIs_development$1.isFragment = isFragment;
4094
+ reactIs_development$1.isLazy = isLazy;
4095
+ reactIs_development$1.isMemo = isMemo;
4096
+ reactIs_development$1.isPortal = isPortal;
4097
+ reactIs_development$1.isProfiler = isProfiler;
4098
+ reactIs_development$1.isStrictMode = isStrictMode;
4099
+ reactIs_development$1.isSuspense = isSuspense;
4100
+ reactIs_development$1.isValidElementType = isValidElementType;
4101
+ reactIs_development$1.typeOf = typeOf;
4102
+ })();
4103
+ }
4104
+ return reactIs_development$1;
4105
+ }
4106
+ var hasRequiredReactIs$1;
4107
+ function requireReactIs$1() {
4108
+ if (hasRequiredReactIs$1) return reactIs$1.exports;
4109
+ hasRequiredReactIs$1 = 1;
4110
+ if (process.env.NODE_ENV === 'production') {
4111
+ reactIs$1.exports = requireReactIs_production_min$1();
4112
+ } else {
4113
+ reactIs$1.exports = requireReactIs_development$1();
4114
+ }
4115
+ return reactIs$1.exports;
4116
+ }
4117
+
4118
+ /*
4119
+ object-assign
4120
+ (c) Sindre Sorhus
4121
+ @license MIT
4122
+ */
4123
+
4124
+ var objectAssign$1;
4125
+ var hasRequiredObjectAssign$1;
4126
+ function requireObjectAssign$1() {
4127
+ if (hasRequiredObjectAssign$1) return objectAssign$1;
4128
+ hasRequiredObjectAssign$1 = 1;
4129
+ /* eslint-disable no-unused-vars */
4130
+ var getOwnPropertySymbols = Object.getOwnPropertySymbols;
4131
+ var hasOwnProperty = Object.prototype.hasOwnProperty;
4132
+ var propIsEnumerable = Object.prototype.propertyIsEnumerable;
4133
+ function toObject(val) {
4134
+ if (val === null || val === undefined) {
4135
+ throw new TypeError('Object.assign cannot be called with null or undefined');
4136
+ }
4137
+ return Object(val);
4138
+ }
4139
+ function shouldUseNative() {
4140
+ try {
4141
+ if (!Object.assign) {
4142
+ return false;
4143
+ }
4144
+
4145
+ // Detect buggy property enumeration order in older V8 versions.
4146
+
4147
+ // https://bugs.chromium.org/p/v8/issues/detail?id=4118
4148
+ var test1 = new String('abc'); // eslint-disable-line no-new-wrappers
4149
+ test1[5] = 'de';
4150
+ if (Object.getOwnPropertyNames(test1)[0] === '5') {
4151
+ return false;
4152
+ }
4153
+
4154
+ // https://bugs.chromium.org/p/v8/issues/detail?id=3056
4155
+ var test2 = {};
4156
+ for (var i = 0; i < 10; i++) {
4157
+ test2['_' + String.fromCharCode(i)] = i;
4158
+ }
4159
+ var order2 = Object.getOwnPropertyNames(test2).map(function (n) {
4160
+ return test2[n];
4161
+ });
4162
+ if (order2.join('') !== '0123456789') {
4163
+ return false;
4164
+ }
4165
+
4166
+ // https://bugs.chromium.org/p/v8/issues/detail?id=3056
4167
+ var test3 = {};
4168
+ 'abcdefghijklmnopqrst'.split('').forEach(function (letter) {
4169
+ test3[letter] = letter;
4170
+ });
4171
+ if (Object.keys(Object.assign({}, test3)).join('') !== 'abcdefghijklmnopqrst') {
4172
+ return false;
4173
+ }
4174
+ return true;
4175
+ } catch (err) {
4176
+ // We don't expect any of the above to throw, but better to be safe.
4177
+ return false;
4178
+ }
4179
+ }
4180
+ objectAssign$1 = shouldUseNative() ? Object.assign : function (target, source) {
4181
+ var from;
4182
+ var to = toObject(target);
4183
+ var symbols;
4184
+ for (var s = 1; s < arguments.length; s++) {
4185
+ from = Object(arguments[s]);
4186
+ for (var key in from) {
4187
+ if (hasOwnProperty.call(from, key)) {
4188
+ to[key] = from[key];
4189
+ }
4190
+ }
4191
+ if (getOwnPropertySymbols) {
4192
+ symbols = getOwnPropertySymbols(from);
4193
+ for (var i = 0; i < symbols.length; i++) {
4194
+ if (propIsEnumerable.call(from, symbols[i])) {
4195
+ to[symbols[i]] = from[symbols[i]];
4196
+ }
4197
+ }
4198
+ }
4199
+ }
4200
+ return to;
4201
+ };
4202
+ return objectAssign$1;
4203
+ }
4204
+
4205
+ /**
4206
+ * Copyright (c) 2013-present, Facebook, Inc.
4207
+ *
4208
+ * This source code is licensed under the MIT license found in the
4209
+ * LICENSE file in the root directory of this source tree.
4210
+ */
4211
+
4212
+ var ReactPropTypesSecret_1$1;
4213
+ var hasRequiredReactPropTypesSecret$1;
4214
+ function requireReactPropTypesSecret$1() {
4215
+ if (hasRequiredReactPropTypesSecret$1) return ReactPropTypesSecret_1$1;
4216
+ hasRequiredReactPropTypesSecret$1 = 1;
4217
+ var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
4218
+ ReactPropTypesSecret_1$1 = ReactPropTypesSecret;
4219
+ return ReactPropTypesSecret_1$1;
4220
+ }
4221
+ var has$1;
4222
+ var hasRequiredHas$1;
4223
+ function requireHas$1() {
4224
+ if (hasRequiredHas$1) return has$1;
4225
+ hasRequiredHas$1 = 1;
4226
+ has$1 = Function.call.bind(Object.prototype.hasOwnProperty);
4227
+ return has$1;
4228
+ }
4229
+
4230
+ /**
4231
+ * Copyright (c) 2013-present, Facebook, Inc.
4232
+ *
4233
+ * This source code is licensed under the MIT license found in the
4234
+ * LICENSE file in the root directory of this source tree.
4235
+ */
4236
+
4237
+ var checkPropTypes_1$1;
4238
+ var hasRequiredCheckPropTypes$1;
4239
+ function requireCheckPropTypes$1() {
4240
+ if (hasRequiredCheckPropTypes$1) return checkPropTypes_1$1;
4241
+ hasRequiredCheckPropTypes$1 = 1;
4242
+ var printWarning = function () {};
4243
+ if (process.env.NODE_ENV !== 'production') {
4244
+ var ReactPropTypesSecret = /*@__PURE__*/requireReactPropTypesSecret$1();
4245
+ var loggedTypeFailures = {};
4246
+ var has = /*@__PURE__*/requireHas$1();
4247
+ printWarning = function (text) {
4248
+ var message = 'Warning: ' + text;
4249
+ if (typeof console !== 'undefined') {
4250
+ console.error(message);
4251
+ }
4252
+ try {
4253
+ // --- Welcome to debugging React ---
4254
+ // This error was thrown as a convenience so that you can use this stack
4255
+ // to find the callsite that caused this warning to fire.
4256
+ throw new Error(message);
4257
+ } catch (x) {/**/}
4258
+ };
4259
+ }
4260
+
4261
+ /**
4262
+ * Assert that the values match with the type specs.
4263
+ * Error messages are memorized and will only be shown once.
4264
+ *
4265
+ * @param {object} typeSpecs Map of name to a ReactPropType
4266
+ * @param {object} values Runtime values that need to be type-checked
4267
+ * @param {string} location e.g. "prop", "context", "child context"
4268
+ * @param {string} componentName Name of the component for error messages.
4269
+ * @param {?Function} getStack Returns the component stack.
4270
+ * @private
4271
+ */
4272
+ function checkPropTypes(typeSpecs, values, location, componentName, getStack) {
4273
+ if (process.env.NODE_ENV !== 'production') {
4274
+ for (var typeSpecName in typeSpecs) {
4275
+ if (has(typeSpecs, typeSpecName)) {
4276
+ var error;
4277
+ // Prop type validation may throw. In case they do, we don't want to
4278
+ // fail the render phase where it didn't fail before. So we log it.
4279
+ // After these have been cleaned up, we'll let them throw.
4280
+ try {
4281
+ // This is intentionally an invariant that gets caught. It's the same
4282
+ // behavior as without this statement except with a better message.
4283
+ if (typeof typeSpecs[typeSpecName] !== 'function') {
4284
+ var err = Error((componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' + 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.' + 'This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.');
4285
+ err.name = 'Invariant Violation';
4286
+ throw err;
4287
+ }
4288
+ error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret);
4289
+ } catch (ex) {
4290
+ error = ex;
4291
+ }
4292
+ if (error && !(error instanceof Error)) {
4293
+ printWarning((componentName || 'React class') + ': type specification of ' + location + ' `' + typeSpecName + '` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a ' + typeof error + '. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).');
4294
+ }
4295
+ if (error instanceof Error && !(error.message in loggedTypeFailures)) {
4296
+ // Only monitor this failure once because there tends to be a lot of the
4297
+ // same error.
4298
+ loggedTypeFailures[error.message] = true;
4299
+ var stack = getStack ? getStack() : '';
4300
+ printWarning('Failed ' + location + ' type: ' + error.message + (stack != null ? stack : ''));
4301
+ }
4302
+ }
4303
+ }
4304
+ }
4305
+ }
4306
+
4307
+ /**
4308
+ * Resets warning cache when testing.
4309
+ *
4310
+ * @private
4311
+ */
4312
+ checkPropTypes.resetWarningCache = function () {
4313
+ if (process.env.NODE_ENV !== 'production') {
4314
+ loggedTypeFailures = {};
4315
+ }
4316
+ };
4317
+ checkPropTypes_1$1 = checkPropTypes;
4318
+ return checkPropTypes_1$1;
4319
+ }
4320
+
4321
+ /**
4322
+ * Copyright (c) 2013-present, Facebook, Inc.
4323
+ *
4324
+ * This source code is licensed under the MIT license found in the
4325
+ * LICENSE file in the root directory of this source tree.
4326
+ */
4327
+
4328
+ var factoryWithTypeCheckers$1;
4329
+ var hasRequiredFactoryWithTypeCheckers$1;
4330
+ function requireFactoryWithTypeCheckers$1() {
4331
+ if (hasRequiredFactoryWithTypeCheckers$1) return factoryWithTypeCheckers$1;
4332
+ hasRequiredFactoryWithTypeCheckers$1 = 1;
4333
+ var ReactIs = requireReactIs$1();
4334
+ var assign = requireObjectAssign$1();
4335
+ var ReactPropTypesSecret = /*@__PURE__*/requireReactPropTypesSecret$1();
4336
+ var has = /*@__PURE__*/requireHas$1();
4337
+ var checkPropTypes = /*@__PURE__*/requireCheckPropTypes$1();
4338
+ var printWarning = function () {};
4339
+ if (process.env.NODE_ENV !== 'production') {
4340
+ printWarning = function (text) {
4341
+ var message = 'Warning: ' + text;
4342
+ if (typeof console !== 'undefined') {
4343
+ console.error(message);
4344
+ }
4345
+ try {
4346
+ // --- Welcome to debugging React ---
4347
+ // This error was thrown as a convenience so that you can use this stack
4348
+ // to find the callsite that caused this warning to fire.
4349
+ throw new Error(message);
4350
+ } catch (x) {}
4351
+ };
4352
+ }
4353
+ function emptyFunctionThatReturnsNull() {
4354
+ return null;
4355
+ }
4356
+ factoryWithTypeCheckers$1 = function (isValidElement, throwOnDirectAccess) {
4357
+ /* global Symbol */
4358
+ var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
4359
+ var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec.
4360
+
4361
+ /**
4362
+ * Returns the iterator method function contained on the iterable object.
4363
+ *
4364
+ * Be sure to invoke the function with the iterable as context:
4365
+ *
4366
+ * var iteratorFn = getIteratorFn(myIterable);
4367
+ * if (iteratorFn) {
4368
+ * var iterator = iteratorFn.call(myIterable);
4369
+ * ...
4370
+ * }
4371
+ *
4372
+ * @param {?object} maybeIterable
4373
+ * @return {?function}
4374
+ */
4375
+ function getIteratorFn(maybeIterable) {
4376
+ var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]);
4377
+ if (typeof iteratorFn === 'function') {
4378
+ return iteratorFn;
4379
+ }
4380
+ }
4381
+
4382
+ /**
4383
+ * Collection of methods that allow declaration and validation of props that are
4384
+ * supplied to React components. Example usage:
4385
+ *
4386
+ * var Props = require('ReactPropTypes');
4387
+ * var MyArticle = React.createClass({
4388
+ * propTypes: {
4389
+ * // An optional string prop named "description".
4390
+ * description: Props.string,
4391
+ *
4392
+ * // A required enum prop named "category".
4393
+ * category: Props.oneOf(['News','Photos']).isRequired,
4394
+ *
4395
+ * // A prop named "dialog" that requires an instance of Dialog.
4396
+ * dialog: Props.instanceOf(Dialog).isRequired
4397
+ * },
4398
+ * render: function() { ... }
4399
+ * });
4400
+ *
4401
+ * A more formal specification of how these methods are used:
4402
+ *
4403
+ * type := array|bool|func|object|number|string|oneOf([...])|instanceOf(...)
4404
+ * decl := ReactPropTypes.{type}(.isRequired)?
4405
+ *
4406
+ * Each and every declaration produces a function with the same signature. This
4407
+ * allows the creation of custom validation functions. For example:
4408
+ *
4409
+ * var MyLink = React.createClass({
4410
+ * propTypes: {
4411
+ * // An optional string or URI prop named "href".
4412
+ * href: function(props, propName, componentName) {
4413
+ * var propValue = props[propName];
4414
+ * if (propValue != null && typeof propValue !== 'string' &&
4415
+ * !(propValue instanceof URI)) {
4416
+ * return new Error(
4417
+ * 'Expected a string or an URI for ' + propName + ' in ' +
4418
+ * componentName
4419
+ * );
4420
+ * }
4421
+ * }
4422
+ * },
4423
+ * render: function() {...}
4424
+ * });
4425
+ *
4426
+ * @internal
4427
+ */
4428
+
4429
+ var ANONYMOUS = '<<anonymous>>';
4430
+
4431
+ // Important!
4432
+ // Keep this list in sync with production version in `./factoryWithThrowingShims.js`.
4433
+ var ReactPropTypes = {
4434
+ array: createPrimitiveTypeChecker('array'),
4435
+ bigint: createPrimitiveTypeChecker('bigint'),
4436
+ bool: createPrimitiveTypeChecker('boolean'),
4437
+ func: createPrimitiveTypeChecker('function'),
4438
+ number: createPrimitiveTypeChecker('number'),
4439
+ object: createPrimitiveTypeChecker('object'),
4440
+ string: createPrimitiveTypeChecker('string'),
4441
+ symbol: createPrimitiveTypeChecker('symbol'),
4442
+ any: createAnyTypeChecker(),
4443
+ arrayOf: createArrayOfTypeChecker,
4444
+ element: createElementTypeChecker(),
4445
+ elementType: createElementTypeTypeChecker(),
4446
+ instanceOf: createInstanceTypeChecker,
4447
+ node: createNodeChecker(),
4448
+ objectOf: createObjectOfTypeChecker,
4449
+ oneOf: createEnumTypeChecker,
4450
+ oneOfType: createUnionTypeChecker,
4451
+ shape: createShapeTypeChecker,
4452
+ exact: createStrictShapeTypeChecker
4453
+ };
4454
+
4455
+ /**
4456
+ * inlined Object.is polyfill to avoid requiring consumers ship their own
4457
+ * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is
4458
+ */
4459
+ /*eslint-disable no-self-compare*/
4460
+ function is(x, y) {
4461
+ // SameValue algorithm
4462
+ if (x === y) {
4463
+ // Steps 1-5, 7-10
4464
+ // Steps 6.b-6.e: +0 != -0
4465
+ return x !== 0 || 1 / x === 1 / y;
4466
+ } else {
4467
+ // Step 6.a: NaN == NaN
4468
+ return x !== x && y !== y;
4469
+ }
4470
+ }
4471
+ /*eslint-enable no-self-compare*/
4472
+
4473
+ /**
4474
+ * We use an Error-like object for backward compatibility as people may call
4475
+ * PropTypes directly and inspect their output. However, we don't use real
4476
+ * Errors anymore. We don't inspect their stack anyway, and creating them
4477
+ * is prohibitively expensive if they are created too often, such as what
4478
+ * happens in oneOfType() for any type before the one that matched.
4479
+ */
4480
+ function PropTypeError(message, data) {
4481
+ this.message = message;
4482
+ this.data = data && typeof data === 'object' ? data : {};
4483
+ this.stack = '';
4484
+ }
4485
+ // Make `instanceof Error` still work for returned errors.
4486
+ PropTypeError.prototype = Error.prototype;
4487
+ function createChainableTypeChecker(validate) {
4488
+ if (process.env.NODE_ENV !== 'production') {
4489
+ var manualPropTypeCallCache = {};
4490
+ var manualPropTypeWarningCount = 0;
4491
+ }
4492
+ function checkType(isRequired, props, propName, componentName, location, propFullName, secret) {
4493
+ componentName = componentName || ANONYMOUS;
4494
+ propFullName = propFullName || propName;
4495
+ if (secret !== ReactPropTypesSecret) {
4496
+ if (throwOnDirectAccess) {
4497
+ // New behavior only for users of `prop-types` package
4498
+ var err = new Error('Calling PropTypes validators directly is not supported by the `prop-types` package. ' + 'Use `PropTypes.checkPropTypes()` to call them. ' + 'Read more at http://fb.me/use-check-prop-types');
4499
+ err.name = 'Invariant Violation';
4500
+ throw err;
4501
+ } else if (process.env.NODE_ENV !== 'production' && typeof console !== 'undefined') {
4502
+ // Old behavior for people using React.PropTypes
4503
+ var cacheKey = componentName + ':' + propName;
4504
+ if (!manualPropTypeCallCache[cacheKey] &&
4505
+ // Avoid spamming the console because they are often not actionable except for lib authors
4506
+ manualPropTypeWarningCount < 3) {
4507
+ printWarning('You are manually calling a React.PropTypes validation ' + 'function for the `' + propFullName + '` prop on `' + componentName + '`. This is deprecated ' + 'and will throw in the standalone `prop-types` package. ' + 'You may be seeing this warning due to a third-party PropTypes ' + 'library. See https://fb.me/react-warning-dont-call-proptypes ' + 'for details.');
4508
+ manualPropTypeCallCache[cacheKey] = true;
4509
+ manualPropTypeWarningCount++;
4510
+ }
4511
+ }
4512
+ }
4513
+ if (props[propName] == null) {
4514
+ if (isRequired) {
4515
+ if (props[propName] === null) {
4516
+ return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required ' + ('in `' + componentName + '`, but its value is `null`.'));
4517
+ }
4518
+ return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required in ' + ('`' + componentName + '`, but its value is `undefined`.'));
4519
+ }
4520
+ return null;
4521
+ } else {
4522
+ return validate(props, propName, componentName, location, propFullName);
4523
+ }
4524
+ }
4525
+ var chainedCheckType = checkType.bind(null, false);
4526
+ chainedCheckType.isRequired = checkType.bind(null, true);
4527
+ return chainedCheckType;
4528
+ }
4529
+ function createPrimitiveTypeChecker(expectedType) {
4530
+ function validate(props, propName, componentName, location, propFullName, secret) {
4531
+ var propValue = props[propName];
4532
+ var propType = getPropType(propValue);
4533
+ if (propType !== expectedType) {
4534
+ // `propValue` being instance of, say, date/regexp, pass the 'object'
4535
+ // check, but we can offer a more precise error message here rather than
4536
+ // 'of type `object`'.
4537
+ var preciseType = getPreciseType(propValue);
4538
+ return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.'), {
4539
+ expectedType: expectedType
4540
+ });
4541
+ }
4542
+ return null;
4543
+ }
4544
+ return createChainableTypeChecker(validate);
4545
+ }
4546
+ function createAnyTypeChecker() {
4547
+ return createChainableTypeChecker(emptyFunctionThatReturnsNull);
4548
+ }
4549
+ function createArrayOfTypeChecker(typeChecker) {
4550
+ function validate(props, propName, componentName, location, propFullName) {
4551
+ if (typeof typeChecker !== 'function') {
4552
+ return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside arrayOf.');
4553
+ }
4554
+ var propValue = props[propName];
4555
+ if (!Array.isArray(propValue)) {
4556
+ var propType = getPropType(propValue);
4557
+ return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an array.'));
4558
+ }
4559
+ for (var i = 0; i < propValue.length; i++) {
4560
+ var error = typeChecker(propValue, i, componentName, location, propFullName + '[' + i + ']', ReactPropTypesSecret);
4561
+ if (error instanceof Error) {
4562
+ return error;
4563
+ }
4564
+ }
4565
+ return null;
4566
+ }
4567
+ return createChainableTypeChecker(validate);
4568
+ }
4569
+ function createElementTypeChecker() {
4570
+ function validate(props, propName, componentName, location, propFullName) {
4571
+ var propValue = props[propName];
4572
+ if (!isValidElement(propValue)) {
4573
+ var propType = getPropType(propValue);
4574
+ return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement.'));
4575
+ }
4576
+ return null;
4577
+ }
4578
+ return createChainableTypeChecker(validate);
4579
+ }
4580
+ function createElementTypeTypeChecker() {
4581
+ function validate(props, propName, componentName, location, propFullName) {
4582
+ var propValue = props[propName];
4583
+ if (!ReactIs.isValidElementType(propValue)) {
4584
+ var propType = getPropType(propValue);
4585
+ return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement type.'));
4586
+ }
4587
+ return null;
4588
+ }
4589
+ return createChainableTypeChecker(validate);
4590
+ }
4591
+ function createInstanceTypeChecker(expectedClass) {
4592
+ function validate(props, propName, componentName, location, propFullName) {
4593
+ if (!(props[propName] instanceof expectedClass)) {
4594
+ var expectedClassName = expectedClass.name || ANONYMOUS;
4595
+ var actualClassName = getClassName(props[propName]);
4596
+ return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + actualClassName + '` supplied to `' + componentName + '`, expected ') + ('instance of `' + expectedClassName + '`.'));
4597
+ }
4598
+ return null;
4599
+ }
4600
+ return createChainableTypeChecker(validate);
4601
+ }
4602
+ function createEnumTypeChecker(expectedValues) {
4603
+ if (!Array.isArray(expectedValues)) {
4604
+ if (process.env.NODE_ENV !== 'production') {
4605
+ if (arguments.length > 1) {
4606
+ printWarning('Invalid arguments supplied to oneOf, expected an array, got ' + arguments.length + ' arguments. ' + 'A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z]).');
4607
+ } else {
4608
+ printWarning('Invalid argument supplied to oneOf, expected an array.');
4609
+ }
4610
+ }
4611
+ return emptyFunctionThatReturnsNull;
4612
+ }
4613
+ function validate(props, propName, componentName, location, propFullName) {
4614
+ var propValue = props[propName];
4615
+ for (var i = 0; i < expectedValues.length; i++) {
4616
+ if (is(propValue, expectedValues[i])) {
4617
+ return null;
4618
+ }
4619
+ }
4620
+ var valuesString = JSON.stringify(expectedValues, function replacer(key, value) {
4621
+ var type = getPreciseType(value);
4622
+ if (type === 'symbol') {
4623
+ return String(value);
4624
+ }
4625
+ return value;
4626
+ });
4627
+ return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of value `' + String(propValue) + '` ' + ('supplied to `' + componentName + '`, expected one of ' + valuesString + '.'));
4628
+ }
4629
+ return createChainableTypeChecker(validate);
4630
+ }
4631
+ function createObjectOfTypeChecker(typeChecker) {
4632
+ function validate(props, propName, componentName, location, propFullName) {
4633
+ if (typeof typeChecker !== 'function') {
4634
+ return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside objectOf.');
4635
+ }
4636
+ var propValue = props[propName];
4637
+ var propType = getPropType(propValue);
4638
+ if (propType !== 'object') {
4639
+ return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an object.'));
4640
+ }
4641
+ for (var key in propValue) {
4642
+ if (has(propValue, key)) {
4643
+ var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
4644
+ if (error instanceof Error) {
4645
+ return error;
4646
+ }
4647
+ }
4648
+ }
4649
+ return null;
4650
+ }
4651
+ return createChainableTypeChecker(validate);
4652
+ }
4653
+ function createUnionTypeChecker(arrayOfTypeCheckers) {
4654
+ if (!Array.isArray(arrayOfTypeCheckers)) {
4655
+ process.env.NODE_ENV !== 'production' ? printWarning('Invalid argument supplied to oneOfType, expected an instance of array.') : void 0;
4656
+ return emptyFunctionThatReturnsNull;
4657
+ }
4658
+ for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
4659
+ var checker = arrayOfTypeCheckers[i];
4660
+ if (typeof checker !== 'function') {
4661
+ printWarning('Invalid argument supplied to oneOfType. Expected an array of check functions, but ' + 'received ' + getPostfixForTypeWarning(checker) + ' at index ' + i + '.');
4662
+ return emptyFunctionThatReturnsNull;
4663
+ }
4664
+ }
4665
+ function validate(props, propName, componentName, location, propFullName) {
4666
+ var expectedTypes = [];
4667
+ for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
4668
+ var checker = arrayOfTypeCheckers[i];
4669
+ var checkerResult = checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret);
4670
+ if (checkerResult == null) {
4671
+ return null;
4672
+ }
4673
+ if (checkerResult.data && has(checkerResult.data, 'expectedType')) {
4674
+ expectedTypes.push(checkerResult.data.expectedType);
4675
+ }
4676
+ }
4677
+ var expectedTypesMessage = expectedTypes.length > 0 ? ', expected one of type [' + expectedTypes.join(', ') + ']' : '';
4678
+ return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`' + expectedTypesMessage + '.'));
4679
+ }
4680
+ return createChainableTypeChecker(validate);
4681
+ }
4682
+ function createNodeChecker() {
4683
+ function validate(props, propName, componentName, location, propFullName) {
4684
+ if (!isNode(props[propName])) {
4685
+ return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a ReactNode.'));
4686
+ }
4687
+ return null;
4688
+ }
4689
+ return createChainableTypeChecker(validate);
4690
+ }
4691
+ function invalidValidatorError(componentName, location, propFullName, key, type) {
4692
+ return new PropTypeError((componentName || 'React class') + ': ' + location + ' type `' + propFullName + '.' + key + '` is invalid; ' + 'it must be a function, usually from the `prop-types` package, but received `' + type + '`.');
4693
+ }
4694
+ function createShapeTypeChecker(shapeTypes) {
4695
+ function validate(props, propName, componentName, location, propFullName) {
4696
+ var propValue = props[propName];
4697
+ var propType = getPropType(propValue);
4698
+ if (propType !== 'object') {
4699
+ return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
4700
+ }
4701
+ for (var key in shapeTypes) {
4702
+ var checker = shapeTypes[key];
4703
+ if (typeof checker !== 'function') {
4704
+ return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker));
4705
+ }
4706
+ var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
4707
+ if (error) {
4708
+ return error;
4709
+ }
4710
+ }
4711
+ return null;
4712
+ }
4713
+ return createChainableTypeChecker(validate);
4714
+ }
4715
+ function createStrictShapeTypeChecker(shapeTypes) {
4716
+ function validate(props, propName, componentName, location, propFullName) {
4717
+ var propValue = props[propName];
4718
+ var propType = getPropType(propValue);
4719
+ if (propType !== 'object') {
4720
+ return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
4721
+ }
4722
+ // We need to check all keys in case some are required but missing from props.
4723
+ var allKeys = assign({}, props[propName], shapeTypes);
4724
+ for (var key in allKeys) {
4725
+ var checker = shapeTypes[key];
4726
+ if (has(shapeTypes, key) && typeof checker !== 'function') {
4727
+ return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker));
4728
+ }
4729
+ if (!checker) {
4730
+ return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` key `' + key + '` supplied to `' + componentName + '`.' + '\nBad object: ' + JSON.stringify(props[propName], null, ' ') + '\nValid keys: ' + JSON.stringify(Object.keys(shapeTypes), null, ' '));
4731
+ }
4732
+ var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
4733
+ if (error) {
4734
+ return error;
4735
+ }
4736
+ }
4737
+ return null;
4738
+ }
4739
+ return createChainableTypeChecker(validate);
4740
+ }
4741
+ function isNode(propValue) {
4742
+ switch (typeof propValue) {
4743
+ case 'number':
4744
+ case 'string':
4745
+ case 'undefined':
4746
+ return true;
4747
+ case 'boolean':
4748
+ return !propValue;
4749
+ case 'object':
4750
+ if (Array.isArray(propValue)) {
4751
+ return propValue.every(isNode);
4752
+ }
4753
+ if (propValue === null || isValidElement(propValue)) {
4754
+ return true;
4755
+ }
4756
+ var iteratorFn = getIteratorFn(propValue);
4757
+ if (iteratorFn) {
4758
+ var iterator = iteratorFn.call(propValue);
4759
+ var step;
4760
+ if (iteratorFn !== propValue.entries) {
4761
+ while (!(step = iterator.next()).done) {
4762
+ if (!isNode(step.value)) {
4763
+ return false;
4764
+ }
4765
+ }
4766
+ } else {
4767
+ // Iterator will provide entry [k,v] tuples rather than values.
4768
+ while (!(step = iterator.next()).done) {
4769
+ var entry = step.value;
4770
+ if (entry) {
4771
+ if (!isNode(entry[1])) {
4772
+ return false;
4773
+ }
4774
+ }
4775
+ }
4776
+ }
4777
+ } else {
4778
+ return false;
4779
+ }
4780
+ return true;
4781
+ default:
4782
+ return false;
4783
+ }
4784
+ }
4785
+ function isSymbol(propType, propValue) {
4786
+ // Native Symbol.
4787
+ if (propType === 'symbol') {
4788
+ return true;
4789
+ }
4790
+
4791
+ // falsy value can't be a Symbol
4792
+ if (!propValue) {
4793
+ return false;
4794
+ }
4795
+
4796
+ // 19.4.3.5 Symbol.prototype[@@toStringTag] === 'Symbol'
4797
+ if (propValue['@@toStringTag'] === 'Symbol') {
4798
+ return true;
4799
+ }
4800
+
4801
+ // Fallback for non-spec compliant Symbols which are polyfilled.
4802
+ if (typeof Symbol === 'function' && propValue instanceof Symbol) {
4803
+ return true;
4804
+ }
4805
+ return false;
4806
+ }
4807
+
4808
+ // Equivalent of `typeof` but with special handling for array and regexp.
4809
+ function getPropType(propValue) {
4810
+ var propType = typeof propValue;
4811
+ if (Array.isArray(propValue)) {
4812
+ return 'array';
4813
+ }
4814
+ if (propValue instanceof RegExp) {
4815
+ // Old webkits (at least until Android 4.0) return 'function' rather than
4816
+ // 'object' for typeof a RegExp. We'll normalize this here so that /bla/
4817
+ // passes PropTypes.object.
4818
+ return 'object';
4819
+ }
4820
+ if (isSymbol(propType, propValue)) {
4821
+ return 'symbol';
4822
+ }
4823
+ return propType;
4824
+ }
4825
+
4826
+ // This handles more types than `getPropType`. Only used for error messages.
4827
+ // See `createPrimitiveTypeChecker`.
4828
+ function getPreciseType(propValue) {
4829
+ if (typeof propValue === 'undefined' || propValue === null) {
4830
+ return '' + propValue;
4831
+ }
4832
+ var propType = getPropType(propValue);
4833
+ if (propType === 'object') {
4834
+ if (propValue instanceof Date) {
4835
+ return 'date';
4836
+ } else if (propValue instanceof RegExp) {
4837
+ return 'regexp';
4838
+ }
4839
+ }
4840
+ return propType;
4841
+ }
4842
+
4843
+ // Returns a string that is postfixed to a warning about an invalid type.
4844
+ // For example, "undefined" or "of type array"
4845
+ function getPostfixForTypeWarning(value) {
4846
+ var type = getPreciseType(value);
4847
+ switch (type) {
4848
+ case 'array':
4849
+ case 'object':
4850
+ return 'an ' + type;
4851
+ case 'boolean':
4852
+ case 'date':
4853
+ case 'regexp':
4854
+ return 'a ' + type;
4855
+ default:
4856
+ return type;
4857
+ }
4858
+ }
4859
+
4860
+ // Returns class name of the object, if any.
4861
+ function getClassName(propValue) {
4862
+ if (!propValue.constructor || !propValue.constructor.name) {
4863
+ return ANONYMOUS;
4864
+ }
4865
+ return propValue.constructor.name;
4866
+ }
4867
+ ReactPropTypes.checkPropTypes = checkPropTypes;
4868
+ ReactPropTypes.resetWarningCache = checkPropTypes.resetWarningCache;
4869
+ ReactPropTypes.PropTypes = ReactPropTypes;
4870
+ return ReactPropTypes;
4871
+ };
4872
+ return factoryWithTypeCheckers$1;
4873
+ }
4874
+
4875
+ /**
4876
+ * Copyright (c) 2013-present, Facebook, Inc.
4877
+ *
4878
+ * This source code is licensed under the MIT license found in the
4879
+ * LICENSE file in the root directory of this source tree.
4880
+ */
4881
+
4882
+ var factoryWithThrowingShims$1;
4883
+ var hasRequiredFactoryWithThrowingShims$1;
4884
+ function requireFactoryWithThrowingShims$1() {
4885
+ if (hasRequiredFactoryWithThrowingShims$1) return factoryWithThrowingShims$1;
4886
+ hasRequiredFactoryWithThrowingShims$1 = 1;
4887
+ var ReactPropTypesSecret = /*@__PURE__*/requireReactPropTypesSecret$1();
4888
+ function emptyFunction() {}
4889
+ function emptyFunctionWithReset() {}
4890
+ emptyFunctionWithReset.resetWarningCache = emptyFunction;
4891
+ factoryWithThrowingShims$1 = function () {
4892
+ function shim(props, propName, componentName, location, propFullName, secret) {
4893
+ if (secret === ReactPropTypesSecret) {
4894
+ // It is still safe when called from React.
4895
+ return;
4896
+ }
4897
+ var err = new Error('Calling PropTypes validators directly is not supported by the `prop-types` package. ' + 'Use PropTypes.checkPropTypes() to call them. ' + 'Read more at http://fb.me/use-check-prop-types');
4898
+ err.name = 'Invariant Violation';
4899
+ throw err;
4900
+ }
4901
+ shim.isRequired = shim;
4902
+ function getShim() {
4903
+ return shim;
4904
+ } // Important!
4905
+ // Keep this list in sync with production version in `./factoryWithTypeCheckers.js`.
4906
+ var ReactPropTypes = {
4907
+ array: shim,
4908
+ bigint: shim,
4909
+ bool: shim,
4910
+ func: shim,
4911
+ number: shim,
4912
+ object: shim,
4913
+ string: shim,
4914
+ symbol: shim,
4915
+ any: shim,
4916
+ arrayOf: getShim,
4917
+ element: shim,
4918
+ elementType: shim,
4919
+ instanceOf: getShim,
4920
+ node: shim,
4921
+ objectOf: getShim,
4922
+ oneOf: getShim,
4923
+ oneOfType: getShim,
4924
+ shape: getShim,
4925
+ exact: getShim,
4926
+ checkPropTypes: emptyFunctionWithReset,
4927
+ resetWarningCache: emptyFunction
4928
+ };
4929
+ ReactPropTypes.PropTypes = ReactPropTypes;
4930
+ return ReactPropTypes;
4931
+ };
4932
+ return factoryWithThrowingShims$1;
4933
+ }
4934
+
4935
+ /**
4936
+ * Copyright (c) 2013-present, Facebook, Inc.
4937
+ *
4938
+ * This source code is licensed under the MIT license found in the
4939
+ * LICENSE file in the root directory of this source tree.
4940
+ */
4941
+
4942
+ var hasRequiredPropTypes$1;
4943
+ function requirePropTypes$1() {
4944
+ if (hasRequiredPropTypes$1) return propTypes$1.exports;
4945
+ hasRequiredPropTypes$1 = 1;
4946
+ if (process.env.NODE_ENV !== 'production') {
4947
+ var ReactIs = requireReactIs$1();
4948
+
4949
+ // By explicitly using `prop-types` you are opting into new development behavior.
4950
+ // http://fb.me/prop-types-in-prod
4951
+ var throwOnDirectAccess = true;
4952
+ propTypes$1.exports = /*@__PURE__*/requireFactoryWithTypeCheckers$1()(ReactIs.isElement, throwOnDirectAccess);
4953
+ } else {
4954
+ // By explicitly using `prop-types` you are opting into new production behavior.
4955
+ // http://fb.me/prop-types-in-prod
4956
+ propTypes$1.exports = /*@__PURE__*/requireFactoryWithThrowingShims$1()();
4957
+ }
4958
+ return propTypes$1.exports;
4959
+ }
4960
+ var propTypesExports$1 = /*@__PURE__*/requirePropTypes$1();
4961
+ var PropTypes$1 = /*@__PURE__*/getDefaultExportFromCjs$1(propTypesExports$1);
4962
+ ({
4963
+ onPowerOff: PropTypes$1.func,
4964
+ onRestart: PropTypes$1.func,
4965
+ powerOffLabel: PropTypes$1.string,
4966
+ restartLabel: PropTypes$1.string,
4967
+ iconClassName: PropTypes$1.string,
4968
+ confirmTitle: PropTypes$1.string,
4969
+ cancelText: PropTypes$1.string,
4970
+ okText: PropTypes$1.string,
4971
+ run: PropTypes$1.func
4972
+ });
4973
+ ({
4974
+ logoUrl: PropTypes$1.string,
4975
+ logoWidth: PropTypes$1.number,
4976
+ logoAlt: PropTypes$1.string,
4977
+ onClick: PropTypes$1.func
4978
+ });
4979
+
4980
+ // PropTypes 类型检查
4981
+ ({
4982
+ menuElement: PropTypes$1.node,
4983
+ productInfo: PropTypes$1.shape({
4984
+ productName: PropTypes$1.string,
4985
+ version: PropTypes$1.string
4986
+ }),
4987
+ showLogo: PropTypes$1.bool,
4988
+ showProductInfo: PropTypes$1.bool,
4989
+ showHardwareUsage: PropTypes$1.bool,
4990
+ showSystemOperations: PropTypes$1.bool,
4991
+ onPowerOff: PropTypes$1.func,
4992
+ onRestart: PropTypes$1.func,
4993
+ onRun: PropTypes$1.func,
4994
+ hardwareMonitorUrl: PropTypes$1.string,
4995
+ getSocketUrl: PropTypes$1.func,
4996
+ logoProps: PropTypes$1.object,
4997
+ className: PropTypes$1.string,
4998
+ style: PropTypes$1.object
4999
+ });
5000
+ function getDefaultExportFromCjs(x) {
5001
+ return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
5002
+ }
5003
+ var propTypes = {
5004
+ exports: {}
5005
+ };
5006
+ var reactIs = {
5007
+ exports: {}
5008
+ };
5009
+ var reactIs_production_min = {};
5010
+
5011
+ /** @license React v16.13.1
5012
+ * react-is.production.min.js
5013
+ *
5014
+ * Copyright (c) Facebook, Inc. and its affiliates.
5015
+ *
5016
+ * This source code is licensed under the MIT license found in the
5017
+ * LICENSE file in the root directory of this source tree.
5018
+ */
5019
+
5020
+ var hasRequiredReactIs_production_min;
5021
+ function requireReactIs_production_min() {
5022
+ if (hasRequiredReactIs_production_min) return reactIs_production_min;
5023
+ hasRequiredReactIs_production_min = 1;
5024
+ var b = "function" === typeof Symbol && Symbol.for,
5025
+ c = b ? Symbol.for("react.element") : 60103,
5026
+ d = b ? Symbol.for("react.portal") : 60106,
5027
+ e = b ? Symbol.for("react.fragment") : 60107,
5028
+ f = b ? Symbol.for("react.strict_mode") : 60108,
5029
+ g = b ? Symbol.for("react.profiler") : 60114,
5030
+ h = b ? Symbol.for("react.provider") : 60109,
5031
+ k = b ? Symbol.for("react.context") : 60110,
5032
+ l = b ? Symbol.for("react.async_mode") : 60111,
5033
+ m = b ? Symbol.for("react.concurrent_mode") : 60111,
5034
+ n = b ? Symbol.for("react.forward_ref") : 60112,
5035
+ p = b ? Symbol.for("react.suspense") : 60113,
5036
+ q = b ? Symbol.for("react.suspense_list") : 60120,
5037
+ r = b ? Symbol.for("react.memo") : 60115,
5038
+ t = b ? Symbol.for("react.lazy") : 60116,
5039
+ v = b ? Symbol.for("react.block") : 60121,
5040
+ w = b ? Symbol.for("react.fundamental") : 60117,
5041
+ x = b ? Symbol.for("react.responder") : 60118,
5042
+ y = b ? Symbol.for("react.scope") : 60119;
5043
+ function z(a) {
5044
+ if ("object" === typeof a && null !== a) {
5045
+ var u = a.$$typeof;
5046
+ switch (u) {
5047
+ case c:
5048
+ switch (a = a.type, a) {
5049
+ case l:
5050
+ case m:
5051
+ case e:
5052
+ case g:
5053
+ case f:
5054
+ case p:
5055
+ return a;
5056
+ default:
5057
+ switch (a = a && a.$$typeof, a) {
5058
+ case k:
5059
+ case n:
5060
+ case t:
5061
+ case r:
5062
+ case h:
5063
+ return a;
5064
+ default:
5065
+ return u;
5066
+ }
5067
+ }
5068
+ case d:
5069
+ return u;
5070
+ }
5071
+ }
5072
+ }
5073
+ function A(a) {
5074
+ return z(a) === m;
5075
+ }
5076
+ reactIs_production_min.AsyncMode = l;
5077
+ reactIs_production_min.ConcurrentMode = m;
5078
+ reactIs_production_min.ContextConsumer = k;
5079
+ reactIs_production_min.ContextProvider = h;
5080
+ reactIs_production_min.Element = c;
5081
+ reactIs_production_min.ForwardRef = n;
5082
+ reactIs_production_min.Fragment = e;
5083
+ reactIs_production_min.Lazy = t;
5084
+ reactIs_production_min.Memo = r;
5085
+ reactIs_production_min.Portal = d;
5086
+ reactIs_production_min.Profiler = g;
5087
+ reactIs_production_min.StrictMode = f;
5088
+ reactIs_production_min.Suspense = p;
5089
+ reactIs_production_min.isAsyncMode = function (a) {
5090
+ return A(a) || z(a) === l;
5091
+ };
5092
+ reactIs_production_min.isConcurrentMode = A;
5093
+ reactIs_production_min.isContextConsumer = function (a) {
5094
+ return z(a) === k;
5095
+ };
5096
+ reactIs_production_min.isContextProvider = function (a) {
5097
+ return z(a) === h;
5098
+ };
5099
+ reactIs_production_min.isElement = function (a) {
5100
+ return "object" === typeof a && null !== a && a.$$typeof === c;
5101
+ };
5102
+ reactIs_production_min.isForwardRef = function (a) {
5103
+ return z(a) === n;
5104
+ };
5105
+ reactIs_production_min.isFragment = function (a) {
5106
+ return z(a) === e;
5107
+ };
5108
+ reactIs_production_min.isLazy = function (a) {
5109
+ return z(a) === t;
5110
+ };
5111
+ reactIs_production_min.isMemo = function (a) {
5112
+ return z(a) === r;
5113
+ };
5114
+ reactIs_production_min.isPortal = function (a) {
5115
+ return z(a) === d;
5116
+ };
5117
+ reactIs_production_min.isProfiler = function (a) {
5118
+ return z(a) === g;
5119
+ };
5120
+ reactIs_production_min.isStrictMode = function (a) {
5121
+ return z(a) === f;
5122
+ };
5123
+ reactIs_production_min.isSuspense = function (a) {
5124
+ return z(a) === p;
5125
+ };
5126
+ reactIs_production_min.isValidElementType = function (a) {
5127
+ 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);
5128
+ };
5129
+ reactIs_production_min.typeOf = z;
5130
+ return reactIs_production_min;
5131
+ }
5132
+ var reactIs_development = {};
5133
+
5134
+ /** @license React v16.13.1
5135
+ * react-is.development.js
5136
+ *
5137
+ * Copyright (c) Facebook, Inc. and its affiliates.
5138
+ *
5139
+ * This source code is licensed under the MIT license found in the
5140
+ * LICENSE file in the root directory of this source tree.
5141
+ */
5142
+
5143
+ var hasRequiredReactIs_development;
5144
+ function requireReactIs_development() {
5145
+ if (hasRequiredReactIs_development) return reactIs_development;
5146
+ hasRequiredReactIs_development = 1;
5147
+ if (process.env.NODE_ENV !== "production") {
5148
+ (function () {
5149
+ // The Symbol used to tag the ReactElement-like types. If there is no native Symbol
5150
+ // nor polyfill, then a plain number is used for performance.
5151
+ var hasSymbol = typeof Symbol === 'function' && Symbol.for;
5152
+ var REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for('react.element') : 0xeac7;
5153
+ var REACT_PORTAL_TYPE = hasSymbol ? Symbol.for('react.portal') : 0xeaca;
5154
+ var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for('react.fragment') : 0xeacb;
5155
+ var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for('react.strict_mode') : 0xeacc;
5156
+ var REACT_PROFILER_TYPE = hasSymbol ? Symbol.for('react.profiler') : 0xead2;
5157
+ var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for('react.provider') : 0xeacd;
5158
+ var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for('react.context') : 0xeace; // TODO: We don't use AsyncMode or ConcurrentMode anymore. They were temporary
5159
+ // (unstable) APIs that have been removed. Can we remove the symbols?
5160
+
5161
+ var REACT_ASYNC_MODE_TYPE = hasSymbol ? Symbol.for('react.async_mode') : 0xeacf;
5162
+ var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for('react.concurrent_mode') : 0xeacf;
5163
+ var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for('react.forward_ref') : 0xead0;
5164
+ var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for('react.suspense') : 0xead1;
5165
+ var REACT_SUSPENSE_LIST_TYPE = hasSymbol ? Symbol.for('react.suspense_list') : 0xead8;
5166
+ var REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3;
5167
+ var REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 0xead4;
5168
+ var REACT_BLOCK_TYPE = hasSymbol ? Symbol.for('react.block') : 0xead9;
5169
+ var REACT_FUNDAMENTAL_TYPE = hasSymbol ? Symbol.for('react.fundamental') : 0xead5;
5170
+ var REACT_RESPONDER_TYPE = hasSymbol ? Symbol.for('react.responder') : 0xead6;
5171
+ var REACT_SCOPE_TYPE = hasSymbol ? Symbol.for('react.scope') : 0xead7;
5172
+ function isValidElementType(type) {
5173
+ return typeof type === 'string' || typeof type === 'function' ||
5174
+ // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill.
5175
+ 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);
5176
+ }
5177
+ function typeOf(object) {
5178
+ if (typeof object === 'object' && object !== null) {
5179
+ var $$typeof = object.$$typeof;
5180
+ switch ($$typeof) {
5181
+ case REACT_ELEMENT_TYPE:
5182
+ var type = object.type;
5183
+ switch (type) {
5184
+ case REACT_ASYNC_MODE_TYPE:
5185
+ case REACT_CONCURRENT_MODE_TYPE:
5186
+ case REACT_FRAGMENT_TYPE:
5187
+ case REACT_PROFILER_TYPE:
5188
+ case REACT_STRICT_MODE_TYPE:
5189
+ case REACT_SUSPENSE_TYPE:
5190
+ return type;
5191
+ default:
5192
+ var $$typeofType = type && type.$$typeof;
5193
+ switch ($$typeofType) {
5194
+ case REACT_CONTEXT_TYPE:
5195
+ case REACT_FORWARD_REF_TYPE:
5196
+ case REACT_LAZY_TYPE:
5197
+ case REACT_MEMO_TYPE:
5198
+ case REACT_PROVIDER_TYPE:
5199
+ return $$typeofType;
5200
+ default:
5201
+ return $$typeof;
5202
+ }
5203
+ }
5204
+ case REACT_PORTAL_TYPE:
5205
+ return $$typeof;
5206
+ }
5207
+ }
5208
+ return undefined;
5209
+ } // AsyncMode is deprecated along with isAsyncMode
5210
+
5211
+ var AsyncMode = REACT_ASYNC_MODE_TYPE;
5212
+ var ConcurrentMode = REACT_CONCURRENT_MODE_TYPE;
5213
+ var ContextConsumer = REACT_CONTEXT_TYPE;
5214
+ var ContextProvider = REACT_PROVIDER_TYPE;
5215
+ var Element = REACT_ELEMENT_TYPE;
5216
+ var ForwardRef = REACT_FORWARD_REF_TYPE;
5217
+ var Fragment = REACT_FRAGMENT_TYPE;
5218
+ var Lazy = REACT_LAZY_TYPE;
5219
+ var Memo = REACT_MEMO_TYPE;
5220
+ var Portal = REACT_PORTAL_TYPE;
5221
+ var Profiler = REACT_PROFILER_TYPE;
5222
+ var StrictMode = REACT_STRICT_MODE_TYPE;
5223
+ var Suspense = REACT_SUSPENSE_TYPE;
5224
+ var hasWarnedAboutDeprecatedIsAsyncMode = false; // AsyncMode should be deprecated
5225
+
5226
+ function isAsyncMode(object) {
5227
+ {
5228
+ if (!hasWarnedAboutDeprecatedIsAsyncMode) {
5229
+ hasWarnedAboutDeprecatedIsAsyncMode = true; // Using console['warn'] to evade Babel and ESLint
5230
+
5231
+ 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.');
5232
+ }
5233
+ }
5234
+ return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;
5235
+ }
5236
+ function isConcurrentMode(object) {
5237
+ return typeOf(object) === REACT_CONCURRENT_MODE_TYPE;
5238
+ }
5239
+ function isContextConsumer(object) {
5240
+ return typeOf(object) === REACT_CONTEXT_TYPE;
5241
+ }
5242
+ function isContextProvider(object) {
5243
+ return typeOf(object) === REACT_PROVIDER_TYPE;
5244
+ }
5245
+ function isElement(object) {
5246
+ return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
5247
+ }
5248
+ function isForwardRef(object) {
5249
+ return typeOf(object) === REACT_FORWARD_REF_TYPE;
5250
+ }
5251
+ function isFragment(object) {
5252
+ return typeOf(object) === REACT_FRAGMENT_TYPE;
5253
+ }
5254
+ function isLazy(object) {
5255
+ return typeOf(object) === REACT_LAZY_TYPE;
5256
+ }
5257
+ function isMemo(object) {
5258
+ return typeOf(object) === REACT_MEMO_TYPE;
5259
+ }
5260
+ function isPortal(object) {
5261
+ return typeOf(object) === REACT_PORTAL_TYPE;
5262
+ }
5263
+ function isProfiler(object) {
5264
+ return typeOf(object) === REACT_PROFILER_TYPE;
5265
+ }
5266
+ function isStrictMode(object) {
5267
+ return typeOf(object) === REACT_STRICT_MODE_TYPE;
5268
+ }
5269
+ function isSuspense(object) {
5270
+ return typeOf(object) === REACT_SUSPENSE_TYPE;
5271
+ }
5272
+ reactIs_development.AsyncMode = AsyncMode;
5273
+ reactIs_development.ConcurrentMode = ConcurrentMode;
5274
+ reactIs_development.ContextConsumer = ContextConsumer;
5275
+ reactIs_development.ContextProvider = ContextProvider;
5276
+ reactIs_development.Element = Element;
5277
+ reactIs_development.ForwardRef = ForwardRef;
5278
+ reactIs_development.Fragment = Fragment;
5279
+ reactIs_development.Lazy = Lazy;
5280
+ reactIs_development.Memo = Memo;
5281
+ reactIs_development.Portal = Portal;
5282
+ reactIs_development.Profiler = Profiler;
5283
+ reactIs_development.StrictMode = StrictMode;
5284
+ reactIs_development.Suspense = Suspense;
5285
+ reactIs_development.isAsyncMode = isAsyncMode;
5286
+ reactIs_development.isConcurrentMode = isConcurrentMode;
5287
+ reactIs_development.isContextConsumer = isContextConsumer;
5288
+ reactIs_development.isContextProvider = isContextProvider;
5289
+ reactIs_development.isElement = isElement;
5290
+ reactIs_development.isForwardRef = isForwardRef;
5291
+ reactIs_development.isFragment = isFragment;
5292
+ reactIs_development.isLazy = isLazy;
5293
+ reactIs_development.isMemo = isMemo;
5294
+ reactIs_development.isPortal = isPortal;
5295
+ reactIs_development.isProfiler = isProfiler;
5296
+ reactIs_development.isStrictMode = isStrictMode;
5297
+ reactIs_development.isSuspense = isSuspense;
5298
+ reactIs_development.isValidElementType = isValidElementType;
5299
+ reactIs_development.typeOf = typeOf;
5300
+ })();
5301
+ }
5302
+ return reactIs_development;
5303
+ }
5304
+ var hasRequiredReactIs;
5305
+ function requireReactIs() {
5306
+ if (hasRequiredReactIs) return reactIs.exports;
5307
+ hasRequiredReactIs = 1;
5308
+ if (process.env.NODE_ENV === 'production') {
5309
+ reactIs.exports = requireReactIs_production_min();
5310
+ } else {
5311
+ reactIs.exports = requireReactIs_development();
5312
+ }
5313
+ return reactIs.exports;
5314
+ }
5315
+
5316
+ /*
5317
+ object-assign
5318
+ (c) Sindre Sorhus
5319
+ @license MIT
5320
+ */
5321
+
5322
+ var objectAssign;
5323
+ var hasRequiredObjectAssign;
5324
+ function requireObjectAssign() {
5325
+ if (hasRequiredObjectAssign) return objectAssign;
5326
+ hasRequiredObjectAssign = 1;
5327
+ /* eslint-disable no-unused-vars */
5328
+ var getOwnPropertySymbols = Object.getOwnPropertySymbols;
5329
+ var hasOwnProperty = Object.prototype.hasOwnProperty;
5330
+ var propIsEnumerable = Object.prototype.propertyIsEnumerable;
5331
+ function toObject(val) {
5332
+ if (val === null || val === undefined) {
5333
+ throw new TypeError('Object.assign cannot be called with null or undefined');
5334
+ }
5335
+ return Object(val);
5336
+ }
5337
+ function shouldUseNative() {
5338
+ try {
5339
+ if (!Object.assign) {
5340
+ return false;
5341
+ }
5342
+
5343
+ // Detect buggy property enumeration order in older V8 versions.
5344
+
5345
+ // https://bugs.chromium.org/p/v8/issues/detail?id=4118
5346
+ var test1 = new String('abc'); // eslint-disable-line no-new-wrappers
5347
+ test1[5] = 'de';
5348
+ if (Object.getOwnPropertyNames(test1)[0] === '5') {
5349
+ return false;
5350
+ }
5351
+
5352
+ // https://bugs.chromium.org/p/v8/issues/detail?id=3056
5353
+ var test2 = {};
5354
+ for (var i = 0; i < 10; i++) {
5355
+ test2['_' + String.fromCharCode(i)] = i;
5356
+ }
5357
+ var order2 = Object.getOwnPropertyNames(test2).map(function (n) {
5358
+ return test2[n];
5359
+ });
5360
+ if (order2.join('') !== '0123456789') {
5361
+ return false;
5362
+ }
5363
+
5364
+ // https://bugs.chromium.org/p/v8/issues/detail?id=3056
5365
+ var test3 = {};
5366
+ 'abcdefghijklmnopqrst'.split('').forEach(function (letter) {
5367
+ test3[letter] = letter;
5368
+ });
5369
+ if (Object.keys(Object.assign({}, test3)).join('') !== 'abcdefghijklmnopqrst') {
5370
+ return false;
5371
+ }
5372
+ return true;
5373
+ } catch (err) {
5374
+ // We don't expect any of the above to throw, but better to be safe.
5375
+ return false;
5376
+ }
5377
+ }
5378
+ objectAssign = shouldUseNative() ? Object.assign : function (target, source) {
5379
+ var from;
5380
+ var to = toObject(target);
5381
+ var symbols;
5382
+ for (var s = 1; s < arguments.length; s++) {
5383
+ from = Object(arguments[s]);
5384
+ for (var key in from) {
5385
+ if (hasOwnProperty.call(from, key)) {
5386
+ to[key] = from[key];
5387
+ }
5388
+ }
5389
+ if (getOwnPropertySymbols) {
5390
+ symbols = getOwnPropertySymbols(from);
5391
+ for (var i = 0; i < symbols.length; i++) {
5392
+ if (propIsEnumerable.call(from, symbols[i])) {
5393
+ to[symbols[i]] = from[symbols[i]];
5394
+ }
5395
+ }
5396
+ }
5397
+ }
5398
+ return to;
5399
+ };
5400
+ return objectAssign;
5401
+ }
5402
+
5403
+ /**
5404
+ * Copyright (c) 2013-present, Facebook, Inc.
5405
+ *
5406
+ * This source code is licensed under the MIT license found in the
5407
+ * LICENSE file in the root directory of this source tree.
5408
+ */
5409
+
5410
+ var ReactPropTypesSecret_1;
5411
+ var hasRequiredReactPropTypesSecret;
5412
+ function requireReactPropTypesSecret() {
5413
+ if (hasRequiredReactPropTypesSecret) return ReactPropTypesSecret_1;
5414
+ hasRequiredReactPropTypesSecret = 1;
5415
+ var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
5416
+ ReactPropTypesSecret_1 = ReactPropTypesSecret;
5417
+ return ReactPropTypesSecret_1;
5418
+ }
5419
+ var has;
5420
+ var hasRequiredHas;
5421
+ function requireHas() {
5422
+ if (hasRequiredHas) return has;
5423
+ hasRequiredHas = 1;
5424
+ has = Function.call.bind(Object.prototype.hasOwnProperty);
5425
+ return has;
5426
+ }
5427
+
5428
+ /**
5429
+ * Copyright (c) 2013-present, Facebook, Inc.
5430
+ *
5431
+ * This source code is licensed under the MIT license found in the
5432
+ * LICENSE file in the root directory of this source tree.
5433
+ */
5434
+
5435
+ var checkPropTypes_1;
5436
+ var hasRequiredCheckPropTypes;
5437
+ function requireCheckPropTypes() {
5438
+ if (hasRequiredCheckPropTypes) return checkPropTypes_1;
5439
+ hasRequiredCheckPropTypes = 1;
5440
+ var printWarning = function () {};
5441
+ if (process.env.NODE_ENV !== 'production') {
5442
+ var ReactPropTypesSecret = /*@__PURE__*/requireReactPropTypesSecret();
5443
+ var loggedTypeFailures = {};
5444
+ var has = /*@__PURE__*/requireHas();
5445
+ printWarning = function (text) {
5446
+ var message = 'Warning: ' + text;
5447
+ if (typeof console !== 'undefined') {
5448
+ console.error(message);
5449
+ }
5450
+ try {
5451
+ // --- Welcome to debugging React ---
5452
+ // This error was thrown as a convenience so that you can use this stack
5453
+ // to find the callsite that caused this warning to fire.
5454
+ throw new Error(message);
5455
+ } catch (x) {/**/}
5456
+ };
5457
+ }
5458
+
5459
+ /**
5460
+ * Assert that the values match with the type specs.
5461
+ * Error messages are memorized and will only be shown once.
5462
+ *
5463
+ * @param {object} typeSpecs Map of name to a ReactPropType
5464
+ * @param {object} values Runtime values that need to be type-checked
5465
+ * @param {string} location e.g. "prop", "context", "child context"
5466
+ * @param {string} componentName Name of the component for error messages.
5467
+ * @param {?Function} getStack Returns the component stack.
5468
+ * @private
5469
+ */
5470
+ function checkPropTypes(typeSpecs, values, location, componentName, getStack) {
5471
+ if (process.env.NODE_ENV !== 'production') {
5472
+ for (var typeSpecName in typeSpecs) {
5473
+ if (has(typeSpecs, typeSpecName)) {
5474
+ var error;
5475
+ // Prop type validation may throw. In case they do, we don't want to
5476
+ // fail the render phase where it didn't fail before. So we log it.
5477
+ // After these have been cleaned up, we'll let them throw.
5478
+ try {
5479
+ // This is intentionally an invariant that gets caught. It's the same
5480
+ // behavior as without this statement except with a better message.
5481
+ if (typeof typeSpecs[typeSpecName] !== 'function') {
5482
+ var err = Error((componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' + 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.' + 'This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.');
5483
+ err.name = 'Invariant Violation';
5484
+ throw err;
5485
+ }
5486
+ error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret);
5487
+ } catch (ex) {
5488
+ error = ex;
5489
+ }
5490
+ if (error && !(error instanceof Error)) {
5491
+ printWarning((componentName || 'React class') + ': type specification of ' + location + ' `' + typeSpecName + '` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a ' + typeof error + '. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).');
5492
+ }
5493
+ if (error instanceof Error && !(error.message in loggedTypeFailures)) {
5494
+ // Only monitor this failure once because there tends to be a lot of the
5495
+ // same error.
5496
+ loggedTypeFailures[error.message] = true;
5497
+ var stack = getStack ? getStack() : '';
5498
+ printWarning('Failed ' + location + ' type: ' + error.message + (stack != null ? stack : ''));
5499
+ }
5500
+ }
5501
+ }
5502
+ }
5503
+ }
5504
+
5505
+ /**
5506
+ * Resets warning cache when testing.
5507
+ *
5508
+ * @private
5509
+ */
5510
+ checkPropTypes.resetWarningCache = function () {
5511
+ if (process.env.NODE_ENV !== 'production') {
5512
+ loggedTypeFailures = {};
5513
+ }
5514
+ };
5515
+ checkPropTypes_1 = checkPropTypes;
5516
+ return checkPropTypes_1;
5517
+ }
5518
+
5519
+ /**
5520
+ * Copyright (c) 2013-present, Facebook, Inc.
5521
+ *
5522
+ * This source code is licensed under the MIT license found in the
5523
+ * LICENSE file in the root directory of this source tree.
5524
+ */
5525
+
5526
+ var factoryWithTypeCheckers;
5527
+ var hasRequiredFactoryWithTypeCheckers;
5528
+ function requireFactoryWithTypeCheckers() {
5529
+ if (hasRequiredFactoryWithTypeCheckers) return factoryWithTypeCheckers;
5530
+ hasRequiredFactoryWithTypeCheckers = 1;
5531
+ var ReactIs = requireReactIs();
5532
+ var assign = requireObjectAssign();
5533
+ var ReactPropTypesSecret = /*@__PURE__*/requireReactPropTypesSecret();
5534
+ var has = /*@__PURE__*/requireHas();
5535
+ var checkPropTypes = /*@__PURE__*/requireCheckPropTypes();
5536
+ var printWarning = function () {};
5537
+ if (process.env.NODE_ENV !== 'production') {
5538
+ printWarning = function (text) {
5539
+ var message = 'Warning: ' + text;
5540
+ if (typeof console !== 'undefined') {
5541
+ console.error(message);
5542
+ }
5543
+ try {
5544
+ // --- Welcome to debugging React ---
5545
+ // This error was thrown as a convenience so that you can use this stack
5546
+ // to find the callsite that caused this warning to fire.
5547
+ throw new Error(message);
5548
+ } catch (x) {}
5549
+ };
5550
+ }
5551
+ function emptyFunctionThatReturnsNull() {
5552
+ return null;
5553
+ }
5554
+ factoryWithTypeCheckers = function (isValidElement, throwOnDirectAccess) {
5555
+ /* global Symbol */
5556
+ var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
5557
+ var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec.
5558
+
5559
+ /**
5560
+ * Returns the iterator method function contained on the iterable object.
5561
+ *
5562
+ * Be sure to invoke the function with the iterable as context:
5563
+ *
5564
+ * var iteratorFn = getIteratorFn(myIterable);
5565
+ * if (iteratorFn) {
5566
+ * var iterator = iteratorFn.call(myIterable);
5567
+ * ...
5568
+ * }
5569
+ *
5570
+ * @param {?object} maybeIterable
5571
+ * @return {?function}
5572
+ */
5573
+ function getIteratorFn(maybeIterable) {
5574
+ var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]);
5575
+ if (typeof iteratorFn === 'function') {
5576
+ return iteratorFn;
5577
+ }
5578
+ }
5579
+
5580
+ /**
5581
+ * Collection of methods that allow declaration and validation of props that are
5582
+ * supplied to React components. Example usage:
5583
+ *
5584
+ * var Props = require('ReactPropTypes');
5585
+ * var MyArticle = React.createClass({
5586
+ * propTypes: {
5587
+ * // An optional string prop named "description".
5588
+ * description: Props.string,
5589
+ *
5590
+ * // A required enum prop named "category".
5591
+ * category: Props.oneOf(['News','Photos']).isRequired,
5592
+ *
5593
+ * // A prop named "dialog" that requires an instance of Dialog.
5594
+ * dialog: Props.instanceOf(Dialog).isRequired
5595
+ * },
5596
+ * render: function() { ... }
5597
+ * });
5598
+ *
5599
+ * A more formal specification of how these methods are used:
5600
+ *
5601
+ * type := array|bool|func|object|number|string|oneOf([...])|instanceOf(...)
5602
+ * decl := ReactPropTypes.{type}(.isRequired)?
5603
+ *
5604
+ * Each and every declaration produces a function with the same signature. This
5605
+ * allows the creation of custom validation functions. For example:
5606
+ *
5607
+ * var MyLink = React.createClass({
5608
+ * propTypes: {
5609
+ * // An optional string or URI prop named "href".
5610
+ * href: function(props, propName, componentName) {
5611
+ * var propValue = props[propName];
5612
+ * if (propValue != null && typeof propValue !== 'string' &&
5613
+ * !(propValue instanceof URI)) {
5614
+ * return new Error(
5615
+ * 'Expected a string or an URI for ' + propName + ' in ' +
5616
+ * componentName
5617
+ * );
5618
+ * }
5619
+ * }
5620
+ * },
5621
+ * render: function() {...}
5622
+ * });
5623
+ *
5624
+ * @internal
5625
+ */
5626
+
5627
+ var ANONYMOUS = '<<anonymous>>';
5628
+
5629
+ // Important!
5630
+ // Keep this list in sync with production version in `./factoryWithThrowingShims.js`.
5631
+ var ReactPropTypes = {
5632
+ array: createPrimitiveTypeChecker('array'),
5633
+ bigint: createPrimitiveTypeChecker('bigint'),
5634
+ bool: createPrimitiveTypeChecker('boolean'),
5635
+ func: createPrimitiveTypeChecker('function'),
5636
+ number: createPrimitiveTypeChecker('number'),
5637
+ object: createPrimitiveTypeChecker('object'),
5638
+ string: createPrimitiveTypeChecker('string'),
5639
+ symbol: createPrimitiveTypeChecker('symbol'),
5640
+ any: createAnyTypeChecker(),
5641
+ arrayOf: createArrayOfTypeChecker,
5642
+ element: createElementTypeChecker(),
5643
+ elementType: createElementTypeTypeChecker(),
5644
+ instanceOf: createInstanceTypeChecker,
5645
+ node: createNodeChecker(),
5646
+ objectOf: createObjectOfTypeChecker,
5647
+ oneOf: createEnumTypeChecker,
5648
+ oneOfType: createUnionTypeChecker,
5649
+ shape: createShapeTypeChecker,
5650
+ exact: createStrictShapeTypeChecker
5651
+ };
5652
+
5653
+ /**
5654
+ * inlined Object.is polyfill to avoid requiring consumers ship their own
5655
+ * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is
5656
+ */
5657
+ /*eslint-disable no-self-compare*/
5658
+ function is(x, y) {
5659
+ // SameValue algorithm
5660
+ if (x === y) {
5661
+ // Steps 1-5, 7-10
5662
+ // Steps 6.b-6.e: +0 != -0
5663
+ return x !== 0 || 1 / x === 1 / y;
5664
+ } else {
5665
+ // Step 6.a: NaN == NaN
5666
+ return x !== x && y !== y;
5667
+ }
5668
+ }
5669
+ /*eslint-enable no-self-compare*/
5670
+
5671
+ /**
5672
+ * We use an Error-like object for backward compatibility as people may call
5673
+ * PropTypes directly and inspect their output. However, we don't use real
5674
+ * Errors anymore. We don't inspect their stack anyway, and creating them
5675
+ * is prohibitively expensive if they are created too often, such as what
5676
+ * happens in oneOfType() for any type before the one that matched.
5677
+ */
5678
+ function PropTypeError(message, data) {
5679
+ this.message = message;
5680
+ this.data = data && typeof data === 'object' ? data : {};
5681
+ this.stack = '';
5682
+ }
5683
+ // Make `instanceof Error` still work for returned errors.
5684
+ PropTypeError.prototype = Error.prototype;
5685
+ function createChainableTypeChecker(validate) {
5686
+ if (process.env.NODE_ENV !== 'production') {
5687
+ var manualPropTypeCallCache = {};
5688
+ var manualPropTypeWarningCount = 0;
5689
+ }
5690
+ function checkType(isRequired, props, propName, componentName, location, propFullName, secret) {
5691
+ componentName = componentName || ANONYMOUS;
5692
+ propFullName = propFullName || propName;
5693
+ if (secret !== ReactPropTypesSecret) {
5694
+ if (throwOnDirectAccess) {
5695
+ // New behavior only for users of `prop-types` package
5696
+ var err = new Error('Calling PropTypes validators directly is not supported by the `prop-types` package. ' + 'Use `PropTypes.checkPropTypes()` to call them. ' + 'Read more at http://fb.me/use-check-prop-types');
5697
+ err.name = 'Invariant Violation';
5698
+ throw err;
5699
+ } else if (process.env.NODE_ENV !== 'production' && typeof console !== 'undefined') {
5700
+ // Old behavior for people using React.PropTypes
5701
+ var cacheKey = componentName + ':' + propName;
5702
+ if (!manualPropTypeCallCache[cacheKey] &&
5703
+ // Avoid spamming the console because they are often not actionable except for lib authors
5704
+ manualPropTypeWarningCount < 3) {
5705
+ printWarning('You are manually calling a React.PropTypes validation ' + 'function for the `' + propFullName + '` prop on `' + componentName + '`. This is deprecated ' + 'and will throw in the standalone `prop-types` package. ' + 'You may be seeing this warning due to a third-party PropTypes ' + 'library. See https://fb.me/react-warning-dont-call-proptypes ' + 'for details.');
5706
+ manualPropTypeCallCache[cacheKey] = true;
5707
+ manualPropTypeWarningCount++;
5708
+ }
5709
+ }
5710
+ }
5711
+ if (props[propName] == null) {
5712
+ if (isRequired) {
5713
+ if (props[propName] === null) {
5714
+ return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required ' + ('in `' + componentName + '`, but its value is `null`.'));
5715
+ }
5716
+ return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required in ' + ('`' + componentName + '`, but its value is `undefined`.'));
5717
+ }
5718
+ return null;
5719
+ } else {
5720
+ return validate(props, propName, componentName, location, propFullName);
5721
+ }
5722
+ }
5723
+ var chainedCheckType = checkType.bind(null, false);
5724
+ chainedCheckType.isRequired = checkType.bind(null, true);
5725
+ return chainedCheckType;
5726
+ }
5727
+ function createPrimitiveTypeChecker(expectedType) {
5728
+ function validate(props, propName, componentName, location, propFullName, secret) {
5729
+ var propValue = props[propName];
5730
+ var propType = getPropType(propValue);
5731
+ if (propType !== expectedType) {
5732
+ // `propValue` being instance of, say, date/regexp, pass the 'object'
5733
+ // check, but we can offer a more precise error message here rather than
5734
+ // 'of type `object`'.
5735
+ var preciseType = getPreciseType(propValue);
5736
+ return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.'), {
5737
+ expectedType: expectedType
5738
+ });
5739
+ }
5740
+ return null;
5741
+ }
5742
+ return createChainableTypeChecker(validate);
5743
+ }
5744
+ function createAnyTypeChecker() {
5745
+ return createChainableTypeChecker(emptyFunctionThatReturnsNull);
5746
+ }
5747
+ function createArrayOfTypeChecker(typeChecker) {
5748
+ function validate(props, propName, componentName, location, propFullName) {
5749
+ if (typeof typeChecker !== 'function') {
5750
+ return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside arrayOf.');
5751
+ }
5752
+ var propValue = props[propName];
5753
+ if (!Array.isArray(propValue)) {
5754
+ var propType = getPropType(propValue);
5755
+ return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an array.'));
5756
+ }
5757
+ for (var i = 0; i < propValue.length; i++) {
5758
+ var error = typeChecker(propValue, i, componentName, location, propFullName + '[' + i + ']', ReactPropTypesSecret);
5759
+ if (error instanceof Error) {
5760
+ return error;
5761
+ }
5762
+ }
5763
+ return null;
5764
+ }
5765
+ return createChainableTypeChecker(validate);
5766
+ }
5767
+ function createElementTypeChecker() {
5768
+ function validate(props, propName, componentName, location, propFullName) {
5769
+ var propValue = props[propName];
5770
+ if (!isValidElement(propValue)) {
5771
+ var propType = getPropType(propValue);
5772
+ return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement.'));
5773
+ }
5774
+ return null;
5775
+ }
5776
+ return createChainableTypeChecker(validate);
5777
+ }
5778
+ function createElementTypeTypeChecker() {
5779
+ function validate(props, propName, componentName, location, propFullName) {
5780
+ var propValue = props[propName];
5781
+ if (!ReactIs.isValidElementType(propValue)) {
5782
+ var propType = getPropType(propValue);
5783
+ return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement type.'));
5784
+ }
5785
+ return null;
5786
+ }
5787
+ return createChainableTypeChecker(validate);
5788
+ }
5789
+ function createInstanceTypeChecker(expectedClass) {
5790
+ function validate(props, propName, componentName, location, propFullName) {
5791
+ if (!(props[propName] instanceof expectedClass)) {
5792
+ var expectedClassName = expectedClass.name || ANONYMOUS;
5793
+ var actualClassName = getClassName(props[propName]);
5794
+ return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + actualClassName + '` supplied to `' + componentName + '`, expected ') + ('instance of `' + expectedClassName + '`.'));
5795
+ }
5796
+ return null;
5797
+ }
5798
+ return createChainableTypeChecker(validate);
5799
+ }
5800
+ function createEnumTypeChecker(expectedValues) {
5801
+ if (!Array.isArray(expectedValues)) {
5802
+ if (process.env.NODE_ENV !== 'production') {
5803
+ if (arguments.length > 1) {
5804
+ printWarning('Invalid arguments supplied to oneOf, expected an array, got ' + arguments.length + ' arguments. ' + 'A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z]).');
5805
+ } else {
5806
+ printWarning('Invalid argument supplied to oneOf, expected an array.');
5807
+ }
5808
+ }
5809
+ return emptyFunctionThatReturnsNull;
5810
+ }
5811
+ function validate(props, propName, componentName, location, propFullName) {
5812
+ var propValue = props[propName];
5813
+ for (var i = 0; i < expectedValues.length; i++) {
5814
+ if (is(propValue, expectedValues[i])) {
5815
+ return null;
5816
+ }
5817
+ }
5818
+ var valuesString = JSON.stringify(expectedValues, function replacer(key, value) {
5819
+ var type = getPreciseType(value);
5820
+ if (type === 'symbol') {
5821
+ return String(value);
5822
+ }
5823
+ return value;
5824
+ });
5825
+ return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of value `' + String(propValue) + '` ' + ('supplied to `' + componentName + '`, expected one of ' + valuesString + '.'));
5826
+ }
5827
+ return createChainableTypeChecker(validate);
5828
+ }
5829
+ function createObjectOfTypeChecker(typeChecker) {
5830
+ function validate(props, propName, componentName, location, propFullName) {
5831
+ if (typeof typeChecker !== 'function') {
5832
+ return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside objectOf.');
5833
+ }
5834
+ var propValue = props[propName];
5835
+ var propType = getPropType(propValue);
5836
+ if (propType !== 'object') {
5837
+ return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an object.'));
5838
+ }
5839
+ for (var key in propValue) {
5840
+ if (has(propValue, key)) {
5841
+ var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
5842
+ if (error instanceof Error) {
5843
+ return error;
5844
+ }
5845
+ }
5846
+ }
5847
+ return null;
5848
+ }
5849
+ return createChainableTypeChecker(validate);
5850
+ }
5851
+ function createUnionTypeChecker(arrayOfTypeCheckers) {
5852
+ if (!Array.isArray(arrayOfTypeCheckers)) {
5853
+ process.env.NODE_ENV !== 'production' ? printWarning('Invalid argument supplied to oneOfType, expected an instance of array.') : void 0;
5854
+ return emptyFunctionThatReturnsNull;
5855
+ }
5856
+ for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
5857
+ var checker = arrayOfTypeCheckers[i];
5858
+ if (typeof checker !== 'function') {
5859
+ printWarning('Invalid argument supplied to oneOfType. Expected an array of check functions, but ' + 'received ' + getPostfixForTypeWarning(checker) + ' at index ' + i + '.');
5860
+ return emptyFunctionThatReturnsNull;
5861
+ }
5862
+ }
5863
+ function validate(props, propName, componentName, location, propFullName) {
5864
+ var expectedTypes = [];
5865
+ for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
5866
+ var checker = arrayOfTypeCheckers[i];
5867
+ var checkerResult = checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret);
5868
+ if (checkerResult == null) {
5869
+ return null;
5870
+ }
5871
+ if (checkerResult.data && has(checkerResult.data, 'expectedType')) {
5872
+ expectedTypes.push(checkerResult.data.expectedType);
5873
+ }
5874
+ }
5875
+ var expectedTypesMessage = expectedTypes.length > 0 ? ', expected one of type [' + expectedTypes.join(', ') + ']' : '';
5876
+ return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`' + expectedTypesMessage + '.'));
5877
+ }
5878
+ return createChainableTypeChecker(validate);
5879
+ }
5880
+ function createNodeChecker() {
5881
+ function validate(props, propName, componentName, location, propFullName) {
5882
+ if (!isNode(props[propName])) {
5883
+ return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a ReactNode.'));
5884
+ }
5885
+ return null;
5886
+ }
5887
+ return createChainableTypeChecker(validate);
5888
+ }
5889
+ function invalidValidatorError(componentName, location, propFullName, key, type) {
5890
+ return new PropTypeError((componentName || 'React class') + ': ' + location + ' type `' + propFullName + '.' + key + '` is invalid; ' + 'it must be a function, usually from the `prop-types` package, but received `' + type + '`.');
5891
+ }
5892
+ function createShapeTypeChecker(shapeTypes) {
5893
+ function validate(props, propName, componentName, location, propFullName) {
5894
+ var propValue = props[propName];
5895
+ var propType = getPropType(propValue);
5896
+ if (propType !== 'object') {
5897
+ return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
5898
+ }
5899
+ for (var key in shapeTypes) {
5900
+ var checker = shapeTypes[key];
5901
+ if (typeof checker !== 'function') {
5902
+ return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker));
5903
+ }
5904
+ var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
5905
+ if (error) {
5906
+ return error;
5907
+ }
5908
+ }
5909
+ return null;
5910
+ }
5911
+ return createChainableTypeChecker(validate);
5912
+ }
5913
+ function createStrictShapeTypeChecker(shapeTypes) {
5914
+ function validate(props, propName, componentName, location, propFullName) {
5915
+ var propValue = props[propName];
5916
+ var propType = getPropType(propValue);
5917
+ if (propType !== 'object') {
5918
+ return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
5919
+ }
5920
+ // We need to check all keys in case some are required but missing from props.
5921
+ var allKeys = assign({}, props[propName], shapeTypes);
5922
+ for (var key in allKeys) {
5923
+ var checker = shapeTypes[key];
5924
+ if (has(shapeTypes, key) && typeof checker !== 'function') {
5925
+ return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker));
5926
+ }
5927
+ if (!checker) {
5928
+ return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` key `' + key + '` supplied to `' + componentName + '`.' + '\nBad object: ' + JSON.stringify(props[propName], null, ' ') + '\nValid keys: ' + JSON.stringify(Object.keys(shapeTypes), null, ' '));
5929
+ }
5930
+ var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
5931
+ if (error) {
5932
+ return error;
5933
+ }
5934
+ }
5935
+ return null;
5936
+ }
5937
+ return createChainableTypeChecker(validate);
5938
+ }
5939
+ function isNode(propValue) {
5940
+ switch (typeof propValue) {
5941
+ case 'number':
5942
+ case 'string':
5943
+ case 'undefined':
5944
+ return true;
5945
+ case 'boolean':
5946
+ return !propValue;
5947
+ case 'object':
5948
+ if (Array.isArray(propValue)) {
5949
+ return propValue.every(isNode);
5950
+ }
5951
+ if (propValue === null || isValidElement(propValue)) {
5952
+ return true;
5953
+ }
5954
+ var iteratorFn = getIteratorFn(propValue);
5955
+ if (iteratorFn) {
5956
+ var iterator = iteratorFn.call(propValue);
5957
+ var step;
5958
+ if (iteratorFn !== propValue.entries) {
5959
+ while (!(step = iterator.next()).done) {
5960
+ if (!isNode(step.value)) {
5961
+ return false;
5962
+ }
5963
+ }
5964
+ } else {
5965
+ // Iterator will provide entry [k,v] tuples rather than values.
5966
+ while (!(step = iterator.next()).done) {
5967
+ var entry = step.value;
5968
+ if (entry) {
5969
+ if (!isNode(entry[1])) {
5970
+ return false;
5971
+ }
5972
+ }
5973
+ }
5974
+ }
5975
+ } else {
5976
+ return false;
5977
+ }
5978
+ return true;
5979
+ default:
5980
+ return false;
5981
+ }
5982
+ }
5983
+ function isSymbol(propType, propValue) {
5984
+ // Native Symbol.
5985
+ if (propType === 'symbol') {
5986
+ return true;
5987
+ }
5988
+
5989
+ // falsy value can't be a Symbol
5990
+ if (!propValue) {
5991
+ return false;
5992
+ }
5993
+
5994
+ // 19.4.3.5 Symbol.prototype[@@toStringTag] === 'Symbol'
5995
+ if (propValue['@@toStringTag'] === 'Symbol') {
5996
+ return true;
5997
+ }
5998
+
5999
+ // Fallback for non-spec compliant Symbols which are polyfilled.
6000
+ if (typeof Symbol === 'function' && propValue instanceof Symbol) {
6001
+ return true;
6002
+ }
6003
+ return false;
6004
+ }
6005
+
6006
+ // Equivalent of `typeof` but with special handling for array and regexp.
6007
+ function getPropType(propValue) {
6008
+ var propType = typeof propValue;
6009
+ if (Array.isArray(propValue)) {
6010
+ return 'array';
6011
+ }
6012
+ if (propValue instanceof RegExp) {
6013
+ // Old webkits (at least until Android 4.0) return 'function' rather than
6014
+ // 'object' for typeof a RegExp. We'll normalize this here so that /bla/
6015
+ // passes PropTypes.object.
6016
+ return 'object';
6017
+ }
6018
+ if (isSymbol(propType, propValue)) {
6019
+ return 'symbol';
6020
+ }
6021
+ return propType;
6022
+ }
6023
+
6024
+ // This handles more types than `getPropType`. Only used for error messages.
6025
+ // See `createPrimitiveTypeChecker`.
6026
+ function getPreciseType(propValue) {
6027
+ if (typeof propValue === 'undefined' || propValue === null) {
6028
+ return '' + propValue;
6029
+ }
6030
+ var propType = getPropType(propValue);
6031
+ if (propType === 'object') {
6032
+ if (propValue instanceof Date) {
6033
+ return 'date';
6034
+ } else if (propValue instanceof RegExp) {
6035
+ return 'regexp';
6036
+ }
6037
+ }
6038
+ return propType;
6039
+ }
6040
+
6041
+ // Returns a string that is postfixed to a warning about an invalid type.
6042
+ // For example, "undefined" or "of type array"
6043
+ function getPostfixForTypeWarning(value) {
6044
+ var type = getPreciseType(value);
6045
+ switch (type) {
6046
+ case 'array':
6047
+ case 'object':
6048
+ return 'an ' + type;
6049
+ case 'boolean':
6050
+ case 'date':
6051
+ case 'regexp':
6052
+ return 'a ' + type;
6053
+ default:
6054
+ return type;
6055
+ }
6056
+ }
6057
+
6058
+ // Returns class name of the object, if any.
6059
+ function getClassName(propValue) {
6060
+ if (!propValue.constructor || !propValue.constructor.name) {
6061
+ return ANONYMOUS;
6062
+ }
6063
+ return propValue.constructor.name;
6064
+ }
6065
+ ReactPropTypes.checkPropTypes = checkPropTypes;
6066
+ ReactPropTypes.resetWarningCache = checkPropTypes.resetWarningCache;
6067
+ ReactPropTypes.PropTypes = ReactPropTypes;
6068
+ return ReactPropTypes;
6069
+ };
6070
+ return factoryWithTypeCheckers;
6071
+ }
6072
+
6073
+ /**
6074
+ * Copyright (c) 2013-present, Facebook, Inc.
6075
+ *
6076
+ * This source code is licensed under the MIT license found in the
6077
+ * LICENSE file in the root directory of this source tree.
6078
+ */
6079
+
6080
+ var factoryWithThrowingShims;
6081
+ var hasRequiredFactoryWithThrowingShims;
6082
+ function requireFactoryWithThrowingShims() {
6083
+ if (hasRequiredFactoryWithThrowingShims) return factoryWithThrowingShims;
6084
+ hasRequiredFactoryWithThrowingShims = 1;
6085
+ var ReactPropTypesSecret = /*@__PURE__*/requireReactPropTypesSecret();
6086
+ function emptyFunction() {}
6087
+ function emptyFunctionWithReset() {}
6088
+ emptyFunctionWithReset.resetWarningCache = emptyFunction;
6089
+ factoryWithThrowingShims = function () {
6090
+ function shim(props, propName, componentName, location, propFullName, secret) {
6091
+ if (secret === ReactPropTypesSecret) {
6092
+ // It is still safe when called from React.
6093
+ return;
6094
+ }
6095
+ var err = new Error('Calling PropTypes validators directly is not supported by the `prop-types` package. ' + 'Use PropTypes.checkPropTypes() to call them. ' + 'Read more at http://fb.me/use-check-prop-types');
6096
+ err.name = 'Invariant Violation';
6097
+ throw err;
6098
+ }
6099
+ shim.isRequired = shim;
6100
+ function getShim() {
6101
+ return shim;
6102
+ } // Important!
6103
+ // Keep this list in sync with production version in `./factoryWithTypeCheckers.js`.
6104
+ var ReactPropTypes = {
6105
+ array: shim,
6106
+ bigint: shim,
6107
+ bool: shim,
6108
+ func: shim,
6109
+ number: shim,
6110
+ object: shim,
6111
+ string: shim,
6112
+ symbol: shim,
6113
+ any: shim,
6114
+ arrayOf: getShim,
6115
+ element: shim,
6116
+ elementType: shim,
6117
+ instanceOf: getShim,
6118
+ node: shim,
6119
+ objectOf: getShim,
6120
+ oneOf: getShim,
6121
+ oneOfType: getShim,
6122
+ shape: getShim,
6123
+ exact: getShim,
6124
+ checkPropTypes: emptyFunctionWithReset,
6125
+ resetWarningCache: emptyFunction
6126
+ };
6127
+ ReactPropTypes.PropTypes = ReactPropTypes;
6128
+ return ReactPropTypes;
6129
+ };
6130
+ return factoryWithThrowingShims;
6131
+ }
6132
+
6133
+ /**
6134
+ * Copyright (c) 2013-present, Facebook, Inc.
6135
+ *
6136
+ * This source code is licensed under the MIT license found in the
6137
+ * LICENSE file in the root directory of this source tree.
6138
+ */
6139
+
6140
+ var hasRequiredPropTypes;
6141
+ function requirePropTypes() {
6142
+ if (hasRequiredPropTypes) return propTypes.exports;
6143
+ hasRequiredPropTypes = 1;
6144
+ if (process.env.NODE_ENV !== 'production') {
6145
+ var ReactIs = requireReactIs();
6146
+
6147
+ // By explicitly using `prop-types` you are opting into new development behavior.
6148
+ // http://fb.me/prop-types-in-prod
6149
+ var throwOnDirectAccess = true;
6150
+ propTypes.exports = /*@__PURE__*/requireFactoryWithTypeCheckers()(ReactIs.isElement, throwOnDirectAccess);
6151
+ } else {
6152
+ // By explicitly using `prop-types` you are opting into new production behavior.
6153
+ // http://fb.me/prop-types-in-prod
6154
+ propTypes.exports = /*@__PURE__*/requireFactoryWithThrowingShims()();
6155
+ }
6156
+ return propTypes.exports;
6157
+ }
6158
+ var propTypesExports = /*@__PURE__*/requirePropTypes();
6159
+ var PropTypes = /*@__PURE__*/getDefaultExportFromCjs(propTypesExports);
6160
+ ({
6161
+ onPowerOff: PropTypes.func,
6162
+ onRestart: PropTypes.func,
6163
+ powerOffLabel: PropTypes.string,
6164
+ restartLabel: PropTypes.string,
6165
+ iconClassName: PropTypes.string,
6166
+ confirmTitle: PropTypes.string,
6167
+ cancelText: PropTypes.string,
6168
+ okText: PropTypes.string,
6169
+ run: PropTypes.func
6170
+ });
6171
+ ({
6172
+ logoUrl: PropTypes.string,
6173
+ logoWidth: PropTypes.number,
6174
+ logoAlt: PropTypes.string,
6175
+ onClick: PropTypes.func
6176
+ });
6177
+
6178
+ // PropTypes 类型检查
6179
+ ({
6180
+ menuElement: PropTypes.node,
6181
+ productInfo: PropTypes.shape({
6182
+ productName: PropTypes.string,
6183
+ version: PropTypes.string
6184
+ }),
6185
+ showLogo: PropTypes.bool,
6186
+ showProductInfo: PropTypes.bool,
6187
+ showHardwareUsage: PropTypes.bool,
6188
+ showSystemOperations: PropTypes.bool,
6189
+ onPowerOff: PropTypes.func,
6190
+ onRestart: PropTypes.func,
6191
+ onRun: PropTypes.func,
6192
+ hardwareMonitorUrl: PropTypes.string,
6193
+ getSocketUrl: PropTypes.func,
6194
+ logoProps: PropTypes.object,
6195
+ className: PropTypes.string,
6196
+ style: PropTypes.object
6197
+ });
6198
+
6199
+ const numberProps = {
6200
+ controls: false,
6201
+ keyboard: false,
6202
+ changeOnWheel: false,
6203
+ precision: 0
6204
+ };
6205
+ const NmosModal = _ref => {
6206
+ let {
6207
+ open,
6208
+ onClose,
6209
+ getNmosSettings,
6210
+ updateNmosSettings,
6211
+ hostAddressOptions = [],
6212
+ modalProps = {},
6213
+ formProps = {}
6214
+ } = _ref;
6215
+ const [nmosSettings, setNmosSettings] = useState(null);
6216
+ const [loading, setLoading] = useState(false);
6217
+ const [form] = Form.useForm();
6218
+ const {
6219
+ message
6220
+ } = App.useApp();
6221
+ useEffect(() => {
6222
+ // 重置表单和状态当 Modal 打开时
6223
+ if (open) {
6224
+ setLoading(true);
6225
+ getNmosSettings().then(data => {
6226
+ if (data) {
6227
+ setNmosSettings(data);
6228
+ // 数据加载后设置表单值
6229
+ form.setFieldsValue({
6230
+ host_addresses: data.host_addresses || [],
6231
+ domain: data.domain,
6232
+ registry_address: data.registry_address,
6233
+ registration_port: data.registration_port,
6234
+ registry_version: data.registry_version,
6235
+ logging_level: data.logging_level
6236
+ });
6237
+ }
6238
+ }).catch(err => {
6239
+ console.error("Failed to fetch settings", err);
6240
+ }).finally(() => {
6241
+ setLoading(false);
6242
+ });
6243
+ } else {
6244
+ // 关闭时重置表单
6245
+ form.resetFields();
6246
+ setNmosSettings(null);
6247
+ }
6248
+ }, [open, form, getNmosSettings]);
6249
+ const handleSubmit = async () => {
6250
+ const values = await form.getFieldsValue();
6251
+ setLoading(true);
6252
+ try {
6253
+ const response = await updateNmosSettings(_objectSpread2(_objectSpread2({}, nmosSettings), values));
6254
+ if (response) {
6255
+ message.success('Success');
6256
+ setTimeout(() => {
6257
+ onClose();
6258
+ }, 1500);
6259
+ }
6260
+ } catch (error) {
6261
+ console.error('Update failed:', error);
6262
+ } finally {
6263
+ setLoading(false);
6264
+ }
6265
+ };
6266
+ return /*#__PURE__*/jsx(StyledModal$3, _objectSpread2(_objectSpread2({
6267
+ title: "NMOS",
6268
+ width: 650,
6269
+ open: open,
6270
+ onOk: handleSubmit,
6271
+ onCancel: onClose,
6272
+ confirmLoading: loading,
6273
+ destroyOnClose: true // 关闭时销毁组件,确保下次打开重新初始化
6274
+ }, modalProps), {}, {
6275
+ children: /*#__PURE__*/jsxs(Form, _objectSpread2(_objectSpread2({
6276
+ form: form,
6277
+ name: "nmosForm",
6278
+ labelCol: {
6279
+ span: 5
6280
+ },
6281
+ wrapperCol: {
6282
+ span: 19
6283
+ },
6284
+ autoComplete: "off",
6285
+ disabled: loading
6286
+ }, formProps), {}, {
6287
+ children: [/*#__PURE__*/jsx(Form.Item, {
6288
+ label: "Host Addresses",
6289
+ name: "host_addresses",
6290
+ children: /*#__PURE__*/jsx(Select, {
6291
+ mode: "multiple",
6292
+ options: hostAddressOptions,
6293
+ fieldNames: {
6294
+ label: "display_name",
6295
+ value: "ip_address"
6296
+ },
6297
+ placeholder: "Select host address",
6298
+ allowClear: true
6299
+ })
6300
+ }), /*#__PURE__*/jsx(Form.Item, {
6301
+ label: "Domain",
6302
+ name: "domain",
6303
+ children: /*#__PURE__*/jsx(Input, {})
6304
+ }), /*#__PURE__*/jsx(Form.Item, {
6305
+ label: "Registry Address",
6306
+ name: "registry_address",
6307
+ children: /*#__PURE__*/jsx(Input, {})
6308
+ }), /*#__PURE__*/jsx(Form.Item, {
6309
+ label: "Registry Port",
6310
+ name: "registration_port",
6311
+ children: /*#__PURE__*/jsx(InputNumber, _objectSpread2(_objectSpread2({}, numberProps), {}, {
6312
+ min: 0,
6313
+ max: 65535,
6314
+ style: {
6315
+ width: '100%'
6316
+ }
6317
+ }))
6318
+ }), /*#__PURE__*/jsx(Form.Item, {
6319
+ label: "Registry Version",
6320
+ name: "registry_version",
6321
+ children: /*#__PURE__*/jsx(Select, {
6322
+ options: [{
6323
+ label: "v1.0",
6324
+ value: "v1.0"
6325
+ }, {
6326
+ label: "v1.1",
6327
+ value: "v1.1"
6328
+ }, {
6329
+ label: "v1.2",
6330
+ value: "v1.2"
6331
+ }, {
6332
+ label: "v1.3",
6333
+ value: "v1.3"
6334
+ }],
6335
+ placeholder: "Select version"
6336
+ })
6337
+ }), /*#__PURE__*/jsx(Form.Item, {
6338
+ label: "Logging Level",
6339
+ name: "logging_level",
6340
+ children: /*#__PURE__*/jsx(InputNumber, _objectSpread2(_objectSpread2({}, numberProps), {}, {
6341
+ min: -40,
6342
+ max: 40,
6343
+ style: {
6344
+ width: '100%'
6345
+ }
6346
+ }))
6347
+ })]
6348
+ }))
6349
+ }));
6350
+ };
6351
+ var NmosModal$1 = /*#__PURE__*/memo(NmosModal);
6352
+
3679
6353
  const _excluded = ["value", "min", "max", "className", "disablePointerLock", "modifierKeys", "decimalPlaces", "onChange", "onDragStart", "onDragEnd", "disabled", "style"];
3680
6354
 
3681
6355
  // 默认配置
@@ -4020,5 +6694,5 @@ function DraggableNumberInput(_ref2) {
4020
6694
  }));
4021
6695
  }
4022
6696
 
4023
- export { AuthorizationModal$1 as AuthorizationModal, CommonHeader$1 as CommonHeader, DraggableNumberInput, LSMLabelField$1 as LSMLabelField, NetworkSettingsModal$1 as NetworkSettingsModal, PresetModal, PtpModal$1 as PtpModal, StyledModal$1 as StyledModal, SystemOperations$1 as SystemOperations, UpgradeManager$1 as UpgradeManager, useAuth, useHardwareUsage$1 as useHardwareUsage, useSystemOperations$1 as useSystemOperations, useUpgrade$1 as useUpgrade };
6697
+ export { AuthorizationModal$1 as AuthorizationModal, CommonHeader$1 as CommonHeader, DraggableNumberInput, LSMLabelField$1 as LSMLabelField, NetworkSettingsModal$1 as NetworkSettingsModal, NmosModal$1 as NmosModal, PresetModal, PtpModal$1 as PtpModal, StyledModal$1 as StyledModal, SystemOperations$1 as SystemOperations, UpgradeManager$1 as UpgradeManager, useAuth, useHardwareUsage$1 as useHardwareUsage, useSystemOperations$1 as useSystemOperations, useUpgrade$1 as useUpgrade };
4024
6698
  //# sourceMappingURL=index.esm.js.map