92 |
92 |
93 (function() { module.exports = this["wp"]["element"]; }()); |
93 (function() { module.exports = this["wp"]["element"]; }()); |
94 |
94 |
95 /***/ }), |
95 /***/ }), |
96 |
96 |
97 /***/ 10: |
97 /***/ 126: |
98 /***/ (function(module, __webpack_exports__, __webpack_require__) { |
98 /***/ (function(module, exports, __webpack_require__) { |
99 |
99 |
100 "use strict"; |
100 "use strict"; |
101 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _classCallCheck; }); |
101 |
|
102 |
|
103 function _typeof(obj) { |
|
104 if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { |
|
105 _typeof = function (obj) { |
|
106 return typeof obj; |
|
107 }; |
|
108 } else { |
|
109 _typeof = function (obj) { |
|
110 return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; |
|
111 }; |
|
112 } |
|
113 |
|
114 return _typeof(obj); |
|
115 } |
|
116 |
102 function _classCallCheck(instance, Constructor) { |
117 function _classCallCheck(instance, Constructor) { |
103 if (!(instance instanceof Constructor)) { |
118 if (!(instance instanceof Constructor)) { |
104 throw new TypeError("Cannot call a class as a function"); |
119 throw new TypeError("Cannot call a class as a function"); |
105 } |
120 } |
106 } |
121 } |
107 |
122 |
|
123 function _defineProperties(target, props) { |
|
124 for (var i = 0; i < props.length; i++) { |
|
125 var descriptor = props[i]; |
|
126 descriptor.enumerable = descriptor.enumerable || false; |
|
127 descriptor.configurable = true; |
|
128 if ("value" in descriptor) descriptor.writable = true; |
|
129 Object.defineProperty(target, descriptor.key, descriptor); |
|
130 } |
|
131 } |
|
132 |
|
133 function _createClass(Constructor, protoProps, staticProps) { |
|
134 if (protoProps) _defineProperties(Constructor.prototype, protoProps); |
|
135 if (staticProps) _defineProperties(Constructor, staticProps); |
|
136 return Constructor; |
|
137 } |
|
138 |
|
139 /** |
|
140 * Given an instance of EquivalentKeyMap, returns its internal value pair tuple |
|
141 * for a key, if one exists. The tuple members consist of the last reference |
|
142 * value for the key (used in efficient subsequent lookups) and the value |
|
143 * assigned for the key at the leaf node. |
|
144 * |
|
145 * @param {EquivalentKeyMap} instance EquivalentKeyMap instance. |
|
146 * @param {*} key The key for which to return value pair. |
|
147 * |
|
148 * @return {?Array} Value pair, if exists. |
|
149 */ |
|
150 function getValuePair(instance, key) { |
|
151 var _map = instance._map, |
|
152 _arrayTreeMap = instance._arrayTreeMap, |
|
153 _objectTreeMap = instance._objectTreeMap; // Map keeps a reference to the last object-like key used to set the |
|
154 // value, which can be used to shortcut immediately to the value. |
|
155 |
|
156 if (_map.has(key)) { |
|
157 return _map.get(key); |
|
158 } // Sort keys to ensure stable retrieval from tree. |
|
159 |
|
160 |
|
161 var properties = Object.keys(key).sort(); // Tree by type to avoid conflicts on numeric object keys, empty value. |
|
162 |
|
163 var map = Array.isArray(key) ? _arrayTreeMap : _objectTreeMap; |
|
164 |
|
165 for (var i = 0; i < properties.length; i++) { |
|
166 var property = properties[i]; |
|
167 map = map.get(property); |
|
168 |
|
169 if (map === undefined) { |
|
170 return; |
|
171 } |
|
172 |
|
173 var propertyValue = key[property]; |
|
174 map = map.get(propertyValue); |
|
175 |
|
176 if (map === undefined) { |
|
177 return; |
|
178 } |
|
179 } |
|
180 |
|
181 var valuePair = map.get('_ekm_value'); |
|
182 |
|
183 if (!valuePair) { |
|
184 return; |
|
185 } // If reached, it implies that an object-like key was set with another |
|
186 // reference, so delete the reference and replace with the current. |
|
187 |
|
188 |
|
189 _map.delete(valuePair[0]); |
|
190 |
|
191 valuePair[0] = key; |
|
192 map.set('_ekm_value', valuePair); |
|
193 |
|
194 _map.set(key, valuePair); |
|
195 |
|
196 return valuePair; |
|
197 } |
|
198 /** |
|
199 * Variant of a Map object which enables lookup by equivalent (deeply equal) |
|
200 * object and array keys. |
|
201 */ |
|
202 |
|
203 |
|
204 var EquivalentKeyMap = |
|
205 /*#__PURE__*/ |
|
206 function () { |
|
207 /** |
|
208 * Constructs a new instance of EquivalentKeyMap. |
|
209 * |
|
210 * @param {Iterable.<*>} iterable Initial pair of key, value for map. |
|
211 */ |
|
212 function EquivalentKeyMap(iterable) { |
|
213 _classCallCheck(this, EquivalentKeyMap); |
|
214 |
|
215 this.clear(); |
|
216 |
|
217 if (iterable instanceof EquivalentKeyMap) { |
|
218 // Map#forEach is only means of iterating with support for IE11. |
|
219 var iterablePairs = []; |
|
220 iterable.forEach(function (value, key) { |
|
221 iterablePairs.push([key, value]); |
|
222 }); |
|
223 iterable = iterablePairs; |
|
224 } |
|
225 |
|
226 if (iterable != null) { |
|
227 for (var i = 0; i < iterable.length; i++) { |
|
228 this.set(iterable[i][0], iterable[i][1]); |
|
229 } |
|
230 } |
|
231 } |
|
232 /** |
|
233 * Accessor property returning the number of elements. |
|
234 * |
|
235 * @return {number} Number of elements. |
|
236 */ |
|
237 |
|
238 |
|
239 _createClass(EquivalentKeyMap, [{ |
|
240 key: "set", |
|
241 |
|
242 /** |
|
243 * Add or update an element with a specified key and value. |
|
244 * |
|
245 * @param {*} key The key of the element to add. |
|
246 * @param {*} value The value of the element to add. |
|
247 * |
|
248 * @return {EquivalentKeyMap} Map instance. |
|
249 */ |
|
250 value: function set(key, value) { |
|
251 // Shortcut non-object-like to set on internal Map. |
|
252 if (key === null || _typeof(key) !== 'object') { |
|
253 this._map.set(key, value); |
|
254 |
|
255 return this; |
|
256 } // Sort keys to ensure stable assignment into tree. |
|
257 |
|
258 |
|
259 var properties = Object.keys(key).sort(); |
|
260 var valuePair = [key, value]; // Tree by type to avoid conflicts on numeric object keys, empty value. |
|
261 |
|
262 var map = Array.isArray(key) ? this._arrayTreeMap : this._objectTreeMap; |
|
263 |
|
264 for (var i = 0; i < properties.length; i++) { |
|
265 var property = properties[i]; |
|
266 |
|
267 if (!map.has(property)) { |
|
268 map.set(property, new EquivalentKeyMap()); |
|
269 } |
|
270 |
|
271 map = map.get(property); |
|
272 var propertyValue = key[property]; |
|
273 |
|
274 if (!map.has(propertyValue)) { |
|
275 map.set(propertyValue, new EquivalentKeyMap()); |
|
276 } |
|
277 |
|
278 map = map.get(propertyValue); |
|
279 } // If an _ekm_value exists, there was already an equivalent key. Before |
|
280 // overriding, ensure that the old key reference is removed from map to |
|
281 // avoid memory leak of accumulating equivalent keys. This is, in a |
|
282 // sense, a poor man's WeakMap, while still enabling iterability. |
|
283 |
|
284 |
|
285 var previousValuePair = map.get('_ekm_value'); |
|
286 |
|
287 if (previousValuePair) { |
|
288 this._map.delete(previousValuePair[0]); |
|
289 } |
|
290 |
|
291 map.set('_ekm_value', valuePair); |
|
292 |
|
293 this._map.set(key, valuePair); |
|
294 |
|
295 return this; |
|
296 } |
|
297 /** |
|
298 * Returns a specified element. |
|
299 * |
|
300 * @param {*} key The key of the element to return. |
|
301 * |
|
302 * @return {?*} The element associated with the specified key or undefined |
|
303 * if the key can't be found. |
|
304 */ |
|
305 |
|
306 }, { |
|
307 key: "get", |
|
308 value: function get(key) { |
|
309 // Shortcut non-object-like to get from internal Map. |
|
310 if (key === null || _typeof(key) !== 'object') { |
|
311 return this._map.get(key); |
|
312 } |
|
313 |
|
314 var valuePair = getValuePair(this, key); |
|
315 |
|
316 if (valuePair) { |
|
317 return valuePair[1]; |
|
318 } |
|
319 } |
|
320 /** |
|
321 * Returns a boolean indicating whether an element with the specified key |
|
322 * exists or not. |
|
323 * |
|
324 * @param {*} key The key of the element to test for presence. |
|
325 * |
|
326 * @return {boolean} Whether an element with the specified key exists. |
|
327 */ |
|
328 |
|
329 }, { |
|
330 key: "has", |
|
331 value: function has(key) { |
|
332 if (key === null || _typeof(key) !== 'object') { |
|
333 return this._map.has(key); |
|
334 } // Test on the _presence_ of the pair, not its value, as even undefined |
|
335 // can be a valid member value for a key. |
|
336 |
|
337 |
|
338 return getValuePair(this, key) !== undefined; |
|
339 } |
|
340 /** |
|
341 * Removes the specified element. |
|
342 * |
|
343 * @param {*} key The key of the element to remove. |
|
344 * |
|
345 * @return {boolean} Returns true if an element existed and has been |
|
346 * removed, or false if the element does not exist. |
|
347 */ |
|
348 |
|
349 }, { |
|
350 key: "delete", |
|
351 value: function _delete(key) { |
|
352 if (!this.has(key)) { |
|
353 return false; |
|
354 } // This naive implementation will leave orphaned child trees. A better |
|
355 // implementation should traverse and remove orphans. |
|
356 |
|
357 |
|
358 this.set(key, undefined); |
|
359 return true; |
|
360 } |
|
361 /** |
|
362 * Executes a provided function once per each key/value pair, in insertion |
|
363 * order. |
|
364 * |
|
365 * @param {Function} callback Function to execute for each element. |
|
366 * @param {*} thisArg Value to use as `this` when executing |
|
367 * `callback`. |
|
368 */ |
|
369 |
|
370 }, { |
|
371 key: "forEach", |
|
372 value: function forEach(callback) { |
|
373 var _this = this; |
|
374 |
|
375 var thisArg = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this; |
|
376 |
|
377 this._map.forEach(function (value, key) { |
|
378 // Unwrap value from object-like value pair. |
|
379 if (key !== null && _typeof(key) === 'object') { |
|
380 value = value[1]; |
|
381 } |
|
382 |
|
383 callback.call(thisArg, value, key, _this); |
|
384 }); |
|
385 } |
|
386 /** |
|
387 * Removes all elements. |
|
388 */ |
|
389 |
|
390 }, { |
|
391 key: "clear", |
|
392 value: function clear() { |
|
393 this._map = new Map(); |
|
394 this._arrayTreeMap = new Map(); |
|
395 this._objectTreeMap = new Map(); |
|
396 } |
|
397 }, { |
|
398 key: "size", |
|
399 get: function get() { |
|
400 return this._map.size; |
|
401 } |
|
402 }]); |
|
403 |
|
404 return EquivalentKeyMap; |
|
405 }(); |
|
406 |
|
407 module.exports = EquivalentKeyMap; |
|
408 |
|
409 |
108 /***/ }), |
410 /***/ }), |
109 |
411 |
110 /***/ 100: |
412 /***/ 127: |
111 /***/ (function(module, exports) { |
413 /***/ (function(module, exports) { |
112 |
414 |
|
415 var g; |
|
416 |
|
417 // This works in non-strict mode |
|
418 g = (function() { |
|
419 return this; |
|
420 })(); |
|
421 |
|
422 try { |
|
423 // This works if eval is allowed (see CSP) |
|
424 g = g || new Function("return this")(); |
|
425 } catch (e) { |
|
426 // This works if the window reference is available |
|
427 if (typeof window === "object") g = window; |
|
428 } |
|
429 |
|
430 // g can still be undefined, but nothing to do about it... |
|
431 // We return undefined, instead of nothing here, so it's |
|
432 // easier to handle this case. if(!global) { ...} |
|
433 |
|
434 module.exports = g; |
|
435 |
|
436 |
|
437 /***/ }), |
|
438 |
|
439 /***/ 13: |
|
440 /***/ (function(module, exports) { |
|
441 |
|
442 (function() { module.exports = this["React"]; }()); |
|
443 |
|
444 /***/ }), |
|
445 |
|
446 /***/ 14: |
|
447 /***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
448 |
|
449 "use strict"; |
|
450 |
|
451 // EXPORTS |
|
452 __webpack_require__.d(__webpack_exports__, "a", function() { return /* binding */ _slicedToArray; }); |
|
453 |
|
454 // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js |
|
455 var arrayWithHoles = __webpack_require__(38); |
|
456 |
|
457 // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js |
|
458 function _iterableToArrayLimit(arr, i) { |
|
459 if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return; |
|
460 var _arr = []; |
|
461 var _n = true; |
|
462 var _d = false; |
|
463 var _e = undefined; |
|
464 |
|
465 try { |
|
466 for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { |
|
467 _arr.push(_s.value); |
|
468 |
|
469 if (i && _arr.length === i) break; |
|
470 } |
|
471 } catch (err) { |
|
472 _d = true; |
|
473 _e = err; |
|
474 } finally { |
|
475 try { |
|
476 if (!_n && _i["return"] != null) _i["return"](); |
|
477 } finally { |
|
478 if (_d) throw _e; |
|
479 } |
|
480 } |
|
481 |
|
482 return _arr; |
|
483 } |
|
484 // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js |
|
485 var unsupportedIterableToArray = __webpack_require__(29); |
|
486 |
|
487 // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/nonIterableRest.js |
|
488 var nonIterableRest = __webpack_require__(39); |
|
489 |
|
490 // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/slicedToArray.js |
|
491 |
|
492 |
|
493 |
|
494 |
|
495 function _slicedToArray(arr, i) { |
|
496 return Object(arrayWithHoles["a" /* default */])(arr) || _iterableToArrayLimit(arr, i) || Object(unsupportedIterableToArray["a" /* default */])(arr, i) || Object(nonIterableRest["a" /* default */])(); |
|
497 } |
|
498 |
|
499 /***/ }), |
|
500 |
|
501 /***/ 150: |
|
502 /***/ (function(module, exports) { |
|
503 |
|
504 (function() { module.exports = this["wp"]["priorityQueue"]; }()); |
|
505 |
|
506 /***/ }), |
|
507 |
|
508 /***/ 151: |
|
509 /***/ (function(module, exports) { |
|
510 |
113 module.exports = isPromise; |
511 module.exports = isPromise; |
|
512 module.exports.default = isPromise; |
114 |
513 |
115 function isPromise(obj) { |
514 function isPromise(obj) { |
116 return !!obj && (typeof obj === 'object' || typeof obj === 'function') && typeof obj.then === 'function'; |
515 return !!obj && (typeof obj === 'object' || typeof obj === 'function') && typeof obj.then === 'function'; |
117 } |
516 } |
118 |
517 |
119 |
518 |
120 /***/ }), |
519 /***/ }), |
121 |
520 |
122 /***/ 11: |
521 /***/ 163: |
|
522 /***/ (function(module, exports) { |
|
523 |
|
524 function combineReducers( reducers ) { |
|
525 var keys = Object.keys( reducers ), |
|
526 getNextState; |
|
527 |
|
528 getNextState = ( function() { |
|
529 var fn, i, key; |
|
530 |
|
531 fn = 'return {'; |
|
532 for ( i = 0; i < keys.length; i++ ) { |
|
533 // Rely on Quoted escaping of JSON.stringify with guarantee that |
|
534 // each member of Object.keys is a string. |
|
535 // |
|
536 // "If Type(value) is String, then return the result of calling the |
|
537 // abstract operation Quote with argument value. [...] The abstract |
|
538 // operation Quote(value) wraps a String value in double quotes and |
|
539 // escapes characters within it." |
|
540 // |
|
541 // https://www.ecma-international.org/ecma-262/5.1/#sec-15.12.3 |
|
542 key = JSON.stringify( keys[ i ] ); |
|
543 |
|
544 fn += key + ':r[' + key + '](s[' + key + '],a),'; |
|
545 } |
|
546 fn += '}'; |
|
547 |
|
548 return new Function( 'r,s,a', fn ); |
|
549 } )(); |
|
550 |
|
551 return function combinedReducer( state, action ) { |
|
552 var nextState, i, key; |
|
553 |
|
554 // Assumed changed if initial state. |
|
555 if ( state === undefined ) { |
|
556 return getNextState( reducers, {}, action ); |
|
557 } |
|
558 |
|
559 nextState = getNextState( reducers, state, action ); |
|
560 |
|
561 // Determine whether state has changed. |
|
562 i = keys.length; |
|
563 while ( i-- ) { |
|
564 key = keys[ i ]; |
|
565 if ( state[ key ] !== nextState[ key ] ) { |
|
566 // Return immediately if a changed value is encountered. |
|
567 return nextState; |
|
568 } |
|
569 } |
|
570 |
|
571 return state; |
|
572 }; |
|
573 } |
|
574 |
|
575 module.exports = combineReducers; |
|
576 |
|
577 |
|
578 /***/ }), |
|
579 |
|
580 /***/ 18: |
123 /***/ (function(module, __webpack_exports__, __webpack_require__) { |
581 /***/ (function(module, __webpack_exports__, __webpack_require__) { |
124 |
582 |
125 "use strict"; |
583 "use strict"; |
126 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _possibleConstructorReturn; }); |
584 |
127 /* harmony import */ var _helpers_esm_typeof__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(32); |
585 // EXPORTS |
128 /* harmony import */ var _assertThisInitialized__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(3); |
586 __webpack_require__.d(__webpack_exports__, "a", function() { return /* binding */ _toConsumableArray; }); |
129 |
587 |
130 |
588 // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js |
131 function _possibleConstructorReturn(self, call) { |
589 var arrayLikeToArray = __webpack_require__(26); |
132 if (call && (Object(_helpers_esm_typeof__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])(call) === "object" || typeof call === "function")) { |
590 |
133 return call; |
591 // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/arrayWithoutHoles.js |
134 } |
592 |
135 |
593 function _arrayWithoutHoles(arr) { |
136 return Object(_assertThisInitialized__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"])(self); |
594 if (Array.isArray(arr)) return Object(arrayLikeToArray["a" /* default */])(arr); |
|
595 } |
|
596 // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/iterableToArray.js |
|
597 var iterableToArray = __webpack_require__(35); |
|
598 |
|
599 // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js |
|
600 var unsupportedIterableToArray = __webpack_require__(29); |
|
601 |
|
602 // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/nonIterableSpread.js |
|
603 function _nonIterableSpread() { |
|
604 throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); |
|
605 } |
|
606 // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js |
|
607 |
|
608 |
|
609 |
|
610 |
|
611 function _toConsumableArray(arr) { |
|
612 return _arrayWithoutHoles(arr) || Object(iterableToArray["a" /* default */])(arr) || Object(unsupportedIterableToArray["a" /* default */])(arr) || _nonIterableSpread(); |
137 } |
613 } |
138 |
614 |
139 /***/ }), |
615 /***/ }), |
140 |
616 |
141 /***/ 12: |
617 /***/ 196: |
142 /***/ (function(module, __webpack_exports__, __webpack_require__) { |
618 /***/ (function(module, __webpack_exports__, __webpack_require__) { |
143 |
619 |
144 "use strict"; |
620 "use strict"; |
145 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _getPrototypeOf; }); |
621 /* WEBPACK VAR INJECTION */(function(global, module) {/* harmony import */ var _ponyfill_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(275); |
146 function _getPrototypeOf(o) { |
622 /* global window */ |
147 _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { |
623 |
148 return o.__proto__ || Object.getPrototypeOf(o); |
624 |
149 }; |
625 var root; |
150 return _getPrototypeOf(o); |
626 |
151 } |
627 if (typeof self !== 'undefined') { |
|
628 root = self; |
|
629 } else if (typeof window !== 'undefined') { |
|
630 root = window; |
|
631 } else if (typeof global !== 'undefined') { |
|
632 root = global; |
|
633 } else if (true) { |
|
634 root = module; |
|
635 } else {} |
|
636 |
|
637 var result = Object(_ponyfill_js__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])(root); |
|
638 /* harmony default export */ __webpack_exports__["a"] = (result); |
|
639 |
|
640 /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(127), __webpack_require__(412)(module))) |
152 |
641 |
153 /***/ }), |
642 /***/ }), |
154 |
643 |
155 /***/ 13: |
644 /***/ 2: |
|
645 /***/ (function(module, exports) { |
|
646 |
|
647 (function() { module.exports = this["lodash"]; }()); |
|
648 |
|
649 /***/ }), |
|
650 |
|
651 /***/ 24: |
|
652 /***/ (function(module, exports) { |
|
653 |
|
654 (function() { module.exports = this["regeneratorRuntime"]; }()); |
|
655 |
|
656 /***/ }), |
|
657 |
|
658 /***/ 26: |
156 /***/ (function(module, __webpack_exports__, __webpack_require__) { |
659 /***/ (function(module, __webpack_exports__, __webpack_require__) { |
157 |
660 |
158 "use strict"; |
661 "use strict"; |
159 |
662 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _arrayLikeToArray; }); |
160 // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js |
663 function _arrayLikeToArray(arr, len) { |
161 function _setPrototypeOf(o, p) { |
664 if (len == null || len > arr.length) len = arr.length; |
162 _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { |
665 |
163 o.__proto__ = p; |
666 for (var i = 0, arr2 = new Array(len); i < len; i++) { |
164 return o; |
667 arr2[i] = arr[i]; |
165 }; |
668 } |
166 |
669 |
167 return _setPrototypeOf(o, p); |
670 return arr2; |
168 } |
|
169 // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/inherits.js |
|
170 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _inherits; }); |
|
171 |
|
172 function _inherits(subClass, superClass) { |
|
173 if (typeof superClass !== "function" && superClass !== null) { |
|
174 throw new TypeError("Super expression must either be null or a function"); |
|
175 } |
|
176 |
|
177 subClass.prototype = Object.create(superClass && superClass.prototype, { |
|
178 constructor: { |
|
179 value: subClass, |
|
180 writable: true, |
|
181 configurable: true |
|
182 } |
|
183 }); |
|
184 if (superClass) _setPrototypeOf(subClass, superClass); |
|
185 } |
671 } |
186 |
672 |
187 /***/ }), |
673 /***/ }), |
188 |
674 |
189 /***/ 132: |
675 /***/ 274: |
|
676 /***/ (function(module, exports) { |
|
677 |
|
678 (function() { module.exports = this["wp"]["reduxRoutine"]; }()); |
|
679 |
|
680 /***/ }), |
|
681 |
|
682 /***/ 275: |
|
683 /***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
684 |
|
685 "use strict"; |
|
686 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return symbolObservablePonyfill; }); |
|
687 function symbolObservablePonyfill(root) { |
|
688 var result; |
|
689 var Symbol = root.Symbol; |
|
690 |
|
691 if (typeof Symbol === 'function') { |
|
692 if (Symbol.observable) { |
|
693 result = Symbol.observable; |
|
694 } else { |
|
695 result = Symbol('observable'); |
|
696 Symbol.observable = result; |
|
697 } |
|
698 } else { |
|
699 result = '@@observable'; |
|
700 } |
|
701 |
|
702 return result; |
|
703 }; |
|
704 |
|
705 |
|
706 /***/ }), |
|
707 |
|
708 /***/ 29: |
|
709 /***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
710 |
|
711 "use strict"; |
|
712 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _unsupportedIterableToArray; }); |
|
713 /* harmony import */ var _arrayLikeToArray__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(26); |
|
714 |
|
715 function _unsupportedIterableToArray(o, minLen) { |
|
716 if (!o) return; |
|
717 if (typeof o === "string") return Object(_arrayLikeToArray__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])(o, minLen); |
|
718 var n = Object.prototype.toString.call(o).slice(8, -1); |
|
719 if (n === "Object" && o.constructor) n = o.constructor.name; |
|
720 if (n === "Map" || n === "Set") return Array.from(o); |
|
721 if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return Object(_arrayLikeToArray__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])(o, minLen); |
|
722 } |
|
723 |
|
724 /***/ }), |
|
725 |
|
726 /***/ 35: |
|
727 /***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
728 |
|
729 "use strict"; |
|
730 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _iterableToArray; }); |
|
731 function _iterableToArray(iter) { |
|
732 if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter); |
|
733 } |
|
734 |
|
735 /***/ }), |
|
736 |
|
737 /***/ 37: |
|
738 /***/ (function(module, exports) { |
|
739 |
|
740 (function() { module.exports = this["wp"]["deprecated"]; }()); |
|
741 |
|
742 /***/ }), |
|
743 |
|
744 /***/ 38: |
|
745 /***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
746 |
|
747 "use strict"; |
|
748 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _arrayWithHoles; }); |
|
749 function _arrayWithHoles(arr) { |
|
750 if (Array.isArray(arr)) return arr; |
|
751 } |
|
752 |
|
753 /***/ }), |
|
754 |
|
755 /***/ 39: |
|
756 /***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
757 |
|
758 "use strict"; |
|
759 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _nonIterableRest; }); |
|
760 function _nonIterableRest() { |
|
761 throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); |
|
762 } |
|
763 |
|
764 /***/ }), |
|
765 |
|
766 /***/ 412: |
190 /***/ (function(module, exports) { |
767 /***/ (function(module, exports) { |
191 |
768 |
192 module.exports = function(originalModule) { |
769 module.exports = function(originalModule) { |
193 if (!originalModule.webpackPolyfill) { |
770 if (!originalModule.webpackPolyfill) { |
194 var module = Object.create(originalModule); |
771 var module = Object.create(originalModule); |
215 }; |
792 }; |
216 |
793 |
217 |
794 |
218 /***/ }), |
795 /***/ }), |
219 |
796 |
220 /***/ 15: |
797 /***/ 442: |
221 /***/ (function(module, __webpack_exports__, __webpack_require__) { |
798 /***/ (function(module, __webpack_exports__, __webpack_require__) { |
222 |
799 |
223 "use strict"; |
800 "use strict"; |
224 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _defineProperty; }); |
801 // ESM COMPAT FLAG |
225 function _defineProperty(obj, key, value) { |
|
226 if (key in obj) { |
|
227 Object.defineProperty(obj, key, { |
|
228 value: value, |
|
229 enumerable: true, |
|
230 configurable: true, |
|
231 writable: true |
|
232 }); |
|
233 } else { |
|
234 obj[key] = value; |
|
235 } |
|
236 |
|
237 return obj; |
|
238 } |
|
239 |
|
240 /***/ }), |
|
241 |
|
242 /***/ 17: |
|
243 /***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
244 |
|
245 "use strict"; |
|
246 |
|
247 // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/arrayWithoutHoles.js |
|
248 function _arrayWithoutHoles(arr) { |
|
249 if (Array.isArray(arr)) { |
|
250 for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { |
|
251 arr2[i] = arr[i]; |
|
252 } |
|
253 |
|
254 return arr2; |
|
255 } |
|
256 } |
|
257 // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/iterableToArray.js |
|
258 var iterableToArray = __webpack_require__(34); |
|
259 |
|
260 // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/nonIterableSpread.js |
|
261 function _nonIterableSpread() { |
|
262 throw new TypeError("Invalid attempt to spread non-iterable instance"); |
|
263 } |
|
264 // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js |
|
265 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _toConsumableArray; }); |
|
266 |
|
267 |
|
268 |
|
269 function _toConsumableArray(arr) { |
|
270 return _arrayWithoutHoles(arr) || Object(iterableToArray["a" /* default */])(arr) || _nonIterableSpread(); |
|
271 } |
|
272 |
|
273 /***/ }), |
|
274 |
|
275 /***/ 19: |
|
276 /***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
277 |
|
278 "use strict"; |
|
279 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _extends; }); |
|
280 function _extends() { |
|
281 _extends = Object.assign || function (target) { |
|
282 for (var i = 1; i < arguments.length; i++) { |
|
283 var source = arguments[i]; |
|
284 |
|
285 for (var key in source) { |
|
286 if (Object.prototype.hasOwnProperty.call(source, key)) { |
|
287 target[key] = source[key]; |
|
288 } |
|
289 } |
|
290 } |
|
291 |
|
292 return target; |
|
293 }; |
|
294 |
|
295 return _extends.apply(this, arguments); |
|
296 } |
|
297 |
|
298 /***/ }), |
|
299 |
|
300 /***/ 197: |
|
301 /***/ (function(module, exports) { |
|
302 |
|
303 function combineReducers( reducers ) { |
|
304 var keys = Object.keys( reducers ), |
|
305 getNextState; |
|
306 |
|
307 getNextState = ( function() { |
|
308 var fn, i, key; |
|
309 |
|
310 fn = 'return {'; |
|
311 for ( i = 0; i < keys.length; i++ ) { |
|
312 // Rely on Quoted escaping of JSON.stringify with guarantee that |
|
313 // each member of Object.keys is a string. |
|
314 // |
|
315 // "If Type(value) is String, then return the result of calling the |
|
316 // abstract operation Quote with argument value. [...] The abstract |
|
317 // operation Quote(value) wraps a String value in double quotes and |
|
318 // escapes characters within it." |
|
319 // |
|
320 // https://www.ecma-international.org/ecma-262/5.1/#sec-15.12.3 |
|
321 key = JSON.stringify( keys[ i ] ); |
|
322 |
|
323 fn += key + ':r[' + key + '](s[' + key + '],a),'; |
|
324 } |
|
325 fn += '}'; |
|
326 |
|
327 return new Function( 'r,s,a', fn ); |
|
328 } )(); |
|
329 |
|
330 return function combinedReducer( state, action ) { |
|
331 var nextState, i, key; |
|
332 |
|
333 // Assumed changed if initial state. |
|
334 if ( state === undefined ) { |
|
335 return getNextState( reducers, {}, action ); |
|
336 } |
|
337 |
|
338 nextState = getNextState( reducers, state, action ); |
|
339 |
|
340 // Determine whether state has changed. |
|
341 i = keys.length; |
|
342 while ( i-- ) { |
|
343 key = keys[ i ]; |
|
344 if ( state[ key ] !== nextState[ key ] ) { |
|
345 // Return immediately if a changed value is encountered. |
|
346 return nextState; |
|
347 } |
|
348 } |
|
349 |
|
350 return state; |
|
351 }; |
|
352 } |
|
353 |
|
354 module.exports = combineReducers; |
|
355 |
|
356 |
|
357 /***/ }), |
|
358 |
|
359 /***/ 2: |
|
360 /***/ (function(module, exports) { |
|
361 |
|
362 (function() { module.exports = this["lodash"]; }()); |
|
363 |
|
364 /***/ }), |
|
365 |
|
366 /***/ 224: |
|
367 /***/ (function(module, exports) { |
|
368 |
|
369 (function() { module.exports = this["wp"]["reduxRoutine"]; }()); |
|
370 |
|
371 /***/ }), |
|
372 |
|
373 /***/ 225: |
|
374 /***/ (function(module, exports) { |
|
375 |
|
376 (function() { module.exports = this["wp"]["priorityQueue"]; }()); |
|
377 |
|
378 /***/ }), |
|
379 |
|
380 /***/ 23: |
|
381 /***/ (function(module, exports, __webpack_require__) { |
|
382 |
|
383 module.exports = __webpack_require__(54); |
|
384 |
|
385 |
|
386 /***/ }), |
|
387 |
|
388 /***/ 28: |
|
389 /***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
390 |
|
391 "use strict"; |
|
392 |
|
393 // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js |
|
394 var arrayWithHoles = __webpack_require__(37); |
|
395 |
|
396 // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js |
|
397 function _iterableToArrayLimit(arr, i) { |
|
398 var _arr = []; |
|
399 var _n = true; |
|
400 var _d = false; |
|
401 var _e = undefined; |
|
402 |
|
403 try { |
|
404 for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { |
|
405 _arr.push(_s.value); |
|
406 |
|
407 if (i && _arr.length === i) break; |
|
408 } |
|
409 } catch (err) { |
|
410 _d = true; |
|
411 _e = err; |
|
412 } finally { |
|
413 try { |
|
414 if (!_n && _i["return"] != null) _i["return"](); |
|
415 } finally { |
|
416 if (_d) throw _e; |
|
417 } |
|
418 } |
|
419 |
|
420 return _arr; |
|
421 } |
|
422 // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/nonIterableRest.js |
|
423 var nonIterableRest = __webpack_require__(38); |
|
424 |
|
425 // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/slicedToArray.js |
|
426 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _slicedToArray; }); |
|
427 |
|
428 |
|
429 |
|
430 function _slicedToArray(arr, i) { |
|
431 return Object(arrayWithHoles["a" /* default */])(arr) || _iterableToArrayLimit(arr, i) || Object(nonIterableRest["a" /* default */])(); |
|
432 } |
|
433 |
|
434 /***/ }), |
|
435 |
|
436 /***/ 3: |
|
437 /***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
438 |
|
439 "use strict"; |
|
440 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _assertThisInitialized; }); |
|
441 function _assertThisInitialized(self) { |
|
442 if (self === void 0) { |
|
443 throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); |
|
444 } |
|
445 |
|
446 return self; |
|
447 } |
|
448 |
|
449 /***/ }), |
|
450 |
|
451 /***/ 32: |
|
452 /***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
453 |
|
454 "use strict"; |
|
455 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _typeof; }); |
|
456 function _typeof2(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof2 = function _typeof2(obj) { return typeof obj; }; } else { _typeof2 = function _typeof2(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof2(obj); } |
|
457 |
|
458 function _typeof(obj) { |
|
459 if (typeof Symbol === "function" && _typeof2(Symbol.iterator) === "symbol") { |
|
460 _typeof = function _typeof(obj) { |
|
461 return _typeof2(obj); |
|
462 }; |
|
463 } else { |
|
464 _typeof = function _typeof(obj) { |
|
465 return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : _typeof2(obj); |
|
466 }; |
|
467 } |
|
468 |
|
469 return _typeof(obj); |
|
470 } |
|
471 |
|
472 /***/ }), |
|
473 |
|
474 /***/ 34: |
|
475 /***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
476 |
|
477 "use strict"; |
|
478 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _iterableToArray; }); |
|
479 function _iterableToArray(iter) { |
|
480 if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter); |
|
481 } |
|
482 |
|
483 /***/ }), |
|
484 |
|
485 /***/ 363: |
|
486 /***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
487 |
|
488 "use strict"; |
|
489 __webpack_require__.r(__webpack_exports__); |
802 __webpack_require__.r(__webpack_exports__); |
|
803 |
|
804 // EXPORTS |
|
805 __webpack_require__.d(__webpack_exports__, "withSelect", function() { return /* reexport */ with_select; }); |
|
806 __webpack_require__.d(__webpack_exports__, "withDispatch", function() { return /* reexport */ with_dispatch; }); |
|
807 __webpack_require__.d(__webpack_exports__, "withRegistry", function() { return /* reexport */ with_registry; }); |
|
808 __webpack_require__.d(__webpack_exports__, "RegistryProvider", function() { return /* reexport */ context; }); |
|
809 __webpack_require__.d(__webpack_exports__, "RegistryConsumer", function() { return /* reexport */ RegistryConsumer; }); |
|
810 __webpack_require__.d(__webpack_exports__, "useRegistry", function() { return /* reexport */ useRegistry; }); |
|
811 __webpack_require__.d(__webpack_exports__, "useSelect", function() { return /* reexport */ useSelect; }); |
|
812 __webpack_require__.d(__webpack_exports__, "useDispatch", function() { return /* reexport */ use_dispatch; }); |
|
813 __webpack_require__.d(__webpack_exports__, "__unstableUseDispatchWithMap", function() { return /* reexport */ use_dispatch_with_map; }); |
|
814 __webpack_require__.d(__webpack_exports__, "AsyncModeProvider", function() { return /* reexport */ async_mode_provider_context; }); |
|
815 __webpack_require__.d(__webpack_exports__, "createRegistry", function() { return /* reexport */ createRegistry; }); |
|
816 __webpack_require__.d(__webpack_exports__, "createRegistrySelector", function() { return /* reexport */ createRegistrySelector; }); |
|
817 __webpack_require__.d(__webpack_exports__, "createRegistryControl", function() { return /* reexport */ createRegistryControl; }); |
|
818 __webpack_require__.d(__webpack_exports__, "plugins", function() { return /* reexport */ plugins_namespaceObject; }); |
|
819 __webpack_require__.d(__webpack_exports__, "combineReducers", function() { return /* reexport */ turbo_combine_reducers_default.a; }); |
|
820 __webpack_require__.d(__webpack_exports__, "select", function() { return /* binding */ build_module_select; }); |
|
821 __webpack_require__.d(__webpack_exports__, "__experimentalResolveSelect", function() { return /* binding */ build_module_experimentalResolveSelect; }); |
|
822 __webpack_require__.d(__webpack_exports__, "dispatch", function() { return /* binding */ build_module_dispatch; }); |
|
823 __webpack_require__.d(__webpack_exports__, "subscribe", function() { return /* binding */ build_module_subscribe; }); |
|
824 __webpack_require__.d(__webpack_exports__, "registerGenericStore", function() { return /* binding */ build_module_registerGenericStore; }); |
|
825 __webpack_require__.d(__webpack_exports__, "registerStore", function() { return /* binding */ build_module_registerStore; }); |
|
826 __webpack_require__.d(__webpack_exports__, "use", function() { return /* binding */ build_module_use; }); |
|
827 |
|
828 // NAMESPACE OBJECT: ./node_modules/@wordpress/data/build-module/namespace-store/metadata/selectors.js |
490 var selectors_namespaceObject = {}; |
829 var selectors_namespaceObject = {}; |
491 __webpack_require__.r(selectors_namespaceObject); |
830 __webpack_require__.r(selectors_namespaceObject); |
492 __webpack_require__.d(selectors_namespaceObject, "getIsResolving", function() { return getIsResolving; }); |
831 __webpack_require__.d(selectors_namespaceObject, "getIsResolving", function() { return getIsResolving; }); |
493 __webpack_require__.d(selectors_namespaceObject, "hasStartedResolution", function() { return hasStartedResolution; }); |
832 __webpack_require__.d(selectors_namespaceObject, "hasStartedResolution", function() { return hasStartedResolution; }); |
494 __webpack_require__.d(selectors_namespaceObject, "hasFinishedResolution", function() { return hasFinishedResolution; }); |
833 __webpack_require__.d(selectors_namespaceObject, "hasFinishedResolution", function() { return hasFinishedResolution; }); |
495 __webpack_require__.d(selectors_namespaceObject, "isResolving", function() { return isResolving; }); |
834 __webpack_require__.d(selectors_namespaceObject, "isResolving", function() { return isResolving; }); |
496 __webpack_require__.d(selectors_namespaceObject, "getCachedResolvers", function() { return getCachedResolvers; }); |
835 __webpack_require__.d(selectors_namespaceObject, "getCachedResolvers", function() { return getCachedResolvers; }); |
|
836 |
|
837 // NAMESPACE OBJECT: ./node_modules/@wordpress/data/build-module/namespace-store/metadata/actions.js |
497 var actions_namespaceObject = {}; |
838 var actions_namespaceObject = {}; |
498 __webpack_require__.r(actions_namespaceObject); |
839 __webpack_require__.r(actions_namespaceObject); |
499 __webpack_require__.d(actions_namespaceObject, "startResolution", function() { return startResolution; }); |
840 __webpack_require__.d(actions_namespaceObject, "startResolution", function() { return startResolution; }); |
500 __webpack_require__.d(actions_namespaceObject, "finishResolution", function() { return finishResolution; }); |
841 __webpack_require__.d(actions_namespaceObject, "finishResolution", function() { return finishResolution; }); |
501 __webpack_require__.d(actions_namespaceObject, "invalidateResolution", function() { return invalidateResolution; }); |
842 __webpack_require__.d(actions_namespaceObject, "invalidateResolution", function() { return invalidateResolution; }); |
502 __webpack_require__.d(actions_namespaceObject, "invalidateResolutionForStore", function() { return invalidateResolutionForStore; }); |
843 __webpack_require__.d(actions_namespaceObject, "invalidateResolutionForStore", function() { return invalidateResolutionForStore; }); |
503 __webpack_require__.d(actions_namespaceObject, "invalidateResolutionForStoreSelector", function() { return invalidateResolutionForStoreSelector; }); |
844 __webpack_require__.d(actions_namespaceObject, "invalidateResolutionForStoreSelector", function() { return invalidateResolutionForStoreSelector; }); |
|
845 |
|
846 // NAMESPACE OBJECT: ./node_modules/@wordpress/data/build-module/plugins/index.js |
504 var plugins_namespaceObject = {}; |
847 var plugins_namespaceObject = {}; |
505 __webpack_require__.r(plugins_namespaceObject); |
848 __webpack_require__.r(plugins_namespaceObject); |
506 __webpack_require__.d(plugins_namespaceObject, "controls", function() { return controls; }); |
849 __webpack_require__.d(plugins_namespaceObject, "controls", function() { return controls; }); |
507 __webpack_require__.d(plugins_namespaceObject, "persistence", function() { return plugins_persistence; }); |
850 __webpack_require__.d(plugins_namespaceObject, "persistence", function() { return plugins_persistence; }); |
508 |
851 |
509 // EXTERNAL MODULE: ./node_modules/turbo-combine-reducers/index.js |
852 // EXTERNAL MODULE: ./node_modules/turbo-combine-reducers/index.js |
510 var turbo_combine_reducers = __webpack_require__(197); |
853 var turbo_combine_reducers = __webpack_require__(163); |
511 var turbo_combine_reducers_default = /*#__PURE__*/__webpack_require__.n(turbo_combine_reducers); |
854 var turbo_combine_reducers_default = /*#__PURE__*/__webpack_require__.n(turbo_combine_reducers); |
512 |
855 |
513 // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/slicedToArray.js + 1 modules |
856 // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/slicedToArray.js + 1 modules |
514 var slicedToArray = __webpack_require__(28); |
857 var slicedToArray = __webpack_require__(14); |
515 |
858 |
516 // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/objectSpread.js |
859 // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/defineProperty.js |
517 var objectSpread = __webpack_require__(7); |
860 var defineProperty = __webpack_require__(5); |
518 |
861 |
519 // EXTERNAL MODULE: external "lodash" |
862 // EXTERNAL MODULE: external {"this":"lodash"} |
520 var external_lodash_ = __webpack_require__(2); |
863 var external_this_lodash_ = __webpack_require__(2); |
521 |
864 |
522 // EXTERNAL MODULE: ./node_modules/@babel/runtime/regenerator/index.js |
865 // EXTERNAL MODULE: ./node_modules/memize/index.js |
523 var regenerator = __webpack_require__(23); |
866 var memize = __webpack_require__(60); |
524 var regenerator_default = /*#__PURE__*/__webpack_require__.n(regenerator); |
867 var memize_default = /*#__PURE__*/__webpack_require__.n(memize); |
|
868 |
|
869 // EXTERNAL MODULE: external {"this":"regeneratorRuntime"} |
|
870 var external_this_regeneratorRuntime_ = __webpack_require__(24); |
|
871 var external_this_regeneratorRuntime_default = /*#__PURE__*/__webpack_require__.n(external_this_regeneratorRuntime_); |
525 |
872 |
526 // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js |
873 // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js |
527 var asyncToGenerator = __webpack_require__(44); |
874 var asyncToGenerator = __webpack_require__(50); |
528 |
875 |
529 // EXTERNAL MODULE: ./node_modules/redux/es/redux.js |
876 // EXTERNAL MODULE: ./node_modules/symbol-observable/es/index.js |
530 var redux = __webpack_require__(71); |
877 var es = __webpack_require__(196); |
531 |
878 |
532 // EXTERNAL MODULE: ./node_modules/is-promise/index.js |
879 // CONCATENATED MODULE: ./node_modules/redux/es/redux.js |
533 var is_promise = __webpack_require__(100); |
|
534 var is_promise_default = /*#__PURE__*/__webpack_require__.n(is_promise); |
|
535 |
|
536 // CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/promise-middleware.js |
|
537 /** |
|
538 * External dependencies |
|
539 */ |
|
540 |
|
541 /** |
|
542 * Simplest possible promise redux middleware. |
|
543 * |
|
544 * @return {function} middleware. |
|
545 */ |
|
546 |
|
547 var promise_middleware_promiseMiddleware = function promiseMiddleware() { |
|
548 return function (next) { |
|
549 return function (action) { |
|
550 if (is_promise_default()(action)) { |
|
551 return action.then(function (resolvedAction) { |
|
552 if (resolvedAction) { |
|
553 return next(resolvedAction); |
|
554 } |
|
555 }); |
|
556 } |
|
557 |
|
558 return next(action); |
|
559 }; |
|
560 }; |
|
561 }; |
|
562 |
|
563 /* harmony default export */ var promise_middleware = (promise_middleware_promiseMiddleware); |
|
564 |
|
565 // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js + 2 modules |
|
566 var toConsumableArray = __webpack_require__(17); |
|
567 |
|
568 // CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/resolvers-cache-middleware.js |
|
569 |
|
570 |
|
571 |
|
572 /** |
|
573 * External dependencies |
|
574 */ |
|
575 |
|
576 /** |
|
577 * creates a middleware handling resolvers cache invalidation. |
|
578 * |
|
579 * @param {Object} registry |
|
580 * @param {string} reducerKey |
|
581 * |
|
582 * @return {function} middleware |
|
583 */ |
|
584 |
|
585 var resolvers_cache_middleware_createResolversCacheMiddleware = function createResolversCacheMiddleware(registry, reducerKey) { |
|
586 return function () { |
|
587 return function (next) { |
|
588 return function (action) { |
|
589 var resolvers = registry.select('core/data').getCachedResolvers(reducerKey); |
|
590 Object.entries(resolvers).forEach(function (_ref) { |
|
591 var _ref2 = Object(slicedToArray["a" /* default */])(_ref, 2), |
|
592 selectorName = _ref2[0], |
|
593 resolversByArgs = _ref2[1]; |
|
594 |
|
595 var resolver = Object(external_lodash_["get"])(registry.namespaces, [reducerKey, 'resolvers', selectorName]); |
|
596 |
|
597 if (!resolver || !resolver.shouldInvalidate) { |
|
598 return; |
|
599 } |
|
600 |
|
601 resolversByArgs.forEach(function (value, args) { |
|
602 // resolversByArgs is the map Map([ args ] => boolean) storing the cache resolution status for a given selector. |
|
603 // If the value is false it means this resolver has finished its resolution which means we need to invalidate it, |
|
604 // if it's true it means it's inflight and the invalidation is not necessary. |
|
605 if (value !== false || !resolver.shouldInvalidate.apply(resolver, [action].concat(Object(toConsumableArray["a" /* default */])(args)))) { |
|
606 return; |
|
607 } // Trigger cache invalidation |
|
608 |
|
609 |
|
610 registry.dispatch('core/data').invalidateResolution(reducerKey, selectorName, args); |
|
611 }); |
|
612 }); |
|
613 next(action); |
|
614 }; |
|
615 }; |
|
616 }; |
|
617 }; |
|
618 |
|
619 /* harmony default export */ var resolvers_cache_middleware = (resolvers_cache_middleware_createResolversCacheMiddleware); |
|
620 |
|
621 // CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/namespace-store.js |
|
622 |
|
623 |
|
624 |
|
625 |
|
626 /** |
|
627 * External dependencies |
|
628 */ |
|
629 |
|
630 |
|
631 /** |
|
632 * Internal dependencies |
|
633 */ |
|
634 |
|
635 |
|
636 |
|
637 /** |
|
638 * Creates a namespace object with a store derived from the reducer given. |
|
639 * |
|
640 * @param {string} key Identifying string used for namespace and redex dev tools. |
|
641 * @param {Object} options Contains reducer, actions, selectors, and resolvers. |
|
642 * @param {Object} registry Registry reference. |
|
643 * |
|
644 * @return {Object} Store Object. |
|
645 */ |
|
646 |
|
647 function createNamespace(key, options, registry) { |
|
648 var reducer = options.reducer; |
|
649 var store = createReduxStore(key, options, registry); |
|
650 var selectors, actions, resolvers; |
|
651 |
|
652 if (options.actions) { |
|
653 actions = mapActions(options.actions, store); |
|
654 } |
|
655 |
|
656 if (options.selectors) { |
|
657 selectors = mapSelectors(options.selectors, store, registry); |
|
658 } |
|
659 |
|
660 if (options.resolvers) { |
|
661 var fulfillment = getCoreDataFulfillment(registry, key); |
|
662 var result = mapResolvers(options.resolvers, selectors, fulfillment, store); |
|
663 resolvers = result.resolvers; |
|
664 selectors = result.selectors; |
|
665 } |
|
666 |
|
667 var getSelectors = function getSelectors() { |
|
668 return selectors; |
|
669 }; |
|
670 |
|
671 var getActions = function getActions() { |
|
672 return actions; |
|
673 }; // Customize subscribe behavior to call listeners only on effective change, |
|
674 // not on every dispatch. |
|
675 |
|
676 |
|
677 var subscribe = store && function (listener) { |
|
678 var lastState = store.getState(); |
|
679 store.subscribe(function () { |
|
680 var state = store.getState(); |
|
681 var hasChanged = state !== lastState; |
|
682 lastState = state; |
|
683 |
|
684 if (hasChanged) { |
|
685 listener(); |
|
686 } |
|
687 }); |
|
688 }; // This can be simplified to just { subscribe, getSelectors, getActions } |
|
689 // Once we remove the use function. |
|
690 |
|
691 |
|
692 return { |
|
693 reducer: reducer, |
|
694 store: store, |
|
695 actions: actions, |
|
696 selectors: selectors, |
|
697 resolvers: resolvers, |
|
698 getSelectors: getSelectors, |
|
699 getActions: getActions, |
|
700 subscribe: subscribe |
|
701 }; |
|
702 } |
|
703 /** |
|
704 * Creates a redux store for a namespace. |
|
705 * |
|
706 * @param {string} key Part of the state shape to register the |
|
707 * selectors for. |
|
708 * @param {Object} options Registered store options. |
|
709 * @param {Object} registry Registry reference, for resolver enhancer support. |
|
710 * |
|
711 * @return {Object} Newly created redux store. |
|
712 */ |
|
713 |
|
714 function createReduxStore(key, options, registry) { |
|
715 var enhancers = [Object(redux["a" /* applyMiddleware */])(resolvers_cache_middleware(registry, key), promise_middleware)]; |
|
716 |
|
717 if (typeof window !== 'undefined' && window.__REDUX_DEVTOOLS_EXTENSION__) { |
|
718 enhancers.push(window.__REDUX_DEVTOOLS_EXTENSION__({ |
|
719 name: key, |
|
720 instanceId: key |
|
721 })); |
|
722 } |
|
723 |
|
724 var reducer = options.reducer, |
|
725 initialState = options.initialState; |
|
726 return Object(redux["c" /* createStore */])(reducer, initialState, Object(external_lodash_["flowRight"])(enhancers)); |
|
727 } |
|
728 /** |
|
729 * Maps selectors to a redux store. |
|
730 * |
|
731 * @param {Object} selectors Selectors to register. Keys will be used as the |
|
732 * public facing API. Selectors will get passed the |
|
733 * state as first argument. |
|
734 * @param {Object} store The redux store to which the selectors should be mapped. |
|
735 * @param {Object} registry Registry reference. |
|
736 * |
|
737 * @return {Object} Selectors mapped to the redux store provided. |
|
738 */ |
|
739 |
|
740 |
|
741 function mapSelectors(selectors, store, registry) { |
|
742 var createStateSelector = function createStateSelector(registeredSelector) { |
|
743 var selector = registeredSelector.isRegistrySelector ? registeredSelector(registry.select) : registeredSelector; |
|
744 return function runSelector() { |
|
745 // This function is an optimized implementation of: |
|
746 // |
|
747 // selector( store.getState(), ...arguments ) |
|
748 // |
|
749 // Where the above would incur an `Array#concat` in its application, |
|
750 // the logic here instead efficiently constructs an arguments array via |
|
751 // direct assignment. |
|
752 var argsLength = arguments.length; |
|
753 var args = new Array(argsLength + 1); |
|
754 args[0] = store.getState(); |
|
755 |
|
756 for (var i = 0; i < argsLength; i++) { |
|
757 args[i + 1] = arguments[i]; |
|
758 } |
|
759 |
|
760 return selector.apply(void 0, args); |
|
761 }; |
|
762 }; |
|
763 |
|
764 return Object(external_lodash_["mapValues"])(selectors, createStateSelector); |
|
765 } |
|
766 /** |
|
767 * Maps actions to dispatch from a given store. |
|
768 * |
|
769 * @param {Object} actions Actions to register. |
|
770 * @param {Object} store The redux store to which the actions should be mapped. |
|
771 * @return {Object} Actions mapped to the redux store provided. |
|
772 */ |
|
773 |
|
774 |
|
775 function mapActions(actions, store) { |
|
776 var createBoundAction = function createBoundAction(action) { |
|
777 return function () { |
|
778 return store.dispatch(action.apply(void 0, arguments)); |
|
779 }; |
|
780 }; |
|
781 |
|
782 return Object(external_lodash_["mapValues"])(actions, createBoundAction); |
|
783 } |
|
784 /** |
|
785 * Returns resolvers with matched selectors for a given namespace. |
|
786 * Resolvers are side effects invoked once per argument set of a given selector call, |
|
787 * used in ensuring that the data needs for the selector are satisfied. |
|
788 * |
|
789 * @param {Object} resolvers Resolvers to register. |
|
790 * @param {Object} selectors The current selectors to be modified. |
|
791 * @param {Object} fulfillment Fulfillment implementation functions. |
|
792 * @param {Object} store The redux store to which the resolvers should be mapped. |
|
793 * @return {Object} An object containing updated selectors and resolvers. |
|
794 */ |
|
795 |
|
796 |
|
797 function mapResolvers(resolvers, selectors, fulfillment, store) { |
|
798 var mapSelector = function mapSelector(selector, selectorName) { |
|
799 var resolver = resolvers[selectorName]; |
|
800 |
|
801 if (!resolver) { |
|
802 return selector; |
|
803 } |
|
804 |
|
805 return function () { |
|
806 for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { |
|
807 args[_key] = arguments[_key]; |
|
808 } |
|
809 |
|
810 function fulfillSelector() { |
|
811 return _fulfillSelector.apply(this, arguments); |
|
812 } |
|
813 |
|
814 function _fulfillSelector() { |
|
815 _fulfillSelector = Object(asyncToGenerator["a" /* default */])( |
|
816 /*#__PURE__*/ |
|
817 regenerator_default.a.mark(function _callee() { |
|
818 var state; |
|
819 return regenerator_default.a.wrap(function _callee$(_context) { |
|
820 while (1) { |
|
821 switch (_context.prev = _context.next) { |
|
822 case 0: |
|
823 state = store.getState(); |
|
824 |
|
825 if (!(typeof resolver.isFulfilled === 'function' && resolver.isFulfilled.apply(resolver, [state].concat(args)))) { |
|
826 _context.next = 3; |
|
827 break; |
|
828 } |
|
829 |
|
830 return _context.abrupt("return"); |
|
831 |
|
832 case 3: |
|
833 if (!fulfillment.hasStarted(selectorName, args)) { |
|
834 _context.next = 5; |
|
835 break; |
|
836 } |
|
837 |
|
838 return _context.abrupt("return"); |
|
839 |
|
840 case 5: |
|
841 fulfillment.start(selectorName, args); |
|
842 _context.next = 8; |
|
843 return fulfillment.fulfill.apply(fulfillment, [selectorName].concat(args)); |
|
844 |
|
845 case 8: |
|
846 fulfillment.finish(selectorName, args); |
|
847 |
|
848 case 9: |
|
849 case "end": |
|
850 return _context.stop(); |
|
851 } |
|
852 } |
|
853 }, _callee, this); |
|
854 })); |
|
855 return _fulfillSelector.apply(this, arguments); |
|
856 } |
|
857 |
|
858 fulfillSelector.apply(void 0, args); |
|
859 return selector.apply(void 0, args); |
|
860 }; |
|
861 }; |
|
862 |
|
863 var mappedResolvers = Object(external_lodash_["mapValues"])(resolvers, function (resolver) { |
|
864 var _resolver$fulfill = resolver.fulfill, |
|
865 resolverFulfill = _resolver$fulfill === void 0 ? resolver : _resolver$fulfill; |
|
866 return Object(objectSpread["a" /* default */])({}, resolver, { |
|
867 fulfill: resolverFulfill |
|
868 }); |
|
869 }); |
|
870 return { |
|
871 resolvers: mappedResolvers, |
|
872 selectors: Object(external_lodash_["mapValues"])(selectors, mapSelector) |
|
873 }; |
|
874 } |
|
875 /** |
|
876 * Bundles up fulfillment functions for resolvers. |
|
877 * @param {Object} registry Registry reference, for fulfilling via resolvers |
|
878 * @param {string} key Part of the state shape to register the |
|
879 * selectors for. |
|
880 * @return {Object} An object providing fulfillment functions. |
|
881 */ |
|
882 |
|
883 |
|
884 function getCoreDataFulfillment(registry, key) { |
|
885 var _registry$select = registry.select('core/data'), |
|
886 hasStartedResolution = _registry$select.hasStartedResolution; |
|
887 |
|
888 var _registry$dispatch = registry.dispatch('core/data'), |
|
889 startResolution = _registry$dispatch.startResolution, |
|
890 finishResolution = _registry$dispatch.finishResolution; |
|
891 |
|
892 return { |
|
893 hasStarted: function hasStarted() { |
|
894 for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { |
|
895 args[_key2] = arguments[_key2]; |
|
896 } |
|
897 |
|
898 return hasStartedResolution.apply(void 0, [key].concat(args)); |
|
899 }, |
|
900 start: function start() { |
|
901 for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) { |
|
902 args[_key3] = arguments[_key3]; |
|
903 } |
|
904 |
|
905 return startResolution.apply(void 0, [key].concat(args)); |
|
906 }, |
|
907 finish: function finish() { |
|
908 for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) { |
|
909 args[_key4] = arguments[_key4]; |
|
910 } |
|
911 |
|
912 return finishResolution.apply(void 0, [key].concat(args)); |
|
913 }, |
|
914 fulfill: function fulfill() { |
|
915 for (var _len5 = arguments.length, args = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) { |
|
916 args[_key5] = arguments[_key5]; |
|
917 } |
|
918 |
|
919 return fulfillWithRegistry.apply(void 0, [registry, key].concat(args)); |
|
920 } |
|
921 }; |
|
922 } |
|
923 /** |
|
924 * Calls a resolver given arguments |
|
925 * |
|
926 * @param {Object} registry Registry reference, for fulfilling via resolvers |
|
927 * @param {string} key Part of the state shape to register the |
|
928 * selectors for. |
|
929 * @param {string} selectorName Selector name to fulfill. |
|
930 * @param {Array} args Selector Arguments. |
|
931 */ |
|
932 |
|
933 |
|
934 function fulfillWithRegistry(_x, _x2, _x3) { |
|
935 return _fulfillWithRegistry.apply(this, arguments); |
|
936 } |
|
937 |
|
938 function _fulfillWithRegistry() { |
|
939 _fulfillWithRegistry = Object(asyncToGenerator["a" /* default */])( |
|
940 /*#__PURE__*/ |
|
941 regenerator_default.a.mark(function _callee2(registry, key, selectorName) { |
|
942 var namespace, |
|
943 resolver, |
|
944 _len6, |
|
945 args, |
|
946 _key6, |
|
947 action, |
|
948 _args2 = arguments; |
|
949 |
|
950 return regenerator_default.a.wrap(function _callee2$(_context2) { |
|
951 while (1) { |
|
952 switch (_context2.prev = _context2.next) { |
|
953 case 0: |
|
954 namespace = registry.stores[key]; |
|
955 resolver = Object(external_lodash_["get"])(namespace, ['resolvers', selectorName]); |
|
956 |
|
957 if (resolver) { |
|
958 _context2.next = 4; |
|
959 break; |
|
960 } |
|
961 |
|
962 return _context2.abrupt("return"); |
|
963 |
|
964 case 4: |
|
965 for (_len6 = _args2.length, args = new Array(_len6 > 3 ? _len6 - 3 : 0), _key6 = 3; _key6 < _len6; _key6++) { |
|
966 args[_key6 - 3] = _args2[_key6]; |
|
967 } |
|
968 |
|
969 action = resolver.fulfill.apply(resolver, args); |
|
970 |
|
971 if (!action) { |
|
972 _context2.next = 9; |
|
973 break; |
|
974 } |
|
975 |
|
976 _context2.next = 9; |
|
977 return namespace.store.dispatch(action); |
|
978 |
|
979 case 9: |
|
980 case "end": |
|
981 return _context2.stop(); |
|
982 } |
|
983 } |
|
984 }, _callee2, this); |
|
985 })); |
|
986 return _fulfillWithRegistry.apply(this, arguments); |
|
987 } |
|
988 |
|
989 // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/defineProperty.js |
|
990 var defineProperty = __webpack_require__(15); |
|
991 |
|
992 // EXTERNAL MODULE: ./node_modules/equivalent-key-map/equivalent-key-map.js |
|
993 var equivalent_key_map = __webpack_require__(76); |
|
994 var equivalent_key_map_default = /*#__PURE__*/__webpack_require__.n(equivalent_key_map); |
|
995 |
|
996 // CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/store/utils.js |
|
997 |
|
998 |
|
999 |
|
1000 /** |
|
1001 * Higher-order reducer creator which creates a combined reducer object, keyed |
|
1002 * by a property on the action object. |
|
1003 * |
|
1004 * @param {string} actionProperty Action property by which to key object. |
|
1005 * |
|
1006 * @return {Function} Higher-order reducer. |
|
1007 */ |
|
1008 var utils_onSubKey = function onSubKey(actionProperty) { |
|
1009 return function (reducer) { |
|
1010 return function () { |
|
1011 var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; |
|
1012 var action = arguments.length > 1 ? arguments[1] : undefined; |
|
1013 // Retrieve subkey from action. Do not track if undefined; useful for cases |
|
1014 // where reducer is scoped by action shape. |
|
1015 var key = action[actionProperty]; |
|
1016 |
|
1017 if (key === undefined) { |
|
1018 return state; |
|
1019 } // Avoid updating state if unchanged. Note that this also accounts for a |
|
1020 // reducer which returns undefined on a key which is not yet tracked. |
|
1021 |
|
1022 |
|
1023 var nextKeyState = reducer(state[key], action); |
|
1024 |
|
1025 if (nextKeyState === state[key]) { |
|
1026 return state; |
|
1027 } |
|
1028 |
|
1029 return Object(objectSpread["a" /* default */])({}, state, Object(defineProperty["a" /* default */])({}, key, nextKeyState)); |
|
1030 }; |
|
1031 }; |
|
1032 }; |
|
1033 |
|
1034 // CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/store/reducer.js |
|
1035 |
|
1036 |
|
1037 |
|
1038 /** |
|
1039 * External dependencies |
|
1040 */ |
|
1041 |
|
1042 |
|
1043 /** |
|
1044 * Internal dependencies |
|
1045 */ |
|
1046 |
|
1047 |
|
1048 /** |
|
1049 * Reducer function returning next state for selector resolution of |
|
1050 * subkeys, object form: |
|
1051 * |
|
1052 * reducerKey -> selectorName -> EquivalentKeyMap<Array,boolean> |
|
1053 * |
|
1054 * @param {Object} state Current state. |
|
1055 * @param {Object} action Dispatched action. |
|
1056 * |
|
1057 * @returns {Object} Next state. |
|
1058 */ |
|
1059 |
|
1060 var subKeysIsResolved = Object(external_lodash_["flowRight"])([utils_onSubKey('reducerKey'), utils_onSubKey('selectorName')])(function () { |
|
1061 var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : new equivalent_key_map_default.a(); |
|
1062 var action = arguments.length > 1 ? arguments[1] : undefined; |
|
1063 |
|
1064 switch (action.type) { |
|
1065 case 'START_RESOLUTION': |
|
1066 case 'FINISH_RESOLUTION': |
|
1067 { |
|
1068 var isStarting = action.type === 'START_RESOLUTION'; |
|
1069 var nextState = new equivalent_key_map_default.a(state); |
|
1070 nextState.set(action.args, isStarting); |
|
1071 return nextState; |
|
1072 } |
|
1073 |
|
1074 case 'INVALIDATE_RESOLUTION': |
|
1075 { |
|
1076 var _nextState = new equivalent_key_map_default.a(state); |
|
1077 |
|
1078 _nextState.delete(action.args); |
|
1079 |
|
1080 return _nextState; |
|
1081 } |
|
1082 } |
|
1083 |
|
1084 return state; |
|
1085 }); |
|
1086 /** |
|
1087 * Reducer function returning next state for selector resolution, object form: |
|
1088 * |
|
1089 * reducerKey -> selectorName -> EquivalentKeyMap<Array, boolean> |
|
1090 * |
|
1091 * @param {Object} state Current state. |
|
1092 * @param {Object} action Dispatched action. |
|
1093 * |
|
1094 * @return {Object} Next state. |
|
1095 */ |
|
1096 |
|
1097 var reducer_isResolved = function isResolved() { |
|
1098 var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; |
|
1099 var action = arguments.length > 1 ? arguments[1] : undefined; |
|
1100 |
|
1101 switch (action.type) { |
|
1102 case 'INVALIDATE_RESOLUTION_FOR_STORE': |
|
1103 return Object(external_lodash_["has"])(state, action.reducerKey) ? Object(external_lodash_["omit"])(state, [action.reducerKey]) : state; |
|
1104 |
|
1105 case 'INVALIDATE_RESOLUTION_FOR_STORE_SELECTOR': |
|
1106 return Object(external_lodash_["has"])(state, [action.reducerKey, action.selectorName]) ? Object(objectSpread["a" /* default */])({}, state, Object(defineProperty["a" /* default */])({}, action.reducerKey, Object(external_lodash_["omit"])(state[action.reducerKey], [action.selectorName]))) : state; |
|
1107 |
|
1108 case 'START_RESOLUTION': |
|
1109 case 'FINISH_RESOLUTION': |
|
1110 case 'INVALIDATE_RESOLUTION': |
|
1111 return subKeysIsResolved(state, action); |
|
1112 } |
|
1113 |
|
1114 return state; |
|
1115 }; |
|
1116 |
|
1117 /* harmony default export */ var store_reducer = (reducer_isResolved); |
|
1118 |
|
1119 // CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/store/selectors.js |
|
1120 /** |
|
1121 * External dependencies |
|
1122 */ |
|
1123 |
|
1124 /** |
|
1125 * Returns the raw `isResolving` value for a given reducer key, selector name, |
|
1126 * and arguments set. May be undefined if the selector has never been resolved |
|
1127 * or not resolved for the given set of arguments, otherwise true or false for |
|
1128 * resolution started and completed respectively. |
|
1129 * |
|
1130 * @param {Object} state Data state. |
|
1131 * @param {string} reducerKey Registered store reducer key. |
|
1132 * @param {string} selectorName Selector name. |
|
1133 * @param {Array} args Arguments passed to selector. |
|
1134 * |
|
1135 * @return {?boolean} isResolving value. |
|
1136 */ |
|
1137 |
|
1138 function getIsResolving(state, reducerKey, selectorName, args) { |
|
1139 var map = Object(external_lodash_["get"])(state, [reducerKey, selectorName]); |
|
1140 |
|
1141 if (!map) { |
|
1142 return; |
|
1143 } |
|
1144 |
|
1145 return map.get(args); |
|
1146 } |
|
1147 /** |
|
1148 * Returns true if resolution has already been triggered for a given reducer |
|
1149 * key, selector name, and arguments set. |
|
1150 * |
|
1151 * @param {Object} state Data state. |
|
1152 * @param {string} reducerKey Registered store reducer key. |
|
1153 * @param {string} selectorName Selector name. |
|
1154 * @param {?Array} args Arguments passed to selector (default `[]`). |
|
1155 * |
|
1156 * @return {boolean} Whether resolution has been triggered. |
|
1157 */ |
|
1158 |
|
1159 function hasStartedResolution(state, reducerKey, selectorName) { |
|
1160 var args = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : []; |
|
1161 return getIsResolving(state, reducerKey, selectorName, args) !== undefined; |
|
1162 } |
|
1163 /** |
|
1164 * Returns true if resolution has completed for a given reducer key, selector |
|
1165 * name, and arguments set. |
|
1166 * |
|
1167 * @param {Object} state Data state. |
|
1168 * @param {string} reducerKey Registered store reducer key. |
|
1169 * @param {string} selectorName Selector name. |
|
1170 * @param {?Array} args Arguments passed to selector. |
|
1171 * |
|
1172 * @return {boolean} Whether resolution has completed. |
|
1173 */ |
|
1174 |
|
1175 function hasFinishedResolution(state, reducerKey, selectorName) { |
|
1176 var args = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : []; |
|
1177 return getIsResolving(state, reducerKey, selectorName, args) === false; |
|
1178 } |
|
1179 /** |
|
1180 * Returns true if resolution has been triggered but has not yet completed for |
|
1181 * a given reducer key, selector name, and arguments set. |
|
1182 * |
|
1183 * @param {Object} state Data state. |
|
1184 * @param {string} reducerKey Registered store reducer key. |
|
1185 * @param {string} selectorName Selector name. |
|
1186 * @param {?Array} args Arguments passed to selector. |
|
1187 * |
|
1188 * @return {boolean} Whether resolution is in progress. |
|
1189 */ |
|
1190 |
|
1191 function isResolving(state, reducerKey, selectorName) { |
|
1192 var args = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : []; |
|
1193 return getIsResolving(state, reducerKey, selectorName, args) === true; |
|
1194 } |
|
1195 /** |
|
1196 * Returns the list of the cached resolvers. |
|
1197 * |
|
1198 * @param {Object} state Data state. |
|
1199 * @param {string} reducerKey Registered store reducer key. |
|
1200 * |
|
1201 * @return {Object} Resolvers mapped by args and selectorName. |
|
1202 */ |
|
1203 |
|
1204 function getCachedResolvers(state, reducerKey) { |
|
1205 return state.hasOwnProperty(reducerKey) ? state[reducerKey] : {}; |
|
1206 } |
|
1207 |
|
1208 // CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/store/actions.js |
|
1209 /** |
|
1210 * Returns an action object used in signalling that selector resolution has |
|
1211 * started. |
|
1212 * |
|
1213 * @param {string} reducerKey Registered store reducer key. |
|
1214 * @param {string} selectorName Name of selector for which resolver triggered. |
|
1215 * @param {...*} args Arguments to associate for uniqueness. |
|
1216 * |
|
1217 * @return {Object} Action object. |
|
1218 */ |
|
1219 function startResolution(reducerKey, selectorName, args) { |
|
1220 return { |
|
1221 type: 'START_RESOLUTION', |
|
1222 reducerKey: reducerKey, |
|
1223 selectorName: selectorName, |
|
1224 args: args |
|
1225 }; |
|
1226 } |
|
1227 /** |
|
1228 * Returns an action object used in signalling that selector resolution has |
|
1229 * completed. |
|
1230 * |
|
1231 * @param {string} reducerKey Registered store reducer key. |
|
1232 * @param {string} selectorName Name of selector for which resolver triggered. |
|
1233 * @param {...*} args Arguments to associate for uniqueness. |
|
1234 * |
|
1235 * @return {Object} Action object. |
|
1236 */ |
|
1237 |
|
1238 function finishResolution(reducerKey, selectorName, args) { |
|
1239 return { |
|
1240 type: 'FINISH_RESOLUTION', |
|
1241 reducerKey: reducerKey, |
|
1242 selectorName: selectorName, |
|
1243 args: args |
|
1244 }; |
|
1245 } |
|
1246 /** |
|
1247 * Returns an action object used in signalling that we should invalidate the resolution cache. |
|
1248 * |
|
1249 * @param {string} reducerKey Registered store reducer key. |
|
1250 * @param {string} selectorName Name of selector for which resolver should be invalidated. |
|
1251 * @param {Array} args Arguments to associate for uniqueness. |
|
1252 * |
|
1253 * @return {Object} Action object. |
|
1254 */ |
|
1255 |
|
1256 function invalidateResolution(reducerKey, selectorName, args) { |
|
1257 return { |
|
1258 type: 'INVALIDATE_RESOLUTION', |
|
1259 reducerKey: reducerKey, |
|
1260 selectorName: selectorName, |
|
1261 args: args |
|
1262 }; |
|
1263 } |
|
1264 /** |
|
1265 * Returns an action object used in signalling that the resolution cache for a |
|
1266 * given reducerKey should be invalidated. |
|
1267 * |
|
1268 * @param {string} reducerKey Registered store reducer key. |
|
1269 * |
|
1270 * @return {Object} Action object. |
|
1271 */ |
|
1272 |
|
1273 function invalidateResolutionForStore(reducerKey) { |
|
1274 return { |
|
1275 type: 'INVALIDATE_RESOLUTION_FOR_STORE', |
|
1276 reducerKey: reducerKey |
|
1277 }; |
|
1278 } |
|
1279 /** |
|
1280 * Returns an action object used in signalling that the resolution cache for a |
|
1281 * given reducerKey and selectorName should be invalidated. |
|
1282 * |
|
1283 * @param {string} reducerKey Registered store reducer key. |
|
1284 * @param {string} selectorName Name of selector for which all resolvers should |
|
1285 * be invalidated. |
|
1286 * |
|
1287 * @return {Object} Action object. |
|
1288 */ |
|
1289 |
|
1290 function invalidateResolutionForStoreSelector(reducerKey, selectorName) { |
|
1291 return { |
|
1292 type: 'INVALIDATE_RESOLUTION_FOR_STORE_SELECTOR', |
|
1293 reducerKey: reducerKey, |
|
1294 selectorName: selectorName |
|
1295 }; |
|
1296 } |
|
1297 |
|
1298 // CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/store/index.js |
|
1299 /** |
|
1300 * Internal dependencies |
|
1301 */ |
|
1302 |
|
1303 |
|
1304 |
|
1305 /* harmony default export */ var build_module_store = ({ |
|
1306 reducer: store_reducer, |
|
1307 actions: actions_namespaceObject, |
|
1308 selectors: selectors_namespaceObject |
|
1309 }); |
|
1310 |
|
1311 // CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/registry.js |
|
1312 |
|
1313 |
|
1314 |
|
1315 /** |
|
1316 * External dependencies |
|
1317 */ |
|
1318 |
|
1319 /** |
|
1320 * Internal dependencies |
|
1321 */ |
|
1322 |
|
1323 |
|
1324 |
|
1325 /** |
|
1326 * An isolated orchestrator of store registrations. |
|
1327 * |
|
1328 * @typedef {WPDataRegistry} |
|
1329 * |
|
1330 * @property {Function} registerGenericStore |
|
1331 * @property {Function} registerStore |
|
1332 * @property {Function} subscribe |
|
1333 * @property {Function} select |
|
1334 * @property {Function} dispatch |
|
1335 */ |
|
1336 |
|
1337 /** |
|
1338 * An object of registry function overrides. |
|
1339 * |
|
1340 * @typedef {WPDataPlugin} |
|
1341 */ |
|
1342 |
|
1343 /** |
|
1344 * Creates a new store registry, given an optional object of initial store |
|
1345 * configurations. |
|
1346 * |
|
1347 * @param {Object} storeConfigs Initial store configurations. |
|
1348 * |
|
1349 * @return {WPDataRegistry} Data registry. |
|
1350 */ |
|
1351 |
|
1352 function createRegistry() { |
|
1353 var storeConfigs = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; |
|
1354 var stores = {}; |
|
1355 var listeners = []; |
|
1356 /** |
|
1357 * Global listener called for each store's update. |
|
1358 */ |
|
1359 |
|
1360 function globalListener() { |
|
1361 listeners.forEach(function (listener) { |
|
1362 return listener(); |
|
1363 }); |
|
1364 } |
|
1365 /** |
|
1366 * Subscribe to changes to any data. |
|
1367 * |
|
1368 * @param {Function} listener Listener function. |
|
1369 * |
|
1370 * @return {Function} Unsubscribe function. |
|
1371 */ |
|
1372 |
|
1373 |
|
1374 var subscribe = function subscribe(listener) { |
|
1375 listeners.push(listener); |
|
1376 return function () { |
|
1377 listeners = Object(external_lodash_["without"])(listeners, listener); |
|
1378 }; |
|
1379 }; |
|
1380 /** |
|
1381 * Calls a selector given the current state and extra arguments. |
|
1382 * |
|
1383 * @param {string} reducerKey Part of the state shape to register the |
|
1384 * selectors for. |
|
1385 * |
|
1386 * @return {*} The selector's returned value. |
|
1387 */ |
|
1388 |
|
1389 |
|
1390 function select(reducerKey) { |
|
1391 var store = stores[reducerKey]; |
|
1392 return store && store.getSelectors(); |
|
1393 } |
|
1394 /** |
|
1395 * Returns the available actions for a part of the state. |
|
1396 * |
|
1397 * @param {string} reducerKey Part of the state shape to dispatch the |
|
1398 * action for. |
|
1399 * |
|
1400 * @return {*} The action's returned value. |
|
1401 */ |
|
1402 |
|
1403 |
|
1404 function dispatch(reducerKey) { |
|
1405 var store = stores[reducerKey]; |
|
1406 return store && store.getActions(); |
|
1407 } // |
|
1408 // Deprecated |
|
1409 // TODO: Remove this after `use()` is removed. |
|
1410 // |
|
1411 |
|
1412 |
|
1413 function withPlugins(attributes) { |
|
1414 return Object(external_lodash_["mapValues"])(attributes, function (attribute, key) { |
|
1415 if (typeof attribute !== 'function') { |
|
1416 return attribute; |
|
1417 } |
|
1418 |
|
1419 return function () { |
|
1420 return registry[key].apply(null, arguments); |
|
1421 }; |
|
1422 }); |
|
1423 } |
|
1424 /** |
|
1425 * Registers a generic store. |
|
1426 * |
|
1427 * @param {string} key Store registry key. |
|
1428 * @param {Object} config Configuration (getSelectors, getActions, subscribe). |
|
1429 */ |
|
1430 |
|
1431 |
|
1432 function registerGenericStore(key, config) { |
|
1433 if (typeof config.getSelectors !== 'function') { |
|
1434 throw new TypeError('config.getSelectors must be a function'); |
|
1435 } |
|
1436 |
|
1437 if (typeof config.getActions !== 'function') { |
|
1438 throw new TypeError('config.getActions must be a function'); |
|
1439 } |
|
1440 |
|
1441 if (typeof config.subscribe !== 'function') { |
|
1442 throw new TypeError('config.subscribe must be a function'); |
|
1443 } |
|
1444 |
|
1445 stores[key] = config; |
|
1446 config.subscribe(globalListener); |
|
1447 } |
|
1448 |
|
1449 var registry = { |
|
1450 registerGenericStore: registerGenericStore, |
|
1451 stores: stores, |
|
1452 namespaces: stores, |
|
1453 // TODO: Deprecate/remove this. |
|
1454 subscribe: subscribe, |
|
1455 select: select, |
|
1456 dispatch: dispatch, |
|
1457 use: use |
|
1458 }; |
|
1459 /** |
|
1460 * Registers a standard `@wordpress/data` store. |
|
1461 * |
|
1462 * @param {string} reducerKey Reducer key. |
|
1463 * @param {Object} options Store description (reducer, actions, selectors, resolvers). |
|
1464 * |
|
1465 * @return {Object} Registered store object. |
|
1466 */ |
|
1467 |
|
1468 registry.registerStore = function (reducerKey, options) { |
|
1469 if (!options.reducer) { |
|
1470 throw new TypeError('Must specify store reducer'); |
|
1471 } |
|
1472 |
|
1473 var namespace = createNamespace(reducerKey, options, registry); |
|
1474 registerGenericStore(reducerKey, namespace); |
|
1475 return namespace.store; |
|
1476 }; // |
|
1477 // TODO: |
|
1478 // This function will be deprecated as soon as it is no longer internally referenced. |
|
1479 // |
|
1480 |
|
1481 |
|
1482 function use(plugin, options) { |
|
1483 registry = Object(objectSpread["a" /* default */])({}, registry, plugin(registry, options)); |
|
1484 return registry; |
|
1485 } |
|
1486 |
|
1487 Object.entries(Object(objectSpread["a" /* default */])({ |
|
1488 'core/data': build_module_store |
|
1489 }, storeConfigs)).map(function (_ref) { |
|
1490 var _ref2 = Object(slicedToArray["a" /* default */])(_ref, 2), |
|
1491 name = _ref2[0], |
|
1492 config = _ref2[1]; |
|
1493 |
|
1494 return registry.registerStore(name, config); |
|
1495 }); |
|
1496 return withPlugins(registry); |
|
1497 } |
|
1498 |
|
1499 // CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/default-registry.js |
|
1500 /** |
|
1501 * Internal dependencies |
|
1502 */ |
|
1503 |
|
1504 /* harmony default export */ var default_registry = (createRegistry()); |
|
1505 |
|
1506 // EXTERNAL MODULE: external {"this":["wp","reduxRoutine"]} |
|
1507 var external_this_wp_reduxRoutine_ = __webpack_require__(224); |
|
1508 var external_this_wp_reduxRoutine_default = /*#__PURE__*/__webpack_require__.n(external_this_wp_reduxRoutine_); |
|
1509 |
|
1510 // CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/plugins/controls/index.js |
|
1511 /** |
|
1512 * External dependencies |
|
1513 */ |
|
1514 |
|
1515 |
|
1516 /** |
|
1517 * WordPress dependencies |
|
1518 */ |
|
1519 |
|
1520 |
|
1521 /* harmony default export */ var controls = (function (registry) { |
|
1522 return { |
|
1523 registerStore: function registerStore(reducerKey, options) { |
|
1524 var store = registry.registerStore(reducerKey, options); |
|
1525 |
|
1526 if (options.controls) { |
|
1527 var normalizedControls = Object(external_lodash_["mapValues"])(options.controls, function (control) { |
|
1528 return control.isRegistryControl ? control(registry) : control; |
|
1529 }); |
|
1530 var middleware = external_this_wp_reduxRoutine_default()(normalizedControls); |
|
1531 var enhancer = Object(redux["a" /* applyMiddleware */])(middleware); |
|
1532 |
|
1533 var createStore = function createStore() { |
|
1534 return store; |
|
1535 }; |
|
1536 |
|
1537 Object.assign(store, enhancer(createStore)(options.reducer)); |
|
1538 registry.namespaces[reducerKey].supportControls = true; |
|
1539 } |
|
1540 |
|
1541 return store; |
|
1542 } |
|
1543 }; |
|
1544 }); |
|
1545 |
|
1546 // CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/plugins/persistence/storage/object.js |
|
1547 var objectStorage; |
|
1548 var object_storage = { |
|
1549 getItem: function getItem(key) { |
|
1550 if (!objectStorage || !objectStorage[key]) { |
|
1551 return null; |
|
1552 } |
|
1553 |
|
1554 return objectStorage[key]; |
|
1555 }, |
|
1556 setItem: function setItem(key, value) { |
|
1557 if (!objectStorage) { |
|
1558 object_storage.clear(); |
|
1559 } |
|
1560 |
|
1561 objectStorage[key] = String(value); |
|
1562 }, |
|
1563 clear: function clear() { |
|
1564 objectStorage = Object.create(null); |
|
1565 } |
|
1566 }; |
|
1567 /* harmony default export */ var object = (object_storage); |
|
1568 |
|
1569 // CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/plugins/persistence/storage/default.js |
|
1570 /** |
|
1571 * Internal dependencies |
|
1572 */ |
|
1573 |
|
1574 var default_storage; |
|
1575 |
|
1576 try { |
|
1577 // Private Browsing in Safari 10 and earlier will throw an error when |
|
1578 // attempting to set into localStorage. The test here is intentional in |
|
1579 // causing a thrown error as condition for using fallback object storage. |
|
1580 default_storage = window.localStorage; |
|
1581 default_storage.setItem('__wpDataTestLocalStorage', ''); |
|
1582 default_storage.removeItem('__wpDataTestLocalStorage'); |
|
1583 } catch (error) { |
|
1584 default_storage = object; |
|
1585 } |
|
1586 |
|
1587 /* harmony default export */ var storage_default = (default_storage); |
|
1588 |
|
1589 // CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/plugins/persistence/index.js |
|
1590 |
|
1591 |
|
1592 |
|
1593 /** |
|
1594 * External dependencies |
|
1595 */ |
|
1596 |
|
1597 /** |
|
1598 * Internal dependencies |
|
1599 */ |
|
1600 |
|
1601 |
|
1602 |
|
1603 /** |
|
1604 * Persistence plugin options. |
|
1605 * |
|
1606 * @property {Storage} storage Persistent storage implementation. This must |
|
1607 * at least implement `getItem` and `setItem` of |
|
1608 * the Web Storage API. |
|
1609 * @property {string} storageKey Key on which to set in persistent storage. |
|
1610 * |
|
1611 * @typedef {WPDataPersistencePluginOptions} |
|
1612 */ |
|
1613 |
|
1614 /** |
|
1615 * Default plugin storage. |
|
1616 * |
|
1617 * @type {Storage} |
|
1618 */ |
|
1619 |
|
1620 var DEFAULT_STORAGE = storage_default; |
|
1621 /** |
|
1622 * Default plugin storage key. |
|
1623 * |
|
1624 * @type {string} |
|
1625 */ |
|
1626 |
|
1627 var DEFAULT_STORAGE_KEY = 'WP_DATA'; |
|
1628 /** |
|
1629 * Higher-order reducer which invokes the original reducer only if state is |
|
1630 * inequal from that of the action's `nextState` property, otherwise returning |
|
1631 * the original state reference. |
|
1632 * |
|
1633 * @param {Function} reducer Original reducer. |
|
1634 * |
|
1635 * @return {Function} Enhanced reducer. |
|
1636 */ |
|
1637 |
|
1638 var withLazySameState = function withLazySameState(reducer) { |
|
1639 return function (state, action) { |
|
1640 if (action.nextState === state) { |
|
1641 return state; |
|
1642 } |
|
1643 |
|
1644 return reducer(state, action); |
|
1645 }; |
|
1646 }; |
|
1647 /** |
|
1648 * Creates a persistence interface, exposing getter and setter methods (`get` |
|
1649 * and `set` respectively). |
|
1650 * |
|
1651 * @param {WPDataPersistencePluginOptions} options Plugin options. |
|
1652 * |
|
1653 * @return {Object} Persistence interface. |
|
1654 */ |
|
1655 |
|
1656 function createPersistenceInterface(options) { |
|
1657 var _options$storage = options.storage, |
|
1658 storage = _options$storage === void 0 ? DEFAULT_STORAGE : _options$storage, |
|
1659 _options$storageKey = options.storageKey, |
|
1660 storageKey = _options$storageKey === void 0 ? DEFAULT_STORAGE_KEY : _options$storageKey; |
|
1661 var data; |
|
1662 /** |
|
1663 * Returns the persisted data as an object, defaulting to an empty object. |
|
1664 * |
|
1665 * @return {Object} Persisted data. |
|
1666 */ |
|
1667 |
|
1668 function get() { |
|
1669 if (data === undefined) { |
|
1670 // If unset, getItem is expected to return null. Fall back to |
|
1671 // empty object. |
|
1672 var persisted = storage.getItem(storageKey); |
|
1673 |
|
1674 if (persisted === null) { |
|
1675 data = {}; |
|
1676 } else { |
|
1677 try { |
|
1678 data = JSON.parse(persisted); |
|
1679 } catch (error) { |
|
1680 // Similarly, should any error be thrown during parse of |
|
1681 // the string (malformed JSON), fall back to empty object. |
|
1682 data = {}; |
|
1683 } |
|
1684 } |
|
1685 } |
|
1686 |
|
1687 return data; |
|
1688 } |
|
1689 /** |
|
1690 * Merges an updated reducer state into the persisted data. |
|
1691 * |
|
1692 * @param {string} key Key to update. |
|
1693 * @param {*} value Updated value. |
|
1694 */ |
|
1695 |
|
1696 |
|
1697 function set(key, value) { |
|
1698 data = Object(objectSpread["a" /* default */])({}, data, Object(defineProperty["a" /* default */])({}, key, value)); |
|
1699 storage.setItem(storageKey, JSON.stringify(data)); |
|
1700 } |
|
1701 |
|
1702 return { |
|
1703 get: get, |
|
1704 set: set |
|
1705 }; |
|
1706 } |
|
1707 /** |
|
1708 * Data plugin to persist store state into a single storage key. |
|
1709 * |
|
1710 * @param {WPDataRegistry} registry Data registry. |
|
1711 * @param {?WPDataPersistencePluginOptions} pluginOptions Plugin options. |
|
1712 * |
|
1713 * @return {WPDataPlugin} Data plugin. |
|
1714 */ |
|
1715 |
|
1716 var persistence_persistencePlugin = function persistencePlugin(registry, pluginOptions) { |
|
1717 var persistence = createPersistenceInterface(pluginOptions); |
|
1718 /** |
|
1719 * Creates an enhanced store dispatch function, triggering the state of the |
|
1720 * given reducer key to be persisted when changed. |
|
1721 * |
|
1722 * @param {Function} getState Function which returns current state. |
|
1723 * @param {string} reducerKey Reducer key. |
|
1724 * @param {?Array<string>} keys Optional subset of keys to save. |
|
1725 * |
|
1726 * @return {Function} Enhanced dispatch function. |
|
1727 */ |
|
1728 |
|
1729 function createPersistOnChange(getState, reducerKey, keys) { |
|
1730 var getPersistedState; |
|
1731 |
|
1732 if (Array.isArray(keys)) { |
|
1733 // Given keys, the persisted state should by produced as an object |
|
1734 // of the subset of keys. This implementation uses combineReducers |
|
1735 // to leverage its behavior of returning the same object when none |
|
1736 // of the property values changes. This allows a strict reference |
|
1737 // equality to bypass a persistence set on an unchanging state. |
|
1738 var reducers = keys.reduce(function (result, key) { |
|
1739 return Object.assign(result, Object(defineProperty["a" /* default */])({}, key, function (state, action) { |
|
1740 return action.nextState[key]; |
|
1741 })); |
|
1742 }, {}); |
|
1743 getPersistedState = withLazySameState(turbo_combine_reducers_default()(reducers)); |
|
1744 } else { |
|
1745 getPersistedState = function getPersistedState(state, action) { |
|
1746 return action.nextState; |
|
1747 }; |
|
1748 } |
|
1749 |
|
1750 var lastState = getPersistedState(undefined, { |
|
1751 nextState: getState() |
|
1752 }); |
|
1753 return function (result) { |
|
1754 var state = getPersistedState(lastState, { |
|
1755 nextState: getState() |
|
1756 }); |
|
1757 |
|
1758 if (state !== lastState) { |
|
1759 persistence.set(reducerKey, state); |
|
1760 lastState = state; |
|
1761 } |
|
1762 |
|
1763 return result; |
|
1764 }; |
|
1765 } |
|
1766 |
|
1767 return { |
|
1768 registerStore: function registerStore(reducerKey, options) { |
|
1769 if (!options.persist) { |
|
1770 return registry.registerStore(reducerKey, options); |
|
1771 } // Load from persistence to use as initial state. |
|
1772 |
|
1773 |
|
1774 var persistedState = persistence.get()[reducerKey]; |
|
1775 |
|
1776 if (persistedState !== undefined) { |
|
1777 var initialState = options.reducer(undefined, { |
|
1778 type: '@@WP/PERSISTENCE_RESTORE' |
|
1779 }); |
|
1780 |
|
1781 if (Object(external_lodash_["isPlainObject"])(initialState) && Object(external_lodash_["isPlainObject"])(persistedState)) { |
|
1782 // If state is an object, ensure that: |
|
1783 // - Other keys are left intact when persisting only a |
|
1784 // subset of keys. |
|
1785 // - New keys in what would otherwise be used as initial |
|
1786 // state are deeply merged as base for persisted value. |
|
1787 initialState = Object(external_lodash_["merge"])({}, initialState, persistedState); |
|
1788 } else { |
|
1789 // If there is a mismatch in object-likeness of default |
|
1790 // initial or persisted state, defer to persisted value. |
|
1791 initialState = persistedState; |
|
1792 } |
|
1793 |
|
1794 options = Object(objectSpread["a" /* default */])({}, options, { |
|
1795 initialState: initialState |
|
1796 }); |
|
1797 } |
|
1798 |
|
1799 var store = registry.registerStore(reducerKey, options); |
|
1800 store.dispatch = Object(external_lodash_["flow"])([store.dispatch, createPersistOnChange(store.getState, reducerKey, options.persist)]); |
|
1801 return store; |
|
1802 } |
|
1803 }; |
|
1804 }; |
|
1805 /** |
|
1806 * Deprecated: Remove this function once WordPress 5.3 is released. |
|
1807 */ |
|
1808 |
|
1809 |
|
1810 persistence_persistencePlugin.__unstableMigrate = function (pluginOptions) { |
|
1811 var persistence = createPersistenceInterface(pluginOptions); // Preferences migration to introduce the block editor module |
|
1812 |
|
1813 var persistedState = persistence.get(); |
|
1814 var coreEditorState = persistedState['core/editor']; |
|
1815 |
|
1816 if (coreEditorState && coreEditorState.preferences && coreEditorState.preferences.insertUsage) { |
|
1817 var blockEditorState = { |
|
1818 preferences: { |
|
1819 insertUsage: coreEditorState.preferences.insertUsage |
|
1820 } |
|
1821 }; |
|
1822 persistence.set('core/editor', Object(objectSpread["a" /* default */])({}, coreEditorState, { |
|
1823 preferences: Object(external_lodash_["omit"])(coreEditorState.preferences, ['insertUsage']) |
|
1824 })); |
|
1825 persistence.set('core/block-editor', blockEditorState); |
|
1826 } |
|
1827 }; |
|
1828 |
|
1829 /* harmony default export */ var plugins_persistence = (persistence_persistencePlugin); |
|
1830 |
|
1831 // CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/plugins/index.js |
|
1832 |
|
1833 |
|
1834 |
|
1835 // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/extends.js |
|
1836 var esm_extends = __webpack_require__(19); |
|
1837 |
|
1838 // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/classCallCheck.js |
|
1839 var classCallCheck = __webpack_require__(10); |
|
1840 |
|
1841 // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/createClass.js |
|
1842 var createClass = __webpack_require__(9); |
|
1843 |
|
1844 // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js |
|
1845 var possibleConstructorReturn = __webpack_require__(11); |
|
1846 |
|
1847 // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js |
|
1848 var getPrototypeOf = __webpack_require__(12); |
|
1849 |
|
1850 // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/inherits.js + 1 modules |
|
1851 var inherits = __webpack_require__(13); |
|
1852 |
|
1853 // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js |
|
1854 var assertThisInitialized = __webpack_require__(3); |
|
1855 |
|
1856 // EXTERNAL MODULE: external {"this":["wp","element"]} |
|
1857 var external_this_wp_element_ = __webpack_require__(0); |
|
1858 |
|
1859 // EXTERNAL MODULE: external {"this":["wp","isShallowEqual"]} |
|
1860 var external_this_wp_isShallowEqual_ = __webpack_require__(42); |
|
1861 |
|
1862 // EXTERNAL MODULE: external {"this":["wp","compose"]} |
|
1863 var external_this_wp_compose_ = __webpack_require__(6); |
|
1864 |
|
1865 // EXTERNAL MODULE: external {"this":["wp","priorityQueue"]} |
|
1866 var external_this_wp_priorityQueue_ = __webpack_require__(225); |
|
1867 |
|
1868 // CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/components/registry-provider/index.js |
|
1869 /** |
|
1870 * WordPress dependencies |
|
1871 */ |
|
1872 |
|
1873 /** |
|
1874 * Internal dependencies |
|
1875 */ |
|
1876 |
|
1877 |
|
1878 |
|
1879 var _createContext = Object(external_this_wp_element_["createContext"])(default_registry), |
|
1880 Consumer = _createContext.Consumer, |
|
1881 Provider = _createContext.Provider; |
|
1882 |
|
1883 var RegistryConsumer = Consumer; |
|
1884 /* harmony default export */ var registry_provider = (Provider); |
|
1885 |
|
1886 // CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/components/async-mode-provider/index.js |
|
1887 /** |
|
1888 * WordPress dependencies |
|
1889 */ |
|
1890 |
|
1891 |
|
1892 var async_mode_provider_createContext = Object(external_this_wp_element_["createContext"])(false), |
|
1893 async_mode_provider_Consumer = async_mode_provider_createContext.Consumer, |
|
1894 async_mode_provider_Provider = async_mode_provider_createContext.Provider; |
|
1895 |
|
1896 var AsyncModeConsumer = async_mode_provider_Consumer; |
|
1897 /* harmony default export */ var async_mode_provider = (async_mode_provider_Provider); |
|
1898 |
|
1899 // CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/components/with-select/index.js |
|
1900 |
|
1901 |
|
1902 |
|
1903 |
|
1904 |
|
1905 |
|
1906 |
|
1907 |
|
1908 |
|
1909 /** |
|
1910 * WordPress dependencies |
|
1911 */ |
|
1912 |
|
1913 |
|
1914 |
|
1915 |
|
1916 /** |
|
1917 * Internal dependencies |
|
1918 */ |
|
1919 |
|
1920 |
|
1921 |
|
1922 var renderQueue = Object(external_this_wp_priorityQueue_["createQueue"])(); |
|
1923 /** |
|
1924 * Higher-order component used to inject state-derived props using registered |
|
1925 * selectors. |
|
1926 * |
|
1927 * @param {Function} mapSelectToProps Function called on every state change, |
|
1928 * expected to return object of props to |
|
1929 * merge with the component's own props. |
|
1930 * |
|
1931 * @return {Component} Enhanced component with merged state data props. |
|
1932 */ |
|
1933 |
|
1934 var with_select_withSelect = function withSelect(mapSelectToProps) { |
|
1935 return Object(external_this_wp_compose_["createHigherOrderComponent"])(function (WrappedComponent) { |
|
1936 /** |
|
1937 * Default merge props. A constant value is used as the fallback since it |
|
1938 * can be more efficiently shallow compared in case component is repeatedly |
|
1939 * rendered without its own merge props. |
|
1940 * |
|
1941 * @type {Object} |
|
1942 */ |
|
1943 var DEFAULT_MERGE_PROPS = {}; |
|
1944 /** |
|
1945 * Given a props object, returns the next merge props by mapSelectToProps. |
|
1946 * |
|
1947 * @param {Object} props Props to pass as argument to mapSelectToProps. |
|
1948 * |
|
1949 * @return {Object} Props to merge into rendered wrapped element. |
|
1950 */ |
|
1951 |
|
1952 function getNextMergeProps(props) { |
|
1953 return mapSelectToProps(props.registry.select, props.ownProps, props.registry) || DEFAULT_MERGE_PROPS; |
|
1954 } |
|
1955 |
|
1956 var ComponentWithSelect = |
|
1957 /*#__PURE__*/ |
|
1958 function (_Component) { |
|
1959 Object(inherits["a" /* default */])(ComponentWithSelect, _Component); |
|
1960 |
|
1961 function ComponentWithSelect(props) { |
|
1962 var _this; |
|
1963 |
|
1964 Object(classCallCheck["a" /* default */])(this, ComponentWithSelect); |
|
1965 |
|
1966 _this = Object(possibleConstructorReturn["a" /* default */])(this, Object(getPrototypeOf["a" /* default */])(ComponentWithSelect).call(this, props)); |
|
1967 _this.onStoreChange = _this.onStoreChange.bind(Object(assertThisInitialized["a" /* default */])(Object(assertThisInitialized["a" /* default */])(_this))); |
|
1968 |
|
1969 _this.subscribe(props.registry); |
|
1970 |
|
1971 _this.mergeProps = getNextMergeProps(props); |
|
1972 return _this; |
|
1973 } |
|
1974 |
|
1975 Object(createClass["a" /* default */])(ComponentWithSelect, [{ |
|
1976 key: "componentDidMount", |
|
1977 value: function componentDidMount() { |
|
1978 this.canRunSelection = true; // A state change may have occurred between the constructor and |
|
1979 // mount of the component (e.g. during the wrapped component's own |
|
1980 // constructor), in which case selection should be rerun. |
|
1981 |
|
1982 if (this.hasQueuedSelection) { |
|
1983 this.hasQueuedSelection = false; |
|
1984 this.onStoreChange(); |
|
1985 } |
|
1986 } |
|
1987 }, { |
|
1988 key: "componentWillUnmount", |
|
1989 value: function componentWillUnmount() { |
|
1990 this.canRunSelection = false; |
|
1991 this.unsubscribe(); |
|
1992 renderQueue.flush(this); |
|
1993 } |
|
1994 }, { |
|
1995 key: "shouldComponentUpdate", |
|
1996 value: function shouldComponentUpdate(nextProps, nextState) { |
|
1997 // Cycle subscription if registry changes. |
|
1998 var hasRegistryChanged = nextProps.registry !== this.props.registry; |
|
1999 var hasSyncRenderingChanged = nextProps.isAsync !== this.props.isAsync; |
|
2000 |
|
2001 if (hasRegistryChanged) { |
|
2002 this.unsubscribe(); |
|
2003 this.subscribe(nextProps.registry); |
|
2004 } |
|
2005 |
|
2006 if (hasSyncRenderingChanged) { |
|
2007 renderQueue.flush(this); |
|
2008 } // Treat a registry change as equivalent to `ownProps`, to reflect |
|
2009 // `mergeProps` to rendered component if and only if updated. |
|
2010 |
|
2011 |
|
2012 var hasPropsChanged = hasRegistryChanged || !Object(external_this_wp_isShallowEqual_["isShallowEqualObjects"])(this.props.ownProps, nextProps.ownProps); // Only render if props have changed or merge props have been updated |
|
2013 // from the store subscriber. |
|
2014 |
|
2015 if (this.state === nextState && !hasPropsChanged && !hasSyncRenderingChanged) { |
|
2016 return false; |
|
2017 } |
|
2018 |
|
2019 if (hasPropsChanged || hasSyncRenderingChanged) { |
|
2020 var nextMergeProps = getNextMergeProps(nextProps); |
|
2021 |
|
2022 if (!Object(external_this_wp_isShallowEqual_["isShallowEqualObjects"])(this.mergeProps, nextMergeProps)) { |
|
2023 // If merge props change as a result of the incoming props, |
|
2024 // they should be reflected as such in the upcoming render. |
|
2025 // While side effects are discouraged in lifecycle methods, |
|
2026 // this component is used heavily, and prior efforts to use |
|
2027 // `getDerivedStateFromProps` had demonstrated miserable |
|
2028 // performance. |
|
2029 this.mergeProps = nextMergeProps; |
|
2030 } // Regardless whether merge props are changing, fall through to |
|
2031 // incur the render since the component will need to receive |
|
2032 // the changed `ownProps`. |
|
2033 |
|
2034 } |
|
2035 |
|
2036 return true; |
|
2037 } |
|
2038 }, { |
|
2039 key: "onStoreChange", |
|
2040 value: function onStoreChange() { |
|
2041 if (!this.canRunSelection) { |
|
2042 this.hasQueuedSelection = true; |
|
2043 return; |
|
2044 } |
|
2045 |
|
2046 var nextMergeProps = getNextMergeProps(this.props); |
|
2047 |
|
2048 if (Object(external_this_wp_isShallowEqual_["isShallowEqualObjects"])(this.mergeProps, nextMergeProps)) { |
|
2049 return; |
|
2050 } |
|
2051 |
|
2052 this.mergeProps = nextMergeProps; // Schedule an update. Merge props are not assigned to state since |
|
2053 // derivation of merge props from incoming props occurs within |
|
2054 // shouldComponentUpdate, where setState is not allowed. setState |
|
2055 // is used here instead of forceUpdate because forceUpdate bypasses |
|
2056 // shouldComponentUpdate altogether, which isn't desireable if both |
|
2057 // state and props change within the same render. Unfortunately, |
|
2058 // this requires that next merge props are generated twice. |
|
2059 |
|
2060 this.setState({}); |
|
2061 } |
|
2062 }, { |
|
2063 key: "subscribe", |
|
2064 value: function subscribe(registry) { |
|
2065 var _this2 = this; |
|
2066 |
|
2067 this.unsubscribe = registry.subscribe(function () { |
|
2068 if (_this2.props.isAsync) { |
|
2069 renderQueue.add(_this2, _this2.onStoreChange); |
|
2070 } else { |
|
2071 _this2.onStoreChange(); |
|
2072 } |
|
2073 }); |
|
2074 } |
|
2075 }, { |
|
2076 key: "render", |
|
2077 value: function render() { |
|
2078 return Object(external_this_wp_element_["createElement"])(WrappedComponent, Object(esm_extends["a" /* default */])({}, this.props.ownProps, this.mergeProps)); |
|
2079 } |
|
2080 }]); |
|
2081 |
|
2082 return ComponentWithSelect; |
|
2083 }(external_this_wp_element_["Component"]); |
|
2084 |
|
2085 return function (ownProps) { |
|
2086 return Object(external_this_wp_element_["createElement"])(AsyncModeConsumer, null, function (isAsync) { |
|
2087 return Object(external_this_wp_element_["createElement"])(RegistryConsumer, null, function (registry) { |
|
2088 return Object(external_this_wp_element_["createElement"])(ComponentWithSelect, { |
|
2089 ownProps: ownProps, |
|
2090 registry: registry, |
|
2091 isAsync: isAsync |
|
2092 }); |
|
2093 }); |
|
2094 }); |
|
2095 }; |
|
2096 }, 'withSelect'); |
|
2097 }; |
|
2098 |
|
2099 /* harmony default export */ var with_select = (with_select_withSelect); |
|
2100 |
|
2101 // CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/components/with-dispatch/index.js |
|
2102 |
|
2103 |
|
2104 |
|
2105 |
|
2106 |
|
2107 |
|
2108 |
|
2109 |
|
2110 /** |
|
2111 * External dependencies |
|
2112 */ |
|
2113 |
|
2114 /** |
|
2115 * WordPress dependencies |
|
2116 */ |
|
2117 |
|
2118 |
|
2119 |
|
2120 /** |
|
2121 * Internal dependencies |
|
2122 */ |
|
2123 |
|
2124 |
|
2125 /** |
|
2126 * Higher-order component used to add dispatch props using registered action |
|
2127 * creators. |
|
2128 * |
|
2129 * @param {Object} mapDispatchToProps Object of prop names where value is a |
|
2130 * dispatch-bound action creator, or a |
|
2131 * function to be called with with the |
|
2132 * component's props and returning an |
|
2133 * action creator. |
|
2134 * |
|
2135 * @return {Component} Enhanced component with merged dispatcher props. |
|
2136 */ |
|
2137 |
|
2138 var with_dispatch_withDispatch = function withDispatch(mapDispatchToProps) { |
|
2139 return Object(external_this_wp_compose_["createHigherOrderComponent"])(function (WrappedComponent) { |
|
2140 var ComponentWithDispatch = |
|
2141 /*#__PURE__*/ |
|
2142 function (_Component) { |
|
2143 Object(inherits["a" /* default */])(ComponentWithDispatch, _Component); |
|
2144 |
|
2145 function ComponentWithDispatch(props) { |
|
2146 var _this; |
|
2147 |
|
2148 Object(classCallCheck["a" /* default */])(this, ComponentWithDispatch); |
|
2149 |
|
2150 _this = Object(possibleConstructorReturn["a" /* default */])(this, Object(getPrototypeOf["a" /* default */])(ComponentWithDispatch).apply(this, arguments)); |
|
2151 _this.proxyProps = {}; |
|
2152 |
|
2153 _this.setProxyProps(props); |
|
2154 |
|
2155 return _this; |
|
2156 } |
|
2157 |
|
2158 Object(createClass["a" /* default */])(ComponentWithDispatch, [{ |
|
2159 key: "proxyDispatch", |
|
2160 value: function proxyDispatch(propName) { |
|
2161 var _mapDispatchToProps; |
|
2162 |
|
2163 for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { |
|
2164 args[_key - 1] = arguments[_key]; |
|
2165 } |
|
2166 |
|
2167 // Original dispatcher is a pre-bound (dispatching) action creator. |
|
2168 (_mapDispatchToProps = mapDispatchToProps(this.props.registry.dispatch, this.props.ownProps, this.props.registry))[propName].apply(_mapDispatchToProps, args); |
|
2169 } |
|
2170 }, { |
|
2171 key: "setProxyProps", |
|
2172 value: function setProxyProps(props) { |
|
2173 var _this2 = this; |
|
2174 |
|
2175 // Assign as instance property so that in subsequent render |
|
2176 // reconciliation, the prop values are referentially equal. |
|
2177 // Importantly, note that while `mapDispatchToProps` is |
|
2178 // called, it is done only to determine the keys for which |
|
2179 // proxy functions should be created. The actual registry |
|
2180 // dispatch does not occur until the function is called. |
|
2181 var propsToDispatchers = mapDispatchToProps(this.props.registry.dispatch, props.ownProps, this.props.registry); |
|
2182 this.proxyProps = Object(external_lodash_["mapValues"])(propsToDispatchers, function (dispatcher, propName) { |
|
2183 if (typeof dispatcher !== 'function') { |
|
2184 // eslint-disable-next-line no-console |
|
2185 console.warn("Property ".concat(propName, " returned from mapDispatchToProps in withDispatch must be a function.")); |
|
2186 } // Prebind with prop name so we have reference to the original |
|
2187 // dispatcher to invoke. Track between re-renders to avoid |
|
2188 // creating new function references every render. |
|
2189 |
|
2190 |
|
2191 if (_this2.proxyProps.hasOwnProperty(propName)) { |
|
2192 return _this2.proxyProps[propName]; |
|
2193 } |
|
2194 |
|
2195 return _this2.proxyDispatch.bind(_this2, propName); |
|
2196 }); |
|
2197 } |
|
2198 }, { |
|
2199 key: "render", |
|
2200 value: function render() { |
|
2201 return Object(external_this_wp_element_["createElement"])(WrappedComponent, Object(esm_extends["a" /* default */])({}, this.props.ownProps, this.proxyProps)); |
|
2202 } |
|
2203 }]); |
|
2204 |
|
2205 return ComponentWithDispatch; |
|
2206 }(external_this_wp_element_["Component"]); |
|
2207 |
|
2208 return function (ownProps) { |
|
2209 return Object(external_this_wp_element_["createElement"])(RegistryConsumer, null, function (registry) { |
|
2210 return Object(external_this_wp_element_["createElement"])(ComponentWithDispatch, { |
|
2211 ownProps: ownProps, |
|
2212 registry: registry |
|
2213 }); |
|
2214 }); |
|
2215 }; |
|
2216 }, 'withDispatch'); |
|
2217 }; |
|
2218 |
|
2219 /* harmony default export */ var with_dispatch = (with_dispatch_withDispatch); |
|
2220 |
|
2221 // CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/components/with-registry/index.js |
|
2222 |
|
2223 |
|
2224 |
|
2225 /** |
|
2226 * WordPress dependencies |
|
2227 */ |
|
2228 |
|
2229 /** |
|
2230 * Internal dependencies |
|
2231 */ |
|
2232 |
|
2233 |
|
2234 /** |
|
2235 * Higher-order component which renders the original component with the current |
|
2236 * registry context passed as its `registry` prop. |
|
2237 * |
|
2238 * @param {WPComponent} OriginalComponent Original component. |
|
2239 * |
|
2240 * @return {WPComponent} Enhanced component. |
|
2241 */ |
|
2242 |
|
2243 var withRegistry = Object(external_this_wp_compose_["createHigherOrderComponent"])(function (OriginalComponent) { |
|
2244 return function (props) { |
|
2245 return Object(external_this_wp_element_["createElement"])(RegistryConsumer, null, function (registry) { |
|
2246 return Object(external_this_wp_element_["createElement"])(OriginalComponent, Object(esm_extends["a" /* default */])({}, props, { |
|
2247 registry: registry |
|
2248 })); |
|
2249 }); |
|
2250 }; |
|
2251 }, 'withRegistry'); |
|
2252 /* harmony default export */ var with_registry = (withRegistry); |
|
2253 |
|
2254 // CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/factory.js |
|
2255 /** |
|
2256 * Mark a selector as a registry selector. |
|
2257 * |
|
2258 * @param {function} registrySelector Function receiving a registry object and returning a state selector. |
|
2259 * |
|
2260 * @return {function} marked registry selector. |
|
2261 */ |
|
2262 function createRegistrySelector(registrySelector) { |
|
2263 registrySelector.isRegistrySelector = true; |
|
2264 return registrySelector; |
|
2265 } |
|
2266 /** |
|
2267 * Mark a control as a registry control. |
|
2268 * |
|
2269 * @param {function} registryControl Function receiving a registry object and returning a control. |
|
2270 * |
|
2271 * @return {function} marked registry control. |
|
2272 */ |
|
2273 |
|
2274 function createRegistryControl(registryControl) { |
|
2275 registryControl.isRegistryControl = true; |
|
2276 return registryControl; |
|
2277 } |
|
2278 |
|
2279 // CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/index.js |
|
2280 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "select", function() { return build_module_select; }); |
|
2281 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "dispatch", function() { return build_module_dispatch; }); |
|
2282 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "subscribe", function() { return build_module_subscribe; }); |
|
2283 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "registerGenericStore", function() { return build_module_registerGenericStore; }); |
|
2284 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "registerStore", function() { return build_module_registerStore; }); |
|
2285 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "use", function() { return build_module_use; }); |
|
2286 /* concated harmony reexport withSelect */__webpack_require__.d(__webpack_exports__, "withSelect", function() { return with_select; }); |
|
2287 /* concated harmony reexport withDispatch */__webpack_require__.d(__webpack_exports__, "withDispatch", function() { return with_dispatch; }); |
|
2288 /* concated harmony reexport withRegistry */__webpack_require__.d(__webpack_exports__, "withRegistry", function() { return with_registry; }); |
|
2289 /* concated harmony reexport RegistryProvider */__webpack_require__.d(__webpack_exports__, "RegistryProvider", function() { return registry_provider; }); |
|
2290 /* concated harmony reexport RegistryConsumer */__webpack_require__.d(__webpack_exports__, "RegistryConsumer", function() { return RegistryConsumer; }); |
|
2291 /* concated harmony reexport __experimentalAsyncModeProvider */__webpack_require__.d(__webpack_exports__, "__experimentalAsyncModeProvider", function() { return async_mode_provider; }); |
|
2292 /* concated harmony reexport createRegistry */__webpack_require__.d(__webpack_exports__, "createRegistry", function() { return createRegistry; }); |
|
2293 /* concated harmony reexport plugins */__webpack_require__.d(__webpack_exports__, "plugins", function() { return plugins_namespaceObject; }); |
|
2294 /* concated harmony reexport createRegistrySelector */__webpack_require__.d(__webpack_exports__, "createRegistrySelector", function() { return createRegistrySelector; }); |
|
2295 /* concated harmony reexport createRegistryControl */__webpack_require__.d(__webpack_exports__, "createRegistryControl", function() { return createRegistryControl; }); |
|
2296 /* concated harmony reexport combineReducers */__webpack_require__.d(__webpack_exports__, "combineReducers", function() { return turbo_combine_reducers_default.a; }); |
|
2297 /** |
|
2298 * External dependencies |
|
2299 */ |
|
2300 |
|
2301 /** |
|
2302 * Internal dependencies |
|
2303 */ |
|
2304 |
|
2305 |
|
2306 |
|
2307 |
|
2308 |
|
2309 |
|
2310 |
|
2311 |
|
2312 |
|
2313 |
|
2314 |
|
2315 /** |
|
2316 * The combineReducers helper function turns an object whose values are different |
|
2317 * reducing functions into a single reducing function you can pass to registerReducer. |
|
2318 * |
|
2319 * @param {Object} reducers An object whose values correspond to different reducing |
|
2320 * functions that need to be combined into one. |
|
2321 * |
|
2322 * @return {Function} A reducer that invokes every reducer inside the reducers |
|
2323 * object, and constructs a state object with the same shape. |
|
2324 */ |
|
2325 |
|
2326 |
|
2327 var build_module_select = default_registry.select; |
|
2328 var build_module_dispatch = default_registry.dispatch; |
|
2329 var build_module_subscribe = default_registry.subscribe; |
|
2330 var build_module_registerGenericStore = default_registry.registerGenericStore; |
|
2331 var build_module_registerStore = default_registry.registerStore; |
|
2332 var build_module_use = default_registry.use; |
|
2333 |
|
2334 |
|
2335 /***/ }), |
|
2336 |
|
2337 /***/ 37: |
|
2338 /***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
2339 |
|
2340 "use strict"; |
|
2341 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _arrayWithHoles; }); |
|
2342 function _arrayWithHoles(arr) { |
|
2343 if (Array.isArray(arr)) return arr; |
|
2344 } |
|
2345 |
|
2346 /***/ }), |
|
2347 |
|
2348 /***/ 38: |
|
2349 /***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
2350 |
|
2351 "use strict"; |
|
2352 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _nonIterableRest; }); |
|
2353 function _nonIterableRest() { |
|
2354 throw new TypeError("Invalid attempt to destructure non-iterable instance"); |
|
2355 } |
|
2356 |
|
2357 /***/ }), |
|
2358 |
|
2359 /***/ 42: |
|
2360 /***/ (function(module, exports) { |
|
2361 |
|
2362 (function() { module.exports = this["wp"]["isShallowEqual"]; }()); |
|
2363 |
|
2364 /***/ }), |
|
2365 |
|
2366 /***/ 44: |
|
2367 /***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
2368 |
|
2369 "use strict"; |
|
2370 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _asyncToGenerator; }); |
|
2371 function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { |
|
2372 try { |
|
2373 var info = gen[key](arg); |
|
2374 var value = info.value; |
|
2375 } catch (error) { |
|
2376 reject(error); |
|
2377 return; |
|
2378 } |
|
2379 |
|
2380 if (info.done) { |
|
2381 resolve(value); |
|
2382 } else { |
|
2383 Promise.resolve(value).then(_next, _throw); |
|
2384 } |
|
2385 } |
|
2386 |
|
2387 function _asyncToGenerator(fn) { |
|
2388 return function () { |
|
2389 var self = this, |
|
2390 args = arguments; |
|
2391 return new Promise(function (resolve, reject) { |
|
2392 var gen = fn.apply(self, args); |
|
2393 |
|
2394 function _next(value) { |
|
2395 asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); |
|
2396 } |
|
2397 |
|
2398 function _throw(err) { |
|
2399 asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); |
|
2400 } |
|
2401 |
|
2402 _next(undefined); |
|
2403 }); |
|
2404 }; |
|
2405 } |
|
2406 |
|
2407 /***/ }), |
|
2408 |
|
2409 /***/ 54: |
|
2410 /***/ (function(module, exports, __webpack_require__) { |
|
2411 |
|
2412 /** |
|
2413 * Copyright (c) 2014-present, Facebook, Inc. |
|
2414 * |
|
2415 * This source code is licensed under the MIT license found in the |
|
2416 * LICENSE file in the root directory of this source tree. |
|
2417 */ |
|
2418 |
|
2419 // This method of obtaining a reference to the global object needs to be |
|
2420 // kept identical to the way it is obtained in runtime.js |
|
2421 var g = (function() { |
|
2422 return this || (typeof self === "object" && self); |
|
2423 })() || Function("return this")(); |
|
2424 |
|
2425 // Use `getOwnPropertyNames` because not all browsers support calling |
|
2426 // `hasOwnProperty` on the global `self` object in a worker. See #183. |
|
2427 var hadRuntime = g.regeneratorRuntime && |
|
2428 Object.getOwnPropertyNames(g).indexOf("regeneratorRuntime") >= 0; |
|
2429 |
|
2430 // Save the old regeneratorRuntime in case it needs to be restored later. |
|
2431 var oldRuntime = hadRuntime && g.regeneratorRuntime; |
|
2432 |
|
2433 // Force reevalutation of runtime.js. |
|
2434 g.regeneratorRuntime = undefined; |
|
2435 |
|
2436 module.exports = __webpack_require__(55); |
|
2437 |
|
2438 if (hadRuntime) { |
|
2439 // Restore the original runtime. |
|
2440 g.regeneratorRuntime = oldRuntime; |
|
2441 } else { |
|
2442 // Remove the global property added by runtime.js. |
|
2443 try { |
|
2444 delete g.regeneratorRuntime; |
|
2445 } catch(e) { |
|
2446 g.regeneratorRuntime = undefined; |
|
2447 } |
|
2448 } |
|
2449 |
|
2450 |
|
2451 /***/ }), |
|
2452 |
|
2453 /***/ 55: |
|
2454 /***/ (function(module, exports) { |
|
2455 |
|
2456 /** |
|
2457 * Copyright (c) 2014-present, Facebook, Inc. |
|
2458 * |
|
2459 * This source code is licensed under the MIT license found in the |
|
2460 * LICENSE file in the root directory of this source tree. |
|
2461 */ |
|
2462 |
|
2463 !(function(global) { |
|
2464 "use strict"; |
|
2465 |
|
2466 var Op = Object.prototype; |
|
2467 var hasOwn = Op.hasOwnProperty; |
|
2468 var undefined; // More compressible than void 0. |
|
2469 var $Symbol = typeof Symbol === "function" ? Symbol : {}; |
|
2470 var iteratorSymbol = $Symbol.iterator || "@@iterator"; |
|
2471 var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator"; |
|
2472 var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; |
|
2473 |
|
2474 var inModule = typeof module === "object"; |
|
2475 var runtime = global.regeneratorRuntime; |
|
2476 if (runtime) { |
|
2477 if (inModule) { |
|
2478 // If regeneratorRuntime is defined globally and we're in a module, |
|
2479 // make the exports object identical to regeneratorRuntime. |
|
2480 module.exports = runtime; |
|
2481 } |
|
2482 // Don't bother evaluating the rest of this file if the runtime was |
|
2483 // already defined globally. |
|
2484 return; |
|
2485 } |
|
2486 |
|
2487 // Define the runtime globally (as expected by generated code) as either |
|
2488 // module.exports (if we're in a module) or a new, empty object. |
|
2489 runtime = global.regeneratorRuntime = inModule ? module.exports : {}; |
|
2490 |
|
2491 function wrap(innerFn, outerFn, self, tryLocsList) { |
|
2492 // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator. |
|
2493 var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator; |
|
2494 var generator = Object.create(protoGenerator.prototype); |
|
2495 var context = new Context(tryLocsList || []); |
|
2496 |
|
2497 // The ._invoke method unifies the implementations of the .next, |
|
2498 // .throw, and .return methods. |
|
2499 generator._invoke = makeInvokeMethod(innerFn, self, context); |
|
2500 |
|
2501 return generator; |
|
2502 } |
|
2503 runtime.wrap = wrap; |
|
2504 |
|
2505 // Try/catch helper to minimize deoptimizations. Returns a completion |
|
2506 // record like context.tryEntries[i].completion. This interface could |
|
2507 // have been (and was previously) designed to take a closure to be |
|
2508 // invoked without arguments, but in all the cases we care about we |
|
2509 // already have an existing method we want to call, so there's no need |
|
2510 // to create a new function object. We can even get away with assuming |
|
2511 // the method takes exactly one argument, since that happens to be true |
|
2512 // in every case, so we don't have to touch the arguments object. The |
|
2513 // only additional allocation required is the completion record, which |
|
2514 // has a stable shape and so hopefully should be cheap to allocate. |
|
2515 function tryCatch(fn, obj, arg) { |
|
2516 try { |
|
2517 return { type: "normal", arg: fn.call(obj, arg) }; |
|
2518 } catch (err) { |
|
2519 return { type: "throw", arg: err }; |
|
2520 } |
|
2521 } |
|
2522 |
|
2523 var GenStateSuspendedStart = "suspendedStart"; |
|
2524 var GenStateSuspendedYield = "suspendedYield"; |
|
2525 var GenStateExecuting = "executing"; |
|
2526 var GenStateCompleted = "completed"; |
|
2527 |
|
2528 // Returning this object from the innerFn has the same effect as |
|
2529 // breaking out of the dispatch switch statement. |
|
2530 var ContinueSentinel = {}; |
|
2531 |
|
2532 // Dummy constructor functions that we use as the .constructor and |
|
2533 // .constructor.prototype properties for functions that return Generator |
|
2534 // objects. For full spec compliance, you may wish to configure your |
|
2535 // minifier not to mangle the names of these two functions. |
|
2536 function Generator() {} |
|
2537 function GeneratorFunction() {} |
|
2538 function GeneratorFunctionPrototype() {} |
|
2539 |
|
2540 // This is a polyfill for %IteratorPrototype% for environments that |
|
2541 // don't natively support it. |
|
2542 var IteratorPrototype = {}; |
|
2543 IteratorPrototype[iteratorSymbol] = function () { |
|
2544 return this; |
|
2545 }; |
|
2546 |
|
2547 var getProto = Object.getPrototypeOf; |
|
2548 var NativeIteratorPrototype = getProto && getProto(getProto(values([]))); |
|
2549 if (NativeIteratorPrototype && |
|
2550 NativeIteratorPrototype !== Op && |
|
2551 hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) { |
|
2552 // This environment has a native %IteratorPrototype%; use it instead |
|
2553 // of the polyfill. |
|
2554 IteratorPrototype = NativeIteratorPrototype; |
|
2555 } |
|
2556 |
|
2557 var Gp = GeneratorFunctionPrototype.prototype = |
|
2558 Generator.prototype = Object.create(IteratorPrototype); |
|
2559 GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype; |
|
2560 GeneratorFunctionPrototype.constructor = GeneratorFunction; |
|
2561 GeneratorFunctionPrototype[toStringTagSymbol] = |
|
2562 GeneratorFunction.displayName = "GeneratorFunction"; |
|
2563 |
|
2564 // Helper for defining the .next, .throw, and .return methods of the |
|
2565 // Iterator interface in terms of a single ._invoke method. |
|
2566 function defineIteratorMethods(prototype) { |
|
2567 ["next", "throw", "return"].forEach(function(method) { |
|
2568 prototype[method] = function(arg) { |
|
2569 return this._invoke(method, arg); |
|
2570 }; |
|
2571 }); |
|
2572 } |
|
2573 |
|
2574 runtime.isGeneratorFunction = function(genFun) { |
|
2575 var ctor = typeof genFun === "function" && genFun.constructor; |
|
2576 return ctor |
|
2577 ? ctor === GeneratorFunction || |
|
2578 // For the native GeneratorFunction constructor, the best we can |
|
2579 // do is to check its .name property. |
|
2580 (ctor.displayName || ctor.name) === "GeneratorFunction" |
|
2581 : false; |
|
2582 }; |
|
2583 |
|
2584 runtime.mark = function(genFun) { |
|
2585 if (Object.setPrototypeOf) { |
|
2586 Object.setPrototypeOf(genFun, GeneratorFunctionPrototype); |
|
2587 } else { |
|
2588 genFun.__proto__ = GeneratorFunctionPrototype; |
|
2589 if (!(toStringTagSymbol in genFun)) { |
|
2590 genFun[toStringTagSymbol] = "GeneratorFunction"; |
|
2591 } |
|
2592 } |
|
2593 genFun.prototype = Object.create(Gp); |
|
2594 return genFun; |
|
2595 }; |
|
2596 |
|
2597 // Within the body of any async function, `await x` is transformed to |
|
2598 // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test |
|
2599 // `hasOwn.call(value, "__await")` to determine if the yielded value is |
|
2600 // meant to be awaited. |
|
2601 runtime.awrap = function(arg) { |
|
2602 return { __await: arg }; |
|
2603 }; |
|
2604 |
|
2605 function AsyncIterator(generator) { |
|
2606 function invoke(method, arg, resolve, reject) { |
|
2607 var record = tryCatch(generator[method], generator, arg); |
|
2608 if (record.type === "throw") { |
|
2609 reject(record.arg); |
|
2610 } else { |
|
2611 var result = record.arg; |
|
2612 var value = result.value; |
|
2613 if (value && |
|
2614 typeof value === "object" && |
|
2615 hasOwn.call(value, "__await")) { |
|
2616 return Promise.resolve(value.__await).then(function(value) { |
|
2617 invoke("next", value, resolve, reject); |
|
2618 }, function(err) { |
|
2619 invoke("throw", err, resolve, reject); |
|
2620 }); |
|
2621 } |
|
2622 |
|
2623 return Promise.resolve(value).then(function(unwrapped) { |
|
2624 // When a yielded Promise is resolved, its final value becomes |
|
2625 // the .value of the Promise<{value,done}> result for the |
|
2626 // current iteration. |
|
2627 result.value = unwrapped; |
|
2628 resolve(result); |
|
2629 }, function(error) { |
|
2630 // If a rejected Promise was yielded, throw the rejection back |
|
2631 // into the async generator function so it can be handled there. |
|
2632 return invoke("throw", error, resolve, reject); |
|
2633 }); |
|
2634 } |
|
2635 } |
|
2636 |
|
2637 var previousPromise; |
|
2638 |
|
2639 function enqueue(method, arg) { |
|
2640 function callInvokeWithMethodAndArg() { |
|
2641 return new Promise(function(resolve, reject) { |
|
2642 invoke(method, arg, resolve, reject); |
|
2643 }); |
|
2644 } |
|
2645 |
|
2646 return previousPromise = |
|
2647 // If enqueue has been called before, then we want to wait until |
|
2648 // all previous Promises have been resolved before calling invoke, |
|
2649 // so that results are always delivered in the correct order. If |
|
2650 // enqueue has not been called before, then it is important to |
|
2651 // call invoke immediately, without waiting on a callback to fire, |
|
2652 // so that the async generator function has the opportunity to do |
|
2653 // any necessary setup in a predictable way. This predictability |
|
2654 // is why the Promise constructor synchronously invokes its |
|
2655 // executor callback, and why async functions synchronously |
|
2656 // execute code before the first await. Since we implement simple |
|
2657 // async functions in terms of async generators, it is especially |
|
2658 // important to get this right, even though it requires care. |
|
2659 previousPromise ? previousPromise.then( |
|
2660 callInvokeWithMethodAndArg, |
|
2661 // Avoid propagating failures to Promises returned by later |
|
2662 // invocations of the iterator. |
|
2663 callInvokeWithMethodAndArg |
|
2664 ) : callInvokeWithMethodAndArg(); |
|
2665 } |
|
2666 |
|
2667 // Define the unified helper method that is used to implement .next, |
|
2668 // .throw, and .return (see defineIteratorMethods). |
|
2669 this._invoke = enqueue; |
|
2670 } |
|
2671 |
|
2672 defineIteratorMethods(AsyncIterator.prototype); |
|
2673 AsyncIterator.prototype[asyncIteratorSymbol] = function () { |
|
2674 return this; |
|
2675 }; |
|
2676 runtime.AsyncIterator = AsyncIterator; |
|
2677 |
|
2678 // Note that simple async functions are implemented on top of |
|
2679 // AsyncIterator objects; they just return a Promise for the value of |
|
2680 // the final result produced by the iterator. |
|
2681 runtime.async = function(innerFn, outerFn, self, tryLocsList) { |
|
2682 var iter = new AsyncIterator( |
|
2683 wrap(innerFn, outerFn, self, tryLocsList) |
|
2684 ); |
|
2685 |
|
2686 return runtime.isGeneratorFunction(outerFn) |
|
2687 ? iter // If outerFn is a generator, return the full iterator. |
|
2688 : iter.next().then(function(result) { |
|
2689 return result.done ? result.value : iter.next(); |
|
2690 }); |
|
2691 }; |
|
2692 |
|
2693 function makeInvokeMethod(innerFn, self, context) { |
|
2694 var state = GenStateSuspendedStart; |
|
2695 |
|
2696 return function invoke(method, arg) { |
|
2697 if (state === GenStateExecuting) { |
|
2698 throw new Error("Generator is already running"); |
|
2699 } |
|
2700 |
|
2701 if (state === GenStateCompleted) { |
|
2702 if (method === "throw") { |
|
2703 throw arg; |
|
2704 } |
|
2705 |
|
2706 // Be forgiving, per 25.3.3.3.3 of the spec: |
|
2707 // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume |
|
2708 return doneResult(); |
|
2709 } |
|
2710 |
|
2711 context.method = method; |
|
2712 context.arg = arg; |
|
2713 |
|
2714 while (true) { |
|
2715 var delegate = context.delegate; |
|
2716 if (delegate) { |
|
2717 var delegateResult = maybeInvokeDelegate(delegate, context); |
|
2718 if (delegateResult) { |
|
2719 if (delegateResult === ContinueSentinel) continue; |
|
2720 return delegateResult; |
|
2721 } |
|
2722 } |
|
2723 |
|
2724 if (context.method === "next") { |
|
2725 // Setting context._sent for legacy support of Babel's |
|
2726 // function.sent implementation. |
|
2727 context.sent = context._sent = context.arg; |
|
2728 |
|
2729 } else if (context.method === "throw") { |
|
2730 if (state === GenStateSuspendedStart) { |
|
2731 state = GenStateCompleted; |
|
2732 throw context.arg; |
|
2733 } |
|
2734 |
|
2735 context.dispatchException(context.arg); |
|
2736 |
|
2737 } else if (context.method === "return") { |
|
2738 context.abrupt("return", context.arg); |
|
2739 } |
|
2740 |
|
2741 state = GenStateExecuting; |
|
2742 |
|
2743 var record = tryCatch(innerFn, self, context); |
|
2744 if (record.type === "normal") { |
|
2745 // If an exception is thrown from innerFn, we leave state === |
|
2746 // GenStateExecuting and loop back for another invocation. |
|
2747 state = context.done |
|
2748 ? GenStateCompleted |
|
2749 : GenStateSuspendedYield; |
|
2750 |
|
2751 if (record.arg === ContinueSentinel) { |
|
2752 continue; |
|
2753 } |
|
2754 |
|
2755 return { |
|
2756 value: record.arg, |
|
2757 done: context.done |
|
2758 }; |
|
2759 |
|
2760 } else if (record.type === "throw") { |
|
2761 state = GenStateCompleted; |
|
2762 // Dispatch the exception by looping back around to the |
|
2763 // context.dispatchException(context.arg) call above. |
|
2764 context.method = "throw"; |
|
2765 context.arg = record.arg; |
|
2766 } |
|
2767 } |
|
2768 }; |
|
2769 } |
|
2770 |
|
2771 // Call delegate.iterator[context.method](context.arg) and handle the |
|
2772 // result, either by returning a { value, done } result from the |
|
2773 // delegate iterator, or by modifying context.method and context.arg, |
|
2774 // setting context.delegate to null, and returning the ContinueSentinel. |
|
2775 function maybeInvokeDelegate(delegate, context) { |
|
2776 var method = delegate.iterator[context.method]; |
|
2777 if (method === undefined) { |
|
2778 // A .throw or .return when the delegate iterator has no .throw |
|
2779 // method always terminates the yield* loop. |
|
2780 context.delegate = null; |
|
2781 |
|
2782 if (context.method === "throw") { |
|
2783 if (delegate.iterator.return) { |
|
2784 // If the delegate iterator has a return method, give it a |
|
2785 // chance to clean up. |
|
2786 context.method = "return"; |
|
2787 context.arg = undefined; |
|
2788 maybeInvokeDelegate(delegate, context); |
|
2789 |
|
2790 if (context.method === "throw") { |
|
2791 // If maybeInvokeDelegate(context) changed context.method from |
|
2792 // "return" to "throw", let that override the TypeError below. |
|
2793 return ContinueSentinel; |
|
2794 } |
|
2795 } |
|
2796 |
|
2797 context.method = "throw"; |
|
2798 context.arg = new TypeError( |
|
2799 "The iterator does not provide a 'throw' method"); |
|
2800 } |
|
2801 |
|
2802 return ContinueSentinel; |
|
2803 } |
|
2804 |
|
2805 var record = tryCatch(method, delegate.iterator, context.arg); |
|
2806 |
|
2807 if (record.type === "throw") { |
|
2808 context.method = "throw"; |
|
2809 context.arg = record.arg; |
|
2810 context.delegate = null; |
|
2811 return ContinueSentinel; |
|
2812 } |
|
2813 |
|
2814 var info = record.arg; |
|
2815 |
|
2816 if (! info) { |
|
2817 context.method = "throw"; |
|
2818 context.arg = new TypeError("iterator result is not an object"); |
|
2819 context.delegate = null; |
|
2820 return ContinueSentinel; |
|
2821 } |
|
2822 |
|
2823 if (info.done) { |
|
2824 // Assign the result of the finished delegate to the temporary |
|
2825 // variable specified by delegate.resultName (see delegateYield). |
|
2826 context[delegate.resultName] = info.value; |
|
2827 |
|
2828 // Resume execution at the desired location (see delegateYield). |
|
2829 context.next = delegate.nextLoc; |
|
2830 |
|
2831 // If context.method was "throw" but the delegate handled the |
|
2832 // exception, let the outer generator proceed normally. If |
|
2833 // context.method was "next", forget context.arg since it has been |
|
2834 // "consumed" by the delegate iterator. If context.method was |
|
2835 // "return", allow the original .return call to continue in the |
|
2836 // outer generator. |
|
2837 if (context.method !== "return") { |
|
2838 context.method = "next"; |
|
2839 context.arg = undefined; |
|
2840 } |
|
2841 |
|
2842 } else { |
|
2843 // Re-yield the result returned by the delegate method. |
|
2844 return info; |
|
2845 } |
|
2846 |
|
2847 // The delegate iterator is finished, so forget it and continue with |
|
2848 // the outer generator. |
|
2849 context.delegate = null; |
|
2850 return ContinueSentinel; |
|
2851 } |
|
2852 |
|
2853 // Define Generator.prototype.{next,throw,return} in terms of the |
|
2854 // unified ._invoke helper method. |
|
2855 defineIteratorMethods(Gp); |
|
2856 |
|
2857 Gp[toStringTagSymbol] = "Generator"; |
|
2858 |
|
2859 // A Generator should always return itself as the iterator object when the |
|
2860 // @@iterator function is called on it. Some browsers' implementations of the |
|
2861 // iterator prototype chain incorrectly implement this, causing the Generator |
|
2862 // object to not be returned from this call. This ensures that doesn't happen. |
|
2863 // See https://github.com/facebook/regenerator/issues/274 for more details. |
|
2864 Gp[iteratorSymbol] = function() { |
|
2865 return this; |
|
2866 }; |
|
2867 |
|
2868 Gp.toString = function() { |
|
2869 return "[object Generator]"; |
|
2870 }; |
|
2871 |
|
2872 function pushTryEntry(locs) { |
|
2873 var entry = { tryLoc: locs[0] }; |
|
2874 |
|
2875 if (1 in locs) { |
|
2876 entry.catchLoc = locs[1]; |
|
2877 } |
|
2878 |
|
2879 if (2 in locs) { |
|
2880 entry.finallyLoc = locs[2]; |
|
2881 entry.afterLoc = locs[3]; |
|
2882 } |
|
2883 |
|
2884 this.tryEntries.push(entry); |
|
2885 } |
|
2886 |
|
2887 function resetTryEntry(entry) { |
|
2888 var record = entry.completion || {}; |
|
2889 record.type = "normal"; |
|
2890 delete record.arg; |
|
2891 entry.completion = record; |
|
2892 } |
|
2893 |
|
2894 function Context(tryLocsList) { |
|
2895 // The root entry object (effectively a try statement without a catch |
|
2896 // or a finally block) gives us a place to store values thrown from |
|
2897 // locations where there is no enclosing try statement. |
|
2898 this.tryEntries = [{ tryLoc: "root" }]; |
|
2899 tryLocsList.forEach(pushTryEntry, this); |
|
2900 this.reset(true); |
|
2901 } |
|
2902 |
|
2903 runtime.keys = function(object) { |
|
2904 var keys = []; |
|
2905 for (var key in object) { |
|
2906 keys.push(key); |
|
2907 } |
|
2908 keys.reverse(); |
|
2909 |
|
2910 // Rather than returning an object with a next method, we keep |
|
2911 // things simple and return the next function itself. |
|
2912 return function next() { |
|
2913 while (keys.length) { |
|
2914 var key = keys.pop(); |
|
2915 if (key in object) { |
|
2916 next.value = key; |
|
2917 next.done = false; |
|
2918 return next; |
|
2919 } |
|
2920 } |
|
2921 |
|
2922 // To avoid creating an additional object, we just hang the .value |
|
2923 // and .done properties off the next function object itself. This |
|
2924 // also ensures that the minifier will not anonymize the function. |
|
2925 next.done = true; |
|
2926 return next; |
|
2927 }; |
|
2928 }; |
|
2929 |
|
2930 function values(iterable) { |
|
2931 if (iterable) { |
|
2932 var iteratorMethod = iterable[iteratorSymbol]; |
|
2933 if (iteratorMethod) { |
|
2934 return iteratorMethod.call(iterable); |
|
2935 } |
|
2936 |
|
2937 if (typeof iterable.next === "function") { |
|
2938 return iterable; |
|
2939 } |
|
2940 |
|
2941 if (!isNaN(iterable.length)) { |
|
2942 var i = -1, next = function next() { |
|
2943 while (++i < iterable.length) { |
|
2944 if (hasOwn.call(iterable, i)) { |
|
2945 next.value = iterable[i]; |
|
2946 next.done = false; |
|
2947 return next; |
|
2948 } |
|
2949 } |
|
2950 |
|
2951 next.value = undefined; |
|
2952 next.done = true; |
|
2953 |
|
2954 return next; |
|
2955 }; |
|
2956 |
|
2957 return next.next = next; |
|
2958 } |
|
2959 } |
|
2960 |
|
2961 // Return an iterator with no values. |
|
2962 return { next: doneResult }; |
|
2963 } |
|
2964 runtime.values = values; |
|
2965 |
|
2966 function doneResult() { |
|
2967 return { value: undefined, done: true }; |
|
2968 } |
|
2969 |
|
2970 Context.prototype = { |
|
2971 constructor: Context, |
|
2972 |
|
2973 reset: function(skipTempReset) { |
|
2974 this.prev = 0; |
|
2975 this.next = 0; |
|
2976 // Resetting context._sent for legacy support of Babel's |
|
2977 // function.sent implementation. |
|
2978 this.sent = this._sent = undefined; |
|
2979 this.done = false; |
|
2980 this.delegate = null; |
|
2981 |
|
2982 this.method = "next"; |
|
2983 this.arg = undefined; |
|
2984 |
|
2985 this.tryEntries.forEach(resetTryEntry); |
|
2986 |
|
2987 if (!skipTempReset) { |
|
2988 for (var name in this) { |
|
2989 // Not sure about the optimal order of these conditions: |
|
2990 if (name.charAt(0) === "t" && |
|
2991 hasOwn.call(this, name) && |
|
2992 !isNaN(+name.slice(1))) { |
|
2993 this[name] = undefined; |
|
2994 } |
|
2995 } |
|
2996 } |
|
2997 }, |
|
2998 |
|
2999 stop: function() { |
|
3000 this.done = true; |
|
3001 |
|
3002 var rootEntry = this.tryEntries[0]; |
|
3003 var rootRecord = rootEntry.completion; |
|
3004 if (rootRecord.type === "throw") { |
|
3005 throw rootRecord.arg; |
|
3006 } |
|
3007 |
|
3008 return this.rval; |
|
3009 }, |
|
3010 |
|
3011 dispatchException: function(exception) { |
|
3012 if (this.done) { |
|
3013 throw exception; |
|
3014 } |
|
3015 |
|
3016 var context = this; |
|
3017 function handle(loc, caught) { |
|
3018 record.type = "throw"; |
|
3019 record.arg = exception; |
|
3020 context.next = loc; |
|
3021 |
|
3022 if (caught) { |
|
3023 // If the dispatched exception was caught by a catch block, |
|
3024 // then let that catch block handle the exception normally. |
|
3025 context.method = "next"; |
|
3026 context.arg = undefined; |
|
3027 } |
|
3028 |
|
3029 return !! caught; |
|
3030 } |
|
3031 |
|
3032 for (var i = this.tryEntries.length - 1; i >= 0; --i) { |
|
3033 var entry = this.tryEntries[i]; |
|
3034 var record = entry.completion; |
|
3035 |
|
3036 if (entry.tryLoc === "root") { |
|
3037 // Exception thrown outside of any try block that could handle |
|
3038 // it, so set the completion value of the entire function to |
|
3039 // throw the exception. |
|
3040 return handle("end"); |
|
3041 } |
|
3042 |
|
3043 if (entry.tryLoc <= this.prev) { |
|
3044 var hasCatch = hasOwn.call(entry, "catchLoc"); |
|
3045 var hasFinally = hasOwn.call(entry, "finallyLoc"); |
|
3046 |
|
3047 if (hasCatch && hasFinally) { |
|
3048 if (this.prev < entry.catchLoc) { |
|
3049 return handle(entry.catchLoc, true); |
|
3050 } else if (this.prev < entry.finallyLoc) { |
|
3051 return handle(entry.finallyLoc); |
|
3052 } |
|
3053 |
|
3054 } else if (hasCatch) { |
|
3055 if (this.prev < entry.catchLoc) { |
|
3056 return handle(entry.catchLoc, true); |
|
3057 } |
|
3058 |
|
3059 } else if (hasFinally) { |
|
3060 if (this.prev < entry.finallyLoc) { |
|
3061 return handle(entry.finallyLoc); |
|
3062 } |
|
3063 |
|
3064 } else { |
|
3065 throw new Error("try statement without catch or finally"); |
|
3066 } |
|
3067 } |
|
3068 } |
|
3069 }, |
|
3070 |
|
3071 abrupt: function(type, arg) { |
|
3072 for (var i = this.tryEntries.length - 1; i >= 0; --i) { |
|
3073 var entry = this.tryEntries[i]; |
|
3074 if (entry.tryLoc <= this.prev && |
|
3075 hasOwn.call(entry, "finallyLoc") && |
|
3076 this.prev < entry.finallyLoc) { |
|
3077 var finallyEntry = entry; |
|
3078 break; |
|
3079 } |
|
3080 } |
|
3081 |
|
3082 if (finallyEntry && |
|
3083 (type === "break" || |
|
3084 type === "continue") && |
|
3085 finallyEntry.tryLoc <= arg && |
|
3086 arg <= finallyEntry.finallyLoc) { |
|
3087 // Ignore the finally entry if control is not jumping to a |
|
3088 // location outside the try/catch block. |
|
3089 finallyEntry = null; |
|
3090 } |
|
3091 |
|
3092 var record = finallyEntry ? finallyEntry.completion : {}; |
|
3093 record.type = type; |
|
3094 record.arg = arg; |
|
3095 |
|
3096 if (finallyEntry) { |
|
3097 this.method = "next"; |
|
3098 this.next = finallyEntry.finallyLoc; |
|
3099 return ContinueSentinel; |
|
3100 } |
|
3101 |
|
3102 return this.complete(record); |
|
3103 }, |
|
3104 |
|
3105 complete: function(record, afterLoc) { |
|
3106 if (record.type === "throw") { |
|
3107 throw record.arg; |
|
3108 } |
|
3109 |
|
3110 if (record.type === "break" || |
|
3111 record.type === "continue") { |
|
3112 this.next = record.arg; |
|
3113 } else if (record.type === "return") { |
|
3114 this.rval = this.arg = record.arg; |
|
3115 this.method = "return"; |
|
3116 this.next = "end"; |
|
3117 } else if (record.type === "normal" && afterLoc) { |
|
3118 this.next = afterLoc; |
|
3119 } |
|
3120 |
|
3121 return ContinueSentinel; |
|
3122 }, |
|
3123 |
|
3124 finish: function(finallyLoc) { |
|
3125 for (var i = this.tryEntries.length - 1; i >= 0; --i) { |
|
3126 var entry = this.tryEntries[i]; |
|
3127 if (entry.finallyLoc === finallyLoc) { |
|
3128 this.complete(entry.completion, entry.afterLoc); |
|
3129 resetTryEntry(entry); |
|
3130 return ContinueSentinel; |
|
3131 } |
|
3132 } |
|
3133 }, |
|
3134 |
|
3135 "catch": function(tryLoc) { |
|
3136 for (var i = this.tryEntries.length - 1; i >= 0; --i) { |
|
3137 var entry = this.tryEntries[i]; |
|
3138 if (entry.tryLoc === tryLoc) { |
|
3139 var record = entry.completion; |
|
3140 if (record.type === "throw") { |
|
3141 var thrown = record.arg; |
|
3142 resetTryEntry(entry); |
|
3143 } |
|
3144 return thrown; |
|
3145 } |
|
3146 } |
|
3147 |
|
3148 // The context.catch method must only be called with a location |
|
3149 // argument that corresponds to a known catch block. |
|
3150 throw new Error("illegal catch attempt"); |
|
3151 }, |
|
3152 |
|
3153 delegateYield: function(iterable, resultName, nextLoc) { |
|
3154 this.delegate = { |
|
3155 iterator: values(iterable), |
|
3156 resultName: resultName, |
|
3157 nextLoc: nextLoc |
|
3158 }; |
|
3159 |
|
3160 if (this.method === "next") { |
|
3161 // Deliberately forget the last sent value so that we don't |
|
3162 // accidentally pass it on to the delegate. |
|
3163 this.arg = undefined; |
|
3164 } |
|
3165 |
|
3166 return ContinueSentinel; |
|
3167 } |
|
3168 }; |
|
3169 })( |
|
3170 // In sloppy mode, unbound `this` refers to the global object, fallback to |
|
3171 // Function constructor if we're in global strict mode. That is sadly a form |
|
3172 // of indirect eval which violates Content Security Policy. |
|
3173 (function() { |
|
3174 return this || (typeof self === "object" && self); |
|
3175 })() || Function("return this")() |
|
3176 ); |
|
3177 |
|
3178 |
|
3179 /***/ }), |
|
3180 |
|
3181 /***/ 59: |
|
3182 /***/ (function(module, exports) { |
|
3183 |
|
3184 var g; |
|
3185 |
|
3186 // This works in non-strict mode |
|
3187 g = (function() { |
|
3188 return this; |
|
3189 })(); |
|
3190 |
|
3191 try { |
|
3192 // This works if eval is allowed (see CSP) |
|
3193 g = g || new Function("return this")(); |
|
3194 } catch (e) { |
|
3195 // This works if the window reference is available |
|
3196 if (typeof window === "object") g = window; |
|
3197 } |
|
3198 |
|
3199 // g can still be undefined, but nothing to do about it... |
|
3200 // We return undefined, instead of nothing here, so it's |
|
3201 // easier to handle this case. if(!global) { ...} |
|
3202 |
|
3203 module.exports = g; |
|
3204 |
|
3205 |
|
3206 /***/ }), |
|
3207 |
|
3208 /***/ 6: |
|
3209 /***/ (function(module, exports) { |
|
3210 |
|
3211 (function() { module.exports = this["wp"]["compose"]; }()); |
|
3212 |
|
3213 /***/ }), |
|
3214 |
|
3215 /***/ 7: |
|
3216 /***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
3217 |
|
3218 "use strict"; |
|
3219 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _objectSpread; }); |
|
3220 /* harmony import */ var _defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(15); |
|
3221 |
|
3222 function _objectSpread(target) { |
|
3223 for (var i = 1; i < arguments.length; i++) { |
|
3224 var source = arguments[i] != null ? arguments[i] : {}; |
|
3225 var ownKeys = Object.keys(source); |
|
3226 |
|
3227 if (typeof Object.getOwnPropertySymbols === 'function') { |
|
3228 ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { |
|
3229 return Object.getOwnPropertyDescriptor(source, sym).enumerable; |
|
3230 })); |
|
3231 } |
|
3232 |
|
3233 ownKeys.forEach(function (key) { |
|
3234 Object(_defineProperty__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])(target, key, source[key]); |
|
3235 }); |
|
3236 } |
|
3237 |
|
3238 return target; |
|
3239 } |
|
3240 |
|
3241 /***/ }), |
|
3242 |
|
3243 /***/ 71: |
|
3244 /***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
3245 |
|
3246 "use strict"; |
|
3247 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return createStore; }); |
|
3248 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return combineReducers; }); |
|
3249 /* unused harmony export bindActionCreators */ |
|
3250 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return applyMiddleware; }); |
|
3251 /* unused harmony export compose */ |
|
3252 /* unused harmony export __DO_NOT_USE__ActionTypes */ |
|
3253 /* harmony import */ var symbol_observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(77); |
|
3254 |
880 |
3255 |
881 |
3256 /** |
882 /** |
3257 * These are private action types reserved by Redux. |
883 * These are private action types reserved by Redux. |
3258 * For any unknown actions, you must return the current state. |
884 * For any unknown actions, you must return the current state. |
3872 |
1525 |
3873 if (false) {} |
1526 if (false) {} |
3874 |
1527 |
3875 |
1528 |
3876 |
1529 |
|
1530 // EXTERNAL MODULE: external {"this":["wp","reduxRoutine"]} |
|
1531 var external_this_wp_reduxRoutine_ = __webpack_require__(274); |
|
1532 var external_this_wp_reduxRoutine_default = /*#__PURE__*/__webpack_require__.n(external_this_wp_reduxRoutine_); |
|
1533 |
|
1534 // EXTERNAL MODULE: ./node_modules/is-promise/index.js |
|
1535 var is_promise = __webpack_require__(151); |
|
1536 var is_promise_default = /*#__PURE__*/__webpack_require__.n(is_promise); |
|
1537 |
|
1538 // CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/promise-middleware.js |
|
1539 /** |
|
1540 * External dependencies |
|
1541 */ |
|
1542 |
|
1543 /** |
|
1544 * Simplest possible promise redux middleware. |
|
1545 * |
|
1546 * @return {Function} middleware. |
|
1547 */ |
|
1548 |
|
1549 var promise_middleware_promiseMiddleware = function promiseMiddleware() { |
|
1550 return function (next) { |
|
1551 return function (action) { |
|
1552 if (is_promise_default()(action)) { |
|
1553 return action.then(function (resolvedAction) { |
|
1554 if (resolvedAction) { |
|
1555 return next(resolvedAction); |
|
1556 } |
|
1557 }); |
|
1558 } |
|
1559 |
|
1560 return next(action); |
|
1561 }; |
|
1562 }; |
|
1563 }; |
|
1564 |
|
1565 /* harmony default export */ var promise_middleware = (promise_middleware_promiseMiddleware); |
|
1566 |
|
1567 // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js + 2 modules |
|
1568 var toConsumableArray = __webpack_require__(18); |
|
1569 |
|
1570 // CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/resolvers-cache-middleware.js |
|
1571 |
|
1572 |
|
1573 |
|
1574 /** |
|
1575 * External dependencies |
|
1576 */ |
|
1577 |
|
1578 /** @typedef {import('./registry').WPDataRegistry} WPDataRegistry */ |
|
1579 |
|
1580 /** |
|
1581 * Creates a middleware handling resolvers cache invalidation. |
|
1582 * |
|
1583 * @param {WPDataRegistry} registry The registry reference for which to create |
|
1584 * the middleware. |
|
1585 * @param {string} reducerKey The namespace for which to create the |
|
1586 * middleware. |
|
1587 * |
|
1588 * @return {Function} Middleware function. |
|
1589 */ |
|
1590 |
|
1591 var resolvers_cache_middleware_createResolversCacheMiddleware = function createResolversCacheMiddleware(registry, reducerKey) { |
|
1592 return function () { |
|
1593 return function (next) { |
|
1594 return function (action) { |
|
1595 var resolvers = registry.select('core/data').getCachedResolvers(reducerKey); |
|
1596 Object.entries(resolvers).forEach(function (_ref) { |
|
1597 var _ref2 = Object(slicedToArray["a" /* default */])(_ref, 2), |
|
1598 selectorName = _ref2[0], |
|
1599 resolversByArgs = _ref2[1]; |
|
1600 |
|
1601 var resolver = Object(external_this_lodash_["get"])(registry.stores, [reducerKey, 'resolvers', selectorName]); |
|
1602 |
|
1603 if (!resolver || !resolver.shouldInvalidate) { |
|
1604 return; |
|
1605 } |
|
1606 |
|
1607 resolversByArgs.forEach(function (value, args) { |
|
1608 // resolversByArgs is the map Map([ args ] => boolean) storing the cache resolution status for a given selector. |
|
1609 // If the value is false it means this resolver has finished its resolution which means we need to invalidate it, |
|
1610 // if it's true it means it's inflight and the invalidation is not necessary. |
|
1611 if (value !== false || !resolver.shouldInvalidate.apply(resolver, [action].concat(Object(toConsumableArray["a" /* default */])(args)))) { |
|
1612 return; |
|
1613 } // Trigger cache invalidation |
|
1614 |
|
1615 |
|
1616 registry.dispatch('core/data').invalidateResolution(reducerKey, selectorName, args); |
|
1617 }); |
|
1618 }); |
|
1619 return next(action); |
|
1620 }; |
|
1621 }; |
|
1622 }; |
|
1623 }; |
|
1624 |
|
1625 /* harmony default export */ var resolvers_cache_middleware = (resolvers_cache_middleware_createResolversCacheMiddleware); |
|
1626 |
|
1627 // EXTERNAL MODULE: ./node_modules/equivalent-key-map/equivalent-key-map.js |
|
1628 var equivalent_key_map = __webpack_require__(126); |
|
1629 var equivalent_key_map_default = /*#__PURE__*/__webpack_require__.n(equivalent_key_map); |
|
1630 |
|
1631 // CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/namespace-store/metadata/utils.js |
|
1632 |
|
1633 |
|
1634 function utils_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; } |
|
1635 |
|
1636 function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { utils_ownKeys(Object(source), true).forEach(function (key) { Object(defineProperty["a" /* default */])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { utils_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } |
|
1637 |
|
1638 /** |
|
1639 * Higher-order reducer creator which creates a combined reducer object, keyed |
|
1640 * by a property on the action object. |
|
1641 * |
|
1642 * @param {string} actionProperty Action property by which to key object. |
|
1643 * |
|
1644 * @return {Function} Higher-order reducer. |
|
1645 */ |
|
1646 var utils_onSubKey = function onSubKey(actionProperty) { |
|
1647 return function (reducer) { |
|
1648 return function () { |
|
1649 var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; |
|
1650 var action = arguments.length > 1 ? arguments[1] : undefined; |
|
1651 // Retrieve subkey from action. Do not track if undefined; useful for cases |
|
1652 // where reducer is scoped by action shape. |
|
1653 var key = action[actionProperty]; |
|
1654 |
|
1655 if (key === undefined) { |
|
1656 return state; |
|
1657 } // Avoid updating state if unchanged. Note that this also accounts for a |
|
1658 // reducer which returns undefined on a key which is not yet tracked. |
|
1659 |
|
1660 |
|
1661 var nextKeyState = reducer(state[key], action); |
|
1662 |
|
1663 if (nextKeyState === state[key]) { |
|
1664 return state; |
|
1665 } |
|
1666 |
|
1667 return _objectSpread({}, state, Object(defineProperty["a" /* default */])({}, key, nextKeyState)); |
|
1668 }; |
|
1669 }; |
|
1670 }; |
|
1671 |
|
1672 // CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/namespace-store/metadata/reducer.js |
|
1673 /** |
|
1674 * External dependencies |
|
1675 */ |
|
1676 |
|
1677 |
|
1678 /** |
|
1679 * Internal dependencies |
|
1680 */ |
|
1681 |
|
1682 |
|
1683 /** |
|
1684 * Reducer function returning next state for selector resolution of |
|
1685 * subkeys, object form: |
|
1686 * |
|
1687 * selectorName -> EquivalentKeyMap<Array,boolean> |
|
1688 * |
|
1689 * @param {Object} state Current state. |
|
1690 * @param {Object} action Dispatched action. |
|
1691 * |
|
1692 * @return {Object} Next state. |
|
1693 */ |
|
1694 |
|
1695 var subKeysIsResolved = Object(external_this_lodash_["flowRight"])([utils_onSubKey('selectorName')])(function () { |
|
1696 var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : new equivalent_key_map_default.a(); |
|
1697 var action = arguments.length > 1 ? arguments[1] : undefined; |
|
1698 |
|
1699 switch (action.type) { |
|
1700 case 'START_RESOLUTION': |
|
1701 case 'FINISH_RESOLUTION': |
|
1702 { |
|
1703 var isStarting = action.type === 'START_RESOLUTION'; |
|
1704 var nextState = new equivalent_key_map_default.a(state); |
|
1705 nextState.set(action.args, isStarting); |
|
1706 return nextState; |
|
1707 } |
|
1708 |
|
1709 case 'INVALIDATE_RESOLUTION': |
|
1710 { |
|
1711 var _nextState = new equivalent_key_map_default.a(state); |
|
1712 |
|
1713 _nextState.delete(action.args); |
|
1714 |
|
1715 return _nextState; |
|
1716 } |
|
1717 } |
|
1718 |
|
1719 return state; |
|
1720 }); |
|
1721 /** |
|
1722 * Reducer function returning next state for selector resolution, object form: |
|
1723 * |
|
1724 * selectorName -> EquivalentKeyMap<Array, boolean> |
|
1725 * |
|
1726 * @param {Object} state Current state. |
|
1727 * @param {Object} action Dispatched action. |
|
1728 * |
|
1729 * @return {Object} Next state. |
|
1730 */ |
|
1731 |
|
1732 var reducer_isResolved = function isResolved() { |
|
1733 var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; |
|
1734 var action = arguments.length > 1 ? arguments[1] : undefined; |
|
1735 |
|
1736 switch (action.type) { |
|
1737 case 'INVALIDATE_RESOLUTION_FOR_STORE': |
|
1738 return {}; |
|
1739 |
|
1740 case 'INVALIDATE_RESOLUTION_FOR_STORE_SELECTOR': |
|
1741 return Object(external_this_lodash_["has"])(state, [action.selectorName]) ? Object(external_this_lodash_["omit"])(state, [action.selectorName]) : state; |
|
1742 |
|
1743 case 'START_RESOLUTION': |
|
1744 case 'FINISH_RESOLUTION': |
|
1745 case 'INVALIDATE_RESOLUTION': |
|
1746 return subKeysIsResolved(state, action); |
|
1747 } |
|
1748 |
|
1749 return state; |
|
1750 }; |
|
1751 |
|
1752 /* harmony default export */ var metadata_reducer = (reducer_isResolved); |
|
1753 |
|
1754 // CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/namespace-store/metadata/selectors.js |
|
1755 /** |
|
1756 * External dependencies |
|
1757 */ |
|
1758 |
|
1759 /** |
|
1760 * Returns the raw `isResolving` value for a given selector name, |
|
1761 * and arguments set. May be undefined if the selector has never been resolved |
|
1762 * or not resolved for the given set of arguments, otherwise true or false for |
|
1763 * resolution started and completed respectively. |
|
1764 * |
|
1765 * @param {Object} state Data state. |
|
1766 * @param {string} selectorName Selector name. |
|
1767 * @param {Array} args Arguments passed to selector. |
|
1768 * |
|
1769 * @return {?boolean} isResolving value. |
|
1770 */ |
|
1771 |
|
1772 function getIsResolving(state, selectorName, args) { |
|
1773 var map = Object(external_this_lodash_["get"])(state, [selectorName]); |
|
1774 |
|
1775 if (!map) { |
|
1776 return; |
|
1777 } |
|
1778 |
|
1779 return map.get(args); |
|
1780 } |
|
1781 /** |
|
1782 * Returns true if resolution has already been triggered for a given |
|
1783 * selector name, and arguments set. |
|
1784 * |
|
1785 * @param {Object} state Data state. |
|
1786 * @param {string} selectorName Selector name. |
|
1787 * @param {?Array} args Arguments passed to selector (default `[]`). |
|
1788 * |
|
1789 * @return {boolean} Whether resolution has been triggered. |
|
1790 */ |
|
1791 |
|
1792 function hasStartedResolution(state, selectorName) { |
|
1793 var args = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : []; |
|
1794 return getIsResolving(state, selectorName, args) !== undefined; |
|
1795 } |
|
1796 /** |
|
1797 * Returns true if resolution has completed for a given selector |
|
1798 * name, and arguments set. |
|
1799 * |
|
1800 * @param {Object} state Data state. |
|
1801 * @param {string} selectorName Selector name. |
|
1802 * @param {?Array} args Arguments passed to selector. |
|
1803 * |
|
1804 * @return {boolean} Whether resolution has completed. |
|
1805 */ |
|
1806 |
|
1807 function hasFinishedResolution(state, selectorName) { |
|
1808 var args = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : []; |
|
1809 return getIsResolving(state, selectorName, args) === false; |
|
1810 } |
|
1811 /** |
|
1812 * Returns true if resolution has been triggered but has not yet completed for |
|
1813 * a given selector name, and arguments set. |
|
1814 * |
|
1815 * @param {Object} state Data state. |
|
1816 * @param {string} selectorName Selector name. |
|
1817 * @param {?Array} args Arguments passed to selector. |
|
1818 * |
|
1819 * @return {boolean} Whether resolution is in progress. |
|
1820 */ |
|
1821 |
|
1822 function isResolving(state, selectorName) { |
|
1823 var args = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : []; |
|
1824 return getIsResolving(state, selectorName, args) === true; |
|
1825 } |
|
1826 /** |
|
1827 * Returns the list of the cached resolvers. |
|
1828 * |
|
1829 * @param {Object} state Data state. |
|
1830 * |
|
1831 * @return {Object} Resolvers mapped by args and selectorName. |
|
1832 */ |
|
1833 |
|
1834 function getCachedResolvers(state) { |
|
1835 return state; |
|
1836 } |
|
1837 |
|
1838 // CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/namespace-store/metadata/actions.js |
|
1839 /** |
|
1840 * Returns an action object used in signalling that selector resolution has |
|
1841 * started. |
|
1842 * |
|
1843 * @param {string} selectorName Name of selector for which resolver triggered. |
|
1844 * @param {...*} args Arguments to associate for uniqueness. |
|
1845 * |
|
1846 * @return {Object} Action object. |
|
1847 */ |
|
1848 function startResolution(selectorName, args) { |
|
1849 return { |
|
1850 type: 'START_RESOLUTION', |
|
1851 selectorName: selectorName, |
|
1852 args: args |
|
1853 }; |
|
1854 } |
|
1855 /** |
|
1856 * Returns an action object used in signalling that selector resolution has |
|
1857 * completed. |
|
1858 * |
|
1859 * @param {string} selectorName Name of selector for which resolver triggered. |
|
1860 * @param {...*} args Arguments to associate for uniqueness. |
|
1861 * |
|
1862 * @return {Object} Action object. |
|
1863 */ |
|
1864 |
|
1865 function finishResolution(selectorName, args) { |
|
1866 return { |
|
1867 type: 'FINISH_RESOLUTION', |
|
1868 selectorName: selectorName, |
|
1869 args: args |
|
1870 }; |
|
1871 } |
|
1872 /** |
|
1873 * Returns an action object used in signalling that we should invalidate the resolution cache. |
|
1874 * |
|
1875 * @param {string} selectorName Name of selector for which resolver should be invalidated. |
|
1876 * @param {Array} args Arguments to associate for uniqueness. |
|
1877 * |
|
1878 * @return {Object} Action object. |
|
1879 */ |
|
1880 |
|
1881 function invalidateResolution(selectorName, args) { |
|
1882 return { |
|
1883 type: 'INVALIDATE_RESOLUTION', |
|
1884 selectorName: selectorName, |
|
1885 args: args |
|
1886 }; |
|
1887 } |
|
1888 /** |
|
1889 * Returns an action object used in signalling that the resolution |
|
1890 * should be invalidated. |
|
1891 * |
|
1892 * @return {Object} Action object. |
|
1893 */ |
|
1894 |
|
1895 function invalidateResolutionForStore() { |
|
1896 return { |
|
1897 type: 'INVALIDATE_RESOLUTION_FOR_STORE' |
|
1898 }; |
|
1899 } |
|
1900 /** |
|
1901 * Returns an action object used in signalling that the resolution cache for a |
|
1902 * given selectorName should be invalidated. |
|
1903 * |
|
1904 * @param {string} selectorName Name of selector for which all resolvers should |
|
1905 * be invalidated. |
|
1906 * |
|
1907 * @return {Object} Action object. |
|
1908 */ |
|
1909 |
|
1910 function invalidateResolutionForStoreSelector(selectorName) { |
|
1911 return { |
|
1912 type: 'INVALIDATE_RESOLUTION_FOR_STORE_SELECTOR', |
|
1913 selectorName: selectorName |
|
1914 }; |
|
1915 } |
|
1916 |
|
1917 // CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/namespace-store/index.js |
|
1918 |
|
1919 |
|
1920 |
|
1921 |
|
1922 function namespace_store_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; } |
|
1923 |
|
1924 function namespace_store_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { namespace_store_ownKeys(Object(source), true).forEach(function (key) { Object(defineProperty["a" /* default */])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { namespace_store_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } |
|
1925 |
|
1926 /** |
|
1927 * External dependencies |
|
1928 */ |
|
1929 |
|
1930 |
|
1931 |
|
1932 /** |
|
1933 * WordPress dependencies |
|
1934 */ |
|
1935 |
|
1936 |
|
1937 /** |
|
1938 * Internal dependencies |
|
1939 */ |
|
1940 |
|
1941 |
|
1942 |
|
1943 |
|
1944 |
|
1945 |
|
1946 /** |
|
1947 * @typedef {WPDataRegistry} WPDataRegistry |
|
1948 */ |
|
1949 |
|
1950 /** |
|
1951 * Creates a namespace object with a store derived from the reducer given. |
|
1952 * |
|
1953 * @param {string} key Unique namespace identifier. |
|
1954 * @param {Object} options Registered store options, with properties |
|
1955 * describing reducer, actions, selectors, and |
|
1956 * resolvers. |
|
1957 * @param {WPDataRegistry} registry Registry reference. |
|
1958 * |
|
1959 * @return {Object} Store Object. |
|
1960 */ |
|
1961 |
|
1962 function createNamespace(key, options, registry) { |
|
1963 var reducer = options.reducer; |
|
1964 var store = createReduxStore(key, options, registry); |
|
1965 var resolvers; |
|
1966 var actions = mapActions(namespace_store_objectSpread({}, actions_namespaceObject, {}, options.actions), store); |
|
1967 var selectors = mapSelectors(namespace_store_objectSpread({}, Object(external_this_lodash_["mapValues"])(selectors_namespaceObject, function (selector) { |
|
1968 return function (state) { |
|
1969 for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { |
|
1970 args[_key - 1] = arguments[_key]; |
|
1971 } |
|
1972 |
|
1973 return selector.apply(void 0, [state.metadata].concat(args)); |
|
1974 }; |
|
1975 }), {}, Object(external_this_lodash_["mapValues"])(options.selectors, function (selector) { |
|
1976 if (selector.isRegistrySelector) { |
|
1977 selector.registry = registry; |
|
1978 } |
|
1979 |
|
1980 return function (state) { |
|
1981 for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) { |
|
1982 args[_key2 - 1] = arguments[_key2]; |
|
1983 } |
|
1984 |
|
1985 return selector.apply(void 0, [state.root].concat(args)); |
|
1986 }; |
|
1987 })), store); |
|
1988 |
|
1989 if (options.resolvers) { |
|
1990 var result = mapResolvers(options.resolvers, selectors, store); |
|
1991 resolvers = result.resolvers; |
|
1992 selectors = result.selectors; |
|
1993 } |
|
1994 |
|
1995 var getSelectors = function getSelectors() { |
|
1996 return selectors; |
|
1997 }; |
|
1998 |
|
1999 var getActions = function getActions() { |
|
2000 return actions; |
|
2001 }; // We have some modules monkey-patching the store object |
|
2002 // It's wrong to do so but until we refactor all of our effects to controls |
|
2003 // We need to keep the same "store" instance here. |
|
2004 |
|
2005 |
|
2006 store.__unstableOriginalGetState = store.getState; |
|
2007 |
|
2008 store.getState = function () { |
|
2009 return store.__unstableOriginalGetState().root; |
|
2010 }; // Customize subscribe behavior to call listeners only on effective change, |
|
2011 // not on every dispatch. |
|
2012 |
|
2013 |
|
2014 var subscribe = store && function (listener) { |
|
2015 var lastState = store.__unstableOriginalGetState(); |
|
2016 |
|
2017 store.subscribe(function () { |
|
2018 var state = store.__unstableOriginalGetState(); |
|
2019 |
|
2020 var hasChanged = state !== lastState; |
|
2021 lastState = state; |
|
2022 |
|
2023 if (hasChanged) { |
|
2024 listener(); |
|
2025 } |
|
2026 }); |
|
2027 }; // This can be simplified to just { subscribe, getSelectors, getActions } |
|
2028 // Once we remove the use function. |
|
2029 |
|
2030 |
|
2031 return { |
|
2032 reducer: reducer, |
|
2033 store: store, |
|
2034 actions: actions, |
|
2035 selectors: selectors, |
|
2036 resolvers: resolvers, |
|
2037 getSelectors: getSelectors, |
|
2038 getActions: getActions, |
|
2039 subscribe: subscribe |
|
2040 }; |
|
2041 } |
|
2042 /** |
|
2043 * Creates a redux store for a namespace. |
|
2044 * |
|
2045 * @param {string} key Unique namespace identifier. |
|
2046 * @param {Object} options Registered store options, with properties |
|
2047 * describing reducer, actions, selectors, and |
|
2048 * resolvers. |
|
2049 * @param {WPDataRegistry} registry Registry reference. |
|
2050 * |
|
2051 * @return {Object} Newly created redux store. |
|
2052 */ |
|
2053 |
|
2054 function createReduxStore(key, options, registry) { |
|
2055 var middlewares = [resolvers_cache_middleware(registry, key), promise_middleware]; |
|
2056 |
|
2057 if (options.controls) { |
|
2058 var normalizedControls = Object(external_this_lodash_["mapValues"])(options.controls, function (control) { |
|
2059 return control.isRegistryControl ? control(registry) : control; |
|
2060 }); |
|
2061 middlewares.push(external_this_wp_reduxRoutine_default()(normalizedControls)); |
|
2062 } |
|
2063 |
|
2064 var enhancers = [applyMiddleware.apply(void 0, middlewares)]; |
|
2065 |
|
2066 if (typeof window !== 'undefined' && window.__REDUX_DEVTOOLS_EXTENSION__) { |
|
2067 enhancers.push(window.__REDUX_DEVTOOLS_EXTENSION__({ |
|
2068 name: key, |
|
2069 instanceId: key |
|
2070 })); |
|
2071 } |
|
2072 |
|
2073 var reducer = options.reducer, |
|
2074 initialState = options.initialState; |
|
2075 var enhancedReducer = turbo_combine_reducers_default()({ |
|
2076 metadata: metadata_reducer, |
|
2077 root: reducer |
|
2078 }); |
|
2079 return createStore(enhancedReducer, { |
|
2080 root: initialState |
|
2081 }, Object(external_this_lodash_["flowRight"])(enhancers)); |
|
2082 } |
|
2083 /** |
|
2084 * Maps selectors to a store. |
|
2085 * |
|
2086 * @param {Object} selectors Selectors to register. Keys will be used as the |
|
2087 * public facing API. Selectors will get passed the |
|
2088 * state as first argument. |
|
2089 * @param {Object} store The store to which the selectors should be mapped. |
|
2090 * |
|
2091 * @return {Object} Selectors mapped to the provided store. |
|
2092 */ |
|
2093 |
|
2094 |
|
2095 function mapSelectors(selectors, store) { |
|
2096 var createStateSelector = function createStateSelector(registrySelector) { |
|
2097 var selector = function runSelector() { |
|
2098 // This function is an optimized implementation of: |
|
2099 // |
|
2100 // selector( store.getState(), ...arguments ) |
|
2101 // |
|
2102 // Where the above would incur an `Array#concat` in its application, |
|
2103 // the logic here instead efficiently constructs an arguments array via |
|
2104 // direct assignment. |
|
2105 var argsLength = arguments.length; |
|
2106 var args = new Array(argsLength + 1); |
|
2107 args[0] = store.__unstableOriginalGetState(); |
|
2108 |
|
2109 for (var i = 0; i < argsLength; i++) { |
|
2110 args[i + 1] = arguments[i]; |
|
2111 } |
|
2112 |
|
2113 return registrySelector.apply(void 0, args); |
|
2114 }; |
|
2115 |
|
2116 selector.hasResolver = false; |
|
2117 return selector; |
|
2118 }; |
|
2119 |
|
2120 return Object(external_this_lodash_["mapValues"])(selectors, createStateSelector); |
|
2121 } |
|
2122 /** |
|
2123 * Maps actions to dispatch from a given store. |
|
2124 * |
|
2125 * @param {Object} actions Actions to register. |
|
2126 * @param {Object} store The redux store to which the actions should be mapped. |
|
2127 * @return {Object} Actions mapped to the redux store provided. |
|
2128 */ |
|
2129 |
|
2130 |
|
2131 function mapActions(actions, store) { |
|
2132 var createBoundAction = function createBoundAction(action) { |
|
2133 return function () { |
|
2134 return Promise.resolve(store.dispatch(action.apply(void 0, arguments))); |
|
2135 }; |
|
2136 }; |
|
2137 |
|
2138 return Object(external_this_lodash_["mapValues"])(actions, createBoundAction); |
|
2139 } |
|
2140 /** |
|
2141 * Returns resolvers with matched selectors for a given namespace. |
|
2142 * Resolvers are side effects invoked once per argument set of a given selector call, |
|
2143 * used in ensuring that the data needs for the selector are satisfied. |
|
2144 * |
|
2145 * @param {Object} resolvers Resolvers to register. |
|
2146 * @param {Object} selectors The current selectors to be modified. |
|
2147 * @param {Object} store The redux store to which the resolvers should be mapped. |
|
2148 * @return {Object} An object containing updated selectors and resolvers. |
|
2149 */ |
|
2150 |
|
2151 |
|
2152 function mapResolvers(resolvers, selectors, store) { |
|
2153 var mappedResolvers = Object(external_this_lodash_["mapValues"])(resolvers, function (resolver) { |
|
2154 var _resolver$fulfill = resolver.fulfill, |
|
2155 resolverFulfill = _resolver$fulfill === void 0 ? resolver : _resolver$fulfill; |
|
2156 return namespace_store_objectSpread({}, resolver, { |
|
2157 fulfill: resolverFulfill |
|
2158 }); |
|
2159 }); |
|
2160 |
|
2161 var mapSelector = function mapSelector(selector, selectorName) { |
|
2162 var resolver = resolvers[selectorName]; |
|
2163 |
|
2164 if (!resolver) { |
|
2165 selector.hasResolver = false; |
|
2166 return selector; |
|
2167 } |
|
2168 |
|
2169 var selectorResolver = function selectorResolver() { |
|
2170 for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) { |
|
2171 args[_key3] = arguments[_key3]; |
|
2172 } |
|
2173 |
|
2174 function fulfillSelector() { |
|
2175 return _fulfillSelector.apply(this, arguments); |
|
2176 } |
|
2177 |
|
2178 function _fulfillSelector() { |
|
2179 _fulfillSelector = Object(asyncToGenerator["a" /* default */])( /*#__PURE__*/external_this_regeneratorRuntime_default.a.mark(function _callee() { |
|
2180 var state, _store$__unstableOrig, metadata; |
|
2181 |
|
2182 return external_this_regeneratorRuntime_default.a.wrap(function _callee$(_context) { |
|
2183 while (1) { |
|
2184 switch (_context.prev = _context.next) { |
|
2185 case 0: |
|
2186 state = store.getState(); |
|
2187 |
|
2188 if (!(typeof resolver.isFulfilled === 'function' && resolver.isFulfilled.apply(resolver, [state].concat(args)))) { |
|
2189 _context.next = 3; |
|
2190 break; |
|
2191 } |
|
2192 |
|
2193 return _context.abrupt("return"); |
|
2194 |
|
2195 case 3: |
|
2196 _store$__unstableOrig = store.__unstableOriginalGetState(), metadata = _store$__unstableOrig.metadata; |
|
2197 |
|
2198 if (!hasStartedResolution(metadata, selectorName, args)) { |
|
2199 _context.next = 6; |
|
2200 break; |
|
2201 } |
|
2202 |
|
2203 return _context.abrupt("return"); |
|
2204 |
|
2205 case 6: |
|
2206 store.dispatch(startResolution(selectorName, args)); |
|
2207 _context.next = 9; |
|
2208 return fulfillResolver.apply(void 0, [store, mappedResolvers, selectorName].concat(args)); |
|
2209 |
|
2210 case 9: |
|
2211 store.dispatch(finishResolution(selectorName, args)); |
|
2212 |
|
2213 case 10: |
|
2214 case "end": |
|
2215 return _context.stop(); |
|
2216 } |
|
2217 } |
|
2218 }, _callee); |
|
2219 })); |
|
2220 return _fulfillSelector.apply(this, arguments); |
|
2221 } |
|
2222 |
|
2223 fulfillSelector.apply(void 0, args); |
|
2224 return selector.apply(void 0, args); |
|
2225 }; |
|
2226 |
|
2227 selectorResolver.hasResolver = true; |
|
2228 return selectorResolver; |
|
2229 }; |
|
2230 |
|
2231 return { |
|
2232 resolvers: mappedResolvers, |
|
2233 selectors: Object(external_this_lodash_["mapValues"])(selectors, mapSelector) |
|
2234 }; |
|
2235 } |
|
2236 /** |
|
2237 * Calls a resolver given arguments |
|
2238 * |
|
2239 * @param {Object} store Store reference, for fulfilling via resolvers |
|
2240 * @param {Object} resolvers Store Resolvers |
|
2241 * @param {string} selectorName Selector name to fulfill. |
|
2242 * @param {Array} args Selector Arguments. |
|
2243 */ |
|
2244 |
|
2245 |
|
2246 function fulfillResolver(_x, _x2, _x3) { |
|
2247 return _fulfillResolver.apply(this, arguments); |
|
2248 } |
|
2249 |
|
2250 function _fulfillResolver() { |
|
2251 _fulfillResolver = Object(asyncToGenerator["a" /* default */])( /*#__PURE__*/external_this_regeneratorRuntime_default.a.mark(function _callee2(store, resolvers, selectorName) { |
|
2252 var resolver, |
|
2253 _len4, |
|
2254 args, |
|
2255 _key4, |
|
2256 action, |
|
2257 _args2 = arguments; |
|
2258 |
|
2259 return external_this_regeneratorRuntime_default.a.wrap(function _callee2$(_context2) { |
|
2260 while (1) { |
|
2261 switch (_context2.prev = _context2.next) { |
|
2262 case 0: |
|
2263 resolver = Object(external_this_lodash_["get"])(resolvers, [selectorName]); |
|
2264 |
|
2265 if (resolver) { |
|
2266 _context2.next = 3; |
|
2267 break; |
|
2268 } |
|
2269 |
|
2270 return _context2.abrupt("return"); |
|
2271 |
|
2272 case 3: |
|
2273 for (_len4 = _args2.length, args = new Array(_len4 > 3 ? _len4 - 3 : 0), _key4 = 3; _key4 < _len4; _key4++) { |
|
2274 args[_key4 - 3] = _args2[_key4]; |
|
2275 } |
|
2276 |
|
2277 action = resolver.fulfill.apply(resolver, args); |
|
2278 |
|
2279 if (!action) { |
|
2280 _context2.next = 8; |
|
2281 break; |
|
2282 } |
|
2283 |
|
2284 _context2.next = 8; |
|
2285 return store.dispatch(action); |
|
2286 |
|
2287 case 8: |
|
2288 case "end": |
|
2289 return _context2.stop(); |
|
2290 } |
|
2291 } |
|
2292 }, _callee2); |
|
2293 })); |
|
2294 return _fulfillResolver.apply(this, arguments); |
|
2295 } |
|
2296 |
|
2297 // CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/store/index.js |
|
2298 |
|
2299 |
|
2300 function store_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; } |
|
2301 |
|
2302 function store_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { store_ownKeys(Object(source), true).forEach(function (key) { Object(defineProperty["a" /* default */])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { store_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } |
|
2303 |
|
2304 function createCoreDataStore(registry) { |
|
2305 var getCoreDataSelector = function getCoreDataSelector(selectorName) { |
|
2306 return function (reducerKey) { |
|
2307 var _registry$select; |
|
2308 |
|
2309 for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { |
|
2310 args[_key - 1] = arguments[_key]; |
|
2311 } |
|
2312 |
|
2313 return (_registry$select = registry.select(reducerKey))[selectorName].apply(_registry$select, args); |
|
2314 }; |
|
2315 }; |
|
2316 |
|
2317 var getCoreDataAction = function getCoreDataAction(actionName) { |
|
2318 return function (reducerKey) { |
|
2319 var _registry$dispatch; |
|
2320 |
|
2321 for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) { |
|
2322 args[_key2 - 1] = arguments[_key2]; |
|
2323 } |
|
2324 |
|
2325 return (_registry$dispatch = registry.dispatch(reducerKey))[actionName].apply(_registry$dispatch, args); |
|
2326 }; |
|
2327 }; |
|
2328 |
|
2329 return { |
|
2330 getSelectors: function getSelectors() { |
|
2331 return ['getIsResolving', 'hasStartedResolution', 'hasFinishedResolution', 'isResolving', 'getCachedResolvers'].reduce(function (memo, selectorName) { |
|
2332 return store_objectSpread({}, memo, Object(defineProperty["a" /* default */])({}, selectorName, getCoreDataSelector(selectorName))); |
|
2333 }, {}); |
|
2334 }, |
|
2335 getActions: function getActions() { |
|
2336 return ['startResolution', 'finishResolution', 'invalidateResolution', 'invalidateResolutionForStore', 'invalidateResolutionForStoreSelector'].reduce(function (memo, actionName) { |
|
2337 return store_objectSpread({}, memo, Object(defineProperty["a" /* default */])({}, actionName, getCoreDataAction(actionName))); |
|
2338 }, {}); |
|
2339 }, |
|
2340 subscribe: function subscribe() { |
|
2341 // There's no reasons to trigger any listener when we subscribe to this store |
|
2342 // because there's no state stored in this store that need to retrigger selectors |
|
2343 // if a change happens, the corresponding store where the tracking stated live |
|
2344 // would have already triggered a "subscribe" call. |
|
2345 return function () {}; |
|
2346 } |
|
2347 }; |
|
2348 } |
|
2349 |
|
2350 /* harmony default export */ var build_module_store = (createCoreDataStore); |
|
2351 |
|
2352 // CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/registry.js |
|
2353 |
|
2354 |
|
2355 |
|
2356 function registry_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; } |
|
2357 |
|
2358 function registry_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { registry_ownKeys(Object(source), true).forEach(function (key) { Object(defineProperty["a" /* default */])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { registry_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } |
|
2359 |
|
2360 /** |
|
2361 * External dependencies |
|
2362 */ |
|
2363 |
|
2364 |
|
2365 /** |
|
2366 * Internal dependencies |
|
2367 */ |
|
2368 |
|
2369 |
|
2370 |
|
2371 /** |
|
2372 * @typedef {Object} WPDataRegistry An isolated orchestrator of store registrations. |
|
2373 * |
|
2374 * @property {Function} registerGenericStore Given a namespace key and settings |
|
2375 * object, registers a new generic |
|
2376 * store. |
|
2377 * @property {Function} registerStore Given a namespace key and settings |
|
2378 * object, registers a new namespace |
|
2379 * store. |
|
2380 * @property {Function} subscribe Given a function callback, invokes |
|
2381 * the callback on any change to state |
|
2382 * within any registered store. |
|
2383 * @property {Function} select Given a namespace key, returns an |
|
2384 * object of the store's registered |
|
2385 * selectors. |
|
2386 * @property {Function} dispatch Given a namespace key, returns an |
|
2387 * object of the store's registered |
|
2388 * action dispatchers. |
|
2389 */ |
|
2390 |
|
2391 /** |
|
2392 * @typedef {Object} WPDataPlugin An object of registry function overrides. |
|
2393 * |
|
2394 * @property {Function} registerStore registers store. |
|
2395 */ |
|
2396 |
|
2397 /** |
|
2398 * Creates a new store registry, given an optional object of initial store |
|
2399 * configurations. |
|
2400 * |
|
2401 * @param {Object} storeConfigs Initial store configurations. |
|
2402 * @param {Object?} parent Parent registry. |
|
2403 * |
|
2404 * @return {WPDataRegistry} Data registry. |
|
2405 */ |
|
2406 |
|
2407 function createRegistry() { |
|
2408 var storeConfigs = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; |
|
2409 var parent = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; |
|
2410 var stores = {}; |
|
2411 var listeners = []; |
|
2412 /** |
|
2413 * Global listener called for each store's update. |
|
2414 */ |
|
2415 |
|
2416 function globalListener() { |
|
2417 listeners.forEach(function (listener) { |
|
2418 return listener(); |
|
2419 }); |
|
2420 } |
|
2421 /** |
|
2422 * Subscribe to changes to any data. |
|
2423 * |
|
2424 * @param {Function} listener Listener function. |
|
2425 * |
|
2426 * @return {Function} Unsubscribe function. |
|
2427 */ |
|
2428 |
|
2429 |
|
2430 var subscribe = function subscribe(listener) { |
|
2431 listeners.push(listener); |
|
2432 return function () { |
|
2433 listeners = Object(external_this_lodash_["without"])(listeners, listener); |
|
2434 }; |
|
2435 }; |
|
2436 /** |
|
2437 * Calls a selector given the current state and extra arguments. |
|
2438 * |
|
2439 * @param {string} reducerKey Part of the state shape to register the |
|
2440 * selectors for. |
|
2441 * |
|
2442 * @return {*} The selector's returned value. |
|
2443 */ |
|
2444 |
|
2445 |
|
2446 function select(reducerKey) { |
|
2447 var store = stores[reducerKey]; |
|
2448 |
|
2449 if (store) { |
|
2450 return store.getSelectors(); |
|
2451 } |
|
2452 |
|
2453 return parent && parent.select(reducerKey); |
|
2454 } |
|
2455 |
|
2456 var getResolveSelectors = memize_default()(function (selectors) { |
|
2457 return Object(external_this_lodash_["mapValues"])(Object(external_this_lodash_["omit"])(selectors, ['getIsResolving', 'hasStartedResolution', 'hasFinishedResolution', 'isResolving', 'getCachedResolvers']), function (selector, selectorName) { |
|
2458 return function () { |
|
2459 for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { |
|
2460 args[_key] = arguments[_key]; |
|
2461 } |
|
2462 |
|
2463 return new Promise(function (resolve) { |
|
2464 var hasFinished = function hasFinished() { |
|
2465 return selectors.hasFinishedResolution(selectorName, args); |
|
2466 }; |
|
2467 |
|
2468 var getResult = function getResult() { |
|
2469 return selector.apply(null, args); |
|
2470 }; // trigger the selector (to trigger the resolver) |
|
2471 |
|
2472 |
|
2473 var result = getResult(); |
|
2474 |
|
2475 if (hasFinished()) { |
|
2476 return resolve(result); |
|
2477 } |
|
2478 |
|
2479 var unsubscribe = subscribe(function () { |
|
2480 if (hasFinished()) { |
|
2481 unsubscribe(); |
|
2482 resolve(getResult()); |
|
2483 } |
|
2484 }); |
|
2485 }); |
|
2486 }; |
|
2487 }); |
|
2488 }, { |
|
2489 maxSize: 1 |
|
2490 }); |
|
2491 /** |
|
2492 * Given the name of a registered store, returns an object containing the store's |
|
2493 * selectors pre-bound to state so that you only need to supply additional arguments, |
|
2494 * and modified so that they return promises that resolve to their eventual values, |
|
2495 * after any resolvers have ran. |
|
2496 * |
|
2497 * @param {string} reducerKey Part of the state shape to register the |
|
2498 * selectors for. |
|
2499 * |
|
2500 * @return {Object} Each key of the object matches the name of a selector. |
|
2501 */ |
|
2502 |
|
2503 function __experimentalResolveSelect(reducerKey) { |
|
2504 return getResolveSelectors(select(reducerKey)); |
|
2505 } |
|
2506 /** |
|
2507 * Returns the available actions for a part of the state. |
|
2508 * |
|
2509 * @param {string} reducerKey Part of the state shape to dispatch the |
|
2510 * action for. |
|
2511 * |
|
2512 * @return {*} The action's returned value. |
|
2513 */ |
|
2514 |
|
2515 |
|
2516 function dispatch(reducerKey) { |
|
2517 var store = stores[reducerKey]; |
|
2518 |
|
2519 if (store) { |
|
2520 return store.getActions(); |
|
2521 } |
|
2522 |
|
2523 return parent && parent.dispatch(reducerKey); |
|
2524 } // |
|
2525 // Deprecated |
|
2526 // TODO: Remove this after `use()` is removed. |
|
2527 // |
|
2528 |
|
2529 |
|
2530 function withPlugins(attributes) { |
|
2531 return Object(external_this_lodash_["mapValues"])(attributes, function (attribute, key) { |
|
2532 if (typeof attribute !== 'function') { |
|
2533 return attribute; |
|
2534 } |
|
2535 |
|
2536 return function () { |
|
2537 return registry[key].apply(null, arguments); |
|
2538 }; |
|
2539 }); |
|
2540 } |
|
2541 /** |
|
2542 * Registers a generic store. |
|
2543 * |
|
2544 * @param {string} key Store registry key. |
|
2545 * @param {Object} config Configuration (getSelectors, getActions, subscribe). |
|
2546 */ |
|
2547 |
|
2548 |
|
2549 function registerGenericStore(key, config) { |
|
2550 if (typeof config.getSelectors !== 'function') { |
|
2551 throw new TypeError('config.getSelectors must be a function'); |
|
2552 } |
|
2553 |
|
2554 if (typeof config.getActions !== 'function') { |
|
2555 throw new TypeError('config.getActions must be a function'); |
|
2556 } |
|
2557 |
|
2558 if (typeof config.subscribe !== 'function') { |
|
2559 throw new TypeError('config.subscribe must be a function'); |
|
2560 } |
|
2561 |
|
2562 stores[key] = config; |
|
2563 config.subscribe(globalListener); |
|
2564 } |
|
2565 |
|
2566 var registry = { |
|
2567 registerGenericStore: registerGenericStore, |
|
2568 stores: stores, |
|
2569 namespaces: stores, |
|
2570 // TODO: Deprecate/remove this. |
|
2571 subscribe: subscribe, |
|
2572 select: select, |
|
2573 __experimentalResolveSelect: __experimentalResolveSelect, |
|
2574 dispatch: dispatch, |
|
2575 use: use |
|
2576 }; |
|
2577 /** |
|
2578 * Registers a standard `@wordpress/data` store. |
|
2579 * |
|
2580 * @param {string} reducerKey Reducer key. |
|
2581 * @param {Object} options Store description (reducer, actions, selectors, resolvers). |
|
2582 * |
|
2583 * @return {Object} Registered store object. |
|
2584 */ |
|
2585 |
|
2586 registry.registerStore = function (reducerKey, options) { |
|
2587 if (!options.reducer) { |
|
2588 throw new TypeError('Must specify store reducer'); |
|
2589 } |
|
2590 |
|
2591 var namespace = createNamespace(reducerKey, options, registry); |
|
2592 registerGenericStore(reducerKey, namespace); |
|
2593 return namespace.store; |
|
2594 }; // |
|
2595 // TODO: |
|
2596 // This function will be deprecated as soon as it is no longer internally referenced. |
|
2597 // |
|
2598 |
|
2599 |
|
2600 function use(plugin, options) { |
|
2601 registry = registry_objectSpread({}, registry, {}, plugin(registry, options)); |
|
2602 return registry; |
|
2603 } |
|
2604 |
|
2605 registerGenericStore('core/data', build_module_store(registry)); |
|
2606 Object.entries(storeConfigs).forEach(function (_ref) { |
|
2607 var _ref2 = Object(slicedToArray["a" /* default */])(_ref, 2), |
|
2608 name = _ref2[0], |
|
2609 config = _ref2[1]; |
|
2610 |
|
2611 return registry.registerStore(name, config); |
|
2612 }); |
|
2613 |
|
2614 if (parent) { |
|
2615 parent.subscribe(globalListener); |
|
2616 } |
|
2617 |
|
2618 return withPlugins(registry); |
|
2619 } |
|
2620 |
|
2621 // CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/default-registry.js |
|
2622 /** |
|
2623 * Internal dependencies |
|
2624 */ |
|
2625 |
|
2626 /* harmony default export */ var default_registry = (createRegistry()); |
|
2627 |
|
2628 // EXTERNAL MODULE: external {"this":["wp","deprecated"]} |
|
2629 var external_this_wp_deprecated_ = __webpack_require__(37); |
|
2630 var external_this_wp_deprecated_default = /*#__PURE__*/__webpack_require__.n(external_this_wp_deprecated_); |
|
2631 |
|
2632 // CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/plugins/controls/index.js |
|
2633 /** |
|
2634 * WordPress dependencies |
|
2635 */ |
|
2636 |
|
2637 /* harmony default export */ var controls = (function (registry) { |
|
2638 external_this_wp_deprecated_default()('wp.data.plugins.controls', { |
|
2639 hint: 'The controls plugins is now baked-in.' |
|
2640 }); |
|
2641 return registry; |
|
2642 }); |
|
2643 |
|
2644 // CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/plugins/persistence/storage/object.js |
|
2645 var objectStorage; |
|
2646 var object_storage = { |
|
2647 getItem: function getItem(key) { |
|
2648 if (!objectStorage || !objectStorage[key]) { |
|
2649 return null; |
|
2650 } |
|
2651 |
|
2652 return objectStorage[key]; |
|
2653 }, |
|
2654 setItem: function setItem(key, value) { |
|
2655 if (!objectStorage) { |
|
2656 object_storage.clear(); |
|
2657 } |
|
2658 |
|
2659 objectStorage[key] = String(value); |
|
2660 }, |
|
2661 clear: function clear() { |
|
2662 objectStorage = Object.create(null); |
|
2663 } |
|
2664 }; |
|
2665 /* harmony default export */ var object = (object_storage); |
|
2666 |
|
2667 // CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/plugins/persistence/storage/default.js |
|
2668 /** |
|
2669 * Internal dependencies |
|
2670 */ |
|
2671 |
|
2672 var default_storage; |
|
2673 |
|
2674 try { |
|
2675 // Private Browsing in Safari 10 and earlier will throw an error when |
|
2676 // attempting to set into localStorage. The test here is intentional in |
|
2677 // causing a thrown error as condition for using fallback object storage. |
|
2678 default_storage = window.localStorage; |
|
2679 default_storage.setItem('__wpDataTestLocalStorage', ''); |
|
2680 default_storage.removeItem('__wpDataTestLocalStorage'); |
|
2681 } catch (error) { |
|
2682 default_storage = object; |
|
2683 } |
|
2684 |
|
2685 /* harmony default export */ var storage_default = (default_storage); |
|
2686 |
|
2687 // CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/plugins/persistence/index.js |
|
2688 |
|
2689 |
|
2690 function persistence_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; } |
|
2691 |
|
2692 function persistence_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { persistence_ownKeys(Object(source), true).forEach(function (key) { Object(defineProperty["a" /* default */])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { persistence_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } |
|
2693 |
|
2694 /** |
|
2695 * External dependencies |
|
2696 */ |
|
2697 |
|
2698 /** |
|
2699 * Internal dependencies |
|
2700 */ |
|
2701 |
|
2702 |
|
2703 |
|
2704 /** @typedef {import('../../registry').WPDataRegistry} WPDataRegistry */ |
|
2705 |
|
2706 /** @typedef {import('../../registry').WPDataPlugin} WPDataPlugin */ |
|
2707 |
|
2708 /** |
|
2709 * @typedef {Object} WPDataPersistencePluginOptions Persistence plugin options. |
|
2710 * |
|
2711 * @property {Storage} storage Persistent storage implementation. This must |
|
2712 * at least implement `getItem` and `setItem` of |
|
2713 * the Web Storage API. |
|
2714 * @property {string} storageKey Key on which to set in persistent storage. |
|
2715 * |
|
2716 */ |
|
2717 |
|
2718 /** |
|
2719 * Default plugin storage. |
|
2720 * |
|
2721 * @type {Storage} |
|
2722 */ |
|
2723 |
|
2724 var DEFAULT_STORAGE = storage_default; |
|
2725 /** |
|
2726 * Default plugin storage key. |
|
2727 * |
|
2728 * @type {string} |
|
2729 */ |
|
2730 |
|
2731 var DEFAULT_STORAGE_KEY = 'WP_DATA'; |
|
2732 /** |
|
2733 * Higher-order reducer which invokes the original reducer only if state is |
|
2734 * inequal from that of the action's `nextState` property, otherwise returning |
|
2735 * the original state reference. |
|
2736 * |
|
2737 * @param {Function} reducer Original reducer. |
|
2738 * |
|
2739 * @return {Function} Enhanced reducer. |
|
2740 */ |
|
2741 |
|
2742 var withLazySameState = function withLazySameState(reducer) { |
|
2743 return function (state, action) { |
|
2744 if (action.nextState === state) { |
|
2745 return state; |
|
2746 } |
|
2747 |
|
2748 return reducer(state, action); |
|
2749 }; |
|
2750 }; |
|
2751 /** |
|
2752 * Creates a persistence interface, exposing getter and setter methods (`get` |
|
2753 * and `set` respectively). |
|
2754 * |
|
2755 * @param {WPDataPersistencePluginOptions} options Plugin options. |
|
2756 * |
|
2757 * @return {Object} Persistence interface. |
|
2758 */ |
|
2759 |
|
2760 function createPersistenceInterface(options) { |
|
2761 var _options$storage = options.storage, |
|
2762 storage = _options$storage === void 0 ? DEFAULT_STORAGE : _options$storage, |
|
2763 _options$storageKey = options.storageKey, |
|
2764 storageKey = _options$storageKey === void 0 ? DEFAULT_STORAGE_KEY : _options$storageKey; |
|
2765 var data; |
|
2766 /** |
|
2767 * Returns the persisted data as an object, defaulting to an empty object. |
|
2768 * |
|
2769 * @return {Object} Persisted data. |
|
2770 */ |
|
2771 |
|
2772 function getData() { |
|
2773 if (data === undefined) { |
|
2774 // If unset, getItem is expected to return null. Fall back to |
|
2775 // empty object. |
|
2776 var persisted = storage.getItem(storageKey); |
|
2777 |
|
2778 if (persisted === null) { |
|
2779 data = {}; |
|
2780 } else { |
|
2781 try { |
|
2782 data = JSON.parse(persisted); |
|
2783 } catch (error) { |
|
2784 // Similarly, should any error be thrown during parse of |
|
2785 // the string (malformed JSON), fall back to empty object. |
|
2786 data = {}; |
|
2787 } |
|
2788 } |
|
2789 } |
|
2790 |
|
2791 return data; |
|
2792 } |
|
2793 /** |
|
2794 * Merges an updated reducer state into the persisted data. |
|
2795 * |
|
2796 * @param {string} key Key to update. |
|
2797 * @param {*} value Updated value. |
|
2798 */ |
|
2799 |
|
2800 |
|
2801 function setData(key, value) { |
|
2802 data = persistence_objectSpread({}, data, Object(defineProperty["a" /* default */])({}, key, value)); |
|
2803 storage.setItem(storageKey, JSON.stringify(data)); |
|
2804 } |
|
2805 |
|
2806 return { |
|
2807 get: getData, |
|
2808 set: setData |
|
2809 }; |
|
2810 } |
|
2811 /** |
|
2812 * Data plugin to persist store state into a single storage key. |
|
2813 * |
|
2814 * @param {WPDataRegistry} registry Data registry. |
|
2815 * @param {?WPDataPersistencePluginOptions} pluginOptions Plugin options. |
|
2816 * |
|
2817 * @return {WPDataPlugin} Data plugin. |
|
2818 */ |
|
2819 |
|
2820 function persistencePlugin(registry, pluginOptions) { |
|
2821 var persistence = createPersistenceInterface(pluginOptions); |
|
2822 /** |
|
2823 * Creates an enhanced store dispatch function, triggering the state of the |
|
2824 * given reducer key to be persisted when changed. |
|
2825 * |
|
2826 * @param {Function} getState Function which returns current state. |
|
2827 * @param {string} reducerKey Reducer key. |
|
2828 * @param {?Array<string>} keys Optional subset of keys to save. |
|
2829 * |
|
2830 * @return {Function} Enhanced dispatch function. |
|
2831 */ |
|
2832 |
|
2833 function createPersistOnChange(getState, reducerKey, keys) { |
|
2834 var getPersistedState; |
|
2835 |
|
2836 if (Array.isArray(keys)) { |
|
2837 // Given keys, the persisted state should by produced as an object |
|
2838 // of the subset of keys. This implementation uses combineReducers |
|
2839 // to leverage its behavior of returning the same object when none |
|
2840 // of the property values changes. This allows a strict reference |
|
2841 // equality to bypass a persistence set on an unchanging state. |
|
2842 var reducers = keys.reduce(function (accumulator, key) { |
|
2843 return Object.assign(accumulator, Object(defineProperty["a" /* default */])({}, key, function (state, action) { |
|
2844 return action.nextState[key]; |
|
2845 })); |
|
2846 }, {}); |
|
2847 getPersistedState = withLazySameState(turbo_combine_reducers_default()(reducers)); |
|
2848 } else { |
|
2849 getPersistedState = function getPersistedState(state, action) { |
|
2850 return action.nextState; |
|
2851 }; |
|
2852 } |
|
2853 |
|
2854 var lastState = getPersistedState(undefined, { |
|
2855 nextState: getState() |
|
2856 }); |
|
2857 return function () { |
|
2858 var state = getPersistedState(lastState, { |
|
2859 nextState: getState() |
|
2860 }); |
|
2861 |
|
2862 if (state !== lastState) { |
|
2863 persistence.set(reducerKey, state); |
|
2864 lastState = state; |
|
2865 } |
|
2866 }; |
|
2867 } |
|
2868 |
|
2869 return { |
|
2870 registerStore: function registerStore(reducerKey, options) { |
|
2871 if (!options.persist) { |
|
2872 return registry.registerStore(reducerKey, options); |
|
2873 } // Load from persistence to use as initial state. |
|
2874 |
|
2875 |
|
2876 var persistedState = persistence.get()[reducerKey]; |
|
2877 |
|
2878 if (persistedState !== undefined) { |
|
2879 var initialState = options.reducer(options.initialState, { |
|
2880 type: '@@WP/PERSISTENCE_RESTORE' |
|
2881 }); |
|
2882 |
|
2883 if (Object(external_this_lodash_["isPlainObject"])(initialState) && Object(external_this_lodash_["isPlainObject"])(persistedState)) { |
|
2884 // If state is an object, ensure that: |
|
2885 // - Other keys are left intact when persisting only a |
|
2886 // subset of keys. |
|
2887 // - New keys in what would otherwise be used as initial |
|
2888 // state are deeply merged as base for persisted value. |
|
2889 initialState = Object(external_this_lodash_["merge"])({}, initialState, persistedState); |
|
2890 } else { |
|
2891 // If there is a mismatch in object-likeness of default |
|
2892 // initial or persisted state, defer to persisted value. |
|
2893 initialState = persistedState; |
|
2894 } |
|
2895 |
|
2896 options = persistence_objectSpread({}, options, { |
|
2897 initialState: initialState |
|
2898 }); |
|
2899 } |
|
2900 |
|
2901 var store = registry.registerStore(reducerKey, options); |
|
2902 store.subscribe(createPersistOnChange(store.getState, reducerKey, options.persist)); |
|
2903 return store; |
|
2904 } |
|
2905 }; |
|
2906 } |
|
2907 /** |
|
2908 * Deprecated: Remove this function and the code in WordPress Core that calls |
|
2909 * it once WordPress 5.4 is released. |
|
2910 */ |
|
2911 |
|
2912 |
|
2913 persistencePlugin.__unstableMigrate = function (pluginOptions) { |
|
2914 var persistence = createPersistenceInterface(pluginOptions); |
|
2915 var state = persistence.get(); // Migrate 'insertUsage' from 'core/editor' to 'core/block-editor' |
|
2916 |
|
2917 var insertUsage = Object(external_this_lodash_["get"])(state, ['core/editor', 'preferences', 'insertUsage']); |
|
2918 |
|
2919 if (insertUsage) { |
|
2920 persistence.set('core/block-editor', { |
|
2921 preferences: { |
|
2922 insertUsage: insertUsage |
|
2923 } |
|
2924 }); |
|
2925 } |
|
2926 |
|
2927 var editPostState = state['core/edit-post']; // Default `fullscreenMode` to `false` if any persisted state had existed |
|
2928 // and the user hadn't made an explicit choice about fullscreen mode. This |
|
2929 // is needed since `fullscreenMode` previously did not have a default value |
|
2930 // and was implicitly false by its absence. It is now `true` by default, but |
|
2931 // this change is not intended to affect upgrades from earlier versions. |
|
2932 |
|
2933 var hadPersistedState = Object.keys(state).length > 0; |
|
2934 var hadFullscreenModePreference = Object(external_this_lodash_["has"])(state, ['core/edit-post', 'preferences', 'features', 'fullscreenMode']); |
|
2935 |
|
2936 if (hadPersistedState && !hadFullscreenModePreference) { |
|
2937 editPostState = Object(external_this_lodash_["merge"])({}, editPostState, { |
|
2938 preferences: { |
|
2939 features: { |
|
2940 fullscreenMode: false |
|
2941 } |
|
2942 } |
|
2943 }); |
|
2944 } // Migrate 'areTipsEnabled' from 'core/nux' to 'showWelcomeGuide' in 'core/edit-post' |
|
2945 |
|
2946 |
|
2947 var areTipsEnabled = Object(external_this_lodash_["get"])(state, ['core/nux', 'preferences', 'areTipsEnabled']); |
|
2948 var hasWelcomeGuide = Object(external_this_lodash_["has"])(state, ['core/edit-post', 'preferences', 'features', 'welcomeGuide']); |
|
2949 |
|
2950 if (areTipsEnabled !== undefined && !hasWelcomeGuide) { |
|
2951 editPostState = Object(external_this_lodash_["merge"])({}, editPostState, { |
|
2952 preferences: { |
|
2953 features: { |
|
2954 welcomeGuide: areTipsEnabled |
|
2955 } |
|
2956 } |
|
2957 }); |
|
2958 } |
|
2959 |
|
2960 if (editPostState !== state['core/edit-post']) { |
|
2961 persistence.set('core/edit-post', editPostState); |
|
2962 } |
|
2963 }; |
|
2964 |
|
2965 /* harmony default export */ var plugins_persistence = (persistencePlugin); |
|
2966 |
|
2967 // CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/plugins/index.js |
|
2968 |
|
2969 |
|
2970 |
|
2971 // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/extends.js |
|
2972 var esm_extends = __webpack_require__(8); |
|
2973 |
|
2974 // EXTERNAL MODULE: external {"this":["wp","element"]} |
|
2975 var external_this_wp_element_ = __webpack_require__(0); |
|
2976 |
|
2977 // EXTERNAL MODULE: external {"this":["wp","compose"]} |
|
2978 var external_this_wp_compose_ = __webpack_require__(9); |
|
2979 |
|
2980 // EXTERNAL MODULE: external {"this":"React"} |
|
2981 var external_this_React_ = __webpack_require__(13); |
|
2982 |
|
2983 // CONCATENATED MODULE: ./node_modules/use-memo-one/dist/use-memo-one.esm.js |
|
2984 |
|
2985 |
|
2986 function areInputsEqual(newInputs, lastInputs) { |
|
2987 if (newInputs.length !== lastInputs.length) { |
|
2988 return false; |
|
2989 } |
|
2990 |
|
2991 for (var i = 0; i < newInputs.length; i++) { |
|
2992 if (newInputs[i] !== lastInputs[i]) { |
|
2993 return false; |
|
2994 } |
|
2995 } |
|
2996 |
|
2997 return true; |
|
2998 } |
|
2999 |
|
3000 function useMemoOne(getResult, inputs) { |
|
3001 var initial = Object(external_this_React_["useState"])(function () { |
|
3002 return { |
|
3003 inputs: inputs, |
|
3004 result: getResult() |
|
3005 }; |
|
3006 })[0]; |
|
3007 var committed = Object(external_this_React_["useRef"])(initial); |
|
3008 var isInputMatch = Boolean(inputs && committed.current.inputs && areInputsEqual(inputs, committed.current.inputs)); |
|
3009 var cache = isInputMatch ? committed.current : { |
|
3010 inputs: inputs, |
|
3011 result: getResult() |
|
3012 }; |
|
3013 Object(external_this_React_["useEffect"])(function () { |
|
3014 committed.current = cache; |
|
3015 }, [cache]); |
|
3016 return cache.result; |
|
3017 } |
|
3018 function useCallbackOne(callback, inputs) { |
|
3019 return useMemoOne(function () { |
|
3020 return callback; |
|
3021 }, inputs); |
|
3022 } |
|
3023 var useMemo = useMemoOne; |
|
3024 var useCallback = useCallbackOne; |
|
3025 |
|
3026 |
|
3027 |
|
3028 // EXTERNAL MODULE: external {"this":["wp","priorityQueue"]} |
|
3029 var external_this_wp_priorityQueue_ = __webpack_require__(150); |
|
3030 |
|
3031 // EXTERNAL MODULE: external {"this":["wp","isShallowEqual"]} |
|
3032 var external_this_wp_isShallowEqual_ = __webpack_require__(64); |
|
3033 var external_this_wp_isShallowEqual_default = /*#__PURE__*/__webpack_require__.n(external_this_wp_isShallowEqual_); |
|
3034 |
|
3035 // CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/components/registry-provider/context.js |
|
3036 /** |
|
3037 * WordPress dependencies |
|
3038 */ |
|
3039 |
|
3040 /** |
|
3041 * Internal dependencies |
|
3042 */ |
|
3043 |
|
3044 |
|
3045 var Context = Object(external_this_wp_element_["createContext"])(default_registry); |
|
3046 var Consumer = Context.Consumer, |
|
3047 Provider = Context.Provider; |
|
3048 /** |
|
3049 * A custom react Context consumer exposing the provided `registry` to |
|
3050 * children components. Used along with the RegistryProvider. |
|
3051 * |
|
3052 * You can read more about the react context api here: |
|
3053 * https://reactjs.org/docs/context.html#contextprovider |
|
3054 * |
|
3055 * @example |
|
3056 * ```js |
|
3057 * const { |
|
3058 * RegistryProvider, |
|
3059 * RegistryConsumer, |
|
3060 * createRegistry |
|
3061 * } = wp.data; |
|
3062 * |
|
3063 * const registry = createRegistry( {} ); |
|
3064 * |
|
3065 * const App = ( { props } ) => { |
|
3066 * return <RegistryProvider value={ registry }> |
|
3067 * <div>Hello There</div> |
|
3068 * <RegistryConsumer> |
|
3069 * { ( registry ) => ( |
|
3070 * <ComponentUsingRegistry |
|
3071 * { ...props } |
|
3072 * registry={ registry } |
|
3073 * ) } |
|
3074 * </RegistryConsumer> |
|
3075 * </RegistryProvider> |
|
3076 * } |
|
3077 * ``` |
|
3078 */ |
|
3079 |
|
3080 var RegistryConsumer = Consumer; |
|
3081 /** |
|
3082 * A custom Context provider for exposing the provided `registry` to children |
|
3083 * components via a consumer. |
|
3084 * |
|
3085 * See <a name="#RegistryConsumer">RegistryConsumer</a> documentation for |
|
3086 * example. |
|
3087 */ |
|
3088 |
|
3089 /* harmony default export */ var context = (Provider); |
|
3090 |
|
3091 // CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/components/registry-provider/use-registry.js |
|
3092 /** |
|
3093 * WordPress dependencies |
|
3094 */ |
|
3095 |
|
3096 /** |
|
3097 * Internal dependencies |
|
3098 */ |
|
3099 |
|
3100 |
|
3101 /** |
|
3102 * A custom react hook exposing the registry context for use. |
|
3103 * |
|
3104 * This exposes the `registry` value provided via the |
|
3105 * <a href="#RegistryProvider">Registry Provider</a> to a component implementing |
|
3106 * this hook. |
|
3107 * |
|
3108 * It acts similarly to the `useContext` react hook. |
|
3109 * |
|
3110 * Note: Generally speaking, `useRegistry` is a low level hook that in most cases |
|
3111 * won't be needed for implementation. Most interactions with the wp.data api |
|
3112 * can be performed via the `useSelect` hook, or the `withSelect` and |
|
3113 * `withDispatch` higher order components. |
|
3114 * |
|
3115 * @example |
|
3116 * ```js |
|
3117 * const { |
|
3118 * RegistryProvider, |
|
3119 * createRegistry, |
|
3120 * useRegistry, |
|
3121 * } = wp.data |
|
3122 * |
|
3123 * const registry = createRegistry( {} ); |
|
3124 * |
|
3125 * const SomeChildUsingRegistry = ( props ) => { |
|
3126 * const registry = useRegistry( registry ); |
|
3127 * // ...logic implementing the registry in other react hooks. |
|
3128 * }; |
|
3129 * |
|
3130 * |
|
3131 * const ParentProvidingRegistry = ( props ) => { |
|
3132 * return <RegistryProvider value={ registry }> |
|
3133 * <SomeChildUsingRegistry { ...props } /> |
|
3134 * </RegistryProvider> |
|
3135 * }; |
|
3136 * ``` |
|
3137 * |
|
3138 * @return {Function} A custom react hook exposing the registry context value. |
|
3139 */ |
|
3140 |
|
3141 function useRegistry() { |
|
3142 return Object(external_this_wp_element_["useContext"])(Context); |
|
3143 } |
|
3144 |
|
3145 // CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/components/async-mode-provider/context.js |
|
3146 /** |
|
3147 * WordPress dependencies |
|
3148 */ |
|
3149 |
|
3150 var context_Context = Object(external_this_wp_element_["createContext"])(false); |
|
3151 var context_Consumer = context_Context.Consumer, |
|
3152 context_Provider = context_Context.Provider; |
|
3153 var AsyncModeConsumer = context_Consumer; |
|
3154 /** |
|
3155 * Context Provider Component used to switch the data module component rerendering |
|
3156 * between Sync and Async modes. |
|
3157 * |
|
3158 * @example |
|
3159 * |
|
3160 * ```js |
|
3161 * import { useSelect, AsyncModeProvider } from '@wordpress/data'; |
|
3162 * |
|
3163 * function BlockCount() { |
|
3164 * const count = useSelect( ( select ) => { |
|
3165 * return select( 'core/block-editor' ).getBlockCount() |
|
3166 * }, [] ); |
|
3167 * |
|
3168 * return count; |
|
3169 * } |
|
3170 * |
|
3171 * function App() { |
|
3172 * return ( |
|
3173 * <AsyncModeProvider value={ true }> |
|
3174 * <BlockCount /> |
|
3175 * </AsyncModeProvider> |
|
3176 * ); |
|
3177 * } |
|
3178 * ``` |
|
3179 * |
|
3180 * In this example, the BlockCount component is rerendered asynchronously. |
|
3181 * It means if a more critical task is being performed (like typing in an input), |
|
3182 * the rerendering is delayed until the browser becomes IDLE. |
|
3183 * It is possible to nest multiple levels of AsyncModeProvider to fine-tune the rendering behavior. |
|
3184 * |
|
3185 * @param {boolean} props.value Enable Async Mode. |
|
3186 * @return {WPComponent} The component to be rendered. |
|
3187 */ |
|
3188 |
|
3189 /* harmony default export */ var async_mode_provider_context = (context_Provider); |
|
3190 |
|
3191 // CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/components/async-mode-provider/use-async-mode.js |
|
3192 /** |
|
3193 * WordPress dependencies |
|
3194 */ |
|
3195 |
|
3196 /** |
|
3197 * Internal dependencies |
|
3198 */ |
|
3199 |
|
3200 |
|
3201 function useAsyncMode() { |
|
3202 return Object(external_this_wp_element_["useContext"])(context_Context); |
|
3203 } |
|
3204 |
|
3205 // CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/components/use-select/index.js |
|
3206 |
|
3207 |
|
3208 /** |
|
3209 * External dependencies |
|
3210 */ |
|
3211 |
|
3212 /** |
|
3213 * WordPress dependencies |
|
3214 */ |
|
3215 |
|
3216 |
|
3217 |
|
3218 |
|
3219 /** |
|
3220 * Internal dependencies |
|
3221 */ |
|
3222 |
|
3223 |
|
3224 |
|
3225 /** |
|
3226 * Favor useLayoutEffect to ensure the store subscription callback always has |
|
3227 * the selector from the latest render. If a store update happens between render |
|
3228 * and the effect, this could cause missed/stale updates or inconsistent state. |
|
3229 * |
|
3230 * Fallback to useEffect for server rendered components because currently React |
|
3231 * throws a warning when using useLayoutEffect in that environment. |
|
3232 */ |
|
3233 |
|
3234 var useIsomorphicLayoutEffect = typeof window !== 'undefined' ? external_this_wp_element_["useLayoutEffect"] : external_this_wp_element_["useEffect"]; |
|
3235 var renderQueue = Object(external_this_wp_priorityQueue_["createQueue"])(); |
|
3236 /** |
|
3237 * Custom react hook for retrieving props from registered selectors. |
|
3238 * |
|
3239 * In general, this custom React hook follows the |
|
3240 * [rules of hooks](https://reactjs.org/docs/hooks-rules.html). |
|
3241 * |
|
3242 * @param {Function} _mapSelect Function called on every state change. The |
|
3243 * returned value is exposed to the component |
|
3244 * implementing this hook. The function receives |
|
3245 * the `registry.select` method on the first |
|
3246 * argument and the `registry` on the second |
|
3247 * argument. |
|
3248 * @param {Array} deps If provided, this memoizes the mapSelect so the |
|
3249 * same `mapSelect` is invoked on every state |
|
3250 * change unless the dependencies change. |
|
3251 * |
|
3252 * @example |
|
3253 * ```js |
|
3254 * const { useSelect } = wp.data; |
|
3255 * |
|
3256 * function HammerPriceDisplay( { currency } ) { |
|
3257 * const price = useSelect( ( select ) => { |
|
3258 * return select( 'my-shop' ).getPrice( 'hammer', currency ) |
|
3259 * }, [ currency ] ); |
|
3260 * return new Intl.NumberFormat( 'en-US', { |
|
3261 * style: 'currency', |
|
3262 * currency, |
|
3263 * } ).format( price ); |
|
3264 * } |
|
3265 * |
|
3266 * // Rendered in the application: |
|
3267 * // <HammerPriceDisplay currency="USD" /> |
|
3268 * ``` |
|
3269 * |
|
3270 * In the above example, when `HammerPriceDisplay` is rendered into an |
|
3271 * application, the price will be retrieved from the store state using the |
|
3272 * `mapSelect` callback on `useSelect`. If the currency prop changes then |
|
3273 * any price in the state for that currency is retrieved. If the currency prop |
|
3274 * doesn't change and other props are passed in that do change, the price will |
|
3275 * not change because the dependency is just the currency. |
|
3276 * |
|
3277 * @return {Function} A custom react hook. |
|
3278 */ |
|
3279 |
|
3280 function useSelect(_mapSelect, deps) { |
|
3281 var mapSelect = Object(external_this_wp_element_["useCallback"])(_mapSelect, deps); |
|
3282 var registry = useRegistry(); |
|
3283 var isAsync = useAsyncMode(); // React can sometimes clear the `useMemo` cache. |
|
3284 // We use the cache-stable `useMemoOne` to avoid |
|
3285 // losing queues. |
|
3286 |
|
3287 var queueContext = useMemoOne(function () { |
|
3288 return { |
|
3289 queue: true |
|
3290 }; |
|
3291 }, [registry]); |
|
3292 |
|
3293 var _useReducer = Object(external_this_wp_element_["useReducer"])(function (s) { |
|
3294 return s + 1; |
|
3295 }, 0), |
|
3296 _useReducer2 = Object(slicedToArray["a" /* default */])(_useReducer, 2), |
|
3297 forceRender = _useReducer2[1]; |
|
3298 |
|
3299 var latestMapSelect = Object(external_this_wp_element_["useRef"])(); |
|
3300 var latestIsAsync = Object(external_this_wp_element_["useRef"])(isAsync); |
|
3301 var latestMapOutput = Object(external_this_wp_element_["useRef"])(); |
|
3302 var latestMapOutputError = Object(external_this_wp_element_["useRef"])(); |
|
3303 var isMountedAndNotUnsubscribing = Object(external_this_wp_element_["useRef"])(); |
|
3304 var mapOutput; |
|
3305 |
|
3306 try { |
|
3307 if (latestMapSelect.current !== mapSelect || latestMapOutputError.current) { |
|
3308 mapOutput = mapSelect(registry.select, registry); |
|
3309 } else { |
|
3310 mapOutput = latestMapOutput.current; |
|
3311 } |
|
3312 } catch (error) { |
|
3313 var errorMessage = "An error occurred while running 'mapSelect': ".concat(error.message); |
|
3314 |
|
3315 if (latestMapOutputError.current) { |
|
3316 errorMessage += "\nThe error may be correlated with this previous error:\n"; |
|
3317 errorMessage += "".concat(latestMapOutputError.current.stack, "\n\n"); |
|
3318 errorMessage += 'Original stack trace:'; |
|
3319 throw new Error(errorMessage); |
|
3320 } else { |
|
3321 // eslint-disable-next-line no-console |
|
3322 console.error(errorMessage); |
|
3323 } |
|
3324 } |
|
3325 |
|
3326 useIsomorphicLayoutEffect(function () { |
|
3327 latestMapSelect.current = mapSelect; |
|
3328 latestMapOutput.current = mapOutput; |
|
3329 latestMapOutputError.current = undefined; |
|
3330 isMountedAndNotUnsubscribing.current = true; // This has to run after the other ref updates |
|
3331 // to avoid using stale values in the flushed |
|
3332 // callbacks or potentially overwriting a |
|
3333 // changed `latestMapOutput.current`. |
|
3334 |
|
3335 if (latestIsAsync.current !== isAsync) { |
|
3336 latestIsAsync.current = isAsync; |
|
3337 renderQueue.flush(queueContext); |
|
3338 } |
|
3339 }); |
|
3340 useIsomorphicLayoutEffect(function () { |
|
3341 var onStoreChange = function onStoreChange() { |
|
3342 if (isMountedAndNotUnsubscribing.current) { |
|
3343 try { |
|
3344 var newMapOutput = latestMapSelect.current(registry.select, registry); |
|
3345 |
|
3346 if (external_this_wp_isShallowEqual_default()(latestMapOutput.current, newMapOutput)) { |
|
3347 return; |
|
3348 } |
|
3349 |
|
3350 latestMapOutput.current = newMapOutput; |
|
3351 } catch (error) { |
|
3352 latestMapOutputError.current = error; |
|
3353 } |
|
3354 |
|
3355 forceRender(); |
|
3356 } |
|
3357 }; // catch any possible state changes during mount before the subscription |
|
3358 // could be set. |
|
3359 |
|
3360 |
|
3361 if (latestIsAsync.current) { |
|
3362 renderQueue.add(queueContext, onStoreChange); |
|
3363 } else { |
|
3364 onStoreChange(); |
|
3365 } |
|
3366 |
|
3367 var unsubscribe = registry.subscribe(function () { |
|
3368 if (latestIsAsync.current) { |
|
3369 renderQueue.add(queueContext, onStoreChange); |
|
3370 } else { |
|
3371 onStoreChange(); |
|
3372 } |
|
3373 }); |
|
3374 return function () { |
|
3375 isMountedAndNotUnsubscribing.current = false; |
|
3376 unsubscribe(); |
|
3377 renderQueue.flush(queueContext); |
|
3378 }; |
|
3379 }, [registry]); |
|
3380 return mapOutput; |
|
3381 } |
|
3382 |
|
3383 // CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/components/with-select/index.js |
|
3384 |
|
3385 |
|
3386 |
|
3387 /** |
|
3388 * WordPress dependencies |
|
3389 */ |
|
3390 |
|
3391 /** |
|
3392 * Internal dependencies |
|
3393 */ |
|
3394 |
|
3395 |
|
3396 /** |
|
3397 * Higher-order component used to inject state-derived props using registered |
|
3398 * selectors. |
|
3399 * |
|
3400 * @param {Function} mapSelectToProps Function called on every state change, |
|
3401 * expected to return object of props to |
|
3402 * merge with the component's own props. |
|
3403 * |
|
3404 * @example |
|
3405 * ```js |
|
3406 * function PriceDisplay( { price, currency } ) { |
|
3407 * return new Intl.NumberFormat( 'en-US', { |
|
3408 * style: 'currency', |
|
3409 * currency, |
|
3410 * } ).format( price ); |
|
3411 * } |
|
3412 * |
|
3413 * const { withSelect } = wp.data; |
|
3414 * |
|
3415 * const HammerPriceDisplay = withSelect( ( select, ownProps ) => { |
|
3416 * const { getPrice } = select( 'my-shop' ); |
|
3417 * const { currency } = ownProps; |
|
3418 * |
|
3419 * return { |
|
3420 * price: getPrice( 'hammer', currency ), |
|
3421 * }; |
|
3422 * } )( PriceDisplay ); |
|
3423 * |
|
3424 * // Rendered in the application: |
|
3425 * // |
|
3426 * // <HammerPriceDisplay currency="USD" /> |
|
3427 * ``` |
|
3428 * In the above example, when `HammerPriceDisplay` is rendered into an |
|
3429 * application, it will pass the price into the underlying `PriceDisplay` |
|
3430 * component and update automatically if the price of a hammer ever changes in |
|
3431 * the store. |
|
3432 * |
|
3433 * @return {WPComponent} Enhanced component with merged state data props. |
|
3434 */ |
|
3435 |
|
3436 var with_select_withSelect = function withSelect(mapSelectToProps) { |
|
3437 return Object(external_this_wp_compose_["createHigherOrderComponent"])(function (WrappedComponent) { |
|
3438 return Object(external_this_wp_compose_["pure"])(function (ownProps) { |
|
3439 var mapSelect = function mapSelect(select, registry) { |
|
3440 return mapSelectToProps(select, ownProps, registry); |
|
3441 }; |
|
3442 |
|
3443 var mergeProps = useSelect(mapSelect); |
|
3444 return Object(external_this_wp_element_["createElement"])(WrappedComponent, Object(esm_extends["a" /* default */])({}, ownProps, mergeProps)); |
|
3445 }); |
|
3446 }, 'withSelect'); |
|
3447 }; |
|
3448 |
|
3449 /* harmony default export */ var with_select = (with_select_withSelect); |
|
3450 |
|
3451 // CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/components/use-dispatch/use-dispatch-with-map.js |
|
3452 |
|
3453 |
|
3454 /** |
|
3455 * External dependencies |
|
3456 */ |
|
3457 |
|
3458 /** |
|
3459 * WordPress dependencies |
|
3460 */ |
|
3461 |
|
3462 |
|
3463 /** |
|
3464 * Internal dependencies |
|
3465 */ |
|
3466 |
|
3467 |
|
3468 /** |
|
3469 * Favor useLayoutEffect to ensure the store subscription callback always has |
|
3470 * the dispatchMap from the latest render. If a store update happens between |
|
3471 * render and the effect, this could cause missed/stale updates or |
|
3472 * inconsistent state. |
|
3473 * |
|
3474 * Fallback to useEffect for server rendered components because currently React |
|
3475 * throws a warning when using useLayoutEffect in that environment. |
|
3476 */ |
|
3477 |
|
3478 var use_dispatch_with_map_useIsomorphicLayoutEffect = typeof window !== 'undefined' ? external_this_wp_element_["useLayoutEffect"] : external_this_wp_element_["useEffect"]; |
|
3479 /** |
|
3480 * Custom react hook for returning aggregate dispatch actions using the provided |
|
3481 * dispatchMap. |
|
3482 * |
|
3483 * Currently this is an internal api only and is implemented by `withDispatch` |
|
3484 * |
|
3485 * @param {Function} dispatchMap Receives the `registry.dispatch` function as |
|
3486 * the first argument and the `registry` object |
|
3487 * as the second argument. Should return an |
|
3488 * object mapping props to functions. |
|
3489 * @param {Array} deps An array of dependencies for the hook. |
|
3490 * @return {Object} An object mapping props to functions created by the passed |
|
3491 * in dispatchMap. |
|
3492 */ |
|
3493 |
|
3494 var use_dispatch_with_map_useDispatchWithMap = function useDispatchWithMap(dispatchMap, deps) { |
|
3495 var registry = useRegistry(); |
|
3496 var currentDispatchMap = Object(external_this_wp_element_["useRef"])(dispatchMap); |
|
3497 use_dispatch_with_map_useIsomorphicLayoutEffect(function () { |
|
3498 currentDispatchMap.current = dispatchMap; |
|
3499 }); |
|
3500 return Object(external_this_wp_element_["useMemo"])(function () { |
|
3501 var currentDispatchProps = currentDispatchMap.current(registry.dispatch, registry); |
|
3502 return Object(external_this_lodash_["mapValues"])(currentDispatchProps, function (dispatcher, propName) { |
|
3503 if (typeof dispatcher !== 'function') { |
|
3504 // eslint-disable-next-line no-console |
|
3505 console.warn("Property ".concat(propName, " returned from dispatchMap in useDispatchWithMap must be a function.")); |
|
3506 } |
|
3507 |
|
3508 return function () { |
|
3509 var _currentDispatchMap$c; |
|
3510 |
|
3511 return (_currentDispatchMap$c = currentDispatchMap.current(registry.dispatch, registry))[propName].apply(_currentDispatchMap$c, arguments); |
|
3512 }; |
|
3513 }); |
|
3514 }, [registry].concat(Object(toConsumableArray["a" /* default */])(deps))); |
|
3515 }; |
|
3516 |
|
3517 /* harmony default export */ var use_dispatch_with_map = (use_dispatch_with_map_useDispatchWithMap); |
|
3518 |
|
3519 // CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/components/with-dispatch/index.js |
|
3520 |
|
3521 |
|
3522 |
|
3523 /** |
|
3524 * WordPress dependencies |
|
3525 */ |
|
3526 |
|
3527 /** |
|
3528 * Internal dependencies |
|
3529 */ |
|
3530 |
|
3531 |
|
3532 /** |
|
3533 * Higher-order component used to add dispatch props using registered action |
|
3534 * creators. |
|
3535 * |
|
3536 * @param {Function} mapDispatchToProps A function of returning an object of |
|
3537 * prop names where value is a |
|
3538 * dispatch-bound action creator, or a |
|
3539 * function to be called with the |
|
3540 * component's props and returning an |
|
3541 * action creator. |
|
3542 * |
|
3543 * @example |
|
3544 * ```jsx |
|
3545 * function Button( { onClick, children } ) { |
|
3546 * return <button type="button" onClick={ onClick }>{ children }</button>; |
|
3547 * } |
|
3548 * |
|
3549 * const { withDispatch } = wp.data; |
|
3550 * |
|
3551 * const SaleButton = withDispatch( ( dispatch, ownProps ) => { |
|
3552 * const { startSale } = dispatch( 'my-shop' ); |
|
3553 * const { discountPercent } = ownProps; |
|
3554 * |
|
3555 * return { |
|
3556 * onClick() { |
|
3557 * startSale( discountPercent ); |
|
3558 * }, |
|
3559 * }; |
|
3560 * } )( Button ); |
|
3561 * |
|
3562 * // Rendered in the application: |
|
3563 * // |
|
3564 * // <SaleButton discountPercent="20">Start Sale!</SaleButton> |
|
3565 * ``` |
|
3566 * |
|
3567 * @example |
|
3568 * In the majority of cases, it will be sufficient to use only two first params |
|
3569 * passed to `mapDispatchToProps` as illustrated in the previous example. |
|
3570 * However, there might be some very advanced use cases where using the |
|
3571 * `registry` object might be used as a tool to optimize the performance of |
|
3572 * your component. Using `select` function from the registry might be useful |
|
3573 * when you need to fetch some dynamic data from the store at the time when the |
|
3574 * event is fired, but at the same time, you never use it to render your |
|
3575 * component. In such scenario, you can avoid using the `withSelect` higher |
|
3576 * order component to compute such prop, which might lead to unnecessary |
|
3577 * re-renders of your component caused by its frequent value change. |
|
3578 * Keep in mind, that `mapDispatchToProps` must return an object with functions |
|
3579 * only. |
|
3580 * |
|
3581 * ```jsx |
|
3582 * function Button( { onClick, children } ) { |
|
3583 * return <button type="button" onClick={ onClick }>{ children }</button>; |
|
3584 * } |
|
3585 * |
|
3586 * const { withDispatch } = wp.data; |
|
3587 * |
|
3588 * const SaleButton = withDispatch( ( dispatch, ownProps, { select } ) => { |
|
3589 * // Stock number changes frequently. |
|
3590 * const { getStockNumber } = select( 'my-shop' ); |
|
3591 * const { startSale } = dispatch( 'my-shop' ); |
|
3592 * return { |
|
3593 * onClick() { |
|
3594 * const discountPercent = getStockNumber() > 50 ? 10 : 20; |
|
3595 * startSale( discountPercent ); |
|
3596 * }, |
|
3597 * }; |
|
3598 * } )( Button ); |
|
3599 * |
|
3600 * // Rendered in the application: |
|
3601 * // |
|
3602 * // <SaleButton>Start Sale!</SaleButton> |
|
3603 * ``` |
|
3604 * |
|
3605 * _Note:_ It is important that the `mapDispatchToProps` function always |
|
3606 * returns an object with the same keys. For example, it should not contain |
|
3607 * conditions under which a different value would be returned. |
|
3608 * |
|
3609 * @return {WPComponent} Enhanced component with merged dispatcher props. |
|
3610 */ |
|
3611 |
|
3612 var with_dispatch_withDispatch = function withDispatch(mapDispatchToProps) { |
|
3613 return Object(external_this_wp_compose_["createHigherOrderComponent"])(function (WrappedComponent) { |
|
3614 return function (ownProps) { |
|
3615 var mapDispatch = function mapDispatch(dispatch, registry) { |
|
3616 return mapDispatchToProps(dispatch, ownProps, registry); |
|
3617 }; |
|
3618 |
|
3619 var dispatchProps = use_dispatch_with_map(mapDispatch, []); |
|
3620 return Object(external_this_wp_element_["createElement"])(WrappedComponent, Object(esm_extends["a" /* default */])({}, ownProps, dispatchProps)); |
|
3621 }; |
|
3622 }, 'withDispatch'); |
|
3623 }; |
|
3624 |
|
3625 /* harmony default export */ var with_dispatch = (with_dispatch_withDispatch); |
|
3626 |
|
3627 // CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/components/with-registry/index.js |
|
3628 |
|
3629 |
|
3630 |
|
3631 /** |
|
3632 * WordPress dependencies |
|
3633 */ |
|
3634 |
|
3635 /** |
|
3636 * Internal dependencies |
|
3637 */ |
|
3638 |
|
3639 |
|
3640 /** |
|
3641 * Higher-order component which renders the original component with the current |
|
3642 * registry context passed as its `registry` prop. |
|
3643 * |
|
3644 * @param {WPComponent} OriginalComponent Original component. |
|
3645 * |
|
3646 * @return {WPComponent} Enhanced component. |
|
3647 */ |
|
3648 |
|
3649 var withRegistry = Object(external_this_wp_compose_["createHigherOrderComponent"])(function (OriginalComponent) { |
|
3650 return function (props) { |
|
3651 return Object(external_this_wp_element_["createElement"])(RegistryConsumer, null, function (registry) { |
|
3652 return Object(external_this_wp_element_["createElement"])(OriginalComponent, Object(esm_extends["a" /* default */])({}, props, { |
|
3653 registry: registry |
|
3654 })); |
|
3655 }); |
|
3656 }; |
|
3657 }, 'withRegistry'); |
|
3658 /* harmony default export */ var with_registry = (withRegistry); |
|
3659 |
|
3660 // CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/components/use-dispatch/use-dispatch.js |
|
3661 /** |
|
3662 * Internal dependencies |
|
3663 */ |
|
3664 |
|
3665 /** |
|
3666 * A custom react hook returning the current registry dispatch actions creators. |
|
3667 * |
|
3668 * Note: The component using this hook must be within the context of a |
|
3669 * RegistryProvider. |
|
3670 * |
|
3671 * @param {string} [storeName] Optionally provide the name of the store from |
|
3672 * which to retrieve action creators. If not |
|
3673 * provided, the registry.dispatch function is |
|
3674 * returned instead. |
|
3675 * |
|
3676 * @example |
|
3677 * This illustrates a pattern where you may need to retrieve dynamic data from |
|
3678 * the server via the `useSelect` hook to use in combination with the dispatch |
|
3679 * action. |
|
3680 * |
|
3681 * ```jsx |
|
3682 * const { useDispatch, useSelect } = wp.data; |
|
3683 * const { useCallback } = wp.element; |
|
3684 * |
|
3685 * function Button( { onClick, children } ) { |
|
3686 * return <button type="button" onClick={ onClick }>{ children }</button> |
|
3687 * } |
|
3688 * |
|
3689 * const SaleButton = ( { children } ) => { |
|
3690 * const { stockNumber } = useSelect( |
|
3691 * ( select ) => select( 'my-shop' ).getStockNumber(), |
|
3692 * [] |
|
3693 * ); |
|
3694 * const { startSale } = useDispatch( 'my-shop' ); |
|
3695 * const onClick = useCallback( () => { |
|
3696 * const discountPercent = stockNumber > 50 ? 10: 20; |
|
3697 * startSale( discountPercent ); |
|
3698 * }, [ stockNumber ] ); |
|
3699 * return <Button onClick={ onClick }>{ children }</Button> |
|
3700 * } |
|
3701 * |
|
3702 * // Rendered somewhere in the application: |
|
3703 * // |
|
3704 * // <SaleButton>Start Sale!</SaleButton> |
|
3705 * ``` |
|
3706 * @return {Function} A custom react hook. |
|
3707 */ |
|
3708 |
|
3709 var use_dispatch_useDispatch = function useDispatch(storeName) { |
|
3710 var _useRegistry = useRegistry(), |
|
3711 dispatch = _useRegistry.dispatch; |
|
3712 |
|
3713 return storeName === void 0 ? dispatch : dispatch(storeName); |
|
3714 }; |
|
3715 |
|
3716 /* harmony default export */ var use_dispatch = (use_dispatch_useDispatch); |
|
3717 |
|
3718 // CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/factory.js |
|
3719 /** |
|
3720 * Internal dependencies |
|
3721 */ |
|
3722 |
|
3723 /** @typedef {import('./registry').WPDataRegistry} WPDataRegistry */ |
|
3724 |
|
3725 /** |
|
3726 * Mark a selector as a registry selector. |
|
3727 * |
|
3728 * @param {Function} registrySelector Function receiving a registry object and returning a state selector. |
|
3729 * |
|
3730 * @return {Function} marked registry selector. |
|
3731 */ |
|
3732 |
|
3733 function createRegistrySelector(registrySelector) { |
|
3734 var selector = function selector() { |
|
3735 return registrySelector(selector.registry.select).apply(void 0, arguments); |
|
3736 }; |
|
3737 /** |
|
3738 * Flag indicating to selector registration mapping that the selector should |
|
3739 * be mapped as a registry selector. |
|
3740 * |
|
3741 * @type {boolean} |
|
3742 */ |
|
3743 |
|
3744 |
|
3745 selector.isRegistrySelector = true; |
|
3746 /** |
|
3747 * Registry on which to call `select`, stubbed for non-standard usage to |
|
3748 * use the default registry. |
|
3749 * |
|
3750 * @type {WPDataRegistry} |
|
3751 */ |
|
3752 |
|
3753 selector.registry = default_registry; |
|
3754 return selector; |
|
3755 } |
|
3756 /** |
|
3757 * Mark a control as a registry control. |
|
3758 * |
|
3759 * @param {Function} registryControl Function receiving a registry object and returning a control. |
|
3760 * |
|
3761 * @return {Function} marked registry control. |
|
3762 */ |
|
3763 |
|
3764 function createRegistryControl(registryControl) { |
|
3765 registryControl.isRegistryControl = true; |
|
3766 return registryControl; |
|
3767 } |
|
3768 |
|
3769 // CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/index.js |
|
3770 /** |
|
3771 * External dependencies |
|
3772 */ |
|
3773 |
|
3774 /** |
|
3775 * Internal dependencies |
|
3776 */ |
|
3777 |
|
3778 |
|
3779 |
|
3780 |
|
3781 |
|
3782 |
|
3783 |
|
3784 |
|
3785 |
|
3786 |
|
3787 |
|
3788 |
|
3789 /** |
|
3790 * Object of available plugins to use with a registry. |
|
3791 * |
|
3792 * @see [use](#use) |
|
3793 * |
|
3794 * @type {Object} |
|
3795 */ |
|
3796 |
|
3797 |
|
3798 /** |
|
3799 * The combineReducers helper function turns an object whose values are different |
|
3800 * reducing functions into a single reducing function you can pass to registerReducer. |
|
3801 * |
|
3802 * @param {Object} reducers An object whose values correspond to different reducing |
|
3803 * functions that need to be combined into one. |
|
3804 * |
|
3805 * @example |
|
3806 * ```js |
|
3807 * const { combineReducers, registerStore } = wp.data; |
|
3808 * |
|
3809 * const prices = ( state = {}, action ) => { |
|
3810 * return action.type === 'SET_PRICE' ? |
|
3811 * { |
|
3812 * ...state, |
|
3813 * [ action.item ]: action.price, |
|
3814 * } : |
|
3815 * state; |
|
3816 * }; |
|
3817 * |
|
3818 * const discountPercent = ( state = 0, action ) => { |
|
3819 * return action.type === 'START_SALE' ? |
|
3820 * action.discountPercent : |
|
3821 * state; |
|
3822 * }; |
|
3823 * |
|
3824 * registerStore( 'my-shop', { |
|
3825 * reducer: combineReducers( { |
|
3826 * prices, |
|
3827 * discountPercent, |
|
3828 * } ), |
|
3829 * } ); |
|
3830 * ``` |
|
3831 * |
|
3832 * @return {Function} A reducer that invokes every reducer inside the reducers |
|
3833 * object, and constructs a state object with the same shape. |
|
3834 */ |
|
3835 |
|
3836 |
|
3837 /** |
|
3838 * Given the name of a registered store, returns an object of the store's selectors. |
|
3839 * The selector functions are been pre-bound to pass the current state automatically. |
|
3840 * As a consumer, you need only pass arguments of the selector, if applicable. |
|
3841 * |
|
3842 * @param {string} name Store name. |
|
3843 * |
|
3844 * @example |
|
3845 * ```js |
|
3846 * const { select } = wp.data; |
|
3847 * |
|
3848 * select( 'my-shop' ).getPrice( 'hammer' ); |
|
3849 * ``` |
|
3850 * |
|
3851 * @return {Object} Object containing the store's selectors. |
|
3852 */ |
|
3853 |
|
3854 var build_module_select = default_registry.select; |
|
3855 /** |
|
3856 * Given the name of a registered store, returns an object containing the store's |
|
3857 * selectors pre-bound to state so that you only need to supply additional arguments, |
|
3858 * and modified so that they return promises that resolve to their eventual values, |
|
3859 * after any resolvers have ran. |
|
3860 * |
|
3861 * @param {string} name Store name. |
|
3862 * |
|
3863 * @example |
|
3864 * ```js |
|
3865 * const { __experimentalResolveSelect } = wp.data; |
|
3866 * |
|
3867 * __experimentalResolveSelect( 'my-shop' ).getPrice( 'hammer' ).then(console.log) |
|
3868 * ``` |
|
3869 * |
|
3870 * @return {Object} Object containing the store's promise-wrapped selectors. |
|
3871 */ |
|
3872 |
|
3873 var build_module_experimentalResolveSelect = default_registry.__experimentalResolveSelect; |
|
3874 /** |
|
3875 * Given the name of a registered store, returns an object of the store's action creators. |
|
3876 * Calling an action creator will cause it to be dispatched, updating the state value accordingly. |
|
3877 * |
|
3878 * Note: Action creators returned by the dispatch will return a promise when |
|
3879 * they are called. |
|
3880 * |
|
3881 * @param {string} name Store name. |
|
3882 * |
|
3883 * @example |
|
3884 * ```js |
|
3885 * const { dispatch } = wp.data; |
|
3886 * |
|
3887 * dispatch( 'my-shop' ).setPrice( 'hammer', 9.75 ); |
|
3888 * ``` |
|
3889 * @return {Object} Object containing the action creators. |
|
3890 */ |
|
3891 |
|
3892 var build_module_dispatch = default_registry.dispatch; |
|
3893 /** |
|
3894 * Given a listener function, the function will be called any time the state value |
|
3895 * of one of the registered stores has changed. This function returns a `unsubscribe` |
|
3896 * function used to stop the subscription. |
|
3897 * |
|
3898 * @param {Function} listener Callback function. |
|
3899 * |
|
3900 * @example |
|
3901 * ```js |
|
3902 * const { subscribe } = wp.data; |
|
3903 * |
|
3904 * const unsubscribe = subscribe( () => { |
|
3905 * // You could use this opportunity to test whether the derived result of a |
|
3906 * // selector has subsequently changed as the result of a state update. |
|
3907 * } ); |
|
3908 * |
|
3909 * // Later, if necessary... |
|
3910 * unsubscribe(); |
|
3911 * ``` |
|
3912 */ |
|
3913 |
|
3914 var build_module_subscribe = default_registry.subscribe; |
|
3915 /** |
|
3916 * Registers a generic store. |
|
3917 * |
|
3918 * @param {string} key Store registry key. |
|
3919 * @param {Object} config Configuration (getSelectors, getActions, subscribe). |
|
3920 */ |
|
3921 |
|
3922 var build_module_registerGenericStore = default_registry.registerGenericStore; |
|
3923 /** |
|
3924 * Registers a standard `@wordpress/data` store. |
|
3925 * |
|
3926 * @param {string} reducerKey Reducer key. |
|
3927 * @param {Object} options Store description (reducer, actions, selectors, resolvers). |
|
3928 * |
|
3929 * @return {Object} Registered store object. |
|
3930 */ |
|
3931 |
|
3932 var build_module_registerStore = default_registry.registerStore; |
|
3933 /** |
|
3934 * Extends a registry to inherit functionality provided by a given plugin. A |
|
3935 * plugin is an object with properties aligning to that of a registry, merged |
|
3936 * to extend the default registry behavior. |
|
3937 * |
|
3938 * @param {Object} plugin Plugin object. |
|
3939 */ |
|
3940 |
|
3941 var build_module_use = default_registry.use; |
|
3942 |
3877 |
3943 |
3878 /***/ }), |
3944 /***/ }), |
3879 |
3945 |
3880 /***/ 76: |
3946 /***/ 5: |
|
3947 /***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
3948 |
|
3949 "use strict"; |
|
3950 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _defineProperty; }); |
|
3951 function _defineProperty(obj, key, value) { |
|
3952 if (key in obj) { |
|
3953 Object.defineProperty(obj, key, { |
|
3954 value: value, |
|
3955 enumerable: true, |
|
3956 configurable: true, |
|
3957 writable: true |
|
3958 }); |
|
3959 } else { |
|
3960 obj[key] = value; |
|
3961 } |
|
3962 |
|
3963 return obj; |
|
3964 } |
|
3965 |
|
3966 /***/ }), |
|
3967 |
|
3968 /***/ 50: |
|
3969 /***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
3970 |
|
3971 "use strict"; |
|
3972 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _asyncToGenerator; }); |
|
3973 function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { |
|
3974 try { |
|
3975 var info = gen[key](arg); |
|
3976 var value = info.value; |
|
3977 } catch (error) { |
|
3978 reject(error); |
|
3979 return; |
|
3980 } |
|
3981 |
|
3982 if (info.done) { |
|
3983 resolve(value); |
|
3984 } else { |
|
3985 Promise.resolve(value).then(_next, _throw); |
|
3986 } |
|
3987 } |
|
3988 |
|
3989 function _asyncToGenerator(fn) { |
|
3990 return function () { |
|
3991 var self = this, |
|
3992 args = arguments; |
|
3993 return new Promise(function (resolve, reject) { |
|
3994 var gen = fn.apply(self, args); |
|
3995 |
|
3996 function _next(value) { |
|
3997 asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); |
|
3998 } |
|
3999 |
|
4000 function _throw(err) { |
|
4001 asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); |
|
4002 } |
|
4003 |
|
4004 _next(undefined); |
|
4005 }); |
|
4006 }; |
|
4007 } |
|
4008 |
|
4009 /***/ }), |
|
4010 |
|
4011 /***/ 60: |
3881 /***/ (function(module, exports, __webpack_require__) { |
4012 /***/ (function(module, exports, __webpack_require__) { |
3882 |
4013 |
|
4014 /** |
|
4015 * Memize options object. |
|
4016 * |
|
4017 * @typedef MemizeOptions |
|
4018 * |
|
4019 * @property {number} [maxSize] Maximum size of the cache. |
|
4020 */ |
|
4021 |
|
4022 /** |
|
4023 * Internal cache entry. |
|
4024 * |
|
4025 * @typedef MemizeCacheNode |
|
4026 * |
|
4027 * @property {?MemizeCacheNode|undefined} [prev] Previous node. |
|
4028 * @property {?MemizeCacheNode|undefined} [next] Next node. |
|
4029 * @property {Array<*>} args Function arguments for cache |
|
4030 * entry. |
|
4031 * @property {*} val Function result. |
|
4032 */ |
|
4033 |
|
4034 /** |
|
4035 * Properties of the enhanced function for controlling cache. |
|
4036 * |
|
4037 * @typedef MemizeMemoizedFunction |
|
4038 * |
|
4039 * @property {()=>void} clear Clear the cache. |
|
4040 */ |
|
4041 |
|
4042 /** |
|
4043 * Accepts a function to be memoized, and returns a new memoized function, with |
|
4044 * optional options. |
|
4045 * |
|
4046 * @template {Function} F |
|
4047 * |
|
4048 * @param {F} fn Function to memoize. |
|
4049 * @param {MemizeOptions} [options] Options object. |
|
4050 * |
|
4051 * @return {F & MemizeMemoizedFunction} Memoized function. |
|
4052 */ |
|
4053 function memize( fn, options ) { |
|
4054 var size = 0; |
|
4055 |
|
4056 /** @type {?MemizeCacheNode|undefined} */ |
|
4057 var head; |
|
4058 |
|
4059 /** @type {?MemizeCacheNode|undefined} */ |
|
4060 var tail; |
|
4061 |
|
4062 options = options || {}; |
|
4063 |
|
4064 function memoized( /* ...args */ ) { |
|
4065 var node = head, |
|
4066 len = arguments.length, |
|
4067 args, i; |
|
4068 |
|
4069 searchCache: while ( node ) { |
|
4070 // Perform a shallow equality test to confirm that whether the node |
|
4071 // under test is a candidate for the arguments passed. Two arrays |
|
4072 // are shallowly equal if their length matches and each entry is |
|
4073 // strictly equal between the two sets. Avoid abstracting to a |
|
4074 // function which could incur an arguments leaking deoptimization. |
|
4075 |
|
4076 // Check whether node arguments match arguments length |
|
4077 if ( node.args.length !== arguments.length ) { |
|
4078 node = node.next; |
|
4079 continue; |
|
4080 } |
|
4081 |
|
4082 // Check whether node arguments match arguments values |
|
4083 for ( i = 0; i < len; i++ ) { |
|
4084 if ( node.args[ i ] !== arguments[ i ] ) { |
|
4085 node = node.next; |
|
4086 continue searchCache; |
|
4087 } |
|
4088 } |
|
4089 |
|
4090 // At this point we can assume we've found a match |
|
4091 |
|
4092 // Surface matched node to head if not already |
|
4093 if ( node !== head ) { |
|
4094 // As tail, shift to previous. Must only shift if not also |
|
4095 // head, since if both head and tail, there is no previous. |
|
4096 if ( node === tail ) { |
|
4097 tail = node.prev; |
|
4098 } |
|
4099 |
|
4100 // Adjust siblings to point to each other. If node was tail, |
|
4101 // this also handles new tail's empty `next` assignment. |
|
4102 /** @type {MemizeCacheNode} */ ( node.prev ).next = node.next; |
|
4103 if ( node.next ) { |
|
4104 node.next.prev = node.prev; |
|
4105 } |
|
4106 |
|
4107 node.next = head; |
|
4108 node.prev = null; |
|
4109 /** @type {MemizeCacheNode} */ ( head ).prev = node; |
|
4110 head = node; |
|
4111 } |
|
4112 |
|
4113 // Return immediately |
|
4114 return node.val; |
|
4115 } |
|
4116 |
|
4117 // No cached value found. Continue to insertion phase: |
|
4118 |
|
4119 // Create a copy of arguments (avoid leaking deoptimization) |
|
4120 args = new Array( len ); |
|
4121 for ( i = 0; i < len; i++ ) { |
|
4122 args[ i ] = arguments[ i ]; |
|
4123 } |
|
4124 |
|
4125 node = { |
|
4126 args: args, |
|
4127 |
|
4128 // Generate the result from original function |
|
4129 val: fn.apply( null, args ), |
|
4130 }; |
|
4131 |
|
4132 // Don't need to check whether node is already head, since it would |
|
4133 // have been returned above already if it was |
|
4134 |
|
4135 // Shift existing head down list |
|
4136 if ( head ) { |
|
4137 head.prev = node; |
|
4138 node.next = head; |
|
4139 } else { |
|
4140 // If no head, follows that there's no tail (at initial or reset) |
|
4141 tail = node; |
|
4142 } |
|
4143 |
|
4144 // Trim tail if we're reached max size and are pending cache insertion |
|
4145 if ( size === /** @type {MemizeOptions} */ ( options ).maxSize ) { |
|
4146 tail = /** @type {MemizeCacheNode} */ ( tail ).prev; |
|
4147 /** @type {MemizeCacheNode} */ ( tail ).next = null; |
|
4148 } else { |
|
4149 size++; |
|
4150 } |
|
4151 |
|
4152 head = node; |
|
4153 |
|
4154 return node.val; |
|
4155 } |
|
4156 |
|
4157 memoized.clear = function() { |
|
4158 head = null; |
|
4159 tail = null; |
|
4160 size = 0; |
|
4161 }; |
|
4162 |
|
4163 if ( false ) {} |
|
4164 |
|
4165 // Ignore reason: There's not a clear solution to create an intersection of |
|
4166 // the function with additional properties, where the goal is to retain the |
|
4167 // function signature of the incoming argument and add control properties |
|
4168 // on the return value. |
|
4169 |
|
4170 // @ts-ignore |
|
4171 return memoized; |
|
4172 } |
|
4173 |
|
4174 module.exports = memize; |
|
4175 |
|
4176 |
|
4177 /***/ }), |
|
4178 |
|
4179 /***/ 64: |
|
4180 /***/ (function(module, exports) { |
|
4181 |
|
4182 (function() { module.exports = this["wp"]["isShallowEqual"]; }()); |
|
4183 |
|
4184 /***/ }), |
|
4185 |
|
4186 /***/ 8: |
|
4187 /***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
4188 |
3883 "use strict"; |
4189 "use strict"; |
3884 |
4190 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _extends; }); |
3885 |
4191 function _extends() { |
3886 function _typeof(obj) { |
4192 _extends = Object.assign || function (target) { |
3887 if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { |
4193 for (var i = 1; i < arguments.length; i++) { |
3888 _typeof = function (obj) { |
4194 var source = arguments[i]; |
3889 return typeof obj; |
4195 |
3890 }; |
4196 for (var key in source) { |
3891 } else { |
4197 if (Object.prototype.hasOwnProperty.call(source, key)) { |
3892 _typeof = function (obj) { |
4198 target[key] = source[key]; |
3893 return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; |
4199 } |
3894 }; |
|
3895 } |
|
3896 |
|
3897 return _typeof(obj); |
|
3898 } |
|
3899 |
|
3900 function _classCallCheck(instance, Constructor) { |
|
3901 if (!(instance instanceof Constructor)) { |
|
3902 throw new TypeError("Cannot call a class as a function"); |
|
3903 } |
|
3904 } |
|
3905 |
|
3906 function _defineProperties(target, props) { |
|
3907 for (var i = 0; i < props.length; i++) { |
|
3908 var descriptor = props[i]; |
|
3909 descriptor.enumerable = descriptor.enumerable || false; |
|
3910 descriptor.configurable = true; |
|
3911 if ("value" in descriptor) descriptor.writable = true; |
|
3912 Object.defineProperty(target, descriptor.key, descriptor); |
|
3913 } |
|
3914 } |
|
3915 |
|
3916 function _createClass(Constructor, protoProps, staticProps) { |
|
3917 if (protoProps) _defineProperties(Constructor.prototype, protoProps); |
|
3918 if (staticProps) _defineProperties(Constructor, staticProps); |
|
3919 return Constructor; |
|
3920 } |
|
3921 |
|
3922 /** |
|
3923 * Given an instance of EquivalentKeyMap, returns its internal value pair tuple |
|
3924 * for a key, if one exists. The tuple members consist of the last reference |
|
3925 * value for the key (used in efficient subsequent lookups) and the value |
|
3926 * assigned for the key at the leaf node. |
|
3927 * |
|
3928 * @param {EquivalentKeyMap} instance EquivalentKeyMap instance. |
|
3929 * @param {*} key The key for which to return value pair. |
|
3930 * |
|
3931 * @return {?Array} Value pair, if exists. |
|
3932 */ |
|
3933 function getValuePair(instance, key) { |
|
3934 var _map = instance._map, |
|
3935 _arrayTreeMap = instance._arrayTreeMap, |
|
3936 _objectTreeMap = instance._objectTreeMap; // Map keeps a reference to the last object-like key used to set the |
|
3937 // value, which can be used to shortcut immediately to the value. |
|
3938 |
|
3939 if (_map.has(key)) { |
|
3940 return _map.get(key); |
|
3941 } // Sort keys to ensure stable retrieval from tree. |
|
3942 |
|
3943 |
|
3944 var properties = Object.keys(key).sort(); // Tree by type to avoid conflicts on numeric object keys, empty value. |
|
3945 |
|
3946 var map = Array.isArray(key) ? _arrayTreeMap : _objectTreeMap; |
|
3947 |
|
3948 for (var i = 0; i < properties.length; i++) { |
|
3949 var property = properties[i]; |
|
3950 map = map.get(property); |
|
3951 |
|
3952 if (map === undefined) { |
|
3953 return; |
|
3954 } |
|
3955 |
|
3956 var propertyValue = key[property]; |
|
3957 map = map.get(propertyValue); |
|
3958 |
|
3959 if (map === undefined) { |
|
3960 return; |
|
3961 } |
|
3962 } |
|
3963 |
|
3964 var valuePair = map.get('_ekm_value'); |
|
3965 |
|
3966 if (!valuePair) { |
|
3967 return; |
|
3968 } // If reached, it implies that an object-like key was set with another |
|
3969 // reference, so delete the reference and replace with the current. |
|
3970 |
|
3971 |
|
3972 _map.delete(valuePair[0]); |
|
3973 |
|
3974 valuePair[0] = key; |
|
3975 map.set('_ekm_value', valuePair); |
|
3976 |
|
3977 _map.set(key, valuePair); |
|
3978 |
|
3979 return valuePair; |
|
3980 } |
|
3981 /** |
|
3982 * Variant of a Map object which enables lookup by equivalent (deeply equal) |
|
3983 * object and array keys. |
|
3984 */ |
|
3985 |
|
3986 |
|
3987 var EquivalentKeyMap = |
|
3988 /*#__PURE__*/ |
|
3989 function () { |
|
3990 /** |
|
3991 * Constructs a new instance of EquivalentKeyMap. |
|
3992 * |
|
3993 * @param {Iterable.<*>} iterable Initial pair of key, value for map. |
|
3994 */ |
|
3995 function EquivalentKeyMap(iterable) { |
|
3996 _classCallCheck(this, EquivalentKeyMap); |
|
3997 |
|
3998 this.clear(); |
|
3999 |
|
4000 if (iterable instanceof EquivalentKeyMap) { |
|
4001 // Map#forEach is only means of iterating with support for IE11. |
|
4002 var iterablePairs = []; |
|
4003 iterable.forEach(function (value, key) { |
|
4004 iterablePairs.push([key, value]); |
|
4005 }); |
|
4006 iterable = iterablePairs; |
|
4007 } |
|
4008 |
|
4009 if (iterable != null) { |
|
4010 for (var i = 0; i < iterable.length; i++) { |
|
4011 this.set(iterable[i][0], iterable[i][1]); |
|
4012 } |
4200 } |
4013 } |
4201 } |
4014 } |
4202 |
4015 /** |
4203 return target; |
4016 * Accessor property returning the number of elements. |
4204 }; |
4017 * |
4205 |
4018 * @return {number} Number of elements. |
4206 return _extends.apply(this, arguments); |
4019 */ |
4207 } |
4020 |
|
4021 |
|
4022 _createClass(EquivalentKeyMap, [{ |
|
4023 key: "set", |
|
4024 |
|
4025 /** |
|
4026 * Add or update an element with a specified key and value. |
|
4027 * |
|
4028 * @param {*} key The key of the element to add. |
|
4029 * @param {*} value The value of the element to add. |
|
4030 * |
|
4031 * @return {EquivalentKeyMap} Map instance. |
|
4032 */ |
|
4033 value: function set(key, value) { |
|
4034 // Shortcut non-object-like to set on internal Map. |
|
4035 if (key === null || _typeof(key) !== 'object') { |
|
4036 this._map.set(key, value); |
|
4037 |
|
4038 return this; |
|
4039 } // Sort keys to ensure stable assignment into tree. |
|
4040 |
|
4041 |
|
4042 var properties = Object.keys(key).sort(); |
|
4043 var valuePair = [key, value]; // Tree by type to avoid conflicts on numeric object keys, empty value. |
|
4044 |
|
4045 var map = Array.isArray(key) ? this._arrayTreeMap : this._objectTreeMap; |
|
4046 |
|
4047 for (var i = 0; i < properties.length; i++) { |
|
4048 var property = properties[i]; |
|
4049 |
|
4050 if (!map.has(property)) { |
|
4051 map.set(property, new EquivalentKeyMap()); |
|
4052 } |
|
4053 |
|
4054 map = map.get(property); |
|
4055 var propertyValue = key[property]; |
|
4056 |
|
4057 if (!map.has(propertyValue)) { |
|
4058 map.set(propertyValue, new EquivalentKeyMap()); |
|
4059 } |
|
4060 |
|
4061 map = map.get(propertyValue); |
|
4062 } // If an _ekm_value exists, there was already an equivalent key. Before |
|
4063 // overriding, ensure that the old key reference is removed from map to |
|
4064 // avoid memory leak of accumulating equivalent keys. This is, in a |
|
4065 // sense, a poor man's WeakMap, while still enabling iterability. |
|
4066 |
|
4067 |
|
4068 var previousValuePair = map.get('_ekm_value'); |
|
4069 |
|
4070 if (previousValuePair) { |
|
4071 this._map.delete(previousValuePair[0]); |
|
4072 } |
|
4073 |
|
4074 map.set('_ekm_value', valuePair); |
|
4075 |
|
4076 this._map.set(key, valuePair); |
|
4077 |
|
4078 return this; |
|
4079 } |
|
4080 /** |
|
4081 * Returns a specified element. |
|
4082 * |
|
4083 * @param {*} key The key of the element to return. |
|
4084 * |
|
4085 * @return {?*} The element associated with the specified key or undefined |
|
4086 * if the key can't be found. |
|
4087 */ |
|
4088 |
|
4089 }, { |
|
4090 key: "get", |
|
4091 value: function get(key) { |
|
4092 // Shortcut non-object-like to get from internal Map. |
|
4093 if (key === null || _typeof(key) !== 'object') { |
|
4094 return this._map.get(key); |
|
4095 } |
|
4096 |
|
4097 var valuePair = getValuePair(this, key); |
|
4098 |
|
4099 if (valuePair) { |
|
4100 return valuePair[1]; |
|
4101 } |
|
4102 } |
|
4103 /** |
|
4104 * Returns a boolean indicating whether an element with the specified key |
|
4105 * exists or not. |
|
4106 * |
|
4107 * @param {*} key The key of the element to test for presence. |
|
4108 * |
|
4109 * @return {boolean} Whether an element with the specified key exists. |
|
4110 */ |
|
4111 |
|
4112 }, { |
|
4113 key: "has", |
|
4114 value: function has(key) { |
|
4115 if (key === null || _typeof(key) !== 'object') { |
|
4116 return this._map.has(key); |
|
4117 } // Test on the _presence_ of the pair, not its value, as even undefined |
|
4118 // can be a valid member value for a key. |
|
4119 |
|
4120 |
|
4121 return getValuePair(this, key) !== undefined; |
|
4122 } |
|
4123 /** |
|
4124 * Removes the specified element. |
|
4125 * |
|
4126 * @param {*} key The key of the element to remove. |
|
4127 * |
|
4128 * @return {boolean} Returns true if an element existed and has been |
|
4129 * removed, or false if the element does not exist. |
|
4130 */ |
|
4131 |
|
4132 }, { |
|
4133 key: "delete", |
|
4134 value: function _delete(key) { |
|
4135 if (!this.has(key)) { |
|
4136 return false; |
|
4137 } // This naive implementation will leave orphaned child trees. A better |
|
4138 // implementation should traverse and remove orphans. |
|
4139 |
|
4140 |
|
4141 this.set(key, undefined); |
|
4142 return true; |
|
4143 } |
|
4144 /** |
|
4145 * Executes a provided function once per each key/value pair, in insertion |
|
4146 * order. |
|
4147 * |
|
4148 * @param {Function} callback Function to execute for each element. |
|
4149 * @param {*} thisArg Value to use as `this` when executing |
|
4150 * `callback`. |
|
4151 */ |
|
4152 |
|
4153 }, { |
|
4154 key: "forEach", |
|
4155 value: function forEach(callback) { |
|
4156 var _this = this; |
|
4157 |
|
4158 var thisArg = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this; |
|
4159 |
|
4160 this._map.forEach(function (value, key) { |
|
4161 // Unwrap value from object-like value pair. |
|
4162 if (key !== null && _typeof(key) === 'object') { |
|
4163 value = value[1]; |
|
4164 } |
|
4165 |
|
4166 callback.call(thisArg, value, key, _this); |
|
4167 }); |
|
4168 } |
|
4169 /** |
|
4170 * Removes all elements. |
|
4171 */ |
|
4172 |
|
4173 }, { |
|
4174 key: "clear", |
|
4175 value: function clear() { |
|
4176 this._map = new Map(); |
|
4177 this._arrayTreeMap = new Map(); |
|
4178 this._objectTreeMap = new Map(); |
|
4179 } |
|
4180 }, { |
|
4181 key: "size", |
|
4182 get: function get() { |
|
4183 return this._map.size; |
|
4184 } |
|
4185 }]); |
|
4186 |
|
4187 return EquivalentKeyMap; |
|
4188 }(); |
|
4189 |
|
4190 module.exports = EquivalentKeyMap; |
|
4191 |
|
4192 |
4208 |
4193 /***/ }), |
4209 /***/ }), |
4194 |
4210 |
4195 /***/ 77: |
|
4196 /***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
4197 |
|
4198 "use strict"; |
|
4199 /* WEBPACK VAR INJECTION */(function(global, module) {/* harmony import */ var _ponyfill_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(99); |
|
4200 /* global window */ |
|
4201 |
|
4202 |
|
4203 var root; |
|
4204 |
|
4205 if (typeof self !== 'undefined') { |
|
4206 root = self; |
|
4207 } else if (typeof window !== 'undefined') { |
|
4208 root = window; |
|
4209 } else if (typeof global !== 'undefined') { |
|
4210 root = global; |
|
4211 } else if (true) { |
|
4212 root = module; |
|
4213 } else {} |
|
4214 |
|
4215 var result = Object(_ponyfill_js__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])(root); |
|
4216 /* harmony default export */ __webpack_exports__["a"] = (result); |
|
4217 |
|
4218 /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(59), __webpack_require__(132)(module))) |
|
4219 |
|
4220 /***/ }), |
|
4221 |
|
4222 /***/ 9: |
4211 /***/ 9: |
4223 /***/ (function(module, __webpack_exports__, __webpack_require__) { |
4212 /***/ (function(module, exports) { |
4224 |
4213 |
4225 "use strict"; |
4214 (function() { module.exports = this["wp"]["compose"]; }()); |
4226 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _createClass; }); |
|
4227 function _defineProperties(target, props) { |
|
4228 for (var i = 0; i < props.length; i++) { |
|
4229 var descriptor = props[i]; |
|
4230 descriptor.enumerable = descriptor.enumerable || false; |
|
4231 descriptor.configurable = true; |
|
4232 if ("value" in descriptor) descriptor.writable = true; |
|
4233 Object.defineProperty(target, descriptor.key, descriptor); |
|
4234 } |
|
4235 } |
|
4236 |
|
4237 function _createClass(Constructor, protoProps, staticProps) { |
|
4238 if (protoProps) _defineProperties(Constructor.prototype, protoProps); |
|
4239 if (staticProps) _defineProperties(Constructor, staticProps); |
|
4240 return Constructor; |
|
4241 } |
|
4242 |
|
4243 /***/ }), |
|
4244 |
|
4245 /***/ 99: |
|
4246 /***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
4247 |
|
4248 "use strict"; |
|
4249 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return symbolObservablePonyfill; }); |
|
4250 function symbolObservablePonyfill(root) { |
|
4251 var result; |
|
4252 var Symbol = root.Symbol; |
|
4253 |
|
4254 if (typeof Symbol === 'function') { |
|
4255 if (Symbol.observable) { |
|
4256 result = Symbol.observable; |
|
4257 } else { |
|
4258 result = Symbol('observable'); |
|
4259 Symbol.observable = result; |
|
4260 } |
|
4261 } else { |
|
4262 result = '@@observable'; |
|
4263 } |
|
4264 |
|
4265 return result; |
|
4266 }; |
|
4267 |
|
4268 |
4215 |
4269 /***/ }) |
4216 /***/ }) |
4270 |
4217 |
4271 /******/ }); |
4218 /******/ }); |