diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000..d616fc4 Binary files /dev/null and b/.DS_Store differ diff --git a/._.DS_Store b/._.DS_Store new file mode 100644 index 0000000..94a48a8 Binary files /dev/null and b/._.DS_Store differ diff --git a/._.gitignore b/._.gitignore new file mode 100644 index 0000000..0cd760f Binary files /dev/null and b/._.gitignore differ diff --git a/._README.md b/._README.md new file mode 100644 index 0000000..0cd760f Binary files /dev/null and b/._README.md differ diff --git a/._app b/._app new file mode 100644 index 0000000..5e98053 Binary files /dev/null and b/._app differ diff --git a/._built b/._built new file mode 100644 index 0000000..5e98053 Binary files /dev/null and b/._built differ diff --git a/._gulp b/._gulp new file mode 100644 index 0000000..5e98053 Binary files /dev/null and b/._gulp differ diff --git a/._gulpfile.js b/._gulpfile.js new file mode 100644 index 0000000..0cd760f Binary files /dev/null and b/._gulpfile.js differ diff --git a/._index.html b/._index.html new file mode 100644 index 0000000..0cd760f Binary files /dev/null and b/._index.html differ diff --git a/._package.json b/._package.json new file mode 100644 index 0000000..0cd760f Binary files /dev/null and b/._package.json differ diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..3c3629e --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +node_modules diff --git a/README.md b/README.md new file mode 100644 index 0000000..d1165da --- /dev/null +++ b/README.md @@ -0,0 +1,17 @@ +# Github user search + +Search and view users via the Github API - http://simonsmith.github.io/github-user-search/ + +Built with + +- [React](http://facebook.github.io/react/) +- [Reflux](https://github.com/spoike/refluxjs) +- [SUIT CSS](http://suitcss.github.io/) +- [6to5](https://6to5.org/) +- [webpack](http://webpack.github.io/) + +It also caches results in sessionStorage to lower the hits on the API. + +### To do + +- Add some more profile information diff --git a/app/.DS_Store b/app/.DS_Store new file mode 100644 index 0000000..29d5b7e Binary files /dev/null and b/app/.DS_Store differ diff --git a/app/._.DS_Store b/app/._.DS_Store new file mode 100644 index 0000000..94a48a8 Binary files /dev/null and b/app/._.DS_Store differ diff --git a/app/._react b/app/._react new file mode 100644 index 0000000..5e98053 Binary files /dev/null and b/app/._react differ diff --git a/app/._suit b/app/._suit new file mode 100644 index 0000000..5e98053 Binary files /dev/null and b/app/._suit differ diff --git a/app/npm-debug.log b/app/npm-debug.log new file mode 100644 index 0000000..0897635 --- /dev/null +++ b/app/npm-debug.log @@ -0,0 +1,23 @@ +0 info it worked if it ends with ok +1 verbose cli [ '/usr/local/bin/node', '/usr/local/bin/npm', 'start' ] +2 info using npm@2.14.4 +3 info using node@v4.1.2 +4 verbose stack Error: missing script: start +4 verbose stack at run (/usr/local/lib/node_modules/npm/lib/run-script.js:142:19) +4 verbose stack at /usr/local/lib/node_modules/npm/lib/run-script.js:58:5 +4 verbose stack at /usr/local/lib/node_modules/npm/node_modules/read-package-json/read-json.js:345:5 +4 verbose stack at checkBinReferences_ (/usr/local/lib/node_modules/npm/node_modules/read-package-json/read-json.js:309:45) +4 verbose stack at final (/usr/local/lib/node_modules/npm/node_modules/read-package-json/read-json.js:343:3) +4 verbose stack at then (/usr/local/lib/node_modules/npm/node_modules/read-package-json/read-json.js:113:5) +4 verbose stack at /usr/local/lib/node_modules/npm/node_modules/read-package-json/read-json.js:232:12 +4 verbose stack at /usr/local/lib/node_modules/npm/node_modules/graceful-fs/graceful-fs.js:76:16 +4 verbose stack at FSReqWrap.readFileAfterClose [as oncomplete] (fs.js:380:3) +5 verbose cwd /Applications/XAMPP/xamppfiles/htdocs/github-user-search-master/app +6 error Darwin 16.1.0 +7 error argv "/usr/local/bin/node" "/usr/local/bin/npm" "start" +8 error node v4.1.2 +9 error npm v2.14.4 +10 error missing script: start +11 error If you need help, you may report this error at: +11 error +12 verbose exit [ 1, true ] diff --git a/app/react/.DS_Store b/app/react/.DS_Store new file mode 100644 index 0000000..a2d245f Binary files /dev/null and b/app/react/.DS_Store differ diff --git a/app/react/._.DS_Store b/app/react/._.DS_Store new file mode 100644 index 0000000..94a48a8 Binary files /dev/null and b/app/react/._.DS_Store differ diff --git a/app/react/._actions b/app/react/._actions new file mode 100644 index 0000000..5e98053 Binary files /dev/null and b/app/react/._actions differ diff --git a/app/react/._api b/app/react/._api new file mode 100644 index 0000000..5e98053 Binary files /dev/null and b/app/react/._api differ diff --git a/app/react/._components b/app/react/._components new file mode 100644 index 0000000..5e98053 Binary files /dev/null and b/app/react/._components differ diff --git a/app/react/._mixins b/app/react/._mixins new file mode 100644 index 0000000..5e98053 Binary files /dev/null and b/app/react/._mixins differ diff --git a/app/react/._stores b/app/react/._stores new file mode 100644 index 0000000..5e98053 Binary files /dev/null and b/app/react/._stores differ diff --git a/app/react/._utils b/app/react/._utils new file mode 100644 index 0000000..5e98053 Binary files /dev/null and b/app/react/._utils differ diff --git a/app/react/actions/._user.js b/app/react/actions/._user.js new file mode 100644 index 0000000..0cd760f Binary files /dev/null and b/app/react/actions/._user.js differ diff --git a/app/react/actions/user.js b/app/react/actions/user.js new file mode 100644 index 0000000..46e051d --- /dev/null +++ b/app/react/actions/user.js @@ -0,0 +1,35 @@ +import Reflux from 'reflux'; +import request from 'reqwest'; +import { getItem } from 'mixins/cache'; +import gitHubAPI from 'api/github'; +import partial from 'lodash-node/modern/function/partial' + +var User = Reflux.createActions({ + search: { asyncResult: true }, + profile: { asyncResult: true }, + repos: { asyncResult: true }, + starred: { asyncResult: true } +}); + +User.search.listen(function(url) { + // Use the url as the cachekey + getAPIItem.call(this, url, url); +}); + +function getAPIItem(cacheKey, url, username) { + var cached = getItem(`${username}:${cacheKey}`); + + if (cached) { + return this.completed(cached, true); + } + + gitHubAPI(url) + .then(this.completed) + .fail(this.failed); +} + +User.profile.listen(partial(getAPIItem, 'profile')); +User.repos.listen(partial(getAPIItem, 'repos')); +User.starred.listen(partial(getAPIItem, 'starred')); + +export default User diff --git a/app/react/api/._github.js b/app/react/api/._github.js new file mode 100644 index 0000000..0cd760f Binary files /dev/null and b/app/react/api/._github.js differ diff --git a/app/react/api/github.js b/app/react/api/github.js new file mode 100644 index 0000000..7a296c0 --- /dev/null +++ b/app/react/api/github.js @@ -0,0 +1,25 @@ +import reqwest from 'reqwest'; +import parseLinkHeader from 'utils/parseLinkHeader'; +import startsWith from 'lodash-node/modern/string/startsWith'; +import path from 'path'; + +const API_ROOT_URL = 'https://api.github.com'; + +export default gitHubAPI; + +function gitHubAPI(url) { + var requestUrl = startsWith(url, API_ROOT_URL) ? url : path.join(API_ROOT_URL, url); + var req = reqwest({ + url: requestUrl, + type: 'json' + }) + .then(apiData => { + return { + results: apiData, + url, + pagination: parseLinkHeader(req.request.getResponseHeader('Link')) + }; + }); + + return req; +} \ No newline at end of file diff --git a/app/react/components/._app.jsx b/app/react/components/._app.jsx new file mode 100644 index 0000000..0cd760f Binary files /dev/null and b/app/react/components/._app.jsx differ diff --git a/app/react/components/._layout.jsx b/app/react/components/._layout.jsx new file mode 100644 index 0000000..0cd760f Binary files /dev/null and b/app/react/components/._layout.jsx differ diff --git a/app/react/components/._pagination.jsx b/app/react/components/._pagination.jsx new file mode 100644 index 0000000..0cd760f Binary files /dev/null and b/app/react/components/._pagination.jsx differ diff --git a/app/react/components/._profile-card.jsx b/app/react/components/._profile-card.jsx new file mode 100644 index 0000000..0cd760f Binary files /dev/null and b/app/react/components/._profile-card.jsx differ diff --git a/app/react/components/._profile-stat-group.jsx b/app/react/components/._profile-stat-group.jsx new file mode 100644 index 0000000..0cd760f Binary files /dev/null and b/app/react/components/._profile-stat-group.jsx differ diff --git a/app/react/components/._profile.jsx b/app/react/components/._profile.jsx new file mode 100644 index 0000000..0cd760f Binary files /dev/null and b/app/react/components/._profile.jsx differ diff --git a/app/react/components/._repo-list.jsx b/app/react/components/._repo-list.jsx new file mode 100644 index 0000000..0cd760f Binary files /dev/null and b/app/react/components/._repo-list.jsx differ diff --git a/app/react/components/._repo.jsx b/app/react/components/._repo.jsx new file mode 100644 index 0000000..0cd760f Binary files /dev/null and b/app/react/components/._repo.jsx differ diff --git a/app/react/components/._results-message.jsx b/app/react/components/._results-message.jsx new file mode 100644 index 0000000..0cd760f Binary files /dev/null and b/app/react/components/._results-message.jsx differ diff --git a/app/react/components/._results.jsx b/app/react/components/._results.jsx new file mode 100644 index 0000000..0cd760f Binary files /dev/null and b/app/react/components/._results.jsx differ diff --git a/app/react/components/._search-form.jsx b/app/react/components/._search-form.jsx new file mode 100644 index 0000000..0cd760f Binary files /dev/null and b/app/react/components/._search-form.jsx differ diff --git a/app/react/components/._search.jsx b/app/react/components/._search.jsx new file mode 100644 index 0000000..0cd760f Binary files /dev/null and b/app/react/components/._search.jsx differ diff --git a/app/react/components/._stat.jsx b/app/react/components/._stat.jsx new file mode 100644 index 0000000..0cd760f Binary files /dev/null and b/app/react/components/._stat.jsx differ diff --git a/app/react/components/._user-detail.jsx b/app/react/components/._user-detail.jsx new file mode 100644 index 0000000..0cd760f Binary files /dev/null and b/app/react/components/._user-detail.jsx differ diff --git a/app/react/components/app.jsx b/app/react/components/app.jsx new file mode 100644 index 0000000..82f1577 --- /dev/null +++ b/app/react/components/app.jsx @@ -0,0 +1,19 @@ +import React from 'react'; +import Router, { Route, DefaultRoute, Redirect } from 'react-router' + +import Layout from './layout.jsx'; +import Search from './search.jsx'; +import UserDetail from './user-detail.jsx'; + +var routes = ( + + + + + + +); + +Router.run(routes, function(Handler) { + React.render(, document.body); +}); diff --git a/app/react/components/layout.jsx b/app/react/components/layout.jsx new file mode 100644 index 0000000..5e8bf0f --- /dev/null +++ b/app/react/components/layout.jsx @@ -0,0 +1,12 @@ +import React from 'react'; +import Router, { RouteHandler } from 'react-router' + +var Layout = React.createClass({ + render: function() { + return ( + + ) + } +}); + +export default Layout; diff --git a/app/react/components/pagination.jsx b/app/react/components/pagination.jsx new file mode 100644 index 0000000..a26d27c --- /dev/null +++ b/app/react/components/pagination.jsx @@ -0,0 +1,63 @@ +import React from 'react'; +import Router, { State, Link } from 'react-router' + +var Pagination = React.createClass({ + mixins: [State], + + renderNextLink() { + if (this.props.pagination.next) { + let url = new URL(this.props.pagination.next); + return ( + + Next + + ) + } + }, + + renderPrevLink() { + if (this.props.pagination.prev) { + let url = new URL(this.props.pagination.prev); + return ( + + Previous + + ) + } + }, + + renderFirstLink() { + if (this.props.pagination.first) { + let url = new URL(this.props.pagination.first); + return ( + + First + + ) + } + }, + + renderLastLink() { + if (this.props.pagination.last) { + let url = new URL(this.props.pagination.last); + return ( + + Last + + ) + } + }, + + render() { + return ( +
+ {this.renderFirstLink()} + {this.renderPrevLink()} + {this.renderNextLink()} + {this.renderLastLink()} +
+ ); + } +}); + +export default Pagination; diff --git a/app/react/components/profile-card.jsx b/app/react/components/profile-card.jsx new file mode 100644 index 0000000..88d91eb --- /dev/null +++ b/app/react/components/profile-card.jsx @@ -0,0 +1,17 @@ +import React from 'react'; +import { Link } from 'react-router'; + +var ProfileCard = React.createClass({ + render: function() { + return ( +
+ + +

{this.props.username}

+ +
+ ) + } +}); + +export default ProfileCard; diff --git a/app/react/components/profile-stat-group.jsx b/app/react/components/profile-stat-group.jsx new file mode 100644 index 0000000..a1ae963 --- /dev/null +++ b/app/react/components/profile-stat-group.jsx @@ -0,0 +1,26 @@ +import React from 'react'; +import Stat from './stat.jsx'; +import map from 'lodash-node/modern/collection/map'; +import uniqueId from 'lodash-node/modern/utility/uniqueId'; + +var ProfileStatGroup = React.createClass({ + renderStatItems: function() { + return map(this.props.stats, function(value, key) { + return ( +
  • + +
  • + ); + }); + }, + + render: function() { + return ( +
      + {this.renderStatItems()} +
    + ) + } +}); + +export default ProfileStatGroup; diff --git a/app/react/components/profile.jsx b/app/react/components/profile.jsx new file mode 100644 index 0000000..f5d3341 --- /dev/null +++ b/app/react/components/profile.jsx @@ -0,0 +1,37 @@ +import React from 'react'; +import ProfileStatGroup from './profile-stat-group.jsx'; + +var Profile = React.createClass({ + render: function() { + var stats = { + 'Followers': this.props.user.followers, + 'Following': this.props.user.following, + 'Repos': this.props.user.public_repos + }; + + return ( +
    +
    + +
    +
    +

    + + {this.props.user.name} + +

    +
    +

    {this.props.user.login}

    +

    {this.props.user.location}

    +

    {this.props.user.blog}

    +
    +
    + +
    +
    +
    + ) + } +}); + +export default Profile; diff --git a/app/react/components/repo-list.jsx b/app/react/components/repo-list.jsx new file mode 100644 index 0000000..93e1813 --- /dev/null +++ b/app/react/components/repo-list.jsx @@ -0,0 +1,23 @@ +import React from 'react'; +import Repo from './repo.jsx'; +import map from 'lodash-node/modern/collection/map'; + +var RepoList = React.createClass({ + render: function() { + var repos = map(this.props.repos, function(repo) { + return ( +
  • + +
  • + ); + }); + + return ( +
      + {repos} +
    + ) + } +}); + +export default RepoList; diff --git a/app/react/components/repo.jsx b/app/react/components/repo.jsx new file mode 100644 index 0000000..144142a --- /dev/null +++ b/app/react/components/repo.jsx @@ -0,0 +1,30 @@ +import React from 'react'; +import Stat from './stat.jsx'; + +var Repo = React.createClass({ + renderStat: function() { + if (this.props.data.stargazers_count) { + return ( +
    + +
    + ) + } else { + return null; + } + }, + + render: function() { + return ( + + ) + } +}); + +export default Repo; \ No newline at end of file diff --git a/app/react/components/results-message.jsx b/app/react/components/results-message.jsx new file mode 100644 index 0000000..8a2d306 --- /dev/null +++ b/app/react/components/results-message.jsx @@ -0,0 +1,48 @@ +import React from 'react'; +import pluralize from 'pluralize'; + +var ResultsMessage = React.createClass({ + render: function() { + var results = this.props.results; + var total = results.total_count; + var resultsMessage; + + // Found some results + if (total > 0) { + resultsMessage = ( + + {total} {pluralize('results', total)} for {this.props.query} + + ); + } + + // Found zero results + if (total == 0) { + resultsMessage = ( + No results for {this.props.query} + ); + } + + // Found results, but no more pages + if (total > 0 && !results.items.length) { + resultsMessage = ( + No more results for {this.props.query} + ); + } + + // No results because error + if (results.error) { + resultsMessage = ( + Error: {results.error.message} + ) + } + + return ( +

    + {resultsMessage} +

    + ) + } +}); + +export default ResultsMessage; \ No newline at end of file diff --git a/app/react/components/results.jsx b/app/react/components/results.jsx new file mode 100644 index 0000000..aca55bc --- /dev/null +++ b/app/react/components/results.jsx @@ -0,0 +1,27 @@ +import React from 'react'; +import ProfileCard from './profile-card.jsx'; +import map from 'lodash-node/modern/collection/map'; + +var Results = React.createClass({ + renderResultsItem: function(user) { + return ( +
  • + +
  • + ) + }, + + render: function() { + var resultsItems = this.props.results && map(this.props.results.items, this.renderResultsItem); + + return ( +
    +
      + {resultsItems} +
    +
    + ) + } +}); + +export default Results; diff --git a/app/react/components/search-form.jsx b/app/react/components/search-form.jsx new file mode 100644 index 0000000..3f34492 --- /dev/null +++ b/app/react/components/search-form.jsx @@ -0,0 +1,33 @@ +import React from 'react/addons'; +import Router, { State } from 'react-router'; +var LinkedStateMixin = React.addons.LinkedStateMixin; + +var SearchForm = React.createClass({ + mixins: [State, LinkedStateMixin], + + getInitialState: function() { + return { value: '' }; + }, + + componentWillReceiveProps: function() { + this.setState({ value: this.getQuery().q }); + }, + + getSearchTerm: function () { + return this.refs.input.getDOMNode().value + }, + + render: function() { + return ( +
    +

    Search for a GitHub user

    +
    + + +
    +
    + ) + } +}); + +export default SearchForm; diff --git a/app/react/components/search.jsx b/app/react/components/search.jsx new file mode 100644 index 0000000..203ff96 --- /dev/null +++ b/app/react/components/search.jsx @@ -0,0 +1,73 @@ +import React from 'react'; +import Router, { Navigation, State } from 'react-router' +import Reflux from 'reflux'; + +import isEmpty from 'lodash-node/modern/lang/isEmpty'; +import isString from 'lodash-node/modern/lang/isString'; + +import SearchForm from './search-form.jsx'; +import Pagination from './pagination.jsx'; +import Results from './results.jsx'; +import ResultsMessage from './results-message.jsx'; + +import User from 'actions/user'; +import SearchStore from 'stores/search'; + +var Search = React.createClass({ + mixins: [ + Navigation, + Reflux.connect(SearchStore), + Reflux.ListenerMixin, + State + ], + + handleSearchFormSubmit(event) { + event.preventDefault(); + + this.transitionTo('users', {}, { + q: this.refs.searchForm.getSearchTerm() + }); + }, + + search(url) { + // Clear results before loading new set + this.setState(SearchStore.getInitialState()); + + if (isString(url) && !isEmpty(this.getQuery())) { + User.search(url); + } + }, + + componentWillReceiveProps() { + // Search if route param changes + this.search(this.getPath()); + }, + + componentDidMount() { + // Search if URL params are present on page render + this.search(this.getPath()); + }, + + render() { + return ( +
    +
    +
    + + +
    +
    +
    +
    + +
    +
    + +
    +
    +
    + ) + } +}); + +export default Search; diff --git a/app/react/components/stat.jsx b/app/react/components/stat.jsx new file mode 100644 index 0000000..cdcc1e8 --- /dev/null +++ b/app/react/components/stat.jsx @@ -0,0 +1,16 @@ +import React from 'react'; +import joinClasses from 'utils/joinClasses'; +import pluralize from 'pluralize'; + +var Stat = React.createClass({ + render: function() { + return ( +
    + {this.props.value} + {pluralize(this.props.title, this.props.value)} +
    + ) + } +}); + +export default Stat; diff --git a/app/react/components/user-detail.jsx b/app/react/components/user-detail.jsx new file mode 100644 index 0000000..b560129 --- /dev/null +++ b/app/react/components/user-detail.jsx @@ -0,0 +1,57 @@ +import React from 'react'; +import Router, { Navigation, State } from 'react-router' +import Reflux from 'reflux'; + +import User from 'actions/user'; +import ProfileStore from 'stores/profile'; +import RepoStore from 'stores/repos'; +import StarredStore from 'stores/starred'; + +import Profile from './profile.jsx'; +import RepoList from './repo-list.jsx'; + +var UserDetail = React.createClass({ + mixins: [ + Navigation, + Reflux.connect(ProfileStore), + Reflux.connect(RepoStore), + Reflux.connect(StarredStore), + Reflux.ListenerMixin, + State + ], + + componentWillReceiveProps: function() { + User.profile(this.getPath(), this.getParams().username); + }, + + componentDidMount: function() { + User.profile(this.getPath(), this.getParams().username); + }, + + render: function() { + return ( +
    +
    +

    Github user detail

    +
    + +
    +
    +
    +
    +
    +

    Popular Repositories

    + +
    +
    +

    Recently Starred

    + +
    +
    +
    +
    + ) + } +}); + +export default UserDetail; diff --git a/app/react/mixins/._cache.js b/app/react/mixins/._cache.js new file mode 100644 index 0000000..0cd760f Binary files /dev/null and b/app/react/mixins/._cache.js differ diff --git a/app/react/mixins/cache.js b/app/react/mixins/cache.js new file mode 100644 index 0000000..706ce1e --- /dev/null +++ b/app/react/mixins/cache.js @@ -0,0 +1,29 @@ +function getItem(key) { + var item = sessionStorage.getItem(key); + + try { + item = JSON.parse(item); + } catch (e) {} + + return item; +} + +function setItem(key, value) { + var type = toType(value); + + if (/object|array/.test(type)) { + value = JSON.stringify(value); + } + + sessionStorage.setItem(key, value); +} + +function removeItem(key) { + sessionStorage.removeItem(key); +} + +function toType(obj) { + return ({}).toString.call(obj).match(/\s([a-z|A-Z]+)/)[1].toLowerCase(); +} + +export { getItem, setItem, removeItem } \ No newline at end of file diff --git a/app/react/stores/._profile.js b/app/react/stores/._profile.js new file mode 100644 index 0000000..0cd760f Binary files /dev/null and b/app/react/stores/._profile.js differ diff --git a/app/react/stores/._repos.js b/app/react/stores/._repos.js new file mode 100644 index 0000000..0cd760f Binary files /dev/null and b/app/react/stores/._repos.js differ diff --git a/app/react/stores/._search.js b/app/react/stores/._search.js new file mode 100644 index 0000000..0cd760f Binary files /dev/null and b/app/react/stores/._search.js differ diff --git a/app/react/stores/._starred.js b/app/react/stores/._starred.js new file mode 100644 index 0000000..0cd760f Binary files /dev/null and b/app/react/stores/._starred.js differ diff --git a/app/react/stores/profile.js b/app/react/stores/profile.js new file mode 100644 index 0000000..90ee390 --- /dev/null +++ b/app/react/stores/profile.js @@ -0,0 +1,38 @@ +import Reflux from 'reflux'; +import User from 'actions/user'; +import pick from 'lodash-node/modern/object/pick'; +import { setItem } from 'mixins/cache'; + +export default Reflux.createStore({ + init() { + this.listenTo(User.profile.completed, this.onProfileCompleted); + }, + + getInitialState() { + return { + user: {} + }; + }, + + onProfileCompleted(data, fromCache) { + if (!fromCache) { + // Only take properties that are needed + let results = pick(data.results, + 'avatar_url', + 'blog', + 'followers', + 'following', + 'repos_url', + 'starred_url', + 'location', + 'login', + 'name', + 'public_repos', + 'html_url'); + setItem(`${results.login}:profile`, results); + this.trigger({ user: results }); + } else { + this.trigger({ user: data }); + } + } +}); \ No newline at end of file diff --git a/app/react/stores/repos.js b/app/react/stores/repos.js new file mode 100644 index 0000000..aa3b413 --- /dev/null +++ b/app/react/stores/repos.js @@ -0,0 +1,56 @@ +import Reflux from 'reflux'; +import User from 'actions/user'; +import ProfileStore from 'stores/profile'; +import pick from 'lodash-node/modern/object/pick'; +import { setItem } from 'mixins/cache'; + +export default Reflux.createStore({ + init() { + this.listenTo(ProfileStore, this.onProfileCompleted); + this.listenTo(User.repos.completed, this.onReposCompleted); + }, + + getInitialState() { + return { + repos: {} + }; + }, + + onProfileCompleted(data) { + this.username = data.user.login; + User.repos(data.user.repos_url, data.user.login); + }, + + onReposCompleted(data, fromCache) { + if (!fromCache) { + let results = data.results + .filter(this.removeForks) + .sort(this.sortByPopular) + .map(this.trimData) + .slice(0, 5); + + setItem(`${this.username}:repos`, results); + this.trigger({ repos: results }); + } else { + this.trigger({ repos: data }); + } + }, + + removeForks(item) { + return item.fork == false; + }, + + sortByPopular(a, b) { + return b.stargazers_count - a.stargazers_count; + }, + + trimData(repo) { + return pick(repo, + 'id', + 'name', + 'html_url', + 'description', + 'stargazers_count' + ) + } +}); \ No newline at end of file diff --git a/app/react/stores/search.js b/app/react/stores/search.js new file mode 100644 index 0000000..dce0f16 --- /dev/null +++ b/app/react/stores/search.js @@ -0,0 +1,57 @@ +import Reflux from 'reflux'; +import User from 'actions/user'; +import pick from 'lodash-node/modern/object/pick'; +import map from 'lodash-node/modern/collection/map'; +import { setItem } from 'mixins/cache'; +import parseLinkHeader from 'utils/parseLinkHeader'; + +export default Reflux.createStore({ + init() { + this.listenTo(User.search.completed, this.onSearchCompleted); + this.listenTo(User.search.failed, this.onSearchFailed); + }, + + getInitialState() { + return { + results: { + items: [] + }, + url: '', + pagination: {} + }; + }, + + onSearchCompleted(data, fromCache) { + if (!fromCache) { + // Only take data that's needed + let results = pick(data.results, 'items', 'total_count'); + results.items = map(data.results.items, item => pick(item, 'avatar_url', 'id', 'login')); + + // Don't mutate the data param + let newData = { + results, + url: data.url, + pagination: data.pagination + }; + + // Cache it + setItem(newData.url, newData); + + // Notify the views + this.trigger(newData); + } else { + // Response came from cache, so send straight to views + this.trigger(data); + } + }, + + onSearchFailed(query, xhr) { + this.trigger({ + results: { + items: [], + error: JSON.parse(xhr.responseText) + }, + query + }); + } +}); diff --git a/app/react/stores/starred.js b/app/react/stores/starred.js new file mode 100644 index 0000000..a3490b3 --- /dev/null +++ b/app/react/stores/starred.js @@ -0,0 +1,36 @@ +import Reflux from 'reflux'; +import User from 'actions/user'; +import ProfileStore from 'stores/profile'; +import pick from 'lodash-node/modern/object/pick'; +import { setItem } from 'mixins/cache'; + +export default Reflux.createStore({ + init() { + this.listenTo(User.starred.completed, this.onStarredCompleted); + this.listenTo(ProfileStore, this.onProfileCompleted); + }, + + getInitialState() { + return { + starred: {} + }; + }, + + onProfileCompleted(data) { + this.username = data.user.login; + User.starred(data.user.starred_url.replace(/\{\/[a-z]+}/g, ''), data.user.login); + }, + + onStarredCompleted(data, fromCache) { + if (!fromCache) { + let results = data.results + .map((repo) => pick(repo, 'id', 'name', 'html_url', 'description')) + .slice(0, 5); + + setItem(`${this.username}:starred`, results); + this.trigger({ starred: results }); + } else { + this.trigger({ starred: data }); + } + } +}); \ No newline at end of file diff --git a/app/react/utils/._joinClasses.js b/app/react/utils/._joinClasses.js new file mode 100644 index 0000000..0cd760f Binary files /dev/null and b/app/react/utils/._joinClasses.js differ diff --git a/app/react/utils/._parseLinkHeader.js b/app/react/utils/._parseLinkHeader.js new file mode 100644 index 0000000..0cd760f Binary files /dev/null and b/app/react/utils/._parseLinkHeader.js differ diff --git a/app/react/utils/joinClasses.js b/app/react/utils/joinClasses.js new file mode 100644 index 0000000..d8aad41 --- /dev/null +++ b/app/react/utils/joinClasses.js @@ -0,0 +1,39 @@ +/** + * Copyright 2013-2014, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule joinClasses + * @typechecks static-only + */ + +"use strict"; + +/** + * Combines multiple className strings into one. + * http://jsperf.com/joinclasses-args-vs-array + * + * @param {...?string} classes + * @return {string} + */ +function joinClasses(className/*, ... */) { + if (!className) { + className = ''; + } + var nextClass; + var argLength = arguments.length; + if (argLength > 1) { + for (var ii = 1; ii < argLength; ii++) { + nextClass = arguments[ii]; + if (nextClass) { + className = (className ? className + ' ' : '') + nextClass; + } + } + } + return className; +} + +module.exports = joinClasses; \ No newline at end of file diff --git a/app/react/utils/parseLinkHeader.js b/app/react/utils/parseLinkHeader.js new file mode 100644 index 0000000..83d5641 --- /dev/null +++ b/app/react/utils/parseLinkHeader.js @@ -0,0 +1,19 @@ +/** + * Extract pagination links from Link header in GitHub API + * */ + +export default function parseLinkHeader(link) { + if (!link) { + return {}; + } + + let parsed = {}; + let reg = /<(.*?)>; rel="(.*)"/; + + link.split(',').forEach(function(part) { + var r = reg.exec(part); + parsed[r[2]] = r[1]; + }); + + return parsed; +} \ No newline at end of file diff --git a/app/suit/._app.css b/app/suit/._app.css new file mode 100644 index 0000000..0cd760f Binary files /dev/null and b/app/suit/._app.css differ diff --git a/app/suit/._base.css b/app/suit/._base.css new file mode 100644 index 0000000..0cd760f Binary files /dev/null and b/app/suit/._base.css differ diff --git a/app/suit/._components b/app/suit/._components new file mode 100644 index 0000000..5e98053 Binary files /dev/null and b/app/suit/._components differ diff --git a/app/suit/._forms.css b/app/suit/._forms.css new file mode 100644 index 0000000..0cd760f Binary files /dev/null and b/app/suit/._forms.css differ diff --git a/app/suit/._utils b/app/suit/._utils new file mode 100644 index 0000000..5e98053 Binary files /dev/null and b/app/suit/._utils differ diff --git a/app/suit/app.css b/app/suit/app.css new file mode 100644 index 0000000..213864f --- /dev/null +++ b/app/suit/app.css @@ -0,0 +1,9 @@ +@custom-media --sm-viewport (min-width: 36.25em); +@custom-media --md-viewport (min-width: 48em); +@custom-media --lg-viewport (min-width: 64em); + +@import "./base.css"; +@import "./forms.css"; +@import "./components/container.css"; +@import "./components/search.css"; +@import "./components/user-detail.css"; diff --git a/app/suit/base.css b/app/suit/base.css new file mode 100644 index 0000000..68a05fa --- /dev/null +++ b/app/suit/base.css @@ -0,0 +1,29 @@ +@import "suitcss-base"; + +:root { + --base-link-color: #069; +} + +html { + color: #444; + font-size: 1rem; + font-family: "Helvetica Neue", Helvetica, sans-serif; +} + +a { + color: var(--base-link-color); + text-decoration: none; +} + +a:hover, +a:focus, +a:active { + color: var(--base-link-color); + text-decoration: underline; +} + +mark { + background-color: #cee2ff; + padding: .1875rem; + border-radius: 3px; +} \ No newline at end of file diff --git a/app/suit/components/._button.css b/app/suit/components/._button.css new file mode 100644 index 0000000..0cd760f Binary files /dev/null and b/app/suit/components/._button.css differ diff --git a/app/suit/components/._container.css b/app/suit/components/._container.css new file mode 100644 index 0000000..0cd760f Binary files /dev/null and b/app/suit/components/._container.css differ diff --git a/app/suit/components/._pagination.css b/app/suit/components/._pagination.css new file mode 100644 index 0000000..0cd760f Binary files /dev/null and b/app/suit/components/._pagination.css differ diff --git a/app/suit/components/._profile-card.css b/app/suit/components/._profile-card.css new file mode 100644 index 0000000..0cd760f Binary files /dev/null and b/app/suit/components/._profile-card.css differ diff --git a/app/suit/components/._profile-stat-group.css b/app/suit/components/._profile-stat-group.css new file mode 100644 index 0000000..0cd760f Binary files /dev/null and b/app/suit/components/._profile-stat-group.css differ diff --git a/app/suit/components/._profile.css b/app/suit/components/._profile.css new file mode 100644 index 0000000..0cd760f Binary files /dev/null and b/app/suit/components/._profile.css differ diff --git a/app/suit/components/._repo-list.css b/app/suit/components/._repo-list.css new file mode 100644 index 0000000..0cd760f Binary files /dev/null and b/app/suit/components/._repo-list.css differ diff --git a/app/suit/components/._repo.css b/app/suit/components/._repo.css new file mode 100644 index 0000000..0cd760f Binary files /dev/null and b/app/suit/components/._repo.css differ diff --git a/app/suit/components/._results-message.css b/app/suit/components/._results-message.css new file mode 100644 index 0000000..0cd760f Binary files /dev/null and b/app/suit/components/._results-message.css differ diff --git a/app/suit/components/._results.css b/app/suit/components/._results.css new file mode 100644 index 0000000..0cd760f Binary files /dev/null and b/app/suit/components/._results.css differ diff --git a/app/suit/components/._search.css b/app/suit/components/._search.css new file mode 100644 index 0000000..0cd760f Binary files /dev/null and b/app/suit/components/._search.css differ diff --git a/app/suit/components/._searchform.css b/app/suit/components/._searchform.css new file mode 100644 index 0000000..0cd760f Binary files /dev/null and b/app/suit/components/._searchform.css differ diff --git a/app/suit/components/._stat.css b/app/suit/components/._stat.css new file mode 100644 index 0000000..0cd760f Binary files /dev/null and b/app/suit/components/._stat.css differ diff --git a/app/suit/components/._user-detail.css b/app/suit/components/._user-detail.css new file mode 100644 index 0000000..0cd760f Binary files /dev/null and b/app/suit/components/._user-detail.css differ diff --git a/app/suit/components/button.css b/app/suit/components/button.css new file mode 100644 index 0000000..f19a78f --- /dev/null +++ b/app/suit/components/button.css @@ -0,0 +1,28 @@ +@import "suitcss-components-button"; + +.Button--default { + background-color: #eee; + color: #444; + border-color: #d9d9d9 #d9d9d9 #ccc; + border-radius: 4px; +} + +.Button--default:hover, +.Button--default:focus, +.Button--default:active, +.Button--default.is-pressed { + background-color: #f5f5f5; + color: #222; + border-color: #c6c6c6 #c6c6c6 #bbb; + box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2); +} + +.Button--default:focus { + outline: 0; +} + +.Button--default:active, +.Button--default.is-pressed { + background-color: #ccc; + box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.2); +} \ No newline at end of file diff --git a/app/suit/components/container.css b/app/suit/components/container.css new file mode 100644 index 0000000..4725a2c --- /dev/null +++ b/app/suit/components/container.css @@ -0,0 +1,7 @@ +/** @define Container; use strict */ + +.Container { + width: 95%; + margin: 0 auto; + max-width: 1020px; +} \ No newline at end of file diff --git a/app/suit/components/pagination.css b/app/suit/components/pagination.css new file mode 100644 index 0000000..e6529a5 --- /dev/null +++ b/app/suit/components/pagination.css @@ -0,0 +1,23 @@ +/** @define Pagination; use strict */ + +@import "suitcss-utils-layout"; +@import "suitcss-utils-display"; +@import "suitcss-utils-link"; + +.Pagination { + text-align: center; +} + +.Pagination-link { + color: #333; + display: inline-block; + padding: 3px 6px; +} + +.Pagination-link--prev { + margin-right: 8px; +} + +.Pagination-link--next { + margin-left: 8px; +} \ No newline at end of file diff --git a/app/suit/components/profile-card.css b/app/suit/components/profile-card.css new file mode 100644 index 0000000..730a050 --- /dev/null +++ b/app/suit/components/profile-card.css @@ -0,0 +1,47 @@ +/** @define ProfileCard; use strict */ + +@import "suitcss-utils-layout"; +@import "suitcss-utils-text"; +@import "suitcss-utils-link"; + +.ProfileCard { + border: 1px solid #ccc; + border-radius: 3px; + background-color: #f2f2f2; + transition: background-color .2s ease; +} + +.ProfileCard:hover { + background-color: #e6e6e6; +} + +.ProfileCard:hover .ProfileCard-avatar { + opacity: 1; +} + +.ProfileCard-link { + padding: .625rem; + display: block; + color: #333; +} + +.ProfileCard-link:hover { + color: inherit; +} + +.ProfileCard-username { + overflow: hidden; + margin-top: .5rem; + font-size: 1.125rem; + font-weight: 500; +} + +.ProfileCard-avatar { + border-radius: 50%; + opacity: .8; + transition: opacity .2s ease;; + border: 1px solid #999; + display: block; + float: left; + margin-right: .625rem; +} diff --git a/app/suit/components/profile-stat-group.css b/app/suit/components/profile-stat-group.css new file mode 100644 index 0000000..b7427d9 --- /dev/null +++ b/app/suit/components/profile-stat-group.css @@ -0,0 +1,6 @@ +/** @define ProfileStatGroup; use strict */ + +.ProfileStatGroup-item { + display: inline-block; + margin-right: 1.2rem; +} \ No newline at end of file diff --git a/app/suit/components/profile.css b/app/suit/components/profile.css new file mode 100644 index 0000000..c316dca --- /dev/null +++ b/app/suit/components/profile.css @@ -0,0 +1,58 @@ +/** @define Profile; use strict */ + +@import "suitcss-utils-layout"; +@import "./stat.css"; +@import "./profile-stat-group.css"; +@import "../utils/img.css"; + +.Profile { + text-align: center; + position: relative; +} + +.Profile-avatarImg { + margin-left: auto; + margin-right: auto; + border-radius: 5px; + border: 2px solid #fff; +} + +.Profile-userItem { + margin-bottom: .1875rem; +} + +.Profile-userItem:empty { + margin-bottom: 0; +} + +.Profile-name { + font-size: 1.8rem; + margin-bottom: .5rem; +} + +.Profile-userInfo { + color: #777; +} + +.Profile-wrapProfileStatGroup { + margin-top: 15px; +} + +.Profile-link { + color: inherit; +} + +@media (--sm-viewport) { + .Profile { + text-align: left; + } + + .Profile-avatar { + float: left; + margin-right: .625rem; + } + + .Profile-body { + float: left; + } +} \ No newline at end of file diff --git a/app/suit/components/repo-list.css b/app/suit/components/repo-list.css new file mode 100644 index 0000000..000901f --- /dev/null +++ b/app/suit/components/repo-list.css @@ -0,0 +1,13 @@ +/** @define RepoList; use strict */ + +@import "./repo.css"; + +.RepoList-item { + margin-bottom: 1rem; + padding-bottom: 1rem; + border-bottom: 1px dotted #ddd; +} + +.RepoList-item:last-child { + border-bottom: none; +} \ No newline at end of file diff --git a/app/suit/components/repo.css b/app/suit/components/repo.css new file mode 100644 index 0000000..886f82a --- /dev/null +++ b/app/suit/components/repo.css @@ -0,0 +1,35 @@ +/** @define Repo; use strict */ + +@import "suitcss-utils-link"; +@import "suitcss-utils-text"; + +.Repo { + position: relative; + min-height: 65px; +} + +.Repo-name { + margin-bottom: .3125rem; +} + +.Repo-description { + font-size: .9375rem; + max-width: 85%; +} + +.Repo-wrapStat { + position: absolute; + top: 25%; + right: 10px; +} + +.Repo-link { + padding: .625rem; + border-radius: 5px; + transition: background-color .2s ease; + color: inherit; +} + +.Repo-link:hover { + background-color: #f4f4f4; +} diff --git a/app/suit/components/results-message.css b/app/suit/components/results-message.css new file mode 100644 index 0000000..b6097a3 --- /dev/null +++ b/app/suit/components/results-message.css @@ -0,0 +1,6 @@ +/** @define ResultsMessage */ + +.ResultsMessage { + text-align: center; + margin-bottom: .9375rem; +} \ No newline at end of file diff --git a/app/suit/components/results.css b/app/suit/components/results.css new file mode 100644 index 0000000..51fd0a7 --- /dev/null +++ b/app/suit/components/results.css @@ -0,0 +1,51 @@ +/** @define Results; use strict */ + +@import "suitcss-utils-layout"; +@import "./profile-card.css"; + +.Results-item { + margin-bottom: 1.5%; +} + +@media (min-width: 28.125em) { + .Results-item { + float: left; + } +} + +@media (min-width: 28.125em) and (max-width: 48em) { + .Results-item { + width: 49%; + margin-right: 1.5%; + } + + .Results-item:nth-child(2n) { + margin-right: 0; + } +} + +/* 3 col */ +@media (min-width: 48em) and (max-width: 67em) { + .Results-item { + width: 32.6%; + margin-right: 1%; + margin-bottom: 1%; + } + + .Results-item:nth-child(3n) { + margin-right: 0; + } +} + +/* 4 col */ +@media (min-width: 67em) { + .Results-item { + width: 24.25%; + margin-right: 1%; + margin-bottom: 1%; + } + + .Results-item:nth-child(4n) { + margin-right: 0; + } +} \ No newline at end of file diff --git a/app/suit/components/search.css b/app/suit/components/search.css new file mode 100644 index 0000000..354dece --- /dev/null +++ b/app/suit/components/search.css @@ -0,0 +1,24 @@ +/** @define Search; use strict */ + +@import "suitcss-utils-size"; +@import "./results.css"; +@import "./searchform.css"; +@import "./results-message.css"; +@import "./pagination.css"; +@import "../utils/space.css"; + +.Search { + padding: 1.25rem 0; +} + +.Search-item { + margin-bottom: 1.5rem; +} + +.Search-item:last-child { + margin-bottom: 0; +} + +.Search-wrapSearchForm { + border-bottom: 1px solid #ddd; +} \ No newline at end of file diff --git a/app/suit/components/searchform.css b/app/suit/components/searchform.css new file mode 100644 index 0000000..237a079 --- /dev/null +++ b/app/suit/components/searchform.css @@ -0,0 +1,29 @@ +/** @define SearchForm; use strict */ + +@import "./button.css"; +@import "suitcss-utils-size"; +@import "../utils/space.css"; + +.SearchForm { + padding-bottom: 1.25rem; +} + +.SearchForm-title { + margin-bottom: .625rem; + text-align: center; + font-size: 1.6rem; +} + +.SearchForm-input { + width: calc(100% - 84px); + border-top-right-radius: 0; + border-bottom-right-radius: 0; + border-right: 0; +} + +.SearchForm-btn { + width: 48px; + height: 48px; + border-top-left-radius: 0; + border-bottom-left-radius: 0; +} \ No newline at end of file diff --git a/app/suit/components/stat.css b/app/suit/components/stat.css new file mode 100644 index 0000000..eced9c6 --- /dev/null +++ b/app/suit/components/stat.css @@ -0,0 +1,18 @@ +/** @define Stat; use strict */ + +.Stat { + text-align: center; +} + +.Stat--large .Stat-value { + font-size: 1.375rem; +} + +.Stat-value { + display: block; +} + +.Stat-title { + display: block; + font-size: .75em; +} \ No newline at end of file diff --git a/app/suit/components/user-detail.css b/app/suit/components/user-detail.css new file mode 100644 index 0000000..9b8a745 --- /dev/null +++ b/app/suit/components/user-detail.css @@ -0,0 +1,30 @@ +/** @define UserDetail; use strict */ + +@import "suitcss-utils-display"; +@import "suitcss-components-grid"; +@import "suitcss-utils-size"; +@import "./profile.css"; +@import "./repo-list.css"; + +.UserDetail-item { + margin-bottom: 1.5rem; +} + +.UserDetail-header { + padding-top: 1.25rem; + padding-bottom: 1rem; + background-color: #f2f2f2; + margin-bottom: 1rem; +} + +.UserDetail-itemHeader { + margin-bottom: 1rem; +} + +@media (--sm-viewport) { + .UserDetail-header { + height: 170px; + padding-bottom: 0; + margin-bottom: 3rem; + } +} \ No newline at end of file diff --git a/app/suit/forms.css b/app/suit/forms.css new file mode 100644 index 0000000..5f976e7 --- /dev/null +++ b/app/suit/forms.css @@ -0,0 +1,49 @@ +@import "suitcss-utils-display"; + +input[type="search"] { + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; +} + +.FormControl { + display: block; + width: 100%; + height: 34px; + padding: 6px 12px; + line-height: 1.42857143; + color: #555; + background-color: #fff; + background-image: none; + border: 1px solid #ccc; + border-radius: 4px; + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075); + box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075); + -webkit-transition: border-color ease-in-out .15s, -webkit-box-shadow ease-in-out .15s; + -o-transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s; + transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s; +} + +.FormControl:focus { + border-color: #66afe9; + outline: 0; + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 8px rgba(102, 175, 233, .6); + box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 8px rgba(102, 175, 233, .6); +} + +.FormControl::-moz-placeholder { + color: #999; + opacity: 1; +} + +.FormControl:-ms-input-placeholder { + color: #999; +} + +.FormControl::-webkit-input-placeholder { + color: #999; +} + +input[type="search"] { + -webkit-appearance: none; +} \ No newline at end of file diff --git a/app/suit/utils/._img.css b/app/suit/utils/._img.css new file mode 100644 index 0000000..0cd760f Binary files /dev/null and b/app/suit/utils/._img.css differ diff --git a/app/suit/utils/._space.css b/app/suit/utils/._space.css new file mode 100644 index 0000000..0cd760f Binary files /dev/null and b/app/suit/utils/._space.css differ diff --git a/app/suit/utils/img.css b/app/suit/utils/img.css new file mode 100644 index 0000000..3d46ffc --- /dev/null +++ b/app/suit/utils/img.css @@ -0,0 +1,5 @@ +.u-imgResponsive { + display: block; + max-width: 100%; + height: auto; +} \ No newline at end of file diff --git a/app/suit/utils/space.css b/app/suit/utils/space.css new file mode 100644 index 0000000..a62e80a --- /dev/null +++ b/app/suit/utils/space.css @@ -0,0 +1,44 @@ +.u-mXA { + margin-left: auto; + margin-right: auto; +} + +.u-mZ { + margin: 0 !important; +} + +.u-pZ { + padding: 0 !important; +} + +.u-mtZ { + margin-top: 0 !important; +} + +.u-mrZ { + margin-right: 0 !important; +} + +.u-mbZ { + margin-bottom: 0 !important; +} + +.u-mlZ { + margin-left: 0 !important; +} + +.u-ptZ { + padding-top: 0 !important; +} + +.u-prZ { + padding-right: 0 !important; +} + +.u-pbZ { + padding-bottom: 0 !important; +} + +.u-plZ { + padding-left: 0 !important; +} \ No newline at end of file diff --git a/built/._app.built.css b/built/._app.built.css new file mode 100644 index 0000000..0cd760f Binary files /dev/null and b/built/._app.built.css differ diff --git a/built/._app.built.js b/built/._app.built.js new file mode 100644 index 0000000..0cd760f Binary files /dev/null and b/built/._app.built.js differ diff --git a/built/._app.built.js.map b/built/._app.built.js.map new file mode 100644 index 0000000..0cd760f Binary files /dev/null and b/built/._app.built.js.map differ diff --git a/built/._app.js.map b/built/._app.js.map new file mode 100644 index 0000000..0cd760f Binary files /dev/null and b/built/._app.js.map differ diff --git a/built/app.built.css b/built/app.built.css new file mode 100644 index 0000000..2a30f2e --- /dev/null +++ b/built/app.built.css @@ -0,0 +1,2154 @@ +/*! normalize.css v3.0.2 | MIT License | git.io/normalize */ + +/** + * 1. Set default font family to sans-serif. + * 2. Prevent iOS text size adjust after orientation change, without disabling + * user zoom. + */ + +html { + font-family: sans-serif; + /* 1 */ + -ms-text-size-adjust: 100%; + /* 2 */ + -webkit-text-size-adjust: 100%; + /* 2 */ +} + +/** + * Remove default margin. + */ + +body { + margin: 0; +} + +/* HTML5 display definitions + ========================================================================== */ + +/** + * Correct `block` display not defined for any HTML5 element in IE 8/9. + * Correct `block` display not defined for `details` or `summary` in IE 10/11 + * and Firefox. + * Correct `block` display not defined for `main` in IE 11. + */ + +article, +aside, +details, +figcaption, +figure, +footer, +header, +hgroup, +main, +menu, +nav, +section, +summary { + display: block; +} + +/** + * 1. Correct `inline-block` display not defined in IE 8/9. + * 2. Normalize vertical alignment of `progress` in Chrome, Firefox, and Opera. + */ + +audio, +canvas, +progress, +video { + display: inline-block; + /* 1 */ + vertical-align: baseline; + /* 2 */ +} + +/** + * Prevent modern browsers from displaying `audio` without controls. + * Remove excess height in iOS 5 devices. + */ + +audio:not([controls]) { + display: none; + height: 0; +} + +/** + * Address `[hidden]` styling not present in IE 8/9/10. + * Hide the `template` element in IE 8/9/11, Safari, and Firefox < 22. + */ + +[hidden], +template { + display: none; +} + +/* Links + ========================================================================== */ + +/** + * Remove the gray background color from active links in IE 10. + */ + +a { + background-color: transparent; +} + +/** + * Improve readability when focused and also mouse hovered in all browsers. + */ + +a:active, +a:hover { + outline: 0; +} + +/* Text-level semantics + ========================================================================== */ + +/** + * Address styling not present in IE 8/9/10/11, Safari, and Chrome. + */ + +abbr[title] { + border-bottom: 1px dotted; +} + +/** + * Address style set to `bolder` in Firefox 4+, Safari, and Chrome. + */ + +b, +strong { + font-weight: bold; +} + +/** + * Address styling not present in Safari and Chrome. + */ + +dfn { + font-style: italic; +} + +/** + * Address variable `h1` font-size and margin within `section` and `article` + * contexts in Firefox 4+, Safari, and Chrome. + */ + +h1 { + font-size: 2em; + margin: 0.67em 0; +} + +/** + * Address styling not present in IE 8/9. + */ + +mark { + background: #ff0; + color: #000; +} + +/** + * Address inconsistent and variable font size in all browsers. + */ + +small { + font-size: 80%; +} + +/** + * Prevent `sub` and `sup` affecting `line-height` in all browsers. + */ + +sub, +sup { + font-size: 75%; + line-height: 0; + position: relative; + vertical-align: baseline; +} + +sup { + top: -0.5em; +} + +sub { + bottom: -0.25em; +} + +/* Embedded content + ========================================================================== */ + +/** + * Remove border when inside `a` element in IE 8/9/10. + */ + +img { + border: 0; +} + +/** + * Correct overflow not hidden in IE 9/10/11. + */ + +svg:not(:root) { + overflow: hidden; +} + +/* Grouping content + ========================================================================== */ + +/** + * Address margin not present in IE 8/9 and Safari. + */ + +figure { + margin: 1em 40px; +} + +/** + * Address differences between Firefox and other browsers. + */ + +hr { + box-sizing: content-box; + height: 0; +} + +/** + * Contain overflow in all browsers. + */ + +pre { + overflow: auto; +} + +/** + * Address odd `em`-unit font size rendering in all browsers. + */ + +code, +kbd, +pre, +samp { + font-family: monospace, monospace; + font-size: 1em; +} + +/* Forms + ========================================================================== */ + +/** + * Known limitation: by default, Chrome and Safari on OS X allow very limited + * styling of `select`, unless a `border` property is set. + */ + +/** + * 1. Correct color not being inherited. + * Known issue: affects color of disabled elements. + * 2. Correct font properties not being inherited. + * 3. Address margins set differently in Firefox 4+, Safari, and Chrome. + */ + +button, +input, +optgroup, +select, +textarea { + color: inherit; + /* 1 */ + font: inherit; + /* 2 */ + margin: 0; + /* 3 */ +} + +/** + * Address `overflow` set to `hidden` in IE 8/9/10/11. + */ + +button { + overflow: visible; +} + +/** + * Address inconsistent `text-transform` inheritance for `button` and `select`. + * All other form control elements do not inherit `text-transform` values. + * Correct `button` style inheritance in Firefox, IE 8/9/10/11, and Opera. + * Correct `select` style inheritance in Firefox. + */ + +button, +select { + text-transform: none; +} + +/** + * 1. Avoid the WebKit bug in Android 4.0.* where (2) destroys native `audio` + * and `video` controls. + * 2. Correct inability to style clickable `input` types in iOS. + * 3. Improve usability and consistency of cursor style between image-type + * `input` and others. + */ + +button, +html input[type="button"], +input[type="reset"], +input[type="submit"] { + -webkit-appearance: button; + /* 2 */ + cursor: pointer; + /* 3 */ +} + +/** + * Re-set default cursor for disabled elements. + */ + +button[disabled], +html input[disabled] { + cursor: default; +} + +/** + * Remove inner padding and border in Firefox 4+. + */ + +button::-moz-focus-inner, +input::-moz-focus-inner { + border: 0; + padding: 0; +} + +/** + * Address Firefox 4+ setting `line-height` on `input` using `!important` in + * the UA stylesheet. + */ + +input { + line-height: normal; +} + +/** + * It's recommended that you don't attempt to style these elements. + * Firefox's implementation doesn't respect box-sizing, padding, or width. + * + * 1. Address box sizing set to `content-box` in IE 8/9/10. + * 2. Remove excess padding in IE 8/9/10. + */ + +input[type="checkbox"], +input[type="radio"] { + box-sizing: border-box; + /* 1 */ + padding: 0; + /* 2 */ +} + +/** + * Fix the cursor style for Chrome's increment/decrement buttons. For certain + * `font-size` values of the `input`, it causes the cursor style of the + * decrement button to change from `default` to `text`. + */ + +input[type="number"]::-webkit-inner-spin-button, +input[type="number"]::-webkit-outer-spin-button { + height: auto; +} + +/** + * 1. Address `appearance` set to `searchfield` in Safari and Chrome. + * 2. Address `box-sizing` set to `border-box` in Safari and Chrome + * (include `-moz` to future-proof). + */ + +input[type="search"] { + -webkit-appearance: textfield; + /* 1 */ + /* 2 */ + box-sizing: content-box; +} + +/** + * Remove inner padding and search cancel button in Safari and Chrome on OS X. + * Safari (but not Chrome) clips the cancel button when the search input has + * padding (and `textfield` appearance). + */ + +input[type="search"]::-webkit-search-cancel-button, +input[type="search"]::-webkit-search-decoration { + -webkit-appearance: none; +} + +/** + * Define consistent border, margin, and padding. + */ + +fieldset { + border: 1px solid #c0c0c0; + margin: 0 2px; + padding: 0.35em 0.625em 0.75em; +} + +/** + * 1. Correct `color` not being inherited in IE 8/9/10/11. + * 2. Remove padding so people aren't caught out if they zero out fieldsets. + */ + +legend { + border: 0; + /* 1 */ + padding: 0; + /* 2 */ +} + +/** + * Remove default vertical scrollbar in IE 8/9/10/11. + */ + +textarea { + overflow: auto; +} + +/** + * Don't inherit the `font-weight` (applied by a rule above). + * NOTE: the default cannot safely be changed in Chrome and Safari on OS X. + */ + +optgroup { + font-weight: bold; +} + +/* Tables + ========================================================================== */ + +/** + * Remove most spacing between table cells. + */ + +table { + border-collapse: collapse; + border-spacing: 0; +} + +td, +th { + padding: 0; +} + +/** + * A thin layer on top of normalize.css that provides a starting point more + * suitable for web applications. Removes the default spacing and border for + * appropriate elements. + */ + +blockquote, +dl, +dd, +h1, +h2, +h3, +h4, +h5, +h6, +figure, +p, +pre { + margin: 0; +} + +button { + background: transparent; + border: 0; + padding: 0; +} + +/** + * Work around a Firefox/IE bug where the transparent `button` background + * results in a loss of the default `button` focus styles. + */ + +button:focus { + outline: 1px dotted; + outline: 5px auto -webkit-focus-ring-color; +} + +fieldset { + border: 0; + margin: 0; + padding: 0; +} + +iframe { + border: 0; +} + +ol, +ul { + list-style: none; + margin: 0; + padding: 0; +} + +/** + * Suppress the focus outline on links that cannot be accessed via keyboard. + * This prevents an unwanted focus outline from appearing around elements that + * might still respond to pointer events. + */ + +[tabindex="-1"]:focus { + outline: none !important; +} + + + +html { + color: #444; + font-size: 1rem; + font-family: "Helvetica Neue", Helvetica, sans-serif; +} + +a { + color: #069; + text-decoration: none; +} + +a:hover, +a:focus, +a:active { + color: #069; + text-decoration: underline; +} + +mark { + background-color: #cee2ff; + padding: .1875rem; + border-radius: 3px; +} + +/** + * Display-type utilities + */ + +.u-block { + display: block !important; +} + +.u-hidden { + display: none !important; +} + +/** + * Completely remove from the flow but leave available to screen readers. + */ + +.u-hiddenVisually { + position: absolute !important; + overflow: hidden !important; + width: 1px !important; + height: 1px !important; + padding: 0 !important; + border: 0 !important; + clip: rect(1px, 1px, 1px, 1px) !important; +} + +.u-inline { + display: inline !important; +} + +/** + * 1. Fix for Firefox bug: an image styled `max-width:100%` within an + * inline-block will display at its default size, and not limit its width to + * 100% of an ancestral container. + */ + +.u-inlineBlock { + display: inline-block !important; + max-width: 100%; + /* 1 */ +} + +.u-table { + display: table !important; +} + +.u-tableCell { + display: table-cell !important; +} + +.u-tableRow { + display: table-row !important; +} + +input[type="search"] { + box-sizing: border-box; +} + +.FormControl { + display: block; + width: 100%; + height: 34px; + padding: 6px 12px; + line-height: 1.42857143; + color: #555; + background-color: #fff; + background-image: none; + border: 1px solid #ccc; + border-radius: 4px; + box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075); + -webkit-transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s; + transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s; +} + +.FormControl:focus { + border-color: #66afe9; + outline: 0; + box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 8px rgba(102, 175, 233, .6); +} + +.FormControl::-moz-placeholder { + color: #999; + opacity: 1; +} + +.FormControl:-ms-input-placeholder { + color: #999; +} + +.FormControl::-webkit-input-placeholder { + color: #999; +} + +input[type="search"] { + -webkit-appearance: none; +} + +/** @define Container; use strict */ + +.Container { + width: 95%; + margin: 0 auto; + max-width: 1020px; +} + +/** @define Search; use strict */ + +/** + * Sizing utilities + */ + +/* Intrinsic widths + ========================================================================== */ + +/** + * Make an element shrink wrap its content. + */ + +.u-sizeFit, +.u-sizeFitAlt { + display: block !important; + float: left !important; + width: auto !important; +} + +.u-sizeFitAlt { + float: right !important; +} + +/** + * Make an element fill the remaining space. + * N.B. This will hide overflow. + */ + +.u-sizeFill { + display: block !important; + overflow: hidden !important; + width: auto !important; +} + +/** + * An alternative method to make an element fill the remaining space. + * N.B. Do not use if child elements might be wider than the remaining space. + * In Chrome, Safari, and Firefox it results in undesired layout. + */ + +.u-sizeFillAlt { + display: table-cell !important; + max-width: 100% !important; + width: 10000px !important; +} + +/** + * Make an element the width of its parent. + */ + +.u-sizeFull { + box-sizing: border-box !important; + display: block !important; + width: 100% !important; +} + +/* Proportional widths + ========================================================================== */ + +/** + * Specify the proportional width of an object. + * Intentional redundancy build into each set of unit classes. + * Supports: 2, 3, 4, 5, 6, 8, 10, 12 part + */ + +.u-size1of12 { + width: 8.333333333333332% !important; +} + +.u-size1of10 { + width: 10% !important; +} + +.u-size1of8 { + width: 12.5% !important; +} + +.u-size1of6, +.u-size2of12 { + width: 16.666666666666664% !important; +} + +.u-size1of5, +.u-size2of10 { + width: 20% !important; +} + +.u-size1of4, +.u-size2of8, +.u-size3of12 { + width: 25% !important; +} + +.u-size3of10 { + width: 30% !important; +} + +.u-size1of3, +.u-size2of6, +.u-size4of12 { + width: 33.33333333333333% !important; +} + +.u-size3of8 { + width: 37.5% !important; +} + +.u-size2of5, +.u-size4of10 { + width: 40% !important; +} + +.u-size5of12 { + width: 41.66666666666667% !important; +} + +.u-size1of2, +.u-size2of4, +.u-size3of6, +.u-size4of8, +.u-size5of10, +.u-size6of12 { + width: 50% !important; +} + +.u-size7of12 { + width: 58.333333333333336% !important; +} + +.u-size3of5, +.u-size6of10 { + width: 60% !important; +} + +.u-size5of8 { + width: 62.5% !important; +} + +.u-size2of3, +.u-size4of6, +.u-size8of12 { + width: 66.66666666666666% !important; +} + +.u-size7of10 { + width: 70% !important; +} + +.u-size3of4, +.u-size6of8, +.u-size9of12 { + width: 75% !important; +} + +.u-size4of5, +.u-size8of10 { + width: 80% !important; +} + +.u-size5of6, +.u-size10of12 { + width: 83.33333333333334% !important; +} + +.u-size7of8 { + width: 87.5% !important; +} + +.u-size9of10 { + width: 90% !important; +} + +.u-size11of12 { + width: 91.66666666666666% !important; +} + +/** + * Size: breakpoint 1 (small) + */ + +@media (min-width: 36.25em) { + /** + * Make an element shrink wrap its content. + */ + + .u-sm-sizeFit, + .u-sm-sizeFitAlt { + display: block !important; + float: left !important; + width: auto !important; + } + + .u-sm-sizeFitAlt { + float: right !important; + } + + /** + * Make an element fill the remaining space. + * N.B. This will hide overflow. + */ + + .u-sm-sizeFill { + display: block !important; + overflow: hidden !important; + width: auto !important; + } + + /** + * An alternative method to make an element fill the remaining space. + * N.B. Do not use if child elements might be wider than the remaining space. + * In Chrome, Safari, and Firefox it results in undesired layout. + */ + + .u-sm-sizeFillAlt { + display: table-cell !important; + max-width: 100% !important; + width: 10000px !important; + } + + /** + * Make an element the width of its parent. + */ + + .u-sm-sizeFull { + box-sizing: border-box !important; + display: block !important; + width: 100% !important; + } + + /* Proportional widths: breakpoint 1 (small) + ========================================================================== */ + + /** + * Specify the proportional width of an object. + * Intentional redundancy build into each set of unit classes. + * Supports: 2, 3, 4, 5, 6, 8, 10, 12 part + */ + + .u-sm-size1of12 { + width: 8.333333333333332% !important; + } + + .u-sm-size1of10 { + width: 10% !important; + } + + .u-sm-size1of8 { + width: 12.5% !important; + } + + .u-sm-size1of6, + .u-sm-size2of12 { + width: 16.666666666666664% !important; + } + + .u-sm-size1of5, + .u-sm-size2of10 { + width: 20% !important; + } + + .u-sm-size1of4, + .u-sm-size2of8, + .u-sm-size3of12 { + width: 25% !important; + } + + .u-sm-size3of10 { + width: 30% !important; + } + + .u-sm-size1of3, + .u-sm-size2of6, + .u-sm-size4of12 { + width: 33.33333333333333% !important; + } + + .u-sm-size3of8 { + width: 37.5% !important; + } + + .u-sm-size2of5, + .u-sm-size4of10 { + width: 40% !important; + } + + .u-sm-size5of12 { + width: 41.66666666666667% !important; + } + + .u-sm-size1of2, + .u-sm-size2of4, + .u-sm-size3of6, + .u-sm-size4of8, + .u-sm-size5of10, + .u-sm-size6of12 { + width: 50% !important; + } + + .u-sm-size7of12 { + width: 58.333333333333336% !important; + } + + .u-sm-size3of5, + .u-sm-size6of10 { + width: 60% !important; + } + + .u-sm-size5of8 { + width: 62.5% !important; + } + + .u-sm-size2of3, + .u-sm-size4of6, + .u-sm-size8of12 { + width: 66.66666666666666% !important; + } + + .u-sm-size7of10 { + width: 70% !important; + } + + .u-sm-size3of4, + .u-sm-size6of8, + .u-sm-size9of12 { + width: 75% !important; + } + + .u-sm-size4of5, + .u-sm-size8of10 { + width: 80% !important; + } + + .u-sm-size5of6, + .u-sm-size10of12 { + width: 83.33333333333334% !important; + } + + .u-sm-size7of8 { + width: 87.5% !important; + } + + .u-sm-size9of10 { + width: 90% !important; + } + + .u-sm-size11of12 { + width: 91.66666666666666% !important; + } +} + +/** + * Size: breakpoint 2 (medium) + */ + +@media (min-width: 48em) { + /** + * Make an element shrink wrap its content. + */ + + .u-md-sizeFit, + .u-md-sizeFitAlt { + display: block !important; + float: left !important; + width: auto !important; + } + + .u-md-sizeFitAlt { + float: right !important; + } + + /** + * Make an element fill the remaining space. + * N.B. This will hide overflow. + */ + + .u-md-sizeFill { + display: block !important; + overflow: hidden !important; + width: auto !important; + } + + /** + * An alternative method to make an element fill the remaining space. + * N.B. Do not use if child elements might be wider than the remaining space. + * In Chrome, Safari, and Firefox it results in undesired layout. + */ + + .u-md-sizeFillAlt { + display: table-cell !important; + max-width: 100% !important; + width: 10000px !important; + } + + /** + * Make an element the width of its parent. + */ + + .u-md-sizeFull { + box-sizing: border-box !important; + display: block !important; + width: 100% !important; + } + + /* Proportional widths: breakpoint 2 (medium) + ========================================================================== */ + + /** + * Specify the proportional width of an object. + * Intentional redundancy build into each set of unit classes. + * Supports: 2, 3, 4, 5, 6, 8, 10, 12 part + */ + + .u-md-size1of12 { + width: 8.333333333333332% !important; + } + + .u-md-size1of10 { + width: 10% !important; + } + + .u-md-size1of8 { + width: 12.5% !important; + } + + .u-md-size1of6, + .u-md-size2of12 { + width: 16.666666666666664% !important; + } + + .u-md-size1of5, + .u-md-size2of10 { + width: 20% !important; + } + + .u-md-size1of4, + .u-md-size2of8, + .u-md-size3of12 { + width: 25% !important; + } + + .u-md-size3of10 { + width: 30% !important; + } + + .u-md-size1of3, + .u-md-size2of6, + .u-md-size4of12 { + width: 33.33333333333333% !important; + } + + .u-md-size3of8 { + width: 37.5% !important; + } + + .u-md-size2of5, + .u-md-size4of10 { + width: 40% !important; + } + + .u-md-size5of12 { + width: 41.66666666666667% !important; + } + + .u-md-size1of2, + .u-md-size2of4, + .u-md-size3of6, + .u-md-size4of8, + .u-md-size5of10, + .u-md-size6of12 { + width: 50% !important; + } + + .u-md-size7of12 { + width: 58.333333333333336% !important; + } + + .u-md-size3of5, + .u-md-size6of10 { + width: 60% !important; + } + + .u-md-size5of8 { + width: 62.5% !important; + } + + .u-md-size2of3, + .u-md-size4of6, + .u-md-size8of12 { + width: 66.66666666666666% !important; + } + + .u-md-size7of10 { + width: 70% !important; + } + + .u-md-size3of4, + .u-md-size6of8, + .u-md-size9of12 { + width: 75% !important; + } + + .u-md-size4of5, + .u-md-size8of10 { + width: 80% !important; + } + + .u-md-size5of6, + .u-md-size10of12 { + width: 83.33333333333334% !important; + } + + .u-md-size7of8 { + width: 87.5% !important; + } + + .u-md-size9of10 { + width: 90% !important; + } + + .u-md-size11of12 { + width: 91.66666666666666% !important; + } +} + +/** + * Size: breakpoint 3 (large) + */ + +@media (min-width: 64em) { + /** + * Make an element shrink wrap its content. + */ + + .u-lg-sizeFit, + .u-lg-sizeFitAlt { + display: block !important; + float: left !important; + width: auto !important; + } + + .u-lg-sizeFitAlt { + float: right !important; + } + + /** + * Make an element fill the remaining space. + * N.B. This will hide overflow. + */ + + .u-lg-sizeFill { + display: block !important; + overflow: hidden !important; + width: auto !important; + } + + /** + * An alternative method to make an element fill the remaining space. + * N.B. Do not use if child elements might be wider than the remaining space. + * In Chrome, Safari, and Firefox it results in undesired layout. + */ + + .u-lg-sizeFillAlt { + display: table-cell !important; + max-width: 100% !important; + width: 10000px !important; + } + + /** + * Make an element the width of its parent. + */ + + .u-lg-sizeFull { + box-sizing: border-box !important; + display: block !important; + width: 100% !important; + } + + /* Proportional widths: breakpoint 3 (large) + ========================================================================== */ + + /** + * Specify the proportional width of an object. + * Intentional redundancy build into each set of unit classes. + * Supports: 2, 3, 4, 5, 6, 8, 10, 12 part + */ + + .u-lg-size1of12 { + width: 8.333333333333332% !important; + } + + .u-lg-size1of10 { + width: 10% !important; + } + + .u-lg-size1of8 { + width: 12.5% !important; + } + + .u-lg-size1of6, + .u-lg-size2of12 { + width: 16.666666666666664% !important; + } + + .u-lg-size1of5, + .u-lg-size2of10 { + width: 20% !important; + } + + .u-lg-size1of4, + .u-lg-size2of8, + .u-lg-size3of12 { + width: 25% !important; + } + + .u-lg-size3of10 { + width: 30% !important; + } + + .u-lg-size1of3, + .u-lg-size2of6, + .u-lg-size4of12 { + width: 33.33333333333333% !important; + } + + .u-lg-size3of8 { + width: 37.5% !important; + } + + .u-lg-size2of5, + .u-lg-size4of10 { + width: 40% !important; + } + + .u-lg-size5of12 { + width: 41.66666666666667% !important; + } + + .u-lg-size1of2, + .u-lg-size2of4, + .u-lg-size3of6, + .u-lg-size4of8, + .u-lg-size5of10, + .u-lg-size6of12 { + width: 50% !important; + } + + .u-lg-size7of12 { + width: 58.333333333333336% !important; + } + + .u-lg-size3of5, + .u-lg-size6of10 { + width: 60% !important; + } + + .u-lg-size5of8 { + width: 62.5% !important; + } + + .u-lg-size2of3, + .u-lg-size4of6, + .u-lg-size8of12 { + width: 66.66666666666666% !important; + } + + .u-lg-size7of10 { + width: 70% !important; + } + + .u-lg-size3of4, + .u-lg-size6of8, + .u-lg-size9of12 { + width: 75% !important; + } + + .u-lg-size4of5, + .u-lg-size8of10 { + width: 80% !important; + } + + .u-lg-size5of6, + .u-lg-size10of12 { + width: 83.33333333333334% !important; + } + + .u-lg-size7of8 { + width: 87.5% !important; + } + + .u-lg-size9of10 { + width: 90% !important; + } + + .u-lg-size11of12 { + width: 91.66666666666666% !important; + } +} + +/** @define Results; use strict */ + +/** + * Contain floats + * + * Make an element expand to contain floated children. + * Uses pseudo-elements (micro clearfix). + * + * 1. The space content is one way to avoid an Opera bug when the + * `contenteditable` attribute is included anywhere else in the document. + * Otherwise it causes space to appear at the top and bottom of the + * element. + * 2. The use of `table` rather than `block` is only necessary if using + * `:before` to contain the top-margins of child elements. + */ + +.u-cf:before, +.u-cf:after { + content: " "; + /* 1 */ + display: table; + /* 2 */ +} + +.u-cf:after { + clear: both; +} + +/** + * New block formatting context + * + * This affords some useful properties to the element. It won't wrap under + * floats. Will also contain any floated children. + + * N.B. This will clip overflow. Use the alternative method below if this is + * problematic. + */ + +.u-nbfc { + overflow: hidden !important; +} + +/** + * New block formatting context (alternative) + * + * Alternative method when overflow must not be clipped. + * + * 1. Create a new block formatting context (NBFC). + * 2. Avoid shrink-wrap behaviour of table-cell. + * + * N.B. This breaks down in some browsers when elements within this element + * exceed its width. + */ + +.u-nbfcAlt { + display: table-cell !important; + /* 1 */ + width: 10000px !important; + /* 2 */ +} + +/** + * Floats + */ + +.u-floatLeft { + float: left !important; +} + +.u-floatRight { + float: right !important; +} + +/** @define ProfileCard; use strict */ + +/** + * Word breaking + * + * Break strings when their length exceeds the width of their container. + */ + +.u-textBreak { + word-wrap: break-word !important; +} + +/** + * Horizontal text alignment + */ + +.u-textCenter { + text-align: center !important; +} + +.u-textLeft { + text-align: left !important; +} + +.u-textRight { + text-align: right !important; +} + +/** + * Inherit the ancestor's text color. + */ + +.u-textInheritColor { + color: inherit !important; +} + +/** + * Enables font kerning in all browsers. + * http://blog.typekit.com/2014/02/05/kerning-on-the-web/ + * + * 1. Chrome (not Windows), Firefox, Safari 6+, iOS, Android + * 2. Chrome (not Windows), Firefox, IE 10+ + * 3. Safari 7 and future browsers + */ + +.u-textKern { + text-rendering: optimizeLegibility; + /* 1 */ + -webkit-font-feature-settings: "kern" 1; + -moz-font-feature-settings: "kern" 1; + font-feature-settings: "kern" 1; + /* 2 */ + -webkit-font-kerning: normal; + -moz-font-kerning: normal; + font-kerning: normal; + /* 3 */ +} + +/** + * Prevent whitespace wrapping + */ + +.u-textNoWrap { + white-space: nowrap !important; +} + +/** + * Text truncation + * + * Prevent text from wrapping onto multiple lines, and truncate with an + * ellipsis. + * + * 1. Ensure that the node has a maximum width after which truncation can + * occur. + * 2. Fix for IE 8/9 if `word-wrap: break-word` is in effect on ancestor + * nodes. + */ + +.u-textTruncate { + max-width: 100%; + /* 1 */ + overflow: hidden !important; + text-overflow: ellipsis !important; + white-space: nowrap !important; + word-wrap: normal !important; + /* 2 */ +} + +/** + * Clean link + * + * A link without any text-decoration at all. + */ + +.u-linkClean, +.u-linkClean:hover, +.u-linkClean:focus, +.u-linkClean:active { + text-decoration: none !important; +} + +/** + * Link complex + * + * A common pattern is to have a link with several pieces of text and/or an + * icon, where only one piece of text should display the underline when the + * link is the subject of user interaction. + * + * Example HTML: + * + * + * Link complex + * target + * + */ + +.u-linkComplex, +.u-linkComplex:hover, +.u-linkComplex:focus, +.u-linkComplex:active { + text-decoration: none !important; +} + +.u-linkComplex:hover .u-linkComplexTarget, +.u-linkComplex:focus .u-linkComplexTarget, +.u-linkComplex:active .u-linkComplexTarget { + text-decoration: underline !important; +} + +/** + * Block-level link + * + * Combination of traits commonly used in vertical navigation lists. + */ + +.u-linkBlock, +.u-linkBlock:hover, +.u-linkBlock:focus, +.u-linkBlock:active { + display: block !important; + text-decoration: none !important; +} + +.ProfileCard { + border: 1px solid #ccc; + border-radius: 3px; + background-color: #f2f2f2; + -webkit-transition: background-color .2s ease; + transition: background-color .2s ease; +} + +.ProfileCard:hover { + background-color: #e6e6e6; +} + +.ProfileCard:hover .ProfileCard-avatar { + opacity: 1; +} + +.ProfileCard-link { + padding: .625rem; + display: block; + color: #333; +} + +.ProfileCard-link:hover { + color: inherit; +} + +.ProfileCard-username { + overflow: hidden; + margin-top: .5rem; + font-size: 1.125rem; + font-weight: 500; +} + +.ProfileCard-avatar { + border-radius: 50%; + opacity: .8; + -webkit-transition: opacity .2s ease; + transition: opacity .2s ease; + border: 1px solid #999; + display: block; + float: left; + margin-right: .625rem; +} + +.Results-item { + margin-bottom: 1.5%; +} + +@media (min-width: 28.125em) { + .Results-item { + float: left; + } +} + +@media (min-width: 28.125em) and (max-width: 48em) { + .Results-item { + width: 49%; + margin-right: 1.5%; + } + + .Results-item:nth-child(2n) { + margin-right: 0; + } +} + +/* 3 col */ + +@media (min-width: 48em) and (max-width: 67em) { + .Results-item { + width: 32.6%; + margin-right: 1%; + margin-bottom: 1%; + } + + .Results-item:nth-child(3n) { + margin-right: 0; + } +} + +/* 4 col */ + +@media (min-width: 67em) { + .Results-item { + width: 24.25%; + margin-right: 1%; + margin-bottom: 1%; + } + + .Results-item:nth-child(4n) { + margin-right: 0; + } +} + +/** @define SearchForm; use strict */ + +/** @define Button; use strict */ + + + +/** + * The button classes are best applied to links, buttons, and submit inputs. + * These components can be used in forms, as calls to action, or as part of the + * general UI of the site/app. + */ + +/** + * 1. Corrects inability to style clickable `input` types in iOS. + * 2. Normalize `box-sizing` across all elements that this component could be + * applied to. + * 3. Inherit text color from ancestor. + * 4. Inherit font styles from ancestor. + * 5. Normalize `line-height`. For `input`, it can't be changed from `normal` in Firefox 4+. + * 6. Prevent button text from being selectable. + * 7. Make sure `input` will wrap text across multiple lines. + */ + +.Button { + -webkit-appearance: none; + /* 1 */ + background: transparent; + border-color: currentcolor; + border-style: solid; + border-width: 1px; + box-sizing: border-box; + /* 2 */ + color: inherit; + /* 3 */ + cursor: pointer; + display: inline-block; + font: inherit; + /* 4 */ + line-height: normal; + /* 5 */ + margin: 0; + padding: 0.4em 0.75em; + position: relative; + text-align: center; + text-decoration: none; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + /* 6 */ + white-space: normal; + /* 7 */ +} + +/** + * Remove excess padding and border in Firefox 4+ + */ + +.Button::-moz-focus-inner { + border: 0; + padding: 0; +} + +/** + * Work around a Firefox/IE bug where the transparent `button` background + * results in a loss of the default `button` focus styles. + */ + +.Button:focus { + outline: 1px dotted; + outline: 5px auto -webkit-focus-ring-color; +} + +/** + * UI states + */ + +.Button:hover, +.Button:focus, +.Button:active { + text-decoration: none; +} + +.Button:disabled, +.Button.is-disabled { + cursor: default; + opacity: 0.6; +} + +.Button--default { + background-color: #eee; + color: #444; + border-color: #d9d9d9 #d9d9d9 #ccc; + border-radius: 4px; +} + +.Button--default:hover, +.Button--default:focus, +.Button--default:active, +.Button--default.is-pressed { + background-color: #f5f5f5; + color: #222; + border-color: #c6c6c6 #c6c6c6 #bbb; + box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2); +} + +.Button--default:focus { + outline: 0; +} + +.Button--default:active, +.Button--default.is-pressed { + background-color: #ccc; + box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.2); +} + +.u-mXA { + margin-left: auto; + margin-right: auto; +} + +.u-mZ { + margin: 0 !important; +} + +.u-pZ { + padding: 0 !important; +} + +.u-mtZ { + margin-top: 0 !important; +} + +.u-mrZ { + margin-right: 0 !important; +} + +.u-mbZ { + margin-bottom: 0 !important; +} + +.u-mlZ { + margin-left: 0 !important; +} + +.u-ptZ { + padding-top: 0 !important; +} + +.u-prZ { + padding-right: 0 !important; +} + +.u-pbZ { + padding-bottom: 0 !important; +} + +.u-plZ { + padding-left: 0 !important; +} + +.SearchForm { + padding-bottom: 1.25rem; +} + +.SearchForm-title { + margin-bottom: .625rem; + text-align: center; + font-size: 1.6rem; +} + +.SearchForm-input { + width: calc(100% - 84px); + border-top-right-radius: 0; + border-bottom-right-radius: 0; + border-right: 0; +} + +.SearchForm-btn { + width: 48px; + height: 48px; + border-top-left-radius: 0; + border-bottom-left-radius: 0; +} + +/** @define ResultsMessage */ + +.ResultsMessage { + text-align: center; + margin-bottom: .9375rem; +} + +/** @define Pagination; use strict */ + +.Pagination { + text-align: center; +} + +.Pagination-link { + color: #333; + display: inline-block; + padding: 3px 6px; +} + +.Pagination-link--prev { + margin-right: 8px; +} + +.Pagination-link--next { + margin-left: 8px; +} + +.Search { + padding: 1.25rem 0; +} + +.Search-item { + margin-bottom: 1.5rem; +} + +.Search-item:last-child { + margin-bottom: 0; +} + +.Search-wrapSearchForm { + border-bottom: 1px solid #ddd; +} + +/** @define UserDetail; use strict */ + +/** @define Grid; use strict */ + + + +/** + * Core grid component + * + * DO NOT apply dimension or offset utilities to the `Grid` element. All cell + * widths and offsets should be applied to child grid cells. + */ + +/* Grid container + ========================================================================== */ + +/** + * All content must be contained within child `Grid-cell` elements. + * + * 1. Account for browser defaults of elements that might be the root node of + * the component. + * 2. Remove inter-cell whitespace that appears between `inline-block` child + * elements. + * 3. Ensure consistent default alignment. + */ + +.Grid { + display: block; + /* 1 */ + font-size: 0; + /* 2 */ + margin: 0; + /* 1 */ + padding: 0; + /* 1 */ + text-align: left; + /* 3 */ +} + +/** + * Modifier: center align all grid cells + */ + +.Grid--alignCenter { + text-align: center; +} + +/** + * Modifier: right align all grid cells + */ + +.Grid--alignRight { + text-align: right; +} + +/** + * Modifier: middle-align grid cells + */ + +.Grid--alignMiddle > .Grid-cell { + vertical-align: middle; +} + +/** + * Modifier: bottom-align grid cells + */ + +.Grid--alignBottom > .Grid-cell { + vertical-align: bottom; +} + +/** + * Modifier: gutters + * + * NOTE: this can trigger a horizontal scrollbar if the component is as wide as + * the viewport. Use padding on a container, or `overflow-x:hidden` to protect + * against it. + */ + +.Grid--withGutter { + margin: 0 -10px; +} + +.Grid--withGutter > .Grid-cell { + padding: 0 10px; +} + +/* Grid cell + ========================================================================== */ + +/** + * No explicit width by default. Rely on combining `Grid-cell` with a dimension + * utility or a component class that extends 'grid'. + * + * 1. Fundamentals of the non-float grid layout. + * 2. Reset font size change made in `Grid`. + * 3. Keeps content correctly aligned with the grid direction. + * 4. Controls vertical positioning of units. + * 5. Make cells full-width by default. + */ + +.Grid-cell { + box-sizing: border-box; + display: inline-block; + /* 1 */ + font-size: 1rem; + /* 2 */ + margin: 0; + padding: 0; + text-align: left; + /* 3 */ + vertical-align: top; + /* 4 */ + width: 100%; + /* 5 */ +} + +/** + * Modifier: horizontally center one unit + * Set a specific unit to be horizontally centered. Doesn't affect + * any other units. Can still contain a child `Grid` object. + */ + +.Grid-cell--center { + display: block; + margin: 0 auto; +} + +/** @define Profile; use strict */ + +/** @define Stat; use strict */ + +.Stat { + text-align: center; +} + +.Stat--large .Stat-value { + font-size: 1.375rem; +} + +.Stat-value { + display: block; +} + +.Stat-title { + display: block; + font-size: .75em; +} + +/** @define ProfileStatGroup; use strict */ + +.ProfileStatGroup-item { + display: inline-block; + margin-right: 1.2rem; +} + +.u-imgResponsive { + display: block; + max-width: 100%; + height: auto; +} + +.Profile { + text-align: center; + position: relative; +} + +.Profile-avatarImg { + margin-left: auto; + margin-right: auto; + border-radius: 5px; + border: 2px solid #fff; +} + +.Profile-userItem { + margin-bottom: .1875rem; +} + +.Profile-userItem:empty { + margin-bottom: 0; +} + +.Profile-name { + font-size: 1.8rem; + margin-bottom: .5rem; +} + +.Profile-userInfo { + color: #777; +} + +.Profile-wrapProfileStatGroup { + margin-top: 15px; +} + +.Profile-link { + color: inherit; +} + +@media (min-width: 36.25em) { + .Profile { + text-align: left; + } + + .Profile-avatar { + float: left; + margin-right: .625rem; + } + + .Profile-body { + float: left; + } +} + +/** @define RepoList; use strict */ + +/** @define Repo; use strict */ + +.Repo { + position: relative; + min-height: 65px; +} + +.Repo-name { + margin-bottom: .3125rem; +} + +.Repo-description { + font-size: .9375rem; + max-width: 85%; +} + +.Repo-wrapStat { + position: absolute; + top: 25%; + right: 10px; +} + +.Repo-link { + padding: .625rem; + border-radius: 5px; + -webkit-transition: background-color .2s ease; + transition: background-color .2s ease; + color: inherit; +} + +.Repo-link:hover { + background-color: #f4f4f4; +} + +.RepoList-item { + margin-bottom: 1rem; + padding-bottom: 1rem; + border-bottom: 1px dotted #ddd; +} + +.RepoList-item:last-child { + border-bottom: none; +} + +.UserDetail-item { + margin-bottom: 1.5rem; +} + +.UserDetail-header { + padding-top: 1.25rem; + padding-bottom: 1rem; + background-color: #f2f2f2; + margin-bottom: 1rem; +} + +.UserDetail-itemHeader { + margin-bottom: 1rem; +} + +@media (min-width: 36.25em) { + .UserDetail-header { + height: 170px; + padding-bottom: 0; + margin-bottom: 3rem; + } +} \ No newline at end of file diff --git a/built/app.built.js b/built/app.built.js new file mode 100644 index 0000000..ffe4dbe --- /dev/null +++ b/built/app.built.js @@ -0,0 +1,32981 @@ +/******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ +/******/ // Check if module is in cache +/******/ if(installedModules[moduleId]) +/******/ return installedModules[moduleId].exports; +/******/ +/******/ // Create a new module (and put it into the cache) +/******/ var module = installedModules[moduleId] = { +/******/ exports: {}, +/******/ id: moduleId, +/******/ loaded: false +/******/ }; +/******/ +/******/ // Execute the module function +/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); +/******/ +/******/ // Flag the module as loaded +/******/ module.loaded = true; +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __webpack_require__.m = modules; +/******/ +/******/ // expose the module cache +/******/ __webpack_require__.c = installedModules; +/******/ +/******/ // __webpack_public_path__ +/******/ __webpack_require__.p = ""; +/******/ +/******/ // Load entry module and return exports +/******/ return __webpack_require__(0); +/******/ }) +/************************************************************************/ +/******/ ([ +/* 0 */ +/***/ function(module, exports, __webpack_require__) { + + "use strict"; + + var _interopRequire = function (obj) { return obj && obj.__esModule ? obj["default"] : obj; }; + + var React = _interopRequire(__webpack_require__(4)); + + var _reactRouter = __webpack_require__(5); + + var Router = _interopRequire(_reactRouter); + + var Route = _reactRouter.Route; + var DefaultRoute = _reactRouter.DefaultRoute; + var Redirect = _reactRouter.Redirect; + var Layout = _interopRequire(__webpack_require__(1)); + + var Search = _interopRequire(__webpack_require__(2)); + + var UserDetail = _interopRequire(__webpack_require__(3)); + + var routes = React.createElement( + Route, + { name: "layout", path: "/", handler: Layout }, + React.createElement(Route, { name: "users", path: "search/users", handler: Search }), + React.createElement(Route, { name: "user", path: "/users/:username", handler: UserDetail }), + React.createElement(DefaultRoute, { handler: Search }), + React.createElement(Redirect, { from: "/", to: "users" }) + ); + + Router.run(routes, function (Handler) { + React.render(React.createElement(Handler, null), document.body); + }); + +/***/ }, +/* 1 */ +/***/ function(module, exports, __webpack_require__) { + + "use strict"; + + var _interopRequire = function (obj) { return obj && obj.__esModule ? obj["default"] : obj; }; + + var React = _interopRequire(__webpack_require__(4)); + + var _reactRouter = __webpack_require__(5); + + var Router = _interopRequire(_reactRouter); + + var RouteHandler = _reactRouter.RouteHandler; + + + var Layout = React.createClass({ + displayName: "Layout", + render: function () { + return React.createElement(RouteHandler, null); + } + }); + + module.exports = Layout; + +/***/ }, +/* 2 */ +/***/ function(module, exports, __webpack_require__) { + + "use strict"; + + var _interopRequire = function (obj) { return obj && obj.__esModule ? obj["default"] : obj; }; + + var React = _interopRequire(__webpack_require__(4)); + + var _reactRouter = __webpack_require__(5); + + var Router = _interopRequire(_reactRouter); + + var Navigation = _reactRouter.Navigation; + var State = _reactRouter.State; + var Reflux = _interopRequire(__webpack_require__(17)); + + var isEmpty = _interopRequire(__webpack_require__(35)); + + var isString = _interopRequire(__webpack_require__(36)); + + var SearchForm = _interopRequire(__webpack_require__(8)); + + var Pagination = _interopRequire(__webpack_require__(9)); + + var Results = _interopRequire(__webpack_require__(10)); + + var ResultsMessage = _interopRequire(__webpack_require__(11)); + + var User = _interopRequire(__webpack_require__(12)); + + var SearchStore = _interopRequire(__webpack_require__(16)); + + var Search = React.createClass({ + displayName: "Search", + mixins: [Navigation, Reflux.connect(SearchStore), Reflux.ListenerMixin, State], + + handleSearchFormSubmit: function handleSearchFormSubmit(event) { + event.preventDefault(); + + this.transitionTo("users", {}, { + q: this.refs.searchForm.getSearchTerm() + }); + }, + + search: function search(url) { + // Clear results before loading new set + this.setState(SearchStore.getInitialState()); + + if (isString(url) && !isEmpty(this.getQuery())) { + User.search(url); + } + }, + + componentWillReceiveProps: function componentWillReceiveProps() { + // Search if route param changes + this.search(this.getPath()); + }, + + componentDidMount: function componentDidMount() { + // Search if URL params are present on page render + this.search(this.getPath()); + }, + + render: function render() { + return React.createElement( + "div", + { className: "Search" }, + React.createElement( + "div", + { className: "Search-item Search-wrapSearchForm" }, + React.createElement( + "div", + { className: "Container" }, + React.createElement(SearchForm, { onUserSearch: this.handleSearchFormSubmit, query: this.state.query, ref: "searchForm" }), + React.createElement(ResultsMessage, { results: this.state.results, query: this.getQuery().q }) + ) + ), + React.createElement( + "div", + { className: "Container" }, + React.createElement( + "div", + { className: "Search-item" }, + React.createElement(Results, { results: this.state.results }) + ), + React.createElement( + "div", + { className: "Search-item u-mXA u-size8of10 u-md-size5of10" }, + React.createElement(Pagination, { pagination: this.state.pagination }) + ) + ) + ); + } + }); + + module.exports = Search; + +/***/ }, +/* 3 */ +/***/ function(module, exports, __webpack_require__) { + + "use strict"; + + var _interopRequire = function (obj) { return obj && obj.__esModule ? obj["default"] : obj; }; + + var React = _interopRequire(__webpack_require__(4)); + + var _reactRouter = __webpack_require__(5); + + var Router = _interopRequire(_reactRouter); + + var Navigation = _reactRouter.Navigation; + var State = _reactRouter.State; + var Reflux = _interopRequire(__webpack_require__(17)); + + var User = _interopRequire(__webpack_require__(12)); + + var ProfileStore = _interopRequire(__webpack_require__(13)); + + var RepoStore = _interopRequire(__webpack_require__(14)); + + var StarredStore = _interopRequire(__webpack_require__(15)); + + var Profile = _interopRequire(__webpack_require__(6)); + + var RepoList = _interopRequire(__webpack_require__(7)); + + var UserDetail = React.createClass({ + displayName: "UserDetail", + mixins: [Navigation, Reflux.connect(ProfileStore), Reflux.connect(RepoStore), Reflux.connect(StarredStore), Reflux.ListenerMixin, State], + + componentWillReceiveProps: function () { + User.profile(this.getPath(), this.getParams().username); + }, + + componentDidMount: function () { + User.profile(this.getPath(), this.getParams().username); + }, + + render: function () { + return React.createElement( + "div", + { className: "UserDetail" }, + React.createElement( + "header", + { className: "UserDetail-item UserDetail-header" }, + React.createElement( + "h1", + { className: "u-hiddenVisually" }, + "Github user detail" + ), + React.createElement( + "div", + { className: "Container" }, + React.createElement(Profile, { user: this.state.user }) + ) + ), + React.createElement( + "div", + { className: "UserDetail-item Container" }, + React.createElement( + "div", + { className: "Grid Grid--withGutter" }, + React.createElement( + "div", + { className: "Grid-cell u-sm-size1of2" }, + React.createElement( + "h2", + { className: "UserDetail-itemHeader" }, + "Popular Repositories" + ), + React.createElement(RepoList, { repos: this.state.repos }) + ), + React.createElement( + "div", + { className: "Grid-cell u-sm-size1of2" }, + React.createElement( + "h2", + { className: "UserDetail-itemHeader" }, + "Recently Starred" + ), + React.createElement(RepoList, { repos: this.state.starred }) + ) + ) + ) + ); + } + }); + + module.exports = UserDetail; + +/***/ }, +/* 4 */ +/***/ function(module, exports, __webpack_require__) { + + module.exports = __webpack_require__(18); + + +/***/ }, +/* 5 */ +/***/ function(module, exports, __webpack_require__) { + + exports.DefaultRoute = __webpack_require__(19); + exports.Link = __webpack_require__(20); + exports.NotFoundRoute = __webpack_require__(21); + exports.Redirect = __webpack_require__(22); + exports.Route = __webpack_require__(23); + exports.RouteHandler = __webpack_require__(24); + + exports.HashLocation = __webpack_require__(25); + exports.HistoryLocation = __webpack_require__(26); + exports.RefreshLocation = __webpack_require__(27); + + exports.ImitateBrowserBehavior = __webpack_require__(28); + exports.ScrollToTopBehavior = __webpack_require__(29); + + exports.Navigation = __webpack_require__(30); + exports.State = __webpack_require__(31); + + exports.create = __webpack_require__(32); + exports.run = __webpack_require__(33); + + exports.History = __webpack_require__(34); + + +/***/ }, +/* 6 */ +/***/ function(module, exports, __webpack_require__) { + + "use strict"; + + var _interopRequire = function (obj) { return obj && obj.__esModule ? obj["default"] : obj; }; + + var React = _interopRequire(__webpack_require__(4)); + + var ProfileStatGroup = _interopRequire(__webpack_require__(39)); + + var Profile = React.createClass({ + displayName: "Profile", + render: function () { + var stats = { + Followers: this.props.user.followers, + Following: this.props.user.following, + Repos: this.props.user.public_repos + }; + + return React.createElement( + "div", + { className: "Profile u-cf" }, + React.createElement( + "div", + { className: "Profile-avatar" }, + React.createElement("img", { className: "Profile-avatarImg u-imgResponsive", src: this.props.user.avatar_url, width: "190", height: "190" }) + ), + React.createElement( + "div", + { className: "Profile-body" }, + React.createElement( + "h2", + { className: "Profile-name" }, + React.createElement( + "a", + { className: "Profile-link u-linkClean", href: this.props.user.html_url }, + this.props.user.name + ) + ), + React.createElement( + "div", + { className: "Profile-userInfo" }, + React.createElement( + "p", + { className: "Profile-userItem" }, + this.props.user.login + ), + React.createElement( + "p", + { className: "Profile-userItem" }, + this.props.user.location + ), + React.createElement( + "p", + { className: "Profile-userItem" }, + React.createElement( + "a", + { href: this.props.user.blog, target: "_blank" }, + this.props.user.blog + ) + ) + ), + React.createElement( + "div", + { className: "Profile-wrapProfileStatGroup" }, + React.createElement(ProfileStatGroup, { stats: stats }) + ) + ) + ); + } + }); + + module.exports = Profile; + +/***/ }, +/* 7 */ +/***/ function(module, exports, __webpack_require__) { + + "use strict"; + + var _interopRequire = function (obj) { return obj && obj.__esModule ? obj["default"] : obj; }; + + var React = _interopRequire(__webpack_require__(4)); + + var Repo = _interopRequire(__webpack_require__(37)); + + var map = _interopRequire(__webpack_require__(38)); + + var RepoList = React.createClass({ + displayName: "RepoList", + render: function () { + var repos = map(this.props.repos, function (repo) { + return React.createElement( + "li", + { className: "RepoList-item", key: repo.id }, + React.createElement(Repo, { data: repo }) + ); + }); + + return React.createElement( + "ul", + { className: "RepoList" }, + repos + ); + } + }); + + module.exports = RepoList; + +/***/ }, +/* 8 */ +/***/ function(module, exports, __webpack_require__) { + + "use strict"; + + var _interopRequire = function (obj) { return obj && obj.__esModule ? obj["default"] : obj; }; + + var React = _interopRequire(__webpack_require__(40)); + + var _reactRouter = __webpack_require__(5); + + var Router = _interopRequire(_reactRouter); + + var State = _reactRouter.State; + var LinkedStateMixin = React.addons.LinkedStateMixin; + + var SearchForm = React.createClass({ + displayName: "SearchForm", + mixins: [State, LinkedStateMixin], + + getInitialState: function () { + return { value: "" }; + }, + + componentWillReceiveProps: function () { + this.setState({ value: this.getQuery().q }); + }, + + getSearchTerm: function () { + return this.refs.input.getDOMNode().value; + }, + + render: function () { + return React.createElement( + "form", + { className: "SearchForm", onSubmit: this.props.onUserSearch }, + React.createElement( + "h1", + { className: "SearchForm-title" }, + "Search for a GitHub user" + ), + React.createElement( + "div", + { className: "SearchForm-search u-mXA u-size8of10 u-md-size5of10" }, + React.createElement("input", { className: "SearchForm-input FormControl u-inlineBlock", placeholder: "e.g user", type: "text", ref: "input", valueLink: this.linkState("value") }), + React.createElement( + "button", + { className: "SearchForm-btn Button Button--default", type: "submit" }, + "Go" + ) + ) + ); + } + }); + + module.exports = SearchForm; + +/***/ }, +/* 9 */ +/***/ function(module, exports, __webpack_require__) { + + "use strict"; + + var _interopRequire = function (obj) { return obj && obj.__esModule ? obj["default"] : obj; }; + + var React = _interopRequire(__webpack_require__(4)); + + var _reactRouter = __webpack_require__(5); + + var Router = _interopRequire(_reactRouter); + + var State = _reactRouter.State; + var Link = _reactRouter.Link; + + + var Pagination = React.createClass({ + displayName: "Pagination", + mixins: [State], + + renderNextLink: function renderNextLink() { + if (this.props.pagination.next) { + var url = new URL(this.props.pagination.next); + return React.createElement( + Link, + { className: "Pagination-link Pagination-link--next u-linkClean", to: "" + url.pathname + "" + url.search }, + "Next ", + React.createElement( + "span", + { "aria-hidden": "true" }, + "›" + ) + ); + } + }, + + renderPrevLink: function renderPrevLink() { + if (this.props.pagination.prev) { + var url = new URL(this.props.pagination.prev); + return React.createElement( + Link, + { className: "Pagination-link Pagination-link--prev u-linkClean", to: "" + url.pathname + "" + url.search }, + React.createElement( + "span", + { "aria-hidden": "true" }, + "‹" + ), + " Previous" + ); + } + }, + + renderFirstLink: function renderFirstLink() { + if (this.props.pagination.first) { + var url = new URL(this.props.pagination.first); + return React.createElement( + Link, + { className: "Pagination-link Pagination-link--first u-linkClean", to: "" + url.pathname + "" + url.search }, + React.createElement( + "span", + { "aria-hidden": "true" }, + "«" + ), + " First" + ); + } + }, + + renderLastLink: function renderLastLink() { + if (this.props.pagination.last) { + var url = new URL(this.props.pagination.last); + return React.createElement( + Link, + { className: "Pagination-link Pagination-link--last u-linkClean", to: "" + url.pathname + "" + url.search }, + "Last ", + React.createElement( + "span", + { "aria-hidden": "true" }, + "»" + ) + ); + } + }, + + render: function render() { + return React.createElement( + "div", + { className: "Pagination u-cf" }, + this.renderFirstLink(), + this.renderPrevLink(), + this.renderNextLink(), + this.renderLastLink() + ); + } + }); + + module.exports = Pagination; + +/***/ }, +/* 10 */ +/***/ function(module, exports, __webpack_require__) { + + "use strict"; + + var _interopRequire = function (obj) { return obj && obj.__esModule ? obj["default"] : obj; }; + + var React = _interopRequire(__webpack_require__(4)); + + var ProfileCard = _interopRequire(__webpack_require__(41)); + + var map = _interopRequire(__webpack_require__(38)); + + var Results = React.createClass({ + displayName: "Results", + renderResultsItem: function (user) { + return React.createElement( + "li", + { key: user.id, className: "Results-item" }, + React.createElement(ProfileCard, { username: user.login, avatar: user.avatar_url }) + ); + }, + + render: function () { + var resultsItems = this.props.results && map(this.props.results.items, this.renderResultsItem); + + return React.createElement( + "div", + { className: "Results" }, + React.createElement( + "ul", + { className: "Results-list u-cf" }, + resultsItems + ) + ); + } + }); + + module.exports = Results; + +/***/ }, +/* 11 */ +/***/ function(module, exports, __webpack_require__) { + + "use strict"; + + var _interopRequire = function (obj) { return obj && obj.__esModule ? obj["default"] : obj; }; + + var React = _interopRequire(__webpack_require__(4)); + + var pluralize = _interopRequire(__webpack_require__(88)); + + var ResultsMessage = React.createClass({ + displayName: "ResultsMessage", + render: function () { + var results = this.props.results; + var total = results.total_count; + var resultsMessage; + + // Found some results + if (total > 0) { + resultsMessage = React.createElement( + "span", + null, + React.createElement( + "b", + null, + total + ), + " ", + pluralize("results", total), + " for ", + React.createElement( + "mark", + null, + this.props.query + ) + ); + } + + // Found zero results + if (total == 0) { + resultsMessage = React.createElement( + "span", + null, + "No results for ", + React.createElement( + "mark", + null, + this.props.query + ) + ); + } + + // Found results, but no more pages + if (total > 0 && !results.items.length) { + resultsMessage = React.createElement( + "span", + null, + "No more results for ", + React.createElement( + "mark", + null, + this.props.query + ) + ); + } + + // No results because error + if (results.error) { + resultsMessage = React.createElement( + "span", + null, + React.createElement( + "b", + null, + "Error:" + ), + " ", + results.error.message + ); + } + + return React.createElement( + "p", + { className: "ResultsMessage" }, + resultsMessage + ); + } + }); + + module.exports = ResultsMessage; + +/***/ }, +/* 12 */ +/***/ function(module, exports, __webpack_require__) { + + "use strict"; + + var _interopRequire = function (obj) { return obj && obj.__esModule ? obj["default"] : obj; }; + + var Reflux = _interopRequire(__webpack_require__(17)); + + var request = _interopRequire(__webpack_require__(90)); + + var getItem = __webpack_require__(44).getItem; + var gitHubAPI = _interopRequire(__webpack_require__(70)); + + var partial = _interopRequire(__webpack_require__(42)); + + var User = Reflux.createActions({ + search: { asyncResult: true }, + profile: { asyncResult: true }, + repos: { asyncResult: true }, + starred: { asyncResult: true } + }); + + User.search.listen(function (url) { + // Use the url as the cachekey + getAPIItem.call(this, url, url); + }); + + function getAPIItem(cacheKey, url, username) { + var cached = getItem("" + username + ":" + cacheKey); + + if (cached) { + return this.completed(cached, true); + } + + gitHubAPI(url).then(this.completed).fail(this.failed); + } + + User.profile.listen(partial(getAPIItem, "profile")); + User.repos.listen(partial(getAPIItem, "repos")); + User.starred.listen(partial(getAPIItem, "starred")); + + module.exports = User; + +/***/ }, +/* 13 */ +/***/ function(module, exports, __webpack_require__) { + + "use strict"; + + var _interopRequire = function (obj) { return obj && obj.__esModule ? obj["default"] : obj; }; + + var Reflux = _interopRequire(__webpack_require__(17)); + + var User = _interopRequire(__webpack_require__(12)); + + var pick = _interopRequire(__webpack_require__(43)); + + var setItem = __webpack_require__(44).setItem; + module.exports = Reflux.createStore({ + init: function init() { + this.listenTo(User.profile.completed, this.onProfileCompleted); + }, + + getInitialState: function getInitialState() { + return { + user: {} + }; + }, + + onProfileCompleted: function onProfileCompleted(data, fromCache) { + if (!fromCache) { + // Only take properties that are needed + var results = pick(data.results, "avatar_url", "blog", "followers", "following", "repos_url", "starred_url", "location", "login", "name", "public_repos", "html_url"); + setItem("" + results.login + ":profile", results); + this.trigger({ user: results }); + } else { + this.trigger({ user: data }); + } + } + }); + +/***/ }, +/* 14 */ +/***/ function(module, exports, __webpack_require__) { + + "use strict"; + + var _interopRequire = function (obj) { return obj && obj.__esModule ? obj["default"] : obj; }; + + var Reflux = _interopRequire(__webpack_require__(17)); + + var User = _interopRequire(__webpack_require__(12)); + + var ProfileStore = _interopRequire(__webpack_require__(13)); + + var pick = _interopRequire(__webpack_require__(43)); + + var setItem = __webpack_require__(44).setItem; + module.exports = Reflux.createStore({ + init: function init() { + this.listenTo(ProfileStore, this.onProfileCompleted); + this.listenTo(User.repos.completed, this.onReposCompleted); + }, + + getInitialState: function getInitialState() { + return { + repos: {} + }; + }, + + onProfileCompleted: function onProfileCompleted(data) { + this.username = data.user.login; + User.repos(data.user.repos_url, data.user.login); + }, + + onReposCompleted: function onReposCompleted(data, fromCache) { + if (!fromCache) { + var results = data.results.filter(this.removeForks).sort(this.sortByPopular).map(this.trimData).slice(0, 5); + + setItem("" + this.username + ":repos", results); + this.trigger({ repos: results }); + } else { + this.trigger({ repos: data }); + } + }, + + removeForks: function removeForks(item) { + return item.fork == false; + }, + + sortByPopular: function sortByPopular(a, b) { + return b.stargazers_count - a.stargazers_count; + }, + + trimData: function trimData(repo) { + return pick(repo, "id", "name", "html_url", "description", "stargazers_count"); + } + }); + +/***/ }, +/* 15 */ +/***/ function(module, exports, __webpack_require__) { + + "use strict"; + + var _interopRequire = function (obj) { return obj && obj.__esModule ? obj["default"] : obj; }; + + var Reflux = _interopRequire(__webpack_require__(17)); + + var User = _interopRequire(__webpack_require__(12)); + + var ProfileStore = _interopRequire(__webpack_require__(13)); + + var pick = _interopRequire(__webpack_require__(43)); + + var setItem = __webpack_require__(44).setItem; + module.exports = Reflux.createStore({ + init: function init() { + this.listenTo(User.starred.completed, this.onStarredCompleted); + this.listenTo(ProfileStore, this.onProfileCompleted); + }, + + getInitialState: function getInitialState() { + return { + starred: {} + }; + }, + + onProfileCompleted: function onProfileCompleted(data) { + this.username = data.user.login; + User.starred(data.user.starred_url.replace(/\{\/[a-z]+}/g, ""), data.user.login); + }, + + onStarredCompleted: function onStarredCompleted(data, fromCache) { + if (!fromCache) { + var results = data.results.map(function (repo) { + return pick(repo, "id", "name", "html_url", "description"); + }).slice(0, 5); + + setItem("" + this.username + ":starred", results); + this.trigger({ starred: results }); + } else { + this.trigger({ starred: data }); + } + } + }); + +/***/ }, +/* 16 */ +/***/ function(module, exports, __webpack_require__) { + + "use strict"; + + var _interopRequire = function (obj) { return obj && obj.__esModule ? obj["default"] : obj; }; + + var Reflux = _interopRequire(__webpack_require__(17)); + + var User = _interopRequire(__webpack_require__(12)); + + var pick = _interopRequire(__webpack_require__(43)); + + var map = _interopRequire(__webpack_require__(38)); + + var setItem = __webpack_require__(44).setItem; + var parseLinkHeader = _interopRequire(__webpack_require__(45)); + + module.exports = Reflux.createStore({ + init: function init() { + this.listenTo(User.search.completed, this.onSearchCompleted); + this.listenTo(User.search.failed, this.onSearchFailed); + }, + + getInitialState: function getInitialState() { + return { + results: { + items: [] + }, + url: "", + pagination: {} + }; + }, + + onSearchCompleted: function onSearchCompleted(data, fromCache) { + if (!fromCache) { + // Only take data that's needed + var results = pick(data.results, "items", "total_count"); + results.items = map(data.results.items, function (item) { + return pick(item, "avatar_url", "id", "login"); + }); + + // Don't mutate the data param + var newData = { + results: results, + url: data.url, + pagination: data.pagination + }; + + // Cache it + setItem(newData.url, newData); + + // Notify the views + this.trigger(newData); + } else { + // Response came from cache, so send straight to views + this.trigger(data); + } + }, + + onSearchFailed: function onSearchFailed(query, xhr) { + this.trigger({ + results: { + items: [], + error: JSON.parse(xhr.responseText) + }, + query: query + }); + } + }); + +/***/ }, +/* 17 */ +/***/ function(module, exports, __webpack_require__) { + + module.exports = __webpack_require__(77); + + +/***/ }, +/* 18 */ +/***/ function(module, exports, __webpack_require__) { + + /* WEBPACK VAR INJECTION */(function(process) {/** + * Copyright 2013-2014, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule React + */ + + "use strict"; + + var DOMPropertyOperations = __webpack_require__(46); + var EventPluginUtils = __webpack_require__(47); + var ReactChildren = __webpack_require__(48); + var ReactComponent = __webpack_require__(49); + var ReactCompositeComponent = __webpack_require__(50); + var ReactContext = __webpack_require__(51); + var ReactCurrentOwner = __webpack_require__(52); + var ReactElement = __webpack_require__(53); + var ReactElementValidator = __webpack_require__(54); + var ReactDOM = __webpack_require__(55); + var ReactDOMComponent = __webpack_require__(56); + var ReactDefaultInjection = __webpack_require__(57); + var ReactInstanceHandles = __webpack_require__(58); + var ReactLegacyElement = __webpack_require__(59); + var ReactMount = __webpack_require__(60); + var ReactMultiChild = __webpack_require__(61); + var ReactPerf = __webpack_require__(62); + var ReactPropTypes = __webpack_require__(63); + var ReactServerRendering = __webpack_require__(64); + var ReactTextComponent = __webpack_require__(65); + + var assign = __webpack_require__(66); + var deprecated = __webpack_require__(67); + var onlyChild = __webpack_require__(68); + + ReactDefaultInjection.inject(); + + var createElement = ReactElement.createElement; + var createFactory = ReactElement.createFactory; + + if ("production" !== process.env.NODE_ENV) { + createElement = ReactElementValidator.createElement; + createFactory = ReactElementValidator.createFactory; + } + + // TODO: Drop legacy elements once classes no longer export these factories + createElement = ReactLegacyElement.wrapCreateElement( + createElement + ); + createFactory = ReactLegacyElement.wrapCreateFactory( + createFactory + ); + + var render = ReactPerf.measure('React', 'render', ReactMount.render); + + var React = { + Children: { + map: ReactChildren.map, + forEach: ReactChildren.forEach, + count: ReactChildren.count, + only: onlyChild + }, + DOM: ReactDOM, + PropTypes: ReactPropTypes, + initializeTouchEvents: function(shouldUseTouch) { + EventPluginUtils.useTouchEvents = shouldUseTouch; + }, + createClass: ReactCompositeComponent.createClass, + createElement: createElement, + createFactory: createFactory, + constructAndRenderComponent: ReactMount.constructAndRenderComponent, + constructAndRenderComponentByID: ReactMount.constructAndRenderComponentByID, + render: render, + renderToString: ReactServerRendering.renderToString, + renderToStaticMarkup: ReactServerRendering.renderToStaticMarkup, + unmountComponentAtNode: ReactMount.unmountComponentAtNode, + isValidClass: ReactLegacyElement.isValidClass, + isValidElement: ReactElement.isValidElement, + withContext: ReactContext.withContext, + + // Hook for JSX spread, don't use this for anything else. + __spread: assign, + + // Deprecations (remove for 0.13) + renderComponent: deprecated( + 'React', + 'renderComponent', + 'render', + this, + render + ), + renderComponentToString: deprecated( + 'React', + 'renderComponentToString', + 'renderToString', + this, + ReactServerRendering.renderToString + ), + renderComponentToStaticMarkup: deprecated( + 'React', + 'renderComponentToStaticMarkup', + 'renderToStaticMarkup', + this, + ReactServerRendering.renderToStaticMarkup + ), + isValidComponent: deprecated( + 'React', + 'isValidComponent', + 'isValidElement', + this, + ReactElement.isValidElement + ) + }; + + // Inject the runtime into a devtools global hook regardless of browser. + // Allows for debugging when the hook is injected on the page. + if ( + typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined' && + typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.inject === 'function') { + __REACT_DEVTOOLS_GLOBAL_HOOK__.inject({ + Component: ReactComponent, + CurrentOwner: ReactCurrentOwner, + DOMComponent: ReactDOMComponent, + DOMPropertyOperations: DOMPropertyOperations, + InstanceHandles: ReactInstanceHandles, + Mount: ReactMount, + MultiChild: ReactMultiChild, + TextComponent: ReactTextComponent + }); + } + + if ("production" !== process.env.NODE_ENV) { + var ExecutionEnvironment = __webpack_require__(69); + if (ExecutionEnvironment.canUseDOM && window.top === window.self) { + + // If we're in Chrome, look for the devtools marker and provide a download + // link if not installed. + if (navigator.userAgent.indexOf('Chrome') > -1) { + if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ === 'undefined') { + console.debug( + 'Download the React DevTools for a better development experience: ' + + 'http://fb.me/react-devtools' + ); + } + } + + var expectedFeatures = [ + // shims + Array.isArray, + Array.prototype.every, + Array.prototype.forEach, + Array.prototype.indexOf, + Array.prototype.map, + Date.now, + Function.prototype.bind, + Object.keys, + String.prototype.split, + String.prototype.trim, + + // shams + Object.create, + Object.freeze + ]; + + for (var i = 0; i < expectedFeatures.length; i++) { + if (!expectedFeatures[i]) { + console.error( + 'One or more ES5 shim/shams expected by React are not available: ' + + 'http://fb.me/react-warning-polyfills' + ); + break; + } + } + } + } + + // Version exists only in the open-source version of React, not in Facebook's + // internal version. + React.version = '0.12.2'; + + module.exports = React; + + /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(89))) + +/***/ }, +/* 19 */ +/***/ function(module, exports, __webpack_require__) { + + var React = __webpack_require__(4); + var FakeNode = __webpack_require__(71); + var PropTypes = __webpack_require__(72); + + /** + * A component is a special kind of that + * renders when its parent matches but none of its siblings do. + * Only one such route may be used at any given level in the + * route hierarchy. + */ + var DefaultRoute = React.createClass({ + + displayName: 'DefaultRoute', + + mixins: [ FakeNode ], + + propTypes: { + name: React.PropTypes.string, + path: PropTypes.falsy, + handler: React.PropTypes.func.isRequired + } + + }); + + module.exports = DefaultRoute; + + +/***/ }, +/* 20 */ +/***/ function(module, exports, __webpack_require__) { + + var React = __webpack_require__(4); + var classSet = __webpack_require__(73); + var assign = __webpack_require__(66); + var Navigation = __webpack_require__(30); + var State = __webpack_require__(31); + + function isLeftClickEvent(event) { + return event.button === 0; + } + + function isModifiedEvent(event) { + return !!(event.metaKey || event.altKey || event.ctrlKey || event.shiftKey); + } + + /** + * components are used to create an element that links to a route. + * When that route is active, the link gets an "active" class name (or the + * value of its `activeClassName` prop). + * + * For example, assuming you have the following route: + * + * + * + * You could use the following component to link to that route: + * + * + * + * In addition to params, links may pass along query string parameters + * using the `query` prop. + * + * + */ + var Link = React.createClass({ + + displayName: 'Link', + + mixins: [ Navigation, State ], + + propTypes: { + activeClassName: React.PropTypes.string.isRequired, + to: React.PropTypes.string.isRequired, + params: React.PropTypes.object, + query: React.PropTypes.object, + onClick: React.PropTypes.func + }, + + getDefaultProps: function () { + return { + activeClassName: 'active' + }; + }, + + handleClick: function (event) { + var allowTransition = true; + var clickResult; + + if (this.props.onClick) + clickResult = this.props.onClick(event); + + if (isModifiedEvent(event) || !isLeftClickEvent(event)) + return; + + if (clickResult === false || event.defaultPrevented === true) + allowTransition = false; + + event.preventDefault(); + + if (allowTransition) + this.transitionTo(this.props.to, this.props.params, this.props.query); + }, + + /** + * Returns the value of the "href" attribute to use on the DOM element. + */ + getHref: function () { + return this.makeHref(this.props.to, this.props.params, this.props.query); + }, + + /** + * Returns the value of the "class" attribute to use on the DOM element, which contains + * the value of the activeClassName property when this is active. + */ + getClassName: function () { + var classNames = {}; + + if (this.props.className) + classNames[this.props.className] = true; + + if (this.isActive(this.props.to, this.props.params, this.props.query)) + classNames[this.props.activeClassName] = true; + + return classSet(classNames); + }, + + render: function () { + var props = assign({}, this.props, { + href: this.getHref(), + className: this.getClassName(), + onClick: this.handleClick + }); + + return React.DOM.a(props, this.props.children); + } + + }); + + module.exports = Link; + + +/***/ }, +/* 21 */ +/***/ function(module, exports, __webpack_require__) { + + var React = __webpack_require__(4); + var FakeNode = __webpack_require__(71); + var PropTypes = __webpack_require__(72); + + /** + * A is a special kind of that + * renders when the beginning of its parent's path matches + * but none of its siblings do, including any . + * Only one such route may be used at any given level in the + * route hierarchy. + */ + var NotFoundRoute = React.createClass({ + + displayName: 'NotFoundRoute', + + mixins: [ FakeNode ], + + propTypes: { + name: React.PropTypes.string, + path: PropTypes.falsy, + handler: React.PropTypes.func.isRequired + } + + }); + + module.exports = NotFoundRoute; + + +/***/ }, +/* 22 */ +/***/ function(module, exports, __webpack_require__) { + + var React = __webpack_require__(4); + var FakeNode = __webpack_require__(71); + var PropTypes = __webpack_require__(72); + + /** + * A component is a special kind of that always + * redirects to another route when it matches. + */ + var Redirect = React.createClass({ + + displayName: 'Redirect', + + mixins: [ FakeNode ], + + propTypes: { + path: React.PropTypes.string, + from: React.PropTypes.string, // Alias for path. + to: React.PropTypes.string, + handler: PropTypes.falsy + } + + }); + + module.exports = Redirect; + + +/***/ }, +/* 23 */ +/***/ function(module, exports, __webpack_require__) { + + var React = __webpack_require__(4); + var FakeNode = __webpack_require__(71); + + /** + * components specify components that are rendered to the page when the + * URL matches a given pattern. + * + * Routes are arranged in a nested tree structure. When a new URL is requested, + * the tree is searched depth-first to find a route whose path matches the URL. + * When one is found, all routes in the tree that lead to it are considered + * "active" and their components are rendered into the DOM, nested in the same + * order as they are in the tree. + * + * The preferred way to configure a router is using JSX. The XML-like syntax is + * a great way to visualize how routes are laid out in an application. + * + * var routes = [ + * + * + * + * + * + * ]; + * + * Router.run(routes, function (Handler) { + * React.render(, document.body); + * }); + * + * Handlers for Route components that contain children can render their active + * child route using a element. + * + * var App = React.createClass({ + * render: function () { + * return ( + *
    + * + *
    + * ); + * } + * }); + */ + var Route = React.createClass({ + + displayName: 'Route', + + mixins: [ FakeNode ], + + propTypes: { + name: React.PropTypes.string, + path: React.PropTypes.string, + handler: React.PropTypes.func.isRequired, + ignoreScrollBehavior: React.PropTypes.bool + } + + }); + + module.exports = Route; + + +/***/ }, +/* 24 */ +/***/ function(module, exports, __webpack_require__) { + + var React = __webpack_require__(4); + var RouteHandlerMixin = __webpack_require__(74); + + /** + * A component renders the active child route handler + * when routes are nested. + */ + var RouteHandler = React.createClass({ + + displayName: 'RouteHandler', + + mixins: [RouteHandlerMixin], + + getDefaultProps: function () { + return { + ref: '__routeHandler__' + }; + }, + + render: function () { + return this.getRouteHandler(); + } + + }); + + module.exports = RouteHandler; + + +/***/ }, +/* 25 */ +/***/ function(module, exports, __webpack_require__) { + + var LocationActions = __webpack_require__(75); + var History = __webpack_require__(34); + var Path = __webpack_require__(76); + + /** + * Returns the current URL path from the `hash` portion of the URL, including + * query string. + */ + function getHashPath() { + return Path.decode( + // We can't use window.location.hash here because it's not + // consistent across browsers - Firefox will pre-decode it! + window.location.href.split('#')[1] || '' + ); + } + + var _actionType; + + function ensureSlash() { + var path = getHashPath(); + + if (path.charAt(0) === '/') + return true; + + HashLocation.replace('/' + path); + + return false; + } + + var _changeListeners = []; + + function notifyChange(type) { + if (type === LocationActions.PUSH) + History.length += 1; + + var change = { + path: getHashPath(), + type: type + }; + + _changeListeners.forEach(function (listener) { + listener(change); + }); + } + + var _isListening = false; + + function onHashChange() { + if (ensureSlash()) { + // If we don't have an _actionType then all we know is the hash + // changed. It was probably caused by the user clicking the Back + // button, but may have also been the Forward button or manual + // manipulation. So just guess 'pop'. + notifyChange(_actionType || LocationActions.POP); + _actionType = null; + } + } + + /** + * A Location that uses `window.location.hash`. + */ + var HashLocation = { + + addChangeListener: function (listener) { + _changeListeners.push(listener); + + // Do this BEFORE listening for hashchange. + ensureSlash(); + + if (_isListening) + return; + + if (window.addEventListener) { + window.addEventListener('hashchange', onHashChange, false); + } else { + window.attachEvent('onhashchange', onHashChange); + } + + _isListening = true; + }, + + removeChangeListener: function(listener) { + for (var i = 0, l = _changeListeners.length; i < l; i ++) { + if (_changeListeners[i] === listener) { + _changeListeners.splice(i, 1); + break; + } + } + + if (window.removeEventListener) { + window.removeEventListener('hashchange', onHashChange, false); + } else { + window.removeEvent('onhashchange', onHashChange); + } + + if (_changeListeners.length === 0) + _isListening = false; + }, + + + + push: function (path) { + _actionType = LocationActions.PUSH; + window.location.hash = Path.encode(path); + }, + + replace: function (path) { + _actionType = LocationActions.REPLACE; + window.location.replace(window.location.pathname + '#' + Path.encode(path)); + }, + + pop: function () { + _actionType = LocationActions.POP; + History.back(); + }, + + getCurrentPath: getHashPath, + + toString: function () { + return ''; + } + + }; + + module.exports = HashLocation; + + +/***/ }, +/* 26 */ +/***/ function(module, exports, __webpack_require__) { + + var LocationActions = __webpack_require__(75); + var History = __webpack_require__(34); + var Path = __webpack_require__(76); + + /** + * Returns the current URL path from `window.location`, including query string. + */ + function getWindowPath() { + return Path.decode( + window.location.pathname + window.location.search + ); + } + + var _changeListeners = []; + + function notifyChange(type) { + var change = { + path: getWindowPath(), + type: type + }; + + _changeListeners.forEach(function (listener) { + listener(change); + }); + } + + var _isListening = false; + + function onPopState() { + notifyChange(LocationActions.POP); + } + + /** + * A Location that uses HTML5 history. + */ + var HistoryLocation = { + + addChangeListener: function (listener) { + _changeListeners.push(listener); + + if (_isListening) + return; + + if (window.addEventListener) { + window.addEventListener('popstate', onPopState, false); + } else { + window.attachEvent('popstate', onPopState); + } + + _isListening = true; + }, + + removeChangeListener: function(listener) { + for (var i = 0, l = _changeListeners.length; i < l; i ++) { + if (_changeListeners[i] === listener) { + _changeListeners.splice(i, 1); + break; + } + } + + if (window.addEventListener) { + window.removeEventListener('popstate', onPopState); + } else { + window.removeEvent('popstate', onPopState); + } + + if (_changeListeners.length === 0) + _isListening = false; + }, + + + + push: function (path) { + window.history.pushState({ path: path }, '', Path.encode(path)); + History.length += 1; + notifyChange(LocationActions.PUSH); + }, + + replace: function (path) { + window.history.replaceState({ path: path }, '', Path.encode(path)); + notifyChange(LocationActions.REPLACE); + }, + + pop: History.back, + + getCurrentPath: getWindowPath, + + toString: function () { + return ''; + } + + }; + + module.exports = HistoryLocation; + + +/***/ }, +/* 27 */ +/***/ function(module, exports, __webpack_require__) { + + var HistoryLocation = __webpack_require__(26); + var History = __webpack_require__(34); + var Path = __webpack_require__(76); + + /** + * A Location that uses full page refreshes. This is used as + * the fallback for HistoryLocation in browsers that do not + * support the HTML5 history API. + */ + var RefreshLocation = { + + push: function (path) { + window.location = Path.encode(path); + }, + + replace: function (path) { + window.location.replace(Path.encode(path)); + }, + + pop: History.back, + + getCurrentPath: HistoryLocation.getCurrentPath, + + toString: function () { + return ''; + } + + }; + + module.exports = RefreshLocation; + + +/***/ }, +/* 28 */ +/***/ function(module, exports, __webpack_require__) { + + var LocationActions = __webpack_require__(75); + + /** + * A scroll behavior that attempts to imitate the default behavior + * of modern browsers. + */ + var ImitateBrowserBehavior = { + + updateScrollPosition: function (position, actionType) { + switch (actionType) { + case LocationActions.PUSH: + case LocationActions.REPLACE: + window.scrollTo(0, 0); + break; + case LocationActions.POP: + if (position) { + window.scrollTo(position.x, position.y); + } else { + window.scrollTo(0, 0); + } + break; + } + } + + }; + + module.exports = ImitateBrowserBehavior; + + +/***/ }, +/* 29 */ +/***/ function(module, exports, __webpack_require__) { + + /** + * A scroll behavior that always scrolls to the top of the page + * after a transition. + */ + var ScrollToTopBehavior = { + + updateScrollPosition: function () { + window.scrollTo(0, 0); + } + + }; + + module.exports = ScrollToTopBehavior; + + +/***/ }, +/* 30 */ +/***/ function(module, exports, __webpack_require__) { + + var React = __webpack_require__(4); + + /** + * A mixin for components that modify the URL. + * + * Example: + * + * var MyLink = React.createClass({ + * mixins: [ Router.Navigation ], + * handleClick: function (event) { + * event.preventDefault(); + * this.transitionTo('aRoute', { the: 'params' }, { the: 'query' }); + * }, + * render: function () { + * return ( + *
    Click me! + * ); + * } + * }); + */ + var Navigation = { + + contextTypes: { + makePath: React.PropTypes.func.isRequired, + makeHref: React.PropTypes.func.isRequired, + transitionTo: React.PropTypes.func.isRequired, + replaceWith: React.PropTypes.func.isRequired, + goBack: React.PropTypes.func.isRequired + }, + + /** + * Returns an absolute URL path created from the given route + * name, URL parameters, and query values. + */ + makePath: function (to, params, query) { + return this.context.makePath(to, params, query); + }, + + /** + * Returns a string that may safely be used as the href of a + * link to the route with the given name. + */ + makeHref: function (to, params, query) { + return this.context.makeHref(to, params, query); + }, + + /** + * Transitions to the URL specified in the arguments by pushing + * a new URL onto the history stack. + */ + transitionTo: function (to, params, query) { + this.context.transitionTo(to, params, query); + }, + + /** + * Transitions to the URL specified in the arguments by replacing + * the current URL in the history stack. + */ + replaceWith: function (to, params, query) { + this.context.replaceWith(to, params, query); + }, + + /** + * Transitions to the previous URL. + */ + goBack: function () { + this.context.goBack(); + } + + }; + + module.exports = Navigation; + + +/***/ }, +/* 31 */ +/***/ function(module, exports, __webpack_require__) { + + var React = __webpack_require__(4); + + /** + * A mixin for components that need to know the path, routes, URL + * params and query that are currently active. + * + * Example: + * + * var AboutLink = React.createClass({ + * mixins: [ Router.State ], + * render: function () { + * var className = this.props.className; + * + * if (this.isActive('about')) + * className += ' is-active'; + * + * return React.DOM.a({ className: className }, this.props.children); + * } + * }); + */ + var State = { + + contextTypes: { + getCurrentPath: React.PropTypes.func.isRequired, + getCurrentRoutes: React.PropTypes.func.isRequired, + getCurrentPathname: React.PropTypes.func.isRequired, + getCurrentParams: React.PropTypes.func.isRequired, + getCurrentQuery: React.PropTypes.func.isRequired, + isActive: React.PropTypes.func.isRequired + }, + + /** + * Returns the current URL path. + */ + getPath: function () { + return this.context.getCurrentPath(); + }, + + /** + * Returns an array of the routes that are currently active. + */ + getRoutes: function () { + return this.context.getCurrentRoutes(); + }, + + /** + * Returns the current URL path without the query string. + */ + getPathname: function () { + return this.context.getCurrentPathname(); + }, + + /** + * Returns an object of the URL params that are currently active. + */ + getParams: function () { + return this.context.getCurrentParams(); + }, + + /** + * Returns an object of the query params that are currently active. + */ + getQuery: function () { + return this.context.getCurrentQuery(); + }, + + /** + * A helper method to determine if a given route, params, and query + * are active. + */ + isActive: function (to, params, query) { + return this.context.isActive(to, params, query); + } + + }; + + module.exports = State; + + +/***/ }, +/* 32 */ +/***/ function(module, exports, __webpack_require__) { + + /* WEBPACK VAR INJECTION */(function(process) {/* jshint -W058 */ + var React = __webpack_require__(4); + var warning = __webpack_require__(78); + var invariant = __webpack_require__(79); + var canUseDOM = __webpack_require__(69).canUseDOM; + var ImitateBrowserBehavior = __webpack_require__(28); + var RouteHandler = __webpack_require__(24); + var LocationActions = __webpack_require__(75); + var HashLocation = __webpack_require__(25); + var HistoryLocation = __webpack_require__(26); + var RefreshLocation = __webpack_require__(27); + var NavigationContext = __webpack_require__(80); + var StateContext = __webpack_require__(81); + var Scrolling = __webpack_require__(82); + var createRoutesFromChildren = __webpack_require__(83); + var supportsHistory = __webpack_require__(84); + var Transition = __webpack_require__(85); + var PropTypes = __webpack_require__(72); + var Redirect = __webpack_require__(86); + var History = __webpack_require__(34); + var Cancellation = __webpack_require__(87); + var Path = __webpack_require__(76); + + /** + * The default location for new routers. + */ + var DEFAULT_LOCATION = canUseDOM ? HashLocation : '/'; + + /** + * The default scroll behavior for new routers. + */ + var DEFAULT_SCROLL_BEHAVIOR = canUseDOM ? ImitateBrowserBehavior : null; + + /** + * The default error handler for new routers. + */ + function defaultErrorHandler(error) { + // Throw so we don't silently swallow async errors. + throw error; // This error probably originated in a transition hook. + } + + /** + * The default aborted transition handler for new routers. + */ + function defaultAbortHandler(abortReason, location) { + if (typeof location === 'string') + throw new Error('Unhandled aborted transition! Reason: ' + abortReason); + + if (abortReason instanceof Cancellation) { + return; + } else if (abortReason instanceof Redirect) { + location.replace(this.makePath(abortReason.to, abortReason.params, abortReason.query)); + } else { + location.pop(); + } + } + + function findMatch(pathname, routes, defaultRoute, notFoundRoute) { + var match, route, params; + + for (var i = 0, len = routes.length; i < len; ++i) { + route = routes[i]; + + // Check the subtree first to find the most deeply-nested match. + match = findMatch(pathname, route.childRoutes, route.defaultRoute, route.notFoundRoute); + + if (match != null) { + match.routes.unshift(route); + return match; + } + + // No routes in the subtree matched, so check this route. + params = Path.extractParams(route.path, pathname); + + if (params) + return createMatch(route, params); + } + + // No routes matched, so try the default route if there is one. + if (defaultRoute && (params = Path.extractParams(defaultRoute.path, pathname))) + return createMatch(defaultRoute, params); + + // Last attempt: does the "not found" route match? + if (notFoundRoute && (params = Path.extractParams(notFoundRoute.path, pathname))) + return createMatch(notFoundRoute, params); + + return match; + } + + function createMatch(route, params) { + return { routes: [ route ], params: params }; + } + + function hasProperties(object, properties) { + for (var propertyName in properties) + if (properties.hasOwnProperty(propertyName) && object[propertyName] !== properties[propertyName]) + return false; + + return true; + } + + function hasMatch(routes, route, prevParams, nextParams, prevQuery, nextQuery) { + return routes.some(function (r) { + if (r !== route) + return false; + + var paramNames = route.paramNames; + var paramName; + + // Ensure that all params the route cares about did not change. + for (var i = 0, len = paramNames.length; i < len; ++i) { + paramName = paramNames[i]; + + if (nextParams[paramName] !== prevParams[paramName]) + return false; + } + + // Ensure the query hasn't changed. + return hasProperties(prevQuery, nextQuery) && hasProperties(nextQuery, prevQuery); + }); + } + + /** + * Creates and returns a new router using the given options. A router + * is a ReactComponent class that knows how to react to changes in the + * URL and keep the contents of the page in sync. + * + * Options may be any of the following: + * + * - routes (required) The route config + * - location The location to use. Defaults to HashLocation when + * the DOM is available, "/" otherwise + * - scrollBehavior The scroll behavior to use. Defaults to ImitateBrowserBehavior + * when the DOM is available, null otherwise + * - onError A function that is used to handle errors + * - onAbort A function that is used to handle aborted transitions + * + * When rendering in a server-side environment, the location should simply + * be the URL path that was used in the request, including the query string. + */ + function createRouter(options) { + options = options || {}; + + if (typeof options === 'function') { + options = { routes: options }; // Router.create() + } else if (Array.isArray(options)) { + options = { routes: options }; // Router.create([ , ]) + } + + var routes = []; + var namedRoutes = {}; + var components = []; + var location = options.location || DEFAULT_LOCATION; + var scrollBehavior = options.scrollBehavior || DEFAULT_SCROLL_BEHAVIOR; + var onError = options.onError || defaultErrorHandler; + var onAbort = options.onAbort || defaultAbortHandler; + var state = {}; + var nextState = {}; + var pendingTransition = null; + + function updateState() { + state = nextState; + nextState = {}; + } + + if (typeof location === 'string') { + warning( + !canUseDOM || process.env.NODE_ENV === 'test', + 'You should not use a static location in a DOM environment because ' + + 'the router will not be kept in sync with the current URL' + ); + } else { + invariant( + canUseDOM, + 'You cannot use %s without a DOM', + location + ); + } + + // Automatically fall back to full page refreshes in + // browsers that don't support the HTML history API. + if (location === HistoryLocation && !supportsHistory()) + location = RefreshLocation; + + var router = React.createClass({ + + displayName: 'Router', + + mixins: [ NavigationContext, StateContext, Scrolling ], + + statics: { + + defaultRoute: null, + notFoundRoute: null, + + /** + * Adds routes to this router from the given children object (see ReactChildren). + */ + addRoutes: function (children) { + routes.push.apply(routes, createRoutesFromChildren(children, this, namedRoutes)); + }, + + /** + * Returns an absolute URL path created from the given route + * name, URL parameters, and query. + */ + makePath: function (to, params, query) { + var path; + if (Path.isAbsolute(to)) { + path = Path.normalize(to); + } else { + var route = namedRoutes[to]; + + invariant( + route, + 'Unable to find ', + to + ); + + path = route.path; + } + + return Path.withQuery(Path.injectParams(path, params), query); + }, + + /** + * Returns a string that may safely be used as the href of a link + * to the route with the given name, URL parameters, and query. + */ + makeHref: function (to, params, query) { + var path = this.makePath(to, params, query); + return (location === HashLocation) ? '#' + path : path; + }, + + /** + * Transitions to the URL specified in the arguments by pushing + * a new URL onto the history stack. + */ + transitionTo: function (to, params, query) { + invariant( + typeof location !== 'string', + 'You cannot use transitionTo with a static location' + ); + + var path = this.makePath(to, params, query); + + if (pendingTransition) { + // Replace so pending location does not stay in history. + location.replace(path); + } else { + location.push(path); + } + }, + + /** + * Transitions to the URL specified in the arguments by replacing + * the current URL in the history stack. + */ + replaceWith: function (to, params, query) { + invariant( + typeof location !== 'string', + 'You cannot use replaceWith with a static location' + ); + + location.replace(this.makePath(to, params, query)); + }, + + /** + * Transitions to the previous URL if one is available. Returns true if the + * router was able to go back, false otherwise. + * + * Note: The router only tracks history entries in your application, not the + * current browser session, so you can safely call this function without guarding + * against sending the user back to some other site. However, when using + * RefreshLocation (which is the fallback for HistoryLocation in browsers that + * don't support HTML5 history) this method will *always* send the client back + * because we cannot reliably track history length. + */ + goBack: function () { + invariant( + typeof location !== 'string', + 'You cannot use goBack with a static location' + ); + + if (History.length > 1 || location === RefreshLocation) { + location.pop(); + return true; + } + + warning(false, 'goBack() was ignored because there is no router history'); + + return false; + }, + + /** + * Performs a match of the given pathname against this router and returns an object + * with the { routes, params } that match. Returns null if no match can be made. + */ + match: function (pathname) { + return findMatch(pathname, routes, this.defaultRoute, this.notFoundRoute) || null; + }, + + /** + * Performs a transition to the given path and calls callback(error, abortReason) + * when the transition is finished. If both arguments are null the router's state + * was updated. Otherwise the transition did not complete. + * + * In a transition, a router first determines which routes are involved by beginning + * with the current route, up the route tree to the first parent route that is shared + * with the destination route, and back down the tree to the destination route. The + * willTransitionFrom hook is invoked on all route handlers we're transitioning away + * from, in reverse nesting order. Likewise, the willTransitionTo hook is invoked on + * all route handlers we're transitioning to. + * + * Both willTransitionFrom and willTransitionTo hooks may either abort or redirect the + * transition. To resolve asynchronously, they may use transition.wait(promise). If no + * hooks wait, the transition is fully synchronous. + */ + dispatch: function (path, action, callback) { + if (pendingTransition) { + pendingTransition.abort(new Cancellation); + pendingTransition = null; + } + + var prevPath = state.path; + if (prevPath === path) + return; // Nothing to do! + + // Record the scroll position as early as possible to + // get it before browsers try update it automatically. + if (prevPath && action !== LocationActions.REPLACE) + this.recordScrollPosition(prevPath); + + var pathname = Path.withoutQuery(path); + var match = this.match(pathname); + + warning( + match != null, + 'No route matches path "%s". Make sure you have somewhere in your routes', + path, path + ); + + if (match == null) + match = {}; + + var prevRoutes = state.routes || []; + var prevParams = state.params || {}; + var prevQuery = state.query || {}; + + var nextRoutes = match.routes || []; + var nextParams = match.params || {}; + var nextQuery = Path.extractQuery(path) || {}; + + var fromRoutes, toRoutes; + if (prevRoutes.length) { + fromRoutes = prevRoutes.filter(function (route) { + return !hasMatch(nextRoutes, route, prevParams, nextParams, prevQuery, nextQuery); + }); + + toRoutes = nextRoutes.filter(function (route) { + return !hasMatch(prevRoutes, route, prevParams, nextParams, prevQuery, nextQuery); + }); + } else { + fromRoutes = []; + toRoutes = nextRoutes; + } + + var transition = new Transition(path, this.replaceWith.bind(this, path)); + pendingTransition = transition; + + transition.from(fromRoutes, components, function (error) { + if (error || transition.isAborted) + return callback.call(router, error, transition); + + transition.to(toRoutes, nextParams, nextQuery, function (error) { + if (error || transition.isAborted) + return callback.call(router, error, transition); + + nextState.path = path; + nextState.action = action; + nextState.pathname = pathname; + nextState.routes = nextRoutes; + nextState.params = nextParams; + nextState.query = nextQuery; + + callback.call(router, null, transition); + }); + }); + }, + + /** + * Starts this router and calls callback(router, state) when the route changes. + * + * If the router's location is static (i.e. a URL path in a server environment) + * the callback is called only once. Otherwise, the location should be one of the + * Router.*Location objects (e.g. Router.HashLocation or Router.HistoryLocation). + */ + run: function (callback) { + var dispatchHandler = function (error, transition) { + pendingTransition = null; + + if (error) { + onError.call(router, error); + } else if (transition.isAborted) { + onAbort.call(router, transition.abortReason, location); + } else { + callback.call(router, router, nextState); + } + }; + + if (typeof location === 'string') { + router.dispatch(location, null, dispatchHandler); + } else { + // Listen for changes to the location. + var changeListener = function (change) { + router.dispatch(change.path, change.type, dispatchHandler); + }; + + if (location.addChangeListener) + location.addChangeListener(changeListener); + + // Bootstrap using the current path. + router.dispatch(location.getCurrentPath(), null, dispatchHandler); + } + }, + + teardown: function() { + location.removeChangeListener(this.changeListener); + } + + }, + + propTypes: { + children: PropTypes.falsy + }, + + getLocation: function () { + return location; + }, + + getScrollBehavior: function () { + return scrollBehavior; + }, + + getRouteAtDepth: function (depth) { + var routes = this.state.routes; + return routes && routes[depth]; + }, + + getRouteComponents: function () { + return components; + }, + + getInitialState: function () { + updateState(); + return state; + }, + + componentWillReceiveProps: function () { + updateState(); + this.setState(state); + }, + + componentWillUnmount: function() { + router.teardown(); + }, + + render: function () { + return this.getRouteAtDepth(0) ? React.createElement(RouteHandler, this.props) : null; + }, + + childContextTypes: { + getRouteAtDepth: React.PropTypes.func.isRequired, + getRouteComponents: React.PropTypes.func.isRequired, + routeHandlers: React.PropTypes.array.isRequired + }, + + getChildContext: function () { + return { + getRouteComponents: this.getRouteComponents, + getRouteAtDepth: this.getRouteAtDepth, + routeHandlers: [ this ] + }; + } + + }); + + if (options.routes) + router.addRoutes(options.routes); + + return router; + } + + module.exports = createRouter; + + /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(89))) + +/***/ }, +/* 33 */ +/***/ function(module, exports, __webpack_require__) { + + var createRouter = __webpack_require__(32); + + /** + * A high-level convenience method that creates, configures, and + * runs a router in one shot. The method signature is: + * + * Router.run(routes[, location ], callback); + * + * Using `window.location.hash` to manage the URL, you could do: + * + * Router.run(routes, function (Handler) { + * React.render(, document.body); + * }); + * + * Using HTML5 history and a custom "cursor" prop: + * + * Router.run(routes, Router.HistoryLocation, function (Handler) { + * React.render(, document.body); + * }); + * + * Returns the newly created router. + * + * Note: If you need to specify further options for your router such + * as error/abort handling or custom scroll behavior, use Router.create + * instead. + * + * var router = Router.create(options); + * router.run(function (Handler) { + * // ... + * }); + */ + function runRouter(routes, location, callback) { + if (typeof location === 'function') { + callback = location; + location = null; + } + + var router = createRouter({ + routes: routes, + location: location + }); + + router.run(callback); + + return router; + } + + module.exports = runRouter; + + +/***/ }, +/* 34 */ +/***/ function(module, exports, __webpack_require__) { + + var invariant = __webpack_require__(79); + var canUseDOM = __webpack_require__(69).canUseDOM; + + var History = { + + /** + * Sends the browser back one entry in the history. + */ + back: function () { + invariant( + canUseDOM, + 'Cannot use History.back without a DOM' + ); + + // Do this first so that History.length will + // be accurate in location change listeners. + History.length -= 1; + + window.history.back(); + }, + + /** + * The current number of entries in the history. + */ + length: 1 + + }; + + module.exports = History; + + +/***/ }, +/* 35 */ +/***/ function(module, exports, __webpack_require__) { + + var isArguments = __webpack_require__(91), + isArray = __webpack_require__(92), + isFunction = __webpack_require__(93), + isLength = __webpack_require__(94), + isObjectLike = __webpack_require__(95), + isString = __webpack_require__(36), + keys = __webpack_require__(96); + + /** + * Checks if a value is empty. A value is considered empty unless it is an + * `arguments` object, array, string, or jQuery-like collection with a length + * greater than `0` or an object with own enumerable properties. + * + * @static + * @memberOf _ + * @category Lang + * @param {Array|Object|string} value The value to inspect. + * @returns {boolean} Returns `true` if `value` is empty, else `false`. + * @example + * + * _.isEmpty(null); + * // => true + * + * _.isEmpty(true); + * // => true + * + * _.isEmpty(1); + * // => true + * + * _.isEmpty([1, 2, 3]); + * // => false + * + * _.isEmpty({ 'a': 1 }); + * // => false + */ + function isEmpty(value) { + if (value == null) { + return true; + } + var length = value.length; + if (isLength(length) && (isArray(value) || isString(value) || isArguments(value) || + (isObjectLike(value) && isFunction(value.splice)))) { + return !length; + } + return !keys(value).length; + } + + module.exports = isEmpty; + + +/***/ }, +/* 36 */ +/***/ function(module, exports, __webpack_require__) { + + var isObjectLike = __webpack_require__(95); + + /** `Object#toString` result references. */ + var stringTag = '[object String]'; + + /** Used for native method references. */ + var objectProto = Object.prototype; + + /** + * Used to resolve the `toStringTag` of values. + * See the [ES spec](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.prototype.tostring) + * for more details. + */ + var objToString = objectProto.toString; + + /** + * Checks if `value` is classified as a `String` primitive or object. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. + * @example + * + * _.isString('abc'); + * // => true + * + * _.isString(1); + * // => false + */ + function isString(value) { + return typeof value == 'string' || (isObjectLike(value) && objToString.call(value) == stringTag) || false; + } + + module.exports = isString; + + +/***/ }, +/* 37 */ +/***/ function(module, exports, __webpack_require__) { + + "use strict"; + + var _interopRequire = function (obj) { return obj && obj.__esModule ? obj["default"] : obj; }; + + var React = _interopRequire(__webpack_require__(4)); + + var Stat = _interopRequire(__webpack_require__(97)); + + var Repo = React.createClass({ + displayName: "Repo", + renderStat: function () { + if (this.props.data.stargazers_count) { + return React.createElement( + "div", + { className: "Repo-wrapStat" }, + React.createElement(Stat, { value: this.props.data.stargazers_count, title: "Star" }) + ); + } else { + return null; + } + }, + + render: function () { + return React.createElement( + "div", + { className: "Repo" }, + React.createElement( + "a", + { className: "Repo-link u-linkBlock", href: this.props.data.html_url }, + React.createElement( + "h3", + { className: "Repo-name" }, + this.props.data.name + ), + React.createElement( + "p", + { className: "Repo-description u-textTruncate" }, + this.props.data.description + ), + this.renderStat() + ) + ); + } + }); + + module.exports = Repo; + +/***/ }, +/* 38 */ +/***/ function(module, exports, __webpack_require__) { + + var arrayMap = __webpack_require__(98), + baseCallback = __webpack_require__(99), + baseMap = __webpack_require__(100), + isArray = __webpack_require__(92); + + /** + * Creates an array of values by running each element in `collection` through + * `iteratee`. The `iteratee` is bound to `thisArg` and invoked with three + * arguments; (value, index|key, collection). + * + * If a property name is provided for `predicate` the created "_.property" + * style callback returns the property value of the given element. + * + * If an object is provided for `predicate` the created "_.matches" style + * callback returns `true` for elements that have the properties of the given + * object, else `false`. + * + * @static + * @memberOf _ + * @alias collect + * @category Collection + * @param {Array|Object|string} collection The collection to iterate over. + * @param {Function|Object|string} [iteratee=_.identity] The function invoked + * per iteration. If a property name or object is provided it is used to + * create a "_.property" or "_.matches" style callback respectively. + * @param {*} [thisArg] The `this` binding of `iteratee`. + * @returns {Array} Returns the new mapped array. + * @example + * + * _.map([1, 2, 3], function(n) { return n * 3; }); + * // => [3, 6, 9] + * + * _.map({ 'one': 1, 'two': 2, 'three': 3 }, function(n) { return n * 3; }); + * // => [3, 6, 9] (iteration order is not guaranteed) + * + * var users = [ + * { 'user': 'barney' }, + * { 'user': 'fred' } + * ]; + * + * // using the "_.property" callback shorthand + * _.map(users, 'user'); + * // => ['barney', 'fred'] + */ + function map(collection, iteratee, thisArg) { + var func = isArray(collection) ? arrayMap : baseMap; + iteratee = baseCallback(iteratee, thisArg, 3); + return func(collection, iteratee); + } + + module.exports = map; + + +/***/ }, +/* 39 */ +/***/ function(module, exports, __webpack_require__) { + + "use strict"; + + var _interopRequire = function (obj) { return obj && obj.__esModule ? obj["default"] : obj; }; + + var React = _interopRequire(__webpack_require__(4)); + + var Stat = _interopRequire(__webpack_require__(97)); + + var map = _interopRequire(__webpack_require__(38)); + + var uniqueId = _interopRequire(__webpack_require__(101)); + + var ProfileStatGroup = React.createClass({ + displayName: "ProfileStatGroup", + renderStatItems: function () { + return map(this.props.stats, function (value, key) { + return React.createElement( + "li", + { key: uniqueId(), className: "ProfileStatGroup-item" }, + React.createElement(Stat, { value: value, title: key, className: "Stat--large" }) + ); + }); + }, + + render: function () { + return React.createElement( + "ul", + { className: "ProfileStatGroup" }, + this.renderStatItems() + ); + } + }); + + module.exports = ProfileStatGroup; + +/***/ }, +/* 40 */ +/***/ function(module, exports, __webpack_require__) { + + module.exports = __webpack_require__(102); + + +/***/ }, +/* 41 */ +/***/ function(module, exports, __webpack_require__) { + + "use strict"; + + var _interopRequire = function (obj) { return obj && obj.__esModule ? obj["default"] : obj; }; + + var React = _interopRequire(__webpack_require__(4)); + + var Link = __webpack_require__(5).Link; + + + var ProfileCard = React.createClass({ + displayName: "ProfileCard", + render: function () { + return React.createElement( + "div", + { className: "ProfileCard" }, + React.createElement( + Link, + { className: "ProfileCard-link u-cf u-linkClean", to: "user", params: { username: this.props.username } }, + React.createElement("img", { className: "ProfileCard-avatar", src: this.props.avatar, width: "40", height: "40" }), + React.createElement( + "h2", + { className: "ProfileCard-username u-textTruncate" }, + this.props.username + ) + ) + ); + } + }); + + module.exports = ProfileCard; + +/***/ }, +/* 42 */ +/***/ function(module, exports, __webpack_require__) { + + var baseSlice = __webpack_require__(107), + createWrapper = __webpack_require__(108), + replaceHolders = __webpack_require__(109); + + /** Used to compose bitmasks for wrapper metadata. */ + var PARTIAL_FLAG = 32; + + /** + * Creates a function that invokes `func` with `partial` arguments prepended + * to those provided to the new function. This method is like `_.bind` except + * it does **not** alter the `this` binding. + * + * The `_.partial.placeholder` value, which defaults to `_` in monolithic + * builds, may be used as a placeholder for partially applied arguments. + * + * **Note:** This method does not set the `length` property of partially + * applied functions. + * + * @static + * @memberOf _ + * @category Function + * @param {Function} func The function to partially apply arguments to. + * @param {...*} [args] The arguments to be partially applied. + * @returns {Function} Returns the new partially applied function. + * @example + * + * var greet = function(greeting, name) { + * return greeting + ' ' + name; + * }; + * + * var sayHelloTo = _.partial(greet, 'hello'); + * sayHelloTo('fred'); + * // => 'hello fred' + * + * // using placeholders + * var greetFred = _.partial(greet, _, 'fred'); + * greetFred('hi'); + * // => 'hi fred' + */ + function partial(func) { + var partials = baseSlice(arguments, 1), + holders = replaceHolders(partials, partial.placeholder); + + return createWrapper(func, PARTIAL_FLAG, null, partials, holders); + } + + // Assign default placeholders. + partial.placeholder = {}; + + module.exports = partial; + + +/***/ }, +/* 43 */ +/***/ function(module, exports, __webpack_require__) { + + var baseFlatten = __webpack_require__(103), + bindCallback = __webpack_require__(104), + pickByArray = __webpack_require__(105), + pickByCallback = __webpack_require__(106); + + /** + * Creates an object composed of the picked `object` properties. Property + * names may be specified as individual arguments or as arrays of property + * names. If `predicate` is provided it is invoked for each property of `object` + * picking the properties `predicate` returns truthy for. The predicate is + * bound to `thisArg` and invoked with three arguments; (value, key, object). + * + * @static + * @memberOf _ + * @category Object + * @param {Object} object The source object. + * @param {Function|...(string|string[])} [predicate] The function invoked per + * iteration or property names to pick, specified as individual property + * names or arrays of property names. + * @param {*} [thisArg] The `this` binding of `predicate`. + * @returns {Object} Returns the new object. + * @example + * + * var object = { 'user': 'fred', 'age': 40 }; + * + * _.pick(object, 'user'); + * // => { 'user': 'fred' } + * + * _.pick(object, _.isString); + * // => { 'user': 'fred' } + */ + function pick(object, predicate, thisArg) { + if (object == null) { + return {}; + } + return typeof predicate == 'function' + ? pickByCallback(object, bindCallback(predicate, thisArg, 3)) + : pickByArray(object, baseFlatten(arguments, false, false, 1)); + } + + module.exports = pick; + + +/***/ }, +/* 44 */ +/***/ function(module, exports, __webpack_require__) { + + "use strict"; + + function getItem(key) { + var item = sessionStorage.getItem(key); + + try { + item = JSON.parse(item); + } catch (e) {} + + return item; + } + + function setItem(key, value) { + var type = toType(value); + + if (/object|array/.test(type)) { + value = JSON.stringify(value); + } + + sessionStorage.setItem(key, value); + } + + function removeItem(key) { + sessionStorage.removeItem(key); + } + + function toType(obj) { + return ({}).toString.call(obj).match(/\s([a-z|A-Z]+)/)[1].toLowerCase(); + } + + exports.getItem = getItem; + exports.setItem = setItem; + exports.removeItem = removeItem; + Object.defineProperty(exports, "__esModule", { + value: true + }); + +/***/ }, +/* 45 */ +/***/ function(module, exports, __webpack_require__) { + + "use strict"; + + /** + * Extract pagination links from Link header in GitHub API + * */ + + module.exports = parseLinkHeader; + function parseLinkHeader(link) { + if (!link) { + return {}; + } + + var parsed = {}; + var reg = /<(.*?)>; rel="(.*)"/; + + link.split(",").forEach(function (part) { + var r = reg.exec(part); + parsed[r[2]] = r[1]; + }); + + return parsed; + } + +/***/ }, +/* 46 */ +/***/ function(module, exports, __webpack_require__) { + + /* WEBPACK VAR INJECTION */(function(process) {/** + * Copyright 2013-2014, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule DOMPropertyOperations + * @typechecks static-only + */ + + "use strict"; + + var DOMProperty = __webpack_require__(112); + + var escapeTextForBrowser = __webpack_require__(113); + var memoizeStringOnly = __webpack_require__(114); + var warning = __webpack_require__(78); + + function shouldIgnoreValue(name, value) { + return value == null || + (DOMProperty.hasBooleanValue[name] && !value) || + (DOMProperty.hasNumericValue[name] && isNaN(value)) || + (DOMProperty.hasPositiveNumericValue[name] && (value < 1)) || + (DOMProperty.hasOverloadedBooleanValue[name] && value === false); + } + + var processAttributeNameAndPrefix = memoizeStringOnly(function(name) { + return escapeTextForBrowser(name) + '="'; + }); + + if ("production" !== process.env.NODE_ENV) { + var reactProps = { + children: true, + dangerouslySetInnerHTML: true, + key: true, + ref: true + }; + var warnedProperties = {}; + + var warnUnknownProperty = function(name) { + if (reactProps.hasOwnProperty(name) && reactProps[name] || + warnedProperties.hasOwnProperty(name) && warnedProperties[name]) { + return; + } + + warnedProperties[name] = true; + var lowerCasedName = name.toLowerCase(); + + // data-* attributes should be lowercase; suggest the lowercase version + var standardName = ( + DOMProperty.isCustomAttribute(lowerCasedName) ? + lowerCasedName : + DOMProperty.getPossibleStandardName.hasOwnProperty(lowerCasedName) ? + DOMProperty.getPossibleStandardName[lowerCasedName] : + null + ); + + // For now, only warn when we have a suggested correction. This prevents + // logging too much when using transferPropsTo. + ("production" !== process.env.NODE_ENV ? warning( + standardName == null, + 'Unknown DOM property ' + name + '. Did you mean ' + standardName + '?' + ) : null); + + }; + } + + /** + * Operations for dealing with DOM properties. + */ + var DOMPropertyOperations = { + + /** + * Creates markup for the ID property. + * + * @param {string} id Unescaped ID. + * @return {string} Markup string. + */ + createMarkupForID: function(id) { + return processAttributeNameAndPrefix(DOMProperty.ID_ATTRIBUTE_NAME) + + escapeTextForBrowser(id) + '"'; + }, + + /** + * Creates markup for a property. + * + * @param {string} name + * @param {*} value + * @return {?string} Markup string, or null if the property was invalid. + */ + createMarkupForProperty: function(name, value) { + if (DOMProperty.isStandardName.hasOwnProperty(name) && + DOMProperty.isStandardName[name]) { + if (shouldIgnoreValue(name, value)) { + return ''; + } + var attributeName = DOMProperty.getAttributeName[name]; + if (DOMProperty.hasBooleanValue[name] || + (DOMProperty.hasOverloadedBooleanValue[name] && value === true)) { + return escapeTextForBrowser(attributeName); + } + return processAttributeNameAndPrefix(attributeName) + + escapeTextForBrowser(value) + '"'; + } else if (DOMProperty.isCustomAttribute(name)) { + if (value == null) { + return ''; + } + return processAttributeNameAndPrefix(name) + + escapeTextForBrowser(value) + '"'; + } else if ("production" !== process.env.NODE_ENV) { + warnUnknownProperty(name); + } + return null; + }, + + /** + * Sets the value for a property on a node. + * + * @param {DOMElement} node + * @param {string} name + * @param {*} value + */ + setValueForProperty: function(node, name, value) { + if (DOMProperty.isStandardName.hasOwnProperty(name) && + DOMProperty.isStandardName[name]) { + var mutationMethod = DOMProperty.getMutationMethod[name]; + if (mutationMethod) { + mutationMethod(node, value); + } else if (shouldIgnoreValue(name, value)) { + this.deleteValueForProperty(node, name); + } else if (DOMProperty.mustUseAttribute[name]) { + // `setAttribute` with objects becomes only `[object]` in IE8/9, + // ('' + value) makes it output the correct toString()-value. + node.setAttribute(DOMProperty.getAttributeName[name], '' + value); + } else { + var propName = DOMProperty.getPropertyName[name]; + // Must explicitly cast values for HAS_SIDE_EFFECTS-properties to the + // property type before comparing; only `value` does and is string. + if (!DOMProperty.hasSideEffects[name] || + ('' + node[propName]) !== ('' + value)) { + // Contrary to `setAttribute`, object properties are properly + // `toString`ed by IE8/9. + node[propName] = value; + } + } + } else if (DOMProperty.isCustomAttribute(name)) { + if (value == null) { + node.removeAttribute(name); + } else { + node.setAttribute(name, '' + value); + } + } else if ("production" !== process.env.NODE_ENV) { + warnUnknownProperty(name); + } + }, + + /** + * Deletes the value for a property on a node. + * + * @param {DOMElement} node + * @param {string} name + */ + deleteValueForProperty: function(node, name) { + if (DOMProperty.isStandardName.hasOwnProperty(name) && + DOMProperty.isStandardName[name]) { + var mutationMethod = DOMProperty.getMutationMethod[name]; + if (mutationMethod) { + mutationMethod(node, undefined); + } else if (DOMProperty.mustUseAttribute[name]) { + node.removeAttribute(DOMProperty.getAttributeName[name]); + } else { + var propName = DOMProperty.getPropertyName[name]; + var defaultValue = DOMProperty.getDefaultValueForProperty( + node.nodeName, + propName + ); + if (!DOMProperty.hasSideEffects[name] || + ('' + node[propName]) !== defaultValue) { + node[propName] = defaultValue; + } + } + } else if (DOMProperty.isCustomAttribute(name)) { + node.removeAttribute(name); + } else if ("production" !== process.env.NODE_ENV) { + warnUnknownProperty(name); + } + } + + }; + + module.exports = DOMPropertyOperations; + + /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(89))) + +/***/ }, +/* 47 */ +/***/ function(module, exports, __webpack_require__) { + + /* WEBPACK VAR INJECTION */(function(process) {/** + * Copyright 2013-2014, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule EventPluginUtils + */ + + "use strict"; + + var EventConstants = __webpack_require__(115); + + var invariant = __webpack_require__(79); + + /** + * Injected dependencies: + */ + + /** + * - `Mount`: [required] Module that can convert between React dom IDs and + * actual node references. + */ + var injection = { + Mount: null, + injectMount: function(InjectedMount) { + injection.Mount = InjectedMount; + if ("production" !== process.env.NODE_ENV) { + ("production" !== process.env.NODE_ENV ? invariant( + InjectedMount && InjectedMount.getNode, + 'EventPluginUtils.injection.injectMount(...): Injected Mount module ' + + 'is missing getNode.' + ) : invariant(InjectedMount && InjectedMount.getNode)); + } + } + }; + + var topLevelTypes = EventConstants.topLevelTypes; + + function isEndish(topLevelType) { + return topLevelType === topLevelTypes.topMouseUp || + topLevelType === topLevelTypes.topTouchEnd || + topLevelType === topLevelTypes.topTouchCancel; + } + + function isMoveish(topLevelType) { + return topLevelType === topLevelTypes.topMouseMove || + topLevelType === topLevelTypes.topTouchMove; + } + function isStartish(topLevelType) { + return topLevelType === topLevelTypes.topMouseDown || + topLevelType === topLevelTypes.topTouchStart; + } + + + var validateEventDispatches; + if ("production" !== process.env.NODE_ENV) { + validateEventDispatches = function(event) { + var dispatchListeners = event._dispatchListeners; + var dispatchIDs = event._dispatchIDs; + + var listenersIsArr = Array.isArray(dispatchListeners); + var idsIsArr = Array.isArray(dispatchIDs); + var IDsLen = idsIsArr ? dispatchIDs.length : dispatchIDs ? 1 : 0; + var listenersLen = listenersIsArr ? + dispatchListeners.length : + dispatchListeners ? 1 : 0; + + ("production" !== process.env.NODE_ENV ? invariant( + idsIsArr === listenersIsArr && IDsLen === listenersLen, + 'EventPluginUtils: Invalid `event`.' + ) : invariant(idsIsArr === listenersIsArr && IDsLen === listenersLen)); + }; + } + + /** + * Invokes `cb(event, listener, id)`. Avoids using call if no scope is + * provided. The `(listener,id)` pair effectively forms the "dispatch" but are + * kept separate to conserve memory. + */ + function forEachEventDispatch(event, cb) { + var dispatchListeners = event._dispatchListeners; + var dispatchIDs = event._dispatchIDs; + if ("production" !== process.env.NODE_ENV) { + validateEventDispatches(event); + } + if (Array.isArray(dispatchListeners)) { + for (var i = 0; i < dispatchListeners.length; i++) { + if (event.isPropagationStopped()) { + break; + } + // Listeners and IDs are two parallel arrays that are always in sync. + cb(event, dispatchListeners[i], dispatchIDs[i]); + } + } else if (dispatchListeners) { + cb(event, dispatchListeners, dispatchIDs); + } + } + + /** + * Default implementation of PluginModule.executeDispatch(). + * @param {SyntheticEvent} SyntheticEvent to handle + * @param {function} Application-level callback + * @param {string} domID DOM id to pass to the callback. + */ + function executeDispatch(event, listener, domID) { + event.currentTarget = injection.Mount.getNode(domID); + var returnValue = listener(event, domID); + event.currentTarget = null; + return returnValue; + } + + /** + * Standard/simple iteration through an event's collected dispatches. + */ + function executeDispatchesInOrder(event, executeDispatch) { + forEachEventDispatch(event, executeDispatch); + event._dispatchListeners = null; + event._dispatchIDs = null; + } + + /** + * Standard/simple iteration through an event's collected dispatches, but stops + * at the first dispatch execution returning true, and returns that id. + * + * @return id of the first dispatch execution who's listener returns true, or + * null if no listener returned true. + */ + function executeDispatchesInOrderStopAtTrueImpl(event) { + var dispatchListeners = event._dispatchListeners; + var dispatchIDs = event._dispatchIDs; + if ("production" !== process.env.NODE_ENV) { + validateEventDispatches(event); + } + if (Array.isArray(dispatchListeners)) { + for (var i = 0; i < dispatchListeners.length; i++) { + if (event.isPropagationStopped()) { + break; + } + // Listeners and IDs are two parallel arrays that are always in sync. + if (dispatchListeners[i](event, dispatchIDs[i])) { + return dispatchIDs[i]; + } + } + } else if (dispatchListeners) { + if (dispatchListeners(event, dispatchIDs)) { + return dispatchIDs; + } + } + return null; + } + + /** + * @see executeDispatchesInOrderStopAtTrueImpl + */ + function executeDispatchesInOrderStopAtTrue(event) { + var ret = executeDispatchesInOrderStopAtTrueImpl(event); + event._dispatchIDs = null; + event._dispatchListeners = null; + return ret; + } + + /** + * Execution of a "direct" dispatch - there must be at most one dispatch + * accumulated on the event or it is considered an error. It doesn't really make + * sense for an event with multiple dispatches (bubbled) to keep track of the + * return values at each dispatch execution, but it does tend to make sense when + * dealing with "direct" dispatches. + * + * @return The return value of executing the single dispatch. + */ + function executeDirectDispatch(event) { + if ("production" !== process.env.NODE_ENV) { + validateEventDispatches(event); + } + var dispatchListener = event._dispatchListeners; + var dispatchID = event._dispatchIDs; + ("production" !== process.env.NODE_ENV ? invariant( + !Array.isArray(dispatchListener), + 'executeDirectDispatch(...): Invalid `event`.' + ) : invariant(!Array.isArray(dispatchListener))); + var res = dispatchListener ? + dispatchListener(event, dispatchID) : + null; + event._dispatchListeners = null; + event._dispatchIDs = null; + return res; + } + + /** + * @param {SyntheticEvent} event + * @return {bool} True iff number of dispatches accumulated is greater than 0. + */ + function hasDispatches(event) { + return !!event._dispatchListeners; + } + + /** + * General utilities that are useful in creating custom Event Plugins. + */ + var EventPluginUtils = { + isEndish: isEndish, + isMoveish: isMoveish, + isStartish: isStartish, + + executeDirectDispatch: executeDirectDispatch, + executeDispatch: executeDispatch, + executeDispatchesInOrder: executeDispatchesInOrder, + executeDispatchesInOrderStopAtTrue: executeDispatchesInOrderStopAtTrue, + hasDispatches: hasDispatches, + injection: injection, + useTouchEvents: false + }; + + module.exports = EventPluginUtils; + + /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(89))) + +/***/ }, +/* 48 */ +/***/ function(module, exports, __webpack_require__) { + + /* WEBPACK VAR INJECTION */(function(process) {/** + * Copyright 2013-2014, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule ReactChildren + */ + + "use strict"; + + var PooledClass = __webpack_require__(110); + + var traverseAllChildren = __webpack_require__(111); + var warning = __webpack_require__(78); + + var twoArgumentPooler = PooledClass.twoArgumentPooler; + var threeArgumentPooler = PooledClass.threeArgumentPooler; + + /** + * PooledClass representing the bookkeeping associated with performing a child + * traversal. Allows avoiding binding callbacks. + * + * @constructor ForEachBookKeeping + * @param {!function} forEachFunction Function to perform traversal with. + * @param {?*} forEachContext Context to perform context with. + */ + function ForEachBookKeeping(forEachFunction, forEachContext) { + this.forEachFunction = forEachFunction; + this.forEachContext = forEachContext; + } + PooledClass.addPoolingTo(ForEachBookKeeping, twoArgumentPooler); + + function forEachSingleChild(traverseContext, child, name, i) { + var forEachBookKeeping = traverseContext; + forEachBookKeeping.forEachFunction.call( + forEachBookKeeping.forEachContext, child, i); + } + + /** + * Iterates through children that are typically specified as `props.children`. + * + * The provided forEachFunc(child, index) will be called for each + * leaf child. + * + * @param {?*} children Children tree container. + * @param {function(*, int)} forEachFunc. + * @param {*} forEachContext Context for forEachContext. + */ + function forEachChildren(children, forEachFunc, forEachContext) { + if (children == null) { + return children; + } + + var traverseContext = + ForEachBookKeeping.getPooled(forEachFunc, forEachContext); + traverseAllChildren(children, forEachSingleChild, traverseContext); + ForEachBookKeeping.release(traverseContext); + } + + /** + * PooledClass representing the bookkeeping associated with performing a child + * mapping. Allows avoiding binding callbacks. + * + * @constructor MapBookKeeping + * @param {!*} mapResult Object containing the ordered map of results. + * @param {!function} mapFunction Function to perform mapping with. + * @param {?*} mapContext Context to perform mapping with. + */ + function MapBookKeeping(mapResult, mapFunction, mapContext) { + this.mapResult = mapResult; + this.mapFunction = mapFunction; + this.mapContext = mapContext; + } + PooledClass.addPoolingTo(MapBookKeeping, threeArgumentPooler); + + function mapSingleChildIntoContext(traverseContext, child, name, i) { + var mapBookKeeping = traverseContext; + var mapResult = mapBookKeeping.mapResult; + + var keyUnique = !mapResult.hasOwnProperty(name); + ("production" !== process.env.NODE_ENV ? warning( + keyUnique, + 'ReactChildren.map(...): Encountered two children with the same key, ' + + '`%s`. Child keys must be unique; when two children share a key, only ' + + 'the first child will be used.', + name + ) : null); + + if (keyUnique) { + var mappedChild = + mapBookKeeping.mapFunction.call(mapBookKeeping.mapContext, child, i); + mapResult[name] = mappedChild; + } + } + + /** + * Maps children that are typically specified as `props.children`. + * + * The provided mapFunction(child, key, index) will be called for each + * leaf child. + * + * TODO: This may likely break any calls to `ReactChildren.map` that were + * previously relying on the fact that we guarded against null children. + * + * @param {?*} children Children tree container. + * @param {function(*, int)} mapFunction. + * @param {*} mapContext Context for mapFunction. + * @return {object} Object containing the ordered map of results. + */ + function mapChildren(children, func, context) { + if (children == null) { + return children; + } + + var mapResult = {}; + var traverseContext = MapBookKeeping.getPooled(mapResult, func, context); + traverseAllChildren(children, mapSingleChildIntoContext, traverseContext); + MapBookKeeping.release(traverseContext); + return mapResult; + } + + function forEachSingleChildDummy(traverseContext, child, name, i) { + return null; + } + + /** + * Count the number of children that are typically specified as + * `props.children`. + * + * @param {?*} children Children tree container. + * @return {number} The number of children. + */ + function countChildren(children, context) { + return traverseAllChildren(children, forEachSingleChildDummy, null); + } + + var ReactChildren = { + forEach: forEachChildren, + map: mapChildren, + count: countChildren + }; + + module.exports = ReactChildren; + + /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(89))) + +/***/ }, +/* 49 */ +/***/ function(module, exports, __webpack_require__) { + + /* WEBPACK VAR INJECTION */(function(process) {/** + * Copyright 2013-2014, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule ReactComponent + */ + + "use strict"; + + var ReactElement = __webpack_require__(53); + var ReactOwner = __webpack_require__(116); + var ReactUpdates = __webpack_require__(117); + + var assign = __webpack_require__(66); + var invariant = __webpack_require__(79); + var keyMirror = __webpack_require__(118); + + /** + * Every React component is in one of these life cycles. + */ + var ComponentLifeCycle = keyMirror({ + /** + * Mounted components have a DOM node representation and are capable of + * receiving new props. + */ + MOUNTED: null, + /** + * Unmounted components are inactive and cannot receive new props. + */ + UNMOUNTED: null + }); + + var injected = false; + + /** + * Optionally injectable environment dependent cleanup hook. (server vs. + * browser etc). Example: A browser system caches DOM nodes based on component + * ID and must remove that cache entry when this instance is unmounted. + * + * @private + */ + var unmountIDFromEnvironment = null; + + /** + * The "image" of a component tree, is the platform specific (typically + * serialized) data that represents a tree of lower level UI building blocks. + * On the web, this "image" is HTML markup which describes a construction of + * low level `div` and `span` nodes. Other platforms may have different + * encoding of this "image". This must be injected. + * + * @private + */ + var mountImageIntoNode = null; + + /** + * Components are the basic units of composition in React. + * + * Every component accepts a set of keyed input parameters known as "props" that + * are initialized by the constructor. Once a component is mounted, the props + * can be mutated using `setProps` or `replaceProps`. + * + * Every component is capable of the following operations: + * + * `mountComponent` + * Initializes the component, renders markup, and registers event listeners. + * + * `receiveComponent` + * Updates the rendered DOM nodes to match the given component. + * + * `unmountComponent` + * Releases any resources allocated by this component. + * + * Components can also be "owned" by other components. Being owned by another + * component means being constructed by that component. This is different from + * being the child of a component, which means having a DOM representation that + * is a child of the DOM representation of that component. + * + * @class ReactComponent + */ + var ReactComponent = { + + injection: { + injectEnvironment: function(ReactComponentEnvironment) { + ("production" !== process.env.NODE_ENV ? invariant( + !injected, + 'ReactComponent: injectEnvironment() can only be called once.' + ) : invariant(!injected)); + mountImageIntoNode = ReactComponentEnvironment.mountImageIntoNode; + unmountIDFromEnvironment = + ReactComponentEnvironment.unmountIDFromEnvironment; + ReactComponent.BackendIDOperations = + ReactComponentEnvironment.BackendIDOperations; + injected = true; + } + }, + + /** + * @internal + */ + LifeCycle: ComponentLifeCycle, + + /** + * Injected module that provides ability to mutate individual properties. + * Injected into the base class because many different subclasses need access + * to this. + * + * @internal + */ + BackendIDOperations: null, + + /** + * Base functionality for every ReactComponent constructor. Mixed into the + * `ReactComponent` prototype, but exposed statically for easy access. + * + * @lends {ReactComponent.prototype} + */ + Mixin: { + + /** + * Checks whether or not this component is mounted. + * + * @return {boolean} True if mounted, false otherwise. + * @final + * @protected + */ + isMounted: function() { + return this._lifeCycleState === ComponentLifeCycle.MOUNTED; + }, + + /** + * Sets a subset of the props. + * + * @param {object} partialProps Subset of the next props. + * @param {?function} callback Called after props are updated. + * @final + * @public + */ + setProps: function(partialProps, callback) { + // Merge with the pending element if it exists, otherwise with existing + // element props. + var element = this._pendingElement || this._currentElement; + this.replaceProps( + assign({}, element.props, partialProps), + callback + ); + }, + + /** + * Replaces all of the props. + * + * @param {object} props New props. + * @param {?function} callback Called after props are updated. + * @final + * @public + */ + replaceProps: function(props, callback) { + ("production" !== process.env.NODE_ENV ? invariant( + this.isMounted(), + 'replaceProps(...): Can only update a mounted component.' + ) : invariant(this.isMounted())); + ("production" !== process.env.NODE_ENV ? invariant( + this._mountDepth === 0, + 'replaceProps(...): You called `setProps` or `replaceProps` on a ' + + 'component with a parent. This is an anti-pattern since props will ' + + 'get reactively updated when rendered. Instead, change the owner\'s ' + + '`render` method to pass the correct value as props to the component ' + + 'where it is created.' + ) : invariant(this._mountDepth === 0)); + // This is a deoptimized path. We optimize for always having a element. + // This creates an extra internal element. + this._pendingElement = ReactElement.cloneAndReplaceProps( + this._pendingElement || this._currentElement, + props + ); + ReactUpdates.enqueueUpdate(this, callback); + }, + + /** + * Schedule a partial update to the props. Only used for internal testing. + * + * @param {object} partialProps Subset of the next props. + * @param {?function} callback Called after props are updated. + * @final + * @internal + */ + _setPropsInternal: function(partialProps, callback) { + // This is a deoptimized path. We optimize for always having a element. + // This creates an extra internal element. + var element = this._pendingElement || this._currentElement; + this._pendingElement = ReactElement.cloneAndReplaceProps( + element, + assign({}, element.props, partialProps) + ); + ReactUpdates.enqueueUpdate(this, callback); + }, + + /** + * Base constructor for all React components. + * + * Subclasses that override this method should make sure to invoke + * `ReactComponent.Mixin.construct.call(this, ...)`. + * + * @param {ReactElement} element + * @internal + */ + construct: function(element) { + // This is the public exposed props object after it has been processed + // with default props. The element's props represents the true internal + // state of the props. + this.props = element.props; + // Record the component responsible for creating this component. + // This is accessible through the element but we maintain an extra + // field for compatibility with devtools and as a way to make an + // incremental update. TODO: Consider deprecating this field. + this._owner = element._owner; + + // All components start unmounted. + this._lifeCycleState = ComponentLifeCycle.UNMOUNTED; + + // See ReactUpdates. + this._pendingCallbacks = null; + + // We keep the old element and a reference to the pending element + // to track updates. + this._currentElement = element; + this._pendingElement = null; + }, + + /** + * Initializes the component, renders markup, and registers event listeners. + * + * NOTE: This does not insert any nodes into the DOM. + * + * Subclasses that override this method should make sure to invoke + * `ReactComponent.Mixin.mountComponent.call(this, ...)`. + * + * @param {string} rootID DOM ID of the root node. + * @param {ReactReconcileTransaction|ReactServerRenderingTransaction} transaction + * @param {number} mountDepth number of components in the owner hierarchy. + * @return {?string} Rendered markup to be inserted into the DOM. + * @internal + */ + mountComponent: function(rootID, transaction, mountDepth) { + ("production" !== process.env.NODE_ENV ? invariant( + !this.isMounted(), + 'mountComponent(%s, ...): Can only mount an unmounted component. ' + + 'Make sure to avoid storing components between renders or reusing a ' + + 'single component instance in multiple places.', + rootID + ) : invariant(!this.isMounted())); + var ref = this._currentElement.ref; + if (ref != null) { + var owner = this._currentElement._owner; + ReactOwner.addComponentAsRefTo(this, ref, owner); + } + this._rootNodeID = rootID; + this._lifeCycleState = ComponentLifeCycle.MOUNTED; + this._mountDepth = mountDepth; + // Effectively: return ''; + }, + + /** + * Releases any resources allocated by `mountComponent`. + * + * NOTE: This does not remove any nodes from the DOM. + * + * Subclasses that override this method should make sure to invoke + * `ReactComponent.Mixin.unmountComponent.call(this)`. + * + * @internal + */ + unmountComponent: function() { + ("production" !== process.env.NODE_ENV ? invariant( + this.isMounted(), + 'unmountComponent(): Can only unmount a mounted component.' + ) : invariant(this.isMounted())); + var ref = this._currentElement.ref; + if (ref != null) { + ReactOwner.removeComponentAsRefFrom(this, ref, this._owner); + } + unmountIDFromEnvironment(this._rootNodeID); + this._rootNodeID = null; + this._lifeCycleState = ComponentLifeCycle.UNMOUNTED; + }, + + /** + * Given a new instance of this component, updates the rendered DOM nodes + * as if that instance was rendered instead. + * + * Subclasses that override this method should make sure to invoke + * `ReactComponent.Mixin.receiveComponent.call(this, ...)`. + * + * @param {object} nextComponent Next set of properties. + * @param {ReactReconcileTransaction} transaction + * @internal + */ + receiveComponent: function(nextElement, transaction) { + ("production" !== process.env.NODE_ENV ? invariant( + this.isMounted(), + 'receiveComponent(...): Can only update a mounted component.' + ) : invariant(this.isMounted())); + this._pendingElement = nextElement; + this.performUpdateIfNecessary(transaction); + }, + + /** + * If `_pendingElement` is set, update the component. + * + * @param {ReactReconcileTransaction} transaction + * @internal + */ + performUpdateIfNecessary: function(transaction) { + if (this._pendingElement == null) { + return; + } + var prevElement = this._currentElement; + var nextElement = this._pendingElement; + this._currentElement = nextElement; + this.props = nextElement.props; + this._owner = nextElement._owner; + this._pendingElement = null; + this.updateComponent(transaction, prevElement); + }, + + /** + * Updates the component's currently mounted representation. + * + * @param {ReactReconcileTransaction} transaction + * @param {object} prevElement + * @internal + */ + updateComponent: function(transaction, prevElement) { + var nextElement = this._currentElement; + + // If either the owner or a `ref` has changed, make sure the newest owner + // has stored a reference to `this`, and the previous owner (if different) + // has forgotten the reference to `this`. We use the element instead + // of the public this.props because the post processing cannot determine + // a ref. The ref conceptually lives on the element. + + // TODO: Should this even be possible? The owner cannot change because + // it's forbidden by shouldUpdateReactComponent. The ref can change + // if you swap the keys of but not the refs. Reconsider where this check + // is made. It probably belongs where the key checking and + // instantiateReactComponent is done. + + if (nextElement._owner !== prevElement._owner || + nextElement.ref !== prevElement.ref) { + if (prevElement.ref != null) { + ReactOwner.removeComponentAsRefFrom( + this, prevElement.ref, prevElement._owner + ); + } + // Correct, even if the owner is the same, and only the ref has changed. + if (nextElement.ref != null) { + ReactOwner.addComponentAsRefTo( + this, + nextElement.ref, + nextElement._owner + ); + } + } + }, + + /** + * Mounts this component and inserts it into the DOM. + * + * @param {string} rootID DOM ID of the root node. + * @param {DOMElement} container DOM element to mount into. + * @param {boolean} shouldReuseMarkup If true, do not insert markup + * @final + * @internal + * @see {ReactMount.render} + */ + mountComponentIntoNode: function(rootID, container, shouldReuseMarkup) { + var transaction = ReactUpdates.ReactReconcileTransaction.getPooled(); + transaction.perform( + this._mountComponentIntoNode, + this, + rootID, + container, + transaction, + shouldReuseMarkup + ); + ReactUpdates.ReactReconcileTransaction.release(transaction); + }, + + /** + * @param {string} rootID DOM ID of the root node. + * @param {DOMElement} container DOM element to mount into. + * @param {ReactReconcileTransaction} transaction + * @param {boolean} shouldReuseMarkup If true, do not insert markup + * @final + * @private + */ + _mountComponentIntoNode: function( + rootID, + container, + transaction, + shouldReuseMarkup) { + var markup = this.mountComponent(rootID, transaction, 0); + mountImageIntoNode(markup, container, shouldReuseMarkup); + }, + + /** + * Checks if this component is owned by the supplied `owner` component. + * + * @param {ReactComponent} owner Component to check. + * @return {boolean} True if `owners` owns this component. + * @final + * @internal + */ + isOwnedBy: function(owner) { + return this._owner === owner; + }, + + /** + * Gets another component, that shares the same owner as this one, by ref. + * + * @param {string} ref of a sibling Component. + * @return {?ReactComponent} the actual sibling Component. + * @final + * @internal + */ + getSiblingByRef: function(ref) { + var owner = this._owner; + if (!owner || !owner.refs) { + return null; + } + return owner.refs[ref]; + } + } + }; + + module.exports = ReactComponent; + + /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(89))) + +/***/ }, +/* 50 */ +/***/ function(module, exports, __webpack_require__) { + + /* WEBPACK VAR INJECTION */(function(process) {/** + * Copyright 2013-2014, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule ReactCompositeComponent + */ + + "use strict"; + + var ReactComponent = __webpack_require__(49); + var ReactContext = __webpack_require__(51); + var ReactCurrentOwner = __webpack_require__(52); + var ReactElement = __webpack_require__(53); + var ReactElementValidator = __webpack_require__(54); + var ReactEmptyComponent = __webpack_require__(121); + var ReactErrorUtils = __webpack_require__(122); + var ReactLegacyElement = __webpack_require__(59); + var ReactOwner = __webpack_require__(116); + var ReactPerf = __webpack_require__(62); + var ReactPropTransferer = __webpack_require__(123); + var ReactPropTypeLocations = __webpack_require__(119); + var ReactPropTypeLocationNames = __webpack_require__(124); + var ReactUpdates = __webpack_require__(117); + + var assign = __webpack_require__(66); + var instantiateReactComponent = __webpack_require__(125); + var invariant = __webpack_require__(79); + var keyMirror = __webpack_require__(118); + var keyOf = __webpack_require__(126); + var monitorCodeUse = __webpack_require__(120); + var mapObject = __webpack_require__(127); + var shouldUpdateReactComponent = __webpack_require__(128); + var warning = __webpack_require__(78); + + var MIXINS_KEY = keyOf({mixins: null}); + + /** + * Policies that describe methods in `ReactCompositeComponentInterface`. + */ + var SpecPolicy = keyMirror({ + /** + * These methods may be defined only once by the class specification or mixin. + */ + DEFINE_ONCE: null, + /** + * These methods may be defined by both the class specification and mixins. + * Subsequent definitions will be chained. These methods must return void. + */ + DEFINE_MANY: null, + /** + * These methods are overriding the base ReactCompositeComponent class. + */ + OVERRIDE_BASE: null, + /** + * These methods are similar to DEFINE_MANY, except we assume they return + * objects. We try to merge the keys of the return values of all the mixed in + * functions. If there is a key conflict we throw. + */ + DEFINE_MANY_MERGED: null + }); + + + var injectedMixins = []; + + /** + * Composite components are higher-level components that compose other composite + * or native components. + * + * To create a new type of `ReactCompositeComponent`, pass a specification of + * your new class to `React.createClass`. The only requirement of your class + * specification is that you implement a `render` method. + * + * var MyComponent = React.createClass({ + * render: function() { + * return
    Hello World
    ; + * } + * }); + * + * The class specification supports a specific protocol of methods that have + * special meaning (e.g. `render`). See `ReactCompositeComponentInterface` for + * more the comprehensive protocol. Any other properties and methods in the + * class specification will available on the prototype. + * + * @interface ReactCompositeComponentInterface + * @internal + */ + var ReactCompositeComponentInterface = { + + /** + * An array of Mixin objects to include when defining your component. + * + * @type {array} + * @optional + */ + mixins: SpecPolicy.DEFINE_MANY, + + /** + * An object containing properties and methods that should be defined on + * the component's constructor instead of its prototype (static methods). + * + * @type {object} + * @optional + */ + statics: SpecPolicy.DEFINE_MANY, + + /** + * Definition of prop types for this component. + * + * @type {object} + * @optional + */ + propTypes: SpecPolicy.DEFINE_MANY, + + /** + * Definition of context types for this component. + * + * @type {object} + * @optional + */ + contextTypes: SpecPolicy.DEFINE_MANY, + + /** + * Definition of context types this component sets for its children. + * + * @type {object} + * @optional + */ + childContextTypes: SpecPolicy.DEFINE_MANY, + + // ==== Definition methods ==== + + /** + * Invoked when the component is mounted. Values in the mapping will be set on + * `this.props` if that prop is not specified (i.e. using an `in` check). + * + * This method is invoked before `getInitialState` and therefore cannot rely + * on `this.state` or use `this.setState`. + * + * @return {object} + * @optional + */ + getDefaultProps: SpecPolicy.DEFINE_MANY_MERGED, + + /** + * Invoked once before the component is mounted. The return value will be used + * as the initial value of `this.state`. + * + * getInitialState: function() { + * return { + * isOn: false, + * fooBaz: new BazFoo() + * } + * } + * + * @return {object} + * @optional + */ + getInitialState: SpecPolicy.DEFINE_MANY_MERGED, + + /** + * @return {object} + * @optional + */ + getChildContext: SpecPolicy.DEFINE_MANY_MERGED, + + /** + * Uses props from `this.props` and state from `this.state` to render the + * structure of the component. + * + * No guarantees are made about when or how often this method is invoked, so + * it must not have side effects. + * + * render: function() { + * var name = this.props.name; + * return
    Hello, {name}!
    ; + * } + * + * @return {ReactComponent} + * @nosideeffects + * @required + */ + render: SpecPolicy.DEFINE_ONCE, + + + + // ==== Delegate methods ==== + + /** + * Invoked when the component is initially created and about to be mounted. + * This may have side effects, but any external subscriptions or data created + * by this method must be cleaned up in `componentWillUnmount`. + * + * @optional + */ + componentWillMount: SpecPolicy.DEFINE_MANY, + + /** + * Invoked when the component has been mounted and has a DOM representation. + * However, there is no guarantee that the DOM node is in the document. + * + * Use this as an opportunity to operate on the DOM when the component has + * been mounted (initialized and rendered) for the first time. + * + * @param {DOMElement} rootNode DOM element representing the component. + * @optional + */ + componentDidMount: SpecPolicy.DEFINE_MANY, + + /** + * Invoked before the component receives new props. + * + * Use this as an opportunity to react to a prop transition by updating the + * state using `this.setState`. Current props are accessed via `this.props`. + * + * componentWillReceiveProps: function(nextProps, nextContext) { + * this.setState({ + * likesIncreasing: nextProps.likeCount > this.props.likeCount + * }); + * } + * + * NOTE: There is no equivalent `componentWillReceiveState`. An incoming prop + * transition may cause a state change, but the opposite is not true. If you + * need it, you are probably looking for `componentWillUpdate`. + * + * @param {object} nextProps + * @optional + */ + componentWillReceiveProps: SpecPolicy.DEFINE_MANY, + + /** + * Invoked while deciding if the component should be updated as a result of + * receiving new props, state and/or context. + * + * Use this as an opportunity to `return false` when you're certain that the + * transition to the new props/state/context will not require a component + * update. + * + * shouldComponentUpdate: function(nextProps, nextState, nextContext) { + * return !equal(nextProps, this.props) || + * !equal(nextState, this.state) || + * !equal(nextContext, this.context); + * } + * + * @param {object} nextProps + * @param {?object} nextState + * @param {?object} nextContext + * @return {boolean} True if the component should update. + * @optional + */ + shouldComponentUpdate: SpecPolicy.DEFINE_ONCE, + + /** + * Invoked when the component is about to update due to a transition from + * `this.props`, `this.state` and `this.context` to `nextProps`, `nextState` + * and `nextContext`. + * + * Use this as an opportunity to perform preparation before an update occurs. + * + * NOTE: You **cannot** use `this.setState()` in this method. + * + * @param {object} nextProps + * @param {?object} nextState + * @param {?object} nextContext + * @param {ReactReconcileTransaction} transaction + * @optional + */ + componentWillUpdate: SpecPolicy.DEFINE_MANY, + + /** + * Invoked when the component's DOM representation has been updated. + * + * Use this as an opportunity to operate on the DOM when the component has + * been updated. + * + * @param {object} prevProps + * @param {?object} prevState + * @param {?object} prevContext + * @param {DOMElement} rootNode DOM element representing the component. + * @optional + */ + componentDidUpdate: SpecPolicy.DEFINE_MANY, + + /** + * Invoked when the component is about to be removed from its parent and have + * its DOM representation destroyed. + * + * Use this as an opportunity to deallocate any external resources. + * + * NOTE: There is no `componentDidUnmount` since your component will have been + * destroyed by that point. + * + * @optional + */ + componentWillUnmount: SpecPolicy.DEFINE_MANY, + + + + // ==== Advanced methods ==== + + /** + * Updates the component's currently mounted DOM representation. + * + * By default, this implements React's rendering and reconciliation algorithm. + * Sophisticated clients may wish to override this. + * + * @param {ReactReconcileTransaction} transaction + * @internal + * @overridable + */ + updateComponent: SpecPolicy.OVERRIDE_BASE + + }; + + /** + * Mapping from class specification keys to special processing functions. + * + * Although these are declared like instance properties in the specification + * when defining classes using `React.createClass`, they are actually static + * and are accessible on the constructor instead of the prototype. Despite + * being static, they must be defined outside of the "statics" key under + * which all other static methods are defined. + */ + var RESERVED_SPEC_KEYS = { + displayName: function(Constructor, displayName) { + Constructor.displayName = displayName; + }, + mixins: function(Constructor, mixins) { + if (mixins) { + for (var i = 0; i < mixins.length; i++) { + mixSpecIntoComponent(Constructor, mixins[i]); + } + } + }, + childContextTypes: function(Constructor, childContextTypes) { + validateTypeDef( + Constructor, + childContextTypes, + ReactPropTypeLocations.childContext + ); + Constructor.childContextTypes = assign( + {}, + Constructor.childContextTypes, + childContextTypes + ); + }, + contextTypes: function(Constructor, contextTypes) { + validateTypeDef( + Constructor, + contextTypes, + ReactPropTypeLocations.context + ); + Constructor.contextTypes = assign( + {}, + Constructor.contextTypes, + contextTypes + ); + }, + /** + * Special case getDefaultProps which should move into statics but requires + * automatic merging. + */ + getDefaultProps: function(Constructor, getDefaultProps) { + if (Constructor.getDefaultProps) { + Constructor.getDefaultProps = createMergedResultFunction( + Constructor.getDefaultProps, + getDefaultProps + ); + } else { + Constructor.getDefaultProps = getDefaultProps; + } + }, + propTypes: function(Constructor, propTypes) { + validateTypeDef( + Constructor, + propTypes, + ReactPropTypeLocations.prop + ); + Constructor.propTypes = assign( + {}, + Constructor.propTypes, + propTypes + ); + }, + statics: function(Constructor, statics) { + mixStaticSpecIntoComponent(Constructor, statics); + } + }; + + function getDeclarationErrorAddendum(component) { + var owner = component._owner || null; + if (owner && owner.constructor && owner.constructor.displayName) { + return ' Check the render method of `' + owner.constructor.displayName + + '`.'; + } + return ''; + } + + function validateTypeDef(Constructor, typeDef, location) { + for (var propName in typeDef) { + if (typeDef.hasOwnProperty(propName)) { + ("production" !== process.env.NODE_ENV ? invariant( + typeof typeDef[propName] == 'function', + '%s: %s type `%s` is invalid; it must be a function, usually from ' + + 'React.PropTypes.', + Constructor.displayName || 'ReactCompositeComponent', + ReactPropTypeLocationNames[location], + propName + ) : invariant(typeof typeDef[propName] == 'function')); + } + } + } + + function validateMethodOverride(proto, name) { + var specPolicy = ReactCompositeComponentInterface.hasOwnProperty(name) ? + ReactCompositeComponentInterface[name] : + null; + + // Disallow overriding of base class methods unless explicitly allowed. + if (ReactCompositeComponentMixin.hasOwnProperty(name)) { + ("production" !== process.env.NODE_ENV ? invariant( + specPolicy === SpecPolicy.OVERRIDE_BASE, + 'ReactCompositeComponentInterface: You are attempting to override ' + + '`%s` from your class specification. Ensure that your method names ' + + 'do not overlap with React methods.', + name + ) : invariant(specPolicy === SpecPolicy.OVERRIDE_BASE)); + } + + // Disallow defining methods more than once unless explicitly allowed. + if (proto.hasOwnProperty(name)) { + ("production" !== process.env.NODE_ENV ? invariant( + specPolicy === SpecPolicy.DEFINE_MANY || + specPolicy === SpecPolicy.DEFINE_MANY_MERGED, + 'ReactCompositeComponentInterface: You are attempting to define ' + + '`%s` on your component more than once. This conflict may be due ' + + 'to a mixin.', + name + ) : invariant(specPolicy === SpecPolicy.DEFINE_MANY || + specPolicy === SpecPolicy.DEFINE_MANY_MERGED)); + } + } + + function validateLifeCycleOnReplaceState(instance) { + var compositeLifeCycleState = instance._compositeLifeCycleState; + ("production" !== process.env.NODE_ENV ? invariant( + instance.isMounted() || + compositeLifeCycleState === CompositeLifeCycle.MOUNTING, + 'replaceState(...): Can only update a mounted or mounting component.' + ) : invariant(instance.isMounted() || + compositeLifeCycleState === CompositeLifeCycle.MOUNTING)); + ("production" !== process.env.NODE_ENV ? invariant( + ReactCurrentOwner.current == null, + 'replaceState(...): Cannot update during an existing state transition ' + + '(such as within `render`). Render methods should be a pure function ' + + 'of props and state.' + ) : invariant(ReactCurrentOwner.current == null)); + ("production" !== process.env.NODE_ENV ? invariant(compositeLifeCycleState !== CompositeLifeCycle.UNMOUNTING, + 'replaceState(...): Cannot update while unmounting component. This ' + + 'usually means you called setState() on an unmounted component.' + ) : invariant(compositeLifeCycleState !== CompositeLifeCycle.UNMOUNTING)); + } + + /** + * Mixin helper which handles policy validation and reserved + * specification keys when building `ReactCompositeComponent` classses. + */ + function mixSpecIntoComponent(Constructor, spec) { + if (!spec) { + return; + } + + ("production" !== process.env.NODE_ENV ? invariant( + !ReactLegacyElement.isValidFactory(spec), + 'ReactCompositeComponent: You\'re attempting to ' + + 'use a component class as a mixin. Instead, just use a regular object.' + ) : invariant(!ReactLegacyElement.isValidFactory(spec))); + ("production" !== process.env.NODE_ENV ? invariant( + !ReactElement.isValidElement(spec), + 'ReactCompositeComponent: You\'re attempting to ' + + 'use a component as a mixin. Instead, just use a regular object.' + ) : invariant(!ReactElement.isValidElement(spec))); + + var proto = Constructor.prototype; + + // By handling mixins before any other properties, we ensure the same + // chaining order is applied to methods with DEFINE_MANY policy, whether + // mixins are listed before or after these methods in the spec. + if (spec.hasOwnProperty(MIXINS_KEY)) { + RESERVED_SPEC_KEYS.mixins(Constructor, spec.mixins); + } + + for (var name in spec) { + if (!spec.hasOwnProperty(name)) { + continue; + } + + if (name === MIXINS_KEY) { + // We have already handled mixins in a special case above + continue; + } + + var property = spec[name]; + validateMethodOverride(proto, name); + + if (RESERVED_SPEC_KEYS.hasOwnProperty(name)) { + RESERVED_SPEC_KEYS[name](Constructor, property); + } else { + // Setup methods on prototype: + // The following member methods should not be automatically bound: + // 1. Expected ReactCompositeComponent methods (in the "interface"). + // 2. Overridden methods (that were mixed in). + var isCompositeComponentMethod = + ReactCompositeComponentInterface.hasOwnProperty(name); + var isAlreadyDefined = proto.hasOwnProperty(name); + var markedDontBind = property && property.__reactDontBind; + var isFunction = typeof property === 'function'; + var shouldAutoBind = + isFunction && + !isCompositeComponentMethod && + !isAlreadyDefined && + !markedDontBind; + + if (shouldAutoBind) { + if (!proto.__reactAutoBindMap) { + proto.__reactAutoBindMap = {}; + } + proto.__reactAutoBindMap[name] = property; + proto[name] = property; + } else { + if (isAlreadyDefined) { + var specPolicy = ReactCompositeComponentInterface[name]; + + // These cases should already be caught by validateMethodOverride + ("production" !== process.env.NODE_ENV ? invariant( + isCompositeComponentMethod && ( + specPolicy === SpecPolicy.DEFINE_MANY_MERGED || + specPolicy === SpecPolicy.DEFINE_MANY + ), + 'ReactCompositeComponent: Unexpected spec policy %s for key %s ' + + 'when mixing in component specs.', + specPolicy, + name + ) : invariant(isCompositeComponentMethod && ( + specPolicy === SpecPolicy.DEFINE_MANY_MERGED || + specPolicy === SpecPolicy.DEFINE_MANY + ))); + + // For methods which are defined more than once, call the existing + // methods before calling the new property, merging if appropriate. + if (specPolicy === SpecPolicy.DEFINE_MANY_MERGED) { + proto[name] = createMergedResultFunction(proto[name], property); + } else if (specPolicy === SpecPolicy.DEFINE_MANY) { + proto[name] = createChainedFunction(proto[name], property); + } + } else { + proto[name] = property; + if ("production" !== process.env.NODE_ENV) { + // Add verbose displayName to the function, which helps when looking + // at profiling tools. + if (typeof property === 'function' && spec.displayName) { + proto[name].displayName = spec.displayName + '_' + name; + } + } + } + } + } + } + } + + function mixStaticSpecIntoComponent(Constructor, statics) { + if (!statics) { + return; + } + for (var name in statics) { + var property = statics[name]; + if (!statics.hasOwnProperty(name)) { + continue; + } + + var isReserved = name in RESERVED_SPEC_KEYS; + ("production" !== process.env.NODE_ENV ? invariant( + !isReserved, + 'ReactCompositeComponent: You are attempting to define a reserved ' + + 'property, `%s`, that shouldn\'t be on the "statics" key. Define it ' + + 'as an instance property instead; it will still be accessible on the ' + + 'constructor.', + name + ) : invariant(!isReserved)); + + var isInherited = name in Constructor; + ("production" !== process.env.NODE_ENV ? invariant( + !isInherited, + 'ReactCompositeComponent: You are attempting to define ' + + '`%s` on your component more than once. This conflict may be ' + + 'due to a mixin.', + name + ) : invariant(!isInherited)); + Constructor[name] = property; + } + } + + /** + * Merge two objects, but throw if both contain the same key. + * + * @param {object} one The first object, which is mutated. + * @param {object} two The second object + * @return {object} one after it has been mutated to contain everything in two. + */ + function mergeObjectsWithNoDuplicateKeys(one, two) { + ("production" !== process.env.NODE_ENV ? invariant( + one && two && typeof one === 'object' && typeof two === 'object', + 'mergeObjectsWithNoDuplicateKeys(): Cannot merge non-objects' + ) : invariant(one && two && typeof one === 'object' && typeof two === 'object')); + + mapObject(two, function(value, key) { + ("production" !== process.env.NODE_ENV ? invariant( + one[key] === undefined, + 'mergeObjectsWithNoDuplicateKeys(): ' + + 'Tried to merge two objects with the same key: `%s`. This conflict ' + + 'may be due to a mixin; in particular, this may be caused by two ' + + 'getInitialState() or getDefaultProps() methods returning objects ' + + 'with clashing keys.', + key + ) : invariant(one[key] === undefined)); + one[key] = value; + }); + return one; + } + + /** + * Creates a function that invokes two functions and merges their return values. + * + * @param {function} one Function to invoke first. + * @param {function} two Function to invoke second. + * @return {function} Function that invokes the two argument functions. + * @private + */ + function createMergedResultFunction(one, two) { + return function mergedResult() { + var a = one.apply(this, arguments); + var b = two.apply(this, arguments); + if (a == null) { + return b; + } else if (b == null) { + return a; + } + return mergeObjectsWithNoDuplicateKeys(a, b); + }; + } + + /** + * Creates a function that invokes two functions and ignores their return vales. + * + * @param {function} one Function to invoke first. + * @param {function} two Function to invoke second. + * @return {function} Function that invokes the two argument functions. + * @private + */ + function createChainedFunction(one, two) { + return function chainedFunction() { + one.apply(this, arguments); + two.apply(this, arguments); + }; + } + + /** + * `ReactCompositeComponent` maintains an auxiliary life cycle state in + * `this._compositeLifeCycleState` (which can be null). + * + * This is different from the life cycle state maintained by `ReactComponent` in + * `this._lifeCycleState`. The following diagram shows how the states overlap in + * time. There are times when the CompositeLifeCycle is null - at those times it + * is only meaningful to look at ComponentLifeCycle alone. + * + * Top Row: ReactComponent.ComponentLifeCycle + * Low Row: ReactComponent.CompositeLifeCycle + * + * +-------+---------------------------------+--------+ + * | UN | MOUNTED | UN | + * |MOUNTED| | MOUNTED| + * +-------+---------------------------------+--------+ + * | ^--------+ +-------+ +--------^ | + * | | | | | | | | + * | 0--|MOUNTING|-0-|RECEIVE|-0-| UN |--->0 | + * | | | |PROPS | |MOUNTING| | + * | | | | | | | | + * | | | | | | | | + * | +--------+ +-------+ +--------+ | + * | | | | + * +-------+---------------------------------+--------+ + */ + var CompositeLifeCycle = keyMirror({ + /** + * Components in the process of being mounted respond to state changes + * differently. + */ + MOUNTING: null, + /** + * Components in the process of being unmounted are guarded against state + * changes. + */ + UNMOUNTING: null, + /** + * Components that are mounted and receiving new props respond to state + * changes differently. + */ + RECEIVING_PROPS: null + }); + + /** + * @lends {ReactCompositeComponent.prototype} + */ + var ReactCompositeComponentMixin = { + + /** + * Base constructor for all composite component. + * + * @param {ReactElement} element + * @final + * @internal + */ + construct: function(element) { + // Children can be either an array or more than one argument + ReactComponent.Mixin.construct.apply(this, arguments); + ReactOwner.Mixin.construct.apply(this, arguments); + + this.state = null; + this._pendingState = null; + + // This is the public post-processed context. The real context and pending + // context lives on the element. + this.context = null; + + this._compositeLifeCycleState = null; + }, + + /** + * Checks whether or not this composite component is mounted. + * @return {boolean} True if mounted, false otherwise. + * @protected + * @final + */ + isMounted: function() { + return ReactComponent.Mixin.isMounted.call(this) && + this._compositeLifeCycleState !== CompositeLifeCycle.MOUNTING; + }, + + /** + * Initializes the component, renders markup, and registers event listeners. + * + * @param {string} rootID DOM ID of the root node. + * @param {ReactReconcileTransaction|ReactServerRenderingTransaction} transaction + * @param {number} mountDepth number of components in the owner hierarchy + * @return {?string} Rendered markup to be inserted into the DOM. + * @final + * @internal + */ + mountComponent: ReactPerf.measure( + 'ReactCompositeComponent', + 'mountComponent', + function(rootID, transaction, mountDepth) { + ReactComponent.Mixin.mountComponent.call( + this, + rootID, + transaction, + mountDepth + ); + this._compositeLifeCycleState = CompositeLifeCycle.MOUNTING; + + if (this.__reactAutoBindMap) { + this._bindAutoBindMethods(); + } + + this.context = this._processContext(this._currentElement._context); + this.props = this._processProps(this.props); + + this.state = this.getInitialState ? this.getInitialState() : null; + ("production" !== process.env.NODE_ENV ? invariant( + typeof this.state === 'object' && !Array.isArray(this.state), + '%s.getInitialState(): must return an object or null', + this.constructor.displayName || 'ReactCompositeComponent' + ) : invariant(typeof this.state === 'object' && !Array.isArray(this.state))); + + this._pendingState = null; + this._pendingForceUpdate = false; + + if (this.componentWillMount) { + this.componentWillMount(); + // When mounting, calls to `setState` by `componentWillMount` will set + // `this._pendingState` without triggering a re-render. + if (this._pendingState) { + this.state = this._pendingState; + this._pendingState = null; + } + } + + this._renderedComponent = instantiateReactComponent( + this._renderValidatedComponent(), + this._currentElement.type // The wrapping type + ); + + // Done with mounting, `setState` will now trigger UI changes. + this._compositeLifeCycleState = null; + var markup = this._renderedComponent.mountComponent( + rootID, + transaction, + mountDepth + 1 + ); + if (this.componentDidMount) { + transaction.getReactMountReady().enqueue(this.componentDidMount, this); + } + return markup; + } + ), + + /** + * Releases any resources allocated by `mountComponent`. + * + * @final + * @internal + */ + unmountComponent: function() { + this._compositeLifeCycleState = CompositeLifeCycle.UNMOUNTING; + if (this.componentWillUnmount) { + this.componentWillUnmount(); + } + this._compositeLifeCycleState = null; + + this._renderedComponent.unmountComponent(); + this._renderedComponent = null; + + ReactComponent.Mixin.unmountComponent.call(this); + + // Some existing components rely on this.props even after they've been + // destroyed (in event handlers). + // TODO: this.props = null; + // TODO: this.state = null; + }, + + /** + * Sets a subset of the state. Always use this or `replaceState` to mutate + * state. You should treat `this.state` as immutable. + * + * There is no guarantee that `this.state` will be immediately updated, so + * accessing `this.state` after calling this method may return the old value. + * + * There is no guarantee that calls to `setState` will run synchronously, + * as they may eventually be batched together. You can provide an optional + * callback that will be executed when the call to setState is actually + * completed. + * + * @param {object} partialState Next partial state to be merged with state. + * @param {?function} callback Called after state is updated. + * @final + * @protected + */ + setState: function(partialState, callback) { + ("production" !== process.env.NODE_ENV ? invariant( + typeof partialState === 'object' || partialState == null, + 'setState(...): takes an object of state variables to update.' + ) : invariant(typeof partialState === 'object' || partialState == null)); + if ("production" !== process.env.NODE_ENV){ + ("production" !== process.env.NODE_ENV ? warning( + partialState != null, + 'setState(...): You passed an undefined or null state object; ' + + 'instead, use forceUpdate().' + ) : null); + } + // Merge with `_pendingState` if it exists, otherwise with existing state. + this.replaceState( + assign({}, this._pendingState || this.state, partialState), + callback + ); + }, + + /** + * Replaces all of the state. Always use this or `setState` to mutate state. + * You should treat `this.state` as immutable. + * + * There is no guarantee that `this.state` will be immediately updated, so + * accessing `this.state` after calling this method may return the old value. + * + * @param {object} completeState Next state. + * @param {?function} callback Called after state is updated. + * @final + * @protected + */ + replaceState: function(completeState, callback) { + validateLifeCycleOnReplaceState(this); + this._pendingState = completeState; + if (this._compositeLifeCycleState !== CompositeLifeCycle.MOUNTING) { + // If we're in a componentWillMount handler, don't enqueue a rerender + // because ReactUpdates assumes we're in a browser context (which is wrong + // for server rendering) and we're about to do a render anyway. + // TODO: The callback here is ignored when setState is called from + // componentWillMount. Either fix it or disallow doing so completely in + // favor of getInitialState. + ReactUpdates.enqueueUpdate(this, callback); + } + }, + + /** + * Filters the context object to only contain keys specified in + * `contextTypes`, and asserts that they are valid. + * + * @param {object} context + * @return {?object} + * @private + */ + _processContext: function(context) { + var maskedContext = null; + var contextTypes = this.constructor.contextTypes; + if (contextTypes) { + maskedContext = {}; + for (var contextName in contextTypes) { + maskedContext[contextName] = context[contextName]; + } + if ("production" !== process.env.NODE_ENV) { + this._checkPropTypes( + contextTypes, + maskedContext, + ReactPropTypeLocations.context + ); + } + } + return maskedContext; + }, + + /** + * @param {object} currentContext + * @return {object} + * @private + */ + _processChildContext: function(currentContext) { + var childContext = this.getChildContext && this.getChildContext(); + var displayName = this.constructor.displayName || 'ReactCompositeComponent'; + if (childContext) { + ("production" !== process.env.NODE_ENV ? invariant( + typeof this.constructor.childContextTypes === 'object', + '%s.getChildContext(): childContextTypes must be defined in order to ' + + 'use getChildContext().', + displayName + ) : invariant(typeof this.constructor.childContextTypes === 'object')); + if ("production" !== process.env.NODE_ENV) { + this._checkPropTypes( + this.constructor.childContextTypes, + childContext, + ReactPropTypeLocations.childContext + ); + } + for (var name in childContext) { + ("production" !== process.env.NODE_ENV ? invariant( + name in this.constructor.childContextTypes, + '%s.getChildContext(): key "%s" is not defined in childContextTypes.', + displayName, + name + ) : invariant(name in this.constructor.childContextTypes)); + } + return assign({}, currentContext, childContext); + } + return currentContext; + }, + + /** + * Processes props by setting default values for unspecified props and + * asserting that the props are valid. Does not mutate its argument; returns + * a new props object with defaults merged in. + * + * @param {object} newProps + * @return {object} + * @private + */ + _processProps: function(newProps) { + if ("production" !== process.env.NODE_ENV) { + var propTypes = this.constructor.propTypes; + if (propTypes) { + this._checkPropTypes(propTypes, newProps, ReactPropTypeLocations.prop); + } + } + return newProps; + }, + + /** + * Assert that the props are valid + * + * @param {object} propTypes Map of prop name to a ReactPropType + * @param {object} props + * @param {string} location e.g. "prop", "context", "child context" + * @private + */ + _checkPropTypes: function(propTypes, props, location) { + // TODO: Stop validating prop types here and only use the element + // validation. + var componentName = this.constructor.displayName; + for (var propName in propTypes) { + if (propTypes.hasOwnProperty(propName)) { + var error = + propTypes[propName](props, propName, componentName, location); + if (error instanceof Error) { + // We may want to extend this logic for similar errors in + // renderComponent calls, so I'm abstracting it away into + // a function to minimize refactoring in the future + var addendum = getDeclarationErrorAddendum(this); + ("production" !== process.env.NODE_ENV ? warning(false, error.message + addendum) : null); + } + } + } + }, + + /** + * If any of `_pendingElement`, `_pendingState`, or `_pendingForceUpdate` + * is set, update the component. + * + * @param {ReactReconcileTransaction} transaction + * @internal + */ + performUpdateIfNecessary: function(transaction) { + var compositeLifeCycleState = this._compositeLifeCycleState; + // Do not trigger a state transition if we are in the middle of mounting or + // receiving props because both of those will already be doing this. + if (compositeLifeCycleState === CompositeLifeCycle.MOUNTING || + compositeLifeCycleState === CompositeLifeCycle.RECEIVING_PROPS) { + return; + } + + if (this._pendingElement == null && + this._pendingState == null && + !this._pendingForceUpdate) { + return; + } + + var nextContext = this.context; + var nextProps = this.props; + var nextElement = this._currentElement; + if (this._pendingElement != null) { + nextElement = this._pendingElement; + nextContext = this._processContext(nextElement._context); + nextProps = this._processProps(nextElement.props); + this._pendingElement = null; + + this._compositeLifeCycleState = CompositeLifeCycle.RECEIVING_PROPS; + if (this.componentWillReceiveProps) { + this.componentWillReceiveProps(nextProps, nextContext); + } + } + + this._compositeLifeCycleState = null; + + var nextState = this._pendingState || this.state; + this._pendingState = null; + + var shouldUpdate = + this._pendingForceUpdate || + !this.shouldComponentUpdate || + this.shouldComponentUpdate(nextProps, nextState, nextContext); + + if ("production" !== process.env.NODE_ENV) { + if (typeof shouldUpdate === "undefined") { + console.warn( + (this.constructor.displayName || 'ReactCompositeComponent') + + '.shouldComponentUpdate(): Returned undefined instead of a ' + + 'boolean value. Make sure to return true or false.' + ); + } + } + + if (shouldUpdate) { + this._pendingForceUpdate = false; + // Will set `this.props`, `this.state` and `this.context`. + this._performComponentUpdate( + nextElement, + nextProps, + nextState, + nextContext, + transaction + ); + } else { + // If it's determined that a component should not update, we still want + // to set props and state. + this._currentElement = nextElement; + this.props = nextProps; + this.state = nextState; + this.context = nextContext; + + // Owner cannot change because shouldUpdateReactComponent doesn't allow + // it. TODO: Remove this._owner completely. + this._owner = nextElement._owner; + } + }, + + /** + * Merges new props and state, notifies delegate methods of update and + * performs update. + * + * @param {ReactElement} nextElement Next element + * @param {object} nextProps Next public object to set as properties. + * @param {?object} nextState Next object to set as state. + * @param {?object} nextContext Next public object to set as context. + * @param {ReactReconcileTransaction} transaction + * @private + */ + _performComponentUpdate: function( + nextElement, + nextProps, + nextState, + nextContext, + transaction + ) { + var prevElement = this._currentElement; + var prevProps = this.props; + var prevState = this.state; + var prevContext = this.context; + + if (this.componentWillUpdate) { + this.componentWillUpdate(nextProps, nextState, nextContext); + } + + this._currentElement = nextElement; + this.props = nextProps; + this.state = nextState; + this.context = nextContext; + + // Owner cannot change because shouldUpdateReactComponent doesn't allow + // it. TODO: Remove this._owner completely. + this._owner = nextElement._owner; + + this.updateComponent( + transaction, + prevElement + ); + + if (this.componentDidUpdate) { + transaction.getReactMountReady().enqueue( + this.componentDidUpdate.bind(this, prevProps, prevState, prevContext), + this + ); + } + }, + + receiveComponent: function(nextElement, transaction) { + if (nextElement === this._currentElement && + nextElement._owner != null) { + // Since elements are immutable after the owner is rendered, + // we can do a cheap identity compare here to determine if this is a + // superfluous reconcile. It's possible for state to be mutable but such + // change should trigger an update of the owner which would recreate + // the element. We explicitly check for the existence of an owner since + // it's possible for a element created outside a composite to be + // deeply mutated and reused. + return; + } + + ReactComponent.Mixin.receiveComponent.call( + this, + nextElement, + transaction + ); + }, + + /** + * Updates the component's currently mounted DOM representation. + * + * By default, this implements React's rendering and reconciliation algorithm. + * Sophisticated clients may wish to override this. + * + * @param {ReactReconcileTransaction} transaction + * @param {ReactElement} prevElement + * @internal + * @overridable + */ + updateComponent: ReactPerf.measure( + 'ReactCompositeComponent', + 'updateComponent', + function(transaction, prevParentElement) { + ReactComponent.Mixin.updateComponent.call( + this, + transaction, + prevParentElement + ); + + var prevComponentInstance = this._renderedComponent; + var prevElement = prevComponentInstance._currentElement; + var nextElement = this._renderValidatedComponent(); + if (shouldUpdateReactComponent(prevElement, nextElement)) { + prevComponentInstance.receiveComponent(nextElement, transaction); + } else { + // These two IDs are actually the same! But nothing should rely on that. + var thisID = this._rootNodeID; + var prevComponentID = prevComponentInstance._rootNodeID; + prevComponentInstance.unmountComponent(); + this._renderedComponent = instantiateReactComponent( + nextElement, + this._currentElement.type + ); + var nextMarkup = this._renderedComponent.mountComponent( + thisID, + transaction, + this._mountDepth + 1 + ); + ReactComponent.BackendIDOperations.dangerouslyReplaceNodeWithMarkupByID( + prevComponentID, + nextMarkup + ); + } + } + ), + + /** + * Forces an update. This should only be invoked when it is known with + * certainty that we are **not** in a DOM transaction. + * + * You may want to call this when you know that some deeper aspect of the + * component's state has changed but `setState` was not called. + * + * This will not invoke `shouldUpdateComponent`, but it will invoke + * `componentWillUpdate` and `componentDidUpdate`. + * + * @param {?function} callback Called after update is complete. + * @final + * @protected + */ + forceUpdate: function(callback) { + var compositeLifeCycleState = this._compositeLifeCycleState; + ("production" !== process.env.NODE_ENV ? invariant( + this.isMounted() || + compositeLifeCycleState === CompositeLifeCycle.MOUNTING, + 'forceUpdate(...): Can only force an update on mounted or mounting ' + + 'components.' + ) : invariant(this.isMounted() || + compositeLifeCycleState === CompositeLifeCycle.MOUNTING)); + ("production" !== process.env.NODE_ENV ? invariant( + compositeLifeCycleState !== CompositeLifeCycle.UNMOUNTING && + ReactCurrentOwner.current == null, + 'forceUpdate(...): Cannot force an update while unmounting component ' + + 'or within a `render` function.' + ) : invariant(compositeLifeCycleState !== CompositeLifeCycle.UNMOUNTING && + ReactCurrentOwner.current == null)); + this._pendingForceUpdate = true; + ReactUpdates.enqueueUpdate(this, callback); + }, + + /** + * @private + */ + _renderValidatedComponent: ReactPerf.measure( + 'ReactCompositeComponent', + '_renderValidatedComponent', + function() { + var renderedComponent; + var previousContext = ReactContext.current; + ReactContext.current = this._processChildContext( + this._currentElement._context + ); + ReactCurrentOwner.current = this; + try { + renderedComponent = this.render(); + if (renderedComponent === null || renderedComponent === false) { + renderedComponent = ReactEmptyComponent.getEmptyComponent(); + ReactEmptyComponent.registerNullComponentID(this._rootNodeID); + } else { + ReactEmptyComponent.deregisterNullComponentID(this._rootNodeID); + } + } finally { + ReactContext.current = previousContext; + ReactCurrentOwner.current = null; + } + ("production" !== process.env.NODE_ENV ? invariant( + ReactElement.isValidElement(renderedComponent), + '%s.render(): A valid ReactComponent must be returned. You may have ' + + 'returned undefined, an array or some other invalid object.', + this.constructor.displayName || 'ReactCompositeComponent' + ) : invariant(ReactElement.isValidElement(renderedComponent))); + return renderedComponent; + } + ), + + /** + * @private + */ + _bindAutoBindMethods: function() { + for (var autoBindKey in this.__reactAutoBindMap) { + if (!this.__reactAutoBindMap.hasOwnProperty(autoBindKey)) { + continue; + } + var method = this.__reactAutoBindMap[autoBindKey]; + this[autoBindKey] = this._bindAutoBindMethod(ReactErrorUtils.guard( + method, + this.constructor.displayName + '.' + autoBindKey + )); + } + }, + + /** + * Binds a method to the component. + * + * @param {function} method Method to be bound. + * @private + */ + _bindAutoBindMethod: function(method) { + var component = this; + var boundMethod = method.bind(component); + if ("production" !== process.env.NODE_ENV) { + boundMethod.__reactBoundContext = component; + boundMethod.__reactBoundMethod = method; + boundMethod.__reactBoundArguments = null; + var componentName = component.constructor.displayName; + var _bind = boundMethod.bind; + boundMethod.bind = function(newThis ) {for (var args=[],$__0=1,$__1=arguments.length;$__0<$__1;$__0++) args.push(arguments[$__0]); + // User is trying to bind() an autobound method; we effectively will + // ignore the value of "this" that the user is trying to use, so + // let's warn. + if (newThis !== component && newThis !== null) { + monitorCodeUse('react_bind_warning', { component: componentName }); + console.warn( + 'bind(): React component methods may only be bound to the ' + + 'component instance. See ' + componentName + ); + } else if (!args.length) { + monitorCodeUse('react_bind_warning', { component: componentName }); + console.warn( + 'bind(): You are binding a component method to the component. ' + + 'React does this for you automatically in a high-performance ' + + 'way, so you can safely remove this call. See ' + componentName + ); + return boundMethod; + } + var reboundMethod = _bind.apply(boundMethod, arguments); + reboundMethod.__reactBoundContext = component; + reboundMethod.__reactBoundMethod = method; + reboundMethod.__reactBoundArguments = args; + return reboundMethod; + }; + } + return boundMethod; + } + }; + + var ReactCompositeComponentBase = function() {}; + assign( + ReactCompositeComponentBase.prototype, + ReactComponent.Mixin, + ReactOwner.Mixin, + ReactPropTransferer.Mixin, + ReactCompositeComponentMixin + ); + + /** + * Module for creating composite components. + * + * @class ReactCompositeComponent + * @extends ReactComponent + * @extends ReactOwner + * @extends ReactPropTransferer + */ + var ReactCompositeComponent = { + + LifeCycle: CompositeLifeCycle, + + Base: ReactCompositeComponentBase, + + /** + * Creates a composite component class given a class specification. + * + * @param {object} spec Class specification (which must define `render`). + * @return {function} Component constructor function. + * @public + */ + createClass: function(spec) { + var Constructor = function(props) { + // This constructor is overridden by mocks. The argument is used + // by mocks to assert on what gets mounted. This will later be used + // by the stand-alone class implementation. + }; + Constructor.prototype = new ReactCompositeComponentBase(); + Constructor.prototype.constructor = Constructor; + + injectedMixins.forEach( + mixSpecIntoComponent.bind(null, Constructor) + ); + + mixSpecIntoComponent(Constructor, spec); + + // Initialize the defaultProps property after all mixins have been merged + if (Constructor.getDefaultProps) { + Constructor.defaultProps = Constructor.getDefaultProps(); + } + + ("production" !== process.env.NODE_ENV ? invariant( + Constructor.prototype.render, + 'createClass(...): Class specification must implement a `render` method.' + ) : invariant(Constructor.prototype.render)); + + if ("production" !== process.env.NODE_ENV) { + if (Constructor.prototype.componentShouldUpdate) { + monitorCodeUse( + 'react_component_should_update_warning', + { component: spec.displayName } + ); + console.warn( + (spec.displayName || 'A component') + ' has a method called ' + + 'componentShouldUpdate(). Did you mean shouldComponentUpdate()? ' + + 'The name is phrased as a question because the function is ' + + 'expected to return a value.' + ); + } + } + + // Reduce time spent doing lookups by setting these on the prototype. + for (var methodName in ReactCompositeComponentInterface) { + if (!Constructor.prototype[methodName]) { + Constructor.prototype[methodName] = null; + } + } + + if ("production" !== process.env.NODE_ENV) { + return ReactLegacyElement.wrapFactory( + ReactElementValidator.createFactory(Constructor) + ); + } + return ReactLegacyElement.wrapFactory( + ReactElement.createFactory(Constructor) + ); + }, + + injection: { + injectMixin: function(mixin) { + injectedMixins.push(mixin); + } + } + }; + + module.exports = ReactCompositeComponent; + + /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(89))) + +/***/ }, +/* 51 */ +/***/ function(module, exports, __webpack_require__) { + + /** + * Copyright 2013-2014, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule ReactContext + */ + + "use strict"; + + var assign = __webpack_require__(66); + + /** + * Keeps track of the current context. + * + * The context is automatically passed down the component ownership hierarchy + * and is accessible via `this.context` on ReactCompositeComponents. + */ + var ReactContext = { + + /** + * @internal + * @type {object} + */ + current: {}, + + /** + * Temporarily extends the current context while executing scopedCallback. + * + * A typical use case might look like + * + * render: function() { + * var children = ReactContext.withContext({foo: 'foo'}, () => ( + * + * )); + * return
    {children}
    ; + * } + * + * @param {object} newContext New context to merge into the existing context + * @param {function} scopedCallback Callback to run with the new context + * @return {ReactComponent|array} + */ + withContext: function(newContext, scopedCallback) { + var result; + var previousContext = ReactContext.current; + ReactContext.current = assign({}, previousContext, newContext); + try { + result = scopedCallback(); + } finally { + ReactContext.current = previousContext; + } + return result; + } + + }; + + module.exports = ReactContext; + + +/***/ }, +/* 52 */ +/***/ function(module, exports, __webpack_require__) { + + /** + * Copyright 2013-2014, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule ReactCurrentOwner + */ + + "use strict"; + + /** + * Keeps track of the current owner. + * + * The current owner is the component who should own any components that are + * currently being constructed. + * + * The depth indicate how many composite components are above this render level. + */ + var ReactCurrentOwner = { + + /** + * @internal + * @type {ReactComponent} + */ + current: null + + }; + + module.exports = ReactCurrentOwner; + + +/***/ }, +/* 53 */ +/***/ function(module, exports, __webpack_require__) { + + /* WEBPACK VAR INJECTION */(function(process) {/** + * Copyright 2014, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule ReactElement + */ + + "use strict"; + + var ReactContext = __webpack_require__(51); + var ReactCurrentOwner = __webpack_require__(52); + + var warning = __webpack_require__(78); + + var RESERVED_PROPS = { + key: true, + ref: true + }; + + /** + * Warn for mutations. + * + * @internal + * @param {object} object + * @param {string} key + */ + function defineWarningProperty(object, key) { + Object.defineProperty(object, key, { + + configurable: false, + enumerable: true, + + get: function() { + if (!this._store) { + return null; + } + return this._store[key]; + }, + + set: function(value) { + ("production" !== process.env.NODE_ENV ? warning( + false, + 'Don\'t set the ' + key + ' property of the component. ' + + 'Mutate the existing props object instead.' + ) : null); + this._store[key] = value; + } + + }); + } + + /** + * This is updated to true if the membrane is successfully created. + */ + var useMutationMembrane = false; + + /** + * Warn for mutations. + * + * @internal + * @param {object} element + */ + function defineMutationMembrane(prototype) { + try { + var pseudoFrozenProperties = { + props: true + }; + for (var key in pseudoFrozenProperties) { + defineWarningProperty(prototype, key); + } + useMutationMembrane = true; + } catch (x) { + // IE will fail on defineProperty + } + } + + /** + * Base constructor for all React elements. This is only used to make this + * work with a dynamic instanceof check. Nothing should live on this prototype. + * + * @param {*} type + * @param {string|object} ref + * @param {*} key + * @param {*} props + * @internal + */ + var ReactElement = function(type, key, ref, owner, context, props) { + // Built-in properties that belong on the element + this.type = type; + this.key = key; + this.ref = ref; + + // Record the component responsible for creating this element. + this._owner = owner; + + // TODO: Deprecate withContext, and then the context becomes accessible + // through the owner. + this._context = context; + + if ("production" !== process.env.NODE_ENV) { + // The validation flag and props are currently mutative. We put them on + // an external backing store so that we can freeze the whole object. + // This can be replaced with a WeakMap once they are implemented in + // commonly used development environments. + this._store = { validated: false, props: props }; + + // We're not allowed to set props directly on the object so we early + // return and rely on the prototype membrane to forward to the backing + // store. + if (useMutationMembrane) { + Object.freeze(this); + return; + } + } + + this.props = props; + }; + + // We intentionally don't expose the function on the constructor property. + // ReactElement should be indistinguishable from a plain object. + ReactElement.prototype = { + _isReactElement: true + }; + + if ("production" !== process.env.NODE_ENV) { + defineMutationMembrane(ReactElement.prototype); + } + + ReactElement.createElement = function(type, config, children) { + var propName; + + // Reserved names are extracted + var props = {}; + + var key = null; + var ref = null; + + if (config != null) { + ref = config.ref === undefined ? null : config.ref; + if ("production" !== process.env.NODE_ENV) { + ("production" !== process.env.NODE_ENV ? warning( + config.key !== null, + 'createElement(...): Encountered component with a `key` of null. In ' + + 'a future version, this will be treated as equivalent to the string ' + + '\'null\'; instead, provide an explicit key or use undefined.' + ) : null); + } + // TODO: Change this back to `config.key === undefined` + key = config.key == null ? null : '' + config.key; + // Remaining properties are added to a new props object + for (propName in config) { + if (config.hasOwnProperty(propName) && + !RESERVED_PROPS.hasOwnProperty(propName)) { + props[propName] = config[propName]; + } + } + } + + // Children can be more than one argument, and those are transferred onto + // the newly allocated props object. + var childrenLength = arguments.length - 2; + if (childrenLength === 1) { + props.children = children; + } else if (childrenLength > 1) { + var childArray = Array(childrenLength); + for (var i = 0; i < childrenLength; i++) { + childArray[i] = arguments[i + 2]; + } + props.children = childArray; + } + + // Resolve default props + if (type && type.defaultProps) { + var defaultProps = type.defaultProps; + for (propName in defaultProps) { + if (typeof props[propName] === 'undefined') { + props[propName] = defaultProps[propName]; + } + } + } + + return new ReactElement( + type, + key, + ref, + ReactCurrentOwner.current, + ReactContext.current, + props + ); + }; + + ReactElement.createFactory = function(type) { + var factory = ReactElement.createElement.bind(null, type); + // Expose the type on the factory and the prototype so that it can be + // easily accessed on elements. E.g. .type === Foo.type. + // This should not be named `constructor` since this may not be the function + // that created the element, and it may not even be a constructor. + factory.type = type; + return factory; + }; + + ReactElement.cloneAndReplaceProps = function(oldElement, newProps) { + var newElement = new ReactElement( + oldElement.type, + oldElement.key, + oldElement.ref, + oldElement._owner, + oldElement._context, + newProps + ); + + if ("production" !== process.env.NODE_ENV) { + // If the key on the original is valid, then the clone is valid + newElement._store.validated = oldElement._store.validated; + } + return newElement; + }; + + /** + * @param {?object} object + * @return {boolean} True if `object` is a valid component. + * @final + */ + ReactElement.isValidElement = function(object) { + // ReactTestUtils is often used outside of beforeEach where as React is + // within it. This leads to two different instances of React on the same + // page. To identify a element from a different React instance we use + // a flag instead of an instanceof check. + var isElement = !!(object && object._isReactElement); + // if (isElement && !(object instanceof ReactElement)) { + // This is an indicator that you're using multiple versions of React at the + // same time. This will screw with ownership and stuff. Fix it, please. + // TODO: We could possibly warn here. + // } + return isElement; + }; + + module.exports = ReactElement; + + /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(89))) + +/***/ }, +/* 54 */ +/***/ function(module, exports, __webpack_require__) { + + /* WEBPACK VAR INJECTION */(function(process) {/** + * Copyright 2014, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule ReactElementValidator + */ + + /** + * ReactElementValidator provides a wrapper around a element factory + * which validates the props passed to the element. This is intended to be + * used only in DEV and could be replaced by a static type checker for languages + * that support it. + */ + + "use strict"; + + var ReactElement = __webpack_require__(53); + var ReactPropTypeLocations = __webpack_require__(119); + var ReactCurrentOwner = __webpack_require__(52); + + var monitorCodeUse = __webpack_require__(120); + var warning = __webpack_require__(78); + + /** + * Warn if there's no key explicitly set on dynamic arrays of children or + * object keys are not valid. This allows us to keep track of children between + * updates. + */ + var ownerHasKeyUseWarning = { + 'react_key_warning': {}, + 'react_numeric_key_warning': {} + }; + var ownerHasMonitoredObjectMap = {}; + + var loggedTypeFailures = {}; + + var NUMERIC_PROPERTY_REGEX = /^\d+$/; + + /** + * Gets the current owner's displayName for use in warnings. + * + * @internal + * @return {?string} Display name or undefined + */ + function getCurrentOwnerDisplayName() { + var current = ReactCurrentOwner.current; + return current && current.constructor.displayName || undefined; + } + + /** + * Warn if the component doesn't have an explicit key assigned to it. + * This component is in an array. The array could grow and shrink or be + * reordered. All children that haven't already been validated are required to + * have a "key" property assigned to it. + * + * @internal + * @param {ReactComponent} component Component that requires a key. + * @param {*} parentType component's parent's type. + */ + function validateExplicitKey(component, parentType) { + if (component._store.validated || component.key != null) { + return; + } + component._store.validated = true; + + warnAndMonitorForKeyUse( + 'react_key_warning', + 'Each child in an array should have a unique "key" prop.', + component, + parentType + ); + } + + /** + * Warn if the key is being defined as an object property but has an incorrect + * value. + * + * @internal + * @param {string} name Property name of the key. + * @param {ReactComponent} component Component that requires a key. + * @param {*} parentType component's parent's type. + */ + function validatePropertyKey(name, component, parentType) { + if (!NUMERIC_PROPERTY_REGEX.test(name)) { + return; + } + warnAndMonitorForKeyUse( + 'react_numeric_key_warning', + 'Child objects should have non-numeric keys so ordering is preserved.', + component, + parentType + ); + } + + /** + * Shared warning and monitoring code for the key warnings. + * + * @internal + * @param {string} warningID The id used when logging. + * @param {string} message The base warning that gets output. + * @param {ReactComponent} component Component that requires a key. + * @param {*} parentType component's parent's type. + */ + function warnAndMonitorForKeyUse(warningID, message, component, parentType) { + var ownerName = getCurrentOwnerDisplayName(); + var parentName = parentType.displayName; + + var useName = ownerName || parentName; + var memoizer = ownerHasKeyUseWarning[warningID]; + if (memoizer.hasOwnProperty(useName)) { + return; + } + memoizer[useName] = true; + + message += ownerName ? + (" Check the render method of " + ownerName + ".") : + (" Check the renderComponent call using <" + parentName + ">."); + + // Usually the current owner is the offender, but if it accepts children as a + // property, it may be the creator of the child that's responsible for + // assigning it a key. + var childOwnerName = null; + if (component._owner && component._owner !== ReactCurrentOwner.current) { + // Name of the component that originally created this child. + childOwnerName = component._owner.constructor.displayName; + + message += (" It was passed a child from " + childOwnerName + "."); + } + + message += ' See http://fb.me/react-warning-keys for more information.'; + monitorCodeUse(warningID, { + component: useName, + componentOwner: childOwnerName + }); + console.warn(message); + } + + /** + * Log that we're using an object map. We're considering deprecating this + * feature and replace it with proper Map and ImmutableMap data structures. + * + * @internal + */ + function monitorUseOfObjectMap() { + var currentName = getCurrentOwnerDisplayName() || ''; + if (ownerHasMonitoredObjectMap.hasOwnProperty(currentName)) { + return; + } + ownerHasMonitoredObjectMap[currentName] = true; + monitorCodeUse('react_object_map_children'); + } + + /** + * Ensure that every component either is passed in a static location, in an + * array with an explicit keys property defined, or in an object literal + * with valid key property. + * + * @internal + * @param {*} component Statically passed child of any type. + * @param {*} parentType component's parent's type. + * @return {boolean} + */ + function validateChildKeys(component, parentType) { + if (Array.isArray(component)) { + for (var i = 0; i < component.length; i++) { + var child = component[i]; + if (ReactElement.isValidElement(child)) { + validateExplicitKey(child, parentType); + } + } + } else if (ReactElement.isValidElement(component)) { + // This component was passed in a valid location. + component._store.validated = true; + } else if (component && typeof component === 'object') { + monitorUseOfObjectMap(); + for (var name in component) { + validatePropertyKey(name, component[name], parentType); + } + } + } + + /** + * Assert that the props are valid + * + * @param {string} componentName Name of the component for error messages. + * @param {object} propTypes Map of prop name to a ReactPropType + * @param {object} props + * @param {string} location e.g. "prop", "context", "child context" + * @private + */ + function checkPropTypes(componentName, propTypes, props, location) { + for (var propName in propTypes) { + if (propTypes.hasOwnProperty(propName)) { + var error; + // Prop type validation may throw. In case they do, we don't want to + // fail the render phase where it didn't fail before. So we log it. + // After these have been cleaned up, we'll let them throw. + try { + error = propTypes[propName](props, propName, componentName, location); + } catch (ex) { + error = ex; + } + if (error instanceof Error && !(error.message in loggedTypeFailures)) { + // Only monitor this failure once because there tends to be a lot of the + // same error. + loggedTypeFailures[error.message] = true; + // This will soon use the warning module + monitorCodeUse( + 'react_failed_descriptor_type_check', + { message: error.message } + ); + } + } + } + } + + var ReactElementValidator = { + + createElement: function(type, props, children) { + // We warn in this case but don't throw. We expect the element creation to + // succeed and there will likely be errors in render. + ("production" !== process.env.NODE_ENV ? warning( + type != null, + 'React.createElement: type should not be null or undefined. It should ' + + 'be a string (for DOM elements) or a ReactClass (for composite ' + + 'components).' + ) : null); + + var element = ReactElement.createElement.apply(this, arguments); + + // The result can be nullish if a mock or a custom function is used. + // TODO: Drop this when these are no longer allowed as the type argument. + if (element == null) { + return element; + } + + for (var i = 2; i < arguments.length; i++) { + validateChildKeys(arguments[i], type); + } + + if (type) { + var name = type.displayName; + if (type.propTypes) { + checkPropTypes( + name, + type.propTypes, + element.props, + ReactPropTypeLocations.prop + ); + } + if (type.contextTypes) { + checkPropTypes( + name, + type.contextTypes, + element._context, + ReactPropTypeLocations.context + ); + } + } + return element; + }, + + createFactory: function(type) { + var validatedFactory = ReactElementValidator.createElement.bind( + null, + type + ); + validatedFactory.type = type; + return validatedFactory; + } + + }; + + module.exports = ReactElementValidator; + + /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(89))) + +/***/ }, +/* 55 */ +/***/ function(module, exports, __webpack_require__) { + + /* WEBPACK VAR INJECTION */(function(process) {/** + * Copyright 2013-2014, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule ReactDOM + * @typechecks static-only + */ + + "use strict"; + + var ReactElement = __webpack_require__(53); + var ReactElementValidator = __webpack_require__(54); + var ReactLegacyElement = __webpack_require__(59); + + var mapObject = __webpack_require__(127); + + /** + * Create a factory that creates HTML tag elements. + * + * @param {string} tag Tag name (e.g. `div`). + * @private + */ + function createDOMFactory(tag) { + if ("production" !== process.env.NODE_ENV) { + return ReactLegacyElement.markNonLegacyFactory( + ReactElementValidator.createFactory(tag) + ); + } + return ReactLegacyElement.markNonLegacyFactory( + ReactElement.createFactory(tag) + ); + } + + /** + * Creates a mapping from supported HTML tags to `ReactDOMComponent` classes. + * This is also accessible via `React.DOM`. + * + * @public + */ + var ReactDOM = mapObject({ + a: 'a', + abbr: 'abbr', + address: 'address', + area: 'area', + article: 'article', + aside: 'aside', + audio: 'audio', + b: 'b', + base: 'base', + bdi: 'bdi', + bdo: 'bdo', + big: 'big', + blockquote: 'blockquote', + body: 'body', + br: 'br', + button: 'button', + canvas: 'canvas', + caption: 'caption', + cite: 'cite', + code: 'code', + col: 'col', + colgroup: 'colgroup', + data: 'data', + datalist: 'datalist', + dd: 'dd', + del: 'del', + details: 'details', + dfn: 'dfn', + dialog: 'dialog', + div: 'div', + dl: 'dl', + dt: 'dt', + em: 'em', + embed: 'embed', + fieldset: 'fieldset', + figcaption: 'figcaption', + figure: 'figure', + footer: 'footer', + form: 'form', + h1: 'h1', + h2: 'h2', + h3: 'h3', + h4: 'h4', + h5: 'h5', + h6: 'h6', + head: 'head', + header: 'header', + hr: 'hr', + html: 'html', + i: 'i', + iframe: 'iframe', + img: 'img', + input: 'input', + ins: 'ins', + kbd: 'kbd', + keygen: 'keygen', + label: 'label', + legend: 'legend', + li: 'li', + link: 'link', + main: 'main', + map: 'map', + mark: 'mark', + menu: 'menu', + menuitem: 'menuitem', + meta: 'meta', + meter: 'meter', + nav: 'nav', + noscript: 'noscript', + object: 'object', + ol: 'ol', + optgroup: 'optgroup', + option: 'option', + output: 'output', + p: 'p', + param: 'param', + picture: 'picture', + pre: 'pre', + progress: 'progress', + q: 'q', + rp: 'rp', + rt: 'rt', + ruby: 'ruby', + s: 's', + samp: 'samp', + script: 'script', + section: 'section', + select: 'select', + small: 'small', + source: 'source', + span: 'span', + strong: 'strong', + style: 'style', + sub: 'sub', + summary: 'summary', + sup: 'sup', + table: 'table', + tbody: 'tbody', + td: 'td', + textarea: 'textarea', + tfoot: 'tfoot', + th: 'th', + thead: 'thead', + time: 'time', + title: 'title', + tr: 'tr', + track: 'track', + u: 'u', + ul: 'ul', + 'var': 'var', + video: 'video', + wbr: 'wbr', + + // SVG + circle: 'circle', + defs: 'defs', + ellipse: 'ellipse', + g: 'g', + line: 'line', + linearGradient: 'linearGradient', + mask: 'mask', + path: 'path', + pattern: 'pattern', + polygon: 'polygon', + polyline: 'polyline', + radialGradient: 'radialGradient', + rect: 'rect', + stop: 'stop', + svg: 'svg', + text: 'text', + tspan: 'tspan' + + }, createDOMFactory); + + module.exports = ReactDOM; + + /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(89))) + +/***/ }, +/* 56 */ +/***/ function(module, exports, __webpack_require__) { + + /* WEBPACK VAR INJECTION */(function(process) {/** + * Copyright 2013-2014, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule ReactDOMComponent + * @typechecks static-only + */ + + "use strict"; + + var CSSPropertyOperations = __webpack_require__(129); + var DOMProperty = __webpack_require__(112); + var DOMPropertyOperations = __webpack_require__(46); + var ReactBrowserComponentMixin = __webpack_require__(130); + var ReactComponent = __webpack_require__(49); + var ReactBrowserEventEmitter = __webpack_require__(131); + var ReactMount = __webpack_require__(60); + var ReactMultiChild = __webpack_require__(61); + var ReactPerf = __webpack_require__(62); + + var assign = __webpack_require__(66); + var escapeTextForBrowser = __webpack_require__(113); + var invariant = __webpack_require__(79); + var isEventSupported = __webpack_require__(132); + var keyOf = __webpack_require__(126); + var monitorCodeUse = __webpack_require__(120); + + var deleteListener = ReactBrowserEventEmitter.deleteListener; + var listenTo = ReactBrowserEventEmitter.listenTo; + var registrationNameModules = ReactBrowserEventEmitter.registrationNameModules; + + // For quickly matching children type, to test if can be treated as content. + var CONTENT_TYPES = {'string': true, 'number': true}; + + var STYLE = keyOf({style: null}); + + var ELEMENT_NODE_TYPE = 1; + + /** + * @param {?object} props + */ + function assertValidProps(props) { + if (!props) { + return; + } + // Note the use of `==` which checks for null or undefined. + ("production" !== process.env.NODE_ENV ? invariant( + props.children == null || props.dangerouslySetInnerHTML == null, + 'Can only set one of `children` or `props.dangerouslySetInnerHTML`.' + ) : invariant(props.children == null || props.dangerouslySetInnerHTML == null)); + if ("production" !== process.env.NODE_ENV) { + if (props.contentEditable && props.children != null) { + console.warn( + 'A component is `contentEditable` and contains `children` managed by ' + + 'React. It is now your responsibility to guarantee that none of those '+ + 'nodes are unexpectedly modified or duplicated. This is probably not ' + + 'intentional.' + ); + } + } + ("production" !== process.env.NODE_ENV ? invariant( + props.style == null || typeof props.style === 'object', + 'The `style` prop expects a mapping from style properties to values, ' + + 'not a string.' + ) : invariant(props.style == null || typeof props.style === 'object')); + } + + function putListener(id, registrationName, listener, transaction) { + if ("production" !== process.env.NODE_ENV) { + // IE8 has no API for event capturing and the `onScroll` event doesn't + // bubble. + if (registrationName === 'onScroll' && + !isEventSupported('scroll', true)) { + monitorCodeUse('react_no_scroll_event'); + console.warn('This browser doesn\'t support the `onScroll` event'); + } + } + var container = ReactMount.findReactContainerForID(id); + if (container) { + var doc = container.nodeType === ELEMENT_NODE_TYPE ? + container.ownerDocument : + container; + listenTo(registrationName, doc); + } + transaction.getPutListenerQueue().enqueuePutListener( + id, + registrationName, + listener + ); + } + + // For HTML, certain tags should omit their close tag. We keep a whitelist for + // those special cased tags. + + var omittedCloseTags = { + 'area': true, + 'base': true, + 'br': true, + 'col': true, + 'embed': true, + 'hr': true, + 'img': true, + 'input': true, + 'keygen': true, + 'link': true, + 'meta': true, + 'param': true, + 'source': true, + 'track': true, + 'wbr': true + // NOTE: menuitem's close tag should be omitted, but that causes problems. + }; + + // We accept any tag to be rendered but since this gets injected into abitrary + // HTML, we want to make sure that it's a safe tag. + // http://www.w3.org/TR/REC-xml/#NT-Name + + var VALID_TAG_REGEX = /^[a-zA-Z][a-zA-Z:_\.\-\d]*$/; // Simplified subset + var validatedTagCache = {}; + var hasOwnProperty = {}.hasOwnProperty; + + function validateDangerousTag(tag) { + if (!hasOwnProperty.call(validatedTagCache, tag)) { + ("production" !== process.env.NODE_ENV ? invariant(VALID_TAG_REGEX.test(tag), 'Invalid tag: %s', tag) : invariant(VALID_TAG_REGEX.test(tag))); + validatedTagCache[tag] = true; + } + } + + /** + * Creates a new React class that is idempotent and capable of containing other + * React components. It accepts event listeners and DOM properties that are + * valid according to `DOMProperty`. + * + * - Event listeners: `onClick`, `onMouseDown`, etc. + * - DOM properties: `className`, `name`, `title`, etc. + * + * The `style` property functions differently from the DOM API. It accepts an + * object mapping of style properties to values. + * + * @constructor ReactDOMComponent + * @extends ReactComponent + * @extends ReactMultiChild + */ + function ReactDOMComponent(tag) { + validateDangerousTag(tag); + this._tag = tag; + this.tagName = tag.toUpperCase(); + } + + ReactDOMComponent.displayName = 'ReactDOMComponent'; + + ReactDOMComponent.Mixin = { + + /** + * Generates root tag markup then recurses. This method has side effects and + * is not idempotent. + * + * @internal + * @param {string} rootID The root DOM ID for this node. + * @param {ReactReconcileTransaction|ReactServerRenderingTransaction} transaction + * @param {number} mountDepth number of components in the owner hierarchy + * @return {string} The computed markup. + */ + mountComponent: ReactPerf.measure( + 'ReactDOMComponent', + 'mountComponent', + function(rootID, transaction, mountDepth) { + ReactComponent.Mixin.mountComponent.call( + this, + rootID, + transaction, + mountDepth + ); + assertValidProps(this.props); + var closeTag = omittedCloseTags[this._tag] ? '' : ''; + return ( + this._createOpenTagMarkupAndPutListeners(transaction) + + this._createContentMarkup(transaction) + + closeTag + ); + } + ), + + /** + * Creates markup for the open tag and all attributes. + * + * This method has side effects because events get registered. + * + * Iterating over object properties is faster than iterating over arrays. + * @see http://jsperf.com/obj-vs-arr-iteration + * + * @private + * @param {ReactReconcileTransaction|ReactServerRenderingTransaction} transaction + * @return {string} Markup of opening tag. + */ + _createOpenTagMarkupAndPutListeners: function(transaction) { + var props = this.props; + var ret = '<' + this._tag; + + for (var propKey in props) { + if (!props.hasOwnProperty(propKey)) { + continue; + } + var propValue = props[propKey]; + if (propValue == null) { + continue; + } + if (registrationNameModules.hasOwnProperty(propKey)) { + putListener(this._rootNodeID, propKey, propValue, transaction); + } else { + if (propKey === STYLE) { + if (propValue) { + propValue = props.style = assign({}, props.style); + } + propValue = CSSPropertyOperations.createMarkupForStyles(propValue); + } + var markup = + DOMPropertyOperations.createMarkupForProperty(propKey, propValue); + if (markup) { + ret += ' ' + markup; + } + } + } + + // For static pages, no need to put React ID and checksum. Saves lots of + // bytes. + if (transaction.renderToStaticMarkup) { + return ret + '>'; + } + + var markupForID = DOMPropertyOperations.createMarkupForID(this._rootNodeID); + return ret + ' ' + markupForID + '>'; + }, + + /** + * Creates markup for the content between the tags. + * + * @private + * @param {ReactReconcileTransaction|ReactServerRenderingTransaction} transaction + * @return {string} Content markup. + */ + _createContentMarkup: function(transaction) { + // Intentional use of != to avoid catching zero/false. + var innerHTML = this.props.dangerouslySetInnerHTML; + if (innerHTML != null) { + if (innerHTML.__html != null) { + return innerHTML.__html; + } + } else { + var contentToUse = + CONTENT_TYPES[typeof this.props.children] ? this.props.children : null; + var childrenToUse = contentToUse != null ? null : this.props.children; + if (contentToUse != null) { + return escapeTextForBrowser(contentToUse); + } else if (childrenToUse != null) { + var mountImages = this.mountChildren( + childrenToUse, + transaction + ); + return mountImages.join(''); + } + } + return ''; + }, + + receiveComponent: function(nextElement, transaction) { + if (nextElement === this._currentElement && + nextElement._owner != null) { + // Since elements are immutable after the owner is rendered, + // we can do a cheap identity compare here to determine if this is a + // superfluous reconcile. It's possible for state to be mutable but such + // change should trigger an update of the owner which would recreate + // the element. We explicitly check for the existence of an owner since + // it's possible for a element created outside a composite to be + // deeply mutated and reused. + return; + } + + ReactComponent.Mixin.receiveComponent.call( + this, + nextElement, + transaction + ); + }, + + /** + * Updates a native DOM component after it has already been allocated and + * attached to the DOM. Reconciles the root DOM node, then recurses. + * + * @param {ReactReconcileTransaction} transaction + * @param {ReactElement} prevElement + * @internal + * @overridable + */ + updateComponent: ReactPerf.measure( + 'ReactDOMComponent', + 'updateComponent', + function(transaction, prevElement) { + assertValidProps(this._currentElement.props); + ReactComponent.Mixin.updateComponent.call( + this, + transaction, + prevElement + ); + this._updateDOMProperties(prevElement.props, transaction); + this._updateDOMChildren(prevElement.props, transaction); + } + ), + + /** + * Reconciles the properties by detecting differences in property values and + * updating the DOM as necessary. This function is probably the single most + * critical path for performance optimization. + * + * TODO: Benchmark whether checking for changed values in memory actually + * improves performance (especially statically positioned elements). + * TODO: Benchmark the effects of putting this at the top since 99% of props + * do not change for a given reconciliation. + * TODO: Benchmark areas that can be improved with caching. + * + * @private + * @param {object} lastProps + * @param {ReactReconcileTransaction} transaction + */ + _updateDOMProperties: function(lastProps, transaction) { + var nextProps = this.props; + var propKey; + var styleName; + var styleUpdates; + for (propKey in lastProps) { + if (nextProps.hasOwnProperty(propKey) || + !lastProps.hasOwnProperty(propKey)) { + continue; + } + if (propKey === STYLE) { + var lastStyle = lastProps[propKey]; + for (styleName in lastStyle) { + if (lastStyle.hasOwnProperty(styleName)) { + styleUpdates = styleUpdates || {}; + styleUpdates[styleName] = ''; + } + } + } else if (registrationNameModules.hasOwnProperty(propKey)) { + deleteListener(this._rootNodeID, propKey); + } else if ( + DOMProperty.isStandardName[propKey] || + DOMProperty.isCustomAttribute(propKey)) { + ReactComponent.BackendIDOperations.deletePropertyByID( + this._rootNodeID, + propKey + ); + } + } + for (propKey in nextProps) { + var nextProp = nextProps[propKey]; + var lastProp = lastProps[propKey]; + if (!nextProps.hasOwnProperty(propKey) || nextProp === lastProp) { + continue; + } + if (propKey === STYLE) { + if (nextProp) { + nextProp = nextProps.style = assign({}, nextProp); + } + if (lastProp) { + // Unset styles on `lastProp` but not on `nextProp`. + for (styleName in lastProp) { + if (lastProp.hasOwnProperty(styleName) && + (!nextProp || !nextProp.hasOwnProperty(styleName))) { + styleUpdates = styleUpdates || {}; + styleUpdates[styleName] = ''; + } + } + // Update styles that changed since `lastProp`. + for (styleName in nextProp) { + if (nextProp.hasOwnProperty(styleName) && + lastProp[styleName] !== nextProp[styleName]) { + styleUpdates = styleUpdates || {}; + styleUpdates[styleName] = nextProp[styleName]; + } + } + } else { + // Relies on `updateStylesByID` not mutating `styleUpdates`. + styleUpdates = nextProp; + } + } else if (registrationNameModules.hasOwnProperty(propKey)) { + putListener(this._rootNodeID, propKey, nextProp, transaction); + } else if ( + DOMProperty.isStandardName[propKey] || + DOMProperty.isCustomAttribute(propKey)) { + ReactComponent.BackendIDOperations.updatePropertyByID( + this._rootNodeID, + propKey, + nextProp + ); + } + } + if (styleUpdates) { + ReactComponent.BackendIDOperations.updateStylesByID( + this._rootNodeID, + styleUpdates + ); + } + }, + + /** + * Reconciles the children with the various properties that affect the + * children content. + * + * @param {object} lastProps + * @param {ReactReconcileTransaction} transaction + */ + _updateDOMChildren: function(lastProps, transaction) { + var nextProps = this.props; + + var lastContent = + CONTENT_TYPES[typeof lastProps.children] ? lastProps.children : null; + var nextContent = + CONTENT_TYPES[typeof nextProps.children] ? nextProps.children : null; + + var lastHtml = + lastProps.dangerouslySetInnerHTML && + lastProps.dangerouslySetInnerHTML.__html; + var nextHtml = + nextProps.dangerouslySetInnerHTML && + nextProps.dangerouslySetInnerHTML.__html; + + // Note the use of `!=` which checks for null or undefined. + var lastChildren = lastContent != null ? null : lastProps.children; + var nextChildren = nextContent != null ? null : nextProps.children; + + // If we're switching from children to content/html or vice versa, remove + // the old content + var lastHasContentOrHtml = lastContent != null || lastHtml != null; + var nextHasContentOrHtml = nextContent != null || nextHtml != null; + if (lastChildren != null && nextChildren == null) { + this.updateChildren(null, transaction); + } else if (lastHasContentOrHtml && !nextHasContentOrHtml) { + this.updateTextContent(''); + } + + if (nextContent != null) { + if (lastContent !== nextContent) { + this.updateTextContent('' + nextContent); + } + } else if (nextHtml != null) { + if (lastHtml !== nextHtml) { + ReactComponent.BackendIDOperations.updateInnerHTMLByID( + this._rootNodeID, + nextHtml + ); + } + } else if (nextChildren != null) { + this.updateChildren(nextChildren, transaction); + } + }, + + /** + * Destroys all event registrations for this instance. Does not remove from + * the DOM. That must be done by the parent. + * + * @internal + */ + unmountComponent: function() { + this.unmountChildren(); + ReactBrowserEventEmitter.deleteAllListeners(this._rootNodeID); + ReactComponent.Mixin.unmountComponent.call(this); + } + + }; + + assign( + ReactDOMComponent.prototype, + ReactComponent.Mixin, + ReactDOMComponent.Mixin, + ReactMultiChild.Mixin, + ReactBrowserComponentMixin + ); + + module.exports = ReactDOMComponent; + + /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(89))) + +/***/ }, +/* 57 */ +/***/ function(module, exports, __webpack_require__) { + + /* WEBPACK VAR INJECTION */(function(process) {/** + * Copyright 2013-2014, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule ReactDefaultInjection + */ + + "use strict"; + + var BeforeInputEventPlugin = __webpack_require__(134); + var ChangeEventPlugin = __webpack_require__(135); + var ClientReactRootIndex = __webpack_require__(136); + var CompositionEventPlugin = __webpack_require__(137); + var DefaultEventPluginOrder = __webpack_require__(138); + var EnterLeaveEventPlugin = __webpack_require__(139); + var ExecutionEnvironment = __webpack_require__(69); + var HTMLDOMPropertyConfig = __webpack_require__(140); + var MobileSafariClickEventPlugin = __webpack_require__(141); + var ReactBrowserComponentMixin = __webpack_require__(130); + var ReactComponentBrowserEnvironment = + __webpack_require__(142); + var ReactDefaultBatchingStrategy = __webpack_require__(143); + var ReactDOMComponent = __webpack_require__(56); + var ReactDOMButton = __webpack_require__(144); + var ReactDOMForm = __webpack_require__(145); + var ReactDOMImg = __webpack_require__(146); + var ReactDOMInput = __webpack_require__(147); + var ReactDOMOption = __webpack_require__(148); + var ReactDOMSelect = __webpack_require__(149); + var ReactDOMTextarea = __webpack_require__(150); + var ReactEventListener = __webpack_require__(151); + var ReactInjection = __webpack_require__(152); + var ReactInstanceHandles = __webpack_require__(58); + var ReactMount = __webpack_require__(60); + var SelectEventPlugin = __webpack_require__(153); + var ServerReactRootIndex = __webpack_require__(154); + var SimpleEventPlugin = __webpack_require__(155); + var SVGDOMPropertyConfig = __webpack_require__(156); + + var createFullPageComponent = __webpack_require__(157); + + function inject() { + ReactInjection.EventEmitter.injectReactEventListener( + ReactEventListener + ); + + /** + * Inject modules for resolving DOM hierarchy and plugin ordering. + */ + ReactInjection.EventPluginHub.injectEventPluginOrder(DefaultEventPluginOrder); + ReactInjection.EventPluginHub.injectInstanceHandle(ReactInstanceHandles); + ReactInjection.EventPluginHub.injectMount(ReactMount); + + /** + * Some important event plugins included by default (without having to require + * them). + */ + ReactInjection.EventPluginHub.injectEventPluginsByName({ + SimpleEventPlugin: SimpleEventPlugin, + EnterLeaveEventPlugin: EnterLeaveEventPlugin, + ChangeEventPlugin: ChangeEventPlugin, + CompositionEventPlugin: CompositionEventPlugin, + MobileSafariClickEventPlugin: MobileSafariClickEventPlugin, + SelectEventPlugin: SelectEventPlugin, + BeforeInputEventPlugin: BeforeInputEventPlugin + }); + + ReactInjection.NativeComponent.injectGenericComponentClass( + ReactDOMComponent + ); + + ReactInjection.NativeComponent.injectComponentClasses({ + 'button': ReactDOMButton, + 'form': ReactDOMForm, + 'img': ReactDOMImg, + 'input': ReactDOMInput, + 'option': ReactDOMOption, + 'select': ReactDOMSelect, + 'textarea': ReactDOMTextarea, + + 'html': createFullPageComponent('html'), + 'head': createFullPageComponent('head'), + 'body': createFullPageComponent('body') + }); + + // This needs to happen after createFullPageComponent() otherwise the mixin + // gets double injected. + ReactInjection.CompositeComponent.injectMixin(ReactBrowserComponentMixin); + + ReactInjection.DOMProperty.injectDOMPropertyConfig(HTMLDOMPropertyConfig); + ReactInjection.DOMProperty.injectDOMPropertyConfig(SVGDOMPropertyConfig); + + ReactInjection.EmptyComponent.injectEmptyComponent('noscript'); + + ReactInjection.Updates.injectReconcileTransaction( + ReactComponentBrowserEnvironment.ReactReconcileTransaction + ); + ReactInjection.Updates.injectBatchingStrategy( + ReactDefaultBatchingStrategy + ); + + ReactInjection.RootIndex.injectCreateReactRootIndex( + ExecutionEnvironment.canUseDOM ? + ClientReactRootIndex.createReactRootIndex : + ServerReactRootIndex.createReactRootIndex + ); + + ReactInjection.Component.injectEnvironment(ReactComponentBrowserEnvironment); + + if ("production" !== process.env.NODE_ENV) { + var url = (ExecutionEnvironment.canUseDOM && window.location.href) || ''; + if ((/[?&]react_perf\b/).test(url)) { + var ReactDefaultPerf = __webpack_require__(158); + ReactDefaultPerf.start(); + } + } + } + + module.exports = { + inject: inject + }; + + /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(89))) + +/***/ }, +/* 58 */ +/***/ function(module, exports, __webpack_require__) { + + /* WEBPACK VAR INJECTION */(function(process) {/** + * Copyright 2013-2014, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule ReactInstanceHandles + * @typechecks static-only + */ + + "use strict"; + + var ReactRootIndex = __webpack_require__(133); + + var invariant = __webpack_require__(79); + + var SEPARATOR = '.'; + var SEPARATOR_LENGTH = SEPARATOR.length; + + /** + * Maximum depth of traversals before we consider the possibility of a bad ID. + */ + var MAX_TREE_DEPTH = 100; + + /** + * Creates a DOM ID prefix to use when mounting React components. + * + * @param {number} index A unique integer + * @return {string} React root ID. + * @internal + */ + function getReactRootIDString(index) { + return SEPARATOR + index.toString(36); + } + + /** + * Checks if a character in the supplied ID is a separator or the end. + * + * @param {string} id A React DOM ID. + * @param {number} index Index of the character to check. + * @return {boolean} True if the character is a separator or end of the ID. + * @private + */ + function isBoundary(id, index) { + return id.charAt(index) === SEPARATOR || index === id.length; + } + + /** + * Checks if the supplied string is a valid React DOM ID. + * + * @param {string} id A React DOM ID, maybe. + * @return {boolean} True if the string is a valid React DOM ID. + * @private + */ + function isValidID(id) { + return id === '' || ( + id.charAt(0) === SEPARATOR && id.charAt(id.length - 1) !== SEPARATOR + ); + } + + /** + * Checks if the first ID is an ancestor of or equal to the second ID. + * + * @param {string} ancestorID + * @param {string} descendantID + * @return {boolean} True if `ancestorID` is an ancestor of `descendantID`. + * @internal + */ + function isAncestorIDOf(ancestorID, descendantID) { + return ( + descendantID.indexOf(ancestorID) === 0 && + isBoundary(descendantID, ancestorID.length) + ); + } + + /** + * Gets the parent ID of the supplied React DOM ID, `id`. + * + * @param {string} id ID of a component. + * @return {string} ID of the parent, or an empty string. + * @private + */ + function getParentID(id) { + return id ? id.substr(0, id.lastIndexOf(SEPARATOR)) : ''; + } + + /** + * Gets the next DOM ID on the tree path from the supplied `ancestorID` to the + * supplied `destinationID`. If they are equal, the ID is returned. + * + * @param {string} ancestorID ID of an ancestor node of `destinationID`. + * @param {string} destinationID ID of the destination node. + * @return {string} Next ID on the path from `ancestorID` to `destinationID`. + * @private + */ + function getNextDescendantID(ancestorID, destinationID) { + ("production" !== process.env.NODE_ENV ? invariant( + isValidID(ancestorID) && isValidID(destinationID), + 'getNextDescendantID(%s, %s): Received an invalid React DOM ID.', + ancestorID, + destinationID + ) : invariant(isValidID(ancestorID) && isValidID(destinationID))); + ("production" !== process.env.NODE_ENV ? invariant( + isAncestorIDOf(ancestorID, destinationID), + 'getNextDescendantID(...): React has made an invalid assumption about ' + + 'the DOM hierarchy. Expected `%s` to be an ancestor of `%s`.', + ancestorID, + destinationID + ) : invariant(isAncestorIDOf(ancestorID, destinationID))); + if (ancestorID === destinationID) { + return ancestorID; + } + // Skip over the ancestor and the immediate separator. Traverse until we hit + // another separator or we reach the end of `destinationID`. + var start = ancestorID.length + SEPARATOR_LENGTH; + for (var i = start; i < destinationID.length; i++) { + if (isBoundary(destinationID, i)) { + break; + } + } + return destinationID.substr(0, i); + } + + /** + * Gets the nearest common ancestor ID of two IDs. + * + * Using this ID scheme, the nearest common ancestor ID is the longest common + * prefix of the two IDs that immediately preceded a "marker" in both strings. + * + * @param {string} oneID + * @param {string} twoID + * @return {string} Nearest common ancestor ID, or the empty string if none. + * @private + */ + function getFirstCommonAncestorID(oneID, twoID) { + var minLength = Math.min(oneID.length, twoID.length); + if (minLength === 0) { + return ''; + } + var lastCommonMarkerIndex = 0; + // Use `<=` to traverse until the "EOL" of the shorter string. + for (var i = 0; i <= minLength; i++) { + if (isBoundary(oneID, i) && isBoundary(twoID, i)) { + lastCommonMarkerIndex = i; + } else if (oneID.charAt(i) !== twoID.charAt(i)) { + break; + } + } + var longestCommonID = oneID.substr(0, lastCommonMarkerIndex); + ("production" !== process.env.NODE_ENV ? invariant( + isValidID(longestCommonID), + 'getFirstCommonAncestorID(%s, %s): Expected a valid React DOM ID: %s', + oneID, + twoID, + longestCommonID + ) : invariant(isValidID(longestCommonID))); + return longestCommonID; + } + + /** + * Traverses the parent path between two IDs (either up or down). The IDs must + * not be the same, and there must exist a parent path between them. If the + * callback returns `false`, traversal is stopped. + * + * @param {?string} start ID at which to start traversal. + * @param {?string} stop ID at which to end traversal. + * @param {function} cb Callback to invoke each ID with. + * @param {?boolean} skipFirst Whether or not to skip the first node. + * @param {?boolean} skipLast Whether or not to skip the last node. + * @private + */ + function traverseParentPath(start, stop, cb, arg, skipFirst, skipLast) { + start = start || ''; + stop = stop || ''; + ("production" !== process.env.NODE_ENV ? invariant( + start !== stop, + 'traverseParentPath(...): Cannot traverse from and to the same ID, `%s`.', + start + ) : invariant(start !== stop)); + var traverseUp = isAncestorIDOf(stop, start); + ("production" !== process.env.NODE_ENV ? invariant( + traverseUp || isAncestorIDOf(start, stop), + 'traverseParentPath(%s, %s, ...): Cannot traverse from two IDs that do ' + + 'not have a parent path.', + start, + stop + ) : invariant(traverseUp || isAncestorIDOf(start, stop))); + // Traverse from `start` to `stop` one depth at a time. + var depth = 0; + var traverse = traverseUp ? getParentID : getNextDescendantID; + for (var id = start; /* until break */; id = traverse(id, stop)) { + var ret; + if ((!skipFirst || id !== start) && (!skipLast || id !== stop)) { + ret = cb(id, traverseUp, arg); + } + if (ret === false || id === stop) { + // Only break //after// visiting `stop`. + break; + } + ("production" !== process.env.NODE_ENV ? invariant( + depth++ < MAX_TREE_DEPTH, + 'traverseParentPath(%s, %s, ...): Detected an infinite loop while ' + + 'traversing the React DOM ID tree. This may be due to malformed IDs: %s', + start, stop + ) : invariant(depth++ < MAX_TREE_DEPTH)); + } + } + + /** + * Manages the IDs assigned to DOM representations of React components. This + * uses a specific scheme in order to traverse the DOM efficiently (e.g. in + * order to simulate events). + * + * @internal + */ + var ReactInstanceHandles = { + + /** + * Constructs a React root ID + * @return {string} A React root ID. + */ + createReactRootID: function() { + return getReactRootIDString(ReactRootIndex.createReactRootIndex()); + }, + + /** + * Constructs a React ID by joining a root ID with a name. + * + * @param {string} rootID Root ID of a parent component. + * @param {string} name A component's name (as flattened children). + * @return {string} A React ID. + * @internal + */ + createReactID: function(rootID, name) { + return rootID + name; + }, + + /** + * Gets the DOM ID of the React component that is the root of the tree that + * contains the React component with the supplied DOM ID. + * + * @param {string} id DOM ID of a React component. + * @return {?string} DOM ID of the React component that is the root. + * @internal + */ + getReactRootIDFromNodeID: function(id) { + if (id && id.charAt(0) === SEPARATOR && id.length > 1) { + var index = id.indexOf(SEPARATOR, 1); + return index > -1 ? id.substr(0, index) : id; + } + return null; + }, + + /** + * Traverses the ID hierarchy and invokes the supplied `cb` on any IDs that + * should would receive a `mouseEnter` or `mouseLeave` event. + * + * NOTE: Does not invoke the callback on the nearest common ancestor because + * nothing "entered" or "left" that element. + * + * @param {string} leaveID ID being left. + * @param {string} enterID ID being entered. + * @param {function} cb Callback to invoke on each entered/left ID. + * @param {*} upArg Argument to invoke the callback with on left IDs. + * @param {*} downArg Argument to invoke the callback with on entered IDs. + * @internal + */ + traverseEnterLeave: function(leaveID, enterID, cb, upArg, downArg) { + var ancestorID = getFirstCommonAncestorID(leaveID, enterID); + if (ancestorID !== leaveID) { + traverseParentPath(leaveID, ancestorID, cb, upArg, false, true); + } + if (ancestorID !== enterID) { + traverseParentPath(ancestorID, enterID, cb, downArg, true, false); + } + }, + + /** + * Simulates the traversal of a two-phase, capture/bubble event dispatch. + * + * NOTE: This traversal happens on IDs without touching the DOM. + * + * @param {string} targetID ID of the target node. + * @param {function} cb Callback to invoke. + * @param {*} arg Argument to invoke the callback with. + * @internal + */ + traverseTwoPhase: function(targetID, cb, arg) { + if (targetID) { + traverseParentPath('', targetID, cb, arg, true, false); + traverseParentPath(targetID, '', cb, arg, false, true); + } + }, + + /** + * Traverse a node ID, calling the supplied `cb` for each ancestor ID. For + * example, passing `.0.$row-0.1` would result in `cb` getting called + * with `.0`, `.0.$row-0`, and `.0.$row-0.1`. + * + * NOTE: This traversal happens on IDs without touching the DOM. + * + * @param {string} targetID ID of the target node. + * @param {function} cb Callback to invoke. + * @param {*} arg Argument to invoke the callback with. + * @internal + */ + traverseAncestors: function(targetID, cb, arg) { + traverseParentPath('', targetID, cb, arg, true, false); + }, + + /** + * Exposed for unit testing. + * @private + */ + _getFirstCommonAncestorID: getFirstCommonAncestorID, + + /** + * Exposed for unit testing. + * @private + */ + _getNextDescendantID: getNextDescendantID, + + isAncestorIDOf: isAncestorIDOf, + + SEPARATOR: SEPARATOR + + }; + + module.exports = ReactInstanceHandles; + + /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(89))) + +/***/ }, +/* 59 */ +/***/ function(module, exports, __webpack_require__) { + + /* WEBPACK VAR INJECTION */(function(process) {/** + * Copyright 2014, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule ReactLegacyElement + */ + + "use strict"; + + var ReactCurrentOwner = __webpack_require__(52); + + var invariant = __webpack_require__(79); + var monitorCodeUse = __webpack_require__(120); + var warning = __webpack_require__(78); + + var legacyFactoryLogs = {}; + function warnForLegacyFactoryCall() { + if (!ReactLegacyElementFactory._isLegacyCallWarningEnabled) { + return; + } + var owner = ReactCurrentOwner.current; + var name = owner && owner.constructor ? owner.constructor.displayName : ''; + if (!name) { + name = 'Something'; + } + if (legacyFactoryLogs.hasOwnProperty(name)) { + return; + } + legacyFactoryLogs[name] = true; + ("production" !== process.env.NODE_ENV ? warning( + false, + name + ' is calling a React component directly. ' + + 'Use a factory or JSX instead. See: http://fb.me/react-legacyfactory' + ) : null); + monitorCodeUse('react_legacy_factory_call', { version: 3, name: name }); + } + + function warnForPlainFunctionType(type) { + var isReactClass = + type.prototype && + typeof type.prototype.mountComponent === 'function' && + typeof type.prototype.receiveComponent === 'function'; + if (isReactClass) { + ("production" !== process.env.NODE_ENV ? warning( + false, + 'Did not expect to get a React class here. Use `Component` instead ' + + 'of `Component.type` or `this.constructor`.' + ) : null); + } else { + if (!type._reactWarnedForThisType) { + try { + type._reactWarnedForThisType = true; + } catch (x) { + // just incase this is a frozen object or some special object + } + monitorCodeUse( + 'react_non_component_in_jsx', + { version: 3, name: type.name } + ); + } + ("production" !== process.env.NODE_ENV ? warning( + false, + 'This JSX uses a plain function. Only React components are ' + + 'valid in React\'s JSX transform.' + ) : null); + } + } + + function warnForNonLegacyFactory(type) { + ("production" !== process.env.NODE_ENV ? warning( + false, + 'Do not pass React.DOM.' + type.type + ' to JSX or createFactory. ' + + 'Use the string "' + type.type + '" instead.' + ) : null); + } + + /** + * Transfer static properties from the source to the target. Functions are + * rebound to have this reflect the original source. + */ + function proxyStaticMethods(target, source) { + if (typeof source !== 'function') { + return; + } + for (var key in source) { + if (source.hasOwnProperty(key)) { + var value = source[key]; + if (typeof value === 'function') { + var bound = value.bind(source); + // Copy any properties defined on the function, such as `isRequired` on + // a PropTypes validator. + for (var k in value) { + if (value.hasOwnProperty(k)) { + bound[k] = value[k]; + } + } + target[key] = bound; + } else { + target[key] = value; + } + } + } + } + + // We use an object instead of a boolean because booleans are ignored by our + // mocking libraries when these factories gets mocked. + var LEGACY_MARKER = {}; + var NON_LEGACY_MARKER = {}; + + var ReactLegacyElementFactory = {}; + + ReactLegacyElementFactory.wrapCreateFactory = function(createFactory) { + var legacyCreateFactory = function(type) { + if (typeof type !== 'function') { + // Non-function types cannot be legacy factories + return createFactory(type); + } + + if (type.isReactNonLegacyFactory) { + // This is probably a factory created by ReactDOM we unwrap it to get to + // the underlying string type. It shouldn't have been passed here so we + // warn. + if ("production" !== process.env.NODE_ENV) { + warnForNonLegacyFactory(type); + } + return createFactory(type.type); + } + + if (type.isReactLegacyFactory) { + // This is probably a legacy factory created by ReactCompositeComponent. + // We unwrap it to get to the underlying class. + return createFactory(type.type); + } + + if ("production" !== process.env.NODE_ENV) { + warnForPlainFunctionType(type); + } + + // Unless it's a legacy factory, then this is probably a plain function, + // that is expecting to be invoked by JSX. We can just return it as is. + return type; + }; + return legacyCreateFactory; + }; + + ReactLegacyElementFactory.wrapCreateElement = function(createElement) { + var legacyCreateElement = function(type, props, children) { + if (typeof type !== 'function') { + // Non-function types cannot be legacy factories + return createElement.apply(this, arguments); + } + + var args; + + if (type.isReactNonLegacyFactory) { + // This is probably a factory created by ReactDOM we unwrap it to get to + // the underlying string type. It shouldn't have been passed here so we + // warn. + if ("production" !== process.env.NODE_ENV) { + warnForNonLegacyFactory(type); + } + args = Array.prototype.slice.call(arguments, 0); + args[0] = type.type; + return createElement.apply(this, args); + } + + if (type.isReactLegacyFactory) { + // This is probably a legacy factory created by ReactCompositeComponent. + // We unwrap it to get to the underlying class. + if (type._isMockFunction) { + // If this is a mock function, people will expect it to be called. We + // will actually call the original mock factory function instead. This + // future proofs unit testing that assume that these are classes. + type.type._mockedReactClassConstructor = type; + } + args = Array.prototype.slice.call(arguments, 0); + args[0] = type.type; + return createElement.apply(this, args); + } + + if ("production" !== process.env.NODE_ENV) { + warnForPlainFunctionType(type); + } + + // This is being called with a plain function we should invoke it + // immediately as if this was used with legacy JSX. + return type.apply(null, Array.prototype.slice.call(arguments, 1)); + }; + return legacyCreateElement; + }; + + ReactLegacyElementFactory.wrapFactory = function(factory) { + ("production" !== process.env.NODE_ENV ? invariant( + typeof factory === 'function', + 'This is suppose to accept a element factory' + ) : invariant(typeof factory === 'function')); + var legacyElementFactory = function(config, children) { + // This factory should not be called when JSX is used. Use JSX instead. + if ("production" !== process.env.NODE_ENV) { + warnForLegacyFactoryCall(); + } + return factory.apply(this, arguments); + }; + proxyStaticMethods(legacyElementFactory, factory.type); + legacyElementFactory.isReactLegacyFactory = LEGACY_MARKER; + legacyElementFactory.type = factory.type; + return legacyElementFactory; + }; + + // This is used to mark a factory that will remain. E.g. we're allowed to call + // it as a function. However, you're not suppose to pass it to createElement + // or createFactory, so it will warn you if you do. + ReactLegacyElementFactory.markNonLegacyFactory = function(factory) { + factory.isReactNonLegacyFactory = NON_LEGACY_MARKER; + return factory; + }; + + // Checks if a factory function is actually a legacy factory pretending to + // be a class. + ReactLegacyElementFactory.isValidFactory = function(factory) { + // TODO: This will be removed and moved into a class validator or something. + return typeof factory === 'function' && + factory.isReactLegacyFactory === LEGACY_MARKER; + }; + + ReactLegacyElementFactory.isValidClass = function(factory) { + if ("production" !== process.env.NODE_ENV) { + ("production" !== process.env.NODE_ENV ? warning( + false, + 'isValidClass is deprecated and will be removed in a future release. ' + + 'Use a more specific validator instead.' + ) : null); + } + return ReactLegacyElementFactory.isValidFactory(factory); + }; + + ReactLegacyElementFactory._isLegacyCallWarningEnabled = true; + + module.exports = ReactLegacyElementFactory; + + /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(89))) + +/***/ }, +/* 60 */ +/***/ function(module, exports, __webpack_require__) { + + /* WEBPACK VAR INJECTION */(function(process) {/** + * Copyright 2013-2014, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule ReactMount + */ + + "use strict"; + + var DOMProperty = __webpack_require__(112); + var ReactBrowserEventEmitter = __webpack_require__(131); + var ReactCurrentOwner = __webpack_require__(52); + var ReactElement = __webpack_require__(53); + var ReactLegacyElement = __webpack_require__(59); + var ReactInstanceHandles = __webpack_require__(58); + var ReactPerf = __webpack_require__(62); + + var containsNode = __webpack_require__(159); + var deprecated = __webpack_require__(67); + var getReactRootElementInContainer = __webpack_require__(160); + var instantiateReactComponent = __webpack_require__(125); + var invariant = __webpack_require__(79); + var shouldUpdateReactComponent = __webpack_require__(128); + var warning = __webpack_require__(78); + + var createElement = ReactLegacyElement.wrapCreateElement( + ReactElement.createElement + ); + + var SEPARATOR = ReactInstanceHandles.SEPARATOR; + + var ATTR_NAME = DOMProperty.ID_ATTRIBUTE_NAME; + var nodeCache = {}; + + var ELEMENT_NODE_TYPE = 1; + var DOC_NODE_TYPE = 9; + + /** Mapping from reactRootID to React component instance. */ + var instancesByReactRootID = {}; + + /** Mapping from reactRootID to `container` nodes. */ + var containersByReactRootID = {}; + + if ("production" !== process.env.NODE_ENV) { + /** __DEV__-only mapping from reactRootID to root elements. */ + var rootElementsByReactRootID = {}; + } + + // Used to store breadth-first search state in findComponentRoot. + var findComponentRootReusableArray = []; + + /** + * @param {DOMElement} container DOM element that may contain a React component. + * @return {?string} A "reactRoot" ID, if a React component is rendered. + */ + function getReactRootID(container) { + var rootElement = getReactRootElementInContainer(container); + return rootElement && ReactMount.getID(rootElement); + } + + /** + * Accessing node[ATTR_NAME] or calling getAttribute(ATTR_NAME) on a form + * element can return its control whose name or ID equals ATTR_NAME. All + * DOM nodes support `getAttributeNode` but this can also get called on + * other objects so just return '' if we're given something other than a + * DOM node (such as window). + * + * @param {?DOMElement|DOMWindow|DOMDocument|DOMTextNode} node DOM node. + * @return {string} ID of the supplied `domNode`. + */ + function getID(node) { + var id = internalGetID(node); + if (id) { + if (nodeCache.hasOwnProperty(id)) { + var cached = nodeCache[id]; + if (cached !== node) { + ("production" !== process.env.NODE_ENV ? invariant( + !isValid(cached, id), + 'ReactMount: Two valid but unequal nodes with the same `%s`: %s', + ATTR_NAME, id + ) : invariant(!isValid(cached, id))); + + nodeCache[id] = node; + } + } else { + nodeCache[id] = node; + } + } + + return id; + } + + function internalGetID(node) { + // If node is something like a window, document, or text node, none of + // which support attributes or a .getAttribute method, gracefully return + // the empty string, as if the attribute were missing. + return node && node.getAttribute && node.getAttribute(ATTR_NAME) || ''; + } + + /** + * Sets the React-specific ID of the given node. + * + * @param {DOMElement} node The DOM node whose ID will be set. + * @param {string} id The value of the ID attribute. + */ + function setID(node, id) { + var oldID = internalGetID(node); + if (oldID !== id) { + delete nodeCache[oldID]; + } + node.setAttribute(ATTR_NAME, id); + nodeCache[id] = node; + } + + /** + * Finds the node with the supplied React-generated DOM ID. + * + * @param {string} id A React-generated DOM ID. + * @return {DOMElement} DOM node with the suppled `id`. + * @internal + */ + function getNode(id) { + if (!nodeCache.hasOwnProperty(id) || !isValid(nodeCache[id], id)) { + nodeCache[id] = ReactMount.findReactNodeByID(id); + } + return nodeCache[id]; + } + + /** + * A node is "valid" if it is contained by a currently mounted container. + * + * This means that the node does not have to be contained by a document in + * order to be considered valid. + * + * @param {?DOMElement} node The candidate DOM node. + * @param {string} id The expected ID of the node. + * @return {boolean} Whether the node is contained by a mounted container. + */ + function isValid(node, id) { + if (node) { + ("production" !== process.env.NODE_ENV ? invariant( + internalGetID(node) === id, + 'ReactMount: Unexpected modification of `%s`', + ATTR_NAME + ) : invariant(internalGetID(node) === id)); + + var container = ReactMount.findReactContainerForID(id); + if (container && containsNode(container, node)) { + return true; + } + } + + return false; + } + + /** + * Causes the cache to forget about one React-specific ID. + * + * @param {string} id The ID to forget. + */ + function purgeID(id) { + delete nodeCache[id]; + } + + var deepestNodeSoFar = null; + function findDeepestCachedAncestorImpl(ancestorID) { + var ancestor = nodeCache[ancestorID]; + if (ancestor && isValid(ancestor, ancestorID)) { + deepestNodeSoFar = ancestor; + } else { + // This node isn't populated in the cache, so presumably none of its + // descendants are. Break out of the loop. + return false; + } + } + + /** + * Return the deepest cached node whose ID is a prefix of `targetID`. + */ + function findDeepestCachedAncestor(targetID) { + deepestNodeSoFar = null; + ReactInstanceHandles.traverseAncestors( + targetID, + findDeepestCachedAncestorImpl + ); + + var foundNode = deepestNodeSoFar; + deepestNodeSoFar = null; + return foundNode; + } + + /** + * Mounting is the process of initializing a React component by creatings its + * representative DOM elements and inserting them into a supplied `container`. + * Any prior content inside `container` is destroyed in the process. + * + * ReactMount.render( + * component, + * document.getElementById('container') + * ); + * + *
    <-- Supplied `container`. + *
    <-- Rendered reactRoot of React + * // ... component. + *
    + *
    + * + * Inside of `container`, the first element rendered is the "reactRoot". + */ + var ReactMount = { + /** Exposed for debugging purposes **/ + _instancesByReactRootID: instancesByReactRootID, + + /** + * This is a hook provided to support rendering React components while + * ensuring that the apparent scroll position of its `container` does not + * change. + * + * @param {DOMElement} container The `container` being rendered into. + * @param {function} renderCallback This must be called once to do the render. + */ + scrollMonitor: function(container, renderCallback) { + renderCallback(); + }, + + /** + * Take a component that's already mounted into the DOM and replace its props + * @param {ReactComponent} prevComponent component instance already in the DOM + * @param {ReactComponent} nextComponent component instance to render + * @param {DOMElement} container container to render into + * @param {?function} callback function triggered on completion + */ + _updateRootComponent: function( + prevComponent, + nextComponent, + container, + callback) { + var nextProps = nextComponent.props; + ReactMount.scrollMonitor(container, function() { + prevComponent.replaceProps(nextProps, callback); + }); + + if ("production" !== process.env.NODE_ENV) { + // Record the root element in case it later gets transplanted. + rootElementsByReactRootID[getReactRootID(container)] = + getReactRootElementInContainer(container); + } + + return prevComponent; + }, + + /** + * Register a component into the instance map and starts scroll value + * monitoring + * @param {ReactComponent} nextComponent component instance to render + * @param {DOMElement} container container to render into + * @return {string} reactRoot ID prefix + */ + _registerComponent: function(nextComponent, container) { + ("production" !== process.env.NODE_ENV ? invariant( + container && ( + container.nodeType === ELEMENT_NODE_TYPE || + container.nodeType === DOC_NODE_TYPE + ), + '_registerComponent(...): Target container is not a DOM element.' + ) : invariant(container && ( + container.nodeType === ELEMENT_NODE_TYPE || + container.nodeType === DOC_NODE_TYPE + ))); + + ReactBrowserEventEmitter.ensureScrollValueMonitoring(); + + var reactRootID = ReactMount.registerContainer(container); + instancesByReactRootID[reactRootID] = nextComponent; + return reactRootID; + }, + + /** + * Render a new component into the DOM. + * @param {ReactComponent} nextComponent component instance to render + * @param {DOMElement} container container to render into + * @param {boolean} shouldReuseMarkup if we should skip the markup insertion + * @return {ReactComponent} nextComponent + */ + _renderNewRootComponent: ReactPerf.measure( + 'ReactMount', + '_renderNewRootComponent', + function( + nextComponent, + container, + shouldReuseMarkup) { + // Various parts of our code (such as ReactCompositeComponent's + // _renderValidatedComponent) assume that calls to render aren't nested; + // verify that that's the case. + ("production" !== process.env.NODE_ENV ? warning( + ReactCurrentOwner.current == null, + '_renderNewRootComponent(): Render methods should be a pure function ' + + 'of props and state; triggering nested component updates from ' + + 'render is not allowed. If necessary, trigger nested updates in ' + + 'componentDidUpdate.' + ) : null); + + var componentInstance = instantiateReactComponent(nextComponent, null); + var reactRootID = ReactMount._registerComponent( + componentInstance, + container + ); + componentInstance.mountComponentIntoNode( + reactRootID, + container, + shouldReuseMarkup + ); + + if ("production" !== process.env.NODE_ENV) { + // Record the root element in case it later gets transplanted. + rootElementsByReactRootID[reactRootID] = + getReactRootElementInContainer(container); + } + + return componentInstance; + } + ), + + /** + * Renders a React component into the DOM in the supplied `container`. + * + * If the React component was previously rendered into `container`, this will + * perform an update on it and only mutate the DOM as necessary to reflect the + * latest React component. + * + * @param {ReactElement} nextElement Component element to render. + * @param {DOMElement} container DOM element to render into. + * @param {?function} callback function triggered on completion + * @return {ReactComponent} Component instance rendered in `container`. + */ + render: function(nextElement, container, callback) { + ("production" !== process.env.NODE_ENV ? invariant( + ReactElement.isValidElement(nextElement), + 'renderComponent(): Invalid component element.%s', + ( + typeof nextElement === 'string' ? + ' Instead of passing an element string, make sure to instantiate ' + + 'it by passing it to React.createElement.' : + ReactLegacyElement.isValidFactory(nextElement) ? + ' Instead of passing a component class, make sure to instantiate ' + + 'it by passing it to React.createElement.' : + // Check if it quacks like a element + typeof nextElement.props !== "undefined" ? + ' This may be caused by unintentionally loading two independent ' + + 'copies of React.' : + '' + ) + ) : invariant(ReactElement.isValidElement(nextElement))); + + var prevComponent = instancesByReactRootID[getReactRootID(container)]; + + if (prevComponent) { + var prevElement = prevComponent._currentElement; + if (shouldUpdateReactComponent(prevElement, nextElement)) { + return ReactMount._updateRootComponent( + prevComponent, + nextElement, + container, + callback + ); + } else { + ReactMount.unmountComponentAtNode(container); + } + } + + var reactRootElement = getReactRootElementInContainer(container); + var containerHasReactMarkup = + reactRootElement && ReactMount.isRenderedByReact(reactRootElement); + + var shouldReuseMarkup = containerHasReactMarkup && !prevComponent; + + var component = ReactMount._renderNewRootComponent( + nextElement, + container, + shouldReuseMarkup + ); + callback && callback.call(component); + return component; + }, + + /** + * Constructs a component instance of `constructor` with `initialProps` and + * renders it into the supplied `container`. + * + * @param {function} constructor React component constructor. + * @param {?object} props Initial props of the component instance. + * @param {DOMElement} container DOM element to render into. + * @return {ReactComponent} Component instance rendered in `container`. + */ + constructAndRenderComponent: function(constructor, props, container) { + var element = createElement(constructor, props); + return ReactMount.render(element, container); + }, + + /** + * Constructs a component instance of `constructor` with `initialProps` and + * renders it into a container node identified by supplied `id`. + * + * @param {function} componentConstructor React component constructor + * @param {?object} props Initial props of the component instance. + * @param {string} id ID of the DOM element to render into. + * @return {ReactComponent} Component instance rendered in the container node. + */ + constructAndRenderComponentByID: function(constructor, props, id) { + var domNode = document.getElementById(id); + ("production" !== process.env.NODE_ENV ? invariant( + domNode, + 'Tried to get element with id of "%s" but it is not present on the page.', + id + ) : invariant(domNode)); + return ReactMount.constructAndRenderComponent(constructor, props, domNode); + }, + + /** + * Registers a container node into which React components will be rendered. + * This also creates the "reactRoot" ID that will be assigned to the element + * rendered within. + * + * @param {DOMElement} container DOM element to register as a container. + * @return {string} The "reactRoot" ID of elements rendered within. + */ + registerContainer: function(container) { + var reactRootID = getReactRootID(container); + if (reactRootID) { + // If one exists, make sure it is a valid "reactRoot" ID. + reactRootID = ReactInstanceHandles.getReactRootIDFromNodeID(reactRootID); + } + if (!reactRootID) { + // No valid "reactRoot" ID found, create one. + reactRootID = ReactInstanceHandles.createReactRootID(); + } + containersByReactRootID[reactRootID] = container; + return reactRootID; + }, + + /** + * Unmounts and destroys the React component rendered in the `container`. + * + * @param {DOMElement} container DOM element containing a React component. + * @return {boolean} True if a component was found in and unmounted from + * `container` + */ + unmountComponentAtNode: function(container) { + // Various parts of our code (such as ReactCompositeComponent's + // _renderValidatedComponent) assume that calls to render aren't nested; + // verify that that's the case. (Strictly speaking, unmounting won't cause a + // render but we still don't expect to be in a render call here.) + ("production" !== process.env.NODE_ENV ? warning( + ReactCurrentOwner.current == null, + 'unmountComponentAtNode(): Render methods should be a pure function of ' + + 'props and state; triggering nested component updates from render is ' + + 'not allowed. If necessary, trigger nested updates in ' + + 'componentDidUpdate.' + ) : null); + + var reactRootID = getReactRootID(container); + var component = instancesByReactRootID[reactRootID]; + if (!component) { + return false; + } + ReactMount.unmountComponentFromNode(component, container); + delete instancesByReactRootID[reactRootID]; + delete containersByReactRootID[reactRootID]; + if ("production" !== process.env.NODE_ENV) { + delete rootElementsByReactRootID[reactRootID]; + } + return true; + }, + + /** + * Unmounts a component and removes it from the DOM. + * + * @param {ReactComponent} instance React component instance. + * @param {DOMElement} container DOM element to unmount from. + * @final + * @internal + * @see {ReactMount.unmountComponentAtNode} + */ + unmountComponentFromNode: function(instance, container) { + instance.unmountComponent(); + + if (container.nodeType === DOC_NODE_TYPE) { + container = container.documentElement; + } + + // http://jsperf.com/emptying-a-node + while (container.lastChild) { + container.removeChild(container.lastChild); + } + }, + + /** + * Finds the container DOM element that contains React component to which the + * supplied DOM `id` belongs. + * + * @param {string} id The ID of an element rendered by a React component. + * @return {?DOMElement} DOM element that contains the `id`. + */ + findReactContainerForID: function(id) { + var reactRootID = ReactInstanceHandles.getReactRootIDFromNodeID(id); + var container = containersByReactRootID[reactRootID]; + + if ("production" !== process.env.NODE_ENV) { + var rootElement = rootElementsByReactRootID[reactRootID]; + if (rootElement && rootElement.parentNode !== container) { + ("production" !== process.env.NODE_ENV ? invariant( + // Call internalGetID here because getID calls isValid which calls + // findReactContainerForID (this function). + internalGetID(rootElement) === reactRootID, + 'ReactMount: Root element ID differed from reactRootID.' + ) : invariant(// Call internalGetID here because getID calls isValid which calls + // findReactContainerForID (this function). + internalGetID(rootElement) === reactRootID)); + + var containerChild = container.firstChild; + if (containerChild && + reactRootID === internalGetID(containerChild)) { + // If the container has a new child with the same ID as the old + // root element, then rootElementsByReactRootID[reactRootID] is + // just stale and needs to be updated. The case that deserves a + // warning is when the container is empty. + rootElementsByReactRootID[reactRootID] = containerChild; + } else { + console.warn( + 'ReactMount: Root element has been removed from its original ' + + 'container. New container:', rootElement.parentNode + ); + } + } + } + + return container; + }, + + /** + * Finds an element rendered by React with the supplied ID. + * + * @param {string} id ID of a DOM node in the React component. + * @return {DOMElement} Root DOM node of the React component. + */ + findReactNodeByID: function(id) { + var reactRoot = ReactMount.findReactContainerForID(id); + return ReactMount.findComponentRoot(reactRoot, id); + }, + + /** + * True if the supplied `node` is rendered by React. + * + * @param {*} node DOM Element to check. + * @return {boolean} True if the DOM Element appears to be rendered by React. + * @internal + */ + isRenderedByReact: function(node) { + if (node.nodeType !== 1) { + // Not a DOMElement, therefore not a React component + return false; + } + var id = ReactMount.getID(node); + return id ? id.charAt(0) === SEPARATOR : false; + }, + + /** + * Traverses up the ancestors of the supplied node to find a node that is a + * DOM representation of a React component. + * + * @param {*} node + * @return {?DOMEventTarget} + * @internal + */ + getFirstReactDOM: function(node) { + var current = node; + while (current && current.parentNode !== current) { + if (ReactMount.isRenderedByReact(current)) { + return current; + } + current = current.parentNode; + } + return null; + }, + + /** + * Finds a node with the supplied `targetID` inside of the supplied + * `ancestorNode`. Exploits the ID naming scheme to perform the search + * quickly. + * + * @param {DOMEventTarget} ancestorNode Search from this root. + * @pararm {string} targetID ID of the DOM representation of the component. + * @return {DOMEventTarget} DOM node with the supplied `targetID`. + * @internal + */ + findComponentRoot: function(ancestorNode, targetID) { + var firstChildren = findComponentRootReusableArray; + var childIndex = 0; + + var deepestAncestor = findDeepestCachedAncestor(targetID) || ancestorNode; + + firstChildren[0] = deepestAncestor.firstChild; + firstChildren.length = 1; + + while (childIndex < firstChildren.length) { + var child = firstChildren[childIndex++]; + var targetChild; + + while (child) { + var childID = ReactMount.getID(child); + if (childID) { + // Even if we find the node we're looking for, we finish looping + // through its siblings to ensure they're cached so that we don't have + // to revisit this node again. Otherwise, we make n^2 calls to getID + // when visiting the many children of a single node in order. + + if (targetID === childID) { + targetChild = child; + } else if (ReactInstanceHandles.isAncestorIDOf(childID, targetID)) { + // If we find a child whose ID is an ancestor of the given ID, + // then we can be sure that we only want to search the subtree + // rooted at this child, so we can throw out the rest of the + // search state. + firstChildren.length = childIndex = 0; + firstChildren.push(child.firstChild); + } + + } else { + // If this child had no ID, then there's a chance that it was + // injected automatically by the browser, as when a `` + // element sprouts an extra `` child as a side effect of + // `.innerHTML` parsing. Optimistically continue down this + // branch, but not before examining the other siblings. + firstChildren.push(child.firstChild); + } + + child = child.nextSibling; + } + + if (targetChild) { + // Emptying firstChildren/findComponentRootReusableArray is + // not necessary for correctness, but it helps the GC reclaim + // any nodes that were left at the end of the search. + firstChildren.length = 0; + + return targetChild; + } + } + + firstChildren.length = 0; + + ("production" !== process.env.NODE_ENV ? invariant( + false, + 'findComponentRoot(..., %s): Unable to find element. This probably ' + + 'means the DOM was unexpectedly mutated (e.g., by the browser), ' + + 'usually due to forgetting a when using tables, nesting tags ' + + 'like ,

    , or , or using non-SVG elements in an ' + + 'parent. ' + + 'Try inspecting the child nodes of the element with React ID `%s`.', + targetID, + ReactMount.getID(ancestorNode) + ) : invariant(false)); + }, + + + /** + * React ID utilities. + */ + + getReactRootID: getReactRootID, + + getID: getID, + + setID: setID, + + getNode: getNode, + + purgeID: purgeID + }; + + // Deprecations (remove for 0.13) + ReactMount.renderComponent = deprecated( + 'ReactMount', + 'renderComponent', + 'render', + this, + ReactMount.render + ); + + module.exports = ReactMount; + + /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(89))) + +/***/ }, +/* 61 */ +/***/ function(module, exports, __webpack_require__) { + + /** + * Copyright 2013-2014, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule ReactMultiChild + * @typechecks static-only + */ + + "use strict"; + + var ReactComponent = __webpack_require__(49); + var ReactMultiChildUpdateTypes = __webpack_require__(161); + + var flattenChildren = __webpack_require__(162); + var instantiateReactComponent = __webpack_require__(125); + var shouldUpdateReactComponent = __webpack_require__(128); + + /** + * Updating children of a component may trigger recursive updates. The depth is + * used to batch recursive updates to render markup more efficiently. + * + * @type {number} + * @private + */ + var updateDepth = 0; + + /** + * Queue of update configuration objects. + * + * Each object has a `type` property that is in `ReactMultiChildUpdateTypes`. + * + * @type {array} + * @private + */ + var updateQueue = []; + + /** + * Queue of markup to be rendered. + * + * @type {array} + * @private + */ + var markupQueue = []; + + /** + * Enqueues markup to be rendered and inserted at a supplied index. + * + * @param {string} parentID ID of the parent component. + * @param {string} markup Markup that renders into an element. + * @param {number} toIndex Destination index. + * @private + */ + function enqueueMarkup(parentID, markup, toIndex) { + // NOTE: Null values reduce hidden classes. + updateQueue.push({ + parentID: parentID, + parentNode: null, + type: ReactMultiChildUpdateTypes.INSERT_MARKUP, + markupIndex: markupQueue.push(markup) - 1, + textContent: null, + fromIndex: null, + toIndex: toIndex + }); + } + + /** + * Enqueues moving an existing element to another index. + * + * @param {string} parentID ID of the parent component. + * @param {number} fromIndex Source index of the existing element. + * @param {number} toIndex Destination index of the element. + * @private + */ + function enqueueMove(parentID, fromIndex, toIndex) { + // NOTE: Null values reduce hidden classes. + updateQueue.push({ + parentID: parentID, + parentNode: null, + type: ReactMultiChildUpdateTypes.MOVE_EXISTING, + markupIndex: null, + textContent: null, + fromIndex: fromIndex, + toIndex: toIndex + }); + } + + /** + * Enqueues removing an element at an index. + * + * @param {string} parentID ID of the parent component. + * @param {number} fromIndex Index of the element to remove. + * @private + */ + function enqueueRemove(parentID, fromIndex) { + // NOTE: Null values reduce hidden classes. + updateQueue.push({ + parentID: parentID, + parentNode: null, + type: ReactMultiChildUpdateTypes.REMOVE_NODE, + markupIndex: null, + textContent: null, + fromIndex: fromIndex, + toIndex: null + }); + } + + /** + * Enqueues setting the text content. + * + * @param {string} parentID ID of the parent component. + * @param {string} textContent Text content to set. + * @private + */ + function enqueueTextContent(parentID, textContent) { + // NOTE: Null values reduce hidden classes. + updateQueue.push({ + parentID: parentID, + parentNode: null, + type: ReactMultiChildUpdateTypes.TEXT_CONTENT, + markupIndex: null, + textContent: textContent, + fromIndex: null, + toIndex: null + }); + } + + /** + * Processes any enqueued updates. + * + * @private + */ + function processQueue() { + if (updateQueue.length) { + ReactComponent.BackendIDOperations.dangerouslyProcessChildrenUpdates( + updateQueue, + markupQueue + ); + clearQueue(); + } + } + + /** + * Clears any enqueued updates. + * + * @private + */ + function clearQueue() { + updateQueue.length = 0; + markupQueue.length = 0; + } + + /** + * ReactMultiChild are capable of reconciling multiple children. + * + * @class ReactMultiChild + * @internal + */ + var ReactMultiChild = { + + /** + * Provides common functionality for components that must reconcile multiple + * children. This is used by `ReactDOMComponent` to mount, update, and + * unmount child components. + * + * @lends {ReactMultiChild.prototype} + */ + Mixin: { + + /** + * Generates a "mount image" for each of the supplied children. In the case + * of `ReactDOMComponent`, a mount image is a string of markup. + * + * @param {?object} nestedChildren Nested child maps. + * @return {array} An array of mounted representations. + * @internal + */ + mountChildren: function(nestedChildren, transaction) { + var children = flattenChildren(nestedChildren); + var mountImages = []; + var index = 0; + this._renderedChildren = children; + for (var name in children) { + var child = children[name]; + if (children.hasOwnProperty(name)) { + // The rendered children must be turned into instances as they're + // mounted. + var childInstance = instantiateReactComponent(child, null); + children[name] = childInstance; + // Inlined for performance, see `ReactInstanceHandles.createReactID`. + var rootID = this._rootNodeID + name; + var mountImage = childInstance.mountComponent( + rootID, + transaction, + this._mountDepth + 1 + ); + childInstance._mountIndex = index; + mountImages.push(mountImage); + index++; + } + } + return mountImages; + }, + + /** + * Replaces any rendered children with a text content string. + * + * @param {string} nextContent String of content. + * @internal + */ + updateTextContent: function(nextContent) { + updateDepth++; + var errorThrown = true; + try { + var prevChildren = this._renderedChildren; + // Remove any rendered children. + for (var name in prevChildren) { + if (prevChildren.hasOwnProperty(name)) { + this._unmountChildByName(prevChildren[name], name); + } + } + // Set new text content. + this.setTextContent(nextContent); + errorThrown = false; + } finally { + updateDepth--; + if (!updateDepth) { + errorThrown ? clearQueue() : processQueue(); + } + } + }, + + /** + * Updates the rendered children with new children. + * + * @param {?object} nextNestedChildren Nested child maps. + * @param {ReactReconcileTransaction} transaction + * @internal + */ + updateChildren: function(nextNestedChildren, transaction) { + updateDepth++; + var errorThrown = true; + try { + this._updateChildren(nextNestedChildren, transaction); + errorThrown = false; + } finally { + updateDepth--; + if (!updateDepth) { + errorThrown ? clearQueue() : processQueue(); + } + } + }, + + /** + * Improve performance by isolating this hot code path from the try/catch + * block in `updateChildren`. + * + * @param {?object} nextNestedChildren Nested child maps. + * @param {ReactReconcileTransaction} transaction + * @final + * @protected + */ + _updateChildren: function(nextNestedChildren, transaction) { + var nextChildren = flattenChildren(nextNestedChildren); + var prevChildren = this._renderedChildren; + if (!nextChildren && !prevChildren) { + return; + } + var name; + // `nextIndex` will increment for each child in `nextChildren`, but + // `lastIndex` will be the last index visited in `prevChildren`. + var lastIndex = 0; + var nextIndex = 0; + for (name in nextChildren) { + if (!nextChildren.hasOwnProperty(name)) { + continue; + } + var prevChild = prevChildren && prevChildren[name]; + var prevElement = prevChild && prevChild._currentElement; + var nextElement = nextChildren[name]; + if (shouldUpdateReactComponent(prevElement, nextElement)) { + this.moveChild(prevChild, nextIndex, lastIndex); + lastIndex = Math.max(prevChild._mountIndex, lastIndex); + prevChild.receiveComponent(nextElement, transaction); + prevChild._mountIndex = nextIndex; + } else { + if (prevChild) { + // Update `lastIndex` before `_mountIndex` gets unset by unmounting. + lastIndex = Math.max(prevChild._mountIndex, lastIndex); + this._unmountChildByName(prevChild, name); + } + // The child must be instantiated before it's mounted. + var nextChildInstance = instantiateReactComponent( + nextElement, + null + ); + this._mountChildByNameAtIndex( + nextChildInstance, name, nextIndex, transaction + ); + } + nextIndex++; + } + // Remove children that are no longer present. + for (name in prevChildren) { + if (prevChildren.hasOwnProperty(name) && + !(nextChildren && nextChildren[name])) { + this._unmountChildByName(prevChildren[name], name); + } + } + }, + + /** + * Unmounts all rendered children. This should be used to clean up children + * when this component is unmounted. + * + * @internal + */ + unmountChildren: function() { + var renderedChildren = this._renderedChildren; + for (var name in renderedChildren) { + var renderedChild = renderedChildren[name]; + // TODO: When is this not true? + if (renderedChild.unmountComponent) { + renderedChild.unmountComponent(); + } + } + this._renderedChildren = null; + }, + + /** + * Moves a child component to the supplied index. + * + * @param {ReactComponent} child Component to move. + * @param {number} toIndex Destination index of the element. + * @param {number} lastIndex Last index visited of the siblings of `child`. + * @protected + */ + moveChild: function(child, toIndex, lastIndex) { + // If the index of `child` is less than `lastIndex`, then it needs to + // be moved. Otherwise, we do not need to move it because a child will be + // inserted or moved before `child`. + if (child._mountIndex < lastIndex) { + enqueueMove(this._rootNodeID, child._mountIndex, toIndex); + } + }, + + /** + * Creates a child component. + * + * @param {ReactComponent} child Component to create. + * @param {string} mountImage Markup to insert. + * @protected + */ + createChild: function(child, mountImage) { + enqueueMarkup(this._rootNodeID, mountImage, child._mountIndex); + }, + + /** + * Removes a child component. + * + * @param {ReactComponent} child Child to remove. + * @protected + */ + removeChild: function(child) { + enqueueRemove(this._rootNodeID, child._mountIndex); + }, + + /** + * Sets this text content string. + * + * @param {string} textContent Text content to set. + * @protected + */ + setTextContent: function(textContent) { + enqueueTextContent(this._rootNodeID, textContent); + }, + + /** + * Mounts a child with the supplied name. + * + * NOTE: This is part of `updateChildren` and is here for readability. + * + * @param {ReactComponent} child Component to mount. + * @param {string} name Name of the child. + * @param {number} index Index at which to insert the child. + * @param {ReactReconcileTransaction} transaction + * @private + */ + _mountChildByNameAtIndex: function(child, name, index, transaction) { + // Inlined for performance, see `ReactInstanceHandles.createReactID`. + var rootID = this._rootNodeID + name; + var mountImage = child.mountComponent( + rootID, + transaction, + this._mountDepth + 1 + ); + child._mountIndex = index; + this.createChild(child, mountImage); + this._renderedChildren = this._renderedChildren || {}; + this._renderedChildren[name] = child; + }, + + /** + * Unmounts a rendered child by name. + * + * NOTE: This is part of `updateChildren` and is here for readability. + * + * @param {ReactComponent} child Component to unmount. + * @param {string} name Name of the child in `this._renderedChildren`. + * @private + */ + _unmountChildByName: function(child, name) { + this.removeChild(child); + child._mountIndex = null; + child.unmountComponent(); + delete this._renderedChildren[name]; + } + + } + + }; + + module.exports = ReactMultiChild; + + +/***/ }, +/* 62 */ +/***/ function(module, exports, __webpack_require__) { + + /* WEBPACK VAR INJECTION */(function(process) {/** + * Copyright 2013-2014, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule ReactPerf + * @typechecks static-only + */ + + "use strict"; + + /** + * ReactPerf is a general AOP system designed to measure performance. This + * module only has the hooks: see ReactDefaultPerf for the analysis tool. + */ + var ReactPerf = { + /** + * Boolean to enable/disable measurement. Set to false by default to prevent + * accidental logging and perf loss. + */ + enableMeasure: false, + + /** + * Holds onto the measure function in use. By default, don't measure + * anything, but we'll override this if we inject a measure function. + */ + storedMeasure: _noMeasure, + + /** + * Use this to wrap methods you want to measure. Zero overhead in production. + * + * @param {string} objName + * @param {string} fnName + * @param {function} func + * @return {function} + */ + measure: function(objName, fnName, func) { + if ("production" !== process.env.NODE_ENV) { + var measuredFunc = null; + var wrapper = function() { + if (ReactPerf.enableMeasure) { + if (!measuredFunc) { + measuredFunc = ReactPerf.storedMeasure(objName, fnName, func); + } + return measuredFunc.apply(this, arguments); + } + return func.apply(this, arguments); + }; + wrapper.displayName = objName + '_' + fnName; + return wrapper; + } + return func; + }, + + injection: { + /** + * @param {function} measure + */ + injectMeasure: function(measure) { + ReactPerf.storedMeasure = measure; + } + } + }; + + /** + * Simply passes through the measured function, without measuring it. + * + * @param {string} objName + * @param {string} fnName + * @param {function} func + * @return {function} + */ + function _noMeasure(objName, fnName, func) { + return func; + } + + module.exports = ReactPerf; + + /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(89))) + +/***/ }, +/* 63 */ +/***/ function(module, exports, __webpack_require__) { + + /** + * Copyright 2013-2014, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule ReactPropTypes + */ + + "use strict"; + + var ReactElement = __webpack_require__(53); + var ReactPropTypeLocationNames = __webpack_require__(124); + + var deprecated = __webpack_require__(67); + var emptyFunction = __webpack_require__(163); + + /** + * Collection of methods that allow declaration and validation of props that are + * supplied to React components. Example usage: + * + * var Props = require('ReactPropTypes'); + * var MyArticle = React.createClass({ + * propTypes: { + * // An optional string prop named "description". + * description: Props.string, + * + * // A required enum prop named "category". + * category: Props.oneOf(['News','Photos']).isRequired, + * + * // A prop named "dialog" that requires an instance of Dialog. + * dialog: Props.instanceOf(Dialog).isRequired + * }, + * render: function() { ... } + * }); + * + * A more formal specification of how these methods are used: + * + * type := array|bool|func|object|number|string|oneOf([...])|instanceOf(...) + * decl := ReactPropTypes.{type}(.isRequired)? + * + * Each and every declaration produces a function with the same signature. This + * allows the creation of custom validation functions. For example: + * + * var MyLink = React.createClass({ + * propTypes: { + * // An optional string or URI prop named "href". + * href: function(props, propName, componentName) { + * var propValue = props[propName]; + * if (propValue != null && typeof propValue !== 'string' && + * !(propValue instanceof URI)) { + * return new Error( + * 'Expected a string or an URI for ' + propName + ' in ' + + * componentName + * ); + * } + * } + * }, + * render: function() {...} + * }); + * + * @internal + */ + + var ANONYMOUS = '<>'; + + var elementTypeChecker = createElementTypeChecker(); + var nodeTypeChecker = createNodeChecker(); + + var ReactPropTypes = { + array: createPrimitiveTypeChecker('array'), + bool: createPrimitiveTypeChecker('boolean'), + func: createPrimitiveTypeChecker('function'), + number: createPrimitiveTypeChecker('number'), + object: createPrimitiveTypeChecker('object'), + string: createPrimitiveTypeChecker('string'), + + any: createAnyTypeChecker(), + arrayOf: createArrayOfTypeChecker, + element: elementTypeChecker, + instanceOf: createInstanceTypeChecker, + node: nodeTypeChecker, + objectOf: createObjectOfTypeChecker, + oneOf: createEnumTypeChecker, + oneOfType: createUnionTypeChecker, + shape: createShapeTypeChecker, + + component: deprecated( + 'React.PropTypes', + 'component', + 'element', + this, + elementTypeChecker + ), + renderable: deprecated( + 'React.PropTypes', + 'renderable', + 'node', + this, + nodeTypeChecker + ) + }; + + function createChainableTypeChecker(validate) { + function checkType(isRequired, props, propName, componentName, location) { + componentName = componentName || ANONYMOUS; + if (props[propName] == null) { + var locationName = ReactPropTypeLocationNames[location]; + if (isRequired) { + return new Error( + ("Required " + locationName + " `" + propName + "` was not specified in ")+ + ("`" + componentName + "`.") + ); + } + } else { + return validate(props, propName, componentName, location); + } + } + + var chainedCheckType = checkType.bind(null, false); + chainedCheckType.isRequired = checkType.bind(null, true); + + return chainedCheckType; + } + + function createPrimitiveTypeChecker(expectedType) { + function validate(props, propName, componentName, location) { + var propValue = props[propName]; + var propType = getPropType(propValue); + if (propType !== expectedType) { + var locationName = ReactPropTypeLocationNames[location]; + // `propValue` being instance of, say, date/regexp, pass the 'object' + // check, but we can offer a more precise error message here rather than + // 'of type `object`'. + var preciseType = getPreciseType(propValue); + + return new Error( + ("Invalid " + locationName + " `" + propName + "` of type `" + preciseType + "` ") + + ("supplied to `" + componentName + "`, expected `" + expectedType + "`.") + ); + } + } + return createChainableTypeChecker(validate); + } + + function createAnyTypeChecker() { + return createChainableTypeChecker(emptyFunction.thatReturns()); + } + + function createArrayOfTypeChecker(typeChecker) { + function validate(props, propName, componentName, location) { + var propValue = props[propName]; + if (!Array.isArray(propValue)) { + var locationName = ReactPropTypeLocationNames[location]; + var propType = getPropType(propValue); + return new Error( + ("Invalid " + locationName + " `" + propName + "` of type ") + + ("`" + propType + "` supplied to `" + componentName + "`, expected an array.") + ); + } + for (var i = 0; i < propValue.length; i++) { + var error = typeChecker(propValue, i, componentName, location); + if (error instanceof Error) { + return error; + } + } + } + return createChainableTypeChecker(validate); + } + + function createElementTypeChecker() { + function validate(props, propName, componentName, location) { + if (!ReactElement.isValidElement(props[propName])) { + var locationName = ReactPropTypeLocationNames[location]; + return new Error( + ("Invalid " + locationName + " `" + propName + "` supplied to ") + + ("`" + componentName + "`, expected a ReactElement.") + ); + } + } + return createChainableTypeChecker(validate); + } + + function createInstanceTypeChecker(expectedClass) { + function validate(props, propName, componentName, location) { + if (!(props[propName] instanceof expectedClass)) { + var locationName = ReactPropTypeLocationNames[location]; + var expectedClassName = expectedClass.name || ANONYMOUS; + return new Error( + ("Invalid " + locationName + " `" + propName + "` supplied to ") + + ("`" + componentName + "`, expected instance of `" + expectedClassName + "`.") + ); + } + } + return createChainableTypeChecker(validate); + } + + function createEnumTypeChecker(expectedValues) { + function validate(props, propName, componentName, location) { + var propValue = props[propName]; + for (var i = 0; i < expectedValues.length; i++) { + if (propValue === expectedValues[i]) { + return; + } + } + + var locationName = ReactPropTypeLocationNames[location]; + var valuesString = JSON.stringify(expectedValues); + return new Error( + ("Invalid " + locationName + " `" + propName + "` of value `" + propValue + "` ") + + ("supplied to `" + componentName + "`, expected one of " + valuesString + ".") + ); + } + return createChainableTypeChecker(validate); + } + + function createObjectOfTypeChecker(typeChecker) { + function validate(props, propName, componentName, location) { + var propValue = props[propName]; + var propType = getPropType(propValue); + if (propType !== 'object') { + var locationName = ReactPropTypeLocationNames[location]; + return new Error( + ("Invalid " + locationName + " `" + propName + "` of type ") + + ("`" + propType + "` supplied to `" + componentName + "`, expected an object.") + ); + } + for (var key in propValue) { + if (propValue.hasOwnProperty(key)) { + var error = typeChecker(propValue, key, componentName, location); + if (error instanceof Error) { + return error; + } + } + } + } + return createChainableTypeChecker(validate); + } + + function createUnionTypeChecker(arrayOfTypeCheckers) { + function validate(props, propName, componentName, location) { + for (var i = 0; i < arrayOfTypeCheckers.length; i++) { + var checker = arrayOfTypeCheckers[i]; + if (checker(props, propName, componentName, location) == null) { + return; + } + } + + var locationName = ReactPropTypeLocationNames[location]; + return new Error( + ("Invalid " + locationName + " `" + propName + "` supplied to ") + + ("`" + componentName + "`.") + ); + } + return createChainableTypeChecker(validate); + } + + function createNodeChecker() { + function validate(props, propName, componentName, location) { + if (!isNode(props[propName])) { + var locationName = ReactPropTypeLocationNames[location]; + return new Error( + ("Invalid " + locationName + " `" + propName + "` supplied to ") + + ("`" + componentName + "`, expected a ReactNode.") + ); + } + } + return createChainableTypeChecker(validate); + } + + function createShapeTypeChecker(shapeTypes) { + function validate(props, propName, componentName, location) { + var propValue = props[propName]; + var propType = getPropType(propValue); + if (propType !== 'object') { + var locationName = ReactPropTypeLocationNames[location]; + return new Error( + ("Invalid " + locationName + " `" + propName + "` of type `" + propType + "` ") + + ("supplied to `" + componentName + "`, expected `object`.") + ); + } + for (var key in shapeTypes) { + var checker = shapeTypes[key]; + if (!checker) { + continue; + } + var error = checker(propValue, key, componentName, location); + if (error) { + return error; + } + } + } + return createChainableTypeChecker(validate, 'expected `object`'); + } + + function isNode(propValue) { + switch(typeof propValue) { + case 'number': + case 'string': + return true; + case 'boolean': + return !propValue; + case 'object': + if (Array.isArray(propValue)) { + return propValue.every(isNode); + } + if (ReactElement.isValidElement(propValue)) { + return true; + } + for (var k in propValue) { + if (!isNode(propValue[k])) { + return false; + } + } + return true; + default: + return false; + } + } + + // Equivalent of `typeof` but with special handling for array and regexp. + function getPropType(propValue) { + var propType = typeof propValue; + if (Array.isArray(propValue)) { + return 'array'; + } + if (propValue instanceof RegExp) { + // Old webkits (at least until Android 4.0) return 'function' rather than + // 'object' for typeof a RegExp. We'll normalize this here so that /bla/ + // passes PropTypes.object. + return 'object'; + } + return propType; + } + + // This handles more types than `getPropType`. Only used for error messages. + // See `createPrimitiveTypeChecker`. + function getPreciseType(propValue) { + var propType = getPropType(propValue); + if (propType === 'object') { + if (propValue instanceof Date) { + return 'date'; + } else if (propValue instanceof RegExp) { + return 'regexp'; + } + } + return propType; + } + + module.exports = ReactPropTypes; + + +/***/ }, +/* 64 */ +/***/ function(module, exports, __webpack_require__) { + + /* WEBPACK VAR INJECTION */(function(process) {/** + * Copyright 2013-2014, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @typechecks static-only + * @providesModule ReactServerRendering + */ + "use strict"; + + var ReactElement = __webpack_require__(53); + var ReactInstanceHandles = __webpack_require__(58); + var ReactMarkupChecksum = __webpack_require__(164); + var ReactServerRenderingTransaction = + __webpack_require__(165); + + var instantiateReactComponent = __webpack_require__(125); + var invariant = __webpack_require__(79); + + /** + * @param {ReactElement} element + * @return {string} the HTML markup + */ + function renderToString(element) { + ("production" !== process.env.NODE_ENV ? invariant( + ReactElement.isValidElement(element), + 'renderToString(): You must pass a valid ReactElement.' + ) : invariant(ReactElement.isValidElement(element))); + + var transaction; + try { + var id = ReactInstanceHandles.createReactRootID(); + transaction = ReactServerRenderingTransaction.getPooled(false); + + return transaction.perform(function() { + var componentInstance = instantiateReactComponent(element, null); + var markup = componentInstance.mountComponent(id, transaction, 0); + return ReactMarkupChecksum.addChecksumToMarkup(markup); + }, null); + } finally { + ReactServerRenderingTransaction.release(transaction); + } + } + + /** + * @param {ReactElement} element + * @return {string} the HTML markup, without the extra React ID and checksum + * (for generating static pages) + */ + function renderToStaticMarkup(element) { + ("production" !== process.env.NODE_ENV ? invariant( + ReactElement.isValidElement(element), + 'renderToStaticMarkup(): You must pass a valid ReactElement.' + ) : invariant(ReactElement.isValidElement(element))); + + var transaction; + try { + var id = ReactInstanceHandles.createReactRootID(); + transaction = ReactServerRenderingTransaction.getPooled(true); + + return transaction.perform(function() { + var componentInstance = instantiateReactComponent(element, null); + return componentInstance.mountComponent(id, transaction, 0); + }, null); + } finally { + ReactServerRenderingTransaction.release(transaction); + } + } + + module.exports = { + renderToString: renderToString, + renderToStaticMarkup: renderToStaticMarkup + }; + + /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(89))) + +/***/ }, +/* 65 */ +/***/ function(module, exports, __webpack_require__) { + + /** + * Copyright 2013-2014, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule ReactTextComponent + * @typechecks static-only + */ + + "use strict"; + + var DOMPropertyOperations = __webpack_require__(46); + var ReactComponent = __webpack_require__(49); + var ReactElement = __webpack_require__(53); + + var assign = __webpack_require__(66); + var escapeTextForBrowser = __webpack_require__(113); + + /** + * Text nodes violate a couple assumptions that React makes about components: + * + * - When mounting text into the DOM, adjacent text nodes are merged. + * - Text nodes cannot be assigned a React root ID. + * + * This component is used to wrap strings in elements so that they can undergo + * the same reconciliation that is applied to elements. + * + * TODO: Investigate representing React components in the DOM with text nodes. + * + * @class ReactTextComponent + * @extends ReactComponent + * @internal + */ + var ReactTextComponent = function(props) { + // This constructor and it's argument is currently used by mocks. + }; + + assign(ReactTextComponent.prototype, ReactComponent.Mixin, { + + /** + * Creates the markup for this text node. This node is not intended to have + * any features besides containing text content. + * + * @param {string} rootID DOM ID of the root node. + * @param {ReactReconcileTransaction|ReactServerRenderingTransaction} transaction + * @param {number} mountDepth number of components in the owner hierarchy + * @return {string} Markup for this text node. + * @internal + */ + mountComponent: function(rootID, transaction, mountDepth) { + ReactComponent.Mixin.mountComponent.call( + this, + rootID, + transaction, + mountDepth + ); + + var escapedText = escapeTextForBrowser(this.props); + + if (transaction.renderToStaticMarkup) { + // Normally we'd wrap this in a `span` for the reasons stated above, but + // since this is a situation where React won't take over (static pages), + // we can simply return the text as it is. + return escapedText; + } + + return ( + '' + + escapedText + + '' + ); + }, + + /** + * Updates this component by updating the text content. + * + * @param {object} nextComponent Contains the next text content. + * @param {ReactReconcileTransaction} transaction + * @internal + */ + receiveComponent: function(nextComponent, transaction) { + var nextProps = nextComponent.props; + if (nextProps !== this.props) { + this.props = nextProps; + ReactComponent.BackendIDOperations.updateTextContentByID( + this._rootNodeID, + nextProps + ); + } + } + + }); + + var ReactTextComponentFactory = function(text) { + // Bypass validation and configuration + return new ReactElement(ReactTextComponent, null, null, null, null, text); + }; + + ReactTextComponentFactory.type = ReactTextComponent; + + module.exports = ReactTextComponentFactory; + + +/***/ }, +/* 66 */ +/***/ function(module, exports, __webpack_require__) { + + /** + * Copyright 2014, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule Object.assign + */ + + // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.assign + + function assign(target, sources) { + if (target == null) { + throw new TypeError('Object.assign target cannot be null or undefined'); + } + + var to = Object(target); + var hasOwnProperty = Object.prototype.hasOwnProperty; + + for (var nextIndex = 1; nextIndex < arguments.length; nextIndex++) { + var nextSource = arguments[nextIndex]; + if (nextSource == null) { + continue; + } + + var from = Object(nextSource); + + // We don't currently support accessors nor proxies. Therefore this + // copy cannot throw. If we ever supported this then we must handle + // exceptions and side-effects. We don't support symbols so they won't + // be transferred. + + for (var key in from) { + if (hasOwnProperty.call(from, key)) { + to[key] = from[key]; + } + } + } + + return to; + }; + + module.exports = assign; + + +/***/ }, +/* 67 */ +/***/ function(module, exports, __webpack_require__) { + + /* WEBPACK VAR INJECTION */(function(process) {/** + * Copyright 2013-2014, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule deprecated + */ + + var assign = __webpack_require__(66); + var warning = __webpack_require__(78); + + /** + * This will log a single deprecation notice per function and forward the call + * on to the new API. + * + * @param {string} namespace The namespace of the call, eg 'React' + * @param {string} oldName The old function name, eg 'renderComponent' + * @param {string} newName The new function name, eg 'render' + * @param {*} ctx The context this forwarded call should run in + * @param {function} fn The function to forward on to + * @return {*} Will be the value as returned from `fn` + */ + function deprecated(namespace, oldName, newName, ctx, fn) { + var warned = false; + if ("production" !== process.env.NODE_ENV) { + var newFn = function() { + ("production" !== process.env.NODE_ENV ? warning( + warned, + (namespace + "." + oldName + " will be deprecated in a future version. ") + + ("Use " + namespace + "." + newName + " instead.") + ) : null); + warned = true; + return fn.apply(ctx, arguments); + }; + newFn.displayName = (namespace + "_" + oldName); + // We need to make sure all properties of the original fn are copied over. + // In particular, this is needed to support PropTypes + return assign(newFn, fn); + } + + return fn; + } + + module.exports = deprecated; + + /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(89))) + +/***/ }, +/* 68 */ +/***/ function(module, exports, __webpack_require__) { + + /* WEBPACK VAR INJECTION */(function(process) {/** + * Copyright 2013-2014, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule onlyChild + */ + "use strict"; + + var ReactElement = __webpack_require__(53); + + var invariant = __webpack_require__(79); + + /** + * Returns the first child in a collection of children and verifies that there + * is only one child in the collection. The current implementation of this + * function assumes that a single child gets passed without a wrapper, but the + * purpose of this helper function is to abstract away the particular structure + * of children. + * + * @param {?object} children Child collection structure. + * @return {ReactComponent} The first and only `ReactComponent` contained in the + * structure. + */ + function onlyChild(children) { + ("production" !== process.env.NODE_ENV ? invariant( + ReactElement.isValidElement(children), + 'onlyChild must be passed a children with exactly one child.' + ) : invariant(ReactElement.isValidElement(children))); + return children; + } + + module.exports = onlyChild; + + /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(89))) + +/***/ }, +/* 69 */ +/***/ function(module, exports, __webpack_require__) { + + /** + * Copyright 2013-2014, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule ExecutionEnvironment + */ + + /*jslint evil: true */ + + "use strict"; + + var canUseDOM = !!( + typeof window !== 'undefined' && + window.document && + window.document.createElement + ); + + /** + * Simple, lightweight module assisting with the detection and context of + * Worker. Helps avoid circular dependencies and allows code to reason about + * whether or not they are in a Worker, even if they never include the main + * `ReactWorker` dependency. + */ + var ExecutionEnvironment = { + + canUseDOM: canUseDOM, + + canUseWorkers: typeof Worker !== 'undefined', + + canUseEventListeners: + canUseDOM && !!(window.addEventListener || window.attachEvent), + + canUseViewport: canUseDOM && !!window.screen, + + isInWorker: !canUseDOM // For now, this is true - might change in the future. + + }; + + module.exports = ExecutionEnvironment; + + +/***/ }, +/* 70 */ +/***/ function(module, exports, __webpack_require__) { + + "use strict"; + + var _interopRequire = function (obj) { return obj && obj.__esModule ? obj["default"] : obj; }; + + var reqwest = _interopRequire(__webpack_require__(90)); + + var parseLinkHeader = _interopRequire(__webpack_require__(45)); + + var startsWith = _interopRequire(__webpack_require__(166)); + + var path = _interopRequire(__webpack_require__(184)); + + var API_ROOT_URL = "https://api.github.com"; + + module.exports = gitHubAPI; + + + function gitHubAPI(url) { + var requestUrl = startsWith(url, API_ROOT_URL) ? url : path.join(API_ROOT_URL, url); + var req = reqwest({ + url: requestUrl, + type: "json" + }).then(function (apiData) { + return { + results: apiData, + url: url, + pagination: parseLinkHeader(req.request.getResponseHeader("Link")) + }; + }); + + return req; + } + +/***/ }, +/* 71 */ +/***/ function(module, exports, __webpack_require__) { + + var invariant = __webpack_require__(79); + + var FakeNode = { + + render: function () { + invariant( + false, + '%s elements should not be rendered', + this.constructor.displayName + ); + } + + }; + + module.exports = FakeNode; + + +/***/ }, +/* 72 */ +/***/ function(module, exports, __webpack_require__) { + + var PropTypes = { + + /** + * Requires that the value of a prop be falsy. + */ + falsy: function (props, propName, componentName) { + if (props[propName]) + return new Error('<' + componentName + '> may not have a "' + propName + '" prop'); + } + + }; + + module.exports = PropTypes; + + +/***/ }, +/* 73 */ +/***/ function(module, exports, __webpack_require__) { + + /** + * Copyright 2013-2014, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule cx + */ + + /** + * This function is used to mark string literals representing CSS class names + * so that they can be transformed statically. This allows for modularization + * and minification of CSS class names. + * + * In static_upstream, this function is actually implemented, but it should + * eventually be replaced with something more descriptive, and the transform + * that is used in the main stack should be ported for use elsewhere. + * + * @param string|object className to modularize, or an object of key/values. + * In the object case, the values are conditions that + * determine if the className keys should be included. + * @param [string ...] Variable list of classNames in the string case. + * @return string Renderable space-separated CSS className. + */ + function cx(classNames) { + if (typeof classNames == 'object') { + return Object.keys(classNames).filter(function(className) { + return classNames[className]; + }).join(' '); + } else { + return Array.prototype.join.call(arguments, ' '); + } + } + + module.exports = cx; + + +/***/ }, +/* 74 */ +/***/ function(module, exports, __webpack_require__) { + + var React = __webpack_require__(4); + + module.exports = { + contextTypes: { + getRouteAtDepth: React.PropTypes.func.isRequired, + getRouteComponents: React.PropTypes.func.isRequired, + routeHandlers: React.PropTypes.array.isRequired + }, + + childContextTypes: { + routeHandlers: React.PropTypes.array.isRequired + }, + + getChildContext: function () { + return { + routeHandlers: this.context.routeHandlers.concat([ this ]) + }; + }, + + getRouteDepth: function () { + return this.context.routeHandlers.length - 1; + }, + + componentDidMount: function () { + this._updateRouteComponent(); + }, + + componentDidUpdate: function () { + this._updateRouteComponent(); + }, + + _updateRouteComponent: function () { + var depth = this.getRouteDepth(); + var components = this.context.getRouteComponents(); + components[depth] = this.refs[this.props.ref || '__routeHandler__']; + }, + + getRouteHandler: function (props) { + var route = this.context.getRouteAtDepth(this.getRouteDepth()); + return route ? React.createElement(route.handler, props || this.props) : null; + } + }; + +/***/ }, +/* 75 */ +/***/ function(module, exports, __webpack_require__) { + + /** + * Actions that modify the URL. + */ + var LocationActions = { + + /** + * Indicates a new location is being pushed to the history stack. + */ + PUSH: 'push', + + /** + * Indicates the current location should be replaced. + */ + REPLACE: 'replace', + + /** + * Indicates the most recent entry should be removed from the history stack. + */ + POP: 'pop' + + }; + + module.exports = LocationActions; + + +/***/ }, +/* 76 */ +/***/ function(module, exports, __webpack_require__) { + + var invariant = __webpack_require__(79); + var merge = __webpack_require__(202).merge; + var qs = __webpack_require__(201); + + var paramCompileMatcher = /:([a-zA-Z_$][a-zA-Z0-9_$]*)|[*.()\[\]\\+|{}^$]/g; + var paramInjectMatcher = /:([a-zA-Z_$][a-zA-Z0-9_$?]*[?]?)|[*]/g; + var paramInjectTrailingSlashMatcher = /\/\/\?|\/\?/g; + var queryMatcher = /\?(.+)/; + + var _compiledPatterns = {}; + + function compilePattern(pattern) { + if (!(pattern in _compiledPatterns)) { + var paramNames = []; + var source = pattern.replace(paramCompileMatcher, function (match, paramName) { + if (paramName) { + paramNames.push(paramName); + return '([^/?#]+)'; + } else if (match === '*') { + paramNames.push('splat'); + return '(.*?)'; + } else { + return '\\' + match; + } + }); + + _compiledPatterns[pattern] = { + matcher: new RegExp('^' + source + '$', 'i'), + paramNames: paramNames + }; + } + + return _compiledPatterns[pattern]; + } + + var Path = { + + /** + * Safely decodes special characters in the given URL path. + */ + decode: function (path) { + return decodeURI(path.replace(/\+/g, ' ')); + }, + + /** + * Safely encodes special characters in the given URL path. + */ + encode: function (path) { + return encodeURI(path).replace(/%20/g, '+'); + }, + + /** + * Returns an array of the names of all parameters in the given pattern. + */ + extractParamNames: function (pattern) { + return compilePattern(pattern).paramNames; + }, + + /** + * Extracts the portions of the given URL path that match the given pattern + * and returns an object of param name => value pairs. Returns null if the + * pattern does not match the given path. + */ + extractParams: function (pattern, path) { + var object = compilePattern(pattern); + var match = path.match(object.matcher); + + if (!match) + return null; + + var params = {}; + + object.paramNames.forEach(function (paramName, index) { + params[paramName] = match[index + 1]; + }); + + return params; + }, + + /** + * Returns a version of the given route path with params interpolated. Throws + * if there is a dynamic segment of the route path for which there is no param. + */ + injectParams: function (pattern, params) { + params = params || {}; + + var splatIndex = 0; + + return pattern.replace(paramInjectMatcher, function (match, paramName) { + paramName = paramName || 'splat'; + + // If param is optional don't check for existence + if (paramName.slice(-1) !== '?') { + invariant( + params[paramName] != null, + 'Missing "' + paramName + '" parameter for path "' + pattern + '"' + ); + } else { + paramName = paramName.slice(0, -1); + + if (params[paramName] == null) + return ''; + } + + var segment; + if (paramName === 'splat' && Array.isArray(params[paramName])) { + segment = params[paramName][splatIndex++]; + + invariant( + segment != null, + 'Missing splat # ' + splatIndex + ' for path "' + pattern + '"' + ); + } else { + segment = params[paramName]; + } + + return segment; + }).replace(paramInjectTrailingSlashMatcher, '/'); + }, + + /** + * Returns an object that is the result of parsing any query string contained + * in the given path, null if the path contains no query string. + */ + extractQuery: function (path) { + var match = path.match(queryMatcher); + return match && qs.parse(match[1]); + }, + + /** + * Returns a version of the given path without the query string. + */ + withoutQuery: function (path) { + return path.replace(queryMatcher, ''); + }, + + /** + * Returns a version of the given path with the parameters in the given + * query merged into the query string. + */ + withQuery: function (path, query) { + var existingQuery = Path.extractQuery(path); + + if (existingQuery) + query = query ? merge(existingQuery, query) : existingQuery; + + var queryString = query && qs.stringify(query); + + if (queryString) + return Path.withoutQuery(path) + '?' + queryString; + + return path; + }, + + /** + * Returns true if the given path is absolute. + */ + isAbsolute: function (path) { + return path.charAt(0) === '/'; + }, + + /** + * Returns a normalized version of the given path. + */ + normalize: function (path, parentRoute) { + return path.replace(/^\/*/, '/'); + }, + + /** + * Joins two URL paths together. + */ + join: function (a, b) { + return a.replace(/\/*$/, '/') + b; + } + + }; + + module.exports = Path; + + +/***/ }, +/* 77 */ +/***/ function(module, exports, __webpack_require__) { + + exports.ActionMethods = __webpack_require__(167); + + exports.ListenerMethods = __webpack_require__(168); + + exports.PublisherMethods = __webpack_require__(169); + + exports.StoreMethods = __webpack_require__(170); + + exports.createAction = __webpack_require__(171); + + exports.createStore = __webpack_require__(172); + + exports.connect = __webpack_require__(173); + + exports.ListenerMixin = __webpack_require__(174); + + exports.listenTo = __webpack_require__(175); + + exports.listenToMany = __webpack_require__(176); + + + var maker = __webpack_require__(177).staticJoinCreator; + + exports.joinTrailing = exports.all = maker("last"); // Reflux.all alias for backward compatibility + + exports.joinLeading = maker("first"); + + exports.joinStrict = maker("strict"); + + exports.joinConcat = maker("all"); + + var _ = __webpack_require__(178); + + /** + * Convenience function for creating a set of actions + * + * @param definitions the definitions for the actions to be created + * @returns an object with actions of corresponding action names + */ + exports.createActions = function(definitions) { + var actions = {}; + for (var k in definitions){ + var val = definitions[k], + actionName = _.isObject(val) ? k : val; + + actions[actionName] = exports.createAction(val); + } + return actions; + }; + + /** + * Sets the eventmitter that Reflux uses + */ + exports.setEventEmitter = function(ctx) { + var _ = __webpack_require__(178); + _.EventEmitter = ctx; + }; + + + /** + * Sets the Promise library that Reflux uses + */ + exports.setPromise = function(ctx) { + var _ = __webpack_require__(178); + _.Promise = ctx; + }; + + /** + * Sets the Promise factory that creates new promises + * @param {Function} factory has the signature `function(resolver) { return [new Promise]; }` + */ + exports.setPromiseFactory = function(factory) { + var _ = __webpack_require__(178); + _.createPromise = factory; + }; + + + /** + * Sets the method used for deferring actions and stores + */ + exports.nextTick = function(nextTick) { + var _ = __webpack_require__(178); + _.nextTick = nextTick; + }; + + /** + * Provides the set of created actions and stores for introspection + */ + exports.__keep = __webpack_require__(179); + + /** + * Warn if Function.prototype.bind not available + */ + if (!Function.prototype.bind) { + console.error( + 'Function.prototype.bind not available. ' + + 'ES5 shim required. ' + + 'https://github.com/spoike/refluxjs#es5' + ); + } + + +/***/ }, +/* 78 */ +/***/ function(module, exports, __webpack_require__) { + + /* WEBPACK VAR INJECTION */(function(process) {/** + * Copyright 2014, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule warning + */ + + "use strict"; + + var emptyFunction = __webpack_require__(163); + + /** + * Similar to invariant but only logs a warning if the condition is not met. + * This can be used to log issues in development environments in critical + * paths. Removing the logging code for production environments will keep the + * same logic and follow the same code paths. + */ + + var warning = emptyFunction; + + if ("production" !== process.env.NODE_ENV) { + warning = function(condition, format ) {for (var args=[],$__0=2,$__1=arguments.length;$__0<$__1;$__0++) args.push(arguments[$__0]); + if (format === undefined) { + throw new Error( + '`warning(condition, format, ...args)` requires a warning ' + + 'message argument' + ); + } + + if (!condition) { + var argIndex = 0; + console.warn('Warning: ' + format.replace(/%s/g, function() {return args[argIndex++];})); + } + }; + } + + module.exports = warning; + + /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(89))) + +/***/ }, +/* 79 */ +/***/ function(module, exports, __webpack_require__) { + + /* WEBPACK VAR INJECTION */(function(process) {/** + * Copyright 2013-2014, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule invariant + */ + + "use strict"; + + /** + * Use invariant() to assert state which your program assumes to be true. + * + * Provide sprintf-style format (only %s is supported) and arguments + * to provide information about what broke and what you were + * expecting. + * + * The invariant message will be stripped in production, but the invariant + * will remain to ensure logic does not differ in production. + */ + + var invariant = function(condition, format, a, b, c, d, e, f) { + if ("production" !== process.env.NODE_ENV) { + if (format === undefined) { + throw new Error('invariant requires an error message argument'); + } + } + + if (!condition) { + var error; + if (format === undefined) { + error = new Error( + 'Minified exception occurred; use the non-minified dev environment ' + + 'for the full error message and additional helpful warnings.' + ); + } else { + var args = [a, b, c, d, e, f]; + var argIndex = 0; + error = new Error( + 'Invariant Violation: ' + + format.replace(/%s/g, function() { return args[argIndex++]; }) + ); + } + + error.framesToPop = 1; // we don't care about invariant's own frame + throw error; + } + }; + + module.exports = invariant; + + /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(89))) + +/***/ }, +/* 80 */ +/***/ function(module, exports, __webpack_require__) { + + var React = __webpack_require__(4); + + /** + * Provides the router with context for Router.Navigation. + */ + var NavigationContext = { + + childContextTypes: { + makePath: React.PropTypes.func.isRequired, + makeHref: React.PropTypes.func.isRequired, + transitionTo: React.PropTypes.func.isRequired, + replaceWith: React.PropTypes.func.isRequired, + goBack: React.PropTypes.func.isRequired + }, + + getChildContext: function () { + return { + makePath: this.constructor.makePath, + makeHref: this.constructor.makeHref, + transitionTo: this.constructor.transitionTo, + replaceWith: this.constructor.replaceWith, + goBack: this.constructor.goBack + }; + } + + }; + + module.exports = NavigationContext; + + +/***/ }, +/* 81 */ +/***/ function(module, exports, __webpack_require__) { + + var React = __webpack_require__(4); + var assign = __webpack_require__(66); + var Path = __webpack_require__(76); + + function routeIsActive(activeRoutes, routeName) { + return activeRoutes.some(function (route) { + return route.name === routeName; + }); + } + + function paramsAreActive(activeParams, params) { + for (var property in params) + if (String(activeParams[property]) !== String(params[property])) + return false; + + return true; + } + + function queryIsActive(activeQuery, query) { + for (var property in query) + if (String(activeQuery[property]) !== String(query[property])) + return false; + + return true; + } + + /** + * Provides the router with context for Router.State. + */ + var StateContext = { + + /** + * Returns the current URL path + query string. + */ + getCurrentPath: function () { + return this.state.path; + }, + + /** + * Returns a read-only array of the currently active routes. + */ + getCurrentRoutes: function () { + return this.state.routes.slice(0); + }, + + /** + * Returns the current URL path without the query string. + */ + getCurrentPathname: function () { + return this.state.pathname; + }, + + /** + * Returns a read-only object of the currently active URL parameters. + */ + getCurrentParams: function () { + return assign({}, this.state.params); + }, + + /** + * Returns a read-only object of the currently active query parameters. + */ + getCurrentQuery: function () { + return assign({}, this.state.query); + }, + + /** + * Returns true if the given route, params, and query are active. + */ + isActive: function (to, params, query) { + if (Path.isAbsolute(to)) + return to === this.state.path; + + return routeIsActive(this.state.routes, to) && + paramsAreActive(this.state.params, params) && + (query == null || queryIsActive(this.state.query, query)); + }, + + childContextTypes: { + getCurrentPath: React.PropTypes.func.isRequired, + getCurrentRoutes: React.PropTypes.func.isRequired, + getCurrentPathname: React.PropTypes.func.isRequired, + getCurrentParams: React.PropTypes.func.isRequired, + getCurrentQuery: React.PropTypes.func.isRequired, + isActive: React.PropTypes.func.isRequired + }, + + getChildContext: function () { + return { + getCurrentPath: this.getCurrentPath, + getCurrentRoutes: this.getCurrentRoutes, + getCurrentPathname: this.getCurrentPathname, + getCurrentParams: this.getCurrentParams, + getCurrentQuery: this.getCurrentQuery, + isActive: this.isActive + }; + } + + }; + + module.exports = StateContext; + + +/***/ }, +/* 82 */ +/***/ function(module, exports, __webpack_require__) { + + var invariant = __webpack_require__(79); + var canUseDOM = __webpack_require__(69).canUseDOM; + var getWindowScrollPosition = __webpack_require__(180); + + function shouldUpdateScroll(state, prevState) { + if (!prevState) + return true; + + // Don't update scroll position when only the query has changed. + if (state.pathname === prevState.pathname) + return false; + + var routes = state.routes; + var prevRoutes = prevState.routes; + + var sharedAncestorRoutes = routes.filter(function (route) { + return prevRoutes.indexOf(route) !== -1; + }); + + return !sharedAncestorRoutes.some(function (route) { + return route.ignoreScrollBehavior; + }); + } + + /** + * Provides the router with the ability to manage window scroll position + * according to its scroll behavior. + */ + var Scrolling = { + + statics: { + /** + * Records curent scroll position as the last known position for the given URL path. + */ + recordScrollPosition: function (path) { + if (!this.scrollHistory) + this.scrollHistory = {}; + + this.scrollHistory[path] = getWindowScrollPosition(); + }, + + /** + * Returns the last known scroll position for the given URL path. + */ + getScrollPosition: function (path) { + if (!this.scrollHistory) + this.scrollHistory = {}; + + return this.scrollHistory[path] || null; + } + }, + + componentWillMount: function () { + invariant( + this.getScrollBehavior() == null || canUseDOM, + 'Cannot use scroll behavior without a DOM' + ); + }, + + componentDidMount: function () { + this._updateScroll(); + }, + + componentDidUpdate: function (prevProps, prevState) { + this._updateScroll(prevState); + }, + + _updateScroll: function (prevState) { + if (!shouldUpdateScroll(this.state, prevState)) + return; + + var scrollBehavior = this.getScrollBehavior(); + + if (scrollBehavior) + scrollBehavior.updateScrollPosition( + this.constructor.getScrollPosition(this.state.path), + this.state.action + ); + } + + }; + + module.exports = Scrolling; + + +/***/ }, +/* 83 */ +/***/ function(module, exports, __webpack_require__) { + + /* jshint -W084 */ + var React = __webpack_require__(4); + var warning = __webpack_require__(78); + var invariant = __webpack_require__(79); + var DefaultRoute = __webpack_require__(19); + var NotFoundRoute = __webpack_require__(21); + var Redirect = __webpack_require__(22); + var Route = __webpack_require__(23); + var Path = __webpack_require__(76); + + var CONFIG_ELEMENT_TYPES = [ + DefaultRoute.type, + NotFoundRoute.type, + Redirect.type, + Route.type + ]; + + function createRedirectHandler(to, _params, _query) { + return React.createClass({ + statics: { + willTransitionTo: function (transition, params, query) { + transition.redirect(to, _params || params, _query || query); + } + }, + + render: function () { + return null; + } + }); + } + + function checkPropTypes(componentName, propTypes, props) { + for (var propName in propTypes) { + if (propTypes.hasOwnProperty(propName)) { + var error = propTypes[propName](props, propName, componentName); + + if (error instanceof Error) + warning(false, error.message); + } + } + } + + function createRoute(element, parentRoute, namedRoutes) { + var type = element.type; + var props = element.props; + var componentName = (type && type.displayName) || 'UnknownComponent'; + + invariant( + CONFIG_ELEMENT_TYPES.indexOf(type) !== -1, + 'Unrecognized route configuration element "<%s>"', + componentName + ); + + if (type.propTypes) + checkPropTypes(componentName, type.propTypes, props); + + var route = { name: props.name }; + + if (props.ignoreScrollBehavior) { + route.ignoreScrollBehavior = true; + } + + if (type === Redirect.type) { + route.handler = createRedirectHandler(props.to, props.params, props.query); + props.path = props.path || props.from || '*'; + } else { + route.handler = props.handler; + } + + var parentPath = (parentRoute && parentRoute.path) || '/'; + + if ((props.path || props.name) && type !== DefaultRoute.type && type !== NotFoundRoute.type) { + var path = props.path || props.name; + + // Relative paths extend their parent. + if (!Path.isAbsolute(path)) + path = Path.join(parentPath, path); + + route.path = Path.normalize(path); + } else { + route.path = parentPath; + + if (type === NotFoundRoute.type) + route.path += '*'; + } + + route.paramNames = Path.extractParamNames(route.path); + + // Make sure the route's path has all params its parent needs. + if (parentRoute && Array.isArray(parentRoute.paramNames)) { + parentRoute.paramNames.forEach(function (paramName) { + invariant( + route.paramNames.indexOf(paramName) !== -1, + 'The nested route path "%s" is missing the "%s" parameter of its parent path "%s"', + route.path, paramName, parentRoute.path + ); + }); + } + + // Make sure the route can be looked up by s. + if (props.name) { + invariant( + namedRoutes[props.name] == null, + 'You cannot use the name "%s" for more than one route', + props.name + ); + + namedRoutes[props.name] = route; + } + + // Handle . + if (type === NotFoundRoute.type) { + invariant( + parentRoute, + ' must have a parent ' + ); + + invariant( + parentRoute.notFoundRoute == null, + 'You may not have more than one per ' + ); + + parentRoute.notFoundRoute = route; + + return null; + } + + // Handle . + if (type === DefaultRoute.type) { + invariant( + parentRoute, + ' must have a parent ' + ); + + invariant( + parentRoute.defaultRoute == null, + 'You may not have more than one per ' + ); + + parentRoute.defaultRoute = route; + + return null; + } + + route.childRoutes = createRoutesFromChildren(props.children, route, namedRoutes); + + return route; + } + + /** + * Creates and returns an array of route objects from the given ReactChildren. + */ + function createRoutesFromChildren(children, parentRoute, namedRoutes) { + var routes = []; + + React.Children.forEach(children, function (child) { + // Exclude s and s. + if (child = createRoute(child, parentRoute, namedRoutes)) + routes.push(child); + }); + + return routes; + } + + module.exports = createRoutesFromChildren; + + +/***/ }, +/* 84 */ +/***/ function(module, exports, __webpack_require__) { + + function supportsHistory() { + /*! taken from modernizr + * https://github.com/Modernizr/Modernizr/blob/master/LICENSE + * https://github.com/Modernizr/Modernizr/blob/master/feature-detects/history.js + * changed to avoid false negatives for Windows Phones: https://github.com/rackt/react-router/issues/586 + */ + var ua = navigator.userAgent; + if ((ua.indexOf('Android 2.') !== -1 || + (ua.indexOf('Android 4.0') !== -1)) && + ua.indexOf('Mobile Safari') !== -1 && + ua.indexOf('Chrome') === -1 && + ua.indexOf('Windows Phone') === -1) { + return false; + } + return (window.history && 'pushState' in window.history); + } + + module.exports = supportsHistory; + + +/***/ }, +/* 85 */ +/***/ function(module, exports, __webpack_require__) { + + var assign = __webpack_require__(66); + var reversedArray = __webpack_require__(181); + var Redirect = __webpack_require__(86); + var Promise = __webpack_require__(182); + + /** + * Runs all hook functions serially and calls callback(error) when finished. + * A hook may return a promise if it needs to execute asynchronously. + */ + function runHooks(hooks, callback) { + var promise; + try { + promise = hooks.reduce(function (promise, hook) { + // The first hook to use transition.wait makes the rest + // of the transition async from that point forward. + return promise ? promise.then(hook) : hook(); + }, null); + } catch (error) { + return callback(error); // Sync error. + } + + if (promise) { + // Use setTimeout to break the promise chain. + promise.then(function () { + setTimeout(callback); + }, function (error) { + setTimeout(function () { + callback(error); + }); + }); + } else { + callback(); + } + } + + /** + * Calls the willTransitionFrom hook of all handlers in the given matches + * serially in reverse with the transition object and the current instance of + * the route's handler, so that the deepest nested handlers are called first. + * Calls callback(error) when finished. + */ + function runTransitionFromHooks(transition, routes, components, callback) { + components = reversedArray(components); + + var hooks = reversedArray(routes).map(function (route, index) { + return function () { + var handler = route.handler; + + if (!transition.isAborted && handler.willTransitionFrom) + return handler.willTransitionFrom(transition, components[index]); + + var promise = transition._promise; + transition._promise = null; + + return promise; + }; + }); + + runHooks(hooks, callback); + } + + /** + * Calls the willTransitionTo hook of all handlers in the given matches + * serially with the transition object and any params that apply to that + * handler. Calls callback(error) when finished. + */ + function runTransitionToHooks(transition, routes, params, query, callback) { + var hooks = routes.map(function (route) { + return function () { + var handler = route.handler; + + if (!transition.isAborted && handler.willTransitionTo) + handler.willTransitionTo(transition, params, query); + + var promise = transition._promise; + transition._promise = null; + + return promise; + }; + }); + + runHooks(hooks, callback); + } + + /** + * Encapsulates a transition to a given path. + * + * The willTransitionTo and willTransitionFrom handlers receive + * an instance of this class as their first argument. + */ + function Transition(path, retry) { + this.path = path; + this.abortReason = null; + this.isAborted = false; + this.retry = retry.bind(this); + this._promise = null; + } + + assign(Transition.prototype, { + + abort: function (reason) { + if (this.isAborted) { + // First abort wins. + return; + } + + this.abortReason = reason; + this.isAborted = true; + }, + + redirect: function (to, params, query) { + this.abort(new Redirect(to, params, query)); + }, + + wait: function (value) { + this._promise = Promise.resolve(value); + }, + + from: function (routes, components, callback) { + return runTransitionFromHooks(this, routes, components, callback); + }, + + to: function (routes, params, query, callback) { + return runTransitionToHooks(this, routes, params, query, callback); + } + + }); + + module.exports = Transition; + + +/***/ }, +/* 86 */ +/***/ function(module, exports, __webpack_require__) { + + /** + * Encapsulates a redirect to the given route. + */ + function Redirect(to, params, query) { + this.to = to; + this.params = params; + this.query = query; + } + + module.exports = Redirect; + + +/***/ }, +/* 87 */ +/***/ function(module, exports, __webpack_require__) { + + /** + * Represents a cancellation caused by navigating away + * before the previous transition has fully resolved. + */ + function Cancellation() { } + + module.exports = Cancellation; + + +/***/ }, +/* 88 */ +/***/ function(module, exports, __webpack_require__) { + + (function (root, pluralize) { + /* istanbul ignore else */ + if (true) { + // Node. + module.exports = pluralize(); + } else if (typeof define === 'function' && define.amd) { + // AMD, registers as an anonymous module. + define(function () { + return pluralize(); + }); + } else { + // Browser global. + root.pluralize = pluralize(); + } + })(this, function () { + // Rule storage - pluralize and singularize need to be run sequentially, + // while other rules can be optimized using an object for instant lookups. + var pluralRules = []; + var singularRules = []; + var uncountables = {}; + var irregularPlurals = {}; + var irregularSingles = {}; + + /** + * Title case a string. + * + * @param {string} str + * @return {string} + */ + function toTitleCase (str) { + return str.charAt(0).toUpperCase() + str.substr(1).toLowerCase(); + } + + /** + * Sanitize a pluralization rule to a usable regular expression. + * + * @param {(RegExp|string)} rule + * @return {RegExp} + */ + function sanitizeRule (rule) { + if (typeof rule === 'string') { + return new RegExp('^' + rule + '$', 'i'); + } + + return rule; + } + + /** + * Pass in a word token to produce a function that can replicate the case on + * another word. + * + * @param {string} word + * @param {string} token + * @return {Function} + */ + function restoreCase (word, token) { + // Upper cased words. E.g. "HELLO". + if (word === word.toUpperCase()) { + return token.toUpperCase(); + } + + // Title cased words. E.g. "Title". + if (word[0] === word[0].toUpperCase()) { + return toTitleCase(token); + } + + // Lower cased words. E.g. "test". + return token.toLowerCase(); + } + + /** + * Interpolate a regexp string. + * + * @param {[type]} str [description] + * @param {[type]} args [description] + * @return {[type]} [description] + */ + function interpolate (str, args) { + return str.replace(/\$(\d{1,2})/g, function (match, index) { + return args[index] || ''; + }); + } + + /** + * Sanitize a word by passing in the word and sanitization rules. + * + * @param {String} word + * @param {Array} collection + * @return {String} + */ + function sanitizeWord (word, collection) { + // Empty string or doesn't need fixing. + if (!word.length || uncountables.hasOwnProperty(word)) { + return word; + } + + var len = collection.length; + + // Iterate over the sanitization rules and use the first one to match. + while (len--) { + var rule = collection[len]; + + // If the rule passes, return the replacement. + if (rule[0].test(word)) { + return word.replace(rule[0], function (match, index, word) { + var result = interpolate(rule[1], arguments); + + if (match === '') { + return restoreCase(word[index - 1], result); + } + + return restoreCase(match, result); + }); + } + } + + return word; + } + + /** + * Replace a word with the updated word. + * + * @param {Object} replaceMap + * @param {Object} keepMap + * @param {Array} rules + * @return {Function} + */ + function replaceWord (replaceMap, keepMap, rules) { + return function (word) { + // Get the correct token and case restoration functions. + var token = word.toLowerCase(); + + // Check against the keep object map. + if (keepMap.hasOwnProperty(token)) { + return restoreCase(word, token); + } + + // Check against the replacement map for a direct word replacement. + if (replaceMap.hasOwnProperty(token)) { + return restoreCase(word, replaceMap[token]); + } + + // Run all the rules against the word. + return sanitizeWord(word, rules); + }; + } + + /** + * Pluralize or singularize a word based on the passed in count. + * + * @param {String} word + * @param {Number} count + * @param {Boolean} inclusive + * @return {String} + */ + function pluralize (word, count, inclusive) { + var pluralized = count === 1 ? + pluralize.singular(word) : pluralize.plural(word); + + return (inclusive ? count + ' ' : '') + pluralized; + } + + /** + * Pluralize a word. + * + * @type {Function} + */ + pluralize.plural = replaceWord( + irregularSingles, irregularPlurals, pluralRules + ); + + /** + * Singularize a word. + * + * @type {Function} + */ + pluralize.singular = replaceWord( + irregularPlurals, irregularSingles, singularRules + ); + + /** + * Add a pluralization rule to the collection. + * + * @param {(string|RegExp)} rule + * @param {string} replacement + */ + pluralize.addPluralRule = function (rule, replacement) { + pluralRules.push([sanitizeRule(rule), replacement]); + }; + + /** + * Add a singularization rule to the collection. + * + * @param {(string|RegExp)} rule + * @param {string} replacement + */ + pluralize.addSingularRule = function (rule, replacement) { + singularRules.push([sanitizeRule(rule), replacement]); + }; + + /** + * Add an uncountable word rule. + * + * @param {(string|RegExp)} word + */ + pluralize.addUncountableRule = function (word) { + if (typeof word === 'string') { + return uncountables[word.toLowerCase()] = true; + } + + // Set singular and plural references for the word. + pluralize.addPluralRule(word, '$0'); + pluralize.addSingularRule(word, '$0'); + }; + + /** + * Add an irregular word definition. + * + * @param {String} single + * @param {String} plural + */ + pluralize.addIrregularRule = function (single, plural) { + plural = plural.toLowerCase(); + single = single.toLowerCase(); + + irregularSingles[single] = plural; + irregularPlurals[plural] = single; + }; + + /** + * Irregular rules. + */ + [ + // Pronouns. + ['I', 'we'], + ['me', 'us'], + ['he', 'they'], + ['she', 'they'], + ['them', 'them'], + ['myself', 'ourselves'], + ['yourself', 'yourselves'], + ['itself', 'themselves'], + ['herself', 'themselves'], + ['himself', 'themselves'], + ['themself', 'themselves'], + ['this', 'these'], + ['that', 'those'], + // Words ending in with a consonant and `o`. + ['echo', 'echoes'], + ['dingo', 'dingoes'], + ['volcano', 'volcanoes'], + ['tornado', 'tornadoes'], + ['torpedo', 'torpedoes'], + // Ends with `us`. + ['genus', 'genera'], + ['viscus', 'viscera'], + // Ends with `ma`. + ['stigma', 'stigmata'], + ['stoma', 'stomata'], + ['dogma', 'dogmata'], + ['lemma', 'lemmata'], + ['schema', 'schemata'], + ['anathema', 'anathemata'], + // Other irregular rules. + ['ox', 'oxen'], + ['axe', 'axes'], + ['die', 'dice'], + ['yes', 'yeses'], + ['foot', 'feet'], + ['eave', 'eaves'], + ['goose', 'geese'], + ['tooth', 'teeth'], + ['quiz', 'quizzes'], + ['human', 'humans'], + ['proof', 'proofs'], + ['carve', 'carves'], + ['valve', 'valves'], + ['thief', 'thieves'], + ['genie', 'genies'], + ['groove', 'grooves'], + ['pickaxe', 'pickaxes'], + ['whiskey', 'whiskies'] + ].forEach(function (rule) { + return pluralize.addIrregularRule(rule[0], rule[1]); + }); + + /** + * Pluralization rules. + */ + [ + [/s?$/i, 's'], + [/([^aeiou]ese)$/i, '$1'], + [/(ax|test)is$/i, '$1es'], + [/(alias|[^aou]us|tlas|gas|ris)$/i, '$1es'], + [/(e[mn]u)s?$/i, '$1s'], + [/([^l]ias|[aeiou]las|[emjzr]as|[iu]am)$/i, '$1'], + [/(alumn|syllab|octop|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i, '$1i'], + [/(alumn|alg|vertebr)(?:a|ae)$/i, '$1ae'], + [/(seraph|cherub)(?:im)?$/i, '$1im'], + [/(her|at|gr)o$/i, '$1oes'], + [/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|automat|quor)(?:a|um)$/i, '$1a'], + [/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|\w+hedr)(?:a|on)$/i, '$1a'], + [/sis$/i, 'ses'], + [/(?:(i)fe|(ar|l|ea|eo|oa|hoo)f)$/i, '$1$2ves'], + [/([^aeiouy]|qu)y$/i, '$1ies'], + [/([^ch][ieo][ln])ey$/i, '$1ies'], + [/(x|ch|ss|sh|zz)$/i, '$1es'], + [/(matr|cod|mur|sil|vert|ind|append)(?:ix|ex)$/i, '$1ices'], + [/(m|l)(?:ice|ouse)$/i, '$1ice'], + [/(pe)(?:rson|ople)$/i, '$1ople'], + [/(child)(?:ren)?$/i, '$1ren'], + [/eaux$/i, '$0'], + [/m[ae]n$/i, 'men'] + ].forEach(function (rule) { + return pluralize.addPluralRule(rule[0], rule[1]); + }); + + /** + * Singularization rules. + */ + [ + [/s$/i, ''], + [/(ss)$/i, '$1'], + [/((a)naly|(b)a|(d)iagno|(p)arenthe|(p)rogno|(s)ynop|(t)he)(?:sis|ses)$/i, '$1sis'], + [/(^analy)(?:sis|ses)$/i, '$1sis'], + [/([^aeflor])ves$/i, '$1fe'], + [/(hive|tive|dr?ive)s$/i, '$1'], + [/(ar|(?:wo|[ae])l|[eo][ao])ves$/i, '$1f'], + [/([^aeiouy]|qu)ies$/i, '$1y'], + [/(^[pl]|zomb|^(?:neck)?t|[aeo][lt]|cut)ies$/i, '$1ie'], + [/([^c][eor]n|smil)ies$/i, '$1ey'], + [/(m|l)ice$/i, '$1ouse'], + [/(seraph|cherub)im$/i, '$1'], + [/(x|ch|ss|sh|zz|tto|go|cho|alias|[^aou]us|tlas|gas|(?:her|at|gr)o|ris)(?:es)?$/i, '$1'], + [/(e[mn]u)s?$/i, '$1'], + [/(movie|twelve)s$/i, '$1'], + [/(cris|test|diagnos)(?:is|es)$/i, '$1is'], + [/(alumn|syllab|octop|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i, '$1us'], + [/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|automat|quor)a$/i, '$1um'], + [/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|\w+hedr)a$/i, '$1on'], + [/(alumn|alg|vertebr)ae$/i, '$1a'], + [/(cod|mur|sil|vert|ind)ices$/i, '$1ex'], + [/(matr|append)ices$/i, '$1ix'], + [/(pe)(rson|ople)$/i, '$1rson'], + [/(child)ren$/i, '$1'], + [/(eau)x?$/i, '$1'], + [/men$/i, 'man'] + ].forEach(function (rule) { + return pluralize.addSingularRule(rule[0], rule[1]); + }); + + /** + * Uncountable rules. + */ + [ + // Singular words with no plurals. + 'advice', + 'agenda', + 'bison', + 'bream', + 'buffalo', + 'carp', + 'chassis', + 'cod', + 'cooperation', + 'corps', + 'digestion', + 'debris', + 'diabetes', + 'energy', + 'equipment', + 'elk', + 'excretion', + 'expertise', + 'flounder', + 'gallows', + 'graffiti', + 'headquarters', + 'health', + 'herpes', + 'highjinks', + 'homework', + 'information', + 'jeans', + 'justice', + 'kudos', + 'labour', + 'machinery', + 'mackerel', + 'media', + 'mews', + 'moose', + 'news', + 'pike', + 'plankton', + 'pliers', + 'pollution', + 'premises', + 'rain', + 'rice', + 'salmon', + 'scissors', + 'series', + 'sewage', + 'shambles', + 'shrimp', + 'species', + 'staff', + 'swine', + 'trout', + 'tuna', + 'whiting', + 'wildebeest', + 'wildlife', + // Regexes. + /pox$/i, // "chickpox", "smallpox" + /ois$/i, + /deer$/i, // "deer", "reindeer" + /fish$/i, // "fish", "blowfish", "angelfish" + /sheep$/i, + /measles$/i, + /[^aeiou]ese$/i // "chinese", "japanese" + ].forEach(pluralize.addUncountableRule); + + return pluralize; + }); + + +/***/ }, +/* 89 */ +/***/ function(module, exports, __webpack_require__) { + + // shim for using process in browser + + var process = module.exports = {}; + + process.nextTick = (function () { + var canSetImmediate = typeof window !== 'undefined' + && window.setImmediate; + var canMutationObserver = typeof window !== 'undefined' + && window.MutationObserver; + var canPost = typeof window !== 'undefined' + && window.postMessage && window.addEventListener + ; + + if (canSetImmediate) { + return function (f) { return window.setImmediate(f) }; + } + + var queue = []; + + if (canMutationObserver) { + var hiddenDiv = document.createElement("div"); + var observer = new MutationObserver(function () { + var queueList = queue.slice(); + queue.length = 0; + queueList.forEach(function (fn) { + fn(); + }); + }); + + observer.observe(hiddenDiv, { attributes: true }); + + return function nextTick(fn) { + if (!queue.length) { + hiddenDiv.setAttribute('yes', 'no'); + } + queue.push(fn); + }; + } + + if (canPost) { + window.addEventListener('message', function (ev) { + var source = ev.source; + if ((source === window || source === null) && ev.data === 'process-tick') { + ev.stopPropagation(); + if (queue.length > 0) { + var fn = queue.shift(); + fn(); + } + } + }, true); + + return function nextTick(fn) { + queue.push(fn); + window.postMessage('process-tick', '*'); + }; + } + + return function nextTick(fn) { + setTimeout(fn, 0); + }; + })(); + + process.title = 'browser'; + process.browser = true; + process.env = {}; + process.argv = []; + + function noop() {} + + process.on = noop; + process.addListener = noop; + process.once = noop; + process.off = noop; + process.removeListener = noop; + process.removeAllListeners = noop; + process.emit = noop; + + process.binding = function (name) { + throw new Error('process.binding is not supported'); + }; + + // TODO(shtylman) + process.cwd = function () { return '/' }; + process.chdir = function (dir) { + throw new Error('process.chdir is not supported'); + }; + + +/***/ }, +/* 90 */ +/***/ function(module, exports, __webpack_require__) { + + var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;/*! + * Reqwest! A general purpose XHR connection manager + * license MIT (c) Dustin Diaz 2014 + * https://github.com/ded/reqwest + */ + + !function (name, context, definition) { + if (typeof module != 'undefined' && module.exports) module.exports = definition() + else if (true) !(__WEBPACK_AMD_DEFINE_FACTORY__ = (definition), __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? (__WEBPACK_AMD_DEFINE_FACTORY__.call(exports, __webpack_require__, exports, module)) : __WEBPACK_AMD_DEFINE_FACTORY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) + else context[name] = definition() + }('reqwest', this, function () { + + var win = window + , doc = document + , httpsRe = /^http/ + , protocolRe = /(^\w+):\/\// + , twoHundo = /^(20\d|1223)$/ //http://stackoverflow.com/questions/10046972/msie-returns-status-code-of-1223-for-ajax-request + , byTag = 'getElementsByTagName' + , readyState = 'readyState' + , contentType = 'Content-Type' + , requestedWith = 'X-Requested-With' + , head = doc[byTag]('head')[0] + , uniqid = 0 + , callbackPrefix = 'reqwest_' + (+new Date()) + , lastValue // data stored by the most recent JSONP callback + , xmlHttpRequest = 'XMLHttpRequest' + , xDomainRequest = 'XDomainRequest' + , noop = function () {} + + , isArray = typeof Array.isArray == 'function' + ? Array.isArray + : function (a) { + return a instanceof Array + } + + , defaultHeaders = { + 'contentType': 'application/x-www-form-urlencoded' + , 'requestedWith': xmlHttpRequest + , 'accept': { + '*': 'text/javascript, text/html, application/xml, text/xml, */*' + , 'xml': 'application/xml, text/xml' + , 'html': 'text/html' + , 'text': 'text/plain' + , 'json': 'application/json, text/javascript' + , 'js': 'application/javascript, text/javascript' + } + } + + , xhr = function(o) { + // is it x-domain + if (o['crossOrigin'] === true) { + var xhr = win[xmlHttpRequest] ? new XMLHttpRequest() : null + if (xhr && 'withCredentials' in xhr) { + return xhr + } else if (win[xDomainRequest]) { + return new XDomainRequest() + } else { + throw new Error('Browser does not support cross-origin requests') + } + } else if (win[xmlHttpRequest]) { + return new XMLHttpRequest() + } else { + return new ActiveXObject('Microsoft.XMLHTTP') + } + } + , globalSetupOptions = { + dataFilter: function (data) { + return data + } + } + + function succeed(r) { + var protocol = protocolRe.exec(r.url); + protocol = (protocol && protocol[1]) || window.location.protocol; + return httpsRe.test(protocol) ? twoHundo.test(r.request.status) : !!r.request.response; + } + + function handleReadyState(r, success, error) { + return function () { + // use _aborted to mitigate against IE err c00c023f + // (can't read props on aborted request objects) + if (r._aborted) return error(r.request) + if (r._timedOut) return error(r.request, 'Request is aborted: timeout') + if (r.request && r.request[readyState] == 4) { + r.request.onreadystatechange = noop + if (succeed(r)) success(r.request) + else + error(r.request) + } + } + } + + function setHeaders(http, o) { + var headers = o['headers'] || {} + , h + + headers['Accept'] = headers['Accept'] + || defaultHeaders['accept'][o['type']] + || defaultHeaders['accept']['*'] + + var isAFormData = typeof FormData === 'function' && (o['data'] instanceof FormData); + // breaks cross-origin requests with legacy browsers + if (!o['crossOrigin'] && !headers[requestedWith]) headers[requestedWith] = defaultHeaders['requestedWith'] + if (!headers[contentType] && !isAFormData) headers[contentType] = o['contentType'] || defaultHeaders['contentType'] + for (h in headers) + headers.hasOwnProperty(h) && 'setRequestHeader' in http && http.setRequestHeader(h, headers[h]) + } + + function setCredentials(http, o) { + if (typeof o['withCredentials'] !== 'undefined' && typeof http.withCredentials !== 'undefined') { + http.withCredentials = !!o['withCredentials'] + } + } + + function generalCallback(data) { + lastValue = data + } + + function urlappend (url, s) { + return url + (/\?/.test(url) ? '&' : '?') + s + } + + function handleJsonp(o, fn, err, url) { + var reqId = uniqid++ + , cbkey = o['jsonpCallback'] || 'callback' // the 'callback' key + , cbval = o['jsonpCallbackName'] || reqwest.getcallbackPrefix(reqId) + , cbreg = new RegExp('((^|\\?|&)' + cbkey + ')=([^&]+)') + , match = url.match(cbreg) + , script = doc.createElement('script') + , loaded = 0 + , isIE10 = navigator.userAgent.indexOf('MSIE 10.0') !== -1 + + if (match) { + if (match[3] === '?') { + url = url.replace(cbreg, '$1=' + cbval) // wildcard callback func name + } else { + cbval = match[3] // provided callback func name + } + } else { + url = urlappend(url, cbkey + '=' + cbval) // no callback details, add 'em + } + + win[cbval] = generalCallback + + script.type = 'text/javascript' + script.src = url + script.async = true + if (typeof script.onreadystatechange !== 'undefined' && !isIE10) { + // need this for IE due to out-of-order onreadystatechange(), binding script + // execution to an event listener gives us control over when the script + // is executed. See http://jaubourg.net/2010/07/loading-script-as-onclick-handler-of.html + script.htmlFor = script.id = '_reqwest_' + reqId + } + + script.onload = script.onreadystatechange = function () { + if ((script[readyState] && script[readyState] !== 'complete' && script[readyState] !== 'loaded') || loaded) { + return false + } + script.onload = script.onreadystatechange = null + script.onclick && script.onclick() + // Call the user callback with the last value stored and clean up values and scripts. + fn(lastValue) + lastValue = undefined + head.removeChild(script) + loaded = 1 + } + + // Add the script to the DOM head + head.appendChild(script) + + // Enable JSONP timeout + return { + abort: function () { + script.onload = script.onreadystatechange = null + err({}, 'Request is aborted: timeout', {}) + lastValue = undefined + head.removeChild(script) + loaded = 1 + } + } + } + + function getRequest(fn, err) { + var o = this.o + , method = (o['method'] || 'GET').toUpperCase() + , url = typeof o === 'string' ? o : o['url'] + // convert non-string objects to query-string form unless o['processData'] is false + , data = (o['processData'] !== false && o['data'] && typeof o['data'] !== 'string') + ? reqwest.toQueryString(o['data']) + : (o['data'] || null) + , http + , sendWait = false + + // if we're working on a GET request and we have data then we should append + // query string to end of URL and not post data + if ((o['type'] == 'jsonp' || method == 'GET') && data) { + url = urlappend(url, data) + data = null + } + + if (o['type'] == 'jsonp') return handleJsonp(o, fn, err, url) + + // get the xhr from the factory if passed + // if the factory returns null, fall-back to ours + http = (o.xhr && o.xhr(o)) || xhr(o) + + http.open(method, url, o['async'] === false ? false : true) + setHeaders(http, o) + setCredentials(http, o) + if (win[xDomainRequest] && http instanceof win[xDomainRequest]) { + http.onload = fn + http.onerror = err + // NOTE: see + // http://social.msdn.microsoft.com/Forums/en-US/iewebdevelopment/thread/30ef3add-767c-4436-b8a9-f1ca19b4812e + http.onprogress = function() {} + sendWait = true + } else { + http.onreadystatechange = handleReadyState(this, fn, err) + } + o['before'] && o['before'](http) + if (sendWait) { + setTimeout(function () { + http.send(data) + }, 200) + } else { + http.send(data) + } + return http + } + + function Reqwest(o, fn) { + this.o = o + this.fn = fn + + init.apply(this, arguments) + } + + function setType(header) { + // json, javascript, text/plain, text/html, xml + if (header.match('json')) return 'json' + if (header.match('javascript')) return 'js' + if (header.match('text')) return 'html' + if (header.match('xml')) return 'xml' + } + + function init(o, fn) { + + this.url = typeof o == 'string' ? o : o['url'] + this.timeout = null + + // whether request has been fulfilled for purpose + // of tracking the Promises + this._fulfilled = false + // success handlers + this._successHandler = function(){} + this._fulfillmentHandlers = [] + // error handlers + this._errorHandlers = [] + // complete (both success and fail) handlers + this._completeHandlers = [] + this._erred = false + this._responseArgs = {} + + var self = this + + fn = fn || function () {} + + if (o['timeout']) { + this.timeout = setTimeout(function () { + timedOut() + }, o['timeout']) + } + + if (o['success']) { + this._successHandler = function () { + o['success'].apply(o, arguments) + } + } + + if (o['error']) { + this._errorHandlers.push(function () { + o['error'].apply(o, arguments) + }) + } + + if (o['complete']) { + this._completeHandlers.push(function () { + o['complete'].apply(o, arguments) + }) + } + + function complete (resp) { + o['timeout'] && clearTimeout(self.timeout) + self.timeout = null + while (self._completeHandlers.length > 0) { + self._completeHandlers.shift()(resp) + } + } + + function success (resp) { + var type = o['type'] || resp && setType(resp.getResponseHeader('Content-Type')) // resp can be undefined in IE + resp = (type !== 'jsonp') ? self.request : resp + // use global data filter on response text + var filteredResponse = globalSetupOptions.dataFilter(resp.responseText, type) + , r = filteredResponse + try { + resp.responseText = r + } catch (e) { + // can't assign this in IE<=8, just ignore + } + if (r) { + switch (type) { + case 'json': + try { + resp = win.JSON ? win.JSON.parse(r) : eval('(' + r + ')') + } catch (err) { + return error(resp, 'Could not parse JSON in response', err) + } + break + case 'js': + resp = eval(r) + break + case 'html': + resp = r + break + case 'xml': + resp = resp.responseXML + && resp.responseXML.parseError // IE trololo + && resp.responseXML.parseError.errorCode + && resp.responseXML.parseError.reason + ? null + : resp.responseXML + break + } + } + + self._responseArgs.resp = resp + self._fulfilled = true + fn(resp) + self._successHandler(resp) + while (self._fulfillmentHandlers.length > 0) { + resp = self._fulfillmentHandlers.shift()(resp) + } + + complete(resp) + } + + function timedOut() { + self._timedOut = true + self.request.abort() + } + + function error(resp, msg, t) { + resp = self.request + self._responseArgs.resp = resp + self._responseArgs.msg = msg + self._responseArgs.t = t + self._erred = true + while (self._errorHandlers.length > 0) { + self._errorHandlers.shift()(resp, msg, t) + } + complete(resp) + } + + this.request = getRequest.call(this, success, error) + } + + Reqwest.prototype = { + abort: function () { + this._aborted = true + this.request.abort() + } + + , retry: function () { + init.call(this, this.o, this.fn) + } + + /** + * Small deviation from the Promises A CommonJs specification + * http://wiki.commonjs.org/wiki/Promises/A + */ + + /** + * `then` will execute upon successful requests + */ + , then: function (success, fail) { + success = success || function () {} + fail = fail || function () {} + if (this._fulfilled) { + this._responseArgs.resp = success(this._responseArgs.resp) + } else if (this._erred) { + fail(this._responseArgs.resp, this._responseArgs.msg, this._responseArgs.t) + } else { + this._fulfillmentHandlers.push(success) + this._errorHandlers.push(fail) + } + return this + } + + /** + * `always` will execute whether the request succeeds or fails + */ + , always: function (fn) { + if (this._fulfilled || this._erred) { + fn(this._responseArgs.resp) + } else { + this._completeHandlers.push(fn) + } + return this + } + + /** + * `fail` will execute when the request fails + */ + , fail: function (fn) { + if (this._erred) { + fn(this._responseArgs.resp, this._responseArgs.msg, this._responseArgs.t) + } else { + this._errorHandlers.push(fn) + } + return this + } + , 'catch': function (fn) { + return this.fail(fn) + } + } + + function reqwest(o, fn) { + return new Reqwest(o, fn) + } + + // normalize newline variants according to spec -> CRLF + function normalize(s) { + return s ? s.replace(/\r?\n/g, '\r\n') : '' + } + + function serial(el, cb) { + var n = el.name + , t = el.tagName.toLowerCase() + , optCb = function (o) { + // IE gives value="" even where there is no value attribute + // 'specified' ref: http://www.w3.org/TR/DOM-Level-3-Core/core.html#ID-862529273 + if (o && !o['disabled']) + cb(n, normalize(o['attributes']['value'] && o['attributes']['value']['specified'] ? o['value'] : o['text'])) + } + , ch, ra, val, i + + // don't serialize elements that are disabled or without a name + if (el.disabled || !n) return + + switch (t) { + case 'input': + if (!/reset|button|image|file/i.test(el.type)) { + ch = /checkbox/i.test(el.type) + ra = /radio/i.test(el.type) + val = el.value + // WebKit gives us "" instead of "on" if a checkbox has no value, so correct it here + ;(!(ch || ra) || el.checked) && cb(n, normalize(ch && val === '' ? 'on' : val)) + } + break + case 'textarea': + cb(n, normalize(el.value)) + break + case 'select': + if (el.type.toLowerCase() === 'select-one') { + optCb(el.selectedIndex >= 0 ? el.options[el.selectedIndex] : null) + } else { + for (i = 0; el.length && i < el.length; i++) { + el.options[i].selected && optCb(el.options[i]) + } + } + break + } + } + + // collect up all form elements found from the passed argument elements all + // the way down to child elements; pass a '' or form fields. + // called with 'this'=callback to use for serial() on each element + function eachFormElement() { + var cb = this + , e, i + , serializeSubtags = function (e, tags) { + var i, j, fa + for (i = 0; i < tags.length; i++) { + fa = e[byTag](tags[i]) + for (j = 0; j < fa.length; j++) serial(fa[j], cb) + } + } + + for (i = 0; i < arguments.length; i++) { + e = arguments[i] + if (/input|select|textarea/i.test(e.tagName)) serial(e, cb) + serializeSubtags(e, [ 'input', 'select', 'textarea' ]) + } + } + + // standard query string style serialization + function serializeQueryString() { + return reqwest.toQueryString(reqwest.serializeArray.apply(null, arguments)) + } + + // { 'name': 'value', ... } style serialization + function serializeHash() { + var hash = {} + eachFormElement.apply(function (name, value) { + if (name in hash) { + hash[name] && !isArray(hash[name]) && (hash[name] = [hash[name]]) + hash[name].push(value) + } else hash[name] = value + }, arguments) + return hash + } + + // [ { name: 'name', value: 'value' }, ... ] style serialization + reqwest.serializeArray = function () { + var arr = [] + eachFormElement.apply(function (name, value) { + arr.push({name: name, value: value}) + }, arguments) + return arr + } + + reqwest.serialize = function () { + if (arguments.length === 0) return '' + var opt, fn + , args = Array.prototype.slice.call(arguments, 0) + + opt = args.pop() + opt && opt.nodeType && args.push(opt) && (opt = null) + opt && (opt = opt.type) + + if (opt == 'map') fn = serializeHash + else if (opt == 'array') fn = reqwest.serializeArray + else fn = serializeQueryString + + return fn.apply(null, args) + } + + reqwest.toQueryString = function (o, trad) { + var prefix, i + , traditional = trad || false + , s = [] + , enc = encodeURIComponent + , add = function (key, value) { + // If value is a function, invoke it and return its value + value = ('function' === typeof value) ? value() : (value == null ? '' : value) + s[s.length] = enc(key) + '=' + enc(value) + } + // If an array was passed in, assume that it is an array of form elements. + if (isArray(o)) { + for (i = 0; o && i < o.length; i++) add(o[i]['name'], o[i]['value']) + } else { + // If traditional, encode the "old" way (the way 1.3.2 or older + // did it), otherwise encode params recursively. + for (prefix in o) { + if (o.hasOwnProperty(prefix)) buildParams(prefix, o[prefix], traditional, add) + } + } + + // spaces should be + according to spec + return s.join('&').replace(/%20/g, '+') + } + + function buildParams(prefix, obj, traditional, add) { + var name, i, v + , rbracket = /\[\]$/ + + if (isArray(obj)) { + // Serialize array item. + for (i = 0; obj && i < obj.length; i++) { + v = obj[i] + if (traditional || rbracket.test(prefix)) { + // Treat each array item as a scalar. + add(prefix, v) + } else { + buildParams(prefix + '[' + (typeof v === 'object' ? i : '') + ']', v, traditional, add) + } + } + } else if (obj && obj.toString() === '[object Object]') { + // Serialize object item. + for (name in obj) { + buildParams(prefix + '[' + name + ']', obj[name], traditional, add) + } + + } else { + // Serialize scalar item. + add(prefix, obj) + } + } + + reqwest.getcallbackPrefix = function () { + return callbackPrefix + } + + // jQuery and Zepto compatibility, differences can be remapped here so you can call + // .ajax.compat(options, callback) + reqwest.compat = function (o, fn) { + if (o) { + o['type'] && (o['method'] = o['type']) && delete o['type'] + o['dataType'] && (o['type'] = o['dataType']) + o['jsonpCallback'] && (o['jsonpCallbackName'] = o['jsonpCallback']) && delete o['jsonpCallback'] + o['jsonp'] && (o['jsonpCallback'] = o['jsonp']) + } + return new Reqwest(o, fn) + } + + reqwest.ajaxSetup = function (options) { + options = options || {} + for (var k in options) { + globalSetupOptions[k] = options[k] + } + } + + return reqwest + }); + + +/***/ }, +/* 91 */ +/***/ function(module, exports, __webpack_require__) { + + var isLength = __webpack_require__(94), + isObjectLike = __webpack_require__(95); + + /** `Object#toString` result references. */ + var argsTag = '[object Arguments]'; + + /** Used for native method references. */ + var objectProto = Object.prototype; + + /** + * Used to resolve the `toStringTag` of values. + * See the [ES spec](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.prototype.tostring) + * for more details. + */ + var objToString = objectProto.toString; + + /** + * Checks if `value` is classified as an `arguments` object. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. + * @example + * + * (function() { return _.isArguments(arguments); })(); + * // => true + * + * _.isArguments([1, 2, 3]); + * // => false + */ + function isArguments(value) { + var length = isObjectLike(value) ? value.length : undefined; + return (isLength(length) && objToString.call(value) == argsTag) || false; + } + + module.exports = isArguments; + + +/***/ }, +/* 92 */ +/***/ function(module, exports, __webpack_require__) { + + var isLength = __webpack_require__(94), + isNative = __webpack_require__(183), + isObjectLike = __webpack_require__(95); + + /** `Object#toString` result references. */ + var arrayTag = '[object Array]'; + + /** Used for native method references. */ + var objectProto = Object.prototype; + + /** + * Used to resolve the `toStringTag` of values. + * See the [ES spec](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.prototype.tostring) + * for more details. + */ + var objToString = objectProto.toString; + + /* Native method references for those with the same name as other `lodash` methods. */ + var nativeIsArray = isNative(nativeIsArray = Array.isArray) && nativeIsArray; + + /** + * Checks if `value` is classified as an `Array` object. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. + * @example + * + * _.isArray([1, 2, 3]); + * // => true + * + * (function() { return _.isArray(arguments); })(); + * // => false + */ + var isArray = nativeIsArray || function(value) { + return (isObjectLike(value) && isLength(value.length) && objToString.call(value) == arrayTag) || false; + }; + + module.exports = isArray; + + +/***/ }, +/* 93 */ +/***/ function(module, exports, __webpack_require__) { + + /* WEBPACK VAR INJECTION */(function(global) {var isNative = __webpack_require__(183); + + /** `Object#toString` result references. */ + var funcTag = '[object Function]'; + + /** Used for native method references. */ + var objectProto = Object.prototype; + + /** + * Used to resolve the `toStringTag` of values. + * See the [ES spec](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.prototype.tostring) + * for more details. + */ + var objToString = objectProto.toString; + + /** Native method references. */ + var Uint8Array = isNative(Uint8Array = global.Uint8Array) && Uint8Array; + + /** + * Checks if `value` is classified as a `Function` object. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. + * @example + * + * _.isFunction(_); + * // => true + * + * _.isFunction(/abc/); + * // => false + */ + function isFunction(value) { + // Avoid a Chakra JIT bug in compatibility modes of IE 11. + // See https://github.com/jashkenas/underscore/issues/1621 for more details. + return typeof value == 'function' || false; + } + // Fallback for environments that return incorrect `typeof` operator results. + if (isFunction(/x/) || (Uint8Array && !isFunction(Uint8Array))) { + isFunction = function(value) { + // The use of `Object#toString` avoids issues with the `typeof` operator + // in older versions of Chrome and Safari which return 'function' for regexes + // and Safari 8 equivalents which return 'object' for typed array constructors. + return objToString.call(value) == funcTag; + }; + } + + module.exports = isFunction; + + /* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }()))) + +/***/ }, +/* 94 */ +/***/ function(module, exports, __webpack_require__) { + + /** + * Used as the maximum length of an array-like value. + * See the [ES spec](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-tolength) + * for more details. + */ + var MAX_SAFE_INTEGER = Math.pow(2, 53) - 1; + + /** + * Checks if `value` is a valid array-like length. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. + */ + function isLength(value) { + return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; + } + + module.exports = isLength; + + +/***/ }, +/* 95 */ +/***/ function(module, exports, __webpack_require__) { + + /** + * Checks if `value` is object-like. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is object-like, else `false`. + */ + function isObjectLike(value) { + return (value && typeof value == 'object') || false; + } + + module.exports = isObjectLike; + + +/***/ }, +/* 96 */ +/***/ function(module, exports, __webpack_require__) { + + var isLength = __webpack_require__(94), + isNative = __webpack_require__(183), + isObject = __webpack_require__(185), + shimKeys = __webpack_require__(186); + + /* Native method references for those with the same name as other `lodash` methods. */ + var nativeKeys = isNative(nativeKeys = Object.keys) && nativeKeys; + + /** + * Creates an array of the own enumerable property names of `object`. + * + * **Note:** Non-object values are coerced to objects. See the + * [ES spec](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.keys) + * for more details. + * + * @static + * @memberOf _ + * @category Object + * @param {Object} object The object to inspect. + * @returns {Array} Returns the array of property names. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.keys(new Foo); + * // => ['a', 'b'] (iteration order is not guaranteed) + * + * _.keys('hi'); + * // => ['0', '1'] + */ + var keys = !nativeKeys ? shimKeys : function(object) { + if (object) { + var Ctor = object.constructor, + length = object.length; + } + if ((typeof Ctor == 'function' && Ctor.prototype === object) || + (typeof object != 'function' && (length && isLength(length)))) { + return shimKeys(object); + } + return isObject(object) ? nativeKeys(object) : []; + }; + + module.exports = keys; + + +/***/ }, +/* 97 */ +/***/ function(module, exports, __webpack_require__) { + + "use strict"; + + var _interopRequire = function (obj) { return obj && obj.__esModule ? obj["default"] : obj; }; + + var React = _interopRequire(__webpack_require__(4)); + + var joinClasses = _interopRequire(__webpack_require__(187)); + + var pluralize = _interopRequire(__webpack_require__(88)); + + var Stat = React.createClass({ + displayName: "Stat", + render: function () { + return React.createElement( + "div", + { className: joinClasses("Stat", this.props.className) }, + React.createElement( + "span", + { className: "Stat-value" }, + this.props.value + ), + React.createElement( + "span", + { className: "Stat-title" }, + pluralize(this.props.title, this.props.value) + ) + ); + } + }); + + module.exports = Stat; + +/***/ }, +/* 98 */ +/***/ function(module, exports, __webpack_require__) { + + /** + * A specialized version of `_.map` for arrays without support for callback + * shorthands or `this` binding. + * + * @private + * @param {Array} array The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns the new mapped array. + */ + function arrayMap(array, iteratee) { + var index = -1, + length = array.length, + result = Array(length); + + while (++index < length) { + result[index] = iteratee(array[index], index, array); + } + return result; + } + + module.exports = arrayMap; + + +/***/ }, +/* 99 */ +/***/ function(module, exports, __webpack_require__) { + + var baseMatches = __webpack_require__(189), + baseProperty = __webpack_require__(190), + baseToString = __webpack_require__(191), + bindCallback = __webpack_require__(104), + identity = __webpack_require__(192), + isBindable = __webpack_require__(193); + + /** + * The base implementation of `_.callback` which supports specifying the + * number of arguments to provide to `func`. + * + * @private + * @param {*} [func=_.identity] The value to convert to a callback. + * @param {*} [thisArg] The `this` binding of `func`. + * @param {number} [argCount] The number of arguments to provide to `func`. + * @returns {Function} Returns the callback. + */ + function baseCallback(func, thisArg, argCount) { + var type = typeof func; + if (type == 'function') { + return (typeof thisArg != 'undefined' && isBindable(func)) + ? bindCallback(func, thisArg, argCount) + : func; + } + if (func == null) { + return identity; + } + // Handle "_.property" and "_.matches" style callback shorthands. + return type == 'object' + ? baseMatches(func, !argCount) + : baseProperty(argCount ? baseToString(func) : func); + } + + module.exports = baseCallback; + + +/***/ }, +/* 100 */ +/***/ function(module, exports, __webpack_require__) { + + var baseEach = __webpack_require__(188); + + /** + * The base implementation of `_.map` without support for callback shorthands + * or `this` binding. + * + * @private + * @param {Array|Object|string} collection The collection to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns the new mapped array. + */ + function baseMap(collection, iteratee) { + var result = []; + baseEach(collection, function(value, key, collection) { + result.push(iteratee(value, key, collection)); + }); + return result; + } + + module.exports = baseMap; + + +/***/ }, +/* 101 */ +/***/ function(module, exports, __webpack_require__) { + + var baseToString = __webpack_require__(191); + + /** Used to generate unique IDs. */ + var idCounter = 0; + + /** + * Generates a unique ID. If `prefix` is provided the ID is appended to it. + * + * @static + * @memberOf _ + * @category Utility + * @param {string} [prefix] The value to prefix the ID with. + * @returns {string} Returns the unique ID. + * @example + * + * _.uniqueId('contact_'); + * // => 'contact_104' + * + * _.uniqueId(); + * // => '105' + */ + function uniqueId(prefix) { + var id = ++idCounter; + return baseToString(prefix) + id; + } + + module.exports = uniqueId; + + +/***/ }, +/* 102 */ +/***/ function(module, exports, __webpack_require__) { + + /* WEBPACK VAR INJECTION */(function(process) {/** + * Copyright 2013-2014, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule ReactWithAddons + */ + + /** + * This module exists purely in the open source project, and is meant as a way + * to create a separate standalone build of React. This build has "addons", or + * functionality we've built and think might be useful but doesn't have a good + * place to live inside React core. + */ + + "use strict"; + + var LinkedStateMixin = __webpack_require__(194); + var React = __webpack_require__(18); + var ReactComponentWithPureRenderMixin = + __webpack_require__(195); + var ReactCSSTransitionGroup = __webpack_require__(196); + var ReactTransitionGroup = __webpack_require__(197); + var ReactUpdates = __webpack_require__(117); + + var cx = __webpack_require__(73); + var cloneWithProps = __webpack_require__(198); + var update = __webpack_require__(199); + + React.addons = { + CSSTransitionGroup: ReactCSSTransitionGroup, + LinkedStateMixin: LinkedStateMixin, + PureRenderMixin: ReactComponentWithPureRenderMixin, + TransitionGroup: ReactTransitionGroup, + + batchedUpdates: ReactUpdates.batchedUpdates, + classSet: cx, + cloneWithProps: cloneWithProps, + update: update + }; + + if ("production" !== process.env.NODE_ENV) { + React.addons.Perf = __webpack_require__(158); + React.addons.TestUtils = __webpack_require__(200); + } + + module.exports = React; + + /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(89))) + +/***/ }, +/* 103 */ +/***/ function(module, exports, __webpack_require__) { + + var isArguments = __webpack_require__(91), + isArray = __webpack_require__(92), + isLength = __webpack_require__(94), + isObjectLike = __webpack_require__(95); + + /** + * The base implementation of `_.flatten` with added support for restricting + * flattening and specifying the start index. + * + * @private + * @param {Array} array The array to flatten. + * @param {boolean} [isDeep] Specify a deep flatten. + * @param {boolean} [isStrict] Restrict flattening to arrays and `arguments` objects. + * @param {number} [fromIndex=0] The index to start from. + * @returns {Array} Returns the new flattened array. + */ + function baseFlatten(array, isDeep, isStrict, fromIndex) { + var index = (fromIndex || 0) - 1, + length = array.length, + resIndex = -1, + result = []; + + while (++index < length) { + var value = array[index]; + + if (isObjectLike(value) && isLength(value.length) && (isArray(value) || isArguments(value))) { + if (isDeep) { + // Recursively flatten arrays (susceptible to call stack limits). + value = baseFlatten(value, isDeep, isStrict); + } + var valIndex = -1, + valLength = value.length; + + result.length += valLength; + while (++valIndex < valLength) { + result[++resIndex] = value[valIndex]; + } + } else if (!isStrict) { + result[++resIndex] = value; + } + } + return result; + } + + module.exports = baseFlatten; + + +/***/ }, +/* 104 */ +/***/ function(module, exports, __webpack_require__) { + + var identity = __webpack_require__(192); + + /** + * A specialized version of `baseCallback` which only supports `this` binding + * and specifying the number of arguments to provide to `func`. + * + * @private + * @param {Function} func The function to bind. + * @param {*} thisArg The `this` binding of `func`. + * @param {number} [argCount] The number of arguments to provide to `func`. + * @returns {Function} Returns the callback. + */ + function bindCallback(func, thisArg, argCount) { + if (typeof func != 'function') { + return identity; + } + if (typeof thisArg == 'undefined') { + return func; + } + switch (argCount) { + case 1: return function(value) { + return func.call(thisArg, value); + }; + case 3: return function(value, index, collection) { + return func.call(thisArg, value, index, collection); + }; + case 4: return function(accumulator, value, index, collection) { + return func.call(thisArg, accumulator, value, index, collection); + }; + case 5: return function(value, other, key, object, source) { + return func.call(thisArg, value, other, key, object, source); + }; + } + return function() { + return func.apply(thisArg, arguments); + }; + } + + module.exports = bindCallback; + + +/***/ }, +/* 105 */ +/***/ function(module, exports, __webpack_require__) { + + var toObject = __webpack_require__(203); + + /** + * A specialized version of `_.pick` that picks `object` properties specified + * by the `props` array. + * + * @private + * @param {Object} object The source object. + * @param {string[]} props The property names to pick. + * @returns {Object} Returns the new object. + */ + function pickByArray(object, props) { + object = toObject(object); + + var index = -1, + length = props.length, + result = {}; + + while (++index < length) { + var key = props[index]; + if (key in object) { + result[key] = object[key]; + } + } + return result; + } + + module.exports = pickByArray; + + +/***/ }, +/* 106 */ +/***/ function(module, exports, __webpack_require__) { + + var baseForIn = __webpack_require__(204); + + /** + * A specialized version of `_.pick` that picks `object` properties `predicate` + * returns truthy for. + * + * @private + * @param {Object} object The source object. + * @param {Function} predicate The function invoked per iteration. + * @returns {Object} Returns the new object. + */ + function pickByCallback(object, predicate) { + var result = {}; + baseForIn(object, function(value, key, object) { + if (predicate(value, key, object)) { + result[key] = value; + } + }); + return result; + } + + module.exports = pickByCallback; + + +/***/ }, +/* 107 */ +/***/ function(module, exports, __webpack_require__) { + + /** + * The base implementation of `_.slice` without an iteratee call guard. + * + * @private + * @param {Array} array The array to slice. + * @param {number} [start=0] The start position. + * @param {number} [end=array.length] The end position. + * @returns {Array} Returns the slice of `array`. + */ + function baseSlice(array, start, end) { + var index = -1, + length = array.length; + + start = start == null ? 0 : (+start || 0); + if (start < 0) { + start = -start > length ? 0 : (length + start); + } + end = (typeof end == 'undefined' || end > length) ? length : (+end || 0); + if (end < 0) { + end += length; + } + length = start > end ? 0 : (end - start); + + var result = Array(length); + while (++index < length) { + result[index] = array[index + start]; + } + return result; + } + + module.exports = baseSlice; + + +/***/ }, +/* 108 */ +/***/ function(module, exports, __webpack_require__) { + + var baseSetData = __webpack_require__(205), + createBindWrapper = __webpack_require__(206), + createHybridWrapper = __webpack_require__(207), + createPartialWrapper = __webpack_require__(208), + getData = __webpack_require__(209), + isFunction = __webpack_require__(93), + mergeData = __webpack_require__(210), + setData = __webpack_require__(211); + + /** Used to compose bitmasks for wrapper metadata. */ + var BIND_FLAG = 1, + BIND_KEY_FLAG = 2, + PARTIAL_FLAG = 32, + PARTIAL_RIGHT_FLAG = 64; + + /** Used as the `TypeError` message for "Functions" methods. */ + var FUNC_ERROR_TEXT = 'Expected a function'; + + /* Native method references for those with the same name as other `lodash` methods. */ + var nativeMax = Math.max; + + /** + * Creates a function that either curries or invokes `func` with optional + * `this` binding and partially applied arguments. + * + * @private + * @param {Function|string} func The function or method name to reference. + * @param {number} bitmask The bitmask of flags. + * The bitmask may be composed of the following flags: + * 1 - `_.bind` + * 2 - `_.bindKey` + * 4 - `_.curry` or `_.curryRight` of a bound function + * 8 - `_.curry` + * 16 - `_.curryRight` + * 32 - `_.partial` + * 64 - `_.partialRight` + * 128 - `_.rearg` + * 256 - `_.ary` + * @param {*} [thisArg] The `this` binding of `func`. + * @param {Array} [partials] The arguments to be partially applied. + * @param {Array} [holders] The `partials` placeholder indexes. + * @param {Array} [argPos] The argument positions of the new function. + * @param {number} [ary] The arity cap of `func`. + * @param {number} [arity] The arity of `func`. + * @returns {Function} Returns the new wrapped function. + */ + function createWrapper(func, bitmask, thisArg, partials, holders, argPos, ary, arity) { + var isBindKey = bitmask & BIND_KEY_FLAG; + if (!isBindKey && !isFunction(func)) { + throw new TypeError(FUNC_ERROR_TEXT); + } + var length = partials ? partials.length : 0; + if (!length) { + bitmask &= ~(PARTIAL_FLAG | PARTIAL_RIGHT_FLAG); + partials = holders = null; + } + length -= (holders ? holders.length : 0); + if (bitmask & PARTIAL_RIGHT_FLAG) { + var partialsRight = partials, + holdersRight = holders; + + partials = holders = null; + } + var data = !isBindKey && getData(func), + newData = [func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity]; + + if (data && data !== true) { + mergeData(newData, data); + bitmask = newData[1]; + arity = newData[9]; + } + newData[9] = arity == null + ? (isBindKey ? 0 : func.length) + : (nativeMax(arity - length, 0) || 0); + + if (bitmask == BIND_FLAG) { + var result = createBindWrapper(newData[0], newData[2]); + } else if ((bitmask == PARTIAL_FLAG || bitmask == (BIND_FLAG | PARTIAL_FLAG)) && !newData[4].length) { + result = createPartialWrapper.apply(null, newData); + } else { + result = createHybridWrapper.apply(null, newData); + } + var setter = data ? baseSetData : setData; + return setter(result, newData); + } + + module.exports = createWrapper; + + +/***/ }, +/* 109 */ +/***/ function(module, exports, __webpack_require__) { + + /** Used as the internal argument placeholder. */ + var PLACEHOLDER = '__lodash_placeholder__'; + + /** + * Replaces all `placeholder` elements in `array` with an internal placeholder + * and returns an array of their indexes. + * + * @private + * @param {Array} array The array to modify. + * @param {*} placeholder The placeholder to replace. + * @returns {Array} Returns the new array of placeholder indexes. + */ + function replaceHolders(array, placeholder) { + var index = -1, + length = array.length, + resIndex = -1, + result = []; + + while (++index < length) { + if (array[index] === placeholder) { + array[index] = PLACEHOLDER; + result[++resIndex] = index; + } + } + return result; + } + + module.exports = replaceHolders; + + +/***/ }, +/* 110 */ +/***/ function(module, exports, __webpack_require__) { + + /* WEBPACK VAR INJECTION */(function(process) {/** + * Copyright 2013-2014, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule PooledClass + */ + + "use strict"; + + var invariant = __webpack_require__(79); + + /** + * Static poolers. Several custom versions for each potential number of + * arguments. A completely generic pooler is easy to implement, but would + * require accessing the `arguments` object. In each of these, `this` refers to + * the Class itself, not an instance. If any others are needed, simply add them + * here, or in their own files. + */ + var oneArgumentPooler = function(copyFieldsFrom) { + var Klass = this; + if (Klass.instancePool.length) { + var instance = Klass.instancePool.pop(); + Klass.call(instance, copyFieldsFrom); + return instance; + } else { + return new Klass(copyFieldsFrom); + } + }; + + var twoArgumentPooler = function(a1, a2) { + var Klass = this; + if (Klass.instancePool.length) { + var instance = Klass.instancePool.pop(); + Klass.call(instance, a1, a2); + return instance; + } else { + return new Klass(a1, a2); + } + }; + + var threeArgumentPooler = function(a1, a2, a3) { + var Klass = this; + if (Klass.instancePool.length) { + var instance = Klass.instancePool.pop(); + Klass.call(instance, a1, a2, a3); + return instance; + } else { + return new Klass(a1, a2, a3); + } + }; + + var fiveArgumentPooler = function(a1, a2, a3, a4, a5) { + var Klass = this; + if (Klass.instancePool.length) { + var instance = Klass.instancePool.pop(); + Klass.call(instance, a1, a2, a3, a4, a5); + return instance; + } else { + return new Klass(a1, a2, a3, a4, a5); + } + }; + + var standardReleaser = function(instance) { + var Klass = this; + ("production" !== process.env.NODE_ENV ? invariant( + instance instanceof Klass, + 'Trying to release an instance into a pool of a different type.' + ) : invariant(instance instanceof Klass)); + if (instance.destructor) { + instance.destructor(); + } + if (Klass.instancePool.length < Klass.poolSize) { + Klass.instancePool.push(instance); + } + }; + + var DEFAULT_POOL_SIZE = 10; + var DEFAULT_POOLER = oneArgumentPooler; + + /** + * Augments `CopyConstructor` to be a poolable class, augmenting only the class + * itself (statically) not adding any prototypical fields. Any CopyConstructor + * you give this may have a `poolSize` property, and will look for a + * prototypical `destructor` on instances (optional). + * + * @param {Function} CopyConstructor Constructor that can be used to reset. + * @param {Function} pooler Customizable pooler. + */ + var addPoolingTo = function(CopyConstructor, pooler) { + var NewKlass = CopyConstructor; + NewKlass.instancePool = []; + NewKlass.getPooled = pooler || DEFAULT_POOLER; + if (!NewKlass.poolSize) { + NewKlass.poolSize = DEFAULT_POOL_SIZE; + } + NewKlass.release = standardReleaser; + return NewKlass; + }; + + var PooledClass = { + addPoolingTo: addPoolingTo, + oneArgumentPooler: oneArgumentPooler, + twoArgumentPooler: twoArgumentPooler, + threeArgumentPooler: threeArgumentPooler, + fiveArgumentPooler: fiveArgumentPooler + }; + + module.exports = PooledClass; + + /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(89))) + +/***/ }, +/* 111 */ +/***/ function(module, exports, __webpack_require__) { + + /* WEBPACK VAR INJECTION */(function(process) {/** + * Copyright 2013-2014, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule traverseAllChildren + */ + + "use strict"; + + var ReactElement = __webpack_require__(53); + var ReactInstanceHandles = __webpack_require__(58); + + var invariant = __webpack_require__(79); + + var SEPARATOR = ReactInstanceHandles.SEPARATOR; + var SUBSEPARATOR = ':'; + + /** + * TODO: Test that: + * 1. `mapChildren` transforms strings and numbers into `ReactTextComponent`. + * 2. it('should fail when supplied duplicate key', function() { + * 3. That a single child and an array with one item have the same key pattern. + * }); + */ + + var userProvidedKeyEscaperLookup = { + '=': '=0', + '.': '=1', + ':': '=2' + }; + + var userProvidedKeyEscapeRegex = /[=.:]/g; + + function userProvidedKeyEscaper(match) { + return userProvidedKeyEscaperLookup[match]; + } + + /** + * Generate a key string that identifies a component within a set. + * + * @param {*} component A component that could contain a manual key. + * @param {number} index Index that is used if a manual key is not provided. + * @return {string} + */ + function getComponentKey(component, index) { + if (component && component.key != null) { + // Explicit key + return wrapUserProvidedKey(component.key); + } + // Implicit key determined by the index in the set + return index.toString(36); + } + + /** + * Escape a component key so that it is safe to use in a reactid. + * + * @param {*} key Component key to be escaped. + * @return {string} An escaped string. + */ + function escapeUserProvidedKey(text) { + return ('' + text).replace( + userProvidedKeyEscapeRegex, + userProvidedKeyEscaper + ); + } + + /** + * Wrap a `key` value explicitly provided by the user to distinguish it from + * implicitly-generated keys generated by a component's index in its parent. + * + * @param {string} key Value of a user-provided `key` attribute + * @return {string} + */ + function wrapUserProvidedKey(key) { + return '$' + escapeUserProvidedKey(key); + } + + /** + * @param {?*} children Children tree container. + * @param {!string} nameSoFar Name of the key path so far. + * @param {!number} indexSoFar Number of children encountered until this point. + * @param {!function} callback Callback to invoke with each child found. + * @param {?*} traverseContext Used to pass information throughout the traversal + * process. + * @return {!number} The number of children in this subtree. + */ + var traverseAllChildrenImpl = + function(children, nameSoFar, indexSoFar, callback, traverseContext) { + var nextName, nextIndex; + var subtreeCount = 0; // Count of children found in the current subtree. + if (Array.isArray(children)) { + for (var i = 0; i < children.length; i++) { + var child = children[i]; + nextName = ( + nameSoFar + + (nameSoFar ? SUBSEPARATOR : SEPARATOR) + + getComponentKey(child, i) + ); + nextIndex = indexSoFar + subtreeCount; + subtreeCount += traverseAllChildrenImpl( + child, + nextName, + nextIndex, + callback, + traverseContext + ); + } + } else { + var type = typeof children; + var isOnlyChild = nameSoFar === ''; + // If it's the only child, treat the name as if it was wrapped in an array + // so that it's consistent if the number of children grows + var storageName = + isOnlyChild ? SEPARATOR + getComponentKey(children, 0) : nameSoFar; + if (children == null || type === 'boolean') { + // All of the above are perceived as null. + callback(traverseContext, null, storageName, indexSoFar); + subtreeCount = 1; + } else if (type === 'string' || type === 'number' || + ReactElement.isValidElement(children)) { + callback(traverseContext, children, storageName, indexSoFar); + subtreeCount = 1; + } else if (type === 'object') { + ("production" !== process.env.NODE_ENV ? invariant( + !children || children.nodeType !== 1, + 'traverseAllChildren(...): Encountered an invalid child; DOM ' + + 'elements are not valid children of React components.' + ) : invariant(!children || children.nodeType !== 1)); + for (var key in children) { + if (children.hasOwnProperty(key)) { + nextName = ( + nameSoFar + (nameSoFar ? SUBSEPARATOR : SEPARATOR) + + wrapUserProvidedKey(key) + SUBSEPARATOR + + getComponentKey(children[key], 0) + ); + nextIndex = indexSoFar + subtreeCount; + subtreeCount += traverseAllChildrenImpl( + children[key], + nextName, + nextIndex, + callback, + traverseContext + ); + } + } + } + } + return subtreeCount; + }; + + /** + * Traverses children that are typically specified as `props.children`, but + * might also be specified through attributes: + * + * - `traverseAllChildren(this.props.children, ...)` + * - `traverseAllChildren(this.props.leftPanelChildren, ...)` + * + * The `traverseContext` is an optional argument that is passed through the + * entire traversal. It can be used to store accumulations or anything else that + * the callback might find relevant. + * + * @param {?*} children Children tree object. + * @param {!function} callback To invoke upon traversing each child. + * @param {?*} traverseContext Context for traversal. + * @return {!number} The number of children in this subtree. + */ + function traverseAllChildren(children, callback, traverseContext) { + if (children == null) { + return 0; + } + + return traverseAllChildrenImpl(children, '', 0, callback, traverseContext); + } + + module.exports = traverseAllChildren; + + /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(89))) + +/***/ }, +/* 112 */ +/***/ function(module, exports, __webpack_require__) { + + /* WEBPACK VAR INJECTION */(function(process) {/** + * Copyright 2013-2014, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule DOMProperty + * @typechecks static-only + */ + + /*jslint bitwise: true */ + + "use strict"; + + var invariant = __webpack_require__(79); + + function checkMask(value, bitmask) { + return (value & bitmask) === bitmask; + } + + var DOMPropertyInjection = { + /** + * Mapping from normalized, camelcased property names to a configuration that + * specifies how the associated DOM property should be accessed or rendered. + */ + MUST_USE_ATTRIBUTE: 0x1, + MUST_USE_PROPERTY: 0x2, + HAS_SIDE_EFFECTS: 0x4, + HAS_BOOLEAN_VALUE: 0x8, + HAS_NUMERIC_VALUE: 0x10, + HAS_POSITIVE_NUMERIC_VALUE: 0x20 | 0x10, + HAS_OVERLOADED_BOOLEAN_VALUE: 0x40, + + /** + * Inject some specialized knowledge about the DOM. This takes a config object + * with the following properties: + * + * isCustomAttribute: function that given an attribute name will return true + * if it can be inserted into the DOM verbatim. Useful for data-* or aria-* + * attributes where it's impossible to enumerate all of the possible + * attribute names, + * + * Properties: object mapping DOM property name to one of the + * DOMPropertyInjection constants or null. If your attribute isn't in here, + * it won't get written to the DOM. + * + * DOMAttributeNames: object mapping React attribute name to the DOM + * attribute name. Attribute names not specified use the **lowercase** + * normalized name. + * + * DOMPropertyNames: similar to DOMAttributeNames but for DOM properties. + * Property names not specified use the normalized name. + * + * DOMMutationMethods: Properties that require special mutation methods. If + * `value` is undefined, the mutation method should unset the property. + * + * @param {object} domPropertyConfig the config as described above. + */ + injectDOMPropertyConfig: function(domPropertyConfig) { + var Properties = domPropertyConfig.Properties || {}; + var DOMAttributeNames = domPropertyConfig.DOMAttributeNames || {}; + var DOMPropertyNames = domPropertyConfig.DOMPropertyNames || {}; + var DOMMutationMethods = domPropertyConfig.DOMMutationMethods || {}; + + if (domPropertyConfig.isCustomAttribute) { + DOMProperty._isCustomAttributeFunctions.push( + domPropertyConfig.isCustomAttribute + ); + } + + for (var propName in Properties) { + ("production" !== process.env.NODE_ENV ? invariant( + !DOMProperty.isStandardName.hasOwnProperty(propName), + 'injectDOMPropertyConfig(...): You\'re trying to inject DOM property ' + + '\'%s\' which has already been injected. You may be accidentally ' + + 'injecting the same DOM property config twice, or you may be ' + + 'injecting two configs that have conflicting property names.', + propName + ) : invariant(!DOMProperty.isStandardName.hasOwnProperty(propName))); + + DOMProperty.isStandardName[propName] = true; + + var lowerCased = propName.toLowerCase(); + DOMProperty.getPossibleStandardName[lowerCased] = propName; + + if (DOMAttributeNames.hasOwnProperty(propName)) { + var attributeName = DOMAttributeNames[propName]; + DOMProperty.getPossibleStandardName[attributeName] = propName; + DOMProperty.getAttributeName[propName] = attributeName; + } else { + DOMProperty.getAttributeName[propName] = lowerCased; + } + + DOMProperty.getPropertyName[propName] = + DOMPropertyNames.hasOwnProperty(propName) ? + DOMPropertyNames[propName] : + propName; + + if (DOMMutationMethods.hasOwnProperty(propName)) { + DOMProperty.getMutationMethod[propName] = DOMMutationMethods[propName]; + } else { + DOMProperty.getMutationMethod[propName] = null; + } + + var propConfig = Properties[propName]; + DOMProperty.mustUseAttribute[propName] = + checkMask(propConfig, DOMPropertyInjection.MUST_USE_ATTRIBUTE); + DOMProperty.mustUseProperty[propName] = + checkMask(propConfig, DOMPropertyInjection.MUST_USE_PROPERTY); + DOMProperty.hasSideEffects[propName] = + checkMask(propConfig, DOMPropertyInjection.HAS_SIDE_EFFECTS); + DOMProperty.hasBooleanValue[propName] = + checkMask(propConfig, DOMPropertyInjection.HAS_BOOLEAN_VALUE); + DOMProperty.hasNumericValue[propName] = + checkMask(propConfig, DOMPropertyInjection.HAS_NUMERIC_VALUE); + DOMProperty.hasPositiveNumericValue[propName] = + checkMask(propConfig, DOMPropertyInjection.HAS_POSITIVE_NUMERIC_VALUE); + DOMProperty.hasOverloadedBooleanValue[propName] = + checkMask(propConfig, DOMPropertyInjection.HAS_OVERLOADED_BOOLEAN_VALUE); + + ("production" !== process.env.NODE_ENV ? invariant( + !DOMProperty.mustUseAttribute[propName] || + !DOMProperty.mustUseProperty[propName], + 'DOMProperty: Cannot require using both attribute and property: %s', + propName + ) : invariant(!DOMProperty.mustUseAttribute[propName] || + !DOMProperty.mustUseProperty[propName])); + ("production" !== process.env.NODE_ENV ? invariant( + DOMProperty.mustUseProperty[propName] || + !DOMProperty.hasSideEffects[propName], + 'DOMProperty: Properties that have side effects must use property: %s', + propName + ) : invariant(DOMProperty.mustUseProperty[propName] || + !DOMProperty.hasSideEffects[propName])); + ("production" !== process.env.NODE_ENV ? invariant( + !!DOMProperty.hasBooleanValue[propName] + + !!DOMProperty.hasNumericValue[propName] + + !!DOMProperty.hasOverloadedBooleanValue[propName] <= 1, + 'DOMProperty: Value can be one of boolean, overloaded boolean, or ' + + 'numeric value, but not a combination: %s', + propName + ) : invariant(!!DOMProperty.hasBooleanValue[propName] + + !!DOMProperty.hasNumericValue[propName] + + !!DOMProperty.hasOverloadedBooleanValue[propName] <= 1)); + } + } + }; + var defaultValueCache = {}; + + /** + * DOMProperty exports lookup objects that can be used like functions: + * + * > DOMProperty.isValid['id'] + * true + * > DOMProperty.isValid['foobar'] + * undefined + * + * Although this may be confusing, it performs better in general. + * + * @see http://jsperf.com/key-exists + * @see http://jsperf.com/key-missing + */ + var DOMProperty = { + + ID_ATTRIBUTE_NAME: 'data-reactid', + + /** + * Checks whether a property name is a standard property. + * @type {Object} + */ + isStandardName: {}, + + /** + * Mapping from lowercase property names to the properly cased version, used + * to warn in the case of missing properties. + * @type {Object} + */ + getPossibleStandardName: {}, + + /** + * Mapping from normalized names to attribute names that differ. Attribute + * names are used when rendering markup or with `*Attribute()`. + * @type {Object} + */ + getAttributeName: {}, + + /** + * Mapping from normalized names to properties on DOM node instances. + * (This includes properties that mutate due to external factors.) + * @type {Object} + */ + getPropertyName: {}, + + /** + * Mapping from normalized names to mutation methods. This will only exist if + * mutation cannot be set simply by the property or `setAttribute()`. + * @type {Object} + */ + getMutationMethod: {}, + + /** + * Whether the property must be accessed and mutated as an object property. + * @type {Object} + */ + mustUseAttribute: {}, + + /** + * Whether the property must be accessed and mutated using `*Attribute()`. + * (This includes anything that fails ` in `.) + * @type {Object} + */ + mustUseProperty: {}, + + /** + * Whether or not setting a value causes side effects such as triggering + * resources to be loaded or text selection changes. We must ensure that + * the value is only set if it has changed. + * @type {Object} + */ + hasSideEffects: {}, + + /** + * Whether the property should be removed when set to a falsey value. + * @type {Object} + */ + hasBooleanValue: {}, + + /** + * Whether the property must be numeric or parse as a + * numeric and should be removed when set to a falsey value. + * @type {Object} + */ + hasNumericValue: {}, + + /** + * Whether the property must be positive numeric or parse as a positive + * numeric and should be removed when set to a falsey value. + * @type {Object} + */ + hasPositiveNumericValue: {}, + + /** + * Whether the property can be used as a flag as well as with a value. Removed + * when strictly equal to false; present without a value when strictly equal + * to true; present with a value otherwise. + * @type {Object} + */ + hasOverloadedBooleanValue: {}, + + /** + * All of the isCustomAttribute() functions that have been injected. + */ + _isCustomAttributeFunctions: [], + + /** + * Checks whether a property name is a custom attribute. + * @method + */ + isCustomAttribute: function(attributeName) { + for (var i = 0; i < DOMProperty._isCustomAttributeFunctions.length; i++) { + var isCustomAttributeFn = DOMProperty._isCustomAttributeFunctions[i]; + if (isCustomAttributeFn(attributeName)) { + return true; + } + } + return false; + }, + + /** + * Returns the default property value for a DOM property (i.e., not an + * attribute). Most default values are '' or false, but not all. Worse yet, + * some (in particular, `type`) vary depending on the type of element. + * + * TODO: Is it better to grab all the possible properties when creating an + * element to avoid having to create the same element twice? + */ + getDefaultValueForProperty: function(nodeName, prop) { + var nodeDefaults = defaultValueCache[nodeName]; + var testElement; + if (!nodeDefaults) { + defaultValueCache[nodeName] = nodeDefaults = {}; + } + if (!(prop in nodeDefaults)) { + testElement = document.createElement(nodeName); + nodeDefaults[prop] = testElement[prop]; + } + return nodeDefaults[prop]; + }, + + injection: DOMPropertyInjection + }; + + module.exports = DOMProperty; + + /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(89))) + +/***/ }, +/* 113 */ +/***/ function(module, exports, __webpack_require__) { + + /** + * Copyright 2013-2014, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule escapeTextForBrowser + * @typechecks static-only + */ + + "use strict"; + + var ESCAPE_LOOKUP = { + "&": "&", + ">": ">", + "<": "<", + "\"": """, + "'": "'" + }; + + var ESCAPE_REGEX = /[&><"']/g; + + function escaper(match) { + return ESCAPE_LOOKUP[match]; + } + + /** + * Escapes text to prevent scripting attacks. + * + * @param {*} text Text value to escape. + * @return {string} An escaped string. + */ + function escapeTextForBrowser(text) { + return ('' + text).replace(ESCAPE_REGEX, escaper); + } + + module.exports = escapeTextForBrowser; + + +/***/ }, +/* 114 */ +/***/ function(module, exports, __webpack_require__) { + + /** + * Copyright 2013-2014, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule memoizeStringOnly + * @typechecks static-only + */ + + "use strict"; + + /** + * Memoizes the return value of a function that accepts one string argument. + * + * @param {function} callback + * @return {function} + */ + function memoizeStringOnly(callback) { + var cache = {}; + return function(string) { + if (cache.hasOwnProperty(string)) { + return cache[string]; + } else { + return cache[string] = callback.call(this, string); + } + }; + } + + module.exports = memoizeStringOnly; + + +/***/ }, +/* 115 */ +/***/ function(module, exports, __webpack_require__) { + + /** + * Copyright 2013-2014, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule EventConstants + */ + + "use strict"; + + var keyMirror = __webpack_require__(118); + + var PropagationPhases = keyMirror({bubbled: null, captured: null}); + + /** + * Types of raw signals from the browser caught at the top level. + */ + var topLevelTypes = keyMirror({ + topBlur: null, + topChange: null, + topClick: null, + topCompositionEnd: null, + topCompositionStart: null, + topCompositionUpdate: null, + topContextMenu: null, + topCopy: null, + topCut: null, + topDoubleClick: null, + topDrag: null, + topDragEnd: null, + topDragEnter: null, + topDragExit: null, + topDragLeave: null, + topDragOver: null, + topDragStart: null, + topDrop: null, + topError: null, + topFocus: null, + topInput: null, + topKeyDown: null, + topKeyPress: null, + topKeyUp: null, + topLoad: null, + topMouseDown: null, + topMouseMove: null, + topMouseOut: null, + topMouseOver: null, + topMouseUp: null, + topPaste: null, + topReset: null, + topScroll: null, + topSelectionChange: null, + topSubmit: null, + topTextInput: null, + topTouchCancel: null, + topTouchEnd: null, + topTouchMove: null, + topTouchStart: null, + topWheel: null + }); + + var EventConstants = { + topLevelTypes: topLevelTypes, + PropagationPhases: PropagationPhases + }; + + module.exports = EventConstants; + + +/***/ }, +/* 116 */ +/***/ function(module, exports, __webpack_require__) { + + /* WEBPACK VAR INJECTION */(function(process) {/** + * Copyright 2013-2014, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule ReactOwner + */ + + "use strict"; + + var emptyObject = __webpack_require__(212); + var invariant = __webpack_require__(79); + + /** + * ReactOwners are capable of storing references to owned components. + * + * All components are capable of //being// referenced by owner components, but + * only ReactOwner components are capable of //referencing// owned components. + * The named reference is known as a "ref". + * + * Refs are available when mounted and updated during reconciliation. + * + * var MyComponent = React.createClass({ + * render: function() { + * return ( + *

    + * ); + * }, + * handleClick: function() { + * this.refs.custom.handleClick(); + * }, + * componentDidMount: function() { + * this.refs.custom.initialize(); + * } + * }); + * + * Refs should rarely be used. When refs are used, they should only be done to + * control data that is not handled by React's data flow. + * + * @class ReactOwner + */ + var ReactOwner = { + + /** + * @param {?object} object + * @return {boolean} True if `object` is a valid owner. + * @final + */ + isValidOwner: function(object) { + return !!( + object && + typeof object.attachRef === 'function' && + typeof object.detachRef === 'function' + ); + }, + + /** + * Adds a component by ref to an owner component. + * + * @param {ReactComponent} component Component to reference. + * @param {string} ref Name by which to refer to the component. + * @param {ReactOwner} owner Component on which to record the ref. + * @final + * @internal + */ + addComponentAsRefTo: function(component, ref, owner) { + ("production" !== process.env.NODE_ENV ? invariant( + ReactOwner.isValidOwner(owner), + 'addComponentAsRefTo(...): Only a ReactOwner can have refs. This ' + + 'usually means that you\'re trying to add a ref to a component that ' + + 'doesn\'t have an owner (that is, was not created inside of another ' + + 'component\'s `render` method). Try rendering this component inside of ' + + 'a new top-level component which will hold the ref.' + ) : invariant(ReactOwner.isValidOwner(owner))); + owner.attachRef(ref, component); + }, + + /** + * Removes a component by ref from an owner component. + * + * @param {ReactComponent} component Component to dereference. + * @param {string} ref Name of the ref to remove. + * @param {ReactOwner} owner Component on which the ref is recorded. + * @final + * @internal + */ + removeComponentAsRefFrom: function(component, ref, owner) { + ("production" !== process.env.NODE_ENV ? invariant( + ReactOwner.isValidOwner(owner), + 'removeComponentAsRefFrom(...): Only a ReactOwner can have refs. This ' + + 'usually means that you\'re trying to remove a ref to a component that ' + + 'doesn\'t have an owner (that is, was not created inside of another ' + + 'component\'s `render` method). Try rendering this component inside of ' + + 'a new top-level component which will hold the ref.' + ) : invariant(ReactOwner.isValidOwner(owner))); + // Check that `component` is still the current ref because we do not want to + // detach the ref if another component stole it. + if (owner.refs[ref] === component) { + owner.detachRef(ref); + } + }, + + /** + * A ReactComponent must mix this in to have refs. + * + * @lends {ReactOwner.prototype} + */ + Mixin: { + + construct: function() { + this.refs = emptyObject; + }, + + /** + * Lazily allocates the refs object and stores `component` as `ref`. + * + * @param {string} ref Reference name. + * @param {component} component Component to store as `ref`. + * @final + * @private + */ + attachRef: function(ref, component) { + ("production" !== process.env.NODE_ENV ? invariant( + component.isOwnedBy(this), + 'attachRef(%s, ...): Only a component\'s owner can store a ref to it.', + ref + ) : invariant(component.isOwnedBy(this))); + var refs = this.refs === emptyObject ? (this.refs = {}) : this.refs; + refs[ref] = component; + }, + + /** + * Detaches a reference name. + * + * @param {string} ref Name to dereference. + * @final + * @private + */ + detachRef: function(ref) { + delete this.refs[ref]; + } + + } + + }; + + module.exports = ReactOwner; + + /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(89))) + +/***/ }, +/* 117 */ +/***/ function(module, exports, __webpack_require__) { + + /* WEBPACK VAR INJECTION */(function(process) {/** + * Copyright 2013-2014, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule ReactUpdates + */ + + "use strict"; + + var CallbackQueue = __webpack_require__(213); + var PooledClass = __webpack_require__(110); + var ReactCurrentOwner = __webpack_require__(52); + var ReactPerf = __webpack_require__(62); + var Transaction = __webpack_require__(214); + + var assign = __webpack_require__(66); + var invariant = __webpack_require__(79); + var warning = __webpack_require__(78); + + var dirtyComponents = []; + var asapCallbackQueue = CallbackQueue.getPooled(); + var asapEnqueued = false; + + var batchingStrategy = null; + + function ensureInjected() { + ("production" !== process.env.NODE_ENV ? invariant( + ReactUpdates.ReactReconcileTransaction && batchingStrategy, + 'ReactUpdates: must inject a reconcile transaction class and batching ' + + 'strategy' + ) : invariant(ReactUpdates.ReactReconcileTransaction && batchingStrategy)); + } + + var NESTED_UPDATES = { + initialize: function() { + this.dirtyComponentsLength = dirtyComponents.length; + }, + close: function() { + if (this.dirtyComponentsLength !== dirtyComponents.length) { + // Additional updates were enqueued by componentDidUpdate handlers or + // similar; before our own UPDATE_QUEUEING wrapper closes, we want to run + // these new updates so that if A's componentDidUpdate calls setState on + // B, B will update before the callback A's updater provided when calling + // setState. + dirtyComponents.splice(0, this.dirtyComponentsLength); + flushBatchedUpdates(); + } else { + dirtyComponents.length = 0; + } + } + }; + + var UPDATE_QUEUEING = { + initialize: function() { + this.callbackQueue.reset(); + }, + close: function() { + this.callbackQueue.notifyAll(); + } + }; + + var TRANSACTION_WRAPPERS = [NESTED_UPDATES, UPDATE_QUEUEING]; + + function ReactUpdatesFlushTransaction() { + this.reinitializeTransaction(); + this.dirtyComponentsLength = null; + this.callbackQueue = CallbackQueue.getPooled(); + this.reconcileTransaction = + ReactUpdates.ReactReconcileTransaction.getPooled(); + } + + assign( + ReactUpdatesFlushTransaction.prototype, + Transaction.Mixin, { + getTransactionWrappers: function() { + return TRANSACTION_WRAPPERS; + }, + + destructor: function() { + this.dirtyComponentsLength = null; + CallbackQueue.release(this.callbackQueue); + this.callbackQueue = null; + ReactUpdates.ReactReconcileTransaction.release(this.reconcileTransaction); + this.reconcileTransaction = null; + }, + + perform: function(method, scope, a) { + // Essentially calls `this.reconcileTransaction.perform(method, scope, a)` + // with this transaction's wrappers around it. + return Transaction.Mixin.perform.call( + this, + this.reconcileTransaction.perform, + this.reconcileTransaction, + method, + scope, + a + ); + } + }); + + PooledClass.addPoolingTo(ReactUpdatesFlushTransaction); + + function batchedUpdates(callback, a, b) { + ensureInjected(); + batchingStrategy.batchedUpdates(callback, a, b); + } + + /** + * Array comparator for ReactComponents by owner depth + * + * @param {ReactComponent} c1 first component you're comparing + * @param {ReactComponent} c2 second component you're comparing + * @return {number} Return value usable by Array.prototype.sort(). + */ + function mountDepthComparator(c1, c2) { + return c1._mountDepth - c2._mountDepth; + } + + function runBatchedUpdates(transaction) { + var len = transaction.dirtyComponentsLength; + ("production" !== process.env.NODE_ENV ? invariant( + len === dirtyComponents.length, + 'Expected flush transaction\'s stored dirty-components length (%s) to ' + + 'match dirty-components array length (%s).', + len, + dirtyComponents.length + ) : invariant(len === dirtyComponents.length)); + + // Since reconciling a component higher in the owner hierarchy usually (not + // always -- see shouldComponentUpdate()) will reconcile children, reconcile + // them before their children by sorting the array. + dirtyComponents.sort(mountDepthComparator); + + for (var i = 0; i < len; i++) { + // If a component is unmounted before pending changes apply, ignore them + // TODO: Queue unmounts in the same list to avoid this happening at all + var component = dirtyComponents[i]; + if (component.isMounted()) { + // If performUpdateIfNecessary happens to enqueue any new updates, we + // shouldn't execute the callbacks until the next render happens, so + // stash the callbacks first + var callbacks = component._pendingCallbacks; + component._pendingCallbacks = null; + component.performUpdateIfNecessary(transaction.reconcileTransaction); + + if (callbacks) { + for (var j = 0; j < callbacks.length; j++) { + transaction.callbackQueue.enqueue( + callbacks[j], + component + ); + } + } + } + } + } + + var flushBatchedUpdates = ReactPerf.measure( + 'ReactUpdates', + 'flushBatchedUpdates', + function() { + // ReactUpdatesFlushTransaction's wrappers will clear the dirtyComponents + // array and perform any updates enqueued by mount-ready handlers (i.e., + // componentDidUpdate) but we need to check here too in order to catch + // updates enqueued by setState callbacks and asap calls. + while (dirtyComponents.length || asapEnqueued) { + if (dirtyComponents.length) { + var transaction = ReactUpdatesFlushTransaction.getPooled(); + transaction.perform(runBatchedUpdates, null, transaction); + ReactUpdatesFlushTransaction.release(transaction); + } + + if (asapEnqueued) { + asapEnqueued = false; + var queue = asapCallbackQueue; + asapCallbackQueue = CallbackQueue.getPooled(); + queue.notifyAll(); + CallbackQueue.release(queue); + } + } + } + ); + + /** + * Mark a component as needing a rerender, adding an optional callback to a + * list of functions which will be executed once the rerender occurs. + */ + function enqueueUpdate(component, callback) { + ("production" !== process.env.NODE_ENV ? invariant( + !callback || typeof callback === "function", + 'enqueueUpdate(...): You called `setProps`, `replaceProps`, ' + + '`setState`, `replaceState`, or `forceUpdate` with a callback that ' + + 'isn\'t callable.' + ) : invariant(!callback || typeof callback === "function")); + ensureInjected(); + + // Various parts of our code (such as ReactCompositeComponent's + // _renderValidatedComponent) assume that calls to render aren't nested; + // verify that that's the case. (This is called by each top-level update + // function, like setProps, setState, forceUpdate, etc.; creation and + // destruction of top-level components is guarded in ReactMount.) + ("production" !== process.env.NODE_ENV ? warning( + ReactCurrentOwner.current == null, + 'enqueueUpdate(): Render methods should be a pure function of props ' + + 'and state; triggering nested component updates from render is not ' + + 'allowed. If necessary, trigger nested updates in ' + + 'componentDidUpdate.' + ) : null); + + if (!batchingStrategy.isBatchingUpdates) { + batchingStrategy.batchedUpdates(enqueueUpdate, component, callback); + return; + } + + dirtyComponents.push(component); + + if (callback) { + if (component._pendingCallbacks) { + component._pendingCallbacks.push(callback); + } else { + component._pendingCallbacks = [callback]; + } + } + } + + /** + * Enqueue a callback to be run at the end of the current batching cycle. Throws + * if no updates are currently being performed. + */ + function asap(callback, context) { + ("production" !== process.env.NODE_ENV ? invariant( + batchingStrategy.isBatchingUpdates, + 'ReactUpdates.asap: Can\'t enqueue an asap callback in a context where' + + 'updates are not being batched.' + ) : invariant(batchingStrategy.isBatchingUpdates)); + asapCallbackQueue.enqueue(callback, context); + asapEnqueued = true; + } + + var ReactUpdatesInjection = { + injectReconcileTransaction: function(ReconcileTransaction) { + ("production" !== process.env.NODE_ENV ? invariant( + ReconcileTransaction, + 'ReactUpdates: must provide a reconcile transaction class' + ) : invariant(ReconcileTransaction)); + ReactUpdates.ReactReconcileTransaction = ReconcileTransaction; + }, + + injectBatchingStrategy: function(_batchingStrategy) { + ("production" !== process.env.NODE_ENV ? invariant( + _batchingStrategy, + 'ReactUpdates: must provide a batching strategy' + ) : invariant(_batchingStrategy)); + ("production" !== process.env.NODE_ENV ? invariant( + typeof _batchingStrategy.batchedUpdates === 'function', + 'ReactUpdates: must provide a batchedUpdates() function' + ) : invariant(typeof _batchingStrategy.batchedUpdates === 'function')); + ("production" !== process.env.NODE_ENV ? invariant( + typeof _batchingStrategy.isBatchingUpdates === 'boolean', + 'ReactUpdates: must provide an isBatchingUpdates boolean attribute' + ) : invariant(typeof _batchingStrategy.isBatchingUpdates === 'boolean')); + batchingStrategy = _batchingStrategy; + } + }; + + var ReactUpdates = { + /** + * React references `ReactReconcileTransaction` using this property in order + * to allow dependency injection. + * + * @internal + */ + ReactReconcileTransaction: null, + + batchedUpdates: batchedUpdates, + enqueueUpdate: enqueueUpdate, + flushBatchedUpdates: flushBatchedUpdates, + injection: ReactUpdatesInjection, + asap: asap + }; + + module.exports = ReactUpdates; + + /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(89))) + +/***/ }, +/* 118 */ +/***/ function(module, exports, __webpack_require__) { + + /* WEBPACK VAR INJECTION */(function(process) {/** + * Copyright 2013-2014, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule keyMirror + * @typechecks static-only + */ + + "use strict"; + + var invariant = __webpack_require__(79); + + /** + * Constructs an enumeration with keys equal to their value. + * + * For example: + * + * var COLORS = keyMirror({blue: null, red: null}); + * var myColor = COLORS.blue; + * var isColorValid = !!COLORS[myColor]; + * + * The last line could not be performed if the values of the generated enum were + * not equal to their keys. + * + * Input: {key1: val1, key2: val2} + * Output: {key1: key1, key2: key2} + * + * @param {object} obj + * @return {object} + */ + var keyMirror = function(obj) { + var ret = {}; + var key; + ("production" !== process.env.NODE_ENV ? invariant( + obj instanceof Object && !Array.isArray(obj), + 'keyMirror(...): Argument must be an object.' + ) : invariant(obj instanceof Object && !Array.isArray(obj))); + for (key in obj) { + if (!obj.hasOwnProperty(key)) { + continue; + } + ret[key] = key; + } + return ret; + }; + + module.exports = keyMirror; + + /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(89))) + +/***/ }, +/* 119 */ +/***/ function(module, exports, __webpack_require__) { + + /** + * Copyright 2013-2014, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule ReactPropTypeLocations + */ + + "use strict"; + + var keyMirror = __webpack_require__(118); + + var ReactPropTypeLocations = keyMirror({ + prop: null, + context: null, + childContext: null + }); + + module.exports = ReactPropTypeLocations; + + +/***/ }, +/* 120 */ +/***/ function(module, exports, __webpack_require__) { + + /* WEBPACK VAR INJECTION */(function(process) {/** + * Copyright 2014, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule monitorCodeUse + */ + + "use strict"; + + var invariant = __webpack_require__(79); + + /** + * Provides open-source compatible instrumentation for monitoring certain API + * uses before we're ready to issue a warning or refactor. It accepts an event + * name which may only contain the characters [a-z0-9_] and an optional data + * object with further information. + */ + + function monitorCodeUse(eventName, data) { + ("production" !== process.env.NODE_ENV ? invariant( + eventName && !/[^a-z0-9_]/.test(eventName), + 'You must provide an eventName using only the characters [a-z0-9_]' + ) : invariant(eventName && !/[^a-z0-9_]/.test(eventName))); + } + + module.exports = monitorCodeUse; + + /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(89))) + +/***/ }, +/* 121 */ +/***/ function(module, exports, __webpack_require__) { + + /* WEBPACK VAR INJECTION */(function(process) {/** + * Copyright 2014, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule ReactEmptyComponent + */ + + "use strict"; + + var ReactElement = __webpack_require__(53); + + var invariant = __webpack_require__(79); + + var component; + // This registry keeps track of the React IDs of the components that rendered to + // `null` (in reality a placeholder such as `noscript`) + var nullComponentIdsRegistry = {}; + + var ReactEmptyComponentInjection = { + injectEmptyComponent: function(emptyComponent) { + component = ReactElement.createFactory(emptyComponent); + } + }; + + /** + * @return {ReactComponent} component The injected empty component. + */ + function getEmptyComponent() { + ("production" !== process.env.NODE_ENV ? invariant( + component, + 'Trying to return null from a render, but no null placeholder component ' + + 'was injected.' + ) : invariant(component)); + return component(); + } + + /** + * Mark the component as having rendered to null. + * @param {string} id Component's `_rootNodeID`. + */ + function registerNullComponentID(id) { + nullComponentIdsRegistry[id] = true; + } + + /** + * Unmark the component as having rendered to null: it renders to something now. + * @param {string} id Component's `_rootNodeID`. + */ + function deregisterNullComponentID(id) { + delete nullComponentIdsRegistry[id]; + } + + /** + * @param {string} id Component's `_rootNodeID`. + * @return {boolean} True if the component is rendered to null. + */ + function isNullComponentID(id) { + return nullComponentIdsRegistry[id]; + } + + var ReactEmptyComponent = { + deregisterNullComponentID: deregisterNullComponentID, + getEmptyComponent: getEmptyComponent, + injection: ReactEmptyComponentInjection, + isNullComponentID: isNullComponentID, + registerNullComponentID: registerNullComponentID + }; + + module.exports = ReactEmptyComponent; + + /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(89))) + +/***/ }, +/* 122 */ +/***/ function(module, exports, __webpack_require__) { + + /** + * Copyright 2013-2014, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule ReactErrorUtils + * @typechecks + */ + + "use strict"; + + var ReactErrorUtils = { + /** + * Creates a guarded version of a function. This is supposed to make debugging + * of event handlers easier. To aid debugging with the browser's debugger, + * this currently simply returns the original function. + * + * @param {function} func Function to be executed + * @param {string} name The name of the guard + * @return {function} + */ + guard: function(func, name) { + return func; + } + }; + + module.exports = ReactErrorUtils; + + +/***/ }, +/* 123 */ +/***/ function(module, exports, __webpack_require__) { + + /* WEBPACK VAR INJECTION */(function(process) {/** + * Copyright 2013-2014, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule ReactPropTransferer + */ + + "use strict"; + + var assign = __webpack_require__(66); + var emptyFunction = __webpack_require__(163); + var invariant = __webpack_require__(79); + var joinClasses = __webpack_require__(215); + var warning = __webpack_require__(78); + + var didWarn = false; + + /** + * Creates a transfer strategy that will merge prop values using the supplied + * `mergeStrategy`. If a prop was previously unset, this just sets it. + * + * @param {function} mergeStrategy + * @return {function} + */ + function createTransferStrategy(mergeStrategy) { + return function(props, key, value) { + if (!props.hasOwnProperty(key)) { + props[key] = value; + } else { + props[key] = mergeStrategy(props[key], value); + } + }; + } + + var transferStrategyMerge = createTransferStrategy(function(a, b) { + // `merge` overrides the first object's (`props[key]` above) keys using the + // second object's (`value`) keys. An object's style's existing `propA` would + // get overridden. Flip the order here. + return assign({}, b, a); + }); + + /** + * Transfer strategies dictate how props are transferred by `transferPropsTo`. + * NOTE: if you add any more exceptions to this list you should be sure to + * update `cloneWithProps()` accordingly. + */ + var TransferStrategies = { + /** + * Never transfer `children`. + */ + children: emptyFunction, + /** + * Transfer the `className` prop by merging them. + */ + className: createTransferStrategy(joinClasses), + /** + * Transfer the `style` prop (which is an object) by merging them. + */ + style: transferStrategyMerge + }; + + /** + * Mutates the first argument by transferring the properties from the second + * argument. + * + * @param {object} props + * @param {object} newProps + * @return {object} + */ + function transferInto(props, newProps) { + for (var thisKey in newProps) { + if (!newProps.hasOwnProperty(thisKey)) { + continue; + } + + var transferStrategy = TransferStrategies[thisKey]; + + if (transferStrategy && TransferStrategies.hasOwnProperty(thisKey)) { + transferStrategy(props, thisKey, newProps[thisKey]); + } else if (!props.hasOwnProperty(thisKey)) { + props[thisKey] = newProps[thisKey]; + } + } + return props; + } + + /** + * ReactPropTransferer are capable of transferring props to another component + * using a `transferPropsTo` method. + * + * @class ReactPropTransferer + */ + var ReactPropTransferer = { + + TransferStrategies: TransferStrategies, + + /** + * Merge two props objects using TransferStrategies. + * + * @param {object} oldProps original props (they take precedence) + * @param {object} newProps new props to merge in + * @return {object} a new object containing both sets of props merged. + */ + mergeProps: function(oldProps, newProps) { + return transferInto(assign({}, oldProps), newProps); + }, + + /** + * @lends {ReactPropTransferer.prototype} + */ + Mixin: { + + /** + * Transfer props from this component to a target component. + * + * Props that do not have an explicit transfer strategy will be transferred + * only if the target component does not already have the prop set. + * + * This is usually used to pass down props to a returned root component. + * + * @param {ReactElement} element Component receiving the properties. + * @return {ReactElement} The supplied `component`. + * @final + * @protected + */ + transferPropsTo: function(element) { + ("production" !== process.env.NODE_ENV ? invariant( + element._owner === this, + '%s: You can\'t call transferPropsTo() on a component that you ' + + 'don\'t own, %s. This usually means you are calling ' + + 'transferPropsTo() on a component passed in as props or children.', + this.constructor.displayName, + typeof element.type === 'string' ? + element.type : + element.type.displayName + ) : invariant(element._owner === this)); + + if ("production" !== process.env.NODE_ENV) { + if (!didWarn) { + didWarn = true; + ("production" !== process.env.NODE_ENV ? warning( + false, + 'transferPropsTo is deprecated. ' + + 'See http://fb.me/react-transferpropsto for more information.' + ) : null); + } + } + + // Because elements are immutable we have to merge into the existing + // props object rather than clone it. + transferInto(element.props, this.props); + + return element; + } + + } + }; + + module.exports = ReactPropTransferer; + + /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(89))) + +/***/ }, +/* 124 */ +/***/ function(module, exports, __webpack_require__) { + + /* WEBPACK VAR INJECTION */(function(process) {/** + * Copyright 2013-2014, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule ReactPropTypeLocationNames + */ + + "use strict"; + + var ReactPropTypeLocationNames = {}; + + if ("production" !== process.env.NODE_ENV) { + ReactPropTypeLocationNames = { + prop: 'prop', + context: 'context', + childContext: 'child context' + }; + } + + module.exports = ReactPropTypeLocationNames; + + /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(89))) + +/***/ }, +/* 125 */ +/***/ function(module, exports, __webpack_require__) { + + /* WEBPACK VAR INJECTION */(function(process) {/** + * Copyright 2013-2014, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule instantiateReactComponent + * @typechecks static-only + */ + + "use strict"; + + var warning = __webpack_require__(78); + + var ReactElement = __webpack_require__(53); + var ReactLegacyElement = __webpack_require__(59); + var ReactNativeComponent = __webpack_require__(216); + var ReactEmptyComponent = __webpack_require__(121); + + /** + * Given an `element` create an instance that will actually be mounted. + * + * @param {object} element + * @param {*} parentCompositeType The composite type that resolved this. + * @return {object} A new instance of the element's constructor. + * @protected + */ + function instantiateReactComponent(element, parentCompositeType) { + var instance; + + if ("production" !== process.env.NODE_ENV) { + ("production" !== process.env.NODE_ENV ? warning( + element && (typeof element.type === 'function' || + typeof element.type === 'string'), + 'Only functions or strings can be mounted as React components.' + ) : null); + + // Resolve mock instances + if (element.type._mockedReactClassConstructor) { + // If this is a mocked class, we treat the legacy factory as if it was the + // class constructor for future proofing unit tests. Because this might + // be mocked as a legacy factory, we ignore any warnings triggerd by + // this temporary hack. + ReactLegacyElement._isLegacyCallWarningEnabled = false; + try { + instance = new element.type._mockedReactClassConstructor( + element.props + ); + } finally { + ReactLegacyElement._isLegacyCallWarningEnabled = true; + } + + // If the mock implementation was a legacy factory, then it returns a + // element. We need to turn this into a real component instance. + if (ReactElement.isValidElement(instance)) { + instance = new instance.type(instance.props); + } + + var render = instance.render; + if (!render) { + // For auto-mocked factories, the prototype isn't shimmed and therefore + // there is no render function on the instance. We replace the whole + // component with an empty component instance instead. + element = ReactEmptyComponent.getEmptyComponent(); + } else { + if (render._isMockFunction && !render._getMockImplementation()) { + // Auto-mocked components may have a prototype with a mocked render + // function. For those, we'll need to mock the result of the render + // since we consider undefined to be invalid results from render. + render.mockImplementation( + ReactEmptyComponent.getEmptyComponent + ); + } + instance.construct(element); + return instance; + } + } + } + + // Special case string values + if (typeof element.type === 'string') { + instance = ReactNativeComponent.createInstanceForTag( + element.type, + element.props, + parentCompositeType + ); + } else { + // Normal case for non-mocks and non-strings + instance = new element.type(element.props); + } + + if ("production" !== process.env.NODE_ENV) { + ("production" !== process.env.NODE_ENV ? warning( + typeof instance.construct === 'function' && + typeof instance.mountComponent === 'function' && + typeof instance.receiveComponent === 'function', + 'Only React Components can be mounted.' + ) : null); + } + + // This actually sets up the internal instance. This will become decoupled + // from the public instance in a future diff. + instance.construct(element); + + return instance; + } + + module.exports = instantiateReactComponent; + + /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(89))) + +/***/ }, +/* 126 */ +/***/ function(module, exports, __webpack_require__) { + + /** + * Copyright 2013-2014, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule keyOf + */ + + /** + * Allows extraction of a minified key. Let's the build system minify keys + * without loosing the ability to dynamically use key strings as values + * themselves. Pass in an object with a single key/val pair and it will return + * you the string key of that single record. Suppose you want to grab the + * value for a key 'className' inside of an object. Key/val minification may + * have aliased that key to be 'xa12'. keyOf({className: null}) will return + * 'xa12' in that case. Resolve keys you want to use once at startup time, then + * reuse those resolutions. + */ + var keyOf = function(oneKeyObj) { + var key; + for (key in oneKeyObj) { + if (!oneKeyObj.hasOwnProperty(key)) { + continue; + } + return key; + } + return null; + }; + + + module.exports = keyOf; + + +/***/ }, +/* 127 */ +/***/ function(module, exports, __webpack_require__) { + + /** + * Copyright 2013-2014, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule mapObject + */ + + 'use strict'; + + var hasOwnProperty = Object.prototype.hasOwnProperty; + + /** + * Executes the provided `callback` once for each enumerable own property in the + * object and constructs a new object from the results. The `callback` is + * invoked with three arguments: + * + * - the property value + * - the property name + * - the object being traversed + * + * Properties that are added after the call to `mapObject` will not be visited + * by `callback`. If the values of existing properties are changed, the value + * passed to `callback` will be the value at the time `mapObject` visits them. + * Properties that are deleted before being visited are not visited. + * + * @grep function objectMap() + * @grep function objMap() + * + * @param {?object} object + * @param {function} callback + * @param {*} context + * @return {?object} + */ + function mapObject(object, callback, context) { + if (!object) { + return null; + } + var result = {}; + for (var name in object) { + if (hasOwnProperty.call(object, name)) { + result[name] = callback.call(context, object[name], name, object); + } + } + return result; + } + + module.exports = mapObject; + + +/***/ }, +/* 128 */ +/***/ function(module, exports, __webpack_require__) { + + /** + * Copyright 2013-2014, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule shouldUpdateReactComponent + * @typechecks static-only + */ + + "use strict"; + + /** + * Given a `prevElement` and `nextElement`, determines if the existing + * instance should be updated as opposed to being destroyed or replaced by a new + * instance. Both arguments are elements. This ensures that this logic can + * operate on stateless trees without any backing instance. + * + * @param {?object} prevElement + * @param {?object} nextElement + * @return {boolean} True if the existing instance should be updated. + * @protected + */ + function shouldUpdateReactComponent(prevElement, nextElement) { + if (prevElement && nextElement && + prevElement.type === nextElement.type && + prevElement.key === nextElement.key && + prevElement._owner === nextElement._owner) { + return true; + } + return false; + } + + module.exports = shouldUpdateReactComponent; + + +/***/ }, +/* 129 */ +/***/ function(module, exports, __webpack_require__) { + + /* WEBPACK VAR INJECTION */(function(process) {/** + * Copyright 2013-2014, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule CSSPropertyOperations + * @typechecks static-only + */ + + "use strict"; + + var CSSProperty = __webpack_require__(217); + var ExecutionEnvironment = __webpack_require__(69); + + var camelizeStyleName = __webpack_require__(218); + var dangerousStyleValue = __webpack_require__(219); + var hyphenateStyleName = __webpack_require__(220); + var memoizeStringOnly = __webpack_require__(114); + var warning = __webpack_require__(78); + + var processStyleName = memoizeStringOnly(function(styleName) { + return hyphenateStyleName(styleName); + }); + + var styleFloatAccessor = 'cssFloat'; + if (ExecutionEnvironment.canUseDOM) { + // IE8 only supports accessing cssFloat (standard) as styleFloat + if (document.documentElement.style.cssFloat === undefined) { + styleFloatAccessor = 'styleFloat'; + } + } + + if ("production" !== process.env.NODE_ENV) { + var warnedStyleNames = {}; + + var warnHyphenatedStyleName = function(name) { + if (warnedStyleNames.hasOwnProperty(name) && warnedStyleNames[name]) { + return; + } + + warnedStyleNames[name] = true; + ("production" !== process.env.NODE_ENV ? warning( + false, + 'Unsupported style property ' + name + '. Did you mean ' + + camelizeStyleName(name) + '?' + ) : null); + }; + } + + /** + * Operations for dealing with CSS properties. + */ + var CSSPropertyOperations = { + + /** + * Serializes a mapping of style properties for use as inline styles: + * + * > createMarkupForStyles({width: '200px', height: 0}) + * "width:200px;height:0;" + * + * Undefined values are ignored so that declarative programming is easier. + * The result should be HTML-escaped before insertion into the DOM. + * + * @param {object} styles + * @return {?string} + */ + createMarkupForStyles: function(styles) { + var serialized = ''; + for (var styleName in styles) { + if (!styles.hasOwnProperty(styleName)) { + continue; + } + if ("production" !== process.env.NODE_ENV) { + if (styleName.indexOf('-') > -1) { + warnHyphenatedStyleName(styleName); + } + } + var styleValue = styles[styleName]; + if (styleValue != null) { + serialized += processStyleName(styleName) + ':'; + serialized += dangerousStyleValue(styleName, styleValue) + ';'; + } + } + return serialized || null; + }, + + /** + * Sets the value for multiple styles on a node. If a value is specified as + * '' (empty string), the corresponding style property will be unset. + * + * @param {DOMElement} node + * @param {object} styles + */ + setValueForStyles: function(node, styles) { + var style = node.style; + for (var styleName in styles) { + if (!styles.hasOwnProperty(styleName)) { + continue; + } + if ("production" !== process.env.NODE_ENV) { + if (styleName.indexOf('-') > -1) { + warnHyphenatedStyleName(styleName); + } + } + var styleValue = dangerousStyleValue(styleName, styles[styleName]); + if (styleName === 'float') { + styleName = styleFloatAccessor; + } + if (styleValue) { + style[styleName] = styleValue; + } else { + var expansion = CSSProperty.shorthandPropertyExpansions[styleName]; + if (expansion) { + // Shorthand property that IE8 won't like unsetting, so unset each + // component to placate it + for (var individualStyleName in expansion) { + style[individualStyleName] = ''; + } + } else { + style[styleName] = ''; + } + } + } + } + + }; + + module.exports = CSSPropertyOperations; + + /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(89))) + +/***/ }, +/* 130 */ +/***/ function(module, exports, __webpack_require__) { + + /* WEBPACK VAR INJECTION */(function(process) {/** + * Copyright 2013-2014, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule ReactBrowserComponentMixin + */ + + "use strict"; + + var ReactEmptyComponent = __webpack_require__(121); + var ReactMount = __webpack_require__(60); + + var invariant = __webpack_require__(79); + + var ReactBrowserComponentMixin = { + /** + * Returns the DOM node rendered by this component. + * + * @return {DOMElement} The root node of this component. + * @final + * @protected + */ + getDOMNode: function() { + ("production" !== process.env.NODE_ENV ? invariant( + this.isMounted(), + 'getDOMNode(): A component must be mounted to have a DOM node.' + ) : invariant(this.isMounted())); + if (ReactEmptyComponent.isNullComponentID(this._rootNodeID)) { + return null; + } + return ReactMount.getNode(this._rootNodeID); + } + }; + + module.exports = ReactBrowserComponentMixin; + + /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(89))) + +/***/ }, +/* 131 */ +/***/ function(module, exports, __webpack_require__) { + + /** + * Copyright 2013-2014, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule ReactBrowserEventEmitter + * @typechecks static-only + */ + + "use strict"; + + var EventConstants = __webpack_require__(115); + var EventPluginHub = __webpack_require__(223); + var EventPluginRegistry = __webpack_require__(224); + var ReactEventEmitterMixin = __webpack_require__(225); + var ViewportMetrics = __webpack_require__(226); + + var assign = __webpack_require__(66); + var isEventSupported = __webpack_require__(132); + + /** + * Summary of `ReactBrowserEventEmitter` event handling: + * + * - Top-level delegation is used to trap most native browser events. This + * may only occur in the main thread and is the responsibility of + * ReactEventListener, which is injected and can therefore support pluggable + * event sources. This is the only work that occurs in the main thread. + * + * - We normalize and de-duplicate events to account for browser quirks. This + * may be done in the worker thread. + * + * - Forward these native events (with the associated top-level type used to + * trap it) to `EventPluginHub`, which in turn will ask plugins if they want + * to extract any synthetic events. + * + * - The `EventPluginHub` will then process each event by annotating them with + * "dispatches", a sequence of listeners and IDs that care about that event. + * + * - The `EventPluginHub` then dispatches the events. + * + * Overview of React and the event system: + * + * +------------+ . + * | DOM | . + * +------------+ . + * | . + * v . + * +------------+ . + * | ReactEvent | . + * | Listener | . + * +------------+ . +-----------+ + * | . +--------+|SimpleEvent| + * | . | |Plugin | + * +-----|------+ . v +-----------+ + * | | | . +--------------+ +------------+ + * | +-----------.--->|EventPluginHub| | Event | + * | | . | | +-----------+ | Propagators| + * | ReactEvent | . | | |TapEvent | |------------| + * | Emitter | . | |<---+|Plugin | |other plugin| + * | | . | | +-----------+ | utilities | + * | +-----------.--->| | +------------+ + * | | | . +--------------+ + * +-----|------+ . ^ +-----------+ + * | . | |Enter/Leave| + * + . +-------+|Plugin | + * +-------------+ . +-----------+ + * | application | . + * |-------------| . + * | | . + * | | . + * +-------------+ . + * . + * React Core . General Purpose Event Plugin System + */ + + var alreadyListeningTo = {}; + var isMonitoringScrollValue = false; + var reactTopListenersCounter = 0; + + // For events like 'submit' which don't consistently bubble (which we trap at a + // lower node than `document`), binding at `document` would cause duplicate + // events so we don't include them here + var topEventMapping = { + topBlur: 'blur', + topChange: 'change', + topClick: 'click', + topCompositionEnd: 'compositionend', + topCompositionStart: 'compositionstart', + topCompositionUpdate: 'compositionupdate', + topContextMenu: 'contextmenu', + topCopy: 'copy', + topCut: 'cut', + topDoubleClick: 'dblclick', + topDrag: 'drag', + topDragEnd: 'dragend', + topDragEnter: 'dragenter', + topDragExit: 'dragexit', + topDragLeave: 'dragleave', + topDragOver: 'dragover', + topDragStart: 'dragstart', + topDrop: 'drop', + topFocus: 'focus', + topInput: 'input', + topKeyDown: 'keydown', + topKeyPress: 'keypress', + topKeyUp: 'keyup', + topMouseDown: 'mousedown', + topMouseMove: 'mousemove', + topMouseOut: 'mouseout', + topMouseOver: 'mouseover', + topMouseUp: 'mouseup', + topPaste: 'paste', + topScroll: 'scroll', + topSelectionChange: 'selectionchange', + topTextInput: 'textInput', + topTouchCancel: 'touchcancel', + topTouchEnd: 'touchend', + topTouchMove: 'touchmove', + topTouchStart: 'touchstart', + topWheel: 'wheel' + }; + + /** + * To ensure no conflicts with other potential React instances on the page + */ + var topListenersIDKey = "_reactListenersID" + String(Math.random()).slice(2); + + function getListeningForDocument(mountAt) { + // In IE8, `mountAt` is a host object and doesn't have `hasOwnProperty` + // directly. + if (!Object.prototype.hasOwnProperty.call(mountAt, topListenersIDKey)) { + mountAt[topListenersIDKey] = reactTopListenersCounter++; + alreadyListeningTo[mountAt[topListenersIDKey]] = {}; + } + return alreadyListeningTo[mountAt[topListenersIDKey]]; + } + + /** + * `ReactBrowserEventEmitter` is used to attach top-level event listeners. For + * example: + * + * ReactBrowserEventEmitter.putListener('myID', 'onClick', myFunction); + * + * This would allocate a "registration" of `('onClick', myFunction)` on 'myID'. + * + * @internal + */ + var ReactBrowserEventEmitter = assign({}, ReactEventEmitterMixin, { + + /** + * Injectable event backend + */ + ReactEventListener: null, + + injection: { + /** + * @param {object} ReactEventListener + */ + injectReactEventListener: function(ReactEventListener) { + ReactEventListener.setHandleTopLevel( + ReactBrowserEventEmitter.handleTopLevel + ); + ReactBrowserEventEmitter.ReactEventListener = ReactEventListener; + } + }, + + /** + * Sets whether or not any created callbacks should be enabled. + * + * @param {boolean} enabled True if callbacks should be enabled. + */ + setEnabled: function(enabled) { + if (ReactBrowserEventEmitter.ReactEventListener) { + ReactBrowserEventEmitter.ReactEventListener.setEnabled(enabled); + } + }, + + /** + * @return {boolean} True if callbacks are enabled. + */ + isEnabled: function() { + return !!( + ReactBrowserEventEmitter.ReactEventListener && + ReactBrowserEventEmitter.ReactEventListener.isEnabled() + ); + }, + + /** + * We listen for bubbled touch events on the document object. + * + * Firefox v8.01 (and possibly others) exhibited strange behavior when + * mounting `onmousemove` events at some node that was not the document + * element. The symptoms were that if your mouse is not moving over something + * contained within that mount point (for example on the background) the + * top-level listeners for `onmousemove` won't be called. However, if you + * register the `mousemove` on the document object, then it will of course + * catch all `mousemove`s. This along with iOS quirks, justifies restricting + * top-level listeners to the document object only, at least for these + * movement types of events and possibly all events. + * + * @see http://www.quirksmode.org/blog/archives/2010/09/click_event_del.html + * + * Also, `keyup`/`keypress`/`keydown` do not bubble to the window on IE, but + * they bubble to document. + * + * @param {string} registrationName Name of listener (e.g. `onClick`). + * @param {object} contentDocumentHandle Document which owns the container + */ + listenTo: function(registrationName, contentDocumentHandle) { + var mountAt = contentDocumentHandle; + var isListening = getListeningForDocument(mountAt); + var dependencies = EventPluginRegistry. + registrationNameDependencies[registrationName]; + + var topLevelTypes = EventConstants.topLevelTypes; + for (var i = 0, l = dependencies.length; i < l; i++) { + var dependency = dependencies[i]; + if (!( + isListening.hasOwnProperty(dependency) && + isListening[dependency] + )) { + if (dependency === topLevelTypes.topWheel) { + if (isEventSupported('wheel')) { + ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent( + topLevelTypes.topWheel, + 'wheel', + mountAt + ); + } else if (isEventSupported('mousewheel')) { + ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent( + topLevelTypes.topWheel, + 'mousewheel', + mountAt + ); + } else { + // Firefox needs to capture a different mouse scroll event. + // @see http://www.quirksmode.org/dom/events/tests/scroll.html + ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent( + topLevelTypes.topWheel, + 'DOMMouseScroll', + mountAt + ); + } + } else if (dependency === topLevelTypes.topScroll) { + + if (isEventSupported('scroll', true)) { + ReactBrowserEventEmitter.ReactEventListener.trapCapturedEvent( + topLevelTypes.topScroll, + 'scroll', + mountAt + ); + } else { + ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent( + topLevelTypes.topScroll, + 'scroll', + ReactBrowserEventEmitter.ReactEventListener.WINDOW_HANDLE + ); + } + } else if (dependency === topLevelTypes.topFocus || + dependency === topLevelTypes.topBlur) { + + if (isEventSupported('focus', true)) { + ReactBrowserEventEmitter.ReactEventListener.trapCapturedEvent( + topLevelTypes.topFocus, + 'focus', + mountAt + ); + ReactBrowserEventEmitter.ReactEventListener.trapCapturedEvent( + topLevelTypes.topBlur, + 'blur', + mountAt + ); + } else if (isEventSupported('focusin')) { + // IE has `focusin` and `focusout` events which bubble. + // @see http://www.quirksmode.org/blog/archives/2008/04/delegating_the.html + ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent( + topLevelTypes.topFocus, + 'focusin', + mountAt + ); + ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent( + topLevelTypes.topBlur, + 'focusout', + mountAt + ); + } + + // to make sure blur and focus event listeners are only attached once + isListening[topLevelTypes.topBlur] = true; + isListening[topLevelTypes.topFocus] = true; + } else if (topEventMapping.hasOwnProperty(dependency)) { + ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent( + dependency, + topEventMapping[dependency], + mountAt + ); + } + + isListening[dependency] = true; + } + } + }, + + trapBubbledEvent: function(topLevelType, handlerBaseName, handle) { + return ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent( + topLevelType, + handlerBaseName, + handle + ); + }, + + trapCapturedEvent: function(topLevelType, handlerBaseName, handle) { + return ReactBrowserEventEmitter.ReactEventListener.trapCapturedEvent( + topLevelType, + handlerBaseName, + handle + ); + }, + + /** + * Listens to window scroll and resize events. We cache scroll values so that + * application code can access them without triggering reflows. + * + * NOTE: Scroll events do not bubble. + * + * @see http://www.quirksmode.org/dom/events/scroll.html + */ + ensureScrollValueMonitoring: function(){ + if (!isMonitoringScrollValue) { + var refresh = ViewportMetrics.refreshScrollValues; + ReactBrowserEventEmitter.ReactEventListener.monitorScrollValue(refresh); + isMonitoringScrollValue = true; + } + }, + + eventNameDispatchConfigs: EventPluginHub.eventNameDispatchConfigs, + + registrationNameModules: EventPluginHub.registrationNameModules, + + putListener: EventPluginHub.putListener, + + getListener: EventPluginHub.getListener, + + deleteListener: EventPluginHub.deleteListener, + + deleteAllListeners: EventPluginHub.deleteAllListeners + + }); + + module.exports = ReactBrowserEventEmitter; + + +/***/ }, +/* 132 */ +/***/ function(module, exports, __webpack_require__) { + + /** + * Copyright 2013-2014, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule isEventSupported + */ + + "use strict"; + + var ExecutionEnvironment = __webpack_require__(69); + + var useHasFeature; + if (ExecutionEnvironment.canUseDOM) { + useHasFeature = + document.implementation && + document.implementation.hasFeature && + // always returns true in newer browsers as per the standard. + // @see http://dom.spec.whatwg.org/#dom-domimplementation-hasfeature + document.implementation.hasFeature('', '') !== true; + } + + /** + * Checks if an event is supported in the current execution environment. + * + * NOTE: This will not work correctly for non-generic events such as `change`, + * `reset`, `load`, `error`, and `select`. + * + * Borrows from Modernizr. + * + * @param {string} eventNameSuffix Event name, e.g. "click". + * @param {?boolean} capture Check if the capture phase is supported. + * @return {boolean} True if the event is supported. + * @internal + * @license Modernizr 3.0.0pre (Custom Build) | MIT + */ + function isEventSupported(eventNameSuffix, capture) { + if (!ExecutionEnvironment.canUseDOM || + capture && !('addEventListener' in document)) { + return false; + } + + var eventName = 'on' + eventNameSuffix; + var isSupported = eventName in document; + + if (!isSupported) { + var element = document.createElement('div'); + element.setAttribute(eventName, 'return;'); + isSupported = typeof element[eventName] === 'function'; + } + + if (!isSupported && useHasFeature && eventNameSuffix === 'wheel') { + // This is the only way to test support for the `wheel` event in IE9+. + isSupported = document.implementation.hasFeature('Events.wheel', '3.0'); + } + + return isSupported; + } + + module.exports = isEventSupported; + + +/***/ }, +/* 133 */ +/***/ function(module, exports, __webpack_require__) { + + /** + * Copyright 2013-2014, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule ReactRootIndex + * @typechecks + */ + + "use strict"; + + var ReactRootIndexInjection = { + /** + * @param {function} _createReactRootIndex + */ + injectCreateReactRootIndex: function(_createReactRootIndex) { + ReactRootIndex.createReactRootIndex = _createReactRootIndex; + } + }; + + var ReactRootIndex = { + createReactRootIndex: null, + injection: ReactRootIndexInjection + }; + + module.exports = ReactRootIndex; + + +/***/ }, +/* 134 */ +/***/ function(module, exports, __webpack_require__) { + + /** + * Copyright 2013 Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule BeforeInputEventPlugin + * @typechecks static-only + */ + + "use strict"; + + var EventConstants = __webpack_require__(115); + var EventPropagators = __webpack_require__(221); + var ExecutionEnvironment = __webpack_require__(69); + var SyntheticInputEvent = __webpack_require__(222); + + var keyOf = __webpack_require__(126); + + var canUseTextInputEvent = ( + ExecutionEnvironment.canUseDOM && + 'TextEvent' in window && + !('documentMode' in document || isPresto()) + ); + + /** + * Opera <= 12 includes TextEvent in window, but does not fire + * text input events. Rely on keypress instead. + */ + function isPresto() { + var opera = window.opera; + return ( + typeof opera === 'object' && + typeof opera.version === 'function' && + parseInt(opera.version(), 10) <= 12 + ); + } + + var SPACEBAR_CODE = 32; + var SPACEBAR_CHAR = String.fromCharCode(SPACEBAR_CODE); + + var topLevelTypes = EventConstants.topLevelTypes; + + // Events and their corresponding property names. + var eventTypes = { + beforeInput: { + phasedRegistrationNames: { + bubbled: keyOf({onBeforeInput: null}), + captured: keyOf({onBeforeInputCapture: null}) + }, + dependencies: [ + topLevelTypes.topCompositionEnd, + topLevelTypes.topKeyPress, + topLevelTypes.topTextInput, + topLevelTypes.topPaste + ] + } + }; + + // Track characters inserted via keypress and composition events. + var fallbackChars = null; + + // Track whether we've ever handled a keypress on the space key. + var hasSpaceKeypress = false; + + /** + * Return whether a native keypress event is assumed to be a command. + * This is required because Firefox fires `keypress` events for key commands + * (cut, copy, select-all, etc.) even though no character is inserted. + */ + function isKeypressCommand(nativeEvent) { + return ( + (nativeEvent.ctrlKey || nativeEvent.altKey || nativeEvent.metaKey) && + // ctrlKey && altKey is equivalent to AltGr, and is not a command. + !(nativeEvent.ctrlKey && nativeEvent.altKey) + ); + } + + /** + * Create an `onBeforeInput` event to match + * http://www.w3.org/TR/2013/WD-DOM-Level-3-Events-20131105/#events-inputevents. + * + * This event plugin is based on the native `textInput` event + * available in Chrome, Safari, Opera, and IE. This event fires after + * `onKeyPress` and `onCompositionEnd`, but before `onInput`. + * + * `beforeInput` is spec'd but not implemented in any browsers, and + * the `input` event does not provide any useful information about what has + * actually been added, contrary to the spec. Thus, `textInput` is the best + * available event to identify the characters that have actually been inserted + * into the target node. + */ + var BeforeInputEventPlugin = { + + eventTypes: eventTypes, + + /** + * @param {string} topLevelType Record from `EventConstants`. + * @param {DOMEventTarget} topLevelTarget The listening component root node. + * @param {string} topLevelTargetID ID of `topLevelTarget`. + * @param {object} nativeEvent Native browser event. + * @return {*} An accumulation of synthetic events. + * @see {EventPluginHub.extractEvents} + */ + extractEvents: function( + topLevelType, + topLevelTarget, + topLevelTargetID, + nativeEvent) { + + var chars; + + if (canUseTextInputEvent) { + switch (topLevelType) { + case topLevelTypes.topKeyPress: + /** + * If native `textInput` events are available, our goal is to make + * use of them. However, there is a special case: the spacebar key. + * In Webkit, preventing default on a spacebar `textInput` event + * cancels character insertion, but it *also* causes the browser + * to fall back to its default spacebar behavior of scrolling the + * page. + * + * Tracking at: + * https://code.google.com/p/chromium/issues/detail?id=355103 + * + * To avoid this issue, use the keypress event as if no `textInput` + * event is available. + */ + var which = nativeEvent.which; + if (which !== SPACEBAR_CODE) { + return; + } + + hasSpaceKeypress = true; + chars = SPACEBAR_CHAR; + break; + + case topLevelTypes.topTextInput: + // Record the characters to be added to the DOM. + chars = nativeEvent.data; + + // If it's a spacebar character, assume that we have already handled + // it at the keypress level and bail immediately. Android Chrome + // doesn't give us keycodes, so we need to blacklist it. + if (chars === SPACEBAR_CHAR && hasSpaceKeypress) { + return; + } + + // Otherwise, carry on. + break; + + default: + // For other native event types, do nothing. + return; + } + } else { + switch (topLevelType) { + case topLevelTypes.topPaste: + // If a paste event occurs after a keypress, throw out the input + // chars. Paste events should not lead to BeforeInput events. + fallbackChars = null; + break; + case topLevelTypes.topKeyPress: + /** + * As of v27, Firefox may fire keypress events even when no character + * will be inserted. A few possibilities: + * + * - `which` is `0`. Arrow keys, Esc key, etc. + * + * - `which` is the pressed key code, but no char is available. + * Ex: 'AltGr + d` in Polish. There is no modified character for + * this key combination and no character is inserted into the + * document, but FF fires the keypress for char code `100` anyway. + * No `input` event will occur. + * + * - `which` is the pressed key code, but a command combination is + * being used. Ex: `Cmd+C`. No character is inserted, and no + * `input` event will occur. + */ + if (nativeEvent.which && !isKeypressCommand(nativeEvent)) { + fallbackChars = String.fromCharCode(nativeEvent.which); + } + break; + case topLevelTypes.topCompositionEnd: + fallbackChars = nativeEvent.data; + break; + } + + // If no changes have occurred to the fallback string, no relevant + // event has fired and we're done. + if (fallbackChars === null) { + return; + } + + chars = fallbackChars; + } + + // If no characters are being inserted, no BeforeInput event should + // be fired. + if (!chars) { + return; + } + + var event = SyntheticInputEvent.getPooled( + eventTypes.beforeInput, + topLevelTargetID, + nativeEvent + ); + + event.data = chars; + fallbackChars = null; + EventPropagators.accumulateTwoPhaseDispatches(event); + return event; + } + }; + + module.exports = BeforeInputEventPlugin; + + +/***/ }, +/* 135 */ +/***/ function(module, exports, __webpack_require__) { + + /** + * Copyright 2013-2014, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule ChangeEventPlugin + */ + + "use strict"; + + var EventConstants = __webpack_require__(115); + var EventPluginHub = __webpack_require__(223); + var EventPropagators = __webpack_require__(221); + var ExecutionEnvironment = __webpack_require__(69); + var ReactUpdates = __webpack_require__(117); + var SyntheticEvent = __webpack_require__(227); + + var isEventSupported = __webpack_require__(132); + var isTextInputElement = __webpack_require__(228); + var keyOf = __webpack_require__(126); + + var topLevelTypes = EventConstants.topLevelTypes; + + var eventTypes = { + change: { + phasedRegistrationNames: { + bubbled: keyOf({onChange: null}), + captured: keyOf({onChangeCapture: null}) + }, + dependencies: [ + topLevelTypes.topBlur, + topLevelTypes.topChange, + topLevelTypes.topClick, + topLevelTypes.topFocus, + topLevelTypes.topInput, + topLevelTypes.topKeyDown, + topLevelTypes.topKeyUp, + topLevelTypes.topSelectionChange + ] + } + }; + + /** + * For IE shims + */ + var activeElement = null; + var activeElementID = null; + var activeElementValue = null; + var activeElementValueProp = null; + + /** + * SECTION: handle `change` event + */ + function shouldUseChangeEvent(elem) { + return ( + elem.nodeName === 'SELECT' || + (elem.nodeName === 'INPUT' && elem.type === 'file') + ); + } + + var doesChangeEventBubble = false; + if (ExecutionEnvironment.canUseDOM) { + // See `handleChange` comment below + doesChangeEventBubble = isEventSupported('change') && ( + !('documentMode' in document) || document.documentMode > 8 + ); + } + + function manualDispatchChangeEvent(nativeEvent) { + var event = SyntheticEvent.getPooled( + eventTypes.change, + activeElementID, + nativeEvent + ); + EventPropagators.accumulateTwoPhaseDispatches(event); + + // If change and propertychange bubbled, we'd just bind to it like all the + // other events and have it go through ReactBrowserEventEmitter. Since it + // doesn't, we manually listen for the events and so we have to enqueue and + // process the abstract event manually. + // + // Batching is necessary here in order to ensure that all event handlers run + // before the next rerender (including event handlers attached to ancestor + // elements instead of directly on the input). Without this, controlled + // components don't work properly in conjunction with event bubbling because + // the component is rerendered and the value reverted before all the event + // handlers can run. See https://github.com/facebook/react/issues/708. + ReactUpdates.batchedUpdates(runEventInBatch, event); + } + + function runEventInBatch(event) { + EventPluginHub.enqueueEvents(event); + EventPluginHub.processEventQueue(); + } + + function startWatchingForChangeEventIE8(target, targetID) { + activeElement = target; + activeElementID = targetID; + activeElement.attachEvent('onchange', manualDispatchChangeEvent); + } + + function stopWatchingForChangeEventIE8() { + if (!activeElement) { + return; + } + activeElement.detachEvent('onchange', manualDispatchChangeEvent); + activeElement = null; + activeElementID = null; + } + + function getTargetIDForChangeEvent( + topLevelType, + topLevelTarget, + topLevelTargetID) { + if (topLevelType === topLevelTypes.topChange) { + return topLevelTargetID; + } + } + function handleEventsForChangeEventIE8( + topLevelType, + topLevelTarget, + topLevelTargetID) { + if (topLevelType === topLevelTypes.topFocus) { + // stopWatching() should be a noop here but we call it just in case we + // missed a blur event somehow. + stopWatchingForChangeEventIE8(); + startWatchingForChangeEventIE8(topLevelTarget, topLevelTargetID); + } else if (topLevelType === topLevelTypes.topBlur) { + stopWatchingForChangeEventIE8(); + } + } + + + /** + * SECTION: handle `input` event + */ + var isInputEventSupported = false; + if (ExecutionEnvironment.canUseDOM) { + // IE9 claims to support the input event but fails to trigger it when + // deleting text, so we ignore its input events + isInputEventSupported = isEventSupported('input') && ( + !('documentMode' in document) || document.documentMode > 9 + ); + } + + /** + * (For old IE.) Replacement getter/setter for the `value` property that gets + * set on the active element. + */ + var newValueProp = { + get: function() { + return activeElementValueProp.get.call(this); + }, + set: function(val) { + // Cast to a string so we can do equality checks. + activeElementValue = '' + val; + activeElementValueProp.set.call(this, val); + } + }; + + /** + * (For old IE.) Starts tracking propertychange events on the passed-in element + * and override the value property so that we can distinguish user events from + * value changes in JS. + */ + function startWatchingForValueChange(target, targetID) { + activeElement = target; + activeElementID = targetID; + activeElementValue = target.value; + activeElementValueProp = Object.getOwnPropertyDescriptor( + target.constructor.prototype, + 'value' + ); + + Object.defineProperty(activeElement, 'value', newValueProp); + activeElement.attachEvent('onpropertychange', handlePropertyChange); + } + + /** + * (For old IE.) Removes the event listeners from the currently-tracked element, + * if any exists. + */ + function stopWatchingForValueChange() { + if (!activeElement) { + return; + } + + // delete restores the original property definition + delete activeElement.value; + activeElement.detachEvent('onpropertychange', handlePropertyChange); + + activeElement = null; + activeElementID = null; + activeElementValue = null; + activeElementValueProp = null; + } + + /** + * (For old IE.) Handles a propertychange event, sending a `change` event if + * the value of the active element has changed. + */ + function handlePropertyChange(nativeEvent) { + if (nativeEvent.propertyName !== 'value') { + return; + } + var value = nativeEvent.srcElement.value; + if (value === activeElementValue) { + return; + } + activeElementValue = value; + + manualDispatchChangeEvent(nativeEvent); + } + + /** + * If a `change` event should be fired, returns the target's ID. + */ + function getTargetIDForInputEvent( + topLevelType, + topLevelTarget, + topLevelTargetID) { + if (topLevelType === topLevelTypes.topInput) { + // In modern browsers (i.e., not IE8 or IE9), the input event is exactly + // what we want so fall through here and trigger an abstract event + return topLevelTargetID; + } + } + + // For IE8 and IE9. + function handleEventsForInputEventIE( + topLevelType, + topLevelTarget, + topLevelTargetID) { + if (topLevelType === topLevelTypes.topFocus) { + // In IE8, we can capture almost all .value changes by adding a + // propertychange handler and looking for events with propertyName + // equal to 'value' + // In IE9, propertychange fires for most input events but is buggy and + // doesn't fire when text is deleted, but conveniently, selectionchange + // appears to fire in all of the remaining cases so we catch those and + // forward the event if the value has changed + // In either case, we don't want to call the event handler if the value + // is changed from JS so we redefine a setter for `.value` that updates + // our activeElementValue variable, allowing us to ignore those changes + // + // stopWatching() should be a noop here but we call it just in case we + // missed a blur event somehow. + stopWatchingForValueChange(); + startWatchingForValueChange(topLevelTarget, topLevelTargetID); + } else if (topLevelType === topLevelTypes.topBlur) { + stopWatchingForValueChange(); + } + } + + // For IE8 and IE9. + function getTargetIDForInputEventIE( + topLevelType, + topLevelTarget, + topLevelTargetID) { + if (topLevelType === topLevelTypes.topSelectionChange || + topLevelType === topLevelTypes.topKeyUp || + topLevelType === topLevelTypes.topKeyDown) { + // On the selectionchange event, the target is just document which isn't + // helpful for us so just check activeElement instead. + // + // 99% of the time, keydown and keyup aren't necessary. IE8 fails to fire + // propertychange on the first input event after setting `value` from a + // script and fires only keydown, keypress, keyup. Catching keyup usually + // gets it and catching keydown lets us fire an event for the first + // keystroke if user does a key repeat (it'll be a little delayed: right + // before the second keystroke). Other input methods (e.g., paste) seem to + // fire selectionchange normally. + if (activeElement && activeElement.value !== activeElementValue) { + activeElementValue = activeElement.value; + return activeElementID; + } + } + } + + + /** + * SECTION: handle `click` event + */ + function shouldUseClickEvent(elem) { + // Use the `click` event to detect changes to checkbox and radio inputs. + // This approach works across all browsers, whereas `change` does not fire + // until `blur` in IE8. + return ( + elem.nodeName === 'INPUT' && + (elem.type === 'checkbox' || elem.type === 'radio') + ); + } + + function getTargetIDForClickEvent( + topLevelType, + topLevelTarget, + topLevelTargetID) { + if (topLevelType === topLevelTypes.topClick) { + return topLevelTargetID; + } + } + + /** + * This plugin creates an `onChange` event that normalizes change events + * across form elements. This event fires at a time when it's possible to + * change the element's value without seeing a flicker. + * + * Supported elements are: + * - input (see `isTextInputElement`) + * - textarea + * - select + */ + var ChangeEventPlugin = { + + eventTypes: eventTypes, + + /** + * @param {string} topLevelType Record from `EventConstants`. + * @param {DOMEventTarget} topLevelTarget The listening component root node. + * @param {string} topLevelTargetID ID of `topLevelTarget`. + * @param {object} nativeEvent Native browser event. + * @return {*} An accumulation of synthetic events. + * @see {EventPluginHub.extractEvents} + */ + extractEvents: function( + topLevelType, + topLevelTarget, + topLevelTargetID, + nativeEvent) { + + var getTargetIDFunc, handleEventFunc; + if (shouldUseChangeEvent(topLevelTarget)) { + if (doesChangeEventBubble) { + getTargetIDFunc = getTargetIDForChangeEvent; + } else { + handleEventFunc = handleEventsForChangeEventIE8; + } + } else if (isTextInputElement(topLevelTarget)) { + if (isInputEventSupported) { + getTargetIDFunc = getTargetIDForInputEvent; + } else { + getTargetIDFunc = getTargetIDForInputEventIE; + handleEventFunc = handleEventsForInputEventIE; + } + } else if (shouldUseClickEvent(topLevelTarget)) { + getTargetIDFunc = getTargetIDForClickEvent; + } + + if (getTargetIDFunc) { + var targetID = getTargetIDFunc( + topLevelType, + topLevelTarget, + topLevelTargetID + ); + if (targetID) { + var event = SyntheticEvent.getPooled( + eventTypes.change, + targetID, + nativeEvent + ); + EventPropagators.accumulateTwoPhaseDispatches(event); + return event; + } + } + + if (handleEventFunc) { + handleEventFunc( + topLevelType, + topLevelTarget, + topLevelTargetID + ); + } + } + + }; + + module.exports = ChangeEventPlugin; + + +/***/ }, +/* 136 */ +/***/ function(module, exports, __webpack_require__) { + + /** + * Copyright 2013-2014, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule ClientReactRootIndex + * @typechecks + */ + + "use strict"; + + var nextReactRootIndex = 0; + + var ClientReactRootIndex = { + createReactRootIndex: function() { + return nextReactRootIndex++; + } + }; + + module.exports = ClientReactRootIndex; + + +/***/ }, +/* 137 */ +/***/ function(module, exports, __webpack_require__) { + + /** + * Copyright 2013-2014, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule CompositionEventPlugin + * @typechecks static-only + */ + + "use strict"; + + var EventConstants = __webpack_require__(115); + var EventPropagators = __webpack_require__(221); + var ExecutionEnvironment = __webpack_require__(69); + var ReactInputSelection = __webpack_require__(229); + var SyntheticCompositionEvent = __webpack_require__(230); + + var getTextContentAccessor = __webpack_require__(231); + var keyOf = __webpack_require__(126); + + var END_KEYCODES = [9, 13, 27, 32]; // Tab, Return, Esc, Space + var START_KEYCODE = 229; + + var useCompositionEvent = ( + ExecutionEnvironment.canUseDOM && + 'CompositionEvent' in window + ); + + // In IE9+, we have access to composition events, but the data supplied + // by the native compositionend event may be incorrect. In Korean, for example, + // the compositionend event contains only one character regardless of + // how many characters have been composed since compositionstart. + // We therefore use the fallback data while still using the native + // events as triggers. + var useFallbackData = ( + !useCompositionEvent || + ( + 'documentMode' in document && + document.documentMode > 8 && + document.documentMode <= 11 + ) + ); + + var topLevelTypes = EventConstants.topLevelTypes; + var currentComposition = null; + + // Events and their corresponding property names. + var eventTypes = { + compositionEnd: { + phasedRegistrationNames: { + bubbled: keyOf({onCompositionEnd: null}), + captured: keyOf({onCompositionEndCapture: null}) + }, + dependencies: [ + topLevelTypes.topBlur, + topLevelTypes.topCompositionEnd, + topLevelTypes.topKeyDown, + topLevelTypes.topKeyPress, + topLevelTypes.topKeyUp, + topLevelTypes.topMouseDown + ] + }, + compositionStart: { + phasedRegistrationNames: { + bubbled: keyOf({onCompositionStart: null}), + captured: keyOf({onCompositionStartCapture: null}) + }, + dependencies: [ + topLevelTypes.topBlur, + topLevelTypes.topCompositionStart, + topLevelTypes.topKeyDown, + topLevelTypes.topKeyPress, + topLevelTypes.topKeyUp, + topLevelTypes.topMouseDown + ] + }, + compositionUpdate: { + phasedRegistrationNames: { + bubbled: keyOf({onCompositionUpdate: null}), + captured: keyOf({onCompositionUpdateCapture: null}) + }, + dependencies: [ + topLevelTypes.topBlur, + topLevelTypes.topCompositionUpdate, + topLevelTypes.topKeyDown, + topLevelTypes.topKeyPress, + topLevelTypes.topKeyUp, + topLevelTypes.topMouseDown + ] + } + }; + + /** + * Translate native top level events into event types. + * + * @param {string} topLevelType + * @return {object} + */ + function getCompositionEventType(topLevelType) { + switch (topLevelType) { + case topLevelTypes.topCompositionStart: + return eventTypes.compositionStart; + case topLevelTypes.topCompositionEnd: + return eventTypes.compositionEnd; + case topLevelTypes.topCompositionUpdate: + return eventTypes.compositionUpdate; + } + } + + /** + * Does our fallback best-guess model think this event signifies that + * composition has begun? + * + * @param {string} topLevelType + * @param {object} nativeEvent + * @return {boolean} + */ + function isFallbackStart(topLevelType, nativeEvent) { + return ( + topLevelType === topLevelTypes.topKeyDown && + nativeEvent.keyCode === START_KEYCODE + ); + } + + /** + * Does our fallback mode think that this event is the end of composition? + * + * @param {string} topLevelType + * @param {object} nativeEvent + * @return {boolean} + */ + function isFallbackEnd(topLevelType, nativeEvent) { + switch (topLevelType) { + case topLevelTypes.topKeyUp: + // Command keys insert or clear IME input. + return (END_KEYCODES.indexOf(nativeEvent.keyCode) !== -1); + case topLevelTypes.topKeyDown: + // Expect IME keyCode on each keydown. If we get any other + // code we must have exited earlier. + return (nativeEvent.keyCode !== START_KEYCODE); + case topLevelTypes.topKeyPress: + case topLevelTypes.topMouseDown: + case topLevelTypes.topBlur: + // Events are not possible without cancelling IME. + return true; + default: + return false; + } + } + + /** + * Helper class stores information about selection and document state + * so we can figure out what changed at a later date. + * + * @param {DOMEventTarget} root + */ + function FallbackCompositionState(root) { + this.root = root; + this.startSelection = ReactInputSelection.getSelection(root); + this.startValue = this.getText(); + } + + /** + * Get current text of input. + * + * @return {string} + */ + FallbackCompositionState.prototype.getText = function() { + return this.root.value || this.root[getTextContentAccessor()]; + }; + + /** + * Text that has changed since the start of composition. + * + * @return {string} + */ + FallbackCompositionState.prototype.getData = function() { + var endValue = this.getText(); + var prefixLength = this.startSelection.start; + var suffixLength = this.startValue.length - this.startSelection.end; + + return endValue.substr( + prefixLength, + endValue.length - suffixLength - prefixLength + ); + }; + + /** + * This plugin creates `onCompositionStart`, `onCompositionUpdate` and + * `onCompositionEnd` events on inputs, textareas and contentEditable + * nodes. + */ + var CompositionEventPlugin = { + + eventTypes: eventTypes, + + /** + * @param {string} topLevelType Record from `EventConstants`. + * @param {DOMEventTarget} topLevelTarget The listening component root node. + * @param {string} topLevelTargetID ID of `topLevelTarget`. + * @param {object} nativeEvent Native browser event. + * @return {*} An accumulation of synthetic events. + * @see {EventPluginHub.extractEvents} + */ + extractEvents: function( + topLevelType, + topLevelTarget, + topLevelTargetID, + nativeEvent) { + + var eventType; + var data; + + if (useCompositionEvent) { + eventType = getCompositionEventType(topLevelType); + } else if (!currentComposition) { + if (isFallbackStart(topLevelType, nativeEvent)) { + eventType = eventTypes.compositionStart; + } + } else if (isFallbackEnd(topLevelType, nativeEvent)) { + eventType = eventTypes.compositionEnd; + } + + if (useFallbackData) { + // The current composition is stored statically and must not be + // overwritten while composition continues. + if (!currentComposition && eventType === eventTypes.compositionStart) { + currentComposition = new FallbackCompositionState(topLevelTarget); + } else if (eventType === eventTypes.compositionEnd) { + if (currentComposition) { + data = currentComposition.getData(); + currentComposition = null; + } + } + } + + if (eventType) { + var event = SyntheticCompositionEvent.getPooled( + eventType, + topLevelTargetID, + nativeEvent + ); + if (data) { + // Inject data generated from fallback path into the synthetic event. + // This matches the property of native CompositionEventInterface. + event.data = data; + } + EventPropagators.accumulateTwoPhaseDispatches(event); + return event; + } + } + }; + + module.exports = CompositionEventPlugin; + + +/***/ }, +/* 138 */ +/***/ function(module, exports, __webpack_require__) { + + /** + * Copyright 2013-2014, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule DefaultEventPluginOrder + */ + + "use strict"; + + var keyOf = __webpack_require__(126); + + /** + * Module that is injectable into `EventPluginHub`, that specifies a + * deterministic ordering of `EventPlugin`s. A convenient way to reason about + * plugins, without having to package every one of them. This is better than + * having plugins be ordered in the same order that they are injected because + * that ordering would be influenced by the packaging order. + * `ResponderEventPlugin` must occur before `SimpleEventPlugin` so that + * preventing default on events is convenient in `SimpleEventPlugin` handlers. + */ + var DefaultEventPluginOrder = [ + keyOf({ResponderEventPlugin: null}), + keyOf({SimpleEventPlugin: null}), + keyOf({TapEventPlugin: null}), + keyOf({EnterLeaveEventPlugin: null}), + keyOf({ChangeEventPlugin: null}), + keyOf({SelectEventPlugin: null}), + keyOf({CompositionEventPlugin: null}), + keyOf({BeforeInputEventPlugin: null}), + keyOf({AnalyticsEventPlugin: null}), + keyOf({MobileSafariClickEventPlugin: null}) + ]; + + module.exports = DefaultEventPluginOrder; + + +/***/ }, +/* 139 */ +/***/ function(module, exports, __webpack_require__) { + + /** + * Copyright 2013-2014, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule EnterLeaveEventPlugin + * @typechecks static-only + */ + + "use strict"; + + var EventConstants = __webpack_require__(115); + var EventPropagators = __webpack_require__(221); + var SyntheticMouseEvent = __webpack_require__(232); + + var ReactMount = __webpack_require__(60); + var keyOf = __webpack_require__(126); + + var topLevelTypes = EventConstants.topLevelTypes; + var getFirstReactDOM = ReactMount.getFirstReactDOM; + + var eventTypes = { + mouseEnter: { + registrationName: keyOf({onMouseEnter: null}), + dependencies: [ + topLevelTypes.topMouseOut, + topLevelTypes.topMouseOver + ] + }, + mouseLeave: { + registrationName: keyOf({onMouseLeave: null}), + dependencies: [ + topLevelTypes.topMouseOut, + topLevelTypes.topMouseOver + ] + } + }; + + var extractedEvents = [null, null]; + + var EnterLeaveEventPlugin = { + + eventTypes: eventTypes, + + /** + * For almost every interaction we care about, there will be both a top-level + * `mouseover` and `mouseout` event that occurs. Only use `mouseout` so that + * we do not extract duplicate events. However, moving the mouse into the + * browser from outside will not fire a `mouseout` event. In this case, we use + * the `mouseover` top-level event. + * + * @param {string} topLevelType Record from `EventConstants`. + * @param {DOMEventTarget} topLevelTarget The listening component root node. + * @param {string} topLevelTargetID ID of `topLevelTarget`. + * @param {object} nativeEvent Native browser event. + * @return {*} An accumulation of synthetic events. + * @see {EventPluginHub.extractEvents} + */ + extractEvents: function( + topLevelType, + topLevelTarget, + topLevelTargetID, + nativeEvent) { + if (topLevelType === topLevelTypes.topMouseOver && + (nativeEvent.relatedTarget || nativeEvent.fromElement)) { + return null; + } + if (topLevelType !== topLevelTypes.topMouseOut && + topLevelType !== topLevelTypes.topMouseOver) { + // Must not be a mouse in or mouse out - ignoring. + return null; + } + + var win; + if (topLevelTarget.window === topLevelTarget) { + // `topLevelTarget` is probably a window object. + win = topLevelTarget; + } else { + // TODO: Figure out why `ownerDocument` is sometimes undefined in IE8. + var doc = topLevelTarget.ownerDocument; + if (doc) { + win = doc.defaultView || doc.parentWindow; + } else { + win = window; + } + } + + var from, to; + if (topLevelType === topLevelTypes.topMouseOut) { + from = topLevelTarget; + to = + getFirstReactDOM(nativeEvent.relatedTarget || nativeEvent.toElement) || + win; + } else { + from = win; + to = topLevelTarget; + } + + if (from === to) { + // Nothing pertains to our managed components. + return null; + } + + var fromID = from ? ReactMount.getID(from) : ''; + var toID = to ? ReactMount.getID(to) : ''; + + var leave = SyntheticMouseEvent.getPooled( + eventTypes.mouseLeave, + fromID, + nativeEvent + ); + leave.type = 'mouseleave'; + leave.target = from; + leave.relatedTarget = to; + + var enter = SyntheticMouseEvent.getPooled( + eventTypes.mouseEnter, + toID, + nativeEvent + ); + enter.type = 'mouseenter'; + enter.target = to; + enter.relatedTarget = from; + + EventPropagators.accumulateEnterLeaveDispatches(leave, enter, fromID, toID); + + extractedEvents[0] = leave; + extractedEvents[1] = enter; + + return extractedEvents; + } + + }; + + module.exports = EnterLeaveEventPlugin; + + +/***/ }, +/* 140 */ +/***/ function(module, exports, __webpack_require__) { + + /** + * Copyright 2013-2014, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule HTMLDOMPropertyConfig + */ + + /*jslint bitwise: true*/ + + "use strict"; + + var DOMProperty = __webpack_require__(112); + var ExecutionEnvironment = __webpack_require__(69); + + var MUST_USE_ATTRIBUTE = DOMProperty.injection.MUST_USE_ATTRIBUTE; + var MUST_USE_PROPERTY = DOMProperty.injection.MUST_USE_PROPERTY; + var HAS_BOOLEAN_VALUE = DOMProperty.injection.HAS_BOOLEAN_VALUE; + var HAS_SIDE_EFFECTS = DOMProperty.injection.HAS_SIDE_EFFECTS; + var HAS_NUMERIC_VALUE = DOMProperty.injection.HAS_NUMERIC_VALUE; + var HAS_POSITIVE_NUMERIC_VALUE = + DOMProperty.injection.HAS_POSITIVE_NUMERIC_VALUE; + var HAS_OVERLOADED_BOOLEAN_VALUE = + DOMProperty.injection.HAS_OVERLOADED_BOOLEAN_VALUE; + + var hasSVG; + if (ExecutionEnvironment.canUseDOM) { + var implementation = document.implementation; + hasSVG = ( + implementation && + implementation.hasFeature && + implementation.hasFeature( + 'http://www.w3.org/TR/SVG11/feature#BasicStructure', + '1.1' + ) + ); + } + + + var HTMLDOMPropertyConfig = { + isCustomAttribute: RegExp.prototype.test.bind( + /^(data|aria)-[a-z_][a-z\d_.\-]*$/ + ), + Properties: { + /** + * Standard Properties + */ + accept: null, + acceptCharset: null, + accessKey: null, + action: null, + allowFullScreen: MUST_USE_ATTRIBUTE | HAS_BOOLEAN_VALUE, + allowTransparency: MUST_USE_ATTRIBUTE, + alt: null, + async: HAS_BOOLEAN_VALUE, + autoComplete: null, + // autoFocus is polyfilled/normalized by AutoFocusMixin + // autoFocus: HAS_BOOLEAN_VALUE, + autoPlay: HAS_BOOLEAN_VALUE, + cellPadding: null, + cellSpacing: null, + charSet: MUST_USE_ATTRIBUTE, + checked: MUST_USE_PROPERTY | HAS_BOOLEAN_VALUE, + classID: MUST_USE_ATTRIBUTE, + // To set className on SVG elements, it's necessary to use .setAttribute; + // this works on HTML elements too in all browsers except IE8. Conveniently, + // IE8 doesn't support SVG and so we can simply use the attribute in + // browsers that support SVG and the property in browsers that don't, + // regardless of whether the element is HTML or SVG. + className: hasSVG ? MUST_USE_ATTRIBUTE : MUST_USE_PROPERTY, + cols: MUST_USE_ATTRIBUTE | HAS_POSITIVE_NUMERIC_VALUE, + colSpan: null, + content: null, + contentEditable: null, + contextMenu: MUST_USE_ATTRIBUTE, + controls: MUST_USE_PROPERTY | HAS_BOOLEAN_VALUE, + coords: null, + crossOrigin: null, + data: null, // For `` acts as `src`. + dateTime: MUST_USE_ATTRIBUTE, + defer: HAS_BOOLEAN_VALUE, + dir: null, + disabled: MUST_USE_ATTRIBUTE | HAS_BOOLEAN_VALUE, + download: HAS_OVERLOADED_BOOLEAN_VALUE, + draggable: null, + encType: null, + form: MUST_USE_ATTRIBUTE, + formAction: MUST_USE_ATTRIBUTE, + formEncType: MUST_USE_ATTRIBUTE, + formMethod: MUST_USE_ATTRIBUTE, + formNoValidate: HAS_BOOLEAN_VALUE, + formTarget: MUST_USE_ATTRIBUTE, + frameBorder: MUST_USE_ATTRIBUTE, + height: MUST_USE_ATTRIBUTE, + hidden: MUST_USE_ATTRIBUTE | HAS_BOOLEAN_VALUE, + href: null, + hrefLang: null, + htmlFor: null, + httpEquiv: null, + icon: null, + id: MUST_USE_PROPERTY, + label: null, + lang: null, + list: MUST_USE_ATTRIBUTE, + loop: MUST_USE_PROPERTY | HAS_BOOLEAN_VALUE, + manifest: MUST_USE_ATTRIBUTE, + marginHeight: null, + marginWidth: null, + max: null, + maxLength: MUST_USE_ATTRIBUTE, + media: MUST_USE_ATTRIBUTE, + mediaGroup: null, + method: null, + min: null, + multiple: MUST_USE_PROPERTY | HAS_BOOLEAN_VALUE, + muted: MUST_USE_PROPERTY | HAS_BOOLEAN_VALUE, + name: null, + noValidate: HAS_BOOLEAN_VALUE, + open: null, + pattern: null, + placeholder: null, + poster: null, + preload: null, + radioGroup: null, + readOnly: MUST_USE_PROPERTY | HAS_BOOLEAN_VALUE, + rel: null, + required: HAS_BOOLEAN_VALUE, + role: MUST_USE_ATTRIBUTE, + rows: MUST_USE_ATTRIBUTE | HAS_POSITIVE_NUMERIC_VALUE, + rowSpan: null, + sandbox: null, + scope: null, + scrolling: null, + seamless: MUST_USE_ATTRIBUTE | HAS_BOOLEAN_VALUE, + selected: MUST_USE_PROPERTY | HAS_BOOLEAN_VALUE, + shape: null, + size: MUST_USE_ATTRIBUTE | HAS_POSITIVE_NUMERIC_VALUE, + sizes: MUST_USE_ATTRIBUTE, + span: HAS_POSITIVE_NUMERIC_VALUE, + spellCheck: null, + src: null, + srcDoc: MUST_USE_PROPERTY, + srcSet: MUST_USE_ATTRIBUTE, + start: HAS_NUMERIC_VALUE, + step: null, + style: null, + tabIndex: null, + target: null, + title: null, + type: null, + useMap: null, + value: MUST_USE_PROPERTY | HAS_SIDE_EFFECTS, + width: MUST_USE_ATTRIBUTE, + wmode: MUST_USE_ATTRIBUTE, + + /** + * Non-standard Properties + */ + autoCapitalize: null, // Supported in Mobile Safari for keyboard hints + autoCorrect: null, // Supported in Mobile Safari for keyboard hints + itemProp: MUST_USE_ATTRIBUTE, // Microdata: http://schema.org/docs/gs.html + itemScope: MUST_USE_ATTRIBUTE | HAS_BOOLEAN_VALUE, // Microdata: http://schema.org/docs/gs.html + itemType: MUST_USE_ATTRIBUTE, // Microdata: http://schema.org/docs/gs.html + property: null // Supports OG in meta tags + }, + DOMAttributeNames: { + acceptCharset: 'accept-charset', + className: 'class', + htmlFor: 'for', + httpEquiv: 'http-equiv' + }, + DOMPropertyNames: { + autoCapitalize: 'autocapitalize', + autoComplete: 'autocomplete', + autoCorrect: 'autocorrect', + autoFocus: 'autofocus', + autoPlay: 'autoplay', + encType: 'enctype', + hrefLang: 'hreflang', + radioGroup: 'radiogroup', + spellCheck: 'spellcheck', + srcDoc: 'srcdoc', + srcSet: 'srcset' + } + }; + + module.exports = HTMLDOMPropertyConfig; + + +/***/ }, +/* 141 */ +/***/ function(module, exports, __webpack_require__) { + + /** + * Copyright 2013-2014, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule MobileSafariClickEventPlugin + * @typechecks static-only + */ + + "use strict"; + + var EventConstants = __webpack_require__(115); + + var emptyFunction = __webpack_require__(163); + + var topLevelTypes = EventConstants.topLevelTypes; + + /** + * Mobile Safari does not fire properly bubble click events on non-interactive + * elements, which means delegated click listeners do not fire. The workaround + * for this bug involves attaching an empty click listener on the target node. + * + * This particular plugin works around the bug by attaching an empty click + * listener on `touchstart` (which does fire on every element). + */ + var MobileSafariClickEventPlugin = { + + eventTypes: null, + + /** + * @param {string} topLevelType Record from `EventConstants`. + * @param {DOMEventTarget} topLevelTarget The listening component root node. + * @param {string} topLevelTargetID ID of `topLevelTarget`. + * @param {object} nativeEvent Native browser event. + * @return {*} An accumulation of synthetic events. + * @see {EventPluginHub.extractEvents} + */ + extractEvents: function( + topLevelType, + topLevelTarget, + topLevelTargetID, + nativeEvent) { + if (topLevelType === topLevelTypes.topTouchStart) { + var target = nativeEvent.target; + if (target && !target.onclick) { + target.onclick = emptyFunction; + } + } + } + + }; + + module.exports = MobileSafariClickEventPlugin; + + +/***/ }, +/* 142 */ +/***/ function(module, exports, __webpack_require__) { + + /* WEBPACK VAR INJECTION */(function(process) {/** + * Copyright 2013-2014, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule ReactComponentBrowserEnvironment + */ + + /*jslint evil: true */ + + "use strict"; + + var ReactDOMIDOperations = __webpack_require__(233); + var ReactMarkupChecksum = __webpack_require__(164); + var ReactMount = __webpack_require__(60); + var ReactPerf = __webpack_require__(62); + var ReactReconcileTransaction = __webpack_require__(234); + + var getReactRootElementInContainer = __webpack_require__(160); + var invariant = __webpack_require__(79); + var setInnerHTML = __webpack_require__(235); + + + var ELEMENT_NODE_TYPE = 1; + var DOC_NODE_TYPE = 9; + + + /** + * Abstracts away all functionality of `ReactComponent` requires knowledge of + * the browser context. + */ + var ReactComponentBrowserEnvironment = { + ReactReconcileTransaction: ReactReconcileTransaction, + + BackendIDOperations: ReactDOMIDOperations, + + /** + * If a particular environment requires that some resources be cleaned up, + * specify this in the injected Mixin. In the DOM, we would likely want to + * purge any cached node ID lookups. + * + * @private + */ + unmountIDFromEnvironment: function(rootNodeID) { + ReactMount.purgeID(rootNodeID); + }, + + /** + * @param {string} markup Markup string to place into the DOM Element. + * @param {DOMElement} container DOM Element to insert markup into. + * @param {boolean} shouldReuseMarkup Should reuse the existing markup in the + * container if possible. + */ + mountImageIntoNode: ReactPerf.measure( + 'ReactComponentBrowserEnvironment', + 'mountImageIntoNode', + function(markup, container, shouldReuseMarkup) { + ("production" !== process.env.NODE_ENV ? invariant( + container && ( + container.nodeType === ELEMENT_NODE_TYPE || + container.nodeType === DOC_NODE_TYPE + ), + 'mountComponentIntoNode(...): Target container is not valid.' + ) : invariant(container && ( + container.nodeType === ELEMENT_NODE_TYPE || + container.nodeType === DOC_NODE_TYPE + ))); + + if (shouldReuseMarkup) { + if (ReactMarkupChecksum.canReuseMarkup( + markup, + getReactRootElementInContainer(container))) { + return; + } else { + ("production" !== process.env.NODE_ENV ? invariant( + container.nodeType !== DOC_NODE_TYPE, + 'You\'re trying to render a component to the document using ' + + 'server rendering but the checksum was invalid. This usually ' + + 'means you rendered a different component type or props on ' + + 'the client from the one on the server, or your render() ' + + 'methods are impure. React cannot handle this case due to ' + + 'cross-browser quirks by rendering at the document root. You ' + + 'should look for environment dependent code in your components ' + + 'and ensure the props are the same client and server side.' + ) : invariant(container.nodeType !== DOC_NODE_TYPE)); + + if ("production" !== process.env.NODE_ENV) { + console.warn( + 'React attempted to use reuse markup in a container but the ' + + 'checksum was invalid. This generally means that you are ' + + 'using server rendering and the markup generated on the ' + + 'server was not what the client was expecting. React injected ' + + 'new markup to compensate which works but you have lost many ' + + 'of the benefits of server rendering. Instead, figure out ' + + 'why the markup being generated is different on the client ' + + 'or server.' + ); + } + } + } + + ("production" !== process.env.NODE_ENV ? invariant( + container.nodeType !== DOC_NODE_TYPE, + 'You\'re trying to render a component to the document but ' + + 'you didn\'t use server rendering. We can\'t do this ' + + 'without using server rendering due to cross-browser quirks. ' + + 'See renderComponentToString() for server rendering.' + ) : invariant(container.nodeType !== DOC_NODE_TYPE)); + + setInnerHTML(container, markup); + } + ) + }; + + module.exports = ReactComponentBrowserEnvironment; + + /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(89))) + +/***/ }, +/* 143 */ +/***/ function(module, exports, __webpack_require__) { + + /** + * Copyright 2013-2014, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule ReactDefaultBatchingStrategy + */ + + "use strict"; + + var ReactUpdates = __webpack_require__(117); + var Transaction = __webpack_require__(214); + + var assign = __webpack_require__(66); + var emptyFunction = __webpack_require__(163); + + var RESET_BATCHED_UPDATES = { + initialize: emptyFunction, + close: function() { + ReactDefaultBatchingStrategy.isBatchingUpdates = false; + } + }; + + var FLUSH_BATCHED_UPDATES = { + initialize: emptyFunction, + close: ReactUpdates.flushBatchedUpdates.bind(ReactUpdates) + }; + + var TRANSACTION_WRAPPERS = [FLUSH_BATCHED_UPDATES, RESET_BATCHED_UPDATES]; + + function ReactDefaultBatchingStrategyTransaction() { + this.reinitializeTransaction(); + } + + assign( + ReactDefaultBatchingStrategyTransaction.prototype, + Transaction.Mixin, + { + getTransactionWrappers: function() { + return TRANSACTION_WRAPPERS; + } + } + ); + + var transaction = new ReactDefaultBatchingStrategyTransaction(); + + var ReactDefaultBatchingStrategy = { + isBatchingUpdates: false, + + /** + * Call the provided function in a context within which calls to `setState` + * and friends are batched such that components aren't updated unnecessarily. + */ + batchedUpdates: function(callback, a, b) { + var alreadyBatchingUpdates = ReactDefaultBatchingStrategy.isBatchingUpdates; + + ReactDefaultBatchingStrategy.isBatchingUpdates = true; + + // The code is written this way to avoid extra allocations + if (alreadyBatchingUpdates) { + callback(a, b); + } else { + transaction.perform(callback, null, a, b); + } + } + }; + + module.exports = ReactDefaultBatchingStrategy; + + +/***/ }, +/* 144 */ +/***/ function(module, exports, __webpack_require__) { + + /** + * Copyright 2013-2014, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule ReactDOMButton + */ + + "use strict"; + + var AutoFocusMixin = __webpack_require__(237); + var ReactBrowserComponentMixin = __webpack_require__(130); + var ReactCompositeComponent = __webpack_require__(50); + var ReactElement = __webpack_require__(53); + var ReactDOM = __webpack_require__(55); + + var keyMirror = __webpack_require__(118); + + // Store a reference to the