From 97f7cab355134a5fff7ba951b7e94a6e9d736e1e Mon Sep 17 00:00:00 2001 From: betamee Date: Sun, 19 Feb 2017 17:49:54 +0800 Subject: [PATCH 1/7] =?UTF-8?q?=E6=96=B0=E5=BB=BA=E5=88=86=E6=94=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/default.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/default.js b/config/default.js index 825da67..5ee8510 100644 --- a/config/default.js +++ b/config/default.js @@ -2,7 +2,7 @@ module.exports = { port: 3000, session: { secret: 'myblog', - key: 'myblog', + key: 'blog', maxAge: 2592000000 }, mongodb: 'mongodb://localhost:27017/myblog' From 5d5c60649321480075b49b793c68f5abd76dcc19 Mon Sep 17 00:00:00 2001 From: betamee Date: Sun, 19 Feb 2017 20:40:31 +0800 Subject: [PATCH 2/7] =?UTF-8?q?=E5=AE=8C=E6=88=90demo=E7=9A=84=E7=BC=96?= =?UTF-8?q?=E5=86=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.js | 87 ++++++++++++++++++++++++++++++-------------------------- 1 file changed, 46 insertions(+), 41 deletions(-) diff --git a/index.js b/index.js index eea37b5..b9b5689 100644 --- a/index.js +++ b/index.js @@ -17,26 +17,23 @@ import {match, RoutingContext} from 'react-router'; import AppRoutes from './common/AppRoutes'; import renderFullPage from './server/lib/viewpage'; +import configureStore from './common/store/index'; +import {Provider} from 'react-redux'; var app = express(); -// 设置模板目录 -app.set('views', path.join(__dirname, 'views')); -// 设置模板引擎为 ejs -app.set('view engine', 'ejs'); - // 设置静态文件目录 -app.use(express.static(path.join(__dirname, 'public'))); +app.use(express.static(path.join(__dirname, './server/public'))); // session 中间件 -app.use(session({ - name: config.session.key,// 设置 cookie 中保存 session id 的字段名称 - secret: config.session.secret,// 通过设置 secret 来计算 hash 值并放在 cookie 中,使产生的 signedCookie 防篡改 - cookie: { - maxAge: config.session.maxAge// 过期时间,过期后 cookie 中的 session id 自动删除 - }, - store: new MongoStore({// 将 session 存储到 mongodb - url: config.mongodb// mongodb 地址 - }) -})); +// app.use(session({ +// name: config.session.key,// 设置 cookie 中保存 session id 的字段名称 +// secret: config.session.secret,// 通过设置 secret 来计算 hash 值并放在 cookie 中,使产生的 signedCookie 防篡改 +// cookie: { +// maxAge: config.session.maxAge// 过期时间,过期后 cookie 中的 session id 自动删除 +// }, +// store: new MongoStore({// 将 session 存储到 mongodb +// url: config.mongodb// mongodb 地址 +// }) +// })); // flash 中间价,用来显示通知 app.use(flash()); // 处理表单及文件上传的中间件 @@ -51,28 +48,19 @@ app.locals.blog = { description: pkg.description }; -// 添加模板必需的三个变量 -app.use(function (req, res, next) { - res.locals.user = req.session.user; - res.locals.success = req.flash('success').toString(); - res.locals.error = req.flash('error').toString(); - next(); -}); -// 正常请求的日志 -app.use(expressWinston.logger({ - transports: [ - new (winston.transports.Console)({ - json: true, - colorize: true - }), - new winston.transports.File({ - filename: 'logs/success.log' - }) - ] -})); -// 路由 -// routes(app); +// // 正常请求的日志 +// app.use(expressWinston.logger({ +// transports: [ +// new (winston.transports.Console)({ +// json: true, +// colorize: true +// }), +// new winston.transports.File({ +// filename: 'logs/success.log' +// }) +// ] +// })); @@ -85,15 +73,32 @@ app.use((req, res)=>{ console.log(renderProps); if(err) { + res.status(500).send(err.message); + }else if(redirectLocation) { + res.redirect(302, redirectLocation.pathname+redirectLocation.search); + }else if(renderProps) { - // let marked = renderToString(); - // res.status(200).end(marked); + var initialState = { + count:1, + todo:['haha'] + }; + + const store = configureStore(initialState); + + let marked = renderToString( + + + + ); + + const initHtml= renderFullPage(marked,initialState); + + res.status(200).end(initHtml); }else { - // let notFoundPage = renderToString(); - // res.status(404).end(notFoundPage); + res.status(404).end('404 npt found'); } }); }); From ce9728c9ae753def177aa8aa1a29cb16c0ea4667 Mon Sep 17 00:00:00 2001 From: betamee Date: Sun, 19 Feb 2017 20:40:58 +0800 Subject: [PATCH 3/7] =?UTF-8?q?=E5=AE=8C=E6=88=90demo=E7=9A=84=E7=BC=96?= =?UTF-8?q?=E5=86=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client/App-Client.jsx | 2 +- client/Layout.jsx | 20 --- client/component/Footer.jsx | 21 --- client/component/Header.jsx | 16 --- client/component/Layout.jsx | 1 - client/component/Posts.jsx | 0 client/component/Signin.jsx | 0 client/component/Signup.jsx | 0 client/component/signput.jsx | 0 common/AppRoutes.js | 24 +--- common/NotFoundPage.jsx | 0 common/action/counteraction.js | 8 ++ common/action/posts.js | 122 ------------------ common/action/todoaction.js | 8 ++ common/action/user.js | 104 --------------- common/components/Counter.jsx | 18 +++ common/components/Layout.jsx | 16 +++ common/components/Todo.jsx | 18 +++ common/containers/Counterpage.jsx | 25 ++++ common/containers/Todopage.jsx | 24 ++++ common/reducers/counterReducer.js | 11 ++ common/reducers/index.js | 11 -- common/reducers/posts.js | 44 ------- common/reducers/rootReducer.js | 11 ++ common/reducers/todoReducer.js | 10 ++ common/reducers/user.js | 38 ------ common/store/index.js | 8 ++ common/store/store.js | 21 --- webpack.config.js | 9 ++ .../Edit.jsx => webpack.server.config.js | 0 30 files changed, 173 insertions(+), 417 deletions(-) delete mode 100644 client/Layout.jsx delete mode 100644 client/component/Footer.jsx delete mode 100644 client/component/Header.jsx delete mode 100644 client/component/Layout.jsx delete mode 100644 client/component/Posts.jsx delete mode 100644 client/component/Signin.jsx delete mode 100644 client/component/Signup.jsx delete mode 100644 client/component/signput.jsx delete mode 100644 common/NotFoundPage.jsx create mode 100644 common/action/counteraction.js delete mode 100644 common/action/posts.js create mode 100644 common/action/todoaction.js delete mode 100644 common/action/user.js create mode 100644 common/components/Counter.jsx create mode 100644 common/components/Layout.jsx create mode 100644 common/components/Todo.jsx create mode 100644 common/containers/Counterpage.jsx create mode 100644 common/containers/Todopage.jsx create mode 100644 common/reducers/counterReducer.js delete mode 100644 common/reducers/index.js delete mode 100644 common/reducers/posts.js create mode 100644 common/reducers/rootReducer.js create mode 100644 common/reducers/todoReducer.js delete mode 100644 common/reducers/user.js create mode 100644 common/store/index.js delete mode 100644 common/store/store.js create mode 100644 webpack.config.js rename client/component/Edit.jsx => webpack.server.config.js (100%) diff --git a/client/App-Client.jsx b/client/App-Client.jsx index 48b36d2..144d0ec 100644 --- a/client/App-Client.jsx +++ b/client/App-Client.jsx @@ -6,7 +6,7 @@ import AppRoutes from '../common/AppRoutes.js'; //状态管理 import {Provider} from 'react-redux'; -import configureStore from '../common/store/store.js'; +import configureStore from '../common/store/index.js'; // `__INITIAL_STATE__` 来自服务器端渲染 diff --git a/client/Layout.jsx b/client/Layout.jsx deleted file mode 100644 index c0cf1d6..0000000 --- a/client/Layout.jsx +++ /dev/null @@ -1,20 +0,0 @@ -import React,{Component} from 'react'; -// import {Link} from 'react-router'; - -import Header from './component/Header'; -import Footer from './component/Footer'; - - -class Layout extends Component { - render() { - return ( -
-
-
- {this.props.children} -
-
-
- ); - } -} \ No newline at end of file diff --git a/client/component/Footer.jsx b/client/component/Footer.jsx deleted file mode 100644 index c612da9..0000000 --- a/client/component/Footer.jsx +++ /dev/null @@ -1,21 +0,0 @@ -import React, {Component} from 'react' -// import {Link} from 'react-router'; - -/** - * Footer组件,可定义些尾部信息 - */ -const Footer = ()=> { -
-

- This is a blog to showcase universal rendering and routing with React and Express. -

- -

- Built with ︎ and code by 橡树上. - Contribute on GitHub or - read the tutorial on Scotch.io -

-
-} - -export default Footer; \ No newline at end of file diff --git a/client/component/Header.jsx b/client/component/Header.jsx deleted file mode 100644 index e5a90c1..0000000 --- a/client/component/Header.jsx +++ /dev/null @@ -1,16 +0,0 @@ -import React, {Component} from 'react' -import {Link} from 'react-router'; - -/** - * Header组件,可定义些头部标题,头像 - */ -const Header = ()=> { -
- - Hello World! This is my Blog - -
-} - - -export default Header; \ No newline at end of file diff --git a/client/component/Layout.jsx b/client/component/Layout.jsx deleted file mode 100644 index 51cca30..0000000 --- a/client/component/Layout.jsx +++ /dev/null @@ -1 +0,0 @@ -import React from 'react'; \ No newline at end of file diff --git a/client/component/Posts.jsx b/client/component/Posts.jsx deleted file mode 100644 index e69de29..0000000 diff --git a/client/component/Signin.jsx b/client/component/Signin.jsx deleted file mode 100644 index e69de29..0000000 diff --git a/client/component/Signup.jsx b/client/component/Signup.jsx deleted file mode 100644 index e69de29..0000000 diff --git a/client/component/signput.jsx b/client/component/signput.jsx deleted file mode 100644 index e69de29..0000000 diff --git a/common/AppRoutes.js b/common/AppRoutes.js index 5574434..c35531b 100644 --- a/common/AppRoutes.js +++ b/common/AppRoutes.js @@ -1,28 +1,16 @@ import React from 'react'; import {Route, Redirect} from 'react-router'; -import Layout from '../client/Layout.jsx';//布局页面 -import Signin from '../client/component/Signin.jsx';//登入,签到 -import Signout from '../client/component/signput.jsx';//登出 -import Signup from '../client/component/Signup.jsx';//注册 -import Posts from '../client/component/Posts.jsx';//文章页 - - -import NotFoundPage from './NotFoundPage.jsx';//错误页 - +import Layout from './components/Layout.jsx';//布局页面 +import Counterpage from './containers/Counterpage.jsx'; +import Todopage from './containers/Todopage.jsx'; //注意这个重定向路由 const AppRoutes = ( - - - - - - - - - + + + ); diff --git a/common/NotFoundPage.jsx b/common/NotFoundPage.jsx deleted file mode 100644 index e69de29..0000000 diff --git a/common/action/counteraction.js b/common/action/counteraction.js new file mode 100644 index 0000000..2830450 --- /dev/null +++ b/common/action/counteraction.js @@ -0,0 +1,8 @@ + +export const ADD_COUNT = 'ADD_COUNT'; + +export default function counterAction() { + return { + type: ADD_COUNT + } +} \ No newline at end of file diff --git a/common/action/posts.js b/common/action/posts.js deleted file mode 100644 index 7d997fa..0000000 --- a/common/action/posts.js +++ /dev/null @@ -1,122 +0,0 @@ -import fetch from 'isomorphic-fetch'; - -/* - * action 类型: - * 与post相关 - */ -export const INVALIDATE_POSTS = 'INVALIDATE_POSTS'; -export const REQUEST_CREATE_POST_BY_USERID= 'REQUEST_CREATE_POST_BY_USERID'; -export const REQUEST_UPDATE_POST_BY_ID = 'REQUEST_UPDATE_POST_BY_ID'; -export const REQUEST_DEL_POST_BY_ID = 'REQUEST_DEL_POST_BY_ID'; -export const REQUEST_POSTS = 'REQUEST_POSTS'; -export const RECEIVE_POSTS = 'RECEIVE_POSTS'; - -/* - * action 函数: - */ - -function requestPosts() {//只返回一个正在请求的状态 - return { - type: REQUEST_POSTS, - } -} - -function requestUpdatePostById() {//只返回一个正在请求的状态 - return { - type: REQUEST_UPDATE_POST_BY_ID, - } -} - -function requestDeletePostById() {//只返回一个正在请求的状态 - return { - type: REQUEST_DEL_POST_BY_ID, - } -} - - -function requestCreatePostByUser() { - return { - type: REQUEST_CREATE_POST_BY_USERID, - } -} - -function receivePosts(jsonData) { - return { - type:RECEIVE_POSTS, - posts: jsonData - } -} - -function errorGetPost(){ - return { - type: INVALIDATE_POSTS - } -} - - -export function fetchPosts() { - return (dispatch,getState)=>{ - dispatch(requestPosts());//先表明正在请求 - return fetch('/api/posts') - .then(res=>res.json()) - .then(json=>dispatch(receivePosts(json))) - } -} - - -export function createPostByUser(post, user){ - return (dispatch,getState)=>{ - dispatch(requestCreatePostByUser());//先表明正在请求 - - - let option={ - method:'post', - headers:{ - 'Content-Type': 'application/x-www-form-urlencoded; charset=utf-8' - }, - body:{ - post, - user - } - }; - return fetch('/api/post',option) - .then(res=>res.json()) - .then(json=>dispatch(receivePosts())) - .catch(()=>dispatch(errorGetPost())); - } -} -export function updatePostById(postId) { - return (dispatch,getState) =>{ - dispatch(requestPosts());//先表明正在请求 - - let option={ - method:'post', - headers:{ - 'Content-Type': 'application/x-www-form-urlencoded; charset=utf-8' - }, - body:[] - }; - return fetch(`/api/posts/${postId}/edit`,option) - .then(res=>res.json()) - .then(json=>dispatch(receivePosts(json))) - .catch(()=>dispatch(errorGetPost())); - } -} - -export function delePostById(postId) { - return (dispatch,getState) =>{ - dispatch(requestPosts());//先表明正在请求 - - let option={ - method:'post', - headers:{ - 'Content-Type': 'application/x-www-form-urlencoded; charset=utf-8' - }, - body:[] - }; - return fetch(`/api/posts/${postId}/remove`) - .then(res=>res.json()) - .then(json=>dispatch(receivePosts(json))) - .catch(()=>dispatch(errorGetPost()));//获取失败时 - } -} \ No newline at end of file diff --git a/common/action/todoaction.js b/common/action/todoaction.js new file mode 100644 index 0000000..0a99615 --- /dev/null +++ b/common/action/todoaction.js @@ -0,0 +1,8 @@ +export const ADD_TODO = 'ADD_TODO'; + +export default function todoAction(todoTxt) { + return { + type: ADD_COUNT, + todo:todoTxt + } +} \ No newline at end of file diff --git a/common/action/user.js b/common/action/user.js deleted file mode 100644 index 044dfde..0000000 --- a/common/action/user.js +++ /dev/null @@ -1,104 +0,0 @@ -export const REQUEST_SIGNIN = 'REQUEST_SIGNIN'; -export const REQUEST_SIGNINUP ='REQUEST_SIGNINUP'; -export const REQUEST_SIGNINOUT = 'REQUEST_SIGNINOUT'; -export const ERROR_USER='ERROR_USER'; - -export const FINISH_SIGNIN='FINISH_SIGNIN'; -export const FINISH_SIGNUP ='FINISH_SIGNUP'; -export const FINISH_SIGNOUT='FINISH_SIGNOUT'; - -function requestSignin(){ - return { - type:REQUEST_SIGNIN - } -} - -function requestSignup(){ - return { - type:REQUEST_SIGNINUP - } -} - - -function requestSignout(){ - return { - type:REQUEST_SIGNINOUT - } -} - - -//完成后的状态 -function finishSignin(userInfo){//登录 - return { - type: FINISH_SIGNIN, - userInfo - } -} - -function finishSignup(userInfo){ - return { - type: FINISH_SIGNUP, - userInfo - } -} - -function finishSignout(userInfo){ - return { - type: FINISH_SIGNOUT, - userInfo - } -} - -function errorUserHandle(){ - return { - type: ERROR_USER - } -} - - - - -export default UserSignin=(username,password)=>{//登录 - return (dispatch,getState)=>{ - dispatch(requestSignin()); - - let option = { - method:'post', - headers:{ - 'Content-Type': 'application/x-www-form-urlencoded' - }, - body:`username=${encodeURIComponent(username)}&password=${encodeURIComponent(password)}` - } - return fetch('/api/signin',option) - .then(userinfo=>dispatch(finishSignin(userinfo))) - .catch(()=>dispatch(errorUserHandle())); - } -} - -export default UserSignup=(username,password,repassword,gender)=>{//注册,表单数据 - return (dispatch,getState)=>{ - dispatch(requestSignup());//先表明正在请求 - - let option = { - method:'post', - headers:{ - 'Content-Type': 'application/x-www-form-urlencoded' - }, - body:`username=${encodeURIComponent(username)}&password=${encodeURIComponent(password)}& - repassword=${encodeURIComponent(repassword)}&gender=${encodeURIComponent(gender)}` - } - - return fetch('/api/signup',option) - .then(userinfo=>dispatch(finishSignup(userinfo))) - .catch(()=>dispatch(errorUserHandle())); - } -} - -export default UserSignout=(user)=>{//通过user来设置登出 - return (dispatch,getState) =>{ - dispatch(requestSignout());//先表明正在请求 - return fetch(`/api/signout/`) - .then((message)=>dispatch(finishSignout(message))) - .catch(()=>dispatch(errorUserHandle())); - } -} \ No newline at end of file diff --git a/common/components/Counter.jsx b/common/components/Counter.jsx new file mode 100644 index 0000000..7e65ea8 --- /dev/null +++ b/common/components/Counter.jsx @@ -0,0 +1,18 @@ +import React,{Component} from 'react'; + +class Counter extends Component { + constructor(props){ + super(props); + } + render() { + + + return( +
+ Hello World +
+ ); + } +} + +export default Counter; \ No newline at end of file diff --git a/common/components/Layout.jsx b/common/components/Layout.jsx new file mode 100644 index 0000000..ede1da8 --- /dev/null +++ b/common/components/Layout.jsx @@ -0,0 +1,16 @@ +import React,{Component} from 'react'; + +class Layout extends Component { + constructor(props){ + super(props); + } + render() { + return( +
+ {this.props.children} +
+ ); + } +} + +export default Layout; \ No newline at end of file diff --git a/common/components/Todo.jsx b/common/components/Todo.jsx new file mode 100644 index 0000000..c473e2f --- /dev/null +++ b/common/components/Todo.jsx @@ -0,0 +1,18 @@ +import React,{Component} from 'react'; + +class Todo extends Component { + constructor(props){ + super(props); + } + render() { + + + return( +
+ Hello Todo! +
+ ); + } +} + +export default Todo; \ No newline at end of file diff --git a/common/containers/Counterpage.jsx b/common/containers/Counterpage.jsx new file mode 100644 index 0000000..a09cc10 --- /dev/null +++ b/common/containers/Counterpage.jsx @@ -0,0 +1,25 @@ +import {connect} from 'react-redux'; +import Counter from '../components/Counter'; +import {bindActionCreators} from 'redux'; +import counterAction from '../action/counteraction.js'; + + +//mapStateToProps +const mapStateToProps = (state, ownProps) => { + return { + count: state.count + } +} + + +const mapDispatchToProps = (dispatch, ownProps) => { + + return { + onIncreaseClick: () => { + dispatch(counterAction()) + } + } +} + + +export default connect(mapStateToProps,mapDispatchToProps)(Counter); \ No newline at end of file diff --git a/common/containers/Todopage.jsx b/common/containers/Todopage.jsx new file mode 100644 index 0000000..6912fbb --- /dev/null +++ b/common/containers/Todopage.jsx @@ -0,0 +1,24 @@ +import {connect} from 'react-redux'; +import Todo from '../components/Todo'; +import {bindActionCreators} from 'redux'; +import todoAction from '../action/todoaction.js'; + + +//mapStateToProps +const mapStateToProps = (state, ownProps) => { + return { + todo: state.todo + } +} + + +const mapDispatchToProps = (dispatch, ownProps) => { + + return { + onAddTodoClick: (text) => { + dispatch(todoAction(text)) + } + } +} + +export default connect(mapStateToProps,mapDispatchToProps)(Todo); \ No newline at end of file diff --git a/common/reducers/counterReducer.js b/common/reducers/counterReducer.js new file mode 100644 index 0000000..96f1ad1 --- /dev/null +++ b/common/reducers/counterReducer.js @@ -0,0 +1,11 @@ +import {ADD_COUNT} from '../action/counteraction'; + + +export default counterReducer=(state=0, action)=>{ + switch(action.type) { + case ADD_COUNT: + return state+1; + default: + return state; + } +} \ No newline at end of file diff --git a/common/reducers/index.js b/common/reducers/index.js deleted file mode 100644 index e09ef96..0000000 --- a/common/reducers/index.js +++ /dev/null @@ -1,11 +0,0 @@ -import userReducer from './user'; -import postsReducer from './posts'; - -const initialState={}; - -export default rootReducer=(state=initialState, action)=>{ - return { - userReducer:userReducer(state.user, action), - postsReducer:postsReducer(state.posts, action) - } -} diff --git a/common/reducers/posts.js b/common/reducers/posts.js deleted file mode 100644 index b1a6af6..0000000 --- a/common/reducers/posts.js +++ /dev/null @@ -1,44 +0,0 @@ -import - { - INVALIDATE_POSTS, - REQUEST_UPDATE_POST_BY_ID, - REQUEST_DEL_POST_BY_ID, - REQUEST_POSTS, - RECEIVE_POSTS, - } from '../action/posts.js'; - - - -const initialState = { - isFetching:false,//文章是否在获取中 - didInvalidate:false,//是否无效 - items:[] -};//初始状态文章为空 - -export default postsReducer=(state = initialState, action)=>{ - switch(action.type) { - case INVALIDATE_POSTS://当文章无效的时候 - return Object.assign({}, state, { - didInvalidate:true - }); - - //请求类 - case REQUEST_UPDATE_POST_BY_ID://通过文章id更新文章数据 - case REQUEST_POSTS://请求所有的文章 - case REQUEST_DEL_POST_BY_ID://通过文章id删除文章数据 - return Object.assign({},state,{ - isFetching:true, - didInvalidate:false, - }); - - case RECEIVE_POSTS://获取数据 - return Object.assign({},state,{ - isFetching:false, - didInvalidate:false, - items:action.posts - }); - - default: - return state; - } -} \ No newline at end of file diff --git a/common/reducers/rootReducer.js b/common/reducers/rootReducer.js new file mode 100644 index 0000000..e7adf5e --- /dev/null +++ b/common/reducers/rootReducer.js @@ -0,0 +1,11 @@ +import { combineReducers }from 'redux'; +import counterReducer from './counterReducer'; +import todoReducer from './todoReducer'; + + +export default rootReducer=(state={},action)=>{ + return { + counterReducer:counterReducer(state.count, action), + todoReducer: todoReducer(state.todo, action) + } +} \ No newline at end of file diff --git a/common/reducers/todoReducer.js b/common/reducers/todoReducer.js new file mode 100644 index 0000000..b9462d9 --- /dev/null +++ b/common/reducers/todoReducer.js @@ -0,0 +1,10 @@ +import {ADD_TODO} from '../action/todoaction'; + +export default todoReducer=(state=[],action)=>{ + switch(action.type){ + case ADD_TODO: + return state.push(action.todo); + default: + return state; + } +} \ No newline at end of file diff --git a/common/reducers/user.js b/common/reducers/user.js deleted file mode 100644 index e4f7d55..0000000 --- a/common/reducers/user.js +++ /dev/null @@ -1,38 +0,0 @@ -import { - REQUEST_SIGNIN, - REQUEST_SIGNINOUT, - REQUEST_SIGNINUP, - ERROR_USER, - FINISH_SIGNIN, - FINISH_SIGNOUT, - FINISH_SIGNUP -} from '../action/user'; - - -let initialState = { - isRequesting:false, - isLogin:false, - userInfo:{} -} - -export default userReducer=(state=initialState,action)=>{ - switch(action.type){ - case REQUEST_SIGNIN: - case REQUEST_SIGNINOUT: - case REQUEST_SIGNINUP: - return Object.assign({},state,{ - isRequesting:true - }); - case FINISH_SIGNUP://注册 - case FINISH_SIGNIN://登录 - return Object.assign({},state,{ - isLogin:true, - userInfo:action.userInfo - }); - case FINISH_SIGNOUT: - return Object.assign({},state,{ - isLogin:false, - userInfo:{} - }); - } -} \ No newline at end of file diff --git a/common/store/index.js b/common/store/index.js new file mode 100644 index 0000000..a32a52c --- /dev/null +++ b/common/store/index.js @@ -0,0 +1,8 @@ +import {createStore} from 'redux'; +import rootReducer from '../reducers/rootReducer'; + + +export default configureStore=(initialState)=>{ + const store =createStore(rootReducer,initialState); + return store; +} \ No newline at end of file diff --git a/common/store/store.js b/common/store/store.js deleted file mode 100644 index 0a45953..0000000 --- a/common/store/store.js +++ /dev/null @@ -1,21 +0,0 @@ -import { createStore,applyMiddleware} from 'react-redux'; -import thunkMiddleware from 'redux-thunk'; -import createLogger from 'redux-logger'; -import rootReducer from '../reducers'; - -const loggerMiddleware = createLogger(); - -export default configureStore=(preloadedState)=>{ - return createStore( - rootReducer, - preloadedState, - applyMiddleware( - thunkMiddleware, - loggerMiddleware - ) - ); -} - - - - diff --git a/webpack.config.js b/webpack.config.js new file mode 100644 index 0000000..c60b02c --- /dev/null +++ b/webpack.config.js @@ -0,0 +1,9 @@ +var path = require('path'); +var webpack = require('webpack'); + + +module.exports={ + +} + + diff --git a/client/component/Edit.jsx b/webpack.server.config.js similarity index 100% rename from client/component/Edit.jsx rename to webpack.server.config.js From 094880ebf3d1b463a19587c4a33a2e031381da1f Mon Sep 17 00:00:00 2001 From: betamee Date: Mon, 20 Feb 2017 10:11:07 +0800 Subject: [PATCH 4/7] =?UTF-8?q?=E5=88=A0=E9=99=A4webpack=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- webpack.server.config.js | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 webpack.server.config.js diff --git a/webpack.server.config.js b/webpack.server.config.js deleted file mode 100644 index e69de29..0000000 From 48a5f39023f7b8c109768022a24fc5ac27813a19 Mon Sep 17 00:00:00 2001 From: betamee Date: Mon, 20 Feb 2017 16:02:34 +0800 Subject: [PATCH 5/7] =?UTF-8?q?=E9=AA=8C=E8=AF=81redux?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .babelrc | 3 +++ index.js | 2 +- package.json | 1 + 3 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 .babelrc diff --git a/.babelrc b/.babelrc new file mode 100644 index 0000000..09fba6d --- /dev/null +++ b/.babelrc @@ -0,0 +1,3 @@ +{ + presets: ["es2015", "react","stage-1"] +} \ No newline at end of file diff --git a/index.js b/index.js index b9b5689..527461f 100644 --- a/index.js +++ b/index.js @@ -66,7 +66,7 @@ app.locals.blog = { app.use((req, res)=>{ - match( {AppRoutes, location:req.url}, (err, redirectLocation, renderProps)=>{ + match( {routes:AppRoutes, location:req.url}, (err, redirectLocation, renderProps)=>{ console.log(err); console.log(redirectLocation); diff --git a/package.json b/package.json index 7747c29..6f7317e 100644 --- a/package.json +++ b/package.json @@ -21,6 +21,7 @@ }, "homepage": "https://github.com/BetaMee/ReactBlog#readme", "dependencies": { + "axios": "^0.15.3", "config-lite": "^1.5.0", "connect-flash": "^0.1.1", "connect-mongo": "^1.3.2", From a4a521e14e2655d01c23e8502e37643047b2dc6f Mon Sep 17 00:00:00 2001 From: betamee Date: Mon, 20 Feb 2017 19:43:53 +0800 Subject: [PATCH 6/7] =?UTF-8?q?=E5=81=9A=E4=BA=86=E4=BA=9B=E6=9B=B4?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common/action/counteraction.js | 6 +- common/action/todoaction.js | 6 +- common/reducers/counterReducer.js | 6 +- common/reducers/rootReducer.js | 6 +- common/reducers/todoReducer.js | 6 +- common/store/index.js | 6 +- index.js | 102 ++++---------------- npm-debug.log | 48 +++++++++ package.json | 14 ++- server/apiroutes/index.js | 6 ++ server/{noderoutes => apiroutes}/posts.js | 0 server/{noderoutes => apiroutes}/signin.js | 0 server/{noderoutes => apiroutes}/signout.js | 0 server/{noderoutes => apiroutes}/signup.js | 0 server/noderoutes/index.js | 16 --- 15 files changed, 111 insertions(+), 111 deletions(-) create mode 100644 npm-debug.log create mode 100644 server/apiroutes/index.js rename server/{noderoutes => apiroutes}/posts.js (100%) rename server/{noderoutes => apiroutes}/signin.js (100%) rename server/{noderoutes => apiroutes}/signout.js (100%) rename server/{noderoutes => apiroutes}/signup.js (100%) delete mode 100644 server/noderoutes/index.js diff --git a/common/action/counteraction.js b/common/action/counteraction.js index 2830450..cc9d904 100644 --- a/common/action/counteraction.js +++ b/common/action/counteraction.js @@ -1,8 +1,10 @@ export const ADD_COUNT = 'ADD_COUNT'; -export default function counterAction() { +const counterAction=()=> { return { type: ADD_COUNT } -} \ No newline at end of file +} + +export default counterAction; \ No newline at end of file diff --git a/common/action/todoaction.js b/common/action/todoaction.js index 0a99615..0f9299b 100644 --- a/common/action/todoaction.js +++ b/common/action/todoaction.js @@ -1,8 +1,10 @@ export const ADD_TODO = 'ADD_TODO'; -export default function todoAction(todoTxt) { +const todoAction=(todoTxt)=> { return { type: ADD_COUNT, todo:todoTxt } -} \ No newline at end of file +} + +export default todoAction; \ No newline at end of file diff --git a/common/reducers/counterReducer.js b/common/reducers/counterReducer.js index 96f1ad1..36ab428 100644 --- a/common/reducers/counterReducer.js +++ b/common/reducers/counterReducer.js @@ -1,11 +1,13 @@ import {ADD_COUNT} from '../action/counteraction'; -export default counterReducer=(state=0, action)=>{ +const counterReducer=(state=0, action)=>{ switch(action.type) { case ADD_COUNT: return state+1; default: return state; } -} \ No newline at end of file +} + +export default counterReducer; \ No newline at end of file diff --git a/common/reducers/rootReducer.js b/common/reducers/rootReducer.js index e7adf5e..40cd2eb 100644 --- a/common/reducers/rootReducer.js +++ b/common/reducers/rootReducer.js @@ -3,9 +3,11 @@ import counterReducer from './counterReducer'; import todoReducer from './todoReducer'; -export default rootReducer=(state={},action)=>{ +const rootReducer=(state={},action)=>{ return { counterReducer:counterReducer(state.count, action), todoReducer: todoReducer(state.todo, action) } -} \ No newline at end of file +} + +export default rootReducer; \ No newline at end of file diff --git a/common/reducers/todoReducer.js b/common/reducers/todoReducer.js index b9462d9..73407a3 100644 --- a/common/reducers/todoReducer.js +++ b/common/reducers/todoReducer.js @@ -1,10 +1,12 @@ import {ADD_TODO} from '../action/todoaction'; -export default todoReducer=(state=[],action)=>{ +const todoReducer=(state=[],action)=>{ switch(action.type){ case ADD_TODO: return state.push(action.todo); default: return state; } -} \ No newline at end of file +} + +export default todoReducer; \ No newline at end of file diff --git a/common/store/index.js b/common/store/index.js index a32a52c..4a330b2 100644 --- a/common/store/index.js +++ b/common/store/index.js @@ -2,7 +2,9 @@ import {createStore} from 'redux'; import rootReducer from '../reducers/rootReducer'; -export default configureStore=(initialState)=>{ +const configureStore=(initialState)=>{ const store =createStore(rootReducer,initialState); return store; -} \ No newline at end of file +} + +export default configureStore; \ No newline at end of file diff --git a/index.js b/index.js index 527461f..7847d87 100644 --- a/index.js +++ b/index.js @@ -1,19 +1,14 @@ -var path = require('path'); -var express = require('express'); -var session = require('express-session'); -var MongoStore = require('connect-mongo')(session); -var flash = require('connect-flash'); -var config = require('config-lite'); -var NodeRoutes = require('./server/noderoutes'); -var pkg = require('./package'); -var winston = require('winston'); -var expressWinston = require('express-winston'); - +import config from 'config-lite'; +import express from 'express'; +import path from 'path'; +import pkg from './package.json'; +import ApiRoutes from './server/apiroutes'; //react服务端渲染配置 +import React from 'react'; import {renderToString} from 'react-dom/server'; -import {match, RoutingContext} from 'react-router'; +import {match, RouterContext} from 'react-router'; import AppRoutes from './common/AppRoutes'; import renderFullPage from './server/lib/viewpage'; @@ -22,56 +17,15 @@ import {Provider} from 'react-redux'; var app = express(); // 设置静态文件目录 -app.use(express.static(path.join(__dirname, './server/public'))); -// session 中间件 -// app.use(session({ -// name: config.session.key,// 设置 cookie 中保存 session id 的字段名称 -// secret: config.session.secret,// 通过设置 secret 来计算 hash 值并放在 cookie 中,使产生的 signedCookie 防篡改 -// cookie: { -// maxAge: config.session.maxAge// 过期时间,过期后 cookie 中的 session id 自动删除 -// }, -// store: new MongoStore({// 将 session 存储到 mongodb -// url: config.mongodb// mongodb 地址 -// }) -// })); -// flash 中间价,用来显示通知 -app.use(flash()); -// 处理表单及文件上传的中间件 -app.use(require('express-formidable')({ - uploadDir: path.join(__dirname, 'public/img'),// 上传文件目录 - keepExtensions: true// 保留后缀 -})); - -// 设置模板全局常量 -app.locals.blog = { - title: pkg.name, - description: pkg.description -}; - - -// // 正常请求的日志 -// app.use(expressWinston.logger({ -// transports: [ -// new (winston.transports.Console)({ -// json: true, -// colorize: true -// }), -// new winston.transports.File({ -// filename: 'logs/success.log' -// }) -// ] -// })); - - - -app.use((req, res)=>{ +app.use(express.static(path.join(__dirname, 'server/public'))); - match( {routes:AppRoutes, location:req.url}, (err, redirectLocation, renderProps)=>{ - - console.log(err); - console.log(redirectLocation); - console.log(renderProps); +//RESTful api路由,必须置于前 +ApiRoutes(app); +//处理react路由 +app.get("*",(req, res)=>{ + match( {routes:AppRoutes, location:req.url}, (err, redirectLocation, renderProps)=>{ + if(err) { res.status(500).send(err.message); @@ -94,7 +48,7 @@ app.use((req, res)=>{ ); - const initHtml= renderFullPage(marked,initialState); + const initHtml= renderFullPage(marked,store.getState()); res.status(200).end(initHtml); }else { @@ -104,28 +58,12 @@ app.use((req, res)=>{ }); - - - -// 错误请求的日志 -app.use(expressWinston.errorLogger({ - transports: [ - new winston.transports.Console({ - json: true, - colorize: true - }), - new winston.transports.File({ - filename: 'logs/error.log' - }) - ] -})); - // error page -app.use(function (err, req, res, next) { - res.render('error', { - error: err - }); -}); +// app.use(function (err, req, res, next) { +// res.render('error', { +// error: err +// }); +// }); if (module.parent) { module.exports = app; diff --git a/npm-debug.log b/npm-debug.log new file mode 100644 index 0000000..9dffa71 --- /dev/null +++ b/npm-debug.log @@ -0,0 +1,48 @@ +0 info it worked if it ends with ok +1 verbose cli [ 'C:\\Packages\\nodejs\\node.exe', +1 verbose cli 'C:\\Packages\\nvm\\npm\\node_modules\\npm\\bin\\npm-cli.js', +1 verbose cli 'run', +1 verbose cli 'start' ] +2 info using npm@4.0.5 +3 info using node@v6.9.4 +4 verbose run-script [ 'prestart', 'start', 'poststart' ] +5 info lifecycle react-blog@1.0.0~prestart: react-blog@1.0.0 +6 silly lifecycle react-blog@1.0.0~prestart: no script for prestart, continuing +7 info lifecycle react-blog@1.0.0~start: react-blog@1.0.0 +8 verbose lifecycle react-blog@1.0.0~start: unsafe-perm in lifecycle true +9 verbose lifecycle react-blog@1.0.0~start: PATH: C:\Packages\nvm\npm\node_modules\npm\bin\node-gyp-bin;C:\Github\ReactBlog\node_modules\.bin;C:\Packages\Python27\;C:\Packages\Python27\Scripts;C:\ProgramData\Oracle\Java\javapath;C:\Packages\nvm\npm;C:\Packages\nvm;C:\Packages\nodejs;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Softwares\cmder;C:\Users\Betamee\AppData\Local\Microsoft\WindowsApps;C:\Softwares\Microsoft VS Code\bin;C:\Softwares\Crucial\Crucial Storage Executive;C:\Packages\xampp\php;C:\Packages\xampp\php\ext;C:\Softwares\MATLAB\R2015b\runtime\win64;C:\Softwares\MATLAB\R2015b\bin;C:\Softwares\MATLAB\R2015b\polyspace\bin;C:\Program Files\Microsoft SQL Server\130\Tools\Binn\;C:\Packages\Java\jdk1.8.0_102\bin;C:\Packages\Java\jdk1.8.0_102\jre\bin;C:\Softwares\Calibre2\;C:\Program Files (x86)\Windows Kits\8.1\Windows Performance Toolkit\;C:\Program Files\dotnet\;C:\Program Files\Microsoft\Web Platform Installer\;C:\ProgramData\chocolatey\bin;C:\Packages\gradle-3.2.1\bin;C:\Softwares\Git\cmd;C:\Softwares\WinSCP\;C:\Packages\Ruby23-x64\bin;C:\Packages\MongoDB\Server\3.4\bin;C:\Packages\Ruby23-x64\bin;C:\Users\Betamee\AppData\Local\Microsoft\WindowsApps;C:\Softwares\Microsoft VS Code\bin;C:\Packages\Android\sdk\tools;C:\Packages\Android\sdk\platform-tools +10 verbose lifecycle react-blog@1.0.0~start: CWD: C:\Github\ReactBlog +11 silly lifecycle react-blog@1.0.0~start: Args: [ '/d /s /c', 'babel-node index.js' ] +12 silly lifecycle react-blog@1.0.0~start: Returned: code: 1 signal: null +13 info lifecycle react-blog@1.0.0~start: Failed to exec start script +14 verbose stack Error: react-blog@1.0.0 start: `babel-node index.js` +14 verbose stack Exit status 1 +14 verbose stack at EventEmitter. (C:\Packages\nvm\npm\node_modules\npm\lib\utils\lifecycle.js:279:16) +14 verbose stack at emitTwo (events.js:106:13) +14 verbose stack at EventEmitter.emit (events.js:191:7) +14 verbose stack at ChildProcess. (C:\Packages\nvm\npm\node_modules\npm\lib\utils\spawn.js:40:14) +14 verbose stack at emitTwo (events.js:106:13) +14 verbose stack at ChildProcess.emit (events.js:191:7) +14 verbose stack at maybeClose (internal/child_process.js:877:16) +14 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5) +15 verbose pkgid react-blog@1.0.0 +16 verbose cwd C:\Github\ReactBlog +17 error Windows_NT 10.0.14393 +18 error argv "C:\\Packages\\nodejs\\node.exe" "C:\\Packages\\nvm\\npm\\node_modules\\npm\\bin\\npm-cli.js" "run" "start" +19 error node v6.9.4 +20 error npm v4.0.5 +21 error code ELIFECYCLE +22 error react-blog@1.0.0 start: `babel-node index.js` +22 error Exit status 1 +23 error Failed at the react-blog@1.0.0 start script 'babel-node index.js'. +23 error Make sure you have the latest version of node.js and npm installed. +23 error If you do, this is most likely a problem with the react-blog package, +23 error not with npm itself. +23 error Tell the author that this fails on your system: +23 error babel-node index.js +23 error You can get information on how to open an issue for this project with: +23 error npm bugs react-blog +23 error Or if that isn't available, you can get their info via: +23 error npm owner ls react-blog +23 error There is likely additional logging output above. +24 verbose exit [ 1, true ] diff --git a/package.json b/package.json index 6f7317e..48c7aa2 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,8 @@ "description": "a blog system", "main": "index.js", "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" + "test": "echo \"Error: no test specified\" && exit 1", + "start":"node_modules/.bin/babel-node index.js" }, "repository": { "type": "git", @@ -42,5 +43,16 @@ "redux-thunk": "^2.2.0", "sha1": "^1.1.1", "winston": "^2.3.1" + }, + "devDependencies": { + "babel-cli": "^6.23.0", + "babel-core": "^6.23.1", + "babel-loader": "^6.3.2", + "babel-preset-es2015": "^6.22.0", + "babel-preset-react": "^6.23.0", + "babel-preset-stage-1": "^6.22.0", + "react-hot-loader": "^1.3.1", + "webpack": "^2.2.1", + "webpack-dev-server": "^2.4.0" } } diff --git a/server/apiroutes/index.js b/server/apiroutes/index.js new file mode 100644 index 0000000..c451058 --- /dev/null +++ b/server/apiroutes/index.js @@ -0,0 +1,6 @@ +module.exports = function (app) { + app.use('/api/signup', require('./signup')); + app.use('/api/signin', require('./signin')); + app.use('/api/signout', require('./signout')); + app.use('/api/posts', require('./posts')); +}; diff --git a/server/noderoutes/posts.js b/server/apiroutes/posts.js similarity index 100% rename from server/noderoutes/posts.js rename to server/apiroutes/posts.js diff --git a/server/noderoutes/signin.js b/server/apiroutes/signin.js similarity index 100% rename from server/noderoutes/signin.js rename to server/apiroutes/signin.js diff --git a/server/noderoutes/signout.js b/server/apiroutes/signout.js similarity index 100% rename from server/noderoutes/signout.js rename to server/apiroutes/signout.js diff --git a/server/noderoutes/signup.js b/server/apiroutes/signup.js similarity index 100% rename from server/noderoutes/signup.js rename to server/apiroutes/signup.js diff --git a/server/noderoutes/index.js b/server/noderoutes/index.js deleted file mode 100644 index 68e4ce0..0000000 --- a/server/noderoutes/index.js +++ /dev/null @@ -1,16 +0,0 @@ -module.exports = function (app) { - app.get('/', function (req, res) { - res.redirect('/posts'); - }); - app.use('/signup', require('./signup')); - app.use('/signin', require('./signin')); - app.use('/signout', require('./signout')); - app.use('/posts', require('./posts')); - - // 404 page - app.use(function (req, res) { - if (!res.headersSent) { - res.render('404'); - } - }); -}; From c8094c75166ae46021145986e25dfa8618b54ea3 Mon Sep 17 00:00:00 2001 From: betamee Date: Tue, 21 Feb 2017 01:40:03 +0800 Subject: [PATCH 7/7] =?UTF-8?q?=E9=AA=8C=E8=AF=81=E5=AE=8Credux=E6=8A=80?= =?UTF-8?q?=E6=9C=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common/AppRoutes.js | 6 ++-- common/action/counteraction.js | 20 +++++++++++-- common/components/Counter.jsx | 33 +++++++++++++++++++-- common/components/Indexpage.jsx | 25 ++++++++++++++++ common/components/Layout.jsx | 6 ++++ common/components/Todo.jsx | 14 ++++++++- common/containers/Counterpage.jsx | 16 ++++++++--- common/containers/Todopage.jsx | 2 +- common/reducers/counterReducer.js | 23 +++++++++++++-- common/reducers/rootReducer.js | 17 +++++++---- common/store/index.js | 5 ++-- index.js | 9 +++++- npm-debug.log | 48 ------------------------------- package.json | 3 +- server/apiroutes/posts.js | 20 +++++++------ server/lib/viewpage.js | 4 +-- server/public/js/client.bundle.js | 21 ++++++++++++++ webpack.config.js | 29 ++++++++++++++++++- 18 files changed, 217 insertions(+), 84 deletions(-) create mode 100644 common/components/Indexpage.jsx delete mode 100644 npm-debug.log create mode 100644 server/public/js/client.bundle.js diff --git a/common/AppRoutes.js b/common/AppRoutes.js index c35531b..a4cef02 100644 --- a/common/AppRoutes.js +++ b/common/AppRoutes.js @@ -1,14 +1,16 @@ import React from 'react'; -import {Route, Redirect} from 'react-router'; +import {Route, IndexRoute} from 'react-router'; import Layout from './components/Layout.jsx';//布局页面 import Counterpage from './containers/Counterpage.jsx'; import Todopage from './containers/Todopage.jsx'; +import Indexpage from './components/Indexpage.jsx'; + //注意这个重定向路由 const AppRoutes = ( - + diff --git a/common/action/counteraction.js b/common/action/counteraction.js index cc9d904..8050fe0 100644 --- a/common/action/counteraction.js +++ b/common/action/counteraction.js @@ -1,10 +1,26 @@ +import request from 'axios'; +import fetch from 'isomorphic-fetch'; export const ADD_COUNT = 'ADD_COUNT'; -const counterAction=()=> { +export const ASYNC_REQUEST_ADD ="ASYNC_REQUEST_ADD";//异步请求中 +export const ASYNC_RECEIVE_ADD ="ASYNC_RECEIVE_ADD";//成功收获数据 + + + +export const counterAction=()=> {//同步 return { type: ADD_COUNT } } -export default counterAction; \ No newline at end of file +const AsyncCounterAction=()=>{//异步 + return dispatch=>{ + dispatch({type:ASYNC_REQUEST_ADD});//先分发一个action表明请求中 + return fetch('/api/posts') + .then(response=>response.json()) + .then(json=>dispatch({type:ASYNC_RECEIVE_ADD, data:json})); + } +} + +export default AsyncCounterAction; \ No newline at end of file diff --git a/common/components/Counter.jsx b/common/components/Counter.jsx index 7e65ea8..01ddaf6 100644 --- a/common/components/Counter.jsx +++ b/common/components/Counter.jsx @@ -1,15 +1,44 @@ import React,{Component} from 'react'; +import {Link} from 'react-router'; + class Counter extends Component { constructor(props){ super(props); + + } + componentDidMount () { + console.log("Counter did mount"); + } + + handleClick=(e)=>{ + const {onIncreaseClick} = this.props; + e.preventDefault(); + console.log("click"); + onIncreaseClick();//改变状态,触发action,props会自动随之变化,由react-redux提供,我只需要提供UI组件 } - render() { + handleAsyncClick=(e)=>{ + const {AsyncRequestDispatch} = this.props; + e.preventDefault(); + console.log("async click"); + console.log(AsyncRequestDispatch); + AsyncRequestDispatch();//异步改变状态 + } + + render() { + const { count} = this.props; + console.log(count); return(
- Hello World + Hello Counter{count.num}
+ Post数据:{count.data.post} +
+
+
+ Index + Todo
); } diff --git a/common/components/Indexpage.jsx b/common/components/Indexpage.jsx new file mode 100644 index 0000000..f58ed99 --- /dev/null +++ b/common/components/Indexpage.jsx @@ -0,0 +1,25 @@ +import React,{Component} from 'react'; +import {Link} from 'react-router'; + + +class Indexpage extends Component { + constructor(props){ + super(props); + } + componentDidMount () { + console.log("Indexpage did mount"); + console.log(this.props); + } + + render() { + return( +
+ Hello Indexpage + Counter + Todo +
+ ); + } +} + +export default Indexpage; \ No newline at end of file diff --git a/common/components/Layout.jsx b/common/components/Layout.jsx index ede1da8..5ffc496 100644 --- a/common/components/Layout.jsx +++ b/common/components/Layout.jsx @@ -4,9 +4,15 @@ class Layout extends Component { constructor(props){ super(props); } + componentDidMount() { + console.log("layout mount here"); + console.log(this.props); + } + render() { return(
+
Hello Layout
{this.props.children}
); diff --git a/common/components/Todo.jsx b/common/components/Todo.jsx index c473e2f..e5c6b3e 100644 --- a/common/components/Todo.jsx +++ b/common/components/Todo.jsx @@ -1,15 +1,27 @@ import React,{Component} from 'react'; +import {Link} from 'react-router'; + class Todo extends Component { constructor(props){ super(props); } - render() { + componentDidMount () { + console.log("Todo did mount"); + console.log(this.props); + } + + render() { + const { todo, onAddTodoClick } = this.props + console.log(todo); + console.log(onAddTodoClick); return(
Hello Todo! + Index + Counter
); } diff --git a/common/containers/Counterpage.jsx b/common/containers/Counterpage.jsx index a09cc10..20f8cb3 100644 --- a/common/containers/Counterpage.jsx +++ b/common/containers/Counterpage.jsx @@ -1,9 +1,10 @@ +import React from 'react'; + import {connect} from 'react-redux'; -import Counter from '../components/Counter'; +import Counter from '../components/Counter.jsx'; import {bindActionCreators} from 'redux'; -import counterAction from '../action/counteraction.js'; - - +import {counterAction} from '../action/counteraction.js';//导入action分法函数 +import AsyncCounterAction from '../action/counteraction.js'; //mapStateToProps const mapStateToProps = (state, ownProps) => { return { @@ -16,7 +17,14 @@ const mapDispatchToProps = (dispatch, ownProps) => { return { onIncreaseClick: () => { + console.log("onIncreaseClick here"); dispatch(counterAction()) + }, + + AsyncRequestDispatch:()=>{ + console.log("AsyncRequestDispatch here"); + console.log(AsyncCounterAction()); + dispatch(AsyncCounterAction()); } } } diff --git a/common/containers/Todopage.jsx b/common/containers/Todopage.jsx index 6912fbb..fb4ec00 100644 --- a/common/containers/Todopage.jsx +++ b/common/containers/Todopage.jsx @@ -1,5 +1,5 @@ import {connect} from 'react-redux'; -import Todo from '../components/Todo'; +import Todo from '../components/Todo.jsx'; import {bindActionCreators} from 'redux'; import todoAction from '../action/todoaction.js'; diff --git a/common/reducers/counterReducer.js b/common/reducers/counterReducer.js index 36ab428..23c923c 100644 --- a/common/reducers/counterReducer.js +++ b/common/reducers/counterReducer.js @@ -1,10 +1,27 @@ -import {ADD_COUNT} from '../action/counteraction'; +import {ADD_COUNT,ASYNC_RECEIVE_ADD,ASYNC_REQUEST_ADD} from '../action/counteraction'; -const counterReducer=(state=0, action)=>{ +let initialState={ + num:0, + isFetching:false, + data:{} +} + +const counterReducer=(state=initialState, action)=>{ switch(action.type) { case ADD_COUNT: - return state+1; + return Object.assign({},state,{ + num:state.num+1 + }); + case ASYNC_REQUEST_ADD://请求 + return Object.assign({},state,{ + isFetching:true + }); + case ASYNC_RECEIVE_ADD://响应 + return Object.assign({},state,{ + data:action.data, + isFetching:false + }); default: return state; } diff --git a/common/reducers/rootReducer.js b/common/reducers/rootReducer.js index 40cd2eb..3bce9de 100644 --- a/common/reducers/rootReducer.js +++ b/common/reducers/rootReducer.js @@ -3,11 +3,16 @@ import counterReducer from './counterReducer'; import todoReducer from './todoReducer'; -const rootReducer=(state={},action)=>{ - return { - counterReducer:counterReducer(state.count, action), - todoReducer: todoReducer(state.todo, action) - } -} +// const rootReducer=(state={},action)=>{ +// return { +// count:counterReducer(state.count, action), +// todo: todoReducer(state.todo, action) +// } +// } +const rootReducer =combineReducers({//这里的count和todo一定要和状态属性一致 + count:counterReducer, + todo:todoReducer +}); + export default rootReducer; \ No newline at end of file diff --git a/common/store/index.js b/common/store/index.js index 4a330b2..a66ef55 100644 --- a/common/store/index.js +++ b/common/store/index.js @@ -1,9 +1,10 @@ -import {createStore} from 'redux'; +import {createStore, applyMiddleware} from 'redux'; import rootReducer from '../reducers/rootReducer'; +import thunk from 'redux-thunk';//应用一下中间件 const configureStore=(initialState)=>{ - const store =createStore(rootReducer,initialState); + const store =createStore(rootReducer,initialState,applyMiddleware(thunk)); return store; } diff --git a/index.js b/index.js index 7847d87..3f61fca 100644 --- a/index.js +++ b/index.js @@ -36,12 +36,19 @@ app.get("*",(req, res)=>{ }else if(renderProps) { var initialState = { - count:1, + count:{ + num:1, + isFetching:false, + data:{ + post:"hhhh" + } + }, todo:['haha'] }; const store = configureStore(initialState); + console.log(store.getState()); let marked = renderToString( diff --git a/npm-debug.log b/npm-debug.log deleted file mode 100644 index 9dffa71..0000000 --- a/npm-debug.log +++ /dev/null @@ -1,48 +0,0 @@ -0 info it worked if it ends with ok -1 verbose cli [ 'C:\\Packages\\nodejs\\node.exe', -1 verbose cli 'C:\\Packages\\nvm\\npm\\node_modules\\npm\\bin\\npm-cli.js', -1 verbose cli 'run', -1 verbose cli 'start' ] -2 info using npm@4.0.5 -3 info using node@v6.9.4 -4 verbose run-script [ 'prestart', 'start', 'poststart' ] -5 info lifecycle react-blog@1.0.0~prestart: react-blog@1.0.0 -6 silly lifecycle react-blog@1.0.0~prestart: no script for prestart, continuing -7 info lifecycle react-blog@1.0.0~start: react-blog@1.0.0 -8 verbose lifecycle react-blog@1.0.0~start: unsafe-perm in lifecycle true -9 verbose lifecycle react-blog@1.0.0~start: PATH: C:\Packages\nvm\npm\node_modules\npm\bin\node-gyp-bin;C:\Github\ReactBlog\node_modules\.bin;C:\Packages\Python27\;C:\Packages\Python27\Scripts;C:\ProgramData\Oracle\Java\javapath;C:\Packages\nvm\npm;C:\Packages\nvm;C:\Packages\nodejs;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Softwares\cmder;C:\Users\Betamee\AppData\Local\Microsoft\WindowsApps;C:\Softwares\Microsoft VS Code\bin;C:\Softwares\Crucial\Crucial Storage Executive;C:\Packages\xampp\php;C:\Packages\xampp\php\ext;C:\Softwares\MATLAB\R2015b\runtime\win64;C:\Softwares\MATLAB\R2015b\bin;C:\Softwares\MATLAB\R2015b\polyspace\bin;C:\Program Files\Microsoft SQL Server\130\Tools\Binn\;C:\Packages\Java\jdk1.8.0_102\bin;C:\Packages\Java\jdk1.8.0_102\jre\bin;C:\Softwares\Calibre2\;C:\Program Files (x86)\Windows Kits\8.1\Windows Performance Toolkit\;C:\Program Files\dotnet\;C:\Program Files\Microsoft\Web Platform Installer\;C:\ProgramData\chocolatey\bin;C:\Packages\gradle-3.2.1\bin;C:\Softwares\Git\cmd;C:\Softwares\WinSCP\;C:\Packages\Ruby23-x64\bin;C:\Packages\MongoDB\Server\3.4\bin;C:\Packages\Ruby23-x64\bin;C:\Users\Betamee\AppData\Local\Microsoft\WindowsApps;C:\Softwares\Microsoft VS Code\bin;C:\Packages\Android\sdk\tools;C:\Packages\Android\sdk\platform-tools -10 verbose lifecycle react-blog@1.0.0~start: CWD: C:\Github\ReactBlog -11 silly lifecycle react-blog@1.0.0~start: Args: [ '/d /s /c', 'babel-node index.js' ] -12 silly lifecycle react-blog@1.0.0~start: Returned: code: 1 signal: null -13 info lifecycle react-blog@1.0.0~start: Failed to exec start script -14 verbose stack Error: react-blog@1.0.0 start: `babel-node index.js` -14 verbose stack Exit status 1 -14 verbose stack at EventEmitter. (C:\Packages\nvm\npm\node_modules\npm\lib\utils\lifecycle.js:279:16) -14 verbose stack at emitTwo (events.js:106:13) -14 verbose stack at EventEmitter.emit (events.js:191:7) -14 verbose stack at ChildProcess. (C:\Packages\nvm\npm\node_modules\npm\lib\utils\spawn.js:40:14) -14 verbose stack at emitTwo (events.js:106:13) -14 verbose stack at ChildProcess.emit (events.js:191:7) -14 verbose stack at maybeClose (internal/child_process.js:877:16) -14 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5) -15 verbose pkgid react-blog@1.0.0 -16 verbose cwd C:\Github\ReactBlog -17 error Windows_NT 10.0.14393 -18 error argv "C:\\Packages\\nodejs\\node.exe" "C:\\Packages\\nvm\\npm\\node_modules\\npm\\bin\\npm-cli.js" "run" "start" -19 error node v6.9.4 -20 error npm v4.0.5 -21 error code ELIFECYCLE -22 error react-blog@1.0.0 start: `babel-node index.js` -22 error Exit status 1 -23 error Failed at the react-blog@1.0.0 start script 'babel-node index.js'. -23 error Make sure you have the latest version of node.js and npm installed. -23 error If you do, this is most likely a problem with the react-blog package, -23 error not with npm itself. -23 error Tell the author that this fails on your system: -23 error babel-node index.js -23 error You can get information on how to open an issue for this project with: -23 error npm bugs react-blog -23 error Or if that isn't available, you can get their info via: -23 error npm owner ls react-blog -23 error There is likely additional logging output above. -24 verbose exit [ 1, true ] diff --git a/package.json b/package.json index 48c7aa2..6f98ede 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,8 @@ "main": "index.js", "scripts": { "test": "echo \"Error: no test specified\" && exit 1", - "start":"node_modules/.bin/babel-node index.js" + "start": "node_modules/.bin/babel-node index.js", + "build": "webpack -p" }, "repository": { "type": "git", diff --git a/server/apiroutes/posts.js b/server/apiroutes/posts.js index bc6ae5e..079f815 100644 --- a/server/apiroutes/posts.js +++ b/server/apiroutes/posts.js @@ -8,15 +8,19 @@ var checkLogin = require('../middlewares/check').checkLogin; // GET /posts 所有用户或者特定用户的文章页 // eg: GET /posts?author=xxx router.get('/', function(req, res, next) { - var author = req.query.author; + // var author = req.query.author; + + // PostModel.getPosts(author) + // .then(function (posts) { + // res.render('posts', { + // posts: posts + // }); + // }) + // .catch(next); + res.json({ + post:"hello redux" + }); - PostModel.getPosts(author) - .then(function (posts) { - res.render('posts', { - posts: posts - }); - }) - .catch(next); }); // GET /posts/create 发表文章页 diff --git a/server/lib/viewpage.js b/server/lib/viewpage.js index d1c810f..db38c30 100644 --- a/server/lib/viewpage.js +++ b/server/lib/viewpage.js @@ -12,9 +12,9 @@ function renderFullPage(html, initiaState) { - + `; diff --git a/server/public/js/client.bundle.js b/server/public/js/client.bundle.js new file mode 100644 index 0000000..4815708 --- /dev/null +++ b/server/public/js/client.bundle.js @@ -0,0 +1,21 @@ +!function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var n={};return t.m=e,t.c=n,t.i=function(e){return e},t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=299)}([function(e,t,n){"use strict";function r(e,t,n,r,i,a,u,s){if(o(t),!e){var c;if(void 0===t)c=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var l=[n,r,i,a,u,s],p=0;c=new Error(t.replace(/%s/g,function(){return l[p++]})),c.name="Invariant Violation"}throw c.framesToPop=1,c}}var o=function(e){};e.exports=r},function(e,t,n){"use strict";var r=n(9),o=r;e.exports=o},function(e,t,n){"use strict";function r(e){for(var t=arguments.length-1,n="Minified React error #"+e+"; visit http://facebook.github.io/react/docs/error-decoder.html?invariant="+e,r=0;r0?void 0:l()(!1),null!=f&&(a+=encodeURI(f));else if("("===c)s[o]="",o+=1;else if(")"===c){var v=s.pop();o-=1,o?s[o-1]+=v:a+=v}else if("\\("===c)a+="(";else if("\\)"===c)a+=")";else if(":"===c.charAt(0))if(p=c.substring(1),f=t[p],null!=f||o>0?void 0:l()(!1),null==f){if(o){s[o-1]="";for(var m=r.indexOf(c),y=r.slice(m,r.length),g=-1,b=0;b0?void 0:l()(!1),d=m+g-1}}else o?s[o-1]+=encodeURIComponent(f):a+=encodeURIComponent(f);else o?s[o-1]+=c:a+=c;return o<=0?void 0:l()(!1),a.replace(/\/+/g,"/")}var c=n(6),l=n.n(c);t.c=a,t.b=u,t.a=s;var p=Object.create(null)},function(e,t,n){"use strict";var r=n(16);n.n(r)},function(e,t,n){"use strict";var r=n(4),o=n(280),i=n(72),a=n(285),u=n(281),s=n(282),c=n(25),l=n(283),p=n(286),f=n(287),d=(n(1),c.createElement),h=c.createFactory,v=c.cloneElement,m=r,y={Children:{map:o.map,forEach:o.forEach,count:o.count,toArray:o.toArray,only:f},Component:i,PureComponent:a,createElement:d,cloneElement:v,isValidElement:c.isValidElement,PropTypes:l,createClass:u.createClass,createFactory:h,createMixin:function(e){return e},DOM:s,version:p,__spread:m};e.exports=y},function(e,t,n){"use strict";function r(e){return void 0!==e.ref}function o(e){return void 0!==e.key}var i=n(4),a=n(13),u=(n(1),n(125),Object.prototype.hasOwnProperty),s=n(123),c={key:!0,ref:!0,__self:!0,__source:!0},l=function(e,t,n,r,o,i,a){var u={$$typeof:s,type:e,key:t,ref:n,props:a,_owner:i};return u};l.createElement=function(e,t,n){var i,s={},p=null,f=null,d=null,h=null;if(null!=t){r(t)&&(f=t.ref),o(t)&&(p=""+t.key),d=void 0===t.__self?null:t.__self,h=void 0===t.__source?null:t.__source;for(i in t)u.call(t,i)&&!c.hasOwnProperty(i)&&(s[i]=t[i])}var v=arguments.length-2;if(1===v)s.children=n;else if(v>1){for(var m=Array(v),y=0;y1){for(var b=Array(g),_=0;_ should not have a "'+t+'" prop')}var o=n(3);n.n(o);t.c=r,n.d(t,"a",function(){return f}),n.d(t,"b",function(){return d}),n.d(t,"d",function(){return v});var i=o.PropTypes.func,a=o.PropTypes.object,u=o.PropTypes.arrayOf,s=o.PropTypes.oneOfType,c=o.PropTypes.element,l=o.PropTypes.shape,p=o.PropTypes.string,f=(l({listen:i.isRequired,push:i.isRequired,replace:i.isRequired,go:i.isRequired,goBack:i.isRequired,goForward:i.isRequired}),s([i,p])),d=s([f,a]),h=s([a,c]),v=s([h,u(h)])},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(266);n.d(t,"Router",function(){return r.a});var o=n(114);n.d(t,"Link",function(){return o.a});var i=n(262);n.d(t,"IndexLink",function(){return i.a});var a=n(277);n.d(t,"withRouter",function(){return a.a});var u=n(263);n.d(t,"IndexRedirect",function(){return u.a});var s=n(264);n.d(t,"IndexRoute",function(){return s.a});var c=n(116);n.d(t,"Redirect",function(){return c.a});var l=n(265);n.d(t,"Route",function(){return l.a});var p=n(15);n.d(t,"createRoutes",function(){return p.a});var f=n(71);n.d(t,"RouterContext",function(){return f.a});var d=n(70);n.d(t,"locationShape",function(){return d.a}),n.d(t,"routerShape",function(){return d.b});var h=n(275);n.d(t,"match",function(){return h.a});var v=n(121);n.d(t,"useRouterHistory",function(){return v.a});var m=n(22);n.d(t,"formatPattern",function(){return m.a});var y=n(268);n.d(t,"applyRouterMiddleware",function(){return y.a});var g=n(269);n.d(t,"browserHistory",function(){return g.a});var b=n(273);n.d(t,"hashHistory",function(){return b.a});var _=n(118);n.d(t,"createMemoryHistory",function(){return _.a})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(128),o=n(292),i=n(291),a=n(290),u=n(127);n(129);n.d(t,"createStore",function(){return r.a}),n.d(t,"combineReducers",function(){return o.a}),n.d(t,"bindActionCreators",function(){return i.a}),n.d(t,"applyMiddleware",function(){return a.a}),n.d(t,"compose",function(){return u.a})},function(e,t,n){"use strict";t.__esModule=!0;t.PUSH="PUSH",t.REPLACE="REPLACE",t.POP="POP"},function(e,t,n){"use strict";t.__esModule=!0;t.addEventListener=function(e,t,n){return e.addEventListener?e.addEventListener(t,n,!1):e.attachEvent("on"+t,n)},t.removeEventListener=function(e,t,n){return e.removeEventListener?e.removeEventListener(t,n,!1):e.detachEvent("on"+t,n)},t.supportsHistory=function(){var e=window.navigator.userAgent;return(e.indexOf("Android 2.")===-1&&e.indexOf("Android 4.0")===-1||e.indexOf("Mobile Safari")===-1||e.indexOf("Chrome")!==-1||e.indexOf("Windows Phone")!==-1)&&(window.history&&"pushState"in window.history)},t.supportsGoWithoutReloadUsingHash=function(){return window.navigator.userAgent.indexOf("Firefox")===-1},t.supportsPopstateOnHashchange=function(){return window.navigator.userAgent.indexOf("Trident")===-1}},function(e,t,n){"use strict";function r(e){return Object.prototype.hasOwnProperty.call(e,v)||(e[v]=d++,p[e[v]]={}),p[e[v]]}var o,i=n(4),a=n(52),u=n(207),s=n(98),c=n(240),l=n(63),p={},f=!1,d=0,h={topAbort:"abort",topAnimationEnd:c("animationend")||"animationend",topAnimationIteration:c("animationiteration")||"animationiteration",topAnimationStart:c("animationstart")||"animationstart",topBlur:"blur",topCanPlay:"canplay",topCanPlayThrough:"canplaythrough",topChange:"change",topClick:"click",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",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",topTouchCancel:"touchcancel",topTouchEnd:"touchend",topTouchMove:"touchmove",topTouchStart:"touchstart",topTransitionEnd:c("transitionend")||"transitionend",topVolumeChange:"volumechange",topWaiting:"waiting",topWheel:"wheel"},v="_reactListenersID"+String(Math.random()).slice(2),m=i({},u,{ +ReactEventListener:null,injection:{injectReactEventListener:function(e){e.setHandleTopLevel(m.handleTopLevel),m.ReactEventListener=e}},setEnabled:function(e){m.ReactEventListener&&m.ReactEventListener.setEnabled(e)},isEnabled:function(){return!(!m.ReactEventListener||!m.ReactEventListener.isEnabled())},listenTo:function(e,t){for(var n=t,o=r(n),i=a.registrationNameDependencies[e],u=0;u]/;e.exports=o},function(e,t,n){"use strict";var r,o=n(7),i=n(51),a=/^[ \r\n\t\f]/,u=/<(!--|link|noscript|meta|script|style)[ \r\n\t\f\/>]/,s=n(59),c=s(function(e,t){if(e.namespaceURI!==i.svg||"innerHTML"in e)e.innerHTML=t;else{r=r||document.createElement("div"),r.innerHTML=""+t+"";for(var n=r.firstChild;n.firstChild;)e.appendChild(n.firstChild)}});if(o.canUseDOM){var l=document.createElement("div");l.innerHTML=" ",""===l.innerHTML&&(c=function(e,t){if(e.parentNode&&e.parentNode.replaceChild(e,e),a.test(t)||"<"===t[0]&&u.test(t)){e.innerHTML=String.fromCharCode(65279)+t;var n=e.firstChild;1===n.data.length?e.removeChild(n):n.deleteData(0,1)}else e.innerHTML=t}),l=null}e.exports=c},function(e,t,n){"use strict";(function(t){function r(e,t){!i.isUndefined(e)&&i.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}function o(){var e;return"undefined"!=typeof XMLHttpRequest?e=n(74):"undefined"!=typeof t&&(e=n(74)),e}var i=n(8),a=n(147),u=/^\)\]\}',?\n/,s={"Content-Type":"application/x-www-form-urlencoded"},c={adapter:o(),transformRequest:[function(e,t){return a(t,"Content-Type"),i.isFormData(e)||i.isArrayBuffer(e)||i.isStream(e)||i.isFile(e)||i.isBlob(e)?e:i.isArrayBufferView(e)?e.buffer:i.isURLSearchParams(e)?(r(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString()):i.isObject(e)?(r(t,"application/json;charset=utf-8"),JSON.stringify(e)):e}],transformResponse:[function(e){if("string"==typeof e){e=e.replace(u,"");try{e=JSON.parse(e)}catch(e){}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,validateStatus:function(e){return e>=200&&e<300}};c.headers={common:{Accept:"application/json, text/plain, */*"}},i.forEach(["delete","get","head"],function(e){c.headers[e]={}}),i.forEach(["post","put","patch"],function(e){c.headers[e]=i.merge(s)}),e.exports=c}).call(t,n(49))},function(e,t,n){"use strict";function r(e,t){return e===t?0!==e||0!==t||1/e===1/t:e!==e&&t!==t}function o(e,t){if(r(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;var n=Object.keys(e),o=Object.keys(t);if(n.length!==o.length)return!1;for(var a=0;a1)for(var n=1;n-1?void 0:a("96",e),!c.plugins[n]){t.extractEvents?void 0:a("97",e),c.plugins[n]=t;var r=t.eventTypes;for(var i in r)o(r[i],t,i)?void 0:a("98",i,e)}}}function o(e,t,n){c.eventNameDispatchConfigs.hasOwnProperty(n)?a("99",n):void 0,c.eventNameDispatchConfigs[n]=e;var r=e.phasedRegistrationNames;if(r){for(var o in r)if(r.hasOwnProperty(o)){var u=r[o];i(u,t,n)}return!0}return!!e.registrationName&&(i(e.registrationName,t,n),!0)}function i(e,t,n){c.registrationNameModules[e]?a("100",e):void 0,c.registrationNameModules[e]=t,c.registrationNameDependencies[e]=t.eventTypes[n].dependencies}var a=n(2),u=(n(0),null),s={},c={plugins:[],eventNameDispatchConfigs:{},registrationNameModules:{},registrationNameDependencies:{},possibleRegistrationNames:null,injectEventPluginOrder:function(e){u?a("101"):void 0,u=Array.prototype.slice.call(e),r()},injectEventPluginsByName:function(e){var t=!1;for(var n in e)if(e.hasOwnProperty(n)){var o=e[n];s.hasOwnProperty(n)&&s[n]===o||(s[n]?a("102",n):void 0,s[n]=o,t=!0)}t&&r()},getPluginModuleForEvent:function(e){var t=e.dispatchConfig;if(t.registrationName)return c.registrationNameModules[t.registrationName]||null;if(void 0!==t.phasedRegistrationNames){var n=t.phasedRegistrationNames;for(var r in n)if(n.hasOwnProperty(r)){var o=c.registrationNameModules[n[r]];if(o)return o}}return null},_resetEventPlugins:function(){u=null;for(var e in s)s.hasOwnProperty(e)&&delete s[e];c.plugins.length=0;var t=c.eventNameDispatchConfigs;for(var n in t)t.hasOwnProperty(n)&&delete t[n];var r=c.registrationNameModules;for(var o in r)r.hasOwnProperty(o)&&delete r[o]}};e.exports=c},function(e,t,n){"use strict";function r(e){return"topMouseUp"===e||"topTouchEnd"===e||"topTouchCancel"===e}function o(e){return"topMouseMove"===e||"topTouchMove"===e}function i(e){return"topMouseDown"===e||"topTouchStart"===e}function a(e,t,n,r){var o=e.type||"unknown-event";e.currentTarget=y.getNodeFromInstance(r),t?v.invokeGuardedCallbackWithCatch(o,n,e):v.invokeGuardedCallback(o,n,e),e.currentTarget=null}function u(e,t){var n=e._dispatchListeners,r=e._dispatchInstances;if(Array.isArray(n))for(var o=0;o0&&r.length<20?n+" (keys: "+r.join(", ")+")":n}function i(e,t){var n=u.get(e);if(!n){return null}return n}var a=n(2),u=(n(13),n(30)),s=(n(10),n(11)),c=(n(0),n(1),{isMounted:function(e){var t=u.get(e);return!!t&&!!t._renderedComponent},enqueueCallback:function(e,t,n){c.validateCallback(t,n);var o=i(e);return o?(o._pendingCallbacks?o._pendingCallbacks.push(t):o._pendingCallbacks=[t],void r(o)):null},enqueueCallbackInternal:function(e,t){e._pendingCallbacks?e._pendingCallbacks.push(t):e._pendingCallbacks=[t],r(e)},enqueueForceUpdate:function(e){var t=i(e,"forceUpdate");t&&(t._pendingForceUpdate=!0,r(t))},enqueueReplaceState:function(e,t){var n=i(e,"replaceState");n&&(n._pendingStateQueue=[t],n._pendingReplaceState=!0,r(n))},enqueueSetState:function(e,t){var n=i(e,"setState");if(n){var o=n._pendingStateQueue||(n._pendingStateQueue=[]);o.push(t),r(n)}},enqueueElementInternal:function(e,t,n){e._pendingElement=t,e._context=n,r(e)},validateCallback:function(e,t){e&&"function"!=typeof e?a("122",t,o(e)):void 0}});e.exports=c},function(e,t,n){"use strict";var r=function(e){return"undefined"!=typeof MSApp&&MSApp.execUnsafeLocalFunction?function(t,n,r,o){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,o)})}:e};e.exports=r},function(e,t,n){"use strict";function r(e){var t,n=e.keyCode;return"charCode"in e?(t=e.charCode,0===t&&13===n&&(t=13)):t=n,t>=32||13===t?t:0}e.exports=r},function(e,t,n){"use strict";function r(e){var t=this,n=t.nativeEvent;if(n.getModifierState)return n.getModifierState(e);var r=i[e];return!!r&&!!n[r]}function o(e){return r}var i={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};e.exports=o},function(e,t,n){"use strict";function r(e){var t=e.target||e.srcElement||window;return t.correspondingUseElement&&(t=t.correspondingUseElement),3===t.nodeType?t.parentNode:t}e.exports=r},function(e,t,n){"use strict";/** + * Checks if an event is supported in the current execution environment. + * + * NOTE: This will not work correctly for non-generic events such as `change`, + * `reset`, `load`, `error`, and `select`. + * + * Borrows from Modernizr. + * + * @param {string} eventNameSuffix Event name, e.g. "click". + * @param {?boolean} capture Check if the capture phase is supported. + * @return {boolean} True if the event is supported. + * @internal + * @license Modernizr 3.0.0pre (Custom Build) | MIT + */ +function r(e,t){if(!i.canUseDOM||t&&!("addEventListener"in document))return!1;var n="on"+e,r=n in document;if(!r){var a=document.createElement("div");a.setAttribute(n,"return;"),r="function"==typeof a[n]}return!r&&o&&"wheel"===e&&(r=document.implementation.hasFeature("Events.wheel","3.0")),r}var o,i=n(7);i.canUseDOM&&(o=document.implementation&&document.implementation.hasFeature&&document.implementation.hasFeature("","")!==!0),e.exports=r},function(e,t,n){"use strict";function r(e,t){var n=null===e||e===!1,r=null===t||t===!1;if(n||r)return n===r;var o=typeof e,i=typeof t;return"string"===o||"number"===o?"string"===i||"number"===i:"object"===i&&e.type===t.type&&e.key===t.key}e.exports=r},function(e,t,n){"use strict";var r=(n(4),n(9)),o=(n(1),r);e.exports=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(254),o=n(109),i=n(255);n.d(t,"Provider",function(){return r.a}),n.d(t,"connectAdvanced",function(){return o.a}),n.d(t,"connect",function(){return i.a})},function(e,t,n){"use strict";function r(e){"undefined"!=typeof console&&"function"==typeof console.error&&console.error(e);try{throw new Error(e)}catch(e){}}t.a=r},function(e,t,n){"use strict";function r(e,t,n){function r(){return a=!0,u?void(c=[].concat(Array.prototype.slice.call(arguments))):void n.apply(this,arguments)}function o(){if(!a&&(s=!0,!u)){for(u=!0;!a&&i=e&&s&&(a=!0,n()))}}var i=0,a=!1,u=!1,s=!1,c=void 0;o()}function o(e,t,n){function r(e,t,r){a||(t?(a=!0,n(t)):(i[e]=r,a=++u===o,a&&n(null,i)))}var o=e.length,i=[];if(0===o)return n(null,i);var a=!1,u=0;e.forEach(function(e,n){t(e,n,function(e,t){r(n,e,t)})})}t.b=r,t.a=o},function(e,t,n){"use strict";function r(e){return"@@contextSubscriber/"+e}function o(e){var t,n,o=r(e),i=o+"/listeners",a=o+"/eventIndex",s=o+"/subscribe";return n={childContextTypes:(t={},t[o]=u.isRequired,t),getChildContext:function(){var e;return e={},e[o]={eventIndex:this[a],subscribe:this[s]},e},componentWillMount:function(){this[i]=[],this[a]=0},componentWillReceiveProps:function(){this[a]++},componentDidUpdate:function(){var e=this;this[i].forEach(function(t){return t(e[a])})}},n[s]=function(e){var t=this;return this[i].push(e),function(){t[i]=t[i].filter(function(t){return t!==e})}},n}function i(e){var t,n,o=r(e),i=o+"/lastRenderedEventIndex",a=o+"/handleContextUpdate",s=o+"/unsubscribe";return n={contextTypes:(t={},t[o]=u,t),getInitialState:function(){var e;return this.context[o]?(e={},e[i]=this.context[o].eventIndex,e):{}},componentDidMount:function(){this.context[o]&&(this[s]=this.context[o].subscribe(this[a]))},componentWillReceiveProps:function(){var e;this.context[o]&&this.setState((e={},e[i]=this.context[o].eventIndex,e))},componentWillUnmount:function(){this[s]&&(this[s](),this[s]=null)}},n[a]=function(e){if(e!==this.state[i]){var t;this.setState((t={},t[i]=e,t))}},n}var a=n(3);n.n(a);t.a=o,t.b=i;var u=a.PropTypes.shape({subscribe:a.PropTypes.func.isRequired,eventIndex:a.PropTypes.number.isRequired})},function(e,t,n){"use strict";var r=n(3);n.n(r);n.d(t,"b",function(){return s}),n.d(t,"a",function(){return c});var o=r.PropTypes.func,i=r.PropTypes.object,a=r.PropTypes.shape,u=r.PropTypes.string,s=a({push:o.isRequired,replace:o.isRequired,go:o.isRequired,goBack:o.isRequired,goForward:o.isRequired,setRouteLeaveHook:o.isRequired,isActive:o.isRequired}),c=a({pathname:u.isRequired,search:u.isRequired,state:i,action:u.isRequired,key:u})},function(e,t,n){"use strict";var r=n(6),o=n.n(r),i=n(3),a=n.n(i),u=n(272),s=n(69),c=n(15),l=Object.assign||function(e){for(var t=1;t1?t-1:0),o=1;o1?t-1:0),o=1;o.":"function"==typeof t?" Instead of passing a class like Foo, pass React.createElement(Foo) or .":null!=t&&void 0!==t.props?" This may be caused by unintentionally loading two independent copies of React.":"");var a,u=m.createElement(U,{child:t});if(e){var s=w.get(e);a=s._processChildContext(s._context)}else a=T;var l=f(n);if(l){var p=l._currentElement,h=p.props.child;if(A(h,t)){var v=l._renderedComponent.getPublicInstance(),y=r&&function(){r.call(v)};return F._updateRootComponent(l,u,a,n,y),v}F.unmountComponentAtNode(n)}var g=o(n),b=g&&!!i(g),_=c(n),C=b&&!l&&!_,E=F._renderNewRootComponent(u,n,C,a)._renderedComponent.getPublicInstance();return r&&r.call(E),E},render:function(e,t,n){return F._renderSubtreeIntoContainer(null,e,t,n)},unmountComponentAtNode:function(e){l(e)?void 0:d("40");var t=f(e);if(!t){c(e),1===e.nodeType&&e.hasAttribute(N);return!1}return delete j[t._instance.rootID],O.batchedUpdates(s,t,e,!1),!0},_mountImageIntoNode:function(e,t,n,i,a){if(l(t)?void 0:d("41"),i){var u=o(t);if(E.canReuseMarkup(e,u))return void g.precacheNode(n,u);var s=u.getAttribute(E.CHECKSUM_ATTR_NAME);u.removeAttribute(E.CHECKSUM_ATTR_NAME);var c=u.outerHTML;u.setAttribute(E.CHECKSUM_ATTR_NAME,s);var p=e,f=r(p,c),v=" (client) "+p.substring(f-20,f+20)+"\n (server) "+c.substring(f-20,f+20);t.nodeType===I?d("42",v):void 0}if(t.nodeType===I?d("43"):void 0,a.useCreateElement){for(;t.lastChild;)t.removeChild(t.lastChild);h.insertTreeBefore(t,e,null)}else k(t,e),g.precacheNode(n,t.firstChild)}};e.exports=F},function(e,t,n){"use strict";var r=n(2),o=n(24),i=(n(0),{HOST:0,COMPOSITE:1,EMPTY:2,getType:function(e){return null===e||e===!1?i.EMPTY:o.isValidElement(e)?"function"==typeof e.type?i.COMPOSITE:i.HOST:void r("26",e)}});e.exports=i},function(e,t,n){"use strict";var r={currentScrollLeft:0,currentScrollTop:0,refreshScrollValues:function(e){r.currentScrollLeft=e.x,r.currentScrollTop=e.y}};e.exports=r},function(e,t,n){"use strict";function r(e,t){return null==t?o("30"):void 0,null==e?t:Array.isArray(e)?Array.isArray(t)?(e.push.apply(e,t),e):(e.push(t),e):Array.isArray(t)?[e].concat(t):[e,t]}var o=n(2);n(0);e.exports=r},function(e,t,n){"use strict";function r(e,t,n){Array.isArray(e)?e.forEach(t,n):e&&t.call(n,e)}e.exports=r},function(e,t,n){"use strict";function r(e){for(var t;(t=e._renderedNodeType)===o.COMPOSITE;)e=e._renderedComponent;return t===o.HOST?e._renderedComponent:t===o.EMPTY?null:void 0}var o=n(97);e.exports=r},function(e,t,n){"use strict";function r(){return!i&&o.canUseDOM&&(i="textContent"in document.documentElement?"textContent":"innerText"),i}var o=n(7),i=null;e.exports=r},function(e,t,n){"use strict";function r(e){if(e){var t=e.getName();if(t)return" Check the render method of `"+t+"`."}return""}function o(e){return"function"==typeof e&&"undefined"!=typeof e.prototype&&"function"==typeof e.prototype.mountComponent&&"function"==typeof e.prototype.receiveComponent}function i(e,t){var n;if(null===e||e===!1)n=c.create(i);else if("object"==typeof e){var u=e,s=u.type;if("function"!=typeof s&&"string"!=typeof s){var f="";f+=r(u._owner),a("130",null==s?s:typeof s,f)}"string"==typeof u.type?n=l.createInternalComponent(u):o(u.type)?(n=new u.type(u),n.getHostNode||(n.getHostNode=n.getNativeNode)):n=new p(u)}else"string"==typeof e||"number"==typeof e?n=l.createInstanceForText(e):a("131",typeof e);return n._mountIndex=0,n._mountImage=null,n}var a=n(2),u=n(4),s=n(191),c=n(92),l=n(94),p=(n(238),n(0),n(1),function(e){this.construct(e)});u(p.prototype,s,{_instantiateReactComponent:i}),e.exports=i},function(e,t,n){"use strict";function r(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return"input"===t?!!o[e.type]:"textarea"===t}var o={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};e.exports=r},function(e,t,n){"use strict";var r=n(7),o=n(40),i=n(41),a=function(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&3===n.nodeType)return void(n.nodeValue=t)}e.textContent=t};r.canUseDOM&&("textContent"in document.documentElement||(a=function(e,t){return 3===e.nodeType?void(e.nodeValue=t):void i(e,o(t))})),e.exports=a},function(e,t,n){"use strict";function r(e,t){return e&&"object"==typeof e&&null!=e.key?c.escape(e.key):t.toString(36)}function o(e,t,n,i){var f=typeof e;if("undefined"!==f&&"boolean"!==f||(e=null),null===e||"string"===f||"number"===f||"object"===f&&e.$$typeof===u)return n(i,e,""===t?l+r(e,0):t),1;var d,h,v=0,m=""===t?l:t+p;if(Array.isArray(e))for(var y=0;y=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}function u(e){var t,u,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},l=s.getDisplayName,y=void 0===l?function(e){return"ConnectAdvanced("+e+")"}:l,g=s.methodName,b=void 0===g?"connectAdvanced":g,_=s.renderCountProp,C=void 0===_?void 0:_,w=s.shouldHandleStateChanges,E=void 0===w||w,x=s.storeKey,P=void 0===x?"store":x,O=s.withRef,T=void 0!==O&&O,S=a(s,["getDisplayName","methodName","renderCountProp","shouldHandleStateChanges","storeKey","withRef"]),k=P+"Subscription",A=m++,R=(t={},t[P]=h.a,t[k]=f.PropTypes.instanceOf(d.a),t),N=(u={},u[k]=f.PropTypes.instanceOf(d.a),u);return function(t){p()("function"==typeof t,"You must pass a component to the function returned by connect. Instead received "+t);var a=t.displayName||t.name||"Component",u=y(a),s=v({},S,{getDisplayName:y,methodName:b,renderCountProp:C,shouldHandleStateChanges:E,storeKey:P,withRef:T,displayName:u,wrappedComponentName:a,WrappedComponent:t}),l=function(a){function c(e,t){r(this,c);var n=o(this,a.call(this,e,t));return n.version=A,n.state={},n.renderCount=0,n.store=n.props[P]||n.context[P],n.parentSub=e[k]||t[k],n.setWrappedInstance=n.setWrappedInstance.bind(n),p()(n.store,'Could not find "'+P+'" in either the context or '+('props of "'+u+'". ')+"Either wrap the root component in a , "+('or explicitly pass "'+P+'" as a prop to "'+u+'".')),n.getState=n.store.getState.bind(n.store),n.initSelector(),n.initSubscription(),n}return i(c,a),c.prototype.getChildContext=function(){var e;return e={},e[k]=this.subscription||this.parentSub,e},c.prototype.componentDidMount=function(){E&&(this.subscription.trySubscribe(),this.selector.run(this.props),this.selector.shouldComponentUpdate&&this.forceUpdate()); +},c.prototype.componentWillReceiveProps=function(e){this.selector.run(e)},c.prototype.shouldComponentUpdate=function(){return this.selector.shouldComponentUpdate},c.prototype.componentWillUnmount=function(){this.subscription&&this.subscription.tryUnsubscribe(),this.subscription=null,this.store=null,this.parentSub=null,this.selector.run=function(){}},c.prototype.getWrappedInstance=function(){return p()(T,"To access the wrapped instance, you need to specify "+("{ withRef: true } in the options argument of the "+b+"() call.")),this.wrappedInstance},c.prototype.setWrappedInstance=function(e){this.wrappedInstance=e},c.prototype.initSelector=function(){var t=this.store.dispatch,n=this.getState,r=e(t,s),o=this.selector={shouldComponentUpdate:!0,props:r(n(),this.props),run:function(e){try{var t=r(n(),e);(o.error||t!==o.props)&&(o.shouldComponentUpdate=!0,o.props=t,o.error=null)}catch(e){o.shouldComponentUpdate=!0,o.error=e}}}},c.prototype.initSubscription=function(){var e=this;E&&!function(){var t=e.subscription=new d.a(e.store,e.parentSub),n={};t.onStateChange=function(){this.selector.run(this.props),this.selector.shouldComponentUpdate?(this.componentDidUpdate=function(){this.componentDidUpdate=void 0,t.notifyNestedSubs()},this.setState(n)):t.notifyNestedSubs()}.bind(e)}()},c.prototype.isSubscribed=function(){return Boolean(this.subscription)&&this.subscription.isSubscribed()},c.prototype.addExtraProps=function(e){if(!T&&!C)return e;var t=v({},e);return T&&(t.ref=this.setWrappedInstance),C&&(t[C]=this.renderCount++),t},c.prototype.render=function(){var e=this.selector;if(e.shouldComponentUpdate=!1,e.error)throw e.error;return n.i(f.createElement)(t,this.addExtraProps(e.props))},c}(f.Component);return l.WrappedComponent=t,l.displayName=u,l.childContextTypes=N,l.contextTypes=R,l.propTypes=R,c()(l,t)}}var s=n(85),c=n.n(s),l=n(6),p=n.n(l),f=n(3),d=(n.n(f),n(111)),h=n(112);t.a=u;var v=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}function o(e){return 0===e.button}function i(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function a(e){for(var t in e)if(Object.prototype.hasOwnProperty.call(e,t))return!1;return!0}function u(e,t){return"function"==typeof e?e(t.location):e}var s=n(3),c=n.n(s),l=n(6),p=n.n(l),f=n(70),d=n(69),h=Object.assign||function(e){for(var t=1;t=0;r--){var o=e[r],i=o.path||"";if(n=i.replace(/\/*$/,"/")+n,0===i.indexOf("/"))break}return"/"+n}},propTypes:{path:p,from:p,to:p.isRequired,query:f,state:f,onEnter:c.c,children:c.c},render:function(){a()(!1)}});t.a=d},function(e,t,n){"use strict";function r(e,t,n){var r=i({},e,{setRouteLeaveHook:t.listenBeforeLeavingRoute,isActive:t.isActive});return o(r,n)}function o(e,t){var n=t.location,r=t.params,o=t.routes;return e.location=n,e.params=r,e.routes=o,e}t.a=r,t.b=o;var i=Object.assign||function(e){for(var t=1;t1&&void 0!==arguments[1]&&arguments[1];return e.__id__||t&&(e.__id__=w++)}function h(e){return e.map(function(e){return E[d(e)]}).filter(function(e){return e})}function v(e,r){n.i(c.a)(t,e,function(t,o){if(null==o)return void r();C=l({},o,{location:e});for(var a=h(n.i(i.a)(_,C).leaveRoutes),u=void 0,s=0,c=a.length;null==u&&s>8-u%1*8)){if(n=o.charCodeAt(u+=.75),n>255)throw new r;t=t<<8|n}return a}var i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";r.prototype=new Error,r.prototype.code=5,r.prototype.name="InvalidCharacterError",e.exports=o},function(e,t,n){"use strict";function r(e){return encodeURIComponent(e).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}var o=n(8);e.exports=function(e,t,n){if(!t)return e;var i;if(n)i=n(t);else if(o.isURLSearchParams(t))i=t.toString();else{var a=[];o.forEach(t,function(e,t){null!==e&&"undefined"!=typeof e&&(o.isArray(e)&&(t+="[]"),o.isArray(e)||(e=[e]),o.forEach(e,function(e){o.isDate(e)?e=e.toISOString():o.isObject(e)&&(e=JSON.stringify(e)),a.push(r(t)+"="+r(e))}))}),i=a.join("&")}return i&&(e+=(e.indexOf("?")===-1?"?":"&")+i),e}},function(e,t,n){"use strict";e.exports=function(e,t){return e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,"")}},function(e,t,n){"use strict";var r=n(8);e.exports=r.isStandardBrowserEnv()?function(){return{write:function(e,t,n,o,i,a){var u=[];u.push(e+"="+encodeURIComponent(t)),r.isNumber(n)&&u.push("expires="+new Date(n).toGMTString()),r.isString(o)&&u.push("path="+o),r.isString(i)&&u.push("domain="+i),a===!0&&u.push("secure"),document.cookie=u.join("; ")},read:function(e){var t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}()},function(e,t,n){"use strict";e.exports=function(e){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(e)}},function(e,t,n){"use strict";var r=n(8);e.exports=r.isStandardBrowserEnv()?function(){function e(e){var t=e;return n&&(o.setAttribute("href",t),t=o.href),o.setAttribute("href",t),{href:o.href,protocol:o.protocol?o.protocol.replace(/:$/,""):"",host:o.host,search:o.search?o.search.replace(/^\?/,""):"",hash:o.hash?o.hash.replace(/^#/,""):"",hostname:o.hostname,port:o.port,pathname:"/"===o.pathname.charAt(0)?o.pathname:"/"+o.pathname}}var t,n=/(msie|trident)/i.test(navigator.userAgent),o=document.createElement("a");return t=e(window.location.href),function(n){var o=r.isString(n)?e(n):n;return o.protocol===t.protocol&&o.host===t.host}}():function(){return function(){return!0}}()},function(e,t,n){"use strict";var r=n(8);e.exports=function(e,t){r.forEach(e,function(n,r){r!==t&&r.toUpperCase()===t.toUpperCase()&&(e[t]=n,delete e[r])})}},function(e,t,n){"use strict";var r=n(8);e.exports=function(e){var t,n,o,i={};return e?(r.forEach(e.split("\n"),function(e){o=e.indexOf(":"),t=r.trim(e.substr(0,o)).toLowerCase(),n=r.trim(e.substr(o+1)),t&&(i[t]=i[t]?i[t]+", "+n:n)}),i):i}},function(e,t,n){"use strict";e.exports=function(e){return function(t){return e.apply(null,t)}}},function(e,t,n){"use strict";function r(e){return e.replace(o,function(e,t){return t.toUpperCase()})}var o=/-(.)/g;e.exports=r},function(e,t,n){"use strict";function r(e){return o(e.replace(i,"ms-"))}var o=n(150),i=/^-ms-/;e.exports=r},function(e,t,n){"use strict";function r(e,t){return!(!e||!t)&&(e===t||!o(e)&&(o(t)?r(e,t.parentNode):"contains"in e?e.contains(t):!!e.compareDocumentPosition&&!!(16&e.compareDocumentPosition(t))))}var o=n(160);e.exports=r},function(e,t,n){"use strict";function r(e){var t=e.length;if(Array.isArray(e)||"object"!=typeof e&&"function"!=typeof e?a(!1):void 0,"number"!=typeof t?a(!1):void 0,0===t||t-1 in e?void 0:a(!1),"function"==typeof e.callee?a(!1):void 0,e.hasOwnProperty)try{return Array.prototype.slice.call(e)}catch(e){}for(var n=Array(t),r=0;r":a.innerHTML="<"+e+">",u[e]=!a.firstChild),u[e]?f[e]:null}var o=n(7),i=n(0),a=o.canUseDOM?document.createElement("div"):null,u={},s=[1,'"],c=[1,"","
"],l=[3,"","
"],p=[1,'',""],f={"*":[1,"?
","
"],area:[1,"",""],col:[2,"","
"],legend:[1,"
","
"],param:[1,"",""],tr:[2,"","
"],optgroup:s,option:s,caption:c,colgroup:c,tbody:c,tfoot:c,thead:c,td:l,th:l},d=["circle","clipPath","defs","ellipse","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","text","tspan"];d.forEach(function(e){f[e]=p,u[e]=!0}),e.exports=r},function(e,t,n){"use strict";function r(e){return e===window?{x:window.pageXOffset||document.documentElement.scrollLeft,y:window.pageYOffset||document.documentElement.scrollTop}:{x:e.scrollLeft,y:e.scrollTop}}e.exports=r},function(e,t,n){"use strict";function r(e){return e.replace(o,"-$1").toLowerCase()}var o=/([A-Z])/g;e.exports=r},function(e,t,n){"use strict";function r(e){return o(e).replace(i,"-ms-")}var o=n(157),i=/^ms-/;e.exports=r},function(e,t,n){"use strict";function r(e){return!(!e||!("function"==typeof Node?e instanceof Node:"object"==typeof e&&"number"==typeof e.nodeType&&"string"==typeof e.nodeName))}e.exports=r},function(e,t,n){"use strict";function r(e){return o(e)&&3==e.nodeType}var o=n(159);e.exports=r},function(e,t,n){"use strict";function r(e){var t={};return function(n){return t.hasOwnProperty(n)||(t[n]=e.call(this,n)),t[n]}}e.exports=r},function(e,t,n){"use strict";t.__esModule=!0;t.loopAsync=function(e,t,n){var r=0,o=!1,i=!1,a=!1,u=void 0,s=function(){for(var e=arguments.length,t=Array(e),r=0;r=e&&a&&(o=!0,n()))}};c()}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0,t.replaceLocation=t.pushLocation=t.startListener=t.getCurrentLocation=t.go=t.getUserConfirmation=void 0;var o=n(44);Object.defineProperty(t,"getUserConfirmation",{enumerable:!0,get:function(){return o.getUserConfirmation}}),Object.defineProperty(t,"go",{enumerable:!0,get:function(){return o.go}});var i=n(16),a=(r(i),n(18)),u=n(36),s=n(82),c=n(14),l="hashchange",p=function(){var e=window.location.href,t=e.indexOf("#");return t===-1?"":e.substring(t+1)},f=function(e){return window.location.hash=e},d=function(e){var t=window.location.href.indexOf("#");window.location.replace(window.location.href.slice(0,t>=0?t:0)+"#"+e)},h=t.getCurrentLocation=function(e,t){var n=e.decodePath(p()),r=(0,c.getQueryStringValueFromPath)(n,t),o=void 0;r&&(n=(0,c.stripQueryStringValueFromPath)(n,t),o=(0,s.readState)(r));var i=(0,c.parsePath)(n);return i.state=o,(0,a.createLocation)(i,void 0,r)},v=void 0,m=(t.startListener=function(e,t,n){var r=function(){var r=p(),o=t.encodePath(r);if(r!==o)d(o);else{var i=h(t,n);if(v&&i.key&&v.key===i.key)return;v=i,e(i)}},o=p(),i=t.encodePath(o);return o!==i&&d(i),(0,u.addEventListener)(window,l,r),function(){return(0,u.removeEventListener)(window,l,r)}},function(e,t,n,r){var o=e.state,i=e.key,a=t.encodePath((0,c.createPath)(e));void 0!==o&&(a=(0,c.addQueryStringValueToPath)(a,n,i),(0,s.saveState)(i,o)),v=e,r(a)});t.pushLocation=function(e,t,n){return m(e,t,n,function(e){p()!==e&&f(e)})},t.replaceLocation=function(e,t,n){return m(e,t,n,function(e){p()!==e&&d(e)})}},function(e,t,n){"use strict";t.__esModule=!0,t.replaceLocation=t.pushLocation=t.getCurrentLocation=t.go=t.getUserConfirmation=void 0;var r=n(44);Object.defineProperty(t,"getUserConfirmation",{enumerable:!0,get:function(){return r.getUserConfirmation}}),Object.defineProperty(t,"go",{enumerable:!0,get:function(){return r.go}});var o=n(18),i=n(14);t.getCurrentLocation=function(){return(0,o.createLocation)(window.location)},t.pushLocation=function(e){return window.location.href=(0,i.createPath)(e),!1},t.replaceLocation=function(e){return window.location.replace((0,i.createPath)(e)),!1}},function(e,t,n){"use strict";function r(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}function o(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var i=Object.assign||function(e){for(var t=1;t=0&&t=0&&m8&&C<=11),x=32,P=String.fromCharCode(x),O={beforeInput:{phasedRegistrationNames:{bubbled:"onBeforeInput",captured:"onBeforeInputCapture"},dependencies:["topCompositionEnd","topKeyPress","topTextInput","topPaste"]},compositionEnd:{phasedRegistrationNames:{bubbled:"onCompositionEnd",captured:"onCompositionEndCapture"},dependencies:["topBlur","topCompositionEnd","topKeyDown","topKeyPress","topKeyUp","topMouseDown"]},compositionStart:{phasedRegistrationNames:{bubbled:"onCompositionStart",captured:"onCompositionStartCapture"},dependencies:["topBlur","topCompositionStart","topKeyDown","topKeyPress","topKeyUp","topMouseDown"]},compositionUpdate:{phasedRegistrationNames:{bubbled:"onCompositionUpdate",captured:"onCompositionUpdateCapture"},dependencies:["topBlur","topCompositionUpdate","topKeyDown","topKeyPress","topKeyUp","topMouseDown"]}},T=!1,S=null,k={eventTypes:O,extractEvents:function(e,t,n,r){return[c(e,t,n,r),f(e,t,n,r)]}};e.exports=k},function(e,t,n){"use strict";var r=n(87),o=n(7),i=(n(10),n(151),n(233)),a=n(158),u=n(161),s=(n(1),u(function(e){return a(e)})),c=!1,l="cssFloat";if(o.canUseDOM){var p=document.createElement("div").style;try{p.font=""}catch(e){c=!0}void 0===document.documentElement.style.cssFloat&&(l="styleFloat")}var f={createMarkupForStyles:function(e,t){var n="";for(var r in e)if(e.hasOwnProperty(r)){var o=e[r];null!=o&&(n+=s(r)+":",n+=i(r,o,t)+";")}return n||null},setValueForStyles:function(e,t,n){var o=e.style;for(var a in t)if(t.hasOwnProperty(a)){var u=i(a,t[a],n);if("float"!==a&&"cssFloat"!==a||(a=l),u)o[a]=u;else{var s=c&&r.shorthandPropertyExpansions[a];if(s)for(var p in s)o[p]="";else o[a]=""}}}};e.exports=f},function(e,t,n){"use strict";function r(e){var t=e.nodeName&&e.nodeName.toLowerCase();return"select"===t||"input"===t&&"file"===e.type}function o(e){var t=E.getPooled(T.change,k,e,x(e));b.accumulateTwoPhaseDispatches(t),w.batchedUpdates(i,t)}function i(e){g.enqueueEvents(e),g.processEventQueue(!1)}function a(e,t){S=e,k=t,S.attachEvent("onchange",o)}function u(){S&&(S.detachEvent("onchange",o),S=null,k=null)}function s(e,t){if("topChange"===e)return t}function c(e,t,n){"topFocus"===e?(u(),a(t,n)):"topBlur"===e&&u()}function l(e,t){S=e,k=t,A=e.value,R=Object.getOwnPropertyDescriptor(e.constructor.prototype,"value"),Object.defineProperty(S,"value",I),S.attachEvent?S.attachEvent("onpropertychange",f):S.addEventListener("propertychange",f,!1)}function p(){S&&(delete S.value,S.detachEvent?S.detachEvent("onpropertychange",f):S.removeEventListener("propertychange",f,!1),S=null,k=null,A=null,R=null)}function f(e){if("value"===e.propertyName){var t=e.srcElement.value;t!==A&&(A=t,o(e))}}function d(e,t){if("topInput"===e)return t}function h(e,t,n){"topFocus"===e?(p(),l(t,n)):"topBlur"===e&&p()}function v(e,t){if(("topSelectionChange"===e||"topKeyUp"===e||"topKeyDown"===e)&&S&&S.value!==A)return A=S.value,k}function m(e){return e.nodeName&&"input"===e.nodeName.toLowerCase()&&("checkbox"===e.type||"radio"===e.type)}function y(e,t){if("topClick"===e)return t}var g=n(28),b=n(29),_=n(7),C=n(5),w=n(11),E=n(12),x=n(62),P=n(63),O=n(104),T={change:{phasedRegistrationNames:{bubbled:"onChange",captured:"onChangeCapture"},dependencies:["topBlur","topChange","topClick","topFocus","topInput","topKeyDown","topKeyUp","topSelectionChange"]}},S=null,k=null,A=null,R=null,N=!1;_.canUseDOM&&(N=P("change")&&(!document.documentMode||document.documentMode>8));var M=!1;_.canUseDOM&&(M=P("input")&&(!document.documentMode||document.documentMode>11));var I={get:function(){return R.get.call(this)},set:function(e){A=""+e,R.set.call(this,e)}},D={eventTypes:T,extractEvents:function(e,t,n,o){var i,a,u=t?C.getNodeFromInstance(t):window;if(r(u)?N?i=s:a=c:O(u)?M?i=d:(i=v,a=h):m(u)&&(i=y),i){var l=i(e,t);if(l){var p=E.getPooled(T.change,l,n,o);return p.type="change",b.accumulateTwoPhaseDispatches(p),p}}a&&a(e,u,t)}};e.exports=D},function(e,t,n){"use strict";var r=n(2),o=n(19),i=n(7),a=n(154),u=n(9),s=(n(0),{dangerouslyReplaceNodeWithMarkup:function(e,t){if(i.canUseDOM?void 0:r("56"),t?void 0:r("57"),"HTML"===e.nodeName?r("58"):void 0,"string"==typeof t){var n=a(t,u)[0];e.parentNode.replaceChild(n,e)}else o.replaceChildWithTree(e,t)}});e.exports=s},function(e,t,n){"use strict";var r=["ResponderEventPlugin","SimpleEventPlugin","TapEventPlugin","EnterLeaveEventPlugin","ChangeEventPlugin","SelectEventPlugin","BeforeInputEventPlugin"];e.exports=r},function(e,t,n){"use strict";var r=n(29),o=n(5),i=n(38),a={mouseEnter:{registrationName:"onMouseEnter",dependencies:["topMouseOut","topMouseOver"]},mouseLeave:{registrationName:"onMouseLeave",dependencies:["topMouseOut","topMouseOver"]}},u={eventTypes:a,extractEvents:function(e,t,n,u){if("topMouseOver"===e&&(n.relatedTarget||n.fromElement))return null;if("topMouseOut"!==e&&"topMouseOver"!==e)return null;var s;if(u.window===u)s=u;else{var c=u.ownerDocument;s=c?c.defaultView||c.parentWindow:window}var l,p;if("topMouseOut"===e){l=t;var f=n.relatedTarget||n.toElement;p=f?o.getClosestInstanceFromNode(f):null}else l=null,p=t;if(l===p)return null;var d=null==l?s:o.getNodeFromInstance(l),h=null==p?s:o.getNodeFromInstance(p),v=i.getPooled(a.mouseLeave,l,n,u);v.type="mouseleave",v.target=d,v.relatedTarget=h;var m=i.getPooled(a.mouseEnter,p,n,u);return m.type="mouseenter",m.target=h,m.relatedTarget=d,r.accumulateEnterLeaveDispatches(v,m,l,p),[v,m]}};e.exports=u},function(e,t,n){"use strict";function r(e){this._root=e,this._startText=this.getText(),this._fallbackText=null}var o=n(4),i=n(17),a=n(102);o(r.prototype,{destructor:function(){this._root=null,this._startText=null,this._fallbackText=null},getText:function(){return"value"in this._root?this._root.value:this._root[a()]},getData:function(){if(this._fallbackText)return this._fallbackText;var e,t,n=this._startText,r=n.length,o=this.getText(),i=o.length;for(e=0;e1?1-t:void 0;return this._fallbackText=o.slice(e,u),this._fallbackText}}),i.addPoolingTo(r),e.exports=r},function(e,t,n){"use strict";var r=n(20),o=r.injection.MUST_USE_PROPERTY,i=r.injection.HAS_BOOLEAN_VALUE,a=r.injection.HAS_NUMERIC_VALUE,u=r.injection.HAS_POSITIVE_NUMERIC_VALUE,s=r.injection.HAS_OVERLOADED_BOOLEAN_VALUE,c={isCustomAttribute:RegExp.prototype.test.bind(new RegExp("^(data|aria)-["+r.ATTRIBUTE_NAME_CHAR+"]*$")),Properties:{accept:0,acceptCharset:0,accessKey:0,action:0,allowFullScreen:i,allowTransparency:0,alt:0,as:0,async:i,autoComplete:0,autoPlay:i,capture:i,cellPadding:0,cellSpacing:0,charSet:0,challenge:0,checked:o|i,cite:0,classID:0,className:0,cols:u,colSpan:0,content:0,contentEditable:0,contextMenu:0,controls:i,coords:0,crossOrigin:0,data:0,dateTime:0,default:i,defer:i,dir:0,disabled:i,download:s,draggable:0,encType:0,form:0,formAction:0,formEncType:0,formMethod:0,formNoValidate:i,formTarget:0,frameBorder:0,headers:0,height:0,hidden:i,high:0,href:0,hrefLang:0,htmlFor:0,httpEquiv:0,icon:0,id:0,inputMode:0,integrity:0,is:0,keyParams:0,keyType:0,kind:0,label:0,lang:0,list:0,loop:i,low:0,manifest:0,marginHeight:0,marginWidth:0,max:0,maxLength:0,media:0,mediaGroup:0,method:0,min:0,minLength:0,multiple:o|i,muted:o|i,name:0,nonce:0,noValidate:i,open:i,optimum:0,pattern:0,placeholder:0,playsInline:i,poster:0,preload:0,profile:0,radioGroup:0,readOnly:i,referrerPolicy:0,rel:0,required:i,reversed:i,role:0,rows:u,rowSpan:a,sandbox:0,scope:0,scoped:i,scrolling:0,seamless:i,selected:o|i,shape:0,size:u,sizes:0,span:u,spellCheck:0,src:0,srcDoc:0,srcLang:0,srcSet:0,start:a,step:0,style:0,summary:0,tabIndex:0,target:0,title:0,type:0,useMap:0,value:0,width:0,wmode:0,wrap:0,about:0,datatype:0,inlist:0,prefix:0,property:0,resource:0,typeof:0,vocab:0,autoCapitalize:0,autoCorrect:0,autoSave:0,color:0,itemProp:0,itemScope:i,itemType:0,itemID:0,itemRef:0,results:0,security:0,unselectable:0},DOMAttributeNames:{acceptCharset:"accept-charset",className:"class",htmlFor:"for",httpEquiv:"http-equiv"},DOMPropertyNames:{}};e.exports=c},function(e,t,n){"use strict";(function(t){function r(e,t,n,r){var o=void 0===e[n];null!=t&&o&&(e[n]=i(t,!0))}var o=n(21),i=n(103),a=(n(54),n(64)),u=n(106);n(1);"undefined"!=typeof t&&t.env,1;var s={instantiateChildren:function(e,t,n,o){if(null==e)return null;var i={};return u(e,r,i),i},updateChildren:function(e,t,n,r,u,s,c,l,p){if(t||e){var f,d;for(f in t)if(t.hasOwnProperty(f)){d=e&&e[f];var h=d&&d._currentElement,v=t[f];if(null!=d&&a(h,v))o.receiveComponent(d,v,u,l),t[f]=d;else{d&&(r[f]=o.getHostNode(d),o.unmountComponent(d,!1));var m=i(v,!0);t[f]=m;var y=o.mountComponent(m,u,s,c,l,p);n.push(y)}}for(f in e)!e.hasOwnProperty(f)||t&&t.hasOwnProperty(f)||(d=e[f],r[f]=o.getHostNode(d),o.unmountComponent(d,!1))}},unmountChildren:function(e,t){for(var n in e)if(e.hasOwnProperty(n)){var r=e[n];o.unmountComponent(r,t)}}};e.exports=s}).call(t,n(49))},function(e,t,n){"use strict";var r=n(50),o=n(197),i={processChildrenUpdates:o.dangerouslyProcessChildrenUpdates,replaceNodeWithMarkup:r.dangerouslyReplaceNodeWithMarkup};e.exports=i},function(e,t,n){"use strict";function r(e){}function o(e,t){}function i(e){return!(!e.prototype||!e.prototype.isReactComponent)}function a(e){return!(!e.prototype||!e.prototype.isPureReactComponent)}var u=n(2),s=n(4),c=n(24),l=n(56),p=n(13),f=n(57),d=n(30),h=(n(10),n(97)),v=n(21),m=n(27),y=(n(0),n(43)),g=n(64),b=(n(1),{ImpureClass:0,PureClass:1,StatelessFunctional:2});r.prototype.render=function(){var e=d.get(this)._currentElement.type,t=e(this.props,this.context,this.updater);return o(e,t),t};var _=1,C={construct:function(e){this._currentElement=e,this._rootNodeID=0,this._compositeType=null,this._instance=null,this._hostParent=null,this._hostContainerInfo=null,this._updateBatchNumber=null,this._pendingElement=null,this._pendingStateQueue=null,this._pendingReplaceState=!1,this._pendingForceUpdate=!1,this._renderedNodeType=null,this._renderedComponent=null,this._context=null,this._mountOrder=0,this._topLevelWrapper=null,this._pendingCallbacks=null,this._calledComponentWillUnmount=!1},mountComponent:function(e,t,n,s){this._context=s,this._mountOrder=_++,this._hostParent=t,this._hostContainerInfo=n;var l,p=this._currentElement.props,f=this._processContext(s),h=this._currentElement.type,v=e.getUpdateQueue(),y=i(h),g=this._constructComponent(y,p,f,v);y||null!=g&&null!=g.render?a(h)?this._compositeType=b.PureClass:this._compositeType=b.ImpureClass:(l=g,o(h,l),null===g||g===!1||c.isValidElement(g)?void 0:u("105",h.displayName||h.name||"Component"),g=new r(h),this._compositeType=b.StatelessFunctional);g.props=p,g.context=f,g.refs=m,g.updater=v,this._instance=g,d.set(g,this);var C=g.state;void 0===C&&(g.state=C=null),"object"!=typeof C||Array.isArray(C)?u("106",this.getName()||"ReactCompositeComponent"):void 0,this._pendingStateQueue=null,this._pendingReplaceState=!1,this._pendingForceUpdate=!1;var w;return w=g.unstable_handleError?this.performInitialMountWithErrorHandling(l,t,n,e,s):this.performInitialMount(l,t,n,e,s),g.componentDidMount&&e.getReactMountReady().enqueue(g.componentDidMount,g),w},_constructComponent:function(e,t,n,r){return this._constructComponentWithoutOwner(e,t,n,r)},_constructComponentWithoutOwner:function(e,t,n,r){var o=this._currentElement.type;return e?new o(t,n,r):o(t,n,r)},performInitialMountWithErrorHandling:function(e,t,n,r,o){var i,a=r.checkpoint();try{i=this.performInitialMount(e,t,n,r,o)}catch(u){r.rollback(a),this._instance.unstable_handleError(u),this._pendingStateQueue&&(this._instance.state=this._processPendingState(this._instance.props,this._instance.context)),a=r.checkpoint(),this._renderedComponent.unmountComponent(!0),r.rollback(a),i=this.performInitialMount(e,t,n,r,o)}return i},performInitialMount:function(e,t,n,r,o){var i=this._instance,a=0;i.componentWillMount&&(i.componentWillMount(),this._pendingStateQueue&&(i.state=this._processPendingState(i.props,i.context))),void 0===e&&(e=this._renderValidatedComponent());var u=h.getType(e);this._renderedNodeType=u;var s=this._instantiateReactComponent(e,u!==h.EMPTY);this._renderedComponent=s;var c=v.mountComponent(s,r,t,n,this._processChildContext(o),a);return c},getHostNode:function(){return v.getHostNode(this._renderedComponent)},unmountComponent:function(e){if(this._renderedComponent){var t=this._instance;if(t.componentWillUnmount&&!t._calledComponentWillUnmount)if(t._calledComponentWillUnmount=!0,e){var n=this.getName()+".componentWillUnmount()";f.invokeGuardedCallback(n,t.componentWillUnmount.bind(t))}else t.componentWillUnmount();this._renderedComponent&&(v.unmountComponent(this._renderedComponent,e),this._renderedNodeType=null,this._renderedComponent=null,this._instance=null),this._pendingStateQueue=null,this._pendingReplaceState=!1,this._pendingForceUpdate=!1,this._pendingCallbacks=null,this._pendingElement=null,this._context=null,this._rootNodeID=0,this._topLevelWrapper=null,d.remove(t)}},_maskContext:function(e){var t=this._currentElement.type,n=t.contextTypes;if(!n)return m;var r={};for(var o in n)r[o]=e[o];return r},_processContext:function(e){var t=this._maskContext(e);return t},_processChildContext:function(e){var t,n=this._currentElement.type,r=this._instance;if(r.getChildContext&&(t=r.getChildContext()),t){"object"!=typeof n.childContextTypes?u("107",this.getName()||"ReactCompositeComponent"):void 0;for(var o in t)o in n.childContextTypes?void 0:u("108",this.getName()||"ReactCompositeComponent",o);return s({},e,t)}return e},_checkContextTypes:function(e,t,n){},receiveComponent:function(e,t,n){var r=this._currentElement,o=this._context;this._pendingElement=null,this.updateComponent(t,r,e,o,n)},performUpdateIfNecessary:function(e){null!=this._pendingElement?v.receiveComponent(this,this._pendingElement,e,this._context):null!==this._pendingStateQueue||this._pendingForceUpdate?this.updateComponent(e,this._currentElement,this._currentElement,this._context,this._context):this._updateBatchNumber=null},updateComponent:function(e,t,n,r,o){var i=this._instance;null==i?u("136",this.getName()||"ReactCompositeComponent"):void 0;var a,s=!1;this._context===o?a=i.context:(a=this._processContext(o),s=!0);var c=t.props,l=n.props;t!==n&&(s=!0),s&&i.componentWillReceiveProps&&i.componentWillReceiveProps(l,a);var p=this._processPendingState(l,a),f=!0;this._pendingForceUpdate||(i.shouldComponentUpdate?f=i.shouldComponentUpdate(l,p,a):this._compositeType===b.PureClass&&(f=!y(c,l)||!y(i.state,p))),this._updateBatchNumber=null,f?(this._pendingForceUpdate=!1,this._performComponentUpdate(n,l,p,a,e,o)):(this._currentElement=n,this._context=o,i.props=l,i.state=p,i.context=a)},_processPendingState:function(e,t){var n=this._instance,r=this._pendingStateQueue,o=this._pendingReplaceState;if(this._pendingReplaceState=!1,this._pendingStateQueue=null,!r)return n.state;if(o&&1===r.length)return r[0];for(var i=s({},o?r[0]:n.state),a=o?1:0;a=0||null!=t.is}function h(e){var t=e.type;f(t),this._currentElement=e,this._tag=t.toLowerCase(),this._namespaceURI=null,this._renderedChildren=null,this._previousStyle=null,this._previousStyleCopy=null,this._hostNode=null,this._hostParent=null,this._rootNodeID=0,this._domID=0,this._hostContainerInfo=null,this._wrapperState=null,this._topLevelWrapper=null,this._flags=0}var v=n(2),m=n(4),y=n(180),g=n(182),b=n(19),_=n(51),C=n(20),w=n(89),E=n(28),x=n(52),P=n(37),O=n(90),T=n(5),S=n(198),k=n(199),A=n(91),R=n(202),N=(n(10),n(211)),M=n(216),I=(n(9),n(40)),D=(n(0),n(63),n(43),n(65),n(1),O),j=E.deleteListener,L=T.getNodeFromInstance,U=P.listenTo,F=x.registrationNameModules,B={string:!0,number:!0},q="style",V="__html",H={children:null,dangerouslySetInnerHTML:null,suppressContentEditableWarning:null},W=11,K={topAbort:"abort",topCanPlay:"canplay",topCanPlayThrough:"canplaythrough",topDurationChange:"durationchange",topEmptied:"emptied",topEncrypted:"encrypted",topEnded:"ended",topError:"error",topLoadedData:"loadeddata",topLoadedMetadata:"loadedmetadata",topLoadStart:"loadstart",topPause:"pause",topPlay:"play",topPlaying:"playing",topProgress:"progress",topRateChange:"ratechange",topSeeked:"seeked",topSeeking:"seeking",topStalled:"stalled",topSuspend:"suspend",topTimeUpdate:"timeupdate",topVolumeChange:"volumechange",topWaiting:"waiting"},Y={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},z={listing:!0,pre:!0,textarea:!0},Q=m({menuitem:!0},Y),X=/^[a-zA-Z][a-zA-Z:_\.\-\d]*$/,G={},$={}.hasOwnProperty,Z=1;h.displayName="ReactDOMComponent",h.Mixin={mountComponent:function(e,t,n,r){this._rootNodeID=Z++,this._domID=n._idCounter++,this._hostParent=t,this._hostContainerInfo=n;var i=this._currentElement.props;switch(this._tag){case"audio":case"form":case"iframe":case"img":case"link":case"object":case"source":case"video":this._wrapperState={listeners:null},e.getReactMountReady().enqueue(l,this);break;case"input":S.mountWrapper(this,i,t),i=S.getHostProps(this,i),e.getReactMountReady().enqueue(l,this);break;case"option":k.mountWrapper(this,i,t),i=k.getHostProps(this,i);break;case"select":A.mountWrapper(this,i,t),i=A.getHostProps(this,i),e.getReactMountReady().enqueue(l,this);break;case"textarea":R.mountWrapper(this,i,t),i=R.getHostProps(this,i),e.getReactMountReady().enqueue(l,this)}o(this,i);var a,p;null!=t?(a=t._namespaceURI,p=t._tag):n._tag&&(a=n._namespaceURI,p=n._tag),(null==a||a===_.svg&&"foreignobject"===p)&&(a=_.html),a===_.html&&("svg"===this._tag?a=_.svg:"math"===this._tag&&(a=_.mathml)),this._namespaceURI=a;var f;if(e.useCreateElement){var d,h=n._ownerDocument;if(a===_.html)if("script"===this._tag){var v=h.createElement("div"),m=this._currentElement.type;v.innerHTML="<"+m+">",d=v.removeChild(v.firstChild)}else d=i.is?h.createElement(this._currentElement.type,i.is):h.createElement(this._currentElement.type);else d=h.createElementNS(a,this._currentElement.type);T.precacheNode(this,d),this._flags|=D.hasCachedChildNodes,this._hostParent||w.setAttributeForRoot(d),this._updateDOMProperties(null,i,e);var g=b(d);this._createInitialChildren(e,i,r,g),f=g}else{var C=this._createOpenTagMarkupAndPutListeners(e,i),E=this._createContentMarkup(e,i,r);f=!E&&Y[this._tag]?C+"/>":C+">"+E+""}switch(this._tag){case"input":e.getReactMountReady().enqueue(u,this),i.autoFocus&&e.getReactMountReady().enqueue(y.focusDOMComponent,this);break;case"textarea":e.getReactMountReady().enqueue(s,this),i.autoFocus&&e.getReactMountReady().enqueue(y.focusDOMComponent,this);break;case"select":i.autoFocus&&e.getReactMountReady().enqueue(y.focusDOMComponent,this);break;case"button":i.autoFocus&&e.getReactMountReady().enqueue(y.focusDOMComponent,this);break;case"option":e.getReactMountReady().enqueue(c,this)}return f},_createOpenTagMarkupAndPutListeners:function(e,t){var n="<"+this._currentElement.type;for(var r in t)if(t.hasOwnProperty(r)){var o=t[r];if(null!=o)if(F.hasOwnProperty(r))o&&i(this,r,o,e);else{r===q&&(o&&(o=this._previousStyleCopy=m({},t.style)),o=g.createMarkupForStyles(o,this));var a=null;null!=this._tag&&d(this._tag,t)?H.hasOwnProperty(r)||(a=w.createMarkupForCustomAttribute(r,o)):a=w.createMarkupForProperty(r,o),a&&(n+=" "+a)}}return e.renderToStaticMarkup?n:(this._hostParent||(n+=" "+w.createMarkupForRoot()),n+=" "+w.createMarkupForID(this._domID))},_createContentMarkup:function(e,t,n){var r="",o=t.dangerouslySetInnerHTML;if(null!=o)null!=o.__html&&(r=o.__html);else{var i=B[typeof t.children]?t.children:null,a=null!=i?null:t.children;if(null!=i)r=I(i);else if(null!=a){var u=this.mountChildren(a,e,n);r=u.join("")}}return z[this._tag]&&"\n"===r.charAt(0)?"\n"+r:r},_createInitialChildren:function(e,t,n,r){var o=t.dangerouslySetInnerHTML;if(null!=o)null!=o.__html&&b.queueHTML(r,o.__html);else{var i=B[typeof t.children]?t.children:null,a=null!=i?null:t.children;if(null!=i)""!==i&&b.queueText(r,i);else if(null!=a)for(var u=this.mountChildren(a,e,n),s=0;s"},receiveComponent:function(){},getHostNode:function(){return i.getNodeFromInstance(this)},unmountComponent:function(){i.uncacheNode(this)}}),e.exports=a},function(e,t,n){"use strict";var r={useCreateElement:!0,useFiber:!1};e.exports=r},function(e,t,n){"use strict";var r=n(50),o=n(5),i={dangerouslyProcessChildrenUpdates:function(e,t){var n=o.getNodeFromInstance(e);r.processUpdates(n,t)}};e.exports=i},function(e,t,n){"use strict";function r(){this._rootNodeID&&p.updateWrapper(this)}function o(e){var t=this._currentElement.props,n=s.executeOnChange(t,e);l.asap(r,this);var o=t.name;if("radio"===t.type&&null!=o){for(var a=c.getNodeFromInstance(this),u=a;u.parentNode;)u=u.parentNode;for(var p=u.querySelectorAll("input[name="+JSON.stringify(""+o)+'][type="radio"]'),f=0;ft.end?(n=t.end,r=t.start):(n=t.start,r=t.end),o.moveToElementText(e),o.moveStart("character",n),o.setEndPoint("EndToStart",o),o.moveEnd("character",r-n),o.select()}function u(e,t){if(window.getSelection){var n=window.getSelection(),r=e[l()].length,o=Math.min(t.start,r),i=void 0===t.end?o:Math.min(t.end,r);if(!n.extend&&o>i){var a=i;i=o,o=a}var u=c(e,o),s=c(e,i);if(u&&s){var p=document.createRange();p.setStart(u.node,u.offset),n.removeAllRanges(),o>i?(n.addRange(p),n.extend(s.node,s.offset)):(p.setEnd(s.node,s.offset),n.addRange(p))}}}var s=n(7),c=n(239),l=n(102),p=s.canUseDOM&&"selection"in document&&!("getSelection"in window),f={getOffsets:p?o:i,setOffsets:p?a:u};e.exports=f},function(e,t,n){"use strict";var r=n(2),o=n(4),i=n(50),a=n(19),u=n(5),s=n(40),c=(n(0),n(65),function(e){this._currentElement=e,this._stringText=""+e,this._hostNode=null,this._hostParent=null,this._domID=0,this._mountIndex=0,this._closingComment=null,this._commentNodes=null});o(c.prototype,{mountComponent:function(e,t,n,r){var o=n._idCounter++,i=" react-text: "+o+" ",c=" /react-text ";if(this._domID=o,this._hostParent=t,e.useCreateElement){var l=n._ownerDocument,p=l.createComment(i),f=l.createComment(c),d=a(l.createDocumentFragment());return a.queueChild(d,a(p)),this._stringText&&a.queueChild(d,a(l.createTextNode(this._stringText))),a.queueChild(d,a(f)),u.precacheNode(this,p),this._closingComment=f,d}var h=s(this._stringText);return e.renderToStaticMarkup?h:""+h+""},receiveComponent:function(e,t){if(e!==this._currentElement){this._currentElement=e;var n=""+e;if(n!==this._stringText){this._stringText=n;var r=this.getHostNode();i.replaceDelimitedText(r[0],r[1],n)}}},getHostNode:function(){var e=this._commentNodes;if(e)return e;if(!this._closingComment)for(var t=u.getNodeFromInstance(this),n=t.nextSibling;;){if(null==n?r("67",this._domID):void 0,8===n.nodeType&&" /react-text "===n.nodeValue){this._closingComment=n;break}n=n.nextSibling}return e=[this._hostNode,this._closingComment],this._commentNodes=e,e},unmountComponent:function(){this._closingComment=null,this._commentNodes=null,u.uncacheNode(this)}}),e.exports=c},function(e,t,n){"use strict";function r(){this._rootNodeID&&l.updateWrapper(this)}function o(e){var t=this._currentElement.props,n=u.executeOnChange(t,e);return c.asap(r,this),n}var i=n(2),a=n(4),u=n(55),s=n(5),c=n(11),l=(n(0),n(1),{getHostProps:function(e,t){null!=t.dangerouslySetInnerHTML?i("91"):void 0;var n=a({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue,onChange:e._wrapperState.onChange});return n},mountWrapper:function(e,t){var n=u.getValue(t),r=n;if(null==n){var a=t.defaultValue,s=t.children;null!=s&&(null!=a?i("92"):void 0,Array.isArray(s)&&(s.length<=1?void 0:i("93"),s=s[0]),a=""+s),null==a&&(a=""),r=a}e._wrapperState={initialValue:""+r,listeners:null,onChange:o.bind(e)}},updateWrapper:function(e){var t=e._currentElement.props,n=s.getNodeFromInstance(e),r=u.getValue(t);if(null!=r){var o=""+r;o!==n.value&&(n.value=o),null==t.defaultValue&&(n.defaultValue=o)}null!=t.defaultValue&&(n.defaultValue=t.defaultValue)},postMountWrapper:function(e){var t=s.getNodeFromInstance(e),n=t.textContent;n===e._wrapperState.initialValue&&(t.value=n)}});e.exports=l},function(e,t,n){"use strict";function r(e,t){"_hostNode"in e?void 0:s("33"),"_hostNode"in t?void 0:s("33");for(var n=0,r=e;r;r=r._hostParent)n++;for(var o=0,i=t;i;i=i._hostParent)o++;for(;n-o>0;)e=e._hostParent,n--;for(;o-n>0;)t=t._hostParent,o--;for(var a=n;a--;){if(e===t)return e;e=e._hostParent,t=t._hostParent}return null}function o(e,t){"_hostNode"in e?void 0:s("35"),"_hostNode"in t?void 0:s("35");for(;t;){if(t===e)return!0;t=t._hostParent}return!1}function i(e){return"_hostNode"in e?void 0:s("36"),e._hostParent}function a(e,t,n){for(var r=[];e;)r.push(e),e=e._hostParent;var o;for(o=r.length;o-- >0;)t(r[o],"captured",n);for(o=0;o0;)n(s[c],"captured",i)}var s=n(2);n(0);e.exports={isAncestor:o,getLowestCommonAncestor:r,getParentInstance:i,traverseTwoPhase:a,traverseEnterLeave:u}},function(e,t,n){"use strict";function r(){this.reinitializeTransaction()}var o=n(4),i=n(11),a=n(39),u=n(9),s={initialize:u,close:function(){f.isBatchingUpdates=!1}},c={initialize:u,close:i.flushBatchedUpdates.bind(i)},l=[c,s];o(r.prototype,a,{getTransactionWrappers:function(){return l}});var p=new r,f={isBatchingUpdates:!1,batchedUpdates:function(e,t,n,r,o,i){var a=f.isBatchingUpdates;return f.isBatchingUpdates=!0,a?e(t,n,r,o,i):p.perform(e,null,t,n,r,o,i)}};e.exports=f},function(e,t,n){"use strict";function r(){E||(E=!0,g.EventEmitter.injectReactEventListener(y),g.EventPluginHub.injectEventPluginOrder(u),g.EventPluginUtils.injectComponentTree(f),g.EventPluginUtils.injectTreeTraversal(h),g.EventPluginHub.injectEventPluginsByName({SimpleEventPlugin:w,EnterLeaveEventPlugin:s,ChangeEventPlugin:a,SelectEventPlugin:C,BeforeInputEventPlugin:i}),g.HostComponent.injectGenericComponentClass(p),g.HostComponent.injectTextComponentClass(v),g.DOMProperty.injectDOMPropertyConfig(o),g.DOMProperty.injectDOMPropertyConfig(c),g.DOMProperty.injectDOMPropertyConfig(_),g.EmptyComponent.injectEmptyComponentFactory(function(e){return new d(e)}),g.Updates.injectReconcileTransaction(b),g.Updates.injectBatchingStrategy(m),g.Component.injectEnvironment(l))}var o=n(179),i=n(181),a=n(183),u=n(185),s=n(186),c=n(188),l=n(190),p=n(193),f=n(5),d=n(195),h=n(203),v=n(201),m=n(204),y=n(208),g=n(209),b=n(214),_=n(219),C=n(220),w=n(221),E=!1;e.exports={inject:r}},function(e,t,n){"use strict";var r="function"==typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103;e.exports=r},function(e,t,n){"use strict";function r(e){o.enqueueEvents(e),o.processEventQueue(!1)}var o=n(28),i={handleTopLevel:function(e,t,n,i){var a=o.extractEvents(e,t,n,i);r(a)}};e.exports=i},function(e,t,n){"use strict";function r(e){for(;e._hostParent;)e=e._hostParent;var t=p.getNodeFromInstance(e),n=t.parentNode;return p.getClosestInstanceFromNode(n)}function o(e,t){this.topLevelType=e,this.nativeEvent=t,this.ancestors=[]}function i(e){var t=d(e.nativeEvent),n=p.getClosestInstanceFromNode(t),o=n;do e.ancestors.push(o),o=o&&r(o);while(o);for(var i=0;i/,i=/^<\!\-\-/,a={CHECKSUM_ATTR_NAME:"data-react-checksum",addChecksumToMarkup:function(e){var t=r(e);return i.test(e)?e:e.replace(o," "+a.CHECKSUM_ATTR_NAME+'="'+t+'"$&')},canReuseMarkup:function(e,t){var n=t.getAttribute(a.CHECKSUM_ATTR_NAME);n=n&&parseInt(n,10);var o=r(e);return o===n}};e.exports=a},function(e,t,n){"use strict";function r(e,t,n){return{type:"INSERT_MARKUP",content:e,fromIndex:null,fromNode:null,toIndex:n,afterNode:t}}function o(e,t,n){return{type:"MOVE_EXISTING",content:null,fromIndex:e._mountIndex,fromNode:f.getHostNode(e),toIndex:n,afterNode:t}}function i(e,t){return{type:"REMOVE_NODE",content:null,fromIndex:e._mountIndex,fromNode:t,toIndex:null,afterNode:null}}function a(e){return{type:"SET_MARKUP",content:e,fromIndex:null,fromNode:null,toIndex:null,afterNode:null}}function u(e){return{type:"TEXT_CONTENT",content:e,fromIndex:null,fromNode:null,toIndex:null,afterNode:null}}function s(e,t){return t&&(e=e||[],e.push(t)),e}function c(e,t){p.processChildrenUpdates(e,t)}var l=n(2),p=n(56),f=(n(30),n(10),n(13),n(21)),d=n(189),h=(n(9),n(235)),v=(n(0),{Mixin:{_reconcilerInstantiateChildren:function(e,t,n){return d.instantiateChildren(e,t,n)},_reconcilerUpdateChildren:function(e,t,n,r,o,i){var a,u=0;return a=h(t,u),d.updateChildren(e,a,n,r,o,this,this._hostContainerInfo,i,u),a},mountChildren:function(e,t,n){var r=this._reconcilerInstantiateChildren(e,t,n);this._renderedChildren=r;var o=[],i=0;for(var a in r)if(r.hasOwnProperty(a)){var u=r[a],s=0,c=f.mountComponent(u,t,this,this._hostContainerInfo,n,s);u._mountIndex=i++,o.push(c)}return o},updateTextContent:function(e){var t=this._renderedChildren;d.unmountChildren(t,!1);for(var n in t)t.hasOwnProperty(n)&&l("118");var r=[u(e)];c(this,r)},updateMarkup:function(e){var t=this._renderedChildren;d.unmountChildren(t,!1);for(var n in t)t.hasOwnProperty(n)&&l("118");var r=[a(e)];c(this,r)},updateChildren:function(e,t,n){this._updateChildren(e,t,n)},_updateChildren:function(e,t,n){var r=this._renderedChildren,o={},i=[],a=this._reconcilerUpdateChildren(r,e,i,o,t,n);if(a||r){var u,l=null,p=0,d=0,h=0,v=null;for(u in a)if(a.hasOwnProperty(u)){var m=r&&r[u],y=a[u];m===y?(l=s(l,this.moveChild(m,v,p,d)),d=Math.max(m._mountIndex,d),m._mountIndex=p):(m&&(d=Math.max(m._mountIndex,d)),l=s(l,this._mountChildAtIndex(y,i[h],v,p,t,n)),h++),p++,v=f.getHostNode(y)}for(u in o)o.hasOwnProperty(u)&&(l=s(l,this._unmountChild(r[u],o[u])));l&&c(this,l),this._renderedChildren=a}},unmountChildren:function(e){var t=this._renderedChildren;d.unmountChildren(t,e),this._renderedChildren=null},moveChild:function(e,t,n,r){if(e._mountIndex=t)return{node:n,offset:t-i};i=a}n=r(o(n))}}e.exports=i},function(e,t,n){"use strict";function r(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n["ms"+e]="MS"+t,n["O"+e]="o"+t.toLowerCase(),n}function o(e){if(u[e])return u[e];if(!a[e])return e;var t=a[e];for(var n in t)if(t.hasOwnProperty(n)&&n in s)return u[e]=t[n];return""}var i=n(7),a={animationend:r("Animation","AnimationEnd"),animationiteration:r("Animation","AnimationIteration"),animationstart:r("Animation","AnimationStart"),transitionend:r("Transition","TransitionEnd")},u={},s={};i.canUseDOM&&(s=document.createElement("div").style,"AnimationEvent"in window||(delete a.animationend.animation,delete a.animationiteration.animation,delete a.animationstart.animation),"TransitionEvent"in window||delete a.transitionend.transition),e.exports=o},function(e,t,n){"use strict";function r(e){return'"'+o(e)+'"'}var o=n(40);e.exports=r},function(e,t,n){"use strict";var r=n(96);e.exports=r.renderSubtreeIntoContainer},function(e,t,n){try{(function(){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var r=n(3),o=e(r),i=n(33),a=n(246),u=e(a),s=n(248),c=e(s),l=n(249),p=e(l),f=n(245),d=e(f),h=o.default.createElement(i.Route,{path:"/",component:u.default},o.default.createElement(i.IndexRoute,{component:d.default}),o.default.createElement(i.Route,{path:"counter",component:c.default}),o.default.createElement(i.Route,{path:"todo",component:p.default}));t.default=h}).call(this)}finally{}},function(e,t,n){try{(function(){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:r,n=arguments[1];switch(n.type){case e.ADD_COUNT:return Object.assign({},t,{num:t.num+1});case e.ASYNC_REQUEST_ADD:return Object.assign({},t,{isFetching:!0});case e.ASYNC_RECEIVE_ADD:return Object.assign({},t,{data:n.data,isFetching:!1});default:return t}};t.default=o}).call(this)}finally{}},function(e,t,n){try{(function(){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var r=n(34),o=n(250),i=e(o),a=n(252),u=e(a),s=(0,r.combineReducers)({count:i.default,todo:u.default});t.default=s}).call(this)}finally{}},function(e,t,n){try{(function(){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var e=n(108),r=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments[1];switch(n.type){case e.ADD_TODO:return t.push(n.todo);default:return t}};t.default=r}).call(this)}finally{}},function(e,t,n){try{(function(){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var r=n(34),o=n(251),i=e(o),a=n(289),u=e(a),s=function(e){var t=(0,r.createStore)(i.default,e,(0,r.applyMiddleware)(u.default));return t};t.default=s}).call(this)}finally{}},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var a=n(3),u=(n.n(a),n(111)),s=n(112);n(67);n.d(t,"a",function(){return c});var c=function(e){function t(n,i){r(this,t);var a=o(this,e.call(this,n,i));return a.store=n.store,a}return i(t,e),t.prototype.getChildContext=function(){return{store:this.store,storeSubscription:null}},t.prototype.render=function(){return a.Children.only(this.props.children)},t}(a.Component);c.propTypes={store:s.a.isRequired,children:a.PropTypes.element.isRequired},c.childContextTypes={store:s.a.isRequired,storeSubscription:a.PropTypes.instanceOf(u.a)},c.displayName="Provider"},function(e,t,n){"use strict";function r(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}function o(e,t,n){for(var r=t.length-1;r>=0;r--){var o=t[r](e);if(o)return o}return function(t,r){throw new Error("Invalid value of type "+typeof e+" for "+n+" argument when connecting component "+r.wrappedComponentName+".")}}function i(e,t){return e===t}function a(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.connectHOC,n=void 0===t?u.a:t,a=e.mapStateToPropsFactories,h=void 0===a?l.a:a,v=e.mapDispatchToPropsFactories,m=void 0===v?c.a:v,y=e.mergePropsFactories,g=void 0===y?p.a:y,b=e.selectorFactory,_=void 0===b?f.a:b;return function(e,t,a){var u=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},c=u.pure,l=void 0===c||c,p=u.areStatesEqual,f=void 0===p?i:p,v=u.areOwnPropsEqual,y=void 0===v?s.a:v,b=u.areStatePropsEqual,C=void 0===b?s.a:b,w=u.areMergedPropsEqual,E=void 0===w?s.a:w,x=r(u,["pure","areStatesEqual","areOwnPropsEqual","areStatePropsEqual","areMergedPropsEqual"]),P=o(e,h,"mapStateToProps"),O=o(t,m,"mapDispatchToProps"),T=o(a,g,"mergeProps");return n(_,d({methodName:"connect",getDisplayName:function(e){return"Connect("+e+")"},shouldHandleStateChanges:Boolean(e),initMapStateToProps:P,initMapDispatchToProps:O,initMergeProps:T,pure:l,areStatesEqual:f,areOwnPropsEqual:y,areStatePropsEqual:C,areMergedPropsEqual:E},x))}}var u=n(109),s=n(261),c=n(256),l=n(257),p=n(258),f=n(259),d=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}function o(e,t,n,r){return function(o,i){return n(e(o,i),t(r,i),i)}}function i(e,t,n,r,o){function i(o,i){return h=o,v=i,m=e(h,v),y=t(r,v),g=n(m,y,v),d=!0,g}function a(){return m=e(h,v),t.dependsOnOwnProps&&(y=t(r,v)),g=n(m,y,v)}function u(){return e.dependsOnOwnProps&&(m=e(h,v)),t.dependsOnOwnProps&&(y=t(r,v)),g=n(m,y,v)}function s(){var t=e(h,v),r=!f(t,m);return m=t,r&&(g=n(m,y,v)),g}function c(e,t){var n=!p(t,v),r=!l(e,h);return h=e,v=t,n&&r?a():n?u():r?s():g}var l=o.areStatesEqual,p=o.areOwnPropsEqual,f=o.areStatePropsEqual,d=!1,h=void 0,v=void 0,m=void 0,y=void 0,g=void 0;return function(e,t){return d?c(e,t):i(e,t)}}function a(e,t){var n=t.initMapStateToProps,a=t.initMapDispatchToProps,u=t.initMergeProps,s=r(t,["initMapStateToProps","initMapDispatchToProps","initMergeProps"]),c=n(e,s),l=a(e,s),p=u(e,s),f=s.pure?i:o;return f(c,l,p,e,s)}n(260);t.a=a},function(e,t,n){"use strict";n(67)},function(e,t,n){"use strict";function r(e,t){if(e===t)return!0;var n=0,r=0;for(var i in e){if(o.call(e,i)&&e[i]!==t[i])return!1;n++}for(var a in t)o.call(t,a)&&r++;return n===r}t.a=r;var o=Object.prototype.hasOwnProperty},function(e,t,n){"use strict";var r=n(3),o=n.n(r),i=n(114),a=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}var o=n(6),i=n.n(o),a=n(3),u=n.n(a),s=n(120),c=n(32),l=n(71),p=n(15),f=n(117),d=(n(23),Object.assign||function(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:r.createElement;return function(t,n){return s.reduceRight(function(e,t){return t(e,n)},e(t,n))}};return function(e){return u.reduceRight(function(t,n){return n(t,e)},o.a.createElement(i.a,a({},e,{createElement:c(e.createElement)})))}}},function(e,t,n){"use strict";var r=n(165),o=n.n(r),i=n(119);t.a=n.i(i.a)(o.a)},function(e,t,n){"use strict";function r(e,t,r){if(!e.path)return!1;var o=n.i(i.b)(e.path);return o.some(function(e){return t.params[e]!==r.params[e]})}function o(e,t){var n=e&&e.routes,o=t.routes,i=void 0,a=void 0,u=void 0;return n?!function(){var s=!1;i=n.filter(function(n){if(s)return!0;var i=o.indexOf(n)===-1||r(n,e,t);return i&&(s=!0),i}),i.reverse(),u=[],a=[],o.forEach(function(e){var t=n.indexOf(e)===-1,r=i.indexOf(e)!==-1;t||r?u.push(e):a.push(e)})}():(i=[],a=[],u=o),{leaveRoutes:i,changeRoutes:a,enterRoutes:u}}var i=n(22);t.a=o},function(e,t,n){"use strict";function r(e,t,r){if(t.component||t.components)return void r(null,t.component||t.components);var o=t.getComponent||t.getComponents;if(o){var i=o.call(t,e,r);n.i(a.a)(i)&&i.then(function(e){return r(null,e)},r)}else r()}function o(e,t){n.i(i.a)(e.routes,function(t,n,o){r(e,t,o)},t)}var i=n(68),a=n(115);t.a=o},function(e,t,n){"use strict";function r(e,t){var r={};return e.path?(n.i(o.b)(e.path).forEach(function(e){Object.prototype.hasOwnProperty.call(t,e)&&(r[e]=t[e])}),r):r}var o=n(22);t.a=r},function(e,t,n){"use strict";var r=n(166),o=n.n(r),i=n(119);t.a=n.i(i.a)(o.a)},function(e,t,n){"use strict";function r(e,t){if(e==t)return!0;if(null==e||null==t)return!1;if(Array.isArray(e))return Array.isArray(t)&&e.length===t.length&&e.every(function(e,n){return r(e,t[n])});if("object"===("undefined"==typeof e?"undefined":c(e))){for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n))if(void 0===e[n]){if(void 0!==t[n])return!1}else{if(!Object.prototype.hasOwnProperty.call(t,n))return!1;if(!r(e[n],t[n]))return!1}return!0}return String(e)===String(t)}function o(e,t){return"/"!==t.charAt(0)&&(t="/"+t),"/"!==e.charAt(e.length-1)&&(e+="/"),"/"!==t.charAt(t.length-1)&&(t+="/"),t===e}function i(e,t,r){for(var o=e,i=[],a=[],u=0,c=t.length;u=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}function o(e,t){var o=e.history,a=e.routes,d=e.location,h=r(e,["history","routes","location"]);o||d?void 0:u()(!1),o=o?o:n.i(s.a)(h);var v=n.i(c.a)(o,n.i(l.a)(a));d=d?o.createLocation(d):o.getCurrentLocation(),v.match(d,function(e,r,a){var u=void 0;if(a){var s=n.i(p.a)(o,v,a);u=f({},a,{router:s,matchContext:{transitionManager:v,router:s}})}t(e,r&&o.createLocation(r,i.REPLACE),u)})}var i=n(35),a=(n.n(i),n(6)),u=n.n(a),s=n(118),c=n(120),l=n(15),p=n(117),f=Object.assign||function(e){for(var t=1;t4&&void 0!==arguments[4]?arguments[4]:[],a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:[];void 0===o&&("/"!==t.pathname.charAt(0)&&(t=d({},t,{pathname:"/"+t.pathname})),o=t.pathname),n.i(c.b)(e.length,function(n,r,s){u(e[n],t,o,i,a,function(e,t){e||t?s(e,t):r()})},r)}var c=n(68),l=n(115),p=n(22),f=(n(23),n(15));t.a=s;var d=Object.assign||function(e){for(var t=1;t>"),T={array:a("array"),bool:a("boolean"),func:a("function"),number:a("number"),object:a("object"),string:a("string"),symbol:a("symbol"),any:u(),arrayOf:s,element:c(),instanceOf:l,node:h(),objectOf:f,oneOf:p,oneOfType:d,shape:v};o.prototype=Error.prototype,e.exports=T},function(e,t,n){"use strict";var r="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";e.exports=r},function(e,t,n){"use strict";function r(e,t,n){this.props=e,this.context=t,this.refs=s,this.updater=n||u}function o(){}var i=n(4),a=n(72),u=n(73),s=n(27);o.prototype=a.prototype,r.prototype=new o,r.prototype.constructor=r,i(r.prototype,a.prototype),r.prototype.isPureReactComponent=!0,e.exports=r},function(e,t,n){"use strict";e.exports="15.4.2"},function(e,t,n){"use strict";function r(e){return i.isValidElement(e)?void 0:o("143"),e}var o=n(26),i=n(25);n(0);e.exports=r},function(e,t,n){"use strict";function r(e,t){return e&&"object"==typeof e&&null!=e.key?c.escape(e.key):t.toString(36)}function o(e,t,n,i){var f=typeof e;if("undefined"!==f&&"boolean"!==f||(e=null),null===e||"string"===f||"number"===f||"object"===f&&e.$$typeof===u)return n(i,e,""===t?l+r(e,0):t),1;var d,h,v=0,m=""===t?l:t+p;if(Array.isArray(e))for(var y=0;y-1?t:e}function d(e,t){t=t||{};var n=t.body;if(e instanceof d){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new o(e.headers)),this.method=e.method,this.mode=e.mode,n||null==e._bodyInit||(n=e._bodyInit,e.bodyUsed=!0)}else this.url=String(e);if(this.credentials=t.credentials||this.credentials||"omit",!t.headers&&this.headers||(this.headers=new o(t.headers)),this.method=f(t.method||this.method||"GET"),this.mode=t.mode||this.mode||null,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&n)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(n)}function h(e){var t=new FormData;return e.trim().split("&").forEach(function(e){if(e){var n=e.split("="),r=n.shift().replace(/\+/g," "),o=n.join("=").replace(/\+/g," ");t.append(decodeURIComponent(r),decodeURIComponent(o))}}),t}function v(e){var t=new o;return e.split(/\r?\n/).forEach(function(e){var n=e.split(":"),r=n.shift().trim();if(r){var o=n.join(":").trim();t.append(r,o)}}),t}function m(e,t){t||(t={}),this.type="default",this.status="status"in t?t.status:200,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in t?t.statusText:"OK",this.headers=new o(t.headers),this.url=t.url||"",this._initBody(e)}if(!e.fetch){var y={searchParams:"URLSearchParams"in e,iterable:"Symbol"in e&&"iterator"in Symbol,blob:"FileReader"in e&&"Blob"in e&&function(){try{return new Blob,!0}catch(e){return!1}}(),formData:"FormData"in e,arrayBuffer:"ArrayBuffer"in e};if(y.arrayBuffer)var g=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],b=function(e){return e&&DataView.prototype.isPrototypeOf(e)},_=ArrayBuffer.isView||function(e){return e&&g.indexOf(Object.prototype.toString.call(e))>-1};o.prototype.append=function(e,r){e=t(e),r=n(r);var o=this.map[e];this.map[e]=o?o+","+r:r},o.prototype.delete=function(e){delete this.map[t(e)]},o.prototype.get=function(e){return e=t(e),this.has(e)?this.map[e]:null},o.prototype.has=function(e){return this.map.hasOwnProperty(t(e))},o.prototype.set=function(e,r){this.map[t(e)]=n(r)},o.prototype.forEach=function(e,t){for(var n in this.map)this.map.hasOwnProperty(n)&&e.call(t,this.map[n],n,this)},o.prototype.keys=function(){var e=[];return this.forEach(function(t,n){e.push(n)}),r(e)},o.prototype.values=function(){var e=[];return this.forEach(function(t){e.push(t)}),r(e)},o.prototype.entries=function(){var e=[];return this.forEach(function(t,n){e.push([n,t])}),r(e)},y.iterable&&(o.prototype[Symbol.iterator]=o.prototype.entries);var C=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];d.prototype.clone=function(){return new d(this,{body:this._bodyInit})},p.call(d.prototype),p.call(m.prototype),m.prototype.clone=function(){return new m(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new o(this.headers),url:this.url})},m.error=function(){var e=new m(null,{status:0,statusText:""});return e.type="error",e};var w=[301,302,303,307,308];m.redirect=function(e,t){if(w.indexOf(t)===-1)throw new RangeError("Invalid status code");return new m(null,{status:t,headers:{location:e}})},e.Headers=o,e.Request=d,e.Response=m,e.fetch=function(e,t){return new Promise(function(n,r){var o=new d(e,t),i=new XMLHttpRequest;i.onload=function(){var e={status:i.status,statusText:i.statusText,headers:v(i.getAllResponseHeaders()||"")};e.url="responseURL"in i?i.responseURL:e.headers.get("X-Request-URL");var t="response"in i?i.response:i.responseText;n(new m(t,e))},i.onerror=function(){r(new TypeError("Network request failed"))},i.ontimeout=function(){r(new TypeError("Network request failed"))},i.open(o.method,o.url,!0),"include"===o.credentials&&(i.withCredentials=!0),"responseType"in i&&y.blob&&(i.responseType="blob"),o.headers.forEach(function(e,t){i.setRequestHeader(t,e)}),i.send("undefined"==typeof o._bodyInit?null:o._bodyInit)})},e.fetch.polyfill=!0}}("undefined"!=typeof self?self:this)},function(e,t,n){e.exports=n(131)}]); \ No newline at end of file diff --git a/webpack.config.js b/webpack.config.js index c60b02c..b5f3da3 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -1,9 +1,36 @@ var path = require('path'); var webpack = require('webpack'); +var APP_PATH = path.resolve(__dirname, './client/App-Client.jsx'); +var BUILD_PATH = path.resolve(__dirname, './server/public/js'); module.exports={ - + entry:[ + // 'webpack-dev-server/client?http://0.0.0.0:3000', // WebpackDevServer host and port + // 'webpack/hot/only-dev-server', // "only" prevents reload on syntax errors + APP_PATH + ], + + output:{ + path: BUILD_PATH, + filename: 'client.bundle.js' + }, + module:{ + rules:[ + { + test:/\.(js|jsx)$/, + exclude:/node_modules/, + use: [ + 'react-hot-loader', + 'babel-loader', + ] + }, + ] + }, + + plugins:[ + + ] }