diff --git a/node_modules/.yarn-integrity b/node_modules/.yarn-integrity
index 9e84958..b42e002 100644
--- a/node_modules/.yarn-integrity
+++ b/node_modules/.yarn-integrity
@@ -7,6 +7,7 @@
"linkedModules": [],
"topLevelPatterns": [
"lodash@^4.17.4",
+ "redux-persist@^5.5.0",
"reduxsauce@^0.7.0"
],
"lockfileEntries": {
@@ -17,6 +18,7 @@
"loose-envify@^1.1.0": "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.3.1.tgz#d1a8ad33fa9ce0e713d65fdd0ac8b748d478c848",
"ramda@^0.24.1": "https://registry.yarnpkg.com/ramda/-/ramda-0.24.1.tgz#c3b7755197f35b8dc3502228262c4c91ddb6b857",
"ramdasauce@^2.0.0": "https://registry.yarnpkg.com/ramdasauce/-/ramdasauce-2.1.0.tgz#65ea157a9cfc17841a7dd6499d3f9f421dc2eb36",
+ "redux-persist@^5.5.0": "https://registry.yarnpkg.com/redux-persist/-/redux-persist-5.5.0.tgz#64b5030625cb6f863f76487975acb8bb4fe4f9bb",
"redux@^3.7.1": "https://registry.yarnpkg.com/redux/-/redux-3.7.2.tgz#06b73123215901d25d065be342eb026bc1c8537b",
"reduxsauce@^0.7.0": "https://registry.yarnpkg.com/reduxsauce/-/reduxsauce-0.7.0.tgz#f482377fd9f5095384ec6b247902eae06712c59b",
"symbol-observable@^1.0.3": "https://registry.yarnpkg.com/symbol-observable/-/symbol-observable-1.1.0.tgz#5c68fd8d54115d9dfb72a84720549222e8db9b32"
diff --git a/node_modules/redux-persist/LICENSE b/node_modules/redux-persist/LICENSE
new file mode 100644
index 0000000..4c472db
--- /dev/null
+++ b/node_modules/redux-persist/LICENSE
@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) 2017 Zack Story
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/node_modules/redux-persist/README.md b/node_modules/redux-persist/README.md
new file mode 100644
index 0000000..5f11e64
--- /dev/null
+++ b/node_modules/redux-persist/README.md
@@ -0,0 +1,202 @@
+# Redux Persist
+
+Persist and rehydrate a redux store.
+
+[![build status](https://img.shields.io/travis/rt2zz/redux-persist/master.svg?style=flat-square)](https://travis-ci.org/rt2zz/redux-persist) [![npm version](https://img.shields.io/npm/v/redux-persist.svg?style=flat-square)](https://www.npmjs.com/package/redux-persist) [![npm downloads](https://img.shields.io/npm/dm/redux-persist.svg?style=flat-square)](https://www.npmjs.com/package/redux-persist)
+
+Redux Persist takes your redux state object and saves it to persisted storage. On app launch, it retrieves this persisted state and saves it back to redux.
+
+**Note:** These instructions are for redux-persist v5. For a list of breaking changes between v4 and v5, see our [migration guide](./docs/MigrationGuide-v5.md).
+[v4](https://github.com/rt2zz/redux-persist/tree/v4.8.2) will be supported for the forseeable future, and if it works well for your use case you are encouraged to stay on v4.
+
+## Quickstart
+`npm install --save redux-persist`
+\- OR -
+`yarn add redux-persist`
+
+##### Implementation
+Basic implementation involves adding `persistReducer` and `persistStore` to your setup. **IMPORTANT** Every app needs to decide how many levels of state they want to "merge". The default is 1 level. Please read through the [state reconciler docs](#state-reconciler) for more information.
+
+```js
+// configureStore.js
+
+import { createStore } from 'redux'
+import { persistStore, persistReducer } from 'redux-persist'
+import storage from 'redux-persist/lib/storage'
+
+import rootReducer from './reducers'
+
+const persistConfig = {
+ key: 'root',
+ storage: storage,
+}
+
+const persistedReducer = persistReducer(persistConfig, rootReducer)
+
+export default () => {
+ let store = createStore(persistedReducer)
+ let persistor = persistStore(store)
+ return { store, persistor }
+}
+```
+
+If you are using react, wrap your root component with [PersistGate](./docs/PersistGate.md). This delays the rendering of your app's UI until your persisted state has been retrieved and saved to redux.
+
+```js
+import React from 'react'
+import { Provider } from 'react-redux'
+import { PersistGate } from 'redux-persist/lib/integration/react'
+
+import configureStore from './store/configureStore'
+let { store, persistor } = configureStore()
+
+// import your necessary custom components.
+import { RootComponent } from './components'
+
+const App = () => {
+ return (
+
+
+
+
+
+ );
+};
+
+export default App
+```
+
+**NOTE** loading is set to null for simplicity, but in practice should be any react instance, e.g. `loading={ }`
+
+## State Reconciler
+State reconcilers define how incoming persisted state is merged in with existing default state. It is critical to choose the right state reconciler for your state shape. There are three options that ship out of the box, lets look at how each operates:
+
+1. hardSet (`import hardSet from 'redux-persist/lib/stateReconciler/hardSet'`)
+This will hard set incoming state. This can be desirable in some cases where persistReducer is nested deeper in your reducer tree, or if you do not rely on initialState in your reducer.
+ - **INCOMING STATE**: `{ foo: incomingFoo }`
+ - **INITIAL STATE**: `{ foo: initialFoo, bar: initialBar }`
+ - **RECONCILED STATE**: `{ foo: incomingFoo }` // note bar has been dropped
+2. autoMergeLevel1 (default)
+This will auto merge one level deep. Auto merge means if the some piece of substate was modified by your reducer during the REHYDRATE action, it will skip this piece of state. Level 1 means it will shallow merge 1 level deep.
+ - **INCOMING STATE**: `{ foo: incomingFoo }`
+ - **INITIAL STATE**: `{ foo: initialFoo, bar: initialBar }`
+ - **RECONCILED STATE**: `{ foo: incomingFoo, bar: initialBar }`
+3. autoMergeLevel2
+This acts just like autoMergeLevel1, except it shallow merges two levels
+ - **INCOMING STATE**: `{ foo: incomingFoo }`
+ - **INITIAL STATE**: `{ foo: initialFoo, bar: initialBar }`
+ - **RECONCILED STATE**: `{ foo: mergedFoo, bar: initialBar }`
+
+#### Example
+```js
+import autoMergeLevel2 from 'redux-persist/lib/stateReconciler/hardSet'
+
+const persistConfig = {
+ key: 'root',
+ storage,
+ stateReconciler: hardSet,
+}
+```
+
+## Blacklist & Whitelist
+By Example:
+```js
+// BLACKLIST
+const persistConfig = {
+ key: 'root',
+ storage: storage,
+ blacklist: ['navigation'] // navigation will not be persisted
+};
+
+// WHITELIST
+const persistConfig = {
+ key: 'root',
+ storage: storage,
+ whitelist: ['navigation'] // only navigation will be persisted
+};
+```
+
+#### Nested Blacklist / Whitelist
+The blacklist and whitelist only work one level deep. However persisted reducers can be nested.For example, if you want to blacklist `state.auth.somethingTemporary`:
+```js
+import { combineReducers } from 'redux'
+import { persistReducer } from 'redux-persist'
+import storage from 'redux-persist/lib/storage'
+
+import { authReducer, otherReducer } from './reducers'
+
+const rootPersistConfig = {
+ key: 'root',
+ storage: storage,
+ blacklist: ['auth']
+}
+
+const authPersistConfig = {
+ key: 'auth',
+ storage: storage,
+ blacklist: ['somethingTemporary']
+}
+
+const rootReducer = combineReducers({
+ auth: persistReducer(authPersistConfig, authReducer),
+ other: otherReducer,
+})
+
+export default persistReducer(rootPersistConfig, rootReducer)
+```
+
+## Migrations
+`persistReducer` has a general purpose "migrate" config which will be called after getting stored state but before actually reconciling with the reducer. It can be any function which takes state as an argument and returns a promise to return a new state object.
+
+Redux Persist ships with `createMigrate`, which helps create a synchronous migration for moving from any version of stored state to the current state version. [[Additional information]](./docs/migrations.md)
+
+## Transforms
+
+Transforms allow you to customize the state object that gets persisted and rehydrated.
+
+There are several libraries that tackle some of the common implementations for transforms.
+- [immutable](https://github.com/rt2zz/redux-persist-transform-immutable) - support immutable reducers
+- [compress](https://github.com/rt2zz/redux-persist-transform-compress) - compress your serialized state with lz-string
+- [encrypt](https://github.com/maxdeviant/redux-persist-transform-encrypt) - encrypt your serialized state with AES
+- [filter](https://github.com/edy/redux-persist-transform-filter) - store or load a subset of your state
+- [filter-immutable](https://github.com/actra-development/redux-persist-transform-filter-immutable) - store or load a subset of your state with support for immutablejs
+- [expire](https://github.com/gabceb/redux-persist-transform-expire) - expire a specific subset of your state based on a property
+
+When the state object gets persisted, it first gets serialized with `JSON.stringify()`. If parts of your state object are not mappable to JSON objects, the serialization process may transform these parts of your state in unexpected ways. For example, the javascript [Set](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set) type does not exist in JSON. When you try to serialize a Set via `JSON.stringify()`, it gets converted to an empty object. Probably not what you want.
+
+Below is a Transform that successfully persists a Set property, which simply converts it to an array and back. In this way, the Set gets converted to an Array, which is a recognized data structure in JSON. When pulled out of the persisted store, the array gets converted back to a Set before being saved to the redux store.
+
+```js
+const myTransform = createTransform(
+ // transform state on its way to being serialized and persisted.
+ (inboundState, key) => {
+ // convert mySet to an Array.
+ return { ...inboundState, mySet: [...inboundState.mySet] };
+ },
+ // transform state being rehydrated
+ (outboundState, key) => {
+ // convert mySet back to a Set.
+ return { ...outboundState, mySet: new Set(outboundState.mySet) };
+ },
+ // define which reducers this transform gets called for.
+ { whitelist: ['someReducer'] }
+);
+```
+
+The createTransform function takes three parameters.
+1. A function that gets called right before state is persisted.
+2. A function that gets called right before state is rehydrated.
+3. A config object.
+
+## Storage Engines
+- **localStorage** `import storage from 'redux-persist/lib/storage'`
+- **sessionStorage** `import sessionStorage from 'redux-persist/lib/storage/session'`
+- **AsyncStorage** react-native `import storage from 'redux-persist/lib/storage'`
+- **[localForage](https://github.com/mozilla/localForage)** recommended for web
+- **[electron storage](https://github.com/psperber/redux-persist-electron-storage)** Electron support via [electron store](https://github.com/sindresorhus/electron-store)
+- **[redux-persist-filesystem-storage](https://github.com/robwalkerco/redux-persist-filesystem-storage)** react-native, to mitigate storage size limitations in android ([#199](https://github.com/rt2zz/redux-persist/issues/199), [#284](https://github.com/rt2zz/redux-persist/issues/284))
+- **[redux-persist-node-storage](https://github.com/pellejacobs/redux-persist-node-storage)** for use in nodejs environments.
+- **[redux-persist-sensitive-storage](https://github.com/CodingZeal/redux-persist-sensitive-storage)** react-native, for sensitive information (uses [react-native-sensitive-storage](https://github.com/mCodex/react-native-sensitive-info)).
+- **[redux-persist-fs-storage](https://github.com/leethree/redux-persist-fs-storage)** react-native-fs engine
+- **[redux-persist-cookie-storage](https://github.com/abersager/redux-persist-cookie-storage)** Cookie storage engine, works in browser and Node.js, for universal / isomorphic apps
+- **custom** any conforming storage api implementing the following methods: `setItem` `getItem` `removeItem`. (**NB**: These methods must support promises)
diff --git a/node_modules/redux-persist/es/constants.js b/node_modules/redux-persist/es/constants.js
new file mode 100644
index 0000000..4302a37
--- /dev/null
+++ b/node_modules/redux-persist/es/constants.js
@@ -0,0 +1,8 @@
+export var KEY_PREFIX = 'persist:';
+export var FLUSH = 'persist/FLUSH';
+export var REHYDRATE = 'persist/REHYDRATE';
+export var PAUSE = 'persist/PAUSE';
+export var PERSIST = 'persist/PERSIST';
+export var PURGE = 'persist/PURGE';
+export var REGISTER = 'persist/REGISTER';
+export var DEFAULT_VERSION = -1;
\ No newline at end of file
diff --git a/node_modules/redux-persist/es/constants.js.flow b/node_modules/redux-persist/es/constants.js.flow
new file mode 100644
index 0000000..009705f
--- /dev/null
+++ b/node_modules/redux-persist/es/constants.js.flow
@@ -0,0 +1,10 @@
+// @flow
+
+export const KEY_PREFIX = 'persist:'
+export const FLUSH = 'persist/FLUSH'
+export const REHYDRATE = 'persist/REHYDRATE'
+export const PAUSE = 'persist/PAUSE'
+export const PERSIST = 'persist/PERSIST'
+export const PURGE = 'persist/PURGE'
+export const REGISTER = 'persist/REGISTER'
+export const DEFAULT_VERSION = -1
diff --git a/node_modules/redux-persist/es/createMigrate.js b/node_modules/redux-persist/es/createMigrate.js
new file mode 100644
index 0000000..e26eee9
--- /dev/null
+++ b/node_modules/redux-persist/es/createMigrate.js
@@ -0,0 +1,42 @@
+import { DEFAULT_VERSION } from './constants';
+
+export default function createMigrate(migrations, config) {
+ var _ref = config || {},
+ debug = _ref.debug;
+
+ return function (state, currentVersion) {
+ if (!state) {
+ if (process.env.NODE_ENV !== 'production' && debug) console.log('redux-persist: no inbound state, skipping migration');
+ return Promise.resolve(undefined);
+ }
+
+ var inboundVersion = state._persist && state._persist.version !== undefined ? state._persist.version : DEFAULT_VERSION;
+ if (inboundVersion === currentVersion) {
+ if (process.env.NODE_ENV !== 'production' && debug) console.log('redux-persist: versions match, noop migration');
+ return Promise.resolve(state);
+ }
+ if (inboundVersion > currentVersion) {
+ if (process.env.NODE_ENV !== 'production') console.error('redux-persist: downgrading version is not supported');
+ return Promise.resolve(state);
+ }
+
+ var migrationKeys = Object.keys(migrations).map(function (ver) {
+ return parseInt(ver);
+ }).filter(function (key) {
+ return currentVersion >= key && key > inboundVersion;
+ }).sort(function (a, b) {
+ return a - b;
+ });
+
+ if (process.env.NODE_ENV !== 'production' && debug) console.log('redux-persist: migrationKeys', migrationKeys);
+ try {
+ var migratedState = migrationKeys.reduce(function (state, versionKey) {
+ if (process.env.NODE_ENV !== 'production' && debug) console.log('redux-persist: running migration for versionKey', versionKey);
+ return migrations[versionKey](state);
+ }, state);
+ return Promise.resolve(migratedState);
+ } catch (err) {
+ return Promise.reject(err);
+ }
+ };
+}
\ No newline at end of file
diff --git a/node_modules/redux-persist/es/createMigrate.js.flow b/node_modules/redux-persist/es/createMigrate.js.flow
new file mode 100644
index 0000000..5426c46
--- /dev/null
+++ b/node_modules/redux-persist/es/createMigrate.js.flow
@@ -0,0 +1,58 @@
+// @flow
+
+import { DEFAULT_VERSION } from './constants'
+
+import type { PersistedState, MigrationManifest } from './types'
+
+export default function createMigrate(
+ migrations: MigrationManifest,
+ config?: { debug: boolean }
+) {
+ let { debug } = config || {}
+ return function(
+ state: PersistedState,
+ currentVersion: number
+ ): Promise {
+ if (!state) {
+ if (process.env.NODE_ENV !== 'production' && debug)
+ console.log('redux-persist: no inbound state, skipping migration')
+ return Promise.resolve(undefined)
+ }
+
+ let inboundVersion: number =
+ state._persist && state._persist.version !== undefined
+ ? state._persist.version
+ : DEFAULT_VERSION
+ if (inboundVersion === currentVersion) {
+ if (process.env.NODE_ENV !== 'production' && debug)
+ console.log('redux-persist: versions match, noop migration')
+ return Promise.resolve(state)
+ }
+ if (inboundVersion > currentVersion) {
+ if (process.env.NODE_ENV !== 'production')
+ console.error('redux-persist: downgrading version is not supported')
+ return Promise.resolve(state)
+ }
+
+ let migrationKeys = Object.keys(migrations)
+ .map(ver => parseInt(ver))
+ .filter(key => currentVersion >= key && key > inboundVersion)
+ .sort((a, b) => a - b)
+
+ if (process.env.NODE_ENV !== 'production' && debug)
+ console.log('redux-persist: migrationKeys', migrationKeys)
+ try {
+ let migratedState = migrationKeys.reduce((state, versionKey) => {
+ if (process.env.NODE_ENV !== 'production' && debug)
+ console.log(
+ 'redux-persist: running migration for versionKey',
+ versionKey
+ )
+ return migrations[versionKey](state)
+ }, state)
+ return Promise.resolve(migratedState)
+ } catch (err) {
+ return Promise.reject(err)
+ }
+ }
+}
diff --git a/node_modules/redux-persist/es/createPersistoid.js b/node_modules/redux-persist/es/createPersistoid.js
new file mode 100644
index 0000000..071a13a
--- /dev/null
+++ b/node_modules/redux-persist/es/createPersistoid.js
@@ -0,0 +1,102 @@
+import { KEY_PREFIX, REHYDRATE } from './constants';
+
+export default function createPersistoid(config) {
+ // defaults
+ var blacklist = config.blacklist || null;
+ var whitelist = config.whitelist || null;
+ var transforms = config.transforms || [];
+ var throttle = config.throttle || 0;
+ var storageKey = '' + (config.keyPrefix !== undefined ? config.keyPrefix : KEY_PREFIX) + config.key;
+ var storage = config.storage;
+ var serialize = config.serialize === false ? function (x) {
+ return x;
+ } : defaultSerialize;
+
+ // initialize stateful values
+ var lastState = {};
+ var stagedState = {};
+ var keysToProcess = [];
+ var timeIterator = null;
+ var writePromise = null;
+
+ var update = function update(state) {
+ // add any changed keys to the queue
+ Object.keys(state).forEach(function (key) {
+ var subState = state[key];
+ if (!passWhitelistBlacklist(key)) return; // is keyspace ignored? noop
+ if (lastState[key] === state[key]) return; // value unchanged? noop
+ if (keysToProcess.indexOf(key) !== -1) return; // is key already queued? noop
+ keysToProcess.push(key); // add key to queue
+ });
+
+ // start the time iterator if not running (read: throttle)
+ if (timeIterator === null) {
+ timeIterator = setInterval(processNextKey, throttle);
+ }
+
+ lastState = state;
+ };
+
+ function processNextKey() {
+ if (keysToProcess.length === 0) {
+ if (timeIterator) clearInterval(timeIterator);
+ timeIterator = null;
+ return;
+ }
+
+ var key = keysToProcess.shift();
+ var endState = transforms.reduce(function (subState, transformer) {
+ return transformer.in(subState, key);
+ }, lastState[key]);
+ if (typeof endState !== 'undefined') stagedWrite(key, endState);
+ }
+
+ function stagedWrite(key, endState) {
+ try {
+ stagedState[key] = serialize(endState);
+ } catch (err) {
+ console.error('redux-persist/createPersistoid: error serializing state', err);
+ }
+ if (keysToProcess.length === 0) {
+ // cleanup any removed keys just before write.
+ Object.keys(stagedState).forEach(function (key) {
+ if (lastState[key] === undefined) {
+ delete stagedState[key];
+ }
+ });
+
+ writePromise = storage.setItem(storageKey, serialize(stagedState)).catch(onWriteFail);
+ }
+ }
+
+ function passWhitelistBlacklist(key) {
+ if (whitelist && whitelist.indexOf(key) === -1 && key !== '_persist') return false;
+ if (blacklist && blacklist.indexOf(key) !== -1) return false;
+ return true;
+ }
+
+ function onWriteFail(err) {
+ // @TODO add fail handlers (typically storage full)
+ if (err && process.env.NODE_ENV !== 'production') {
+ console.error('Error storing data', err);
+ }
+ }
+
+ var flush = function flush() {
+ while (keysToProcess.length !== 0) {
+ processNextKey();
+ }
+ return writePromise || Promise.resolve();
+ };
+
+ // return `persistoid`
+ return {
+ update: update,
+ flush: flush
+ };
+}
+
+// @NOTE in the future this may be exposed via config
+function defaultSerialize(data) {
+ return JSON.stringify(data);
+}
\ No newline at end of file
diff --git a/node_modules/redux-persist/es/createPersistoid.js.flow b/node_modules/redux-persist/es/createPersistoid.js.flow
new file mode 100644
index 0000000..16dfe85
--- /dev/null
+++ b/node_modules/redux-persist/es/createPersistoid.js.flow
@@ -0,0 +1,111 @@
+// @flow
+
+import { KEY_PREFIX, REHYDRATE } from './constants'
+
+import type { Persistoid, PersistConfig, Transform } from './types'
+
+export default function createPersistoid(config: PersistConfig): Persistoid {
+ // defaults
+ const blacklist: ?Array = config.blacklist || null
+ const whitelist: ?Array = config.whitelist || null
+ const transforms = config.transforms || []
+ const throttle = config.throttle || 0
+ const storageKey = `${config.keyPrefix !== undefined
+ ? config.keyPrefix
+ : KEY_PREFIX}${config.key}`
+ const storage = config.storage
+ const serialize = config.serialize === false ? x => x : defaultSerialize
+
+ // initialize stateful values
+ let lastState = {}
+ let stagedState = {}
+ let keysToProcess = []
+ let timeIterator: ?number = null
+ let writePromise = null
+
+ const update = (state: Object) => {
+ // add any changed keys to the queue
+ Object.keys(state).forEach(key => {
+ let subState = state[key]
+ if (!passWhitelistBlacklist(key)) return // is keyspace ignored? noop
+ if (lastState[key] === state[key]) return // value unchanged? noop
+ if (keysToProcess.indexOf(key) !== -1) return // is key already queued? noop
+ keysToProcess.push(key) // add key to queue
+ })
+
+ // start the time iterator if not running (read: throttle)
+ if (timeIterator === null) {
+ timeIterator = setInterval(processNextKey, throttle)
+ }
+
+ lastState = state
+ }
+
+ function processNextKey() {
+ if (keysToProcess.length === 0) {
+ if (timeIterator) clearInterval(timeIterator)
+ timeIterator = null
+ return
+ }
+
+ let key = keysToProcess.shift()
+ let endState = transforms.reduce((subState, transformer) => {
+ return transformer.in(subState, key)
+ }, lastState[key])
+ if (typeof endState !== 'undefined') stagedWrite(key, endState)
+ }
+
+ function stagedWrite(key: string, endState: any) {
+ try {
+ stagedState[key] = serialize(endState)
+ } catch (err) {
+ console.error(
+ 'redux-persist/createPersistoid: error serializing state',
+ err
+ )
+ }
+ if (keysToProcess.length === 0) {
+ // cleanup any removed keys just before write.
+ Object.keys(stagedState).forEach(key => {
+ if (lastState[key] === undefined) {
+ delete stagedState[key]
+ }
+ })
+
+ writePromise = storage
+ .setItem(storageKey, serialize(stagedState))
+ .catch(onWriteFail)
+ }
+ }
+
+ function passWhitelistBlacklist(key) {
+ if (whitelist && whitelist.indexOf(key) === -1 && key !== '_persist') return false
+ if (blacklist && blacklist.indexOf(key) !== -1) return false
+ return true
+ }
+
+ function onWriteFail(err) {
+ // @TODO add fail handlers (typically storage full)
+ if (err && process.env.NODE_ENV !== 'production') {
+ console.error('Error storing data', err)
+ }
+ }
+
+ const flush = () => {
+ while (keysToProcess.length !== 0) {
+ processNextKey()
+ }
+ return writePromise || Promise.resolve()
+ }
+
+ // return `persistoid`
+ return {
+ update,
+ flush,
+ }
+}
+
+// @NOTE in the future this may be exposed via config
+function defaultSerialize(data) {
+ return JSON.stringify(data)
+}
diff --git a/node_modules/redux-persist/es/createTransform.js b/node_modules/redux-persist/es/createTransform.js
new file mode 100644
index 0000000..2f5cc67
--- /dev/null
+++ b/node_modules/redux-persist/es/createTransform.js
@@ -0,0 +1,27 @@
+
+
+export default function createTransform(
+// @NOTE inbound: transform state coming from redux on its way to being serialized and stored
+inbound,
+// @NOTE outbound: transform state coming from storage, on its way to be rehydrated into redux
+outbound) {
+ var config = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
+
+ var whitelist = config.whitelist || null;
+ var blacklist = config.blacklist || null;
+
+ function whitelistBlacklistCheck(key) {
+ if (whitelist && whitelist.indexOf(key) === -1) return true;
+ if (blacklist && blacklist.indexOf(key) !== -1) return true;
+ return false;
+ }
+
+ return {
+ in: function _in(state, key) {
+ return !whitelistBlacklistCheck(key) && inbound ? inbound(state, key) : state;
+ },
+ out: function out(state, key) {
+ return !whitelistBlacklistCheck(key) && outbound ? outbound(state, key) : state;
+ }
+ };
+}
\ No newline at end of file
diff --git a/node_modules/redux-persist/es/createTransform.js.flow b/node_modules/redux-persist/es/createTransform.js.flow
new file mode 100644
index 0000000..3da5a15
--- /dev/null
+++ b/node_modules/redux-persist/es/createTransform.js.flow
@@ -0,0 +1,30 @@
+// @flow
+
+type TransformConfig = {
+ whitelist?: Array,
+ blacklist?: Array,
+}
+
+export default function createTransform(
+ // @NOTE inbound: transform state coming from redux on its way to being serialized and stored
+ inbound: ?Function,
+ // @NOTE outbound: transform state coming from storage, on its way to be rehydrated into redux
+ outbound: ?Function,
+ config: TransformConfig = {}
+) {
+ let whitelist = config.whitelist || null
+ let blacklist = config.blacklist || null
+
+ function whitelistBlacklistCheck(key) {
+ if (whitelist && whitelist.indexOf(key) === -1) return true
+ if (blacklist && blacklist.indexOf(key) !== -1) return true
+ return false
+ }
+
+ return {
+ in: (state: Object, key: string) =>
+ !whitelistBlacklistCheck(key) && inbound ? inbound(state, key) : state,
+ out: (state: Object, key: string) =>
+ !whitelistBlacklistCheck(key) && outbound ? outbound(state, key) : state,
+ }
+}
diff --git a/node_modules/redux-persist/es/getStoredState.js b/node_modules/redux-persist/es/getStoredState.js
new file mode 100644
index 0000000..768e9d8
--- /dev/null
+++ b/node_modules/redux-persist/es/getStoredState.js
@@ -0,0 +1,34 @@
+
+
+import { KEY_PREFIX } from './constants';
+
+export default function getStoredState(config) {
+ var transforms = config.transforms || [];
+ var storageKey = '' + (config.keyPrefix !== undefined ? config.keyPrefix : KEY_PREFIX) + config.key;
+ var storage = config.storage;
+ var debug = config.debug;
+ var deserialize = config.serialize === false ? function (x) {
+ return x;
+ } : defaultDeserialize;
+ return storage.getItem(storageKey).then(function (serialized) {
+ if (!serialized) return undefined;else {
+ try {
+ var state = {};
+ var rawState = deserialize(serialized);
+ Object.keys(rawState).forEach(function (key) {
+ state[key] = transforms.reduceRight(function (subState, transformer) {
+ return transformer.out(subState, key);
+ }, deserialize(rawState[key]));
+ });
+ return state;
+ } catch (err) {
+ if (process.env.NODE_ENV !== 'production' && debug) console.log('redux-persist/getStoredState: Error restoring data ' + serialized, err);
+ throw err;
+ }
+ }
+ });
+}
+
+function defaultDeserialize(serial) {
+ return JSON.parse(serial);
+}
\ No newline at end of file
diff --git a/node_modules/redux-persist/es/getStoredState.js.flow b/node_modules/redux-persist/es/getStoredState.js.flow
new file mode 100644
index 0000000..f98b348
--- /dev/null
+++ b/node_modules/redux-persist/es/getStoredState.js.flow
@@ -0,0 +1,43 @@
+// @flow
+
+import type { PersistConfig } from './types'
+
+import { KEY_PREFIX } from './constants'
+
+export default function getStoredState(
+ config: PersistConfig
+): Promise {
+ const transforms = config.transforms || []
+ const storageKey = `${config.keyPrefix !== undefined
+ ? config.keyPrefix
+ : KEY_PREFIX}${config.key}`
+ const storage = config.storage
+ const debug = config.debug
+ const deserialize = config.serialize === false ? x => x : defaultDeserialize
+ return storage.getItem(storageKey).then(serialized => {
+ if (!serialized) return undefined
+ else {
+ try {
+ let state = {}
+ let rawState = deserialize(serialized)
+ Object.keys(rawState).forEach(key => {
+ state[key] = transforms.reduceRight((subState, transformer) => {
+ return transformer.out(subState, key)
+ }, deserialize(rawState[key]))
+ })
+ return state
+ } catch (err) {
+ if (process.env.NODE_ENV !== 'production' && debug)
+ console.log(
+ `redux-persist/getStoredState: Error restoring data ${serialized}`,
+ err
+ )
+ throw err
+ }
+ }
+ })
+}
+
+function defaultDeserialize(serial) {
+ return JSON.parse(serial)
+}
diff --git a/node_modules/redux-persist/es/index.js b/node_modules/redux-persist/es/index.js
new file mode 100644
index 0000000..a998926
--- /dev/null
+++ b/node_modules/redux-persist/es/index.js
@@ -0,0 +1,10 @@
+export { default as persistReducer } from './persistReducer';
+export { default as persistCombineReducers } from './persistCombineReducers';
+export { default as persistStore } from './persistStore';
+export { default as createMigrate } from './createMigrate';
+export { default as createTransform } from './createTransform';
+export { default as getStoredState } from './getStoredState';
+export { default as createPersistoid } from './createPersistoid';
+export { default as purgeStoredState } from './purgeStoredState';
+
+export * from './constants';
\ No newline at end of file
diff --git a/node_modules/redux-persist/es/index.js.flow b/node_modules/redux-persist/es/index.js.flow
new file mode 100644
index 0000000..0d9c048
--- /dev/null
+++ b/node_modules/redux-persist/es/index.js.flow
@@ -0,0 +1,12 @@
+// @flow
+
+export { default as persistReducer } from './persistReducer'
+export { default as persistCombineReducers } from './persistCombineReducers'
+export { default as persistStore } from './persistStore'
+export { default as createMigrate } from './createMigrate'
+export { default as createTransform } from './createTransform'
+export { default as getStoredState } from './getStoredState'
+export { default as createPersistoid } from './createPersistoid'
+export { default as purgeStoredState } from './purgeStoredState'
+
+export * from './constants'
diff --git a/node_modules/redux-persist/es/integration/getStoredStateMigrateV4.js b/node_modules/redux-persist/es/integration/getStoredStateMigrateV4.js
new file mode 100644
index 0000000..2af4524
--- /dev/null
+++ b/node_modules/redux-persist/es/integration/getStoredStateMigrateV4.js
@@ -0,0 +1,160 @@
+var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
+
+var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
+
+import getStoredStateV5 from '../getStoredState';
+
+export default function getStoredState(v4Config) {
+ return function (v5Config) {
+ return getStoredStateV5(v5Config).then(function (state) {
+ if (state) return state;else return getStoredStateV4(v4Config);
+ });
+ };
+}
+
+var KEY_PREFIX = 'reduxPersist:';
+
+function hasLocalStorage() {
+ if ((typeof window === 'undefined' ? 'undefined' : _typeof(window)) !== 'object' || !('localStorage' in window)) {
+ return false;
+ }
+
+ try {
+ var _storage = window.localStorage;
+ var testKey = 'redux-persist localStorage test';
+ _storage.setItem(testKey, 'test');
+ _storage.getItem(testKey);
+ _storage.removeItem(testKey);
+ } catch (e) {
+ if (process.env.NODE_ENV !== 'production') console.warn('redux-persist localStorage test failed, persistence will be disabled.');
+ return false;
+ }
+ return true;
+}
+
+var noop = function noop() {
+ /* noop */return null;
+};
+var noStorage = {
+ getItem: noop,
+ setItem: noop,
+ removeItem: noop,
+ getAllKeys: noop
+};
+var createAsyncLocalStorage = function createAsyncLocalStorage() {
+ if (!hasLocalStorage()) return noStorage;
+ var localStorage = window.localStorage;
+ return {
+ getAllKeys: function getAllKeys(cb) {
+ try {
+ var keys = [];
+ for (var i = 0; i < localStorage.length; i++) {
+ keys.push(localStorage.key(i));
+ }
+ cb(null, keys);
+ } catch (e) {
+ cb(e);
+ }
+ },
+ getItem: function getItem(key, cb) {
+ try {
+ var s = localStorage.getItem(key);
+ cb(null, s);
+ } catch (e) {
+ cb(e);
+ }
+ },
+ setItem: function setItem(key, string, cb) {
+ try {
+ localStorage.setItem(key, string);
+ cb(null);
+ } catch (e) {
+ cb(e);
+ }
+ },
+ removeItem: function removeItem(key, cb) {
+ try {
+ localStorage.removeItem(key);
+ cb && cb(null);
+ } catch (e) {
+ cb(e);
+ }
+ }
+ };
+};
+
+function getStoredStateV4(v4Config) {
+ return new Promise(function (resolve, reject) {
+ var storage = v4Config.storage || createAsyncLocalStorage();
+ var deserializer = v4Config.serialize === false ? function (data) {
+ return data;
+ } : function (serial) {
+ return JSON.parse(serial);
+ };
+ var blacklist = v4Config.blacklist || [];
+ var whitelist = v4Config.whitelist || false;
+ var transforms = v4Config.transforms || [];
+ var keyPrefix = v4Config.keyPrefix !== undefined ? v4Config.keyPrefix : KEY_PREFIX;
+
+ // fallback getAllKeys to `keys` if present (LocalForage compatability)
+ if (storage.keys && !storage.getAllKeys) storage = _extends({}, storage, { getAllKeys: storage.keys });
+
+ var restoredState = {};
+ var completionCount = 0;
+
+ storage.getAllKeys(function (err) {
+ var allKeys = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
+
+ if (err) {
+ if (process.env.NODE_ENV !== 'production') console.warn('redux-persist/getStoredState: Error in storage.getAllKeys');
+ return reject(err);
+ }
+
+ var persistKeys = allKeys.filter(function (key) {
+ return key.indexOf(keyPrefix) === 0;
+ }).map(function (key) {
+ return key.slice(keyPrefix.length);
+ });
+ var keysToRestore = persistKeys.filter(passWhitelistBlacklist);
+
+ var restoreCount = keysToRestore.length;
+ if (restoreCount === 0) resolve(undefined);
+ keysToRestore.forEach(function (key) {
+ storage.getItem(createStorageKey(key), function (err, serialized) {
+ if (err && process.env.NODE_ENV !== 'production') console.warn('redux-persist/getStoredState: Error restoring data for key:', key, err);else restoredState[key] = rehydrate(key, serialized);
+ completionCount += 1;
+ if (completionCount === restoreCount) resolve(restoredState);
+ });
+ });
+ });
+
+ function rehydrate(key, serialized) {
+ var state = null;
+
+ try {
+ var data = serialized ? deserializer(serialized) : undefined;
+ state = transforms.reduceRight(function (subState, transformer) {
+ return transformer.out(subState, key);
+ }, data);
+ } catch (err) {
+ if (process.env.NODE_ENV !== 'production') console.warn('redux-persist/getStoredState: Error restoring data for key:', key, err);
+ }
+
+ return state;
+ }
+
+ function passWhitelistBlacklist(key) {
+ if (whitelist && whitelist.indexOf(key) === -1) return false;
+ if (blacklist.indexOf(key) !== -1) return false;
+ return true;
+ }
+
+ function createStorageKey(key) {
+ return '' + keyPrefix + key;
+ }
+ });
+}
+
+function defaultDeserializer(serial) {
+ return JSON.parse(serial);
+}
\ No newline at end of file
diff --git a/node_modules/redux-persist/es/integration/getStoredStateMigrateV4.js.flow b/node_modules/redux-persist/es/integration/getStoredStateMigrateV4.js.flow
new file mode 100644
index 0000000..03ea063
--- /dev/null
+++ b/node_modules/redux-persist/es/integration/getStoredStateMigrateV4.js.flow
@@ -0,0 +1,183 @@
+// @flow
+
+import getStoredStateV5 from '../getStoredState'
+
+import type { PersistConfig, Transform } from '../types'
+
+type V4Config = {
+ storage?: Object,
+ keyPrefix?: string,
+ transforms?: Array,
+ blacklist?: Array,
+ whitelist?: Array,
+}
+
+export default function getStoredState(v4Config: V4Config) {
+ return function(v5Config: PersistConfig) {
+ return getStoredStateV5(v5Config).then(state => {
+ if (state) return state
+ else return getStoredStateV4(v4Config)
+ })
+ }
+}
+
+const KEY_PREFIX = 'reduxPersist:'
+
+function hasLocalStorage() {
+ if (typeof window !== 'object' || !('localStorage' in window)) {
+ return false
+ }
+
+ try {
+ let storage = window.localStorage
+ const testKey = `redux-persist localStorage test`
+ storage.setItem(testKey, 'test')
+ storage.getItem(testKey)
+ storage.removeItem(testKey)
+ } catch (e) {
+ if (process.env.NODE_ENV !== 'production')
+ console.warn(
+ `redux-persist localStorage test failed, persistence will be disabled.`
+ )
+ return false
+ }
+ return true
+}
+
+let noop = (...args: any) => {
+ /* noop */ return null
+}
+const noStorage = {
+ getItem: noop,
+ setItem: noop,
+ removeItem: noop,
+ getAllKeys: noop,
+}
+const createAsyncLocalStorage = () => {
+ if (!hasLocalStorage()) return noStorage
+ let localStorage = window.localStorage
+ return {
+ getAllKeys: function(cb) {
+ try {
+ var keys = []
+ for (var i = 0; i < localStorage.length; i++) {
+ keys.push(localStorage.key(i))
+ }
+ cb(null, keys)
+ } catch (e) {
+ cb(e)
+ }
+ },
+ getItem(key, cb) {
+ try {
+ var s = localStorage.getItem(key)
+ cb(null, s)
+ } catch (e) {
+ cb(e)
+ }
+ },
+ setItem(key, string, cb) {
+ try {
+ localStorage.setItem(key, string)
+ cb(null)
+ } catch (e) {
+ cb(e)
+ }
+ },
+ removeItem(key, cb) {
+ try {
+ localStorage.removeItem(key)
+ cb && cb(null)
+ } catch (e) {
+ cb(e)
+ }
+ },
+ }
+}
+
+function getStoredStateV4(v4Config: V4Config) {
+ return new Promise((resolve, reject) => {
+ let storage = v4Config.storage || createAsyncLocalStorage()
+ const deserializer =
+ v4Config.serialize === false
+ ? data => data
+ : (serial: string) => JSON.parse(serial)
+ const blacklist = v4Config.blacklist || []
+ const whitelist = v4Config.whitelist || false
+ const transforms = v4Config.transforms || []
+ const keyPrefix =
+ v4Config.keyPrefix !== undefined ? v4Config.keyPrefix : KEY_PREFIX
+
+ // fallback getAllKeys to `keys` if present (LocalForage compatability)
+ if (storage.keys && !storage.getAllKeys)
+ storage = { ...storage, getAllKeys: storage.keys }
+
+ let restoredState = {}
+ let completionCount = 0
+
+ storage.getAllKeys((err, allKeys = []) => {
+ if (err) {
+ if (process.env.NODE_ENV !== 'production')
+ console.warn(
+ 'redux-persist/getStoredState: Error in storage.getAllKeys'
+ )
+ return reject(err)
+ }
+
+ let persistKeys = allKeys
+ .filter(key => key.indexOf(keyPrefix) === 0)
+ .map(key => key.slice(keyPrefix.length))
+ let keysToRestore = persistKeys.filter(passWhitelistBlacklist)
+
+ let restoreCount = keysToRestore.length
+ if (restoreCount === 0) resolve(undefined)
+ keysToRestore.forEach(key => {
+ storage.getItem(createStorageKey(key), (err, serialized) => {
+ if (err && process.env.NODE_ENV !== 'production')
+ console.warn(
+ 'redux-persist/getStoredState: Error restoring data for key:',
+ key,
+ err
+ )
+ else restoredState[key] = rehydrate(key, serialized)
+ completionCount += 1
+ if (completionCount === restoreCount) resolve(restoredState)
+ })
+ })
+ })
+
+ function rehydrate(key: string, serialized: ?string) {
+ let state = null
+
+ try {
+ let data = serialized ? deserializer(serialized) : undefined
+ state = transforms.reduceRight((subState, transformer) => {
+ return transformer.out(subState, key)
+ }, data)
+ } catch (err) {
+ if (process.env.NODE_ENV !== 'production')
+ console.warn(
+ 'redux-persist/getStoredState: Error restoring data for key:',
+ key,
+ err
+ )
+ }
+
+ return state
+ }
+
+ function passWhitelistBlacklist(key) {
+ if (whitelist && whitelist.indexOf(key) === -1) return false
+ if (blacklist.indexOf(key) !== -1) return false
+ return true
+ }
+
+ function createStorageKey(key) {
+ return `${keyPrefix}${key}`
+ }
+ })
+}
+
+function defaultDeserializer(serial: string) {
+ return JSON.parse(serial)
+}
diff --git a/node_modules/redux-persist/es/integration/react.js b/node_modules/redux-persist/es/integration/react.js
new file mode 100644
index 0000000..ef86417
--- /dev/null
+++ b/node_modules/redux-persist/es/integration/react.js
@@ -0,0 +1,72 @@
+var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
+
+function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
+
+function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
+
+function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
+
+import React, { PureComponent } from 'react'; // eslint-disable-line import/no-unresolved
+// eslint-disable-line import/no-unresolved
+
+
+export var PersistGate = function (_PureComponent) {
+ _inherits(PersistGate, _PureComponent);
+
+ function PersistGate() {
+ var _ref;
+
+ var _temp, _this, _ret;
+
+ _classCallCheck(this, PersistGate);
+
+ for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
+ args[_key] = arguments[_key];
+ }
+
+ return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = PersistGate.__proto__ || Object.getPrototypeOf(PersistGate)).call.apply(_ref, [this].concat(args))), _this), _this.state = {
+ bootstrapped: false
+ }, _this.handlePersistorState = function () {
+ var persistor = _this.props.persistor;
+
+ var _persistor$getState = persistor.getState(),
+ bootstrapped = _persistor$getState.bootstrapped;
+
+ if (bootstrapped) {
+ if (_this.props.onBeforeLift) {
+ Promise.resolve(_this.props.onBeforeLift()).then(function () {
+ return _this.setState({ bootstrapped: true });
+ }).catch(function () {
+ return _this.setState({ bootstrapped: true });
+ });
+ } else {
+ _this.setState({ bootstrapped: true });
+ }
+ _this._unsubscribe && _this._unsubscribe();
+ }
+ }, _temp), _possibleConstructorReturn(_this, _ret);
+ }
+
+ _createClass(PersistGate, [{
+ key: 'componentDidMount',
+ value: function componentDidMount() {
+ this._unsubscribe = this.props.persistor.subscribe(this.handlePersistorState);
+ this.handlePersistorState();
+ }
+ }, {
+ key: 'componentWillUnmount',
+ value: function componentWillUnmount() {
+ this._unsubscribe && this._unsubscribe();
+ }
+ }, {
+ key: 'render',
+ value: function render() {
+ return this.state.bootstrapped ? this.props.children : this.props.loading;
+ }
+ }]);
+
+ return PersistGate;
+}(PureComponent);
+PersistGate.defaultProps = {
+ loading: null
+};
\ No newline at end of file
diff --git a/node_modules/redux-persist/es/integration/react.js.flow b/node_modules/redux-persist/es/integration/react.js.flow
new file mode 100644
index 0000000..6a34894
--- /dev/null
+++ b/node_modules/redux-persist/es/integration/react.js.flow
@@ -0,0 +1,56 @@
+// @flow
+import React, { PureComponent } from 'react' // eslint-disable-line import/no-unresolved
+import type { Node } from 'react' // eslint-disable-line import/no-unresolved
+import type { Persistor } from '../types'
+
+type Props = {
+ onBeforeLift?: Function,
+ children?: Node,
+ loading?: Node,
+ persistor: Persistor,
+}
+
+type State = {
+ bootstrapped: boolean,
+}
+
+export class PersistGate extends PureComponent {
+ static defaultProps = {
+ loading: null,
+ }
+
+ state = {
+ bootstrapped: false,
+ }
+ _unsubscribe: ?Function
+
+ componentDidMount() {
+ this._unsubscribe = this.props.persistor.subscribe(
+ this.handlePersistorState
+ )
+ this.handlePersistorState()
+ }
+
+ handlePersistorState = () => {
+ const { persistor } = this.props
+ let { bootstrapped } = persistor.getState()
+ if (bootstrapped) {
+ if (this.props.onBeforeLift) {
+ Promise.resolve(this.props.onBeforeLift())
+ .then(() => this.setState({ bootstrapped: true }))
+ .catch(() => this.setState({ bootstrapped: true }))
+ } else {
+ this.setState({ bootstrapped: true })
+ }
+ this._unsubscribe && this._unsubscribe()
+ }
+ }
+
+ componentWillUnmount() {
+ this._unsubscribe && this._unsubscribe()
+ }
+
+ render() {
+ return this.state.bootstrapped ? this.props.children : this.props.loading
+ }
+}
diff --git a/node_modules/redux-persist/es/persistCombineReducers.js b/node_modules/redux-persist/es/persistCombineReducers.js
new file mode 100644
index 0000000..a92b9f1
--- /dev/null
+++ b/node_modules/redux-persist/es/persistCombineReducers.js
@@ -0,0 +1,9 @@
+import { combineReducers } from 'redux';
+import persistReducer from './persistReducer';
+import autoMergeLevel2 from './stateReconciler/autoMergeLevel2';
+
+// combineReducers + persistReducer with stateReconciler defaulted to autoMergeLevel2
+export default function persistCombineReducers(config, reducers) {
+ config.stateReconciler = config.stateReconciler === undefined ? autoMergeLevel2 : config.stateReconciler;
+ return persistReducer(config, combineReducers(reducers));
+}
\ No newline at end of file
diff --git a/node_modules/redux-persist/es/persistCombineReducers.js.flow b/node_modules/redux-persist/es/persistCombineReducers.js.flow
new file mode 100644
index 0000000..3db95ea
--- /dev/null
+++ b/node_modules/redux-persist/es/persistCombineReducers.js.flow
@@ -0,0 +1,22 @@
+// @flow
+
+import { combineReducers } from 'redux'
+import persistReducer from './persistReducer'
+import autoMergeLevel2 from './stateReconciler/autoMergeLevel2'
+
+import type { PersistConfig } from './types'
+
+type Reducers = {
+ [key: string]: Function,
+}
+
+type Reducer = (state: Object, action: Object) => Object
+
+// combineReducers + persistReducer with stateReconciler defaulted to autoMergeLevel2
+export default function persistCombineReducers(
+ config: PersistConfig,
+ reducers: Reducers
+): Reducer {
+ config.stateReconciler = config.stateReconciler === undefined ? autoMergeLevel2 : config.stateReconciler
+ return persistReducer(config, combineReducers(reducers))
+}
diff --git a/node_modules/redux-persist/es/persistReducer.js b/node_modules/redux-persist/es/persistReducer.js
new file mode 100644
index 0000000..2d7f372
--- /dev/null
+++ b/node_modules/redux-persist/es/persistReducer.js
@@ -0,0 +1,110 @@
+var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
+
+function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
+
+import { FLUSH, PAUSE, PERSIST, PURGE, REHYDRATE, DEFAULT_VERSION } from './constants';
+
+import autoMergeLevel1 from './stateReconciler/autoMergeLevel1';
+import createPersistoid from './createPersistoid';
+import defaultGetStoredState from './getStoredState';
+import purgeStoredState from './purgeStoredState';
+
+/*
+ @TODO add validation / handling for:
+ - persisting a reducer which has nested _persist
+ - handling actions that fire before reydrate is called
+*/
+export default function persistReducer(config, baseReducer) {
+ if (process.env.NODE_ENV !== 'production') {
+ if (!config) throw new Error('config is required for persistReducer');
+ if (!config.key) throw new Error('key is required in persistor config');
+ if (!config.storage) throw new Error("redux-persist: config.storage is required. Try using one of the provided storage engines `import storageLocal from 'redux-persist/es/storage/local'");
+ }
+
+ var version = config.version !== undefined ? config.version : DEFAULT_VERSION;
+ var debug = config.debug || false;
+ var stateReconciler = config.stateReconciler === undefined ? autoMergeLevel1 : config.stateReconciler;
+ var getStoredState = config.getStoredState || defaultGetStoredState;
+ var _persistoid = null;
+ var _purge = false;
+ var _paused = true;
+
+ return function (state, action) {
+ var _ref = state || {},
+ _persist = _ref._persist,
+ rest = _objectWithoutProperties(_ref, ['_persist']);
+
+ var restState = rest;
+
+ if (action.type === PERSIST) {
+ // @NOTE PERSIST resumes if paused.
+ _paused = false;
+
+ // @NOTE only ever create persistoid once, ensure we call it at least once, even if _persist has already been set
+ if (!_persistoid) _persistoid = createPersistoid(config);
+
+ // @NOTE PERSIST can be called multiple times, noop after the first
+ if (_persist) return state;
+ if (typeof action.rehydrate !== 'function' || typeof action.register !== 'function') throw new Error('redux-persist: either rehydrate or register is not a function on the PERSIST action. This can happen if the action is being replayed. This is an unexplored use case, please open an issue and we will figure out a resolution.');
+
+ action.register(config.key);
+
+ getStoredState(config).then(function (restoredState) {
+ var migrate = config.migrate || function (s, v) {
+ return Promise.resolve(s);
+ };
+ migrate(restoredState, version).then(function (migratedState) {
+ action.rehydrate(config.key, migratedState);
+ }, function (migrateErr) {
+ if (process.env.NODE_ENV !== 'production' && migrateErr) console.error('redux-persist: migration error', migrateErr);
+ action.rehydrate(config.key, undefined, migrateErr);
+ });
+ }, function (err) {
+ action.rehydrate(config.key, undefined, err);
+ });
+
+ return _extends({}, baseReducer(restState, action), {
+ _persist: { version: version, rehydrated: false }
+ });
+ } else if (action.type === PURGE) {
+ _purge = true;
+ action.result(purgeStoredState(config));
+ return _extends({}, baseReducer(restState, action), {
+ _persist: _persist
+ });
+ } else if (action.type === FLUSH) {
+ action.result(_persistoid && _persistoid.flush());
+ return _extends({}, baseReducer(restState, action), {
+ _persist: _persist
+ });
+ } else if (action.type === PAUSE) {
+ _paused = true;
+ } else if (action.type === REHYDRATE) {
+ // noop on restState if purging
+ if (_purge) return _extends({}, restState, {
+ _persist: _extends({}, _persist, { rehydrated: true })
+
+ // @NOTE if key does not match, will continue to default else below
+ });if (action.key === config.key) {
+ var reducedState = baseReducer(restState, action);
+ var inboundState = action.payload;
+ var reconciledRest = stateReconciler !== false ? stateReconciler(inboundState, state, reducedState, config) : reducedState;
+
+ return _extends({}, reconciledRest, {
+ _persist: _extends({}, _persist, { rehydrated: true })
+ });
+ }
+ }
+
+ // if we have not already handled PERSIST, straight passthrough
+ if (!_persist) return baseReducer(state, action);
+
+ // otherwise, pull off _persist, run the reducer, and update the persistoid
+ // @TODO more performant workaround for combineReducers warning
+ var newState = _extends({}, baseReducer(restState, action), {
+ _persist: _persist
+ // update the persistoid only if we are already rehydrated and are not paused
+ });_persist.rehydrated && _persistoid && !_paused && _persistoid.update(newState);
+ return newState;
+ };
+}
\ No newline at end of file
diff --git a/node_modules/redux-persist/es/persistReducer.js.flow b/node_modules/redux-persist/es/persistReducer.js.flow
new file mode 100644
index 0000000..681a80f
--- /dev/null
+++ b/node_modules/redux-persist/es/persistReducer.js.flow
@@ -0,0 +1,155 @@
+// @flow
+import {
+ FLUSH,
+ PAUSE,
+ PERSIST,
+ PURGE,
+ REHYDRATE,
+ DEFAULT_VERSION,
+} from './constants'
+
+import type {
+ PersistConfig,
+ MigrationManifest,
+ PersistState,
+ Persistoid,
+} from './types'
+
+import autoMergeLevel1 from './stateReconciler/autoMergeLevel1'
+import createPersistoid from './createPersistoid'
+import defaultGetStoredState from './getStoredState'
+import purgeStoredState from './purgeStoredState'
+
+type PersistPartial = { _persist: PersistState }
+/*
+ @TODO add validation / handling for:
+ - persisting a reducer which has nested _persist
+ - handling actions that fire before reydrate is called
+*/
+export default function persistReducer(
+ config: PersistConfig,
+ baseReducer: (State | void, Action) => State
+): (State, Action) => State & PersistPartial {
+ if (process.env.NODE_ENV !== 'production') {
+ if (!config) throw new Error('config is required for persistReducer')
+ if (!config.key) throw new Error('key is required in persistor config')
+ if (!config.storage)
+ throw new Error(
+ "redux-persist: config.storage is required. Try using one of the provided storage engines `import storageLocal from 'redux-persist/es/storage/local'"
+ )
+ }
+
+ const version =
+ config.version !== undefined ? config.version : DEFAULT_VERSION
+ const debug = config.debug || false
+ const stateReconciler =
+ config.stateReconciler === undefined
+ ? autoMergeLevel1
+ : config.stateReconciler
+ const getStoredState = config.getStoredState || defaultGetStoredState
+ let _persistoid = null
+ let _purge = false
+ let _paused = true
+
+ return (state: State, action: Action) => {
+ let { _persist, ...rest } = state || {}
+ let restState: State = rest
+
+ if (action.type === PERSIST) {
+ // @NOTE PERSIST resumes if paused.
+ _paused = false
+
+ // @NOTE only ever create persistoid once, ensure we call it at least once, even if _persist has already been set
+ if (!_persistoid) _persistoid = createPersistoid(config)
+
+ // @NOTE PERSIST can be called multiple times, noop after the first
+ if (_persist) return state
+ if (
+ typeof action.rehydrate !== 'function' ||
+ typeof action.register !== 'function'
+ )
+ throw new Error(
+ 'redux-persist: either rehydrate or register is not a function on the PERSIST action. This can happen if the action is being replayed. This is an unexplored use case, please open an issue and we will figure out a resolution.'
+ )
+
+ action.register(config.key)
+
+ getStoredState(config).then(
+ restoredState => {
+ const migrate = config.migrate || ((s, v) => Promise.resolve(s))
+ migrate(restoredState, version).then(
+ migratedState => {
+ action.rehydrate(config.key, migratedState)
+ },
+ migrateErr => {
+ if (process.env.NODE_ENV !== 'production' && migrateErr)
+ console.error('redux-persist: migration error', migrateErr)
+ action.rehydrate(config.key, undefined, migrateErr)
+ }
+ )
+ },
+ err => {
+ action.rehydrate(config.key, undefined, err)
+ }
+ )
+
+ return {
+ ...baseReducer(restState, action),
+ _persist: { version, rehydrated: false },
+ }
+ } else if (action.type === PURGE) {
+ _purge = true
+ action.result(purgeStoredState(config))
+ return {
+ ...baseReducer(restState, action),
+ _persist,
+ }
+ } else if (action.type === FLUSH) {
+ action.result(_persistoid && _persistoid.flush())
+ return {
+ ...baseReducer(restState, action),
+ _persist,
+ }
+ } else if (action.type === PAUSE) {
+ _paused = true
+ } else if (action.type === REHYDRATE) {
+ // noop on restState if purging
+ if (_purge)
+ return {
+ ...restState,
+ _persist: { ..._persist, rehydrated: true },
+ }
+
+ // @NOTE if key does not match, will continue to default else below
+ if (action.key === config.key) {
+ let reducedState = baseReducer(restState, action)
+ let inboundState = action.payload
+ let reconciledRest: State =
+ stateReconciler !== false
+ ? stateReconciler(inboundState, state, reducedState, config)
+ : reducedState
+
+ return {
+ ...reconciledRest,
+ _persist: { ..._persist, rehydrated: true },
+ }
+ }
+ }
+
+ // if we have not already handled PERSIST, straight passthrough
+ if (!_persist) return baseReducer(state, action)
+
+ // otherwise, pull off _persist, run the reducer, and update the persistoid
+ // @TODO more performant workaround for combineReducers warning
+ let newState = {
+ ...baseReducer(restState, action),
+ _persist,
+ }
+ // update the persistoid only if we are already rehydrated and are not paused
+ _persist.rehydrated &&
+ _persistoid &&
+ !_paused &&
+ _persistoid.update(newState)
+ return newState
+ }
+}
diff --git a/node_modules/redux-persist/es/persistStore.js b/node_modules/redux-persist/es/persistStore.js
new file mode 100644
index 0000000..e93f414
--- /dev/null
+++ b/node_modules/redux-persist/es/persistStore.js
@@ -0,0 +1,102 @@
+var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
+
+function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }
+
+import { createStore } from 'redux';
+
+import persistReducer from './persistReducer';
+import { FLUSH, PAUSE, PERSIST, PURGE, REGISTER, REHYDRATE } from './constants';
+
+var initialState = {
+ registry: [],
+ bootstrapped: false
+};
+
+var persistorReducer = function persistorReducer() {
+ var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : initialState;
+ var action = arguments[1];
+
+ switch (action.type) {
+ case REGISTER:
+ return _extends({}, state, { registry: [].concat(_toConsumableArray(state.registry), [action.key]) });
+ case REHYDRATE:
+ var firstIndex = state.registry.indexOf(action.key);
+ var registry = [].concat(_toConsumableArray(state.registry));
+ registry.splice(firstIndex, 1);
+ return _extends({}, state, { registry: registry, bootstrapped: registry.length === 0 });
+ default:
+ return state;
+ }
+};
+
+export default function persistStore(store, persistorOptions, cb) {
+ var options = persistorOptions || {};
+
+ // help catch incorrect usage of passing PersistConfig in as PersistorOptions
+ if (process.env.NODE_ENV !== 'production') {
+ var bannedKeys = ['blacklist', 'whitelist', 'transforms', 'storage', 'keyPrefix', 'migrate'];
+ bannedKeys.forEach(function (k) {
+ if (!!options[k]) console.error('redux-persist: invalid option passed to persistStore: "' + k + '". You may be incorrectly passing persistConfig into persistStore, whereas it should be passed into persistReducer.');
+ });
+ }
+ var boostrappedCb = cb || false;
+ var persistor = createStore(persistorReducer, undefined, options.enhancer);
+
+ persistor.purge = function () {
+ var results = [];
+ store.dispatch({
+ type: PURGE,
+ result: function result(purgeResult) {
+ results.push(purgeResult);
+ }
+ });
+ return Promise.all(results);
+ };
+
+ persistor.flush = function () {
+ var results = [];
+ store.dispatch({
+ type: FLUSH,
+ result: function result(flushResult) {
+ results.push(flushResult);
+ }
+ });
+ return Promise.all(results);
+ };
+
+ persistor.pause = function () {
+ store.dispatch({
+ type: PAUSE
+ });
+ };
+
+ var register = function register(key) {
+ persistor.dispatch({
+ type: REGISTER,
+ key: key
+ });
+ };
+
+ var rehydrate = function rehydrate(key, payload, err) {
+ var rehydrateAction = {
+ type: REHYDRATE,
+ payload: payload,
+ err: err,
+ key: key
+ // dispatch to `store` to rehydrate and `persistor` to track result
+ };store.dispatch(rehydrateAction);
+ persistor.dispatch(rehydrateAction);
+ if (boostrappedCb && persistor.getState().bootstrapped) {
+ boostrappedCb();
+ boostrappedCb = false;
+ }
+ };
+
+ persistor.persist = function () {
+ store.dispatch({ type: PERSIST, register: register, rehydrate: rehydrate });
+ };
+
+ persistor.persist();
+
+ return persistor;
+}
\ No newline at end of file
diff --git a/node_modules/redux-persist/es/persistStore.js.flow b/node_modules/redux-persist/es/persistStore.js.flow
new file mode 100644
index 0000000..7118baf
--- /dev/null
+++ b/node_modules/redux-persist/es/persistStore.js.flow
@@ -0,0 +1,125 @@
+// @flow
+
+import type {
+ Persistor,
+ PersistConfig,
+ PersistorOptions,
+ MigrationManifest,
+ RehydrateAction,
+ RehydrateErrorType,
+} from './types'
+
+import { createStore } from 'redux'
+import persistReducer from './persistReducer'
+import { FLUSH, PAUSE, PERSIST, PURGE, REGISTER, REHYDRATE } from './constants'
+
+type PendingRehydrate = [Object, RehydrateErrorType, PersistConfig]
+type Persist = (PersistConfig, MigrationManifest) => R => R
+type CreatePersistor = Object => void
+type BoostrappedCb = () => any
+
+const initialState = {
+ registry: [],
+ bootstrapped: false,
+}
+
+const persistorReducer = (state = initialState, action) => {
+ switch (action.type) {
+ case REGISTER:
+ return { ...state, registry: [...state.registry, action.key] }
+ case REHYDRATE:
+ let firstIndex = state.registry.indexOf(action.key)
+ let registry = [...state.registry]
+ registry.splice(firstIndex, 1)
+ return { ...state, registry, bootstrapped: registry.length === 0 }
+ default:
+ return state
+ }
+}
+
+export default function persistStore(
+ store: Object,
+ persistorOptions?: PersistorOptions,
+ cb?: BoostrappedCb
+): Persistor {
+ let options: Object = persistorOptions || {}
+
+ // help catch incorrect usage of passing PersistConfig in as PersistorOptions
+ if (process.env.NODE_ENV !== 'production') {
+ let bannedKeys = [
+ 'blacklist',
+ 'whitelist',
+ 'transforms',
+ 'storage',
+ 'keyPrefix',
+ 'migrate',
+ ]
+ bannedKeys.forEach(k => {
+ if (!!options[k])
+ console.error(
+ `redux-persist: invalid option passed to persistStore: "${k}". You may be incorrectly passing persistConfig into persistStore, whereas it should be passed into persistReducer.`
+ )
+ })
+ }
+ let boostrappedCb = cb || false
+ let persistor = createStore(persistorReducer, undefined, options.enhancer)
+
+ persistor.purge = () => {
+ let results = []
+ store.dispatch({
+ type: PURGE,
+ result: purgeResult => {
+ results.push(purgeResult)
+ },
+ })
+ return Promise.all(results)
+ }
+
+ persistor.flush = () => {
+ let results = []
+ store.dispatch({
+ type: FLUSH,
+ result: flushResult => {
+ results.push(flushResult)
+ },
+ })
+ return Promise.all(results)
+ }
+
+ persistor.pause = () => {
+ store.dispatch({
+ type: PAUSE,
+ })
+ }
+
+ let register = (key: string) => {
+ persistor.dispatch({
+ type: REGISTER,
+ key,
+ })
+ }
+
+ let rehydrate = (key: string, payload: Object, err: any) => {
+ let rehydrateAction = {
+ type: REHYDRATE,
+ payload,
+ err,
+ key,
+ }
+ // dispatch to `store` to rehydrate and `persistor` to track result
+ store.dispatch(rehydrateAction)
+ persistor.dispatch(rehydrateAction)
+ if (boostrappedCb && persistor.getState().bootstrapped) {
+ boostrappedCb()
+ boostrappedCb = false
+ }
+ }
+
+ persistor.persist = () => {
+ store.dispatch({ type: PERSIST, register, rehydrate })
+ }
+
+ persistor.persist()
+
+ return persistor
+}
diff --git a/node_modules/redux-persist/es/purgeStoredState.js b/node_modules/redux-persist/es/purgeStoredState.js
new file mode 100644
index 0000000..a07d21a
--- /dev/null
+++ b/node_modules/redux-persist/es/purgeStoredState.js
@@ -0,0 +1,15 @@
+
+
+import { KEY_PREFIX } from './constants';
+
+export default function purgeStoredState(config) {
+ var storage = config.storage;
+ var storageKey = '' + (config.keyPrefix !== undefined ? config.keyPrefix : KEY_PREFIX) + config.key;
+ return storage.removeItem(storageKey, warnIfRemoveError);
+}
+
+function warnIfRemoveError(err) {
+ if (err && process.env.NODE_ENV !== 'production') {
+ console.error('redux-persist/purgeStoredState: Error purging data stored state', err);
+ }
+}
\ No newline at end of file
diff --git a/node_modules/redux-persist/es/purgeStoredState.js.flow b/node_modules/redux-persist/es/purgeStoredState.js.flow
new file mode 100644
index 0000000..c780f88
--- /dev/null
+++ b/node_modules/redux-persist/es/purgeStoredState.js.flow
@@ -0,0 +1,22 @@
+// @flow
+
+import type { PersistConfig } from './types'
+
+import { KEY_PREFIX } from './constants'
+
+export default function purgeStoredState(config: PersistConfig) {
+ const storage = config.storage
+ const storageKey = `${config.keyPrefix !== undefined
+ ? config.keyPrefix
+ : KEY_PREFIX}${config.key}`
+ return storage.removeItem(storageKey, warnIfRemoveError)
+}
+
+function warnIfRemoveError(err) {
+ if (err && process.env.NODE_ENV !== 'production') {
+ console.error(
+ 'redux-persist/purgeStoredState: Error purging data stored state',
+ err
+ )
+ }
+}
diff --git a/node_modules/redux-persist/es/stateReconciler/autoMergeLevel1.js b/node_modules/redux-persist/es/stateReconciler/autoMergeLevel1.js
new file mode 100644
index 0000000..95ef27b
--- /dev/null
+++ b/node_modules/redux-persist/es/stateReconciler/autoMergeLevel1.js
@@ -0,0 +1,33 @@
+var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
+
+var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
+
+export default function autoMergeLevel1(inboundState, originalState, reducedState, _ref) {
+ var debug = _ref.debug;
+
+ var newState = _extends({}, reducedState);
+ // only rehydrate if inboundState exists and is an object
+ if (inboundState && (typeof inboundState === 'undefined' ? 'undefined' : _typeof(inboundState)) === 'object') {
+ Object.keys(inboundState).forEach(function (key) {
+ // ignore _persist data
+ if (key === '_persist') return;
+ // if reducer modifies substate, skip auto rehydration
+ if (originalState[key] !== reducedState[key]) {
+ if (process.env.NODE_ENV !== 'production' && debug) console.log('redux-persist/stateReconciler: sub state for key `%s` modified, skipping.', key);
+ return;
+ }
+ // otherwise hard set the new value
+ newState[key] = inboundState[key];
+ });
+ }
+
+ if (process.env.NODE_ENV !== 'production' && debug && inboundState && (typeof inboundState === 'undefined' ? 'undefined' : _typeof(inboundState)) === 'object') console.log('redux-persist/stateReconciler: rehydrated keys \'' + Object.keys(inboundState).join(', ') + '\'');
+
+ return newState;
+}
+
+/*
+ autoMergeLevel1:
+ - merges 1 level of substate
+ - skips substate if already modified
+*/
\ No newline at end of file
diff --git a/node_modules/redux-persist/es/stateReconciler/autoMergeLevel1.js.flow b/node_modules/redux-persist/es/stateReconciler/autoMergeLevel1.js.flow
new file mode 100644
index 0000000..880f28a
--- /dev/null
+++ b/node_modules/redux-persist/es/stateReconciler/autoMergeLevel1.js.flow
@@ -0,0 +1,50 @@
+// @flow
+
+/*
+ autoMergeLevel1:
+ - merges 1 level of substate
+ - skips substate if already modified
+*/
+
+import type { PersistConfig } from '../types'
+
+export default function autoMergeLevel1(
+ inboundState: State,
+ originalState: State,
+ reducedState: State,
+ { debug }: PersistConfig
+): State {
+ let newState = { ...reducedState }
+ // only rehydrate if inboundState exists and is an object
+ if (inboundState && typeof inboundState === 'object') {
+ Object.keys(inboundState).forEach(key => {
+ // ignore _persist data
+ if (key === '_persist') return
+ // if reducer modifies substate, skip auto rehydration
+ if (originalState[key] !== reducedState[key]) {
+ if (process.env.NODE_ENV !== 'production' && debug)
+ console.log(
+ 'redux-persist/stateReconciler: sub state for key `%s` modified, skipping.',
+ key
+ )
+ return
+ }
+ // otherwise hard set the new value
+ newState[key] = inboundState[key]
+ })
+ }
+
+ if (
+ process.env.NODE_ENV !== 'production' &&
+ debug &&
+ inboundState &&
+ typeof inboundState === 'object'
+ )
+ console.log(
+ `redux-persist/stateReconciler: rehydrated keys '${Object.keys(
+ inboundState
+ ).join(', ')}'`
+ )
+
+ return newState
+}
diff --git a/node_modules/redux-persist/es/stateReconciler/autoMergeLevel2.js b/node_modules/redux-persist/es/stateReconciler/autoMergeLevel2.js
new file mode 100644
index 0000000..acf61a2
--- /dev/null
+++ b/node_modules/redux-persist/es/stateReconciler/autoMergeLevel2.js
@@ -0,0 +1,43 @@
+var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
+
+var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
+
+export default function autoMergeLevel2(inboundState, originalState, reducedState, _ref) {
+ var debug = _ref.debug;
+
+ var newState = _extends({}, reducedState);
+ // only rehydrate if inboundState exists and is an object
+ if (inboundState && (typeof inboundState === 'undefined' ? 'undefined' : _typeof(inboundState)) === 'object') {
+ Object.keys(inboundState).forEach(function (key) {
+ // ignore _persist data
+ if (key === '_persist') return;
+ // if reducer modifies substate, skip auto rehydration
+ if (originalState[key] !== reducedState[key]) {
+ if (process.env.NODE_ENV !== 'production' && debug) console.log('redux-persist/stateReconciler: sub state for key `%s` modified, skipping.', key);
+ return;
+ }
+ if (isPlainEnoughObject(reducedState[key])) {
+ // if object is plain enough shallow merge the new values (hence "Level2")
+ newState[key] = _extends({}, newState[key], inboundState[key]);
+ return;
+ }
+ // otherwise hard set
+ newState[key] = inboundState[key];
+ });
+ }
+
+ if (process.env.NODE_ENV !== 'production' && debug && inboundState && (typeof inboundState === 'undefined' ? 'undefined' : _typeof(inboundState)) === 'object') console.log('redux-persist/stateReconciler: rehydrated keys \'' + Object.keys(inboundState).join(', ') + '\'');
+
+ return newState;
+}
+
+/*
+ autoMergeLevel2:
+ - merges 2 level of substate
+ - skips substate if already modified
+ - this is essentially redux-perist v4 behavior
+*/
+
+function isPlainEnoughObject(o) {
+ return o !== null && !Array.isArray(o) && (typeof o === 'undefined' ? 'undefined' : _typeof(o)) === 'object';
+}
\ No newline at end of file
diff --git a/node_modules/redux-persist/es/stateReconciler/autoMergeLevel2.js.flow b/node_modules/redux-persist/es/stateReconciler/autoMergeLevel2.js.flow
new file mode 100644
index 0000000..f451380
--- /dev/null
+++ b/node_modules/redux-persist/es/stateReconciler/autoMergeLevel2.js.flow
@@ -0,0 +1,60 @@
+// @flow
+
+/*
+ autoMergeLevel2:
+ - merges 2 level of substate
+ - skips substate if already modified
+ - this is essentially redux-perist v4 behavior
+*/
+
+import type { PersistConfig } from '../types'
+
+export default function autoMergeLevel2(
+ inboundState: State,
+ originalState: State,
+ reducedState: State,
+ { debug }: PersistConfig
+): State {
+ let newState = { ...reducedState }
+ // only rehydrate if inboundState exists and is an object
+ if (inboundState && typeof inboundState === 'object') {
+ Object.keys(inboundState).forEach(key => {
+ // ignore _persist data
+ if (key === '_persist') return
+ // if reducer modifies substate, skip auto rehydration
+ if (originalState[key] !== reducedState[key]) {
+ if (process.env.NODE_ENV !== 'production' && debug)
+ console.log(
+ 'redux-persist/stateReconciler: sub state for key `%s` modified, skipping.',
+ key
+ )
+ return
+ }
+ if (isPlainEnoughObject(reducedState[key])) {
+ // if object is plain enough shallow merge the new values (hence "Level2")
+ newState[key] = { ...newState[key], ...inboundState[key] }
+ return
+ }
+ // otherwise hard set
+ newState[key] = inboundState[key]
+ })
+ }
+
+ if (
+ process.env.NODE_ENV !== 'production' &&
+ debug &&
+ inboundState &&
+ typeof inboundState === 'object'
+ )
+ console.log(
+ `redux-persist/stateReconciler: rehydrated keys '${Object.keys(
+ inboundState
+ ).join(', ')}'`
+ )
+
+ return newState
+}
+
+function isPlainEnoughObject(o) {
+ return o !== null && !Array.isArray(o) && typeof o === 'object'
+}
diff --git a/node_modules/redux-persist/es/stateReconciler/hardSet.js b/node_modules/redux-persist/es/stateReconciler/hardSet.js
new file mode 100644
index 0000000..415341b
--- /dev/null
+++ b/node_modules/redux-persist/es/stateReconciler/hardSet.js
@@ -0,0 +1,10 @@
+
+
+/*
+ hardSet:
+ - hard set incoming state
+*/
+
+export default function hardSet(inboundState) {
+ return inboundState;
+}
\ No newline at end of file
diff --git a/node_modules/redux-persist/es/stateReconciler/hardSet.js.flow b/node_modules/redux-persist/es/stateReconciler/hardSet.js.flow
new file mode 100644
index 0000000..1f5fcda
--- /dev/null
+++ b/node_modules/redux-persist/es/stateReconciler/hardSet.js.flow
@@ -0,0 +1,10 @@
+// @flow
+
+/*
+ hardSet:
+ - hard set incoming state
+*/
+
+export default function hardSet(inboundState: State): State {
+ return inboundState
+}
diff --git a/node_modules/redux-persist/es/storage/createWebStorage.js b/node_modules/redux-persist/es/storage/createWebStorage.js
new file mode 100644
index 0000000..87d949d
--- /dev/null
+++ b/node_modules/redux-persist/es/storage/createWebStorage.js
@@ -0,0 +1,22 @@
+import getStorage from './getStorage';
+
+export default function createWebStorage(type) {
+ var storage = getStorage(type);
+ return {
+ getItem: function getItem(key) {
+ return new Promise(function (resolve, reject) {
+ resolve(storage.getItem(key));
+ });
+ },
+ setItem: function setItem(key, item) {
+ return new Promise(function (resolve, reject) {
+ resolve(storage.setItem(key, item));
+ });
+ },
+ removeItem: function removeItem(key) {
+ return new Promise(function (resolve, reject) {
+ resolve(storage.removeItem(key));
+ });
+ }
+ };
+}
\ No newline at end of file
diff --git a/node_modules/redux-persist/es/storage/createWebStorage.js.flow b/node_modules/redux-persist/es/storage/createWebStorage.js.flow
new file mode 100644
index 0000000..b77132c
--- /dev/null
+++ b/node_modules/redux-persist/es/storage/createWebStorage.js.flow
@@ -0,0 +1,23 @@
+// @flow
+import getStorage from './getStorage'
+
+export default function createWebStorage(type: string) {
+ let storage = getStorage(type)
+ return {
+ getItem: (key: string): Promise => {
+ return new Promise((resolve, reject) => {
+ resolve(storage.getItem(key))
+ })
+ },
+ setItem: (key: string, item: string): Promise => {
+ return new Promise((resolve, reject) => {
+ resolve(storage.setItem(key, item))
+ })
+ },
+ removeItem: (key: string): Promise => {
+ return new Promise((resolve, reject) => {
+ resolve(storage.removeItem(key))
+ })
+ },
+ }
+}
diff --git a/node_modules/redux-persist/es/storage/getStorage.js b/node_modules/redux-persist/es/storage/getStorage.js
new file mode 100644
index 0000000..bcc7414
--- /dev/null
+++ b/node_modules/redux-persist/es/storage/getStorage.js
@@ -0,0 +1,37 @@
+var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
+
+function noop() {}
+
+var noopStorage = {
+ getItem: noop,
+ setItem: noop,
+ removeItem: noop
+};
+
+function hasStorage(storageType) {
+ if ((typeof window === 'undefined' ? 'undefined' : _typeof(window)) !== 'object' || !(storageType in window)) {
+ return false;
+ }
+
+ try {
+ var storage = window[storageType];
+ var testKey = 'redux-persist ' + storageType + ' test';
+ storage.setItem(testKey, 'test');
+ storage.getItem(testKey);
+ storage.removeItem(testKey);
+ } catch (e) {
+ if (process.env.NODE_ENV !== 'production') console.warn('redux-persist ' + storageType + ' test failed, persistence will be disabled.');
+ return false;
+ }
+ return true;
+}
+
+export default function getStorage(type) {
+ var storageType = type + 'Storage';
+ if (hasStorage(storageType)) return window[storageType];else {
+ if (process.env.NODE_ENV !== 'production') {
+ console.error('redux-persist failed to create sync storage. falling back to memory storage.');
+ }
+ return noopStorage;
+ }
+}
\ No newline at end of file
diff --git a/node_modules/redux-persist/es/storage/getStorage.js.flow b/node_modules/redux-persist/es/storage/getStorage.js.flow
new file mode 100644
index 0000000..a6b8e60
--- /dev/null
+++ b/node_modules/redux-persist/es/storage/getStorage.js.flow
@@ -0,0 +1,44 @@
+// @flow
+
+import type { Storage } from '../types'
+
+function noop() {}
+let noopStorage = {
+ getItem: noop,
+ setItem: noop,
+ removeItem: noop,
+}
+
+function hasStorage(storageType) {
+ if (typeof window !== 'object' || !(storageType in window)) {
+ return false
+ }
+
+ try {
+ let storage = window[storageType]
+ const testKey = `redux-persist ${storageType} test`
+ storage.setItem(testKey, 'test')
+ storage.getItem(testKey)
+ storage.removeItem(testKey)
+ } catch (e) {
+ if (process.env.NODE_ENV !== 'production')
+ console.warn(
+ `redux-persist ${storageType} test failed, persistence will be disabled.`
+ )
+ return false
+ }
+ return true
+}
+
+export default function getStorage(type: string): Storage {
+ const storageType = `${type}Storage`
+ if (hasStorage(storageType)) return window[storageType]
+ else {
+ if (process.env.NODE_ENV !== 'production') {
+ console.error(
+ `redux-persist failed to create sync storage. falling back to memory storage.`
+ )
+ }
+ return noopStorage
+ }
+}
diff --git a/node_modules/redux-persist/es/storage/index.js b/node_modules/redux-persist/es/storage/index.js
new file mode 100644
index 0000000..bdd8dea
--- /dev/null
+++ b/node_modules/redux-persist/es/storage/index.js
@@ -0,0 +1,3 @@
+import createWebStorage from './createWebStorage';
+
+export default createWebStorage('local');
\ No newline at end of file
diff --git a/node_modules/redux-persist/es/storage/index.js.flow b/node_modules/redux-persist/es/storage/index.js.flow
new file mode 100644
index 0000000..0532b1f
--- /dev/null
+++ b/node_modules/redux-persist/es/storage/index.js.flow
@@ -0,0 +1,5 @@
+// @flow
+
+import createWebStorage from './createWebStorage'
+
+export default createWebStorage('local')
diff --git a/node_modules/redux-persist/es/storage/index.native.js b/node_modules/redux-persist/es/storage/index.native.js
new file mode 100644
index 0000000..81d0c60
--- /dev/null
+++ b/node_modules/redux-persist/es/storage/index.native.js
@@ -0,0 +1,6 @@
+// @noflow
+/* eslint-disable */
+
+import { AsyncStorage } from 'react-native';
+
+export default AsyncStorage;
\ No newline at end of file
diff --git a/node_modules/redux-persist/es/storage/index.native.js.flow b/node_modules/redux-persist/es/storage/index.native.js.flow
new file mode 100644
index 0000000..641e10f
--- /dev/null
+++ b/node_modules/redux-persist/es/storage/index.native.js.flow
@@ -0,0 +1,6 @@
+// @noflow
+/* eslint-disable */
+
+import { AsyncStorage } from 'react-native'
+
+export default AsyncStorage
diff --git a/node_modules/redux-persist/es/storage/session.js b/node_modules/redux-persist/es/storage/session.js
new file mode 100644
index 0000000..eb01977
--- /dev/null
+++ b/node_modules/redux-persist/es/storage/session.js
@@ -0,0 +1,3 @@
+import createWebStorage from './createWebStorage';
+
+export default createWebStorage('session');
\ No newline at end of file
diff --git a/node_modules/redux-persist/es/storage/session.js.flow b/node_modules/redux-persist/es/storage/session.js.flow
new file mode 100644
index 0000000..1bb16d6
--- /dev/null
+++ b/node_modules/redux-persist/es/storage/session.js.flow
@@ -0,0 +1,5 @@
+// @flow
+
+import createWebStorage from './createWebStorage'
+
+export default createWebStorage('session')
diff --git a/node_modules/redux-persist/es/types.js b/node_modules/redux-persist/es/types.js
new file mode 100644
index 0000000..e69de29
diff --git a/node_modules/redux-persist/es/types.js.flow b/node_modules/redux-persist/es/types.js.flow
new file mode 100644
index 0000000..2873bdb
--- /dev/null
+++ b/node_modules/redux-persist/es/types.js.flow
@@ -0,0 +1,82 @@
+// @flow
+
+export type PersistState = {
+ version: number,
+ rehydrated: boolean,
+}
+
+export type PersistedState = {
+ _persist: PersistState,
+} | void
+
+export type PersistConfig = {
+ version?: number,
+ storage: Object,
+ key: string,
+ keyPrefix?: string, // @TODO remove in v6
+ blacklist?: Array,
+ whitelist?: Array,
+ transforms?: Array,
+ throttle?: number,
+ migrate?: (PersistedState, number) => Promise,
+ stateReconciler?: false | Function,
+ getStoredState?: PersistConfig => Promise, // used for migrations
+ debug?: boolean,
+ serialize?: boolean,
+}
+
+export type PersistorOptions = {
+ enhancer?: Function,
+}
+
+export type Storage = {
+ getItem: (string, ?(string) => any) => any,
+ setItem: (string, string, ?() => any) => any,
+ removeItem: (string, ?() => any) => any,
+}
+
+export type MigrationManifest = {
+ [number | string]: (PersistedState) => PersistedState,
+}
+
+export type Transform = {
+ in: (Object | string, string) => Object,
+ out: (Object | string, string) => Object,
+ config?: PersistConfig,
+}
+
+export type RehydrateErrorType = any
+
+export type RehydrateAction = {
+ type: 'redux-persist/REHYDRATE',
+ key: string,
+ payload: ?Object,
+ err: ?RehydrateErrorType,
+}
+
+export type Persistoid = {
+ update: Object => void,
+ flush: () => Promise,
+}
+
+type RegisterAction = {
+ type: 'redux-persist/REGISTER',
+ key: string,
+}
+
+type PersistorAction = RehydrateAction | RegisterAction
+
+type PersistorState = {
+ registry: Array,
+ bootstrapped: boolean,
+}
+
+type PersistorSubscribeCallback = () => any
+
+export type Persistor = {
+ purge: () => Promise,
+ flush: () => Promise,
+ +dispatch: PersistorAction => PersistorAction,
+ +getState: () => PersistorState,
+ +subscribe: PersistorSubscribeCallback => () => any,
+}
diff --git a/node_modules/redux-persist/es/utils/curry.js b/node_modules/redux-persist/es/utils/curry.js
new file mode 100644
index 0000000..868a477
--- /dev/null
+++ b/node_modules/redux-persist/es/utils/curry.js
@@ -0,0 +1,28 @@
+// //
+// // credit @gcanti, taken from https://github.com/gcanti/flow-static-land/blob/e36cd55b8f8541e81828ec39964bdb6f5ccbec91/src/Fun.js
+
+// export type Fn1 = (a: A, ...rest: Array) => B
+// export type Fn2 = (a: A, b: B, ...rest: Array) => C
+// export type Fn3 = (a: A, b: B, c: C, ...rest: Array) => D
+
+// export type CurriedFn2 = Fn1 > & Fn2
+// export type CurriedFn3 = Fn1 > &
+// Fn2 > &
+// Fn3
+
+// declare function curry (f: Fn2 ): CurriedFn2 // eslint-disable-line no-redeclare
+// declare function curry (f: Fn3 ): CurriedFn3 // eslint-disable-line no-redeclare
+
+// declare function curried(f, length, acc) {
+// return function() {
+// const combined = acc.concat(Array.prototype.slice.call(arguments))
+// return combined.length >= length
+// ? f.apply(this, combined)
+// : curried(f, length, combined)
+// }
+// }
+
+// export function curry(f: Function) {
+// // eslint-disable-line no-redeclare
+// return curried(f, f.length, [])
+// }
\ No newline at end of file
diff --git a/node_modules/redux-persist/es/utils/curry.js.flow b/node_modules/redux-persist/es/utils/curry.js.flow
new file mode 100644
index 0000000..b55b1a8
--- /dev/null
+++ b/node_modules/redux-persist/es/utils/curry.js.flow
@@ -0,0 +1,28 @@
+// // @flow
+// // credit @gcanti, taken from https://github.com/gcanti/flow-static-land/blob/e36cd55b8f8541e81828ec39964bdb6f5ccbec91/src/Fun.js
+
+// export type Fn1 = (a: A, ...rest: Array) => B
+// export type Fn2 = (a: A, b: B, ...rest: Array) => C
+// export type Fn3 = (a: A, b: B, c: C, ...rest: Array) => D
+
+// export type CurriedFn2 = Fn1 > & Fn2
+// export type CurriedFn3 = Fn1 > &
+// Fn2 > &
+// Fn3
+
+// declare function curry (f: Fn2 ): CurriedFn2 // eslint-disable-line no-redeclare
+// declare function curry (f: Fn3 ): CurriedFn3 // eslint-disable-line no-redeclare
+
+// declare function curried(f, length, acc) {
+// return function() {
+// const combined = acc.concat(Array.prototype.slice.call(arguments))
+// return combined.length >= length
+// ? f.apply(this, combined)
+// : curried(f, length, combined)
+// }
+// }
+
+// export function curry(f: Function) {
+// // eslint-disable-line no-redeclare
+// return curried(f, f.length, [])
+// }
diff --git a/node_modules/redux-persist/lib/constants.js b/node_modules/redux-persist/lib/constants.js
new file mode 100644
index 0000000..e128dd6
--- /dev/null
+++ b/node_modules/redux-persist/lib/constants.js
@@ -0,0 +1,11 @@
+'use strict';
+
+exports.__esModule = true;
+var KEY_PREFIX = exports.KEY_PREFIX = 'persist:';
+var FLUSH = exports.FLUSH = 'persist/FLUSH';
+var REHYDRATE = exports.REHYDRATE = 'persist/REHYDRATE';
+var PAUSE = exports.PAUSE = 'persist/PAUSE';
+var PERSIST = exports.PERSIST = 'persist/PERSIST';
+var PURGE = exports.PURGE = 'persist/PURGE';
+var REGISTER = exports.REGISTER = 'persist/REGISTER';
+var DEFAULT_VERSION = exports.DEFAULT_VERSION = -1;
\ No newline at end of file
diff --git a/node_modules/redux-persist/lib/constants.js.flow b/node_modules/redux-persist/lib/constants.js.flow
new file mode 100644
index 0000000..009705f
--- /dev/null
+++ b/node_modules/redux-persist/lib/constants.js.flow
@@ -0,0 +1,10 @@
+// @flow
+
+export const KEY_PREFIX = 'persist:'
+export const FLUSH = 'persist/FLUSH'
+export const REHYDRATE = 'persist/REHYDRATE'
+export const PAUSE = 'persist/PAUSE'
+export const PERSIST = 'persist/PERSIST'
+export const PURGE = 'persist/PURGE'
+export const REGISTER = 'persist/REGISTER'
+export const DEFAULT_VERSION = -1
diff --git a/node_modules/redux-persist/lib/createMigrate.js b/node_modules/redux-persist/lib/createMigrate.js
new file mode 100644
index 0000000..025868b
--- /dev/null
+++ b/node_modules/redux-persist/lib/createMigrate.js
@@ -0,0 +1,47 @@
+'use strict';
+
+exports.__esModule = true;
+exports.default = createMigrate;
+
+var _constants = require('./constants');
+
+function createMigrate(migrations, config) {
+ var _ref = config || {},
+ debug = _ref.debug;
+
+ return function (state, currentVersion) {
+ if (!state) {
+ if (process.env.NODE_ENV !== 'production' && debug) console.log('redux-persist: no inbound state, skipping migration');
+ return Promise.resolve(undefined);
+ }
+
+ var inboundVersion = state._persist && state._persist.version !== undefined ? state._persist.version : _constants.DEFAULT_VERSION;
+ if (inboundVersion === currentVersion) {
+ if (process.env.NODE_ENV !== 'production' && debug) console.log('redux-persist: versions match, noop migration');
+ return Promise.resolve(state);
+ }
+ if (inboundVersion > currentVersion) {
+ if (process.env.NODE_ENV !== 'production') console.error('redux-persist: downgrading version is not supported');
+ return Promise.resolve(state);
+ }
+
+ var migrationKeys = Object.keys(migrations).map(function (ver) {
+ return parseInt(ver);
+ }).filter(function (key) {
+ return currentVersion >= key && key > inboundVersion;
+ }).sort(function (a, b) {
+ return a - b;
+ });
+
+ if (process.env.NODE_ENV !== 'production' && debug) console.log('redux-persist: migrationKeys', migrationKeys);
+ try {
+ var migratedState = migrationKeys.reduce(function (state, versionKey) {
+ if (process.env.NODE_ENV !== 'production' && debug) console.log('redux-persist: running migration for versionKey', versionKey);
+ return migrations[versionKey](state);
+ }, state);
+ return Promise.resolve(migratedState);
+ } catch (err) {
+ return Promise.reject(err);
+ }
+ };
+}
\ No newline at end of file
diff --git a/node_modules/redux-persist/lib/createMigrate.js.flow b/node_modules/redux-persist/lib/createMigrate.js.flow
new file mode 100644
index 0000000..5426c46
--- /dev/null
+++ b/node_modules/redux-persist/lib/createMigrate.js.flow
@@ -0,0 +1,58 @@
+// @flow
+
+import { DEFAULT_VERSION } from './constants'
+
+import type { PersistedState, MigrationManifest } from './types'
+
+export default function createMigrate(
+ migrations: MigrationManifest,
+ config?: { debug: boolean }
+) {
+ let { debug } = config || {}
+ return function(
+ state: PersistedState,
+ currentVersion: number
+ ): Promise {
+ if (!state) {
+ if (process.env.NODE_ENV !== 'production' && debug)
+ console.log('redux-persist: no inbound state, skipping migration')
+ return Promise.resolve(undefined)
+ }
+
+ let inboundVersion: number =
+ state._persist && state._persist.version !== undefined
+ ? state._persist.version
+ : DEFAULT_VERSION
+ if (inboundVersion === currentVersion) {
+ if (process.env.NODE_ENV !== 'production' && debug)
+ console.log('redux-persist: versions match, noop migration')
+ return Promise.resolve(state)
+ }
+ if (inboundVersion > currentVersion) {
+ if (process.env.NODE_ENV !== 'production')
+ console.error('redux-persist: downgrading version is not supported')
+ return Promise.resolve(state)
+ }
+
+ let migrationKeys = Object.keys(migrations)
+ .map(ver => parseInt(ver))
+ .filter(key => currentVersion >= key && key > inboundVersion)
+ .sort((a, b) => a - b)
+
+ if (process.env.NODE_ENV !== 'production' && debug)
+ console.log('redux-persist: migrationKeys', migrationKeys)
+ try {
+ let migratedState = migrationKeys.reduce((state, versionKey) => {
+ if (process.env.NODE_ENV !== 'production' && debug)
+ console.log(
+ 'redux-persist: running migration for versionKey',
+ versionKey
+ )
+ return migrations[versionKey](state)
+ }, state)
+ return Promise.resolve(migratedState)
+ } catch (err) {
+ return Promise.reject(err)
+ }
+ }
+}
diff --git a/node_modules/redux-persist/lib/createPersistoid.js b/node_modules/redux-persist/lib/createPersistoid.js
new file mode 100644
index 0000000..8c66f41
--- /dev/null
+++ b/node_modules/redux-persist/lib/createPersistoid.js
@@ -0,0 +1,109 @@
+'use strict';
+
+exports.__esModule = true;
+exports.default = createPersistoid;
+
+var _constants = require('./constants');
+
+function createPersistoid(config) {
+ // defaults
+ var blacklist = config.blacklist || null;
+ var whitelist = config.whitelist || null;
+ var transforms = config.transforms || [];
+ var throttle = config.throttle || 0;
+ var storageKey = '' + (config.keyPrefix !== undefined ? config.keyPrefix : _constants.KEY_PREFIX) + config.key;
+ var storage = config.storage;
+ var serialize = config.serialize === false ? function (x) {
+ return x;
+ } : defaultSerialize;
+
+ // initialize stateful values
+ var lastState = {};
+ var stagedState = {};
+ var keysToProcess = [];
+ var timeIterator = null;
+ var writePromise = null;
+
+ var update = function update(state) {
+ // add any changed keys to the queue
+ Object.keys(state).forEach(function (key) {
+ var subState = state[key];
+ if (!passWhitelistBlacklist(key)) return; // is keyspace ignored? noop
+ if (lastState[key] === state[key]) return; // value unchanged? noop
+ if (keysToProcess.indexOf(key) !== -1) return; // is key already queued? noop
+ keysToProcess.push(key); // add key to queue
+ });
+
+ // start the time iterator if not running (read: throttle)
+ if (timeIterator === null) {
+ timeIterator = setInterval(processNextKey, throttle);
+ }
+
+ lastState = state;
+ };
+
+ function processNextKey() {
+ if (keysToProcess.length === 0) {
+ if (timeIterator) clearInterval(timeIterator);
+ timeIterator = null;
+ return;
+ }
+
+ var key = keysToProcess.shift();
+ var endState = transforms.reduce(function (subState, transformer) {
+ return transformer.in(subState, key);
+ }, lastState[key]);
+ if (typeof endState !== 'undefined') stagedWrite(key, endState);
+ }
+
+ function stagedWrite(key, endState) {
+ try {
+ stagedState[key] = serialize(endState);
+ } catch (err) {
+ console.error('redux-persist/createPersistoid: error serializing state', err);
+ }
+ if (keysToProcess.length === 0) {
+ // cleanup any removed keys just before write.
+ Object.keys(stagedState).forEach(function (key) {
+ if (lastState[key] === undefined) {
+ delete stagedState[key];
+ }
+ });
+
+ writePromise = storage.setItem(storageKey, serialize(stagedState)).catch(onWriteFail);
+ }
+ }
+
+ function passWhitelistBlacklist(key) {
+ if (whitelist && whitelist.indexOf(key) === -1 && key !== '_persist') return false;
+ if (blacklist && blacklist.indexOf(key) !== -1) return false;
+ return true;
+ }
+
+ function onWriteFail(err) {
+ // @TODO add fail handlers (typically storage full)
+ if (err && process.env.NODE_ENV !== 'production') {
+ console.error('Error storing data', err);
+ }
+ }
+
+ var flush = function flush() {
+ while (keysToProcess.length !== 0) {
+ processNextKey();
+ }
+ return writePromise || Promise.resolve();
+ };
+
+ // return `persistoid`
+ return {
+ update: update,
+ flush: flush
+ };
+}
+
+// @NOTE in the future this may be exposed via config
+
+
+function defaultSerialize(data) {
+ return JSON.stringify(data);
+}
\ No newline at end of file
diff --git a/node_modules/redux-persist/lib/createPersistoid.js.flow b/node_modules/redux-persist/lib/createPersistoid.js.flow
new file mode 100644
index 0000000..16dfe85
--- /dev/null
+++ b/node_modules/redux-persist/lib/createPersistoid.js.flow
@@ -0,0 +1,111 @@
+// @flow
+
+import { KEY_PREFIX, REHYDRATE } from './constants'
+
+import type { Persistoid, PersistConfig, Transform } from './types'
+
+export default function createPersistoid(config: PersistConfig): Persistoid {
+ // defaults
+ const blacklist: ?Array = config.blacklist || null
+ const whitelist: ?Array = config.whitelist || null
+ const transforms = config.transforms || []
+ const throttle = config.throttle || 0
+ const storageKey = `${config.keyPrefix !== undefined
+ ? config.keyPrefix
+ : KEY_PREFIX}${config.key}`
+ const storage = config.storage
+ const serialize = config.serialize === false ? x => x : defaultSerialize
+
+ // initialize stateful values
+ let lastState = {}
+ let stagedState = {}
+ let keysToProcess = []
+ let timeIterator: ?number = null
+ let writePromise = null
+
+ const update = (state: Object) => {
+ // add any changed keys to the queue
+ Object.keys(state).forEach(key => {
+ let subState = state[key]
+ if (!passWhitelistBlacklist(key)) return // is keyspace ignored? noop
+ if (lastState[key] === state[key]) return // value unchanged? noop
+ if (keysToProcess.indexOf(key) !== -1) return // is key already queued? noop
+ keysToProcess.push(key) // add key to queue
+ })
+
+ // start the time iterator if not running (read: throttle)
+ if (timeIterator === null) {
+ timeIterator = setInterval(processNextKey, throttle)
+ }
+
+ lastState = state
+ }
+
+ function processNextKey() {
+ if (keysToProcess.length === 0) {
+ if (timeIterator) clearInterval(timeIterator)
+ timeIterator = null
+ return
+ }
+
+ let key = keysToProcess.shift()
+ let endState = transforms.reduce((subState, transformer) => {
+ return transformer.in(subState, key)
+ }, lastState[key])
+ if (typeof endState !== 'undefined') stagedWrite(key, endState)
+ }
+
+ function stagedWrite(key: string, endState: any) {
+ try {
+ stagedState[key] = serialize(endState)
+ } catch (err) {
+ console.error(
+ 'redux-persist/createPersistoid: error serializing state',
+ err
+ )
+ }
+ if (keysToProcess.length === 0) {
+ // cleanup any removed keys just before write.
+ Object.keys(stagedState).forEach(key => {
+ if (lastState[key] === undefined) {
+ delete stagedState[key]
+ }
+ })
+
+ writePromise = storage
+ .setItem(storageKey, serialize(stagedState))
+ .catch(onWriteFail)
+ }
+ }
+
+ function passWhitelistBlacklist(key) {
+ if (whitelist && whitelist.indexOf(key) === -1 && key !== '_persist') return false
+ if (blacklist && blacklist.indexOf(key) !== -1) return false
+ return true
+ }
+
+ function onWriteFail(err) {
+ // @TODO add fail handlers (typically storage full)
+ if (err && process.env.NODE_ENV !== 'production') {
+ console.error('Error storing data', err)
+ }
+ }
+
+ const flush = () => {
+ while (keysToProcess.length !== 0) {
+ processNextKey()
+ }
+ return writePromise || Promise.resolve()
+ }
+
+ // return `persistoid`
+ return {
+ update,
+ flush,
+ }
+}
+
+// @NOTE in the future this may be exposed via config
+function defaultSerialize(data) {
+ return JSON.stringify(data)
+}
diff --git a/node_modules/redux-persist/lib/createTransform.js b/node_modules/redux-persist/lib/createTransform.js
new file mode 100644
index 0000000..87ff75e
--- /dev/null
+++ b/node_modules/redux-persist/lib/createTransform.js
@@ -0,0 +1,29 @@
+"use strict";
+
+exports.__esModule = true;
+exports.default = createTransform;
+function createTransform(
+// @NOTE inbound: transform state coming from redux on its way to being serialized and stored
+inbound,
+// @NOTE outbound: transform state coming from storage, on its way to be rehydrated into redux
+outbound) {
+ var config = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
+
+ var whitelist = config.whitelist || null;
+ var blacklist = config.blacklist || null;
+
+ function whitelistBlacklistCheck(key) {
+ if (whitelist && whitelist.indexOf(key) === -1) return true;
+ if (blacklist && blacklist.indexOf(key) !== -1) return true;
+ return false;
+ }
+
+ return {
+ in: function _in(state, key) {
+ return !whitelistBlacklistCheck(key) && inbound ? inbound(state, key) : state;
+ },
+ out: function out(state, key) {
+ return !whitelistBlacklistCheck(key) && outbound ? outbound(state, key) : state;
+ }
+ };
+}
\ No newline at end of file
diff --git a/node_modules/redux-persist/lib/createTransform.js.flow b/node_modules/redux-persist/lib/createTransform.js.flow
new file mode 100644
index 0000000..3da5a15
--- /dev/null
+++ b/node_modules/redux-persist/lib/createTransform.js.flow
@@ -0,0 +1,30 @@
+// @flow
+
+type TransformConfig = {
+ whitelist?: Array,
+ blacklist?: Array,
+}
+
+export default function createTransform(
+ // @NOTE inbound: transform state coming from redux on its way to being serialized and stored
+ inbound: ?Function,
+ // @NOTE outbound: transform state coming from storage, on its way to be rehydrated into redux
+ outbound: ?Function,
+ config: TransformConfig = {}
+) {
+ let whitelist = config.whitelist || null
+ let blacklist = config.blacklist || null
+
+ function whitelistBlacklistCheck(key) {
+ if (whitelist && whitelist.indexOf(key) === -1) return true
+ if (blacklist && blacklist.indexOf(key) !== -1) return true
+ return false
+ }
+
+ return {
+ in: (state: Object, key: string) =>
+ !whitelistBlacklistCheck(key) && inbound ? inbound(state, key) : state,
+ out: (state: Object, key: string) =>
+ !whitelistBlacklistCheck(key) && outbound ? outbound(state, key) : state,
+ }
+}
diff --git a/node_modules/redux-persist/lib/getStoredState.js b/node_modules/redux-persist/lib/getStoredState.js
new file mode 100644
index 0000000..14c7c2f
--- /dev/null
+++ b/node_modules/redux-persist/lib/getStoredState.js
@@ -0,0 +1,37 @@
+'use strict';
+
+exports.__esModule = true;
+exports.default = getStoredState;
+
+var _constants = require('./constants');
+
+function getStoredState(config) {
+ var transforms = config.transforms || [];
+ var storageKey = '' + (config.keyPrefix !== undefined ? config.keyPrefix : _constants.KEY_PREFIX) + config.key;
+ var storage = config.storage;
+ var debug = config.debug;
+ var deserialize = config.serialize === false ? function (x) {
+ return x;
+ } : defaultDeserialize;
+ return storage.getItem(storageKey).then(function (serialized) {
+ if (!serialized) return undefined;else {
+ try {
+ var state = {};
+ var rawState = deserialize(serialized);
+ Object.keys(rawState).forEach(function (key) {
+ state[key] = transforms.reduceRight(function (subState, transformer) {
+ return transformer.out(subState, key);
+ }, deserialize(rawState[key]));
+ });
+ return state;
+ } catch (err) {
+ if (process.env.NODE_ENV !== 'production' && debug) console.log('redux-persist/getStoredState: Error restoring data ' + serialized, err);
+ throw err;
+ }
+ }
+ });
+}
+
+function defaultDeserialize(serial) {
+ return JSON.parse(serial);
+}
\ No newline at end of file
diff --git a/node_modules/redux-persist/lib/getStoredState.js.flow b/node_modules/redux-persist/lib/getStoredState.js.flow
new file mode 100644
index 0000000..f98b348
--- /dev/null
+++ b/node_modules/redux-persist/lib/getStoredState.js.flow
@@ -0,0 +1,43 @@
+// @flow
+
+import type { PersistConfig } from './types'
+
+import { KEY_PREFIX } from './constants'
+
+export default function getStoredState(
+ config: PersistConfig
+): Promise {
+ const transforms = config.transforms || []
+ const storageKey = `${config.keyPrefix !== undefined
+ ? config.keyPrefix
+ : KEY_PREFIX}${config.key}`
+ const storage = config.storage
+ const debug = config.debug
+ const deserialize = config.serialize === false ? x => x : defaultDeserialize
+ return storage.getItem(storageKey).then(serialized => {
+ if (!serialized) return undefined
+ else {
+ try {
+ let state = {}
+ let rawState = deserialize(serialized)
+ Object.keys(rawState).forEach(key => {
+ state[key] = transforms.reduceRight((subState, transformer) => {
+ return transformer.out(subState, key)
+ }, deserialize(rawState[key]))
+ })
+ return state
+ } catch (err) {
+ if (process.env.NODE_ENV !== 'production' && debug)
+ console.log(
+ `redux-persist/getStoredState: Error restoring data ${serialized}`,
+ err
+ )
+ throw err
+ }
+ }
+ })
+}
+
+function defaultDeserialize(serial) {
+ return JSON.parse(serial)
+}
diff --git a/node_modules/redux-persist/lib/index.js b/node_modules/redux-persist/lib/index.js
new file mode 100644
index 0000000..6b490ef
--- /dev/null
+++ b/node_modules/redux-persist/lib/index.js
@@ -0,0 +1,89 @@
+'use strict';
+
+exports.__esModule = true;
+
+var _persistReducer = require('./persistReducer');
+
+Object.defineProperty(exports, 'persistReducer', {
+ enumerable: true,
+ get: function get() {
+ return _interopRequireDefault(_persistReducer).default;
+ }
+});
+
+var _persistCombineReducers = require('./persistCombineReducers');
+
+Object.defineProperty(exports, 'persistCombineReducers', {
+ enumerable: true,
+ get: function get() {
+ return _interopRequireDefault(_persistCombineReducers).default;
+ }
+});
+
+var _persistStore = require('./persistStore');
+
+Object.defineProperty(exports, 'persistStore', {
+ enumerable: true,
+ get: function get() {
+ return _interopRequireDefault(_persistStore).default;
+ }
+});
+
+var _createMigrate = require('./createMigrate');
+
+Object.defineProperty(exports, 'createMigrate', {
+ enumerable: true,
+ get: function get() {
+ return _interopRequireDefault(_createMigrate).default;
+ }
+});
+
+var _createTransform = require('./createTransform');
+
+Object.defineProperty(exports, 'createTransform', {
+ enumerable: true,
+ get: function get() {
+ return _interopRequireDefault(_createTransform).default;
+ }
+});
+
+var _getStoredState = require('./getStoredState');
+
+Object.defineProperty(exports, 'getStoredState', {
+ enumerable: true,
+ get: function get() {
+ return _interopRequireDefault(_getStoredState).default;
+ }
+});
+
+var _createPersistoid = require('./createPersistoid');
+
+Object.defineProperty(exports, 'createPersistoid', {
+ enumerable: true,
+ get: function get() {
+ return _interopRequireDefault(_createPersistoid).default;
+ }
+});
+
+var _purgeStoredState = require('./purgeStoredState');
+
+Object.defineProperty(exports, 'purgeStoredState', {
+ enumerable: true,
+ get: function get() {
+ return _interopRequireDefault(_purgeStoredState).default;
+ }
+});
+
+var _constants = require('./constants');
+
+Object.keys(_constants).forEach(function (key) {
+ if (key === "default" || key === "__esModule") return;
+ Object.defineProperty(exports, key, {
+ enumerable: true,
+ get: function get() {
+ return _constants[key];
+ }
+ });
+});
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
\ No newline at end of file
diff --git a/node_modules/redux-persist/lib/index.js.flow b/node_modules/redux-persist/lib/index.js.flow
new file mode 100644
index 0000000..0d9c048
--- /dev/null
+++ b/node_modules/redux-persist/lib/index.js.flow
@@ -0,0 +1,12 @@
+// @flow
+
+export { default as persistReducer } from './persistReducer'
+export { default as persistCombineReducers } from './persistCombineReducers'
+export { default as persistStore } from './persistStore'
+export { default as createMigrate } from './createMigrate'
+export { default as createTransform } from './createTransform'
+export { default as getStoredState } from './getStoredState'
+export { default as createPersistoid } from './createPersistoid'
+export { default as purgeStoredState } from './purgeStoredState'
+
+export * from './constants'
diff --git a/node_modules/redux-persist/lib/integration/getStoredStateMigrateV4.js b/node_modules/redux-persist/lib/integration/getStoredStateMigrateV4.js
new file mode 100644
index 0000000..94d8b15
--- /dev/null
+++ b/node_modules/redux-persist/lib/integration/getStoredStateMigrateV4.js
@@ -0,0 +1,170 @@
+'use strict';
+
+exports.__esModule = true;
+
+var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
+
+var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
+
+exports.default = getStoredState;
+
+var _getStoredState = require('../getStoredState');
+
+var _getStoredState2 = _interopRequireDefault(_getStoredState);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+function getStoredState(v4Config) {
+ return function (v5Config) {
+ return (0, _getStoredState2.default)(v5Config).then(function (state) {
+ if (state) return state;else return getStoredStateV4(v4Config);
+ });
+ };
+}
+
+var KEY_PREFIX = 'reduxPersist:';
+
+function hasLocalStorage() {
+ if ((typeof window === 'undefined' ? 'undefined' : _typeof(window)) !== 'object' || !('localStorage' in window)) {
+ return false;
+ }
+
+ try {
+ var _storage = window.localStorage;
+ var testKey = 'redux-persist localStorage test';
+ _storage.setItem(testKey, 'test');
+ _storage.getItem(testKey);
+ _storage.removeItem(testKey);
+ } catch (e) {
+ if (process.env.NODE_ENV !== 'production') console.warn('redux-persist localStorage test failed, persistence will be disabled.');
+ return false;
+ }
+ return true;
+}
+
+var noop = function noop() {
+ /* noop */return null;
+};
+var noStorage = {
+ getItem: noop,
+ setItem: noop,
+ removeItem: noop,
+ getAllKeys: noop
+};
+var createAsyncLocalStorage = function createAsyncLocalStorage() {
+ if (!hasLocalStorage()) return noStorage;
+ var localStorage = window.localStorage;
+ return {
+ getAllKeys: function getAllKeys(cb) {
+ try {
+ var keys = [];
+ for (var i = 0; i < localStorage.length; i++) {
+ keys.push(localStorage.key(i));
+ }
+ cb(null, keys);
+ } catch (e) {
+ cb(e);
+ }
+ },
+ getItem: function getItem(key, cb) {
+ try {
+ var s = localStorage.getItem(key);
+ cb(null, s);
+ } catch (e) {
+ cb(e);
+ }
+ },
+ setItem: function setItem(key, string, cb) {
+ try {
+ localStorage.setItem(key, string);
+ cb(null);
+ } catch (e) {
+ cb(e);
+ }
+ },
+ removeItem: function removeItem(key, cb) {
+ try {
+ localStorage.removeItem(key);
+ cb && cb(null);
+ } catch (e) {
+ cb(e);
+ }
+ }
+ };
+};
+
+function getStoredStateV4(v4Config) {
+ return new Promise(function (resolve, reject) {
+ var storage = v4Config.storage || createAsyncLocalStorage();
+ var deserializer = v4Config.serialize === false ? function (data) {
+ return data;
+ } : function (serial) {
+ return JSON.parse(serial);
+ };
+ var blacklist = v4Config.blacklist || [];
+ var whitelist = v4Config.whitelist || false;
+ var transforms = v4Config.transforms || [];
+ var keyPrefix = v4Config.keyPrefix !== undefined ? v4Config.keyPrefix : KEY_PREFIX;
+
+ // fallback getAllKeys to `keys` if present (LocalForage compatability)
+ if (storage.keys && !storage.getAllKeys) storage = _extends({}, storage, { getAllKeys: storage.keys });
+
+ var restoredState = {};
+ var completionCount = 0;
+
+ storage.getAllKeys(function (err) {
+ var allKeys = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
+
+ if (err) {
+ if (process.env.NODE_ENV !== 'production') console.warn('redux-persist/getStoredState: Error in storage.getAllKeys');
+ return reject(err);
+ }
+
+ var persistKeys = allKeys.filter(function (key) {
+ return key.indexOf(keyPrefix) === 0;
+ }).map(function (key) {
+ return key.slice(keyPrefix.length);
+ });
+ var keysToRestore = persistKeys.filter(passWhitelistBlacklist);
+
+ var restoreCount = keysToRestore.length;
+ if (restoreCount === 0) resolve(undefined);
+ keysToRestore.forEach(function (key) {
+ storage.getItem(createStorageKey(key), function (err, serialized) {
+ if (err && process.env.NODE_ENV !== 'production') console.warn('redux-persist/getStoredState: Error restoring data for key:', key, err);else restoredState[key] = rehydrate(key, serialized);
+ completionCount += 1;
+ if (completionCount === restoreCount) resolve(restoredState);
+ });
+ });
+ });
+
+ function rehydrate(key, serialized) {
+ var state = null;
+
+ try {
+ var data = serialized ? deserializer(serialized) : undefined;
+ state = transforms.reduceRight(function (subState, transformer) {
+ return transformer.out(subState, key);
+ }, data);
+ } catch (err) {
+ if (process.env.NODE_ENV !== 'production') console.warn('redux-persist/getStoredState: Error restoring data for key:', key, err);
+ }
+
+ return state;
+ }
+
+ function passWhitelistBlacklist(key) {
+ if (whitelist && whitelist.indexOf(key) === -1) return false;
+ if (blacklist.indexOf(key) !== -1) return false;
+ return true;
+ }
+
+ function createStorageKey(key) {
+ return '' + keyPrefix + key;
+ }
+ });
+}
+
+function defaultDeserializer(serial) {
+ return JSON.parse(serial);
+}
\ No newline at end of file
diff --git a/node_modules/redux-persist/lib/integration/getStoredStateMigrateV4.js.flow b/node_modules/redux-persist/lib/integration/getStoredStateMigrateV4.js.flow
new file mode 100644
index 0000000..03ea063
--- /dev/null
+++ b/node_modules/redux-persist/lib/integration/getStoredStateMigrateV4.js.flow
@@ -0,0 +1,183 @@
+// @flow
+
+import getStoredStateV5 from '../getStoredState'
+
+import type { PersistConfig, Transform } from '../types'
+
+type V4Config = {
+ storage?: Object,
+ keyPrefix?: string,
+ transforms?: Array,
+ blacklist?: Array,
+ whitelist?: Array,
+}
+
+export default function getStoredState(v4Config: V4Config) {
+ return function(v5Config: PersistConfig) {
+ return getStoredStateV5(v5Config).then(state => {
+ if (state) return state
+ else return getStoredStateV4(v4Config)
+ })
+ }
+}
+
+const KEY_PREFIX = 'reduxPersist:'
+
+function hasLocalStorage() {
+ if (typeof window !== 'object' || !('localStorage' in window)) {
+ return false
+ }
+
+ try {
+ let storage = window.localStorage
+ const testKey = `redux-persist localStorage test`
+ storage.setItem(testKey, 'test')
+ storage.getItem(testKey)
+ storage.removeItem(testKey)
+ } catch (e) {
+ if (process.env.NODE_ENV !== 'production')
+ console.warn(
+ `redux-persist localStorage test failed, persistence will be disabled.`
+ )
+ return false
+ }
+ return true
+}
+
+let noop = (...args: any) => {
+ /* noop */ return null
+}
+const noStorage = {
+ getItem: noop,
+ setItem: noop,
+ removeItem: noop,
+ getAllKeys: noop,
+}
+const createAsyncLocalStorage = () => {
+ if (!hasLocalStorage()) return noStorage
+ let localStorage = window.localStorage
+ return {
+ getAllKeys: function(cb) {
+ try {
+ var keys = []
+ for (var i = 0; i < localStorage.length; i++) {
+ keys.push(localStorage.key(i))
+ }
+ cb(null, keys)
+ } catch (e) {
+ cb(e)
+ }
+ },
+ getItem(key, cb) {
+ try {
+ var s = localStorage.getItem(key)
+ cb(null, s)
+ } catch (e) {
+ cb(e)
+ }
+ },
+ setItem(key, string, cb) {
+ try {
+ localStorage.setItem(key, string)
+ cb(null)
+ } catch (e) {
+ cb(e)
+ }
+ },
+ removeItem(key, cb) {
+ try {
+ localStorage.removeItem(key)
+ cb && cb(null)
+ } catch (e) {
+ cb(e)
+ }
+ },
+ }
+}
+
+function getStoredStateV4(v4Config: V4Config) {
+ return new Promise((resolve, reject) => {
+ let storage = v4Config.storage || createAsyncLocalStorage()
+ const deserializer =
+ v4Config.serialize === false
+ ? data => data
+ : (serial: string) => JSON.parse(serial)
+ const blacklist = v4Config.blacklist || []
+ const whitelist = v4Config.whitelist || false
+ const transforms = v4Config.transforms || []
+ const keyPrefix =
+ v4Config.keyPrefix !== undefined ? v4Config.keyPrefix : KEY_PREFIX
+
+ // fallback getAllKeys to `keys` if present (LocalForage compatability)
+ if (storage.keys && !storage.getAllKeys)
+ storage = { ...storage, getAllKeys: storage.keys }
+
+ let restoredState = {}
+ let completionCount = 0
+
+ storage.getAllKeys((err, allKeys = []) => {
+ if (err) {
+ if (process.env.NODE_ENV !== 'production')
+ console.warn(
+ 'redux-persist/getStoredState: Error in storage.getAllKeys'
+ )
+ return reject(err)
+ }
+
+ let persistKeys = allKeys
+ .filter(key => key.indexOf(keyPrefix) === 0)
+ .map(key => key.slice(keyPrefix.length))
+ let keysToRestore = persistKeys.filter(passWhitelistBlacklist)
+
+ let restoreCount = keysToRestore.length
+ if (restoreCount === 0) resolve(undefined)
+ keysToRestore.forEach(key => {
+ storage.getItem(createStorageKey(key), (err, serialized) => {
+ if (err && process.env.NODE_ENV !== 'production')
+ console.warn(
+ 'redux-persist/getStoredState: Error restoring data for key:',
+ key,
+ err
+ )
+ else restoredState[key] = rehydrate(key, serialized)
+ completionCount += 1
+ if (completionCount === restoreCount) resolve(restoredState)
+ })
+ })
+ })
+
+ function rehydrate(key: string, serialized: ?string) {
+ let state = null
+
+ try {
+ let data = serialized ? deserializer(serialized) : undefined
+ state = transforms.reduceRight((subState, transformer) => {
+ return transformer.out(subState, key)
+ }, data)
+ } catch (err) {
+ if (process.env.NODE_ENV !== 'production')
+ console.warn(
+ 'redux-persist/getStoredState: Error restoring data for key:',
+ key,
+ err
+ )
+ }
+
+ return state
+ }
+
+ function passWhitelistBlacklist(key) {
+ if (whitelist && whitelist.indexOf(key) === -1) return false
+ if (blacklist.indexOf(key) !== -1) return false
+ return true
+ }
+
+ function createStorageKey(key) {
+ return `${keyPrefix}${key}`
+ }
+ })
+}
+
+function defaultDeserializer(serial: string) {
+ return JSON.parse(serial)
+}
diff --git a/node_modules/redux-persist/lib/integration/react.js b/node_modules/redux-persist/lib/integration/react.js
new file mode 100644
index 0000000..bd309c5
--- /dev/null
+++ b/node_modules/redux-persist/lib/integration/react.js
@@ -0,0 +1,82 @@
+'use strict';
+
+exports.__esModule = true;
+exports.PersistGate = undefined;
+
+var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
+
+var _react = require('react');
+
+var _react2 = _interopRequireDefault(_react);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
+
+function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
+
+function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
+
+// eslint-disable-line import/no-unresolved
+// eslint-disable-line import/no-unresolved
+var PersistGate = exports.PersistGate = function (_PureComponent) {
+ _inherits(PersistGate, _PureComponent);
+
+ function PersistGate() {
+ var _ref;
+
+ var _temp, _this, _ret;
+
+ _classCallCheck(this, PersistGate);
+
+ for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
+ args[_key] = arguments[_key];
+ }
+
+ return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = PersistGate.__proto__ || Object.getPrototypeOf(PersistGate)).call.apply(_ref, [this].concat(args))), _this), _this.state = {
+ bootstrapped: false
+ }, _this.handlePersistorState = function () {
+ var persistor = _this.props.persistor;
+
+ var _persistor$getState = persistor.getState(),
+ bootstrapped = _persistor$getState.bootstrapped;
+
+ if (bootstrapped) {
+ if (_this.props.onBeforeLift) {
+ Promise.resolve(_this.props.onBeforeLift()).then(function () {
+ return _this.setState({ bootstrapped: true });
+ }).catch(function () {
+ return _this.setState({ bootstrapped: true });
+ });
+ } else {
+ _this.setState({ bootstrapped: true });
+ }
+ _this._unsubscribe && _this._unsubscribe();
+ }
+ }, _temp), _possibleConstructorReturn(_this, _ret);
+ }
+
+ _createClass(PersistGate, [{
+ key: 'componentDidMount',
+ value: function componentDidMount() {
+ this._unsubscribe = this.props.persistor.subscribe(this.handlePersistorState);
+ this.handlePersistorState();
+ }
+ }, {
+ key: 'componentWillUnmount',
+ value: function componentWillUnmount() {
+ this._unsubscribe && this._unsubscribe();
+ }
+ }, {
+ key: 'render',
+ value: function render() {
+ return this.state.bootstrapped ? this.props.children : this.props.loading;
+ }
+ }]);
+
+ return PersistGate;
+}(_react.PureComponent);
+
+PersistGate.defaultProps = {
+ loading: null
+};
\ No newline at end of file
diff --git a/node_modules/redux-persist/lib/integration/react.js.flow b/node_modules/redux-persist/lib/integration/react.js.flow
new file mode 100644
index 0000000..6a34894
--- /dev/null
+++ b/node_modules/redux-persist/lib/integration/react.js.flow
@@ -0,0 +1,56 @@
+// @flow
+import React, { PureComponent } from 'react' // eslint-disable-line import/no-unresolved
+import type { Node } from 'react' // eslint-disable-line import/no-unresolved
+import type { Persistor } from '../types'
+
+type Props = {
+ onBeforeLift?: Function,
+ children?: Node,
+ loading?: Node,
+ persistor: Persistor,
+}
+
+type State = {
+ bootstrapped: boolean,
+}
+
+export class PersistGate extends PureComponent {
+ static defaultProps = {
+ loading: null,
+ }
+
+ state = {
+ bootstrapped: false,
+ }
+ _unsubscribe: ?Function
+
+ componentDidMount() {
+ this._unsubscribe = this.props.persistor.subscribe(
+ this.handlePersistorState
+ )
+ this.handlePersistorState()
+ }
+
+ handlePersistorState = () => {
+ const { persistor } = this.props
+ let { bootstrapped } = persistor.getState()
+ if (bootstrapped) {
+ if (this.props.onBeforeLift) {
+ Promise.resolve(this.props.onBeforeLift())
+ .then(() => this.setState({ bootstrapped: true }))
+ .catch(() => this.setState({ bootstrapped: true }))
+ } else {
+ this.setState({ bootstrapped: true })
+ }
+ this._unsubscribe && this._unsubscribe()
+ }
+ }
+
+ componentWillUnmount() {
+ this._unsubscribe && this._unsubscribe()
+ }
+
+ render() {
+ return this.state.bootstrapped ? this.props.children : this.props.loading
+ }
+}
diff --git a/node_modules/redux-persist/lib/persistCombineReducers.js b/node_modules/redux-persist/lib/persistCombineReducers.js
new file mode 100644
index 0000000..cd3ace5
--- /dev/null
+++ b/node_modules/redux-persist/lib/persistCombineReducers.js
@@ -0,0 +1,22 @@
+'use strict';
+
+exports.__esModule = true;
+exports.default = persistCombineReducers;
+
+var _redux = require('redux');
+
+var _persistReducer = require('./persistReducer');
+
+var _persistReducer2 = _interopRequireDefault(_persistReducer);
+
+var _autoMergeLevel = require('./stateReconciler/autoMergeLevel2');
+
+var _autoMergeLevel2 = _interopRequireDefault(_autoMergeLevel);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+// combineReducers + persistReducer with stateReconciler defaulted to autoMergeLevel2
+function persistCombineReducers(config, reducers) {
+ config.stateReconciler = config.stateReconciler === undefined ? _autoMergeLevel2.default : config.stateReconciler;
+ return (0, _persistReducer2.default)(config, (0, _redux.combineReducers)(reducers));
+}
\ No newline at end of file
diff --git a/node_modules/redux-persist/lib/persistCombineReducers.js.flow b/node_modules/redux-persist/lib/persistCombineReducers.js.flow
new file mode 100644
index 0000000..3db95ea
--- /dev/null
+++ b/node_modules/redux-persist/lib/persistCombineReducers.js.flow
@@ -0,0 +1,22 @@
+// @flow
+
+import { combineReducers } from 'redux'
+import persistReducer from './persistReducer'
+import autoMergeLevel2 from './stateReconciler/autoMergeLevel2'
+
+import type { PersistConfig } from './types'
+
+type Reducers = {
+ [key: string]: Function,
+}
+
+type Reducer = (state: Object, action: Object) => Object
+
+// combineReducers + persistReducer with stateReconciler defaulted to autoMergeLevel2
+export default function persistCombineReducers(
+ config: PersistConfig,
+ reducers: Reducers
+): Reducer {
+ config.stateReconciler = config.stateReconciler === undefined ? autoMergeLevel2 : config.stateReconciler
+ return persistReducer(config, combineReducers(reducers))
+}
diff --git a/node_modules/redux-persist/lib/persistReducer.js b/node_modules/redux-persist/lib/persistReducer.js
new file mode 100644
index 0000000..83773fb
--- /dev/null
+++ b/node_modules/redux-persist/lib/persistReducer.js
@@ -0,0 +1,129 @@
+'use strict';
+
+exports.__esModule = true;
+
+var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
+
+exports.default = persistReducer;
+
+var _constants = require('./constants');
+
+var _autoMergeLevel = require('./stateReconciler/autoMergeLevel1');
+
+var _autoMergeLevel2 = _interopRequireDefault(_autoMergeLevel);
+
+var _createPersistoid = require('./createPersistoid');
+
+var _createPersistoid2 = _interopRequireDefault(_createPersistoid);
+
+var _getStoredState = require('./getStoredState');
+
+var _getStoredState2 = _interopRequireDefault(_getStoredState);
+
+var _purgeStoredState = require('./purgeStoredState');
+
+var _purgeStoredState2 = _interopRequireDefault(_purgeStoredState);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
+
+/*
+ @TODO add validation / handling for:
+ - persisting a reducer which has nested _persist
+ - handling actions that fire before reydrate is called
+*/
+function persistReducer(config, baseReducer) {
+ if (process.env.NODE_ENV !== 'production') {
+ if (!config) throw new Error('config is required for persistReducer');
+ if (!config.key) throw new Error('key is required in persistor config');
+ if (!config.storage) throw new Error("redux-persist: config.storage is required. Try using one of the provided storage engines `import storageLocal from 'redux-persist/es/storage/local'");
+ }
+
+ var version = config.version !== undefined ? config.version : _constants.DEFAULT_VERSION;
+ var debug = config.debug || false;
+ var stateReconciler = config.stateReconciler === undefined ? _autoMergeLevel2.default : config.stateReconciler;
+ var getStoredState = config.getStoredState || _getStoredState2.default;
+ var _persistoid = null;
+ var _purge = false;
+ var _paused = true;
+
+ return function (state, action) {
+ var _ref = state || {},
+ _persist = _ref._persist,
+ rest = _objectWithoutProperties(_ref, ['_persist']);
+
+ var restState = rest;
+
+ if (action.type === _constants.PERSIST) {
+ // @NOTE PERSIST resumes if paused.
+ _paused = false;
+
+ // @NOTE only ever create persistoid once, ensure we call it at least once, even if _persist has already been set
+ if (!_persistoid) _persistoid = (0, _createPersistoid2.default)(config);
+
+ // @NOTE PERSIST can be called multiple times, noop after the first
+ if (_persist) return state;
+ if (typeof action.rehydrate !== 'function' || typeof action.register !== 'function') throw new Error('redux-persist: either rehydrate or register is not a function on the PERSIST action. This can happen if the action is being replayed. This is an unexplored use case, please open an issue and we will figure out a resolution.');
+
+ action.register(config.key);
+
+ getStoredState(config).then(function (restoredState) {
+ var migrate = config.migrate || function (s, v) {
+ return Promise.resolve(s);
+ };
+ migrate(restoredState, version).then(function (migratedState) {
+ action.rehydrate(config.key, migratedState);
+ }, function (migrateErr) {
+ if (process.env.NODE_ENV !== 'production' && migrateErr) console.error('redux-persist: migration error', migrateErr);
+ action.rehydrate(config.key, undefined, migrateErr);
+ });
+ }, function (err) {
+ action.rehydrate(config.key, undefined, err);
+ });
+
+ return _extends({}, baseReducer(restState, action), {
+ _persist: { version: version, rehydrated: false }
+ });
+ } else if (action.type === _constants.PURGE) {
+ _purge = true;
+ action.result((0, _purgeStoredState2.default)(config));
+ return _extends({}, baseReducer(restState, action), {
+ _persist: _persist
+ });
+ } else if (action.type === _constants.FLUSH) {
+ action.result(_persistoid && _persistoid.flush());
+ return _extends({}, baseReducer(restState, action), {
+ _persist: _persist
+ });
+ } else if (action.type === _constants.PAUSE) {
+ _paused = true;
+ } else if (action.type === _constants.REHYDRATE) {
+ // noop on restState if purging
+ if (_purge) return _extends({}, restState, {
+ _persist: _extends({}, _persist, { rehydrated: true })
+
+ // @NOTE if key does not match, will continue to default else below
+ });if (action.key === config.key) {
+ var reducedState = baseReducer(restState, action);
+ var inboundState = action.payload;
+ var reconciledRest = stateReconciler !== false ? stateReconciler(inboundState, state, reducedState, config) : reducedState;
+
+ return _extends({}, reconciledRest, {
+ _persist: _extends({}, _persist, { rehydrated: true })
+ });
+ }
+ }
+
+ // if we have not already handled PERSIST, straight passthrough
+ if (!_persist) return baseReducer(state, action);
+
+ // otherwise, pull off _persist, run the reducer, and update the persistoid
+ // @TODO more performant workaround for combineReducers warning
+ var newState = _extends({}, baseReducer(restState, action), {
+ _persist: _persist
+ // update the persistoid only if we are already rehydrated and are not paused
+ });_persist.rehydrated && _persistoid && !_paused && _persistoid.update(newState);
+ return newState;
+ };
+}
\ No newline at end of file
diff --git a/node_modules/redux-persist/lib/persistReducer.js.flow b/node_modules/redux-persist/lib/persistReducer.js.flow
new file mode 100644
index 0000000..681a80f
--- /dev/null
+++ b/node_modules/redux-persist/lib/persistReducer.js.flow
@@ -0,0 +1,155 @@
+// @flow
+import {
+ FLUSH,
+ PAUSE,
+ PERSIST,
+ PURGE,
+ REHYDRATE,
+ DEFAULT_VERSION,
+} from './constants'
+
+import type {
+ PersistConfig,
+ MigrationManifest,
+ PersistState,
+ Persistoid,
+} from './types'
+
+import autoMergeLevel1 from './stateReconciler/autoMergeLevel1'
+import createPersistoid from './createPersistoid'
+import defaultGetStoredState from './getStoredState'
+import purgeStoredState from './purgeStoredState'
+
+type PersistPartial = { _persist: PersistState }
+/*
+ @TODO add validation / handling for:
+ - persisting a reducer which has nested _persist
+ - handling actions that fire before reydrate is called
+*/
+export default function persistReducer(
+ config: PersistConfig,
+ baseReducer: (State | void, Action) => State
+): (State, Action) => State & PersistPartial {
+ if (process.env.NODE_ENV !== 'production') {
+ if (!config) throw new Error('config is required for persistReducer')
+ if (!config.key) throw new Error('key is required in persistor config')
+ if (!config.storage)
+ throw new Error(
+ "redux-persist: config.storage is required. Try using one of the provided storage engines `import storageLocal from 'redux-persist/es/storage/local'"
+ )
+ }
+
+ const version =
+ config.version !== undefined ? config.version : DEFAULT_VERSION
+ const debug = config.debug || false
+ const stateReconciler =
+ config.stateReconciler === undefined
+ ? autoMergeLevel1
+ : config.stateReconciler
+ const getStoredState = config.getStoredState || defaultGetStoredState
+ let _persistoid = null
+ let _purge = false
+ let _paused = true
+
+ return (state: State, action: Action) => {
+ let { _persist, ...rest } = state || {}
+ let restState: State = rest
+
+ if (action.type === PERSIST) {
+ // @NOTE PERSIST resumes if paused.
+ _paused = false
+
+ // @NOTE only ever create persistoid once, ensure we call it at least once, even if _persist has already been set
+ if (!_persistoid) _persistoid = createPersistoid(config)
+
+ // @NOTE PERSIST can be called multiple times, noop after the first
+ if (_persist) return state
+ if (
+ typeof action.rehydrate !== 'function' ||
+ typeof action.register !== 'function'
+ )
+ throw new Error(
+ 'redux-persist: either rehydrate or register is not a function on the PERSIST action. This can happen if the action is being replayed. This is an unexplored use case, please open an issue and we will figure out a resolution.'
+ )
+
+ action.register(config.key)
+
+ getStoredState(config).then(
+ restoredState => {
+ const migrate = config.migrate || ((s, v) => Promise.resolve(s))
+ migrate(restoredState, version).then(
+ migratedState => {
+ action.rehydrate(config.key, migratedState)
+ },
+ migrateErr => {
+ if (process.env.NODE_ENV !== 'production' && migrateErr)
+ console.error('redux-persist: migration error', migrateErr)
+ action.rehydrate(config.key, undefined, migrateErr)
+ }
+ )
+ },
+ err => {
+ action.rehydrate(config.key, undefined, err)
+ }
+ )
+
+ return {
+ ...baseReducer(restState, action),
+ _persist: { version, rehydrated: false },
+ }
+ } else if (action.type === PURGE) {
+ _purge = true
+ action.result(purgeStoredState(config))
+ return {
+ ...baseReducer(restState, action),
+ _persist,
+ }
+ } else if (action.type === FLUSH) {
+ action.result(_persistoid && _persistoid.flush())
+ return {
+ ...baseReducer(restState, action),
+ _persist,
+ }
+ } else if (action.type === PAUSE) {
+ _paused = true
+ } else if (action.type === REHYDRATE) {
+ // noop on restState if purging
+ if (_purge)
+ return {
+ ...restState,
+ _persist: { ..._persist, rehydrated: true },
+ }
+
+ // @NOTE if key does not match, will continue to default else below
+ if (action.key === config.key) {
+ let reducedState = baseReducer(restState, action)
+ let inboundState = action.payload
+ let reconciledRest: State =
+ stateReconciler !== false
+ ? stateReconciler(inboundState, state, reducedState, config)
+ : reducedState
+
+ return {
+ ...reconciledRest,
+ _persist: { ..._persist, rehydrated: true },
+ }
+ }
+ }
+
+ // if we have not already handled PERSIST, straight passthrough
+ if (!_persist) return baseReducer(state, action)
+
+ // otherwise, pull off _persist, run the reducer, and update the persistoid
+ // @TODO more performant workaround for combineReducers warning
+ let newState = {
+ ...baseReducer(restState, action),
+ _persist,
+ }
+ // update the persistoid only if we are already rehydrated and are not paused
+ _persist.rehydrated &&
+ _persistoid &&
+ !_paused &&
+ _persistoid.update(newState)
+ return newState
+ }
+}
diff --git a/node_modules/redux-persist/lib/persistStore.js b/node_modules/redux-persist/lib/persistStore.js
new file mode 100644
index 0000000..1eec37b
--- /dev/null
+++ b/node_modules/redux-persist/lib/persistStore.js
@@ -0,0 +1,113 @@
+'use strict';
+
+exports.__esModule = true;
+
+var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
+
+exports.default = persistStore;
+
+var _redux = require('redux');
+
+var _persistReducer = require('./persistReducer');
+
+var _persistReducer2 = _interopRequireDefault(_persistReducer);
+
+var _constants = require('./constants');
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }
+
+var initialState = {
+ registry: [],
+ bootstrapped: false
+};
+
+var persistorReducer = function persistorReducer() {
+ var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : initialState;
+ var action = arguments[1];
+
+ switch (action.type) {
+ case _constants.REGISTER:
+ return _extends({}, state, { registry: [].concat(_toConsumableArray(state.registry), [action.key]) });
+ case _constants.REHYDRATE:
+ var firstIndex = state.registry.indexOf(action.key);
+ var registry = [].concat(_toConsumableArray(state.registry));
+ registry.splice(firstIndex, 1);
+ return _extends({}, state, { registry: registry, bootstrapped: registry.length === 0 });
+ default:
+ return state;
+ }
+};
+
+function persistStore(store, persistorOptions, cb) {
+ var options = persistorOptions || {};
+
+ // help catch incorrect usage of passing PersistConfig in as PersistorOptions
+ if (process.env.NODE_ENV !== 'production') {
+ var bannedKeys = ['blacklist', 'whitelist', 'transforms', 'storage', 'keyPrefix', 'migrate'];
+ bannedKeys.forEach(function (k) {
+ if (!!options[k]) console.error('redux-persist: invalid option passed to persistStore: "' + k + '". You may be incorrectly passing persistConfig into persistStore, whereas it should be passed into persistReducer.');
+ });
+ }
+ var boostrappedCb = cb || false;
+ var persistor = (0, _redux.createStore)(persistorReducer, undefined, options.enhancer);
+
+ persistor.purge = function () {
+ var results = [];
+ store.dispatch({
+ type: _constants.PURGE,
+ result: function result(purgeResult) {
+ results.push(purgeResult);
+ }
+ });
+ return Promise.all(results);
+ };
+
+ persistor.flush = function () {
+ var results = [];
+ store.dispatch({
+ type: _constants.FLUSH,
+ result: function result(flushResult) {
+ results.push(flushResult);
+ }
+ });
+ return Promise.all(results);
+ };
+
+ persistor.pause = function () {
+ store.dispatch({
+ type: _constants.PAUSE
+ });
+ };
+
+ var register = function register(key) {
+ persistor.dispatch({
+ type: _constants.REGISTER,
+ key: key
+ });
+ };
+
+ var rehydrate = function rehydrate(key, payload, err) {
+ var rehydrateAction = {
+ type: _constants.REHYDRATE,
+ payload: payload,
+ err: err,
+ key: key
+ // dispatch to `store` to rehydrate and `persistor` to track result
+ };store.dispatch(rehydrateAction);
+ persistor.dispatch(rehydrateAction);
+ if (boostrappedCb && persistor.getState().bootstrapped) {
+ boostrappedCb();
+ boostrappedCb = false;
+ }
+ };
+
+ persistor.persist = function () {
+ store.dispatch({ type: _constants.PERSIST, register: register, rehydrate: rehydrate });
+ };
+
+ persistor.persist();
+
+ return persistor;
+}
\ No newline at end of file
diff --git a/node_modules/redux-persist/lib/persistStore.js.flow b/node_modules/redux-persist/lib/persistStore.js.flow
new file mode 100644
index 0000000..7118baf
--- /dev/null
+++ b/node_modules/redux-persist/lib/persistStore.js.flow
@@ -0,0 +1,125 @@
+// @flow
+
+import type {
+ Persistor,
+ PersistConfig,
+ PersistorOptions,
+ MigrationManifest,
+ RehydrateAction,
+ RehydrateErrorType,
+} from './types'
+
+import { createStore } from 'redux'
+import persistReducer from './persistReducer'
+import { FLUSH, PAUSE, PERSIST, PURGE, REGISTER, REHYDRATE } from './constants'
+
+type PendingRehydrate = [Object, RehydrateErrorType, PersistConfig]
+type Persist = (PersistConfig, MigrationManifest) => R => R
+type CreatePersistor = Object => void
+type BoostrappedCb = () => any
+
+const initialState = {
+ registry: [],
+ bootstrapped: false,
+}
+
+const persistorReducer = (state = initialState, action) => {
+ switch (action.type) {
+ case REGISTER:
+ return { ...state, registry: [...state.registry, action.key] }
+ case REHYDRATE:
+ let firstIndex = state.registry.indexOf(action.key)
+ let registry = [...state.registry]
+ registry.splice(firstIndex, 1)
+ return { ...state, registry, bootstrapped: registry.length === 0 }
+ default:
+ return state
+ }
+}
+
+export default function persistStore(
+ store: Object,
+ persistorOptions?: PersistorOptions,
+ cb?: BoostrappedCb
+): Persistor {
+ let options: Object = persistorOptions || {}
+
+ // help catch incorrect usage of passing PersistConfig in as PersistorOptions
+ if (process.env.NODE_ENV !== 'production') {
+ let bannedKeys = [
+ 'blacklist',
+ 'whitelist',
+ 'transforms',
+ 'storage',
+ 'keyPrefix',
+ 'migrate',
+ ]
+ bannedKeys.forEach(k => {
+ if (!!options[k])
+ console.error(
+ `redux-persist: invalid option passed to persistStore: "${k}". You may be incorrectly passing persistConfig into persistStore, whereas it should be passed into persistReducer.`
+ )
+ })
+ }
+ let boostrappedCb = cb || false
+ let persistor = createStore(persistorReducer, undefined, options.enhancer)
+
+ persistor.purge = () => {
+ let results = []
+ store.dispatch({
+ type: PURGE,
+ result: purgeResult => {
+ results.push(purgeResult)
+ },
+ })
+ return Promise.all(results)
+ }
+
+ persistor.flush = () => {
+ let results = []
+ store.dispatch({
+ type: FLUSH,
+ result: flushResult => {
+ results.push(flushResult)
+ },
+ })
+ return Promise.all(results)
+ }
+
+ persistor.pause = () => {
+ store.dispatch({
+ type: PAUSE,
+ })
+ }
+
+ let register = (key: string) => {
+ persistor.dispatch({
+ type: REGISTER,
+ key,
+ })
+ }
+
+ let rehydrate = (key: string, payload: Object, err: any) => {
+ let rehydrateAction = {
+ type: REHYDRATE,
+ payload,
+ err,
+ key,
+ }
+ // dispatch to `store` to rehydrate and `persistor` to track result
+ store.dispatch(rehydrateAction)
+ persistor.dispatch(rehydrateAction)
+ if (boostrappedCb && persistor.getState().bootstrapped) {
+ boostrappedCb()
+ boostrappedCb = false
+ }
+ }
+
+ persistor.persist = () => {
+ store.dispatch({ type: PERSIST, register, rehydrate })
+ }
+
+ persistor.persist()
+
+ return persistor
+}
diff --git a/node_modules/redux-persist/lib/purgeStoredState.js b/node_modules/redux-persist/lib/purgeStoredState.js
new file mode 100644
index 0000000..fc5be3f
--- /dev/null
+++ b/node_modules/redux-persist/lib/purgeStoredState.js
@@ -0,0 +1,18 @@
+'use strict';
+
+exports.__esModule = true;
+exports.default = purgeStoredState;
+
+var _constants = require('./constants');
+
+function purgeStoredState(config) {
+ var storage = config.storage;
+ var storageKey = '' + (config.keyPrefix !== undefined ? config.keyPrefix : _constants.KEY_PREFIX) + config.key;
+ return storage.removeItem(storageKey, warnIfRemoveError);
+}
+
+function warnIfRemoveError(err) {
+ if (err && process.env.NODE_ENV !== 'production') {
+ console.error('redux-persist/purgeStoredState: Error purging data stored state', err);
+ }
+}
\ No newline at end of file
diff --git a/node_modules/redux-persist/lib/purgeStoredState.js.flow b/node_modules/redux-persist/lib/purgeStoredState.js.flow
new file mode 100644
index 0000000..c780f88
--- /dev/null
+++ b/node_modules/redux-persist/lib/purgeStoredState.js.flow
@@ -0,0 +1,22 @@
+// @flow
+
+import type { PersistConfig } from './types'
+
+import { KEY_PREFIX } from './constants'
+
+export default function purgeStoredState(config: PersistConfig) {
+ const storage = config.storage
+ const storageKey = `${config.keyPrefix !== undefined
+ ? config.keyPrefix
+ : KEY_PREFIX}${config.key}`
+ return storage.removeItem(storageKey, warnIfRemoveError)
+}
+
+function warnIfRemoveError(err) {
+ if (err && process.env.NODE_ENV !== 'production') {
+ console.error(
+ 'redux-persist/purgeStoredState: Error purging data stored state',
+ err
+ )
+ }
+}
diff --git a/node_modules/redux-persist/lib/stateReconciler/autoMergeLevel1.js b/node_modules/redux-persist/lib/stateReconciler/autoMergeLevel1.js
new file mode 100644
index 0000000..a2568f1
--- /dev/null
+++ b/node_modules/redux-persist/lib/stateReconciler/autoMergeLevel1.js
@@ -0,0 +1,38 @@
+'use strict';
+
+exports.__esModule = true;
+
+var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
+
+var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
+
+exports.default = autoMergeLevel1;
+function autoMergeLevel1(inboundState, originalState, reducedState, _ref) {
+ var debug = _ref.debug;
+
+ var newState = _extends({}, reducedState);
+ // only rehydrate if inboundState exists and is an object
+ if (inboundState && (typeof inboundState === 'undefined' ? 'undefined' : _typeof(inboundState)) === 'object') {
+ Object.keys(inboundState).forEach(function (key) {
+ // ignore _persist data
+ if (key === '_persist') return;
+ // if reducer modifies substate, skip auto rehydration
+ if (originalState[key] !== reducedState[key]) {
+ if (process.env.NODE_ENV !== 'production' && debug) console.log('redux-persist/stateReconciler: sub state for key `%s` modified, skipping.', key);
+ return;
+ }
+ // otherwise hard set the new value
+ newState[key] = inboundState[key];
+ });
+ }
+
+ if (process.env.NODE_ENV !== 'production' && debug && inboundState && (typeof inboundState === 'undefined' ? 'undefined' : _typeof(inboundState)) === 'object') console.log('redux-persist/stateReconciler: rehydrated keys \'' + Object.keys(inboundState).join(', ') + '\'');
+
+ return newState;
+}
+
+/*
+ autoMergeLevel1:
+ - merges 1 level of substate
+ - skips substate if already modified
+*/
\ No newline at end of file
diff --git a/node_modules/redux-persist/lib/stateReconciler/autoMergeLevel1.js.flow b/node_modules/redux-persist/lib/stateReconciler/autoMergeLevel1.js.flow
new file mode 100644
index 0000000..880f28a
--- /dev/null
+++ b/node_modules/redux-persist/lib/stateReconciler/autoMergeLevel1.js.flow
@@ -0,0 +1,50 @@
+// @flow
+
+/*
+ autoMergeLevel1:
+ - merges 1 level of substate
+ - skips substate if already modified
+*/
+
+import type { PersistConfig } from '../types'
+
+export default function autoMergeLevel1(
+ inboundState: State,
+ originalState: State,
+ reducedState: State,
+ { debug }: PersistConfig
+): State {
+ let newState = { ...reducedState }
+ // only rehydrate if inboundState exists and is an object
+ if (inboundState && typeof inboundState === 'object') {
+ Object.keys(inboundState).forEach(key => {
+ // ignore _persist data
+ if (key === '_persist') return
+ // if reducer modifies substate, skip auto rehydration
+ if (originalState[key] !== reducedState[key]) {
+ if (process.env.NODE_ENV !== 'production' && debug)
+ console.log(
+ 'redux-persist/stateReconciler: sub state for key `%s` modified, skipping.',
+ key
+ )
+ return
+ }
+ // otherwise hard set the new value
+ newState[key] = inboundState[key]
+ })
+ }
+
+ if (
+ process.env.NODE_ENV !== 'production' &&
+ debug &&
+ inboundState &&
+ typeof inboundState === 'object'
+ )
+ console.log(
+ `redux-persist/stateReconciler: rehydrated keys '${Object.keys(
+ inboundState
+ ).join(', ')}'`
+ )
+
+ return newState
+}
diff --git a/node_modules/redux-persist/lib/stateReconciler/autoMergeLevel2.js b/node_modules/redux-persist/lib/stateReconciler/autoMergeLevel2.js
new file mode 100644
index 0000000..a33862d
--- /dev/null
+++ b/node_modules/redux-persist/lib/stateReconciler/autoMergeLevel2.js
@@ -0,0 +1,48 @@
+'use strict';
+
+exports.__esModule = true;
+
+var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
+
+var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
+
+exports.default = autoMergeLevel2;
+function autoMergeLevel2(inboundState, originalState, reducedState, _ref) {
+ var debug = _ref.debug;
+
+ var newState = _extends({}, reducedState);
+ // only rehydrate if inboundState exists and is an object
+ if (inboundState && (typeof inboundState === 'undefined' ? 'undefined' : _typeof(inboundState)) === 'object') {
+ Object.keys(inboundState).forEach(function (key) {
+ // ignore _persist data
+ if (key === '_persist') return;
+ // if reducer modifies substate, skip auto rehydration
+ if (originalState[key] !== reducedState[key]) {
+ if (process.env.NODE_ENV !== 'production' && debug) console.log('redux-persist/stateReconciler: sub state for key `%s` modified, skipping.', key);
+ return;
+ }
+ if (isPlainEnoughObject(reducedState[key])) {
+ // if object is plain enough shallow merge the new values (hence "Level2")
+ newState[key] = _extends({}, newState[key], inboundState[key]);
+ return;
+ }
+ // otherwise hard set
+ newState[key] = inboundState[key];
+ });
+ }
+
+ if (process.env.NODE_ENV !== 'production' && debug && inboundState && (typeof inboundState === 'undefined' ? 'undefined' : _typeof(inboundState)) === 'object') console.log('redux-persist/stateReconciler: rehydrated keys \'' + Object.keys(inboundState).join(', ') + '\'');
+
+ return newState;
+}
+
+/*
+ autoMergeLevel2:
+ - merges 2 level of substate
+ - skips substate if already modified
+ - this is essentially redux-perist v4 behavior
+*/
+
+function isPlainEnoughObject(o) {
+ return o !== null && !Array.isArray(o) && (typeof o === 'undefined' ? 'undefined' : _typeof(o)) === 'object';
+}
\ No newline at end of file
diff --git a/node_modules/redux-persist/lib/stateReconciler/autoMergeLevel2.js.flow b/node_modules/redux-persist/lib/stateReconciler/autoMergeLevel2.js.flow
new file mode 100644
index 0000000..f451380
--- /dev/null
+++ b/node_modules/redux-persist/lib/stateReconciler/autoMergeLevel2.js.flow
@@ -0,0 +1,60 @@
+// @flow
+
+/*
+ autoMergeLevel2:
+ - merges 2 level of substate
+ - skips substate if already modified
+ - this is essentially redux-perist v4 behavior
+*/
+
+import type { PersistConfig } from '../types'
+
+export default function autoMergeLevel2(
+ inboundState: State,
+ originalState: State,
+ reducedState: State,
+ { debug }: PersistConfig
+): State {
+ let newState = { ...reducedState }
+ // only rehydrate if inboundState exists and is an object
+ if (inboundState && typeof inboundState === 'object') {
+ Object.keys(inboundState).forEach(key => {
+ // ignore _persist data
+ if (key === '_persist') return
+ // if reducer modifies substate, skip auto rehydration
+ if (originalState[key] !== reducedState[key]) {
+ if (process.env.NODE_ENV !== 'production' && debug)
+ console.log(
+ 'redux-persist/stateReconciler: sub state for key `%s` modified, skipping.',
+ key
+ )
+ return
+ }
+ if (isPlainEnoughObject(reducedState[key])) {
+ // if object is plain enough shallow merge the new values (hence "Level2")
+ newState[key] = { ...newState[key], ...inboundState[key] }
+ return
+ }
+ // otherwise hard set
+ newState[key] = inboundState[key]
+ })
+ }
+
+ if (
+ process.env.NODE_ENV !== 'production' &&
+ debug &&
+ inboundState &&
+ typeof inboundState === 'object'
+ )
+ console.log(
+ `redux-persist/stateReconciler: rehydrated keys '${Object.keys(
+ inboundState
+ ).join(', ')}'`
+ )
+
+ return newState
+}
+
+function isPlainEnoughObject(o) {
+ return o !== null && !Array.isArray(o) && typeof o === 'object'
+}
diff --git a/node_modules/redux-persist/lib/stateReconciler/hardSet.js b/node_modules/redux-persist/lib/stateReconciler/hardSet.js
new file mode 100644
index 0000000..96752c4
--- /dev/null
+++ b/node_modules/redux-persist/lib/stateReconciler/hardSet.js
@@ -0,0 +1,14 @@
+"use strict";
+
+exports.__esModule = true;
+exports.default = hardSet;
+
+
+/*
+ hardSet:
+ - hard set incoming state
+*/
+
+function hardSet(inboundState) {
+ return inboundState;
+}
\ No newline at end of file
diff --git a/node_modules/redux-persist/lib/stateReconciler/hardSet.js.flow b/node_modules/redux-persist/lib/stateReconciler/hardSet.js.flow
new file mode 100644
index 0000000..1f5fcda
--- /dev/null
+++ b/node_modules/redux-persist/lib/stateReconciler/hardSet.js.flow
@@ -0,0 +1,10 @@
+// @flow
+
+/*
+ hardSet:
+ - hard set incoming state
+*/
+
+export default function hardSet(inboundState: State): State {
+ return inboundState
+}
diff --git a/node_modules/redux-persist/lib/storage/createWebStorage.js b/node_modules/redux-persist/lib/storage/createWebStorage.js
new file mode 100644
index 0000000..950d9a9
--- /dev/null
+++ b/node_modules/redux-persist/lib/storage/createWebStorage.js
@@ -0,0 +1,31 @@
+'use strict';
+
+exports.__esModule = true;
+exports.default = createWebStorage;
+
+var _getStorage = require('./getStorage');
+
+var _getStorage2 = _interopRequireDefault(_getStorage);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+function createWebStorage(type) {
+ var storage = (0, _getStorage2.default)(type);
+ return {
+ getItem: function getItem(key) {
+ return new Promise(function (resolve, reject) {
+ resolve(storage.getItem(key));
+ });
+ },
+ setItem: function setItem(key, item) {
+ return new Promise(function (resolve, reject) {
+ resolve(storage.setItem(key, item));
+ });
+ },
+ removeItem: function removeItem(key) {
+ return new Promise(function (resolve, reject) {
+ resolve(storage.removeItem(key));
+ });
+ }
+ };
+}
\ No newline at end of file
diff --git a/node_modules/redux-persist/lib/storage/createWebStorage.js.flow b/node_modules/redux-persist/lib/storage/createWebStorage.js.flow
new file mode 100644
index 0000000..b77132c
--- /dev/null
+++ b/node_modules/redux-persist/lib/storage/createWebStorage.js.flow
@@ -0,0 +1,23 @@
+// @flow
+import getStorage from './getStorage'
+
+export default function createWebStorage(type: string) {
+ let storage = getStorage(type)
+ return {
+ getItem: (key: string): Promise => {
+ return new Promise((resolve, reject) => {
+ resolve(storage.getItem(key))
+ })
+ },
+ setItem: (key: string, item: string): Promise => {
+ return new Promise((resolve, reject) => {
+ resolve(storage.setItem(key, item))
+ })
+ },
+ removeItem: (key: string): Promise => {
+ return new Promise((resolve, reject) => {
+ resolve(storage.removeItem(key))
+ })
+ },
+ }
+}
diff --git a/node_modules/redux-persist/lib/storage/getStorage.js b/node_modules/redux-persist/lib/storage/getStorage.js
new file mode 100644
index 0000000..c8232b7
--- /dev/null
+++ b/node_modules/redux-persist/lib/storage/getStorage.js
@@ -0,0 +1,44 @@
+'use strict';
+
+exports.__esModule = true;
+
+var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
+
+exports.default = getStorage;
+
+
+function noop() {}
+
+var noopStorage = {
+ getItem: noop,
+ setItem: noop,
+ removeItem: noop
+};
+
+function hasStorage(storageType) {
+ if ((typeof window === 'undefined' ? 'undefined' : _typeof(window)) !== 'object' || !(storageType in window)) {
+ return false;
+ }
+
+ try {
+ var storage = window[storageType];
+ var testKey = 'redux-persist ' + storageType + ' test';
+ storage.setItem(testKey, 'test');
+ storage.getItem(testKey);
+ storage.removeItem(testKey);
+ } catch (e) {
+ if (process.env.NODE_ENV !== 'production') console.warn('redux-persist ' + storageType + ' test failed, persistence will be disabled.');
+ return false;
+ }
+ return true;
+}
+
+function getStorage(type) {
+ var storageType = type + 'Storage';
+ if (hasStorage(storageType)) return window[storageType];else {
+ if (process.env.NODE_ENV !== 'production') {
+ console.error('redux-persist failed to create sync storage. falling back to memory storage.');
+ }
+ return noopStorage;
+ }
+}
\ No newline at end of file
diff --git a/node_modules/redux-persist/lib/storage/getStorage.js.flow b/node_modules/redux-persist/lib/storage/getStorage.js.flow
new file mode 100644
index 0000000..a6b8e60
--- /dev/null
+++ b/node_modules/redux-persist/lib/storage/getStorage.js.flow
@@ -0,0 +1,44 @@
+// @flow
+
+import type { Storage } from '../types'
+
+function noop() {}
+let noopStorage = {
+ getItem: noop,
+ setItem: noop,
+ removeItem: noop,
+}
+
+function hasStorage(storageType) {
+ if (typeof window !== 'object' || !(storageType in window)) {
+ return false
+ }
+
+ try {
+ let storage = window[storageType]
+ const testKey = `redux-persist ${storageType} test`
+ storage.setItem(testKey, 'test')
+ storage.getItem(testKey)
+ storage.removeItem(testKey)
+ } catch (e) {
+ if (process.env.NODE_ENV !== 'production')
+ console.warn(
+ `redux-persist ${storageType} test failed, persistence will be disabled.`
+ )
+ return false
+ }
+ return true
+}
+
+export default function getStorage(type: string): Storage {
+ const storageType = `${type}Storage`
+ if (hasStorage(storageType)) return window[storageType]
+ else {
+ if (process.env.NODE_ENV !== 'production') {
+ console.error(
+ `redux-persist failed to create sync storage. falling back to memory storage.`
+ )
+ }
+ return noopStorage
+ }
+}
diff --git a/node_modules/redux-persist/lib/storage/index.js b/node_modules/redux-persist/lib/storage/index.js
new file mode 100644
index 0000000..ab29ff5
--- /dev/null
+++ b/node_modules/redux-persist/lib/storage/index.js
@@ -0,0 +1,11 @@
+'use strict';
+
+exports.__esModule = true;
+
+var _createWebStorage = require('./createWebStorage');
+
+var _createWebStorage2 = _interopRequireDefault(_createWebStorage);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+exports.default = (0, _createWebStorage2.default)('local');
\ No newline at end of file
diff --git a/node_modules/redux-persist/lib/storage/index.js.flow b/node_modules/redux-persist/lib/storage/index.js.flow
new file mode 100644
index 0000000..0532b1f
--- /dev/null
+++ b/node_modules/redux-persist/lib/storage/index.js.flow
@@ -0,0 +1,5 @@
+// @flow
+
+import createWebStorage from './createWebStorage'
+
+export default createWebStorage('local')
diff --git a/node_modules/redux-persist/lib/storage/index.native.js b/node_modules/redux-persist/lib/storage/index.native.js
new file mode 100644
index 0000000..9cba57d
--- /dev/null
+++ b/node_modules/redux-persist/lib/storage/index.native.js
@@ -0,0 +1,8 @@
+'use strict';
+
+exports.__esModule = true;
+
+var _reactNative = require('react-native');
+
+exports.default = _reactNative.AsyncStorage; // @noflow
+/* eslint-disable */
\ No newline at end of file
diff --git a/node_modules/redux-persist/lib/storage/index.native.js.flow b/node_modules/redux-persist/lib/storage/index.native.js.flow
new file mode 100644
index 0000000..641e10f
--- /dev/null
+++ b/node_modules/redux-persist/lib/storage/index.native.js.flow
@@ -0,0 +1,6 @@
+// @noflow
+/* eslint-disable */
+
+import { AsyncStorage } from 'react-native'
+
+export default AsyncStorage
diff --git a/node_modules/redux-persist/lib/storage/session.js b/node_modules/redux-persist/lib/storage/session.js
new file mode 100644
index 0000000..73e278d
--- /dev/null
+++ b/node_modules/redux-persist/lib/storage/session.js
@@ -0,0 +1,11 @@
+'use strict';
+
+exports.__esModule = true;
+
+var _createWebStorage = require('./createWebStorage');
+
+var _createWebStorage2 = _interopRequireDefault(_createWebStorage);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+exports.default = (0, _createWebStorage2.default)('session');
\ No newline at end of file
diff --git a/node_modules/redux-persist/lib/storage/session.js.flow b/node_modules/redux-persist/lib/storage/session.js.flow
new file mode 100644
index 0000000..1bb16d6
--- /dev/null
+++ b/node_modules/redux-persist/lib/storage/session.js.flow
@@ -0,0 +1,5 @@
+// @flow
+
+import createWebStorage from './createWebStorage'
+
+export default createWebStorage('session')
diff --git a/node_modules/redux-persist/lib/types.js b/node_modules/redux-persist/lib/types.js
new file mode 100644
index 0000000..a726efc
--- /dev/null
+++ b/node_modules/redux-persist/lib/types.js
@@ -0,0 +1 @@
+'use strict';
\ No newline at end of file
diff --git a/node_modules/redux-persist/lib/types.js.flow b/node_modules/redux-persist/lib/types.js.flow
new file mode 100644
index 0000000..2873bdb
--- /dev/null
+++ b/node_modules/redux-persist/lib/types.js.flow
@@ -0,0 +1,82 @@
+// @flow
+
+export type PersistState = {
+ version: number,
+ rehydrated: boolean,
+}
+
+export type PersistedState = {
+ _persist: PersistState,
+} | void
+
+export type PersistConfig = {
+ version?: number,
+ storage: Object,
+ key: string,
+ keyPrefix?: string, // @TODO remove in v6
+ blacklist?: Array,
+ whitelist?: Array,
+ transforms?: Array,
+ throttle?: number,
+ migrate?: (PersistedState, number) => Promise,
+ stateReconciler?: false | Function,
+ getStoredState?: PersistConfig => Promise, // used for migrations
+ debug?: boolean,
+ serialize?: boolean,
+}
+
+export type PersistorOptions = {
+ enhancer?: Function,
+}
+
+export type Storage = {
+ getItem: (string, ?(string) => any) => any,
+ setItem: (string, string, ?() => any) => any,
+ removeItem: (string, ?() => any) => any,
+}
+
+export type MigrationManifest = {
+ [number | string]: (PersistedState) => PersistedState,
+}
+
+export type Transform = {
+ in: (Object | string, string) => Object,
+ out: (Object | string, string) => Object,
+ config?: PersistConfig,
+}
+
+export type RehydrateErrorType = any
+
+export type RehydrateAction = {
+ type: 'redux-persist/REHYDRATE',
+ key: string,
+ payload: ?Object,
+ err: ?RehydrateErrorType,
+}
+
+export type Persistoid = {
+ update: Object => void,
+ flush: () => Promise,
+}
+
+type RegisterAction = {
+ type: 'redux-persist/REGISTER',
+ key: string,
+}
+
+type PersistorAction = RehydrateAction | RegisterAction
+
+type PersistorState = {
+ registry: Array,
+ bootstrapped: boolean,
+}
+
+type PersistorSubscribeCallback = () => any
+
+export type Persistor = {
+ purge: () => Promise,
+ flush: () => Promise,
+ +dispatch: PersistorAction => PersistorAction,
+ +getState: () => PersistorState,
+ +subscribe: PersistorSubscribeCallback => () => any,
+}
diff --git a/node_modules/redux-persist/lib/utils/curry.js b/node_modules/redux-persist/lib/utils/curry.js
new file mode 100644
index 0000000..c358959
--- /dev/null
+++ b/node_modules/redux-persist/lib/utils/curry.js
@@ -0,0 +1,29 @@
+// //
+// // credit @gcanti, taken from https://github.com/gcanti/flow-static-land/blob/e36cd55b8f8541e81828ec39964bdb6f5ccbec91/src/Fun.js
+
+// export type Fn1 = (a: A, ...rest: Array) => B
+// export type Fn2 = (a: A, b: B, ...rest: Array) => C
+// export type Fn3 = (a: A, b: B, c: C, ...rest: Array) => D
+
+// export type CurriedFn2 = Fn1 > & Fn2
+// export type CurriedFn3 = Fn1 > &
+// Fn2 > &
+// Fn3
+
+// declare function curry (f: Fn2 ): CurriedFn2 // eslint-disable-line no-redeclare
+// declare function curry (f: Fn3 ): CurriedFn3 // eslint-disable-line no-redeclare
+
+// declare function curried(f, length, acc) {
+// return function() {
+// const combined = acc.concat(Array.prototype.slice.call(arguments))
+// return combined.length >= length
+// ? f.apply(this, combined)
+// : curried(f, length, combined)
+// }
+// }
+
+// export function curry(f: Function) {
+// // eslint-disable-line no-redeclare
+// return curried(f, f.length, [])
+// }
+"use strict";
\ No newline at end of file
diff --git a/node_modules/redux-persist/lib/utils/curry.js.flow b/node_modules/redux-persist/lib/utils/curry.js.flow
new file mode 100644
index 0000000..b55b1a8
--- /dev/null
+++ b/node_modules/redux-persist/lib/utils/curry.js.flow
@@ -0,0 +1,28 @@
+// // @flow
+// // credit @gcanti, taken from https://github.com/gcanti/flow-static-land/blob/e36cd55b8f8541e81828ec39964bdb6f5ccbec91/src/Fun.js
+
+// export type Fn1 = (a: A, ...rest: Array) => B
+// export type Fn2 = (a: A, b: B, ...rest: Array) => C
+// export type Fn3 = (a: A, b: B, c: C, ...rest: Array) => D
+
+// export type CurriedFn2 = Fn1 > & Fn2
+// export type CurriedFn3 = Fn1 > &
+// Fn2 > &
+// Fn3
+
+// declare function curry (f: Fn2 ): CurriedFn2 // eslint-disable-line no-redeclare
+// declare function curry (f: Fn3 ): CurriedFn3 // eslint-disable-line no-redeclare
+
+// declare function curried(f, length, acc) {
+// return function() {
+// const combined = acc.concat(Array.prototype.slice.call(arguments))
+// return combined.length >= length
+// ? f.apply(this, combined)
+// : curried(f, length, combined)
+// }
+// }
+
+// export function curry(f: Function) {
+// // eslint-disable-line no-redeclare
+// return curried(f, f.length, [])
+// }
diff --git a/node_modules/redux-persist/package.json b/node_modules/redux-persist/package.json
new file mode 100644
index 0000000..222ebda
--- /dev/null
+++ b/node_modules/redux-persist/package.json
@@ -0,0 +1,72 @@
+{
+ "name": "redux-persist",
+ "version": "5.5.0",
+ "description": "persist and rehydrate redux stores",
+ "main": "lib/index.js",
+ "module": "es/index.js",
+ "repository": "rt2zz/redux-persist",
+ "files": [
+ "es",
+ "src",
+ "lib"
+ ],
+ "scripts": {
+ "build": "npm run flow-copy && npm run build:commonjs && npm run build:es",
+ "build:commonjs": "cross-env BABEL_ENV=commonjs babel src --out-dir lib",
+ "build:es": "cross-env BABEL_ENV=es babel src --out-dir es",
+ "clean": "rimraf es && rimraf lib",
+ "flow-copy": "flow-copy-source src es && flow-copy-source src lib",
+ "precommit": "lint-staged",
+ "prepublishOnly": "npm run clean && npm run build",
+ "test": "BABEL_ENV=commonjs ava"
+ },
+ "lint-staged": {
+ "src/**/*.js": [
+ "prettier --no-semi --single-quote --trailing-comma --parser=flow --write",
+ "git add"
+ ]
+ },
+ "author": "",
+ "license": "MIT",
+ "homepage": "https://github.com/rt2zz/redux-persist#readme",
+ "ava": {
+ "files": [
+ "tests/**/*.spec.js"
+ ],
+ "require": [
+ "babel-polyfill",
+ "babel-register"
+ ],
+ "babel": "inherit"
+ },
+ "devDependencies": {
+ "ava": "^0.19.1",
+ "babel-cli": "^6.26.0",
+ "babel-eslint": "^8.0.1",
+ "babel-plugin-transform-class-properties": "^6.24.1",
+ "babel-plugin-transform-es2015-modules-commonjs": "^6.24.1",
+ "babel-plugin-transform-object-rest-spread": "^6.23.0",
+ "babel-polyfill": "^6.23.0",
+ "babel-preset-env": "^1.5.2",
+ "babel-preset-flow": "^6.23.0",
+ "babel-register": "^6.24.1",
+ "cross-env": "^5.0.1",
+ "eslint": "^4.8.0",
+ "eslint-plugin-flowtype": "^2.30.4",
+ "eslint-plugin-import": "^2.2.0",
+ "flow-bin": "^0.59.0",
+ "flow-copy-source": "^1.1.0",
+ "husky": "^0.13.3",
+ "lint-staged": "^3.4.0",
+ "lodash": "^4.17.4",
+ "prettier": "^1.4.4",
+ "redux": "^3.6.0",
+ "redux-mock-store": "^1.2.3",
+ "rimraf": "^2.6.1",
+ "sinon": "^2.3.2"
+ },
+ "peerDependencies": {
+ "redux": ">3.0.0"
+ },
+ "dependencies": {}
+}
diff --git a/node_modules/redux-persist/src/constants.js b/node_modules/redux-persist/src/constants.js
new file mode 100644
index 0000000..009705f
--- /dev/null
+++ b/node_modules/redux-persist/src/constants.js
@@ -0,0 +1,10 @@
+// @flow
+
+export const KEY_PREFIX = 'persist:'
+export const FLUSH = 'persist/FLUSH'
+export const REHYDRATE = 'persist/REHYDRATE'
+export const PAUSE = 'persist/PAUSE'
+export const PERSIST = 'persist/PERSIST'
+export const PURGE = 'persist/PURGE'
+export const REGISTER = 'persist/REGISTER'
+export const DEFAULT_VERSION = -1
diff --git a/node_modules/redux-persist/src/createMigrate.js b/node_modules/redux-persist/src/createMigrate.js
new file mode 100644
index 0000000..5426c46
--- /dev/null
+++ b/node_modules/redux-persist/src/createMigrate.js
@@ -0,0 +1,58 @@
+// @flow
+
+import { DEFAULT_VERSION } from './constants'
+
+import type { PersistedState, MigrationManifest } from './types'
+
+export default function createMigrate(
+ migrations: MigrationManifest,
+ config?: { debug: boolean }
+) {
+ let { debug } = config || {}
+ return function(
+ state: PersistedState,
+ currentVersion: number
+ ): Promise {
+ if (!state) {
+ if (process.env.NODE_ENV !== 'production' && debug)
+ console.log('redux-persist: no inbound state, skipping migration')
+ return Promise.resolve(undefined)
+ }
+
+ let inboundVersion: number =
+ state._persist && state._persist.version !== undefined
+ ? state._persist.version
+ : DEFAULT_VERSION
+ if (inboundVersion === currentVersion) {
+ if (process.env.NODE_ENV !== 'production' && debug)
+ console.log('redux-persist: versions match, noop migration')
+ return Promise.resolve(state)
+ }
+ if (inboundVersion > currentVersion) {
+ if (process.env.NODE_ENV !== 'production')
+ console.error('redux-persist: downgrading version is not supported')
+ return Promise.resolve(state)
+ }
+
+ let migrationKeys = Object.keys(migrations)
+ .map(ver => parseInt(ver))
+ .filter(key => currentVersion >= key && key > inboundVersion)
+ .sort((a, b) => a - b)
+
+ if (process.env.NODE_ENV !== 'production' && debug)
+ console.log('redux-persist: migrationKeys', migrationKeys)
+ try {
+ let migratedState = migrationKeys.reduce((state, versionKey) => {
+ if (process.env.NODE_ENV !== 'production' && debug)
+ console.log(
+ 'redux-persist: running migration for versionKey',
+ versionKey
+ )
+ return migrations[versionKey](state)
+ }, state)
+ return Promise.resolve(migratedState)
+ } catch (err) {
+ return Promise.reject(err)
+ }
+ }
+}
diff --git a/node_modules/redux-persist/src/createPersistoid.js b/node_modules/redux-persist/src/createPersistoid.js
new file mode 100644
index 0000000..16dfe85
--- /dev/null
+++ b/node_modules/redux-persist/src/createPersistoid.js
@@ -0,0 +1,111 @@
+// @flow
+
+import { KEY_PREFIX, REHYDRATE } from './constants'
+
+import type { Persistoid, PersistConfig, Transform } from './types'
+
+export default function createPersistoid(config: PersistConfig): Persistoid {
+ // defaults
+ const blacklist: ?Array = config.blacklist || null
+ const whitelist: ?Array = config.whitelist || null
+ const transforms = config.transforms || []
+ const throttle = config.throttle || 0
+ const storageKey = `${config.keyPrefix !== undefined
+ ? config.keyPrefix
+ : KEY_PREFIX}${config.key}`
+ const storage = config.storage
+ const serialize = config.serialize === false ? x => x : defaultSerialize
+
+ // initialize stateful values
+ let lastState = {}
+ let stagedState = {}
+ let keysToProcess = []
+ let timeIterator: ?number = null
+ let writePromise = null
+
+ const update = (state: Object) => {
+ // add any changed keys to the queue
+ Object.keys(state).forEach(key => {
+ let subState = state[key]
+ if (!passWhitelistBlacklist(key)) return // is keyspace ignored? noop
+ if (lastState[key] === state[key]) return // value unchanged? noop
+ if (keysToProcess.indexOf(key) !== -1) return // is key already queued? noop
+ keysToProcess.push(key) // add key to queue
+ })
+
+ // start the time iterator if not running (read: throttle)
+ if (timeIterator === null) {
+ timeIterator = setInterval(processNextKey, throttle)
+ }
+
+ lastState = state
+ }
+
+ function processNextKey() {
+ if (keysToProcess.length === 0) {
+ if (timeIterator) clearInterval(timeIterator)
+ timeIterator = null
+ return
+ }
+
+ let key = keysToProcess.shift()
+ let endState = transforms.reduce((subState, transformer) => {
+ return transformer.in(subState, key)
+ }, lastState[key])
+ if (typeof endState !== 'undefined') stagedWrite(key, endState)
+ }
+
+ function stagedWrite(key: string, endState: any) {
+ try {
+ stagedState[key] = serialize(endState)
+ } catch (err) {
+ console.error(
+ 'redux-persist/createPersistoid: error serializing state',
+ err
+ )
+ }
+ if (keysToProcess.length === 0) {
+ // cleanup any removed keys just before write.
+ Object.keys(stagedState).forEach(key => {
+ if (lastState[key] === undefined) {
+ delete stagedState[key]
+ }
+ })
+
+ writePromise = storage
+ .setItem(storageKey, serialize(stagedState))
+ .catch(onWriteFail)
+ }
+ }
+
+ function passWhitelistBlacklist(key) {
+ if (whitelist && whitelist.indexOf(key) === -1 && key !== '_persist') return false
+ if (blacklist && blacklist.indexOf(key) !== -1) return false
+ return true
+ }
+
+ function onWriteFail(err) {
+ // @TODO add fail handlers (typically storage full)
+ if (err && process.env.NODE_ENV !== 'production') {
+ console.error('Error storing data', err)
+ }
+ }
+
+ const flush = () => {
+ while (keysToProcess.length !== 0) {
+ processNextKey()
+ }
+ return writePromise || Promise.resolve()
+ }
+
+ // return `persistoid`
+ return {
+ update,
+ flush,
+ }
+}
+
+// @NOTE in the future this may be exposed via config
+function defaultSerialize(data) {
+ return JSON.stringify(data)
+}
diff --git a/node_modules/redux-persist/src/createTransform.js b/node_modules/redux-persist/src/createTransform.js
new file mode 100644
index 0000000..3da5a15
--- /dev/null
+++ b/node_modules/redux-persist/src/createTransform.js
@@ -0,0 +1,30 @@
+// @flow
+
+type TransformConfig = {
+ whitelist?: Array,
+ blacklist?: Array,
+}
+
+export default function createTransform(
+ // @NOTE inbound: transform state coming from redux on its way to being serialized and stored
+ inbound: ?Function,
+ // @NOTE outbound: transform state coming from storage, on its way to be rehydrated into redux
+ outbound: ?Function,
+ config: TransformConfig = {}
+) {
+ let whitelist = config.whitelist || null
+ let blacklist = config.blacklist || null
+
+ function whitelistBlacklistCheck(key) {
+ if (whitelist && whitelist.indexOf(key) === -1) return true
+ if (blacklist && blacklist.indexOf(key) !== -1) return true
+ return false
+ }
+
+ return {
+ in: (state: Object, key: string) =>
+ !whitelistBlacklistCheck(key) && inbound ? inbound(state, key) : state,
+ out: (state: Object, key: string) =>
+ !whitelistBlacklistCheck(key) && outbound ? outbound(state, key) : state,
+ }
+}
diff --git a/node_modules/redux-persist/src/getStoredState.js b/node_modules/redux-persist/src/getStoredState.js
new file mode 100644
index 0000000..f98b348
--- /dev/null
+++ b/node_modules/redux-persist/src/getStoredState.js
@@ -0,0 +1,43 @@
+// @flow
+
+import type { PersistConfig } from './types'
+
+import { KEY_PREFIX } from './constants'
+
+export default function getStoredState(
+ config: PersistConfig
+): Promise {
+ const transforms = config.transforms || []
+ const storageKey = `${config.keyPrefix !== undefined
+ ? config.keyPrefix
+ : KEY_PREFIX}${config.key}`
+ const storage = config.storage
+ const debug = config.debug
+ const deserialize = config.serialize === false ? x => x : defaultDeserialize
+ return storage.getItem(storageKey).then(serialized => {
+ if (!serialized) return undefined
+ else {
+ try {
+ let state = {}
+ let rawState = deserialize(serialized)
+ Object.keys(rawState).forEach(key => {
+ state[key] = transforms.reduceRight((subState, transformer) => {
+ return transformer.out(subState, key)
+ }, deserialize(rawState[key]))
+ })
+ return state
+ } catch (err) {
+ if (process.env.NODE_ENV !== 'production' && debug)
+ console.log(
+ `redux-persist/getStoredState: Error restoring data ${serialized}`,
+ err
+ )
+ throw err
+ }
+ }
+ })
+}
+
+function defaultDeserialize(serial) {
+ return JSON.parse(serial)
+}
diff --git a/node_modules/redux-persist/src/index.d.ts b/node_modules/redux-persist/src/index.d.ts
new file mode 100644
index 0000000..633ad09
--- /dev/null
+++ b/node_modules/redux-persist/src/index.d.ts
@@ -0,0 +1,413 @@
+
+declare module "redux-persist" {
+ export * from "redux-persist/es/constants";
+ export * from "redux-persist/es/types";
+ export * from "redux-persist/es/createMigrate";
+ export * from "redux-persist/es/createPersistoid";
+ export * from "redux-persist/es/createTransform";
+ export * from "redux-persist/es/createWebStorage";
+ export * from "redux-persist/es/getStoredState";
+ export * from "redux-persist/es/persistCombineReducers";
+ export * from "redux-persist/es/persistReducer";
+ export * from "redux-persist/es/persistStore";
+ export * from "redux-persist/es/purgeStoredState";
+}
+
+declare module "redux-persist/lib/constants" {
+ export * from "redux-persist/es/constants";
+}
+
+declare module "redux-persist/lib/types" {
+ export * from "redux-persist/es/types";
+}
+
+declare module "redux-persist/lib/createMigrate" {
+ export * from "redux-persist/es/createMigrate";
+}
+
+declare module "redux-persist/lib/createPersistoid" {
+ export * from "redux-persist/es/createPersistoid";
+}
+
+declare module "redux-persist/lib/createTransform" {
+ export * from "redux-persist/es/createTransform";
+}
+
+declare module "redux-persist/lib/createWebStorage" {
+ export * from "redux-persist/es/createWebStorage";
+}
+
+declare module "redux-persist/lib/getStoredState" {
+ export * from "redux-persist/es/getStoredState";
+}
+
+declare module "redux-persist/lib/persistCombineReducers" {
+ export * from "redux-persist/es/persistCombineReducers";
+}
+
+declare module "redux-persist/lib/persistReducer" {
+ export * from "redux-persist/es/persistReducer";
+}
+
+declare module "redux-persist/lib/persistStore" {
+ export * from "redux-persist/es/persistStore";
+}
+
+declare module "redux-persist/lib/purgeStoredState" {
+ export * from "redux-persist/es/purgeStoredState";
+}
+
+declare module "redux-persist/es/constants" {
+ /* constants */
+ export const DEFAULT_VERSION: number;
+ export const KEY_PREFIX: "persist:";
+ export const FLUSH: "persist/FLUSH";
+ export const REHYDRATE: "persist/REHYDRATE";
+ export const PAUSE: "persist/PAUSE";
+ export const PERSIST: "persist/PERSIST";
+ export const PURGE: "persist/PURGE";
+ export const REGISTER: "persist/REGISTER";
+}
+
+declare module "redux-persist/es/types" {
+ import { StoreEnhancer } from "redux";
+ import { Transform } from "redux-persist/es/createTransform"
+ /* types */
+ export interface PersistState { version: number; rehydrated: boolean; }
+ export type PersistedState = { _persist: PersistState } | void;
+
+ export interface PersistConfig {
+ version?: number;
+ storage: WebStorage | AsyncStorage | LocalForageStorage | Storage;
+ key: string;
+ /**
+ * **Depricated:** keyPrefix is going to be removed in v6.
+ */
+ keyPrefix?: string;
+ blacklist?: Array;
+ whitelist?: Array;
+ transforms?: Array>;
+ throttle?: number;
+ migrate?: (state: PersistedState, versionKey: number) => Promise;
+ stateReconciler?: false | Function;
+ /**
+ * Used for migrations.
+ */
+ getStoredState?: (config: PersistConfig) => Promise;
+ debug?: boolean;
+ serialize?: boolean;
+ }
+ export interface PersistorOptions { enhancer?: StoreEnhancer }
+ export interface MigrationManifest {
+ [key: string]: (state: PersistedState) => PersistedState;
+ }
+ export type RehydrateErrorType = any;
+ export type RehydrateAction = {
+ type: "redux-persist/es/REHYDRATE",
+ key: string,
+ payload?: Payload,
+ err?: RehydrateErrorType,
+ }
+ export interface Persistoid {
+ update(item: any): void;
+ flush(): Promise;
+ }
+ export type RegisterAction = {
+ type: "redux-persist/es/REGISTER",
+ key: string,
+ }
+ export type PersistorAction = RehydrateAction | RegisterAction
+ export interface PersistorState {
+ registry: Array;
+ bootstrapped: boolean;
+ }
+ export type PersistorSubscribeCallback = () => any
+ /**
+ * A persistor is a redux store unto itself, allowing you to purge stored state, flush all
+ * pending state serialization and immediately write to disk
+ */
+ export interface Persistor {
+ purge(): Promise;
+ flush(): Promise;
+ dispatch(action: PersistorAction): PersistorAction;
+ getState(): PersistorState;
+ subscribe(callback: PersistorSubscribeCallback): () => any;
+ }
+ /* storage types */
+ export interface WebStorage {
+ /**
+ * Fetches key and returns item in a promise.
+ */
+ getItem(key: string): Promise;
+ /**
+ * Sets value for key and returns item in a promise.
+ */
+ setItem(key: string, item: string): Promise;
+ /**
+ * Removes value for key.
+ */
+ removeItem(key: string): Promise;
+ }
+ /**
+ * User for local storage in react-native.
+ *
+ * AsyncStorage is a simple, unencrypted, asynchronous, persistent, key-value storage
+ * system that is global to the app. It should be used instead of LocalStorage.
+ *
+ * It is recommended that you use an abstraction on top of `AsyncStorage`
+ * instead of `AsyncStorage` directly for anything more than light usage since
+ * it operates globally.
+ *
+ * On iOS, `AsyncStorage` is backed by native code that stores small values in a
+ * serialized dictionary and larger values in separate files. On Android,
+ * `AsyncStorage` will use either [RocksDB](http://rocksdb.org/) or SQLite
+ * based on what is available.
+ *
+ * The definition obtained from
+ * @see https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/react-native/index.d.ts
+ */
+ export interface AsyncStorage {
+ /**
+ * Fetches key and passes the result to callback, along with an Error if there is any.
+ */
+ getItem(key: string, callback?: (error?: Error, result?: string) => void): Promise;
+ /**
+ * Sets value for key and calls callback on completion, along with an Error if there is any.
+ */
+ setItem(key: string, value: string, callback?: (error?: Error) => void): Promise;
+ /**
+ * Removes value for key and calls callback on completion, along with an Error if there is any.
+ */
+ removeItem(key: string, callback?: (error?: Error) => void): Promise;
+ /**
+ * Merges existing value with input value, assuming they are stringified json. Returns a Promise object.
+ * Not supported by all native implementation
+ */
+ mergeItem(key: string, value: string, callback?: (error?: Error) => void): Promise;
+ /**
+ * Erases all AsyncStorage for all clients, libraries, etc. You probably don't want to call this.
+ * Use removeItem or multiRemove to clear only your own keys instead.
+ */
+ clear(callback?: (error?: Error) => void): Promise;
+ /**
+ * Gets all keys known to the app, for all callers, libraries, etc
+ */
+ getAllKeys(callback?: (error?: Error, keys?: string[]) => void): Promise;
+ /**
+ * multiGet invokes callback with an array of key-value pair arrays that matches the input format of multiSet
+ */
+ multiGet(keys: string[], callback?: (errors?: Error[], result?: [string, string][]) => void): Promise<[string, string][]>;
+ /**
+ * multiSet and multiMerge take arrays of key-value array pairs that match the output of multiGet,
+ *
+ * multiSet([['k1', 'val1'], ['k2', 'val2']], cb);
+ */
+ multiSet(keyValuePairs: string[][], callback?: (errors?: Error[]) => void): Promise;
+ /**
+ * Delete all the keys in the keys array.
+ */
+ multiRemove(keys: string[], callback?: (errors?: Error[]) => void): Promise;
+ /**
+ * Merges existing values with input values, assuming they are stringified json.
+ * Returns a Promise object.
+ *
+ * Not supported by all native implementations.
+ */
+ multiMerge(keyValuePairs: string[][], callback?: (errors?: Error[]) => void): Promise;
+ }
+ /**
+ * LocalForage: Offline storage, improved. Wraps IndexedDB, WebSQL or localStorage using a simple
+ * but powerful API.
+ *
+ * The type definition was obtained from:
+ * @see https://github.com/localForage/localForage/blob/master/typings/localforage.d.ts
+ */
+ export interface LocalForageStorage {
+ getItem(key: string, callback?: (err: any, value: T) => void): Promise;
+ setItem(key: string, value: T, callback?: (err: any, value: T) => void): Promise;
+ removeItem(key: string, callback?: (err: any) => void): Promise;
+ clear(callback?: (err: any) => void): Promise;
+ length(callback?: (err: any, numberOfKeys: number) => void): Promise;
+ key(keyIndex: number, callback?: (err: any, key: string) => void): Promise;
+ keys(callback?: (err: any, keys: string[]) => void): Promise;
+ iterate(iteratee: (value: T, key: string, iterationNumber: number) => U, callback?: (err: any, result: U) => void): Promise;
+ }
+ export interface Storage {
+ getItem(key: string, ...args: any[]): any;
+ setItem(key: string, value: any, ...args: any[]): any;
+ remoteItem(key: string, ...args: any[]): any;
+ }
+}
+
+declare module "redux-persist/es/createMigrate" {
+ import { PersistedState, MigrationManifest } from "redux-persist/es/types";
+ // createMigrate
+ /**
+ * Migration configutation
+ */
+ export interface MigrationConfig { debug: boolean; }
+ export type MigrationDispatch = (state: PersistedState, currentVersion: number) => Promise;
+ /**
+ * Creates a migration path for your app's state.
+ * @param migrations migration manifest
+ * @param config migration configuration (basically, indicates if you are running in debug mode or not)
+ */
+ export function createMigrate(migrations: MigrationManifest, config?: MigrationConfig): MigrationDispatch;
+}
+
+declare module "redux-persist/es/createPersistoid" {
+ import { PersistConfig, Persistoid } from "redux-persist/es/types";
+ // createPersistoid
+ export function createPersistoid(config: PersistConfig): Persistoid;
+}
+
+declare module "redux-persist/es/createTransform" {
+ import { PersistConfig } from "redux-persist/es/types";
+
+ export type TransformIn = (state: S, key: string) => R;
+ export type TransformOut = (raw: R, key: string) => S;
+
+ export interface Transform {
+ in: TransformIn;
+ out: TransformOut;
+ config?: PersistConfig;
+ }
+
+ export function createTransform(
+ inbound: TransformIn,
+ outbound: TransformOut,
+ config?: Pick
+ ): Transform;
+}
+
+declare module "redux-persist/es/createWebStorage" {
+ import { WebStorage } from "redux-persist/es/types";
+ export function createWebStorage(type: string): WebStorage;
+}
+
+declare module "redux-persist/es/getStoredState" {
+ import { PersistConfig } from "redux-persist/es/types";
+ export function getStoredState(config: PersistConfig): Promise;
+}
+
+declare module "redux-persist/es/persistCombineReducers" {
+ import { Reducer, ReducersMapObject } from "redux";
+ import { PersistConfig, PersistedState } from "redux-persist/es/types";
+ /**
+ * It provides a way of combining the reducers, replacing redux's @see combineReducers
+ * @param config persistence configuration
+ * @param reducers set of keyed functions mapping to the application state
+ * @returns reducer
+ */
+ export function persistCombineReducers(config: PersistConfig, reducers: ReducersMapObject): Reducer;
+}
+
+declare module "redux-persist/es/persistReducer" {
+ import { PersistState, PersistConfig } from "redux-persist/es/types";
+ // persistReducer
+ export interface PersistPartial { _persist: PersistState }
+ export type BaseReducer = (state: S | void, action: A) => S;
+ /**
+ * It provides a way of combining the reducers, replacing redux's @see combineReducers
+ * @param config persistence configuration
+ * @param baseReducer reducer used to persist the state
+ */
+ export function persistReducer(config: PersistConfig, baseReducer: BaseReducer): (s: S, a: A) => S & PersistPartial;
+}
+declare module "redux-persist/es/persistStore" {
+ import { PersistorOptions, Persistor } from "redux-persist/es/types";
+ // persistStore
+ export type BoostrappedCallback = () => any;
+ /**
+ * Creates a persistor for a given store.
+ * @param store store to be persisted (or match an existent storage)
+ * @param persistorOptions enhancers of the persistor
+ * @param callback bootstrap callback of sort.
+ */
+ export function persistStore(store: any, persistorOptions?: PersistorOptions, callback?: BoostrappedCallback): Persistor;
+}
+
+declare module "redux-persist/es/purgeStoredState" {
+ import { PersistConfig } from "redux-persist/es/types";
+ /**
+ * Removes stored state.
+ * @param config persist configuration
+ */
+ export function purgeStoredState(config: PersistConfig): any;
+}
+
+declare module "redux-persist/es/integration/react" {
+ import { ReactNode, PureComponent } from "react";
+ import { Persistor, WebStorage } from "redux-persist";
+
+ /**
+ * Properties of @see PersistGate
+ */
+ export interface PersistGateProps {
+ persistor: Persistor;
+ onBeforeLift?: Function;
+ children?: ReactNode;
+ loading?: ReactNode;
+ }
+ /**
+ * State of @see PersistGate
+ */
+ export interface PersistorGateState { bootstrapped: boolean; }
+ /**
+ * Entry point of your react application to allow it persist a given store @see Persistor and its configuration.
+ * @see Persistor
+ * @see PersistGateProps
+ * @see PersistGateState
+ */
+ export class PersistGate extends React.PureComponent { }
+}
+
+declare module "redux-persist/es/integration/getStoredStateMigrateV4" {
+ import { PersistConfig, Transform } from "redux-persist";
+
+ export interface V4Config {
+ storage?: any;
+ keyPrefix?: string;
+ transforms?: Array>;
+ blacklist?: string[];
+ whitelist?: string[];
+ }
+
+ export function getStoredState(v4Config: V4Config): (config: PersistConfig) => Promise;
+}
+
+declare module "redux-persist/es/stateReconciler/autoMergeLevel1" {
+ import { PersistConfig } from "redux-persist";
+ export function autoMergeLevel1(inboundState: S, originalState: S, reducedState: S, { debug }: PersistConfig): S;
+}
+
+declare module "redux-persist/es/stateReconciler/autoMergeLevel2" {
+ import { PersistConfig } from "redux-persist";
+ export function autoMergeLevel2(inboundState: S, originalState: S, reducedState: S, { debug }: PersistConfig): S;
+}
+
+declare module "redux-persist/es/stateReconciler/hardSet" {
+ export function hardSet(inboundState: S): S;
+}
+
+declare module "redux-persist/es/storage" {
+ import { WebStorage } from "redux-persist";
+ export let storage: WebStorage;
+ export default storage;
+}
+
+declare module "redux-persist/es/getStorage" {
+ import { Storage } from "redux-persist";
+ export function getStorage(type: string): Storage;
+}
+
+declare module "redux-persist/es/createWebStorage" {
+ import { WebStorage } from "redux-persist";
+ export function createWebStorage(type: string): WebStorage;
+}
+
+declare module "redux-persist/es/storage/session" {
+ import { WebStorage } from "redux-persist";
+ let sessionStorage: WebStorage;
+ export default sessionStorage;
+}
diff --git a/node_modules/redux-persist/src/index.js b/node_modules/redux-persist/src/index.js
new file mode 100644
index 0000000..0d9c048
--- /dev/null
+++ b/node_modules/redux-persist/src/index.js
@@ -0,0 +1,12 @@
+// @flow
+
+export { default as persistReducer } from './persistReducer'
+export { default as persistCombineReducers } from './persistCombineReducers'
+export { default as persistStore } from './persistStore'
+export { default as createMigrate } from './createMigrate'
+export { default as createTransform } from './createTransform'
+export { default as getStoredState } from './getStoredState'
+export { default as createPersistoid } from './createPersistoid'
+export { default as purgeStoredState } from './purgeStoredState'
+
+export * from './constants'
diff --git a/node_modules/redux-persist/src/integration/getStoredStateMigrateV4.js b/node_modules/redux-persist/src/integration/getStoredStateMigrateV4.js
new file mode 100644
index 0000000..03ea063
--- /dev/null
+++ b/node_modules/redux-persist/src/integration/getStoredStateMigrateV4.js
@@ -0,0 +1,183 @@
+// @flow
+
+import getStoredStateV5 from '../getStoredState'
+
+import type { PersistConfig, Transform } from '../types'
+
+type V4Config = {
+ storage?: Object,
+ keyPrefix?: string,
+ transforms?: Array,
+ blacklist?: Array,
+ whitelist?: Array,
+}
+
+export default function getStoredState(v4Config: V4Config) {
+ return function(v5Config: PersistConfig) {
+ return getStoredStateV5(v5Config).then(state => {
+ if (state) return state
+ else return getStoredStateV4(v4Config)
+ })
+ }
+}
+
+const KEY_PREFIX = 'reduxPersist:'
+
+function hasLocalStorage() {
+ if (typeof window !== 'object' || !('localStorage' in window)) {
+ return false
+ }
+
+ try {
+ let storage = window.localStorage
+ const testKey = `redux-persist localStorage test`
+ storage.setItem(testKey, 'test')
+ storage.getItem(testKey)
+ storage.removeItem(testKey)
+ } catch (e) {
+ if (process.env.NODE_ENV !== 'production')
+ console.warn(
+ `redux-persist localStorage test failed, persistence will be disabled.`
+ )
+ return false
+ }
+ return true
+}
+
+let noop = (...args: any) => {
+ /* noop */ return null
+}
+const noStorage = {
+ getItem: noop,
+ setItem: noop,
+ removeItem: noop,
+ getAllKeys: noop,
+}
+const createAsyncLocalStorage = () => {
+ if (!hasLocalStorage()) return noStorage
+ let localStorage = window.localStorage
+ return {
+ getAllKeys: function(cb) {
+ try {
+ var keys = []
+ for (var i = 0; i < localStorage.length; i++) {
+ keys.push(localStorage.key(i))
+ }
+ cb(null, keys)
+ } catch (e) {
+ cb(e)
+ }
+ },
+ getItem(key, cb) {
+ try {
+ var s = localStorage.getItem(key)
+ cb(null, s)
+ } catch (e) {
+ cb(e)
+ }
+ },
+ setItem(key, string, cb) {
+ try {
+ localStorage.setItem(key, string)
+ cb(null)
+ } catch (e) {
+ cb(e)
+ }
+ },
+ removeItem(key, cb) {
+ try {
+ localStorage.removeItem(key)
+ cb && cb(null)
+ } catch (e) {
+ cb(e)
+ }
+ },
+ }
+}
+
+function getStoredStateV4(v4Config: V4Config) {
+ return new Promise((resolve, reject) => {
+ let storage = v4Config.storage || createAsyncLocalStorage()
+ const deserializer =
+ v4Config.serialize === false
+ ? data => data
+ : (serial: string) => JSON.parse(serial)
+ const blacklist = v4Config.blacklist || []
+ const whitelist = v4Config.whitelist || false
+ const transforms = v4Config.transforms || []
+ const keyPrefix =
+ v4Config.keyPrefix !== undefined ? v4Config.keyPrefix : KEY_PREFIX
+
+ // fallback getAllKeys to `keys` if present (LocalForage compatability)
+ if (storage.keys && !storage.getAllKeys)
+ storage = { ...storage, getAllKeys: storage.keys }
+
+ let restoredState = {}
+ let completionCount = 0
+
+ storage.getAllKeys((err, allKeys = []) => {
+ if (err) {
+ if (process.env.NODE_ENV !== 'production')
+ console.warn(
+ 'redux-persist/getStoredState: Error in storage.getAllKeys'
+ )
+ return reject(err)
+ }
+
+ let persistKeys = allKeys
+ .filter(key => key.indexOf(keyPrefix) === 0)
+ .map(key => key.slice(keyPrefix.length))
+ let keysToRestore = persistKeys.filter(passWhitelistBlacklist)
+
+ let restoreCount = keysToRestore.length
+ if (restoreCount === 0) resolve(undefined)
+ keysToRestore.forEach(key => {
+ storage.getItem(createStorageKey(key), (err, serialized) => {
+ if (err && process.env.NODE_ENV !== 'production')
+ console.warn(
+ 'redux-persist/getStoredState: Error restoring data for key:',
+ key,
+ err
+ )
+ else restoredState[key] = rehydrate(key, serialized)
+ completionCount += 1
+ if (completionCount === restoreCount) resolve(restoredState)
+ })
+ })
+ })
+
+ function rehydrate(key: string, serialized: ?string) {
+ let state = null
+
+ try {
+ let data = serialized ? deserializer(serialized) : undefined
+ state = transforms.reduceRight((subState, transformer) => {
+ return transformer.out(subState, key)
+ }, data)
+ } catch (err) {
+ if (process.env.NODE_ENV !== 'production')
+ console.warn(
+ 'redux-persist/getStoredState: Error restoring data for key:',
+ key,
+ err
+ )
+ }
+
+ return state
+ }
+
+ function passWhitelistBlacklist(key) {
+ if (whitelist && whitelist.indexOf(key) === -1) return false
+ if (blacklist.indexOf(key) !== -1) return false
+ return true
+ }
+
+ function createStorageKey(key) {
+ return `${keyPrefix}${key}`
+ }
+ })
+}
+
+function defaultDeserializer(serial: string) {
+ return JSON.parse(serial)
+}
diff --git a/node_modules/redux-persist/src/integration/react.js b/node_modules/redux-persist/src/integration/react.js
new file mode 100644
index 0000000..6a34894
--- /dev/null
+++ b/node_modules/redux-persist/src/integration/react.js
@@ -0,0 +1,56 @@
+// @flow
+import React, { PureComponent } from 'react' // eslint-disable-line import/no-unresolved
+import type { Node } from 'react' // eslint-disable-line import/no-unresolved
+import type { Persistor } from '../types'
+
+type Props = {
+ onBeforeLift?: Function,
+ children?: Node,
+ loading?: Node,
+ persistor: Persistor,
+}
+
+type State = {
+ bootstrapped: boolean,
+}
+
+export class PersistGate extends PureComponent {
+ static defaultProps = {
+ loading: null,
+ }
+
+ state = {
+ bootstrapped: false,
+ }
+ _unsubscribe: ?Function
+
+ componentDidMount() {
+ this._unsubscribe = this.props.persistor.subscribe(
+ this.handlePersistorState
+ )
+ this.handlePersistorState()
+ }
+
+ handlePersistorState = () => {
+ const { persistor } = this.props
+ let { bootstrapped } = persistor.getState()
+ if (bootstrapped) {
+ if (this.props.onBeforeLift) {
+ Promise.resolve(this.props.onBeforeLift())
+ .then(() => this.setState({ bootstrapped: true }))
+ .catch(() => this.setState({ bootstrapped: true }))
+ } else {
+ this.setState({ bootstrapped: true })
+ }
+ this._unsubscribe && this._unsubscribe()
+ }
+ }
+
+ componentWillUnmount() {
+ this._unsubscribe && this._unsubscribe()
+ }
+
+ render() {
+ return this.state.bootstrapped ? this.props.children : this.props.loading
+ }
+}
diff --git a/node_modules/redux-persist/src/persistCombineReducers.js b/node_modules/redux-persist/src/persistCombineReducers.js
new file mode 100644
index 0000000..3db95ea
--- /dev/null
+++ b/node_modules/redux-persist/src/persistCombineReducers.js
@@ -0,0 +1,22 @@
+// @flow
+
+import { combineReducers } from 'redux'
+import persistReducer from './persistReducer'
+import autoMergeLevel2 from './stateReconciler/autoMergeLevel2'
+
+import type { PersistConfig } from './types'
+
+type Reducers = {
+ [key: string]: Function,
+}
+
+type Reducer = (state: Object, action: Object) => Object
+
+// combineReducers + persistReducer with stateReconciler defaulted to autoMergeLevel2
+export default function persistCombineReducers(
+ config: PersistConfig,
+ reducers: Reducers
+): Reducer {
+ config.stateReconciler = config.stateReconciler === undefined ? autoMergeLevel2 : config.stateReconciler
+ return persistReducer(config, combineReducers(reducers))
+}
diff --git a/node_modules/redux-persist/src/persistReducer.js b/node_modules/redux-persist/src/persistReducer.js
new file mode 100644
index 0000000..681a80f
--- /dev/null
+++ b/node_modules/redux-persist/src/persistReducer.js
@@ -0,0 +1,155 @@
+// @flow
+import {
+ FLUSH,
+ PAUSE,
+ PERSIST,
+ PURGE,
+ REHYDRATE,
+ DEFAULT_VERSION,
+} from './constants'
+
+import type {
+ PersistConfig,
+ MigrationManifest,
+ PersistState,
+ Persistoid,
+} from './types'
+
+import autoMergeLevel1 from './stateReconciler/autoMergeLevel1'
+import createPersistoid from './createPersistoid'
+import defaultGetStoredState from './getStoredState'
+import purgeStoredState from './purgeStoredState'
+
+type PersistPartial = { _persist: PersistState }
+/*
+ @TODO add validation / handling for:
+ - persisting a reducer which has nested _persist
+ - handling actions that fire before reydrate is called
+*/
+export default function persistReducer(
+ config: PersistConfig,
+ baseReducer: (State | void, Action) => State
+): (State, Action) => State & PersistPartial {
+ if (process.env.NODE_ENV !== 'production') {
+ if (!config) throw new Error('config is required for persistReducer')
+ if (!config.key) throw new Error('key is required in persistor config')
+ if (!config.storage)
+ throw new Error(
+ "redux-persist: config.storage is required. Try using one of the provided storage engines `import storageLocal from 'redux-persist/es/storage/local'"
+ )
+ }
+
+ const version =
+ config.version !== undefined ? config.version : DEFAULT_VERSION
+ const debug = config.debug || false
+ const stateReconciler =
+ config.stateReconciler === undefined
+ ? autoMergeLevel1
+ : config.stateReconciler
+ const getStoredState = config.getStoredState || defaultGetStoredState
+ let _persistoid = null
+ let _purge = false
+ let _paused = true
+
+ return (state: State, action: Action) => {
+ let { _persist, ...rest } = state || {}
+ let restState: State = rest
+
+ if (action.type === PERSIST) {
+ // @NOTE PERSIST resumes if paused.
+ _paused = false
+
+ // @NOTE only ever create persistoid once, ensure we call it at least once, even if _persist has already been set
+ if (!_persistoid) _persistoid = createPersistoid(config)
+
+ // @NOTE PERSIST can be called multiple times, noop after the first
+ if (_persist) return state
+ if (
+ typeof action.rehydrate !== 'function' ||
+ typeof action.register !== 'function'
+ )
+ throw new Error(
+ 'redux-persist: either rehydrate or register is not a function on the PERSIST action. This can happen if the action is being replayed. This is an unexplored use case, please open an issue and we will figure out a resolution.'
+ )
+
+ action.register(config.key)
+
+ getStoredState(config).then(
+ restoredState => {
+ const migrate = config.migrate || ((s, v) => Promise.resolve(s))
+ migrate(restoredState, version).then(
+ migratedState => {
+ action.rehydrate(config.key, migratedState)
+ },
+ migrateErr => {
+ if (process.env.NODE_ENV !== 'production' && migrateErr)
+ console.error('redux-persist: migration error', migrateErr)
+ action.rehydrate(config.key, undefined, migrateErr)
+ }
+ )
+ },
+ err => {
+ action.rehydrate(config.key, undefined, err)
+ }
+ )
+
+ return {
+ ...baseReducer(restState, action),
+ _persist: { version, rehydrated: false },
+ }
+ } else if (action.type === PURGE) {
+ _purge = true
+ action.result(purgeStoredState(config))
+ return {
+ ...baseReducer(restState, action),
+ _persist,
+ }
+ } else if (action.type === FLUSH) {
+ action.result(_persistoid && _persistoid.flush())
+ return {
+ ...baseReducer(restState, action),
+ _persist,
+ }
+ } else if (action.type === PAUSE) {
+ _paused = true
+ } else if (action.type === REHYDRATE) {
+ // noop on restState if purging
+ if (_purge)
+ return {
+ ...restState,
+ _persist: { ..._persist, rehydrated: true },
+ }
+
+ // @NOTE if key does not match, will continue to default else below
+ if (action.key === config.key) {
+ let reducedState = baseReducer(restState, action)
+ let inboundState = action.payload
+ let reconciledRest: State =
+ stateReconciler !== false
+ ? stateReconciler(inboundState, state, reducedState, config)
+ : reducedState
+
+ return {
+ ...reconciledRest,
+ _persist: { ..._persist, rehydrated: true },
+ }
+ }
+ }
+
+ // if we have not already handled PERSIST, straight passthrough
+ if (!_persist) return baseReducer(state, action)
+
+ // otherwise, pull off _persist, run the reducer, and update the persistoid
+ // @TODO more performant workaround for combineReducers warning
+ let newState = {
+ ...baseReducer(restState, action),
+ _persist,
+ }
+ // update the persistoid only if we are already rehydrated and are not paused
+ _persist.rehydrated &&
+ _persistoid &&
+ !_paused &&
+ _persistoid.update(newState)
+ return newState
+ }
+}
diff --git a/node_modules/redux-persist/src/persistStore.js b/node_modules/redux-persist/src/persistStore.js
new file mode 100644
index 0000000..7118baf
--- /dev/null
+++ b/node_modules/redux-persist/src/persistStore.js
@@ -0,0 +1,125 @@
+// @flow
+
+import type {
+ Persistor,
+ PersistConfig,
+ PersistorOptions,
+ MigrationManifest,
+ RehydrateAction,
+ RehydrateErrorType,
+} from './types'
+
+import { createStore } from 'redux'
+import persistReducer from './persistReducer'
+import { FLUSH, PAUSE, PERSIST, PURGE, REGISTER, REHYDRATE } from './constants'
+
+type PendingRehydrate = [Object, RehydrateErrorType, PersistConfig]
+type Persist = (PersistConfig, MigrationManifest) => R => R
+type CreatePersistor = Object => void
+type BoostrappedCb = () => any
+
+const initialState = {
+ registry: [],
+ bootstrapped: false,
+}
+
+const persistorReducer = (state = initialState, action) => {
+ switch (action.type) {
+ case REGISTER:
+ return { ...state, registry: [...state.registry, action.key] }
+ case REHYDRATE:
+ let firstIndex = state.registry.indexOf(action.key)
+ let registry = [...state.registry]
+ registry.splice(firstIndex, 1)
+ return { ...state, registry, bootstrapped: registry.length === 0 }
+ default:
+ return state
+ }
+}
+
+export default function persistStore(
+ store: Object,
+ persistorOptions?: PersistorOptions,
+ cb?: BoostrappedCb
+): Persistor {
+ let options: Object = persistorOptions || {}
+
+ // help catch incorrect usage of passing PersistConfig in as PersistorOptions
+ if (process.env.NODE_ENV !== 'production') {
+ let bannedKeys = [
+ 'blacklist',
+ 'whitelist',
+ 'transforms',
+ 'storage',
+ 'keyPrefix',
+ 'migrate',
+ ]
+ bannedKeys.forEach(k => {
+ if (!!options[k])
+ console.error(
+ `redux-persist: invalid option passed to persistStore: "${k}". You may be incorrectly passing persistConfig into persistStore, whereas it should be passed into persistReducer.`
+ )
+ })
+ }
+ let boostrappedCb = cb || false
+ let persistor = createStore(persistorReducer, undefined, options.enhancer)
+
+ persistor.purge = () => {
+ let results = []
+ store.dispatch({
+ type: PURGE,
+ result: purgeResult => {
+ results.push(purgeResult)
+ },
+ })
+ return Promise.all(results)
+ }
+
+ persistor.flush = () => {
+ let results = []
+ store.dispatch({
+ type: FLUSH,
+ result: flushResult => {
+ results.push(flushResult)
+ },
+ })
+ return Promise.all(results)
+ }
+
+ persistor.pause = () => {
+ store.dispatch({
+ type: PAUSE,
+ })
+ }
+
+ let register = (key: string) => {
+ persistor.dispatch({
+ type: REGISTER,
+ key,
+ })
+ }
+
+ let rehydrate = (key: string, payload: Object, err: any) => {
+ let rehydrateAction = {
+ type: REHYDRATE,
+ payload,
+ err,
+ key,
+ }
+ // dispatch to `store` to rehydrate and `persistor` to track result
+ store.dispatch(rehydrateAction)
+ persistor.dispatch(rehydrateAction)
+ if (boostrappedCb && persistor.getState().bootstrapped) {
+ boostrappedCb()
+ boostrappedCb = false
+ }
+ }
+
+ persistor.persist = () => {
+ store.dispatch({ type: PERSIST, register, rehydrate })
+ }
+
+ persistor.persist()
+
+ return persistor
+}
diff --git a/node_modules/redux-persist/src/purgeStoredState.js b/node_modules/redux-persist/src/purgeStoredState.js
new file mode 100644
index 0000000..c780f88
--- /dev/null
+++ b/node_modules/redux-persist/src/purgeStoredState.js
@@ -0,0 +1,22 @@
+// @flow
+
+import type { PersistConfig } from './types'
+
+import { KEY_PREFIX } from './constants'
+
+export default function purgeStoredState(config: PersistConfig) {
+ const storage = config.storage
+ const storageKey = `${config.keyPrefix !== undefined
+ ? config.keyPrefix
+ : KEY_PREFIX}${config.key}`
+ return storage.removeItem(storageKey, warnIfRemoveError)
+}
+
+function warnIfRemoveError(err) {
+ if (err && process.env.NODE_ENV !== 'production') {
+ console.error(
+ 'redux-persist/purgeStoredState: Error purging data stored state',
+ err
+ )
+ }
+}
diff --git a/node_modules/redux-persist/src/stateReconciler/autoMergeLevel1.js b/node_modules/redux-persist/src/stateReconciler/autoMergeLevel1.js
new file mode 100644
index 0000000..880f28a
--- /dev/null
+++ b/node_modules/redux-persist/src/stateReconciler/autoMergeLevel1.js
@@ -0,0 +1,50 @@
+// @flow
+
+/*
+ autoMergeLevel1:
+ - merges 1 level of substate
+ - skips substate if already modified
+*/
+
+import type { PersistConfig } from '../types'
+
+export default function autoMergeLevel1(
+ inboundState: State,
+ originalState: State,
+ reducedState: State,
+ { debug }: PersistConfig
+): State {
+ let newState = { ...reducedState }
+ // only rehydrate if inboundState exists and is an object
+ if (inboundState && typeof inboundState === 'object') {
+ Object.keys(inboundState).forEach(key => {
+ // ignore _persist data
+ if (key === '_persist') return
+ // if reducer modifies substate, skip auto rehydration
+ if (originalState[key] !== reducedState[key]) {
+ if (process.env.NODE_ENV !== 'production' && debug)
+ console.log(
+ 'redux-persist/stateReconciler: sub state for key `%s` modified, skipping.',
+ key
+ )
+ return
+ }
+ // otherwise hard set the new value
+ newState[key] = inboundState[key]
+ })
+ }
+
+ if (
+ process.env.NODE_ENV !== 'production' &&
+ debug &&
+ inboundState &&
+ typeof inboundState === 'object'
+ )
+ console.log(
+ `redux-persist/stateReconciler: rehydrated keys '${Object.keys(
+ inboundState
+ ).join(', ')}'`
+ )
+
+ return newState
+}
diff --git a/node_modules/redux-persist/src/stateReconciler/autoMergeLevel2.js b/node_modules/redux-persist/src/stateReconciler/autoMergeLevel2.js
new file mode 100644
index 0000000..f451380
--- /dev/null
+++ b/node_modules/redux-persist/src/stateReconciler/autoMergeLevel2.js
@@ -0,0 +1,60 @@
+// @flow
+
+/*
+ autoMergeLevel2:
+ - merges 2 level of substate
+ - skips substate if already modified
+ - this is essentially redux-perist v4 behavior
+*/
+
+import type { PersistConfig } from '../types'
+
+export default function autoMergeLevel2(
+ inboundState: State,
+ originalState: State,
+ reducedState: State,
+ { debug }: PersistConfig
+): State {
+ let newState = { ...reducedState }
+ // only rehydrate if inboundState exists and is an object
+ if (inboundState && typeof inboundState === 'object') {
+ Object.keys(inboundState).forEach(key => {
+ // ignore _persist data
+ if (key === '_persist') return
+ // if reducer modifies substate, skip auto rehydration
+ if (originalState[key] !== reducedState[key]) {
+ if (process.env.NODE_ENV !== 'production' && debug)
+ console.log(
+ 'redux-persist/stateReconciler: sub state for key `%s` modified, skipping.',
+ key
+ )
+ return
+ }
+ if (isPlainEnoughObject(reducedState[key])) {
+ // if object is plain enough shallow merge the new values (hence "Level2")
+ newState[key] = { ...newState[key], ...inboundState[key] }
+ return
+ }
+ // otherwise hard set
+ newState[key] = inboundState[key]
+ })
+ }
+
+ if (
+ process.env.NODE_ENV !== 'production' &&
+ debug &&
+ inboundState &&
+ typeof inboundState === 'object'
+ )
+ console.log(
+ `redux-persist/stateReconciler: rehydrated keys '${Object.keys(
+ inboundState
+ ).join(', ')}'`
+ )
+
+ return newState
+}
+
+function isPlainEnoughObject(o) {
+ return o !== null && !Array.isArray(o) && typeof o === 'object'
+}
diff --git a/node_modules/redux-persist/src/stateReconciler/hardSet.js b/node_modules/redux-persist/src/stateReconciler/hardSet.js
new file mode 100644
index 0000000..1f5fcda
--- /dev/null
+++ b/node_modules/redux-persist/src/stateReconciler/hardSet.js
@@ -0,0 +1,10 @@
+// @flow
+
+/*
+ hardSet:
+ - hard set incoming state
+*/
+
+export default function hardSet(inboundState: State): State {
+ return inboundState
+}
diff --git a/node_modules/redux-persist/src/storage/createWebStorage.js b/node_modules/redux-persist/src/storage/createWebStorage.js
new file mode 100644
index 0000000..b77132c
--- /dev/null
+++ b/node_modules/redux-persist/src/storage/createWebStorage.js
@@ -0,0 +1,23 @@
+// @flow
+import getStorage from './getStorage'
+
+export default function createWebStorage(type: string) {
+ let storage = getStorage(type)
+ return {
+ getItem: (key: string): Promise => {
+ return new Promise((resolve, reject) => {
+ resolve(storage.getItem(key))
+ })
+ },
+ setItem: (key: string, item: string): Promise => {
+ return new Promise((resolve, reject) => {
+ resolve(storage.setItem(key, item))
+ })
+ },
+ removeItem: (key: string): Promise => {
+ return new Promise((resolve, reject) => {
+ resolve(storage.removeItem(key))
+ })
+ },
+ }
+}
diff --git a/node_modules/redux-persist/src/storage/getStorage.js b/node_modules/redux-persist/src/storage/getStorage.js
new file mode 100644
index 0000000..a6b8e60
--- /dev/null
+++ b/node_modules/redux-persist/src/storage/getStorage.js
@@ -0,0 +1,44 @@
+// @flow
+
+import type { Storage } from '../types'
+
+function noop() {}
+let noopStorage = {
+ getItem: noop,
+ setItem: noop,
+ removeItem: noop,
+}
+
+function hasStorage(storageType) {
+ if (typeof window !== 'object' || !(storageType in window)) {
+ return false
+ }
+
+ try {
+ let storage = window[storageType]
+ const testKey = `redux-persist ${storageType} test`
+ storage.setItem(testKey, 'test')
+ storage.getItem(testKey)
+ storage.removeItem(testKey)
+ } catch (e) {
+ if (process.env.NODE_ENV !== 'production')
+ console.warn(
+ `redux-persist ${storageType} test failed, persistence will be disabled.`
+ )
+ return false
+ }
+ return true
+}
+
+export default function getStorage(type: string): Storage {
+ const storageType = `${type}Storage`
+ if (hasStorage(storageType)) return window[storageType]
+ else {
+ if (process.env.NODE_ENV !== 'production') {
+ console.error(
+ `redux-persist failed to create sync storage. falling back to memory storage.`
+ )
+ }
+ return noopStorage
+ }
+}
diff --git a/node_modules/redux-persist/src/storage/index.js b/node_modules/redux-persist/src/storage/index.js
new file mode 100644
index 0000000..0532b1f
--- /dev/null
+++ b/node_modules/redux-persist/src/storage/index.js
@@ -0,0 +1,5 @@
+// @flow
+
+import createWebStorage from './createWebStorage'
+
+export default createWebStorage('local')
diff --git a/node_modules/redux-persist/src/storage/index.native.js b/node_modules/redux-persist/src/storage/index.native.js
new file mode 100644
index 0000000..641e10f
--- /dev/null
+++ b/node_modules/redux-persist/src/storage/index.native.js
@@ -0,0 +1,6 @@
+// @noflow
+/* eslint-disable */
+
+import { AsyncStorage } from 'react-native'
+
+export default AsyncStorage
diff --git a/node_modules/redux-persist/src/storage/session.js b/node_modules/redux-persist/src/storage/session.js
new file mode 100644
index 0000000..1bb16d6
--- /dev/null
+++ b/node_modules/redux-persist/src/storage/session.js
@@ -0,0 +1,5 @@
+// @flow
+
+import createWebStorage from './createWebStorage'
+
+export default createWebStorage('session')
diff --git a/node_modules/redux-persist/src/types.js b/node_modules/redux-persist/src/types.js
new file mode 100644
index 0000000..2873bdb
--- /dev/null
+++ b/node_modules/redux-persist/src/types.js
@@ -0,0 +1,82 @@
+// @flow
+
+export type PersistState = {
+ version: number,
+ rehydrated: boolean,
+}
+
+export type PersistedState = {
+ _persist: PersistState,
+} | void
+
+export type PersistConfig = {
+ version?: number,
+ storage: Object,
+ key: string,
+ keyPrefix?: string, // @TODO remove in v6
+ blacklist?: Array,
+ whitelist?: Array,
+ transforms?: Array,
+ throttle?: number,
+ migrate?: (PersistedState, number) => Promise,
+ stateReconciler?: false | Function,
+ getStoredState?: PersistConfig => Promise, // used for migrations
+ debug?: boolean,
+ serialize?: boolean,
+}
+
+export type PersistorOptions = {
+ enhancer?: Function,
+}
+
+export type Storage = {
+ getItem: (string, ?(string) => any) => any,
+ setItem: (string, string, ?() => any) => any,
+ removeItem: (string, ?() => any) => any,
+}
+
+export type MigrationManifest = {
+ [number | string]: (PersistedState) => PersistedState,
+}
+
+export type Transform = {
+ in: (Object | string, string) => Object,
+ out: (Object | string, string) => Object,
+ config?: PersistConfig,
+}
+
+export type RehydrateErrorType = any
+
+export type RehydrateAction = {
+ type: 'redux-persist/REHYDRATE',
+ key: string,
+ payload: ?Object,
+ err: ?RehydrateErrorType,
+}
+
+export type Persistoid = {
+ update: Object => void,
+ flush: () => Promise,
+}
+
+type RegisterAction = {
+ type: 'redux-persist/REGISTER',
+ key: string,
+}
+
+type PersistorAction = RehydrateAction | RegisterAction
+
+type PersistorState = {
+ registry: Array,
+ bootstrapped: boolean,
+}
+
+type PersistorSubscribeCallback = () => any
+
+export type Persistor = {
+ purge: () => Promise,
+ flush: () => Promise,
+ +dispatch: PersistorAction => PersistorAction,
+ +getState: () => PersistorState,
+ +subscribe: PersistorSubscribeCallback => () => any,
+}
diff --git a/node_modules/redux-persist/src/utils/curry.js b/node_modules/redux-persist/src/utils/curry.js
new file mode 100644
index 0000000..b55b1a8
--- /dev/null
+++ b/node_modules/redux-persist/src/utils/curry.js
@@ -0,0 +1,28 @@
+// // @flow
+// // credit @gcanti, taken from https://github.com/gcanti/flow-static-land/blob/e36cd55b8f8541e81828ec39964bdb6f5ccbec91/src/Fun.js
+
+// export type Fn1 = (a: A, ...rest: Array) => B
+// export type Fn2 = (a: A, b: B, ...rest: Array) => C
+// export type Fn3 = (a: A, b: B, c: C, ...rest: Array) => D
+
+// export type CurriedFn2 = Fn1 > & Fn2
+// export type CurriedFn3 = Fn1 > &
+// Fn2 > &
+// Fn3
+
+// declare function curry (f: Fn2 ): CurriedFn2 // eslint-disable-line no-redeclare
+// declare function curry (f: Fn3 ): CurriedFn3 // eslint-disable-line no-redeclare
+
+// declare function curried(f, length, acc) {
+// return function() {
+// const combined = acc.concat(Array.prototype.slice.call(arguments))
+// return combined.length >= length
+// ? f.apply(this, combined)
+// : curried(f, length, combined)
+// }
+// }
+
+// export function curry(f: Function) {
+// // eslint-disable-line no-redeclare
+// return curried(f, f.length, [])
+// }
diff --git a/package.json b/package.json
index c02a9ca..a365f3e 100644
--- a/package.json
+++ b/package.json
@@ -15,6 +15,7 @@
"license": "ISC",
"dependencies": {
"lodash": "^4.17.4",
+ "redux-persist": "^5.5.0",
"reduxsauce": "^0.7.0"
}
}
diff --git a/src/index.js b/src/index.js
index 5d7f170..d49fb22 100644
--- a/src/index.js
+++ b/src/index.js
@@ -4,6 +4,7 @@ import { createOfflineActions, markActionsOffline } from './offlineActions'
import reducer from './reducer'
import suspendSaga from './suspendSaga'
import consumeActionMiddleware from './consumeActionMiddleware'
+import offlinePersistenceTransform from './offlinePersistenceTransform'
module.exports = {
ONLINE: actions.ONLINE,
@@ -14,4 +15,5 @@ module.exports = {
reducer,
suspendSaga,
consumeActionMiddleware,
+ offlinePersistenceTransform,
}
diff --git a/yarn.lock b/yarn.lock
index 1b11511..fa0cbff 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -30,6 +30,10 @@ ramdasauce@^2.0.0:
dependencies:
ramda "^0.24.1"
+redux-persist@^5.5.0:
+ version "5.5.0"
+ resolved "https://registry.yarnpkg.com/redux-persist/-/redux-persist-5.5.0.tgz#64b5030625cb6f863f76487975acb8bb4fe4f9bb"
+
redux@^3.7.1:
version "3.7.2"
resolved "https://registry.yarnpkg.com/redux/-/redux-3.7.2.tgz#06b73123215901d25d065be342eb026bc1c8537b"