Version Description
2020-07-22 = - Fix: Update returning customer total to include customers whose first order was within the report date range #4430 - Fix: Fix an error in the Analytics/Orders table when there is an order deleted directly from the database #4630 - Fix: Reselecting advanced filters in the customer list #4650 - Fix: Reporting of deleted coupons #4671 - Fix: Preventing refresh after answering a survey note #4711 - Fix: Regular filters not working #4704 - Fix: React warning in test that the key prop wasn't assigned in List #4808 - Fix: Center continue buttons in the onboarding profile wizard #4082 - Fix: Homepage template used in setup checklist customization task #4807 - Fix: Errant Jetpack activation prompt in Stats Overview home screen widget #4817 - Fix: Unable to activate theme with uppercase name #4393 @ayubadiputra - Fix: Set active theme when OBW is shown via the task list #4834 - Enhancement: Add option to dismiss tasks in Setup Checklist #4733 - Enhancement: Show contextual help menu when working on store setup tasks. #4779 - Enhancement: Add automatic PayPal account creation flow. #4804 - Enhancement: Move the WooCommerce > Coupons dashboard menu item to Marketing > Coupons. #4786 - Tweak: Add education and travel to the onboarding industry types #4694 - Tweak: Refactor Jetpack connection flows #4655 - Tweak: Remove the Composite products option from the onboarding wizard #4703 - Tweak: Refactor tax task to use promise chain #4683 - Tweak: Add bundle install UI to Business Details step #4695 - Tweak: Include Product Bundles and Product Add-ons as OBW product options #4705 - Tweak: Toggle the Physical products checkbox on by default #4702 - Tweak: Variation Names: Allow long names to be shown #4715 - Tweak: Limit inbox status to unactioned notes #4765 - Tweak: Only show usage tracking modal once in OBW. #4766 - Tweak: Add WooCommerce Payments to Setup Checklist. #4793 - Tweak: Update connection flow for Bundle UI #4717 - Tweak: Style improvements for Marketing hub. #4794 - Tweak: Added skip profiler functionality #4721 - Tweak: Reordered home screen tasks #4754 - Tweak: Create single source of truth for task list array #4825 - Tweak: Rework the store details onboarding screen #4771 - Tweak: Design of Product Types step in Onboarding #4707 - Tweak: Add copy that WCS TOS will be accepted upon install #4799 - Dev: Customize webpack jsonpFunction to avoid potential collision with other Webpack bundles #4644 @aaemnnosttv - Dev: Update @wordpress/base-styles and replace deprecated variables #4759
Release Info
Developer | timmydcrawford |
Plugin | WooCommerce Admin |
Version | 1.4.0 |
Comparing to | |
See all releases |
Code changes from version 1.3.2 to 1.4.0
- dist/app/index.js +12336 -12020
@@ -35,7 +35,7 @@ this["wc"] = this["wc"] || {}; this["wc"]["app"] =
|
|
35 |
/******/
|
36 |
/******/ // object to store loaded CSS chunks
|
37 |
/******/ var installedCssChunks = {
|
38 |
-
/******/
|
39 |
/******/ }
|
40 |
/******/ var isCssRtlEnabled = function() {
|
41 |
/******/ return document.dir === 'rtl';
|
@@ -45,14 +45,14 @@ this["wc"] = this["wc"] || {}; this["wc"]["app"] =
|
|
45 |
/******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched
|
46 |
/******/ // Promise = chunk loading, 0 = chunk loaded
|
47 |
/******/ var installedChunks = {
|
48 |
-
/******/
|
49 |
/******/ };
|
50 |
/******/
|
51 |
/******/
|
52 |
/******/
|
53 |
/******/ // script path function
|
54 |
/******/ function jsonpScriptSrc(chunkId) {
|
55 |
-
/******/ return __webpack_require__.p + "chunks/" + chunkId + "." + {"0":"
|
56 |
/******/ }
|
57 |
/******/
|
58 |
/******/ // The require function
|
@@ -86,7 +86,7 @@ this["wc"] = this["wc"] || {}; this["wc"]["app"] =
|
|
86 |
/******/
|
87 |
/******/
|
88 |
/******/ // mini-css-extract-plugin CSS loading
|
89 |
-
/******/ var cssChunks = {"0":1,"
|
90 |
/******/ if(installedCssChunks[chunkId]) promises.push(installedCssChunks[chunkId]);
|
91 |
/******/ else if(installedCssChunks[chunkId] !== 0 && cssChunks[chunkId]) {
|
92 |
/******/ promises.push(installedCssChunks[chunkId] = new Promise(function(resolve, reject) {
|
@@ -238,7 +238,7 @@ this["wc"] = this["wc"] || {}; this["wc"]["app"] =
|
|
238 |
/******/ // on error function for async loading
|
239 |
/******/ __webpack_require__.oe = function(err) { console.error(err); throw err; };
|
240 |
/******/
|
241 |
-
/******/ var jsonpArray = window["
|
242 |
/******/ var oldJsonpFunction = jsonpArray.push.bind(jsonpArray);
|
243 |
/******/ jsonpArray.push = webpackJsonpCallback;
|
244 |
/******/ jsonpArray = jsonpArray.slice();
|
@@ -247,7 +247,7 @@ this["wc"] = this["wc"] || {}; this["wc"]["app"] =
|
|
247 |
/******/
|
248 |
/******/
|
249 |
/******/ // Load entry module and return exports
|
250 |
-
/******/ return __webpack_require__(__webpack_require__.s =
|
251 |
/******/ })
|
252 |
/************************************************************************/
|
253 |
/******/ ({
|
@@ -272,7 +272,7 @@ this["wc"] = this["wc"] || {}; this["wc"]["app"] =
|
|
272 |
if (false) { var throwOnDirectAccess, ReactIs; } else {
|
273 |
// By explicitly using `prop-types` you are opting into new production behavior.
|
274 |
// http://fb.me/prop-types-in-prod
|
275 |
-
module.exports = __webpack_require__(
|
276 |
}
|
277 |
|
278 |
|
@@ -314,35 +314,21 @@ function _inherits(subClass, superClass) {
|
|
314 |
|
315 |
/***/ }),
|
316 |
|
317 |
-
/***/
|
318 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
319 |
|
320 |
"use strict";
|
321 |
-
/* harmony import */ var
|
322 |
-
/* harmony import */ var
|
323 |
-
/* harmony import */ var
|
324 |
-
/* harmony import */ var
|
325 |
-
/* harmony import */ var
|
326 |
-
/* harmony import */ var
|
327 |
-
/* harmony import */ var
|
328 |
-
/* harmony import */ var
|
329 |
-
/* harmony import */ var
|
330 |
-
/* harmony import */ var
|
331 |
-
/* harmony import */ var
|
332 |
-
/* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_5__);
|
333 |
-
/* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(26);
|
334 |
-
/* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_6__);
|
335 |
-
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(0);
|
336 |
-
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__);
|
337 |
-
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(2);
|
338 |
-
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_8__);
|
339 |
-
/* harmony import */ var _wordpress_is_shallow_equal__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(65);
|
340 |
-
/* harmony import */ var _wordpress_is_shallow_equal__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_wordpress_is_shallow_equal__WEBPACK_IMPORTED_MODULE_9__);
|
341 |
-
/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(54);
|
342 |
-
/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(18);
|
343 |
-
/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_11__);
|
344 |
-
|
345 |
-
|
346 |
|
347 |
|
348 |
|
@@ -350,1827 +336,1746 @@ function _inherits(subClass, superClass) {
|
|
350 |
|
351 |
|
352 |
|
353 |
-
function _createSuper(Derived) {
|
354 |
|
355 |
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
|
356 |
|
357 |
/**
|
358 |
-
*
|
359 |
-
* is released which supports this functionality.
|
360 |
-
*
|
361 |
-
* @todo Remove this and use `@wordpress/data` `withSelect` instead after
|
362 |
-
* this PR is merged: https://github.com/WordPress/gutenberg/pull/11460
|
363 |
*/
|
364 |
|
365 |
/**
|
366 |
-
*
|
367 |
*/
|
368 |
|
369 |
|
|
|
|
|
|
|
370 |
|
371 |
|
372 |
|
373 |
/**
|
374 |
-
*
|
375 |
-
* selectors.
|
376 |
-
*
|
377 |
-
* @param {Function} mapSelectToProps Function called on every state change,
|
378 |
-
* expected to return object of props to
|
379 |
-
* merge with the component's own props.
|
380 |
*
|
381 |
-
* @
|
382 |
*/
|
383 |
|
384 |
-
var
|
385 |
-
return Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_10__[/* default */ "a"])(function (WrappedComponent) {
|
386 |
-
/**
|
387 |
-
* Default merge props. A constant value is used as the fallback since it
|
388 |
-
* can be more efficiently shallow compared in case component is repeatedly
|
389 |
-
* rendered without its own merge props.
|
390 |
-
*
|
391 |
-
* @type {Object}
|
392 |
-
*/
|
393 |
-
var DEFAULT_MERGE_PROPS = {};
|
394 |
|
395 |
-
|
396 |
-
|
397 |
|
398 |
-
|
399 |
|
400 |
-
|
401 |
-
|
402 |
|
403 |
-
|
404 |
|
405 |
-
|
406 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
407 |
|
408 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
409 |
|
410 |
-
|
411 |
-
|
412 |
-
|
413 |
-
|
414 |
-
|
415 |
-
|
416 |
-
*
|
417 |
-
* @param {Object} props Props to pass as argument to mapSelectToProps.
|
418 |
-
*
|
419 |
-
* @return {Object} Props to merge into rendered wrapped element.
|
420 |
-
*/
|
421 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
422 |
|
423 |
-
|
424 |
-
|
425 |
-
|
426 |
-
var _this2 = this;
|
427 |
|
428 |
-
|
429 |
-
var onCompletes = [];
|
430 |
-
var componentContext = {
|
431 |
-
component: this
|
432 |
-
};
|
433 |
|
434 |
-
|
435 |
-
|
436 |
-
|
437 |
-
|
|
|
|
|
|
|
|
|
438 |
|
439 |
-
|
440 |
-
|
441 |
-
|
442 |
-
|
443 |
-
|
444 |
-
|
445 |
-
|
|
|
446 |
|
447 |
-
if (onComplete) {
|
448 |
-
onCompletes.push(onComplete);
|
449 |
-
}
|
450 |
|
451 |
-
|
452 |
-
|
453 |
-
|
|
|
|
|
454 |
|
455 |
-
storeSelectors[key] = selectors;
|
456 |
-
} else {
|
457 |
-
storeSelectors[key] = selectorsForKey;
|
458 |
-
}
|
459 |
-
};
|
460 |
|
461 |
-
|
462 |
-
|
463 |
-
|
464 |
-
|
465 |
|
466 |
-
return storeSelectors[key];
|
467 |
-
};
|
468 |
|
469 |
-
|
470 |
|
471 |
-
|
472 |
-
return onComplete();
|
473 |
-
});
|
474 |
-
return selectedProps;
|
475 |
-
}
|
476 |
-
}, {
|
477 |
-
key: "componentDidMount",
|
478 |
-
value: function componentDidMount() {
|
479 |
-
this.canRunSelection = true; // A state change may have occurred between the constructor and
|
480 |
-
// mount of the component (e.g. during the wrapped component's own
|
481 |
-
// constructor), in which case selection should be rerun.
|
482 |
|
483 |
-
|
484 |
-
|
485 |
-
this.onStoreChange();
|
486 |
-
}
|
487 |
}
|
488 |
-
}, {
|
489 |
-
key: "componentWillUnmount",
|
490 |
-
value: function componentWillUnmount() {
|
491 |
-
var _this3 = this;
|
492 |
|
493 |
-
|
494 |
-
|
495 |
-
|
496 |
-
|
|
|
497 |
});
|
498 |
}
|
499 |
-
}
|
500 |
-
|
501 |
-
|
502 |
-
|
503 |
-
|
504 |
-
|
505 |
-
|
506 |
-
|
507 |
-
|
508 |
-
|
509 |
-
|
510 |
|
|
|
|
|
|
|
|
|
511 |
|
512 |
-
|
513 |
-
|
|
|
|
|
|
|
|
|
514 |
|
515 |
-
if (this.state === nextState && !hasPropsChanged) {
|
516 |
-
return false;
|
517 |
-
}
|
518 |
|
519 |
-
|
520 |
-
|
521 |
-
|
522 |
-
|
523 |
-
|
524 |
-
|
525 |
-
|
526 |
-
|
527 |
-
|
528 |
-
|
529 |
-
|
530 |
-
|
531 |
-
// incur the render since the component will need to receive
|
532 |
-
// the changed `ownProps`.
|
533 |
|
534 |
-
|
|
|
535 |
|
536 |
-
|
537 |
-
|
538 |
-
}, {
|
539 |
-
key: "onStoreChange",
|
540 |
-
value: function onStoreChange() {
|
541 |
-
if (!this.canRunSelection) {
|
542 |
-
this.hasQueuedSelection = true;
|
543 |
-
return;
|
544 |
-
}
|
545 |
|
546 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
547 |
|
548 |
-
|
549 |
-
|
550 |
-
}
|
551 |
|
552 |
-
|
553 |
-
|
554 |
-
// shouldComponentUpdate, where setState is not allowed. setState
|
555 |
-
// is used here instead of forceUpdate because forceUpdate bypasses
|
556 |
-
// shouldComponentUpdate altogether, which isn't desireable if both
|
557 |
-
// state and props change within the same render. Unfortunately,
|
558 |
-
// this requires that next merge props are generated twice.
|
559 |
|
560 |
-
|
561 |
-
}
|
562 |
-
}, {
|
563 |
-
key: "subscribe",
|
564 |
-
value: function subscribe(registry) {
|
565 |
-
this.unsubscribe = registry.subscribe(this.onStoreChange);
|
566 |
-
}
|
567 |
-
}, {
|
568 |
-
key: "render",
|
569 |
-
value: function render() {
|
570 |
-
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["createElement"])(WrappedComponent, _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({}, this.props.ownProps, this.mergeProps));
|
571 |
-
}
|
572 |
-
}]);
|
573 |
|
574 |
-
|
575 |
-
|
576 |
|
577 |
-
|
578 |
-
|
579 |
-
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["createElement"])(ComponentWithSelect, {
|
580 |
-
ownProps: ownProps,
|
581 |
-
registry: registry
|
582 |
-
});
|
583 |
-
});
|
584 |
-
};
|
585 |
-
}, 'withSelect');
|
586 |
-
};
|
587 |
|
588 |
-
/* harmony default export */ __webpack_exports__["a"] = (withSelect);
|
589 |
|
590 |
/***/ }),
|
591 |
|
592 |
-
/***/
|
593 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
594 |
|
595 |
"use strict";
|
596 |
-
/* harmony import */ var _woocommerce_date__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(24);
|
597 |
-
/* harmony import */ var _woocommerce_date__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_woocommerce_date__WEBPACK_IMPORTED_MODULE_0__);
|
598 |
-
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "k", function() { return _woocommerce_date__WEBPACK_IMPORTED_MODULE_0__["isoDateFormat"]; });
|
599 |
|
600 |
-
|
|
|
|
|
|
|
|
|
|
|
601 |
|
602 |
-
|
603 |
|
604 |
-
|
|
|
605 |
|
606 |
-
|
|
|
|
|
|
|
607 |
|
608 |
-
|
|
|
|
|
|
|
|
|
609 |
|
610 |
-
|
|
|
611 |
|
612 |
-
|
|
|
|
|
613 |
|
614 |
-
|
|
|
615 |
|
616 |
-
|
|
|
|
|
617 |
|
618 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
619 |
|
620 |
-
|
621 |
-
* External dependencies
|
622 |
-
*/
|
623 |
|
624 |
-
|
625 |
-
|
626 |
-
|
|
|
|
|
|
|
|
|
627 |
|
628 |
-
|
629 |
-
|
630 |
-
|
631 |
-
// Export the expected API for the consuming app.
|
632 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
633 |
|
|
|
634 |
|
635 |
-
|
|
|
|
|
|
|
|
|
|
|
636 |
|
637 |
-
|
638 |
-
/***/ (function(module, exports, __webpack_require__) {
|
639 |
|
640 |
-
|
641 |
|
|
|
|
|
642 |
|
643 |
-
|
644 |
-
* Copyright (c) 2013-present, Facebook, Inc.
|
645 |
-
*
|
646 |
-
* This source code is licensed under the MIT license found in the
|
647 |
-
* LICENSE file in the root directory of this source tree.
|
648 |
-
*
|
649 |
-
*
|
650 |
-
*/
|
651 |
|
652 |
-
|
653 |
-
|
654 |
-
|
655 |
-
};
|
656 |
}
|
657 |
|
658 |
-
|
659 |
-
|
660 |
-
|
661 |
-
* always need to be callable, since JS lacks a null-call idiom ala Cocoa.
|
662 |
-
*/
|
663 |
-
var emptyFunction = function emptyFunction() {};
|
664 |
|
665 |
-
|
666 |
-
|
667 |
-
emptyFunction.thatReturnsTrue = makeEmptyFunction(true);
|
668 |
-
emptyFunction.thatReturnsNull = makeEmptyFunction(null);
|
669 |
-
emptyFunction.thatReturnsThis = function () {
|
670 |
-
return this;
|
671 |
-
};
|
672 |
-
emptyFunction.thatReturnsArgument = function (arg) {
|
673 |
-
return arg;
|
674 |
-
};
|
675 |
|
676 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
677 |
|
678 |
-
|
|
|
|
|
679 |
|
680 |
-
|
681 |
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
682 |
|
683 |
-
|
684 |
-
|
685 |
-
|
686 |
-
/* harmony import */ var _assertThisInitialized__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(5);
|
687 |
-
|
688 |
-
|
689 |
-
function _possibleConstructorReturn(self, call) {
|
690 |
-
if (call && (Object(_helpers_esm_typeof__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])(call) === "object" || typeof call === "function")) {
|
691 |
-
return call;
|
692 |
}
|
693 |
|
694 |
-
return
|
695 |
}
|
696 |
|
697 |
-
|
698 |
|
699 |
-
|
700 |
-
|
701 |
|
702 |
-
|
703 |
|
704 |
-
/***/ }),
|
705 |
|
706 |
-
/***/ 113:
|
707 |
-
/***/ (function(module, exports, __webpack_require__) {
|
708 |
|
709 |
-
"use strict";
|
710 |
-
/**
|
711 |
-
* Copyright (c) 2013-present, Facebook, Inc.
|
712 |
-
*
|
713 |
-
* This source code is licensed under the MIT license found in the
|
714 |
-
* LICENSE file in the root directory of this source tree.
|
715 |
-
*/
|
716 |
|
717 |
|
718 |
|
719 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
720 |
|
721 |
-
|
722 |
-
|
723 |
-
|
|
|
724 |
|
725 |
-
|
726 |
-
function shim(props, propName, componentName, location, propFullName, secret) {
|
727 |
-
if (secret === ReactPropTypesSecret) {
|
728 |
-
// It is still safe when called from React.
|
729 |
-
return;
|
730 |
-
}
|
731 |
-
var err = new Error(
|
732 |
-
'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +
|
733 |
-
'Use PropTypes.checkPropTypes() to call them. ' +
|
734 |
-
'Read more at http://fb.me/use-check-prop-types'
|
735 |
-
);
|
736 |
-
err.name = 'Invariant Violation';
|
737 |
-
throw err;
|
738 |
-
};
|
739 |
-
shim.isRequired = shim;
|
740 |
-
function getShim() {
|
741 |
-
return shim;
|
742 |
-
};
|
743 |
-
// Important!
|
744 |
-
// Keep this list in sync with production version in `./factoryWithTypeCheckers.js`.
|
745 |
-
var ReactPropTypes = {
|
746 |
-
array: shim,
|
747 |
-
bool: shim,
|
748 |
-
func: shim,
|
749 |
-
number: shim,
|
750 |
-
object: shim,
|
751 |
-
string: shim,
|
752 |
-
symbol: shim,
|
753 |
|
754 |
-
|
755 |
-
|
756 |
-
|
757 |
-
|
758 |
-
instanceOf: getShim,
|
759 |
-
node: shim,
|
760 |
-
objectOf: getShim,
|
761 |
-
oneOf: getShim,
|
762 |
-
oneOfType: getShim,
|
763 |
-
shape: getShim,
|
764 |
-
exact: getShim,
|
765 |
|
766 |
-
|
767 |
-
|
|
|
|
|
768 |
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
769 |
|
770 |
-
|
771 |
-
|
772 |
-
return ReactPropTypes;
|
773 |
-
};
|
774 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
775 |
|
776 |
-
|
|
|
|
|
|
|
|
|
777 |
|
778 |
-
|
779 |
-
|
|
|
|
|
|
|
780 |
|
781 |
-
|
782 |
-
|
783 |
-
* Copyright (c) 2013-present, Facebook, Inc.
|
784 |
-
*
|
785 |
-
* This source code is licensed under the MIT license found in the
|
786 |
-
* LICENSE file in the root directory of this source tree.
|
787 |
-
*/
|
788 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
789 |
|
|
|
790 |
|
791 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
792 |
|
793 |
-
|
|
|
|
|
|
|
|
|
794 |
|
|
|
|
|
795 |
|
796 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
797 |
|
798 |
-
|
799 |
-
|
|
|
|
|
|
|
|
|
800 |
|
801 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
802 |
|
|
|
803 |
|
804 |
-
|
805 |
-
var
|
806 |
-
var has = Object.prototype.hasOwnProperty;
|
807 |
|
808 |
-
|
809 |
-
|
810 |
-
return prefix + '[]';
|
811 |
-
},
|
812 |
-
comma: 'comma',
|
813 |
-
indices: function indices(prefix, key) {
|
814 |
-
return prefix + '[' + key + ']';
|
815 |
-
},
|
816 |
-
repeat: function repeat(prefix) {
|
817 |
-
return prefix;
|
818 |
}
|
819 |
-
};
|
820 |
|
821 |
-
|
822 |
-
|
823 |
-
|
824 |
-
|
825 |
-
|
|
|
|
|
|
|
826 |
|
827 |
-
|
|
|
|
|
|
|
828 |
|
829 |
-
|
830 |
-
|
831 |
-
|
832 |
-
|
833 |
-
charset: 'utf-8',
|
834 |
-
charsetSentinel: false,
|
835 |
-
delimiter: '&',
|
836 |
-
encode: true,
|
837 |
-
encoder: utils.encode,
|
838 |
-
encodeValuesOnly: false,
|
839 |
-
format: defaultFormat,
|
840 |
-
formatter: formats.formatters[defaultFormat],
|
841 |
-
// deprecated
|
842 |
-
indices: false,
|
843 |
-
serializeDate: function serializeDate(date) {
|
844 |
-
return toISO.call(date);
|
845 |
-
},
|
846 |
-
skipNulls: false,
|
847 |
-
strictNullHandling: false
|
848 |
-
};
|
849 |
|
850 |
-
|
851 |
-
|
852 |
-
|
853 |
-
|
854 |
-
|
855 |
-
|
856 |
-
}
|
857 |
|
858 |
-
var
|
859 |
-
|
860 |
-
|
861 |
-
|
862 |
-
|
863 |
-
|
864 |
-
|
865 |
-
|
866 |
-
|
867 |
-
|
868 |
-
|
869 |
-
formatter,
|
870 |
-
encodeValuesOnly,
|
871 |
-
charset
|
872 |
-
) {
|
873 |
-
var obj = object;
|
874 |
-
if (typeof filter === 'function') {
|
875 |
-
obj = filter(prefix, obj);
|
876 |
-
} else if (obj instanceof Date) {
|
877 |
-
obj = serializeDate(obj);
|
878 |
-
} else if (generateArrayPrefix === 'comma' && isArray(obj)) {
|
879 |
-
obj = obj.join(',');
|
880 |
-
}
|
881 |
|
882 |
-
|
883 |
-
|
884 |
-
|
885 |
-
|
|
|
|
|
|
|
|
|
|
|
886 |
|
887 |
-
|
888 |
-
|
|
|
|
|
|
|
|
|
889 |
|
890 |
-
|
891 |
-
|
892 |
-
|
893 |
-
|
894 |
-
|
895 |
-
|
896 |
-
|
|
|
897 |
|
898 |
-
|
|
|
|
|
899 |
|
900 |
-
|
901 |
-
|
902 |
-
}
|
903 |
|
904 |
-
|
905 |
-
|
906 |
-
|
907 |
-
|
908 |
-
|
909 |
-
|
910 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
911 |
|
912 |
-
for (var i = 0; i < objKeys.length; ++i) {
|
913 |
-
var key = objKeys[i];
|
914 |
|
915 |
-
|
916 |
-
|
917 |
-
|
|
|
918 |
|
919 |
-
|
920 |
-
|
921 |
-
|
922 |
-
|
923 |
-
|
924 |
-
|
925 |
-
|
926 |
-
|
927 |
-
|
928 |
-
|
929 |
-
|
930 |
-
|
931 |
-
formatter,
|
932 |
-
encodeValuesOnly,
|
933 |
-
charset
|
934 |
-
));
|
935 |
-
} else {
|
936 |
-
pushToArray(values, stringify(
|
937 |
-
obj[key],
|
938 |
-
prefix + (allowDots ? '.' + key : '[' + key + ']'),
|
939 |
-
generateArrayPrefix,
|
940 |
-
strictNullHandling,
|
941 |
-
skipNulls,
|
942 |
-
encoder,
|
943 |
-
filter,
|
944 |
-
sort,
|
945 |
-
allowDots,
|
946 |
-
serializeDate,
|
947 |
-
formatter,
|
948 |
-
encodeValuesOnly,
|
949 |
-
charset
|
950 |
-
));
|
951 |
-
}
|
952 |
-
}
|
953 |
|
954 |
-
|
955 |
-
}
|
|
|
|
|
956 |
|
957 |
-
var
|
958 |
-
|
959 |
-
|
960 |
-
|
|
|
|
|
|
|
|
|
|
|
961 |
|
962 |
-
|
963 |
-
|
964 |
-
|
965 |
|
966 |
-
|
967 |
-
if (typeof opts.charset !== 'undefined' && opts.charset !== 'utf-8' && opts.charset !== 'iso-8859-1') {
|
968 |
-
throw new TypeError('The charset option must be either utf-8, iso-8859-1, or undefined');
|
969 |
-
}
|
970 |
|
971 |
-
|
972 |
-
|
973 |
-
if (!has.call(formats.formatters, opts.format)) {
|
974 |
-
throw new TypeError('Unknown format option provided.');
|
975 |
-
}
|
976 |
-
format = opts.format;
|
977 |
-
}
|
978 |
-
var formatter = formats.formatters[format];
|
979 |
|
980 |
-
|
981 |
-
|
982 |
-
|
983 |
-
}
|
984 |
|
985 |
-
|
986 |
-
|
987 |
-
|
988 |
-
|
989 |
-
|
990 |
-
delimiter: typeof opts.delimiter === 'undefined' ? defaults.delimiter : opts.delimiter,
|
991 |
-
encode: typeof opts.encode === 'boolean' ? opts.encode : defaults.encode,
|
992 |
-
encoder: typeof opts.encoder === 'function' ? opts.encoder : defaults.encoder,
|
993 |
-
encodeValuesOnly: typeof opts.encodeValuesOnly === 'boolean' ? opts.encodeValuesOnly : defaults.encodeValuesOnly,
|
994 |
-
filter: filter,
|
995 |
-
formatter: formatter,
|
996 |
-
serializeDate: typeof opts.serializeDate === 'function' ? opts.serializeDate : defaults.serializeDate,
|
997 |
-
skipNulls: typeof opts.skipNulls === 'boolean' ? opts.skipNulls : defaults.skipNulls,
|
998 |
-
sort: typeof opts.sort === 'function' ? opts.sort : null,
|
999 |
-
strictNullHandling: typeof opts.strictNullHandling === 'boolean' ? opts.strictNullHandling : defaults.strictNullHandling
|
1000 |
-
};
|
1001 |
-
};
|
1002 |
|
1003 |
-
|
1004 |
-
|
1005 |
-
|
1006 |
-
|
1007 |
-
var objKeys;
|
1008 |
-
var filter;
|
1009 |
-
|
1010 |
-
if (typeof options.filter === 'function') {
|
1011 |
-
filter = options.filter;
|
1012 |
-
obj = filter('', obj);
|
1013 |
-
} else if (isArray(options.filter)) {
|
1014 |
-
filter = options.filter;
|
1015 |
-
objKeys = filter;
|
1016 |
-
}
|
1017 |
-
|
1018 |
-
var keys = [];
|
1019 |
|
1020 |
-
|
1021 |
-
return '';
|
1022 |
-
}
|
1023 |
|
1024 |
-
|
1025 |
-
if (
|
1026 |
-
|
1027 |
-
|
1028 |
-
arrayFormat = opts.indices ? 'indices' : 'repeat';
|
1029 |
} else {
|
1030 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1031 |
}
|
|
|
1032 |
|
1033 |
-
|
|
|
|
|
|
|
1034 |
|
1035 |
-
|
1036 |
-
|
1037 |
-
|
|
|
|
|
1038 |
|
1039 |
-
if (
|
1040 |
-
|
|
|
1041 |
}
|
|
|
1042 |
|
1043 |
-
|
1044 |
-
|
1045 |
|
1046 |
-
|
1047 |
-
|
1048 |
-
|
1049 |
-
pushToArray(keys, stringify(
|
1050 |
-
obj[key],
|
1051 |
-
key,
|
1052 |
-
generateArrayPrefix,
|
1053 |
-
options.strictNullHandling,
|
1054 |
-
options.skipNulls,
|
1055 |
-
options.encode ? options.encoder : null,
|
1056 |
-
options.filter,
|
1057 |
-
options.sort,
|
1058 |
-
options.allowDots,
|
1059 |
-
options.serializeDate,
|
1060 |
-
options.formatter,
|
1061 |
-
options.encodeValuesOnly,
|
1062 |
-
options.charset
|
1063 |
-
));
|
1064 |
-
}
|
1065 |
|
1066 |
-
|
1067 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1068 |
|
1069 |
-
|
1070 |
-
|
1071 |
-
|
1072 |
-
|
|
|
|
|
|
|
|
|
1073 |
} else {
|
1074 |
-
|
1075 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
1076 |
}
|
1077 |
-
|
|
|
|
|
|
|
|
|
|
|
1078 |
|
1079 |
-
|
1080 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1081 |
|
|
|
|
|
|
|
|
|
|
|
1082 |
|
1083 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1084 |
|
1085 |
-
|
1086 |
-
|
|
|
1087 |
|
1088 |
-
|
|
|
|
|
1089 |
|
|
|
|
|
|
|
1090 |
|
1091 |
-
var
|
1092 |
|
1093 |
-
|
1094 |
-
|
1095 |
|
1096 |
-
|
1097 |
-
|
1098 |
-
|
1099 |
-
|
1100 |
-
|
1101 |
-
|
1102 |
-
|
1103 |
-
|
1104 |
-
delimiter: '&',
|
1105 |
-
depth: 5,
|
1106 |
-
ignoreQueryPrefix: false,
|
1107 |
-
interpretNumericEntities: false,
|
1108 |
-
parameterLimit: 1000,
|
1109 |
-
parseArrays: true,
|
1110 |
-
plainObjects: false,
|
1111 |
-
strictNullHandling: false
|
1112 |
-
};
|
1113 |
|
1114 |
-
var
|
1115 |
-
return str.replace(/&#(\d+);/g, function ($0, numberStr) {
|
1116 |
-
return String.fromCharCode(parseInt(numberStr, 10));
|
1117 |
-
});
|
1118 |
-
};
|
1119 |
|
1120 |
-
|
1121 |
-
if (
|
1122 |
-
|
1123 |
}
|
1124 |
|
1125 |
-
|
1126 |
-
};
|
1127 |
|
1128 |
-
|
1129 |
-
|
1130 |
-
|
1131 |
-
for (var i = 0; i < val.length; i += 1) {
|
1132 |
-
mapped.push(fn(val[i]));
|
1133 |
-
}
|
1134 |
-
return mapped;
|
1135 |
}
|
1136 |
-
return fn(val);
|
1137 |
-
};
|
1138 |
-
|
1139 |
-
// This is what browsers will submit when the ✓ character occurs in an
|
1140 |
-
// application/x-www-form-urlencoded body and the encoding of the page containing
|
1141 |
-
// the form is iso-8859-1, or when the submitted form has an accept-charset
|
1142 |
-
// attribute of iso-8859-1. Presumably also with other charsets that do not contain
|
1143 |
-
// the ✓ character, such as us-ascii.
|
1144 |
-
var isoSentinel = 'utf8=%26%2310003%3B'; // encodeURIComponent('✓')
|
1145 |
|
1146 |
-
|
1147 |
-
|
|
|
|
|
|
|
1148 |
|
1149 |
-
|
1150 |
-
|
1151 |
-
|
1152 |
-
var limit = options.parameterLimit === Infinity ? undefined : options.parameterLimit;
|
1153 |
-
var parts = cleanStr.split(options.delimiter, limit);
|
1154 |
-
var skipIndex = -1; // Keep track of where the utf8 sentinel was found
|
1155 |
-
var i;
|
1156 |
|
1157 |
-
|
1158 |
-
|
1159 |
-
|
1160 |
-
|
1161 |
-
|
1162 |
-
|
1163 |
-
|
1164 |
-
|
1165 |
-
}
|
1166 |
-
skipIndex = i;
|
1167 |
-
i = parts.length; // The eslint settings do not allow break;
|
1168 |
-
}
|
1169 |
-
}
|
1170 |
-
}
|
1171 |
-
|
1172 |
-
for (i = 0; i < parts.length; ++i) {
|
1173 |
-
if (i === skipIndex) {
|
1174 |
-
continue;
|
1175 |
-
}
|
1176 |
-
var part = parts[i];
|
1177 |
-
|
1178 |
-
var bracketEqualsPos = part.indexOf(']=');
|
1179 |
-
var pos = bracketEqualsPos === -1 ? part.indexOf('=') : bracketEqualsPos + 1;
|
1180 |
-
|
1181 |
-
var key, val;
|
1182 |
-
if (pos === -1) {
|
1183 |
-
key = options.decoder(part, defaults.decoder, charset, 'key');
|
1184 |
-
val = options.strictNullHandling ? null : '';
|
1185 |
-
} else {
|
1186 |
-
key = options.decoder(part.slice(0, pos), defaults.decoder, charset, 'key');
|
1187 |
-
val = maybeMap(
|
1188 |
-
parseArrayValue(part.slice(pos + 1), options),
|
1189 |
-
function (encodedVal) {
|
1190 |
-
return options.decoder(encodedVal, defaults.decoder, charset, 'value');
|
1191 |
-
}
|
1192 |
-
);
|
1193 |
-
}
|
1194 |
-
|
1195 |
-
if (val && options.interpretNumericEntities && charset === 'iso-8859-1') {
|
1196 |
-
val = interpretNumericEntities(val);
|
1197 |
-
}
|
1198 |
|
1199 |
-
|
1200 |
-
|
1201 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1202 |
|
1203 |
-
|
1204 |
-
|
1205 |
-
|
1206 |
-
|
1207 |
-
|
|
|
|
|
|
|
1208 |
}
|
1209 |
-
|
1210 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1211 |
};
|
1212 |
|
1213 |
-
|
1214 |
-
|
|
|
|
|
1215 |
|
1216 |
-
|
1217 |
-
|
1218 |
-
|
|
|
|
|
|
|
|
|
1219 |
|
1220 |
-
|
1221 |
-
|
1222 |
-
|
1223 |
-
obj = options.plainObjects ? Object.create(null) : {};
|
1224 |
-
var cleanRoot = root.charAt(0) === '[' && root.charAt(root.length - 1) === ']' ? root.slice(1, -1) : root;
|
1225 |
-
var index = parseInt(cleanRoot, 10);
|
1226 |
-
if (!options.parseArrays && cleanRoot === '') {
|
1227 |
-
obj = { 0: leaf };
|
1228 |
-
} else if (
|
1229 |
-
!isNaN(index)
|
1230 |
-
&& root !== cleanRoot
|
1231 |
-
&& String(index) === cleanRoot
|
1232 |
-
&& index >= 0
|
1233 |
-
&& (options.parseArrays && index <= options.arrayLimit)
|
1234 |
-
) {
|
1235 |
-
obj = [];
|
1236 |
-
obj[index] = leaf;
|
1237 |
-
} else {
|
1238 |
-
obj[cleanRoot] = leaf;
|
1239 |
-
}
|
1240 |
-
}
|
1241 |
|
1242 |
-
|
1243 |
-
|
|
|
1244 |
|
1245 |
-
|
1246 |
-
|
|
|
|
|
1247 |
|
1248 |
-
|
1249 |
-
|
1250 |
-
|
1251 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1252 |
|
1253 |
-
|
1254 |
-
var
|
|
|
|
|
|
|
|
|
1255 |
|
1256 |
-
|
1257 |
|
1258 |
-
|
1259 |
-
|
1260 |
|
1261 |
-
|
|
|
|
|
1262 |
|
1263 |
-
|
1264 |
-
|
1265 |
|
1266 |
-
|
|
|
|
|
1267 |
|
1268 |
-
|
1269 |
-
|
1270 |
-
|
1271 |
-
if (!options.plainObjects && has.call(Object.prototype, parent)) {
|
1272 |
-
if (!options.allowPrototypes) {
|
1273 |
-
return;
|
1274 |
-
}
|
1275 |
-
}
|
1276 |
|
1277 |
-
|
1278 |
-
|
|
|
|
|
|
|
|
|
|
|
1279 |
|
1280 |
-
|
1281 |
|
1282 |
-
|
1283 |
-
|
1284 |
-
i += 1;
|
1285 |
-
if (!options.plainObjects && has.call(Object.prototype, segment[1].slice(1, -1))) {
|
1286 |
-
if (!options.allowPrototypes) {
|
1287 |
-
return;
|
1288 |
-
}
|
1289 |
-
}
|
1290 |
-
keys.push(segment[1]);
|
1291 |
}
|
|
|
1292 |
|
1293 |
-
|
1294 |
-
|
1295 |
-
|
1296 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1297 |
}
|
|
|
1298 |
|
1299 |
-
|
1300 |
-
|
|
|
|
|
1301 |
|
1302 |
-
var
|
1303 |
-
if (
|
1304 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
1305 |
}
|
|
|
1306 |
|
1307 |
-
if (opts.decoder !== null && opts.decoder !== undefined && typeof opts.decoder !== 'function') {
|
1308 |
-
throw new TypeError('Decoder has to be a function.');
|
1309 |
-
}
|
1310 |
-
|
1311 |
-
if (typeof opts.charset !== 'undefined' && opts.charset !== 'utf-8' && opts.charset !== 'iso-8859-1') {
|
1312 |
-
throw new TypeError('The charset option must be either utf-8, iso-8859-1, or undefined');
|
1313 |
-
}
|
1314 |
-
var charset = typeof opts.charset === 'undefined' ? defaults.charset : opts.charset;
|
1315 |
|
1316 |
-
|
1317 |
-
|
1318 |
-
|
1319 |
-
|
1320 |
-
|
1321 |
-
charsetSentinel: typeof opts.charsetSentinel === 'boolean' ? opts.charsetSentinel : defaults.charsetSentinel,
|
1322 |
-
comma: typeof opts.comma === 'boolean' ? opts.comma : defaults.comma,
|
1323 |
-
decoder: typeof opts.decoder === 'function' ? opts.decoder : defaults.decoder,
|
1324 |
-
delimiter: typeof opts.delimiter === 'string' || utils.isRegExp(opts.delimiter) ? opts.delimiter : defaults.delimiter,
|
1325 |
-
// eslint-disable-next-line no-implicit-coercion, no-extra-parens
|
1326 |
-
depth: (typeof opts.depth === 'number' || opts.depth === false) ? +opts.depth : defaults.depth,
|
1327 |
-
ignoreQueryPrefix: opts.ignoreQueryPrefix === true,
|
1328 |
-
interpretNumericEntities: typeof opts.interpretNumericEntities === 'boolean' ? opts.interpretNumericEntities : defaults.interpretNumericEntities,
|
1329 |
-
parameterLimit: typeof opts.parameterLimit === 'number' ? opts.parameterLimit : defaults.parameterLimit,
|
1330 |
-
parseArrays: opts.parseArrays !== false,
|
1331 |
-
plainObjects: typeof opts.plainObjects === 'boolean' ? opts.plainObjects : defaults.plainObjects,
|
1332 |
-
strictNullHandling: typeof opts.strictNullHandling === 'boolean' ? opts.strictNullHandling : defaults.strictNullHandling
|
1333 |
-
};
|
1334 |
-
};
|
1335 |
|
1336 |
-
|
1337 |
-
var
|
|
|
1338 |
|
1339 |
-
if (
|
1340 |
-
|
1341 |
}
|
1342 |
|
1343 |
-
|
1344 |
-
|
1345 |
|
1346 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1347 |
|
1348 |
-
|
1349 |
-
|
1350 |
-
|
1351 |
-
|
1352 |
-
|
1353 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1354 |
|
1355 |
-
|
1356 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1357 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1358 |
|
1359 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1360 |
|
1361 |
-
|
1362 |
-
|
|
|
|
|
1363 |
|
1364 |
-
|
|
|
|
|
1365 |
|
|
|
|
|
|
|
1366 |
|
1367 |
-
var
|
1368 |
|
1369 |
-
|
1370 |
-
|
1371 |
-
*
|
1372 |
-
* @param {import('.').ComparableObject} a First object to compare.
|
1373 |
-
* @param {import('.').ComparableObject} b Second object to compare.
|
1374 |
-
*
|
1375 |
-
* @return {boolean} Whether the two objects are shallow equal.
|
1376 |
-
*/
|
1377 |
-
function isShallowEqualObjects( a, b ) {
|
1378 |
-
var aKeys, bKeys, i, key, aValue;
|
1379 |
|
1380 |
-
|
1381 |
-
|
1382 |
-
|
|
|
|
|
|
|
1383 |
|
1384 |
-
|
1385 |
-
bKeys = keys( b );
|
1386 |
|
1387 |
-
|
1388 |
-
|
1389 |
-
|
|
|
1390 |
|
1391 |
-
|
1392 |
|
1393 |
-
|
1394 |
-
|
1395 |
-
|
|
|
1396 |
|
1397 |
-
|
1398 |
-
|
1399 |
-
|
1400 |
-
|
1401 |
-
|
1402 |
-
// Example: isShallowEqualObjects( { a: undefined }, { b: 5 } )
|
1403 |
-
( aValue === undefined && ! b.hasOwnProperty( key ) ) ||
|
1404 |
-
aValue !== b[ key ]
|
1405 |
-
) {
|
1406 |
-
return false;
|
1407 |
-
}
|
1408 |
|
1409 |
-
|
1410 |
-
|
|
|
1411 |
|
1412 |
-
|
1413 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
1414 |
|
1415 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1416 |
|
|
|
|
|
|
|
|
|
|
|
|
|
1417 |
|
1418 |
-
/***/ }),
|
1419 |
|
1420 |
-
|
1421 |
-
|
|
|
|
|
1422 |
|
1423 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1424 |
|
|
|
|
|
1425 |
|
1426 |
-
|
1427 |
-
|
1428 |
-
|
1429 |
-
* @param {any[]} a First array to compare.
|
1430 |
-
* @param {any[]} b Second array to compare.
|
1431 |
-
*
|
1432 |
-
* @return {boolean} Whether the two arrays are shallow equal.
|
1433 |
-
*/
|
1434 |
-
function isShallowEqualArrays( a, b ) {
|
1435 |
-
var i;
|
1436 |
|
1437 |
-
|
1438 |
-
|
1439 |
-
|
1440 |
|
1441 |
-
|
1442 |
-
|
1443 |
-
|
|
|
1444 |
|
1445 |
-
|
1446 |
-
if ( a[ i ] !== b[ i ] ) {
|
1447 |
-
return false;
|
1448 |
-
}
|
1449 |
-
}
|
1450 |
|
1451 |
-
|
1452 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1453 |
|
1454 |
-
|
|
|
|
|
|
|
|
|
1455 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1456 |
|
1457 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1458 |
|
1459 |
-
|
1460 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1461 |
|
1462 |
-
|
|
|
|
|
1463 |
|
|
|
|
|
|
|
1464 |
|
1465 |
-
|
1466 |
-
|
1467 |
-
|
1468 |
-
|
1469 |
-
function setup(env) {
|
1470 |
-
createDebug.debug = createDebug;
|
1471 |
-
createDebug.default = createDebug;
|
1472 |
-
createDebug.coerce = coerce;
|
1473 |
-
createDebug.disable = disable;
|
1474 |
-
createDebug.enable = enable;
|
1475 |
-
createDebug.enabled = enabled;
|
1476 |
-
createDebug.humanize = __webpack_require__(120);
|
1477 |
-
Object.keys(env).forEach(function (key) {
|
1478 |
-
createDebug[key] = env[key];
|
1479 |
-
});
|
1480 |
-
/**
|
1481 |
-
* Active `debug` instances.
|
1482 |
-
*/
|
1483 |
|
1484 |
-
|
1485 |
-
|
1486 |
-
|
1487 |
-
|
1488 |
|
1489 |
-
|
1490 |
-
|
1491 |
-
/**
|
1492 |
-
* Map of special "%n" handling functions, for the debug "format" argument.
|
1493 |
-
*
|
1494 |
-
* Valid key names are a single, lower or upper-case letter, i.e. "n" and "N".
|
1495 |
-
*/
|
1496 |
|
1497 |
-
|
1498 |
-
|
1499 |
-
|
1500 |
-
* @param {String} namespace The namespace string for the for the debug instance to be colored
|
1501 |
-
* @return {Number|String} An ANSI color code for the given namespace
|
1502 |
-
* @api private
|
1503 |
-
*/
|
1504 |
|
1505 |
-
|
1506 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1507 |
|
1508 |
-
for (var i = 0; i < namespace.length; i++) {
|
1509 |
-
hash = (hash << 5) - hash + namespace.charCodeAt(i);
|
1510 |
-
hash |= 0; // Convert to 32bit integer
|
1511 |
-
}
|
1512 |
|
1513 |
-
return createDebug.colors[Math.abs(hash) % createDebug.colors.length];
|
1514 |
-
}
|
1515 |
|
1516 |
-
createDebug.selectColor = selectColor;
|
1517 |
-
/**
|
1518 |
-
* Create a debugger with the given `namespace`.
|
1519 |
-
*
|
1520 |
-
* @param {String} namespace
|
1521 |
-
* @return {Function}
|
1522 |
-
* @api public
|
1523 |
-
*/
|
1524 |
|
1525 |
-
|
1526 |
-
var prevTime;
|
1527 |
|
1528 |
-
|
1529 |
-
|
1530 |
-
args[_key] = arguments[_key];
|
1531 |
-
}
|
1532 |
|
1533 |
-
|
1534 |
-
|
1535 |
-
|
1536 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1537 |
|
1538 |
-
var self = debug; // Set `diff` timestamp
|
1539 |
|
1540 |
-
var curr = Number(new Date());
|
1541 |
-
var ms = curr - (prevTime || curr);
|
1542 |
-
self.diff = ms;
|
1543 |
-
self.prev = prevTime;
|
1544 |
-
self.curr = curr;
|
1545 |
-
prevTime = curr;
|
1546 |
-
args[0] = createDebug.coerce(args[0]);
|
1547 |
|
1548 |
-
if (typeof args[0] !== 'string') {
|
1549 |
-
// Anything else let's inspect with %O
|
1550 |
-
args.unshift('%O');
|
1551 |
-
} // Apply any `formatters` transformations
|
1552 |
|
1553 |
|
1554 |
-
var index = 0;
|
1555 |
-
args[0] = args[0].replace(/%([a-zA-Z%])/g, function (match, format) {
|
1556 |
-
// If we encounter an escaped % then don't increase the array index
|
1557 |
-
if (match === '%%') {
|
1558 |
-
return match;
|
1559 |
-
}
|
1560 |
|
1561 |
-
index++;
|
1562 |
-
var formatter = createDebug.formatters[format];
|
1563 |
|
1564 |
-
if (typeof formatter === 'function') {
|
1565 |
-
var val = args[index];
|
1566 |
-
match = formatter.call(self, val); // Now we need to remove `args[index]` since it's inlined in the `format`
|
1567 |
|
1568 |
-
args.splice(index, 1);
|
1569 |
-
index--;
|
1570 |
-
}
|
1571 |
|
1572 |
-
|
1573 |
-
}); // Apply env-specific formatting (colors, etc.)
|
1574 |
|
1575 |
-
|
1576 |
-
var logFn = self.log || createDebug.log;
|
1577 |
-
logFn.apply(self, args);
|
1578 |
-
}
|
1579 |
|
1580 |
-
|
1581 |
-
|
1582 |
-
|
1583 |
-
|
1584 |
-
|
1585 |
-
|
1586 |
-
|
1587 |
-
// env-specific initialization logic for debug instances
|
1588 |
|
1589 |
-
|
1590 |
-
|
1591 |
-
|
1592 |
|
1593 |
-
createDebug.instances.push(debug);
|
1594 |
-
return debug;
|
1595 |
-
}
|
1596 |
|
1597 |
-
function destroy() {
|
1598 |
-
var index = createDebug.instances.indexOf(this);
|
1599 |
|
1600 |
-
if (index !== -1) {
|
1601 |
-
createDebug.instances.splice(index, 1);
|
1602 |
-
return true;
|
1603 |
-
}
|
1604 |
|
1605 |
-
return false;
|
1606 |
-
}
|
1607 |
|
1608 |
-
|
1609 |
-
|
1610 |
-
|
1611 |
-
|
1612 |
-
|
1613 |
-
|
1614 |
-
|
1615 |
-
|
1616 |
-
|
1617 |
-
|
1618 |
-
* @api public
|
1619 |
-
*/
|
1620 |
-
|
1621 |
-
|
1622 |
-
function enable(namespaces) {
|
1623 |
-
createDebug.save(namespaces);
|
1624 |
-
createDebug.names = [];
|
1625 |
-
createDebug.skips = [];
|
1626 |
-
var i;
|
1627 |
-
var split = (typeof namespaces === 'string' ? namespaces : '').split(/[\s,]+/);
|
1628 |
-
var len = split.length;
|
1629 |
-
|
1630 |
-
for (i = 0; i < len; i++) {
|
1631 |
-
if (!split[i]) {
|
1632 |
-
// ignore empty strings
|
1633 |
-
continue;
|
1634 |
-
}
|
1635 |
-
|
1636 |
-
namespaces = split[i].replace(/\*/g, '.*?');
|
1637 |
|
1638 |
-
|
1639 |
-
|
1640 |
-
|
1641 |
-
|
1642 |
-
|
1643 |
-
|
|
|
|
|
|
|
|
|
1644 |
|
1645 |
-
|
1646 |
-
|
1647 |
-
instance.enabled = createDebug.enabled(instance.namespace);
|
1648 |
-
}
|
1649 |
-
}
|
1650 |
-
/**
|
1651 |
-
* Disable debug output.
|
1652 |
-
*
|
1653 |
-
* @return {String} namespaces
|
1654 |
-
* @api public
|
1655 |
-
*/
|
1656 |
|
|
|
1657 |
|
1658 |
-
|
1659 |
-
|
1660 |
-
return '-' + namespace;
|
1661 |
-
})).join(',');
|
1662 |
-
createDebug.enable('');
|
1663 |
-
return namespaces;
|
1664 |
-
}
|
1665 |
-
/**
|
1666 |
-
* Returns true if the given mode name is enabled, false otherwise.
|
1667 |
-
*
|
1668 |
-
* @param {String} name
|
1669 |
-
* @return {Boolean}
|
1670 |
-
* @api public
|
1671 |
-
*/
|
1672 |
|
|
|
1673 |
|
1674 |
-
|
1675 |
-
|
1676 |
-
return true;
|
1677 |
-
}
|
1678 |
|
1679 |
-
|
1680 |
-
var len;
|
1681 |
|
1682 |
-
|
1683 |
-
|
1684 |
-
return
|
1685 |
}
|
1686 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
1687 |
|
1688 |
-
for (i = 0, len = createDebug.names.length; i < len; i++) {
|
1689 |
-
if (createDebug.names[i].test(name)) {
|
1690 |
-
return true;
|
1691 |
-
}
|
1692 |
-
}
|
1693 |
|
1694 |
-
|
1695 |
-
|
1696 |
-
|
1697 |
-
|
1698 |
-
*
|
1699 |
-
* @param {RegExp} regxep
|
1700 |
-
* @return {String} namespace
|
1701 |
-
* @api private
|
1702 |
-
*/
|
1703 |
|
|
|
|
|
|
|
|
|
|
|
1704 |
|
1705 |
-
|
1706 |
-
|
1707 |
-
|
1708 |
-
|
1709 |
-
* Coerce `val`.
|
1710 |
-
*
|
1711 |
-
* @param {Mixed} val
|
1712 |
-
* @return {Mixed}
|
1713 |
-
* @api private
|
1714 |
-
*/
|
1715 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1716 |
|
1717 |
-
|
1718 |
-
|
1719 |
-
|
1720 |
-
}
|
1721 |
|
1722 |
-
|
1723 |
-
|
|
|
1724 |
|
1725 |
-
|
1726 |
-
|
1727 |
-
|
|
|
|
|
1728 |
|
1729 |
-
|
|
|
|
|
|
|
1730 |
|
1731 |
-
|
|
|
1732 |
|
1733 |
-
|
1734 |
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
1735 |
|
1736 |
-
|
1737 |
-
|
1738 |
-
|
1739 |
-
|
1740 |
-
|
1741 |
-
|
|
|
|
|
|
|
|
|
|
|
1742 |
|
1743 |
-
|
1744 |
-
|
1745 |
-
|
|
|
1746 |
}
|
1747 |
-
}
|
1748 |
-
|
|
|
|
|
1749 |
|
1750 |
-
|
1751 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1752 |
|
1753 |
-
|
1754 |
-
|
|
|
|
|
|
|
1755 |
|
1756 |
-
/***/ }),
|
1757 |
|
1758 |
-
|
1759 |
-
|
1760 |
|
1761 |
-
|
1762 |
-
|
1763 |
-
|
1764 |
|
1765 |
-
|
1766 |
-
var
|
1767 |
-
var h = m * 60;
|
1768 |
-
var d = h * 24;
|
1769 |
-
var w = d * 7;
|
1770 |
-
var y = d * 365.25;
|
1771 |
|
1772 |
-
|
1773 |
-
|
1774 |
-
|
1775 |
-
|
1776 |
-
|
1777 |
-
|
1778 |
-
|
1779 |
-
|
1780 |
-
|
1781 |
-
|
1782 |
-
|
1783 |
-
* @api public
|
1784 |
-
*/
|
1785 |
-
|
1786 |
-
module.exports = function(val, options) {
|
1787 |
-
options = options || {};
|
1788 |
-
var type = typeof val;
|
1789 |
-
if (type === 'string' && val.length > 0) {
|
1790 |
-
return parse(val);
|
1791 |
-
} else if (type === 'number' && isFinite(val)) {
|
1792 |
-
return options.long ? fmtLong(val) : fmtShort(val);
|
1793 |
-
}
|
1794 |
-
throw new Error(
|
1795 |
-
'val is not a non-empty string or a valid number. val=' +
|
1796 |
-
JSON.stringify(val)
|
1797 |
-
);
|
1798 |
-
};
|
1799 |
|
1800 |
-
|
1801 |
-
* Parse the given `str` and return milliseconds.
|
1802 |
-
*
|
1803 |
-
* @param {String} str
|
1804 |
-
* @return {Number}
|
1805 |
-
* @api private
|
1806 |
-
*/
|
1807 |
|
1808 |
-
|
1809 |
-
|
1810 |
-
|
1811 |
-
|
1812 |
-
|
1813 |
-
|
1814 |
-
|
1815 |
-
|
1816 |
-
|
1817 |
-
return;
|
1818 |
-
}
|
1819 |
-
var n = parseFloat(match[1]);
|
1820 |
-
var type = (match[2] || 'ms').toLowerCase();
|
1821 |
-
switch (type) {
|
1822 |
-
case 'years':
|
1823 |
-
case 'year':
|
1824 |
-
case 'yrs':
|
1825 |
-
case 'yr':
|
1826 |
-
case 'y':
|
1827 |
-
return n * y;
|
1828 |
-
case 'weeks':
|
1829 |
-
case 'week':
|
1830 |
-
case 'w':
|
1831 |
-
return n * w;
|
1832 |
-
case 'days':
|
1833 |
-
case 'day':
|
1834 |
-
case 'd':
|
1835 |
-
return n * d;
|
1836 |
-
case 'hours':
|
1837 |
-
case 'hour':
|
1838 |
-
case 'hrs':
|
1839 |
-
case 'hr':
|
1840 |
-
case 'h':
|
1841 |
-
return n * h;
|
1842 |
-
case 'minutes':
|
1843 |
-
case 'minute':
|
1844 |
-
case 'mins':
|
1845 |
-
case 'min':
|
1846 |
-
case 'm':
|
1847 |
-
return n * m;
|
1848 |
-
case 'seconds':
|
1849 |
-
case 'second':
|
1850 |
-
case 'secs':
|
1851 |
-
case 'sec':
|
1852 |
-
case 's':
|
1853 |
-
return n * s;
|
1854 |
-
case 'milliseconds':
|
1855 |
-
case 'millisecond':
|
1856 |
-
case 'msecs':
|
1857 |
-
case 'msec':
|
1858 |
-
case 'ms':
|
1859 |
-
return n;
|
1860 |
-
default:
|
1861 |
-
return undefined;
|
1862 |
-
}
|
1863 |
-
}
|
1864 |
|
1865 |
-
|
1866 |
-
* Short format for `ms`.
|
1867 |
-
*
|
1868 |
-
* @param {Number} ms
|
1869 |
-
* @return {String}
|
1870 |
-
* @api private
|
1871 |
-
*/
|
1872 |
|
1873 |
-
|
1874 |
-
|
1875 |
-
|
1876 |
-
return Math.round(ms / d) + 'd';
|
1877 |
-
}
|
1878 |
-
if (msAbs >= h) {
|
1879 |
-
return Math.round(ms / h) + 'h';
|
1880 |
-
}
|
1881 |
-
if (msAbs >= m) {
|
1882 |
-
return Math.round(ms / m) + 'm';
|
1883 |
-
}
|
1884 |
-
if (msAbs >= s) {
|
1885 |
-
return Math.round(ms / s) + 's';
|
1886 |
-
}
|
1887 |
-
return ms + 'ms';
|
1888 |
-
}
|
1889 |
|
1890 |
-
|
1891 |
-
|
1892 |
-
|
1893 |
-
|
1894 |
-
|
1895 |
-
|
1896 |
-
|
1897 |
|
1898 |
-
|
1899 |
-
|
1900 |
-
|
1901 |
-
|
1902 |
-
|
1903 |
-
|
1904 |
-
|
1905 |
-
|
1906 |
-
|
1907 |
-
|
1908 |
-
|
1909 |
-
|
1910 |
-
|
1911 |
-
}
|
1912 |
-
return ms + ' ms';
|
1913 |
-
}
|
1914 |
|
1915 |
-
|
1916 |
-
|
1917 |
-
*/
|
1918 |
|
1919 |
-
function
|
1920 |
-
|
1921 |
-
|
1922 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
1923 |
|
|
|
1924 |
|
1925 |
/***/ }),
|
1926 |
|
1927 |
-
/***/
|
1928 |
-
/***/ (function(module,
|
1929 |
|
1930 |
-
|
1931 |
-
|
1932 |
-
|
1933 |
-
|
1934 |
-
}
|
1935 |
|
1936 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1937 |
|
1938 |
/***/ }),
|
1939 |
|
1940 |
-
/***/
|
1941 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
1942 |
|
1943 |
"use strict";
|
|
|
|
|
|
|
1944 |
|
1945 |
-
|
1946 |
-
__webpack_require__.d(__webpack_exports__, "a", function() { return /* binding */ speak; });
|
1947 |
|
1948 |
-
|
1949 |
|
1950 |
-
|
1951 |
-
var build_module = __webpack_require__(70);
|
1952 |
|
1953 |
-
|
1954 |
-
/**
|
1955 |
-
* Build the live regions markup.
|
1956 |
-
*
|
1957 |
-
* @param {string} [ariaLive] Value for the 'aria-live' attribute; default: 'polite'.
|
1958 |
-
*
|
1959 |
-
* @return {HTMLDivElement} The ARIA live region HTML element.
|
1960 |
-
*/
|
1961 |
-
function addContainer() {
|
1962 |
-
var ariaLive = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'polite';
|
1963 |
-
var container = document.createElement('div');
|
1964 |
-
container.id = "a11y-speak-".concat(ariaLive);
|
1965 |
-
container.className = 'a11y-speak-region';
|
1966 |
-
container.setAttribute('style', 'position: absolute;' + 'margin: -1px;' + 'padding: 0;' + 'height: 1px;' + 'width: 1px;' + 'overflow: hidden;' + 'clip: rect(1px, 1px, 1px, 1px);' + '-webkit-clip-path: inset(50%);' + 'clip-path: inset(50%);' + 'border: 0;' + 'word-wrap: normal !important;');
|
1967 |
-
container.setAttribute('aria-live', ariaLive);
|
1968 |
-
container.setAttribute('aria-relevant', 'additions text');
|
1969 |
-
container.setAttribute('aria-atomic', 'true');
|
1970 |
-
var _document = document,
|
1971 |
-
body = _document.body;
|
1972 |
|
1973 |
-
|
1974 |
-
body.appendChild(container);
|
1975 |
-
}
|
1976 |
|
1977 |
-
|
1978 |
-
}
|
1979 |
-
//# sourceMappingURL=add-container.js.map
|
1980 |
-
// CONCATENATED MODULE: ./node_modules/@wordpress/a11y/build-module/clear.js
|
1981 |
-
/**
|
1982 |
-
* Clear the a11y-speak-region elements.
|
1983 |
-
*/
|
1984 |
-
function clear() {
|
1985 |
-
var regions = document.getElementsByClassName('a11y-speak-region');
|
1986 |
|
1987 |
-
|
1988 |
-
regions[i].textContent = '';
|
1989 |
-
}
|
1990 |
-
}
|
1991 |
-
//# sourceMappingURL=clear.js.map
|
1992 |
-
// CONCATENATED MODULE: ./node_modules/@wordpress/a11y/build-module/filter-message.js
|
1993 |
-
var previousMessage = '';
|
1994 |
-
/**
|
1995 |
-
* Filter the message to be announced to the screenreader.
|
1996 |
-
*
|
1997 |
-
* @param {string} message The message to be announced.
|
1998 |
-
*
|
1999 |
-
* @return {string} The filtered message.
|
2000 |
-
*/
|
2001 |
|
2002 |
-
|
2003 |
-
/*
|
2004 |
-
* Strip HTML tags (if any) from the message string. Ideally, messages should
|
2005 |
-
* be simple strings, carefully crafted for specific use with A11ySpeak.
|
2006 |
-
* When re-using already existing strings this will ensure simple HTML to be
|
2007 |
-
* stripped out and replaced with a space. Browsers will collapse multiple
|
2008 |
-
* spaces natively.
|
2009 |
-
*/
|
2010 |
-
message = message.replace(/<[^<>]+>/g, ' ');
|
2011 |
|
2012 |
-
|
2013 |
-
|
2014 |
-
|
2015 |
|
2016 |
-
previousMessage = message;
|
2017 |
-
return message;
|
2018 |
-
}
|
2019 |
-
//# sourceMappingURL=filter-message.js.map
|
2020 |
-
// CONCATENATED MODULE: ./node_modules/@wordpress/a11y/build-module/index.js
|
2021 |
/**
|
2022 |
-
*
|
2023 |
*/
|
2024 |
|
2025 |
/**
|
2026 |
* Internal dependencies
|
2027 |
*/
|
2028 |
|
|
|
|
|
|
|
|
|
2029 |
|
2030 |
|
2031 |
|
2032 |
-
|
2033 |
-
* Create the live regions.
|
2034 |
-
*/
|
2035 |
|
2036 |
-
|
2037 |
-
|
2038 |
-
var containerPolite = document.getElementById('a11y-speak-polite');
|
2039 |
|
2040 |
-
|
2041 |
-
addContainer('assertive');
|
2042 |
-
}
|
2043 |
|
2044 |
-
if (containerPolite === null) {
|
2045 |
-
addContainer('polite');
|
2046 |
-
}
|
2047 |
-
}
|
2048 |
-
/**
|
2049 |
-
* Run setup on domReady.
|
2050 |
-
*/
|
2051 |
|
2052 |
-
Object(build_module["a" /* default */])(setup);
|
2053 |
/**
|
2054 |
-
*
|
2055 |
-
* This module is inspired by the `speak` function in `wp-a11y.js`.
|
2056 |
-
*
|
2057 |
-
* @param {string} message The message to be announced by assistive technologies.
|
2058 |
-
* @param {string} [ariaLive] The politeness level for aria-live; default: 'polite'.
|
2059 |
-
*
|
2060 |
-
* @example
|
2061 |
-
* ```js
|
2062 |
-
* import { speak } from '@wordpress/a11y';
|
2063 |
*
|
2064 |
-
*
|
2065 |
-
*
|
2066 |
*
|
2067 |
-
*
|
2068 |
-
* speak( 'The message you want to send to the ARIA live region', 'assertive' );
|
2069 |
-
* ```
|
2070 |
*/
|
2071 |
|
2072 |
-
function
|
2073 |
-
|
2074 |
-
|
2075 |
-
|
2076 |
-
var containerAssertive = document.getElementById('a11y-speak-assertive');
|
2077 |
-
var containerPolite = document.getElementById('a11y-speak-polite');
|
2078 |
-
|
2079 |
-
if (containerAssertive && ariaLive === 'assertive') {
|
2080 |
-
containerAssertive.textContent = message;
|
2081 |
-
} else if (containerPolite) {
|
2082 |
-
containerPolite.textContent = message;
|
2083 |
-
}
|
2084 |
}
|
2085 |
-
//# sourceMappingURL=index.js.map
|
2086 |
-
|
2087 |
-
/***/ }),
|
2088 |
-
|
2089 |
-
/***/ 129:
|
2090 |
-
/***/ (function(module, exports, __webpack_require__) {
|
2091 |
-
|
2092 |
-
var objectWithoutPropertiesLoose = __webpack_require__(273);
|
2093 |
-
|
2094 |
-
function _objectWithoutProperties(source, excluded) {
|
2095 |
-
if (source == null) return {};
|
2096 |
-
var target = objectWithoutPropertiesLoose(source, excluded);
|
2097 |
-
var key, i;
|
2098 |
-
|
2099 |
-
if (Object.getOwnPropertySymbols) {
|
2100 |
-
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
2101 |
|
2102 |
-
|
2103 |
-
|
2104 |
-
|
2105 |
-
|
2106 |
-
|
2107 |
-
|
2108 |
-
}
|
2109 |
|
2110 |
-
|
2111 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2112 |
|
2113 |
-
module.exports =
|
2114 |
|
2115 |
/***/ }),
|
2116 |
|
2117 |
-
/***/
|
2118 |
/***/ (function(module, exports) {
|
2119 |
|
2120 |
-
(function() { module.exports = this["
|
2121 |
|
2122 |
/***/ }),
|
2123 |
|
2124 |
-
/***/
|
2125 |
-
/***/ (function(module,
|
2126 |
|
2127 |
"use strict";
|
2128 |
-
|
2129 |
-
|
|
|
|
|
|
|
|
|
2130 |
|
2131 |
-
function _objectWithoutProperties(source, excluded) {
|
2132 |
-
if (source == null) return {};
|
2133 |
-
var target = Object(_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])(source, excluded);
|
2134 |
-
var key, i;
|
2135 |
|
2136 |
-
if (Object.getOwnPropertySymbols) {
|
2137 |
-
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
2138 |
|
2139 |
-
|
2140 |
-
key = sourceSymbolKeys[i];
|
2141 |
-
if (excluded.indexOf(key) >= 0) continue;
|
2142 |
-
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
2143 |
-
target[key] = source[key];
|
2144 |
-
}
|
2145 |
-
}
|
2146 |
|
2147 |
-
|
2148 |
-
}
|
|
|
2149 |
|
2150 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2151 |
|
2152 |
-
|
2153 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2154 |
|
2155 |
-
|
2156 |
-
|
2157 |
-
o.__proto__ = p;
|
2158 |
-
return o;
|
2159 |
};
|
2160 |
|
2161 |
-
|
2162 |
-
|
|
|
|
|
2163 |
|
2164 |
-
module.exports = _setPrototypeOf;
|
2165 |
|
2166 |
/***/ }),
|
2167 |
|
2168 |
-
/***/
|
2169 |
/***/ (function(module, exports, __webpack_require__) {
|
2170 |
|
2171 |
"use strict";
|
2172 |
/**
|
2173 |
-
* Copyright (c)
|
2174 |
*
|
2175 |
* This source code is licensed under the MIT license found in the
|
2176 |
* LICENSE file in the root directory of this source tree.
|
@@ -2178,3295 +2083,3426 @@ module.exports = _setPrototypeOf;
|
|
2178 |
|
2179 |
|
2180 |
|
2181 |
-
var
|
2182 |
|
2183 |
-
|
2184 |
-
(typeof Symbol === 'function' && Symbol.for && Symbol.for('react.element')) ||
|
2185 |
-
0xeac7;
|
2186 |
|
2187 |
-
var emptyFunction = __webpack_require__(109);
|
2188 |
-
var invariant = __webpack_require__(149);
|
2189 |
-
var warning = __webpack_require__(150);
|
2190 |
|
2191 |
-
|
2192 |
-
var SUBSEPARATOR = ':';
|
2193 |
|
2194 |
-
|
|
|
2195 |
|
2196 |
-
|
2197 |
-
var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec.
|
2198 |
|
2199 |
-
function getIteratorFn(maybeIterable) {
|
2200 |
-
var iteratorFn =
|
2201 |
-
maybeIterable &&
|
2202 |
-
((ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL]) ||
|
2203 |
-
maybeIterable[FAUX_ITERATOR_SYMBOL]);
|
2204 |
-
if (typeof iteratorFn === 'function') {
|
2205 |
-
return iteratorFn;
|
2206 |
-
}
|
2207 |
-
}
|
2208 |
|
2209 |
-
|
2210 |
-
|
2211 |
-
|
2212 |
-
'=': '=0',
|
2213 |
-
':': '=2'
|
2214 |
-
};
|
2215 |
-
var escapedString = ('' + key).replace(escapeRegex, function(match) {
|
2216 |
-
return escaperLookup[match];
|
2217 |
-
});
|
2218 |
|
2219 |
-
|
2220 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2221 |
|
2222 |
-
|
2223 |
-
|
2224 |
-
|
2225 |
-
|
2226 |
-
|
2227 |
-
return escape(component.key);
|
2228 |
-
}
|
2229 |
-
// Implicit key determined by the index in the set
|
2230 |
-
return index.toString(36);
|
2231 |
-
}
|
2232 |
|
2233 |
-
|
2234 |
-
children,
|
2235 |
-
nameSoFar,
|
2236 |
-
callback,
|
2237 |
-
traverseContext
|
2238 |
-
) {
|
2239 |
-
var type = typeof children;
|
2240 |
|
2241 |
-
|
2242 |
-
|
2243 |
-
|
2244 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2245 |
|
2246 |
-
|
2247 |
-
|
2248 |
-
|
2249 |
-
|
2250 |
-
|
2251 |
-
|
2252 |
-
|
2253 |
-
) {
|
2254 |
-
callback(
|
2255 |
-
traverseContext,
|
2256 |
-
children,
|
2257 |
-
// If it's the only child, treat the name as if it was wrapped in an array
|
2258 |
-
// so that it's consistent if the number of children grows.
|
2259 |
-
nameSoFar === '' ? SEPARATOR + getComponentKey(children, 0) : nameSoFar
|
2260 |
-
);
|
2261 |
-
return 1;
|
2262 |
-
}
|
2263 |
|
2264 |
-
|
2265 |
-
|
2266 |
-
|
2267 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2268 |
|
2269 |
-
|
2270 |
-
|
2271 |
-
|
2272 |
-
|
2273 |
-
|
2274 |
-
|
2275 |
-
nextName,
|
2276 |
-
callback,
|
2277 |
-
traverseContext
|
2278 |
-
);
|
2279 |
}
|
2280 |
-
} else {
|
2281 |
-
var iteratorFn = getIteratorFn(children);
|
2282 |
-
if (iteratorFn) {
|
2283 |
-
if (false) {}
|
2284 |
|
2285 |
-
|
2286 |
-
|
2287 |
-
|
2288 |
-
|
2289 |
-
|
2290 |
-
|
2291 |
-
subtreeCount += traverseAllChildrenImpl(
|
2292 |
-
child,
|
2293 |
-
nextName,
|
2294 |
-
callback,
|
2295 |
-
traverseContext
|
2296 |
-
);
|
2297 |
-
}
|
2298 |
-
} else if (type === 'object') {
|
2299 |
-
var addendum = '';
|
2300 |
-
if (false) {}
|
2301 |
-
var childrenString = '' + children;
|
2302 |
-
invariant(
|
2303 |
-
false,
|
2304 |
-
'Objects are not valid as a React child (found: %s).%s',
|
2305 |
-
childrenString === '[object Object]'
|
2306 |
-
? 'object with keys {' + Object.keys(children).join(', ') + '}'
|
2307 |
-
: childrenString,
|
2308 |
-
addendum
|
2309 |
-
);
|
2310 |
}
|
2311 |
-
}
|
2312 |
|
2313 |
-
|
2314 |
-
}
|
2315 |
|
2316 |
-
|
2317 |
-
|
2318 |
-
|
2319 |
-
}
|
2320 |
|
2321 |
-
|
2322 |
-
|
|
|
|
|
|
|
|
|
|
|
2323 |
|
2324 |
-
var
|
2325 |
-
|
2326 |
-
return ('' + text).replace(userProvidedKeyEscapeRegex, '$&/');
|
2327 |
-
}
|
2328 |
|
2329 |
-
|
2330 |
-
|
2331 |
-
|
2332 |
-
{key: newKey},
|
2333 |
-
oldElement.props !== undefined ? oldElement.props.children : undefined
|
2334 |
-
);
|
2335 |
-
}
|
2336 |
|
2337 |
-
|
2338 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2339 |
|
2340 |
-
|
2341 |
-
var Klass = this;
|
2342 |
-
if (Klass.instancePool.length) {
|
2343 |
-
var instance = Klass.instancePool.pop();
|
2344 |
-
Klass.call(instance, copyFieldsFrom);
|
2345 |
-
return instance;
|
2346 |
-
} else {
|
2347 |
-
return new Klass(copyFieldsFrom);
|
2348 |
-
}
|
2349 |
};
|
2350 |
|
2351 |
-
var
|
2352 |
-
|
2353 |
-
|
2354 |
-
|
2355 |
-
NewKlass.instancePool = [];
|
2356 |
-
NewKlass.getPooled = pooler || DEFAULT_POOLER;
|
2357 |
-
if (!NewKlass.poolSize) {
|
2358 |
-
NewKlass.poolSize = DEFAULT_POOL_SIZE;
|
2359 |
-
}
|
2360 |
-
NewKlass.release = standardReleaser;
|
2361 |
-
return NewKlass;
|
2362 |
-
};
|
2363 |
|
2364 |
-
|
2365 |
-
|
2366 |
-
|
2367 |
-
instance instanceof Klass,
|
2368 |
-
'Trying to release an instance into a pool of a different type.'
|
2369 |
-
);
|
2370 |
-
instance.destructor();
|
2371 |
-
if (Klass.instancePool.length < Klass.poolSize) {
|
2372 |
-
Klass.instancePool.push(instance);
|
2373 |
-
}
|
2374 |
-
};
|
2375 |
|
2376 |
-
var
|
2377 |
-
|
2378 |
-
|
2379 |
-
|
2380 |
-
Klass.call(instance, a1, a2, a3, a4);
|
2381 |
-
return instance;
|
2382 |
-
} else {
|
2383 |
-
return new Klass(a1, a2, a3, a4);
|
2384 |
-
}
|
2385 |
-
};
|
2386 |
|
2387 |
-
|
2388 |
-
|
2389 |
-
|
2390 |
-
|
2391 |
-
|
2392 |
-
|
2393 |
-
}
|
2394 |
-
|
2395 |
-
|
2396 |
-
|
2397 |
-
|
2398 |
-
|
2399 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2400 |
};
|
2401 |
-
addPoolingTo(MapBookKeeping, fourArgumentPooler);
|
2402 |
|
2403 |
-
function
|
2404 |
-
|
2405 |
-
|
2406 |
-
var func = bookKeeping.func;
|
2407 |
-
var context = bookKeeping.context;
|
2408 |
|
2409 |
-
|
2410 |
-
|
2411 |
-
|
2412 |
-
|
2413 |
-
|
2414 |
-
|
2415 |
-
|
2416 |
-
|
2417 |
-
|
2418 |
-
if (React.isValidElement(mappedChild)) {
|
2419 |
-
mappedChild = cloneAndReplaceKey(
|
2420 |
-
mappedChild,
|
2421 |
-
// Keep both the (mapped) and old keys if they differ, just as
|
2422 |
-
// traverseAllChildren used to do for objects as children
|
2423 |
-
keyPrefix +
|
2424 |
-
(mappedChild.key && (!child || child.key !== mappedChild.key)
|
2425 |
-
? escapeUserProvidedKey(mappedChild.key) + '/'
|
2426 |
-
: '') +
|
2427 |
-
childKey
|
2428 |
-
);
|
2429 |
}
|
2430 |
-
result.push(mappedChild);
|
2431 |
-
}
|
2432 |
-
}
|
2433 |
|
2434 |
-
|
2435 |
-
var escapedPrefix = '';
|
2436 |
-
if (prefix != null) {
|
2437 |
-
escapedPrefix = escapeUserProvidedKey(prefix) + '/';
|
2438 |
-
}
|
2439 |
-
var traverseContext = MapBookKeeping.getPooled(
|
2440 |
-
array,
|
2441 |
-
escapedPrefix,
|
2442 |
-
func,
|
2443 |
-
context
|
2444 |
-
);
|
2445 |
-
traverseAllChildren(children, mapSingleChildIntoContext, traverseContext);
|
2446 |
-
MapBookKeeping.release(traverseContext);
|
2447 |
-
}
|
2448 |
|
2449 |
-
|
|
|
|
|
2450 |
|
2451 |
-
var
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2452 |
|
2453 |
-
|
2454 |
-
if (typeof object !== 'object' || !object || Array.isArray(object)) {
|
2455 |
-
warning(
|
2456 |
-
false,
|
2457 |
-
'React.addons.createFragment only accepts a single object. Got: %s',
|
2458 |
-
object
|
2459 |
-
);
|
2460 |
-
return object;
|
2461 |
-
}
|
2462 |
-
if (React.isValidElement(object)) {
|
2463 |
-
warning(
|
2464 |
-
false,
|
2465 |
-
'React.addons.createFragment does not accept a ReactElement ' +
|
2466 |
-
'without a wrapper object.'
|
2467 |
-
);
|
2468 |
-
return object;
|
2469 |
-
}
|
2470 |
|
2471 |
-
|
2472 |
-
|
2473 |
-
|
2474 |
-
'elements are not valid children of React components.'
|
2475 |
-
);
|
2476 |
|
2477 |
-
|
|
|
|
|
2478 |
|
2479 |
-
|
2480 |
-
|
2481 |
-
mapIntoWithKeyPrefixInternal(
|
2482 |
-
object[key],
|
2483 |
-
result,
|
2484 |
-
key,
|
2485 |
-
emptyFunction.thatReturnsArgument
|
2486 |
-
);
|
2487 |
-
}
|
2488 |
|
2489 |
-
|
2490 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2491 |
|
2492 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2493 |
|
2494 |
|
2495 |
/***/ }),
|
2496 |
|
2497 |
-
/***/
|
2498 |
-
/***/ (function(module,
|
2499 |
|
2500 |
"use strict";
|
2501 |
-
|
2502 |
-
|
2503 |
-
|
2504 |
-
|
2505 |
-
|
2506 |
-
*
|
2507 |
-
*/
|
2508 |
|
|
|
|
|
|
|
|
|
|
|
|
|
2509 |
|
|
|
|
|
2510 |
|
2511 |
-
|
2512 |
-
* Use invariant() to assert state which your program assumes to be true.
|
2513 |
-
*
|
2514 |
-
* Provide sprintf-style format (only %s is supported) and arguments
|
2515 |
-
* to provide information about what broke and what you were
|
2516 |
-
* expecting.
|
2517 |
-
*
|
2518 |
-
* The invariant message will be stripped in production, but the invariant
|
2519 |
-
* will remain to ensure logic does not differ in production.
|
2520 |
-
*/
|
2521 |
-
|
2522 |
-
var validateFormat = function validateFormat(format) {};
|
2523 |
-
|
2524 |
-
if (false) {}
|
2525 |
-
|
2526 |
-
function invariant(condition, format, a, b, c, d, e, f) {
|
2527 |
-
validateFormat(format);
|
2528 |
-
|
2529 |
-
if (!condition) {
|
2530 |
-
var error;
|
2531 |
-
if (format === undefined) {
|
2532 |
-
error = new Error('Minified exception occurred; use the non-minified dev environment ' + 'for the full error message and additional helpful warnings.');
|
2533 |
-
} else {
|
2534 |
-
var args = [a, b, c, d, e, f];
|
2535 |
-
var argIndex = 0;
|
2536 |
-
error = new Error(format.replace(/%s/g, function () {
|
2537 |
-
return args[argIndex++];
|
2538 |
-
}));
|
2539 |
-
error.name = 'Invariant Violation';
|
2540 |
-
}
|
2541 |
-
|
2542 |
-
error.framesToPop = 1; // we don't care about invariant's own frame
|
2543 |
-
throw error;
|
2544 |
-
}
|
2545 |
}
|
2546 |
|
2547 |
-
module.exports = invariant;
|
2548 |
-
|
2549 |
/***/ }),
|
2550 |
|
2551 |
-
/***/
|
2552 |
-
/***/ (function(module,
|
2553 |
|
2554 |
"use strict";
|
2555 |
|
2556 |
-
// EXPORTS
|
2557 |
-
__webpack_require__.d(__webpack_exports__, "a", function() { return /* binding */ _toConsumableArray; });
|
2558 |
-
|
2559 |
-
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js
|
2560 |
-
var arrayLikeToArray = __webpack_require__(30);
|
2561 |
|
2562 |
-
|
2563 |
|
2564 |
-
|
2565 |
-
|
2566 |
-
}
|
2567 |
-
// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/iterableToArray.js
|
2568 |
-
function _iterableToArray(iter) {
|
2569 |
-
if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter);
|
2570 |
-
}
|
2571 |
-
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js
|
2572 |
-
var unsupportedIterableToArray = __webpack_require__(49);
|
2573 |
|
2574 |
-
|
2575 |
-
|
2576 |
-
|
2577 |
-
|
2578 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2579 |
|
|
|
|
|
|
|
|
|
|
|
2580 |
|
|
|
|
|
|
|
|
|
2581 |
|
|
|
|
|
2582 |
|
2583 |
-
function
|
2584 |
-
|
2585 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2586 |
|
2587 |
-
|
|
|
|
|
|
|
|
|
|
|
2588 |
|
2589 |
-
|
2590 |
-
|
2591 |
|
2592 |
-
|
2593 |
-
|
2594 |
-
|
2595 |
-
|
2596 |
-
|
2597 |
-
|
2598 |
-
|
2599 |
-
*/
|
2600 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2601 |
|
|
|
|
|
|
|
|
|
|
|
2602 |
|
2603 |
-
var
|
|
|
2604 |
|
2605 |
-
|
2606 |
-
|
2607 |
-
|
2608 |
-
|
2609 |
-
|
2610 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2611 |
|
2612 |
-
|
|
|
|
|
2613 |
|
2614 |
-
if (
|
|
|
|
|
2615 |
|
2616 |
-
|
|
|
|
|
|
|
|
|
|
|
2617 |
|
2618 |
-
|
|
|
2619 |
|
2620 |
-
|
2621 |
-
|
2622 |
|
2623 |
-
|
|
|
|
|
2624 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2625 |
|
2626 |
-
|
2627 |
-
|
2628 |
-
if (item.match(/^\{\{\//)) {
|
2629 |
-
return {
|
2630 |
-
type: 'componentClose',
|
2631 |
-
value: item.replace(/\W/g, '')
|
2632 |
-
};
|
2633 |
-
}
|
2634 |
-
// {{example /}}
|
2635 |
-
if (item.match(/\/\}\}$/)) {
|
2636 |
-
return {
|
2637 |
-
type: 'componentSelfClosing',
|
2638 |
-
value: item.replace(/\W/g, '')
|
2639 |
-
};
|
2640 |
-
}
|
2641 |
-
// {{example}}
|
2642 |
-
if (item.match(/^\{\{/)) {
|
2643 |
-
return {
|
2644 |
-
type: 'componentOpen',
|
2645 |
-
value: item.replace(/\W/g, '')
|
2646 |
-
};
|
2647 |
-
}
|
2648 |
-
return {
|
2649 |
-
type: 'string',
|
2650 |
-
value: item
|
2651 |
-
};
|
2652 |
-
}
|
2653 |
|
2654 |
-
|
2655 |
-
var tokenStrings = mixedString.split(/(\{\{\/?\s*\w+\s*\/?\}\})/g); // split to components and strings
|
2656 |
-
return tokenStrings.map(identifyToken);
|
2657 |
};
|
2658 |
-
//# sourceMappingURL=tokenize.js.map
|
2659 |
|
2660 |
-
|
|
|
|
|
|
|
2661 |
|
2662 |
-
|
2663 |
-
|
2664 |
|
2665 |
-
|
2666 |
-
if (len == null || len > arr.length) len = arr.length;
|
2667 |
|
2668 |
-
|
2669 |
-
|
2670 |
-
}
|
2671 |
|
2672 |
-
|
2673 |
-
}
|
2674 |
|
2675 |
-
|
|
|
2676 |
|
2677 |
-
|
2678 |
|
2679 |
-
|
2680 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2681 |
|
2682 |
-
(function() { module.exports = this["moment"]; }());
|
2683 |
|
2684 |
/***/ }),
|
2685 |
|
2686 |
-
/***/
|
2687 |
-
/***/ (function(module,
|
2688 |
|
2689 |
"use strict";
|
2690 |
-
|
2691 |
-
|
2692 |
-
|
2693 |
-
* External dependencies
|
2694 |
-
*/
|
2695 |
|
2696 |
/**
|
2697 |
-
*
|
2698 |
-
* composition, where each successive invocation is supplied the return value of the previous.
|
2699 |
*
|
2700 |
-
* @param {
|
|
|
2701 |
*
|
2702 |
-
* @return {
|
2703 |
*/
|
|
|
|
|
2704 |
|
2705 |
-
|
2706 |
-
|
|
|
2707 |
|
2708 |
-
|
|
|
2709 |
|
2710 |
-
|
2711 |
-
|
|
|
2712 |
|
2713 |
-
|
2714 |
-
if (key in obj) {
|
2715 |
-
Object.defineProperty(obj, key, {
|
2716 |
-
value: value,
|
2717 |
-
enumerable: true,
|
2718 |
-
configurable: true,
|
2719 |
-
writable: true
|
2720 |
-
});
|
2721 |
-
} else {
|
2722 |
-
obj[key] = value;
|
2723 |
-
}
|
2724 |
|
2725 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2726 |
}
|
2727 |
|
2728 |
-
module.exports =
|
|
|
2729 |
|
2730 |
/***/ }),
|
2731 |
|
2732 |
-
/***/
|
2733 |
-
/***/ (function(module,
|
2734 |
|
2735 |
"use strict";
|
2736 |
|
2737 |
-
// EXPORTS
|
2738 |
-
__webpack_require__.d(__webpack_exports__, "a", function() { return /* reexport */ client_ApiClient; });
|
2739 |
-
__webpack_require__.d(__webpack_exports__, "b", function() { return /* reexport */ MINUTE; });
|
2740 |
-
__webpack_require__.d(__webpack_exports__, "c", function() { return /* reexport */ SECOND; });
|
2741 |
|
2742 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2743 |
|
2744 |
-
|
2745 |
-
|
2746 |
-
|
2747 |
|
2748 |
-
|
2749 |
-
|
|
|
2750 |
|
2751 |
-
|
2752 |
-
|
|
|
|
|
|
|
2753 |
|
2754 |
-
|
2755 |
-
|
2756 |
-
var browser_default = /*#__PURE__*/__webpack_require__.n(browser);
|
2757 |
|
2758 |
-
|
2759 |
-
var external_lodash_ = __webpack_require__(2);
|
2760 |
|
2761 |
-
// CONCATENATED MODULE: ./node_modules/@fresh-data/framework/es/client/calculate-updates.js
|
2762 |
-
var DEFAULT_MAX_UPDATE = 30000;
|
2763 |
-
var DEFAULT_MIN_UPDATE = 500;
|
2764 |
-
/**
|
2765 |
-
* Compares requirements against current state for update information.
|
2766 |
-
* Takes a list of requirements and the current state, both keyed by resourceName,
|
2767 |
-
* and returns update information which contains an array of resourceNames that are
|
2768 |
-
* currently needed and when the next update cycle should run, in milleseconds.
|
2769 |
-
* @param {Object} requirementsByResource List of requirements keyed by resourceName.
|
2770 |
-
* @param {Object} resourceState State indexed by resourceName.
|
2771 |
-
* @param {number} [minUpdate] Minimum nextUpdate value.
|
2772 |
-
* @param {number} [maxUpdate] Maximum nextUpdate value.
|
2773 |
-
* @param {Date} [now] Current time (used for tests).
|
2774 |
-
* @return {Object} updateInfo: { nextUpdate, updates }
|
2775 |
-
* @see combineComponentRequirements
|
2776 |
-
*/
|
2777 |
|
2778 |
-
|
2779 |
-
if (minUpdate === void 0) {
|
2780 |
-
minUpdate = DEFAULT_MIN_UPDATE;
|
2781 |
-
}
|
2782 |
|
2783 |
-
|
2784 |
-
|
2785 |
-
|
|
|
2786 |
|
2787 |
-
if (now === void 0) {
|
2788 |
-
now = new Date();
|
2789 |
-
}
|
2790 |
|
2791 |
-
var updateInfo = {
|
2792 |
-
updates: [],
|
2793 |
-
nextUpdate: maxUpdate
|
2794 |
-
};
|
2795 |
-
appendUpdatesForResources(updateInfo, requirementsByResource, resourceState, now);
|
2796 |
-
updateInfo.nextUpdate = Math.max(updateInfo.nextUpdate, minUpdate);
|
2797 |
-
return updateInfo;
|
2798 |
-
}
|
2799 |
/**
|
2800 |
-
*
|
2801 |
-
*
|
2802 |
-
* @param {Object} requirementsByResource List of requirements keyed by resource.
|
2803 |
-
* @param {Object} resourceState State indexed by resourceName.
|
2804 |
-
* @param {Date} [now] Current time (used for tests).
|
2805 |
-
* @see calculateUpdates
|
2806 |
-
* @see appendUpdatesForResource
|
2807 |
*/
|
2808 |
-
|
2809 |
-
|
2810 |
-
|
2811 |
-
|
2812 |
-
|
2813 |
-
|
|
|
|
|
|
|
|
|
2814 |
});
|
2815 |
-
|
2816 |
-
|
2817 |
-
|
2818 |
-
* @param {Object} updateInfo Update information to be mutated by this function.
|
2819 |
-
* @param {string} resourceName Name of the resource to be analyzed.
|
2820 |
-
* @param {Object} requirements The requirements for this level of the tree.
|
2821 |
-
* @param {Object} state The current state for this resource.
|
2822 |
-
* @param {Date} [now] Current time (used for tests).
|
2823 |
-
* @see appendUpdatesForResources
|
2824 |
-
*/
|
2825 |
|
|
|
|
|
|
|
|
|
2826 |
|
2827 |
-
|
2828 |
-
|
2829 |
-
|
2830 |
-
|
2831 |
-
|
2832 |
-
|
2833 |
-
|
2834 |
-
updateInfo.nextUpdate = Math.min(updateInfo.nextUpdate, nextUpdate);
|
2835 |
|
2836 |
-
|
2837 |
-
|
2838 |
-
|
2839 |
-
}
|
2840 |
-
|
2841 |
-
|
2842 |
-
|
2843 |
-
* @param {Object} state The matching state for the resource.
|
2844 |
-
* @param {Date} now Current time (used for tests).
|
2845 |
-
* @return {number} Time left until timeout, or MAX_SAFE_INTEGER if not applicable.
|
2846 |
-
*/
|
2847 |
|
|
|
|
|
2848 |
|
2849 |
-
|
2850 |
-
|
2851 |
-
|
|
|
2852 |
|
2853 |
-
|
2854 |
-
return timeout - (now - lastRequested);
|
2855 |
}
|
2856 |
|
2857 |
-
|
2858 |
-
|
2859 |
-
|
2860 |
-
|
2861 |
-
|
2862 |
-
|
2863 |
-
|
2864 |
-
|
2865 |
-
*/
|
2866 |
|
2867 |
-
function
|
2868 |
-
|
2869 |
|
2870 |
-
|
2871 |
-
|
2872 |
-
|
|
|
2873 |
|
2874 |
-
|
2875 |
-
|
2876 |
-
|
2877 |
-
|
2878 |
-
* Generates information about components that require resources.
|
2879 |
-
* @param {Object} client The client to inspect.
|
2880 |
-
* @return {Array} An array of objects that describe components and their requirements.
|
2881 |
-
*/
|
2882 |
-
function components_components(client) {
|
2883 |
-
var componentSummaries = [];
|
2884 |
-
client.requirementsByComponent.forEach(function (requirements, component) {
|
2885 |
-
componentSummaries.push({
|
2886 |
-
component: component,
|
2887 |
-
requirements: requirements
|
2888 |
-
});
|
2889 |
-
});
|
2890 |
-
return componentSummaries;
|
2891 |
-
}
|
2892 |
-
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js
|
2893 |
-
var objectWithoutPropertiesLoose = __webpack_require__(46);
|
2894 |
|
2895 |
-
//
|
2896 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2897 |
|
|
|
|
|
|
|
|
|
2898 |
|
2899 |
|
2900 |
-
|
2901 |
-
|
2902 |
-
|
|
|
|
|
|
|
2903 |
|
2904 |
-
|
2905 |
-
|
2906 |
-
fetching: 'fetching',
|
2907 |
-
stale: 'stale',
|
2908 |
-
fresh: 'fresh',
|
2909 |
-
notRequired: 'notRequired'
|
2910 |
-
};
|
2911 |
-
/**
|
2912 |
-
* Compiles information about the resources available from a fresh-data client.
|
2913 |
-
* @param {Object} client A fresh-data client to be inspected.
|
2914 |
-
* @return {Object} A list of detailed resource info objects, keyed by resource name.
|
2915 |
-
*/
|
2916 |
|
2917 |
-
|
2918 |
-
|
2919 |
-
|
2920 |
-
var resourceNames = Object(external_lodash_["union"])(Object.keys(resourceState), Object.keys(requirements));
|
2921 |
-
return resourceNames.reduce(function (resourceInfo, resourceName) {
|
2922 |
-
var resource = resourceState[resourceName] || {};
|
2923 |
-
var data = resource.data;
|
2924 |
-
var status = getStatus(resource, requirements[resourceName]);
|
2925 |
-
var summary = getSummary(status, resource, requirements[resourceName]);
|
2926 |
-
resourceInfo[resourceName] = {
|
2927 |
-
status: status,
|
2928 |
-
summary: summary,
|
2929 |
-
data: data
|
2930 |
-
};
|
2931 |
|
2932 |
-
|
2933 |
-
|
2934 |
-
|
2935 |
-
|
2936 |
-
|
|
|
|
|
|
|
|
|
|
|
2937 |
}
|
2938 |
|
2939 |
-
|
2940 |
-
|
2941 |
-
|
|
|
|
|
|
|
|
|
|
|
2942 |
|
2943 |
-
|
2944 |
-
|
2945 |
-
|
2946 |
-
}
|
2947 |
|
2948 |
-
|
2949 |
-
|
2950 |
-
|
2951 |
-
var freshnessLeft = getFreshnessLeft(freshness, resource, now);
|
2952 |
|
2953 |
-
|
2954 |
-
var
|
2955 |
|
2956 |
-
if (
|
2957 |
-
|
|
|
2958 |
}
|
2959 |
|
2960 |
-
return
|
2961 |
}
|
2962 |
|
2963 |
-
|
2964 |
-
|
|
|
|
|
2965 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2966 |
|
2967 |
-
return STATUS.fresh;
|
2968 |
-
}
|
2969 |
-
|
2970 |
-
function getSummary(status, resource, requirement) {
|
2971 |
-
var now = new Date();
|
2972 |
|
2973 |
-
|
2974 |
-
|
2975 |
-
|
2976 |
-
|
2977 |
-
|
2978 |
-
|
2979 |
-
|
2980 |
-
return millisToString(timeoutLeft) + " until timeout";
|
2981 |
|
2982 |
-
|
2983 |
-
|
2984 |
-
|
|
|
|
|
2985 |
|
2986 |
-
|
2987 |
-
var freshnessLeft = getFreshnessLeft(requirement.freshness, resource, now);
|
2988 |
-
return "Fresh for " + millisToString(freshnessLeft);
|
2989 |
|
2990 |
-
|
2991 |
-
|
2992 |
-
|
2993 |
-
|
2994 |
-
}
|
|
|
2995 |
|
2996 |
-
|
2997 |
-
|
2998 |
-
|
|
|
2999 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
3000 |
|
3001 |
-
var _requirement = requirement,
|
3002 |
-
freshness = _requirement.freshness,
|
3003 |
-
timeout = _requirement.timeout,
|
3004 |
-
other = Object(objectWithoutPropertiesLoose["a" /* default */])(_requirement, ["freshness", "timeout"]);
|
3005 |
-
|
3006 |
-
return Object(esm_extends["a" /* default */])({
|
3007 |
-
freshness: millisToString(freshness),
|
3008 |
-
timeout: millisToString(timeout)
|
3009 |
-
}, other);
|
3010 |
-
}
|
3011 |
-
|
3012 |
-
var SECOND_IN_MILLIS = 1000;
|
3013 |
-
var MINUTE_IN_MILLIS = SECOND_IN_MILLIS * 60;
|
3014 |
-
var HOUR_IN_MILLIS = MINUTE_IN_MILLIS * 60;
|
3015 |
|
3016 |
-
function
|
3017 |
-
|
3018 |
-
|
|
|
|
|
|
|
3019 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3020 |
|
3021 |
-
var hours = Math.floor(millis / HOUR_IN_MILLIS);
|
3022 |
-
millis -= hours * HOUR_IN_MILLIS;
|
3023 |
-
var minutes = Math.floor(millis / MINUTE_IN_MILLIS);
|
3024 |
-
millis -= minutes * MINUTE_IN_MILLIS;
|
3025 |
-
var seconds = millis / SECOND_IN_MILLIS;
|
3026 |
-
var str = '';
|
3027 |
-
str = hours ? hours + " hours " : str;
|
3028 |
-
str = minutes ? "" + str + minutes + " mins " : str;
|
3029 |
-
str = seconds ? "" + str + seconds + " secs " : str;
|
3030 |
-
return str;
|
3031 |
-
}
|
3032 |
-
|
3033 |
-
function getComponentsForResource(requirementsByComponent, resourceName) {
|
3034 |
-
var components = [];
|
3035 |
-
requirementsByComponent.forEach(function (requirements, component) {
|
3036 |
-
var requirement = Object(external_lodash_["find"])(requirements, {
|
3037 |
-
resourceName: resourceName
|
3038 |
-
});
|
3039 |
|
3040 |
-
|
3041 |
-
|
|
|
3042 |
}
|
3043 |
-
});
|
3044 |
-
return components.length ? components : null;
|
3045 |
-
}
|
3046 |
-
// CONCATENATED MODULE: ./node_modules/@fresh-data/framework/es/devinfo/summary.js
|
3047 |
-
|
3048 |
-
|
3049 |
-
/**
|
3050 |
-
* A string summary of fresh-data client resources
|
3051 |
-
* @param {Object} resources Resources generated by ./resources.js for a client.
|
3052 |
-
* @return {string} A single-line string summary.
|
3053 |
-
*/
|
3054 |
-
|
3055 |
-
function summary_summary(resources) {
|
3056 |
-
var resourceNames = Object.keys(resources);
|
3057 |
-
var components = [];
|
3058 |
-
var freshCount = 0;
|
3059 |
-
var staleCount = 0;
|
3060 |
-
var timedOutCount = 0;
|
3061 |
-
var fetchingCount = 0;
|
3062 |
-
var notRequiredCount = 0;
|
3063 |
-
resourceNames.forEach(function (resourceName) {
|
3064 |
-
var resource = resources[resourceName];
|
3065 |
-
components = Object(external_lodash_["union"])(components, resource.componentsRequiring);
|
3066 |
-
|
3067 |
-
switch (resource.status) {
|
3068 |
-
case STATUS.overdue:
|
3069 |
-
timedOutCount++;
|
3070 |
-
break;
|
3071 |
-
|
3072 |
-
case STATUS.fetching:
|
3073 |
-
fetchingCount++;
|
3074 |
-
break;
|
3075 |
|
3076 |
-
|
3077 |
-
|
3078 |
-
break;
|
3079 |
|
3080 |
-
|
3081 |
-
|
3082 |
-
|
|
|
|
|
3083 |
|
3084 |
-
|
3085 |
-
|
|
|
|
|
3086 |
}
|
3087 |
-
});
|
3088 |
-
var text = resourceNames.length + " resources, " + components.length + " components ( ";
|
3089 |
|
3090 |
-
|
3091 |
-
text += freshCount + " fresh ";
|
3092 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3093 |
|
3094 |
-
if (staleCount) {
|
3095 |
-
text += staleCount + " stale ";
|
3096 |
-
}
|
3097 |
|
3098 |
-
|
3099 |
-
|
3100 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3101 |
|
3102 |
-
if (timedOutCount) {
|
3103 |
-
text += timedOutCount + " timed out ";
|
3104 |
-
}
|
3105 |
|
3106 |
-
|
3107 |
-
|
|
|
|
|
|
|
|
|
3108 |
}
|
3109 |
|
3110 |
-
|
3111 |
-
return
|
3112 |
}
|
3113 |
-
// CONCATENATED MODULE: ./node_modules/@fresh-data/framework/es/devinfo/index.js
|
3114 |
|
|
|
3115 |
|
|
|
|
|
|
|
|
|
3116 |
|
3117 |
-
var devInfo = {};
|
3118 |
/**
|
3119 |
-
*
|
3120 |
-
* @return {boolean} True if dev info is enabled, false if not.
|
3121 |
*/
|
3122 |
|
3123 |
-
|
3124 |
-
|
3125 |
-
|
|
|
|
|
|
|
|
|
3126 |
/**
|
3127 |
-
*
|
3128 |
-
*
|
3129 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3130 |
*/
|
3131 |
|
3132 |
-
function
|
3133 |
-
|
3134 |
-
|
3135 |
-
|
|
|
|
|
|
|
3136 |
}
|
3137 |
-
|
|
|
|
|
|
|
|
|
|
|
3138 |
/**
|
3139 |
-
*
|
3140 |
-
*
|
3141 |
-
* @
|
|
|
|
|
3142 |
*/
|
3143 |
|
3144 |
-
function
|
3145 |
-
|
3146 |
-
|
3147 |
-
|
3148 |
-
|
3149 |
-
|
3150 |
-
|
3151 |
-
|
3152 |
-
|
3153 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3154 |
}
|
|
|
3155 |
/**
|
3156 |
-
*
|
3157 |
-
*
|
|
|
|
|
|
|
3158 |
*/
|
3159 |
|
3160 |
-
|
3161 |
-
|
3162 |
-
if (
|
3163 |
-
|
3164 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3165 |
}
|
3166 |
-
// CONCATENATED MODULE: ./node_modules/@fresh-data/framework/es/utils/constants.js
|
3167 |
-
var SECOND = 1000;
|
3168 |
-
var MINUTE = 60 * SECOND;
|
3169 |
-
var HOUR = 60 * MINUTE;
|
3170 |
-
// CONCATENATED MODULE: ./node_modules/@fresh-data/framework/es/client/requirements.js
|
3171 |
-
|
3172 |
|
3173 |
-
|
3174 |
-
var DEFAULTS = {
|
3175 |
-
freshness: Number.MAX_SAFE_INTEGER,
|
3176 |
-
timeout: 20 * SECOND
|
3177 |
-
};
|
3178 |
/**
|
3179 |
-
*
|
3180 |
-
*
|
3181 |
-
* @
|
|
|
|
|
3182 |
*/
|
3183 |
|
3184 |
-
function
|
3185 |
-
var
|
3186 |
-
|
3187 |
-
|
3188 |
-
|
3189 |
-
|
3190 |
-
|
3191 |
-
|
3192 |
-
|
3193 |
-
|
3194 |
-
|
|
|
|
|
|
|
|
|
3195 |
}
|
3196 |
-
/**
|
3197 |
-
* Mutates the state of requirementsByResource by adding requirement parameters to it.
|
3198 |
-
* @param {Object} requirementsByResource List of requirements keyed by resourceName.
|
3199 |
-
* @param {Object} reqParams New requirement parameters ( e.g. { freshness: 30 * SECOND } )
|
3200 |
-
* @param {string} resourceName Name of resource being required.
|
3201 |
-
*/
|
3202 |
-
|
3203 |
-
function addResourceRequirement(requirementsByResource, reqParams, resourceName) {
|
3204 |
-
var requirement = requirementsByResource[resourceName] || Object(esm_extends["a" /* default */])({}, DEFAULTS);
|
3205 |
|
3206 |
-
addRequirementParams(requirement, reqParams);
|
3207 |
-
requirementsByResource[resourceName] = requirement;
|
3208 |
-
}
|
3209 |
/**
|
3210 |
-
*
|
3211 |
-
* @param {Object} requirements Contains requirement parameters.
|
3212 |
-
* @param {Object} reqParams New requirement parameters (freshness, timeout), to be merged with existing ones.
|
3213 |
*/
|
3214 |
|
3215 |
-
function
|
3216 |
-
var
|
3217 |
-
|
3218 |
-
var newFreshness = reqParams.freshness || Number.MAX_SAFE_INTEGER;
|
3219 |
-
var newTimeout = reqParams.timeout || Number.MAX_SAFE_INTEGER;
|
3220 |
-
requirements.freshness = Math.min(freshness, newFreshness);
|
3221 |
-
requirements.timeout = Math.min(timeout, newTimeout);
|
3222 |
}
|
3223 |
-
// CONCATENATED MODULE: ./node_modules/@fresh-data/framework/es/client/index.js
|
3224 |
-
|
3225 |
-
|
3226 |
-
|
3227 |
|
3228 |
|
|
|
3229 |
|
|
|
|
|
3230 |
|
|
|
3231 |
|
3232 |
-
|
3233 |
|
3234 |
-
|
3235 |
-
|
3236 |
-
}
|
3237 |
|
3238 |
-
function
|
3239 |
-
|
|
|
|
|
3240 |
}
|
3241 |
|
3242 |
-
|
3243 |
-
var _this = this;
|
3244 |
-
|
3245 |
-
if (setTimer === void 0) {
|
3246 |
-
setTimer = _setTimer;
|
3247 |
-
}
|
3248 |
-
|
3249 |
-
if (clearTimer === void 0) {
|
3250 |
-
clearTimer = _clearTimer;
|
3251 |
-
}
|
3252 |
-
|
3253 |
-
this.getName = function () {
|
3254 |
-
return _this.name || 'UID_' + _this.uid;
|
3255 |
-
};
|
3256 |
-
|
3257 |
-
this.mapOperations = function (apiOperations) {
|
3258 |
-
return Object.keys(apiOperations).reduce(function (operations, operationName) {
|
3259 |
-
operations[operationName] = function (resourceNames, data) {
|
3260 |
-
var apiOperation = apiOperations[operationName];
|
3261 |
-
return _this.applyOperation(apiOperation, resourceNames, data);
|
3262 |
-
};
|
3263 |
|
3264 |
-
|
3265 |
-
}, {});
|
3266 |
-
};
|
3267 |
|
3268 |
-
|
3269 |
-
|
3270 |
-
dataReceived = _ref.dataReceived;
|
3271 |
-
_this.dataHandlers = {
|
3272 |
-
dataRequested: dataRequested,
|
3273 |
-
dataReceived: dataReceived
|
3274 |
-
};
|
3275 |
-
};
|
3276 |
|
3277 |
-
|
3278 |
-
if (now === void 0) {
|
3279 |
-
now = new Date();
|
3280 |
-
}
|
3281 |
|
3282 |
-
|
3283 |
-
|
3284 |
|
3285 |
-
|
3286 |
|
3287 |
-
|
3288 |
-
|
3289 |
-
});
|
3290 |
|
3291 |
-
|
3292 |
-
|
3293 |
-
};
|
3294 |
|
3295 |
-
|
3296 |
-
|
3297 |
-
|
|
|
3298 |
|
3299 |
-
|
3300 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
3301 |
|
3302 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3303 |
|
3304 |
-
|
3305 |
-
|
|
|
3306 |
|
3307 |
-
|
3308 |
-
|
3309 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3310 |
|
3311 |
-
|
3312 |
-
|
|
|
3313 |
|
3314 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3315 |
|
3316 |
-
|
3317 |
-
|
|
|
3318 |
|
3319 |
-
this.getResource = function (resourceName) {
|
3320 |
-
var resources = _this.state.resources || {};
|
3321 |
-
var resource = resources[resourceName] || {};
|
3322 |
-
return resource;
|
3323 |
-
};
|
3324 |
|
3325 |
-
|
3326 |
-
|
3327 |
-
|
3328 |
-
|
3329 |
-
|
3330 |
-
|
3331 |
-
|
3332 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
3333 |
|
3334 |
-
|
3335 |
-
|
3336 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3337 |
|
3338 |
-
|
3339 |
-
|
3340 |
-
}
|
3341 |
|
3342 |
-
|
3343 |
-
|
3344 |
-
|
3345 |
-
|
|
|
|
|
|
|
|
|
3346 |
|
3347 |
-
|
|
|
|
|
3348 |
|
3349 |
-
_this.updateRequirementsByResource(now);
|
3350 |
-
};
|
3351 |
|
3352 |
-
this.setComponentRequirements = function (component, componentRequirements, now) {
|
3353 |
-
if (now === void 0) {
|
3354 |
-
now = new Date();
|
3355 |
-
}
|
3356 |
|
3357 |
-
_this.requirementsByComponent.set(component, componentRequirements);
|
3358 |
|
3359 |
-
_this.updateRequirementsByResource(now);
|
3360 |
-
};
|
3361 |
|
3362 |
-
|
3363 |
-
|
3364 |
-
|
3365 |
-
}
|
3366 |
|
3367 |
-
|
3368 |
-
|
|
|
|
|
3369 |
|
3370 |
-
|
|
|
|
|
3371 |
|
3372 |
-
|
|
|
|
|
3373 |
|
3374 |
-
|
3375 |
-
|
3376 |
-
|
3377 |
-
|
3378 |
-
|
|
|
|
|
3379 |
|
3380 |
-
|
3381 |
-
|
3382 |
-
|
3383 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3384 |
|
3385 |
-
|
3386 |
-
|
3387 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3388 |
|
3389 |
-
|
3390 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3391 |
|
3392 |
-
_this.updateTimer(now);
|
3393 |
-
}
|
3394 |
-
};
|
3395 |
|
3396 |
-
|
3397 |
-
|
3398 |
-
|
3399 |
-
|
3400 |
-
|
3401 |
-
regenerator_default.a.mark(function _callee(now) {
|
3402 |
-
var requirementsByComponent, requirementsByResource, state, minUpdate, maxUpdate, resourceState, componentCount, resourceCount, _calculateUpdates, nextUpdate, updates, readOperationName, readOperation;
|
3403 |
|
3404 |
-
|
3405 |
-
while (1) {
|
3406 |
-
switch (_context.prev = _context.next) {
|
3407 |
-
case 0:
|
3408 |
-
requirementsByComponent = _this.requirementsByComponent, requirementsByResource = _this.requirementsByResource, state = _this.state, minUpdate = _this.minUpdate, maxUpdate = _this.maxUpdate;
|
3409 |
-
resourceState = state.resources || {};
|
3410 |
-
componentCount = requirementsByComponent.size;
|
3411 |
-
resourceCount = Object.keys(requirementsByResource).length;
|
3412 |
|
3413 |
-
|
|
|
3414 |
|
3415 |
-
|
3416 |
|
3417 |
-
|
3418 |
-
|
3419 |
-
|
3420 |
-
|
3421 |
|
3422 |
-
|
|
|
3423 |
|
3424 |
-
|
3425 |
-
|
3426 |
-
|
3427 |
-
|
|
|
|
|
|
|
3428 |
|
3429 |
-
|
3430 |
-
|
3431 |
|
3432 |
-
|
3433 |
-
_context.next = 13;
|
3434 |
-
break;
|
3435 |
-
}
|
3436 |
|
3437 |
-
|
3438 |
|
3439 |
-
|
3440 |
-
|
3441 |
-
return _this.operations[readOperationName](updates);
|
3442 |
|
3443 |
-
|
3444 |
-
|
|
|
3445 |
|
3446 |
-
|
|
|
|
|
|
|
3447 |
|
3448 |
-
|
3449 |
-
|
3450 |
-
_context.next = 21;
|
3451 |
-
break;
|
3452 |
-
|
3453 |
-
case 20:
|
3454 |
-
if (_this.timeoutId) {
|
3455 |
-
_this.debug('Unscheduling future updates');
|
3456 |
|
3457 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
3458 |
|
3459 |
-
|
3460 |
-
|
3461 |
|
3462 |
-
|
3463 |
-
case "end":
|
3464 |
-
return _context.stop();
|
3465 |
-
}
|
3466 |
-
}
|
3467 |
-
}, _callee);
|
3468 |
-
}));
|
3469 |
|
3470 |
-
|
3471 |
-
|
3472 |
-
};
|
3473 |
-
}();
|
3474 |
|
3475 |
-
|
3476 |
-
if (nextUpdate === void 0) {
|
3477 |
-
nextUpdate = undefined;
|
3478 |
-
}
|
3479 |
|
3480 |
-
|
3481 |
-
|
3482 |
-
minUpdate = _this.minUpdate,
|
3483 |
-
maxUpdate = _this.maxUpdate;
|
3484 |
-
var resourceState = state.resources || {};
|
3485 |
|
3486 |
-
|
3487 |
-
|
3488 |
-
}
|
3489 |
|
3490 |
-
|
3491 |
-
_this.clearTimer(_this.timeoutId);
|
3492 |
|
3493 |
-
|
3494 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3495 |
|
3496 |
-
|
3497 |
-
|
3498 |
-
|
3499 |
-
|
|
|
3500 |
|
3501 |
-
this.applyOperation =
|
3502 |
-
/*#__PURE__*/
|
3503 |
-
function () {
|
3504 |
-
var _ref3 = Object(asyncToGenerator["a" /* default */])(
|
3505 |
-
/*#__PURE__*/
|
3506 |
-
regenerator_default.a.mark(function _callee3(apiOperation, resourceNames, data) {
|
3507 |
-
var operationResult, values, requests;
|
3508 |
-
return regenerator_default.a.wrap(function _callee3$(_context3) {
|
3509 |
-
while (1) {
|
3510 |
-
switch (_context3.prev = _context3.next) {
|
3511 |
-
case 0:
|
3512 |
-
_context3.prev = 0;
|
3513 |
|
3514 |
-
_this.dataRequested(resourceNames);
|
3515 |
|
3516 |
-
operationResult = apiOperation(resourceNames, data) || [];
|
3517 |
-
values = Object(external_lodash_["isArray"])(operationResult) ? operationResult : [operationResult];
|
3518 |
-
requests = values.map(
|
3519 |
-
/*#__PURE__*/
|
3520 |
-
function () {
|
3521 |
-
var _ref4 = Object(asyncToGenerator["a" /* default */])(
|
3522 |
-
/*#__PURE__*/
|
3523 |
-
regenerator_default.a.mark(function _callee2(value) {
|
3524 |
-
var resources;
|
3525 |
-
return regenerator_default.a.wrap(function _callee2$(_context2) {
|
3526 |
-
while (1) {
|
3527 |
-
switch (_context2.prev = _context2.next) {
|
3528 |
-
case 0:
|
3529 |
-
_context2.next = 2;
|
3530 |
-
return value;
|
3531 |
|
3532 |
-
|
3533 |
-
|
|
|
3534 |
|
3535 |
-
|
3536 |
|
3537 |
-
|
|
|
3538 |
|
3539 |
-
|
3540 |
-
|
3541 |
-
|
3542 |
-
|
3543 |
-
|
3544 |
-
}, _callee2);
|
3545 |
-
}));
|
3546 |
|
3547 |
-
|
3548 |
-
|
3549 |
-
};
|
3550 |
-
}());
|
3551 |
-
_context3.next = 7;
|
3552 |
-
return Promise.all(requests);
|
3553 |
|
3554 |
-
|
3555 |
-
return _context3.abrupt("return", _context3.sent);
|
3556 |
|
3557 |
-
|
3558 |
-
_context3.prev = 10;
|
3559 |
-
_context3.t0 = _context3["catch"](0);
|
3560 |
|
3561 |
-
|
|
|
3562 |
|
3563 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
3564 |
|
3565 |
-
case 14:
|
3566 |
-
case "end":
|
3567 |
-
return _context3.stop();
|
3568 |
-
}
|
3569 |
-
}
|
3570 |
-
}, _callee3, null, [[0, 10]]);
|
3571 |
-
}));
|
3572 |
|
3573 |
-
return function (_x2, _x3, _x4) {
|
3574 |
-
return _ref3.apply(this, arguments);
|
3575 |
-
};
|
3576 |
-
}();
|
3577 |
|
3578 |
-
|
3579 |
-
if (!_this.dataHandlers) {
|
3580 |
-
_this.debug('Data requested before dataHandlers set. Disregarding.');
|
3581 |
|
3582 |
-
|
3583 |
-
|
|
|
3584 |
|
3585 |
-
|
|
|
|
|
3586 |
|
3587 |
-
|
3588 |
-
|
3589 |
|
3590 |
-
|
3591 |
-
if (!_this.dataHandlers) {
|
3592 |
-
_this.debug('Data received before dataHandlers set. Disregarding.');
|
3593 |
|
3594 |
-
|
3595 |
-
|
3596 |
|
3597 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3598 |
|
3599 |
-
|
|
|
|
|
|
|
|
|
3600 |
};
|
|
|
|
|
|
|
3601 |
|
3602 |
-
|
3603 |
-
|
3604 |
-
_selectors = apiSpec.selectors;
|
3605 |
-
|
3606 |
-
var _readOperationName = apiSpec.readOperationName || DEFAULT_READ_OPERATION;
|
3607 |
-
|
3608 |
-
this.uid = Object(external_lodash_["uniqueId"])();
|
3609 |
-
this.name = apiSpec.name;
|
3610 |
-
this.debug = browser_default()("fresh-data:api-client[" + this.uid + "]");
|
3611 |
-
this.debug('New ApiClient for apiSpec: ', apiSpec);
|
3612 |
-
this.operations = _operations && this.mapOperations(_operations);
|
3613 |
-
this.mutations = mutations && mapFunctions(mutations, this.operations);
|
3614 |
-
this.selectors = _selectors;
|
3615 |
-
this.readOperationName = _readOperationName;
|
3616 |
-
this.dataHandlers = null;
|
3617 |
-
this.subscriptionCallbacks = new Set();
|
3618 |
-
this.requirementsByComponent = new Map();
|
3619 |
-
this.requirementsByResource = {};
|
3620 |
-
this.minUpdate = DEFAULT_MIN_UPDATE;
|
3621 |
-
this.maxUpdate = DEFAULT_MAX_UPDATE;
|
3622 |
-
this.setTimer = setTimer;
|
3623 |
-
this.clearTimer = clearTimer;
|
3624 |
-
this.timeoutId = null;
|
3625 |
-
this.state = {};
|
3626 |
-
updateDevInfo(this);
|
3627 |
-
};
|
3628 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3629 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3630 |
|
3631 |
-
|
3632 |
-
|
3633 |
-
|
3634 |
}
|
3635 |
|
3636 |
-
|
3637 |
-
|
3638 |
-
|
3639 |
-
|
3640 |
-
|
3641 |
-
//
|
3642 |
-
|
3643 |
-
|
3644 |
-
|
3645 |
-
|
3646 |
-
|
3647 |
-
//
|
3648 |
-
|
3649 |
-
|
3650 |
-
|
|
|
|
|
3651 |
|
3652 |
-
|
|
|
|
|
|
|
3653 |
|
3654 |
-
|
3655 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3656 |
|
3657 |
-
var
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3658 |
|
3659 |
-
|
3660 |
-
if (!o) return;
|
3661 |
-
if (typeof o === "string") return arrayLikeToArray(o, minLen);
|
3662 |
-
var n = Object.prototype.toString.call(o).slice(8, -1);
|
3663 |
-
if (n === "Object" && o.constructor) n = o.constructor.name;
|
3664 |
-
if (n === "Map" || n === "Set") return Array.from(o);
|
3665 |
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return arrayLikeToArray(o, minLen);
|
3666 |
}
|
3667 |
|
3668 |
-
|
3669 |
-
|
3670 |
-
|
3671 |
-
|
3672 |
-
/***/ 176:
|
3673 |
-
/***/ (function(module, exports, __webpack_require__) {
|
3674 |
-
|
3675 |
-
"use strict";
|
3676 |
-
|
3677 |
-
|
3678 |
-
if (true) {
|
3679 |
-
module.exports = __webpack_require__(210);
|
3680 |
-
} else {}
|
3681 |
|
|
|
|
|
3682 |
|
3683 |
-
|
|
|
|
|
|
|
3684 |
|
3685 |
-
|
3686 |
-
|
|
|
|
|
|
|
|
|
|
|
3687 |
|
3688 |
-
|
|
|
3689 |
|
3690 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3691 |
|
3692 |
-
|
3693 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3694 |
|
3695 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3696 |
|
3697 |
-
|
3698 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3699 |
|
3700 |
-
|
3701 |
-
|
3702 |
-
|
|
|
|
|
|
|
3703 |
}
|
3704 |
-
|
3705 |
-
|
3706 |
-
|
3707 |
-
|
3708 |
-
|
3709 |
-
|
3710 |
-
|
|
|
3711 |
|
3712 |
-
|
3713 |
-
|
3714 |
-
|
|
|
|
|
3715 |
|
3716 |
-
|
3717 |
-
|
3718 |
-
|
3719 |
-
|
3720 |
-
|
3721 |
-
|
3722 |
-
|
3723 |
-
|
3724 |
-
|
3725 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3726 |
}
|
|
|
3727 |
}
|
3728 |
-
|
3729 |
-
return _arr;
|
3730 |
}
|
3731 |
-
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js
|
3732 |
-
var unsupportedIterableToArray = __webpack_require__(49);
|
3733 |
|
3734 |
-
|
3735 |
-
|
3736 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3737 |
}
|
3738 |
-
// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/slicedToArray.js
|
3739 |
-
|
3740 |
-
|
3741 |
|
|
|
3742 |
|
3743 |
-
|
3744 |
-
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || Object(unsupportedIterableToArray["a" /* default */])(arr, i) || _nonIterableRest();
|
3745 |
-
}
|
3746 |
|
3747 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3748 |
|
3749 |
-
|
3750 |
-
|
|
|
|
|
|
|
3751 |
|
3752 |
-
|
3753 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3754 |
|
3755 |
-
|
|
|
3756 |
|
3757 |
-
|
3758 |
-
* Copyright 2015, Yahoo! Inc.
|
3759 |
-
* Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.
|
3760 |
-
*/
|
3761 |
-
var REACT_STATICS = {
|
3762 |
-
childContextTypes: true,
|
3763 |
-
contextType: true,
|
3764 |
-
contextTypes: true,
|
3765 |
-
defaultProps: true,
|
3766 |
-
displayName: true,
|
3767 |
-
getDefaultProps: true,
|
3768 |
-
getDerivedStateFromError: true,
|
3769 |
-
getDerivedStateFromProps: true,
|
3770 |
-
mixins: true,
|
3771 |
-
propTypes: true,
|
3772 |
-
type: true
|
3773 |
-
};
|
3774 |
-
var KNOWN_STATICS = {
|
3775 |
-
name: true,
|
3776 |
-
length: true,
|
3777 |
-
prototype: true,
|
3778 |
-
caller: true,
|
3779 |
-
callee: true,
|
3780 |
-
arguments: true,
|
3781 |
-
arity: true
|
3782 |
-
};
|
3783 |
-
var FORWARD_REF_STATICS = {
|
3784 |
-
'$$typeof': true,
|
3785 |
-
render: true,
|
3786 |
-
defaultProps: true,
|
3787 |
-
displayName: true,
|
3788 |
-
propTypes: true
|
3789 |
-
};
|
3790 |
-
var MEMO_STATICS = {
|
3791 |
-
'$$typeof': true,
|
3792 |
-
compare: true,
|
3793 |
-
defaultProps: true,
|
3794 |
-
displayName: true,
|
3795 |
-
propTypes: true,
|
3796 |
-
type: true
|
3797 |
-
};
|
3798 |
-
var TYPE_STATICS = {};
|
3799 |
-
TYPE_STATICS[reactIs.ForwardRef] = FORWARD_REF_STATICS;
|
3800 |
-
TYPE_STATICS[reactIs.Memo] = MEMO_STATICS;
|
3801 |
|
3802 |
-
function getStatics(component) {
|
3803 |
-
// React v16.11 and below
|
3804 |
-
if (reactIs.isMemo(component)) {
|
3805 |
-
return MEMO_STATICS;
|
3806 |
-
} // React v16.12 and above
|
3807 |
|
|
|
3808 |
|
3809 |
-
|
3810 |
-
|
3811 |
|
3812 |
-
|
3813 |
-
|
3814 |
-
|
3815 |
-
|
3816 |
-
|
3817 |
-
|
3818 |
-
|
3819 |
-
|
3820 |
-
// don't hoist over string (html) components
|
3821 |
-
if (objectPrototype) {
|
3822 |
-
var inheritedComponent = getPrototypeOf(sourceComponent);
|
3823 |
|
3824 |
-
if (inheritedComponent && inheritedComponent !== objectPrototype) {
|
3825 |
-
hoistNonReactStatics(targetComponent, inheritedComponent, blacklist);
|
3826 |
-
}
|
3827 |
-
}
|
3828 |
|
3829 |
-
var keys = getOwnPropertyNames(sourceComponent);
|
3830 |
|
3831 |
-
|
3832 |
-
|
3833 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3834 |
|
3835 |
-
|
3836 |
-
var sourceStatics = getStatics(sourceComponent);
|
3837 |
|
3838 |
-
|
3839 |
-
var key = keys[i];
|
3840 |
|
3841 |
-
|
3842 |
-
|
3843 |
|
3844 |
-
|
3845 |
-
|
3846 |
-
|
3847 |
-
|
3848 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
3849 |
}
|
3850 |
-
}
|
3851 |
|
3852 |
-
|
|
|
|
|
3853 |
}
|
3854 |
|
3855 |
-
module.exports =
|
3856 |
-
|
3857 |
|
3858 |
/***/ }),
|
3859 |
|
3860 |
-
/***/
|
3861 |
-
/***/ (function(module,
|
3862 |
|
3863 |
"use strict";
|
3864 |
-
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(3);
|
3865 |
-
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__);
|
3866 |
-
/* harmony import */ var _wordpress_hooks__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(48);
|
3867 |
-
/* harmony import */ var _wordpress_hooks__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_hooks__WEBPACK_IMPORTED_MODULE_1__);
|
3868 |
-
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(0);
|
3869 |
-
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__);
|
3870 |
-
/* harmony import */ var _settings__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(23);
|
3871 |
-
/* harmony import */ var _index__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(197);
|
3872 |
/**
|
3873 |
-
*
|
|
|
|
|
|
|
|
|
3874 |
*/
|
3875 |
|
3876 |
|
3877 |
|
3878 |
-
|
3879 |
-
* WooCommerce dependencies
|
3880 |
-
*/
|
3881 |
-
|
3882 |
|
3883 |
-
var manageStock = Object(_settings__WEBPACK_IMPORTED_MODULE_3__[/* getSetting */ "g"])('manageStock', 'no');
|
3884 |
/**
|
3885 |
-
*
|
|
|
|
|
|
|
3886 |
*/
|
3887 |
|
3888 |
-
var
|
3889 |
-
return Promise.all(/* import() | analytics-report-revenue */[__webpack_require__.e(2), __webpack_require__.e(0), __webpack_require__.e(16)]).then(__webpack_require__.bind(null, 738));
|
3890 |
-
});
|
3891 |
-
var ProductsReport = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["lazy"])(function () {
|
3892 |
-
return Promise.all(/* import() | analytics-report-products */[__webpack_require__.e(2), __webpack_require__.e(0), __webpack_require__.e(5), __webpack_require__.e(15)]).then(__webpack_require__.bind(null, 739));
|
3893 |
-
});
|
3894 |
-
var OrdersReport = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["lazy"])(function () {
|
3895 |
-
return Promise.all(/* import() | analytics-report-orders */[__webpack_require__.e(2), __webpack_require__.e(0), __webpack_require__.e(14)]).then(__webpack_require__.bind(null, 740));
|
3896 |
-
});
|
3897 |
-
var CategoriesReport = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["lazy"])(function () {
|
3898 |
-
return Promise.all(/* import() | analytics-report-categories */[__webpack_require__.e(2), __webpack_require__.e(0), __webpack_require__.e(5), __webpack_require__.e(10)]).then(__webpack_require__.bind(null, 736));
|
3899 |
-
});
|
3900 |
-
var CouponsReport = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["lazy"])(function () {
|
3901 |
-
return Promise.all(/* import() | analytics-report-coupons */[__webpack_require__.e(2), __webpack_require__.e(0), __webpack_require__.e(11)]).then(__webpack_require__.bind(null, 741));
|
3902 |
-
});
|
3903 |
-
var TaxesReport = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["lazy"])(function () {
|
3904 |
-
return Promise.all(/* import() | analytics-report-taxes */[__webpack_require__.e(2), __webpack_require__.e(0), __webpack_require__.e(18)]).then(__webpack_require__.bind(null, 742));
|
3905 |
-
});
|
3906 |
-
var DownloadsReport = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["lazy"])(function () {
|
3907 |
-
return Promise.all(/* import() | analytics-report-downloads */[__webpack_require__.e(2), __webpack_require__.e(0), __webpack_require__.e(13)]).then(__webpack_require__.bind(null, 743));
|
3908 |
-
});
|
3909 |
-
var StockReport = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["lazy"])(function () {
|
3910 |
-
return Promise.all(/* import() | analytics-report-stock */[__webpack_require__.e(0), __webpack_require__.e(17)]).then(__webpack_require__.bind(null, 735));
|
3911 |
-
});
|
3912 |
-
var CustomersReport = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["lazy"])(function () {
|
3913 |
-
return Promise.all(/* import() | analytics-report-customers */[__webpack_require__.e(0), __webpack_require__.e(12)]).then(__webpack_require__.bind(null, 737));
|
3914 |
-
});
|
3915 |
|
3916 |
-
|
3917 |
-
|
3918 |
-
|
3919 |
-
title: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__["__"])('Revenue', 'woocommerce-admin'),
|
3920 |
-
component: RevenueReport
|
3921 |
-
}, {
|
3922 |
-
report: 'products',
|
3923 |
-
title: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__["__"])('Products', 'woocommerce-admin'),
|
3924 |
-
component: ProductsReport
|
3925 |
-
}, {
|
3926 |
-
report: 'orders',
|
3927 |
-
title: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__["__"])('Orders', 'woocommerce-admin'),
|
3928 |
-
component: OrdersReport
|
3929 |
-
}, {
|
3930 |
-
report: 'categories',
|
3931 |
-
title: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__["__"])('Categories', 'woocommerce-admin'),
|
3932 |
-
component: CategoriesReport
|
3933 |
-
}, {
|
3934 |
-
report: 'coupons',
|
3935 |
-
title: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__["__"])('Coupons', 'woocommerce-admin'),
|
3936 |
-
component: CouponsReport
|
3937 |
-
}, {
|
3938 |
-
report: 'taxes',
|
3939 |
-
title: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__["__"])('Taxes', 'woocommerce-admin'),
|
3940 |
-
component: TaxesReport
|
3941 |
-
}, {
|
3942 |
-
report: 'downloads',
|
3943 |
-
title: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__["__"])('Downloads', 'woocommerce-admin'),
|
3944 |
-
component: DownloadsReport
|
3945 |
-
}, manageStock === 'yes' ? {
|
3946 |
-
report: 'stock',
|
3947 |
-
title: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__["__"])('Stock', 'woocommerce-admin'),
|
3948 |
-
component: StockReport
|
3949 |
-
} : null, {
|
3950 |
-
report: 'customers',
|
3951 |
-
title: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__["__"])('Customers', 'woocommerce-admin'),
|
3952 |
-
component: CustomersReport
|
3953 |
-
}, {
|
3954 |
-
report: 'downloads',
|
3955 |
-
title: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__["__"])('Downloads', 'woocommerce-admin'),
|
3956 |
-
component: DownloadsReport
|
3957 |
-
}].filter(Boolean);
|
3958 |
-
return Object(_wordpress_hooks__WEBPACK_IMPORTED_MODULE_1__["applyFilters"])(_index__WEBPACK_IMPORTED_MODULE_4__["REPORTS_FILTER"], reports);
|
3959 |
-
});
|
3960 |
|
3961 |
/***/ }),
|
3962 |
|
3963 |
-
/***/
|
3964 |
-
/***/ (function(module,
|
3965 |
|
3966 |
-
|
3967 |
-
__webpack_require__.r(__webpack_exports__);
|
3968 |
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "REPORTS_FILTER", function() { return REPORTS_FILTER; });
|
3969 |
-
/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(17);
|
3970 |
-
/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__);
|
3971 |
-
/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(38);
|
3972 |
-
/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1__);
|
3973 |
-
/* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(37);
|
3974 |
-
/* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_2__);
|
3975 |
-
/* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(39);
|
3976 |
-
/* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_3__);
|
3977 |
-
/* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(42);
|
3978 |
-
/* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_4__);
|
3979 |
-
/* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(26);
|
3980 |
-
/* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_5__);
|
3981 |
-
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(0);
|
3982 |
-
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__);
|
3983 |
-
/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(169);
|
3984 |
-
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(1);
|
3985 |
-
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_8__);
|
3986 |
-
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(2);
|
3987 |
-
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_9__);
|
3988 |
-
/* harmony import */ var _woocommerce_components__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(53);
|
3989 |
-
/* harmony import */ var _woocommerce_components__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(_woocommerce_components__WEBPACK_IMPORTED_MODULE_10__);
|
3990 |
-
/* harmony import */ var _woocommerce_navigation__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(22);
|
3991 |
-
/* harmony import */ var _woocommerce_navigation__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(_woocommerce_navigation__WEBPACK_IMPORTED_MODULE_11__);
|
3992 |
-
/* harmony import */ var _style_scss__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(439);
|
3993 |
-
/* harmony import */ var _style_scss__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(_style_scss__WEBPACK_IMPORTED_MODULE_12__);
|
3994 |
-
/* harmony import */ var analytics_components_report_error__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(261);
|
3995 |
-
/* harmony import */ var wc_api_items_utils__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(274);
|
3996 |
-
/* harmony import */ var wc_api_with_select__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(101);
|
3997 |
-
/* harmony import */ var lib_currency_context__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(200);
|
3998 |
-
/* harmony import */ var _get_reports__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(196);
|
3999 |
|
|
|
4000 |
|
|
|
|
|
4001 |
|
|
|
4002 |
|
4003 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4004 |
|
|
|
|
|
|
|
|
|
|
|
4005 |
|
|
|
4006 |
|
4007 |
-
|
|
|
4008 |
|
4009 |
-
function
|
|
|
4010 |
|
4011 |
-
|
|
|
|
|
4012 |
|
4013 |
-
|
|
|
4014 |
|
4015 |
-
|
4016 |
-
|
4017 |
-
|
4018 |
|
|
|
|
|
4019 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4020 |
|
|
|
|
|
4021 |
|
4022 |
-
|
4023 |
-
* WooCommerce dependencies
|
4024 |
-
*/
|
4025 |
|
|
|
4026 |
|
|
|
|
|
4027 |
|
|
|
|
|
|
|
4028 |
/**
|
4029 |
-
*
|
4030 |
*/
|
4031 |
|
4032 |
-
|
4033 |
-
|
4034 |
-
|
4035 |
-
|
4036 |
-
|
4037 |
-
|
4038 |
-
var REPORTS_FILTER = 'woocommerce_admin_reports_list';
|
4039 |
/**
|
4040 |
-
*
|
4041 |
-
*
|
4042 |
-
* instead to determine if the Customers Report is being rendered.
|
4043 |
*
|
4044 |
-
* @param {
|
4045 |
-
*
|
|
|
4046 |
*/
|
4047 |
|
4048 |
-
|
4049 |
-
|
4050 |
-
path = _ref.path;
|
4051 |
-
return params.report || path.replace(/^\/+/, '');
|
4052 |
-
};
|
4053 |
-
|
4054 |
-
var Report = /*#__PURE__*/function (_Component) {
|
4055 |
-
_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_3___default()(Report, _Component);
|
4056 |
-
|
4057 |
-
var _super = _createSuper(Report);
|
4058 |
-
|
4059 |
-
function Report() {
|
4060 |
-
var _this;
|
4061 |
|
4062 |
-
|
4063 |
|
4064 |
-
|
4065 |
-
|
4066 |
-
hasError: false
|
4067 |
-
};
|
4068 |
-
return _this;
|
4069 |
-
}
|
4070 |
|
4071 |
-
|
4072 |
-
key: "componentDidCatch",
|
4073 |
-
value: function componentDidCatch(error) {
|
4074 |
-
this.setState({
|
4075 |
-
hasError: true
|
4076 |
-
});
|
4077 |
-
/* eslint-disable no-console */
|
4078 |
|
4079 |
-
|
4080 |
-
|
4081 |
-
|
4082 |
-
|
4083 |
-
key: "render",
|
4084 |
-
value: function render() {
|
4085 |
-
if (this.state.hasError) {
|
4086 |
-
return null;
|
4087 |
-
}
|
4088 |
|
4089 |
-
|
4090 |
|
4091 |
-
|
4092 |
-
|
4093 |
-
|
4094 |
-
});
|
4095 |
-
}
|
4096 |
|
4097 |
-
|
4098 |
-
|
4099 |
-
report: reportParam
|
4100 |
-
});
|
4101 |
|
4102 |
-
|
4103 |
-
|
4104 |
-
}
|
4105 |
|
4106 |
-
|
4107 |
-
|
4108 |
-
|
4109 |
-
}, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])(Container, this.props));
|
4110 |
-
}
|
4111 |
-
}]);
|
4112 |
|
4113 |
-
|
4114 |
-
|
4115 |
|
4116 |
-
|
4117 |
-
|
4118 |
-
|
4119 |
-
|
4120 |
-
|
4121 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4122 |
|
4123 |
-
|
4124 |
-
|
|
|
4125 |
}
|
4126 |
|
4127 |
-
|
4128 |
-
|
4129 |
-
|
4130 |
-
var mappedReport = report === 'categories' && query.filter === 'single_category' ? 'products' : report;
|
4131 |
-
var itemsResult = Object(wc_api_items_utils__WEBPACK_IMPORTED_MODULE_14__[/* searchItemsByString */ "b"])(select, mappedReport, searchWords);
|
4132 |
-
var isError = itemsResult.isError,
|
4133 |
-
isRequesting = itemsResult.isRequesting,
|
4134 |
-
items = itemsResult.items;
|
4135 |
-
var ids = Object.keys(items);
|
4136 |
|
4137 |
-
if (
|
4138 |
-
|
4139 |
-
isError: isError,
|
4140 |
-
isRequesting: isRequesting
|
4141 |
-
};
|
4142 |
}
|
4143 |
|
4144 |
-
|
4145 |
-
|
4146 |
-
|
4147 |
-
query: _objectSpread(_objectSpread({}, props.query), {}, _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()({}, mappedReport, ids.join(',')))
|
4148 |
};
|
4149 |
-
|
4150 |
-
|
4151 |
-
|
4152 |
-
|
4153 |
-
|
4154 |
-
|
4155 |
-
|
4156 |
-
|
4157 |
-
|
4158 |
-
|
4159 |
-
|
4160 |
-
|
4161 |
-
|
4162 |
|
4163 |
-
|
4164 |
-
|
4165 |
-
var
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4166 |
|
4167 |
-
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/defineProperty.js
|
4168 |
-
var defineProperty = __webpack_require__(17);
|
4169 |
-
var defineProperty_default = /*#__PURE__*/__webpack_require__.n(defineProperty);
|
4170 |
|
4171 |
-
|
4172 |
-
var
|
4173 |
-
|
|
|
|
|
|
|
|
|
|
|
4174 |
|
4175 |
-
|
4176 |
-
|
4177 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4178 |
|
4179 |
-
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/createClass.js
|
4180 |
-
var createClass = __webpack_require__(37);
|
4181 |
-
var createClass_default = /*#__PURE__*/__webpack_require__.n(createClass);
|
4182 |
|
4183 |
-
|
4184 |
-
var
|
4185 |
-
var
|
4186 |
|
4187 |
-
|
4188 |
-
|
4189 |
-
|
4190 |
|
4191 |
-
|
4192 |
-
|
4193 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
4194 |
|
4195 |
-
|
4196 |
-
var
|
4197 |
|
4198 |
-
|
4199 |
-
|
|
|
4200 |
|
4201 |
-
|
4202 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4203 |
|
4204 |
-
//
|
4205 |
-
var inheritsLoose = __webpack_require__(60);
|
4206 |
|
4207 |
-
// EXTERNAL MODULE: external "React"
|
4208 |
-
var external_React_ = __webpack_require__(13);
|
4209 |
-
var external_React_default = /*#__PURE__*/__webpack_require__.n(external_React_);
|
4210 |
|
4211 |
-
// EXTERNAL MODULE: ./node_modules/prop-types/index.js
|
4212 |
-
var prop_types = __webpack_require__(1);
|
4213 |
-
var prop_types_default = /*#__PURE__*/__webpack_require__.n(prop_types);
|
4214 |
|
4215 |
-
// EXTERNAL MODULE: ./node_modules/history/esm/history.js + 2 modules
|
4216 |
-
var esm_history = __webpack_require__(98);
|
4217 |
|
4218 |
-
|
4219 |
-
|
4220 |
-
|
4221 |
|
4222 |
-
|
4223 |
-
|
4224 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4225 |
|
4226 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4227 |
|
|
|
|
|
|
|
|
|
|
|
|
|
4228 |
|
|
|
|
|
|
|
4229 |
|
|
|
|
|
|
|
|
|
4230 |
|
|
|
|
|
|
|
|
|
4231 |
|
|
|
|
|
4232 |
|
4233 |
-
|
|
|
|
|
4234 |
|
4235 |
-
|
4236 |
-
if (x === y) {
|
4237 |
-
return x !== 0 || 1 / x === 1 / y;
|
4238 |
-
} else {
|
4239 |
-
return x !== x && y !== y;
|
4240 |
}
|
4241 |
-
}
|
4242 |
|
4243 |
-
|
4244 |
-
|
4245 |
-
|
4246 |
-
on: function on(handler) {
|
4247 |
-
handlers.push(handler);
|
4248 |
-
},
|
4249 |
-
off: function off(handler) {
|
4250 |
-
handlers = handlers.filter(function (h) {
|
4251 |
-
return h !== handler;
|
4252 |
-
});
|
4253 |
-
},
|
4254 |
-
get: function get() {
|
4255 |
-
return value;
|
4256 |
-
},
|
4257 |
-
set: function set(newValue, changedBits) {
|
4258 |
-
value = newValue;
|
4259 |
-
handlers.forEach(function (handler) {
|
4260 |
-
return handler(value, changedBits);
|
4261 |
-
});
|
4262 |
-
}
|
4263 |
-
};
|
4264 |
-
}
|
4265 |
|
4266 |
-
|
4267 |
-
return Array.isArray(children) ? children[0] : children;
|
4268 |
}
|
4269 |
|
4270 |
-
function
|
4271 |
-
var
|
4272 |
-
|
4273 |
-
var contextProp = '__create-react-context-' + gud_default()() + '__';
|
4274 |
|
4275 |
-
|
4276 |
-
|
4277 |
-
|
4278 |
-
|
4279 |
|
4280 |
-
|
4281 |
-
var
|
|
|
4282 |
|
4283 |
-
|
4284 |
-
|
4285 |
-
return
|
4286 |
-
}
|
4287 |
|
4288 |
-
|
|
|
|
|
4289 |
|
4290 |
-
|
4291 |
-
|
|
|
|
|
|
|
4292 |
|
4293 |
-
|
4294 |
-
|
|
|
|
|
4295 |
|
4296 |
-
|
4297 |
-
|
4298 |
-
|
4299 |
-
|
4300 |
-
var changedBits;
|
4301 |
-
|
4302 |
-
if (objectIs(oldValue, newValue)) {
|
4303 |
-
changedBits = 0;
|
4304 |
-
} else {
|
4305 |
-
changedBits = typeof calculateChangedBits === 'function' ? calculateChangedBits(oldValue, newValue) : MAX_SIGNED_31_BIT_INT;
|
4306 |
-
|
4307 |
-
if (false) {}
|
4308 |
-
|
4309 |
-
changedBits |= 0;
|
4310 |
-
|
4311 |
-
if (changedBits !== 0) {
|
4312 |
-
this.emitter.set(nextProps.value, changedBits);
|
4313 |
-
}
|
4314 |
-
}
|
4315 |
-
}
|
4316 |
-
};
|
4317 |
-
|
4318 |
-
_proto.render = function render() {
|
4319 |
-
return this.props.children;
|
4320 |
-
};
|
4321 |
-
|
4322 |
-
return Provider;
|
4323 |
-
}(external_React_["Component"]);
|
4324 |
-
|
4325 |
-
Provider.childContextTypes = (_Provider$childContex = {}, _Provider$childContex[contextProp] = prop_types_default.a.object.isRequired, _Provider$childContex);
|
4326 |
|
4327 |
-
|
4328 |
-
|
4329 |
-
|
4330 |
-
|
|
|
4331 |
|
4332 |
-
|
4333 |
-
|
|
|
4334 |
|
4335 |
-
|
4336 |
-
|
4337 |
-
|
4338 |
-
|
4339 |
|
4340 |
-
|
4341 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4342 |
|
4343 |
-
|
4344 |
-
|
4345 |
-
|
4346 |
-
|
4347 |
-
|
4348 |
-
|
4349 |
|
4350 |
-
|
|
|
4351 |
}
|
|
|
|
|
|
|
|
|
4352 |
|
4353 |
-
var _proto2 = Consumer.prototype;
|
4354 |
-
|
4355 |
-
_proto2.componentWillReceiveProps = function componentWillReceiveProps(nextProps) {
|
4356 |
-
var observedBits = nextProps.observedBits;
|
4357 |
-
this.observedBits = observedBits === undefined || observedBits === null ? MAX_SIGNED_31_BIT_INT : observedBits;
|
4358 |
-
};
|
4359 |
-
|
4360 |
-
_proto2.componentDidMount = function componentDidMount() {
|
4361 |
-
if (this.context[contextProp]) {
|
4362 |
-
this.context[contextProp].on(this.onUpdate);
|
4363 |
-
}
|
4364 |
-
|
4365 |
-
var observedBits = this.props.observedBits;
|
4366 |
-
this.observedBits = observedBits === undefined || observedBits === null ? MAX_SIGNED_31_BIT_INT : observedBits;
|
4367 |
-
};
|
4368 |
-
|
4369 |
-
_proto2.componentWillUnmount = function componentWillUnmount() {
|
4370 |
-
if (this.context[contextProp]) {
|
4371 |
-
this.context[contextProp].off(this.onUpdate);
|
4372 |
-
}
|
4373 |
-
};
|
4374 |
|
4375 |
-
|
4376 |
-
|
4377 |
-
|
4378 |
-
|
4379 |
-
|
4380 |
-
}
|
4381 |
-
};
|
4382 |
|
4383 |
-
|
4384 |
-
|
4385 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4386 |
|
4387 |
-
|
4388 |
-
|
|
|
|
|
4389 |
|
4390 |
-
|
4391 |
-
|
4392 |
-
|
4393 |
-
Consumer: Consumer
|
4394 |
-
};
|
4395 |
-
}
|
4396 |
|
4397 |
-
|
|
|
|
|
4398 |
|
4399 |
-
|
|
|
|
|
4400 |
|
4401 |
-
|
4402 |
-
|
|
|
|
|
|
|
4403 |
|
4404 |
-
|
4405 |
-
|
|
|
4406 |
|
4407 |
-
|
4408 |
-
|
4409 |
-
|
4410 |
|
4411 |
-
|
4412 |
-
|
|
|
4413 |
|
4414 |
-
|
4415 |
-
|
|
|
4416 |
|
4417 |
-
|
4418 |
-
|
4419 |
-
|
4420 |
|
4421 |
-
|
|
|
|
|
|
|
4422 |
|
4423 |
|
4424 |
|
|
|
|
|
|
|
|
|
|
|
4425 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4426 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4427 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4428 |
|
4429 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4430 |
|
4431 |
|
4432 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4433 |
|
|
|
|
|
|
|
|
|
|
|
|
|
4434 |
|
4435 |
-
|
4436 |
-
|
4437 |
-
|
4438 |
-
|
4439 |
-
|
4440 |
-
|
4441 |
-
|
|
|
|
|
|
|
|
|
4442 |
|
4443 |
-
|
4444 |
-
|
4445 |
-
react_router_createNamedContext("Router");
|
4446 |
|
|
|
|
|
|
|
4447 |
/**
|
4448 |
-
*
|
|
|
|
|
4449 |
*/
|
4450 |
|
4451 |
-
|
4452 |
-
|
4453 |
-
|
4454 |
-
|
|
|
|
|
|
|
|
|
|
|
4455 |
|
4456 |
-
Router.computeRootMatch = function computeRootMatch(pathname) {
|
4457 |
-
return {
|
4458 |
-
path: "/",
|
4459 |
-
url: "/",
|
4460 |
-
params: {},
|
4461 |
-
isExact: pathname === "/"
|
4462 |
-
};
|
4463 |
-
};
|
4464 |
|
4465 |
-
function Router(props) {
|
4466 |
-
var _this;
|
4467 |
|
4468 |
-
_this = _React$Component.call(this, props) || this;
|
4469 |
-
_this.state = {
|
4470 |
-
location: props.history.location
|
4471 |
-
}; // This is a bit of a hack. We have to start listening for location
|
4472 |
-
// changes here in the constructor in case there are any <Redirect>s
|
4473 |
-
// on the initial render. If there are, they will replace/push when
|
4474 |
-
// they mount and since cDM fires in children before parents, we may
|
4475 |
-
// get a new location before the <Router> is mounted.
|
4476 |
|
4477 |
-
_this._isMounted = false;
|
4478 |
-
_this._pendingLocation = null;
|
4479 |
|
4480 |
-
if (!props.staticContext) {
|
4481 |
-
_this.unlisten = props.history.listen(function (location) {
|
4482 |
-
if (_this._isMounted) {
|
4483 |
-
_this.setState({
|
4484 |
-
location: location
|
4485 |
-
});
|
4486 |
-
} else {
|
4487 |
-
_this._pendingLocation = location;
|
4488 |
-
}
|
4489 |
-
});
|
4490 |
-
}
|
4491 |
|
4492 |
-
return _this;
|
4493 |
-
}
|
4494 |
|
4495 |
-
var _proto = Router.prototype;
|
4496 |
|
4497 |
-
|
4498 |
-
this._isMounted = true;
|
4499 |
|
4500 |
-
|
4501 |
-
|
4502 |
-
|
4503 |
-
});
|
4504 |
-
}
|
4505 |
-
};
|
4506 |
|
4507 |
-
|
4508 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4509 |
};
|
4510 |
|
4511 |
-
|
4512 |
-
return
|
4513 |
-
|
4514 |
-
|
4515 |
-
|
4516 |
-
|
4517 |
-
|
4518 |
-
|
4519 |
-
|
4520 |
-
});
|
4521 |
};
|
4522 |
|
4523 |
-
|
4524 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
4525 |
|
4526 |
-
|
|
|
|
|
|
|
4527 |
|
4528 |
-
|
4529 |
-
|
4530 |
-
*/
|
4531 |
|
4532 |
-
|
4533 |
-
/*#__PURE__*/
|
4534 |
-
function (_React$Component) {
|
4535 |
-
Object(inheritsLoose["a" /* default */])(MemoryRouter, _React$Component);
|
4536 |
|
4537 |
-
|
4538 |
-
|
|
|
4539 |
|
4540 |
-
|
4541 |
-
args[_key] = arguments[_key];
|
4542 |
}
|
|
|
4543 |
|
4544 |
-
|
4545 |
-
|
4546 |
-
|
4547 |
-
}
|
4548 |
|
4549 |
-
|
|
|
4550 |
|
4551 |
-
|
4552 |
-
|
4553 |
-
|
4554 |
-
children: this.props.children
|
4555 |
-
});
|
4556 |
};
|
4557 |
|
4558 |
-
|
4559 |
-
|
|
|
4560 |
|
4561 |
-
|
|
|
4562 |
|
4563 |
-
|
4564 |
-
/*#__PURE__*/
|
4565 |
-
function (_React$Component) {
|
4566 |
-
Object(inheritsLoose["a" /* default */])(Lifecycle, _React$Component);
|
4567 |
|
4568 |
-
|
4569 |
-
|
4570 |
-
}
|
4571 |
|
4572 |
-
|
|
|
|
|
|
|
|
|
4573 |
|
4574 |
-
|
4575 |
-
|
|
|
|
|
|
|
|
|
|
|
4576 |
};
|
4577 |
|
4578 |
-
|
4579 |
-
|
4580 |
};
|
4581 |
|
4582 |
-
|
4583 |
-
|
4584 |
};
|
4585 |
|
4586 |
-
|
4587 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
4588 |
};
|
4589 |
|
4590 |
-
|
4591 |
-
|
|
|
|
|
4592 |
|
4593 |
-
|
4594 |
-
* The public API for prompting the user before navigating away from a screen.
|
4595 |
-
*/
|
4596 |
|
4597 |
-
|
4598 |
-
|
4599 |
-
_ref$when = _ref.when,
|
4600 |
-
when = _ref$when === void 0 ? true : _ref$when;
|
4601 |
-
return external_React_default.a.createElement(react_router_context.Consumer, null, function (context) {
|
4602 |
-
!context ? false ? undefined : Object(tiny_invariant_esm["a" /* default */])(false) : void 0;
|
4603 |
-
if (!when || context.staticContext) return null;
|
4604 |
-
var method = context.history.block;
|
4605 |
-
return external_React_default.a.createElement(react_router_Lifecycle, {
|
4606 |
-
onMount: function onMount(self) {
|
4607 |
-
self.release = method(message);
|
4608 |
-
},
|
4609 |
-
onUpdate: function onUpdate(self, prevProps) {
|
4610 |
-
if (prevProps.message !== message) {
|
4611 |
-
self.release();
|
4612 |
-
self.release = method(message);
|
4613 |
-
}
|
4614 |
-
},
|
4615 |
-
onUnmount: function onUnmount(self) {
|
4616 |
-
self.release();
|
4617 |
-
},
|
4618 |
-
message: message
|
4619 |
-
});
|
4620 |
-
});
|
4621 |
-
}
|
4622 |
-
|
4623 |
-
if (false) { var messageType; }
|
4624 |
-
|
4625 |
-
var cache = {};
|
4626 |
-
var cacheLimit = 10000;
|
4627 |
-
var cacheCount = 0;
|
4628 |
-
|
4629 |
-
function compilePath(path) {
|
4630 |
-
if (cache[path]) return cache[path];
|
4631 |
-
var generator = path_to_regexp_default.a.compile(path);
|
4632 |
|
4633 |
-
|
4634 |
-
|
4635 |
-
|
4636 |
-
|
4637 |
|
4638 |
-
|
4639 |
-
|
4640 |
-
/**
|
4641 |
-
* Public API for generating a URL pathname from a path and parameters.
|
4642 |
-
*/
|
4643 |
|
|
|
4644 |
|
4645 |
-
|
4646 |
-
if (path === void 0) {
|
4647 |
-
path = "/";
|
4648 |
-
}
|
4649 |
|
4650 |
-
|
4651 |
-
|
4652 |
-
|
|
|
|
|
4653 |
|
4654 |
-
|
4655 |
-
|
4656 |
-
|
4657 |
-
}
|
4658 |
|
4659 |
-
|
4660 |
-
|
4661 |
-
|
4662 |
|
4663 |
-
|
4664 |
-
|
4665 |
-
to = _ref.to,
|
4666 |
-
_ref$push = _ref.push,
|
4667 |
-
push = _ref$push === void 0 ? false : _ref$push;
|
4668 |
-
return external_React_default.a.createElement(react_router_context.Consumer, null, function (context) {
|
4669 |
-
!context ? false ? undefined : Object(tiny_invariant_esm["a" /* default */])(false) : void 0;
|
4670 |
-
var history = context.history,
|
4671 |
-
staticContext = context.staticContext;
|
4672 |
-
var method = push ? history.push : history.replace;
|
4673 |
-
var location = Object(esm_history["b" /* createLocation */])(computedMatch ? typeof to === "string" ? generatePath(to, computedMatch.params) : Object(esm_extends["a" /* default */])({}, to, {
|
4674 |
-
pathname: generatePath(to.pathname, computedMatch.params)
|
4675 |
-
}) : to); // When rendering in a static context,
|
4676 |
-
// set the new location immediately.
|
4677 |
|
4678 |
-
|
4679 |
-
method(location);
|
4680 |
-
return null;
|
4681 |
}
|
|
|
4682 |
|
4683 |
-
|
4684 |
-
|
4685 |
-
|
4686 |
-
|
4687 |
-
|
4688 |
-
|
|
|
4689 |
|
4690 |
-
|
4691 |
-
|
4692 |
-
|
4693 |
-
|
4694 |
-
|
4695 |
-
|
4696 |
-
|
4697 |
-
|
4698 |
-
});
|
4699 |
-
}
|
4700 |
|
4701 |
-
|
4702 |
|
4703 |
-
|
4704 |
-
var cacheLimit$1 = 10000;
|
4705 |
-
var cacheCount$1 = 0;
|
4706 |
|
4707 |
-
|
4708 |
-
|
4709 |
-
|
4710 |
-
|
4711 |
-
var keys = [];
|
4712 |
-
var regexp = path_to_regexp_default()(path, keys, options);
|
4713 |
-
var result = {
|
4714 |
-
regexp: regexp,
|
4715 |
-
keys: keys
|
4716 |
-
};
|
4717 |
|
4718 |
-
|
4719 |
-
pathCache[path] = result;
|
4720 |
-
cacheCount$1++;
|
4721 |
-
}
|
4722 |
|
4723 |
-
|
4724 |
-
|
4725 |
-
|
4726 |
-
|
4727 |
-
*/
|
4728 |
|
|
|
|
|
4729 |
|
4730 |
-
|
4731 |
-
|
4732 |
-
|
4733 |
-
|
4734 |
|
4735 |
-
|
4736 |
-
options = {
|
4737 |
-
path: options
|
4738 |
-
};
|
4739 |
-
}
|
4740 |
|
4741 |
-
|
4742 |
-
|
4743 |
-
|
4744 |
-
exact = _options$exact === void 0 ? false : _options$exact,
|
4745 |
-
_options$strict = _options.strict,
|
4746 |
-
strict = _options$strict === void 0 ? false : _options$strict,
|
4747 |
-
_options$sensitive = _options.sensitive,
|
4748 |
-
sensitive = _options$sensitive === void 0 ? false : _options$sensitive;
|
4749 |
-
var paths = [].concat(path);
|
4750 |
-
return paths.reduce(function (matched, path) {
|
4751 |
-
if (!path && path !== "") return null;
|
4752 |
-
if (matched) return matched;
|
4753 |
|
4754 |
-
|
4755 |
-
|
4756 |
-
strict: strict,
|
4757 |
-
sensitive: sensitive
|
4758 |
-
}),
|
4759 |
-
regexp = _compilePath.regexp,
|
4760 |
-
keys = _compilePath.keys;
|
4761 |
|
4762 |
-
|
4763 |
-
if (!match) return null;
|
4764 |
-
var url = match[0],
|
4765 |
-
values = match.slice(1);
|
4766 |
-
var isExact = pathname === url;
|
4767 |
-
if (exact && !isExact) return null;
|
4768 |
-
return {
|
4769 |
-
path: path,
|
4770 |
-
// the path used to match
|
4771 |
-
url: path === "/" && url === "" ? "/" : url,
|
4772 |
-
// the matched portion of the URL
|
4773 |
-
isExact: isExact,
|
4774 |
-
// whether or not we matched exactly
|
4775 |
-
params: keys.reduce(function (memo, key, index) {
|
4776 |
-
memo[key.name] = values[index];
|
4777 |
-
return memo;
|
4778 |
-
}, {})
|
4779 |
-
};
|
4780 |
-
}, null);
|
4781 |
-
}
|
4782 |
|
4783 |
-
|
4784 |
-
return external_React_default.a.Children.count(children) === 0;
|
4785 |
-
}
|
4786 |
|
4787 |
-
|
4788 |
-
|
4789 |
-
false ? undefined : void 0;
|
4790 |
-
return value || null;
|
4791 |
-
}
|
4792 |
-
/**
|
4793 |
-
* The public API for matching a single path and rendering.
|
4794 |
-
*/
|
4795 |
|
|
|
|
|
|
|
4796 |
|
4797 |
-
|
4798 |
-
/*#__PURE__*/
|
4799 |
-
function (_React$Component) {
|
4800 |
-
Object(inheritsLoose["a" /* default */])(Route, _React$Component);
|
4801 |
|
4802 |
-
|
4803 |
-
|
4804 |
-
}
|
4805 |
|
4806 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
4807 |
|
4808 |
-
|
4809 |
-
|
|
|
|
|
4810 |
|
4811 |
-
|
4812 |
-
|
4813 |
-
|
4814 |
-
|
4815 |
-
: _this.props.path ? matchPath(location.pathname, _this.props) : context$1.match;
|
4816 |
|
4817 |
-
|
4818 |
-
|
4819 |
-
|
4820 |
-
|
|
|
4821 |
|
4822 |
-
|
4823 |
-
|
4824 |
-
|
4825 |
-
render = _this$props.render; // Preact uses an empty array as children by
|
4826 |
-
// default, so use null if that's the case.
|
4827 |
|
4828 |
-
|
4829 |
-
|
4830 |
-
}
|
4831 |
|
4832 |
-
|
4833 |
-
|
4834 |
-
|
4835 |
-
|
|
|
|
|
4836 |
};
|
4837 |
|
4838 |
-
|
4839 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4840 |
|
4841 |
-
|
4842 |
|
4843 |
-
|
4844 |
-
|
4845 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4846 |
|
4847 |
-
|
4848 |
-
|
4849 |
-
return Object(esm_extends["a" /* default */])({}, location, {
|
4850 |
-
pathname: addLeadingSlash(basename) + location.pathname
|
4851 |
-
});
|
4852 |
-
}
|
4853 |
|
4854 |
-
|
4855 |
-
if (!basename) return location;
|
4856 |
-
var base = addLeadingSlash(basename);
|
4857 |
-
if (location.pathname.indexOf(base) !== 0) return location;
|
4858 |
-
return Object(esm_extends["a" /* default */])({}, location, {
|
4859 |
-
pathname: location.pathname.substr(base.length)
|
4860 |
-
});
|
4861 |
-
}
|
4862 |
|
4863 |
-
|
4864 |
-
return typeof location === "string" ? location : Object(esm_history["d" /* createPath */])(location);
|
4865 |
-
}
|
4866 |
|
4867 |
-
|
4868 |
-
|
4869 |
-
|
4870 |
-
|
4871 |
-
}
|
|
|
|
|
4872 |
|
4873 |
-
function
|
4874 |
-
|
4875 |
-
|
4876 |
-
|
4877 |
-
|
4878 |
-
|
4879 |
-
*/
|
4880 |
|
|
|
|
|
4881 |
|
4882 |
-
|
4883 |
-
|
4884 |
-
|
4885 |
-
Object(inheritsLoose["a" /* default */])(StaticRouter, _React$Component);
|
4886 |
|
4887 |
-
|
4888 |
-
var _this;
|
4889 |
|
4890 |
-
|
4891 |
-
args[_key] = arguments[_key];
|
4892 |
-
}
|
4893 |
|
4894 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
4895 |
|
4896 |
-
|
4897 |
-
return
|
4898 |
};
|
|
|
4899 |
|
4900 |
-
|
4901 |
-
|
4902 |
-
|
4903 |
|
4904 |
-
|
4905 |
-
|
4906 |
-
};
|
4907 |
|
4908 |
-
_this.
|
4909 |
-
return noop;
|
4910 |
-
};
|
4911 |
|
4912 |
-
return
|
4913 |
-
}
|
4914 |
|
4915 |
-
|
|
|
|
|
4916 |
|
4917 |
-
|
4918 |
-
|
4919 |
-
_this$props$basename = _this$props.basename,
|
4920 |
-
basename = _this$props$basename === void 0 ? "" : _this$props$basename,
|
4921 |
-
_this$props$context = _this$props.context,
|
4922 |
-
context = _this$props$context === void 0 ? {} : _this$props$context;
|
4923 |
-
context.action = action;
|
4924 |
-
context.location = addBasename(basename, Object(esm_history["b" /* createLocation */])(location));
|
4925 |
-
context.url = createURL(context.location);
|
4926 |
-
};
|
4927 |
|
4928 |
-
|
4929 |
-
var _this$props2 = this.props,
|
4930 |
-
_this$props2$basename = _this$props2.basename,
|
4931 |
-
basename = _this$props2$basename === void 0 ? "" : _this$props2$basename,
|
4932 |
-
_this$props2$context = _this$props2.context,
|
4933 |
-
context = _this$props2$context === void 0 ? {} : _this$props2$context,
|
4934 |
-
_this$props2$location = _this$props2.location,
|
4935 |
-
location = _this$props2$location === void 0 ? "/" : _this$props2$location,
|
4936 |
-
rest = Object(objectWithoutPropertiesLoose["a" /* default */])(_this$props2, ["basename", "context", "location"]);
|
4937 |
|
4938 |
-
|
4939 |
-
createHref: function createHref(path) {
|
4940 |
-
return addLeadingSlash(basename + createURL(path));
|
4941 |
-
},
|
4942 |
-
action: "POP",
|
4943 |
-
location: stripBasename(basename, Object(esm_history["b" /* createLocation */])(location)),
|
4944 |
-
push: this.handlePush,
|
4945 |
-
replace: this.handleReplace,
|
4946 |
-
go: staticHandler("go"),
|
4947 |
-
goBack: staticHandler("goBack"),
|
4948 |
-
goForward: staticHandler("goForward"),
|
4949 |
-
listen: this.handleListen,
|
4950 |
-
block: this.handleBlock
|
4951 |
-
};
|
4952 |
-
return external_React_default.a.createElement(react_router_Router, Object(esm_extends["a" /* default */])({}, rest, {
|
4953 |
-
history: history,
|
4954 |
-
staticContext: context
|
4955 |
-
}));
|
4956 |
};
|
4957 |
|
4958 |
-
|
4959 |
-
|
4960 |
-
|
4961 |
-
if (false) {}
|
4962 |
|
4963 |
-
|
4964 |
-
* The public API for rendering the first <Route> that matches.
|
4965 |
-
*/
|
4966 |
|
4967 |
-
|
4968 |
-
|
4969 |
-
|
4970 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4971 |
|
4972 |
-
function Switch() {
|
4973 |
-
return _React$Component.apply(this, arguments) || this;
|
4974 |
-
}
|
4975 |
|
4976 |
-
var _proto = Switch.prototype;
|
4977 |
|
4978 |
-
|
4979 |
-
|
|
|
|
|
4980 |
|
4981 |
-
|
4982 |
-
|
4983 |
-
|
4984 |
-
|
4985 |
-
|
4986 |
-
|
4987 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
4988 |
|
4989 |
-
external_React_default.a.Children.forEach(_this.props.children, function (child) {
|
4990 |
-
if (match == null && external_React_default.a.isValidElement(child)) {
|
4991 |
-
element = child;
|
4992 |
-
var path = child.props.path || child.props.from;
|
4993 |
-
match = path ? matchPath(location.pathname, Object(esm_extends["a" /* default */])({}, child.props, {
|
4994 |
-
path: path
|
4995 |
-
})) : context.match;
|
4996 |
-
}
|
4997 |
-
});
|
4998 |
-
return match ? external_React_default.a.cloneElement(element, {
|
4999 |
-
location: location,
|
5000 |
-
computedMatch: match
|
5001 |
-
}) : null;
|
5002 |
-
});
|
5003 |
-
};
|
5004 |
|
5005 |
-
return Switch;
|
5006 |
-
}(external_React_default.a.Component);
|
5007 |
|
5008 |
-
|
5009 |
|
5010 |
-
|
5011 |
-
|
5012 |
-
*/
|
5013 |
|
5014 |
-
|
5015 |
-
var displayName = "withRouter(" + (Component.displayName || Component.name) + ")";
|
5016 |
|
5017 |
-
|
5018 |
-
|
5019 |
-
|
|
|
|
|
|
|
|
|
|
|
5020 |
|
5021 |
-
|
5022 |
-
!context ? false ? undefined : Object(tiny_invariant_esm["a" /* default */])(false) : void 0;
|
5023 |
-
return external_React_default.a.createElement(Component, Object(esm_extends["a" /* default */])({}, remainingProps, context, {
|
5024 |
-
ref: wrappedComponentRef
|
5025 |
-
}));
|
5026 |
-
});
|
5027 |
-
};
|
5028 |
|
5029 |
-
|
5030 |
-
C.WrappedComponent = Component;
|
5031 |
|
5032 |
-
|
|
|
5033 |
|
5034 |
-
|
5035 |
-
}
|
5036 |
|
5037 |
-
|
5038 |
-
function
|
5039 |
-
if (false) {}
|
5040 |
|
5041 |
-
|
|
|
|
|
5042 |
}
|
5043 |
-
|
5044 |
-
|
|
|
|
|
|
|
|
|
|
|
5045 |
|
5046 |
-
|
5047 |
-
|
5048 |
-
|
5049 |
-
if (false) {}
|
5050 |
|
5051 |
-
|
5052 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5053 |
}
|
5054 |
-
|
5055 |
-
|
5056 |
|
5057 |
-
|
|
|
|
|
5058 |
}
|
|
|
5059 |
|
5060 |
-
if (false) { var secondaryBuildName, initialBuildName, buildNames, react_router_key, global; }
|
5061 |
|
5062 |
|
5063 |
-
//# sourceMappingURL=react-router.js.map
|
5064 |
|
5065 |
-
|
5066 |
-
|
|
|
5067 |
|
5068 |
-
|
5069 |
-
var external_this_wc_components_ = __webpack_require__(53);
|
5070 |
|
5071 |
-
|
5072 |
-
|
5073 |
|
5074 |
-
|
5075 |
-
var settings = __webpack_require__(23);
|
5076 |
|
5077 |
-
// EXTERNAL MODULE: external {"this":["wc","data"]}
|
5078 |
-
var external_this_wc_data_ = __webpack_require__(43);
|
5079 |
|
5080 |
-
|
5081 |
-
|
|
|
5082 |
|
5083 |
-
// EXTERNAL MODULE: ./node_modules/qs/lib/index.js
|
5084 |
-
var lib = __webpack_require__(66);
|
5085 |
|
5086 |
-
|
5087 |
-
var external_this_wp_hooks_ = __webpack_require__(48);
|
5088 |
|
5089 |
-
|
5090 |
-
|
5091 |
|
5092 |
-
|
5093 |
-
var utils = __webpack_require__(268);
|
5094 |
|
5095 |
-
|
5096 |
-
var get_reports = __webpack_require__(196);
|
5097 |
|
5098 |
-
|
|
|
5099 |
|
|
|
5100 |
|
5101 |
|
|
|
5102 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5103 |
|
|
|
|
|
|
|
|
|
|
|
5104 |
|
5105 |
|
5106 |
-
|
|
|
5107 |
|
5108 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5109 |
|
5110 |
-
|
5111 |
-
|
5112 |
-
|
|
|
5113 |
|
|
|
5114 |
|
|
|
|
|
|
|
5115 |
|
|
|
|
|
5116 |
|
|
|
|
|
5117 |
|
5118 |
-
|
5119 |
-
|
5120 |
-
*/
|
5121 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5122 |
|
|
|
|
|
5123 |
|
5124 |
-
|
5125 |
-
* Internal dependencies
|
5126 |
-
*/
|
5127 |
|
5128 |
|
5129 |
-
|
5130 |
-
return Promise.resolve(/* import() */).then(__webpack_require__.bind(null, 197));
|
5131 |
-
});
|
5132 |
-
var AnalyticsSettings = Object(external_this_wp_element_["lazy"])(function () {
|
5133 |
-
return __webpack_require__.e(/* import() | analytics-settings */ 19).then(__webpack_require__.bind(null, 922));
|
5134 |
-
});
|
5135 |
-
var Dashboard = Object(external_this_wp_element_["lazy"])(function () {
|
5136 |
-
return __webpack_require__.e(/* import() | dashboard */ 25).then(__webpack_require__.bind(null, 911));
|
5137 |
-
});
|
5138 |
-
var DevDocs = Object(external_this_wp_element_["lazy"])(function () {
|
5139 |
-
return Promise.all(/* import() | devdocs */[__webpack_require__.e(1), __webpack_require__.e(47), __webpack_require__.e(29)]).then(__webpack_require__.bind(null, 924));
|
5140 |
-
});
|
5141 |
-
var Homescreen = Object(external_this_wp_element_["lazy"])(function () {
|
5142 |
-
return Promise.all(/* import() | homescreen */[__webpack_require__.e(1), __webpack_require__.e(3), __webpack_require__.e(4), __webpack_require__.e(6), __webpack_require__.e(30)]).then(__webpack_require__.bind(null, 921));
|
5143 |
-
});
|
5144 |
-
var MarketingOverview = Object(external_this_wp_element_["lazy"])(function () {
|
5145 |
-
return Promise.all(/* import() | marketing-overview */[__webpack_require__.e(1), __webpack_require__.e(48), __webpack_require__.e(34)]).then(__webpack_require__.bind(null, 923));
|
5146 |
-
});
|
5147 |
-
|
5148 |
-
var TIME_EXCLUDED_SCREENS_FILTER = 'woocommerce_admin_time_excluded_screens';
|
5149 |
-
var PAGES_FILTER = 'woocommerce_admin_pages_list';
|
5150 |
-
var controller_getPages = function getPages() {
|
5151 |
-
var pages = [];
|
5152 |
-
var initialBreadcrumbs = [['', wcSettings.woocommerceTranslation]];
|
5153 |
-
|
5154 |
-
if (window.wcAdminFeatures.devdocs) {
|
5155 |
-
pages.push({
|
5156 |
-
container: DevDocs,
|
5157 |
-
path: '/devdocs',
|
5158 |
-
breadcrumbs: function breadcrumbs(_ref) {
|
5159 |
-
var location = _ref.location;
|
5160 |
-
|
5161 |
-
var _getUrlParams = Object(utils["b" /* getUrlParams */])(location.search),
|
5162 |
-
component = _getUrlParams.component;
|
5163 |
-
|
5164 |
-
if (component) {
|
5165 |
-
return [].concat(initialBreadcrumbs, [['/devdocs', 'Documentation'], component]);
|
5166 |
-
}
|
5167 |
|
5168 |
-
|
5169 |
-
|
5170 |
-
wpOpenMenu: 'toplevel_page_woocommerce'
|
5171 |
-
});
|
5172 |
-
}
|
5173 |
|
5174 |
-
|
5175 |
-
pages.push({
|
5176 |
-
container: Dashboard,
|
5177 |
-
path: '/',
|
5178 |
-
breadcrumbs: [].concat(initialBreadcrumbs, [Object(external_this_wp_i18n_["__"])('Dashboard', 'woocommerce-admin')]),
|
5179 |
-
wpOpenMenu: 'toplevel_page_woocommerce'
|
5180 |
-
});
|
5181 |
-
}
|
5182 |
|
5183 |
-
|
5184 |
-
pages.push({
|
5185 |
-
container: Homescreen,
|
5186 |
-
path: '/',
|
5187 |
-
breadcrumbs: [].concat(initialBreadcrumbs, [Object(external_this_wp_i18n_["__"])('Home', 'woocommerce-admin')]),
|
5188 |
-
wpOpenMenu: 'toplevel_page_woocommerce'
|
5189 |
-
});
|
5190 |
-
}
|
5191 |
|
5192 |
-
|
5193 |
-
|
5194 |
-
pages.push({
|
5195 |
-
container: Dashboard,
|
5196 |
-
path: '/analytics/overview',
|
5197 |
-
breadcrumbs: [].concat(initialBreadcrumbs, [['/analytics/overview', Object(external_this_wp_i18n_["__"])('Analytics', 'woocommerce-admin')], Object(external_this_wp_i18n_["__"])('Overview', 'woocommerce-admin')]),
|
5198 |
-
wpOpenMenu: 'toplevel_page_wc-admin-path--analytics-overview'
|
5199 |
-
});
|
5200 |
-
}
|
5201 |
|
5202 |
-
|
5203 |
-
|
5204 |
-
|
5205 |
-
|
5206 |
-
|
5207 |
-
|
5208 |
-
|
5209 |
-
|
5210 |
-
|
5211 |
-
|
5212 |
-
|
5213 |
-
|
5214 |
-
|
5215 |
-
|
5216 |
-
|
5217 |
-
path: '/analytics/:report',
|
5218 |
-
breadcrumbs: function breadcrumbs(_ref2) {
|
5219 |
-
var match = _ref2.match;
|
5220 |
-
var report = Object(external_lodash_["find"])(Object(get_reports["a" /* default */])(), {
|
5221 |
-
report: match.params.report
|
5222 |
-
});
|
5223 |
|
5224 |
-
if (!report) {
|
5225 |
-
return [];
|
5226 |
-
}
|
5227 |
|
5228 |
-
|
5229 |
-
|
5230 |
-
|
5231 |
-
|
5232 |
-
}
|
5233 |
|
5234 |
-
|
5235 |
-
|
5236 |
-
|
5237 |
-
|
5238 |
-
|
5239 |
-
wpOpenMenu: 'toplevel_page_woocommerce-marketing'
|
5240 |
-
});
|
5241 |
}
|
5242 |
|
5243 |
-
return
|
5244 |
-
};
|
5245 |
-
var
|
5246 |
-
|
5247 |
-
|
5248 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5249 |
|
5250 |
-
|
5251 |
-
|
|
|
|
|
|
|
5252 |
|
5253 |
-
|
|
|
5254 |
}
|
5255 |
|
5256 |
-
|
5257 |
-
|
5258 |
-
|
5259 |
-
|
5260 |
-
|
5261 |
-
|
5262 |
-
|
5263 |
-
|
5264 |
-
|
5265 |
-
|
5266 |
-
|
5267 |
-
|
5268 |
-
|
5269 |
-
|
5270 |
-
|
5271 |
-
|
5272 |
-
|
|
|
|
|
5273 |
|
5274 |
-
|
5275 |
-
|
5276 |
-
|
5277 |
-
|
5278 |
-
}, {
|
5279 |
-
key: "getQuery",
|
5280 |
-
value: function getQuery(searchString) {
|
5281 |
-
if (!searchString) {
|
5282 |
-
return {};
|
5283 |
-
}
|
5284 |
|
5285 |
-
|
5286 |
-
|
5287 |
-
|
5288 |
-
}, {
|
5289 |
-
key: "render",
|
5290 |
-
value: function render() {
|
5291 |
-
var _this$props = this.props,
|
5292 |
-
page = _this$props.page,
|
5293 |
-
match = _this$props.match,
|
5294 |
-
location = _this$props.location;
|
5295 |
-
var url = match.url,
|
5296 |
-
params = match.params;
|
5297 |
-
var query = this.getQuery(location.search);
|
5298 |
-
window.wpNavMenuUrlUpdate(query);
|
5299 |
-
window.wpNavMenuClassChange(page, url);
|
5300 |
-
return Object(external_this_wp_element_["createElement"])(external_this_wp_element_["Suspense"], {
|
5301 |
-
fallback: Object(external_this_wp_element_["createElement"])(external_this_wc_components_["Spinner"], null)
|
5302 |
-
}, Object(external_this_wp_element_["createElement"])(page.container, {
|
5303 |
-
params: params,
|
5304 |
-
path: url,
|
5305 |
-
pathMatch: page.path,
|
5306 |
-
query: query
|
5307 |
-
}));
|
5308 |
-
}
|
5309 |
-
}]);
|
5310 |
|
5311 |
-
|
5312 |
-
}
|
5313 |
/**
|
5314 |
-
*
|
5315 |
-
* as is.
|
5316 |
*
|
5317 |
-
* @param {
|
5318 |
-
* @
|
5319 |
-
* @param {Array} excludedScreens - wc-admin screens to avoid updating.
|
5320 |
*/
|
5321 |
|
5322 |
-
function
|
5323 |
-
|
|
|
5324 |
|
5325 |
-
|
5326 |
-
var search = Object(external_lodash_["last"])(item.href.split('?'));
|
5327 |
-
var query = Object(lib["parse"])(search);
|
5328 |
-
var defaultPath = window.wcAdminFeatures.homescreen ? 'homescreen' : 'dashboard';
|
5329 |
-
var path = query.path || defaultPath;
|
5330 |
-
var screen = path.replace('/analytics', '').replace('/', '');
|
5331 |
-
var isExcludedScreen = excludedScreens.includes(screen);
|
5332 |
-
var href = 'admin.php?' + Object(lib["stringify"])(Object.assign(query, isExcludedScreen ? {} : nextQuery)); // Replace the href so you can see the url on hover.
|
5333 |
|
5334 |
-
|
|
|
5335 |
|
5336 |
-
|
5337 |
-
|
5338 |
-
|
5339 |
-
|
5340 |
-
|
5341 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
5342 |
|
5343 |
-
window.wpNavMenuUrlUpdate = function (query) {
|
5344 |
-
var excludedScreens = Object(external_this_wp_hooks_["applyFilters"])(TIME_EXCLUDED_SCREENS_FILTER, ['devdocs', 'stock', 'settings', 'customers', 'homescreen']);
|
5345 |
-
var nextQuery = Object(external_this_wc_navigation_["getPersistedQuery"])(query);
|
5346 |
-
Array.from(document.querySelectorAll('#adminmenu a')).forEach(function (item) {
|
5347 |
-
return updateLinkHref(item, nextQuery, excludedScreens);
|
5348 |
-
});
|
5349 |
-
}; // When the route changes, we need to update wp-admin's menu with the correct section & current link
|
5350 |
|
5351 |
|
5352 |
-
|
5353 |
-
|
5354 |
-
|
5355 |
-
});
|
5356 |
-
var submenu = Array.from(document.querySelectorAll('.wp-has-current-submenu'));
|
5357 |
-
submenu.forEach(function (element) {
|
5358 |
-
element.classList.remove('wp-has-current-submenu');
|
5359 |
-
element.classList.remove('wp-menu-open');
|
5360 |
-
element.classList.remove('selected');
|
5361 |
-
element.classList.add('wp-not-current-submenu');
|
5362 |
-
element.classList.add('menu-top');
|
5363 |
-
});
|
5364 |
-
var pageUrl = url === '/' ? 'admin.php?page=wc-admin' : 'admin.php?page=wc-admin&path=' + encodeURIComponent(url);
|
5365 |
-
var currentItemsSelector = url === '/' ? "li > a[href$=\"".concat(pageUrl, "\"], li > a[href*=\"").concat(pageUrl, "?\"]") : "li > a[href*=\"".concat(pageUrl, "\"]");
|
5366 |
-
var currentItems = document.querySelectorAll(currentItemsSelector);
|
5367 |
-
Array.from(currentItems).forEach(function (item) {
|
5368 |
-
item.parentElement.classList.add('current');
|
5369 |
-
});
|
5370 |
|
5371 |
-
if (page.wpOpenMenu) {
|
5372 |
-
var currentMenu = document.querySelector('#' + page.wpOpenMenu);
|
5373 |
|
5374 |
-
|
5375 |
-
|
5376 |
-
|
5377 |
-
|
5378 |
-
currentMenu.classList.add('current');
|
5379 |
-
}
|
5380 |
-
}
|
5381 |
|
5382 |
-
|
5383 |
-
|
5384 |
-
};
|
5385 |
-
|
5386 |
-
|
5387 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5388 |
|
5389 |
-
|
5390 |
-
var
|
5391 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5392 |
|
5393 |
-
|
5394 |
-
var external_this_wp_htmlEntities_ = __webpack_require__(72);
|
5395 |
|
5396 |
-
|
5397 |
-
|
5398 |
|
5399 |
-
|
5400 |
-
|
5401 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5402 |
|
5403 |
-
// EXTERNAL MODULE: ./node_modules/@wordpress/components/build-module/button/index.js
|
5404 |
-
var build_module_button = __webpack_require__(68);
|
5405 |
|
5406 |
-
// EXTERNAL MODULE: ./node_modules/@wordpress/components/build-module/navigable-container/menu.js + 1 modules
|
5407 |
-
var menu = __webpack_require__(418);
|
5408 |
|
5409 |
-
// EXTERNAL MODULE: ./node_modules/gridicons/dist/pages.js
|
5410 |
-
var dist_pages = __webpack_require__(407);
|
5411 |
-
var pages_default = /*#__PURE__*/__webpack_require__.n(dist_pages);
|
5412 |
|
5413 |
-
// EXTERNAL MODULE: ./node_modules/gridicons/dist/cross-small.js
|
5414 |
-
var cross_small = __webpack_require__(408);
|
5415 |
-
var cross_small_default = /*#__PURE__*/__webpack_require__.n(cross_small);
|
5416 |
|
5417 |
-
// EXTERNAL MODULE: ./client/header/activity-panel/style.scss
|
5418 |
-
var activity_panel_style = __webpack_require__(442);
|
5419 |
|
5420 |
-
// CONCATENATED MODULE: ./client/header/activity-panel/toggle-bubble.js
|
5421 |
|
5422 |
|
5423 |
-
|
5424 |
-
* External dependencies
|
5425 |
-
*/
|
5426 |
|
|
|
5427 |
|
|
|
5428 |
|
5429 |
-
|
5430 |
-
|
5431 |
-
|
5432 |
-
|
5433 |
-
|
5434 |
-
_ref$hasUnread = _ref.hasUnread,
|
5435 |
-
hasUnread = _ref$hasUnread === void 0 ? false : _ref$hasUnread;
|
5436 |
-
var classes = classnames_default()('woocommerce-layout__activity-panel-toggle-bubble', {
|
5437 |
-
'has-unread': hasUnread
|
5438 |
-
});
|
5439 |
-
/* eslint-disable max-len */
|
5440 |
|
5441 |
-
return Object(external_this_wp_element_["createElement"])("div", {
|
5442 |
-
className: classes
|
5443 |
-
}, Object(external_this_wp_element_["createElement"])("svg", {
|
5444 |
-
height: height,
|
5445 |
-
width: width,
|
5446 |
-
viewBox: "0 0 24 24"
|
5447 |
-
}, Object(external_this_wp_element_["createElement"])("path", {
|
5448 |
-
d: "M18.9 2H5.1C3.4 2 2 3.4 2 5.1v10.7C2 17.6 3.4 19 5.1 19H9l6 3-1-3h4.9c1.7 0 3.1-1.4 3.1-3.1V5.1C22 3.4 20.6 2 18.9 2zm-1.5 4.5c-.4.8-.8 2.1-1 3.9-.3 1.8-.4 3.1-.3 4.1 0 .3 0 .5-.1.7-.1.2-.3.4-.6.4s-.6-.1-.9-.4c-1-1-1.8-2.6-2.4-4.6-.7 1.4-1.2 2.4-1.6 3.1-.6 1.2-1.2 1.8-1.6 1.9-.3 0-.5-.2-.8-.7-.5-1.4-1.1-4.2-1.7-8.2 0-.3 0-.5.2-.7.1-.2.4-.3.7-.4.5 0 .9.2.9.8.3 2.3.7 4.2 1.1 5.7l2.4-4.5c.2-.4.4-.6.8-.6.5 0 .8.3.9.9.3 1.4.6 2.6 1 3.7.3-2.7.8-4.7 1.4-5.9.2-.3.4-.5.7-.5.2 0 .5.1.7.2.2.2.3.4.3.6 0 .2 0 .4-.1.5z"
|
5449 |
-
})));
|
5450 |
-
/* eslint-enable max-len */
|
5451 |
-
};
|
5452 |
|
5453 |
-
toggle_bubble_ActivityPanelToggleBubble.propTypes = {
|
5454 |
-
height: prop_types_default.a.number,
|
5455 |
-
width: prop_types_default.a.number,
|
5456 |
-
hasUnread: prop_types_default.a.bool
|
5457 |
-
};
|
5458 |
-
/* harmony default export */ var toggle_bubble = (toggle_bubble_ActivityPanelToggleBubble);
|
5459 |
-
// EXTERNAL MODULE: ./client/analytics/settings/config.js + 1 modules
|
5460 |
-
var config = __webpack_require__(271);
|
5461 |
|
5462 |
-
// EXTERNAL MODULE: ./client/wc-api/constants.js
|
5463 |
-
var constants = __webpack_require__(33);
|
5464 |
|
5465 |
-
// CONCATENATED MODULE: ./client/header/activity-panel/unread-indicators.js
|
5466 |
/**
|
5467 |
* WooCommerce dependencies
|
5468 |
*/
|
5469 |
|
|
|
|
|
5470 |
/**
|
5471 |
* Internal dependencies
|
5472 |
*/
|
@@ -5474,9649 +5510,9899 @@ var constants = __webpack_require__(33);
|
|
5474 |
|
5475 |
|
5476 |
|
5477 |
-
function getUnreadNotes(select) {
|
5478 |
-
var _select = select('wc-api'),
|
5479 |
-
getNotes = _select.getNotes,
|
5480 |
-
getNotesError = _select.getNotesError,
|
5481 |
-
isGetNotesRequesting = _select.isGetNotesRequesting;
|
5482 |
|
5483 |
-
var _select2 = select(external_this_wc_data_["USER_STORE_NAME"]),
|
5484 |
-
getCurrentUser = _select2.getCurrentUser;
|
5485 |
|
5486 |
-
var userData = getCurrentUser();
|
5487 |
-
var lastRead = parseInt(userData && userData.woocommerce_meta && userData.woocommerce_meta.activity_panel_inbox_last_read, 10);
|
5488 |
|
5489 |
-
|
5490 |
-
|
5491 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
5492 |
|
5493 |
-
|
5494 |
-
|
5495 |
-
|
5496 |
-
|
5497 |
-
|
5498 |
-
order: 'desc'
|
5499 |
-
}; // Disable eslint rule requiring `latestNote` to be defined below because the next two statements
|
5500 |
-
// depend on `getNotes` to have been called.
|
5501 |
-
// eslint-disable-next-line @wordpress/no-unused-vars-before-return
|
5502 |
|
5503 |
-
|
5504 |
-
|
5505 |
-
var isRequesting = isGetNotesRequesting(notesQuery);
|
5506 |
|
5507 |
-
|
5508 |
-
return null;
|
5509 |
-
}
|
5510 |
|
5511 |
-
|
5512 |
-
|
5513 |
-
function getUnreadOrders(select) {
|
5514 |
-
var _select3 = select('wc-api'),
|
5515 |
-
getItems = _select3.getItems,
|
5516 |
-
getItemsTotalCount = _select3.getItemsTotalCount,
|
5517 |
-
getItemsError = _select3.getItemsError,
|
5518 |
-
isGetItemsRequesting = _select3.isGetItemsRequesting;
|
5519 |
-
|
5520 |
-
var _select4 = select(external_this_wc_data_["SETTINGS_STORE_NAME"]),
|
5521 |
-
getMutableSetting = _select4.getSetting;
|
5522 |
|
5523 |
-
|
5524 |
-
_getMutableSetting$wo = _getMutableSetting.woocommerce_actionable_order_statuses,
|
5525 |
-
orderStatuses = _getMutableSetting$wo === void 0 ? config["a" /* DEFAULT_ACTIONABLE_STATUSES */] : _getMutableSetting$wo;
|
5526 |
|
5527 |
-
|
5528 |
-
|
|
|
|
|
|
|
5529 |
}
|
5530 |
|
5531 |
-
|
5532 |
-
|
5533 |
-
|
5534 |
-
|
5535 |
-
|
5536 |
-
|
5537 |
-
|
5538 |
-
getItems('orders', ordersQuery); // Disable eslint rule requiring `latestNote` to be defined below because the next two statements
|
5539 |
-
// depend on `getItemsTotalCount` to have been called.
|
5540 |
-
// eslint-disable-next-line @wordpress/no-unused-vars-before-return
|
5541 |
|
5542 |
-
|
5543 |
-
|
5544 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
5545 |
|
5546 |
-
|
5547 |
-
return null;
|
5548 |
-
}
|
5549 |
|
5550 |
-
|
5551 |
-
|
5552 |
-
|
5553 |
-
|
5554 |
-
|
5555 |
-
getReviewsError = _select5.getReviewsError,
|
5556 |
-
isGetReviewsRequesting = _select5.isGetReviewsRequesting;
|
5557 |
|
5558 |
-
|
|
|
|
|
|
|
5559 |
|
5560 |
-
|
5561 |
-
|
5562 |
-
|
5563 |
-
// @todo we are not using this review, so when the endpoint supports it,
|
5564 |
-
// it could be replaced with `per_page: 0`
|
5565 |
-
per_page: 1,
|
5566 |
-
status: 'hold'
|
5567 |
-
};
|
5568 |
-
var totalActionableReviews = getReviewsTotalCount(actionableReviewsQuery);
|
5569 |
-
var isActionableReviewsError = Boolean(getReviewsError(actionableReviewsQuery));
|
5570 |
-
var isActionableReviewsRequesting = isGetReviewsRequesting(actionableReviewsQuery);
|
5571 |
|
5572 |
-
|
5573 |
-
return
|
|
|
|
|
5574 |
}
|
5575 |
-
}
|
5576 |
|
5577 |
-
return
|
5578 |
-
}
|
5579 |
-
function getUnreadStock() {
|
5580 |
-
return Object(settings["g" /* getSetting */])('hasLowStock', false);
|
5581 |
-
}
|
5582 |
-
// EXTERNAL MODULE: ./client/lib/tracks.js
|
5583 |
-
var tracks = __webpack_require__(63);
|
5584 |
|
5585 |
-
|
5586 |
-
|
|
|
|
|
|
|
|
|
5587 |
|
5588 |
-
|
|
|
|
|
5589 |
|
|
|
|
|
5590 |
|
|
|
|
|
|
|
|
|
|
|
|
|
5591 |
|
|
|
|
|
|
|
|
|
|
|
|
|
5592 |
|
|
|
|
|
|
|
|
|
|
|
|
|
5593 |
|
|
|
5594 |
|
|
|
|
|
5595 |
|
|
|
5596 |
|
5597 |
-
|
|
|
|
|
|
|
5598 |
|
5599 |
-
|
|
|
|
|
5600 |
|
5601 |
-
|
5602 |
-
|
5603 |
-
*/
|
5604 |
|
|
|
|
|
|
|
5605 |
|
|
|
|
|
|
|
5606 |
|
|
|
|
|
|
|
5607 |
|
|
|
|
|
|
|
5608 |
|
|
|
|
|
|
|
5609 |
|
|
|
|
|
|
|
5610 |
|
|
|
|
|
5611 |
|
|
|
|
|
5612 |
|
|
|
|
|
5613 |
|
5614 |
-
|
5615 |
-
|
5616 |
-
*/
|
5617 |
|
|
|
|
|
|
|
5618 |
|
|
|
|
|
|
|
5619 |
|
|
|
|
|
5620 |
|
|
|
|
|
|
|
5621 |
|
|
|
|
|
|
|
5622 |
|
5623 |
-
|
5624 |
-
return Promise.all(/* import() | activity-panels-inbox */[__webpack_require__.e(1), __webpack_require__.e(3), __webpack_require__.e(4), __webpack_require__.e(46), __webpack_require__.e(7)]).then(__webpack_require__.bind(null, 792));
|
5625 |
-
});
|
5626 |
-
var OrdersPanel = Object(external_this_wp_element_["lazy"])(function () {
|
5627 |
-
return Promise.all(/* import() | activity-panels-orders */[__webpack_require__.e(1), __webpack_require__.e(3), __webpack_require__.e(8)]).then(__webpack_require__.bind(null, 927));
|
5628 |
-
});
|
5629 |
-
var StockPanel = Object(external_this_wp_element_["lazy"])(function () {
|
5630 |
-
return Promise.all(/* import() | activity-panels-stock */[__webpack_require__.e(1), __webpack_require__.e(3), __webpack_require__.e(9)]).then(__webpack_require__.bind(null, 928));
|
5631 |
-
});
|
5632 |
-
var ReviewsPanel = Object(external_this_wp_element_["lazy"])(function () {
|
5633 |
-
return Promise.all(/* import() | activity-panels-inbox */[__webpack_require__.e(1), __webpack_require__.e(3), __webpack_require__.e(4), __webpack_require__.e(46), __webpack_require__.e(7)]).then(__webpack_require__.bind(null, 916));
|
5634 |
-
});
|
5635 |
|
5636 |
|
5637 |
-
var manageStock = Object(settings["g" /* getSetting */])('manageStock', 'no');
|
5638 |
-
var activity_panel_reviewsEnabled = Object(settings["g" /* getSetting */])('reviewsEnabled', 'no');
|
5639 |
|
5640 |
-
var activity_panel_ActivityPanel = /*#__PURE__*/function (_Component) {
|
5641 |
-
inherits_default()(ActivityPanel, _Component);
|
5642 |
|
5643 |
-
var _super = activity_panel_createSuper(ActivityPanel);
|
5644 |
|
5645 |
-
function ActivityPanel() {
|
5646 |
-
var _this;
|
5647 |
|
5648 |
-
|
5649 |
|
5650 |
-
|
5651 |
-
|
5652 |
-
|
5653 |
-
|
5654 |
-
|
5655 |
-
_this.state = {
|
5656 |
-
isPanelOpen: false,
|
5657 |
-
mobileOpen: false,
|
5658 |
-
currentTab: '',
|
5659 |
-
isPanelSwitching: false
|
5660 |
-
};
|
5661 |
-
return _this;
|
5662 |
}
|
|
|
5663 |
|
5664 |
-
|
5665 |
-
|
5666 |
-
|
5667 |
-
|
5668 |
-
|
5669 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5670 |
|
5671 |
-
|
5672 |
-
|
5673 |
-
|
5674 |
-
});
|
5675 |
-
}
|
5676 |
|
5677 |
-
|
5678 |
-
|
5679 |
-
return {
|
5680 |
-
isPanelOpen: !state.isPanelOpen,
|
5681 |
-
currentTab: tabName,
|
5682 |
-
mobileOpen: !state.isPanelOpen
|
5683 |
-
};
|
5684 |
-
}
|
5685 |
|
5686 |
-
|
5687 |
-
currentTab: tabName,
|
5688 |
-
isPanelSwitching: true
|
5689 |
-
};
|
5690 |
-
});
|
5691 |
-
}
|
5692 |
-
}, {
|
5693 |
-
key: "clearPanel",
|
5694 |
-
value: function clearPanel() {
|
5695 |
-
this.setState(function (_ref) {
|
5696 |
-
var isPanelOpen = _ref.isPanelOpen;
|
5697 |
-
return isPanelOpen ? {
|
5698 |
-
isPanelSwitching: false
|
5699 |
-
} : {
|
5700 |
-
currentTab: ''
|
5701 |
-
};
|
5702 |
-
});
|
5703 |
-
} // On smaller screen, the panel buttons are hidden behind a toggle.
|
5704 |
|
5705 |
-
|
5706 |
-
|
5707 |
-
|
5708 |
-
|
5709 |
-
|
5710 |
-
|
5711 |
-
|
5712 |
-
|
5713 |
-
|
5714 |
-
|
5715 |
-
|
5716 |
}
|
5717 |
-
}, {
|
5718 |
-
key: "handleClickOutside",
|
5719 |
-
value: function handleClickOutside(event) {
|
5720 |
-
var _this$state2 = this.state,
|
5721 |
-
isPanelOpen = _this$state2.isPanelOpen,
|
5722 |
-
currentTab = _this$state2.currentTab;
|
5723 |
-
var isClickOnModalOrSnackbar = event.target.closest('.woocommerce-inbox-dismiss-confirmation_modal') || event.target.closest('.components-snackbar__action');
|
5724 |
|
5725 |
-
|
5726 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5727 |
}
|
5728 |
-
}
|
5729 |
|
5730 |
-
|
5731 |
-
|
5732 |
-
|
5733 |
-
var _this$props = this.props,
|
5734 |
-
hasUnreadNotes = _this$props.hasUnreadNotes,
|
5735 |
-
hasUnreadOrders = _this$props.hasUnreadOrders,
|
5736 |
-
hasUnapprovedReviews = _this$props.hasUnapprovedReviews,
|
5737 |
-
hasUnreadStock = _this$props.hasUnreadStock,
|
5738 |
-
isEmbedded = _this$props.isEmbedded; // Don't show the inbox on the Home screen.
|
5739 |
|
5740 |
-
|
5741 |
-
|
5742 |
|
5743 |
-
|
5744 |
-
return [showInbox ? {
|
5745 |
-
name: 'inbox',
|
5746 |
-
title: Object(external_this_wp_i18n_["__"])('Inbox', 'woocommerce-admin'),
|
5747 |
-
icon: Object(external_this_wp_element_["createElement"])("i", {
|
5748 |
-
className: "material-icons-outlined"
|
5749 |
-
}, "inbox"),
|
5750 |
-
unread: hasUnreadNotes
|
5751 |
-
} : null, {
|
5752 |
-
name: 'orders',
|
5753 |
-
title: Object(external_this_wp_i18n_["__"])('Orders', 'woocommerce-admin'),
|
5754 |
-
icon: Object(external_this_wp_element_["createElement"])(pages_default.a, null),
|
5755 |
-
unread: hasUnreadOrders
|
5756 |
-
}, manageStock === 'yes' ? {
|
5757 |
-
name: 'stock',
|
5758 |
-
title: Object(external_this_wp_i18n_["__"])('Stock', 'woocommerce-admin'),
|
5759 |
-
icon: Object(external_this_wp_element_["createElement"])("i", {
|
5760 |
-
className: "material-icons-outlined"
|
5761 |
-
}, "widgets"),
|
5762 |
-
unread: hasUnreadStock
|
5763 |
-
} : null, activity_panel_reviewsEnabled === 'yes' ? {
|
5764 |
-
name: 'reviews',
|
5765 |
-
title: Object(external_this_wp_i18n_["__"])('Reviews', 'woocommerce-admin'),
|
5766 |
-
icon: Object(external_this_wp_element_["createElement"])("i", {
|
5767 |
-
className: "material-icons-outlined"
|
5768 |
-
}, "star_border"),
|
5769 |
-
unread: hasUnapprovedReviews
|
5770 |
-
} : null].filter(Boolean);
|
5771 |
-
}
|
5772 |
-
}, {
|
5773 |
-
key: "getPanelContent",
|
5774 |
-
value: function getPanelContent(tab) {
|
5775 |
-
switch (tab) {
|
5776 |
-
case 'inbox':
|
5777 |
-
return Object(external_this_wp_element_["createElement"])(InboxPanel, null);
|
5778 |
|
5779 |
-
|
5780 |
-
|
5781 |
-
|
5782 |
-
|
5783 |
-
});
|
5784 |
|
5785 |
-
|
5786 |
-
|
5787 |
|
5788 |
-
|
5789 |
-
|
5790 |
-
|
5791 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5792 |
});
|
|
|
|
|
5793 |
|
5794 |
-
|
5795 |
-
return null;
|
5796 |
-
}
|
5797 |
}
|
5798 |
-
}, {
|
5799 |
-
key: "renderPanel",
|
5800 |
-
value: function renderPanel() {
|
5801 |
-
var _this$state3 = this.state,
|
5802 |
-
isPanelOpen = _this$state3.isPanelOpen,
|
5803 |
-
currentTab = _this$state3.currentTab,
|
5804 |
-
isPanelSwitching = _this$state3.isPanelSwitching;
|
5805 |
-
var tab = Object(external_lodash_["find"])(this.getTabs(), {
|
5806 |
-
name: currentTab
|
5807 |
-
});
|
5808 |
|
5809 |
-
|
5810 |
-
|
5811 |
-
|
5812 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
5813 |
}
|
5814 |
|
5815 |
-
var
|
5816 |
-
|
5817 |
-
|
5818 |
-
});
|
5819 |
-
return Object(external_this_wp_element_["createElement"])("div", {
|
5820 |
-
className: classNames,
|
5821 |
-
tabIndex: 0,
|
5822 |
-
role: "tabpanel",
|
5823 |
-
"aria-label": tab.title,
|
5824 |
-
onTransitionEnd: this.clearPanel,
|
5825 |
-
onAnimationEnd: this.clearPanel
|
5826 |
-
}, Object(external_this_wp_element_["createElement"])("div", {
|
5827 |
-
className: "woocommerce-layout__activity-panel-content",
|
5828 |
-
key: 'activity-panel-' + currentTab,
|
5829 |
-
id: 'activity-panel-' + currentTab
|
5830 |
-
}, Object(external_this_wp_element_["createElement"])(external_this_wp_element_["Suspense"], {
|
5831 |
-
fallback: Object(external_this_wp_element_["createElement"])(external_this_wc_components_["Spinner"], null)
|
5832 |
-
}, this.getPanelContent(currentTab))));
|
5833 |
-
}
|
5834 |
-
}, {
|
5835 |
-
key: "renderTab",
|
5836 |
-
value: function renderTab(tab, i) {
|
5837 |
-
var _this$state4 = this.state,
|
5838 |
-
currentTab = _this$state4.currentTab,
|
5839 |
-
isPanelOpen = _this$state4.isPanelOpen;
|
5840 |
-
var className = classnames_default()('woocommerce-layout__activity-panel-tab', {
|
5841 |
-
'is-active': isPanelOpen && tab.name === currentTab,
|
5842 |
-
'has-unread': tab.unread
|
5843 |
-
});
|
5844 |
-
var selected = tab.name === currentTab;
|
5845 |
-
var tabIndex = -1; // Only make this item tabbable if it is the currently selected item, or the panel is closed and the item is the first item.
|
5846 |
|
5847 |
-
|
5848 |
-
|
|
|
5849 |
}
|
|
|
5850 |
|
5851 |
-
|
5852 |
-
|
5853 |
-
|
5854 |
-
|
5855 |
-
|
5856 |
-
|
5857 |
-
|
5858 |
-
id: 'activity-panel-tab-' + tab.name,
|
5859 |
-
onClick: Object(external_lodash_["partial"])(this.togglePanel, tab.name)
|
5860 |
-
}, tab.icon, tab.title, ' ', tab.unread && Object(external_this_wp_element_["createElement"])("span", {
|
5861 |
-
className: "screen-reader-text"
|
5862 |
-
}, Object(external_this_wp_i18n_["__"])('unread activity', 'woocommerce-admin')));
|
5863 |
-
}
|
5864 |
-
}, {
|
5865 |
-
key: "render",
|
5866 |
-
value: function render() {
|
5867 |
-
var tabs = this.getTabs();
|
5868 |
-
var mobileOpen = this.state.mobileOpen;
|
5869 |
-
var headerId = Object(external_lodash_["uniqueId"])('activity-panel-header_');
|
5870 |
-
var panelClasses = classnames_default()('woocommerce-layout__activity-panel', {
|
5871 |
-
'is-mobile-open': this.state.mobileOpen
|
5872 |
-
});
|
5873 |
-
var hasUnread = tabs.some(function (tab) {
|
5874 |
-
return tab.unread;
|
5875 |
-
});
|
5876 |
-
var viewLabel = hasUnread ? Object(external_this_wp_i18n_["__"])('View Activity Panel, you have unread activity', 'woocommerce-admin') : Object(external_this_wp_i18n_["__"])('View Activity Panel', 'woocommerce-admin');
|
5877 |
-
return Object(external_this_wp_element_["createElement"])("div", null, Object(external_this_wp_element_["createElement"])(external_this_wc_components_["H"], {
|
5878 |
-
id: headerId,
|
5879 |
-
className: "screen-reader-text"
|
5880 |
-
}, Object(external_this_wp_i18n_["__"])('Store Activity', 'woocommerce-admin')), Object(external_this_wp_element_["createElement"])(external_this_wc_components_["Section"], {
|
5881 |
-
component: "aside",
|
5882 |
-
id: "woocommerce-activity-panel",
|
5883 |
-
"aria-labelledby": headerId
|
5884 |
-
}, Object(external_this_wp_element_["createElement"])(build_module_button["a" /* default */], {
|
5885 |
-
onClick: this.toggleMobile,
|
5886 |
-
label: mobileOpen ? Object(external_this_wp_i18n_["__"])('Close Activity Panel', 'woocommerce-admin') : viewLabel,
|
5887 |
-
"aria-expanded": mobileOpen,
|
5888 |
-
className: "woocommerce-layout__activity-panel-mobile-toggle"
|
5889 |
-
}, mobileOpen ? Object(external_this_wp_element_["createElement"])(cross_small_default.a, null) : Object(external_this_wp_element_["createElement"])(toggle_bubble, {
|
5890 |
-
hasUnread: hasUnread
|
5891 |
-
})), Object(external_this_wp_element_["createElement"])("div", {
|
5892 |
-
className: panelClasses
|
5893 |
-
}, Object(external_this_wp_element_["createElement"])(menu["a" /* default */], {
|
5894 |
-
role: "tablist",
|
5895 |
-
orientation: "horizontal",
|
5896 |
-
className: "woocommerce-layout__activity-panel-tabs"
|
5897 |
-
}, tabs && tabs.map(this.renderTab)), this.renderPanel())));
|
5898 |
-
}
|
5899 |
-
}]);
|
5900 |
|
5901 |
-
|
5902 |
-
|
|
|
5903 |
|
5904 |
-
|
5905 |
-
|
5906 |
-
|
5907 |
-
|
5908 |
-
var hasUnapprovedReviews = getUnapprovedReviews(select);
|
5909 |
return {
|
5910 |
-
|
5911 |
-
|
5912 |
-
hasUnreadStock: hasUnreadStock,
|
5913 |
-
hasUnapprovedReviews: hasUnapprovedReviews
|
5914 |
};
|
5915 |
-
}
|
5916 |
-
// CONCATENATED MODULE: ./client/header/index.js
|
5917 |
|
|
|
5918 |
|
|
|
5919 |
|
|
|
|
|
5920 |
|
|
|
|
|
5921 |
|
|
|
|
|
|
|
5922 |
|
|
|
|
|
5923 |
|
|
|
|
|
5924 |
|
5925 |
-
|
|
|
|
|
5926 |
|
5927 |
-
|
5928 |
|
5929 |
-
/**
|
5930 |
-
* External dependencies
|
5931 |
-
*/
|
5932 |
|
5933 |
|
5934 |
|
5935 |
|
5936 |
|
5937 |
-
/**
|
5938 |
-
* WooCommerce dependencies
|
5939 |
-
*/
|
5940 |
|
5941 |
|
5942 |
|
5943 |
|
5944 |
-
/**
|
5945 |
-
* Internal dependencies
|
5946 |
-
*/
|
5947 |
|
5948 |
|
5949 |
|
|
|
5950 |
|
|
|
|
|
|
|
|
|
|
|
5951 |
|
5952 |
-
var
|
5953 |
-
|
|
|
5954 |
|
5955 |
-
|
|
|
|
|
5956 |
|
5957 |
-
|
5958 |
-
|
|
|
|
|
5959 |
|
5960 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5961 |
|
5962 |
-
|
|
|
|
|
|
|
5963 |
_this.state = {
|
5964 |
-
|
5965 |
-
};
|
5966 |
-
|
5967 |
-
|
5968 |
-
|
5969 |
-
|
5970 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5971 |
return _this;
|
5972 |
}
|
5973 |
|
5974 |
-
|
5975 |
-
key: "componentDidMount",
|
5976 |
-
value: function componentDidMount() {
|
5977 |
-
this.threshold = this.headerRef.current.offsetTop;
|
5978 |
-
window.addEventListener('scroll', this.onWindowScroll);
|
5979 |
-
this.updateIsScrolled();
|
5980 |
-
}
|
5981 |
-
}, {
|
5982 |
-
key: "componentWillUnmount",
|
5983 |
-
value: function componentWillUnmount() {
|
5984 |
-
window.removeEventListener('scroll', this.onWindowScroll);
|
5985 |
-
window.cancelAnimationFrame(this.handle);
|
5986 |
-
}
|
5987 |
-
}, {
|
5988 |
-
key: "onWindowScroll",
|
5989 |
-
value: function onWindowScroll() {
|
5990 |
-
this.handle = window.requestAnimationFrame(this.updateIsScrolled);
|
5991 |
-
}
|
5992 |
-
}, {
|
5993 |
-
key: "updateIsScrolled",
|
5994 |
-
value: function updateIsScrolled() {
|
5995 |
-
var isScrolled = window.pageYOffset > this.threshold - 20;
|
5996 |
|
5997 |
-
|
5998 |
-
|
5999 |
-
|
6000 |
-
|
6001 |
-
|
6002 |
-
|
6003 |
-
}, {
|
6004 |
-
key: "trackLinkClick",
|
6005 |
-
value: function trackLinkClick(event) {
|
6006 |
-
var href = event.target.closest('a').getAttribute('href');
|
6007 |
-
Object(tracks["b" /* recordEvent */])('navbar_breadcrumb_click', {
|
6008 |
-
href: href,
|
6009 |
-
text: event.target.innerText
|
6010 |
});
|
6011 |
}
|
6012 |
-
}
|
6013 |
-
key: "updateDocumentTitle",
|
6014 |
-
value: function updateDocumentTitle() {
|
6015 |
-
var _this$props = this.props,
|
6016 |
-
sections = _this$props.sections,
|
6017 |
-
isEmbedded = _this$props.isEmbedded; // Don't modify the document title on existing WooCommerce pages.
|
6018 |
|
6019 |
-
|
6020 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6021 |
}
|
|
|
|
|
6022 |
|
6023 |
-
|
|
|
6024 |
|
6025 |
-
|
6026 |
-
return Array.isArray(section) ? section[1] : section;
|
6027 |
-
}).reverse().join(' ‹ ');
|
6028 |
|
6029 |
-
|
6030 |
-
|
6031 |
-
|
6032 |
-
key: "render",
|
6033 |
-
value: function render() {
|
6034 |
-
var _this2 = this;
|
6035 |
|
6036 |
-
|
6037 |
-
|
6038 |
-
|
6039 |
-
|
6040 |
|
6041 |
-
|
|
|
6042 |
|
6043 |
-
|
6044 |
-
|
6045 |
-
'is-scrolled': isScrolled
|
6046 |
-
});
|
6047 |
-
return Object(external_this_wp_element_["createElement"])("div", {
|
6048 |
-
className: className,
|
6049 |
-
ref: this.headerRef
|
6050 |
-
}, Object(external_this_wp_element_["createElement"])("h1", {
|
6051 |
-
className: "woocommerce-layout__header-breadcrumbs"
|
6052 |
-
}, _sections.map(function (section, i) {
|
6053 |
-
var sectionPiece = Array.isArray(section) ? Object(external_this_wp_element_["createElement"])(external_this_wc_components_["Link"], {
|
6054 |
-
href: isEmbedded ? Object(settings["f" /* getAdminLink */])(section[0]) : Object(external_this_wc_navigation_["getNewPath"])({}, section[0], {}),
|
6055 |
-
type: isEmbedded ? 'wp-admin' : 'wc-admin',
|
6056 |
-
onClick: _this2.trackLinkClick
|
6057 |
-
}, section[1]) : section;
|
6058 |
-
return Object(external_this_wp_element_["createElement"])("span", {
|
6059 |
-
key: i
|
6060 |
-
}, Object(external_this_wp_htmlEntities_["decodeEntities"])(sectionPiece));
|
6061 |
-
})), window.wcAdminFeatures['activity-panels'] && Object(external_this_wp_element_["createElement"])(activity_panel, {
|
6062 |
-
isEmbedded: isEmbedded
|
6063 |
-
}));
|
6064 |
}
|
6065 |
-
}]);
|
6066 |
|
6067 |
-
|
6068 |
-
|
|
|
|
|
6069 |
|
6070 |
-
|
6071 |
-
sections: prop_types_default.a.node.isRequired,
|
6072 |
-
isEmbedded: prop_types_default.a.bool
|
6073 |
-
};
|
6074 |
-
header_Header.defaultProps = {
|
6075 |
-
isEmbedded: false
|
6076 |
-
};
|
6077 |
-
/* harmony default export */ var header = (header_Header);
|
6078 |
-
// CONCATENATED MODULE: ./client/layout/notices.js
|
6079 |
|
|
|
|
|
|
|
|
|
|
|
|
|
6080 |
|
|
|
|
|
6081 |
|
|
|
6082 |
|
|
|
|
|
|
|
|
|
6083 |
|
|
|
|
|
|
|
6084 |
|
|
|
6085 |
|
6086 |
-
|
|
|
|
|
6087 |
|
6088 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6089 |
|
6090 |
/**
|
6091 |
-
*
|
6092 |
*/
|
6093 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6094 |
|
6095 |
-
|
6096 |
-
inherits_default()(Notices, _Component);
|
6097 |
|
6098 |
-
|
|
|
|
|
6099 |
|
6100 |
-
|
6101 |
-
|
|
|
6102 |
|
6103 |
-
|
|
|
|
|
6104 |
}
|
6105 |
|
6106 |
-
|
6107 |
-
|
6108 |
-
|
6109 |
-
|
6110 |
-
|
6111 |
-
className: "woocommerce-layout__notice-list"
|
6112 |
-
});
|
6113 |
-
}
|
6114 |
-
}]);
|
6115 |
|
6116 |
-
return Notices;
|
6117 |
-
}(external_this_wp_element_["Component"]);
|
6118 |
|
6119 |
-
|
6120 |
-
|
6121 |
-
|
6122 |
-
|
6123 |
|
6124 |
-
|
6125 |
-
|
|
|
6126 |
|
6127 |
-
|
6128 |
-
|
|
|
|
|
6129 |
|
6130 |
-
|
6131 |
-
|
|
|
6132 |
|
6133 |
-
|
6134 |
-
var
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6135 |
|
6136 |
-
|
6137 |
-
|
|
|
|
|
6138 |
|
6139 |
-
|
|
|
|
|
|
|
|
|
|
|
6140 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6141 |
|
|
|
6142 |
|
|
|
|
|
|
|
6143 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6144 |
|
|
|
|
|
|
|
|
|
6145 |
|
|
|
|
|
6146 |
/**
|
6147 |
-
*
|
6148 |
*/
|
6149 |
|
6150 |
|
|
|
|
|
|
|
|
|
6151 |
|
6152 |
-
|
6153 |
-
|
6154 |
-
|
|
|
|
|
6155 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6156 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6157 |
|
6158 |
-
|
6159 |
-
|
6160 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6161 |
|
|
|
|
|
|
|
6162 |
|
|
|
|
|
|
|
|
|
|
|
6163 |
/**
|
6164 |
-
*
|
6165 |
-
*
|
6166 |
-
* @param {Object} $0 Props passed to the component.
|
6167 |
-
* @param {Array} $0.notices Array of notices to render.
|
6168 |
-
* @param {Function} $0.onRemove Function called when a notice should be removed / dismissed.
|
6169 |
-
* @param {Object} $0.className Name of the class used by the component.
|
6170 |
-
* @param {Object} $0.children Array of children to be rendered inside the notice list.
|
6171 |
-
* @return {Object} The rendered notices list.
|
6172 |
*/
|
6173 |
|
6174 |
-
function SnackbarList(_ref) {
|
6175 |
-
var notices = _ref.notices,
|
6176 |
-
className = _ref.className,
|
6177 |
-
children = _ref.children,
|
6178 |
-
_ref$onRemove = _ref.onRemove,
|
6179 |
-
onRemove = _ref$onRemove === void 0 ? external_lodash_["noop"] : _ref$onRemove;
|
6180 |
-
var isReducedMotion = Object(use_reduced_motion["a" /* default */])();
|
6181 |
|
6182 |
-
|
6183 |
-
|
6184 |
-
|
6185 |
-
|
6186 |
-
refMap = _useState2[0];
|
6187 |
|
6188 |
-
|
6189 |
-
return
|
6190 |
-
}
|
6191 |
-
from: {
|
6192 |
-
opacity: 0,
|
6193 |
-
height: 0
|
6194 |
-
},
|
6195 |
-
enter: function enter(item) {
|
6196 |
-
return /*#__PURE__*/function () {
|
6197 |
-
var _ref2 = Object(asyncToGenerator["a" /* default */])( /*#__PURE__*/regenerator_default.a.mark(function _callee(next) {
|
6198 |
-
return regenerator_default.a.wrap(function _callee$(_context) {
|
6199 |
-
while (1) {
|
6200 |
-
switch (_context.prev = _context.next) {
|
6201 |
-
case 0:
|
6202 |
-
_context.next = 2;
|
6203 |
-
return next({
|
6204 |
-
opacity: 1,
|
6205 |
-
height: refMap.get(item).offsetHeight
|
6206 |
-
});
|
6207 |
|
6208 |
-
|
6209 |
-
return _context.abrupt("return", _context.sent);
|
6210 |
|
6211 |
-
|
6212 |
-
|
6213 |
-
return _context.stop();
|
6214 |
-
}
|
6215 |
-
}
|
6216 |
-
}, _callee);
|
6217 |
-
}));
|
6218 |
|
6219 |
-
|
6220 |
-
|
6221 |
-
|
6222 |
-
|
6223 |
-
|
6224 |
-
leave: function leave() {
|
6225 |
-
return /*#__PURE__*/function () {
|
6226 |
-
var _ref3 = Object(asyncToGenerator["a" /* default */])( /*#__PURE__*/regenerator_default.a.mark(function _callee2(next) {
|
6227 |
-
return regenerator_default.a.wrap(function _callee2$(_context2) {
|
6228 |
-
while (1) {
|
6229 |
-
switch (_context2.prev = _context2.next) {
|
6230 |
-
case 0:
|
6231 |
-
_context2.next = 2;
|
6232 |
-
return next({
|
6233 |
-
opacity: 0
|
6234 |
-
});
|
6235 |
|
6236 |
-
|
6237 |
-
|
6238 |
-
|
6239 |
-
|
6240 |
-
});
|
6241 |
|
6242 |
-
|
6243 |
-
|
6244 |
-
|
6245 |
-
|
6246 |
-
|
6247 |
-
}, _callee2);
|
6248 |
-
}));
|
6249 |
|
6250 |
-
|
6251 |
-
|
6252 |
-
|
6253 |
-
}();
|
6254 |
-
},
|
6255 |
-
immediate: isReducedMotion
|
6256 |
-
});
|
6257 |
-
className = classnames_default()('components-snackbar-list', className);
|
6258 |
|
6259 |
-
|
6260 |
-
|
6261 |
-
|
6262 |
-
};
|
6263 |
};
|
6264 |
|
6265 |
-
return
|
6266 |
-
|
6267 |
-
|
6268 |
-
|
6269 |
-
|
6270 |
-
|
6271 |
-
|
6272 |
-
key: key,
|
6273 |
-
style: style
|
6274 |
-
}, Object(external_this_wp_element_["createElement"])("div", {
|
6275 |
-
className: "components-snackbar-list__notice-container",
|
6276 |
-
ref: function ref(_ref5) {
|
6277 |
-
return _ref5 && refMap.set(notice, _ref5);
|
6278 |
-
}
|
6279 |
-
}, Object(external_this_wp_element_["createElement"])(snackbar["a" /* default */], Object(esm_extends["a" /* default */])({}, Object(external_lodash_["omit"])(notice, ['content']), {
|
6280 |
-
onRemove: removeNotice(notice)
|
6281 |
-
}), notice.content)));
|
6282 |
-
}));
|
6283 |
}
|
6284 |
|
6285 |
-
|
6286 |
-
|
6287 |
-
|
6288 |
-
|
|
|
|
|
6289 |
|
6290 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6291 |
|
|
|
|
|
|
|
6292 |
|
|
|
|
|
|
|
|
|
|
|
6293 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6294 |
|
6295 |
|
|
|
|
|
|
|
|
|
6296 |
|
|
|
|
|
6297 |
|
6298 |
-
|
|
|
|
|
6299 |
|
6300 |
-
|
6301 |
|
6302 |
-
|
6303 |
-
|
6304 |
-
|
6305 |
|
|
|
|
|
|
|
6306 |
|
|
|
|
|
|
|
6307 |
|
|
|
|
|
|
|
6308 |
|
|
|
|
|
6309 |
|
|
|
6310 |
|
6311 |
-
|
6312 |
-
|
6313 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6314 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6315 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6316 |
|
|
|
|
|
6317 |
|
6318 |
-
|
6319 |
-
inherits_default()(TransientNotices, _Component);
|
6320 |
|
6321 |
-
|
|
|
|
|
6322 |
|
6323 |
-
|
6324 |
-
|
|
|
|
|
6325 |
|
6326 |
-
|
|
|
6327 |
}
|
6328 |
|
6329 |
-
|
6330 |
-
key: "render",
|
6331 |
-
value: function render() {
|
6332 |
-
var _this$props = this.props,
|
6333 |
-
className = _this$props.className,
|
6334 |
-
notices = _this$props.notices,
|
6335 |
-
onRemove = _this$props.onRemove;
|
6336 |
-
var classes = classnames_default()('woocommerce-transient-notices', 'components-notices__snackbar', className);
|
6337 |
-
return Object(external_this_wp_element_["createElement"])(list, {
|
6338 |
-
notices: notices,
|
6339 |
-
className: classes,
|
6340 |
-
onRemove: onRemove
|
6341 |
-
});
|
6342 |
-
}
|
6343 |
-
}]);
|
6344 |
|
6345 |
-
|
6346 |
-
|
6347 |
|
6348 |
-
|
6349 |
-
|
6350 |
-
|
6351 |
-
|
6352 |
-
|
|
|
|
|
6353 |
|
6354 |
-
|
6355 |
-
|
6356 |
-
|
6357 |
-
|
6358 |
-
}
|
6359 |
-
|
6360 |
-
|
6361 |
-
|
6362 |
-
|
6363 |
-
|
6364 |
-
|
6365 |
-
|
6366 |
-
|
|
|
6367 |
};
|
6368 |
-
}))(transient_notices_TransientNotices));
|
6369 |
-
// EXTERNAL MODULE: ./client/analytics/report/index.js
|
6370 |
-
var analytics_report = __webpack_require__(197);
|
6371 |
|
6372 |
-
|
|
|
6373 |
|
|
|
6374 |
|
|
|
|
|
|
|
6375 |
|
|
|
|
|
6376 |
|
|
|
|
|
|
|
6377 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6378 |
|
|
|
|
|
6379 |
|
|
|
6380 |
|
|
|
|
|
6381 |
|
|
|
|
|
|
|
6382 |
|
6383 |
-
|
|
|
|
|
|
|
6384 |
|
6385 |
-
|
|
|
|
|
|
|
6386 |
|
6387 |
-
|
|
|
|
|
|
|
|
|
6388 |
|
6389 |
-
|
|
|
6390 |
|
6391 |
-
|
6392 |
-
* External dependencies
|
6393 |
-
*/
|
6394 |
|
6395 |
|
|
|
6396 |
|
|
|
|
|
6397 |
|
|
|
|
|
6398 |
|
|
|
|
|
6399 |
|
6400 |
-
|
6401 |
-
|
6402 |
-
*/
|
6403 |
|
|
|
|
|
6404 |
|
|
|
|
|
6405 |
|
|
|
|
|
6406 |
|
|
|
|
|
6407 |
|
6408 |
-
|
6409 |
-
|
6410 |
-
*/
|
6411 |
|
|
|
|
|
6412 |
|
|
|
|
|
6413 |
|
|
|
6414 |
|
6415 |
|
6416 |
|
6417 |
|
6418 |
-
var StoreAlerts = Object(external_this_wp_element_["lazy"])(function () {
|
6419 |
-
return Promise.all(/* import() | store-alerts */[__webpack_require__.e(4), __webpack_require__.e(43)]).then(__webpack_require__.bind(null, 926));
|
6420 |
-
});
|
6421 |
|
6422 |
-
var layout_PrimaryLayout = /*#__PURE__*/function (_Component) {
|
6423 |
-
inherits_default()(PrimaryLayout, _Component);
|
6424 |
|
6425 |
-
var _super = layout_createSuper(PrimaryLayout);
|
6426 |
|
6427 |
-
|
6428 |
-
classCallCheck_default()(this, PrimaryLayout);
|
6429 |
|
6430 |
-
|
6431 |
-
}
|
6432 |
|
6433 |
-
|
6434 |
-
|
6435 |
-
|
6436 |
-
var children = this.props.children;
|
6437 |
-
return Object(external_this_wp_element_["createElement"])("div", {
|
6438 |
-
className: "woocommerce-layout__primary",
|
6439 |
-
id: "woocommerce-layout__primary"
|
6440 |
-
}, window.wcAdminFeatures['store-alerts'] && Object(external_this_wp_element_["createElement"])(external_this_wp_element_["Suspense"], {
|
6441 |
-
fallback: Object(external_this_wp_element_["createElement"])(external_this_wc_components_["Spinner"], null)
|
6442 |
-
}, Object(external_this_wp_element_["createElement"])(StoreAlerts, null)), Object(external_this_wp_element_["createElement"])(layout_notices, null), children);
|
6443 |
-
}
|
6444 |
-
}]);
|
6445 |
|
6446 |
-
return PrimaryLayout;
|
6447 |
-
}(external_this_wp_element_["Component"]);
|
6448 |
|
6449 |
-
var layout_Layout = /*#__PURE__*/function (_Component2) {
|
6450 |
-
inherits_default()(_Layout, _Component2);
|
6451 |
|
6452 |
-
var _super2 = layout_createSuper(_Layout);
|
6453 |
|
6454 |
-
function _Layout() {
|
6455 |
-
classCallCheck_default()(this, _Layout);
|
6456 |
|
6457 |
-
|
6458 |
-
|
|
|
6459 |
|
6460 |
-
createClass_default()(_Layout, [{
|
6461 |
-
key: "componentDidMount",
|
6462 |
-
value: function componentDidMount() {
|
6463 |
-
this.recordPageViewTrack();
|
6464 |
-
}
|
6465 |
-
}, {
|
6466 |
-
key: "componentDidUpdate",
|
6467 |
-
value: function componentDidUpdate(prevProps) {
|
6468 |
-
var previousPath = Object(external_lodash_["get"])(prevProps, 'location.pathname');
|
6469 |
-
var currentPath = Object(external_lodash_["get"])(this.props, 'location.pathname');
|
6470 |
|
6471 |
-
if (!previousPath || !currentPath) {
|
6472 |
-
return;
|
6473 |
-
}
|
6474 |
|
6475 |
-
|
6476 |
-
|
6477 |
-
|
6478 |
-
}
|
6479 |
-
}, {
|
6480 |
-
key: "recordPageViewTrack",
|
6481 |
-
value: function recordPageViewTrack() {
|
6482 |
-
var _this$props = this.props,
|
6483 |
-
activePlugins = _this$props.activePlugins,
|
6484 |
-
installedPlugins = _this$props.installedPlugins,
|
6485 |
-
isEmbedded = _this$props.isEmbedded,
|
6486 |
-
isJetpackConnected = _this$props.isJetpackConnected;
|
6487 |
|
6488 |
-
if (isEmbedded) {
|
6489 |
-
var _path = document.location.pathname + document.location.search;
|
6490 |
|
6491 |
-
|
6492 |
-
|
6493 |
-
|
6494 |
-
|
6495 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6496 |
|
6497 |
-
|
|
|
|
|
|
|
|
|
6498 |
|
6499 |
-
|
6500 |
-
|
6501 |
-
|
|
|
|
|
|
|
6502 |
|
|
|
|
|
6503 |
|
6504 |
-
|
|
|
|
|
6505 |
|
6506 |
-
|
6507 |
-
|
6508 |
-
|
|
|
|
|
6509 |
|
6510 |
-
|
6511 |
-
|
6512 |
-
|
6513 |
-
|
6514 |
-
|
6515 |
-
|
6516 |
-
|
6517 |
-
|
6518 |
-
value: function render() {
|
6519 |
-
var _this$props2 = this.props,
|
6520 |
-
isEmbedded = _this$props2.isEmbedded,
|
6521 |
-
restProps = objectWithoutProperties_default()(_this$props2, ["isEmbedded"]);
|
6522 |
|
6523 |
-
|
6524 |
-
|
6525 |
-
|
6526 |
-
|
6527 |
-
|
6528 |
-
|
6529 |
-
|
6530 |
-
|
6531 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6532 |
}
|
6533 |
-
}]);
|
6534 |
|
6535 |
-
|
6536 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6537 |
|
6538 |
-
|
6539 |
-
|
6540 |
-
|
6541 |
-
container: prop_types_default.a.oneOfType([prop_types_default.a.func, prop_types_default.a.object // Support React.lazy
|
6542 |
-
]),
|
6543 |
-
path: prop_types_default.a.string,
|
6544 |
-
breadcrumbs: prop_types_default.a.oneOfType([prop_types_default.a.func, prop_types_default.a.arrayOf(prop_types_default.a.oneOfType([prop_types_default.a.arrayOf(prop_types_default.a.string), prop_types_default.a.string]))]).isRequired,
|
6545 |
-
wpOpenMenu: prop_types_default.a.string
|
6546 |
-
}).isRequired
|
6547 |
-
};
|
6548 |
-
var Layout = Object(compose["a" /* default */])(Object(external_this_wc_data_["withPluginsHydration"])(_objectSpread(_objectSpread({}, window.wcSettings.plugins || {}), {}, {
|
6549 |
-
jetpackStatus: window.wcSettings.dataEndpoints && window.wcSettings.dataEndpoints.jetpackStatus || false
|
6550 |
-
})), Object(external_this_wp_data_["withSelect"])(function (select, _ref) {
|
6551 |
-
var isEmbedded = _ref.isEmbedded;
|
6552 |
|
6553 |
-
|
6554 |
-
|
6555 |
-
|
|
|
6556 |
}
|
6557 |
|
6558 |
-
|
6559 |
-
|
6560 |
-
|
6561 |
-
|
|
|
|
|
|
|
|
|
6562 |
|
6563 |
-
|
6564 |
-
|
6565 |
-
|
6566 |
-
|
6567 |
-
|
6568 |
-
})
|
|
|
6569 |
|
6570 |
-
|
6571 |
-
|
|
|
|
|
6572 |
|
6573 |
-
var
|
6574 |
|
6575 |
-
function
|
6576 |
-
classCallCheck_default()(this,
|
6577 |
|
6578 |
-
return
|
6579 |
}
|
6580 |
|
6581 |
-
createClass_default()(
|
6582 |
-
key: "
|
6583 |
-
value: function
|
6584 |
-
|
6585 |
-
history: Object(external_this_wc_navigation_["getHistory"])()
|
6586 |
-
}, Object(external_this_wp_element_["createElement"])(react_router_Switch, null, controller_getPages().map(function (page) {
|
6587 |
-
return Object(external_this_wp_element_["createElement"])(react_router_Route, {
|
6588 |
-
key: page.path,
|
6589 |
-
path: page.path,
|
6590 |
-
exact: true,
|
6591 |
-
render: function render(props) {
|
6592 |
-
return Object(external_this_wp_element_["createElement"])(Layout, extends_default()({
|
6593 |
-
page: page
|
6594 |
-
}, props));
|
6595 |
-
}
|
6596 |
-
});
|
6597 |
-
})));
|
6598 |
}
|
6599 |
-
}
|
6600 |
-
|
6601 |
-
|
6602 |
-
|
6603 |
-
|
6604 |
-
var PageLayout = Object(compose["a" /* default */])( // Use the useFilters HoC so PageLayout is re-rendered when filters are used to add new pages or reports
|
6605 |
-
Object(external_this_wc_components_["useFilters"])([PAGES_FILTER, analytics_report["REPORTS_FILTER"]]), window.wcSettings.preloadOptions ? Object(external_this_wc_data_["withOptionsHydration"])(_objectSpread({}, window.wcSettings.preloadOptions)) : external_lodash_["identity"])(layout_PageLayout);
|
6606 |
-
var layout_EmbedLayout = /*#__PURE__*/function (_Component4) {
|
6607 |
-
inherits_default()(EmbedLayout, _Component4);
|
6608 |
-
|
6609 |
-
var _super4 = layout_createSuper(EmbedLayout);
|
6610 |
-
|
6611 |
-
function EmbedLayout() {
|
6612 |
-
classCallCheck_default()(this, EmbedLayout);
|
6613 |
|
6614 |
-
|
6615 |
-
|
|
|
|
|
|
|
6616 |
|
6617 |
-
|
|
|
|
|
|
|
|
|
6618 |
key: "render",
|
6619 |
value: function render() {
|
6620 |
-
|
6621 |
-
|
6622 |
-
|
6623 |
-
|
6624 |
-
|
6625 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6626 |
}
|
6627 |
}]);
|
6628 |
|
6629 |
-
return
|
6630 |
}(external_this_wp_element_["Component"]);
|
6631 |
-
|
6632 |
-
/***/ }),
|
6633 |
-
|
6634 |
-
/***/ 2:
|
6635 |
-
/***/ (function(module, exports) {
|
6636 |
-
|
6637 |
-
(function() { module.exports = this["lodash"]; }());
|
6638 |
-
|
6639 |
-
/***/ }),
|
6640 |
-
|
6641 |
-
/***/ 200:
|
6642 |
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
6643 |
-
|
6644 |
-
"use strict";
|
6645 |
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return getFilteredCurrencyInstance; });
|
6646 |
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return CurrencyContext; });
|
6647 |
-
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0);
|
6648 |
-
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
|
6649 |
-
/* harmony import */ var _wordpress_hooks__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(48);
|
6650 |
-
/* harmony import */ var _wordpress_hooks__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_hooks__WEBPACK_IMPORTED_MODULE_1__);
|
6651 |
-
/* harmony import */ var _woocommerce_currency__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(111);
|
6652 |
-
/* harmony import */ var _woocommerce_currency__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_woocommerce_currency__WEBPACK_IMPORTED_MODULE_2__);
|
6653 |
-
/* harmony import */ var _woocommerce_wc_admin_settings__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(23);
|
6654 |
/**
|
6655 |
-
*
|
|
|
|
|
|
|
|
|
|
|
6656 |
*/
|
6657 |
|
|
|
|
|
6658 |
|
6659 |
-
|
6660 |
-
|
6661 |
-
|
6662 |
-
|
|
|
|
|
|
|
|
|
6663 |
|
6664 |
-
|
6665 |
-
* Internal dependencies
|
6666 |
-
*/
|
6667 |
|
|
|
|
|
|
|
|
|
|
|
|
|
6668 |
|
6669 |
-
|
6670 |
-
var
|
6671 |
-
var
|
6672 |
-
|
6673 |
-
|
6674 |
-
};
|
6675 |
-
|
6676 |
-
);
|
6677 |
|
6678 |
-
/***/ }),
|
6679 |
|
6680 |
-
|
6681 |
-
|
6682 |
-
|
6683 |
-
|
6684 |
-
|
6685 |
-
|
6686 |
-
|
6687 |
-
|
6688 |
-
|
6689 |
-
|
6690 |
-
|
6691 |
-
|
6692 |
-
|
6693 |
-
|
6694 |
-
|
6695 |
-
|
6696 |
-
|
|
|
6697 |
|
6698 |
-
|
6699 |
-
|
6700 |
-
*/
|
6701 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6702 |
|
6703 |
-
|
6704 |
-
|
6705 |
-
|
|
|
|
|
|
|
6706 |
|
6707 |
-
|
6708 |
-
|
6709 |
-
|
6710 |
-
* @see _breakpoints.scss
|
6711 |
-
*
|
6712 |
-
* @type {Object<WPBreakpoint,number>}
|
6713 |
-
*/
|
6714 |
|
6715 |
-
|
6716 |
-
|
6717 |
-
wide: 1280,
|
6718 |
-
large: 960,
|
6719 |
-
medium: 782,
|
6720 |
-
small: 600,
|
6721 |
-
mobile: 480
|
6722 |
-
};
|
6723 |
-
/**
|
6724 |
-
* @typedef {">="|"<"} WPViewportOperator
|
6725 |
-
*/
|
6726 |
|
6727 |
-
|
6728 |
-
|
6729 |
-
*
|
6730 |
-
* @type {Object<WPViewportOperator,string>}
|
6731 |
-
*/
|
6732 |
|
6733 |
-
|
6734 |
-
|
6735 |
-
|
6736 |
-
};
|
6737 |
-
/**
|
6738 |
-
* Object mapping media query operators to a function that given a breakpointValue and a width evaluates if the operator matches the values.
|
6739 |
-
*
|
6740 |
-
* @type {Object<WPViewportOperator,Function>}
|
6741 |
-
*/
|
6742 |
|
6743 |
-
|
6744 |
-
|
6745 |
-
return width >= breakpointValue;
|
6746 |
-
},
|
6747 |
-
'<': function _(breakpointValue, width) {
|
6748 |
-
return width < breakpointValue;
|
6749 |
-
}
|
6750 |
-
};
|
6751 |
-
var ViewportMatchWidthContext = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createContext"])(null);
|
6752 |
-
/**
|
6753 |
-
* Returns true if the viewport matches the given query, or false otherwise.
|
6754 |
-
*
|
6755 |
-
* @param {WPBreakpoint} breakpoint Breakpoint size name.
|
6756 |
-
* @param {WPViewportOperator} [operator=">="] Viewport operator.
|
6757 |
-
*
|
6758 |
-
* @example
|
6759 |
-
*
|
6760 |
-
* ```js
|
6761 |
-
* useViewportMatch( 'huge', '<' );
|
6762 |
-
* useViewportMatch( 'medium' );
|
6763 |
-
* ```
|
6764 |
-
*
|
6765 |
-
* @return {boolean} Whether viewport matches query.
|
6766 |
-
*/
|
6767 |
|
6768 |
-
|
6769 |
-
|
6770 |
-
var simulatedWidth = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["useContext"])(ViewportMatchWidthContext);
|
6771 |
-
var mediaQuery = !simulatedWidth && "(".concat(CONDITIONS[operator], ": ").concat(BREAKPOINTS[breakpoint], "px)");
|
6772 |
-
var mediaQueryResult = Object(_use_media_query__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"])(mediaQuery);
|
6773 |
|
6774 |
-
|
6775 |
-
|
6776 |
-
|
6777 |
|
6778 |
-
|
6779 |
-
|
|
|
6780 |
|
6781 |
-
|
6782 |
-
|
6783 |
-
//# sourceMappingURL=index.js.map
|
6784 |
|
6785 |
-
|
|
|
6786 |
|
6787 |
-
|
6788 |
-
|
6789 |
|
6790 |
-
|
6791 |
-
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0);
|
6792 |
-
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
|
6793 |
-
/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(32);
|
6794 |
|
6795 |
|
6796 |
/**
|
6797 |
-
*
|
6798 |
*/
|
6799 |
|
6800 |
-
var close = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__[/* SVG */ "b"], {
|
6801 |
-
xmlns: "http://www.w3.org/2000/svg",
|
6802 |
-
viewBox: "0 0 24 24"
|
6803 |
-
}, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__[/* Path */ "a"], {
|
6804 |
-
d: "M13 11.8l6.1-6.3-1-1-6.1 6.2-6.1-6.2-1 1 6.1 6.3-6.5 6.7 1 1 6.5-6.6 6.5 6.6 1-1z"
|
6805 |
-
}));
|
6806 |
-
/* harmony default export */ __webpack_exports__["a"] = (close);
|
6807 |
-
//# sourceMappingURL=close.js.map
|
6808 |
|
6809 |
-
/***/ }),
|
6810 |
|
6811 |
-
|
6812 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6813 |
|
6814 |
-
(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6815 |
|
6816 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6817 |
|
6818 |
-
|
6819 |
-
|
6820 |
|
6821 |
-
|
6822 |
-
|
6823 |
-
|
6824 |
-
|
6825 |
-
|
6826 |
-
*
|
6827 |
-
* This source code is licensed under the MIT license found in the
|
6828 |
-
* LICENSE file in the root directory of this source tree.
|
6829 |
*/
|
6830 |
|
6831 |
-
|
6832 |
-
|
6833 |
-
|
6834 |
-
exports.Profiler=g;exports.StrictMode=f;exports.Suspense=p;exports.isAsyncMode=function(a){return A(a)||z(a)===l};exports.isConcurrentMode=A;exports.isContextConsumer=function(a){return z(a)===k};exports.isContextProvider=function(a){return z(a)===h};exports.isElement=function(a){return"object"===typeof a&&null!==a&&a.$$typeof===c};exports.isForwardRef=function(a){return z(a)===n};exports.isFragment=function(a){return z(a)===e};exports.isLazy=function(a){return z(a)===t};
|
6835 |
-
exports.isMemo=function(a){return z(a)===r};exports.isPortal=function(a){return z(a)===d};exports.isProfiler=function(a){return z(a)===g};exports.isStrictMode=function(a){return z(a)===f};exports.isSuspense=function(a){return z(a)===p};
|
6836 |
-
exports.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)};exports.typeOf=z;
|
6837 |
|
6838 |
|
6839 |
-
/***/ }),
|
6840 |
|
6841 |
-
/***/ 211:
|
6842 |
-
/***/ (function(module, exports, __webpack_require__) {
|
6843 |
|
6844 |
-
var arrayLikeToArray = __webpack_require__(152);
|
6845 |
|
6846 |
-
function
|
6847 |
-
|
6848 |
-
|
|
|
|
|
6849 |
|
6850 |
-
|
|
|
6851 |
|
6852 |
-
|
|
|
6853 |
|
6854 |
-
|
6855 |
-
|
|
|
|
|
6856 |
|
6857 |
-
function _iterableToArray(iter) {
|
6858 |
-
if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter);
|
6859 |
-
}
|
6860 |
|
6861 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6862 |
|
6863 |
-
|
|
|
|
|
6864 |
|
6865 |
-
|
6866 |
-
|
|
|
6867 |
|
6868 |
-
|
6869 |
-
|
6870 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
6871 |
|
6872 |
-
|
|
|
6873 |
|
6874 |
-
|
|
|
|
|
6875 |
|
6876 |
-
|
6877 |
-
|
|
|
6878 |
|
6879 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6880 |
|
6881 |
-
|
|
|
|
|
6882 |
|
6883 |
-
|
6884 |
-
|
|
|
6885 |
|
6886 |
-
|
6887 |
-
|
6888 |
-
|
6889 |
-
|
6890 |
-
|
6891 |
-
|
6892 |
-
|
6893 |
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return WC_ASSET_URL; });
|
6894 |
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "g", function() { return getSetting; });
|
6895 |
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "h", function() { return setSetting; });
|
6896 |
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return getAdminLink; });
|
6897 |
-
/* harmony import */ var _babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(35);
|
6898 |
-
/* harmony import */ var _babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_0__);
|
6899 |
-
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(3);
|
6900 |
-
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__);
|
6901 |
|
|
|
6902 |
|
6903 |
-
|
6904 |
-
|
6905 |
-
|
6906 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6907 |
|
6908 |
-
|
6909 |
-
|
6910 |
-
|
6911 |
-
if (!mutableSources.includes(key)) {
|
6912 |
-
source[key] = settings[key];
|
6913 |
}
|
6914 |
|
6915 |
-
return
|
6916 |
-
}
|
6917 |
-
|
6918 |
-
|
6919 |
-
|
6920 |
-
|
6921 |
-
var
|
6922 |
-
var SITE_TITLE = SOURCE.siteTitle;
|
6923 |
-
var WC_ASSET_URL = SOURCE.wcAssetUrl;
|
6924 |
-
/**
|
6925 |
-
* Retrieves a setting value from the setting state.
|
6926 |
-
*
|
6927 |
-
* @export
|
6928 |
-
* @param {string} name The identifier for the setting.
|
6929 |
-
* @param {*} [fallback=false] The value to use as a fallback
|
6930 |
-
* if the setting is not in the
|
6931 |
-
* state.
|
6932 |
-
* @param {Function} [filter=( val ) => val] A callback for filtering the
|
6933 |
-
* value before it's returned.
|
6934 |
-
* Receives both the found value
|
6935 |
-
* (if it exists for the key) and
|
6936 |
-
* the provided fallback arg.
|
6937 |
-
*
|
6938 |
-
* @return {*} The value present in the settings state for the given
|
6939 |
-
* name.
|
6940 |
-
*/
|
6941 |
|
6942 |
-
|
6943 |
-
|
6944 |
-
var filter = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : function (val) {
|
6945 |
-
return val;
|
6946 |
-
};
|
6947 |
|
6948 |
-
|
6949 |
-
|
6950 |
-
}
|
6951 |
|
6952 |
-
|
6953 |
-
return filter(value, fallback);
|
6954 |
-
}
|
6955 |
-
/**
|
6956 |
-
* Sets a value to a property on the settings state.
|
6957 |
-
*
|
6958 |
-
* NOTE: This feature is to be removed in favour of data stores when a full migration
|
6959 |
-
* is complete.
|
6960 |
-
*
|
6961 |
-
* @deprecated
|
6962 |
-
*
|
6963 |
-
* @export
|
6964 |
-
* @param {string} name The setting property key for the
|
6965 |
-
* setting being mutated.
|
6966 |
-
* @param {*} value The value to set.
|
6967 |
-
* @param {Function} [filter=( val ) => val] Allows for providing a callback
|
6968 |
-
* to sanitize the setting (eg.
|
6969 |
-
* ensure it's a number)
|
6970 |
-
*/
|
6971 |
|
6972 |
-
function setSetting(name, value) {
|
6973 |
-
var filter = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : function (val) {
|
6974 |
-
return val;
|
6975 |
-
};
|
6976 |
|
6977 |
-
if (mutableSources.includes(name)) {
|
6978 |
-
throw new Error(Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__["__"])('Mutable settings should be mutated via data store.'));
|
6979 |
-
}
|
6980 |
|
6981 |
-
|
6982 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6983 |
/**
|
6984 |
-
*
|
6985 |
-
*
|
6986 |
-
* @param {string} path Relative path.
|
6987 |
-
* @return {string} Full admin URL.
|
6988 |
*/
|
6989 |
|
6990 |
-
function getAdminLink(path) {
|
6991 |
-
return (ADMIN_URL || '') + path;
|
6992 |
-
}
|
6993 |
|
6994 |
-
/***/ }),
|
6995 |
|
6996 |
-
/***/ 24:
|
6997 |
-
/***/ (function(module, exports) {
|
6998 |
|
6999 |
-
(function() { module.exports = this["wc"]["date"]; }());
|
7000 |
|
7001 |
-
/***/ }),
|
7002 |
|
7003 |
-
/***/ 257:
|
7004 |
-
/***/ (function(module, exports, __webpack_require__) {
|
7005 |
|
7006 |
-
"use strict";
|
7007 |
|
7008 |
|
7009 |
-
Object.defineProperty(exports, '__esModule', { value: true });
|
7010 |
|
7011 |
-
|
|
|
|
|
7012 |
|
7013 |
-
var _extends = _interopDefault(__webpack_require__(80));
|
7014 |
-
var _objectWithoutPropertiesLoose = _interopDefault(__webpack_require__(273));
|
7015 |
-
var React = __webpack_require__(13);
|
7016 |
-
var React__default = _interopDefault(React);
|
7017 |
-
var _inheritsLoose = _interopDefault(__webpack_require__(126));
|
7018 |
-
var _assertThisInitialized = _interopDefault(__webpack_require__(62));
|
7019 |
|
7020 |
-
var is = {
|
7021 |
-
arr: Array.isArray,
|
7022 |
-
obj: function obj(a) {
|
7023 |
-
return Object.prototype.toString.call(a) === '[object Object]';
|
7024 |
-
},
|
7025 |
-
fun: function fun(a) {
|
7026 |
-
return typeof a === 'function';
|
7027 |
-
},
|
7028 |
-
str: function str(a) {
|
7029 |
-
return typeof a === 'string';
|
7030 |
-
},
|
7031 |
-
num: function num(a) {
|
7032 |
-
return typeof a === 'number';
|
7033 |
-
},
|
7034 |
-
und: function und(a) {
|
7035 |
-
return a === void 0;
|
7036 |
-
},
|
7037 |
-
nul: function nul(a) {
|
7038 |
-
return a === null;
|
7039 |
-
},
|
7040 |
-
set: function set(a) {
|
7041 |
-
return a instanceof Set;
|
7042 |
-
},
|
7043 |
-
map: function map(a) {
|
7044 |
-
return a instanceof Map;
|
7045 |
-
},
|
7046 |
-
equ: function equ(a, b) {
|
7047 |
-
if (typeof a !== typeof b) return false;
|
7048 |
-
if (is.str(a) || is.num(a)) return a === b;
|
7049 |
-
if (is.obj(a) && is.obj(b) && Object.keys(a).length + Object.keys(b).length === 0) return true;
|
7050 |
-
var i;
|
7051 |
|
7052 |
-
for (i in a) {
|
7053 |
-
if (!(i in b)) return false;
|
7054 |
-
}
|
7055 |
|
7056 |
-
for (i in b) {
|
7057 |
-
if (a[i] !== b[i]) return false;
|
7058 |
-
}
|
7059 |
|
7060 |
-
|
7061 |
-
|
7062 |
-
|
7063 |
-
function merge(target, lowercase) {
|
7064 |
-
if (lowercase === void 0) {
|
7065 |
-
lowercase = true;
|
7066 |
-
}
|
7067 |
|
7068 |
-
return function (object) {
|
7069 |
-
return (is.arr(object) ? object : Object.keys(object)).reduce(function (acc, element) {
|
7070 |
-
var key = lowercase ? element[0].toLowerCase() + element.substring(1) : element;
|
7071 |
-
acc[key] = target(key);
|
7072 |
-
return acc;
|
7073 |
-
}, target);
|
7074 |
-
};
|
7075 |
-
}
|
7076 |
-
function useForceUpdate() {
|
7077 |
-
var _useState = React.useState(false),
|
7078 |
-
f = _useState[1];
|
7079 |
|
7080 |
-
var forceUpdate = React.useCallback(function () {
|
7081 |
-
return f(function (v) {
|
7082 |
-
return !v;
|
7083 |
-
});
|
7084 |
-
}, []);
|
7085 |
-
return forceUpdate;
|
7086 |
-
}
|
7087 |
-
function withDefault(value, defaultValue) {
|
7088 |
-
return is.und(value) || is.nul(value) ? defaultValue : value;
|
7089 |
-
}
|
7090 |
-
function toArray(a) {
|
7091 |
-
return !is.und(a) ? is.arr(a) ? a : [a] : [];
|
7092 |
-
}
|
7093 |
-
function callProp(obj) {
|
7094 |
-
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
7095 |
-
args[_key - 1] = arguments[_key];
|
7096 |
-
}
|
7097 |
|
7098 |
-
return is.fun(obj) ? obj.apply(void 0, args) : obj;
|
7099 |
-
}
|
7100 |
|
7101 |
-
function getForwardProps(props) {
|
7102 |
-
var to = props.to,
|
7103 |
-
from = props.from,
|
7104 |
-
config = props.config,
|
7105 |
-
onStart = props.onStart,
|
7106 |
-
onRest = props.onRest,
|
7107 |
-
onFrame = props.onFrame,
|
7108 |
-
children = props.children,
|
7109 |
-
reset = props.reset,
|
7110 |
-
reverse = props.reverse,
|
7111 |
-
force = props.force,
|
7112 |
-
immediate = props.immediate,
|
7113 |
-
delay = props.delay,
|
7114 |
-
attach = props.attach,
|
7115 |
-
destroyed = props.destroyed,
|
7116 |
-
interpolateTo = props.interpolateTo,
|
7117 |
-
ref = props.ref,
|
7118 |
-
lazy = props.lazy,
|
7119 |
-
forward = _objectWithoutPropertiesLoose(props, ["to", "from", "config", "onStart", "onRest", "onFrame", "children", "reset", "reverse", "force", "immediate", "delay", "attach", "destroyed", "interpolateTo", "ref", "lazy"]);
|
7120 |
-
|
7121 |
-
return forward;
|
7122 |
-
}
|
7123 |
-
|
7124 |
-
function interpolateTo(props) {
|
7125 |
-
var forward = getForwardProps(props);
|
7126 |
-
if (is.und(forward)) return _extends({
|
7127 |
-
to: forward
|
7128 |
-
}, props);
|
7129 |
-
var rest = Object.keys(props).reduce(function (a, k) {
|
7130 |
-
var _extends2;
|
7131 |
-
|
7132 |
-
return !is.und(forward[k]) ? a : _extends({}, a, (_extends2 = {}, _extends2[k] = props[k], _extends2));
|
7133 |
-
}, {});
|
7134 |
-
return _extends({
|
7135 |
-
to: forward
|
7136 |
-
}, rest);
|
7137 |
-
}
|
7138 |
-
function handleRef(ref, forward) {
|
7139 |
-
if (forward) {
|
7140 |
-
// If it's a function, assume it's a ref callback
|
7141 |
-
if (is.fun(forward)) forward(ref);else if (is.obj(forward)) {
|
7142 |
-
forward.current = ref;
|
7143 |
-
}
|
7144 |
-
}
|
7145 |
-
|
7146 |
-
return ref;
|
7147 |
-
}
|
7148 |
-
|
7149 |
-
var Animated =
|
7150 |
-
/*#__PURE__*/
|
7151 |
-
function () {
|
7152 |
-
function Animated() {
|
7153 |
-
this.payload = void 0;
|
7154 |
-
this.children = [];
|
7155 |
-
}
|
7156 |
|
7157 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7158 |
|
7159 |
-
_proto.getAnimatedValue = function getAnimatedValue() {
|
7160 |
-
return this.getValue();
|
7161 |
-
};
|
7162 |
|
7163 |
-
|
7164 |
-
|
7165 |
-
|
|
|
7166 |
|
7167 |
-
|
7168 |
|
7169 |
-
|
|
|
7170 |
|
7171 |
-
|
7172 |
-
return this.children;
|
7173 |
-
};
|
7174 |
|
7175 |
-
|
7176 |
-
|
7177 |
-
|
7178 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7179 |
|
7180 |
-
|
7181 |
-
|
7182 |
-
|
7183 |
-
|
7184 |
-
|
|
|
7185 |
|
7186 |
-
|
7187 |
-
|
7188 |
-
|
7189 |
-
|
7190 |
-
|
7191 |
-
_inheritsLoose(AnimatedArray, _Animated);
|
7192 |
|
7193 |
-
|
7194 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
7195 |
|
7196 |
-
|
7197 |
-
|
|
|
|
|
|
|
7198 |
}
|
7199 |
-
|
7200 |
-
|
7201 |
-
|
7202 |
-
|
7203 |
-
|
7204 |
-
|
7205 |
-
|
|
|
|
|
|
|
7206 |
});
|
7207 |
-
}
|
7208 |
|
7209 |
-
|
7210 |
-
|
7211 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7212 |
});
|
7213 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7214 |
|
7215 |
-
|
7216 |
-
|
|
|
|
|
7217 |
|
7218 |
-
|
7219 |
-
|
7220 |
-
|
7221 |
-
|
7222 |
-
|
7223 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7224 |
|
7225 |
-
|
7226 |
-
|
7227 |
|
7228 |
-
|
7229 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7230 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
7231 |
|
7232 |
-
|
7233 |
-
|
|
|
|
|
|
|
7234 |
|
7235 |
-
|
7236 |
-
|
7237 |
-
return s instanceof Animated && s.addChild(_assertThisInitialized(_this2));
|
7238 |
-
});
|
7239 |
-
};
|
7240 |
|
7241 |
-
|
7242 |
-
|
7243 |
-
|
7244 |
-
|
7245 |
-
|
7246 |
|
7247 |
-
|
7248 |
-
|
|
|
|
|
|
|
|
|
7249 |
|
7250 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7251 |
|
7252 |
-
|
7253 |
-
|
7254 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7255 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7256 |
|
7257 |
-
|
|
|
|
|
7258 |
|
7259 |
-
|
7260 |
-
|
7261 |
-
|
7262 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7263 |
}
|
|
|
7264 |
|
7265 |
-
|
7266 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7267 |
|
7268 |
-
|
7269 |
-
|
7270 |
-
|
7271 |
|
7272 |
-
|
7273 |
-
}(Animated);
|
7274 |
|
7275 |
-
|
7276 |
-
|
7277 |
-
|
7278 |
-
|
7279 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7280 |
};
|
7281 |
-
}
|
7282 |
-
|
7283 |
-
|
7284 |
-
|
7285 |
-
|
7286 |
-
|
7287 |
-
return typeof window !== 'undefined' ? window.requestAnimationFrame(cb) : -1;
|
7288 |
-
};
|
7289 |
-
var cancelFrame = function cancelFrame(id) {
|
7290 |
-
typeof window !== 'undefined' && window.cancelAnimationFrame(id);
|
7291 |
-
};
|
7292 |
-
function injectFrame(raf, caf) {
|
7293 |
-
requestFrame = raf;
|
7294 |
-
cancelFrame = caf;
|
7295 |
-
}
|
7296 |
-
var interpolation;
|
7297 |
-
function injectStringInterpolator(fn) {
|
7298 |
-
interpolation = fn;
|
7299 |
-
}
|
7300 |
-
var now = function now() {
|
7301 |
-
return Date.now();
|
7302 |
-
};
|
7303 |
-
function injectNow(nowFn) {
|
7304 |
-
now = nowFn;
|
7305 |
-
}
|
7306 |
-
var defaultElement;
|
7307 |
-
function injectDefaultElement(el) {
|
7308 |
-
defaultElement = el;
|
7309 |
-
}
|
7310 |
-
var animatedApi = function animatedApi(node) {
|
7311 |
-
return node.current;
|
7312 |
-
};
|
7313 |
-
function injectAnimatedApi(fn) {
|
7314 |
-
animatedApi = fn;
|
7315 |
-
}
|
7316 |
-
var createAnimatedStyle;
|
7317 |
-
function injectCreateAnimatedStyle(factory) {
|
7318 |
-
createAnimatedStyle = factory;
|
7319 |
-
}
|
7320 |
-
var manualFrameloop;
|
7321 |
-
function injectManualFrameloop(callback) {
|
7322 |
-
manualFrameloop = callback;
|
7323 |
-
}
|
7324 |
|
7325 |
-
|
7326 |
-
|
7327 |
-
|
7328 |
-
|
7329 |
-
|
7330 |
-
|
7331 |
-
get cancelFrame () { return cancelFrame; },
|
7332 |
-
injectFrame: injectFrame,
|
7333 |
-
get interpolation () { return interpolation; },
|
7334 |
-
injectStringInterpolator: injectStringInterpolator,
|
7335 |
-
get now () { return now; },
|
7336 |
-
injectNow: injectNow,
|
7337 |
-
get defaultElement () { return defaultElement; },
|
7338 |
-
injectDefaultElement: injectDefaultElement,
|
7339 |
-
get animatedApi () { return animatedApi; },
|
7340 |
-
injectAnimatedApi: injectAnimatedApi,
|
7341 |
-
get createAnimatedStyle () { return createAnimatedStyle; },
|
7342 |
-
injectCreateAnimatedStyle: injectCreateAnimatedStyle,
|
7343 |
-
get manualFrameloop () { return manualFrameloop; },
|
7344 |
-
injectManualFrameloop: injectManualFrameloop
|
7345 |
-
});
|
7346 |
|
7347 |
/**
|
7348 |
-
*
|
7349 |
*/
|
7350 |
|
7351 |
-
var AnimatedProps =
|
7352 |
-
/*#__PURE__*/
|
7353 |
-
function (_AnimatedObject) {
|
7354 |
-
_inheritsLoose(AnimatedProps, _AnimatedObject);
|
7355 |
|
7356 |
-
function AnimatedProps(props, callback) {
|
7357 |
-
var _this;
|
7358 |
|
7359 |
-
_this = _AnimatedObject.call(this) || this;
|
7360 |
-
_this.update = void 0;
|
7361 |
-
_this.payload = !props.style ? props : _extends({}, props, {
|
7362 |
-
style: createAnimatedStyle(props.style)
|
7363 |
-
});
|
7364 |
-
_this.update = callback;
|
7365 |
|
7366 |
-
_this.attach();
|
7367 |
|
7368 |
-
|
7369 |
-
|
|
|
7370 |
|
7371 |
-
return AnimatedProps;
|
7372 |
-
}(AnimatedObject);
|
7373 |
|
7374 |
-
var isFunctionComponent = function isFunctionComponent(val) {
|
7375 |
-
return is.fun(val) && !(val.prototype instanceof React__default.Component);
|
7376 |
-
};
|
7377 |
|
7378 |
-
var createAnimatedComponent = function createAnimatedComponent(Component) {
|
7379 |
-
var AnimatedComponent = React.forwardRef(function (props, ref) {
|
7380 |
-
var forceUpdate = useForceUpdate();
|
7381 |
-
var mounted = React.useRef(true);
|
7382 |
-
var propsAnimated = React.useRef(null);
|
7383 |
-
var node = React.useRef(null);
|
7384 |
-
var attachProps = React.useCallback(function (props) {
|
7385 |
-
var oldPropsAnimated = propsAnimated.current;
|
7386 |
|
7387 |
-
|
7388 |
-
|
|
|
7389 |
|
7390 |
-
if (node.current) {
|
7391 |
-
didUpdate = applyAnimatedValues.fn(node.current, propsAnimated.current.getAnimatedValue());
|
7392 |
-
}
|
7393 |
|
7394 |
-
if (!node.current || didUpdate === false) {
|
7395 |
-
// If no referenced node has been found, or the update target didn't have a
|
7396 |
-
// native-responder, then forceUpdate the animation ...
|
7397 |
-
forceUpdate();
|
7398 |
-
}
|
7399 |
-
};
|
7400 |
|
7401 |
-
propsAnimated.current = new AnimatedProps(props, callback);
|
7402 |
-
oldPropsAnimated && oldPropsAnimated.detach();
|
7403 |
-
}, []);
|
7404 |
-
React.useEffect(function () {
|
7405 |
-
return function () {
|
7406 |
-
mounted.current = false;
|
7407 |
-
propsAnimated.current && propsAnimated.current.detach();
|
7408 |
-
};
|
7409 |
-
}, []);
|
7410 |
-
React.useImperativeHandle(ref, function () {
|
7411 |
-
return animatedApi(node, mounted, forceUpdate);
|
7412 |
-
});
|
7413 |
-
attachProps(props);
|
7414 |
|
7415 |
-
var _getValue = propsAnimated.current.getValue(),
|
7416 |
-
scrollTop = _getValue.scrollTop,
|
7417 |
-
scrollLeft = _getValue.scrollLeft,
|
7418 |
-
animatedProps = _objectWithoutPropertiesLoose(_getValue, ["scrollTop", "scrollLeft"]); // Functions cannot have refs, see:
|
7419 |
-
// See: https://github.com/react-spring/react-spring/issues/569
|
7420 |
|
|
|
|
|
7421 |
|
7422 |
-
|
7423 |
-
return node.current = handleRef(childRef, ref);
|
7424 |
-
};
|
7425 |
-
return React__default.createElement(Component, _extends({}, animatedProps, {
|
7426 |
-
ref: refFn
|
7427 |
-
}));
|
7428 |
-
});
|
7429 |
-
return AnimatedComponent;
|
7430 |
-
};
|
7431 |
|
7432 |
-
|
7433 |
-
var
|
7434 |
|
7435 |
-
|
7436 |
-
if (!active) return false;
|
7437 |
-
var time = now();
|
7438 |
|
7439 |
-
|
7440 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7441 |
|
7442 |
-
|
7443 |
-
|
7444 |
-
|
7445 |
-
|
7446 |
-
|
7447 |
-
|
7448 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7449 |
}
|
|
|
|
|
|
|
|
|
7450 |
|
7451 |
-
|
7452 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7453 |
|
7454 |
-
|
7455 |
-
|
7456 |
-
|
7457 |
-
lastTime = void 0;
|
7458 |
|
7459 |
-
|
7460 |
-
var animation = config.animatedValues[valIdx]; // If an animation is done, skip, until all of them conclude
|
7461 |
|
7462 |
-
|
7463 |
-
|
7464 |
-
|
7465 |
-
var position = animation.lastPosition;
|
7466 |
-
var isAnimated = to instanceof Animated;
|
7467 |
-
var velocity = Array.isArray(config.initialVelocity) ? config.initialVelocity[valIdx] : config.initialVelocity;
|
7468 |
-
if (isAnimated) to = to.getValue(); // Conclude animation if it's either immediate, or from-values match end-state
|
7469 |
|
7470 |
-
|
7471 |
-
|
7472 |
-
|
7473 |
-
|
7474 |
-
|
|
|
7475 |
|
|
|
|
|
|
|
|
|
|
|
7476 |
|
7477 |
-
|
7478 |
-
animation.setValue(to);
|
7479 |
-
animation.done = true;
|
7480 |
-
continue;
|
7481 |
-
}
|
7482 |
|
7483 |
-
|
7484 |
-
|
7485 |
-
|
7486 |
-
|
7487 |
-
|
7488 |
-
|
7489 |
-
|
7490 |
-
|
7491 |
-
|
7492 |
-
|
7493 |
-
|
7494 |
-
|
7495 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7496 |
|
7497 |
-
|
|
|
7498 |
|
7499 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7500 |
|
7501 |
-
for (var i = 0; i < numSteps; ++i) {
|
7502 |
-
var force = -config.tension * (position - to);
|
7503 |
-
var damping = -config.friction * velocity;
|
7504 |
-
var acceleration = (force + damping) / config.mass;
|
7505 |
-
velocity = velocity + acceleration * 1 / 1000;
|
7506 |
-
position = position + velocity * 1 / 1000;
|
7507 |
-
} // Conditions for stopping the spring animation
|
7508 |
|
7509 |
|
7510 |
-
var isOvershooting = config.clamp && config.tension !== 0 ? from < to ? position > to : position < to : false;
|
7511 |
-
var isVelocity = Math.abs(velocity) <= config.precision;
|
7512 |
-
var isDisplacement = config.tension !== 0 ? Math.abs(to - position) <= config.precision : true;
|
7513 |
-
endOfAnimation = isOvershooting || isVelocity && isDisplacement;
|
7514 |
-
animation.lastVelocity = velocity;
|
7515 |
-
animation.lastTime = time;
|
7516 |
-
} // Trails aren't done until their parents conclude
|
7517 |
|
7518 |
|
7519 |
-
if (isAnimated && !config.toValues[valIdx].done) endOfAnimation = false;
|
7520 |
|
7521 |
-
if (endOfAnimation) {
|
7522 |
-
// Ensure that we end up with a round value
|
7523 |
-
if (animation.value !== to) position = to;
|
7524 |
-
animation.done = true;
|
7525 |
-
} else isActive = true;
|
7526 |
|
7527 |
-
|
7528 |
-
animation.lastPosition = position;
|
7529 |
-
} // Keep track of updated values only when necessary
|
7530 |
|
|
|
7531 |
|
7532 |
-
|
7533 |
-
|
|
|
7534 |
|
7535 |
|
7536 |
-
|
|
|
7537 |
|
7538 |
-
|
7539 |
-
controllers.delete(controller);
|
7540 |
-
controller.stop(true);
|
7541 |
-
}
|
7542 |
-
} // Loop over as long as there are controllers ...
|
7543 |
|
|
|
|
|
7544 |
|
7545 |
-
|
7546 |
-
if (manualFrameloop) manualFrameloop();else requestFrame(update);
|
7547 |
-
} else {
|
7548 |
-
active = false;
|
7549 |
}
|
7550 |
|
7551 |
-
|
7552 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7553 |
|
7554 |
-
|
7555 |
-
|
7556 |
-
|
7557 |
-
if (!active) {
|
7558 |
-
active = true;
|
7559 |
-
if (manualFrameloop) requestFrame(manualFrameloop);else requestFrame(update);
|
7560 |
-
}
|
7561 |
-
};
|
7562 |
-
|
7563 |
-
var stop = function stop(controller) {
|
7564 |
-
if (controllers.has(controller)) controllers.delete(controller);
|
7565 |
-
};
|
7566 |
|
7567 |
-
|
7568 |
-
|
7569 |
-
|
7570 |
-
|
7571 |
|
7572 |
-
|
7573 |
-
|
7574 |
-
range: range,
|
7575 |
-
output: output,
|
7576 |
-
extrapolate: extrapolate
|
7577 |
-
});
|
7578 |
-
}
|
7579 |
|
7580 |
-
|
7581 |
-
|
7582 |
-
}
|
7583 |
|
7584 |
-
|
7585 |
-
|
7586 |
-
var inputRange = config.range || [0, 1];
|
7587 |
-
var extrapolateLeft = config.extrapolateLeft || config.extrapolate || 'extend';
|
7588 |
-
var extrapolateRight = config.extrapolateRight || config.extrapolate || 'extend';
|
7589 |
|
7590 |
-
|
7591 |
-
|
7592 |
-
};
|
7593 |
|
7594 |
-
|
7595 |
-
|
7596 |
-
return interpolate(input, inputRange[range], inputRange[range + 1], outputRange[range], outputRange[range + 1], easing, extrapolateLeft, extrapolateRight, config.map);
|
7597 |
-
};
|
7598 |
-
}
|
7599 |
|
7600 |
-
|
7601 |
-
var result = map ? map(input) : input; // Extrapolate
|
7602 |
|
7603 |
-
if (result < inputMin) {
|
7604 |
-
if (extrapolateLeft === 'identity') return result;else if (extrapolateLeft === 'clamp') result = inputMin;
|
7605 |
-
}
|
7606 |
|
7607 |
-
if (result > inputMax) {
|
7608 |
-
if (extrapolateRight === 'identity') return result;else if (extrapolateRight === 'clamp') result = inputMax;
|
7609 |
-
}
|
7610 |
|
7611 |
-
if (outputMin === outputMax) return outputMin;
|
7612 |
-
if (inputMin === inputMax) return input <= inputMin ? outputMin : outputMax; // Input Range
|
7613 |
|
7614 |
-
if (inputMin === -Infinity) result = -result;else if (inputMax === Infinity) result = result - inputMin;else result = (result - inputMin) / (inputMax - inputMin); // Easing
|
7615 |
|
7616 |
-
result = easing(result); // Output Range
|
7617 |
|
7618 |
-
|
7619 |
-
|
7620 |
-
|
7621 |
|
7622 |
-
function findRange(input, inputRange) {
|
7623 |
-
for (var i = 1; i < inputRange.length - 1; ++i) {
|
7624 |
-
if (inputRange[i] >= input) break;
|
7625 |
-
}
|
7626 |
|
7627 |
-
return i - 1;
|
7628 |
-
}
|
7629 |
|
7630 |
-
|
7631 |
-
|
7632 |
-
|
7633 |
-
_inheritsLoose(AnimatedInterpolation, _AnimatedArray);
|
7634 |
|
7635 |
-
function AnimatedInterpolation(parents, range, output, extrapolate) {
|
7636 |
-
var _this;
|
7637 |
|
7638 |
-
_this = _AnimatedArray.call(this) || this;
|
7639 |
-
_this.calc = void 0;
|
7640 |
-
_this.payload = parents instanceof AnimatedArray && !(parents instanceof AnimatedInterpolation) ? parents.getPayload() : Array.isArray(parents) ? parents : [parents];
|
7641 |
-
_this.calc = createInterpolator(range, output, extrapolate);
|
7642 |
-
return _this;
|
7643 |
-
}
|
7644 |
|
7645 |
-
|
|
|
|
|
7646 |
|
7647 |
-
_proto.getValue = function getValue() {
|
7648 |
-
return this.calc.apply(this, this.payload.map(function (value) {
|
7649 |
-
return value.getValue();
|
7650 |
-
}));
|
7651 |
-
};
|
7652 |
|
7653 |
-
|
7654 |
-
|
7655 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7656 |
|
7657 |
-
|
7658 |
-
|
7659 |
-
|
|
|
|
|
|
|
|
|
7660 |
|
7661 |
-
|
7662 |
-
|
|
|
|
|
|
|
7663 |
|
7664 |
-
var
|
7665 |
-
|
7666 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7667 |
|
7668 |
-
|
7669 |
-
|
7670 |
-
tension: 170,
|
7671 |
-
friction: 26
|
7672 |
-
},
|
7673 |
-
gentle: {
|
7674 |
-
tension: 120,
|
7675 |
-
friction: 14
|
7676 |
-
},
|
7677 |
-
wobbly: {
|
7678 |
-
tension: 180,
|
7679 |
-
friction: 12
|
7680 |
-
},
|
7681 |
-
stiff: {
|
7682 |
-
tension: 210,
|
7683 |
-
friction: 20
|
7684 |
-
},
|
7685 |
-
slow: {
|
7686 |
-
tension: 280,
|
7687 |
-
friction: 60
|
7688 |
-
},
|
7689 |
-
molasses: {
|
7690 |
-
tension: 280,
|
7691 |
-
friction: 120
|
7692 |
-
}
|
7693 |
-
};
|
7694 |
|
7695 |
-
|
7696 |
-
|
7697 |
-
|
|
|
|
|
|
|
|
|
7698 |
|
7699 |
-
function
|
7700 |
-
|
7701 |
-
|
7702 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7703 |
|
7704 |
-
|
7705 |
-
|
7706 |
-
|
7707 |
-
|
7708 |
-
|
7709 |
-
});else if (timeSteps) {
|
7710 |
-
refs.forEach(function (_ref2, index) {
|
7711 |
-
var current = _ref2.current;
|
7712 |
|
7713 |
-
|
7714 |
-
|
|
|
|
|
|
|
|
|
|
|
7715 |
|
7716 |
-
|
7717 |
-
|
7718 |
-
|
7719 |
-
|
7720 |
-
|
7721 |
-
|
7722 |
-
});
|
7723 |
-
});
|
7724 |
-
ctrl.start();
|
7725 |
-
});
|
7726 |
-
}
|
7727 |
-
}
|
7728 |
-
});
|
7729 |
-
} else refs.reduce(function (q, _ref3, rI) {
|
7730 |
-
var current = _ref3.current;
|
7731 |
-
return q = q.then(function () {
|
7732 |
-
return current.start();
|
7733 |
-
});
|
7734 |
-
}, Promise.resolve());
|
7735 |
-
previous.current = refs;
|
7736 |
});
|
7737 |
-
|
7738 |
|
7739 |
-
|
7740 |
-
|
7741 |
-
|
7742 |
-
|
7743 |
-
|
7744 |
-
|
7745 |
-
|
7746 |
-
|
7747 |
-
|
7748 |
-
|
7749 |
-
|
7750 |
-
|
7751 |
-
|
7752 |
-
|
7753 |
-
|
7754 |
-
|
7755 |
-
|
7756 |
-
|
7757 |
-
|
7758 |
-
|
7759 |
-
|
7760 |
-
|
7761 |
-
|
7762 |
-
|
7763 |
-
styles.add(node);
|
7764 |
-
} else {
|
7765 |
-
node.getChildren().forEach(function (child) {
|
7766 |
-
return addAnimatedStyles(child, styles);
|
7767 |
-
});
|
7768 |
-
}
|
7769 |
}
|
7770 |
|
7771 |
-
var
|
7772 |
-
|
7773 |
-
|
7774 |
-
|
7775 |
|
7776 |
-
|
7777 |
-
var _this;
|
7778 |
|
7779 |
-
_this = _Animated.call(this) || this;
|
7780 |
-
_this.animatedStyles = new Set();
|
7781 |
-
_this.value = void 0;
|
7782 |
-
_this.startPosition = void 0;
|
7783 |
-
_this.lastPosition = void 0;
|
7784 |
-
_this.lastVelocity = void 0;
|
7785 |
-
_this.startTime = void 0;
|
7786 |
-
_this.lastTime = void 0;
|
7787 |
-
_this.done = false;
|
7788 |
|
7789 |
-
_this.setValue = function (value, flush) {
|
7790 |
-
if (flush === void 0) {
|
7791 |
-
flush = true;
|
7792 |
-
}
|
7793 |
|
7794 |
-
_this.value = value;
|
7795 |
-
if (flush) _this.flush();
|
7796 |
-
};
|
7797 |
|
7798 |
-
_this.value = _value;
|
7799 |
-
_this.startPosition = _value;
|
7800 |
-
_this.lastPosition = _value;
|
7801 |
-
return _this;
|
7802 |
-
}
|
7803 |
|
7804 |
-
var _proto = AnimatedValue.prototype;
|
7805 |
|
7806 |
-
_proto.flush = function flush() {
|
7807 |
-
if (this.animatedStyles.size === 0) {
|
7808 |
-
addAnimatedStyles(this, this.animatedStyles);
|
7809 |
-
}
|
7810 |
|
7811 |
-
|
7812 |
-
return animatedStyle.update();
|
7813 |
-
});
|
7814 |
-
};
|
7815 |
|
7816 |
-
|
7817 |
-
this.animatedStyles.clear();
|
7818 |
-
};
|
7819 |
|
7820 |
-
|
7821 |
-
|
7822 |
-
|
7823 |
|
7824 |
-
_proto.interpolate = function interpolate(range, output, extrapolate) {
|
7825 |
-
return new AnimatedInterpolation(this, range, output, extrapolate);
|
7826 |
-
};
|
7827 |
|
7828 |
-
return AnimatedValue;
|
7829 |
-
}(Animated);
|
7830 |
|
7831 |
-
var AnimatedValueArray =
|
7832 |
-
/*#__PURE__*/
|
7833 |
-
function (_AnimatedArray) {
|
7834 |
-
_inheritsLoose(AnimatedValueArray, _AnimatedArray);
|
7835 |
|
7836 |
-
function AnimatedValueArray(values) {
|
7837 |
-
var _this;
|
7838 |
|
7839 |
-
_this = _AnimatedArray.call(this) || this;
|
7840 |
-
_this.payload = values.map(function (n) {
|
7841 |
-
return new AnimatedValue(n);
|
7842 |
-
});
|
7843 |
-
return _this;
|
7844 |
-
}
|
7845 |
|
7846 |
-
|
|
|
|
|
7847 |
|
7848 |
-
_proto.setValue = function setValue(value, flush) {
|
7849 |
-
var _this2 = this;
|
7850 |
|
7851 |
-
if (flush === void 0) {
|
7852 |
-
flush = true;
|
7853 |
-
}
|
7854 |
|
7855 |
-
|
7856 |
-
|
7857 |
-
|
7858 |
-
|
7859 |
-
|
7860 |
-
|
7861 |
-
|
7862 |
-
|
7863 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7864 |
});
|
7865 |
}
|
7866 |
-
};
|
7867 |
|
7868 |
-
|
7869 |
-
|
7870 |
-
return v.getValue();
|
7871 |
-
});
|
7872 |
-
};
|
7873 |
|
7874 |
-
|
7875 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7876 |
};
|
|
|
|
|
|
|
7877 |
|
7878 |
-
|
7879 |
-
}(AnimatedArray);
|
7880 |
|
7881 |
-
var G = 0;
|
7882 |
|
7883 |
-
var Controller =
|
7884 |
-
/*#__PURE__*/
|
7885 |
-
function () {
|
7886 |
-
function Controller() {
|
7887 |
-
var _this = this;
|
7888 |
|
7889 |
-
this.id = void 0;
|
7890 |
-
this.idle = true;
|
7891 |
-
this.hasChanged = false;
|
7892 |
-
this.guid = 0;
|
7893 |
-
this.local = 0;
|
7894 |
-
this.props = {};
|
7895 |
-
this.merged = {};
|
7896 |
-
this.animations = {};
|
7897 |
-
this.interpolations = {};
|
7898 |
-
this.values = {};
|
7899 |
-
this.configs = [];
|
7900 |
-
this.listeners = [];
|
7901 |
-
this.queue = [];
|
7902 |
-
this.localQueue = void 0;
|
7903 |
|
7904 |
-
this.getValues = function () {
|
7905 |
-
return _this.interpolations;
|
7906 |
-
};
|
7907 |
|
7908 |
-
this.id = G++;
|
7909 |
-
}
|
7910 |
-
/** update(props)
|
7911 |
-
* This function filters input props and creates an array of tasks which are executed in .start()
|
7912 |
-
* Each task is allowed to carry a delay, which means it can execute asnychroneously */
|
7913 |
|
7914 |
|
7915 |
-
var _proto = Controller.prototype;
|
7916 |
|
7917 |
-
_proto.update = function update$$1(args) {
|
7918 |
-
//this._id = n + this.id
|
7919 |
-
if (!args) return this; // Extract delay and the to-prop from props
|
7920 |
|
7921 |
-
var _ref = interpolateTo(args),
|
7922 |
-
_ref$delay = _ref.delay,
|
7923 |
-
delay = _ref$delay === void 0 ? 0 : _ref$delay,
|
7924 |
-
to = _ref.to,
|
7925 |
-
props = _objectWithoutPropertiesLoose(_ref, ["delay", "to"]);
|
7926 |
|
7927 |
-
|
7928 |
-
// If config is either a function or an array queue it up as is
|
7929 |
-
this.queue.push(_extends({}, props, {
|
7930 |
-
delay: delay,
|
7931 |
-
to: to
|
7932 |
-
}));
|
7933 |
-
} else if (to) {
|
7934 |
-
// Otherwise go through each key since it could be delayed individually
|
7935 |
-
var ops = {};
|
7936 |
-
Object.entries(to).forEach(function (_ref2) {
|
7937 |
-
var _to;
|
7938 |
|
7939 |
-
|
7940 |
-
v = _ref2[1];
|
7941 |
|
7942 |
-
|
7943 |
-
var entry = _extends({
|
7944 |
-
to: (_to = {}, _to[k] = v, _to),
|
7945 |
-
delay: callProp(delay, k)
|
7946 |
-
}, props);
|
7947 |
|
7948 |
-
|
7949 |
-
ops[entry.delay] = _extends({}, ops[entry.delay], entry, {
|
7950 |
-
to: _extends({}, previous, entry.to)
|
7951 |
-
});
|
7952 |
-
});
|
7953 |
-
this.queue = Object.values(ops);
|
7954 |
-
} // Sort queue, so that async calls go last
|
7955 |
|
|
|
|
|
|
|
7956 |
|
7957 |
-
this.queue = this.queue.sort(function (a, b) {
|
7958 |
-
return a.delay - b.delay;
|
7959 |
-
}); // Diff the reduced props immediately (they'll contain the from-prop and some config)
|
7960 |
|
7961 |
-
this.diff(props);
|
7962 |
-
return this;
|
7963 |
-
}
|
7964 |
-
/** start(onEnd)
|
7965 |
-
* This function either executes a queue, if present, or starts the frameloop, which animates */
|
7966 |
-
;
|
7967 |
|
7968 |
-
_proto.start = function start$$1(onEnd) {
|
7969 |
-
var _this2 = this;
|
7970 |
|
7971 |
-
// If a queue is present we must excecute it
|
7972 |
-
if (this.queue.length) {
|
7973 |
-
this.idle = false; // Updates can interrupt trailing queues, in that case we just merge values
|
7974 |
|
7975 |
-
if (this.localQueue) {
|
7976 |
-
this.localQueue.forEach(function (_ref3) {
|
7977 |
-
var _ref3$from = _ref3.from,
|
7978 |
-
from = _ref3$from === void 0 ? {} : _ref3$from,
|
7979 |
-
_ref3$to = _ref3.to,
|
7980 |
-
to = _ref3$to === void 0 ? {} : _ref3$to;
|
7981 |
-
if (is.obj(from)) _this2.merged = _extends({}, from, _this2.merged);
|
7982 |
-
if (is.obj(to)) _this2.merged = _extends({}, _this2.merged, to);
|
7983 |
-
});
|
7984 |
-
} // The guid helps us tracking frames, a new queue over an old one means an override
|
7985 |
-
// We discard async calls in that caseÍ
|
7986 |
|
7987 |
|
7988 |
-
|
7989 |
-
|
7990 |
-
|
7991 |
|
7992 |
-
queue.forEach(function (_ref4, index) {
|
7993 |
-
var delay = _ref4.delay,
|
7994 |
-
props = _objectWithoutPropertiesLoose(_ref4, ["delay"]);
|
7995 |
|
7996 |
-
var cb = function cb(finished) {
|
7997 |
-
if (index === queue.length - 1 && local === _this2.guid && finished) {
|
7998 |
-
_this2.idle = true;
|
7999 |
-
if (_this2.props.onRest) _this2.props.onRest(_this2.merged);
|
8000 |
-
}
|
8001 |
|
8002 |
-
if (onEnd) onEnd();
|
8003 |
-
}; // Entries can be delayed, ansyc or immediate
|
8004 |
|
8005 |
|
8006 |
-
|
|
|
|
|
8007 |
|
8008 |
-
if (delay) {
|
8009 |
-
setTimeout(function () {
|
8010 |
-
if (local === _this2.guid) {
|
8011 |
-
if (async) _this2.runAsync(props, cb);else _this2.diff(props).start(cb);
|
8012 |
-
}
|
8013 |
-
}, delay);
|
8014 |
-
} else if (async) _this2.runAsync(props, cb);else _this2.diff(props).start(cb);
|
8015 |
-
});
|
8016 |
-
} // Otherwise we kick of the frameloop
|
8017 |
-
else {
|
8018 |
-
if (is.fun(onEnd)) this.listeners.push(onEnd);
|
8019 |
-
if (this.props.onStart) this.props.onStart();
|
8020 |
|
8021 |
-
start(this);
|
8022 |
-
}
|
8023 |
|
8024 |
-
return this;
|
8025 |
-
};
|
8026 |
|
8027 |
-
_proto.stop = function stop$$1(finished) {
|
8028 |
-
this.listeners.forEach(function (onEnd) {
|
8029 |
-
return onEnd(finished);
|
8030 |
-
});
|
8031 |
-
this.listeners = [];
|
8032 |
-
return this;
|
8033 |
-
}
|
8034 |
-
/** Pause sets onEnd listeners free, but also removes the controller from the frameloop */
|
8035 |
-
;
|
8036 |
|
8037 |
-
_proto.pause = function pause(finished) {
|
8038 |
-
this.stop(true);
|
8039 |
-
if (finished) stop(this);
|
8040 |
-
return this;
|
8041 |
-
};
|
8042 |
|
8043 |
-
_proto.runAsync = function runAsync(_ref5, onEnd) {
|
8044 |
-
var _this3 = this;
|
8045 |
|
8046 |
-
|
8047 |
-
|
|
|
8048 |
|
8049 |
-
|
8050 |
-
|
8051 |
|
8052 |
-
|
8053 |
|
8054 |
-
|
8055 |
-
|
8056 |
-
var index = i;
|
8057 |
|
8058 |
-
|
|
|
8059 |
|
8060 |
-
|
8061 |
-
|
8062 |
-
|
8063 |
-
|
8064 |
-
|
8065 |
-
|
8066 |
-
|
8067 |
-
}
|
|
|
|
|
|
|
|
|
8068 |
|
8069 |
-
|
8070 |
-
|
8071 |
-
}
|
8072 |
-
} else if (is.fun(props.to)) {
|
8073 |
-
var index = 0;
|
8074 |
-
var last;
|
8075 |
-
queue = queue.then(function () {
|
8076 |
-
return props.to( // next(props)
|
8077 |
-
function (p) {
|
8078 |
-
var fresh = _extends({}, props, interpolateTo(p));
|
8079 |
|
8080 |
-
|
8081 |
-
|
8082 |
|
8083 |
-
|
8084 |
-
return _this3.diff(fresh).start(r);
|
8085 |
-
});
|
8086 |
-
return;
|
8087 |
-
}, // cancel()
|
8088 |
-
function (finished) {
|
8089 |
-
if (finished === void 0) {
|
8090 |
-
finished = true;
|
8091 |
-
}
|
8092 |
|
8093 |
-
|
8094 |
-
|
8095 |
-
return last;
|
8096 |
-
});
|
8097 |
-
});
|
8098 |
-
}
|
8099 |
|
8100 |
-
|
8101 |
-
}
|
8102 |
|
8103 |
-
|
8104 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8105 |
|
8106 |
-
|
8107 |
-
|
8108 |
-
|
8109 |
-
from = _this$props$from === void 0 ? {} : _this$props$from,
|
8110 |
-
_this$props$to = _this$props.to,
|
8111 |
-
to = _this$props$to === void 0 ? {} : _this$props$to,
|
8112 |
-
_this$props$config = _this$props.config,
|
8113 |
-
config = _this$props$config === void 0 ? {} : _this$props$config,
|
8114 |
-
reverse = _this$props.reverse,
|
8115 |
-
attach = _this$props.attach,
|
8116 |
-
reset = _this$props.reset,
|
8117 |
-
immediate = _this$props.immediate; // Reverse values when requested
|
8118 |
|
8119 |
-
|
8120 |
-
|
8121 |
-
|
8122 |
-
|
8123 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8124 |
|
|
|
|
|
8125 |
|
8126 |
-
|
8127 |
-
|
|
|
|
|
|
|
8128 |
|
8129 |
-
|
8130 |
|
8131 |
-
|
8132 |
-
|
8133 |
-
|
8134 |
-
// Issue cached entries, except on reset
|
8135 |
-
var entry = acc[name] || {}; // Figure out what the value is supposed to be
|
8136 |
|
8137 |
-
var isNumber = is.num(value);
|
8138 |
-
var isString = is.str(value) && !value.startsWith('#') && !/\d/.test(value) && !colorNames[value];
|
8139 |
-
var isArray = is.arr(value);
|
8140 |
-
var isInterpolation = !isNumber && !isArray && !isString;
|
8141 |
-
var fromValue = !is.und(from[name]) ? from[name] : value;
|
8142 |
-
var toValue = isNumber || isArray ? value : isString ? value : 1;
|
8143 |
-
var toConfig = callProp(config, name);
|
8144 |
-
if (target) toValue = target.animations[name].parent;
|
8145 |
-
var parent = entry.parent,
|
8146 |
-
interpolation$$1 = entry.interpolation,
|
8147 |
-
toValues = toArray(target ? toValue.getPayload() : toValue),
|
8148 |
-
animatedValues;
|
8149 |
-
var newValue = value;
|
8150 |
-
if (isInterpolation) newValue = interpolation({
|
8151 |
-
range: [0, 1],
|
8152 |
-
output: [value, value]
|
8153 |
-
})(1);
|
8154 |
-
var currentValue = interpolation$$1 && interpolation$$1.getValue(); // Change detection flags
|
8155 |
|
8156 |
-
var
|
8157 |
-
var isActive = !isFirst && entry.animatedValues.some(function (v) {
|
8158 |
-
return !v.done;
|
8159 |
-
});
|
8160 |
-
var currentValueDiffersFromGoal = !is.equ(newValue, currentValue);
|
8161 |
-
var hasNewGoal = !is.equ(newValue, entry.previous);
|
8162 |
-
var hasNewConfig = !is.equ(toConfig, entry.config); // Change animation props when props indicate a new goal (new value differs from previous one)
|
8163 |
-
// and current values differ from it. Config changes trigger a new update as well (though probably shouldn't?)
|
8164 |
|
8165 |
-
if (
|
8166 |
-
|
|
|
8167 |
|
8168 |
-
|
8169 |
-
|
8170 |
-
|
8171 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8172 |
|
8173 |
-
|
8174 |
-
|
8175 |
-
|
8176 |
-
|
|
|
|
|
|
|
|
|
|
|
8177 |
|
8178 |
-
|
8179 |
-
|
8180 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8181 |
|
8182 |
-
|
8183 |
-
|
8184 |
-
entry.interpolation.updateConfig(range);
|
8185 |
-
} else interpolation$$1 = parent.interpolate(range);
|
8186 |
-
}
|
8187 |
-
toValues = toArray(target ? toValue.getPayload() : toValue);
|
8188 |
-
animatedValues = toArray(parent.getPayload());
|
8189 |
-
if (reset && !isInterpolation) parent.setValue(fromValue, false);
|
8190 |
-
_this4.hasChanged = true; // Reset animated values
|
8191 |
|
8192 |
-
|
8193 |
-
|
8194 |
-
|
8195 |
-
|
8196 |
-
|
8197 |
-
|
8198 |
-
|
8199 |
-
|
8200 |
-
|
|
|
|
|
|
|
|
|
|
|
8201 |
|
8202 |
-
|
8203 |
-
|
8204 |
-
|
|
|
8205 |
|
8206 |
-
|
8207 |
-
|
8208 |
-
|
8209 |
-
|
8210 |
-
animatedValues: animatedValues,
|
8211 |
-
toValues: toValues,
|
8212 |
-
previous: newValue,
|
8213 |
-
config: toConfig,
|
8214 |
-
fromValues: toArray(parent.getValue()),
|
8215 |
-
immediate: callProp(immediate, name),
|
8216 |
-
initialVelocity: withDefault(toConfig.velocity, 0),
|
8217 |
-
clamp: withDefault(toConfig.clamp, false),
|
8218 |
-
precision: withDefault(toConfig.precision, 0.01),
|
8219 |
-
tension: withDefault(toConfig.tension, 170),
|
8220 |
-
friction: withDefault(toConfig.friction, 26),
|
8221 |
-
mass: withDefault(toConfig.mass, 1),
|
8222 |
-
duration: toConfig.duration,
|
8223 |
-
easing: withDefault(toConfig.easing, function (t) {
|
8224 |
-
return t;
|
8225 |
-
}),
|
8226 |
-
decay: toConfig.decay
|
8227 |
-
}), _extends2));
|
8228 |
-
} else {
|
8229 |
-
if (!currentValueDiffersFromGoal) {
|
8230 |
-
var _extends3;
|
8231 |
|
8232 |
-
|
8233 |
-
|
8234 |
-
|
8235 |
-
|
8236 |
-
|
8237 |
-
|
8238 |
-
interpolation$$1.updateConfig({
|
8239 |
-
output: [newValue, newValue]
|
8240 |
-
});
|
8241 |
-
}
|
8242 |
|
8243 |
-
|
8244 |
-
|
8245 |
-
return _extends({}, acc, (_extends3 = {}, _extends3[name] = _extends({}, acc[name], {
|
8246 |
-
previous: newValue
|
8247 |
-
}), _extends3));
|
8248 |
-
}
|
8249 |
|
8250 |
-
|
8251 |
-
}
|
8252 |
-
}, this.animations);
|
8253 |
|
8254 |
-
|
8255 |
-
|
8256 |
-
this.configs = Object.values(this.animations);
|
8257 |
-
this.values = {};
|
8258 |
-
this.interpolations = {};
|
8259 |
|
8260 |
-
|
8261 |
-
|
8262 |
-
|
8263 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8264 |
}
|
|
|
8265 |
|
8266 |
-
|
8267 |
-
|
8268 |
|
8269 |
-
|
8270 |
-
|
8271 |
-
|
8272 |
-
|
8273 |
-
this.animations = {};
|
8274 |
-
this.interpolations = {};
|
8275 |
-
this.values = {};
|
8276 |
-
this.configs = [];
|
8277 |
-
this.local = 0;
|
8278 |
-
};
|
8279 |
|
8280 |
-
|
8281 |
-
}();
|
8282 |
|
8283 |
-
|
8284 |
-
|
8285 |
-
* const [props, set] = useSprings(number, (i, controller) => ({ ... }))
|
8286 |
-
*/
|
8287 |
|
8288 |
-
|
8289 |
-
|
8290 |
-
var ctrl = React.useRef();
|
8291 |
-
var isFn = is.fun(props); // The controller maintains the animation values, starts and stops animations
|
8292 |
|
8293 |
-
|
8294 |
-
|
8295 |
-
|
8296 |
-
|
8297 |
-
|
|
|
|
|
|
|
8298 |
});
|
8299 |
-
ctrl.current = undefined;
|
8300 |
}
|
|
|
8301 |
|
8302 |
-
|
8303 |
-
|
8304 |
-
var ctrl = new Controller();
|
8305 |
-
var newProps = isFn ? callProp(props, i, ctrl) : props[i];
|
8306 |
-
if (i === 0) ref = newProps.ref;
|
8307 |
-
ctrl.update(newProps);
|
8308 |
-
if (!ref) ctrl.start();
|
8309 |
-
return ctrl;
|
8310 |
-
}), ref];
|
8311 |
-
}, [length]),
|
8312 |
-
controllers = _useMemo[0],
|
8313 |
-
ref = _useMemo[1];
|
8314 |
|
8315 |
-
|
8316 |
|
8317 |
-
|
8318 |
-
|
8319 |
-
start: function start() {
|
8320 |
-
return Promise.all(ctrl.current.map(function (c) {
|
8321 |
-
return new Promise(function (r) {
|
8322 |
-
return c.start(r);
|
8323 |
-
});
|
8324 |
-
}));
|
8325 |
-
},
|
8326 |
-
stop: function stop(finished) {
|
8327 |
-
return ctrl.current.forEach(function (c) {
|
8328 |
-
return c.stop(finished);
|
8329 |
-
});
|
8330 |
-
},
|
8331 |
|
8332 |
-
|
8333 |
-
|
8334 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8335 |
|
8336 |
-
};
|
8337 |
-
}); // This function updates the controllers
|
8338 |
|
8339 |
-
|
8340 |
-
|
8341 |
-
|
8342 |
-
c.update(isFn ? callProp(updateProps, i, c) : updateProps[i]);
|
8343 |
-
if (!ref) c.start();
|
8344 |
-
});
|
8345 |
-
};
|
8346 |
-
}, [length]); // Update controller if props aren't functional
|
8347 |
|
8348 |
-
React.useEffect(function () {
|
8349 |
-
if (mounted.current) {
|
8350 |
-
if (!isFn) updateCtrl(props);
|
8351 |
-
} else if (!ref) ctrl.current.forEach(function (c) {
|
8352 |
-
return c.start();
|
8353 |
-
});
|
8354 |
-
}); // Update mounted flag and destroy controller on unmount
|
8355 |
|
8356 |
-
|
8357 |
-
|
8358 |
-
|
8359 |
-
return c.destroy();
|
8360 |
-
});
|
8361 |
-
};
|
8362 |
-
}, []); // Return animated props, or, anim-props + the update-setter above
|
8363 |
|
8364 |
-
|
8365 |
-
|
8366 |
-
|
8367 |
-
|
8368 |
-
|
8369 |
-
|
8370 |
-
});
|
8371 |
-
}] : propValues;
|
8372 |
};
|
|
|
|
|
8373 |
|
8374 |
-
|
8375 |
-
* const props = useSpring({ ... })
|
8376 |
-
* const [props, set] = useSpring(() => ({ ... }))
|
8377 |
-
*/
|
8378 |
|
8379 |
-
|
8380 |
-
|
8381 |
|
8382 |
-
|
8383 |
-
result = _useSprings[0],
|
8384 |
-
set = _useSprings[1],
|
8385 |
-
pause = _useSprings[2];
|
8386 |
|
8387 |
-
|
8388 |
-
};
|
8389 |
|
8390 |
-
|
8391 |
-
|
8392 |
-
* const [trails, set] = useTrail(number, () => ({ ... }))
|
8393 |
-
*/
|
8394 |
|
8395 |
-
|
8396 |
-
|
8397 |
-
|
8398 |
-
|
8399 |
-
|
|
|
|
|
8400 |
|
8401 |
-
|
8402 |
-
|
8403 |
-
|
8404 |
-
return _extends({}, updateProps, {
|
8405 |
-
config: callProp(updateProps.config, i),
|
8406 |
-
attach: i > 0 && function () {
|
8407 |
-
return instances.current[i - 1];
|
8408 |
-
}
|
8409 |
-
});
|
8410 |
-
}),
|
8411 |
-
result = _useSprings[0],
|
8412 |
-
set = _useSprings[1],
|
8413 |
-
pause = _useSprings[2]; // Set up function to update controller
|
8414 |
|
8415 |
|
8416 |
-
|
8417 |
-
|
8418 |
-
|
8419 |
-
var last = props.reverse ? i === 0 : length - 1 === i;
|
8420 |
-
var attachIdx = props.reverse ? i + 1 : i - 1;
|
8421 |
-
var attachController = instances.current[attachIdx];
|
8422 |
-
return _extends({}, props, {
|
8423 |
-
config: callProp(props.config || updateProps.config, i),
|
8424 |
-
attach: attachController && function () {
|
8425 |
-
return attachController;
|
8426 |
-
}
|
8427 |
-
});
|
8428 |
-
});
|
8429 |
-
};
|
8430 |
-
}, [length, updateProps.reverse]); // Update controller if props aren't functional
|
8431 |
|
8432 |
-
|
8433 |
-
|
8434 |
-
|
|
|
|
|
|
|
|
|
8435 |
|
8436 |
-
|
8437 |
-
|
8438 |
-
|
8439 |
-
|
|
|
|
|
|
|
8440 |
};
|
|
|
|
|
|
|
8441 |
|
8442 |
-
/**
|
8443 |
-
*
|
8444 |
-
*
|
|
|
8445 |
*/
|
8446 |
|
8447 |
-
var
|
8448 |
-
|
8449 |
-
|
8450 |
-
|
|
|
|
|
|
|
|
|
|
|
8451 |
|
8452 |
-
var
|
8453 |
-
|
|
|
|
|
|
|
|
|
|
|
8454 |
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8455 |
|
8456 |
-
var
|
8457 |
-
var
|
8458 |
-
|
8459 |
-
|
8460 |
-
|
8461 |
-
} : _props$keys,
|
8462 |
-
rest = _objectWithoutPropertiesLoose(props, ["items", "keys"]);
|
8463 |
|
8464 |
-
|
8465 |
-
|
8466 |
-
|
8467 |
-
|
8468 |
-
|
8469 |
};
|
8470 |
|
8471 |
-
|
8472 |
-
|
8473 |
-
|
8474 |
-
keys: keyTransform || function (i) {
|
8475 |
-
return i;
|
8476 |
-
}
|
8477 |
-
}, config);
|
8478 |
|
8479 |
-
|
8480 |
-
_get$lazy = _get.lazy,
|
8481 |
-
lazy = _get$lazy === void 0 ? false : _get$lazy,
|
8482 |
-
_get$unique = _get.unique,
|
8483 |
-
_get$reset = _get.reset,
|
8484 |
-
reset = _get$reset === void 0 ? false : _get$reset,
|
8485 |
-
enter = _get.enter,
|
8486 |
-
leave = _get.leave,
|
8487 |
-
update = _get.update,
|
8488 |
-
onDestroyed = _get.onDestroyed,
|
8489 |
-
keys = _get.keys,
|
8490 |
-
items = _get.items,
|
8491 |
-
onFrame = _get.onFrame,
|
8492 |
-
_onRest = _get.onRest,
|
8493 |
-
onStart = _get.onStart,
|
8494 |
-
ref = _get.ref,
|
8495 |
-
extra = _objectWithoutPropertiesLoose(_get, ["lazy", "unique", "reset", "enter", "leave", "update", "onDestroyed", "keys", "items", "onFrame", "onRest", "onStart", "ref"]);
|
8496 |
|
8497 |
-
|
8498 |
-
|
8499 |
-
var state = React.useRef({
|
8500 |
-
mounted: false,
|
8501 |
-
first: true,
|
8502 |
-
deleted: [],
|
8503 |
-
current: {},
|
8504 |
-
transitions: [],
|
8505 |
-
prevProps: {},
|
8506 |
-
paused: !!props.ref,
|
8507 |
-
instances: !mounted.current && new Map(),
|
8508 |
-
forceUpdate: forceUpdate
|
8509 |
-
});
|
8510 |
-
React.useImperativeHandle(props.ref, function () {
|
8511 |
-
return {
|
8512 |
-
start: function start() {
|
8513 |
-
return Promise.all(Array.from(state.current.instances).map(function (_ref) {
|
8514 |
-
var c = _ref[1];
|
8515 |
-
return new Promise(function (r) {
|
8516 |
-
return c.start(r);
|
8517 |
-
});
|
8518 |
-
}));
|
8519 |
-
},
|
8520 |
-
stop: function stop(finished) {
|
8521 |
-
return Array.from(state.current.instances).forEach(function (_ref2) {
|
8522 |
-
var c = _ref2[1];
|
8523 |
-
return c.stop(finished);
|
8524 |
-
});
|
8525 |
-
},
|
8526 |
|
8527 |
-
|
8528 |
-
|
8529 |
-
|
8530 |
-
|
8531 |
-
});
|
8532 |
-
}
|
8533 |
|
8534 |
-
};
|
8535 |
-
}); // Update state
|
8536 |
|
8537 |
-
|
|
|
|
|
8538 |
|
8539 |
-
|
8540 |
-
|
8541 |
-
|
8542 |
-
|
8543 |
-
|
8544 |
-
|
8545 |
-
|
8546 |
-
|
8547 |
-
key = transition.key,
|
8548 |
-
item = transition.item;
|
8549 |
-
if (!state.current.instances.has(key)) state.current.instances.set(key, new Controller()); // update the map object
|
8550 |
|
8551 |
-
|
8552 |
|
8553 |
-
|
8554 |
-
|
8555 |
-
from: from,
|
8556 |
-
config: config,
|
8557 |
-
ref: ref,
|
8558 |
-
onRest: function onRest(values) {
|
8559 |
-
if (state.current.mounted) {
|
8560 |
-
if (transition.destroyed) {
|
8561 |
-
// If no ref is given delete destroyed items immediately
|
8562 |
-
if (!ref && !lazy) cleanUp(state, key);
|
8563 |
-
if (onDestroyed) onDestroyed(item);
|
8564 |
-
} // A transition comes to rest once all its springs conclude
|
8565 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8566 |
|
8567 |
-
|
8568 |
-
|
8569 |
-
|
8570 |
-
|
8571 |
-
|
8572 |
-
|
8573 |
-
if (_onRest) _onRest(item, slot, values);
|
8574 |
-
}
|
8575 |
-
},
|
8576 |
-
onStart: onStart && function () {
|
8577 |
-
return onStart(item, slot);
|
8578 |
-
},
|
8579 |
-
onFrame: onFrame && function (values) {
|
8580 |
-
return onFrame(item, slot, values);
|
8581 |
-
},
|
8582 |
-
delay: trail,
|
8583 |
-
reset: reset && slot === ENTER // Update controller
|
8584 |
|
8585 |
-
});
|
8586 |
|
8587 |
-
|
8588 |
-
if (!state.current.paused) ctrl.start();
|
8589 |
-
});
|
8590 |
-
}
|
8591 |
|
8592 |
-
|
8593 |
-
|
8594 |
-
return function () {
|
8595 |
-
state.current.mounted = mounted.current = false;
|
8596 |
-
Array.from(state.current.instances).map(function (_ref5) {
|
8597 |
-
var c = _ref5[1];
|
8598 |
-
return c.destroy();
|
8599 |
-
});
|
8600 |
-
state.current.instances.clear();
|
8601 |
-
};
|
8602 |
-
}, []);
|
8603 |
-
return state.current.transitions.map(function (_ref6) {
|
8604 |
-
var item = _ref6.item,
|
8605 |
-
slot = _ref6.slot,
|
8606 |
-
key = _ref6.key;
|
8607 |
-
return {
|
8608 |
-
item: item,
|
8609 |
-
key: key,
|
8610 |
-
state: slot,
|
8611 |
-
props: state.current.instances.get(key).getValues()
|
8612 |
-
};
|
8613 |
-
});
|
8614 |
-
}
|
8615 |
|
8616 |
-
|
8617 |
-
var deleted = state.current.deleted;
|
8618 |
|
8619 |
-
|
8620 |
-
|
8621 |
-
|
8622 |
-
_ref8 = _iterator[_i++];
|
8623 |
-
} else {
|
8624 |
-
_i = _iterator.next();
|
8625 |
-
if (_i.done) return "break";
|
8626 |
-
_ref8 = _i.value;
|
8627 |
-
}
|
8628 |
|
8629 |
-
|
8630 |
-
var key = _ref7.key;
|
8631 |
|
8632 |
-
|
8633 |
-
return t.key !== key;
|
8634 |
-
};
|
8635 |
|
8636 |
-
|
8637 |
-
|
8638 |
-
state.current.transitions = state.current.transitions.filter(filter);
|
8639 |
-
state.current.deleted = state.current.deleted.filter(filter);
|
8640 |
-
}
|
8641 |
-
};
|
8642 |
|
8643 |
-
|
8644 |
-
|
|
|
8645 |
|
8646 |
-
|
8647 |
|
8648 |
-
|
8649 |
-
}
|
8650 |
|
8651 |
-
|
|
|
|
|
|
|
|
|
8652 |
}
|
8653 |
|
8654 |
-
|
8655 |
-
var first = _ref9.first,
|
8656 |
-
prevProps = _ref9.prevProps,
|
8657 |
-
state = _objectWithoutPropertiesLoose(_ref9, ["first", "prevProps"]);
|
8658 |
|
8659 |
-
|
8660 |
-
items = _get2.items,
|
8661 |
-
keys = _get2.keys,
|
8662 |
-
initial = _get2.initial,
|
8663 |
-
from = _get2.from,
|
8664 |
-
enter = _get2.enter,
|
8665 |
-
leave = _get2.leave,
|
8666 |
-
update = _get2.update,
|
8667 |
-
_get2$trail = _get2.trail,
|
8668 |
-
trail = _get2$trail === void 0 ? 0 : _get2$trail,
|
8669 |
-
unique = _get2.unique,
|
8670 |
-
config = _get2.config,
|
8671 |
-
_get2$order = _get2.order,
|
8672 |
-
order = _get2$order === void 0 ? [ENTER, LEAVE, UPDATE] : _get2$order;
|
8673 |
|
8674 |
-
|
8675 |
-
|
8676 |
-
_items = _get3.items;
|
8677 |
|
8678 |
-
|
8679 |
|
8680 |
-
|
8681 |
|
8682 |
-
|
8683 |
-
|
8684 |
-
var nextSet = new Set(keys);
|
8685 |
-
var added = keys.filter(function (item) {
|
8686 |
-
return !currentSet.has(item);
|
8687 |
-
});
|
8688 |
-
var removed = state.transitions.filter(function (item) {
|
8689 |
-
return !item.destroyed && !nextSet.has(item.originalKey);
|
8690 |
-
}).map(function (i) {
|
8691 |
-
return i.originalKey;
|
8692 |
-
});
|
8693 |
-
var updated = keys.filter(function (item) {
|
8694 |
-
return currentSet.has(item);
|
8695 |
-
});
|
8696 |
-
var delay = -trail;
|
8697 |
|
8698 |
-
|
8699 |
-
var changeType = order.shift();
|
8700 |
|
8701 |
-
|
8702 |
-
case ENTER:
|
8703 |
-
{
|
8704 |
-
added.forEach(function (key, index) {
|
8705 |
-
// In unique mode, remove fading out transitions if their key comes in again
|
8706 |
-
if (unique && deleted.find(function (d) {
|
8707 |
-
return d.originalKey === key;
|
8708 |
-
})) deleted = deleted.filter(function (t) {
|
8709 |
-
return t.originalKey !== key;
|
8710 |
-
});
|
8711 |
-
var keyIndex = keys.indexOf(key);
|
8712 |
-
var item = items[keyIndex];
|
8713 |
-
var slot = first && initial !== void 0 ? 'initial' : ENTER;
|
8714 |
-
current[key] = {
|
8715 |
-
slot: slot,
|
8716 |
-
originalKey: key,
|
8717 |
-
key: unique ? String(key) : guid++,
|
8718 |
-
item: item,
|
8719 |
-
trail: delay = delay + trail,
|
8720 |
-
config: callProp(config, item, slot),
|
8721 |
-
from: callProp(first ? initial !== void 0 ? initial || {} : from : from, item),
|
8722 |
-
to: callProp(enter, item)
|
8723 |
-
};
|
8724 |
-
});
|
8725 |
-
break;
|
8726 |
-
}
|
8727 |
|
8728 |
-
|
8729 |
-
|
8730 |
-
removed.forEach(function (key) {
|
8731 |
-
var keyIndex = _keys.indexOf(key);
|
8732 |
|
8733 |
-
|
8734 |
-
var slot = LEAVE;
|
8735 |
-
deleted.unshift(_extends({}, current[key], {
|
8736 |
-
slot: slot,
|
8737 |
-
destroyed: true,
|
8738 |
-
left: _keys[Math.max(0, keyIndex - 1)],
|
8739 |
-
right: _keys[Math.min(_keys.length, keyIndex + 1)],
|
8740 |
-
trail: delay = delay + trail,
|
8741 |
-
config: callProp(config, item, slot),
|
8742 |
-
to: callProp(leave, item)
|
8743 |
-
}));
|
8744 |
-
delete current[key];
|
8745 |
-
});
|
8746 |
-
break;
|
8747 |
-
}
|
8748 |
|
8749 |
-
|
8750 |
-
|
8751 |
-
|
8752 |
-
|
8753 |
-
|
8754 |
-
|
8755 |
-
|
8756 |
-
|
8757 |
-
|
8758 |
-
|
8759 |
-
|
8760 |
-
|
8761 |
-
|
8762 |
-
|
8763 |
-
|
8764 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8765 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8766 |
}
|
8767 |
|
8768 |
-
|
8769 |
-
return
|
8770 |
-
|
8771 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8772 |
|
8773 |
-
|
8774 |
-
|
8775 |
-
|
8776 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8777 |
|
8778 |
-
|
|
|
8779 |
|
8780 |
-
|
8781 |
-
|
8782 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8783 |
|
8784 |
-
|
8785 |
-
out = [].concat(out.slice(0, pos), [item], out.slice(pos));
|
8786 |
-
});
|
8787 |
-
return _extends({}, state, {
|
8788 |
-
changed: added.length || removed.length || updated.length,
|
8789 |
-
first: first && added.length === 0,
|
8790 |
-
transitions: out,
|
8791 |
-
current: current,
|
8792 |
-
deleted: deleted,
|
8793 |
-
prevProps: props
|
8794 |
-
});
|
8795 |
}
|
8796 |
|
8797 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8798 |
/*#__PURE__*/
|
8799 |
-
function (
|
8800 |
-
|
|
|
|
|
|
|
8801 |
|
8802 |
-
|
8803 |
-
var _this;
|
8804 |
|
8805 |
-
|
8806 |
-
|
8807 |
-
|
8808 |
|
8809 |
-
|
|
|
|
|
8810 |
|
8811 |
-
|
8812 |
-
style = applyAnimatedValues.transform(style);
|
8813 |
-
}
|
8814 |
|
8815 |
-
|
8816 |
-
return _this;
|
8817 |
-
}
|
8818 |
|
8819 |
-
|
8820 |
-
|
|
|
8821 |
|
8822 |
-
|
8823 |
-
|
8824 |
-
|
8825 |
-
|
8826 |
-
antiquewhite: 0xfaebd7ff,
|
8827 |
-
aqua: 0x00ffffff,
|
8828 |
-
aquamarine: 0x7fffd4ff,
|
8829 |
-
azure: 0xf0ffffff,
|
8830 |
-
beige: 0xf5f5dcff,
|
8831 |
-
bisque: 0xffe4c4ff,
|
8832 |
-
black: 0x000000ff,
|
8833 |
-
blanchedalmond: 0xffebcdff,
|
8834 |
-
blue: 0x0000ffff,
|
8835 |
-
blueviolet: 0x8a2be2ff,
|
8836 |
-
brown: 0xa52a2aff,
|
8837 |
-
burlywood: 0xdeb887ff,
|
8838 |
-
burntsienna: 0xea7e5dff,
|
8839 |
-
cadetblue: 0x5f9ea0ff,
|
8840 |
-
chartreuse: 0x7fff00ff,
|
8841 |
-
chocolate: 0xd2691eff,
|
8842 |
-
coral: 0xff7f50ff,
|
8843 |
-
cornflowerblue: 0x6495edff,
|
8844 |
-
cornsilk: 0xfff8dcff,
|
8845 |
-
crimson: 0xdc143cff,
|
8846 |
-
cyan: 0x00ffffff,
|
8847 |
-
darkblue: 0x00008bff,
|
8848 |
-
darkcyan: 0x008b8bff,
|
8849 |
-
darkgoldenrod: 0xb8860bff,
|
8850 |
-
darkgray: 0xa9a9a9ff,
|
8851 |
-
darkgreen: 0x006400ff,
|
8852 |
-
darkgrey: 0xa9a9a9ff,
|
8853 |
-
darkkhaki: 0xbdb76bff,
|
8854 |
-
darkmagenta: 0x8b008bff,
|
8855 |
-
darkolivegreen: 0x556b2fff,
|
8856 |
-
darkorange: 0xff8c00ff,
|
8857 |
-
darkorchid: 0x9932ccff,
|
8858 |
-
darkred: 0x8b0000ff,
|
8859 |
-
darksalmon: 0xe9967aff,
|
8860 |
-
darkseagreen: 0x8fbc8fff,
|
8861 |
-
darkslateblue: 0x483d8bff,
|
8862 |
-
darkslategray: 0x2f4f4fff,
|
8863 |
-
darkslategrey: 0x2f4f4fff,
|
8864 |
-
darkturquoise: 0x00ced1ff,
|
8865 |
-
darkviolet: 0x9400d3ff,
|
8866 |
-
deeppink: 0xff1493ff,
|
8867 |
-
deepskyblue: 0x00bfffff,
|
8868 |
-
dimgray: 0x696969ff,
|
8869 |
-
dimgrey: 0x696969ff,
|
8870 |
-
dodgerblue: 0x1e90ffff,
|
8871 |
-
firebrick: 0xb22222ff,
|
8872 |
-
floralwhite: 0xfffaf0ff,
|
8873 |
-
forestgreen: 0x228b22ff,
|
8874 |
-
fuchsia: 0xff00ffff,
|
8875 |
-
gainsboro: 0xdcdcdcff,
|
8876 |
-
ghostwhite: 0xf8f8ffff,
|
8877 |
-
gold: 0xffd700ff,
|
8878 |
-
goldenrod: 0xdaa520ff,
|
8879 |
-
gray: 0x808080ff,
|
8880 |
-
green: 0x008000ff,
|
8881 |
-
greenyellow: 0xadff2fff,
|
8882 |
-
grey: 0x808080ff,
|
8883 |
-
honeydew: 0xf0fff0ff,
|
8884 |
-
hotpink: 0xff69b4ff,
|
8885 |
-
indianred: 0xcd5c5cff,
|
8886 |
-
indigo: 0x4b0082ff,
|
8887 |
-
ivory: 0xfffff0ff,
|
8888 |
-
khaki: 0xf0e68cff,
|
8889 |
-
lavender: 0xe6e6faff,
|
8890 |
-
lavenderblush: 0xfff0f5ff,
|
8891 |
-
lawngreen: 0x7cfc00ff,
|
8892 |
-
lemonchiffon: 0xfffacdff,
|
8893 |
-
lightblue: 0xadd8e6ff,
|
8894 |
-
lightcoral: 0xf08080ff,
|
8895 |
-
lightcyan: 0xe0ffffff,
|
8896 |
-
lightgoldenrodyellow: 0xfafad2ff,
|
8897 |
-
lightgray: 0xd3d3d3ff,
|
8898 |
-
lightgreen: 0x90ee90ff,
|
8899 |
-
lightgrey: 0xd3d3d3ff,
|
8900 |
-
lightpink: 0xffb6c1ff,
|
8901 |
-
lightsalmon: 0xffa07aff,
|
8902 |
-
lightseagreen: 0x20b2aaff,
|
8903 |
-
lightskyblue: 0x87cefaff,
|
8904 |
-
lightslategray: 0x778899ff,
|
8905 |
-
lightslategrey: 0x778899ff,
|
8906 |
-
lightsteelblue: 0xb0c4deff,
|
8907 |
-
lightyellow: 0xffffe0ff,
|
8908 |
-
lime: 0x00ff00ff,
|
8909 |
-
limegreen: 0x32cd32ff,
|
8910 |
-
linen: 0xfaf0e6ff,
|
8911 |
-
magenta: 0xff00ffff,
|
8912 |
-
maroon: 0x800000ff,
|
8913 |
-
mediumaquamarine: 0x66cdaaff,
|
8914 |
-
mediumblue: 0x0000cdff,
|
8915 |
-
mediumorchid: 0xba55d3ff,
|
8916 |
-
mediumpurple: 0x9370dbff,
|
8917 |
-
mediumseagreen: 0x3cb371ff,
|
8918 |
-
mediumslateblue: 0x7b68eeff,
|
8919 |
-
mediumspringgreen: 0x00fa9aff,
|
8920 |
-
mediumturquoise: 0x48d1ccff,
|
8921 |
-
mediumvioletred: 0xc71585ff,
|
8922 |
-
midnightblue: 0x191970ff,
|
8923 |
-
mintcream: 0xf5fffaff,
|
8924 |
-
mistyrose: 0xffe4e1ff,
|
8925 |
-
moccasin: 0xffe4b5ff,
|
8926 |
-
navajowhite: 0xffdeadff,
|
8927 |
-
navy: 0x000080ff,
|
8928 |
-
oldlace: 0xfdf5e6ff,
|
8929 |
-
olive: 0x808000ff,
|
8930 |
-
olivedrab: 0x6b8e23ff,
|
8931 |
-
orange: 0xffa500ff,
|
8932 |
-
orangered: 0xff4500ff,
|
8933 |
-
orchid: 0xda70d6ff,
|
8934 |
-
palegoldenrod: 0xeee8aaff,
|
8935 |
-
palegreen: 0x98fb98ff,
|
8936 |
-
paleturquoise: 0xafeeeeff,
|
8937 |
-
palevioletred: 0xdb7093ff,
|
8938 |
-
papayawhip: 0xffefd5ff,
|
8939 |
-
peachpuff: 0xffdab9ff,
|
8940 |
-
peru: 0xcd853fff,
|
8941 |
-
pink: 0xffc0cbff,
|
8942 |
-
plum: 0xdda0ddff,
|
8943 |
-
powderblue: 0xb0e0e6ff,
|
8944 |
-
purple: 0x800080ff,
|
8945 |
-
rebeccapurple: 0x663399ff,
|
8946 |
-
red: 0xff0000ff,
|
8947 |
-
rosybrown: 0xbc8f8fff,
|
8948 |
-
royalblue: 0x4169e1ff,
|
8949 |
-
saddlebrown: 0x8b4513ff,
|
8950 |
-
salmon: 0xfa8072ff,
|
8951 |
-
sandybrown: 0xf4a460ff,
|
8952 |
-
seagreen: 0x2e8b57ff,
|
8953 |
-
seashell: 0xfff5eeff,
|
8954 |
-
sienna: 0xa0522dff,
|
8955 |
-
silver: 0xc0c0c0ff,
|
8956 |
-
skyblue: 0x87ceebff,
|
8957 |
-
slateblue: 0x6a5acdff,
|
8958 |
-
slategray: 0x708090ff,
|
8959 |
-
slategrey: 0x708090ff,
|
8960 |
-
snow: 0xfffafaff,
|
8961 |
-
springgreen: 0x00ff7fff,
|
8962 |
-
steelblue: 0x4682b4ff,
|
8963 |
-
tan: 0xd2b48cff,
|
8964 |
-
teal: 0x008080ff,
|
8965 |
-
thistle: 0xd8bfd8ff,
|
8966 |
-
tomato: 0xff6347ff,
|
8967 |
-
turquoise: 0x40e0d0ff,
|
8968 |
-
violet: 0xee82eeff,
|
8969 |
-
wheat: 0xf5deb3ff,
|
8970 |
-
white: 0xffffffff,
|
8971 |
-
whitesmoke: 0xf5f5f5ff,
|
8972 |
-
yellow: 0xffff00ff,
|
8973 |
-
yellowgreen: 0x9acd32ff
|
8974 |
-
};
|
8975 |
-
|
8976 |
-
// const INTEGER = '[-+]?\\d+';
|
8977 |
-
var NUMBER = '[-+]?\\d*\\.?\\d+';
|
8978 |
-
var PERCENTAGE = NUMBER + '%';
|
8979 |
|
8980 |
-
function
|
8981 |
-
|
8982 |
-
|
8983 |
-
|
|
|
8984 |
|
8985 |
-
return
|
8986 |
-
}
|
|
|
|
|
|
|
|
|
8987 |
|
8988 |
-
|
8989 |
-
var
|
8990 |
-
var hsl = new RegExp('hsl' + call(NUMBER, PERCENTAGE, PERCENTAGE));
|
8991 |
-
var hsla = new RegExp('hsla' + call(NUMBER, PERCENTAGE, PERCENTAGE, NUMBER));
|
8992 |
-
var hex3 = /^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/;
|
8993 |
-
var hex4 = /^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/;
|
8994 |
-
var hex6 = /^#([0-9a-fA-F]{6})$/;
|
8995 |
-
var hex8 = /^#([0-9a-fA-F]{8})$/;
|
8996 |
|
8997 |
-
|
8998 |
-
|
|
|
8999 |
|
9000 |
-
|
|
|
9001 |
|
9002 |
-
|
9003 |
-
|
|
|
|
|
|
|
9004 |
|
9005 |
-
|
9006 |
-
|
|
|
|
|
|
|
9007 |
|
9008 |
-
|
9009 |
-
|
9010 |
|
9011 |
-
|
9012 |
-
|
9013 |
-
|
|
|
|
|
|
|
9014 |
|
9015 |
-
|
9016 |
-
|
9017 |
-
this software without specific prior written permission.
|
9018 |
|
9019 |
-
|
9020 |
-
|
9021 |
-
|
9022 |
-
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
9023 |
-
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
9024 |
-
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
9025 |
-
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
9026 |
-
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
9027 |
-
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
9028 |
-
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
9029 |
-
*/
|
9030 |
-
function normalizeColor(color) {
|
9031 |
-
var match;
|
9032 |
|
9033 |
-
|
9034 |
-
|
9035 |
-
} // Ordered based on occurrences on Facebook codebase
|
9036 |
|
|
|
|
|
|
|
|
|
|
|
9037 |
|
9038 |
-
|
9039 |
-
|
|
|
|
|
|
|
9040 |
|
9041 |
-
|
9042 |
-
return (parse255(match[1]) << 24 | // r
|
9043 |
-
parse255(match[2]) << 16 | // g
|
9044 |
-
parse255(match[3]) << 8 | // b
|
9045 |
-
0x000000ff) >>> // a
|
9046 |
-
0;
|
9047 |
}
|
9048 |
|
9049 |
-
|
9050 |
-
return (parse255(match[1]) << 24 | // r
|
9051 |
-
parse255(match[2]) << 16 | // g
|
9052 |
-
parse255(match[3]) << 8 | // b
|
9053 |
-
parse1(match[4])) >>> // a
|
9054 |
-
0;
|
9055 |
-
}
|
9056 |
|
9057 |
-
|
9058 |
-
|
9059 |
-
|
9060 |
-
|
9061 |
-
'ff', // a
|
9062 |
-
16) >>> 0;
|
9063 |
-
} // https://drafts.csswg.org/css-color-4/#hex-notation
|
9064 |
|
|
|
9065 |
|
9066 |
-
|
|
|
|
|
|
|
|
|
9067 |
|
9068 |
-
|
9069 |
-
|
9070 |
-
match[2] + match[2] + // g
|
9071 |
-
match[3] + match[3] + // b
|
9072 |
-
match[4] + match[4], // a
|
9073 |
-
16) >>> 0;
|
9074 |
-
}
|
9075 |
|
9076 |
-
|
9077 |
-
return (
|
9078 |
-
|
9079 |
-
parsePercentage(match[3]) // l
|
9080 |
-
) | 0x000000ff) >>> // a
|
9081 |
-
0;
|
9082 |
-
}
|
9083 |
|
9084 |
-
|
9085 |
-
|
9086 |
-
parsePercentage(match[2]), // s
|
9087 |
-
parsePercentage(match[3]) // l
|
9088 |
-
) | parse1(match[4])) >>> // a
|
9089 |
-
0;
|
9090 |
-
}
|
9091 |
|
9092 |
-
|
|
|
|
|
|
|
|
|
|
|
9093 |
}
|
9094 |
-
|
9095 |
-
function
|
9096 |
-
|
9097 |
-
if (t > 1) t -= 1;
|
9098 |
-
if (t < 1 / 6) return p + (q - p) * 6 * t;
|
9099 |
-
if (t < 1 / 2) return q;
|
9100 |
-
if (t < 2 / 3) return p + (q - p) * (2 / 3 - t) * 6;
|
9101 |
-
return p;
|
9102 |
}
|
9103 |
-
|
9104 |
-
|
9105 |
-
|
9106 |
-
|
9107 |
-
|
9108 |
-
|
9109 |
-
|
9110 |
-
|
|
|
9111 |
}
|
9112 |
-
|
9113 |
-
function
|
9114 |
-
|
9115 |
-
if (int < 0) return 0;
|
9116 |
-
if (int > 255) return 255;
|
9117 |
-
return int;
|
9118 |
}
|
9119 |
-
|
9120 |
-
|
9121 |
-
|
9122 |
-
|
|
|
9123 |
}
|
9124 |
-
|
9125 |
-
function
|
9126 |
-
|
9127 |
-
if (num < 0) return 0;
|
9128 |
-
if (num > 1) return 255;
|
9129 |
-
return Math.round(num * 255);
|
9130 |
}
|
9131 |
-
|
9132 |
-
|
9133 |
-
|
9134 |
-
|
9135 |
-
|
9136 |
-
|
9137 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
9138 |
}
|
9139 |
|
9140 |
-
|
9141 |
-
|
9142 |
-
|
9143 |
-
|
9144 |
-
|
9145 |
-
|
9146 |
-
|
9147 |
-
|
9148 |
-
|
9149 |
-
|
9150 |
-
|
9151 |
-
|
9152 |
-
|
9153 |
-
|
9154 |
-
|
9155 |
-
|
9156 |
-
|
|
|
|
|
|
|
|
|
9157 |
|
9158 |
-
var colorNamesRegex = new RegExp("(" + Object.keys(colors).join('|') + ")", 'g');
|
9159 |
/**
|
9160 |
-
*
|
9161 |
-
* and recombines those values into new strings of the same shape. Supports
|
9162 |
-
* things like:
|
9163 |
-
*
|
9164 |
-
* rgba(123, 42, 99, 0.36) // colors
|
9165 |
-
* -45deg // values with units
|
9166 |
-
* 0 2px 2px 0px rgba(0, 0, 0, 0.12) // box shadows
|
9167 |
*/
|
9168 |
|
9169 |
-
var
|
9170 |
-
|
9171 |
-
|
9172 |
-
|
9173 |
-
|
9174 |
-
|
9175 |
-
|
9176 |
-
|
9177 |
-
|
9178 |
-
|
9179 |
-
|
9180 |
-
|
9181 |
-
return outputRanges[i].push(+number);
|
9182 |
-
});
|
9183 |
-
});
|
9184 |
-
var interpolations = outputRange[0].match(stringShapeRegex).map(function (_value, i) {
|
9185 |
-
return createInterpolator(_extends({}, config, {
|
9186 |
-
output: outputRanges[i]
|
9187 |
-
}));
|
9188 |
-
});
|
9189 |
-
return function (input) {
|
9190 |
-
var i = 0;
|
9191 |
-
return outputRange[0] // 'rgba(0, 100, 200, 0)'
|
9192 |
-
// ->
|
9193 |
-
// 'rgba(${interpolations[0](input)}, ${interpolations[1](input)}, ...'
|
9194 |
-
.replace(stringShapeRegex, function () {
|
9195 |
-
return interpolations[i++](input);
|
9196 |
-
}) // rgba requires that the r,g,b are integers.... so we want to round them, but we *dont* want to
|
9197 |
-
// round the opacity (4th column).
|
9198 |
-
.replace(/rgba\(([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+)\)/gi, function (_, p1, p2, p3, p4) {
|
9199 |
-
return "rgba(" + Math.round(p1) + ", " + Math.round(p2) + ", " + Math.round(p3) + ", " + p4 + ")";
|
9200 |
});
|
9201 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9202 |
};
|
9203 |
|
9204 |
-
var
|
9205 |
-
|
9206 |
-
|
9207 |
-
|
9208 |
-
|
9209 |
-
|
9210 |
-
|
9211 |
-
|
9212 |
-
columnCount: true,
|
9213 |
-
columns: true,
|
9214 |
-
flex: true,
|
9215 |
-
flexGrow: true,
|
9216 |
-
flexPositive: true,
|
9217 |
-
flexShrink: true,
|
9218 |
-
flexNegative: true,
|
9219 |
-
flexOrder: true,
|
9220 |
-
gridRow: true,
|
9221 |
-
gridRowEnd: true,
|
9222 |
-
gridRowSpan: true,
|
9223 |
-
gridRowStart: true,
|
9224 |
-
gridColumn: true,
|
9225 |
-
gridColumnEnd: true,
|
9226 |
-
gridColumnSpan: true,
|
9227 |
-
gridColumnStart: true,
|
9228 |
-
fontWeight: true,
|
9229 |
-
lineClamp: true,
|
9230 |
-
lineHeight: true,
|
9231 |
-
opacity: true,
|
9232 |
-
order: true,
|
9233 |
-
orphans: true,
|
9234 |
-
tabSize: true,
|
9235 |
-
widows: true,
|
9236 |
-
zIndex: true,
|
9237 |
-
zoom: true,
|
9238 |
-
// SVG-related properties
|
9239 |
-
fillOpacity: true,
|
9240 |
-
floodOpacity: true,
|
9241 |
-
stopOpacity: true,
|
9242 |
-
strokeDasharray: true,
|
9243 |
-
strokeDashoffset: true,
|
9244 |
-
strokeMiterlimit: true,
|
9245 |
-
strokeOpacity: true,
|
9246 |
-
strokeWidth: true
|
9247 |
-
};
|
9248 |
|
9249 |
-
var
|
9250 |
-
|
9251 |
-
};
|
9252 |
|
9253 |
-
|
9254 |
-
|
9255 |
-
|
9256 |
-
return acc[prefixKey(prefix, prop)] = acc[prop];
|
9257 |
-
});
|
9258 |
-
return acc;
|
9259 |
-
}, isUnitlessNumber);
|
9260 |
|
9261 |
-
|
9262 |
-
|
9263 |
-
|
|
|
|
|
|
|
9264 |
|
9265 |
-
|
9266 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9267 |
|
9268 |
-
var
|
9269 |
-
|
9270 |
-
|
9271 |
-
|
9272 |
-
|
9273 |
-
injectStringInterpolator(createStringInterpolator);
|
9274 |
-
injectColorNames(colors);
|
9275 |
-
injectApplyAnimatedValues(function (instance, props) {
|
9276 |
-
if (instance.nodeType && instance.setAttribute !== undefined) {
|
9277 |
-
var style = props.style,
|
9278 |
-
children = props.children,
|
9279 |
-
scrollTop = props.scrollTop,
|
9280 |
-
scrollLeft = props.scrollLeft,
|
9281 |
-
attributes = _objectWithoutPropertiesLoose(props, ["style", "children", "scrollTop", "scrollLeft"]);
|
9282 |
|
9283 |
-
var filter = instance.nodeName === 'filter' || instance.parentNode && instance.parentNode.nodeName === 'filter';
|
9284 |
-
if (scrollTop !== void 0) instance.scrollTop = scrollTop;
|
9285 |
-
if (scrollLeft !== void 0) instance.scrollLeft = scrollLeft; // Set textContent, if children is an animatable value
|
9286 |
|
9287 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9288 |
|
9289 |
-
|
9290 |
-
|
9291 |
-
var isCustomProperty = styleName.indexOf('--') === 0;
|
9292 |
-
var styleValue = dangerousStyleValue(styleName, style[styleName], isCustomProperty);
|
9293 |
-
if (styleName === 'float') styleName = 'cssFloat';
|
9294 |
-
if (isCustomProperty) instance.style.setProperty(styleName, styleValue);else instance.style[styleName] = styleValue;
|
9295 |
-
} // Set attributes ...
|
9296 |
|
|
|
|
|
|
|
9297 |
|
9298 |
-
|
9299 |
-
|
9300 |
-
|
9301 |
-
|
9302 |
-
|
9303 |
-
|
|
|
|
|
|
|
|
|
9304 |
}
|
9305 |
|
9306 |
-
|
9307 |
-
|
9308 |
-
}, function (style) {
|
9309 |
-
return style;
|
9310 |
-
});
|
9311 |
|
9312 |
-
var
|
9313 |
-
|
9314 |
-
|
9315 |
-
|
9316 |
-
var extendedAnimated = apply(domElements);
|
9317 |
|
9318 |
-
|
9319 |
-
|
9320 |
-
exports.update = update;
|
9321 |
-
exports.animated = extendedAnimated;
|
9322 |
-
exports.a = extendedAnimated;
|
9323 |
-
exports.interpolate = interpolate$1;
|
9324 |
-
exports.Globals = Globals;
|
9325 |
-
exports.useSpring = useSpring;
|
9326 |
-
exports.useTrail = useTrail;
|
9327 |
-
exports.useTransition = useTransition;
|
9328 |
-
exports.useChain = useChain;
|
9329 |
-
exports.useSprings = useSprings;
|
9330 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9331 |
|
9332 |
-
|
|
|
|
|
|
|
|
|
9333 |
|
9334 |
-
/***/ 258:
|
9335 |
-
/***/ (function(module, exports, __webpack_require__) {
|
9336 |
|
9337 |
-
|
|
|
|
|
|
|
|
|
9338 |
|
9339 |
-
|
9340 |
-
|
9341 |
-
|
9342 |
-
|
9343 |
-
|
9344 |
-
|
9345 |
-
|
9346 |
-
|
|
|
|
|
|
|
|
|
|
|
9347 |
|
9348 |
-
|
9349 |
-
* The main path matching regexp utility.
|
9350 |
-
*
|
9351 |
-
* @type {RegExp}
|
9352 |
-
*/
|
9353 |
-
var PATH_REGEXP = new RegExp([
|
9354 |
-
// Match escaped characters that would otherwise appear in future matches.
|
9355 |
-
// This allows the user to escape special characters that won't transform.
|
9356 |
-
'(\\\\.)',
|
9357 |
-
// Match Express-style parameters and un-named parameters with a prefix
|
9358 |
-
// and optional suffixes. Matches appear as:
|
9359 |
-
//
|
9360 |
-
// "/:test(\\d+)?" => ["/", "test", "\d+", undefined, "?", undefined]
|
9361 |
-
// "/route(\\d+)" => [undefined, undefined, undefined, "\d+", undefined, undefined]
|
9362 |
-
// "/*" => ["/", undefined, undefined, undefined, undefined, "*"]
|
9363 |
-
'([\\/.])?(?:(?:\\:(\\w+)(?:\\(((?:\\\\.|[^\\\\()])+)\\))?|\\(((?:\\\\.|[^\\\\()])+)\\))([+*?])?|(\\*))'
|
9364 |
-
].join('|'), 'g')
|
9365 |
|
9366 |
-
|
9367 |
-
* Parse a string for the raw tokens.
|
9368 |
-
*
|
9369 |
-
* @param {string} str
|
9370 |
-
* @param {Object=} options
|
9371 |
-
* @return {!Array}
|
9372 |
-
*/
|
9373 |
-
function parse (str, options) {
|
9374 |
-
var tokens = []
|
9375 |
-
var key = 0
|
9376 |
-
var index = 0
|
9377 |
-
var path = ''
|
9378 |
-
var defaultDelimiter = options && options.delimiter || '/'
|
9379 |
-
var res
|
9380 |
|
9381 |
-
|
9382 |
-
|
9383 |
-
|
9384 |
-
|
9385 |
-
|
9386 |
-
|
|
|
9387 |
|
9388 |
-
// Ignore already escaped sequences.
|
9389 |
-
if (escaped) {
|
9390 |
-
path += escaped[1]
|
9391 |
-
continue
|
9392 |
-
}
|
9393 |
|
9394 |
-
|
9395 |
-
|
9396 |
-
|
9397 |
-
|
9398 |
-
|
9399 |
-
|
9400 |
-
|
9401 |
|
9402 |
-
// Push the current path onto the tokens.
|
9403 |
-
if (path) {
|
9404 |
-
tokens.push(path)
|
9405 |
-
path = ''
|
9406 |
-
}
|
9407 |
|
9408 |
-
|
9409 |
-
var repeat = modifier === '+' || modifier === '*'
|
9410 |
-
var optional = modifier === '?' || modifier === '*'
|
9411 |
-
var delimiter = res[2] || defaultDelimiter
|
9412 |
-
var pattern = capture || group
|
9413 |
|
9414 |
-
|
9415 |
-
|
9416 |
-
|
9417 |
-
|
9418 |
-
|
9419 |
-
repeat: repeat,
|
9420 |
-
partial: partial,
|
9421 |
-
asterisk: !!asterisk,
|
9422 |
-
pattern: pattern ? escapeGroup(pattern) : (asterisk ? '.*' : '[^' + escapeString(delimiter) + ']+?')
|
9423 |
-
})
|
9424 |
-
}
|
9425 |
|
9426 |
-
|
9427 |
-
|
9428 |
-
|
9429 |
-
}
|
9430 |
|
9431 |
-
// If the path exists, push it onto the end.
|
9432 |
-
if (path) {
|
9433 |
-
tokens.push(path)
|
9434 |
-
}
|
9435 |
|
9436 |
-
|
9437 |
-
}
|
9438 |
|
9439 |
-
/**
|
9440 |
-
* Compile a string to a template function for the path.
|
9441 |
-
*
|
9442 |
-
* @param {string} str
|
9443 |
-
* @param {Object=} options
|
9444 |
-
* @return {!function(Object=, Object=)}
|
9445 |
-
*/
|
9446 |
-
function compile (str, options) {
|
9447 |
-
return tokensToFunction(parse(str, options), options)
|
9448 |
-
}
|
9449 |
|
9450 |
-
|
9451 |
-
* Prettier encoding of URI path segments.
|
9452 |
-
*
|
9453 |
-
* @param {string}
|
9454 |
-
* @return {string}
|
9455 |
-
*/
|
9456 |
-
function encodeURIComponentPretty (str) {
|
9457 |
-
return encodeURI(str).replace(/[\/?#]/g, function (c) {
|
9458 |
-
return '%' + c.charCodeAt(0).toString(16).toUpperCase()
|
9459 |
-
})
|
9460 |
-
}
|
9461 |
|
9462 |
-
|
9463 |
-
|
9464 |
-
|
9465 |
-
|
9466 |
-
|
9467 |
-
*/
|
9468 |
-
function encodeAsterisk (str) {
|
9469 |
-
return encodeURI(str).replace(/[?#]/g, function (c) {
|
9470 |
-
return '%' + c.charCodeAt(0).toString(16).toUpperCase()
|
9471 |
-
})
|
9472 |
-
}
|
9473 |
|
9474 |
-
/**
|
9475 |
-
* Expose a method for transforming tokens into the path function.
|
9476 |
-
*/
|
9477 |
-
function tokensToFunction (tokens, options) {
|
9478 |
-
// Compile all the tokens into regexps.
|
9479 |
-
var matches = new Array(tokens.length)
|
9480 |
|
9481 |
-
|
9482 |
-
|
9483 |
-
|
9484 |
-
|
9485 |
-
}
|
9486 |
}
|
9487 |
|
9488 |
-
return
|
9489 |
-
|
9490 |
-
var data = obj || {}
|
9491 |
-
var options = opts || {}
|
9492 |
-
var encode = options.pretty ? encodeURIComponentPretty : encodeURIComponent
|
9493 |
|
9494 |
-
|
9495 |
-
|
9496 |
|
9497 |
-
|
9498 |
-
|
|
|
|
|
|
|
9499 |
|
9500 |
-
|
9501 |
-
|
|
|
9502 |
|
9503 |
-
|
9504 |
-
|
|
|
|
|
9505 |
|
9506 |
-
|
9507 |
-
|
9508 |
-
|
9509 |
-
|
9510 |
-
|
9511 |
-
|
|
|
9512 |
|
9513 |
-
|
9514 |
-
|
9515 |
-
|
9516 |
-
}
|
9517 |
-
}
|
9518 |
|
9519 |
-
|
9520 |
-
|
9521 |
-
|
9522 |
-
|
|
|
9523 |
|
9524 |
-
|
9525 |
-
|
9526 |
-
|
9527 |
-
} else {
|
9528 |
-
throw new TypeError('Expected "' + token.name + '" to not be empty')
|
9529 |
-
}
|
9530 |
-
}
|
9531 |
|
9532 |
-
|
9533 |
-
|
|
|
|
|
|
|
9534 |
|
9535 |
-
|
9536 |
-
|
9537 |
-
}
|
9538 |
|
9539 |
-
|
9540 |
-
|
|
|
9541 |
|
9542 |
-
|
9543 |
-
|
|
|
9544 |
|
9545 |
-
|
|
|
9546 |
|
9547 |
-
|
9548 |
-
throw new TypeError('Expected "' + token.name + '" to match "' + token.pattern + '", but received "' + segment + '"')
|
9549 |
-
}
|
9550 |
|
9551 |
-
|
9552 |
-
}
|
9553 |
|
9554 |
-
|
9555 |
-
|
9556 |
}
|
9557 |
|
9558 |
-
|
9559 |
-
|
9560 |
-
|
9561 |
-
|
9562 |
-
* @return {string}
|
9563 |
-
*/
|
9564 |
-
function escapeString (str) {
|
9565 |
-
return str.replace(/([.+*?=^!:${}()[\]|\/\\])/g, '\\$1')
|
9566 |
-
}
|
9567 |
|
9568 |
-
|
9569 |
-
* Escape the capturing group by escaping special characters and meaning.
|
9570 |
-
*
|
9571 |
-
* @param {string} group
|
9572 |
-
* @return {string}
|
9573 |
-
*/
|
9574 |
-
function escapeGroup (group) {
|
9575 |
-
return group.replace(/([=!:$\/()])/g, '\\$1')
|
9576 |
}
|
9577 |
|
9578 |
-
|
9579 |
-
|
9580 |
-
|
9581 |
-
|
9582 |
-
* @param {Array} keys
|
9583 |
-
* @return {!RegExp}
|
9584 |
-
*/
|
9585 |
-
function attachKeys (re, keys) {
|
9586 |
-
re.keys = keys
|
9587 |
-
return re
|
9588 |
-
}
|
9589 |
|
9590 |
-
|
9591 |
-
|
9592 |
-
*
|
9593 |
-
* @param {Object} options
|
9594 |
-
* @return {string}
|
9595 |
-
*/
|
9596 |
-
function flags (options) {
|
9597 |
-
return options && options.sensitive ? '' : 'i'
|
9598 |
-
}
|
9599 |
|
9600 |
-
|
9601 |
-
|
9602 |
-
|
9603 |
-
|
9604 |
-
|
9605 |
-
* @return {!RegExp}
|
9606 |
-
*/
|
9607 |
-
function regexpToRegexp (path, keys) {
|
9608 |
-
// Use a negative lookahead to match only capturing groups.
|
9609 |
-
var groups = path.source.match(/\((?!\?)/g)
|
9610 |
-
|
9611 |
-
if (groups) {
|
9612 |
-
for (var i = 0; i < groups.length; i++) {
|
9613 |
-
keys.push({
|
9614 |
-
name: i,
|
9615 |
-
prefix: null,
|
9616 |
-
delimiter: null,
|
9617 |
-
optional: false,
|
9618 |
-
repeat: false,
|
9619 |
-
partial: false,
|
9620 |
-
asterisk: false,
|
9621 |
-
pattern: null
|
9622 |
-
})
|
9623 |
-
}
|
9624 |
}
|
9625 |
|
9626 |
-
|
9627 |
-
}
|
9628 |
|
9629 |
-
|
9630 |
-
|
9631 |
-
|
9632 |
-
|
9633 |
-
|
9634 |
-
|
9635 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9636 |
*/
|
9637 |
-
function arrayToRegexp (path, keys, options) {
|
9638 |
-
var parts = []
|
9639 |
|
9640 |
-
|
9641 |
-
|
|
|
9642 |
}
|
9643 |
|
9644 |
-
var
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9645 |
|
9646 |
-
|
9647 |
-
|
9648 |
|
9649 |
-
|
9650 |
-
|
9651 |
-
|
9652 |
-
|
9653 |
-
|
9654 |
-
|
9655 |
-
|
9656 |
-
|
9657 |
-
|
9658 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9659 |
}
|
9660 |
|
9661 |
/**
|
9662 |
-
*
|
|
|
9663 |
*
|
9664 |
-
*
|
9665 |
-
*
|
9666 |
-
*
|
9667 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9668 |
*/
|
9669 |
-
function
|
9670 |
-
if (
|
9671 |
-
|
9672 |
-
|
|
|
|
|
|
|
9673 |
}
|
|
|
9674 |
|
9675 |
-
|
|
|
|
|
|
|
9676 |
|
9677 |
-
|
9678 |
-
|
9679 |
-
var route = ''
|
9680 |
|
9681 |
-
|
9682 |
-
|
9683 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
9684 |
|
9685 |
-
|
9686 |
-
|
9687 |
-
|
9688 |
-
|
9689 |
-
var capture = '(?:' + token.pattern + ')'
|
9690 |
|
9691 |
-
|
|
|
|
|
9692 |
|
9693 |
-
|
9694 |
-
|
9695 |
-
|
|
|
|
|
9696 |
|
9697 |
-
|
9698 |
-
if (!token.partial) {
|
9699 |
-
capture = '(?:' + prefix + '(' + capture + '))?'
|
9700 |
-
} else {
|
9701 |
-
capture = prefix + '(' + capture + ')?'
|
9702 |
-
}
|
9703 |
-
} else {
|
9704 |
-
capture = prefix + '(' + capture + ')'
|
9705 |
-
}
|
9706 |
|
9707 |
-
|
|
|
|
|
9708 |
}
|
9709 |
-
}
|
9710 |
|
9711 |
-
|
9712 |
-
|
|
|
|
|
9713 |
|
9714 |
-
|
9715 |
-
|
9716 |
-
|
9717 |
-
// in non-ending mode, where "/test/" shouldn't match "/test//route".
|
9718 |
-
if (!strict) {
|
9719 |
-
route = (endsWithDelimiter ? route.slice(0, -delimiter.length) : route) + '(?:' + delimiter + '(?=$))?'
|
9720 |
-
}
|
9721 |
|
9722 |
-
|
9723 |
-
|
9724 |
-
}
|
9725 |
-
// In non-ending mode, we need the capturing groups to match as much as
|
9726 |
-
// possible by using a positive lookahead to the end or next path segment.
|
9727 |
-
route += strict && endsWithDelimiter ? '' : '(?=' + delimiter + '|$)'
|
9728 |
-
}
|
9729 |
|
9730 |
-
|
9731 |
-
|
|
|
9732 |
|
9733 |
-
|
9734 |
-
|
9735 |
-
*
|
9736 |
-
* An empty array can be passed in for the keys, which will hold the
|
9737 |
-
* placeholder key descriptions. For example, using `/user/:id`, `keys` will
|
9738 |
-
* contain `[{ name: 'id', delimiter: '/', optional: false, repeat: false }]`.
|
9739 |
-
*
|
9740 |
-
* @param {(string|RegExp|Array)} path
|
9741 |
-
* @param {(Array|Object)=} keys
|
9742 |
-
* @param {Object=} options
|
9743 |
-
* @return {!RegExp}
|
9744 |
-
*/
|
9745 |
-
function pathToRegexp (path, keys, options) {
|
9746 |
-
if (!isarray(keys)) {
|
9747 |
-
options = /** @type {!Object} */ (keys || options)
|
9748 |
-
keys = []
|
9749 |
-
}
|
9750 |
|
9751 |
-
|
|
|
|
|
|
|
9752 |
|
9753 |
-
|
9754 |
-
|
9755 |
-
}
|
9756 |
|
9757 |
-
|
9758 |
-
|
|
|
|
|
|
|
9759 |
}
|
9760 |
|
9761 |
-
|
9762 |
-
}
|
9763 |
|
|
|
|
|
9764 |
|
9765 |
-
|
|
|
|
|
9766 |
|
9767 |
-
|
9768 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9769 |
|
9770 |
-
|
9771 |
-
|
9772 |
-
|
|
|
|
|
9773 |
|
|
|
|
|
|
|
9774 |
|
9775 |
-
|
|
|
9776 |
|
9777 |
-
|
9778 |
-
root = self;
|
9779 |
-
} else if (typeof window !== 'undefined') {
|
9780 |
-
root = window;
|
9781 |
-
} else if (typeof global !== 'undefined') {
|
9782 |
-
root = global;
|
9783 |
-
} else if (true) {
|
9784 |
-
root = module;
|
9785 |
-
} else {}
|
9786 |
|
9787 |
-
var
|
9788 |
-
|
|
|
|
|
|
|
9789 |
|
9790 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9791 |
|
9792 |
-
|
|
|
|
|
9793 |
|
9794 |
-
|
9795 |
-
|
|
|
|
|
|
|
9796 |
|
9797 |
-
function _getPrototypeOf(o) {
|
9798 |
-
module.exports = _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
|
9799 |
-
return o.__proto__ || Object.getPrototypeOf(o);
|
9800 |
-
};
|
9801 |
-
return _getPrototypeOf(o);
|
9802 |
-
}
|
9803 |
|
9804 |
-
|
9805 |
|
9806 |
-
|
|
|
|
|
9807 |
|
9808 |
-
|
9809 |
-
|
|
|
|
|
|
|
9810 |
|
9811 |
-
|
9812 |
-
|
9813 |
-
|
9814 |
-
|
9815 |
-
|
9816 |
-
|
9817 |
-
|
9818 |
-
|
9819 |
-
|
9820 |
-
|
9821 |
-
|
9822 |
-
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(0);
|
9823 |
-
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_5__);
|
9824 |
-
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(3);
|
9825 |
-
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_6__);
|
9826 |
-
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(1);
|
9827 |
-
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_7__);
|
9828 |
-
/* harmony import */ var _woocommerce_components__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(53);
|
9829 |
-
/* harmony import */ var _woocommerce_components__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_woocommerce_components__WEBPACK_IMPORTED_MODULE_8__);
|
9830 |
-
/* harmony import */ var _woocommerce_wc_admin_settings__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(23);
|
9831 |
|
|
|
|
|
9832 |
|
|
|
|
|
|
|
|
|
|
|
9833 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9834 |
|
9835 |
|
|
|
|
|
|
|
9836 |
|
|
|
|
|
|
|
|
|
|
|
|
|
9837 |
|
9838 |
-
|
|
|
9839 |
|
9840 |
-
|
|
|
|
|
9841 |
|
9842 |
-
|
9843 |
-
|
9844 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9845 |
|
9846 |
|
|
|
|
|
|
|
9847 |
|
9848 |
-
|
9849 |
-
|
9850 |
-
|
9851 |
|
|
|
|
|
|
|
|
|
|
|
9852 |
|
|
|
|
|
9853 |
|
9854 |
-
/**
|
9855 |
-
* Component to render when there is an error in a report component due to data
|
9856 |
-
* not being loaded or being invalid.
|
9857 |
-
*/
|
9858 |
|
9859 |
-
var
|
9860 |
-
_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default()(ReportError, _Component);
|
9861 |
|
9862 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9863 |
|
9864 |
-
|
9865 |
-
|
9866 |
|
9867 |
-
return
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9868 |
}
|
|
|
|
|
9869 |
|
9870 |
-
|
9871 |
-
|
9872 |
-
|
9873 |
-
|
9874 |
-
|
9875 |
-
isError = _this$props.isError,
|
9876 |
-
isEmpty = _this$props.isEmpty;
|
9877 |
-
var title, actionLabel, actionURL, actionCallback;
|
9878 |
-
|
9879 |
-
if (isError) {
|
9880 |
-
title = Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_6__["__"])('There was an error getting your stats. Please try again.', 'woocommerce-admin');
|
9881 |
-
actionLabel = Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_6__["__"])('Reload', 'woocommerce-admin');
|
9882 |
-
|
9883 |
-
actionCallback = function actionCallback() {
|
9884 |
-
// @todo Add tracking for how often an error is displayed, and the reload action is clicked.
|
9885 |
-
window.location.reload();
|
9886 |
-
};
|
9887 |
-
} else if (isEmpty) {
|
9888 |
-
title = Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_6__["__"])('No results could be found for this date range.', 'woocommerce-admin');
|
9889 |
-
actionLabel = Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_6__["__"])('View Orders', 'woocommerce-admin');
|
9890 |
-
actionURL = Object(_woocommerce_wc_admin_settings__WEBPACK_IMPORTED_MODULE_9__[/* getAdminLink */ "f"])('edit.php?post_type=shop_order');
|
9891 |
-
}
|
9892 |
-
|
9893 |
-
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_5__["createElement"])(_woocommerce_components__WEBPACK_IMPORTED_MODULE_8__["EmptyContent"], {
|
9894 |
-
className: className,
|
9895 |
-
title: title,
|
9896 |
-
actionLabel: actionLabel,
|
9897 |
-
actionURL: actionURL,
|
9898 |
-
actionCallback: actionCallback
|
9899 |
-
});
|
9900 |
-
}
|
9901 |
-
}]);
|
9902 |
-
|
9903 |
-
return ReportError;
|
9904 |
-
}(_wordpress_element__WEBPACK_IMPORTED_MODULE_5__["Component"]);
|
9905 |
-
|
9906 |
-
ReportError.propTypes = {
|
9907 |
-
/**
|
9908 |
-
* Additional class name to style the component.
|
9909 |
-
*/
|
9910 |
-
className: prop_types__WEBPACK_IMPORTED_MODULE_7___default.a.string,
|
9911 |
-
|
9912 |
-
/**
|
9913 |
-
* Boolean representing whether there was an error.
|
9914 |
-
*/
|
9915 |
-
isError: prop_types__WEBPACK_IMPORTED_MODULE_7___default.a.bool,
|
9916 |
|
9917 |
-
|
9918 |
-
|
9919 |
-
*/
|
9920 |
-
isEmpty: prop_types__WEBPACK_IMPORTED_MODULE_7___default.a.bool
|
9921 |
-
};
|
9922 |
-
ReportError.defaultProps = {
|
9923 |
-
className: ''
|
9924 |
-
};
|
9925 |
-
/* harmony default export */ __webpack_exports__["a"] = (ReportError);
|
9926 |
|
9927 |
-
|
|
|
9928 |
|
9929 |
-
|
9930 |
-
|
9931 |
|
9932 |
-
|
9933 |
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return getUrlParams; });
|
9934 |
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return getScreenName; });
|
9935 |
-
/**
|
9936 |
-
* Get the URL params.
|
9937 |
-
*
|
9938 |
-
* @param {string} locationSearch - Querystring part of a URL, including the question mark (?).
|
9939 |
-
* @return {Object} - URL params.
|
9940 |
-
*/
|
9941 |
-
function getUrlParams(locationSearch) {
|
9942 |
-
if (locationSearch) {
|
9943 |
-
return locationSearch.substr(1).split('&').reduce(function (params, query) {
|
9944 |
-
var chunks = query.split('=');
|
9945 |
-
var key = chunks[0];
|
9946 |
-
var value = decodeURIComponent(chunks[1]);
|
9947 |
-
value = isNaN(Number(value)) ? value : Number(value);
|
9948 |
-
return params[key] = value, params;
|
9949 |
-
}, {});
|
9950 |
-
}
|
9951 |
|
9952 |
-
|
9953 |
-
|
9954 |
-
|
9955 |
-
* Get the current screen name.
|
9956 |
-
*
|
9957 |
-
* @return {string} - Screen name.
|
9958 |
-
*/
|
9959 |
|
9960 |
-
|
9961 |
-
var screenName = '';
|
9962 |
|
9963 |
-
|
9964 |
-
|
9965 |
-
|
9966 |
-
|
|
|
|
|
|
|
|
|
9967 |
|
9968 |
-
|
9969 |
-
|
9970 |
-
|
9971 |
-
|
9972 |
-
|
9973 |
-
|
|
|
|
|
|
|
|
|
9974 |
|
9975 |
-
|
9976 |
-
|
9977 |
|
9978 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9979 |
|
9980 |
-
|
9981 |
-
|
|
|
|
|
|
|
|
|
9982 |
|
9983 |
-
|
|
|
9984 |
|
9985 |
-
|
|
|
9986 |
|
9987 |
-
|
9988 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9989 |
|
9990 |
-
|
|
|
|
|
|
|
|
|
9991 |
|
9992 |
-
// EXPORTS
|
9993 |
-
__webpack_require__.d(__webpack_exports__, "a", function() { return /* binding */ DEFAULT_ACTIONABLE_STATUSES; });
|
9994 |
-
__webpack_require__.d(__webpack_exports__, "b", function() { return /* binding */ config; });
|
9995 |
|
9996 |
-
|
|
|
9997 |
|
9998 |
-
//
|
9999 |
-
var external_this_wp_element_ = __webpack_require__(0);
|
10000 |
|
10001 |
-
|
10002 |
-
var
|
|
|
|
|
|
|
10003 |
|
10004 |
-
|
10005 |
-
var
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10006 |
|
10007 |
-
|
10008 |
-
var
|
10009 |
-
|
|
|
|
|
|
|
|
|
|
|
10010 |
|
10011 |
-
|
10012 |
-
var
|
10013 |
|
10014 |
-
//
|
10015 |
-
|
|
|
|
|
10016 |
|
10017 |
-
|
10018 |
-
|
|
|
|
|
10019 |
|
10020 |
-
|
10021 |
-
|
|
|
10022 |
|
10023 |
-
|
10024 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10025 |
|
10026 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10027 |
|
|
|
|
|
|
|
10028 |
|
10029 |
-
|
10030 |
-
|
10031 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10032 |
|
10033 |
-
|
10034 |
-
|
10035 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10036 |
|
|
|
|
|
|
|
|
|
|
|
|
|
10037 |
|
10038 |
-
|
10039 |
-
|
10040 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10041 |
|
|
|
|
|
10042 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10043 |
|
|
|
|
|
10044 |
|
10045 |
-
|
10046 |
-
|
10047 |
-
|
|
|
10048 |
|
10049 |
-
|
10050 |
-
|
|
|
|
|
10051 |
|
10052 |
-
var
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10053 |
|
10054 |
-
|
10055 |
-
|
10056 |
-
|
10057 |
-
|
10058 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10059 |
}
|
10060 |
-
});
|
10061 |
-
};
|
10062 |
|
10063 |
-
|
|
|
10064 |
|
10065 |
-
var
|
10066 |
-
|
10067 |
-
|
10068 |
-
|
10069 |
-
|
|
|
|
|
|
|
10070 |
|
10071 |
-
|
10072 |
-
|
10073 |
-
|
|
|
|
|
|
|
|
|
10074 |
|
10075 |
-
|
10076 |
-
|
10077 |
-
|
10078 |
-
|
10079 |
-
|
10080 |
-
|
10081 |
-
|
10082 |
-
|
10083 |
-
|
10084 |
-
|
10085 |
-
onRangeSelect: change,
|
10086 |
-
dateQuery: dateQuery,
|
10087 |
-
isoDateFormat: date["k" /* isoDateFormat */]
|
10088 |
});
|
|
|
|
|
|
|
|
|
|
|
10089 |
};
|
10090 |
|
10091 |
-
|
10092 |
-
|
|
|
|
|
10093 |
|
|
|
|
|
10094 |
|
10095 |
-
|
10096 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10097 |
*/
|
10098 |
|
|
|
|
|
|
|
|
|
|
|
10099 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10100 |
|
10101 |
|
10102 |
-
|
10103 |
-
|
10104 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10105 |
|
|
|
|
|
|
|
10106 |
|
10107 |
-
|
10108 |
-
|
10109 |
-
|
10110 |
-
|
10111 |
-
|
10112 |
-
return status !== 'refunded';
|
10113 |
-
}).map(function (key) {
|
10114 |
-
return {
|
10115 |
-
value: key,
|
10116 |
-
label: settings["d" /* ORDER_STATUSES */][key],
|
10117 |
-
description: Object(external_this_wp_i18n_["sprintf"])(Object(external_this_wp_i18n_["__"])('Exclude the %s status from reports', 'woocommerce-admin'), settings["d" /* ORDER_STATUSES */][key])
|
10118 |
-
};
|
10119 |
-
});
|
10120 |
-
var unregisteredOrderStatuses = Object(settings["g" /* getSetting */])('unregisteredOrderStatuses', {});
|
10121 |
-
var orderStatusOptions = [{
|
10122 |
-
key: 'defaultStatuses',
|
10123 |
-
options: filteredOrderStatuses.filter(function (status) {
|
10124 |
-
return DEFAULT_ORDER_STATUSES.includes(status.value);
|
10125 |
-
})
|
10126 |
-
}, {
|
10127 |
-
key: 'customStatuses',
|
10128 |
-
label: Object(external_this_wp_i18n_["__"])('Custom Statuses', 'woocommerce-admin'),
|
10129 |
-
options: filteredOrderStatuses.filter(function (status) {
|
10130 |
-
return !DEFAULT_ORDER_STATUSES.includes(status.value);
|
10131 |
-
})
|
10132 |
-
}, {
|
10133 |
-
key: 'unregisteredStatuses',
|
10134 |
-
label: Object(external_this_wp_i18n_["__"])('Unregistered Statuses', 'woocommerce-admin'),
|
10135 |
-
options: Object.keys(unregisteredOrderStatuses).map(function (key) {
|
10136 |
-
return {
|
10137 |
-
value: key,
|
10138 |
-
label: key,
|
10139 |
-
description: Object(external_this_wp_i18n_["sprintf"])(Object(external_this_wp_i18n_["__"])('Exclude the %s status from reports', 'woocommerce-admin'), key)
|
10140 |
-
};
|
10141 |
-
})
|
10142 |
-
}];
|
10143 |
-
var config = Object(external_this_wp_hooks_["applyFilters"])(SETTINGS_FILTER, {
|
10144 |
-
woocommerce_excluded_report_order_statuses: {
|
10145 |
-
label: Object(external_this_wp_i18n_["__"])('Excluded Statuses:', 'woocommerce-admin'),
|
10146 |
-
inputType: 'checkboxGroup',
|
10147 |
-
options: orderStatusOptions,
|
10148 |
-
helpText: lib_default()({
|
10149 |
-
mixedString: Object(external_this_wp_i18n_["__"])('Orders with these statuses are excluded from the totals in your reports. ' + 'The {{strong}}Refunded{{/strong}} status can not be excluded.', 'woocommerce-admin'),
|
10150 |
-
components: {
|
10151 |
-
strong: Object(external_this_wp_element_["createElement"])("strong", null)
|
10152 |
-
}
|
10153 |
-
}),
|
10154 |
-
defaultValue: ['pending', 'cancelled', 'failed']
|
10155 |
-
},
|
10156 |
-
woocommerce_actionable_order_statuses: {
|
10157 |
-
label: Object(external_this_wp_i18n_["__"])('Actionable Statuses:', 'woocommerce-admin'),
|
10158 |
-
inputType: 'checkboxGroup',
|
10159 |
-
options: orderStatusOptions,
|
10160 |
-
helpText: Object(external_this_wp_i18n_["__"])('Orders with these statuses require action on behalf of the store admin.' + 'These orders will show up in the Orders tab under the activity panel.', 'woocommerce-admin'),
|
10161 |
-
defaultValue: DEFAULT_ACTIONABLE_STATUSES
|
10162 |
-
},
|
10163 |
-
woocommerce_default_date_range: {
|
10164 |
-
name: 'woocommerce_default_date_range',
|
10165 |
-
label: Object(external_this_wp_i18n_["__"])('Default Date Range:', 'woocommerce-admin'),
|
10166 |
-
inputType: 'component',
|
10167 |
-
component: default_date,
|
10168 |
-
helpText: Object(external_this_wp_i18n_["__"])('Select a default date range. When no range is selected, reports will be viewed by ' + 'the default date range.', 'woocommerce-admin'),
|
10169 |
-
defaultValue: DEFAULT_DATE_RANGE
|
10170 |
-
}
|
10171 |
-
});
|
10172 |
|
10173 |
-
|
|
|
|
|
|
|
10174 |
|
10175 |
-
|
10176 |
-
|
|
|
|
|
10177 |
|
10178 |
-
function
|
10179 |
-
|
10180 |
-
|
10181 |
-
var sourceKeys = Object.keys(source);
|
10182 |
-
var key, i;
|
10183 |
|
10184 |
-
|
10185 |
-
|
10186 |
-
|
10187 |
-
|
10188 |
-
|
|
|
|
|
10189 |
|
10190 |
-
|
10191 |
-
|
|
|
|
|
|
|
|
|
10192 |
|
10193 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
10194 |
|
10195 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10196 |
|
10197 |
-
|
10198 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10199 |
|
10200 |
-
|
10201 |
-
|
10202 |
-
|
10203 |
-
|
10204 |
-
|
10205 |
-
|
10206 |
|
|
|
|
|
10207 |
|
10208 |
-
|
10209 |
|
10210 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10211 |
|
10212 |
-
|
10213 |
-
* External dependencies
|
10214 |
-
*/
|
10215 |
|
10216 |
-
|
10217 |
-
|
10218 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10219 |
|
10220 |
-
/**
|
10221 |
-
* Returns leaderboard data to render a leaderboard table.
|
10222 |
-
*
|
10223 |
-
* @param {Object} options arguments
|
10224 |
-
* @param {string} options.id Leaderboard ID
|
10225 |
-
* @param {number} options.per_page Per page limit
|
10226 |
-
* @param {Object} options.persisted_query Persisted query passed to endpoint
|
10227 |
-
* @param {Object} options.query Query parameters in the url
|
10228 |
-
* @param {Object} options.select Instance of @wordpress/select
|
10229 |
-
* @param {string} options.defaultDateRange User specified default date range.
|
10230 |
-
* @return {Object} Object containing leaderboard responses.
|
10231 |
-
*/
|
10232 |
|
10233 |
-
|
10234 |
-
|
10235 |
-
|
10236 |
-
|
10237 |
-
|
10238 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10239 |
|
10240 |
-
|
10241 |
-
getItems = _select.getItems,
|
10242 |
-
getItemsError = _select.getItemsError,
|
10243 |
-
isGetItemsRequesting = _select.isGetItemsRequesting;
|
10244 |
|
10245 |
-
|
10246 |
-
|
10247 |
-
isError: false,
|
10248 |
-
rows: []
|
10249 |
-
};
|
10250 |
-
var datesFromQuery = Object(lib_date__WEBPACK_IMPORTED_MODULE_1__[/* getCurrentDates */ "f"])(query, options.defaultDateRange);
|
10251 |
-
var leaderboardQuery = {
|
10252 |
-
after: Object(lib_date__WEBPACK_IMPORTED_MODULE_1__[/* appendTimestamp */ "a"])(datesFromQuery.primary.after, 'start'),
|
10253 |
-
before: Object(lib_date__WEBPACK_IMPORTED_MODULE_1__[/* appendTimestamp */ "a"])(datesFromQuery.primary.before, 'end'),
|
10254 |
-
per_page: perPage,
|
10255 |
-
persisted_query: JSON.stringify(persistedQuery)
|
10256 |
-
}; // Disable eslint rule requiring `getItems` to be defined below because the next two statements
|
10257 |
-
// depend on `getItems` to have been called.
|
10258 |
-
// eslint-disable-next-line @wordpress/no-unused-vars-before-return
|
10259 |
-
|
10260 |
-
var leaderboards = getItems(endpoint, leaderboardQuery);
|
10261 |
-
|
10262 |
-
if (isGetItemsRequesting(endpoint, leaderboardQuery)) {
|
10263 |
-
return _objectSpread(_objectSpread({}, response), {}, {
|
10264 |
-
isRequesting: true
|
10265 |
-
});
|
10266 |
-
} else if (getItemsError(endpoint, leaderboardQuery)) {
|
10267 |
-
return _objectSpread(_objectSpread({}, response), {}, {
|
10268 |
-
isError: true
|
10269 |
});
|
10270 |
}
|
10271 |
|
10272 |
-
|
10273 |
-
|
10274 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10275 |
});
|
10276 |
}
|
10277 |
-
/**
|
10278 |
-
* Returns items based on a search query.
|
10279 |
-
*
|
10280 |
-
* @param {Object} select Instance of @wordpress/select
|
10281 |
-
* @param {string} endpoint Report API Endpoint
|
10282 |
-
* @param {string[]} search Array of search strings.
|
10283 |
-
* @return {Object} Object containing API request information and the matching items.
|
10284 |
-
*/
|
10285 |
|
10286 |
-
function
|
10287 |
-
var
|
10288 |
-
getItems = _select2.getItems,
|
10289 |
-
getItemsError = _select2.getItemsError,
|
10290 |
-
isGetItemsRequesting = _select2.isGetItemsRequesting;
|
10291 |
|
10292 |
-
var
|
10293 |
-
|
10294 |
-
|
10295 |
-
|
10296 |
-
|
10297 |
-
|
10298 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10299 |
};
|
10300 |
-
var newItems = getItems(endpoint, query);
|
10301 |
-
newItems.forEach(function (item, id) {
|
10302 |
-
items[id] = item;
|
10303 |
-
});
|
10304 |
|
10305 |
-
if (
|
10306 |
-
|
|
|
|
|
10307 |
}
|
|
|
10308 |
|
10309 |
-
|
10310 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10311 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10312 |
});
|
10313 |
-
return {
|
10314 |
-
items: items,
|
10315 |
-
isRequesting: isRequesting,
|
10316 |
-
isError: isError
|
10317 |
-
};
|
10318 |
}
|
10319 |
|
10320 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10321 |
|
10322 |
-
|
10323 |
-
|
|
|
|
|
10324 |
|
10325 |
-
(
|
|
|
10326 |
|
10327 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10328 |
|
10329 |
-
|
10330 |
-
|
10331 |
|
10332 |
-
|
10333 |
|
10334 |
-
|
|
|
10335 |
|
10336 |
-
|
10337 |
-
|
10338 |
|
10339 |
-
|
10340 |
-
|
10341 |
-
function _arrayLikeToArray(arr, len) {
|
10342 |
-
if (len == null || len > arr.length) len = arr.length;
|
10343 |
|
10344 |
-
|
10345 |
-
|
10346 |
-
|
10347 |
|
10348 |
-
|
10349 |
-
|
|
|
10350 |
|
10351 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10352 |
|
10353 |
-
|
10354 |
-
|
|
|
10355 |
|
10356 |
-
"use strict";
|
10357 |
|
10358 |
-
|
10359 |
-
|
10360 |
-
__webpack_require__.d(__webpack_exports__, "b", function() { return /* binding */ ESCAPE; });
|
10361 |
-
__webpack_require__.d(__webpack_exports__, "c", function() { return /* binding */ LEFT; });
|
10362 |
-
__webpack_require__.d(__webpack_exports__, "f", function() { return /* binding */ UP; });
|
10363 |
-
__webpack_require__.d(__webpack_exports__, "d", function() { return /* binding */ RIGHT; });
|
10364 |
-
__webpack_require__.d(__webpack_exports__, "a", function() { return /* binding */ DOWN; });
|
10365 |
|
10366 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
10367 |
|
10368 |
-
|
10369 |
-
|
|
|
|
|
|
|
|
|
|
|
10370 |
|
10371 |
-
|
10372 |
-
|
|
|
|
|
|
|
|
|
|
|
10373 |
|
10374 |
-
// EXTERNAL MODULE: external "lodash"
|
10375 |
-
var external_lodash_ = __webpack_require__(2);
|
10376 |
|
10377 |
-
|
10378 |
-
var external_this_wp_i18n_ = __webpack_require__(3);
|
10379 |
|
10380 |
-
|
10381 |
-
|
10382 |
-
|
10383 |
-
|
|
|
|
|
|
|
10384 |
|
10385 |
-
|
10386 |
-
|
10387 |
-
|
10388 |
-
|
10389 |
-
|
10390 |
-
|
10391 |
-
|
10392 |
|
10393 |
-
|
10394 |
-
|
|
|
|
|
|
|
|
|
|
|
10395 |
|
10396 |
-
|
10397 |
-
return platform.indexOf('Mac') !== -1 || Object(external_lodash_["includes"])(['iPad', 'iPhone'], platform);
|
10398 |
}
|
10399 |
-
//# sourceMappingURL=platform.js.map
|
10400 |
-
// CONCATENATED MODULE: ./node_modules/@wordpress/components/node_modules/@wordpress/keycodes/build-module/index.js
|
10401 |
-
|
10402 |
-
|
10403 |
-
|
10404 |
-
/**
|
10405 |
-
* Note: The order of the modifier keys in many of the [foo]Shortcut()
|
10406 |
-
* functions in this file are intentional and should not be changed. They're
|
10407 |
-
* designed to fit with the standard menu keyboard shortcuts shown in the
|
10408 |
-
* user's platform.
|
10409 |
-
*
|
10410 |
-
* For example, on MacOS menu shortcuts will place Shift before Command, but
|
10411 |
-
* on Windows Control will usually come first. So don't provide your own
|
10412 |
-
* shortcut combos directly to keyboardShortcut().
|
10413 |
-
*/
|
10414 |
-
|
10415 |
-
/**
|
10416 |
-
* External dependencies
|
10417 |
-
*/
|
10418 |
|
10419 |
-
|
10420 |
-
|
10421 |
-
|
10422 |
-
|
10423 |
-
|
10424 |
-
|
10425 |
-
|
10426 |
-
|
10427 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10428 |
|
10429 |
-
|
10430 |
-
|
10431 |
-
|
|
|
|
|
|
|
10432 |
|
10433 |
-
|
10434 |
-
|
10435 |
-
|
10436 |
-
|
10437 |
-
* @typedef {Record<WPKeycodeModifier, (key:string)=>any>} WPKeycodeHandlerByModifier
|
10438 |
-
*/
|
10439 |
|
10440 |
-
|
10441 |
-
|
10442 |
-
|
|
|
|
|
|
|
10443 |
|
10444 |
-
|
10445 |
-
|
10446 |
-
|
10447 |
-
|
|
|
|
|
|
|
10448 |
|
10449 |
-
|
10450 |
-
|
10451 |
-
|
10452 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10453 |
|
10454 |
-
var ENTER = 13;
|
10455 |
-
/**
|
10456 |
-
* Keycode for ESCAPE key.
|
10457 |
-
*/
|
10458 |
|
10459 |
-
var
|
10460 |
-
|
10461 |
-
* Keycode for SPACE key.
|
10462 |
-
*/
|
10463 |
|
10464 |
-
var
|
10465 |
-
/**
|
10466 |
-
* Keycode for LEFT key.
|
10467 |
-
*/
|
10468 |
|
10469 |
-
var
|
10470 |
/**
|
10471 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
|
10472 |
*/
|
10473 |
|
10474 |
-
var
|
10475 |
-
|
10476 |
-
|
10477 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10478 |
|
10479 |
-
var
|
10480 |
-
|
10481 |
-
|
10482 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10483 |
|
10484 |
-
var
|
10485 |
-
|
10486 |
-
|
10487 |
-
*/
|
10488 |
|
10489 |
-
var
|
10490 |
-
|
10491 |
-
|
10492 |
-
|
|
|
|
|
|
|
10493 |
|
10494 |
-
|
10495 |
-
|
10496 |
-
|
10497 |
-
*/
|
10498 |
|
10499 |
-
|
10500 |
-
|
10501 |
-
* Keycode for CTRL key.
|
10502 |
-
*/
|
10503 |
|
10504 |
-
var
|
10505 |
-
|
10506 |
-
|
10507 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10508 |
|
10509 |
-
var
|
10510 |
-
|
10511 |
-
|
10512 |
-
*/
|
10513 |
|
10514 |
-
|
10515 |
-
/**
|
10516 |
-
* Keycode for ZERO key.
|
10517 |
-
*/
|
10518 |
|
10519 |
-
var
|
10520 |
-
|
10521 |
-
|
10522 |
-
|
10523 |
-
|
10524 |
-
|
10525 |
-
|
10526 |
-
* - `primaryAlt`: takes a isApple function as a parameter.
|
10527 |
-
* - `secondary`: takes a isApple function as a parameter.
|
10528 |
-
* - `access`: takes a isApple function as a parameter.
|
10529 |
-
* - `ctrl`
|
10530 |
-
* - `alt`
|
10531 |
-
* - `ctrlShift`
|
10532 |
-
* - `shift`
|
10533 |
-
* - `shiftAlt`
|
10534 |
-
*/
|
10535 |
|
10536 |
-
var modifiers = {
|
10537 |
-
primary: function primary(_isApple) {
|
10538 |
-
return _isApple() ? [COMMAND] : [CTRL];
|
10539 |
-
},
|
10540 |
-
primaryShift: function primaryShift(_isApple) {
|
10541 |
-
return _isApple() ? [SHIFT, COMMAND] : [CTRL, SHIFT];
|
10542 |
-
},
|
10543 |
-
primaryAlt: function primaryAlt(_isApple) {
|
10544 |
-
return _isApple() ? [ALT, COMMAND] : [CTRL, ALT];
|
10545 |
-
},
|
10546 |
-
secondary: function secondary(_isApple) {
|
10547 |
-
return _isApple() ? [SHIFT, ALT, COMMAND] : [CTRL, SHIFT, ALT];
|
10548 |
-
},
|
10549 |
-
access: function access(_isApple) {
|
10550 |
-
return _isApple() ? [CTRL, ALT] : [SHIFT, ALT];
|
10551 |
-
},
|
10552 |
-
ctrl: function ctrl() {
|
10553 |
-
return [CTRL];
|
10554 |
-
},
|
10555 |
-
alt: function alt() {
|
10556 |
-
return [ALT];
|
10557 |
-
},
|
10558 |
-
ctrlShift: function ctrlShift() {
|
10559 |
-
return [CTRL, SHIFT];
|
10560 |
-
},
|
10561 |
-
shift: function shift() {
|
10562 |
-
return [SHIFT];
|
10563 |
-
},
|
10564 |
-
shiftAlt: function shiftAlt() {
|
10565 |
-
return [SHIFT, ALT];
|
10566 |
-
}
|
10567 |
-
};
|
10568 |
-
/**
|
10569 |
-
* An object that contains functions to get raw shortcuts.
|
10570 |
-
* E.g. rawShortcut.primary( 'm' ) will return 'meta+m' on Mac.
|
10571 |
-
* These are intended for user with the KeyboardShortcuts component or TinyMCE.
|
10572 |
-
*
|
10573 |
-
* @type {WPKeycodeHandlerByModifier} Keyed map of functions to raw shortcuts.
|
10574 |
-
*/
|
10575 |
|
10576 |
-
var
|
10577 |
-
|
10578 |
-
|
|
|
|
|
|
|
|
|
10579 |
|
10580 |
-
return
|
10581 |
-
};
|
|
|
|
|
10582 |
});
|
10583 |
-
/**
|
10584 |
-
* Return an array of the parts of a keyboard shortcut chord for display
|
10585 |
-
* E.g displayShortcutList.primary( 'm' ) will return [ '⌘', 'M' ] on Mac.
|
10586 |
-
*
|
10587 |
-
* @type {WPKeycodeHandlerByModifier} Keyed map of functions to shortcut
|
10588 |
-
* sequences.
|
10589 |
-
*/
|
10590 |
|
10591 |
-
var
|
10592 |
-
|
10593 |
-
|
|
|
|
|
10594 |
|
10595 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10596 |
|
10597 |
-
var isApple = _isApple();
|
10598 |
|
10599 |
-
|
10600 |
-
var modifierKeys = modifier(_isApple).reduce(function (accumulator, key) {
|
10601 |
-
var replacementKey = Object(external_lodash_["get"])(replacementKeyMap, key, key); // If on the Mac, adhere to platform convention and don't show plus between keys.
|
10602 |
|
10603 |
-
|
10604 |
-
|
10605 |
-
|
|
|
10606 |
|
10607 |
-
return [].concat(Object(toConsumableArray["a" /* default */])(accumulator), [replacementKey, '+']);
|
10608 |
-
}, []);
|
10609 |
-
var capitalizedCharacter = Object(external_lodash_["capitalize"])(character);
|
10610 |
-
return [].concat(Object(toConsumableArray["a" /* default */])(modifierKeys), [capitalizedCharacter]);
|
10611 |
-
};
|
10612 |
-
});
|
10613 |
/**
|
10614 |
-
*
|
10615 |
-
* E.g. displayShortcut.primary( 'm' ) will return '⌘M' on Mac.
|
10616 |
-
*
|
10617 |
-
* @type {WPKeycodeHandlerByModifier} Keyed map of functions to display
|
10618 |
-
* shortcuts.
|
10619 |
*/
|
|
|
|
|
|
|
|
|
|
|
10620 |
|
10621 |
-
|
10622 |
-
|
10623 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10624 |
|
10625 |
-
return shortcutList(character, _isApple).join('');
|
10626 |
-
};
|
10627 |
-
});
|
10628 |
/**
|
10629 |
-
*
|
10630 |
-
* E.g. shortcutAriaLabel.primary( '.' ) will return 'Command + Period' on Mac.
|
10631 |
*
|
10632 |
-
* @
|
10633 |
-
*
|
|
|
10634 |
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10635 |
|
10636 |
-
|
10637 |
-
|
10638 |
-
var
|
|
|
|
|
|
|
10639 |
|
10640 |
-
|
|
|
|
|
|
|
|
|
10641 |
|
10642 |
-
var
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10643 |
|
10644 |
-
var replacementKeyMap = (_replacementKeyMap2 = {}, Object(defineProperty["a" /* default */])(_replacementKeyMap2, SHIFT, 'Shift'), Object(defineProperty["a" /* default */])(_replacementKeyMap2, COMMAND, isApple ? 'Command' : 'Control'), Object(defineProperty["a" /* default */])(_replacementKeyMap2, CTRL, 'Control'), Object(defineProperty["a" /* default */])(_replacementKeyMap2, ALT, isApple ? 'Option' : 'Alt'), Object(defineProperty["a" /* default */])(_replacementKeyMap2, ',', Object(external_this_wp_i18n_["__"])('Comma')), Object(defineProperty["a" /* default */])(_replacementKeyMap2, '.', Object(external_this_wp_i18n_["__"])('Period')), Object(defineProperty["a" /* default */])(_replacementKeyMap2, '`', Object(external_this_wp_i18n_["__"])('Backtick')), _replacementKeyMap2);
|
10645 |
-
return [].concat(Object(toConsumableArray["a" /* default */])(modifier(_isApple)), [character]).map(function (key) {
|
10646 |
-
return Object(external_lodash_["capitalize"])(Object(external_lodash_["get"])(replacementKeyMap, key, key));
|
10647 |
-
}).join(isApple ? ' ' : ' + ');
|
10648 |
-
};
|
10649 |
-
});
|
10650 |
/**
|
10651 |
-
*
|
10652 |
-
* the event.
|
10653 |
-
*
|
10654 |
-
* @param {KeyboardEvent} event Keyboard event.
|
10655 |
*
|
10656 |
-
* @
|
|
|
|
|
10657 |
*/
|
10658 |
-
|
10659 |
-
|
10660 |
-
return [ALT, CTRL, COMMAND, SHIFT].filter(function (key) {
|
10661 |
-
return event["".concat(key, "Key")];
|
10662 |
-
});
|
10663 |
}
|
|
|
10664 |
/**
|
10665 |
-
*
|
10666 |
-
* predefined shortcut combination.
|
10667 |
-
* E.g. isKeyboardEvent.primary( event, 'm' ) will return true if the event
|
10668 |
-
* signals pressing ⌘M.
|
10669 |
*
|
10670 |
-
* @
|
|
|
10671 |
*/
|
|
|
|
|
|
|
|
|
|
|
10672 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10673 |
|
10674 |
-
|
10675 |
-
|
10676 |
-
|
10677 |
-
|
10678 |
-
|
10679 |
-
|
10680 |
|
10681 |
-
|
10682 |
-
|
|
|
|
|
10683 |
}
|
|
|
10684 |
|
10685 |
-
|
10686 |
-
|
10687 |
-
}
|
|
|
|
|
10688 |
|
10689 |
-
|
10690 |
-
|
10691 |
-
});
|
10692 |
-
//# sourceMappingURL=index.js.map
|
10693 |
|
10694 |
-
|
|
|
10695 |
|
10696 |
-
|
10697 |
-
|
10698 |
|
10699 |
-
|
10700 |
-
|
10701 |
-
/* unused harmony export G */
|
10702 |
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Path; });
|
10703 |
-
/* unused harmony export Polygon */
|
10704 |
-
/* unused harmony export Rect */
|
10705 |
-
/* unused harmony export Defs */
|
10706 |
-
/* unused harmony export RadialGradient */
|
10707 |
-
/* unused harmony export LinearGradient */
|
10708 |
-
/* unused harmony export Stop */
|
10709 |
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return SVG; });
|
10710 |
-
/* harmony import */ var _babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6);
|
10711 |
-
/* harmony import */ var _babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(14);
|
10712 |
-
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(8);
|
10713 |
-
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_2__);
|
10714 |
-
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(0);
|
10715 |
-
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__);
|
10716 |
|
|
|
|
|
|
|
|
|
|
|
|
|
10717 |
|
|
|
|
|
|
|
|
|
|
|
10718 |
|
10719 |
-
|
|
|
|
|
|
|
10720 |
|
10721 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
10722 |
|
10723 |
-
|
10724 |
-
|
10725 |
-
*/
|
10726 |
|
10727 |
-
|
10728 |
-
|
10729 |
-
|
10730 |
|
10731 |
-
|
|
|
10732 |
|
10733 |
-
|
|
|
10734 |
|
10735 |
-
|
10736 |
|
10737 |
-
|
|
|
|
|
10738 |
|
10739 |
-
|
10740 |
-
|
10741 |
-
|
10742 |
-
|
10743 |
-
|
|
|
10744 |
|
10745 |
-
var Circle = function Circle(props) {
|
10746 |
-
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__["createElement"])('circle', props);
|
10747 |
-
};
|
10748 |
/**
|
10749 |
-
*
|
10750 |
*
|
10751 |
-
* @
|
|
|
10752 |
*/
|
|
|
|
|
|
|
10753 |
|
10754 |
-
var G = function G(props) {
|
10755 |
-
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__["createElement"])('g', props);
|
10756 |
-
};
|
10757 |
/**
|
10758 |
-
*
|
10759 |
*
|
10760 |
-
* @
|
|
|
10761 |
*/
|
|
|
|
|
|
|
10762 |
|
10763 |
-
var Path = function Path(props) {
|
10764 |
-
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__["createElement"])('path', props);
|
10765 |
-
};
|
10766 |
/**
|
10767 |
-
*
|
10768 |
*
|
10769 |
-
* @
|
|
|
|
|
10770 |
*/
|
|
|
|
|
|
|
|
|
10771 |
|
10772 |
-
var Polygon = function Polygon(props) {
|
10773 |
-
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__["createElement"])('polygon', props);
|
10774 |
-
};
|
10775 |
/**
|
10776 |
-
*
|
10777 |
*
|
10778 |
-
* @
|
|
|
10779 |
*/
|
|
|
|
|
|
|
10780 |
|
10781 |
-
var Rect = function Rect(props) {
|
10782 |
-
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__["createElement"])('rect', props);
|
10783 |
-
};
|
10784 |
/**
|
10785 |
-
*
|
10786 |
*
|
10787 |
-
* @
|
|
|
|
|
10788 |
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10789 |
|
10790 |
-
var Defs = function Defs(props) {
|
10791 |
-
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__["createElement"])('defs', props);
|
10792 |
-
};
|
10793 |
/**
|
10794 |
-
*
|
10795 |
*
|
10796 |
-
* @
|
|
|
|
|
|
|
10797 |
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10798 |
|
10799 |
-
var RadialGradient = function RadialGradient(props) {
|
10800 |
-
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__["createElement"])('radialGradient', props);
|
10801 |
-
};
|
10802 |
/**
|
10803 |
-
*
|
10804 |
*
|
10805 |
-
* @
|
|
|
|
|
|
|
10806 |
*/
|
|
|
|
|
|
|
10807 |
|
10808 |
-
var LinearGradient = function LinearGradient(props) {
|
10809 |
-
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__["createElement"])('linearGradient', props);
|
10810 |
-
};
|
10811 |
/**
|
10812 |
-
*
|
10813 |
*
|
10814 |
-
* @
|
|
|
|
|
|
|
10815 |
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10816 |
|
10817 |
-
var Stop = function Stop(props) {
|
10818 |
-
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__["createElement"])('stop', props);
|
10819 |
-
};
|
10820 |
/**
|
|
|
10821 |
*
|
10822 |
-
*
|
10823 |
-
*
|
|
|
10824 |
*
|
10825 |
-
* @
|
|
|
|
|
|
|
10826 |
*/
|
|
|
|
|
|
|
|
|
|
|
10827 |
|
10828 |
-
|
10829 |
-
var className = _ref.className,
|
10830 |
-
isPressed = _ref.isPressed,
|
10831 |
-
props = Object(_babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"])(_ref, ["className", "isPressed"]);
|
10832 |
|
10833 |
-
|
10834 |
-
|
10835 |
-
|
10836 |
-
|
10837 |
-
|
10838 |
-
|
10839 |
-
|
10840 |
-
}); // Disable reason: We need to have a way to render HTML tag for web.
|
10841 |
-
// eslint-disable-next-line react/forbid-elements
|
10842 |
|
|
|
|
|
10843 |
|
10844 |
-
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__["createElement"])("svg", appliedProps);
|
10845 |
-
};
|
10846 |
-
//# sourceMappingURL=index.js.map
|
10847 |
|
10848 |
/***/ }),
|
10849 |
|
10850 |
-
/***/
|
10851 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
10852 |
|
10853 |
"use strict";
|
10854 |
-
/*
|
10855 |
-
/*
|
10856 |
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return WC_ADMIN_NAMESPACE; });
|
10857 |
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return WCS_NAMESPACE; });
|
10858 |
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return DEFAULT_REQUIREMENT; });
|
10859 |
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return MAX_PER_PAGE; });
|
10860 |
-
/* unused harmony export DEFAULT_ACTIONABLE_STATUSES */
|
10861 |
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return QUERY_DEFAULTS; });
|
10862 |
-
/* harmony import */ var _fresh_data_framework__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(170);
|
10863 |
-
/**
|
10864 |
-
* External dependencies
|
10865 |
-
*/
|
10866 |
-
|
10867 |
-
var JETPACK_NAMESPACE = '/jetpack/v4';
|
10868 |
-
var NAMESPACE = '/wc-analytics';
|
10869 |
-
var WC_ADMIN_NAMESPACE = '/wc-admin';
|
10870 |
-
var WCS_NAMESPACE = '/wc/v1'; // WCS endpoints like Stripe are not avaiable on later /wc versions
|
10871 |
-
|
10872 |
-
var DEFAULT_REQUIREMENT = {
|
10873 |
-
timeout: 1 * _fresh_data_framework__WEBPACK_IMPORTED_MODULE_0__[/* MINUTE */ "b"],
|
10874 |
-
freshness: 30 * _fresh_data_framework__WEBPACK_IMPORTED_MODULE_0__[/* MINUTE */ "b"]
|
10875 |
-
}; // WordPress & WooCommerce both set a hard limit of 100 for the per_page parameter
|
10876 |
-
|
10877 |
-
var MAX_PER_PAGE = 100;
|
10878 |
-
var DEFAULT_ACTIONABLE_STATUSES = ['processing', 'on-hold'];
|
10879 |
-
var QUERY_DEFAULTS = {
|
10880 |
-
pageSize: 25,
|
10881 |
-
period: 'month',
|
10882 |
-
compare: 'previous_year',
|
10883 |
-
noteTypes: 'info,warning,marketing'
|
10884 |
-
};
|
10885 |
-
|
10886 |
-
/***/ }),
|
10887 |
|
10888 |
-
/***/ 35:
|
10889 |
-
/***/ (function(module, exports) {
|
10890 |
|
10891 |
-
|
10892 |
-
"@babel/helpers - typeof";
|
10893 |
|
10894 |
-
|
10895 |
-
|
10896 |
-
|
10897 |
-
|
10898 |
-
|
10899 |
-
|
10900 |
-
|
10901 |
-
|
10902 |
-
|
10903 |
|
10904 |
-
|
10905 |
-
|
10906 |
|
10907 |
-
|
10908 |
|
10909 |
/***/ }),
|
10910 |
|
10911 |
-
/***/
|
10912 |
-
/***/ (function(module,
|
10913 |
|
10914 |
"use strict";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10915 |
|
10916 |
|
10917 |
-
Object.defineProperty(exports, "__esModule", {
|
10918 |
-
value: true
|
10919 |
-
});
|
10920 |
-
|
10921 |
-
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; /**
|
10922 |
-
* External Dependencies
|
10923 |
-
*/
|
10924 |
-
|
10925 |
-
|
10926 |
-
/**
|
10927 |
-
* Internal Dependencies
|
10928 |
-
*/
|
10929 |
-
|
10930 |
|
10931 |
-
var _react = __webpack_require__(13);
|
10932 |
|
10933 |
-
var _react2 = _interopRequireDefault(_react);
|
10934 |
|
10935 |
-
var _reactAddonsCreateFragment = __webpack_require__(148);
|
10936 |
|
10937 |
-
var _reactAddonsCreateFragment2 = _interopRequireDefault(_reactAddonsCreateFragment);
|
10938 |
|
10939 |
-
var
|
10940 |
|
10941 |
-
|
10942 |
|
10943 |
-
|
|
|
|
|
10944 |
|
10945 |
-
var currentMixedString = void 0;
|
10946 |
|
10947 |
-
function getCloseIndex(openIndex, tokens) {
|
10948 |
-
var openToken = tokens[openIndex],
|
10949 |
-
nestLevel = 0,
|
10950 |
-
token,
|
10951 |
-
i;
|
10952 |
-
for (i = openIndex + 1; i < tokens.length; i++) {
|
10953 |
-
token = tokens[i];
|
10954 |
-
if (token.value === openToken.value) {
|
10955 |
-
if (token.type === 'componentOpen') {
|
10956 |
-
nestLevel++;
|
10957 |
-
continue;
|
10958 |
-
}
|
10959 |
-
if (token.type === 'componentClose') {
|
10960 |
-
if (nestLevel === 0) {
|
10961 |
-
return i;
|
10962 |
-
}
|
10963 |
-
nestLevel--;
|
10964 |
-
}
|
10965 |
-
}
|
10966 |
-
}
|
10967 |
-
// if we get this far, there was no matching close token
|
10968 |
-
throw new Error('Missing closing component token `' + openToken.value + '`');
|
10969 |
-
}
|
10970 |
|
10971 |
-
|
10972 |
-
|
10973 |
-
|
10974 |
-
openComponent,
|
10975 |
-
clonedOpenComponent,
|
10976 |
-
openIndex,
|
10977 |
-
closeIndex,
|
10978 |
-
token,
|
10979 |
-
i,
|
10980 |
-
grandChildTokens,
|
10981 |
-
grandChildren,
|
10982 |
-
siblingTokens,
|
10983 |
-
siblings;
|
10984 |
|
10985 |
-
for (i = 0; i < tokens.length; i++) {
|
10986 |
-
token = tokens[i];
|
10987 |
-
if (token.type === 'string') {
|
10988 |
-
children.push(token.value);
|
10989 |
-
continue;
|
10990 |
-
}
|
10991 |
-
// component node should at least be set
|
10992 |
-
if (!components.hasOwnProperty(token.value) || typeof components[token.value] === 'undefined') {
|
10993 |
-
throw new Error('Invalid interpolation, missing component node: `' + token.value + '`');
|
10994 |
-
}
|
10995 |
-
// should be either ReactElement or null (both type "object"), all other types deprecated
|
10996 |
-
if (_typeof(components[token.value]) !== 'object') {
|
10997 |
-
throw new Error('Invalid interpolation, component node must be a ReactElement or null: `' + token.value + '`', '\n> ' + currentMixedString);
|
10998 |
-
}
|
10999 |
-
// we should never see a componentClose token in this loop
|
11000 |
-
if (token.type === 'componentClose') {
|
11001 |
-
throw new Error('Missing opening component token: `' + token.value + '`');
|
11002 |
-
}
|
11003 |
-
if (token.type === 'componentOpen') {
|
11004 |
-
openComponent = components[token.value];
|
11005 |
-
openIndex = i;
|
11006 |
-
break;
|
11007 |
-
}
|
11008 |
-
// componentSelfClosing token
|
11009 |
-
children.push(components[token.value]);
|
11010 |
-
continue;
|
11011 |
-
}
|
11012 |
|
11013 |
-
if (openComponent) {
|
11014 |
-
closeIndex = getCloseIndex(openIndex, tokens);
|
11015 |
-
grandChildTokens = tokens.slice(openIndex + 1, closeIndex);
|
11016 |
-
grandChildren = buildChildren(grandChildTokens, components);
|
11017 |
-
clonedOpenComponent = _react2.default.cloneElement(openComponent, {}, grandChildren);
|
11018 |
-
children.push(clonedOpenComponent);
|
11019 |
|
11020 |
-
|
11021 |
-
|
11022 |
-
|
11023 |
-
|
11024 |
-
}
|
11025 |
-
}
|
11026 |
|
11027 |
-
|
11028 |
-
|
11029 |
-
}
|
11030 |
|
11031 |
-
|
11032 |
-
if (child) {
|
11033 |
-
childrenObject['interpolation-child-' + index] = child;
|
11034 |
-
}
|
11035 |
-
});
|
11036 |
|
11037 |
-
|
11038 |
-
|
11039 |
|
11040 |
-
|
11041 |
-
|
11042 |
-
components = options.components,
|
11043 |
-
throwErrors = options.throwErrors;
|
11044 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11045 |
|
11046 |
-
|
|
|
|
|
11047 |
|
11048 |
-
|
11049 |
-
|
11050 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
11051 |
|
11052 |
-
|
11053 |
-
|
11054 |
-
|
11055 |
-
|
|
|
|
|
|
|
|
|
|
|
11056 |
|
11057 |
-
|
11058 |
-
|
11059 |
|
11060 |
-
|
|
|
|
|
|
|
|
|
11061 |
|
11062 |
-
|
11063 |
-
|
11064 |
-
|
11065 |
-
|
11066 |
-
throw new Error('Interpolation Error: unable to process `' + mixedString + '` because of error `' + error.message + '`');
|
11067 |
-
}
|
11068 |
|
11069 |
-
|
11070 |
-
|
|
|
|
|
11071 |
};
|
11072 |
-
|
11073 |
-
|
11074 |
-
|
|
|
11075 |
|
11076 |
/***/ }),
|
11077 |
|
11078 |
-
/***/
|
11079 |
-
/***/ (function(module,
|
11080 |
|
11081 |
-
|
11082 |
-
|
11083 |
-
|
11084 |
-
|
11085 |
-
|
11086 |
-
|
11087 |
-
|
11088 |
-
|
11089 |
-
|
|
|
|
|
|
|
|
|
|
|
11090 |
|
11091 |
-
function _createClass(Constructor, protoProps, staticProps) {
|
11092 |
-
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
11093 |
-
if (staticProps) _defineProperties(Constructor, staticProps);
|
11094 |
-
return Constructor;
|
11095 |
-
}
|
11096 |
|
11097 |
-
|
|
|
|
|
11098 |
|
11099 |
-
/***/ }),
|
11100 |
|
11101 |
-
|
11102 |
-
|
|
|
|
|
|
|
|
|
11103 |
|
11104 |
-
function
|
11105 |
-
if (!
|
11106 |
-
|
11107 |
}
|
11108 |
-
}
|
11109 |
|
11110 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
11111 |
|
11112 |
-
|
|
|
|
|
11113 |
|
11114 |
-
|
11115 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11116 |
|
11117 |
-
|
|
|
|
|
|
|
|
|
|
|
11118 |
|
11119 |
-
|
11120 |
-
|
11121 |
-
throw new TypeError("Super expression must either be null or a function");
|
11122 |
}
|
11123 |
|
11124 |
-
|
11125 |
-
|
11126 |
-
|
11127 |
-
|
11128 |
-
configurable: true
|
11129 |
}
|
11130 |
});
|
11131 |
-
|
11132 |
-
|
11133 |
-
|
11134 |
-
module.exports = _inherits;
|
11135 |
-
|
11136 |
-
/***/ }),
|
11137 |
|
11138 |
-
|
11139 |
-
|
|
|
11140 |
|
11141 |
-
|
11142 |
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _getPrototypeOf; });
|
11143 |
-
function _getPrototypeOf(o) {
|
11144 |
-
_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
|
11145 |
-
return o.__proto__ || Object.getPrototypeOf(o);
|
11146 |
-
};
|
11147 |
-
return _getPrototypeOf(o);
|
11148 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
11149 |
|
11150 |
-
|
11151 |
-
|
11152 |
-
|
11153 |
-
|
11154 |
-
|
11155 |
-
|
11156 |
-
|
11157 |
-
|
11158 |
-
|
|
|
|
|
11159 |
|
11160 |
-
|
11161 |
-
|
11162 |
-
|
11163 |
-
};
|
11164 |
-
} else {
|
11165 |
-
_typeof = function _typeof(obj) {
|
11166 |
-
return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
11167 |
-
};
|
11168 |
}
|
11169 |
|
11170 |
-
return
|
11171 |
}
|
11172 |
|
11173 |
/***/ }),
|
11174 |
|
11175 |
-
/***/
|
11176 |
-
/***/ (function(module,
|
11177 |
|
11178 |
"use strict";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11179 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11180 |
|
11181 |
-
|
11182 |
-
|
11183 |
-
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
|
11184 |
-
|
11185 |
-
function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
|
11186 |
-
|
11187 |
-
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
11188 |
-
|
11189 |
-
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
11190 |
-
|
11191 |
-
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
11192 |
-
|
11193 |
-
var hoistNonReactStatic = __webpack_require__(441);
|
11194 |
-
var React = __webpack_require__(13);
|
11195 |
-
var ReactDOM = __webpack_require__(78);
|
11196 |
-
|
11197 |
-
module.exports = function enhanceWithClickOutside(WrappedComponent) {
|
11198 |
-
var componentName = WrappedComponent.displayName || WrappedComponent.name;
|
11199 |
|
11200 |
-
var
|
11201 |
-
|
|
|
|
|
11202 |
|
11203 |
-
|
11204 |
-
|
|
|
|
|
|
|
|
|
11205 |
|
11206 |
-
|
|
|
11207 |
|
11208 |
-
|
11209 |
-
return _this;
|
11210 |
-
}
|
11211 |
|
11212 |
-
|
11213 |
-
|
11214 |
-
value: function componentDidMount() {
|
11215 |
-
document.addEventListener('click', this.handleClickOutside, true);
|
11216 |
-
}
|
11217 |
-
}, {
|
11218 |
-
key: 'componentWillUnmount',
|
11219 |
-
value: function componentWillUnmount() {
|
11220 |
-
document.removeEventListener('click', this.handleClickOutside, true);
|
11221 |
-
}
|
11222 |
-
}, {
|
11223 |
-
key: 'handleClickOutside',
|
11224 |
-
value: function handleClickOutside(e) {
|
11225 |
-
var domNode = this.__domNode;
|
11226 |
-
if ((!domNode || !domNode.contains(e.target)) && this.__wrappedInstance && typeof this.__wrappedInstance.handleClickOutside === 'function') {
|
11227 |
-
this.__wrappedInstance.handleClickOutside(e);
|
11228 |
-
}
|
11229 |
-
}
|
11230 |
-
}, {
|
11231 |
-
key: 'render',
|
11232 |
-
value: function render() {
|
11233 |
-
var _this2 = this;
|
11234 |
|
11235 |
-
|
11236 |
-
|
11237 |
-
|
|
|
|
|
|
|
|
|
|
|
11238 |
|
11239 |
-
|
11240 |
-
|
11241 |
-
|
11242 |
-
|
11243 |
-
|
11244 |
-
|
11245 |
-
|
11246 |
-
}
|
11247 |
-
}]);
|
11248 |
|
11249 |
-
|
11250 |
-
|
|
|
|
|
|
|
11251 |
|
11252 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11253 |
|
11254 |
-
|
11255 |
-
|
|
|
|
|
|
|
|
|
|
|
11256 |
|
11257 |
/***/ }),
|
11258 |
|
11259 |
-
/***/
|
11260 |
-
/***/ (function(module,
|
11261 |
|
11262 |
"use strict";
|
11263 |
-
var _extends=Object.assign||function(a){for(var c,b=1;b<arguments.length;b++)for(var d in c=arguments[b],c)Object.prototype.hasOwnProperty.call(c,d)&&(a[d]=c[d]);return a};Object.defineProperty(exports,'__esModule',{value:!0});exports.default=function(a){var b=a.size,c=b===void 0?24:b,d=a.onClick,e=a.icon,f=a.className,g=_objectWithoutProperties(a,['size','onClick','icon','className']),j=['gridicon','gridicons-pages',f,!1,!1,!1].filter(Boolean).join(' ');return _react2.default.createElement('svg',_extends({className:j,height:c,width:c,onClick:d},g,{xmlns:'http://www.w3.org/2000/svg',viewBox:'0 0 24 24'}),_react2.default.createElement('g',null,_react2.default.createElement('path',{d:'M16 8H8V6h8v2zm0 2H8v2h8v-2zm4-6v12l-6 6H6c-1.105 0-2-.895-2-2V4c0-1.105.895-2 2-2h12c1.105 0 2 .895 2 2zm-2 10V4H6v16h6v-4c0-1.105.895-2 2-2h4z'})))};var _react=__webpack_require__(13),_react2=_interopRequireDefault(_react);function _interopRequireDefault(a){return a&&a.__esModule?a:{default:a}}function _objectWithoutProperties(a,b){var d={};for(var c in a)0<=b.indexOf(c)||Object.prototype.hasOwnProperty.call(a,c)&&(d[c]=a[c]);return d}module.exports=exports['default'];
|
11264 |
-
|
11265 |
-
|
11266 |
-
/***/ }),
|
11267 |
|
11268 |
-
|
11269 |
-
|
|
|
11270 |
|
11271 |
-
|
11272 |
-
var _extends=Object.assign||function(a){for(var c,b=1;b<arguments.length;b++)for(var d in c=arguments[b],c)Object.prototype.hasOwnProperty.call(c,d)&&(a[d]=c[d]);return a};Object.defineProperty(exports,'__esModule',{value:!0});exports.default=function(a){var b=a.size,c=b===void 0?24:b,d=a.onClick,e=a.icon,f=a.className,g=_objectWithoutProperties(a,['size','onClick','icon','className']),j=['gridicon','gridicons-cross-small',f,!1,!1,!1].filter(Boolean).join(' ');return _react2.default.createElement('svg',_extends({className:j,height:c,width:c,onClick:d},g,{xmlns:'http://www.w3.org/2000/svg',viewBox:'0 0 24 24'}),_react2.default.createElement('g',null,_react2.default.createElement('path',{d:'M17.705 7.705l-1.41-1.41L12 10.59 7.705 6.295l-1.41 1.41L10.59 12l-4.295 4.295 1.41 1.41L12 13.41l4.295 4.295 1.41-1.41L13.41 12l4.295-4.295z'})))};var _react=__webpack_require__(13),_react2=_interopRequireDefault(_react);function _interopRequireDefault(a){return a&&a.__esModule?a:{default:a}}function _objectWithoutProperties(a,b){var d={};for(var c in a)0<=b.indexOf(c)||Object.prototype.hasOwnProperty.call(a,c)&&(d[c]=a[c]);return d}module.exports=exports['default'];
|
11273 |
|
|
|
|
|
11274 |
|
11275 |
-
|
|
|
11276 |
|
11277 |
-
|
11278 |
-
|
11279 |
|
11280 |
-
|
11281 |
-
|
11282 |
-
|
11283 |
-
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(2);
|
11284 |
-
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_1__);
|
11285 |
-
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(8);
|
11286 |
-
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_2__);
|
11287 |
-
/* harmony import */ var _wordpress_a11y__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(127);
|
11288 |
-
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(3);
|
11289 |
-
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__);
|
11290 |
-
/* harmony import */ var _wordpress_warning__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(410);
|
11291 |
-
/* harmony import */ var ___WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(68);
|
11292 |
|
|
|
|
|
11293 |
|
11294 |
-
|
11295 |
-
|
11296 |
-
*/
|
11297 |
|
|
|
|
|
11298 |
|
11299 |
-
|
11300 |
-
|
11301 |
-
*/
|
11302 |
|
|
|
|
|
11303 |
|
|
|
11304 |
|
11305 |
|
|
|
|
|
|
|
11306 |
|
11307 |
/**
|
11308 |
* Internal dependencies
|
11309 |
*/
|
11310 |
|
11311 |
|
11312 |
-
var NOTICE_TIMEOUT = 10000;
|
11313 |
-
/** @typedef {import('@wordpress/element').WPElement} WPElement */
|
11314 |
-
|
11315 |
/**
|
11316 |
-
*
|
11317 |
-
* valid message is provided.
|
11318 |
-
*
|
11319 |
-
* @param {string|WPElement} [message] Message to announce.
|
11320 |
-
* @param {'polite'|'assertive'} politeness Politeness to announce.
|
11321 |
*/
|
11322 |
|
11323 |
-
function useSpokenMessage(message, politeness) {
|
11324 |
-
var spokenMessage = typeof message === 'string' ? message : Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["renderToString"])(message);
|
11325 |
-
Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["useEffect"])(function () {
|
11326 |
-
if (spokenMessage) {
|
11327 |
-
Object(_wordpress_a11y__WEBPACK_IMPORTED_MODULE_3__[/* speak */ "a"])(spokenMessage, politeness);
|
11328 |
-
}
|
11329 |
-
}, [spokenMessage, politeness]);
|
11330 |
-
}
|
11331 |
|
11332 |
-
function Snackbar(_ref, ref) {
|
11333 |
-
var className = _ref.className,
|
11334 |
-
children = _ref.children,
|
11335 |
-
_ref$spokenMessage = _ref.spokenMessage,
|
11336 |
-
spokenMessage = _ref$spokenMessage === void 0 ? children : _ref$spokenMessage,
|
11337 |
-
_ref$politeness = _ref.politeness,
|
11338 |
-
politeness = _ref$politeness === void 0 ? 'polite' : _ref$politeness,
|
11339 |
-
_ref$actions = _ref.actions,
|
11340 |
-
actions = _ref$actions === void 0 ? [] : _ref$actions,
|
11341 |
-
_ref$onRemove = _ref.onRemove,
|
11342 |
-
onRemove = _ref$onRemove === void 0 ? lodash__WEBPACK_IMPORTED_MODULE_1__["noop"] : _ref$onRemove;
|
11343 |
-
useSpokenMessage(spokenMessage, politeness);
|
11344 |
-
Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["useEffect"])(function () {
|
11345 |
-
var timeoutHandle = setTimeout(function () {
|
11346 |
-
onRemove();
|
11347 |
-
}, NOTICE_TIMEOUT);
|
11348 |
-
return function () {
|
11349 |
-
return clearTimeout(timeoutHandle);
|
11350 |
-
};
|
11351 |
-
}, []);
|
11352 |
-
var classes = classnames__WEBPACK_IMPORTED_MODULE_2___default()(className, 'components-snackbar');
|
11353 |
|
11354 |
-
if (actions && actions.length > 1) {
|
11355 |
-
// we need to inform developers that snackbar only accepts 1 action
|
11356 |
-
typeof process !== "undefined" && process.env && "production" !== "production" ? Object(_wordpress_warning__WEBPACK_IMPORTED_MODULE_5__[/* default */ "a"])('Snackbar can only have 1 action, use Notice if your message require many messages') : void 0; // return first element only while keeping it inside an array
|
11357 |
|
11358 |
-
|
11359 |
-
|
|
|
11360 |
|
11361 |
-
|
11362 |
-
|
11363 |
-
className: classes,
|
11364 |
-
onClick: onRemove,
|
11365 |
-
tabIndex: "0",
|
11366 |
-
role: "button",
|
11367 |
-
onKeyPress: onRemove,
|
11368 |
-
"aria-label": Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__["__"])('Dismiss this notice')
|
11369 |
-
}, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("div", {
|
11370 |
-
className: "components-snackbar__content"
|
11371 |
-
}, children, actions.map(function (_ref2, index) {
|
11372 |
-
var label = _ref2.label,
|
11373 |
-
_onClick = _ref2.onClick,
|
11374 |
-
url = _ref2.url;
|
11375 |
-
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(___WEBPACK_IMPORTED_MODULE_6__[/* default */ "a"], {
|
11376 |
-
key: index,
|
11377 |
-
href: url,
|
11378 |
-
isTertiary: true,
|
11379 |
-
onClick: function onClick(event) {
|
11380 |
-
event.stopPropagation();
|
11381 |
|
11382 |
-
|
11383 |
-
_onClick(event);
|
11384 |
-
}
|
11385 |
-
},
|
11386 |
-
className: "components-snackbar__action"
|
11387 |
-
}, label);
|
11388 |
-
})));
|
11389 |
-
}
|
11390 |
|
11391 |
-
|
11392 |
-
|
11393 |
-
|
|
|
|
|
|
|
|
|
|
|
11394 |
|
11395 |
-
|
11396 |
|
11397 |
-
|
11398 |
-
|
|
|
|
|
|
|
11399 |
|
11400 |
-
var
|
|
|
|
|
11401 |
|
11402 |
-
var
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11403 |
|
11404 |
-
var
|
|
|
11405 |
|
11406 |
-
var nonIterableSpread = __webpack_require__(213);
|
11407 |
|
11408 |
-
|
11409 |
-
|
11410 |
-
|
11411 |
|
11412 |
-
module.exports = _toConsumableArray;
|
11413 |
|
11414 |
-
/***/ }),
|
11415 |
|
11416 |
-
/***/ 410:
|
11417 |
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
11418 |
|
11419 |
-
"use strict";
|
11420 |
-
/* WEBPACK VAR INJECTION */(function(process) {/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return warning; });
|
11421 |
-
function isDev() {
|
11422 |
-
return typeof process !== 'undefined' && process.env && "production" !== 'production';
|
11423 |
-
}
|
11424 |
/**
|
11425 |
-
*
|
11426 |
-
*
|
11427 |
-
* @param {string} message Message to show in the warning.
|
11428 |
-
*
|
11429 |
-
* @example
|
11430 |
-
* ```js
|
11431 |
-
* import warning from '@wordpress/warning';
|
11432 |
-
*
|
11433 |
-
* function MyComponent( props ) {
|
11434 |
-
* if ( ! props.title ) {
|
11435 |
-
* warning( '`props.title` was not passed' );
|
11436 |
-
* }
|
11437 |
-
* ...
|
11438 |
-
* }
|
11439 |
-
* ```
|
11440 |
*/
|
11441 |
|
11442 |
|
11443 |
-
|
11444 |
-
|
11445 |
-
|
11446 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11447 |
|
|
|
11448 |
|
11449 |
-
|
11450 |
-
|
11451 |
-
// https://github.com/facebook/react/issues/4216
|
11452 |
|
11453 |
-
|
11454 |
-
|
11455 |
-
|
11456 |
-
}
|
|
|
11457 |
}
|
11458 |
-
//# sourceMappingURL=index.js.map
|
11459 |
-
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(47)))
|
11460 |
|
11461 |
-
|
11462 |
|
11463 |
-
/***/
|
11464 |
-
/***/ (function(module, exports, __webpack_require__) {
|
11465 |
|
11466 |
-
|
11467 |
-
|
11468 |
|
|
|
|
|
|
|
|
|
|
|
11469 |
|
11470 |
-
|
|
|
|
|
|
|
|
|
11471 |
|
11472 |
-
|
11473 |
-
|
11474 |
-
};
|
11475 |
|
11476 |
-
|
11477 |
|
11478 |
/***/ }),
|
11479 |
|
11480 |
-
/***/
|
11481 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
11482 |
|
11483 |
"use strict";
|
11484 |
-
/* harmony
|
11485 |
-
/* harmony
|
11486 |
-
/* harmony import */ var
|
11487 |
-
/* harmony import */ var
|
11488 |
-
/* harmony import */ var
|
11489 |
-
/* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__);
|
11490 |
-
/* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(42);
|
11491 |
-
/* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__);
|
11492 |
-
/* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(26);
|
11493 |
-
/* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__);
|
11494 |
-
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(0);
|
11495 |
-
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_5__);
|
11496 |
-
/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(18);
|
11497 |
-
/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_6__);
|
11498 |
-
/* harmony import */ var _woocommerce_data__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(43);
|
11499 |
-
/* harmony import */ var _woocommerce_data__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_woocommerce_data__WEBPACK_IMPORTED_MODULE_7__);
|
11500 |
-
/* harmony import */ var _style_scss__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(445);
|
11501 |
-
/* harmony import */ var _style_scss__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_style_scss__WEBPACK_IMPORTED_MODULE_8__);
|
11502 |
-
|
11503 |
-
|
11504 |
-
|
11505 |
-
|
11506 |
-
|
11507 |
|
11508 |
|
11509 |
-
function
|
11510 |
|
11511 |
-
function
|
11512 |
|
11513 |
/**
|
11514 |
* External dependencies
|
11515 |
*/
|
11516 |
|
11517 |
-
|
11518 |
/**
|
11519 |
* WooCommerce dependencies
|
11520 |
*/
|
11521 |
|
11522 |
-
|
11523 |
/**
|
11524 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11525 |
*/
|
11526 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11527 |
|
|
|
|
|
|
|
|
|
|
|
|
|
11528 |
|
11529 |
-
var
|
11530 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
11531 |
|
11532 |
-
var _super = _createSuper(Navigation);
|
11533 |
|
11534 |
-
|
11535 |
-
_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, Navigation);
|
11536 |
|
11537 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11538 |
}
|
11539 |
|
11540 |
-
|
11541 |
-
|
11542 |
-
|
11543 |
-
|
11544 |
-
|
11545 |
-
|
11546 |
-
|
11547 |
-
|
11548 |
-
|
11549 |
-
|
11550 |
-
|
11551 |
-
|
11552 |
-
|
11553 |
-
href: url
|
11554 |
-
}, title), item.children && item.children.length && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_5__["createElement"])("ul", {
|
11555 |
-
className: "woocommerce-navigation__submenu"
|
11556 |
-
}, item.children.map(function (childItem) {
|
11557 |
-
return _this.renderMenuItem(childItem, depth + 1);
|
11558 |
-
})));
|
11559 |
-
}
|
11560 |
-
}, {
|
11561 |
-
key: "render",
|
11562 |
-
value: function render() {
|
11563 |
-
var _this2 = this;
|
11564 |
|
11565 |
-
|
11566 |
-
|
11567 |
-
|
11568 |
-
|
11569 |
-
|
11570 |
-
}, items.map(function (item) {
|
11571 |
-
return _this2.renderMenuItem(item);
|
11572 |
-
})));
|
11573 |
-
}
|
11574 |
-
}]);
|
11575 |
|
11576 |
-
|
11577 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11578 |
|
11579 |
-
|
11580 |
-
|
|
|
|
|
11581 |
return {
|
11582 |
-
items: items
|
|
|
|
|
11583 |
};
|
11584 |
-
}
|
11585 |
-
|
11586 |
-
/***/ }),
|
11587 |
-
|
11588 |
-
/***/ 413:
|
11589 |
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
11590 |
-
|
11591 |
-
"use strict";
|
11592 |
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return symbolObservablePonyfill; });
|
11593 |
-
function symbolObservablePonyfill(root) {
|
11594 |
-
var result;
|
11595 |
-
var Symbol = root.Symbol;
|
11596 |
-
|
11597 |
-
if (typeof Symbol === 'function') {
|
11598 |
-
if (Symbol.observable) {
|
11599 |
-
result = Symbol.observable;
|
11600 |
-
} else {
|
11601 |
-
result = Symbol('observable');
|
11602 |
-
Symbol.observable = result;
|
11603 |
-
}
|
11604 |
-
} else {
|
11605 |
-
result = '@@observable';
|
11606 |
-
}
|
11607 |
-
|
11608 |
-
return result;
|
11609 |
-
};
|
11610 |
-
|
11611 |
|
11612 |
/***/ }),
|
11613 |
|
11614 |
-
/***/
|
11615 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
11616 |
|
11617 |
"use strict";
|
|
|
|
|
|
|
|
|
11618 |
|
11619 |
-
// UNUSED EXPORTS: NavigableMenu
|
11620 |
-
|
11621 |
-
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/extends.js
|
11622 |
-
var esm_extends = __webpack_require__(12);
|
11623 |
-
|
11624 |
-
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js
|
11625 |
-
var objectWithoutProperties = __webpack_require__(14);
|
11626 |
-
|
11627 |
-
// EXTERNAL MODULE: external {"this":["wp","element"]}
|
11628 |
-
var external_this_wp_element_ = __webpack_require__(0);
|
11629 |
-
|
11630 |
-
// EXTERNAL MODULE: external "lodash"
|
11631 |
-
var external_lodash_ = __webpack_require__(2);
|
11632 |
-
|
11633 |
-
// EXTERNAL MODULE: ./node_modules/@wordpress/components/node_modules/@wordpress/keycodes/build-module/index.js + 1 modules
|
11634 |
-
var build_module = __webpack_require__(31);
|
11635 |
-
|
11636 |
-
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/classCallCheck.js
|
11637 |
-
var classCallCheck = __webpack_require__(9);
|
11638 |
-
|
11639 |
-
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/createClass.js
|
11640 |
-
var createClass = __webpack_require__(7);
|
11641 |
-
|
11642 |
-
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js
|
11643 |
-
var assertThisInitialized = __webpack_require__(5);
|
11644 |
|
11645 |
-
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js
|
11646 |
-
var possibleConstructorReturn = __webpack_require__(11);
|
11647 |
|
11648 |
-
|
11649 |
-
var getPrototypeOf = __webpack_require__(4);
|
11650 |
|
11651 |
-
|
11652 |
-
var inherits = __webpack_require__(10);
|
11653 |
|
11654 |
-
|
11655 |
-
|
|
|
|
|
11656 |
|
11657 |
-
|
11658 |
|
|
|
11659 |
|
|
|
11660 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11661 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11662 |
|
|
|
|
|
11663 |
|
|
|
11664 |
|
|
|
|
|
11665 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11666 |
|
11667 |
|
11668 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11669 |
|
11670 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
11671 |
|
11672 |
/**
|
11673 |
-
*
|
|
|
11674 |
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11675 |
|
11676 |
/**
|
11677 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11678 |
*/
|
11679 |
|
|
|
|
|
11680 |
|
|
|
|
|
|
|
11681 |
|
|
|
|
|
|
|
|
|
11682 |
|
11683 |
-
|
11684 |
-
|
|
|
|
|
11685 |
|
11686 |
-
|
11687 |
-
return total + nextValue;
|
11688 |
-
} else if (nextValue >= total) {
|
11689 |
-
return nextValue - total;
|
11690 |
}
|
11691 |
|
11692 |
-
|
11693 |
-
|
|
|
11694 |
|
11695 |
-
var
|
11696 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11697 |
|
11698 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11699 |
|
11700 |
-
function NavigableContainer() {
|
11701 |
-
var _this;
|
11702 |
|
11703 |
-
|
|
|
|
|
|
|
11704 |
|
11705 |
-
|
11706 |
-
_this.onKeyDown = _this.onKeyDown.bind(Object(assertThisInitialized["a" /* default */])(_this));
|
11707 |
-
_this.bindContainer = _this.bindContainer.bind(Object(assertThisInitialized["a" /* default */])(_this));
|
11708 |
-
_this.getFocusableContext = _this.getFocusableContext.bind(Object(assertThisInitialized["a" /* default */])(_this));
|
11709 |
-
_this.getFocusableIndex = _this.getFocusableIndex.bind(Object(assertThisInitialized["a" /* default */])(_this));
|
11710 |
-
return _this;
|
11711 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11712 |
|
11713 |
-
|
11714 |
-
|
11715 |
-
|
11716 |
-
|
11717 |
-
// because we want to catch events from the underlying DOM tree
|
11718 |
-
// The React Tree can be different from the DOM tree when using
|
11719 |
-
// portals. Block Toolbars for instance are rendered in a separate
|
11720 |
-
// React Trees.
|
11721 |
-
this.container.addEventListener('keydown', this.onKeyDown);
|
11722 |
-
this.container.addEventListener('focus', this.onFocus);
|
11723 |
}
|
11724 |
-
|
11725 |
-
|
11726 |
-
|
11727 |
-
this.container.removeEventListener('keydown', this.onKeyDown);
|
11728 |
-
this.container.removeEventListener('focus', this.onFocus);
|
11729 |
}
|
11730 |
-
}, {
|
11731 |
-
key: "bindContainer",
|
11732 |
-
value: function bindContainer(ref) {
|
11733 |
-
var forwardedRef = this.props.forwardedRef;
|
11734 |
-
this.container = ref;
|
11735 |
|
11736 |
-
|
11737 |
-
|
11738 |
-
|
11739 |
-
|
|
|
|
|
11740 |
}
|
11741 |
-
}
|
11742 |
-
}, {
|
11743 |
-
key: "getFocusableContext",
|
11744 |
-
value: function getFocusableContext(target) {
|
11745 |
-
var onlyBrowserTabstops = this.props.onlyBrowserTabstops;
|
11746 |
-
var finder = onlyBrowserTabstops ? dom_build_module["a" /* focus */].tabbable : dom_build_module["a" /* focus */].focusable;
|
11747 |
-
var focusables = finder.find(this.container);
|
11748 |
-
var index = this.getFocusableIndex(focusables, target);
|
11749 |
|
11750 |
-
if (
|
11751 |
-
|
11752 |
-
index: index,
|
11753 |
-
target: target,
|
11754 |
-
focusables: focusables
|
11755 |
-
};
|
11756 |
}
|
11757 |
|
11758 |
-
|
11759 |
-
|
11760 |
-
|
11761 |
-
|
11762 |
-
|
11763 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11764 |
|
11765 |
-
|
11766 |
-
|
11767 |
-
|
|
|
11768 |
}
|
11769 |
-
}, {
|
11770 |
-
key: "onKeyDown",
|
11771 |
-
value: function onKeyDown(event) {
|
11772 |
-
if (this.props.onKeyDown) {
|
11773 |
-
this.props.onKeyDown(event);
|
11774 |
-
}
|
11775 |
|
11776 |
-
|
11777 |
-
|
11778 |
-
|
11779 |
-
cycle = _this$props$cycle === void 0 ? true : _this$props$cycle,
|
11780 |
-
eventToOffset = _this$props.eventToOffset,
|
11781 |
-
_this$props$onNavigat = _this$props.onNavigate,
|
11782 |
-
onNavigate = _this$props$onNavigat === void 0 ? external_lodash_["noop"] : _this$props$onNavigat,
|
11783 |
-
stopNavigationEvents = _this$props.stopNavigationEvents;
|
11784 |
-
var offset = eventToOffset(event); // eventToOffset returns undefined if the event is not handled by the component
|
11785 |
|
11786 |
-
|
11787 |
-
|
11788 |
-
|
11789 |
-
// from scrolling.
|
11790 |
|
11791 |
-
|
11792 |
-
|
11793 |
-
|
11794 |
-
|
|
|
|
|
11795 |
|
11796 |
-
|
11797 |
-
return;
|
11798 |
-
}
|
11799 |
|
11800 |
-
|
|
|
|
|
|
|
11801 |
|
11802 |
-
|
11803 |
-
|
11804 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11805 |
|
11806 |
-
var index = context.index,
|
11807 |
-
focusables = context.focusables;
|
11808 |
-
var nextIndex = cycle ? cycleValue(index, focusables.length, offset) : index + offset;
|
11809 |
|
11810 |
-
|
11811 |
-
|
11812 |
-
|
11813 |
-
}
|
11814 |
}
|
11815 |
-
}, {
|
11816 |
-
key: "render",
|
11817 |
-
value: function render() {
|
11818 |
-
var _this$props2 = this.props,
|
11819 |
-
children = _this$props2.children,
|
11820 |
-
props = Object(objectWithoutProperties["a" /* default */])(_this$props2, ["children"]);
|
11821 |
|
11822 |
-
|
11823 |
-
|
11824 |
-
|
11825 |
-
|
11826 |
-
}]);
|
11827 |
|
11828 |
-
|
11829 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11830 |
|
11831 |
-
var container_forwardedNavigableContainer = function forwardedNavigableContainer(props, ref) {
|
11832 |
-
return Object(external_this_wp_element_["createElement"])(container_NavigableContainer, Object(esm_extends["a" /* default */])({}, props, {
|
11833 |
-
forwardedRef: ref
|
11834 |
-
}));
|
11835 |
-
};
|
11836 |
|
11837 |
-
|
11838 |
-
|
11839 |
-
|
11840 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11841 |
|
|
|
|
|
|
|
|
|
|
|
11842 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11843 |
|
11844 |
|
11845 |
-
|
11846 |
-
|
11847 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11848 |
|
11849 |
/**
|
11850 |
-
*
|
|
|
|
|
|
|
11851 |
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
11852 |
|
11853 |
|
|
|
|
|
|
|
|
|
|
|
|
|
11854 |
|
11855 |
-
|
11856 |
-
* Internal dependencies
|
11857 |
-
*/
|
11858 |
|
|
|
|
|
|
|
|
|
|
|
11859 |
|
11860 |
-
function
|
11861 |
-
var
|
11862 |
-
|
11863 |
-
_ref$orientation = _ref.orientation,
|
11864 |
-
orientation = _ref$orientation === void 0 ? 'vertical' : _ref$orientation,
|
11865 |
-
rest = Object(objectWithoutProperties["a" /* default */])(_ref, ["role", "orientation"]);
|
11866 |
|
11867 |
-
|
11868 |
-
|
11869 |
-
|
11870 |
-
var previous = [build_module["f" /* UP */]];
|
11871 |
|
11872 |
-
|
11873 |
-
|
11874 |
-
|
11875 |
-
}
|
11876 |
|
11877 |
-
|
11878 |
-
|
11879 |
-
|
11880 |
-
|
|
|
|
|
|
|
11881 |
|
11882 |
-
|
11883 |
-
|
11884 |
-
|
11885 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11886 |
}
|
11887 |
-
};
|
11888 |
|
11889 |
-
|
11890 |
-
|
11891 |
-
|
11892 |
-
|
11893 |
-
|
11894 |
-
|
11895 |
-
eventToOffset: eventToOffset
|
11896 |
-
}, rest));
|
11897 |
}
|
11898 |
-
|
11899 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11900 |
|
11901 |
-
/***/ }),
|
11902 |
|
11903 |
-
|
11904 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
11905 |
|
11906 |
-
|
|
|
|
|
|
|
11907 |
|
11908 |
-
var
|
|
|
11909 |
|
11910 |
-
|
11911 |
-
if (call && (_typeof(call) === "object" || typeof call === "function")) {
|
11912 |
-
return call;
|
11913 |
-
}
|
11914 |
|
11915 |
-
|
11916 |
-
}
|
11917 |
|
11918 |
-
|
11919 |
|
11920 |
-
|
|
|
|
|
|
|
|
|
11921 |
|
11922 |
-
|
11923 |
-
|
|
|
|
|
11924 |
|
11925 |
-
(
|
|
|
|
|
11926 |
|
11927 |
-
|
11928 |
|
11929 |
-
|
11930 |
-
|
11931 |
|
11932 |
-
|
11933 |
-
|
11934 |
-
|
11935 |
-
|
11936 |
-
|
11937 |
-
/* harmony import */ var _stylesheets_index_scss__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(437);
|
11938 |
-
/* harmony import */ var _stylesheets_index_scss__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_stylesheets_index_scss__WEBPACK_IMPORTED_MODULE_2__);
|
11939 |
-
/* harmony import */ var _layout__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(199);
|
11940 |
-
/* harmony import */ var _navigation__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(412);
|
11941 |
-
/* harmony import */ var wc_api_wp_data_store__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(715);
|
11942 |
-
/* harmony import */ var _woocommerce_data__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(43);
|
11943 |
-
/* harmony import */ var _woocommerce_data__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_woocommerce_data__WEBPACK_IMPORTED_MODULE_6__);
|
11944 |
|
|
|
|
|
|
|
|
|
11945 |
|
11946 |
-
|
11947 |
-
|
11948 |
-
|
11949 |
|
|
|
|
|
|
|
|
|
11950 |
|
|
|
|
|
|
|
|
|
|
|
11951 |
/**
|
11952 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11953 |
*/
|
11954 |
|
11955 |
|
|
|
|
|
|
|
|
|
11956 |
|
|
|
|
|
|
|
11957 |
|
|
|
11958 |
|
11959 |
-
|
11960 |
-
|
11961 |
|
11962 |
-
|
11963 |
-
|
11964 |
-
|
11965 |
-
|
11966 |
-
var hydrateUser = window.wcSettings.currentUserData;
|
11967 |
|
11968 |
-
|
11969 |
-
|
11970 |
|
11971 |
-
|
11972 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11973 |
}
|
11974 |
|
11975 |
-
|
11976 |
-
|
11977 |
-
var adminMenu = document.getElementById('adminmenumain');
|
11978 |
-
adminMenu.classList.add('folded');
|
11979 |
}
|
11980 |
|
11981 |
-
|
11982 |
-
var
|
11983 |
-
var hydrateSettings = window.wcSettings.preloadSettings && window.wcSettings.preloadSettings.general;
|
11984 |
-
|
11985 |
-
if (hydrateSettings) {
|
11986 |
-
HydratedPageLayout = Object(_woocommerce_data__WEBPACK_IMPORTED_MODULE_6__["withSettingsHydration"])('general', {
|
11987 |
-
general: window.wcSettings.preloadSettings.general
|
11988 |
-
})(HydratedPageLayout);
|
11989 |
-
}
|
11990 |
|
11991 |
-
if (
|
11992 |
-
|
11993 |
}
|
11994 |
|
11995 |
-
|
11996 |
-
|
11997 |
-
|
11998 |
-
|
11999 |
-
|
12000 |
-
if (hydrateUser) {
|
12001 |
-
HydratedEmbedLayout = Object(_woocommerce_data__WEBPACK_IMPORTED_MODULE_6__["withCurrentUserHydration"])(hydrateUser)(HydratedEmbedLayout);
|
12002 |
-
} // Render the header.
|
12003 |
|
|
|
|
|
|
|
12004 |
|
12005 |
-
|
12006 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12007 |
|
12008 |
-
|
12009 |
-
var wrap = wpBody.querySelector('.wrap.woocommerce') || wpBody.querySelector('[class="wrap"]');
|
12010 |
-
var noticeContainer = document.createElement('div');
|
12011 |
-
Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["render"])(Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("div", {
|
12012 |
-
className: "woocommerce-layout"
|
12013 |
-
}, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_layout__WEBPACK_IMPORTED_MODULE_3__[/* PrimaryLayout */ "c"], null)), wpBody.insertBefore(noticeContainer, wrap));
|
12014 |
}
|
12015 |
-
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(56)))
|
12016 |
-
|
12017 |
-
/***/ }),
|
12018 |
-
|
12019 |
-
/***/ 436:
|
12020 |
-
/***/ (function(module, exports, __webpack_require__) {
|
12021 |
|
12022 |
/**
|
12023 |
-
*
|
|
|
|
|
12024 |
*
|
12025 |
-
*
|
12026 |
-
*
|
|
|
|
|
12027 |
*/
|
12028 |
-
|
12029 |
-
var
|
12030 |
-
|
12031 |
-
|
12032 |
-
var Op = Object.prototype;
|
12033 |
-
var hasOwn = Op.hasOwnProperty;
|
12034 |
-
var undefined; // More compressible than void 0.
|
12035 |
-
var $Symbol = typeof Symbol === "function" ? Symbol : {};
|
12036 |
-
var iteratorSymbol = $Symbol.iterator || "@@iterator";
|
12037 |
-
var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator";
|
12038 |
-
var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
|
12039 |
-
|
12040 |
-
function wrap(innerFn, outerFn, self, tryLocsList) {
|
12041 |
-
// If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.
|
12042 |
-
var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;
|
12043 |
-
var generator = Object.create(protoGenerator.prototype);
|
12044 |
-
var context = new Context(tryLocsList || []);
|
12045 |
-
|
12046 |
-
// The ._invoke method unifies the implementations of the .next,
|
12047 |
-
// .throw, and .return methods.
|
12048 |
-
generator._invoke = makeInvokeMethod(innerFn, self, context);
|
12049 |
-
|
12050 |
-
return generator;
|
12051 |
}
|
12052 |
-
exports.wrap = wrap;
|
12053 |
|
12054 |
-
|
12055 |
-
|
12056 |
-
|
12057 |
-
|
12058 |
-
// already have an existing method we want to call, so there's no need
|
12059 |
-
// to create a new function object. We can even get away with assuming
|
12060 |
-
// the method takes exactly one argument, since that happens to be true
|
12061 |
-
// in every case, so we don't have to touch the arguments object. The
|
12062 |
-
// only additional allocation required is the completion record, which
|
12063 |
-
// has a stable shape and so hopefully should be cheap to allocate.
|
12064 |
-
function tryCatch(fn, obj, arg) {
|
12065 |
-
try {
|
12066 |
-
return { type: "normal", arg: fn.call(obj, arg) };
|
12067 |
-
} catch (err) {
|
12068 |
-
return { type: "throw", arg: err };
|
12069 |
-
}
|
12070 |
}
|
12071 |
|
12072 |
-
|
12073 |
-
|
12074 |
-
|
12075 |
-
var GenStateCompleted = "completed";
|
12076 |
-
|
12077 |
-
// Returning this object from the innerFn has the same effect as
|
12078 |
-
// breaking out of the dispatch switch statement.
|
12079 |
-
var ContinueSentinel = {};
|
12080 |
-
|
12081 |
-
// Dummy constructor functions that we use as the .constructor and
|
12082 |
-
// .constructor.prototype properties for functions that return Generator
|
12083 |
-
// objects. For full spec compliance, you may wish to configure your
|
12084 |
-
// minifier not to mangle the names of these two functions.
|
12085 |
-
function Generator() {}
|
12086 |
-
function GeneratorFunction() {}
|
12087 |
-
function GeneratorFunctionPrototype() {}
|
12088 |
|
12089 |
-
|
12090 |
-
|
12091 |
-
|
12092 |
-
|
12093 |
-
|
12094 |
-
|
12095 |
|
12096 |
-
|
12097 |
-
|
12098 |
-
|
12099 |
-
|
12100 |
-
|
12101 |
-
|
12102 |
-
|
12103 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12104 |
}
|
12105 |
|
12106 |
-
|
12107 |
-
|
12108 |
-
|
12109 |
-
GeneratorFunctionPrototype.constructor = GeneratorFunction;
|
12110 |
-
GeneratorFunctionPrototype[toStringTagSymbol] =
|
12111 |
-
GeneratorFunction.displayName = "GeneratorFunction";
|
12112 |
|
12113 |
-
|
12114 |
-
|
12115 |
-
function defineIteratorMethods(prototype) {
|
12116 |
-
["next", "throw", "return"].forEach(function(method) {
|
12117 |
-
prototype[method] = function(arg) {
|
12118 |
-
return this._invoke(method, arg);
|
12119 |
};
|
12120 |
-
});
|
12121 |
-
}
|
12122 |
|
12123 |
-
|
12124 |
-
|
12125 |
-
|
12126 |
-
|
12127 |
-
|
12128 |
-
|
12129 |
-
|
12130 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
12131 |
};
|
|
|
12132 |
|
12133 |
-
|
12134 |
-
|
12135 |
-
|
12136 |
-
|
12137 |
-
genFun.__proto__ = GeneratorFunctionPrototype;
|
12138 |
-
if (!(toStringTagSymbol in genFun)) {
|
12139 |
-
genFun[toStringTagSymbol] = "GeneratorFunction";
|
12140 |
-
}
|
12141 |
-
}
|
12142 |
-
genFun.prototype = Object.create(Gp);
|
12143 |
-
return genFun;
|
12144 |
-
};
|
12145 |
|
12146 |
-
|
12147 |
-
// `yield regeneratorRuntime.awrap(x)`, so that the runtime can test
|
12148 |
-
// `hasOwn.call(value, "__await")` to determine if the yielded value is
|
12149 |
-
// meant to be awaited.
|
12150 |
-
exports.awrap = function(arg) {
|
12151 |
-
return { __await: arg };
|
12152 |
-
};
|
12153 |
|
12154 |
-
|
12155 |
-
function invoke(method, arg, resolve, reject) {
|
12156 |
-
var record = tryCatch(generator[method], generator, arg);
|
12157 |
-
if (record.type === "throw") {
|
12158 |
-
reject(record.arg);
|
12159 |
-
} else {
|
12160 |
-
var result = record.arg;
|
12161 |
-
var value = result.value;
|
12162 |
-
if (value &&
|
12163 |
-
typeof value === "object" &&
|
12164 |
-
hasOwn.call(value, "__await")) {
|
12165 |
-
return PromiseImpl.resolve(value.__await).then(function(value) {
|
12166 |
-
invoke("next", value, resolve, reject);
|
12167 |
-
}, function(err) {
|
12168 |
-
invoke("throw", err, resolve, reject);
|
12169 |
-
});
|
12170 |
-
}
|
12171 |
|
12172 |
-
return PromiseImpl.resolve(value).then(function(unwrapped) {
|
12173 |
-
// When a yielded Promise is resolved, its final value becomes
|
12174 |
-
// the .value of the Promise<{value,done}> result for the
|
12175 |
-
// current iteration.
|
12176 |
-
result.value = unwrapped;
|
12177 |
-
resolve(result);
|
12178 |
-
}, function(error) {
|
12179 |
-
// If a rejected Promise was yielded, throw the rejection back
|
12180 |
-
// into the async generator function so it can be handled there.
|
12181 |
-
return invoke("throw", error, resolve, reject);
|
12182 |
-
});
|
12183 |
-
}
|
12184 |
-
}
|
12185 |
|
12186 |
-
var previousPromise;
|
12187 |
|
12188 |
-
function enqueue(method, arg) {
|
12189 |
-
function callInvokeWithMethodAndArg() {
|
12190 |
-
return new PromiseImpl(function(resolve, reject) {
|
12191 |
-
invoke(method, arg, resolve, reject);
|
12192 |
-
});
|
12193 |
-
}
|
12194 |
|
12195 |
-
|
12196 |
-
// If enqueue has been called before, then we want to wait until
|
12197 |
-
// all previous Promises have been resolved before calling invoke,
|
12198 |
-
// so that results are always delivered in the correct order. If
|
12199 |
-
// enqueue has not been called before, then it is important to
|
12200 |
-
// call invoke immediately, without waiting on a callback to fire,
|
12201 |
-
// so that the async generator function has the opportunity to do
|
12202 |
-
// any necessary setup in a predictable way. This predictability
|
12203 |
-
// is why the Promise constructor synchronously invokes its
|
12204 |
-
// executor callback, and why async functions synchronously
|
12205 |
-
// execute code before the first await. Since we implement simple
|
12206 |
-
// async functions in terms of async generators, it is especially
|
12207 |
-
// important to get this right, even though it requires care.
|
12208 |
-
previousPromise ? previousPromise.then(
|
12209 |
-
callInvokeWithMethodAndArg,
|
12210 |
-
// Avoid propagating failures to Promises returned by later
|
12211 |
-
// invocations of the iterator.
|
12212 |
-
callInvokeWithMethodAndArg
|
12213 |
-
) : callInvokeWithMethodAndArg();
|
12214 |
-
}
|
12215 |
|
12216 |
-
|
12217 |
-
|
12218 |
-
this._invoke = enqueue;
|
12219 |
-
}
|
12220 |
|
12221 |
-
|
12222 |
-
AsyncIterator.prototype[asyncIteratorSymbol] = function () {
|
12223 |
-
return this;
|
12224 |
-
};
|
12225 |
-
exports.AsyncIterator = AsyncIterator;
|
12226 |
|
12227 |
-
|
12228 |
-
// AsyncIterator objects; they just return a Promise for the value of
|
12229 |
-
// the final result produced by the iterator.
|
12230 |
-
exports.async = function(innerFn, outerFn, self, tryLocsList, PromiseImpl) {
|
12231 |
-
if (PromiseImpl === void 0) PromiseImpl = Promise;
|
12232 |
|
12233 |
-
|
12234 |
-
|
12235 |
-
PromiseImpl
|
12236 |
-
);
|
12237 |
|
12238 |
-
|
12239 |
-
? iter // If outerFn is a generator, return the full iterator.
|
12240 |
-
: iter.next().then(function(result) {
|
12241 |
-
return result.done ? result.value : iter.next();
|
12242 |
-
});
|
12243 |
-
};
|
12244 |
|
12245 |
-
|
12246 |
-
var state = GenStateSuspendedStart;
|
12247 |
|
12248 |
-
|
12249 |
-
|
12250 |
-
throw new Error("Generator is already running");
|
12251 |
-
}
|
12252 |
|
12253 |
-
|
12254 |
-
|
12255 |
-
|
12256 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12257 |
|
12258 |
-
|
12259 |
-
|
12260 |
-
|
12261 |
-
|
12262 |
|
12263 |
-
|
12264 |
-
|
|
|
|
|
12265 |
|
12266 |
-
|
12267 |
-
|
12268 |
-
|
12269 |
-
|
12270 |
-
|
12271 |
-
|
12272 |
-
|
12273 |
-
|
12274 |
-
}
|
12275 |
|
12276 |
-
|
12277 |
-
// Setting context._sent for legacy support of Babel's
|
12278 |
-
// function.sent implementation.
|
12279 |
-
context.sent = context._sent = context.arg;
|
12280 |
|
12281 |
-
|
12282 |
-
|
12283 |
-
|
12284 |
-
|
12285 |
-
|
|
|
|
|
12286 |
|
12287 |
-
|
|
|
|
|
12288 |
|
12289 |
-
|
12290 |
-
|
12291 |
-
}
|
12292 |
|
12293 |
-
|
12294 |
|
12295 |
-
|
12296 |
-
|
12297 |
-
// If an exception is thrown from innerFn, we leave state ===
|
12298 |
-
// GenStateExecuting and loop back for another invocation.
|
12299 |
-
state = context.done
|
12300 |
-
? GenStateCompleted
|
12301 |
-
: GenStateSuspendedYield;
|
12302 |
|
12303 |
-
|
12304 |
-
continue;
|
12305 |
-
}
|
12306 |
|
12307 |
-
|
12308 |
-
|
12309 |
-
|
12310 |
-
|
|
|
|
|
|
|
12311 |
|
12312 |
-
|
12313 |
-
state = GenStateCompleted;
|
12314 |
-
// Dispatch the exception by looping back around to the
|
12315 |
-
// context.dispatchException(context.arg) call above.
|
12316 |
-
context.method = "throw";
|
12317 |
-
context.arg = record.arg;
|
12318 |
-
}
|
12319 |
-
}
|
12320 |
-
};
|
12321 |
-
}
|
12322 |
|
12323 |
-
|
12324 |
-
|
12325 |
-
// delegate iterator, or by modifying context.method and context.arg,
|
12326 |
-
// setting context.delegate to null, and returning the ContinueSentinel.
|
12327 |
-
function maybeInvokeDelegate(delegate, context) {
|
12328 |
-
var method = delegate.iterator[context.method];
|
12329 |
-
if (method === undefined) {
|
12330 |
-
// A .throw or .return when the delegate iterator has no .throw
|
12331 |
-
// method always terminates the yield* loop.
|
12332 |
-
context.delegate = null;
|
12333 |
|
12334 |
-
|
12335 |
-
|
12336 |
-
if (delegate.iterator["return"]) {
|
12337 |
-
// If the delegate iterator has a return method, give it a
|
12338 |
-
// chance to clean up.
|
12339 |
-
context.method = "return";
|
12340 |
-
context.arg = undefined;
|
12341 |
-
maybeInvokeDelegate(delegate, context);
|
12342 |
|
12343 |
-
|
12344 |
-
|
12345 |
-
// "return" to "throw", let that override the TypeError below.
|
12346 |
-
return ContinueSentinel;
|
12347 |
-
}
|
12348 |
-
}
|
12349 |
|
12350 |
-
|
12351 |
-
|
12352 |
-
"The iterator does not provide a 'throw' method");
|
12353 |
-
}
|
12354 |
|
12355 |
-
|
12356 |
-
|
|
|
|
|
12357 |
|
12358 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
12359 |
|
12360 |
-
|
12361 |
-
|
12362 |
-
context.arg = record.arg;
|
12363 |
-
context.delegate = null;
|
12364 |
-
return ContinueSentinel;
|
12365 |
-
}
|
12366 |
|
12367 |
-
|
|
|
|
|
|
|
|
|
12368 |
|
12369 |
-
if (! info) {
|
12370 |
-
context.method = "throw";
|
12371 |
-
context.arg = new TypeError("iterator result is not an object");
|
12372 |
-
context.delegate = null;
|
12373 |
-
return ContinueSentinel;
|
12374 |
-
}
|
12375 |
|
12376 |
-
if (info.done) {
|
12377 |
-
// Assign the result of the finished delegate to the temporary
|
12378 |
-
// variable specified by delegate.resultName (see delegateYield).
|
12379 |
-
context[delegate.resultName] = info.value;
|
12380 |
|
12381 |
-
|
12382 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12383 |
|
12384 |
-
|
12385 |
-
|
12386 |
-
|
12387 |
-
// "consumed" by the delegate iterator. If context.method was
|
12388 |
-
// "return", allow the original .return call to continue in the
|
12389 |
-
// outer generator.
|
12390 |
-
if (context.method !== "return") {
|
12391 |
-
context.method = "next";
|
12392 |
-
context.arg = undefined;
|
12393 |
-
}
|
12394 |
|
12395 |
-
|
12396 |
-
|
12397 |
-
|
12398 |
-
}
|
12399 |
|
12400 |
-
// The delegate iterator is finished, so forget it and continue with
|
12401 |
-
// the outer generator.
|
12402 |
-
context.delegate = null;
|
12403 |
-
return ContinueSentinel;
|
12404 |
-
}
|
12405 |
|
12406 |
-
|
12407 |
-
|
12408 |
-
|
12409 |
|
12410 |
-
Gp[toStringTagSymbol] = "Generator";
|
12411 |
|
12412 |
-
|
12413 |
-
|
12414 |
-
|
12415 |
-
// object to not be returned from this call. This ensures that doesn't happen.
|
12416 |
-
// See https://github.com/facebook/regenerator/issues/274 for more details.
|
12417 |
-
Gp[iteratorSymbol] = function() {
|
12418 |
-
return this;
|
12419 |
-
};
|
12420 |
|
12421 |
-
|
12422 |
-
|
12423 |
-
|
|
|
|
|
|
|
12424 |
|
12425 |
-
|
12426 |
-
|
|
|
12427 |
|
12428 |
-
|
12429 |
-
|
12430 |
-
|
|
|
12431 |
|
12432 |
-
|
12433 |
-
|
12434 |
-
|
12435 |
-
|
12436 |
|
12437 |
-
|
12438 |
-
|
|
|
|
|
12439 |
|
12440 |
-
|
12441 |
-
|
12442 |
-
|
12443 |
-
|
12444 |
-
entry.completion = record;
|
12445 |
-
}
|
12446 |
|
12447 |
-
|
12448 |
-
|
12449 |
-
|
12450 |
-
|
12451 |
-
this.tryEntries = [{ tryLoc: "root" }];
|
12452 |
-
tryLocsList.forEach(pushTryEntry, this);
|
12453 |
-
this.reset(true);
|
12454 |
-
}
|
12455 |
|
12456 |
-
|
12457 |
-
|
12458 |
-
|
12459 |
-
|
12460 |
-
}
|
12461 |
-
keys.reverse();
|
12462 |
|
12463 |
-
|
12464 |
-
|
12465 |
-
|
12466 |
-
|
12467 |
-
var key = keys.pop();
|
12468 |
-
if (key in object) {
|
12469 |
-
next.value = key;
|
12470 |
-
next.done = false;
|
12471 |
-
return next;
|
12472 |
-
}
|
12473 |
-
}
|
12474 |
|
12475 |
-
|
12476 |
-
|
12477 |
-
|
12478 |
-
|
12479 |
-
return next;
|
12480 |
-
};
|
12481 |
-
};
|
12482 |
|
12483 |
-
|
12484 |
-
|
12485 |
-
|
12486 |
-
|
12487 |
-
return iteratorMethod.call(iterable);
|
12488 |
-
}
|
12489 |
|
12490 |
-
|
12491 |
-
|
12492 |
-
|
|
|
12493 |
|
12494 |
-
|
12495 |
-
|
12496 |
-
|
12497 |
-
|
12498 |
-
next.value = iterable[i];
|
12499 |
-
next.done = false;
|
12500 |
-
return next;
|
12501 |
-
}
|
12502 |
-
}
|
12503 |
|
12504 |
-
|
12505 |
-
|
|
|
|
|
12506 |
|
12507 |
-
|
12508 |
-
|
|
|
|
|
12509 |
|
12510 |
-
|
12511 |
-
|
12512 |
-
|
|
|
12513 |
|
12514 |
-
|
12515 |
-
|
12516 |
-
|
12517 |
-
|
12518 |
|
12519 |
-
|
12520 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12521 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12522 |
|
12523 |
-
|
12524 |
-
|
|
|
12525 |
|
12526 |
-
|
12527 |
-
|
12528 |
-
|
12529 |
-
|
12530 |
-
|
12531 |
-
|
12532 |
-
|
12533 |
-
|
|
|
|
|
12534 |
|
12535 |
-
|
12536 |
-
|
|
|
12537 |
|
12538 |
-
|
12539 |
|
12540 |
-
|
12541 |
-
for (var name in this) {
|
12542 |
-
// Not sure about the optimal order of these conditions:
|
12543 |
-
if (name.charAt(0) === "t" &&
|
12544 |
-
hasOwn.call(this, name) &&
|
12545 |
-
!isNaN(+name.slice(1))) {
|
12546 |
-
this[name] = undefined;
|
12547 |
-
}
|
12548 |
-
}
|
12549 |
-
}
|
12550 |
-
},
|
12551 |
|
12552 |
-
|
12553 |
-
|
|
|
12554 |
|
12555 |
-
|
12556 |
-
|
12557 |
-
if (rootRecord.type === "throw") {
|
12558 |
-
throw rootRecord.arg;
|
12559 |
}
|
12560 |
|
12561 |
-
return
|
12562 |
-
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12563 |
|
12564 |
-
|
12565 |
-
|
12566 |
-
|
12567 |
-
}
|
12568 |
|
12569 |
-
|
12570 |
-
|
12571 |
-
|
12572 |
-
|
12573 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12574 |
|
12575 |
-
if (caught) {
|
12576 |
-
// If the dispatched exception was caught by a catch block,
|
12577 |
-
// then let that catch block handle the exception normally.
|
12578 |
-
context.method = "next";
|
12579 |
-
context.arg = undefined;
|
12580 |
-
}
|
12581 |
|
12582 |
-
|
12583 |
-
|
|
|
12584 |
|
12585 |
-
|
12586 |
-
|
12587 |
-
var record = entry.completion;
|
12588 |
|
12589 |
-
|
12590 |
-
|
12591 |
-
|
12592 |
-
// throw the exception.
|
12593 |
-
return handle("end");
|
12594 |
-
}
|
12595 |
|
12596 |
-
|
12597 |
-
|
12598 |
-
|
12599 |
|
12600 |
-
|
12601 |
-
|
12602 |
-
|
12603 |
-
|
12604 |
-
return handle(entry.finallyLoc);
|
12605 |
-
}
|
12606 |
|
12607 |
-
|
12608 |
-
if (this.prev < entry.catchLoc) {
|
12609 |
-
return handle(entry.catchLoc, true);
|
12610 |
-
}
|
12611 |
|
12612 |
-
|
12613 |
-
|
12614 |
-
return handle(entry.finallyLoc);
|
12615 |
-
}
|
12616 |
|
12617 |
-
|
12618 |
-
|
12619 |
-
}
|
12620 |
-
}
|
12621 |
-
}
|
12622 |
-
},
|
12623 |
|
12624 |
-
|
12625 |
-
|
12626 |
-
|
12627 |
-
|
12628 |
-
|
12629 |
-
|
12630 |
-
|
12631 |
-
|
12632 |
-
|
12633 |
-
}
|
12634 |
|
12635 |
-
|
12636 |
-
|
12637 |
-
type === "continue") &&
|
12638 |
-
finallyEntry.tryLoc <= arg &&
|
12639 |
-
arg <= finallyEntry.finallyLoc) {
|
12640 |
-
// Ignore the finally entry if control is not jumping to a
|
12641 |
-
// location outside the try/catch block.
|
12642 |
-
finallyEntry = null;
|
12643 |
-
}
|
12644 |
|
12645 |
-
|
12646 |
-
record.type = type;
|
12647 |
-
record.arg = arg;
|
12648 |
|
12649 |
-
|
12650 |
-
this.method = "next";
|
12651 |
-
this.next = finallyEntry.finallyLoc;
|
12652 |
-
return ContinueSentinel;
|
12653 |
-
}
|
12654 |
|
12655 |
-
|
12656 |
-
|
12657 |
|
12658 |
-
|
12659 |
-
|
12660 |
-
throw record.arg;
|
12661 |
-
}
|
12662 |
|
12663 |
-
|
12664 |
-
|
12665 |
-
|
12666 |
-
|
12667 |
-
this.rval = this.arg = record.arg;
|
12668 |
-
this.method = "return";
|
12669 |
-
this.next = "end";
|
12670 |
-
} else if (record.type === "normal" && afterLoc) {
|
12671 |
-
this.next = afterLoc;
|
12672 |
-
}
|
12673 |
|
12674 |
-
|
12675 |
-
|
12676 |
|
12677 |
-
|
12678 |
-
|
12679 |
-
|
12680 |
-
|
12681 |
-
|
12682 |
-
|
12683 |
-
|
|
|
|
|
|
|
|
|
|
|
12684 |
}
|
12685 |
-
|
12686 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12687 |
|
12688 |
-
|
12689 |
-
|
12690 |
-
|
12691 |
-
|
12692 |
-
|
12693 |
-
|
12694 |
-
|
12695 |
-
|
12696 |
-
|
12697 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12698 |
}
|
12699 |
-
|
12700 |
|
12701 |
-
// The context.catch method must only be called with a location
|
12702 |
-
// argument that corresponds to a known catch block.
|
12703 |
-
throw new Error("illegal catch attempt");
|
12704 |
-
},
|
12705 |
|
12706 |
-
delegateYield: function(iterable, resultName, nextLoc) {
|
12707 |
-
this.delegate = {
|
12708 |
-
iterator: values(iterable),
|
12709 |
-
resultName: resultName,
|
12710 |
-
nextLoc: nextLoc
|
12711 |
-
};
|
12712 |
|
12713 |
-
|
12714 |
-
|
12715 |
-
|
12716 |
-
|
12717 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12718 |
|
12719 |
-
|
|
|
|
|
|
|
|
|
|
|
12720 |
}
|
12721 |
-
|
|
|
|
|
|
|
|
|
12722 |
|
12723 |
-
|
12724 |
-
|
12725 |
-
|
12726 |
-
|
12727 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12728 |
|
12729 |
-
}
|
12730 |
-
// If this script is executing as a CommonJS module, use module.exports
|
12731 |
-
// as the regeneratorRuntime namespace. Otherwise create a new empty
|
12732 |
-
// object. Either way, the resulting object will be used to initialize
|
12733 |
-
// the regeneratorRuntime variable at the top of this file.
|
12734 |
-
true ? module.exports : undefined
|
12735 |
-
));
|
12736 |
|
12737 |
-
|
12738 |
-
|
12739 |
-
|
12740 |
-
|
12741 |
-
|
12742 |
-
|
12743 |
-
|
12744 |
-
|
12745 |
-
|
12746 |
-
// you've misconfigured your bundler to force strict mode and applied a
|
12747 |
-
// CSP to forbid Function, and you're not willing to fix either of those
|
12748 |
-
// problems, please detail your unique predicament in a GitHub issue.
|
12749 |
-
Function("r", "regeneratorRuntime = r")(runtime);
|
12750 |
-
}
|
12751 |
|
|
|
12752 |
|
12753 |
-
|
|
|
|
|
12754 |
|
12755 |
-
|
12756 |
-
|
|
|
|
|
|
|
12757 |
|
12758 |
-
// extracted by mini-css-extract-plugin
|
12759 |
|
12760 |
/***/ }),
|
12761 |
|
12762 |
-
/***/
|
12763 |
/***/ (function(module, exports, __webpack_require__) {
|
12764 |
|
12765 |
-
|
12766 |
|
12767 |
-
/***/ }),
|
12768 |
|
12769 |
-
|
12770 |
-
|
|
|
12771 |
|
12772 |
-
|
|
|
|
|
12773 |
|
12774 |
-
/***/ }),
|
12775 |
|
12776 |
-
|
12777 |
-
|
|
|
12778 |
|
12779 |
-
// extracted by mini-css-extract-plugin
|
12780 |
|
12781 |
-
|
12782 |
|
12783 |
-
|
12784 |
-
/***/ (function(module, exports, __webpack_require__) {
|
12785 |
|
12786 |
-
|
12787 |
|
|
|
12788 |
|
12789 |
-
|
12790 |
-
* Copyright 2015, Yahoo! Inc.
|
12791 |
-
* Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.
|
12792 |
-
*/
|
12793 |
-
var REACT_STATICS = {
|
12794 |
-
childContextTypes: true,
|
12795 |
-
contextTypes: true,
|
12796 |
-
defaultProps: true,
|
12797 |
-
displayName: true,
|
12798 |
-
getDefaultProps: true,
|
12799 |
-
getDerivedStateFromProps: true,
|
12800 |
-
mixins: true,
|
12801 |
-
propTypes: true,
|
12802 |
-
type: true
|
12803 |
-
};
|
12804 |
|
12805 |
-
var
|
12806 |
-
name: true,
|
12807 |
-
length: true,
|
12808 |
-
prototype: true,
|
12809 |
-
caller: true,
|
12810 |
-
callee: true,
|
12811 |
-
arguments: true,
|
12812 |
-
arity: true
|
12813 |
-
};
|
12814 |
|
12815 |
-
|
12816 |
-
var getOwnPropertyNames = Object.getOwnPropertyNames;
|
12817 |
-
var getOwnPropertySymbols = Object.getOwnPropertySymbols;
|
12818 |
-
var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
|
12819 |
-
var getPrototypeOf = Object.getPrototypeOf;
|
12820 |
-
var objectPrototype = getPrototypeOf && getPrototypeOf(Object);
|
12821 |
|
12822 |
-
|
12823 |
-
if (typeof sourceComponent !== 'string') { // don't hoist over string (html) components
|
12824 |
|
12825 |
-
|
12826 |
-
|
12827 |
-
|
12828 |
-
|
12829 |
-
|
12830 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12831 |
|
12832 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12833 |
|
12834 |
-
|
12835 |
-
|
12836 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12837 |
|
12838 |
-
|
12839 |
-
|
12840 |
-
|
12841 |
-
|
12842 |
-
|
12843 |
-
|
12844 |
-
} catch (e) {}
|
12845 |
-
}
|
12846 |
-
}
|
12847 |
|
12848 |
-
|
12849 |
-
|
|
|
|
|
|
|
|
|
12850 |
|
12851 |
-
|
12852 |
-
|
|
|
12853 |
|
12854 |
-
|
|
|
|
|
|
|
|
|
12855 |
|
|
|
|
|
12856 |
|
12857 |
-
|
|
|
|
|
|
|
12858 |
|
12859 |
-
/***/ 442:
|
12860 |
-
/***/ (function(module, exports, __webpack_require__) {
|
12861 |
|
12862 |
-
|
12863 |
|
12864 |
-
|
|
|
|
|
12865 |
|
12866 |
-
|
12867 |
-
|
|
|
|
|
12868 |
|
12869 |
-
|
|
|
12870 |
|
12871 |
-
|
12872 |
|
12873 |
-
|
12874 |
-
|
|
|
|
|
|
|
|
|
12875 |
|
12876 |
-
|
12877 |
-
|
12878 |
};
|
12879 |
|
|
|
|
|
12880 |
|
12881 |
/***/ }),
|
12882 |
|
12883 |
-
/***/
|
12884 |
-
/***/ (function(module,
|
12885 |
|
12886 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12887 |
|
12888 |
-
/***/ }),
|
12889 |
|
12890 |
-
/***/ 446:
|
12891 |
-
/***/ (function(module, exports) {
|
12892 |
|
12893 |
-
|
12894 |
-
if (!originalModule.webpackPolyfill) {
|
12895 |
-
var module = Object.create(originalModule);
|
12896 |
-
// module.parent = undefined by default
|
12897 |
-
if (!module.children) module.children = [];
|
12898 |
-
Object.defineProperty(module, "loaded", {
|
12899 |
-
enumerable: true,
|
12900 |
-
get: function() {
|
12901 |
-
return module.l;
|
12902 |
-
}
|
12903 |
-
});
|
12904 |
-
Object.defineProperty(module, "id", {
|
12905 |
-
enumerable: true,
|
12906 |
-
get: function() {
|
12907 |
-
return module.i;
|
12908 |
-
}
|
12909 |
-
});
|
12910 |
-
Object.defineProperty(module, "exports", {
|
12911 |
-
enumerable: true
|
12912 |
-
});
|
12913 |
-
module.webpackPolyfill = 1;
|
12914 |
-
}
|
12915 |
-
return module;
|
12916 |
-
};
|
12917 |
|
|
|
12918 |
|
12919 |
-
|
|
|
|
|
12920 |
|
12921 |
-
|
12922 |
-
|
|
|
12923 |
|
12924 |
-
|
12925 |
|
12926 |
-
|
12927 |
-
__webpack_require__.d(__webpack_exports__, "a", function() { return /* binding */ build_module_focus; });
|
12928 |
|
12929 |
-
|
12930 |
|
12931 |
-
|
12932 |
-
var focusable_namespaceObject = {};
|
12933 |
-
__webpack_require__.r(focusable_namespaceObject);
|
12934 |
-
__webpack_require__.d(focusable_namespaceObject, "find", function() { return find; });
|
12935 |
|
12936 |
-
|
12937 |
-
|
12938 |
-
|
12939 |
-
|
12940 |
-
|
12941 |
-
__webpack_require__.d(tabbable_namespaceObject, "findPrevious", function() { return findPrevious; });
|
12942 |
-
__webpack_require__.d(tabbable_namespaceObject, "findNext", function() { return findNext; });
|
12943 |
|
12944 |
-
|
|
|
|
|
12945 |
/**
|
12946 |
-
*
|
12947 |
*
|
12948 |
-
*
|
12949 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
12950 |
*
|
12951 |
-
*
|
12952 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
12953 |
*
|
12954 |
-
*
|
12955 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
12956 |
*
|
12957 |
-
*
|
12958 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
12959 |
*
|
12960 |
-
*
|
12961 |
-
* - https://w3c.github.io/html/editing.html#data-model
|
12962 |
*/
|
12963 |
-
|
|
|
|
|
|
|
12964 |
/**
|
12965 |
-
*
|
12966 |
-
* nor visibility: hidden).
|
12967 |
*
|
12968 |
-
* @
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12969 |
*
|
12970 |
-
* @return {
|
12971 |
*/
|
12972 |
|
12973 |
-
function
|
12974 |
-
return
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12975 |
}
|
12976 |
-
/**
|
12977 |
-
* Returns true if the specified area element is a valid focusable element, or
|
12978 |
-
* false otherwise. Area is only focusable if within a map where a named map
|
12979 |
-
* referenced by an image somewhere in the document.
|
12980 |
-
*
|
12981 |
-
* @param {Element} element DOM area element to test.
|
12982 |
-
*
|
12983 |
-
* @return {boolean} Whether area element is valid for focus.
|
12984 |
-
*/
|
12985 |
|
|
|
12986 |
|
12987 |
-
|
12988 |
-
|
12989 |
|
12990 |
-
|
12991 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12992 |
}
|
12993 |
|
12994 |
-
|
12995 |
-
return !!img && isVisible(img);
|
12996 |
}
|
12997 |
-
/**
|
12998 |
-
* Returns all focusable elements within a given context.
|
12999 |
-
*
|
13000 |
-
* @param {Element} context Element in which to search.
|
13001 |
-
*
|
13002 |
-
* @return {Element[]} Focusable elements.
|
13003 |
-
*/
|
13004 |
|
|
|
13005 |
|
13006 |
-
|
13007 |
-
|
13008 |
-
return Array.from(elements).filter(function (element) {
|
13009 |
-
if (!isVisible(element)) {
|
13010 |
-
return false;
|
13011 |
-
}
|
13012 |
-
|
13013 |
-
var nodeName = element.nodeName;
|
13014 |
|
13015 |
-
|
13016 |
-
|
13017 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
13018 |
|
13019 |
-
|
13020 |
-
|
|
|
|
|
13021 |
}
|
13022 |
-
//# sourceMappingURL=focusable.js.map
|
13023 |
-
// EXTERNAL MODULE: external "lodash"
|
13024 |
-
var external_lodash_ = __webpack_require__(2);
|
13025 |
|
13026 |
-
|
13027 |
-
/**
|
13028 |
-
* External dependencies
|
13029 |
-
*/
|
13030 |
|
13031 |
-
|
13032 |
-
* Internal dependencies
|
13033 |
-
*/
|
13034 |
|
|
|
|
|
13035 |
|
13036 |
-
|
13037 |
-
* Returns the tab index of the given element. In contrast with the tabIndex
|
13038 |
-
* property, this normalizes the default (0) to avoid browser inconsistencies,
|
13039 |
-
* operating under the assumption that this function is only ever called with a
|
13040 |
-
* focusable node.
|
13041 |
-
*
|
13042 |
-
* @see https://bugzilla.mozilla.org/show_bug.cgi?id=1190261
|
13043 |
-
*
|
13044 |
-
* @param {Element} element Element from which to retrieve.
|
13045 |
-
*
|
13046 |
-
* @return {?number} Tab index of element (default 0).
|
13047 |
-
*/
|
13048 |
|
13049 |
-
function getTabIndex(element) {
|
13050 |
-
var tabIndex = element.getAttribute('tabindex');
|
13051 |
-
return tabIndex === null ? 0 : parseInt(tabIndex, 10);
|
13052 |
-
}
|
13053 |
-
/**
|
13054 |
-
* Returns true if the specified element is tabbable, or false otherwise.
|
13055 |
-
*
|
13056 |
-
* @param {Element} element Element to test.
|
13057 |
-
*
|
13058 |
-
* @return {boolean} Whether element is tabbable.
|
13059 |
-
*/
|
13060 |
|
|
|
13061 |
|
13062 |
-
function
|
13063 |
-
return getTabIndex(element) !== -1;
|
13064 |
-
}
|
13065 |
-
/**
|
13066 |
-
* Returns a stateful reducer function which constructs a filtered array of
|
13067 |
-
* tabbable elements, where at most one radio input is selected for a given
|
13068 |
-
* name, giving priority to checked input, falling back to the first
|
13069 |
-
* encountered.
|
13070 |
-
*
|
13071 |
-
* @return {Function} Radio group collapse reducer.
|
13072 |
-
*/
|
13073 |
|
13074 |
-
function
|
13075 |
-
var CHOSEN_RADIO_BY_NAME = {};
|
13076 |
-
return function collapseRadioGroup(result, element) {
|
13077 |
-
var nodeName = element.nodeName,
|
13078 |
-
type = element.type,
|
13079 |
-
checked = element.checked,
|
13080 |
-
name = element.name; // For all non-radio tabbables, construct to array by concatenating.
|
13081 |
|
13082 |
-
|
13083 |
-
return result.concat(element);
|
13084 |
-
}
|
13085 |
|
13086 |
-
|
13087 |
|
13088 |
-
|
13089 |
|
13090 |
-
|
13091 |
-
|
13092 |
-
|
13093 |
-
// element is checked and should take priority. Retroactively remove
|
13094 |
-
// the element which had previously been considered the chosen one.
|
13095 |
|
|
|
|
|
13096 |
|
13097 |
-
|
13098 |
-
|
13099 |
-
result = Object(external_lodash_["without"])(result, hadChosenElement);
|
13100 |
-
}
|
13101 |
|
13102 |
-
|
13103 |
-
|
13104 |
-
};
|
13105 |
-
}
|
13106 |
-
/**
|
13107 |
-
* An array map callback, returning an object with the element value and its
|
13108 |
-
* array index location as properties. This is used to emulate a proper stable
|
13109 |
-
* sort where equal tabIndex should be left in order of their occurrence in the
|
13110 |
-
* document.
|
13111 |
-
*
|
13112 |
-
* @param {Element} element Element.
|
13113 |
-
* @param {number} index Array index of element.
|
13114 |
-
*
|
13115 |
-
* @return {Object} Mapped object with element, index.
|
13116 |
-
*/
|
13117 |
|
|
|
13118 |
|
13119 |
-
|
13120 |
-
|
13121 |
-
|
13122 |
-
|
13123 |
-
|
13124 |
-
|
13125 |
-
|
13126 |
-
|
13127 |
-
|
13128 |
-
|
13129 |
-
|
13130 |
-
|
13131 |
-
|
13132 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13133 |
|
|
|
|
|
|
|
13134 |
|
13135 |
-
|
13136 |
-
|
13137 |
-
|
13138 |
-
|
13139 |
-
|
13140 |
-
|
13141 |
-
|
13142 |
-
|
13143 |
-
|
13144 |
-
* @param {Object} b Second object to compare.
|
13145 |
-
*
|
13146 |
-
* @return {number} Comparator result.
|
13147 |
-
*/
|
13148 |
|
|
|
|
|
13149 |
|
13150 |
-
|
13151 |
-
var aTabIndex = getTabIndex(a.element);
|
13152 |
-
var bTabIndex = getTabIndex(b.element);
|
13153 |
|
13154 |
-
|
13155 |
-
|
13156 |
-
}
|
13157 |
|
13158 |
-
|
13159 |
-
}
|
13160 |
-
/**
|
13161 |
-
* Givin focusable elements, filters out tabbable element.
|
13162 |
-
*
|
13163 |
-
* @param {Array} focusables Focusable elements to filter.
|
13164 |
-
*
|
13165 |
-
* @return {Array} Tabbable elements.
|
13166 |
-
*/
|
13167 |
|
|
|
|
|
13168 |
|
13169 |
-
function
|
13170 |
-
|
|
|
|
|
13171 |
}
|
13172 |
|
13173 |
-
|
13174 |
-
return filterTabbable(find(context));
|
13175 |
-
}
|
13176 |
-
/**
|
13177 |
-
* Given a focusable element, find the preceding tabbable element.
|
13178 |
-
*
|
13179 |
-
* @param {Element} element The focusable element before which to look. Defaults
|
13180 |
-
* to the active element.
|
13181 |
-
*/
|
13182 |
|
13183 |
-
|
13184 |
-
var element = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : document.activeElement;
|
13185 |
-
var focusables = find(document.body);
|
13186 |
-
var index = focusables.indexOf(element); // Remove all focusables after and including `element`.
|
13187 |
|
13188 |
-
|
13189 |
-
|
13190 |
-
}
|
13191 |
-
/**
|
13192 |
-
* Given a focusable element, find the next tabbable element.
|
13193 |
-
*
|
13194 |
-
* @param {Element} element The focusable element after which to look. Defaults
|
13195 |
-
* to the active element.
|
13196 |
-
*/
|
13197 |
|
13198 |
-
|
13199 |
-
|
13200 |
-
var focusables = find(document.body);
|
13201 |
-
var index = focusables.indexOf(element); // Remove all focusables before and inside `element`.
|
13202 |
|
13203 |
-
var remaining = focusables.slice(index + 1).filter(function (node) {
|
13204 |
-
return !element.contains(node);
|
13205 |
-
});
|
13206 |
-
return Object(external_lodash_["first"])(filterTabbable(remaining));
|
13207 |
-
}
|
13208 |
-
//# sourceMappingURL=tabbable.js.map
|
13209 |
-
// CONCATENATED MODULE: ./node_modules/@wordpress/dom/build-module/index.js
|
13210 |
-
/**
|
13211 |
-
* Internal dependencies
|
13212 |
-
*/
|
13213 |
|
|
|
13214 |
|
13215 |
-
|
13216 |
-
|
13217 |
-
* under the keys with the same name.
|
13218 |
-
*/
|
13219 |
|
13220 |
-
|
13221 |
-
|
13222 |
-
tabbable: tabbable_namespaceObject
|
13223 |
-
};
|
13224 |
|
13225 |
-
//# sourceMappingURL=index.js.map
|
13226 |
|
13227 |
/***/ }),
|
13228 |
|
13229 |
-
/***/
|
13230 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
13231 |
|
13232 |
"use strict";
|
13233 |
-
/*
|
13234 |
-
|
13235 |
-
|
13236 |
-
|
13237 |
-
|
13238 |
-
|
13239 |
-
|
13240 |
-
|
13241 |
-
|
13242 |
-
|
13243 |
-
|
13244 |
-
}
|
13245 |
|
13246 |
-
return target;
|
13247 |
-
}
|
13248 |
|
13249 |
-
|
|
|
|
|
13250 |
|
13251 |
-
/***/ 47:
|
13252 |
-
/***/ (function(module, exports) {
|
13253 |
|
13254 |
-
|
13255 |
-
|
|
|
13256 |
|
13257 |
-
// cached from whatever global is present so that test runners that stub it
|
13258 |
-
// don't break things. But we need to wrap it in a try catch in case it is
|
13259 |
-
// wrapped in strict mode code which doesn't define any globals. It's inside a
|
13260 |
-
// function because try/catches deoptimize in certain engines.
|
13261 |
|
13262 |
-
var cachedSetTimeout;
|
13263 |
-
var cachedClearTimeout;
|
13264 |
|
13265 |
-
function defaultSetTimout() {
|
13266 |
-
throw new Error('setTimeout has not been defined');
|
13267 |
-
}
|
13268 |
-
function defaultClearTimeout () {
|
13269 |
-
throw new Error('clearTimeout has not been defined');
|
13270 |
-
}
|
13271 |
-
(function () {
|
13272 |
-
try {
|
13273 |
-
if (typeof setTimeout === 'function') {
|
13274 |
-
cachedSetTimeout = setTimeout;
|
13275 |
-
} else {
|
13276 |
-
cachedSetTimeout = defaultSetTimout;
|
13277 |
-
}
|
13278 |
-
} catch (e) {
|
13279 |
-
cachedSetTimeout = defaultSetTimout;
|
13280 |
-
}
|
13281 |
-
try {
|
13282 |
-
if (typeof clearTimeout === 'function') {
|
13283 |
-
cachedClearTimeout = clearTimeout;
|
13284 |
-
} else {
|
13285 |
-
cachedClearTimeout = defaultClearTimeout;
|
13286 |
-
}
|
13287 |
-
} catch (e) {
|
13288 |
-
cachedClearTimeout = defaultClearTimeout;
|
13289 |
-
}
|
13290 |
-
} ())
|
13291 |
-
function runTimeout(fun) {
|
13292 |
-
if (cachedSetTimeout === setTimeout) {
|
13293 |
-
//normal enviroments in sane situations
|
13294 |
-
return setTimeout(fun, 0);
|
13295 |
-
}
|
13296 |
-
// if setTimeout wasn't available but was latter defined
|
13297 |
-
if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {
|
13298 |
-
cachedSetTimeout = setTimeout;
|
13299 |
-
return setTimeout(fun, 0);
|
13300 |
-
}
|
13301 |
-
try {
|
13302 |
-
// when when somebody has screwed with setTimeout but no I.E. maddness
|
13303 |
-
return cachedSetTimeout(fun, 0);
|
13304 |
-
} catch(e){
|
13305 |
-
try {
|
13306 |
-
// When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
|
13307 |
-
return cachedSetTimeout.call(null, fun, 0);
|
13308 |
-
} catch(e){
|
13309 |
-
// same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error
|
13310 |
-
return cachedSetTimeout.call(this, fun, 0);
|
13311 |
-
}
|
13312 |
-
}
|
13313 |
|
13314 |
|
13315 |
-
|
13316 |
-
|
13317 |
-
|
13318 |
-
//normal enviroments in sane situations
|
13319 |
-
return clearTimeout(marker);
|
13320 |
-
}
|
13321 |
-
// if clearTimeout wasn't available but was latter defined
|
13322 |
-
if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {
|
13323 |
-
cachedClearTimeout = clearTimeout;
|
13324 |
-
return clearTimeout(marker);
|
13325 |
-
}
|
13326 |
-
try {
|
13327 |
-
// when when somebody has screwed with setTimeout but no I.E. maddness
|
13328 |
-
return cachedClearTimeout(marker);
|
13329 |
-
} catch (e){
|
13330 |
-
try {
|
13331 |
-
// When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
|
13332 |
-
return cachedClearTimeout.call(null, marker);
|
13333 |
-
} catch (e){
|
13334 |
-
// same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.
|
13335 |
-
// Some versions of I.E. have different rules for clearTimeout vs setTimeout
|
13336 |
-
return cachedClearTimeout.call(this, marker);
|
13337 |
-
}
|
13338 |
-
}
|
13339 |
|
13340 |
|
|
|
|
|
13341 |
|
13342 |
-
|
13343 |
-
|
13344 |
-
|
13345 |
-
|
13346 |
-
|
|
|
|
|
13347 |
|
13348 |
-
function
|
13349 |
-
|
13350 |
-
|
13351 |
-
|
13352 |
-
|
13353 |
-
if (currentQueue.length) {
|
13354 |
-
queue = currentQueue.concat(queue);
|
13355 |
-
} else {
|
13356 |
-
queueIndex = -1;
|
13357 |
-
}
|
13358 |
-
if (queue.length) {
|
13359 |
-
drainQueue();
|
13360 |
}
|
|
|
13361 |
}
|
13362 |
|
13363 |
-
function
|
13364 |
-
|
13365 |
-
|
13366 |
-
|
13367 |
-
|
13368 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13369 |
|
13370 |
-
|
13371 |
-
|
13372 |
-
currentQueue = queue;
|
13373 |
-
queue = [];
|
13374 |
-
while (++queueIndex < len) {
|
13375 |
-
if (currentQueue) {
|
13376 |
-
currentQueue[queueIndex].run();
|
13377 |
-
}
|
13378 |
}
|
13379 |
-
|
13380 |
-
|
13381 |
-
}
|
13382 |
-
|
13383 |
-
draining = false;
|
13384 |
-
runClearTimeout(timeout);
|
13385 |
}
|
13386 |
|
13387 |
-
|
13388 |
-
|
13389 |
-
|
13390 |
-
for (var i = 1; i < arguments.length; i++) {
|
13391 |
-
args[i - 1] = arguments[i];
|
13392 |
-
}
|
13393 |
-
}
|
13394 |
-
queue.push(new Item(fun, args));
|
13395 |
-
if (queue.length === 1 && !draining) {
|
13396 |
-
runTimeout(drainQueue);
|
13397 |
-
}
|
13398 |
-
};
|
13399 |
|
13400 |
-
|
13401 |
-
function Item(fun, array) {
|
13402 |
-
this.fun = fun;
|
13403 |
-
this.array = array;
|
13404 |
-
}
|
13405 |
-
Item.prototype.run = function () {
|
13406 |
-
this.fun.apply(null, this.array);
|
13407 |
-
};
|
13408 |
-
process.title = 'browser';
|
13409 |
-
process.browser = true;
|
13410 |
-
process.env = {};
|
13411 |
-
process.argv = [];
|
13412 |
-
process.version = ''; // empty string to avoid regexp issues
|
13413 |
-
process.versions = {};
|
13414 |
|
13415 |
-
|
|
|
13416 |
|
13417 |
-
|
13418 |
-
|
13419 |
-
process.once = noop;
|
13420 |
-
process.off = noop;
|
13421 |
-
process.removeListener = noop;
|
13422 |
-
process.removeAllListeners = noop;
|
13423 |
-
process.emit = noop;
|
13424 |
-
process.prependListener = noop;
|
13425 |
-
process.prependOnceListener = noop;
|
13426 |
|
13427 |
-
process.listeners = function (name) { return [] }
|
13428 |
|
13429 |
-
|
13430 |
-
throw new Error('process.binding is not supported');
|
13431 |
-
};
|
13432 |
|
13433 |
-
|
13434 |
-
|
13435 |
-
throw new Error('process.chdir is not supported');
|
13436 |
};
|
13437 |
-
process.umask = function() { return 0; };
|
13438 |
-
|
13439 |
-
|
13440 |
-
/***/ }),
|
13441 |
-
|
13442 |
-
/***/ 48:
|
13443 |
-
/***/ (function(module, exports) {
|
13444 |
|
13445 |
-
|
13446 |
|
13447 |
/***/ }),
|
13448 |
|
13449 |
-
/***/
|
13450 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
13451 |
|
13452 |
"use strict";
|
13453 |
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return
|
13454 |
-
|
13455 |
-
|
13456 |
-
|
13457 |
-
if (!o) return;
|
13458 |
-
if (typeof o === "string") return Object(_arrayLikeToArray__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])(o, minLen);
|
13459 |
-
var n = Object.prototype.toString.call(o).slice(8, -1);
|
13460 |
-
if (n === "Object" && o.constructor) n = o.constructor.name;
|
13461 |
-
if (n === "Map" || n === "Set") return Array.from(o);
|
13462 |
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return Object(_arrayLikeToArray__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])(o, minLen);
|
13463 |
-
}
|
13464 |
-
|
13465 |
-
/***/ }),
|
13466 |
|
13467 |
-
|
13468 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13469 |
|
13470 |
-
|
13471 |
-
|
13472 |
-
function _assertThisInitialized(self) {
|
13473 |
-
if (self === void 0) {
|
13474 |
-
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
13475 |
-
}
|
13476 |
|
13477 |
-
return self;
|
13478 |
-
}
|
13479 |
|
13480 |
/***/ }),
|
13481 |
|
13482 |
-
/***/
|
13483 |
-
/***/ (function(module, exports) {
|
13484 |
|
13485 |
-
|
13486 |
-
try {
|
13487 |
-
var info = gen[key](arg);
|
13488 |
-
var value = info.value;
|
13489 |
-
} catch (error) {
|
13490 |
-
reject(error);
|
13491 |
-
return;
|
13492 |
-
}
|
13493 |
|
13494 |
-
|
13495 |
-
|
13496 |
-
|
13497 |
-
Promise.resolve(value).then(_next, _throw);
|
13498 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13499 |
}
|
13500 |
|
13501 |
-
|
13502 |
-
return function () {
|
13503 |
-
var self = this,
|
13504 |
-
args = arguments;
|
13505 |
-
return new Promise(function (resolve, reject) {
|
13506 |
-
var gen = fn.apply(self, args);
|
13507 |
|
13508 |
-
|
13509 |
-
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
|
13510 |
-
}
|
13511 |
|
13512 |
-
|
13513 |
-
|
13514 |
-
}
|
13515 |
|
13516 |
-
|
13517 |
-
});
|
13518 |
-
};
|
13519 |
-
}
|
13520 |
|
13521 |
-
|
13522 |
|
13523 |
-
|
|
|
13524 |
|
13525 |
-
|
13526 |
-
|
13527 |
|
13528 |
-
|
|
|
13529 |
|
13530 |
-
|
|
|
13531 |
|
13532 |
-
|
13533 |
-
|
13534 |
|
13535 |
-
|
13536 |
-
|
13537 |
-
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_0__);
|
13538 |
-
/**
|
13539 |
-
* External dependencies
|
13540 |
-
*/
|
13541 |
|
13542 |
-
|
13543 |
-
|
13544 |
-
* name, returns the enhanced component augmented with a generated displayName.
|
13545 |
-
*
|
13546 |
-
* @param {Function} mapComponentToEnhancedComponent Function mapping component
|
13547 |
-
* to enhanced component.
|
13548 |
-
* @param {string} modifierName Seed name from which to
|
13549 |
-
* generated display name.
|
13550 |
-
*
|
13551 |
-
* @return {WPComponent} Component class with generated display name assigned.
|
13552 |
-
*/
|
13553 |
|
13554 |
-
|
13555 |
-
|
13556 |
-
var EnhancedComponent = mapComponentToEnhancedComponent(OriginalComponent);
|
13557 |
-
var _OriginalComponent$di = OriginalComponent.displayName,
|
13558 |
-
displayName = _OriginalComponent$di === void 0 ? OriginalComponent.name || 'Component' : _OriginalComponent$di;
|
13559 |
-
EnhancedComponent.displayName = "".concat(Object(lodash__WEBPACK_IMPORTED_MODULE_0__["upperFirst"])(Object(lodash__WEBPACK_IMPORTED_MODULE_0__["camelCase"])(modifierName)), "(").concat(displayName, ")");
|
13560 |
-
return EnhancedComponent;
|
13561 |
-
};
|
13562 |
-
}
|
13563 |
|
13564 |
-
|
13565 |
-
|
13566 |
|
13567 |
-
|
|
|
13568 |
|
13569 |
-
|
13570 |
-
|
13571 |
|
13572 |
-
|
13573 |
-
|
13574 |
-
"default": obj
|
13575 |
-
};
|
13576 |
-
}
|
13577 |
|
13578 |
-
module.
|
13579 |
|
13580 |
-
/***/ }),
|
13581 |
|
13582 |
-
/***/ 56:
|
13583 |
-
/***/ (function(module, exports) {
|
13584 |
|
13585 |
-
var g;
|
13586 |
|
13587 |
-
// This works in non-strict mode
|
13588 |
-
g = (function() {
|
13589 |
-
return this;
|
13590 |
-
})();
|
13591 |
|
13592 |
-
try {
|
13593 |
-
// This works if eval is allowed (see CSP)
|
13594 |
-
g = g || new Function("return this")();
|
13595 |
-
} catch (e) {
|
13596 |
-
// This works if the window reference is available
|
13597 |
-
if (typeof window === "object") g = window;
|
13598 |
-
}
|
13599 |
|
13600 |
-
// g can still be undefined, but nothing to do about it...
|
13601 |
-
// We return undefined, instead of nothing here, so it's
|
13602 |
-
// easier to handle this case. if(!global) { ...}
|
13603 |
|
13604 |
-
module.exports = g;
|
13605 |
|
13606 |
|
13607 |
-
/***/ }),
|
13608 |
|
13609 |
-
|
13610 |
-
|
|
|
13611 |
|
13612 |
-
"use strict";
|
13613 |
-
/* unused harmony export logged */
|
13614 |
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return deprecated; });
|
13615 |
-
/* harmony import */ var _wordpress_hooks__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(48);
|
13616 |
-
/* harmony import */ var _wordpress_hooks__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_hooks__WEBPACK_IMPORTED_MODULE_0__);
|
13617 |
/**
|
13618 |
-
*
|
13619 |
*/
|
13620 |
|
13621 |
/**
|
13622 |
-
*
|
13623 |
-
* message is only logged once.
|
13624 |
-
*
|
13625 |
-
* @type {Object}
|
13626 |
*/
|
13627 |
|
13628 |
-
var logged = Object.create(null);
|
13629 |
-
/**
|
13630 |
-
* Logs a message to notify developers about a deprecated feature.
|
13631 |
-
*
|
13632 |
-
* @param {string} feature Name of the deprecated feature.
|
13633 |
-
* @param {?Object} options Personalisation options
|
13634 |
-
* @param {?string} options.version Version in which the feature will be removed.
|
13635 |
-
* @param {?string} options.alternative Feature to use instead
|
13636 |
-
* @param {?string} options.plugin Plugin name if it's a plugin feature
|
13637 |
-
* @param {?string} options.link Link to documentation
|
13638 |
-
* @param {?string} options.hint Additional message to help transition away from the deprecated feature.
|
13639 |
-
*
|
13640 |
-
* @example
|
13641 |
-
* ```js
|
13642 |
-
* import deprecated from '@wordpress/deprecated';
|
13643 |
-
*
|
13644 |
-
* deprecated( 'Eating meat', {
|
13645 |
-
* version: 'the future',
|
13646 |
-
* alternative: 'vegetables',
|
13647 |
-
* plugin: 'the earth',
|
13648 |
-
* hint: 'You may find it beneficial to transition gradually.',
|
13649 |
-
* } );
|
13650 |
-
*
|
13651 |
-
* // Logs: 'Eating meat is deprecated and will be removed from the earth in the future. Please use vegetables instead. Note: You may find it beneficial to transition gradually.'
|
13652 |
-
* ```
|
13653 |
-
*/
|
13654 |
|
13655 |
-
function deprecated(feature) {
|
13656 |
-
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
13657 |
-
var version = options.version,
|
13658 |
-
alternative = options.alternative,
|
13659 |
-
plugin = options.plugin,
|
13660 |
-
link = options.link,
|
13661 |
-
hint = options.hint;
|
13662 |
-
var pluginMessage = plugin ? " from ".concat(plugin) : '';
|
13663 |
-
var versionMessage = version ? " and will be removed".concat(pluginMessage, " in version ").concat(version) : '';
|
13664 |
-
var useInsteadMessage = alternative ? " Please use ".concat(alternative, " instead.") : '';
|
13665 |
-
var linkMessage = link ? " See: ".concat(link) : '';
|
13666 |
-
var hintMessage = hint ? " Note: ".concat(hint) : '';
|
13667 |
-
var message = "".concat(feature, " is deprecated").concat(versionMessage, ".").concat(useInsteadMessage).concat(linkMessage).concat(hintMessage); // Skip if already logged.
|
13668 |
|
13669 |
-
if (message in logged) {
|
13670 |
-
return;
|
13671 |
-
}
|
13672 |
-
/**
|
13673 |
-
* Fires whenever a deprecated feature is encountered
|
13674 |
-
*
|
13675 |
-
* @param {string} feature Name of the deprecated feature.
|
13676 |
-
* @param {?Object} options Personalisation options
|
13677 |
-
* @param {?string} options.version Version in which the feature will be removed.
|
13678 |
-
* @param {?string} options.alternative Feature to use instead
|
13679 |
-
* @param {?string} options.plugin Plugin name if it's a plugin feature
|
13680 |
-
* @param {?string} options.link Link to documentation
|
13681 |
-
* @param {?string} options.hint Additional message to help transition away from the deprecated feature.
|
13682 |
-
* @param {?string} message Message sent to console.warn
|
13683 |
-
*/
|
13684 |
|
|
|
|
|
13685 |
|
13686 |
-
|
|
|
|
|
|
|
|
|
13687 |
|
13688 |
-
|
13689 |
-
logged[message] = true;
|
13690 |
}
|
13691 |
-
//# sourceMappingURL=index.js.map
|
13692 |
|
13693 |
-
|
|
|
13694 |
|
13695 |
-
|
13696 |
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
13697 |
|
13698 |
-
|
13699 |
-
|
13700 |
-
|
13701 |
-
|
13702 |
-
|
13703 |
-
|
13704 |
-
|
13705 |
-
|
13706 |
-
|
13707 |
-
|
13708 |
-
|
13709 |
-
obj[key] = value;
|
13710 |
}
|
13711 |
|
13712 |
-
|
13713 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13714 |
|
13715 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13716 |
|
13717 |
-
|
13718 |
-
|
|
|
|
|
|
|
|
|
|
|
13719 |
|
13720 |
-
|
13721 |
-
|
13722 |
-
|
13723 |
-
|
13724 |
-
|
13725 |
-
|
13726 |
-
}
|
13727 |
|
13728 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13729 |
|
13730 |
-
|
13731 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13732 |
|
13733 |
-
|
13734 |
-
|
13735 |
-
|
13736 |
-
|
13737 |
|
13738 |
-
|
13739 |
-
|
|
|
|
|
13740 |
|
13741 |
-
|
|
|
|
|
13742 |
|
13743 |
-
|
13744 |
|
13745 |
-
|
13746 |
-
|
|
|
13747 |
|
13748 |
-
|
13749 |
-
|
13750 |
-
|
13751 |
-
|
13752 |
-
|
13753 |
-
|
13754 |
-
|
13755 |
-
|
13756 |
-
|
13757 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13758 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13759 |
|
13760 |
|
13761 |
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
13762 |
|
13763 |
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
13764 |
|
13765 |
/**
|
13766 |
* External dependencies
|
13767 |
*/
|
13768 |
|
13769 |
/**
|
13770 |
-
*
|
13771 |
*/
|
13772 |
|
13773 |
-
|
|
|
13774 |
/**
|
13775 |
-
*
|
13776 |
-
*
|
13777 |
-
* @param {string} eventName The name of the event to record, don't include the wcadmin_ prefix
|
13778 |
-
* @param {Object} eventProperties event properties to include in the event
|
13779 |
*/
|
13780 |
|
13781 |
-
function recordEvent(eventName, eventProperties) {
|
13782 |
-
tracksDebug('recordevent %s %o', 'wcadmin_' + eventName, eventProperties, {
|
13783 |
-
_tqk: window._tkq,
|
13784 |
-
shouldRecord: true && !!window._tkq && !!window.wcTracks && !!window.wcTracks.isEnabled
|
13785 |
-
});
|
13786 |
-
|
13787 |
-
if (!window.wcTracks || typeof window.wcTracks.recordEvent !== 'function' || "production" === 'development') {
|
13788 |
-
return false;
|
13789 |
-
}
|
13790 |
|
13791 |
-
|
13792 |
-
|
13793 |
-
|
13794 |
-
|
13795 |
-
|
13796 |
-
|
13797 |
-
clear: function clear() {
|
13798 |
-
if (!window.localStorage) {
|
13799 |
-
return;
|
13800 |
-
}
|
13801 |
|
13802 |
-
|
13803 |
-
|
13804 |
-
|
13805 |
-
|
13806 |
-
return [];
|
13807 |
-
}
|
13808 |
|
13809 |
-
|
13810 |
-
|
13811 |
-
|
13812 |
-
return items;
|
13813 |
-
},
|
13814 |
-
add: function add() {
|
13815 |
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
13816 |
-
args[_key] = arguments[_key];
|
13817 |
}
|
13818 |
|
13819 |
-
if (
|
13820 |
-
|
13821 |
-
|
13822 |
-
args: args
|
13823 |
-
});
|
13824 |
-
recordEvent.apply(null, args || undefined);
|
13825 |
-
return;
|
13826 |
}
|
13827 |
|
13828 |
-
|
13829 |
-
|
13830 |
-
|
13831 |
-
|
13832 |
-
items.push(newItem);
|
13833 |
-
items = items.slice(-100); // Upper limit.
|
13834 |
-
|
13835 |
-
tracksDebug('Adding new item to queue.', newItem);
|
13836 |
-
window.localStorage.setItem(tracksQueue.localStorageKey(), JSON.stringify(items));
|
13837 |
-
},
|
13838 |
-
process: function process() {
|
13839 |
-
if (!window.localStorage) {
|
13840 |
-
return; // Not possible.
|
13841 |
}
|
|
|
13842 |
|
13843 |
-
|
13844 |
-
|
13845 |
-
|
13846 |
-
|
13847 |
-
|
13848 |
-
|
13849 |
-
|
13850 |
-
|
13851 |
-
});
|
13852 |
-
}
|
13853 |
-
};
|
13854 |
-
/**
|
13855 |
-
* Queue a tracks event.
|
13856 |
-
*
|
13857 |
-
* This allows you to delay tracks events that would otherwise cause a race condition.
|
13858 |
-
* For example, when we trigger `wcadmin_tasklist_appearance_continue_setup` we're simultaneously moving the user to a new page via
|
13859 |
-
* `window.location`. This is an example of a race condition that should be avoided by enqueueing the event,
|
13860 |
-
* and therefore running it on the next pageview.
|
13861 |
-
*
|
13862 |
-
* @param {string} eventName The name of the event to record, don't include the wcadmin_ prefix
|
13863 |
-
* @param {Object} eventProperties event properties to include in the event
|
13864 |
-
*/
|
13865 |
-
|
13866 |
-
function queueRecordEvent(eventName, eventProperties) {
|
13867 |
-
tracksQueue.add(eventName, eventProperties);
|
13868 |
}
|
13869 |
-
|
13870 |
-
|
13871 |
-
*
|
13872 |
-
* @param {string} path the page/path to record a page view for
|
13873 |
-
* @param {Object} extraProperties extra event properties to include in the event
|
13874 |
-
*/
|
13875 |
|
13876 |
-
|
13877 |
-
if (!path) {
|
13878 |
-
return;
|
13879 |
-
}
|
13880 |
|
13881 |
-
|
13882 |
-
|
13883 |
-
}, extraProperties)); // Process queue.
|
13884 |
|
13885 |
-
|
13886 |
-
}
|
13887 |
|
13888 |
/***/ }),
|
13889 |
|
13890 |
-
/***/
|
13891 |
-
/***/ (function(module,
|
13892 |
|
13893 |
"use strict";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13894 |
|
13895 |
|
13896 |
/**
|
13897 |
-
*
|
13898 |
*/
|
13899 |
-
var isShallowEqualObjects = __webpack_require__( 117 );
|
13900 |
-
var isShallowEqualArrays = __webpack_require__( 118 );
|
13901 |
-
|
13902 |
-
var isArray = Array.isArray;
|
13903 |
|
13904 |
-
/**
|
13905 |
-
* @typedef {Record<string, any>} ComparableObject
|
13906 |
-
*/
|
13907 |
|
13908 |
/**
|
13909 |
-
*
|
13910 |
-
* otherwise.
|
13911 |
-
*
|
13912 |
-
* @param {any[]|ComparableObject} a First object or array to compare.
|
13913 |
-
* @param {any[]|ComparableObject} b Second object or array to compare.
|
13914 |
-
*
|
13915 |
-
* @return {boolean} Whether the two values are shallow equal.
|
13916 |
*/
|
13917 |
-
function isShallowEqual( a, b ) {
|
13918 |
-
if ( a && b ) {
|
13919 |
-
if ( a.constructor === Object && b.constructor === Object ) {
|
13920 |
-
return isShallowEqualObjects( a, b );
|
13921 |
-
} else if ( isArray( a ) && isArray( b ) ) {
|
13922 |
-
return isShallowEqualArrays( a, b );
|
13923 |
-
}
|
13924 |
-
}
|
13925 |
-
|
13926 |
-
return a === b;
|
13927 |
-
}
|
13928 |
-
|
13929 |
-
module.exports = isShallowEqual;
|
13930 |
-
module.exports.isShallowEqualObjects = isShallowEqualObjects;
|
13931 |
-
module.exports.isShallowEqualArrays = isShallowEqualArrays;
|
13932 |
-
|
13933 |
-
|
13934 |
-
/***/ }),
|
13935 |
-
|
13936 |
-
/***/ 66:
|
13937 |
-
/***/ (function(module, exports, __webpack_require__) {
|
13938 |
-
|
13939 |
-
"use strict";
|
13940 |
|
13941 |
|
13942 |
-
var stringify = __webpack_require__(115);
|
13943 |
-
var parse = __webpack_require__(116);
|
13944 |
-
var formats = __webpack_require__(94);
|
13945 |
|
13946 |
-
module.exports = {
|
13947 |
-
formats: formats,
|
13948 |
-
parse: parse,
|
13949 |
-
stringify: stringify
|
13950 |
-
};
|
13951 |
|
|
|
|
|
13952 |
|
13953 |
-
|
|
|
|
|
|
|
13954 |
|
13955 |
-
|
13956 |
-
|
|
|
13957 |
|
13958 |
-
|
13959 |
-
|
13960 |
-
|
13961 |
-
|
13962 |
-
var info = gen[key](arg);
|
13963 |
-
var value = info.value;
|
13964 |
-
} catch (error) {
|
13965 |
-
reject(error);
|
13966 |
-
return;
|
13967 |
}
|
13968 |
|
13969 |
-
if (
|
13970 |
-
|
13971 |
-
} else {
|
13972 |
-
Promise.resolve(value).then(_next, _throw);
|
13973 |
}
|
13974 |
-
}
|
13975 |
-
|
13976 |
-
function _asyncToGenerator(fn) {
|
13977 |
-
return function () {
|
13978 |
-
var self = this,
|
13979 |
-
args = arguments;
|
13980 |
-
return new Promise(function (resolve, reject) {
|
13981 |
-
var gen = fn.apply(self, args);
|
13982 |
-
|
13983 |
-
function _next(value) {
|
13984 |
-
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
|
13985 |
-
}
|
13986 |
-
|
13987 |
-
function _throw(err) {
|
13988 |
-
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
|
13989 |
-
}
|
13990 |
-
|
13991 |
-
_next(undefined);
|
13992 |
-
});
|
13993 |
-
};
|
13994 |
-
}
|
13995 |
|
13996 |
-
|
13997 |
-
|
13998 |
-
|
13999 |
-
|
14000 |
-
|
14001 |
-
"use strict";
|
14002 |
-
/* unused harmony export Button */
|
14003 |
-
/* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(12);
|
14004 |
-
/* harmony import */ var _babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(14);
|
14005 |
-
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(0);
|
14006 |
-
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__);
|
14007 |
-
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(8);
|
14008 |
-
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_3__);
|
14009 |
-
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(2);
|
14010 |
-
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_4__);
|
14011 |
-
/* harmony import */ var _wordpress_deprecated__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(59);
|
14012 |
-
/* harmony import */ var _tooltip__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(97);
|
14013 |
-
/* harmony import */ var _icon__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(96);
|
14014 |
|
|
|
|
|
|
|
14015 |
|
14016 |
|
|
|
|
|
14017 |
|
14018 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14019 |
|
14020 |
-
|
14021 |
|
14022 |
-
|
|
|
14023 |
|
14024 |
/**
|
14025 |
-
*
|
|
|
|
|
|
|
14026 |
*/
|
14027 |
|
|
|
|
|
14028 |
|
14029 |
-
|
14030 |
-
|
14031 |
-
|
|
|
|
|
|
|
|
|
14032 |
|
|
|
|
|
|
|
|
|
|
|
14033 |
|
|
|
|
|
|
|
14034 |
|
14035 |
-
|
14036 |
-
|
14037 |
-
|
14038 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14039 |
|
|
|
|
|
|
|
|
|
14040 |
|
14041 |
-
|
14042 |
-
|
14043 |
-
var
|
14044 |
-
target = props.target,
|
14045 |
-
isPrimary = props.isPrimary,
|
14046 |
-
isLarge = props.isLarge,
|
14047 |
-
isSmall = props.isSmall,
|
14048 |
-
isTertiary = props.isTertiary,
|
14049 |
-
isPressed = props.isPressed,
|
14050 |
-
isBusy = props.isBusy,
|
14051 |
-
isDefault = props.isDefault,
|
14052 |
-
isSecondary = props.isSecondary,
|
14053 |
-
isLink = props.isLink,
|
14054 |
-
isDestructive = props.isDestructive,
|
14055 |
-
className = props.className,
|
14056 |
-
disabled = props.disabled,
|
14057 |
-
icon = props.icon,
|
14058 |
-
iconSize = props.iconSize,
|
14059 |
-
showTooltip = props.showTooltip,
|
14060 |
-
tooltipPosition = props.tooltipPosition,
|
14061 |
-
shortcut = props.shortcut,
|
14062 |
-
label = props.label,
|
14063 |
-
children = props.children,
|
14064 |
-
isFocusable = props.__experimentalIsFocusable,
|
14065 |
-
additionalProps = Object(_babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"])(props, ["href", "target", "isPrimary", "isLarge", "isSmall", "isTertiary", "isPressed", "isBusy", "isDefault", "isSecondary", "isLink", "isDestructive", "className", "disabled", "icon", "iconSize", "showTooltip", "tooltipPosition", "shortcut", "label", "children", "__experimentalIsFocusable"]);
|
14066 |
|
14067 |
-
|
14068 |
-
|
14069 |
-
|
14070 |
-
|
14071 |
-
}
|
|
|
|
|
14072 |
|
14073 |
-
|
14074 |
-
|
14075 |
-
|
14076 |
-
|
14077 |
-
|
14078 |
-
'is-tertiary': isTertiary,
|
14079 |
-
'is-pressed': isPressed,
|
14080 |
-
'is-busy': isBusy,
|
14081 |
-
'is-link': isLink,
|
14082 |
-
'is-destructive': isDestructive,
|
14083 |
-
'has-text': !!icon && !!children,
|
14084 |
-
'has-icon': !!icon
|
14085 |
-
});
|
14086 |
-
var trulyDisabled = disabled && !isFocusable;
|
14087 |
-
var Tag = href !== undefined && !trulyDisabled ? 'a' : 'button';
|
14088 |
-
var tagProps = Tag === 'a' ? {
|
14089 |
-
href: href,
|
14090 |
-
target: target
|
14091 |
-
} : {
|
14092 |
-
type: 'button',
|
14093 |
-
disabled: trulyDisabled,
|
14094 |
-
'aria-pressed': isPressed
|
14095 |
};
|
14096 |
|
14097 |
-
|
14098 |
-
|
14099 |
-
|
14100 |
-
|
|
|
|
|
|
|
|
|
|
|
14101 |
|
14102 |
-
|
14103 |
-
|
|
|
|
|
|
|
|
|
14104 |
|
14105 |
-
|
14106 |
-
|
14107 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
14108 |
|
14109 |
-
|
14110 |
-
|
14111 |
-
|
14112 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14113 |
}
|
14114 |
-
} catch (err) {
|
14115 |
-
_iterator.e(err);
|
14116 |
-
} finally {
|
14117 |
-
_iterator.f();
|
14118 |
}
|
14119 |
-
|
14120 |
-
|
|
|
14121 |
|
14122 |
-
|
14123 |
-
|
14124 |
-
|
14125 |
-
|
14126 |
-
|
14127 |
-
|
14128 |
-
|
14129 |
-
className: classes,
|
14130 |
-
"aria-label": additionalProps['aria-label'] || label,
|
14131 |
-
ref: ref
|
14132 |
-
}), icon && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["createElement"])(_icon__WEBPACK_IMPORTED_MODULE_7__[/* default */ "a"], {
|
14133 |
-
icon: icon,
|
14134 |
-
size: iconSize
|
14135 |
-
}), children);
|
14136 |
|
14137 |
-
|
14138 |
-
|
14139 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14140 |
|
14141 |
-
|
14142 |
-
|
14143 |
-
|
14144 |
-
|
14145 |
-
|
14146 |
-
|
14147 |
-
|
14148 |
-
|
|
|
|
|
|
|
|
|
|
|
14149 |
|
14150 |
-
|
14151 |
|
14152 |
-
|
14153 |
-
|
|
|
|
|
|
|
|
|
14154 |
|
14155 |
-
|
14156 |
-
|
14157 |
-
|
14158 |
-
|
14159 |
-
|
14160 |
-
|
14161 |
-
|
14162 |
-
|
14163 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14164 |
}
|
14165 |
-
}
|
14166 |
|
14167 |
-
|
14168 |
-
|
14169 |
-
|
14170 |
-
|
14171 |
-
|
14172 |
|
14173 |
-
|
|
|
|
|
|
|
|
|
14174 |
|
14175 |
-
|
14176 |
-
|
|
|
|
|
14177 |
|
14178 |
-
|
14179 |
-
|
14180 |
-
|
14181 |
-
|
14182 |
-
|
14183 |
-
|
14184 |
-
*
|
14185 |
-
* This typedef is used so that a descriptive type is provided in our
|
14186 |
-
* automatically generated documentation.
|
14187 |
-
*
|
14188 |
-
* An in-line type `() => void` would be preferable, but the generated
|
14189 |
-
* documentation is `null` in that case.
|
14190 |
-
*
|
14191 |
-
* @see https://github.com/WordPress/gutenberg/issues/18045
|
14192 |
-
*/
|
14193 |
|
14194 |
-
|
14195 |
-
|
14196 |
-
*
|
14197 |
-
* @param {Callback} callback A function to execute after the DOM is ready.
|
14198 |
-
*
|
14199 |
-
* @example
|
14200 |
-
* ```js
|
14201 |
-
* import domReady from '@wordpress/dom-ready';
|
14202 |
-
*
|
14203 |
-
* domReady( function() {
|
14204 |
-
* //do something after DOM loads.
|
14205 |
-
* } );
|
14206 |
-
* ```
|
14207 |
-
*
|
14208 |
-
* @return {void}
|
14209 |
-
*/
|
14210 |
-
function domReady(callback) {
|
14211 |
-
if (document.readyState === 'complete' || // DOMContentLoaded + Images/Styles/etc loaded, so we call directly.
|
14212 |
-
document.readyState === 'interactive' // DOMContentLoaded fires at this point, so we call directly.
|
14213 |
-
) {
|
14214 |
-
return void callback();
|
14215 |
-
} // DOMContentLoaded has not fired yet, delay callback until then.
|
14216 |
|
|
|
|
|
|
|
|
|
14217 |
|
14218 |
-
|
14219 |
-
|
14220 |
-
|
|
|
14221 |
|
14222 |
-
|
|
|
|
|
|
|
14223 |
|
14224 |
-
|
14225 |
-
|
14226 |
|
14227 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14228 |
|
14229 |
-
|
14230 |
-
|
|
|
|
|
14231 |
|
14232 |
-
|
14233 |
-
|
|
|
|
|
|
|
14234 |
|
14235 |
-
|
14236 |
-
var symbol_observable_es = __webpack_require__(259);
|
14237 |
|
14238 |
-
|
|
|
|
|
14239 |
|
|
|
14240 |
|
14241 |
-
|
14242 |
-
|
14243 |
-
|
14244 |
-
|
14245 |
-
|
14246 |
-
|
14247 |
-
|
14248 |
-
return Math.random().toString(36).substring(7).split('').join('.');
|
14249 |
-
};
|
14250 |
|
14251 |
-
|
14252 |
-
|
14253 |
-
|
14254 |
-
PROBE_UNKNOWN_ACTION: function PROBE_UNKNOWN_ACTION() {
|
14255 |
-
return "@@redux/PROBE_UNKNOWN_ACTION" + randomString();
|
14256 |
-
}
|
14257 |
-
};
|
14258 |
|
14259 |
-
|
14260 |
-
|
14261 |
-
|
14262 |
-
|
14263 |
-
function isPlainObject(obj) {
|
14264 |
-
if (typeof obj !== 'object' || obj === null) return false;
|
14265 |
-
var proto = obj;
|
14266 |
|
14267 |
-
|
14268 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14269 |
}
|
14270 |
|
14271 |
-
|
14272 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14273 |
|
14274 |
-
|
14275 |
-
|
14276 |
-
|
14277 |
-
|
14278 |
-
|
14279 |
-
|
14280 |
-
|
14281 |
-
|
14282 |
-
|
14283 |
-
|
14284 |
-
|
14285 |
-
|
14286 |
-
|
14287 |
-
|
14288 |
-
|
14289 |
-
* an object with the same shape as `combineReducers` keys.
|
14290 |
-
*
|
14291 |
-
* @param {Function} [enhancer] The store enhancer. You may optionally specify it
|
14292 |
-
* to enhance the store with third-party capabilities such as middleware,
|
14293 |
-
* time travel, persistence, etc. The only store enhancer that ships with Redux
|
14294 |
-
* is `applyMiddleware()`.
|
14295 |
-
*
|
14296 |
-
* @returns {Store} A Redux store that lets you read the state, dispatch actions
|
14297 |
-
* and subscribe to changes.
|
14298 |
-
*/
|
14299 |
|
14300 |
-
|
14301 |
-
|
|
|
|
|
14302 |
|
14303 |
-
|
14304 |
-
|
14305 |
-
}
|
14306 |
|
14307 |
-
|
14308 |
-
enhancer = preloadedState;
|
14309 |
-
preloadedState = undefined;
|
14310 |
-
}
|
14311 |
|
14312 |
-
|
14313 |
-
|
14314 |
-
|
|
|
|
|
14315 |
}
|
14316 |
|
14317 |
-
|
14318 |
-
}
|
14319 |
|
14320 |
-
|
14321 |
-
|
14322 |
-
|
|
|
|
|
|
|
14323 |
|
14324 |
-
|
14325 |
-
|
14326 |
-
|
14327 |
-
|
14328 |
-
var isDispatching = false;
|
14329 |
-
/**
|
14330 |
-
* This makes a shallow copy of currentListeners so we can use
|
14331 |
-
* nextListeners as a temporary list while dispatching.
|
14332 |
-
*
|
14333 |
-
* This prevents any bugs around consumers calling
|
14334 |
-
* subscribe/unsubscribe in the middle of a dispatch.
|
14335 |
-
*/
|
14336 |
|
14337 |
-
|
14338 |
-
|
14339 |
-
nextListeners = currentListeners.slice();
|
14340 |
-
}
|
14341 |
-
}
|
14342 |
-
/**
|
14343 |
-
* Reads the state tree managed by the store.
|
14344 |
-
*
|
14345 |
-
* @returns {any} The current state tree of your application.
|
14346 |
-
*/
|
14347 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14348 |
|
14349 |
-
|
14350 |
-
|
14351 |
-
|
14352 |
}
|
14353 |
|
14354 |
-
|
|
|
|
|
|
|
14355 |
}
|
14356 |
-
/**
|
14357 |
-
* Adds a change listener. It will be called any time an action is dispatched,
|
14358 |
-
* and some part of the state tree may potentially have changed. You may then
|
14359 |
-
* call `getState()` to read the current state tree inside the callback.
|
14360 |
-
*
|
14361 |
-
* You may call `dispatch()` from a change listener, with the following
|
14362 |
-
* caveats:
|
14363 |
-
*
|
14364 |
-
* 1. The subscriptions are snapshotted just before every `dispatch()` call.
|
14365 |
-
* If you subscribe or unsubscribe while the listeners are being invoked, this
|
14366 |
-
* will not have any effect on the `dispatch()` that is currently in progress.
|
14367 |
-
* However, the next `dispatch()` call, whether nested or not, will use a more
|
14368 |
-
* recent snapshot of the subscription list.
|
14369 |
-
*
|
14370 |
-
* 2. The listener should not expect to see all state changes, as the state
|
14371 |
-
* might have been updated multiple times during a nested `dispatch()` before
|
14372 |
-
* the listener is called. It is, however, guaranteed that all subscribers
|
14373 |
-
* registered before the `dispatch()` started will be called with the latest
|
14374 |
-
* state by the time it exits.
|
14375 |
-
*
|
14376 |
-
* @param {Function} listener A callback to be invoked on every dispatch.
|
14377 |
-
* @returns {Function} A function to remove this change listener.
|
14378 |
-
*/
|
14379 |
|
|
|
|
|
|
|
14380 |
|
14381 |
-
|
14382 |
-
if (typeof listener !== 'function') {
|
14383 |
-
throw new Error('Expected the listener to be a function.');
|
14384 |
-
}
|
14385 |
|
14386 |
-
|
14387 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14388 |
}
|
14389 |
|
14390 |
-
|
14391 |
-
|
14392 |
-
|
14393 |
-
|
14394 |
-
if (!isSubscribed) {
|
14395 |
-
return;
|
14396 |
-
}
|
14397 |
|
14398 |
-
|
14399 |
-
|
14400 |
-
}
|
14401 |
|
14402 |
-
|
14403 |
-
|
14404 |
-
|
14405 |
-
|
14406 |
-
|
14407 |
-
};
|
14408 |
}
|
14409 |
-
/**
|
14410 |
-
* Dispatches an action. It is the only way to trigger a state change.
|
14411 |
-
*
|
14412 |
-
* The `reducer` function, used to create the store, will be called with the
|
14413 |
-
* current state tree and the given `action`. Its return value will
|
14414 |
-
* be considered the **next** state of the tree, and the change listeners
|
14415 |
-
* will be notified.
|
14416 |
-
*
|
14417 |
-
* The base implementation only supports plain object actions. If you want to
|
14418 |
-
* dispatch a Promise, an Observable, a thunk, or something else, you need to
|
14419 |
-
* wrap your store creating function into the corresponding middleware. For
|
14420 |
-
* example, see the documentation for the `redux-thunk` package. Even the
|
14421 |
-
* middleware will eventually dispatch plain object actions using this method.
|
14422 |
-
*
|
14423 |
-
* @param {Object} action A plain object representing “what changed”. It is
|
14424 |
-
* a good idea to keep actions serializable so you can record and replay user
|
14425 |
-
* sessions, or use the time travelling `redux-devtools`. An action must have
|
14426 |
-
* a `type` property which may not be `undefined`. It is a good idea to use
|
14427 |
-
* string constants for action types.
|
14428 |
-
*
|
14429 |
-
* @returns {Object} For convenience, the same action object you dispatched.
|
14430 |
-
*
|
14431 |
-
* Note that, if you use a custom middleware, it may wrap `dispatch()` to
|
14432 |
-
* return something else (for example, a Promise you can await).
|
14433 |
-
*/
|
14434 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14435 |
|
14436 |
-
function
|
14437 |
-
|
14438 |
-
|
|
|
14439 |
}
|
|
|
14440 |
|
14441 |
-
|
14442 |
-
|
14443 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14444 |
|
14445 |
-
|
14446 |
-
|
14447 |
-
|
|
|
|
|
|
|
|
|
14448 |
|
14449 |
-
|
14450 |
-
|
14451 |
-
|
14452 |
-
|
14453 |
-
|
14454 |
-
|
14455 |
|
14456 |
-
|
|
|
|
|
14457 |
|
14458 |
-
|
14459 |
-
|
14460 |
-
|
14461 |
-
|
|
|
|
|
|
|
|
|
|
|
14462 |
|
14463 |
-
|
14464 |
-
|
14465 |
-
/**
|
14466 |
-
* Replaces the reducer currently used by the store to calculate the state.
|
14467 |
-
*
|
14468 |
-
* You might need this if your app implements code splitting and you want to
|
14469 |
-
* load some of the reducers dynamically. You might also need this if you
|
14470 |
-
* implement a hot reloading mechanism for Redux.
|
14471 |
-
*
|
14472 |
-
* @param {Function} nextReducer The reducer for the store to use instead.
|
14473 |
-
* @returns {void}
|
14474 |
-
*/
|
14475 |
|
|
|
|
|
14476 |
|
14477 |
-
|
14478 |
-
|
14479 |
-
throw new Error('Expected the nextReducer to be a function.');
|
14480 |
}
|
14481 |
|
14482 |
-
|
14483 |
-
|
14484 |
-
|
14485 |
-
|
14486 |
|
14487 |
-
|
14488 |
-
|
14489 |
-
});
|
14490 |
}
|
14491 |
-
/**
|
14492 |
-
* Interoperability point for observable/reactive libraries.
|
14493 |
-
* @returns {observable} A minimal observable of state changes.
|
14494 |
-
* For more information, see the observable proposal:
|
14495 |
-
* https://github.com/tc39/proposal-observable
|
14496 |
-
*/
|
14497 |
|
|
|
|
|
14498 |
|
14499 |
-
|
14500 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
14501 |
|
14502 |
-
|
14503 |
-
|
14504 |
-
/**
|
14505 |
-
* The minimal observable subscription method.
|
14506 |
-
* @param {Object} observer Any object that can be used as an observer.
|
14507 |
-
* The observer object should have a `next` method.
|
14508 |
-
* @returns {subscription} An object with an `unsubscribe` method that can
|
14509 |
-
* be used to unsubscribe the observable from the store, and prevent further
|
14510 |
-
* emission of values from the observable.
|
14511 |
-
*/
|
14512 |
-
subscribe: function subscribe(observer) {
|
14513 |
-
if (typeof observer !== 'object' || observer === null) {
|
14514 |
-
throw new TypeError('Expected the observer to be an object.');
|
14515 |
-
}
|
14516 |
|
14517 |
-
|
14518 |
-
|
14519 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
14520 |
}
|
14521 |
}
|
14522 |
-
|
14523 |
-
observeState();
|
14524 |
-
var unsubscribe = outerSubscribe(observeState);
|
14525 |
-
return {
|
14526 |
-
unsubscribe: unsubscribe
|
14527 |
-
};
|
14528 |
}
|
14529 |
-
},
|
14530 |
-
return this;
|
14531 |
-
}, _ref;
|
14532 |
-
} // When a store is created, an "INIT" action is dispatched so that every
|
14533 |
-
// reducer returns their initial state. This effectively populates
|
14534 |
-
// the initial state tree.
|
14535 |
-
|
14536 |
-
|
14537 |
-
dispatch({
|
14538 |
-
type: ActionTypes.INIT
|
14539 |
-
});
|
14540 |
-
return _ref2 = {
|
14541 |
-
dispatch: dispatch,
|
14542 |
-
subscribe: subscribe,
|
14543 |
-
getState: getState,
|
14544 |
-
replaceReducer: replaceReducer
|
14545 |
-
}, _ref2[symbol_observable_es["a" /* default */]] = observable, _ref2;
|
14546 |
-
}
|
14547 |
-
|
14548 |
-
/**
|
14549 |
-
* Prints a warning in the console if it exists.
|
14550 |
-
*
|
14551 |
-
* @param {String} message The warning message.
|
14552 |
-
* @returns {void}
|
14553 |
-
*/
|
14554 |
-
function warning(message) {
|
14555 |
-
/* eslint-disable no-console */
|
14556 |
-
if (typeof console !== 'undefined' && typeof console.error === 'function') {
|
14557 |
-
console.error(message);
|
14558 |
-
}
|
14559 |
-
/* eslint-enable no-console */
|
14560 |
-
|
14561 |
|
14562 |
-
|
14563 |
-
|
14564 |
-
// "break on all exceptions" in your console,
|
14565 |
-
// it would pause the execution at this line.
|
14566 |
-
throw new Error(message);
|
14567 |
-
} catch (e) {} // eslint-disable-line no-empty
|
14568 |
|
14569 |
-
|
|
|
|
|
|
|
|
|
14570 |
|
14571 |
-
|
14572 |
-
|
14573 |
-
var actionDescription = actionType && "action \"" + String(actionType) + "\"" || 'an action';
|
14574 |
-
return "Given " + actionDescription + ", reducer \"" + key + "\" returned undefined. " + "To ignore an action, you must explicitly return the previous state. " + "If you want this reducer to hold no value, you can return null instead of undefined.";
|
14575 |
-
}
|
14576 |
|
14577 |
-
function
|
14578 |
-
|
14579 |
-
|
|
|
14580 |
|
14581 |
-
|
14582 |
-
|
14583 |
-
|
|
|
|
|
14584 |
|
14585 |
-
|
14586 |
-
|
14587 |
-
|
|
|
|
|
|
|
14588 |
|
14589 |
-
|
14590 |
-
|
14591 |
-
});
|
14592 |
-
unexpectedKeys.forEach(function (key) {
|
14593 |
-
unexpectedKeyCache[key] = true;
|
14594 |
-
});
|
14595 |
-
if (action && action.type === ActionTypes.REPLACE) return;
|
14596 |
|
14597 |
-
|
14598 |
-
|
14599 |
-
|
14600 |
-
}
|
14601 |
|
14602 |
-
|
14603 |
-
|
14604 |
-
|
14605 |
-
|
14606 |
-
|
14607 |
-
|
14608 |
|
14609 |
-
|
14610 |
-
|
14611 |
-
|
14612 |
|
14613 |
-
|
14614 |
-
|
14615 |
-
|
14616 |
-
|
14617 |
-
|
14618 |
-
|
14619 |
-
}
|
14620 |
-
/**
|
14621 |
-
* Turns an object whose values are different reducer functions, into a single
|
14622 |
-
* reducer function. It will call every child reducer, and gather their results
|
14623 |
-
* into a single state object, whose keys correspond to the keys of the passed
|
14624 |
-
* reducer functions.
|
14625 |
-
*
|
14626 |
-
* @param {Object} reducers An object whose values correspond to different
|
14627 |
-
* reducer functions that need to be combined into one. One handy way to obtain
|
14628 |
-
* it is to use ES6 `import * as reducers` syntax. The reducers may never return
|
14629 |
-
* undefined for any action. Instead, they should return their initial state
|
14630 |
-
* if the state passed to them was undefined, and the current state for any
|
14631 |
-
* unrecognized action.
|
14632 |
-
*
|
14633 |
-
* @returns {Function} A reducer function that invokes every reducer inside the
|
14634 |
-
* passed object, and builds a state object with the same shape.
|
14635 |
-
*/
|
14636 |
|
|
|
|
|
|
|
|
|
14637 |
|
14638 |
-
|
14639 |
-
|
14640 |
-
|
|
|
14641 |
|
14642 |
-
|
14643 |
-
|
|
|
|
|
|
|
|
|
14644 |
|
14645 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14646 |
|
14647 |
-
|
14648 |
-
|
14649 |
-
|
14650 |
-
|
|
|
|
|
|
|
|
|
|
|
14651 |
|
14652 |
-
|
14653 |
-
|
|
|
14654 |
|
14655 |
-
|
|
|
|
|
|
|
|
|
14656 |
|
14657 |
-
|
|
|
14658 |
|
14659 |
-
|
|
|
|
|
|
|
14660 |
|
14661 |
-
|
14662 |
-
|
14663 |
-
|
14664 |
-
|
14665 |
-
|
|
|
|
|
|
|
|
|
|
|
14666 |
|
14667 |
-
|
14668 |
-
|
14669 |
-
state = {};
|
14670 |
-
}
|
14671 |
|
14672 |
-
|
14673 |
-
|
14674 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14675 |
|
14676 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14677 |
|
14678 |
-
|
14679 |
-
|
|
|
|
|
14680 |
|
14681 |
-
|
14682 |
-
|
14683 |
-
|
14684 |
-
|
14685 |
-
|
|
|
14686 |
|
14687 |
-
if (
|
14688 |
-
|
14689 |
-
|
|
|
14690 |
}
|
14691 |
|
14692 |
-
|
14693 |
-
hasChanged = hasChanged || nextStateForKey !== previousStateForKey;
|
14694 |
}
|
14695 |
-
|
14696 |
-
hasChanged = hasChanged || finalReducerKeys.length !== Object.keys(state).length;
|
14697 |
-
return hasChanged ? nextState : state;
|
14698 |
};
|
14699 |
-
}
|
14700 |
|
14701 |
-
|
14702 |
-
return
|
14703 |
-
|
14704 |
-
|
14705 |
-
|
14706 |
-
/**
|
14707 |
-
* Turns an object whose values are action creators, into an object with the
|
14708 |
-
* same keys, but with every function wrapped into a `dispatch` call so they
|
14709 |
-
* may be invoked directly. This is just a convenience method, as you can call
|
14710 |
-
* `store.dispatch(MyActionCreators.doSomething())` yourself just fine.
|
14711 |
-
*
|
14712 |
-
* For convenience, you can also pass an action creator as the first argument,
|
14713 |
-
* and get a dispatch wrapped function in return.
|
14714 |
-
*
|
14715 |
-
* @param {Function|Object} actionCreators An object whose values are action
|
14716 |
-
* creator functions. One handy way to obtain it is to use ES6 `import * as`
|
14717 |
-
* syntax. You may also pass a single function.
|
14718 |
-
*
|
14719 |
-
* @param {Function} dispatch The `dispatch` function available on your Redux
|
14720 |
-
* store.
|
14721 |
-
*
|
14722 |
-
* @returns {Function|Object} The object mimicking the original object, but with
|
14723 |
-
* every action creator wrapped into the `dispatch` call. If you passed a
|
14724 |
-
* function as `actionCreators`, the return value will also be a single
|
14725 |
-
* function.
|
14726 |
-
*/
|
14727 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14728 |
|
14729 |
-
|
14730 |
-
|
14731 |
-
|
14732 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14733 |
|
14734 |
-
if (typeof actionCreators !== 'object' || actionCreators === null) {
|
14735 |
-
throw new Error("bindActionCreators expected an object or a function, instead received " + (actionCreators === null ? 'null' : typeof actionCreators) + ". " + "Did you write \"import ActionCreators from\" instead of \"import * as ActionCreators from\"?");
|
14736 |
-
}
|
14737 |
|
14738 |
-
|
14739 |
|
14740 |
-
|
14741 |
-
|
14742 |
|
14743 |
-
|
14744 |
-
boundActionCreators[key] = bindActionCreator(actionCreator, dispatch);
|
14745 |
-
}
|
14746 |
-
}
|
14747 |
|
14748 |
-
|
14749 |
-
}
|
14750 |
|
14751 |
-
|
14752 |
-
|
14753 |
-
Object.defineProperty(obj, key, {
|
14754 |
-
value: value,
|
14755 |
-
enumerable: true,
|
14756 |
-
configurable: true,
|
14757 |
-
writable: true
|
14758 |
-
});
|
14759 |
-
} else {
|
14760 |
-
obj[key] = value;
|
14761 |
-
}
|
14762 |
|
14763 |
-
|
14764 |
-
}
|
14765 |
|
14766 |
-
|
14767 |
-
var keys = Object.keys(object);
|
14768 |
|
14769 |
-
|
14770 |
-
|
14771 |
-
}
|
14772 |
|
14773 |
-
|
14774 |
-
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
14775 |
-
});
|
14776 |
-
return keys;
|
14777 |
-
}
|
14778 |
|
14779 |
-
|
14780 |
-
for (var i = 1; i < arguments.length; i++) {
|
14781 |
-
var source = arguments[i] != null ? arguments[i] : {};
|
14782 |
|
14783 |
-
|
14784 |
-
|
14785 |
-
_defineProperty(target, key, source[key]);
|
14786 |
-
});
|
14787 |
-
} else if (Object.getOwnPropertyDescriptors) {
|
14788 |
-
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
14789 |
-
} else {
|
14790 |
-
ownKeys(source).forEach(function (key) {
|
14791 |
-
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
14792 |
-
});
|
14793 |
-
}
|
14794 |
-
}
|
14795 |
|
14796 |
-
|
14797 |
-
}
|
14798 |
|
14799 |
-
|
14800 |
-
* Composes single-argument functions from right to left. The rightmost
|
14801 |
-
* function can take multiple arguments as it provides the signature for
|
14802 |
-
* the resulting composite function.
|
14803 |
-
*
|
14804 |
-
* @param {...Function} funcs The functions to compose.
|
14805 |
-
* @returns {Function} A function obtained by composing the argument functions
|
14806 |
-
* from right to left. For example, compose(f, g, h) is identical to doing
|
14807 |
-
* (...args) => f(g(h(...args))).
|
14808 |
-
*/
|
14809 |
-
function compose() {
|
14810 |
-
for (var _len = arguments.length, funcs = new Array(_len), _key = 0; _key < _len; _key++) {
|
14811 |
-
funcs[_key] = arguments[_key];
|
14812 |
-
}
|
14813 |
|
14814 |
-
|
14815 |
-
|
14816 |
-
return arg;
|
14817 |
-
};
|
14818 |
-
}
|
14819 |
|
14820 |
-
|
14821 |
-
return funcs[0];
|
14822 |
-
}
|
14823 |
|
14824 |
-
return funcs.reduce(function (a, b) {
|
14825 |
-
return function () {
|
14826 |
-
return a(b.apply(void 0, arguments));
|
14827 |
-
};
|
14828 |
-
});
|
14829 |
-
}
|
14830 |
|
14831 |
/**
|
14832 |
-
*
|
14833 |
-
*
|
14834 |
-
* asynchronous actions in a concise manner, or logging every action payload.
|
14835 |
-
*
|
14836 |
-
* See `redux-thunk` package as an example of the Redux middleware.
|
14837 |
-
*
|
14838 |
-
* Because middleware is potentially asynchronous, this should be the first
|
14839 |
-
* store enhancer in the composition chain.
|
14840 |
-
*
|
14841 |
-
* Note that each middleware will be given the `dispatch` and `getState` functions
|
14842 |
-
* as named arguments.
|
14843 |
-
*
|
14844 |
-
* @param {...Function} middlewares The middleware chain to be applied.
|
14845 |
-
* @returns {Function} A store enhancer applying the middleware.
|
14846 |
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14847 |
|
14848 |
-
|
14849 |
-
|
14850 |
-
|
14851 |
-
|
|
|
|
|
|
|
|
|
|
|
14852 |
|
14853 |
-
|
14854 |
-
|
14855 |
-
|
|
|
|
|
|
|
14856 |
|
14857 |
-
|
14858 |
-
|
14859 |
-
};
|
14860 |
|
14861 |
-
|
14862 |
-
|
14863 |
-
|
14864 |
-
|
|
|
14865 |
}
|
14866 |
-
};
|
14867 |
-
var chain = middlewares.map(function (middleware) {
|
14868 |
-
return middleware(middlewareAPI);
|
14869 |
-
});
|
14870 |
-
_dispatch = compose.apply(void 0, chain)(store.dispatch);
|
14871 |
-
return _objectSpread2({}, store, {
|
14872 |
-
dispatch: _dispatch
|
14873 |
-
});
|
14874 |
-
};
|
14875 |
-
};
|
14876 |
-
}
|
14877 |
|
14878 |
-
|
14879 |
-
* This is a dummy function to check if the function name has been altered by minification.
|
14880 |
-
* If the function has been minified and NODE_ENV !== 'production', warn the user.
|
14881 |
-
*/
|
14882 |
|
14883 |
-
|
|
|
|
|
14884 |
|
14885 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14886 |
|
|
|
|
|
14887 |
|
|
|
|
|
14888 |
|
14889 |
-
|
14890 |
-
var defineProperty = __webpack_require__(17);
|
14891 |
-
var defineProperty_default = /*#__PURE__*/__webpack_require__.n(defineProperty);
|
14892 |
|
14893 |
-
// CONCATENATED MODULE: ./client/wc-api/wp-data-store/reducer.js
|
14894 |
|
|
|
14895 |
|
14896 |
-
|
|
|
14897 |
|
14898 |
-
|
14899 |
|
14900 |
-
|
14901 |
-
resources: {}
|
14902 |
-
};
|
14903 |
-
/**
|
14904 |
-
* Primary reducer for fresh-data apiclient data.
|
14905 |
-
*
|
14906 |
-
* @param {Object} state The base state for fresh-data.
|
14907 |
-
* @param {Object} action Action object to be processed.
|
14908 |
-
* @return {Object} The new state, or the previous state if this action doesn't belong to fresh-data.
|
14909 |
-
*/
|
14910 |
|
14911 |
-
|
14912 |
-
|
14913 |
-
var action = arguments.length > 1 ? arguments[1] : undefined;
|
14914 |
|
14915 |
-
|
14916 |
-
case 'FRESH_DATA_REQUESTED':
|
14917 |
-
return reduceRequested(state, action);
|
14918 |
|
14919 |
-
|
14920 |
-
return reduceReceived(state, action);
|
14921 |
|
14922 |
-
|
14923 |
-
|
14924 |
-
}
|
14925 |
-
}
|
14926 |
-
function reduceRequested(state, action) {
|
14927 |
-
var newResources = action.resourceNames.reduce(function (resources, name) {
|
14928 |
-
resources[name] = {
|
14929 |
-
lastRequested: action.time
|
14930 |
-
};
|
14931 |
-
return resources;
|
14932 |
-
}, {});
|
14933 |
-
return reduceResources(state, newResources);
|
14934 |
-
}
|
14935 |
-
function reduceReceived(state, action) {
|
14936 |
-
var newResources = Object.keys(action.resources).reduce(function (resources, name) {
|
14937 |
-
var resource = _objectSpread({}, action.resources[name]);
|
14938 |
|
14939 |
-
|
14940 |
-
|
14941 |
-
|
14942 |
|
14943 |
-
if (resource.error) {
|
14944 |
-
resource.lastError = action.time;
|
14945 |
-
}
|
14946 |
|
14947 |
-
|
14948 |
-
return resources;
|
14949 |
-
}, {});
|
14950 |
-
return reduceResources(state, newResources);
|
14951 |
-
}
|
14952 |
-
function reduceResources(state, newResources) {
|
14953 |
-
var updatedResources = Object.keys(newResources).reduce(function (resources, resourceName) {
|
14954 |
-
var resource = resources[resourceName];
|
14955 |
-
var newResource = newResources[resourceName];
|
14956 |
-
resources[resourceName] = _objectSpread(_objectSpread({}, resource), newResource);
|
14957 |
-
return resources;
|
14958 |
-
}, _objectSpread({}, state.resources));
|
14959 |
-
return _objectSpread(_objectSpread({}, state), {}, {
|
14960 |
-
resources: updatedResources
|
14961 |
-
});
|
14962 |
-
}
|
14963 |
-
// CONCATENATED MODULE: ./client/wc-api/wp-data-store/create-api-client.js
|
14964 |
-
/**
|
14965 |
-
* External dependencies
|
14966 |
-
*/
|
14967 |
|
|
|
|
|
14968 |
|
14969 |
-
|
14970 |
-
|
14971 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14972 |
|
14973 |
|
|
|
14974 |
|
14975 |
-
|
14976 |
-
|
14977 |
-
return createStore(reducer_reducer, devTools && devTools({
|
14978 |
-
name: name,
|
14979 |
-
instanceId: name
|
14980 |
-
}));
|
14981 |
-
}
|
14982 |
|
14983 |
-
|
14984 |
-
|
14985 |
-
|
14986 |
-
|
14987 |
-
|
14988 |
-
|
14989 |
-
|
14990 |
-
}
|
14991 |
|
14992 |
-
|
14993 |
-
|
14994 |
-
|
14995 |
-
|
14996 |
-
|
14997 |
-
|
14998 |
-
|
14999 |
-
store.dispatch({
|
15000 |
-
type: 'FRESH_DATA_RECEIVED',
|
15001 |
-
resources: resources,
|
15002 |
-
time: new Date()
|
15003 |
-
});
|
15004 |
-
}
|
15005 |
-
};
|
15006 |
}
|
15007 |
|
15008 |
-
|
15009 |
-
|
15010 |
-
|
15011 |
-
|
15012 |
-
|
|
|
15013 |
|
15014 |
-
|
15015 |
-
apiClient.setState(store.getState());
|
15016 |
-
};
|
15017 |
|
15018 |
-
|
15019 |
-
|
|
|
|
|
|
|
|
|
15020 |
}
|
15021 |
|
15022 |
-
|
15023 |
-
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/toConsumableArray.js
|
15024 |
-
var toConsumableArray = __webpack_require__(41);
|
15025 |
-
var toConsumableArray_default = /*#__PURE__*/__webpack_require__.n(toConsumableArray);
|
15026 |
|
15027 |
-
|
15028 |
-
var asyncToGenerator = __webpack_require__(51);
|
15029 |
-
var asyncToGenerator_default = /*#__PURE__*/__webpack_require__.n(asyncToGenerator);
|
15030 |
|
15031 |
-
|
15032 |
-
|
15033 |
|
15034 |
-
|
15035 |
-
function getResourceName(prefix, identifier) {
|
15036 |
-
var identifierString = JSON.stringify(identifier, Object.keys(identifier).sort());
|
15037 |
-
return "".concat(prefix, ":").concat(identifierString);
|
15038 |
-
}
|
15039 |
-
function getResourcePrefix(resourceName) {
|
15040 |
-
return resourceName.substring(0, resourceName.indexOf(':'));
|
15041 |
-
}
|
15042 |
-
function isResourcePrefix(resourceName, prefix) {
|
15043 |
-
var resourcePrefix = getResourcePrefix(resourceName);
|
15044 |
-
return resourcePrefix === prefix;
|
15045 |
-
}
|
15046 |
-
function getResourceIdentifier(resourceName) {
|
15047 |
-
var identifierString = resourceName.substring(resourceName.indexOf(':') + 1);
|
15048 |
-
return JSON.parse(identifierString);
|
15049 |
-
}
|
15050 |
-
// CONCATENATED MODULE: ./client/wc-api/export/mutations.js
|
15051 |
|
|
|
15052 |
|
|
|
|
|
15053 |
|
15054 |
-
|
15055 |
-
* External dependencies
|
15056 |
-
*/
|
15057 |
|
|
|
|
|
15058 |
|
15059 |
-
|
15060 |
-
* Internal dependencies
|
15061 |
-
*/
|
15062 |
|
|
|
|
|
|
|
|
|
15063 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15064 |
|
15065 |
-
|
15066 |
-
|
15067 |
-
|
15068 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15069 |
|
15070 |
-
|
15071 |
-
|
15072 |
-
|
15073 |
-
|
15074 |
-
|
15075 |
-
|
15076 |
-
|
15077 |
-
|
|
|
|
|
|
|
15078 |
|
15079 |
-
case 4:
|
15080 |
-
result = _context.sent;
|
15081 |
-
response = result[0][resourceName];
|
15082 |
|
15083 |
-
|
15084 |
-
|
15085 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15086 |
|
15087 |
-
if (response && response.error) {
|
15088 |
-
createNotice('error', Object(external_this_wp_i18n_["sprintf"])(Object(external_this_wp_i18n_["__"])('There was a problem exporting your %s Report. Please try again.', 'woocommerce-admin'), reportTitle));
|
15089 |
-
}
|
15090 |
|
15091 |
-
|
15092 |
-
|
15093 |
-
return _context.stop();
|
15094 |
-
}
|
15095 |
-
}
|
15096 |
-
}, _callee);
|
15097 |
-
}));
|
15098 |
|
15099 |
-
|
15100 |
-
|
15101 |
-
|
15102 |
-
}();
|
15103 |
-
};
|
15104 |
|
15105 |
-
|
15106 |
-
|
15107 |
-
}
|
15108 |
-
|
15109 |
-
|
15110 |
-
|
|
|
|
|
|
|
|
|
15111 |
|
15112 |
-
// EXTERNAL MODULE: ./client/wc-api/constants.js
|
15113 |
-
var constants = __webpack_require__(33);
|
15114 |
|
15115 |
-
|
|
|
|
|
|
|
|
|
|
|
15116 |
|
|
|
15117 |
|
|
|
|
|
|
|
15118 |
|
|
|
|
|
|
|
|
|
|
|
|
|
15119 |
|
|
|
15120 |
/**
|
15121 |
* External dependencies
|
15122 |
*/
|
@@ -15126,1147 +15412,1133 @@ var constants = __webpack_require__(33);
|
|
15126 |
*/
|
15127 |
|
15128 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15129 |
|
15130 |
-
|
15131 |
-
|
15132 |
-
|
15133 |
-
return toConsumableArray_default()(initiateExport(resourceNames, data, fetch));
|
15134 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15135 |
|
15136 |
-
function initiateExport(resourceNames, data, fetch) {
|
15137 |
-
var filteredNames = resourceNames.filter(function (name) {
|
15138 |
-
return name.startsWith('report-export-');
|
15139 |
-
});
|
15140 |
-
return filteredNames.map( /*#__PURE__*/function () {
|
15141 |
-
var _ref = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime.mark(function _callee(resourceName) {
|
15142 |
-
var prefix, reportType, url, result;
|
15143 |
-
return regeneratorRuntime.wrap(function _callee$(_context) {
|
15144 |
-
while (1) {
|
15145 |
-
switch (_context.prev = _context.next) {
|
15146 |
-
case 0:
|
15147 |
-
prefix = getResourcePrefix(resourceName);
|
15148 |
-
reportType = prefix.split('-').pop();
|
15149 |
-
url = constants["c" /* NAMESPACE */] + '/reports/' + reportType + '/export';
|
15150 |
-
_context.prev = 3;
|
15151 |
-
_context.next = 6;
|
15152 |
-
return fetch({
|
15153 |
-
path: url,
|
15154 |
-
method: 'POST',
|
15155 |
-
data: {
|
15156 |
-
report_args: data[resourceName],
|
15157 |
-
email: true
|
15158 |
-
}
|
15159 |
-
});
|
15160 |
-
|
15161 |
-
case 6:
|
15162 |
-
result = _context.sent;
|
15163 |
-
return _context.abrupt("return", defineProperty_default()({}, resourceName, defineProperty_default()({}, result.status, result.message)));
|
15164 |
-
|
15165 |
-
case 10:
|
15166 |
-
_context.prev = 10;
|
15167 |
-
_context.t0 = _context["catch"](3);
|
15168 |
-
return _context.abrupt("return", defineProperty_default()({}, resourceName, {
|
15169 |
-
error: _context.t0
|
15170 |
-
}));
|
15171 |
-
|
15172 |
-
case 13:
|
15173 |
-
case "end":
|
15174 |
-
return _context.stop();
|
15175 |
-
}
|
15176 |
-
}
|
15177 |
-
}, _callee, null, [[3, 10]]);
|
15178 |
-
}));
|
15179 |
|
15180 |
-
|
15181 |
-
|
15182 |
-
};
|
15183 |
-
}());
|
15184 |
}
|
15185 |
-
|
15186 |
-
/* harmony default export */ var export_operations = ({
|
15187 |
-
update: operations_update
|
15188 |
-
});
|
15189 |
-
// CONCATENATED MODULE: ./client/wc-api/export/index.js
|
15190 |
/**
|
15191 |
-
*
|
|
|
|
|
|
|
|
|
|
|
15192 |
*/
|
15193 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15194 |
|
15195 |
-
|
15196 |
-
|
15197 |
-
|
15198 |
-
});
|
15199 |
-
// CONCATENATED MODULE: ./client/wc-api/items/mutations.js
|
15200 |
|
|
|
15201 |
|
|
|
15202 |
|
15203 |
-
|
|
|
|
|
|
|
|
|
15204 |
|
15205 |
-
function mutations_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { mutations_ownKeys(Object(source), true).forEach(function (key) { defineProperty_default()(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { mutations_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
15206 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15207 |
/**
|
15208 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15209 |
*/
|
15210 |
|
15211 |
|
|
|
|
|
|
|
|
|
|
|
|
|
15212 |
/**
|
15213 |
-
*
|
|
|
|
|
|
|
|
|
|
|
15214 |
*/
|
15215 |
|
15216 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15217 |
|
15218 |
-
var mutations_updateProductStock = function updateProductStock(operations) {
|
15219 |
-
return /*#__PURE__*/function () {
|
15220 |
-
var _ref = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime.mark(function _callee(product, newStock) {
|
15221 |
-
var _dispatch, createNotice, oldStockQuantity, resourceName, result, response;
|
15222 |
-
|
15223 |
-
return regeneratorRuntime.wrap(function _callee$(_context) {
|
15224 |
-
while (1) {
|
15225 |
-
switch (_context.prev = _context.next) {
|
15226 |
-
case 0:
|
15227 |
-
_dispatch = Object(external_this_wp_data_["dispatch"])('core/notices'), createNotice = _dispatch.createNotice;
|
15228 |
-
oldStockQuantity = product.stock_quantity;
|
15229 |
-
resourceName = getResourceName('items-query-products-item', product.id); // Optimistically update product stock
|
15230 |
|
15231 |
-
|
15232 |
-
|
15233 |
-
|
15234 |
-
_context.next = 6;
|
15235 |
-
return operations.update([resourceName], defineProperty_default()({}, resourceName, {
|
15236 |
-
id: product.id,
|
15237 |
-
type: product.type,
|
15238 |
-
parent_id: product.parent_id,
|
15239 |
-
stock_quantity: newStock
|
15240 |
-
}));
|
15241 |
|
15242 |
-
|
15243 |
-
|
15244 |
-
|
15245 |
|
15246 |
-
|
15247 |
-
|
15248 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
15249 |
|
15250 |
-
if (response && response.error) {
|
15251 |
-
createNotice('error', Object(external_this_wp_i18n_["sprintf"])(Object(external_this_wp_i18n_["__"])('%s stock could not be updated.', 'woocommerce-admin'), product.name)); // Revert local changes if the operation failed in the server
|
15252 |
|
15253 |
-
|
15254 |
-
|
15255 |
-
|
15256 |
-
}
|
15257 |
|
15258 |
-
|
15259 |
-
|
15260 |
-
|
15261 |
-
|
15262 |
-
|
15263 |
-
|
15264 |
-
|
|
|
|
|
15265 |
|
15266 |
-
|
15267 |
-
|
15268 |
-
|
15269 |
-
|
15270 |
-
};
|
15271 |
|
15272 |
-
|
15273 |
-
|
15274 |
-
}
|
15275 |
-
|
15276 |
-
|
15277 |
-
|
|
|
|
|
|
|
15278 |
|
15279 |
-
|
15280 |
-
var
|
|
|
|
|
15281 |
|
15282 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15283 |
|
15284 |
|
|
|
|
|
|
|
|
|
15285 |
|
|
|
|
|
|
|
|
|
15286 |
|
15287 |
-
|
15288 |
|
15289 |
-
|
15290 |
|
15291 |
-
|
15292 |
-
|
15293 |
-
*/
|
15294 |
|
|
|
|
|
|
|
|
|
|
|
|
|
15295 |
|
15296 |
-
|
15297 |
-
|
15298 |
-
*/
|
15299 |
|
|
|
15300 |
|
|
|
|
|
15301 |
|
15302 |
-
|
15303 |
-
|
15304 |
-
|
15305 |
-
'items-query-coupons': 'coupons',
|
15306 |
-
'items-query-leaderboards': 'leaderboards',
|
15307 |
-
'items-query-orders': 'orders',
|
15308 |
-
'items-query-products': 'products',
|
15309 |
-
'items-query-taxes': 'taxes'
|
15310 |
-
};
|
15311 |
|
15312 |
-
function
|
15313 |
-
|
15314 |
-
|
15315 |
-
|
15316 |
-
|
15317 |
-
|
15318 |
-
return
|
15319 |
-
|
15320 |
-
var prefix, endpoint, query, url, isUnboundedRequest, response, items, totalCount, ids, itemResources;
|
15321 |
-
return regeneratorRuntime.wrap(function _callee$(_context) {
|
15322 |
-
while (1) {
|
15323 |
-
switch (_context.prev = _context.next) {
|
15324 |
-
case 0:
|
15325 |
-
prefix = getResourcePrefix(resourceName);
|
15326 |
-
endpoint = typeEndpointMap[prefix];
|
15327 |
-
query = getResourceIdentifier(resourceName);
|
15328 |
-
url = Object(external_this_wp_url_["addQueryArgs"])("".concat(constants["c" /* NAMESPACE */], "/").concat(endpoint), query);
|
15329 |
-
isUnboundedRequest = query.per_page === -1;
|
15330 |
-
_context.prev = 5;
|
15331 |
-
_context.next = 8;
|
15332 |
-
return fetch({
|
15333 |
-
/* eslint-disable max-len */
|
15334 |
|
15335 |
-
|
15336 |
-
* A false parse flag allows a full response including headers which are useful
|
15337 |
-
* to determine totalCount. However, this invalidates an unbounded request, ie
|
15338 |
-
* `per_page: -1` by skipping middleware in apiFetch.
|
15339 |
-
*
|
15340 |
-
* See the Gutenberg code for more:
|
15341 |
-
* https://github.com/WordPress/gutenberg/blob/dee3dcf49028717b4af3164e3096bfe747c41ed2/packages/api-fetch/src/middlewares/fetch-all-middleware.js#L39-L45
|
15342 |
-
*/
|
15343 |
|
15344 |
-
|
15345 |
-
|
15346 |
-
path: url
|
15347 |
-
});
|
15348 |
|
15349 |
-
|
15350 |
-
|
|
|
|
|
|
|
|
|
|
|
15351 |
|
15352 |
-
if (!isUnboundedRequest) {
|
15353 |
-
_context.next = 14;
|
15354 |
-
break;
|
15355 |
-
}
|
15356 |
|
15357 |
-
|
15358 |
-
|
15359 |
-
|
15360 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15361 |
|
15362 |
-
|
15363 |
-
_context.next = 16;
|
15364 |
-
return response.json();
|
15365 |
|
15366 |
-
|
15367 |
-
|
15368 |
-
totalCount = parseInt(response.headers.get('x-wp-total'), 10);
|
15369 |
|
15370 |
-
|
15371 |
-
|
15372 |
-
|
15373 |
-
|
15374 |
-
|
15375 |
-
|
15376 |
-
|
15377 |
-
|
15378 |
-
return resources;
|
15379 |
-
}, {});
|
15380 |
-
return _context.abrupt("return", operations_objectSpread(defineProperty_default()({}, resourceName, {
|
15381 |
-
data: ids,
|
15382 |
-
totalCount: totalCount
|
15383 |
-
}), itemResources));
|
15384 |
|
15385 |
-
|
15386 |
-
|
15387 |
-
|
15388 |
-
|
15389 |
-
|
15390 |
-
|
15391 |
|
15392 |
-
|
15393 |
-
|
15394 |
-
|
15395 |
-
|
15396 |
-
|
15397 |
-
|
15398 |
-
}));
|
15399 |
|
15400 |
-
|
15401 |
-
|
15402 |
-
|
15403 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15404 |
}
|
15405 |
|
15406 |
-
|
15407 |
-
var fetch = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : external_this_wp_apiFetch_default.a;
|
15408 |
-
var updateableTypes = ['items-query-products-item'];
|
15409 |
-
var filteredNames = resourceNames.filter(function (name) {
|
15410 |
-
return updateableTypes.includes(getResourcePrefix(name));
|
15411 |
-
});
|
15412 |
-
return filteredNames.map( /*#__PURE__*/function () {
|
15413 |
-
var _ref3 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime.mark(function _callee2(resourceName) {
|
15414 |
-
var _data$resourceName, id, parentId, type, itemData, url;
|
15415 |
|
15416 |
-
|
15417 |
-
while (1) {
|
15418 |
-
switch (_context2.prev = _context2.next) {
|
15419 |
-
case 0:
|
15420 |
-
_data$resourceName = data[resourceName], id = _data$resourceName.id, parentId = _data$resourceName.parent_id, type = _data$resourceName.type, itemData = objectWithoutProperties_default()(_data$resourceName, ["id", "parent_id", "type"]);
|
15421 |
-
url = constants["c" /* NAMESPACE */];
|
15422 |
-
_context2.t0 = type;
|
15423 |
-
_context2.next = _context2.t0 === 'variation' ? 5 : _context2.t0 === 'variable' ? 7 : _context2.t0 === 'simple' ? 7 : 7;
|
15424 |
-
break;
|
15425 |
|
15426 |
-
|
15427 |
-
|
15428 |
-
return _context2.abrupt("break", 8);
|
15429 |
|
15430 |
-
|
15431 |
-
url += "/products/".concat(id);
|
15432 |
|
15433 |
-
|
15434 |
-
return _context2.abrupt("return", fetch({
|
15435 |
-
path: url,
|
15436 |
-
method: 'PUT',
|
15437 |
-
data: itemData
|
15438 |
-
}).then(function (item) {
|
15439 |
-
return defineProperty_default()({}, resourceName, {
|
15440 |
-
data: item
|
15441 |
-
});
|
15442 |
-
}).catch(function (error) {
|
15443 |
-
return defineProperty_default()({}, resourceName, {
|
15444 |
-
error: error
|
15445 |
-
});
|
15446 |
-
}));
|
15447 |
|
15448 |
-
|
15449 |
-
|
15450 |
-
return _context2.stop();
|
15451 |
-
}
|
15452 |
-
}
|
15453 |
-
}, _callee2);
|
15454 |
-
}));
|
15455 |
|
15456 |
-
|
15457 |
-
|
15458 |
-
|
15459 |
-
|
15460 |
-
|
|
|
|
|
|
|
15461 |
|
15462 |
-
|
15463 |
-
|
15464 |
-
|
15465 |
-
|
15466 |
-
|
15467 |
-
|
15468 |
-
page: 1,
|
15469 |
-
per_page: 1,
|
15470 |
-
low_in_stock: true,
|
15471 |
-
status: 'publish'
|
15472 |
-
});
|
15473 |
-
return filteredNames.map( /*#__PURE__*/function () {
|
15474 |
-
var _ref6 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime.mark(function _callee3(resourceName) {
|
15475 |
-
var _ref7;
|
15476 |
|
15477 |
-
|
15478 |
-
|
15479 |
-
|
15480 |
-
|
15481 |
-
|
15482 |
-
|
15483 |
-
|
15484 |
-
|
15485 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15486 |
|
15487 |
-
case 1:
|
15488 |
-
case "end":
|
15489 |
-
return _context3.stop();
|
15490 |
-
}
|
15491 |
-
}
|
15492 |
-
}, _callee3);
|
15493 |
-
}));
|
15494 |
|
15495 |
-
|
15496 |
-
|
15497 |
-
|
15498 |
-
|
15499 |
}
|
|
|
15500 |
|
15501 |
-
|
15502 |
-
read: operations_read,
|
15503 |
-
update: items_operations_update,
|
15504 |
-
updateLocally: operations_updateLocally
|
15505 |
-
});
|
15506 |
-
// EXTERNAL MODULE: external "lodash"
|
15507 |
-
var external_lodash_ = __webpack_require__(2);
|
15508 |
|
15509 |
-
|
|
|
|
|
|
|
|
|
|
|
15510 |
/**
|
15511 |
* External dependencies
|
15512 |
*/
|
15513 |
|
15514 |
/**
|
15515 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15516 |
*/
|
15517 |
|
|
|
|
|
|
|
|
|
|
|
|
35 |
/******/
|
36 |
/******/ // object to store loaded CSS chunks
|
37 |
/******/ var installedCssChunks = {
|
38 |
+
/******/ 23: 0
|
39 |
/******/ }
|
40 |
/******/ var isCssRtlEnabled = function() {
|
41 |
/******/ return document.dir === 'rtl';
|
45 |
/******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched
|
46 |
/******/ // Promise = chunk loading, 0 = chunk loaded
|
47 |
/******/ var installedChunks = {
|
48 |
+
/******/ 23: 0
|
49 |
/******/ };
|
50 |
/******/
|
51 |
/******/
|
52 |
/******/
|
53 |
/******/ // script path function
|
54 |
/******/ function jsonpScriptSrc(chunkId) {
|
55 |
+
/******/ return __webpack_require__.p + "chunks/" + chunkId + "." + {"0":"c8452721bca81bd851ae","1":"4c5f3a9f3d2bd068fc6d","2":"b11d4cf0dec19fd9f0e6","3":"e67e2d439872e8decf5e","4":"6eab7b1e8d46171fef9a","5":"611a9c04266cfb776f7b","6":"87f4e7e8f3245cfb29c1","7":"f17130e2641abf3cd016","8":"46ec1f52d28485795ce0","9":"f09a1380fc1c0b03c0d8","10":"7bf713d572ef1de24f84","11":"3e85cd2e76cc8aeb3e3f","12":"84216d2c32d675753560","13":"cca4d83e5dbf1ca4005c","14":"68b3dadffd1cc4b0a2a0","15":"0dc5162a27e4dca31b7e","16":"787c1f9af0839717386c","17":"36eb07ef43a44b4b40da","18":"bc48f13417b765ec08ef","19":"e560ed3a98b960791a7c","20":"dbc2abed3165d6c929ba","21":"f95723923635672f927b","22":"7009e9b5dfa7bd08518f","27":"81bec8245cabf6a35ade","28":"ceb58b4426a63286c301","29":"e4a8b26907da5f130e16","32":"6d3e1dde339ba17062ae","33":"cb071961fc49712b4a3a","35":"ecd46c45a0243244014b","37":"69f982dd979949e93fb8","45":"70c2b8bd61e33438583c","46":"9859831f2290ca3c1022","47":"30311e86842714f654e0","48":"065d88f8e2f395082e30","49":"ee48201c410a550f69df","50":"9ac21ea893ae6b65ed1c","51":"11fff3c9fcde6c700c0d","52":"56527c0bd48f8b266baa"}[chunkId] + ".js"
|
56 |
/******/ }
|
57 |
/******/
|
58 |
/******/ // The require function
|
86 |
/******/
|
87 |
/******/
|
88 |
/******/ // mini-css-extract-plugin CSS loading
|
89 |
+
/******/ var cssChunks = {"0":1,"8":1,"9":1,"10":1,"11":1,"12":1,"17":1,"22":1,"28":1,"29":1,"32":1,"33":1,"35":1,"37":1,"45":1,"46":1,"47":1,"48":1};
|
90 |
/******/ if(installedCssChunks[chunkId]) promises.push(installedCssChunks[chunkId]);
|
91 |
/******/ else if(installedCssChunks[chunkId] !== 0 && cssChunks[chunkId]) {
|
92 |
/******/ promises.push(installedCssChunks[chunkId] = new Promise(function(resolve, reject) {
|
238 |
/******/ // on error function for async loading
|
239 |
/******/ __webpack_require__.oe = function(err) { console.error(err); throw err; };
|
240 |
/******/
|
241 |
+
/******/ var jsonpArray = window["__wcAdmin_webpackJsonp"] = window["__wcAdmin_webpackJsonp"] || [];
|
242 |
/******/ var oldJsonpFunction = jsonpArray.push.bind(jsonpArray);
|
243 |
/******/ jsonpArray.push = webpackJsonpCallback;
|
244 |
/******/ jsonpArray = jsonpArray.slice();
|
247 |
/******/
|
248 |
/******/
|
249 |
/******/ // Load entry module and return exports
|
250 |
+
/******/ return __webpack_require__(__webpack_require__.s = 446);
|
251 |
/******/ })
|
252 |
/************************************************************************/
|
253 |
/******/ ({
|
272 |
if (false) { var throwOnDirectAccess, ReactIs; } else {
|
273 |
// By explicitly using `prop-types` you are opting into new production behavior.
|
274 |
// http://fb.me/prop-types-in-prod
|
275 |
+
module.exports = __webpack_require__(117)();
|
276 |
}
|
277 |
|
278 |
|
314 |
|
315 |
/***/ }),
|
316 |
|
317 |
+
/***/ 100:
|
318 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
319 |
|
320 |
"use strict";
|
321 |
+
/* harmony import */ var _babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(9);
|
322 |
+
/* harmony import */ var _babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(8);
|
323 |
+
/* harmony import */ var _babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(11);
|
324 |
+
/* harmony import */ var _babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(4);
|
325 |
+
/* harmony import */ var _babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(10);
|
326 |
+
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(0);
|
327 |
+
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_5__);
|
328 |
+
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(2);
|
329 |
+
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_6__);
|
330 |
+
/* harmony import */ var _popover__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(83);
|
331 |
+
/* harmony import */ var _shortcut__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(91);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
332 |
|
333 |
|
334 |
|
336 |
|
337 |
|
338 |
|
339 |
+
function _createSuper(Derived) { return function () { var Super = Object(_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__[/* default */ "a"])(Derived), result; if (_isNativeReflectConstruct()) { var NewTarget = Object(_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__[/* default */ "a"])(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return Object(_babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__[/* default */ "a"])(this, result); }; }
|
340 |
|
341 |
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
|
342 |
|
343 |
/**
|
344 |
+
* External dependencies
|
|
|
|
|
|
|
|
|
345 |
*/
|
346 |
|
347 |
/**
|
348 |
+
* WordPress dependencies
|
349 |
*/
|
350 |
|
351 |
|
352 |
+
/**
|
353 |
+
* Internal dependencies
|
354 |
+
*/
|
355 |
|
356 |
|
357 |
|
358 |
/**
|
359 |
+
* Time over children to wait before showing tooltip
|
|
|
|
|
|
|
|
|
|
|
360 |
*
|
361 |
+
* @type {number}
|
362 |
*/
|
363 |
|
364 |
+
var TOOLTIP_DELAY = 700;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
365 |
|
366 |
+
var Tooltip = /*#__PURE__*/function (_Component) {
|
367 |
+
Object(_babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_4__[/* default */ "a"])(Tooltip, _Component);
|
368 |
|
369 |
+
var _super = _createSuper(Tooltip);
|
370 |
|
371 |
+
function Tooltip() {
|
372 |
+
var _this;
|
373 |
|
374 |
+
Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])(this, Tooltip);
|
375 |
|
376 |
+
_this = _super.apply(this, arguments);
|
377 |
+
_this.delayedSetIsOver = Object(lodash__WEBPACK_IMPORTED_MODULE_6__["debounce"])(function (isOver) {
|
378 |
+
return _this.setState({
|
379 |
+
isOver: isOver
|
380 |
+
});
|
381 |
+
}, TOOLTIP_DELAY);
|
382 |
+
/**
|
383 |
+
* Prebound `isInMouseDown` handler, created as a constant reference to
|
384 |
+
* assure ability to remove in component unmount.
|
385 |
+
*
|
386 |
+
* @type {Function}
|
387 |
+
*/
|
388 |
|
389 |
+
_this.cancelIsMouseDown = _this.createSetIsMouseDown(false);
|
390 |
+
/**
|
391 |
+
* Whether a the mouse is currently pressed, used in determining whether
|
392 |
+
* to handle a focus event as displaying the tooltip immediately.
|
393 |
+
*
|
394 |
+
* @type {boolean}
|
395 |
+
*/
|
396 |
|
397 |
+
_this.isInMouseDown = false;
|
398 |
+
_this.state = {
|
399 |
+
isOver: false
|
400 |
+
};
|
401 |
+
return _this;
|
402 |
+
}
|
|
|
|
|
|
|
|
|
|
|
403 |
|
404 |
+
Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"])(Tooltip, [{
|
405 |
+
key: "componentWillUnmount",
|
406 |
+
value: function componentWillUnmount() {
|
407 |
+
this.delayedSetIsOver.cancel();
|
408 |
+
document.removeEventListener('mouseup', this.cancelIsMouseDown);
|
409 |
+
}
|
410 |
+
}, {
|
411 |
+
key: "emitToChild",
|
412 |
+
value: function emitToChild(eventName, event) {
|
413 |
+
var children = this.props.children;
|
414 |
|
415 |
+
if (_wordpress_element__WEBPACK_IMPORTED_MODULE_5__["Children"].count(children) !== 1) {
|
416 |
+
return;
|
417 |
+
}
|
|
|
418 |
|
419 |
+
var child = _wordpress_element__WEBPACK_IMPORTED_MODULE_5__["Children"].only(children);
|
|
|
|
|
|
|
|
|
420 |
|
421 |
+
if (typeof child.props[eventName] === 'function') {
|
422 |
+
child.props[eventName](event);
|
423 |
+
}
|
424 |
+
}
|
425 |
+
}, {
|
426 |
+
key: "createToggleIsOver",
|
427 |
+
value: function createToggleIsOver(eventName, isDelayed) {
|
428 |
+
var _this2 = this;
|
429 |
|
430 |
+
return function (event) {
|
431 |
+
// Preserve original child callback behavior
|
432 |
+
_this2.emitToChild(eventName, event); // Mouse events behave unreliably in React for disabled elements,
|
433 |
+
// firing on mouseenter but not mouseleave. Further, the default
|
434 |
+
// behavior for disabled elements in some browsers is to ignore
|
435 |
+
// mouse events. Don't bother trying to to handle them.
|
436 |
+
//
|
437 |
+
// See: https://github.com/facebook/react/issues/4251
|
438 |
|
|
|
|
|
|
|
439 |
|
440 |
+
if (event.currentTarget.disabled) {
|
441 |
+
return;
|
442 |
+
} // A focus event will occur as a result of a mouse click, but it
|
443 |
+
// should be disambiguated between interacting with the button and
|
444 |
+
// using an explicit focus shift as a cue to display the tooltip.
|
445 |
|
|
|
|
|
|
|
|
|
|
|
446 |
|
447 |
+
if ('focus' === event.type && _this2.isInMouseDown) {
|
448 |
+
return;
|
449 |
+
} // Needed in case unsetting is over while delayed set pending, i.e.
|
450 |
+
// quickly blur/mouseleave before delayedSetIsOver is called
|
451 |
|
|
|
|
|
452 |
|
453 |
+
_this2.delayedSetIsOver.cancel();
|
454 |
|
455 |
+
var isOver = Object(lodash__WEBPACK_IMPORTED_MODULE_6__["includes"])(['focus', 'mouseenter'], event.type);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
456 |
|
457 |
+
if (isOver === _this2.state.isOver) {
|
458 |
+
return;
|
|
|
|
|
459 |
}
|
|
|
|
|
|
|
|
|
460 |
|
461 |
+
if (isDelayed) {
|
462 |
+
_this2.delayedSetIsOver(isOver);
|
463 |
+
} else {
|
464 |
+
_this2.setState({
|
465 |
+
isOver: isOver
|
466 |
});
|
467 |
}
|
468 |
+
};
|
469 |
+
}
|
470 |
+
/**
|
471 |
+
* Creates an event callback to handle assignment of the `isInMouseDown`
|
472 |
+
* instance property in response to a `mousedown` or `mouseup` event.
|
473 |
+
*
|
474 |
+
* @param {boolean} isMouseDown Whether handler is to be created for the
|
475 |
+
* `mousedown` event, as opposed to `mouseup`.
|
476 |
+
*
|
477 |
+
* @return {Function} Event callback handler.
|
478 |
+
*/
|
479 |
|
480 |
+
}, {
|
481 |
+
key: "createSetIsMouseDown",
|
482 |
+
value: function createSetIsMouseDown(isMouseDown) {
|
483 |
+
var _this3 = this;
|
484 |
|
485 |
+
return function (event) {
|
486 |
+
// Preserve original child callback behavior
|
487 |
+
_this3.emitToChild(isMouseDown ? 'onMouseDown' : 'onMouseUp', event); // On mouse down, the next `mouseup` should revert the value of the
|
488 |
+
// instance property and remove its own event handler. The bind is
|
489 |
+
// made on the document since the `mouseup` might not occur within
|
490 |
+
// the bounds of the element.
|
491 |
|
|
|
|
|
|
|
492 |
|
493 |
+
document[isMouseDown ? 'addEventListener' : 'removeEventListener']('mouseup', _this3.cancelIsMouseDown);
|
494 |
+
_this3.isInMouseDown = isMouseDown;
|
495 |
+
};
|
496 |
+
}
|
497 |
+
}, {
|
498 |
+
key: "render",
|
499 |
+
value: function render() {
|
500 |
+
var _this$props = this.props,
|
501 |
+
children = _this$props.children,
|
502 |
+
position = _this$props.position,
|
503 |
+
text = _this$props.text,
|
504 |
+
shortcut = _this$props.shortcut;
|
|
|
|
|
505 |
|
506 |
+
if (_wordpress_element__WEBPACK_IMPORTED_MODULE_5__["Children"].count(children) !== 1) {
|
507 |
+
if (false) {}
|
508 |
|
509 |
+
return children;
|
510 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
511 |
|
512 |
+
var child = _wordpress_element__WEBPACK_IMPORTED_MODULE_5__["Children"].only(children);
|
513 |
+
var isOver = this.state.isOver;
|
514 |
+
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_5__["cloneElement"])(child, {
|
515 |
+
onMouseEnter: this.createToggleIsOver('onMouseEnter', true),
|
516 |
+
onMouseLeave: this.createToggleIsOver('onMouseLeave'),
|
517 |
+
onClick: this.createToggleIsOver('onClick'),
|
518 |
+
onFocus: this.createToggleIsOver('onFocus'),
|
519 |
+
onBlur: this.createToggleIsOver('onBlur'),
|
520 |
+
onMouseDown: this.createSetIsMouseDown(true),
|
521 |
+
children: Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_5__["concatChildren"])(child.props.children, isOver && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_5__["createElement"])(_popover__WEBPACK_IMPORTED_MODULE_7__[/* default */ "a"], {
|
522 |
+
focusOnMount: false,
|
523 |
+
position: position,
|
524 |
+
className: "components-tooltip",
|
525 |
+
"aria-hidden": "true",
|
526 |
+
animate: false,
|
527 |
+
noArrow: true
|
528 |
+
}, text, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_5__["createElement"])(_shortcut__WEBPACK_IMPORTED_MODULE_8__[/* default */ "a"], {
|
529 |
+
className: "components-tooltip__shortcut",
|
530 |
+
shortcut: shortcut
|
531 |
+
})))
|
532 |
+
});
|
533 |
+
}
|
534 |
+
}]);
|
535 |
|
536 |
+
return Tooltip;
|
537 |
+
}(_wordpress_element__WEBPACK_IMPORTED_MODULE_5__["Component"]);
|
|
|
538 |
|
539 |
+
/* harmony default export */ __webpack_exports__["a"] = (Tooltip);
|
540 |
+
//# sourceMappingURL=index.js.map
|
|
|
|
|
|
|
|
|
|
|
541 |
|
542 |
+
/***/ }),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
543 |
|
544 |
+
/***/ 101:
|
545 |
+
/***/ (function(module, exports, __webpack_require__) {
|
546 |
|
547 |
+
var e=__webpack_require__(13),n={display:"block",opacity:0,position:"absolute",top:0,left:0,height:"100%",width:"100%",overflow:"hidden",pointerEvents:"none",zIndex:-1},t=function(t){var r=t.onResize,u=e.useRef();return function(n,t){var r=function(){return n.current&&n.current.contentDocument&&n.current.contentDocument.defaultView};function u(){t();var e=r();e&&e.addEventListener("resize",t)}e.useEffect((function(){return r()?u():n.current&&n.current.addEventListener&&n.current.addEventListener("load",u),function(){var e=r();e&&"function"==typeof e.removeEventListener&&e.removeEventListener("resize",t)}}),[])}(u,(function(){return r(u)})),e.createElement("iframe",{style:n,src:"about:blank",ref:u,"aria-hidden":!0,tabIndex:-1,frameBorder:0})},r=function(e){return{width:null!=e?e.offsetWidth:null,height:null!=e?e.offsetHeight:null}};module.exports=function(n){void 0===n&&(n=r);var u=e.useState(n(null)),o=u[0],i=u[1],c=e.useCallback((function(e){return i(n(e.current))}),[n]);return[e.useMemo((function(){return e.createElement(t,{onResize:c})}),[c]),o]};
|
548 |
+
//# sourceMappingURL=index.js.map
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
549 |
|
|
|
550 |
|
551 |
/***/ }),
|
552 |
|
553 |
+
/***/ 102:
|
554 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
555 |
|
556 |
"use strict";
|
|
|
|
|
|
|
557 |
|
558 |
+
// EXPORTS
|
559 |
+
__webpack_require__.d(__webpack_exports__, "a", function() { return /* binding */ createBrowserHistory; });
|
560 |
+
__webpack_require__.d(__webpack_exports__, "c", function() { return /* binding */ createMemoryHistory; });
|
561 |
+
__webpack_require__.d(__webpack_exports__, "b", function() { return /* binding */ createLocation; });
|
562 |
+
__webpack_require__.d(__webpack_exports__, "e", function() { return /* binding */ locationsAreEqual; });
|
563 |
+
__webpack_require__.d(__webpack_exports__, "d", function() { return /* binding */ createPath; });
|
564 |
|
565 |
+
// UNUSED EXPORTS: createHashHistory, parsePath
|
566 |
|
567 |
+
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/extends.js
|
568 |
+
var esm_extends = __webpack_require__(12);
|
569 |
|
570 |
+
// CONCATENATED MODULE: ./node_modules/resolve-pathname/esm/resolve-pathname.js
|
571 |
+
function isAbsolute(pathname) {
|
572 |
+
return pathname.charAt(0) === '/';
|
573 |
+
}
|
574 |
|
575 |
+
// About 1.5x faster than the two-arg version of Array#splice()
|
576 |
+
function spliceOne(list, index) {
|
577 |
+
for (var i = index, k = i + 1, n = list.length; k < n; i += 1, k += 1) {
|
578 |
+
list[i] = list[k];
|
579 |
+
}
|
580 |
|
581 |
+
list.pop();
|
582 |
+
}
|
583 |
|
584 |
+
// This implementation is based heavily on node's url.parse
|
585 |
+
function resolvePathname(to, from) {
|
586 |
+
if (from === undefined) from = '';
|
587 |
|
588 |
+
var toParts = (to && to.split('/')) || [];
|
589 |
+
var fromParts = (from && from.split('/')) || [];
|
590 |
|
591 |
+
var isToAbs = to && isAbsolute(to);
|
592 |
+
var isFromAbs = from && isAbsolute(from);
|
593 |
+
var mustEndAbs = isToAbs || isFromAbs;
|
594 |
|
595 |
+
if (to && isAbsolute(to)) {
|
596 |
+
// to is absolute
|
597 |
+
fromParts = toParts;
|
598 |
+
} else if (toParts.length) {
|
599 |
+
// to is relative, drop the filename
|
600 |
+
fromParts.pop();
|
601 |
+
fromParts = fromParts.concat(toParts);
|
602 |
+
}
|
603 |
|
604 |
+
if (!fromParts.length) return '/';
|
|
|
|
|
605 |
|
606 |
+
var hasTrailingSlash;
|
607 |
+
if (fromParts.length) {
|
608 |
+
var last = fromParts[fromParts.length - 1];
|
609 |
+
hasTrailingSlash = last === '.' || last === '..' || last === '';
|
610 |
+
} else {
|
611 |
+
hasTrailingSlash = false;
|
612 |
+
}
|
613 |
|
614 |
+
var up = 0;
|
615 |
+
for (var i = fromParts.length; i >= 0; i--) {
|
616 |
+
var part = fromParts[i];
|
|
|
617 |
|
618 |
+
if (part === '.') {
|
619 |
+
spliceOne(fromParts, i);
|
620 |
+
} else if (part === '..') {
|
621 |
+
spliceOne(fromParts, i);
|
622 |
+
up++;
|
623 |
+
} else if (up) {
|
624 |
+
spliceOne(fromParts, i);
|
625 |
+
up--;
|
626 |
+
}
|
627 |
+
}
|
628 |
|
629 |
+
if (!mustEndAbs) for (; up--; up) fromParts.unshift('..');
|
630 |
|
631 |
+
if (
|
632 |
+
mustEndAbs &&
|
633 |
+
fromParts[0] !== '' &&
|
634 |
+
(!fromParts[0] || !isAbsolute(fromParts[0]))
|
635 |
+
)
|
636 |
+
fromParts.unshift('');
|
637 |
|
638 |
+
var result = fromParts.join('/');
|
|
|
639 |
|
640 |
+
if (hasTrailingSlash && result.substr(-1) !== '/') result += '/';
|
641 |
|
642 |
+
return result;
|
643 |
+
}
|
644 |
|
645 |
+
/* harmony default export */ var resolve_pathname = (resolvePathname);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
646 |
|
647 |
+
// CONCATENATED MODULE: ./node_modules/value-equal/esm/value-equal.js
|
648 |
+
function value_equal_valueOf(obj) {
|
649 |
+
return obj.valueOf ? obj.valueOf() : Object.prototype.valueOf.call(obj);
|
|
|
650 |
}
|
651 |
|
652 |
+
function valueEqual(a, b) {
|
653 |
+
// Test for strict equality first.
|
654 |
+
if (a === b) return true;
|
|
|
|
|
|
|
655 |
|
656 |
+
// Otherwise, if either of them == null they are not equal.
|
657 |
+
if (a == null || b == null) return false;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
658 |
|
659 |
+
if (Array.isArray(a)) {
|
660 |
+
return (
|
661 |
+
Array.isArray(b) &&
|
662 |
+
a.length === b.length &&
|
663 |
+
a.every(function(item, index) {
|
664 |
+
return valueEqual(item, b[index]);
|
665 |
+
})
|
666 |
+
);
|
667 |
+
}
|
668 |
|
669 |
+
if (typeof a === 'object' || typeof b === 'object') {
|
670 |
+
var aValue = value_equal_valueOf(a);
|
671 |
+
var bValue = value_equal_valueOf(b);
|
672 |
|
673 |
+
if (aValue !== a || bValue !== b) return valueEqual(aValue, bValue);
|
|
|
674 |
|
675 |
+
return Object.keys(Object.assign({}, a, b)).every(function(key) {
|
676 |
+
return valueEqual(a[key], b[key]);
|
677 |
+
});
|
|
|
|
|
|
|
|
|
|
|
|
|
678 |
}
|
679 |
|
680 |
+
return false;
|
681 |
}
|
682 |
|
683 |
+
/* harmony default export */ var value_equal = (valueEqual);
|
684 |
|
685 |
+
// EXTERNAL MODULE: ./node_modules/tiny-invariant/dist/tiny-invariant.esm.js
|
686 |
+
var tiny_invariant_esm = __webpack_require__(81);
|
687 |
|
688 |
+
// CONCATENATED MODULE: ./node_modules/history/esm/history.js
|
689 |
|
|
|
690 |
|
|
|
|
|
691 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
692 |
|
693 |
|
694 |
|
695 |
+
function addLeadingSlash(path) {
|
696 |
+
return path.charAt(0) === '/' ? path : '/' + path;
|
697 |
+
}
|
698 |
+
function stripLeadingSlash(path) {
|
699 |
+
return path.charAt(0) === '/' ? path.substr(1) : path;
|
700 |
+
}
|
701 |
+
function hasBasename(path, prefix) {
|
702 |
+
return path.toLowerCase().indexOf(prefix.toLowerCase()) === 0 && '/?#'.indexOf(path.charAt(prefix.length)) !== -1;
|
703 |
+
}
|
704 |
+
function stripBasename(path, prefix) {
|
705 |
+
return hasBasename(path, prefix) ? path.substr(prefix.length) : path;
|
706 |
+
}
|
707 |
+
function stripTrailingSlash(path) {
|
708 |
+
return path.charAt(path.length - 1) === '/' ? path.slice(0, -1) : path;
|
709 |
+
}
|
710 |
+
function parsePath(path) {
|
711 |
+
var pathname = path || '/';
|
712 |
+
var search = '';
|
713 |
+
var hash = '';
|
714 |
+
var hashIndex = pathname.indexOf('#');
|
715 |
|
716 |
+
if (hashIndex !== -1) {
|
717 |
+
hash = pathname.substr(hashIndex);
|
718 |
+
pathname = pathname.substr(0, hashIndex);
|
719 |
+
}
|
720 |
|
721 |
+
var searchIndex = pathname.indexOf('?');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
722 |
|
723 |
+
if (searchIndex !== -1) {
|
724 |
+
search = pathname.substr(searchIndex);
|
725 |
+
pathname = pathname.substr(0, searchIndex);
|
726 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
727 |
|
728 |
+
return {
|
729 |
+
pathname: pathname,
|
730 |
+
search: search === '?' ? '' : search,
|
731 |
+
hash: hash === '#' ? '' : hash
|
732 |
};
|
733 |
+
}
|
734 |
+
function createPath(location) {
|
735 |
+
var pathname = location.pathname,
|
736 |
+
search = location.search,
|
737 |
+
hash = location.hash;
|
738 |
+
var path = pathname || '/';
|
739 |
+
if (search && search !== '?') path += search.charAt(0) === '?' ? search : "?" + search;
|
740 |
+
if (hash && hash !== '#') path += hash.charAt(0) === '#' ? hash : "#" + hash;
|
741 |
+
return path;
|
742 |
+
}
|
743 |
|
744 |
+
function createLocation(path, state, key, currentLocation) {
|
745 |
+
var location;
|
|
|
|
|
746 |
|
747 |
+
if (typeof path === 'string') {
|
748 |
+
// Two-arg form: push(path, state)
|
749 |
+
location = parsePath(path);
|
750 |
+
location.state = state;
|
751 |
+
} else {
|
752 |
+
// One-arg form: push(location)
|
753 |
+
location = Object(esm_extends["a" /* default */])({}, path);
|
754 |
+
if (location.pathname === undefined) location.pathname = '';
|
755 |
|
756 |
+
if (location.search) {
|
757 |
+
if (location.search.charAt(0) !== '?') location.search = '?' + location.search;
|
758 |
+
} else {
|
759 |
+
location.search = '';
|
760 |
+
}
|
761 |
|
762 |
+
if (location.hash) {
|
763 |
+
if (location.hash.charAt(0) !== '#') location.hash = '#' + location.hash;
|
764 |
+
} else {
|
765 |
+
location.hash = '';
|
766 |
+
}
|
767 |
|
768 |
+
if (state !== undefined && location.state === undefined) location.state = state;
|
769 |
+
}
|
|
|
|
|
|
|
|
|
|
|
770 |
|
771 |
+
try {
|
772 |
+
location.pathname = decodeURI(location.pathname);
|
773 |
+
} catch (e) {
|
774 |
+
if (e instanceof URIError) {
|
775 |
+
throw new URIError('Pathname "' + location.pathname + '" could not be decoded. ' + 'This is likely caused by an invalid percent-encoding.');
|
776 |
+
} else {
|
777 |
+
throw e;
|
778 |
+
}
|
779 |
+
}
|
780 |
|
781 |
+
if (key) location.key = key;
|
782 |
|
783 |
+
if (currentLocation) {
|
784 |
+
// Resolve incomplete/relative pathname relative to current location.
|
785 |
+
if (!location.pathname) {
|
786 |
+
location.pathname = currentLocation.pathname;
|
787 |
+
} else if (location.pathname.charAt(0) !== '/') {
|
788 |
+
location.pathname = resolve_pathname(location.pathname, currentLocation.pathname);
|
789 |
+
}
|
790 |
+
} else {
|
791 |
+
// When there is no prior location and pathname is empty, set it to /
|
792 |
+
if (!location.pathname) {
|
793 |
+
location.pathname = '/';
|
794 |
+
}
|
795 |
+
}
|
796 |
|
797 |
+
return location;
|
798 |
+
}
|
799 |
+
function locationsAreEqual(a, b) {
|
800 |
+
return a.pathname === b.pathname && a.search === b.search && a.hash === b.hash && a.key === b.key && value_equal(a.state, b.state);
|
801 |
+
}
|
802 |
|
803 |
+
function createTransitionManager() {
|
804 |
+
var prompt = null;
|
805 |
|
806 |
+
function setPrompt(nextPrompt) {
|
807 |
+
false ? undefined : void 0;
|
808 |
+
prompt = nextPrompt;
|
809 |
+
return function () {
|
810 |
+
if (prompt === nextPrompt) prompt = null;
|
811 |
+
};
|
812 |
+
}
|
813 |
|
814 |
+
function confirmTransitionTo(location, action, getUserConfirmation, callback) {
|
815 |
+
// TODO: If another transition starts while we're still confirming
|
816 |
+
// the previous one, we may end up in a weird state. Figure out the
|
817 |
+
// best way to handle this.
|
818 |
+
if (prompt != null) {
|
819 |
+
var result = typeof prompt === 'function' ? prompt(location, action) : prompt;
|
820 |
|
821 |
+
if (typeof result === 'string') {
|
822 |
+
if (typeof getUserConfirmation === 'function') {
|
823 |
+
getUserConfirmation(result, callback);
|
824 |
+
} else {
|
825 |
+
false ? undefined : void 0;
|
826 |
+
callback(true);
|
827 |
+
}
|
828 |
+
} else {
|
829 |
+
// Return false from a transition hook to cancel the transition.
|
830 |
+
callback(result !== false);
|
831 |
+
}
|
832 |
+
} else {
|
833 |
+
callback(true);
|
834 |
+
}
|
835 |
+
}
|
836 |
|
837 |
+
var listeners = [];
|
838 |
|
839 |
+
function appendListener(fn) {
|
840 |
+
var isActive = true;
|
|
|
841 |
|
842 |
+
function listener() {
|
843 |
+
if (isActive) fn.apply(void 0, arguments);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
844 |
}
|
|
|
845 |
|
846 |
+
listeners.push(listener);
|
847 |
+
return function () {
|
848 |
+
isActive = false;
|
849 |
+
listeners = listeners.filter(function (item) {
|
850 |
+
return item !== listener;
|
851 |
+
});
|
852 |
+
};
|
853 |
+
}
|
854 |
|
855 |
+
function notifyListeners() {
|
856 |
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
857 |
+
args[_key] = arguments[_key];
|
858 |
+
}
|
859 |
|
860 |
+
listeners.forEach(function (listener) {
|
861 |
+
return listener.apply(void 0, args);
|
862 |
+
});
|
863 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
864 |
|
865 |
+
return {
|
866 |
+
setPrompt: setPrompt,
|
867 |
+
confirmTransitionTo: confirmTransitionTo,
|
868 |
+
appendListener: appendListener,
|
869 |
+
notifyListeners: notifyListeners
|
870 |
+
};
|
871 |
+
}
|
872 |
|
873 |
+
var canUseDOM = !!(typeof window !== 'undefined' && window.document && window.document.createElement);
|
874 |
+
function getConfirmation(message, callback) {
|
875 |
+
callback(window.confirm(message)); // eslint-disable-line no-alert
|
876 |
+
}
|
877 |
+
/**
|
878 |
+
* Returns true if the HTML5 history API is supported. Taken from Modernizr.
|
879 |
+
*
|
880 |
+
* https://github.com/Modernizr/Modernizr/blob/master/LICENSE
|
881 |
+
* https://github.com/Modernizr/Modernizr/blob/master/feature-detects/history.js
|
882 |
+
* changed to avoid false negatives for Windows Phones: https://github.com/reactjs/react-router/issues/586
|
883 |
+
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
884 |
|
885 |
+
function supportsHistory() {
|
886 |
+
var ua = window.navigator.userAgent;
|
887 |
+
if ((ua.indexOf('Android 2.') !== -1 || ua.indexOf('Android 4.0') !== -1) && ua.indexOf('Mobile Safari') !== -1 && ua.indexOf('Chrome') === -1 && ua.indexOf('Windows Phone') === -1) return false;
|
888 |
+
return window.history && 'pushState' in window.history;
|
889 |
+
}
|
890 |
+
/**
|
891 |
+
* Returns true if browser fires popstate on hash change.
|
892 |
+
* IE10 and IE11 do not.
|
893 |
+
*/
|
894 |
|
895 |
+
function supportsPopStateOnHashChange() {
|
896 |
+
return window.navigator.userAgent.indexOf('Trident') === -1;
|
897 |
+
}
|
898 |
+
/**
|
899 |
+
* Returns false if using go(n) with hash history causes a full page reload.
|
900 |
+
*/
|
901 |
|
902 |
+
function supportsGoWithoutReloadUsingHash() {
|
903 |
+
return window.navigator.userAgent.indexOf('Firefox') === -1;
|
904 |
+
}
|
905 |
+
/**
|
906 |
+
* Returns true if a given popstate event is an extraneous WebKit event.
|
907 |
+
* Accounts for the fact that Chrome on iOS fires real popstate events
|
908 |
+
* containing undefined state when pressing the back button.
|
909 |
+
*/
|
910 |
|
911 |
+
function isExtraneousPopstateEvent(event) {
|
912 |
+
return event.state === undefined && navigator.userAgent.indexOf('CriOS') === -1;
|
913 |
+
}
|
914 |
|
915 |
+
var PopStateEvent = 'popstate';
|
916 |
+
var HashChangeEvent = 'hashchange';
|
|
|
917 |
|
918 |
+
function getHistoryState() {
|
919 |
+
try {
|
920 |
+
return window.history.state || {};
|
921 |
+
} catch (e) {
|
922 |
+
// IE 11 sometimes throws when accessing window.history.state
|
923 |
+
// See https://github.com/ReactTraining/history/pull/289
|
924 |
+
return {};
|
925 |
+
}
|
926 |
+
}
|
927 |
+
/**
|
928 |
+
* Creates a history object that uses the HTML5 history API including
|
929 |
+
* pushState, replaceState, and the popstate event.
|
930 |
+
*/
|
931 |
|
|
|
|
|
932 |
|
933 |
+
function createBrowserHistory(props) {
|
934 |
+
if (props === void 0) {
|
935 |
+
props = {};
|
936 |
+
}
|
937 |
|
938 |
+
!canUseDOM ? false ? undefined : Object(tiny_invariant_esm["a" /* default */])(false) : void 0;
|
939 |
+
var globalHistory = window.history;
|
940 |
+
var canUseHistory = supportsHistory();
|
941 |
+
var needsHashChangeListener = !supportsPopStateOnHashChange();
|
942 |
+
var _props = props,
|
943 |
+
_props$forceRefresh = _props.forceRefresh,
|
944 |
+
forceRefresh = _props$forceRefresh === void 0 ? false : _props$forceRefresh,
|
945 |
+
_props$getUserConfirm = _props.getUserConfirmation,
|
946 |
+
getUserConfirmation = _props$getUserConfirm === void 0 ? getConfirmation : _props$getUserConfirm,
|
947 |
+
_props$keyLength = _props.keyLength,
|
948 |
+
keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;
|
949 |
+
var basename = props.basename ? stripTrailingSlash(addLeadingSlash(props.basename)) : '';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
950 |
|
951 |
+
function getDOMLocation(historyState) {
|
952 |
+
var _ref = historyState || {},
|
953 |
+
key = _ref.key,
|
954 |
+
state = _ref.state;
|
955 |
|
956 |
+
var _window$location = window.location,
|
957 |
+
pathname = _window$location.pathname,
|
958 |
+
search = _window$location.search,
|
959 |
+
hash = _window$location.hash;
|
960 |
+
var path = pathname + search + hash;
|
961 |
+
false ? undefined : void 0;
|
962 |
+
if (basename) path = stripBasename(path, basename);
|
963 |
+
return createLocation(path, state, key);
|
964 |
+
}
|
965 |
|
966 |
+
function createKey() {
|
967 |
+
return Math.random().toString(36).substr(2, keyLength);
|
968 |
+
}
|
969 |
|
970 |
+
var transitionManager = createTransitionManager();
|
|
|
|
|
|
|
971 |
|
972 |
+
function setState(nextState) {
|
973 |
+
Object(esm_extends["a" /* default */])(history, nextState);
|
|
|
|
|
|
|
|
|
|
|
|
|
974 |
|
975 |
+
history.length = globalHistory.length;
|
976 |
+
transitionManager.notifyListeners(history.location, history.action);
|
977 |
+
}
|
|
|
978 |
|
979 |
+
function handlePopState(event) {
|
980 |
+
// Ignore extraneous popstate events in WebKit.
|
981 |
+
if (isExtraneousPopstateEvent(event)) return;
|
982 |
+
handlePop(getDOMLocation(event.state));
|
983 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
984 |
|
985 |
+
function handleHashChange() {
|
986 |
+
handlePop(getDOMLocation(getHistoryState()));
|
987 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
988 |
|
989 |
+
var forceNextPop = false;
|
|
|
|
|
990 |
|
991 |
+
function handlePop(location) {
|
992 |
+
if (forceNextPop) {
|
993 |
+
forceNextPop = false;
|
994 |
+
setState();
|
|
|
995 |
} else {
|
996 |
+
var action = 'POP';
|
997 |
+
transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {
|
998 |
+
if (ok) {
|
999 |
+
setState({
|
1000 |
+
action: action,
|
1001 |
+
location: location
|
1002 |
+
});
|
1003 |
+
} else {
|
1004 |
+
revertPop(location);
|
1005 |
+
}
|
1006 |
+
});
|
1007 |
}
|
1008 |
+
}
|
1009 |
|
1010 |
+
function revertPop(fromLocation) {
|
1011 |
+
var toLocation = history.location; // TODO: We could probably make this more reliable by
|
1012 |
+
// keeping a list of keys we've seen in sessionStorage.
|
1013 |
+
// Instead, we just default to 0 for keys we don't know.
|
1014 |
|
1015 |
+
var toIndex = allKeys.indexOf(toLocation.key);
|
1016 |
+
if (toIndex === -1) toIndex = 0;
|
1017 |
+
var fromIndex = allKeys.indexOf(fromLocation.key);
|
1018 |
+
if (fromIndex === -1) fromIndex = 0;
|
1019 |
+
var delta = toIndex - fromIndex;
|
1020 |
|
1021 |
+
if (delta) {
|
1022 |
+
forceNextPop = true;
|
1023 |
+
go(delta);
|
1024 |
}
|
1025 |
+
}
|
1026 |
|
1027 |
+
var initialLocation = getDOMLocation(getHistoryState());
|
1028 |
+
var allKeys = [initialLocation.key]; // Public interface
|
1029 |
|
1030 |
+
function createHref(location) {
|
1031 |
+
return basename + createPath(location);
|
1032 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1033 |
|
1034 |
+
function push(path, state) {
|
1035 |
+
false ? undefined : void 0;
|
1036 |
+
var action = 'PUSH';
|
1037 |
+
var location = createLocation(path, state, createKey(), history.location);
|
1038 |
+
transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {
|
1039 |
+
if (!ok) return;
|
1040 |
+
var href = createHref(location);
|
1041 |
+
var key = location.key,
|
1042 |
+
state = location.state;
|
1043 |
|
1044 |
+
if (canUseHistory) {
|
1045 |
+
globalHistory.pushState({
|
1046 |
+
key: key,
|
1047 |
+
state: state
|
1048 |
+
}, null, href);
|
1049 |
+
|
1050 |
+
if (forceRefresh) {
|
1051 |
+
window.location.href = href;
|
1052 |
} else {
|
1053 |
+
var prevIndex = allKeys.indexOf(history.location.key);
|
1054 |
+
var nextKeys = allKeys.slice(0, prevIndex + 1);
|
1055 |
+
nextKeys.push(location.key);
|
1056 |
+
allKeys = nextKeys;
|
1057 |
+
setState({
|
1058 |
+
action: action,
|
1059 |
+
location: location
|
1060 |
+
});
|
1061 |
}
|
1062 |
+
} else {
|
1063 |
+
false ? undefined : void 0;
|
1064 |
+
window.location.href = href;
|
1065 |
+
}
|
1066 |
+
});
|
1067 |
+
}
|
1068 |
|
1069 |
+
function replace(path, state) {
|
1070 |
+
false ? undefined : void 0;
|
1071 |
+
var action = 'REPLACE';
|
1072 |
+
var location = createLocation(path, state, createKey(), history.location);
|
1073 |
+
transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {
|
1074 |
+
if (!ok) return;
|
1075 |
+
var href = createHref(location);
|
1076 |
+
var key = location.key,
|
1077 |
+
state = location.state;
|
1078 |
|
1079 |
+
if (canUseHistory) {
|
1080 |
+
globalHistory.replaceState({
|
1081 |
+
key: key,
|
1082 |
+
state: state
|
1083 |
+
}, null, href);
|
1084 |
|
1085 |
+
if (forceRefresh) {
|
1086 |
+
window.location.replace(href);
|
1087 |
+
} else {
|
1088 |
+
var prevIndex = allKeys.indexOf(history.location.key);
|
1089 |
+
if (prevIndex !== -1) allKeys[prevIndex] = location.key;
|
1090 |
+
setState({
|
1091 |
+
action: action,
|
1092 |
+
location: location
|
1093 |
+
});
|
1094 |
+
}
|
1095 |
+
} else {
|
1096 |
+
false ? undefined : void 0;
|
1097 |
+
window.location.replace(href);
|
1098 |
+
}
|
1099 |
+
});
|
1100 |
+
}
|
1101 |
|
1102 |
+
function go(n) {
|
1103 |
+
globalHistory.go(n);
|
1104 |
+
}
|
1105 |
|
1106 |
+
function goBack() {
|
1107 |
+
go(-1);
|
1108 |
+
}
|
1109 |
|
1110 |
+
function goForward() {
|
1111 |
+
go(1);
|
1112 |
+
}
|
1113 |
|
1114 |
+
var listenerCount = 0;
|
1115 |
|
1116 |
+
function checkDOMListeners(delta) {
|
1117 |
+
listenerCount += delta;
|
1118 |
|
1119 |
+
if (listenerCount === 1 && delta === 1) {
|
1120 |
+
window.addEventListener(PopStateEvent, handlePopState);
|
1121 |
+
if (needsHashChangeListener) window.addEventListener(HashChangeEvent, handleHashChange);
|
1122 |
+
} else if (listenerCount === 0) {
|
1123 |
+
window.removeEventListener(PopStateEvent, handlePopState);
|
1124 |
+
if (needsHashChangeListener) window.removeEventListener(HashChangeEvent, handleHashChange);
|
1125 |
+
}
|
1126 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1127 |
|
1128 |
+
var isBlocked = false;
|
|
|
|
|
|
|
|
|
1129 |
|
1130 |
+
function block(prompt) {
|
1131 |
+
if (prompt === void 0) {
|
1132 |
+
prompt = false;
|
1133 |
}
|
1134 |
|
1135 |
+
var unblock = transitionManager.setPrompt(prompt);
|
|
|
1136 |
|
1137 |
+
if (!isBlocked) {
|
1138 |
+
checkDOMListeners(1);
|
1139 |
+
isBlocked = true;
|
|
|
|
|
|
|
|
|
1140 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1141 |
|
1142 |
+
return function () {
|
1143 |
+
if (isBlocked) {
|
1144 |
+
isBlocked = false;
|
1145 |
+
checkDOMListeners(-1);
|
1146 |
+
}
|
1147 |
|
1148 |
+
return unblock();
|
1149 |
+
};
|
1150 |
+
}
|
|
|
|
|
|
|
|
|
1151 |
|
1152 |
+
function listen(listener) {
|
1153 |
+
var unlisten = transitionManager.appendListener(listener);
|
1154 |
+
checkDOMListeners(1);
|
1155 |
+
return function () {
|
1156 |
+
checkDOMListeners(-1);
|
1157 |
+
unlisten();
|
1158 |
+
};
|
1159 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1160 |
|
1161 |
+
var history = {
|
1162 |
+
length: globalHistory.length,
|
1163 |
+
action: 'POP',
|
1164 |
+
location: initialLocation,
|
1165 |
+
createHref: createHref,
|
1166 |
+
push: push,
|
1167 |
+
replace: replace,
|
1168 |
+
go: go,
|
1169 |
+
goBack: goBack,
|
1170 |
+
goForward: goForward,
|
1171 |
+
block: block,
|
1172 |
+
listen: listen
|
1173 |
+
};
|
1174 |
+
return history;
|
1175 |
+
}
|
1176 |
|
1177 |
+
var HashChangeEvent$1 = 'hashchange';
|
1178 |
+
var HashPathCoders = {
|
1179 |
+
hashbang: {
|
1180 |
+
encodePath: function encodePath(path) {
|
1181 |
+
return path.charAt(0) === '!' ? path : '!/' + stripLeadingSlash(path);
|
1182 |
+
},
|
1183 |
+
decodePath: function decodePath(path) {
|
1184 |
+
return path.charAt(0) === '!' ? path.substr(1) : path;
|
1185 |
}
|
1186 |
+
},
|
1187 |
+
noslash: {
|
1188 |
+
encodePath: stripLeadingSlash,
|
1189 |
+
decodePath: addLeadingSlash
|
1190 |
+
},
|
1191 |
+
slash: {
|
1192 |
+
encodePath: addLeadingSlash,
|
1193 |
+
decodePath: addLeadingSlash
|
1194 |
+
}
|
1195 |
};
|
1196 |
|
1197 |
+
function stripHash(url) {
|
1198 |
+
var hashIndex = url.indexOf('#');
|
1199 |
+
return hashIndex === -1 ? url : url.slice(0, hashIndex);
|
1200 |
+
}
|
1201 |
|
1202 |
+
function getHashPath() {
|
1203 |
+
// We can't use window.location.hash here because it's not
|
1204 |
+
// consistent across browsers - Firefox will pre-decode it!
|
1205 |
+
var href = window.location.href;
|
1206 |
+
var hashIndex = href.indexOf('#');
|
1207 |
+
return hashIndex === -1 ? '' : href.substring(hashIndex + 1);
|
1208 |
+
}
|
1209 |
|
1210 |
+
function pushHashPath(path) {
|
1211 |
+
window.location.hash = path;
|
1212 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1213 |
|
1214 |
+
function replaceHashPath(path) {
|
1215 |
+
window.location.replace(stripHash(window.location.href) + '#' + path);
|
1216 |
+
}
|
1217 |
|
1218 |
+
function createHashHistory(props) {
|
1219 |
+
if (props === void 0) {
|
1220 |
+
props = {};
|
1221 |
+
}
|
1222 |
|
1223 |
+
!canUseDOM ? false ? undefined : Object(tiny_invariant_esm["a" /* default */])(false) : void 0;
|
1224 |
+
var globalHistory = window.history;
|
1225 |
+
var canGoWithoutReload = supportsGoWithoutReloadUsingHash();
|
1226 |
+
var _props = props,
|
1227 |
+
_props$getUserConfirm = _props.getUserConfirmation,
|
1228 |
+
getUserConfirmation = _props$getUserConfirm === void 0 ? getConfirmation : _props$getUserConfirm,
|
1229 |
+
_props$hashType = _props.hashType,
|
1230 |
+
hashType = _props$hashType === void 0 ? 'slash' : _props$hashType;
|
1231 |
+
var basename = props.basename ? stripTrailingSlash(addLeadingSlash(props.basename)) : '';
|
1232 |
+
var _HashPathCoders$hashT = HashPathCoders[hashType],
|
1233 |
+
encodePath = _HashPathCoders$hashT.encodePath,
|
1234 |
+
decodePath = _HashPathCoders$hashT.decodePath;
|
1235 |
|
1236 |
+
function getDOMLocation() {
|
1237 |
+
var path = decodePath(getHashPath());
|
1238 |
+
false ? undefined : void 0;
|
1239 |
+
if (basename) path = stripBasename(path, basename);
|
1240 |
+
return createLocation(path);
|
1241 |
+
}
|
1242 |
|
1243 |
+
var transitionManager = createTransitionManager();
|
1244 |
|
1245 |
+
function setState(nextState) {
|
1246 |
+
Object(esm_extends["a" /* default */])(history, nextState);
|
1247 |
|
1248 |
+
history.length = globalHistory.length;
|
1249 |
+
transitionManager.notifyListeners(history.location, history.action);
|
1250 |
+
}
|
1251 |
|
1252 |
+
var forceNextPop = false;
|
1253 |
+
var ignorePath = null;
|
1254 |
|
1255 |
+
function locationsAreEqual$$1(a, b) {
|
1256 |
+
return a.pathname === b.pathname && a.search === b.search && a.hash === b.hash;
|
1257 |
+
}
|
1258 |
|
1259 |
+
function handleHashChange() {
|
1260 |
+
var path = getHashPath();
|
1261 |
+
var encodedPath = encodePath(path);
|
|
|
|
|
|
|
|
|
|
|
1262 |
|
1263 |
+
if (path !== encodedPath) {
|
1264 |
+
// Ensure we always have a properly-encoded hash.
|
1265 |
+
replaceHashPath(encodedPath);
|
1266 |
+
} else {
|
1267 |
+
var location = getDOMLocation();
|
1268 |
+
var prevLocation = history.location;
|
1269 |
+
if (!forceNextPop && locationsAreEqual$$1(prevLocation, location)) return; // A hashchange doesn't always == location change.
|
1270 |
|
1271 |
+
if (ignorePath === createPath(location)) return; // Ignore this change; we already setState in push/replace.
|
1272 |
|
1273 |
+
ignorePath = null;
|
1274 |
+
handlePop(location);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1275 |
}
|
1276 |
+
}
|
1277 |
|
1278 |
+
function handlePop(location) {
|
1279 |
+
if (forceNextPop) {
|
1280 |
+
forceNextPop = false;
|
1281 |
+
setState();
|
1282 |
+
} else {
|
1283 |
+
var action = 'POP';
|
1284 |
+
transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {
|
1285 |
+
if (ok) {
|
1286 |
+
setState({
|
1287 |
+
action: action,
|
1288 |
+
location: location
|
1289 |
+
});
|
1290 |
+
} else {
|
1291 |
+
revertPop(location);
|
1292 |
+
}
|
1293 |
+
});
|
1294 |
}
|
1295 |
+
}
|
1296 |
|
1297 |
+
function revertPop(fromLocation) {
|
1298 |
+
var toLocation = history.location; // TODO: We could probably make this more reliable by
|
1299 |
+
// keeping a list of paths we've seen in sessionStorage.
|
1300 |
+
// Instead, we just default to 0 for paths we don't know.
|
1301 |
|
1302 |
+
var toIndex = allPaths.lastIndexOf(createPath(toLocation));
|
1303 |
+
if (toIndex === -1) toIndex = 0;
|
1304 |
+
var fromIndex = allPaths.lastIndexOf(createPath(fromLocation));
|
1305 |
+
if (fromIndex === -1) fromIndex = 0;
|
1306 |
+
var delta = toIndex - fromIndex;
|
1307 |
+
|
1308 |
+
if (delta) {
|
1309 |
+
forceNextPop = true;
|
1310 |
+
go(delta);
|
1311 |
}
|
1312 |
+
} // Ensure the hash is encoded properly before doing anything else.
|
1313 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1314 |
|
1315 |
+
var path = getHashPath();
|
1316 |
+
var encodedPath = encodePath(path);
|
1317 |
+
if (path !== encodedPath) replaceHashPath(encodedPath);
|
1318 |
+
var initialLocation = getDOMLocation();
|
1319 |
+
var allPaths = [createPath(initialLocation)]; // Public interface
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1320 |
|
1321 |
+
function createHref(location) {
|
1322 |
+
var baseTag = document.querySelector('base');
|
1323 |
+
var href = '';
|
1324 |
|
1325 |
+
if (baseTag && baseTag.getAttribute('href')) {
|
1326 |
+
href = stripHash(window.location.href);
|
1327 |
}
|
1328 |
|
1329 |
+
return href + '#' + encodePath(basename + createPath(location));
|
1330 |
+
}
|
1331 |
|
1332 |
+
function push(path, state) {
|
1333 |
+
false ? undefined : void 0;
|
1334 |
+
var action = 'PUSH';
|
1335 |
+
var location = createLocation(path, undefined, undefined, history.location);
|
1336 |
+
transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {
|
1337 |
+
if (!ok) return;
|
1338 |
+
var path = createPath(location);
|
1339 |
+
var encodedPath = encodePath(basename + path);
|
1340 |
+
var hashChanged = getHashPath() !== encodedPath;
|
1341 |
|
1342 |
+
if (hashChanged) {
|
1343 |
+
// We cannot tell if a hashchange was caused by a PUSH, so we'd
|
1344 |
+
// rather setState here and ignore the hashchange. The caveat here
|
1345 |
+
// is that other hash histories in the page will consider it a POP.
|
1346 |
+
ignorePath = path;
|
1347 |
+
pushHashPath(encodedPath);
|
1348 |
+
var prevIndex = allPaths.lastIndexOf(createPath(history.location));
|
1349 |
+
var nextPaths = allPaths.slice(0, prevIndex + 1);
|
1350 |
+
nextPaths.push(path);
|
1351 |
+
allPaths = nextPaths;
|
1352 |
+
setState({
|
1353 |
+
action: action,
|
1354 |
+
location: location
|
1355 |
+
});
|
1356 |
+
} else {
|
1357 |
+
false ? undefined : void 0;
|
1358 |
+
setState();
|
1359 |
+
}
|
1360 |
+
});
|
1361 |
+
}
|
1362 |
|
1363 |
+
function replace(path, state) {
|
1364 |
+
false ? undefined : void 0;
|
1365 |
+
var action = 'REPLACE';
|
1366 |
+
var location = createLocation(path, undefined, undefined, history.location);
|
1367 |
+
transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {
|
1368 |
+
if (!ok) return;
|
1369 |
+
var path = createPath(location);
|
1370 |
+
var encodedPath = encodePath(basename + path);
|
1371 |
+
var hashChanged = getHashPath() !== encodedPath;
|
1372 |
|
1373 |
+
if (hashChanged) {
|
1374 |
+
// We cannot tell if a hashchange was caused by a REPLACE, so we'd
|
1375 |
+
// rather setState here and ignore the hashchange. The caveat here
|
1376 |
+
// is that other hash histories in the page will consider it a POP.
|
1377 |
+
ignorePath = path;
|
1378 |
+
replaceHashPath(encodedPath);
|
1379 |
+
}
|
1380 |
|
1381 |
+
var prevIndex = allPaths.indexOf(createPath(history.location));
|
1382 |
+
if (prevIndex !== -1) allPaths[prevIndex] = path;
|
1383 |
+
setState({
|
1384 |
+
action: action,
|
1385 |
+
location: location
|
1386 |
+
});
|
1387 |
+
});
|
1388 |
+
}
|
1389 |
|
1390 |
+
function go(n) {
|
1391 |
+
false ? undefined : void 0;
|
1392 |
+
globalHistory.go(n);
|
1393 |
+
}
|
1394 |
|
1395 |
+
function goBack() {
|
1396 |
+
go(-1);
|
1397 |
+
}
|
1398 |
|
1399 |
+
function goForward() {
|
1400 |
+
go(1);
|
1401 |
+
}
|
1402 |
|
1403 |
+
var listenerCount = 0;
|
1404 |
|
1405 |
+
function checkDOMListeners(delta) {
|
1406 |
+
listenerCount += delta;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1407 |
|
1408 |
+
if (listenerCount === 1 && delta === 1) {
|
1409 |
+
window.addEventListener(HashChangeEvent$1, handleHashChange);
|
1410 |
+
} else if (listenerCount === 0) {
|
1411 |
+
window.removeEventListener(HashChangeEvent$1, handleHashChange);
|
1412 |
+
}
|
1413 |
+
}
|
1414 |
|
1415 |
+
var isBlocked = false;
|
|
|
1416 |
|
1417 |
+
function block(prompt) {
|
1418 |
+
if (prompt === void 0) {
|
1419 |
+
prompt = false;
|
1420 |
+
}
|
1421 |
|
1422 |
+
var unblock = transitionManager.setPrompt(prompt);
|
1423 |
|
1424 |
+
if (!isBlocked) {
|
1425 |
+
checkDOMListeners(1);
|
1426 |
+
isBlocked = true;
|
1427 |
+
}
|
1428 |
|
1429 |
+
return function () {
|
1430 |
+
if (isBlocked) {
|
1431 |
+
isBlocked = false;
|
1432 |
+
checkDOMListeners(-1);
|
1433 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
1434 |
|
1435 |
+
return unblock();
|
1436 |
+
};
|
1437 |
+
}
|
1438 |
|
1439 |
+
function listen(listener) {
|
1440 |
+
var unlisten = transitionManager.appendListener(listener);
|
1441 |
+
checkDOMListeners(1);
|
1442 |
+
return function () {
|
1443 |
+
checkDOMListeners(-1);
|
1444 |
+
unlisten();
|
1445 |
+
};
|
1446 |
+
}
|
1447 |
|
1448 |
+
var history = {
|
1449 |
+
length: globalHistory.length,
|
1450 |
+
action: 'POP',
|
1451 |
+
location: initialLocation,
|
1452 |
+
createHref: createHref,
|
1453 |
+
push: push,
|
1454 |
+
replace: replace,
|
1455 |
+
go: go,
|
1456 |
+
goBack: goBack,
|
1457 |
+
goForward: goForward,
|
1458 |
+
block: block,
|
1459 |
+
listen: listen
|
1460 |
+
};
|
1461 |
+
return history;
|
1462 |
+
}
|
1463 |
|
1464 |
+
function clamp(n, lowerBound, upperBound) {
|
1465 |
+
return Math.min(Math.max(n, lowerBound), upperBound);
|
1466 |
+
}
|
1467 |
+
/**
|
1468 |
+
* Creates a history object that stores locations in memory.
|
1469 |
+
*/
|
1470 |
|
|
|
1471 |
|
1472 |
+
function createMemoryHistory(props) {
|
1473 |
+
if (props === void 0) {
|
1474 |
+
props = {};
|
1475 |
+
}
|
1476 |
|
1477 |
+
var _props = props,
|
1478 |
+
getUserConfirmation = _props.getUserConfirmation,
|
1479 |
+
_props$initialEntries = _props.initialEntries,
|
1480 |
+
initialEntries = _props$initialEntries === void 0 ? ['/'] : _props$initialEntries,
|
1481 |
+
_props$initialIndex = _props.initialIndex,
|
1482 |
+
initialIndex = _props$initialIndex === void 0 ? 0 : _props$initialIndex,
|
1483 |
+
_props$keyLength = _props.keyLength,
|
1484 |
+
keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;
|
1485 |
+
var transitionManager = createTransitionManager();
|
1486 |
|
1487 |
+
function setState(nextState) {
|
1488 |
+
Object(esm_extends["a" /* default */])(history, nextState);
|
1489 |
|
1490 |
+
history.length = history.entries.length;
|
1491 |
+
transitionManager.notifyListeners(history.location, history.action);
|
1492 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1493 |
|
1494 |
+
function createKey() {
|
1495 |
+
return Math.random().toString(36).substr(2, keyLength);
|
1496 |
+
}
|
1497 |
|
1498 |
+
var index = clamp(initialIndex, 0, initialEntries.length - 1);
|
1499 |
+
var entries = initialEntries.map(function (entry) {
|
1500 |
+
return typeof entry === 'string' ? createLocation(entry, undefined, createKey()) : createLocation(entry, undefined, entry.key || createKey());
|
1501 |
+
}); // Public interface
|
1502 |
|
1503 |
+
var createHref = createPath;
|
|
|
|
|
|
|
|
|
1504 |
|
1505 |
+
function push(path, state) {
|
1506 |
+
false ? undefined : void 0;
|
1507 |
+
var action = 'PUSH';
|
1508 |
+
var location = createLocation(path, state, createKey(), history.location);
|
1509 |
+
transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {
|
1510 |
+
if (!ok) return;
|
1511 |
+
var prevIndex = history.index;
|
1512 |
+
var nextIndex = prevIndex + 1;
|
1513 |
+
var nextEntries = history.entries.slice(0);
|
1514 |
|
1515 |
+
if (nextEntries.length > nextIndex) {
|
1516 |
+
nextEntries.splice(nextIndex, nextEntries.length - nextIndex, location);
|
1517 |
+
} else {
|
1518 |
+
nextEntries.push(location);
|
1519 |
+
}
|
1520 |
|
1521 |
+
setState({
|
1522 |
+
action: action,
|
1523 |
+
location: location,
|
1524 |
+
index: nextIndex,
|
1525 |
+
entries: nextEntries
|
1526 |
+
});
|
1527 |
+
});
|
1528 |
+
}
|
1529 |
|
1530 |
+
function replace(path, state) {
|
1531 |
+
false ? undefined : void 0;
|
1532 |
+
var action = 'REPLACE';
|
1533 |
+
var location = createLocation(path, state, createKey(), history.location);
|
1534 |
+
transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {
|
1535 |
+
if (!ok) return;
|
1536 |
+
history.entries[history.index] = location;
|
1537 |
+
setState({
|
1538 |
+
action: action,
|
1539 |
+
location: location
|
1540 |
+
});
|
1541 |
+
});
|
1542 |
+
}
|
1543 |
|
1544 |
+
function go(n) {
|
1545 |
+
var nextIndex = clamp(history.index + n, 0, history.entries.length - 1);
|
1546 |
+
var action = 'POP';
|
1547 |
+
var location = history.entries[nextIndex];
|
1548 |
+
transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {
|
1549 |
+
if (ok) {
|
1550 |
+
setState({
|
1551 |
+
action: action,
|
1552 |
+
location: location,
|
1553 |
+
index: nextIndex
|
1554 |
+
});
|
1555 |
+
} else {
|
1556 |
+
// Mimic the behavior of DOM histories by
|
1557 |
+
// causing a render after a cancelled POP.
|
1558 |
+
setState();
|
1559 |
+
}
|
1560 |
+
});
|
1561 |
+
}
|
1562 |
|
1563 |
+
function goBack() {
|
1564 |
+
go(-1);
|
1565 |
+
}
|
1566 |
|
1567 |
+
function goForward() {
|
1568 |
+
go(1);
|
1569 |
+
}
|
1570 |
|
1571 |
+
function canGo(n) {
|
1572 |
+
var nextIndex = history.index + n;
|
1573 |
+
return nextIndex >= 0 && nextIndex < history.entries.length;
|
1574 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1575 |
|
1576 |
+
function block(prompt) {
|
1577 |
+
if (prompt === void 0) {
|
1578 |
+
prompt = false;
|
1579 |
+
}
|
1580 |
|
1581 |
+
return transitionManager.setPrompt(prompt);
|
1582 |
+
}
|
|
|
|
|
|
|
|
|
|
|
1583 |
|
1584 |
+
function listen(listener) {
|
1585 |
+
return transitionManager.appendListener(listener);
|
1586 |
+
}
|
|
|
|
|
|
|
|
|
1587 |
|
1588 |
+
var history = {
|
1589 |
+
length: entries.length,
|
1590 |
+
action: 'POP',
|
1591 |
+
location: entries[index],
|
1592 |
+
index: index,
|
1593 |
+
entries: entries,
|
1594 |
+
createHref: createHref,
|
1595 |
+
push: push,
|
1596 |
+
replace: replace,
|
1597 |
+
go: go,
|
1598 |
+
goBack: goBack,
|
1599 |
+
goForward: goForward,
|
1600 |
+
canGo: canGo,
|
1601 |
+
block: block,
|
1602 |
+
listen: listen
|
1603 |
+
};
|
1604 |
+
return history;
|
1605 |
+
}
|
1606 |
|
|
|
|
|
|
|
|
|
1607 |
|
|
|
|
|
1608 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1609 |
|
1610 |
+
/***/ }),
|
|
|
1611 |
|
1612 |
+
/***/ 104:
|
1613 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
1614 |
|
1615 |
+
"use strict";
|
1616 |
+
/* harmony import */ var _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(78);
|
1617 |
+
/* harmony import */ var _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__);
|
1618 |
+
/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(42);
|
1619 |
+
/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1__);
|
1620 |
+
/* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(41);
|
1621 |
+
/* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_2__);
|
1622 |
+
/* harmony import */ var _babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(65);
|
1623 |
+
/* harmony import */ var _babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_3__);
|
1624 |
+
/* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(43);
|
1625 |
+
/* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_4__);
|
1626 |
+
/* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(47);
|
1627 |
+
/* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_5__);
|
1628 |
+
/* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(28);
|
1629 |
+
/* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_6__);
|
1630 |
+
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(0);
|
1631 |
+
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__);
|
1632 |
+
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(2);
|
1633 |
+
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_8__);
|
1634 |
+
/* harmony import */ var _wordpress_is_shallow_equal__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(58);
|
1635 |
+
/* harmony import */ var _wordpress_is_shallow_equal__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_wordpress_is_shallow_equal__WEBPACK_IMPORTED_MODULE_9__);
|
1636 |
+
/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(57);
|
1637 |
+
/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(19);
|
1638 |
+
/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_11__);
|
1639 |
|
|
|
1640 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1641 |
|
|
|
|
|
|
|
|
|
1642 |
|
1643 |
|
|
|
|
|
|
|
|
|
|
|
|
|
1644 |
|
|
|
|
|
1645 |
|
|
|
|
|
|
|
1646 |
|
|
|
|
|
|
|
1647 |
|
1648 |
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_6___default()(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_6___default()(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_5___default()(this, result); }; }
|
|
|
1649 |
|
1650 |
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
|
|
|
|
|
|
|
1651 |
|
1652 |
+
/**
|
1653 |
+
* NOTE: This is temporary code. It exists only until a version of `@wordpress/data`
|
1654 |
+
* is released which supports this functionality.
|
1655 |
+
*
|
1656 |
+
* @todo Remove this and use `@wordpress/data` `withSelect` instead after
|
1657 |
+
* this PR is merged: https://github.com/WordPress/gutenberg/pull/11460
|
1658 |
+
*/
|
|
|
1659 |
|
1660 |
+
/**
|
1661 |
+
* External dependencies
|
1662 |
+
*/
|
1663 |
|
|
|
|
|
|
|
1664 |
|
|
|
|
|
1665 |
|
|
|
|
|
|
|
|
|
1666 |
|
|
|
|
|
1667 |
|
1668 |
+
/**
|
1669 |
+
* Higher-order component used to inject state-derived props using registered
|
1670 |
+
* selectors.
|
1671 |
+
*
|
1672 |
+
* @param {Function} mapSelectToProps Function called on every state change,
|
1673 |
+
* expected to return object of props to
|
1674 |
+
* merge with the component's own props.
|
1675 |
+
*
|
1676 |
+
* @return {Component} Enhanced component with merged state data props.
|
1677 |
+
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1678 |
|
1679 |
+
var withSelect = function withSelect(mapSelectToProps) {
|
1680 |
+
return Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_10__[/* default */ "a"])(function (WrappedComponent) {
|
1681 |
+
/**
|
1682 |
+
* Default merge props. A constant value is used as the fallback since it
|
1683 |
+
* can be more efficiently shallow compared in case component is repeatedly
|
1684 |
+
* rendered without its own merge props.
|
1685 |
+
*
|
1686 |
+
* @type {Object}
|
1687 |
+
*/
|
1688 |
+
var DEFAULT_MERGE_PROPS = {};
|
1689 |
|
1690 |
+
var ComponentWithSelect = /*#__PURE__*/function (_Component) {
|
1691 |
+
_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_4___default()(ComponentWithSelect, _Component);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1692 |
|
1693 |
+
var _super = _createSuper(ComponentWithSelect);
|
1694 |
|
1695 |
+
function ComponentWithSelect(props) {
|
1696 |
+
var _this;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1697 |
|
1698 |
+
_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default()(this, ComponentWithSelect);
|
1699 |
|
1700 |
+
_this = _super.call(this, props);
|
1701 |
+
_this.onStoreChange = _this.onStoreChange.bind(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_3___default()(_this));
|
|
|
|
|
1702 |
|
1703 |
+
_this.subscribe(props.registry);
|
|
|
1704 |
|
1705 |
+
_this.onUnmounts = {};
|
1706 |
+
_this.mergeProps = _this.getNextMergeProps(props);
|
1707 |
+
return _this;
|
1708 |
}
|
1709 |
+
/**
|
1710 |
+
* Given a props object, returns the next merge props by mapSelectToProps.
|
1711 |
+
*
|
1712 |
+
* @param {Object} props Props to pass as argument to mapSelectToProps.
|
1713 |
+
*
|
1714 |
+
* @return {Object} Props to merge into rendered wrapped element.
|
1715 |
+
*/
|
1716 |
|
|
|
|
|
|
|
|
|
|
|
1717 |
|
1718 |
+
_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_2___default()(ComponentWithSelect, [{
|
1719 |
+
key: "getNextMergeProps",
|
1720 |
+
value: function getNextMergeProps(props) {
|
1721 |
+
var _this2 = this;
|
|
|
|
|
|
|
|
|
|
|
1722 |
|
1723 |
+
var storeSelectors = {};
|
1724 |
+
var onCompletes = [];
|
1725 |
+
var componentContext = {
|
1726 |
+
component: this
|
1727 |
+
};
|
1728 |
|
1729 |
+
var getStoreFromRegistry = function getStoreFromRegistry(key, registry, context) {
|
1730 |
+
// This is our first time selecting from this store.
|
1731 |
+
// Do some lazy-loading of handling at this time.
|
1732 |
+
var selectorsForKey = registry.select(key);
|
|
|
|
|
|
|
|
|
|
|
|
|
1733 |
|
1734 |
+
if (Object(lodash__WEBPACK_IMPORTED_MODULE_8__["isFunction"])(selectorsForKey)) {
|
1735 |
+
// This store has special handling for its selectors.
|
1736 |
+
// We give it a context, and we check for a "resolve"
|
1737 |
+
var _selectorsForKey = selectorsForKey(context),
|
1738 |
+
selectors = _selectorsForKey.selectors,
|
1739 |
+
onComplete = _selectorsForKey.onComplete,
|
1740 |
+
onUnmount = _selectorsForKey.onUnmount;
|
1741 |
|
1742 |
+
if (onComplete) {
|
1743 |
+
onCompletes.push(onComplete);
|
1744 |
+
}
|
|
|
1745 |
|
1746 |
+
if (onUnmount) {
|
1747 |
+
_this2.onUnmounts[key] = onUnmount;
|
1748 |
+
}
|
1749 |
|
1750 |
+
storeSelectors[key] = selectors;
|
1751 |
+
} else {
|
1752 |
+
storeSelectors[key] = selectorsForKey;
|
1753 |
+
}
|
1754 |
+
};
|
1755 |
|
1756 |
+
var select = function select(key) {
|
1757 |
+
if (!storeSelectors[key]) {
|
1758 |
+
getStoreFromRegistry(key, props.registry, componentContext);
|
1759 |
+
}
|
1760 |
|
1761 |
+
return storeSelectors[key];
|
1762 |
+
};
|
1763 |
|
1764 |
+
var selectedProps = mapSelectToProps(select, props.ownProps) || DEFAULT_MERGE_PROPS; // Complete the select for those stores which support it.
|
|
|
1765 |
|
1766 |
+
onCompletes.forEach(function (onComplete) {
|
1767 |
+
return onComplete();
|
1768 |
+
});
|
1769 |
+
return selectedProps;
|
1770 |
+
}
|
1771 |
+
}, {
|
1772 |
+
key: "componentDidMount",
|
1773 |
+
value: function componentDidMount() {
|
1774 |
+
this.canRunSelection = true; // A state change may have occurred between the constructor and
|
1775 |
+
// mount of the component (e.g. during the wrapped component's own
|
1776 |
+
// constructor), in which case selection should be rerun.
|
1777 |
|
1778 |
+
if (this.hasQueuedSelection) {
|
1779 |
+
this.hasQueuedSelection = false;
|
1780 |
+
this.onStoreChange();
|
1781 |
+
}
|
1782 |
}
|
1783 |
+
}, {
|
1784 |
+
key: "componentWillUnmount",
|
1785 |
+
value: function componentWillUnmount() {
|
1786 |
+
var _this3 = this;
|
1787 |
|
1788 |
+
this.canRunSelection = false;
|
1789 |
+
this.unsubscribe();
|
1790 |
+
Object.keys(this.onUnmounts).forEach(function (key) {
|
1791 |
+
return _this3.onUnmounts[key]();
|
1792 |
+
});
|
1793 |
+
}
|
1794 |
+
}, {
|
1795 |
+
key: "shouldComponentUpdate",
|
1796 |
+
value: function shouldComponentUpdate(nextProps, nextState) {
|
1797 |
+
// Cycle subscription if registry changes.
|
1798 |
+
var hasRegistryChanged = nextProps.registry !== this.props.registry;
|
1799 |
|
1800 |
+
if (hasRegistryChanged) {
|
1801 |
+
this.unsubscribe();
|
1802 |
+
this.subscribe(nextProps.registry);
|
1803 |
+
} // Treat a registry change as equivalent to `ownProps`, to reflect
|
1804 |
+
// `mergeProps` to rendered component if and only if updated.
|
1805 |
|
|
|
1806 |
|
1807 |
+
var hasPropsChanged = hasRegistryChanged || !_wordpress_is_shallow_equal__WEBPACK_IMPORTED_MODULE_9___default()(this.props.ownProps, nextProps.ownProps); // Only render if props have changed or merge props have been updated
|
1808 |
+
// from the store subscriber.
|
1809 |
|
1810 |
+
if (this.state === nextState && !hasPropsChanged) {
|
1811 |
+
return false;
|
1812 |
+
}
|
1813 |
|
1814 |
+
if (hasPropsChanged) {
|
1815 |
+
var nextMergeProps = this.getNextMergeProps(nextProps);
|
|
|
|
|
|
|
|
|
1816 |
|
1817 |
+
if (!_wordpress_is_shallow_equal__WEBPACK_IMPORTED_MODULE_9___default()(this.mergeProps, nextMergeProps)) {
|
1818 |
+
// If merge props change as a result of the incoming props,
|
1819 |
+
// they should be reflected as such in the upcoming render.
|
1820 |
+
// While side effects are discouraged in lifecycle methods,
|
1821 |
+
// this component is used heavily, and prior efforts to use
|
1822 |
+
// `getDerivedStateFromProps` had demonstrated miserable
|
1823 |
+
// performance.
|
1824 |
+
this.mergeProps = nextMergeProps;
|
1825 |
+
} // Regardless whether merge props are changing, fall through to
|
1826 |
+
// incur the render since the component will need to receive
|
1827 |
+
// the changed `ownProps`.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1828 |
|
1829 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
1830 |
|
1831 |
+
return true;
|
1832 |
+
}
|
1833 |
+
}, {
|
1834 |
+
key: "onStoreChange",
|
1835 |
+
value: function onStoreChange() {
|
1836 |
+
if (!this.canRunSelection) {
|
1837 |
+
this.hasQueuedSelection = true;
|
1838 |
+
return;
|
1839 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1840 |
|
1841 |
+
var nextMergeProps = this.getNextMergeProps(this.props);
|
|
|
|
|
|
|
|
|
|
|
|
|
1842 |
|
1843 |
+
if (_wordpress_is_shallow_equal__WEBPACK_IMPORTED_MODULE_9___default()(this.mergeProps, nextMergeProps)) {
|
1844 |
+
return;
|
1845 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1846 |
|
1847 |
+
this.mergeProps = nextMergeProps; // Schedule an update. Merge props are not assigned to state since
|
1848 |
+
// derivation of merge props from incoming props occurs within
|
1849 |
+
// shouldComponentUpdate, where setState is not allowed. setState
|
1850 |
+
// is used here instead of forceUpdate because forceUpdate bypasses
|
1851 |
+
// shouldComponentUpdate altogether, which isn't desireable if both
|
1852 |
+
// state and props change within the same render. Unfortunately,
|
1853 |
+
// this requires that next merge props are generated twice.
|
1854 |
|
1855 |
+
this.setState({});
|
1856 |
+
}
|
1857 |
+
}, {
|
1858 |
+
key: "subscribe",
|
1859 |
+
value: function subscribe(registry) {
|
1860 |
+
this.unsubscribe = registry.subscribe(this.onStoreChange);
|
1861 |
+
}
|
1862 |
+
}, {
|
1863 |
+
key: "render",
|
1864 |
+
value: function render() {
|
1865 |
+
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["createElement"])(WrappedComponent, _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({}, this.props.ownProps, this.mergeProps));
|
1866 |
+
}
|
1867 |
+
}]);
|
|
|
|
|
|
|
1868 |
|
1869 |
+
return ComponentWithSelect;
|
1870 |
+
}(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["Component"]);
|
|
|
1871 |
|
1872 |
+
return function (ownProps) {
|
1873 |
+
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["createElement"])(_wordpress_data__WEBPACK_IMPORTED_MODULE_11__["RegistryConsumer"], null, function (registry) {
|
1874 |
+
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["createElement"])(ComponentWithSelect, {
|
1875 |
+
ownProps: ownProps,
|
1876 |
+
registry: registry
|
1877 |
+
});
|
1878 |
+
});
|
1879 |
+
};
|
1880 |
+
}, 'withSelect');
|
1881 |
+
};
|
1882 |
|
1883 |
+
/* harmony default export */ __webpack_exports__["a"] = (withSelect);
|
1884 |
|
1885 |
/***/ }),
|
1886 |
|
1887 |
+
/***/ 11:
|
1888 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
1889 |
|
1890 |
+
"use strict";
|
1891 |
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _possibleConstructorReturn; });
|
1892 |
+
/* harmony import */ var _helpers_esm_typeof__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(40);
|
1893 |
+
/* harmony import */ var _assertThisInitialized__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(5);
|
|
|
1894 |
|
1895 |
+
|
1896 |
+
function _possibleConstructorReturn(self, call) {
|
1897 |
+
if (call && (Object(_helpers_esm_typeof__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])(call) === "object" || typeof call === "function")) {
|
1898 |
+
return call;
|
1899 |
+
}
|
1900 |
+
|
1901 |
+
return Object(_assertThisInitialized__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"])(self);
|
1902 |
+
}
|
1903 |
|
1904 |
/***/ }),
|
1905 |
|
1906 |
+
/***/ 111:
|
1907 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
1908 |
|
1909 |
"use strict";
|
1910 |
+
/* harmony import */ var _woocommerce_date__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(24);
|
1911 |
+
/* harmony import */ var _woocommerce_date__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_woocommerce_date__WEBPACK_IMPORTED_MODULE_0__);
|
1912 |
+
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "k", function() { return _woocommerce_date__WEBPACK_IMPORTED_MODULE_0__["isoDateFormat"]; });
|
1913 |
|
1914 |
+
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _woocommerce_date__WEBPACK_IMPORTED_MODULE_0__["appendTimestamp"]; });
|
|
|
1915 |
|
1916 |
+
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "h", function() { return _woocommerce_date__WEBPACK_IMPORTED_MODULE_0__["getDateParamsFromQuery"]; });
|
1917 |
|
1918 |
+
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "f", function() { return _woocommerce_date__WEBPACK_IMPORTED_MODULE_0__["getCurrentDates"]; });
|
|
|
1919 |
|
1920 |
+
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "j", function() { return _woocommerce_date__WEBPACK_IMPORTED_MODULE_0__["getPreviousDate"]; });
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1921 |
|
1922 |
+
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "d", function() { return _woocommerce_date__WEBPACK_IMPORTED_MODULE_0__["getAllowedIntervalsForQuery"]; });
|
|
|
|
|
1923 |
|
1924 |
+
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "i", function() { return _woocommerce_date__WEBPACK_IMPORTED_MODULE_0__["getIntervalForQuery"]; });
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1925 |
|
1926 |
+
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "e", function() { return _woocommerce_date__WEBPACK_IMPORTED_MODULE_0__["getChartTypeForQuery"]; });
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1927 |
|
1928 |
+
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "c", function() { return _woocommerce_date__WEBPACK_IMPORTED_MODULE_0__["defaultTableDateFormat"]; });
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1929 |
|
1930 |
+
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "g", function() { return _woocommerce_date__WEBPACK_IMPORTED_MODULE_0__["getDateFormatsForInterval"]; });
|
1931 |
+
|
1932 |
+
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "b", function() { return _woocommerce_date__WEBPACK_IMPORTED_MODULE_0__["dateValidationMessages"]; });
|
1933 |
|
|
|
|
|
|
|
|
|
|
|
1934 |
/**
|
1935 |
+
* External dependencies
|
1936 |
*/
|
1937 |
|
1938 |
/**
|
1939 |
* Internal dependencies
|
1940 |
*/
|
1941 |
|
1942 |
+
/**
|
1943 |
+
* WooCommerce dependencies
|
1944 |
+
*/
|
1945 |
+
// Export the expected API for the consuming app.
|
1946 |
|
1947 |
|
1948 |
|
1949 |
+
/***/ }),
|
|
|
|
|
1950 |
|
1951 |
+
/***/ 114:
|
1952 |
+
/***/ (function(module, exports, __webpack_require__) {
|
|
|
1953 |
|
1954 |
+
"use strict";
|
|
|
|
|
1955 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1956 |
|
|
|
1957 |
/**
|
1958 |
+
* Copyright (c) 2013-present, Facebook, Inc.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1959 |
*
|
1960 |
+
* This source code is licensed under the MIT license found in the
|
1961 |
+
* LICENSE file in the root directory of this source tree.
|
1962 |
*
|
1963 |
+
*
|
|
|
|
|
1964 |
*/
|
1965 |
|
1966 |
+
function makeEmptyFunction(arg) {
|
1967 |
+
return function () {
|
1968 |
+
return arg;
|
1969 |
+
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1970 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1971 |
|
1972 |
+
/**
|
1973 |
+
* This function accepts and discards inputs; it has no side effects. This is
|
1974 |
+
* primarily useful idiomatically for overridable function endpoints which
|
1975 |
+
* always need to be callable, since JS lacks a null-call idiom ala Cocoa.
|
1976 |
+
*/
|
1977 |
+
var emptyFunction = function emptyFunction() {};
|
|
|
1978 |
|
1979 |
+
emptyFunction.thatReturns = makeEmptyFunction;
|
1980 |
+
emptyFunction.thatReturnsFalse = makeEmptyFunction(false);
|
1981 |
+
emptyFunction.thatReturnsTrue = makeEmptyFunction(true);
|
1982 |
+
emptyFunction.thatReturnsNull = makeEmptyFunction(null);
|
1983 |
+
emptyFunction.thatReturnsThis = function () {
|
1984 |
+
return this;
|
1985 |
+
};
|
1986 |
+
emptyFunction.thatReturnsArgument = function (arg) {
|
1987 |
+
return arg;
|
1988 |
+
};
|
1989 |
|
1990 |
+
module.exports = emptyFunction;
|
1991 |
|
1992 |
/***/ }),
|
1993 |
|
1994 |
+
/***/ 116:
|
1995 |
/***/ (function(module, exports) {
|
1996 |
|
1997 |
+
(function() { module.exports = this["wc"]["currency"]; }());
|
1998 |
|
1999 |
/***/ }),
|
2000 |
|
2001 |
+
/***/ 117:
|
2002 |
+
/***/ (function(module, exports, __webpack_require__) {
|
2003 |
|
2004 |
"use strict";
|
2005 |
+
/**
|
2006 |
+
* Copyright (c) 2013-present, Facebook, Inc.
|
2007 |
+
*
|
2008 |
+
* This source code is licensed under the MIT license found in the
|
2009 |
+
* LICENSE file in the root directory of this source tree.
|
2010 |
+
*/
|
2011 |
|
|
|
|
|
|
|
|
|
2012 |
|
|
|
|
|
2013 |
|
2014 |
+
var ReactPropTypesSecret = __webpack_require__(118);
|
|
|
|
|
|
|
|
|
|
|
|
|
2015 |
|
2016 |
+
function emptyFunction() {}
|
2017 |
+
function emptyFunctionWithReset() {}
|
2018 |
+
emptyFunctionWithReset.resetWarningCache = emptyFunction;
|
2019 |
|
2020 |
+
module.exports = function() {
|
2021 |
+
function shim(props, propName, componentName, location, propFullName, secret) {
|
2022 |
+
if (secret === ReactPropTypesSecret) {
|
2023 |
+
// It is still safe when called from React.
|
2024 |
+
return;
|
2025 |
+
}
|
2026 |
+
var err = new Error(
|
2027 |
+
'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +
|
2028 |
+
'Use PropTypes.checkPropTypes() to call them. ' +
|
2029 |
+
'Read more at http://fb.me/use-check-prop-types'
|
2030 |
+
);
|
2031 |
+
err.name = 'Invariant Violation';
|
2032 |
+
throw err;
|
2033 |
+
};
|
2034 |
+
shim.isRequired = shim;
|
2035 |
+
function getShim() {
|
2036 |
+
return shim;
|
2037 |
+
};
|
2038 |
+
// Important!
|
2039 |
+
// Keep this list in sync with production version in `./factoryWithTypeCheckers.js`.
|
2040 |
+
var ReactPropTypes = {
|
2041 |
+
array: shim,
|
2042 |
+
bool: shim,
|
2043 |
+
func: shim,
|
2044 |
+
number: shim,
|
2045 |
+
object: shim,
|
2046 |
+
string: shim,
|
2047 |
+
symbol: shim,
|
2048 |
|
2049 |
+
any: shim,
|
2050 |
+
arrayOf: getShim,
|
2051 |
+
element: shim,
|
2052 |
+
elementType: shim,
|
2053 |
+
instanceOf: getShim,
|
2054 |
+
node: shim,
|
2055 |
+
objectOf: getShim,
|
2056 |
+
oneOf: getShim,
|
2057 |
+
oneOfType: getShim,
|
2058 |
+
shape: getShim,
|
2059 |
+
exact: getShim,
|
2060 |
|
2061 |
+
checkPropTypes: emptyFunctionWithReset,
|
2062 |
+
resetWarningCache: emptyFunction
|
|
|
|
|
2063 |
};
|
2064 |
|
2065 |
+
ReactPropTypes.PropTypes = ReactPropTypes;
|
2066 |
+
|
2067 |
+
return ReactPropTypes;
|
2068 |
+
};
|
2069 |
|
|
|
2070 |
|
2071 |
/***/ }),
|
2072 |
|
2073 |
+
/***/ 118:
|
2074 |
/***/ (function(module, exports, __webpack_require__) {
|
2075 |
|
2076 |
"use strict";
|
2077 |
/**
|
2078 |
+
* Copyright (c) 2013-present, Facebook, Inc.
|
2079 |
*
|
2080 |
* This source code is licensed under the MIT license found in the
|
2081 |
* LICENSE file in the root directory of this source tree.
|
2083 |
|
2084 |
|
2085 |
|
2086 |
+
var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
|
2087 |
|
2088 |
+
module.exports = ReactPropTypesSecret;
|
|
|
|
|
2089 |
|
|
|
|
|
|
|
2090 |
|
2091 |
+
/***/ }),
|
|
|
2092 |
|
2093 |
+
/***/ 119:
|
2094 |
+
/***/ (function(module, exports, __webpack_require__) {
|
2095 |
|
2096 |
+
"use strict";
|
|
|
2097 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2098 |
|
2099 |
+
var utils = __webpack_require__(74);
|
2100 |
+
var formats = __webpack_require__(96);
|
2101 |
+
var has = Object.prototype.hasOwnProperty;
|
|
|
|
|
|
|
|
|
|
|
|
|
2102 |
|
2103 |
+
var arrayPrefixGenerators = {
|
2104 |
+
brackets: function brackets(prefix) {
|
2105 |
+
return prefix + '[]';
|
2106 |
+
},
|
2107 |
+
comma: 'comma',
|
2108 |
+
indices: function indices(prefix, key) {
|
2109 |
+
return prefix + '[' + key + ']';
|
2110 |
+
},
|
2111 |
+
repeat: function repeat(prefix) {
|
2112 |
+
return prefix;
|
2113 |
+
}
|
2114 |
+
};
|
2115 |
|
2116 |
+
var isArray = Array.isArray;
|
2117 |
+
var push = Array.prototype.push;
|
2118 |
+
var pushToArray = function (arr, valueOrArray) {
|
2119 |
+
push.apply(arr, isArray(valueOrArray) ? valueOrArray : [valueOrArray]);
|
2120 |
+
};
|
|
|
|
|
|
|
|
|
|
|
2121 |
|
2122 |
+
var toISO = Date.prototype.toISOString;
|
|
|
|
|
|
|
|
|
|
|
|
|
2123 |
|
2124 |
+
var defaultFormat = formats['default'];
|
2125 |
+
var defaults = {
|
2126 |
+
addQueryPrefix: false,
|
2127 |
+
allowDots: false,
|
2128 |
+
charset: 'utf-8',
|
2129 |
+
charsetSentinel: false,
|
2130 |
+
delimiter: '&',
|
2131 |
+
encode: true,
|
2132 |
+
encoder: utils.encode,
|
2133 |
+
encodeValuesOnly: false,
|
2134 |
+
format: defaultFormat,
|
2135 |
+
formatter: formats.formatters[defaultFormat],
|
2136 |
+
// deprecated
|
2137 |
+
indices: false,
|
2138 |
+
serializeDate: function serializeDate(date) {
|
2139 |
+
return toISO.call(date);
|
2140 |
+
},
|
2141 |
+
skipNulls: false,
|
2142 |
+
strictNullHandling: false
|
2143 |
+
};
|
2144 |
|
2145 |
+
var isNonNullishPrimitive = function isNonNullishPrimitive(v) {
|
2146 |
+
return typeof v === 'string'
|
2147 |
+
|| typeof v === 'number'
|
2148 |
+
|| typeof v === 'boolean'
|
2149 |
+
|| typeof v === 'symbol'
|
2150 |
+
|| typeof v === 'bigint';
|
2151 |
+
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2152 |
|
2153 |
+
var stringify = function stringify(
|
2154 |
+
object,
|
2155 |
+
prefix,
|
2156 |
+
generateArrayPrefix,
|
2157 |
+
strictNullHandling,
|
2158 |
+
skipNulls,
|
2159 |
+
encoder,
|
2160 |
+
filter,
|
2161 |
+
sort,
|
2162 |
+
allowDots,
|
2163 |
+
serializeDate,
|
2164 |
+
formatter,
|
2165 |
+
encodeValuesOnly,
|
2166 |
+
charset
|
2167 |
+
) {
|
2168 |
+
var obj = object;
|
2169 |
+
if (typeof filter === 'function') {
|
2170 |
+
obj = filter(prefix, obj);
|
2171 |
+
} else if (obj instanceof Date) {
|
2172 |
+
obj = serializeDate(obj);
|
2173 |
+
} else if (generateArrayPrefix === 'comma' && isArray(obj)) {
|
2174 |
+
obj = obj.join(',');
|
2175 |
+
}
|
2176 |
|
2177 |
+
if (obj === null) {
|
2178 |
+
if (strictNullHandling) {
|
2179 |
+
return encoder && !encodeValuesOnly ? encoder(prefix, defaults.encoder, charset, 'key') : prefix;
|
2180 |
+
}
|
2181 |
+
|
2182 |
+
obj = '';
|
|
|
|
|
|
|
|
|
2183 |
}
|
|
|
|
|
|
|
|
|
2184 |
|
2185 |
+
if (isNonNullishPrimitive(obj) || utils.isBuffer(obj)) {
|
2186 |
+
if (encoder) {
|
2187 |
+
var keyValue = encodeValuesOnly ? prefix : encoder(prefix, defaults.encoder, charset, 'key');
|
2188 |
+
return [formatter(keyValue) + '=' + formatter(encoder(obj, defaults.encoder, charset, 'value'))];
|
2189 |
+
}
|
2190 |
+
return [formatter(prefix) + '=' + formatter(String(obj))];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2191 |
}
|
|
|
2192 |
|
2193 |
+
var values = [];
|
|
|
2194 |
|
2195 |
+
if (typeof obj === 'undefined') {
|
2196 |
+
return values;
|
2197 |
+
}
|
|
|
2198 |
|
2199 |
+
var objKeys;
|
2200 |
+
if (isArray(filter)) {
|
2201 |
+
objKeys = filter;
|
2202 |
+
} else {
|
2203 |
+
var keys = Object.keys(obj);
|
2204 |
+
objKeys = sort ? keys.sort(sort) : keys;
|
2205 |
+
}
|
2206 |
|
2207 |
+
for (var i = 0; i < objKeys.length; ++i) {
|
2208 |
+
var key = objKeys[i];
|
|
|
|
|
2209 |
|
2210 |
+
if (skipNulls && obj[key] === null) {
|
2211 |
+
continue;
|
2212 |
+
}
|
|
|
|
|
|
|
|
|
2213 |
|
2214 |
+
if (isArray(obj)) {
|
2215 |
+
pushToArray(values, stringify(
|
2216 |
+
obj[key],
|
2217 |
+
typeof generateArrayPrefix === 'function' ? generateArrayPrefix(prefix, key) : prefix,
|
2218 |
+
generateArrayPrefix,
|
2219 |
+
strictNullHandling,
|
2220 |
+
skipNulls,
|
2221 |
+
encoder,
|
2222 |
+
filter,
|
2223 |
+
sort,
|
2224 |
+
allowDots,
|
2225 |
+
serializeDate,
|
2226 |
+
formatter,
|
2227 |
+
encodeValuesOnly,
|
2228 |
+
charset
|
2229 |
+
));
|
2230 |
+
} else {
|
2231 |
+
pushToArray(values, stringify(
|
2232 |
+
obj[key],
|
2233 |
+
prefix + (allowDots ? '.' + key : '[' + key + ']'),
|
2234 |
+
generateArrayPrefix,
|
2235 |
+
strictNullHandling,
|
2236 |
+
skipNulls,
|
2237 |
+
encoder,
|
2238 |
+
filter,
|
2239 |
+
sort,
|
2240 |
+
allowDots,
|
2241 |
+
serializeDate,
|
2242 |
+
formatter,
|
2243 |
+
encodeValuesOnly,
|
2244 |
+
charset
|
2245 |
+
));
|
2246 |
+
}
|
2247 |
+
}
|
2248 |
|
2249 |
+
return values;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2250 |
};
|
2251 |
|
2252 |
+
var normalizeStringifyOptions = function normalizeStringifyOptions(opts) {
|
2253 |
+
if (!opts) {
|
2254 |
+
return defaults;
|
2255 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2256 |
|
2257 |
+
if (opts.encoder !== null && opts.encoder !== undefined && typeof opts.encoder !== 'function') {
|
2258 |
+
throw new TypeError('Encoder has to be a function.');
|
2259 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2260 |
|
2261 |
+
var charset = opts.charset || defaults.charset;
|
2262 |
+
if (typeof opts.charset !== 'undefined' && opts.charset !== 'utf-8' && opts.charset !== 'iso-8859-1') {
|
2263 |
+
throw new TypeError('The charset option must be either utf-8, iso-8859-1, or undefined');
|
2264 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
2265 |
|
2266 |
+
var format = formats['default'];
|
2267 |
+
if (typeof opts.format !== 'undefined') {
|
2268 |
+
if (!has.call(formats.formatters, opts.format)) {
|
2269 |
+
throw new TypeError('Unknown format option provided.');
|
2270 |
+
}
|
2271 |
+
format = opts.format;
|
2272 |
+
}
|
2273 |
+
var formatter = formats.formatters[format];
|
2274 |
+
|
2275 |
+
var filter = defaults.filter;
|
2276 |
+
if (typeof opts.filter === 'function' || isArray(opts.filter)) {
|
2277 |
+
filter = opts.filter;
|
2278 |
+
}
|
2279 |
+
|
2280 |
+
return {
|
2281 |
+
addQueryPrefix: typeof opts.addQueryPrefix === 'boolean' ? opts.addQueryPrefix : defaults.addQueryPrefix,
|
2282 |
+
allowDots: typeof opts.allowDots === 'undefined' ? defaults.allowDots : !!opts.allowDots,
|
2283 |
+
charset: charset,
|
2284 |
+
charsetSentinel: typeof opts.charsetSentinel === 'boolean' ? opts.charsetSentinel : defaults.charsetSentinel,
|
2285 |
+
delimiter: typeof opts.delimiter === 'undefined' ? defaults.delimiter : opts.delimiter,
|
2286 |
+
encode: typeof opts.encode === 'boolean' ? opts.encode : defaults.encode,
|
2287 |
+
encoder: typeof opts.encoder === 'function' ? opts.encoder : defaults.encoder,
|
2288 |
+
encodeValuesOnly: typeof opts.encodeValuesOnly === 'boolean' ? opts.encodeValuesOnly : defaults.encodeValuesOnly,
|
2289 |
+
filter: filter,
|
2290 |
+
formatter: formatter,
|
2291 |
+
serializeDate: typeof opts.serializeDate === 'function' ? opts.serializeDate : defaults.serializeDate,
|
2292 |
+
skipNulls: typeof opts.skipNulls === 'boolean' ? opts.skipNulls : defaults.skipNulls,
|
2293 |
+
sort: typeof opts.sort === 'function' ? opts.sort : null,
|
2294 |
+
strictNullHandling: typeof opts.strictNullHandling === 'boolean' ? opts.strictNullHandling : defaults.strictNullHandling
|
2295 |
+
};
|
2296 |
};
|
|
|
2297 |
|
2298 |
+
module.exports = function (object, opts) {
|
2299 |
+
var obj = object;
|
2300 |
+
var options = normalizeStringifyOptions(opts);
|
|
|
|
|
2301 |
|
2302 |
+
var objKeys;
|
2303 |
+
var filter;
|
2304 |
+
|
2305 |
+
if (typeof options.filter === 'function') {
|
2306 |
+
filter = options.filter;
|
2307 |
+
obj = filter('', obj);
|
2308 |
+
} else if (isArray(options.filter)) {
|
2309 |
+
filter = options.filter;
|
2310 |
+
objKeys = filter;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2311 |
}
|
|
|
|
|
|
|
2312 |
|
2313 |
+
var keys = [];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2314 |
|
2315 |
+
if (typeof obj !== 'object' || obj === null) {
|
2316 |
+
return '';
|
2317 |
+
}
|
2318 |
|
2319 |
+
var arrayFormat;
|
2320 |
+
if (opts && opts.arrayFormat in arrayPrefixGenerators) {
|
2321 |
+
arrayFormat = opts.arrayFormat;
|
2322 |
+
} else if (opts && 'indices' in opts) {
|
2323 |
+
arrayFormat = opts.indices ? 'indices' : 'repeat';
|
2324 |
+
} else {
|
2325 |
+
arrayFormat = 'indices';
|
2326 |
+
}
|
2327 |
|
2328 |
+
var generateArrayPrefix = arrayPrefixGenerators[arrayFormat];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2329 |
|
2330 |
+
if (!objKeys) {
|
2331 |
+
objKeys = Object.keys(obj);
|
2332 |
+
}
|
|
|
|
|
2333 |
|
2334 |
+
if (options.sort) {
|
2335 |
+
objKeys.sort(options.sort);
|
2336 |
+
}
|
2337 |
|
2338 |
+
for (var i = 0; i < objKeys.length; ++i) {
|
2339 |
+
var key = objKeys[i];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2340 |
|
2341 |
+
if (options.skipNulls && obj[key] === null) {
|
2342 |
+
continue;
|
2343 |
+
}
|
2344 |
+
pushToArray(keys, stringify(
|
2345 |
+
obj[key],
|
2346 |
+
key,
|
2347 |
+
generateArrayPrefix,
|
2348 |
+
options.strictNullHandling,
|
2349 |
+
options.skipNulls,
|
2350 |
+
options.encode ? options.encoder : null,
|
2351 |
+
options.filter,
|
2352 |
+
options.sort,
|
2353 |
+
options.allowDots,
|
2354 |
+
options.serializeDate,
|
2355 |
+
options.formatter,
|
2356 |
+
options.encodeValuesOnly,
|
2357 |
+
options.charset
|
2358 |
+
));
|
2359 |
+
}
|
2360 |
|
2361 |
+
var joined = keys.join(options.delimiter);
|
2362 |
+
var prefix = options.addQueryPrefix === true ? '?' : '';
|
2363 |
+
|
2364 |
+
if (options.charsetSentinel) {
|
2365 |
+
if (options.charset === 'iso-8859-1') {
|
2366 |
+
// encodeURIComponent('✓'), the "numeric entity" representation of a checkmark
|
2367 |
+
prefix += 'utf8=%26%2310003%3B&';
|
2368 |
+
} else {
|
2369 |
+
// encodeURIComponent('✓')
|
2370 |
+
prefix += 'utf8=%E2%9C%93&';
|
2371 |
+
}
|
2372 |
+
}
|
2373 |
+
|
2374 |
+
return joined.length > 0 ? prefix + joined : '';
|
2375 |
+
};
|
2376 |
|
2377 |
|
2378 |
/***/ }),
|
2379 |
|
2380 |
+
/***/ 12:
|
2381 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
2382 |
|
2383 |
"use strict";
|
2384 |
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _extends; });
|
2385 |
+
function _extends() {
|
2386 |
+
_extends = Object.assign || function (target) {
|
2387 |
+
for (var i = 1; i < arguments.length; i++) {
|
2388 |
+
var source = arguments[i];
|
|
|
|
|
2389 |
|
2390 |
+
for (var key in source) {
|
2391 |
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
2392 |
+
target[key] = source[key];
|
2393 |
+
}
|
2394 |
+
}
|
2395 |
+
}
|
2396 |
|
2397 |
+
return target;
|
2398 |
+
};
|
2399 |
|
2400 |
+
return _extends.apply(this, arguments);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2401 |
}
|
2402 |
|
|
|
|
|
2403 |
/***/ }),
|
2404 |
|
2405 |
+
/***/ 120:
|
2406 |
+
/***/ (function(module, exports, __webpack_require__) {
|
2407 |
|
2408 |
"use strict";
|
2409 |
|
|
|
|
|
|
|
|
|
|
|
2410 |
|
2411 |
+
var utils = __webpack_require__(74);
|
2412 |
|
2413 |
+
var has = Object.prototype.hasOwnProperty;
|
2414 |
+
var isArray = Array.isArray;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2415 |
|
2416 |
+
var defaults = {
|
2417 |
+
allowDots: false,
|
2418 |
+
allowPrototypes: false,
|
2419 |
+
arrayLimit: 20,
|
2420 |
+
charset: 'utf-8',
|
2421 |
+
charsetSentinel: false,
|
2422 |
+
comma: false,
|
2423 |
+
decoder: utils.decode,
|
2424 |
+
delimiter: '&',
|
2425 |
+
depth: 5,
|
2426 |
+
ignoreQueryPrefix: false,
|
2427 |
+
interpretNumericEntities: false,
|
2428 |
+
parameterLimit: 1000,
|
2429 |
+
parseArrays: true,
|
2430 |
+
plainObjects: false,
|
2431 |
+
strictNullHandling: false
|
2432 |
+
};
|
2433 |
|
2434 |
+
var interpretNumericEntities = function (str) {
|
2435 |
+
return str.replace(/&#(\d+);/g, function ($0, numberStr) {
|
2436 |
+
return String.fromCharCode(parseInt(numberStr, 10));
|
2437 |
+
});
|
2438 |
+
};
|
2439 |
|
2440 |
+
var parseArrayValue = function (val, options) {
|
2441 |
+
if (val && typeof val === 'string' && options.comma && val.indexOf(',') > -1) {
|
2442 |
+
return val.split(',');
|
2443 |
+
}
|
2444 |
|
2445 |
+
return val;
|
2446 |
+
};
|
2447 |
|
2448 |
+
var maybeMap = function maybeMap(val, fn) {
|
2449 |
+
if (isArray(val)) {
|
2450 |
+
var mapped = [];
|
2451 |
+
for (var i = 0; i < val.length; i += 1) {
|
2452 |
+
mapped.push(fn(val[i]));
|
2453 |
+
}
|
2454 |
+
return mapped;
|
2455 |
+
}
|
2456 |
+
return fn(val);
|
2457 |
+
};
|
2458 |
|
2459 |
+
// This is what browsers will submit when the ✓ character occurs in an
|
2460 |
+
// application/x-www-form-urlencoded body and the encoding of the page containing
|
2461 |
+
// the form is iso-8859-1, or when the submitted form has an accept-charset
|
2462 |
+
// attribute of iso-8859-1. Presumably also with other charsets that do not contain
|
2463 |
+
// the ✓ character, such as us-ascii.
|
2464 |
+
var isoSentinel = 'utf8=%26%2310003%3B'; // encodeURIComponent('✓')
|
2465 |
|
2466 |
+
// These are the percent-encoded utf-8 octets representing a checkmark, indicating that the request actually is utf-8 encoded.
|
2467 |
+
var charsetSentinel = 'utf8=%E2%9C%93'; // encodeURIComponent('✓')
|
2468 |
|
2469 |
+
var parseValues = function parseQueryStringValues(str, options) {
|
2470 |
+
var obj = {};
|
2471 |
+
var cleanStr = options.ignoreQueryPrefix ? str.replace(/^\?/, '') : str;
|
2472 |
+
var limit = options.parameterLimit === Infinity ? undefined : options.parameterLimit;
|
2473 |
+
var parts = cleanStr.split(options.delimiter, limit);
|
2474 |
+
var skipIndex = -1; // Keep track of where the utf8 sentinel was found
|
2475 |
+
var i;
|
|
|
2476 |
|
2477 |
+
var charset = options.charset;
|
2478 |
+
if (options.charsetSentinel) {
|
2479 |
+
for (i = 0; i < parts.length; ++i) {
|
2480 |
+
if (parts[i].indexOf('utf8=') === 0) {
|
2481 |
+
if (parts[i] === charsetSentinel) {
|
2482 |
+
charset = 'utf-8';
|
2483 |
+
} else if (parts[i] === isoSentinel) {
|
2484 |
+
charset = 'iso-8859-1';
|
2485 |
+
}
|
2486 |
+
skipIndex = i;
|
2487 |
+
i = parts.length; // The eslint settings do not allow break;
|
2488 |
+
}
|
2489 |
+
}
|
2490 |
+
}
|
2491 |
|
2492 |
+
for (i = 0; i < parts.length; ++i) {
|
2493 |
+
if (i === skipIndex) {
|
2494 |
+
continue;
|
2495 |
+
}
|
2496 |
+
var part = parts[i];
|
2497 |
|
2498 |
+
var bracketEqualsPos = part.indexOf(']=');
|
2499 |
+
var pos = bracketEqualsPos === -1 ? part.indexOf('=') : bracketEqualsPos + 1;
|
2500 |
|
2501 |
+
var key, val;
|
2502 |
+
if (pos === -1) {
|
2503 |
+
key = options.decoder(part, defaults.decoder, charset, 'key');
|
2504 |
+
val = options.strictNullHandling ? null : '';
|
2505 |
+
} else {
|
2506 |
+
key = options.decoder(part.slice(0, pos), defaults.decoder, charset, 'key');
|
2507 |
+
val = maybeMap(
|
2508 |
+
parseArrayValue(part.slice(pos + 1), options),
|
2509 |
+
function (encodedVal) {
|
2510 |
+
return options.decoder(encodedVal, defaults.decoder, charset, 'value');
|
2511 |
+
}
|
2512 |
+
);
|
2513 |
+
}
|
2514 |
|
2515 |
+
if (val && options.interpretNumericEntities && charset === 'iso-8859-1') {
|
2516 |
+
val = interpretNumericEntities(val);
|
2517 |
+
}
|
2518 |
|
2519 |
+
if (part.indexOf('[]=') > -1) {
|
2520 |
+
val = isArray(val) ? [val] : val;
|
2521 |
+
}
|
2522 |
|
2523 |
+
if (has.call(obj, key)) {
|
2524 |
+
obj[key] = utils.combine(obj[key], val);
|
2525 |
+
} else {
|
2526 |
+
obj[key] = val;
|
2527 |
+
}
|
2528 |
+
}
|
2529 |
|
2530 |
+
return obj;
|
2531 |
+
};
|
2532 |
|
2533 |
+
var parseObject = function (chain, val, options, valuesParsed) {
|
2534 |
+
var leaf = valuesParsed ? val : parseArrayValue(val, options);
|
2535 |
|
2536 |
+
for (var i = chain.length - 1; i >= 0; --i) {
|
2537 |
+
var obj;
|
2538 |
+
var root = chain[i];
|
2539 |
|
2540 |
+
if (root === '[]' && options.parseArrays) {
|
2541 |
+
obj = [].concat(leaf);
|
2542 |
+
} else {
|
2543 |
+
obj = options.plainObjects ? Object.create(null) : {};
|
2544 |
+
var cleanRoot = root.charAt(0) === '[' && root.charAt(root.length - 1) === ']' ? root.slice(1, -1) : root;
|
2545 |
+
var index = parseInt(cleanRoot, 10);
|
2546 |
+
if (!options.parseArrays && cleanRoot === '') {
|
2547 |
+
obj = { 0: leaf };
|
2548 |
+
} else if (
|
2549 |
+
!isNaN(index)
|
2550 |
+
&& root !== cleanRoot
|
2551 |
+
&& String(index) === cleanRoot
|
2552 |
+
&& index >= 0
|
2553 |
+
&& (options.parseArrays && index <= options.arrayLimit)
|
2554 |
+
) {
|
2555 |
+
obj = [];
|
2556 |
+
obj[index] = leaf;
|
2557 |
+
} else {
|
2558 |
+
obj[cleanRoot] = leaf;
|
2559 |
+
}
|
2560 |
+
}
|
2561 |
|
2562 |
+
leaf = obj; // eslint-disable-line no-param-reassign
|
2563 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2564 |
|
2565 |
+
return leaf;
|
|
|
|
|
2566 |
};
|
|
|
2567 |
|
2568 |
+
var parseKeys = function parseQueryStringKeys(givenKey, val, options, valuesParsed) {
|
2569 |
+
if (!givenKey) {
|
2570 |
+
return;
|
2571 |
+
}
|
2572 |
|
2573 |
+
// Transform dot notation to bracket notation
|
2574 |
+
var key = options.allowDots ? givenKey.replace(/\.([^.[]+)/g, '[$1]') : givenKey;
|
2575 |
|
2576 |
+
// The regex chunks
|
|
|
2577 |
|
2578 |
+
var brackets = /(\[[^[\]]*])/;
|
2579 |
+
var child = /(\[[^[\]]*])/g;
|
|
|
2580 |
|
2581 |
+
// Get the parent
|
|
|
2582 |
|
2583 |
+
var segment = options.depth > 0 && brackets.exec(key);
|
2584 |
+
var parent = segment ? key.slice(0, segment.index) : key;
|
2585 |
|
2586 |
+
// Stash the parent if it exists
|
2587 |
|
2588 |
+
var keys = [];
|
2589 |
+
if (parent) {
|
2590 |
+
// If we aren't using plain objects, optionally prefix keys that would overwrite object prototype properties
|
2591 |
+
if (!options.plainObjects && has.call(Object.prototype, parent)) {
|
2592 |
+
if (!options.allowPrototypes) {
|
2593 |
+
return;
|
2594 |
+
}
|
2595 |
+
}
|
2596 |
+
|
2597 |
+
keys.push(parent);
|
2598 |
+
}
|
2599 |
+
|
2600 |
+
// Loop through children appending to the array until we hit depth
|
2601 |
+
|
2602 |
+
var i = 0;
|
2603 |
+
while (options.depth > 0 && (segment = child.exec(key)) !== null && i < options.depth) {
|
2604 |
+
i += 1;
|
2605 |
+
if (!options.plainObjects && has.call(Object.prototype, segment[1].slice(1, -1))) {
|
2606 |
+
if (!options.allowPrototypes) {
|
2607 |
+
return;
|
2608 |
+
}
|
2609 |
+
}
|
2610 |
+
keys.push(segment[1]);
|
2611 |
+
}
|
2612 |
+
|
2613 |
+
// If there's a remainder, just add whatever is left
|
2614 |
+
|
2615 |
+
if (segment) {
|
2616 |
+
keys.push('[' + key.slice(segment.index) + ']');
|
2617 |
+
}
|
2618 |
+
|
2619 |
+
return parseObject(keys, val, options, valuesParsed);
|
2620 |
+
};
|
2621 |
+
|
2622 |
+
var normalizeParseOptions = function normalizeParseOptions(opts) {
|
2623 |
+
if (!opts) {
|
2624 |
+
return defaults;
|
2625 |
+
}
|
2626 |
+
|
2627 |
+
if (opts.decoder !== null && opts.decoder !== undefined && typeof opts.decoder !== 'function') {
|
2628 |
+
throw new TypeError('Decoder has to be a function.');
|
2629 |
+
}
|
2630 |
+
|
2631 |
+
if (typeof opts.charset !== 'undefined' && opts.charset !== 'utf-8' && opts.charset !== 'iso-8859-1') {
|
2632 |
+
throw new TypeError('The charset option must be either utf-8, iso-8859-1, or undefined');
|
2633 |
+
}
|
2634 |
+
var charset = typeof opts.charset === 'undefined' ? defaults.charset : opts.charset;
|
2635 |
+
|
2636 |
+
return {
|
2637 |
+
allowDots: typeof opts.allowDots === 'undefined' ? defaults.allowDots : !!opts.allowDots,
|
2638 |
+
allowPrototypes: typeof opts.allowPrototypes === 'boolean' ? opts.allowPrototypes : defaults.allowPrototypes,
|
2639 |
+
arrayLimit: typeof opts.arrayLimit === 'number' ? opts.arrayLimit : defaults.arrayLimit,
|
2640 |
+
charset: charset,
|
2641 |
+
charsetSentinel: typeof opts.charsetSentinel === 'boolean' ? opts.charsetSentinel : defaults.charsetSentinel,
|
2642 |
+
comma: typeof opts.comma === 'boolean' ? opts.comma : defaults.comma,
|
2643 |
+
decoder: typeof opts.decoder === 'function' ? opts.decoder : defaults.decoder,
|
2644 |
+
delimiter: typeof opts.delimiter === 'string' || utils.isRegExp(opts.delimiter) ? opts.delimiter : defaults.delimiter,
|
2645 |
+
// eslint-disable-next-line no-implicit-coercion, no-extra-parens
|
2646 |
+
depth: (typeof opts.depth === 'number' || opts.depth === false) ? +opts.depth : defaults.depth,
|
2647 |
+
ignoreQueryPrefix: opts.ignoreQueryPrefix === true,
|
2648 |
+
interpretNumericEntities: typeof opts.interpretNumericEntities === 'boolean' ? opts.interpretNumericEntities : defaults.interpretNumericEntities,
|
2649 |
+
parameterLimit: typeof opts.parameterLimit === 'number' ? opts.parameterLimit : defaults.parameterLimit,
|
2650 |
+
parseArrays: opts.parseArrays !== false,
|
2651 |
+
plainObjects: typeof opts.plainObjects === 'boolean' ? opts.plainObjects : defaults.plainObjects,
|
2652 |
+
strictNullHandling: typeof opts.strictNullHandling === 'boolean' ? opts.strictNullHandling : defaults.strictNullHandling
|
2653 |
+
};
|
2654 |
+
};
|
2655 |
+
|
2656 |
+
module.exports = function (str, opts) {
|
2657 |
+
var options = normalizeParseOptions(opts);
|
2658 |
+
|
2659 |
+
if (str === '' || str === null || typeof str === 'undefined') {
|
2660 |
+
return options.plainObjects ? Object.create(null) : {};
|
2661 |
+
}
|
2662 |
+
|
2663 |
+
var tempObj = typeof str === 'string' ? parseValues(str, options) : str;
|
2664 |
+
var obj = options.plainObjects ? Object.create(null) : {};
|
2665 |
+
|
2666 |
+
// Iterate over the keys and setup the new object
|
2667 |
+
|
2668 |
+
var keys = Object.keys(tempObj);
|
2669 |
+
for (var i = 0; i < keys.length; ++i) {
|
2670 |
+
var key = keys[i];
|
2671 |
+
var newObj = parseKeys(key, tempObj[key], options, typeof str === 'string');
|
2672 |
+
obj = utils.merge(obj, newObj, options);
|
2673 |
+
}
|
2674 |
+
|
2675 |
+
return utils.compact(obj);
|
2676 |
+
};
|
2677 |
|
|
|
2678 |
|
2679 |
/***/ }),
|
2680 |
|
2681 |
+
/***/ 121:
|
2682 |
+
/***/ (function(module, exports, __webpack_require__) {
|
2683 |
|
2684 |
"use strict";
|
2685 |
+
|
2686 |
+
|
2687 |
+
var keys = Object.keys;
|
|
|
|
|
2688 |
|
2689 |
/**
|
2690 |
+
* Returns true if the two objects are shallow equal, or false otherwise.
|
|
|
2691 |
*
|
2692 |
+
* @param {import('.').ComparableObject} a First object to compare.
|
2693 |
+
* @param {import('.').ComparableObject} b Second object to compare.
|
2694 |
*
|
2695 |
+
* @return {boolean} Whether the two objects are shallow equal.
|
2696 |
*/
|
2697 |
+
function isShallowEqualObjects( a, b ) {
|
2698 |
+
var aKeys, bKeys, i, key, aValue;
|
2699 |
|
2700 |
+
if ( a === b ) {
|
2701 |
+
return true;
|
2702 |
+
}
|
2703 |
|
2704 |
+
aKeys = keys( a );
|
2705 |
+
bKeys = keys( b );
|
2706 |
|
2707 |
+
if ( aKeys.length !== bKeys.length ) {
|
2708 |
+
return false;
|
2709 |
+
}
|
2710 |
|
2711 |
+
i = 0;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2712 |
|
2713 |
+
while ( i < aKeys.length ) {
|
2714 |
+
key = aKeys[ i ];
|
2715 |
+
aValue = a[ key ];
|
2716 |
+
|
2717 |
+
if (
|
2718 |
+
// In iterating only the keys of the first object after verifying
|
2719 |
+
// equal lengths, account for the case that an explicit `undefined`
|
2720 |
+
// value in the first is implicitly undefined in the second.
|
2721 |
+
//
|
2722 |
+
// Example: isShallowEqualObjects( { a: undefined }, { b: 5 } )
|
2723 |
+
( aValue === undefined && ! b.hasOwnProperty( key ) ) ||
|
2724 |
+
aValue !== b[ key ]
|
2725 |
+
) {
|
2726 |
+
return false;
|
2727 |
+
}
|
2728 |
+
|
2729 |
+
i++;
|
2730 |
+
}
|
2731 |
+
|
2732 |
+
return true;
|
2733 |
}
|
2734 |
|
2735 |
+
module.exports = isShallowEqualObjects;
|
2736 |
+
|
2737 |
|
2738 |
/***/ }),
|
2739 |
|
2740 |
+
/***/ 122:
|
2741 |
+
/***/ (function(module, exports, __webpack_require__) {
|
2742 |
|
2743 |
"use strict";
|
2744 |
|
|
|
|
|
|
|
|
|
2745 |
|
2746 |
+
/**
|
2747 |
+
* Returns true if the two arrays are shallow equal, or false otherwise.
|
2748 |
+
*
|
2749 |
+
* @param {any[]} a First array to compare.
|
2750 |
+
* @param {any[]} b Second array to compare.
|
2751 |
+
*
|
2752 |
+
* @return {boolean} Whether the two arrays are shallow equal.
|
2753 |
+
*/
|
2754 |
+
function isShallowEqualArrays( a, b ) {
|
2755 |
+
var i;
|
2756 |
|
2757 |
+
if ( a === b ) {
|
2758 |
+
return true;
|
2759 |
+
}
|
2760 |
|
2761 |
+
if ( a.length !== b.length ) {
|
2762 |
+
return false;
|
2763 |
+
}
|
2764 |
|
2765 |
+
for ( i = 0; i < a.length; i++ ) {
|
2766 |
+
if ( a[ i ] !== b[ i ] ) {
|
2767 |
+
return false;
|
2768 |
+
}
|
2769 |
+
}
|
2770 |
|
2771 |
+
return true;
|
2772 |
+
}
|
|
|
2773 |
|
2774 |
+
module.exports = isShallowEqualArrays;
|
|
|
2775 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2776 |
|
2777 |
+
/***/ }),
|
|
|
|
|
|
|
2778 |
|
2779 |
+
/***/ 123:
|
2780 |
+
/***/ (function(module, exports, __webpack_require__) {
|
2781 |
+
|
2782 |
+
"use strict";
|
2783 |
|
|
|
|
|
|
|
2784 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2785 |
/**
|
2786 |
+
* This is the common logic for both the Node.js and web browser
|
2787 |
+
* implementations of `debug()`.
|
|
|
|
|
|
|
|
|
|
|
2788 |
*/
|
2789 |
+
function setup(env) {
|
2790 |
+
createDebug.debug = createDebug;
|
2791 |
+
createDebug.default = createDebug;
|
2792 |
+
createDebug.coerce = coerce;
|
2793 |
+
createDebug.disable = disable;
|
2794 |
+
createDebug.enable = enable;
|
2795 |
+
createDebug.enabled = enabled;
|
2796 |
+
createDebug.humanize = __webpack_require__(124);
|
2797 |
+
Object.keys(env).forEach(function (key) {
|
2798 |
+
createDebug[key] = env[key];
|
2799 |
});
|
2800 |
+
/**
|
2801 |
+
* Active `debug` instances.
|
2802 |
+
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2803 |
|
2804 |
+
createDebug.instances = [];
|
2805 |
+
/**
|
2806 |
+
* The currently active debug mode names, and names to skip.
|
2807 |
+
*/
|
2808 |
|
2809 |
+
createDebug.names = [];
|
2810 |
+
createDebug.skips = [];
|
2811 |
+
/**
|
2812 |
+
* Map of special "%n" handling functions, for the debug "format" argument.
|
2813 |
+
*
|
2814 |
+
* Valid key names are a single, lower or upper-case letter, i.e. "n" and "N".
|
2815 |
+
*/
|
|
|
2816 |
|
2817 |
+
createDebug.formatters = {};
|
2818 |
+
/**
|
2819 |
+
* Selects a color for a debug namespace
|
2820 |
+
* @param {String} namespace The namespace string for the for the debug instance to be colored
|
2821 |
+
* @return {Number|String} An ANSI color code for the given namespace
|
2822 |
+
* @api private
|
2823 |
+
*/
|
|
|
|
|
|
|
|
|
2824 |
|
2825 |
+
function selectColor(namespace) {
|
2826 |
+
var hash = 0;
|
2827 |
|
2828 |
+
for (var i = 0; i < namespace.length; i++) {
|
2829 |
+
hash = (hash << 5) - hash + namespace.charCodeAt(i);
|
2830 |
+
hash |= 0; // Convert to 32bit integer
|
2831 |
+
}
|
2832 |
|
2833 |
+
return createDebug.colors[Math.abs(hash) % createDebug.colors.length];
|
|
|
2834 |
}
|
2835 |
|
2836 |
+
createDebug.selectColor = selectColor;
|
2837 |
+
/**
|
2838 |
+
* Create a debugger with the given `namespace`.
|
2839 |
+
*
|
2840 |
+
* @param {String} namespace
|
2841 |
+
* @return {Function}
|
2842 |
+
* @api public
|
2843 |
+
*/
|
|
|
2844 |
|
2845 |
+
function createDebug(namespace) {
|
2846 |
+
var prevTime;
|
2847 |
|
2848 |
+
function debug() {
|
2849 |
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
2850 |
+
args[_key] = arguments[_key];
|
2851 |
+
}
|
2852 |
|
2853 |
+
// Disabled?
|
2854 |
+
if (!debug.enabled) {
|
2855 |
+
return;
|
2856 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2857 |
|
2858 |
+
var self = debug; // Set `diff` timestamp
|
2859 |
|
2860 |
+
var curr = Number(new Date());
|
2861 |
+
var ms = curr - (prevTime || curr);
|
2862 |
+
self.diff = ms;
|
2863 |
+
self.prev = prevTime;
|
2864 |
+
self.curr = curr;
|
2865 |
+
prevTime = curr;
|
2866 |
+
args[0] = createDebug.coerce(args[0]);
|
2867 |
|
2868 |
+
if (typeof args[0] !== 'string') {
|
2869 |
+
// Anything else let's inspect with %O
|
2870 |
+
args.unshift('%O');
|
2871 |
+
} // Apply any `formatters` transformations
|
2872 |
|
2873 |
|
2874 |
+
var index = 0;
|
2875 |
+
args[0] = args[0].replace(/%([a-zA-Z%])/g, function (match, format) {
|
2876 |
+
// If we encounter an escaped % then don't increase the array index
|
2877 |
+
if (match === '%%') {
|
2878 |
+
return match;
|
2879 |
+
}
|
2880 |
|
2881 |
+
index++;
|
2882 |
+
var formatter = createDebug.formatters[format];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2883 |
|
2884 |
+
if (typeof formatter === 'function') {
|
2885 |
+
var val = args[index];
|
2886 |
+
match = formatter.call(self, val); // Now we need to remove `args[index]` since it's inlined in the `format`
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2887 |
|
2888 |
+
args.splice(index, 1);
|
2889 |
+
index--;
|
2890 |
+
}
|
2891 |
+
|
2892 |
+
return match;
|
2893 |
+
}); // Apply env-specific formatting (colors, etc.)
|
2894 |
+
|
2895 |
+
createDebug.formatArgs.call(self, args);
|
2896 |
+
var logFn = self.log || createDebug.log;
|
2897 |
+
logFn.apply(self, args);
|
2898 |
}
|
2899 |
|
2900 |
+
debug.namespace = namespace;
|
2901 |
+
debug.enabled = createDebug.enabled(namespace);
|
2902 |
+
debug.useColors = createDebug.useColors();
|
2903 |
+
debug.color = selectColor(namespace);
|
2904 |
+
debug.destroy = destroy;
|
2905 |
+
debug.extend = extend; // Debug.formatArgs = formatArgs;
|
2906 |
+
// debug.rawLog = rawLog;
|
2907 |
+
// env-specific initialization logic for debug instances
|
2908 |
|
2909 |
+
if (typeof createDebug.init === 'function') {
|
2910 |
+
createDebug.init(debug);
|
2911 |
+
}
|
|
|
2912 |
|
2913 |
+
createDebug.instances.push(debug);
|
2914 |
+
return debug;
|
2915 |
+
}
|
|
|
2916 |
|
2917 |
+
function destroy() {
|
2918 |
+
var index = createDebug.instances.indexOf(this);
|
2919 |
|
2920 |
+
if (index !== -1) {
|
2921 |
+
createDebug.instances.splice(index, 1);
|
2922 |
+
return true;
|
2923 |
}
|
2924 |
|
2925 |
+
return false;
|
2926 |
}
|
2927 |
|
2928 |
+
function extend(namespace, delimiter) {
|
2929 |
+
var newDebug = createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace);
|
2930 |
+
newDebug.log = this.log;
|
2931 |
+
return newDebug;
|
2932 |
}
|
2933 |
+
/**
|
2934 |
+
* Enables a debug mode by namespaces. This can include modes
|
2935 |
+
* separated by a colon and wildcards.
|
2936 |
+
*
|
2937 |
+
* @param {String} namespaces
|
2938 |
+
* @api public
|
2939 |
+
*/
|
2940 |
|
|
|
|
|
|
|
|
|
|
|
2941 |
|
2942 |
+
function enable(namespaces) {
|
2943 |
+
createDebug.save(namespaces);
|
2944 |
+
createDebug.names = [];
|
2945 |
+
createDebug.skips = [];
|
2946 |
+
var i;
|
2947 |
+
var split = (typeof namespaces === 'string' ? namespaces : '').split(/[\s,]+/);
|
2948 |
+
var len = split.length;
|
|
|
2949 |
|
2950 |
+
for (i = 0; i < len; i++) {
|
2951 |
+
if (!split[i]) {
|
2952 |
+
// ignore empty strings
|
2953 |
+
continue;
|
2954 |
+
}
|
2955 |
|
2956 |
+
namespaces = split[i].replace(/\*/g, '.*?');
|
|
|
|
|
2957 |
|
2958 |
+
if (namespaces[0] === '-') {
|
2959 |
+
createDebug.skips.push(new RegExp('^' + namespaces.substr(1) + '$'));
|
2960 |
+
} else {
|
2961 |
+
createDebug.names.push(new RegExp('^' + namespaces + '$'));
|
2962 |
+
}
|
2963 |
+
}
|
2964 |
|
2965 |
+
for (i = 0; i < createDebug.instances.length; i++) {
|
2966 |
+
var instance = createDebug.instances[i];
|
2967 |
+
instance.enabled = createDebug.enabled(instance.namespace);
|
2968 |
+
}
|
2969 |
}
|
2970 |
+
/**
|
2971 |
+
* Disable debug output.
|
2972 |
+
*
|
2973 |
+
* @return {String} namespaces
|
2974 |
+
* @api public
|
2975 |
+
*/
|
2976 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2977 |
|
2978 |
+
function disable() {
|
2979 |
+
var namespaces = [].concat(createDebug.names.map(toNamespace), createDebug.skips.map(toNamespace).map(function (namespace) {
|
2980 |
+
return '-' + namespace;
|
2981 |
+
})).join(',');
|
2982 |
+
createDebug.enable('');
|
2983 |
+
return namespaces;
|
2984 |
}
|
2985 |
+
/**
|
2986 |
+
* Returns true if the given mode name is enabled, false otherwise.
|
2987 |
+
*
|
2988 |
+
* @param {String} name
|
2989 |
+
* @return {Boolean}
|
2990 |
+
* @api public
|
2991 |
+
*/
|
2992 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2993 |
|
2994 |
+
function enabled(name) {
|
2995 |
+
if (name[name.length - 1] === '*') {
|
2996 |
+
return true;
|
2997 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2998 |
|
2999 |
+
var i;
|
3000 |
+
var len;
|
|
|
3001 |
|
3002 |
+
for (i = 0, len = createDebug.skips.length; i < len; i++) {
|
3003 |
+
if (createDebug.skips[i].test(name)) {
|
3004 |
+
return false;
|
3005 |
+
}
|
3006 |
+
}
|
3007 |
|
3008 |
+
for (i = 0, len = createDebug.names.length; i < len; i++) {
|
3009 |
+
if (createDebug.names[i].test(name)) {
|
3010 |
+
return true;
|
3011 |
+
}
|
3012 |
}
|
|
|
|
|
3013 |
|
3014 |
+
return false;
|
|
|
3015 |
}
|
3016 |
+
/**
|
3017 |
+
* Convert regexp to namespace
|
3018 |
+
*
|
3019 |
+
* @param {RegExp} regxep
|
3020 |
+
* @return {String} namespace
|
3021 |
+
* @api private
|
3022 |
+
*/
|
3023 |
|
|
|
|
|
|
|
3024 |
|
3025 |
+
function toNamespace(regexp) {
|
3026 |
+
return regexp.toString().substring(2, regexp.toString().length - 2).replace(/\.\*\?$/, '*');
|
3027 |
}
|
3028 |
+
/**
|
3029 |
+
* Coerce `val`.
|
3030 |
+
*
|
3031 |
+
* @param {Mixed} val
|
3032 |
+
* @return {Mixed}
|
3033 |
+
* @api private
|
3034 |
+
*/
|
3035 |
|
|
|
|
|
|
|
3036 |
|
3037 |
+
function coerce(val) {
|
3038 |
+
if (val instanceof Error) {
|
3039 |
+
return val.stack || val.message;
|
3040 |
+
}
|
3041 |
+
|
3042 |
+
return val;
|
3043 |
}
|
3044 |
|
3045 |
+
createDebug.enable(createDebug.load());
|
3046 |
+
return createDebug;
|
3047 |
}
|
|
|
3048 |
|
3049 |
+
module.exports = setup;
|
3050 |
|
3051 |
+
/***/ }),
|
3052 |
+
|
3053 |
+
/***/ 124:
|
3054 |
+
/***/ (function(module, exports) {
|
3055 |
|
|
|
3056 |
/**
|
3057 |
+
* Helpers.
|
|
|
3058 |
*/
|
3059 |
|
3060 |
+
var s = 1000;
|
3061 |
+
var m = s * 60;
|
3062 |
+
var h = m * 60;
|
3063 |
+
var d = h * 24;
|
3064 |
+
var w = d * 7;
|
3065 |
+
var y = d * 365.25;
|
3066 |
+
|
3067 |
/**
|
3068 |
+
* Parse or format the given `val`.
|
3069 |
+
*
|
3070 |
+
* Options:
|
3071 |
+
*
|
3072 |
+
* - `long` verbose formatting [false]
|
3073 |
+
*
|
3074 |
+
* @param {String|Number} val
|
3075 |
+
* @param {Object} [options]
|
3076 |
+
* @throws {Error} throw an error if val is not a non-empty string or a number
|
3077 |
+
* @return {String|Number}
|
3078 |
+
* @api public
|
3079 |
*/
|
3080 |
|
3081 |
+
module.exports = function(val, options) {
|
3082 |
+
options = options || {};
|
3083 |
+
var type = typeof val;
|
3084 |
+
if (type === 'string' && val.length > 0) {
|
3085 |
+
return parse(val);
|
3086 |
+
} else if (type === 'number' && isFinite(val)) {
|
3087 |
+
return options.long ? fmtLong(val) : fmtShort(val);
|
3088 |
}
|
3089 |
+
throw new Error(
|
3090 |
+
'val is not a non-empty string or a valid number. val=' +
|
3091 |
+
JSON.stringify(val)
|
3092 |
+
);
|
3093 |
+
};
|
3094 |
+
|
3095 |
/**
|
3096 |
+
* Parse the given `str` and return milliseconds.
|
3097 |
+
*
|
3098 |
+
* @param {String} str
|
3099 |
+
* @return {Number}
|
3100 |
+
* @api private
|
3101 |
*/
|
3102 |
|
3103 |
+
function parse(str) {
|
3104 |
+
str = String(str);
|
3105 |
+
if (str.length > 100) {
|
3106 |
+
return;
|
3107 |
+
}
|
3108 |
+
var match = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(
|
3109 |
+
str
|
3110 |
+
);
|
3111 |
+
if (!match) {
|
3112 |
+
return;
|
3113 |
+
}
|
3114 |
+
var n = parseFloat(match[1]);
|
3115 |
+
var type = (match[2] || 'ms').toLowerCase();
|
3116 |
+
switch (type) {
|
3117 |
+
case 'years':
|
3118 |
+
case 'year':
|
3119 |
+
case 'yrs':
|
3120 |
+
case 'yr':
|
3121 |
+
case 'y':
|
3122 |
+
return n * y;
|
3123 |
+
case 'weeks':
|
3124 |
+
case 'week':
|
3125 |
+
case 'w':
|
3126 |
+
return n * w;
|
3127 |
+
case 'days':
|
3128 |
+
case 'day':
|
3129 |
+
case 'd':
|
3130 |
+
return n * d;
|
3131 |
+
case 'hours':
|
3132 |
+
case 'hour':
|
3133 |
+
case 'hrs':
|
3134 |
+
case 'hr':
|
3135 |
+
case 'h':
|
3136 |
+
return n * h;
|
3137 |
+
case 'minutes':
|
3138 |
+
case 'minute':
|
3139 |
+
case 'mins':
|
3140 |
+
case 'min':
|
3141 |
+
case 'm':
|
3142 |
+
return n * m;
|
3143 |
+
case 'seconds':
|
3144 |
+
case 'second':
|
3145 |
+
case 'secs':
|
3146 |
+
case 'sec':
|
3147 |
+
case 's':
|
3148 |
+
return n * s;
|
3149 |
+
case 'milliseconds':
|
3150 |
+
case 'millisecond':
|
3151 |
+
case 'msecs':
|
3152 |
+
case 'msec':
|
3153 |
+
case 'ms':
|
3154 |
+
return n;
|
3155 |
+
default:
|
3156 |
+
return undefined;
|
3157 |
+
}
|
3158 |
}
|
3159 |
+
|
3160 |
/**
|
3161 |
+
* Short format for `ms`.
|
3162 |
+
*
|
3163 |
+
* @param {Number} ms
|
3164 |
+
* @return {String}
|
3165 |
+
* @api private
|
3166 |
*/
|
3167 |
|
3168 |
+
function fmtShort(ms) {
|
3169 |
+
var msAbs = Math.abs(ms);
|
3170 |
+
if (msAbs >= d) {
|
3171 |
+
return Math.round(ms / d) + 'd';
|
3172 |
}
|
3173 |
+
if (msAbs >= h) {
|
3174 |
+
return Math.round(ms / h) + 'h';
|
3175 |
+
}
|
3176 |
+
if (msAbs >= m) {
|
3177 |
+
return Math.round(ms / m) + 'm';
|
3178 |
+
}
|
3179 |
+
if (msAbs >= s) {
|
3180 |
+
return Math.round(ms / s) + 's';
|
3181 |
+
}
|
3182 |
+
return ms + 'ms';
|
3183 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
3184 |
|
|
|
|
|
|
|
|
|
|
|
3185 |
/**
|
3186 |
+
* Long format for `ms`.
|
3187 |
+
*
|
3188 |
+
* @param {Number} ms
|
3189 |
+
* @return {String}
|
3190 |
+
* @api private
|
3191 |
*/
|
3192 |
|
3193 |
+
function fmtLong(ms) {
|
3194 |
+
var msAbs = Math.abs(ms);
|
3195 |
+
if (msAbs >= d) {
|
3196 |
+
return plural(ms, msAbs, d, 'day');
|
3197 |
+
}
|
3198 |
+
if (msAbs >= h) {
|
3199 |
+
return plural(ms, msAbs, h, 'hour');
|
3200 |
+
}
|
3201 |
+
if (msAbs >= m) {
|
3202 |
+
return plural(ms, msAbs, m, 'minute');
|
3203 |
+
}
|
3204 |
+
if (msAbs >= s) {
|
3205 |
+
return plural(ms, msAbs, s, 'second');
|
3206 |
+
}
|
3207 |
+
return ms + ' ms';
|
3208 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3209 |
|
|
|
|
|
|
|
3210 |
/**
|
3211 |
+
* Pluralization helper.
|
|
|
|
|
3212 |
*/
|
3213 |
|
3214 |
+
function plural(ms, msAbs, n, name) {
|
3215 |
+
var isPlural = msAbs >= n * 1.5;
|
3216 |
+
return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : '');
|
|
|
|
|
|
|
|
|
3217 |
}
|
|
|
|
|
|
|
|
|
3218 |
|
3219 |
|
3220 |
+
/***/ }),
|
3221 |
|
3222 |
+
/***/ 13:
|
3223 |
+
/***/ (function(module, exports) {
|
3224 |
|
3225 |
+
(function() { module.exports = this["React"]; }());
|
3226 |
|
3227 |
+
/***/ }),
|
3228 |
|
3229 |
+
/***/ 131:
|
3230 |
+
/***/ (function(module, exports) {
|
|
|
3231 |
|
3232 |
+
function _inheritsLoose(subClass, superClass) {
|
3233 |
+
subClass.prototype = Object.create(superClass.prototype);
|
3234 |
+
subClass.prototype.constructor = subClass;
|
3235 |
+
subClass.__proto__ = superClass;
|
3236 |
}
|
3237 |
|
3238 |
+
module.exports = _inheritsLoose;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3239 |
|
3240 |
+
/***/ }),
|
|
|
|
|
3241 |
|
3242 |
+
/***/ 132:
|
3243 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
|
|
|
|
|
|
|
3244 |
|
3245 |
+
"use strict";
|
|
|
|
|
|
|
3246 |
|
3247 |
+
// EXPORTS
|
3248 |
+
__webpack_require__.d(__webpack_exports__, "a", function() { return /* binding */ speak; });
|
3249 |
|
3250 |
+
// UNUSED EXPORTS: setup
|
3251 |
|
3252 |
+
// EXTERNAL MODULE: ./node_modules/@wordpress/dom-ready/build-module/index.js
|
3253 |
+
var build_module = __webpack_require__(72);
|
|
|
3254 |
|
3255 |
+
// EXTERNAL MODULE: external {"this":["wp","i18n"]}
|
3256 |
+
var external_this_wp_i18n_ = __webpack_require__(3);
|
|
|
3257 |
|
3258 |
+
// CONCATENATED MODULE: ./node_modules/@wordpress/a11y/build-module/add-intro-text.js
|
3259 |
+
/**
|
3260 |
+
* WordPress dependencies
|
3261 |
+
*/
|
3262 |
|
3263 |
+
/**
|
3264 |
+
* Build the explanatory text to be placed before the aria live regions.
|
3265 |
+
*
|
3266 |
+
* This text is initially hidden from assistive technologies by using a `hidden`
|
3267 |
+
* HTML attribute which is then removed once a message fills the aria-live regions.
|
3268 |
+
*
|
3269 |
+
* @return {HTMLParagraphElement} The explanatory text HTML element.
|
3270 |
+
*/
|
3271 |
|
3272 |
+
function addIntroText() {
|
3273 |
+
var introText = document.createElement('p');
|
3274 |
+
introText.id = 'a11y-speak-intro-text';
|
3275 |
+
introText.className = 'a11y-speak-intro-text';
|
3276 |
+
introText.textContent = Object(external_this_wp_i18n_["__"])('Notifications');
|
3277 |
+
introText.setAttribute('style', 'position: absolute;' + 'margin: -1px;' + 'padding: 0;' + 'height: 1px;' + 'width: 1px;' + 'overflow: hidden;' + 'clip: rect(1px, 1px, 1px, 1px);' + '-webkit-clip-path: inset(50%);' + 'clip-path: inset(50%);' + 'border: 0;' + 'word-wrap: normal !important;');
|
3278 |
+
introText.setAttribute('hidden', 'hidden');
|
3279 |
+
var _document = document,
|
3280 |
+
body = _document.body;
|
3281 |
|
3282 |
+
if (body) {
|
3283 |
+
body.appendChild(introText);
|
3284 |
+
}
|
3285 |
|
3286 |
+
return introText;
|
3287 |
+
}
|
3288 |
+
//# sourceMappingURL=add-intro-text.js.map
|
3289 |
+
// CONCATENATED MODULE: ./node_modules/@wordpress/a11y/build-module/add-container.js
|
3290 |
+
/**
|
3291 |
+
* Build the live regions markup.
|
3292 |
+
*
|
3293 |
+
* @param {string} [ariaLive] Value for the 'aria-live' attribute; default: 'polite'.
|
3294 |
+
*
|
3295 |
+
* @return {HTMLDivElement} The ARIA live region HTML element.
|
3296 |
+
*/
|
3297 |
+
function addContainer() {
|
3298 |
+
var ariaLive = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'polite';
|
3299 |
+
var container = document.createElement('div');
|
3300 |
+
container.id = "a11y-speak-".concat(ariaLive);
|
3301 |
+
container.className = 'a11y-speak-region';
|
3302 |
+
container.setAttribute('style', 'position: absolute;' + 'margin: -1px;' + 'padding: 0;' + 'height: 1px;' + 'width: 1px;' + 'overflow: hidden;' + 'clip: rect(1px, 1px, 1px, 1px);' + '-webkit-clip-path: inset(50%);' + 'clip-path: inset(50%);' + 'border: 0;' + 'word-wrap: normal !important;');
|
3303 |
+
container.setAttribute('aria-live', ariaLive);
|
3304 |
+
container.setAttribute('aria-relevant', 'additions text');
|
3305 |
+
container.setAttribute('aria-atomic', 'true');
|
3306 |
+
var _document = document,
|
3307 |
+
body = _document.body;
|
3308 |
|
3309 |
+
if (body) {
|
3310 |
+
body.appendChild(container);
|
3311 |
+
}
|
3312 |
|
3313 |
+
return container;
|
3314 |
+
}
|
3315 |
+
//# sourceMappingURL=add-container.js.map
|
3316 |
+
// CONCATENATED MODULE: ./node_modules/@wordpress/a11y/build-module/clear.js
|
3317 |
+
/**
|
3318 |
+
* Clears the a11y-speak-region elements and hides the explanatory text.
|
3319 |
+
*/
|
3320 |
+
function clear() {
|
3321 |
+
var regions = document.getElementsByClassName('a11y-speak-region');
|
3322 |
+
var introText = document.getElementById('a11y-speak-intro-text');
|
3323 |
|
3324 |
+
for (var i = 0; i < regions.length; i++) {
|
3325 |
+
regions[i].textContent = '';
|
3326 |
+
} // Make sure the explanatory text is hidden from assistive technologies.
|
3327 |
|
|
|
|
|
|
|
|
|
|
|
3328 |
|
3329 |
+
if (introText) {
|
3330 |
+
introText.setAttribute('hidden', 'hidden');
|
3331 |
+
}
|
3332 |
+
}
|
3333 |
+
//# sourceMappingURL=clear.js.map
|
3334 |
+
// CONCATENATED MODULE: ./node_modules/@wordpress/a11y/build-module/filter-message.js
|
3335 |
+
var previousMessage = '';
|
3336 |
+
/**
|
3337 |
+
* Filter the message to be announced to the screenreader.
|
3338 |
+
*
|
3339 |
+
* @param {string} message The message to be announced.
|
3340 |
+
*
|
3341 |
+
* @return {string} The filtered message.
|
3342 |
+
*/
|
3343 |
|
3344 |
+
function filterMessage(message) {
|
3345 |
+
/*
|
3346 |
+
* Strip HTML tags (if any) from the message string. Ideally, messages should
|
3347 |
+
* be simple strings, carefully crafted for specific use with A11ySpeak.
|
3348 |
+
* When re-using already existing strings this will ensure simple HTML to be
|
3349 |
+
* stripped out and replaced with a space. Browsers will collapse multiple
|
3350 |
+
* spaces natively.
|
3351 |
+
*/
|
3352 |
+
message = message.replace(/<[^<>]+>/g, ' ');
|
3353 |
+
/*
|
3354 |
+
* Safari + VoiceOver don't announce repeated, identical strings. We use
|
3355 |
+
* a `no-break space` to force them to think identical strings are different.
|
3356 |
+
*/
|
3357 |
|
3358 |
+
if (previousMessage === message) {
|
3359 |
+
message += "\xA0";
|
3360 |
+
}
|
3361 |
|
3362 |
+
previousMessage = message;
|
3363 |
+
return message;
|
3364 |
+
}
|
3365 |
+
//# sourceMappingURL=filter-message.js.map
|
3366 |
+
// CONCATENATED MODULE: ./node_modules/@wordpress/a11y/build-module/index.js
|
3367 |
+
/**
|
3368 |
+
* WordPress dependencies
|
3369 |
+
*/
|
3370 |
|
3371 |
+
/**
|
3372 |
+
* Internal dependencies
|
3373 |
+
*/
|
3374 |
|
|
|
|
|
3375 |
|
|
|
|
|
|
|
|
|
3376 |
|
|
|
3377 |
|
|
|
|
|
3378 |
|
3379 |
+
/**
|
3380 |
+
* Create the live regions.
|
3381 |
+
*/
|
|
|
3382 |
|
3383 |
+
function setup() {
|
3384 |
+
var introText = document.getElementById('a11y-speak-intro-text');
|
3385 |
+
var containerAssertive = document.getElementById('a11y-speak-assertive');
|
3386 |
+
var containerPolite = document.getElementById('a11y-speak-polite');
|
3387 |
|
3388 |
+
if (introText === null) {
|
3389 |
+
addIntroText();
|
3390 |
+
}
|
3391 |
|
3392 |
+
if (containerAssertive === null) {
|
3393 |
+
addContainer('assertive');
|
3394 |
+
}
|
3395 |
|
3396 |
+
if (containerPolite === null) {
|
3397 |
+
addContainer('polite');
|
3398 |
+
}
|
3399 |
+
}
|
3400 |
+
/**
|
3401 |
+
* Run setup on domReady.
|
3402 |
+
*/
|
3403 |
|
3404 |
+
Object(build_module["a" /* default */])(setup);
|
3405 |
+
/**
|
3406 |
+
* Allows you to easily announce dynamic interface updates to screen readers using ARIA live regions.
|
3407 |
+
* This module is inspired by the `speak` function in `wp-a11y.js`.
|
3408 |
+
*
|
3409 |
+
* @param {string} message The message to be announced by assistive technologies.
|
3410 |
+
* @param {string} [ariaLive] The politeness level for aria-live; default: 'polite'.
|
3411 |
+
*
|
3412 |
+
* @example
|
3413 |
+
* ```js
|
3414 |
+
* import { speak } from '@wordpress/a11y';
|
3415 |
+
*
|
3416 |
+
* // For polite messages that shouldn't interrupt what screen readers are currently announcing.
|
3417 |
+
* speak( 'The message you want to send to the ARIA live region' );
|
3418 |
+
*
|
3419 |
+
* // For assertive messages that should interrupt what screen readers are currently announcing.
|
3420 |
+
* speak( 'The message you want to send to the ARIA live region', 'assertive' );
|
3421 |
+
* ```
|
3422 |
+
*/
|
3423 |
|
3424 |
+
function speak(message, ariaLive) {
|
3425 |
+
/*
|
3426 |
+
* Clear previous messages to allow repeated strings being read out and hide
|
3427 |
+
* the explanatory text from assistive technologies.
|
3428 |
+
*/
|
3429 |
+
clear();
|
3430 |
+
message = filterMessage(message);
|
3431 |
+
var introText = document.getElementById('a11y-speak-intro-text');
|
3432 |
+
var containerAssertive = document.getElementById('a11y-speak-assertive');
|
3433 |
+
var containerPolite = document.getElementById('a11y-speak-polite');
|
3434 |
|
3435 |
+
if (containerAssertive && ariaLive === 'assertive') {
|
3436 |
+
containerAssertive.textContent = message;
|
3437 |
+
} else if (containerPolite) {
|
3438 |
+
containerPolite.textContent = message;
|
3439 |
+
}
|
3440 |
+
/*
|
3441 |
+
* Make the explanatory text available to assistive technologies by removing
|
3442 |
+
* the 'hidden' HTML attribute.
|
3443 |
+
*/
|
3444 |
|
|
|
|
|
|
|
3445 |
|
3446 |
+
if (introText) {
|
3447 |
+
introText.removeAttribute('hidden');
|
3448 |
+
}
|
3449 |
+
}
|
3450 |
+
//# sourceMappingURL=index.js.map
|
|
|
|
|
3451 |
|
3452 |
+
/***/ }),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3453 |
|
3454 |
+
/***/ 134:
|
3455 |
+
/***/ (function(module, exports, __webpack_require__) {
|
3456 |
|
3457 |
+
var objectWithoutPropertiesLoose = __webpack_require__(282);
|
3458 |
|
3459 |
+
function _objectWithoutProperties(source, excluded) {
|
3460 |
+
if (source == null) return {};
|
3461 |
+
var target = objectWithoutPropertiesLoose(source, excluded);
|
3462 |
+
var key, i;
|
3463 |
|
3464 |
+
if (Object.getOwnPropertySymbols) {
|
3465 |
+
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
3466 |
|
3467 |
+
for (i = 0; i < sourceSymbolKeys.length; i++) {
|
3468 |
+
key = sourceSymbolKeys[i];
|
3469 |
+
if (excluded.indexOf(key) >= 0) continue;
|
3470 |
+
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
3471 |
+
target[key] = source[key];
|
3472 |
+
}
|
3473 |
+
}
|
3474 |
|
3475 |
+
return target;
|
3476 |
+
}
|
3477 |
|
3478 |
+
module.exports = _objectWithoutProperties;
|
|
|
|
|
|
|
3479 |
|
3480 |
+
/***/ }),
|
3481 |
|
3482 |
+
/***/ 14:
|
3483 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
|
3484 |
|
3485 |
+
"use strict";
|
3486 |
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _objectWithoutProperties; });
|
3487 |
+
/* harmony import */ var _objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(46);
|
3488 |
|
3489 |
+
function _objectWithoutProperties(source, excluded) {
|
3490 |
+
if (source == null) return {};
|
3491 |
+
var target = Object(_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])(source, excluded);
|
3492 |
+
var key, i;
|
3493 |
|
3494 |
+
if (Object.getOwnPropertySymbols) {
|
3495 |
+
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
|
|
|
|
|
|
|
|
|
|
|
3496 |
|
3497 |
+
for (i = 0; i < sourceSymbolKeys.length; i++) {
|
3498 |
+
key = sourceSymbolKeys[i];
|
3499 |
+
if (excluded.indexOf(key) >= 0) continue;
|
3500 |
+
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
3501 |
+
target[key] = source[key];
|
3502 |
+
}
|
3503 |
+
}
|
3504 |
|
3505 |
+
return target;
|
3506 |
+
}
|
3507 |
|
3508 |
+
/***/ }),
|
|
|
|
|
|
|
|
|
|
|
|
|
3509 |
|
3510 |
+
/***/ 15:
|
3511 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
3512 |
|
3513 |
+
"use strict";
|
|
|
|
|
|
|
3514 |
|
3515 |
+
// EXPORTS
|
3516 |
+
__webpack_require__.d(__webpack_exports__, "a", function() { return /* binding */ _toConsumableArray; });
|
|
|
|
|
|
|
3517 |
|
3518 |
+
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js
|
3519 |
+
var arrayLikeToArray = __webpack_require__(31);
|
|
|
3520 |
|
3521 |
+
// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/arrayWithoutHoles.js
|
|
|
3522 |
|
3523 |
+
function _arrayWithoutHoles(arr) {
|
3524 |
+
if (Array.isArray(arr)) return Object(arrayLikeToArray["a" /* default */])(arr);
|
3525 |
+
}
|
3526 |
+
// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/iterableToArray.js
|
3527 |
+
function _iterableToArray(iter) {
|
3528 |
+
if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter);
|
3529 |
+
}
|
3530 |
+
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js
|
3531 |
+
var unsupportedIterableToArray = __webpack_require__(51);
|
3532 |
|
3533 |
+
// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/nonIterableSpread.js
|
3534 |
+
function _nonIterableSpread() {
|
3535 |
+
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
3536 |
+
}
|
3537 |
+
// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js
|
3538 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3539 |
|
|
|
3540 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3541 |
|
3542 |
+
function _toConsumableArray(arr) {
|
3543 |
+
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || Object(unsupportedIterableToArray["a" /* default */])(arr) || _nonIterableSpread();
|
3544 |
+
}
|
3545 |
|
3546 |
+
/***/ }),
|
3547 |
|
3548 |
+
/***/ 156:
|
3549 |
+
/***/ (function(module, exports) {
|
3550 |
|
3551 |
+
function _setPrototypeOf(o, p) {
|
3552 |
+
module.exports = _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
|
3553 |
+
o.__proto__ = p;
|
3554 |
+
return o;
|
3555 |
+
};
|
|
|
|
|
3556 |
|
3557 |
+
return _setPrototypeOf(o, p);
|
3558 |
+
}
|
|
|
|
|
|
|
|
|
3559 |
|
3560 |
+
module.exports = _setPrototypeOf;
|
|
|
3561 |
|
3562 |
+
/***/ }),
|
|
|
|
|
3563 |
|
3564 |
+
/***/ 157:
|
3565 |
+
/***/ (function(module, exports, __webpack_require__) {
|
3566 |
|
3567 |
+
"use strict";
|
3568 |
+
/**
|
3569 |
+
* Copyright (c) 2015-present, Facebook, Inc.
|
3570 |
+
*
|
3571 |
+
* This source code is licensed under the MIT license found in the
|
3572 |
+
* LICENSE file in the root directory of this source tree.
|
3573 |
+
*/
|
3574 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3575 |
|
|
|
|
|
|
|
|
|
3576 |
|
3577 |
+
var React = __webpack_require__(13);
|
|
|
|
|
3578 |
|
3579 |
+
var REACT_ELEMENT_TYPE =
|
3580 |
+
(typeof Symbol === 'function' && Symbol.for && Symbol.for('react.element')) ||
|
3581 |
+
0xeac7;
|
3582 |
|
3583 |
+
var emptyFunction = __webpack_require__(114);
|
3584 |
+
var invariant = __webpack_require__(158);
|
3585 |
+
var warning = __webpack_require__(159);
|
3586 |
|
3587 |
+
var SEPARATOR = '.';
|
3588 |
+
var SUBSEPARATOR = ':';
|
3589 |
|
3590 |
+
var didWarnAboutMaps = false;
|
|
|
|
|
3591 |
|
3592 |
+
var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
|
3593 |
+
var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec.
|
3594 |
|
3595 |
+
function getIteratorFn(maybeIterable) {
|
3596 |
+
var iteratorFn =
|
3597 |
+
maybeIterable &&
|
3598 |
+
((ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL]) ||
|
3599 |
+
maybeIterable[FAUX_ITERATOR_SYMBOL]);
|
3600 |
+
if (typeof iteratorFn === 'function') {
|
3601 |
+
return iteratorFn;
|
3602 |
+
}
|
3603 |
+
}
|
3604 |
|
3605 |
+
function escape(key) {
|
3606 |
+
var escapeRegex = /[=:]/g;
|
3607 |
+
var escaperLookup = {
|
3608 |
+
'=': '=0',
|
3609 |
+
':': '=2'
|
3610 |
};
|
3611 |
+
var escapedString = ('' + key).replace(escapeRegex, function(match) {
|
3612 |
+
return escaperLookup[match];
|
3613 |
+
});
|
3614 |
|
3615 |
+
return '$' + escapedString;
|
3616 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3617 |
|
3618 |
+
function getComponentKey(component, index) {
|
3619 |
+
// Do some typechecking here since we call this blindly. We want to ensure
|
3620 |
+
// that we don't block potential future ES APIs.
|
3621 |
+
if (component && typeof component === 'object' && component.key != null) {
|
3622 |
+
// Explicit key
|
3623 |
+
return escape(component.key);
|
3624 |
+
}
|
3625 |
+
// Implicit key determined by the index in the set
|
3626 |
+
return index.toString(36);
|
3627 |
+
}
|
3628 |
|
3629 |
+
function traverseAllChildrenImpl(
|
3630 |
+
children,
|
3631 |
+
nameSoFar,
|
3632 |
+
callback,
|
3633 |
+
traverseContext
|
3634 |
+
) {
|
3635 |
+
var type = typeof children;
|
3636 |
|
3637 |
+
if (type === 'undefined' || type === 'boolean') {
|
3638 |
+
// All of the above are perceived as null.
|
3639 |
+
children = null;
|
3640 |
}
|
3641 |
|
3642 |
+
if (
|
3643 |
+
children === null ||
|
3644 |
+
type === 'string' ||
|
3645 |
+
type === 'number' ||
|
3646 |
+
// The following is inlined from ReactElement. This means we can optimize
|
3647 |
+
// some checks. React Fiber also inlines this logic for similar purposes.
|
3648 |
+
(type === 'object' && children.$$typeof === REACT_ELEMENT_TYPE)
|
3649 |
+
) {
|
3650 |
+
callback(
|
3651 |
+
traverseContext,
|
3652 |
+
children,
|
3653 |
+
// If it's the only child, treat the name as if it was wrapped in an array
|
3654 |
+
// so that it's consistent if the number of children grows.
|
3655 |
+
nameSoFar === '' ? SEPARATOR + getComponentKey(children, 0) : nameSoFar
|
3656 |
+
);
|
3657 |
+
return 1;
|
3658 |
+
}
|
3659 |
|
3660 |
+
var child;
|
3661 |
+
var nextName;
|
3662 |
+
var subtreeCount = 0; // Count of children found in the current subtree.
|
3663 |
+
var nextNamePrefix = nameSoFar === '' ? SEPARATOR : nameSoFar + SUBSEPARATOR;
|
3664 |
|
3665 |
+
if (Array.isArray(children)) {
|
3666 |
+
for (var i = 0; i < children.length; i++) {
|
3667 |
+
child = children[i];
|
3668 |
+
nextName = nextNamePrefix + getComponentKey(child, i);
|
3669 |
+
subtreeCount += traverseAllChildrenImpl(
|
3670 |
+
child,
|
3671 |
+
nextName,
|
3672 |
+
callback,
|
3673 |
+
traverseContext
|
3674 |
+
);
|
3675 |
+
}
|
3676 |
+
} else {
|
3677 |
+
var iteratorFn = getIteratorFn(children);
|
3678 |
+
if (iteratorFn) {
|
3679 |
+
if (false) {}
|
3680 |
|
3681 |
+
var iterator = iteratorFn.call(children);
|
3682 |
+
var step;
|
3683 |
+
var ii = 0;
|
3684 |
+
while (!(step = iterator.next()).done) {
|
3685 |
+
child = step.value;
|
3686 |
+
nextName = nextNamePrefix + getComponentKey(child, ii++);
|
3687 |
+
subtreeCount += traverseAllChildrenImpl(
|
3688 |
+
child,
|
3689 |
+
nextName,
|
3690 |
+
callback,
|
3691 |
+
traverseContext
|
3692 |
+
);
|
3693 |
+
}
|
3694 |
+
} else if (type === 'object') {
|
3695 |
+
var addendum = '';
|
3696 |
+
if (false) {}
|
3697 |
+
var childrenString = '' + children;
|
3698 |
+
invariant(
|
3699 |
+
false,
|
3700 |
+
'Objects are not valid as a React child (found: %s).%s',
|
3701 |
+
childrenString === '[object Object]'
|
3702 |
+
? 'object with keys {' + Object.keys(children).join(', ') + '}'
|
3703 |
+
: childrenString,
|
3704 |
+
addendum
|
3705 |
+
);
|
3706 |
+
}
|
3707 |
+
}
|
3708 |
|
3709 |
+
return subtreeCount;
|
|
|
|
|
|
|
|
|
|
|
|
|
3710 |
}
|
3711 |
|
3712 |
+
function traverseAllChildren(children, callback, traverseContext) {
|
3713 |
+
if (children == null) {
|
3714 |
+
return 0;
|
3715 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3716 |
|
3717 |
+
return traverseAllChildrenImpl(children, '', callback, traverseContext);
|
3718 |
+
}
|
3719 |
|
3720 |
+
var userProvidedKeyEscapeRegex = /\/+/g;
|
3721 |
+
function escapeUserProvidedKey(text) {
|
3722 |
+
return ('' + text).replace(userProvidedKeyEscapeRegex, '$&/');
|
3723 |
+
}
|
3724 |
|
3725 |
+
function cloneAndReplaceKey(oldElement, newKey) {
|
3726 |
+
return React.cloneElement(
|
3727 |
+
oldElement,
|
3728 |
+
{key: newKey},
|
3729 |
+
oldElement.props !== undefined ? oldElement.props.children : undefined
|
3730 |
+
);
|
3731 |
+
}
|
3732 |
|
3733 |
+
var DEFAULT_POOL_SIZE = 10;
|
3734 |
+
var DEFAULT_POOLER = oneArgumentPooler;
|
3735 |
|
3736 |
+
var oneArgumentPooler = function(copyFieldsFrom) {
|
3737 |
+
var Klass = this;
|
3738 |
+
if (Klass.instancePool.length) {
|
3739 |
+
var instance = Klass.instancePool.pop();
|
3740 |
+
Klass.call(instance, copyFieldsFrom);
|
3741 |
+
return instance;
|
3742 |
+
} else {
|
3743 |
+
return new Klass(copyFieldsFrom);
|
3744 |
+
}
|
3745 |
+
};
|
3746 |
|
3747 |
+
var addPoolingTo = function addPoolingTo(CopyConstructor, pooler) {
|
3748 |
+
// Casting as any so that flow ignores the actual implementation and trusts
|
3749 |
+
// it to match the type we declared
|
3750 |
+
var NewKlass = CopyConstructor;
|
3751 |
+
NewKlass.instancePool = [];
|
3752 |
+
NewKlass.getPooled = pooler || DEFAULT_POOLER;
|
3753 |
+
if (!NewKlass.poolSize) {
|
3754 |
+
NewKlass.poolSize = DEFAULT_POOL_SIZE;
|
3755 |
+
}
|
3756 |
+
NewKlass.release = standardReleaser;
|
3757 |
+
return NewKlass;
|
3758 |
+
};
|
3759 |
|
3760 |
+
var standardReleaser = function standardReleaser(instance) {
|
3761 |
+
var Klass = this;
|
3762 |
+
invariant(
|
3763 |
+
instance instanceof Klass,
|
3764 |
+
'Trying to release an instance into a pool of a different type.'
|
3765 |
+
);
|
3766 |
+
instance.destructor();
|
3767 |
+
if (Klass.instancePool.length < Klass.poolSize) {
|
3768 |
+
Klass.instancePool.push(instance);
|
3769 |
+
}
|
3770 |
+
};
|
3771 |
|
3772 |
+
var fourArgumentPooler = function fourArgumentPooler(a1, a2, a3, a4) {
|
3773 |
+
var Klass = this;
|
3774 |
+
if (Klass.instancePool.length) {
|
3775 |
+
var instance = Klass.instancePool.pop();
|
3776 |
+
Klass.call(instance, a1, a2, a3, a4);
|
3777 |
+
return instance;
|
3778 |
+
} else {
|
3779 |
+
return new Klass(a1, a2, a3, a4);
|
3780 |
+
}
|
3781 |
+
};
|
3782 |
|
3783 |
+
function MapBookKeeping(mapResult, keyPrefix, mapFunction, mapContext) {
|
3784 |
+
this.result = mapResult;
|
3785 |
+
this.keyPrefix = keyPrefix;
|
3786 |
+
this.func = mapFunction;
|
3787 |
+
this.context = mapContext;
|
3788 |
+
this.count = 0;
|
3789 |
}
|
3790 |
+
MapBookKeeping.prototype.destructor = function() {
|
3791 |
+
this.result = null;
|
3792 |
+
this.keyPrefix = null;
|
3793 |
+
this.func = null;
|
3794 |
+
this.context = null;
|
3795 |
+
this.count = 0;
|
3796 |
+
};
|
3797 |
+
addPoolingTo(MapBookKeeping, fourArgumentPooler);
|
3798 |
|
3799 |
+
function mapSingleChildIntoContext(bookKeeping, child, childKey) {
|
3800 |
+
var result = bookKeeping.result;
|
3801 |
+
var keyPrefix = bookKeeping.keyPrefix;
|
3802 |
+
var func = bookKeeping.func;
|
3803 |
+
var context = bookKeeping.context;
|
3804 |
|
3805 |
+
var mappedChild = func.call(context, child, bookKeeping.count++);
|
3806 |
+
if (Array.isArray(mappedChild)) {
|
3807 |
+
mapIntoWithKeyPrefixInternal(
|
3808 |
+
mappedChild,
|
3809 |
+
result,
|
3810 |
+
childKey,
|
3811 |
+
emptyFunction.thatReturnsArgument
|
3812 |
+
);
|
3813 |
+
} else if (mappedChild != null) {
|
3814 |
+
if (React.isValidElement(mappedChild)) {
|
3815 |
+
mappedChild = cloneAndReplaceKey(
|
3816 |
+
mappedChild,
|
3817 |
+
// Keep both the (mapped) and old keys if they differ, just as
|
3818 |
+
// traverseAllChildren used to do for objects as children
|
3819 |
+
keyPrefix +
|
3820 |
+
(mappedChild.key && (!child || child.key !== mappedChild.key)
|
3821 |
+
? escapeUserProvidedKey(mappedChild.key) + '/'
|
3822 |
+
: '') +
|
3823 |
+
childKey
|
3824 |
+
);
|
3825 |
}
|
3826 |
+
result.push(mappedChild);
|
3827 |
}
|
|
|
|
|
3828 |
}
|
|
|
|
|
3829 |
|
3830 |
+
function mapIntoWithKeyPrefixInternal(children, array, prefix, func, context) {
|
3831 |
+
var escapedPrefix = '';
|
3832 |
+
if (prefix != null) {
|
3833 |
+
escapedPrefix = escapeUserProvidedKey(prefix) + '/';
|
3834 |
+
}
|
3835 |
+
var traverseContext = MapBookKeeping.getPooled(
|
3836 |
+
array,
|
3837 |
+
escapedPrefix,
|
3838 |
+
func,
|
3839 |
+
context
|
3840 |
+
);
|
3841 |
+
traverseAllChildren(children, mapSingleChildIntoContext, traverseContext);
|
3842 |
+
MapBookKeeping.release(traverseContext);
|
3843 |
}
|
|
|
|
|
|
|
3844 |
|
3845 |
+
var numericPropertyRegex = /^\d+$/;
|
3846 |
|
3847 |
+
var warnedAboutNumeric = false;
|
|
|
|
|
3848 |
|
3849 |
+
function createReactFragment(object) {
|
3850 |
+
if (typeof object !== 'object' || !object || Array.isArray(object)) {
|
3851 |
+
warning(
|
3852 |
+
false,
|
3853 |
+
'React.addons.createFragment only accepts a single object. Got: %s',
|
3854 |
+
object
|
3855 |
+
);
|
3856 |
+
return object;
|
3857 |
+
}
|
3858 |
+
if (React.isValidElement(object)) {
|
3859 |
+
warning(
|
3860 |
+
false,
|
3861 |
+
'React.addons.createFragment does not accept a ReactElement ' +
|
3862 |
+
'without a wrapper object.'
|
3863 |
+
);
|
3864 |
+
return object;
|
3865 |
+
}
|
3866 |
|
3867 |
+
invariant(
|
3868 |
+
object.nodeType !== 1,
|
3869 |
+
'React.addons.createFragment(...): Encountered an invalid child; DOM ' +
|
3870 |
+
'elements are not valid children of React components.'
|
3871 |
+
);
|
3872 |
|
3873 |
+
var result = [];
|
3874 |
|
3875 |
+
for (var key in object) {
|
3876 |
+
if (false) {}
|
3877 |
+
mapIntoWithKeyPrefixInternal(
|
3878 |
+
object[key],
|
3879 |
+
result,
|
3880 |
+
key,
|
3881 |
+
emptyFunction.thatReturnsArgument
|
3882 |
+
);
|
3883 |
+
}
|
3884 |
|
3885 |
+
return result;
|
3886 |
+
}
|
3887 |
|
3888 |
+
module.exports = createReactFragment;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3889 |
|
|
|
|
|
|
|
|
|
|
|
3890 |
|
3891 |
+
/***/ }),
|
3892 |
|
3893 |
+
/***/ 158:
|
3894 |
+
/***/ (function(module, exports, __webpack_require__) {
|
3895 |
|
3896 |
+
"use strict";
|
3897 |
+
/**
|
3898 |
+
* Copyright (c) 2013-present, Facebook, Inc.
|
3899 |
+
*
|
3900 |
+
* This source code is licensed under the MIT license found in the
|
3901 |
+
* LICENSE file in the root directory of this source tree.
|
3902 |
+
*
|
3903 |
+
*/
|
|
|
|
|
|
|
3904 |
|
|
|
|
|
|
|
|
|
3905 |
|
|
|
3906 |
|
3907 |
+
/**
|
3908 |
+
* Use invariant() to assert state which your program assumes to be true.
|
3909 |
+
*
|
3910 |
+
* Provide sprintf-style format (only %s is supported) and arguments
|
3911 |
+
* to provide information about what broke and what you were
|
3912 |
+
* expecting.
|
3913 |
+
*
|
3914 |
+
* The invariant message will be stripped in production, but the invariant
|
3915 |
+
* will remain to ensure logic does not differ in production.
|
3916 |
+
*/
|
3917 |
|
3918 |
+
var validateFormat = function validateFormat(format) {};
|
|
|
3919 |
|
3920 |
+
if (false) {}
|
|
|
3921 |
|
3922 |
+
function invariant(condition, format, a, b, c, d, e, f) {
|
3923 |
+
validateFormat(format);
|
3924 |
|
3925 |
+
if (!condition) {
|
3926 |
+
var error;
|
3927 |
+
if (format === undefined) {
|
3928 |
+
error = new Error('Minified exception occurred; use the non-minified dev environment ' + 'for the full error message and additional helpful warnings.');
|
3929 |
+
} else {
|
3930 |
+
var args = [a, b, c, d, e, f];
|
3931 |
+
var argIndex = 0;
|
3932 |
+
error = new Error(format.replace(/%s/g, function () {
|
3933 |
+
return args[argIndex++];
|
3934 |
+
}));
|
3935 |
+
error.name = 'Invariant Violation';
|
3936 |
}
|
|
|
3937 |
|
3938 |
+
error.framesToPop = 1; // we don't care about invariant's own frame
|
3939 |
+
throw error;
|
3940 |
+
}
|
3941 |
}
|
3942 |
|
3943 |
+
module.exports = invariant;
|
|
|
3944 |
|
3945 |
/***/ }),
|
3946 |
|
3947 |
+
/***/ 159:
|
3948 |
+
/***/ (function(module, exports, __webpack_require__) {
|
3949 |
|
3950 |
"use strict";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3951 |
/**
|
3952 |
+
* Copyright (c) 2014-present, Facebook, Inc.
|
3953 |
+
*
|
3954 |
+
* This source code is licensed under the MIT license found in the
|
3955 |
+
* LICENSE file in the root directory of this source tree.
|
3956 |
+
*
|
3957 |
*/
|
3958 |
|
3959 |
|
3960 |
|
3961 |
+
var emptyFunction = __webpack_require__(114);
|
|
|
|
|
|
|
3962 |
|
|
|
3963 |
/**
|
3964 |
+
* Similar to invariant but only logs a warning if the condition is not met.
|
3965 |
+
* This can be used to log issues in development environments in critical
|
3966 |
+
* paths. Removing the logging code for production environments will keep the
|
3967 |
+
* same logic and follow the same code paths.
|
3968 |
*/
|
3969 |
|
3970 |
+
var warning = emptyFunction;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3971 |
|
3972 |
+
if (false) { var printWarning; }
|
3973 |
+
|
3974 |
+
module.exports = warning;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3975 |
|
3976 |
/***/ }),
|
3977 |
|
3978 |
+
/***/ 16:
|
3979 |
+
/***/ (function(module, exports) {
|
3980 |
|
3981 |
+
(function() { module.exports = this["moment"]; }());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3982 |
|
3983 |
+
/***/ }),
|
3984 |
|
3985 |
+
/***/ 160:
|
3986 |
+
/***/ (function(module, exports, __webpack_require__) {
|
3987 |
|
3988 |
+
"use strict";
|
3989 |
|
3990 |
|
3991 |
+
function identifyToken(item) {
|
3992 |
+
// {{/example}}
|
3993 |
+
if (item.match(/^\{\{\//)) {
|
3994 |
+
return {
|
3995 |
+
type: 'componentClose',
|
3996 |
+
value: item.replace(/\W/g, '')
|
3997 |
+
};
|
3998 |
+
}
|
3999 |
+
// {{example /}}
|
4000 |
+
if (item.match(/\/\}\}$/)) {
|
4001 |
+
return {
|
4002 |
+
type: 'componentSelfClosing',
|
4003 |
+
value: item.replace(/\W/g, '')
|
4004 |
+
};
|
4005 |
+
}
|
4006 |
+
// {{example}}
|
4007 |
+
if (item.match(/^\{\{/)) {
|
4008 |
+
return {
|
4009 |
+
type: 'componentOpen',
|
4010 |
+
value: item.replace(/\W/g, '')
|
4011 |
+
};
|
4012 |
+
}
|
4013 |
+
return {
|
4014 |
+
type: 'string',
|
4015 |
+
value: item
|
4016 |
+
};
|
4017 |
+
}
|
4018 |
|
4019 |
+
module.exports = function (mixedString) {
|
4020 |
+
var tokenStrings = mixedString.split(/(\{\{\/?\s*\w+\s*\/?\}\})/g); // split to components and strings
|
4021 |
+
return tokenStrings.map(identifyToken);
|
4022 |
+
};
|
4023 |
+
//# sourceMappingURL=tokenize.js.map
|
4024 |
|
4025 |
+
/***/ }),
|
4026 |
|
4027 |
+
/***/ 161:
|
4028 |
+
/***/ (function(module, exports) {
|
4029 |
|
4030 |
+
function _arrayLikeToArray(arr, len) {
|
4031 |
+
if (len == null || len > arr.length) len = arr.length;
|
4032 |
|
4033 |
+
for (var i = 0, arr2 = new Array(len); i < len; i++) {
|
4034 |
+
arr2[i] = arr[i];
|
4035 |
+
}
|
4036 |
|
4037 |
+
return arr2;
|
4038 |
+
}
|
4039 |
|
4040 |
+
module.exports = _arrayLikeToArray;
|
4041 |
+
|
4042 |
+
/***/ }),
|
4043 |
|
4044 |
+
/***/ 17:
|
4045 |
+
/***/ (function(module, exports) {
|
4046 |
|
4047 |
+
function _defineProperty(obj, key, value) {
|
4048 |
+
if (key in obj) {
|
4049 |
+
Object.defineProperty(obj, key, {
|
4050 |
+
value: value,
|
4051 |
+
enumerable: true,
|
4052 |
+
configurable: true,
|
4053 |
+
writable: true
|
4054 |
+
});
|
4055 |
+
} else {
|
4056 |
+
obj[key] = value;
|
4057 |
+
}
|
4058 |
|
4059 |
+
return obj;
|
4060 |
+
}
|
4061 |
|
4062 |
+
module.exports = _defineProperty;
|
|
|
|
|
4063 |
|
4064 |
+
/***/ }),
|
4065 |
|
4066 |
+
/***/ 175:
|
4067 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
4068 |
|
4069 |
+
"use strict";
|
4070 |
+
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2);
|
4071 |
+
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_0__);
|
4072 |
/**
|
4073 |
+
* External dependencies
|
4074 |
*/
|
4075 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4076 |
/**
|
4077 |
+
* Composes multiple higher-order components into a single higher-order component. Performs right-to-left function
|
4078 |
+
* composition, where each successive invocation is supplied the return value of the previous.
|
|
|
4079 |
*
|
4080 |
+
* @param {...Function} hocs The HOC functions to invoke.
|
4081 |
+
*
|
4082 |
+
* @return {Function} Returns the new composite function.
|
4083 |
*/
|
4084 |
|
4085 |
+
/* harmony default export */ __webpack_exports__["a"] = (lodash__WEBPACK_IMPORTED_MODULE_0__["flowRight"]);
|
4086 |
+
//# sourceMappingURL=compose.js.map
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4087 |
|
4088 |
+
/***/ }),
|
4089 |
|
4090 |
+
/***/ 176:
|
4091 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
|
|
|
4092 |
|
4093 |
+
"use strict";
|
|
|
|
|
|
|
|
|
|
|
|
|
4094 |
|
4095 |
+
// EXPORTS
|
4096 |
+
__webpack_require__.d(__webpack_exports__, "a", function() { return /* reexport */ client_ApiClient; });
|
4097 |
+
__webpack_require__.d(__webpack_exports__, "b", function() { return /* reexport */ MINUTE; });
|
4098 |
+
__webpack_require__.d(__webpack_exports__, "c", function() { return /* reexport */ SECOND; });
|
|
|
|
|
|
|
|
|
|
|
4099 |
|
4100 |
+
// UNUSED EXPORTS: HOUR
|
4101 |
|
4102 |
+
// EXTERNAL MODULE: ./node_modules/@babel/runtime/regenerator/index.js
|
4103 |
+
var regenerator = __webpack_require__(77);
|
4104 |
+
var regenerator_default = /*#__PURE__*/__webpack_require__.n(regenerator);
|
|
|
|
|
4105 |
|
4106 |
+
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js
|
4107 |
+
var asyncToGenerator = __webpack_require__(68);
|
|
|
|
|
4108 |
|
4109 |
+
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/extends.js
|
4110 |
+
var esm_extends = __webpack_require__(12);
|
|
|
4111 |
|
4112 |
+
// EXTERNAL MODULE: ./node_modules/debug/src/browser.js
|
4113 |
+
var browser = __webpack_require__(88);
|
4114 |
+
var browser_default = /*#__PURE__*/__webpack_require__.n(browser);
|
|
|
|
|
|
|
4115 |
|
4116 |
+
// EXTERNAL MODULE: external "lodash"
|
4117 |
+
var external_lodash_ = __webpack_require__(2);
|
4118 |
|
4119 |
+
// CONCATENATED MODULE: ./node_modules/@fresh-data/framework/es/client/calculate-updates.js
|
4120 |
+
var DEFAULT_MAX_UPDATE = 30000;
|
4121 |
+
var DEFAULT_MIN_UPDATE = 500;
|
4122 |
+
/**
|
4123 |
+
* Compares requirements against current state for update information.
|
4124 |
+
* Takes a list of requirements and the current state, both keyed by resourceName,
|
4125 |
+
* and returns update information which contains an array of resourceNames that are
|
4126 |
+
* currently needed and when the next update cycle should run, in milleseconds.
|
4127 |
+
* @param {Object} requirementsByResource List of requirements keyed by resourceName.
|
4128 |
+
* @param {Object} resourceState State indexed by resourceName.
|
4129 |
+
* @param {number} [minUpdate] Minimum nextUpdate value.
|
4130 |
+
* @param {number} [maxUpdate] Maximum nextUpdate value.
|
4131 |
+
* @param {Date} [now] Current time (used for tests).
|
4132 |
+
* @return {Object} updateInfo: { nextUpdate, updates }
|
4133 |
+
* @see combineComponentRequirements
|
4134 |
+
*/
|
4135 |
|
4136 |
+
function calculateUpdates(requirementsByResource, resourceState, minUpdate, maxUpdate, now) {
|
4137 |
+
if (minUpdate === void 0) {
|
4138 |
+
minUpdate = DEFAULT_MIN_UPDATE;
|
4139 |
}
|
4140 |
|
4141 |
+
if (maxUpdate === void 0) {
|
4142 |
+
maxUpdate = DEFAULT_MAX_UPDATE;
|
4143 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
4144 |
|
4145 |
+
if (now === void 0) {
|
4146 |
+
now = new Date();
|
|
|
|
|
|
|
4147 |
}
|
4148 |
|
4149 |
+
var updateInfo = {
|
4150 |
+
updates: [],
|
4151 |
+
nextUpdate: maxUpdate
|
|
|
4152 |
};
|
4153 |
+
appendUpdatesForResources(updateInfo, requirementsByResource, resourceState, now);
|
4154 |
+
updateInfo.nextUpdate = Math.max(updateInfo.nextUpdate, minUpdate);
|
4155 |
+
return updateInfo;
|
4156 |
+
}
|
4157 |
+
/**
|
4158 |
+
* Iterates resources to analyze needed updates.
|
4159 |
+
* @param {Object} updateInfo Update information to be mutated by this function.
|
4160 |
+
* @param {Object} requirementsByResource List of requirements keyed by resource.
|
4161 |
+
* @param {Object} resourceState State indexed by resourceName.
|
4162 |
+
* @param {Date} [now] Current time (used for tests).
|
4163 |
+
* @see calculateUpdates
|
4164 |
+
* @see appendUpdatesForResource
|
4165 |
+
*/
|
4166 |
|
4167 |
+
function appendUpdatesForResources(updateInfo, requirementsByResource, resourceState, now) {
|
4168 |
+
Object.keys(requirementsByResource).forEach(function (resourceName) {
|
4169 |
+
var requirements = requirementsByResource[resourceName];
|
4170 |
+
var state = resourceState[resourceName] || {};
|
4171 |
+
appendUpdatesForResource(updateInfo, resourceName, requirements, state, now);
|
4172 |
+
});
|
4173 |
+
}
|
4174 |
+
/**
|
4175 |
+
* Analyzes a resource's requirements against its current state..
|
4176 |
+
* @param {Object} updateInfo Update information to be mutated by this function.
|
4177 |
+
* @param {string} resourceName Name of the resource to be analyzed.
|
4178 |
+
* @param {Object} requirements The requirements for this level of the tree.
|
4179 |
+
* @param {Object} state The current state for this resource.
|
4180 |
+
* @param {Date} [now] Current time (used for tests).
|
4181 |
+
* @see appendUpdatesForResources
|
4182 |
+
*/
|
4183 |
|
|
|
|
|
|
|
4184 |
|
4185 |
+
function appendUpdatesForResource(updateInfo, resourceName, requirements, state, now) {
|
4186 |
+
var lastRequested = state.lastRequested,
|
4187 |
+
lastReceived = state.lastReceived;
|
4188 |
+
var isRequested = lastRequested && (!lastReceived || lastRequested > lastReceived);
|
4189 |
+
var timeoutLeft = getTimeoutLeft(requirements.timeout, state, now);
|
4190 |
+
var freshnessLeft = getFreshnessLeft(requirements.freshness, state, now);
|
4191 |
+
var nextUpdate = isRequested && 0 >= freshnessLeft ? timeoutLeft : freshnessLeft;
|
4192 |
+
updateInfo.nextUpdate = Math.min(updateInfo.nextUpdate, nextUpdate);
|
4193 |
|
4194 |
+
if (nextUpdate < 0) {
|
4195 |
+
updateInfo.updates.push(resourceName);
|
4196 |
+
}
|
4197 |
+
}
|
4198 |
+
/**
|
4199 |
+
* Calculates the remaining time left until a timeout is reached.
|
4200 |
+
* @param {Object} timeout The timeout requirements in milliseconds.
|
4201 |
+
* @param {Object} state The matching state for the resource.
|
4202 |
+
* @param {Date} now Current time (used for tests).
|
4203 |
+
* @return {number} Time left until timeout, or MAX_SAFE_INTEGER if not applicable.
|
4204 |
+
*/
|
4205 |
|
|
|
|
|
|
|
4206 |
|
4207 |
+
function getTimeoutLeft(timeout, state, now) {
|
4208 |
+
var lastRequested = state.lastRequested || Number.MIN_SAFE_INTEGER;
|
4209 |
+
var lastReceived = state.lastReceived || Number.MIN_SAFE_INTEGER;
|
4210 |
|
4211 |
+
if (timeout && lastRequested && lastRequested > lastReceived) {
|
4212 |
+
return timeout - (now - lastRequested);
|
4213 |
+
}
|
4214 |
|
4215 |
+
return Number.MAX_SAFE_INTEGER;
|
4216 |
+
}
|
4217 |
+
/**
|
4218 |
+
* Calculates the time remaining until this data is considered stale.
|
4219 |
+
* @param {Object} freshness The freshness requirements in milliseconds.
|
4220 |
+
* @param {Object} state The matching state for the resource.
|
4221 |
+
* @param {Date} now Current time (used for tests).
|
4222 |
+
* @return {number} Time left until stale, or MAX_SAFE_INTEGER if not applicable.
|
4223 |
+
*/
|
4224 |
|
4225 |
+
function getFreshnessLeft(freshness, state, now) {
|
4226 |
+
var lastReceived = state.lastReceived;
|
4227 |
|
4228 |
+
if (freshness && lastReceived) {
|
4229 |
+
return freshness - (now - lastReceived);
|
4230 |
+
}
|
4231 |
|
4232 |
+
return freshness ? Number.MIN_SAFE_INTEGER : Number.MAX_SAFE_INTEGER;
|
4233 |
+
}
|
4234 |
+
// CONCATENATED MODULE: ./node_modules/@fresh-data/framework/es/devinfo/components.js
|
4235 |
+
/**
|
4236 |
+
* Generates information about components that require resources.
|
4237 |
+
* @param {Object} client The client to inspect.
|
4238 |
+
* @return {Array} An array of objects that describe components and their requirements.
|
4239 |
+
*/
|
4240 |
+
function components_components(client) {
|
4241 |
+
var componentSummaries = [];
|
4242 |
+
client.requirementsByComponent.forEach(function (requirements, component) {
|
4243 |
+
componentSummaries.push({
|
4244 |
+
component: component,
|
4245 |
+
requirements: requirements
|
4246 |
+
});
|
4247 |
+
});
|
4248 |
+
return componentSummaries;
|
4249 |
+
}
|
4250 |
+
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js
|
4251 |
+
var objectWithoutPropertiesLoose = __webpack_require__(46);
|
4252 |
|
4253 |
+
// CONCATENATED MODULE: ./node_modules/@fresh-data/framework/es/devinfo/resources.js
|
|
|
4254 |
|
|
|
|
|
|
|
4255 |
|
|
|
|
|
|
|
4256 |
|
|
|
|
|
4257 |
|
4258 |
+
/**
|
4259 |
+
* Possible statuses of a resource.
|
4260 |
+
*/
|
4261 |
|
4262 |
+
var STATUS = {
|
4263 |
+
overdue: 'overdue',
|
4264 |
+
fetching: 'fetching',
|
4265 |
+
stale: 'stale',
|
4266 |
+
fresh: 'fresh',
|
4267 |
+
notRequired: 'notRequired'
|
4268 |
+
};
|
4269 |
+
/**
|
4270 |
+
* Compiles information about the resources available from a fresh-data client.
|
4271 |
+
* @param {Object} client A fresh-data client to be inspected.
|
4272 |
+
* @return {Object} A list of detailed resource info objects, keyed by resource name.
|
4273 |
+
*/
|
4274 |
|
4275 |
+
function resources_resources(client) {
|
4276 |
+
var resourceState = client.state.resources || {};
|
4277 |
+
var requirements = client.requirementsByResource;
|
4278 |
+
var resourceNames = Object(external_lodash_["union"])(Object.keys(resourceState), Object.keys(requirements));
|
4279 |
+
return resourceNames.reduce(function (resourceInfo, resourceName) {
|
4280 |
+
var resource = resourceState[resourceName] || {};
|
4281 |
+
var data = resource.data;
|
4282 |
+
var status = getStatus(resource, requirements[resourceName]);
|
4283 |
+
var summary = getSummary(status, resource, requirements[resourceName]);
|
4284 |
+
resourceInfo[resourceName] = {
|
4285 |
+
status: status,
|
4286 |
+
summary: summary,
|
4287 |
+
data: data
|
4288 |
+
};
|
4289 |
|
4290 |
+
if (requirements[resourceName]) {
|
4291 |
+
var combinedRequirement = convertRequirement(requirements[resourceName]);
|
4292 |
+
var componentsRequiring = getComponentsForResource(client.requirementsByComponent, resourceName);
|
4293 |
+
resourceInfo[resourceName].combinedRequirement = combinedRequirement;
|
4294 |
+
resourceInfo[resourceName].componentsRequiring = componentsRequiring;
|
4295 |
+
}
|
4296 |
|
4297 |
+
return resourceInfo;
|
4298 |
+
}, {});
|
4299 |
+
}
|
4300 |
|
4301 |
+
function getStatus(resource, requirement) {
|
4302 |
+
if (!requirement) {
|
4303 |
+
return STATUS.notRequired;
|
4304 |
+
}
|
4305 |
|
4306 |
+
var freshness = requirement.freshness,
|
4307 |
+
timeout = requirement.timeout;
|
4308 |
+
var now = new Date();
|
4309 |
+
var freshnessLeft = getFreshnessLeft(freshness, resource, now);
|
4310 |
|
4311 |
+
if (resource && resource.lastRequested > resource.lastReceived) {
|
4312 |
+
var timeoutLeft = getTimeoutLeft(timeout, resource, now);
|
4313 |
|
4314 |
+
if (timeoutLeft < 0) {
|
4315 |
+
return STATUS.overdue;
|
4316 |
+
}
|
4317 |
|
4318 |
+
return STATUS.fetching;
|
|
|
|
|
|
|
|
|
4319 |
}
|
|
|
4320 |
|
4321 |
+
if (freshnessLeft < 0) {
|
4322 |
+
return STATUS.stale;
|
4323 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4324 |
|
4325 |
+
return STATUS.fresh;
|
|
|
4326 |
}
|
4327 |
|
4328 |
+
function getSummary(status, resource, requirement) {
|
4329 |
+
var now = new Date();
|
|
|
|
|
4330 |
|
4331 |
+
switch (status) {
|
4332 |
+
case STATUS.overdue:
|
4333 |
+
var timeout = getTimeoutLeft(requirement.timeout, resource, now);
|
4334 |
+
return "Timed out for " + millisToString(-timeout);
|
4335 |
|
4336 |
+
case STATUS.fetching:
|
4337 |
+
var timeoutLeft = getTimeoutLeft(requirement.timeout, resource, now);
|
4338 |
+
return millisToString(timeoutLeft) + " until timeout";
|
4339 |
|
4340 |
+
case STATUS.stale:
|
4341 |
+
var staleness = getFreshnessLeft(requirement.freshness, resource, now);
|
4342 |
+
return "Stale for " + millisToString(-staleness);
|
|
|
4343 |
|
4344 |
+
case STATUS.fresh:
|
4345 |
+
var freshnessLeft = getFreshnessLeft(requirement.freshness, resource, now);
|
4346 |
+
return "Fresh for " + millisToString(freshnessLeft);
|
4347 |
|
4348 |
+
case STATUS.notRequired:
|
4349 |
+
default:
|
4350 |
+
return 'Resource is not fetched directly.';
|
4351 |
+
}
|
4352 |
+
}
|
4353 |
|
4354 |
+
function convertRequirement(requirement) {
|
4355 |
+
if (requirement === void 0) {
|
4356 |
+
requirement = {};
|
4357 |
+
}
|
4358 |
|
4359 |
+
var _requirement = requirement,
|
4360 |
+
freshness = _requirement.freshness,
|
4361 |
+
timeout = _requirement.timeout,
|
4362 |
+
other = Object(objectWithoutPropertiesLoose["a" /* default */])(_requirement, ["freshness", "timeout"]);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4363 |
|
4364 |
+
return Object(esm_extends["a" /* default */])({
|
4365 |
+
freshness: millisToString(freshness),
|
4366 |
+
timeout: millisToString(timeout)
|
4367 |
+
}, other);
|
4368 |
+
}
|
4369 |
|
4370 |
+
var SECOND_IN_MILLIS = 1000;
|
4371 |
+
var MINUTE_IN_MILLIS = SECOND_IN_MILLIS * 60;
|
4372 |
+
var HOUR_IN_MILLIS = MINUTE_IN_MILLIS * 60;
|
4373 |
|
4374 |
+
function millisToString(millis) {
|
4375 |
+
if (!millis) {
|
4376 |
+
return '';
|
4377 |
+
}
|
4378 |
|
4379 |
+
var hours = Math.floor(millis / HOUR_IN_MILLIS);
|
4380 |
+
millis -= hours * HOUR_IN_MILLIS;
|
4381 |
+
var minutes = Math.floor(millis / MINUTE_IN_MILLIS);
|
4382 |
+
millis -= minutes * MINUTE_IN_MILLIS;
|
4383 |
+
var seconds = millis / SECOND_IN_MILLIS;
|
4384 |
+
var str = '';
|
4385 |
+
str = hours ? hours + " hours " : str;
|
4386 |
+
str = minutes ? "" + str + minutes + " mins " : str;
|
4387 |
+
str = seconds ? "" + str + seconds + " secs " : str;
|
4388 |
+
return str;
|
4389 |
+
}
|
4390 |
|
4391 |
+
function getComponentsForResource(requirementsByComponent, resourceName) {
|
4392 |
+
var components = [];
|
4393 |
+
requirementsByComponent.forEach(function (requirements, component) {
|
4394 |
+
var requirement = Object(external_lodash_["find"])(requirements, {
|
4395 |
+
resourceName: resourceName
|
4396 |
+
});
|
4397 |
|
4398 |
+
if (requirement) {
|
4399 |
+
components.push(component);
|
4400 |
}
|
4401 |
+
});
|
4402 |
+
return components.length ? components : null;
|
4403 |
+
}
|
4404 |
+
// CONCATENATED MODULE: ./node_modules/@fresh-data/framework/es/devinfo/summary.js
|
4405 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4406 |
|
4407 |
+
/**
|
4408 |
+
* A string summary of fresh-data client resources
|
4409 |
+
* @param {Object} resources Resources generated by ./resources.js for a client.
|
4410 |
+
* @return {string} A single-line string summary.
|
4411 |
+
*/
|
|
|
|
|
4412 |
|
4413 |
+
function summary_summary(resources) {
|
4414 |
+
var resourceNames = Object.keys(resources);
|
4415 |
+
var components = [];
|
4416 |
+
var freshCount = 0;
|
4417 |
+
var staleCount = 0;
|
4418 |
+
var timedOutCount = 0;
|
4419 |
+
var fetchingCount = 0;
|
4420 |
+
var notRequiredCount = 0;
|
4421 |
+
resourceNames.forEach(function (resourceName) {
|
4422 |
+
var resource = resources[resourceName];
|
4423 |
+
components = Object(external_lodash_["union"])(components, resource.componentsRequiring);
|
4424 |
|
4425 |
+
switch (resource.status) {
|
4426 |
+
case STATUS.overdue:
|
4427 |
+
timedOutCount++;
|
4428 |
+
break;
|
4429 |
|
4430 |
+
case STATUS.fetching:
|
4431 |
+
fetchingCount++;
|
4432 |
+
break;
|
|
|
|
|
|
|
4433 |
|
4434 |
+
case STATUS.stale:
|
4435 |
+
staleCount++;
|
4436 |
+
break;
|
4437 |
|
4438 |
+
case STATUS.fresh:
|
4439 |
+
freshCount++;
|
4440 |
+
break;
|
4441 |
|
4442 |
+
case STATUS.notRequired:
|
4443 |
+
notRequiredCount++;
|
4444 |
+
}
|
4445 |
+
});
|
4446 |
+
var text = resourceNames.length + " resources, " + components.length + " components ( ";
|
4447 |
|
4448 |
+
if (freshCount) {
|
4449 |
+
text += freshCount + " fresh ";
|
4450 |
+
}
|
4451 |
|
4452 |
+
if (staleCount) {
|
4453 |
+
text += staleCount + " stale ";
|
4454 |
+
}
|
4455 |
|
4456 |
+
if (notRequiredCount) {
|
4457 |
+
text += notRequiredCount + " not required ";
|
4458 |
+
}
|
4459 |
|
4460 |
+
if (timedOutCount) {
|
4461 |
+
text += timedOutCount + " timed out ";
|
4462 |
+
}
|
4463 |
|
4464 |
+
if (fetchingCount) {
|
4465 |
+
text += fetchingCount + " fetching ";
|
4466 |
+
}
|
4467 |
|
4468 |
+
text += ')';
|
4469 |
+
return text;
|
4470 |
+
}
|
4471 |
+
// CONCATENATED MODULE: ./node_modules/@fresh-data/framework/es/devinfo/index.js
|
4472 |
|
4473 |
|
4474 |
|
4475 |
+
var devInfo = {};
|
4476 |
+
/**
|
4477 |
+
* Checks if devInfo is enabled and available.
|
4478 |
+
* @return {boolean} True if dev info is enabled, false if not.
|
4479 |
+
*/
|
4480 |
|
4481 |
+
function isDevInfoEnabled() {
|
4482 |
+
return true === window.__FRESH_DATA_DEV_INFO__;
|
4483 |
+
}
|
4484 |
+
/**
|
4485 |
+
* Called by the ApiClient class to update the dev info data.
|
4486 |
+
* This is called when the client state or requirements change.
|
4487 |
+
* @param {Object} client The client which has been updated.
|
4488 |
+
*/
|
4489 |
|
4490 |
+
function updateDevInfo(client) {
|
4491 |
+
if (isDevInfoEnabled()) {
|
4492 |
+
devInfo[client.getName()] = generateDevInfo(client);
|
4493 |
+
setDevInfoGlobal();
|
4494 |
+
}
|
4495 |
+
}
|
4496 |
+
/**
|
4497 |
+
* Generates the devInfo object for a given client.
|
4498 |
+
* @param {Object} client The client for which the info is generated.
|
4499 |
+
* @return {Object} A devInfo object with summary, resources, and components.
|
4500 |
+
*/
|
4501 |
|
4502 |
+
function generateDevInfo(client) {
|
4503 |
+
var components = components_components(client);
|
4504 |
+
var resources = resources_resources(client);
|
4505 |
+
var summary = summary_summary(resources);
|
4506 |
+
var info = {
|
4507 |
+
summary: summary,
|
4508 |
+
resources: resources,
|
4509 |
+
components: components
|
4510 |
+
};
|
4511 |
+
return info;
|
4512 |
+
}
|
4513 |
+
/**
|
4514 |
+
* Sets the dev info to the global window context.
|
4515 |
+
* This is so it can be referenced by the JavaScript console in the browser.
|
4516 |
+
*/
|
4517 |
|
4518 |
|
4519 |
+
function setDevInfoGlobal() {
|
4520 |
+
if (!window.freshData) {
|
4521 |
+
window.freshData = devInfo;
|
4522 |
+
}
|
4523 |
+
}
|
4524 |
+
// CONCATENATED MODULE: ./node_modules/@fresh-data/framework/es/utils/constants.js
|
4525 |
+
var SECOND = 1000;
|
4526 |
+
var MINUTE = 60 * SECOND;
|
4527 |
+
var HOUR = 60 * MINUTE;
|
4528 |
+
// CONCATENATED MODULE: ./node_modules/@fresh-data/framework/es/client/requirements.js
|
4529 |
|
4530 |
|
4531 |
|
4532 |
+
var DEFAULTS = {
|
4533 |
+
freshness: Number.MAX_SAFE_INTEGER,
|
4534 |
+
timeout: 20 * SECOND
|
4535 |
+
};
|
4536 |
+
/**
|
4537 |
+
* Combines component requirements into a requirements list by resourceName.
|
4538 |
+
* @param {Map} requirementsByComponent Key: Component, Value: requirements parameters with resourceName.
|
4539 |
+
* @return {Object} List of requirements by resource name.
|
4540 |
+
*/
|
4541 |
|
4542 |
+
function combineComponentRequirements(requirementsByComponent) {
|
4543 |
+
var requirementsByResource = {};
|
4544 |
+
requirementsByComponent.forEach(function (requirements) {
|
4545 |
+
requirements.forEach(function (requirement) {
|
4546 |
+
var resourceName = requirement.resourceName,
|
4547 |
+
reqParams = Object(objectWithoutPropertiesLoose["a" /* default */])(requirement, ["resourceName"]);
|
4548 |
|
4549 |
+
addResourceRequirement(requirementsByResource, reqParams, resourceName);
|
4550 |
+
});
|
4551 |
+
});
|
4552 |
+
return requirementsByResource;
|
4553 |
+
}
|
4554 |
+
/**
|
4555 |
+
* Mutates the state of requirementsByResource by adding requirement parameters to it.
|
4556 |
+
* @param {Object} requirementsByResource List of requirements keyed by resourceName.
|
4557 |
+
* @param {Object} reqParams New requirement parameters ( e.g. { freshness: 30 * SECOND } )
|
4558 |
+
* @param {string} resourceName Name of resource being required.
|
4559 |
+
*/
|
4560 |
|
4561 |
+
function addResourceRequirement(requirementsByResource, reqParams, resourceName) {
|
4562 |
+
var requirement = requirementsByResource[resourceName] || Object(esm_extends["a" /* default */])({}, DEFAULTS);
|
|
|
4563 |
|
4564 |
+
addRequirementParams(requirement, reqParams);
|
4565 |
+
requirementsByResource[resourceName] = requirement;
|
4566 |
+
}
|
4567 |
/**
|
4568 |
+
* Merges new requirement parameters into existing ones.
|
4569 |
+
* @param {Object} requirements Contains requirement parameters.
|
4570 |
+
* @param {Object} reqParams New requirement parameters (freshness, timeout), to be merged with existing ones.
|
4571 |
*/
|
4572 |
|
4573 |
+
function addRequirementParams(requirements, reqParams) {
|
4574 |
+
var freshness = requirements.freshness || DEFAULTS.freshness;
|
4575 |
+
var timeout = requirements.timeout || DEFAULTS.timeout;
|
4576 |
+
var newFreshness = reqParams.freshness || Number.MAX_SAFE_INTEGER;
|
4577 |
+
var newTimeout = reqParams.timeout || Number.MAX_SAFE_INTEGER;
|
4578 |
+
requirements.freshness = Math.min(freshness, newFreshness);
|
4579 |
+
requirements.timeout = Math.min(timeout, newTimeout);
|
4580 |
+
}
|
4581 |
+
// CONCATENATED MODULE: ./node_modules/@fresh-data/framework/es/client/index.js
|
4582 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4583 |
|
|
|
|
|
4584 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4585 |
|
|
|
|
|
4586 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4587 |
|
|
|
|
|
4588 |
|
|
|
4589 |
|
4590 |
+
var DEFAULT_READ_OPERATION = 'read';
|
|
|
4591 |
|
4592 |
+
function _setTimer(callback, delay) {
|
4593 |
+
return window.setTimeout(callback, delay);
|
4594 |
+
}
|
|
|
|
|
|
|
4595 |
|
4596 |
+
function _clearTimer(id) {
|
4597 |
+
return window.clearTimeout(id);
|
4598 |
+
}
|
4599 |
+
|
4600 |
+
var client_ApiClient = function ApiClient(apiSpec, setTimer, clearTimer) {
|
4601 |
+
var _this = this;
|
4602 |
+
|
4603 |
+
if (setTimer === void 0) {
|
4604 |
+
setTimer = _setTimer;
|
4605 |
+
}
|
4606 |
+
|
4607 |
+
if (clearTimer === void 0) {
|
4608 |
+
clearTimer = _clearTimer;
|
4609 |
+
}
|
4610 |
+
|
4611 |
+
this.getName = function () {
|
4612 |
+
return _this.name || 'UID_' + _this.uid;
|
4613 |
};
|
4614 |
|
4615 |
+
this.mapOperations = function (apiOperations) {
|
4616 |
+
return Object.keys(apiOperations).reduce(function (operations, operationName) {
|
4617 |
+
operations[operationName] = function (resourceNames, data) {
|
4618 |
+
var apiOperation = apiOperations[operationName];
|
4619 |
+
return _this.applyOperation(apiOperation, resourceNames, data);
|
4620 |
+
};
|
4621 |
+
|
4622 |
+
return operations;
|
4623 |
+
}, {});
|
|
|
4624 |
};
|
4625 |
|
4626 |
+
this.setDataHandlers = function (_ref) {
|
4627 |
+
var dataRequested = _ref.dataRequested,
|
4628 |
+
dataReceived = _ref.dataReceived;
|
4629 |
+
_this.dataHandlers = {
|
4630 |
+
dataRequested: dataRequested,
|
4631 |
+
dataReceived: dataReceived
|
4632 |
+
};
|
4633 |
+
};
|
4634 |
|
4635 |
+
this.setState = function (state, now) {
|
4636 |
+
if (now === void 0) {
|
4637 |
+
now = new Date();
|
4638 |
+
}
|
4639 |
|
4640 |
+
if (_this.state !== state) {
|
4641 |
+
_this.state = state;
|
|
|
4642 |
|
4643 |
+
_this.updateTimer(now);
|
|
|
|
|
|
|
4644 |
|
4645 |
+
_this.subscriptionCallbacks.forEach(function (callback) {
|
4646 |
+
return callback(_this);
|
4647 |
+
});
|
4648 |
|
4649 |
+
updateDevInfo(_this);
|
|
|
4650 |
}
|
4651 |
+
};
|
4652 |
|
4653 |
+
this.subscribe = function (callback) {
|
4654 |
+
if (_this.subscriptionCallbacks.has(callback)) {
|
4655 |
+
_this.debug('Attempting to add a subscription callback twice:', callback);
|
|
|
4656 |
|
4657 |
+
return false;
|
4658 |
+
}
|
4659 |
|
4660 |
+
_this.subscriptionCallbacks.add(callback);
|
4661 |
+
|
4662 |
+
return callback;
|
|
|
|
|
4663 |
};
|
4664 |
|
4665 |
+
this.unsubscribe = function (callback) {
|
4666 |
+
if (!_this.subscriptionCallbacks.has(callback)) {
|
4667 |
+
_this.debug('Attempting to remove a callback that is not subscribed:', callback);
|
4668 |
|
4669 |
+
return false;
|
4670 |
+
}
|
4671 |
|
4672 |
+
_this.subscriptionCallbacks["delete"](callback);
|
|
|
|
|
|
|
4673 |
|
4674 |
+
return callback;
|
4675 |
+
};
|
|
|
4676 |
|
4677 |
+
this.getResource = function (resourceName) {
|
4678 |
+
var resources = _this.state.resources || {};
|
4679 |
+
var resource = resources[resourceName] || {};
|
4680 |
+
return resource;
|
4681 |
+
};
|
4682 |
|
4683 |
+
this.requireResource = function (componentRequirements) {
|
4684 |
+
return function (requirement, resourceName) {
|
4685 |
+
componentRequirements.push(Object(esm_extends["a" /* default */])({}, requirement, {
|
4686 |
+
resourceName: resourceName
|
4687 |
+
}));
|
4688 |
+
return _this.getResource(resourceName);
|
4689 |
+
};
|
4690 |
};
|
4691 |
|
4692 |
+
this.getMutations = function () {
|
4693 |
+
return _this.mutations;
|
4694 |
};
|
4695 |
|
4696 |
+
this.getSelectors = function (componentRequirements) {
|
4697 |
+
return mapFunctions(_this.selectors, _this.getResource, _this.requireResource(componentRequirements));
|
4698 |
};
|
4699 |
|
4700 |
+
this.clearComponentRequirements = function (component, now) {
|
4701 |
+
if (now === void 0) {
|
4702 |
+
now = new Date();
|
4703 |
+
}
|
4704 |
+
|
4705 |
+
_this.requirementsByComponent["delete"](component);
|
4706 |
+
|
4707 |
+
_this.updateRequirementsByResource(now);
|
4708 |
};
|
4709 |
|
4710 |
+
this.setComponentRequirements = function (component, componentRequirements, now) {
|
4711 |
+
if (now === void 0) {
|
4712 |
+
now = new Date();
|
4713 |
+
}
|
4714 |
|
4715 |
+
_this.requirementsByComponent.set(component, componentRequirements);
|
|
|
|
|
4716 |
|
4717 |
+
_this.updateRequirementsByResource(now);
|
4718 |
+
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4719 |
|
4720 |
+
this.setComponentData = function (component, selectorFunc, now) {
|
4721 |
+
if (now === void 0) {
|
4722 |
+
now = new Date();
|
4723 |
+
}
|
4724 |
|
4725 |
+
if (selectorFunc) {
|
4726 |
+
var componentRequirements = [];
|
|
|
|
|
|
|
4727 |
|
4728 |
+
var selectors = _this.getSelectors(componentRequirements);
|
4729 |
|
4730 |
+
selectorFunc(selectors);
|
|
|
|
|
|
|
4731 |
|
4732 |
+
_this.setComponentRequirements(component, componentRequirements, now);
|
4733 |
+
} else {
|
4734 |
+
_this.clearComponentRequirements(component, now);
|
4735 |
+
}
|
4736 |
+
};
|
4737 |
|
4738 |
+
this.updateRequirementsByResource = function (now) {
|
4739 |
+
if (now === void 0) {
|
4740 |
+
now = new Date();
|
4741 |
+
}
|
4742 |
|
4743 |
+
// TODO: Consider using a reducer style function for resource requirements so we don't
|
4744 |
+
// have to do a deep equals check.
|
4745 |
+
var requirementsByResource = combineComponentRequirements(_this.requirementsByComponent);
|
4746 |
|
4747 |
+
if (!Object(external_lodash_["isEqual"])(_this.requirementsByResource, requirementsByResource)) {
|
4748 |
+
_this.requirementsByResource = requirementsByResource;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4749 |
|
4750 |
+
_this.updateTimer(now);
|
|
|
|
|
4751 |
}
|
4752 |
+
};
|
4753 |
|
4754 |
+
this.updateRequirementsData =
|
4755 |
+
/*#__PURE__*/
|
4756 |
+
function () {
|
4757 |
+
var _ref2 = Object(asyncToGenerator["a" /* default */])(
|
4758 |
+
/*#__PURE__*/
|
4759 |
+
regenerator_default.a.mark(function _callee(now) {
|
4760 |
+
var requirementsByComponent, requirementsByResource, state, minUpdate, maxUpdate, resourceState, componentCount, resourceCount, _calculateUpdates, nextUpdate, updates, readOperationName, readOperation;
|
4761 |
|
4762 |
+
return regenerator_default.a.wrap(function _callee$(_context) {
|
4763 |
+
while (1) {
|
4764 |
+
switch (_context.prev = _context.next) {
|
4765 |
+
case 0:
|
4766 |
+
requirementsByComponent = _this.requirementsByComponent, requirementsByResource = _this.requirementsByResource, state = _this.state, minUpdate = _this.minUpdate, maxUpdate = _this.maxUpdate;
|
4767 |
+
resourceState = state.resources || {};
|
4768 |
+
componentCount = requirementsByComponent.size;
|
4769 |
+
resourceCount = Object.keys(requirementsByResource).length;
|
|
|
|
|
4770 |
|
4771 |
+
_this.debug("Updating requirements for " + componentCount + " components and " + resourceCount + " resources.");
|
4772 |
|
4773 |
+
updateDevInfo(_this);
|
|
|
|
|
4774 |
|
4775 |
+
if (Object(external_lodash_["isEmpty"])(requirementsByResource)) {
|
4776 |
+
_context.next = 20;
|
4777 |
+
break;
|
4778 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
4779 |
|
4780 |
+
_calculateUpdates = calculateUpdates(requirementsByResource, resourceState, minUpdate, maxUpdate, now), nextUpdate = _calculateUpdates.nextUpdate, updates = _calculateUpdates.updates;
|
|
|
|
|
|
|
4781 |
|
4782 |
+
if (!(updates && updates.length > 0)) {
|
4783 |
+
_context.next = 15;
|
4784 |
+
break;
|
4785 |
+
}
|
|
|
4786 |
|
4787 |
+
readOperationName = _this.readOperationName;
|
4788 |
+
readOperation = _this.operations[readOperationName];
|
4789 |
|
4790 |
+
if (readOperation) {
|
4791 |
+
_context.next = 13;
|
4792 |
+
break;
|
4793 |
+
}
|
4794 |
|
4795 |
+
throw new Error("Operation \"" + readOperationName + "\" not found.");
|
|
|
|
|
|
|
|
|
4796 |
|
4797 |
+
case 13:
|
4798 |
+
_context.next = 15;
|
4799 |
+
return _this.operations[readOperationName](updates);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4800 |
|
4801 |
+
case 15:
|
4802 |
+
_this.debug("Scheduling next update for " + nextUpdate / 1000 + " seconds.");
|
|
|
|
|
|
|
|
|
|
|
4803 |
|
4804 |
+
updateDevInfo(_this);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4805 |
|
4806 |
+
_this.updateTimer(now, nextUpdate);
|
|
|
|
|
4807 |
|
4808 |
+
_context.next = 21;
|
4809 |
+
break;
|
|
|
|
|
|
|
|
|
|
|
|
|
4810 |
|
4811 |
+
case 20:
|
4812 |
+
if (_this.timeoutId) {
|
4813 |
+
_this.debug('Unscheduling future updates');
|
4814 |
|
4815 |
+
updateDevInfo(_this);
|
|
|
|
|
|
|
4816 |
|
4817 |
+
_this.updateTimer(now, null);
|
4818 |
+
}
|
|
|
4819 |
|
4820 |
+
case 21:
|
4821 |
+
case "end":
|
4822 |
+
return _context.stop();
|
4823 |
+
}
|
4824 |
+
}
|
4825 |
+
}, _callee);
|
4826 |
+
}));
|
4827 |
|
4828 |
+
return function (_x) {
|
4829 |
+
return _ref2.apply(this, arguments);
|
4830 |
+
};
|
4831 |
+
}();
|
4832 |
|
4833 |
+
this.updateTimer = function (now, nextUpdate) {
|
4834 |
+
if (nextUpdate === void 0) {
|
4835 |
+
nextUpdate = undefined;
|
4836 |
+
}
|
|
|
4837 |
|
4838 |
+
var requirementsByResource = _this.requirementsByResource,
|
4839 |
+
state = _this.state,
|
4840 |
+
minUpdate = _this.minUpdate,
|
4841 |
+
maxUpdate = _this.maxUpdate;
|
4842 |
+
var resourceState = state.resources || {};
|
4843 |
|
4844 |
+
if (undefined === nextUpdate) {
|
4845 |
+
nextUpdate = calculateUpdates(requirementsByResource, resourceState, minUpdate, maxUpdate, now).nextUpdate;
|
4846 |
+
}
|
|
|
|
|
4847 |
|
4848 |
+
if (_this.timeoutId) {
|
4849 |
+
_this.clearTimer(_this.timeoutId);
|
|
|
4850 |
|
4851 |
+
_this.timeoutId = null;
|
4852 |
+
}
|
4853 |
+
|
4854 |
+
if (nextUpdate) {
|
4855 |
+
_this.timeoutId = _this.setTimer(_this.updateRequirementsData, nextUpdate);
|
4856 |
+
}
|
4857 |
};
|
4858 |
|
4859 |
+
this.applyOperation =
|
4860 |
+
/*#__PURE__*/
|
4861 |
+
function () {
|
4862 |
+
var _ref3 = Object(asyncToGenerator["a" /* default */])(
|
4863 |
+
/*#__PURE__*/
|
4864 |
+
regenerator_default.a.mark(function _callee3(apiOperation, resourceNames, data) {
|
4865 |
+
var operationResult, values, requests;
|
4866 |
+
return regenerator_default.a.wrap(function _callee3$(_context3) {
|
4867 |
+
while (1) {
|
4868 |
+
switch (_context3.prev = _context3.next) {
|
4869 |
+
case 0:
|
4870 |
+
_context3.prev = 0;
|
4871 |
|
4872 |
+
_this.dataRequested(resourceNames);
|
4873 |
|
4874 |
+
operationResult = apiOperation(resourceNames, data) || [];
|
4875 |
+
values = Object(external_lodash_["isArray"])(operationResult) ? operationResult : [operationResult];
|
4876 |
+
requests = values.map(
|
4877 |
+
/*#__PURE__*/
|
4878 |
+
function () {
|
4879 |
+
var _ref4 = Object(asyncToGenerator["a" /* default */])(
|
4880 |
+
/*#__PURE__*/
|
4881 |
+
regenerator_default.a.mark(function _callee2(value) {
|
4882 |
+
var resources;
|
4883 |
+
return regenerator_default.a.wrap(function _callee2$(_context2) {
|
4884 |
+
while (1) {
|
4885 |
+
switch (_context2.prev = _context2.next) {
|
4886 |
+
case 0:
|
4887 |
+
_context2.next = 2;
|
4888 |
+
return value;
|
4889 |
|
4890 |
+
case 2:
|
4891 |
+
resources = _context2.sent;
|
|
|
|
|
|
|
|
|
4892 |
|
4893 |
+
_this.dataReceived(resources);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4894 |
|
4895 |
+
return _context2.abrupt("return", resources);
|
|
|
|
|
4896 |
|
4897 |
+
case 5:
|
4898 |
+
case "end":
|
4899 |
+
return _context2.stop();
|
4900 |
+
}
|
4901 |
+
}
|
4902 |
+
}, _callee2);
|
4903 |
+
}));
|
4904 |
|
4905 |
+
return function (_x5) {
|
4906 |
+
return _ref4.apply(this, arguments);
|
4907 |
+
};
|
4908 |
+
}());
|
4909 |
+
_context3.next = 7;
|
4910 |
+
return Promise.all(requests);
|
|
|
4911 |
|
4912 |
+
case 7:
|
4913 |
+
return _context3.abrupt("return", _context3.sent);
|
4914 |
|
4915 |
+
case 10:
|
4916 |
+
_context3.prev = 10;
|
4917 |
+
_context3.t0 = _context3["catch"](0);
|
|
|
4918 |
|
4919 |
+
_this.debug('Error caught while applying operation: ', apiOperation);
|
|
|
4920 |
|
4921 |
+
throw _context3.t0;
|
|
|
|
|
4922 |
|
4923 |
+
case 14:
|
4924 |
+
case "end":
|
4925 |
+
return _context3.stop();
|
4926 |
+
}
|
4927 |
+
}
|
4928 |
+
}, _callee3, null, [[0, 10]]);
|
4929 |
+
}));
|
4930 |
|
4931 |
+
return function (_x2, _x3, _x4) {
|
4932 |
+
return _ref3.apply(this, arguments);
|
4933 |
};
|
4934 |
+
}();
|
4935 |
|
4936 |
+
this.dataRequested = function (resourceNames) {
|
4937 |
+
if (!_this.dataHandlers) {
|
4938 |
+
_this.debug('Data requested before dataHandlers set. Disregarding.');
|
4939 |
|
4940 |
+
return;
|
4941 |
+
}
|
|
|
4942 |
|
4943 |
+
_this.dataHandlers.dataRequested(resourceNames);
|
|
|
|
|
4944 |
|
4945 |
+
return resourceNames;
|
4946 |
+
};
|
4947 |
|
4948 |
+
this.dataReceived = function (resources) {
|
4949 |
+
if (!_this.dataHandlers) {
|
4950 |
+
_this.debug('Data received before dataHandlers set. Disregarding.');
|
4951 |
|
4952 |
+
return;
|
4953 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4954 |
|
4955 |
+
_this.dataHandlers.dataReceived(resources);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4956 |
|
4957 |
+
return resources;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4958 |
};
|
4959 |
|
4960 |
+
var _operations = apiSpec.operations,
|
4961 |
+
mutations = apiSpec.mutations,
|
4962 |
+
_selectors = apiSpec.selectors;
|
|
|
4963 |
|
4964 |
+
var _readOperationName = apiSpec.readOperationName || DEFAULT_READ_OPERATION;
|
|
|
|
|
4965 |
|
4966 |
+
this.uid = Object(external_lodash_["uniqueId"])();
|
4967 |
+
this.name = apiSpec.name;
|
4968 |
+
this.debug = browser_default()("fresh-data:api-client[" + this.uid + "]");
|
4969 |
+
this.debug('New ApiClient for apiSpec: ', apiSpec);
|
4970 |
+
this.operations = _operations && this.mapOperations(_operations);
|
4971 |
+
this.mutations = mutations && mapFunctions(mutations, this.operations);
|
4972 |
+
this.selectors = _selectors;
|
4973 |
+
this.readOperationName = _readOperationName;
|
4974 |
+
this.dataHandlers = null;
|
4975 |
+
this.subscriptionCallbacks = new Set();
|
4976 |
+
this.requirementsByComponent = new Map();
|
4977 |
+
this.requirementsByResource = {};
|
4978 |
+
this.minUpdate = DEFAULT_MIN_UPDATE;
|
4979 |
+
this.maxUpdate = DEFAULT_MAX_UPDATE;
|
4980 |
+
this.setTimer = setTimer;
|
4981 |
+
this.clearTimer = clearTimer;
|
4982 |
+
this.timeoutId = null;
|
4983 |
+
this.state = {};
|
4984 |
+
updateDevInfo(this);
|
4985 |
+
};
|
4986 |
|
|
|
|
|
|
|
4987 |
|
|
|
4988 |
|
4989 |
+
function mapFunctions(functionsByName) {
|
4990 |
+
for (var _len = arguments.length, params = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
4991 |
+
params[_key - 1] = arguments[_key];
|
4992 |
+
}
|
4993 |
|
4994 |
+
return Object.keys(functionsByName).reduce(function (mappedFunctions, functionName) {
|
4995 |
+
mappedFunctions[functionName] = functionsByName[functionName].apply(functionsByName, params);
|
4996 |
+
return mappedFunctions;
|
4997 |
+
}, {});
|
4998 |
+
}
|
4999 |
+
// CONCATENATED MODULE: ./node_modules/@fresh-data/framework/es/index.js
|
5000 |
+
/**
|
5001 |
+
* This is the public API of Fresh Data.
|
5002 |
+
* Below are the parts that can be used within your own application
|
5003 |
+
* in order to use Fresh Data with your own APIs.
|
5004 |
+
*/
|
5005 |
+
// Instantiate an ApiClient with a given apiSpec.
|
5006 |
+
// Use these to express requirement times like freshness and timeout.
|
5007 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5008 |
|
|
|
|
|
5009 |
|
5010 |
+
/***/ }),
|
5011 |
|
5012 |
+
/***/ 178:
|
5013 |
+
/***/ (function(module, exports, __webpack_require__) {
|
|
|
5014 |
|
5015 |
+
var arrayLikeToArray = __webpack_require__(161);
|
|
|
5016 |
|
5017 |
+
function _unsupportedIterableToArray(o, minLen) {
|
5018 |
+
if (!o) return;
|
5019 |
+
if (typeof o === "string") return arrayLikeToArray(o, minLen);
|
5020 |
+
var n = Object.prototype.toString.call(o).slice(8, -1);
|
5021 |
+
if (n === "Object" && o.constructor) n = o.constructor.name;
|
5022 |
+
if (n === "Map" || n === "Set") return Array.from(o);
|
5023 |
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return arrayLikeToArray(o, minLen);
|
5024 |
+
}
|
5025 |
|
5026 |
+
module.exports = _unsupportedIterableToArray;
|
|
|
|
|
|
|
|
|
|
|
|
|
5027 |
|
5028 |
+
/***/ }),
|
|
|
5029 |
|
5030 |
+
/***/ 18:
|
5031 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
5032 |
|
5033 |
+
"use strict";
|
|
|
5034 |
|
5035 |
+
// EXPORTS
|
5036 |
+
__webpack_require__.d(__webpack_exports__, "a", function() { return /* binding */ _slicedToArray; });
|
|
|
5037 |
|
5038 |
+
// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js
|
5039 |
+
function _arrayWithHoles(arr) {
|
5040 |
+
if (Array.isArray(arr)) return arr;
|
5041 |
}
|
5042 |
+
// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js
|
5043 |
+
function _iterableToArrayLimit(arr, i) {
|
5044 |
+
if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return;
|
5045 |
+
var _arr = [];
|
5046 |
+
var _n = true;
|
5047 |
+
var _d = false;
|
5048 |
+
var _e = undefined;
|
5049 |
|
5050 |
+
try {
|
5051 |
+
for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
|
5052 |
+
_arr.push(_s.value);
|
|
|
5053 |
|
5054 |
+
if (i && _arr.length === i) break;
|
5055 |
+
}
|
5056 |
+
} catch (err) {
|
5057 |
+
_d = true;
|
5058 |
+
_e = err;
|
5059 |
+
} finally {
|
5060 |
+
try {
|
5061 |
+
if (!_n && _i["return"] != null) _i["return"]();
|
5062 |
+
} finally {
|
5063 |
+
if (_d) throw _e;
|
5064 |
+
}
|
5065 |
+
}
|
5066 |
+
|
5067 |
+
return _arr;
|
5068 |
}
|
5069 |
+
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js
|
5070 |
+
var unsupportedIterableToArray = __webpack_require__(51);
|
5071 |
|
5072 |
+
// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/nonIterableRest.js
|
5073 |
+
function _nonIterableRest() {
|
5074 |
+
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
5075 |
}
|
5076 |
+
// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/slicedToArray.js
|
5077 |
|
|
|
5078 |
|
5079 |
|
|
|
5080 |
|
5081 |
+
function _slicedToArray(arr, i) {
|
5082 |
+
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || Object(unsupportedIterableToArray["a" /* default */])(arr, i) || _nonIterableRest();
|
5083 |
+
}
|
5084 |
|
5085 |
+
/***/ }),
|
|
|
5086 |
|
5087 |
+
/***/ 181:
|
5088 |
+
/***/ (function(module, exports, __webpack_require__) {
|
5089 |
|
5090 |
+
"use strict";
|
|
|
5091 |
|
|
|
|
|
5092 |
|
5093 |
+
if (true) {
|
5094 |
+
module.exports = __webpack_require__(214);
|
5095 |
+
} else {}
|
5096 |
|
|
|
|
|
5097 |
|
5098 |
+
/***/ }),
|
|
|
5099 |
|
5100 |
+
/***/ 19:
|
5101 |
+
/***/ (function(module, exports) {
|
5102 |
|
5103 |
+
(function() { module.exports = this["wp"]["data"]; }());
|
|
|
5104 |
|
5105 |
+
/***/ }),
|
|
|
5106 |
|
5107 |
+
/***/ 199:
|
5108 |
+
/***/ (function(module, exports, __webpack_require__) {
|
5109 |
|
5110 |
+
"use strict";
|
5111 |
|
5112 |
|
5113 |
+
var reactIs = __webpack_require__(181);
|
5114 |
|
5115 |
+
/**
|
5116 |
+
* Copyright 2015, Yahoo! Inc.
|
5117 |
+
* Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.
|
5118 |
+
*/
|
5119 |
+
var REACT_STATICS = {
|
5120 |
+
childContextTypes: true,
|
5121 |
+
contextType: true,
|
5122 |
+
contextTypes: true,
|
5123 |
+
defaultProps: true,
|
5124 |
+
displayName: true,
|
5125 |
+
getDefaultProps: true,
|
5126 |
+
getDerivedStateFromError: true,
|
5127 |
+
getDerivedStateFromProps: true,
|
5128 |
+
mixins: true,
|
5129 |
+
propTypes: true,
|
5130 |
+
type: true
|
5131 |
+
};
|
5132 |
+
var KNOWN_STATICS = {
|
5133 |
+
name: true,
|
5134 |
+
length: true,
|
5135 |
+
prototype: true,
|
5136 |
+
caller: true,
|
5137 |
+
callee: true,
|
5138 |
+
arguments: true,
|
5139 |
+
arity: true
|
5140 |
+
};
|
5141 |
+
var FORWARD_REF_STATICS = {
|
5142 |
+
'$$typeof': true,
|
5143 |
+
render: true,
|
5144 |
+
defaultProps: true,
|
5145 |
+
displayName: true,
|
5146 |
+
propTypes: true
|
5147 |
+
};
|
5148 |
+
var MEMO_STATICS = {
|
5149 |
+
'$$typeof': true,
|
5150 |
+
compare: true,
|
5151 |
+
defaultProps: true,
|
5152 |
+
displayName: true,
|
5153 |
+
propTypes: true,
|
5154 |
+
type: true
|
5155 |
+
};
|
5156 |
+
var TYPE_STATICS = {};
|
5157 |
+
TYPE_STATICS[reactIs.ForwardRef] = FORWARD_REF_STATICS;
|
5158 |
+
TYPE_STATICS[reactIs.Memo] = MEMO_STATICS;
|
5159 |
|
5160 |
+
function getStatics(component) {
|
5161 |
+
// React v16.11 and below
|
5162 |
+
if (reactIs.isMemo(component)) {
|
5163 |
+
return MEMO_STATICS;
|
5164 |
+
} // React v16.12 and above
|
5165 |
|
5166 |
|
5167 |
+
return TYPE_STATICS[component['$$typeof']] || REACT_STATICS;
|
5168 |
+
}
|
5169 |
|
5170 |
+
var defineProperty = Object.defineProperty;
|
5171 |
+
var getOwnPropertyNames = Object.getOwnPropertyNames;
|
5172 |
+
var getOwnPropertySymbols = Object.getOwnPropertySymbols;
|
5173 |
+
var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
|
5174 |
+
var getPrototypeOf = Object.getPrototypeOf;
|
5175 |
+
var objectPrototype = Object.prototype;
|
5176 |
+
function hoistNonReactStatics(targetComponent, sourceComponent, blacklist) {
|
5177 |
+
if (typeof sourceComponent !== 'string') {
|
5178 |
+
// don't hoist over string (html) components
|
5179 |
+
if (objectPrototype) {
|
5180 |
+
var inheritedComponent = getPrototypeOf(sourceComponent);
|
5181 |
|
5182 |
+
if (inheritedComponent && inheritedComponent !== objectPrototype) {
|
5183 |
+
hoistNonReactStatics(targetComponent, inheritedComponent, blacklist);
|
5184 |
+
}
|
5185 |
+
}
|
5186 |
|
5187 |
+
var keys = getOwnPropertyNames(sourceComponent);
|
5188 |
|
5189 |
+
if (getOwnPropertySymbols) {
|
5190 |
+
keys = keys.concat(getOwnPropertySymbols(sourceComponent));
|
5191 |
+
}
|
5192 |
|
5193 |
+
var targetStatics = getStatics(targetComponent);
|
5194 |
+
var sourceStatics = getStatics(sourceComponent);
|
5195 |
|
5196 |
+
for (var i = 0; i < keys.length; ++i) {
|
5197 |
+
var key = keys[i];
|
5198 |
|
5199 |
+
if (!KNOWN_STATICS[key] && !(blacklist && blacklist[key]) && !(sourceStatics && sourceStatics[key]) && !(targetStatics && targetStatics[key])) {
|
5200 |
+
var descriptor = getOwnPropertyDescriptor(sourceComponent, key);
|
|
|
5201 |
|
5202 |
+
try {
|
5203 |
+
// Avoid failures from read-only properties
|
5204 |
+
defineProperty(targetComponent, key, descriptor);
|
5205 |
+
} catch (e) {}
|
5206 |
+
}
|
5207 |
+
}
|
5208 |
+
}
|
5209 |
|
5210 |
+
return targetComponent;
|
5211 |
+
}
|
5212 |
|
5213 |
+
module.exports = hoistNonReactStatics;
|
|
|
|
|
5214 |
|
5215 |
|
5216 |
+
/***/ }),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5217 |
|
5218 |
+
/***/ 2:
|
5219 |
+
/***/ (function(module, exports) {
|
|
|
|
|
|
|
5220 |
|
5221 |
+
(function() { module.exports = this["lodash"]; }());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5222 |
|
5223 |
+
/***/ }),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5224 |
|
5225 |
+
/***/ 20:
|
5226 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5227 |
|
5228 |
+
"use strict";
|
5229 |
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return ADMIN_URL; });
|
5230 |
+
/* unused harmony export COUNTRIES */
|
5231 |
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return CURRENCY; });
|
5232 |
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return LOCALE; });
|
5233 |
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return ORDER_STATUSES; });
|
5234 |
+
/* unused harmony export SITE_TITLE */
|
5235 |
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return WC_ASSET_URL; });
|
5236 |
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "g", function() { return getSetting; });
|
5237 |
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "h", function() { return setSetting; });
|
5238 |
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return getAdminLink; });
|
5239 |
+
/* harmony import */ var _babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(34);
|
5240 |
+
/* harmony import */ var _babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_0__);
|
5241 |
+
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(3);
|
5242 |
+
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__);
|
|
|
|
|
|
|
|
|
|
|
|
|
5243 |
|
|
|
|
|
|
|
5244 |
|
5245 |
+
/**
|
5246 |
+
* External dependencies
|
5247 |
+
*/
|
5248 |
+
// Remove mutable data from settings object to prevent access. Data stores should be used instead.
|
|
|
5249 |
|
5250 |
+
var mutableSources = ['wcAdminSettings', 'preloadSettings'];
|
5251 |
+
var settings = (typeof wcSettings === "undefined" ? "undefined" : _babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_0___default()(wcSettings)) === 'object' ? wcSettings : {};
|
5252 |
+
var SOURCE = Object.keys(settings).reduce(function (source, key) {
|
5253 |
+
if (!mutableSources.includes(key)) {
|
5254 |
+
source[key] = settings[key];
|
|
|
|
|
5255 |
}
|
5256 |
|
5257 |
+
return source;
|
5258 |
+
}, {});
|
5259 |
+
var ADMIN_URL = SOURCE.adminUrl;
|
5260 |
+
var COUNTRIES = SOURCE.countries;
|
5261 |
+
var CURRENCY = SOURCE.currency;
|
5262 |
+
var LOCALE = SOURCE.locale;
|
5263 |
+
var ORDER_STATUSES = SOURCE.orderStatuses;
|
5264 |
+
var SITE_TITLE = SOURCE.siteTitle;
|
5265 |
+
var WC_ASSET_URL = SOURCE.wcAssetUrl;
|
5266 |
+
/**
|
5267 |
+
* Retrieves a setting value from the setting state.
|
5268 |
+
*
|
5269 |
+
* @export
|
5270 |
+
* @param {string} name The identifier for the setting.
|
5271 |
+
* @param {*} [fallback=false] The value to use as a fallback
|
5272 |
+
* if the setting is not in the
|
5273 |
+
* state.
|
5274 |
+
* @param {Function} [filter=( val ) => val] A callback for filtering the
|
5275 |
+
* value before it's returned.
|
5276 |
+
* Receives both the found value
|
5277 |
+
* (if it exists for the key) and
|
5278 |
+
* the provided fallback arg.
|
5279 |
+
*
|
5280 |
+
* @return {*} The value present in the settings state for the given
|
5281 |
+
* name.
|
5282 |
+
*/
|
5283 |
|
5284 |
+
function getSetting(name) {
|
5285 |
+
var fallback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
5286 |
+
var filter = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : function (val) {
|
5287 |
+
return val;
|
5288 |
+
};
|
5289 |
|
5290 |
+
if (mutableSources.includes(name)) {
|
5291 |
+
throw new Error(Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__["__"])('Mutable settings should be accessed via data store.'));
|
5292 |
}
|
5293 |
|
5294 |
+
var value = SOURCE.hasOwnProperty(name) ? SOURCE[name] : fallback;
|
5295 |
+
return filter(value, fallback);
|
5296 |
+
}
|
5297 |
+
/**
|
5298 |
+
* Sets a value to a property on the settings state.
|
5299 |
+
*
|
5300 |
+
* NOTE: This feature is to be removed in favour of data stores when a full migration
|
5301 |
+
* is complete.
|
5302 |
+
*
|
5303 |
+
* @deprecated
|
5304 |
+
*
|
5305 |
+
* @export
|
5306 |
+
* @param {string} name The setting property key for the
|
5307 |
+
* setting being mutated.
|
5308 |
+
* @param {*} value The value to set.
|
5309 |
+
* @param {Function} [filter=( val ) => val] Allows for providing a callback
|
5310 |
+
* to sanitize the setting (eg.
|
5311 |
+
* ensure it's a number)
|
5312 |
+
*/
|
5313 |
|
5314 |
+
function setSetting(name, value) {
|
5315 |
+
var filter = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : function (val) {
|
5316 |
+
return val;
|
5317 |
+
};
|
|
|
|
|
|
|
|
|
|
|
|
|
5318 |
|
5319 |
+
if (mutableSources.includes(name)) {
|
5320 |
+
throw new Error(Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__["__"])('Mutable settings should be mutated via data store.'));
|
5321 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5322 |
|
5323 |
+
SOURCE[name] = filter(value);
|
5324 |
+
}
|
5325 |
/**
|
5326 |
+
* Returns a string with the site's wp-admin URL appended. JS version of `admin_url`.
|
|
|
5327 |
*
|
5328 |
+
* @param {string} path Relative path.
|
5329 |
+
* @return {string} Full admin URL.
|
|
|
5330 |
*/
|
5331 |
|
5332 |
+
function getAdminLink(path) {
|
5333 |
+
return (ADMIN_URL || '') + path;
|
5334 |
+
}
|
5335 |
|
5336 |
+
/***/ }),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5337 |
|
5338 |
+
/***/ 201:
|
5339 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
5340 |
|
5341 |
+
"use strict";
|
5342 |
+
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(3);
|
5343 |
+
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__);
|
5344 |
+
/* harmony import */ var _wordpress_hooks__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(44);
|
5345 |
+
/* harmony import */ var _wordpress_hooks__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_hooks__WEBPACK_IMPORTED_MODULE_1__);
|
5346 |
+
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(0);
|
5347 |
+
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__);
|
5348 |
+
/* harmony import */ var _settings__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(20);
|
5349 |
+
/* harmony import */ var _index__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(202);
|
5350 |
+
/**
|
5351 |
+
* External dependencies
|
5352 |
+
*/
|
5353 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5354 |
|
5355 |
|
5356 |
+
/**
|
5357 |
+
* WooCommerce dependencies
|
5358 |
+
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5359 |
|
|
|
|
|
5360 |
|
5361 |
+
var manageStock = Object(_settings__WEBPACK_IMPORTED_MODULE_3__[/* getSetting */ "g"])('manageStock', 'no');
|
5362 |
+
/**
|
5363 |
+
* Internal dependencies
|
5364 |
+
*/
|
|
|
|
|
|
|
5365 |
|
5366 |
+
var RevenueReport = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["lazy"])(function () {
|
5367 |
+
return Promise.all(/* import() | analytics-report-revenue */[__webpack_require__.e(1), __webpack_require__.e(3), __webpack_require__.e(0), __webpack_require__.e(19)]).then(__webpack_require__.bind(null, 749));
|
5368 |
+
});
|
5369 |
+
var ProductsReport = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["lazy"])(function () {
|
5370 |
+
return Promise.all(/* import() | analytics-report-products */[__webpack_require__.e(1), __webpack_require__.e(3), __webpack_require__.e(0), __webpack_require__.e(8), __webpack_require__.e(18)]).then(__webpack_require__.bind(null, 748));
|
5371 |
+
});
|
5372 |
+
var OrdersReport = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["lazy"])(function () {
|
5373 |
+
return Promise.all(/* import() | analytics-report-orders */[__webpack_require__.e(1), __webpack_require__.e(3), __webpack_require__.e(0), __webpack_require__.e(17)]).then(__webpack_require__.bind(null, 750));
|
5374 |
+
});
|
5375 |
+
var CategoriesReport = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["lazy"])(function () {
|
5376 |
+
return Promise.all(/* import() | analytics-report-categories */[__webpack_require__.e(1), __webpack_require__.e(3), __webpack_require__.e(0), __webpack_require__.e(8), __webpack_require__.e(13)]).then(__webpack_require__.bind(null, 744));
|
5377 |
+
});
|
5378 |
+
var CouponsReport = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["lazy"])(function () {
|
5379 |
+
return Promise.all(/* import() | analytics-report-coupons */[__webpack_require__.e(1), __webpack_require__.e(3), __webpack_require__.e(0), __webpack_require__.e(14)]).then(__webpack_require__.bind(null, 746));
|
5380 |
+
});
|
5381 |
+
var TaxesReport = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["lazy"])(function () {
|
5382 |
+
return Promise.all(/* import() | analytics-report-taxes */[__webpack_require__.e(1), __webpack_require__.e(3), __webpack_require__.e(0), __webpack_require__.e(21)]).then(__webpack_require__.bind(null, 747));
|
5383 |
+
});
|
5384 |
+
var DownloadsReport = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["lazy"])(function () {
|
5385 |
+
return Promise.all(/* import() | analytics-report-downloads */[__webpack_require__.e(1), __webpack_require__.e(3), __webpack_require__.e(0), __webpack_require__.e(16)]).then(__webpack_require__.bind(null, 751));
|
5386 |
+
});
|
5387 |
+
var StockReport = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["lazy"])(function () {
|
5388 |
+
return Promise.all(/* import() | analytics-report-stock */[__webpack_require__.e(1), __webpack_require__.e(0), __webpack_require__.e(20)]).then(__webpack_require__.bind(null, 743));
|
5389 |
+
});
|
5390 |
+
var CustomersReport = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["lazy"])(function () {
|
5391 |
+
return Promise.all(/* import() | analytics-report-customers */[__webpack_require__.e(1), __webpack_require__.e(0), __webpack_require__.e(15)]).then(__webpack_require__.bind(null, 745));
|
5392 |
+
});
|
5393 |
|
5394 |
+
/* harmony default export */ __webpack_exports__["a"] = (function () {
|
5395 |
+
var reports = [{
|
5396 |
+
report: 'revenue',
|
5397 |
+
title: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__["__"])('Revenue', 'woocommerce-admin'),
|
5398 |
+
component: RevenueReport
|
5399 |
+
}, {
|
5400 |
+
report: 'products',
|
5401 |
+
title: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__["__"])('Products', 'woocommerce-admin'),
|
5402 |
+
component: ProductsReport
|
5403 |
+
}, {
|
5404 |
+
report: 'orders',
|
5405 |
+
title: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__["__"])('Orders', 'woocommerce-admin'),
|
5406 |
+
component: OrdersReport
|
5407 |
+
}, {
|
5408 |
+
report: 'categories',
|
5409 |
+
title: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__["__"])('Categories', 'woocommerce-admin'),
|
5410 |
+
component: CategoriesReport
|
5411 |
+
}, {
|
5412 |
+
report: 'coupons',
|
5413 |
+
title: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__["__"])('Coupons', 'woocommerce-admin'),
|
5414 |
+
component: CouponsReport
|
5415 |
+
}, {
|
5416 |
+
report: 'taxes',
|
5417 |
+
title: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__["__"])('Taxes', 'woocommerce-admin'),
|
5418 |
+
component: TaxesReport
|
5419 |
+
}, {
|
5420 |
+
report: 'downloads',
|
5421 |
+
title: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__["__"])('Downloads', 'woocommerce-admin'),
|
5422 |
+
component: DownloadsReport
|
5423 |
+
}, manageStock === 'yes' ? {
|
5424 |
+
report: 'stock',
|
5425 |
+
title: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__["__"])('Stock', 'woocommerce-admin'),
|
5426 |
+
component: StockReport
|
5427 |
+
} : null, {
|
5428 |
+
report: 'customers',
|
5429 |
+
title: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__["__"])('Customers', 'woocommerce-admin'),
|
5430 |
+
component: CustomersReport
|
5431 |
+
}, {
|
5432 |
+
report: 'downloads',
|
5433 |
+
title: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__["__"])('Downloads', 'woocommerce-admin'),
|
5434 |
+
component: DownloadsReport
|
5435 |
+
}].filter(Boolean);
|
5436 |
+
return Object(_wordpress_hooks__WEBPACK_IMPORTED_MODULE_1__["applyFilters"])(_index__WEBPACK_IMPORTED_MODULE_4__["REPORTS_FILTER"], reports);
|
5437 |
+
});
|
5438 |
|
5439 |
+
/***/ }),
|
|
|
5440 |
|
5441 |
+
/***/ 202:
|
5442 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
5443 |
|
5444 |
+
"use strict";
|
5445 |
+
__webpack_require__.r(__webpack_exports__);
|
5446 |
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "REPORTS_FILTER", function() { return REPORTS_FILTER; });
|
5447 |
+
/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(17);
|
5448 |
+
/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__);
|
5449 |
+
/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(42);
|
5450 |
+
/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1__);
|
5451 |
+
/* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(41);
|
5452 |
+
/* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_2__);
|
5453 |
+
/* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(43);
|
5454 |
+
/* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_3__);
|
5455 |
+
/* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(47);
|
5456 |
+
/* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_4__);
|
5457 |
+
/* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(28);
|
5458 |
+
/* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_5__);
|
5459 |
+
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(0);
|
5460 |
+
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__);
|
5461 |
+
/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(175);
|
5462 |
+
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(1);
|
5463 |
+
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_8__);
|
5464 |
+
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(2);
|
5465 |
+
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_9__);
|
5466 |
+
/* harmony import */ var _woocommerce_components__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(55);
|
5467 |
+
/* harmony import */ var _woocommerce_components__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(_woocommerce_components__WEBPACK_IMPORTED_MODULE_10__);
|
5468 |
+
/* harmony import */ var _woocommerce_navigation__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(23);
|
5469 |
+
/* harmony import */ var _woocommerce_navigation__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(_woocommerce_navigation__WEBPACK_IMPORTED_MODULE_11__);
|
5470 |
+
/* harmony import */ var _style_scss__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(451);
|
5471 |
+
/* harmony import */ var _style_scss__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(_style_scss__WEBPACK_IMPORTED_MODULE_12__);
|
5472 |
+
/* harmony import */ var analytics_components_report_error__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(267);
|
5473 |
+
/* harmony import */ var wc_api_items_utils__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(283);
|
5474 |
+
/* harmony import */ var wc_api_with_select__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(104);
|
5475 |
+
/* harmony import */ var lib_currency_context__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(204);
|
5476 |
+
/* harmony import */ var _get_reports__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(201);
|
5477 |
|
|
|
|
|
5478 |
|
|
|
|
|
5479 |
|
|
|
|
|
|
|
5480 |
|
|
|
|
|
|
|
5481 |
|
|
|
|
|
5482 |
|
|
|
5483 |
|
5484 |
|
5485 |
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
|
|
|
|
5486 |
|
5487 |
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
5488 |
|
5489 |
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_5___default()(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_5___default()(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_4___default()(this, result); }; }
|
5490 |
|
5491 |
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
|
5492 |
+
|
5493 |
+
/**
|
5494 |
+
* External dependencies
|
5495 |
+
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
5496 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5497 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5498 |
|
|
|
|
|
5499 |
|
|
|
5500 |
/**
|
5501 |
* WooCommerce dependencies
|
5502 |
*/
|
5503 |
|
5504 |
+
|
5505 |
+
|
5506 |
/**
|
5507 |
* Internal dependencies
|
5508 |
*/
|
5510 |
|
5511 |
|
5512 |
|
|
|
|
|
|
|
|
|
|
|
5513 |
|
|
|
|
|
5514 |
|
|
|
|
|
5515 |
|
5516 |
+
var REPORTS_FILTER = 'woocommerce_admin_reports_list';
|
5517 |
+
/**
|
5518 |
+
* The Customers Report will not have the `report` param supplied by the router/
|
5519 |
+
* because it no longer exists under the path `/analytics/:report`. Use `props.path`/
|
5520 |
+
* instead to determine if the Customers Report is being rendered.
|
5521 |
+
*
|
5522 |
+
* @param {Object} params -url parameters
|
5523 |
+
* @return {string} - report parameter
|
5524 |
+
*/
|
5525 |
|
5526 |
+
var getReportParam = function getReportParam(_ref) {
|
5527 |
+
var params = _ref.params,
|
5528 |
+
path = _ref.path;
|
5529 |
+
return params.report || path.replace(/^\/+/, '');
|
5530 |
+
};
|
|
|
|
|
|
|
|
|
5531 |
|
5532 |
+
var Report = /*#__PURE__*/function (_Component) {
|
5533 |
+
_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_3___default()(Report, _Component);
|
|
|
5534 |
|
5535 |
+
var _super = _createSuper(Report);
|
|
|
|
|
5536 |
|
5537 |
+
function Report() {
|
5538 |
+
var _this;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5539 |
|
5540 |
+
_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default()(this, Report);
|
|
|
|
|
5541 |
|
5542 |
+
_this = _super.apply(this, arguments);
|
5543 |
+
_this.state = {
|
5544 |
+
hasError: false
|
5545 |
+
};
|
5546 |
+
return _this;
|
5547 |
}
|
5548 |
|
5549 |
+
_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_2___default()(Report, [{
|
5550 |
+
key: "componentDidCatch",
|
5551 |
+
value: function componentDidCatch(error) {
|
5552 |
+
this.setState({
|
5553 |
+
hasError: true
|
5554 |
+
});
|
5555 |
+
/* eslint-disable no-console */
|
|
|
|
|
|
|
5556 |
|
5557 |
+
console.warn(error);
|
5558 |
+
/* eslint-enable no-console */
|
5559 |
+
}
|
5560 |
+
}, {
|
5561 |
+
key: "render",
|
5562 |
+
value: function render() {
|
5563 |
+
if (this.state.hasError) {
|
5564 |
+
return null;
|
5565 |
+
}
|
5566 |
|
5567 |
+
var isError = this.props.isError;
|
|
|
|
|
5568 |
|
5569 |
+
if (isError) {
|
5570 |
+
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])(analytics_components_report_error__WEBPACK_IMPORTED_MODULE_13__[/* default */ "a"], {
|
5571 |
+
isError: true
|
5572 |
+
});
|
5573 |
+
}
|
|
|
|
|
5574 |
|
5575 |
+
var reportParam = getReportParam(this.props);
|
5576 |
+
var report = Object(lodash__WEBPACK_IMPORTED_MODULE_9__["find"])(Object(_get_reports__WEBPACK_IMPORTED_MODULE_17__[/* default */ "a"])(), {
|
5577 |
+
report: reportParam
|
5578 |
+
});
|
5579 |
|
5580 |
+
if (!report) {
|
5581 |
+
return null;
|
5582 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5583 |
|
5584 |
+
var Container = report.component;
|
5585 |
+
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])(lib_currency_context__WEBPACK_IMPORTED_MODULE_16__[/* CurrencyContext */ "a"].Provider, {
|
5586 |
+
value: Object(lib_currency_context__WEBPACK_IMPORTED_MODULE_16__[/* getFilteredCurrencyInstance */ "b"])(Object(_woocommerce_navigation__WEBPACK_IMPORTED_MODULE_11__["getQuery"])())
|
5587 |
+
}, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])(Container, this.props));
|
5588 |
}
|
5589 |
+
}]);
|
5590 |
|
5591 |
+
return Report;
|
5592 |
+
}(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["Component"]);
|
|
|
|
|
|
|
|
|
|
|
5593 |
|
5594 |
+
Report.propTypes = {
|
5595 |
+
params: prop_types__WEBPACK_IMPORTED_MODULE_8___default.a.object.isRequired
|
5596 |
+
};
|
5597 |
+
/* harmony default export */ __webpack_exports__["default"] = (Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_7__[/* default */ "a"])(Object(_woocommerce_components__WEBPACK_IMPORTED_MODULE_10__["useFilters"])(REPORTS_FILTER), Object(wc_api_with_select__WEBPACK_IMPORTED_MODULE_15__[/* default */ "a"])(function (select, props) {
|
5598 |
+
var query = Object(_woocommerce_navigation__WEBPACK_IMPORTED_MODULE_11__["getQuery"])();
|
5599 |
+
var search = query.search;
|
5600 |
|
5601 |
+
if (!search) {
|
5602 |
+
return {};
|
5603 |
+
}
|
5604 |
|
5605 |
+
var report = getReportParam(props);
|
5606 |
+
var searchWords = Object(_woocommerce_navigation__WEBPACK_IMPORTED_MODULE_11__["getSearchWords"])(query); // Single Category view in Categories Report uses the products endpoint, so search must also.
|
5607 |
|
5608 |
+
var mappedReport = report === 'categories' && query.filter === 'single_category' ? 'products' : report;
|
5609 |
+
var itemsResult = Object(wc_api_items_utils__WEBPACK_IMPORTED_MODULE_14__[/* searchItemsByString */ "b"])(select, mappedReport, searchWords);
|
5610 |
+
var isError = itemsResult.isError,
|
5611 |
+
isRequesting = itemsResult.isRequesting,
|
5612 |
+
items = itemsResult.items;
|
5613 |
+
var ids = Object.keys(items);
|
5614 |
|
5615 |
+
if (!ids.length) {
|
5616 |
+
return {
|
5617 |
+
isError: isError,
|
5618 |
+
isRequesting: isRequesting
|
5619 |
+
};
|
5620 |
+
}
|
5621 |
|
5622 |
+
return {
|
5623 |
+
isError: isError,
|
5624 |
+
isRequesting: isRequesting,
|
5625 |
+
query: _objectSpread(_objectSpread({}, props.query), {}, _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()({}, mappedReport, ids.join(',')))
|
5626 |
+
};
|
5627 |
+
}))(Report));
|
5628 |
|
5629 |
+
/***/ }),
|
5630 |
|
5631 |
+
/***/ 203:
|
5632 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
5633 |
|
5634 |
+
"use strict";
|
5635 |
|
5636 |
+
// EXPORTS
|
5637 |
+
__webpack_require__.d(__webpack_exports__, "c", function() { return /* binding */ layout_PrimaryLayout; });
|
5638 |
+
__webpack_require__.d(__webpack_exports__, "b", function() { return /* binding */ PageLayout; });
|
5639 |
+
__webpack_require__.d(__webpack_exports__, "a", function() { return /* binding */ layout_EmbedLayout; });
|
5640 |
|
5641 |
+
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/defineProperty.js
|
5642 |
+
var defineProperty = __webpack_require__(17);
|
5643 |
+
var defineProperty_default = /*#__PURE__*/__webpack_require__.n(defineProperty);
|
5644 |
|
5645 |
+
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/extends.js
|
5646 |
+
var helpers_extends = __webpack_require__(78);
|
5647 |
+
var extends_default = /*#__PURE__*/__webpack_require__.n(helpers_extends);
|
5648 |
|
5649 |
+
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/objectWithoutProperties.js
|
5650 |
+
var objectWithoutProperties = __webpack_require__(134);
|
5651 |
+
var objectWithoutProperties_default = /*#__PURE__*/__webpack_require__.n(objectWithoutProperties);
|
5652 |
|
5653 |
+
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/classCallCheck.js
|
5654 |
+
var classCallCheck = __webpack_require__(42);
|
5655 |
+
var classCallCheck_default = /*#__PURE__*/__webpack_require__.n(classCallCheck);
|
5656 |
|
5657 |
+
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/createClass.js
|
5658 |
+
var createClass = __webpack_require__(41);
|
5659 |
+
var createClass_default = /*#__PURE__*/__webpack_require__.n(createClass);
|
5660 |
|
5661 |
+
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/inherits.js
|
5662 |
+
var inherits = __webpack_require__(43);
|
5663 |
+
var inherits_default = /*#__PURE__*/__webpack_require__.n(inherits);
|
5664 |
|
5665 |
+
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js
|
5666 |
+
var possibleConstructorReturn = __webpack_require__(47);
|
5667 |
+
var possibleConstructorReturn_default = /*#__PURE__*/__webpack_require__.n(possibleConstructorReturn);
|
5668 |
|
5669 |
+
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/getPrototypeOf.js
|
5670 |
+
var getPrototypeOf = __webpack_require__(28);
|
5671 |
+
var getPrototypeOf_default = /*#__PURE__*/__webpack_require__.n(getPrototypeOf);
|
5672 |
|
5673 |
+
// EXTERNAL MODULE: external {"this":["wp","element"]}
|
5674 |
+
var external_this_wp_element_ = __webpack_require__(0);
|
5675 |
|
5676 |
+
// EXTERNAL MODULE: ./node_modules/@wordpress/compose/build-module/higher-order/compose.js
|
5677 |
+
var compose = __webpack_require__(175);
|
5678 |
|
5679 |
+
// EXTERNAL MODULE: external {"this":["wp","data"]}
|
5680 |
+
var external_this_wp_data_ = __webpack_require__(19);
|
5681 |
|
5682 |
+
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js
|
5683 |
+
var inheritsLoose = __webpack_require__(62);
|
|
|
5684 |
|
5685 |
+
// EXTERNAL MODULE: external "React"
|
5686 |
+
var external_React_ = __webpack_require__(13);
|
5687 |
+
var external_React_default = /*#__PURE__*/__webpack_require__.n(external_React_);
|
5688 |
|
5689 |
+
// EXTERNAL MODULE: ./node_modules/prop-types/index.js
|
5690 |
+
var prop_types = __webpack_require__(1);
|
5691 |
+
var prop_types_default = /*#__PURE__*/__webpack_require__.n(prop_types);
|
5692 |
|
5693 |
+
// EXTERNAL MODULE: ./node_modules/history/esm/history.js + 2 modules
|
5694 |
+
var esm_history = __webpack_require__(102);
|
5695 |
|
5696 |
+
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/inheritsLoose.js
|
5697 |
+
var helpers_inheritsLoose = __webpack_require__(131);
|
5698 |
+
var inheritsLoose_default = /*#__PURE__*/__webpack_require__.n(helpers_inheritsLoose);
|
5699 |
|
5700 |
+
// EXTERNAL MODULE: ./node_modules/gud/index.js
|
5701 |
+
var gud = __webpack_require__(423);
|
5702 |
+
var gud_default = /*#__PURE__*/__webpack_require__.n(gud);
|
5703 |
|
5704 |
+
// CONCATENATED MODULE: ./node_modules/mini-create-react-context/dist/esm/index.js
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5705 |
|
5706 |
|
|
|
|
|
5707 |
|
|
|
|
|
5708 |
|
|
|
5709 |
|
|
|
|
|
5710 |
|
5711 |
+
var MAX_SIGNED_31_BIT_INT = 1073741823;
|
5712 |
|
5713 |
+
function objectIs(x, y) {
|
5714 |
+
if (x === y) {
|
5715 |
+
return x !== 0 || 1 / x === 1 / y;
|
5716 |
+
} else {
|
5717 |
+
return x !== x && y !== y;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5718 |
}
|
5719 |
+
}
|
5720 |
|
5721 |
+
function createEventEmitter(value) {
|
5722 |
+
var handlers = [];
|
5723 |
+
return {
|
5724 |
+
on: function on(handler) {
|
5725 |
+
handlers.push(handler);
|
5726 |
+
},
|
5727 |
+
off: function off(handler) {
|
5728 |
+
handlers = handlers.filter(function (h) {
|
5729 |
+
return h !== handler;
|
5730 |
+
});
|
5731 |
+
},
|
5732 |
+
get: function get() {
|
5733 |
+
return value;
|
5734 |
+
},
|
5735 |
+
set: function set(newValue, changedBits) {
|
5736 |
+
value = newValue;
|
5737 |
+
handlers.forEach(function (handler) {
|
5738 |
+
return handler(value, changedBits);
|
5739 |
+
});
|
5740 |
+
}
|
5741 |
+
};
|
5742 |
+
}
|
5743 |
|
5744 |
+
function onlyChild(children) {
|
5745 |
+
return Array.isArray(children) ? children[0] : children;
|
5746 |
+
}
|
|
|
|
|
5747 |
|
5748 |
+
function createReactContext(defaultValue, calculateChangedBits) {
|
5749 |
+
var _Provider$childContex, _Consumer$contextType;
|
|
|
|
|
|
|
|
|
|
|
|
|
5750 |
|
5751 |
+
var contextProp = '__create-react-context-' + gud_default()() + '__';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5752 |
|
5753 |
+
var Provider =
|
5754 |
+
/*#__PURE__*/
|
5755 |
+
function (_Component) {
|
5756 |
+
inheritsLoose_default()(Provider, _Component);
|
5757 |
+
|
5758 |
+
function Provider() {
|
5759 |
+
var _this;
|
5760 |
+
|
5761 |
+
_this = _Component.apply(this, arguments) || this;
|
5762 |
+
_this.emitter = createEventEmitter(_this.props.value);
|
5763 |
+
return _this;
|
5764 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5765 |
|
5766 |
+
var _proto = Provider.prototype;
|
5767 |
+
|
5768 |
+
_proto.getChildContext = function getChildContext() {
|
5769 |
+
var _ref;
|
5770 |
+
|
5771 |
+
return _ref = {}, _ref[contextProp] = this.emitter, _ref;
|
5772 |
+
};
|
5773 |
+
|
5774 |
+
_proto.componentWillReceiveProps = function componentWillReceiveProps(nextProps) {
|
5775 |
+
if (this.props.value !== nextProps.value) {
|
5776 |
+
var oldValue = this.props.value;
|
5777 |
+
var newValue = nextProps.value;
|
5778 |
+
var changedBits;
|
5779 |
+
|
5780 |
+
if (objectIs(oldValue, newValue)) {
|
5781 |
+
changedBits = 0;
|
5782 |
+
} else {
|
5783 |
+
changedBits = typeof calculateChangedBits === 'function' ? calculateChangedBits(oldValue, newValue) : MAX_SIGNED_31_BIT_INT;
|
5784 |
+
|
5785 |
+
if (false) {}
|
5786 |
+
|
5787 |
+
changedBits |= 0;
|
5788 |
+
|
5789 |
+
if (changedBits !== 0) {
|
5790 |
+
this.emitter.set(nextProps.value, changedBits);
|
5791 |
+
}
|
5792 |
+
}
|
5793 |
}
|
5794 |
+
};
|
5795 |
|
5796 |
+
_proto.render = function render() {
|
5797 |
+
return this.props.children;
|
5798 |
+
};
|
|
|
|
|
|
|
|
|
|
|
|
|
5799 |
|
5800 |
+
return Provider;
|
5801 |
+
}(external_React_["Component"]);
|
5802 |
|
5803 |
+
Provider.childContextTypes = (_Provider$childContex = {}, _Provider$childContex[contextProp] = prop_types_default.a.object.isRequired, _Provider$childContex);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5804 |
|
5805 |
+
var Consumer =
|
5806 |
+
/*#__PURE__*/
|
5807 |
+
function (_Component2) {
|
5808 |
+
inheritsLoose_default()(Consumer, _Component2);
|
|
|
5809 |
|
5810 |
+
function Consumer() {
|
5811 |
+
var _this2;
|
5812 |
|
5813 |
+
_this2 = _Component2.apply(this, arguments) || this;
|
5814 |
+
_this2.state = {
|
5815 |
+
value: _this2.getValue()
|
5816 |
+
};
|
5817 |
+
|
5818 |
+
_this2.onUpdate = function (newValue, changedBits) {
|
5819 |
+
var observedBits = _this2.observedBits | 0;
|
5820 |
+
|
5821 |
+
if ((observedBits & changedBits) !== 0) {
|
5822 |
+
_this2.setState({
|
5823 |
+
value: _this2.getValue()
|
5824 |
});
|
5825 |
+
}
|
5826 |
+
};
|
5827 |
|
5828 |
+
return _this2;
|
|
|
|
|
5829 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5830 |
|
5831 |
+
var _proto2 = Consumer.prototype;
|
5832 |
+
|
5833 |
+
_proto2.componentWillReceiveProps = function componentWillReceiveProps(nextProps) {
|
5834 |
+
var observedBits = nextProps.observedBits;
|
5835 |
+
this.observedBits = observedBits === undefined || observedBits === null ? MAX_SIGNED_31_BIT_INT : observedBits;
|
5836 |
+
};
|
5837 |
+
|
5838 |
+
_proto2.componentDidMount = function componentDidMount() {
|
5839 |
+
if (this.context[contextProp]) {
|
5840 |
+
this.context[contextProp].on(this.onUpdate);
|
5841 |
}
|
5842 |
|
5843 |
+
var observedBits = this.props.observedBits;
|
5844 |
+
this.observedBits = observedBits === undefined || observedBits === null ? MAX_SIGNED_31_BIT_INT : observedBits;
|
5845 |
+
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5846 |
|
5847 |
+
_proto2.componentWillUnmount = function componentWillUnmount() {
|
5848 |
+
if (this.context[contextProp]) {
|
5849 |
+
this.context[contextProp].off(this.onUpdate);
|
5850 |
}
|
5851 |
+
};
|
5852 |
|
5853 |
+
_proto2.getValue = function getValue() {
|
5854 |
+
if (this.context[contextProp]) {
|
5855 |
+
return this.context[contextProp].get();
|
5856 |
+
} else {
|
5857 |
+
return defaultValue;
|
5858 |
+
}
|
5859 |
+
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5860 |
|
5861 |
+
_proto2.render = function render() {
|
5862 |
+
return onlyChild(this.props.children)(this.state.value);
|
5863 |
+
};
|
5864 |
|
5865 |
+
return Consumer;
|
5866 |
+
}(external_React_["Component"]);
|
5867 |
+
|
5868 |
+
Consumer.contextTypes = (_Consumer$contextType = {}, _Consumer$contextType[contextProp] = prop_types_default.a.object, _Consumer$contextType);
|
|
|
5869 |
return {
|
5870 |
+
Provider: Provider,
|
5871 |
+
Consumer: Consumer
|
|
|
|
|
5872 |
};
|
5873 |
+
}
|
|
|
5874 |
|
5875 |
+
var index = external_React_default.a.createContext || createReactContext;
|
5876 |
|
5877 |
+
/* harmony default export */ var esm = (index);
|
5878 |
|
5879 |
+
// EXTERNAL MODULE: ./node_modules/tiny-invariant/dist/tiny-invariant.esm.js
|
5880 |
+
var tiny_invariant_esm = __webpack_require__(81);
|
5881 |
|
5882 |
+
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/extends.js
|
5883 |
+
var esm_extends = __webpack_require__(12);
|
5884 |
|
5885 |
+
// EXTERNAL MODULE: ./node_modules/react-router/node_modules/path-to-regexp/index.js
|
5886 |
+
var path_to_regexp = __webpack_require__(264);
|
5887 |
+
var path_to_regexp_default = /*#__PURE__*/__webpack_require__.n(path_to_regexp);
|
5888 |
|
5889 |
+
// EXTERNAL MODULE: ./node_modules/react-is/index.js
|
5890 |
+
var react_is = __webpack_require__(181);
|
5891 |
|
5892 |
+
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js
|
5893 |
+
var objectWithoutPropertiesLoose = __webpack_require__(46);
|
5894 |
|
5895 |
+
// EXTERNAL MODULE: ./node_modules/hoist-non-react-statics/dist/hoist-non-react-statics.cjs.js
|
5896 |
+
var hoist_non_react_statics_cjs = __webpack_require__(199);
|
5897 |
+
var hoist_non_react_statics_cjs_default = /*#__PURE__*/__webpack_require__.n(hoist_non_react_statics_cjs);
|
5898 |
|
5899 |
+
// CONCATENATED MODULE: ./node_modules/react-router/esm/react-router.js
|
5900 |
|
|
|
|
|
|
|
5901 |
|
5902 |
|
5903 |
|
5904 |
|
5905 |
|
|
|
|
|
|
|
5906 |
|
5907 |
|
5908 |
|
5909 |
|
|
|
|
|
|
|
5910 |
|
5911 |
|
5912 |
|
5913 |
+
// TODO: Replace with React.createContext once we can assume React 16+
|
5914 |
|
5915 |
+
var react_router_createNamedContext = function createNamedContext(name) {
|
5916 |
+
var context = esm();
|
5917 |
+
context.displayName = name;
|
5918 |
+
return context;
|
5919 |
+
};
|
5920 |
|
5921 |
+
var react_router_context =
|
5922 |
+
/*#__PURE__*/
|
5923 |
+
react_router_createNamedContext("Router");
|
5924 |
|
5925 |
+
/**
|
5926 |
+
* The public API for putting history on context.
|
5927 |
+
*/
|
5928 |
|
5929 |
+
var react_router_Router =
|
5930 |
+
/*#__PURE__*/
|
5931 |
+
function (_React$Component) {
|
5932 |
+
Object(inheritsLoose["a" /* default */])(Router, _React$Component);
|
5933 |
|
5934 |
+
Router.computeRootMatch = function computeRootMatch(pathname) {
|
5935 |
+
return {
|
5936 |
+
path: "/",
|
5937 |
+
url: "/",
|
5938 |
+
params: {},
|
5939 |
+
isExact: pathname === "/"
|
5940 |
+
};
|
5941 |
+
};
|
5942 |
|
5943 |
+
function Router(props) {
|
5944 |
+
var _this;
|
5945 |
+
|
5946 |
+
_this = _React$Component.call(this, props) || this;
|
5947 |
_this.state = {
|
5948 |
+
location: props.history.location
|
5949 |
+
}; // This is a bit of a hack. We have to start listening for location
|
5950 |
+
// changes here in the constructor in case there are any <Redirect>s
|
5951 |
+
// on the initial render. If there are, they will replace/push when
|
5952 |
+
// they mount and since cDM fires in children before parents, we may
|
5953 |
+
// get a new location before the <Router> is mounted.
|
5954 |
+
|
5955 |
+
_this._isMounted = false;
|
5956 |
+
_this._pendingLocation = null;
|
5957 |
+
|
5958 |
+
if (!props.staticContext) {
|
5959 |
+
_this.unlisten = props.history.listen(function (location) {
|
5960 |
+
if (_this._isMounted) {
|
5961 |
+
_this.setState({
|
5962 |
+
location: location
|
5963 |
+
});
|
5964 |
+
} else {
|
5965 |
+
_this._pendingLocation = location;
|
5966 |
+
}
|
5967 |
+
});
|
5968 |
+
}
|
5969 |
+
|
5970 |
return _this;
|
5971 |
}
|
5972 |
|
5973 |
+
var _proto = Router.prototype;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5974 |
|
5975 |
+
_proto.componentDidMount = function componentDidMount() {
|
5976 |
+
this._isMounted = true;
|
5977 |
+
|
5978 |
+
if (this._pendingLocation) {
|
5979 |
+
this.setState({
|
5980 |
+
location: this._pendingLocation
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5981 |
});
|
5982 |
}
|
5983 |
+
};
|
|
|
|
|
|
|
|
|
|
|
5984 |
|
5985 |
+
_proto.componentWillUnmount = function componentWillUnmount() {
|
5986 |
+
if (this.unlisten) this.unlisten();
|
5987 |
+
};
|
5988 |
+
|
5989 |
+
_proto.render = function render() {
|
5990 |
+
return external_React_default.a.createElement(react_router_context.Provider, {
|
5991 |
+
children: this.props.children || null,
|
5992 |
+
value: {
|
5993 |
+
history: this.props.history,
|
5994 |
+
location: this.state.location,
|
5995 |
+
match: Router.computeRootMatch(this.state.location.pathname),
|
5996 |
+
staticContext: this.props.staticContext
|
5997 |
}
|
5998 |
+
});
|
5999 |
+
};
|
6000 |
|
6001 |
+
return Router;
|
6002 |
+
}(external_React_default.a.Component);
|
6003 |
|
6004 |
+
if (false) {}
|
|
|
|
|
6005 |
|
6006 |
+
/**
|
6007 |
+
* The public API for a <Router> that stores location in memory.
|
6008 |
+
*/
|
|
|
|
|
|
|
6009 |
|
6010 |
+
var react_router_MemoryRouter =
|
6011 |
+
/*#__PURE__*/
|
6012 |
+
function (_React$Component) {
|
6013 |
+
Object(inheritsLoose["a" /* default */])(MemoryRouter, _React$Component);
|
6014 |
|
6015 |
+
function MemoryRouter() {
|
6016 |
+
var _this;
|
6017 |
|
6018 |
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
6019 |
+
args[_key] = arguments[_key];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6020 |
}
|
|
|
6021 |
|
6022 |
+
_this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;
|
6023 |
+
_this.history = Object(esm_history["c" /* createMemoryHistory */])(_this.props);
|
6024 |
+
return _this;
|
6025 |
+
}
|
6026 |
|
6027 |
+
var _proto = MemoryRouter.prototype;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6028 |
|
6029 |
+
_proto.render = function render() {
|
6030 |
+
return external_React_default.a.createElement(react_router_Router, {
|
6031 |
+
history: this.history,
|
6032 |
+
children: this.props.children
|
6033 |
+
});
|
6034 |
+
};
|
6035 |
|
6036 |
+
return MemoryRouter;
|
6037 |
+
}(external_React_default.a.Component);
|
6038 |
|
6039 |
+
if (false) {}
|
6040 |
|
6041 |
+
var react_router_Lifecycle =
|
6042 |
+
/*#__PURE__*/
|
6043 |
+
function (_React$Component) {
|
6044 |
+
Object(inheritsLoose["a" /* default */])(Lifecycle, _React$Component);
|
6045 |
|
6046 |
+
function Lifecycle() {
|
6047 |
+
return _React$Component.apply(this, arguments) || this;
|
6048 |
+
}
|
6049 |
|
6050 |
+
var _proto = Lifecycle.prototype;
|
6051 |
|
6052 |
+
_proto.componentDidMount = function componentDidMount() {
|
6053 |
+
if (this.props.onMount) this.props.onMount.call(this, this);
|
6054 |
+
};
|
6055 |
|
6056 |
+
_proto.componentDidUpdate = function componentDidUpdate(prevProps) {
|
6057 |
+
if (this.props.onUpdate) this.props.onUpdate.call(this, this, prevProps);
|
6058 |
+
};
|
6059 |
+
|
6060 |
+
_proto.componentWillUnmount = function componentWillUnmount() {
|
6061 |
+
if (this.props.onUnmount) this.props.onUnmount.call(this, this);
|
6062 |
+
};
|
6063 |
+
|
6064 |
+
_proto.render = function render() {
|
6065 |
+
return null;
|
6066 |
+
};
|
6067 |
+
|
6068 |
+
return Lifecycle;
|
6069 |
+
}(external_React_default.a.Component);
|
6070 |
|
6071 |
/**
|
6072 |
+
* The public API for prompting the user before navigating away from a screen.
|
6073 |
*/
|
6074 |
|
6075 |
+
function Prompt(_ref) {
|
6076 |
+
var message = _ref.message,
|
6077 |
+
_ref$when = _ref.when,
|
6078 |
+
when = _ref$when === void 0 ? true : _ref$when;
|
6079 |
+
return external_React_default.a.createElement(react_router_context.Consumer, null, function (context) {
|
6080 |
+
!context ? false ? undefined : Object(tiny_invariant_esm["a" /* default */])(false) : void 0;
|
6081 |
+
if (!when || context.staticContext) return null;
|
6082 |
+
var method = context.history.block;
|
6083 |
+
return external_React_default.a.createElement(react_router_Lifecycle, {
|
6084 |
+
onMount: function onMount(self) {
|
6085 |
+
self.release = method(message);
|
6086 |
+
},
|
6087 |
+
onUpdate: function onUpdate(self, prevProps) {
|
6088 |
+
if (prevProps.message !== message) {
|
6089 |
+
self.release();
|
6090 |
+
self.release = method(message);
|
6091 |
+
}
|
6092 |
+
},
|
6093 |
+
onUnmount: function onUnmount(self) {
|
6094 |
+
self.release();
|
6095 |
+
},
|
6096 |
+
message: message
|
6097 |
+
});
|
6098 |
+
});
|
6099 |
+
}
|
6100 |
|
6101 |
+
if (false) { var messageType; }
|
|
|
6102 |
|
6103 |
+
var cache = {};
|
6104 |
+
var cacheLimit = 10000;
|
6105 |
+
var cacheCount = 0;
|
6106 |
|
6107 |
+
function compilePath(path) {
|
6108 |
+
if (cache[path]) return cache[path];
|
6109 |
+
var generator = path_to_regexp_default.a.compile(path);
|
6110 |
|
6111 |
+
if (cacheCount < cacheLimit) {
|
6112 |
+
cache[path] = generator;
|
6113 |
+
cacheCount++;
|
6114 |
}
|
6115 |
|
6116 |
+
return generator;
|
6117 |
+
}
|
6118 |
+
/**
|
6119 |
+
* Public API for generating a URL pathname from a path and parameters.
|
6120 |
+
*/
|
|
|
|
|
|
|
|
|
6121 |
|
|
|
|
|
6122 |
|
6123 |
+
function generatePath(path, params) {
|
6124 |
+
if (path === void 0) {
|
6125 |
+
path = "/";
|
6126 |
+
}
|
6127 |
|
6128 |
+
if (params === void 0) {
|
6129 |
+
params = {};
|
6130 |
+
}
|
6131 |
|
6132 |
+
return path === "/" ? path : compilePath(path)(params, {
|
6133 |
+
pretty: true
|
6134 |
+
});
|
6135 |
+
}
|
6136 |
|
6137 |
+
/**
|
6138 |
+
* The public API for navigating programmatically with a component.
|
6139 |
+
*/
|
6140 |
|
6141 |
+
function Redirect(_ref) {
|
6142 |
+
var computedMatch = _ref.computedMatch,
|
6143 |
+
to = _ref.to,
|
6144 |
+
_ref$push = _ref.push,
|
6145 |
+
push = _ref$push === void 0 ? false : _ref$push;
|
6146 |
+
return external_React_default.a.createElement(react_router_context.Consumer, null, function (context) {
|
6147 |
+
!context ? false ? undefined : Object(tiny_invariant_esm["a" /* default */])(false) : void 0;
|
6148 |
+
var history = context.history,
|
6149 |
+
staticContext = context.staticContext;
|
6150 |
+
var method = push ? history.push : history.replace;
|
6151 |
+
var location = Object(esm_history["b" /* createLocation */])(computedMatch ? typeof to === "string" ? generatePath(to, computedMatch.params) : Object(esm_extends["a" /* default */])({}, to, {
|
6152 |
+
pathname: generatePath(to.pathname, computedMatch.params)
|
6153 |
+
}) : to); // When rendering in a static context,
|
6154 |
+
// set the new location immediately.
|
6155 |
|
6156 |
+
if (staticContext) {
|
6157 |
+
method(location);
|
6158 |
+
return null;
|
6159 |
+
}
|
6160 |
|
6161 |
+
return external_React_default.a.createElement(react_router_Lifecycle, {
|
6162 |
+
onMount: function onMount() {
|
6163 |
+
method(location);
|
6164 |
+
},
|
6165 |
+
onUpdate: function onUpdate(self, prevProps) {
|
6166 |
+
var prevLocation = Object(esm_history["b" /* createLocation */])(prevProps.to);
|
6167 |
|
6168 |
+
if (!Object(esm_history["e" /* locationsAreEqual */])(prevLocation, Object(esm_extends["a" /* default */])({}, location, {
|
6169 |
+
key: prevLocation.key
|
6170 |
+
}))) {
|
6171 |
+
method(location);
|
6172 |
+
}
|
6173 |
+
},
|
6174 |
+
to: to
|
6175 |
+
});
|
6176 |
+
});
|
6177 |
+
}
|
6178 |
|
6179 |
+
if (false) {}
|
6180 |
|
6181 |
+
var cache$1 = {};
|
6182 |
+
var cacheLimit$1 = 10000;
|
6183 |
+
var cacheCount$1 = 0;
|
6184 |
|
6185 |
+
function compilePath$1(path, options) {
|
6186 |
+
var cacheKey = "" + options.end + options.strict + options.sensitive;
|
6187 |
+
var pathCache = cache$1[cacheKey] || (cache$1[cacheKey] = {});
|
6188 |
+
if (pathCache[path]) return pathCache[path];
|
6189 |
+
var keys = [];
|
6190 |
+
var regexp = path_to_regexp_default()(path, keys, options);
|
6191 |
+
var result = {
|
6192 |
+
regexp: regexp,
|
6193 |
+
keys: keys
|
6194 |
+
};
|
6195 |
|
6196 |
+
if (cacheCount$1 < cacheLimit$1) {
|
6197 |
+
pathCache[path] = result;
|
6198 |
+
cacheCount$1++;
|
6199 |
+
}
|
6200 |
|
6201 |
+
return result;
|
6202 |
+
}
|
6203 |
/**
|
6204 |
+
* Public API for matching a URL pathname to a path.
|
6205 |
*/
|
6206 |
|
6207 |
|
6208 |
+
function matchPath(pathname, options) {
|
6209 |
+
if (options === void 0) {
|
6210 |
+
options = {};
|
6211 |
+
}
|
6212 |
|
6213 |
+
if (typeof options === "string" || Array.isArray(options)) {
|
6214 |
+
options = {
|
6215 |
+
path: options
|
6216 |
+
};
|
6217 |
+
}
|
6218 |
|
6219 |
+
var _options = options,
|
6220 |
+
path = _options.path,
|
6221 |
+
_options$exact = _options.exact,
|
6222 |
+
exact = _options$exact === void 0 ? false : _options$exact,
|
6223 |
+
_options$strict = _options.strict,
|
6224 |
+
strict = _options$strict === void 0 ? false : _options$strict,
|
6225 |
+
_options$sensitive = _options.sensitive,
|
6226 |
+
sensitive = _options$sensitive === void 0 ? false : _options$sensitive;
|
6227 |
+
var paths = [].concat(path);
|
6228 |
+
return paths.reduce(function (matched, path) {
|
6229 |
+
if (!path && path !== "") return null;
|
6230 |
+
if (matched) return matched;
|
6231 |
|
6232 |
+
var _compilePath = compilePath$1(path, {
|
6233 |
+
end: exact,
|
6234 |
+
strict: strict,
|
6235 |
+
sensitive: sensitive
|
6236 |
+
}),
|
6237 |
+
regexp = _compilePath.regexp,
|
6238 |
+
keys = _compilePath.keys;
|
6239 |
|
6240 |
+
var match = regexp.exec(pathname);
|
6241 |
+
if (!match) return null;
|
6242 |
+
var url = match[0],
|
6243 |
+
values = match.slice(1);
|
6244 |
+
var isExact = pathname === url;
|
6245 |
+
if (exact && !isExact) return null;
|
6246 |
+
return {
|
6247 |
+
path: path,
|
6248 |
+
// the path used to match
|
6249 |
+
url: path === "/" && url === "" ? "/" : url,
|
6250 |
+
// the matched portion of the URL
|
6251 |
+
isExact: isExact,
|
6252 |
+
// whether or not we matched exactly
|
6253 |
+
params: keys.reduce(function (memo, key, index) {
|
6254 |
+
memo[key.name] = values[index];
|
6255 |
+
return memo;
|
6256 |
+
}, {})
|
6257 |
+
};
|
6258 |
+
}, null);
|
6259 |
+
}
|
6260 |
|
6261 |
+
function isEmptyChildren(children) {
|
6262 |
+
return external_React_default.a.Children.count(children) === 0;
|
6263 |
+
}
|
6264 |
|
6265 |
+
function evalChildrenDev(children, props, path) {
|
6266 |
+
var value = children(props);
|
6267 |
+
false ? undefined : void 0;
|
6268 |
+
return value || null;
|
6269 |
+
}
|
6270 |
/**
|
6271 |
+
* The public API for matching a single path and rendering.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6272 |
*/
|
6273 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6274 |
|
6275 |
+
var react_router_Route =
|
6276 |
+
/*#__PURE__*/
|
6277 |
+
function (_React$Component) {
|
6278 |
+
Object(inheritsLoose["a" /* default */])(Route, _React$Component);
|
|
|
6279 |
|
6280 |
+
function Route() {
|
6281 |
+
return _React$Component.apply(this, arguments) || this;
|
6282 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6283 |
|
6284 |
+
var _proto = Route.prototype;
|
|
|
6285 |
|
6286 |
+
_proto.render = function render() {
|
6287 |
+
var _this = this;
|
|
|
|
|
|
|
|
|
|
|
6288 |
|
6289 |
+
return external_React_default.a.createElement(react_router_context.Consumer, null, function (context$1) {
|
6290 |
+
!context$1 ? false ? undefined : Object(tiny_invariant_esm["a" /* default */])(false) : void 0;
|
6291 |
+
var location = _this.props.location || context$1.location;
|
6292 |
+
var match = _this.props.computedMatch ? _this.props.computedMatch // <Switch> already computed the match for us
|
6293 |
+
: _this.props.path ? matchPath(location.pathname, _this.props) : context$1.match;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6294 |
|
6295 |
+
var props = Object(esm_extends["a" /* default */])({}, context$1, {
|
6296 |
+
location: location,
|
6297 |
+
match: match
|
6298 |
+
});
|
|
|
6299 |
|
6300 |
+
var _this$props = _this.props,
|
6301 |
+
children = _this$props.children,
|
6302 |
+
component = _this$props.component,
|
6303 |
+
render = _this$props.render; // Preact uses an empty array as children by
|
6304 |
+
// default, so use null if that's the case.
|
|
|
|
|
6305 |
|
6306 |
+
if (Array.isArray(children) && children.length === 0) {
|
6307 |
+
children = null;
|
6308 |
+
}
|
|
|
|
|
|
|
|
|
|
|
6309 |
|
6310 |
+
return external_React_default.a.createElement(react_router_context.Provider, {
|
6311 |
+
value: props
|
6312 |
+
}, props.match ? children ? typeof children === "function" ? false ? undefined : children(props) : children : component ? external_React_default.a.createElement(component, props) : render ? render(props) : null : typeof children === "function" ? false ? undefined : children(props) : null);
|
6313 |
+
});
|
6314 |
};
|
6315 |
|
6316 |
+
return Route;
|
6317 |
+
}(external_React_default.a.Component);
|
6318 |
+
|
6319 |
+
if (false) {}
|
6320 |
+
|
6321 |
+
function addLeadingSlash(path) {
|
6322 |
+
return path.charAt(0) === "/" ? path : "/" + path;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6323 |
}
|
6324 |
|
6325 |
+
function addBasename(basename, location) {
|
6326 |
+
if (!basename) return location;
|
6327 |
+
return Object(esm_extends["a" /* default */])({}, location, {
|
6328 |
+
pathname: addLeadingSlash(basename) + location.pathname
|
6329 |
+
});
|
6330 |
+
}
|
6331 |
|
6332 |
+
function stripBasename(basename, location) {
|
6333 |
+
if (!basename) return location;
|
6334 |
+
var base = addLeadingSlash(basename);
|
6335 |
+
if (location.pathname.indexOf(base) !== 0) return location;
|
6336 |
+
return Object(esm_extends["a" /* default */])({}, location, {
|
6337 |
+
pathname: location.pathname.substr(base.length)
|
6338 |
+
});
|
6339 |
+
}
|
6340 |
|
6341 |
+
function createURL(location) {
|
6342 |
+
return typeof location === "string" ? location : Object(esm_history["d" /* createPath */])(location);
|
6343 |
+
}
|
6344 |
|
6345 |
+
function staticHandler(methodName) {
|
6346 |
+
return function () {
|
6347 |
+
false ? undefined : Object(tiny_invariant_esm["a" /* default */])(false) ;
|
6348 |
+
};
|
6349 |
+
}
|
6350 |
|
6351 |
+
function noop() {}
|
6352 |
+
/**
|
6353 |
+
* The public top-level API for a "static" <Router>, so-called because it
|
6354 |
+
* can't actually change the current location. Instead, it just records
|
6355 |
+
* location changes in a context object. Useful mainly in testing and
|
6356 |
+
* server-rendering scenarios.
|
6357 |
+
*/
|
6358 |
|
6359 |
|
6360 |
+
var react_router_StaticRouter =
|
6361 |
+
/*#__PURE__*/
|
6362 |
+
function (_React$Component) {
|
6363 |
+
Object(inheritsLoose["a" /* default */])(StaticRouter, _React$Component);
|
6364 |
|
6365 |
+
function StaticRouter() {
|
6366 |
+
var _this;
|
6367 |
|
6368 |
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
6369 |
+
args[_key] = arguments[_key];
|
6370 |
+
}
|
6371 |
|
6372 |
+
_this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;
|
6373 |
|
6374 |
+
_this.handlePush = function (location) {
|
6375 |
+
return _this.navigateTo(location, "PUSH");
|
6376 |
+
};
|
6377 |
|
6378 |
+
_this.handleReplace = function (location) {
|
6379 |
+
return _this.navigateTo(location, "REPLACE");
|
6380 |
+
};
|
6381 |
|
6382 |
+
_this.handleListen = function () {
|
6383 |
+
return noop;
|
6384 |
+
};
|
6385 |
|
6386 |
+
_this.handleBlock = function () {
|
6387 |
+
return noop;
|
6388 |
+
};
|
6389 |
|
6390 |
+
return _this;
|
6391 |
+
}
|
6392 |
|
6393 |
+
var _proto = StaticRouter.prototype;
|
6394 |
|
6395 |
+
_proto.navigateTo = function navigateTo(location, action) {
|
6396 |
+
var _this$props = this.props,
|
6397 |
+
_this$props$basename = _this$props.basename,
|
6398 |
+
basename = _this$props$basename === void 0 ? "" : _this$props$basename,
|
6399 |
+
_this$props$context = _this$props.context,
|
6400 |
+
context = _this$props$context === void 0 ? {} : _this$props$context;
|
6401 |
+
context.action = action;
|
6402 |
+
context.location = addBasename(basename, Object(esm_history["b" /* createLocation */])(location));
|
6403 |
+
context.url = createURL(context.location);
|
6404 |
+
};
|
6405 |
|
6406 |
+
_proto.render = function render() {
|
6407 |
+
var _this$props2 = this.props,
|
6408 |
+
_this$props2$basename = _this$props2.basename,
|
6409 |
+
basename = _this$props2$basename === void 0 ? "" : _this$props2$basename,
|
6410 |
+
_this$props2$context = _this$props2.context,
|
6411 |
+
context = _this$props2$context === void 0 ? {} : _this$props2$context,
|
6412 |
+
_this$props2$location = _this$props2.location,
|
6413 |
+
location = _this$props2$location === void 0 ? "/" : _this$props2$location,
|
6414 |
+
rest = Object(objectWithoutPropertiesLoose["a" /* default */])(_this$props2, ["basename", "context", "location"]);
|
6415 |
|
6416 |
+
var history = {
|
6417 |
+
createHref: function createHref(path) {
|
6418 |
+
return addLeadingSlash(basename + createURL(path));
|
6419 |
+
},
|
6420 |
+
action: "POP",
|
6421 |
+
location: stripBasename(basename, Object(esm_history["b" /* createLocation */])(location)),
|
6422 |
+
push: this.handlePush,
|
6423 |
+
replace: this.handleReplace,
|
6424 |
+
go: staticHandler("go"),
|
6425 |
+
goBack: staticHandler("goBack"),
|
6426 |
+
goForward: staticHandler("goForward"),
|
6427 |
+
listen: this.handleListen,
|
6428 |
+
block: this.handleBlock
|
6429 |
+
};
|
6430 |
+
return external_React_default.a.createElement(react_router_Router, Object(esm_extends["a" /* default */])({}, rest, {
|
6431 |
+
history: history,
|
6432 |
+
staticContext: context
|
6433 |
+
}));
|
6434 |
+
};
|
6435 |
|
6436 |
+
return StaticRouter;
|
6437 |
+
}(external_React_default.a.Component);
|
6438 |
|
6439 |
+
if (false) {}
|
|
|
6440 |
|
6441 |
+
/**
|
6442 |
+
* The public API for rendering the first <Route> that matches.
|
6443 |
+
*/
|
6444 |
|
6445 |
+
var react_router_Switch =
|
6446 |
+
/*#__PURE__*/
|
6447 |
+
function (_React$Component) {
|
6448 |
+
Object(inheritsLoose["a" /* default */])(Switch, _React$Component);
|
6449 |
|
6450 |
+
function Switch() {
|
6451 |
+
return _React$Component.apply(this, arguments) || this;
|
6452 |
}
|
6453 |
|
6454 |
+
var _proto = Switch.prototype;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6455 |
|
6456 |
+
_proto.render = function render() {
|
6457 |
+
var _this = this;
|
6458 |
|
6459 |
+
return external_React_default.a.createElement(react_router_context.Consumer, null, function (context) {
|
6460 |
+
!context ? false ? undefined : Object(tiny_invariant_esm["a" /* default */])(false) : void 0;
|
6461 |
+
var location = _this.props.location || context.location;
|
6462 |
+
var element, match; // We use React.Children.forEach instead of React.Children.toArray().find()
|
6463 |
+
// here because toArray adds keys to all child elements and we do not want
|
6464 |
+
// to trigger an unmount/remount for two <Route>s that render the same
|
6465 |
+
// component at different URLs.
|
6466 |
|
6467 |
+
external_React_default.a.Children.forEach(_this.props.children, function (child) {
|
6468 |
+
if (match == null && external_React_default.a.isValidElement(child)) {
|
6469 |
+
element = child;
|
6470 |
+
var path = child.props.path || child.props.from;
|
6471 |
+
match = path ? matchPath(location.pathname, Object(esm_extends["a" /* default */])({}, child.props, {
|
6472 |
+
path: path
|
6473 |
+
})) : context.match;
|
6474 |
+
}
|
6475 |
+
});
|
6476 |
+
return match ? external_React_default.a.cloneElement(element, {
|
6477 |
+
location: location,
|
6478 |
+
computedMatch: match
|
6479 |
+
}) : null;
|
6480 |
+
});
|
6481 |
};
|
|
|
|
|
|
|
6482 |
|
6483 |
+
return Switch;
|
6484 |
+
}(external_React_default.a.Component);
|
6485 |
|
6486 |
+
if (false) {}
|
6487 |
|
6488 |
+
/**
|
6489 |
+
* A public higher-order component to access the imperative API
|
6490 |
+
*/
|
6491 |
|
6492 |
+
function withRouter(Component) {
|
6493 |
+
var displayName = "withRouter(" + (Component.displayName || Component.name) + ")";
|
6494 |
|
6495 |
+
var C = function C(props) {
|
6496 |
+
var wrappedComponentRef = props.wrappedComponentRef,
|
6497 |
+
remainingProps = Object(objectWithoutPropertiesLoose["a" /* default */])(props, ["wrappedComponentRef"]);
|
6498 |
|
6499 |
+
return external_React_default.a.createElement(react_router_context.Consumer, null, function (context) {
|
6500 |
+
!context ? false ? undefined : Object(tiny_invariant_esm["a" /* default */])(false) : void 0;
|
6501 |
+
return external_React_default.a.createElement(Component, Object(esm_extends["a" /* default */])({}, remainingProps, context, {
|
6502 |
+
ref: wrappedComponentRef
|
6503 |
+
}));
|
6504 |
+
});
|
6505 |
+
};
|
6506 |
|
6507 |
+
C.displayName = displayName;
|
6508 |
+
C.WrappedComponent = Component;
|
6509 |
|
6510 |
+
if (false) {}
|
6511 |
|
6512 |
+
return hoist_non_react_statics_cjs_default()(C, Component);
|
6513 |
+
}
|
6514 |
|
6515 |
+
var useContext = external_React_default.a.useContext;
|
6516 |
+
function useHistory() {
|
6517 |
+
if (false) {}
|
6518 |
|
6519 |
+
return useContext(react_router_context).history;
|
6520 |
+
}
|
6521 |
+
function useLocation() {
|
6522 |
+
if (false) {}
|
6523 |
|
6524 |
+
return useContext(react_router_context).location;
|
6525 |
+
}
|
6526 |
+
function useParams() {
|
6527 |
+
if (false) {}
|
6528 |
|
6529 |
+
var match = useContext(react_router_context).match;
|
6530 |
+
return match ? match.params : {};
|
6531 |
+
}
|
6532 |
+
function useRouteMatch(path) {
|
6533 |
+
if (false) {}
|
6534 |
|
6535 |
+
return path ? matchPath(useLocation().pathname, path) : useContext(react_router_context).match;
|
6536 |
+
}
|
6537 |
|
6538 |
+
if (false) { var secondaryBuildName, initialBuildName, buildNames, react_router_key, global; }
|
|
|
|
|
6539 |
|
6540 |
|
6541 |
+
//# sourceMappingURL=react-router.js.map
|
6542 |
|
6543 |
+
// EXTERNAL MODULE: external "lodash"
|
6544 |
+
var external_lodash_ = __webpack_require__(2);
|
6545 |
|
6546 |
+
// EXTERNAL MODULE: ./node_modules/qs/lib/index.js
|
6547 |
+
var lib = __webpack_require__(67);
|
6548 |
|
6549 |
+
// EXTERNAL MODULE: external {"this":["wc","components"]}
|
6550 |
+
var external_this_wc_components_ = __webpack_require__(55);
|
6551 |
|
6552 |
+
// EXTERNAL MODULE: external {"this":["wc","navigation"]}
|
6553 |
+
var external_this_wc_navigation_ = __webpack_require__(23);
|
|
|
6554 |
|
6555 |
+
// EXTERNAL MODULE: ./client/settings/index.js
|
6556 |
+
var settings = __webpack_require__(20);
|
6557 |
|
6558 |
+
// EXTERNAL MODULE: external {"this":["wc","data"]}
|
6559 |
+
var external_this_wc_data_ = __webpack_require__(48);
|
6560 |
|
6561 |
+
// EXTERNAL MODULE: ./client/layout/style.scss
|
6562 |
+
var layout_style = __webpack_require__(450);
|
6563 |
|
6564 |
+
// EXTERNAL MODULE: external {"this":["wp","hooks"]}
|
6565 |
+
var external_this_wp_hooks_ = __webpack_require__(44);
|
6566 |
|
6567 |
+
// EXTERNAL MODULE: external {"this":["wp","i18n"]}
|
6568 |
+
var external_this_wp_i18n_ = __webpack_require__(3);
|
|
|
6569 |
|
6570 |
+
// EXTERNAL MODULE: ./client/utils/index.js
|
6571 |
+
var utils = __webpack_require__(275);
|
6572 |
|
6573 |
+
// EXTERNAL MODULE: ./client/analytics/report/get-reports.js
|
6574 |
+
var get_reports = __webpack_require__(201);
|
6575 |
|
6576 |
+
// CONCATENATED MODULE: ./client/layout/controller.js
|
6577 |
|
6578 |
|
6579 |
|
6580 |
|
|
|
|
|
|
|
6581 |
|
|
|
|
|
6582 |
|
|
|
6583 |
|
6584 |
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = getPrototypeOf_default()(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = getPrototypeOf_default()(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return possibleConstructorReturn_default()(this, result); }; }
|
|
|
6585 |
|
6586 |
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
|
|
|
6587 |
|
6588 |
+
/**
|
6589 |
+
* External dependencies
|
6590 |
+
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6591 |
|
|
|
|
|
6592 |
|
|
|
|
|
6593 |
|
|
|
6594 |
|
|
|
|
|
6595 |
|
6596 |
+
/**
|
6597 |
+
* WooCommerce dependencies
|
6598 |
+
*/
|
6599 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6600 |
|
|
|
|
|
|
|
6601 |
|
6602 |
+
/**
|
6603 |
+
* Internal dependencies
|
6604 |
+
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6605 |
|
|
|
|
|
6606 |
|
6607 |
+
var AnalyticsReport = Object(external_this_wp_element_["lazy"])(function () {
|
6608 |
+
return Promise.resolve(/* import() */).then(__webpack_require__.bind(null, 202));
|
6609 |
+
});
|
6610 |
+
var AnalyticsSettings = Object(external_this_wp_element_["lazy"])(function () {
|
6611 |
+
return __webpack_require__.e(/* import() | analytics-settings */ 22).then(__webpack_require__.bind(null, 937));
|
6612 |
+
});
|
6613 |
+
var Dashboard = Object(external_this_wp_element_["lazy"])(function () {
|
6614 |
+
return __webpack_require__.e(/* import() | dashboard */ 28).then(__webpack_require__.bind(null, 927));
|
6615 |
+
});
|
6616 |
+
var DevDocs = Object(external_this_wp_element_["lazy"])(function () {
|
6617 |
+
return Promise.all(/* import() | devdocs */[__webpack_require__.e(2), __webpack_require__.e(50), __webpack_require__.e(32)]).then(__webpack_require__.bind(null, 940));
|
6618 |
+
});
|
6619 |
+
var Homescreen = Object(external_this_wp_element_["lazy"])(function () {
|
6620 |
+
return Promise.all(/* import() | homescreen */[__webpack_require__.e(2), __webpack_require__.e(4), __webpack_require__.e(5), __webpack_require__.e(6), __webpack_require__.e(33)]).then(__webpack_require__.bind(null, 934));
|
6621 |
+
});
|
6622 |
+
var MarketingOverview = Object(external_this_wp_element_["lazy"])(function () {
|
6623 |
+
return Promise.all(/* import() | marketing-overview */[__webpack_require__.e(2), __webpack_require__.e(51), __webpack_require__.e(37)]).then(__webpack_require__.bind(null, 938));
|
6624 |
+
});
|
6625 |
+
var ProfileWizard = Object(external_this_wp_element_["lazy"])(function () {
|
6626 |
+
return Promise.all(/* import() | profile-wizard */[__webpack_require__.e(2), __webpack_require__.e(4), __webpack_require__.e(6), __webpack_require__.e(52), __webpack_require__.e(45)]).then(__webpack_require__.bind(null, 935));
|
6627 |
+
});
|
6628 |
|
6629 |
+
var TIME_EXCLUDED_SCREENS_FILTER = 'woocommerce_admin_time_excluded_screens';
|
6630 |
+
var PAGES_FILTER = 'woocommerce_admin_pages_list';
|
6631 |
+
var controller_getPages = function getPages() {
|
6632 |
+
var pages = [];
|
6633 |
+
var initialBreadcrumbs = [['', wcSettings.woocommerceTranslation]];
|
6634 |
|
6635 |
+
if (window.wcAdminFeatures.devdocs) {
|
6636 |
+
pages.push({
|
6637 |
+
container: DevDocs,
|
6638 |
+
path: '/devdocs',
|
6639 |
+
breadcrumbs: function breadcrumbs(_ref) {
|
6640 |
+
var location = _ref.location;
|
6641 |
|
6642 |
+
var _getUrlParams = Object(utils["b" /* getUrlParams */])(location.search),
|
6643 |
+
component = _getUrlParams.component;
|
6644 |
|
6645 |
+
if (component) {
|
6646 |
+
return [].concat(initialBreadcrumbs, [['/devdocs', 'Documentation'], component]);
|
6647 |
+
}
|
6648 |
|
6649 |
+
return [].concat(initialBreadcrumbs, ['Documentation']);
|
6650 |
+
},
|
6651 |
+
wpOpenMenu: 'toplevel_page_woocommerce'
|
6652 |
+
});
|
6653 |
+
}
|
6654 |
|
6655 |
+
if (window.wcAdminFeatures['analytics-dashboard'] && !window.wcAdminFeatures.homescreen) {
|
6656 |
+
pages.push({
|
6657 |
+
container: Dashboard,
|
6658 |
+
path: '/',
|
6659 |
+
breadcrumbs: [].concat(initialBreadcrumbs, [Object(external_this_wp_i18n_["__"])('Dashboard', 'woocommerce-admin')]),
|
6660 |
+
wpOpenMenu: 'toplevel_page_woocommerce'
|
6661 |
+
});
|
6662 |
+
}
|
|
|
|
|
|
|
|
|
6663 |
|
6664 |
+
if (window.wcAdminFeatures.homescreen) {
|
6665 |
+
pages.push({
|
6666 |
+
container: Homescreen,
|
6667 |
+
path: '/',
|
6668 |
+
breadcrumbs: [].concat(initialBreadcrumbs, [Object(external_this_wp_i18n_["__"])('Home', 'woocommerce-admin')]),
|
6669 |
+
wpOpenMenu: 'toplevel_page_woocommerce'
|
6670 |
+
});
|
6671 |
+
}
|
6672 |
+
|
6673 |
+
if (window.wcAdminFeatures.analytics) {
|
6674 |
+
if (window.wcAdminFeatures.homescreen) {
|
6675 |
+
pages.push({
|
6676 |
+
container: Dashboard,
|
6677 |
+
path: '/analytics/overview',
|
6678 |
+
breadcrumbs: [].concat(initialBreadcrumbs, [['/analytics/overview', Object(external_this_wp_i18n_["__"])('Analytics', 'woocommerce-admin')], Object(external_this_wp_i18n_["__"])('Overview', 'woocommerce-admin')]),
|
6679 |
+
wpOpenMenu: 'toplevel_page_wc-admin-path--analytics-overview'
|
6680 |
+
});
|
6681 |
}
|
|
|
6682 |
|
6683 |
+
var ReportWpOpenMenu = "toplevel_page_wc-admin-path--analytics-".concat(window.wcAdminFeatures.homescreen ? 'overview' : 'revenue');
|
6684 |
+
pages.push({
|
6685 |
+
container: AnalyticsSettings,
|
6686 |
+
path: '/analytics/settings',
|
6687 |
+
breadcrumbs: [].concat(initialBreadcrumbs, [['/analytics/revenue', Object(external_this_wp_i18n_["__"])('Analytics', 'woocommerce-admin')], Object(external_this_wp_i18n_["__"])('Settings', 'woocommerce-admin')]),
|
6688 |
+
wpOpenMenu: ReportWpOpenMenu
|
6689 |
+
});
|
6690 |
+
pages.push({
|
6691 |
+
container: AnalyticsReport,
|
6692 |
+
path: '/customers',
|
6693 |
+
breadcrumbs: [].concat(initialBreadcrumbs, [Object(external_this_wp_i18n_["__"])('Customers', 'woocommerce-admin')]),
|
6694 |
+
wpOpenMenu: 'toplevel_page_woocommerce'
|
6695 |
+
});
|
6696 |
+
pages.push({
|
6697 |
+
container: AnalyticsReport,
|
6698 |
+
path: '/analytics/:report',
|
6699 |
+
breadcrumbs: function breadcrumbs(_ref2) {
|
6700 |
+
var match = _ref2.match;
|
6701 |
+
var report = Object(external_lodash_["find"])(Object(get_reports["a" /* default */])(), {
|
6702 |
+
report: match.params.report
|
6703 |
+
});
|
6704 |
|
6705 |
+
if (!report) {
|
6706 |
+
return [];
|
6707 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6708 |
|
6709 |
+
return [].concat(initialBreadcrumbs, [['/analytics/revenue', Object(external_this_wp_i18n_["__"])('Analytics', 'woocommerce-admin')], report.title]);
|
6710 |
+
},
|
6711 |
+
wpOpenMenu: ReportWpOpenMenu
|
6712 |
+
});
|
6713 |
}
|
6714 |
|
6715 |
+
if (window.wcAdminFeatures.marketing) {
|
6716 |
+
pages.push({
|
6717 |
+
container: MarketingOverview,
|
6718 |
+
path: '/marketing',
|
6719 |
+
breadcrumbs: [].concat(initialBreadcrumbs, [['/marketing', Object(external_this_wp_i18n_["__"])('Marketing', 'woocommerce-admin')], Object(external_this_wp_i18n_["__"])('Overview', 'woocommerce-admin')]),
|
6720 |
+
wpOpenMenu: 'toplevel_page_woocommerce-marketing'
|
6721 |
+
});
|
6722 |
+
}
|
6723 |
|
6724 |
+
if (window.wcAdminFeatures.onboarding) {
|
6725 |
+
pages.push({
|
6726 |
+
container: ProfileWizard,
|
6727 |
+
path: '/profiler',
|
6728 |
+
breadcrumbs: [].concat(initialBreadcrumbs, [['/profiler', Object(external_this_wp_i18n_["__"])('Profiler', 'woocommerce-admin')]])
|
6729 |
+
});
|
6730 |
+
}
|
6731 |
|
6732 |
+
return Object(external_this_wp_hooks_["applyFilters"])(PAGES_FILTER, pages);
|
6733 |
+
};
|
6734 |
+
var controller_Controller = /*#__PURE__*/function (_Component) {
|
6735 |
+
inherits_default()(Controller, _Component);
|
6736 |
|
6737 |
+
var _super = _createSuper(Controller);
|
6738 |
|
6739 |
+
function Controller() {
|
6740 |
+
classCallCheck_default()(this, Controller);
|
6741 |
|
6742 |
+
return _super.apply(this, arguments);
|
6743 |
}
|
6744 |
|
6745 |
+
createClass_default()(Controller, [{
|
6746 |
+
key: "componentDidMount",
|
6747 |
+
value: function componentDidMount() {
|
6748 |
+
window.document.documentElement.scrollTop = 0;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6749 |
}
|
6750 |
+
}, {
|
6751 |
+
key: "componentDidUpdate",
|
6752 |
+
value: function componentDidUpdate(prevProps) {
|
6753 |
+
var prevBaseQuery = Object(external_lodash_["omit"])(prevProps.query, 'chartType', 'filter', 'paged');
|
6754 |
+
var baseQuery = Object(external_lodash_["omit"])(this.props.query, 'chartType', 'filter', 'paged');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6755 |
|
6756 |
+
if (prevProps.query.paged > 1 && !Object(external_lodash_["isEqual"])(prevBaseQuery, baseQuery)) {
|
6757 |
+
Object(external_this_wc_navigation_["getHistory"])().replace(Object(external_this_wc_navigation_["getNewPath"])({
|
6758 |
+
paged: 1
|
6759 |
+
}));
|
6760 |
+
}
|
6761 |
|
6762 |
+
if (prevProps.match.url !== this.props.match.url) {
|
6763 |
+
window.document.documentElement.scrollTop = 0;
|
6764 |
+
}
|
6765 |
+
}
|
6766 |
+
}, {
|
6767 |
key: "render",
|
6768 |
value: function render() {
|
6769 |
+
var _this$props = this.props,
|
6770 |
+
page = _this$props.page,
|
6771 |
+
match = _this$props.match,
|
6772 |
+
query = _this$props.query;
|
6773 |
+
var url = match.url,
|
6774 |
+
params = match.params;
|
6775 |
+
window.wpNavMenuUrlUpdate(query);
|
6776 |
+
window.wpNavMenuClassChange(page, url);
|
6777 |
+
return Object(external_this_wp_element_["createElement"])(external_this_wp_element_["Suspense"], {
|
6778 |
+
fallback: Object(external_this_wp_element_["createElement"])(external_this_wc_components_["Spinner"], null)
|
6779 |
+
}, Object(external_this_wp_element_["createElement"])(page.container, {
|
6780 |
+
params: params,
|
6781 |
+
path: url,
|
6782 |
+
pathMatch: page.path,
|
6783 |
+
query: query
|
6784 |
+
}));
|
6785 |
}
|
6786 |
}]);
|
6787 |
|
6788 |
+
return Controller;
|
6789 |
}(external_this_wp_element_["Component"]);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6790 |
/**
|
6791 |
+
* Update an anchor's link in sidebar to include persisted queries. Leave excluded screens
|
6792 |
+
* as is.
|
6793 |
+
*
|
6794 |
+
* @param {HTMLElement} item - Sidebar anchor link.
|
6795 |
+
* @param {Object} nextQuery - A query object to be added to updated hrefs.
|
6796 |
+
* @param {Array} excludedScreens - wc-admin screens to avoid updating.
|
6797 |
*/
|
6798 |
|
6799 |
+
function updateLinkHref(item, nextQuery, excludedScreens) {
|
6800 |
+
var isWCAdmin = /admin.php\?page=wc-admin/.test(item.href);
|
6801 |
|
6802 |
+
if (isWCAdmin) {
|
6803 |
+
var search = Object(external_lodash_["last"])(item.href.split('?'));
|
6804 |
+
var query = Object(lib["parse"])(search);
|
6805 |
+
var defaultPath = window.wcAdminFeatures.homescreen ? 'homescreen' : 'dashboard';
|
6806 |
+
var path = query.path || defaultPath;
|
6807 |
+
var screen = path.replace('/analytics', '').replace('/', '');
|
6808 |
+
var isExcludedScreen = excludedScreens.includes(screen);
|
6809 |
+
var href = 'admin.php?' + Object(lib["stringify"])(Object.assign(query, isExcludedScreen ? {} : nextQuery)); // Replace the href so you can see the url on hover.
|
6810 |
|
6811 |
+
item.href = href;
|
|
|
|
|
6812 |
|
6813 |
+
item.onclick = function (e) {
|
6814 |
+
e.preventDefault();
|
6815 |
+
Object(external_this_wc_navigation_["getHistory"])().push(href);
|
6816 |
+
};
|
6817 |
+
}
|
6818 |
+
} // Update's wc-admin links in wp-admin menu
|
6819 |
|
6820 |
+
window.wpNavMenuUrlUpdate = function (query) {
|
6821 |
+
var excludedScreens = Object(external_this_wp_hooks_["applyFilters"])(TIME_EXCLUDED_SCREENS_FILTER, ['devdocs', 'stock', 'settings', 'customers', 'homescreen']);
|
6822 |
+
var nextQuery = Object(external_this_wc_navigation_["getPersistedQuery"])(query);
|
6823 |
+
Array.from(document.querySelectorAll('#adminmenu a')).forEach(function (item) {
|
6824 |
+
return updateLinkHref(item, nextQuery, excludedScreens);
|
6825 |
+
});
|
6826 |
+
}; // When the route changes, we need to update wp-admin's menu with the correct section & current link
|
|
|
6827 |
|
|
|
6828 |
|
6829 |
+
window.wpNavMenuClassChange = function (page, url) {
|
6830 |
+
Array.from(document.getElementsByClassName('current')).forEach(function (item) {
|
6831 |
+
item.classList.remove('current');
|
6832 |
+
});
|
6833 |
+
var submenu = Array.from(document.querySelectorAll('.wp-has-current-submenu'));
|
6834 |
+
submenu.forEach(function (element) {
|
6835 |
+
element.classList.remove('wp-has-current-submenu');
|
6836 |
+
element.classList.remove('wp-menu-open');
|
6837 |
+
element.classList.remove('selected');
|
6838 |
+
element.classList.add('wp-not-current-submenu');
|
6839 |
+
element.classList.add('menu-top');
|
6840 |
+
});
|
6841 |
+
var pageUrl = url === '/' ? 'admin.php?page=wc-admin' : 'admin.php?page=wc-admin&path=' + encodeURIComponent(url);
|
6842 |
+
var currentItemsSelector = url === '/' ? "li > a[href$=\"".concat(pageUrl, "\"], li > a[href*=\"").concat(pageUrl, "?\"]") : "li > a[href*=\"".concat(pageUrl, "\"]");
|
6843 |
+
var currentItems = document.querySelectorAll(currentItemsSelector);
|
6844 |
+
Array.from(currentItems).forEach(function (item) {
|
6845 |
+
item.parentElement.classList.add('current');
|
6846 |
+
});
|
6847 |
|
6848 |
+
if (page.wpOpenMenu) {
|
6849 |
+
var currentMenu = document.querySelector('#' + page.wpOpenMenu);
|
|
|
6850 |
|
6851 |
+
if (currentMenu) {
|
6852 |
+
currentMenu.classList.remove('wp-not-current-submenu');
|
6853 |
+
currentMenu.classList.add('wp-has-current-submenu');
|
6854 |
+
currentMenu.classList.add('wp-menu-open');
|
6855 |
+
currentMenu.classList.add('current');
|
6856 |
+
}
|
6857 |
+
}
|
6858 |
|
6859 |
+
var wpWrap = document.querySelector('#wpwrap');
|
6860 |
+
wpWrap.classList.remove('wp-responsive-open');
|
6861 |
+
};
|
6862 |
+
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/assertThisInitialized.js
|
6863 |
+
var assertThisInitialized = __webpack_require__(65);
|
6864 |
+
var assertThisInitialized_default = /*#__PURE__*/__webpack_require__.n(assertThisInitialized);
|
6865 |
|
6866 |
+
// EXTERNAL MODULE: ./node_modules/classnames/index.js
|
6867 |
+
var classnames = __webpack_require__(7);
|
6868 |
+
var classnames_default = /*#__PURE__*/__webpack_require__.n(classnames);
|
|
|
|
|
|
|
|
|
6869 |
|
6870 |
+
// EXTERNAL MODULE: external {"this":["wp","htmlEntities"]}
|
6871 |
+
var external_this_wp_htmlEntities_ = __webpack_require__(70);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6872 |
|
6873 |
+
// EXTERNAL MODULE: ./client/header/style.scss
|
6874 |
+
var header_style = __webpack_require__(452);
|
|
|
|
|
|
|
6875 |
|
6876 |
+
// EXTERNAL MODULE: ./node_modules/react-click-outside/dist/index.js
|
6877 |
+
var dist = __webpack_require__(419);
|
6878 |
+
var dist_default = /*#__PURE__*/__webpack_require__.n(dist);
|
|
|
|
|
|
|
|
|
|
|
|
|
6879 |
|
6880 |
+
// EXTERNAL MODULE: ./node_modules/@wordpress/components/build-module/button/index.js
|
6881 |
+
var build_module_button = __webpack_require__(69);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6882 |
|
6883 |
+
// EXTERNAL MODULE: ./node_modules/@wordpress/components/build-module/navigable-container/menu.js + 1 modules
|
6884 |
+
var menu = __webpack_require__(430);
|
|
|
|
|
|
|
6885 |
|
6886 |
+
// EXTERNAL MODULE: ./node_modules/gridicons/dist/pages.js
|
6887 |
+
var dist_pages = __webpack_require__(420);
|
6888 |
+
var pages_default = /*#__PURE__*/__webpack_require__.n(dist_pages);
|
6889 |
|
6890 |
+
// EXTERNAL MODULE: ./node_modules/gridicons/dist/cross-small.js
|
6891 |
+
var cross_small = __webpack_require__(421);
|
6892 |
+
var cross_small_default = /*#__PURE__*/__webpack_require__.n(cross_small);
|
6893 |
|
6894 |
+
// EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/icon/index.js
|
6895 |
+
var icon = __webpack_require__(284);
|
|
|
6896 |
|
6897 |
+
// EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/lifesaver.js
|
6898 |
+
var lifesaver = __webpack_require__(757);
|
6899 |
|
6900 |
+
// EXTERNAL MODULE: ./client/header/activity-panel/style.scss
|
6901 |
+
var activity_panel_style = __webpack_require__(454);
|
6902 |
|
6903 |
+
// CONCATENATED MODULE: ./client/header/activity-panel/toggle-bubble.js
|
|
|
|
|
|
|
6904 |
|
6905 |
|
6906 |
/**
|
6907 |
+
* External dependencies
|
6908 |
*/
|
6909 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6910 |
|
|
|
6911 |
|
6912 |
+
var toggle_bubble_ActivityPanelToggleBubble = function ActivityPanelToggleBubble(_ref) {
|
6913 |
+
var _ref$height = _ref.height,
|
6914 |
+
height = _ref$height === void 0 ? 24 : _ref$height,
|
6915 |
+
_ref$width = _ref.width,
|
6916 |
+
width = _ref$width === void 0 ? 24 : _ref$width,
|
6917 |
+
_ref$hasUnread = _ref.hasUnread,
|
6918 |
+
hasUnread = _ref$hasUnread === void 0 ? false : _ref$hasUnread;
|
6919 |
+
var classes = classnames_default()('woocommerce-layout__activity-panel-toggle-bubble', {
|
6920 |
+
'has-unread': hasUnread
|
6921 |
+
});
|
6922 |
+
/* eslint-disable max-len */
|
6923 |
|
6924 |
+
return Object(external_this_wp_element_["createElement"])("div", {
|
6925 |
+
className: classes
|
6926 |
+
}, Object(external_this_wp_element_["createElement"])("svg", {
|
6927 |
+
height: height,
|
6928 |
+
width: width,
|
6929 |
+
viewBox: "0 0 24 24"
|
6930 |
+
}, Object(external_this_wp_element_["createElement"])("path", {
|
6931 |
+
d: "M18.9 2H5.1C3.4 2 2 3.4 2 5.1v10.7C2 17.6 3.4 19 5.1 19H9l6 3-1-3h4.9c1.7 0 3.1-1.4 3.1-3.1V5.1C22 3.4 20.6 2 18.9 2zm-1.5 4.5c-.4.8-.8 2.1-1 3.9-.3 1.8-.4 3.1-.3 4.1 0 .3 0 .5-.1.7-.1.2-.3.4-.6.4s-.6-.1-.9-.4c-1-1-1.8-2.6-2.4-4.6-.7 1.4-1.2 2.4-1.6 3.1-.6 1.2-1.2 1.8-1.6 1.9-.3 0-.5-.2-.8-.7-.5-1.4-1.1-4.2-1.7-8.2 0-.3 0-.5.2-.7.1-.2.4-.3.7-.4.5 0 .9.2.9.8.3 2.3.7 4.2 1.1 5.7l2.4-4.5c.2-.4.4-.6.8-.6.5 0 .8.3.9.9.3 1.4.6 2.6 1 3.7.3-2.7.8-4.7 1.4-5.9.2-.3.4-.5.7-.5.2 0 .5.1.7.2.2.2.3.4.3.6 0 .2 0 .4-.1.5z"
|
6932 |
+
})));
|
6933 |
+
/* eslint-enable max-len */
|
6934 |
+
};
|
6935 |
|
6936 |
+
toggle_bubble_ActivityPanelToggleBubble.propTypes = {
|
6937 |
+
height: prop_types_default.a.number,
|
6938 |
+
width: prop_types_default.a.number,
|
6939 |
+
hasUnread: prop_types_default.a.bool
|
6940 |
+
};
|
6941 |
+
/* harmony default export */ var toggle_bubble = (toggle_bubble_ActivityPanelToggleBubble);
|
6942 |
+
// EXTERNAL MODULE: ./client/analytics/settings/config.js + 1 modules
|
6943 |
+
var config = __webpack_require__(279);
|
6944 |
|
6945 |
+
// EXTERNAL MODULE: ./client/wc-api/constants.js
|
6946 |
+
var constants = __webpack_require__(30);
|
6947 |
|
6948 |
+
// EXTERNAL MODULE: ./client/header/activity-panel/panels/inbox/utils.js
|
6949 |
+
var inbox_utils = __webpack_require__(276);
|
6950 |
+
|
6951 |
+
// CONCATENATED MODULE: ./client/header/activity-panel/unread-indicators.js
|
6952 |
+
/**
|
6953 |
+
* WooCommerce dependencies
|
|
|
|
|
6954 |
*/
|
6955 |
|
6956 |
+
/**
|
6957 |
+
* Internal dependencies
|
6958 |
+
*/
|
|
|
|
|
|
|
6959 |
|
6960 |
|
|
|
6961 |
|
|
|
|
|
6962 |
|
|
|
6963 |
|
6964 |
+
function getUnreadNotes(select) {
|
6965 |
+
var _select = select('wc-api'),
|
6966 |
+
getNotes = _select.getNotes,
|
6967 |
+
getNotesError = _select.getNotesError,
|
6968 |
+
isGetNotesRequesting = _select.isGetNotesRequesting;
|
6969 |
|
6970 |
+
var _select2 = select(external_this_wc_data_["USER_STORE_NAME"]),
|
6971 |
+
getCurrentUser = _select2.getCurrentUser;
|
6972 |
|
6973 |
+
var userData = getCurrentUser();
|
6974 |
+
var lastRead = parseInt(userData && userData.woocommerce_meta && userData.woocommerce_meta.activity_panel_inbox_last_read, 10);
|
6975 |
|
6976 |
+
if (!lastRead) {
|
6977 |
+
return null;
|
6978 |
+
} // @todo This method would be more performant if we ask only for 1 item per page with status "unactioned".
|
6979 |
+
// This change should be applied after having pagination implemented.
|
6980 |
|
|
|
|
|
|
|
6981 |
|
6982 |
+
var notesQuery = {
|
6983 |
+
page: 1,
|
6984 |
+
per_page: constants["d" /* QUERY_DEFAULTS */].pageSize,
|
6985 |
+
status: 'unactioned',
|
6986 |
+
type: constants["d" /* QUERY_DEFAULTS */].noteTypes,
|
6987 |
+
orderby: 'date',
|
6988 |
+
order: 'desc'
|
6989 |
+
}; // Disable eslint rule requiring `latestNotes` to be defined below because the next two statements
|
6990 |
+
// depend on `getNotes` to have been called.
|
6991 |
+
// eslint-disable-next-line @wordpress/no-unused-vars-before-return
|
6992 |
|
6993 |
+
var latestNotes = getNotes(notesQuery);
|
6994 |
+
var isError = Boolean(getNotesError(notesQuery));
|
6995 |
+
var isRequesting = isGetNotesRequesting(notesQuery);
|
6996 |
|
6997 |
+
if (isError || isRequesting) {
|
6998 |
+
return null;
|
6999 |
+
}
|
7000 |
|
7001 |
+
var unreadNotesCount = Object(inbox_utils["a" /* getUnreadNotesCount */])(latestNotes, lastRead);
|
7002 |
+
return unreadNotesCount > 0;
|
7003 |
}
|
7004 |
+
function getUnreadOrders(select) {
|
7005 |
+
var _select3 = select('wc-api'),
|
7006 |
+
getItems = _select3.getItems,
|
7007 |
+
getItemsTotalCount = _select3.getItemsTotalCount,
|
7008 |
+
getItemsError = _select3.getItemsError,
|
7009 |
+
isGetItemsRequesting = _select3.isGetItemsRequesting;
|
7010 |
|
7011 |
+
var _select4 = select(external_this_wc_data_["SETTINGS_STORE_NAME"]),
|
7012 |
+
getMutableSetting = _select4.getSetting;
|
7013 |
|
7014 |
+
var _getMutableSetting = getMutableSetting('wc_admin', 'wcAdminSettings', {}),
|
7015 |
+
_getMutableSetting$wo = _getMutableSetting.woocommerce_actionable_order_statuses,
|
7016 |
+
orderStatuses = _getMutableSetting$wo === void 0 ? config["a" /* DEFAULT_ACTIONABLE_STATUSES */] : _getMutableSetting$wo;
|
7017 |
|
7018 |
+
if (!orderStatuses.length) {
|
7019 |
+
return false;
|
7020 |
+
}
|
7021 |
|
7022 |
+
var ordersQuery = {
|
7023 |
+
page: 1,
|
7024 |
+
per_page: 1,
|
7025 |
+
// Core endpoint requires per_page > 0.
|
7026 |
+
status: orderStatuses,
|
7027 |
+
_fields: ['id']
|
7028 |
+
};
|
7029 |
+
getItems('orders', ordersQuery); // Disable eslint rule requiring `latestNote` to be defined below because the next two statements
|
7030 |
+
// depend on `getItemsTotalCount` to have been called.
|
7031 |
+
// eslint-disable-next-line @wordpress/no-unused-vars-before-return
|
7032 |
|
7033 |
+
var totalOrders = getItemsTotalCount('orders', ordersQuery);
|
7034 |
+
var isError = Boolean(getItemsError('orders', ordersQuery));
|
7035 |
+
var isRequesting = isGetItemsRequesting('orders', ordersQuery);
|
7036 |
|
7037 |
+
if (isError || isRequesting) {
|
7038 |
+
return null;
|
7039 |
+
}
|
7040 |
|
7041 |
+
return totalOrders > 0;
|
7042 |
+
}
|
7043 |
+
function getUnapprovedReviews(select) {
|
7044 |
+
var _select5 = select('wc-api'),
|
7045 |
+
getReviewsTotalCount = _select5.getReviewsTotalCount,
|
7046 |
+
getReviewsError = _select5.getReviewsError,
|
7047 |
+
isGetReviewsRequesting = _select5.isGetReviewsRequesting;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7048 |
|
7049 |
+
var reviewsEnabled = Object(settings["g" /* getSetting */])('reviewsEnabled');
|
7050 |
|
7051 |
+
if (reviewsEnabled === 'yes') {
|
7052 |
+
var actionableReviewsQuery = {
|
7053 |
+
page: 1,
|
7054 |
+
// @todo we are not using this review, so when the endpoint supports it,
|
7055 |
+
// it could be replaced with `per_page: 0`
|
7056 |
+
per_page: 1,
|
7057 |
+
status: 'hold'
|
7058 |
+
};
|
7059 |
+
var totalActionableReviews = getReviewsTotalCount(actionableReviewsQuery);
|
7060 |
+
var isActionableReviewsError = Boolean(getReviewsError(actionableReviewsQuery));
|
7061 |
+
var isActionableReviewsRequesting = isGetReviewsRequesting(actionableReviewsQuery);
|
7062 |
|
7063 |
+
if (!isActionableReviewsError && !isActionableReviewsRequesting) {
|
7064 |
+
return totalActionableReviews > 0;
|
7065 |
+
}
|
|
|
|
|
7066 |
}
|
7067 |
|
7068 |
+
return false;
|
7069 |
+
}
|
7070 |
+
function getUnreadStock() {
|
7071 |
+
return Object(settings["g" /* getSetting */])('hasLowStock', false);
|
7072 |
+
}
|
7073 |
+
// EXTERNAL MODULE: ./client/dashboard/utils.js
|
7074 |
+
var dashboard_utils = __webpack_require__(268);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7075 |
|
7076 |
+
// EXTERNAL MODULE: ./client/lib/tracks.js
|
7077 |
+
var tracks = __webpack_require__(64);
|
|
|
|
|
|
|
7078 |
|
7079 |
+
// EXTERNAL MODULE: ./client/wc-api/with-select.js
|
7080 |
+
var with_select = __webpack_require__(104);
|
|
|
7081 |
|
7082 |
+
// CONCATENATED MODULE: ./client/header/activity-panel/index.js
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7083 |
|
|
|
|
|
|
|
|
|
7084 |
|
|
|
|
|
|
|
7085 |
|
7086 |
+
|
7087 |
+
|
7088 |
+
|
7089 |
+
|
7090 |
+
|
7091 |
+
function activity_panel_createSuper(Derived) { var hasNativeReflectConstruct = activity_panel_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = getPrototypeOf_default()(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = getPrototypeOf_default()(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return possibleConstructorReturn_default()(this, result); }; }
|
7092 |
+
|
7093 |
+
function activity_panel_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
|
7094 |
+
|
7095 |
/**
|
7096 |
+
* External dependencies
|
|
|
|
|
|
|
7097 |
*/
|
7098 |
|
|
|
|
|
|
|
7099 |
|
|
|
7100 |
|
|
|
|
|
7101 |
|
|
|
7102 |
|
|
|
7103 |
|
|
|
|
|
7104 |
|
|
|
7105 |
|
7106 |
|
|
|
7107 |
|
7108 |
+
/**
|
7109 |
+
* WooCommerce dependencies
|
7110 |
+
*/
|
7111 |
|
|
|
|
|
|
|
|
|
|
|
|
|
7112 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7113 |
|
|
|
|
|
|
|
7114 |
|
|
|
|
|
|
|
7115 |
|
7116 |
+
/**
|
7117 |
+
* Internal dependencies
|
7118 |
+
*/
|
|
|
|
|
|
|
|
|
7119 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7120 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7121 |
|
|
|
|
|
7122 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7123 |
|
7124 |
+
var HelpPanel = Object(external_this_wp_element_["lazy"])(function () {
|
7125 |
+
return Promise.all(/* import() | activity-panels-help */[__webpack_require__.e(4), __webpack_require__.e(7), __webpack_require__.e(9)]).then(__webpack_require__.bind(null, 941));
|
7126 |
+
});
|
7127 |
+
var InboxPanel = Object(external_this_wp_element_["lazy"])(function () {
|
7128 |
+
return Promise.all(/* import() | activity-panels-inbox */[__webpack_require__.e(2), __webpack_require__.e(4), __webpack_require__.e(5), __webpack_require__.e(49), __webpack_require__.e(10)]).then(__webpack_require__.bind(null, 801));
|
7129 |
+
});
|
7130 |
+
var OrdersPanel = Object(external_this_wp_element_["lazy"])(function () {
|
7131 |
+
return Promise.all(/* import() | activity-panels-orders */[__webpack_require__.e(2), __webpack_require__.e(4), __webpack_require__.e(11)]).then(__webpack_require__.bind(null, 945));
|
7132 |
+
});
|
7133 |
+
var StockPanel = Object(external_this_wp_element_["lazy"])(function () {
|
7134 |
+
return Promise.all(/* import() | activity-panels-stock */[__webpack_require__.e(2), __webpack_require__.e(4), __webpack_require__.e(12)]).then(__webpack_require__.bind(null, 942));
|
7135 |
+
});
|
7136 |
+
var ReviewsPanel = Object(external_this_wp_element_["lazy"])(function () {
|
7137 |
+
return Promise.all(/* import() | activity-panels-inbox */[__webpack_require__.e(2), __webpack_require__.e(4), __webpack_require__.e(5), __webpack_require__.e(49), __webpack_require__.e(10)]).then(__webpack_require__.bind(null, 932));
|
7138 |
+
});
|
7139 |
|
|
|
|
|
|
|
7140 |
|
7141 |
+
var manageStock = Object(settings["g" /* getSetting */])('manageStock', 'no');
|
7142 |
+
var activity_panel_reviewsEnabled = Object(settings["g" /* getSetting */])('reviewsEnabled', 'no');
|
7143 |
+
var activity_panel_ActivityPanel = /*#__PURE__*/function (_Component) {
|
7144 |
+
inherits_default()(ActivityPanel, _Component);
|
7145 |
|
7146 |
+
var _super = activity_panel_createSuper(ActivityPanel);
|
7147 |
|
7148 |
+
function ActivityPanel() {
|
7149 |
+
var _this;
|
7150 |
|
7151 |
+
classCallCheck_default()(this, ActivityPanel);
|
|
|
|
|
7152 |
|
7153 |
+
_this = _super.apply(this, arguments);
|
7154 |
+
_this.togglePanel = _this.togglePanel.bind(assertThisInitialized_default()(_this));
|
7155 |
+
_this.clearPanel = _this.clearPanel.bind(assertThisInitialized_default()(_this));
|
7156 |
+
_this.toggleMobile = _this.toggleMobile.bind(assertThisInitialized_default()(_this));
|
7157 |
+
_this.renderTab = _this.renderTab.bind(assertThisInitialized_default()(_this));
|
7158 |
+
_this.state = {
|
7159 |
+
isPanelOpen: false,
|
7160 |
+
mobileOpen: false,
|
7161 |
+
currentTab: '',
|
7162 |
+
isPanelSwitching: false
|
7163 |
+
};
|
7164 |
+
return _this;
|
7165 |
+
}
|
7166 |
|
7167 |
+
createClass_default()(ActivityPanel, [{
|
7168 |
+
key: "togglePanel",
|
7169 |
+
value: function togglePanel(tabName) {
|
7170 |
+
var _this$state = this.state,
|
7171 |
+
isPanelOpen = _this$state.isPanelOpen,
|
7172 |
+
currentTab = _this$state.currentTab; // If a panel is being opened, or if an existing panel is already open and a different one is being opened, record a track.
|
7173 |
|
7174 |
+
if (!isPanelOpen || tabName !== currentTab) {
|
7175 |
+
Object(tracks["b" /* recordEvent */])('activity_panel_open', {
|
7176 |
+
tab: tabName
|
7177 |
+
});
|
7178 |
+
}
|
|
|
7179 |
|
7180 |
+
this.setState(function (state) {
|
7181 |
+
if (tabName === state.currentTab || state.currentTab === '') {
|
7182 |
+
return {
|
7183 |
+
isPanelOpen: !state.isPanelOpen,
|
7184 |
+
currentTab: tabName,
|
7185 |
+
mobileOpen: !state.isPanelOpen
|
7186 |
+
};
|
7187 |
+
}
|
7188 |
|
7189 |
+
return {
|
7190 |
+
currentTab: tabName,
|
7191 |
+
isPanelSwitching: true
|
7192 |
+
};
|
7193 |
+
});
|
7194 |
}
|
7195 |
+
}, {
|
7196 |
+
key: "clearPanel",
|
7197 |
+
value: function clearPanel() {
|
7198 |
+
this.setState(function (_ref) {
|
7199 |
+
var isPanelOpen = _ref.isPanelOpen;
|
7200 |
+
return isPanelOpen ? {
|
7201 |
+
isPanelSwitching: false
|
7202 |
+
} : {
|
7203 |
+
currentTab: ''
|
7204 |
+
};
|
7205 |
});
|
7206 |
+
} // On smaller screen, the panel buttons are hidden behind a toggle.
|
7207 |
|
7208 |
+
}, {
|
7209 |
+
key: "toggleMobile",
|
7210 |
+
value: function toggleMobile() {
|
7211 |
+
var tabs = this.getTabs();
|
7212 |
+
this.setState(function (state) {
|
7213 |
+
return {
|
7214 |
+
mobileOpen: !state.mobileOpen,
|
7215 |
+
currentTab: state.mobileOpen ? '' : tabs[0].name,
|
7216 |
+
isPanelOpen: !state.mobileOpen
|
7217 |
+
};
|
7218 |
});
|
7219 |
+
}
|
7220 |
+
}, {
|
7221 |
+
key: "handleClickOutside",
|
7222 |
+
value: function handleClickOutside(event) {
|
7223 |
+
var _this$state2 = this.state,
|
7224 |
+
isPanelOpen = _this$state2.isPanelOpen,
|
7225 |
+
currentTab = _this$state2.currentTab;
|
7226 |
+
var isClickOnModalOrSnackbar = event.target.closest('.woocommerce-inbox-dismiss-confirmation_modal') || event.target.closest('.components-snackbar__action');
|
7227 |
|
7228 |
+
if (isPanelOpen && !isClickOnModalOrSnackbar) {
|
7229 |
+
this.togglePanel(currentTab);
|
7230 |
+
}
|
7231 |
+
} // @todo Pull in dynamic unread status/count
|
7232 |
|
7233 |
+
}, {
|
7234 |
+
key: "getTabs",
|
7235 |
+
value: function getTabs() {
|
7236 |
+
var _this$props = this.props,
|
7237 |
+
hasUnreadNotes = _this$props.hasUnreadNotes,
|
7238 |
+
hasUnreadOrders = _this$props.hasUnreadOrders,
|
7239 |
+
hasUnapprovedReviews = _this$props.hasUnapprovedReviews,
|
7240 |
+
hasUnreadStock = _this$props.hasUnreadStock,
|
7241 |
+
isEmbedded = _this$props.isEmbedded,
|
7242 |
+
requestingTaskListOptions = _this$props.requestingTaskListOptions,
|
7243 |
+
taskListComplete = _this$props.taskListComplete,
|
7244 |
+
taskListHidden = _this$props.taskListHidden,
|
7245 |
+
query = _this$props.query; // Don't show the inbox on the Home screen.
|
7246 |
|
7247 |
+
var _this$props$getHistor = this.props.getHistory(),
|
7248 |
+
location = _this$props$getHistor.location;
|
7249 |
|
7250 |
+
var showInbox = isEmbedded || !window.wcAdminFeatures.homescreen || location.pathname !== '/';
|
7251 |
+
var isPerformingSetupTask = query.task && !query.path && (requestingTaskListOptions === true || taskListHidden === false && taskListComplete === false);
|
7252 |
+
return [!isPerformingSetupTask && showInbox ? {
|
7253 |
+
name: 'inbox',
|
7254 |
+
title: Object(external_this_wp_i18n_["__"])('Inbox', 'woocommerce-admin'),
|
7255 |
+
icon: Object(external_this_wp_element_["createElement"])("i", {
|
7256 |
+
className: "material-icons-outlined"
|
7257 |
+
}, "inbox"),
|
7258 |
+
unread: hasUnreadNotes
|
7259 |
+
} : null, !isPerformingSetupTask && {
|
7260 |
+
name: 'orders',
|
7261 |
+
title: Object(external_this_wp_i18n_["__"])('Orders', 'woocommerce-admin'),
|
7262 |
+
icon: Object(external_this_wp_element_["createElement"])(pages_default.a, null),
|
7263 |
+
unread: hasUnreadOrders
|
7264 |
+
}, !isPerformingSetupTask && manageStock === 'yes' ? {
|
7265 |
+
name: 'stock',
|
7266 |
+
title: Object(external_this_wp_i18n_["__"])('Stock', 'woocommerce-admin'),
|
7267 |
+
icon: Object(external_this_wp_element_["createElement"])("i", {
|
7268 |
+
className: "material-icons-outlined"
|
7269 |
+
}, "widgets"),
|
7270 |
+
unread: hasUnreadStock
|
7271 |
+
} : null, !isPerformingSetupTask && activity_panel_reviewsEnabled === 'yes' ? {
|
7272 |
+
name: 'reviews',
|
7273 |
+
title: Object(external_this_wp_i18n_["__"])('Reviews', 'woocommerce-admin'),
|
7274 |
+
icon: Object(external_this_wp_element_["createElement"])("i", {
|
7275 |
+
className: "material-icons-outlined"
|
7276 |
+
}, "star_border"),
|
7277 |
+
unread: hasUnapprovedReviews
|
7278 |
+
} : null, isPerformingSetupTask && {
|
7279 |
+
name: 'help',
|
7280 |
+
title: Object(external_this_wp_i18n_["__"])('Help', 'woocommerce-admin'),
|
7281 |
+
icon: Object(external_this_wp_element_["createElement"])(icon["a" /* default */], {
|
7282 |
+
icon: lifesaver["a" /* default */]
|
7283 |
+
})
|
7284 |
+
}].filter(Boolean);
|
7285 |
}
|
7286 |
+
}, {
|
7287 |
+
key: "getPanelContent",
|
7288 |
+
value: function getPanelContent(tab) {
|
7289 |
+
switch (tab) {
|
7290 |
+
case 'inbox':
|
7291 |
+
return Object(external_this_wp_element_["createElement"])(InboxPanel, null);
|
7292 |
|
7293 |
+
case 'orders':
|
7294 |
+
var hasUnreadOrders = this.props.hasUnreadOrders;
|
7295 |
+
return Object(external_this_wp_element_["createElement"])(OrdersPanel, {
|
7296 |
+
hasActionableOrders: hasUnreadOrders
|
7297 |
+
});
|
7298 |
|
7299 |
+
case 'stock':
|
7300 |
+
return Object(external_this_wp_element_["createElement"])(StockPanel, null);
|
|
|
|
|
|
|
7301 |
|
7302 |
+
case 'reviews':
|
7303 |
+
var hasUnapprovedReviews = this.props.hasUnapprovedReviews;
|
7304 |
+
return Object(external_this_wp_element_["createElement"])(ReviewsPanel, {
|
7305 |
+
hasUnapprovedReviews: hasUnapprovedReviews
|
7306 |
+
});
|
7307 |
|
7308 |
+
case 'help':
|
7309 |
+
var query = this.props.query;
|
7310 |
+
var task = query.task;
|
7311 |
+
return Object(external_this_wp_element_["createElement"])(HelpPanel, {
|
7312 |
+
taskName: task
|
7313 |
+
});
|
7314 |
|
7315 |
+
default:
|
7316 |
+
return null;
|
7317 |
+
}
|
7318 |
+
}
|
7319 |
+
}, {
|
7320 |
+
key: "renderPanel",
|
7321 |
+
value: function renderPanel() {
|
7322 |
+
var _this$state3 = this.state,
|
7323 |
+
isPanelOpen = _this$state3.isPanelOpen,
|
7324 |
+
currentTab = _this$state3.currentTab,
|
7325 |
+
isPanelSwitching = _this$state3.isPanelSwitching;
|
7326 |
+
var tab = Object(external_lodash_["find"])(this.getTabs(), {
|
7327 |
+
name: currentTab
|
7328 |
+
});
|
7329 |
|
7330 |
+
if (!tab) {
|
7331 |
+
return Object(external_this_wp_element_["createElement"])("div", {
|
7332 |
+
className: "woocommerce-layout__activity-panel-wrapper"
|
7333 |
+
});
|
7334 |
+
}
|
7335 |
+
|
7336 |
+
var classNames = classnames_default()('woocommerce-layout__activity-panel-wrapper', {
|
7337 |
+
'is-open': isPanelOpen,
|
7338 |
+
'is-switching': isPanelSwitching
|
7339 |
+
});
|
7340 |
+
return Object(external_this_wp_element_["createElement"])("div", {
|
7341 |
+
className: classNames,
|
7342 |
+
tabIndex: 0,
|
7343 |
+
role: "tabpanel",
|
7344 |
+
"aria-label": tab.title,
|
7345 |
+
onTransitionEnd: this.clearPanel,
|
7346 |
+
onAnimationEnd: this.clearPanel
|
7347 |
+
}, Object(external_this_wp_element_["createElement"])("div", {
|
7348 |
+
className: "woocommerce-layout__activity-panel-content",
|
7349 |
+
key: 'activity-panel-' + currentTab,
|
7350 |
+
id: 'activity-panel-' + currentTab
|
7351 |
+
}, Object(external_this_wp_element_["createElement"])(external_this_wp_element_["Suspense"], {
|
7352 |
+
fallback: Object(external_this_wp_element_["createElement"])(external_this_wc_components_["Spinner"], null)
|
7353 |
+
}, this.getPanelContent(currentTab))));
|
7354 |
}
|
7355 |
+
}, {
|
7356 |
+
key: "renderTab",
|
7357 |
+
value: function renderTab(tab, i) {
|
7358 |
+
var _this$state4 = this.state,
|
7359 |
+
currentTab = _this$state4.currentTab,
|
7360 |
+
isPanelOpen = _this$state4.isPanelOpen;
|
7361 |
+
var className = classnames_default()('woocommerce-layout__activity-panel-tab', {
|
7362 |
+
'is-active': isPanelOpen && tab.name === currentTab,
|
7363 |
+
'has-unread': tab.unread
|
7364 |
+
});
|
7365 |
+
var selected = tab.name === currentTab;
|
7366 |
+
var tabIndex = -1; // Only make this item tabbable if it is the currently selected item, or the panel is closed and the item is the first item.
|
7367 |
|
7368 |
+
if (selected || !isPanelOpen && i === 0) {
|
7369 |
+
tabIndex = null;
|
7370 |
+
}
|
7371 |
|
7372 |
+
return Object(external_this_wp_element_["createElement"])(build_module_button["a" /* default */], {
|
7373 |
+
role: "tab",
|
7374 |
+
className: className,
|
7375 |
+
tabIndex: tabIndex,
|
7376 |
+
"aria-selected": selected,
|
7377 |
+
"aria-controls": 'activity-panel-' + tab.name,
|
7378 |
+
key: 'activity-panel-tab-' + tab.name,
|
7379 |
+
id: 'activity-panel-tab-' + tab.name,
|
7380 |
+
onClick: Object(external_lodash_["partial"])(this.togglePanel, tab.name)
|
7381 |
+
}, tab.icon, tab.title, ' ', tab.unread && Object(external_this_wp_element_["createElement"])("span", {
|
7382 |
+
className: "screen-reader-text"
|
7383 |
+
}, Object(external_this_wp_i18n_["__"])('unread activity', 'woocommerce-admin')));
|
7384 |
+
}
|
7385 |
+
}, {
|
7386 |
+
key: "render",
|
7387 |
+
value: function render() {
|
7388 |
+
var tabs = this.getTabs();
|
7389 |
+
var mobileOpen = this.state.mobileOpen;
|
7390 |
+
var headerId = Object(external_lodash_["uniqueId"])('activity-panel-header_');
|
7391 |
+
var panelClasses = classnames_default()('woocommerce-layout__activity-panel', {
|
7392 |
+
'is-mobile-open': this.state.mobileOpen
|
7393 |
+
});
|
7394 |
+
var hasUnread = tabs.some(function (tab) {
|
7395 |
+
return tab.unread;
|
7396 |
+
});
|
7397 |
+
var viewLabel = hasUnread ? Object(external_this_wp_i18n_["__"])('View Activity Panel, you have unread activity', 'woocommerce-admin') : Object(external_this_wp_i18n_["__"])('View Activity Panel', 'woocommerce-admin');
|
7398 |
+
return Object(external_this_wp_element_["createElement"])("div", null, Object(external_this_wp_element_["createElement"])(external_this_wc_components_["H"], {
|
7399 |
+
id: headerId,
|
7400 |
+
className: "screen-reader-text"
|
7401 |
+
}, Object(external_this_wp_i18n_["__"])('Store Activity', 'woocommerce-admin')), Object(external_this_wp_element_["createElement"])(external_this_wc_components_["Section"], {
|
7402 |
+
component: "aside",
|
7403 |
+
id: "woocommerce-activity-panel",
|
7404 |
+
"aria-labelledby": headerId
|
7405 |
+
}, Object(external_this_wp_element_["createElement"])(build_module_button["a" /* default */], {
|
7406 |
+
onClick: this.toggleMobile,
|
7407 |
+
label: mobileOpen ? Object(external_this_wp_i18n_["__"])('Close Activity Panel', 'woocommerce-admin') : viewLabel,
|
7408 |
+
"aria-expanded": mobileOpen,
|
7409 |
+
className: "woocommerce-layout__activity-panel-mobile-toggle"
|
7410 |
+
}, mobileOpen ? Object(external_this_wp_element_["createElement"])(cross_small_default.a, null) : Object(external_this_wp_element_["createElement"])(toggle_bubble, {
|
7411 |
+
hasUnread: hasUnread
|
7412 |
+
})), Object(external_this_wp_element_["createElement"])("div", {
|
7413 |
+
className: panelClasses
|
7414 |
+
}, Object(external_this_wp_element_["createElement"])(menu["a" /* default */], {
|
7415 |
+
role: "tablist",
|
7416 |
+
orientation: "horizontal",
|
7417 |
+
className: "woocommerce-layout__activity-panel-tabs"
|
7418 |
+
}, tabs && tabs.map(this.renderTab)), this.renderPanel())));
|
7419 |
}
|
7420 |
+
}]);
|
7421 |
|
7422 |
+
return ActivityPanel;
|
7423 |
+
}(external_this_wp_element_["Component"]);
|
7424 |
+
activity_panel_ActivityPanel.defaultProps = {
|
7425 |
+
getHistory: external_this_wc_navigation_["getHistory"]
|
7426 |
+
};
|
7427 |
+
/* harmony default export */ var activity_panel = (Object(compose["a" /* default */])(Object(with_select["a" /* default */])(function (select) {
|
7428 |
+
var hasUnreadNotes = getUnreadNotes(select);
|
7429 |
+
var hasUnreadOrders = getUnreadOrders(select);
|
7430 |
+
var hasUnreadStock = getUnreadStock();
|
7431 |
+
var hasUnapprovedReviews = getUnapprovedReviews(select);
|
7432 |
|
7433 |
+
var _select = select(external_this_wc_data_["OPTIONS_STORE_NAME"]),
|
7434 |
+
getOption = _select.getOption,
|
7435 |
+
isResolving = _select.isResolving;
|
7436 |
|
7437 |
+
var requestingTaskListOptions, taskListComplete, taskListHidden;
|
|
|
7438 |
|
7439 |
+
if (Object(dashboard_utils["e" /* isOnboardingEnabled */])()) {
|
7440 |
+
taskListComplete = getOption('woocommerce_task_list_complete') === 'yes';
|
7441 |
+
taskListHidden = getOption('woocommerce_task_list_hidden') === 'yes';
|
7442 |
+
requestingTaskListOptions = isResolving('getOption', ['woocommerce_task_list_complete']) || isResolving('getOption', ['woocommerce_task_list_hidden']);
|
7443 |
+
}
|
7444 |
+
|
7445 |
+
return {
|
7446 |
+
hasUnreadNotes: hasUnreadNotes,
|
7447 |
+
hasUnreadOrders: hasUnreadOrders,
|
7448 |
+
hasUnreadStock: hasUnreadStock,
|
7449 |
+
hasUnapprovedReviews: hasUnapprovedReviews,
|
7450 |
+
requestingTaskListOptions: requestingTaskListOptions,
|
7451 |
+
taskListComplete: taskListComplete,
|
7452 |
+
taskListHidden: taskListHidden
|
7453 |
};
|
7454 |
+
}), dist_default.a)(activity_panel_ActivityPanel));
|
7455 |
+
// CONCATENATED MODULE: ./client/header/index.js
|
7456 |
+
|
7457 |
+
|
7458 |
+
|
7459 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7460 |
|
7461 |
+
|
7462 |
+
|
7463 |
+
|
7464 |
+
function header_createSuper(Derived) { var hasNativeReflectConstruct = header_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = getPrototypeOf_default()(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = getPrototypeOf_default()(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return possibleConstructorReturn_default()(this, result); }; }
|
7465 |
+
|
7466 |
+
function header_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7467 |
|
7468 |
/**
|
7469 |
+
* External dependencies
|
7470 |
*/
|
7471 |
|
|
|
|
|
|
|
|
|
7472 |
|
|
|
|
|
7473 |
|
|
|
|
|
|
|
|
|
|
|
|
|
7474 |
|
|
|
7475 |
|
7476 |
+
/**
|
7477 |
+
* WooCommerce dependencies
|
7478 |
+
*/
|
7479 |
|
|
|
|
|
7480 |
|
|
|
|
|
|
|
7481 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7482 |
|
7483 |
+
/**
|
7484 |
+
* Internal dependencies
|
7485 |
+
*/
|
7486 |
|
|
|
|
|
|
|
7487 |
|
|
|
|
|
|
|
|
|
|
|
|
|
7488 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7489 |
|
|
|
|
|
|
|
|
|
|
|
7490 |
|
7491 |
+
var header_Header = /*#__PURE__*/function (_Component) {
|
7492 |
+
inherits_default()(Header, _Component);
|
7493 |
|
7494 |
+
var _super = header_createSuper(Header);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7495 |
|
7496 |
+
function Header() {
|
7497 |
+
var _this;
|
7498 |
|
7499 |
+
classCallCheck_default()(this, Header);
|
|
|
|
|
7500 |
|
7501 |
+
_this = _super.call(this);
|
7502 |
+
_this.state = {
|
7503 |
+
isScrolled: false
|
7504 |
+
};
|
7505 |
+
_this.headerRef = Object(external_this_wp_element_["createRef"])();
|
7506 |
+
_this.onWindowScroll = _this.onWindowScroll.bind(assertThisInitialized_default()(_this));
|
7507 |
+
_this.updateIsScrolled = _this.updateIsScrolled.bind(assertThisInitialized_default()(_this));
|
7508 |
+
_this.trackLinkClick = _this.trackLinkClick.bind(assertThisInitialized_default()(_this));
|
7509 |
+
_this.updateDocumentTitle = _this.updateDocumentTitle.bind(assertThisInitialized_default()(_this));
|
7510 |
+
return _this;
|
7511 |
+
}
|
7512 |
|
7513 |
+
createClass_default()(Header, [{
|
7514 |
+
key: "componentDidMount",
|
7515 |
+
value: function componentDidMount() {
|
7516 |
+
this.threshold = this.headerRef.current.offsetTop;
|
7517 |
+
window.addEventListener('scroll', this.onWindowScroll);
|
7518 |
+
this.updateIsScrolled();
|
7519 |
+
}
|
7520 |
+
}, {
|
7521 |
+
key: "componentWillUnmount",
|
7522 |
+
value: function componentWillUnmount() {
|
7523 |
+
window.removeEventListener('scroll', this.onWindowScroll);
|
7524 |
+
window.cancelAnimationFrame(this.handle);
|
7525 |
+
}
|
7526 |
+
}, {
|
7527 |
+
key: "onWindowScroll",
|
7528 |
+
value: function onWindowScroll() {
|
7529 |
+
this.handle = window.requestAnimationFrame(this.updateIsScrolled);
|
7530 |
}
|
7531 |
+
}, {
|
7532 |
+
key: "updateIsScrolled",
|
7533 |
+
value: function updateIsScrolled() {
|
7534 |
+
var isScrolled = window.pageYOffset > this.threshold - 20;
|
7535 |
|
7536 |
+
if (isScrolled !== this.state.isScrolled) {
|
7537 |
+
this.setState({
|
7538 |
+
isScrolled: isScrolled
|
7539 |
+
});
|
7540 |
+
}
|
7541 |
+
}
|
7542 |
+
}, {
|
7543 |
+
key: "trackLinkClick",
|
7544 |
+
value: function trackLinkClick(event) {
|
7545 |
+
var href = event.target.closest('a').getAttribute('href');
|
7546 |
+
Object(tracks["b" /* recordEvent */])('navbar_breadcrumb_click', {
|
7547 |
+
href: href,
|
7548 |
+
text: event.target.innerText
|
7549 |
+
});
|
7550 |
+
}
|
7551 |
+
}, {
|
7552 |
+
key: "updateDocumentTitle",
|
7553 |
+
value: function updateDocumentTitle() {
|
7554 |
+
var _this$props = this.props,
|
7555 |
+
sections = _this$props.sections,
|
7556 |
+
isEmbedded = _this$props.isEmbedded; // Don't modify the document title on existing WooCommerce pages.
|
7557 |
|
7558 |
+
if (isEmbedded) {
|
7559 |
+
return;
|
7560 |
+
}
|
|
|
7561 |
|
7562 |
+
var _sections = Array.isArray(sections) ? sections : [sections];
|
|
|
7563 |
|
7564 |
+
var documentTitle = _sections.map(function (section) {
|
7565 |
+
return Array.isArray(section) ? section[1] : section;
|
7566 |
+
}).reverse().join(' ‹ ');
|
|
|
|
|
|
|
|
|
7567 |
|
7568 |
+
document.title = Object(external_this_wp_htmlEntities_["decodeEntities"])(Object(external_this_wp_i18n_["sprintf"])(Object(external_this_wp_i18n_["__"])('%1$s ‹ %2$s — WooCommerce', 'woocommerce-admin'), documentTitle, Object(settings["g" /* getSetting */])('siteTitle', '')));
|
7569 |
+
}
|
7570 |
+
}, {
|
7571 |
+
key: "render",
|
7572 |
+
value: function render() {
|
7573 |
+
var _this2 = this;
|
7574 |
|
7575 |
+
var _this$props2 = this.props,
|
7576 |
+
sections = _this$props2.sections,
|
7577 |
+
isEmbedded = _this$props2.isEmbedded,
|
7578 |
+
query = _this$props2.query;
|
7579 |
+
var isScrolled = this.state.isScrolled;
|
7580 |
|
7581 |
+
var _sections = Array.isArray(sections) ? sections : [sections];
|
|
|
|
|
|
|
|
|
7582 |
|
7583 |
+
this.updateDocumentTitle();
|
7584 |
+
var className = classnames_default()('woocommerce-layout__header', {
|
7585 |
+
'is-scrolled': isScrolled
|
7586 |
+
});
|
7587 |
+
return Object(external_this_wp_element_["createElement"])("div", {
|
7588 |
+
className: className,
|
7589 |
+
ref: this.headerRef
|
7590 |
+
}, Object(external_this_wp_element_["createElement"])("h1", {
|
7591 |
+
className: "woocommerce-layout__header-breadcrumbs"
|
7592 |
+
}, _sections.map(function (section, i) {
|
7593 |
+
var sectionPiece = Array.isArray(section) ? Object(external_this_wp_element_["createElement"])(external_this_wc_components_["Link"], {
|
7594 |
+
href: isEmbedded ? Object(settings["f" /* getAdminLink */])(section[0]) : Object(external_this_wc_navigation_["getNewPath"])({}, section[0], {}),
|
7595 |
+
type: isEmbedded ? 'wp-admin' : 'wc-admin',
|
7596 |
+
onClick: _this2.trackLinkClick
|
7597 |
+
}, section[1]) : section;
|
7598 |
+
return Object(external_this_wp_element_["createElement"])("span", {
|
7599 |
+
key: i
|
7600 |
+
}, Object(external_this_wp_htmlEntities_["decodeEntities"])(sectionPiece));
|
7601 |
+
})), window.wcAdminFeatures['activity-panels'] && Object(external_this_wp_element_["createElement"])(activity_panel, {
|
7602 |
+
isEmbedded: isEmbedded,
|
7603 |
+
query: query
|
7604 |
+
}));
|
7605 |
+
}
|
7606 |
+
}]);
|
7607 |
|
7608 |
+
return Header;
|
7609 |
+
}(external_this_wp_element_["Component"]);
|
7610 |
|
7611 |
+
header_Header.propTypes = {
|
7612 |
+
sections: prop_types_default.a.node.isRequired,
|
7613 |
+
isEmbedded: prop_types_default.a.bool
|
7614 |
+
};
|
7615 |
+
header_Header.defaultProps = {
|
7616 |
+
isEmbedded: false
|
7617 |
+
};
|
7618 |
+
/* harmony default export */ var header = (header_Header);
|
7619 |
+
// CONCATENATED MODULE: ./client/layout/notices.js
|
7620 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7621 |
|
7622 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7623 |
|
7624 |
|
|
|
7625 |
|
|
|
|
|
|
|
|
|
|
|
7626 |
|
7627 |
+
function notices_createSuper(Derived) { var hasNativeReflectConstruct = notices_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = getPrototypeOf_default()(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = getPrototypeOf_default()(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return possibleConstructorReturn_default()(this, result); }; }
|
|
|
|
|
7628 |
|
7629 |
+
function notices_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
|
7630 |
|
7631 |
+
/**
|
7632 |
+
* External dependencies
|
7633 |
+
*/
|
7634 |
|
7635 |
|
7636 |
+
var notices_Notices = /*#__PURE__*/function (_Component) {
|
7637 |
+
inherits_default()(Notices, _Component);
|
7638 |
|
7639 |
+
var _super = notices_createSuper(Notices);
|
|
|
|
|
|
|
|
|
7640 |
|
7641 |
+
function Notices() {
|
7642 |
+
classCallCheck_default()(this, Notices);
|
7643 |
|
7644 |
+
return _super.apply(this, arguments);
|
|
|
|
|
|
|
7645 |
}
|
7646 |
|
7647 |
+
createClass_default()(Notices, [{
|
7648 |
+
key: "render",
|
7649 |
+
value: function render() {
|
7650 |
+
return Object(external_this_wp_element_["createElement"])("div", {
|
7651 |
+
id: "woocommerce-layout__notice-list",
|
7652 |
+
className: "woocommerce-layout__notice-list"
|
7653 |
+
});
|
7654 |
+
}
|
7655 |
+
}]);
|
7656 |
|
7657 |
+
return Notices;
|
7658 |
+
}(external_this_wp_element_["Component"]);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7659 |
|
7660 |
+
/* harmony default export */ var layout_notices = (notices_Notices);
|
7661 |
+
// EXTERNAL MODULE: ./node_modules/@babel/runtime/regenerator/index.js
|
7662 |
+
var regenerator = __webpack_require__(77);
|
7663 |
+
var regenerator_default = /*#__PURE__*/__webpack_require__.n(regenerator);
|
7664 |
|
7665 |
+
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js
|
7666 |
+
var asyncToGenerator = __webpack_require__(68);
|
|
|
|
|
|
|
|
|
|
|
7667 |
|
7668 |
+
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/slicedToArray.js + 3 modules
|
7669 |
+
var slicedToArray = __webpack_require__(18);
|
|
|
7670 |
|
7671 |
+
// EXTERNAL MODULE: ./node_modules/react-spring/web.cjs.js
|
7672 |
+
var web_cjs = __webpack_require__(263);
|
|
|
|
|
|
|
7673 |
|
7674 |
+
// EXTERNAL MODULE: ./node_modules/@wordpress/compose/build-module/hooks/use-reduced-motion/index.js
|
7675 |
+
var use_reduced_motion = __webpack_require__(758);
|
|
|
7676 |
|
7677 |
+
// EXTERNAL MODULE: ./node_modules/@wordpress/components/build-module/snackbar/index.js
|
7678 |
+
var snackbar = __webpack_require__(422);
|
|
|
|
|
|
|
7679 |
|
7680 |
+
// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/snackbar/list.js
|
|
|
7681 |
|
|
|
|
|
|
|
7682 |
|
|
|
|
|
|
|
7683 |
|
|
|
|
|
7684 |
|
|
|
7685 |
|
|
|
7686 |
|
7687 |
+
/**
|
7688 |
+
* External dependencies
|
7689 |
+
*/
|
7690 |
|
|
|
|
|
|
|
|
|
7691 |
|
|
|
|
|
7692 |
|
7693 |
+
/**
|
7694 |
+
* WordPress dependencies
|
7695 |
+
*/
|
|
|
7696 |
|
|
|
|
|
7697 |
|
|
|
|
|
|
|
|
|
|
|
|
|
7698 |
|
7699 |
+
/**
|
7700 |
+
* Internal dependencies
|
7701 |
+
*/
|
7702 |
|
|
|
|
|
|
|
|
|
|
|
7703 |
|
7704 |
+
/**
|
7705 |
+
* Renders a list of notices.
|
7706 |
+
*
|
7707 |
+
* @param {Object} $0 Props passed to the component.
|
7708 |
+
* @param {Array} $0.notices Array of notices to render.
|
7709 |
+
* @param {Function} $0.onRemove Function called when a notice should be removed / dismissed.
|
7710 |
+
* @param {Object} $0.className Name of the class used by the component.
|
7711 |
+
* @param {Object} $0.children Array of children to be rendered inside the notice list.
|
7712 |
+
* @return {Object} The rendered notices list.
|
7713 |
+
*/
|
7714 |
|
7715 |
+
function SnackbarList(_ref) {
|
7716 |
+
var notices = _ref.notices,
|
7717 |
+
className = _ref.className,
|
7718 |
+
children = _ref.children,
|
7719 |
+
_ref$onRemove = _ref.onRemove,
|
7720 |
+
onRemove = _ref$onRemove === void 0 ? external_lodash_["noop"] : _ref$onRemove;
|
7721 |
+
var isReducedMotion = Object(use_reduced_motion["a" /* default */])();
|
7722 |
|
7723 |
+
var _useState = Object(external_this_wp_element_["useState"])(function () {
|
7724 |
+
return new WeakMap();
|
7725 |
+
}),
|
7726 |
+
_useState2 = Object(slicedToArray["a" /* default */])(_useState, 1),
|
7727 |
+
refMap = _useState2[0];
|
7728 |
|
7729 |
+
var transitions = Object(web_cjs["useTransition"])(notices, function (notice) {
|
7730 |
+
return notice.id;
|
7731 |
+
}, {
|
7732 |
+
from: {
|
7733 |
+
opacity: 0,
|
7734 |
+
height: 0
|
7735 |
+
},
|
7736 |
+
enter: function enter(item) {
|
7737 |
+
return /*#__PURE__*/function () {
|
7738 |
+
var _ref2 = Object(asyncToGenerator["a" /* default */])( /*#__PURE__*/regenerator_default.a.mark(function _callee(next) {
|
7739 |
+
return regenerator_default.a.wrap(function _callee$(_context) {
|
7740 |
+
while (1) {
|
7741 |
+
switch (_context.prev = _context.next) {
|
7742 |
+
case 0:
|
7743 |
+
_context.next = 2;
|
7744 |
+
return next({
|
7745 |
+
opacity: 1,
|
7746 |
+
height: refMap.get(item).offsetHeight
|
7747 |
+
});
|
7748 |
|
7749 |
+
case 2:
|
7750 |
+
return _context.abrupt("return", _context.sent);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7751 |
|
7752 |
+
case 3:
|
7753 |
+
case "end":
|
7754 |
+
return _context.stop();
|
7755 |
+
}
|
7756 |
+
}
|
7757 |
+
}, _callee);
|
7758 |
+
}));
|
7759 |
|
7760 |
+
return function (_x) {
|
7761 |
+
return _ref2.apply(this, arguments);
|
7762 |
+
};
|
7763 |
+
}();
|
7764 |
+
},
|
7765 |
+
leave: function leave() {
|
7766 |
+
return /*#__PURE__*/function () {
|
7767 |
+
var _ref3 = Object(asyncToGenerator["a" /* default */])( /*#__PURE__*/regenerator_default.a.mark(function _callee2(next) {
|
7768 |
+
return regenerator_default.a.wrap(function _callee2$(_context2) {
|
7769 |
+
while (1) {
|
7770 |
+
switch (_context2.prev = _context2.next) {
|
7771 |
+
case 0:
|
7772 |
+
_context2.next = 2;
|
7773 |
+
return next({
|
7774 |
+
opacity: 0
|
7775 |
+
});
|
7776 |
|
7777 |
+
case 2:
|
7778 |
+
_context2.next = 4;
|
7779 |
+
return next({
|
7780 |
+
height: 0
|
7781 |
+
});
|
|
|
|
|
|
|
7782 |
|
7783 |
+
case 4:
|
7784 |
+
case "end":
|
7785 |
+
return _context2.stop();
|
7786 |
+
}
|
7787 |
+
}
|
7788 |
+
}, _callee2);
|
7789 |
+
}));
|
7790 |
|
7791 |
+
return function (_x2) {
|
7792 |
+
return _ref3.apply(this, arguments);
|
7793 |
+
};
|
7794 |
+
}();
|
7795 |
+
},
|
7796 |
+
immediate: isReducedMotion
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7797 |
});
|
7798 |
+
className = classnames_default()('components-snackbar-list', className);
|
7799 |
|
7800 |
+
var removeNotice = function removeNotice(notice) {
|
7801 |
+
return function () {
|
7802 |
+
return onRemove(notice.id);
|
7803 |
+
};
|
7804 |
+
};
|
7805 |
+
|
7806 |
+
return Object(external_this_wp_element_["createElement"])("div", {
|
7807 |
+
className: className
|
7808 |
+
}, children, transitions.map(function (_ref4) {
|
7809 |
+
var notice = _ref4.item,
|
7810 |
+
key = _ref4.key,
|
7811 |
+
style = _ref4.props;
|
7812 |
+
return Object(external_this_wp_element_["createElement"])(web_cjs["animated"].div, {
|
7813 |
+
key: key,
|
7814 |
+
style: style
|
7815 |
+
}, Object(external_this_wp_element_["createElement"])("div", {
|
7816 |
+
className: "components-snackbar-list__notice-container",
|
7817 |
+
ref: function ref(_ref5) {
|
7818 |
+
return _ref5 && refMap.set(notice, _ref5);
|
7819 |
+
}
|
7820 |
+
}, Object(external_this_wp_element_["createElement"])(snackbar["a" /* default */], Object(esm_extends["a" /* default */])({}, Object(external_lodash_["omit"])(notice, ['content']), {
|
7821 |
+
onRemove: removeNotice(notice)
|
7822 |
+
}), notice.content)));
|
7823 |
+
}));
|
|
|
|
|
|
|
|
|
|
|
|
|
7824 |
}
|
7825 |
|
7826 |
+
/* harmony default export */ var list = (SnackbarList);
|
7827 |
+
//# sourceMappingURL=list.js.map
|
7828 |
+
// EXTERNAL MODULE: ./client/layout/transient-notices/style.scss
|
7829 |
+
var transient_notices_style = __webpack_require__(455);
|
7830 |
|
7831 |
+
// CONCATENATED MODULE: ./client/layout/transient-notices/index.js
|
|
|
7832 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7833 |
|
|
|
|
|
|
|
|
|
7834 |
|
|
|
|
|
|
|
7835 |
|
|
|
|
|
|
|
|
|
|
|
7836 |
|
|
|
7837 |
|
|
|
|
|
|
|
|
|
7838 |
|
7839 |
+
function transient_notices_createSuper(Derived) { var hasNativeReflectConstruct = transient_notices_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = getPrototypeOf_default()(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = getPrototypeOf_default()(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return possibleConstructorReturn_default()(this, result); }; }
|
|
|
|
|
|
|
7840 |
|
7841 |
+
function transient_notices_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
|
|
|
|
|
7842 |
|
7843 |
+
/**
|
7844 |
+
* External dependencies
|
7845 |
+
*/
|
7846 |
|
|
|
|
|
|
|
7847 |
|
|
|
|
|
7848 |
|
|
|
|
|
|
|
|
|
7849 |
|
|
|
|
|
7850 |
|
|
|
|
|
|
|
|
|
|
|
|
|
7851 |
|
7852 |
+
/**
|
7853 |
+
* Internal dependencies
|
7854 |
+
*/
|
7855 |
|
|
|
|
|
7856 |
|
|
|
|
|
|
|
7857 |
|
7858 |
+
|
7859 |
+
var transient_notices_TransientNotices = /*#__PURE__*/function (_Component) {
|
7860 |
+
inherits_default()(TransientNotices, _Component);
|
7861 |
+
|
7862 |
+
var _super = transient_notices_createSuper(TransientNotices);
|
7863 |
+
|
7864 |
+
function TransientNotices() {
|
7865 |
+
classCallCheck_default()(this, TransientNotices);
|
7866 |
+
|
7867 |
+
return _super.apply(this, arguments);
|
7868 |
+
}
|
7869 |
+
|
7870 |
+
createClass_default()(TransientNotices, [{
|
7871 |
+
key: "render",
|
7872 |
+
value: function render() {
|
7873 |
+
var _this$props = this.props,
|
7874 |
+
className = _this$props.className,
|
7875 |
+
notices = _this$props.notices,
|
7876 |
+
onRemove = _this$props.onRemove;
|
7877 |
+
var classes = classnames_default()('woocommerce-transient-notices', 'components-notices__snackbar', className);
|
7878 |
+
return Object(external_this_wp_element_["createElement"])(list, {
|
7879 |
+
notices: notices,
|
7880 |
+
className: classes,
|
7881 |
+
onRemove: onRemove
|
7882 |
});
|
7883 |
}
|
7884 |
+
}]);
|
7885 |
|
7886 |
+
return TransientNotices;
|
7887 |
+
}(external_this_wp_element_["Component"]);
|
|
|
|
|
|
|
7888 |
|
7889 |
+
transient_notices_TransientNotices.propTypes = {
|
7890 |
+
/**
|
7891 |
+
* Additional class name to style the component.
|
7892 |
+
*/
|
7893 |
+
className: prop_types_default.a.string,
|
7894 |
+
|
7895 |
+
/**
|
7896 |
+
* Array of notices to be displayed.
|
7897 |
+
*/
|
7898 |
+
notices: prop_types_default.a.array
|
7899 |
+
};
|
7900 |
+
/* harmony default export */ var transient_notices = (Object(compose["a" /* default */])(Object(with_select["a" /* default */])(function (select) {
|
7901 |
+
var notices = select('core/notices').getNotices();
|
7902 |
+
return {
|
7903 |
+
notices: notices
|
7904 |
+
};
|
7905 |
+
}), Object(external_this_wp_data_["withDispatch"])(function (dispatch) {
|
7906 |
+
return {
|
7907 |
+
onRemove: dispatch('core/notices').removeNotice
|
7908 |
};
|
7909 |
+
}))(transient_notices_TransientNotices));
|
7910 |
+
// EXTERNAL MODULE: ./client/analytics/report/index.js
|
7911 |
+
var analytics_report = __webpack_require__(202);
|
7912 |
|
7913 |
+
// CONCATENATED MODULE: ./client/layout/index.js
|
|
|
7914 |
|
|
|
7915 |
|
|
|
|
|
|
|
|
|
|
|
7916 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7917 |
|
|
|
|
|
|
|
7918 |
|
|
|
|
|
|
|
|
|
|
|
7919 |
|
7920 |
|
|
|
7921 |
|
|
|
|
|
|
|
7922 |
|
|
|
|
|
|
|
|
|
|
|
7923 |
|
7924 |
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7925 |
|
7926 |
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { defineProperty_default()(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
|
7927 |
|
7928 |
+
function layout_createSuper(Derived) { var hasNativeReflectConstruct = layout_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = getPrototypeOf_default()(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = getPrototypeOf_default()(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return possibleConstructorReturn_default()(this, result); }; }
|
|
|
|
|
|
|
|
|
7929 |
|
7930 |
+
function layout_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
|
|
|
|
|
|
|
|
|
|
|
|
|
7931 |
|
7932 |
+
/**
|
7933 |
+
* External dependencies
|
7934 |
+
*/
|
7935 |
|
|
|
|
|
|
|
7936 |
|
|
|
|
|
|
|
|
|
|
|
|
|
7937 |
|
|
|
|
|
7938 |
|
|
|
|
|
|
|
7939 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7940 |
|
7941 |
|
7942 |
+
/**
|
7943 |
+
* WooCommerce dependencies
|
7944 |
+
*/
|
7945 |
|
|
|
|
|
|
|
7946 |
|
|
|
|
|
|
|
|
|
|
|
7947 |
|
|
|
|
|
7948 |
|
7949 |
|
7950 |
+
/**
|
7951 |
+
* Internal dependencies
|
7952 |
+
*/
|
7953 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7954 |
|
|
|
|
|
7955 |
|
|
|
|
|
7956 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7957 |
|
|
|
|
|
|
|
|
|
|
|
7958 |
|
|
|
|
|
7959 |
|
7960 |
+
var StoreAlerts = Object(external_this_wp_element_["lazy"])(function () {
|
7961 |
+
return Promise.all(/* import() | store-alerts */[__webpack_require__.e(5), __webpack_require__.e(46)]).then(__webpack_require__.bind(null, 943));
|
7962 |
+
});
|
7963 |
|
7964 |
+
var layout_PrimaryLayout = /*#__PURE__*/function (_Component) {
|
7965 |
+
inherits_default()(PrimaryLayout, _Component);
|
7966 |
|
7967 |
+
var _super = layout_createSuper(PrimaryLayout);
|
7968 |
|
7969 |
+
function PrimaryLayout() {
|
7970 |
+
classCallCheck_default()(this, PrimaryLayout);
|
|
|
7971 |
|
7972 |
+
return _super.apply(this, arguments);
|
7973 |
+
}
|
7974 |
|
7975 |
+
createClass_default()(PrimaryLayout, [{
|
7976 |
+
key: "render",
|
7977 |
+
value: function render() {
|
7978 |
+
var children = this.props.children;
|
7979 |
+
return Object(external_this_wp_element_["createElement"])("div", {
|
7980 |
+
className: "woocommerce-layout__primary",
|
7981 |
+
id: "woocommerce-layout__primary"
|
7982 |
+
}, window.wcAdminFeatures['store-alerts'] && Object(external_this_wp_element_["createElement"])(external_this_wp_element_["Suspense"], {
|
7983 |
+
fallback: Object(external_this_wp_element_["createElement"])(external_this_wc_components_["Spinner"], null)
|
7984 |
+
}, Object(external_this_wp_element_["createElement"])(StoreAlerts, null)), Object(external_this_wp_element_["createElement"])(layout_notices, null), children);
|
7985 |
+
}
|
7986 |
+
}]);
|
7987 |
|
7988 |
+
return PrimaryLayout;
|
7989 |
+
}(external_this_wp_element_["Component"]);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7990 |
|
7991 |
+
var layout_Layout = /*#__PURE__*/function (_Component2) {
|
7992 |
+
inherits_default()(_Layout, _Component2);
|
7993 |
|
7994 |
+
var _super2 = layout_createSuper(_Layout);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7995 |
|
7996 |
+
function _Layout() {
|
7997 |
+
classCallCheck_default()(this, _Layout);
|
|
|
|
|
|
|
|
|
7998 |
|
7999 |
+
return _super2.apply(this, arguments);
|
8000 |
+
}
|
8001 |
|
8002 |
+
createClass_default()(_Layout, [{
|
8003 |
+
key: "componentDidMount",
|
8004 |
+
value: function componentDidMount() {
|
8005 |
+
this.recordPageViewTrack();
|
8006 |
+
}
|
8007 |
+
}, {
|
8008 |
+
key: "componentDidUpdate",
|
8009 |
+
value: function componentDidUpdate(prevProps) {
|
8010 |
+
var previousPath = Object(external_lodash_["get"])(prevProps, 'location.pathname');
|
8011 |
+
var currentPath = Object(external_lodash_["get"])(this.props, 'location.pathname');
|
8012 |
|
8013 |
+
if (!previousPath || !currentPath) {
|
8014 |
+
return;
|
8015 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8016 |
|
8017 |
+
if (previousPath !== currentPath) {
|
8018 |
+
this.recordPageViewTrack();
|
8019 |
+
}
|
8020 |
+
}
|
8021 |
+
}, {
|
8022 |
+
key: "recordPageViewTrack",
|
8023 |
+
value: function recordPageViewTrack() {
|
8024 |
+
var _this$props = this.props,
|
8025 |
+
activePlugins = _this$props.activePlugins,
|
8026 |
+
installedPlugins = _this$props.installedPlugins,
|
8027 |
+
isEmbedded = _this$props.isEmbedded,
|
8028 |
+
isJetpackConnected = _this$props.isJetpackConnected;
|
8029 |
|
8030 |
+
if (isEmbedded) {
|
8031 |
+
var _path = document.location.pathname + document.location.search;
|
8032 |
|
8033 |
+
Object(tracks["c" /* recordPageView */])(_path, {
|
8034 |
+
is_embedded: true
|
8035 |
+
});
|
8036 |
+
return;
|
8037 |
+
}
|
8038 |
|
8039 |
+
var pathname = Object(external_lodash_["get"])(this.props, 'location.pathname');
|
8040 |
|
8041 |
+
if (!pathname) {
|
8042 |
+
return;
|
8043 |
+
} // Remove leading slash, and camel case remaining pathname
|
|
|
|
|
8044 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8045 |
|
8046 |
+
var path = pathname.substring(1).replace(/\//g, '_'); // When pathname is `/` we are on the dashboard
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8047 |
|
8048 |
+
if (path.length === 0) {
|
8049 |
+
path = window.wcAdminFeatures.homescreen ? 'home_screen' : 'dashboard';
|
8050 |
+
}
|
8051 |
|
8052 |
+
Object(tracks["c" /* recordPageView */])(path, {
|
8053 |
+
jetpack_installed: installedPlugins.includes('jetpack'),
|
8054 |
+
jetpack_active: activePlugins.includes('jetpack'),
|
8055 |
+
jetpack_connected: isJetpackConnected
|
8056 |
+
});
|
8057 |
+
}
|
8058 |
+
}, {
|
8059 |
+
key: "getQuery",
|
8060 |
+
value: function getQuery(searchString) {
|
8061 |
+
if (!searchString) {
|
8062 |
+
return {};
|
8063 |
+
}
|
8064 |
|
8065 |
+
var search = searchString.substring(1);
|
8066 |
+
return Object(lib["parse"])(search);
|
8067 |
+
}
|
8068 |
+
}, {
|
8069 |
+
key: "render",
|
8070 |
+
value: function render() {
|
8071 |
+
var _this$props2 = this.props,
|
8072 |
+
isEmbedded = _this$props2.isEmbedded,
|
8073 |
+
restProps = objectWithoutProperties_default()(_this$props2, ["isEmbedded"]);
|
8074 |
|
8075 |
+
var _this$props3 = this.props,
|
8076 |
+
location = _this$props3.location,
|
8077 |
+
page = _this$props3.page;
|
8078 |
+
var breadcrumbs = page.breadcrumbs;
|
8079 |
+
var query = this.getQuery(location && location.search);
|
8080 |
+
return Object(external_this_wp_element_["createElement"])("div", {
|
8081 |
+
className: "woocommerce-layout"
|
8082 |
+
}, Object(external_this_wp_element_["createElement"])(header, {
|
8083 |
+
sections: Object(external_lodash_["isFunction"])(breadcrumbs) ? breadcrumbs(this.props) : breadcrumbs,
|
8084 |
+
isEmbedded: isEmbedded,
|
8085 |
+
query: query
|
8086 |
+
}), Object(external_this_wp_element_["createElement"])(transient_notices, null), !isEmbedded && Object(external_this_wp_element_["createElement"])(layout_PrimaryLayout, null, Object(external_this_wp_element_["createElement"])("div", {
|
8087 |
+
className: "woocommerce-layout__main"
|
8088 |
+
}, Object(external_this_wp_element_["createElement"])(controller_Controller, extends_default()({}, restProps, {
|
8089 |
+
query: query
|
8090 |
+
})))));
|
8091 |
+
}
|
8092 |
+
}]);
|
8093 |
|
8094 |
+
return _Layout;
|
8095 |
+
}(external_this_wp_element_["Component"]);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8096 |
|
8097 |
+
layout_Layout.propTypes = {
|
8098 |
+
isEmbedded: prop_types_default.a.bool,
|
8099 |
+
page: prop_types_default.a.shape({
|
8100 |
+
container: prop_types_default.a.oneOfType([prop_types_default.a.func, prop_types_default.a.object // Support React.lazy
|
8101 |
+
]),
|
8102 |
+
path: prop_types_default.a.string,
|
8103 |
+
breadcrumbs: prop_types_default.a.oneOfType([prop_types_default.a.func, prop_types_default.a.arrayOf(prop_types_default.a.oneOfType([prop_types_default.a.arrayOf(prop_types_default.a.string), prop_types_default.a.string]))]).isRequired,
|
8104 |
+
wpOpenMenu: prop_types_default.a.string
|
8105 |
+
}).isRequired
|
8106 |
+
};
|
8107 |
+
var Layout = Object(compose["a" /* default */])(Object(external_this_wc_data_["withPluginsHydration"])(_objectSpread(_objectSpread({}, window.wcSettings.plugins || {}), {}, {
|
8108 |
+
jetpackStatus: window.wcSettings.dataEndpoints && window.wcSettings.dataEndpoints.jetpackStatus || false
|
8109 |
+
})), Object(external_this_wp_data_["withSelect"])(function (select, _ref) {
|
8110 |
+
var isEmbedded = _ref.isEmbedded;
|
8111 |
|
8112 |
+
// Embedded pages don't send plugin info to Tracks.
|
8113 |
+
if (isEmbedded) {
|
8114 |
+
return;
|
8115 |
+
}
|
8116 |
|
8117 |
+
var _select = select(external_this_wc_data_["PLUGINS_STORE_NAME"]),
|
8118 |
+
getActivePlugins = _select.getActivePlugins,
|
8119 |
+
getInstalledPlugins = _select.getInstalledPlugins,
|
8120 |
+
isJetpackConnected = _select.isJetpackConnected;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8121 |
|
8122 |
+
return {
|
8123 |
+
activePlugins: getActivePlugins(),
|
8124 |
+
isJetpackConnected: isJetpackConnected(),
|
8125 |
+
installedPlugins: getInstalledPlugins()
|
8126 |
+
};
|
8127 |
+
}))(layout_Layout);
|
|
|
|
|
|
|
|
|
8128 |
|
8129 |
+
var layout_PageLayout = /*#__PURE__*/function (_Component3) {
|
8130 |
+
inherits_default()(_PageLayout, _Component3);
|
|
|
|
|
|
|
|
|
8131 |
|
8132 |
+
var _super3 = layout_createSuper(_PageLayout);
|
|
|
|
|
8133 |
|
8134 |
+
function _PageLayout() {
|
8135 |
+
classCallCheck_default()(this, _PageLayout);
|
|
|
|
|
|
|
8136 |
|
8137 |
+
return _super3.apply(this, arguments);
|
8138 |
+
}
|
8139 |
+
|
8140 |
+
createClass_default()(_PageLayout, [{
|
8141 |
+
key: "render",
|
8142 |
+
value: function render() {
|
8143 |
+
return Object(external_this_wp_element_["createElement"])(react_router_Router, {
|
8144 |
+
history: Object(external_this_wc_navigation_["getHistory"])()
|
8145 |
+
}, Object(external_this_wp_element_["createElement"])(react_router_Switch, null, controller_getPages().map(function (page) {
|
8146 |
+
return Object(external_this_wp_element_["createElement"])(react_router_Route, {
|
8147 |
+
key: page.path,
|
8148 |
+
path: page.path,
|
8149 |
+
exact: true,
|
8150 |
+
render: function render(props) {
|
8151 |
+
return Object(external_this_wp_element_["createElement"])(Layout, extends_default()({
|
8152 |
+
page: page
|
8153 |
+
}, props));
|
8154 |
+
}
|
8155 |
+
});
|
8156 |
+
})));
|
8157 |
}
|
8158 |
+
}]);
|
8159 |
|
8160 |
+
return _PageLayout;
|
8161 |
+
}(external_this_wp_element_["Component"]);
|
8162 |
|
8163 |
+
var PageLayout = Object(compose["a" /* default */])( // Use the useFilters HoC so PageLayout is re-rendered when filters are used to add new pages or reports
|
8164 |
+
Object(external_this_wc_components_["useFilters"])([PAGES_FILTER, analytics_report["REPORTS_FILTER"]]), window.wcSettings.preloadOptions ? Object(external_this_wc_data_["withOptionsHydration"])(_objectSpread({}, window.wcSettings.preloadOptions)) : external_lodash_["identity"])(layout_PageLayout);
|
8165 |
+
var layout_EmbedLayout = /*#__PURE__*/function (_Component4) {
|
8166 |
+
inherits_default()(EmbedLayout, _Component4);
|
|
|
|
|
|
|
|
|
|
|
|
|
8167 |
|
8168 |
+
var _super4 = layout_createSuper(EmbedLayout);
|
|
|
8169 |
|
8170 |
+
function EmbedLayout() {
|
8171 |
+
classCallCheck_default()(this, EmbedLayout);
|
|
|
|
|
8172 |
|
8173 |
+
return _super4.apply(this, arguments);
|
8174 |
+
}
|
|
|
|
|
8175 |
|
8176 |
+
createClass_default()(EmbedLayout, [{
|
8177 |
+
key: "render",
|
8178 |
+
value: function render() {
|
8179 |
+
return Object(external_this_wp_element_["createElement"])(Layout, {
|
8180 |
+
page: {
|
8181 |
+
breadcrumbs: Object(settings["g" /* getSetting */])('embedBreadcrumbs', [])
|
8182 |
+
},
|
8183 |
+
isEmbedded: true
|
8184 |
});
|
|
|
8185 |
}
|
8186 |
+
}]);
|
8187 |
|
8188 |
+
return EmbedLayout;
|
8189 |
+
}(external_this_wp_element_["Component"]);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8190 |
|
8191 |
+
/***/ }),
|
8192 |
|
8193 |
+
/***/ 204:
|
8194 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8195 |
|
8196 |
+
"use strict";
|
8197 |
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return getFilteredCurrencyInstance; });
|
8198 |
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return CurrencyContext; });
|
8199 |
+
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0);
|
8200 |
+
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
|
8201 |
+
/* harmony import */ var _wordpress_hooks__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(44);
|
8202 |
+
/* harmony import */ var _wordpress_hooks__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_hooks__WEBPACK_IMPORTED_MODULE_1__);
|
8203 |
+
/* harmony import */ var _woocommerce_currency__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(116);
|
8204 |
+
/* harmony import */ var _woocommerce_currency__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_woocommerce_currency__WEBPACK_IMPORTED_MODULE_2__);
|
8205 |
+
/* harmony import */ var _woocommerce_wc_admin_settings__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(20);
|
8206 |
+
/**
|
8207 |
+
* External dependencies
|
8208 |
+
*/
|
8209 |
|
|
|
|
|
8210 |
|
8211 |
+
/**
|
8212 |
+
* WooCommerce dependencies
|
8213 |
+
*/
|
|
|
|
|
|
|
|
|
|
|
8214 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8215 |
|
8216 |
+
/**
|
8217 |
+
* Internal dependencies
|
8218 |
+
*/
|
|
|
|
|
|
|
|
|
8219 |
|
8220 |
+
|
8221 |
+
var appCurrency = _woocommerce_currency__WEBPACK_IMPORTED_MODULE_2___default()(_woocommerce_wc_admin_settings__WEBPACK_IMPORTED_MODULE_3__[/* CURRENCY */ "b"]);
|
8222 |
+
var getFilteredCurrencyInstance = function getFilteredCurrencyInstance(query) {
|
8223 |
+
var config = appCurrency.getCurrencyConfig();
|
8224 |
+
var filteredConfig = Object(_wordpress_hooks__WEBPACK_IMPORTED_MODULE_1__["applyFilters"])('woocommerce_admin_report_currency', config, query);
|
8225 |
+
return _woocommerce_currency__WEBPACK_IMPORTED_MODULE_2___default()(filteredConfig);
|
|
|
|
|
8226 |
};
|
8227 |
+
var CurrencyContext = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createContext"])(appCurrency // default value
|
8228 |
+
);
|
8229 |
|
8230 |
+
/***/ }),
|
|
|
|
|
|
|
8231 |
|
8232 |
+
/***/ 205:
|
8233 |
+
/***/ (function(module, exports) {
|
8234 |
|
8235 |
+
(function() { module.exports = this["wc"]["number"]; }());
|
|
|
|
|
|
|
8236 |
|
8237 |
+
/***/ }),
|
|
|
8238 |
|
8239 |
+
/***/ 212:
|
8240 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
8241 |
|
8242 |
+
"use strict";
|
8243 |
+
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0);
|
8244 |
+
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
|
8245 |
+
/* harmony import */ var _use_media_query__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(89);
|
8246 |
+
/**
|
8247 |
+
* WordPress dependencies
|
8248 |
+
*/
|
8249 |
|
8250 |
+
/**
|
8251 |
+
* Internal dependencies
|
8252 |
+
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8253 |
|
8254 |
|
8255 |
+
/**
|
8256 |
+
* @typedef {"huge"|"wide"|"large"|"medium"|"small"|"mobile"} WPBreakpoint
|
8257 |
+
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8258 |
|
8259 |
+
/**
|
8260 |
+
* Hash of breakpoint names with pixel width at which it becomes effective.
|
8261 |
+
*
|
8262 |
+
* @see _breakpoints.scss
|
8263 |
+
*
|
8264 |
+
* @type {Object<WPBreakpoint,number>}
|
8265 |
+
*/
|
8266 |
|
8267 |
+
var BREAKPOINTS = {
|
8268 |
+
huge: 1440,
|
8269 |
+
wide: 1280,
|
8270 |
+
large: 960,
|
8271 |
+
medium: 782,
|
8272 |
+
small: 600,
|
8273 |
+
mobile: 480
|
8274 |
};
|
8275 |
+
/**
|
8276 |
+
* @typedef {">="|"<"} WPViewportOperator
|
8277 |
+
*/
|
8278 |
|
8279 |
+
/**
|
8280 |
+
* Object mapping media query operators to the condition to be used.
|
8281 |
+
*
|
8282 |
+
* @type {Object<WPViewportOperator,string>}
|
8283 |
*/
|
8284 |
|
8285 |
+
var CONDITIONS = {
|
8286 |
+
'>=': 'min-width',
|
8287 |
+
'<': 'max-width'
|
8288 |
+
};
|
8289 |
+
/**
|
8290 |
+
* Object mapping media query operators to a function that given a breakpointValue and a width evaluates if the operator matches the values.
|
8291 |
+
*
|
8292 |
+
* @type {Object<WPViewportOperator,Function>}
|
8293 |
+
*/
|
8294 |
|
8295 |
+
var OPERATOR_EVALUATORS = {
|
8296 |
+
'>=': function _(breakpointValue, width) {
|
8297 |
+
return width >= breakpointValue;
|
8298 |
+
},
|
8299 |
+
'<': function _(breakpointValue, width) {
|
8300 |
+
return width < breakpointValue;
|
8301 |
+
}
|
8302 |
};
|
8303 |
+
var ViewportMatchWidthContext = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createContext"])(null);
|
8304 |
+
/**
|
8305 |
+
* Returns true if the viewport matches the given query, or false otherwise.
|
8306 |
+
*
|
8307 |
+
* @param {WPBreakpoint} breakpoint Breakpoint size name.
|
8308 |
+
* @param {WPViewportOperator} [operator=">="] Viewport operator.
|
8309 |
+
*
|
8310 |
+
* @example
|
8311 |
+
*
|
8312 |
+
* ```js
|
8313 |
+
* useViewportMatch( 'huge', '<' );
|
8314 |
+
* useViewportMatch( 'medium' );
|
8315 |
+
* ```
|
8316 |
+
*
|
8317 |
+
* @return {boolean} Whether viewport matches query.
|
8318 |
+
*/
|
8319 |
|
8320 |
+
var useViewportMatch = function useViewportMatch(breakpoint) {
|
8321 |
+
var operator = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '>=';
|
8322 |
+
var simulatedWidth = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["useContext"])(ViewportMatchWidthContext);
|
8323 |
+
var mediaQuery = !simulatedWidth && "(".concat(CONDITIONS[operator], ": ").concat(BREAKPOINTS[breakpoint], "px)");
|
8324 |
+
var mediaQueryResult = Object(_use_media_query__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"])(mediaQuery);
|
|
|
|
|
8325 |
|
8326 |
+
if (simulatedWidth) {
|
8327 |
+
return OPERATOR_EVALUATORS[operator](BREAKPOINTS[breakpoint], simulatedWidth);
|
8328 |
+
}
|
8329 |
+
|
8330 |
+
return mediaQueryResult;
|
8331 |
};
|
8332 |
|
8333 |
+
useViewportMatch.__experimentalWidthProvider = ViewportMatchWidthContext.Provider;
|
8334 |
+
/* harmony default export */ __webpack_exports__["a"] = (useViewportMatch);
|
8335 |
+
//# sourceMappingURL=index.js.map
|
|
|
|
|
|
|
|
|
8336 |
|
8337 |
+
/***/ }),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8338 |
|
8339 |
+
/***/ 213:
|
8340 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8341 |
|
8342 |
+
"use strict";
|
8343 |
+
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0);
|
8344 |
+
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
|
8345 |
+
/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(37);
|
|
|
|
|
8346 |
|
|
|
|
|
8347 |
|
8348 |
+
/**
|
8349 |
+
* WordPress dependencies
|
8350 |
+
*/
|
8351 |
|
8352 |
+
var close = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__[/* SVG */ "b"], {
|
8353 |
+
xmlns: "http://www.w3.org/2000/svg",
|
8354 |
+
viewBox: "0 0 24 24"
|
8355 |
+
}, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__[/* Path */ "a"], {
|
8356 |
+
d: "M13 11.8l6.1-6.3-1-1-6.1 6.2-6.1-6.2-1 1 6.1 6.3-6.5 6.7 1 1 6.5-6.6 6.5 6.6 1-1z"
|
8357 |
+
}));
|
8358 |
+
/* harmony default export */ __webpack_exports__["a"] = (close);
|
8359 |
+
//# sourceMappingURL=close.js.map
|
|
|
|
|
|
|
8360 |
|
8361 |
+
/***/ }),
|
8362 |
|
8363 |
+
/***/ 214:
|
8364 |
+
/***/ (function(module, exports, __webpack_require__) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8365 |
|
8366 |
+
"use strict";
|
8367 |
+
/** @license React v16.13.1
|
8368 |
+
* react-is.production.min.js
|
8369 |
+
*
|
8370 |
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
8371 |
+
*
|
8372 |
+
* This source code is licensed under the MIT license found in the
|
8373 |
+
* LICENSE file in the root directory of this source tree.
|
8374 |
+
*/
|
8375 |
|
8376 |
+
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?
|
8377 |
+
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;
|
8378 |
+
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}exports.AsyncMode=l;exports.ConcurrentMode=m;exports.ContextConsumer=k;exports.ContextProvider=h;exports.Element=c;exports.ForwardRef=n;exports.Fragment=e;exports.Lazy=t;exports.Memo=r;exports.Portal=d;
|
8379 |
+
exports.Profiler=g;exports.StrictMode=f;exports.Suspense=p;exports.isAsyncMode=function(a){return A(a)||z(a)===l};exports.isConcurrentMode=A;exports.isContextConsumer=function(a){return z(a)===k};exports.isContextProvider=function(a){return z(a)===h};exports.isElement=function(a){return"object"===typeof a&&null!==a&&a.$$typeof===c};exports.isForwardRef=function(a){return z(a)===n};exports.isFragment=function(a){return z(a)===e};exports.isLazy=function(a){return z(a)===t};
|
8380 |
+
exports.isMemo=function(a){return z(a)===r};exports.isPortal=function(a){return z(a)===d};exports.isProfiler=function(a){return z(a)===g};exports.isStrictMode=function(a){return z(a)===f};exports.isSuspense=function(a){return z(a)===p};
|
8381 |
+
exports.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)};exports.typeOf=z;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8382 |
|
|
|
8383 |
|
8384 |
+
/***/ }),
|
|
|
|
|
|
|
8385 |
|
8386 |
+
/***/ 215:
|
8387 |
+
/***/ (function(module, exports, __webpack_require__) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8388 |
|
8389 |
+
var arrayLikeToArray = __webpack_require__(161);
|
|
|
8390 |
|
8391 |
+
function _arrayWithoutHoles(arr) {
|
8392 |
+
if (Array.isArray(arr)) return arrayLikeToArray(arr);
|
8393 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
8394 |
|
8395 |
+
module.exports = _arrayWithoutHoles;
|
|
|
8396 |
|
8397 |
+
/***/ }),
|
|
|
|
|
8398 |
|
8399 |
+
/***/ 216:
|
8400 |
+
/***/ (function(module, exports) {
|
|
|
|
|
|
|
|
|
8401 |
|
8402 |
+
function _iterableToArray(iter) {
|
8403 |
+
if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter);
|
8404 |
+
}
|
8405 |
|
8406 |
+
module.exports = _iterableToArray;
|
8407 |
|
8408 |
+
/***/ }),
|
|
|
8409 |
|
8410 |
+
/***/ 217:
|
8411 |
+
/***/ (function(module, exports) {
|
8412 |
+
|
8413 |
+
function _nonIterableSpread() {
|
8414 |
+
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
8415 |
}
|
8416 |
|
8417 |
+
module.exports = _nonIterableSpread;
|
|
|
|
|
|
|
8418 |
|
8419 |
+
/***/ }),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8420 |
|
8421 |
+
/***/ 22:
|
8422 |
+
/***/ (function(module, exports) {
|
|
|
8423 |
|
8424 |
+
(function() { module.exports = this["wp"]["apiFetch"]; }());
|
8425 |
|
8426 |
+
/***/ }),
|
8427 |
|
8428 |
+
/***/ 23:
|
8429 |
+
/***/ (function(module, exports) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8430 |
|
8431 |
+
(function() { module.exports = this["wc"]["navigation"]; }());
|
|
|
8432 |
|
8433 |
+
/***/ }),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8434 |
|
8435 |
+
/***/ 24:
|
8436 |
+
/***/ (function(module, exports) {
|
|
|
|
|
8437 |
|
8438 |
+
(function() { module.exports = this["wc"]["date"]; }());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8439 |
|
8440 |
+
/***/ }),
|
8441 |
+
|
8442 |
+
/***/ 26:
|
8443 |
+
/***/ (function(module, exports) {
|
8444 |
+
|
8445 |
+
(function() { module.exports = this["wp"]["url"]; }());
|
8446 |
+
|
8447 |
+
/***/ }),
|
8448 |
+
|
8449 |
+
/***/ 263:
|
8450 |
+
/***/ (function(module, exports, __webpack_require__) {
|
8451 |
+
|
8452 |
+
"use strict";
|
8453 |
+
|
8454 |
+
|
8455 |
+
Object.defineProperty(exports, '__esModule', { value: true });
|
8456 |
+
|
8457 |
+
function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
|
8458 |
+
|
8459 |
+
var _extends = _interopDefault(__webpack_require__(78));
|
8460 |
+
var _objectWithoutPropertiesLoose = _interopDefault(__webpack_require__(282));
|
8461 |
+
var React = __webpack_require__(13);
|
8462 |
+
var React__default = _interopDefault(React);
|
8463 |
+
var _inheritsLoose = _interopDefault(__webpack_require__(131));
|
8464 |
+
var _assertThisInitialized = _interopDefault(__webpack_require__(65));
|
8465 |
+
|
8466 |
+
var is = {
|
8467 |
+
arr: Array.isArray,
|
8468 |
+
obj: function obj(a) {
|
8469 |
+
return Object.prototype.toString.call(a) === '[object Object]';
|
8470 |
+
},
|
8471 |
+
fun: function fun(a) {
|
8472 |
+
return typeof a === 'function';
|
8473 |
+
},
|
8474 |
+
str: function str(a) {
|
8475 |
+
return typeof a === 'string';
|
8476 |
+
},
|
8477 |
+
num: function num(a) {
|
8478 |
+
return typeof a === 'number';
|
8479 |
+
},
|
8480 |
+
und: function und(a) {
|
8481 |
+
return a === void 0;
|
8482 |
+
},
|
8483 |
+
nul: function nul(a) {
|
8484 |
+
return a === null;
|
8485 |
+
},
|
8486 |
+
set: function set(a) {
|
8487 |
+
return a instanceof Set;
|
8488 |
+
},
|
8489 |
+
map: function map(a) {
|
8490 |
+
return a instanceof Map;
|
8491 |
+
},
|
8492 |
+
equ: function equ(a, b) {
|
8493 |
+
if (typeof a !== typeof b) return false;
|
8494 |
+
if (is.str(a) || is.num(a)) return a === b;
|
8495 |
+
if (is.obj(a) && is.obj(b) && Object.keys(a).length + Object.keys(b).length === 0) return true;
|
8496 |
+
var i;
|
8497 |
+
|
8498 |
+
for (i in a) {
|
8499 |
+
if (!(i in b)) return false;
|
8500 |
+
}
|
8501 |
+
|
8502 |
+
for (i in b) {
|
8503 |
+
if (a[i] !== b[i]) return false;
|
8504 |
}
|
8505 |
+
|
8506 |
+
return is.und(i) ? a === b : true;
|
8507 |
+
}
|
8508 |
+
};
|
8509 |
+
function merge(target, lowercase) {
|
8510 |
+
if (lowercase === void 0) {
|
8511 |
+
lowercase = true;
|
8512 |
}
|
8513 |
|
8514 |
+
return function (object) {
|
8515 |
+
return (is.arr(object) ? object : Object.keys(object)).reduce(function (acc, element) {
|
8516 |
+
var key = lowercase ? element[0].toLowerCase() + element.substring(1) : element;
|
8517 |
+
acc[key] = target(key);
|
8518 |
+
return acc;
|
8519 |
+
}, target);
|
8520 |
+
};
|
8521 |
+
}
|
8522 |
+
function useForceUpdate() {
|
8523 |
+
var _useState = React.useState(false),
|
8524 |
+
f = _useState[1];
|
8525 |
|
8526 |
+
var forceUpdate = React.useCallback(function () {
|
8527 |
+
return f(function (v) {
|
8528 |
+
return !v;
|
8529 |
+
});
|
8530 |
+
}, []);
|
8531 |
+
return forceUpdate;
|
8532 |
+
}
|
8533 |
+
function withDefault(value, defaultValue) {
|
8534 |
+
return is.und(value) || is.nul(value) ? defaultValue : value;
|
8535 |
+
}
|
8536 |
+
function toArray(a) {
|
8537 |
+
return !is.und(a) ? is.arr(a) ? a : [a] : [];
|
8538 |
+
}
|
8539 |
+
function callProp(obj) {
|
8540 |
+
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
8541 |
+
args[_key - 1] = arguments[_key];
|
8542 |
+
}
|
8543 |
|
8544 |
+
return is.fun(obj) ? obj.apply(void 0, args) : obj;
|
8545 |
+
}
|
8546 |
|
8547 |
+
function getForwardProps(props) {
|
8548 |
+
var to = props.to,
|
8549 |
+
from = props.from,
|
8550 |
+
config = props.config,
|
8551 |
+
onStart = props.onStart,
|
8552 |
+
onRest = props.onRest,
|
8553 |
+
onFrame = props.onFrame,
|
8554 |
+
children = props.children,
|
8555 |
+
reset = props.reset,
|
8556 |
+
reverse = props.reverse,
|
8557 |
+
force = props.force,
|
8558 |
+
immediate = props.immediate,
|
8559 |
+
delay = props.delay,
|
8560 |
+
attach = props.attach,
|
8561 |
+
destroyed = props.destroyed,
|
8562 |
+
interpolateTo = props.interpolateTo,
|
8563 |
+
ref = props.ref,
|
8564 |
+
lazy = props.lazy,
|
8565 |
+
forward = _objectWithoutPropertiesLoose(props, ["to", "from", "config", "onStart", "onRest", "onFrame", "children", "reset", "reverse", "force", "immediate", "delay", "attach", "destroyed", "interpolateTo", "ref", "lazy"]);
|
8566 |
|
8567 |
+
return forward;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8568 |
}
|
8569 |
|
8570 |
+
function interpolateTo(props) {
|
8571 |
+
var forward = getForwardProps(props);
|
8572 |
+
if (is.und(forward)) return _extends({
|
8573 |
+
to: forward
|
8574 |
+
}, props);
|
8575 |
+
var rest = Object.keys(props).reduce(function (a, k) {
|
8576 |
+
var _extends2;
|
8577 |
+
|
8578 |
+
return !is.und(forward[k]) ? a : _extends({}, a, (_extends2 = {}, _extends2[k] = props[k], _extends2));
|
8579 |
+
}, {});
|
8580 |
+
return _extends({
|
8581 |
+
to: forward
|
8582 |
+
}, rest);
|
8583 |
+
}
|
8584 |
+
function handleRef(ref, forward) {
|
8585 |
+
if (forward) {
|
8586 |
+
// If it's a function, assume it's a ref callback
|
8587 |
+
if (is.fun(forward)) forward(ref);else if (is.obj(forward)) {
|
8588 |
+
forward.current = ref;
|
8589 |
+
}
|
8590 |
+
}
|
8591 |
+
|
8592 |
+
return ref;
|
8593 |
+
}
|
8594 |
+
|
8595 |
+
var Animated =
|
8596 |
/*#__PURE__*/
|
8597 |
+
function () {
|
8598 |
+
function Animated() {
|
8599 |
+
this.payload = void 0;
|
8600 |
+
this.children = [];
|
8601 |
+
}
|
8602 |
|
8603 |
+
var _proto = Animated.prototype;
|
|
|
8604 |
|
8605 |
+
_proto.getAnimatedValue = function getAnimatedValue() {
|
8606 |
+
return this.getValue();
|
8607 |
+
};
|
8608 |
|
8609 |
+
_proto.getPayload = function getPayload() {
|
8610 |
+
return this.payload || this;
|
8611 |
+
};
|
8612 |
|
8613 |
+
_proto.attach = function attach() {};
|
|
|
|
|
8614 |
|
8615 |
+
_proto.detach = function detach() {};
|
|
|
|
|
8616 |
|
8617 |
+
_proto.getChildren = function getChildren() {
|
8618 |
+
return this.children;
|
8619 |
+
};
|
8620 |
|
8621 |
+
_proto.addChild = function addChild(child) {
|
8622 |
+
if (this.children.length === 0) this.attach();
|
8623 |
+
this.children.push(child);
|
8624 |
+
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8625 |
|
8626 |
+
_proto.removeChild = function removeChild(child) {
|
8627 |
+
var index = this.children.indexOf(child);
|
8628 |
+
this.children.splice(index, 1);
|
8629 |
+
if (this.children.length === 0) this.detach();
|
8630 |
+
};
|
8631 |
|
8632 |
+
return Animated;
|
8633 |
+
}();
|
8634 |
+
var AnimatedArray =
|
8635 |
+
/*#__PURE__*/
|
8636 |
+
function (_Animated) {
|
8637 |
+
_inheritsLoose(AnimatedArray, _Animated);
|
8638 |
|
8639 |
+
function AnimatedArray() {
|
8640 |
+
var _this;
|
|
|
|
|
|
|
|
|
|
|
|
|
8641 |
|
8642 |
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
8643 |
+
args[_key] = arguments[_key];
|
8644 |
+
}
|
8645 |
|
8646 |
+
_this = _Animated.call.apply(_Animated, [this].concat(args)) || this;
|
8647 |
+
_this.payload = [];
|
8648 |
|
8649 |
+
_this.attach = function () {
|
8650 |
+
return _this.payload.forEach(function (p) {
|
8651 |
+
return p instanceof Animated && p.addChild(_assertThisInitialized(_this));
|
8652 |
+
});
|
8653 |
+
};
|
8654 |
|
8655 |
+
_this.detach = function () {
|
8656 |
+
return _this.payload.forEach(function (p) {
|
8657 |
+
return p instanceof Animated && p.removeChild(_assertThisInitialized(_this));
|
8658 |
+
});
|
8659 |
+
};
|
8660 |
|
8661 |
+
return _this;
|
8662 |
+
}
|
8663 |
|
8664 |
+
return AnimatedArray;
|
8665 |
+
}(Animated);
|
8666 |
+
var AnimatedObject =
|
8667 |
+
/*#__PURE__*/
|
8668 |
+
function (_Animated2) {
|
8669 |
+
_inheritsLoose(AnimatedObject, _Animated2);
|
8670 |
|
8671 |
+
function AnimatedObject() {
|
8672 |
+
var _this2;
|
|
|
8673 |
|
8674 |
+
for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
|
8675 |
+
args[_key3] = arguments[_key3];
|
8676 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8677 |
|
8678 |
+
_this2 = _Animated2.call.apply(_Animated2, [this].concat(args)) || this;
|
8679 |
+
_this2.payload = {};
|
|
|
8680 |
|
8681 |
+
_this2.attach = function () {
|
8682 |
+
return Object.values(_this2.payload).forEach(function (s) {
|
8683 |
+
return s instanceof Animated && s.addChild(_assertThisInitialized(_this2));
|
8684 |
+
});
|
8685 |
+
};
|
8686 |
|
8687 |
+
_this2.detach = function () {
|
8688 |
+
return Object.values(_this2.payload).forEach(function (s) {
|
8689 |
+
return s instanceof Animated && s.removeChild(_assertThisInitialized(_this2));
|
8690 |
+
});
|
8691 |
+
};
|
8692 |
|
8693 |
+
return _this2;
|
|
|
|
|
|
|
|
|
|
|
8694 |
}
|
8695 |
|
8696 |
+
var _proto2 = AnimatedObject.prototype;
|
|
|
|
|
|
|
|
|
|
|
|
|
8697 |
|
8698 |
+
_proto2.getValue = function getValue(animated) {
|
8699 |
+
if (animated === void 0) {
|
8700 |
+
animated = false;
|
8701 |
+
}
|
|
|
|
|
|
|
8702 |
|
8703 |
+
var payload = {};
|
8704 |
|
8705 |
+
for (var _key4 in this.payload) {
|
8706 |
+
var value = this.payload[_key4];
|
8707 |
+
if (animated && !(value instanceof Animated)) continue;
|
8708 |
+
payload[_key4] = value instanceof Animated ? value[animated ? 'getAnimatedValue' : 'getValue']() : value;
|
8709 |
+
}
|
8710 |
|
8711 |
+
return payload;
|
8712 |
+
};
|
|
|
|
|
|
|
|
|
|
|
8713 |
|
8714 |
+
_proto2.getAnimatedValue = function getAnimatedValue() {
|
8715 |
+
return this.getValue(true);
|
8716 |
+
};
|
|
|
|
|
|
|
|
|
8717 |
|
8718 |
+
return AnimatedObject;
|
8719 |
+
}(Animated);
|
|
|
|
|
|
|
|
|
|
|
8720 |
|
8721 |
+
var applyAnimatedValues;
|
8722 |
+
function injectApplyAnimatedValues(fn, transform) {
|
8723 |
+
applyAnimatedValues = {
|
8724 |
+
fn: fn,
|
8725 |
+
transform: transform
|
8726 |
+
};
|
8727 |
}
|
8728 |
+
var colorNames;
|
8729 |
+
function injectColorNames(names) {
|
8730 |
+
colorNames = names;
|
|
|
|
|
|
|
|
|
|
|
8731 |
}
|
8732 |
+
var requestFrame = function requestFrame(cb) {
|
8733 |
+
return typeof window !== 'undefined' ? window.requestAnimationFrame(cb) : -1;
|
8734 |
+
};
|
8735 |
+
var cancelFrame = function cancelFrame(id) {
|
8736 |
+
typeof window !== 'undefined' && window.cancelAnimationFrame(id);
|
8737 |
+
};
|
8738 |
+
function injectFrame(raf, caf) {
|
8739 |
+
requestFrame = raf;
|
8740 |
+
cancelFrame = caf;
|
8741 |
}
|
8742 |
+
var interpolation;
|
8743 |
+
function injectStringInterpolator(fn) {
|
8744 |
+
interpolation = fn;
|
|
|
|
|
|
|
8745 |
}
|
8746 |
+
var now = function now() {
|
8747 |
+
return Date.now();
|
8748 |
+
};
|
8749 |
+
function injectNow(nowFn) {
|
8750 |
+
now = nowFn;
|
8751 |
}
|
8752 |
+
var defaultElement;
|
8753 |
+
function injectDefaultElement(el) {
|
8754 |
+
defaultElement = el;
|
|
|
|
|
|
|
8755 |
}
|
8756 |
+
var animatedApi = function animatedApi(node) {
|
8757 |
+
return node.current;
|
8758 |
+
};
|
8759 |
+
function injectAnimatedApi(fn) {
|
8760 |
+
animatedApi = fn;
|
8761 |
+
}
|
8762 |
+
var createAnimatedStyle;
|
8763 |
+
function injectCreateAnimatedStyle(factory) {
|
8764 |
+
createAnimatedStyle = factory;
|
8765 |
+
}
|
8766 |
+
var manualFrameloop;
|
8767 |
+
function injectManualFrameloop(callback) {
|
8768 |
+
manualFrameloop = callback;
|
8769 |
}
|
8770 |
|
8771 |
+
var Globals = /*#__PURE__*/Object.freeze({
|
8772 |
+
get applyAnimatedValues () { return applyAnimatedValues; },
|
8773 |
+
injectApplyAnimatedValues: injectApplyAnimatedValues,
|
8774 |
+
get colorNames () { return colorNames; },
|
8775 |
+
injectColorNames: injectColorNames,
|
8776 |
+
get requestFrame () { return requestFrame; },
|
8777 |
+
get cancelFrame () { return cancelFrame; },
|
8778 |
+
injectFrame: injectFrame,
|
8779 |
+
get interpolation () { return interpolation; },
|
8780 |
+
injectStringInterpolator: injectStringInterpolator,
|
8781 |
+
get now () { return now; },
|
8782 |
+
injectNow: injectNow,
|
8783 |
+
get defaultElement () { return defaultElement; },
|
8784 |
+
injectDefaultElement: injectDefaultElement,
|
8785 |
+
get animatedApi () { return animatedApi; },
|
8786 |
+
injectAnimatedApi: injectAnimatedApi,
|
8787 |
+
get createAnimatedStyle () { return createAnimatedStyle; },
|
8788 |
+
injectCreateAnimatedStyle: injectCreateAnimatedStyle,
|
8789 |
+
get manualFrameloop () { return manualFrameloop; },
|
8790 |
+
injectManualFrameloop: injectManualFrameloop
|
8791 |
+
});
|
8792 |
|
|
|
8793 |
/**
|
8794 |
+
* Wraps the `style` property with `AnimatedStyle`.
|
|
|
|
|
|
|
|
|
|
|
|
|
8795 |
*/
|
8796 |
|
8797 |
+
var AnimatedProps =
|
8798 |
+
/*#__PURE__*/
|
8799 |
+
function (_AnimatedObject) {
|
8800 |
+
_inheritsLoose(AnimatedProps, _AnimatedObject);
|
8801 |
+
|
8802 |
+
function AnimatedProps(props, callback) {
|
8803 |
+
var _this;
|
8804 |
+
|
8805 |
+
_this = _AnimatedObject.call(this) || this;
|
8806 |
+
_this.update = void 0;
|
8807 |
+
_this.payload = !props.style ? props : _extends({}, props, {
|
8808 |
+
style: createAnimatedStyle(props.style)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8809 |
});
|
8810 |
+
_this.update = callback;
|
8811 |
+
|
8812 |
+
_this.attach();
|
8813 |
+
|
8814 |
+
return _this;
|
8815 |
+
}
|
8816 |
+
|
8817 |
+
return AnimatedProps;
|
8818 |
+
}(AnimatedObject);
|
8819 |
+
|
8820 |
+
var isFunctionComponent = function isFunctionComponent(val) {
|
8821 |
+
return is.fun(val) && !(val.prototype instanceof React__default.Component);
|
8822 |
};
|
8823 |
|
8824 |
+
var createAnimatedComponent = function createAnimatedComponent(Component) {
|
8825 |
+
var AnimatedComponent = React.forwardRef(function (props, ref) {
|
8826 |
+
var forceUpdate = useForceUpdate();
|
8827 |
+
var mounted = React.useRef(true);
|
8828 |
+
var propsAnimated = React.useRef(null);
|
8829 |
+
var node = React.useRef(null);
|
8830 |
+
var attachProps = React.useCallback(function (props) {
|
8831 |
+
var oldPropsAnimated = propsAnimated.current;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8832 |
|
8833 |
+
var callback = function callback() {
|
8834 |
+
var didUpdate = false;
|
|
|
8835 |
|
8836 |
+
if (node.current) {
|
8837 |
+
didUpdate = applyAnimatedValues.fn(node.current, propsAnimated.current.getAnimatedValue());
|
8838 |
+
}
|
|
|
|
|
|
|
|
|
8839 |
|
8840 |
+
if (!node.current || didUpdate === false) {
|
8841 |
+
// If no referenced node has been found, or the update target didn't have a
|
8842 |
+
// native-responder, then forceUpdate the animation ...
|
8843 |
+
forceUpdate();
|
8844 |
+
}
|
8845 |
+
};
|
8846 |
|
8847 |
+
propsAnimated.current = new AnimatedProps(props, callback);
|
8848 |
+
oldPropsAnimated && oldPropsAnimated.detach();
|
8849 |
+
}, []);
|
8850 |
+
React.useEffect(function () {
|
8851 |
+
return function () {
|
8852 |
+
mounted.current = false;
|
8853 |
+
propsAnimated.current && propsAnimated.current.detach();
|
8854 |
+
};
|
8855 |
+
}, []);
|
8856 |
+
React.useImperativeHandle(ref, function () {
|
8857 |
+
return animatedApi(node, mounted, forceUpdate);
|
8858 |
+
});
|
8859 |
+
attachProps(props);
|
8860 |
|
8861 |
+
var _getValue = propsAnimated.current.getValue(),
|
8862 |
+
scrollTop = _getValue.scrollTop,
|
8863 |
+
scrollLeft = _getValue.scrollLeft,
|
8864 |
+
animatedProps = _objectWithoutPropertiesLoose(_getValue, ["scrollTop", "scrollLeft"]); // Functions cannot have refs, see:
|
8865 |
+
// See: https://github.com/react-spring/react-spring/issues/569
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8866 |
|
|
|
|
|
|
|
8867 |
|
8868 |
+
var refFn = isFunctionComponent(Component) ? undefined : function (childRef) {
|
8869 |
+
return node.current = handleRef(childRef, ref);
|
8870 |
+
};
|
8871 |
+
return React__default.createElement(Component, _extends({}, animatedProps, {
|
8872 |
+
ref: refFn
|
8873 |
+
}));
|
8874 |
+
});
|
8875 |
+
return AnimatedComponent;
|
8876 |
+
};
|
8877 |
|
8878 |
+
var active = false;
|
8879 |
+
var controllers = new Set();
|
|
|
|
|
|
|
|
|
|
|
8880 |
|
8881 |
+
var update = function update() {
|
8882 |
+
if (!active) return false;
|
8883 |
+
var time = now();
|
8884 |
|
8885 |
+
for (var _iterator = controllers, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
|
8886 |
+
var _ref;
|
8887 |
+
|
8888 |
+
if (_isArray) {
|
8889 |
+
if (_i >= _iterator.length) break;
|
8890 |
+
_ref = _iterator[_i++];
|
8891 |
+
} else {
|
8892 |
+
_i = _iterator.next();
|
8893 |
+
if (_i.done) break;
|
8894 |
+
_ref = _i.value;
|
8895 |
}
|
8896 |
|
8897 |
+
var controller = _ref;
|
8898 |
+
var isActive = false;
|
|
|
|
|
|
|
8899 |
|
8900 |
+
for (var configIdx = 0; configIdx < controller.configs.length; configIdx++) {
|
8901 |
+
var config = controller.configs[configIdx];
|
8902 |
+
var endOfAnimation = void 0,
|
8903 |
+
lastTime = void 0;
|
|
|
8904 |
|
8905 |
+
for (var valIdx = 0; valIdx < config.animatedValues.length; valIdx++) {
|
8906 |
+
var animation = config.animatedValues[valIdx]; // If an animation is done, skip, until all of them conclude
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8907 |
|
8908 |
+
if (animation.done) continue;
|
8909 |
+
var from = config.fromValues[valIdx];
|
8910 |
+
var to = config.toValues[valIdx];
|
8911 |
+
var position = animation.lastPosition;
|
8912 |
+
var isAnimated = to instanceof Animated;
|
8913 |
+
var velocity = Array.isArray(config.initialVelocity) ? config.initialVelocity[valIdx] : config.initialVelocity;
|
8914 |
+
if (isAnimated) to = to.getValue(); // Conclude animation if it's either immediate, or from-values match end-state
|
8915 |
|
8916 |
+
if (config.immediate) {
|
8917 |
+
animation.setValue(to);
|
8918 |
+
animation.done = true;
|
8919 |
+
continue;
|
8920 |
+
} // Break animation when string values are involved
|
8921 |
|
|
|
|
|
8922 |
|
8923 |
+
if (typeof from === 'string' || typeof to === 'string') {
|
8924 |
+
animation.setValue(to);
|
8925 |
+
animation.done = true;
|
8926 |
+
continue;
|
8927 |
+
}
|
8928 |
|
8929 |
+
if (config.duration !== void 0) {
|
8930 |
+
/** Duration easing */
|
8931 |
+
position = from + config.easing((time - animation.startTime) / config.duration) * (to - from);
|
8932 |
+
endOfAnimation = time >= animation.startTime + config.duration;
|
8933 |
+
} else if (config.decay) {
|
8934 |
+
/** Decay easing */
|
8935 |
+
position = from + velocity / (1 - 0.998) * (1 - Math.exp(-(1 - 0.998) * (time - animation.startTime)));
|
8936 |
+
endOfAnimation = Math.abs(animation.lastPosition - position) < 0.1;
|
8937 |
+
if (endOfAnimation) to = position;
|
8938 |
+
} else {
|
8939 |
+
/** Spring easing */
|
8940 |
+
lastTime = animation.lastTime !== void 0 ? animation.lastTime : time;
|
8941 |
+
velocity = animation.lastVelocity !== void 0 ? animation.lastVelocity : config.initialVelocity; // If we lost a lot of frames just jump to the end.
|
8942 |
|
8943 |
+
if (time > lastTime + 64) lastTime = time; // http://gafferongames.com/game-physics/fix-your-timestep/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8944 |
|
8945 |
+
var numSteps = Math.floor(time - lastTime);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8946 |
|
8947 |
+
for (var i = 0; i < numSteps; ++i) {
|
8948 |
+
var force = -config.tension * (position - to);
|
8949 |
+
var damping = -config.friction * velocity;
|
8950 |
+
var acceleration = (force + damping) / config.mass;
|
8951 |
+
velocity = velocity + acceleration * 1 / 1000;
|
8952 |
+
position = position + velocity * 1 / 1000;
|
8953 |
+
} // Conditions for stopping the spring animation
|
8954 |
|
|
|
|
|
|
|
|
|
|
|
8955 |
|
8956 |
+
var isOvershooting = config.clamp && config.tension !== 0 ? from < to ? position > to : position < to : false;
|
8957 |
+
var isVelocity = Math.abs(velocity) <= config.precision;
|
8958 |
+
var isDisplacement = config.tension !== 0 ? Math.abs(to - position) <= config.precision : true;
|
8959 |
+
endOfAnimation = isOvershooting || isVelocity && isDisplacement;
|
8960 |
+
animation.lastVelocity = velocity;
|
8961 |
+
animation.lastTime = time;
|
8962 |
+
} // Trails aren't done until their parents conclude
|
8963 |
|
|
|
|
|
|
|
|
|
|
|
8964 |
|
8965 |
+
if (isAnimated && !config.toValues[valIdx].done) endOfAnimation = false;
|
|
|
|
|
|
|
|
|
8966 |
|
8967 |
+
if (endOfAnimation) {
|
8968 |
+
// Ensure that we end up with a round value
|
8969 |
+
if (animation.value !== to) position = to;
|
8970 |
+
animation.done = true;
|
8971 |
+
} else isActive = true;
|
|
|
|
|
|
|
|
|
|
|
|
|
8972 |
|
8973 |
+
animation.setValue(position);
|
8974 |
+
animation.lastPosition = position;
|
8975 |
+
} // Keep track of updated values only when necessary
|
|
|
8976 |
|
|
|
|
|
|
|
|
|
8977 |
|
8978 |
+
if (controller.props.onFrame) controller.values[config.name] = config.interpolation.getValue();
|
8979 |
+
} // Update callbacks in the end of the frame
|
8980 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8981 |
|
8982 |
+
if (controller.props.onFrame) controller.props.onFrame(controller.values); // Either call onEnd or next frame
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8983 |
|
8984 |
+
if (!isActive) {
|
8985 |
+
controllers.delete(controller);
|
8986 |
+
controller.stop(true);
|
8987 |
+
}
|
8988 |
+
} // Loop over as long as there are controllers ...
|
|
|
|
|
|
|
|
|
|
|
|
|
8989 |
|
|
|
|
|
|
|
|
|
|
|
|
|
8990 |
|
8991 |
+
if (controllers.size) {
|
8992 |
+
if (manualFrameloop) manualFrameloop();else requestFrame(update);
|
8993 |
+
} else {
|
8994 |
+
active = false;
|
|
|
8995 |
}
|
8996 |
|
8997 |
+
return active;
|
8998 |
+
};
|
|
|
|
|
|
|
8999 |
|
9000 |
+
var start = function start(controller) {
|
9001 |
+
if (!controllers.has(controller)) controllers.add(controller);
|
9002 |
|
9003 |
+
if (!active) {
|
9004 |
+
active = true;
|
9005 |
+
if (manualFrameloop) requestFrame(manualFrameloop);else requestFrame(update);
|
9006 |
+
}
|
9007 |
+
};
|
9008 |
|
9009 |
+
var stop = function stop(controller) {
|
9010 |
+
if (controllers.has(controller)) controllers.delete(controller);
|
9011 |
+
};
|
9012 |
|
9013 |
+
function createInterpolator(range, output, extrapolate) {
|
9014 |
+
if (typeof range === 'function') {
|
9015 |
+
return range;
|
9016 |
+
}
|
9017 |
|
9018 |
+
if (Array.isArray(range)) {
|
9019 |
+
return createInterpolator({
|
9020 |
+
range: range,
|
9021 |
+
output: output,
|
9022 |
+
extrapolate: extrapolate
|
9023 |
+
});
|
9024 |
+
}
|
9025 |
|
9026 |
+
if (interpolation && typeof range.output[0] === 'string') {
|
9027 |
+
return interpolation(range);
|
9028 |
+
}
|
|
|
|
|
9029 |
|
9030 |
+
var config = range;
|
9031 |
+
var outputRange = config.output;
|
9032 |
+
var inputRange = config.range || [0, 1];
|
9033 |
+
var extrapolateLeft = config.extrapolateLeft || config.extrapolate || 'extend';
|
9034 |
+
var extrapolateRight = config.extrapolateRight || config.extrapolate || 'extend';
|
9035 |
|
9036 |
+
var easing = config.easing || function (t) {
|
9037 |
+
return t;
|
9038 |
+
};
|
|
|
|
|
|
|
|
|
9039 |
|
9040 |
+
return function (input) {
|
9041 |
+
var range = findRange(input, inputRange);
|
9042 |
+
return interpolate(input, inputRange[range], inputRange[range + 1], outputRange[range], outputRange[range + 1], easing, extrapolateLeft, extrapolateRight, config.map);
|
9043 |
+
};
|
9044 |
+
}
|
9045 |
|
9046 |
+
function interpolate(input, inputMin, inputMax, outputMin, outputMax, easing, extrapolateLeft, extrapolateRight, map) {
|
9047 |
+
var result = map ? map(input) : input; // Extrapolate
|
|
|
9048 |
|
9049 |
+
if (result < inputMin) {
|
9050 |
+
if (extrapolateLeft === 'identity') return result;else if (extrapolateLeft === 'clamp') result = inputMin;
|
9051 |
+
}
|
9052 |
|
9053 |
+
if (result > inputMax) {
|
9054 |
+
if (extrapolateRight === 'identity') return result;else if (extrapolateRight === 'clamp') result = inputMax;
|
9055 |
+
}
|
9056 |
|
9057 |
+
if (outputMin === outputMax) return outputMin;
|
9058 |
+
if (inputMin === inputMax) return input <= inputMin ? outputMin : outputMax; // Input Range
|
9059 |
|
9060 |
+
if (inputMin === -Infinity) result = -result;else if (inputMax === Infinity) result = result - inputMin;else result = (result - inputMin) / (inputMax - inputMin); // Easing
|
|
|
|
|
9061 |
|
9062 |
+
result = easing(result); // Output Range
|
|
|
9063 |
|
9064 |
+
if (outputMin === -Infinity) result = -result;else if (outputMax === Infinity) result = result + outputMin;else result = result * (outputMax - outputMin) + outputMin;
|
9065 |
+
return result;
|
9066 |
}
|
9067 |
|
9068 |
+
function findRange(input, inputRange) {
|
9069 |
+
for (var i = 1; i < inputRange.length - 1; ++i) {
|
9070 |
+
if (inputRange[i] >= input) break;
|
9071 |
+
}
|
|
|
|
|
|
|
|
|
|
|
9072 |
|
9073 |
+
return i - 1;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9074 |
}
|
9075 |
|
9076 |
+
var AnimatedInterpolation =
|
9077 |
+
/*#__PURE__*/
|
9078 |
+
function (_AnimatedArray) {
|
9079 |
+
_inheritsLoose(AnimatedInterpolation, _AnimatedArray);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9080 |
|
9081 |
+
function AnimatedInterpolation(parents, range, output, extrapolate) {
|
9082 |
+
var _this;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9083 |
|
9084 |
+
_this = _AnimatedArray.call(this) || this;
|
9085 |
+
_this.calc = void 0;
|
9086 |
+
_this.payload = parents instanceof AnimatedArray && !(parents instanceof AnimatedInterpolation) ? parents.getPayload() : Array.isArray(parents) ? parents : [parents];
|
9087 |
+
_this.calc = createInterpolator(range, output, extrapolate);
|
9088 |
+
return _this;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9089 |
}
|
9090 |
|
9091 |
+
var _proto = AnimatedInterpolation.prototype;
|
|
|
9092 |
|
9093 |
+
_proto.getValue = function getValue() {
|
9094 |
+
return this.calc.apply(this, this.payload.map(function (value) {
|
9095 |
+
return value.getValue();
|
9096 |
+
}));
|
9097 |
+
};
|
9098 |
+
|
9099 |
+
_proto.updateConfig = function updateConfig(range, output, extrapolate) {
|
9100 |
+
this.calc = createInterpolator(range, output, extrapolate);
|
9101 |
+
};
|
9102 |
+
|
9103 |
+
_proto.interpolate = function interpolate(range, output, extrapolate) {
|
9104 |
+
return new AnimatedInterpolation(this, range, output, extrapolate);
|
9105 |
+
};
|
9106 |
+
|
9107 |
+
return AnimatedInterpolation;
|
9108 |
+
}(AnimatedArray);
|
9109 |
+
|
9110 |
+
var interpolate$1 = function interpolate(parents, range, output) {
|
9111 |
+
return parents && new AnimatedInterpolation(parents, range, output);
|
9112 |
+
};
|
9113 |
+
|
9114 |
+
var config = {
|
9115 |
+
default: {
|
9116 |
+
tension: 170,
|
9117 |
+
friction: 26
|
9118 |
+
},
|
9119 |
+
gentle: {
|
9120 |
+
tension: 120,
|
9121 |
+
friction: 14
|
9122 |
+
},
|
9123 |
+
wobbly: {
|
9124 |
+
tension: 180,
|
9125 |
+
friction: 12
|
9126 |
+
},
|
9127 |
+
stiff: {
|
9128 |
+
tension: 210,
|
9129 |
+
friction: 20
|
9130 |
+
},
|
9131 |
+
slow: {
|
9132 |
+
tension: 280,
|
9133 |
+
friction: 60
|
9134 |
+
},
|
9135 |
+
molasses: {
|
9136 |
+
tension: 280,
|
9137 |
+
friction: 120
|
9138 |
+
}
|
9139 |
+
};
|
9140 |
+
|
9141 |
+
/** API
|
9142 |
+
* useChain(references, timeSteps, timeFrame)
|
9143 |
*/
|
|
|
|
|
9144 |
|
9145 |
+
function useChain(refs, timeSteps, timeFrame) {
|
9146 |
+
if (timeFrame === void 0) {
|
9147 |
+
timeFrame = 1000;
|
9148 |
}
|
9149 |
|
9150 |
+
var previous = React.useRef();
|
9151 |
+
React.useEffect(function () {
|
9152 |
+
if (is.equ(refs, previous.current)) refs.forEach(function (_ref) {
|
9153 |
+
var current = _ref.current;
|
9154 |
+
return current && current.start();
|
9155 |
+
});else if (timeSteps) {
|
9156 |
+
refs.forEach(function (_ref2, index) {
|
9157 |
+
var current = _ref2.current;
|
9158 |
|
9159 |
+
if (current) {
|
9160 |
+
var ctrls = current.controllers;
|
9161 |
|
9162 |
+
if (ctrls.length) {
|
9163 |
+
var t = timeFrame * timeSteps[index];
|
9164 |
+
ctrls.forEach(function (ctrl) {
|
9165 |
+
ctrl.queue = ctrl.queue.map(function (e) {
|
9166 |
+
return _extends({}, e, {
|
9167 |
+
delay: e.delay + t
|
9168 |
+
});
|
9169 |
+
});
|
9170 |
+
ctrl.start();
|
9171 |
+
});
|
9172 |
+
}
|
9173 |
+
}
|
9174 |
+
});
|
9175 |
+
} else refs.reduce(function (q, _ref3, rI) {
|
9176 |
+
var current = _ref3.current;
|
9177 |
+
return q = q.then(function () {
|
9178 |
+
return current.start();
|
9179 |
+
});
|
9180 |
+
}, Promise.resolve());
|
9181 |
+
previous.current = refs;
|
9182 |
+
});
|
9183 |
}
|
9184 |
|
9185 |
/**
|
9186 |
+
* Animated works by building a directed acyclic graph of dependencies
|
9187 |
+
* transparently when you render your Animated components.
|
9188 |
*
|
9189 |
+
* new Animated.Value(0)
|
9190 |
+
* .interpolate() .interpolate() new Animated.Value(1)
|
9191 |
+
* opacity translateY scale
|
9192 |
+
* style transform
|
9193 |
+
* View#234 style
|
9194 |
+
* View#123
|
9195 |
+
*
|
9196 |
+
* A) Top Down phase
|
9197 |
+
* When an AnimatedValue is updated, we recursively go down through this
|
9198 |
+
* graph in order to find leaf nodes: the views that we flag as needing
|
9199 |
+
* an update.
|
9200 |
+
*
|
9201 |
+
* B) Bottom Up phase
|
9202 |
+
* When a view is flagged as needing an update, we recursively go back up
|
9203 |
+
* in order to build the new value that it needs. The reason why we need
|
9204 |
+
* this two-phases process is to deal with composite props such as
|
9205 |
+
* transform which can receive values from multiple parents.
|
9206 |
*/
|
9207 |
+
function addAnimatedStyles(node, styles) {
|
9208 |
+
if ('update' in node) {
|
9209 |
+
styles.add(node);
|
9210 |
+
} else {
|
9211 |
+
node.getChildren().forEach(function (child) {
|
9212 |
+
return addAnimatedStyles(child, styles);
|
9213 |
+
});
|
9214 |
}
|
9215 |
+
}
|
9216 |
|
9217 |
+
var AnimatedValue =
|
9218 |
+
/*#__PURE__*/
|
9219 |
+
function (_Animated) {
|
9220 |
+
_inheritsLoose(AnimatedValue, _Animated);
|
9221 |
|
9222 |
+
function AnimatedValue(_value) {
|
9223 |
+
var _this;
|
|
|
9224 |
|
9225 |
+
_this = _Animated.call(this) || this;
|
9226 |
+
_this.animatedStyles = new Set();
|
9227 |
+
_this.value = void 0;
|
9228 |
+
_this.startPosition = void 0;
|
9229 |
+
_this.lastPosition = void 0;
|
9230 |
+
_this.lastVelocity = void 0;
|
9231 |
+
_this.startTime = void 0;
|
9232 |
+
_this.lastTime = void 0;
|
9233 |
+
_this.done = false;
|
9234 |
|
9235 |
+
_this.setValue = function (value, flush) {
|
9236 |
+
if (flush === void 0) {
|
9237 |
+
flush = true;
|
9238 |
+
}
|
|
|
9239 |
|
9240 |
+
_this.value = value;
|
9241 |
+
if (flush) _this.flush();
|
9242 |
+
};
|
9243 |
|
9244 |
+
_this.value = _value;
|
9245 |
+
_this.startPosition = _value;
|
9246 |
+
_this.lastPosition = _value;
|
9247 |
+
return _this;
|
9248 |
+
}
|
9249 |
|
9250 |
+
var _proto = AnimatedValue.prototype;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9251 |
|
9252 |
+
_proto.flush = function flush() {
|
9253 |
+
if (this.animatedStyles.size === 0) {
|
9254 |
+
addAnimatedStyles(this, this.animatedStyles);
|
9255 |
}
|
|
|
9256 |
|
9257 |
+
this.animatedStyles.forEach(function (animatedStyle) {
|
9258 |
+
return animatedStyle.update();
|
9259 |
+
});
|
9260 |
+
};
|
9261 |
|
9262 |
+
_proto.clearStyles = function clearStyles() {
|
9263 |
+
this.animatedStyles.clear();
|
9264 |
+
};
|
|
|
|
|
|
|
|
|
9265 |
|
9266 |
+
_proto.getValue = function getValue() {
|
9267 |
+
return this.value;
|
9268 |
+
};
|
|
|
|
|
|
|
|
|
9269 |
|
9270 |
+
_proto.interpolate = function interpolate(range, output, extrapolate) {
|
9271 |
+
return new AnimatedInterpolation(this, range, output, extrapolate);
|
9272 |
+
};
|
9273 |
|
9274 |
+
return AnimatedValue;
|
9275 |
+
}(Animated);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9276 |
|
9277 |
+
var AnimatedValueArray =
|
9278 |
+
/*#__PURE__*/
|
9279 |
+
function (_AnimatedArray) {
|
9280 |
+
_inheritsLoose(AnimatedValueArray, _AnimatedArray);
|
9281 |
|
9282 |
+
function AnimatedValueArray(values) {
|
9283 |
+
var _this;
|
|
|
9284 |
|
9285 |
+
_this = _AnimatedArray.call(this) || this;
|
9286 |
+
_this.payload = values.map(function (n) {
|
9287 |
+
return new AnimatedValue(n);
|
9288 |
+
});
|
9289 |
+
return _this;
|
9290 |
}
|
9291 |
|
9292 |
+
var _proto = AnimatedValueArray.prototype;
|
|
|
9293 |
|
9294 |
+
_proto.setValue = function setValue(value, flush) {
|
9295 |
+
var _this2 = this;
|
9296 |
|
9297 |
+
if (flush === void 0) {
|
9298 |
+
flush = true;
|
9299 |
+
}
|
9300 |
|
9301 |
+
if (Array.isArray(value)) {
|
9302 |
+
if (value.length === this.payload.length) {
|
9303 |
+
value.forEach(function (v, i) {
|
9304 |
+
return _this2.payload[i].setValue(v, flush);
|
9305 |
+
});
|
9306 |
+
}
|
9307 |
+
} else {
|
9308 |
+
this.payload.forEach(function (p) {
|
9309 |
+
return p.setValue(value, flush);
|
9310 |
+
});
|
9311 |
+
}
|
9312 |
+
};
|
9313 |
|
9314 |
+
_proto.getValue = function getValue() {
|
9315 |
+
return this.payload.map(function (v) {
|
9316 |
+
return v.getValue();
|
9317 |
+
});
|
9318 |
+
};
|
9319 |
|
9320 |
+
_proto.interpolate = function interpolate(range, output) {
|
9321 |
+
return new AnimatedInterpolation(this, range, output);
|
9322 |
+
};
|
9323 |
|
9324 |
+
return AnimatedValueArray;
|
9325 |
+
}(AnimatedArray);
|
9326 |
|
9327 |
+
var G = 0;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9328 |
|
9329 |
+
var Controller =
|
9330 |
+
/*#__PURE__*/
|
9331 |
+
function () {
|
9332 |
+
function Controller() {
|
9333 |
+
var _this = this;
|
9334 |
|
9335 |
+
this.id = void 0;
|
9336 |
+
this.idle = true;
|
9337 |
+
this.hasChanged = false;
|
9338 |
+
this.guid = 0;
|
9339 |
+
this.local = 0;
|
9340 |
+
this.props = {};
|
9341 |
+
this.merged = {};
|
9342 |
+
this.animations = {};
|
9343 |
+
this.interpolations = {};
|
9344 |
+
this.values = {};
|
9345 |
+
this.configs = [];
|
9346 |
+
this.listeners = [];
|
9347 |
+
this.queue = [];
|
9348 |
+
this.localQueue = void 0;
|
9349 |
|
9350 |
+
this.getValues = function () {
|
9351 |
+
return _this.interpolations;
|
9352 |
+
};
|
9353 |
|
9354 |
+
this.id = G++;
|
9355 |
+
}
|
9356 |
+
/** update(props)
|
9357 |
+
* This function filters input props and creates an array of tasks which are executed in .start()
|
9358 |
+
* Each task is allowed to carry a delay, which means it can execute asnychroneously */
|
9359 |
|
|
|
|
|
|
|
|
|
|
|
|
|
9360 |
|
9361 |
+
var _proto = Controller.prototype;
|
9362 |
|
9363 |
+
_proto.update = function update$$1(args) {
|
9364 |
+
//this._id = n + this.id
|
9365 |
+
if (!args) return this; // Extract delay and the to-prop from props
|
9366 |
|
9367 |
+
var _ref = interpolateTo(args),
|
9368 |
+
_ref$delay = _ref.delay,
|
9369 |
+
delay = _ref$delay === void 0 ? 0 : _ref$delay,
|
9370 |
+
to = _ref.to,
|
9371 |
+
props = _objectWithoutPropertiesLoose(_ref, ["delay", "to"]);
|
9372 |
|
9373 |
+
if (is.arr(to) || is.fun(to)) {
|
9374 |
+
// If config is either a function or an array queue it up as is
|
9375 |
+
this.queue.push(_extends({}, props, {
|
9376 |
+
delay: delay,
|
9377 |
+
to: to
|
9378 |
+
}));
|
9379 |
+
} else if (to) {
|
9380 |
+
// Otherwise go through each key since it could be delayed individually
|
9381 |
+
var ops = {};
|
9382 |
+
Object.entries(to).forEach(function (_ref2) {
|
9383 |
+
var _to;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9384 |
|
9385 |
+
var k = _ref2[0],
|
9386 |
+
v = _ref2[1];
|
9387 |
|
9388 |
+
// Fetch delay and create an entry, consisting of the to-props, the delay, and basic props
|
9389 |
+
var entry = _extends({
|
9390 |
+
to: (_to = {}, _to[k] = v, _to),
|
9391 |
+
delay: callProp(delay, k)
|
9392 |
+
}, props);
|
9393 |
|
9394 |
+
var previous = ops[entry.delay] && ops[entry.delay].to;
|
9395 |
+
ops[entry.delay] = _extends({}, ops[entry.delay], entry, {
|
9396 |
+
to: _extends({}, previous, entry.to)
|
9397 |
+
});
|
9398 |
+
});
|
9399 |
+
this.queue = Object.values(ops);
|
9400 |
+
} // Sort queue, so that async calls go last
|
9401 |
|
9402 |
|
9403 |
+
this.queue = this.queue.sort(function (a, b) {
|
9404 |
+
return a.delay - b.delay;
|
9405 |
+
}); // Diff the reduced props immediately (they'll contain the from-prop and some config)
|
9406 |
|
9407 |
+
this.diff(props);
|
9408 |
+
return this;
|
9409 |
+
}
|
9410 |
+
/** start(onEnd)
|
9411 |
+
* This function either executes a queue, if present, or starts the frameloop, which animates */
|
9412 |
+
;
|
9413 |
|
9414 |
+
_proto.start = function start$$1(onEnd) {
|
9415 |
+
var _this2 = this;
|
9416 |
|
9417 |
+
// If a queue is present we must excecute it
|
9418 |
+
if (this.queue.length) {
|
9419 |
+
this.idle = false; // Updates can interrupt trailing queues, in that case we just merge values
|
9420 |
|
9421 |
+
if (this.localQueue) {
|
9422 |
+
this.localQueue.forEach(function (_ref3) {
|
9423 |
+
var _ref3$from = _ref3.from,
|
9424 |
+
from = _ref3$from === void 0 ? {} : _ref3$from,
|
9425 |
+
_ref3$to = _ref3.to,
|
9426 |
+
to = _ref3$to === void 0 ? {} : _ref3$to;
|
9427 |
+
if (is.obj(from)) _this2.merged = _extends({}, from, _this2.merged);
|
9428 |
+
if (is.obj(to)) _this2.merged = _extends({}, _this2.merged, to);
|
9429 |
+
});
|
9430 |
+
} // The guid helps us tracking frames, a new queue over an old one means an override
|
9431 |
+
// We discard async calls in that caseÍ
|
9432 |
|
9433 |
|
9434 |
+
var local = this.local = ++this.guid;
|
9435 |
+
var queue = this.localQueue = this.queue;
|
9436 |
+
this.queue = []; // Go through each entry and execute it
|
9437 |
|
9438 |
+
queue.forEach(function (_ref4, index) {
|
9439 |
+
var delay = _ref4.delay,
|
9440 |
+
props = _objectWithoutPropertiesLoose(_ref4, ["delay"]);
|
9441 |
|
9442 |
+
var cb = function cb(finished) {
|
9443 |
+
if (index === queue.length - 1 && local === _this2.guid && finished) {
|
9444 |
+
_this2.idle = true;
|
9445 |
+
if (_this2.props.onRest) _this2.props.onRest(_this2.merged);
|
9446 |
+
}
|
9447 |
|
9448 |
+
if (onEnd) onEnd();
|
9449 |
+
}; // Entries can be delayed, ansyc or immediate
|
9450 |
|
|
|
|
|
|
|
|
|
9451 |
|
9452 |
+
var async = is.arr(props.to) || is.fun(props.to);
|
|
|
9453 |
|
9454 |
+
if (delay) {
|
9455 |
+
setTimeout(function () {
|
9456 |
+
if (local === _this2.guid) {
|
9457 |
+
if (async) _this2.runAsync(props, cb);else _this2.diff(props).start(cb);
|
9458 |
+
}
|
9459 |
+
}, delay);
|
9460 |
+
} else if (async) _this2.runAsync(props, cb);else _this2.diff(props).start(cb);
|
9461 |
+
});
|
9462 |
+
} // Otherwise we kick of the frameloop
|
9463 |
+
else {
|
9464 |
+
if (is.fun(onEnd)) this.listeners.push(onEnd);
|
9465 |
+
if (this.props.onStart) this.props.onStart();
|
9466 |
|
9467 |
+
start(this);
|
9468 |
+
}
|
9469 |
|
9470 |
+
return this;
|
9471 |
+
};
|
9472 |
+
|
9473 |
+
_proto.stop = function stop$$1(finished) {
|
9474 |
+
this.listeners.forEach(function (onEnd) {
|
9475 |
+
return onEnd(finished);
|
9476 |
+
});
|
9477 |
+
this.listeners = [];
|
9478 |
+
return this;
|
9479 |
}
|
9480 |
+
/** Pause sets onEnd listeners free, but also removes the controller from the frameloop */
|
9481 |
+
;
|
9482 |
|
9483 |
+
_proto.pause = function pause(finished) {
|
9484 |
+
this.stop(true);
|
9485 |
+
if (finished) stop(this);
|
9486 |
+
return this;
|
9487 |
+
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9488 |
|
9489 |
+
_proto.runAsync = function runAsync(_ref5, onEnd) {
|
9490 |
+
var _this3 = this;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9491 |
|
9492 |
+
var delay = _ref5.delay,
|
9493 |
+
props = _objectWithoutPropertiesLoose(_ref5, ["delay"]);
|
9494 |
|
9495 |
+
var local = this.local; // If "to" is either a function or an array it will be processed async, therefor "to" should be empty right now
|
9496 |
+
// If the view relies on certain values "from" has to be present
|
9497 |
|
9498 |
+
var queue = Promise.resolve(undefined);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9499 |
|
9500 |
+
if (is.arr(props.to)) {
|
9501 |
+
var _loop = function _loop(i) {
|
9502 |
+
var index = i;
|
|
|
|
|
|
|
|
|
9503 |
|
9504 |
+
var fresh = _extends({}, props, interpolateTo(props.to[index]));
|
|
|
9505 |
|
9506 |
+
if (is.arr(fresh.config)) fresh.config = fresh.config[index];
|
9507 |
+
queue = queue.then(function () {
|
9508 |
+
//this.stop()
|
9509 |
+
if (local === _this3.guid) return new Promise(function (r) {
|
9510 |
+
return _this3.diff(fresh).start(r);
|
9511 |
+
});
|
9512 |
+
});
|
9513 |
+
};
|
9514 |
|
9515 |
+
for (var i = 0; i < props.to.length; i++) {
|
9516 |
+
_loop(i);
|
9517 |
+
}
|
9518 |
+
} else if (is.fun(props.to)) {
|
9519 |
+
var index = 0;
|
9520 |
+
var last;
|
9521 |
+
queue = queue.then(function () {
|
9522 |
+
return props.to( // next(props)
|
9523 |
+
function (p) {
|
9524 |
+
var fresh = _extends({}, props, interpolateTo(p));
|
9525 |
|
9526 |
+
if (is.arr(fresh.config)) fresh.config = fresh.config[index];
|
9527 |
+
index++; //this.stop()
|
9528 |
|
9529 |
+
if (local === _this3.guid) return last = new Promise(function (r) {
|
9530 |
+
return _this3.diff(fresh).start(r);
|
9531 |
+
});
|
9532 |
+
return;
|
9533 |
+
}, // cancel()
|
9534 |
+
function (finished) {
|
9535 |
+
if (finished === void 0) {
|
9536 |
+
finished = true;
|
9537 |
+
}
|
9538 |
|
9539 |
+
return _this3.stop(finished);
|
9540 |
+
}).then(function () {
|
9541 |
+
return last;
|
9542 |
+
});
|
9543 |
+
});
|
9544 |
+
}
|
9545 |
|
9546 |
+
queue.then(onEnd);
|
9547 |
+
};
|
9548 |
|
9549 |
+
_proto.diff = function diff(props) {
|
9550 |
+
var _this4 = this;
|
9551 |
|
9552 |
+
this.props = _extends({}, this.props, props);
|
9553 |
+
var _this$props = this.props,
|
9554 |
+
_this$props$from = _this$props.from,
|
9555 |
+
from = _this$props$from === void 0 ? {} : _this$props$from,
|
9556 |
+
_this$props$to = _this$props.to,
|
9557 |
+
to = _this$props$to === void 0 ? {} : _this$props$to,
|
9558 |
+
_this$props$config = _this$props.config,
|
9559 |
+
config = _this$props$config === void 0 ? {} : _this$props$config,
|
9560 |
+
reverse = _this$props.reverse,
|
9561 |
+
attach = _this$props.attach,
|
9562 |
+
reset = _this$props.reset,
|
9563 |
+
immediate = _this$props.immediate; // Reverse values when requested
|
9564 |
|
9565 |
+
if (reverse) {
|
9566 |
+
var _ref6 = [to, from];
|
9567 |
+
from = _ref6[0];
|
9568 |
+
to = _ref6[1];
|
9569 |
+
} // This will collect all props that were ever set, reset merged props when necessary
|
9570 |
|
|
|
|
|
|
|
9571 |
|
9572 |
+
this.merged = _extends({}, from, this.merged, to);
|
9573 |
+
this.hasChanged = false; // Attachment handling, trailed springs can "attach" themselves to a previous spring
|
9574 |
|
9575 |
+
var target = attach && attach(this); // Reduces input { name: value } pairs into animated values
|
|
|
9576 |
|
9577 |
+
this.animations = Object.entries(this.merged).reduce(function (acc, _ref7) {
|
9578 |
+
var name = _ref7[0],
|
9579 |
+
value = _ref7[1];
|
9580 |
+
// Issue cached entries, except on reset
|
9581 |
+
var entry = acc[name] || {}; // Figure out what the value is supposed to be
|
9582 |
|
9583 |
+
var isNumber = is.num(value);
|
9584 |
+
var isString = is.str(value) && !value.startsWith('#') && !/\d/.test(value) && !colorNames[value];
|
9585 |
+
var isArray = is.arr(value);
|
9586 |
+
var isInterpolation = !isNumber && !isArray && !isString;
|
9587 |
+
var fromValue = !is.und(from[name]) ? from[name] : value;
|
9588 |
+
var toValue = isNumber || isArray ? value : isString ? value : 1;
|
9589 |
+
var toConfig = callProp(config, name);
|
9590 |
+
if (target) toValue = target.animations[name].parent;
|
9591 |
+
var parent = entry.parent,
|
9592 |
+
interpolation$$1 = entry.interpolation,
|
9593 |
+
toValues = toArray(target ? toValue.getPayload() : toValue),
|
9594 |
+
animatedValues;
|
9595 |
+
var newValue = value;
|
9596 |
+
if (isInterpolation) newValue = interpolation({
|
9597 |
+
range: [0, 1],
|
9598 |
+
output: [value, value]
|
9599 |
+
})(1);
|
9600 |
+
var currentValue = interpolation$$1 && interpolation$$1.getValue(); // Change detection flags
|
9601 |
|
9602 |
+
var isFirst = is.und(parent);
|
9603 |
+
var isActive = !isFirst && entry.animatedValues.some(function (v) {
|
9604 |
+
return !v.done;
|
9605 |
+
});
|
9606 |
+
var currentValueDiffersFromGoal = !is.equ(newValue, currentValue);
|
9607 |
+
var hasNewGoal = !is.equ(newValue, entry.previous);
|
9608 |
+
var hasNewConfig = !is.equ(toConfig, entry.config); // Change animation props when props indicate a new goal (new value differs from previous one)
|
9609 |
+
// and current values differ from it. Config changes trigger a new update as well (though probably shouldn't?)
|
9610 |
|
9611 |
+
if (reset || hasNewGoal && currentValueDiffersFromGoal || hasNewConfig) {
|
9612 |
+
var _extends2;
|
9613 |
|
9614 |
+
// Convert regular values into animated values, ALWAYS re-use if possible
|
9615 |
+
if (isNumber || isString) parent = interpolation$$1 = entry.parent || new AnimatedValue(fromValue);else if (isArray) parent = interpolation$$1 = entry.parent || new AnimatedValueArray(fromValue);else if (isInterpolation) {
|
9616 |
+
var prev = entry.interpolation && entry.interpolation.calc(entry.parent.value);
|
9617 |
+
prev = prev !== void 0 && !reset ? prev : fromValue;
|
9618 |
|
9619 |
+
if (entry.parent) {
|
9620 |
+
parent = entry.parent;
|
9621 |
+
parent.setValue(0, false);
|
9622 |
+
} else parent = new AnimatedValue(0);
|
9623 |
|
9624 |
+
var range = {
|
9625 |
+
output: [prev, value]
|
9626 |
+
};
|
9627 |
|
9628 |
+
if (entry.interpolation) {
|
9629 |
+
interpolation$$1 = entry.interpolation;
|
9630 |
+
entry.interpolation.updateConfig(range);
|
9631 |
+
} else interpolation$$1 = parent.interpolate(range);
|
9632 |
+
}
|
9633 |
+
toValues = toArray(target ? toValue.getPayload() : toValue);
|
9634 |
+
animatedValues = toArray(parent.getPayload());
|
9635 |
+
if (reset && !isInterpolation) parent.setValue(fromValue, false);
|
9636 |
+
_this4.hasChanged = true; // Reset animated values
|
9637 |
|
9638 |
+
animatedValues.forEach(function (value) {
|
9639 |
+
value.startPosition = value.value;
|
9640 |
+
value.lastPosition = value.value;
|
9641 |
+
value.lastVelocity = isActive ? value.lastVelocity : undefined;
|
9642 |
+
value.lastTime = isActive ? value.lastTime : undefined;
|
9643 |
+
value.startTime = now();
|
9644 |
+
value.done = false;
|
9645 |
+
value.animatedStyles.clear();
|
9646 |
+
}); // Set immediate values
|
9647 |
|
9648 |
+
if (callProp(immediate, name)) {
|
9649 |
+
parent.setValue(isInterpolation ? toValue : value, false);
|
9650 |
+
}
|
9651 |
|
9652 |
+
return _extends({}, acc, (_extends2 = {}, _extends2[name] = _extends({}, entry, {
|
9653 |
+
name: name,
|
9654 |
+
parent: parent,
|
9655 |
+
interpolation: interpolation$$1,
|
9656 |
+
animatedValues: animatedValues,
|
9657 |
+
toValues: toValues,
|
9658 |
+
previous: newValue,
|
9659 |
+
config: toConfig,
|
9660 |
+
fromValues: toArray(parent.getValue()),
|
9661 |
+
immediate: callProp(immediate, name),
|
9662 |
+
initialVelocity: withDefault(toConfig.velocity, 0),
|
9663 |
+
clamp: withDefault(toConfig.clamp, false),
|
9664 |
+
precision: withDefault(toConfig.precision, 0.01),
|
9665 |
+
tension: withDefault(toConfig.tension, 170),
|
9666 |
+
friction: withDefault(toConfig.friction, 26),
|
9667 |
+
mass: withDefault(toConfig.mass, 1),
|
9668 |
+
duration: toConfig.duration,
|
9669 |
+
easing: withDefault(toConfig.easing, function (t) {
|
9670 |
+
return t;
|
9671 |
+
}),
|
9672 |
+
decay: toConfig.decay
|
9673 |
+
}), _extends2));
|
9674 |
+
} else {
|
9675 |
+
if (!currentValueDiffersFromGoal) {
|
9676 |
+
var _extends3;
|
9677 |
|
9678 |
+
// So ... the current target value (newValue) appears to be different from the previous value,
|
9679 |
+
// which normally constitutes an update, but the actual value (currentValue) matches the target!
|
9680 |
+
// In order to resolve this without causing an animation update we silently flag the animation as done,
|
9681 |
+
// which it technically is. Interpolations also needs a config update with their target set to 1.
|
9682 |
+
if (isInterpolation) {
|
9683 |
+
parent.setValue(1, false);
|
9684 |
+
interpolation$$1.updateConfig({
|
9685 |
+
output: [newValue, newValue]
|
9686 |
+
});
|
9687 |
+
}
|
9688 |
|
9689 |
+
parent.done = true;
|
9690 |
+
_this4.hasChanged = true;
|
9691 |
+
return _extends({}, acc, (_extends3 = {}, _extends3[name] = _extends({}, acc[name], {
|
9692 |
+
previous: newValue
|
9693 |
+
}), _extends3));
|
9694 |
+
}
|
9695 |
|
9696 |
+
return acc;
|
9697 |
+
}
|
9698 |
+
}, this.animations);
|
9699 |
+
|
9700 |
+
if (this.hasChanged) {
|
9701 |
+
// Make animations available to frameloop
|
9702 |
+
this.configs = Object.values(this.animations);
|
9703 |
+
this.values = {};
|
9704 |
+
this.interpolations = {};
|
9705 |
+
|
9706 |
+
for (var key in this.animations) {
|
9707 |
+
this.interpolations[key] = this.animations[key].interpolation;
|
9708 |
+
this.values[key] = this.animations[key].interpolation.getValue();
|
9709 |
+
}
|
9710 |
+
}
|
9711 |
|
9712 |
+
return this;
|
9713 |
+
};
|
9714 |
|
9715 |
+
_proto.destroy = function destroy() {
|
9716 |
+
this.stop();
|
9717 |
+
this.props = {};
|
9718 |
+
this.merged = {};
|
9719 |
+
this.animations = {};
|
9720 |
+
this.interpolations = {};
|
9721 |
+
this.values = {};
|
9722 |
+
this.configs = [];
|
9723 |
+
this.local = 0;
|
9724 |
+
};
|
9725 |
|
9726 |
+
return Controller;
|
9727 |
+
}();
|
9728 |
|
9729 |
+
/** API
|
9730 |
+
* const props = useSprings(number, [{ ... }, { ... }, ...])
|
9731 |
+
* const [props, set] = useSprings(number, (i, controller) => ({ ... }))
|
9732 |
+
*/
|
9733 |
|
9734 |
+
var useSprings = function useSprings(length, props) {
|
9735 |
+
var mounted = React.useRef(false);
|
9736 |
+
var ctrl = React.useRef();
|
9737 |
+
var isFn = is.fun(props); // The controller maintains the animation values, starts and stops animations
|
9738 |
|
9739 |
+
var _useMemo = React.useMemo(function () {
|
9740 |
+
// Remove old controllers
|
9741 |
+
if (ctrl.current) {
|
9742 |
+
ctrl.current.map(function (c) {
|
9743 |
+
return c.destroy();
|
9744 |
+
});
|
9745 |
+
ctrl.current = undefined;
|
9746 |
+
}
|
9747 |
|
9748 |
+
var ref;
|
9749 |
+
return [new Array(length).fill().map(function (_, i) {
|
9750 |
+
var ctrl = new Controller();
|
9751 |
+
var newProps = isFn ? callProp(props, i, ctrl) : props[i];
|
9752 |
+
if (i === 0) ref = newProps.ref;
|
9753 |
+
ctrl.update(newProps);
|
9754 |
+
if (!ref) ctrl.start();
|
9755 |
+
return ctrl;
|
9756 |
+
}), ref];
|
9757 |
+
}, [length]),
|
9758 |
+
controllers = _useMemo[0],
|
9759 |
+
ref = _useMemo[1];
|
9760 |
+
|
9761 |
+
ctrl.current = controllers; // The hooks reference api gets defined here ...
|
9762 |
+
|
9763 |
+
var api = React.useImperativeHandle(ref, function () {
|
9764 |
+
return {
|
9765 |
+
start: function start() {
|
9766 |
+
return Promise.all(ctrl.current.map(function (c) {
|
9767 |
+
return new Promise(function (r) {
|
9768 |
+
return c.start(r);
|
9769 |
+
});
|
9770 |
+
}));
|
9771 |
+
},
|
9772 |
+
stop: function stop(finished) {
|
9773 |
+
return ctrl.current.forEach(function (c) {
|
9774 |
+
return c.stop(finished);
|
9775 |
+
});
|
9776 |
+
},
|
9777 |
+
|
9778 |
+
get controllers() {
|
9779 |
+
return ctrl.current;
|
9780 |
}
|
|
|
|
|
9781 |
|
9782 |
+
};
|
9783 |
+
}); // This function updates the controllers
|
9784 |
|
9785 |
+
var updateCtrl = React.useMemo(function () {
|
9786 |
+
return function (updateProps) {
|
9787 |
+
return ctrl.current.map(function (c, i) {
|
9788 |
+
c.update(isFn ? callProp(updateProps, i, c) : updateProps[i]);
|
9789 |
+
if (!ref) c.start();
|
9790 |
+
});
|
9791 |
+
};
|
9792 |
+
}, [length]); // Update controller if props aren't functional
|
9793 |
|
9794 |
+
React.useEffect(function () {
|
9795 |
+
if (mounted.current) {
|
9796 |
+
if (!isFn) updateCtrl(props);
|
9797 |
+
} else if (!ref) ctrl.current.forEach(function (c) {
|
9798 |
+
return c.start();
|
9799 |
+
});
|
9800 |
+
}); // Update mounted flag and destroy controller on unmount
|
9801 |
|
9802 |
+
React.useEffect(function () {
|
9803 |
+
return mounted.current = true, function () {
|
9804 |
+
return ctrl.current.forEach(function (c) {
|
9805 |
+
return c.destroy();
|
9806 |
+
});
|
9807 |
+
};
|
9808 |
+
}, []); // Return animated props, or, anim-props + the update-setter above
|
9809 |
+
|
9810 |
+
var propValues = ctrl.current.map(function (c) {
|
9811 |
+
return c.getValues();
|
|
|
|
|
|
|
9812 |
});
|
9813 |
+
return isFn ? [propValues, updateCtrl, function (finished) {
|
9814 |
+
return ctrl.current.forEach(function (c) {
|
9815 |
+
return c.pause(finished);
|
9816 |
+
});
|
9817 |
+
}] : propValues;
|
9818 |
};
|
9819 |
|
9820 |
+
/** API
|
9821 |
+
* const props = useSpring({ ... })
|
9822 |
+
* const [props, set] = useSpring(() => ({ ... }))
|
9823 |
+
*/
|
9824 |
|
9825 |
+
var useSpring = function useSpring(props) {
|
9826 |
+
var isFn = is.fun(props);
|
9827 |
|
9828 |
+
var _useSprings = useSprings(1, isFn ? props : [props]),
|
9829 |
+
result = _useSprings[0],
|
9830 |
+
set = _useSprings[1],
|
9831 |
+
pause = _useSprings[2];
|
9832 |
+
|
9833 |
+
return isFn ? [result[0], set, pause] : result;
|
9834 |
+
};
|
9835 |
+
|
9836 |
+
/** API
|
9837 |
+
* const trails = useTrail(number, { ... })
|
9838 |
+
* const [trails, set] = useTrail(number, () => ({ ... }))
|
9839 |
*/
|
9840 |
|
9841 |
+
var useTrail = function useTrail(length, props) {
|
9842 |
+
var mounted = React.useRef(false);
|
9843 |
+
var isFn = is.fun(props);
|
9844 |
+
var updateProps = callProp(props);
|
9845 |
+
var instances = React.useRef();
|
9846 |
|
9847 |
+
var _useSprings = useSprings(length, function (i, ctrl) {
|
9848 |
+
if (i === 0) instances.current = [];
|
9849 |
+
instances.current.push(ctrl);
|
9850 |
+
return _extends({}, updateProps, {
|
9851 |
+
config: callProp(updateProps.config, i),
|
9852 |
+
attach: i > 0 && function () {
|
9853 |
+
return instances.current[i - 1];
|
9854 |
+
}
|
9855 |
+
});
|
9856 |
+
}),
|
9857 |
+
result = _useSprings[0],
|
9858 |
+
set = _useSprings[1],
|
9859 |
+
pause = _useSprings[2]; // Set up function to update controller
|
9860 |
|
9861 |
|
9862 |
+
var updateCtrl = React.useMemo(function () {
|
9863 |
+
return function (props) {
|
9864 |
+
return set(function (i, ctrl) {
|
9865 |
+
var last = props.reverse ? i === 0 : length - 1 === i;
|
9866 |
+
var attachIdx = props.reverse ? i + 1 : i - 1;
|
9867 |
+
var attachController = instances.current[attachIdx];
|
9868 |
+
return _extends({}, props, {
|
9869 |
+
config: callProp(props.config || updateProps.config, i),
|
9870 |
+
attach: attachController && function () {
|
9871 |
+
return attachController;
|
9872 |
+
}
|
9873 |
+
});
|
9874 |
+
});
|
9875 |
+
};
|
9876 |
+
}, [length, updateProps.reverse]); // Update controller if props aren't functional
|
9877 |
|
9878 |
+
React.useEffect(function () {
|
9879 |
+
return void (mounted.current && !isFn && updateCtrl(props));
|
9880 |
+
}); // Update mounted flag and destroy controller on unmount
|
9881 |
|
9882 |
+
React.useEffect(function () {
|
9883 |
+
return void (mounted.current = true);
|
9884 |
+
}, []);
|
9885 |
+
return isFn ? [result, updateCtrl, pause] : result;
|
9886 |
+
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9887 |
|
9888 |
+
/** API
|
9889 |
+
* const transitions = useTransition(items, itemKeys, { ... })
|
9890 |
+
* const [transitions, update] = useTransition(items, itemKeys, () => ({ ... }))
|
9891 |
+
*/
|
9892 |
|
9893 |
+
var guid = 0;
|
9894 |
+
var ENTER = 'enter';
|
9895 |
+
var LEAVE = 'leave';
|
9896 |
+
var UPDATE = 'update';
|
9897 |
|
9898 |
+
var mapKeys = function mapKeys(items, keys) {
|
9899 |
+
return (typeof keys === 'function' ? items.map(keys) : toArray(keys)).map(String);
|
9900 |
+
};
|
|
|
|
|
9901 |
|
9902 |
+
var get = function get(props) {
|
9903 |
+
var items = props.items,
|
9904 |
+
_props$keys = props.keys,
|
9905 |
+
keys = _props$keys === void 0 ? function (item) {
|
9906 |
+
return item;
|
9907 |
+
} : _props$keys,
|
9908 |
+
rest = _objectWithoutPropertiesLoose(props, ["items", "keys"]);
|
9909 |
|
9910 |
+
items = toArray(items !== void 0 ? items : null);
|
9911 |
+
return _extends({
|
9912 |
+
items: items,
|
9913 |
+
keys: mapKeys(items, keys)
|
9914 |
+
}, rest);
|
9915 |
+
};
|
9916 |
|
9917 |
+
function useTransition(input, keyTransform, config) {
|
9918 |
+
var props = _extends({
|
9919 |
+
items: input,
|
9920 |
+
keys: keyTransform || function (i) {
|
9921 |
+
return i;
|
9922 |
+
}
|
9923 |
+
}, config);
|
9924 |
|
9925 |
+
var _get = get(props),
|
9926 |
+
_get$lazy = _get.lazy,
|
9927 |
+
lazy = _get$lazy === void 0 ? false : _get$lazy,
|
9928 |
+
_get$unique = _get.unique,
|
9929 |
+
_get$reset = _get.reset,
|
9930 |
+
reset = _get$reset === void 0 ? false : _get$reset,
|
9931 |
+
enter = _get.enter,
|
9932 |
+
leave = _get.leave,
|
9933 |
+
update = _get.update,
|
9934 |
+
onDestroyed = _get.onDestroyed,
|
9935 |
+
keys = _get.keys,
|
9936 |
+
items = _get.items,
|
9937 |
+
onFrame = _get.onFrame,
|
9938 |
+
_onRest = _get.onRest,
|
9939 |
+
onStart = _get.onStart,
|
9940 |
+
ref = _get.ref,
|
9941 |
+
extra = _objectWithoutPropertiesLoose(_get, ["lazy", "unique", "reset", "enter", "leave", "update", "onDestroyed", "keys", "items", "onFrame", "onRest", "onStart", "ref"]);
|
9942 |
|
9943 |
+
var forceUpdate = useForceUpdate();
|
9944 |
+
var mounted = React.useRef(false);
|
9945 |
+
var state = React.useRef({
|
9946 |
+
mounted: false,
|
9947 |
+
first: true,
|
9948 |
+
deleted: [],
|
9949 |
+
current: {},
|
9950 |
+
transitions: [],
|
9951 |
+
prevProps: {},
|
9952 |
+
paused: !!props.ref,
|
9953 |
+
instances: !mounted.current && new Map(),
|
9954 |
+
forceUpdate: forceUpdate
|
9955 |
+
});
|
9956 |
+
React.useImperativeHandle(props.ref, function () {
|
9957 |
+
return {
|
9958 |
+
start: function start() {
|
9959 |
+
return Promise.all(Array.from(state.current.instances).map(function (_ref) {
|
9960 |
+
var c = _ref[1];
|
9961 |
+
return new Promise(function (r) {
|
9962 |
+
return c.start(r);
|
9963 |
+
});
|
9964 |
+
}));
|
9965 |
+
},
|
9966 |
+
stop: function stop(finished) {
|
9967 |
+
return Array.from(state.current.instances).forEach(function (_ref2) {
|
9968 |
+
var c = _ref2[1];
|
9969 |
+
return c.stop(finished);
|
9970 |
+
});
|
9971 |
+
},
|
9972 |
|
9973 |
+
get controllers() {
|
9974 |
+
return Array.from(state.current.instances).map(function (_ref3) {
|
9975 |
+
var c = _ref3[1];
|
9976 |
+
return c;
|
9977 |
+
});
|
9978 |
+
}
|
9979 |
|
9980 |
+
};
|
9981 |
+
}); // Update state
|
9982 |
|
9983 |
+
state.current = diffItems(state.current, props);
|
9984 |
|
9985 |
+
if (state.current.changed) {
|
9986 |
+
// Update state
|
9987 |
+
state.current.transitions.forEach(function (transition) {
|
9988 |
+
var slot = transition.slot,
|
9989 |
+
from = transition.from,
|
9990 |
+
to = transition.to,
|
9991 |
+
config = transition.config,
|
9992 |
+
trail = transition.trail,
|
9993 |
+
key = transition.key,
|
9994 |
+
item = transition.item;
|
9995 |
+
if (!state.current.instances.has(key)) state.current.instances.set(key, new Controller()); // update the map object
|
9996 |
|
9997 |
+
var ctrl = state.current.instances.get(key);
|
|
|
|
|
9998 |
|
9999 |
+
var newProps = _extends({}, extra, {
|
10000 |
+
to: to,
|
10001 |
+
from: from,
|
10002 |
+
config: config,
|
10003 |
+
ref: ref,
|
10004 |
+
onRest: function onRest(values) {
|
10005 |
+
if (state.current.mounted) {
|
10006 |
+
if (transition.destroyed) {
|
10007 |
+
// If no ref is given delete destroyed items immediately
|
10008 |
+
if (!ref && !lazy) cleanUp(state, key);
|
10009 |
+
if (onDestroyed) onDestroyed(item);
|
10010 |
+
} // A transition comes to rest once all its springs conclude
|
10011 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10012 |
|
10013 |
+
var curInstances = Array.from(state.current.instances);
|
10014 |
+
var active = curInstances.some(function (_ref4) {
|
10015 |
+
var c = _ref4[1];
|
10016 |
+
return !c.idle;
|
10017 |
+
});
|
10018 |
+
if (!active && (ref || lazy) && state.current.deleted.length > 0) cleanUp(state);
|
10019 |
+
if (_onRest) _onRest(item, slot, values);
|
10020 |
+
}
|
10021 |
+
},
|
10022 |
+
onStart: onStart && function () {
|
10023 |
+
return onStart(item, slot);
|
10024 |
+
},
|
10025 |
+
onFrame: onFrame && function (values) {
|
10026 |
+
return onFrame(item, slot, values);
|
10027 |
+
},
|
10028 |
+
delay: trail,
|
10029 |
+
reset: reset && slot === ENTER // Update controller
|
10030 |
|
10031 |
+
});
|
|
|
|
|
|
|
10032 |
|
10033 |
+
ctrl.update(newProps);
|
10034 |
+
if (!state.current.paused) ctrl.start();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10035 |
});
|
10036 |
}
|
10037 |
|
10038 |
+
React.useEffect(function () {
|
10039 |
+
state.current.mounted = mounted.current = true;
|
10040 |
+
return function () {
|
10041 |
+
state.current.mounted = mounted.current = false;
|
10042 |
+
Array.from(state.current.instances).map(function (_ref5) {
|
10043 |
+
var c = _ref5[1];
|
10044 |
+
return c.destroy();
|
10045 |
+
});
|
10046 |
+
state.current.instances.clear();
|
10047 |
+
};
|
10048 |
+
}, []);
|
10049 |
+
return state.current.transitions.map(function (_ref6) {
|
10050 |
+
var item = _ref6.item,
|
10051 |
+
slot = _ref6.slot,
|
10052 |
+
key = _ref6.key;
|
10053 |
+
return {
|
10054 |
+
item: item,
|
10055 |
+
key: key,
|
10056 |
+
state: slot,
|
10057 |
+
props: state.current.instances.get(key).getValues()
|
10058 |
+
};
|
10059 |
});
|
10060 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10061 |
|
10062 |
+
function cleanUp(state, filterKey) {
|
10063 |
+
var deleted = state.current.deleted;
|
|
|
|
|
|
|
10064 |
|
10065 |
+
var _loop = function _loop() {
|
10066 |
+
if (_isArray) {
|
10067 |
+
if (_i >= _iterator.length) return "break";
|
10068 |
+
_ref8 = _iterator[_i++];
|
10069 |
+
} else {
|
10070 |
+
_i = _iterator.next();
|
10071 |
+
if (_i.done) return "break";
|
10072 |
+
_ref8 = _i.value;
|
10073 |
+
}
|
10074 |
+
|
10075 |
+
var _ref7 = _ref8;
|
10076 |
+
var key = _ref7.key;
|
10077 |
+
|
10078 |
+
var filter = function filter(t) {
|
10079 |
+
return t.key !== key;
|
10080 |
};
|
|
|
|
|
|
|
|
|
10081 |
|
10082 |
+
if (is.und(filterKey) || filterKey === key) {
|
10083 |
+
state.current.instances.delete(key);
|
10084 |
+
state.current.transitions = state.current.transitions.filter(filter);
|
10085 |
+
state.current.deleted = state.current.deleted.filter(filter);
|
10086 |
}
|
10087 |
+
};
|
10088 |
|
10089 |
+
for (var _iterator = deleted, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
|
10090 |
+
var _ref8;
|
10091 |
+
|
10092 |
+
var _ret = _loop();
|
10093 |
+
|
10094 |
+
if (_ret === "break") break;
|
10095 |
+
}
|
10096 |
+
|
10097 |
+
state.current.forceUpdate();
|
10098 |
+
}
|
10099 |
+
|
10100 |
+
function diffItems(_ref9, props) {
|
10101 |
+
var first = _ref9.first,
|
10102 |
+
prevProps = _ref9.prevProps,
|
10103 |
+
state = _objectWithoutPropertiesLoose(_ref9, ["first", "prevProps"]);
|
10104 |
+
|
10105 |
+
var _get2 = get(props),
|
10106 |
+
items = _get2.items,
|
10107 |
+
keys = _get2.keys,
|
10108 |
+
initial = _get2.initial,
|
10109 |
+
from = _get2.from,
|
10110 |
+
enter = _get2.enter,
|
10111 |
+
leave = _get2.leave,
|
10112 |
+
update = _get2.update,
|
10113 |
+
_get2$trail = _get2.trail,
|
10114 |
+
trail = _get2$trail === void 0 ? 0 : _get2$trail,
|
10115 |
+
unique = _get2.unique,
|
10116 |
+
config = _get2.config,
|
10117 |
+
_get2$order = _get2.order,
|
10118 |
+
order = _get2$order === void 0 ? [ENTER, LEAVE, UPDATE] : _get2$order;
|
10119 |
+
|
10120 |
+
var _get3 = get(prevProps),
|
10121 |
+
_keys = _get3.keys,
|
10122 |
+
_items = _get3.items;
|
10123 |
+
|
10124 |
+
var current = _extends({}, state.current);
|
10125 |
+
|
10126 |
+
var deleted = [].concat(state.deleted); // Compare next keys with current keys
|
10127 |
+
|
10128 |
+
var currentKeys = Object.keys(current);
|
10129 |
+
var currentSet = new Set(currentKeys);
|
10130 |
+
var nextSet = new Set(keys);
|
10131 |
+
var added = keys.filter(function (item) {
|
10132 |
+
return !currentSet.has(item);
|
10133 |
+
});
|
10134 |
+
var removed = state.transitions.filter(function (item) {
|
10135 |
+
return !item.destroyed && !nextSet.has(item.originalKey);
|
10136 |
+
}).map(function (i) {
|
10137 |
+
return i.originalKey;
|
10138 |
+
});
|
10139 |
+
var updated = keys.filter(function (item) {
|
10140 |
+
return currentSet.has(item);
|
10141 |
+
});
|
10142 |
+
var delay = -trail;
|
10143 |
+
|
10144 |
+
while (order.length) {
|
10145 |
+
var changeType = order.shift();
|
10146 |
+
|
10147 |
+
switch (changeType) {
|
10148 |
+
case ENTER:
|
10149 |
+
{
|
10150 |
+
added.forEach(function (key, index) {
|
10151 |
+
// In unique mode, remove fading out transitions if their key comes in again
|
10152 |
+
if (unique && deleted.find(function (d) {
|
10153 |
+
return d.originalKey === key;
|
10154 |
+
})) deleted = deleted.filter(function (t) {
|
10155 |
+
return t.originalKey !== key;
|
10156 |
+
});
|
10157 |
+
var keyIndex = keys.indexOf(key);
|
10158 |
+
var item = items[keyIndex];
|
10159 |
+
var slot = first && initial !== void 0 ? 'initial' : ENTER;
|
10160 |
+
current[key] = {
|
10161 |
+
slot: slot,
|
10162 |
+
originalKey: key,
|
10163 |
+
key: unique ? String(key) : guid++,
|
10164 |
+
item: item,
|
10165 |
+
trail: delay = delay + trail,
|
10166 |
+
config: callProp(config, item, slot),
|
10167 |
+
from: callProp(first ? initial !== void 0 ? initial || {} : from : from, item),
|
10168 |
+
to: callProp(enter, item)
|
10169 |
+
};
|
10170 |
+
});
|
10171 |
+
break;
|
10172 |
+
}
|
10173 |
+
|
10174 |
+
case LEAVE:
|
10175 |
+
{
|
10176 |
+
removed.forEach(function (key) {
|
10177 |
+
var keyIndex = _keys.indexOf(key);
|
10178 |
+
|
10179 |
+
var item = _items[keyIndex];
|
10180 |
+
var slot = LEAVE;
|
10181 |
+
deleted.unshift(_extends({}, current[key], {
|
10182 |
+
slot: slot,
|
10183 |
+
destroyed: true,
|
10184 |
+
left: _keys[Math.max(0, keyIndex - 1)],
|
10185 |
+
right: _keys[Math.min(_keys.length, keyIndex + 1)],
|
10186 |
+
trail: delay = delay + trail,
|
10187 |
+
config: callProp(config, item, slot),
|
10188 |
+
to: callProp(leave, item)
|
10189 |
+
}));
|
10190 |
+
delete current[key];
|
10191 |
+
});
|
10192 |
+
break;
|
10193 |
+
}
|
10194 |
+
|
10195 |
+
case UPDATE:
|
10196 |
+
{
|
10197 |
+
updated.forEach(function (key) {
|
10198 |
+
var keyIndex = keys.indexOf(key);
|
10199 |
+
var item = items[keyIndex];
|
10200 |
+
var slot = UPDATE;
|
10201 |
+
current[key] = _extends({}, current[key], {
|
10202 |
+
item: item,
|
10203 |
+
slot: slot,
|
10204 |
+
trail: delay = delay + trail,
|
10205 |
+
config: callProp(config, item, slot),
|
10206 |
+
to: callProp(update, item)
|
10207 |
+
});
|
10208 |
+
});
|
10209 |
+
break;
|
10210 |
+
}
|
10211 |
}
|
10212 |
+
}
|
10213 |
+
|
10214 |
+
var out = keys.map(function (key) {
|
10215 |
+
return current[key];
|
10216 |
+
}); // This tries to restore order for deleted items by finding their last known siblings
|
10217 |
+
// only using the left sibling to keep order placement consistent for all deleted items
|
10218 |
+
|
10219 |
+
deleted.forEach(function (_ref10) {
|
10220 |
+
var left = _ref10.left,
|
10221 |
+
right = _ref10.right,
|
10222 |
+
item = _objectWithoutPropertiesLoose(_ref10, ["left", "right"]);
|
10223 |
+
|
10224 |
+
var pos; // Was it the element on the left, if yes, move there ...
|
10225 |
+
|
10226 |
+
if ((pos = out.findIndex(function (t) {
|
10227 |
+
return t.originalKey === left;
|
10228 |
+
})) !== -1) pos += 1; // And if nothing else helps, move it to the start ¯\_(ツ)_/¯
|
10229 |
+
|
10230 |
+
pos = Math.max(0, pos);
|
10231 |
+
out = [].concat(out.slice(0, pos), [item], out.slice(pos));
|
10232 |
+
});
|
10233 |
+
return _extends({}, state, {
|
10234 |
+
changed: added.length || removed.length || updated.length,
|
10235 |
+
first: first && added.length === 0,
|
10236 |
+
transitions: out,
|
10237 |
+
current: current,
|
10238 |
+
deleted: deleted,
|
10239 |
+
prevProps: props
|
10240 |
});
|
|
|
|
|
|
|
|
|
|
|
10241 |
}
|
10242 |
|
10243 |
+
var AnimatedStyle =
|
10244 |
+
/*#__PURE__*/
|
10245 |
+
function (_AnimatedObject) {
|
10246 |
+
_inheritsLoose(AnimatedStyle, _AnimatedObject);
|
10247 |
+
|
10248 |
+
function AnimatedStyle(style) {
|
10249 |
+
var _this;
|
10250 |
+
|
10251 |
+
if (style === void 0) {
|
10252 |
+
style = {};
|
10253 |
+
}
|
10254 |
+
|
10255 |
+
_this = _AnimatedObject.call(this) || this;
|
10256 |
+
|
10257 |
+
if (style.transform && !(style.transform instanceof Animated)) {
|
10258 |
+
style = applyAnimatedValues.transform(style);
|
10259 |
+
}
|
10260 |
+
|
10261 |
+
_this.payload = style;
|
10262 |
+
return _this;
|
10263 |
+
}
|
10264 |
+
|
10265 |
+
return AnimatedStyle;
|
10266 |
+
}(AnimatedObject);
|
10267 |
+
|
10268 |
+
// http://www.w3.org/TR/css3-color/#svg-color
|
10269 |
+
var colors = {
|
10270 |
+
transparent: 0x00000000,
|
10271 |
+
aliceblue: 0xf0f8ffff,
|
10272 |
+
antiquewhite: 0xfaebd7ff,
|
10273 |
+
aqua: 0x00ffffff,
|
10274 |
+
aquamarine: 0x7fffd4ff,
|
10275 |
+
azure: 0xf0ffffff,
|
10276 |
+
beige: 0xf5f5dcff,
|
10277 |
+
bisque: 0xffe4c4ff,
|
10278 |
+
black: 0x000000ff,
|
10279 |
+
blanchedalmond: 0xffebcdff,
|
10280 |
+
blue: 0x0000ffff,
|
10281 |
+
blueviolet: 0x8a2be2ff,
|
10282 |
+
brown: 0xa52a2aff,
|
10283 |
+
burlywood: 0xdeb887ff,
|
10284 |
+
burntsienna: 0xea7e5dff,
|
10285 |
+
cadetblue: 0x5f9ea0ff,
|
10286 |
+
chartreuse: 0x7fff00ff,
|
10287 |
+
chocolate: 0xd2691eff,
|
10288 |
+
coral: 0xff7f50ff,
|
10289 |
+
cornflowerblue: 0x6495edff,
|
10290 |
+
cornsilk: 0xfff8dcff,
|
10291 |
+
crimson: 0xdc143cff,
|
10292 |
+
cyan: 0x00ffffff,
|
10293 |
+
darkblue: 0x00008bff,
|
10294 |
+
darkcyan: 0x008b8bff,
|
10295 |
+
darkgoldenrod: 0xb8860bff,
|
10296 |
+
darkgray: 0xa9a9a9ff,
|
10297 |
+
darkgreen: 0x006400ff,
|
10298 |
+
darkgrey: 0xa9a9a9ff,
|
10299 |
+
darkkhaki: 0xbdb76bff,
|
10300 |
+
darkmagenta: 0x8b008bff,
|
10301 |
+
darkolivegreen: 0x556b2fff,
|
10302 |
+
darkorange: 0xff8c00ff,
|
10303 |
+
darkorchid: 0x9932ccff,
|
10304 |
+
darkred: 0x8b0000ff,
|
10305 |
+
darksalmon: 0xe9967aff,
|
10306 |
+
darkseagreen: 0x8fbc8fff,
|
10307 |
+
darkslateblue: 0x483d8bff,
|
10308 |
+
darkslategray: 0x2f4f4fff,
|
10309 |
+
darkslategrey: 0x2f4f4fff,
|
10310 |
+
darkturquoise: 0x00ced1ff,
|
10311 |
+
darkviolet: 0x9400d3ff,
|
10312 |
+
deeppink: 0xff1493ff,
|
10313 |
+
deepskyblue: 0x00bfffff,
|
10314 |
+
dimgray: 0x696969ff,
|
10315 |
+
dimgrey: 0x696969ff,
|
10316 |
+
dodgerblue: 0x1e90ffff,
|
10317 |
+
firebrick: 0xb22222ff,
|
10318 |
+
floralwhite: 0xfffaf0ff,
|
10319 |
+
forestgreen: 0x228b22ff,
|
10320 |
+
fuchsia: 0xff00ffff,
|
10321 |
+
gainsboro: 0xdcdcdcff,
|
10322 |
+
ghostwhite: 0xf8f8ffff,
|
10323 |
+
gold: 0xffd700ff,
|
10324 |
+
goldenrod: 0xdaa520ff,
|
10325 |
+
gray: 0x808080ff,
|
10326 |
+
green: 0x008000ff,
|
10327 |
+
greenyellow: 0xadff2fff,
|
10328 |
+
grey: 0x808080ff,
|
10329 |
+
honeydew: 0xf0fff0ff,
|
10330 |
+
hotpink: 0xff69b4ff,
|
10331 |
+
indianred: 0xcd5c5cff,
|
10332 |
+
indigo: 0x4b0082ff,
|
10333 |
+
ivory: 0xfffff0ff,
|
10334 |
+
khaki: 0xf0e68cff,
|
10335 |
+
lavender: 0xe6e6faff,
|
10336 |
+
lavenderblush: 0xfff0f5ff,
|
10337 |
+
lawngreen: 0x7cfc00ff,
|
10338 |
+
lemonchiffon: 0xfffacdff,
|
10339 |
+
lightblue: 0xadd8e6ff,
|
10340 |
+
lightcoral: 0xf08080ff,
|
10341 |
+
lightcyan: 0xe0ffffff,
|
10342 |
+
lightgoldenrodyellow: 0xfafad2ff,
|
10343 |
+
lightgray: 0xd3d3d3ff,
|
10344 |
+
lightgreen: 0x90ee90ff,
|
10345 |
+
lightgrey: 0xd3d3d3ff,
|
10346 |
+
lightpink: 0xffb6c1ff,
|
10347 |
+
lightsalmon: 0xffa07aff,
|
10348 |
+
lightseagreen: 0x20b2aaff,
|
10349 |
+
lightskyblue: 0x87cefaff,
|
10350 |
+
lightslategray: 0x778899ff,
|
10351 |
+
lightslategrey: 0x778899ff,
|
10352 |
+
lightsteelblue: 0xb0c4deff,
|
10353 |
+
lightyellow: 0xffffe0ff,
|
10354 |
+
lime: 0x00ff00ff,
|
10355 |
+
limegreen: 0x32cd32ff,
|
10356 |
+
linen: 0xfaf0e6ff,
|
10357 |
+
magenta: 0xff00ffff,
|
10358 |
+
maroon: 0x800000ff,
|
10359 |
+
mediumaquamarine: 0x66cdaaff,
|
10360 |
+
mediumblue: 0x0000cdff,
|
10361 |
+
mediumorchid: 0xba55d3ff,
|
10362 |
+
mediumpurple: 0x9370dbff,
|
10363 |
+
mediumseagreen: 0x3cb371ff,
|
10364 |
+
mediumslateblue: 0x7b68eeff,
|
10365 |
+
mediumspringgreen: 0x00fa9aff,
|
10366 |
+
mediumturquoise: 0x48d1ccff,
|
10367 |
+
mediumvioletred: 0xc71585ff,
|
10368 |
+
midnightblue: 0x191970ff,
|
10369 |
+
mintcream: 0xf5fffaff,
|
10370 |
+
mistyrose: 0xffe4e1ff,
|
10371 |
+
moccasin: 0xffe4b5ff,
|
10372 |
+
navajowhite: 0xffdeadff,
|
10373 |
+
navy: 0x000080ff,
|
10374 |
+
oldlace: 0xfdf5e6ff,
|
10375 |
+
olive: 0x808000ff,
|
10376 |
+
olivedrab: 0x6b8e23ff,
|
10377 |
+
orange: 0xffa500ff,
|
10378 |
+
orangered: 0xff4500ff,
|
10379 |
+
orchid: 0xda70d6ff,
|
10380 |
+
palegoldenrod: 0xeee8aaff,
|
10381 |
+
palegreen: 0x98fb98ff,
|
10382 |
+
paleturquoise: 0xafeeeeff,
|
10383 |
+
palevioletred: 0xdb7093ff,
|
10384 |
+
papayawhip: 0xffefd5ff,
|
10385 |
+
peachpuff: 0xffdab9ff,
|
10386 |
+
peru: 0xcd853fff,
|
10387 |
+
pink: 0xffc0cbff,
|
10388 |
+
plum: 0xdda0ddff,
|
10389 |
+
powderblue: 0xb0e0e6ff,
|
10390 |
+
purple: 0x800080ff,
|
10391 |
+
rebeccapurple: 0x663399ff,
|
10392 |
+
red: 0xff0000ff,
|
10393 |
+
rosybrown: 0xbc8f8fff,
|
10394 |
+
royalblue: 0x4169e1ff,
|
10395 |
+
saddlebrown: 0x8b4513ff,
|
10396 |
+
salmon: 0xfa8072ff,
|
10397 |
+
sandybrown: 0xf4a460ff,
|
10398 |
+
seagreen: 0x2e8b57ff,
|
10399 |
+
seashell: 0xfff5eeff,
|
10400 |
+
sienna: 0xa0522dff,
|
10401 |
+
silver: 0xc0c0c0ff,
|
10402 |
+
skyblue: 0x87ceebff,
|
10403 |
+
slateblue: 0x6a5acdff,
|
10404 |
+
slategray: 0x708090ff,
|
10405 |
+
slategrey: 0x708090ff,
|
10406 |
+
snow: 0xfffafaff,
|
10407 |
+
springgreen: 0x00ff7fff,
|
10408 |
+
steelblue: 0x4682b4ff,
|
10409 |
+
tan: 0xd2b48cff,
|
10410 |
+
teal: 0x008080ff,
|
10411 |
+
thistle: 0xd8bfd8ff,
|
10412 |
+
tomato: 0xff6347ff,
|
10413 |
+
turquoise: 0x40e0d0ff,
|
10414 |
+
violet: 0xee82eeff,
|
10415 |
+
wheat: 0xf5deb3ff,
|
10416 |
+
white: 0xffffffff,
|
10417 |
+
whitesmoke: 0xf5f5f5ff,
|
10418 |
+
yellow: 0xffff00ff,
|
10419 |
+
yellowgreen: 0x9acd32ff
|
10420 |
+
};
|
10421 |
+
|
10422 |
+
// const INTEGER = '[-+]?\\d+';
|
10423 |
+
var NUMBER = '[-+]?\\d*\\.?\\d+';
|
10424 |
+
var PERCENTAGE = NUMBER + '%';
|
10425 |
|
10426 |
+
function call() {
|
10427 |
+
for (var _len = arguments.length, parts = new Array(_len), _key = 0; _key < _len; _key++) {
|
10428 |
+
parts[_key] = arguments[_key];
|
10429 |
+
}
|
10430 |
|
10431 |
+
return '\\(\\s*(' + parts.join(')\\s*,\\s*(') + ')\\s*\\)';
|
10432 |
+
}
|
10433 |
|
10434 |
+
var rgb = new RegExp('rgb' + call(NUMBER, NUMBER, NUMBER));
|
10435 |
+
var rgba = new RegExp('rgba' + call(NUMBER, NUMBER, NUMBER, NUMBER));
|
10436 |
+
var hsl = new RegExp('hsl' + call(NUMBER, PERCENTAGE, PERCENTAGE));
|
10437 |
+
var hsla = new RegExp('hsla' + call(NUMBER, PERCENTAGE, PERCENTAGE, NUMBER));
|
10438 |
+
var hex3 = /^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/;
|
10439 |
+
var hex4 = /^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/;
|
10440 |
+
var hex6 = /^#([0-9a-fA-F]{6})$/;
|
10441 |
+
var hex8 = /^#([0-9a-fA-F]{8})$/;
|
10442 |
|
10443 |
+
/*
|
10444 |
+
https://github.com/react-community/normalize-css-color
|
10445 |
|
10446 |
+
BSD 3-Clause License
|
10447 |
|
10448 |
+
Copyright (c) 2016, React Community
|
10449 |
+
All rights reserved.
|
10450 |
|
10451 |
+
Redistribution and use in source and binary forms, with or without
|
10452 |
+
modification, are permitted provided that the following conditions are met:
|
10453 |
|
10454 |
+
* Redistributions of source code must retain the above copyright notice, this
|
10455 |
+
list of conditions and the following disclaimer.
|
|
|
|
|
10456 |
|
10457 |
+
* Redistributions in binary form must reproduce the above copyright notice,
|
10458 |
+
this list of conditions and the following disclaimer in the documentation
|
10459 |
+
and/or other materials provided with the distribution.
|
10460 |
|
10461 |
+
* Neither the name of the copyright holder nor the names of its
|
10462 |
+
contributors may be used to endorse or promote products derived from
|
10463 |
+
this software without specific prior written permission.
|
10464 |
|
10465 |
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
10466 |
+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
10467 |
+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
10468 |
+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
10469 |
+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
10470 |
+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
10471 |
+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
10472 |
+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
10473 |
+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
10474 |
+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
10475 |
+
*/
|
10476 |
+
function normalizeColor(color) {
|
10477 |
+
var match;
|
10478 |
|
10479 |
+
if (typeof color === 'number') {
|
10480 |
+
return color >>> 0 === color && color >= 0 && color <= 0xffffffff ? color : null;
|
10481 |
+
} // Ordered based on occurrences on Facebook codebase
|
10482 |
|
|
|
10483 |
|
10484 |
+
if (match = hex6.exec(color)) return parseInt(match[1] + 'ff', 16) >>> 0;
|
10485 |
+
if (colors.hasOwnProperty(color)) return colors[color];
|
|
|
|
|
|
|
|
|
|
|
10486 |
|
10487 |
+
if (match = rgb.exec(color)) {
|
10488 |
+
return (parse255(match[1]) << 24 | // r
|
10489 |
+
parse255(match[2]) << 16 | // g
|
10490 |
+
parse255(match[3]) << 8 | // b
|
10491 |
+
0x000000ff) >>> // a
|
10492 |
+
0;
|
10493 |
+
}
|
10494 |
|
10495 |
+
if (match = rgba.exec(color)) {
|
10496 |
+
return (parse255(match[1]) << 24 | // r
|
10497 |
+
parse255(match[2]) << 16 | // g
|
10498 |
+
parse255(match[3]) << 8 | // b
|
10499 |
+
parse1(match[4])) >>> // a
|
10500 |
+
0;
|
10501 |
+
}
|
10502 |
|
10503 |
+
if (match = hex3.exec(color)) {
|
10504 |
+
return parseInt(match[1] + match[1] + // r
|
10505 |
+
match[2] + match[2] + // g
|
10506 |
+
match[3] + match[3] + // b
|
10507 |
+
'ff', // a
|
10508 |
+
16) >>> 0;
|
10509 |
+
} // https://drafts.csswg.org/css-color-4/#hex-notation
|
10510 |
|
|
|
|
|
10511 |
|
10512 |
+
if (match = hex8.exec(color)) return parseInt(match[1], 16) >>> 0;
|
|
|
10513 |
|
10514 |
+
if (match = hex4.exec(color)) {
|
10515 |
+
return parseInt(match[1] + match[1] + // r
|
10516 |
+
match[2] + match[2] + // g
|
10517 |
+
match[3] + match[3] + // b
|
10518 |
+
match[4] + match[4], // a
|
10519 |
+
16) >>> 0;
|
10520 |
+
}
|
10521 |
|
10522 |
+
if (match = hsl.exec(color)) {
|
10523 |
+
return (hslToRgb(parse360(match[1]), // h
|
10524 |
+
parsePercentage(match[2]), // s
|
10525 |
+
parsePercentage(match[3]) // l
|
10526 |
+
) | 0x000000ff) >>> // a
|
10527 |
+
0;
|
10528 |
+
}
|
10529 |
|
10530 |
+
if (match = hsla.exec(color)) {
|
10531 |
+
return (hslToRgb(parse360(match[1]), // h
|
10532 |
+
parsePercentage(match[2]), // s
|
10533 |
+
parsePercentage(match[3]) // l
|
10534 |
+
) | parse1(match[4])) >>> // a
|
10535 |
+
0;
|
10536 |
+
}
|
10537 |
|
10538 |
+
return null;
|
|
|
10539 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10540 |
|
10541 |
+
function hue2rgb(p, q, t) {
|
10542 |
+
if (t < 0) t += 1;
|
10543 |
+
if (t > 1) t -= 1;
|
10544 |
+
if (t < 1 / 6) return p + (q - p) * 6 * t;
|
10545 |
+
if (t < 1 / 2) return q;
|
10546 |
+
if (t < 2 / 3) return p + (q - p) * (2 / 3 - t) * 6;
|
10547 |
+
return p;
|
10548 |
+
}
|
10549 |
|
10550 |
+
function hslToRgb(h, s, l) {
|
10551 |
+
var q = l < 0.5 ? l * (1 + s) : l + s - l * s;
|
10552 |
+
var p = 2 * l - q;
|
10553 |
+
var r = hue2rgb(p, q, h + 1 / 3);
|
10554 |
+
var g = hue2rgb(p, q, h);
|
10555 |
+
var b = hue2rgb(p, q, h - 1 / 3);
|
10556 |
+
return Math.round(r * 255) << 24 | Math.round(g * 255) << 16 | Math.round(b * 255) << 8;
|
10557 |
+
}
|
10558 |
|
10559 |
+
function parse255(str) {
|
10560 |
+
var int = parseInt(str, 10);
|
10561 |
+
if (int < 0) return 0;
|
10562 |
+
if (int > 255) return 255;
|
10563 |
+
return int;
|
10564 |
+
}
|
10565 |
|
10566 |
+
function parse360(str) {
|
10567 |
+
var int = parseFloat(str);
|
10568 |
+
return (int % 360 + 360) % 360 / 360;
|
10569 |
+
}
|
|
|
|
|
10570 |
|
10571 |
+
function parse1(str) {
|
10572 |
+
var num = parseFloat(str);
|
10573 |
+
if (num < 0) return 0;
|
10574 |
+
if (num > 1) return 255;
|
10575 |
+
return Math.round(num * 255);
|
10576 |
+
}
|
10577 |
|
10578 |
+
function parsePercentage(str) {
|
10579 |
+
// parseFloat conveniently ignores the final %
|
10580 |
+
var int = parseFloat(str);
|
10581 |
+
if (int < 0) return 0;
|
10582 |
+
if (int > 100) return 1;
|
10583 |
+
return int / 100;
|
10584 |
+
}
|
10585 |
|
10586 |
+
function colorToRgba(input) {
|
10587 |
+
var int32Color = normalizeColor(input);
|
10588 |
+
if (int32Color === null) return input;
|
10589 |
+
int32Color = int32Color || 0;
|
10590 |
+
var r = (int32Color & 0xff000000) >>> 24;
|
10591 |
+
var g = (int32Color & 0x00ff0000) >>> 16;
|
10592 |
+
var b = (int32Color & 0x0000ff00) >>> 8;
|
10593 |
+
var a = (int32Color & 0x000000ff) / 255;
|
10594 |
+
return "rgba(" + r + ", " + g + ", " + b + ", " + a + ")";
|
10595 |
+
} // Problem: https://github.com/animatedjs/animated/pull/102
|
10596 |
+
// Solution: https://stackoverflow.com/questions/638565/parsing-scientific-notation-sensibly/658662
|
10597 |
|
|
|
|
|
|
|
|
|
10598 |
|
10599 |
+
var stringShapeRegex = /[+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?/g; // Covers rgb, rgba, hsl, hsla
|
10600 |
+
// Taken from https://gist.github.com/olmokramer/82ccce673f86db7cda5e
|
|
|
|
|
10601 |
|
10602 |
+
var colorRegex = /(#(?:[0-9a-f]{2}){2,4}|(#[0-9a-f]{3})|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))/gi; // Covers color names (transparent, blue, etc.)
|
|
|
|
|
|
|
10603 |
|
10604 |
+
var colorNamesRegex = new RegExp("(" + Object.keys(colors).join('|') + ")", 'g');
|
10605 |
/**
|
10606 |
+
* Supports string shapes by extracting numbers so new values can be computed,
|
10607 |
+
* and recombines those values into new strings of the same shape. Supports
|
10608 |
+
* things like:
|
10609 |
+
*
|
10610 |
+
* rgba(123, 42, 99, 0.36) // colors
|
10611 |
+
* -45deg // values with units
|
10612 |
+
* 0 2px 2px 0px rgba(0, 0, 0, 0.12) // box shadows
|
10613 |
*/
|
10614 |
|
10615 |
+
var createStringInterpolator = function createStringInterpolator(config) {
|
10616 |
+
// Replace colors with rgba
|
10617 |
+
var outputRange = config.output.map(function (rangeValue) {
|
10618 |
+
return rangeValue.replace(colorRegex, colorToRgba);
|
10619 |
+
}).map(function (rangeValue) {
|
10620 |
+
return rangeValue.replace(colorNamesRegex, colorToRgba);
|
10621 |
+
});
|
10622 |
+
var outputRanges = outputRange[0].match(stringShapeRegex).map(function () {
|
10623 |
+
return [];
|
10624 |
+
});
|
10625 |
+
outputRange.forEach(function (value) {
|
10626 |
+
value.match(stringShapeRegex).forEach(function (number, i) {
|
10627 |
+
return outputRanges[i].push(+number);
|
10628 |
+
});
|
10629 |
+
});
|
10630 |
+
var interpolations = outputRange[0].match(stringShapeRegex).map(function (_value, i) {
|
10631 |
+
return createInterpolator(_extends({}, config, {
|
10632 |
+
output: outputRanges[i]
|
10633 |
+
}));
|
10634 |
+
});
|
10635 |
+
return function (input) {
|
10636 |
+
var i = 0;
|
10637 |
+
return outputRange[0] // 'rgba(0, 100, 200, 0)'
|
10638 |
+
// ->
|
10639 |
+
// 'rgba(${interpolations[0](input)}, ${interpolations[1](input)}, ...'
|
10640 |
+
.replace(stringShapeRegex, function () {
|
10641 |
+
return interpolations[i++](input);
|
10642 |
+
}) // rgba requires that the r,g,b are integers.... so we want to round them, but we *dont* want to
|
10643 |
+
// round the opacity (4th column).
|
10644 |
+
.replace(/rgba\(([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+)\)/gi, function (_, p1, p2, p3, p4) {
|
10645 |
+
return "rgba(" + Math.round(p1) + ", " + Math.round(p2) + ", " + Math.round(p3) + ", " + p4 + ")";
|
10646 |
+
});
|
10647 |
+
};
|
10648 |
+
};
|
10649 |
|
10650 |
+
var isUnitlessNumber = {
|
10651 |
+
animationIterationCount: true,
|
10652 |
+
borderImageOutset: true,
|
10653 |
+
borderImageSlice: true,
|
10654 |
+
borderImageWidth: true,
|
10655 |
+
boxFlex: true,
|
10656 |
+
boxFlexGroup: true,
|
10657 |
+
boxOrdinalGroup: true,
|
10658 |
+
columnCount: true,
|
10659 |
+
columns: true,
|
10660 |
+
flex: true,
|
10661 |
+
flexGrow: true,
|
10662 |
+
flexPositive: true,
|
10663 |
+
flexShrink: true,
|
10664 |
+
flexNegative: true,
|
10665 |
+
flexOrder: true,
|
10666 |
+
gridRow: true,
|
10667 |
+
gridRowEnd: true,
|
10668 |
+
gridRowSpan: true,
|
10669 |
+
gridRowStart: true,
|
10670 |
+
gridColumn: true,
|
10671 |
+
gridColumnEnd: true,
|
10672 |
+
gridColumnSpan: true,
|
10673 |
+
gridColumnStart: true,
|
10674 |
+
fontWeight: true,
|
10675 |
+
lineClamp: true,
|
10676 |
+
lineHeight: true,
|
10677 |
+
opacity: true,
|
10678 |
+
order: true,
|
10679 |
+
orphans: true,
|
10680 |
+
tabSize: true,
|
10681 |
+
widows: true,
|
10682 |
+
zIndex: true,
|
10683 |
+
zoom: true,
|
10684 |
+
// SVG-related properties
|
10685 |
+
fillOpacity: true,
|
10686 |
+
floodOpacity: true,
|
10687 |
+
stopOpacity: true,
|
10688 |
+
strokeDasharray: true,
|
10689 |
+
strokeDashoffset: true,
|
10690 |
+
strokeMiterlimit: true,
|
10691 |
+
strokeOpacity: true,
|
10692 |
+
strokeWidth: true
|
10693 |
+
};
|
10694 |
|
10695 |
+
var prefixKey = function prefixKey(prefix, key) {
|
10696 |
+
return prefix + key.charAt(0).toUpperCase() + key.substring(1);
|
10697 |
+
};
|
|
|
10698 |
|
10699 |
+
var prefixes = ['Webkit', 'Ms', 'Moz', 'O'];
|
10700 |
+
isUnitlessNumber = Object.keys(isUnitlessNumber).reduce(function (acc, prop) {
|
10701 |
+
prefixes.forEach(function (prefix) {
|
10702 |
+
return acc[prefixKey(prefix, prop)] = acc[prop];
|
10703 |
+
});
|
10704 |
+
return acc;
|
10705 |
+
}, isUnitlessNumber);
|
10706 |
|
10707 |
+
function dangerousStyleValue(name, value, isCustomProperty) {
|
10708 |
+
if (value == null || typeof value === 'boolean' || value === '') return '';
|
10709 |
+
if (!isCustomProperty && typeof value === 'number' && value !== 0 && !(isUnitlessNumber.hasOwnProperty(name) && isUnitlessNumber[name])) return value + 'px'; // Presumes implicit 'px' suffix for unitless numbers
|
|
|
10710 |
|
10711 |
+
return ('' + value).trim();
|
10712 |
+
}
|
|
|
|
|
10713 |
|
10714 |
+
var attributeCache = {};
|
10715 |
+
injectCreateAnimatedStyle(function (style) {
|
10716 |
+
return new AnimatedStyle(style);
|
10717 |
+
});
|
10718 |
+
injectDefaultElement('div');
|
10719 |
+
injectStringInterpolator(createStringInterpolator);
|
10720 |
+
injectColorNames(colors);
|
10721 |
+
injectApplyAnimatedValues(function (instance, props) {
|
10722 |
+
if (instance.nodeType && instance.setAttribute !== undefined) {
|
10723 |
+
var style = props.style,
|
10724 |
+
children = props.children,
|
10725 |
+
scrollTop = props.scrollTop,
|
10726 |
+
scrollLeft = props.scrollLeft,
|
10727 |
+
attributes = _objectWithoutPropertiesLoose(props, ["style", "children", "scrollTop", "scrollLeft"]);
|
10728 |
|
10729 |
+
var filter = instance.nodeName === 'filter' || instance.parentNode && instance.parentNode.nodeName === 'filter';
|
10730 |
+
if (scrollTop !== void 0) instance.scrollTop = scrollTop;
|
10731 |
+
if (scrollLeft !== void 0) instance.scrollLeft = scrollLeft; // Set textContent, if children is an animatable value
|
|
|
10732 |
|
10733 |
+
if (children !== void 0) instance.textContent = children; // Set styles ...
|
|
|
|
|
|
|
10734 |
|
10735 |
+
for (var styleName in style) {
|
10736 |
+
if (!style.hasOwnProperty(styleName)) continue;
|
10737 |
+
var isCustomProperty = styleName.indexOf('--') === 0;
|
10738 |
+
var styleValue = dangerousStyleValue(styleName, style[styleName], isCustomProperty);
|
10739 |
+
if (styleName === 'float') styleName = 'cssFloat';
|
10740 |
+
if (isCustomProperty) instance.style.setProperty(styleName, styleValue);else instance.style[styleName] = styleValue;
|
10741 |
+
} // Set attributes ...
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10742 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10743 |
|
10744 |
+
for (var name in attributes) {
|
10745 |
+
// Attributes are written in dash case
|
10746 |
+
var dashCase = filter ? name : attributeCache[name] || (attributeCache[name] = name.replace(/([A-Z])/g, function (n) {
|
10747 |
+
return '-' + n.toLowerCase();
|
10748 |
+
}));
|
10749 |
+
if (typeof instance.getAttribute(dashCase) !== 'undefined') instance.setAttribute(dashCase, attributes[name]);
|
10750 |
+
}
|
10751 |
|
10752 |
+
return;
|
10753 |
+
} else return false;
|
10754 |
+
}, function (style) {
|
10755 |
+
return style;
|
10756 |
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10757 |
|
10758 |
+
var domElements = ['a', 'abbr', 'address', 'area', 'article', 'aside', 'audio', 'b', 'base', 'bdi', 'bdo', 'big', 'blockquote', 'body', 'br', 'button', 'canvas', 'caption', 'cite', 'code', 'col', 'colgroup', 'data', 'datalist', 'dd', 'del', 'details', 'dfn', 'dialog', 'div', 'dl', 'dt', 'em', 'embed', 'fieldset', 'figcaption', 'figure', 'footer', 'form', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'header', 'hgroup', 'hr', 'html', 'i', 'iframe', 'img', 'input', 'ins', 'kbd', 'keygen', 'label', 'legend', 'li', 'link', 'main', 'map', 'mark', 'menu', 'menuitem', 'meta', 'meter', 'nav', 'noscript', 'object', 'ol', 'optgroup', 'option', 'output', 'p', 'param', 'picture', 'pre', 'progress', 'q', 'rp', 'rt', 'ruby', 's', 'samp', 'script', 'section', 'select', 'small', 'source', 'span', 'strong', 'style', 'sub', 'summary', 'sup', 'table', 'tbody', 'td', 'textarea', 'tfoot', 'th', 'thead', 'time', 'title', 'tr', 'track', 'u', 'ul', 'var', 'video', 'wbr', // SVG
|
10759 |
+
'circle', 'clipPath', 'defs', 'ellipse', 'foreignObject', 'g', 'image', 'line', 'linearGradient', 'mask', 'path', 'pattern', 'polygon', 'polyline', 'radialGradient', 'rect', 'stop', 'svg', 'text', 'tspan'];
|
10760 |
+
// Extend animated with all the available THREE elements
|
10761 |
+
var apply = merge(createAnimatedComponent, false);
|
10762 |
+
var extendedAnimated = apply(domElements);
|
10763 |
|
10764 |
+
exports.apply = apply;
|
10765 |
+
exports.config = config;
|
10766 |
+
exports.update = update;
|
10767 |
+
exports.animated = extendedAnimated;
|
10768 |
+
exports.a = extendedAnimated;
|
10769 |
+
exports.interpolate = interpolate$1;
|
10770 |
+
exports.Globals = Globals;
|
10771 |
+
exports.useSpring = useSpring;
|
10772 |
+
exports.useTrail = useTrail;
|
10773 |
+
exports.useTransition = useTransition;
|
10774 |
+
exports.useChain = useChain;
|
10775 |
+
exports.useSprings = useSprings;
|
10776 |
|
|
|
10777 |
|
10778 |
+
/***/ }),
|
|
|
|
|
10779 |
|
10780 |
+
/***/ 264:
|
10781 |
+
/***/ (function(module, exports, __webpack_require__) {
|
10782 |
+
|
10783 |
+
var isarray = __webpack_require__(456)
|
10784 |
|
|
|
|
|
|
|
|
|
|
|
|
|
10785 |
/**
|
10786 |
+
* Expose `pathToRegexp`.
|
|
|
|
|
|
|
|
|
10787 |
*/
|
10788 |
+
module.exports = pathToRegexp
|
10789 |
+
module.exports.parse = parse
|
10790 |
+
module.exports.compile = compile
|
10791 |
+
module.exports.tokensToFunction = tokensToFunction
|
10792 |
+
module.exports.tokensToRegExp = tokensToRegExp
|
10793 |
|
10794 |
+
/**
|
10795 |
+
* The main path matching regexp utility.
|
10796 |
+
*
|
10797 |
+
* @type {RegExp}
|
10798 |
+
*/
|
10799 |
+
var PATH_REGEXP = new RegExp([
|
10800 |
+
// Match escaped characters that would otherwise appear in future matches.
|
10801 |
+
// This allows the user to escape special characters that won't transform.
|
10802 |
+
'(\\\\.)',
|
10803 |
+
// Match Express-style parameters and un-named parameters with a prefix
|
10804 |
+
// and optional suffixes. Matches appear as:
|
10805 |
+
//
|
10806 |
+
// "/:test(\\d+)?" => ["/", "test", "\d+", undefined, "?", undefined]
|
10807 |
+
// "/route(\\d+)" => [undefined, undefined, undefined, "\d+", undefined, undefined]
|
10808 |
+
// "/*" => ["/", undefined, undefined, undefined, undefined, "*"]
|
10809 |
+
'([\\/.])?(?:(?:\\:(\\w+)(?:\\(((?:\\\\.|[^\\\\()])+)\\))?|\\(((?:\\\\.|[^\\\\()])+)\\))([+*?])?|(\\*))'
|
10810 |
+
].join('|'), 'g')
|
10811 |
|
|
|
|
|
|
|
10812 |
/**
|
10813 |
+
* Parse a string for the raw tokens.
|
|
|
10814 |
*
|
10815 |
+
* @param {string} str
|
10816 |
+
* @param {Object=} options
|
10817 |
+
* @return {!Array}
|
10818 |
*/
|
10819 |
+
function parse (str, options) {
|
10820 |
+
var tokens = []
|
10821 |
+
var key = 0
|
10822 |
+
var index = 0
|
10823 |
+
var path = ''
|
10824 |
+
var defaultDelimiter = options && options.delimiter || '/'
|
10825 |
+
var res
|
10826 |
|
10827 |
+
while ((res = PATH_REGEXP.exec(str)) != null) {
|
10828 |
+
var m = res[0]
|
10829 |
+
var escaped = res[1]
|
10830 |
+
var offset = res.index
|
10831 |
+
path += str.slice(index, offset)
|
10832 |
+
index = offset + m.length
|
10833 |
|
10834 |
+
// Ignore already escaped sequences.
|
10835 |
+
if (escaped) {
|
10836 |
+
path += escaped[1]
|
10837 |
+
continue
|
10838 |
+
}
|
10839 |
|
10840 |
+
var next = str[index]
|
10841 |
+
var prefix = res[2]
|
10842 |
+
var name = res[3]
|
10843 |
+
var capture = res[4]
|
10844 |
+
var group = res[5]
|
10845 |
+
var modifier = res[6]
|
10846 |
+
var asterisk = res[7]
|
10847 |
+
|
10848 |
+
// Push the current path onto the tokens.
|
10849 |
+
if (path) {
|
10850 |
+
tokens.push(path)
|
10851 |
+
path = ''
|
10852 |
+
}
|
10853 |
+
|
10854 |
+
var partial = prefix != null && next != null && next !== prefix
|
10855 |
+
var repeat = modifier === '+' || modifier === '*'
|
10856 |
+
var optional = modifier === '?' || modifier === '*'
|
10857 |
+
var delimiter = res[2] || defaultDelimiter
|
10858 |
+
var pattern = capture || group
|
10859 |
+
|
10860 |
+
tokens.push({
|
10861 |
+
name: name || key++,
|
10862 |
+
prefix: prefix || '',
|
10863 |
+
delimiter: delimiter,
|
10864 |
+
optional: optional,
|
10865 |
+
repeat: repeat,
|
10866 |
+
partial: partial,
|
10867 |
+
asterisk: !!asterisk,
|
10868 |
+
pattern: pattern ? escapeGroup(pattern) : (asterisk ? '.*' : '[^' + escapeString(delimiter) + ']+?')
|
10869 |
+
})
|
10870 |
+
}
|
10871 |
+
|
10872 |
+
// Match any characters still remaining.
|
10873 |
+
if (index < str.length) {
|
10874 |
+
path += str.substr(index)
|
10875 |
+
}
|
10876 |
+
|
10877 |
+
// If the path exists, push it onto the end.
|
10878 |
+
if (path) {
|
10879 |
+
tokens.push(path)
|
10880 |
+
}
|
10881 |
+
|
10882 |
+
return tokens
|
10883 |
+
}
|
10884 |
|
|
|
|
|
|
|
|
|
|
|
|
|
10885 |
/**
|
10886 |
+
* Compile a string to a template function for the path.
|
|
|
|
|
|
|
10887 |
*
|
10888 |
+
* @param {string} str
|
10889 |
+
* @param {Object=} options
|
10890 |
+
* @return {!function(Object=, Object=)}
|
10891 |
*/
|
10892 |
+
function compile (str, options) {
|
10893 |
+
return tokensToFunction(parse(str, options), options)
|
|
|
|
|
|
|
10894 |
}
|
10895 |
+
|
10896 |
/**
|
10897 |
+
* Prettier encoding of URI path segments.
|
|
|
|
|
|
|
10898 |
*
|
10899 |
+
* @param {string}
|
10900 |
+
* @return {string}
|
10901 |
*/
|
10902 |
+
function encodeURIComponentPretty (str) {
|
10903 |
+
return encodeURI(str).replace(/[\/?#]/g, function (c) {
|
10904 |
+
return '%' + c.charCodeAt(0).toString(16).toUpperCase()
|
10905 |
+
})
|
10906 |
+
}
|
10907 |
|
10908 |
+
/**
|
10909 |
+
* Encode the asterisk parameter. Similar to `pretty`, but allows slashes.
|
10910 |
+
*
|
10911 |
+
* @param {string}
|
10912 |
+
* @return {string}
|
10913 |
+
*/
|
10914 |
+
function encodeAsterisk (str) {
|
10915 |
+
return encodeURI(str).replace(/[?#]/g, function (c) {
|
10916 |
+
return '%' + c.charCodeAt(0).toString(16).toUpperCase()
|
10917 |
+
})
|
10918 |
+
}
|
10919 |
|
10920 |
+
/**
|
10921 |
+
* Expose a method for transforming tokens into the path function.
|
10922 |
+
*/
|
10923 |
+
function tokensToFunction (tokens, options) {
|
10924 |
+
// Compile all the tokens into regexps.
|
10925 |
+
var matches = new Array(tokens.length)
|
10926 |
|
10927 |
+
// Compile all the patterns before compilation.
|
10928 |
+
for (var i = 0; i < tokens.length; i++) {
|
10929 |
+
if (typeof tokens[i] === 'object') {
|
10930 |
+
matches[i] = new RegExp('^(?:' + tokens[i].pattern + ')$', flags(options))
|
10931 |
}
|
10932 |
+
}
|
10933 |
|
10934 |
+
return function (obj, opts) {
|
10935 |
+
var path = ''
|
10936 |
+
var data = obj || {}
|
10937 |
+
var options = opts || {}
|
10938 |
+
var encode = options.pretty ? encodeURIComponentPretty : encodeURIComponent
|
10939 |
|
10940 |
+
for (var i = 0; i < tokens.length; i++) {
|
10941 |
+
var token = tokens[i]
|
|
|
|
|
10942 |
|
10943 |
+
if (typeof token === 'string') {
|
10944 |
+
path += token
|
10945 |
|
10946 |
+
continue
|
10947 |
+
}
|
10948 |
|
10949 |
+
var value = data[token.name]
|
10950 |
+
var segment
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10951 |
|
10952 |
+
if (value == null) {
|
10953 |
+
if (token.optional) {
|
10954 |
+
// Prepend partial segment prefixes.
|
10955 |
+
if (token.partial) {
|
10956 |
+
path += token.prefix
|
10957 |
+
}
|
10958 |
|
10959 |
+
continue
|
10960 |
+
} else {
|
10961 |
+
throw new TypeError('Expected "' + token.name + '" to be defined')
|
10962 |
+
}
|
10963 |
+
}
|
10964 |
|
10965 |
+
if (isarray(value)) {
|
10966 |
+
if (!token.repeat) {
|
10967 |
+
throw new TypeError('Expected "' + token.name + '" to not repeat, but received `' + JSON.stringify(value) + '`')
|
10968 |
+
}
|
10969 |
|
10970 |
+
if (value.length === 0) {
|
10971 |
+
if (token.optional) {
|
10972 |
+
continue
|
10973 |
+
} else {
|
10974 |
+
throw new TypeError('Expected "' + token.name + '" to not be empty')
|
10975 |
+
}
|
10976 |
+
}
|
10977 |
|
10978 |
+
for (var j = 0; j < value.length; j++) {
|
10979 |
+
segment = encode(value[j])
|
|
|
10980 |
|
10981 |
+
if (!matches[i].test(segment)) {
|
10982 |
+
throw new TypeError('Expected all "' + token.name + '" to match "' + token.pattern + '", but received `' + JSON.stringify(segment) + '`')
|
10983 |
+
}
|
10984 |
|
10985 |
+
path += (j === 0 ? token.prefix : token.delimiter) + segment
|
10986 |
+
}
|
10987 |
|
10988 |
+
continue
|
10989 |
+
}
|
10990 |
|
10991 |
+
segment = token.asterisk ? encodeAsterisk(value) : encode(value)
|
10992 |
|
10993 |
+
if (!matches[i].test(segment)) {
|
10994 |
+
throw new TypeError('Expected "' + token.name + '" to match "' + token.pattern + '", but received "' + segment + '"')
|
10995 |
+
}
|
10996 |
|
10997 |
+
path += token.prefix + segment
|
10998 |
+
}
|
10999 |
+
|
11000 |
+
return path
|
11001 |
+
}
|
11002 |
+
}
|
11003 |
|
|
|
|
|
|
|
11004 |
/**
|
11005 |
+
* Escape a regular expression string.
|
11006 |
*
|
11007 |
+
* @param {string} str
|
11008 |
+
* @return {string}
|
11009 |
*/
|
11010 |
+
function escapeString (str) {
|
11011 |
+
return str.replace(/([.+*?=^!:${}()[\]|\/\\])/g, '\\$1')
|
11012 |
+
}
|
11013 |
|
|
|
|
|
|
|
11014 |
/**
|
11015 |
+
* Escape the capturing group by escaping special characters and meaning.
|
11016 |
*
|
11017 |
+
* @param {string} group
|
11018 |
+
* @return {string}
|
11019 |
*/
|
11020 |
+
function escapeGroup (group) {
|
11021 |
+
return group.replace(/([=!:$\/()])/g, '\\$1')
|
11022 |
+
}
|
11023 |
|
|
|
|
|
|
|
11024 |
/**
|
11025 |
+
* Attach the keys as a property of the regexp.
|
11026 |
*
|
11027 |
+
* @param {!RegExp} re
|
11028 |
+
* @param {Array} keys
|
11029 |
+
* @return {!RegExp}
|
11030 |
*/
|
11031 |
+
function attachKeys (re, keys) {
|
11032 |
+
re.keys = keys
|
11033 |
+
return re
|
11034 |
+
}
|
11035 |
|
|
|
|
|
|
|
11036 |
/**
|
11037 |
+
* Get the flags for a regexp from the options.
|
11038 |
*
|
11039 |
+
* @param {Object} options
|
11040 |
+
* @return {string}
|
11041 |
*/
|
11042 |
+
function flags (options) {
|
11043 |
+
return options && options.sensitive ? '' : 'i'
|
11044 |
+
}
|
11045 |
|
|
|
|
|
|
|
11046 |
/**
|
11047 |
+
* Pull out keys from a regexp.
|
11048 |
*
|
11049 |
+
* @param {!RegExp} path
|
11050 |
+
* @param {!Array} keys
|
11051 |
+
* @return {!RegExp}
|
11052 |
*/
|
11053 |
+
function regexpToRegexp (path, keys) {
|
11054 |
+
// Use a negative lookahead to match only capturing groups.
|
11055 |
+
var groups = path.source.match(/\((?!\?)/g)
|
11056 |
+
|
11057 |
+
if (groups) {
|
11058 |
+
for (var i = 0; i < groups.length; i++) {
|
11059 |
+
keys.push({
|
11060 |
+
name: i,
|
11061 |
+
prefix: null,
|
11062 |
+
delimiter: null,
|
11063 |
+
optional: false,
|
11064 |
+
repeat: false,
|
11065 |
+
partial: false,
|
11066 |
+
asterisk: false,
|
11067 |
+
pattern: null
|
11068 |
+
})
|
11069 |
+
}
|
11070 |
+
}
|
11071 |
+
|
11072 |
+
return attachKeys(path, keys)
|
11073 |
+
}
|
11074 |
|
|
|
|
|
|
|
11075 |
/**
|
11076 |
+
* Transform an array into a regexp.
|
11077 |
*
|
11078 |
+
* @param {!Array} path
|
11079 |
+
* @param {Array} keys
|
11080 |
+
* @param {!Object} options
|
11081 |
+
* @return {!RegExp}
|
11082 |
*/
|
11083 |
+
function arrayToRegexp (path, keys, options) {
|
11084 |
+
var parts = []
|
11085 |
+
|
11086 |
+
for (var i = 0; i < path.length; i++) {
|
11087 |
+
parts.push(pathToRegexp(path[i], keys, options).source)
|
11088 |
+
}
|
11089 |
+
|
11090 |
+
var regexp = new RegExp('(?:' + parts.join('|') + ')', flags(options))
|
11091 |
+
|
11092 |
+
return attachKeys(regexp, keys)
|
11093 |
+
}
|
11094 |
|
|
|
|
|
|
|
11095 |
/**
|
11096 |
+
* Create a path regexp from string input.
|
11097 |
*
|
11098 |
+
* @param {string} path
|
11099 |
+
* @param {!Array} keys
|
11100 |
+
* @param {!Object} options
|
11101 |
+
* @return {!RegExp}
|
11102 |
*/
|
11103 |
+
function stringToRegexp (path, keys, options) {
|
11104 |
+
return tokensToRegExp(parse(path, options), keys, options)
|
11105 |
+
}
|
11106 |
|
|
|
|
|
|
|
11107 |
/**
|
11108 |
+
* Expose a function for taking tokens and returning a RegExp.
|
11109 |
*
|
11110 |
+
* @param {!Array} tokens
|
11111 |
+
* @param {(Array|Object)=} keys
|
11112 |
+
* @param {Object=} options
|
11113 |
+
* @return {!RegExp}
|
11114 |
*/
|
11115 |
+
function tokensToRegExp (tokens, keys, options) {
|
11116 |
+
if (!isarray(keys)) {
|
11117 |
+
options = /** @type {!Object} */ (keys || options)
|
11118 |
+
keys = []
|
11119 |
+
}
|
11120 |
+
|
11121 |
+
options = options || {}
|
11122 |
+
|
11123 |
+
var strict = options.strict
|
11124 |
+
var end = options.end !== false
|
11125 |
+
var route = ''
|
11126 |
+
|
11127 |
+
// Iterate over the tokens and create our regexp string.
|
11128 |
+
for (var i = 0; i < tokens.length; i++) {
|
11129 |
+
var token = tokens[i]
|
11130 |
+
|
11131 |
+
if (typeof token === 'string') {
|
11132 |
+
route += escapeString(token)
|
11133 |
+
} else {
|
11134 |
+
var prefix = escapeString(token.prefix)
|
11135 |
+
var capture = '(?:' + token.pattern + ')'
|
11136 |
+
|
11137 |
+
keys.push(token)
|
11138 |
+
|
11139 |
+
if (token.repeat) {
|
11140 |
+
capture += '(?:' + prefix + capture + ')*'
|
11141 |
+
}
|
11142 |
+
|
11143 |
+
if (token.optional) {
|
11144 |
+
if (!token.partial) {
|
11145 |
+
capture = '(?:' + prefix + '(' + capture + '))?'
|
11146 |
+
} else {
|
11147 |
+
capture = prefix + '(' + capture + ')?'
|
11148 |
+
}
|
11149 |
+
} else {
|
11150 |
+
capture = prefix + '(' + capture + ')'
|
11151 |
+
}
|
11152 |
+
|
11153 |
+
route += capture
|
11154 |
+
}
|
11155 |
+
}
|
11156 |
+
|
11157 |
+
var delimiter = escapeString(options.delimiter || '/')
|
11158 |
+
var endsWithDelimiter = route.slice(-delimiter.length) === delimiter
|
11159 |
+
|
11160 |
+
// In non-strict mode we allow a slash at the end of match. If the path to
|
11161 |
+
// match already ends with a slash, we remove it for consistency. The slash
|
11162 |
+
// is valid at the end of a path match, not in the middle. This is important
|
11163 |
+
// in non-ending mode, where "/test/" shouldn't match "/test//route".
|
11164 |
+
if (!strict) {
|
11165 |
+
route = (endsWithDelimiter ? route.slice(0, -delimiter.length) : route) + '(?:' + delimiter + '(?=$))?'
|
11166 |
+
}
|
11167 |
+
|
11168 |
+
if (end) {
|
11169 |
+
route += '$'
|
11170 |
+
} else {
|
11171 |
+
// In non-ending mode, we need the capturing groups to match as much as
|
11172 |
+
// possible by using a positive lookahead to the end or next path segment.
|
11173 |
+
route += strict && endsWithDelimiter ? '' : '(?=' + delimiter + '|$)'
|
11174 |
+
}
|
11175 |
+
|
11176 |
+
return attachKeys(new RegExp('^' + route, flags(options)), keys)
|
11177 |
+
}
|
11178 |
|
|
|
|
|
|
|
11179 |
/**
|
11180 |
+
* Normalize the given path string, returning a regular expression.
|
11181 |
*
|
11182 |
+
* An empty array can be passed in for the keys, which will hold the
|
11183 |
+
* placeholder key descriptions. For example, using `/user/:id`, `keys` will
|
11184 |
+
* contain `[{ name: 'id', delimiter: '/', optional: false, repeat: false }]`.
|
11185 |
*
|
11186 |
+
* @param {(string|RegExp|Array)} path
|
11187 |
+
* @param {(Array|Object)=} keys
|
11188 |
+
* @param {Object=} options
|
11189 |
+
* @return {!RegExp}
|
11190 |
*/
|
11191 |
+
function pathToRegexp (path, keys, options) {
|
11192 |
+
if (!isarray(keys)) {
|
11193 |
+
options = /** @type {!Object} */ (keys || options)
|
11194 |
+
keys = []
|
11195 |
+
}
|
11196 |
|
11197 |
+
options = options || {}
|
|
|
|
|
|
|
11198 |
|
11199 |
+
if (path instanceof RegExp) {
|
11200 |
+
return regexpToRegexp(path, /** @type {!Array} */ (keys))
|
11201 |
+
}
|
11202 |
+
|
11203 |
+
if (isarray(path)) {
|
11204 |
+
return arrayToRegexp(/** @type {!Array} */ (path), /** @type {!Array} */ (keys), options)
|
11205 |
+
}
|
|
|
|
|
11206 |
|
11207 |
+
return stringToRegexp(/** @type {string} */ (path), /** @type {!Array} */ (keys), options)
|
11208 |
+
}
|
11209 |
|
|
|
|
|
|
|
11210 |
|
11211 |
/***/ }),
|
11212 |
|
11213 |
+
/***/ 265:
|
11214 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
11215 |
|
11216 |
"use strict";
|
11217 |
+
/* WEBPACK VAR INJECTION */(function(global, module) {/* harmony import */ var _ponyfill_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(424);
|
11218 |
+
/* global window */
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11219 |
|
|
|
|
|
11220 |
|
11221 |
+
var root;
|
|
|
11222 |
|
11223 |
+
if (typeof self !== 'undefined') {
|
11224 |
+
root = self;
|
11225 |
+
} else if (typeof window !== 'undefined') {
|
11226 |
+
root = window;
|
11227 |
+
} else if (typeof global !== 'undefined') {
|
11228 |
+
root = global;
|
11229 |
+
} else if (true) {
|
11230 |
+
root = module;
|
11231 |
+
} else {}
|
11232 |
|
11233 |
+
var result = Object(_ponyfill_js__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])(root);
|
11234 |
+
/* harmony default export */ __webpack_exports__["a"] = (result);
|
11235 |
|
11236 |
+
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(60), __webpack_require__(457)(module)))
|
11237 |
|
11238 |
/***/ }),
|
11239 |
|
11240 |
+
/***/ 267:
|
11241 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
11242 |
|
11243 |
"use strict";
|
11244 |
+
/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(42);
|
11245 |
+
/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);
|
11246 |
+
/* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(41);
|
11247 |
+
/* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);
|
11248 |
+
/* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(43);
|
11249 |
+
/* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__);
|
11250 |
+
/* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(47);
|
11251 |
+
/* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__);
|
11252 |
+
/* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(28);
|
11253 |
+
/* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__);
|
11254 |
+
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(0);
|
11255 |
+
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_5__);
|
11256 |
+
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(3);
|
11257 |
+
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_6__);
|
11258 |
+
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(1);
|
11259 |
+
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_7__);
|
11260 |
+
/* harmony import */ var _woocommerce_components__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(55);
|
11261 |
+
/* harmony import */ var _woocommerce_components__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_woocommerce_components__WEBPACK_IMPORTED_MODULE_8__);
|
11262 |
+
/* harmony import */ var _woocommerce_wc_admin_settings__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(20);
|
11263 |
|
11264 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11265 |
|
|
|
11266 |
|
|
|
11267 |
|
|
|
11268 |
|
|
|
11269 |
|
11270 |
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default()(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default()(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default()(this, result); }; }
|
11271 |
|
11272 |
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
|
11273 |
|
11274 |
+
/**
|
11275 |
+
* External dependencies
|
11276 |
+
*/
|
11277 |
|
|
|
11278 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11279 |
|
11280 |
+
/**
|
11281 |
+
* WooCommerce dependencies
|
11282 |
+
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11283 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11284 |
|
|
|
|
|
|
|
|
|
|
|
|
|
11285 |
|
11286 |
+
/**
|
11287 |
+
* Component to render when there is an error in a report component due to data
|
11288 |
+
* not being loaded or being invalid.
|
11289 |
+
*/
|
|
|
|
|
11290 |
|
11291 |
+
var ReportError = /*#__PURE__*/function (_Component) {
|
11292 |
+
_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default()(ReportError, _Component);
|
|
|
11293 |
|
11294 |
+
var _super = _createSuper(ReportError);
|
|
|
|
|
|
|
|
|
11295 |
|
11296 |
+
function ReportError() {
|
11297 |
+
_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, ReportError);
|
11298 |
|
11299 |
+
return _super.apply(this, arguments);
|
11300 |
+
}
|
|
|
|
|
11301 |
|
11302 |
+
_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(ReportError, [{
|
11303 |
+
key: "render",
|
11304 |
+
value: function render() {
|
11305 |
+
var _this$props = this.props,
|
11306 |
+
className = _this$props.className,
|
11307 |
+
isError = _this$props.isError,
|
11308 |
+
isEmpty = _this$props.isEmpty;
|
11309 |
+
var title, actionLabel, actionURL, actionCallback;
|
11310 |
|
11311 |
+
if (isError) {
|
11312 |
+
title = Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_6__["__"])('There was an error getting your stats. Please try again.', 'woocommerce-admin');
|
11313 |
+
actionLabel = Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_6__["__"])('Reload', 'woocommerce-admin');
|
11314 |
|
11315 |
+
actionCallback = function actionCallback() {
|
11316 |
+
// @todo Add tracking for how often an error is displayed, and the reload action is clicked.
|
11317 |
+
window.location.reload();
|
11318 |
+
};
|
11319 |
+
} else if (isEmpty) {
|
11320 |
+
title = Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_6__["__"])('No results could be found for this date range.', 'woocommerce-admin');
|
11321 |
+
actionLabel = Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_6__["__"])('View Orders', 'woocommerce-admin');
|
11322 |
+
actionURL = Object(_woocommerce_wc_admin_settings__WEBPACK_IMPORTED_MODULE_9__[/* getAdminLink */ "f"])('edit.php?post_type=shop_order');
|
11323 |
+
}
|
11324 |
|
11325 |
+
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_5__["createElement"])(_woocommerce_components__WEBPACK_IMPORTED_MODULE_8__["EmptyContent"], {
|
11326 |
+
className: className,
|
11327 |
+
title: title,
|
11328 |
+
actionLabel: actionLabel,
|
11329 |
+
actionURL: actionURL,
|
11330 |
+
actionCallback: actionCallback
|
11331 |
+
});
|
11332 |
+
}
|
11333 |
+
}]);
|
11334 |
|
11335 |
+
return ReportError;
|
11336 |
+
}(_wordpress_element__WEBPACK_IMPORTED_MODULE_5__["Component"]);
|
11337 |
|
11338 |
+
ReportError.propTypes = {
|
11339 |
+
/**
|
11340 |
+
* Additional class name to style the component.
|
11341 |
+
*/
|
11342 |
+
className: prop_types__WEBPACK_IMPORTED_MODULE_7___default.a.string,
|
11343 |
|
11344 |
+
/**
|
11345 |
+
* Boolean representing whether there was an error.
|
11346 |
+
*/
|
11347 |
+
isError: prop_types__WEBPACK_IMPORTED_MODULE_7___default.a.bool,
|
|
|
|
|
11348 |
|
11349 |
+
/**
|
11350 |
+
* Boolean representing whether the issue is that there is no data.
|
11351 |
+
*/
|
11352 |
+
isEmpty: prop_types__WEBPACK_IMPORTED_MODULE_7___default.a.bool
|
11353 |
};
|
11354 |
+
ReportError.defaultProps = {
|
11355 |
+
className: ''
|
11356 |
+
};
|
11357 |
+
/* harmony default export */ __webpack_exports__["a"] = (ReportError);
|
11358 |
|
11359 |
/***/ }),
|
11360 |
|
11361 |
+
/***/ 268:
|
11362 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
11363 |
|
11364 |
+
"use strict";
|
11365 |
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return getCountryCode; });
|
11366 |
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return getCurrencyRegion; });
|
11367 |
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return getProductIdsForCart; });
|
11368 |
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return getPriceValue; });
|
11369 |
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return isOnboardingEnabled; });
|
11370 |
+
/* harmony import */ var _wordpress_html_entities__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(70);
|
11371 |
+
/* harmony import */ var _wordpress_html_entities__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_html_entities__WEBPACK_IMPORTED_MODULE_0__);
|
11372 |
+
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(2);
|
11373 |
+
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_1__);
|
11374 |
+
/* harmony import */ var _woocommerce_wc_admin_settings__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(20);
|
11375 |
+
/**
|
11376 |
+
* External dependencies
|
11377 |
+
*/
|
11378 |
|
|
|
|
|
|
|
|
|
|
|
11379 |
|
11380 |
+
/**
|
11381 |
+
* Internal dependencies
|
11382 |
+
*/
|
11383 |
|
|
|
11384 |
|
11385 |
+
/**
|
11386 |
+
* Gets the country code from a country:state value string.
|
11387 |
+
*
|
11388 |
+
* @param {string} countryState Country state string, e.g. US:GA.
|
11389 |
+
* @return {string} Country string.
|
11390 |
+
*/
|
11391 |
|
11392 |
+
function getCountryCode(countryState) {
|
11393 |
+
if (!countryState) {
|
11394 |
+
return null;
|
11395 |
}
|
|
|
11396 |
|
11397 |
+
return countryState.split(':')[0];
|
11398 |
+
}
|
11399 |
+
function getCurrencyRegion(countryState) {
|
11400 |
+
var region = getCountryCode(countryState);
|
11401 |
+
var euCountries = Object(lodash__WEBPACK_IMPORTED_MODULE_1__["without"])(Object(_woocommerce_wc_admin_settings__WEBPACK_IMPORTED_MODULE_2__[/* getSetting */ "g"])('onboarding', {
|
11402 |
+
euCountries: []
|
11403 |
+
}).euCountries, 'GB');
|
11404 |
|
11405 |
+
if (euCountries.includes(region)) {
|
11406 |
+
region = 'EU';
|
11407 |
+
}
|
11408 |
|
11409 |
+
return region;
|
11410 |
+
}
|
11411 |
+
/**
|
11412 |
+
* Gets the product IDs for items based on the product types and theme selected in the onboarding profiler.
|
11413 |
+
*
|
11414 |
+
* @param {Object} profileItems Onboarding profile.
|
11415 |
+
* @param {boolean} includeInstalledItems Include installed items in returned product IDs.
|
11416 |
+
* @param {Array} installedPlugins Installed plugins.
|
11417 |
+
* @return {Array} Product Ids.
|
11418 |
+
*/
|
11419 |
|
11420 |
+
function getProductIdsForCart(profileItems) {
|
11421 |
+
var includeInstalledItems = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
11422 |
+
var installedPlugins = arguments.length > 2 ? arguments[2] : undefined;
|
11423 |
+
var onboarding = Object(_woocommerce_wc_admin_settings__WEBPACK_IMPORTED_MODULE_2__[/* getSetting */ "g"])('onboarding', {});
|
11424 |
+
var productIds = []; // The population of onboarding.productTypes only happens if the task list should be shown
|
11425 |
+
// so bail early if it isn't present.
|
11426 |
|
11427 |
+
if (!onboarding.productTypes) {
|
11428 |
+
return productIds;
|
|
|
11429 |
}
|
11430 |
|
11431 |
+
var productTypes = profileItems.product_types || [];
|
11432 |
+
productTypes.forEach(function (productType) {
|
11433 |
+
if (onboarding.productTypes[productType] && onboarding.productTypes[productType].product && (includeInstalledItems || !installedPlugins.includes(onboarding.productTypes[productType].slug))) {
|
11434 |
+
productIds.push(onboarding.productTypes[productType].product);
|
|
|
11435 |
}
|
11436 |
});
|
11437 |
+
var theme = onboarding.themes.find(function (themeData) {
|
11438 |
+
return themeData.slug === profileItems.theme;
|
11439 |
+
});
|
|
|
|
|
|
|
11440 |
|
11441 |
+
if (theme && theme.id && getPriceValue(theme.price) > 0 && (includeInstalledItems || !theme.is_installed)) {
|
11442 |
+
productIds.push(theme.id);
|
11443 |
+
}
|
11444 |
|
11445 |
+
return productIds;
|
|
|
|
|
|
|
|
|
|
|
|
|
11446 |
}
|
11447 |
+
/**
|
11448 |
+
* Get the value of a price from a string, removing any non-numeric characters.
|
11449 |
+
*
|
11450 |
+
* @param {string} string Price string.
|
11451 |
+
* @return {number} Number value.
|
11452 |
+
*/
|
11453 |
|
11454 |
+
function getPriceValue(string) {
|
11455 |
+
return Number(Object(_wordpress_html_entities__WEBPACK_IMPORTED_MODULE_0__["decodeEntities"])(string).replace(/[^0-9.-]+/g, ''));
|
11456 |
+
}
|
11457 |
+
/**
|
11458 |
+
* Returns if the onboarding feature of WooCommerce Admin should be enabled.
|
11459 |
+
*
|
11460 |
+
* While we preform an a/b test of onboarding, the feature will be enabled within the plugin build,
|
11461 |
+
* but only if the user recieved the test/opted in.
|
11462 |
+
*
|
11463 |
+
* @return {boolean} True if the onboarding is enabled.
|
11464 |
+
*/
|
11465 |
|
11466 |
+
function isOnboardingEnabled() {
|
11467 |
+
if (!window.wcAdminFeatures.onboarding) {
|
11468 |
+
return false;
|
|
|
|
|
|
|
|
|
|
|
11469 |
}
|
11470 |
|
11471 |
+
return Object(_woocommerce_wc_admin_settings__WEBPACK_IMPORTED_MODULE_2__[/* getSetting */ "g"])('onboardingEnabled', false);
|
11472 |
}
|
11473 |
|
11474 |
/***/ }),
|
11475 |
|
11476 |
+
/***/ 275:
|
11477 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
11478 |
|
11479 |
"use strict";
|
11480 |
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return getUrlParams; });
|
11481 |
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return getScreenName; });
|
11482 |
+
/**
|
11483 |
+
* Get the URL params.
|
11484 |
+
*
|
11485 |
+
* @param {string} locationSearch - Querystring part of a URL, including the question mark (?).
|
11486 |
+
* @return {Object} - URL params.
|
11487 |
+
*/
|
11488 |
+
function getUrlParams(locationSearch) {
|
11489 |
+
if (locationSearch) {
|
11490 |
+
return locationSearch.substr(1).split('&').reduce(function (params, query) {
|
11491 |
+
var chunks = query.split('=');
|
11492 |
+
var key = chunks[0];
|
11493 |
+
var value = decodeURIComponent(chunks[1]);
|
11494 |
+
value = isNaN(Number(value)) ? value : Number(value);
|
11495 |
+
return params[key] = value, params;
|
11496 |
+
}, {});
|
11497 |
+
}
|
11498 |
|
11499 |
+
return {};
|
11500 |
+
}
|
11501 |
+
/**
|
11502 |
+
* Get the current screen name.
|
11503 |
+
*
|
11504 |
+
* @return {string} - Screen name.
|
11505 |
+
*/
|
11506 |
|
11507 |
+
function getScreenName() {
|
11508 |
+
var screenName = '';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11509 |
|
11510 |
+
var _getUrlParams = getUrlParams(window.location.search),
|
11511 |
+
page = _getUrlParams.page,
|
11512 |
+
path = _getUrlParams.path,
|
11513 |
+
postType = _getUrlParams.post_type;
|
11514 |
|
11515 |
+
if (page) {
|
11516 |
+
var currentPage = page === 'wc-admin' ? 'home_screen' : page;
|
11517 |
+
screenName = path ? path.replace(/\//g, '_').substring(1) : currentPage;
|
11518 |
+
} else if (postType) {
|
11519 |
+
screenName = postType;
|
11520 |
+
}
|
11521 |
|
11522 |
+
return screenName;
|
11523 |
+
}
|
11524 |
|
11525 |
+
/***/ }),
|
|
|
|
|
11526 |
|
11527 |
+
/***/ 276:
|
11528 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11529 |
|
11530 |
+
"use strict";
|
11531 |
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return getUnreadNotesCount; });
|
11532 |
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return hasValidNotes; });
|
11533 |
+
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2);
|
11534 |
+
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_0__);
|
11535 |
+
/**
|
11536 |
+
* External dependencies
|
11537 |
+
*/
|
11538 |
|
11539 |
+
/**
|
11540 |
+
* Get the count of the unread notes from the received list.
|
11541 |
+
*
|
11542 |
+
* @param {Array} notes - List of notes, contains read and unread notes.
|
11543 |
+
* @param {number} lastRead - The timestamp that the user read a note.
|
11544 |
+
* @return {number} - Unread notes count.
|
11545 |
+
*/
|
|
|
|
|
11546 |
|
11547 |
+
function getUnreadNotesCount(notes, lastRead) {
|
11548 |
+
var unreadNotes = Object(lodash__WEBPACK_IMPORTED_MODULE_0__["filter"])(notes, function (note) {
|
11549 |
+
var isDeleted = note.is_deleted,
|
11550 |
+
dateCreatedGmt = note.date_created_gmt,
|
11551 |
+
status = note.status;
|
11552 |
|
11553 |
+
if (!isDeleted) {
|
11554 |
+
var unread = !lastRead || !dateCreatedGmt || new Date(dateCreatedGmt + 'Z').getTime() > lastRead;
|
11555 |
+
return unread && status === 'unactioned';
|
11556 |
+
}
|
11557 |
+
});
|
11558 |
+
return unreadNotes.length;
|
11559 |
+
}
|
11560 |
+
/**
|
11561 |
+
* Verifies if there are any valid notes in the list.
|
11562 |
+
*
|
11563 |
+
* @param {Array} notes - List of notes, contains read and unread notes.
|
11564 |
+
* @return {boolean} - Whether there are valid notes or not.
|
11565 |
+
*/
|
11566 |
|
11567 |
+
function hasValidNotes(notes) {
|
11568 |
+
var validNotes = Object(lodash__WEBPACK_IMPORTED_MODULE_0__["filter"])(notes, function (note) {
|
11569 |
+
var isDeleted = note.is_deleted;
|
11570 |
+
return !isDeleted;
|
11571 |
+
});
|
11572 |
+
return validNotes.length > 0;
|
11573 |
+
}
|
11574 |
|
11575 |
/***/ }),
|
11576 |
|
11577 |
+
/***/ 279:
|
11578 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
11579 |
|
11580 |
"use strict";
|
|
|
|
|
|
|
|
|
11581 |
|
11582 |
+
// EXPORTS
|
11583 |
+
__webpack_require__.d(__webpack_exports__, "a", function() { return /* binding */ DEFAULT_ACTIONABLE_STATUSES; });
|
11584 |
+
__webpack_require__.d(__webpack_exports__, "b", function() { return /* binding */ config; });
|
11585 |
|
11586 |
+
// UNUSED EXPORTS: DEFAULT_ORDER_STATUSES, DEFAULT_DATE_RANGE
|
|
|
11587 |
|
11588 |
+
// EXTERNAL MODULE: external {"this":["wp","element"]}
|
11589 |
+
var external_this_wp_element_ = __webpack_require__(0);
|
11590 |
|
11591 |
+
// EXTERNAL MODULE: external {"this":["wp","i18n"]}
|
11592 |
+
var external_this_wp_i18n_ = __webpack_require__(3);
|
11593 |
|
11594 |
+
// EXTERNAL MODULE: external {"this":["wp","hooks"]}
|
11595 |
+
var external_this_wp_hooks_ = __webpack_require__(44);
|
11596 |
|
11597 |
+
// EXTERNAL MODULE: ./node_modules/interpolate-components/lib/index.js
|
11598 |
+
var lib = __webpack_require__(36);
|
11599 |
+
var lib_default = /*#__PURE__*/__webpack_require__.n(lib);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11600 |
|
11601 |
+
// EXTERNAL MODULE: ./client/settings/index.js
|
11602 |
+
var settings = __webpack_require__(20);
|
11603 |
|
11604 |
+
// EXTERNAL MODULE: ./node_modules/qs/lib/index.js
|
11605 |
+
var qs_lib = __webpack_require__(67);
|
|
|
11606 |
|
11607 |
+
// EXTERNAL MODULE: ./client/lib/date.js
|
11608 |
+
var date = __webpack_require__(111);
|
11609 |
|
11610 |
+
// EXTERNAL MODULE: external {"this":["wc","components"]}
|
11611 |
+
var external_this_wc_components_ = __webpack_require__(55);
|
|
|
11612 |
|
11613 |
+
// EXTERNAL MODULE: external {"this":["wc","data"]}
|
11614 |
+
var external_this_wc_data_ = __webpack_require__(48);
|
11615 |
|
11616 |
+
// CONCATENATED MODULE: ./client/analytics/settings/default-date.js
|
11617 |
|
11618 |
|
11619 |
+
/**
|
11620 |
+
* External dependencies
|
11621 |
+
*/
|
11622 |
|
11623 |
/**
|
11624 |
* Internal dependencies
|
11625 |
*/
|
11626 |
|
11627 |
|
|
|
|
|
|
|
11628 |
/**
|
11629 |
+
* WooCommerce dependencies
|
|
|
|
|
|
|
|
|
11630 |
*/
|
11631 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11632 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11633 |
|
|
|
|
|
|
|
11634 |
|
11635 |
+
var default_date_DefaultDate = function DefaultDate(_ref) {
|
11636 |
+
var value = _ref.value,
|
11637 |
+
onChange = _ref.onChange;
|
11638 |
|
11639 |
+
var _useSettings = Object(external_this_wc_data_["useSettings"])('wc_admin', ['wcAdminSettings']),
|
11640 |
+
wcAdminSettings = _useSettings.wcAdminSettings;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11641 |
|
11642 |
+
var defaultDateRange = wcAdminSettings.woocommerce_default_date_range;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11643 |
|
11644 |
+
var change = function change(query) {
|
11645 |
+
onChange({
|
11646 |
+
target: {
|
11647 |
+
name: 'woocommerce_default_date_range',
|
11648 |
+
value: Object(qs_lib["stringify"])(query)
|
11649 |
+
}
|
11650 |
+
});
|
11651 |
+
};
|
11652 |
|
11653 |
+
var query = Object(qs_lib["parse"])(value.replace(/&/g, '&'));
|
11654 |
|
11655 |
+
var _getDateParamsFromQue = Object(date["h" /* getDateParamsFromQuery */])(query, defaultDateRange),
|
11656 |
+
period = _getDateParamsFromQue.period,
|
11657 |
+
compare = _getDateParamsFromQue.compare,
|
11658 |
+
before = _getDateParamsFromQue.before,
|
11659 |
+
after = _getDateParamsFromQue.after;
|
11660 |
|
11661 |
+
var _getCurrentDates = Object(date["f" /* getCurrentDates */])(query, defaultDateRange),
|
11662 |
+
primaryDate = _getCurrentDates.primary,
|
11663 |
+
secondaryDate = _getCurrentDates.secondary;
|
11664 |
|
11665 |
+
var dateQuery = {
|
11666 |
+
period: period,
|
11667 |
+
compare: compare,
|
11668 |
+
before: before,
|
11669 |
+
after: after,
|
11670 |
+
primaryDate: primaryDate,
|
11671 |
+
secondaryDate: secondaryDate
|
11672 |
+
};
|
11673 |
+
return Object(external_this_wp_element_["createElement"])(external_this_wc_components_["DateRangeFilterPicker"], {
|
11674 |
+
query: query,
|
11675 |
+
onRangeSelect: change,
|
11676 |
+
dateQuery: dateQuery,
|
11677 |
+
isoDateFormat: date["k" /* isoDateFormat */]
|
11678 |
+
});
|
11679 |
+
};
|
11680 |
|
11681 |
+
/* harmony default export */ var default_date = (default_date_DefaultDate);
|
11682 |
+
// CONCATENATED MODULE: ./client/analytics/settings/config.js
|
11683 |
|
|
|
11684 |
|
11685 |
+
/**
|
11686 |
+
* External dependencies
|
11687 |
+
*/
|
11688 |
|
|
|
11689 |
|
|
|
11690 |
|
|
|
|
|
11691 |
|
|
|
|
|
|
|
|
|
|
|
11692 |
/**
|
11693 |
+
* Internal dependencies
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11694 |
*/
|
11695 |
|
11696 |
|
11697 |
+
var SETTINGS_FILTER = 'woocommerce_admin_analytics_settings';
|
11698 |
+
var DEFAULT_ACTIONABLE_STATUSES = ['processing', 'on-hold'];
|
11699 |
+
var DEFAULT_ORDER_STATUSES = ['completed', 'processing', 'refunded', 'cancelled', 'failed', 'pending', 'on-hold'];
|
11700 |
+
var DEFAULT_DATE_RANGE = 'period=month&compare=previous_year';
|
11701 |
+
var filteredOrderStatuses = Object.keys(settings["d" /* ORDER_STATUSES */]).filter(function (status) {
|
11702 |
+
return status !== 'refunded';
|
11703 |
+
}).map(function (key) {
|
11704 |
+
return {
|
11705 |
+
value: key,
|
11706 |
+
label: settings["d" /* ORDER_STATUSES */][key],
|
11707 |
+
description: Object(external_this_wp_i18n_["sprintf"])(Object(external_this_wp_i18n_["__"])('Exclude the %s status from reports', 'woocommerce-admin'), settings["d" /* ORDER_STATUSES */][key])
|
11708 |
+
};
|
11709 |
+
});
|
11710 |
+
var unregisteredOrderStatuses = Object(settings["g" /* getSetting */])('unregisteredOrderStatuses', {});
|
11711 |
+
var orderStatusOptions = [{
|
11712 |
+
key: 'defaultStatuses',
|
11713 |
+
options: filteredOrderStatuses.filter(function (status) {
|
11714 |
+
return DEFAULT_ORDER_STATUSES.includes(status.value);
|
11715 |
+
})
|
11716 |
+
}, {
|
11717 |
+
key: 'customStatuses',
|
11718 |
+
label: Object(external_this_wp_i18n_["__"])('Custom Statuses', 'woocommerce-admin'),
|
11719 |
+
options: filteredOrderStatuses.filter(function (status) {
|
11720 |
+
return !DEFAULT_ORDER_STATUSES.includes(status.value);
|
11721 |
+
})
|
11722 |
+
}, {
|
11723 |
+
key: 'unregisteredStatuses',
|
11724 |
+
label: Object(external_this_wp_i18n_["__"])('Unregistered Statuses', 'woocommerce-admin'),
|
11725 |
+
options: Object.keys(unregisteredOrderStatuses).map(function (key) {
|
11726 |
+
return {
|
11727 |
+
value: key,
|
11728 |
+
label: key,
|
11729 |
+
description: Object(external_this_wp_i18n_["sprintf"])(Object(external_this_wp_i18n_["__"])('Exclude the %s status from reports', 'woocommerce-admin'), key)
|
11730 |
+
};
|
11731 |
+
})
|
11732 |
+
}];
|
11733 |
+
var config = Object(external_this_wp_hooks_["applyFilters"])(SETTINGS_FILTER, {
|
11734 |
+
woocommerce_excluded_report_order_statuses: {
|
11735 |
+
label: Object(external_this_wp_i18n_["__"])('Excluded Statuses:', 'woocommerce-admin'),
|
11736 |
+
inputType: 'checkboxGroup',
|
11737 |
+
options: orderStatusOptions,
|
11738 |
+
helpText: lib_default()({
|
11739 |
+
mixedString: Object(external_this_wp_i18n_["__"])('Orders with these statuses are excluded from the totals in your reports. ' + 'The {{strong}}Refunded{{/strong}} status can not be excluded.', 'woocommerce-admin'),
|
11740 |
+
components: {
|
11741 |
+
strong: Object(external_this_wp_element_["createElement"])("strong", null)
|
11742 |
+
}
|
11743 |
+
}),
|
11744 |
+
defaultValue: ['pending', 'cancelled', 'failed']
|
11745 |
+
},
|
11746 |
+
woocommerce_actionable_order_statuses: {
|
11747 |
+
label: Object(external_this_wp_i18n_["__"])('Actionable Statuses:', 'woocommerce-admin'),
|
11748 |
+
inputType: 'checkboxGroup',
|
11749 |
+
options: orderStatusOptions,
|
11750 |
+
helpText: Object(external_this_wp_i18n_["__"])('Orders with these statuses require action on behalf of the store admin.' + 'These orders will show up in the Orders tab under the activity panel.', 'woocommerce-admin'),
|
11751 |
+
defaultValue: DEFAULT_ACTIONABLE_STATUSES
|
11752 |
+
},
|
11753 |
+
woocommerce_default_date_range: {
|
11754 |
+
name: 'woocommerce_default_date_range',
|
11755 |
+
label: Object(external_this_wp_i18n_["__"])('Default Date Range:', 'woocommerce-admin'),
|
11756 |
+
inputType: 'component',
|
11757 |
+
component: default_date,
|
11758 |
+
helpText: Object(external_this_wp_i18n_["__"])('Select a default date range. When no range is selected, reports will be viewed by ' + 'the default date range.', 'woocommerce-admin'),
|
11759 |
+
defaultValue: DEFAULT_DATE_RANGE
|
11760 |
+
}
|
11761 |
+
});
|
11762 |
|
11763 |
+
/***/ }),
|
11764 |
|
11765 |
+
/***/ 28:
|
11766 |
+
/***/ (function(module, exports) {
|
|
|
11767 |
|
11768 |
+
function _getPrototypeOf(o) {
|
11769 |
+
module.exports = _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
|
11770 |
+
return o.__proto__ || Object.getPrototypeOf(o);
|
11771 |
+
};
|
11772 |
+
return _getPrototypeOf(o);
|
11773 |
}
|
|
|
|
|
11774 |
|
11775 |
+
module.exports = _getPrototypeOf;
|
11776 |
|
11777 |
+
/***/ }),
|
|
|
11778 |
|
11779 |
+
/***/ 282:
|
11780 |
+
/***/ (function(module, exports) {
|
11781 |
|
11782 |
+
function _objectWithoutPropertiesLoose(source, excluded) {
|
11783 |
+
if (source == null) return {};
|
11784 |
+
var target = {};
|
11785 |
+
var sourceKeys = Object.keys(source);
|
11786 |
+
var key, i;
|
11787 |
|
11788 |
+
for (i = 0; i < sourceKeys.length; i++) {
|
11789 |
+
key = sourceKeys[i];
|
11790 |
+
if (excluded.indexOf(key) >= 0) continue;
|
11791 |
+
target[key] = source[key];
|
11792 |
+
}
|
11793 |
|
11794 |
+
return target;
|
11795 |
+
}
|
|
|
11796 |
|
11797 |
+
module.exports = _objectWithoutPropertiesLoose;
|
11798 |
|
11799 |
/***/ }),
|
11800 |
|
11801 |
+
/***/ 283:
|
11802 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
11803 |
|
11804 |
"use strict";
|
11805 |
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return getLeaderboard; });
|
11806 |
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return searchItemsByString; });
|
11807 |
+
/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(17);
|
11808 |
+
/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__);
|
11809 |
+
/* harmony import */ var lib_date__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(111);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11810 |
|
11811 |
|
11812 |
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
11813 |
|
11814 |
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
11815 |
|
11816 |
/**
|
11817 |
* External dependencies
|
11818 |
*/
|
11819 |
|
|
|
11820 |
/**
|
11821 |
* WooCommerce dependencies
|
11822 |
*/
|
11823 |
|
|
|
11824 |
/**
|
11825 |
+
* Returns leaderboard data to render a leaderboard table.
|
11826 |
+
*
|
11827 |
+
* @param {Object} options arguments
|
11828 |
+
* @param {string} options.id Leaderboard ID
|
11829 |
+
* @param {number} options.per_page Per page limit
|
11830 |
+
* @param {Object} options.persisted_query Persisted query passed to endpoint
|
11831 |
+
* @param {Object} options.query Query parameters in the url
|
11832 |
+
* @param {Object} options.select Instance of @wordpress/select
|
11833 |
+
* @param {string} options.defaultDateRange User specified default date range.
|
11834 |
+
* @return {Object} Object containing leaderboard responses.
|
11835 |
*/
|
11836 |
|
11837 |
+
function getLeaderboard(options) {
|
11838 |
+
var endpoint = 'leaderboards';
|
11839 |
+
var perPage = options.per_page,
|
11840 |
+
persistedQuery = options.persisted_query,
|
11841 |
+
query = options.query,
|
11842 |
+
select = options.select,
|
11843 |
+
filterQuery = options.filterQuery;
|
11844 |
+
|
11845 |
+
var _select = select('wc-api'),
|
11846 |
+
getItems = _select.getItems,
|
11847 |
+
getItemsError = _select.getItemsError,
|
11848 |
+
isGetItemsRequesting = _select.isGetItemsRequesting;
|
11849 |
|
11850 |
+
var response = {
|
11851 |
+
isRequesting: false,
|
11852 |
+
isError: false,
|
11853 |
+
rows: []
|
11854 |
+
};
|
11855 |
+
var datesFromQuery = Object(lib_date__WEBPACK_IMPORTED_MODULE_1__[/* getCurrentDates */ "f"])(query, options.defaultDateRange);
|
11856 |
|
11857 |
+
var leaderboardQuery = _objectSpread(_objectSpread({}, filterQuery), {}, {
|
11858 |
+
after: Object(lib_date__WEBPACK_IMPORTED_MODULE_1__[/* appendTimestamp */ "a"])(datesFromQuery.primary.after, 'start'),
|
11859 |
+
before: Object(lib_date__WEBPACK_IMPORTED_MODULE_1__[/* appendTimestamp */ "a"])(datesFromQuery.primary.before, 'end'),
|
11860 |
+
per_page: perPage,
|
11861 |
+
persisted_query: JSON.stringify(persistedQuery)
|
11862 |
+
}); // Disable eslint rule requiring `getItems` to be defined below because the next two statements
|
11863 |
+
// depend on `getItems` to have been called.
|
11864 |
+
// eslint-disable-next-line @wordpress/no-unused-vars-before-return
|
11865 |
|
|
|
11866 |
|
11867 |
+
var leaderboards = getItems(endpoint, leaderboardQuery);
|
|
|
11868 |
|
11869 |
+
if (isGetItemsRequesting(endpoint, leaderboardQuery)) {
|
11870 |
+
return _objectSpread(_objectSpread({}, response), {}, {
|
11871 |
+
isRequesting: true
|
11872 |
+
});
|
11873 |
+
} else if (getItemsError(endpoint, leaderboardQuery)) {
|
11874 |
+
return _objectSpread(_objectSpread({}, response), {}, {
|
11875 |
+
isError: true
|
11876 |
+
});
|
11877 |
}
|
11878 |
|
11879 |
+
var leaderboard = leaderboards.get(options.id);
|
11880 |
+
return _objectSpread(_objectSpread({}, response), {}, {
|
11881 |
+
rows: leaderboard.rows
|
11882 |
+
});
|
11883 |
+
}
|
11884 |
+
/**
|
11885 |
+
* Returns items based on a search query.
|
11886 |
+
*
|
11887 |
+
* @param {Object} select Instance of @wordpress/select
|
11888 |
+
* @param {string} endpoint Report API Endpoint
|
11889 |
+
* @param {string[]} search Array of search strings.
|
11890 |
+
* @return {Object} Object containing API request information and the matching items.
|
11891 |
+
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11892 |
|
11893 |
+
function searchItemsByString(select, endpoint, search) {
|
11894 |
+
var _select2 = select('wc-api'),
|
11895 |
+
getItems = _select2.getItems,
|
11896 |
+
getItemsError = _select2.getItemsError,
|
11897 |
+
isGetItemsRequesting = _select2.isGetItemsRequesting;
|
|
|
|
|
|
|
|
|
|
|
11898 |
|
11899 |
+
var items = {};
|
11900 |
+
var isRequesting = false;
|
11901 |
+
var isError = false;
|
11902 |
+
search.forEach(function (searchWord) {
|
11903 |
+
var query = {
|
11904 |
+
search: searchWord,
|
11905 |
+
per_page: 10
|
11906 |
+
};
|
11907 |
+
var newItems = getItems(endpoint, query);
|
11908 |
+
newItems.forEach(function (item, id) {
|
11909 |
+
items[id] = item;
|
11910 |
+
});
|
11911 |
+
|
11912 |
+
if (isGetItemsRequesting(endpoint, query)) {
|
11913 |
+
isRequesting = true;
|
11914 |
+
}
|
11915 |
|
11916 |
+
if (getItemsError(endpoint, query)) {
|
11917 |
+
isError = true;
|
11918 |
+
}
|
11919 |
+
});
|
11920 |
return {
|
11921 |
+
items: items,
|
11922 |
+
isRequesting: isRequesting,
|
11923 |
+
isError: isError
|
11924 |
};
|
11925 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11926 |
|
11927 |
/***/ }),
|
11928 |
|
11929 |
+
/***/ 284:
|
11930 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
11931 |
|
11932 |
"use strict";
|
11933 |
+
/* harmony import */ var _babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6);
|
11934 |
+
/* harmony import */ var _babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(14);
|
11935 |
+
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(0);
|
11936 |
+
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__);
|
11937 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11938 |
|
|
|
|
|
11939 |
|
11940 |
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
|
|
11941 |
|
11942 |
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { Object(_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
|
11943 |
|
11944 |
+
/**
|
11945 |
+
* WordPress dependencies
|
11946 |
+
*/
|
11947 |
+
// Disable reason: JSDoc linter doesn't seem to parse the union (`&`) correctly.
|
11948 |
|
11949 |
+
/* eslint-disable jsdoc/valid-types */
|
11950 |
|
11951 |
+
/** @typedef {{icon: JSX.Element, size?: number} & import('react').ComponentPropsWithoutRef<'SVG'>} IconProps */
|
11952 |
|
11953 |
+
/* eslint-enable jsdoc/valid-types */
|
11954 |
|
11955 |
+
/**
|
11956 |
+
* Return an SVG icon.
|
11957 |
+
*
|
11958 |
+
* @param {IconProps} props icon is the SVG component to render
|
11959 |
+
* size is a number specifiying the icon size in pixels
|
11960 |
+
* Other props will be passed to wrapped SVG component
|
11961 |
+
*
|
11962 |
+
* @return {JSX.Element} Icon component
|
11963 |
+
*/
|
11964 |
|
11965 |
+
function Icon(_ref) {
|
11966 |
+
var icon = _ref.icon,
|
11967 |
+
_ref$size = _ref.size,
|
11968 |
+
size = _ref$size === void 0 ? 24 : _ref$size,
|
11969 |
+
props = Object(_babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"])(_ref, ["icon", "size"]);
|
11970 |
+
|
11971 |
+
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["cloneElement"])(icon, _objectSpread({
|
11972 |
+
width: size,
|
11973 |
+
height: size
|
11974 |
+
}, props));
|
11975 |
+
}
|
11976 |
|
11977 |
+
/* harmony default export */ __webpack_exports__["a"] = (Icon);
|
11978 |
+
//# sourceMappingURL=index.js.map
|
11979 |
|
11980 |
+
/***/ }),
|
11981 |
|
11982 |
+
/***/ 285:
|
11983 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
11984 |
|
11985 |
+
"use strict";
|
11986 |
+
/* unused harmony export __DO_NOT_USE__ActionTypes */
|
11987 |
+
/* unused harmony export applyMiddleware */
|
11988 |
+
/* unused harmony export bindActionCreators */
|
11989 |
+
/* unused harmony export combineReducers */
|
11990 |
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return compose; });
|
11991 |
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return createStore; });
|
11992 |
+
/* harmony import */ var symbol_observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(265);
|
11993 |
|
11994 |
|
11995 |
+
/**
|
11996 |
+
* These are private action types reserved by Redux.
|
11997 |
+
* For any unknown actions, you must return the current state.
|
11998 |
+
* If the current state is undefined, you must return the initial state.
|
11999 |
+
* Do not reference these action types directly in your code.
|
12000 |
+
*/
|
12001 |
+
var randomString = function randomString() {
|
12002 |
+
return Math.random().toString(36).substring(7).split('').join('.');
|
12003 |
+
};
|
12004 |
|
12005 |
+
var ActionTypes = {
|
12006 |
+
INIT: "@@redux/INIT" + randomString(),
|
12007 |
+
REPLACE: "@@redux/REPLACE" + randomString(),
|
12008 |
+
PROBE_UNKNOWN_ACTION: function PROBE_UNKNOWN_ACTION() {
|
12009 |
+
return "@@redux/PROBE_UNKNOWN_ACTION" + randomString();
|
12010 |
+
}
|
12011 |
+
};
|
12012 |
|
12013 |
/**
|
12014 |
+
* @param {any} obj The object to inspect.
|
12015 |
+
* @returns {boolean} True if the argument appears to be a plain object.
|
12016 |
*/
|
12017 |
+
function isPlainObject(obj) {
|
12018 |
+
if (typeof obj !== 'object' || obj === null) return false;
|
12019 |
+
var proto = obj;
|
12020 |
+
|
12021 |
+
while (Object.getPrototypeOf(proto) !== null) {
|
12022 |
+
proto = Object.getPrototypeOf(proto);
|
12023 |
+
}
|
12024 |
+
|
12025 |
+
return Object.getPrototypeOf(obj) === proto;
|
12026 |
+
}
|
12027 |
|
12028 |
/**
|
12029 |
+
* Creates a Redux store that holds the state tree.
|
12030 |
+
* The only way to change the data in the store is to call `dispatch()` on it.
|
12031 |
+
*
|
12032 |
+
* There should only be a single store in your app. To specify how different
|
12033 |
+
* parts of the state tree respond to actions, you may combine several reducers
|
12034 |
+
* into a single reducer function by using `combineReducers`.
|
12035 |
+
*
|
12036 |
+
* @param {Function} reducer A function that returns the next state tree, given
|
12037 |
+
* the current state tree and the action to handle.
|
12038 |
+
*
|
12039 |
+
* @param {any} [preloadedState] The initial state. You may optionally specify it
|
12040 |
+
* to hydrate the state from the server in universal apps, or to restore a
|
12041 |
+
* previously serialized user session.
|
12042 |
+
* If you use `combineReducers` to produce the root reducer function, this must be
|
12043 |
+
* an object with the same shape as `combineReducers` keys.
|
12044 |
+
*
|
12045 |
+
* @param {Function} [enhancer] The store enhancer. You may optionally specify it
|
12046 |
+
* to enhance the store with third-party capabilities such as middleware,
|
12047 |
+
* time travel, persistence, etc. The only store enhancer that ships with Redux
|
12048 |
+
* is `applyMiddleware()`.
|
12049 |
+
*
|
12050 |
+
* @returns {Store} A Redux store that lets you read the state, dispatch actions
|
12051 |
+
* and subscribe to changes.
|
12052 |
*/
|
12053 |
|
12054 |
+
function createStore(reducer, preloadedState, enhancer) {
|
12055 |
+
var _ref2;
|
12056 |
|
12057 |
+
if (typeof preloadedState === 'function' && typeof enhancer === 'function' || typeof enhancer === 'function' && typeof arguments[3] === 'function') {
|
12058 |
+
throw new Error('It looks like you are passing several store enhancers to ' + 'createStore(). This is not supported. Instead, compose them ' + 'together to a single function.');
|
12059 |
+
}
|
12060 |
|
12061 |
+
if (typeof preloadedState === 'function' && typeof enhancer === 'undefined') {
|
12062 |
+
enhancer = preloadedState;
|
12063 |
+
preloadedState = undefined;
|
12064 |
+
}
|
12065 |
|
12066 |
+
if (typeof enhancer !== 'undefined') {
|
12067 |
+
if (typeof enhancer !== 'function') {
|
12068 |
+
throw new Error('Expected the enhancer to be a function.');
|
12069 |
+
}
|
12070 |
|
12071 |
+
return enhancer(createStore)(reducer, preloadedState);
|
|
|
|
|
|
|
12072 |
}
|
12073 |
|
12074 |
+
if (typeof reducer !== 'function') {
|
12075 |
+
throw new Error('Expected the reducer to be a function.');
|
12076 |
+
}
|
12077 |
|
12078 |
+
var currentReducer = reducer;
|
12079 |
+
var currentState = preloadedState;
|
12080 |
+
var currentListeners = [];
|
12081 |
+
var nextListeners = currentListeners;
|
12082 |
+
var isDispatching = false;
|
12083 |
+
/**
|
12084 |
+
* This makes a shallow copy of currentListeners so we can use
|
12085 |
+
* nextListeners as a temporary list while dispatching.
|
12086 |
+
*
|
12087 |
+
* This prevents any bugs around consumers calling
|
12088 |
+
* subscribe/unsubscribe in the middle of a dispatch.
|
12089 |
+
*/
|
12090 |
|
12091 |
+
function ensureCanMutateNextListeners() {
|
12092 |
+
if (nextListeners === currentListeners) {
|
12093 |
+
nextListeners = currentListeners.slice();
|
12094 |
+
}
|
12095 |
+
}
|
12096 |
+
/**
|
12097 |
+
* Reads the state tree managed by the store.
|
12098 |
+
*
|
12099 |
+
* @returns {any} The current state tree of your application.
|
12100 |
+
*/
|
12101 |
|
|
|
|
|
12102 |
|
12103 |
+
function getState() {
|
12104 |
+
if (isDispatching) {
|
12105 |
+
throw new Error('You may not call store.getState() while the reducer is executing. ' + 'The reducer has already received the state as an argument. ' + 'Pass it down from the top reducer instead of reading it from the store.');
|
12106 |
+
}
|
12107 |
|
12108 |
+
return currentState;
|
|
|
|
|
|
|
|
|
|
|
12109 |
}
|
12110 |
+
/**
|
12111 |
+
* Adds a change listener. It will be called any time an action is dispatched,
|
12112 |
+
* and some part of the state tree may potentially have changed. You may then
|
12113 |
+
* call `getState()` to read the current state tree inside the callback.
|
12114 |
+
*
|
12115 |
+
* You may call `dispatch()` from a change listener, with the following
|
12116 |
+
* caveats:
|
12117 |
+
*
|
12118 |
+
* 1. The subscriptions are snapshotted just before every `dispatch()` call.
|
12119 |
+
* If you subscribe or unsubscribe while the listeners are being invoked, this
|
12120 |
+
* will not have any effect on the `dispatch()` that is currently in progress.
|
12121 |
+
* However, the next `dispatch()` call, whether nested or not, will use a more
|
12122 |
+
* recent snapshot of the subscription list.
|
12123 |
+
*
|
12124 |
+
* 2. The listener should not expect to see all state changes, as the state
|
12125 |
+
* might have been updated multiple times during a nested `dispatch()` before
|
12126 |
+
* the listener is called. It is, however, guaranteed that all subscribers
|
12127 |
+
* registered before the `dispatch()` started will be called with the latest
|
12128 |
+
* state by the time it exits.
|
12129 |
+
*
|
12130 |
+
* @param {Function} listener A callback to be invoked on every dispatch.
|
12131 |
+
* @returns {Function} A function to remove this change listener.
|
12132 |
+
*/
|
12133 |
|
12134 |
+
|
12135 |
+
function subscribe(listener) {
|
12136 |
+
if (typeof listener !== 'function') {
|
12137 |
+
throw new Error('Expected the listener to be a function.');
|
|
|
|
|
|
|
|
|
|
|
|
|
12138 |
}
|
12139 |
+
|
12140 |
+
if (isDispatching) {
|
12141 |
+
throw new Error('You may not call store.subscribe() while the reducer is executing. ' + 'If you would like to be notified after the store has been updated, subscribe from a ' + 'component and invoke store.getState() in the callback to access the latest state. ' + 'See https://redux.js.org/api-reference/store#subscribelistener for more details.');
|
|
|
|
|
12142 |
}
|
|
|
|
|
|
|
|
|
|
|
12143 |
|
12144 |
+
var isSubscribed = true;
|
12145 |
+
ensureCanMutateNextListeners();
|
12146 |
+
nextListeners.push(listener);
|
12147 |
+
return function unsubscribe() {
|
12148 |
+
if (!isSubscribed) {
|
12149 |
+
return;
|
12150 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12151 |
|
12152 |
+
if (isDispatching) {
|
12153 |
+
throw new Error('You may not unsubscribe from a store listener while the reducer is executing. ' + 'See https://redux.js.org/api-reference/store#subscribelistener for more details.');
|
|
|
|
|
|
|
|
|
12154 |
}
|
12155 |
|
12156 |
+
isSubscribed = false;
|
12157 |
+
ensureCanMutateNextListeners();
|
12158 |
+
var index = nextListeners.indexOf(listener);
|
12159 |
+
nextListeners.splice(index, 1);
|
12160 |
+
currentListeners = null;
|
12161 |
+
};
|
12162 |
+
}
|
12163 |
+
/**
|
12164 |
+
* Dispatches an action. It is the only way to trigger a state change.
|
12165 |
+
*
|
12166 |
+
* The `reducer` function, used to create the store, will be called with the
|
12167 |
+
* current state tree and the given `action`. Its return value will
|
12168 |
+
* be considered the **next** state of the tree, and the change listeners
|
12169 |
+
* will be notified.
|
12170 |
+
*
|
12171 |
+
* The base implementation only supports plain object actions. If you want to
|
12172 |
+
* dispatch a Promise, an Observable, a thunk, or something else, you need to
|
12173 |
+
* wrap your store creating function into the corresponding middleware. For
|
12174 |
+
* example, see the documentation for the `redux-thunk` package. Even the
|
12175 |
+
* middleware will eventually dispatch plain object actions using this method.
|
12176 |
+
*
|
12177 |
+
* @param {Object} action A plain object representing “what changed”. It is
|
12178 |
+
* a good idea to keep actions serializable so you can record and replay user
|
12179 |
+
* sessions, or use the time travelling `redux-devtools`. An action must have
|
12180 |
+
* a `type` property which may not be `undefined`. It is a good idea to use
|
12181 |
+
* string constants for action types.
|
12182 |
+
*
|
12183 |
+
* @returns {Object} For convenience, the same action object you dispatched.
|
12184 |
+
*
|
12185 |
+
* Note that, if you use a custom middleware, it may wrap `dispatch()` to
|
12186 |
+
* return something else (for example, a Promise you can await).
|
12187 |
+
*/
|
12188 |
|
12189 |
+
|
12190 |
+
function dispatch(action) {
|
12191 |
+
if (!isPlainObject(action)) {
|
12192 |
+
throw new Error('Actions must be plain objects. ' + 'Use custom middleware for async actions.');
|
12193 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
12194 |
|
12195 |
+
if (typeof action.type === 'undefined') {
|
12196 |
+
throw new Error('Actions may not have an undefined "type" property. ' + 'Have you misspelled a constant?');
|
12197 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
12198 |
|
12199 |
+
if (isDispatching) {
|
12200 |
+
throw new Error('Reducers may not dispatch actions.');
|
12201 |
+
}
|
|
|
12202 |
|
12203 |
+
try {
|
12204 |
+
isDispatching = true;
|
12205 |
+
currentState = currentReducer(currentState, action);
|
12206 |
+
} finally {
|
12207 |
+
isDispatching = false;
|
12208 |
+
}
|
12209 |
|
12210 |
+
var listeners = currentListeners = nextListeners;
|
|
|
|
|
12211 |
|
12212 |
+
for (var i = 0; i < listeners.length; i++) {
|
12213 |
+
var listener = listeners[i];
|
12214 |
+
listener();
|
12215 |
+
}
|
12216 |
|
12217 |
+
return action;
|
12218 |
+
}
|
12219 |
+
/**
|
12220 |
+
* Replaces the reducer currently used by the store to calculate the state.
|
12221 |
+
*
|
12222 |
+
* You might need this if your app implements code splitting and you want to
|
12223 |
+
* load some of the reducers dynamically. You might also need this if you
|
12224 |
+
* implement a hot reloading mechanism for Redux.
|
12225 |
+
*
|
12226 |
+
* @param {Function} nextReducer The reducer for the store to use instead.
|
12227 |
+
* @returns {void}
|
12228 |
+
*/
|
12229 |
|
|
|
|
|
|
|
12230 |
|
12231 |
+
function replaceReducer(nextReducer) {
|
12232 |
+
if (typeof nextReducer !== 'function') {
|
12233 |
+
throw new Error('Expected the nextReducer to be a function.');
|
|
|
12234 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
12235 |
|
12236 |
+
currentReducer = nextReducer; // This action has a similiar effect to ActionTypes.INIT.
|
12237 |
+
// Any reducers that existed in both the new and old rootReducer
|
12238 |
+
// will receive the previous state. This effectively populates
|
12239 |
+
// the new state tree with any relevant data from the old one.
|
|
|
12240 |
|
12241 |
+
dispatch({
|
12242 |
+
type: ActionTypes.REPLACE
|
12243 |
+
});
|
12244 |
+
}
|
12245 |
+
/**
|
12246 |
+
* Interoperability point for observable/reactive libraries.
|
12247 |
+
* @returns {observable} A minimal observable of state changes.
|
12248 |
+
* For more information, see the observable proposal:
|
12249 |
+
* https://github.com/tc39/proposal-observable
|
12250 |
+
*/
|
12251 |
|
|
|
|
|
|
|
|
|
|
|
12252 |
|
12253 |
+
function observable() {
|
12254 |
+
var _ref;
|
12255 |
+
|
12256 |
+
var outerSubscribe = subscribe;
|
12257 |
+
return _ref = {
|
12258 |
+
/**
|
12259 |
+
* The minimal observable subscription method.
|
12260 |
+
* @param {Object} observer Any object that can be used as an observer.
|
12261 |
+
* The observer object should have a `next` method.
|
12262 |
+
* @returns {subscription} An object with an `unsubscribe` method that can
|
12263 |
+
* be used to unsubscribe the observable from the store, and prevent further
|
12264 |
+
* emission of values from the observable.
|
12265 |
+
*/
|
12266 |
+
subscribe: function subscribe(observer) {
|
12267 |
+
if (typeof observer !== 'object' || observer === null) {
|
12268 |
+
throw new TypeError('Expected the observer to be an object.');
|
12269 |
+
}
|
12270 |
|
12271 |
+
function observeState() {
|
12272 |
+
if (observer.next) {
|
12273 |
+
observer.next(getState());
|
12274 |
+
}
|
12275 |
+
}
|
12276 |
|
12277 |
+
observeState();
|
12278 |
+
var unsubscribe = outerSubscribe(observeState);
|
12279 |
+
return {
|
12280 |
+
unsubscribe: unsubscribe
|
12281 |
+
};
|
12282 |
+
}
|
12283 |
+
}, _ref[symbol_observable__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"]] = function () {
|
12284 |
+
return this;
|
12285 |
+
}, _ref;
|
12286 |
+
} // When a store is created, an "INIT" action is dispatched so that every
|
12287 |
+
// reducer returns their initial state. This effectively populates
|
12288 |
+
// the initial state tree.
|
12289 |
|
12290 |
|
12291 |
+
dispatch({
|
12292 |
+
type: ActionTypes.INIT
|
12293 |
+
});
|
12294 |
+
return _ref2 = {
|
12295 |
+
dispatch: dispatch,
|
12296 |
+
subscribe: subscribe,
|
12297 |
+
getState: getState,
|
12298 |
+
replaceReducer: replaceReducer
|
12299 |
+
}, _ref2[symbol_observable__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"]] = observable, _ref2;
|
12300 |
+
}
|
12301 |
|
12302 |
/**
|
12303 |
+
* Prints a warning in the console if it exists.
|
12304 |
+
*
|
12305 |
+
* @param {String} message The warning message.
|
12306 |
+
* @returns {void}
|
12307 |
*/
|
12308 |
+
function warning(message) {
|
12309 |
+
/* eslint-disable no-console */
|
12310 |
+
if (typeof console !== 'undefined' && typeof console.error === 'function') {
|
12311 |
+
console.error(message);
|
12312 |
+
}
|
12313 |
+
/* eslint-enable no-console */
|
12314 |
|
12315 |
|
12316 |
+
try {
|
12317 |
+
// This error was thrown as a convenience so that if you enable
|
12318 |
+
// "break on all exceptions" in your console,
|
12319 |
+
// it would pause the execution at this line.
|
12320 |
+
throw new Error(message);
|
12321 |
+
} catch (e) {} // eslint-disable-line no-empty
|
12322 |
|
12323 |
+
}
|
|
|
|
|
12324 |
|
12325 |
+
function getUndefinedStateErrorMessage(key, action) {
|
12326 |
+
var actionType = action && action.type;
|
12327 |
+
var actionDescription = actionType && "action \"" + String(actionType) + "\"" || 'an action';
|
12328 |
+
return "Given " + actionDescription + ", reducer \"" + key + "\" returned undefined. " + "To ignore an action, you must explicitly return the previous state. " + "If you want this reducer to hold no value, you can return null instead of undefined.";
|
12329 |
+
}
|
12330 |
|
12331 |
+
function getUnexpectedStateShapeWarningMessage(inputState, reducers, action, unexpectedKeyCache) {
|
12332 |
+
var reducerKeys = Object.keys(reducers);
|
12333 |
+
var argumentName = action && action.type === ActionTypes.INIT ? 'preloadedState argument passed to createStore' : 'previous state received by the reducer';
|
|
|
|
|
|
|
12334 |
|
12335 |
+
if (reducerKeys.length === 0) {
|
12336 |
+
return 'Store does not have a valid reducer. Make sure the argument passed ' + 'to combineReducers is an object whose values are reducers.';
|
12337 |
+
}
|
|
|
12338 |
|
12339 |
+
if (!isPlainObject(inputState)) {
|
12340 |
+
return "The " + argumentName + " has unexpected type of \"" + {}.toString.call(inputState).match(/\s([a-z|A-Z]+)/)[1] + "\". Expected argument to be an object with the following " + ("keys: \"" + reducerKeys.join('", "') + "\"");
|
12341 |
+
}
|
|
|
12342 |
|
12343 |
+
var unexpectedKeys = Object.keys(inputState).filter(function (key) {
|
12344 |
+
return !reducers.hasOwnProperty(key) && !unexpectedKeyCache[key];
|
12345 |
+
});
|
12346 |
+
unexpectedKeys.forEach(function (key) {
|
12347 |
+
unexpectedKeyCache[key] = true;
|
12348 |
+
});
|
12349 |
+
if (action && action.type === ActionTypes.REPLACE) return;
|
12350 |
|
12351 |
+
if (unexpectedKeys.length > 0) {
|
12352 |
+
return "Unexpected " + (unexpectedKeys.length > 1 ? 'keys' : 'key') + " " + ("\"" + unexpectedKeys.join('", "') + "\" found in " + argumentName + ". ") + "Expected to find one of the known reducer keys instead: " + ("\"" + reducerKeys.join('", "') + "\". Unexpected keys will be ignored.");
|
12353 |
+
}
|
12354 |
+
}
|
12355 |
+
|
12356 |
+
function assertReducerShape(reducers) {
|
12357 |
+
Object.keys(reducers).forEach(function (key) {
|
12358 |
+
var reducer = reducers[key];
|
12359 |
+
var initialState = reducer(undefined, {
|
12360 |
+
type: ActionTypes.INIT
|
12361 |
+
});
|
12362 |
+
|
12363 |
+
if (typeof initialState === 'undefined') {
|
12364 |
+
throw new Error("Reducer \"" + key + "\" returned undefined during initialization. " + "If the state passed to the reducer is undefined, you must " + "explicitly return the initial state. The initial state may " + "not be undefined. If you don't want to set a value for this reducer, " + "you can use null instead of undefined.");
|
12365 |
}
|
|
|
12366 |
|
12367 |
+
if (typeof reducer(undefined, {
|
12368 |
+
type: ActionTypes.PROBE_UNKNOWN_ACTION()
|
12369 |
+
}) === 'undefined') {
|
12370 |
+
throw new Error("Reducer \"" + key + "\" returned undefined when probed with a random type. " + ("Don't try to handle " + ActionTypes.INIT + " or other actions in \"redux/*\" ") + "namespace. They are considered private. Instead, you must return the " + "current state for any unknown actions, unless it is undefined, " + "in which case you must return the initial state, regardless of the " + "action type. The initial state may not be undefined, but can be null.");
|
12371 |
+
}
|
12372 |
+
});
|
|
|
|
|
12373 |
}
|
12374 |
+
/**
|
12375 |
+
* Turns an object whose values are different reducer functions, into a single
|
12376 |
+
* reducer function. It will call every child reducer, and gather their results
|
12377 |
+
* into a single state object, whose keys correspond to the keys of the passed
|
12378 |
+
* reducer functions.
|
12379 |
+
*
|
12380 |
+
* @param {Object} reducers An object whose values correspond to different
|
12381 |
+
* reducer functions that need to be combined into one. One handy way to obtain
|
12382 |
+
* it is to use ES6 `import * as reducers` syntax. The reducers may never return
|
12383 |
+
* undefined for any action. Instead, they should return their initial state
|
12384 |
+
* if the state passed to them was undefined, and the current state for any
|
12385 |
+
* unrecognized action.
|
12386 |
+
*
|
12387 |
+
* @returns {Function} A reducer function that invokes every reducer inside the
|
12388 |
+
* passed object, and builds a state object with the same shape.
|
12389 |
+
*/
|
12390 |
|
|
|
12391 |
|
12392 |
+
function combineReducers(reducers) {
|
12393 |
+
var reducerKeys = Object.keys(reducers);
|
12394 |
+
var finalReducers = {};
|
12395 |
+
|
12396 |
+
for (var i = 0; i < reducerKeys.length; i++) {
|
12397 |
+
var key = reducerKeys[i];
|
12398 |
+
|
12399 |
+
if (false) {}
|
12400 |
|
12401 |
+
if (typeof reducers[key] === 'function') {
|
12402 |
+
finalReducers[key] = reducers[key];
|
12403 |
+
}
|
12404 |
+
}
|
12405 |
|
12406 |
+
var finalReducerKeys = Object.keys(finalReducers); // This is used to make sure we don't warn about the same
|
12407 |
+
// keys multiple times.
|
12408 |
|
12409 |
+
var unexpectedKeyCache;
|
|
|
|
|
|
|
12410 |
|
12411 |
+
if (false) {}
|
|
|
12412 |
|
12413 |
+
var shapeAssertionError;
|
12414 |
|
12415 |
+
try {
|
12416 |
+
assertReducerShape(finalReducers);
|
12417 |
+
} catch (e) {
|
12418 |
+
shapeAssertionError = e;
|
12419 |
+
}
|
12420 |
|
12421 |
+
return function combination(state, action) {
|
12422 |
+
if (state === void 0) {
|
12423 |
+
state = {};
|
12424 |
+
}
|
12425 |
|
12426 |
+
if (shapeAssertionError) {
|
12427 |
+
throw shapeAssertionError;
|
12428 |
+
}
|
12429 |
|
12430 |
+
if (false) { var warningMessage; }
|
12431 |
|
12432 |
+
var hasChanged = false;
|
12433 |
+
var nextState = {};
|
12434 |
|
12435 |
+
for (var _i = 0; _i < finalReducerKeys.length; _i++) {
|
12436 |
+
var _key = finalReducerKeys[_i];
|
12437 |
+
var reducer = finalReducers[_key];
|
12438 |
+
var previousStateForKey = state[_key];
|
12439 |
+
var nextStateForKey = reducer(previousStateForKey, action);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12440 |
|
12441 |
+
if (typeof nextStateForKey === 'undefined') {
|
12442 |
+
var errorMessage = getUndefinedStateErrorMessage(_key, action);
|
12443 |
+
throw new Error(errorMessage);
|
12444 |
+
}
|
12445 |
|
12446 |
+
nextState[_key] = nextStateForKey;
|
12447 |
+
hasChanged = hasChanged || nextStateForKey !== previousStateForKey;
|
12448 |
+
}
|
12449 |
|
12450 |
+
hasChanged = hasChanged || finalReducerKeys.length !== Object.keys(state).length;
|
12451 |
+
return hasChanged ? nextState : state;
|
12452 |
+
};
|
12453 |
+
}
|
12454 |
|
12455 |
+
function bindActionCreator(actionCreator, dispatch) {
|
12456 |
+
return function () {
|
12457 |
+
return dispatch(actionCreator.apply(this, arguments));
|
12458 |
+
};
|
12459 |
+
}
|
12460 |
/**
|
12461 |
+
* Turns an object whose values are action creators, into an object with the
|
12462 |
+
* same keys, but with every function wrapped into a `dispatch` call so they
|
12463 |
+
* may be invoked directly. This is just a convenience method, as you can call
|
12464 |
+
* `store.dispatch(MyActionCreators.doSomething())` yourself just fine.
|
12465 |
+
*
|
12466 |
+
* For convenience, you can also pass an action creator as the first argument,
|
12467 |
+
* and get a dispatch wrapped function in return.
|
12468 |
+
*
|
12469 |
+
* @param {Function|Object} actionCreators An object whose values are action
|
12470 |
+
* creator functions. One handy way to obtain it is to use ES6 `import * as`
|
12471 |
+
* syntax. You may also pass a single function.
|
12472 |
+
*
|
12473 |
+
* @param {Function} dispatch The `dispatch` function available on your Redux
|
12474 |
+
* store.
|
12475 |
+
*
|
12476 |
+
* @returns {Function|Object} The object mimicking the original object, but with
|
12477 |
+
* every action creator wrapped into the `dispatch` call. If you passed a
|
12478 |
+
* function as `actionCreators`, the return value will also be a single
|
12479 |
+
* function.
|
12480 |
*/
|
12481 |
|
12482 |
|
12483 |
+
function bindActionCreators(actionCreators, dispatch) {
|
12484 |
+
if (typeof actionCreators === 'function') {
|
12485 |
+
return bindActionCreator(actionCreators, dispatch);
|
12486 |
+
}
|
12487 |
|
12488 |
+
if (typeof actionCreators !== 'object' || actionCreators === null) {
|
12489 |
+
throw new Error("bindActionCreators expected an object or a function, instead received " + (actionCreators === null ? 'null' : typeof actionCreators) + ". " + "Did you write \"import ActionCreators from\" instead of \"import * as ActionCreators from\"?");
|
12490 |
+
}
|
12491 |
|
12492 |
+
var boundActionCreators = {};
|
12493 |
|
12494 |
+
for (var key in actionCreators) {
|
12495 |
+
var actionCreator = actionCreators[key];
|
12496 |
|
12497 |
+
if (typeof actionCreator === 'function') {
|
12498 |
+
boundActionCreators[key] = bindActionCreator(actionCreator, dispatch);
|
12499 |
+
}
|
12500 |
+
}
|
|
|
12501 |
|
12502 |
+
return boundActionCreators;
|
12503 |
+
}
|
12504 |
|
12505 |
+
function _defineProperty(obj, key, value) {
|
12506 |
+
if (key in obj) {
|
12507 |
+
Object.defineProperty(obj, key, {
|
12508 |
+
value: value,
|
12509 |
+
enumerable: true,
|
12510 |
+
configurable: true,
|
12511 |
+
writable: true
|
12512 |
+
});
|
12513 |
+
} else {
|
12514 |
+
obj[key] = value;
|
12515 |
}
|
12516 |
|
12517 |
+
return obj;
|
|
|
|
|
|
|
12518 |
}
|
12519 |
|
12520 |
+
function ownKeys(object, enumerableOnly) {
|
12521 |
+
var keys = Object.keys(object);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12522 |
|
12523 |
+
if (Object.getOwnPropertySymbols) {
|
12524 |
+
keys.push.apply(keys, Object.getOwnPropertySymbols(object));
|
12525 |
}
|
12526 |
|
12527 |
+
if (enumerableOnly) keys = keys.filter(function (sym) {
|
12528 |
+
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
12529 |
+
});
|
12530 |
+
return keys;
|
12531 |
+
}
|
|
|
|
|
|
|
12532 |
|
12533 |
+
function _objectSpread2(target) {
|
12534 |
+
for (var i = 1; i < arguments.length; i++) {
|
12535 |
+
var source = arguments[i] != null ? arguments[i] : {};
|
12536 |
|
12537 |
+
if (i % 2) {
|
12538 |
+
ownKeys(source, true).forEach(function (key) {
|
12539 |
+
_defineProperty(target, key, source[key]);
|
12540 |
+
});
|
12541 |
+
} else if (Object.getOwnPropertyDescriptors) {
|
12542 |
+
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
12543 |
+
} else {
|
12544 |
+
ownKeys(source).forEach(function (key) {
|
12545 |
+
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
12546 |
+
});
|
12547 |
+
}
|
12548 |
+
}
|
12549 |
|
12550 |
+
return target;
|
|
|
|
|
|
|
|
|
|
|
12551 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
12552 |
|
12553 |
/**
|
12554 |
+
* Composes single-argument functions from right to left. The rightmost
|
12555 |
+
* function can take multiple arguments as it provides the signature for
|
12556 |
+
* the resulting composite function.
|
12557 |
*
|
12558 |
+
* @param {...Function} funcs The functions to compose.
|
12559 |
+
* @returns {Function} A function obtained by composing the argument functions
|
12560 |
+
* from right to left. For example, compose(f, g, h) is identical to doing
|
12561 |
+
* (...args) => f(g(h(...args))).
|
12562 |
*/
|
12563 |
+
function compose() {
|
12564 |
+
for (var _len = arguments.length, funcs = new Array(_len), _key = 0; _key < _len; _key++) {
|
12565 |
+
funcs[_key] = arguments[_key];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12566 |
}
|
|
|
12567 |
|
12568 |
+
if (funcs.length === 0) {
|
12569 |
+
return function (arg) {
|
12570 |
+
return arg;
|
12571 |
+
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12572 |
}
|
12573 |
|
12574 |
+
if (funcs.length === 1) {
|
12575 |
+
return funcs[0];
|
12576 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12577 |
|
12578 |
+
return funcs.reduce(function (a, b) {
|
12579 |
+
return function () {
|
12580 |
+
return a(b.apply(void 0, arguments));
|
12581 |
+
};
|
12582 |
+
});
|
12583 |
+
}
|
12584 |
|
12585 |
+
/**
|
12586 |
+
* Creates a store enhancer that applies middleware to the dispatch method
|
12587 |
+
* of the Redux store. This is handy for a variety of tasks, such as expressing
|
12588 |
+
* asynchronous actions in a concise manner, or logging every action payload.
|
12589 |
+
*
|
12590 |
+
* See `redux-thunk` package as an example of the Redux middleware.
|
12591 |
+
*
|
12592 |
+
* Because middleware is potentially asynchronous, this should be the first
|
12593 |
+
* store enhancer in the composition chain.
|
12594 |
+
*
|
12595 |
+
* Note that each middleware will be given the `dispatch` and `getState` functions
|
12596 |
+
* as named arguments.
|
12597 |
+
*
|
12598 |
+
* @param {...Function} middlewares The middleware chain to be applied.
|
12599 |
+
* @returns {Function} A store enhancer applying the middleware.
|
12600 |
+
*/
|
12601 |
+
|
12602 |
+
function applyMiddleware() {
|
12603 |
+
for (var _len = arguments.length, middlewares = new Array(_len), _key = 0; _key < _len; _key++) {
|
12604 |
+
middlewares[_key] = arguments[_key];
|
12605 |
}
|
12606 |
|
12607 |
+
return function (createStore) {
|
12608 |
+
return function () {
|
12609 |
+
var store = createStore.apply(void 0, arguments);
|
|
|
|
|
|
|
12610 |
|
12611 |
+
var _dispatch = function dispatch() {
|
12612 |
+
throw new Error('Dispatching while constructing your middleware is not allowed. ' + 'Other middleware would not be applied to this dispatch.');
|
|
|
|
|
|
|
|
|
12613 |
};
|
|
|
|
|
12614 |
|
12615 |
+
var middlewareAPI = {
|
12616 |
+
getState: store.getState,
|
12617 |
+
dispatch: function dispatch() {
|
12618 |
+
return _dispatch.apply(void 0, arguments);
|
12619 |
+
}
|
12620 |
+
};
|
12621 |
+
var chain = middlewares.map(function (middleware) {
|
12622 |
+
return middleware(middlewareAPI);
|
12623 |
+
});
|
12624 |
+
_dispatch = compose.apply(void 0, chain)(store.dispatch);
|
12625 |
+
return _objectSpread2({}, store, {
|
12626 |
+
dispatch: _dispatch
|
12627 |
+
});
|
12628 |
+
};
|
12629 |
};
|
12630 |
+
}
|
12631 |
|
12632 |
+
/*
|
12633 |
+
* This is a dummy function to check if the function name has been altered by minification.
|
12634 |
+
* If the function has been minified and NODE_ENV !== 'production', warn the user.
|
12635 |
+
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12636 |
|
12637 |
+
function isCrushed() {}
|
|
|
|
|
|
|
|
|
|
|
|
|
12638 |
|
12639 |
+
if (false) {}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12640 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12641 |
|
|
|
12642 |
|
|
|
|
|
|
|
|
|
|
|
|
|
12643 |
|
12644 |
+
/***/ }),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12645 |
|
12646 |
+
/***/ 29:
|
12647 |
+
/***/ (function(module, exports) {
|
|
|
|
|
12648 |
|
12649 |
+
(function() { module.exports = this["wp"]["dataControls"]; }());
|
|
|
|
|
|
|
|
|
12650 |
|
12651 |
+
/***/ }),
|
|
|
|
|
|
|
|
|
12652 |
|
12653 |
+
/***/ 3:
|
12654 |
+
/***/ (function(module, exports) {
|
|
|
|
|
12655 |
|
12656 |
+
(function() { module.exports = this["wp"]["i18n"]; }());
|
|
|
|
|
|
|
|
|
|
|
12657 |
|
12658 |
+
/***/ }),
|
|
|
12659 |
|
12660 |
+
/***/ 30:
|
12661 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
12662 |
|
12663 |
+
"use strict";
|
12664 |
+
/* unused harmony export JETPACK_NAMESPACE */
|
12665 |
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return NAMESPACE; });
|
12666 |
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return WC_ADMIN_NAMESPACE; });
|
12667 |
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return WCS_NAMESPACE; });
|
12668 |
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return DEFAULT_REQUIREMENT; });
|
12669 |
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return MAX_PER_PAGE; });
|
12670 |
+
/* unused harmony export DEFAULT_ACTIONABLE_STATUSES */
|
12671 |
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return QUERY_DEFAULTS; });
|
12672 |
+
/* harmony import */ var _fresh_data_framework__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(176);
|
12673 |
+
/**
|
12674 |
+
* External dependencies
|
12675 |
+
*/
|
12676 |
|
12677 |
+
var JETPACK_NAMESPACE = '/jetpack/v4';
|
12678 |
+
var NAMESPACE = '/wc-analytics';
|
12679 |
+
var WC_ADMIN_NAMESPACE = '/wc-admin';
|
12680 |
+
var WCS_NAMESPACE = '/wc/v1'; // WCS endpoints like Stripe are not avaiable on later /wc versions
|
12681 |
|
12682 |
+
var DEFAULT_REQUIREMENT = {
|
12683 |
+
timeout: 1 * _fresh_data_framework__WEBPACK_IMPORTED_MODULE_0__[/* MINUTE */ "b"],
|
12684 |
+
freshness: 30 * _fresh_data_framework__WEBPACK_IMPORTED_MODULE_0__[/* MINUTE */ "b"]
|
12685 |
+
}; // WordPress & WooCommerce both set a hard limit of 100 for the per_page parameter
|
12686 |
|
12687 |
+
var MAX_PER_PAGE = 100;
|
12688 |
+
var DEFAULT_ACTIONABLE_STATUSES = ['processing', 'on-hold'];
|
12689 |
+
var QUERY_DEFAULTS = {
|
12690 |
+
pageSize: 25,
|
12691 |
+
period: 'month',
|
12692 |
+
compare: 'previous_year',
|
12693 |
+
noteTypes: 'info,warning,marketing,survey'
|
12694 |
+
};
|
|
|
12695 |
|
12696 |
+
/***/ }),
|
|
|
|
|
|
|
12697 |
|
12698 |
+
/***/ 31:
|
12699 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
12700 |
+
|
12701 |
+
"use strict";
|
12702 |
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _arrayLikeToArray; });
|
12703 |
+
function _arrayLikeToArray(arr, len) {
|
12704 |
+
if (len == null || len > arr.length) len = arr.length;
|
12705 |
|
12706 |
+
for (var i = 0, arr2 = new Array(len); i < len; i++) {
|
12707 |
+
arr2[i] = arr[i];
|
12708 |
+
}
|
12709 |
|
12710 |
+
return arr2;
|
12711 |
+
}
|
|
|
12712 |
|
12713 |
+
/***/ }),
|
12714 |
|
12715 |
+
/***/ 32:
|
12716 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
|
|
|
|
|
12717 |
|
12718 |
+
"use strict";
|
|
|
|
|
12719 |
|
12720 |
+
// EXPORTS
|
12721 |
+
__webpack_require__.d(__webpack_exports__, "e", function() { return /* binding */ TAB; });
|
12722 |
+
__webpack_require__.d(__webpack_exports__, "b", function() { return /* binding */ ESCAPE; });
|
12723 |
+
__webpack_require__.d(__webpack_exports__, "c", function() { return /* binding */ LEFT; });
|
12724 |
+
__webpack_require__.d(__webpack_exports__, "f", function() { return /* binding */ UP; });
|
12725 |
+
__webpack_require__.d(__webpack_exports__, "d", function() { return /* binding */ RIGHT; });
|
12726 |
+
__webpack_require__.d(__webpack_exports__, "a", function() { return /* binding */ DOWN; });
|
12727 |
|
12728 |
+
// UNUSED EXPORTS: BACKSPACE, ENTER, SPACE, DELETE, F10, ALT, CTRL, COMMAND, SHIFT, ZERO, modifiers, rawShortcut, displayShortcutList, displayShortcut, shortcutAriaLabel, isKeyboardEvent
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12729 |
|
12730 |
+
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/defineProperty.js
|
12731 |
+
var defineProperty = __webpack_require__(6);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12732 |
|
12733 |
+
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js + 3 modules
|
12734 |
+
var toConsumableArray = __webpack_require__(15);
|
|
|
|
|
|
|
|
|
|
|
|
|
12735 |
|
12736 |
+
// EXTERNAL MODULE: external "lodash"
|
12737 |
+
var external_lodash_ = __webpack_require__(2);
|
|
|
|
|
|
|
|
|
12738 |
|
12739 |
+
// EXTERNAL MODULE: external {"this":["wp","i18n"]}
|
12740 |
+
var external_this_wp_i18n_ = __webpack_require__(3);
|
|
|
|
|
12741 |
|
12742 |
+
// CONCATENATED MODULE: ./node_modules/@wordpress/components/node_modules/@wordpress/keycodes/build-module/platform.js
|
12743 |
+
/**
|
12744 |
+
* External dependencies
|
12745 |
+
*/
|
12746 |
|
12747 |
+
/**
|
12748 |
+
* Return true if platform is MacOS.
|
12749 |
+
*
|
12750 |
+
* @param {Object} _window window object by default; used for DI testing.
|
12751 |
+
*
|
12752 |
+
* @return {boolean} True if MacOS; false otherwise.
|
12753 |
+
*/
|
12754 |
|
12755 |
+
function isAppleOS() {
|
12756 |
+
var _window = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : window;
|
|
|
|
|
|
|
|
|
12757 |
|
12758 |
+
var platform = _window.navigator.platform;
|
12759 |
+
return platform.indexOf('Mac') !== -1 || Object(external_lodash_["includes"])(['iPad', 'iPhone'], platform);
|
12760 |
+
}
|
12761 |
+
//# sourceMappingURL=platform.js.map
|
12762 |
+
// CONCATENATED MODULE: ./node_modules/@wordpress/components/node_modules/@wordpress/keycodes/build-module/index.js
|
12763 |
|
|
|
|
|
|
|
|
|
|
|
|
|
12764 |
|
|
|
|
|
|
|
|
|
12765 |
|
12766 |
+
/**
|
12767 |
+
* Note: The order of the modifier keys in many of the [foo]Shortcut()
|
12768 |
+
* functions in this file are intentional and should not be changed. They're
|
12769 |
+
* designed to fit with the standard menu keyboard shortcuts shown in the
|
12770 |
+
* user's platform.
|
12771 |
+
*
|
12772 |
+
* For example, on MacOS menu shortcuts will place Shift before Command, but
|
12773 |
+
* on Windows Control will usually come first. So don't provide your own
|
12774 |
+
* shortcut combos directly to keyboardShortcut().
|
12775 |
+
*/
|
12776 |
|
12777 |
+
/**
|
12778 |
+
* External dependencies
|
12779 |
+
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12780 |
|
12781 |
+
/**
|
12782 |
+
* WordPress dependencies
|
12783 |
+
*/
|
|
|
12784 |
|
|
|
|
|
|
|
|
|
|
|
12785 |
|
12786 |
+
/**
|
12787 |
+
* Internal dependencies
|
12788 |
+
*/
|
12789 |
|
|
|
12790 |
|
12791 |
+
/**
|
12792 |
+
* @typedef {'primary'|'primaryShift'|'primaryAlt'|'secondary'|'access'|'ctrl'|'alt'|'ctrlShift'|'shift'|'shiftAlt'} WPKeycodeModifier
|
12793 |
+
*/
|
|
|
|
|
|
|
|
|
|
|
12794 |
|
12795 |
+
/**
|
12796 |
+
* An object of handler functions for each of the possible modifier
|
12797 |
+
* combinations. A handler will return a value for a given key.
|
12798 |
+
*
|
12799 |
+
* @typedef {Record<WPKeycodeModifier, (key:string)=>any>} WPKeycodeHandlerByModifier
|
12800 |
+
*/
|
12801 |
|
12802 |
+
/**
|
12803 |
+
* Keycode for BACKSPACE key.
|
12804 |
+
*/
|
12805 |
|
12806 |
+
var BACKSPACE = 8;
|
12807 |
+
/**
|
12808 |
+
* Keycode for TAB key.
|
12809 |
+
*/
|
12810 |
|
12811 |
+
var TAB = 9;
|
12812 |
+
/**
|
12813 |
+
* Keycode for ENTER key.
|
12814 |
+
*/
|
12815 |
|
12816 |
+
var ENTER = 13;
|
12817 |
+
/**
|
12818 |
+
* Keycode for ESCAPE key.
|
12819 |
+
*/
|
12820 |
|
12821 |
+
var ESCAPE = 27;
|
12822 |
+
/**
|
12823 |
+
* Keycode for SPACE key.
|
12824 |
+
*/
|
|
|
|
|
12825 |
|
12826 |
+
var SPACE = 32;
|
12827 |
+
/**
|
12828 |
+
* Keycode for LEFT key.
|
12829 |
+
*/
|
|
|
|
|
|
|
|
|
12830 |
|
12831 |
+
var LEFT = 37;
|
12832 |
+
/**
|
12833 |
+
* Keycode for UP key.
|
12834 |
+
*/
|
|
|
|
|
12835 |
|
12836 |
+
var UP = 38;
|
12837 |
+
/**
|
12838 |
+
* Keycode for RIGHT key.
|
12839 |
+
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12840 |
|
12841 |
+
var RIGHT = 39;
|
12842 |
+
/**
|
12843 |
+
* Keycode for DOWN key.
|
12844 |
+
*/
|
|
|
|
|
|
|
12845 |
|
12846 |
+
var DOWN = 40;
|
12847 |
+
/**
|
12848 |
+
* Keycode for DELETE key.
|
12849 |
+
*/
|
|
|
|
|
12850 |
|
12851 |
+
var DELETE = 46;
|
12852 |
+
/**
|
12853 |
+
* Keycode for F10 key.
|
12854 |
+
*/
|
12855 |
|
12856 |
+
var F10 = 121;
|
12857 |
+
/**
|
12858 |
+
* Keycode for ALT key.
|
12859 |
+
*/
|
|
|
|
|
|
|
|
|
|
|
12860 |
|
12861 |
+
var ALT = 'alt';
|
12862 |
+
/**
|
12863 |
+
* Keycode for CTRL key.
|
12864 |
+
*/
|
12865 |
|
12866 |
+
var CTRL = 'ctrl';
|
12867 |
+
/**
|
12868 |
+
* Keycode for COMMAND/META key.
|
12869 |
+
*/
|
12870 |
|
12871 |
+
var COMMAND = 'meta';
|
12872 |
+
/**
|
12873 |
+
* Keycode for SHIFT key.
|
12874 |
+
*/
|
12875 |
|
12876 |
+
var SHIFT = 'shift';
|
12877 |
+
/**
|
12878 |
+
* Keycode for ZERO key.
|
12879 |
+
*/
|
12880 |
|
12881 |
+
var ZERO = 48;
|
12882 |
+
/**
|
12883 |
+
* Object that contains functions that return the available modifier
|
12884 |
+
* depending on platform.
|
12885 |
+
*
|
12886 |
+
* - `primary`: takes a isApple function as a parameter.
|
12887 |
+
* - `primaryShift`: takes a isApple function as a parameter.
|
12888 |
+
* - `primaryAlt`: takes a isApple function as a parameter.
|
12889 |
+
* - `secondary`: takes a isApple function as a parameter.
|
12890 |
+
* - `access`: takes a isApple function as a parameter.
|
12891 |
+
* - `ctrl`
|
12892 |
+
* - `alt`
|
12893 |
+
* - `ctrlShift`
|
12894 |
+
* - `shift`
|
12895 |
+
* - `shiftAlt`
|
12896 |
+
*/
|
12897 |
+
|
12898 |
+
var modifiers = {
|
12899 |
+
primary: function primary(_isApple) {
|
12900 |
+
return _isApple() ? [COMMAND] : [CTRL];
|
12901 |
+
},
|
12902 |
+
primaryShift: function primaryShift(_isApple) {
|
12903 |
+
return _isApple() ? [SHIFT, COMMAND] : [CTRL, SHIFT];
|
12904 |
+
},
|
12905 |
+
primaryAlt: function primaryAlt(_isApple) {
|
12906 |
+
return _isApple() ? [ALT, COMMAND] : [CTRL, ALT];
|
12907 |
+
},
|
12908 |
+
secondary: function secondary(_isApple) {
|
12909 |
+
return _isApple() ? [SHIFT, ALT, COMMAND] : [CTRL, SHIFT, ALT];
|
12910 |
+
},
|
12911 |
+
access: function access(_isApple) {
|
12912 |
+
return _isApple() ? [CTRL, ALT] : [SHIFT, ALT];
|
12913 |
+
},
|
12914 |
+
ctrl: function ctrl() {
|
12915 |
+
return [CTRL];
|
12916 |
+
},
|
12917 |
+
alt: function alt() {
|
12918 |
+
return [ALT];
|
12919 |
+
},
|
12920 |
+
ctrlShift: function ctrlShift() {
|
12921 |
+
return [CTRL, SHIFT];
|
12922 |
+
},
|
12923 |
+
shift: function shift() {
|
12924 |
+
return [SHIFT];
|
12925 |
+
},
|
12926 |
+
shiftAlt: function shiftAlt() {
|
12927 |
+
return [SHIFT, ALT];
|
12928 |
}
|
12929 |
+
};
|
12930 |
+
/**
|
12931 |
+
* An object that contains functions to get raw shortcuts.
|
12932 |
+
* E.g. rawShortcut.primary( 'm' ) will return 'meta+m' on Mac.
|
12933 |
+
* These are intended for user with the KeyboardShortcuts component or TinyMCE.
|
12934 |
+
*
|
12935 |
+
* @type {WPKeycodeHandlerByModifier} Keyed map of functions to raw shortcuts.
|
12936 |
+
*/
|
12937 |
|
12938 |
+
var rawShortcut = Object(external_lodash_["mapValues"])(modifiers, function (modifier) {
|
12939 |
+
return function (character) {
|
12940 |
+
var _isApple = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : isAppleOS;
|
12941 |
|
12942 |
+
return [].concat(Object(toConsumableArray["a" /* default */])(modifier(_isApple)), [character.toLowerCase()]).join('+');
|
12943 |
+
};
|
12944 |
+
});
|
12945 |
+
/**
|
12946 |
+
* Return an array of the parts of a keyboard shortcut chord for display
|
12947 |
+
* E.g displayShortcutList.primary( 'm' ) will return [ '⌘', 'M' ] on Mac.
|
12948 |
+
*
|
12949 |
+
* @type {WPKeycodeHandlerByModifier} Keyed map of functions to shortcut
|
12950 |
+
* sequences.
|
12951 |
+
*/
|
12952 |
|
12953 |
+
var displayShortcutList = Object(external_lodash_["mapValues"])(modifiers, function (modifier) {
|
12954 |
+
return function (character) {
|
12955 |
+
var _replacementKeyMap;
|
12956 |
|
12957 |
+
var _isApple = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : isAppleOS;
|
12958 |
|
12959 |
+
var isApple = _isApple();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12960 |
|
12961 |
+
var replacementKeyMap = (_replacementKeyMap = {}, Object(defineProperty["a" /* default */])(_replacementKeyMap, ALT, isApple ? '⌥' : 'Alt'), Object(defineProperty["a" /* default */])(_replacementKeyMap, CTRL, isApple ? '^' : 'Ctrl'), Object(defineProperty["a" /* default */])(_replacementKeyMap, COMMAND, '⌘'), Object(defineProperty["a" /* default */])(_replacementKeyMap, SHIFT, isApple ? '⇧' : 'Shift'), _replacementKeyMap);
|
12962 |
+
var modifierKeys = modifier(_isApple).reduce(function (accumulator, key) {
|
12963 |
+
var replacementKey = Object(external_lodash_["get"])(replacementKeyMap, key, key); // If on the Mac, adhere to platform convention and don't show plus between keys.
|
12964 |
|
12965 |
+
if (isApple) {
|
12966 |
+
return [].concat(Object(toConsumableArray["a" /* default */])(accumulator), [replacementKey]);
|
|
|
|
|
12967 |
}
|
12968 |
|
12969 |
+
return [].concat(Object(toConsumableArray["a" /* default */])(accumulator), [replacementKey, '+']);
|
12970 |
+
}, []);
|
12971 |
+
var capitalizedCharacter = Object(external_lodash_["capitalize"])(character);
|
12972 |
+
return [].concat(Object(toConsumableArray["a" /* default */])(modifierKeys), [capitalizedCharacter]);
|
12973 |
+
};
|
12974 |
+
});
|
12975 |
+
/**
|
12976 |
+
* An object that contains functions to display shortcuts.
|
12977 |
+
* E.g. displayShortcut.primary( 'm' ) will return '⌘M' on Mac.
|
12978 |
+
*
|
12979 |
+
* @type {WPKeycodeHandlerByModifier} Keyed map of functions to display
|
12980 |
+
* shortcuts.
|
12981 |
+
*/
|
12982 |
|
12983 |
+
var displayShortcut = Object(external_lodash_["mapValues"])(displayShortcutList, function (shortcutList) {
|
12984 |
+
return function (character) {
|
12985 |
+
var _isApple = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : isAppleOS;
|
|
|
12986 |
|
12987 |
+
return shortcutList(character, _isApple).join('');
|
12988 |
+
};
|
12989 |
+
});
|
12990 |
+
/**
|
12991 |
+
* An object that contains functions to return an aria label for a keyboard shortcut.
|
12992 |
+
* E.g. shortcutAriaLabel.primary( '.' ) will return 'Command + Period' on Mac.
|
12993 |
+
*
|
12994 |
+
* @type {WPKeycodeHandlerByModifier} Keyed map of functions to shortcut ARIA
|
12995 |
+
* labels.
|
12996 |
+
*/
|
12997 |
+
|
12998 |
+
var shortcutAriaLabel = Object(external_lodash_["mapValues"])(modifiers, function (modifier) {
|
12999 |
+
return function (character) {
|
13000 |
+
var _replacementKeyMap2;
|
13001 |
+
|
13002 |
+
var _isApple = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : isAppleOS;
|
13003 |
+
|
13004 |
+
var isApple = _isApple();
|
13005 |
+
|
13006 |
+
var replacementKeyMap = (_replacementKeyMap2 = {}, Object(defineProperty["a" /* default */])(_replacementKeyMap2, SHIFT, 'Shift'), Object(defineProperty["a" /* default */])(_replacementKeyMap2, COMMAND, isApple ? 'Command' : 'Control'), Object(defineProperty["a" /* default */])(_replacementKeyMap2, CTRL, 'Control'), Object(defineProperty["a" /* default */])(_replacementKeyMap2, ALT, isApple ? 'Option' : 'Alt'), Object(defineProperty["a" /* default */])(_replacementKeyMap2, ',', Object(external_this_wp_i18n_["__"])('Comma')), Object(defineProperty["a" /* default */])(_replacementKeyMap2, '.', Object(external_this_wp_i18n_["__"])('Period')), Object(defineProperty["a" /* default */])(_replacementKeyMap2, '`', Object(external_this_wp_i18n_["__"])('Backtick')), _replacementKeyMap2);
|
13007 |
+
return [].concat(Object(toConsumableArray["a" /* default */])(modifier(_isApple)), [character]).map(function (key) {
|
13008 |
+
return Object(external_lodash_["capitalize"])(Object(external_lodash_["get"])(replacementKeyMap, key, key));
|
13009 |
+
}).join(isApple ? ' ' : ' + ');
|
13010 |
+
};
|
13011 |
+
});
|
13012 |
+
/**
|
13013 |
+
* From a given KeyboardEvent, returns an array of active modifier constants for
|
13014 |
+
* the event.
|
13015 |
+
*
|
13016 |
+
* @param {KeyboardEvent} event Keyboard event.
|
13017 |
+
*
|
13018 |
+
* @return {Array<ALT|CTRL|COMMAND|SHIFT>} Active modifier constants.
|
13019 |
+
*/
|
13020 |
+
|
13021 |
+
function getEventModifiers(event) {
|
13022 |
+
return [ALT, CTRL, COMMAND, SHIFT].filter(function (key) {
|
13023 |
+
return event["".concat(key, "Key")];
|
13024 |
+
});
|
13025 |
+
}
|
13026 |
+
/**
|
13027 |
+
* An object that contains functions to check if a keyboard event matches a
|
13028 |
+
* predefined shortcut combination.
|
13029 |
+
* E.g. isKeyboardEvent.primary( event, 'm' ) will return true if the event
|
13030 |
+
* signals pressing ⌘M.
|
13031 |
+
*
|
13032 |
+
* @type {WPKeycodeHandlerByModifier} Keyed map of functions to match events.
|
13033 |
+
*/
|
13034 |
|
|
|
|
|
|
|
|
|
|
|
|
|
13035 |
|
13036 |
+
var isKeyboardEvent = Object(external_lodash_["mapValues"])(modifiers, function (getModifiers) {
|
13037 |
+
return function (event, character) {
|
13038 |
+
var _isApple = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : isAppleOS;
|
13039 |
|
13040 |
+
var mods = getModifiers(_isApple);
|
13041 |
+
var eventMods = getEventModifiers(event);
|
|
|
13042 |
|
13043 |
+
if (Object(external_lodash_["xor"])(mods, eventMods).length) {
|
13044 |
+
return false;
|
13045 |
+
}
|
|
|
|
|
|
|
13046 |
|
13047 |
+
if (!character) {
|
13048 |
+
return Object(external_lodash_["includes"])(mods, event.key.toLowerCase());
|
13049 |
+
}
|
13050 |
|
13051 |
+
return event.key === character;
|
13052 |
+
};
|
13053 |
+
});
|
13054 |
+
//# sourceMappingURL=index.js.map
|
|
|
|
|
13055 |
|
13056 |
+
/***/ }),
|
|
|
|
|
|
|
13057 |
|
13058 |
+
/***/ 34:
|
13059 |
+
/***/ (function(module, exports) {
|
|
|
|
|
13060 |
|
13061 |
+
function _typeof(obj) {
|
13062 |
+
"@babel/helpers - typeof";
|
|
|
|
|
|
|
|
|
13063 |
|
13064 |
+
if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
|
13065 |
+
module.exports = _typeof = function _typeof(obj) {
|
13066 |
+
return typeof obj;
|
13067 |
+
};
|
13068 |
+
} else {
|
13069 |
+
module.exports = _typeof = function _typeof(obj) {
|
13070 |
+
return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
13071 |
+
};
|
13072 |
+
}
|
|
|
13073 |
|
13074 |
+
return _typeof(obj);
|
13075 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13076 |
|
13077 |
+
module.exports = _typeof;
|
|
|
|
|
13078 |
|
13079 |
+
/***/ }),
|
|
|
|
|
|
|
|
|
13080 |
|
13081 |
+
/***/ 35:
|
13082 |
+
/***/ (function(module, exports) {
|
13083 |
|
13084 |
+
// shim for using process in browser
|
13085 |
+
var process = module.exports = {};
|
|
|
|
|
13086 |
|
13087 |
+
// cached from whatever global is present so that test runners that stub it
|
13088 |
+
// don't break things. But we need to wrap it in a try catch in case it is
|
13089 |
+
// wrapped in strict mode code which doesn't define any globals. It's inside a
|
13090 |
+
// function because try/catches deoptimize in certain engines.
|
|
|
|
|
|
|
|
|
|
|
|
|
13091 |
|
13092 |
+
var cachedSetTimeout;
|
13093 |
+
var cachedClearTimeout;
|
13094 |
|
13095 |
+
function defaultSetTimout() {
|
13096 |
+
throw new Error('setTimeout has not been defined');
|
13097 |
+
}
|
13098 |
+
function defaultClearTimeout () {
|
13099 |
+
throw new Error('clearTimeout has not been defined');
|
13100 |
+
}
|
13101 |
+
(function () {
|
13102 |
+
try {
|
13103 |
+
if (typeof setTimeout === 'function') {
|
13104 |
+
cachedSetTimeout = setTimeout;
|
13105 |
+
} else {
|
13106 |
+
cachedSetTimeout = defaultSetTimout;
|
13107 |
}
|
13108 |
+
} catch (e) {
|
13109 |
+
cachedSetTimeout = defaultSetTimout;
|
13110 |
+
}
|
13111 |
+
try {
|
13112 |
+
if (typeof clearTimeout === 'function') {
|
13113 |
+
cachedClearTimeout = clearTimeout;
|
13114 |
+
} else {
|
13115 |
+
cachedClearTimeout = defaultClearTimeout;
|
13116 |
+
}
|
13117 |
+
} catch (e) {
|
13118 |
+
cachedClearTimeout = defaultClearTimeout;
|
13119 |
+
}
|
13120 |
+
} ())
|
13121 |
+
function runTimeout(fun) {
|
13122 |
+
if (cachedSetTimeout === setTimeout) {
|
13123 |
+
//normal enviroments in sane situations
|
13124 |
+
return setTimeout(fun, 0);
|
13125 |
+
}
|
13126 |
+
// if setTimeout wasn't available but was latter defined
|
13127 |
+
if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {
|
13128 |
+
cachedSetTimeout = setTimeout;
|
13129 |
+
return setTimeout(fun, 0);
|
13130 |
+
}
|
13131 |
+
try {
|
13132 |
+
// when when somebody has screwed with setTimeout but no I.E. maddness
|
13133 |
+
return cachedSetTimeout(fun, 0);
|
13134 |
+
} catch(e){
|
13135 |
+
try {
|
13136 |
+
// When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
|
13137 |
+
return cachedSetTimeout.call(null, fun, 0);
|
13138 |
+
} catch(e){
|
13139 |
+
// same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error
|
13140 |
+
return cachedSetTimeout.call(this, fun, 0);
|
13141 |
+
}
|
13142 |
+
}
|
13143 |
|
13144 |
+
|
13145 |
+
}
|
13146 |
+
function runClearTimeout(marker) {
|
13147 |
+
if (cachedClearTimeout === clearTimeout) {
|
13148 |
+
//normal enviroments in sane situations
|
13149 |
+
return clearTimeout(marker);
|
13150 |
+
}
|
13151 |
+
// if clearTimeout wasn't available but was latter defined
|
13152 |
+
if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {
|
13153 |
+
cachedClearTimeout = clearTimeout;
|
13154 |
+
return clearTimeout(marker);
|
13155 |
+
}
|
13156 |
+
try {
|
13157 |
+
// when when somebody has screwed with setTimeout but no I.E. maddness
|
13158 |
+
return cachedClearTimeout(marker);
|
13159 |
+
} catch (e){
|
13160 |
+
try {
|
13161 |
+
// When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
|
13162 |
+
return cachedClearTimeout.call(null, marker);
|
13163 |
+
} catch (e){
|
13164 |
+
// same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.
|
13165 |
+
// Some versions of I.E. have different rules for clearTimeout vs setTimeout
|
13166 |
+
return cachedClearTimeout.call(this, marker);
|
13167 |
}
|
13168 |
+
}
|
13169 |
|
|
|
|
|
|
|
|
|
13170 |
|
|
|
|
|
|
|
|
|
|
|
|
|
13171 |
|
13172 |
+
}
|
13173 |
+
var queue = [];
|
13174 |
+
var draining = false;
|
13175 |
+
var currentQueue;
|
13176 |
+
var queueIndex = -1;
|
13177 |
+
|
13178 |
+
function cleanUpNextTick() {
|
13179 |
+
if (!draining || !currentQueue) {
|
13180 |
+
return;
|
13181 |
+
}
|
13182 |
+
draining = false;
|
13183 |
+
if (currentQueue.length) {
|
13184 |
+
queue = currentQueue.concat(queue);
|
13185 |
+
} else {
|
13186 |
+
queueIndex = -1;
|
13187 |
+
}
|
13188 |
+
if (queue.length) {
|
13189 |
+
drainQueue();
|
13190 |
+
}
|
13191 |
+
}
|
13192 |
+
|
13193 |
+
function drainQueue() {
|
13194 |
+
if (draining) {
|
13195 |
+
return;
|
13196 |
+
}
|
13197 |
+
var timeout = runTimeout(cleanUpNextTick);
|
13198 |
+
draining = true;
|
13199 |
+
|
13200 |
+
var len = queue.length;
|
13201 |
+
while(len) {
|
13202 |
+
currentQueue = queue;
|
13203 |
+
queue = [];
|
13204 |
+
while (++queueIndex < len) {
|
13205 |
+
if (currentQueue) {
|
13206 |
+
currentQueue[queueIndex].run();
|
13207 |
+
}
|
13208 |
+
}
|
13209 |
+
queueIndex = -1;
|
13210 |
+
len = queue.length;
|
13211 |
+
}
|
13212 |
+
currentQueue = null;
|
13213 |
+
draining = false;
|
13214 |
+
runClearTimeout(timeout);
|
13215 |
+
}
|
13216 |
|
13217 |
+
process.nextTick = function (fun) {
|
13218 |
+
var args = new Array(arguments.length - 1);
|
13219 |
+
if (arguments.length > 1) {
|
13220 |
+
for (var i = 1; i < arguments.length; i++) {
|
13221 |
+
args[i - 1] = arguments[i];
|
13222 |
+
}
|
13223 |
}
|
13224 |
+
queue.push(new Item(fun, args));
|
13225 |
+
if (queue.length === 1 && !draining) {
|
13226 |
+
runTimeout(drainQueue);
|
13227 |
+
}
|
13228 |
+
};
|
13229 |
|
13230 |
+
// v8 likes predictible objects
|
13231 |
+
function Item(fun, array) {
|
13232 |
+
this.fun = fun;
|
13233 |
+
this.array = array;
|
13234 |
+
}
|
13235 |
+
Item.prototype.run = function () {
|
13236 |
+
this.fun.apply(null, this.array);
|
13237 |
+
};
|
13238 |
+
process.title = 'browser';
|
13239 |
+
process.browser = true;
|
13240 |
+
process.env = {};
|
13241 |
+
process.argv = [];
|
13242 |
+
process.version = ''; // empty string to avoid regexp issues
|
13243 |
+
process.versions = {};
|
13244 |
|
13245 |
+
function noop() {}
|
|
|
|
|
|
|
|
|
|
|
|
|
13246 |
|
13247 |
+
process.on = noop;
|
13248 |
+
process.addListener = noop;
|
13249 |
+
process.once = noop;
|
13250 |
+
process.off = noop;
|
13251 |
+
process.removeListener = noop;
|
13252 |
+
process.removeAllListeners = noop;
|
13253 |
+
process.emit = noop;
|
13254 |
+
process.prependListener = noop;
|
13255 |
+
process.prependOnceListener = noop;
|
|
|
|
|
|
|
|
|
|
|
13256 |
|
13257 |
+
process.listeners = function (name) { return [] }
|
13258 |
|
13259 |
+
process.binding = function (name) {
|
13260 |
+
throw new Error('process.binding is not supported');
|
13261 |
+
};
|
13262 |
|
13263 |
+
process.cwd = function () { return '/' };
|
13264 |
+
process.chdir = function (dir) {
|
13265 |
+
throw new Error('process.chdir is not supported');
|
13266 |
+
};
|
13267 |
+
process.umask = function() { return 0; };
|
13268 |
|
|
|
13269 |
|
13270 |
/***/ }),
|
13271 |
|
13272 |
+
/***/ 36:
|
13273 |
/***/ (function(module, exports, __webpack_require__) {
|
13274 |
|
13275 |
+
"use strict";
|
13276 |
|
|
|
13277 |
|
13278 |
+
Object.defineProperty(exports, "__esModule", {
|
13279 |
+
value: true
|
13280 |
+
});
|
13281 |
|
13282 |
+
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; /**
|
13283 |
+
* External Dependencies
|
13284 |
+
*/
|
13285 |
|
|
|
13286 |
|
13287 |
+
/**
|
13288 |
+
* Internal Dependencies
|
13289 |
+
*/
|
13290 |
|
|
|
13291 |
|
13292 |
+
var _react = __webpack_require__(13);
|
13293 |
|
13294 |
+
var _react2 = _interopRequireDefault(_react);
|
|
|
13295 |
|
13296 |
+
var _reactAddonsCreateFragment = __webpack_require__(157);
|
13297 |
|
13298 |
+
var _reactAddonsCreateFragment2 = _interopRequireDefault(_reactAddonsCreateFragment);
|
13299 |
|
13300 |
+
var _tokenize = __webpack_require__(160);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13301 |
|
13302 |
+
var _tokenize2 = _interopRequireDefault(_tokenize);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13303 |
|
13304 |
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
|
|
|
|
|
|
|
|
|
13305 |
|
13306 |
+
var currentMixedString = void 0;
|
|
|
13307 |
|
13308 |
+
function getCloseIndex(openIndex, tokens) {
|
13309 |
+
var openToken = tokens[openIndex],
|
13310 |
+
nestLevel = 0,
|
13311 |
+
token,
|
13312 |
+
i;
|
13313 |
+
for (i = openIndex + 1; i < tokens.length; i++) {
|
13314 |
+
token = tokens[i];
|
13315 |
+
if (token.value === openToken.value) {
|
13316 |
+
if (token.type === 'componentOpen') {
|
13317 |
+
nestLevel++;
|
13318 |
+
continue;
|
13319 |
+
}
|
13320 |
+
if (token.type === 'componentClose') {
|
13321 |
+
if (nestLevel === 0) {
|
13322 |
+
return i;
|
13323 |
+
}
|
13324 |
+
nestLevel--;
|
13325 |
+
}
|
13326 |
+
}
|
13327 |
+
}
|
13328 |
+
// if we get this far, there was no matching close token
|
13329 |
+
throw new Error('Missing closing component token `' + openToken.value + '`');
|
13330 |
+
}
|
13331 |
|
13332 |
+
function buildChildren(tokens, components) {
|
13333 |
+
var children = [],
|
13334 |
+
childrenObject = {},
|
13335 |
+
openComponent,
|
13336 |
+
clonedOpenComponent,
|
13337 |
+
openIndex,
|
13338 |
+
closeIndex,
|
13339 |
+
token,
|
13340 |
+
i,
|
13341 |
+
grandChildTokens,
|
13342 |
+
grandChildren,
|
13343 |
+
siblingTokens,
|
13344 |
+
siblings;
|
13345 |
|
13346 |
+
for (i = 0; i < tokens.length; i++) {
|
13347 |
+
token = tokens[i];
|
13348 |
+
if (token.type === 'string') {
|
13349 |
+
children.push(token.value);
|
13350 |
+
continue;
|
13351 |
+
}
|
13352 |
+
// component node should at least be set
|
13353 |
+
if (!components.hasOwnProperty(token.value) || typeof components[token.value] === 'undefined') {
|
13354 |
+
throw new Error('Invalid interpolation, missing component node: `' + token.value + '`');
|
13355 |
+
}
|
13356 |
+
// should be either ReactElement or null (both type "object"), all other types deprecated
|
13357 |
+
if (_typeof(components[token.value]) !== 'object') {
|
13358 |
+
throw new Error('Invalid interpolation, component node must be a ReactElement or null: `' + token.value + '`', '\n> ' + currentMixedString);
|
13359 |
+
}
|
13360 |
+
// we should never see a componentClose token in this loop
|
13361 |
+
if (token.type === 'componentClose') {
|
13362 |
+
throw new Error('Missing opening component token: `' + token.value + '`');
|
13363 |
+
}
|
13364 |
+
if (token.type === 'componentOpen') {
|
13365 |
+
openComponent = components[token.value];
|
13366 |
+
openIndex = i;
|
13367 |
+
break;
|
13368 |
+
}
|
13369 |
+
// componentSelfClosing token
|
13370 |
+
children.push(components[token.value]);
|
13371 |
+
continue;
|
13372 |
+
}
|
13373 |
|
13374 |
+
if (openComponent) {
|
13375 |
+
closeIndex = getCloseIndex(openIndex, tokens);
|
13376 |
+
grandChildTokens = tokens.slice(openIndex + 1, closeIndex);
|
13377 |
+
grandChildren = buildChildren(grandChildTokens, components);
|
13378 |
+
clonedOpenComponent = _react2.default.cloneElement(openComponent, {}, grandChildren);
|
13379 |
+
children.push(clonedOpenComponent);
|
|
|
|
|
|
|
13380 |
|
13381 |
+
if (closeIndex < tokens.length - 1) {
|
13382 |
+
siblingTokens = tokens.slice(closeIndex + 1);
|
13383 |
+
siblings = buildChildren(siblingTokens, components);
|
13384 |
+
children = children.concat(siblings);
|
13385 |
+
}
|
13386 |
+
}
|
13387 |
|
13388 |
+
if (children.length === 1) {
|
13389 |
+
return children[0];
|
13390 |
+
}
|
13391 |
|
13392 |
+
children.forEach(function (child, index) {
|
13393 |
+
if (child) {
|
13394 |
+
childrenObject['interpolation-child-' + index] = child;
|
13395 |
+
}
|
13396 |
+
});
|
13397 |
|
13398 |
+
return (0, _reactAddonsCreateFragment2.default)(childrenObject);
|
13399 |
+
}
|
13400 |
|
13401 |
+
function interpolate(options) {
|
13402 |
+
var mixedString = options.mixedString,
|
13403 |
+
components = options.components,
|
13404 |
+
throwErrors = options.throwErrors;
|
13405 |
|
|
|
|
|
13406 |
|
13407 |
+
currentMixedString = mixedString;
|
13408 |
|
13409 |
+
if (!components) {
|
13410 |
+
return mixedString;
|
13411 |
+
}
|
13412 |
|
13413 |
+
if ((typeof components === 'undefined' ? 'undefined' : _typeof(components)) !== 'object') {
|
13414 |
+
if (throwErrors) {
|
13415 |
+
throw new Error('Interpolation Error: unable to process `' + mixedString + '` because components is not an object');
|
13416 |
+
}
|
13417 |
|
13418 |
+
return mixedString;
|
13419 |
+
}
|
13420 |
|
13421 |
+
var tokens = (0, _tokenize2.default)(mixedString);
|
13422 |
|
13423 |
+
try {
|
13424 |
+
return buildChildren(tokens, components);
|
13425 |
+
} catch (error) {
|
13426 |
+
if (throwErrors) {
|
13427 |
+
throw new Error('Interpolation Error: unable to process `' + mixedString + '` because of error `' + error.message + '`');
|
13428 |
+
}
|
13429 |
|
13430 |
+
return mixedString;
|
13431 |
+
}
|
13432 |
};
|
13433 |
|
13434 |
+
exports.default = interpolate;
|
13435 |
+
//# sourceMappingURL=index.js.map
|
13436 |
|
13437 |
/***/ }),
|
13438 |
|
13439 |
+
/***/ 37:
|
13440 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
13441 |
|
13442 |
+
"use strict";
|
13443 |
+
/* unused harmony export Circle */
|
13444 |
+
/* unused harmony export G */
|
13445 |
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Path; });
|
13446 |
+
/* unused harmony export Polygon */
|
13447 |
+
/* unused harmony export Rect */
|
13448 |
+
/* unused harmony export Defs */
|
13449 |
+
/* unused harmony export RadialGradient */
|
13450 |
+
/* unused harmony export LinearGradient */
|
13451 |
+
/* unused harmony export Stop */
|
13452 |
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return SVG; });
|
13453 |
+
/* harmony import */ var _babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6);
|
13454 |
+
/* harmony import */ var _babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(14);
|
13455 |
+
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7);
|
13456 |
+
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_2__);
|
13457 |
+
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(0);
|
13458 |
+
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__);
|
13459 |
|
|
|
13460 |
|
|
|
|
|
13461 |
|
13462 |
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13463 |
|
13464 |
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { Object(_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
13465 |
|
13466 |
+
/**
|
13467 |
+
* External dependencies
|
13468 |
+
*/
|
13469 |
|
13470 |
+
/**
|
13471 |
+
* WordPress dependencies
|
13472 |
+
*/
|
13473 |
|
13474 |
+
// Disable reason: JSDoc linter doesn't seem to parse the union (`&`) correctly.
|
13475 |
|
13476 |
+
/* eslint-disable jsdoc/valid-types */
|
|
|
13477 |
|
13478 |
+
/** @typedef {{isPressed?: boolean} & import('react').ComponentPropsWithoutRef<'svg'>} SVGProps */
|
13479 |
|
13480 |
+
/* eslint-enable jsdoc/valid-types */
|
|
|
|
|
|
|
13481 |
|
13482 |
+
/**
|
13483 |
+
* @param {import('react').ComponentPropsWithoutRef<'circle'>} props
|
13484 |
+
*
|
13485 |
+
* @return {JSX.Element} Circle component
|
13486 |
+
*/
|
|
|
|
|
13487 |
|
13488 |
+
var Circle = function Circle(props) {
|
13489 |
+
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__["createElement"])('circle', props);
|
13490 |
+
};
|
13491 |
/**
|
13492 |
+
* @param {import('react').ComponentPropsWithoutRef<'g'>} props
|
13493 |
*
|
13494 |
+
* @return {JSX.Element} G component
|
13495 |
+
*/
|
13496 |
+
|
13497 |
+
var G = function G(props) {
|
13498 |
+
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__["createElement"])('g', props);
|
13499 |
+
};
|
13500 |
+
/**
|
13501 |
+
* @param {import('react').ComponentPropsWithoutRef<'path'>} props
|
13502 |
*
|
13503 |
+
* @return {JSX.Element} Path component
|
13504 |
+
*/
|
13505 |
+
|
13506 |
+
var Path = function Path(props) {
|
13507 |
+
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__["createElement"])('path', props);
|
13508 |
+
};
|
13509 |
+
/**
|
13510 |
+
* @param {import('react').ComponentPropsWithoutRef<'polygon'>} props
|
13511 |
*
|
13512 |
+
* @return {JSX.Element} Polygon component
|
13513 |
+
*/
|
13514 |
+
|
13515 |
+
var Polygon = function Polygon(props) {
|
13516 |
+
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__["createElement"])('polygon', props);
|
13517 |
+
};
|
13518 |
+
/**
|
13519 |
+
* @param {import('react').ComponentPropsWithoutRef<'rect'>} props
|
13520 |
*
|
13521 |
+
* @return {JSX.Element} Rect component
|
13522 |
+
*/
|
13523 |
+
|
13524 |
+
var Rect = function Rect(props) {
|
13525 |
+
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__["createElement"])('rect', props);
|
13526 |
+
};
|
13527 |
+
/**
|
13528 |
+
* @param {import('react').ComponentPropsWithoutRef<'defs'>} props
|
13529 |
*
|
13530 |
+
* @return {JSX.Element} Defs component
|
|
|
13531 |
*/
|
13532 |
+
|
13533 |
+
var Defs = function Defs(props) {
|
13534 |
+
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__["createElement"])('defs', props);
|
13535 |
+
};
|
13536 |
/**
|
13537 |
+
* @param {import('react').ComponentPropsWithoutRef<'radialGradient'>} props
|
|
|
13538 |
*
|
13539 |
+
* @return {JSX.Element} RadialGradient component
|
13540 |
+
*/
|
13541 |
+
|
13542 |
+
var RadialGradient = function RadialGradient(props) {
|
13543 |
+
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__["createElement"])('radialGradient', props);
|
13544 |
+
};
|
13545 |
+
/**
|
13546 |
+
* @param {import('react').ComponentPropsWithoutRef<'linearGradient'>} props
|
13547 |
*
|
13548 |
+
* @return {JSX.Element} LinearGradient component
|
13549 |
*/
|
13550 |
|
13551 |
+
var LinearGradient = function LinearGradient(props) {
|
13552 |
+
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__["createElement"])('linearGradient', props);
|
13553 |
+
};
|
13554 |
+
/**
|
13555 |
+
* @param {import('react').ComponentPropsWithoutRef<'stop'>} props
|
13556 |
+
*
|
13557 |
+
* @return {JSX.Element} Stop component
|
13558 |
+
*/
|
13559 |
+
|
13560 |
+
var Stop = function Stop(props) {
|
13561 |
+
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__["createElement"])('stop', props);
|
13562 |
+
};
|
13563 |
+
/**
|
13564 |
+
*
|
13565 |
+
* @param {SVGProps} props isPressed indicates whether the SVG should appear as pressed.
|
13566 |
+
* Other props will be passed through to svg component.
|
13567 |
+
*
|
13568 |
+
* @return {JSX.Element} Stop component
|
13569 |
+
*/
|
13570 |
+
|
13571 |
+
var SVG = function SVG(_ref) {
|
13572 |
+
var className = _ref.className,
|
13573 |
+
isPressed = _ref.isPressed,
|
13574 |
+
props = Object(_babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"])(_ref, ["className", "isPressed"]);
|
13575 |
+
|
13576 |
+
var appliedProps = _objectSpread({}, props, {
|
13577 |
+
className: classnames__WEBPACK_IMPORTED_MODULE_2___default()(className, {
|
13578 |
+
'is-pressed': isPressed
|
13579 |
+
}) || undefined,
|
13580 |
+
role: 'img',
|
13581 |
+
'aria-hidden': true,
|
13582 |
+
focusable: false
|
13583 |
+
}); // Disable reason: We need to have a way to render HTML tag for web.
|
13584 |
+
// eslint-disable-next-line react/forbid-elements
|
13585 |
+
|
13586 |
+
|
13587 |
+
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__["createElement"])("svg", appliedProps);
|
13588 |
+
};
|
13589 |
+
//# sourceMappingURL=index.js.map
|
13590 |
+
|
13591 |
+
/***/ }),
|
13592 |
+
|
13593 |
+
/***/ 39:
|
13594 |
+
/***/ (function(module, exports, __webpack_require__) {
|
13595 |
+
|
13596 |
+
var arrayWithoutHoles = __webpack_require__(215);
|
13597 |
+
|
13598 |
+
var iterableToArray = __webpack_require__(216);
|
13599 |
+
|
13600 |
+
var unsupportedIterableToArray = __webpack_require__(178);
|
13601 |
+
|
13602 |
+
var nonIterableSpread = __webpack_require__(217);
|
13603 |
+
|
13604 |
+
function _toConsumableArray(arr) {
|
13605 |
+
return arrayWithoutHoles(arr) || iterableToArray(arr) || unsupportedIterableToArray(arr) || nonIterableSpread();
|
13606 |
+
}
|
13607 |
+
|
13608 |
+
module.exports = _toConsumableArray;
|
13609 |
+
|
13610 |
+
/***/ }),
|
13611 |
+
|
13612 |
+
/***/ 4:
|
13613 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
13614 |
+
|
13615 |
+
"use strict";
|
13616 |
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _getPrototypeOf; });
|
13617 |
+
function _getPrototypeOf(o) {
|
13618 |
+
_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
|
13619 |
+
return o.__proto__ || Object.getPrototypeOf(o);
|
13620 |
+
};
|
13621 |
+
return _getPrototypeOf(o);
|
13622 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13623 |
|
13624 |
+
/***/ }),
|
13625 |
|
13626 |
+
/***/ 40:
|
13627 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
13628 |
|
13629 |
+
"use strict";
|
13630 |
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _typeof; });
|
13631 |
+
function _typeof(obj) {
|
13632 |
+
"@babel/helpers - typeof";
|
13633 |
+
|
13634 |
+
if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
|
13635 |
+
_typeof = function _typeof(obj) {
|
13636 |
+
return typeof obj;
|
13637 |
+
};
|
13638 |
+
} else {
|
13639 |
+
_typeof = function _typeof(obj) {
|
13640 |
+
return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
13641 |
+
};
|
13642 |
}
|
13643 |
|
13644 |
+
return _typeof(obj);
|
|
|
13645 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13646 |
|
13647 |
+
/***/ }),
|
13648 |
|
13649 |
+
/***/ 41:
|
13650 |
+
/***/ (function(module, exports) {
|
|
|
|
|
|
|
|
|
|
|
|
|
13651 |
|
13652 |
+
function _defineProperties(target, props) {
|
13653 |
+
for (var i = 0; i < props.length; i++) {
|
13654 |
+
var descriptor = props[i];
|
13655 |
+
descriptor.enumerable = descriptor.enumerable || false;
|
13656 |
+
descriptor.configurable = true;
|
13657 |
+
if ("value" in descriptor) descriptor.writable = true;
|
13658 |
+
Object.defineProperty(target, descriptor.key, descriptor);
|
13659 |
+
}
|
13660 |
+
}
|
13661 |
|
13662 |
+
function _createClass(Constructor, protoProps, staticProps) {
|
13663 |
+
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
13664 |
+
if (staticProps) _defineProperties(Constructor, staticProps);
|
13665 |
+
return Constructor;
|
13666 |
}
|
|
|
|
|
|
|
13667 |
|
13668 |
+
module.exports = _createClass;
|
|
|
|
|
|
|
13669 |
|
13670 |
+
/***/ }),
|
|
|
|
|
13671 |
|
13672 |
+
/***/ 419:
|
13673 |
+
/***/ (function(module, exports, __webpack_require__) {
|
13674 |
|
13675 |
+
"use strict";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13676 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13677 |
|
13678 |
+
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
|
13679 |
|
13680 |
+
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13681 |
|
13682 |
+
function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
|
|
|
|
|
|
|
|
|
|
|
|
|
13683 |
|
13684 |
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
|
|
|
13685 |
|
13686 |
+
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
13687 |
|
13688 |
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
13689 |
|
13690 |
+
var hoistNonReactStatic = __webpack_require__(453);
|
13691 |
+
var React = __webpack_require__(13);
|
13692 |
+
var ReactDOM = __webpack_require__(80);
|
|
|
|
|
13693 |
|
13694 |
+
module.exports = function enhanceWithClickOutside(WrappedComponent) {
|
13695 |
+
var componentName = WrappedComponent.displayName || WrappedComponent.name;
|
13696 |
|
13697 |
+
var EnhancedComponent = function (_React$Component) {
|
13698 |
+
_inherits(EnhancedComponent, _React$Component);
|
|
|
|
|
13699 |
|
13700 |
+
function EnhancedComponent(props) {
|
13701 |
+
_classCallCheck(this, EnhancedComponent);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13702 |
|
13703 |
+
var _this = _possibleConstructorReturn(this, (EnhancedComponent.__proto__ || Object.getPrototypeOf(EnhancedComponent)).call(this, props));
|
13704 |
|
13705 |
+
_this.handleClickOutside = _this.handleClickOutside.bind(_this);
|
13706 |
+
return _this;
|
13707 |
+
}
|
13708 |
+
|
13709 |
+
_createClass(EnhancedComponent, [{
|
13710 |
+
key: 'componentDidMount',
|
13711 |
+
value: function componentDidMount() {
|
13712 |
+
document.addEventListener('click', this.handleClickOutside, true);
|
13713 |
+
}
|
13714 |
+
}, {
|
13715 |
+
key: 'componentWillUnmount',
|
13716 |
+
value: function componentWillUnmount() {
|
13717 |
+
document.removeEventListener('click', this.handleClickOutside, true);
|
13718 |
+
}
|
13719 |
+
}, {
|
13720 |
+
key: 'handleClickOutside',
|
13721 |
+
value: function handleClickOutside(e) {
|
13722 |
+
var domNode = this.__domNode;
|
13723 |
+
if ((!domNode || !domNode.contains(e.target)) && this.__wrappedInstance && typeof this.__wrappedInstance.handleClickOutside === 'function') {
|
13724 |
+
this.__wrappedInstance.handleClickOutside(e);
|
13725 |
+
}
|
13726 |
+
}
|
13727 |
+
}, {
|
13728 |
+
key: 'render',
|
13729 |
+
value: function render() {
|
13730 |
+
var _this2 = this;
|
13731 |
|
13732 |
+
var _props = this.props,
|
13733 |
+
wrappedRef = _props.wrappedRef,
|
13734 |
+
rest = _objectWithoutProperties(_props, ['wrappedRef']);
|
13735 |
|
13736 |
+
return React.createElement(WrappedComponent, _extends({}, rest, {
|
13737 |
+
ref: function ref(c) {
|
13738 |
+
_this2.__wrappedInstance = c;
|
13739 |
+
_this2.__domNode = ReactDOM.findDOMNode(c);
|
13740 |
+
wrappedRef && wrappedRef(c);
|
13741 |
+
}
|
13742 |
+
}));
|
13743 |
+
}
|
13744 |
+
}]);
|
|
|
|
|
|
|
|
|
13745 |
|
13746 |
+
return EnhancedComponent;
|
13747 |
+
}(React.Component);
|
13748 |
|
13749 |
+
EnhancedComponent.displayName = 'clickOutside(' + componentName + ')';
|
|
|
|
|
13750 |
|
13751 |
+
return hoistNonReactStatic(EnhancedComponent, WrappedComponent);
|
13752 |
+
};
|
|
|
13753 |
|
13754 |
+
/***/ }),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13755 |
|
13756 |
+
/***/ 42:
|
13757 |
+
/***/ (function(module, exports) {
|
13758 |
|
13759 |
+
function _classCallCheck(instance, Constructor) {
|
13760 |
+
if (!(instance instanceof Constructor)) {
|
13761 |
+
throw new TypeError("Cannot call a class as a function");
|
13762 |
+
}
|
13763 |
}
|
13764 |
|
13765 |
+
module.exports = _classCallCheck;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13766 |
|
13767 |
+
/***/ }),
|
|
|
|
|
|
|
13768 |
|
13769 |
+
/***/ 420:
|
13770 |
+
/***/ (function(module, exports, __webpack_require__) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13771 |
|
13772 |
+
"use strict";
|
13773 |
+
var _extends=Object.assign||function(a){for(var c,b=1;b<arguments.length;b++)for(var d in c=arguments[b],c)Object.prototype.hasOwnProperty.call(c,d)&&(a[d]=c[d]);return a};Object.defineProperty(exports,'__esModule',{value:!0});exports.default=function(a){var b=a.size,c=b===void 0?24:b,d=a.onClick,e=a.icon,f=a.className,g=_objectWithoutProperties(a,['size','onClick','icon','className']),j=['gridicon','gridicons-pages',f,!1,!1,!1].filter(Boolean).join(' ');return _react2.default.createElement('svg',_extends({className:j,height:c,width:c,onClick:d},g,{xmlns:'http://www.w3.org/2000/svg',viewBox:'0 0 24 24'}),_react2.default.createElement('g',null,_react2.default.createElement('path',{d:'M16 8H8V6h8v2zm0 2H8v2h8v-2zm4-6v12l-6 6H6c-1.105 0-2-.895-2-2V4c0-1.105.895-2 2-2h12c1.105 0 2 .895 2 2zm-2 10V4H6v16h6v-4c0-1.105.895-2 2-2h4z'})))};var _react=__webpack_require__(13),_react2=_interopRequireDefault(_react);function _interopRequireDefault(a){return a&&a.__esModule?a:{default:a}}function _objectWithoutProperties(a,b){var d={};for(var c in a)0<=b.indexOf(c)||Object.prototype.hasOwnProperty.call(a,c)&&(d[c]=a[c]);return d}module.exports=exports['default'];
|
|
|
|
|
13774 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13775 |
|
13776 |
+
/***/ }),
|
13777 |
|
13778 |
+
/***/ 421:
|
13779 |
+
/***/ (function(module, exports, __webpack_require__) {
|
|
|
|
|
13780 |
|
13781 |
+
"use strict";
|
13782 |
+
var _extends=Object.assign||function(a){for(var c,b=1;b<arguments.length;b++)for(var d in c=arguments[b],c)Object.prototype.hasOwnProperty.call(c,d)&&(a[d]=c[d]);return a};Object.defineProperty(exports,'__esModule',{value:!0});exports.default=function(a){var b=a.size,c=b===void 0?24:b,d=a.onClick,e=a.icon,f=a.className,g=_objectWithoutProperties(a,['size','onClick','icon','className']),j=['gridicon','gridicons-cross-small',f,!1,!1,!1].filter(Boolean).join(' ');return _react2.default.createElement('svg',_extends({className:j,height:c,width:c,onClick:d},g,{xmlns:'http://www.w3.org/2000/svg',viewBox:'0 0 24 24'}),_react2.default.createElement('g',null,_react2.default.createElement('path',{d:'M17.705 7.705l-1.41-1.41L12 10.59 7.705 6.295l-1.41 1.41L10.59 12l-4.295 4.295 1.41 1.41L12 13.41l4.295 4.295 1.41-1.41L13.41 12l4.295-4.295z'})))};var _react=__webpack_require__(13),_react2=_interopRequireDefault(_react);function _interopRequireDefault(a){return a&&a.__esModule?a:{default:a}}function _objectWithoutProperties(a,b){var d={};for(var c in a)0<=b.indexOf(c)||Object.prototype.hasOwnProperty.call(a,c)&&(d[c]=a[c]);return d}module.exports=exports['default'];
|
|
|
|
|
13783 |
|
|
|
13784 |
|
13785 |
/***/ }),
|
13786 |
|
13787 |
+
/***/ 422:
|
13788 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
13789 |
|
13790 |
"use strict";
|
13791 |
+
/* WEBPACK VAR INJECTION */(function(process) {/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0);
|
13792 |
+
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
|
13793 |
+
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(2);
|
13794 |
+
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_1__);
|
13795 |
+
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7);
|
13796 |
+
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_2__);
|
13797 |
+
/* harmony import */ var _wordpress_a11y__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(132);
|
13798 |
+
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(3);
|
13799 |
+
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__);
|
13800 |
+
/* harmony import */ var _wordpress_warning__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(90);
|
13801 |
+
/* harmony import */ var ___WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(69);
|
|
|
13802 |
|
|
|
|
|
13803 |
|
13804 |
+
/**
|
13805 |
+
* External dependencies
|
13806 |
+
*/
|
13807 |
|
|
|
|
|
13808 |
|
13809 |
+
/**
|
13810 |
+
* WordPress dependencies
|
13811 |
+
*/
|
13812 |
|
|
|
|
|
|
|
|
|
13813 |
|
|
|
|
|
13814 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13815 |
|
13816 |
|
13817 |
+
/**
|
13818 |
+
* Internal dependencies
|
13819 |
+
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13820 |
|
13821 |
|
13822 |
+
var NOTICE_TIMEOUT = 10000;
|
13823 |
+
/** @typedef {import('@wordpress/element').WPElement} WPElement */
|
13824 |
|
13825 |
+
/**
|
13826 |
+
* Custom hook which announces the message with the given politeness, if a
|
13827 |
+
* valid message is provided.
|
13828 |
+
*
|
13829 |
+
* @param {string|WPElement} [message] Message to announce.
|
13830 |
+
* @param {'polite'|'assertive'} politeness Politeness to announce.
|
13831 |
+
*/
|
13832 |
|
13833 |
+
function useSpokenMessage(message, politeness) {
|
13834 |
+
var spokenMessage = typeof message === 'string' ? message : Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["renderToString"])(message);
|
13835 |
+
Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["useEffect"])(function () {
|
13836 |
+
if (spokenMessage) {
|
13837 |
+
Object(_wordpress_a11y__WEBPACK_IMPORTED_MODULE_3__[/* speak */ "a"])(spokenMessage, politeness);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13838 |
}
|
13839 |
+
}, [spokenMessage, politeness]);
|
13840 |
}
|
13841 |
|
13842 |
+
function Snackbar(_ref, ref) {
|
13843 |
+
var className = _ref.className,
|
13844 |
+
children = _ref.children,
|
13845 |
+
_ref$spokenMessage = _ref.spokenMessage,
|
13846 |
+
spokenMessage = _ref$spokenMessage === void 0 ? children : _ref$spokenMessage,
|
13847 |
+
_ref$politeness = _ref.politeness,
|
13848 |
+
politeness = _ref$politeness === void 0 ? 'polite' : _ref$politeness,
|
13849 |
+
_ref$actions = _ref.actions,
|
13850 |
+
actions = _ref$actions === void 0 ? [] : _ref$actions,
|
13851 |
+
_ref$onRemove = _ref.onRemove,
|
13852 |
+
onRemove = _ref$onRemove === void 0 ? lodash__WEBPACK_IMPORTED_MODULE_1__["noop"] : _ref$onRemove;
|
13853 |
+
useSpokenMessage(spokenMessage, politeness);
|
13854 |
+
Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["useEffect"])(function () {
|
13855 |
+
var timeoutHandle = setTimeout(function () {
|
13856 |
+
onRemove();
|
13857 |
+
}, NOTICE_TIMEOUT);
|
13858 |
+
return function () {
|
13859 |
+
return clearTimeout(timeoutHandle);
|
13860 |
+
};
|
13861 |
+
}, []);
|
13862 |
+
var classes = classnames__WEBPACK_IMPORTED_MODULE_2___default()(className, 'components-snackbar');
|
13863 |
+
|
13864 |
+
if (actions && actions.length > 1) {
|
13865 |
+
// we need to inform developers that snackbar only accepts 1 action
|
13866 |
+
typeof process !== "undefined" && process.env && "production" !== "production" ? Object(_wordpress_warning__WEBPACK_IMPORTED_MODULE_5__[/* default */ "a"])('Snackbar can only have 1 action, use Notice if your message require many messages') : void 0; // return first element only while keeping it inside an array
|
13867 |
+
|
13868 |
+
actions = [actions[0]];
|
13869 |
+
}
|
13870 |
+
|
13871 |
+
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("div", {
|
13872 |
+
ref: ref,
|
13873 |
+
className: classes,
|
13874 |
+
onClick: onRemove,
|
13875 |
+
tabIndex: "0",
|
13876 |
+
role: "button",
|
13877 |
+
onKeyPress: onRemove,
|
13878 |
+
"aria-label": Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__["__"])('Dismiss this notice')
|
13879 |
+
}, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("div", {
|
13880 |
+
className: "components-snackbar__content"
|
13881 |
+
}, children, actions.map(function (_ref2, index) {
|
13882 |
+
var label = _ref2.label,
|
13883 |
+
_onClick = _ref2.onClick,
|
13884 |
+
url = _ref2.url;
|
13885 |
+
return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(___WEBPACK_IMPORTED_MODULE_6__[/* default */ "a"], {
|
13886 |
+
key: index,
|
13887 |
+
href: url,
|
13888 |
+
isTertiary: true,
|
13889 |
+
onClick: function onClick(event) {
|
13890 |
+
event.stopPropagation();
|
13891 |
|
13892 |
+
if (_onClick) {
|
13893 |
+
_onClick(event);
|
|
|
|
|
|
|
|
|
|
|
|
|
13894 |
}
|
13895 |
+
},
|
13896 |
+
className: "components-snackbar__action"
|
13897 |
+
}, label);
|
13898 |
+
})));
|
|
|
|
|
13899 |
}
|
13900 |
|
13901 |
+
/* harmony default export */ __webpack_exports__["a"] = (Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["forwardRef"])(Snackbar));
|
13902 |
+
//# sourceMappingURL=index.js.map
|
13903 |
+
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(35)))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13904 |
|
13905 |
+
/***/ }),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13906 |
|
13907 |
+
/***/ 423:
|
13908 |
+
/***/ (function(module, exports, __webpack_require__) {
|
13909 |
|
13910 |
+
"use strict";
|
13911 |
+
/* WEBPACK VAR INJECTION */(function(global) {// @flow
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13912 |
|
|
|
13913 |
|
13914 |
+
var key = '__global_unique_id__';
|
|
|
|
|
13915 |
|
13916 |
+
module.exports = function() {
|
13917 |
+
return global[key] = (global[key] || 0) + 1;
|
|
|
13918 |
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13919 |
|
13920 |
+
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(60)))
|
13921 |
|
13922 |
/***/ }),
|
13923 |
|
13924 |
+
/***/ 424:
|
13925 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
13926 |
|
13927 |
"use strict";
|
13928 |
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return symbolObservablePonyfill; });
|
13929 |
+
function symbolObservablePonyfill(root) {
|
13930 |
+
var result;
|
13931 |
+
var Symbol = root.Symbol;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13932 |
|
13933 |
+
if (typeof Symbol === 'function') {
|
13934 |
+
if (Symbol.observable) {
|
13935 |
+
result = Symbol.observable;
|
13936 |
+
} else {
|
13937 |
+
result = Symbol('observable');
|
13938 |
+
Symbol.observable = result;
|
13939 |
+
}
|
13940 |
+
} else {
|
13941 |
+
result = '@@observable';
|
13942 |
+
}
|
13943 |
|
13944 |
+
return result;
|
13945 |
+
};
|
|
|
|
|
|
|
|
|
13946 |
|
|
|
|
|
13947 |
|
13948 |
/***/ }),
|
13949 |
|
13950 |
+
/***/ 43:
|
13951 |
+
/***/ (function(module, exports, __webpack_require__) {
|
13952 |
|
13953 |
+
var setPrototypeOf = __webpack_require__(156);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13954 |
|
13955 |
+
function _inherits(subClass, superClass) {
|
13956 |
+
if (typeof superClass !== "function" && superClass !== null) {
|
13957 |
+
throw new TypeError("Super expression must either be null or a function");
|
|
|
13958 |
}
|
13959 |
+
|
13960 |
+
subClass.prototype = Object.create(superClass && superClass.prototype, {
|
13961 |
+
constructor: {
|
13962 |
+
value: subClass,
|
13963 |
+
writable: true,
|
13964 |
+
configurable: true
|
13965 |
+
}
|
13966 |
+
});
|
13967 |
+
if (superClass) setPrototypeOf(subClass, superClass);
|
13968 |
}
|
13969 |
|
13970 |
+
module.exports = _inherits;
|
|
|
|
|
|
|
|
|
|
|
13971 |
|
13972 |
+
/***/ }),
|
|
|
|
|
13973 |
|
13974 |
+
/***/ 430:
|
13975 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
|
13976 |
|
13977 |
+
"use strict";
|
|
|
|
|
|
|
13978 |
|
13979 |
+
// UNUSED EXPORTS: NavigableMenu
|
13980 |
|
13981 |
+
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/extends.js
|
13982 |
+
var esm_extends = __webpack_require__(12);
|
13983 |
|
13984 |
+
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js
|
13985 |
+
var objectWithoutProperties = __webpack_require__(14);
|
13986 |
|
13987 |
+
// EXTERNAL MODULE: external {"this":["wp","element"]}
|
13988 |
+
var external_this_wp_element_ = __webpack_require__(0);
|
13989 |
|
13990 |
+
// EXTERNAL MODULE: external "lodash"
|
13991 |
+
var external_lodash_ = __webpack_require__(2);
|
13992 |
|
13993 |
+
// EXTERNAL MODULE: ./node_modules/@wordpress/components/node_modules/@wordpress/keycodes/build-module/index.js + 1 modules
|
13994 |
+
var build_module = __webpack_require__(32);
|
13995 |
|
13996 |
+
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/classCallCheck.js
|
13997 |
+
var classCallCheck = __webpack_require__(9);
|
|
|
|
|
|
|
|
|
13998 |
|
13999 |
+
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/createClass.js
|
14000 |
+
var createClass = __webpack_require__(8);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14001 |
|
14002 |
+
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js
|
14003 |
+
var assertThisInitialized = __webpack_require__(5);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14004 |
|
14005 |
+
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js
|
14006 |
+
var possibleConstructorReturn = __webpack_require__(11);
|
14007 |
|
14008 |
+
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js
|
14009 |
+
var getPrototypeOf = __webpack_require__(4);
|
14010 |
|
14011 |
+
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/inherits.js + 1 modules
|
14012 |
+
var inherits = __webpack_require__(10);
|
14013 |
|
14014 |
+
// EXTERNAL MODULE: ./node_modules/@wordpress/components/node_modules/@wordpress/dom/build-module/index.js + 2 modules
|
14015 |
+
var dom_build_module = __webpack_require__(49);
|
|
|
|
|
|
|
14016 |
|
14017 |
+
// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/navigable-container/container.js
|
14018 |
|
|
|
14019 |
|
|
|
|
|
14020 |
|
|
|
14021 |
|
|
|
|
|
|
|
|
|
14022 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14023 |
|
|
|
|
|
|
|
14024 |
|
|
|
14025 |
|
14026 |
|
|
|
14027 |
|
14028 |
+
function _createSuper(Derived) { return function () { var Super = Object(getPrototypeOf["a" /* default */])(Derived), result; if (_isNativeReflectConstruct()) { var NewTarget = Object(getPrototypeOf["a" /* default */])(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return Object(possibleConstructorReturn["a" /* default */])(this, result); }; }
|
14029 |
+
|
14030 |
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
|
14031 |
|
|
|
|
|
|
|
|
|
|
|
14032 |
/**
|
14033 |
+
* External dependencies
|
14034 |
*/
|
14035 |
|
14036 |
/**
|
14037 |
+
* WordPress dependencies
|
|
|
|
|
|
|
14038 |
*/
|
14039 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14040 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14041 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14042 |
|
14043 |
+
function cycleValue(value, total, offset) {
|
14044 |
+
var nextValue = value + offset;
|
14045 |
|
14046 |
+
if (nextValue < 0) {
|
14047 |
+
return total + nextValue;
|
14048 |
+
} else if (nextValue >= total) {
|
14049 |
+
return nextValue - total;
|
14050 |
+
}
|
14051 |
|
14052 |
+
return nextValue;
|
|
|
14053 |
}
|
|
|
14054 |
|
14055 |
+
var container_NavigableContainer = /*#__PURE__*/function (_Component) {
|
14056 |
+
Object(inherits["a" /* default */])(NavigableContainer, _Component);
|
14057 |
|
14058 |
+
var _super = _createSuper(NavigableContainer);
|
|
|
14059 |
|
14060 |
+
function NavigableContainer() {
|
14061 |
+
var _this;
|
14062 |
+
|
14063 |
+
Object(classCallCheck["a" /* default */])(this, NavigableContainer);
|
14064 |
+
|
14065 |
+
_this = _super.apply(this, arguments);
|
14066 |
+
_this.onKeyDown = _this.onKeyDown.bind(Object(assertThisInitialized["a" /* default */])(_this));
|
14067 |
+
_this.bindContainer = _this.bindContainer.bind(Object(assertThisInitialized["a" /* default */])(_this));
|
14068 |
+
_this.getFocusableContext = _this.getFocusableContext.bind(Object(assertThisInitialized["a" /* default */])(_this));
|
14069 |
+
_this.getFocusableIndex = _this.getFocusableIndex.bind(Object(assertThisInitialized["a" /* default */])(_this));
|
14070 |
+
return _this;
|
|
|
14071 |
}
|
14072 |
|
14073 |
+
Object(createClass["a" /* default */])(NavigableContainer, [{
|
14074 |
+
key: "componentDidMount",
|
14075 |
+
value: function componentDidMount() {
|
14076 |
+
// We use DOM event listeners instead of React event listeners
|
14077 |
+
// because we want to catch events from the underlying DOM tree
|
14078 |
+
// The React Tree can be different from the DOM tree when using
|
14079 |
+
// portals. Block Toolbars for instance are rendered in a separate
|
14080 |
+
// React Trees.
|
14081 |
+
this.container.addEventListener('keydown', this.onKeyDown);
|
14082 |
+
this.container.addEventListener('focus', this.onFocus);
|
14083 |
+
}
|
14084 |
+
}, {
|
14085 |
+
key: "componentWillUnmount",
|
14086 |
+
value: function componentWillUnmount() {
|
14087 |
+
this.container.removeEventListener('keydown', this.onKeyDown);
|
14088 |
+
this.container.removeEventListener('focus', this.onFocus);
|
14089 |
+
}
|
14090 |
+
}, {
|
14091 |
+
key: "bindContainer",
|
14092 |
+
value: function bindContainer(ref) {
|
14093 |
+
var forwardedRef = this.props.forwardedRef;
|
14094 |
+
this.container = ref;
|
14095 |
|
14096 |
+
if (Object(external_lodash_["isFunction"])(forwardedRef)) {
|
14097 |
+
forwardedRef(ref);
|
14098 |
+
} else if (forwardedRef && 'current' in forwardedRef) {
|
14099 |
+
forwardedRef.current = ref;
|
14100 |
+
}
|
14101 |
+
}
|
14102 |
+
}, {
|
14103 |
+
key: "getFocusableContext",
|
14104 |
+
value: function getFocusableContext(target) {
|
14105 |
+
var onlyBrowserTabstops = this.props.onlyBrowserTabstops;
|
14106 |
+
var finder = onlyBrowserTabstops ? dom_build_module["a" /* focus */].tabbable : dom_build_module["a" /* focus */].focusable;
|
14107 |
+
var focusables = finder.find(this.container);
|
14108 |
+
var index = this.getFocusableIndex(focusables, target);
|
14109 |
|
14110 |
+
if (index > -1 && target) {
|
14111 |
+
return {
|
14112 |
+
index: index,
|
14113 |
+
target: target,
|
14114 |
+
focusables: focusables
|
14115 |
+
};
|
14116 |
+
}
|
14117 |
|
14118 |
+
return null;
|
14119 |
+
}
|
14120 |
+
}, {
|
14121 |
+
key: "getFocusableIndex",
|
14122 |
+
value: function getFocusableIndex(focusables, target) {
|
14123 |
+
var directIndex = focusables.indexOf(target);
|
|
|
14124 |
|
14125 |
+
if (directIndex !== -1) {
|
14126 |
+
return directIndex;
|
14127 |
+
}
|
14128 |
+
}
|
14129 |
+
}, {
|
14130 |
+
key: "onKeyDown",
|
14131 |
+
value: function onKeyDown(event) {
|
14132 |
+
if (this.props.onKeyDown) {
|
14133 |
+
this.props.onKeyDown(event);
|
14134 |
+
}
|
14135 |
|
14136 |
+
var getFocusableContext = this.getFocusableContext;
|
14137 |
+
var _this$props = this.props,
|
14138 |
+
_this$props$cycle = _this$props.cycle,
|
14139 |
+
cycle = _this$props$cycle === void 0 ? true : _this$props$cycle,
|
14140 |
+
eventToOffset = _this$props.eventToOffset,
|
14141 |
+
_this$props$onNavigat = _this$props.onNavigate,
|
14142 |
+
onNavigate = _this$props$onNavigat === void 0 ? external_lodash_["noop"] : _this$props$onNavigat,
|
14143 |
+
stopNavigationEvents = _this$props.stopNavigationEvents;
|
14144 |
+
var offset = eventToOffset(event); // eventToOffset returns undefined if the event is not handled by the component
|
14145 |
|
14146 |
+
if (offset !== undefined && stopNavigationEvents) {
|
14147 |
+
// Prevents arrow key handlers bound to the document directly interfering
|
14148 |
+
event.stopImmediatePropagation(); // When navigating a collection of items, prevent scroll containers
|
14149 |
+
// from scrolling.
|
14150 |
|
14151 |
+
if (event.target.getAttribute('role') === 'menuitem') {
|
14152 |
+
event.preventDefault();
|
14153 |
+
}
|
14154 |
+
}
|
14155 |
|
14156 |
+
if (!offset) {
|
14157 |
+
return;
|
14158 |
+
}
|
14159 |
|
14160 |
+
var context = getFocusableContext(document.activeElement);
|
14161 |
|
14162 |
+
if (!context) {
|
14163 |
+
return;
|
14164 |
+
}
|
14165 |
|
14166 |
+
var index = context.index,
|
14167 |
+
focusables = context.focusables;
|
14168 |
+
var nextIndex = cycle ? cycleValue(index, focusables.length, offset) : index + offset;
|
14169 |
+
|
14170 |
+
if (nextIndex >= 0 && nextIndex < focusables.length) {
|
14171 |
+
focusables[nextIndex].focus();
|
14172 |
+
onNavigate(nextIndex, focusables[nextIndex]);
|
14173 |
+
}
|
14174 |
+
}
|
14175 |
+
}, {
|
14176 |
+
key: "render",
|
14177 |
+
value: function render() {
|
14178 |
+
var _this$props2 = this.props,
|
14179 |
+
children = _this$props2.children,
|
14180 |
+
props = Object(objectWithoutProperties["a" /* default */])(_this$props2, ["children"]);
|
14181 |
+
|
14182 |
+
return Object(external_this_wp_element_["createElement"])("div", Object(esm_extends["a" /* default */])({
|
14183 |
+
ref: this.bindContainer
|
14184 |
+
}, Object(external_lodash_["omit"])(props, ['stopNavigationEvents', 'eventToOffset', 'onNavigate', 'onKeyDown', 'cycle', 'onlyBrowserTabstops', 'forwardedRef'])), children);
|
14185 |
+
}
|
14186 |
+
}]);
|
14187 |
+
|
14188 |
+
return NavigableContainer;
|
14189 |
+
}(external_this_wp_element_["Component"]);
|
14190 |
|
14191 |
+
var container_forwardedNavigableContainer = function forwardedNavigableContainer(props, ref) {
|
14192 |
+
return Object(external_this_wp_element_["createElement"])(container_NavigableContainer, Object(esm_extends["a" /* default */])({}, props, {
|
14193 |
+
forwardedRef: ref
|
14194 |
+
}));
|
14195 |
+
};
|
14196 |
+
|
14197 |
+
container_forwardedNavigableContainer.displayName = 'NavigableContainer';
|
14198 |
+
/* harmony default export */ var container = (Object(external_this_wp_element_["forwardRef"])(container_forwardedNavigableContainer));
|
14199 |
+
//# sourceMappingURL=container.js.map
|
14200 |
+
// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/navigable-container/menu.js
|
14201 |
|
14202 |
|
|
|
14203 |
|
|
|
14204 |
|
14205 |
/**
|
14206 |
* External dependencies
|
14207 |
*/
|
14208 |
|
14209 |
/**
|
14210 |
+
* WordPress dependencies
|
14211 |
*/
|
14212 |
|
14213 |
+
|
14214 |
+
|
14215 |
/**
|
14216 |
+
* Internal dependencies
|
|
|
|
|
|
|
14217 |
*/
|
14218 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14219 |
|
14220 |
+
function NavigableMenu(_ref, ref) {
|
14221 |
+
var _ref$role = _ref.role,
|
14222 |
+
role = _ref$role === void 0 ? 'menu' : _ref$role,
|
14223 |
+
_ref$orientation = _ref.orientation,
|
14224 |
+
orientation = _ref$orientation === void 0 ? 'vertical' : _ref$orientation,
|
14225 |
+
rest = Object(objectWithoutProperties["a" /* default */])(_ref, ["role", "orientation"]);
|
|
|
|
|
|
|
|
|
14226 |
|
14227 |
+
var eventToOffset = function eventToOffset(evt) {
|
14228 |
+
var keyCode = evt.keyCode;
|
14229 |
+
var next = [build_module["a" /* DOWN */]];
|
14230 |
+
var previous = [build_module["f" /* UP */]];
|
|
|
|
|
14231 |
|
14232 |
+
if (orientation === 'horizontal') {
|
14233 |
+
next = [build_module["d" /* RIGHT */]];
|
14234 |
+
previous = [build_module["c" /* LEFT */]];
|
|
|
|
|
|
|
|
|
|
|
14235 |
}
|
14236 |
|
14237 |
+
if (orientation === 'both') {
|
14238 |
+
next = [build_module["d" /* RIGHT */], build_module["a" /* DOWN */]];
|
14239 |
+
previous = [build_module["c" /* LEFT */], build_module["f" /* UP */]];
|
|
|
|
|
|
|
|
|
14240 |
}
|
14241 |
|
14242 |
+
if (Object(external_lodash_["includes"])(next, keyCode)) {
|
14243 |
+
return 1;
|
14244 |
+
} else if (Object(external_lodash_["includes"])(previous, keyCode)) {
|
14245 |
+
return -1;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14246 |
}
|
14247 |
+
};
|
14248 |
|
14249 |
+
return Object(external_this_wp_element_["createElement"])(container, Object(esm_extends["a" /* default */])({
|
14250 |
+
ref: ref,
|
14251 |
+
stopNavigationEvents: true,
|
14252 |
+
onlyBrowserTabstops: false,
|
14253 |
+
role: role,
|
14254 |
+
"aria-orientation": role === 'presentation' ? null : orientation,
|
14255 |
+
eventToOffset: eventToOffset
|
14256 |
+
}, rest));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14257 |
}
|
14258 |
+
/* harmony default export */ var menu = __webpack_exports__["a"] = (Object(external_this_wp_element_["forwardRef"])(NavigableMenu));
|
14259 |
+
//# sourceMappingURL=menu.js.map
|
|
|
|
|
|
|
|
|
14260 |
|
14261 |
+
/***/ }),
|
|
|
|
|
|
|
14262 |
|
14263 |
+
/***/ 44:
|
14264 |
+
/***/ (function(module, exports) {
|
|
|
14265 |
|
14266 |
+
(function() { module.exports = this["wp"]["hooks"]; }());
|
|
|
14267 |
|
14268 |
/***/ }),
|
14269 |
|
14270 |
+
/***/ 446:
|
14271 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
14272 |
|
14273 |
"use strict";
|
14274 |
+
__webpack_require__.r(__webpack_exports__);
|
14275 |
+
/* WEBPACK VAR INJECTION */(function(global) {/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0);
|
14276 |
+
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
|
14277 |
+
/* harmony import */ var _wordpress_notices__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(725);
|
14278 |
+
/* harmony import */ var _stylesheets_index_scss__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(449);
|
14279 |
+
/* harmony import */ var _stylesheets_index_scss__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_stylesheets_index_scss__WEBPACK_IMPORTED_MODULE_2__);
|
14280 |
+
/* harmony import */ var _layout__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(203);
|
14281 |
+
/* harmony import */ var wc_api_wp_data_store__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(724);
|
14282 |
+
/* harmony import */ var _woocommerce_data__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(48);
|
14283 |
+
/* harmony import */ var _woocommerce_data__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_woocommerce_data__WEBPACK_IMPORTED_MODULE_5__);
|
14284 |
|
14285 |
|
14286 |
/**
|
14287 |
+
* External dependencies
|
14288 |
*/
|
|
|
|
|
|
|
|
|
14289 |
|
|
|
|
|
|
|
14290 |
|
14291 |
/**
|
14292 |
+
* Internal dependencies
|
|
|
|
|
|
|
|
|
|
|
|
|
14293 |
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14294 |
|
14295 |
|
|
|
|
|
|
|
14296 |
|
|
|
|
|
|
|
|
|
|
|
14297 |
|
14298 |
+
// Modify webpack pubilcPath at runtime based on location of WordPress Plugin.
|
14299 |
+
// eslint-disable-next-line no-undef,camelcase
|
14300 |
|
14301 |
+
__webpack_require__.p = global.wcAdminAssets.path;
|
14302 |
+
var appRoot = document.getElementById('root');
|
14303 |
+
var settingsGroup = 'wc_admin';
|
14304 |
+
var hydrateUser = window.wcSettings.currentUserData;
|
14305 |
|
14306 |
+
if (appRoot) {
|
14307 |
+
var HydratedPageLayout = Object(_woocommerce_data__WEBPACK_IMPORTED_MODULE_5__["withSettingsHydration"])(settingsGroup, window.wcSettings)(_layout__WEBPACK_IMPORTED_MODULE_3__[/* PageLayout */ "b"]);
|
14308 |
+
var hydrateSettings = window.wcSettings.preloadSettings && window.wcSettings.preloadSettings.general;
|
14309 |
|
14310 |
+
if (hydrateSettings) {
|
14311 |
+
HydratedPageLayout = Object(_woocommerce_data__WEBPACK_IMPORTED_MODULE_5__["withSettingsHydration"])('general', {
|
14312 |
+
general: window.wcSettings.preloadSettings.general
|
14313 |
+
})(HydratedPageLayout);
|
|
|
|
|
|
|
|
|
|
|
14314 |
}
|
14315 |
|
14316 |
+
if (hydrateUser) {
|
14317 |
+
HydratedPageLayout = Object(_woocommerce_data__WEBPACK_IMPORTED_MODULE_5__["withCurrentUserHydration"])(hydrateUser)(HydratedPageLayout);
|
|
|
|
|
14318 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14319 |
|
14320 |
+
Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["render"])(Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(HydratedPageLayout, null), appRoot);
|
14321 |
+
} else {
|
14322 |
+
var embeddedRoot = document.getElementById('woocommerce-embedded-root');
|
14323 |
+
var HydratedEmbedLayout = Object(_woocommerce_data__WEBPACK_IMPORTED_MODULE_5__["withSettingsHydration"])(settingsGroup, window.wcSettings)(_layout__WEBPACK_IMPORTED_MODULE_3__[/* EmbedLayout */ "a"]);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14324 |
|
14325 |
+
if (hydrateUser) {
|
14326 |
+
HydratedEmbedLayout = Object(_woocommerce_data__WEBPACK_IMPORTED_MODULE_5__["withCurrentUserHydration"])(hydrateUser)(HydratedEmbedLayout);
|
14327 |
+
} // Render the header.
|
14328 |
|
14329 |
|
14330 |
+
Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["render"])(Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(HydratedEmbedLayout, null), embeddedRoot);
|
14331 |
+
embeddedRoot.classList.remove('is-embed-loading'); // Render notices just above the WP content div.
|
14332 |
|
14333 |
+
var wpBody = document.getElementById('wpbody-content');
|
14334 |
+
var wrap = wpBody.querySelector('.wrap.woocommerce') || wpBody.querySelector('[class="wrap"]');
|
14335 |
+
var noticeContainer = document.createElement('div');
|
14336 |
+
Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["render"])(Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("div", {
|
14337 |
+
className: "woocommerce-layout"
|
14338 |
+
}, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_layout__WEBPACK_IMPORTED_MODULE_3__[/* PrimaryLayout */ "c"], null)), wpBody.insertBefore(noticeContainer, wrap));
|
14339 |
+
}
|
14340 |
+
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(60)))
|
14341 |
|
14342 |
+
/***/ }),
|
14343 |
|
14344 |
+
/***/ 448:
|
14345 |
+
/***/ (function(module, exports, __webpack_require__) {
|
14346 |
|
14347 |
/**
|
14348 |
+
* Copyright (c) 2014-present, Facebook, Inc.
|
14349 |
+
*
|
14350 |
+
* This source code is licensed under the MIT license found in the
|
14351 |
+
* LICENSE file in the root directory of this source tree.
|
14352 |
*/
|
14353 |
|
14354 |
+
var runtime = (function (exports) {
|
14355 |
+
"use strict";
|
14356 |
|
14357 |
+
var Op = Object.prototype;
|
14358 |
+
var hasOwn = Op.hasOwnProperty;
|
14359 |
+
var undefined; // More compressible than void 0.
|
14360 |
+
var $Symbol = typeof Symbol === "function" ? Symbol : {};
|
14361 |
+
var iteratorSymbol = $Symbol.iterator || "@@iterator";
|
14362 |
+
var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator";
|
14363 |
+
var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
|
14364 |
|
14365 |
+
function wrap(innerFn, outerFn, self, tryLocsList) {
|
14366 |
+
// If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.
|
14367 |
+
var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;
|
14368 |
+
var generator = Object.create(protoGenerator.prototype);
|
14369 |
+
var context = new Context(tryLocsList || []);
|
14370 |
|
14371 |
+
// The ._invoke method unifies the implementations of the .next,
|
14372 |
+
// .throw, and .return methods.
|
14373 |
+
generator._invoke = makeInvokeMethod(innerFn, self, context);
|
14374 |
|
14375 |
+
return generator;
|
14376 |
+
}
|
14377 |
+
exports.wrap = wrap;
|
14378 |
|
14379 |
+
// Try/catch helper to minimize deoptimizations. Returns a completion
|
14380 |
+
// record like context.tryEntries[i].completion. This interface could
|
14381 |
+
// have been (and was previously) designed to take a closure to be
|
14382 |
+
// invoked without arguments, but in all the cases we care about we
|
14383 |
+
// already have an existing method we want to call, so there's no need
|
14384 |
+
// to create a new function object. We can even get away with assuming
|
14385 |
+
// the method takes exactly one argument, since that happens to be true
|
14386 |
+
// in every case, so we don't have to touch the arguments object. The
|
14387 |
+
// only additional allocation required is the completion record, which
|
14388 |
+
// has a stable shape and so hopefully should be cheap to allocate.
|
14389 |
+
function tryCatch(fn, obj, arg) {
|
14390 |
+
try {
|
14391 |
+
return { type: "normal", arg: fn.call(obj, arg) };
|
14392 |
+
} catch (err) {
|
14393 |
+
return { type: "throw", arg: err };
|
14394 |
+
}
|
14395 |
+
}
|
14396 |
|
14397 |
+
var GenStateSuspendedStart = "suspendedStart";
|
14398 |
+
var GenStateSuspendedYield = "suspendedYield";
|
14399 |
+
var GenStateExecuting = "executing";
|
14400 |
+
var GenStateCompleted = "completed";
|
14401 |
|
14402 |
+
// Returning this object from the innerFn has the same effect as
|
14403 |
+
// breaking out of the dispatch switch statement.
|
14404 |
+
var ContinueSentinel = {};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14405 |
|
14406 |
+
// Dummy constructor functions that we use as the .constructor and
|
14407 |
+
// .constructor.prototype properties for functions that return Generator
|
14408 |
+
// objects. For full spec compliance, you may wish to configure your
|
14409 |
+
// minifier not to mangle the names of these two functions.
|
14410 |
+
function Generator() {}
|
14411 |
+
function GeneratorFunction() {}
|
14412 |
+
function GeneratorFunctionPrototype() {}
|
14413 |
|
14414 |
+
// This is a polyfill for %IteratorPrototype% for environments that
|
14415 |
+
// don't natively support it.
|
14416 |
+
var IteratorPrototype = {};
|
14417 |
+
IteratorPrototype[iteratorSymbol] = function () {
|
14418 |
+
return this;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14419 |
};
|
14420 |
|
14421 |
+
var getProto = Object.getPrototypeOf;
|
14422 |
+
var NativeIteratorPrototype = getProto && getProto(getProto(values([])));
|
14423 |
+
if (NativeIteratorPrototype &&
|
14424 |
+
NativeIteratorPrototype !== Op &&
|
14425 |
+
hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {
|
14426 |
+
// This environment has a native %IteratorPrototype%; use it instead
|
14427 |
+
// of the polyfill.
|
14428 |
+
IteratorPrototype = NativeIteratorPrototype;
|
14429 |
+
}
|
14430 |
|
14431 |
+
var Gp = GeneratorFunctionPrototype.prototype =
|
14432 |
+
Generator.prototype = Object.create(IteratorPrototype);
|
14433 |
+
GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype;
|
14434 |
+
GeneratorFunctionPrototype.constructor = GeneratorFunction;
|
14435 |
+
GeneratorFunctionPrototype[toStringTagSymbol] =
|
14436 |
+
GeneratorFunction.displayName = "GeneratorFunction";
|
14437 |
|
14438 |
+
// Helper for defining the .next, .throw, and .return methods of the
|
14439 |
+
// Iterator interface in terms of a single ._invoke method.
|
14440 |
+
function defineIteratorMethods(prototype) {
|
14441 |
+
["next", "throw", "return"].forEach(function(method) {
|
14442 |
+
prototype[method] = function(arg) {
|
14443 |
+
return this._invoke(method, arg);
|
14444 |
+
};
|
14445 |
+
});
|
14446 |
+
}
|
14447 |
|
14448 |
+
exports.isGeneratorFunction = function(genFun) {
|
14449 |
+
var ctor = typeof genFun === "function" && genFun.constructor;
|
14450 |
+
return ctor
|
14451 |
+
? ctor === GeneratorFunction ||
|
14452 |
+
// For the native GeneratorFunction constructor, the best we can
|
14453 |
+
// do is to check its .name property.
|
14454 |
+
(ctor.displayName || ctor.name) === "GeneratorFunction"
|
14455 |
+
: false;
|
14456 |
+
};
|
14457 |
+
|
14458 |
+
exports.mark = function(genFun) {
|
14459 |
+
if (Object.setPrototypeOf) {
|
14460 |
+
Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);
|
14461 |
+
} else {
|
14462 |
+
genFun.__proto__ = GeneratorFunctionPrototype;
|
14463 |
+
if (!(toStringTagSymbol in genFun)) {
|
14464 |
+
genFun[toStringTagSymbol] = "GeneratorFunction";
|
14465 |
}
|
|
|
|
|
|
|
|
|
14466 |
}
|
14467 |
+
genFun.prototype = Object.create(Gp);
|
14468 |
+
return genFun;
|
14469 |
+
};
|
14470 |
|
14471 |
+
// Within the body of any async function, `await x` is transformed to
|
14472 |
+
// `yield regeneratorRuntime.awrap(x)`, so that the runtime can test
|
14473 |
+
// `hasOwn.call(value, "__await")` to determine if the yielded value is
|
14474 |
+
// meant to be awaited.
|
14475 |
+
exports.awrap = function(arg) {
|
14476 |
+
return { __await: arg };
|
14477 |
+
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14478 |
|
14479 |
+
function AsyncIterator(generator, PromiseImpl) {
|
14480 |
+
function invoke(method, arg, resolve, reject) {
|
14481 |
+
var record = tryCatch(generator[method], generator, arg);
|
14482 |
+
if (record.type === "throw") {
|
14483 |
+
reject(record.arg);
|
14484 |
+
} else {
|
14485 |
+
var result = record.arg;
|
14486 |
+
var value = result.value;
|
14487 |
+
if (value &&
|
14488 |
+
typeof value === "object" &&
|
14489 |
+
hasOwn.call(value, "__await")) {
|
14490 |
+
return PromiseImpl.resolve(value.__await).then(function(value) {
|
14491 |
+
invoke("next", value, resolve, reject);
|
14492 |
+
}, function(err) {
|
14493 |
+
invoke("throw", err, resolve, reject);
|
14494 |
+
});
|
14495 |
+
}
|
14496 |
|
14497 |
+
return PromiseImpl.resolve(value).then(function(unwrapped) {
|
14498 |
+
// When a yielded Promise is resolved, its final value becomes
|
14499 |
+
// the .value of the Promise<{value,done}> result for the
|
14500 |
+
// current iteration.
|
14501 |
+
result.value = unwrapped;
|
14502 |
+
resolve(result);
|
14503 |
+
}, function(error) {
|
14504 |
+
// If a rejected Promise was yielded, throw the rejection back
|
14505 |
+
// into the async generator function so it can be handled there.
|
14506 |
+
return invoke("throw", error, resolve, reject);
|
14507 |
+
});
|
14508 |
+
}
|
14509 |
+
}
|
14510 |
|
14511 |
+
var previousPromise;
|
14512 |
|
14513 |
+
function enqueue(method, arg) {
|
14514 |
+
function callInvokeWithMethodAndArg() {
|
14515 |
+
return new PromiseImpl(function(resolve, reject) {
|
14516 |
+
invoke(method, arg, resolve, reject);
|
14517 |
+
});
|
14518 |
+
}
|
14519 |
|
14520 |
+
return previousPromise =
|
14521 |
+
// If enqueue has been called before, then we want to wait until
|
14522 |
+
// all previous Promises have been resolved before calling invoke,
|
14523 |
+
// so that results are always delivered in the correct order. If
|
14524 |
+
// enqueue has not been called before, then it is important to
|
14525 |
+
// call invoke immediately, without waiting on a callback to fire,
|
14526 |
+
// so that the async generator function has the opportunity to do
|
14527 |
+
// any necessary setup in a predictable way. This predictability
|
14528 |
+
// is why the Promise constructor synchronously invokes its
|
14529 |
+
// executor callback, and why async functions synchronously
|
14530 |
+
// execute code before the first await. Since we implement simple
|
14531 |
+
// async functions in terms of async generators, it is especially
|
14532 |
+
// important to get this right, even though it requires care.
|
14533 |
+
previousPromise ? previousPromise.then(
|
14534 |
+
callInvokeWithMethodAndArg,
|
14535 |
+
// Avoid propagating failures to Promises returned by later
|
14536 |
+
// invocations of the iterator.
|
14537 |
+
callInvokeWithMethodAndArg
|
14538 |
+
) : callInvokeWithMethodAndArg();
|
14539 |
+
}
|
14540 |
+
|
14541 |
+
// Define the unified helper method that is used to implement .next,
|
14542 |
+
// .throw, and .return (see defineIteratorMethods).
|
14543 |
+
this._invoke = enqueue;
|
14544 |
}
|
|
|
14545 |
|
14546 |
+
defineIteratorMethods(AsyncIterator.prototype);
|
14547 |
+
AsyncIterator.prototype[asyncIteratorSymbol] = function () {
|
14548 |
+
return this;
|
14549 |
+
};
|
14550 |
+
exports.AsyncIterator = AsyncIterator;
|
14551 |
|
14552 |
+
// Note that simple async functions are implemented on top of
|
14553 |
+
// AsyncIterator objects; they just return a Promise for the value of
|
14554 |
+
// the final result produced by the iterator.
|
14555 |
+
exports.async = function(innerFn, outerFn, self, tryLocsList, PromiseImpl) {
|
14556 |
+
if (PromiseImpl === void 0) PromiseImpl = Promise;
|
14557 |
|
14558 |
+
var iter = new AsyncIterator(
|
14559 |
+
wrap(innerFn, outerFn, self, tryLocsList),
|
14560 |
+
PromiseImpl
|
14561 |
+
);
|
14562 |
|
14563 |
+
return exports.isGeneratorFunction(outerFn)
|
14564 |
+
? iter // If outerFn is a generator, return the full iterator.
|
14565 |
+
: iter.next().then(function(result) {
|
14566 |
+
return result.done ? result.value : iter.next();
|
14567 |
+
});
|
14568 |
+
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14569 |
|
14570 |
+
function makeInvokeMethod(innerFn, self, context) {
|
14571 |
+
var state = GenStateSuspendedStart;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14572 |
|
14573 |
+
return function invoke(method, arg) {
|
14574 |
+
if (state === GenStateExecuting) {
|
14575 |
+
throw new Error("Generator is already running");
|
14576 |
+
}
|
14577 |
|
14578 |
+
if (state === GenStateCompleted) {
|
14579 |
+
if (method === "throw") {
|
14580 |
+
throw arg;
|
14581 |
+
}
|
14582 |
|
14583 |
+
// Be forgiving, per 25.3.3.3.3 of the spec:
|
14584 |
+
// https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume
|
14585 |
+
return doneResult();
|
14586 |
+
}
|
14587 |
|
14588 |
+
context.method = method;
|
14589 |
+
context.arg = arg;
|
14590 |
|
14591 |
+
while (true) {
|
14592 |
+
var delegate = context.delegate;
|
14593 |
+
if (delegate) {
|
14594 |
+
var delegateResult = maybeInvokeDelegate(delegate, context);
|
14595 |
+
if (delegateResult) {
|
14596 |
+
if (delegateResult === ContinueSentinel) continue;
|
14597 |
+
return delegateResult;
|
14598 |
+
}
|
14599 |
+
}
|
14600 |
|
14601 |
+
if (context.method === "next") {
|
14602 |
+
// Setting context._sent for legacy support of Babel's
|
14603 |
+
// function.sent implementation.
|
14604 |
+
context.sent = context._sent = context.arg;
|
14605 |
|
14606 |
+
} else if (context.method === "throw") {
|
14607 |
+
if (state === GenStateSuspendedStart) {
|
14608 |
+
state = GenStateCompleted;
|
14609 |
+
throw context.arg;
|
14610 |
+
}
|
14611 |
|
14612 |
+
context.dispatchException(context.arg);
|
|
|
14613 |
|
14614 |
+
} else if (context.method === "return") {
|
14615 |
+
context.abrupt("return", context.arg);
|
14616 |
+
}
|
14617 |
|
14618 |
+
state = GenStateExecuting;
|
14619 |
|
14620 |
+
var record = tryCatch(innerFn, self, context);
|
14621 |
+
if (record.type === "normal") {
|
14622 |
+
// If an exception is thrown from innerFn, we leave state ===
|
14623 |
+
// GenStateExecuting and loop back for another invocation.
|
14624 |
+
state = context.done
|
14625 |
+
? GenStateCompleted
|
14626 |
+
: GenStateSuspendedYield;
|
|
|
|
|
14627 |
|
14628 |
+
if (record.arg === ContinueSentinel) {
|
14629 |
+
continue;
|
14630 |
+
}
|
|
|
|
|
|
|
|
|
14631 |
|
14632 |
+
return {
|
14633 |
+
value: record.arg,
|
14634 |
+
done: context.done
|
14635 |
+
};
|
|
|
|
|
|
|
14636 |
|
14637 |
+
} else if (record.type === "throw") {
|
14638 |
+
state = GenStateCompleted;
|
14639 |
+
// Dispatch the exception by looping back around to the
|
14640 |
+
// context.dispatchException(context.arg) call above.
|
14641 |
+
context.method = "throw";
|
14642 |
+
context.arg = record.arg;
|
14643 |
+
}
|
14644 |
+
}
|
14645 |
+
};
|
14646 |
}
|
14647 |
|
14648 |
+
// Call delegate.iterator[context.method](context.arg) and handle the
|
14649 |
+
// result, either by returning a { value, done } result from the
|
14650 |
+
// delegate iterator, or by modifying context.method and context.arg,
|
14651 |
+
// setting context.delegate to null, and returning the ContinueSentinel.
|
14652 |
+
function maybeInvokeDelegate(delegate, context) {
|
14653 |
+
var method = delegate.iterator[context.method];
|
14654 |
+
if (method === undefined) {
|
14655 |
+
// A .throw or .return when the delegate iterator has no .throw
|
14656 |
+
// method always terminates the yield* loop.
|
14657 |
+
context.delegate = null;
|
14658 |
|
14659 |
+
if (context.method === "throw") {
|
14660 |
+
// Note: ["return"] must be used for ES3 parsing compatibility.
|
14661 |
+
if (delegate.iterator["return"]) {
|
14662 |
+
// If the delegate iterator has a return method, give it a
|
14663 |
+
// chance to clean up.
|
14664 |
+
context.method = "return";
|
14665 |
+
context.arg = undefined;
|
14666 |
+
maybeInvokeDelegate(delegate, context);
|
14667 |
+
|
14668 |
+
if (context.method === "throw") {
|
14669 |
+
// If maybeInvokeDelegate(context) changed context.method from
|
14670 |
+
// "return" to "throw", let that override the TypeError below.
|
14671 |
+
return ContinueSentinel;
|
14672 |
+
}
|
14673 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14674 |
|
14675 |
+
context.method = "throw";
|
14676 |
+
context.arg = new TypeError(
|
14677 |
+
"The iterator does not provide a 'throw' method");
|
14678 |
+
}
|
14679 |
|
14680 |
+
return ContinueSentinel;
|
14681 |
+
}
|
|
|
14682 |
|
14683 |
+
var record = tryCatch(method, delegate.iterator, context.arg);
|
|
|
|
|
|
|
14684 |
|
14685 |
+
if (record.type === "throw") {
|
14686 |
+
context.method = "throw";
|
14687 |
+
context.arg = record.arg;
|
14688 |
+
context.delegate = null;
|
14689 |
+
return ContinueSentinel;
|
14690 |
}
|
14691 |
|
14692 |
+
var info = record.arg;
|
|
|
14693 |
|
14694 |
+
if (! info) {
|
14695 |
+
context.method = "throw";
|
14696 |
+
context.arg = new TypeError("iterator result is not an object");
|
14697 |
+
context.delegate = null;
|
14698 |
+
return ContinueSentinel;
|
14699 |
+
}
|
14700 |
|
14701 |
+
if (info.done) {
|
14702 |
+
// Assign the result of the finished delegate to the temporary
|
14703 |
+
// variable specified by delegate.resultName (see delegateYield).
|
14704 |
+
context[delegate.resultName] = info.value;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14705 |
|
14706 |
+
// Resume execution at the desired location (see delegateYield).
|
14707 |
+
context.next = delegate.nextLoc;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14708 |
|
14709 |
+
// If context.method was "throw" but the delegate handled the
|
14710 |
+
// exception, let the outer generator proceed normally. If
|
14711 |
+
// context.method was "next", forget context.arg since it has been
|
14712 |
+
// "consumed" by the delegate iterator. If context.method was
|
14713 |
+
// "return", allow the original .return call to continue in the
|
14714 |
+
// outer generator.
|
14715 |
+
if (context.method !== "return") {
|
14716 |
+
context.method = "next";
|
14717 |
+
context.arg = undefined;
|
14718 |
+
}
|
14719 |
|
14720 |
+
} else {
|
14721 |
+
// Re-yield the result returned by the delegate method.
|
14722 |
+
return info;
|
14723 |
}
|
14724 |
|
14725 |
+
// The delegate iterator is finished, so forget it and continue with
|
14726 |
+
// the outer generator.
|
14727 |
+
context.delegate = null;
|
14728 |
+
return ContinueSentinel;
|
14729 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14730 |
|
14731 |
+
// Define Generator.prototype.{next,throw,return} in terms of the
|
14732 |
+
// unified ._invoke helper method.
|
14733 |
+
defineIteratorMethods(Gp);
|
14734 |
|
14735 |
+
Gp[toStringTagSymbol] = "Generator";
|
|
|
|
|
|
|
14736 |
|
14737 |
+
// A Generator should always return itself as the iterator object when the
|
14738 |
+
// @@iterator function is called on it. Some browsers' implementations of the
|
14739 |
+
// iterator prototype chain incorrectly implement this, causing the Generator
|
14740 |
+
// object to not be returned from this call. This ensures that doesn't happen.
|
14741 |
+
// See https://github.com/facebook/regenerator/issues/274 for more details.
|
14742 |
+
Gp[iteratorSymbol] = function() {
|
14743 |
+
return this;
|
14744 |
+
};
|
14745 |
+
|
14746 |
+
Gp.toString = function() {
|
14747 |
+
return "[object Generator]";
|
14748 |
+
};
|
14749 |
+
|
14750 |
+
function pushTryEntry(locs) {
|
14751 |
+
var entry = { tryLoc: locs[0] };
|
14752 |
+
|
14753 |
+
if (1 in locs) {
|
14754 |
+
entry.catchLoc = locs[1];
|
14755 |
}
|
14756 |
|
14757 |
+
if (2 in locs) {
|
14758 |
+
entry.finallyLoc = locs[2];
|
14759 |
+
entry.afterLoc = locs[3];
|
14760 |
+
}
|
|
|
|
|
|
|
14761 |
|
14762 |
+
this.tryEntries.push(entry);
|
14763 |
+
}
|
|
|
14764 |
|
14765 |
+
function resetTryEntry(entry) {
|
14766 |
+
var record = entry.completion || {};
|
14767 |
+
record.type = "normal";
|
14768 |
+
delete record.arg;
|
14769 |
+
entry.completion = record;
|
|
|
14770 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14771 |
|
14772 |
+
function Context(tryLocsList) {
|
14773 |
+
// The root entry object (effectively a try statement without a catch
|
14774 |
+
// or a finally block) gives us a place to store values thrown from
|
14775 |
+
// locations where there is no enclosing try statement.
|
14776 |
+
this.tryEntries = [{ tryLoc: "root" }];
|
14777 |
+
tryLocsList.forEach(pushTryEntry, this);
|
14778 |
+
this.reset(true);
|
14779 |
+
}
|
14780 |
|
14781 |
+
exports.keys = function(object) {
|
14782 |
+
var keys = [];
|
14783 |
+
for (var key in object) {
|
14784 |
+
keys.push(key);
|
14785 |
}
|
14786 |
+
keys.reverse();
|
14787 |
|
14788 |
+
// Rather than returning an object with a next method, we keep
|
14789 |
+
// things simple and return the next function itself.
|
14790 |
+
return function next() {
|
14791 |
+
while (keys.length) {
|
14792 |
+
var key = keys.pop();
|
14793 |
+
if (key in object) {
|
14794 |
+
next.value = key;
|
14795 |
+
next.done = false;
|
14796 |
+
return next;
|
14797 |
+
}
|
14798 |
+
}
|
14799 |
|
14800 |
+
// To avoid creating an additional object, we just hang the .value
|
14801 |
+
// and .done properties off the next function object itself. This
|
14802 |
+
// also ensures that the minifier will not anonymize the function.
|
14803 |
+
next.done = true;
|
14804 |
+
return next;
|
14805 |
+
};
|
14806 |
+
};
|
14807 |
|
14808 |
+
function values(iterable) {
|
14809 |
+
if (iterable) {
|
14810 |
+
var iteratorMethod = iterable[iteratorSymbol];
|
14811 |
+
if (iteratorMethod) {
|
14812 |
+
return iteratorMethod.call(iterable);
|
14813 |
+
}
|
14814 |
|
14815 |
+
if (typeof iterable.next === "function") {
|
14816 |
+
return iterable;
|
14817 |
+
}
|
14818 |
|
14819 |
+
if (!isNaN(iterable.length)) {
|
14820 |
+
var i = -1, next = function next() {
|
14821 |
+
while (++i < iterable.length) {
|
14822 |
+
if (hasOwn.call(iterable, i)) {
|
14823 |
+
next.value = iterable[i];
|
14824 |
+
next.done = false;
|
14825 |
+
return next;
|
14826 |
+
}
|
14827 |
+
}
|
14828 |
|
14829 |
+
next.value = undefined;
|
14830 |
+
next.done = true;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14831 |
|
14832 |
+
return next;
|
14833 |
+
};
|
14834 |
|
14835 |
+
return next.next = next;
|
14836 |
+
}
|
|
|
14837 |
}
|
14838 |
|
14839 |
+
// Return an iterator with no values.
|
14840 |
+
return { next: doneResult };
|
14841 |
+
}
|
14842 |
+
exports.values = values;
|
14843 |
|
14844 |
+
function doneResult() {
|
14845 |
+
return { value: undefined, done: true };
|
|
|
14846 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
14847 |
|
14848 |
+
Context.prototype = {
|
14849 |
+
constructor: Context,
|
14850 |
|
14851 |
+
reset: function(skipTempReset) {
|
14852 |
+
this.prev = 0;
|
14853 |
+
this.next = 0;
|
14854 |
+
// Resetting context._sent for legacy support of Babel's
|
14855 |
+
// function.sent implementation.
|
14856 |
+
this.sent = this._sent = undefined;
|
14857 |
+
this.done = false;
|
14858 |
+
this.delegate = null;
|
14859 |
|
14860 |
+
this.method = "next";
|
14861 |
+
this.arg = undefined;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14862 |
|
14863 |
+
this.tryEntries.forEach(resetTryEntry);
|
14864 |
+
|
14865 |
+
if (!skipTempReset) {
|
14866 |
+
for (var name in this) {
|
14867 |
+
// Not sure about the optimal order of these conditions:
|
14868 |
+
if (name.charAt(0) === "t" &&
|
14869 |
+
hasOwn.call(this, name) &&
|
14870 |
+
!isNaN(+name.slice(1))) {
|
14871 |
+
this[name] = undefined;
|
14872 |
}
|
14873 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
14874 |
}
|
14875 |
+
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14876 |
|
14877 |
+
stop: function() {
|
14878 |
+
this.done = true;
|
|
|
|
|
|
|
|
|
14879 |
|
14880 |
+
var rootEntry = this.tryEntries[0];
|
14881 |
+
var rootRecord = rootEntry.completion;
|
14882 |
+
if (rootRecord.type === "throw") {
|
14883 |
+
throw rootRecord.arg;
|
14884 |
+
}
|
14885 |
|
14886 |
+
return this.rval;
|
14887 |
+
},
|
|
|
|
|
|
|
14888 |
|
14889 |
+
dispatchException: function(exception) {
|
14890 |
+
if (this.done) {
|
14891 |
+
throw exception;
|
14892 |
+
}
|
14893 |
|
14894 |
+
var context = this;
|
14895 |
+
function handle(loc, caught) {
|
14896 |
+
record.type = "throw";
|
14897 |
+
record.arg = exception;
|
14898 |
+
context.next = loc;
|
14899 |
|
14900 |
+
if (caught) {
|
14901 |
+
// If the dispatched exception was caught by a catch block,
|
14902 |
+
// then let that catch block handle the exception normally.
|
14903 |
+
context.method = "next";
|
14904 |
+
context.arg = undefined;
|
14905 |
+
}
|
14906 |
|
14907 |
+
return !! caught;
|
14908 |
+
}
|
|
|
|
|
|
|
|
|
|
|
14909 |
|
14910 |
+
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
14911 |
+
var entry = this.tryEntries[i];
|
14912 |
+
var record = entry.completion;
|
|
|
14913 |
|
14914 |
+
if (entry.tryLoc === "root") {
|
14915 |
+
// Exception thrown outside of any try block that could handle
|
14916 |
+
// it, so set the completion value of the entire function to
|
14917 |
+
// throw the exception.
|
14918 |
+
return handle("end");
|
14919 |
+
}
|
14920 |
|
14921 |
+
if (entry.tryLoc <= this.prev) {
|
14922 |
+
var hasCatch = hasOwn.call(entry, "catchLoc");
|
14923 |
+
var hasFinally = hasOwn.call(entry, "finallyLoc");
|
14924 |
|
14925 |
+
if (hasCatch && hasFinally) {
|
14926 |
+
if (this.prev < entry.catchLoc) {
|
14927 |
+
return handle(entry.catchLoc, true);
|
14928 |
+
} else if (this.prev < entry.finallyLoc) {
|
14929 |
+
return handle(entry.finallyLoc);
|
14930 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14931 |
|
14932 |
+
} else if (hasCatch) {
|
14933 |
+
if (this.prev < entry.catchLoc) {
|
14934 |
+
return handle(entry.catchLoc, true);
|
14935 |
+
}
|
14936 |
|
14937 |
+
} else if (hasFinally) {
|
14938 |
+
if (this.prev < entry.finallyLoc) {
|
14939 |
+
return handle(entry.finallyLoc);
|
14940 |
+
}
|
14941 |
|
14942 |
+
} else {
|
14943 |
+
throw new Error("try statement without catch or finally");
|
14944 |
+
}
|
14945 |
+
}
|
14946 |
+
}
|
14947 |
+
},
|
14948 |
|
14949 |
+
abrupt: function(type, arg) {
|
14950 |
+
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
14951 |
+
var entry = this.tryEntries[i];
|
14952 |
+
if (entry.tryLoc <= this.prev &&
|
14953 |
+
hasOwn.call(entry, "finallyLoc") &&
|
14954 |
+
this.prev < entry.finallyLoc) {
|
14955 |
+
var finallyEntry = entry;
|
14956 |
+
break;
|
14957 |
+
}
|
14958 |
+
}
|
14959 |
|
14960 |
+
if (finallyEntry &&
|
14961 |
+
(type === "break" ||
|
14962 |
+
type === "continue") &&
|
14963 |
+
finallyEntry.tryLoc <= arg &&
|
14964 |
+
arg <= finallyEntry.finallyLoc) {
|
14965 |
+
// Ignore the finally entry if control is not jumping to a
|
14966 |
+
// location outside the try/catch block.
|
14967 |
+
finallyEntry = null;
|
14968 |
+
}
|
14969 |
|
14970 |
+
var record = finallyEntry ? finallyEntry.completion : {};
|
14971 |
+
record.type = type;
|
14972 |
+
record.arg = arg;
|
14973 |
|
14974 |
+
if (finallyEntry) {
|
14975 |
+
this.method = "next";
|
14976 |
+
this.next = finallyEntry.finallyLoc;
|
14977 |
+
return ContinueSentinel;
|
14978 |
+
}
|
14979 |
|
14980 |
+
return this.complete(record);
|
14981 |
+
},
|
14982 |
|
14983 |
+
complete: function(record, afterLoc) {
|
14984 |
+
if (record.type === "throw") {
|
14985 |
+
throw record.arg;
|
14986 |
+
}
|
14987 |
|
14988 |
+
if (record.type === "break" ||
|
14989 |
+
record.type === "continue") {
|
14990 |
+
this.next = record.arg;
|
14991 |
+
} else if (record.type === "return") {
|
14992 |
+
this.rval = this.arg = record.arg;
|
14993 |
+
this.method = "return";
|
14994 |
+
this.next = "end";
|
14995 |
+
} else if (record.type === "normal" && afterLoc) {
|
14996 |
+
this.next = afterLoc;
|
14997 |
+
}
|
14998 |
|
14999 |
+
return ContinueSentinel;
|
15000 |
+
},
|
|
|
|
|
15001 |
|
15002 |
+
finish: function(finallyLoc) {
|
15003 |
+
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
15004 |
+
var entry = this.tryEntries[i];
|
15005 |
+
if (entry.finallyLoc === finallyLoc) {
|
15006 |
+
this.complete(entry.completion, entry.afterLoc);
|
15007 |
+
resetTryEntry(entry);
|
15008 |
+
return ContinueSentinel;
|
15009 |
+
}
|
15010 |
+
}
|
15011 |
+
},
|
15012 |
|
15013 |
+
"catch": function(tryLoc) {
|
15014 |
+
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
15015 |
+
var entry = this.tryEntries[i];
|
15016 |
+
if (entry.tryLoc === tryLoc) {
|
15017 |
+
var record = entry.completion;
|
15018 |
+
if (record.type === "throw") {
|
15019 |
+
var thrown = record.arg;
|
15020 |
+
resetTryEntry(entry);
|
15021 |
+
}
|
15022 |
+
return thrown;
|
15023 |
+
}
|
15024 |
+
}
|
15025 |
|
15026 |
+
// The context.catch method must only be called with a location
|
15027 |
+
// argument that corresponds to a known catch block.
|
15028 |
+
throw new Error("illegal catch attempt");
|
15029 |
+
},
|
15030 |
|
15031 |
+
delegateYield: function(iterable, resultName, nextLoc) {
|
15032 |
+
this.delegate = {
|
15033 |
+
iterator: values(iterable),
|
15034 |
+
resultName: resultName,
|
15035 |
+
nextLoc: nextLoc
|
15036 |
+
};
|
15037 |
|
15038 |
+
if (this.method === "next") {
|
15039 |
+
// Deliberately forget the last sent value so that we don't
|
15040 |
+
// accidentally pass it on to the delegate.
|
15041 |
+
this.arg = undefined;
|
15042 |
}
|
15043 |
|
15044 |
+
return ContinueSentinel;
|
|
|
15045 |
}
|
|
|
|
|
|
|
15046 |
};
|
|
|
15047 |
|
15048 |
+
// Regardless of whether this script is executing as a CommonJS module
|
15049 |
+
// or not, return the runtime object so that we can declare the variable
|
15050 |
+
// regeneratorRuntime in the outer scope, which allows this module to be
|
15051 |
+
// injected easily by `bin/regenerator --include-runtime script.js`.
|
15052 |
+
return exports;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15053 |
|
15054 |
+
}(
|
15055 |
+
// If this script is executing as a CommonJS module, use module.exports
|
15056 |
+
// as the regeneratorRuntime namespace. Otherwise create a new empty
|
15057 |
+
// object. Either way, the resulting object will be used to initialize
|
15058 |
+
// the regeneratorRuntime variable at the top of this file.
|
15059 |
+
true ? module.exports : undefined
|
15060 |
+
));
|
15061 |
|
15062 |
+
try {
|
15063 |
+
regeneratorRuntime = runtime;
|
15064 |
+
} catch (accidentalStrictMode) {
|
15065 |
+
// This module should not be running in strict mode, so the above
|
15066 |
+
// assignment should always work unless something is misconfigured. Just
|
15067 |
+
// in case runtime.js accidentally runs in strict mode, we can escape
|
15068 |
+
// strict mode using a global Function call. This could conceivably fail
|
15069 |
+
// if a Content Security Policy forbids using Function, but in that case
|
15070 |
+
// the proper solution is to fix the accidental strict mode problem. If
|
15071 |
+
// you've misconfigured your bundler to force strict mode and applied a
|
15072 |
+
// CSP to forbid Function, and you're not willing to fix either of those
|
15073 |
+
// problems, please detail your unique predicament in a GitHub issue.
|
15074 |
+
Function("r", "regeneratorRuntime = r")(runtime);
|
15075 |
+
}
|
15076 |
|
|
|
|
|
|
|
15077 |
|
15078 |
+
/***/ }),
|
15079 |
|
15080 |
+
/***/ 449:
|
15081 |
+
/***/ (function(module, exports, __webpack_require__) {
|
15082 |
|
15083 |
+
// extracted by mini-css-extract-plugin
|
|
|
|
|
|
|
15084 |
|
15085 |
+
/***/ }),
|
|
|
15086 |
|
15087 |
+
/***/ 450:
|
15088 |
+
/***/ (function(module, exports, __webpack_require__) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15089 |
|
15090 |
+
// extracted by mini-css-extract-plugin
|
|
|
15091 |
|
15092 |
+
/***/ }),
|
|
|
15093 |
|
15094 |
+
/***/ 451:
|
15095 |
+
/***/ (function(module, exports, __webpack_require__) {
|
|
|
15096 |
|
15097 |
+
// extracted by mini-css-extract-plugin
|
|
|
|
|
|
|
|
|
15098 |
|
15099 |
+
/***/ }),
|
|
|
|
|
15100 |
|
15101 |
+
/***/ 452:
|
15102 |
+
/***/ (function(module, exports, __webpack_require__) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15103 |
|
15104 |
+
// extracted by mini-css-extract-plugin
|
|
|
15105 |
|
15106 |
+
/***/ }),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15107 |
|
15108 |
+
/***/ 453:
|
15109 |
+
/***/ (function(module, exports, __webpack_require__) {
|
|
|
|
|
|
|
15110 |
|
15111 |
+
"use strict";
|
|
|
|
|
15112 |
|
|
|
|
|
|
|
|
|
|
|
|
|
15113 |
|
15114 |
/**
|
15115 |
+
* Copyright 2015, Yahoo! Inc.
|
15116 |
+
* Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15117 |
*/
|
15118 |
+
var REACT_STATICS = {
|
15119 |
+
childContextTypes: true,
|
15120 |
+
contextTypes: true,
|
15121 |
+
defaultProps: true,
|
15122 |
+
displayName: true,
|
15123 |
+
getDefaultProps: true,
|
15124 |
+
getDerivedStateFromProps: true,
|
15125 |
+
mixins: true,
|
15126 |
+
propTypes: true,
|
15127 |
+
type: true
|
15128 |
+
};
|
15129 |
|
15130 |
+
var KNOWN_STATICS = {
|
15131 |
+
name: true,
|
15132 |
+
length: true,
|
15133 |
+
prototype: true,
|
15134 |
+
caller: true,
|
15135 |
+
callee: true,
|
15136 |
+
arguments: true,
|
15137 |
+
arity: true
|
15138 |
+
};
|
15139 |
|
15140 |
+
var defineProperty = Object.defineProperty;
|
15141 |
+
var getOwnPropertyNames = Object.getOwnPropertyNames;
|
15142 |
+
var getOwnPropertySymbols = Object.getOwnPropertySymbols;
|
15143 |
+
var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
|
15144 |
+
var getPrototypeOf = Object.getPrototypeOf;
|
15145 |
+
var objectPrototype = getPrototypeOf && getPrototypeOf(Object);
|
15146 |
|
15147 |
+
function hoistNonReactStatics(targetComponent, sourceComponent, blacklist) {
|
15148 |
+
if (typeof sourceComponent !== 'string') { // don't hoist over string (html) components
|
|
|
15149 |
|
15150 |
+
if (objectPrototype) {
|
15151 |
+
var inheritedComponent = getPrototypeOf(sourceComponent);
|
15152 |
+
if (inheritedComponent && inheritedComponent !== objectPrototype) {
|
15153 |
+
hoistNonReactStatics(targetComponent, inheritedComponent, blacklist);
|
15154 |
+
}
|
15155 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15156 |
|
15157 |
+
var keys = getOwnPropertyNames(sourceComponent);
|
|
|
|
|
|
|
15158 |
|
15159 |
+
if (getOwnPropertySymbols) {
|
15160 |
+
keys = keys.concat(getOwnPropertySymbols(sourceComponent));
|
15161 |
+
}
|
15162 |
|
15163 |
+
for (var i = 0; i < keys.length; ++i) {
|
15164 |
+
var key = keys[i];
|
15165 |
+
if (!REACT_STATICS[key] && !KNOWN_STATICS[key] && (!blacklist || !blacklist[key])) {
|
15166 |
+
var descriptor = getOwnPropertyDescriptor(sourceComponent, key);
|
15167 |
+
try { // Avoid failures from read-only properties
|
15168 |
+
defineProperty(targetComponent, key, descriptor);
|
15169 |
+
} catch (e) {}
|
15170 |
+
}
|
15171 |
+
}
|
15172 |
|
15173 |
+
return targetComponent;
|
15174 |
+
}
|
15175 |
|
15176 |
+
return targetComponent;
|
15177 |
+
}
|
15178 |
|
15179 |
+
module.exports = hoistNonReactStatics;
|
|
|
|
|
15180 |
|
|
|
15181 |
|
15182 |
+
/***/ }),
|
15183 |
|
15184 |
+
/***/ 454:
|
15185 |
+
/***/ (function(module, exports, __webpack_require__) {
|
15186 |
|
15187 |
+
// extracted by mini-css-extract-plugin
|
15188 |
|
15189 |
+
/***/ }),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15190 |
|
15191 |
+
/***/ 455:
|
15192 |
+
/***/ (function(module, exports, __webpack_require__) {
|
|
|
15193 |
|
15194 |
+
// extracted by mini-css-extract-plugin
|
|
|
|
|
15195 |
|
15196 |
+
/***/ }),
|
|
|
15197 |
|
15198 |
+
/***/ 456:
|
15199 |
+
/***/ (function(module, exports) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15200 |
|
15201 |
+
module.exports = Array.isArray || function (arr) {
|
15202 |
+
return Object.prototype.toString.call(arr) == '[object Array]';
|
15203 |
+
};
|
15204 |
|
|
|
|
|
|
|
15205 |
|
15206 |
+
/***/ }),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15207 |
|
15208 |
+
/***/ 457:
|
15209 |
+
/***/ (function(module, exports) {
|
15210 |
|
15211 |
+
module.exports = function(originalModule) {
|
15212 |
+
if (!originalModule.webpackPolyfill) {
|
15213 |
+
var module = Object.create(originalModule);
|
15214 |
+
// module.parent = undefined by default
|
15215 |
+
if (!module.children) module.children = [];
|
15216 |
+
Object.defineProperty(module, "loaded", {
|
15217 |
+
enumerable: true,
|
15218 |
+
get: function() {
|
15219 |
+
return module.l;
|
15220 |
+
}
|
15221 |
+
});
|
15222 |
+
Object.defineProperty(module, "id", {
|
15223 |
+
enumerable: true,
|
15224 |
+
get: function() {
|
15225 |
+
return module.i;
|
15226 |
+
}
|
15227 |
+
});
|
15228 |
+
Object.defineProperty(module, "exports", {
|
15229 |
+
enumerable: true
|
15230 |
+
});
|
15231 |
+
module.webpackPolyfill = 1;
|
15232 |
+
}
|
15233 |
+
return module;
|
15234 |
+
};
|
15235 |
|
15236 |
|
15237 |
+
/***/ }),
|
15238 |
|
15239 |
+
/***/ 46:
|
15240 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
|
|
|
|
|
15241 |
|
15242 |
+
"use strict";
|
15243 |
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _objectWithoutPropertiesLoose; });
|
15244 |
+
function _objectWithoutPropertiesLoose(source, excluded) {
|
15245 |
+
if (source == null) return {};
|
15246 |
+
var target = {};
|
15247 |
+
var sourceKeys = Object.keys(source);
|
15248 |
+
var key, i;
|
|
|
15249 |
|
15250 |
+
for (i = 0; i < sourceKeys.length; i++) {
|
15251 |
+
key = sourceKeys[i];
|
15252 |
+
if (excluded.indexOf(key) >= 0) continue;
|
15253 |
+
target[key] = source[key];
|
15254 |
+
}
|
15255 |
+
|
15256 |
+
return target;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15257 |
}
|
15258 |
|
15259 |
+
/***/ }),
|
15260 |
+
|
15261 |
+
/***/ 47:
|
15262 |
+
/***/ (function(module, exports, __webpack_require__) {
|
15263 |
+
|
15264 |
+
var _typeof = __webpack_require__(34);
|
15265 |
|
15266 |
+
var assertThisInitialized = __webpack_require__(65);
|
|
|
|
|
15267 |
|
15268 |
+
function _possibleConstructorReturn(self, call) {
|
15269 |
+
if (call && (_typeof(call) === "object" || typeof call === "function")) {
|
15270 |
+
return call;
|
15271 |
+
}
|
15272 |
+
|
15273 |
+
return assertThisInitialized(self);
|
15274 |
}
|
15275 |
|
15276 |
+
module.exports = _possibleConstructorReturn;
|
|
|
|
|
|
|
15277 |
|
15278 |
+
/***/ }),
|
|
|
|
|
15279 |
|
15280 |
+
/***/ 48:
|
15281 |
+
/***/ (function(module, exports) {
|
15282 |
|
15283 |
+
(function() { module.exports = this["wc"]["data"]; }());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15284 |
|
15285 |
+
/***/ }),
|
15286 |
|
15287 |
+
/***/ 49:
|
15288 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
15289 |
|
15290 |
+
"use strict";
|
|
|
|
|
15291 |
|
15292 |
+
// EXPORTS
|
15293 |
+
__webpack_require__.d(__webpack_exports__, "a", function() { return /* binding */ build_module_focus; });
|
15294 |
|
15295 |
+
// UNUSED EXPORTS: isHorizontalEdge, isVerticalEdge, getRectangleFromRange, computeCaretRect, placeCaretAtHorizontalEdge, placeCaretAtVerticalEdge, isTextField, isNumberInput, documentHasTextSelection, documentHasUncollapsedSelection, documentHasSelection, isEntirelySelected, getScrollContainer, getOffsetParent, replace, remove, insertAfter, unwrap, replaceTag, wrap, __unstableStripHTML
|
|
|
|
|
15296 |
|
15297 |
+
// NAMESPACE OBJECT: ./node_modules/@wordpress/components/node_modules/@wordpress/dom/build-module/focusable.js
|
15298 |
+
var focusable_namespaceObject = {};
|
15299 |
+
__webpack_require__.r(focusable_namespaceObject);
|
15300 |
+
__webpack_require__.d(focusable_namespaceObject, "find", function() { return find; });
|
15301 |
|
15302 |
+
// NAMESPACE OBJECT: ./node_modules/@wordpress/components/node_modules/@wordpress/dom/build-module/tabbable.js
|
15303 |
+
var tabbable_namespaceObject = {};
|
15304 |
+
__webpack_require__.r(tabbable_namespaceObject);
|
15305 |
+
__webpack_require__.d(tabbable_namespaceObject, "isTabbableIndex", function() { return isTabbableIndex; });
|
15306 |
+
__webpack_require__.d(tabbable_namespaceObject, "find", function() { return tabbable_find; });
|
15307 |
+
__webpack_require__.d(tabbable_namespaceObject, "findPrevious", function() { return findPrevious; });
|
15308 |
+
__webpack_require__.d(tabbable_namespaceObject, "findNext", function() { return findNext; });
|
15309 |
|
15310 |
+
// CONCATENATED MODULE: ./node_modules/@wordpress/components/node_modules/@wordpress/dom/build-module/focusable.js
|
15311 |
+
/**
|
15312 |
+
* References:
|
15313 |
+
*
|
15314 |
+
* Focusable:
|
15315 |
+
* - https://www.w3.org/TR/html5/editing.html#focus-management
|
15316 |
+
*
|
15317 |
+
* Sequential focus navigation:
|
15318 |
+
* - https://www.w3.org/TR/html5/editing.html#sequential-focus-navigation-and-the-tabindex-attribute
|
15319 |
+
*
|
15320 |
+
* Disabled elements:
|
15321 |
+
* - https://www.w3.org/TR/html5/disabled-elements.html#disabled-elements
|
15322 |
+
*
|
15323 |
+
* getClientRects algorithm (requiring layout box):
|
15324 |
+
* - https://www.w3.org/TR/cssom-view-1/#extension-to-the-element-interface
|
15325 |
+
*
|
15326 |
+
* AREA elements associated with an IMG:
|
15327 |
+
* - https://w3c.github.io/html/editing.html#data-model
|
15328 |
+
*/
|
15329 |
+
var SELECTOR = ['[tabindex]', 'a[href]', 'button:not([disabled])', 'input:not([type="hidden"]):not([disabled])', 'select:not([disabled])', 'textarea:not([disabled])', 'iframe', 'object', 'embed', 'area[href]', '[contenteditable]:not([contenteditable=false])'].join(',');
|
15330 |
+
/**
|
15331 |
+
* Returns true if the specified element is visible (i.e. neither display: none
|
15332 |
+
* nor visibility: hidden).
|
15333 |
+
*
|
15334 |
+
* @param {Element} element DOM element to test.
|
15335 |
+
*
|
15336 |
+
* @return {boolean} Whether element is visible.
|
15337 |
+
*/
|
15338 |
|
15339 |
+
function isVisible(element) {
|
15340 |
+
return element.offsetWidth > 0 || element.offsetHeight > 0 || element.getClientRects().length > 0;
|
15341 |
+
}
|
15342 |
+
/**
|
15343 |
+
* Returns true if the specified element should be skipped from focusable elements.
|
15344 |
+
* For now it rather specific for `iframes` and if tabindex attribute is set to -1.
|
15345 |
+
*
|
15346 |
+
* @param {Element} element DOM element to test.
|
15347 |
+
*
|
15348 |
+
* @return {boolean} Whether element should be skipped from focusable elements.
|
15349 |
+
*/
|
15350 |
|
|
|
|
|
|
|
15351 |
|
15352 |
+
function skipFocus(element) {
|
15353 |
+
return element.nodeName.toLowerCase() === 'iframe' && element.getAttribute('tabindex') === '-1';
|
15354 |
+
}
|
15355 |
+
/**
|
15356 |
+
* Returns true if the specified area element is a valid focusable element, or
|
15357 |
+
* false otherwise. Area is only focusable if within a map where a named map
|
15358 |
+
* referenced by an image somewhere in the document.
|
15359 |
+
*
|
15360 |
+
* @param {Element} element DOM area element to test.
|
15361 |
+
*
|
15362 |
+
* @return {boolean} Whether area element is valid for focus.
|
15363 |
+
*/
|
15364 |
|
|
|
|
|
|
|
15365 |
|
15366 |
+
function isValidFocusableArea(element) {
|
15367 |
+
var map = element.closest('map[name]');
|
|
|
|
|
|
|
|
|
|
|
15368 |
|
15369 |
+
if (!map) {
|
15370 |
+
return false;
|
15371 |
+
}
|
|
|
|
|
15372 |
|
15373 |
+
var img = document.querySelector('img[usemap="#' + map.name + '"]');
|
15374 |
+
return !!img && isVisible(img);
|
15375 |
+
}
|
15376 |
+
/**
|
15377 |
+
* Returns all focusable elements within a given context.
|
15378 |
+
*
|
15379 |
+
* @param {Element} context Element in which to search.
|
15380 |
+
*
|
15381 |
+
* @return {Element[]} Focusable elements.
|
15382 |
+
*/
|
15383 |
|
|
|
|
|
15384 |
|
15385 |
+
function find(context) {
|
15386 |
+
var elements = context.querySelectorAll(SELECTOR);
|
15387 |
+
return Array.from(elements).filter(function (element) {
|
15388 |
+
if (!isVisible(element) || skipFocus(element)) {
|
15389 |
+
return false;
|
15390 |
+
}
|
15391 |
|
15392 |
+
var nodeName = element.nodeName;
|
15393 |
|
15394 |
+
if ('AREA' === nodeName) {
|
15395 |
+
return isValidFocusableArea(element);
|
15396 |
+
}
|
15397 |
|
15398 |
+
return true;
|
15399 |
+
});
|
15400 |
+
}
|
15401 |
+
//# sourceMappingURL=focusable.js.map
|
15402 |
+
// EXTERNAL MODULE: external "lodash"
|
15403 |
+
var external_lodash_ = __webpack_require__(2);
|
15404 |
|
15405 |
+
// CONCATENATED MODULE: ./node_modules/@wordpress/components/node_modules/@wordpress/dom/build-module/tabbable.js
|
15406 |
/**
|
15407 |
* External dependencies
|
15408 |
*/
|
15412 |
*/
|
15413 |
|
15414 |
|
15415 |
+
/**
|
15416 |
+
* Returns the tab index of the given element. In contrast with the tabIndex
|
15417 |
+
* property, this normalizes the default (0) to avoid browser inconsistencies,
|
15418 |
+
* operating under the assumption that this function is only ever called with a
|
15419 |
+
* focusable node.
|
15420 |
+
*
|
15421 |
+
* @see https://bugzilla.mozilla.org/show_bug.cgi?id=1190261
|
15422 |
+
*
|
15423 |
+
* @param {Element} element Element from which to retrieve.
|
15424 |
+
*
|
15425 |
+
* @return {?number} Tab index of element (default 0).
|
15426 |
+
*/
|
15427 |
|
15428 |
+
function getTabIndex(element) {
|
15429 |
+
var tabIndex = element.getAttribute('tabindex');
|
15430 |
+
return tabIndex === null ? 0 : parseInt(tabIndex, 10);
|
|
|
15431 |
}
|
15432 |
+
/**
|
15433 |
+
* Returns true if the specified element is tabbable, or false otherwise.
|
15434 |
+
*
|
15435 |
+
* @param {Element} element Element to test.
|
15436 |
+
*
|
15437 |
+
* @return {boolean} Whether element is tabbable.
|
15438 |
+
*/
|
15439 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15440 |
|
15441 |
+
function isTabbableIndex(element) {
|
15442 |
+
return getTabIndex(element) !== -1;
|
|
|
|
|
15443 |
}
|
|
|
|
|
|
|
|
|
|
|
15444 |
/**
|
15445 |
+
* Returns a stateful reducer function which constructs a filtered array of
|
15446 |
+
* tabbable elements, where at most one radio input is selected for a given
|
15447 |
+
* name, giving priority to checked input, falling back to the first
|
15448 |
+
* encountered.
|
15449 |
+
*
|
15450 |
+
* @return {Function} Radio group collapse reducer.
|
15451 |
*/
|
15452 |
|
15453 |
+
function createStatefulCollapseRadioGroup() {
|
15454 |
+
var CHOSEN_RADIO_BY_NAME = {};
|
15455 |
+
return function collapseRadioGroup(result, element) {
|
15456 |
+
var nodeName = element.nodeName,
|
15457 |
+
type = element.type,
|
15458 |
+
checked = element.checked,
|
15459 |
+
name = element.name; // For all non-radio tabbables, construct to array by concatenating.
|
15460 |
|
15461 |
+
if (nodeName !== 'INPUT' || type !== 'radio' || !name) {
|
15462 |
+
return result.concat(element);
|
15463 |
+
}
|
|
|
|
|
15464 |
|
15465 |
+
var hasChosen = CHOSEN_RADIO_BY_NAME.hasOwnProperty(name); // Omit by skipping concatenation if the radio element is not chosen.
|
15466 |
|
15467 |
+
var isChosen = checked || !hasChosen;
|
15468 |
|
15469 |
+
if (!isChosen) {
|
15470 |
+
return result;
|
15471 |
+
} // At this point, if there had been a chosen element, the current
|
15472 |
+
// element is checked and should take priority. Retroactively remove
|
15473 |
+
// the element which had previously been considered the chosen one.
|
15474 |
|
|
|
15475 |
|
15476 |
+
if (hasChosen) {
|
15477 |
+
var hadChosenElement = CHOSEN_RADIO_BY_NAME[name];
|
15478 |
+
result = Object(external_lodash_["without"])(result, hadChosenElement);
|
15479 |
+
}
|
15480 |
+
|
15481 |
+
CHOSEN_RADIO_BY_NAME[name] = element;
|
15482 |
+
return result.concat(element);
|
15483 |
+
};
|
15484 |
+
}
|
15485 |
/**
|
15486 |
+
* An array map callback, returning an object with the element value and its
|
15487 |
+
* array index location as properties. This is used to emulate a proper stable
|
15488 |
+
* sort where equal tabIndex should be left in order of their occurrence in the
|
15489 |
+
* document.
|
15490 |
+
*
|
15491 |
+
* @param {Element} element Element.
|
15492 |
+
* @param {number} index Array index of element.
|
15493 |
+
*
|
15494 |
+
* @return {Object} Mapped object with element, index.
|
15495 |
*/
|
15496 |
|
15497 |
|
15498 |
+
function mapElementToObjectTabbable(element, index) {
|
15499 |
+
return {
|
15500 |
+
element: element,
|
15501 |
+
index: index
|
15502 |
+
};
|
15503 |
+
}
|
15504 |
/**
|
15505 |
+
* An array map callback, returning an element of the given mapped object's
|
15506 |
+
* element value.
|
15507 |
+
*
|
15508 |
+
* @param {Object} object Mapped object with index.
|
15509 |
+
*
|
15510 |
+
* @return {Element} Mapped object element.
|
15511 |
*/
|
15512 |
|
15513 |
|
15514 |
+
function mapObjectTabbableToElement(object) {
|
15515 |
+
return object.element;
|
15516 |
+
}
|
15517 |
+
/**
|
15518 |
+
* A sort comparator function used in comparing two objects of mapped elements.
|
15519 |
+
*
|
15520 |
+
* @see mapElementToObjectTabbable
|
15521 |
+
*
|
15522 |
+
* @param {Object} a First object to compare.
|
15523 |
+
* @param {Object} b Second object to compare.
|
15524 |
+
*
|
15525 |
+
* @return {number} Comparator result.
|
15526 |
+
*/
|
15527 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15528 |
|
15529 |
+
function compareObjectTabbables(a, b) {
|
15530 |
+
var aTabIndex = getTabIndex(a.element);
|
15531 |
+
var bTabIndex = getTabIndex(b.element);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15532 |
|
15533 |
+
if (aTabIndex === bTabIndex) {
|
15534 |
+
return a.index - b.index;
|
15535 |
+
}
|
15536 |
|
15537 |
+
return aTabIndex - bTabIndex;
|
15538 |
+
}
|
15539 |
+
/**
|
15540 |
+
* Givin focusable elements, filters out tabbable element.
|
15541 |
+
*
|
15542 |
+
* @param {Array} focusables Focusable elements to filter.
|
15543 |
+
*
|
15544 |
+
* @return {Array} Tabbable elements.
|
15545 |
+
*/
|
15546 |
|
|
|
|
|
15547 |
|
15548 |
+
function filterTabbable(focusables) {
|
15549 |
+
return focusables.filter(isTabbableIndex).map(mapElementToObjectTabbable).sort(compareObjectTabbables).map(mapObjectTabbableToElement).reduce(createStatefulCollapseRadioGroup(), []);
|
15550 |
+
}
|
|
|
15551 |
|
15552 |
+
function tabbable_find(context) {
|
15553 |
+
return filterTabbable(find(context));
|
15554 |
+
}
|
15555 |
+
/**
|
15556 |
+
* Given a focusable element, find the preceding tabbable element.
|
15557 |
+
*
|
15558 |
+
* @param {Element} element The focusable element before which to look. Defaults
|
15559 |
+
* to the active element.
|
15560 |
+
*/
|
15561 |
|
15562 |
+
function findPrevious() {
|
15563 |
+
var element = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : document.activeElement;
|
15564 |
+
var focusables = find(document.body);
|
15565 |
+
var index = focusables.indexOf(element); // Remove all focusables after and including `element`.
|
|
|
15566 |
|
15567 |
+
focusables.length = index;
|
15568 |
+
return Object(external_lodash_["last"])(filterTabbable(focusables));
|
15569 |
+
}
|
15570 |
+
/**
|
15571 |
+
* Given a focusable element, find the next tabbable element.
|
15572 |
+
*
|
15573 |
+
* @param {Element} element The focusable element after which to look. Defaults
|
15574 |
+
* to the active element.
|
15575 |
+
*/
|
15576 |
|
15577 |
+
function findNext() {
|
15578 |
+
var element = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : document.activeElement;
|
15579 |
+
var focusables = find(document.body);
|
15580 |
+
var index = focusables.indexOf(element); // Remove all focusables before and inside `element`.
|
15581 |
|
15582 |
+
var remaining = focusables.slice(index + 1).filter(function (node) {
|
15583 |
+
return !element.contains(node);
|
15584 |
+
});
|
15585 |
+
return Object(external_lodash_["first"])(filterTabbable(remaining));
|
15586 |
+
}
|
15587 |
+
//# sourceMappingURL=tabbable.js.map
|
15588 |
+
// CONCATENATED MODULE: ./node_modules/@wordpress/components/node_modules/@wordpress/dom/build-module/index.js
|
15589 |
+
/**
|
15590 |
+
* Internal dependencies
|
15591 |
+
*/
|
15592 |
|
15593 |
|
15594 |
+
/**
|
15595 |
+
* Object grouping `focusable` and `tabbable` utils
|
15596 |
+
* under the keys with the same name.
|
15597 |
+
*/
|
15598 |
|
15599 |
+
var build_module_focus = {
|
15600 |
+
focusable: focusable_namespaceObject,
|
15601 |
+
tabbable: tabbable_namespaceObject
|
15602 |
+
};
|
15603 |
|
15604 |
+
//# sourceMappingURL=index.js.map
|
15605 |
|
15606 |
+
/***/ }),
|
15607 |
|
15608 |
+
/***/ 5:
|
15609 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
|
15610 |
|
15611 |
+
"use strict";
|
15612 |
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _assertThisInitialized; });
|
15613 |
+
function _assertThisInitialized(self) {
|
15614 |
+
if (self === void 0) {
|
15615 |
+
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
15616 |
+
}
|
15617 |
|
15618 |
+
return self;
|
15619 |
+
}
|
|
|
15620 |
|
15621 |
+
/***/ }),
|
15622 |
|
15623 |
+
/***/ 51:
|
15624 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
15625 |
|
15626 |
+
"use strict";
|
15627 |
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _unsupportedIterableToArray; });
|
15628 |
+
/* harmony import */ var _arrayLikeToArray__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(31);
|
|
|
|
|
|
|
|
|
|
|
|
|
15629 |
|
15630 |
+
function _unsupportedIterableToArray(o, minLen) {
|
15631 |
+
if (!o) return;
|
15632 |
+
if (typeof o === "string") return Object(_arrayLikeToArray__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])(o, minLen);
|
15633 |
+
var n = Object.prototype.toString.call(o).slice(8, -1);
|
15634 |
+
if (n === "Object" && o.constructor) n = o.constructor.name;
|
15635 |
+
if (n === "Map" || n === "Set") return Array.from(o);
|
15636 |
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return Object(_arrayLikeToArray__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])(o, minLen);
|
15637 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15638 |
|
15639 |
+
/***/ }),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15640 |
|
15641 |
+
/***/ 53:
|
15642 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
15643 |
|
15644 |
+
"use strict";
|
15645 |
+
/* WEBPACK VAR INJECTION */(function(process) {/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0);
|
15646 |
+
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
|
15647 |
+
/* harmony import */ var _wordpress_warning__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(90);
|
15648 |
+
/**
|
15649 |
+
* WordPress dependencies
|
15650 |
+
*/
|
15651 |
|
|
|
|
|
|
|
|
|
15652 |
|
15653 |
+
var SlotFillContext = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createContext"])({
|
15654 |
+
slots: {},
|
15655 |
+
fills: {},
|
15656 |
+
registerSlot: function registerSlot() {
|
15657 |
+
typeof process !== "undefined" && process.env && "production" !== "production" ? Object(_wordpress_warning__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"])('Components must be wrapped within `SlotFillProvider`. ' + 'See https://developer.wordpress.org/block-editor/components/slot-fill/') : void 0;
|
15658 |
+
},
|
15659 |
+
updateSlot: function updateSlot() {},
|
15660 |
+
unregisterSlot: function unregisterSlot() {},
|
15661 |
+
registerFill: function registerFill() {},
|
15662 |
+
unregisterFill: function unregisterFill() {}
|
15663 |
+
});
|
15664 |
+
/* harmony default export */ __webpack_exports__["a"] = (SlotFillContext);
|
15665 |
+
//# sourceMappingURL=slot-fill-context.js.map
|
15666 |
+
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(35)))
|
15667 |
|
15668 |
+
/***/ }),
|
|
|
|
|
15669 |
|
15670 |
+
/***/ 54:
|
15671 |
+
/***/ (function(module, exports) {
|
|
|
15672 |
|
15673 |
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
15674 |
+
try {
|
15675 |
+
var info = gen[key](arg);
|
15676 |
+
var value = info.value;
|
15677 |
+
} catch (error) {
|
15678 |
+
reject(error);
|
15679 |
+
return;
|
15680 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
15681 |
|
15682 |
+
if (info.done) {
|
15683 |
+
resolve(value);
|
15684 |
+
} else {
|
15685 |
+
Promise.resolve(value).then(_next, _throw);
|
15686 |
+
}
|
15687 |
+
}
|
15688 |
|
15689 |
+
function _asyncToGenerator(fn) {
|
15690 |
+
return function () {
|
15691 |
+
var self = this,
|
15692 |
+
args = arguments;
|
15693 |
+
return new Promise(function (resolve, reject) {
|
15694 |
+
var gen = fn.apply(self, args);
|
|
|
15695 |
|
15696 |
+
function _next(value) {
|
15697 |
+
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
|
15698 |
+
}
|
15699 |
+
|
15700 |
+
function _throw(err) {
|
15701 |
+
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
|
15702 |
+
}
|
15703 |
+
|
15704 |
+
_next(undefined);
|
15705 |
+
});
|
15706 |
+
};
|
15707 |
}
|
15708 |
|
15709 |
+
module.exports = _asyncToGenerator;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15710 |
|
15711 |
+
/***/ }),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15712 |
|
15713 |
+
/***/ 55:
|
15714 |
+
/***/ (function(module, exports) {
|
|
|
15715 |
|
15716 |
+
(function() { module.exports = this["wc"]["components"]; }());
|
|
|
15717 |
|
15718 |
+
/***/ }),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15719 |
|
15720 |
+
/***/ 56:
|
15721 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
|
|
|
|
|
15722 |
|
15723 |
+
"use strict";
|
15724 |
+
/* unused harmony export logged */
|
15725 |
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return deprecated; });
|
15726 |
+
/* harmony import */ var _wordpress_hooks__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(44);
|
15727 |
+
/* harmony import */ var _wordpress_hooks__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_hooks__WEBPACK_IMPORTED_MODULE_0__);
|
15728 |
+
/**
|
15729 |
+
* WordPress dependencies
|
15730 |
+
*/
|
15731 |
|
15732 |
+
/**
|
15733 |
+
* Object map tracking messages which have been logged, for use in ensuring a
|
15734 |
+
* message is only logged once.
|
15735 |
+
*
|
15736 |
+
* @type {Object}
|
15737 |
+
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15738 |
|
15739 |
+
var logged = Object.create(null);
|
15740 |
+
/**
|
15741 |
+
* Logs a message to notify developers about a deprecated feature.
|
15742 |
+
*
|
15743 |
+
* @param {string} feature Name of the deprecated feature.
|
15744 |
+
* @param {?Object} options Personalisation options
|
15745 |
+
* @param {?string} options.version Version in which the feature will be removed.
|
15746 |
+
* @param {?string} options.alternative Feature to use instead
|
15747 |
+
* @param {?string} options.plugin Plugin name if it's a plugin feature
|
15748 |
+
* @param {?string} options.link Link to documentation
|
15749 |
+
* @param {?string} options.hint Additional message to help transition away from the deprecated feature.
|
15750 |
+
*
|
15751 |
+
* @example
|
15752 |
+
* ```js
|
15753 |
+
* import deprecated from '@wordpress/deprecated';
|
15754 |
+
*
|
15755 |
+
* deprecated( 'Eating meat', {
|
15756 |
+
* version: 'the future',
|
15757 |
+
* alternative: 'vegetables',
|
15758 |
+
* plugin: 'the earth',
|
15759 |
+
* hint: 'You may find it beneficial to transition gradually.',
|
15760 |
+
* } );
|
15761 |
+
*
|
15762 |
+
* // Logs: 'Eating meat is deprecated and will be removed from the earth in the future. Please use vegetables instead. Note: You may find it beneficial to transition gradually.'
|
15763 |
+
* ```
|
15764 |
+
*/
|
15765 |
+
|
15766 |
+
function deprecated(feature) {
|
15767 |
+
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
15768 |
+
var version = options.version,
|
15769 |
+
alternative = options.alternative,
|
15770 |
+
plugin = options.plugin,
|
15771 |
+
link = options.link,
|
15772 |
+
hint = options.hint;
|
15773 |
+
var pluginMessage = plugin ? " from ".concat(plugin) : '';
|
15774 |
+
var versionMessage = version ? " and will be removed".concat(pluginMessage, " in version ").concat(version) : '';
|
15775 |
+
var useInsteadMessage = alternative ? " Please use ".concat(alternative, " instead.") : '';
|
15776 |
+
var linkMessage = link ? " See: ".concat(link) : '';
|
15777 |
+
var hintMessage = hint ? " Note: ".concat(hint) : '';
|
15778 |
+
var message = "".concat(feature, " is deprecated").concat(versionMessage, ".").concat(useInsteadMessage).concat(linkMessage).concat(hintMessage); // Skip if already logged.
|
15779 |
+
|
15780 |
+
if (message in logged) {
|
15781 |
+
return;
|
15782 |
+
}
|
15783 |
+
/**
|
15784 |
+
* Fires whenever a deprecated feature is encountered
|
15785 |
+
*
|
15786 |
+
* @param {string} feature Name of the deprecated feature.
|
15787 |
+
* @param {?Object} options Personalisation options
|
15788 |
+
* @param {?string} options.version Version in which the feature will be removed.
|
15789 |
+
* @param {?string} options.alternative Feature to use instead
|
15790 |
+
* @param {?string} options.plugin Plugin name if it's a plugin feature
|
15791 |
+
* @param {?string} options.link Link to documentation
|
15792 |
+
* @param {?string} options.hint Additional message to help transition away from the deprecated feature.
|
15793 |
+
* @param {?string} message Message sent to console.warn
|
15794 |
+
*/
|
15795 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15796 |
|
15797 |
+
Object(_wordpress_hooks__WEBPACK_IMPORTED_MODULE_0__["doAction"])('deprecated', feature, options, message); // eslint-disable-next-line no-console
|
15798 |
+
|
15799 |
+
console.warn(message);
|
15800 |
+
logged[message] = true;
|
15801 |
}
|
15802 |
+
//# sourceMappingURL=index.js.map
|
15803 |
|
15804 |
+
/***/ }),
|
|
|
|
|
|
|
|
|
|
|
|
|
15805 |
|
15806 |
+
/***/ 57:
|
15807 |
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
15808 |
+
|
15809 |
+
"use strict";
|
15810 |
+
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2);
|
15811 |
+
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_0__);
|
15812 |
/**
|
15813 |
* External dependencies
|
15814 |
*/
|
15815 |
|
15816 |
/**
|
15817 |
+
* Given a function mapping a component to an enhanced component and modifier
|
15818 |
+
* name, returns the enhanced component augmented with a generated displayName.
|
15819 |
+
*
|
15820 |
+
* @param {Function} mapComponentToEnhancedComponent Function mapping component
|
15821 |
+
* to enhanced component.
|
15822 |
+
* @param {string} modifierName Seed name from which to
|
15823 |
+
* generated display name.
|
15824 |
+
*
|
15825 |
+
* @return {WPComponent} Component class with generated display name assigned.
|
15826 |
*/
|
15827 |
|
15828 |
+
function createHigherOrderComponent(mapComponentToEnhancedComponent, modifierName) {
|
15829 |
+
return function (OriginalComponent) {
|
15830 |
+
var EnhancedComponent = mapComponentToEnhancedComponent(OriginalComponent);
|
15831 |
+
var _OriginalComponent$di = OriginalComponent.displayName,
|
15832 |
+
displayName = _OriginalComponent$di === void 0 ? OriginalComponent.name || 'Component' : _OriginalComponent$di;
|
15833 |
+
EnhancedComponent.displayName = "".concat(Object(loda
|