├── .babelrc ├── .editorconfig ├── .eslintignore ├── .eslintrc.yaml ├── .gitignore ├── LICENSE ├── README.md ├── client ├── action │ ├── about.js │ ├── app.js │ ├── article-list.js │ └── article.js ├── component │ ├── about │ │ ├── index.jsx │ │ └── style.css │ ├── app │ │ ├── index.jsx │ │ └── style.css │ ├── article-list │ │ ├── index.jsx │ │ └── style.css │ ├── article │ │ ├── index.jsx │ │ └── style.css │ ├── card │ │ ├── index.jsx │ │ └── style.css │ ├── header │ │ ├── index.jsx │ │ ├── intro-bg.png │ │ └── style.css │ ├── markdown │ │ ├── index.jsx │ │ └── style.css │ └── pager │ │ ├── index.jsx │ │ └── style.css ├── config │ └── index.js ├── container │ ├── about │ │ └── index.jsx │ ├── app │ │ ├── index.jsx │ │ └── style.css │ ├── article-list │ │ └── index.jsx │ └── article │ │ └── index.jsx └── index.jsx ├── gulpfile.babel.js ├── lib └── async-props.jsx ├── model └── index.js ├── package.json ├── public ├── falcor.browser.min.js └── favicon.ico ├── route └── index.jsx ├── server ├── app.js ├── config │ └── index.js ├── db │ └── index.js ├── front-middleware.js ├── model │ ├── article.js │ ├── index.js │ └── resume.js ├── route │ ├── index.js │ └── model-router.js ├── server.js └── service │ ├── github-service.js │ └── index.js ├── util └── index.js ├── view ├── dev-index.html ├── index.html └── resume.md ├── webpack.config.backend.js ├── webpack.config.frontend.js ├── webpack.config.js └── webpack.config.production.js /.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": [ "es2015", "react", "stage-0" ] 3 | } 4 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | charset = utf-8 5 | indent_style = tab 6 | end_of_line = lf 7 | insert_final_newline = true 8 | trim_trailing_whitespace = true 9 | max_line_length = 100 10 | tab_width = 2 11 | 12 | [package.json] 13 | indent_style = space 14 | indent_size = 2 15 | 16 | [.babelrc] 17 | indent_style = space 18 | indent_size = 2 19 | 20 | [.eslintrc] 21 | indent_style = space 22 | indent_size = 2 23 | 24 | [*.{yaml,yml}] 25 | indent_style = space 26 | indent_size = 2 27 | 28 | [*.{markdown,md}] 29 | indent_size = 4 30 | -------------------------------------------------------------------------------- /.eslintignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | dev 3 | build 4 | dist 5 | public 6 | -------------------------------------------------------------------------------- /.eslintrc.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | extends: airbnb 4 | 5 | parser: babel-eslint 6 | 7 | settings: 8 | 9 | # import-resolver 10 | import/resolver: 11 | webpack: { config: 'webpack.config.js' } 12 | 13 | rules: 14 | 15 | semi: [2, never] 16 | indent: [2, tab] 17 | 18 | no-script-url: 0 19 | no-confusing-arrow: 0 20 | func-names: 0 21 | 22 | # react 23 | react/prop-types: 0 24 | react/jsx-closing-bracket-location: 0 25 | react/jsx-first-prop-new-line: 0 26 | react/jsx-indent-props: [2, tab] 27 | react/jsx-indent: [2, tab] 28 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | npm-debug.log 3 | .DS_Store 4 | access.log 5 | dev 6 | build 7 | dist 8 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 陈家伟 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # tech-blog 2 | 3 | explore and practice 4 | 5 | * express 6 | * falcor as model(dataModel and uiModel) 7 | * react 8 | * webpack with gulp 9 | * hot loader in backend and frontend 10 | * async props on route component 11 | * server render 12 | -------------------------------------------------------------------------------- /client/action/about.js: -------------------------------------------------------------------------------- 1 | import { dataModel } from '../../model' 2 | 3 | export const loadProps = async () => { 4 | const resume = await dataModel.getValue(['resume']) 5 | return { resume } 6 | } 7 | -------------------------------------------------------------------------------- /client/action/app.js: -------------------------------------------------------------------------------- 1 | export const loadProps = async () => {} 2 | -------------------------------------------------------------------------------- /client/action/article-list.js: -------------------------------------------------------------------------------- 1 | import { dataModel, uiModel } from '../../model' 2 | import { PAGE_SIZE } from '../config' 3 | 4 | export const loadProps = async () => { 5 | const page = await uiModel.getValue(['articleList', 'page']) 6 | const from = (page - 1) * PAGE_SIZE 7 | const to = from + PAGE_SIZE - 1 8 | const response = await dataModel.get(['articles', { from, to }, ['number', 'introduction']], 9 | ['articles', 'length']) 10 | const { articles } = response.json 11 | const length = articles.length 12 | delete articles.$__path 13 | delete articles.length 14 | const totalPages = Math.ceil(length / PAGE_SIZE) 15 | return { articles, page, totalPages } 16 | } 17 | 18 | export const jumpPage = async page => { 19 | await uiModel.setValue(['articleList', 'page'], page) 20 | return global.reload('article-list: jumpPage', page) 21 | } 22 | -------------------------------------------------------------------------------- /client/action/article.js: -------------------------------------------------------------------------------- 1 | import { dataModel } from '../../model' 2 | 3 | export const loadProps = async params => { 4 | const { number } = params 5 | const content = await dataModel.getValue(['articleByNumber', number, 'content']) 6 | const article = { content } 7 | return { article } 8 | } 9 | -------------------------------------------------------------------------------- /client/component/about/index.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import Markdown from '../markdown' 3 | 4 | import './style' 5 | 6 | const About = props => { 7 | const { resume } = props 8 | return ( 9 | 10 | {resume && } 11 | 12 | ) 13 | } 14 | 15 | About.propTypes = { 16 | resume: React.PropTypes.string.isRequired, 17 | } 18 | 19 | export default About 20 | -------------------------------------------------------------------------------- /client/component/about/style.css: -------------------------------------------------------------------------------- 1 | ideal-about { 2 | display: block; 3 | max-width: 800px; 4 | padding: 20px; 5 | margin: 0 auto; 6 | } 7 | -------------------------------------------------------------------------------- /client/component/app/index.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import Header from '../header' 3 | 4 | import './style' 5 | 6 | const App = props => { 7 | const { children } = props 8 | const headProps = { 9 | title: 'My name is Jiawei Chen, this blog is for Exploring and Practicing, ' + 10 | 'especially for React.', 11 | links: [{ 12 | label: 'POSTS', 13 | value: '/articles/', 14 | }, { 15 | label: 'ABOUT', 16 | value: '/about/', 17 | }, { 18 | label: 'GITHUB', 19 | value: 'https://github.com/ustccjw', 20 | }, { 21 | label: 'SOURCE', 22 | value: 'https://github.com/ustccjw/tech-blog', 23 | }], 24 | } 25 | return ( 26 | 27 |
28 |
29 | {children} 30 |
31 | 32 | ) 33 | } 34 | 35 | App.propTypes = { 36 | children: React.PropTypes.any, 37 | } 38 | 39 | export default App 40 | -------------------------------------------------------------------------------- /client/component/app/style.css: -------------------------------------------------------------------------------- 1 | ideal-app { 2 | display: block; 3 | } 4 | -------------------------------------------------------------------------------- /client/component/article-list/index.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import Card from '../card' 3 | import Pager from '../pager' 4 | 5 | import './style' 6 | 7 | import { jumpPage } from '../../action/article-list' 8 | 9 | const ArticleList = props => { 10 | const { articles, page, totalPages } = props 11 | const articleComponents = articles.map(article => 12 | 13 | ) 14 | const handleChange = async type => { 15 | if (type === 'prev') { 16 | jumpPage(page - 1) 17 | } else if (type === 'next') { 18 | jumpPage(page + 1) 19 | } 20 | } 21 | const pageProps = { 22 | handleChange, 23 | canPrev: page > 1, 24 | canNext: page < totalPages, 25 | } 26 | return ( 27 | 28 | {articleComponents} 29 | 30 | 31 | ) 32 | } 33 | 34 | ArticleList.propTypes = { 35 | articles: React.PropTypes.array.isRequired, 36 | page: React.PropTypes.number.isRequired, 37 | totalPages: React.PropTypes.number.isRequired, 38 | } 39 | 40 | export default ArticleList 41 | -------------------------------------------------------------------------------- /client/component/article-list/style.css: -------------------------------------------------------------------------------- 1 | ideal-articlelist { 2 | display: block; 3 | ideal-card { 4 | max-width: 800px; 5 | margin: 40px auto; 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /client/component/article/index.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import Markdown from '../markdown' 3 | 4 | import './style' 5 | 6 | const Article = props => { 7 | const { article } = props 8 | const { content } = article 9 | return ( 10 | 11 | {article && } 12 | 13 | ) 14 | } 15 | 16 | Article.propTypes = { 17 | article: React.PropTypes.object.isRequired, 18 | } 19 | 20 | export default Article 21 | -------------------------------------------------------------------------------- /client/component/article/style.css: -------------------------------------------------------------------------------- 1 | ideal-article { 2 | display: block; 3 | max-width: 800px; 4 | margin: 30px auto; 5 | } 6 | -------------------------------------------------------------------------------- /client/component/card/index.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import { Link } from 'react-router' 3 | import Markdown from '../markdown' 4 | 5 | import './style' 6 | 7 | const Card = props => { 8 | const { article } = props 9 | const { introduction, number } = article 10 | return ( 11 | 12 | 13 | View More 14 | 15 | ) 16 | } 17 | 18 | Card.propTypes = { 19 | article: React.PropTypes.object.isRequired, 20 | } 21 | 22 | export default Card 23 | -------------------------------------------------------------------------------- /client/component/card/style.css: -------------------------------------------------------------------------------- 1 | ideal-card { 2 | display: block; 3 | position: relative; 4 | width: 100%; 5 | height: 400px; 6 | padding: 10px; 7 | border: 1px solid #ccc; 8 | border-radius: 15px; 9 | & > ideal-markdown { 10 | height: 320px; 11 | } 12 | & > a { 13 | position: absolute; 14 | right: 2rem; 15 | bottom: 1rem; 16 | color: #272727; 17 | &::after { 18 | content: " →"; 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /client/component/header/index.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import { Link } from 'react-router' 3 | 4 | import './style' 5 | 6 | const Header = props => { 7 | const { title, links } = props 8 | const linksComponent = links.map(({ label, value }) => { 9 | let link = {label} 10 | if (value.startsWith('http')) { 11 | link = {label} 12 | } 13 | return
  • {link}
  • 14 | }) 15 | return ( 16 | 17 |
    18 |

    {title}

    19 | 22 |
    23 |
    24 | ) 25 | } 26 | 27 | Header.propTypes = { 28 | title: React.PropTypes.string.isRequired, 29 | links: React.PropTypes.array.isRequired, 30 | } 31 | 32 | export default Header 33 | -------------------------------------------------------------------------------- /client/component/header/intro-bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ustccjw/tech-blog/a7c244d51c0f6fc400fe911730071299e2267dea/client/component/header/intro-bg.png -------------------------------------------------------------------------------- /client/component/header/style.css: -------------------------------------------------------------------------------- 1 | ideal-header { 2 | display: block; 3 | position: relative; 4 | padding: 1px; 5 | color: #fff; 6 | font-family: "adelle-sans",sans-serif; 7 | background: url(./intro-bg.png); 8 | h1 { 9 | max-width: 800px; 10 | margin: 250px auto 2rem; 11 | padding: 0 20px; 12 | text-align: center; 13 | font-size: 1.5rem; 14 | font-weight: normal; 15 | } 16 | nav { 17 | position: absolute; 18 | top: 0; 19 | left: 0; 20 | ul { 21 | display: flex; 22 | list-style: none; 23 | li { 24 | margin-right: 20px; 25 | a { 26 | text-decoration: none; 27 | transition: color .25s; 28 | color: #fff; 29 | &:hover { 30 | color: orange; 31 | text-decoration: underline; 32 | } 33 | } 34 | } 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /client/component/markdown/index.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import Remarkable from 'react-remarkable' 3 | import hljs from 'highlight.js' 4 | import { unsafeScript } from '../../../util' 5 | import 'highlight.js/styles/github' 6 | import './style' 7 | 8 | const CONFIG = { 9 | // html: true, 10 | xhtmlOut: true, 11 | linkify: true, 12 | typographer: true, 13 | highlight: (str, lang) => { 14 | if (lang && hljs.getLanguage(lang)) { 15 | return hljs.highlight(lang, str).value 16 | } 17 | return hljs.highlightAuto(str).value 18 | }, 19 | } 20 | 21 | const Markdown = props => { 22 | const { content, options } = props 23 | const remarkableProps = { 24 | source: unsafeScript(content), 25 | options: { ...CONFIG, ...options }, 26 | } 27 | return ( 28 | 29 | 30 | 31 | ) 32 | } 33 | 34 | Markdown.propTypes = { 35 | content: React.PropTypes.string.isRequired, 36 | options: React.PropTypes.object, 37 | } 38 | 39 | export default Markdown 40 | -------------------------------------------------------------------------------- /client/component/markdown/style.css: -------------------------------------------------------------------------------- 1 | ideal-markdown { 2 | display: block; 3 | height: 100%; 4 | padding: 10px 20px 20px; 5 | code { 6 | display: block; 7 | overflow-x: scroll; 8 | } 9 | img { 10 | max-width: 100%; 11 | } 12 | & > div { 13 | height: 100%; 14 | } 15 | & > div > span { 16 | display: block; 17 | height: 100%; 18 | overflow: hidden; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /client/component/pager/index.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | 3 | import './style' 4 | 5 | const Pager = props => { 6 | const { title, handleChange, canPrev, canNext } = props 7 | const { prev, next } = title 8 | const prevComponent = canPrev && ( 9 | 12 | ) 13 | const nextComponent = canNext && ( 14 | 17 | ) 18 | 19 | return ( 20 | 21 |
      22 |
    • {prevComponent}
    • 23 |
    • {nextComponent}
    • 24 |
    25 |
    26 | ) 27 | } 28 | 29 | Pager.propTypes = { 30 | title: React.PropTypes.object, 31 | handleChange: React.PropTypes.func.isRequired, 32 | canPrev: React.PropTypes.bool.isRequired, 33 | canNext: React.PropTypes.bool.isRequired, 34 | } 35 | 36 | Pager.defaultProps = { 37 | title: { 38 | prev: '上一页', 39 | next: '下一页', 40 | }, 41 | } 42 | 43 | export default Pager 44 | -------------------------------------------------------------------------------- /client/component/pager/style.css: -------------------------------------------------------------------------------- 1 | ideal-pager { 2 | display: block; 3 | max-width: 800px; 4 | margin: 0 auto; 5 | padding: 2rem 0; 6 | overflow: auto; 7 | & > ul { 8 | list-style: none; 9 | margin: 0; 10 | padding: 0; 11 | li { 12 | 13 | float: left; 14 | &:nth-child(2) { 15 | float: right; 16 | } 17 | } 18 | button { 19 | padding: 5px 14px; 20 | border: 1px solid #ddd; 21 | border-radius: 15px; 22 | text-decoration: none; 23 | color: #337ab7; 24 | outline: none; 25 | background-color: #fff; 26 | &:hover { 27 | cursor: pointer; 28 | } 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /client/config/index.js: -------------------------------------------------------------------------------- 1 | export const PAGE_SIZE = 7 2 | -------------------------------------------------------------------------------- /client/container/about/index.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import About from '../../component/about' 3 | 4 | import { loadProps } from '../../action/about' 5 | 6 | const AboutContainer = props => { 7 | const { resume } = props 8 | const aboutProps = { resume } 9 | return 10 | } 11 | 12 | AboutContainer.propTypes = { 13 | resume: React.PropTypes.string, 14 | } 15 | 16 | AboutContainer.loadProps = loadProps 17 | 18 | export default AboutContainer 19 | -------------------------------------------------------------------------------- /client/container/app/index.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import App from '../../component/app' 3 | import NProgress from 'nprogress' 4 | 5 | import './style' 6 | 7 | import { loadProps } from '../../action/app' 8 | 9 | export default class AppContainer extends React.Component { 10 | static propTypes = { 11 | children: React.PropTypes.any.isRequired, 12 | loading: React.PropTypes.bool.isRequired, 13 | reload: React.PropTypes.func.isRequired, 14 | } 15 | 16 | static loadProps = loadProps 17 | 18 | componentWillMount() { 19 | const { reload } = this.props 20 | global.reload = reload 21 | } 22 | 23 | componentWillReceiveProps(nextProps) { 24 | const { loading } = nextProps 25 | if (loading) { 26 | NProgress.start() 27 | } else { 28 | NProgress.done() 29 | } 30 | } 31 | 32 | shouldComponentUpdate(nextProps) { 33 | const { loading } = nextProps 34 | return !loading 35 | } 36 | 37 | render() { 38 | const { children } = this.props 39 | const appProps = { children } 40 | return 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /client/container/app/style.css: -------------------------------------------------------------------------------- 1 | @import '~nprogress/nprogress.css'; 2 | 3 | html, body { 4 | margin: 0; 5 | padding: 0; 6 | } 7 | 8 | body { 9 | color: #272727; 10 | font: 16px/1.6 Verdana, sans-serif; 11 | } 12 | 13 | * { 14 | box-sizing: border-box; 15 | } 16 | -------------------------------------------------------------------------------- /client/container/article-list/index.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import ArticleList from '../../component/article-list' 3 | import { object2Array } from '../../../util' 4 | 5 | import { loadProps } from '../../action/article-list' 6 | 7 | const ArticleListContainer = props => { 8 | const { page, articles, totalPages } = props 9 | const articleListProps = { 10 | page, 11 | totalPages, 12 | articles: object2Array(articles), 13 | } 14 | return 15 | } 16 | 17 | ArticleListContainer.propTypes = { 18 | page: React.PropTypes.number.isRequired, 19 | articles: React.PropTypes.object.isRequired, 20 | totalPages: React.PropTypes.number.isRequired, 21 | } 22 | 23 | ArticleListContainer.loadProps = loadProps 24 | 25 | export default ArticleListContainer 26 | -------------------------------------------------------------------------------- /client/container/article/index.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import Article from '../../component/article' 3 | 4 | import { loadProps } from '../../action/article' 5 | 6 | const ArticleContainer = props => { 7 | const { article } = props 8 | const articleProps = { article } 9 | return
    10 | } 11 | 12 | ArticleContainer.propTypes = { 13 | article: React.PropTypes.object, 14 | } 15 | 16 | ArticleContainer.loadProps = loadProps 17 | 18 | export default ArticleContainer 19 | -------------------------------------------------------------------------------- /client/index.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import ReactDOM from 'react-dom' 3 | import { Router, browserHistory as history } from 'react-router' 4 | import Loader from 'halogen/PacmanLoader' 5 | import AsyncProps from '../lib/async-props' 6 | 7 | let rootElement = document.querySelector('main') 8 | if (!rootElement) { 9 | const body = document.body 10 | rootElement = document.createElement('main') 11 | body.insertBefore(rootElement, body.firstChild) 12 | } 13 | const renderLoading = () => 14 | const onError = err => console.error(err) // eslint-disable-line no-console 15 | let render = () => { 16 | const routes = require('../route').default 17 | const router = ( 18 | } /> 20 | ) 21 | ReactDOM.render(router, rootElement) 22 | } 23 | 24 | if (module.hot) { 25 | const renderApp = render 26 | const renderError = err => { 27 | const RedBox = require('redbox-react') 28 | ReactDOM.render(, rootElement) 29 | } 30 | render = () => { 31 | try { 32 | renderApp() 33 | } catch (err) { 34 | renderError(err) 35 | } 36 | } 37 | module.hot.accept('../route', render) 38 | } 39 | 40 | render() 41 | 42 | global.React = React 43 | -------------------------------------------------------------------------------- /gulpfile.babel.js: -------------------------------------------------------------------------------- 1 | import path from 'path' 2 | import { spawn } from 'child_process' 3 | import gulp from 'gulp' 4 | import webpack from 'webpack' 5 | import del from 'del' 6 | import backendConfig from './webpack.config.backend' 7 | import productionConfig from './webpack.config.production' 8 | 9 | function onBuild() {} 10 | 11 | gulp.task('clean-dev', () => del([backendConfig.output.path])) 12 | gulp.task('clean-build', () => del([productionConfig.backend.output.path, 13 | productionConfig.frontend.output.path])) 14 | 15 | gulp.task('backend-watch', done => { 16 | let fireDone = false 17 | webpack(backendConfig).watch(null, (err, stats) => { 18 | onBuild(err, stats) 19 | if (!fireDone) { 20 | fireDone = true 21 | done() 22 | } 23 | }) 24 | }) 25 | 26 | gulp.task('server-start', () => { 27 | const entry = path.join(__dirname, 'dev/backend') 28 | const server = spawn('node', [entry]) 29 | server.stdout.on('data', data => process.stdout.write(data)) 30 | server.stderr.on('data', data => process.stderr.write(data)) 31 | // eslint-disable-next-line no-console 32 | server.on('exit', code => console.log(`child process exited with code ${code}`)) 33 | }) 34 | 35 | gulp.task('backend-build', done => { 36 | webpack(productionConfig.backend).run((err, stats) => { 37 | onBuild(err, stats) 38 | done() 39 | }) 40 | }) 41 | 42 | gulp.task('frontend-build', done => { 43 | webpack(productionConfig.frontend).run((err, stats) => { 44 | onBuild(err, stats) 45 | done() 46 | }) 47 | }) 48 | 49 | gulp.task('dev', gulp.series('clean-dev', 'backend-watch', 'server-start')) 50 | 51 | gulp.task('build', gulp.series('clean-build', 'backend-build', 'frontend-build')) 52 | -------------------------------------------------------------------------------- /lib/async-props.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import RouterContext from 'react-router/lib/RouterContext' 3 | 4 | function eachComponents(components, iterator) { 5 | components.forEach(value => { 6 | if (typeof value === 'object') { 7 | for (const component of value) { 8 | iterator(component) 9 | } 10 | } else { 11 | iterator(value) 12 | } 13 | }) 14 | } 15 | 16 | function findAsyncComponents(components) { 17 | const asyncComponents = [] 18 | eachComponents(components, component => { 19 | if (component.loadProps) { 20 | asyncComponents.push(component) 21 | } 22 | }) 23 | return asyncComponents 24 | } 25 | 26 | async function loadAsyncProps(components, params, location) { 27 | const componentsArray = [] 28 | const propsArray = [] 29 | const tasks = findAsyncComponents(components).map((component, index) => 30 | component.loadProps(params, location).then(props => { 31 | propsArray[index] = props 32 | componentsArray[index] = component 33 | }) 34 | ) 35 | await Promise.all(tasks) 36 | return { componentsArray, propsArray } 37 | } 38 | 39 | function lookupPropsForComponent(component, propsAndComponents) { 40 | const { componentsArray, propsArray } = propsAndComponents 41 | const index = componentsArray.indexOf(component) 42 | return propsArray[index] 43 | } 44 | 45 | function createElement(Component, props, asyncInfo) { 46 | if (Component.loadProps) { 47 | return 48 | } 49 | return 50 | } 51 | 52 | const AsyncPropsContainer = ({ Component, routerProps, asyncInfo, 53 | ...otherProps }) => { 54 | const { propsAndComponents, loading, reload } = asyncInfo 55 | const asyncProps = lookupPropsForComponent(Component, propsAndComponents) 56 | return ( 57 | 59 | ) 60 | } 61 | 62 | class AsyncProps extends React.Component { 63 | static propTypes = { 64 | components: React.PropTypes.array.isRequired, 65 | params: React.PropTypes.object.isRequired, 66 | location: React.PropTypes.object.isRequired, 67 | onError: React.PropTypes.func.isRequired, 68 | renderLoading: React.PropTypes.func.isRequired, 69 | 70 | // server rendering 71 | propsArray: React.PropTypes.array, 72 | componentsArray: React.PropTypes.array, 73 | } 74 | 75 | static defaultProps = { 76 | onError: err => { throw err }, 77 | renderLoading: () => null, 78 | } 79 | 80 | constructor(props, context) { 81 | super(props, context) 82 | const { propsArray, componentsArray } = props 83 | const isServerRender = propsArray && componentsArray 84 | this.state = { 85 | loading: false, 86 | prevProps: null, 87 | propsAndComponents: isServerRender ? { propsArray, componentsArray } : 88 | null, 89 | } 90 | } 91 | 92 | componentDidMount() { 93 | const { components, params, location } = this.props 94 | this.loadAsyncProps(components, params, location) 95 | } 96 | 97 | componentWillReceiveProps(nextProps) { 98 | const routeChanged = nextProps.location !== this.props.location 99 | if (routeChanged) { 100 | const { components, params, location } = nextProps 101 | this.loadAsyncProps(components, params, location) 102 | } 103 | } 104 | 105 | componentWillUnmount() { 106 | this.unmounted = true 107 | } 108 | 109 | async loadAsyncProps(components, params, location) { 110 | this.setState({ loading: true, prevProps: this.props }) 111 | const { onError } = this.props 112 | let propsAndComponents = null 113 | try { 114 | propsAndComponents = await loadAsyncProps(components, params, location) 115 | } catch (err) { 116 | this.setState({ loading: false }) 117 | onError(err) 118 | return 119 | } 120 | const sameLocation = this.props.location === location 121 | if (sameLocation && !this.unmounted) { 122 | this.setState({ loading: false, prevProps: null, propsAndComponents }) 123 | } 124 | } 125 | 126 | reload(actionName, ...args) { 127 | if (process.env.NODE_ENV === 'development') { 128 | console.info(actionName, args) // eslint-disable-line no-console 129 | } 130 | const { components, params, location } = this.props 131 | return this.loadAsyncProps(components, params, location) 132 | } 133 | 134 | render() { 135 | const { loading, prevProps, propsAndComponents } = this.state 136 | const { renderLoading } = this.props 137 | if (!propsAndComponents) { 138 | return renderLoading() 139 | } 140 | const asyncInfo = { loading, propsAndComponents, reload: ::this.reload } 141 | const props = prevProps || this.props 142 | return ( 143 | 144 | createElement(components, props1, asyncInfo)} /> 145 | ) 146 | } 147 | } 148 | 149 | export const loadPropsOnServer = ({ components, params, location }) => 150 | loadAsyncProps(components, params, location) 151 | 152 | export default AsyncProps 153 | -------------------------------------------------------------------------------- /model/index.js: -------------------------------------------------------------------------------- 1 | import falcor from 'falcor' 2 | import HttpDataSource from 'falcor-http-datasource' 3 | 4 | let url = '/model.json' 5 | if (process.env.NODE_ENV === 'development') { 6 | url = 'http://127.0.0.1:3000/model.json' 7 | } 8 | 9 | // dataModel 按对象实体划分 10 | export const dataModel = new falcor.Model({ 11 | source: new HttpDataSource(url), 12 | }) 13 | 14 | // uiModel 按 route component 划分 15 | export const uiModel = new falcor.Model({ 16 | cache: { 17 | articleList: { 18 | page: 1, 19 | }, 20 | }, 21 | }) 22 | 23 | if (global.dataCache) { 24 | dataModel.setCache(global.dataCache) 25 | } 26 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "tech-blog", 3 | "version": "1.0.0", 4 | "description": "explore and practice", 5 | "main": "index.js", 6 | "scripts": { 7 | "start": "NODE_ENV=development gulp dev", 8 | "lint": "eslint ./ --ext .js,.jsx", 9 | "test": "echo \"Error: no test specified\" && exit 1", 10 | "build": "NODE_ENV=production gulp build", 11 | "serve": "NODE_ENV=production pm2 start build/backend.js -f -i 0 --name tech-blog", 12 | "deploy": "npm run build && npm run serve" 13 | }, 14 | "repository": { 15 | "type": "git", 16 | "url": "git+https://github.com/ustccjw/tech-blog.git" 17 | }, 18 | "keywords": [ 19 | "react", 20 | "falcor", 21 | "express" 22 | ], 23 | "author": "ustccjw", 24 | "license": "MIT", 25 | "bugs": { 26 | "url": "https://github.com/ustccjw/tech-blog/issues" 27 | }, 28 | "homepage": "https://github.com/ustccjw/tech-blog#readme", 29 | "dependencies": { 30 | "body-parser": "^1.15.0", 31 | "compression": "^1.6.1", 32 | "cookie-parser": "^1.4.1", 33 | "errorhandler": "^1.4.3", 34 | "es6-template-strings": "^2.0.0", 35 | "express": "^4.13.4", 36 | "express-session": "^1.13.0", 37 | "extract-text-webpack-plugin": "^1.0.1", 38 | "falcor": "^0.1.17", 39 | "falcor-express": "^0.1.2", 40 | "falcor-http-datasource": "^0.1.3", 41 | "falcor-router": "^0.4.0", 42 | "halogen": "^0.2.0", 43 | "highlight.js": "^9.3.0", 44 | "ioredis": "^1.15.1", 45 | "method-override": "^2.3.5", 46 | "morgan": "^1.7.0", 47 | "mz": "^2.4.0", 48 | "node-fetch": "^1.5.1", 49 | "nprogress": "^0.2.0", 50 | "query-string": "^4.1.0", 51 | "react": "^15.0.1", 52 | "react-dom": "^15.0.1", 53 | "react-remarkable": "^1.1.1", 54 | "react-router": "^2.3.0", 55 | "response-time": "^2.3.1", 56 | "serve-favicon": "^2.3.0", 57 | "serve-static": "^1.10.2" 58 | }, 59 | "devDependencies": { 60 | "babel-core": "^6.7.7", 61 | "babel-eslint": "^6.0.3", 62 | "babel-loader": "^6.2.4", 63 | "babel-polyfill": "^6.7.4", 64 | "babel-preset-es2015": "^6.6.0", 65 | "babel-preset-react": "^6.5.0", 66 | "babel-preset-stage-0": "^6.5.0", 67 | "css-loader": "^0.23.1", 68 | "del": "^2.2.0", 69 | "eslint": "^2.8.0", 70 | "eslint-config-airbnb": "^8.0.0", 71 | "eslint-import-resolver-webpack": "^0.2.0", 72 | "eslint-plugin-import": "^1.5.0", 73 | "eslint-plugin-jsx-a11y": "^1.0.2", 74 | "eslint-plugin-react": "^5.0.1", 75 | "extract-text-webpack-plugin": "^1.0.1", 76 | "file-loader": "^0.8.5", 77 | "gulp": "github:gulpjs/gulp#4.0", 78 | "node-noop": "^1.0.0", 79 | "postcss": "^5.0.19", 80 | "postcss-cssnext": "^2.5.2", 81 | "postcss-loader": "^0.8.2", 82 | "postcss-nested": "^1.0.0", 83 | "redbox-react": "^1.2.3", 84 | "source-map-support": "^0.4.0", 85 | "style-loader": "^0.13.1", 86 | "url-loader": "^0.5.7", 87 | "webpack": "^1.13.0", 88 | "webpack-dev-middleware": "^1.6.1", 89 | "webpack-hot-middleware": "^2.10.0" 90 | } 91 | } 92 | -------------------------------------------------------------------------------- /public/falcor.browser.min.js: -------------------------------------------------------------------------------- 1 | !function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var e;e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,e.falcor=t()}}(function(){var t;return function e(t,n,r){function o(s,u){if(!n[s]){if(!t[s]){var a="function"==typeof require&&require;if(!u&&a)return a(s,!0);if(i)return i(s,!0);var c=new Error("Cannot find module '"+s+"'");throw c.code="MODULE_NOT_FOUND",c}var p=n[s]={exports:{}};t[s][0].call(p.exports,function(e){var n=t[s][1][e];return o(n?n:e)},p,p.exports,e,t,n,r)}return n[s].exports}for(var i="function"==typeof require&&require,s=0;s1&&!Array.isArray(r)||0===e&&!Array.isArray(r)&&"string"!==o||1===e&&!Array.isArray(r)&&!x(r))return new u(function(t){t.onError(new Error("Invalid argument"))})}return c.create(this,t)},r.prototype.invalidate=function(){var t,e=-1,n=arguments.length,r=arguments[n-1];for(t=new Array(n);++e0?t.get.apply(t,u).map(function(){return t})["catch"](r.Observable.empty()):r.Observable["return"](t):s>0?e.get.apply(e,u.map(function(t){return a.concat(t)})).map(function(){return e.deref(a)}).mergeAll():r.Observable.empty()})}},{133:133,158:158}],6:[function(t,e,n){var r=t(118),o=t(133),i=t(14),s=t(91);e.exports=function(t){var e=o.fromPath(t);if(!Array.isArray(e))throw new Error("Model#derefSync must be called with an Array path.");var n=i(this,this._path.concat(e)),u=n.path,a=n.value,c=n.found;if(!c)return void 0;var p=s(a);if(Boolean(a)&&Boolean(p)){if(p===r){if(this._boxed)throw a;throw a.value}if(void 0===a.value)return void 0}return this._clone({_path:u})}},{118:118,133:133,14:14,91:91}],7:[function(t,e,n){function r(){this.message=r.message,this.stack=(new Error).stack}r.prototype=new Error,r.prototype.name="BoundJSONGraphModelError",r.message="It is not legal to use the JSON Graph format from a bound Model. JSON Graph format can only be used from a root model.",e.exports=r},{}],8:[function(t,e,n){function r(t,e){this.message=i,this.stack=(new Error).stack,this.boundPath=t,this.shortedPath=e}var o="InvalidModelError",i="The boundPath of the model is not valid since a value or error was found before the path end.";r.prototype=new Error,r.prototype.name=o,r.message=i,e.exports=r},{}],9:[function(t,e,n){function r(t){this.message="An exception was thrown when making a request.",this.stack=(new Error).stack,this.innerError=t}var o="InvalidSourceError";r.prototype=new Error,r.prototype.name=o,r.is=function(t){return t&&t.name===o},e.exports=r},{}],10:[function(t,e,n){function r(){this.message="The allowed number of retries have been exceeded.",this.stack=(new Error).stack}var o="MaxRetryExceededError";r.prototype=new Error,r.prototype.name=o,r.is=function(t){return t&&t.name===o},e.exports=r},{}],11:[function(t,e,n){e.exports=1},{}],12:[function(t,e,n){function r(t,e,n,r,o,h,f){for(var l,d,v=n,y=o,b=r,m=0;;){if(0===m&&b[c]?(m=y.length,d=b[c]):(l=y[m++],d=v[l]),d){var g=d.$type,w=g&&d.value||d;if(m_;_++)x[_]=y[_];y=x}return[v,y]}var o=t(27),i=o.create,s=t(23),u=t(28),a=t(119),c=t(34),p=t(30).promote;e.exports=r},{119:119,23:23,27:27,28:28,30:30,34:34}],13:[function(t,e,n){var r=t(16),o=t(8),i=t(7),s=t(11);e.exports=function(t,e){return function(n,u,a){var c,p,h,f=a[0],l={values:a,optimizedPaths:[]},d=n._root.cache,v=n._path,y=d,b=v.length,m=[];if(b){if(e)return{criticalError:new i};if(y=r(n,v),y===s)return{criticalError:new o(v,v)};for(c=[],p=0;b>p;++p)c[p]=v[p]}else c=[],b=0;for(p=0,h=u.length;h>p;p++)t(n,d,y,u[p],0,f,l,m,c,b,e);return l}}},{11:11,16:16,7:7,8:8}],14:[function(t,e,n){var r=t(18),o=t(8);e.exports=function(t,e){var n,i,s,u,a,c,p=e,h=e;for(n=t._boxed,i=t._materialized,s=t._treatErrorsAsValues,t._boxed=!0,t._materialized=!0,t._treatErrorsAsValues=!0,u=r(t,p.concat(null),!0),t._boxed=n,t._materialized=i,t._treatErrorsAsValues=s,p=u.optimizedPath,a=u.shorted,c=u.found,u=u.value;p.length&&null===p[p.length-1];)p.pop();if(c&&a)throw new o(h,p);return{path:p,value:u,shorted:a,found:c}}},{18:18,8:8}],15:[function(t,e,n){function r(t,e,n){Object.keys(t).filter(function(t){return t[0]!==s&&"$size"!==t}).forEach(function(n){var s=t[n],u=e[n];if(u||(u=e[n]={}),s.$type){var a,c=s.value&&"object"==typeof s.value,p=!t[o];return a=c||p?i(s):s.value,void(e[n]=a)}r(s,u,n)})}var o=t(38),i=t(26),s=t(41);e.exports=function(t){var e={};return r(t,e),e}},{26:26,38:38,41:41}],16:[function(t,e,n){var r=t(11);e.exports=function(t,e){for(var n=t._root.cache,o=-1,i=e.length;++ow;){if(p=e[w++],null!==p&&(x=_[p],b[b.length]=p),!x){S=void 0,m=!0,E=!1;break}if(f=x.$type,y>w){if(f===u){if(l=r(t,v,v,x,x.value),d=l[0],!d){S=void 0,x=void 0;break}f=d.$type,x=d,b=l[1].slice(0)}if(f)break}else S=x;_=x}if(y>w){for(h=w;y>h;++h)if(null!==e[w]){g=!0;break}for(g?(m=!0,S=void 0):S=x,h=w;y>h;++h)b[b.length]=e[h]}if(S&&f&&(i(S)?S=void 0:s(t,S)),S&&f===c&&!t._treatErrorsAsValues)throw{path:w===y?e:e.slice(0,w),value:S.value};return S&&t._boxed?S=Boolean(f)&&!n?o(S):S:!S&&t._materialized?S={$type:a}:S&&(S=S.value),{value:S,shorted:m,optimizedPath:b,found:E}}},{117:117,118:118,119:119,12:12,26:26,28:28,30:30}],19:[function(t,e,n){var r=t(47);e.exports=function(t,e){var n=t._getValueSync({_boxed:!0,_root:t._root,_treatErrorsAsValues:t._treatErrorsAsValues},e,!0).value,o=n&&n[r];return null==o?-1:o}},{47:47}],20:[function(t,e,n){var r=t(13),o=t(32),i=r(o,!1),s=r(o,!0);e.exports={getValueSync:t(18),getBoundValue:t(14),getWithPathsAsPathMap:i,getWithPathsAsJSONGraph:s}},{13:13,14:14,18:18,32:32}],21:[function(t,e,n){var r=t(30),o=t(26),i=r.promote;e.exports=function(t,e,n,r,s){var u=e.value;s.errors||(s.errors=[]),t._boxed&&(u=o(e)),s.errors.push({path:r.slice(0,n+1),value:u}),i(t,e)}},{26:26,30:30}],22:[function(t,e,n){function r(t,e,n,r,o,i,s){s.requestedMissingPaths.push(r.slice(0,n).concat(e)),s.optimizedMissingPaths.push(o.slice(0,i).concat(e))}var o=t(31),i=o.fastCopy;e.exports=function(t,e,n,o,s,u,a){var c;o.requestedMissingPaths||(o.requestedMissingPaths=[],o.optimizedMissingPaths=[]),c=ny;y++)g=f[y],w[g]||(w[g]={}),w=w[g];g=f[y],w[g]=E?{$type:u}:S,h&&n.paths.push(h.slice(0,r))}else if(0===r)n.json=S;else{for(w=n.json,w||(w=n.json={}),y=0;r-1>y;y++)m=h[y],w[m]||(w[m]={}),x=w,_=m,w=w[m];m=h[y],null!==m?w[m]=S:x[_]=S}}}},{117:117,118:118,119:119,26:26,30:30,38:38}],24:[function(t,e,n){var r=t(28),o=t(27),i=t(30),s=o.remove,u=i.splice,a=t(118),c=t(21),p=t(23),h=t(22),f=t(29),l=t(36);e.exports=function(t,e,n,o,i,d,v,y,b,m,g){var w=e&&e.$type,x=e&&void 0===e.value;return e&&w?void(r(e)?(e[l]||(u(t,e),s(e)),h(t,n,o,d,v,y,b)):w===a?(g&&(v[o]=null),m||t._treatErrorsAsValues?p(t,e,i,o,d,v,y,b,m,g):c(t,e,o,v,d)):(g&&(v[o]=null),(!x||x&&f(t))&&p(t,e,i,o,d,v,y,b,m,g))):void(f(t)?p(t,e,i,o,d,v,y,b,m,g):h(t,n,o,d,v,y,b))}},{118:118,21:21,22:22,23:23,27:27,28:28,29:29,30:30,36:36}],25:[function(t,e,n){var r=t(133);e.exports=function(t){var e=r.fromPath(t);if(Array.isArray(e)===!1)throw new Error("Model#getValueSync must be called with an Array path.");return this._path.length&&(e=this._path.concat(e)),this._syncCheck("getValueSync")&&this._getValueSync(this,e).value}},{133:133}],26:[function(t,e,n){var r=t(41);e.exports=function(t){var e,n,o,i=Object.keys(t);for(e={},n=0,o=i.length;o>n;n++){var s=i[n];s[0]!==r&&(e[s]=t[s])}return e}},{41:41}],27:[function(t,e,n){function r(t,e){var n=e[a]||0;e[i+n]=t,e[a]=n+1,t[u]=n,t[s]=e}function o(t){var e=t[s];if(e){for(var n=t[u],r=e[a];r>n;)e[i+n]=e[i+n+1],++n;e[a]=r-1,t[s]=void 0,t[u]=void 0}}var i=t(44),s=t(34),u=t(43),a=t(45);e.exports={create:r,remove:o}},{34:34,43:43,44:44,45:45}],28:[function(t,e,n){var r=t(106);e.exports=function(t){var e=void 0===t.$expires&&-1||t.$expires;return-1!==e&&1!==e&&(0===e||eo;r++,o++)i[r]=t[o];return i}function o(t,e){var n,r,o,i=[];for(n=0,r=t.length;r>n;n++)i[n]=t[n];for(o=0,r=e.length;r>o;o++)null!==e[o]&&(i[n++]=e[o]);return i}function i(t,e){var n,r,o,i=[];for(n=0,r=t.length;r>n;n++)i[n]=t[n];for(o=0,r=e.length;r>o;o++)i[n++]=e[o];return i}e.exports={fastCat:i,fastCatSkipNulls:o,fastCopy:r}},{}],32:[function(t,e,n){var r=t(12),o=t(24),i=t(28),s=t(142).iterateKeySet,u=t(119);e.exports=function a(t,e,n,c,p,h,f,l,d,v,y,b){var m=b,g=d;if(!n||n&&n.$type||p===c.length)return void o(t,n,c,p,h,f,l,g,v,y,m);var w,x;w=c[p];var _="object"==typeof w,S=p+1,E=!1,C=w;if(_&&(E={},C=s(w,E)),void 0!==C||!E.done){var A=v+1;do{m=!1;var N;null===C?N=n:(N=n[C],g[v]=C,l[p]=C);var k=g,O=A;if(N){var P=N.$type,j=P&&N.value||N;if(Sx;++x)k[x]=q[x]}}a(t,e,N,c,S,h,f,l,k,O,y,m),E&&!E.done&&(C=s(w,E))}while(E&&!E.done)}}},{119:119,12:12,142:142,24:24,28:28}],33:[function(t,e,n){"use strict";function r(t){return new r.Model(t)}"function"==typeof Promise?r.Promise=Promise:r.Promise=t(150),e.exports=r,r.Model=t(2)},{150:150,2:2}],34:[function(t,e,n){e.exports=t(41)+"context"},{41:41}],35:[function(t,e,n){e.exports=t(41)+"head"},{41:41}],36:[function(t,e,n){e.exports=t(41)+"invalidated"},{41:41}],37:[function(t,e,n){e.exports=t(41)+"key"},{41:41}],38:[function(t,e,n){e.exports="$modelCreated"},{}],39:[function(t,e,n){e.exports=t(41)+"next"},{41:41}],40:[function(t,e,n){e.exports=t(41)+"parent"},{41:41}],41:[function(t,e,n){e.exports=String.fromCharCode(30)},{}],42:[function(t,e,n){e.exports=t(41)+"prev"},{41:41}],43:[function(t,e,n){e.exports=t(41)+"ref-index"},{41:41}],44:[function(t,e,n){e.exports=t(41)+"ref"},{41:41}],45:[function(t,e,n){e.exports=t(41)+"refs-length"},{41:41}],46:[function(t,e,n){e.exports=t(41)+"tail"},{41:41}],47:[function(t,e,n){e.exports=t(41)+"version"},{41:41}],48:[function(t,e,n){function r(t,e,n,o,s,u,c,p,h,f){if(!_(t)&&!t.$type)for(var l in t)if(l[0]!==a&&"$"!==l[0]&&m(t,l)){var d=t[l],v=g(d)&&!d.$type,y=i(n,o,s,l,d,v,!1,u,c,p,h,f),w=y[0],x=y[1];w&&(v?r(d,e+1,n,x,w,u,c,p,h,f):A(w,x,l,p)&&C(x,b(w),p,u))}}function o(t,e,n,r,o,s,a,h){if(w(n))return S(n,o,s),[void 0,e];y(s,n);var d=n,v=n.value,b=e;if(n=n[p],null!=n)b=n[c]||e;else{var m=0,g=v.length-1;b=n=e;do{var x=v[m],E=g>m,C=i(e,b,n,x,t,E,!0,r,o,s,a,h);if(n=C[0],_(n))return C;b=C[1]}while(m++d,_=i(t,l,e,m,x,!0,n,r,o);if(e=_[0],g(e))return _;l=_[1]}while(d++=h){var x=t[s];for(b=x;d>=w&&b;)x=x[a],m=b.$size||0,d-=m,g===!0&&p(b,m,t,l),b=x;t[s]=t[a]=b,null==b?t[i]=t[u]=void 0:b[u]=void 0}}},{107:107,114:114,35:35,37:37,39:39,40:40,42:42,46:46}],51:[function(t,e,n){var r=t(120),o=t(35),i=t(46),s=t(39),u=t(42),a=t(100);e.exports=function(t,e){if(a(e)&&e.$expires!==r){var n=t[o],c=t[i],p=e[s],h=e[u];e!==n&&(null!=p&&"object"==typeof p&&(p[u]=h),null!=h&&"object"==typeof h&&(h[s]=p),p=n,null!=n&&"object"==typeof n&&(n[u]=e),t[o]=t[s]=n=e,n[s]=p,n[u]=void 0),(null==c||e===c)&&(t[i]=t[u]=c=h||e)}return e}},{100:100,120:120,35:35,39:39,42:42,46:46}],52:[function(t,e,n){var r=t(35),o=t(46),i=t(39),s=t(42);e.exports=function(t,e){var n=t[r],u=t[o],a=e[i],c=e[s];null!=a&&"object"==typeof a&&(a[s]=c),null!=c&&"object"==typeof c&&(c[i]=a),e===n&&(t[r]=t[i]=a),e===u&&(t[o]=t[s]=c),e[i]=e[s]=void 0,n=u=a=c=void 0}},{35:35,39:39,42:42,46:46}],53:[function(t,e,n){function r(t,e){var n=!1;return function(){if(!n&&!t._disposed){n=!0,t._callbacks[e]=null,t._optimizedPaths[e]=[],t._requestedPaths[e]=[];var r=--t._count;0!==r||t.sent||(t._disposable.dispose(),t.requestQueue.removeRequest(t))}}}function o(t){for(var e=[],n=-1,r=0,o=t.length;o>r;++r)for(var i=t[r],s=0,u=i.length;u>s;++s)e[++n]=i[s];return e}var i=t(60),s=t(61),u=0,a=t(58).GetRequest,c=t(77),p=t(79),h=t(118),f=[],l=function(t,e){this.sent=!1,this.scheduled=!1,this.requestQueue=e,this.id=++u,this.type=a,this._scheduler=t,this._pathMap={},this._optimizedPaths=[],this._requestedPaths=[],this._callbacks=[],this._count=0,this._disposable=null,this._collapsed=null,this._disposed=!1};l.prototype={batch:function(t,e,n){var o=this,i=o._optimizedPaths,u=o._requestedPaths,a=o._callbacks,c=i.length;return i[c]=e,u[c]=t,a[c]=n,++o._count,o.scheduled||(o.scheduled=!0,o._disposable=o._scheduler.schedule(function(){s(o,i,function(t,e){if(o.requestQueue.removeRequest(o),o._disposed=!0,o._count){o._merge(u,t,e);for(var n=0,r=a.length;r>n;++n){var i=a[n];i&&i(t,e)}}})})),r(o,c)},add:function(t,e,n){var o,s,u=this,a=i(t,e,u._pathMap);a?(s=a[2],o=a[1]):(s=t,o=e);var c=!1,p=!1;if(o.lengthi){if(null==c){if(e)return!1;c=u[a]=Object.create(null)}if(this.insertPath(t,e,c,i+1,s)===!1)return!1}else u[a]=(c||0)+1,this.length+=1;h.done||(a=f(p,h))}while(!h.done);return!0},r.prototype.removePath=function(t,e,n,r){var o=n||0,i=r||t.length-1,s=e||this.pathmaps[i+1];if(void 0===s||null===s)return!0;var u,a,c=0,p=t[o],h={};u=f(p,h);do if(a=s[u],void 0!==a&&null!==a){if(i>o){c+=this.removePath(t,a,o+1,i);var l=void 0;for(l in a)break;void 0===l&&delete s[u]}else a=s[u]=(a||1)-1,0===a&&delete s[u],c+=1,this.length-=1;h.done||(u=f(p,h))}while(!h.done);return c},r.prototype.getSourceObserver=function(t){var e=this;return i.create(function(n){n.jsonGraph=n.jsonGraph||n.jsong||n.values||n.value,n.index=e.index,t.onNext(n)},function(e){t.onError(e)},function(){t.onCompleted()})},r.prototype._subscribe=function(t){var e=this,n=this.queue;e.pending=!0;var r=!1,o=new a,i=u.create(function(){r||(r=!0,n&&n._remove(e))}),s=new c(o,i);try{o.setDisposable(this.model._source[this.method](this.getSourceArgs()).subscribe(this.getSourceObserver(t)))}catch(h){throw new p(h)}return s},e.exports=r},{142:142,158:158,9:9}],55:[function(t,e,n){function r(t,e){this.total=0,this.model=t,this.requests=[],this.scheduler=e}var o=t(59),i=t(41),s=t(91),u=t(100),a=t(142);r.prototype.set=function(t){return t.paths=a.collapse(t.paths),o.create(this.model,t)},r.prototype._remove=function(t){var e=this.requests,n=e.indexOf(t);-1!==n&&e.splice(n,1)},r.prototype.distributePaths=function(t,e,n){var r,o,i=this.model,s=-1,u=t.length,a=-1,c=e.length,p=[];t:for(;++s-1;){for(var h=r[n-1],f=o[n-1],l=a[n-1]||(a[n-1]=Object.keys(f));l.length>0;){var d=l.pop();if(d[0]!==i)if(h.hasOwnProperty(d)){var v=h[d],y=s(v),b=f[d],m=s(b);if(u(v)&&u(b)&&!y&&!m){r[n]=v,o[n]=b,n+=1;continue t}p>c&&(h[d]=b)}else h[d]=f[d]}n-=1}return t},e.exports=r},{100:100,142:142,41:41,59:59,91:91}],56:[function(t,e,n){function r(t,e){this.model=t,this.scheduler=e,this.requests=this._requests=[]}var o=t(55),i=t(57);r.prototype.get=i.prototype.get,r.prototype.removeRequest=i.prototype.removeRequest,r.prototype.set=o.prototype.set,r.prototype.call=o.prototype.call,e.exports=r},{55:55,57:57}],57:[function(t,e,n){function r(t,e){this.model=t,this.scheduler=e,this.requests=this._requests=[]}var o=t(58),i=t(53);r.prototype={setScheduler:function(t){this.scheduler=t},get:function(t,e,n){function r(){v||(--h,0===h&&n())}var s,u,a,c=this,p=[],h=0,f=c._requests,l=e,d=t,v=!1;for(s=0,u=f.length;u>s;++s)if(a=f[s],a.type===o.GetRequest){if(a.sent){var y=a.add(d,l,r);y[0]&&(d=y[1],l=y[2],p[p.length]=y[3],++h)}else a.batch(d,l,r),l=[],d=[],++h;if(!l.length)break}if(l.length){a=new i(c.scheduler,c),f[f.length]=a,++h;var b=a.batch(d,l,r);p[p.length]=b}return function(){if(!v&&0!==h){v=!0;for(var t=p.length,e=0;t>e;++e)p[e]()}}},removeRequest:function(t){for(var e=this._requests,n=e.length;--n>=0;)if(e[n].id===t.id){e.splice(n,1);break}}},e.exports=r},{53:53,58:58}],58:[function(t,e,n){e.exports={GetRequest:"GET"}},{}],59:[function(t,e,n){function r(){s.call(this)}var o=t(158),i=o.Observer,s=t(54),u=t(84),a=t(77),c=t(79),p=new Array(0);r.create=function(t,e){var n=new r;return n.model=t,n.jsonGraphEnvelope=e,n},r.prototype=Object.create(s.prototype),r.prototype.constructor=r,r.prototype.method="set",r.prototype.insertPath=function(){return!1},r.prototype.removePath=function(){return 0},r.prototype.getSourceArgs=function(){return this.jsonGraphEnvelope},r.prototype.getSourceObserver=function(t){var e=this.model,n=e._path,r=this.jsonGraphEnvelope.paths,o=e._root,h=o.errorSelector,f=o.comparator;return s.prototype.getSourceObserver.call(this,i.create(function(o){e._path=p;var i=a(e,[{paths:r,jsonGraph:o.jsonGraph}],null,h,f);o.paths=i[1],e._path=n,t.onNext(o)},function(o){e._path=p,c(e,u(r,function(t){return{path:t,value:o}}),null,h,f),e._path=n,t.onError(o)},function(){t.onCompleted()}))},e.exports=r},{158:158,54:54,77:77,79:79,84:84}],60:[function(t,e,n){var r=t(142).hasIntersection,o=t(85);e.exports=function(t,e,n){for(var i=[],s=[],u=[],a=-1,c=-1,p=!1,h=0,f=e.length;f>h;++h){var l=e[h],d=n[l.length];d&&r(d,l,0)?(!p&&h>0&&(s=o(t,0,h),i=o(e,0,h)),u[++a]=t[h],p=!0):p&&(i[++c]=l,s[c]=t[h])}return p?[u,i,s]:null}},{142:142,85:85}],61:[function(t,e,n){var r=t(142),o=r.toTree,i=r.toPaths;e.exports=function(t,e,n){if(0===t._count)return void t.requestQueue.removeRequest(t);t.sent=!0,t.scheduled=!1;for(var r=t._pathMap,s=Object.keys(e),u=0,a=s.length;a>u;++u)for(var c=e[u],p=0,h=c.length;h>p;++p){var f=c[p],l=f.length;if(r[l]){var d=r[l];d[d.length]=f}else r[l]=[f]}for(var v=Object.keys(r),y=0,b=v.length;b>y;++y){var m=v[y];r[m]=o(r[m])}var g,w=t._collasped=i(r);t.requestQueue.model._source.get(w).subscribe(function(t){g=t},function(t){n(t,g)},function(){n(null,g)})}},{142:142}],62:[function(t,e,n){function r(t){u.call(this,t||i)}function o(t){return s.Observable.defer(function(){return t})}function i(t){function e(t){function e(t,e){if(Boolean(e.invalidated))t.invalidations.push(t.localThisPath.concat(e.path));else{var n=e.path,r=e.value;Boolean(r)&&"object"==typeof r&&r.$type===f?t.references.push({path:i(n),value:e.value}):t.values.push({path:i(n),value:e.value})}return t}function n(t){var e=t.values.concat(t.references);return e.length>0?o(g.set.apply(g,e)._toJSONG()).map(function(e){return{results:t,envelope:e}}):u["return"]({results:t,envelope:{jsonGraph:{},paths:[]}})}function r(t){var e,n=t.envelope,r=t.results,c=r.values,p=r.references,h=r.invalidations,f=c.map(a).map(i),l=p.reduce(s,[]),d=b.map(i),v=l.concat(d);return e=v.length>0?o(m.get.apply(m,f.concat(v))._toJSONG()):u["return"](n),e.doAction(function(t){t.invalidated=h})}function s(t,e){var n=e.path;return t.push.apply(t,y.map(function(t){return n.concat(t)})),t}function a(t){return t.path}var c=t&&t.localFn;if("function"==typeof c){var p=t.model,h=p._path,l=c.apply(p,v).reduce(e,{values:[],references:[],invalidations:[],localThisPath:h}).flatMap(n).flatMap(r);return u["return"](l)}return u.empty()}function n(t){function e(t){var e=t.invalidated;return e&&e.length&&m.invalidate.apply(m,e),t}return t&&"object"==typeof t?s.Observable.defer(function(){var e;try{e=t.call(x,v,y,b)}catch(n){e=u["throw"](new p(n))}return e}).map(e):u.empty()}function r(t){return o(g.set(t)).reduce(function(t){return t},null).map(function(){return{invalidated:t.invalidated,paths:t.paths.map(function(t){return t.slice(w.length)})}})}function i(t){ 2 | return _.concat(t)}var c=this.args,l=this.model,d=h.fromPath(c[0]),v=c[1]||[],y=(c[2]||[]).map(h.fromPath),b=(c[3]||[]).map(h.fromPath),m=l._clone({_path:[]}),g=m.withoutDataSource(),w=l._path,x=w.concat(d),_=x.slice(0,-1),S=o(l.withoutDataSource().get(d)).map(function(t){for(var e=t.json,n=-1,r=d.length;e&&++n0){var p="_"+n+a+"AsJSON",h=e[p];h(e,c)}}return t.onCompleted(),s.empty}var i=t(158),s=i.Disposable,u=t(63);r.create=u.create,r.prototype=Object.create(u.prototype),r.prototype.method="invalidate",r.prototype.constructor=r,e.exports=r},{158:158,63:63}],65:[function(t,e,n){function r(t){this._subscribe=t}function o(t){var e=this.model,n=new this.type;return n.model=e,n.args=this.args,n.outputFormat=t.outputFormat||"AsPathMap",n.isProgressive=t.isProgressive||!1,n.subscribeCount=0,n.subscribeLimit=t.retryLimit||10,n.initialize().invokeSourceRequest(e).ensureCollect(e).subscribe(t)}var i=t(33),s=t(158)&&t(157),u=s.Observable,a=t(85),c=t(105),p={outputFormat:{value:"AsJSONG"}},h={isProgressive:{value:!0}};r.create=function(t,e){var n=new r(o);return n.args=e,n.type=this,n.model=t,n},r.prototype=Object.create(u.prototype),r.prototype.constructor=r,r.prototype._mixin=function(){var t=this,e=a(arguments);return new t.constructor(function(n){return t.subscribe(e.reduce(function(t,e){return Object.create(t,e)},n))})},r.prototype._toJSONG=function(){return this._mixin(p)},r.prototype.progressively=function(){return this._mixin(h)},r.prototype.subscribe=function(t,e,n){var r=t;r&&"object"==typeof r||(r={onNext:t||c,onError:e||c,onCompleted:n||c});var o=this._subscribe(r);switch(typeof o){case"function":return{dispose:o};case"object":return o||{dispose:c};default:return{dispose:c}}},r.prototype.then=function(t,e){var n=this;return new i.Promise(function(t,e){var r,o=!1;n.toArray().subscribe(function(t){r=t.length<=1?t[0]:t},function(t){o=!0,e(t)},function(){o===!1&&t(r)})}).then(t,e)},e.exports=r},{105:105,157:157,158:158,33:33,85:85}],66:[function(t,e,n){function r(t){l.call(this,t||o)}function o(t){return this.isCompleted?s.call(this,t):i.call(this,t)}function i(t){if(this.subscribeCount++>this.subscribeLimit)return t.onError("Loop kill switch thrown."),h.empty;for(var e=[],n=[],r=this.model,o=this.isMaster,i=r._root,c=this.outputFormat,p=i.errorSelector,f=this.method,l=this.groups,d=-1,y=l.length;++d0){var w="_"+f+m+c,x=r[w],_=x(r,g,null,p);n.push.apply(n,_[1]),"PathValues"===m?e.push.apply(e,g.map(u)):"JSONGs"===m?e.push.apply(e,v(g,a)):e.push.apply(e,_[0])}}return this.requestedPaths=e,o?(this.isCompleted=!0,s.call(this,t)):void t.onError({method:f,optimizedPaths:n,invokeSourceRequest:!0})}function s(t){var e=new f(this.model,this.requestedPaths);return"AsJSONG"===this.outputFormat&&(e=e._toJSONG()),this.isProgressive&&(e=e.progressively()),e.subscribe(t)}function u(t){return t.path}function a(t){return t.paths}var c=t(158),p=c.Observable,h=c.Disposable,f=t(68),l=t(63),d=t(9),v=t(83),y=new Array(0);r.create=l.create,r.prototype=Object.create(l.prototype),r.prototype.method="set",r.prototype.constructor=r,r.prototype.invokeSourceRequest=function(t){var e=this,n=this["catch"](function(r){var o;if(r&&r.invokeSourceRequest===!0){var i={},s=t._path,u=r.optimizedPaths;t._path=y,t._getPathValuesAsJSONG(t._materialize().withoutDataSource(),u,[i]),t._path=s,o=t._request.set(i)["do"](function(t){e.isCompleted=u.length===t.paths.length},function(){e.isCompleted=!0}).materialize().flatMap(function(t){if("C"===t.kind)return p.empty();if("E"===t.kind){var e=t.exception;if(d.is(e))return p["throw"](t.exception)}return n})}else o=p["throw"](r);return o});return new this.constructor(function(t){return n.subscribe(t)})},e.exports=r},{158:158,63:63,68:68,83:83,9:9}],67:[function(t,e,n){var r=function(t){this.disposed=!1,this.currentDisposable=t};r.prototype={dispose:function(){if(!this.disposed&&this.currentDisposable){this.disposed=!0;var t=this.currentDisposable;t.dispose?t.dispose():t()}}},e.exports=r},{}],68:[function(t,e,n){var r=t(65),o=t(69),i=t(70),s={dispose:function(){}},u=t(158).Observable,a=e.exports=function(t,e,n,r){this.model=t,this.currentRemainingPaths=e,this.isJSONGraph=n||!1,this.isProgressive=r||!1};a.prototype=Object.create(u.prototype),a.prototype.subscribe=r.prototype.subscribe,a.prototype.then=r.prototype.then,a.prototype._toJSONG=function(){return new a(this.model,this.currentRemainingPaths,!0,this.isProgressive)},a.prototype.progressively=function(){return new a(this.model,this.currentRemainingPaths,this.isJSONGraph,!0)},a.prototype._subscribe=function(t){var e=[{}],n=[],r=t.isJSONG=this.isJSONGraph,u=this.isProgressive,a=o(this.model,this.currentRemainingPaths,t,u,r,e,n);return a?i(this,this.model,a,t,e,n,1):s}},{158:158,65:65,69:69,70:70}],69:[function(t,e,n){var r=t(20),o=r.getWithPathsAsJSONGraph,i=r.getWithPathsAsPathMap;e.exports=function(t,e,n,r,s,u,a){var c;if(c=s?o(t,e,u):i(t,e,u),c.criticalError)return n.onError(c.criticalError),null;var p=c.hasValue,h=!c.requestedMissingPaths||!t._source;if(c.errors)for(var f=c.errors,l=a.length,d=0,v=f.length;v>d;++d,++l)a[l]=f[d];if(p&&(r||h))try{++t._root.syncRefCount,n.onNext(u[0])}catch(y){throw y}finally{--t._root.syncRefCount}return h?(a.length?n.onError(a):n.onCompleted(),null):c}},{20:20}],70:[function(t,e,n){var r=t(69),o=t(10),i=t(31).fastCat,s=t(50),u=t(89),a=t(67),c=t(47);e.exports=function p(t,e,n,h,f,l,d){if(10===d)throw new o;var v=e._request,y=n.requestedMissingPaths,b=n.optimizedMissingPaths,m=new a,g=[],w=e._path;if(w.length)for(var x=0,_=y.length;_>x;++x)g[x]=i(w,y[x]);else g=y;var S=v.get(g,b,function(){var n=r(e,y,h,t.isProgressive,t.isJSONGraph,f,l);if(n)m.currentDisposable=p(t,e,n,h,f,l,d+1);else{var o=e._root,i=o.cache,a=i[c];s(o,o.expired,u(i),e._maxSize,e._collectRatio,a)}});return m.currentDisposable=S,m}},{10:10,31:31,47:47,50:50,67:67,69:69,89:89}],71:[function(t,e,n){var r=t(68);e.exports=function(t){return new r(this,t)}},{68:68}],72:[function(t,e,n){var r=t(133),o=t(65),i=t(73),s=t(115),u=t(68);e.exports=function(){var t=s(arguments,i,"get");if(t!==!0)return new o(function(e){e.onError(t)});var e=r.fromPathsOrPathValues(arguments);return new u(this,e)}},{115:115,133:133,65:65,68:68,73:73}],73:[function(t,e,n){e.exports={path:!0,pathSyntax:!0}},{}],74:[function(t,e,n){function r(){}var o=t(122),i=t(158),s=i.Disposable;r.prototype.schedule=function(t){return o(t),s.empty},r.prototype.scheduleWithState=function(t,e){var n=this;return o(function(){e(n,t)}),s.empty},e.exports=r},{122:122,158:158}],75:[function(t,e,n){function r(){}var o=t(158),i=o.Disposable;r.prototype.schedule=function(t){return t(),i.empty},r.prototype.scheduleWithState=function(t,e){return e(this,t),i.empty},e.exports=r},{158:158}],76:[function(t,e,n){function r(t){this.delay=t}var o=t(158),i=o.Disposable;r.prototype.schedule=function(t){var e=setTimeout(t,this.delay);return i.create(function(){void 0!==e&&(clearTimeout(e),e=void 0)})},r.prototype.scheduleWithState=function(t,e){var n=this,r=setTimeout(function(){e(n,t)},this.delay);return i.create(function(){void 0!==r&&(clearTimeout(r),r=void 0)})},e.exports=r},{158:158}],77:[function(t,e,n){function r(t,e,n,o,s,u,a,c,p,h,f,d,v,y,b,g,w){for(var x={},_=ex,k=i(t,E,e,n,C,r,A,N,!0,o,s,c,f,v,m,g);if(e=k[0],y(e))return s.index=x,k;E=k[1],r=k[2],C=k[3]}while(x++=x)break;h.index=_}}function o(t,e,n,r,o,s,u,c,f,v){var y=n.value;if(o.splice(0,o.length),o.push.apply(o,y),x(n))return o.index=y.length,E(n,u,c),[void 0,e];m(c,n);var b=n,g=e;if(n=n[h],null!=n)g=n[p]||e,o.index=y.length;else{var w=0,_=y.length-1;g=n=e;do{var C=y[w],A=_>w,N=i(e,g,n,C,t,A,!0,r,o,s,u,c,f,v);if(n=N[0],S(n))return o.index=w,N;g=N[1]}while(w++<_);if(o.index=w,b[h]!==n){var k=n[d]||0;n[d]=k+1,n[a+k]=b,b[h]=n,b[l]=k}}return[n,g]}function i(t,e,n,r,i,s,a,c,p,h,f,l,d,y){for(var b=n.$type;b===v;){var m=o(i,t,n,c,p,h,f,l,d,y);if(n=m[0],S(n))return m;e=m[1],b=n&&n.$type}if(void 0!==b)return[n,e];if(null==r){if(s)throw new Error("`null` is not allowed in branch key positions.");n&&(r=n[u])}else e=n,n=e[r];return n=A(e,n,r,i,s,a,c,p,h,f,l,d,y),[n,e]}function s(t){if(w(t)&&!t.$type){var e=[],n=0;b(t)&&(e[n++]="length");for(var r in t)r[0]!==c&&"$"!==r[0]&&g(t,r)&&(e[n++]=r);return e}return void 0}var u=t(37),a=t(44),c=t(41),p=t(40),h=t(34),f=t(47),l=t(43),d=t(45),v=t(119),y=t(14),b=Array.isArray,m=t(51),g=t(92),w=t(100),x=t(96),_=t(97),S=t(102),E=t(87),C=t(93),A=t(104);e.exports=function(t,e,n,o,i){for(var s=t._root,u=s,a=s.expired,c=C(),h=t._path,l=s.cache,d=h.length?y(t,h).value:l,v=d[p]||l,b=l[f],m=[],g=[],w=[],x=h.length,S=-1,E=e.length;++SS,N=i(e,_,n,C,t,A,!0,r,o,s,p,l,d,b);if(n=N[0],m(n))return o.index=S,N;_=N[1]}while(S++i&&(i=0),n>0&&i>n&&(i=n);for(var s=new Array(i);++oD)return void 0}if(N&&P&&!k)return d(y(e,n,t,m,S),t,m);if(k||!P){if(k&&e===n)null==e[o]&&(e=l(e,N,e.value),t=b(t,-e.$size,S,x),e=d(e,t,m,x));else{var q=!0;(N||!O)&&(q=a(n)-1);return t}},{40:40,44:44,45:45,47:47}],114:[function(t,e,n){var r=t(37),o=t(47),i=t(40),s=t(107),u=t(113);e.exports=function(t,e,n,a){var c=t;do{var p=c[i],h=c.$size=(c.$size||0)-e;0>=h&&null!=p?s(c,p,c[r],n):c[o]!==a&&u(c,a),c=p}while(c);return t}},{107:107,113:113,37:37,40:40,47:47}],115:[function(t,e,n){var r=Array.isArray,o=t(101),i=t(99),s=t(98),u=t(133);e.exports=function(t,e,n){for(var a=0,c=t.length;c>a;++a){var p=t[a],h=!1;if(r(p)&&e.path?h=!0:"string"==typeof p&&e.pathSyntax?h=!0:o(p)&&e.pathValue?(p.path=u.fromPath(p.path),h=!0):i(p)&&e.jsonGraph?h=!0:s(p)&&e.json?h=!0:"function"==typeof p&&a+1===c&&e.selector&&(h=!0),!h)return new Error("Unrecognized argument "+typeof p+" ["+String(p)+"] to Model#"+n)}return!0}},{101:101,133:133,98:98,99:99}],116:[function(t,e,n){var r=t(129),o=r.atom,i=t(106),s=t(121),u=t(38),a=50,c=t(86),p=Array.isArray,h=t(89),f=t(88);e.exports=function(t,e,n){var r=0,l=t,d=e;if(d?(l=c(l),r=h(l),l.$type=d):(l=o(n),d=l.$type,l[u]=!0),null==n)r=a+1;else if(null==r||0>=r)switch(typeof n){case"object":r=p(n)?a+n.length:a+1;break;case"string":r=a+n.length;break;default:r=a+1}var v=f(l);return"number"==typeof v&&s>v&&(l.$expires=i()+-1*v),l.$size=r,l}},{106:106,121:121,129:129,38:38,86:86,88:88,89:89}],117:[function(t,e,n){e.exports="atom"},{}],118:[function(t,e,n){e.exports="error"},{}],119:[function(t,e,n){e.exports="ref"},{}],120:[function(t,e,n){e.exports=1},{}],121:[function(t,e,n){e.exports=0},{}],122:[function(t,e,n){"use strict";function r(){if(a.length)throw a.shift()}function o(t){var e;e=u.length?u.pop():new i,e.task=t,s(e)}function i(){this.task=null}var s=t(123),u=[],a=[],c=s.makeRequestCallFromTimer(r);e.exports=o,i.prototype.call=function(){try{this.task.call()}catch(t){o.onerror?o.onerror(t):(a.push(t),c())}finally{this.task=null,u[u.length]=this}}},{123:123}],123:[function(t,e,n){(function(t){"use strict";function n(t){u.length||(s(),a=!0),u[u.length]=t}function r(){for(;cp){for(var e=0,n=u.length-c;n>e;e++)u[e]=u[e+c];u.length-=c,c=0}}u.length=0,c=0,a=!1}function o(t){var e=1,n=new h(t),r=document.createTextNode("");return n.observe(r,{characterData:!0}),function(){e=-e,r.data=e}}function i(t){return function(){function e(){clearTimeout(n),clearInterval(r),t()}var n=setTimeout(e,0),r=setInterval(e,50)}}e.exports=n;var s,u=[],a=!1,c=0,p=1024,h=t.MutationObserver||t.WebKitMutationObserver;s="function"==typeof h?o(r):i(r),n.requestFlush=s,n.makeRequestCallFromTimer=i}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],124:[function(t,e,n){"use strict";function r(t,e){var n;for(n in e)t[n]=e[n];return t}function o(t,e){if(this._jsongUrl=t,"number"==typeof e){var n={timeout:e};e=n}this._config=r({timeout:15e3,headers:{}},e||{})}var i=t(128),s=t(125);Array.isArray;o.prototype={constructor:o,buildQueryObject:s,get:function(t){var e="GET",n=this.buildQueryObject(this._jsongUrl,e,{paths:t,method:"get"}),o=r(n,this._config),s=this;return i(e,o,s)},set:function(t){var e="POST",n=this.buildQueryObject(this._jsongUrl,e,{jsonGraph:t,method:"set"}),o=r(n,this._config);o.headers["Content-Type"]="application/x-www-form-urlencoded";var s=this;return i(e,o,s)},call:function(t,e,n,o){e=e||[],n=n||[],o=o||[];var s="POST",u=[];u.push("method=call"),u.push("callPath="+encodeURIComponent(JSON.stringify(t))),u.push("arguments="+encodeURIComponent(JSON.stringify(e))),u.push("pathSuffixes="+encodeURIComponent(JSON.stringify(n))),u.push("paths="+encodeURIComponent(JSON.stringify(o)));var a=this.buildQueryObject(this._jsongUrl,s,u.join("&")),c=r(a,this._config);c.headers["Content-Type"]="application/x-www-form-urlencoded";var p=this;return i(s,c,p)}},o.XMLHttpSource=o,o["default"]=o,e.exports=o},{125:125,128:128}],125:[function(t,e,n){"use strict";e.exports=function(t,e,n){var r,o=[],i={url:t},s=-1!==t.indexOf("?"),u=s?"&":"?";return"string"==typeof n?o.push(n):(r=Object.keys(n),r.forEach(function(t){var e="object"==typeof n[t]?JSON.stringify(n[t]):n[t];o.push(t+"="+e)})),"GET"===e?i.url+=u+o.join("&"):i.data=o.join("&"),i}},{}],126:[function(t,e,n){(function(t){"use strict";e.exports=function(){var e=new t.XMLHttpRequest;if("withCredentials"in e)return e;if(t.XDomainRequest)return new XDomainRequest;throw new Error("CORS is not supported by your browser")}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],127:[function(t,e,n){(function(t){"use strict";e.exports=function(){var e,n,r;if(t.XMLHttpRequest)return new t.XMLHttpRequest;try{for(n=["Msxml2.XMLHTTP","Microsoft.XMLHTTP","Msxml2.XMLHTTP.4.0"],r=0;3>r;r++)try{if(e=n[r],new t.ActiveXObject(e))break}catch(o){}return new t.ActiveXObject(e)}catch(o){throw new Error("XMLHttpRequest is not supported by your browser")}}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],128:[function(t,e,n){"use strict";function r(){}function o(t,e,n){return r.create(function(r){var o,i,h,f,l,d={method:t||"GET",crossDomain:!1,async:!0,headers:{},responseType:"json"};for(l in e)p.call(e,l)&&(d[l]=e[l]);d.crossDomain||d.headers["X-Requested-With"]||(d.headers["X-Requested-With"]="XMLHttpRequest"),null!=n.onBeforeRequest&&n.onBeforeRequest(d);try{o=d.crossDomain?c():a()}catch(v){r.onError(v)}try{d.user?o.open(d.method,d.url,d.async,d.user,d.password):o.open(d.method,d.url,d.async),o.timeout=d.timeout,o.withCredentials=d.withCredentials!==!1,h=d.headers;for(f in h)p.call(h,f)&&o.setRequestHeader(f,h[f]);if(d.responseType)try{o.responseType=d.responseType}catch(y){if("json"!==d.responseType)throw y}o.onreadystatechange=function(t){4===o.readyState&&(i||(i=!0,s(r,o,t)))},o.ontimeout=function(t){i||(i=!0,u(r,o,"timeout error",t))},o.send(d.data)}catch(y){r.onError(y)}return function(){i||4===o.readyState||(i=!0,o.abort())}})}function i(t,e,n){n||(n=new Error(e)),t.onError(n)}function s(t,e,n){var r,o;if(e&&t){o=e.responseType,r="response"in e?e.response:e.responseText;var s=1223===e.status?204:e.status;if(s>=200&&399>=s){try{"json"!==o&&(r=JSON.parse(r||"")),"string"==typeof r&&(r=JSON.parse(r||""))}catch(n){i(t,"invalid json",n)}return t.onNext(r),void t.onCompleted()}return 401===s||403===s||407===s?i(t,r):410===s?i(t,r):408===s||504===s?i(t,r):i(t,r||"Response code "+s)}}function u(t,e,n,r){i(t,n||e.statusText||"request error",r)}var a=t(127),c=t(126),p=Object.prototype.hasOwnProperty,h=function(){};r.create=function(t){var e=new r;return e.subscribe=function(e,n,r){var o,i;return o="function"==typeof e?{onNext:e,onError:n||h,onCompleted:r||h}:e,i=t(o),"function"==typeof i?{dispose:i}:i},e},e.exports=o},{126:126,127:127}],129:[function(t,e,n){function r(t,e,n){var r=Object.create(null);if(null!=n){for(var o in n)r[o]=n[o];return r.$type=t,r.value=e,r}return{$type:t,value:e}}var o=t(133);e.exports={ref:function(t,e){return r("ref",o.fromPath(t),e)},atom:function(t,e){return r("atom",t,e)},undefined:function(){return r("atom")},error:function(t,e){return r("error",t,e)},pathValue:function(t,e){return{path:o.fromPath(t),value:e}},pathInvalidation:function(t){return{path:o.fromPath(t),invalidated:!0}}}},{133:133}],130:[function(t,e,n){e.exports={integers:"integers",ranges:"ranges",keys:"keys"}},{}],131:[function(t,e,n){var r={token:"token",dotSeparator:".",commaSeparator:",",openingBracket:"[",closingBracket:"]",openingBrace:"{",closingBrace:"}",escape:"\\",space:" ",colon:":",quote:"quote",unknown:"unknown"};e.exports=r},{}],132:[function(t,e,n){e.exports={indexer:{nested:"Indexers cannot be nested.",needQuotes:"unquoted indexers must be numeric.",empty:"cannot have empty indexers.",leadingDot:"Indexers cannot have leading dots.",leadingComma:"Indexers cannot have leading comma.",requiresComma:"Indexers require commas between indexer args.",routedTokens:"Only one token can be used per indexer when specifying routed tokens."},range:{precedingNaN:"ranges must be preceded by numbers.",suceedingNaN:"ranges must be suceeded by numbers."},routed:{invalid:"Invalid routed token. only integers|ranges|keys are supported."},quote:{empty:"cannot have empty quoted keys.",illegalEscape:"Invalid escape character. Only quotes are escapable."},unexpectedToken:"Unexpected token.",invalidIdentifier:"Invalid Identifier.",invalidPath:"Please provide a valid path.",throwError:function(t,e,n){if(n)throw t+" -- "+e.parseString+" with next token: "+n;throw t+" -- "+e.parseString}}},{}],133:[function(t,e,n){var r=t(139),o=t(134),i=t(130),s=function(t,e){return o(new r(t,e))};e.exports=s,s.fromPathsOrPathValues=function(t,e){if(!t)return[];for(var n=[],r=0,o=t.length;o>r;r++)"string"==typeof t[r]?n[r]=s(t[r],e):"string"==typeof t[r].path?n[r]={path:s(t[r].path,e),value:t[r].value}:n[r]=t[r];return n},s.fromPath=function(t,e){return t?"string"==typeof t?s(t,e):t:[]},s.RoutedTokens=i},{130:130,134:134,139:139}],134:[function(t,e,n){var r=t(131),o=t(132),i=t(135);e.exports=function(t){for(var e=t.next(),n={},s=[];!e.done;){switch(e.type){case r.token:var u=+e.token[0];isNaN(u)||o.throwError(o.invalidIdentifier,t),s[s.length]=e.token;break;case r.dotSeparator:0===s.length&&o.throwError(o.unexpectedToken,t);break;case r.space:break;case r.openingBracket:i(t,e,n,s);break;default:o.throwError(o.unexpectedToken,t)}e=t.next()}return 0===s.length&&o.throwError(o.invalidPath,t),s}},{131:131,132:132,135:135}],135:[function(t,e,n){var r=t(131),o=t(132),i=o.indexer,s=t(137),u=t(136),a=t(138);e.exports=function(t,e,n,c){var p=t.next(),h=!1,f=1,l=!1;for(n.indexer=[];!p.done;){switch(p.type){case r.token:case r.quote:n.indexer.length===f&&o.throwError(i.requiresComma,t)}switch(p.type){case r.openingBrace:l=!0,a(t,p,n,c);break;case r.token:var d=+p.token;isNaN(d)&&o.throwError(i.needQuotes,t),n.indexer[n.indexer.length]=d;break;case r.dotSeparator:n.indexer.length||o.throwError(i.leadingDot,t),s(t,p,n,c);break;case r.space:break;case r.closingBracket:h=!0;break;case r.quote:u(t,p,n,c);break;case r.openingBracket:o.throwError(i.nested,t);break;case r.commaSeparator:++f;break;default:o.throwError(o.unexpectedToken,t)}if(h)break;p=t.next()}0===n.indexer.length&&o.throwError(i.empty,t),n.indexer.length>1&&l&&o.throwError(i.routedTokens,t),1===n.indexer.length&&(n.indexer=n.indexer[0]),c[c.length]=n.indexer,n.indexer=void 0}},{131:131,132:132,136:136,137:137,138:138}],136:[function(t,e,n){var r=t(131),o=t(132),i=o.quote;e.exports=function(t,e,n,s){ 3 | for(var u=t.next(),a="",c=e.token,p=!1,h=!1;!u.done;){switch(u.type){case r.token:case r.space:case r.dotSeparator:case r.commaSeparator:case r.openingBracket:case r.closingBracket:case r.openingBrace:case r.closingBrace:p&&o.throwError(i.illegalEscape,t),a+=u.token;break;case r.quote:p?(a+=u.token,p=!1):u.token!==c?a+=u.token:h=!0;break;case r.escape:p=!0;break;default:o.throwError(o.unexpectedToken,t)}if(h)break;u=t.next()}0===a.length&&o.throwError(i.empty,t),n.indexer[n.indexer.length]=a}},{131:131,132:132}],137:[function(t,e,n){var r=t(139),o=t(131),i=t(132);e.exports=function(t,e,n,s){var u,a=t.peek(),c=1,p=!1,h=!0,f=n.indexer.length-1,l=r.toNumber(n.indexer[f]);for(isNaN(l)&&i.throwError(i.range.precedingNaN,t);!p&&!a.done;){switch(a.type){case o.dotSeparator:3===c&&i.throwError(i.unexpectedToken,t),++c,3===c&&(h=!1);break;case o.token:u=r.toNumber(t.next().token),isNaN(u)&&i.throwError(i.range.suceedingNaN,t),p=!0;break;default:p=!0}if(p)break;t.next(),a=t.peek()}n.indexer[f]={from:l,to:h?u:u-1}}},{131:131,132:132,139:139}],138:[function(t,e,n){var r=t(131),o=t(130),i=t(132),s=i.routed;e.exports=function(t,e,n,u){var a=t.next(),c=!1,p="";switch(a.token){case o.integers:case o.ranges:case o.keys:break;default:i.throwError(s.invalid,t)}var h=t.next();if(h.type===r.colon&&(c=!0,h=t.next(),h.type!==r.token&&i.throwError(s.invalid,t),p=h.token,h=t.next()),h.type===r.closingBrace){var f={type:a.token,named:c,name:p};n.indexer[n.indexer.length]=f}else i.throwError(s.invalid,t)}},{130:130,131:131,132:132}],139:[function(t,e,n){function r(t,e,n){return{token:t,done:n,type:e}}function o(t,e,n){var o,g=!1,w="",x=n?m:b;do{if(o=e+1>=t.length)break;var _=t[e+1];if(void 0===_||-1!==x.indexOf(_)){if(w.length)break;++e;var S;switch(_){case s:S=i.dotSeparator;break;case u:S=i.commaSeparator;break;case a:S=i.openingBracket;break;case c:S=i.closingBracket;break;case p:S=i.openingBrace;break;case h:S=i.closingBrace;break;case y:S=i.space;break;case d:case v:S=i.quote;break;case l:S=i.escape;break;case f:S=i.colon;break;default:S=i.unknown}g=r(_,S,!1);break}w+=_,++e}while(!o);return!g&&w.length&&(g=r(w,i.token,!1)),g||(g={done:!0}),{token:g,idx:e}}var i=t(131),s=".",u=",",a="[",c="]",p="{",h="}",f=":",l="\\",d='"',v="'",y=" ",b="\\'\"[]., ",m="\\{}'\"[]., :",g=e.exports=function(t,e){this._string=t,this._idx=-1,this._extended=e,this.parseString=""};g.prototype={next:function(){var t=this._nextToken?this._nextToken:o(this._string,this._idx,this._extended);return this._idx=t.idx,this._nextToken=!1,this.parseString+=t.token.token,t.token},peek:function(){var t=this._nextToken?this._nextToken:o(this._string,this._idx,this._extended);return this._nextToken=t,t.token}},g.toNumber=function(t){return isNaN(+t)?NaN:+t}},{131:131}],140:[function(t,e,n){var r=t(146),o=t(147);e.exports=function(t){var e=t.reduce(function(t,e){var n=e.length;return t[n]||(t[n]=[]),t[n].push(e),t},{});return Object.keys(e).forEach(function(t){e[t]=o(e[t])}),r(e)}},{146:146,147:147}],141:[function(t,e,n){var r=t(143);e.exports=function o(t,e,n){for(var i=t,s=!0;s&&nr&&(e.empty=!0)}function o(t,e){e.done=!1;var n=e.isObject=!(!t||"object"!=typeof t);e.isArray=n&&i(t),e.arrayOffset=0}var i=Array.isArray;e.exports=function(t,e){if(void 0===e.isArray&&o(t,e),e.isArray){var n;do{e.loaded&&e.rangeOffset>e.to&&(++e.arrayOffset,e.loaded=!1);var i=e.arrayOffset,s=t.length;if(i>=s){e.done=!0;break}var u=t[e.arrayOffset],a=typeof u;if("object"===a){if(e.loaded||r(u,e),e.empty)continue;n=e.rangeOffset++}else++e.arrayOffset,n=u}while(void 0===n);return n}return e.isObject?(e.loaded||r(t,e),e.rangeOffset>e.to?void(e.done=!0):e.rangeOffset++):(e.done=!0,t)}},{}],144:[function(t,e,n){var r=t(141);e.exports=function(t,e){for(var n=[],o=-1,i=0,s=t.length;s>i;++i){var u=t[i];r(e[u.length],u,0)||(n[++o]=u)}return n}},{141:141}],145:[function(t,e,n){var r=t(141);e.exports=function(t,e){for(var n=[],o=-1,i=0,s=t.length;s>i;++i)r(e,t[i],0)||(n[++o]=t[i]);return n}},{141:141}],146:[function(t,e,n){function r(t){return null!==t&&typeof t===f}function o(t,e,n){var r,i,s,u,h,f,l,d,v,y,b,m,g,w,x=c(String(e)),_=Object.create(null),S=[],E=-1,C=0,A=[],N=0;if(u=[],h=-1,n-1>e){for(f=a(t,u);++h0)for(l=i.sets,d=-1,v=l.length,g=u[0];++d1&&u||g;++b1?A[N++]=[u]:A[N++]=u;++h0;++e<=n;){var o=t[e];if(!p(o)){r=!1;break}t[e]=parseInt(o,10)}if(r===!0){t.sort(u);var i=t[0],s=t[n];if(n>=s-i)return{from:i,to:s}}return t}function u(t,e){return t-e}function a(t,e,n){var r=0;for(var o in t)e[r++]=o;return r>1&&e.sort(n),r}function c(t){for(var e=5381,n=-1,r=t.length;++n=0}var h=Array.isArray,f="object";e.exports=function(t){var e,n=[],s=0;for(var u in t)if(p(u)&&r(e=t[u]))for(var a=o(e,0,parseInt(u,10)).sets,c=-1,h=a.length;++c1)for(var n=1;n0?e:0);return new r(function(e,r){o.push(function(t,n){t?r(t):e(n)});var i=t.apply(n,o);!i||"object"!=typeof i&&"function"!=typeof i||"function"!=typeof i.then||e(i)})}},r.nodeify=function(t){return function(){var e=Array.prototype.slice.call(arguments),n="function"==typeof e[e.length-1]?e.pop():null,i=this;try{return t.apply(this,arguments).nodeify(n,i)}catch(s){if(null===n||"undefined"==typeof n)return new r(function(t,e){e(s)});o(function(){n.call(i,s)})}}},r.prototype.nodeify=function(t,e){return"function"!=typeof t?this:void this.then(function(n){o(function(){t.call(e,null,n)})},function(n){o(function(){t.call(e,n)})})}},{122:122,151:151}],157:[function(e,n,r){(function(o){(function(i){var s={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},u=s[typeof window]&&window||this,a=s[typeof r]&&r&&!r.nodeType&&r,c=s[typeof n]&&n&&!n.nodeType&&n,p=(c&&c.exports===a&&a,s[typeof o]&&o);!p||p.global!==p&&p.window!==p||(u=p),"function"==typeof t&&t.amd?t(["rx"],function(t,e){return i(u,e,t)}):"object"==typeof n&&n&&n.exports===a?n.exports=i(u,n.exports,e(158)):u.Rx=i(u,{},u.Rx)}).call(this,function(t,e,n,r){function o(){try{return l.apply(this,arguments)}catch(t){return M.e=t,M}}function i(t){if(!E(t))throw new TypeError("fn must be a function");return l=t,o}function s(t,e,n){return new b(function(r){var o=!1,i=null,s=[];return t.subscribe(function(t){var u,a;try{a=e(t)}catch(c){return void r.onError(c)}if(u=0,o)try{u=n(a,i)}catch(p){return void r.onError(p)}else o=!0,i=a;u>0&&(i=a,s=[]),u>=0&&s.push(t)},function(t){r.onError(t)},function(){r.onNext(s),r.onCompleted()})},t)}function u(t){if(0===t.length)throw new D;return t[0]}function a(t,e,n,r){if(0>e)throw new R;return new b(function(o){var i=e;return t.subscribe(function(t){0===i--&&(o.onNext(t),o.onCompleted())},function(t){o.onError(t)},function(){n?(o.onNext(r),o.onCompleted()):o.onError(new R)})},t)}function c(t,e,n){return new b(function(r){var o=n,i=!1;return t.subscribe(function(t){i?r.onError(new Error("Sequence contains more than one element")):(o=t,i=!0)},function(t){r.onError(t)},function(){i||e?(r.onNext(o),r.onCompleted()):r.onError(new D)})},t)}function p(t,e,n){return new b(function(r){return t.subscribe(function(t){r.onNext(t),r.onCompleted()},function(t){r.onError(t)},function(){e?(r.onNext(n),r.onCompleted()):r.onError(new D)})},t)}function h(t,e,n){return new b(function(r){var o=n,i=!1;return t.subscribe(function(t){o=t,i=!0},function(t){r.onError(t)},function(){i||e?(r.onNext(o),r.onCompleted()):r.onError(new D)})},t)}function f(t,e,n,o){var i=j(e,n,3);return new b(function(e){var n=0;return t.subscribe(function(r){var s;try{s=i(r,n,t)}catch(u){return void e.onError(u)}s?(e.onNext(o?n:r),e.onCompleted()):n++},function(t){e.onError(t)},function(){e.onNext(o?-1:r),e.onCompleted()})},t)}var l,d=n.Observable,v=d.prototype,y=n.CompositeDisposable,b=n.AnonymousObservable,m=n.Disposable.empty,g=(n.internals.isEqual,n.helpers),w=g.not,x=g.defaultComparer,_=g.identity,S=g.defaultSubComparer,E=g.isFunction,C=g.isPromise,A=g.isArrayLike,N=g.isIterable,k=n.internals.inherits,O=d.fromPromise,P=d.from,j=n.internals.bindCallback,D=n.EmptyError,q=n.ObservableBase,R=n.ArgumentOutOfRangeError,M={e:{}};v.aggregate=function(){var t,e,n=!1,r=this;return 2===arguments.length?(n=!0,e=arguments[0],t=arguments[1]):t=arguments[0],new b(function(o){var i,s,u;return r.subscribe(function(r){!u&&(u=!0);try{i?s=t(s,r):(s=n?t(e,r):r,i=!0)}catch(a){return o.onError(a)}},function(t){o.onError(t)},function(){u&&o.onNext(s),!u&&n&&o.onNext(e),!u&&!n&&o.onError(new D),o.onCompleted()})},r)};var T=function(t){function e(e,n,r,o){this.source=e,this.acc=n,this.hasSeed=r,this.seed=o,t.call(this)}function n(t,e){this.o=t,this.acc=e.acc,this.hasSeed=e.hasSeed,this.seed=e.seed,this.hasAccumulation=!1,this.result=null,this.hasValue=!1,this.isStopped=!1}return k(e,t),e.prototype.subscribeCore=function(t){return this.source.subscribe(new n(t,this))},n.prototype.onNext=function(t){this.isStopped||(!this.hasValue&&(this.hasValue=!0),this.hasAccumulation?this.result=i(this.acc)(this.result,t):(this.result=this.hasSeed?i(this.acc)(this.seed,t):t,this.hasAccumulation=!0),this.result===M&&this.o.onError(this.result.e))},n.prototype.onError=function(t){this.isStopped||(this.isStopped=!0,this.o.onError(t))},n.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.hasValue&&this.o.onNext(this.result),!this.hasValue&&this.hasSeed&&this.o.onNext(this.seed),!this.hasValue&&!this.hasSeed&&this.o.onError(new D),this.o.onCompleted())},n.prototype.dispose=function(){this.isStopped=!0},n.prototype.fail=function(t){return this.isStopped?!1:(this.isStopped=!0,this.o.onError(t),!0)},e}(q);return v.reduce=function(t){var e=!1;if(2===arguments.length){e=!0;var n=arguments[1]}return new T(this,t,e,n)},v.some=function(t,e){var n=this;return t?n.filter(t,e).some():new b(function(t){return n.subscribe(function(){t.onNext(!0),t.onCompleted()},function(e){t.onError(e)},function(){t.onNext(!1),t.onCompleted()})},n)},v.any=function(){return this.some.apply(this,arguments)},v.isEmpty=function(){return this.any().map(w)},v.every=function(t,e){return this.filter(function(e){return!t(e)},e).some().map(w)},v.all=function(){return this.every.apply(this,arguments)},v.includes=function(t,e){function n(t,e){return 0===t&&0===e||t===e||isNaN(t)&&isNaN(e)}var r=this;return new b(function(o){var i=0,s=+e||0;return Math.abs(s)===1/0&&(s=0),0>s?(o.onNext(!1),o.onCompleted(),m):r.subscribe(function(e){i++>=s&&n(e,t)&&(o.onNext(!0),o.onCompleted())},function(t){o.onError(t)},function(){o.onNext(!1),o.onCompleted()})},this)},v.contains=function(t,e){v.includes(t,e)},v.count=function(t,e){return t?this.filter(t,e).count():this.reduce(function(t){return t+1},0)},v.indexOf=function(t,e){var n=this;return new b(function(r){var o=0,i=+e||0;return Math.abs(i)===1/0&&(i=0),0>i?(r.onNext(-1),r.onCompleted(),m):n.subscribe(function(e){o>=i&&e===t&&(r.onNext(o),r.onCompleted()),o++},function(t){r.onError(t)},function(){r.onNext(-1),r.onCompleted()})},n)},v.sum=function(t,e){return t&&E(t)?this.map(t,e).sum():this.reduce(function(t,e){return t+e},0)},v.minBy=function(t,e){return e||(e=S),s(this,t,function(t,n){return-1*e(t,n)})},v.min=function(t){return this.minBy(_,t).map(function(t){return u(t)})},v.maxBy=function(t,e){return e||(e=S),s(this,t,e)},v.max=function(t){return this.maxBy(_,t).map(function(t){return u(t)})},v.average=function(t,e){return t&&E(t)?this.map(t,e).average():this.reduce(function(t,e){return{sum:t.sum+e,count:t.count+1}},{sum:0,count:0}).map(function(t){if(0===t.count)throw new D;return t.sum/t.count})},v.sequenceEqual=function(t,e){var n=this;return e||(e=x),new b(function(r){var o=!1,i=!1,s=[],u=[],a=n.subscribe(function(t){var n,o;if(u.length>0){o=u.shift();try{n=e(o,t)}catch(a){return void r.onError(a)}n||(r.onNext(!1),r.onCompleted())}else i?(r.onNext(!1),r.onCompleted()):s.push(t)},function(t){r.onError(t)},function(){o=!0,0===s.length&&(u.length>0?(r.onNext(!1),r.onCompleted()):i&&(r.onNext(!0),r.onCompleted()))});(A(t)||N(t))&&(t=P(t)),C(t)&&(t=O(t));var c=t.subscribe(function(t){var n;if(s.length>0){var i=s.shift();try{n=e(i,t)}catch(a){return void r.onError(a)}n||(r.onNext(!1),r.onCompleted())}else o?(r.onNext(!1),r.onCompleted()):u.push(t)},function(t){r.onError(t)},function(){i=!0,0===u.length&&(s.length>0?(r.onNext(!1),r.onCompleted()):o&&(r.onNext(!0),r.onCompleted()))});return new y(a,c)},n)},v.elementAt=function(t){return a(this,t,!1)},v.elementAtOrDefault=function(t,e){return a(this,t,!0,e)},v.single=function(t,e){return t&&E(t)?this.where(t,e).single():c(this,!1)},v.singleOrDefault=function(t,e,n){return t&&E(t)?this.filter(t,n).singleOrDefault(null,e):c(this,!0,e)},v.first=function(t,e){return t?this.where(t,e).first():p(this,!1)},v.firstOrDefault=function(t,e,n){return t?this.where(t).firstOrDefault(null,e):p(this,!0,e)},v.last=function(t,e){return t?this.where(t,e).last():h(this,!1)},v.lastOrDefault=function(t,e,n){return t?this.where(t,n).lastOrDefault(null,e):h(this,!0,e)},v.find=function(t,e){return f(this,t,e,!1)},v.findIndex=function(t,e){return f(this,t,e,!0)},v.toSet=function(){if("undefined"==typeof t.Set)throw new TypeError;var e=this;return new b(function(n){var r=new t.Set;return e.subscribe(function(t){r.add(t)},function(t){n.onError(t)},function(){n.onNext(r),n.onCompleted()})},e)},v.toMap=function(e,n){if("undefined"==typeof t.Map)throw new TypeError;var r=this;return new b(function(o){var i=new t.Map;return r.subscribe(function(t){var r;try{r=e(t)}catch(s){return void o.onError(s)}var u=t;if(n)try{u=n(t)}catch(s){return void o.onError(s)}i.set(r,u)},function(t){o.onError(t)},function(){o.onNext(i),o.onCompleted()})},r)},n})}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{158:158}],158:[function(e,n,r){(function(e,o){(function(i){function u(t){for(var e=[],n=0,r=t.length;r>n;n++)e.push(t[n]);return e}function a(t,e){if(ct&&e.stack&&"object"==typeof t&&null!==t&&t.stack&&-1===t.stack.indexOf(lt)){for(var n=[],r=e;r;r=r.source)r.stack&&n.unshift(r.stack);n.unshift(t.stack);var o=n.join("\n"+lt+"\n");t.stack=c(o)}}function c(t){for(var e=t.split("\n"),n=[],r=0,o=e.length;o>r;r++){var i=e[r];p(i)||h(i)||!i||n.push(i)}return n.join("\n")}function p(t){var e=l(t);if(!e)return!1;var n=e[0],r=e[1];return n===ht&&r>=ft&&Wn>=r}function h(t){return-1!==t.indexOf("(module.js:")||-1!==t.indexOf("(node.js:")}function f(){if(ct)try{throw new Error}catch(t){var e=t.stack.split("\n"),n=e[0].indexOf("@")>0?e[1]:e[2],r=l(n);if(!r)return;return ht=r[0],r[1]}}function l(t){var e=/at .+ \((.+):(\d+):(?:\d+)\)$/.exec(t);if(e)return[e[1],Number(e[2])];var n=/at ([^ ]+):(\d+):(?:\d+)$/.exec(t);if(n)return[n[1],Number(n[2])];var r=/.*@(.+):(\d+)$/.exec(t);return r?[r[1],Number(r[2])]:void 0}function d(t){var e=[];if(!Ht(t))return e;Ut.nonEnumArgs&&t.length&&Xt(t)&&(t=Yt.call(t));var n=Ut.enumPrototypes&&"function"==typeof t,r=Ut.enumErrorProps&&(t===Jt||t instanceof Error);for(var o in t)n&&"prototype"==o||r&&("message"==o||"name"==o)||e.push(o);if(Ut.nonEnumShadows&&t!==It){var i=t.constructor,s=-1,u=kt;if(t===(i&&i.prototype))var a=t===Lt?Wt:t===Jt?qt:$t.call(t),c=Ft[a];for(;++s-1:void 0});return n.pop(),r.pop(),l}function g(t,e){for(var n=new Array(t),r=0;t>r;r++)n[r]=e();return n}function w(){try{return Qt.apply(this,arguments)}catch(t){return ne.e=t,ne}}function x(t){if(!at(t))throw new TypeError("fn must be a function");return Qt=t,w}function _(t){throw t}function S(t,e){this.id=t,this.value=e}function E(t,e){this.scheduler=t,this.disposable=e,this.isDisposed=!1}function C(t,e){e.isDisposed||(e.isDisposed=!0,e.disposable.dispose())}function A(t){this._s=s}function N(t){this._s=s,this._l=s.length,this._i=0}function k(t){this._a=t}function O(t){this._a=t,this._l=q(t),this._i=0}function P(t){return"number"==typeof t&&X.isFinite(t)}function j(t){var e,n=t[xt];if(!n&&"string"==typeof t)return e=new A(t),e[xt]();if(!n&&t.length!==i)return e=new k(t),e[xt]();if(!n)throw new TypeError("Object is not iterable");return t[xt]()}function D(t){var e=+t;return 0===e?e:isNaN(e)?e:0>e?-1:1}function q(t){var e=+t.length;return isNaN(e)?0:0!==e&&P(e)?(e=D(e)*Math.floor(Math.abs(e)),0>=e?0:e>en?en:e):e}function R(t,e){this.observer=t,this.parent=e}function M(t,e){return me(t)||(t=_e),new rn(e,t)}function T(t,e){this.observer=t,this.parent=e}function V(t,e){this.observer=t,this.parent=e}function W(t,e){return new qn(function(n){var r=new fe,o=new le;return o.setDisposable(r),r.setDisposable(t.subscribe(function(t){n.onNext(t)},function(t){try{var r=e(t)}catch(i){return n.onError(i)}ut(r)&&(r=Xe(r));var s=new fe;o.setDisposable(s),s.setDisposable(r.subscribe(n))},function(t){n.onCompleted(t)})),o},t)}function $(){return!1}function z(t,e){var n=this;return new qn(function(r){var o=0,i=t.length;return n.subscribe(function(n){if(i>o){var s=t[o++],u=x(e)(n,s);if(u===ne)return r.onError(u.e);r.onNext(u)}else r.onCompleted()},function(t){r.onError(t)},function(){r.onCompleted()})},n)}function $(){return!1}function G(){return[]}function $(){return!1}function J(){return[]}function I(t,e){this.observer=t,this.accumulator=e.accumulator,this.hasSeed=e.hasSeed,this.seed=e.seed,this.hasAccumulation=!1,this.accumulation=null,this.hasValue=!1,this.isStopped=!1}function L(t,e,n){var r=At(e,n,3);return t.map(function(e,n){var o=r(e,n,t);return ut(o)&&(o=Xe(o)),(Et(o)||St(o))&&(o=nn(o)),o}).concatAll()}function B(t,e,n){for(var r=0,o=t.length;o>r;r++)if(n(t[r],e))return r;return-1}function F(t){this.comparer=t,this.set=[]}function U(t,e,n){var r=At(e,n,3);return t.map(function(e,n){var o=r(e,n,t);return ut(o)&&(o=Xe(o)),(Et(o)||St(o))&&(o=nn(o)),o}).mergeAll()}var H={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},X=H[typeof window]&&window||this,Q=H[typeof r]&&r&&!r.nodeType&&r,K=H[typeof n]&&n&&!n.nodeType&&n,Y=K&&K.exports===Q&&Q,Z=H[typeof o]&&o;!Z||Z.global!==Z&&Z.window!==Z||(X=Z);var tt={internals:{},config:{Promise:X.Promise},helpers:{}},et=tt.helpers.noop=function(){},nt=(tt.helpers.notDefined=function(t){return"undefined"==typeof t},tt.helpers.identity=function(t){return t}),rt=(tt.helpers.pluck=function(t){return function(e){return e[t]}},tt.helpers.just=function(t){return function(){return t}},tt.helpers.defaultNow=Date.now),ot=tt.helpers.defaultComparer=function(t,e){return Kt(t,e)},it=tt.helpers.defaultSubComparer=function(t,e){return t>e?1:e>t?-1:0},st=(tt.helpers.defaultKeySerializer=function(t){return t.toString()},tt.helpers.defaultError=function(t){throw t}),ut=tt.helpers.isPromise=function(t){return!!t&&"function"!=typeof t.subscribe&&"function"==typeof t.then},at=(tt.helpers.asArray=function(){return Array.prototype.slice.call(arguments)},tt.helpers.not=function(t){return!t},tt.helpers.isFunction=function(){var t=function(t){return"function"==typeof t||!1};return t(/x/)&&(t=function(t){return"function"==typeof t&&"[object Function]"==$t.call(t)}),t}());tt.config.longStackSupport=!1;var ct=!1;try{throw new Error}catch(pt){ct=!!pt.stack}var ht,ft=f(),lt="From previous event:",dt=tt.EmptyError=function(){this.message="Sequence contains no elements.",Error.call(this)};dt.prototype=Error.prototype;var vt=tt.ObjectDisposedError=function(){this.message="Object has been disposed",Error.call(this)};vt.prototype=Error.prototype;var yt=tt.ArgumentOutOfRangeError=function(){this.message="Argument out of range",Error.call(this)};yt.prototype=Error.prototype;var bt=tt.NotSupportedError=function(t){this.message=t||"This operation is not supported",Error.call(this)};bt.prototype=Error.prototype;var mt=tt.NotImplementedError=function(t){this.message=t||"This operation is not implemented",Error.call(this)};mt.prototype=Error.prototype;var gt=tt.helpers.notImplemented=function(){throw new mt},wt=tt.helpers.notSupported=function(){throw new bt},xt="function"==typeof Symbol&&Symbol.iterator||"_es6shim_iterator_";X.Set&&"function"==typeof(new X.Set)["@@iterator"]&&(xt="@@iterator");var _t=tt.doneEnumerator={done:!0,value:i},St=tt.helpers.isIterable=function(t){return t[xt]!==i},Et=tt.helpers.isArrayLike=function(t){return t&&t.length!==i};tt.helpers.iterator=xt;var Ct,At=tt.internals.bindCallback=function(t,e,n){if("undefined"==typeof e)return t;switch(n){case 0:return function(){return t.call(e)};case 1:return function(n){return t.call(e,n)};case 2:return function(n,r){return t.call(e,n,r)};case 3:return function(n,r,o){return t.call(e,n,r,o)}}return function(){return t.apply(e,arguments)}},Nt=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],kt=Nt.length,Ot="[object Arguments]",Pt="[object Array]",jt="[object Boolean]",Dt="[object Date]",qt="[object Error]",Rt="[object Function]",Mt="[object Number]",Tt="[object Object]",Vt="[object RegExp]",Wt="[object String]",$t=Object.prototype.toString,zt=Object.prototype.hasOwnProperty,Gt=$t.call(arguments)==Ot,Jt=Error.prototype,It=Object.prototype,Lt=String.prototype,Bt=It.propertyIsEnumerable;try{Ct=!($t.call(document)==Tt&&!({toString:0}+""))}catch(pt){Ct=!0}var Ft={};Ft[Pt]=Ft[Dt]=Ft[Mt]={constructor:!0,toLocaleString:!0,toString:!0,valueOf:!0},Ft[jt]=Ft[Wt]={constructor:!0,toString:!0,valueOf:!0},Ft[qt]=Ft[Rt]=Ft[Vt]={constructor:!0,toString:!0},Ft[Tt]={constructor:!0};var Ut={};!function(){var t=function(){this.x=1},e=[];t.prototype={valueOf:1,y:1};for(var n in new t)e.push(n);for(n in arguments);Ut.enumErrorProps=Bt.call(Jt,"message")||Bt.call(Jt,"name"),Ut.enumPrototypes=Bt.call(t,"prototype"),Ut.nonEnumArgs=0!=n,Ut.nonEnumShadows=!/valueOf/.test(e)}(1);var Ht=tt.internals.isObject=function(t){var e=typeof t;return t&&("function"==e||"object"==e)||!1},Xt=function(t){return t&&"object"==typeof t?$t.call(t)==Ot:!1};Gt||(Xt=function(t){return t&&"object"==typeof t?zt.call(t,"callee"):!1});var Qt,Kt=tt.internals.isEqual=function(t,e){return m(t,e,[],[])},Yt=({}.hasOwnProperty,Array.prototype.slice),Zt=this.inherits=tt.internals.inherits=function(t,e){function n(){this.constructor=t}n.prototype=e.prototype,t.prototype=new n},te=tt.internals.addProperties=function(t){for(var e=[],n=1,r=arguments.length;r>n;n++)e.push(arguments[n]);for(var o=0,i=e.length;i>o;o++){var s=e[o];for(var u in s)t[u]=s[u]}},ee=tt.internals.addRef=function(t,e){return new qn(function(n){return new ie(e.getDisposable(),t.subscribe(n))})},ne={e:{}};S.prototype.compareTo=function(t){var e=this.value.compareTo(t.value);return 0===e&&(e=this.id-t.id),e};var re=tt.internals.PriorityQueue=function(t){this.items=new Array(t),this.length=0},oe=re.prototype;oe.isHigherPriority=function(t,e){return this.items[t].compareTo(this.items[e])<0},oe.percolate=function(t){if(!(t>=this.length||0>t)){var e=t-1>>1;if(!(0>e||e===t)&&this.isHigherPriority(t,e)){var n=this.items[t];this.items[t]=this.items[e],this.items[e]=n,this.percolate(e)}}},oe.heapify=function(t){if(+t||(t=0),!(t>=this.length||0>t)){var e=2*t+1,n=2*t+2,r=t;if(et;t++)n[t]=arguments[t];for(t=0;e>t;t++)if(!pe(n[t]))throw new TypeError("Not a disposable");this.disposables=n,this.isDisposed=!1,this.length=n.length},se=ie.prototype;se.add=function(t){this.isDisposed?t.dispose():(this.disposables.push(t),this.length++)},se.remove=function(t){var e=!1;if(!this.isDisposed){var n=this.disposables.indexOf(t);-1!==n&&(e=!0,this.disposables.splice(n,1),this.length--,t.dispose())}return e},se.dispose=function(){if(!this.isDisposed){this.isDisposed=!0;for(var t=this.disposables.length,e=new Array(t),n=0;t>n;n++)e[n]=this.disposables[n];for(this.disposables=[],this.length=0,n=0;t>n;n++)e[n].dispose()}};var ue=tt.Disposable=function(t){this.isDisposed=!1,this.action=t||et};ue.prototype.dispose=function(){this.isDisposed||(this.action(),this.isDisposed=!0)};var ae=ue.create=function(t){return new ue(t)},ce=ue.empty={dispose:et},pe=ue.isDisposable=function(t){return t&&at(t.dispose)},he=ue.checkDisposed=function(t){if(t.isDisposed)throw new vt},fe=tt.SingleAssignmentDisposable=function(){ 4 | this.isDisposed=!1,this.current=null};fe.prototype.getDisposable=function(){return this.current},fe.prototype.setDisposable=function(t){if(this.current)throw new Error("Disposable has already been assigned");var e=this.isDisposed;!e&&(this.current=t),e&&t&&t.dispose()},fe.prototype.dispose=function(){if(!this.isDisposed){this.isDisposed=!0;var t=this.current;this.current=null}t&&t.dispose()};var le=tt.SerialDisposable=function(){this.isDisposed=!1,this.current=null};le.prototype.getDisposable=function(){return this.current},le.prototype.setDisposable=function(t){var e=this.isDisposed;if(!e){var n=this.current;this.current=t}n&&n.dispose(),e&&t&&t.dispose()},le.prototype.dispose=function(){if(!this.isDisposed){this.isDisposed=!0;var t=this.current;this.current=null}t&&t.dispose()};var de=tt.RefCountDisposable=function(){function t(t){this.disposable=t,this.disposable.count++,this.isInnerDisposed=!1}function e(t){this.underlyingDisposable=t,this.isDisposed=!1,this.isPrimaryDisposed=!1,this.count=0}return t.prototype.dispose=function(){this.disposable.isDisposed||this.isInnerDisposed||(this.isInnerDisposed=!0,this.disposable.count--,0===this.disposable.count&&this.disposable.isPrimaryDisposed&&(this.disposable.isDisposed=!0,this.disposable.underlyingDisposable.dispose()))},e.prototype.dispose=function(){this.isDisposed||this.isPrimaryDisposed||(this.isPrimaryDisposed=!0,0===this.count&&(this.isDisposed=!0,this.underlyingDisposable.dispose()))},e.prototype.getDisposable=function(){return this.isDisposed?ce:new t(this)},e}();E.prototype.dispose=function(){this.scheduler.scheduleWithState(this,C)};var ve=tt.internals.ScheduledItem=function(t,e,n,r,o){this.scheduler=t,this.state=e,this.action=n,this.dueTime=r,this.comparer=o||it,this.disposable=new fe};ve.prototype.invoke=function(){this.disposable.setDisposable(this.invokeCore())},ve.prototype.compareTo=function(t){return this.comparer(this.dueTime,t.dueTime)},ve.prototype.isCancelled=function(){return this.disposable.isDisposed},ve.prototype.invokeCore=function(){return this.action(this.scheduler,this.state)};var ye=tt.Scheduler=function(){function t(t,e,n,r){this.now=t,this._schedule=e,this._scheduleRelative=n,this._scheduleAbsolute=r}function e(t,e){return e(),ce}t.isScheduler=function(e){return e instanceof t};var n=t.prototype;return n.schedule=function(t){return this._schedule(t,e)},n.scheduleWithState=function(t,e){return this._schedule(t,e)},n.scheduleWithRelative=function(t,n){return this._scheduleRelative(n,t,e)},n.scheduleWithRelativeAndState=function(t,e,n){return this._scheduleRelative(t,e,n)},n.scheduleWithAbsolute=function(t,n){return this._scheduleAbsolute(n,t,e)},n.scheduleWithAbsoluteAndState=function(t,e,n){return this._scheduleAbsolute(t,e,n)},t.now=rt,t.normalize=function(t){return 0>t&&(t=0),t},t}(),be=ye.normalize,me=ye.isScheduler;!function(t){function e(t,e){function n(e){o(e,function(e){var r=!1,o=!1,s=t.scheduleWithState(e,function(t,e){return r?i.remove(s):o=!0,n(e),ce});o||(i.add(s),r=!0)})}var r=e[0],o=e[1],i=new ie;return n(r),i}function n(t,e,n){function r(e){i(e,function(e,o){var i=!1,u=!1,a=t[n](e,o,function(t,e){return i?s.remove(a):u=!0,r(e),ce});u||(s.add(a),i=!0)})}var o=e[0],i=e[1],s=new ie;return r(o),s}function r(t,e){t(function(n){e(t,n)})}t.scheduleRecursive=function(t){return this.scheduleRecursiveWithState(t,r)},t.scheduleRecursiveWithState=function(t,n){return this.scheduleWithState([t,n],e)},t.scheduleRecursiveWithRelative=function(t,e){return this.scheduleRecursiveWithRelativeAndState(e,t,r)},t.scheduleRecursiveWithRelativeAndState=function(t,e,r){return this._scheduleRelative([t,r],e,function(t,e){return n(t,e,"scheduleWithRelativeAndState")})},t.scheduleRecursiveWithAbsolute=function(t,e){return this.scheduleRecursiveWithAbsoluteAndState(e,t,r)},t.scheduleRecursiveWithAbsoluteAndState=function(t,e,r){return this._scheduleAbsolute([t,r],e,function(t,e){return n(t,e,"scheduleWithAbsoluteAndState")})}}(ye.prototype),function(t){ye.prototype.schedulePeriodic=function(t,e){return this.schedulePeriodicWithState(null,t,e)},ye.prototype.schedulePeriodicWithState=function(t,e,n){if("undefined"==typeof X.setInterval)throw new bt;e=be(e);var r=t,o=X.setInterval(function(){r=n(r)},e);return ae(function(){X.clearInterval(o)})}}(ye.prototype),function(t){t.catchError=t["catch"]=function(t){return new Ae(this,t)}}(ye.prototype);var ge,we,xe=(tt.internals.SchedulePeriodicRecursive=function(){function t(t,e){e(0,this._period);try{this._state=this._action(this._state)}catch(n){throw this._cancel.dispose(),n}}function e(t,e,n,r){this._scheduler=t,this._state=e,this._period=n,this._action=r}return e.prototype.start=function(){var e=new fe;return this._cancel=e,e.setDisposable(this._scheduler.scheduleRecursiveWithRelativeAndState(0,this._period,t.bind(this))),e},e}(),ye.immediate=function(){function t(t,e){return e(this,t)}return new ye(rt,t,wt,wt)}()),_e=ye.currentThread=function(){function t(){for(;n.length>0;){var t=n.dequeue();!t.isCancelled()&&t.invoke()}}function e(e,r){var o=new ve(this,e,r,this.now());if(n)n.enqueue(o);else{n=new re(4),n.enqueue(o);var i=x(t)();if(n=null,i===ne)return _(i.e)}return o.disposable}var n,r=new ye(rt,e,wt,wt);return r.scheduleRequired=function(){return!n},r}(),Se=function(){var t,e=et;if(X.setTimeout)t=X.setTimeout,e=X.clearTimeout;else{if(!X.WScript)throw new bt;t=function(t,e){X.WScript.Sleep(e),t()}}return{setTimeout:t,clearTimeout:e}}(),Ee=Se.setTimeout,Ce=Se.clearTimeout;!function(){function t(e){if(s)Ee(function(){t(e)},0);else{var n=i[e];if(n){s=!0;var r=x(n)();if(we(e),s=!1,r===ne)return _(r.e)}}}function n(){if(!X.postMessage||X.importScripts)return!1;var t=!1,e=X.onmessage;return X.onmessage=function(){t=!0},X.postMessage("","*"),X.onmessage=e,t}function r(e){"string"==typeof e.data&&e.data.substring(0,c.length)===c&&t(e.data.substring(c.length))}var o=1,i={},s=!1;we=function(t){delete i[t]};var u=RegExp("^"+String($t).replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/toString| for [^\]]+/g,".*?")+"$"),a="function"==typeof(a=Z&&Y&&Z.setImmediate)&&!u.test(a)&&a;if(at(a))ge=function(e){var n=o++;return i[n]=e,a(function(){t(n)}),n};else if("undefined"!=typeof e&&"[object process]"==={}.toString.call(e))ge=function(n){var r=o++;return i[r]=n,e.nextTick(function(){t(r)}),r};else if(n()){var c="ms.rx.schedule"+Math.random();X.addEventListener?X.addEventListener("message",r,!1):X.attachEvent?X.attachEvent("onmessage",r):X.onmessage=r,ge=function(t){var e=o++;return i[e]=t,X.postMessage(c+currentId,"*"),e}}else if(X.MessageChannel){var p=new X.MessageChannel;p.port1.onmessage=function(e){t(e.data)},ge=function(t){var e=o++;return i[e]=t,p.port2.postMessage(e),e}}else ge="document"in X&&"onreadystatechange"in X.document.createElement("script")?function(e){var n=X.document.createElement("script"),r=o++;return i[r]=e,n.onreadystatechange=function(){t(r),n.onreadystatechange=null,n.parentNode.removeChild(n),n=null},X.document.documentElement.appendChild(n),r}:function(e){var n=o++;return i[n]=e,Ee(function(){t(n)},0),n}}();var Ae=(ye.timeout=ye["default"]=function(){function t(t,e){var n=this,r=new fe,o=ge(function(){!r.isDisposed&&r.setDisposable(e(n,t))});return new ie(r,ae(function(){we(o)}))}function e(t,e,n){var r=this,o=ye.normalize(e),i=new fe;if(0===o)return r.scheduleWithState(t,n);var s=Ee(function(){!i.isDisposed&&i.setDisposable(n(r,t))},o);return new ie(i,ae(function(){Ce(s)}))}function n(t,e,n){return this.scheduleWithRelativeAndState(t,e-this.now(),n)}return new ye(rt,t,e,n)}(),function(t){function e(t,e){return this._scheduler.scheduleWithState(t,this._wrap(e))}function n(t,e,n){return this._scheduler.scheduleWithRelativeAndState(t,e,this._wrap(n))}function r(t,e,n){return this._scheduler.scheduleWithAbsoluteAndState(t,e,this._wrap(n))}function o(o,i){this._scheduler=o,this._handler=i,this._recursiveOriginal=null,this._recursiveWrapper=null,t.call(this,this._scheduler.now.bind(this._scheduler),e,n,r)}return Zt(o,t),o.prototype._clone=function(t){return new o(t,this._handler)},o.prototype._wrap=function(t){var e=this;return function(n,r){try{return t(e._getRecursiveWrapper(n),r)}catch(o){if(!e._handler(o))throw o;return ce}}},o.prototype._getRecursiveWrapper=function(t){if(this._recursiveOriginal!==t){this._recursiveOriginal=t;var e=this._clone(t);e._recursiveOriginal=t,e._recursiveWrapper=e,this._recursiveWrapper=e}return this._recursiveWrapper},o.prototype.schedulePeriodicWithState=function(t,e,n){var r=this,o=!1,i=new fe;return i.setDisposable(this._scheduler.schedulePeriodicWithState(t,e,function(t){if(o)return null;try{return n(t)}catch(e){if(o=!0,!r._handler(e))throw e;return i.dispose(),null}})),i},o}(ye)),Ne=tt.Notification=function(){function t(t,e,n,r,o,i){this.kind=t,this.value=e,this.exception=n,this._accept=r,this._acceptObservable=o,this.toString=i}return t.prototype.accept=function(t,e,n){return t&&"object"==typeof t?this._acceptObservable(t):this._accept(t,e,n)},t.prototype.toObservable=function(t){var e=this;return me(t)||(t=xe),new qn(function(n){return t.scheduleWithState(e,function(t,e){e._acceptObservable(n),"N"===e.kind&&n.onCompleted()})})},t}(),ke=Ne.createOnNext=function(){function t(t){return t(this.value)}function e(t){return t.onNext(this.value)}function n(){return"OnNext("+this.value+")"}return function(r){return new Ne("N",r,null,t,e,n)}}(),Oe=Ne.createOnError=function(){function t(t,e){return e(this.exception)}function e(t){return t.onError(this.exception)}function n(){return"OnError("+this.exception+")"}return function(r){return new Ne("E",null,r,t,e,n)}}(),Pe=Ne.createOnCompleted=function(){function t(t,e,n){return n()}function e(t){return t.onCompleted()}function n(){return"OnCompleted()"}return function(){return new Ne("C",null,null,t,e,n)}}(),je=tt.Observer=function(){};je.prototype.toNotifier=function(){var t=this;return function(e){return e.accept(t)}},je.prototype.asObserver=function(){return new Me(this.onNext.bind(this),this.onError.bind(this),this.onCompleted.bind(this))},je.prototype.checked=function(){return new Te(this)};var De=je.create=function(t,e,n){return t||(t=et),e||(e=st),n||(n=et),new Me(t,e,n)};je.fromNotifier=function(t,e){return new Me(function(n){return t.call(e,ke(n))},function(n){return t.call(e,Oe(n))},function(){return t.call(e,Pe())})},je.prototype.notifyOn=function(t){return new We(t,this)},je.prototype.makeSafe=function(t){return new AnonymousSafeObserver(this._onNext,this._onError,this._onCompleted,t)};var qe,Re=tt.internals.AbstractObserver=function(t){function e(){this.isStopped=!1,t.call(this)}return Zt(e,t),e.prototype.next=gt,e.prototype.error=gt,e.prototype.completed=gt,e.prototype.onNext=function(t){this.isStopped||this.next(t)},e.prototype.onError=function(t){this.isStopped||(this.isStopped=!0,this.error(t))},e.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.completed())},e.prototype.dispose=function(){this.isStopped=!0},e.prototype.fail=function(t){return this.isStopped?!1:(this.isStopped=!0,this.error(t),!0)},e}(je),Me=tt.AnonymousObserver=function(t){function e(e,n,r){t.call(this),this._onNext=e,this._onError=n,this._onCompleted=r}return Zt(e,t),e.prototype.next=function(t){this._onNext(t)},e.prototype.error=function(t){this._onError(t)},e.prototype.completed=function(){this._onCompleted()},e}(Re),Te=function(t){function e(e){t.call(this),this._observer=e,this._state=0}Zt(e,t);var n=e.prototype;return n.onNext=function(t){this.checkAccess();var e=x(this._observer.onNext).call(this._observer,t);this._state=0,e===ne&&_(e.e)},n.onError=function(t){this.checkAccess();var e=x(this._observer.onError).call(this._observer,t);this._state=2,e===ne&&_(e.e)},n.onCompleted=function(){this.checkAccess();var t=x(this._observer.onCompleted).call(this._observer);this._state=2,t===ne&&_(t.e)},n.checkAccess=function(){if(1===this._state)throw new Error("Re-entrancy detected");if(2===this._state)throw new Error("Observer completed");0===this._state&&(this._state=1)},e}(je),Ve=tt.internals.ScheduledObserver=function(t){function e(e,n){t.call(this),this.scheduler=e,this.observer=n,this.isAcquired=!1,this.hasFaulted=!1,this.queue=[],this.disposable=new le}return Zt(e,t),e.prototype.next=function(t){var e=this;this.queue.push(function(){e.observer.onNext(t)})},e.prototype.error=function(t){var e=this;this.queue.push(function(){e.observer.onError(t)})},e.prototype.completed=function(){var t=this;this.queue.push(function(){t.observer.onCompleted()})},e.prototype.ensureActive=function(){var t=!1,e=this;!this.hasFaulted&&this.queue.length>0&&(t=!this.isAcquired,this.isAcquired=!0),t&&this.disposable.setDisposable(this.scheduler.scheduleRecursive(function(t){var n;if(!(e.queue.length>0))return void(e.isAcquired=!1);n=e.queue.shift();try{n()}catch(r){throw e.queue=[],e.hasFaulted=!0,r}t()}))},e.prototype.dispose=function(){t.prototype.dispose.call(this),this.disposable.dispose()},e}(Re),We=function(t){function e(e,n,r){t.call(this,e,n),this._cancel=r}return Zt(e,t),e.prototype.next=function(e){t.prototype.next.call(this,e),this.ensureActive()},e.prototype.error=function(e){t.prototype.error.call(this,e),this.ensureActive()},e.prototype.completed=function(){t.prototype.completed.call(this),this.ensureActive()},e.prototype.dispose=function(){t.prototype.dispose.call(this),this._cancel&&this._cancel.dispose(),this._cancel=null},e}(Ve),$e=tt.Observable=function(){function t(t){if(tt.config.longStackSupport&&ct){try{throw new Error}catch(e){this.stack=e.stack.substring(e.stack.indexOf("\n")+1)}var n=this;this._subscribe=function(e){var r=e.onError.bind(e);return e.onError=function(t){a(t,n),r(t)},t.call(n,e)}}else this._subscribe=t}return qe=t.prototype,qe.subscribe=qe.forEach=function(t,e,n){return this._subscribe("object"==typeof t?t:De(t,e,n))},qe.subscribeOnNext=function(t,e){return this._subscribe(De("undefined"!=typeof e?function(n){t.call(e,n)}:t))},qe.subscribeOnError=function(t,e){return this._subscribe(De(null,"undefined"!=typeof e?function(n){t.call(e,n)}:t))},qe.subscribeOnCompleted=function(t,e){return this._subscribe(De(null,null,"undefined"!=typeof e?function(){t.call(e)}:t))},t}(),ze=tt.ObservableBase=function(t){function e(t){return t&&at(t.dispose)?t:at(t)?ae(t):ce}function n(t,n){var r=n[0],o=n[1],i=x(o.subscribeCore).call(o,r);return i!==ne||r.fail(ne.e)?void r.setDisposable(e(i)):_(ne.e)}function r(t){var e=new Rn(t),r=[e,this];return _e.scheduleRequired()?_e.scheduleWithState(r,n):n(null,r),e}function o(){t.call(this,r)}return Zt(o,t),o.prototype.subscribeCore=gt,o}($e),Ge=tt.internals.Enumerable=function(){},Je=function(t){function e(e){this.sources=e,t.call(this)}function n(t,e,n){this.o=t,this.s=e,this.e=n,this.isStopped=!1}return Zt(e,t),e.prototype.subscribeCore=function(t){var e,r=new le,o=xe.scheduleRecursiveWithState(this.sources[xt](),function(o,i){if(!e){var s=x(o.next).call(o);if(s===ne)return t.onError(s.e);if(s.done)return t.onCompleted();var u=s.value;ut(u)&&(u=Xe(u));var a=new fe;r.setDisposable(a),a.setDisposable(u.subscribe(new n(t,i,o)))}});return new ie(r,o,ae(function(){e=!0}))},n.prototype.onNext=function(t){this.isStopped||this.o.onNext(t)},n.prototype.onError=function(t){this.isStopped||(this.isStopped=!0,this.o.onError(t))},n.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.s(this.e))},n.prototype.dispose=function(){this.isStopped=!0},n.prototype.fail=function(t){return this.isStopped?!1:(this.isStopped=!0,this.o.onError(t),!0)},e}(ze);Ge.prototype.concat=function(){return new Je(this)};var Ie=function(t){function e(e){this.sources=e,t.call(this)}return Zt(e,t),e.prototype.subscribeCore=function(t){var e,n=this.sources[xt](),r=new le,o=xe.scheduleRecursiveWithState(null,function(o,i){if(!e){var s=x(n.next).call(n);if(s===ne)return t.onError(s.e);if(s.done)return null!==o?t.onError(o):t.onCompleted();var u=s.value;ut(u)&&(u=Xe(u));var a=new fe;r.setDisposable(a),a.setDisposable(u.subscribe(function(e){t.onNext(e)},i,function(){t.onCompleted()}))}});return new ie(r,o,ae(function(){e=!0}))},e}(ze);Ge.prototype.catchError=function(){return new Ie(this)},Ge.prototype.catchErrorWhen=function(t){var e=this;return new qn(function(n){var r,o,i=new Tn,s=new Tn,u=t(i),a=u.subscribe(s),c=e[xt](),p=new le,h=xe.scheduleRecursive(function(t){if(!r){var e=x(c.next).call(c);if(e===ne)return n.onError(e.e);if(e.done)return void(o?n.onError(o):n.onCompleted());var u=e.value;ut(u)&&(u=Xe(u));var a=new fe,h=new fe;p.setDisposable(new ie(h,a)),a.setDisposable(u.subscribe(function(t){n.onNext(t)},function(e){h.setDisposable(s.subscribe(t,function(t){n.onError(t)},function(){n.onCompleted()})),i.onNext(e)},function(){n.onCompleted()}))}});return new ie(a,p,h,ae(function(){r=!0}))})};var Le=function(t){function e(t,e){this.v=t,this.c=null==e?-1:e}function n(t){this.v=t.v,this.l=t.c}return Zt(e,t),e.prototype[xt]=function(){return new n(this)},n.prototype.next=function(){return 0===this.l?_t:(this.l>0&&this.l--,{done:!1,value:this.v})},e}(Ge),Be=Ge.repeat=function(t,e){return new Le(t,e)},Fe=function(t){function e(t,e,n){this.s=t,this.fn=e?At(e,n,3):null}function n(t){this.i=-1,this.s=t.s,this.l=this.s.length,this.fn=t.fn}return Zt(e,t),e.prototype[xt]=function(){return new n(this)},n.prototype.next=function(){return++this.it?(e.onNext(n[t]),o(t+1)):e.onCompleted()}var e=this.observer,n=this.parent.args,r=n.length;return this.parent.scheduler.scheduleRecursiveWithState(0,t)};var on=$e.fromArray=function(t,e){return me(e)||(e=_e),new rn(t,e)};$e.generate=function(t,e,n,r,o){return me(o)||(o=_e),new qn(function(i){var s=!0;return o.scheduleRecursiveWithState(t,function(t,o){var u,a;try{s?s=!1:t=n(t),u=e(t),u&&(a=r(t))}catch(c){return i.onError(c)}u?(i.onNext(a),o(t)):i.onCompleted()})})};var sn=function(t){function e(){t.call(this)}return Zt(e,t),e.prototype.subscribeCore=function(t){return ce},e}(ze),un=$e.never=function(){return new sn};$e.of=function(){for(var t=arguments.length,e=new Array(t),n=0;t>n;n++)e[n]=arguments[n];return new rn(e,_e)},$e.ofWithScheduler=function(t){for(var e=arguments.length,n=new Array(e-1),r=1;e>r;r++)n[r-1]=arguments[r];return new rn(n,t)};var an=function(t){function e(e,n){this.obj=e,this.keys=Object.keys(e),this.scheduler=n,t.call(this)}return Zt(e,t),e.prototype.subscribeCore=function(t){var e=new T(t,this);return e.run()},e}(ze);T.prototype.run=function(){function t(t,i){if(o>t){var s=r[t];e.onNext([s,n[s]]),i(t+1)}else e.onCompleted()}var e=this.observer,n=this.parent.obj,r=this.parent.keys,o=r.length;return this.parent.scheduler.scheduleRecursiveWithState(0,t)},$e.pairs=function(t,e){return e||(e=_e),new an(t,e)};var cn=function(t){function e(e,n,r){this.start=e,this.rangeCount=n,this.scheduler=r,t.call(this)}return Zt(e,t),e.prototype.subscribeCore=function(t){var e=new pn(t,this);return e.run()},e}(ze),pn=function(){function t(t,e){this.observer=t,this.parent=e}return t.prototype.run=function(){function t(t,o){n>t?(r.onNext(e+t),o(t+1)):r.onCompleted()}var e=this.parent.start,n=this.parent.rangeCount,r=this.observer;return this.parent.scheduler.scheduleRecursiveWithState(0,t)},t}();$e.range=function(t,e,n){return me(n)||(n=_e),new cn(t,e,n)};var hn=function(t){function e(e,n,r){this.value=e,this.repeatCount=null==n?-1:n,this.scheduler=r,t.call(this)}return Zt(e,t),e.prototype.subscribeCore=function(t){var e=new V(t,this);return e.run()},e}(ze);V.prototype.run=function(){function t(t,r){return(-1===t||t>0)&&(e.onNext(n),t>0&&t--),0===t?e.onCompleted():void r(t)}var e=this.observer,n=this.parent.value;return this.parent.scheduler.scheduleRecursiveWithState(this.parent.repeatCount,t)},$e.repeat=function(t,e,n){return me(n)||(n=_e),new hn(t,e,n)};var fn=function(t){function e(e,n){this.value=e,this.scheduler=n,t.call(this)}function n(t,e){this.observer=t,this.parent=e}function r(t,e){var n=e[0],r=e[1];r.onNext(n),r.onCompleted()}return Zt(e,t),e.prototype.subscribeCore=function(t){var e=new n(t,this);return e.run()},n.prototype.run=function(){return this.parent.scheduler.scheduleWithState([this.parent.value,this.observer],r)},e}(ze),ln=($e["return"]=$e.just=$e.returnValue=function(t,e){return me(e)||(e=xe),new fn(t,e)},function(t){function e(e,n){this.error=e,this.scheduler=n,t.call(this)}function n(t,e){this.o=t,this.p=e}function r(t,e){var n=e[0],r=e[1];r.onError(n)}return Zt(e,t),e.prototype.subscribeCore=function(t){var e=new n(t,this);return e.run()},n.prototype.run=function(){return this.p.scheduler.scheduleWithState([this.p.error,this.o],r)},e}(ze)),dn=$e["throw"]=$e.throwError=$e.throwException=function(t,e){return me(e)||(e=xe),new ln(t,e)};$e.using=function(t,e){return new qn(function(n){var r,o,i=ce;try{r=t(),r&&(i=r),o=e(r)}catch(s){return new ie(dn(s).subscribe(n),i)}return new ie(o.subscribe(n),i)})},qe.amb=function(t){var e=this;return new qn(function(n){function r(){i||(i=s,c.dispose())}function o(){i||(i=u,a.dispose())}var i,s="L",u="R",a=new fe,c=new fe;return ut(t)&&(t=Xe(t)),a.setDisposable(e.subscribe(function(t){r(),i===s&&n.onNext(t)},function(t){r(),i===s&&n.onError(t)},function(){r(),i===s&&n.onCompleted()})),c.setDisposable(t.subscribe(function(t){o(),i===u&&n.onNext(t)},function(t){o(),i===u&&n.onError(t)},function(){o(),i===u&&n.onCompleted()})),new ie(a,c)})},$e.amb=function(){function t(t,e){return t.amb(e)}var e=un(),n=[];if(Array.isArray(arguments[0]))n=arguments[0];else for(var r=0,o=arguments.length;o>r;r++)n.push(arguments[r]);for(var r=0,o=n.length;o>r;r++)e=t(e,n[r]);return e},qe["catch"]=qe.catchError=qe.catchException=function(t){return"function"==typeof t?W(this,t):vn([this,t])};var vn=$e.catchError=$e["catch"]=$e.catchException=function(){var t=[];if(Array.isArray(arguments[0]))t=arguments[0];else for(var e=0,n=arguments.length;n>e;e++)t.push(arguments[e]);return Ue(t).catchError()};qe.combineLatest=function(){for(var t=arguments.length,e=new Array(t),n=0;t>n;n++)e[n]=arguments[n];return Array.isArray(e[0])?e[0].unshift(this):e.unshift(this),yn.apply(this,e)};var yn=$e.combineLatest=function(){for(var t=arguments.length,e=new Array(t),n=0;t>n;n++)e[n]=arguments[n];var r=e.pop();return Array.isArray(e[0])&&(e=e[0]),new qn(function(t){function n(e){if(u[e]=!0,a||(a=u.every(nt))){try{var n=r.apply(null,p)}catch(o){return t.onError(o)}t.onNext(n)}else c.filter(function(t,n){return n!==e}).every(nt)&&t.onCompleted()}function o(e){c[e]=!0,c.every(nt)&&t.onCompleted()}for(var i=e.length,s=function(){return!1},u=g(i,s),a=!1,c=g(i,s),p=new Array(i),h=new Array(i),f=0;i>f;f++)!function(r){var i=e[r],s=new fe;ut(i)&&(i=Xe(i)),s.setDisposable(i.subscribe(function(t){p[r]=t,n(r)},function(e){t.onError(e)},function(){o(r)})),h[r]=s}(f);return new ie(h)},this)};qe.concat=function(){for(var t=[],e=0,n=arguments.length;n>e;e++)t.push(arguments[e]);return t.unshift(this),mn.apply(null,t)};var bn=function(t){function e(e){this.sources=e,t.call(this)}function n(t,e){this.sources=t,this.o=e}return Zt(e,t),e.prototype.subscribeCore=function(t){var e=new n(this.sources,t);return e.run()},n.prototype.run=function(){var t,e=new le,n=this.sources,r=n.length,o=this.o,i=xe.scheduleRecursiveWithState(0,function(i,s){if(!t){if(i===r)return o.onCompleted();var u=n[i];ut(u)&&(u=Xe(u));var a=new fe;e.setDisposable(a),a.setDisposable(u.subscribe(function(t){o.onNext(t)},function(t){o.onError(t)},function(){s(i+1)}))}});return new ie(e,i,ae(function(){t=!0}))},e}(ze),mn=$e.concat=function(){var t;if(Array.isArray(arguments[0]))t=arguments[0];else{t=new Array(arguments.length);for(var e=0,n=arguments.length;n>e;e++)t[e]=arguments[e]}return new bn(t)};qe.concatAll=qe.concatObservable=function(){return this.merge(1)};var gn=function(t){function e(e,n){this.source=e,this.maxConcurrent=n,t.call(this)}return Zt(e,t),e.prototype.subscribeCore=function(t){var e=new ie;return e.add(this.source.subscribe(new wn(t,this.maxConcurrent,e))),e},e}(ze),wn=function(){function t(t,e,n){this.o=t,this.max=e,this.g=n,this.done=!1,this.q=[],this.activeCount=0,this.isStopped=!1}function e(t,e){this.parent=t,this.sad=e,this.isStopped=!1}return t.prototype.handleSubscribe=function(t){var n=new fe;this.g.add(n),ut(t)&&(t=Xe(t)),n.setDisposable(t.subscribe(new e(this,n)))},t.prototype.onNext=function(t){this.isStopped||(this.activeCount0?t.handleSubscribe(t.q.shift()):(t.activeCount--,t.done&&0===t.activeCount&&t.o.onCompleted())}},e.prototype.dispose=function(){this.isStopped=!0},e.prototype.fail=function(t){return this.isStopped?!1:(this.isStopped=!0,this.parent.o.onError(t),!0)},t}();qe.merge=function(t){return"number"!=typeof t?xn(this,t):new gn(this,t)};var xn=$e.merge=function(){var t,e,n=[],r=arguments.length;if(arguments[0])if(me(arguments[0]))for(t=arguments[0],e=1;r>e;e++)n.push(arguments[e]);else for(t=xe,e=0;r>e;e++)n.push(arguments[e]);else for(t=xe,e=1;r>e;e++)n.push(arguments[e]);return Array.isArray(n[0])&&(n=n[0]),M(t,n).mergeAll()},_n=tt.CompositeError=function(t){this.name="NotImplementedError",this.innerErrors=t,this.message="This contains multiple errors. Check the innerErrors",Error.call(this)};_n.prototype=Error.prototype,$e.mergeDelayError=function(){var t;if(Array.isArray(arguments[0]))t=arguments[0];else{var e=arguments.length;t=new Array(e);for(var n=0;e>n;n++)t[n]=arguments[n]}var r=M(null,t);return new qn(function(t){function e(){0===s.length?t.onCompleted():1===s.length?t.onError(s[0]):t.onError(new _n(s))}var n=new ie,o=new fe,i=!1,s=[];return n.add(o),o.setDisposable(r.subscribe(function(r){var o=new fe;n.add(o),ut(r)&&(r=Xe(r)),o.setDisposable(r.subscribe(function(e){t.onNext(e)},function(t){s.push(t),n.remove(o),i&&1===n.length&&e()},function(){n.remove(o),i&&1===n.length&&e()}))},function(t){s.push(t),i=!0,1===n.length&&e()},function(){i=!0,1===n.length&&e()})),n})};var Sn=function(t){function e(e){this.source=e,t.call(this)}function n(t,e){this.o=t,this.g=e,this.isStopped=!1,this.done=!1}function r(t,e,n){this.parent=t,this.g=e,this.sad=n,this.isStopped=!1}return Zt(e,t),e.prototype.subscribeCore=function(t){var e=new ie,r=new fe;return e.add(r),r.setDisposable(this.source.subscribe(new n(t,e))),e},n.prototype.onNext=function(t){if(!this.isStopped){var e=new fe;this.g.add(e),ut(t)&&(t=Xe(t)),e.setDisposable(t.subscribe(new r(this,this.g,e)))}},n.prototype.onError=function(t){this.isStopped||(this.isStopped=!0,this.o.onError(t))},n.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.done=!0,1===this.g.length&&this.o.onCompleted())},n.prototype.dispose=function(){this.isStopped=!0},n.prototype.fail=function(t){return this.isStopped?!1:(this.isStopped=!0,this.o.onError(t),!0)},r.prototype.onNext=function(t){this.isStopped||this.parent.o.onNext(t)},r.prototype.onError=function(t){this.isStopped||(this.isStopped=!0,this.parent.o.onError(t))},r.prototype.onCompleted=function(){if(!this.isStopped){var t=this.parent;this.isStopped=!0,t.g.remove(this.sad),t.done&&1===t.g.length&&t.o.onCompleted()}},r.prototype.dispose=function(){this.isStopped=!0},r.prototype.fail=function(t){return this.isStopped?!1:(this.isStopped=!0,this.parent.o.onError(t),!0)},e}(ze);qe.mergeAll=qe.mergeObservable=function(){return new Sn(this)},qe.onErrorResumeNext=function(t){if(!t)throw new Error("Second observable is required");return En([this,t])};var En=$e.onErrorResumeNext=function(){var t=[];if(Array.isArray(arguments[0]))t=arguments[0];else for(var e=0,n=arguments.length;n>e;e++)t.push(arguments[e]);return new qn(function(e){var n=0,r=new le,o=xe.scheduleRecursive(function(o){var i,s;nn;n++)e[n]=arguments[n];var r=e.pop(),o=this;return Array.isArray(e[0])&&(e=e[0]),new qn(function(t){for(var n=e.length,i=g(n,$),s=!1,u=new Array(n),a=new Array(n+1),c=0;n>c;c++)!function(n){var r=e[n],o=new fe;ut(r)&&(r=Xe(r)),o.setDisposable(r.subscribe(function(t){u[n]=t,i[n]=!0,s=i.every(nt)},function(e){t.onError(e)},et)),a[n]=o}(c);var p=new fe;return p.setDisposable(o.subscribe(function(e){var n=[e].concat(u);if(s){var o=x(r).apply(null,n);return o===ne?t.onError(o.e):void t.onNext(o)}},function(e){t.onError(e)},function(){t.onCompleted()})),a[n]=p,new ie(a)},this)},qe.zip=function(){if(Array.isArray(arguments[0]))return z.apply(this,arguments);for(var t=arguments.length,e=new Array(t),n=0;t>n;n++)e[n]=arguments[n];var r=this,o=e.pop();return e.unshift(r),new qn(function(t){for(var n=e.length,i=g(n,G),s=g(n,$),u=new Array(n),a=0;n>a;a++)!function(n){var a=e[n],c=new fe;ut(a)&&(a=Xe(a)),c.setDisposable(a.subscribe(function(e){if(i[n].push(e),i.every(function(t){return t.length>0})){var u=i.map(function(t){return t.shift()}),a=x(o).apply(r,u);if(a===ne)return t.onError(a.e);t.onNext(a)}else s.filter(function(t,e){return e!==n}).every(nt)&&t.onCompleted()},function(e){t.onError(e)},function(){s[n]=!0,s.every(nt)&&t.onCompleted()})),u[n]=c}(a);return new ie(u)},r)},$e.zip=function(){for(var t=arguments.length,e=new Array(t),n=0;t>n;n++)e[n]=arguments[n];var r=e.shift();return r.zip.apply(r,e)},$e.zipArray=function(){var t;if(Array.isArray(arguments[0]))t=arguments[0];else{var e=arguments.length;t=new Array(e);for(var n=0;e>n;n++)t[n]=arguments[n]}return new qn(function(e){for(var n=t.length,r=g(n,J),o=g(n,$),i=new Array(n),s=0;n>s;s++)!function(n){i[n]=new fe,i[n].setDisposable(t[n].subscribe(function(t){if(r[n].push(t),r.every(function(t){return t.length>0})){var i=r.map(function(t){return t.shift()});e.onNext(i)}else if(o.filter(function(t,e){return e!==n}).every(nt))return e.onCompleted()},function(t){e.onError(t)},function(){o[n]=!0,o.every(nt)&&e.onCompleted()}))}(s);return new ie(i)})},qe.asObservable=function(){var t=this;return new qn(function(e){return t.subscribe(e)},t)},qe.bufferWithCount=function(t,e){return"number"!=typeof e&&(e=t),this.windowWithCount(t,e).selectMany(function(t){return t.toArray()}).where(function(t){return t.length>0})},qe.dematerialize=function(){var t=this;return new qn(function(e){return t.subscribe(function(t){return t.accept(e)},function(t){e.onError(t)},function(){e.onCompleted()})},this)},qe.distinctUntilChanged=function(t,e){var n=this;return e||(e=ot),new qn(function(r){var o,i=!1;return n.subscribe(function(n){var s=n;if(t&&(s=x(t)(n),s===ne))return r.onError(s.e);if(i){var u=x(e)(o,s);if(u===ne)return r.onError(u.e)}i&&u||(i=!0,o=s,r.onNext(n))},function(t){r.onError(t)},function(){r.onCompleted()})},this)};var Nn=function(t){function e(e,n,r,o){this.source=e,this.t=!n||at(n)?De(n||et,r||et,o||et):n,t.call(this)}function n(t,e){this.o=t,this.t=e,this.isStopped=!1}return Zt(e,t),e.prototype.subscribeCore=function(t){return this.source.subscribe(new n(t,this.t))},n.prototype.onNext=function(t){if(!this.isStopped){var e=x(this.t.onNext).call(this.t,t);e===ne&&this.o.onError(e.e),this.o.onNext(t)}},n.prototype.onError=function(t){if(!this.isStopped){this.isStopped=!0;var e=x(this.t.onError).call(this.t,t);if(e===ne)return this.o.onError(e.e);this.o.onError(t)}},n.prototype.onCompleted=function(){if(!this.isStopped){this.isStopped=!0;var t=x(this.t.onCompleted).call(this.t);if(t===ne)return this.o.onError(t.e);this.o.onCompleted()}},n.prototype.dispose=function(){this.isStopped=!0},n.prototype.fail=function(t){return this.isStopped?!1:(this.isStopped=!0,this.o.onError(t),!0)},e}(ze);qe["do"]=qe.tap=qe.doAction=function(t,e,n){return new Nn(this,t,e,n)},qe.doOnNext=qe.tapOnNext=function(t,e){return this.tap("undefined"!=typeof e?function(n){t.call(e,n)}:t)},qe.doOnError=qe.tapOnError=function(t,e){return this.tap(et,"undefined"!=typeof e?function(n){t.call(e,n)}:t)},qe.doOnCompleted=qe.tapOnCompleted=function(t,e){return this.tap(et,null,"undefined"!=typeof e?function(){t.call(e)}:t)},qe["finally"]=qe.ensure=function(t){var e=this;return new qn(function(n){var r;try{r=e.subscribe(n)}catch(o){throw t(),o}return ae(function(){try{r.dispose()}catch(e){throw e}finally{t()}})},this)},qe.finallyAction=function(t){return this.ensure(t)};var kn=function(t){function e(e){this.source=e,t.call(this)}function n(t){this.o=t,this.isStopped=!1}return Zt(e,t),e.prototype.subscribeCore=function(t){return this.source.subscribe(new n(t))},n.prototype.onNext=et,n.prototype.onError=function(t){this.isStopped||(this.isStopped=!0,this.o.onError(t))},n.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.o.onCompleted())},n.prototype.dispose=function(){this.isStopped=!0},n.prototype.fail=function(t){return this.isStopped?!1:(this.isStopped=!0,this.observer.onError(t),!0)},e}(ze);qe.ignoreElements=function(){return new kn(this)},qe.materialize=function(){var t=this;return new qn(function(e){return t.subscribe(function(t){e.onNext(ke(t))},function(t){e.onNext(Oe(t)),e.onCompleted()},function(){e.onNext(Pe()),e.onCompleted()})},t)},qe.repeat=function(t){return Be(this,t).concat()},qe.retry=function(t){return Be(this,t).catchError()},qe.retryWhen=function(t){return Be(this).catchErrorWhen(t)};var On=function(t){function e(e,n,r,o){this.source=e,this.accumulator=n,this.hasSeed=r,this.seed=o,t.call(this)}return Zt(e,t),e.prototype.subscribeCore=function(t){return this.source.subscribe(new I(t,this))},e}(ze);I.prototype.onNext=function(t){if(!this.isStopped){!this.hasValue&&(this.hasValue=!0);try{this.hasAccumulation?this.accumulation=this.accumulator(this.accumulation,t):(this.accumulation=this.hasSeed?this.accumulator(this.seed,t):t,this.hasAccumulation=!0)}catch(e){return this.observer.onError(e)}this.observer.onNext(this.accumulation)}},I.prototype.onError=function(t){this.isStopped||(this.isStopped=!0,this.observer.onError(t))},I.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,!this.hasValue&&this.hasSeed&&this.observer.onNext(this.seed),this.observer.onCompleted())},I.prototype.dispose=function(){this.isStopped=!0},I.prototype.fail=function(t){return this.isStopped?!1:(this.isStopped=!0,this.observer.onError(t),!0)},qe.scan=function(){var t,e,n=!1;return 2===arguments.length?(n=!0,t=arguments[0],e=arguments[1]):e=arguments[0],new On(this,e,n,t)},qe.skipLast=function(t){if(0>t)throw new yt;var e=this;return new qn(function(n){var r=[];return e.subscribe(function(e){r.push(e),r.length>t&&n.onNext(r.shift())},function(t){n.onError(t)},function(){n.onCompleted()})},e)},qe.startWith=function(){var t,e=0;arguments.length&&me(arguments[0])?(t=arguments[0],e=1):t=xe;for(var n=[],r=e,o=arguments.length;o>r;r++)n.push(arguments[r]);return Ue([on(n,t),this]).concat()},qe.takeLast=function(t){if(0>t)throw new yt;var e=this;return new qn(function(n){var r=[];return e.subscribe(function(e){r.push(e),r.length>t&&r.shift()},function(t){n.onError(t)},function(){for(;r.length>0;)n.onNext(r.shift());n.onCompleted()})},e)},qe.takeLastBuffer=function(t){var e=this;return new qn(function(n){var r=[];return e.subscribe(function(e){r.push(e),r.length>t&&r.shift()},function(t){n.onError(t)},function(){n.onNext(r),n.onCompleted()})},e)},qe.windowWithCount=function(t,e){var n=this;if(+t||(t=0),Math.abs(t)===1/0&&(t=0),0>=t)throw new yt;if(null==e&&(e=t),+e||(e=0),Math.abs(e)===1/0&&(e=0),0>=e)throw new yt;return new qn(function(r){function o(){var t=new Tn;a.push(t),r.onNext(ee(t,s))}var i=new fe,s=new de(i),u=0,a=[];return o(),i.setDisposable(n.subscribe(function(n){for(var r=0,i=a.length;i>r;r++)a[r].onNext(n);var s=u-t+1;s>=0&&s%e===0&&a.shift().onCompleted(),++u%e===0&&o()},function(t){for(;a.length>0;)a.shift().onError(t);r.onError(t)},function(){for(;a.length>0;)a.shift().onCompleted();r.onCompleted()})),s},n)},qe.selectConcat=qe.concatMap=function(t,e,n){return at(t)&&at(e)?this.concatMap(function(n,r){var o=t(n,r);return ut(o)&&(o=Xe(o)),(Et(o)||St(o))&&(o=nn(o)),o.map(function(t,o){return e(n,t,r,o)})}):at(t)?L(this,t,n):L(this,function(){return t})},qe.concatMapObserver=qe.selectConcatObserver=function(t,e,n,r){var o=this,i=At(t,r,2),s=At(e,r,1),u=At(n,r,0);return new qn(function(t){var e=0;return o.subscribe(function(n){var r;try{r=i(n,e++)}catch(o){return void t.onError(o)}ut(r)&&(r=Xe(r)),t.onNext(r)},function(e){var n;try{n=s(e)}catch(r){return void t.onError(r)}ut(n)&&(n=Xe(n)),t.onNext(n),t.onCompleted()},function(){var e;try{e=u()}catch(n){return void t.onError(n)}ut(e)&&(e=Xe(e)),t.onNext(e),t.onCompleted()})},this).concatAll()},qe.defaultIfEmpty=function(t){var e=this;return t===i&&(t=null),new qn(function(n){var r=!1;return e.subscribe(function(t){r=!0,n.onNext(t)},function(t){n.onError(t)},function(){!r&&n.onNext(t),n.onCompleted()})},e)},F.prototype.push=function(t){var e=-1===B(this.set,t,this.comparer);return e&&this.set.push(t),e},qe.distinct=function(t,e){var n=this;return e||(e=ot),new qn(function(r){var o=new F(e);return n.subscribe(function(e){var n=e;if(t)try{n=t(e)}catch(i){return void r.onError(i)}o.push(n)&&r.onNext(e)},function(t){r.onError(t)},function(){r.onCompleted()})},this)};var Pn=function(t){function e(e,n,r){this.source=e,this.selector=At(n,r,3),t.call(this)}function n(t,e){return function(n,r,o){return t.call(this,e.selector(n,r,o),r,o)}}function r(t,e,n){this.o=t,this.selector=e,this.source=n,this.i=0,this.isStopped=!1}return Zt(e,t),e.prototype.internalMap=function(t,r){return new e(this.source,n(t,this),r)},e.prototype.subscribeCore=function(t){return this.source.subscribe(new r(t,this.selector,this))},r.prototype.onNext=function(t){if(!this.isStopped){var e=x(this.selector)(t,this.i++,this.source);return e===ne?this.o.onError(e.e):void this.o.onNext(e)}},r.prototype.onError=function(t){this.isStopped||(this.isStopped=!0,this.o.onError(t))},r.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.o.onCompleted())},r.prototype.dispose=function(){this.isStopped=!0},r.prototype.fail=function(t){return this.isStopped?!1:(this.isStopped=!0,this.o.onError(t),!0)},e}(ze);qe.map=qe.select=function(t,e){var n="function"==typeof t?t:function(){return t};return this instanceof Pn?this.internalMap(n,e):new Pn(this,n,e)},qe.pluck=function(){var t=arguments,e=arguments.length;if(0===e)throw new Error("List of properties cannot be empty.");return this.map(function(n){for(var r=n,o=0;e>o;o++){var s=r[t[o]];if("undefined"==typeof s)return i;r=s}return r})},qe.flatMapObserver=qe.selectManyObserver=function(t,e,n,r){var o=this;return new qn(function(i){var s=0;return o.subscribe(function(e){var n;try{n=t.call(r,e,s++)}catch(o){return void i.onError(o)}ut(n)&&(n=Xe(n)),i.onNext(n)},function(t){var n;try{n=e.call(r,t)}catch(o){return void i.onError(o)}ut(n)&&(n=Xe(n)),i.onNext(n),i.onCompleted()},function(){var t;try{t=n.call(r)}catch(e){return void i.onError(e)}ut(t)&&(t=Xe(t)),i.onNext(t),i.onCompleted()})},o).mergeAll()},qe.selectMany=qe.flatMap=function(t,e,n){return at(t)&&at(e)?this.flatMap(function(n,r){var o=t(n,r);return ut(o)&&(o=Xe(o)),(Et(o)||St(o))&&(o=nn(o)),o.map(function(t,o){return e(n,t,r,o)})},n):at(t)?U(this,t,n):U(this,function(){return t})},qe.selectSwitch=qe.flatMapLatest=qe.switchMap=function(t,e){return this.select(t,e).switchLatest()};var jn=function(t){function e(e,n){this.source=e,this.skipCount=n,t.call(this)}function n(t,e){this.c=e,this.r=e,this.o=t,this.isStopped=!1}return Zt(e,t),e.prototype.subscribeCore=function(t){return this.source.subscribe(new n(t,this.skipCount))},n.prototype.onNext=function(t){this.isStopped||(this.r<=0?this.o.onNext(t):this.r--)},n.prototype.onError=function(t){this.isStopped||(this.isStopped=!0,this.o.onError(t))},n.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.o.onCompleted())},n.prototype.dispose=function(){this.isStopped=!0},n.prototype.fail=function(t){return this.isStopped?!1:(this.isStopped=!0,this.o.onError(t),!0)},e}(ze);qe.skip=function(t){if(0>t)throw new yt;return new jn(this,t)},qe.skipWhile=function(t,e){var n=this,r=At(t,e,3);return new qn(function(t){var e=0,o=!1;return n.subscribe(function(i){if(!o)try{o=!r(i,e++,n)}catch(s){return void t.onError(s)}o&&t.onNext(i)},function(e){t.onError(e)},function(){t.onCompleted()})},n)},qe.take=function(t,e){if(0>t)throw new yt;if(0===t)return Ye(e);var n=this;return new qn(function(e){var r=t;return n.subscribe(function(t){r-->0&&(e.onNext(t),0>=r&&e.onCompleted())},function(t){e.onError(t)},function(){e.onCompleted()})},n)},qe.takeWhile=function(t,e){var n=this,r=At(t,e,3);return new qn(function(t){var e=0,o=!0;return n.subscribe(function(i){if(o){try{o=r(i,e++,n)}catch(s){return void t.onError(s)}o?t.onNext(i):t.onCompleted()}},function(e){t.onError(e)},function(){t.onCompleted()})},n)};var Dn=function(t){function e(e,n,r){this.source=e,this.predicate=At(n,r,3),t.call(this)}function n(t,e){return function(n,r,o){return e.predicate(n,r,o)&&t.call(this,n,r,o)}}function r(t,e,n){this.o=t,this.predicate=e,this.source=n,this.i=0,this.isStopped=!1}return Zt(e,t),e.prototype.subscribeCore=function(t){return this.source.subscribe(new r(t,this.predicate,this))},e.prototype.internalFilter=function(t,r){return new e(this.source,n(t,this),r)},r.prototype.onNext=function(t){if(!this.isStopped){var e=x(this.predicate)(t,this.i++,this.source);return e===ne?this.o.onError(e.e):void(e&&this.o.onNext(t))}},r.prototype.onError=function(t){this.isStopped||(this.isStopped=!0,this.o.onError(t))},r.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.o.onCompleted())},r.prototype.dispose=function(){this.isStopped=!0},r.prototype.fail=function(t){return this.isStopped?!1:(this.isStopped=!0,this.o.onError(t),!0)},e}(ze);qe.filter=qe.where=function(t,e){return this instanceof Dn?this.internalFilter(t,e):new Dn(this,t,e)},qe.transduce=function(t){function e(t){return{"@@transducer/init":function(){return t},"@@transducer/step":function(t,e){return t.onNext(e)},"@@transducer/result":function(t){return t.onCompleted()}}}var n=this;return new qn(function(r){var o=t(e(r));return n.subscribe(function(t){try{o["@@transducer/step"](r,t)}catch(e){r.onError(e)}},function(t){r.onError(t)},function(){o["@@transducer/result"](r)})},n)};var qn=tt.AnonymousObservable=function(t){function e(t){return t&&at(t.dispose)?t:at(t)?ae(t):ce}function n(t,n){var r=n[0],o=n[1],i=x(o)(r);return i!==ne||r.fail(ne.e)?void r.setDisposable(e(i)):_(ne.e)}function r(e,r){function o(t){var r=new Rn(t),o=[r,e];return _e.scheduleRequired()?_e.scheduleWithState(o,n):n(null,o),r}this.source=r,t.call(this,o)}return Zt(r,t),r}($e),Rn=function(t){function e(e){t.call(this),this.observer=e,this.m=new fe}Zt(e,t);var n=e.prototype;return n.next=function(t){var e=x(this.observer.onNext).call(this.observer,t);e===ne&&(this.dispose(),_(e.e))},n.error=function(t){var e=x(this.observer.onError).call(this.observer,t);this.dispose(),e===ne&&_(e.e)},n.completed=function(){var t=x(this.observer.onCompleted).call(this.observer);this.dispose(),t===ne&&_(t.e)},n.setDisposable=function(t){this.m.setDisposable(t)},n.getDisposable=function(){return this.m.getDisposable()},n.dispose=function(){t.prototype.dispose.call(this),this.m.dispose()},e}(Re),Mn=function(t,e){this.subject=t,this.observer=e};Mn.prototype.dispose=function(){if(!this.subject.isDisposed&&null!==this.observer){var t=this.subject.observers.indexOf(this.observer);this.subject.observers.splice(t,1),this.observer=null}};var Tn=tt.Subject=function(t){function e(t){return he(this),this.isStopped?this.hasError?(t.onError(this.error),ce):(t.onCompleted(),ce):(this.observers.push(t),new Mn(this,t))}function n(){t.call(this,e),this.isDisposed=!1,this.isStopped=!1,this.observers=[],this.hasError=!1}return Zt(n,t),te(n.prototype,je.prototype,{hasObservers:function(){return this.observers.length>0},onCompleted:function(){if(he(this),!this.isStopped){this.isStopped=!0;for(var t=0,e=u(this.observers),n=e.length;n>t;t++)e[t].onCompleted();this.observers.length=0}},onError:function(t){if(he(this),!this.isStopped){this.isStopped=!0,this.error=t,this.hasError=!0;for(var e=0,n=u(this.observers),r=n.length;r>e;e++)n[e].onError(t);this.observers.length=0}},onNext:function(t){if(he(this),!this.isStopped)for(var e=0,n=u(this.observers),r=n.length;r>e;e++)n[e].onNext(t)},dispose:function(){this.isDisposed=!0,this.observers=null}}),n.create=function(t,e){return new Vn(t,e)},n}($e),Vn=(tt.AsyncSubject=function(t){function e(t){return he(this),this.isStopped?(this.hasError?t.onError(this.error):this.hasValue?(t.onNext(this.value),t.onCompleted()):t.onCompleted(),ce):(this.observers.push(t),new Mn(this,t))}function n(){t.call(this,e),this.isDisposed=!1,this.isStopped=!1,this.hasValue=!1,this.observers=[],this.hasError=!1}return Zt(n,t),te(n.prototype,je,{hasObservers:function(){return he(this),this.observers.length>0},onCompleted:function(){var t,e;if(he(this),!this.isStopped){this.isStopped=!0;var n=u(this.observers),e=n.length;if(this.hasValue)for(t=0;e>t;t++){var r=n[t];r.onNext(this.value),r.onCompleted()}else for(t=0;e>t;t++)n[t].onCompleted();this.observers.length=0}},onError:function(t){if(he(this),!this.isStopped){this.isStopped=!0,this.hasError=!0,this.error=t;for(var e=0,n=u(this.observers),r=n.length;r>e;e++)n[e].onError(t);this.observers.length=0}},onNext:function(t){he(this),this.isStopped||(this.value=t,this.hasValue=!0)},dispose:function(){this.isDisposed=!0,this.observers=null,this.exception=null,this.value=null}}),n}($e),tt.AnonymousSubject=function(t){function e(t){return this.observable.subscribe(t)}function n(n,r){this.observer=n,this.observable=r,t.call(this,e)}return Zt(n,t),te(n.prototype,je.prototype,{onCompleted:function(){this.observer.onCompleted()},onError:function(t){this.observer.onError(t)},onNext:function(t){this.observer.onNext(t)}}),n}($e));"function"==typeof t&&"object"==typeof t.amd&&t.amd?(X.Rx=tt,t(function(){return tt})):Q&&K?Y?(K.exports=tt).Rx=tt:Q.Rx=tt:X.Rx=tt;var Wn=f()}).call(this)}).call(this,e(149),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{149:149}]},{},[1])(1)}); -------------------------------------------------------------------------------- /public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ustccjw/tech-blog/a7c244d51c0f6fc400fe911730071299e2267dea/public/favicon.ico -------------------------------------------------------------------------------- /route/index.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import { Route, IndexRoute } from 'react-router' 3 | import App from '../client/container/app' 4 | import ArticleList from '../client/container/article-list' 5 | import Article from '../client/container/article' 6 | import About from '../client/container/about' 7 | 8 | const routes = ( 9 | 10 | 11 | 12 | 13 | 14 | 15 | ) 16 | 17 | export default routes 18 | -------------------------------------------------------------------------------- /server/app.js: -------------------------------------------------------------------------------- 1 | import fs from 'fs' 2 | import path from 'path' 3 | import express from 'express' 4 | import logger from 'morgan' 5 | import methodOverride from 'method-override' 6 | import session from 'express-session' 7 | import bodyParser from 'body-parser' 8 | import cookieParser from 'cookie-parser' 9 | import responseTime from 'response-time' 10 | import compression from 'compression' 11 | import errorHandler from 'errorhandler' 12 | import route from './route' 13 | import frontMiddleware from './front-middleware' 14 | import { ENV, ROOT } from './config' 15 | 16 | const app = express() 17 | export default app 18 | 19 | app.set('etag', false) 20 | app.enable('trust proxy') 21 | 22 | logger.token('date', () => new Date().toString()) 23 | 24 | // logger 25 | if (ENV === 'production') { 26 | const logPath = path.join(ROOT, 'access.log') 27 | const accessLogStream = fs.createWriteStream(logPath, { flags: 'a' }) 28 | app.use(logger('combined', { stream: accessLogStream })) 29 | } else { 30 | app.use(logger('dev')) 31 | } 32 | 33 | // http method override by X-HTTP-Method-Override 34 | app.use(methodOverride()) 35 | 36 | // session save 37 | app.use(session({ 38 | resave: true, 39 | saveUninitialized: false, 40 | secret: 'ustccjw', 41 | })) 42 | 43 | // body,cookie parse 44 | app.use(bodyParser.json()) 45 | app.use(bodyParser.urlencoded({ extended: false })) 46 | app.use(cookieParser()) 47 | 48 | // add X-Response-Time 49 | app.use(responseTime()) 50 | 51 | // compress 52 | app.use(compression()) 53 | 54 | // error handle last 55 | if (ENV === 'development') { 56 | app.use(errorHandler()) 57 | } 58 | 59 | // frontend webpack watch 60 | if (ENV === 'development') { 61 | frontMiddleware(app) 62 | } 63 | 64 | // route 65 | route(app) 66 | -------------------------------------------------------------------------------- /server/config/index.js: -------------------------------------------------------------------------------- 1 | import path from 'path' 2 | 3 | export const PORT = process.env.PORT || 3000 4 | export const ENV = process.env.NODE_ENV 5 | export const ROOT = path.join(__dirname, '../') 6 | -------------------------------------------------------------------------------- /server/db/index.js: -------------------------------------------------------------------------------- 1 | import Redis from 'ioredis' 2 | const redis = new Redis() 3 | 4 | export default { redis } 5 | -------------------------------------------------------------------------------- /server/front-middleware.js: -------------------------------------------------------------------------------- 1 | // this file modify will trigger multiple frontend webpack watch 2 | // so it should restart server when this file is modified 3 | 4 | import webpack from 'webpack' 5 | import webpackDevMiddleware from 'webpack-dev-middleware' 6 | import webpackHotMiddleware from 'webpack-hot-middleware' 7 | import config from '../webpack.config.frontend' 8 | 9 | const compiler = webpack(config) 10 | const devMiddleware = webpackDevMiddleware(compiler, { 11 | publicPath: config.output.publicPath, 12 | noInfo: true, 13 | }) 14 | const hotMiddleware = webpackHotMiddleware(compiler) 15 | 16 | const frontMiddleware = app => { 17 | app.use(devMiddleware) 18 | app.use(hotMiddleware) 19 | } 20 | 21 | export default frontMiddleware 22 | -------------------------------------------------------------------------------- /server/model/article.js: -------------------------------------------------------------------------------- 1 | import db from '../db' 2 | import { githubService } from '../service/' 3 | 4 | const { redis } = db 5 | 6 | export default class Article { 7 | static get(start, stop = start) { 8 | return redis.zrange('articles', start, stop) 9 | } 10 | 11 | static getByNumber(number) { 12 | return redis.zrangebyscore('articles', -number, -number) 13 | } 14 | 15 | static getLength() { 16 | return redis.zcard('articles') 17 | } 18 | 19 | static async init() { 20 | redis.del('articles') 21 | const url = 'https://api.github.com/repos/ustccjw/Blog/issues' 22 | const articles = await githubService.getArticles(url) 23 | articles.forEach(article => 24 | redis.zadd('articles', -article.number, JSON.stringify(article)) 25 | ) 26 | } 27 | } 28 | 29 | Article.init().catch(error => { 30 | console.error(error.stack) // eslint-disable-line no-console 31 | }) 32 | -------------------------------------------------------------------------------- /server/model/index.js: -------------------------------------------------------------------------------- 1 | export Resume from './resume' 2 | export Article from './article' 3 | 4 | -------------------------------------------------------------------------------- /server/model/resume.js: -------------------------------------------------------------------------------- 1 | import path from 'path' 2 | import fs from 'mz/fs' 3 | import db from '../db' 4 | import { ROOT } from '../config' 5 | 6 | const { redis } = db 7 | 8 | export default class Resume { 9 | static get() { 10 | return redis.get('resume') 11 | } 12 | 13 | static async init() { 14 | redis.del('resume') 15 | const filePath = path.join(ROOT, 'view/resume.md') 16 | const resume = await fs.readFile(filePath) 17 | redis.set('resume', resume.toString()) 18 | } 19 | } 20 | 21 | Resume.init().catch(error => console.error(error.stack)) // eslint-disable-line no-console 22 | -------------------------------------------------------------------------------- /server/route/index.js: -------------------------------------------------------------------------------- 1 | import path from 'path' 2 | import fs from 'mz/fs' 3 | import favicon from 'serve-favicon' 4 | import serveStatic from 'serve-static' 5 | import falcorMiddleware from 'falcor-express' 6 | import React from 'react' 7 | import { renderToString } from 'react-dom/server' 8 | import { match } from 'react-router' 9 | import AsyncProps, { loadPropsOnServer } from '../../lib/async-props' 10 | import template from 'es6-template-strings' 11 | import ModelRouter from './model-router' 12 | import routes from '../../route' 13 | import { dataModel } from '../../model' 14 | import { safeScript } from '../../util' 15 | import { ENV, ROOT } from '../config' 16 | 17 | const route = app => { 18 | // public resource 19 | app.use(favicon(path.join(ROOT, 'public/favicon.ico'))) 20 | app.use(serveStatic(path.join(ROOT, 'public'), { maxAge: '1d' })) 21 | app.use(serveStatic(path.join(ROOT, 'dist'), { maxAge: '1d' })) 22 | 23 | // route 24 | app.use('/model.json', falcorMiddleware.dataSourceRoute((req) => 25 | new ModelRouter(req.cookies.userId))) 26 | 27 | const templatePath = ENV === 'development' ? 28 | path.join(ROOT, 'view/dev-index.html') : 29 | path.join(ROOT, 'view/index.html') 30 | 31 | // default index 32 | app.get('*', (req, res, next) => { 33 | match({ routes, location: req.url }, 34 | async (err, redirect, renderProps) => { 35 | try { 36 | if (err) { 37 | throw err 38 | } 39 | const asyncProps = await loadPropsOnServer(renderProps) 40 | const props = { ...renderProps, ...asyncProps } 41 | const appHTML = renderToString(React.createElement(AsyncProps, props)) 42 | const htmlTemplate = await fs.readFile(templatePath) 43 | const dataCache = JSON.stringify(dataModel.getCache()) 44 | const scriptTag = `` 47 | const html = template(htmlTemplate, { html: appHTML, scriptTag }) 48 | dataModel.setCache(null) 49 | res.send(html) 50 | } catch (err1) { 51 | next(err1) 52 | } 53 | } 54 | ) 55 | }) 56 | } 57 | 58 | export default route 59 | -------------------------------------------------------------------------------- /server/route/model-router.js: -------------------------------------------------------------------------------- 1 | import falcor from 'falcor' 2 | import Router from 'falcor-router' 3 | import { Article, Resume } from '../model' 4 | import { getObjectByKeys } from '../../util' 5 | 6 | const { ref: $ref } = falcor.Model 7 | 8 | const BaseRouter = Router.createClass([{ 9 | route: 'articles[{ranges:indexRanges}][{keys:props}]', 10 | get: async pathSet => { 11 | const result = [] 12 | const tasks = pathSet.indexRanges.map(({ from, to }) => 13 | Article.get(from, to).then(articles => articles. 14 | map(article => JSON.parse(article)). 15 | forEach((article, index) => { 16 | result.push({ 17 | path: ['articleByNumber', article.number], 18 | value: getObjectByKeys(article, pathSet.props), 19 | }) 20 | result.push({ 21 | path: ['articles', from + index], 22 | value: $ref(['articleByNumber', article.number]), 23 | }) 24 | }) 25 | ) 26 | ) 27 | await Promise.all(tasks) 28 | return result 29 | }, 30 | }, { 31 | route: 'articles.length', 32 | get: async () => { 33 | const len = await Article.getLength() 34 | return { 35 | path: ['articles', 'length'], 36 | value: len, 37 | } 38 | }, 39 | }, { 40 | route: 'articleByNumber[{integers:numbers}][{keys:props}]', 41 | get: async pathSet => { 42 | const number = pathSet.numbers[0] 43 | const articles = await Article.getByNumber(number) 44 | const article = JSON.parse(articles[0]) 45 | return { 46 | path: ['articleByNumber', number], 47 | value: getObjectByKeys(article, pathSet.props), 48 | } 49 | }, 50 | }, { 51 | route: 'resume', 52 | get: async () => { 53 | const resume = await Resume.get() 54 | return { 55 | path: ['resume'], 56 | value: resume, 57 | } 58 | }, 59 | }]) 60 | 61 | export default class ModelRouter extends BaseRouter { 62 | constructor(key = null) { 63 | super() 64 | this.key = key 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /server/server.js: -------------------------------------------------------------------------------- 1 | import http from 'http' 2 | import { PORT } from './config' 3 | 4 | let serverListener = null 5 | const server = http.createServer() 6 | 7 | const startServer = () => { 8 | if (serverListener) { 9 | server.removeListener('request', serverListener) 10 | } 11 | serverListener = require('./app').default 12 | server.on('request', serverListener) 13 | server.listen(PORT, () => 14 | console.log(`Express server listening on port ${PORT}`)) // eslint-disable-line no-console 15 | } 16 | 17 | if (module.hot) { 18 | module.hot.accept('./app', () => { 19 | try { 20 | startServer() 21 | } catch (err) { 22 | console.error(err.stack) // eslint-disable-line no-console 23 | } 24 | }) 25 | } 26 | 27 | startServer() 28 | 29 | export default server 30 | -------------------------------------------------------------------------------- /server/service/github-service.js: -------------------------------------------------------------------------------- 1 | import fetch from 'node-fetch' 2 | import queryString from 'query-string' 3 | import { checkStatus } from '../../util' 4 | 5 | const getArticles = async url => { 6 | const query = queryString.stringify({ 7 | state: 'open', 8 | labels: 'blog', 9 | sort: 'created', 10 | }) 11 | const response = await fetch(`${url}?${query}`) 12 | const articles = await checkStatus(response) 13 | return articles.map(article => ({ 14 | number: article.number, 15 | title: article.title, 16 | content: article.body, 17 | comments: article.comments, 18 | commentsUrl: article.comments_url, 19 | createdDate: article.created_at, 20 | updateDate: article.updated_at, 21 | introduction: `${article.body.slice(0, 200)}...`, 22 | author: { 23 | name: article.user.login, 24 | link: article.user.html_url, 25 | }, 26 | })) 27 | } 28 | 29 | const getCommnet = async url => { 30 | const response = await fetch(url) 31 | const comment = await checkStatus(response) 32 | return { 33 | content: comment.body, 34 | createdDate: comment.created_at, 35 | updateDate: comment.updated_at, 36 | author: { 37 | name: comment.user.login, 38 | link: comment.user.html_url, 39 | }, 40 | } 41 | } 42 | 43 | export default { getArticles, getCommnet } 44 | -------------------------------------------------------------------------------- /server/service/index.js: -------------------------------------------------------------------------------- 1 | export githubService from './github-service' 2 | -------------------------------------------------------------------------------- /util/index.js: -------------------------------------------------------------------------------- 1 | export const checkStatus = async response => { 2 | if (response.status >= 200 && response.status < 300) { 3 | return response.json() 4 | } 5 | throw new Error(response.statusText) 6 | } 7 | 8 | export const object2Array = obj => Object.keys(obj).map(key => obj[key]) 9 | 10 | export const getObjectByKeys = (obj, keys) => { 11 | const res = {} 12 | keys.forEach(key => { 13 | res[key] = obj[key] 14 | }) 15 | return res 16 | } 17 | 18 | export const safeScript = str => { 19 | const tagsToReplace = { 20 | '&': '&', 21 | '<': '<', 22 | '>': '>', 23 | } 24 | return str.replace(/[&<>]/g, tag => tagsToReplace[tag]) 25 | } 26 | 27 | export const unsafeScript = str => { 28 | const tagsToReplace = { 29 | '&': '&', 30 | '<': '<', 31 | '>': '>', 32 | } 33 | return str.replace(/(&|<|>)/g, tag => tagsToReplace[tag]) 34 | } 35 | -------------------------------------------------------------------------------- /view/dev-index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | ustccjw's tech blog 8 | 9 | 10 |
    ${html}
    11 | ${scriptTag} 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /view/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | ustccjw's tech blog 9 | 10 | 11 |
    ${html}
    12 | ${scriptTag} 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /view/resume.md: -------------------------------------------------------------------------------- 1 | # 个人简历 2 | 3 | ## 基本资料 4 | 5 | 姓 名: 陈家伟 6 | 出生年月: 1990年9月 7 | 性 别: 男 8 | 学 历: 硕士 9 | 毕业院校: 中国科学与技术大学 10 | 专 业: 计算机科学与技术 11 | 联系电话: 13515667805 12 | 电子邮箱: ustccjw@gmail.com/317713370@qq.com 13 | 14 | ## 教育情况 15 | 16 | * 2007.9 —— 2011.7 就读于合肥工业大学本科,计算机专业; 17 | * 2011.9 —— 2014.7 就读于中国科学与技术大学硕士,计算机专业。 18 | 19 | ## 专业情况 20 | 21 | * 理论 22 | 23 | * 理解并认同结构,样式和行为分离的模块化设计; 24 | * 理解并认同 HTML 语义化和以结构为中心的开发模式; 25 | * 理解并认同使用 CSS 处理器(sass/postcss)来组织样式,反对 CSS 语义化(class dirty); 26 | * 理解并认同使用原生 Javascript(ES2015+)进行开发(借助 Babel); 27 | * 理解并认同前端组件化开发,利用组件来构建系统,易于管理,测试和扩展; 28 | 29 | * 技能 30 | 31 | * 熟悉 node.js,能使用 node.js 来进行简单的 web server开发和一些前端工具的开发; 32 | * 熟悉 React.js 生态圈, 对 React + flux(redux) + webpack + relay/ falcor + CSSinJS/css-modules 有所实践和认识; 33 | 34 | * 思考: 35 | 36 | * 在组件化中 CSS 的组织方式,具体的说,就是在 React 组件中,如何组织样式:CSSinJS/css-modules,实际上就是如何做到 CSS 模块化; 37 | * React 组件中,stateless component 如何权衡,过度的stateless 可能会造成父子组件之间过度耦合。 38 | * 关于 React 组件中 CSS 组织的思考:[React 组件中如何组织 CSS][1] 39 | 40 | ## 实习和工作情况 41 | 42 | * 2013.7 – 2013.9 在支付宝担任前端工程师实习生; 43 | 44 | * 实习期间,主要是进行支付宝前端通用平台的前端开发和维护工作; 45 | * 实习期间,写了一个dnd (aralejs)组件,主要实现拖放功能。 46 | 47 | * 2014.6 – 2014.12 在百度担任前端工程师; 48 | 49 | * 主要进行百度品牌广告的开发工作; 50 | * 内部组件库的整理展示工作。 51 | 52 | * 2014.12 – 至今 在百姓网担任前端工程师; 53 | 54 | * 前期,在前端架构组参与百姓网的前端基础构建; 55 | * 目前,参与开发百姓网的内部(自动化)营销系统(react + redux)。 56 | 57 | ## 主要项目情况 58 | 59 | * [Blog][2] 60 | * [tech-blog][3] 61 | * [auto-ellipsis][4] 62 | * [editorconfig-validate][5] 63 | * [upload][6] 64 | * [dnd][7] 65 | 66 | ## 个人专长 67 | 68 | * 要求规范,对code的要求是简洁规范; 69 | * 持续学习,对新技术有较大的好奇心和学习欲。 70 | 71 | [1]: https://github.com/ustccjw/Blog/issues/13 72 | [2]: https://github.com/ustccjw/Blog/issues 73 | [3]: https://github.com/ustccjw/tech-blog 74 | [4]: https://github.com/ideal-react/auto-ellipsis 75 | [5]: https://github.com/ustccjw/editorconfig-validate 76 | [6]: https://github.com/ustccjw/upload 77 | [7]: https://github.com/aralejs/dnd 78 | -------------------------------------------------------------------------------- /webpack.config.backend.js: -------------------------------------------------------------------------------- 1 | import path from 'path' 2 | import fs from 'fs' 3 | import webpack from 'webpack' 4 | 5 | const nodeModules = {} 6 | fs.readdirSync('node_modules'). 7 | filter(x => ['.bin'].indexOf(x) === -1). 8 | forEach(mod => { 9 | nodeModules[mod] = `commonjs ${mod}` 10 | }) 11 | 12 | module.exports = { 13 | target: 'node', 14 | entry: [ 15 | 'webpack/hot/poll?1000', 16 | 'babel-polyfill', 17 | './server/server.js', 18 | ], 19 | output: { 20 | path: path.join(__dirname, 'dev'), 21 | filename: 'backend.js', 22 | }, 23 | resolve: { 24 | extensions: ['', '.jsx', '.js', '.css'], 25 | }, 26 | node: { 27 | __filename: true, 28 | __dirname: false, 29 | }, 30 | module: { 31 | loaders: [{ 32 | test: /(\.js|\.jsx)$/, 33 | exclude: /(node_modules)/, 34 | loader: 'babel', 35 | }, { 36 | test: /\.(png|jpg|jpeg)$/, 37 | loader: 'url?limit=3072', 38 | }], 39 | }, 40 | plugins: [ 41 | new webpack.HotModuleReplacementPlugin(), 42 | new webpack.BannerPlugin('require("source-map-support").install();', { 43 | raw: true, 44 | entryOnly: false, 45 | }), 46 | new webpack.NormalModuleReplacementPlugin(/\.css$/, 47 | path.join(__dirname, 'node_modules/node-noop/index.js')), 48 | ], 49 | externals: nodeModules, 50 | devtool: 'source-map', 51 | } 52 | -------------------------------------------------------------------------------- /webpack.config.frontend.js: -------------------------------------------------------------------------------- 1 | import path from 'path' 2 | import webpack from 'webpack' 3 | import postcssNested from 'postcss-nested' 4 | import postcssCssnext from 'postcss-cssnext' 5 | 6 | 7 | let root = __dirname 8 | if (__dirname.endsWith('/dev')) { 9 | root = path.join(__dirname, '../') 10 | } 11 | 12 | const config = { 13 | entry: [ 14 | 'webpack-hot-middleware/client', 15 | 'babel-polyfill', 16 | './client/index.jsx', 17 | ], 18 | output: { 19 | path: path.join(root, 'dev'), 20 | filename: 'frontend.js', 21 | publicPath: 'http://127.0.0.1:3000/', 22 | }, 23 | resolve: { 24 | extensions: ['', '.jsx', '.js', '.css'], 25 | }, 26 | module: { 27 | loaders: [{ 28 | test: /(\.js|\.jsx)$/, 29 | exclude: /(node_modules)/, 30 | loader: 'babel', 31 | }, { 32 | test: /\.css$/, 33 | loader: 'style?sourceMap!css?sourceMap!postcss?sourceMap', 34 | }, { 35 | test: /\.(png|jpg|jpeg)$/, 36 | loader: 'url?limit=3072', 37 | }], 38 | }, 39 | externals: { 40 | falcor: 'falcor', 41 | 'falcor-http-datasource': 'falcor.HttpDataSource', 42 | }, 43 | postcss: [postcssNested, postcssCssnext], 44 | plugins: [ 45 | new webpack.optimize.OccurenceOrderPlugin(), 46 | new webpack.HotModuleReplacementPlugin(), 47 | new webpack.DefinePlugin({ 48 | 'process.env.NODE_ENV': JSON.stringify('development'), 49 | }), 50 | ], 51 | devtool: 'inline-source-map', 52 | } 53 | 54 | export default config 55 | -------------------------------------------------------------------------------- /webpack.config.js: -------------------------------------------------------------------------------- 1 | require('babel-register') 2 | module.exports = require('./webpack.config.frontend').default 3 | -------------------------------------------------------------------------------- /webpack.config.production.js: -------------------------------------------------------------------------------- 1 | import path from 'path' 2 | import fs from 'fs' 3 | import webpack from 'webpack' 4 | import ExtractTextPlugin from 'extract-text-webpack-plugin' 5 | import postcssNested from 'postcss-nested' 6 | import postcssCssnext from 'postcss-cssnext' 7 | 8 | const nodeModules = {} 9 | fs.readdirSync('node_modules'). 10 | filter(x => ['.bin'].indexOf(x) === -1). 11 | forEach(mod => { 12 | nodeModules[mod] = `commonjs ${mod}` 13 | }) 14 | 15 | exports.backend = { 16 | target: 'node', 17 | entry: [ 18 | 'babel-polyfill', 19 | './server/server.js', 20 | ], 21 | output: { 22 | path: path.join(__dirname, 'build'), 23 | filename: 'backend.js', 24 | }, 25 | resolve: { 26 | extensions: ['', '.jsx', '.js', '.css'], 27 | }, 28 | node: { 29 | __filename: true, 30 | __dirname: false, 31 | }, 32 | module: { 33 | loaders: [{ 34 | test: /(\.js|\.jsx)$/, 35 | exclude: /(node_modules)/, 36 | loader: 'babel', 37 | }, { 38 | test: /\.(png|jpg|jpeg)$/, 39 | loader: 'url?limit=3072', 40 | }], 41 | }, 42 | plugins: [ 43 | new webpack.BannerPlugin('require("source-map-support").install();', { 44 | raw: true, 45 | entryOnly: false, 46 | }), 47 | new webpack.NormalModuleReplacementPlugin(/\.css$/, 48 | path.join(__dirname, 'node_modules/node-noop/index.js')), 49 | ], 50 | externals: nodeModules, 51 | devtool: 'source-map', 52 | } 53 | 54 | exports.frontend = { 55 | entry: [ 56 | 'babel-polyfill', 57 | './client/index.jsx', 58 | ], 59 | output: { 60 | path: path.join(__dirname, 'dist'), 61 | filename: 'frontend.min.js', 62 | publicPath: '/', 63 | }, 64 | resolve: { 65 | extensions: ['', '.jsx', '.js', '.css'], 66 | }, 67 | module: { 68 | loaders: [{ 69 | test: /(\.js|\.jsx)$/, 70 | exclude: /(node_modules)/, 71 | loader: 'babel', 72 | }, { 73 | test: /\.css$/, 74 | loader: ExtractTextPlugin.extract('style', 'css!postcss'), 75 | }, { 76 | test: /\.(png|jpg|jpeg)$/, 77 | loader: 'url?limit=3072', 78 | }], 79 | }, 80 | externals: { 81 | falcor: 'falcor', 82 | 'falcor-http-datasource': 'falcor.HttpDataSource', 83 | }, 84 | postcss: [postcssNested, postcssCssnext], 85 | plugins: [ 86 | new ExtractTextPlugin('main.min.css'), 87 | new webpack.optimize.OccurenceOrderPlugin(), 88 | new webpack.optimize.UglifyJsPlugin({ 89 | compressor: { 90 | screw_ie8: true, 91 | warnings: false, 92 | }, 93 | }), 94 | new webpack.DefinePlugin({ 95 | 'process.env.NODE_ENV': JSON.stringify('production'), 96 | }), 97 | ], 98 | } 99 | --------------------------------------------------------------------------------