You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

141 lines
4.3 KiB

1 year ago
  1. /******/ (function() { // webpackBootstrap
  2. /******/ "use strict";
  3. /******/ // The require scope
  4. /******/ var __webpack_require__ = {};
  5. /******/
  6. /************************************************************************/
  7. /******/ /* webpack/runtime/define property getters */
  8. /******/ !function() {
  9. /******/ // define getter functions for harmony exports
  10. /******/ __webpack_require__.d = function(exports, definition) {
  11. /******/ for(var key in definition) {
  12. /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
  13. /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
  14. /******/ }
  15. /******/ }
  16. /******/ };
  17. /******/ }();
  18. /******/
  19. /******/ /* webpack/runtime/hasOwnProperty shorthand */
  20. /******/ !function() {
  21. /******/ __webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }
  22. /******/ }();
  23. /******/
  24. /******/ /* webpack/runtime/make namespace object */
  25. /******/ !function() {
  26. /******/ // define __esModule on exports
  27. /******/ __webpack_require__.r = function(exports) {
  28. /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
  29. /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
  30. /******/ }
  31. /******/ Object.defineProperty(exports, '__esModule', { value: true });
  32. /******/ };
  33. /******/ }();
  34. /******/
  35. /************************************************************************/
  36. var __webpack_exports__ = {};
  37. // ESM COMPAT FLAG
  38. __webpack_require__.r(__webpack_exports__);
  39. // EXPORTS
  40. __webpack_require__.d(__webpack_exports__, {
  41. "default": function() { return /* binding */ isShallowEqual; },
  42. isShallowEqualArrays: function() { return /* reexport */ isShallowEqualArrays; },
  43. isShallowEqualObjects: function() { return /* reexport */ isShallowEqualObjects; }
  44. });
  45. ;// CONCATENATED MODULE: ./node_modules/@wordpress/is-shallow-equal/build-module/objects.js
  46. /**
  47. * Returns true if the two objects are shallow equal, or false otherwise.
  48. *
  49. * @param {import('.').ComparableObject} a First object to compare.
  50. * @param {import('.').ComparableObject} b Second object to compare.
  51. *
  52. * @return {boolean} Whether the two objects are shallow equal.
  53. */
  54. function isShallowEqualObjects(a, b) {
  55. if (a === b) {
  56. return true;
  57. }
  58. const aKeys = Object.keys(a);
  59. const bKeys = Object.keys(b);
  60. if (aKeys.length !== bKeys.length) {
  61. return false;
  62. }
  63. let i = 0;
  64. while (i < aKeys.length) {
  65. const key = aKeys[i];
  66. const aValue = a[key];
  67. if (
  68. // In iterating only the keys of the first object after verifying
  69. // equal lengths, account for the case that an explicit `undefined`
  70. // value in the first is implicitly undefined in the second.
  71. //
  72. // Example: isShallowEqualObjects( { a: undefined }, { b: 5 } )
  73. aValue === undefined && !b.hasOwnProperty(key) || aValue !== b[key]) {
  74. return false;
  75. }
  76. i++;
  77. }
  78. return true;
  79. }
  80. ;// CONCATENATED MODULE: ./node_modules/@wordpress/is-shallow-equal/build-module/arrays.js
  81. /**
  82. * Returns true if the two arrays are shallow equal, or false otherwise.
  83. *
  84. * @param {any[]} a First array to compare.
  85. * @param {any[]} b Second array to compare.
  86. *
  87. * @return {boolean} Whether the two arrays are shallow equal.
  88. */
  89. function isShallowEqualArrays(a, b) {
  90. if (a === b) {
  91. return true;
  92. }
  93. if (a.length !== b.length) {
  94. return false;
  95. }
  96. for (let i = 0, len = a.length; i < len; i++) {
  97. if (a[i] !== b[i]) {
  98. return false;
  99. }
  100. }
  101. return true;
  102. }
  103. ;// CONCATENATED MODULE: ./node_modules/@wordpress/is-shallow-equal/build-module/index.js
  104. /**
  105. * Internal dependencies
  106. */
  107. /**
  108. * @typedef {Record<string, any>} ComparableObject
  109. */
  110. /**
  111. * Returns true if the two arrays or objects are shallow equal, or false
  112. * otherwise. Also handles primitive values, just in case.
  113. *
  114. * @param {unknown} a First object or array to compare.
  115. * @param {unknown} b Second object or array to compare.
  116. *
  117. * @return {boolean} Whether the two values are shallow equal.
  118. */
  119. function isShallowEqual(a, b) {
  120. if (a && b) {
  121. if (a.constructor === Object && b.constructor === Object) {
  122. return isShallowEqualObjects(a, b);
  123. } else if (Array.isArray(a) && Array.isArray(b)) {
  124. return isShallowEqualArrays(a, b);
  125. }
  126. }
  127. return a === b;
  128. }
  129. (window.wp = window.wp || {}).isShallowEqual = __webpack_exports__;
  130. /******/ })()
  131. ;