diff --git a/.eslintrc b/.eslintrc
index 4a69de57..2a9389db 100644
--- a/.eslintrc
+++ b/.eslintrc
@@ -1,9 +1,10 @@
{
- "extends": "standard",
+ "extends": ["standard", "standard-jsx"],
"env": {
"es6": true,
"jest": true,
- "node": true
+ "node": true,
+ "browser": true
},
"globals": {
"GENTLY": true
diff --git a/.gitignore b/.gitignore
index 356b3db2..2d5233ca 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,4 +1,7 @@
node_modules
.idea
config/sequelizeCliConfig.js
-config/speechConfig.js
\ No newline at end of file
+config/speechConfig.js
+public/bundle
+server.js
+webpack.config.js
diff --git a/README.md b/README.md
index 974834d1..33aee954 100644
--- a/README.md
+++ b/README.md
@@ -1,5 +1,5 @@
-# spee.ch
-spee.ch is a single-serving site that reads and publishes images and videos to and from the [LBRY](https://lbry.io/) blockchain.
+# Spee.ch
+Spee.ch is a web app that reads and publishes images and videos to and from the [LBRY](https://lbry.io/) blockchain.
## how to run this repository locally
* start mysql
@@ -16,9 +16,9 @@ spee.ch is a single-serving site that reads and publishes images and videos to a
* run `npm install`
* create your `speechConfig.js` file
* copy `speechConfig.js.example` and name it `speechConfig.js`
- * replace the `null` values in the config file with the appropriate values for your environement
- * to start the server, from your command line run `node speech.js`
- * To run hot, use `nodemon` instead of `node`
+ * replace the `null` values in the config file with the appropriate values for your environment
+ * build the app by running `npm run build-prod`
+ * to start the server, run `npm run start`
* visit [localhost:3000](http://localhost:3000)
## Tests
diff --git a/auth/authentication.js b/auth/authentication.js
index 7feb7c0f..c1e69def 100644
--- a/auth/authentication.js
+++ b/auth/authentication.js
@@ -7,31 +7,31 @@ module.exports = {
const userName = channelName.substring(1);
logger.debug(`authenticateChannelCredentials > channelName: ${channelName} username: ${userName} pass: ${userPassword}`);
db.User
- .findOne({where: { userName }})
- .then(user => {
- if (!user) {
- logger.debug('no user found');
+ .findOne({where: { userName }})
+ .then(user => {
+ if (!user) {
+ logger.debug('no user found');
+ resolve(false);
+ return;
+ }
+ return user.comparePassword(userPassword, (passwordErr, isMatch) => {
+ if (passwordErr) {
+ logger.error('comparePassword error:', passwordErr);
resolve(false);
return;
}
- return user.comparePassword(userPassword, (passwordErr, isMatch) => {
- if (passwordErr) {
- logger.error('comparePassword error:', passwordErr);
- resolve(false);
- return;
- }
- if (!isMatch) {
- logger.debug('incorrect password');
- resolve(false);
- return;
- }
- logger.debug('...password was a match...');
- resolve(true);
- });
- })
- .catch(error => {
- reject(error);
+ if (!isMatch) {
+ logger.debug('incorrect password');
+ resolve(false);
+ return;
+ }
+ logger.debug('...password was a match...');
+ resolve(true);
});
+ })
+ .catch(error => {
+ reject(error);
+ });
});
},
authenticateIfNoUserToken (channelName, channelPassword, user) {
diff --git a/config/speechConfig.js.example b/config/speechConfig.js.example
index 7abd197c..0d7e9ab0 100644
--- a/config/speechConfig.js.example
+++ b/config/speechConfig.js.example
@@ -23,8 +23,10 @@ module.exports = {
uploadDirectory: null, // enter file path to where uploads/publishes should be stored
},
site: {
- name: 'Spee.ch',
- host: 'https://spee.ch',
+ title: 'Spee.ch',
+ name : 'Spee.ch',
+ host : 'https://spee.ch',
+ description: 'Open-source, decentralized image and video sharing.'
},
claim: {
defaultTitle : 'Spee.ch',
diff --git a/controllers/publishController.js b/controllers/publishController.js
index 491e3352..9e912cd7 100644
--- a/controllers/publishController.js
+++ b/controllers/publishController.js
@@ -10,80 +10,80 @@ module.exports = {
let publishResults, certificateId, channelName;
// publish the file
return lbryApi.publishClaim(publishParams)
- .then(tx => {
- logger.info(`Successfully published ${publishParams.name} ${fileName}`, tx);
- publishResults = tx;
- // get the channel information
- if (publishParams.channel_name) {
- logger.debug(`this claim was published in channel: ${publishParams.channel_name}`);
- return db.Channel.findOne({where: {channelName: publishParams.channel_name}});
- } else {
- logger.debug('this claim was not published in a channel');
- return null;
- }
- })
- .then(channel => {
+ .then(tx => {
+ logger.info(`Successfully published ${publishParams.name} ${fileName}`, tx);
+ publishResults = tx;
+ // get the channel information
+ if (publishParams.channel_name) {
+ logger.debug(`this claim was published in channel: ${publishParams.channel_name}`);
+ return db.Channel.findOne({where: {channelName: publishParams.channel_name}});
+ } else {
+ logger.debug('this claim was not published in a channel');
+ return null;
+ }
+ })
+ .then(channel => {
// set channel information
- certificateId = null;
- channelName = null;
- if (channel) {
- certificateId = channel.channelClaimId;
- channelName = channel.channelName;
- }
- logger.debug(`certificateId: ${certificateId}`);
- })
- .then(() => {
+ certificateId = null;
+ channelName = null;
+ if (channel) {
+ certificateId = channel.channelClaimId;
+ channelName = channel.channelName;
+ }
+ logger.debug(`certificateId: ${certificateId}`);
+ })
+ .then(() => {
// create the File record
- const fileRecord = {
- name : publishParams.name,
- claimId : publishResults.claim_id,
- title : publishParams.metadata.title,
- description: publishParams.metadata.description,
- address : publishParams.claim_address,
- outpoint : `${publishResults.txid}:${publishResults.nout}`,
- height : 0,
- fileName,
- filePath : publishParams.file_path,
- fileType,
- nsfw : publishParams.metadata.nsfw,
- };
- // create the Claim record
- const claimRecord = {
- name : publishParams.name,
- claimId : publishResults.claim_id,
- title : publishParams.metadata.title,
- description: publishParams.metadata.description,
- address : publishParams.claim_address,
- thumbnail : publishParams.metadata.thumbnail,
- outpoint : `${publishResults.txid}:${publishResults.nout}`,
- height : 0,
- contentType: fileType,
- nsfw : publishParams.metadata.nsfw,
- amount : publishParams.bid,
- certificateId,
- channelName,
- };
- // upsert criteria
- const upsertCriteria = {
- name : publishParams.name,
- claimId: publishResults.claim_id,
- };
- // upsert the records
- return Promise.all([db.upsert(db.File, fileRecord, upsertCriteria, 'File'), db.upsert(db.Claim, claimRecord, upsertCriteria, 'Claim')]);
- })
- .then(([file, claim]) => {
- logger.debug('File and Claim records successfully created');
- return Promise.all([file.setClaim(claim), claim.setFile(file)]);
- })
- .then(() => {
- logger.debug('File and Claim records successfully associated');
- resolve(publishResults); // resolve the promise with the result from lbryApi.publishClaim;
- })
- .catch(error => {
- logger.error('PUBLISH ERROR', error);
- publishHelpers.deleteTemporaryFile(publishParams.file_path); // delete the local file
- reject(error);
- });
+ const fileRecord = {
+ name : publishParams.name,
+ claimId : publishResults.claim_id,
+ title : publishParams.metadata.title,
+ description: publishParams.metadata.description,
+ address : publishParams.claim_address,
+ outpoint : `${publishResults.txid}:${publishResults.nout}`,
+ height : 0,
+ fileName,
+ filePath : publishParams.file_path,
+ fileType,
+ nsfw : publishParams.metadata.nsfw,
+ };
+ // create the Claim record
+ const claimRecord = {
+ name : publishParams.name,
+ claimId : publishResults.claim_id,
+ title : publishParams.metadata.title,
+ description: publishParams.metadata.description,
+ address : publishParams.claim_address,
+ thumbnail : publishParams.metadata.thumbnail,
+ outpoint : `${publishResults.txid}:${publishResults.nout}`,
+ height : 0,
+ contentType: fileType,
+ nsfw : publishParams.metadata.nsfw,
+ amount : publishParams.bid,
+ certificateId,
+ channelName,
+ };
+ // upsert criteria
+ const upsertCriteria = {
+ name : publishParams.name,
+ claimId: publishResults.claim_id,
+ };
+ // upsert the records
+ return Promise.all([db.upsert(db.File, fileRecord, upsertCriteria, 'File'), db.upsert(db.Claim, claimRecord, upsertCriteria, 'Claim')]);
+ })
+ .then(([file, claim]) => {
+ logger.debug('File and Claim records successfully created');
+ return Promise.all([file.setClaim(claim), claim.setFile(file)]);
+ })
+ .then(() => {
+ logger.debug('File and Claim records successfully associated');
+ resolve(publishResults); // resolve the promise with the result from lbryApi.publishClaim;
+ })
+ .catch(error => {
+ logger.error('PUBLISH ERROR', error);
+ publishHelpers.deleteTemporaryFile(publishParams.file_path); // delete the local file
+ reject(error);
+ });
});
},
checkClaimNameAvailability (name) {
diff --git a/helpers/configVarCheck.js b/helpers/configVarCheck.js
index b849245f..c32af5a4 100644
--- a/helpers/configVarCheck.js
+++ b/helpers/configVarCheck.js
@@ -6,11 +6,11 @@ module.exports = function () {
for (let configCategoryKey in config) {
if (config.hasOwnProperty(configCategoryKey)) {
- // get the final variables for each config category
+ // get the final variables for each config category
const configVariables = config[configCategoryKey];
for (let configVarKey in configVariables) {
if (configVariables.hasOwnProperty(configVarKey)) {
- // print each variable
+ // print each variable
logger.debug(`CONFIG CHECK: ${configCategoryKey}.${configVarKey} === ${configVariables[configVarKey]}`);
}
}
diff --git a/helpers/handlePageRender.jsx b/helpers/handlePageRender.jsx
new file mode 100644
index 00000000..206303c4
--- /dev/null
+++ b/helpers/handlePageRender.jsx
@@ -0,0 +1,45 @@
+import React from 'react';
+import { renderToString } from 'react-dom/server';
+import { createStore } from 'redux';
+import Reducer from '../react/reducers';
+import { Provider } from 'react-redux';
+import { StaticRouter } from 'react-router-dom';
+import GAListener from '../react/components/GAListener';
+import App from '../react/app';
+import renderFullPage from './renderFullPage.js';
+import Helmet from 'react-helmet';
+
+module.exports = (req, res) => {
+ let context = {};
+
+ // create a new Redux store instance
+ const store = createStore(Reducer);
+
+ // render component to a string
+ const html = renderToString(
+
+
+
+
+
+
+
+ );
+
+ // get head tags from helmet
+ const helmet = Helmet.renderStatic();
+
+ // check for a redirect
+ if (context.url) {
+ // Somewhere a `` was rendered
+ return res.redirect(301, context.url);
+ } else {
+ // we're good, send the response
+ }
+
+ // get the initial state from our Redux store
+ const preloadedState = store.getState();
+
+ // send the rendered page back to the client
+ res.send(renderFullPage(helmet, html, preloadedState));
+};
diff --git a/helpers/handleShowRender.jsx b/helpers/handleShowRender.jsx
new file mode 100644
index 00000000..7e53bd54
--- /dev/null
+++ b/helpers/handleShowRender.jsx
@@ -0,0 +1,71 @@
+import React from 'react';
+import { renderToString } from 'react-dom/server';
+import { createStore, applyMiddleware } from 'redux';
+import Reducer from '../react/reducers';
+import { Provider } from 'react-redux';
+import { StaticRouter } from 'react-router-dom';
+import GAListener from '../react/components/GAListener';
+import App from '../react/app';
+import renderFullPage from './renderFullPage';
+import createSagaMiddleware from 'redux-saga';
+import { call } from 'redux-saga/effects';
+import { handleShowPageUri } from '../react/sagas/show_uri';
+import { onHandleShowPageUri } from '../react/actions/show';
+
+import Helmet from 'react-helmet';
+
+const returnSagaWithParams = (saga, params) => {
+ return function * () {
+ yield call(saga, params);
+ };
+};
+
+module.exports = (req, res) => {
+ let context = {};
+
+ // create and apply middleware
+ const sagaMiddleware = createSagaMiddleware();
+ const middleware = applyMiddleware(sagaMiddleware);
+
+ // create a new Redux store instance
+ const store = createStore(Reducer, middleware);
+
+ // create saga
+ const action = onHandleShowPageUri(req.params);
+ const saga = returnSagaWithParams(handleShowPageUri, action);
+
+ // run the saga middleware
+ sagaMiddleware
+ .run(saga)
+ .done
+ .then(() => {
+ console.log('preload sagas are done');
+ // render component to a string
+ const html = renderToString(
+
+
+
+
+
+
+
+ );
+
+ // get head tags from helmet
+ const helmet = Helmet.renderStatic();
+
+ // check for a redirect
+ if (context.url) {
+ console.log('REDIRECTING:', context.url);
+ return res.redirect(301, context.url);
+ } else {
+ console.log(`we're good, send the response`);
+ }
+
+ // get the initial state from our Redux store
+ const preloadedState = store.getState();
+
+ // send the rendered page back to the client
+ res.send(renderFullPage(helmet, html, preloadedState));
+ });
+};
diff --git a/helpers/handlebarsHelpers.js b/helpers/handlebarsHelpers.js
deleted file mode 100644
index 5e857070..00000000
--- a/helpers/handlebarsHelpers.js
+++ /dev/null
@@ -1,113 +0,0 @@
-const Handlebars = require('handlebars');
-const { site, claim: claimDefaults } = require('../config/speechConfig.js');
-
-function determineOgTitle (storedTitle, defaultTitle) {
- return ifEmptyReturnOther(storedTitle, defaultTitle);
-};
-
-function determineOgDescription (storedDescription, defaultDescription) {
- const length = 200;
- let description = ifEmptyReturnOther(storedDescription, defaultDescription);
- if (description.length >= length) {
- description = `${description.substring(0, length)}...`;
- };
- return description;
-};
-
-function ifEmptyReturnOther (value, replacement) {
- if (value === '') {
- return replacement;
- }
- return value;
-}
-
-function determineContentTypeFromFileExtension (fileExtension) {
- switch (fileExtension) {
- case 'jpeg':
- case 'jpg':
- return 'image/jpeg';
- case 'png':
- return 'image/png';
- case 'gif':
- return 'image/gif';
- case 'mp4':
- return 'video/mp4';
- default:
- return 'image/jpeg';
- }
-};
-
-function determineOgThumbnailContentType (thumbnail) {
- if (thumbnail) {
- if (thumbnail.lastIndexOf('.') !== -1) {
- return determineContentTypeFromFileExtension(thumbnail.substring(thumbnail.lastIndexOf('.')));
- }
- }
- return '';
-}
-
-function createOpenGraphDataFromClaim (claim, defaultTitle, defaultDescription) {
- let openGraphData = {};
- openGraphData['embedUrl'] = `${site.host}/${claim.claimId}/${claim.name}`;
- openGraphData['showUrl'] = `${site.host}/${claim.claimId}/${claim.name}`;
- openGraphData['source'] = `${site.host}/${claim.claimId}/${claim.name}.${claim.fileExt}`;
- openGraphData['directFileUrl'] = `${site.host}/${claim.claimId}/${claim.name}.${claim.fileExt}`;
- openGraphData['ogTitle'] = determineOgTitle(claim.title, defaultTitle);
- openGraphData['ogDescription'] = determineOgDescription(claim.description, defaultDescription);
- openGraphData['ogThumbnailContentType'] = determineOgThumbnailContentType(claim.thumbnail);
- return openGraphData;
-};
-
-module.exports = {
- placeCommonHeaderTags () {
- const headerBoilerplate = `${site.title}`;
- return new Handlebars.SafeString(headerBoilerplate);
- },
- addOpenGraph (claim) {
- const { ogTitle, ogDescription, showUrl, source, ogThumbnailContentType } = createOpenGraphDataFromClaim(claim, claimDefaults.defaultTitle, claimDefaults.defaultDescription);
- const thumbnail = claim.thumbnail;
- const contentType = claim.contentType;
- const ogTitleTag = ``;
- const ogUrlTag = ``;
- const ogSiteNameTag = ``;
- const ogDescriptionTag = ``;
- const ogImageWidthTag = '';
- const ogImageHeightTag = '';
- const basicTags = `${ogTitleTag} ${ogUrlTag} ${ogSiteNameTag} ${ogDescriptionTag} ${ogImageWidthTag} ${ogImageHeightTag}`;
- let ogImageTag = ``;
- let ogImageTypeTag = ``;
- let ogTypeTag = ``;
- if (contentType === 'video/mp4') {
- const ogVideoTag = ``;
- const ogVideoSecureUrlTag = ``;
- const ogVideoTypeTag = ``;
- ogImageTag = ``;
- ogImageTypeTag = ``;
- ogTypeTag = ``;
- return new Handlebars.SafeString(`${basicTags} ${ogImageTag} ${ogImageTypeTag} ${ogTypeTag} ${ogVideoTag} ${ogVideoSecureUrlTag} ${ogVideoTypeTag}`);
- } else {
- if (contentType === 'image/gif') {
- ogTypeTag = ``;
- };
- return new Handlebars.SafeString(`${basicTags} ${ogImageTag} ${ogImageTypeTag} ${ogTypeTag}`);
- }
- },
- addTwitterCard (claim) {
- const { embedUrl, directFileUrl } = createOpenGraphDataFromClaim(claim, claimDefaults.defaultTitle, claimDefaults.defaultDescription);
- const basicTwitterTags = ``;
- const contentType = claim.contentType;
- if (contentType === 'video/mp4') {
- const twitterName = '';
- const twitterPlayer = ``;
- const twitterPlayerWidth = '';
- const twitterTextPlayerWidth = '';
- const twitterPlayerHeight = '';
- const twitterPlayerStream = ``;
- const twitterPlayerStreamContentType = '';
- return new Handlebars.SafeString(`${basicTwitterTags} ${twitterName} ${twitterPlayer} ${twitterPlayerWidth} ${twitterTextPlayerWidth} ${twitterPlayerHeight} ${twitterPlayerStream} ${twitterPlayerStreamContentType}`);
- } else {
- const twitterCard = '';
- return new Handlebars.SafeString(`${basicTwitterTags} ${twitterCard}`);
- }
- },
-};
diff --git a/helpers/renderFullPage.js b/helpers/renderFullPage.js
new file mode 100644
index 00000000..4786da58
--- /dev/null
+++ b/helpers/renderFullPage.js
@@ -0,0 +1,32 @@
+module.exports = (helmet, html, preloadedState) => {
+ // take the html and preloadedState and return the full page
+ return `
+
+
+
+
+
+
+
+ ${helmet.title.toString()}
+ ${helmet.meta.toString()}
+ ${helmet.link.toString()}
+
+
+
+
+
+
+
+
+
+
${html}
+
+
+
+
+
+ `;
+};
diff --git a/speech.js b/index.js
similarity index 83%
rename from speech.js
rename to index.js
index 3b03adea..9303e671 100644
--- a/speech.js
+++ b/index.js
@@ -3,11 +3,9 @@ const express = require('express');
const bodyParser = require('body-parser');
const expressHandlebars = require('express-handlebars');
const Handlebars = require('handlebars');
-const handlebarsHelpers = require('./helpers/handlebarsHelpers.js');
const { populateLocalsDotUser, serializeSpeechUser, deserializeSpeechUser } = require('./helpers/authHelpers.js');
const config = require('./config/speechConfig.js');
const logger = require('winston');
-const { getDownloadDirectory } = require('./helpers/lbryApi');
const helmet = require('helmet');
const PORT = 3000; // set port
const app = express(); // create an Express application
@@ -54,9 +52,8 @@ app.use(passport.session());
// configure handlebars & register it with express app
const hbs = expressHandlebars.create({
- defaultLayout: 'main', // sets the default layout
+ defaultLayout: 'embed', // sets the default layout
handlebars : Handlebars, // includes basic handlebars for access to that library
- helpers : handlebarsHelpers, // custom defined helpers
});
app.engine('handlebars', hbs.engine);
app.set('view engine', 'handlebars');
@@ -67,19 +64,12 @@ app.use(populateLocalsDotUser);
// start the server
db.sequelize
.sync() // sync sequelize
- .then(() => { // get the download directory from the daemon
- logger.info('Retrieving daemon download directory...');
- return getDownloadDirectory();
- })
- .then(hostedContentPath => {
- // add the hosted content folder at a static path
- app.use('/media', express.static(hostedContentPath));
- // require routes
+ .then(() => { // require routes
require('./routes/auth-routes.js')(app);
require('./routes/api-routes.js')(app);
require('./routes/page-routes.js')(app);
require('./routes/serve-routes.js')(app);
- require('./routes/home-routes.js')(app);
+ require('./routes/fallback-routes.js')(app);
const http = require('http');
return http.Server(app);
})
diff --git a/models/certificate.js b/models/certificate.js
index 07c0cc76..7a83f66d 100644
--- a/models/certificate.js
+++ b/models/certificate.js
@@ -176,15 +176,15 @@ module.exports = (sequelize, { STRING, BOOLEAN, INTEGER, TEXT, DECIMAL }) => {
this.findOne({
where: {name, claimId},
})
- .then(result => {
- if (!result) {
- return resolve(null);
- };
- resolve(claimId);
- })
- .catch(error => {
- reject(error);
- });
+ .then(result => {
+ if (!result) {
+ return resolve(null);
+ };
+ resolve(claimId);
+ })
+ .catch(error => {
+ reject(error);
+ });
});
};
diff --git a/models/claim.js b/models/claim.js
index 25c1a04f..0641ab65 100644
--- a/models/claim.js
+++ b/models/claim.js
@@ -318,15 +318,15 @@ module.exports = (sequelize, { STRING, BOOLEAN, INTEGER, TEXT, DECIMAL }) => {
this.findOne({
where: {name, claimId},
})
- .then(result => {
- if (!result) {
- return resolve(null);
- };
- resolve(claimId);
- })
- .catch(error => {
- reject(error);
- });
+ .then(result => {
+ if (!result) {
+ return resolve(null);
+ };
+ resolve(claimId);
+ })
+ .catch(error => {
+ reject(error);
+ });
});
};
diff --git a/models/index.js b/models/index.js
index 96a4bea5..1e6b6352 100644
--- a/models/index.js
+++ b/models/index.js
@@ -1,7 +1,7 @@
-const fs = require('fs');
-const path = require('path');
+// const fs = require('fs');
+// const path = require('path');
const Sequelize = require('sequelize');
-const basename = path.basename(module.filename);
+// const basename = path.basename(module.filename);
const logger = require('winston');
const config = require('../config/speechConfig.js');
const { database, username, password } = config.sql;
@@ -30,16 +30,19 @@ sequelize
logger.error('Sequelize was unable to connect to the database:', err);
});
-// add each model to the db object
-fs
- .readdirSync(__dirname)
- .filter(file => {
- return (file.indexOf('.') !== 0 && file !== basename && file.slice(-3) === '.js');
- })
- .forEach(file => {
- const model = sequelize['import'](path.join(__dirname, file));
- db[model.name] = model;
- });
+// manually add each model to the db
+const Certificate = require('./certificate.js');
+const Channel = require('./channel.js');
+const Claim = require('./claim.js');
+const File = require('./file.js');
+const Request = require('./request.js');
+const User = require('./user.js');
+db['Certificate'] = sequelize.import('Certificate', Certificate);
+db['Channel'] = sequelize.import('Channel', Channel);
+db['Claim'] = sequelize.import('Claim', Claim);
+db['File'] = sequelize.import('File', File);
+db['Request'] = sequelize.import('Request', Request);
+db['User'] = sequelize.import('User', User);
// run model.association for each model in the db object that has an association
Object.keys(db).forEach(modelName => {
diff --git a/package.json b/package.json
index 96861b3f..c6d0dbce 100644
--- a/package.json
+++ b/package.json
@@ -6,12 +6,14 @@
"scripts": {
"test": "mocha --recursive",
"test-all": "mocha --recursive",
- "start": "node speech.js",
+ "start": "node server.js",
+ "start-dev": "nodemon server.js",
"lint": "eslint .",
"fix": "eslint . --fix",
"precommit": "eslint .",
"babel": "babel",
- "webpack": "webpack"
+ "build-dev": "webpack --config webpack.dev.js",
+ "build-prod": "webpack --config webpack.prod.js"
},
"repository": {
"type": "git",
@@ -35,18 +37,20 @@
"config": "^1.26.1",
"connect-multiparty": "^2.0.0",
"cookie-session": "^2.0.0-beta.3",
+ "cross-fetch": "^1.1.1",
"express": "^4.15.2",
"express-handlebars": "^3.0.0",
"form-data": "^2.3.1",
"helmet": "^3.8.1",
"mysql2": "^1.3.5",
- "nodemon": "^1.11.0",
+ "node-fetch": "^2.0.0",
"passport": "^0.4.0",
"passport-local": "^1.0.0",
"prop-types": "^15.6.0",
"react": "^16.2.0",
"react-dom": "^16.2.0",
"react-ga": "^2.4.1",
+ "react-helmet": "^5.2.0",
"react-redux": "^5.0.6",
"react-router-dom": "^4.2.2",
"redux": "^3.7.2",
@@ -57,6 +61,7 @@
"sequelize-cli": "^3.0.0-3",
"sleep": "^5.1.1",
"universal-analytics": "^0.4.13",
+ "webpack-node-externals": "^1.6.0",
"whatwg-fetch": "^2.0.3",
"winston": "^2.3.1",
"winston-slack-webhook": "billbitt/winston-slack-webhook"
@@ -64,22 +69,29 @@
"devDependencies": {
"babel-core": "^6.26.0",
"babel-loader": "^7.1.2",
+ "babel-plugin-transform-object-rest-spread": "^6.26.0",
"babel-polyfill": "^6.26.0",
"babel-preset-es2015": "^6.24.1",
"babel-preset-react": "^6.24.1",
"babel-preset-stage-2": "^6.24.1",
+ "babel-register": "^6.26.0",
"chai": "^4.1.2",
"chai-http": "^3.0.0",
- "eslint": "3.19.0",
- "eslint-config-standard": "10.2.1",
- "eslint-plugin-import": "^2.2.0",
- "eslint-plugin-node": "^4.2.2",
- "eslint-plugin-promise": "3.5.0",
- "eslint-plugin-react": "6.10.3",
- "eslint-plugin-standard": "3.0.1",
+ "css-loader": "^0.28.9",
+ "eslint": "4.18.0",
+ "eslint-config-standard": "^10.2.1",
+ "eslint-config-standard-jsx": "^5.0.0",
+ "eslint-plugin-import": "^2.8.0",
+ "eslint-plugin-node": "^4.2.3",
+ "eslint-plugin-promise": "^3.5.0",
+ "eslint-plugin-react": "^7.6.1",
+ "eslint-plugin-standard": "^3.0.1",
"husky": "^0.13.4",
"mocha": "^4.0.1",
+ "nodemon": "^1.15.1",
"redux-devtools": "^3.4.1",
- "webpack": "^3.10.0"
+ "regenerator-transform": "^0.12.3",
+ "webpack": "^3.10.0",
+ "webpack-merge": "^4.1.2"
}
}
diff --git a/passport/local-login.js b/passport/local-login.js
index 7263b455..99e9fc50 100644
--- a/passport/local-login.js
+++ b/passport/local-login.js
@@ -8,19 +8,19 @@ function returnUserAndChannelInfo (userInstance) {
userInfo['id'] = userInstance.id;
userInfo['userName'] = userInstance.userName;
userInstance
- .getChannel()
- .then(({channelName, channelClaimId}) => {
- userInfo['channelName'] = channelName;
- userInfo['channelClaimId'] = channelClaimId;
- return db.Certificate.getShortChannelIdFromLongChannelId(channelClaimId, channelName);
- })
- .then(shortChannelId => {
- userInfo['shortChannelId'] = shortChannelId;
- resolve(userInfo);
- })
- .catch(error => {
- reject(error);
- });
+ .getChannel()
+ .then(({channelName, channelClaimId}) => {
+ userInfo['channelName'] = channelName;
+ userInfo['channelClaimId'] = channelClaimId;
+ return db.Certificate.getShortChannelIdFromLongChannelId(channelClaimId, channelName);
+ })
+ .then(shortChannelId => {
+ userInfo['shortChannelId'] = shortChannelId;
+ resolve(userInfo);
+ })
+ .catch(error => {
+ reject(error);
+ });
});
}
@@ -32,34 +32,34 @@ module.exports = new PassportLocalStrategy(
(username, password, done) => {
logger.debug('logging user in');
return db
- .User
- .findOne({where: {userName: username}})
- .then(user => {
- if (!user) {
- // logger.debug('no user found');
+ .User
+ .findOne({where: {userName: username}})
+ .then(user => {
+ if (!user) {
+ // logger.debug('no user found');
+ return done(null, false, {message: 'Incorrect username or password'});
+ }
+ user.comparePassword(password, (passwordErr, isMatch) => {
+ if (passwordErr) {
+ logger.error('passwordErr:', passwordErr);
+ return done(null, false, {message: passwordErr});
+ }
+ if (!isMatch) {
+ // logger.debug('incorrect password');
return done(null, false, {message: 'Incorrect username or password'});
}
- user.comparePassword(password, (passwordErr, isMatch) => {
- if (passwordErr) {
- logger.error('passwordErr:', passwordErr);
- return done(null, false, {message: passwordErr});
- }
- if (!isMatch) {
- // logger.debug('incorrect password');
- return done(null, false, {message: 'Incorrect username or password'});
- }
- logger.debug('Password was a match, returning User');
- return returnUserAndChannelInfo(user)
- .then((userInfo) => {
- return done(null, userInfo);
- })
- .catch(error => {
- return done(error);
- });
- });
- })
- .catch(error => {
- return done(error);
+ logger.debug('Password was a match, returning User');
+ return returnUserAndChannelInfo(user)
+ .then((userInfo) => {
+ return done(null, userInfo);
+ })
+ .catch(error => {
+ return done(error);
+ });
});
+ })
+ .catch(error => {
+ return done(error);
+ });
}
);
diff --git a/public/bundle/bundle.js b/public/bundle/bundle.js
deleted file mode 100644
index 1bd62465..00000000
--- a/public/bundle/bundle.js
+++ /dev/null
@@ -1,25176 +0,0 @@
-/******/ (function(modules) { // webpackBootstrap
-/******/ // The module cache
-/******/ var installedModules = {};
-/******/
-/******/ // The require function
-/******/ function __webpack_require__(moduleId) {
-/******/
-/******/ // Check if module is in cache
-/******/ if(installedModules[moduleId]) {
-/******/ return installedModules[moduleId].exports;
-/******/ }
-/******/ // Create a new module (and put it into the cache)
-/******/ var module = installedModules[moduleId] = {
-/******/ i: moduleId,
-/******/ l: false,
-/******/ exports: {}
-/******/ };
-/******/
-/******/ // Execute the module function
-/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
-/******/
-/******/ // Flag the module as loaded
-/******/ module.l = true;
-/******/
-/******/ // Return the exports of the module
-/******/ return module.exports;
-/******/ }
-/******/
-/******/
-/******/ // expose the modules object (__webpack_modules__)
-/******/ __webpack_require__.m = modules;
-/******/
-/******/ // expose the module cache
-/******/ __webpack_require__.c = installedModules;
-/******/
-/******/ // define getter function for harmony exports
-/******/ __webpack_require__.d = function(exports, name, getter) {
-/******/ if(!__webpack_require__.o(exports, name)) {
-/******/ Object.defineProperty(exports, name, {
-/******/ configurable: false,
-/******/ enumerable: true,
-/******/ get: getter
-/******/ });
-/******/ }
-/******/ };
-/******/
-/******/ // getDefaultExport function for compatibility with non-harmony modules
-/******/ __webpack_require__.n = function(module) {
-/******/ var getter = module && module.__esModule ?
-/******/ function getDefault() { return module['default']; } :
-/******/ function getModuleExports() { return module; };
-/******/ __webpack_require__.d(getter, 'a', getter);
-/******/ return getter;
-/******/ };
-/******/
-/******/ // Object.prototype.hasOwnProperty.call
-/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
-/******/
-/******/ // __webpack_public_path__
-/******/ __webpack_require__.p = "";
-/******/
-/******/ // Load entry module and return exports
-/******/ return __webpack_require__(__webpack_require__.s = 38);
-/******/ })
-/************************************************************************/
-/******/ ([
-/* 0 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-/* WEBPACK VAR INJECTION */(function(process) {
-
-if (process.env.NODE_ENV === 'production') {
- module.exports = __webpack_require__(41);
-} else {
- module.exports = __webpack_require__(42);
-}
-
-/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(1)))
-
-/***/ }),
-/* 1 */
-/***/ (function(module, exports) {
-
-// shim for using process in browser
-var process = module.exports = {};
-
-// cached from whatever global is present so that test runners that stub it
-// don't break things. But we need to wrap it in a try catch in case it is
-// wrapped in strict mode code which doesn't define any globals. It's inside a
-// function because try/catches deoptimize in certain engines.
-
-var cachedSetTimeout;
-var cachedClearTimeout;
-
-function defaultSetTimout() {
- throw new Error('setTimeout has not been defined');
-}
-function defaultClearTimeout () {
- throw new Error('clearTimeout has not been defined');
-}
-(function () {
- try {
- if (typeof setTimeout === 'function') {
- cachedSetTimeout = setTimeout;
- } else {
- cachedSetTimeout = defaultSetTimout;
- }
- } catch (e) {
- cachedSetTimeout = defaultSetTimout;
- }
- try {
- if (typeof clearTimeout === 'function') {
- cachedClearTimeout = clearTimeout;
- } else {
- cachedClearTimeout = defaultClearTimeout;
- }
- } catch (e) {
- cachedClearTimeout = defaultClearTimeout;
- }
-} ())
-function runTimeout(fun) {
- if (cachedSetTimeout === setTimeout) {
- //normal enviroments in sane situations
- return setTimeout(fun, 0);
- }
- // if setTimeout wasn't available but was latter defined
- if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {
- cachedSetTimeout = setTimeout;
- return setTimeout(fun, 0);
- }
- try {
- // when when somebody has screwed with setTimeout but no I.E. maddness
- return cachedSetTimeout(fun, 0);
- } catch(e){
- try {
- // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
- return cachedSetTimeout.call(null, fun, 0);
- } catch(e){
- // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error
- return cachedSetTimeout.call(this, fun, 0);
- }
- }
-
-
-}
-function runClearTimeout(marker) {
- if (cachedClearTimeout === clearTimeout) {
- //normal enviroments in sane situations
- return clearTimeout(marker);
- }
- // if clearTimeout wasn't available but was latter defined
- if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {
- cachedClearTimeout = clearTimeout;
- return clearTimeout(marker);
- }
- try {
- // when when somebody has screwed with setTimeout but no I.E. maddness
- return cachedClearTimeout(marker);
- } catch (e){
- try {
- // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
- return cachedClearTimeout.call(null, marker);
- } catch (e){
- // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.
- // Some versions of I.E. have different rules for clearTimeout vs setTimeout
- return cachedClearTimeout.call(this, marker);
- }
- }
-
-
-
-}
-var queue = [];
-var draining = false;
-var currentQueue;
-var queueIndex = -1;
-
-function cleanUpNextTick() {
- if (!draining || !currentQueue) {
- return;
- }
- draining = false;
- if (currentQueue.length) {
- queue = currentQueue.concat(queue);
- } else {
- queueIndex = -1;
- }
- if (queue.length) {
- drainQueue();
- }
-}
-
-function drainQueue() {
- if (draining) {
- return;
- }
- var timeout = runTimeout(cleanUpNextTick);
- draining = true;
-
- var len = queue.length;
- while(len) {
- currentQueue = queue;
- queue = [];
- while (++queueIndex < len) {
- if (currentQueue) {
- currentQueue[queueIndex].run();
- }
- }
- queueIndex = -1;
- len = queue.length;
- }
- currentQueue = null;
- draining = false;
- runClearTimeout(timeout);
-}
-
-process.nextTick = function (fun) {
- var args = new Array(arguments.length - 1);
- if (arguments.length > 1) {
- for (var i = 1; i < arguments.length; i++) {
- args[i - 1] = arguments[i];
- }
- }
- queue.push(new Item(fun, args));
- if (queue.length === 1 && !draining) {
- runTimeout(drainQueue);
- }
-};
-
-// v8 likes predictible objects
-function Item(fun, array) {
- this.fun = fun;
- this.array = array;
-}
-Item.prototype.run = function () {
- this.fun.apply(null, this.array);
-};
-process.title = 'browser';
-process.browser = true;
-process.env = {};
-process.argv = [];
-process.version = ''; // empty string to avoid regexp issues
-process.versions = {};
-
-function noop() {}
-
-process.on = noop;
-process.addListener = noop;
-process.once = noop;
-process.off = noop;
-process.removeListener = noop;
-process.removeAllListeners = noop;
-process.emit = noop;
-process.prependListener = noop;
-process.prependOnceListener = noop;
-
-process.listeners = function (name) { return [] }
-
-process.binding = function (name) {
- throw new Error('process.binding is not supported');
-};
-
-process.cwd = function () { return '/' };
-process.chdir = function (dir) {
- throw new Error('process.chdir is not supported');
-};
-process.umask = function() { return 0; };
-
-
-/***/ }),
-/* 2 */
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
-
-"use strict";
-Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
-/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__components_Provider__ = __webpack_require__(52);
-/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__components_connectAdvanced__ = __webpack_require__(24);
-/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__connect_connect__ = __webpack_require__(58);
-/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "Provider", function() { return __WEBPACK_IMPORTED_MODULE_0__components_Provider__["b"]; });
-/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "createProvider", function() { return __WEBPACK_IMPORTED_MODULE_0__components_Provider__["a"]; });
-/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "connectAdvanced", function() { return __WEBPACK_IMPORTED_MODULE_1__components_connectAdvanced__["a"]; });
-/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "connect", function() { return __WEBPACK_IMPORTED_MODULE_2__connect_connect__["a"]; });
-
-
-
-
-
-
-/***/ }),
-/* 3 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-
-
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
-exports.selectFile = selectFile;
-exports.clearFile = clearFile;
-exports.updateMetadata = updateMetadata;
-exports.updateClaim = updateClaim;
-exports.setPublishInChannel = setPublishInChannel;
-exports.updatePublishStatus = updatePublishStatus;
-exports.updateError = updateError;
-exports.updateSelectedChannel = updateSelectedChannel;
-exports.toggleMetadataInputs = toggleMetadataInputs;
-
-var _publish_action_types = __webpack_require__(32);
-
-var actions = _interopRequireWildcard(_publish_action_types);
-
-function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
-
-// export action creators
-function selectFile(file) {
- return {
- type: actions.FILE_SELECTED,
- file: file
- };
-};
-
-function clearFile() {
- return {
- type: actions.FILE_CLEAR
- };
-};
-
-function updateMetadata(name, value) {
- return {
- type: actions.METADATA_UPDATE,
- name: name,
- value: value
- };
-};
-
-function updateClaim(value) {
- return {
- type: actions.CLAIM_UPDATE,
- value: value
- };
-};
-
-function setPublishInChannel(channel) {
- return {
- type: actions.SET_PUBLISH_IN_CHANNEL,
- channel: channel
- };
-};
-
-function updatePublishStatus(status, message) {
- return {
- type: actions.PUBLISH_STATUS_UPDATE,
- status: status,
- message: message
- };
-};
-
-function updateError(name, value) {
- return {
- type: actions.ERROR_UPDATE,
- name: name,
- value: value
- };
-};
-
-function updateSelectedChannel(value) {
- return {
- type: actions.SELECTED_CHANNEL_UPDATE,
- value: value
- };
-};
-
-function toggleMetadataInputs(value) {
- return {
- type: actions.TOGGLE_METADATA_INPUTS,
- value: value
- };
-};
-
-/***/ }),
-/* 4 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-
-
-/**
- * Copyright (c) 2013-present, Facebook, Inc.
- *
- * This source code is licensed under the MIT license found in the
- * LICENSE file in the root directory of this source tree.
- *
- *
- */
-
-function makeEmptyFunction(arg) {
- return function () {
- return arg;
- };
-}
-
-/**
- * This function accepts and discards inputs; it has no side effects. This is
- * primarily useful idiomatically for overridable function endpoints which
- * always need to be callable, since JS lacks a null-call idiom ala Cocoa.
- */
-var emptyFunction = function emptyFunction() {};
-
-emptyFunction.thatReturns = makeEmptyFunction;
-emptyFunction.thatReturnsFalse = makeEmptyFunction(false);
-emptyFunction.thatReturnsTrue = makeEmptyFunction(true);
-emptyFunction.thatReturnsNull = makeEmptyFunction(null);
-emptyFunction.thatReturnsThis = function () {
- return this;
-};
-emptyFunction.thatReturnsArgument = function (arg) {
- return arg;
-};
-
-module.exports = emptyFunction;
-
-/***/ }),
-/* 5 */
-/***/ (function(module, exports, __webpack_require__) {
-
-/* WEBPACK VAR INJECTION */(function(process) {/**
- * Copyright (c) 2013-present, Facebook, Inc.
- *
- * This source code is licensed under the MIT license found in the
- * LICENSE file in the root directory of this source tree.
- */
-
-if (process.env.NODE_ENV !== 'production') {
- var REACT_ELEMENT_TYPE = (typeof Symbol === 'function' &&
- Symbol.for &&
- Symbol.for('react.element')) ||
- 0xeac7;
-
- var isValidElement = function(object) {
- return typeof object === 'object' &&
- object !== null &&
- object.$$typeof === REACT_ELEMENT_TYPE;
- };
-
- // By explicitly using `prop-types` you are opting into new development behavior.
- // http://fb.me/prop-types-in-prod
- var throwOnDirectAccess = true;
- module.exports = __webpack_require__(53)(isValidElement, throwOnDirectAccess);
-} else {
- // By explicitly using `prop-types` you are opting into new production behavior.
- // http://fb.me/prop-types-in-prod
- module.exports = __webpack_require__(54)();
-}
-
-/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(1)))
-
-/***/ }),
-/* 6 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-/*
-object-assign
-(c) Sindre Sorhus
-@license MIT
-*/
-
-
-/* eslint-disable no-unused-vars */
-var getOwnPropertySymbols = Object.getOwnPropertySymbols;
-var hasOwnProperty = Object.prototype.hasOwnProperty;
-var propIsEnumerable = Object.prototype.propertyIsEnumerable;
-
-function toObject(val) {
- if (val === null || val === undefined) {
- throw new TypeError('Object.assign cannot be called with null or undefined');
- }
-
- return Object(val);
-}
-
-function shouldUseNative() {
- try {
- if (!Object.assign) {
- return false;
- }
-
- // Detect buggy property enumeration order in older V8 versions.
-
- // https://bugs.chromium.org/p/v8/issues/detail?id=4118
- var test1 = new String('abc'); // eslint-disable-line no-new-wrappers
- test1[5] = 'de';
- if (Object.getOwnPropertyNames(test1)[0] === '5') {
- return false;
- }
-
- // https://bugs.chromium.org/p/v8/issues/detail?id=3056
- var test2 = {};
- for (var i = 0; i < 10; i++) {
- test2['_' + String.fromCharCode(i)] = i;
- }
- var order2 = Object.getOwnPropertyNames(test2).map(function (n) {
- return test2[n];
- });
- if (order2.join('') !== '0123456789') {
- return false;
- }
-
- // https://bugs.chromium.org/p/v8/issues/detail?id=3056
- var test3 = {};
- 'abcdefghijklmnopqrst'.split('').forEach(function (letter) {
- test3[letter] = letter;
- });
- if (Object.keys(Object.assign({}, test3)).join('') !==
- 'abcdefghijklmnopqrst') {
- return false;
- }
-
- return true;
- } catch (err) {
- // We don't expect any of the above to throw, but better to be safe.
- return false;
- }
-}
-
-module.exports = shouldUseNative() ? Object.assign : function (target, source) {
- var from;
- var to = toObject(target);
- var symbols;
-
- for (var s = 1; s < arguments.length; s++) {
- from = Object(arguments[s]);
-
- for (var key in from) {
- if (hasOwnProperty.call(from, key)) {
- to[key] = from[key];
- }
- }
-
- if (getOwnPropertySymbols) {
- symbols = getOwnPropertySymbols(from);
- for (var i = 0; i < symbols.length; i++) {
- if (propIsEnumerable.call(from, symbols[i])) {
- to[symbols[i]] = from[symbols[i]];
- }
- }
- }
- }
-
- return to;
-};
-
-
-/***/ }),
-/* 7 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-/* WEBPACK VAR INJECTION */(function(process) {/**
- * Copyright (c) 2013-present, Facebook, Inc.
- *
- * This source code is licensed under the MIT license found in the
- * LICENSE file in the root directory of this source tree.
- *
- */
-
-
-
-/**
- * Use invariant() to assert state which your program assumes to be true.
- *
- * Provide sprintf-style format (only %s is supported) and arguments
- * to provide information about what broke and what you were
- * expecting.
- *
- * The invariant message will be stripped in production, but the invariant
- * will remain to ensure logic does not differ in production.
- */
-
-var validateFormat = function validateFormat(format) {};
-
-if (process.env.NODE_ENV !== 'production') {
- validateFormat = function validateFormat(format) {
- if (format === undefined) {
- throw new Error('invariant requires an error message argument');
- }
- };
-}
-
-function invariant(condition, format, a, b, c, d, e, f) {
- validateFormat(format);
-
- if (!condition) {
- var error;
- if (format === undefined) {
- error = new Error('Minified exception occurred; use the non-minified dev environment ' + 'for the full error message and additional helpful warnings.');
- } else {
- var args = [a, b, c, d, e, f];
- var argIndex = 0;
- error = new Error(format.replace(/%s/g, function () {
- return args[argIndex++];
- }));
- error.name = 'Invariant Violation';
- }
-
- error.framesToPop = 1; // we don't care about invariant's own frame
- throw error;
- }
-}
-
-module.exports = invariant;
-/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(1)))
-
-/***/ }),
-/* 8 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-/* WEBPACK VAR INJECTION */(function(process) {/**
- * Copyright (c) 2013-present, Facebook, Inc.
- *
- * This source code is licensed under the MIT license found in the
- * LICENSE file in the root directory of this source tree.
- *
- */
-
-
-
-var emptyObject = {};
-
-if (process.env.NODE_ENV !== 'production') {
- Object.freeze(emptyObject);
-}
-
-module.exports = emptyObject;
-/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(1)))
-
-/***/ }),
-/* 9 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-/* WEBPACK VAR INJECTION */(function(process) {/**
- * Copyright (c) 2014-present, Facebook, Inc.
- *
- * This source code is licensed under the MIT license found in the
- * LICENSE file in the root directory of this source tree.
- *
- */
-
-
-
-var emptyFunction = __webpack_require__(4);
-
-/**
- * Similar to invariant but only logs a warning if the condition is not met.
- * This can be used to log issues in development environments in critical
- * paths. Removing the logging code for production environments will keep the
- * same logic and follow the same code paths.
- */
-
-var warning = emptyFunction;
-
-if (process.env.NODE_ENV !== 'production') {
- var printWarning = function printWarning(format) {
- for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
- args[_key - 1] = arguments[_key];
- }
-
- var argIndex = 0;
- var message = 'Warning: ' + format.replace(/%s/g, function () {
- return args[argIndex++];
- });
- if (typeof console !== 'undefined') {
- console.error(message);
- }
- try {
- // --- Welcome to debugging React ---
- // This error was thrown as a convenience so that you can use this stack
- // to find the callsite that caused this warning to fire.
- throw new Error(message);
- } catch (x) {}
- };
-
- warning = function warning(condition, format) {
- if (format === undefined) {
- throw new Error('`warning(condition, format, ...args)` requires a warning ' + 'message argument');
- }
-
- if (format.indexOf('Failed Composite propType: ') === 0) {
- return; // Ignore CompositeComponent proptype check.
- }
-
- if (!condition) {
- for (var _len2 = arguments.length, args = Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) {
- args[_key2 - 2] = arguments[_key2];
- }
-
- printWarning.apply(undefined, [format].concat(args));
- }
- };
-}
-
-module.exports = warning;
-/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(1)))
-
-/***/ }),
-/* 10 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-
-
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
-exports.updateLoggedInChannel = updateLoggedInChannel;
-
-var _channel_action_types = __webpack_require__(34);
-
-var actions = _interopRequireWildcard(_channel_action_types);
-
-function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
-
-// export action creators
-
-function updateLoggedInChannel(name, shortId, longId) {
- return {
- type: actions.CHANNEL_UPDATE,
- name: name,
- shortId: shortId,
- longId: longId
- };
-};
-
-/***/ }),
-/* 11 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-
-
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
-exports.default = request;
-/**
- * Parses the JSON returned by a network request
- *
- * @param {object} response A response from a network request
- *
- * @return {object} The parsed JSON from the request
- */
-function parseJSON(response) {
- if (response.status === 204 || response.status === 205) {
- return null;
- }
- return response.json();
-}
-
-/**
- * Checks if a network request came back fine, and throws an error if not
- *
- * @param {object} response A response from a network request
- *
- * @return {object|undefined} Returns either the response, or throws an error
- */
-function checkStatus(response) {
- if (response.status >= 200 && response.status < 300) {
- return response;
- }
-
- var error = new Error(response.statusText);
- error.response = response;
- throw error;
-}
-
-/**
- * Requests a URL, returning a promise
- *
- * @param {string} url The URL we want to request
- * @param {object} [options] The options we want to pass to "fetch"
- *
- * @return {object} The response data
- */
-function request(url, options) {
- return fetch(url, options).then(checkStatus).then(parseJSON);
-}
-
-/***/ }),
-/* 12 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-/* WEBPACK VAR INJECTION */(function(process) {/**
- * Copyright (c) 2013-present, Facebook, Inc.
- *
- * This source code is licensed under the MIT license found in the
- * LICENSE file in the root directory of this source tree.
- */
-
-
-
-if (process.env.NODE_ENV !== 'production') {
- var invariant = __webpack_require__(7);
- var warning = __webpack_require__(9);
- var ReactPropTypesSecret = __webpack_require__(13);
- var loggedTypeFailures = {};
-}
-
-/**
- * Assert that the values match with the type specs.
- * Error messages are memorized and will only be shown once.
- *
- * @param {object} typeSpecs Map of name to a ReactPropType
- * @param {object} values Runtime values that need to be type-checked
- * @param {string} location e.g. "prop", "context", "child context"
- * @param {string} componentName Name of the component for error messages.
- * @param {?Function} getStack Returns the component stack.
- * @private
- */
-function checkPropTypes(typeSpecs, values, location, componentName, getStack) {
- if (process.env.NODE_ENV !== 'production') {
- for (var typeSpecName in typeSpecs) {
- if (typeSpecs.hasOwnProperty(typeSpecName)) {
- var error;
- // Prop type validation may throw. In case they do, we don't want to
- // fail the render phase where it didn't fail before. So we log it.
- // After these have been cleaned up, we'll let them throw.
- try {
- // This is intentionally an invariant that gets caught. It's the same
- // behavior as without this statement except with a better message.
- invariant(typeof typeSpecs[typeSpecName] === 'function', '%s: %s type `%s` is invalid; it must be a function, usually from ' + 'the `prop-types` package, but received `%s`.', componentName || 'React class', location, typeSpecName, typeof typeSpecs[typeSpecName]);
- error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret);
- } catch (ex) {
- error = ex;
- }
- warning(!error || error instanceof Error, '%s: type specification of %s `%s` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a %s. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).', componentName || 'React class', location, typeSpecName, typeof error);
- if (error instanceof Error && !(error.message in loggedTypeFailures)) {
- // Only monitor this failure once because there tends to be a lot of the
- // same error.
- loggedTypeFailures[error.message] = true;
-
- var stack = getStack ? getStack() : '';
-
- warning(false, 'Failed %s type: %s%s', location, error.message, stack != null ? stack : '');
- }
- }
- }
- }
-}
-
-module.exports = checkPropTypes;
-
-/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(1)))
-
-/***/ }),
-/* 13 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-/**
- * Copyright (c) 2013-present, Facebook, Inc.
- *
- * This source code is licensed under the MIT license found in the
- * LICENSE file in the root directory of this source tree.
- */
-
-
-
-var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
-
-module.exports = ReactPropTypesSecret;
-
-
-/***/ }),
-/* 14 */
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
-
-"use strict";
-/* harmony export (immutable) */ __webpack_exports__["a"] = warning;
-/**
- * Prints a warning in the console if it exists.
- *
- * @param {String} message The warning message.
- * @returns {void}
- */
-function warning(message) {
- /* eslint-disable no-console */
- if (typeof console !== 'undefined' && typeof console.error === 'function') {
- console.error(message);
- }
- /* eslint-enable no-console */
- try {
- // This error was thrown as a convenience so that if you enable
- // "break on all exceptions" in your console,
- // it would pause the execution at this line.
- throw new Error(message);
- /* eslint-disable no-empty */
- } catch (e) {}
- /* eslint-enable no-empty */
-}
-
-/***/ }),
-/* 15 */
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
-
-"use strict";
-Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
-/* WEBPACK VAR INJECTION */(function(process) {/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__createStore__ = __webpack_require__(25);
-/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__combineReducers__ = __webpack_require__(73);
-/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__bindActionCreators__ = __webpack_require__(74);
-/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__applyMiddleware__ = __webpack_require__(75);
-/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__compose__ = __webpack_require__(29);
-/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__utils_warning__ = __webpack_require__(28);
-/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "createStore", function() { return __WEBPACK_IMPORTED_MODULE_0__createStore__["b"]; });
-/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "combineReducers", function() { return __WEBPACK_IMPORTED_MODULE_1__combineReducers__["a"]; });
-/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "bindActionCreators", function() { return __WEBPACK_IMPORTED_MODULE_2__bindActionCreators__["a"]; });
-/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "applyMiddleware", function() { return __WEBPACK_IMPORTED_MODULE_3__applyMiddleware__["a"]; });
-/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "compose", function() { return __WEBPACK_IMPORTED_MODULE_4__compose__["a"]; });
-
-
-
-
-
-
-
-/*
-* This is a dummy function to check if the function name has been altered by minification.
-* If the function has been minified and NODE_ENV !== 'production', warn the user.
-*/
-function isCrushed() {}
-
-if (process.env.NODE_ENV !== 'production' && typeof isCrushed.name === 'string' && isCrushed.name !== 'isCrushed') {
- Object(__WEBPACK_IMPORTED_MODULE_5__utils_warning__["a" /* default */])('You are currently using minified code outside of NODE_ENV === \'production\'. ' + 'This means that you are running a slower development build of Redux. ' + 'You can use loose-envify (https://github.com/zertosh/loose-envify) for browserify ' + 'or DefinePlugin for webpack (http://stackoverflow.com/questions/30030031) ' + 'to ensure you have the correct code for your production build.');
-}
-
-
-/* WEBPACK VAR INJECTION */}.call(__webpack_exports__, __webpack_require__(1)))
-
-/***/ }),
-/* 16 */
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
-
-"use strict";
-/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__baseGetTag_js__ = __webpack_require__(61);
-/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__getPrototype_js__ = __webpack_require__(66);
-/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__isObjectLike_js__ = __webpack_require__(68);
-
-
-
-
-/** `Object#toString` result references. */
-var objectTag = '[object Object]';
-
-/** Used for built-in method references. */
-var funcProto = Function.prototype,
- objectProto = Object.prototype;
-
-/** Used to resolve the decompiled source of functions. */
-var funcToString = funcProto.toString;
-
-/** Used to check objects for own properties. */
-var hasOwnProperty = objectProto.hasOwnProperty;
-
-/** Used to infer the `Object` constructor. */
-var objectCtorString = funcToString.call(Object);
-
-/**
- * Checks if `value` is a plain object, that is, an object created by the
- * `Object` constructor or one with a `[[Prototype]]` of `null`.
- *
- * @static
- * @memberOf _
- * @since 0.8.0
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.
- * @example
- *
- * function Foo() {
- * this.a = 1;
- * }
- *
- * _.isPlainObject(new Foo);
- * // => false
- *
- * _.isPlainObject([1, 2, 3]);
- * // => false
- *
- * _.isPlainObject({ 'x': 0, 'y': 0 });
- * // => true
- *
- * _.isPlainObject(Object.create(null));
- * // => true
- */
-function isPlainObject(value) {
- if (!Object(__WEBPACK_IMPORTED_MODULE_2__isObjectLike_js__["a" /* default */])(value) || Object(__WEBPACK_IMPORTED_MODULE_0__baseGetTag_js__["a" /* default */])(value) != objectTag) {
- return false;
- }
- var proto = Object(__WEBPACK_IMPORTED_MODULE_1__getPrototype_js__["a" /* default */])(value);
- if (proto === null) {
- return true;
- }
- var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;
- return typeof Ctor == 'function' && Ctor instanceof Ctor &&
- funcToString.call(Ctor) == objectCtorString;
-}
-
-/* harmony default export */ __webpack_exports__["a"] = (isPlainObject);
-
-
-/***/ }),
-/* 17 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-/**
- * Copyright (c) 2013-present, Facebook, Inc.
- *
- * This source code is licensed under the MIT license found in the
- * LICENSE file in the root directory of this source tree.
- *
- */
-
-
-
-var canUseDOM = !!(typeof window !== 'undefined' && window.document && window.document.createElement);
-
-/**
- * Simple, lightweight module assisting with the detection and context of
- * Worker. Helps avoid circular dependencies and allows code to reason about
- * whether or not they are in a Worker, even if they never include the main
- * `ReactWorker` dependency.
- */
-var ExecutionEnvironment = {
-
- canUseDOM: canUseDOM,
-
- canUseWorkers: typeof Worker !== 'undefined',
-
- canUseEventListeners: canUseDOM && !!(window.addEventListener || window.attachEvent),
-
- canUseViewport: canUseDOM && !!window.screen,
-
- isInWorker: !canUseDOM // For now, this is true - might change in the future.
-
-};
-
-module.exports = ExecutionEnvironment;
-
-/***/ }),
-/* 18 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-/* WEBPACK VAR INJECTION */(function(process) {
-
-/**
- * Copyright (c) 2013-present, Facebook, Inc.
- *
- * This source code is licensed under the MIT license found in the
- * LICENSE file in the root directory of this source tree.
- *
- * @typechecks
- */
-
-var emptyFunction = __webpack_require__(4);
-
-/**
- * Upstream version of event listener. Does not take into account specific
- * nature of platform.
- */
-var EventListener = {
- /**
- * Listen to DOM events during the bubble phase.
- *
- * @param {DOMEventTarget} target DOM element to register listener on.
- * @param {string} eventType Event type, e.g. 'click' or 'mouseover'.
- * @param {function} callback Callback function.
- * @return {object} Object with a `remove` method.
- */
- listen: function listen(target, eventType, callback) {
- if (target.addEventListener) {
- target.addEventListener(eventType, callback, false);
- return {
- remove: function remove() {
- target.removeEventListener(eventType, callback, false);
- }
- };
- } else if (target.attachEvent) {
- target.attachEvent('on' + eventType, callback);
- return {
- remove: function remove() {
- target.detachEvent('on' + eventType, callback);
- }
- };
- }
- },
-
- /**
- * Listen to DOM events during the capture phase.
- *
- * @param {DOMEventTarget} target DOM element to register listener on.
- * @param {string} eventType Event type, e.g. 'click' or 'mouseover'.
- * @param {function} callback Callback function.
- * @return {object} Object with a `remove` method.
- */
- capture: function capture(target, eventType, callback) {
- if (target.addEventListener) {
- target.addEventListener(eventType, callback, true);
- return {
- remove: function remove() {
- target.removeEventListener(eventType, callback, true);
- }
- };
- } else {
- if (process.env.NODE_ENV !== 'production') {
- console.error('Attempted to listen to events during the capture phase on a ' + 'browser that does not support the capture phase. Your application ' + 'will not receive some events.');
- }
- return {
- remove: emptyFunction
- };
- }
- },
-
- registerDefault: function registerDefault() {}
-};
-
-module.exports = EventListener;
-/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(1)))
-
-/***/ }),
-/* 19 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-
-
-/**
- * Copyright (c) 2013-present, Facebook, Inc.
- *
- * This source code is licensed under the MIT license found in the
- * LICENSE file in the root directory of this source tree.
- *
- * @typechecks
- */
-
-/* eslint-disable fb-www/typeof-undefined */
-
-/**
- * Same as document.activeElement but wraps in a try-catch block. In IE it is
- * not safe to call document.activeElement if there is nothing focused.
- *
- * The activeElement will be null only if the document or document body is not
- * yet defined.
- *
- * @param {?DOMDocument} doc Defaults to current document.
- * @return {?DOMElement}
- */
-function getActiveElement(doc) /*?DOMElement*/{
- doc = doc || (typeof document !== 'undefined' ? document : undefined);
- if (typeof doc === 'undefined') {
- return null;
- }
- try {
- return doc.activeElement || doc.body;
- } catch (e) {
- return doc.body;
- }
-}
-
-module.exports = getActiveElement;
-
-/***/ }),
-/* 20 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-/**
- * Copyright (c) 2013-present, Facebook, Inc.
- *
- * This source code is licensed under the MIT license found in the
- * LICENSE file in the root directory of this source tree.
- *
- * @typechecks
- *
- */
-
-/*eslint-disable no-self-compare */
-
-
-
-var hasOwnProperty = Object.prototype.hasOwnProperty;
-
-/**
- * inlined Object.is polyfill to avoid requiring consumers ship their own
- * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is
- */
-function is(x, y) {
- // SameValue algorithm
- if (x === y) {
- // Steps 1-5, 7-10
- // Steps 6.b-6.e: +0 != -0
- // Added the nonzero y check to make Flow happy, but it is redundant
- return x !== 0 || y !== 0 || 1 / x === 1 / y;
- } else {
- // Step 6.a: NaN == NaN
- return x !== x && y !== y;
- }
-}
-
-/**
- * Performs equality by iterating through keys on an object and returning false
- * when any key has values which are not strictly equal between the arguments.
- * Returns true when the values of all keys are strictly equal.
- */
-function shallowEqual(objA, objB) {
- if (is(objA, objB)) {
- return true;
- }
-
- if (typeof objA !== 'object' || objA === null || typeof objB !== 'object' || objB === null) {
- return false;
- }
-
- var keysA = Object.keys(objA);
- var keysB = Object.keys(objB);
-
- if (keysA.length !== keysB.length) {
- return false;
- }
-
- // Test for A's keys different from B.
- for (var i = 0; i < keysA.length; i++) {
- if (!hasOwnProperty.call(objB, keysA[i]) || !is(objA[keysA[i]], objB[keysA[i]])) {
- return false;
- }
- }
-
- return true;
-}
-
-module.exports = shallowEqual;
-
-/***/ }),
-/* 21 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-
-
-/**
- * Copyright (c) 2013-present, Facebook, Inc.
- *
- * This source code is licensed under the MIT license found in the
- * LICENSE file in the root directory of this source tree.
- *
- *
- */
-
-var isTextNode = __webpack_require__(45);
-
-/*eslint-disable no-bitwise */
-
-/**
- * Checks if a given DOM node contains or is another DOM node.
- */
-function containsNode(outerNode, innerNode) {
- if (!outerNode || !innerNode) {
- return false;
- } else if (outerNode === innerNode) {
- return true;
- } else if (isTextNode(outerNode)) {
- return false;
- } else if (isTextNode(innerNode)) {
- return containsNode(outerNode, innerNode.parentNode);
- } else if ('contains' in outerNode) {
- return outerNode.contains(innerNode);
- } else if (outerNode.compareDocumentPosition) {
- return !!(outerNode.compareDocumentPosition(innerNode) & 16);
- } else {
- return false;
- }
-}
-
-module.exports = containsNode;
-
-/***/ }),
-/* 22 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-/**
- * Copyright (c) 2013-present, Facebook, Inc.
- *
- * This source code is licensed under the MIT license found in the
- * LICENSE file in the root directory of this source tree.
- *
- */
-
-
-
-/**
- * @param {DOMElement} node input/textarea to focus
- */
-
-function focusNode(node) {
- // IE8 can throw "Can't move focus to the control because it is invisible,
- // not enabled, or of a type that does not accept the focus." for all kinds of
- // reasons that are too expensive and fragile to test.
- try {
- node.focus();
- } catch (e) {}
-}
-
-module.exports = focusNode;
-
-/***/ }),
-/* 23 */
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
-
-"use strict";
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return subscriptionShape; });
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return storeShape; });
-/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_prop_types__ = __webpack_require__(5);
-/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_prop_types__);
-
-
-var subscriptionShape = __WEBPACK_IMPORTED_MODULE_0_prop_types___default.a.shape({
- trySubscribe: __WEBPACK_IMPORTED_MODULE_0_prop_types___default.a.func.isRequired,
- tryUnsubscribe: __WEBPACK_IMPORTED_MODULE_0_prop_types___default.a.func.isRequired,
- notifyNestedSubs: __WEBPACK_IMPORTED_MODULE_0_prop_types___default.a.func.isRequired,
- isSubscribed: __WEBPACK_IMPORTED_MODULE_0_prop_types___default.a.func.isRequired
-});
-
-var storeShape = __WEBPACK_IMPORTED_MODULE_0_prop_types___default.a.shape({
- subscribe: __WEBPACK_IMPORTED_MODULE_0_prop_types___default.a.func.isRequired,
- dispatch: __WEBPACK_IMPORTED_MODULE_0_prop_types___default.a.func.isRequired,
- getState: __WEBPACK_IMPORTED_MODULE_0_prop_types___default.a.func.isRequired
-});
-
-/***/ }),
-/* 24 */
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
-
-"use strict";
-/* WEBPACK VAR INJECTION */(function(process) {/* harmony export (immutable) */ __webpack_exports__["a"] = connectAdvanced;
-/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_hoist_non_react_statics__ = __webpack_require__(55);
-/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_hoist_non_react_statics___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_hoist_non_react_statics__);
-/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_invariant__ = __webpack_require__(56);
-/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_invariant___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_invariant__);
-/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_react__ = __webpack_require__(0);
-/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_react__);
-/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__utils_Subscription__ = __webpack_require__(57);
-/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__utils_PropTypes__ = __webpack_require__(23);
-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 _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; }
-
-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; }
-
-
-
-
-
-
-
-
-var hotReloadingVersion = 0;
-var dummyState = {};
-function noop() {}
-function makeSelectorStateful(sourceSelector, store) {
- // wrap the selector in an object that tracks its results between runs.
- var selector = {
- run: function runComponentSelector(props) {
- try {
- var nextProps = sourceSelector(store.getState(), props);
- if (nextProps !== selector.props || selector.error) {
- selector.shouldComponentUpdate = true;
- selector.props = nextProps;
- selector.error = null;
- }
- } catch (error) {
- selector.shouldComponentUpdate = true;
- selector.error = error;
- }
- }
- };
-
- return selector;
-}
-
-function connectAdvanced(
-/*
- selectorFactory is a func that is responsible for returning the selector function used to
- compute new props from state, props, and dispatch. For example:
- export default connectAdvanced((dispatch, options) => (state, props) => ({
- thing: state.things[props.thingId],
- saveThing: fields => dispatch(actionCreators.saveThing(props.thingId, fields)),
- }))(YourComponent)
- Access to dispatch is provided to the factory so selectorFactories can bind actionCreators
- outside of their selector as an optimization. Options passed to connectAdvanced are passed to
- the selectorFactory, along with displayName and WrappedComponent, as the second argument.
- Note that selectorFactory is responsible for all caching/memoization of inbound and outbound
- props. Do not use connectAdvanced directly without memoizing results between calls to your
- selector, otherwise the Connect component will re-render on every state or props change.
-*/
-selectorFactory) {
- var _contextTypes, _childContextTypes;
-
- var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
- _ref$getDisplayName = _ref.getDisplayName,
- getDisplayName = _ref$getDisplayName === undefined ? function (name) {
- return 'ConnectAdvanced(' + name + ')';
- } : _ref$getDisplayName,
- _ref$methodName = _ref.methodName,
- methodName = _ref$methodName === undefined ? 'connectAdvanced' : _ref$methodName,
- _ref$renderCountProp = _ref.renderCountProp,
- renderCountProp = _ref$renderCountProp === undefined ? undefined : _ref$renderCountProp,
- _ref$shouldHandleStat = _ref.shouldHandleStateChanges,
- shouldHandleStateChanges = _ref$shouldHandleStat === undefined ? true : _ref$shouldHandleStat,
- _ref$storeKey = _ref.storeKey,
- storeKey = _ref$storeKey === undefined ? 'store' : _ref$storeKey,
- _ref$withRef = _ref.withRef,
- withRef = _ref$withRef === undefined ? false : _ref$withRef,
- connectOptions = _objectWithoutProperties(_ref, ['getDisplayName', 'methodName', 'renderCountProp', 'shouldHandleStateChanges', 'storeKey', 'withRef']);
-
- var subscriptionKey = storeKey + 'Subscription';
- var version = hotReloadingVersion++;
-
- var contextTypes = (_contextTypes = {}, _contextTypes[storeKey] = __WEBPACK_IMPORTED_MODULE_4__utils_PropTypes__["a" /* storeShape */], _contextTypes[subscriptionKey] = __WEBPACK_IMPORTED_MODULE_4__utils_PropTypes__["b" /* subscriptionShape */], _contextTypes);
- var childContextTypes = (_childContextTypes = {}, _childContextTypes[subscriptionKey] = __WEBPACK_IMPORTED_MODULE_4__utils_PropTypes__["b" /* subscriptionShape */], _childContextTypes);
-
- return function wrapWithConnect(WrappedComponent) {
- __WEBPACK_IMPORTED_MODULE_1_invariant___default()(typeof WrappedComponent == 'function', 'You must pass a component to the function returned by ' + ('connect. Instead received ' + JSON.stringify(WrappedComponent)));
-
- var wrappedComponentName = WrappedComponent.displayName || WrappedComponent.name || 'Component';
-
- var displayName = getDisplayName(wrappedComponentName);
-
- var selectorFactoryOptions = _extends({}, connectOptions, {
- getDisplayName: getDisplayName,
- methodName: methodName,
- renderCountProp: renderCountProp,
- shouldHandleStateChanges: shouldHandleStateChanges,
- storeKey: storeKey,
- withRef: withRef,
- displayName: displayName,
- wrappedComponentName: wrappedComponentName,
- WrappedComponent: WrappedComponent
- });
-
- var Connect = function (_Component) {
- _inherits(Connect, _Component);
-
- function Connect(props, context) {
- _classCallCheck(this, Connect);
-
- var _this = _possibleConstructorReturn(this, _Component.call(this, props, context));
-
- _this.version = version;
- _this.state = {};
- _this.renderCount = 0;
- _this.store = props[storeKey] || context[storeKey];
- _this.propsMode = Boolean(props[storeKey]);
- _this.setWrappedInstance = _this.setWrappedInstance.bind(_this);
-
- __WEBPACK_IMPORTED_MODULE_1_invariant___default()(_this.store, 'Could not find "' + storeKey + '" in either the context or props of ' + ('"' + displayName + '". Either wrap the root component in a , ') + ('or explicitly pass "' + storeKey + '" as a prop to "' + displayName + '".'));
-
- _this.initSelector();
- _this.initSubscription();
- return _this;
- }
-
- Connect.prototype.getChildContext = function getChildContext() {
- var _ref2;
-
- // If this component received store from props, its subscription should be transparent
- // to any descendants receiving store+subscription from context; it passes along
- // subscription passed to it. Otherwise, it shadows the parent subscription, which allows
- // Connect to control ordering of notifications to flow top-down.
- var subscription = this.propsMode ? null : this.subscription;
- return _ref2 = {}, _ref2[subscriptionKey] = subscription || this.context[subscriptionKey], _ref2;
- };
-
- Connect.prototype.componentDidMount = function componentDidMount() {
- if (!shouldHandleStateChanges) return;
-
- // componentWillMount fires during server side rendering, but componentDidMount and
- // componentWillUnmount do not. Because of this, trySubscribe happens during ...didMount.
- // Otherwise, unsubscription would never take place during SSR, causing a memory leak.
- // To handle the case where a child component may have triggered a state change by
- // dispatching an action in its componentWillMount, we have to re-run the select and maybe
- // re-render.
- this.subscription.trySubscribe();
- this.selector.run(this.props);
- if (this.selector.shouldComponentUpdate) this.forceUpdate();
- };
-
- Connect.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) {
- this.selector.run(nextProps);
- };
-
- Connect.prototype.shouldComponentUpdate = function shouldComponentUpdate() {
- return this.selector.shouldComponentUpdate;
- };
-
- Connect.prototype.componentWillUnmount = function componentWillUnmount() {
- if (this.subscription) this.subscription.tryUnsubscribe();
- this.subscription = null;
- this.notifyNestedSubs = noop;
- this.store = null;
- this.selector.run = noop;
- this.selector.shouldComponentUpdate = false;
- };
-
- Connect.prototype.getWrappedInstance = function getWrappedInstance() {
- __WEBPACK_IMPORTED_MODULE_1_invariant___default()(withRef, 'To access the wrapped instance, you need to specify ' + ('{ withRef: true } in the options argument of the ' + methodName + '() call.'));
- return this.wrappedInstance;
- };
-
- Connect.prototype.setWrappedInstance = function setWrappedInstance(ref) {
- this.wrappedInstance = ref;
- };
-
- Connect.prototype.initSelector = function initSelector() {
- var sourceSelector = selectorFactory(this.store.dispatch, selectorFactoryOptions);
- this.selector = makeSelectorStateful(sourceSelector, this.store);
- this.selector.run(this.props);
- };
-
- Connect.prototype.initSubscription = function initSubscription() {
- if (!shouldHandleStateChanges) return;
-
- // parentSub's source should match where store came from: props vs. context. A component
- // connected to the store via props shouldn't use subscription from context, or vice versa.
- var parentSub = (this.propsMode ? this.props : this.context)[subscriptionKey];
- this.subscription = new __WEBPACK_IMPORTED_MODULE_3__utils_Subscription__["a" /* default */](this.store, parentSub, this.onStateChange.bind(this));
-
- // `notifyNestedSubs` is duplicated to handle the case where the component is unmounted in
- // the middle of the notification loop, where `this.subscription` will then be null. An
- // extra null check every change can be avoided by copying the method onto `this` and then
- // replacing it with a no-op on unmount. This can probably be avoided if Subscription's
- // listeners logic is changed to not call listeners that have been unsubscribed in the
- // middle of the notification loop.
- this.notifyNestedSubs = this.subscription.notifyNestedSubs.bind(this.subscription);
- };
-
- Connect.prototype.onStateChange = function onStateChange() {
- this.selector.run(this.props);
-
- if (!this.selector.shouldComponentUpdate) {
- this.notifyNestedSubs();
- } else {
- this.componentDidUpdate = this.notifyNestedSubsOnComponentDidUpdate;
- this.setState(dummyState);
- }
- };
-
- Connect.prototype.notifyNestedSubsOnComponentDidUpdate = function notifyNestedSubsOnComponentDidUpdate() {
- // `componentDidUpdate` is conditionally implemented when `onStateChange` determines it
- // needs to notify nested subs. Once called, it unimplements itself until further state
- // changes occur. Doing it this way vs having a permanent `componentDidUpdate` that does
- // a boolean check every time avoids an extra method call most of the time, resulting
- // in some perf boost.
- this.componentDidUpdate = undefined;
- this.notifyNestedSubs();
- };
-
- Connect.prototype.isSubscribed = function isSubscribed() {
- return Boolean(this.subscription) && this.subscription.isSubscribed();
- };
-
- Connect.prototype.addExtraProps = function addExtraProps(props) {
- if (!withRef && !renderCountProp && !(this.propsMode && this.subscription)) return props;
- // make a shallow copy so that fields added don't leak to the original selector.
- // this is especially important for 'ref' since that's a reference back to the component
- // instance. a singleton memoized selector would then be holding a reference to the
- // instance, preventing the instance from being garbage collected, and that would be bad
- var withExtras = _extends({}, props);
- if (withRef) withExtras.ref = this.setWrappedInstance;
- if (renderCountProp) withExtras[renderCountProp] = this.renderCount++;
- if (this.propsMode && this.subscription) withExtras[subscriptionKey] = this.subscription;
- return withExtras;
- };
-
- Connect.prototype.render = function render() {
- var selector = this.selector;
- selector.shouldComponentUpdate = false;
-
- if (selector.error) {
- throw selector.error;
- } else {
- return Object(__WEBPACK_IMPORTED_MODULE_2_react__["createElement"])(WrappedComponent, this.addExtraProps(selector.props));
- }
- };
-
- return Connect;
- }(__WEBPACK_IMPORTED_MODULE_2_react__["Component"]);
-
- Connect.WrappedComponent = WrappedComponent;
- Connect.displayName = displayName;
- Connect.childContextTypes = childContextTypes;
- Connect.contextTypes = contextTypes;
- Connect.propTypes = contextTypes;
-
- if (process.env.NODE_ENV !== 'production') {
- Connect.prototype.componentWillUpdate = function componentWillUpdate() {
- var _this2 = this;
-
- // We are hot reloading!
- if (this.version !== version) {
- this.version = version;
- this.initSelector();
-
- // If any connected descendants don't hot reload (and resubscribe in the process), their
- // listeners will be lost when we unsubscribe. Unfortunately, by copying over all
- // listeners, this does mean that the old versions of connected descendants will still be
- // notified of state changes; however, their onStateChange function is a no-op so this
- // isn't a huge deal.
- var oldListeners = [];
-
- if (this.subscription) {
- oldListeners = this.subscription.listeners.get();
- this.subscription.tryUnsubscribe();
- }
- this.initSubscription();
- if (shouldHandleStateChanges) {
- this.subscription.trySubscribe();
- oldListeners.forEach(function (listener) {
- return _this2.subscription.listeners.subscribe(listener);
- });
- }
- }
- };
- }
-
- return __WEBPACK_IMPORTED_MODULE_0_hoist_non_react_statics___default()(Connect, WrappedComponent);
- };
-}
-/* WEBPACK VAR INJECTION */}.call(__webpack_exports__, __webpack_require__(1)))
-
-/***/ }),
-/* 25 */
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
-
-"use strict";
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return ActionTypes; });
-/* harmony export (immutable) */ __webpack_exports__["b"] = createStore;
-/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_lodash_es_isPlainObject__ = __webpack_require__(16);
-/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_symbol_observable__ = __webpack_require__(69);
-/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_symbol_observable___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_symbol_observable__);
-
-
-
-/**
- * These are private action types reserved by Redux.
- * For any unknown actions, you must return the current state.
- * If the current state is undefined, you must return the initial state.
- * Do not reference these action types directly in your code.
- */
-var ActionTypes = {
- INIT: '@@redux/INIT'
-
- /**
- * Creates a Redux store that holds the state tree.
- * The only way to change the data in the store is to call `dispatch()` on it.
- *
- * There should only be a single store in your app. To specify how different
- * parts of the state tree respond to actions, you may combine several reducers
- * into a single reducer function by using `combineReducers`.
- *
- * @param {Function} reducer A function that returns the next state tree, given
- * the current state tree and the action to handle.
- *
- * @param {any} [preloadedState] The initial state. You may optionally specify it
- * to hydrate the state from the server in universal apps, or to restore a
- * previously serialized user session.
- * If you use `combineReducers` to produce the root reducer function, this must be
- * an object with the same shape as `combineReducers` keys.
- *
- * @param {Function} [enhancer] The store enhancer. You may optionally specify it
- * to enhance the store with third-party capabilities such as middleware,
- * time travel, persistence, etc. The only store enhancer that ships with Redux
- * is `applyMiddleware()`.
- *
- * @returns {Store} A Redux store that lets you read the state, dispatch actions
- * and subscribe to changes.
- */
-};function createStore(reducer, preloadedState, enhancer) {
- var _ref2;
-
- if (typeof preloadedState === 'function' && typeof enhancer === 'undefined') {
- enhancer = preloadedState;
- preloadedState = undefined;
- }
-
- if (typeof enhancer !== 'undefined') {
- if (typeof enhancer !== 'function') {
- throw new Error('Expected the enhancer to be a function.');
- }
-
- return enhancer(createStore)(reducer, preloadedState);
- }
-
- if (typeof reducer !== 'function') {
- throw new Error('Expected the reducer to be a function.');
- }
-
- var currentReducer = reducer;
- var currentState = preloadedState;
- var currentListeners = [];
- var nextListeners = currentListeners;
- var isDispatching = false;
-
- function ensureCanMutateNextListeners() {
- if (nextListeners === currentListeners) {
- nextListeners = currentListeners.slice();
- }
- }
-
- /**
- * Reads the state tree managed by the store.
- *
- * @returns {any} The current state tree of your application.
- */
- function getState() {
- return currentState;
- }
-
- /**
- * Adds a change listener. It will be called any time an action is dispatched,
- * and some part of the state tree may potentially have changed. You may then
- * call `getState()` to read the current state tree inside the callback.
- *
- * You may call `dispatch()` from a change listener, with the following
- * caveats:
- *
- * 1. The subscriptions are snapshotted just before every `dispatch()` call.
- * If you subscribe or unsubscribe while the listeners are being invoked, this
- * will not have any effect on the `dispatch()` that is currently in progress.
- * However, the next `dispatch()` call, whether nested or not, will use a more
- * recent snapshot of the subscription list.
- *
- * 2. The listener should not expect to see all state changes, as the state
- * might have been updated multiple times during a nested `dispatch()` before
- * the listener is called. It is, however, guaranteed that all subscribers
- * registered before the `dispatch()` started will be called with the latest
- * state by the time it exits.
- *
- * @param {Function} listener A callback to be invoked on every dispatch.
- * @returns {Function} A function to remove this change listener.
- */
- function subscribe(listener) {
- if (typeof listener !== 'function') {
- throw new Error('Expected listener to be a function.');
- }
-
- var isSubscribed = true;
-
- ensureCanMutateNextListeners();
- nextListeners.push(listener);
-
- return function unsubscribe() {
- if (!isSubscribed) {
- return;
- }
-
- isSubscribed = false;
-
- ensureCanMutateNextListeners();
- var index = nextListeners.indexOf(listener);
- nextListeners.splice(index, 1);
- };
- }
-
- /**
- * Dispatches an action. It is the only way to trigger a state change.
- *
- * The `reducer` function, used to create the store, will be called with the
- * current state tree and the given `action`. Its return value will
- * be considered the **next** state of the tree, and the change listeners
- * will be notified.
- *
- * The base implementation only supports plain object actions. If you want to
- * dispatch a Promise, an Observable, a thunk, or something else, you need to
- * wrap your store creating function into the corresponding middleware. For
- * example, see the documentation for the `redux-thunk` package. Even the
- * middleware will eventually dispatch plain object actions using this method.
- *
- * @param {Object} action A plain object representing “what changed”. It is
- * a good idea to keep actions serializable so you can record and replay user
- * sessions, or use the time travelling `redux-devtools`. An action must have
- * a `type` property which may not be `undefined`. It is a good idea to use
- * string constants for action types.
- *
- * @returns {Object} For convenience, the same action object you dispatched.
- *
- * Note that, if you use a custom middleware, it may wrap `dispatch()` to
- * return something else (for example, a Promise you can await).
- */
- function dispatch(action) {
- if (!Object(__WEBPACK_IMPORTED_MODULE_0_lodash_es_isPlainObject__["a" /* default */])(action)) {
- throw new Error('Actions must be plain objects. ' + 'Use custom middleware for async actions.');
- }
-
- if (typeof action.type === 'undefined') {
- throw new Error('Actions may not have an undefined "type" property. ' + 'Have you misspelled a constant?');
- }
-
- if (isDispatching) {
- throw new Error('Reducers may not dispatch actions.');
- }
-
- try {
- isDispatching = true;
- currentState = currentReducer(currentState, action);
- } finally {
- isDispatching = false;
- }
-
- var listeners = currentListeners = nextListeners;
- for (var i = 0; i < listeners.length; i++) {
- var listener = listeners[i];
- listener();
- }
-
- return action;
- }
-
- /**
- * Replaces the reducer currently used by the store to calculate the state.
- *
- * You might need this if your app implements code splitting and you want to
- * load some of the reducers dynamically. You might also need this if you
- * implement a hot reloading mechanism for Redux.
- *
- * @param {Function} nextReducer The reducer for the store to use instead.
- * @returns {void}
- */
- function replaceReducer(nextReducer) {
- if (typeof nextReducer !== 'function') {
- throw new Error('Expected the nextReducer to be a function.');
- }
-
- currentReducer = nextReducer;
- dispatch({ type: ActionTypes.INIT });
- }
-
- /**
- * Interoperability point for observable/reactive libraries.
- * @returns {observable} A minimal observable of state changes.
- * For more information, see the observable proposal:
- * https://github.com/tc39/proposal-observable
- */
- function observable() {
- var _ref;
-
- var outerSubscribe = subscribe;
- return _ref = {
- /**
- * The minimal observable subscription method.
- * @param {Object} observer Any object that can be used as an observer.
- * The observer object should have a `next` method.
- * @returns {subscription} An object with an `unsubscribe` method that can
- * be used to unsubscribe the observable from the store, and prevent further
- * emission of values from the observable.
- */
- subscribe: function subscribe(observer) {
- if (typeof observer !== 'object') {
- throw new TypeError('Expected the observer to be an object.');
- }
-
- function observeState() {
- if (observer.next) {
- observer.next(getState());
- }
- }
-
- observeState();
- var unsubscribe = outerSubscribe(observeState);
- return { unsubscribe: unsubscribe };
- }
- }, _ref[__WEBPACK_IMPORTED_MODULE_1_symbol_observable___default.a] = function () {
- return this;
- }, _ref;
- }
-
- // When a store is created, an "INIT" action is dispatched so that every
- // reducer returns their initial state. This effectively populates
- // the initial state tree.
- dispatch({ type: ActionTypes.INIT });
-
- return _ref2 = {
- dispatch: dispatch,
- subscribe: subscribe,
- getState: getState,
- replaceReducer: replaceReducer
- }, _ref2[__WEBPACK_IMPORTED_MODULE_1_symbol_observable___default.a] = observable, _ref2;
-}
-
-/***/ }),
-/* 26 */
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
-
-"use strict";
-/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__root_js__ = __webpack_require__(62);
-
-
-/** Built-in value references. */
-var Symbol = __WEBPACK_IMPORTED_MODULE_0__root_js__["a" /* default */].Symbol;
-
-/* harmony default export */ __webpack_exports__["a"] = (Symbol);
-
-
-/***/ }),
-/* 27 */
-/***/ (function(module, exports) {
-
-var g;
-
-// This works in non-strict mode
-g = (function() {
- return this;
-})();
-
-try {
- // This works if eval is allowed (see CSP)
- g = g || Function("return this")() || (1,eval)("this");
-} catch(e) {
- // This works if the window reference is available
- if(typeof window === "object")
- g = window;
-}
-
-// g can still be undefined, but nothing to do about it...
-// We return undefined, instead of nothing here, so it's
-// easier to handle this case. if(!global) { ...}
-
-module.exports = g;
-
-
-/***/ }),
-/* 28 */
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
-
-"use strict";
-/* harmony export (immutable) */ __webpack_exports__["a"] = warning;
-/**
- * Prints a warning in the console if it exists.
- *
- * @param {String} message The warning message.
- * @returns {void}
- */
-function warning(message) {
- /* eslint-disable no-console */
- if (typeof console !== 'undefined' && typeof console.error === 'function') {
- console.error(message);
- }
- /* eslint-enable no-console */
- try {
- // This error was thrown as a convenience so that if you enable
- // "break on all exceptions" in your console,
- // it would pause the execution at this line.
- throw new Error(message);
- /* eslint-disable no-empty */
- } catch (e) {}
- /* eslint-enable no-empty */
-}
-
-/***/ }),
-/* 29 */
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
-
-"use strict";
-/* harmony export (immutable) */ __webpack_exports__["a"] = compose;
-/**
- * Composes single-argument functions from right to left. The rightmost
- * function can take multiple arguments as it provides the signature for
- * the resulting composite function.
- *
- * @param {...Function} funcs The functions to compose.
- * @returns {Function} A function obtained by composing the argument functions
- * from right to left. For example, compose(f, g, h) is identical to doing
- * (...args) => f(g(h(...args))).
- */
-
-function compose() {
- for (var _len = arguments.length, funcs = Array(_len), _key = 0; _key < _len; _key++) {
- funcs[_key] = arguments[_key];
- }
-
- if (funcs.length === 0) {
- return function (arg) {
- return arg;
- };
- }
-
- if (funcs.length === 1) {
- return funcs[0];
- }
-
- return funcs.reduce(function (a, b) {
- return function () {
- return a(b.apply(undefined, arguments));
- };
- });
-}
-
-/***/ }),
-/* 30 */
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
-
-"use strict";
-/* WEBPACK VAR INJECTION */(function(process) {/* harmony export (immutable) */ __webpack_exports__["a"] = wrapMapToPropsConstant;
-/* unused harmony export getDependsOnOwnProps */
-/* harmony export (immutable) */ __webpack_exports__["b"] = wrapMapToPropsFunc;
-/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__utils_verifyPlainObject__ = __webpack_require__(31);
-
-
-function wrapMapToPropsConstant(getConstant) {
- return function initConstantSelector(dispatch, options) {
- var constant = getConstant(dispatch, options);
-
- function constantSelector() {
- return constant;
- }
- constantSelector.dependsOnOwnProps = false;
- return constantSelector;
- };
-}
-
-// dependsOnOwnProps is used by createMapToPropsProxy to determine whether to pass props as args
-// to the mapToProps function being wrapped. It is also used by makePurePropsSelector to determine
-// whether mapToProps needs to be invoked when props have changed.
-//
-// A length of one signals that mapToProps does not depend on props from the parent component.
-// A length of zero is assumed to mean mapToProps is getting args via arguments or ...args and
-// therefore not reporting its length accurately..
-function getDependsOnOwnProps(mapToProps) {
- return mapToProps.dependsOnOwnProps !== null && mapToProps.dependsOnOwnProps !== undefined ? Boolean(mapToProps.dependsOnOwnProps) : mapToProps.length !== 1;
-}
-
-// Used by whenMapStateToPropsIsFunction and whenMapDispatchToPropsIsFunction,
-// this function wraps mapToProps in a proxy function which does several things:
-//
-// * Detects whether the mapToProps function being called depends on props, which
-// is used by selectorFactory to decide if it should reinvoke on props changes.
-//
-// * On first call, handles mapToProps if returns another function, and treats that
-// new function as the true mapToProps for subsequent calls.
-//
-// * On first call, verifies the first result is a plain object, in order to warn
-// the developer that their mapToProps function is not returning a valid result.
-//
-function wrapMapToPropsFunc(mapToProps, methodName) {
- return function initProxySelector(dispatch, _ref) {
- var displayName = _ref.displayName;
-
- var proxy = function mapToPropsProxy(stateOrDispatch, ownProps) {
- return proxy.dependsOnOwnProps ? proxy.mapToProps(stateOrDispatch, ownProps) : proxy.mapToProps(stateOrDispatch);
- };
-
- // allow detectFactoryAndVerify to get ownProps
- proxy.dependsOnOwnProps = true;
-
- proxy.mapToProps = function detectFactoryAndVerify(stateOrDispatch, ownProps) {
- proxy.mapToProps = mapToProps;
- proxy.dependsOnOwnProps = getDependsOnOwnProps(mapToProps);
- var props = proxy(stateOrDispatch, ownProps);
-
- if (typeof props === 'function') {
- proxy.mapToProps = props;
- proxy.dependsOnOwnProps = getDependsOnOwnProps(props);
- props = proxy(stateOrDispatch, ownProps);
- }
-
- if (process.env.NODE_ENV !== 'production') Object(__WEBPACK_IMPORTED_MODULE_0__utils_verifyPlainObject__["a" /* default */])(props, displayName, methodName);
-
- return props;
- };
-
- return proxy;
- };
-}
-/* WEBPACK VAR INJECTION */}.call(__webpack_exports__, __webpack_require__(1)))
-
-/***/ }),
-/* 31 */
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
-
-"use strict";
-/* harmony export (immutable) */ __webpack_exports__["a"] = verifyPlainObject;
-/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_lodash_es_isPlainObject__ = __webpack_require__(16);
-/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__warning__ = __webpack_require__(14);
-
-
-
-function verifyPlainObject(value, displayName, methodName) {
- if (!Object(__WEBPACK_IMPORTED_MODULE_0_lodash_es_isPlainObject__["a" /* default */])(value)) {
- Object(__WEBPACK_IMPORTED_MODULE_1__warning__["a" /* default */])(methodName + '() in ' + displayName + ' must return a plain object. Instead received ' + value + '.');
- }
-}
-
-/***/ }),
-/* 32 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-
-
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
-var FILE_SELECTED = exports.FILE_SELECTED = 'FILE_SELECTED';
-var FILE_CLEAR = exports.FILE_CLEAR = 'FILE_CLEAR';
-var METADATA_UPDATE = exports.METADATA_UPDATE = 'METADATA_UPDATE';
-var CLAIM_UPDATE = exports.CLAIM_UPDATE = 'CLAIM_UPDATE';
-var SET_PUBLISH_IN_CHANNEL = exports.SET_PUBLISH_IN_CHANNEL = 'SET_PUBLISH_IN_CHANNEL';
-var PUBLISH_STATUS_UPDATE = exports.PUBLISH_STATUS_UPDATE = 'PUBLISH_STATUS_UPDATE';
-var ERROR_UPDATE = exports.ERROR_UPDATE = 'ERROR_UPDATE';
-var SELECTED_CHANNEL_UPDATE = exports.SELECTED_CHANNEL_UPDATE = 'SELECTED_CHANNEL_UPDATE';
-var TOGGLE_METADATA_INPUTS = exports.TOGGLE_METADATA_INPUTS = 'TOGGLE_METADATA_INPUTS';
-
-/***/ }),
-/* 33 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-
-
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
-var LOGIN = exports.LOGIN = 'Existing';
-var CREATE = exports.CREATE = 'New';
-
-/***/ }),
-/* 34 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-
-
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
-var CHANNEL_UPDATE = exports.CHANNEL_UPDATE = 'CHANNEL_UPDATE';
-
-/***/ }),
-/* 35 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-
-
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
-
-var _reactRedux = __webpack_require__(2);
-
-var _publish = __webpack_require__(3);
-
-var _view = __webpack_require__(85);
-
-var _view2 = _interopRequireDefault(_view);
-
-function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-
-var mapStateToProps = function mapStateToProps(_ref) {
- var publish = _ref.publish;
-
- return {
- file: publish.file,
- thumbnail: publish.metadata.thumbnail,
- fileError: publish.error.file
- };
-};
-
-var mapDispatchToProps = function mapDispatchToProps(dispatch) {
- return {
- onFileSelect: function onFileSelect(file) {
- dispatch((0, _publish.selectFile)(file));
- dispatch((0, _publish.updateError)('publishSubmit', null));
- },
- onFileError: function onFileError(value) {
- dispatch((0, _publish.updateError)('file', value));
- }
- };
-};
-
-exports.default = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)(_view2.default);
-
-/***/ }),
-/* 36 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-
-
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
-
-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 = __webpack_require__(0);
-
-var _react2 = _interopRequireDefault(_react);
-
-var _propTypes = __webpack_require__(5);
-
-var _propTypes2 = _interopRequireDefault(_propTypes);
-
-var _ActiveStatusBar = __webpack_require__(106);
-
-var _ActiveStatusBar2 = _interopRequireDefault(_ActiveStatusBar);
-
-var _InactiveStatusBar = __webpack_require__(107);
-
-var _InactiveStatusBar2 = _interopRequireDefault(_InactiveStatusBar);
-
-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; }
-
-var ProgressBar = function (_React$Component) {
- _inherits(ProgressBar, _React$Component);
-
- function ProgressBar(props) {
- _classCallCheck(this, ProgressBar);
-
- var _this = _possibleConstructorReturn(this, (ProgressBar.__proto__ || Object.getPrototypeOf(ProgressBar)).call(this, props));
-
- _this.state = {
- bars: [],
- index: 0,
- incrementer: 1
- };
- _this.createBars = _this.createBars.bind(_this);
- _this.startProgressBar = _this.startProgressBar.bind(_this);
- _this.updateProgressBar = _this.updateProgressBar.bind(_this);
- _this.stopProgressBar = _this.stopProgressBar.bind(_this);
- return _this;
- }
-
- _createClass(ProgressBar, [{
- key: 'componentDidMount',
- value: function componentDidMount() {
- this.createBars();
- this.startProgressBar();
- }
- }, {
- key: 'componentWillUnmount',
- value: function componentWillUnmount() {
- this.stopProgressBar();
- }
- }, {
- key: 'createBars',
- value: function createBars() {
- var bars = [];
- for (var i = 0; i <= this.props.size; i++) {
- bars.push({ isActive: false });
- }
- this.setState({ bars: bars });
- }
- }, {
- key: 'startProgressBar',
- value: function startProgressBar() {
- this.updateInterval = setInterval(this.updateProgressBar.bind(this), 300);
- }
- }, {
- key: 'updateProgressBar',
- value: function updateProgressBar() {
- var index = this.state.index;
- var incrementer = this.state.incrementer;
- var bars = this.state.bars;
- // flip incrementer if necessary, to stay in bounds
- if (index < 0 || index > this.props.size) {
- incrementer = incrementer * -1;
- index += incrementer;
- }
- // update the indexed bar
- if (incrementer > 0) {
- bars[index].isActive = true;
- } else {
- bars[index].isActive = false;
- };
- // increment index
- index += incrementer;
- // update state
- this.setState({
- bars: bars,
- incrementer: incrementer,
- index: index
- });
- }
- }, {
- key: 'stopProgressBar',
- value: function stopProgressBar() {
- clearInterval(this.updateInterval);
- }
- }, {
- key: 'render',
- value: function render() {
- return _react2.default.createElement(
- 'div',
- null,
- this.state.bars.map(function (bar, index) {
- return bar.isActive ? _react2.default.createElement(_ActiveStatusBar2.default, { key: index }) : _react2.default.createElement(_InactiveStatusBar2.default, { key: index });
- })
- );
- }
- }]);
-
- return ProgressBar;
-}(_react2.default.Component);
-
-;
-
-ProgressBar.propTypes = {
- size: _propTypes2.default.number.isRequired
-};
-
-exports.default = ProgressBar;
-
-/***/ }),
-/* 37 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-
-
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
-var LOAD_START = exports.LOAD_START = 'LOAD_START';
-var LOADING = exports.LOADING = 'LOADING';
-var PUBLISHING = exports.PUBLISHING = 'PUBLISHING';
-var SUCCESS = exports.SUCCESS = 'SUCCESS';
-var FAILED = exports.FAILED = 'FAILED';
-
-/***/ }),
-/* 38 */
-/***/ (function(module, exports, __webpack_require__) {
-
-__webpack_require__(39);
-module.exports = __webpack_require__(40);
-
-
-/***/ }),
-/* 39 */
-/***/ (function(module, exports) {
-
-(function(self) {
- 'use strict';
-
- if (self.fetch) {
- return
- }
-
- var support = {
- searchParams: 'URLSearchParams' in self,
- iterable: 'Symbol' in self && 'iterator' in Symbol,
- blob: 'FileReader' in self && 'Blob' in self && (function() {
- try {
- new Blob()
- return true
- } catch(e) {
- return false
- }
- })(),
- formData: 'FormData' in self,
- arrayBuffer: 'ArrayBuffer' in self
- }
-
- if (support.arrayBuffer) {
- var viewClasses = [
- '[object Int8Array]',
- '[object Uint8Array]',
- '[object Uint8ClampedArray]',
- '[object Int16Array]',
- '[object Uint16Array]',
- '[object Int32Array]',
- '[object Uint32Array]',
- '[object Float32Array]',
- '[object Float64Array]'
- ]
-
- var isDataView = function(obj) {
- return obj && DataView.prototype.isPrototypeOf(obj)
- }
-
- var isArrayBufferView = ArrayBuffer.isView || function(obj) {
- return obj && viewClasses.indexOf(Object.prototype.toString.call(obj)) > -1
- }
- }
-
- function normalizeName(name) {
- if (typeof name !== 'string') {
- name = String(name)
- }
- if (/[^a-z0-9\-#$%&'*+.\^_`|~]/i.test(name)) {
- throw new TypeError('Invalid character in header field name')
- }
- return name.toLowerCase()
- }
-
- function normalizeValue(value) {
- if (typeof value !== 'string') {
- value = String(value)
- }
- return value
- }
-
- // Build a destructive iterator for the value list
- function iteratorFor(items) {
- var iterator = {
- next: function() {
- var value = items.shift()
- return {done: value === undefined, value: value}
- }
- }
-
- if (support.iterable) {
- iterator[Symbol.iterator] = function() {
- return iterator
- }
- }
-
- return iterator
- }
-
- function Headers(headers) {
- this.map = {}
-
- if (headers instanceof Headers) {
- headers.forEach(function(value, name) {
- this.append(name, value)
- }, this)
- } else if (Array.isArray(headers)) {
- headers.forEach(function(header) {
- this.append(header[0], header[1])
- }, this)
- } else if (headers) {
- Object.getOwnPropertyNames(headers).forEach(function(name) {
- this.append(name, headers[name])
- }, this)
- }
- }
-
- Headers.prototype.append = function(name, value) {
- name = normalizeName(name)
- value = normalizeValue(value)
- var oldValue = this.map[name]
- this.map[name] = oldValue ? oldValue+','+value : value
- }
-
- Headers.prototype['delete'] = function(name) {
- delete this.map[normalizeName(name)]
- }
-
- Headers.prototype.get = function(name) {
- name = normalizeName(name)
- return this.has(name) ? this.map[name] : null
- }
-
- Headers.prototype.has = function(name) {
- return this.map.hasOwnProperty(normalizeName(name))
- }
-
- Headers.prototype.set = function(name, value) {
- this.map[normalizeName(name)] = normalizeValue(value)
- }
-
- Headers.prototype.forEach = function(callback, thisArg) {
- for (var name in this.map) {
- if (this.map.hasOwnProperty(name)) {
- callback.call(thisArg, this.map[name], name, this)
- }
- }
- }
-
- Headers.prototype.keys = function() {
- var items = []
- this.forEach(function(value, name) { items.push(name) })
- return iteratorFor(items)
- }
-
- Headers.prototype.values = function() {
- var items = []
- this.forEach(function(value) { items.push(value) })
- return iteratorFor(items)
- }
-
- Headers.prototype.entries = function() {
- var items = []
- this.forEach(function(value, name) { items.push([name, value]) })
- return iteratorFor(items)
- }
-
- if (support.iterable) {
- Headers.prototype[Symbol.iterator] = Headers.prototype.entries
- }
-
- function consumed(body) {
- if (body.bodyUsed) {
- return Promise.reject(new TypeError('Already read'))
- }
- body.bodyUsed = true
- }
-
- function fileReaderReady(reader) {
- return new Promise(function(resolve, reject) {
- reader.onload = function() {
- resolve(reader.result)
- }
- reader.onerror = function() {
- reject(reader.error)
- }
- })
- }
-
- function readBlobAsArrayBuffer(blob) {
- var reader = new FileReader()
- var promise = fileReaderReady(reader)
- reader.readAsArrayBuffer(blob)
- return promise
- }
-
- function readBlobAsText(blob) {
- var reader = new FileReader()
- var promise = fileReaderReady(reader)
- reader.readAsText(blob)
- return promise
- }
-
- function readArrayBufferAsText(buf) {
- var view = new Uint8Array(buf)
- var chars = new Array(view.length)
-
- for (var i = 0; i < view.length; i++) {
- chars[i] = String.fromCharCode(view[i])
- }
- return chars.join('')
- }
-
- function bufferClone(buf) {
- if (buf.slice) {
- return buf.slice(0)
- } else {
- var view = new Uint8Array(buf.byteLength)
- view.set(new Uint8Array(buf))
- return view.buffer
- }
- }
-
- function Body() {
- this.bodyUsed = false
-
- this._initBody = function(body) {
- this._bodyInit = body
- if (!body) {
- this._bodyText = ''
- } else if (typeof body === 'string') {
- this._bodyText = body
- } else if (support.blob && Blob.prototype.isPrototypeOf(body)) {
- this._bodyBlob = body
- } else if (support.formData && FormData.prototype.isPrototypeOf(body)) {
- this._bodyFormData = body
- } else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) {
- this._bodyText = body.toString()
- } else if (support.arrayBuffer && support.blob && isDataView(body)) {
- this._bodyArrayBuffer = bufferClone(body.buffer)
- // IE 10-11 can't handle a DataView body.
- this._bodyInit = new Blob([this._bodyArrayBuffer])
- } else if (support.arrayBuffer && (ArrayBuffer.prototype.isPrototypeOf(body) || isArrayBufferView(body))) {
- this._bodyArrayBuffer = bufferClone(body)
- } else {
- throw new Error('unsupported BodyInit type')
- }
-
- if (!this.headers.get('content-type')) {
- if (typeof body === 'string') {
- this.headers.set('content-type', 'text/plain;charset=UTF-8')
- } else if (this._bodyBlob && this._bodyBlob.type) {
- this.headers.set('content-type', this._bodyBlob.type)
- } else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) {
- this.headers.set('content-type', 'application/x-www-form-urlencoded;charset=UTF-8')
- }
- }
- }
-
- if (support.blob) {
- this.blob = function() {
- var rejected = consumed(this)
- if (rejected) {
- return rejected
- }
-
- if (this._bodyBlob) {
- return Promise.resolve(this._bodyBlob)
- } else if (this._bodyArrayBuffer) {
- return Promise.resolve(new Blob([this._bodyArrayBuffer]))
- } else if (this._bodyFormData) {
- throw new Error('could not read FormData body as blob')
- } else {
- return Promise.resolve(new Blob([this._bodyText]))
- }
- }
-
- this.arrayBuffer = function() {
- if (this._bodyArrayBuffer) {
- return consumed(this) || Promise.resolve(this._bodyArrayBuffer)
- } else {
- return this.blob().then(readBlobAsArrayBuffer)
- }
- }
- }
-
- this.text = function() {
- var rejected = consumed(this)
- if (rejected) {
- return rejected
- }
-
- if (this._bodyBlob) {
- return readBlobAsText(this._bodyBlob)
- } else if (this._bodyArrayBuffer) {
- return Promise.resolve(readArrayBufferAsText(this._bodyArrayBuffer))
- } else if (this._bodyFormData) {
- throw new Error('could not read FormData body as text')
- } else {
- return Promise.resolve(this._bodyText)
- }
- }
-
- if (support.formData) {
- this.formData = function() {
- return this.text().then(decode)
- }
- }
-
- this.json = function() {
- return this.text().then(JSON.parse)
- }
-
- return this
- }
-
- // HTTP methods whose capitalization should be normalized
- var methods = ['DELETE', 'GET', 'HEAD', 'OPTIONS', 'POST', 'PUT']
-
- function normalizeMethod(method) {
- var upcased = method.toUpperCase()
- return (methods.indexOf(upcased) > -1) ? upcased : method
- }
-
- function Request(input, options) {
- options = options || {}
- var body = options.body
-
- if (input instanceof Request) {
- if (input.bodyUsed) {
- throw new TypeError('Already read')
- }
- this.url = input.url
- this.credentials = input.credentials
- if (!options.headers) {
- this.headers = new Headers(input.headers)
- }
- this.method = input.method
- this.mode = input.mode
- if (!body && input._bodyInit != null) {
- body = input._bodyInit
- input.bodyUsed = true
- }
- } else {
- this.url = String(input)
- }
-
- this.credentials = options.credentials || this.credentials || 'omit'
- if (options.headers || !this.headers) {
- this.headers = new Headers(options.headers)
- }
- this.method = normalizeMethod(options.method || this.method || 'GET')
- this.mode = options.mode || this.mode || null
- this.referrer = null
-
- if ((this.method === 'GET' || this.method === 'HEAD') && body) {
- throw new TypeError('Body not allowed for GET or HEAD requests')
- }
- this._initBody(body)
- }
-
- Request.prototype.clone = function() {
- return new Request(this, { body: this._bodyInit })
- }
-
- function decode(body) {
- var form = new FormData()
- body.trim().split('&').forEach(function(bytes) {
- if (bytes) {
- var split = bytes.split('=')
- var name = split.shift().replace(/\+/g, ' ')
- var value = split.join('=').replace(/\+/g, ' ')
- form.append(decodeURIComponent(name), decodeURIComponent(value))
- }
- })
- return form
- }
-
- function parseHeaders(rawHeaders) {
- var headers = new Headers()
- rawHeaders.split(/\r?\n/).forEach(function(line) {
- var parts = line.split(':')
- var key = parts.shift().trim()
- if (key) {
- var value = parts.join(':').trim()
- headers.append(key, value)
- }
- })
- return headers
- }
-
- Body.call(Request.prototype)
-
- function Response(bodyInit, options) {
- if (!options) {
- options = {}
- }
-
- this.type = 'default'
- this.status = 'status' in options ? options.status : 200
- this.ok = this.status >= 200 && this.status < 300
- this.statusText = 'statusText' in options ? options.statusText : 'OK'
- this.headers = new Headers(options.headers)
- this.url = options.url || ''
- this._initBody(bodyInit)
- }
-
- Body.call(Response.prototype)
-
- Response.prototype.clone = function() {
- return new Response(this._bodyInit, {
- status: this.status,
- statusText: this.statusText,
- headers: new Headers(this.headers),
- url: this.url
- })
- }
-
- Response.error = function() {
- var response = new Response(null, {status: 0, statusText: ''})
- response.type = 'error'
- return response
- }
-
- var redirectStatuses = [301, 302, 303, 307, 308]
-
- Response.redirect = function(url, status) {
- if (redirectStatuses.indexOf(status) === -1) {
- throw new RangeError('Invalid status code')
- }
-
- return new Response(null, {status: status, headers: {location: url}})
- }
-
- self.Headers = Headers
- self.Request = Request
- self.Response = Response
-
- self.fetch = function(input, init) {
- return new Promise(function(resolve, reject) {
- var request = new Request(input, init)
- var xhr = new XMLHttpRequest()
-
- xhr.onload = function() {
- var options = {
- status: xhr.status,
- statusText: xhr.statusText,
- headers: parseHeaders(xhr.getAllResponseHeaders() || '')
- }
- options.url = 'responseURL' in xhr ? xhr.responseURL : options.headers.get('X-Request-URL')
- var body = 'response' in xhr ? xhr.response : xhr.responseText
- resolve(new Response(body, options))
- }
-
- xhr.onerror = function() {
- reject(new TypeError('Network request failed'))
- }
-
- xhr.ontimeout = function() {
- reject(new TypeError('Network request failed'))
- }
-
- xhr.open(request.method, request.url, true)
-
- if (request.credentials === 'include') {
- xhr.withCredentials = true
- }
-
- if ('responseType' in xhr && support.blob) {
- xhr.responseType = 'blob'
- }
-
- request.headers.forEach(function(value, name) {
- xhr.setRequestHeader(name, value)
- })
-
- xhr.send(typeof request._bodyInit === 'undefined' ? null : request._bodyInit)
- })
- }
- self.fetch.polyfill = true
-})(typeof self !== 'undefined' ? self : this);
-
-
-/***/ }),
-/* 40 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-
-
-var _react = __webpack_require__(0);
-
-var _react2 = _interopRequireDefault(_react);
-
-var _reactDom = __webpack_require__(43);
-
-var _reactDom2 = _interopRequireDefault(_reactDom);
-
-var _reactRedux = __webpack_require__(2);
-
-var _redux = __webpack_require__(15);
-
-var _reducers = __webpack_require__(80);
-
-var _reducers2 = _interopRequireDefault(_reducers);
-
-var _PublishTool = __webpack_require__(83);
-
-var _PublishTool2 = _interopRequireDefault(_PublishTool);
-
-var _NavBar = __webpack_require__(109);
-
-var _NavBar2 = _interopRequireDefault(_NavBar);
-
-function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-
-var store = (0, _redux.createStore)(_reducers2.default, window.__REDUX_DEVTOOLS_EXTENSION__ && window.__REDUX_DEVTOOLS_EXTENSION__());
-
-_reactDom2.default.render(_react2.default.createElement(
- _reactRedux.Provider,
- { store: store },
- _react2.default.createElement(_NavBar2.default, null)
-), document.getElementById('react-nav-bar'));
-
-_reactDom2.default.render(_react2.default.createElement(
- _reactRedux.Provider,
- { store: store },
- _react2.default.createElement(_PublishTool2.default, null)
-), document.getElementById('react-publish-tool'));
-
-/***/ }),
-/* 41 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-/** @license React v16.2.0
- * react.production.min.js
- *
- * Copyright (c) 2013-present, Facebook, Inc.
- *
- * This source code is licensed under the MIT license found in the
- * LICENSE file in the root directory of this source tree.
- */
-
-var m=__webpack_require__(6),n=__webpack_require__(8),p=__webpack_require__(4),q="function"===typeof Symbol&&Symbol["for"],r=q?Symbol["for"]("react.element"):60103,t=q?Symbol["for"]("react.call"):60104,u=q?Symbol["for"]("react.return"):60105,v=q?Symbol["for"]("react.portal"):60106,w=q?Symbol["for"]("react.fragment"):60107,x="function"===typeof Symbol&&Symbol.iterator;
-function y(a){for(var b=arguments.length-1,e="Minified React error #"+a+"; visit http://facebook.github.io/react/docs/error-decoder.html?invariant\x3d"+a,c=0;cM.length&&M.push(a)}
-function P(a,b,e,c){var d=typeof a;if("undefined"===d||"boolean"===d)a=null;var g=!1;if(null===a)g=!0;else switch(d){case "string":case "number":g=!0;break;case "object":switch(a.$$typeof){case r:case t:case u:case v:g=!0}}if(g)return e(c,a,""===b?"."+Q(a,0):b),1;g=0;b=""===b?".":b+":";if(Array.isArray(a))for(var k=0;k 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
- args[_key - 1] = arguments[_key];
- }
-
- var argIndex = 0;
- var message = 'Warning: ' + format.replace(/%s/g, function () {
- return args[argIndex++];
- });
- if (typeof console !== 'undefined') {
- console.warn(message);
- }
- try {
- // --- Welcome to debugging React ---
- // This error was thrown as a convenience so that you can use this stack
- // to find the callsite that caused this warning to fire.
- throw new Error(message);
- } catch (x) {}
- };
-
- lowPriorityWarning = function (condition, format) {
- if (format === undefined) {
- throw new Error('`warning(condition, format, ...args)` requires a warning ' + 'message argument');
- }
- if (!condition) {
- for (var _len2 = arguments.length, args = Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) {
- args[_key2 - 2] = arguments[_key2];
- }
-
- printWarning.apply(undefined, [format].concat(args));
- }
- };
-}
-
-var lowPriorityWarning$1 = lowPriorityWarning;
-
-var didWarnStateUpdateForUnmountedComponent = {};
-
-function warnNoop(publicInstance, callerName) {
- {
- var constructor = publicInstance.constructor;
- var componentName = constructor && (constructor.displayName || constructor.name) || 'ReactClass';
- var warningKey = componentName + '.' + callerName;
- if (didWarnStateUpdateForUnmountedComponent[warningKey]) {
- return;
- }
- warning(false, '%s(...): Can only update a mounted or mounting component. ' + 'This usually means you called %s() on an unmounted component. ' + 'This is a no-op.\n\nPlease check the code for the %s component.', callerName, callerName, componentName);
- didWarnStateUpdateForUnmountedComponent[warningKey] = true;
- }
-}
-
-/**
- * This is the abstract API for an update queue.
- */
-var ReactNoopUpdateQueue = {
- /**
- * Checks whether or not this composite component is mounted.
- * @param {ReactClass} publicInstance The instance we want to test.
- * @return {boolean} True if mounted, false otherwise.
- * @protected
- * @final
- */
- isMounted: function (publicInstance) {
- return false;
- },
-
- /**
- * Forces an update. This should only be invoked when it is known with
- * certainty that we are **not** in a DOM transaction.
- *
- * You may want to call this when you know that some deeper aspect of the
- * component's state has changed but `setState` was not called.
- *
- * This will not invoke `shouldComponentUpdate`, but it will invoke
- * `componentWillUpdate` and `componentDidUpdate`.
- *
- * @param {ReactClass} publicInstance The instance that should rerender.
- * @param {?function} callback Called after component is updated.
- * @param {?string} callerName name of the calling function in the public API.
- * @internal
- */
- enqueueForceUpdate: function (publicInstance, callback, callerName) {
- warnNoop(publicInstance, 'forceUpdate');
- },
-
- /**
- * Replaces all of the state. Always use this or `setState` to mutate state.
- * You should treat `this.state` as immutable.
- *
- * There is no guarantee that `this.state` will be immediately updated, so
- * accessing `this.state` after calling this method may return the old value.
- *
- * @param {ReactClass} publicInstance The instance that should rerender.
- * @param {object} completeState Next state.
- * @param {?function} callback Called after component is updated.
- * @param {?string} callerName name of the calling function in the public API.
- * @internal
- */
- enqueueReplaceState: function (publicInstance, completeState, callback, callerName) {
- warnNoop(publicInstance, 'replaceState');
- },
-
- /**
- * Sets a subset of the state. This only exists because _pendingState is
- * internal. This provides a merging strategy that is not available to deep
- * properties which is confusing. TODO: Expose pendingState or don't use it
- * during the merge.
- *
- * @param {ReactClass} publicInstance The instance that should rerender.
- * @param {object} partialState Next partial state to be merged with state.
- * @param {?function} callback Called after component is updated.
- * @param {?string} Name of the calling function in the public API.
- * @internal
- */
- enqueueSetState: function (publicInstance, partialState, callback, callerName) {
- warnNoop(publicInstance, 'setState');
- }
-};
-
-/**
- * Base class helpers for the updating state of a component.
- */
-function Component(props, context, updater) {
- this.props = props;
- this.context = context;
- this.refs = emptyObject;
- // We initialize the default updater but the real one gets injected by the
- // renderer.
- this.updater = updater || ReactNoopUpdateQueue;
-}
-
-Component.prototype.isReactComponent = {};
-
-/**
- * Sets a subset of the state. Always use this to mutate
- * state. You should treat `this.state` as immutable.
- *
- * There is no guarantee that `this.state` will be immediately updated, so
- * accessing `this.state` after calling this method may return the old value.
- *
- * There is no guarantee that calls to `setState` will run synchronously,
- * as they may eventually be batched together. You can provide an optional
- * callback that will be executed when the call to setState is actually
- * completed.
- *
- * When a function is provided to setState, it will be called at some point in
- * the future (not synchronously). It will be called with the up to date
- * component arguments (state, props, context). These values can be different
- * from this.* because your function may be called after receiveProps but before
- * shouldComponentUpdate, and this new state, props, and context will not yet be
- * assigned to this.
- *
- * @param {object|function} partialState Next partial state or function to
- * produce next partial state to be merged with current state.
- * @param {?function} callback Called after state is updated.
- * @final
- * @protected
- */
-Component.prototype.setState = function (partialState, callback) {
- !(typeof partialState === 'object' || typeof partialState === 'function' || partialState == null) ? invariant(false, 'setState(...): takes an object of state variables to update or a function which returns an object of state variables.') : void 0;
- this.updater.enqueueSetState(this, partialState, callback, 'setState');
-};
-
-/**
- * Forces an update. This should only be invoked when it is known with
- * certainty that we are **not** in a DOM transaction.
- *
- * You may want to call this when you know that some deeper aspect of the
- * component's state has changed but `setState` was not called.
- *
- * This will not invoke `shouldComponentUpdate`, but it will invoke
- * `componentWillUpdate` and `componentDidUpdate`.
- *
- * @param {?function} callback Called after update is complete.
- * @final
- * @protected
- */
-Component.prototype.forceUpdate = function (callback) {
- this.updater.enqueueForceUpdate(this, callback, 'forceUpdate');
-};
-
-/**
- * Deprecated APIs. These APIs used to exist on classic React classes but since
- * we would like to deprecate them, we're not going to move them over to this
- * modern base class. Instead, we define a getter that warns if it's accessed.
- */
-{
- var deprecatedAPIs = {
- isMounted: ['isMounted', 'Instead, make sure to clean up subscriptions and pending requests in ' + 'componentWillUnmount to prevent memory leaks.'],
- replaceState: ['replaceState', 'Refactor your code to use setState instead (see ' + 'https://github.com/facebook/react/issues/3236).']
- };
- var defineDeprecationWarning = function (methodName, info) {
- Object.defineProperty(Component.prototype, methodName, {
- get: function () {
- lowPriorityWarning$1(false, '%s(...) is deprecated in plain JavaScript React classes. %s', info[0], info[1]);
- return undefined;
- }
- });
- };
- for (var fnName in deprecatedAPIs) {
- if (deprecatedAPIs.hasOwnProperty(fnName)) {
- defineDeprecationWarning(fnName, deprecatedAPIs[fnName]);
- }
- }
-}
-
-/**
- * Base class helpers for the updating state of a component.
- */
-function PureComponent(props, context, updater) {
- // Duplicated from Component.
- this.props = props;
- this.context = context;
- this.refs = emptyObject;
- // We initialize the default updater but the real one gets injected by the
- // renderer.
- this.updater = updater || ReactNoopUpdateQueue;
-}
-
-function ComponentDummy() {}
-ComponentDummy.prototype = Component.prototype;
-var pureComponentPrototype = PureComponent.prototype = new ComponentDummy();
-pureComponentPrototype.constructor = PureComponent;
-// Avoid an extra prototype jump for these methods.
-_assign(pureComponentPrototype, Component.prototype);
-pureComponentPrototype.isPureReactComponent = true;
-
-function AsyncComponent(props, context, updater) {
- // Duplicated from Component.
- this.props = props;
- this.context = context;
- this.refs = emptyObject;
- // We initialize the default updater but the real one gets injected by the
- // renderer.
- this.updater = updater || ReactNoopUpdateQueue;
-}
-
-var asyncComponentPrototype = AsyncComponent.prototype = new ComponentDummy();
-asyncComponentPrototype.constructor = AsyncComponent;
-// Avoid an extra prototype jump for these methods.
-_assign(asyncComponentPrototype, Component.prototype);
-asyncComponentPrototype.unstable_isAsyncReactComponent = true;
-asyncComponentPrototype.render = function () {
- return this.props.children;
-};
-
-/**
- * Keeps track of the current owner.
- *
- * The current owner is the component who should own any components that are
- * currently being constructed.
- */
-var ReactCurrentOwner = {
- /**
- * @internal
- * @type {ReactComponent}
- */
- current: null
-};
-
-var hasOwnProperty = Object.prototype.hasOwnProperty;
-
-var RESERVED_PROPS = {
- key: true,
- ref: true,
- __self: true,
- __source: true
-};
-
-var specialPropKeyWarningShown;
-var specialPropRefWarningShown;
-
-function hasValidRef(config) {
- {
- if (hasOwnProperty.call(config, 'ref')) {
- var getter = Object.getOwnPropertyDescriptor(config, 'ref').get;
- if (getter && getter.isReactWarning) {
- return false;
- }
- }
- }
- return config.ref !== undefined;
-}
-
-function hasValidKey(config) {
- {
- if (hasOwnProperty.call(config, 'key')) {
- var getter = Object.getOwnPropertyDescriptor(config, 'key').get;
- if (getter && getter.isReactWarning) {
- return false;
- }
- }
- }
- return config.key !== undefined;
-}
-
-function defineKeyPropWarningGetter(props, displayName) {
- var warnAboutAccessingKey = function () {
- if (!specialPropKeyWarningShown) {
- specialPropKeyWarningShown = true;
- warning(false, '%s: `key` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://fb.me/react-special-props)', displayName);
- }
- };
- warnAboutAccessingKey.isReactWarning = true;
- Object.defineProperty(props, 'key', {
- get: warnAboutAccessingKey,
- configurable: true
- });
-}
-
-function defineRefPropWarningGetter(props, displayName) {
- var warnAboutAccessingRef = function () {
- if (!specialPropRefWarningShown) {
- specialPropRefWarningShown = true;
- warning(false, '%s: `ref` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://fb.me/react-special-props)', displayName);
- }
- };
- warnAboutAccessingRef.isReactWarning = true;
- Object.defineProperty(props, 'ref', {
- get: warnAboutAccessingRef,
- configurable: true
- });
-}
-
-/**
- * Factory method to create a new React element. This no longer adheres to
- * the class pattern, so do not use new to call it. Also, no instanceof check
- * will work. Instead test $$typeof field against Symbol.for('react.element') to check
- * if something is a React Element.
- *
- * @param {*} type
- * @param {*} key
- * @param {string|object} ref
- * @param {*} self A *temporary* helper to detect places where `this` is
- * different from the `owner` when React.createElement is called, so that we
- * can warn. We want to get rid of owner and replace string `ref`s with arrow
- * functions, and as long as `this` and owner are the same, there will be no
- * change in behavior.
- * @param {*} source An annotation object (added by a transpiler or otherwise)
- * indicating filename, line number, and/or other information.
- * @param {*} owner
- * @param {*} props
- * @internal
- */
-var ReactElement = function (type, key, ref, self, source, owner, props) {
- var element = {
- // This tag allow us to uniquely identify this as a React Element
- $$typeof: REACT_ELEMENT_TYPE,
-
- // Built-in properties that belong on the element
- type: type,
- key: key,
- ref: ref,
- props: props,
-
- // Record the component responsible for creating this element.
- _owner: owner
- };
-
- {
- // The validation flag is currently mutative. We put it on
- // an external backing store so that we can freeze the whole object.
- // This can be replaced with a WeakMap once they are implemented in
- // commonly used development environments.
- element._store = {};
-
- // To make comparing ReactElements easier for testing purposes, we make
- // the validation flag non-enumerable (where possible, which should
- // include every environment we run tests in), so the test framework
- // ignores it.
- Object.defineProperty(element._store, 'validated', {
- configurable: false,
- enumerable: false,
- writable: true,
- value: false
- });
- // self and source are DEV only properties.
- Object.defineProperty(element, '_self', {
- configurable: false,
- enumerable: false,
- writable: false,
- value: self
- });
- // Two elements created in two different places should be considered
- // equal for testing purposes and therefore we hide it from enumeration.
- Object.defineProperty(element, '_source', {
- configurable: false,
- enumerable: false,
- writable: false,
- value: source
- });
- if (Object.freeze) {
- Object.freeze(element.props);
- Object.freeze(element);
- }
- }
-
- return element;
-};
-
-/**
- * Create and return a new ReactElement of the given type.
- * See https://reactjs.org/docs/react-api.html#createelement
- */
-function createElement(type, config, children) {
- var propName;
-
- // Reserved names are extracted
- var props = {};
-
- var key = null;
- var ref = null;
- var self = null;
- var source = null;
-
- if (config != null) {
- if (hasValidRef(config)) {
- ref = config.ref;
- }
- if (hasValidKey(config)) {
- key = '' + config.key;
- }
-
- self = config.__self === undefined ? null : config.__self;
- source = config.__source === undefined ? null : config.__source;
- // Remaining properties are added to a new props object
- for (propName in config) {
- if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
- props[propName] = config[propName];
- }
- }
- }
-
- // Children can be more than one argument, and those are transferred onto
- // the newly allocated props object.
- var childrenLength = arguments.length - 2;
- if (childrenLength === 1) {
- props.children = children;
- } else if (childrenLength > 1) {
- var childArray = Array(childrenLength);
- for (var i = 0; i < childrenLength; i++) {
- childArray[i] = arguments[i + 2];
- }
- {
- if (Object.freeze) {
- Object.freeze(childArray);
- }
- }
- props.children = childArray;
- }
-
- // Resolve default props
- if (type && type.defaultProps) {
- var defaultProps = type.defaultProps;
- for (propName in defaultProps) {
- if (props[propName] === undefined) {
- props[propName] = defaultProps[propName];
- }
- }
- }
- {
- if (key || ref) {
- if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {
- var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;
- if (key) {
- defineKeyPropWarningGetter(props, displayName);
- }
- if (ref) {
- defineRefPropWarningGetter(props, displayName);
- }
- }
- }
- }
- return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);
-}
-
-/**
- * Return a function that produces ReactElements of a given type.
- * See https://reactjs.org/docs/react-api.html#createfactory
- */
-
-
-function cloneAndReplaceKey(oldElement, newKey) {
- var newElement = ReactElement(oldElement.type, newKey, oldElement.ref, oldElement._self, oldElement._source, oldElement._owner, oldElement.props);
-
- return newElement;
-}
-
-/**
- * Clone and return a new ReactElement using element as the starting point.
- * See https://reactjs.org/docs/react-api.html#cloneelement
- */
-function cloneElement(element, config, children) {
- var propName;
-
- // Original props are copied
- var props = _assign({}, element.props);
-
- // Reserved names are extracted
- var key = element.key;
- var ref = element.ref;
- // Self is preserved since the owner is preserved.
- var self = element._self;
- // Source is preserved since cloneElement is unlikely to be targeted by a
- // transpiler, and the original source is probably a better indicator of the
- // true owner.
- var source = element._source;
-
- // Owner will be preserved, unless ref is overridden
- var owner = element._owner;
-
- if (config != null) {
- if (hasValidRef(config)) {
- // Silently steal the ref from the parent.
- ref = config.ref;
- owner = ReactCurrentOwner.current;
- }
- if (hasValidKey(config)) {
- key = '' + config.key;
- }
-
- // Remaining properties override existing props
- var defaultProps;
- if (element.type && element.type.defaultProps) {
- defaultProps = element.type.defaultProps;
- }
- for (propName in config) {
- if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
- if (config[propName] === undefined && defaultProps !== undefined) {
- // Resolve default props
- props[propName] = defaultProps[propName];
- } else {
- props[propName] = config[propName];
- }
- }
- }
- }
-
- // Children can be more than one argument, and those are transferred onto
- // the newly allocated props object.
- var childrenLength = arguments.length - 2;
- if (childrenLength === 1) {
- props.children = children;
- } else if (childrenLength > 1) {
- var childArray = Array(childrenLength);
- for (var i = 0; i < childrenLength; i++) {
- childArray[i] = arguments[i + 2];
- }
- props.children = childArray;
- }
-
- return ReactElement(element.type, key, ref, self, source, owner, props);
-}
-
-/**
- * Verifies the object is a ReactElement.
- * See https://reactjs.org/docs/react-api.html#isvalidelement
- * @param {?object} object
- * @return {boolean} True if `object` is a valid component.
- * @final
- */
-function isValidElement(object) {
- return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
-}
-
-var ReactDebugCurrentFrame = {};
-
-{
- // Component that is being worked on
- ReactDebugCurrentFrame.getCurrentStack = null;
-
- ReactDebugCurrentFrame.getStackAddendum = function () {
- var impl = ReactDebugCurrentFrame.getCurrentStack;
- if (impl) {
- return impl();
- }
- return null;
- };
-}
-
-var SEPARATOR = '.';
-var SUBSEPARATOR = ':';
-
-/**
- * Escape and wrap key so it is safe to use as a reactid
- *
- * @param {string} key to be escaped.
- * @return {string} the escaped key.
- */
-function escape(key) {
- var escapeRegex = /[=:]/g;
- var escaperLookup = {
- '=': '=0',
- ':': '=2'
- };
- var escapedString = ('' + key).replace(escapeRegex, function (match) {
- return escaperLookup[match];
- });
-
- return '$' + escapedString;
-}
-
-/**
- * TODO: Test that a single child and an array with one item have the same key
- * pattern.
- */
-
-var didWarnAboutMaps = false;
-
-var userProvidedKeyEscapeRegex = /\/+/g;
-function escapeUserProvidedKey(text) {
- return ('' + text).replace(userProvidedKeyEscapeRegex, '$&/');
-}
-
-var POOL_SIZE = 10;
-var traverseContextPool = [];
-function getPooledTraverseContext(mapResult, keyPrefix, mapFunction, mapContext) {
- if (traverseContextPool.length) {
- var traverseContext = traverseContextPool.pop();
- traverseContext.result = mapResult;
- traverseContext.keyPrefix = keyPrefix;
- traverseContext.func = mapFunction;
- traverseContext.context = mapContext;
- traverseContext.count = 0;
- return traverseContext;
- } else {
- return {
- result: mapResult,
- keyPrefix: keyPrefix,
- func: mapFunction,
- context: mapContext,
- count: 0
- };
- }
-}
-
-function releaseTraverseContext(traverseContext) {
- traverseContext.result = null;
- traverseContext.keyPrefix = null;
- traverseContext.func = null;
- traverseContext.context = null;
- traverseContext.count = 0;
- if (traverseContextPool.length < POOL_SIZE) {
- traverseContextPool.push(traverseContext);
- }
-}
-
-/**
- * @param {?*} children Children tree container.
- * @param {!string} nameSoFar Name of the key path so far.
- * @param {!function} callback Callback to invoke with each child found.
- * @param {?*} traverseContext Used to pass information throughout the traversal
- * process.
- * @return {!number} The number of children in this subtree.
- */
-function traverseAllChildrenImpl(children, nameSoFar, callback, traverseContext) {
- var type = typeof children;
-
- if (type === 'undefined' || type === 'boolean') {
- // All of the above are perceived as null.
- children = null;
- }
-
- var invokeCallback = false;
-
- if (children === null) {
- invokeCallback = true;
- } else {
- switch (type) {
- case 'string':
- case 'number':
- invokeCallback = true;
- break;
- case 'object':
- switch (children.$$typeof) {
- case REACT_ELEMENT_TYPE:
- case REACT_CALL_TYPE:
- case REACT_RETURN_TYPE:
- case REACT_PORTAL_TYPE:
- invokeCallback = true;
- }
- }
- }
-
- if (invokeCallback) {
- callback(traverseContext, children,
- // If it's the only child, treat the name as if it was wrapped in an array
- // so that it's consistent if the number of children grows.
- nameSoFar === '' ? SEPARATOR + getComponentKey(children, 0) : nameSoFar);
- return 1;
- }
-
- var child;
- var nextName;
- var subtreeCount = 0; // Count of children found in the current subtree.
- var nextNamePrefix = nameSoFar === '' ? SEPARATOR : nameSoFar + SUBSEPARATOR;
-
- if (Array.isArray(children)) {
- for (var i = 0; i < children.length; i++) {
- child = children[i];
- nextName = nextNamePrefix + getComponentKey(child, i);
- subtreeCount += traverseAllChildrenImpl(child, nextName, callback, traverseContext);
- }
- } else {
- var iteratorFn = getIteratorFn(children);
- if (typeof iteratorFn === 'function') {
- {
- // Warn about using Maps as children
- if (iteratorFn === children.entries) {
- warning(didWarnAboutMaps, 'Using Maps as children is unsupported and will likely yield ' + 'unexpected results. Convert it to a sequence/iterable of keyed ' + 'ReactElements instead.%s', ReactDebugCurrentFrame.getStackAddendum());
- didWarnAboutMaps = true;
- }
- }
-
- var iterator = iteratorFn.call(children);
- var step;
- var ii = 0;
- while (!(step = iterator.next()).done) {
- child = step.value;
- nextName = nextNamePrefix + getComponentKey(child, ii++);
- subtreeCount += traverseAllChildrenImpl(child, nextName, callback, traverseContext);
- }
- } else if (type === 'object') {
- var addendum = '';
- {
- addendum = ' If you meant to render a collection of children, use an array ' + 'instead.' + ReactDebugCurrentFrame.getStackAddendum();
- }
- var childrenString = '' + children;
- invariant(false, 'Objects are not valid as a React child (found: %s).%s', childrenString === '[object Object]' ? 'object with keys {' + Object.keys(children).join(', ') + '}' : childrenString, addendum);
- }
- }
-
- return subtreeCount;
-}
-
-/**
- * Traverses children that are typically specified as `props.children`, but
- * might also be specified through attributes:
- *
- * - `traverseAllChildren(this.props.children, ...)`
- * - `traverseAllChildren(this.props.leftPanelChildren, ...)`
- *
- * The `traverseContext` is an optional argument that is passed through the
- * entire traversal. It can be used to store accumulations or anything else that
- * the callback might find relevant.
- *
- * @param {?*} children Children tree object.
- * @param {!function} callback To invoke upon traversing each child.
- * @param {?*} traverseContext Context for traversal.
- * @return {!number} The number of children in this subtree.
- */
-function traverseAllChildren(children, callback, traverseContext) {
- if (children == null) {
- return 0;
- }
-
- return traverseAllChildrenImpl(children, '', callback, traverseContext);
-}
-
-/**
- * Generate a key string that identifies a component within a set.
- *
- * @param {*} component A component that could contain a manual key.
- * @param {number} index Index that is used if a manual key is not provided.
- * @return {string}
- */
-function getComponentKey(component, index) {
- // Do some typechecking here since we call this blindly. We want to ensure
- // that we don't block potential future ES APIs.
- if (typeof component === 'object' && component !== null && component.key != null) {
- // Explicit key
- return escape(component.key);
- }
- // Implicit key determined by the index in the set
- return index.toString(36);
-}
-
-function forEachSingleChild(bookKeeping, child, name) {
- var func = bookKeeping.func,
- context = bookKeeping.context;
-
- func.call(context, child, bookKeeping.count++);
-}
-
-/**
- * Iterates through children that are typically specified as `props.children`.
- *
- * See https://reactjs.org/docs/react-api.html#react.children.foreach
- *
- * The provided forEachFunc(child, index) will be called for each
- * leaf child.
- *
- * @param {?*} children Children tree container.
- * @param {function(*, int)} forEachFunc
- * @param {*} forEachContext Context for forEachContext.
- */
-function forEachChildren(children, forEachFunc, forEachContext) {
- if (children == null) {
- return children;
- }
- var traverseContext = getPooledTraverseContext(null, null, forEachFunc, forEachContext);
- traverseAllChildren(children, forEachSingleChild, traverseContext);
- releaseTraverseContext(traverseContext);
-}
-
-function mapSingleChildIntoContext(bookKeeping, child, childKey) {
- var result = bookKeeping.result,
- keyPrefix = bookKeeping.keyPrefix,
- func = bookKeeping.func,
- context = bookKeeping.context;
-
-
- var mappedChild = func.call(context, child, bookKeeping.count++);
- if (Array.isArray(mappedChild)) {
- mapIntoWithKeyPrefixInternal(mappedChild, result, childKey, emptyFunction.thatReturnsArgument);
- } else if (mappedChild != null) {
- if (isValidElement(mappedChild)) {
- mappedChild = cloneAndReplaceKey(mappedChild,
- // Keep both the (mapped) and old keys if they differ, just as
- // traverseAllChildren used to do for objects as children
- keyPrefix + (mappedChild.key && (!child || child.key !== mappedChild.key) ? escapeUserProvidedKey(mappedChild.key) + '/' : '') + childKey);
- }
- result.push(mappedChild);
- }
-}
-
-function mapIntoWithKeyPrefixInternal(children, array, prefix, func, context) {
- var escapedPrefix = '';
- if (prefix != null) {
- escapedPrefix = escapeUserProvidedKey(prefix) + '/';
- }
- var traverseContext = getPooledTraverseContext(array, escapedPrefix, func, context);
- traverseAllChildren(children, mapSingleChildIntoContext, traverseContext);
- releaseTraverseContext(traverseContext);
-}
-
-/**
- * Maps children that are typically specified as `props.children`.
- *
- * See https://reactjs.org/docs/react-api.html#react.children.map
- *
- * The provided mapFunction(child, key, index) will be called for each
- * leaf child.
- *
- * @param {?*} children Children tree container.
- * @param {function(*, int)} func The map function.
- * @param {*} context Context for mapFunction.
- * @return {object} Object containing the ordered map of results.
- */
-function mapChildren(children, func, context) {
- if (children == null) {
- return children;
- }
- var result = [];
- mapIntoWithKeyPrefixInternal(children, result, null, func, context);
- return result;
-}
-
-/**
- * Count the number of children that are typically specified as
- * `props.children`.
- *
- * See https://reactjs.org/docs/react-api.html#react.children.count
- *
- * @param {?*} children Children tree container.
- * @return {number} The number of children.
- */
-function countChildren(children, context) {
- return traverseAllChildren(children, emptyFunction.thatReturnsNull, null);
-}
-
-/**
- * Flatten a children object (typically specified as `props.children`) and
- * return an array with appropriately re-keyed children.
- *
- * See https://reactjs.org/docs/react-api.html#react.children.toarray
- */
-function toArray(children) {
- var result = [];
- mapIntoWithKeyPrefixInternal(children, result, null, emptyFunction.thatReturnsArgument);
- return result;
-}
-
-/**
- * Returns the first child in a collection of children and verifies that there
- * is only one child in the collection.
- *
- * See https://reactjs.org/docs/react-api.html#react.children.only
- *
- * The current implementation of this function assumes that a single child gets
- * passed without a wrapper, but the purpose of this helper function is to
- * abstract away the particular structure of children.
- *
- * @param {?object} children Child collection structure.
- * @return {ReactElement} The first and only `ReactElement` contained in the
- * structure.
- */
-function onlyChild(children) {
- !isValidElement(children) ? invariant(false, 'React.Children.only expected to receive a single React element child.') : void 0;
- return children;
-}
-
-var describeComponentFrame = function (name, source, ownerName) {
- return '\n in ' + (name || 'Unknown') + (source ? ' (at ' + source.fileName.replace(/^.*[\\\/]/, '') + ':' + source.lineNumber + ')' : ownerName ? ' (created by ' + ownerName + ')' : '');
-};
-
-function getComponentName(fiber) {
- var type = fiber.type;
-
- if (typeof type === 'string') {
- return type;
- }
- if (typeof type === 'function') {
- return type.displayName || type.name;
- }
- return null;
-}
-
-/**
- * ReactElementValidator provides a wrapper around a element factory
- * which validates the props passed to the element. This is intended to be
- * used only in DEV and could be replaced by a static type checker for languages
- * that support it.
- */
-
-{
- var currentlyValidatingElement = null;
-
- var propTypesMisspellWarningShown = false;
-
- var getDisplayName = function (element) {
- if (element == null) {
- return '#empty';
- } else if (typeof element === 'string' || typeof element === 'number') {
- return '#text';
- } else if (typeof element.type === 'string') {
- return element.type;
- } else if (element.type === REACT_FRAGMENT_TYPE) {
- return 'React.Fragment';
- } else {
- return element.type.displayName || element.type.name || 'Unknown';
- }
- };
-
- var getStackAddendum = function () {
- var stack = '';
- if (currentlyValidatingElement) {
- var name = getDisplayName(currentlyValidatingElement);
- var owner = currentlyValidatingElement._owner;
- stack += describeComponentFrame(name, currentlyValidatingElement._source, owner && getComponentName(owner));
- }
- stack += ReactDebugCurrentFrame.getStackAddendum() || '';
- return stack;
- };
-
- var VALID_FRAGMENT_PROPS = new Map([['children', true], ['key', true]]);
-}
-
-function getDeclarationErrorAddendum() {
- if (ReactCurrentOwner.current) {
- var name = getComponentName(ReactCurrentOwner.current);
- if (name) {
- return '\n\nCheck the render method of `' + name + '`.';
- }
- }
- return '';
-}
-
-function getSourceInfoErrorAddendum(elementProps) {
- if (elementProps !== null && elementProps !== undefined && elementProps.__source !== undefined) {
- var source = elementProps.__source;
- var fileName = source.fileName.replace(/^.*[\\\/]/, '');
- var lineNumber = source.lineNumber;
- return '\n\nCheck your code at ' + fileName + ':' + lineNumber + '.';
- }
- return '';
-}
-
-/**
- * Warn if there's no key explicitly set on dynamic arrays of children or
- * object keys are not valid. This allows us to keep track of children between
- * updates.
- */
-var ownerHasKeyUseWarning = {};
-
-function getCurrentComponentErrorInfo(parentType) {
- var info = getDeclarationErrorAddendum();
-
- if (!info) {
- var parentName = typeof parentType === 'string' ? parentType : parentType.displayName || parentType.name;
- if (parentName) {
- info = '\n\nCheck the top-level render call using <' + parentName + '>.';
- }
- }
- return info;
-}
-
-/**
- * Warn if the element doesn't have an explicit key assigned to it.
- * This element is in an array. The array could grow and shrink or be
- * reordered. All children that haven't already been validated are required to
- * have a "key" property assigned to it. Error statuses are cached so a warning
- * will only be shown once.
- *
- * @internal
- * @param {ReactElement} element Element that requires a key.
- * @param {*} parentType element's parent's type.
- */
-function validateExplicitKey(element, parentType) {
- if (!element._store || element._store.validated || element.key != null) {
- return;
- }
- element._store.validated = true;
-
- var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType);
- if (ownerHasKeyUseWarning[currentComponentErrorInfo]) {
- return;
- }
- ownerHasKeyUseWarning[currentComponentErrorInfo] = true;
-
- // Usually the current owner is the offender, but if it accepts children as a
- // property, it may be the creator of the child that's responsible for
- // assigning it a key.
- var childOwner = '';
- if (element && element._owner && element._owner !== ReactCurrentOwner.current) {
- // Give the component that originally created this child.
- childOwner = ' It was passed a child from ' + getComponentName(element._owner) + '.';
- }
-
- currentlyValidatingElement = element;
- {
- warning(false, 'Each child in an array or iterator should have a unique "key" prop.' + '%s%s See https://fb.me/react-warning-keys for more information.%s', currentComponentErrorInfo, childOwner, getStackAddendum());
- }
- currentlyValidatingElement = null;
-}
-
-/**
- * Ensure that every element either is passed in a static location, in an
- * array with an explicit keys property defined, or in an object literal
- * with valid key property.
- *
- * @internal
- * @param {ReactNode} node Statically passed child of any type.
- * @param {*} parentType node's parent's type.
- */
-function validateChildKeys(node, parentType) {
- if (typeof node !== 'object') {
- return;
- }
- if (Array.isArray(node)) {
- for (var i = 0; i < node.length; i++) {
- var child = node[i];
- if (isValidElement(child)) {
- validateExplicitKey(child, parentType);
- }
- }
- } else if (isValidElement(node)) {
- // This element was passed in a valid location.
- if (node._store) {
- node._store.validated = true;
- }
- } else if (node) {
- var iteratorFn = getIteratorFn(node);
- if (typeof iteratorFn === 'function') {
- // Entry iterators used to provide implicit keys,
- // but now we print a separate warning for them later.
- if (iteratorFn !== node.entries) {
- var iterator = iteratorFn.call(node);
- var step;
- while (!(step = iterator.next()).done) {
- if (isValidElement(step.value)) {
- validateExplicitKey(step.value, parentType);
- }
- }
- }
- }
- }
-}
-
-/**
- * Given an element, validate that its props follow the propTypes definition,
- * provided by the type.
- *
- * @param {ReactElement} element
- */
-function validatePropTypes(element) {
- var componentClass = element.type;
- if (typeof componentClass !== 'function') {
- return;
- }
- var name = componentClass.displayName || componentClass.name;
- var propTypes = componentClass.propTypes;
- if (propTypes) {
- currentlyValidatingElement = element;
- checkPropTypes(propTypes, element.props, 'prop', name, getStackAddendum);
- currentlyValidatingElement = null;
- } else if (componentClass.PropTypes !== undefined && !propTypesMisspellWarningShown) {
- propTypesMisspellWarningShown = true;
- warning(false, 'Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?', name || 'Unknown');
- }
- if (typeof componentClass.getDefaultProps === 'function') {
- warning(componentClass.getDefaultProps.isReactClassApproved, 'getDefaultProps is only used on classic React.createClass ' + 'definitions. Use a static property named `defaultProps` instead.');
- }
-}
-
-/**
- * Given a fragment, validate that it can only be provided with fragment props
- * @param {ReactElement} fragment
- */
-function validateFragmentProps(fragment) {
- currentlyValidatingElement = fragment;
-
- var _iteratorNormalCompletion = true;
- var _didIteratorError = false;
- var _iteratorError = undefined;
-
- try {
- for (var _iterator = Object.keys(fragment.props)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
- var key = _step.value;
-
- if (!VALID_FRAGMENT_PROPS.has(key)) {
- warning(false, 'Invalid prop `%s` supplied to `React.Fragment`. ' + 'React.Fragment can only have `key` and `children` props.%s', key, getStackAddendum());
- break;
- }
- }
- } catch (err) {
- _didIteratorError = true;
- _iteratorError = err;
- } finally {
- try {
- if (!_iteratorNormalCompletion && _iterator['return']) {
- _iterator['return']();
- }
- } finally {
- if (_didIteratorError) {
- throw _iteratorError;
- }
- }
- }
-
- if (fragment.ref !== null) {
- warning(false, 'Invalid attribute `ref` supplied to `React.Fragment`.%s', getStackAddendum());
- }
-
- currentlyValidatingElement = null;
-}
-
-function createElementWithValidation(type, props, children) {
- var validType = typeof type === 'string' || typeof type === 'function' || typeof type === 'symbol' || typeof type === 'number';
- // We warn in this case but don't throw. We expect the element creation to
- // succeed and there will likely be errors in render.
- if (!validType) {
- var info = '';
- if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) {
- info += ' You likely forgot to export your component from the file ' + "it's defined in, or you might have mixed up default and named imports.";
- }
-
- var sourceInfo = getSourceInfoErrorAddendum(props);
- if (sourceInfo) {
- info += sourceInfo;
- } else {
- info += getDeclarationErrorAddendum();
- }
-
- info += getStackAddendum() || '';
-
- warning(false, 'React.createElement: type is invalid -- expected a string (for ' + 'built-in components) or a class/function (for composite ' + 'components) but got: %s.%s', type == null ? type : typeof type, info);
- }
-
- var element = createElement.apply(this, arguments);
-
- // The result can be nullish if a mock or a custom function is used.
- // TODO: Drop this when these are no longer allowed as the type argument.
- if (element == null) {
- return element;
- }
-
- // Skip key warning if the type isn't valid since our key validation logic
- // doesn't expect a non-string/function type and can throw confusing errors.
- // We don't want exception behavior to differ between dev and prod.
- // (Rendering will throw with a helpful message and as soon as the type is
- // fixed, the key warnings will appear.)
- if (validType) {
- for (var i = 2; i < arguments.length; i++) {
- validateChildKeys(arguments[i], type);
- }
- }
-
- if (typeof type === 'symbol' && type === REACT_FRAGMENT_TYPE) {
- validateFragmentProps(element);
- } else {
- validatePropTypes(element);
- }
-
- return element;
-}
-
-function createFactoryWithValidation(type) {
- var validatedFactory = createElementWithValidation.bind(null, type);
- // Legacy hook TODO: Warn if this is accessed
- validatedFactory.type = type;
-
- {
- Object.defineProperty(validatedFactory, 'type', {
- enumerable: false,
- get: function () {
- lowPriorityWarning$1(false, 'Factory.type is deprecated. Access the class directly ' + 'before passing it to createFactory.');
- Object.defineProperty(this, 'type', {
- value: type
- });
- return type;
- }
- });
- }
-
- return validatedFactory;
-}
-
-function cloneElementWithValidation(element, props, children) {
- var newElement = cloneElement.apply(this, arguments);
- for (var i = 2; i < arguments.length; i++) {
- validateChildKeys(arguments[i], newElement.type);
- }
- validatePropTypes(newElement);
- return newElement;
-}
-
-var React = {
- Children: {
- map: mapChildren,
- forEach: forEachChildren,
- count: countChildren,
- toArray: toArray,
- only: onlyChild
- },
-
- Component: Component,
- PureComponent: PureComponent,
- unstable_AsyncComponent: AsyncComponent,
-
- Fragment: REACT_FRAGMENT_TYPE,
-
- createElement: createElementWithValidation,
- cloneElement: cloneElementWithValidation,
- createFactory: createFactoryWithValidation,
- isValidElement: isValidElement,
-
- version: ReactVersion,
-
- __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED: {
- ReactCurrentOwner: ReactCurrentOwner,
- // Used by renderers to avoid bundling object-assign twice in UMD bundles:
- assign: _assign
- }
-};
-
-{
- _assign(React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED, {
- // These should not be included in production.
- ReactDebugCurrentFrame: ReactDebugCurrentFrame,
- // Shim for React DOM 16.0.0 which still destructured (but not used) this.
- // TODO: remove in React 17.0.
- ReactComponentTreeHook: {}
- });
-}
-
-
-
-var React$2 = Object.freeze({
- default: React
-});
-
-var React$3 = ( React$2 && React ) || React$2;
-
-// TODO: decide on the top-level export form.
-// This is hacky but makes it work with both Rollup and Jest.
-var react = React$3['default'] ? React$3['default'] : React$3;
-
-module.exports = react;
- })();
-}
-
-/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(1)))
-
-/***/ }),
-/* 43 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-/* WEBPACK VAR INJECTION */(function(process) {
-
-function checkDCE() {
- /* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */
- if (
- typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ === 'undefined' ||
- typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE !== 'function'
- ) {
- return;
- }
- if (process.env.NODE_ENV !== 'production') {
- // This branch is unreachable because this function is only called
- // in production, but the condition is true only in development.
- // Therefore if the branch is still here, dead code elimination wasn't
- // properly applied.
- // Don't change the message. React DevTools relies on it. Also make sure
- // this message doesn't occur elsewhere in this function, or it will cause
- // a false positive.
- throw new Error('^_^');
- }
- try {
- // Verify that the code above has been dead code eliminated (DCE'd).
- __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(checkDCE);
- } catch (err) {
- // DevTools shouldn't crash React, no matter what.
- // We should still report in case we break this code.
- console.error(err);
- }
-}
-
-if (process.env.NODE_ENV === 'production') {
- // DCE check should happen before ReactDOM bundle executes so that
- // DevTools can report bad minification during injection.
- checkDCE();
- module.exports = __webpack_require__(44);
-} else {
- module.exports = __webpack_require__(47);
-}
-
-/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(1)))
-
-/***/ }),
-/* 44 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-/** @license React v16.2.0
- * react-dom.production.min.js
- *
- * Copyright (c) 2013-present, Facebook, Inc.
- *
- * This source code is licensed under the MIT license found in the
- * LICENSE file in the root directory of this source tree.
- */
-
-/*
- Modernizr 3.0.0pre (Custom Build) | MIT
-*/
-var aa=__webpack_require__(0),l=__webpack_require__(17),B=__webpack_require__(6),C=__webpack_require__(4),ba=__webpack_require__(18),da=__webpack_require__(19),ea=__webpack_require__(20),fa=__webpack_require__(21),ia=__webpack_require__(22),D=__webpack_require__(8);
-function E(a){for(var b=arguments.length-1,c="Minified React error #"+a+"; visit http://facebook.github.io/react/docs/error-decoder.html?invariant\x3d"+a,d=0;d=g.hasBooleanValue+g.hasNumericValue+g.hasOverloadedBooleanValue?void 0:E("50",f);e.hasOwnProperty(f)&&(g.attributeName=e[f]);d.hasOwnProperty(f)&&(g.attributeNamespace=d[f]);a.hasOwnProperty(f)&&(g.mutationMethod=a[f]);ua[f]=g}}},ua={};
-function va(a,b){if(oa.hasOwnProperty(a)||2this.eventPool.length&&this.eventPool.push(a)}function Jb(a){a.eventPool=[];a.getPooled=Kb;a.release=Lb}function Mb(a,b,c,d){return T.call(this,a,b,c,d)}T.augmentClass(Mb,{data:null});function Nb(a,b,c,d){return T.call(this,a,b,c,d)}T.augmentClass(Nb,{data:null});var Pb=[9,13,27,32],Vb=l.canUseDOM&&"CompositionEvent"in window,Wb=null;l.canUseDOM&&"documentMode"in document&&(Wb=document.documentMode);var Xb;
-if(Xb=l.canUseDOM&&"TextEvent"in window&&!Wb){var Yb=window.opera;Xb=!("object"===typeof Yb&&"function"===typeof Yb.version&&12>=parseInt(Yb.version(),10))}
-var Zb=Xb,$b=l.canUseDOM&&(!Vb||Wb&&8=Wb),ac=String.fromCharCode(32),bc={beforeInput:{phasedRegistrationNames:{bubbled:"onBeforeInput",captured:"onBeforeInputCapture"},dependencies:["topCompositionEnd","topKeyPress","topTextInput","topPaste"]},compositionEnd:{phasedRegistrationNames:{bubbled:"onCompositionEnd",captured:"onCompositionEndCapture"},dependencies:"topBlur topCompositionEnd topKeyDown topKeyPress topKeyUp topMouseDown".split(" ")},compositionStart:{phasedRegistrationNames:{bubbled:"onCompositionStart",
-captured:"onCompositionStartCapture"},dependencies:"topBlur topCompositionStart topKeyDown topKeyPress topKeyUp topMouseDown".split(" ")},compositionUpdate:{phasedRegistrationNames:{bubbled:"onCompositionUpdate",captured:"onCompositionUpdateCapture"},dependencies:"topBlur topCompositionUpdate topKeyDown topKeyPress topKeyUp topMouseDown".split(" ")}},cc=!1;
-function dc(a,b){switch(a){case "topKeyUp":return-1!==Pb.indexOf(b.keyCode);case "topKeyDown":return 229!==b.keyCode;case "topKeyPress":case "topMouseDown":case "topBlur":return!0;default:return!1}}function ec(a){a=a.detail;return"object"===typeof a&&"data"in a?a.data:null}var fc=!1;function gc(a,b){switch(a){case "topCompositionEnd":return ec(b);case "topKeyPress":if(32!==b.which)return null;cc=!0;return ac;case "topTextInput":return a=b.data,a===ac&&cc?null:a;default:return null}}
-function hc(a,b){if(fc)return"topCompositionEnd"===a||!Vb&&dc(a,b)?(a=Fb(),S._root=null,S._startText=null,S._fallbackText=null,fc=!1,a):null;switch(a){case "topPaste":return null;case "topKeyPress":if(!(b.ctrlKey||b.altKey||b.metaKey)||b.ctrlKey&&b.altKey){if(b.char&&1qd.length&&qd.push(a)}}}
-var xd=Object.freeze({get _enabled(){return td},get _handleTopLevel(){return sd},setHandleTopLevel:function(a){sd=a},setEnabled:ud,isEnabled:function(){return td},trapBubbledEvent:U,trapCapturedEvent:wd,dispatchEvent:vd});function yd(a,b){var c={};c[a.toLowerCase()]=b.toLowerCase();c["Webkit"+a]="webkit"+b;c["Moz"+a]="moz"+b;c["ms"+a]="MS"+b;c["O"+a]="o"+b.toLowerCase();return c}
-var zd={animationend:yd("Animation","AnimationEnd"),animationiteration:yd("Animation","AnimationIteration"),animationstart:yd("Animation","AnimationStart"),transitionend:yd("Transition","TransitionEnd")},Ad={},Bd={};l.canUseDOM&&(Bd=document.createElement("div").style,"AnimationEvent"in window||(delete zd.animationend.animation,delete zd.animationiteration.animation,delete zd.animationstart.animation),"TransitionEvent"in window||delete zd.transitionend.transition);
-function Cd(a){if(Ad[a])return Ad[a];if(!zd[a])return a;var b=zd[a],c;for(c in b)if(b.hasOwnProperty(c)&&c in Bd)return Ad[a]=b[c];return""}
-var Dd={topAbort:"abort",topAnimationEnd:Cd("animationend")||"animationend",topAnimationIteration:Cd("animationiteration")||"animationiteration",topAnimationStart:Cd("animationstart")||"animationstart",topBlur:"blur",topCancel:"cancel",topCanPlay:"canplay",topCanPlayThrough:"canplaythrough",topChange:"change",topClick:"click",topClose:"close",topCompositionEnd:"compositionend",topCompositionStart:"compositionstart",topCompositionUpdate:"compositionupdate",topContextMenu:"contextmenu",topCopy:"copy",
-topCut:"cut",topDoubleClick:"dblclick",topDrag:"drag",topDragEnd:"dragend",topDragEnter:"dragenter",topDragExit:"dragexit",topDragLeave:"dragleave",topDragOver:"dragover",topDragStart:"dragstart",topDrop:"drop",topDurationChange:"durationchange",topEmptied:"emptied",topEncrypted:"encrypted",topEnded:"ended",topError:"error",topFocus:"focus",topInput:"input",topKeyDown:"keydown",topKeyPress:"keypress",topKeyUp:"keyup",topLoadedData:"loadeddata",topLoad:"load",topLoadedMetadata:"loadedmetadata",topLoadStart:"loadstart",
-topMouseDown:"mousedown",topMouseMove:"mousemove",topMouseOut:"mouseout",topMouseOver:"mouseover",topMouseUp:"mouseup",topPaste:"paste",topPause:"pause",topPlay:"play",topPlaying:"playing",topProgress:"progress",topRateChange:"ratechange",topScroll:"scroll",topSeeked:"seeked",topSeeking:"seeking",topSelectionChange:"selectionchange",topStalled:"stalled",topSuspend:"suspend",topTextInput:"textInput",topTimeUpdate:"timeupdate",topToggle:"toggle",topTouchCancel:"touchcancel",topTouchEnd:"touchend",topTouchMove:"touchmove",
-topTouchStart:"touchstart",topTransitionEnd:Cd("transitionend")||"transitionend",topVolumeChange:"volumechange",topWaiting:"waiting",topWheel:"wheel"},Ed={},Fd=0,Gd="_reactListenersID"+(""+Math.random()).slice(2);function Hd(a){Object.prototype.hasOwnProperty.call(a,Gd)||(a[Gd]=Fd++,Ed[a[Gd]]={});return Ed[a[Gd]]}function Id(a){for(;a&&a.firstChild;)a=a.firstChild;return a}
-function Jd(a,b){var c=Id(a);a=0;for(var d;c;){if(3===c.nodeType){d=a+c.textContent.length;if(a<=b&&d>=b)return{node:c,offset:b-a};a=d}a:{for(;c;){if(c.nextSibling){c=c.nextSibling;break a}c=c.parentNode}c=void 0}c=Id(c)}}function Kd(a){var b=a&&a.nodeName&&a.nodeName.toLowerCase();return b&&("input"===b&&"text"===a.type||"textarea"===b||"true"===a.contentEditable)}
-var Ld=l.canUseDOM&&"documentMode"in document&&11>=document.documentMode,Md={select:{phasedRegistrationNames:{bubbled:"onSelect",captured:"onSelectCapture"},dependencies:"topBlur topContextMenu topFocus topKeyDown topKeyUp topMouseDown topMouseUp topSelectionChange".split(" ")}},Nd=null,Od=null,Pd=null,Qd=!1;
-function Rd(a,b){if(Qd||null==Nd||Nd!==da())return null;var c=Nd;"selectionStart"in c&&Kd(c)?c={start:c.selectionStart,end:c.selectionEnd}:window.getSelection?(c=window.getSelection(),c={anchorNode:c.anchorNode,anchorOffset:c.anchorOffset,focusNode:c.focusNode,focusOffset:c.focusOffset}):c=void 0;return Pd&&ea(Pd,c)?null:(Pd=c,a=T.getPooled(Md.select,Od,a,b),a.type="select",a.target=Nd,Ab(a),a)}
-var Sd={eventTypes:Md,extractEvents:function(a,b,c,d){var e=d.window===d?d.document:9===d.nodeType?d:d.ownerDocument,f;if(!(f=!e)){a:{e=Hd(e);f=Sa.onSelect;for(var g=0;ghe||(a.current=ge[he],ge[he]=null,he--)}function W(a,b){he++;ge[he]=a.current;a.current=b}new Set;var ie={current:D},X={current:!1},je=D;function ke(a){return le(a)?je:ie.current}
-function me(a,b){var c=a.type.contextTypes;if(!c)return D;var d=a.stateNode;if(d&&d.__reactInternalMemoizedUnmaskedChildContext===b)return d.__reactInternalMemoizedMaskedChildContext;var e={},f;for(f in c)e[f]=b[f];d&&(a=a.stateNode,a.__reactInternalMemoizedUnmaskedChildContext=b,a.__reactInternalMemoizedMaskedChildContext=e);return e}function le(a){return 2===a.tag&&null!=a.type.childContextTypes}function ne(a){le(a)&&(V(X,a),V(ie,a))}
-function oe(a,b,c){null!=ie.cursor?E("168"):void 0;W(ie,b,a);W(X,c,a)}function pe(a,b){var c=a.stateNode,d=a.type.childContextTypes;if("function"!==typeof c.getChildContext)return b;c=c.getChildContext();for(var e in c)e in d?void 0:E("108",jd(a)||"Unknown",e);return B({},b,c)}function qe(a){if(!le(a))return!1;var b=a.stateNode;b=b&&b.__reactInternalMemoizedMergedChildContext||D;je=ie.current;W(ie,b,a);W(X,X.current,a);return!0}
-function re(a,b){var c=a.stateNode;c?void 0:E("169");if(b){var d=pe(a,je);c.__reactInternalMemoizedMergedChildContext=d;V(X,a);V(ie,a);W(ie,d,a)}else V(X,a);W(X,b,a)}
-function Y(a,b,c){this.tag=a;this.key=b;this.stateNode=this.type=null;this.sibling=this.child=this["return"]=null;this.index=0;this.memoizedState=this.updateQueue=this.memoizedProps=this.pendingProps=this.ref=null;this.internalContextTag=c;this.effectTag=0;this.lastEffect=this.firstEffect=this.nextEffect=null;this.expirationTime=0;this.alternate=null}
-function se(a,b,c){var d=a.alternate;null===d?(d=new Y(a.tag,a.key,a.internalContextTag),d.type=a.type,d.stateNode=a.stateNode,d.alternate=a,a.alternate=d):(d.effectTag=0,d.nextEffect=null,d.firstEffect=null,d.lastEffect=null);d.expirationTime=c;d.pendingProps=b;d.child=a.child;d.memoizedProps=a.memoizedProps;d.memoizedState=a.memoizedState;d.updateQueue=a.updateQueue;d.sibling=a.sibling;d.index=a.index;d.ref=a.ref;return d}
-function te(a,b,c){var d=void 0,e=a.type,f=a.key;"function"===typeof e?(d=e.prototype&&e.prototype.isReactComponent?new Y(2,f,b):new Y(0,f,b),d.type=e,d.pendingProps=a.props):"string"===typeof e?(d=new Y(5,f,b),d.type=e,d.pendingProps=a.props):"object"===typeof e&&null!==e&&"number"===typeof e.tag?(d=e,d.pendingProps=a.props):E("130",null==e?e:typeof e,"");d.expirationTime=c;return d}function ue(a,b,c,d){b=new Y(10,d,b);b.pendingProps=a;b.expirationTime=c;return b}
-function ve(a,b,c){b=new Y(6,null,b);b.pendingProps=a;b.expirationTime=c;return b}function we(a,b,c){b=new Y(7,a.key,b);b.type=a.handler;b.pendingProps=a;b.expirationTime=c;return b}function xe(a,b,c){a=new Y(9,null,b);a.expirationTime=c;return a}function ye(a,b,c){b=new Y(4,a.key,b);b.pendingProps=a.children||[];b.expirationTime=c;b.stateNode={containerInfo:a.containerInfo,pendingChildren:null,implementation:a.implementation};return b}var ze=null,Ae=null;
-function Be(a){return function(b){try{return a(b)}catch(c){}}}function Ce(a){if("undefined"===typeof __REACT_DEVTOOLS_GLOBAL_HOOK__)return!1;var b=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(b.isDisabled||!b.supportsFiber)return!0;try{var c=b.inject(a);ze=Be(function(a){return b.onCommitFiberRoot(c,a)});Ae=Be(function(a){return b.onCommitFiberUnmount(c,a)})}catch(d){}return!0}function De(a){"function"===typeof ze&&ze(a)}function Ee(a){"function"===typeof Ae&&Ae(a)}
-function Fe(a){return{baseState:a,expirationTime:0,first:null,last:null,callbackList:null,hasForceUpdate:!1,isInitialized:!1}}function Ge(a,b){null===a.last?a.first=a.last=b:(a.last.next=b,a.last=b);if(0===a.expirationTime||a.expirationTime>b.expirationTime)a.expirationTime=b.expirationTime}
-function He(a,b){var c=a.alternate,d=a.updateQueue;null===d&&(d=a.updateQueue=Fe(null));null!==c?(a=c.updateQueue,null===a&&(a=c.updateQueue=Fe(null))):a=null;a=a!==d?a:null;null===a?Ge(d,b):null===d.last||null===a.last?(Ge(d,b),Ge(a,b)):(Ge(d,b),a.last=b)}function Ie(a,b,c,d){a=a.partialState;return"function"===typeof a?a.call(b,c,d):a}
-function Je(a,b,c,d,e,f){null!==a&&a.updateQueue===c&&(c=b.updateQueue={baseState:c.baseState,expirationTime:c.expirationTime,first:c.first,last:c.last,isInitialized:c.isInitialized,callbackList:null,hasForceUpdate:!1});c.expirationTime=0;c.isInitialized?a=c.baseState:(a=c.baseState=b.memoizedState,c.isInitialized=!0);for(var g=!0,h=c.first,k=!1;null!==h;){var q=h.expirationTime;if(q>f){var v=c.expirationTime;if(0===v||v>q)c.expirationTime=q;k||(k=!0,c.baseState=a)}else{k||(c.first=h.next,null===
-c.first&&(c.last=null));if(h.isReplace)a=Ie(h,d,a,e),g=!0;else if(q=Ie(h,d,a,e))a=g?B({},a,q):B(a,q),g=!1;h.isForced&&(c.hasForceUpdate=!0);null!==h.callback&&(q=c.callbackList,null===q&&(q=c.callbackList=[]),q.push(h))}h=h.next}null!==c.callbackList?b.effectTag|=32:null!==c.first||c.hasForceUpdate||(b.updateQueue=null);k||(c.baseState=a);return a}
-function Ke(a,b){var c=a.callbackList;if(null!==c)for(a.callbackList=null,a=0;aw?(k=n,n=null):k=n.sibling;var x=G(e,n,m[w],A);if(null===x){null===n&&(n=k);break}a&&n&&null===x.alternate&&b(e,n);g=f(x,g,w);null===r?h=x:r.sibling=x;r=x;n=k}if(w===m.length)return c(e,n),h;if(null===n){for(;ww?(k=n,n=null):k=n.sibling;var J=G(e,n,x.value,A);if(null===J){n||(n=k);break}a&&n&&null===J.alternate&&b(e,n);g=f(J,
-g,w);null===r?h=J:r.sibling=J;r=J;n=k}if(x.done)return c(e,n),h;if(null===n){for(;!x.done;w++,x=m.next())x=z(e,x.value,A),null!==x&&(g=f(x,g,w),null===r?h=x:r.sibling=x,r=x);return h}for(n=d(e,n);!x.done;w++,x=m.next())if(x=I(n,e,w,x.value,A),null!==x){if(a&&null!==x.alternate)n["delete"](null===x.key?w:x.key);g=f(x,g,w);null===r?h=x:r.sibling=x;r=x}a&&n.forEach(function(a){return b(e,a)});return h}return function(a,d,f,h){"object"===typeof f&&null!==f&&f.type===Ve&&null===f.key&&(f=f.props.children);
-var m="object"===typeof f&&null!==f;if(m)switch(f.$$typeof){case Re:a:{var r=f.key;for(m=d;null!==m;){if(m.key===r)if(10===m.tag?f.type===Ve:m.type===f.type){c(a,m.sibling);d=e(m,f.type===Ve?f.props.children:f.props,h);d.ref=Ze(m,f);d["return"]=a;a=d;break a}else{c(a,m);break}else b(a,m);m=m.sibling}f.type===Ve?(d=ue(f.props.children,a.internalContextTag,h,f.key),d["return"]=a,a=d):(h=te(f,a.internalContextTag,h),h.ref=Ze(d,f),h["return"]=a,a=h)}return g(a);case Se:a:{for(m=f.key;null!==d;){if(d.key===
-m)if(7===d.tag){c(a,d.sibling);d=e(d,f,h);d["return"]=a;a=d;break a}else{c(a,d);break}else b(a,d);d=d.sibling}d=we(f,a.internalContextTag,h);d["return"]=a;a=d}return g(a);case Te:a:{if(null!==d)if(9===d.tag){c(a,d.sibling);d=e(d,null,h);d.type=f.value;d["return"]=a;a=d;break a}else c(a,d);d=xe(f,a.internalContextTag,h);d.type=f.value;d["return"]=a;a=d}return g(a);case Ue:a:{for(m=f.key;null!==d;){if(d.key===m)if(4===d.tag&&d.stateNode.containerInfo===f.containerInfo&&d.stateNode.implementation===
-f.implementation){c(a,d.sibling);d=e(d,f.children||[],h);d["return"]=a;a=d;break a}else{c(a,d);break}else b(a,d);d=d.sibling}d=ye(f,a.internalContextTag,h);d["return"]=a;a=d}return g(a)}if("string"===typeof f||"number"===typeof f)return f=""+f,null!==d&&6===d.tag?(c(a,d.sibling),d=e(d,f,h)):(c(a,d),d=ve(f,a.internalContextTag,h)),d["return"]=a,a=d,g(a);if(Ye(f))return L(a,d,f,h);if(Xe(f))return N(a,d,f,h);m&&$e(a,f);if("undefined"===typeof f)switch(a.tag){case 2:case 1:h=a.type,E("152",h.displayName||
-h.name||"Component")}return c(a,d)}}var bf=af(!0),cf=af(!1);
-function df(a,b,c,d,e){function f(a,b,c){var d=b.expirationTime;b.child=null===a?cf(b,null,c,d):bf(b,a.child,c,d)}function g(a,b){var c=b.ref;null===c||a&&a.ref===c||(b.effectTag|=128)}function h(a,b,c,d){g(a,b);if(!c)return d&&re(b,!1),q(a,b);c=b.stateNode;id.current=b;var e=c.render();b.effectTag|=1;f(a,b,e);b.memoizedState=c.state;b.memoizedProps=c.props;d&&re(b,!0);return b.child}function k(a){var b=a.stateNode;b.pendingContext?oe(a,b.pendingContext,b.pendingContext!==b.context):b.context&&oe(a,
-b.context,!1);I(a,b.containerInfo)}function q(a,b){null!==a&&b.child!==a.child?E("153"):void 0;if(null!==b.child){a=b.child;var c=se(a,a.pendingProps,a.expirationTime);b.child=c;for(c["return"]=b;null!==a.sibling;)a=a.sibling,c=c.sibling=se(a,a.pendingProps,a.expirationTime),c["return"]=b;c.sibling=null}return b.child}function v(a,b){switch(b.tag){case 3:k(b);break;case 2:qe(b);break;case 4:I(b,b.stateNode.containerInfo)}return null}var y=a.shouldSetTextContent,u=a.useSyncScheduling,z=a.shouldDeprioritizeSubtree,
-G=b.pushHostContext,I=b.pushHostContainer,L=c.enterHydrationState,N=c.resetHydrationState,J=c.tryToClaimNextHydratableInstance;a=Le(d,e,function(a,b){a.memoizedProps=b},function(a,b){a.memoizedState=b});var w=a.adoptClassInstance,m=a.constructClassInstance,A=a.mountClassInstance,Ob=a.updateClassInstance;return{beginWork:function(a,b,c){if(0===b.expirationTime||b.expirationTime>c)return v(a,b);switch(b.tag){case 0:null!==a?E("155"):void 0;var d=b.type,e=b.pendingProps,r=ke(b);r=me(b,r);d=d(e,r);b.effectTag|=
-1;"object"===typeof d&&null!==d&&"function"===typeof d.render?(b.tag=2,e=qe(b),w(b,d),A(b,c),b=h(a,b,!0,e)):(b.tag=1,f(a,b,d),b.memoizedProps=e,b=b.child);return b;case 1:a:{e=b.type;c=b.pendingProps;d=b.memoizedProps;if(X.current)null===c&&(c=d);else if(null===c||d===c){b=q(a,b);break a}d=ke(b);d=me(b,d);e=e(c,d);b.effectTag|=1;f(a,b,e);b.memoizedProps=c;b=b.child}return b;case 2:return e=qe(b),d=void 0,null===a?b.stateNode?E("153"):(m(b,b.pendingProps),A(b,c),d=!0):d=Ob(a,b,c),h(a,b,d,e);case 3:return k(b),
-e=b.updateQueue,null!==e?(d=b.memoizedState,e=Je(a,b,e,null,null,c),d===e?(N(),b=q(a,b)):(d=e.element,r=b.stateNode,(null===a||null===a.child)&&r.hydrate&&L(b)?(b.effectTag|=2,b.child=cf(b,null,d,c)):(N(),f(a,b,d)),b.memoizedState=e,b=b.child)):(N(),b=q(a,b)),b;case 5:G(b);null===a&&J(b);e=b.type;var n=b.memoizedProps;d=b.pendingProps;null===d&&(d=n,null===d?E("154"):void 0);r=null!==a?a.memoizedProps:null;X.current||null!==d&&n!==d?(n=d.children,y(e,d)?n=null:r&&y(e,r)&&(b.effectTag|=16),g(a,b),
-2147483647!==c&&!u&&z(e,d)?(b.expirationTime=2147483647,b=null):(f(a,b,n),b.memoizedProps=d,b=b.child)):b=q(a,b);return b;case 6:return null===a&&J(b),a=b.pendingProps,null===a&&(a=b.memoizedProps),b.memoizedProps=a,null;case 8:b.tag=7;case 7:e=b.pendingProps;if(X.current)null===e&&(e=a&&a.memoizedProps,null===e?E("154"):void 0);else if(null===e||b.memoizedProps===e)e=b.memoizedProps;d=e.children;b.stateNode=null===a?cf(b,b.stateNode,d,c):bf(b,b.stateNode,d,c);b.memoizedProps=e;return b.stateNode;
-case 9:return null;case 4:a:{I(b,b.stateNode.containerInfo);e=b.pendingProps;if(X.current)null===e&&(e=a&&a.memoizedProps,null==e?E("154"):void 0);else if(null===e||b.memoizedProps===e){b=q(a,b);break a}null===a?b.child=bf(b,null,e,c):f(a,b,e);b.memoizedProps=e;b=b.child}return b;case 10:a:{c=b.pendingProps;if(X.current)null===c&&(c=b.memoizedProps);else if(null===c||b.memoizedProps===c){b=q(a,b);break a}f(a,b,c);b.memoizedProps=c;b=b.child}return b;default:E("156")}},beginFailedWork:function(a,b,
-c){switch(b.tag){case 2:qe(b);break;case 3:k(b);break;default:E("157")}b.effectTag|=64;null===a?b.child=null:b.child!==a.child&&(b.child=a.child);if(0===b.expirationTime||b.expirationTime>c)return v(a,b);b.firstEffect=null;b.lastEffect=null;b.child=null===a?cf(b,null,null,c):bf(b,a.child,null,c);2===b.tag&&(a=b.stateNode,b.memoizedProps=a.props,b.memoizedState=a.state);return b.child}}}
-function ef(a,b,c){function d(a){a.effectTag|=4}var e=a.createInstance,f=a.createTextInstance,g=a.appendInitialChild,h=a.finalizeInitialChildren,k=a.prepareUpdate,q=a.persistence,v=b.getRootHostContainer,y=b.popHostContext,u=b.getHostContext,z=b.popHostContainer,G=c.prepareToHydrateHostInstance,I=c.prepareToHydrateHostTextInstance,L=c.popHydrationState,N=void 0,J=void 0,w=void 0;a.mutation?(N=function(){},J=function(a,b,c){(b.updateQueue=c)&&d(b)},w=function(a,b,c,e){c!==e&&d(b)}):q?E("235"):E("236");
-return{completeWork:function(a,b,c){var m=b.pendingProps;if(null===m)m=b.memoizedProps;else if(2147483647!==b.expirationTime||2147483647===c)b.pendingProps=null;switch(b.tag){case 1:return null;case 2:return ne(b),null;case 3:z(b);V(X,b);V(ie,b);m=b.stateNode;m.pendingContext&&(m.context=m.pendingContext,m.pendingContext=null);if(null===a||null===a.child)L(b),b.effectTag&=-3;N(b);return null;case 5:y(b);c=v();var A=b.type;if(null!==a&&null!=b.stateNode){var p=a.memoizedProps,q=b.stateNode,x=u();q=
-k(q,A,p,m,c,x);J(a,b,q,A,p,m,c);a.ref!==b.ref&&(b.effectTag|=128)}else{if(!m)return null===b.stateNode?E("166"):void 0,null;a=u();if(L(b))G(b,c,a)&&d(b);else{a=e(A,m,c,a,b);a:for(p=b.child;null!==p;){if(5===p.tag||6===p.tag)g(a,p.stateNode);else if(4!==p.tag&&null!==p.child){p.child["return"]=p;p=p.child;continue}if(p===b)break;for(;null===p.sibling;){if(null===p["return"]||p["return"]===b)break a;p=p["return"]}p.sibling["return"]=p["return"];p=p.sibling}h(a,A,m,c)&&d(b);b.stateNode=a}null!==b.ref&&
-(b.effectTag|=128)}return null;case 6:if(a&&null!=b.stateNode)w(a,b,a.memoizedProps,m);else{if("string"!==typeof m)return null===b.stateNode?E("166"):void 0,null;a=v();c=u();L(b)?I(b)&&d(b):b.stateNode=f(m,a,c,b)}return null;case 7:(m=b.memoizedProps)?void 0:E("165");b.tag=8;A=[];a:for((p=b.stateNode)&&(p["return"]=b);null!==p;){if(5===p.tag||6===p.tag||4===p.tag)E("247");else if(9===p.tag)A.push(p.type);else if(null!==p.child){p.child["return"]=p;p=p.child;continue}for(;null===p.sibling;){if(null===
-p["return"]||p["return"]===b)break a;p=p["return"]}p.sibling["return"]=p["return"];p=p.sibling}p=m.handler;m=p(m.props,A);b.child=bf(b,null!==a?a.child:null,m,c);return b.child;case 8:return b.tag=7,null;case 9:return null;case 10:return null;case 4:return z(b),N(b),null;case 0:E("167");default:E("156")}}}}
-function ff(a,b){function c(a){var c=a.ref;if(null!==c)try{c(null)}catch(A){b(a,A)}}function d(a){"function"===typeof Ee&&Ee(a);switch(a.tag){case 2:c(a);var d=a.stateNode;if("function"===typeof d.componentWillUnmount)try{d.props=a.memoizedProps,d.state=a.memoizedState,d.componentWillUnmount()}catch(A){b(a,A)}break;case 5:c(a);break;case 7:e(a.stateNode);break;case 4:k&&g(a)}}function e(a){for(var b=a;;)if(d(b),null===b.child||k&&4===b.tag){if(b===a)break;for(;null===b.sibling;){if(null===b["return"]||
-b["return"]===a)return;b=b["return"]}b.sibling["return"]=b["return"];b=b.sibling}else b.child["return"]=b,b=b.child}function f(a){return 5===a.tag||3===a.tag||4===a.tag}function g(a){for(var b=a,c=!1,f=void 0,g=void 0;;){if(!c){c=b["return"];a:for(;;){null===c?E("160"):void 0;switch(c.tag){case 5:f=c.stateNode;g=!1;break a;case 3:f=c.stateNode.containerInfo;g=!0;break a;case 4:f=c.stateNode.containerInfo;g=!0;break a}c=c["return"]}c=!0}if(5===b.tag||6===b.tag)e(b),g?J(f,b.stateNode):N(f,b.stateNode);
-else if(4===b.tag?f=b.stateNode.containerInfo:d(b),null!==b.child){b.child["return"]=b;b=b.child;continue}if(b===a)break;for(;null===b.sibling;){if(null===b["return"]||b["return"]===a)return;b=b["return"];4===b.tag&&(c=!1)}b.sibling["return"]=b["return"];b=b.sibling}}var h=a.getPublicInstance,k=a.mutation;a=a.persistence;k||(a?E("235"):E("236"));var q=k.commitMount,v=k.commitUpdate,y=k.resetTextContent,u=k.commitTextUpdate,z=k.appendChild,G=k.appendChildToContainer,I=k.insertBefore,L=k.insertInContainerBefore,
-N=k.removeChild,J=k.removeChildFromContainer;return{commitResetTextContent:function(a){y(a.stateNode)},commitPlacement:function(a){a:{for(var b=a["return"];null!==b;){if(f(b)){var c=b;break a}b=b["return"]}E("160");c=void 0}var d=b=void 0;switch(c.tag){case 5:b=c.stateNode;d=!1;break;case 3:b=c.stateNode.containerInfo;d=!0;break;case 4:b=c.stateNode.containerInfo;d=!0;break;default:E("161")}c.effectTag&16&&(y(b),c.effectTag&=-17);a:b:for(c=a;;){for(;null===c.sibling;){if(null===c["return"]||f(c["return"])){c=
-null;break a}c=c["return"]}c.sibling["return"]=c["return"];for(c=c.sibling;5!==c.tag&&6!==c.tag;){if(c.effectTag&2)continue b;if(null===c.child||4===c.tag)continue b;else c.child["return"]=c,c=c.child}if(!(c.effectTag&2)){c=c.stateNode;break a}}for(var e=a;;){if(5===e.tag||6===e.tag)c?d?L(b,e.stateNode,c):I(b,e.stateNode,c):d?G(b,e.stateNode):z(b,e.stateNode);else if(4!==e.tag&&null!==e.child){e.child["return"]=e;e=e.child;continue}if(e===a)break;for(;null===e.sibling;){if(null===e["return"]||e["return"]===
-a)return;e=e["return"]}e.sibling["return"]=e["return"];e=e.sibling}},commitDeletion:function(a){g(a);a["return"]=null;a.child=null;a.alternate&&(a.alternate.child=null,a.alternate["return"]=null)},commitWork:function(a,b){switch(b.tag){case 2:break;case 5:var c=b.stateNode;if(null!=c){var d=b.memoizedProps;a=null!==a?a.memoizedProps:d;var e=b.type,f=b.updateQueue;b.updateQueue=null;null!==f&&v(c,f,e,a,d,b)}break;case 6:null===b.stateNode?E("162"):void 0;c=b.memoizedProps;u(b.stateNode,null!==a?a.memoizedProps:
-c,c);break;case 3:break;default:E("163")}},commitLifeCycles:function(a,b){switch(b.tag){case 2:var c=b.stateNode;if(b.effectTag&4)if(null===a)c.props=b.memoizedProps,c.state=b.memoizedState,c.componentDidMount();else{var d=a.memoizedProps;a=a.memoizedState;c.props=b.memoizedProps;c.state=b.memoizedState;c.componentDidUpdate(d,a)}b=b.updateQueue;null!==b&&Ke(b,c);break;case 3:c=b.updateQueue;null!==c&&Ke(c,null!==b.child?b.child.stateNode:null);break;case 5:c=b.stateNode;null===a&&b.effectTag&4&&q(c,
-b.type,b.memoizedProps,b);break;case 6:break;case 4:break;default:E("163")}},commitAttachRef:function(a){var b=a.ref;if(null!==b){var c=a.stateNode;switch(a.tag){case 5:b(h(c));break;default:b(c)}}},commitDetachRef:function(a){a=a.ref;null!==a&&a(null)}}}var gf={};
-function hf(a){function b(a){a===gf?E("174"):void 0;return a}var c=a.getChildHostContext,d=a.getRootHostContext,e={current:gf},f={current:gf},g={current:gf};return{getHostContext:function(){return b(e.current)},getRootHostContainer:function(){return b(g.current)},popHostContainer:function(a){V(e,a);V(f,a);V(g,a)},popHostContext:function(a){f.current===a&&(V(e,a),V(f,a))},pushHostContainer:function(a,b){W(g,b,a);b=d(b);W(f,a,a);W(e,b,a)},pushHostContext:function(a){var d=b(g.current),h=b(e.current);
-d=c(h,a.type,d);h!==d&&(W(f,a,a),W(e,d,a))},resetHostContainer:function(){e.current=gf;g.current=gf}}}
-function jf(a){function b(a,b){var c=new Y(5,null,0);c.type="DELETED";c.stateNode=b;c["return"]=a;c.effectTag=8;null!==a.lastEffect?(a.lastEffect.nextEffect=c,a.lastEffect=c):a.firstEffect=a.lastEffect=c}function c(a,b){switch(a.tag){case 5:return b=f(b,a.type,a.pendingProps),null!==b?(a.stateNode=b,!0):!1;case 6:return b=g(b,a.pendingProps),null!==b?(a.stateNode=b,!0):!1;default:return!1}}function d(a){for(a=a["return"];null!==a&&5!==a.tag&&3!==a.tag;)a=a["return"];y=a}var e=a.shouldSetTextContent;
-a=a.hydration;if(!a)return{enterHydrationState:function(){return!1},resetHydrationState:function(){},tryToClaimNextHydratableInstance:function(){},prepareToHydrateHostInstance:function(){E("175")},prepareToHydrateHostTextInstance:function(){E("176")},popHydrationState:function(){return!1}};var f=a.canHydrateInstance,g=a.canHydrateTextInstance,h=a.getNextHydratableSibling,k=a.getFirstHydratableChild,q=a.hydrateInstance,v=a.hydrateTextInstance,y=null,u=null,z=!1;return{enterHydrationState:function(a){u=
-k(a.stateNode.containerInfo);y=a;return z=!0},resetHydrationState:function(){u=y=null;z=!1},tryToClaimNextHydratableInstance:function(a){if(z){var d=u;if(d){if(!c(a,d)){d=h(d);if(!d||!c(a,d)){a.effectTag|=2;z=!1;y=a;return}b(y,u)}y=a;u=k(d)}else a.effectTag|=2,z=!1,y=a}},prepareToHydrateHostInstance:function(a,b,c){b=q(a.stateNode,a.type,a.memoizedProps,b,c,a);a.updateQueue=b;return null!==b?!0:!1},prepareToHydrateHostTextInstance:function(a){return v(a.stateNode,a.memoizedProps,a)},popHydrationState:function(a){if(a!==
-y)return!1;if(!z)return d(a),z=!0,!1;var c=a.type;if(5!==a.tag||"head"!==c&&"body"!==c&&!e(c,a.memoizedProps))for(c=u;c;)b(a,c),c=h(c);d(a);u=y?h(a.stateNode):null;return!0}}}
-function kf(a){function b(a){Qb=ja=!0;var b=a.stateNode;b.current===a?E("177"):void 0;b.isReadyForCommit=!1;id.current=null;if(1g.expirationTime)&&(f=g.expirationTime),g=g.sibling;e.expirationTime=f}if(null!==b)return b;null!==c&&(null===c.firstEffect&&(c.firstEffect=a.firstEffect),null!==a.lastEffect&&(null!==c.lastEffect&&(c.lastEffect.nextEffect=a.firstEffect),c.lastEffect=a.lastEffect),1a))if(H<=Uc)for(;null!==F;)F=k(F)?e(F):d(F);else for(;null!==F&&!A();)F=k(F)?e(F):d(F)}else if(!(0===H||H>a))if(H<=Uc)for(;null!==F;)F=d(F);else for(;null!==F&&!A();)F=d(F)}function g(a,b){ja?E("243"):void 0;ja=!0;a.isReadyForCommit=
-!1;if(a!==ra||b!==H||null===F){for(;-1b)a.expirationTime=b;null!==a.alternate&&(0===a.alternate.expirationTime||a.alternate.expirationTime>b)&&(a.alternate.expirationTime=b);if(null===a["return"])if(3===a.tag){var c=a.stateNode;!ja&&c===ra&&bIg&&E("185");if(null===d.nextScheduledRoot)d.remainingExpirationTime=e,null===O?(sa=O=d,d.nextScheduledRoot=d):(O=O.nextScheduledRoot=d,O.nextScheduledRoot=sa);else{var f=d.remainingExpirationTime;if(0===f||eTb)return;Jg(Xc)}var b=Wc()-Pe;Tb=a;Xc=Kg(J,{timeout:10*(a-2)-b})}function N(){var a=0,b=null;if(null!==O)for(var c=O,d=sa;null!==d;){var e=d.remainingExpirationTime;if(0===e){null===c||null===O?E("244"):void 0;if(d===d.nextScheduledRoot){sa=O=d.nextScheduledRoot=null;break}else if(d===sa)sa=e=d.nextScheduledRoot,
-O.nextScheduledRoot=e,d.nextScheduledRoot=null;else if(d===O){O=c;O.nextScheduledRoot=sa;d.nextScheduledRoot=null;break}else c.nextScheduledRoot=d.nextScheduledRoot,d.nextScheduledRoot=null;d=c.nextScheduledRoot}else{if(0===a||eLg?!1:Yc=!0}function Ob(a){null===ma?E("246"):
-void 0;ma.remainingExpirationTime=0;Ub||(Ub=!0,Zc=a)}var r=hf(a),n=jf(a),p=r.popHostContainer,qg=r.popHostContext,x=r.resetHostContainer,Me=df(a,r,n,u,y),rg=Me.beginWork,Gg=Me.beginFailedWork,Fg=ef(a,r,n).completeWork;r=ff(a,h);var zg=r.commitResetTextContent,Ne=r.commitPlacement,Bg=r.commitDeletion,Oe=r.commitWork,Dg=r.commitLifeCycles,Eg=r.commitAttachRef,Ag=r.commitDetachRef,Wc=a.now,Kg=a.scheduleDeferredCallback,Jg=a.cancelDeferredCallback,Hg=a.useSyncScheduling,yg=a.prepareForCommit,Cg=a.resetAfterCommit,
-Pe=Wc(),Uc=2,ka=0,ja=!1,F=null,ra=null,H=0,t=null,R=null,qa=null,ha=null,ca=null,eb=!1,Qb=!1,Sc=!1,sa=null,O=null,Tb=0,Xc=-1,Fa=!1,ma=null,na=0,Yc=!1,Ub=!1,Zc=null,fb=null,la=!1,Sb=!1,Ig=1E3,Rb=0,Lg=1;return{computeAsyncExpiration:v,computeExpirationForFiber:y,scheduleWork:u,batchedUpdates:function(a,b){var c=la;la=!0;try{return a(b)}finally{(la=c)||Fa||w(1,null)}},unbatchedUpdates:function(a){if(la&&!Sb){Sb=!0;try{return a()}finally{Sb=!1}}return a()},flushSync:function(a){var b=la;la=!0;try{a:{var c=
-ka;ka=1;try{var d=a();break a}finally{ka=c}d=void 0}return d}finally{la=b,Fa?E("187"):void 0,w(1,null)}},deferredUpdates:function(a){var b=ka;ka=v();try{return a()}finally{ka=b}}}}
-function lf(a){function b(a){a=od(a);return null===a?null:a.stateNode}var c=a.getPublicInstance;a=kf(a);var d=a.computeAsyncExpiration,e=a.computeExpirationForFiber,f=a.scheduleWork;return{createContainer:function(a,b){var c=new Y(3,null,0);a={current:c,containerInfo:a,pendingChildren:null,remainingExpirationTime:0,isReadyForCommit:!1,finishedWork:null,context:null,pendingContext:null,hydrate:b,nextScheduledRoot:null};return c.stateNode=a},updateContainer:function(a,b,c,q){var g=b.current;if(c){c=
-c._reactInternalFiber;var h;b:{2===kd(c)&&2===c.tag?void 0:E("170");for(h=c;3!==h.tag;){if(le(h)){h=h.stateNode.__reactInternalMemoizedMergedChildContext;break b}(h=h["return"])?void 0:E("171")}h=h.stateNode.context}c=le(c)?pe(c,h):h}else c=D;null===b.context?b.context=c:b.pendingContext=c;b=q;b=void 0===b?null:b;q=null!=a&&null!=a.type&&null!=a.type.prototype&&!0===a.type.prototype.unstable_isAsyncReactComponent?d():e(g);He(g,{expirationTime:q,partialState:{element:a},callback:b,isReplace:!1,isForced:!1,
-nextCallback:null,next:null});f(g,q)},batchedUpdates:a.batchedUpdates,unbatchedUpdates:a.unbatchedUpdates,deferredUpdates:a.deferredUpdates,flushSync:a.flushSync,getPublicRootInstance:function(a){a=a.current;if(!a.child)return null;switch(a.child.tag){case 5:return c(a.child.stateNode);default:return a.child.stateNode}},findHostInstance:b,findHostInstanceWithNoPortals:function(a){a=pd(a);return null===a?null:a.stateNode},injectIntoDevTools:function(a){var c=a.findFiberByHostInstance;return Ce(B({},
-a,{findHostInstanceByFiber:function(a){return b(a)},findFiberByHostInstance:function(a){return c?c(a):null}}))}}}var mf=Object.freeze({default:lf}),nf=mf&&lf||mf,of=nf["default"]?nf["default"]:nf;function pf(a,b,c){var d=3=yf-a)if(-1!==wf&&wf<=
-a)Bf.didTimeout=!0;else{xf||(xf=!0,requestAnimationFrame(Df));return}else Bf.didTimeout=!1;wf=-1;a=uf;uf=null;null!==a&&a(Bf)}},!1);var Df=function(a){xf=!1;var b=a-yf+Af;bb&&(b=8),Af=bc||d.hasOverloadedBooleanValue&&!1===c?Jf(a,b):d.mustUseProperty?a[d.propertyName]=c:(b=d.attributeName,(e=d.attributeNamespace)?a.setAttributeNS(e,b,""+c):d.hasBooleanValue||d.hasOverloadedBooleanValue&&!0===c?a.setAttribute(b,""):a.setAttribute(b,""+c))}else Kf(a,b,va(b,c)?c:null)}
-function Kf(a,b,c){Hf(b)&&(null==c?a.removeAttribute(b):a.setAttribute(b,""+c))}function Jf(a,b){var c=wa(b);c?(b=c.mutationMethod)?b(a,void 0):c.mustUseProperty?a[c.propertyName]=c.hasBooleanValue?!1:"":a.removeAttribute(c.attributeName):a.removeAttribute(b)}
-function Lf(a,b){var c=b.value,d=b.checked;return B({type:void 0,step:void 0,min:void 0,max:void 0},b,{defaultChecked:void 0,defaultValue:void 0,value:null!=c?c:a._wrapperState.initialValue,checked:null!=d?d:a._wrapperState.initialChecked})}function Mf(a,b){var c=b.defaultValue;a._wrapperState={initialChecked:null!=b.checked?b.checked:b.defaultChecked,initialValue:null!=b.value?b.value:c,controlled:"checkbox"===b.type||"radio"===b.type?null!=b.checked:null!=b.value}}
-function Nf(a,b){b=b.checked;null!=b&&If(a,"checked",b)}function Of(a,b){Nf(a,b);var c=b.value;if(null!=c)if(0===c&&""===a.value)a.value="0";else if("number"===b.type){if(b=parseFloat(a.value)||0,c!=b||c==b&&a.value!=c)a.value=""+c}else a.value!==""+c&&(a.value=""+c);else null==b.value&&null!=b.defaultValue&&a.defaultValue!==""+b.defaultValue&&(a.defaultValue=""+b.defaultValue),null==b.checked&&null!=b.defaultChecked&&(a.defaultChecked=!!b.defaultChecked)}
-function Pf(a,b){switch(b.type){case "submit":case "reset":break;case "color":case "date":case "datetime":case "datetime-local":case "month":case "time":case "week":a.value="";a.value=a.defaultValue;break;default:a.value=a.value}b=a.name;""!==b&&(a.name="");a.defaultChecked=!a.defaultChecked;a.defaultChecked=!a.defaultChecked;""!==b&&(a.name=b)}function Qf(a){var b="";aa.Children.forEach(a,function(a){null==a||"string"!==typeof a&&"number"!==typeof a||(b+=a)});return b}
-function Rf(a,b){a=B({children:void 0},b);if(b=Qf(b.children))a.children=b;return a}function Sf(a,b,c,d){a=a.options;if(b){b={};for(var e=0;e=b.length?void 0:E("93"),b=b[0]),c=""+b),null==c&&(c=""));a._wrapperState={initialValue:""+c}}
-function Wf(a,b){var c=b.value;null!=c&&(c=""+c,c!==a.value&&(a.value=c),null==b.defaultValue&&(a.defaultValue=c));null!=b.defaultValue&&(a.defaultValue=b.defaultValue)}function Xf(a){var b=a.textContent;b===a._wrapperState.initialValue&&(a.value=b)}var Yf={html:"http://www.w3.org/1999/xhtml",mathml:"http://www.w3.org/1998/Math/MathML",svg:"http://www.w3.org/2000/svg"};
-function Zf(a){switch(a){case "svg":return"http://www.w3.org/2000/svg";case "math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function $f(a,b){return null==a||"http://www.w3.org/1999/xhtml"===a?Zf(b):"http://www.w3.org/2000/svg"===a&&"foreignObject"===b?"http://www.w3.org/1999/xhtml":a}
-var ag=void 0,bg=function(a){return"undefined"!==typeof MSApp&&MSApp.execUnsafeLocalFunction?function(b,c,d,e){MSApp.execUnsafeLocalFunction(function(){return a(b,c,d,e)})}:a}(function(a,b){if(a.namespaceURI!==Yf.svg||"innerHTML"in a)a.innerHTML=b;else{ag=ag||document.createElement("div");ag.innerHTML="\x3csvg\x3e"+b+"\x3c/svg\x3e";for(b=ag.firstChild;a.firstChild;)a.removeChild(a.firstChild);for(;b.firstChild;)a.appendChild(b.firstChild)}});
-function cg(a,b){if(b){var c=a.firstChild;if(c&&c===a.lastChild&&3===c.nodeType){c.nodeValue=b;return}}a.textContent=b}
-var dg={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,
-stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},eg=["Webkit","ms","Moz","O"];Object.keys(dg).forEach(function(a){eg.forEach(function(b){b=b+a.charAt(0).toUpperCase()+a.substring(1);dg[b]=dg[a]})});
-function fg(a,b){a=a.style;for(var c in b)if(b.hasOwnProperty(c)){var d=0===c.indexOf("--");var e=c;var f=b[c];e=null==f||"boolean"===typeof f||""===f?"":d||"number"!==typeof f||0===f||dg.hasOwnProperty(e)&&dg[e]?(""+f).trim():f+"px";"float"===c&&(c="cssFloat");d?a.setProperty(c,e):a[c]=e}}var gg=B({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});
-function hg(a,b,c){b&&(gg[a]&&(null!=b.children||null!=b.dangerouslySetInnerHTML?E("137",a,c()):void 0),null!=b.dangerouslySetInnerHTML&&(null!=b.children?E("60"):void 0,"object"===typeof b.dangerouslySetInnerHTML&&"__html"in b.dangerouslySetInnerHTML?void 0:E("61")),null!=b.style&&"object"!==typeof b.style?E("62",c()):void 0)}
-function ig(a,b){if(-1===a.indexOf("-"))return"string"===typeof b.is;switch(a){case "annotation-xml":case "color-profile":case "font-face":case "font-face-src":case "font-face-uri":case "font-face-format":case "font-face-name":case "missing-glyph":return!1;default:return!0}}var jg=Yf.html,kg=C.thatReturns("");
-function lg(a,b){a=9===a.nodeType||11===a.nodeType?a:a.ownerDocument;var c=Hd(a);b=Sa[b];for(var d=0;d
-d&&(e=d,d=a,a=e);e=Jd(c,a);var f=Jd(c,d);if(e&&f&&(1!==b.rangeCount||b.anchorNode!==e.node||b.anchorOffset!==e.offset||b.focusNode!==f.node||b.focusOffset!==f.offset)){var g=document.createRange();g.setStart(e.node,e.offset);b.removeAllRanges();a>d?(b.addRange(g),b.extend(f.node,f.offset)):(g.setEnd(f.node,f.offset),b.addRange(g))}}b=[];for(a=c;a=a.parentNode;)1===a.nodeType&&b.push({element:a,left:a.scrollLeft,top:a.scrollTop});ia(c);for(c=0;c 2 && (name[0] === 'o' || name[0] === 'O') && (name[1] === 'n' || name[1] === 'N')) {
- return false;
- }
- if (value === null) {
- return true;
- }
- switch (typeof value) {
- case 'boolean':
- return shouldAttributeAcceptBooleanValue(name);
- case 'undefined':
- case 'number':
- case 'string':
- case 'object':
- return true;
- default:
- // function, symbol
- return false;
- }
-}
-
-function getPropertyInfo(name) {
- return properties.hasOwnProperty(name) ? properties[name] : null;
-}
-
-function shouldAttributeAcceptBooleanValue(name) {
- if (isReservedProp(name)) {
- return true;
- }
- var propertyInfo = getPropertyInfo(name);
- if (propertyInfo) {
- return propertyInfo.hasBooleanValue || propertyInfo.hasStringBooleanValue || propertyInfo.hasOverloadedBooleanValue;
- }
- var prefix = name.toLowerCase().slice(0, 5);
- return prefix === 'data-' || prefix === 'aria-';
-}
-
-/**
- * Checks to see if a property name is within the list of properties
- * reserved for internal React operations. These properties should
- * not be set on an HTML element.
- *
- * @private
- * @param {string} name
- * @return {boolean} If the name is within reserved props
- */
-function isReservedProp(name) {
- return RESERVED_PROPS.hasOwnProperty(name);
-}
-
-var injection = DOMPropertyInjection;
-
-var MUST_USE_PROPERTY = injection.MUST_USE_PROPERTY;
-var HAS_BOOLEAN_VALUE = injection.HAS_BOOLEAN_VALUE;
-var HAS_NUMERIC_VALUE = injection.HAS_NUMERIC_VALUE;
-var HAS_POSITIVE_NUMERIC_VALUE = injection.HAS_POSITIVE_NUMERIC_VALUE;
-var HAS_OVERLOADED_BOOLEAN_VALUE = injection.HAS_OVERLOADED_BOOLEAN_VALUE;
-var HAS_STRING_BOOLEAN_VALUE = injection.HAS_STRING_BOOLEAN_VALUE;
-
-var HTMLDOMPropertyConfig = {
- // When adding attributes to this list, be sure to also add them to
- // the `possibleStandardNames` module to ensure casing and incorrect
- // name warnings.
- Properties: {
- allowFullScreen: HAS_BOOLEAN_VALUE,
- // specifies target context for links with `preload` type
- async: HAS_BOOLEAN_VALUE,
- // Note: there is a special case that prevents it from being written to the DOM
- // on the client side because the browsers are inconsistent. Instead we call focus().
- autoFocus: HAS_BOOLEAN_VALUE,
- autoPlay: HAS_BOOLEAN_VALUE,
- capture: HAS_OVERLOADED_BOOLEAN_VALUE,
- checked: MUST_USE_PROPERTY | HAS_BOOLEAN_VALUE,
- cols: HAS_POSITIVE_NUMERIC_VALUE,
- contentEditable: HAS_STRING_BOOLEAN_VALUE,
- controls: HAS_BOOLEAN_VALUE,
- 'default': HAS_BOOLEAN_VALUE,
- defer: HAS_BOOLEAN_VALUE,
- disabled: HAS_BOOLEAN_VALUE,
- download: HAS_OVERLOADED_BOOLEAN_VALUE,
- draggable: HAS_STRING_BOOLEAN_VALUE,
- formNoValidate: HAS_BOOLEAN_VALUE,
- hidden: HAS_BOOLEAN_VALUE,
- loop: HAS_BOOLEAN_VALUE,
- // Caution; `option.selected` is not updated if `select.multiple` is
- // disabled with `removeAttribute`.
- multiple: MUST_USE_PROPERTY | HAS_BOOLEAN_VALUE,
- muted: MUST_USE_PROPERTY | HAS_BOOLEAN_VALUE,
- noValidate: HAS_BOOLEAN_VALUE,
- open: HAS_BOOLEAN_VALUE,
- playsInline: HAS_BOOLEAN_VALUE,
- readOnly: HAS_BOOLEAN_VALUE,
- required: HAS_BOOLEAN_VALUE,
- reversed: HAS_BOOLEAN_VALUE,
- rows: HAS_POSITIVE_NUMERIC_VALUE,
- rowSpan: HAS_NUMERIC_VALUE,
- scoped: HAS_BOOLEAN_VALUE,
- seamless: HAS_BOOLEAN_VALUE,
- selected: MUST_USE_PROPERTY | HAS_BOOLEAN_VALUE,
- size: HAS_POSITIVE_NUMERIC_VALUE,
- start: HAS_NUMERIC_VALUE,
- // support for projecting regular DOM Elements via V1 named slots ( shadow dom )
- span: HAS_POSITIVE_NUMERIC_VALUE,
- spellCheck: HAS_STRING_BOOLEAN_VALUE,
- // Style must be explicitly set in the attribute list. React components
- // expect a style object
- style: 0,
- // Keep it in the whitelist because it is case-sensitive for SVG.
- tabIndex: 0,
- // itemScope is for for Microdata support.
- // See http://schema.org/docs/gs.html
- itemScope: HAS_BOOLEAN_VALUE,
- // These attributes must stay in the white-list because they have
- // different attribute names (see DOMAttributeNames below)
- acceptCharset: 0,
- className: 0,
- htmlFor: 0,
- httpEquiv: 0,
- // Attributes with mutation methods must be specified in the whitelist
- // Set the string boolean flag to allow the behavior
- value: HAS_STRING_BOOLEAN_VALUE
- },
- DOMAttributeNames: {
- acceptCharset: 'accept-charset',
- className: 'class',
- htmlFor: 'for',
- httpEquiv: 'http-equiv'
- },
- DOMMutationMethods: {
- value: function (node, value) {
- if (value == null) {
- return node.removeAttribute('value');
- }
-
- // Number inputs get special treatment due to some edge cases in
- // Chrome. Let everything else assign the value attribute as normal.
- // https://github.com/facebook/react/issues/7253#issuecomment-236074326
- if (node.type !== 'number' || node.hasAttribute('value') === false) {
- node.setAttribute('value', '' + value);
- } else if (node.validity && !node.validity.badInput && node.ownerDocument.activeElement !== node) {
- // Don't assign an attribute if validation reports bad
- // input. Chrome will clear the value. Additionally, don't
- // operate on inputs that have focus, otherwise Chrome might
- // strip off trailing decimal places and cause the user's
- // cursor position to jump to the beginning of the input.
- //
- // In ReactDOMInput, we have an onBlur event that will trigger
- // this function again when focus is lost.
- node.setAttribute('value', '' + value);
- }
- }
- }
-};
-
-var HAS_STRING_BOOLEAN_VALUE$1 = injection.HAS_STRING_BOOLEAN_VALUE;
-
-
-var NS = {
- xlink: 'http://www.w3.org/1999/xlink',
- xml: 'http://www.w3.org/XML/1998/namespace'
-};
-
-/**
- * This is a list of all SVG attributes that need special casing,
- * namespacing, or boolean value assignment.
- *
- * When adding attributes to this list, be sure to also add them to
- * the `possibleStandardNames` module to ensure casing and incorrect
- * name warnings.
- *
- * SVG Attributes List:
- * https://www.w3.org/TR/SVG/attindex.html
- * SMIL Spec:
- * https://www.w3.org/TR/smil
- */
-var ATTRS = ['accent-height', 'alignment-baseline', 'arabic-form', 'baseline-shift', 'cap-height', 'clip-path', 'clip-rule', 'color-interpolation', 'color-interpolation-filters', 'color-profile', 'color-rendering', 'dominant-baseline', 'enable-background', 'fill-opacity', 'fill-rule', 'flood-color', 'flood-opacity', 'font-family', 'font-size', 'font-size-adjust', 'font-stretch', 'font-style', 'font-variant', 'font-weight', 'glyph-name', 'glyph-orientation-horizontal', 'glyph-orientation-vertical', 'horiz-adv-x', 'horiz-origin-x', 'image-rendering', 'letter-spacing', 'lighting-color', 'marker-end', 'marker-mid', 'marker-start', 'overline-position', 'overline-thickness', 'paint-order', 'panose-1', 'pointer-events', 'rendering-intent', 'shape-rendering', 'stop-color', 'stop-opacity', 'strikethrough-position', 'strikethrough-thickness', 'stroke-dasharray', 'stroke-dashoffset', 'stroke-linecap', 'stroke-linejoin', 'stroke-miterlimit', 'stroke-opacity', 'stroke-width', 'text-anchor', 'text-decoration', 'text-rendering', 'underline-position', 'underline-thickness', 'unicode-bidi', 'unicode-range', 'units-per-em', 'v-alphabetic', 'v-hanging', 'v-ideographic', 'v-mathematical', 'vector-effect', 'vert-adv-y', 'vert-origin-x', 'vert-origin-y', 'word-spacing', 'writing-mode', 'x-height', 'xlink:actuate', 'xlink:arcrole', 'xlink:href', 'xlink:role', 'xlink:show', 'xlink:title', 'xlink:type', 'xml:base', 'xmlns:xlink', 'xml:lang', 'xml:space'];
-
-var SVGDOMPropertyConfig = {
- Properties: {
- autoReverse: HAS_STRING_BOOLEAN_VALUE$1,
- externalResourcesRequired: HAS_STRING_BOOLEAN_VALUE$1,
- preserveAlpha: HAS_STRING_BOOLEAN_VALUE$1
- },
- DOMAttributeNames: {
- autoReverse: 'autoReverse',
- externalResourcesRequired: 'externalResourcesRequired',
- preserveAlpha: 'preserveAlpha'
- },
- DOMAttributeNamespaces: {
- xlinkActuate: NS.xlink,
- xlinkArcrole: NS.xlink,
- xlinkHref: NS.xlink,
- xlinkRole: NS.xlink,
- xlinkShow: NS.xlink,
- xlinkTitle: NS.xlink,
- xlinkType: NS.xlink,
- xmlBase: NS.xml,
- xmlLang: NS.xml,
- xmlSpace: NS.xml
- }
-};
-
-var CAMELIZE = /[\-\:]([a-z])/g;
-var capitalize = function (token) {
- return token[1].toUpperCase();
-};
-
-ATTRS.forEach(function (original) {
- var reactName = original.replace(CAMELIZE, capitalize);
-
- SVGDOMPropertyConfig.Properties[reactName] = 0;
- SVGDOMPropertyConfig.DOMAttributeNames[reactName] = original;
-});
-
-injection.injectDOMPropertyConfig(HTMLDOMPropertyConfig);
-injection.injectDOMPropertyConfig(SVGDOMPropertyConfig);
-
-var ReactErrorUtils = {
- // Used by Fiber to simulate a try-catch.
- _caughtError: null,
- _hasCaughtError: false,
-
- // Used by event system to capture/rethrow the first error.
- _rethrowError: null,
- _hasRethrowError: false,
-
- injection: {
- injectErrorUtils: function (injectedErrorUtils) {
- !(typeof injectedErrorUtils.invokeGuardedCallback === 'function') ? invariant(false, 'Injected invokeGuardedCallback() must be a function.') : void 0;
- invokeGuardedCallback = injectedErrorUtils.invokeGuardedCallback;
- }
- },
-
- /**
- * Call a function while guarding against errors that happens within it.
- * Returns an error if it throws, otherwise null.
- *
- * In production, this is implemented using a try-catch. The reason we don't
- * use a try-catch directly is so that we can swap out a different
- * implementation in DEV mode.
- *
- * @param {String} name of the guard to use for logging or debugging
- * @param {Function} func The function to invoke
- * @param {*} context The context to use when calling the function
- * @param {...*} args Arguments for function
- */
- invokeGuardedCallback: function (name, func, context, a, b, c, d, e, f) {
- invokeGuardedCallback.apply(ReactErrorUtils, arguments);
- },
-
- /**
- * Same as invokeGuardedCallback, but instead of returning an error, it stores
- * it in a global so it can be rethrown by `rethrowCaughtError` later.
- * TODO: See if _caughtError and _rethrowError can be unified.
- *
- * @param {String} name of the guard to use for logging or debugging
- * @param {Function} func The function to invoke
- * @param {*} context The context to use when calling the function
- * @param {...*} args Arguments for function
- */
- invokeGuardedCallbackAndCatchFirstError: function (name, func, context, a, b, c, d, e, f) {
- ReactErrorUtils.invokeGuardedCallback.apply(this, arguments);
- if (ReactErrorUtils.hasCaughtError()) {
- var error = ReactErrorUtils.clearCaughtError();
- if (!ReactErrorUtils._hasRethrowError) {
- ReactErrorUtils._hasRethrowError = true;
- ReactErrorUtils._rethrowError = error;
- }
- }
- },
-
- /**
- * During execution of guarded functions we will capture the first error which
- * we will rethrow to be handled by the top level error handler.
- */
- rethrowCaughtError: function () {
- return rethrowCaughtError.apply(ReactErrorUtils, arguments);
- },
-
- hasCaughtError: function () {
- return ReactErrorUtils._hasCaughtError;
- },
-
- clearCaughtError: function () {
- if (ReactErrorUtils._hasCaughtError) {
- var error = ReactErrorUtils._caughtError;
- ReactErrorUtils._caughtError = null;
- ReactErrorUtils._hasCaughtError = false;
- return error;
- } else {
- invariant(false, 'clearCaughtError was called but no error was captured. This error is likely caused by a bug in React. Please file an issue.');
- }
- }
-};
-
-var invokeGuardedCallback = function (name, func, context, a, b, c, d, e, f) {
- ReactErrorUtils._hasCaughtError = false;
- ReactErrorUtils._caughtError = null;
- var funcArgs = Array.prototype.slice.call(arguments, 3);
- try {
- func.apply(context, funcArgs);
- } catch (error) {
- ReactErrorUtils._caughtError = error;
- ReactErrorUtils._hasCaughtError = true;
- }
-};
-
-{
- // In DEV mode, we swap out invokeGuardedCallback for a special version
- // that plays more nicely with the browser's DevTools. The idea is to preserve
- // "Pause on exceptions" behavior. Because React wraps all user-provided
- // functions in invokeGuardedCallback, and the production version of
- // invokeGuardedCallback uses a try-catch, all user exceptions are treated
- // like caught exceptions, and the DevTools won't pause unless the developer
- // takes the extra step of enabling pause on caught exceptions. This is
- // untintuitive, though, because even though React has caught the error, from
- // the developer's perspective, the error is uncaught.
- //
- // To preserve the expected "Pause on exceptions" behavior, we don't use a
- // try-catch in DEV. Instead, we synchronously dispatch a fake event to a fake
- // DOM node, and call the user-provided callback from inside an event handler
- // for that fake event. If the callback throws, the error is "captured" using
- // a global event handler. But because the error happens in a different
- // event loop context, it does not interrupt the normal program flow.
- // Effectively, this gives us try-catch behavior without actually using
- // try-catch. Neat!
-
- // Check that the browser supports the APIs we need to implement our special
- // DEV version of invokeGuardedCallback
- if (typeof window !== 'undefined' && typeof window.dispatchEvent === 'function' && typeof document !== 'undefined' && typeof document.createEvent === 'function') {
- var fakeNode = document.createElement('react');
-
- var invokeGuardedCallbackDev = function (name, func, context, a, b, c, d, e, f) {
- // Keeps track of whether the user-provided callback threw an error. We
- // set this to true at the beginning, then set it to false right after
- // calling the function. If the function errors, `didError` will never be
- // set to false. This strategy works even if the browser is flaky and
- // fails to call our global error handler, because it doesn't rely on
- // the error event at all.
- var didError = true;
-
- // Create an event handler for our fake event. We will synchronously
- // dispatch our fake event using `dispatchEvent`. Inside the handler, we
- // call the user-provided callback.
- var funcArgs = Array.prototype.slice.call(arguments, 3);
- function callCallback() {
- // We immediately remove the callback from event listeners so that
- // nested `invokeGuardedCallback` calls do not clash. Otherwise, a
- // nested call would trigger the fake event handlers of any call higher
- // in the stack.
- fakeNode.removeEventListener(evtType, callCallback, false);
- func.apply(context, funcArgs);
- didError = false;
- }
-
- // Create a global error event handler. We use this to capture the value
- // that was thrown. It's possible that this error handler will fire more
- // than once; for example, if non-React code also calls `dispatchEvent`
- // and a handler for that event throws. We should be resilient to most of
- // those cases. Even if our error event handler fires more than once, the
- // last error event is always used. If the callback actually does error,
- // we know that the last error event is the correct one, because it's not
- // possible for anything else to have happened in between our callback
- // erroring and the code that follows the `dispatchEvent` call below. If
- // the callback doesn't error, but the error event was fired, we know to
- // ignore it because `didError` will be false, as described above.
- var error = void 0;
- // Use this to track whether the error event is ever called.
- var didSetError = false;
- var isCrossOriginError = false;
-
- function onError(event) {
- error = event.error;
- didSetError = true;
- if (error === null && event.colno === 0 && event.lineno === 0) {
- isCrossOriginError = true;
- }
- }
-
- // Create a fake event type.
- var evtType = 'react-' + (name ? name : 'invokeguardedcallback');
-
- // Attach our event handlers
- window.addEventListener('error', onError);
- fakeNode.addEventListener(evtType, callCallback, false);
-
- // Synchronously dispatch our fake event. If the user-provided function
- // errors, it will trigger our global error handler.
- var evt = document.createEvent('Event');
- evt.initEvent(evtType, false, false);
- fakeNode.dispatchEvent(evt);
-
- if (didError) {
- if (!didSetError) {
- // The callback errored, but the error event never fired.
- error = new Error('An error was thrown inside one of your components, but React ' + "doesn't know what it was. This is likely due to browser " + 'flakiness. React does its best to preserve the "Pause on ' + 'exceptions" behavior of the DevTools, which requires some ' + "DEV-mode only tricks. It's possible that these don't work in " + 'your browser. Try triggering the error in production mode, ' + 'or switching to a modern browser. If you suspect that this is ' + 'actually an issue with React, please file an issue.');
- } else if (isCrossOriginError) {
- error = new Error("A cross-origin error was thrown. React doesn't have access to " + 'the actual error object in development. ' + 'See https://fb.me/react-crossorigin-error for more information.');
- }
- ReactErrorUtils._hasCaughtError = true;
- ReactErrorUtils._caughtError = error;
- } else {
- ReactErrorUtils._hasCaughtError = false;
- ReactErrorUtils._caughtError = null;
- }
-
- // Remove our event listeners
- window.removeEventListener('error', onError);
- };
-
- invokeGuardedCallback = invokeGuardedCallbackDev;
- }
-}
-
-var rethrowCaughtError = function () {
- if (ReactErrorUtils._hasRethrowError) {
- var error = ReactErrorUtils._rethrowError;
- ReactErrorUtils._rethrowError = null;
- ReactErrorUtils._hasRethrowError = false;
- throw error;
- }
-};
-
-/**
- * Injectable ordering of event plugins.
- */
-var eventPluginOrder = null;
-
-/**
- * Injectable mapping from names to event plugin modules.
- */
-var namesToPlugins = {};
-
-/**
- * Recomputes the plugin list using the injected plugins and plugin ordering.
- *
- * @private
- */
-function recomputePluginOrdering() {
- if (!eventPluginOrder) {
- // Wait until an `eventPluginOrder` is injected.
- return;
- }
- for (var pluginName in namesToPlugins) {
- var pluginModule = namesToPlugins[pluginName];
- var pluginIndex = eventPluginOrder.indexOf(pluginName);
- !(pluginIndex > -1) ? invariant(false, 'EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `%s`.', pluginName) : void 0;
- if (plugins[pluginIndex]) {
- continue;
- }
- !pluginModule.extractEvents ? invariant(false, 'EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `%s` does not.', pluginName) : void 0;
- plugins[pluginIndex] = pluginModule;
- var publishedEvents = pluginModule.eventTypes;
- for (var eventName in publishedEvents) {
- !publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName) ? invariant(false, 'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.', eventName, pluginName) : void 0;
- }
- }
-}
-
-/**
- * Publishes an event so that it can be dispatched by the supplied plugin.
- *
- * @param {object} dispatchConfig Dispatch configuration for the event.
- * @param {object} PluginModule Plugin publishing the event.
- * @return {boolean} True if the event was successfully published.
- * @private
- */
-function publishEventForPlugin(dispatchConfig, pluginModule, eventName) {
- !!eventNameDispatchConfigs.hasOwnProperty(eventName) ? invariant(false, 'EventPluginHub: More than one plugin attempted to publish the same event name, `%s`.', eventName) : void 0;
- eventNameDispatchConfigs[eventName] = dispatchConfig;
-
- var phasedRegistrationNames = dispatchConfig.phasedRegistrationNames;
- if (phasedRegistrationNames) {
- for (var phaseName in phasedRegistrationNames) {
- if (phasedRegistrationNames.hasOwnProperty(phaseName)) {
- var phasedRegistrationName = phasedRegistrationNames[phaseName];
- publishRegistrationName(phasedRegistrationName, pluginModule, eventName);
- }
- }
- return true;
- } else if (dispatchConfig.registrationName) {
- publishRegistrationName(dispatchConfig.registrationName, pluginModule, eventName);
- return true;
- }
- return false;
-}
-
-/**
- * Publishes a registration name that is used to identify dispatched events.
- *
- * @param {string} registrationName Registration name to add.
- * @param {object} PluginModule Plugin publishing the event.
- * @private
- */
-function publishRegistrationName(registrationName, pluginModule, eventName) {
- !!registrationNameModules[registrationName] ? invariant(false, 'EventPluginHub: More than one plugin attempted to publish the same registration name, `%s`.', registrationName) : void 0;
- registrationNameModules[registrationName] = pluginModule;
- registrationNameDependencies[registrationName] = pluginModule.eventTypes[eventName].dependencies;
-
- {
- var lowerCasedName = registrationName.toLowerCase();
- possibleRegistrationNames[lowerCasedName] = registrationName;
-
- if (registrationName === 'onDoubleClick') {
- possibleRegistrationNames.ondblclick = registrationName;
- }
- }
-}
-
-/**
- * Registers plugins so that they can extract and dispatch events.
- *
- * @see {EventPluginHub}
- */
-
-/**
- * Ordered list of injected plugins.
- */
-var plugins = [];
-
-/**
- * Mapping from event name to dispatch config
- */
-var eventNameDispatchConfigs = {};
-
-/**
- * Mapping from registration name to plugin module
- */
-var registrationNameModules = {};
-
-/**
- * Mapping from registration name to event name
- */
-var registrationNameDependencies = {};
-
-/**
- * Mapping from lowercase registration names to the properly cased version,
- * used to warn in the case of missing event handlers. Available
- * only in true.
- * @type {Object}
- */
-var possibleRegistrationNames = {};
-// Trust the developer to only use possibleRegistrationNames in true
-
-/**
- * Injects an ordering of plugins (by plugin name). This allows the ordering
- * to be decoupled from injection of the actual plugins so that ordering is
- * always deterministic regardless of packaging, on-the-fly injection, etc.
- *
- * @param {array} InjectedEventPluginOrder
- * @internal
- * @see {EventPluginHub.injection.injectEventPluginOrder}
- */
-function injectEventPluginOrder(injectedEventPluginOrder) {
- !!eventPluginOrder ? invariant(false, 'EventPluginRegistry: Cannot inject event plugin ordering more than once. You are likely trying to load more than one copy of React.') : void 0;
- // Clone the ordering so it cannot be dynamically mutated.
- eventPluginOrder = Array.prototype.slice.call(injectedEventPluginOrder);
- recomputePluginOrdering();
-}
-
-/**
- * Injects plugins to be used by `EventPluginHub`. The plugin names must be
- * in the ordering injected by `injectEventPluginOrder`.
- *
- * Plugins can be injected as part of page initialization or on-the-fly.
- *
- * @param {object} injectedNamesToPlugins Map from names to plugin modules.
- * @internal
- * @see {EventPluginHub.injection.injectEventPluginsByName}
- */
-function injectEventPluginsByName(injectedNamesToPlugins) {
- var isOrderingDirty = false;
- for (var pluginName in injectedNamesToPlugins) {
- if (!injectedNamesToPlugins.hasOwnProperty(pluginName)) {
- continue;
- }
- var pluginModule = injectedNamesToPlugins[pluginName];
- if (!namesToPlugins.hasOwnProperty(pluginName) || namesToPlugins[pluginName] !== pluginModule) {
- !!namesToPlugins[pluginName] ? invariant(false, 'EventPluginRegistry: Cannot inject two different event plugins using the same name, `%s`.', pluginName) : void 0;
- namesToPlugins[pluginName] = pluginModule;
- isOrderingDirty = true;
- }
- }
- if (isOrderingDirty) {
- recomputePluginOrdering();
- }
-}
-
-var EventPluginRegistry = Object.freeze({
- plugins: plugins,
- eventNameDispatchConfigs: eventNameDispatchConfigs,
- registrationNameModules: registrationNameModules,
- registrationNameDependencies: registrationNameDependencies,
- possibleRegistrationNames: possibleRegistrationNames,
- injectEventPluginOrder: injectEventPluginOrder,
- injectEventPluginsByName: injectEventPluginsByName
-});
-
-var getFiberCurrentPropsFromNode = null;
-var getInstanceFromNode = null;
-var getNodeFromInstance = null;
-
-var injection$2 = {
- injectComponentTree: function (Injected) {
- getFiberCurrentPropsFromNode = Injected.getFiberCurrentPropsFromNode;
- getInstanceFromNode = Injected.getInstanceFromNode;
- getNodeFromInstance = Injected.getNodeFromInstance;
-
- {
- warning(getNodeFromInstance && getInstanceFromNode, 'EventPluginUtils.injection.injectComponentTree(...): Injected ' + 'module is missing getNodeFromInstance or getInstanceFromNode.');
- }
- }
-};
-
-
-
-
-
-
-var validateEventDispatches;
-{
- validateEventDispatches = function (event) {
- var dispatchListeners = event._dispatchListeners;
- var dispatchInstances = event._dispatchInstances;
-
- var listenersIsArr = Array.isArray(dispatchListeners);
- var listenersLen = listenersIsArr ? dispatchListeners.length : dispatchListeners ? 1 : 0;
-
- var instancesIsArr = Array.isArray(dispatchInstances);
- var instancesLen = instancesIsArr ? dispatchInstances.length : dispatchInstances ? 1 : 0;
-
- warning(instancesIsArr === listenersIsArr && instancesLen === listenersLen, 'EventPluginUtils: Invalid `event`.');
- };
-}
-
-/**
- * Dispatch the event to the listener.
- * @param {SyntheticEvent} event SyntheticEvent to handle
- * @param {boolean} simulated If the event is simulated (changes exn behavior)
- * @param {function} listener Application-level callback
- * @param {*} inst Internal component instance
- */
-function executeDispatch(event, simulated, listener, inst) {
- var type = event.type || 'unknown-event';
- event.currentTarget = getNodeFromInstance(inst);
- ReactErrorUtils.invokeGuardedCallbackAndCatchFirstError(type, listener, undefined, event);
- event.currentTarget = null;
-}
-
-/**
- * Standard/simple iteration through an event's collected dispatches.
- */
-function executeDispatchesInOrder(event, simulated) {
- var dispatchListeners = event._dispatchListeners;
- var dispatchInstances = event._dispatchInstances;
- {
- validateEventDispatches(event);
- }
- if (Array.isArray(dispatchListeners)) {
- for (var i = 0; i < dispatchListeners.length; i++) {
- if (event.isPropagationStopped()) {
- break;
- }
- // Listeners and Instances are two parallel arrays that are always in sync.
- executeDispatch(event, simulated, dispatchListeners[i], dispatchInstances[i]);
- }
- } else if (dispatchListeners) {
- executeDispatch(event, simulated, dispatchListeners, dispatchInstances);
- }
- event._dispatchListeners = null;
- event._dispatchInstances = null;
-}
-
-/**
- * @see executeDispatchesInOrderStopAtTrueImpl
- */
-
-
-/**
- * Execution of a "direct" dispatch - there must be at most one dispatch
- * accumulated on the event or it is considered an error. It doesn't really make
- * sense for an event with multiple dispatches (bubbled) to keep track of the
- * return values at each dispatch execution, but it does tend to make sense when
- * dealing with "direct" dispatches.
- *
- * @return {*} The return value of executing the single dispatch.
- */
-
-
-/**
- * @param {SyntheticEvent} event
- * @return {boolean} True iff number of dispatches accumulated is greater than 0.
- */
-
-/**
- * Accumulates items that must not be null or undefined into the first one. This
- * is used to conserve memory by avoiding array allocations, and thus sacrifices
- * API cleanness. Since `current` can be null before being passed in and not
- * null after this function, make sure to assign it back to `current`:
- *
- * `a = accumulateInto(a, b);`
- *
- * This API should be sparingly used. Try `accumulate` for something cleaner.
- *
- * @return {*|array<*>} An accumulation of items.
- */
-
-function accumulateInto(current, next) {
- !(next != null) ? invariant(false, 'accumulateInto(...): Accumulated items must not be null or undefined.') : void 0;
-
- if (current == null) {
- return next;
- }
-
- // Both are not empty. Warning: Never call x.concat(y) when you are not
- // certain that x is an Array (x could be a string with concat method).
- if (Array.isArray(current)) {
- if (Array.isArray(next)) {
- current.push.apply(current, next);
- return current;
- }
- current.push(next);
- return current;
- }
-
- if (Array.isArray(next)) {
- // A bit too dangerous to mutate `next`.
- return [current].concat(next);
- }
-
- return [current, next];
-}
-
-/**
- * @param {array} arr an "accumulation" of items which is either an Array or
- * a single item. Useful when paired with the `accumulate` module. This is a
- * simple utility that allows us to reason about a collection of items, but
- * handling the case when there is exactly one item (and we do not need to
- * allocate an array).
- * @param {function} cb Callback invoked with each element or a collection.
- * @param {?} [scope] Scope used as `this` in a callback.
- */
-function forEachAccumulated(arr, cb, scope) {
- if (Array.isArray(arr)) {
- arr.forEach(cb, scope);
- } else if (arr) {
- cb.call(scope, arr);
- }
-}
-
-/**
- * Internal queue of events that have accumulated their dispatches and are
- * waiting to have their dispatches executed.
- */
-var eventQueue = null;
-
-/**
- * Dispatches an event and releases it back into the pool, unless persistent.
- *
- * @param {?object} event Synthetic event to be dispatched.
- * @param {boolean} simulated If the event is simulated (changes exn behavior)
- * @private
- */
-var executeDispatchesAndRelease = function (event, simulated) {
- if (event) {
- executeDispatchesInOrder(event, simulated);
-
- if (!event.isPersistent()) {
- event.constructor.release(event);
- }
- }
-};
-var executeDispatchesAndReleaseSimulated = function (e) {
- return executeDispatchesAndRelease(e, true);
-};
-var executeDispatchesAndReleaseTopLevel = function (e) {
- return executeDispatchesAndRelease(e, false);
-};
-
-function isInteractive(tag) {
- return tag === 'button' || tag === 'input' || tag === 'select' || tag === 'textarea';
-}
-
-function shouldPreventMouseEvent(name, type, props) {
- switch (name) {
- case 'onClick':
- case 'onClickCapture':
- case 'onDoubleClick':
- case 'onDoubleClickCapture':
- case 'onMouseDown':
- case 'onMouseDownCapture':
- case 'onMouseMove':
- case 'onMouseMoveCapture':
- case 'onMouseUp':
- case 'onMouseUpCapture':
- return !!(props.disabled && isInteractive(type));
- default:
- return false;
- }
-}
-
-/**
- * This is a unified interface for event plugins to be installed and configured.
- *
- * Event plugins can implement the following properties:
- *
- * `extractEvents` {function(string, DOMEventTarget, string, object): *}
- * Required. When a top-level event is fired, this method is expected to
- * extract synthetic events that will in turn be queued and dispatched.
- *
- * `eventTypes` {object}
- * Optional, plugins that fire events must publish a mapping of registration
- * names that are used to register listeners. Values of this mapping must
- * be objects that contain `registrationName` or `phasedRegistrationNames`.
- *
- * `executeDispatch` {function(object, function, string)}
- * Optional, allows plugins to override how an event gets dispatched. By
- * default, the listener is simply invoked.
- *
- * Each plugin that is injected into `EventsPluginHub` is immediately operable.
- *
- * @public
- */
-
-/**
- * Methods for injecting dependencies.
- */
-var injection$1 = {
- /**
- * @param {array} InjectedEventPluginOrder
- * @public
- */
- injectEventPluginOrder: injectEventPluginOrder,
-
- /**
- * @param {object} injectedNamesToPlugins Map from names to plugin modules.
- */
- injectEventPluginsByName: injectEventPluginsByName
-};
-
-/**
- * @param {object} inst The instance, which is the source of events.
- * @param {string} registrationName Name of listener (e.g. `onClick`).
- * @return {?function} The stored callback.
- */
-function getListener(inst, registrationName) {
- var listener;
-
- // TODO: shouldPreventMouseEvent is DOM-specific and definitely should not
- // live here; needs to be moved to a better place soon
- var stateNode = inst.stateNode;
- if (!stateNode) {
- // Work in progress (ex: onload events in incremental mode).
- return null;
- }
- var props = getFiberCurrentPropsFromNode(stateNode);
- if (!props) {
- // Work in progress.
- return null;
- }
- listener = props[registrationName];
- if (shouldPreventMouseEvent(registrationName, inst.type, props)) {
- return null;
- }
- !(!listener || typeof listener === 'function') ? invariant(false, 'Expected `%s` listener to be a function, instead got a value of `%s` type.', registrationName, typeof listener) : void 0;
- return listener;
-}
-
-/**
- * Allows registered plugins an opportunity to extract events from top-level
- * native browser events.
- *
- * @return {*} An accumulation of synthetic events.
- * @internal
- */
-function extractEvents(topLevelType, targetInst, nativeEvent, nativeEventTarget) {
- var events;
- for (var i = 0; i < plugins.length; i++) {
- // Not every plugin in the ordering may be loaded at runtime.
- var possiblePlugin = plugins[i];
- if (possiblePlugin) {
- var extractedEvents = possiblePlugin.extractEvents(topLevelType, targetInst, nativeEvent, nativeEventTarget);
- if (extractedEvents) {
- events = accumulateInto(events, extractedEvents);
- }
- }
- }
- return events;
-}
-
-/**
- * Enqueues a synthetic event that should be dispatched when
- * `processEventQueue` is invoked.
- *
- * @param {*} events An accumulation of synthetic events.
- * @internal
- */
-function enqueueEvents(events) {
- if (events) {
- eventQueue = accumulateInto(eventQueue, events);
- }
-}
-
-/**
- * Dispatches all synthetic events on the event queue.
- *
- * @internal
- */
-function processEventQueue(simulated) {
- // Set `eventQueue` to null before processing it so that we can tell if more
- // events get enqueued while processing.
- var processingEventQueue = eventQueue;
- eventQueue = null;
-
- if (!processingEventQueue) {
- return;
- }
-
- if (simulated) {
- forEachAccumulated(processingEventQueue, executeDispatchesAndReleaseSimulated);
- } else {
- forEachAccumulated(processingEventQueue, executeDispatchesAndReleaseTopLevel);
- }
- !!eventQueue ? invariant(false, 'processEventQueue(): Additional events were enqueued while processing an event queue. Support for this has not yet been implemented.') : void 0;
- // This would be a good time to rethrow if any of the event handlers threw.
- ReactErrorUtils.rethrowCaughtError();
-}
-
-var EventPluginHub = Object.freeze({
- injection: injection$1,
- getListener: getListener,
- extractEvents: extractEvents,
- enqueueEvents: enqueueEvents,
- processEventQueue: processEventQueue
-});
-
-var IndeterminateComponent = 0; // Before we know whether it is functional or class
-var FunctionalComponent = 1;
-var ClassComponent = 2;
-var HostRoot = 3; // Root of a host tree. Could be nested inside another node.
-var HostPortal = 4; // A subtree. Could be an entry point to a different renderer.
-var HostComponent = 5;
-var HostText = 6;
-var CallComponent = 7;
-var CallHandlerPhase = 8;
-var ReturnComponent = 9;
-var Fragment = 10;
-
-var randomKey = Math.random().toString(36).slice(2);
-var internalInstanceKey = '__reactInternalInstance$' + randomKey;
-var internalEventHandlersKey = '__reactEventHandlers$' + randomKey;
-
-function precacheFiberNode$1(hostInst, node) {
- node[internalInstanceKey] = hostInst;
-}
-
-/**
- * Given a DOM node, return the closest ReactDOMComponent or
- * ReactDOMTextComponent instance ancestor.
- */
-function getClosestInstanceFromNode(node) {
- if (node[internalInstanceKey]) {
- return node[internalInstanceKey];
- }
-
- // Walk up the tree until we find an ancestor whose instance we have cached.
- var parents = [];
- while (!node[internalInstanceKey]) {
- parents.push(node);
- if (node.parentNode) {
- node = node.parentNode;
- } else {
- // Top of the tree. This node must not be part of a React tree (or is
- // unmounted, potentially).
- return null;
- }
- }
-
- var closest = void 0;
- var inst = node[internalInstanceKey];
- if (inst.tag === HostComponent || inst.tag === HostText) {
- // In Fiber, this will always be the deepest root.
- return inst;
- }
- for (; node && (inst = node[internalInstanceKey]); node = parents.pop()) {
- closest = inst;
- }
-
- return closest;
-}
-
-/**
- * Given a DOM node, return the ReactDOMComponent or ReactDOMTextComponent
- * instance, or null if the node was not rendered by this React.
- */
-function getInstanceFromNode$1(node) {
- var inst = node[internalInstanceKey];
- if (inst) {
- if (inst.tag === HostComponent || inst.tag === HostText) {
- return inst;
- } else {
- return null;
- }
- }
- return null;
-}
-
-/**
- * Given a ReactDOMComponent or ReactDOMTextComponent, return the corresponding
- * DOM node.
- */
-function getNodeFromInstance$1(inst) {
- if (inst.tag === HostComponent || inst.tag === HostText) {
- // In Fiber this, is just the state node right now. We assume it will be
- // a host component or host text.
- return inst.stateNode;
- }
-
- // Without this first invariant, passing a non-DOM-component triggers the next
- // invariant for a missing parent, which is super confusing.
- invariant(false, 'getNodeFromInstance: Invalid argument.');
-}
-
-function getFiberCurrentPropsFromNode$1(node) {
- return node[internalEventHandlersKey] || null;
-}
-
-function updateFiberProps$1(node, props) {
- node[internalEventHandlersKey] = props;
-}
-
-var ReactDOMComponentTree = Object.freeze({
- precacheFiberNode: precacheFiberNode$1,
- getClosestInstanceFromNode: getClosestInstanceFromNode,
- getInstanceFromNode: getInstanceFromNode$1,
- getNodeFromInstance: getNodeFromInstance$1,
- getFiberCurrentPropsFromNode: getFiberCurrentPropsFromNode$1,
- updateFiberProps: updateFiberProps$1
-});
-
-function getParent(inst) {
- do {
- inst = inst['return'];
- // TODO: If this is a HostRoot we might want to bail out.
- // That is depending on if we want nested subtrees (layers) to bubble
- // events to their parent. We could also go through parentNode on the
- // host node but that wouldn't work for React Native and doesn't let us
- // do the portal feature.
- } while (inst && inst.tag !== HostComponent);
- if (inst) {
- return inst;
- }
- return null;
-}
-
-/**
- * Return the lowest common ancestor of A and B, or null if they are in
- * different trees.
- */
-function getLowestCommonAncestor(instA, instB) {
- var depthA = 0;
- for (var tempA = instA; tempA; tempA = getParent(tempA)) {
- depthA++;
- }
- var depthB = 0;
- for (var tempB = instB; tempB; tempB = getParent(tempB)) {
- depthB++;
- }
-
- // If A is deeper, crawl up.
- while (depthA - depthB > 0) {
- instA = getParent(instA);
- depthA--;
- }
-
- // If B is deeper, crawl up.
- while (depthB - depthA > 0) {
- instB = getParent(instB);
- depthB--;
- }
-
- // Walk in lockstep until we find a match.
- var depth = depthA;
- while (depth--) {
- if (instA === instB || instA === instB.alternate) {
- return instA;
- }
- instA = getParent(instA);
- instB = getParent(instB);
- }
- return null;
-}
-
-/**
- * Return if A is an ancestor of B.
- */
-
-
-/**
- * Return the parent instance of the passed-in instance.
- */
-function getParentInstance(inst) {
- return getParent(inst);
-}
-
-/**
- * Simulates the traversal of a two-phase, capture/bubble event dispatch.
- */
-function traverseTwoPhase(inst, fn, arg) {
- var path = [];
- while (inst) {
- path.push(inst);
- inst = getParent(inst);
- }
- var i;
- for (i = path.length; i-- > 0;) {
- fn(path[i], 'captured', arg);
- }
- for (i = 0; i < path.length; i++) {
- fn(path[i], 'bubbled', arg);
- }
-}
-
-/**
- * Traverses the ID hierarchy and invokes the supplied `cb` on any IDs that
- * should would receive a `mouseEnter` or `mouseLeave` event.
- *
- * Does not invoke the callback on the nearest common ancestor because nothing
- * "entered" or "left" that element.
- */
-function traverseEnterLeave(from, to, fn, argFrom, argTo) {
- var common = from && to ? getLowestCommonAncestor(from, to) : null;
- var pathFrom = [];
- while (true) {
- if (!from) {
- break;
- }
- if (from === common) {
- break;
- }
- var alternate = from.alternate;
- if (alternate !== null && alternate === common) {
- break;
- }
- pathFrom.push(from);
- from = getParent(from);
- }
- var pathTo = [];
- while (true) {
- if (!to) {
- break;
- }
- if (to === common) {
- break;
- }
- var _alternate = to.alternate;
- if (_alternate !== null && _alternate === common) {
- break;
- }
- pathTo.push(to);
- to = getParent(to);
- }
- for (var i = 0; i < pathFrom.length; i++) {
- fn(pathFrom[i], 'bubbled', argFrom);
- }
- for (var _i = pathTo.length; _i-- > 0;) {
- fn(pathTo[_i], 'captured', argTo);
- }
-}
-
-/**
- * Some event types have a notion of different registration names for different
- * "phases" of propagation. This finds listeners by a given phase.
- */
-function listenerAtPhase(inst, event, propagationPhase) {
- var registrationName = event.dispatchConfig.phasedRegistrationNames[propagationPhase];
- return getListener(inst, registrationName);
-}
-
-/**
- * A small set of propagation patterns, each of which will accept a small amount
- * of information, and generate a set of "dispatch ready event objects" - which
- * are sets of events that have already been annotated with a set of dispatched
- * listener functions/ids. The API is designed this way to discourage these
- * propagation strategies from actually executing the dispatches, since we
- * always want to collect the entire set of dispatches before executing even a
- * single one.
- */
-
-/**
- * Tags a `SyntheticEvent` with dispatched listeners. Creating this function
- * here, allows us to not have to bind or create functions for each event.
- * Mutating the event's members allows us to not have to create a wrapping
- * "dispatch" object that pairs the event with the listener.
- */
-function accumulateDirectionalDispatches(inst, phase, event) {
- {
- warning(inst, 'Dispatching inst must not be null');
- }
- var listener = listenerAtPhase(inst, event, phase);
- if (listener) {
- event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);
- event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);
- }
-}
-
-/**
- * Collect dispatches (must be entirely collected before dispatching - see unit
- * tests). Lazily allocate the array to conserve memory. We must loop through
- * each event and perform the traversal for each one. We cannot perform a
- * single traversal for the entire collection of events because each event may
- * have a different target.
- */
-function accumulateTwoPhaseDispatchesSingle(event) {
- if (event && event.dispatchConfig.phasedRegistrationNames) {
- traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event);
- }
-}
-
-/**
- * Same as `accumulateTwoPhaseDispatchesSingle`, but skips over the targetID.
- */
-function accumulateTwoPhaseDispatchesSingleSkipTarget(event) {
- if (event && event.dispatchConfig.phasedRegistrationNames) {
- var targetInst = event._targetInst;
- var parentInst = targetInst ? getParentInstance(targetInst) : null;
- traverseTwoPhase(parentInst, accumulateDirectionalDispatches, event);
- }
-}
-
-/**
- * Accumulates without regard to direction, does not look for phased
- * registration names. Same as `accumulateDirectDispatchesSingle` but without
- * requiring that the `dispatchMarker` be the same as the dispatched ID.
- */
-function accumulateDispatches(inst, ignoredDirection, event) {
- if (inst && event && event.dispatchConfig.registrationName) {
- var registrationName = event.dispatchConfig.registrationName;
- var listener = getListener(inst, registrationName);
- if (listener) {
- event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);
- event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);
- }
- }
-}
-
-/**
- * Accumulates dispatches on an `SyntheticEvent`, but only for the
- * `dispatchMarker`.
- * @param {SyntheticEvent} event
- */
-function accumulateDirectDispatchesSingle(event) {
- if (event && event.dispatchConfig.registrationName) {
- accumulateDispatches(event._targetInst, null, event);
- }
-}
-
-function accumulateTwoPhaseDispatches(events) {
- forEachAccumulated(events, accumulateTwoPhaseDispatchesSingle);
-}
-
-function accumulateTwoPhaseDispatchesSkipTarget(events) {
- forEachAccumulated(events, accumulateTwoPhaseDispatchesSingleSkipTarget);
-}
-
-function accumulateEnterLeaveDispatches(leave, enter, from, to) {
- traverseEnterLeave(from, to, accumulateDispatches, leave, enter);
-}
-
-function accumulateDirectDispatches(events) {
- forEachAccumulated(events, accumulateDirectDispatchesSingle);
-}
-
-var EventPropagators = Object.freeze({
- accumulateTwoPhaseDispatches: accumulateTwoPhaseDispatches,
- accumulateTwoPhaseDispatchesSkipTarget: accumulateTwoPhaseDispatchesSkipTarget,
- accumulateEnterLeaveDispatches: accumulateEnterLeaveDispatches,
- accumulateDirectDispatches: accumulateDirectDispatches
-});
-
-var contentKey = null;
-
-/**
- * Gets the key used to access text content on a DOM node.
- *
- * @return {?string} Key used to access text content.
- * @internal
- */
-function getTextContentAccessor() {
- if (!contentKey && ExecutionEnvironment.canUseDOM) {
- // Prefer textContent to innerText because many browsers support both but
- // SVG elements don't support innerText even when