2018-12-14 05:41:57 +01:00
this [ "wp" ] = this [ "wp" ] || { } ; this [ "wp" ] [ "data" ] =
/******/ ( function ( modules ) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = { } ;
/******/
/******/ // The require function
/******/ function _ _webpack _require _ _ ( moduleId ) {
/******/
/******/ // Check if module is in cache
/******/ if ( installedModules [ moduleId ] ) {
/******/ return installedModules [ moduleId ] . exports ;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = installedModules [ moduleId ] = {
/******/ i : moduleId ,
/******/ l : false ,
/******/ exports : { }
/******/ } ;
/******/
/******/ // Execute the module function
/******/ modules [ moduleId ] . call ( module . exports , module , module . exports , _ _webpack _require _ _ ) ;
/******/
/******/ // Flag the module as loaded
/******/ module . l = true ;
/******/
/******/ // Return the exports of the module
/******/ return module . exports ;
/******/ }
/******/
/******/
/******/ // expose the modules object (__webpack_modules__)
/******/ _ _webpack _require _ _ . m = modules ;
/******/
/******/ // expose the module cache
/******/ _ _webpack _require _ _ . c = installedModules ;
/******/
/******/ // define getter function for harmony exports
/******/ _ _webpack _require _ _ . d = function ( exports , name , getter ) {
/******/ if ( ! _ _webpack _require _ _ . o ( exports , name ) ) {
/******/ Object . defineProperty ( exports , name , { enumerable : true , get : getter } ) ;
/******/ }
/******/ } ;
/******/
/******/ // define __esModule on exports
/******/ _ _webpack _require _ _ . r = function ( exports ) {
/******/ if ( typeof Symbol !== 'undefined' && Symbol . toStringTag ) {
/******/ Object . defineProperty ( exports , Symbol . toStringTag , { value : 'Module' } ) ;
/******/ }
/******/ Object . defineProperty ( exports , '__esModule' , { value : true } ) ;
/******/ } ;
/******/
/******/ // create a fake namespace object
/******/ // mode & 1: value is a module id, require it
/******/ // mode & 2: merge all properties of value into the ns
/******/ // mode & 4: return value when already ns object
/******/ // mode & 8|1: behave like require
/******/ _ _webpack _require _ _ . t = function ( value , mode ) {
/******/ if ( mode & 1 ) value = _ _webpack _require _ _ ( value ) ;
/******/ if ( mode & 8 ) return value ;
/******/ if ( ( mode & 4 ) && typeof value === 'object' && value && value . _ _esModule ) return value ;
/******/ var ns = Object . create ( null ) ;
/******/ _ _webpack _require _ _ . r ( ns ) ;
/******/ Object . defineProperty ( ns , 'default' , { enumerable : true , value : value } ) ;
/******/ if ( mode & 2 && typeof value != 'string' ) for ( var key in value ) _ _webpack _require _ _ . d ( ns , key , function ( key ) { return value [ key ] ; } . bind ( null , key ) ) ;
/******/ return ns ;
/******/ } ;
/******/
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ _ _webpack _require _ _ . n = function ( module ) {
/******/ var getter = module && module . _ _esModule ?
/******/ function getDefault ( ) { return module [ 'default' ] ; } :
/******/ function getModuleExports ( ) { return module ; } ;
/******/ _ _webpack _require _ _ . d ( getter , 'a' , getter ) ;
/******/ return getter ;
/******/ } ;
/******/
/******/ // Object.prototype.hasOwnProperty.call
/******/ _ _webpack _require _ _ . o = function ( object , property ) { return Object . prototype . hasOwnProperty . call ( object , property ) ; } ;
/******/
/******/ // __webpack_public_path__
/******/ _ _webpack _require _ _ . p = "" ;
/******/
/******/
/******/ // Load entry module and return exports
2018-12-18 04:14:52 +01:00
/******/ return _ _webpack _require _ _ ( _ _webpack _require _ _ . s = 309 ) ;
2018-12-14 05:41:57 +01:00
/******/ } )
/************************************************************************/
/******/ ( {
2018-12-18 04:14:52 +01:00
/***/ 0 :
/***/ ( function ( module , exports ) {
2018-12-14 05:41:57 +01:00
2018-12-18 04:14:52 +01:00
( function ( ) { module . exports = this [ "wp" ] [ "element" ] ; } ( ) ) ;
2018-12-14 05:41:57 +01:00
/***/ } ) ,
2018-12-18 04:14:52 +01:00
/***/ 10 :
2018-12-14 05:41:57 +01:00
/***/ ( function ( module , _ _webpack _exports _ _ , _ _webpack _require _ _ ) {
"use strict" ;
2018-12-18 04:14:52 +01:00
/* harmony export (binding) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "a" , function ( ) { return _classCallCheck ; } ) ;
function _classCallCheck ( instance , Constructor ) {
if ( ! ( instance instanceof Constructor ) ) {
throw new TypeError ( "Cannot call a class as a function" ) ;
2018-12-14 12:02:53 +01:00
}
2018-12-14 05:41:57 +01:00
}
/***/ } ) ,
2018-12-18 04:14:52 +01:00
/***/ 12 :
2018-12-14 05:41:57 +01:00
/***/ ( function ( module , _ _webpack _exports _ _ , _ _webpack _require _ _ ) {
"use strict" ;
2018-12-18 04:14:52 +01:00
/* harmony export (binding) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "a" , function ( ) { return _possibleConstructorReturn ; } ) ;
/* harmony import */ var _helpers _esm _typeof _ _WEBPACK _IMPORTED _MODULE _0 _ _ = _ _webpack _require _ _ ( 28 ) ;
/* harmony import */ var _assertThisInitialized _ _WEBPACK _IMPORTED _MODULE _1 _ _ = _ _webpack _require _ _ ( 3 ) ;
2018-12-14 05:41:57 +01:00
2018-12-18 04:14:52 +01:00
function _possibleConstructorReturn ( self , call ) {
if ( call && ( Object ( _helpers _esm _typeof _ _WEBPACK _IMPORTED _MODULE _0 _ _ [ /* default */ "a" ] ) ( call ) === "object" || typeof call === "function" ) ) {
return call ;
2018-12-14 05:41:57 +01:00
}
2018-12-18 04:14:52 +01:00
return Object ( _assertThisInitialized _ _WEBPACK _IMPORTED _MODULE _1 _ _ [ /* default */ "a" ] ) ( self ) ;
2018-12-14 05:41:57 +01:00
}
2018-12-18 04:14:52 +01:00
/***/ } ) ,
2018-12-14 05:41:57 +01:00
2018-12-18 04:14:52 +01:00
/***/ 120 :
/***/ ( function ( module , exports ) {
2018-12-14 05:41:57 +01:00
2018-12-18 04:14:52 +01:00
module . exports = function ( originalModule ) {
if ( ! originalModule . webpackPolyfill ) {
var module = Object . create ( originalModule ) ;
// module.parent = undefined by default
if ( ! module . children ) module . children = [ ] ;
Object . defineProperty ( module , "loaded" , {
enumerable : true ,
get : function ( ) {
return module . l ;
}
} ) ;
Object . defineProperty ( module , "id" , {
enumerable : true ,
get : function ( ) {
return module . i ;
}
} ) ;
Object . defineProperty ( module , "exports" , {
enumerable : true
} ) ;
module . webpackPolyfill = 1 ;
}
return module ;
} ;
2018-12-14 05:41:57 +01:00
/***/ } ) ,
2018-12-18 04:14:52 +01:00
/***/ 13 :
2018-12-14 05:41:57 +01:00
/***/ ( function ( module , _ _webpack _exports _ _ , _ _webpack _require _ _ ) {
"use strict" ;
2018-12-18 04:14:52 +01:00
/* harmony export (binding) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "a" , function ( ) { return _getPrototypeOf ; } ) ;
function _getPrototypeOf ( o ) {
_getPrototypeOf = Object . setPrototypeOf ? Object . getPrototypeOf : function _getPrototypeOf ( o ) {
return o . _ _proto _ _ || Object . getPrototypeOf ( o ) ;
} ;
return _getPrototypeOf ( o ) ;
2018-12-14 05:41:57 +01:00
}
/***/ } ) ,
2018-12-18 04:14:52 +01:00
/***/ 14 :
2018-12-14 05:41:57 +01:00
/***/ ( function ( module , _ _webpack _exports _ _ , _ _webpack _require _ _ ) {
"use strict" ;
2018-12-18 04:14:52 +01:00
// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js
function _setPrototypeOf ( o , p ) {
_setPrototypeOf = Object . setPrototypeOf || function _setPrototypeOf ( o , p ) {
o . _ _proto _ _ = p ;
return o ;
} ;
return _setPrototypeOf ( o , p ) ;
2018-12-14 05:41:57 +01:00
}
2018-12-18 04:14:52 +01:00
// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/inherits.js
/* harmony export (binding) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "a" , function ( ) { return _inherits ; } ) ;
2018-12-14 05:41:57 +01:00
2018-12-18 04:14:52 +01:00
function _inherits ( subClass , superClass ) {
if ( typeof superClass !== "function" && superClass !== null ) {
throw new TypeError ( "Super expression must either be null or a function" ) ;
}
subClass . prototype = Object . create ( superClass && superClass . prototype , {
constructor : {
value : subClass ,
writable : true ,
configurable : true
}
} ) ;
if ( superClass ) _setPrototypeOf ( subClass , superClass ) ;
2018-12-14 05:41:57 +01:00
}
/***/ } ) ,
2018-12-18 04:14:52 +01:00
/***/ 15 :
2018-12-14 05:41:57 +01:00
/***/ ( function ( module , _ _webpack _exports _ _ , _ _webpack _require _ _ ) {
"use strict" ;
2018-12-18 04:14:52 +01:00
/* harmony export (binding) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "a" , function ( ) { return _defineProperty ; } ) ;
2018-12-14 05:41:57 +01:00
function _defineProperty ( obj , key , value ) {
if ( key in obj ) {
Object . defineProperty ( obj , key , {
value : value ,
enumerable : true ,
configurable : true ,
writable : true
} ) ;
} else {
obj [ key ] = value ;
}
return obj ;
}
/***/ } ) ,
2018-12-18 04:14:52 +01:00
/***/ 173 :
/***/ ( function ( module , exports ) {
function combineReducers ( reducers ) {
var keys = Object . keys ( reducers ) ,
getNextState ;
getNextState = ( function ( ) {
var fn , i , key ;
fn = 'return {' ;
for ( i = 0 ; i < keys . length ; i ++ ) {
// Rely on Quoted escaping of JSON.stringify with guarantee that
// each member of Object.keys is a string.
//
// "If Type(value) is String, then return the result of calling the
// abstract operation Quote with argument value. [...] The abstract
// operation Quote(value) wraps a String value in double quotes and
// escapes characters within it."
//
// https://www.ecma-international.org/ecma-262/5.1/#sec-15.12.3
key = JSON . stringify ( keys [ i ] ) ;
fn += key + ':r[' + key + '](s[' + key + '],a),' ;
}
fn += '}' ;
return new Function ( 'r,s,a' , fn ) ;
} ) ( ) ;
return function combinedReducer ( state , action ) {
var nextState , i , key ;
// Assumed changed if initial state.
if ( state === undefined ) {
return getNextState ( reducers , { } , action ) ;
}
nextState = getNextState ( reducers , state , action ) ;
// Determine whether state has changed.
i = keys . length ;
while ( i -- ) {
key = keys [ i ] ;
if ( state [ key ] !== nextState [ key ] ) {
// Return immediately if a changed value is encountered.
return nextState ;
}
}
return state ;
} ;
}
module . exports = combineReducers ;
/***/ } ) ,
/***/ 18 :
2018-12-14 05:41:57 +01:00
/***/ ( function ( module , _ _webpack _exports _ _ , _ _webpack _require _ _ ) {
"use strict" ;
2018-12-18 04:14:52 +01:00
/* harmony export (binding) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "a" , function ( ) { return _extends ; } ) ;
2018-12-14 05:41:57 +01:00
function _extends ( ) {
_extends = Object . assign || function ( target ) {
for ( var i = 1 ; i < arguments . length ; i ++ ) {
var source = arguments [ i ] ;
for ( var key in source ) {
if ( Object . prototype . hasOwnProperty . call ( source , key ) ) {
target [ key ] = source [ key ] ;
}
}
}
return target ;
} ;
return _extends . apply ( this , arguments ) ;
}
/***/ } ) ,
2018-12-18 04:14:52 +01:00
/***/ 188 :
/***/ ( function ( module , exports ) {
2018-12-14 05:41:57 +01:00
2018-12-18 04:14:52 +01:00
( function ( ) { module . exports = this [ "wp" ] [ "reduxRoutine" ] ; } ( ) ) ;
2018-12-14 05:41:57 +01:00
/***/ } ) ,
2018-12-18 04:14:52 +01:00
/***/ 19 :
2018-12-14 05:41:57 +01:00
/***/ ( function ( module , _ _webpack _exports _ _ , _ _webpack _require _ _ ) {
"use strict" ;
2018-12-18 04:14:52 +01:00
// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/arrayWithoutHoles.js
function _arrayWithoutHoles ( arr ) {
if ( Array . isArray ( arr ) ) {
for ( var i = 0 , arr2 = new Array ( arr . length ) ; i < arr . length ; i ++ ) {
arr2 [ i ] = arr [ i ] ;
}
return arr2 ;
2018-12-14 05:41:57 +01:00
}
2018-12-18 04:14:52 +01:00
}
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/iterableToArray.js
2018-12-19 04:16:48 +01:00
var iterableToArray = _ _webpack _require _ _ ( 33 ) ;
2018-12-14 05:41:57 +01:00
2018-12-18 04:14:52 +01:00
// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/nonIterableSpread.js
function _nonIterableSpread ( ) {
throw new TypeError ( "Invalid attempt to spread non-iterable instance" ) ;
2018-12-14 05:41:57 +01:00
}
2018-12-18 04:14:52 +01:00
// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js
/* harmony export (binding) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "a" , function ( ) { return _toConsumableArray ; } ) ;
2018-12-14 05:41:57 +01:00
2018-12-14 12:02:53 +01:00
2018-12-18 04:14:52 +01:00
function _toConsumableArray ( arr ) {
return _arrayWithoutHoles ( arr ) || Object ( iterableToArray [ "a" /* default */ ] ) ( arr ) || _nonIterableSpread ( ) ;
2018-12-14 12:02:53 +01:00
}
/***/ } ) ,
2018-12-18 04:14:52 +01:00
/***/ 2 :
/***/ ( function ( module , exports ) {
( function ( ) { module . exports = this [ "lodash" ] ; } ( ) ) ;
/***/ } ) ,
/***/ 25 :
2018-12-14 05:41:57 +01:00
/***/ ( function ( module , _ _webpack _exports _ _ , _ _webpack _require _ _ ) {
"use strict" ;
2018-12-18 04:14:52 +01:00
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js
var arrayWithHoles = _ _webpack _require _ _ ( 35 ) ;
// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js
2018-12-14 05:41:57 +01:00
function _iterableToArrayLimit ( arr , i ) {
var _arr = [ ] ;
var _n = true ;
var _d = false ;
var _e = undefined ;
try {
for ( var _i = arr [ Symbol . iterator ] ( ) , _s ; ! ( _n = ( _s = _i . next ( ) ) . done ) ; _n = true ) {
_arr . push ( _s . value ) ;
if ( i && _arr . length === i ) break ;
}
} catch ( err ) {
_d = true ;
_e = err ;
} finally {
try {
if ( ! _n && _i [ "return" ] != null ) _i [ "return" ] ( ) ;
} finally {
if ( _d ) throw _e ;
}
}
return _arr ;
}
2018-12-18 04:14:52 +01:00
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/nonIterableRest.js
var nonIterableRest = _ _webpack _require _ _ ( 36 ) ;
2018-12-14 05:41:57 +01:00
2018-12-18 04:14:52 +01:00
// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/slicedToArray.js
/* harmony export (binding) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "a" , function ( ) { return _slicedToArray ; } ) ;
2018-12-14 05:41:57 +01:00
2018-12-14 12:02:53 +01:00
2018-12-18 04:14:52 +01:00
function _slicedToArray ( arr , i ) {
return Object ( arrayWithHoles [ "a" /* default */ ] ) ( arr ) || _iterableToArrayLimit ( arr , i ) || Object ( nonIterableRest [ "a" /* default */ ] ) ( ) ;
2018-12-14 12:02:53 +01:00
}
/***/ } ) ,
2018-12-18 04:14:52 +01:00
/***/ 28 :
2018-12-14 05:41:57 +01:00
/***/ ( function ( module , _ _webpack _exports _ _ , _ _webpack _require _ _ ) {
"use strict" ;
2018-12-18 04:14:52 +01:00
/* harmony export (binding) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "a" , function ( ) { return _typeof ; } ) ;
2018-12-14 05:41:57 +01:00
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 ) ; }
function _typeof ( obj ) {
if ( typeof Symbol === "function" && _typeof2 ( Symbol . iterator ) === "symbol" ) {
_typeof = function _typeof ( obj ) {
return _typeof2 ( obj ) ;
} ;
} else {
_typeof = function _typeof ( obj ) {
return obj && typeof Symbol === "function" && obj . constructor === Symbol && obj !== Symbol . prototype ? "symbol" : _typeof2 ( obj ) ;
} ;
}
return _typeof ( obj ) ;
}
/***/ } ) ,
2018-12-18 04:14:52 +01:00
/***/ 3 :
2018-12-14 05:41:57 +01:00
/***/ ( function ( module , _ _webpack _exports _ _ , _ _webpack _require _ _ ) {
"use strict" ;
2018-12-18 04:14:52 +01:00
/* harmony export (binding) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "a" , function ( ) { return _assertThisInitialized ; } ) ;
function _assertThisInitialized ( self ) {
if ( self === void 0 ) {
throw new ReferenceError ( "this hasn't been initialised - super() hasn't been called" ) ;
}
2018-12-14 05:41:57 +01:00
2018-12-18 04:14:52 +01:00
return self ;
}
2018-12-14 05:41:57 +01:00
/***/ } ) ,
2018-12-18 04:14:52 +01:00
/***/ 309 :
2018-12-14 05:41:57 +01:00
/***/ ( function ( module , _ _webpack _exports _ _ , _ _webpack _require _ _ ) {
"use strict" ;
_ _webpack _require _ _ . r ( _ _webpack _exports _ _ ) ;
2018-12-18 04:14:52 +01:00
var selectors _namespaceObject = { } ;
_ _webpack _require _ _ . r ( selectors _namespaceObject ) ;
_ _webpack _require _ _ . d ( selectors _namespaceObject , "getIsResolving" , function ( ) { return getIsResolving ; } ) ;
_ _webpack _require _ _ . d ( selectors _namespaceObject , "hasStartedResolution" , function ( ) { return hasStartedResolution ; } ) ;
_ _webpack _require _ _ . d ( selectors _namespaceObject , "hasFinishedResolution" , function ( ) { return hasFinishedResolution ; } ) ;
_ _webpack _require _ _ . d ( selectors _namespaceObject , "isResolving" , function ( ) { return isResolving ; } ) ;
_ _webpack _require _ _ . d ( selectors _namespaceObject , "getCachedResolvers" , function ( ) { return getCachedResolvers ; } ) ;
var actions _namespaceObject = { } ;
_ _webpack _require _ _ . r ( actions _namespaceObject ) ;
_ _webpack _require _ _ . d ( actions _namespaceObject , "startResolution" , function ( ) { return startResolution ; } ) ;
_ _webpack _require _ _ . d ( actions _namespaceObject , "finishResolution" , function ( ) { return finishResolution ; } ) ;
_ _webpack _require _ _ . d ( actions _namespaceObject , "invalidateResolution" , function ( ) { return invalidateResolution ; } ) ;
var plugins _namespaceObject = { } ;
_ _webpack _require _ _ . r ( plugins _namespaceObject ) ;
_ _webpack _require _ _ . d ( plugins _namespaceObject , "controls" , function ( ) { return controls ; } ) ;
_ _webpack _require _ _ . d ( plugins _namespaceObject , "persistence" , function ( ) { return plugins _persistence ; } ) ;
// EXTERNAL MODULE: ./node_modules/turbo-combine-reducers/index.js
var turbo _combine _reducers = _ _webpack _require _ _ ( 173 ) ;
var turbo _combine _reducers _default = /*#__PURE__*/ _ _webpack _require _ _ . n ( turbo _combine _reducers ) ;
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/slicedToArray.js + 1 modules
var slicedToArray = _ _webpack _require _ _ ( 25 ) ;
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/objectSpread.js
var objectSpread = _ _webpack _require _ _ ( 8 ) ;
// EXTERNAL MODULE: external "lodash"
var external _lodash _ = _ _webpack _require _ _ ( 2 ) ;
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js
var asyncToGenerator = _ _webpack _require _ _ ( 38 ) ;
// EXTERNAL MODULE: ./node_modules/redux/es/redux.js
2018-12-19 04:16:48 +01:00
var redux = _ _webpack _require _ _ ( 62 ) ;
2018-12-18 04:14:52 +01:00
// EXTERNAL MODULE: ./node_modules/is-promise/index.js
var is _promise = _ _webpack _require _ _ ( 86 ) ;
var is _promise _default = /*#__PURE__*/ _ _webpack _require _ _ . n ( is _promise ) ;
// CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/promise-middleware.js
2018-12-14 05:41:57 +01:00
/ * *
* External dependencies
* /
/ * *
2018-12-18 04:14:52 +01:00
* Simplest possible promise redux middleware .
*
* @ return { function } middleware .
2018-12-14 05:41:57 +01:00
* /
2018-12-18 04:14:52 +01:00
var promise _middleware _promiseMiddleware = function promiseMiddleware ( ) {
return function ( next ) {
return function ( action ) {
if ( is _promise _default ( ) ( action ) ) {
return action . then ( function ( resolvedAction ) {
if ( resolvedAction ) {
return next ( resolvedAction ) ;
}
} ) ;
}
return next ( action ) ;
} ;
} ;
} ;
/* harmony default export */ var promise _middleware = ( promise _middleware _promiseMiddleware ) ;
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js + 2 modules
var toConsumableArray = _ _webpack _require _ _ ( 19 ) ;
// CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/resolvers-cache-middleware.js
2018-12-14 05:41:57 +01:00
/ * *
2018-12-18 04:14:52 +01:00
* External dependencies
2018-12-14 05:41:57 +01:00
* /
/ * *
2018-12-18 04:14:52 +01:00
* creates a middleware handling resolvers cache invalidation .
2018-12-14 05:41:57 +01:00
*
2018-12-18 04:14:52 +01:00
* @ param { Object } registry
* @ param { string } reducerKey
2018-12-14 05:41:57 +01:00
*
2018-12-18 04:14:52 +01:00
* @ return { function } middleware
2018-12-14 05:41:57 +01:00
* /
2018-12-18 04:14:52 +01:00
var resolvers _cache _middleware _createResolversCacheMiddleware = function createResolversCacheMiddleware ( registry , reducerKey ) {
return function ( ) {
return function ( next ) {
return function ( action ) {
var resolvers = registry . select ( 'core/data' ) . getCachedResolvers ( reducerKey ) ;
Object . entries ( resolvers ) . forEach ( function ( _ref ) {
var _ref2 = Object ( slicedToArray [ "a" /* default */ ] ) ( _ref , 2 ) ,
selectorName = _ref2 [ 0 ] ,
resolversByArgs = _ref2 [ 1 ] ;
2018-12-14 05:41:57 +01:00
2018-12-18 04:14:52 +01:00
var resolver = Object ( external _lodash _ [ "get" ] ) ( registry . namespaces , [ reducerKey , 'resolvers' , selectorName ] ) ;
2018-12-14 05:41:57 +01:00
2018-12-18 04:14:52 +01:00
if ( ! resolver || ! resolver . shouldInvalidate ) {
return ;
2018-12-14 05:41:57 +01:00
}
2018-12-18 04:14:52 +01:00
resolversByArgs . forEach ( function ( value , args ) {
// resolversByArgs is the map Map([ args ] => boolean) storing the cache resolution status for a given selector.
// If the value is false it means this resolver has finished its resolution which means we need to invalidate it,
// if it's true it means it's inflight and the invalidation is not necessary.
if ( value !== false || ! resolver . shouldInvalidate . apply ( resolver , [ action ] . concat ( Object ( toConsumableArray [ "a" /* default */ ] ) ( args ) ) ) ) {
return ;
} // Trigger cache invalidation
2018-12-14 05:41:57 +01:00
2018-12-18 04:14:52 +01:00
registry . dispatch ( 'core/data' ) . invalidateResolution ( reducerKey , selectorName , args ) ;
2018-12-14 05:41:57 +01:00
} ) ;
} ) ;
2018-12-18 04:14:52 +01:00
next ( action ) ;
} ;
2018-12-14 05:41:57 +01:00
} ;
2018-12-18 04:14:52 +01:00
} ;
2018-12-14 05:41:57 +01:00
} ;
2018-12-18 04:14:52 +01:00
/* harmony default export */ var resolvers _cache _middleware = ( resolvers _cache _middleware _createResolversCacheMiddleware ) ;
2018-12-14 05:41:57 +01:00
2018-12-18 04:14:52 +01:00
// CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/namespace-store.js
2018-12-14 05:41:57 +01:00
/ * *
2018-12-18 04:14:52 +01:00
* External dependencies
2018-12-14 05:41:57 +01:00
* /
/ * *
* Internal dependencies
* /
2018-12-18 04:14:52 +01:00
2018-12-14 05:41:57 +01:00
/ * *
2018-12-18 04:14:52 +01:00
* Creates a namespace object with a store derived from the reducer given .
2018-12-14 05:41:57 +01:00
*
2018-12-18 04:14:52 +01:00
* @ param { string } key Identifying string used for namespace and redex dev tools .
* @ param { Object } options Contains reducer , actions , selectors , and resolvers .
* @ param { Object } registry Temporary registry reference , required for namespace updates .
2018-12-14 05:41:57 +01:00
*
2018-12-18 04:14:52 +01:00
* @ return { Object } Store Object .
2018-12-17 05:52:00 +01:00
* /
function createNamespace ( key , options , registry ) {
Block Editor: Update `@wordpress` dependencies to match Gutenberg 4.5.1.
- Update the annotations, api-fetch, block-library, blocks, components, compose, core-data, data, date, dom, edit-post, editor, element, format-library, html-entities, i18n, jest-console, jest-preset-default, keycodes, list-reusable-blocks, notices, nux, plugins, rich-text, scripts, token-lists, url, viewport packages.
- Upgrades React from 16.5.2 to 16.6.3.
- Adds a missing `wp-date` dependency to the editor script.
- Updates changed dependencies in `script-loader.php`.
- Fixes undefined notices in some blocks.
- Removes incorrect `gutenberg` textdomain.
Merges [43891], [43903], and [43919] to trunk.
Props atimmer, aduth, youknowriad, danielbachhuber.
See #45145.
Built from https://develop.svn.wordpress.org/trunk@44262
git-svn-id: http://core.svn.wordpress.org/trunk@44092 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-12-17 16:37:00 +01:00
var reducer = options . reducer ;
var store = createReduxStore ( reducer , key , registry ) ;
var selectors , actions , resolvers ;
2018-12-17 05:52:00 +01:00
if ( options . actions ) {
actions = mapActions ( options . actions , store ) ;
}
if ( options . selectors ) {
selectors = mapSelectors ( options . selectors , store ) ;
}
if ( options . resolvers ) {
var fulfillment = getCoreDataFulfillment ( registry , key ) ;
var result = mapResolvers ( options . resolvers , selectors , fulfillment , store ) ;
resolvers = result . resolvers ;
selectors = result . selectors ;
}
var getSelectors = function getSelectors ( ) {
return selectors ;
} ;
var getActions = function getActions ( ) {
return actions ;
} ; // Customize subscribe behavior to call listeners only on effective change,
// not on every dispatch.
var subscribe = store && function ( listener ) {
var lastState = store . getState ( ) ;
store . subscribe ( function ( ) {
var state = store . getState ( ) ;
var hasChanged = state !== lastState ;
lastState = state ;
if ( hasChanged ) {
listener ( ) ;
}
} ) ;
Block Editor: Update `@wordpress` dependencies to match Gutenberg 4.5.1.
- Update the annotations, api-fetch, block-library, blocks, components, compose, core-data, data, date, dom, edit-post, editor, element, format-library, html-entities, i18n, jest-console, jest-preset-default, keycodes, list-reusable-blocks, notices, nux, plugins, rich-text, scripts, token-lists, url, viewport packages.
- Upgrades React from 16.5.2 to 16.6.3.
- Adds a missing `wp-date` dependency to the editor script.
- Updates changed dependencies in `script-loader.php`.
- Fixes undefined notices in some blocks.
- Removes incorrect `gutenberg` textdomain.
Merges [43891], [43903], and [43919] to trunk.
Props atimmer, aduth, youknowriad, danielbachhuber.
See #45145.
Built from https://develop.svn.wordpress.org/trunk@44262
git-svn-id: http://core.svn.wordpress.org/trunk@44092 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-12-17 16:37:00 +01:00
} ; // This can be simplified to just { subscribe, getSelectors, getActions }
// Once we remove the use function.
2018-12-17 05:52:00 +01:00
return {
reducer : reducer ,
store : store ,
actions : actions ,
selectors : selectors ,
resolvers : resolvers ,
getSelectors : getSelectors ,
getActions : getActions ,
subscribe : subscribe
} ;
}
/ * *
* Creates a redux store for a namespace .
*
* @ param { Function } reducer Root reducer for redux store .
* @ param { string } key Part of the state shape to register the
* selectors for .
* @ param { Object } registry Registry reference , for resolver enhancer support .
* @ return { Object } Newly created redux store .
* /
function createReduxStore ( reducer , key , registry ) {
2018-12-18 04:14:52 +01:00
var enhancers = [ Object ( redux [ "a" /* applyMiddleware */ ] ) ( resolvers _cache _middleware ( registry , key ) , promise _middleware ) ] ;
2018-12-17 05:52:00 +01:00
if ( typeof window !== 'undefined' && window . _ _REDUX _DEVTOOLS _EXTENSION _ _ ) {
enhancers . push ( window . _ _REDUX _DEVTOOLS _EXTENSION _ _ ( {
name : key ,
instanceId : key
} ) ) ;
}
2018-12-18 04:14:52 +01:00
return Object ( redux [ "c" /* createStore */ ] ) ( reducer , Object ( external _lodash _ [ "flowRight" ] ) ( enhancers ) ) ;
2018-12-17 05:52:00 +01:00
}
/ * *
* Maps selectors to a redux store .
*
* @ param { Object } selectors Selectors to register . Keys will be used as the
* public facing API . Selectors will get passed the
* state as first argument .
* @ param { Object } store The redux store to which the selectors should be mapped .
* @ return { Object } Selectors mapped to the redux store provided .
* /
function mapSelectors ( selectors , store ) {
var createStateSelector = function createStateSelector ( selector ) {
2019-01-04 20:38:57 +01:00
return function runSelector ( ) {
// This function is an optimized implementation of:
//
// selector( store.getState(), ...arguments )
//
// Where the above would incur an `Array#concat` in its application,
// the logic here instead efficiently constructs an arguments array via
// direct assignment.
var argsLength = arguments . length ;
var args = new Array ( argsLength + 1 ) ;
args [ 0 ] = store . getState ( ) ;
for ( var i = 0 ; i < argsLength ; i ++ ) {
args [ i + 1 ] = arguments [ i ] ;
2018-12-17 05:52:00 +01:00
}
2019-01-04 20:38:57 +01:00
return selector . apply ( void 0 , args ) ;
2018-12-17 05:52:00 +01:00
} ;
} ;
2018-12-18 04:14:52 +01:00
return Object ( external _lodash _ [ "mapValues" ] ) ( selectors , createStateSelector ) ;
2018-12-17 05:52:00 +01:00
}
/ * *
* Maps actions to dispatch from a given store .
*
* @ param { Object } actions Actions to register .
* @ param { Object } store The redux store to which the actions should be mapped .
* @ return { Object } Actions mapped to the redux store provided .
* /
function mapActions ( actions , store ) {
var createBoundAction = function createBoundAction ( action ) {
return function ( ) {
return store . dispatch ( action . apply ( void 0 , arguments ) ) ;
} ;
} ;
2018-12-18 04:14:52 +01:00
return Object ( external _lodash _ [ "mapValues" ] ) ( actions , createBoundAction ) ;
2018-12-17 05:52:00 +01:00
}
/ * *
* Returns resolvers with matched selectors for a given namespace .
* Resolvers are side effects invoked once per argument set of a given selector call ,
* used in ensuring that the data needs for the selector are satisfied .
*
* @ param { Object } resolvers Resolvers to register .
* @ param { Object } selectors The current selectors to be modified .
* @ param { Object } fulfillment Fulfillment implementation functions .
* @ param { Object } store The redux store to which the resolvers should be mapped .
* @ return { Object } An object containing updated selectors and resolvers .
* /
function mapResolvers ( resolvers , selectors , fulfillment , store ) {
var mapSelector = function mapSelector ( selector , selectorName ) {
var resolver = resolvers [ selectorName ] ;
if ( ! resolver ) {
return selector ;
}
return function ( ) {
2019-01-04 20:38:57 +01:00
for ( var _len = arguments . length , args = new Array ( _len ) , _key = 0 ; _key < _len ; _key ++ ) {
args [ _key ] = arguments [ _key ] ;
2018-12-17 05:52:00 +01:00
}
function fulfillSelector ( ) {
return _fulfillSelector . apply ( this , arguments ) ;
}
function _fulfillSelector ( ) {
2018-12-18 04:14:52 +01:00
_fulfillSelector = Object ( asyncToGenerator [ "a" /* default */ ] ) (
2018-12-17 05:52:00 +01:00
/*#__PURE__*/
regeneratorRuntime . mark ( function _callee ( ) {
var state ;
return regeneratorRuntime . wrap ( function _callee$ ( _context ) {
while ( 1 ) {
switch ( _context . prev = _context . next ) {
case 0 :
state = store . getState ( ) ;
if ( ! ( typeof resolver . isFulfilled === 'function' && resolver . isFulfilled . apply ( resolver , [ state ] . concat ( args ) ) ) ) {
_context . next = 3 ;
break ;
}
return _context . abrupt ( "return" ) ;
case 3 :
if ( ! fulfillment . hasStarted ( selectorName , args ) ) {
_context . next = 5 ;
break ;
}
return _context . abrupt ( "return" ) ;
case 5 :
fulfillment . start ( selectorName , args ) ;
_context . next = 8 ;
return fulfillment . fulfill . apply ( fulfillment , [ selectorName ] . concat ( args ) ) ;
case 8 :
fulfillment . finish ( selectorName , args ) ;
case 9 :
case "end" :
return _context . stop ( ) ;
}
}
} , _callee , this ) ;
} ) ) ;
return _fulfillSelector . apply ( this , arguments ) ;
}
fulfillSelector . apply ( void 0 , args ) ;
return selector . apply ( void 0 , args ) ;
} ;
} ;
2018-12-18 04:14:52 +01:00
var mappedResolvers = Object ( external _lodash _ [ "mapValues" ] ) ( resolvers , function ( resolver ) {
2018-12-17 05:52:00 +01:00
var _resolver$fulfill = resolver . fulfill ,
resolverFulfill = _resolver$fulfill === void 0 ? resolver : _resolver$fulfill ;
2018-12-18 04:14:52 +01:00
return Object ( objectSpread [ "a" /* default */ ] ) ( { } , resolver , {
2018-12-17 05:52:00 +01:00
fulfill : resolverFulfill
} ) ;
} ) ;
return {
resolvers : mappedResolvers ,
2018-12-18 04:14:52 +01:00
selectors : Object ( external _lodash _ [ "mapValues" ] ) ( selectors , mapSelector )
2018-12-17 05:52:00 +01:00
} ;
}
/ * *
* Bundles up fulfillment functions for resolvers .
* @ param { Object } registry Registry reference , for fulfilling via resolvers
* @ param { string } key Part of the state shape to register the
* selectors for .
* @ return { Object } An object providing fulfillment functions .
* /
function getCoreDataFulfillment ( registry , key ) {
var _registry$select = registry . select ( 'core/data' ) ,
hasStartedResolution = _registry$select . hasStartedResolution ;
var _registry$dispatch = registry . dispatch ( 'core/data' ) ,
startResolution = _registry$dispatch . startResolution ,
finishResolution = _registry$dispatch . finishResolution ;
return {
hasStarted : function hasStarted ( ) {
2019-01-04 20:38:57 +01:00
for ( var _len2 = arguments . length , args = new Array ( _len2 ) , _key2 = 0 ; _key2 < _len2 ; _key2 ++ ) {
args [ _key2 ] = arguments [ _key2 ] ;
2018-12-17 05:52:00 +01:00
}
return hasStartedResolution . apply ( void 0 , [ key ] . concat ( args ) ) ;
} ,
start : function start ( ) {
2019-01-04 20:38:57 +01:00
for ( var _len3 = arguments . length , args = new Array ( _len3 ) , _key3 = 0 ; _key3 < _len3 ; _key3 ++ ) {
args [ _key3 ] = arguments [ _key3 ] ;
2018-12-17 05:52:00 +01:00
}
return startResolution . apply ( void 0 , [ key ] . concat ( args ) ) ;
} ,
finish : function finish ( ) {
2019-01-04 20:38:57 +01:00
for ( var _len4 = arguments . length , args = new Array ( _len4 ) , _key4 = 0 ; _key4 < _len4 ; _key4 ++ ) {
args [ _key4 ] = arguments [ _key4 ] ;
2018-12-17 05:52:00 +01:00
}
return finishResolution . apply ( void 0 , [ key ] . concat ( args ) ) ;
} ,
fulfill : function fulfill ( ) {
2019-01-04 20:38:57 +01:00
for ( var _len5 = arguments . length , args = new Array ( _len5 ) , _key5 = 0 ; _key5 < _len5 ; _key5 ++ ) {
args [ _key5 ] = arguments [ _key5 ] ;
2018-12-17 05:52:00 +01:00
}
return fulfillWithRegistry . apply ( void 0 , [ registry , key ] . concat ( args ) ) ;
}
} ;
}
/ * *
* Calls a resolver given arguments
*
* @ param { Object } registry Registry reference , for fulfilling via resolvers
* @ param { string } key Part of the state shape to register the
* selectors for .
* @ param { string } selectorName Selector name to fulfill .
* @ param { Array } args Selector Arguments .
* /
function fulfillWithRegistry ( _x , _x2 , _x3 ) {
return _fulfillWithRegistry . apply ( this , arguments ) ;
}
function _fulfillWithRegistry ( ) {
2018-12-18 04:14:52 +01:00
_fulfillWithRegistry = Object ( asyncToGenerator [ "a" /* default */ ] ) (
2018-12-17 05:52:00 +01:00
/*#__PURE__*/
regeneratorRuntime . mark ( function _callee2 ( registry , key , selectorName ) {
var namespace ,
resolver ,
2019-01-04 20:38:57 +01:00
_len6 ,
2018-12-17 05:52:00 +01:00
args ,
2019-01-04 20:38:57 +01:00
_key6 ,
2018-12-17 05:52:00 +01:00
action ,
_args2 = arguments ;
return regeneratorRuntime . wrap ( function _callee2$ ( _context2 ) {
while ( 1 ) {
switch ( _context2 . prev = _context2 . next ) {
case 0 :
namespace = registry . stores [ key ] ;
2018-12-18 04:14:52 +01:00
resolver = Object ( external _lodash _ [ "get" ] ) ( namespace , [ 'resolvers' , selectorName ] ) ;
2018-12-17 05:52:00 +01:00
if ( resolver ) {
_context2 . next = 4 ;
break ;
}
return _context2 . abrupt ( "return" ) ;
case 4 :
2019-01-04 20:38:57 +01:00
for ( _len6 = _args2 . length , args = new Array ( _len6 > 3 ? _len6 - 3 : 0 ) , _key6 = 3 ; _key6 < _len6 ; _key6 ++ ) {
args [ _key6 - 3 ] = _args2 [ _key6 ] ;
2018-12-17 05:52:00 +01:00
}
action = resolver . fulfill . apply ( resolver , args ) ;
if ( ! action ) {
_context2 . next = 9 ;
break ;
}
_context2 . next = 9 ;
return namespace . store . dispatch ( action ) ;
case 9 :
case "end" :
return _context2 . stop ( ) ;
}
}
} , _callee2 , this ) ;
} ) ) ;
return _fulfillWithRegistry . apply ( this , arguments ) ;
}
2018-12-18 04:14:52 +01:00
// EXTERNAL MODULE: ./node_modules/equivalent-key-map/equivalent-key-map.js
var equivalent _key _map = _ _webpack _require _ _ ( 66 ) ;
var equivalent _key _map _default = /*#__PURE__*/ _ _webpack _require _ _ . n ( equivalent _key _map ) ;
2018-12-17 05:52:00 +01:00
2018-12-18 04:14:52 +01:00
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/defineProperty.js
var defineProperty = _ _webpack _require _ _ ( 15 ) ;
// CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/store/utils.js
2018-12-14 05:41:57 +01:00
/ * *
2018-12-18 04:14:52 +01:00
* Higher - order reducer creator which creates a combined reducer object , keyed
* by a property on the action object .
*
* @ param { string } actionProperty Action property by which to key object .
*
* @ return { Function } Higher - order reducer .
2018-12-14 05:41:57 +01:00
* /
2018-12-18 04:14:52 +01:00
var utils _onSubKey = function onSubKey ( actionProperty ) {
return function ( reducer ) {
return function ( ) {
var state = arguments . length > 0 && arguments [ 0 ] !== undefined ? arguments [ 0 ] : { } ;
var action = arguments . length > 1 ? arguments [ 1 ] : undefined ;
// Retrieve subkey from action. Do not track if undefined; useful for cases
// where reducer is scoped by action shape.
var key = action [ actionProperty ] ;
2018-12-14 05:41:57 +01:00
2018-12-18 04:14:52 +01:00
if ( key === undefined ) {
return state ;
} // Avoid updating state if unchanged. Note that this also accounts for a
// reducer which returns undefined on a key which is not yet tracked.
2018-12-14 05:41:57 +01:00
2018-12-18 04:14:52 +01:00
var nextKeyState = reducer ( state [ key ] , action ) ;
2018-12-14 05:41:57 +01:00
2018-12-18 04:14:52 +01:00
if ( nextKeyState === state [ key ] ) {
return state ;
2018-12-14 05:41:57 +01:00
}
2018-12-18 04:14:52 +01:00
return Object ( objectSpread [ "a" /* default */ ] ) ( { } , state , Object ( defineProperty [ "a" /* default */ ] ) ( { } , key , nextKeyState ) ) ;
} ;
2018-12-14 05:41:57 +01:00
} ;
2018-12-18 04:14:52 +01:00
} ;
2018-12-14 05:41:57 +01:00
2018-12-18 04:14:52 +01:00
// CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/store/reducer.js
/ * *
* External dependencies
* /
2018-12-14 05:41:57 +01:00
2018-12-18 04:14:52 +01:00
/ * *
* Internal dependencies
* /
2018-12-14 05:41:57 +01:00
2018-12-18 04:14:52 +01:00
/ * *
* Reducer function returning next state for selector resolution , object form :
*
* reducerKey - > selectorName - > EquivalentKeyMap < Array , boolean >
*
* @ param { Object } state Current state .
* @ param { Object } action Dispatched action .
*
* @ returns { Object } Next state .
* /
2018-12-14 05:41:57 +01:00
2018-12-18 04:14:52 +01:00
var isResolved = Object ( external _lodash _ [ "flowRight" ] ) ( [ utils _onSubKey ( 'reducerKey' ) , utils _onSubKey ( 'selectorName' ) ] ) ( function ( ) {
var state = arguments . length > 0 && arguments [ 0 ] !== undefined ? arguments [ 0 ] : new equivalent _key _map _default . a ( ) ;
var action = arguments . length > 1 ? arguments [ 1 ] : undefined ;
2018-12-14 05:41:57 +01:00
2018-12-18 04:14:52 +01:00
switch ( action . type ) {
case 'START_RESOLUTION' :
case 'FINISH_RESOLUTION' :
{
var isStarting = action . type === 'START_RESOLUTION' ;
var nextState = new equivalent _key _map _default . a ( state ) ;
nextState . set ( action . args , isStarting ) ;
return nextState ;
}
2018-12-14 05:41:57 +01:00
2018-12-18 04:14:52 +01:00
case 'INVALIDATE_RESOLUTION' :
{
var _nextState = new equivalent _key _map _default . a ( state ) ;
2018-12-14 05:41:57 +01:00
2018-12-18 04:14:52 +01:00
_nextState . delete ( action . args ) ;
2018-12-14 05:41:57 +01:00
2018-12-18 04:14:52 +01:00
return _nextState ;
}
}
2018-12-14 05:41:57 +01:00
2018-12-18 04:14:52 +01:00
return state ;
} ) ;
/* harmony default export */ var store _reducer = ( isResolved ) ;
2018-12-14 05:41:57 +01:00
2018-12-18 04:14:52 +01:00
// CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/store/selectors.js
2018-12-14 05:41:57 +01:00
/ * *
* External dependencies
* /
/ * *
2018-12-18 04:14:52 +01:00
* Returns the raw ` isResolving ` value for a given reducer key , selector name ,
* and arguments set . May be undefined if the selector has never been resolved
* or not resolved for the given set of arguments , otherwise true or false for
* resolution started and completed respectively .
*
* @ param { Object } state Data state .
* @ param { string } reducerKey Registered store reducer key .
* @ param { string } selectorName Selector name .
* @ param { Array } args Arguments passed to selector .
*
* @ return { ? boolean } isResolving value .
2018-12-14 05:41:57 +01:00
* /
2018-12-18 04:14:52 +01:00
function getIsResolving ( state , reducerKey , selectorName , args ) {
var map = Object ( external _lodash _ [ "get" ] ) ( state , [ reducerKey , selectorName ] ) ;
if ( ! map ) {
return ;
}
2018-12-14 05:41:57 +01:00
2018-12-18 04:14:52 +01:00
return map . get ( args ) ;
}
2018-12-14 05:41:57 +01:00
/ * *
2018-12-18 04:14:52 +01:00
* Returns true if resolution has already been triggered for a given reducer
* key , selector name , and arguments set .
2018-12-14 05:41:57 +01:00
*
2018-12-18 04:14:52 +01:00
* @ param { Object } state Data state .
* @ param { string } reducerKey Registered store reducer key .
* @ param { string } selectorName Selector name .
* @ param { ? Array } args Arguments passed to selector ( default ` [] ` ) .
2018-12-14 05:41:57 +01:00
*
2018-12-18 04:14:52 +01:00
* @ return { boolean } Whether resolution has been triggered .
2018-12-14 05:41:57 +01:00
* /
2018-12-18 04:14:52 +01:00
function hasStartedResolution ( state , reducerKey , selectorName ) {
var args = arguments . length > 3 && arguments [ 3 ] !== undefined ? arguments [ 3 ] : [ ] ;
return getIsResolving ( state , reducerKey , selectorName , args ) !== undefined ;
}
2018-12-14 05:41:57 +01:00
/ * *
2018-12-18 04:14:52 +01:00
* Returns true if resolution has completed for a given reducer key , selector
* name , and arguments set .
2018-12-14 05:41:57 +01:00
*
2018-12-18 04:14:52 +01:00
* @ param { Object } state Data state .
* @ param { string } reducerKey Registered store reducer key .
* @ param { string } selectorName Selector name .
* @ param { ? Array } args Arguments passed to selector .
*
* @ return { boolean } Whether resolution has completed .
2018-12-14 05:41:57 +01:00
* /
2018-12-18 04:14:52 +01:00
function hasFinishedResolution ( state , reducerKey , selectorName ) {
var args = arguments . length > 3 && arguments [ 3 ] !== undefined ? arguments [ 3 ] : [ ] ;
return getIsResolving ( state , reducerKey , selectorName , args ) === false ;
}
2018-12-14 05:41:57 +01:00
/ * *
2018-12-18 04:14:52 +01:00
* Returns true if resolution has been triggered but has not yet completed for
* a given reducer key , selector name , and arguments set .
2018-12-14 05:41:57 +01:00
*
2018-12-18 04:14:52 +01:00
* @ param { Object } state Data state .
* @ param { string } reducerKey Registered store reducer key .
* @ param { string } selectorName Selector name .
* @ param { ? Array } args Arguments passed to selector .
*
* @ return { boolean } Whether resolution is in progress .
2018-12-14 05:41:57 +01:00
* /
2018-12-18 04:14:52 +01:00
function isResolving ( state , reducerKey , selectorName ) {
var args = arguments . length > 3 && arguments [ 3 ] !== undefined ? arguments [ 3 ] : [ ] ;
return getIsResolving ( state , reducerKey , selectorName , args ) === true ;
}
2018-12-14 05:41:57 +01:00
/ * *
2018-12-18 04:14:52 +01:00
* Returns the list of the cached resolvers .
2018-12-14 05:41:57 +01:00
*
2018-12-18 04:14:52 +01:00
* @ param { Object } state Data state .
* @ param { string } reducerKey Registered store reducer key .
2018-12-14 05:41:57 +01:00
*
2018-12-18 04:14:52 +01:00
* @ return { Object } Resolvers mapped by args and selectorName .
2018-12-14 05:41:57 +01:00
* /
2018-12-18 04:14:52 +01:00
function getCachedResolvers ( state , reducerKey ) {
return state . hasOwnProperty ( reducerKey ) ? state [ reducerKey ] : { } ;
}
// CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/store/actions.js
/ * *
* Returns an action object used in signalling that selector resolution has
* started .
*
* @ param { string } reducerKey Registered store reducer key .
* @ param { string } selectorName Name of selector for which resolver triggered .
* @ param { ... * } args Arguments to associate for uniqueness .
*
* @ return { Object } Action object .
* /
function startResolution ( reducerKey , selectorName , args ) {
return {
type : 'START_RESOLUTION' ,
reducerKey : reducerKey ,
selectorName : selectorName ,
args : args
2018-12-14 05:41:57 +01:00
} ;
}
/ * *
2018-12-18 04:14:52 +01:00
* Returns an action object used in signalling that selector resolution has
* completed .
2018-12-14 05:41:57 +01:00
*
2018-12-18 04:14:52 +01:00
* @ param { string } reducerKey Registered store reducer key .
* @ param { string } selectorName Name of selector for which resolver triggered .
* @ param { ... * } args Arguments to associate for uniqueness .
2018-12-14 05:41:57 +01:00
*
2018-12-18 04:14:52 +01:00
* @ return { Object } Action object .
2018-12-14 05:41:57 +01:00
* /
2018-12-18 04:14:52 +01:00
function finishResolution ( reducerKey , selectorName , args ) {
2018-12-14 05:41:57 +01:00
return {
2018-12-18 04:14:52 +01:00
type : 'FINISH_RESOLUTION' ,
reducerKey : reducerKey ,
selectorName : selectorName ,
args : args
2018-12-14 05:41:57 +01:00
} ;
}
/ * *
2018-12-18 04:14:52 +01:00
* Returns an action object used in signalling that we should invalidate the resolution cache .
2018-12-14 05:41:57 +01:00
*
2018-12-18 04:14:52 +01:00
* @ param { string } reducerKey Registered store reducer key .
* @ param { string } selectorName Name of selector for which resolver should be invalidated .
* @ param { Array } args Arguments to associate for uniqueness .
2018-12-14 05:41:57 +01:00
*
2018-12-18 04:14:52 +01:00
* @ return { Object } Action object .
2018-12-14 05:41:57 +01:00
* /
2018-12-18 04:14:52 +01:00
function invalidateResolution ( reducerKey , selectorName , args ) {
return {
type : 'INVALIDATE_RESOLUTION' ,
reducerKey : reducerKey ,
selectorName : selectorName ,
args : args
} ;
}
2018-12-14 05:41:57 +01:00
2018-12-18 04:14:52 +01:00
// CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/store/index.js
/ * *
* Internal dependencies
* /
2018-12-14 05:41:57 +01:00
2018-12-18 04:14:52 +01:00
/* harmony default export */ var build _module _store = ( {
reducer : store _reducer ,
actions : actions _namespaceObject ,
selectors : selectors _namespaceObject
2018-12-14 05:41:57 +01:00
} ) ;
2018-12-18 04:14:52 +01:00
// CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/registry.js
2018-12-14 05:41:57 +01:00
/ * *
* External dependencies
* /
/ * *
* Internal dependencies
* /
/ * *
* An isolated orchestrator of store registrations .
*
* @ typedef { WPDataRegistry }
*
2018-12-17 05:52:00 +01:00
* @ property { Function } registerGenericStore
2018-12-14 05:41:57 +01:00
* @ property { Function } registerStore
* @ property { Function } subscribe
* @ property { Function } select
* @ property { Function } dispatch
* /
/ * *
* An object of registry function overrides .
*
* @ typedef { WPDataPlugin }
* /
/ * *
* Creates a new store registry , given an optional object of initial store
* configurations .
*
* @ param { Object } storeConfigs Initial store configurations .
*
* @ return { WPDataRegistry } Data registry .
* /
function createRegistry ( ) {
var storeConfigs = arguments . length > 0 && arguments [ 0 ] !== undefined ? arguments [ 0 ] : { } ;
2018-12-17 05:52:00 +01:00
var stores = { } ;
2018-12-14 05:41:57 +01:00
var listeners = [ ] ;
/ * *
* Global listener called for each store ' s update .
* /
function globalListener ( ) {
listeners . forEach ( function ( listener ) {
return listener ( ) ;
} ) ;
}
/ * *
* Subscribe to changes to any data .
*
* @ param { Function } listener Listener function .
*
* @ return { Function } Unsubscribe function .
* /
var subscribe = function subscribe ( listener ) {
listeners . push ( listener ) ;
return function ( ) {
2018-12-18 04:14:52 +01:00
listeners = Object ( external _lodash _ [ "without" ] ) ( listeners , listener ) ;
2018-12-14 05:41:57 +01:00
} ;
} ;
/ * *
* Calls a selector given the current state and extra arguments .
*
* @ param { string } reducerKey Part of the state shape to register the
* selectors for .
*
* @ return { * } The selector ' s returned value .
* /
function select ( reducerKey ) {
2018-12-17 05:52:00 +01:00
var store = stores [ reducerKey ] ;
return store && store . getSelectors ( ) ;
2018-12-14 05:41:57 +01:00
}
/ * *
* Returns the available actions for a part of the state .
*
* @ param { string } reducerKey Part of the state shape to dispatch the
* action for .
*
* @ return { * } The action ' s returned value .
* /
function dispatch ( reducerKey ) {
2018-12-17 05:52:00 +01:00
var store = stores [ reducerKey ] ;
return store && store . getActions ( ) ;
} //
// Deprecated
// TODO: Remove this after `use()` is removed.
//
2018-12-14 05:41:57 +01:00
function withPlugins ( attributes ) {
2018-12-18 04:14:52 +01:00
return Object ( external _lodash _ [ "mapValues" ] ) ( attributes , function ( attribute , key ) {
2018-12-14 05:41:57 +01:00
if ( typeof attribute !== 'function' ) {
return attribute ;
}
return function ( ) {
return registry [ key ] . apply ( null , arguments ) ;
} ;
} ) ;
}
2018-12-17 05:52:00 +01:00
/ * *
* Registers a generic store .
*
* @ param { string } key Store registry key .
* @ param { Object } config Configuration ( getSelectors , getActions , subscribe ) .
* /
function registerGenericStore ( key , config ) {
if ( typeof config . getSelectors !== 'function' ) {
throw new TypeError ( 'config.getSelectors must be a function' ) ;
}
if ( typeof config . getActions !== 'function' ) {
throw new TypeError ( 'config.getActions must be a function' ) ;
}
if ( typeof config . subscribe !== 'function' ) {
throw new TypeError ( 'config.subscribe must be a function' ) ;
}
stores [ key ] = config ;
config . subscribe ( globalListener ) ;
}
2018-12-14 05:41:57 +01:00
var registry = {
2018-12-17 05:52:00 +01:00
registerGenericStore : registerGenericStore ,
stores : stores ,
namespaces : stores ,
// TODO: Deprecate/remove this.
2018-12-14 05:41:57 +01:00
subscribe : subscribe ,
select : select ,
dispatch : dispatch ,
2018-12-14 12:02:53 +01:00
use : use
2018-12-14 05:41:57 +01:00
} ;
/ * *
2018-12-17 05:52:00 +01:00
* Registers a standard ` @wordpress/data ` store .
2018-12-14 05:41:57 +01:00
*
2018-12-17 05:52:00 +01:00
* @ param { string } reducerKey Reducer key .
* @ param { Object } options Store description ( reducer , actions , selectors , resolvers ) .
2018-12-14 05:41:57 +01:00
*
2018-12-17 05:52:00 +01:00
* @ return { Object } Registered store object .
2018-12-14 05:41:57 +01:00
* /
2018-12-17 05:52:00 +01:00
registry . registerStore = function ( reducerKey , options ) {
if ( ! options . reducer ) {
throw new TypeError ( 'Must specify store reducer' ) ;
}
2018-12-18 04:14:52 +01:00
var namespace = createNamespace ( reducerKey , options , registry ) ;
2018-12-17 05:52:00 +01:00
registerGenericStore ( reducerKey , namespace ) ;
return namespace . store ;
} ; //
// TODO:
// This function will be deprecated as soon as it is no longer internally referenced.
//
2018-12-14 05:41:57 +01:00
function use ( plugin , options ) {
2018-12-18 04:14:52 +01:00
registry = Object ( objectSpread [ "a" /* default */ ] ) ( { } , registry , plugin ( registry , options ) ) ;
2018-12-14 05:41:57 +01:00
return registry ;
}
2018-12-18 04:14:52 +01:00
Object . entries ( Object ( objectSpread [ "a" /* default */ ] ) ( {
'core/data' : build _module _store
2018-12-14 05:41:57 +01:00
} , storeConfigs ) ) . map ( function ( _ref ) {
2018-12-18 04:14:52 +01:00
var _ref2 = Object ( slicedToArray [ "a" /* default */ ] ) ( _ref , 2 ) ,
2018-12-14 05:41:57 +01:00
name = _ref2 [ 0 ] ,
config = _ref2 [ 1 ] ;
2018-12-17 05:52:00 +01:00
return registry . registerStore ( name , config ) ;
2018-12-14 05:41:57 +01:00
} ) ;
return withPlugins ( registry ) ;
}
2018-12-18 04:14:52 +01:00
// CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/default-registry.js
2018-12-14 05:41:57 +01:00
2018-12-18 04:14:52 +01:00
/* harmony default export */ var default _registry = ( createRegistry ( ) ) ;
2018-12-14 12:02:53 +01:00
2018-12-18 04:14:52 +01:00
// EXTERNAL MODULE: external {"this":["wp","reduxRoutine"]}
var external _this _wp _reduxRoutine _ = _ _webpack _require _ _ ( 188 ) ;
var external _this _wp _reduxRoutine _default = /*#__PURE__*/ _ _webpack _require _ _ . n ( external _this _wp _reduxRoutine _ ) ;
2018-12-14 12:02:53 +01:00
2018-12-18 04:14:52 +01:00
// CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/plugins/controls/index.js
2018-12-14 12:02:53 +01:00
/ * *
* External dependencies
* /
/ * *
2018-12-18 04:14:52 +01:00
* WordPress dependencies
2018-12-14 12:02:53 +01:00
* /
2018-12-18 04:14:52 +01:00
/* harmony default export */ var controls = ( function ( registry ) {
return {
registerStore : function registerStore ( reducerKey , options ) {
var store = registry . registerStore ( reducerKey , options ) ;
2018-12-14 12:02:53 +01:00
2018-12-18 04:14:52 +01:00
if ( options . controls ) {
var middleware = external _this _wp _reduxRoutine _default ( ) ( options . controls ) ;
var enhancer = Object ( redux [ "a" /* applyMiddleware */ ] ) ( middleware ) ;
2018-12-14 05:41:57 +01:00
2018-12-18 04:14:52 +01:00
var createStore = function createStore ( ) {
return store ;
} ;
2018-12-14 05:41:57 +01:00
2018-12-18 04:14:52 +01:00
Object . assign ( store , enhancer ( createStore ) ( options . reducer ) ) ;
registry . namespaces [ reducerKey ] . supportControls = true ;
}
2018-12-14 12:02:53 +01:00
2018-12-18 04:14:52 +01:00
return store ;
}
2018-12-14 12:02:53 +01:00
} ;
2018-12-18 04:14:52 +01:00
} ) ;
2018-12-14 05:41:57 +01:00
2018-12-18 04:14:52 +01:00
// CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/plugins/persistence/storage/object.js
var objectStorage ;
var object _storage = {
getItem : function getItem ( key ) {
if ( ! objectStorage || ! objectStorage [ key ] ) {
return null ;
}
2018-12-14 05:41:57 +01:00
2018-12-18 04:14:52 +01:00
return objectStorage [ key ] ;
} ,
setItem : function setItem ( key , value ) {
if ( ! objectStorage ) {
object _storage . clear ( ) ;
}
2018-12-14 05:41:57 +01:00
2018-12-18 04:14:52 +01:00
objectStorage [ key ] = String ( value ) ;
} ,
clear : function clear ( ) {
objectStorage = Object . create ( null ) ;
}
} ;
/* harmony default export */ var object = ( object _storage ) ;
2018-12-14 05:41:57 +01:00
2018-12-18 04:14:52 +01:00
// CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/plugins/persistence/storage/default.js
2018-12-14 05:41:57 +01:00
/ * *
* Internal dependencies
* /
2018-12-18 04:14:52 +01:00
var default _storage ;
2018-12-14 05:41:57 +01:00
2018-12-18 04:14:52 +01:00
try {
// Private Browsing in Safari 10 and earlier will throw an error when
// attempting to set into localStorage. The test here is intentional in
// causing a thrown error as condition for using fallback object storage.
default _storage = window . localStorage ;
default _storage . setItem ( '__wpDataTestLocalStorage' , '' ) ;
default _storage . removeItem ( '__wpDataTestLocalStorage' ) ;
} catch ( error ) {
default _storage = object ;
}
2018-12-14 05:41:57 +01:00
2018-12-18 04:14:52 +01:00
/* harmony default export */ var storage _default = ( default _storage ) ;
2018-12-14 05:41:57 +01:00
2018-12-18 04:14:52 +01:00
// CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/plugins/persistence/index.js
2018-12-14 05:41:57 +01:00
/ * *
* External dependencies
* /
/ * *
* Internal dependencies
* /
/ * *
2018-12-18 04:14:52 +01:00
* Persistence plugin options .
2018-12-14 05:41:57 +01:00
*
2018-12-18 04:14:52 +01:00
* @ property { Storage } storage Persistent storage implementation . This must
* at least implement ` getItem ` and ` setItem ` of
* the Web Storage API .
* @ property { string } storageKey Key on which to set in persistent storage .
2018-12-14 05:41:57 +01:00
*
2018-12-18 04:14:52 +01:00
* @ typedef { WPDataPersistencePluginOptions }
* /
/ * *
* Default plugin storage .
2018-12-14 05:41:57 +01:00
*
2018-12-18 04:14:52 +01:00
* @ type { Storage }
2018-12-14 05:41:57 +01:00
* /
2018-12-18 04:14:52 +01:00
var DEFAULT _STORAGE = storage _default ;
/ * *
* Default plugin storage key .
*
* @ type { string }
* /
2018-12-14 05:41:57 +01:00
2018-12-18 04:14:52 +01:00
var DEFAULT _STORAGE _KEY = 'WP_DATA' ;
2018-12-14 05:41:57 +01:00
/ * *
2018-12-18 04:14:52 +01:00
* Higher - order reducer to provides an initial value when state is undefined .
*
* @ param { Function } reducer Original reducer .
* @ param { * } initialState Value to use as initial state .
*
* @ return { Function } Enhanced reducer .
2018-12-14 05:41:57 +01:00
* /
2018-12-18 04:14:52 +01:00
function withInitialState ( reducer , initialState ) {
return function ( ) {
var state = arguments . length > 0 && arguments [ 0 ] !== undefined ? arguments [ 0 ] : initialState ;
var action = arguments . length > 1 ? arguments [ 1 ] : undefined ;
return reducer ( state , action ) ;
} ;
}
2018-12-14 05:41:57 +01:00
/ * *
2018-12-18 04:14:52 +01:00
* Creates a persistence interface , exposing getter and setter methods ( ` get `
* and ` set ` respectively ) .
2018-12-14 05:41:57 +01:00
*
2018-12-18 04:14:52 +01:00
* @ param { WPDataPersistencePluginOptions } options Plugin options .
2018-12-14 05:41:57 +01:00
*
2018-12-18 04:14:52 +01:00
* @ return { Object } Persistence interface .
2018-12-14 05:41:57 +01:00
* /
2018-12-18 04:14:52 +01:00
function createPersistenceInterface ( options ) {
var _options$storage = options . storage ,
storage = _options$storage === void 0 ? DEFAULT _STORAGE : _options$storage ,
_options$storageKey = options . storageKey ,
storageKey = _options$storageKey === void 0 ? DEFAULT _STORAGE _KEY : _options$storageKey ;
var data ;
/ * *
* Returns the persisted data as an object , defaulting to an empty object .
*
* @ return { Object } Persisted data .
* /
2018-12-14 05:41:57 +01:00
2018-12-18 04:14:52 +01:00
function get ( ) {
if ( data === undefined ) {
// If unset, getItem is expected to return null. Fall back to
// empty object.
var persisted = storage . getItem ( storageKey ) ;
if ( persisted === null ) {
data = { } ;
} else {
try {
data = JSON . parse ( persisted ) ;
} catch ( error ) {
// Similarly, should any error be thrown during parse of
// the string (malformed JSON), fall back to empty object.
data = { } ;
}
}
}
return data ;
2018-12-14 05:41:57 +01:00
}
2018-12-18 04:14:52 +01:00
/ * *
* Merges an updated reducer state into the persisted data .
*
* @ param { string } key Key to update .
* @ param { * } value Updated value .
* /
2018-12-14 05:41:57 +01:00
2018-12-18 04:14:52 +01:00
function set ( key , value ) {
data = Object ( objectSpread [ "a" /* default */ ] ) ( { } , data , Object ( defineProperty [ "a" /* default */ ] ) ( { } , key , value ) ) ;
storage . setItem ( storageKey , JSON . stringify ( data ) ) ;
}
2018-12-14 05:41:57 +01:00
2018-12-18 04:14:52 +01:00
return {
get : get ,
set : set
} ;
2018-12-14 05:41:57 +01:00
}
/ * *
2018-12-18 04:14:52 +01:00
* Data plugin to persist store state into a single storage key .
2018-12-14 05:41:57 +01:00
*
2018-12-18 04:14:52 +01:00
* @ param { WPDataRegistry } registry Data registry .
* @ param { ? WPDataPersistencePluginOptions } pluginOptions Plugin options .
2018-12-14 05:41:57 +01:00
*
2018-12-18 04:14:52 +01:00
* @ return { WPDataPlugin } Data plugin .
2018-12-14 05:41:57 +01:00
* /
2018-12-18 04:14:52 +01:00
/* harmony default export */ var plugins _persistence = ( function ( registry , pluginOptions ) {
var persistence = createPersistenceInterface ( pluginOptions ) ;
/ * *
* Creates an enhanced store dispatch function , triggering the state of the
* given reducer key to be persisted when changed .
*
* @ param { Function } getState Function which returns current state .
* @ param { string } reducerKey Reducer key .
* @ param { ? Array < string > } keys Optional subset of keys to save .
*
* @ return { Function } Enhanced dispatch function .
* /
2018-12-14 12:02:53 +01:00
2018-12-18 04:14:52 +01:00
function createPersistOnChange ( getState , reducerKey , keys ) {
var lastState = getState ( ) ;
return function ( result ) {
var state = getState ( ) ;
2018-12-14 05:41:57 +01:00
2018-12-18 04:14:52 +01:00
if ( state !== lastState ) {
if ( Array . isArray ( keys ) ) {
state = Object ( external _lodash _ [ "pick" ] ) ( state , keys ) ;
}
2018-12-14 05:41:57 +01:00
2018-12-18 04:14:52 +01:00
persistence . set ( reducerKey , state ) ;
lastState = state ;
}
2018-12-14 05:41:57 +01:00
2018-12-18 04:14:52 +01:00
return result ;
} ;
}
2018-12-14 05:41:57 +01:00
2018-12-18 04:14:52 +01:00
return {
registerStore : function registerStore ( reducerKey , options ) {
if ( ! options . persist ) {
return registry . registerStore ( reducerKey , options ) ;
}
2018-12-14 05:41:57 +01:00
2018-12-18 04:14:52 +01:00
var initialState = persistence . get ( ) [ reducerKey ] ;
options = Object ( objectSpread [ "a" /* default */ ] ) ( { } , options , {
reducer : withInitialState ( options . reducer , initialState )
} ) ;
var store = registry . registerStore ( reducerKey , options ) ;
store . dispatch = Object ( external _lodash _ [ "flow" ] ) ( [ store . dispatch , createPersistOnChange ( store . getState , reducerKey , options . persist ) ] ) ;
return store ;
}
} ;
} ) ;
2018-12-14 05:41:57 +01:00
2018-12-18 04:14:52 +01:00
// CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/plugins/index.js
2018-12-14 05:41:57 +01:00
2018-12-18 04:14:52 +01:00
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/extends.js
var esm _extends = _ _webpack _require _ _ ( 18 ) ;
2018-12-14 05:41:57 +01:00
2018-12-18 04:14:52 +01:00
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/classCallCheck.js
var classCallCheck = _ _webpack _require _ _ ( 10 ) ;
2018-12-14 05:41:57 +01:00
2018-12-18 04:14:52 +01:00
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/createClass.js
var createClass = _ _webpack _require _ _ ( 9 ) ;
2018-12-14 05:41:57 +01:00
2018-12-18 04:14:52 +01:00
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js
var possibleConstructorReturn = _ _webpack _require _ _ ( 12 ) ;
2018-12-14 05:41:57 +01:00
2018-12-18 04:14:52 +01:00
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js
var getPrototypeOf = _ _webpack _require _ _ ( 13 ) ;
2018-12-14 05:41:57 +01:00
2018-12-18 04:14:52 +01:00
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/inherits.js + 1 modules
var inherits = _ _webpack _require _ _ ( 14 ) ;
2018-12-14 05:41:57 +01:00
2018-12-18 04:14:52 +01:00
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js
var assertThisInitialized = _ _webpack _require _ _ ( 3 ) ;
2018-12-14 05:41:57 +01:00
2018-12-18 04:14:52 +01:00
// EXTERNAL MODULE: external {"this":["wp","element"]}
var external _this _wp _element _ = _ _webpack _require _ _ ( 0 ) ;
2018-12-14 05:41:57 +01:00
2018-12-18 04:14:52 +01:00
// EXTERNAL MODULE: external {"this":["wp","isShallowEqual"]}
var external _this _wp _isShallowEqual _ = _ _webpack _require _ _ ( 40 ) ;
var external _this _wp _isShallowEqual _default = /*#__PURE__*/ _ _webpack _require _ _ . n ( external _this _wp _isShallowEqual _ ) ;
2018-12-14 05:41:57 +01:00
2018-12-18 04:14:52 +01:00
// EXTERNAL MODULE: external {"this":["wp","compose"]}
var external _this _wp _compose _ = _ _webpack _require _ _ ( 7 ) ;
2018-12-14 05:41:57 +01:00
2018-12-18 04:14:52 +01:00
// CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/components/registry-provider/index.js
/ * *
* WordPress dependencies
* /
2018-12-14 05:41:57 +01:00
2018-12-18 04:14:52 +01:00
/ * *
* Internal dependencies
* /
2018-12-14 05:41:57 +01:00
2018-12-18 04:14:52 +01:00
var _createContext = Object ( external _this _wp _element _ [ "createContext" ] ) ( default _registry ) ,
Consumer = _createContext . Consumer ,
Provider = _createContext . Provider ;
2018-12-14 05:41:57 +01:00
2018-12-18 04:14:52 +01:00
var RegistryConsumer = Consumer ;
/* harmony default export */ var registry _provider = ( Provider ) ;
2018-12-14 05:41:57 +01:00
2018-12-18 04:14:52 +01:00
// CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/components/with-select/index.js
2018-12-14 05:41:57 +01:00
/ * *
2018-12-18 04:14:52 +01:00
* WordPress dependencies
2018-12-14 05:41:57 +01:00
* /
2018-12-18 04:14:52 +01:00
/ * *
* Internal dependencies
* /
2018-12-14 05:41:57 +01:00
2018-12-18 04:14:52 +01:00
/ * *
* Higher - order component used to inject state - derived props using registered
* selectors .
*
* @ param { Function } mapSelectToProps Function called on every state change ,
* expected to return object of props to
* merge with the component ' s own props .
*
* @ return { Component } Enhanced component with merged state data props .
* /
2018-12-14 05:41:57 +01:00
2018-12-18 04:14:52 +01:00
var with _select _withSelect = function withSelect ( mapSelectToProps ) {
return Object ( external _this _wp _compose _ [ "createHigherOrderComponent" ] ) ( function ( WrappedComponent ) {
2018-12-14 05:41:57 +01:00
/ * *
2018-12-18 04:14:52 +01:00
* Default merge props . A constant value is used as the fallback since it
* can be more efficiently shallow compared in case component is repeatedly
* rendered without its own merge props .
2018-12-14 05:41:57 +01:00
*
2018-12-18 04:14:52 +01:00
* @ type { Object }
* /
var DEFAULT _MERGE _PROPS = { } ;
/ * *
* Given a props object , returns the next merge props by mapSelectToProps .
2018-12-14 05:41:57 +01:00
*
2018-12-18 04:14:52 +01:00
* @ param { Object } props Props to pass as argument to mapSelectToProps .
*
* @ return { Object } Props to merge into rendered wrapped element .
2018-12-14 05:41:57 +01:00
* /
2018-12-18 04:14:52 +01:00
function getNextMergeProps ( props ) {
2018-12-19 04:16:48 +01:00
return mapSelectToProps ( props . registry . select , props . ownProps , props . registry ) || DEFAULT _MERGE _PROPS ;
2018-12-18 04:14:52 +01:00
}
2018-12-14 05:41:57 +01:00
2018-12-18 04:14:52 +01:00
var ComponentWithSelect =
/*#__PURE__*/
function ( _Component ) {
Object ( inherits [ "a" /* default */ ] ) ( ComponentWithSelect , _Component ) ;
2018-12-14 05:41:57 +01:00
2018-12-18 04:14:52 +01:00
function ComponentWithSelect ( props ) {
var _this ;
2018-12-14 05:41:57 +01:00
2018-12-18 04:14:52 +01:00
Object ( classCallCheck [ "a" /* default */ ] ) ( this , ComponentWithSelect ) ;
2018-12-14 05:41:57 +01:00
2018-12-18 04:14:52 +01:00
_this = Object ( possibleConstructorReturn [ "a" /* default */ ] ) ( this , Object ( getPrototypeOf [ "a" /* default */ ] ) ( ComponentWithSelect ) . call ( this , props ) ) ;
_this . onStoreChange = _this . onStoreChange . bind ( Object ( assertThisInitialized [ "a" /* default */ ] ) ( Object ( assertThisInitialized [ "a" /* default */ ] ) ( _this ) ) ) ;
2018-12-14 05:41:57 +01:00
2018-12-18 04:14:52 +01:00
_this . subscribe ( props . registry ) ;
2018-12-14 05:41:57 +01:00
2018-12-18 04:14:52 +01:00
_this . mergeProps = getNextMergeProps ( props ) ;
return _this ;
}
2018-12-14 05:41:57 +01:00
2018-12-18 04:14:52 +01:00
Object ( createClass [ "a" /* default */ ] ) ( ComponentWithSelect , [ {
key : "componentDidMount" ,
value : function componentDidMount ( ) {
this . canRunSelection = true ; // A state change may have occurred between the constructor and
// mount of the component (e.g. during the wrapped component's own
// constructor), in which case selection should be rerun.
2018-12-14 05:41:57 +01:00
2018-12-18 04:14:52 +01:00
if ( this . hasQueuedSelection ) {
this . hasQueuedSelection = false ;
this . onStoreChange ( ) ;
}
}
} , {
key : "componentWillUnmount" ,
value : function componentWillUnmount ( ) {
this . canRunSelection = false ;
this . unsubscribe ( ) ;
}
} , {
key : "shouldComponentUpdate" ,
value : function shouldComponentUpdate ( nextProps , nextState ) {
// Cycle subscription if registry changes.
var hasRegistryChanged = nextProps . registry !== this . props . registry ;
2018-12-14 05:41:57 +01:00
2018-12-18 04:14:52 +01:00
if ( hasRegistryChanged ) {
this . unsubscribe ( ) ;
this . subscribe ( nextProps . registry ) ;
} // Treat a registry change as equivalent to `ownProps`, to reflect
// `mergeProps` to rendered component if and only if updated.
2018-12-14 05:41:57 +01:00
2018-12-18 04:14:52 +01:00
var hasPropsChanged = hasRegistryChanged || ! external _this _wp _isShallowEqual _default ( ) ( this . props . ownProps , nextProps . ownProps ) ; // Only render if props have changed or merge props have been updated
// from the store subscriber.
2018-12-14 05:41:57 +01:00
2018-12-18 04:14:52 +01:00
if ( this . state === nextState && ! hasPropsChanged ) {
return false ;
}
2018-12-14 05:41:57 +01:00
2018-12-18 04:14:52 +01:00
if ( hasPropsChanged ) {
var nextMergeProps = getNextMergeProps ( nextProps ) ;
2018-12-14 05:41:57 +01:00
2018-12-18 04:14:52 +01:00
if ( ! external _this _wp _isShallowEqual _default ( ) ( this . mergeProps , nextMergeProps ) ) {
// If merge props change as a result of the incoming props,
// they should be reflected as such in the upcoming render.
// While side effects are discouraged in lifecycle methods,
// this component is used heavily, and prior efforts to use
// `getDerivedStateFromProps` had demonstrated miserable
// performance.
this . mergeProps = nextMergeProps ;
} // Regardless whether merge props are changing, fall through to
// incur the render since the component will need to receive
// the changed `ownProps`.
2018-12-14 05:41:57 +01:00
2018-12-18 04:14:52 +01:00
}
2018-12-14 05:41:57 +01:00
2018-12-18 04:14:52 +01:00
return true ;
}
} , {
key : "onStoreChange" ,
value : function onStoreChange ( ) {
if ( ! this . canRunSelection ) {
this . hasQueuedSelection = true ;
return ;
}
2018-12-14 05:41:57 +01:00
2018-12-18 04:14:52 +01:00
var nextMergeProps = getNextMergeProps ( this . props ) ;
2018-12-14 05:41:57 +01:00
2018-12-18 04:14:52 +01:00
if ( external _this _wp _isShallowEqual _default ( ) ( this . mergeProps , nextMergeProps ) ) {
return ;
}
2018-12-14 05:41:57 +01:00
2018-12-18 04:14:52 +01:00
this . mergeProps = nextMergeProps ; // Schedule an update. Merge props are not assigned to state since
// derivation of merge props from incoming props occurs within
// shouldComponentUpdate, where setState is not allowed. setState
// is used here instead of forceUpdate because forceUpdate bypasses
// shouldComponentUpdate altogether, which isn't desireable if both
// state and props change within the same render. Unfortunately,
// this requires that next merge props are generated twice.
2018-12-14 05:41:57 +01:00
2018-12-18 04:14:52 +01:00
this . setState ( { } ) ;
2018-12-14 05:41:57 +01:00
}
2018-12-18 04:14:52 +01:00
} , {
key : "subscribe" ,
value : function subscribe ( registry ) {
this . unsubscribe = registry . subscribe ( this . onStoreChange ) ;
}
} , {
key : "render" ,
value : function render ( ) {
return Object ( external _this _wp _element _ [ "createElement" ] ) ( WrappedComponent , Object ( esm _extends [ "a" /* default */ ] ) ( { } , this . props . ownProps , this . mergeProps ) ) ;
}
} ] ) ;
2018-12-14 05:41:57 +01:00
2018-12-18 04:14:52 +01:00
return ComponentWithSelect ;
} ( external _this _wp _element _ [ "Component" ] ) ;
2018-12-14 05:41:57 +01:00
2018-12-18 04:14:52 +01:00
return function ( ownProps ) {
return Object ( external _this _wp _element _ [ "createElement" ] ) ( RegistryConsumer , null , function ( registry ) {
return Object ( external _this _wp _element _ [ "createElement" ] ) ( ComponentWithSelect , {
ownProps : ownProps ,
registry : registry
} ) ;
} ) ;
} ;
} , 'withSelect' ) ;
} ;
2018-12-14 05:41:57 +01:00
2018-12-18 04:14:52 +01:00
/* harmony default export */ var with _select = ( with _select _withSelect ) ;
2018-12-14 05:41:57 +01:00
2018-12-18 04:14:52 +01:00
// CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/components/with-dispatch/index.js
2018-12-14 05:41:57 +01:00
2018-12-18 04:14:52 +01:00
/ * *
* External dependencies
* /
2018-12-14 05:41:57 +01:00
/ * *
2018-12-18 04:14:52 +01:00
* WordPress dependencies
2018-12-14 05:41:57 +01:00
* /
2018-12-18 04:14:52 +01:00
2018-12-14 05:41:57 +01:00
/ * *
2018-12-18 04:14:52 +01:00
* Internal dependencies
2018-12-14 05:41:57 +01:00
* /
/ * *
2018-12-18 04:14:52 +01:00
* Higher - order component used to add dispatch props using registered action
* creators .
2018-12-14 05:41:57 +01:00
*
2018-12-18 04:14:52 +01:00
* @ param { Object } mapDispatchToProps Object of prop names where value is a
* dispatch - bound action creator , or a
* function to be called with with the
* component ' s props and returning an
* action creator .
2018-12-14 05:41:57 +01:00
*
2018-12-18 04:14:52 +01:00
* @ return { Component } Enhanced component with merged dispatcher props .
2018-12-14 05:41:57 +01:00
* /
2018-12-18 04:14:52 +01:00
var with _dispatch _withDispatch = function withDispatch ( mapDispatchToProps ) {
return Object ( external _this _wp _compose _ [ "createHigherOrderComponent" ] ) ( function ( WrappedComponent ) {
var ComponentWithDispatch =
/*#__PURE__*/
function ( _Component ) {
Object ( inherits [ "a" /* default */ ] ) ( ComponentWithDispatch , _Component ) ;
2018-12-14 05:41:57 +01:00
2018-12-18 04:14:52 +01:00
function ComponentWithDispatch ( props ) {
var _this ;
2018-12-14 05:41:57 +01:00
2018-12-18 04:14:52 +01:00
Object ( classCallCheck [ "a" /* default */ ] ) ( this , ComponentWithDispatch ) ;
2018-12-14 05:41:57 +01:00
2018-12-18 04:14:52 +01:00
_this = Object ( possibleConstructorReturn [ "a" /* default */ ] ) ( this , Object ( getPrototypeOf [ "a" /* default */ ] ) ( ComponentWithDispatch ) . apply ( this , arguments ) ) ;
_this . proxyProps = { } ;
2018-12-14 05:41:57 +01:00
2018-12-18 04:14:52 +01:00
_this . setProxyProps ( props ) ;
2018-12-14 05:41:57 +01:00
2018-12-18 04:14:52 +01:00
return _this ;
}
2018-12-14 05:41:57 +01:00
2018-12-18 04:14:52 +01:00
Object ( createClass [ "a" /* default */ ] ) ( ComponentWithDispatch , [ {
key : "proxyDispatch" ,
value : function proxyDispatch ( propName ) {
var _mapDispatchToProps ;
2018-12-14 05:41:57 +01:00
2018-12-18 04:14:52 +01:00
for ( var _len = arguments . length , args = new Array ( _len > 1 ? _len - 1 : 0 ) , _key = 1 ; _key < _len ; _key ++ ) {
args [ _key - 1 ] = arguments [ _key ] ;
}
2018-12-14 05:41:57 +01:00
2018-12-18 04:14:52 +01:00
// Original dispatcher is a pre-bound (dispatching) action creator.
2018-12-19 04:16:48 +01:00
( _mapDispatchToProps = mapDispatchToProps ( this . props . registry . dispatch , this . props . ownProps , this . props . registry ) ) [ propName ] . apply ( _mapDispatchToProps , args ) ;
2018-12-18 04:14:52 +01:00
}
} , {
key : "setProxyProps" ,
value : function setProxyProps ( props ) {
var _this2 = this ;
2018-12-14 05:41:57 +01:00
2018-12-18 04:14:52 +01:00
// Assign as instance property so that in subsequent render
// reconciliation, the prop values are referentially equal.
// Importantly, note that while `mapDispatchToProps` is
// called, it is done only to determine the keys for which
// proxy functions should be created. The actual registry
// dispatch does not occur until the function is called.
2018-12-19 04:16:48 +01:00
var propsToDispatchers = mapDispatchToProps ( this . props . registry . dispatch , props . ownProps , this . props . registry ) ;
2018-12-18 04:14:52 +01:00
this . proxyProps = Object ( external _lodash _ [ "mapValues" ] ) ( propsToDispatchers , function ( dispatcher , propName ) {
2018-12-19 04:16:48 +01:00
if ( typeof dispatcher !== 'function' ) {
// eslint-disable-next-line no-console
console . warn ( "Property " . concat ( propName , " returned from mapDispatchToProps in withDispatch must be a function." ) ) ;
} // Prebind with prop name so we have reference to the original
2018-12-18 04:14:52 +01:00
// dispatcher to invoke. Track between re-renders to avoid
// creating new function references every render.
2018-12-19 04:16:48 +01:00
2018-12-18 04:14:52 +01:00
if ( _this2 . proxyProps . hasOwnProperty ( propName ) ) {
return _this2 . proxyProps [ propName ] ;
}
2018-12-14 05:41:57 +01:00
2018-12-18 04:14:52 +01:00
return _this2 . proxyDispatch . bind ( _this2 , propName ) ;
} ) ;
}
} , {
key : "render" ,
value : function render ( ) {
return Object ( external _this _wp _element _ [ "createElement" ] ) ( WrappedComponent , Object ( esm _extends [ "a" /* default */ ] ) ( { } , this . props . ownProps , this . proxyProps ) ) ;
}
} ] ) ;
2018-12-14 05:41:57 +01:00
2018-12-18 04:14:52 +01:00
return ComponentWithDispatch ;
} ( external _this _wp _element _ [ "Component" ] ) ;
2018-12-14 05:41:57 +01:00
2018-12-18 04:14:52 +01:00
return function ( ownProps ) {
return Object ( external _this _wp _element _ [ "createElement" ] ) ( RegistryConsumer , null , function ( registry ) {
return Object ( external _this _wp _element _ [ "createElement" ] ) ( ComponentWithDispatch , {
ownProps : ownProps ,
registry : registry
} ) ;
} ) ;
} ;
} , 'withDispatch' ) ;
} ;
2018-12-14 05:41:57 +01:00
2018-12-18 04:14:52 +01:00
/* harmony default export */ var with _dispatch = ( with _dispatch _withDispatch ) ;
// CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/index.js
/* harmony export (binding) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "select" , function ( ) { return build _module _select ; } ) ;
/* harmony export (binding) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "dispatch" , function ( ) { return build _module _dispatch ; } ) ;
/* harmony export (binding) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "subscribe" , function ( ) { return build _module _subscribe ; } ) ;
/* harmony export (binding) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "registerGenericStore" , function ( ) { return build _module _registerGenericStore ; } ) ;
/* harmony export (binding) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "registerStore" , function ( ) { return build _module _registerStore ; } ) ;
/* harmony export (binding) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "use" , function ( ) { return build _module _use ; } ) ;
/* concated harmony reexport withSelect */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "withSelect" , function ( ) { return with _select ; } ) ;
/* concated harmony reexport withDispatch */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "withDispatch" , function ( ) { return with _dispatch ; } ) ;
/* concated harmony reexport RegistryProvider */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "RegistryProvider" , function ( ) { return registry _provider ; } ) ;
/* concated harmony reexport RegistryConsumer */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "RegistryConsumer" , function ( ) { return RegistryConsumer ; } ) ;
/* concated harmony reexport createRegistry */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "createRegistry" , function ( ) { return createRegistry ; } ) ;
/* concated harmony reexport plugins */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "plugins" , function ( ) { return plugins _namespaceObject ; } ) ;
/* concated harmony reexport combineReducers */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "combineReducers" , function ( ) { return turbo _combine _reducers _default . a ; } ) ;
/ * *
* External dependencies
* /
2018-12-14 05:41:57 +01:00
2018-12-18 04:14:52 +01:00
/ * *
* Internal dependencies
* /
2018-12-14 05:41:57 +01:00
2018-12-18 04:14:52 +01:00
/ * *
* The combineReducers helper function turns an object whose values are different
* reducing functions into a single reducing function you can pass to registerReducer .
*
* @ param { Object } reducers An object whose values correspond to different reducing
* functions that need to be combined into one .
*
* @ return { Function } A reducer that invokes every reducer inside the reducers
* object , and constructs a state object with the same shape .
* /
2018-12-14 05:41:57 +01:00
2018-12-18 04:14:52 +01:00
var build _module _select = default _registry . select ;
var build _module _dispatch = default _registry . dispatch ;
var build _module _subscribe = default _registry . subscribe ;
var build _module _registerGenericStore = default _registry . registerGenericStore ;
var build _module _registerStore = default _registry . registerStore ;
var build _module _use = default _registry . use ;
2018-12-14 05:41:57 +01:00
2018-12-18 04:14:52 +01:00
/***/ } ) ,
2018-12-14 05:41:57 +01:00
2018-12-19 04:16:48 +01:00
/***/ 33 :
2018-12-18 04:14:52 +01:00
/***/ ( function ( module , _ _webpack _exports _ _ , _ _webpack _require _ _ ) {
2018-12-14 05:41:57 +01:00
2018-12-18 04:14:52 +01:00
"use strict" ;
/* harmony export (binding) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "a" , function ( ) { return _iterableToArray ; } ) ;
function _iterableToArray ( iter ) {
if ( Symbol . iterator in Object ( iter ) || Object . prototype . toString . call ( iter ) === "[object Arguments]" ) return Array . from ( iter ) ;
}
2018-12-14 05:41:57 +01:00
2018-12-18 04:14:52 +01:00
/***/ } ) ,
2018-12-14 05:41:57 +01:00
2018-12-18 04:14:52 +01:00
/***/ 35 :
/***/ ( function ( module , _ _webpack _exports _ _ , _ _webpack _require _ _ ) {
2018-12-14 05:41:57 +01:00
2018-12-18 04:14:52 +01:00
"use strict" ;
/* harmony export (binding) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "a" , function ( ) { return _arrayWithHoles ; } ) ;
function _arrayWithHoles ( arr ) {
if ( Array . isArray ( arr ) ) return arr ;
}
2018-12-14 05:41:57 +01:00
2018-12-18 04:14:52 +01:00
/***/ } ) ,
2018-12-14 05:41:57 +01:00
2018-12-18 04:14:52 +01:00
/***/ 36 :
/***/ ( function ( module , _ _webpack _exports _ _ , _ _webpack _require _ _ ) {
2018-12-14 05:41:57 +01:00
2018-12-18 04:14:52 +01:00
"use strict" ;
/* harmony export (binding) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "a" , function ( ) { return _nonIterableRest ; } ) ;
function _nonIterableRest ( ) {
throw new TypeError ( "Invalid attempt to destructure non-iterable instance" ) ;
2018-12-14 05:41:57 +01:00
}
2018-12-18 04:14:52 +01:00
/***/ } ) ,
2018-12-14 05:41:57 +01:00
2018-12-18 04:14:52 +01:00
/***/ 38 :
/***/ ( function ( module , _ _webpack _exports _ _ , _ _webpack _require _ _ ) {
2018-12-14 05:41:57 +01:00
2018-12-18 04:14:52 +01:00
"use strict" ;
/* harmony export (binding) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "a" , function ( ) { return _asyncToGenerator ; } ) ;
function asyncGeneratorStep ( gen , resolve , reject , _next , _throw , key , arg ) {
2018-12-14 05:41:57 +01:00
try {
2018-12-18 04:14:52 +01:00
var info = gen [ key ] ( arg ) ;
var value = info . value ;
} catch ( error ) {
reject ( error ) ;
return ;
}
2018-12-14 05:41:57 +01:00
2018-12-18 04:14:52 +01:00
if ( info . done ) {
resolve ( value ) ;
} else {
Promise . resolve ( value ) . then ( _next , _throw ) ;
}
2018-12-14 05:41:57 +01:00
}
2018-12-18 04:14:52 +01:00
function _asyncToGenerator ( fn ) {
return function ( ) {
var self = this ,
args = arguments ;
return new Promise ( function ( resolve , reject ) {
var gen = fn . apply ( self , args ) ;
function _next ( value ) {
asyncGeneratorStep ( gen , resolve , reject , _next , _throw , "next" , value ) ;
}
function _throw ( err ) {
asyncGeneratorStep ( gen , resolve , reject , _next , _throw , "throw" , err ) ;
}
_next ( undefined ) ;
} ) ;
} ;
2018-12-14 05:41:57 +01:00
}
2018-12-18 04:14:52 +01:00
/***/ } ) ,
2018-12-14 05:41:57 +01:00
2018-12-18 04:14:52 +01:00
/***/ 40 :
/***/ ( function ( module , exports ) {
2018-12-14 05:41:57 +01:00
2018-12-18 04:14:52 +01:00
( function ( ) { module . exports = this [ "wp" ] [ "isShallowEqual" ] ; } ( ) ) ;
2018-12-14 05:41:57 +01:00
2018-12-18 04:14:52 +01:00
/***/ } ) ,
2018-12-14 05:41:57 +01:00
2018-12-18 04:14:52 +01:00
/***/ 51 :
/***/ ( function ( module , exports ) {
2018-12-14 05:41:57 +01:00
2018-12-18 04:14:52 +01:00
var g ;
2018-12-14 05:41:57 +01:00
2018-12-18 04:14:52 +01:00
// This works in non-strict mode
g = ( function ( ) {
return this ;
} ) ( ) ;
2018-12-14 05:41:57 +01:00
2018-12-18 04:14:52 +01:00
try {
// This works if eval is allowed (see CSP)
g = g || new Function ( "return this" ) ( ) ;
} catch ( e ) {
// This works if the window reference is available
if ( typeof window === "object" ) g = window ;
2018-12-14 05:41:57 +01:00
}
2018-12-18 04:14:52 +01:00
// g can still be undefined, but nothing to do about it...
// We return undefined, instead of nothing here, so it's
// easier to handle this case. if(!global) { ...}
2018-12-14 05:41:57 +01:00
2018-12-18 04:14:52 +01:00
module . exports = g ;
2018-12-14 05:41:57 +01:00
2018-12-18 04:14:52 +01:00
/***/ } ) ,
2018-12-14 05:41:57 +01:00
2018-12-19 04:16:48 +01:00
/***/ 62 :
2018-12-18 04:14:52 +01:00
/***/ ( function ( module , _ _webpack _exports _ _ , _ _webpack _require _ _ ) {
2018-12-14 05:41:57 +01:00
2018-12-18 04:14:52 +01:00
"use strict" ;
/* harmony export (binding) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "c" , function ( ) { return createStore ; } ) ;
/* harmony export (binding) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "b" , function ( ) { return combineReducers ; } ) ;
/* unused harmony export bindActionCreators */
/* harmony export (binding) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "a" , function ( ) { return applyMiddleware ; } ) ;
/* unused harmony export compose */
/* unused harmony export __DO_NOT_USE__ActionTypes */
/* harmony import */ var symbol _observable _ _WEBPACK _IMPORTED _MODULE _0 _ _ = _ _webpack _require _ _ ( 67 ) ;
2018-12-14 05:41:57 +01:00
2018-12-18 04:14:52 +01:00
/ * *
* These are private action types reserved by Redux .
* For any unknown actions , you must return the current state .
* If the current state is undefined , you must return the initial state .
* Do not reference these action types directly in your code .
* /
var randomString = function randomString ( ) {
return Math . random ( ) . toString ( 36 ) . substring ( 7 ) . split ( '' ) . join ( '.' ) ;
} ;
2018-12-14 05:41:57 +01:00
2018-12-18 04:14:52 +01:00
var ActionTypes = {
INIT : "@@redux/INIT" + randomString ( ) ,
REPLACE : "@@redux/REPLACE" + randomString ( ) ,
PROBE _UNKNOWN _ACTION : function PROBE _UNKNOWN _ACTION ( ) {
return "@@redux/PROBE_UNKNOWN_ACTION" + randomString ( ) ;
2018-12-14 05:41:57 +01:00
}
2018-12-18 04:14:52 +01:00
} ;
2018-12-14 05:41:57 +01:00
2018-12-18 04:14:52 +01:00
/ * *
* @ param { any } obj The object to inspect .
* @ returns { boolean } True if the argument appears to be a plain object .
* /
function isPlainObject ( obj ) {
if ( typeof obj !== 'object' || obj === null ) return false ;
var proto = obj ;
2018-12-14 05:41:57 +01:00
2018-12-18 04:14:52 +01:00
while ( Object . getPrototypeOf ( proto ) !== null ) {
proto = Object . getPrototypeOf ( proto ) ;
}
2018-12-14 05:41:57 +01:00
2018-12-18 04:14:52 +01:00
return Object . getPrototypeOf ( obj ) === proto ;
2018-12-14 05:41:57 +01:00
}
/ * *
2018-12-18 04:14:52 +01:00
* Creates a Redux store that holds the state tree .
* The only way to change the data in the store is to call ` dispatch() ` on it .
2018-12-14 05:41:57 +01:00
*
2018-12-18 04:14:52 +01:00
* There should only be a single store in your app . To specify how different
* parts of the state tree respond to actions , you may combine several reducers
* into a single reducer function by using ` combineReducers ` .
2018-12-14 05:41:57 +01:00
*
2018-12-18 04:14:52 +01:00
* @ param { Function } reducer A function that returns the next state tree , given
* the current state tree and the action to handle .
2018-12-14 05:41:57 +01:00
*
2018-12-18 04:14:52 +01:00
* @ param { any } [ preloadedState ] The initial state . You may optionally specify it
* to hydrate the state from the server in universal apps , or to restore a
* previously serialized user session .
* If you use ` combineReducers ` to produce the root reducer function , this must be
* an object with the same shape as ` combineReducers ` keys .
2018-12-14 05:41:57 +01:00
*
2018-12-18 04:14:52 +01:00
* @ param { Function } [ enhancer ] The store enhancer . You may optionally specify it
* to enhance the store with third - party capabilities such as middleware ,
* time travel , persistence , etc . The only store enhancer that ships with Redux
* is ` applyMiddleware() ` .
*
* @ returns { Store } A Redux store that lets you read the state , dispatch actions
* and subscribe to changes .
2018-12-14 05:41:57 +01:00
* /
2018-12-18 04:14:52 +01:00
function createStore ( reducer , preloadedState , enhancer ) {
var _ref2 ;
2018-12-14 05:41:57 +01:00
2018-12-18 04:14:52 +01:00
if ( typeof preloadedState === 'function' && typeof enhancer === 'function' || typeof enhancer === 'function' && typeof arguments [ 3 ] === 'function' ) {
throw new Error ( 'It looks like you are passing several store enhancers to ' + 'createStore(). This is not supported. Instead, compose them ' + 'together to a single function' ) ;
2018-12-14 05:41:57 +01:00
}
2018-12-18 04:14:52 +01:00
if ( typeof preloadedState === 'function' && typeof enhancer === 'undefined' ) {
enhancer = preloadedState ;
preloadedState = undefined ;
2018-12-14 05:41:57 +01:00
}
2018-12-18 04:14:52 +01:00
if ( typeof enhancer !== 'undefined' ) {
if ( typeof enhancer !== 'function' ) {
throw new Error ( 'Expected the enhancer to be a function.' ) ;
}
2018-12-14 05:41:57 +01:00
2018-12-18 04:14:52 +01:00
return enhancer ( createStore ) ( reducer , preloadedState ) ;
}
2018-12-14 05:41:57 +01:00
2018-12-18 04:14:52 +01:00
if ( typeof reducer !== 'function' ) {
throw new Error ( 'Expected the reducer to be a function.' ) ;
2018-12-14 05:41:57 +01:00
}
2018-12-18 04:14:52 +01:00
var currentReducer = reducer ;
var currentState = preloadedState ;
var currentListeners = [ ] ;
var nextListeners = currentListeners ;
var isDispatching = false ;
2018-12-14 05:41:57 +01:00
2018-12-18 04:14:52 +01:00
function ensureCanMutateNextListeners ( ) {
if ( nextListeners === currentListeners ) {
nextListeners = currentListeners . slice ( ) ;
}
2018-12-14 05:41:57 +01:00
}
2018-12-18 04:14:52 +01:00
/ * *
* Reads the state tree managed by the store .
*
* @ returns { any } The current state tree of your application .
* /
2018-12-14 05:41:57 +01:00
2018-12-18 04:14:52 +01:00
function getState ( ) {
if ( isDispatching ) {
throw new Error ( 'You may not call store.getState() while the reducer is executing. ' + 'The reducer has already received the state as an argument. ' + 'Pass it down from the top reducer instead of reading it from the store.' ) ;
2018-12-14 05:41:57 +01:00
}
2018-12-18 04:14:52 +01:00
return currentState ;
2018-12-14 05:41:57 +01:00
}
2018-12-18 04:14:52 +01:00
/ * *
* Adds a change listener . It will be called any time an action is dispatched ,
* and some part of the state tree may potentially have changed . You may then
* call ` getState() ` to read the current state tree inside the callback .
*
* You may call ` dispatch() ` from a change listener , with the following
* caveats :
*
* 1. The subscriptions are snapshotted just before every ` dispatch() ` call .
* If you subscribe or unsubscribe while the listeners are being invoked , this
* will not have any effect on the ` dispatch() ` that is currently in progress .
* However , the next ` dispatch() ` call , whether nested or not , will use a more
* recent snapshot of the subscription list .
*
* 2. The listener should not expect to see all state changes , as the state
* might have been updated multiple times during a nested ` dispatch() ` before
* the listener is called . It is , however , guaranteed that all subscribers
* registered before the ` dispatch() ` started will be called with the latest
* state by the time it exits .
*
* @ param { Function } listener A callback to be invoked on every dispatch .
* @ returns { Function } A function to remove this change listener .
* /
function subscribe ( listener ) {
if ( typeof listener !== 'function' ) {
throw new Error ( 'Expected the listener to be a function.' ) ;
}
if ( isDispatching ) {
throw new Error ( 'You may not call store.subscribe() while the reducer is executing. ' + 'If you would like to be notified after the store has been updated, subscribe from a ' + 'component and invoke store.getState() in the callback to access the latest state. ' + 'See https://redux.js.org/api-reference/store#subscribe(listener) for more details.' ) ;
}
var isSubscribed = true ;
ensureCanMutateNextListeners ( ) ;
nextListeners . push ( listener ) ;
return function unsubscribe ( ) {
if ( ! isSubscribed ) {
return ;
}
if ( isDispatching ) {
throw new Error ( 'You may not unsubscribe from a store listener while the reducer is executing. ' + 'See https://redux.js.org/api-reference/store#subscribe(listener) for more details.' ) ;
}
isSubscribed = false ;
ensureCanMutateNextListeners ( ) ;
var index = nextListeners . indexOf ( listener ) ;
nextListeners . splice ( index , 1 ) ;
} ;
}
/ * *
* Dispatches an action . It is the only way to trigger a state change .
*
* The ` reducer ` function , used to create the store , will be called with the
* current state tree and the given ` action ` . Its return value will
* be considered the * * next * * state of the tree , and the change listeners
* will be notified .
*
* The base implementation only supports plain object actions . If you want to
* dispatch a Promise , an Observable , a thunk , or something else , you need to
* wrap your store creating function into the corresponding middleware . For
* example , see the documentation for the ` redux-thunk ` package . Even the
* middleware will eventually dispatch plain object actions using this method .
*
* @ param { Object } action A plain object representing “ what changed ” . It is
* a good idea to keep actions serializable so you can record and replay user
* sessions , or use the time travelling ` redux-devtools ` . An action must have
* a ` type ` property which may not be ` undefined ` . It is a good idea to use
* string constants for action types .
*
* @ returns { Object } For convenience , the same action object you dispatched .
*
* Note that , if you use a custom middleware , it may wrap ` dispatch() ` to
* return something else ( for example , a Promise you can await ) .
* /
function dispatch ( action ) {
if ( ! isPlainObject ( action ) ) {
throw new Error ( 'Actions must be plain objects. ' + 'Use custom middleware for async actions.' ) ;
}
if ( typeof action . type === 'undefined' ) {
throw new Error ( 'Actions may not have an undefined "type" property. ' + 'Have you misspelled a constant?' ) ;
}
if ( isDispatching ) {
throw new Error ( 'Reducers may not dispatch actions.' ) ;
}
try {
isDispatching = true ;
currentState = currentReducer ( currentState , action ) ;
} finally {
isDispatching = false ;
}
var listeners = currentListeners = nextListeners ;
for ( var i = 0 ; i < listeners . length ; i ++ ) {
var listener = listeners [ i ] ;
listener ( ) ;
}
return action ;
}
/ * *
* Replaces the reducer currently used by the store to calculate the state .
*
* You might need this if your app implements code splitting and you want to
* load some of the reducers dynamically . You might also need this if you
* implement a hot reloading mechanism for Redux .
*
* @ param { Function } nextReducer The reducer for the store to use instead .
* @ returns { void }
* /
function replaceReducer ( nextReducer ) {
if ( typeof nextReducer !== 'function' ) {
throw new Error ( 'Expected the nextReducer to be a function.' ) ;
}
currentReducer = nextReducer ;
dispatch ( {
type : ActionTypes . REPLACE
} ) ;
}
/ * *
* Interoperability point for observable / reactive libraries .
* @ returns { observable } A minimal observable of state changes .
* For more information , see the observable proposal :
* https : //github.com/tc39/proposal-observable
* /
function observable ( ) {
var _ref ;
var outerSubscribe = subscribe ;
return _ref = {
/ * *
* The minimal observable subscription method .
* @ param { Object } observer Any object that can be used as an observer .
* The observer object should have a ` next ` method .
* @ returns { subscription } An object with an ` unsubscribe ` method that can
* be used to unsubscribe the observable from the store , and prevent further
* emission of values from the observable .
* /
subscribe : function subscribe ( observer ) {
if ( typeof observer !== 'object' || observer === null ) {
throw new TypeError ( 'Expected the observer to be an object.' ) ;
}
function observeState ( ) {
if ( observer . next ) {
observer . next ( getState ( ) ) ;
}
}
observeState ( ) ;
var unsubscribe = outerSubscribe ( observeState ) ;
return {
unsubscribe : unsubscribe
} ;
}
} , _ref [ symbol _observable _ _WEBPACK _IMPORTED _MODULE _0 _ _ [ /* default */ "a" ] ] = function ( ) {
return this ;
} , _ref ;
} // When a store is created, an "INIT" action is dispatched so that every
// reducer returns their initial state. This effectively populates
// the initial state tree.
dispatch ( {
type : ActionTypes . INIT
} ) ;
return _ref2 = {
dispatch : dispatch ,
subscribe : subscribe ,
getState : getState ,
replaceReducer : replaceReducer
} , _ref2 [ symbol _observable _ _WEBPACK _IMPORTED _MODULE _0 _ _ [ /* default */ "a" ] ] = observable , _ref2 ;
}
/ * *
* Prints a warning in the console if it exists .
*
* @ param { String } message The warning message .
* @ returns { void }
* /
function warning ( message ) {
/* eslint-disable no-console */
if ( typeof console !== 'undefined' && typeof console . error === 'function' ) {
console . error ( message ) ;
}
/* eslint-enable no-console */
try {
// This error was thrown as a convenience so that if you enable
// "break on all exceptions" in your console,
// it would pause the execution at this line.
throw new Error ( message ) ;
} catch ( e ) { } // eslint-disable-line no-empty
}
function getUndefinedStateErrorMessage ( key , action ) {
var actionType = action && action . type ;
var actionDescription = actionType && "action \"" + String ( actionType ) + "\"" || 'an action' ;
return "Given " + actionDescription + ", reducer \"" + key + "\" returned undefined. " + "To ignore an action, you must explicitly return the previous state. " + "If you want this reducer to hold no value, you can return null instead of undefined." ;
}
function getUnexpectedStateShapeWarningMessage ( inputState , reducers , action , unexpectedKeyCache ) {
var reducerKeys = Object . keys ( reducers ) ;
var argumentName = action && action . type === ActionTypes . INIT ? 'preloadedState argument passed to createStore' : 'previous state received by the reducer' ;
if ( reducerKeys . length === 0 ) {
return 'Store does not have a valid reducer. Make sure the argument passed ' + 'to combineReducers is an object whose values are reducers.' ;
}
if ( ! isPlainObject ( inputState ) ) {
return "The " + argumentName + " has unexpected type of \"" + { } . toString . call ( inputState ) . match ( /\s([a-z|A-Z]+)/ ) [ 1 ] + "\". Expected argument to be an object with the following " + ( "keys: \"" + reducerKeys . join ( '", "' ) + "\"" ) ;
}
var unexpectedKeys = Object . keys ( inputState ) . filter ( function ( key ) {
return ! reducers . hasOwnProperty ( key ) && ! unexpectedKeyCache [ key ] ;
} ) ;
unexpectedKeys . forEach ( function ( key ) {
unexpectedKeyCache [ key ] = true ;
} ) ;
if ( action && action . type === ActionTypes . REPLACE ) return ;
if ( unexpectedKeys . length > 0 ) {
return "Unexpected " + ( unexpectedKeys . length > 1 ? 'keys' : 'key' ) + " " + ( "\"" + unexpectedKeys . join ( '", "' ) + "\" found in " + argumentName + ". " ) + "Expected to find one of the known reducer keys instead: " + ( "\"" + reducerKeys . join ( '", "' ) + "\". Unexpected keys will be ignored." ) ;
}
}
function assertReducerShape ( reducers ) {
Object . keys ( reducers ) . forEach ( function ( key ) {
var reducer = reducers [ key ] ;
var initialState = reducer ( undefined , {
type : ActionTypes . INIT
} ) ;
if ( typeof initialState === 'undefined' ) {
throw new Error ( "Reducer \"" + key + "\" returned undefined during initialization. " + "If the state passed to the reducer is undefined, you must " + "explicitly return the initial state. The initial state may " + "not be undefined. If you don't want to set a value for this reducer, " + "you can use null instead of undefined." ) ;
}
if ( typeof reducer ( undefined , {
type : ActionTypes . PROBE _UNKNOWN _ACTION ( )
} ) === 'undefined' ) {
throw new Error ( "Reducer \"" + key + "\" returned undefined when probed with a random type. " + ( "Don't try to handle " + ActionTypes . INIT + " or other actions in \"redux/*\" " ) + "namespace. They are considered private. Instead, you must return the " + "current state for any unknown actions, unless it is undefined, " + "in which case you must return the initial state, regardless of the " + "action type. The initial state may not be undefined, but can be null." ) ;
}
} ) ;
}
/ * *
* Turns an object whose values are different reducer functions , into a single
* reducer function . It will call every child reducer , and gather their results
* into a single state object , whose keys correspond to the keys of the passed
* reducer functions .
*
* @ param { Object } reducers An object whose values correspond to different
* reducer functions that need to be combined into one . One handy way to obtain
* it is to use ES6 ` import * as reducers ` syntax . The reducers may never return
* undefined for any action . Instead , they should return their initial state
* if the state passed to them was undefined , and the current state for any
* unrecognized action .
*
* @ returns { Function } A reducer function that invokes every reducer inside the
* passed object , and builds a state object with the same shape .
* /
function combineReducers ( reducers ) {
var reducerKeys = Object . keys ( reducers ) ;
var finalReducers = { } ;
for ( var i = 0 ; i < reducerKeys . length ; i ++ ) {
var key = reducerKeys [ i ] ;
if ( false ) { }
if ( typeof reducers [ key ] === 'function' ) {
finalReducers [ key ] = reducers [ key ] ;
}
}
var finalReducerKeys = Object . keys ( finalReducers ) ;
var unexpectedKeyCache ;
if ( false ) { }
var shapeAssertionError ;
try {
assertReducerShape ( finalReducers ) ;
} catch ( e ) {
shapeAssertionError = e ;
}
return function combination ( state , action ) {
if ( state === void 0 ) {
state = { } ;
}
if ( shapeAssertionError ) {
throw shapeAssertionError ;
}
if ( false ) { var warningMessage ; }
var hasChanged = false ;
var nextState = { } ;
for ( var _i = 0 ; _i < finalReducerKeys . length ; _i ++ ) {
var _key = finalReducerKeys [ _i ] ;
var reducer = finalReducers [ _key ] ;
var previousStateForKey = state [ _key ] ;
var nextStateForKey = reducer ( previousStateForKey , action ) ;
if ( typeof nextStateForKey === 'undefined' ) {
var errorMessage = getUndefinedStateErrorMessage ( _key , action ) ;
throw new Error ( errorMessage ) ;
}
nextState [ _key ] = nextStateForKey ;
hasChanged = hasChanged || nextStateForKey !== previousStateForKey ;
}
return hasChanged ? nextState : state ;
} ;
}
function bindActionCreator ( actionCreator , dispatch ) {
return function ( ) {
return dispatch ( actionCreator . apply ( this , arguments ) ) ;
} ;
}
/ * *
* Turns an object whose values are action creators , into an object with the
* same keys , but with every function wrapped into a ` dispatch ` call so they
* may be invoked directly . This is just a convenience method , as you can call
* ` store.dispatch(MyActionCreators.doSomething()) ` yourself just fine .
*
* For convenience , you can also pass a single function as the first argument ,
* and get a function in return .
*
* @ param { Function | Object } actionCreators An object whose values are action
* creator functions . One handy way to obtain it is to use ES6 ` import * as `
* syntax . You may also pass a single function .
*
* @ param { Function } dispatch The ` dispatch ` function available on your Redux
* store .
*
* @ returns { Function | Object } The object mimicking the original object , but with
* every action creator wrapped into the ` dispatch ` call . If you passed a
* function as ` actionCreators ` , the return value will also be a single
* function .
* /
function bindActionCreators ( actionCreators , dispatch ) {
if ( typeof actionCreators === 'function' ) {
return bindActionCreator ( actionCreators , dispatch ) ;
}
if ( typeof actionCreators !== 'object' || actionCreators === null ) {
throw new Error ( "bindActionCreators expected an object or a function, instead received " + ( actionCreators === null ? 'null' : typeof actionCreators ) + ". " + "Did you write \"import ActionCreators from\" instead of \"import * as ActionCreators from\"?" ) ;
}
var keys = Object . keys ( actionCreators ) ;
var boundActionCreators = { } ;
for ( var i = 0 ; i < keys . length ; i ++ ) {
var key = keys [ i ] ;
var actionCreator = actionCreators [ key ] ;
if ( typeof actionCreator === 'function' ) {
boundActionCreators [ key ] = bindActionCreator ( actionCreator , dispatch ) ;
}
}
return boundActionCreators ;
}
function _defineProperty ( obj , key , value ) {
if ( key in obj ) {
Object . defineProperty ( obj , key , {
value : value ,
enumerable : true ,
configurable : true ,
writable : true
} ) ;
} else {
obj [ key ] = value ;
}
return obj ;
}
function _objectSpread ( target ) {
for ( var i = 1 ; i < arguments . length ; i ++ ) {
var source = arguments [ i ] != null ? arguments [ i ] : { } ;
var ownKeys = Object . keys ( source ) ;
if ( typeof Object . getOwnPropertySymbols === 'function' ) {
ownKeys = ownKeys . concat ( Object . getOwnPropertySymbols ( source ) . filter ( function ( sym ) {
return Object . getOwnPropertyDescriptor ( source , sym ) . enumerable ;
} ) ) ;
}
ownKeys . forEach ( function ( key ) {
_defineProperty ( target , key , source [ key ] ) ;
} ) ;
}
return target ;
}
/ * *
* Composes single - argument functions from right to left . The rightmost
* function can take multiple arguments as it provides the signature for
2018-12-14 05:41:57 +01:00
* the resulting composite function .
*
* @ param { ... Function } funcs The functions to compose .
* @ returns { Function } A function obtained by composing the argument functions
* from right to left . For example , compose ( f , g , h ) is identical to doing
* ( ... args ) => f ( g ( h ( ... args ) ) ) .
* /
function compose ( ) {
for ( var _len = arguments . length , funcs = new Array ( _len ) , _key = 0 ; _key < _len ; _key ++ ) {
funcs [ _key ] = arguments [ _key ] ;
}
2018-12-18 04:14:52 +01:00
if ( funcs . length === 0 ) {
return function ( arg ) {
return arg ;
} ;
}
if ( funcs . length === 1 ) {
return funcs [ 0 ] ;
}
return funcs . reduce ( function ( a , b ) {
return function ( ) {
return a ( b . apply ( void 0 , arguments ) ) ;
} ;
} ) ;
}
/ * *
* Creates a store enhancer that applies middleware to the dispatch method
* of the Redux store . This is handy for a variety of tasks , such as expressing
* asynchronous actions in a concise manner , or logging every action payload .
*
* See ` redux-thunk ` package as an example of the Redux middleware .
*
* Because middleware is potentially asynchronous , this should be the first
* store enhancer in the composition chain .
*
* Note that each middleware will be given the ` dispatch ` and ` getState ` functions
* as named arguments .
*
* @ param { ... Function } middlewares The middleware chain to be applied .
* @ returns { Function } A store enhancer applying the middleware .
* /
function applyMiddleware ( ) {
for ( var _len = arguments . length , middlewares = new Array ( _len ) , _key = 0 ; _key < _len ; _key ++ ) {
middlewares [ _key ] = arguments [ _key ] ;
}
return function ( createStore ) {
return function ( ) {
var store = createStore . apply ( void 0 , arguments ) ;
var _dispatch = function dispatch ( ) {
throw new Error ( "Dispatching while constructing your middleware is not allowed. " + "Other middleware would not be applied to this dispatch." ) ;
} ;
var middlewareAPI = {
getState : store . getState ,
dispatch : function dispatch ( ) {
return _dispatch . apply ( void 0 , arguments ) ;
}
} ;
var chain = middlewares . map ( function ( middleware ) {
return middleware ( middlewareAPI ) ;
} ) ;
_dispatch = compose . apply ( void 0 , chain ) ( store . dispatch ) ;
return _objectSpread ( { } , store , {
dispatch : _dispatch
} ) ;
} ;
} ;
}
/ *
* This is a dummy function to check if the function name has been altered by minification .
* If the function has been minified and NODE _ENV !== 'production' , warn the user .
* /
function isCrushed ( ) { }
if ( false ) { }
/***/ } ) ,
/***/ 66 :
/***/ ( function ( module , exports , _ _webpack _require _ _ ) {
"use strict" ;
function _typeof ( obj ) {
if ( typeof Symbol === "function" && typeof Symbol . iterator === "symbol" ) {
_typeof = function ( obj ) {
return typeof obj ;
} ;
} else {
_typeof = function ( obj ) {
return obj && typeof Symbol === "function" && obj . constructor === Symbol && obj !== Symbol . prototype ? "symbol" : typeof obj ;
} ;
}
return _typeof ( obj ) ;
}
function _classCallCheck ( instance , Constructor ) {
if ( ! ( instance instanceof Constructor ) ) {
throw new TypeError ( "Cannot call a class as a function" ) ;
2018-12-14 05:41:57 +01:00
}
2018-12-18 04:14:52 +01:00
}
2018-12-14 05:41:57 +01:00
2018-12-18 04:14:52 +01:00
function _defineProperties ( target , props ) {
for ( var i = 0 ; i < props . length ; i ++ ) {
var descriptor = props [ i ] ;
descriptor . enumerable = descriptor . enumerable || false ;
descriptor . configurable = true ;
if ( "value" in descriptor ) descriptor . writable = true ;
Object . defineProperty ( target , descriptor . key , descriptor ) ;
2018-12-14 05:41:57 +01:00
}
2018-12-18 04:14:52 +01:00
}
2018-12-14 05:41:57 +01:00
2018-12-18 04:14:52 +01:00
function _createClass ( Constructor , protoProps , staticProps ) {
if ( protoProps ) _defineProperties ( Constructor . prototype , protoProps ) ;
if ( staticProps ) _defineProperties ( Constructor , staticProps ) ;
return Constructor ;
2018-12-14 05:41:57 +01:00
}
/ * *
2018-12-18 04:14:52 +01:00
* Given an instance of EquivalentKeyMap , returns its internal value pair tuple
* for a key , if one exists . The tuple members consist of the last reference
* value for the key ( used in efficient subsequent lookups ) and the value
* assigned for the key at the leaf node .
2018-12-14 05:41:57 +01:00
*
2018-12-18 04:14:52 +01:00
* @ param { EquivalentKeyMap } instance EquivalentKeyMap instance .
* @ param { * } key The key for which to return value pair .
2018-12-14 05:41:57 +01:00
*
2018-12-18 04:14:52 +01:00
* @ return { ? Array } Value pair , if exists .
* /
function getValuePair ( instance , key ) {
var _map = instance . _map ,
_arrayTreeMap = instance . _arrayTreeMap ,
_objectTreeMap = instance . _objectTreeMap ; // Map keeps a reference to the last object-like key used to set the
// value, which can be used to shortcut immediately to the value.
if ( _map . has ( key ) ) {
return _map . get ( key ) ;
} // Sort keys to ensure stable retrieval from tree.
var properties = Object . keys ( key ) . sort ( ) ; // Tree by type to avoid conflicts on numeric object keys, empty value.
var map = Array . isArray ( key ) ? _arrayTreeMap : _objectTreeMap ;
for ( var i = 0 ; i < properties . length ; i ++ ) {
var property = properties [ i ] ;
map = map . get ( property ) ;
if ( map === undefined ) {
return ;
}
var propertyValue = key [ property ] ;
map = map . get ( propertyValue ) ;
if ( map === undefined ) {
return ;
}
}
var valuePair = map . get ( '_ekm_value' ) ;
if ( ! valuePair ) {
return ;
} // If reached, it implies that an object-like key was set with another
// reference, so delete the reference and replace with the current.
_map . delete ( valuePair [ 0 ] ) ;
valuePair [ 0 ] = key ;
map . set ( '_ekm_value' , valuePair ) ;
_map . set ( key , valuePair ) ;
return valuePair ;
}
/ * *
* Variant of a Map object which enables lookup by equivalent ( deeply equal )
* object and array keys .
2018-12-14 05:41:57 +01:00
* /
2018-12-18 04:14:52 +01:00
var EquivalentKeyMap =
/*#__PURE__*/
function ( ) {
/ * *
* Constructs a new instance of EquivalentKeyMap .
*
* @ param { Iterable . < * > } iterable Initial pair of key , value for map .
* /
function EquivalentKeyMap ( iterable ) {
_classCallCheck ( this , EquivalentKeyMap ) ;
this . clear ( ) ;
if ( iterable instanceof EquivalentKeyMap ) {
// Map#forEach is only means of iterating with support for IE11.
var iterablePairs = [ ] ;
iterable . forEach ( function ( value , key ) {
iterablePairs . push ( [ key , value ] ) ;
} ) ;
iterable = iterablePairs ;
}
if ( iterable != null ) {
for ( var i = 0 ; i < iterable . length ; i ++ ) {
this . set ( iterable [ i ] [ 0 ] , iterable [ i ] [ 1 ] ) ;
}
}
}
/ * *
* Accessor property returning the number of elements .
*
* @ return { number } Number of elements .
* /
_createClass ( EquivalentKeyMap , [ {
key : "set" ,
/ * *
* Add or update an element with a specified key and value .
*
* @ param { * } key The key of the element to add .
* @ param { * } value The value of the element to add .
*
* @ return { EquivalentKeyMap } Map instance .
* /
value : function set ( key , value ) {
// Shortcut non-object-like to set on internal Map.
if ( key === null || _typeof ( key ) !== 'object' ) {
this . _map . set ( key , value ) ;
return this ;
} // Sort keys to ensure stable assignment into tree.
var properties = Object . keys ( key ) . sort ( ) ;
var valuePair = [ key , value ] ; // Tree by type to avoid conflicts on numeric object keys, empty value.
var map = Array . isArray ( key ) ? this . _arrayTreeMap : this . _objectTreeMap ;
for ( var i = 0 ; i < properties . length ; i ++ ) {
var property = properties [ i ] ;
if ( ! map . has ( property ) ) {
map . set ( property , new EquivalentKeyMap ( ) ) ;
}
map = map . get ( property ) ;
var propertyValue = key [ property ] ;
if ( ! map . has ( propertyValue ) ) {
map . set ( propertyValue , new EquivalentKeyMap ( ) ) ;
}
map = map . get ( propertyValue ) ;
} // If an _ekm_value exists, there was already an equivalent key. Before
// overriding, ensure that the old key reference is removed from map to
// avoid memory leak of accumulating equivalent keys. This is, in a
// sense, a poor man's WeakMap, while still enabling iterability.
var previousValuePair = map . get ( '_ekm_value' ) ;
if ( previousValuePair ) {
this . _map . delete ( previousValuePair [ 0 ] ) ;
}
map . set ( '_ekm_value' , valuePair ) ;
this . _map . set ( key , valuePair ) ;
return this ;
}
/ * *
* Returns a specified element .
*
* @ param { * } key The key of the element to return .
*
* @ return { ? * } The element associated with the specified key or undefined
* if the key can ' t be found .
* /
} , {
key : "get" ,
value : function get ( key ) {
// Shortcut non-object-like to get from internal Map.
if ( key === null || _typeof ( key ) !== 'object' ) {
return this . _map . get ( key ) ;
}
var valuePair = getValuePair ( this , key ) ;
if ( valuePair ) {
return valuePair [ 1 ] ;
}
}
/ * *
* Returns a boolean indicating whether an element with the specified key
* exists or not .
*
* @ param { * } key The key of the element to test for presence .
*
* @ return { boolean } Whether an element with the specified key exists .
* /
} , {
key : "has" ,
value : function has ( key ) {
if ( key === null || _typeof ( key ) !== 'object' ) {
return this . _map . has ( key ) ;
} // Test on the _presence_ of the pair, not its value, as even undefined
// can be a valid member value for a key.
return getValuePair ( this , key ) !== undefined ;
}
/ * *
* Removes the specified element .
*
* @ param { * } key The key of the element to remove .
*
* @ return { boolean } Returns true if an element existed and has been
* removed , or false if the element does not exist .
* /
} , {
key : "delete" ,
value : function _delete ( key ) {
if ( ! this . has ( key ) ) {
return false ;
} // This naive implementation will leave orphaned child trees. A better
// implementation should traverse and remove orphans.
this . set ( key , undefined ) ;
return true ;
}
/ * *
* Executes a provided function once per each key / value pair , in insertion
* order .
*
* @ param { Function } callback Function to execute for each element .
* @ param { * } thisArg Value to use as ` this ` when executing
* ` callback ` .
* /
2018-12-14 05:41:57 +01:00
2018-12-18 04:14:52 +01:00
} , {
key : "forEach" ,
value : function forEach ( callback ) {
var _this = this ;
2018-12-14 05:41:57 +01:00
2018-12-18 04:14:52 +01:00
var thisArg = arguments . length > 1 && arguments [ 1 ] !== undefined ? arguments [ 1 ] : this ;
2018-12-14 05:41:57 +01:00
2018-12-18 04:14:52 +01:00
this . _map . forEach ( function ( value , key ) {
// Unwrap value from object-like value pair.
if ( key !== null && _typeof ( key ) === 'object' ) {
value = value [ 1 ] ;
}
2018-12-14 05:41:57 +01:00
2018-12-18 04:14:52 +01:00
callback . call ( thisArg , value , key , _this ) ;
} ) ;
}
/ * *
* Removes all elements .
* /
2018-12-14 05:41:57 +01:00
2018-12-18 04:14:52 +01:00
} , {
key : "clear" ,
value : function clear ( ) {
this . _map = new Map ( ) ;
this . _arrayTreeMap = new Map ( ) ;
this . _objectTreeMap = new Map ( ) ;
}
} , {
key : "size" ,
get : function get ( ) {
return this . _map . size ;
}
} ] ) ;
2018-12-14 05:41:57 +01:00
2018-12-18 04:14:52 +01:00
return EquivalentKeyMap ;
} ( ) ;
2018-12-14 05:41:57 +01:00
2018-12-18 04:14:52 +01:00
module . exports = EquivalentKeyMap ;
2018-12-14 05:41:57 +01:00
/***/ } ) ,
2018-12-18 04:14:52 +01:00
/***/ 67 :
2018-12-14 05:41:57 +01:00
/***/ ( function ( module , _ _webpack _exports _ _ , _ _webpack _require _ _ ) {
"use strict" ;
2018-12-18 04:14:52 +01:00
/* WEBPACK VAR INJECTION */ ( function ( global , module ) { /* harmony import */ var _ponyfill _js _ _WEBPACK _IMPORTED _MODULE _0 _ _ = _ _webpack _require _ _ ( 85 ) ;
2018-12-14 05:41:57 +01:00
/* global window */
var root ;
if ( typeof self !== 'undefined' ) {
root = self ;
} else if ( typeof window !== 'undefined' ) {
root = window ;
} else if ( typeof global !== 'undefined' ) {
root = global ;
} else if ( true ) {
root = module ;
} else { }
2018-12-18 04:14:52 +01:00
var result = Object ( _ponyfill _js _ _WEBPACK _IMPORTED _MODULE _0 _ _ [ /* default */ "a" ] ) ( root ) ;
/* harmony default export */ _ _webpack _exports _ _ [ "a" ] = ( result ) ;
/* WEBPACK VAR INJECTION */ } . call ( this , _ _webpack _require _ _ ( 51 ) , _ _webpack _require _ _ ( 120 ) ( module ) ) )
/***/ } ) ,
/***/ 7 :
/***/ ( function ( module , exports ) {
2018-12-14 05:41:57 +01:00
2018-12-18 04:14:52 +01:00
( function ( ) { module . exports = this [ "wp" ] [ "compose" ] ; } ( ) ) ;
2018-12-14 05:41:57 +01:00
/***/ } ) ,
2018-12-18 04:14:52 +01:00
/***/ 8 :
2018-12-14 05:41:57 +01:00
/***/ ( function ( module , _ _webpack _exports _ _ , _ _webpack _require _ _ ) {
"use strict" ;
2018-12-18 04:14:52 +01:00
/* harmony export (binding) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "a" , function ( ) { return _objectSpread ; } ) ;
/* harmony import */ var _defineProperty _ _WEBPACK _IMPORTED _MODULE _0 _ _ = _ _webpack _require _ _ ( 15 ) ;
function _objectSpread ( target ) {
for ( var i = 1 ; i < arguments . length ; i ++ ) {
var source = arguments [ i ] != null ? arguments [ i ] : { } ;
var ownKeys = Object . keys ( source ) ;
if ( typeof Object . getOwnPropertySymbols === 'function' ) {
ownKeys = ownKeys . concat ( Object . getOwnPropertySymbols ( source ) . filter ( function ( sym ) {
return Object . getOwnPropertyDescriptor ( source , sym ) . enumerable ;
} ) ) ;
}
ownKeys . forEach ( function ( key ) {
Object ( _defineProperty _ _WEBPACK _IMPORTED _MODULE _0 _ _ [ /* default */ "a" ] ) ( target , key , source [ key ] ) ;
} ) ;
}
return target ;
}
/***/ } ) ,
/***/ 85 :
/***/ ( function ( module , _ _webpack _exports _ _ , _ _webpack _require _ _ ) {
"use strict" ;
/* harmony export (binding) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "a" , function ( ) { return symbolObservablePonyfill ; } ) ;
2018-12-14 05:41:57 +01:00
function symbolObservablePonyfill ( root ) {
var result ;
var Symbol = root . Symbol ;
if ( typeof Symbol === 'function' ) {
if ( Symbol . observable ) {
result = Symbol . observable ;
} else {
result = Symbol ( 'observable' ) ;
Symbol . observable = result ;
}
} else {
result = '@@observable' ;
}
return result ;
} ;
2018-12-15 12:00:40 +01:00
/***/ } ) ,
2018-12-18 04:14:52 +01:00
/***/ 86 :
2018-12-15 12:00:40 +01:00
/***/ ( function ( module , exports ) {
2018-12-18 04:14:52 +01:00
module . exports = isPromise ;
2018-12-15 12:00:40 +01:00
2018-12-18 04:14:52 +01:00
function isPromise ( obj ) {
return ! ! obj && ( typeof obj === 'object' || typeof obj === 'function' ) && typeof obj . then === 'function' ;
2018-12-15 12:00:40 +01:00
}
2018-12-14 05:41:57 +01:00
/***/ } ) ,
2018-12-18 04:14:52 +01:00
/***/ 9 :
/***/ ( function ( module , _ _webpack _exports _ _ , _ _webpack _require _ _ ) {
2018-12-14 05:41:57 +01:00
2018-12-18 04:14:52 +01:00
"use strict" ;
/* harmony export (binding) */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , "a" , function ( ) { return _createClass ; } ) ;
function _defineProperties ( target , props ) {
for ( var i = 0 ; i < props . length ; i ++ ) {
var descriptor = props [ i ] ;
descriptor . enumerable = descriptor . enumerable || false ;
descriptor . configurable = true ;
if ( "value" in descriptor ) descriptor . writable = true ;
Object . defineProperty ( target , descriptor . key , descriptor ) ;
}
2018-12-14 05:41:57 +01:00
}
2018-12-18 04:14:52 +01:00
function _createClass ( Constructor , protoProps , staticProps ) {
if ( protoProps ) _defineProperties ( Constructor . prototype , protoProps ) ;
if ( staticProps ) _defineProperties ( Constructor , staticProps ) ;
return Constructor ;
}
2018-12-14 05:41:57 +01:00
/***/ } )
2018-12-18 04:14:52 +01:00
/******/ } ) ;