Socket
Socket
Sign inDemoInstall

react-router

Package Overview
Dependencies
Maintainers
2
Versions
517
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-router - npm Package Compare versions

Comparing version 1.0.0-rc1 to 1.0.0-rc2

.babelrc

40

CHANGELOG.md

@@ -0,1 +1,41 @@

v1.0.0-rc2 - Thu, 08 Oct 2015 05:06:02 GMT
------------------------------------------
- [bdab3d8](../../commit/bdab3d8) [fixed] Compare query by string value
- [c43fb61](../../commit/c43fb61) [added] <Link hash> prop
- [24e7b4f](../../commit/24e7b4f) [fixed] isActive on nested IndexLink
- [160c5ba](../../commit/160c5ba) [fixed] Removed <Link> warning about no history in context
- [ca9e3b7](../../commit/ca9e3b7) [added] IndexRedirect
- [428da54](../../commit/428da54) [added] Support <Redirect to="relative/path">
- [ebb8d20](../../commit/ebb8d20) [fixed] Remove direct calls to createLocation.
- [fc8a7a4](../../commit/fc8a7a4) [changed] Run examples using HTML5 history
- [37d9bac](../../commit/37d9bac) [fixed] isActive on <Link onlyActiveOnIndex>
- [be37196](../../commit/be37196) [fixed] Actually update state when there are transition hooks
- [b8f1abe](../../commit/b8f1abe) [changed] Removed (un)registerRouteHook
- [69a9240](../../commit/69a9240) [fixed] Added missing IndexLink to exports
- [5fbe933](../../commit/5fbe933) [changed] Do not add "active" class by default
- [85c699c](../../commit/85c699c) [changed] State -> IsActive
- [94509e7](../../commit/94509e7) [added] IndexLink
- [adc0a2f](../../commit/adc0a2f) [added] IndexRoute
- [b86509a](../../commit/b86509a) [added] useRoutes history enhancer [added] RoutingContext component [added] RouteContext mixin [added] Lifecycle mixin
- [e72812d](../../commit/e72812d) [added] <Router initialState>
- [4c6dc1b](../../commit/4c6dc1b) [fixed] Installing on Windows
- [042cffc](../../commit/042cffc) [changed] Removed histories/added history dep
- [af7eb55](../../commit/af7eb55) [added] History.onBeforeChange
- [f4ed900](../../commit/f4ed900) [fixed] correctly updates the window scroll position
- [587e54f](../../commit/587e54f) [added] static `history` singleton getter for `HashHistory` and `BrowserHistory`
- [5bd62b5](../../commit/5bd62b5) [fixed] errors in examples
- [4e2ca3c](../../commit/4e2ca3c) [fixed] URI escape path components with special chars
- [0630488](../../commit/0630488) [fixed] Link module adds extra space
- [26400c1](../../commit/26400c1) [fixed] Use encodeURI for splat params
- [178efc3](../../commit/178efc3) [fixed] <Link href> when using HashHistory
- [41bd525](../../commit/41bd525) [fixed] Properly escape splats
- [4759961](../../commit/4759961) [fixed] URLUtils recognize values containing \n
v0.13.4 - Tue, 06 Oct 2015 13:13:28 GMT
---------------------------------------
- [b237238](../../commit/b237238) [fixed] Removed getter for IE8 compat
v1.0.0-rc1 - Fri, 11 Sep 2015 21:35:18 GMT

@@ -2,0 +42,0 @@ ------------------------------------------

26

docs/Glossary.md

@@ -5,2 +5,24 @@ # Glossary

* [Action](#action)
* [Component](#component)
* [EnterHook](#enterhook)
* [LeaveHook](#leavehook)
* [Location](#location)
* [LocationKey](#locationkey)
* [LocationState](#locationstate)
* [Path](#path)
* [Pathname](#pathname)
* [Params](#params)
* [Query](#query)
* [QueryString](#querystring)
* [RedirectFunction](#redirectfunction)
* [Route](#route)
* [RouteComponent](#routecomponent)
* [RouteConfig](#routeconfig)
* [RouteHook](#routehook)
* [RoutePattern](#routepattern)
* [Router](#router)
* [RouterListener](#routerlistener)
* [RouterState](#routerstate)
## Action

@@ -130,3 +152,3 @@

```js
type RedirectFunction = (pathname: Pathname | Path, query: ?Query, state: ?LocationState) => void;
type RedirectFunction = (state: ?LocationState, pathname: Pathname | Path, query: ?Query) => void;
```

@@ -239,2 +261,2 @@

- an object of [`params`](#params) that were parsed out of the URL, and
- an array of [`components`](#component) that will be rendered to the page in hierarchical order.
- an array of [`components`](#component) that will be rendered to the page in hierarchical order.

47

docs/README.md
## Table of Contents
* [Read Me](/README.md)
* [Introduction](/docs/introduction/README.md)
* [Motivation](/docs/introduction/Motivation.md)
* [Principles](/docs/introduction/Principles.md)
* [Basics](/docs/basics/README.md)
* [Route Configuration](/docs/basics/RouteConfiguration.md)
* [Route Matching](/docs/basics/RouteMatching.md)
* [Histories](/docs/basics/Histories.md)
* [Advanced](/docs/advanced/README.md)
* [Dynamic Routing](/docs/advanced/DynamicRouting.md)
* [Confirming Navigation](/docs/advanced/ConfirmingNavigation.md)
* [Server Rendering](/docs/advanced/ServerRendering.md)
* [Component Lifecycle](/docs/advanced/ComponentLifecycle.md)
* [Recipes](/docs/recipes/README.md)
* [Introduction](/docs/Introduction.md)
* [Basics](/docs/guides/basics/README.md)
* [Route Configuration](/docs/guides/basics/RouteConfiguration.md)
* [Route Matching](/docs/guides/basics/RouteMatching.md)
* [Histories](/docs/guides/basics/Histories.md)
* [Index Routes and Links](/docs/guides/basics/IndexRoutes.md)
* [Advanced Usage](/docs/guides/advanced/README.md)
* [Dynamic Routing](/docs/guides/advanced/DynamicRouting.md)
* [Confirming Navigation](/docs/guides/advanced/ConfirmingNavigation.md)
* [Server Rendering](/docs/guides/advanced/ServerRendering.md)
* [Component Lifecycle](/docs/guides/advanced/ComponentLifecycle.md)
* [Navigating Outside of Components](/docs/guides/advanced/NavigatingOutsideOfComponents.md)
* [Upgrade Guide](/UPGRADE_GUIDE.md)
* [Troubleshooting](/docs/Troubleshooting.md)
* [API](/docs/API.md)
* [Glossary](/docs/Glossary.md)
* [API Reference](/docs/api/README.md)
* [Components](/docs/api/README.md#components)
* [Router](/docs/api/Router.md)
* [Link](/docs/api/Link.md)
* [IndexLink](/docs/api/IndexLink.md)
* [RoutingContext](/docs/api/RoutingContext.md)
* [Configuration components](/docs/api/README.md#configuration-components)
* [Route](/docs/api/Route.md)
* [Redirect](/docs/api/Redirect.md)
* [IndexRoute](/docs/api/IndexRoute.md)
* [Mixins](/docs/api/README.md#mixins)
* [Lifecycle](/docs/api/Lifecycle.md)
* [Navigation](/docs/api/Navigation.md)
* [RouteContext](/docs/api/RouteContext.md)
* [IsActive](/docs/api/IsActive.md)
* [ScrollManagmentMixin](/docs/api/ScrollManagmentMixin.md)
* [Utilities](/docs/api/README.md#utilities)
* [useRoutes](/docs/api/useRoutes.md)
* [createRoutes](/docs/api/createRoutes.md)
* [PropTypes](/docs/api/PropTypes.md)

@@ -7,6 +7,6 @@ # Troubleshooting

<Route component={App}>
{/* ... other routes */
{/* ... other routes */}
</Route>
var App = React.createClass({
const App = React.createClass({
getInitialState() {

@@ -17,6 +17,6 @@ return { showBackButton: false }

componentWillReceiveProps(nextProps) {
var routeChanged = nextProps.location !== this.props.location;
this.setState({ showBackButton: routeChanged });
const routeChanged = nextProps.location !== this.props.location
this.setState({ showBackButton: routeChanged })
}
});
```
})
```

@@ -8,4 +8,4 @@ "use strict";

function loopAsync(turns, work, callback) {
var currentTurn = 0;
var isDone = false;
var currentTurn = 0,
isDone = false;

@@ -36,4 +36,4 @@ function done() {

var isDone = false;
var doneCount = 0;
var isDone = false,
doneCount = 0;

@@ -40,0 +40,0 @@ function done(index, error, value) {

@@ -17,2 +17,6 @@ 'use strict';

function routeQueryChanged(prevState, nextState) {
return prevState.location.search !== nextState.location.search;
}
/**

@@ -22,3 +26,5 @@ * Returns an object of { leaveRoutes, enterRoutes } determined by

* 1) they are not in the next state or 2) they are in the next state
* but their params have changed (i.e. /users/123 => /users/456).
* but their params have changed (i.e. /users/123 => /users/456) or
* 3) they are in the next state but the query has changed
* (i.e. /search?query=foo => /search?query=bar)
*

@@ -33,6 +39,7 @@ * leaveRoutes are ordered starting at the leaf route of the tree

var leaveRoutes, enterRoutes;
var leaveRoutes = undefined,
enterRoutes = undefined;
if (prevRoutes) {
leaveRoutes = prevRoutes.filter(function (route) {
return nextRoutes.indexOf(route) === -1 || routeParamsChanged(route, prevState, nextState);
return nextRoutes.indexOf(route) === -1 || routeParamsChanged(route, prevState, nextState) || routeQueryChanged(prevState, nextState);
});

@@ -39,0 +46,0 @@

@@ -18,5 +18,5 @@ 'use strict';

for (var p in params) if (params.hasOwnProperty(p) && paramNames.indexOf(p) !== -1) routeParams[p] = params[p];
return routeParams;
for (var p in params) {
if (params.hasOwnProperty(p) && paramNames.indexOf(p) !== -1) routeParams[p] = params[p];
}return routeParams;
}

@@ -23,0 +23,0 @@

@@ -20,4 +20,16 @@ /* components */

var _IndexLink2 = require('./IndexLink');
var _IndexLink3 = _interopRequireDefault(_IndexLink2);
exports.IndexLink = _IndexLink3['default'];
/* components (configuration) */
var _IndexRedirect2 = require('./IndexRedirect');
var _IndexRedirect3 = _interopRequireDefault(_IndexRedirect2);
exports.IndexRedirect = _IndexRedirect3['default'];
var _IndexRoute2 = require('./IndexRoute');

@@ -24,0 +36,0 @@

@@ -9,2 +9,6 @@ 'use strict';

function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }
function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
var _react = require('react');

@@ -18,12 +22,23 @@

var IndexLink = _react2['default'].createClass({
displayName: 'IndexLink',
/**
* An <IndexLink> is used to link to an <IndexRoute>.
*/
render: function render() {
return _react2['default'].createElement(_Link2['default'], _extends({}, this.props, { onlyActiveOnIndex: true }));
var IndexLink = (function (_React$Component) {
_inherits(IndexLink, _React$Component);
function IndexLink() {
_classCallCheck(this, IndexLink);
_React$Component.apply(this, arguments);
}
});
IndexLink.prototype.render = function render() {
return _react2['default'].createElement(_Link2['default'], _extends({}, this.props, { onlyActiveOnIndex: true }));
};
return IndexLink;
})(_react2['default'].Component);
exports['default'] = IndexLink;
module.exports = exports['default'];

@@ -5,4 +5,10 @@ 'use strict';

var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }
function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
var _react = require('react');

@@ -32,32 +38,40 @@

*/
var IndexRoute = _react2['default'].createClass({
displayName: 'IndexRoute',
statics: {
var IndexRoute = (function (_React$Component) {
_inherits(IndexRoute, _React$Component);
createRouteFromReactElement: function createRouteFromReactElement(element, parentRoute) {
if (parentRoute) {
parentRoute.indexRoute = _RouteUtils.createRouteFromReactElement(element);
} else {
_warning2['default'](false, 'An <IndexRoute> does not make sense at the root of your route config');
}
}
function IndexRoute() {
_classCallCheck(this, IndexRoute);
},
_React$Component.apply(this, arguments);
}
propTypes: {
path: _PropTypes.falsy,
ignoreScrollBehavior: bool,
component: _PropTypes.component,
components: _PropTypes.components,
getComponents: func
},
IndexRoute.createRouteFromReactElement = function createRouteFromReactElement(element, parentRoute) {
if (parentRoute) {
parentRoute.indexRoute = _RouteUtils.createRouteFromReactElement(element);
} else {
_warning2['default'](false, 'An <IndexRoute> does not make sense at the root of your route config');
}
};
render: function render() {
IndexRoute.prototype.render = function render() {
_invariant2['default'](false, '<IndexRoute> elements are for router configuration only and should not be rendered');
}
};
});
_createClass(IndexRoute, null, [{
key: 'propTypes',
value: {
path: _PropTypes.falsy,
ignoreScrollBehavior: bool,
component: _PropTypes.component,
components: _PropTypes.components,
getComponents: func
},
enumerable: true
}]);
return IndexRoute;
})(_react2['default'].Component);
exports['default'] = IndexRoute;
module.exports = exports['default'];

@@ -7,17 +7,37 @@ 'use strict';

/**
* Returns true if a route and params that match the given
* pathname are currently active.
*/
function pathnameIsActive(pathname, activePathname, activeRoutes, activeParams) {
if (pathname === activePathname || activePathname.indexOf(pathname + '/') === 0) return true;
function deepEqual(a, b) {
if (a == b) return true;
var route, pattern;
var basename = '';
if (a == null || b == null) return false;
if (Array.isArray(a)) {
return Array.isArray(b) && a.length === b.length && a.every(function (item, index) {
return deepEqual(item, b[index]);
});
}
if (typeof a === 'object') {
for (var p in a) {
if (a.hasOwnProperty(p) && (!b.hasOwnProperty(p) || !deepEqual(a[p], b[p]))) return false;
}return true;
}
return String(a) === String(b);
}
function paramsAreActive(paramNames, paramValues, activeParams) {
return paramNames.every(function (paramName, index) {
return String(paramValues[index]) === String(activeParams[paramName]);
});
}
function getMatchingRoute(pathname, activeRoutes, activeParams) {
var route = undefined,
pattern = undefined,
basename = '';
for (var i = 0, len = activeRoutes.length; i < len; ++i) {
route = activeRoutes[i];
if (!route.path) return false;
pattern = route.path || '';
if (pattern.indexOf('/') !== 0) pattern = basename.replace(/\/*$/, '/') + pattern; // Relative paths build on the parent's path.
if (pattern.charAt(0) !== '/') pattern = basename.replace(/\/*$/, '/') + pattern; // Relative paths build on the parent's path.

@@ -30,7 +50,3 @@ var _matchPattern = _PatternUtils.matchPattern(pattern, pathname);

if (remainingPathname === '') {
return paramNames.every(function (paramName, index) {
return String(paramValues[index]) === String(activeParams[paramName]);
});
}
if (remainingPathname === '' && paramsAreActive(paramNames, paramValues, activeParams)) return route;

@@ -40,6 +56,20 @@ basename = pattern;

return false;
return null;
}
/**
* Returns true if the given pathname matches the active routes
* and params.
*/
function routeIsActive(pathname, activeRoutes, activeParams, indexOnly) {
var route = getMatchingRoute(pathname, activeRoutes, activeParams);
if (route == null) return false;
if (indexOnly) return activeRoutes.length > 1 && activeRoutes[activeRoutes.length - 1] === route.indexRoute;
return true;
}
/**
* Returns true if all key/value pairs in the given query are

@@ -53,5 +83,3 @@ * currently active.

for (var p in query) if (query.hasOwnProperty(p) && String(query[p]) !== String(activeQuery[p])) return false;
return true;
return deepEqual(query, activeQuery);
}

@@ -66,5 +94,5 @@

if (indexOnly && (routes.length < 2 || routes[routes.length - 2].indexRoute !== routes[routes.length - 1])) return false;
if (!routeIsActive(pathname, routes, params, indexOnly)) return false;
return pathnameIsActive(pathname, location.pathname, routes, params) && queryIsActive(query, location.query);
return queryIsActive(query, location.query);
}

@@ -71,0 +99,0 @@

@@ -18,5 +18,5 @@ 'use strict';

/**
* The Lifecycle mixin adds the routerWillLeave lifecycle method
* to a component that may be used to cancel a transition or prompt
* the user for confirmation.
* The Lifecycle mixin adds the routerWillLeave lifecycle method to a
* component that may be used to cancel a transition or prompt the user
* for confirmation.
*

@@ -27,15 +27,10 @@ * On standard transitions, routerWillLeave receives a single argument: the

*
* routerWillLeave does not receive a location object during the beforeunload
* event in web browsers (assuming you're using the useBeforeUnload history
* enhancer). In this case, it is not possible for us to know the location
* we're transitioning to so routerWillLeave must return a prompt message to
* prevent the user from closing the tab.
* During the beforeunload event (assuming you're using the useBeforeUnload
* history enhancer), routerWillLeave does not receive a location object
* because it isn't possible for us to know the location we're transitioning
* to. In this case routerWillLeave must return a prompt message to prevent
* the user from closing the window/tab.
*/
var Lifecycle = {
propTypes: {
// Route components receive the route object as a prop.
route: object
},
contextTypes: {

@@ -49,18 +44,19 @@ history: object.isRequired,

_getRoute: function _getRoute() {
var route = this.props.route || this.context.route;
_invariant2['default'](route, 'The Lifecycle mixin needs to be used either on 1) a <Route component> or ' + '2) a descendant of a <Route component> that uses the RouteContext mixin');
return route;
propTypes: {
// Route components receive the route object as a prop.
route: object
},
componentWillMount: function componentWillMount() {
componentDidMount: function componentDidMount() {
_invariant2['default'](this.routerWillLeave, 'The Lifecycle mixin requires you to define a routerWillLeave method');
this.context.history.registerRouteHook(this._getRoute(), this.routerWillLeave);
var route = this.props.route || this.context.route;
_invariant2['default'](route, 'The Lifecycle mixin must be used on either a) a <Route component> or ' + 'b) a descendant of a <Route component> that uses the RouteContext mixin');
this._unlistenBeforeLeavingRoute = this.context.history.listenBeforeLeavingRoute(route, this.routerWillLeave);
},
componentWillUnmount: function componentWillUnmount() {
this.context.history.unregisterRouteHook(this._getRoute(), this.routerWillLeave);
if (this._unlistenBeforeLeavingRoute) this._unlistenBeforeLeavingRoute();
}

@@ -67,0 +63,0 @@

@@ -7,2 +7,4 @@ 'use strict';

var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }

@@ -12,2 +14,6 @@

function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }
function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
var _react = require('react');

@@ -17,6 +23,2 @@

var _warning = require('warning');
var _warning2 = _interopRequireDefault(_warning);
var _React$PropTypes = _react2['default'].PropTypes;

@@ -37,5 +39,5 @@ var bool = _React$PropTypes.bool;

function isEmptyObject(object) {
for (var p in object) if (object.hasOwnProperty(p)) return false;
return true;
for (var p in object) {
if (object.hasOwnProperty(p)) return false;
}return true;
}

@@ -45,4 +47,4 @@

* A <Link> is used to create an <a> 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).
* When that route is active, the link gets the value of its
* `activeClassName` prop
*

@@ -62,30 +64,15 @@ * For example, assuming you have the following route:

*/
var Link = _react2['default'].createClass({
displayName: 'Link',
contextTypes: {
history: object
},
var Link = (function (_React$Component) {
_inherits(Link, _React$Component);
propTypes: {
activeStyle: object,
activeClassName: string,
onlyActiveOnIndex: bool.isRequired,
to: string.isRequired,
query: object,
state: object,
onClick: func
},
function Link() {
_classCallCheck(this, Link);
getDefaultProps: function getDefaultProps() {
return {
onlyActiveOnIndex: false,
className: '',
style: {}
};
},
_React$Component.apply(this, arguments);
}
handleClick: function handleClick(event) {
var allowTransition = true;
var clickResult;
Link.prototype.handleClick = function handleClick(event) {
var allowTransition = true,
clickResult = undefined;

@@ -101,28 +88,31 @@ if (this.props.onClick) clickResult = this.props.onClick(event);

if (allowTransition) this.context.history.pushState(this.props.state, this.props.to, this.props.query);
},
};
componentWillMount: function componentWillMount() {
_warning2['default'](this.context.history, 'A <Link> should not be rendered outside the context of history; ' + 'some features including real hrefs, active styling, and navigation ' + 'will not function correctly');
},
Link.prototype.render = function render() {
var _this = this;
render: function render() {
var history = this.context.history;
var _props = this.props;
var to = _props.to;
var query = _props.query;
var hash = _props.hash;
var state = _props.state;
var activeClassName = _props.activeClassName;
var activeStyle = _props.activeStyle;
var onlyActiveOnIndex = _props.onlyActiveOnIndex;
var to = _props.to;
var query = _props.query;
var state = _props.state;
var onClick = _props.onClick;
var props = _objectWithoutProperties(_props, ['activeClassName', 'activeStyle', 'onlyActiveOnIndex', 'to', 'query', 'state', 'onClick']);
var props = _objectWithoutProperties(_props, ['to', 'query', 'hash', 'state', 'activeClassName', 'activeStyle', 'onlyActiveOnIndex']);
props.onClick = this.handleClick;
// Manually override onClick.
props.onClick = function (e) {
return _this.handleClick(e);
};
// Ignore if rendered outside the context
// of history, simplifies unit testing.
// Ignore if rendered outside the context of history, simplifies unit testing.
var history = this.context.history;
if (history) {
props.href = history.createHref(to, query);
if (hash) props.href += hash;
if (activeClassName || activeStyle != null && !isEmptyObject(activeStyle)) {

@@ -138,7 +128,37 @@ if (history.isActive(to, query, onlyActiveOnIndex)) {

return _react2['default'].createElement('a', props);
}
};
});
_createClass(Link, null, [{
key: 'contextTypes',
value: {
history: object
},
enumerable: true
}, {
key: 'propTypes',
value: {
to: string.isRequired,
query: object,
hash: string,
state: object,
activeStyle: object,
activeClassName: string,
onlyActiveOnIndex: bool.isRequired,
onClick: func
},
enumerable: true
}, {
key: 'defaultProps',
value: {
onlyActiveOnIndex: false,
className: '',
style: {}
},
enumerable: true
}]);
return Link;
})(_react2['default'].Component);
exports['default'] = Link;
module.exports = exports['default'];

@@ -7,6 +7,8 @@ 'use strict';

exports['default'] = match;
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
var _invariant = require('invariant');
var _invariant2 = _interopRequireDefault(_invariant);
var _historyLibCreateMemoryHistory = require('history/lib/createMemoryHistory');

@@ -16,2 +18,8 @@

var _historyLibUseBasename = require('history/lib/useBasename');
var _historyLibUseBasename2 = _interopRequireDefault(_historyLibUseBasename);
var _RouteUtils = require('./RouteUtils');
var _useRoutes = require('./useRoutes');

@@ -21,27 +29,38 @@

var _RouteUtils = require('./RouteUtils');
var createHistory = _useRoutes2['default'](_historyLibUseBasename2['default'](_historyLibCreateMemoryHistory2['default']));
function match(_ref, cb) {
/**
* A high-level API to be used for server-side rendering.
*
* This function matches a location to a set of routes and calls
* callback(error, redirectLocation, renderProps) when finished.
*
* Note: You probably don't want to use this in a browser. Use
* the history.listen API instead.
*/
function match(_ref, callback) {
var routes = _ref.routes;
var history = _ref.history;
var location = _ref.location;
var parseQueryString = _ref.parseQueryString;
var stringifyQuery = _ref.stringifyQuery;
var basename = _ref.basename;
var createHistory = history ? function () {
return history;
} : _historyLibCreateMemoryHistory2['default'];
_invariant2['default'](location, 'match needs a location');
var staticHistory = _useRoutes2['default'](createHistory)({
var history = createHistory({
routes: _RouteUtils.createRoutes(routes),
parseQueryString: parseQueryString,
stringifyQuery: stringifyQuery
stringifyQuery: stringifyQuery,
basename: basename
});
staticHistory.match(location, function (error, nextLocation, nextState) {
var renderProps = nextState ? _extends({}, nextState, { history: staticHistory }) : null;
cb(error, nextLocation, renderProps);
// Allow match({ location: '/the/path', ... })
if (typeof location === 'string') location = history.createLocation(location);
history.match(location, function (error, redirectLocation, nextState) {
callback(error, redirectLocation, nextState && _extends({}, nextState, { history: history }));
});
}
exports['default'] = match;
module.exports = exports['default'];

@@ -58,3 +58,3 @@ 'use strict';

if (pattern.indexOf('/') !== 0) pattern = basename.replace(/\/*$/, '/') + pattern; // Relative paths build on the parent's path.
if (pattern.charAt(0) !== '/') pattern = basename.replace(/\/*$/, '/') + pattern; // Relative paths build on the parent's path.

@@ -70,16 +70,18 @@ var _matchPattern = _PatternUtils.matchPattern(pattern, location.pathname);

if (isExactMatch && route.path) {
var match = {
routes: [route],
params: createParams(paramNames, paramValues)
};
(function () {
var match = {
routes: [route],
params: createParams(paramNames, paramValues)
};
getIndexRoute(route, location, function (error, indexRoute) {
if (error) {
callback(error);
} else {
if (indexRoute) match.routes.push(indexRoute);
getIndexRoute(route, location, function (error, indexRoute) {
if (error) {
callback(error);
} else {
if (indexRoute) match.routes.push(indexRoute);
callback(null, match);
}
});
callback(null, match);
}
});
})();
} else if (remainingPathname != null || route.childRoutes) {

@@ -86,0 +88,0 @@ // Either a) this route matched at least some of the path or b)

@@ -17,3 +17,3 @@ 'use strict';

function escapeRegExp(string) {
return string.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
return string.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
}

@@ -30,3 +30,3 @@

var match,
var match = undefined,
lastIndex = 0,

@@ -111,3 +111,4 @@ matcher = /:([a-zA-Z_$][a-zA-Z0-9_$]*)|\*|\(|\)/g;

var remainingPathname, paramValues;
var remainingPathname = undefined,
paramValues = undefined;
if (match != null) {

@@ -170,3 +171,5 @@ paramValues = Array.prototype.slice.call(match, 1).map(function (v) {

var token, paramName, paramValue;
var token = undefined,
paramName = undefined,
paramValue = undefined;
for (var i = 0, len = tokens.length; i < len; ++i) {

@@ -173,0 +176,0 @@ token = tokens[i];

@@ -5,4 +5,10 @@ 'use strict';

var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }
function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
var _react = require('react');

@@ -27,52 +33,81 @@

/**
* A <Redirect> is used to declare another URL path a client should be sent
* to when they request a given URL.
* A <Redirect> is used to declare another URL path a client should
* be sent to when they request a given URL.
*
* Redirects are placed alongside routes in the route configuration and are
* traversed in the same manner.
* Redirects are placed alongside routes in the route configuration
* and are traversed in the same manner.
*/
var Redirect = _react2['default'].createClass({
displayName: 'Redirect',
statics: {
var Redirect = (function (_React$Component) {
_inherits(Redirect, _React$Component);
createRouteFromReactElement: function createRouteFromReactElement(element) {
var route = _RouteUtils.createRouteFromReactElement(element);
function Redirect() {
_classCallCheck(this, Redirect);
if (route.from) route.path = route.from;
_React$Component.apply(this, arguments);
}
// TODO: Handle relative pathnames, see #1658
_invariant2['default'](route.to.charAt(0) === '/', '<Redirect to> must be an absolute path. This should be fixed in the future');
Redirect.createRouteFromReactElement = function createRouteFromReactElement(element) {
var route = _RouteUtils.createRouteFromReactElement(element);
route.onEnter = function (nextState, replaceState) {
var location = nextState.location;
var params = nextState.params;
if (route.from) route.path = route.from;
var pathname = route.to ? _PatternUtils.formatPattern(route.to, params) : location.pathname;
route.onEnter = function (nextState, replaceState) {
var location = nextState.location;
var params = nextState.params;
replaceState(route.state || location.state, pathname, route.query || location.query);
};
var pathname = undefined;
if (route.to.charAt(0) === '/') {
pathname = _PatternUtils.formatPattern(route.to, params);
} else if (!route.to) {
pathname = location.pathname;
} else {
var routeIndex = nextState.routes.indexOf(route);
var parentPattern = Redirect.getRoutePattern(nextState.routes, routeIndex - 1);
var pattern = parentPattern.replace(/\/*$/, '/') + route.to;
pathname = _PatternUtils.formatPattern(pattern, params);
}
return route;
replaceState(route.state || location.state, pathname, route.query || location.query);
};
return route;
};
Redirect.getRoutePattern = function getRoutePattern(routes, routeIndex) {
var parentPattern = '';
for (var i = routeIndex; i >= 0; i--) {
var route = routes[i];
var pattern = route.path || '';
parentPattern = pattern.replace(/\/*$/, '/') + parentPattern;
if (pattern.indexOf('/') === 0) break;
}
},
return '/' + parentPattern;
};
propTypes: {
path: string,
from: string, // Alias for path
to: string.isRequired,
query: object,
state: object,
onEnter: _PropTypes.falsy,
children: _PropTypes.falsy
},
render: function render() {
Redirect.prototype.render = function render() {
_invariant2['default'](false, '<Redirect> elements are for router configuration only and should not be rendered');
}
};
});
_createClass(Redirect, null, [{
key: 'propTypes',
value: {
path: string,
from: string, // Alias for path
to: string.isRequired,
query: object,
state: object,
onEnter: _PropTypes.falsy,
children: _PropTypes.falsy
},
enumerable: true
}]);
return Redirect;
})(_react2['default'].Component);
exports['default'] = Redirect;
module.exports = exports['default'];

@@ -5,4 +5,10 @@ 'use strict';

var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }
function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
var _react = require('react');

@@ -30,47 +36,55 @@

/**
* A <Route> is used to declare which components are rendered to the page when
* the URL matches a given pattern.
* A <Route> is used to declare which components 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.
* 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 in the tree.
*/
var Route = _react2['default'].createClass({
displayName: 'Route',
statics: {
var Route = (function (_React$Component) {
_inherits(Route, _React$Component);
createRouteFromReactElement: function createRouteFromReactElement(element) {
var route = _RouteUtils.createRouteFromReactElement(element);
function Route() {
_classCallCheck(this, Route);
if (route.handler) {
_warning2['default'](false, '<Route handler> is deprecated, use <Route component> instead');
_React$Component.apply(this, arguments);
}
route.component = route.handler;
delete route.handler;
}
Route.createRouteFromReactElement = function createRouteFromReactElement(element) {
var route = _RouteUtils.createRouteFromReactElement(element);
return route;
if (route.handler) {
_warning2['default'](false, '<Route handler> is deprecated, use <Route component> instead');
route.component = route.handler;
delete route.handler;
}
},
return route;
};
propTypes: {
path: string,
ignoreScrollBehavior: bool,
handler: // deprecated
_PropTypes.component, component: _PropTypes.component,
components: _PropTypes.components,
getComponents: func
},
render: function render() {
Route.prototype.render = function render() {
_invariant2['default'](false, '<Route> elements are for router configuration only and should not be rendered');
}
};
});
_createClass(Route, null, [{
key: 'propTypes',
value: {
path: string,
ignoreScrollBehavior: bool,
handler: // deprecated
_PropTypes.component, component: _PropTypes.component,
components: _PropTypes.components,
getComponents: func
},
enumerable: true
}]);
return Route;
})(_react2['default'].Component);
exports['default'] = Route;
module.exports = exports['default'];

@@ -5,4 +5,10 @@ 'use strict';

var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }
function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
var _react = require('react');

@@ -41,18 +47,27 @@

*/
var Router = _react2['default'].createClass({
displayName: 'Router',
propTypes: {
history: object,
children: _PropTypes.routes,
routes: _PropTypes.routes, // alias for children
createElement: func,
onError: func,
onUpdate: func,
parseQueryString: func,
stringifyQuery: func
},
var Router = (function (_React$Component) {
_inherits(Router, _React$Component);
getInitialState: function getInitialState() {
return {
_createClass(Router, null, [{
key: 'propTypes',
value: {
history: object,
children: _PropTypes.routes,
routes: _PropTypes.routes, // alias for children
createElement: func,
onError: func,
onUpdate: func,
parseQueryString: func,
stringifyQuery: func
},
enumerable: true
}]);
function Router(props, context) {
_classCallCheck(this, Router);
_React$Component.call(this, props, context);
this.state = {
location: null,

@@ -63,5 +78,5 @@ routes: null,

};
},
}
handleError: function handleError(error) {
Router.prototype.handleError = function handleError(error) {
if (this.props.onError) {

@@ -73,5 +88,5 @@ this.props.onError.call(this, error);

}
},
};
componentWillMount: function componentWillMount() {
Router.prototype.componentWillMount = function componentWillMount() {
var _this = this;

@@ -103,13 +118,13 @@

});
},
};
componentWillReceiveProps: function componentWillReceiveProps(nextProps) {
_warning2['default'](nextProps.history === this.props.history, "The `history` provided to <Router/> has changed, it will be ignored.");
},
Router.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) {
_warning2['default'](nextProps.history === this.props.history, 'You cannot change <Router history>; it will be ignored');
};
componentWillUnmount: function componentWillUnmount() {
Router.prototype.componentWillUnmount = function componentWillUnmount() {
if (this._unlisten) this._unlisten();
},
};
render: function render() {
Router.prototype.render = function render() {
var _state = this.state;

@@ -132,7 +147,8 @@ var location = _state.location;

});
}
};
});
return Router;
})(_react2['default'].Component);
exports['default'] = Router;
module.exports = exports['default'];

@@ -68,5 +68,5 @@ 'use strict';

*
* import { Route, createRoutesFromReactChildren } from 'react-router';
* import { Route, createRoutesFromReactChildren } from 'react-router'
*
* var routes = createRoutesFromReactChildren(
* const routes = createRoutesFromReactChildren(
* <Route component={App}>

@@ -76,3 +76,3 @@ * <Route path="home" component={Dashboard}/>

* </Route>
* );
* )
*

@@ -110,3 +110,3 @@ * Note: This method is automatically used when you provide <Route> children

routes = createRoutesFromReactChildren(routes);
} else if (!Array.isArray(routes)) {
} else if (routes && !Array.isArray(routes)) {
routes = [routes];

@@ -113,0 +113,0 @@ }

@@ -5,4 +5,10 @@ 'use strict';

var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }
function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
var _react = require('react');

@@ -29,26 +35,13 @@

*/
var RoutingContext = _react2['default'].createClass({
displayName: 'RoutingContext',
propTypes: {
history: object.isRequired,
createElement: func.isRequired,
location: object.isRequired,
routes: array.isRequired,
params: object.isRequired,
components: array.isRequired
},
var RoutingContext = (function (_React$Component) {
_inherits(RoutingContext, _React$Component);
getDefaultProps: function getDefaultProps() {
return {
createElement: _react2['default'].createElement
};
},
function RoutingContext() {
_classCallCheck(this, RoutingContext);
childContextTypes: {
history: object.isRequired,
location: object.isRequired
},
_React$Component.apply(this, arguments);
}
getChildContext: function getChildContext() {
RoutingContext.prototype.getChildContext = function getChildContext() {
return {

@@ -58,9 +51,9 @@ history: this.props.history,

};
},
};
createElement: function createElement(component, props) {
RoutingContext.prototype.createElement = function createElement(component, props) {
return component == null ? null : this.props.createElement(component, props);
},
};
render: function render() {
RoutingContext.prototype.render = function render() {
var _this = this;

@@ -79,3 +72,3 @@

element = components.reduceRight(function (element, components, index) {
if (components == null) return element; // Don't create new children; use the grandchildren.
if (components == null) return element; // Don't create new children use the grandchildren.

@@ -98,5 +91,5 @@ var route = routes[index];

for (var key in components) if (components.hasOwnProperty(key)) elements[key] = _this.createElement(components[key], props);
return elements;
for (var key in components) {
if (components.hasOwnProperty(key)) elements[key] = _this.createElement(components[key], props);
}return elements;
}

@@ -111,7 +104,34 @@

return element;
}
};
});
_createClass(RoutingContext, null, [{
key: 'propTypes',
value: {
history: object.isRequired,
createElement: func.isRequired,
location: object.isRequired,
routes: array.isRequired,
params: object.isRequired,
components: array.isRequired
},
enumerable: true
}, {
key: 'defaultProps',
value: {
createElement: _react2['default'].createElement
},
enumerable: true
}, {
key: 'childContextTypes',
value: {
history: object.isRequired,
location: object.isRequired
},
enumerable: true
}]);
return RoutingContext;
})(_react2['default'].Component);
exports['default'] = RoutingContext;
module.exports = exports['default'];

@@ -48,3 +48,3 @@ 'use strict';

var redirectInfo;
var redirectInfo = undefined;
function replaceState(state, pathname, query) {

@@ -70,3 +70,5 @@ redirectInfo = { pathname: pathname, query: query, state: state };

function runLeaveHooks(routes) {
for (var i = 0, len = routes.length; i < len; ++i) if (routes[i].onLeave) routes[i].onLeave.call(routes[i]);
for (var i = 0, len = routes.length; i < len; ++i) {
if (routes[i].onLeave) routes[i].onLeave.call(routes[i]);
}
}

@@ -21,6 +21,2 @@ 'use strict';

var _historyLibCreateLocation = require('history/lib/createLocation');
var _historyLibCreateLocation2 = _interopRequireDefault(_historyLibCreateLocation);
var _computeChangedRoutes2 = require('./computeChangedRoutes');

@@ -45,5 +41,5 @@

function hasAnyProperties(object) {
for (var p in object) if (object.hasOwnProperty(p)) return true;
return false;
for (var p in object) {
if (object.hasOwnProperty(p)) return true;
}return false;
}

@@ -55,7 +51,8 @@

*
* - isActive(pathname, query)
* - registerRouteHook(route, (location) => {})
* - unregisterRouteHook(route, (location) => {})
* - match(location, (error, nextState, nextLocation) => {})
* Enhances history objects with the following methods:
*
* - listen((error, nextState) => {})
* - listenBeforeLeavingRoute(route, (nextLocation) => {})
* - match(location, (error, redirectLocation, nextState) => {})
* - isActive(pathname, query, indexOnly=false)
*/

@@ -78,2 +75,10 @@ function useRoutes(createHistory) {

function createLocationFromRedirectInfo(_ref) {
var pathname = _ref.pathname;
var query = _ref.query;
var state = _ref.state;
return history.createLocation(history.createPath(pathname, query), state, _historyLibActions.REPLACE);
}
var partialNextState = undefined;

@@ -88,10 +93,7 @@

if (error) {
callback(error, null, null);
callback(error);
} else if (nextState) {
finishMatch(_extends({}, nextState, { location: location }), function (err, nextLocation, nextState) {
if (nextState) state = nextState;
callback(err, nextLocation, nextState);
});
finishMatch(_extends({}, nextState, { location: location }), callback);
} else {
callback(null, null, null);
callback();
}

@@ -102,10 +104,2 @@ });

function createLocationFromRedirectInfo(_ref) {
var pathname = _ref.pathname;
var query = _ref.query;
var state = _ref.state;
return _historyLibCreateLocation2['default'](history.createPath(pathname, query), state, _historyLibActions.REPLACE, history.createKey());
}
function finishMatch(nextState, callback) {

@@ -123,3 +117,3 @@ var _computeChangedRoutes = _computeChangedRoutes3['default'](state, nextState);

} else if (redirectInfo) {
callback(null, createLocationFromRedirectInfo(redirectInfo), null);
callback(null, createLocationFromRedirectInfo(redirectInfo));
} else {

@@ -131,3 +125,5 @@ // TODO: Fetch components after state is updated.

} else {
callback(null, null, _extends({}, nextState, { components: components }));
// TODO: Make match a pure function and have some other API
// for "match and update state".
callback(null, null, state = _extends({}, nextState, { components: components }));
}

@@ -139,4 +135,2 @@ });

var RouteHooks = {};
var RouteGuid = 1;

@@ -148,2 +142,4 @@

var RouteHooks = {};
function getRouteHooksForRoutes(routes) {

@@ -184,4 +180,4 @@ return routes.reduce(function (hooks, route) {

function beforeUnloadHook() {
// Synchronously check to see if any route hooks want to
// prevent the current window/tab from closing.
// Synchronously check to see if any route hooks want
// to prevent the current window/tab from closing.
if (state.routes) {

@@ -201,3 +197,19 @@ var hooks = getRouteHooksForRoutes(state.routes);

function registerRouteHook(route, hook) {
var unlistenBefore = undefined,
unlistenBeforeUnload = undefined;
/**
* Registers the given hook function to run before leaving the given route.
*
* During a normal transition, the hook function receives the next location
* as its only argument and must return either a) a prompt message to show
* the user, to make sure they want to leave the page or b) false, to prevent
* the transition.
*
* During the beforeunload event (in browsers) the hook receives no arguments.
* In this case it must return a prompt message to prevent the transition.
*
* Returns a function that may be used to unbind the listener.
*/
function listenBeforeLeavingRoute(route, hook) {
// TODO: Warn if they register for a route that isn't currently

@@ -215,5 +227,6 @@ // active. They're probably doing something wrong, like re-creating

if (thereWereNoRouteHooks) {
history.registerTransitionHook(transitionHook);
// setup transition & beforeunload hooks
unlistenBefore = history.listenBefore(transitionHook);
if (history.registerBeforeUnloadHook) history.registerBeforeUnloadHook(beforeUnloadHook);
if (history.listenBeforeUnload) unlistenBeforeUnload = history.listenBeforeUnload(beforeUnloadHook);
}

@@ -223,36 +236,41 @@ } else if (hooks.indexOf(hook) === -1) {

}
}
function unregisterRouteHook(route, hook) {
var routeID = getRouteID(route);
var hooks = RouteHooks[routeID];
return function () {
var hooks = RouteHooks[routeID];
if (hooks != null) {
var newHooks = hooks.filter(function (item) {
return item !== hook;
});
if (hooks != null) {
var newHooks = hooks.filter(function (item) {
return item !== hook;
});
if (newHooks.length === 0) {
delete RouteHooks[routeID];
if (newHooks.length === 0) {
delete RouteHooks[routeID];
if (!hasAnyProperties(RouteHooks)) {
history.unregisterTransitionHook(transitionHook);
if (!hasAnyProperties(RouteHooks)) {
// teardown transition & beforeunload hooks
if (unlistenBefore) {
unlistenBefore();
unlistenBefore = null;
}
if (history.unregisterBeforeUnloadHook) history.unregisterBeforeUnloadHook(beforeUnloadHook);
if (unlistenBeforeUnload) {
unlistenBeforeUnload();
unlistenBeforeUnload = null;
}
}
} else {
RouteHooks[routeID] = newHooks;
}
} else {
RouteHooks[routeID] = newHooks;
}
}
};
}
/**
* This is the API for stateful environments. As the location changes,
* we update state and call the listener. Benefits of this API are:
*
* - We automatically manage state on the client
* - We automatically handle redirects on the client
* - We warn when the location doesn't match any routes
* This is the API for stateful environments. As the location
* changes, we update state and call the listener. We can also
* gracefully handle errors and redirects.
*/
function listen(listener) {
// TODO: Only use a single history listener. Otherwise we'll
// end up with multiple concurrent calls to match.
return history.listen(function (location) {

@@ -262,12 +280,12 @@ if (state.location === location) {

} else {
match(location, function (error, nextLocation, nextState) {
match(location, function (error, redirectLocation, nextState) {
if (error) {
listener(error);
} else if (redirectLocation) {
history.transitionTo(redirectLocation);
} else if (nextState) {
listener(null, state); // match mutates state to nextState
} else if (nextLocation) {
history.transitionTo(nextLocation);
} else {
_warning2['default'](false, 'Location "%s" did not match any routes', location.pathname + location.search);
}
listener(null, nextState);
} else {
_warning2['default'](false, 'Location "%s" did not match any routes', location.pathname + location.search + location.hash);
}
});

@@ -280,6 +298,5 @@ }

isActive: isActive,
registerRouteHook: registerRouteHook,
unregisterRouteHook: unregisterRouteHook,
listen: listen,
match: match
match: match,
listenBeforeLeavingRoute: listenBeforeLeavingRoute,
listen: listen
});

@@ -286,0 +303,0 @@ };

export function loopAsync(turns, work, callback) {
var currentTurn = 0;
var isDone = false;
let currentTurn = 0, isDone = false
function done() {
isDone = true;
callback.apply(this, arguments);
isDone = true
callback.apply(this, arguments)
}

@@ -12,38 +11,37 @@

if (isDone)
return;
return
if (currentTurn < turns) {
work.call(this, currentTurn++, next, done);
work.call(this, currentTurn++, next, done)
} else {
done.apply(this, arguments);
done.apply(this, arguments)
}
}
next();
next()
}
export function mapAsync(array, work, callback) {
var length = array.length;
var values = [];
const length = array.length
const values = []
if (length === 0)
return callback(null, values);
return callback(null, values)
var isDone = false;
var doneCount = 0;
let isDone = false, doneCount = 0
function done(index, error, value) {
if (isDone)
return;
return
if (error) {
isDone = true;
callback(error);
isDone = true
callback(error)
} else {
values[index] = value;
values[index] = value
isDone = (++doneCount === length);
isDone = (++doneCount === length)
if (isDone)
callback(null, values);
callback(null, values)
}

@@ -54,5 +52,5 @@ }

work(item, index, function (error, value) {
done(index, error, value);
});
});
done(index, error, value)
})
})
}

@@ -1,14 +0,18 @@

import { getParamNames } from './PatternUtils';
import { getParamNames } from './PatternUtils'
function routeParamsChanged(route, prevState, nextState) {
if (!route.path)
return false;
return false
var paramNames = getParamNames(route.path);
const paramNames = getParamNames(route.path)
return paramNames.some(function (paramName) {
return prevState.params[paramName] !== nextState.params[paramName];
});
return prevState.params[paramName] !== nextState.params[paramName]
})
}
function routeQueryChanged(prevState, nextState) {
return prevState.location.search !== nextState.location.search
}
/**

@@ -18,3 +22,5 @@ * Returns an object of { leaveRoutes, enterRoutes } determined by

* 1) they are not in the next state or 2) they are in the next state
* but their params have changed (i.e. /users/123 => /users/456).
* but their params have changed (i.e. /users/123 => /users/456) or
* 3) they are in the next state but the query has changed
* (i.e. /search?query=foo => /search?query=bar)
*

@@ -26,20 +32,22 @@ * leaveRoutes are ordered starting at the leaf route of the tree

function computeChangedRoutes(prevState, nextState) {
var prevRoutes = prevState && prevState.routes;
var nextRoutes = nextState.routes;
const prevRoutes = prevState && prevState.routes
const nextRoutes = nextState.routes
var leaveRoutes, enterRoutes;
let leaveRoutes, enterRoutes
if (prevRoutes) {
leaveRoutes = prevRoutes.filter(function (route) {
return nextRoutes.indexOf(route) === -1 || routeParamsChanged(route, prevState, nextState);
});
return nextRoutes.indexOf(route) === -1
|| routeParamsChanged(route, prevState, nextState)
|| routeQueryChanged(prevState, nextState)
})
// onLeave hooks start at the leaf route.
leaveRoutes.reverse();
leaveRoutes.reverse()
enterRoutes = nextRoutes.filter(function (route) {
return prevRoutes.indexOf(route) === -1 || leaveRoutes.indexOf(route) !== -1;
});
return prevRoutes.indexOf(route) === -1 || leaveRoutes.indexOf(route) !== -1
})
} else {
leaveRoutes = [];
enterRoutes = nextRoutes;
leaveRoutes = []
enterRoutes = nextRoutes
}

@@ -50,5 +58,5 @@

enterRoutes
};
}
}
export default computeChangedRoutes;
export default computeChangedRoutes

@@ -1,10 +0,10 @@

export var canUseDOM = !!(
export const canUseDOM = !!(
typeof window !== 'undefined' && window.document && window.document.createElement
);
)
export function addEventListener(node, type, listener) {
if (node.addEventListener) {
node.addEventListener(type, listener, false);
node.addEventListener(type, listener, false)
} else {
node.attachEvent('on' + type, listener);
node.attachEvent('on' + type, listener)
}

@@ -15,5 +15,5 @@ }

if (node.removeEventListener) {
node.removeEventListener(type, listener, false);
node.removeEventListener(type, listener, false)
} else {
node.detachEvent('on' + type, listener);
node.detachEvent('on' + type, listener)
}

@@ -25,3 +25,3 @@ }

// consistent across browsers - Firefox will pre-decode it!
return window.location.href.split('#')[1] || '';
return window.location.href.split('#')[1] || ''
}

@@ -32,7 +32,7 @@

window.location.pathname + window.location.search + '#' + path
);
)
}
export function getWindowPath() {
return window.location.pathname + window.location.search;
return window.location.pathname + window.location.search
}

@@ -44,7 +44,7 @@

y: window.pageYOffset || document.documentElement.scrollTop
};
}
}
export function setWindowScrollPosition(scrollX, scrollY) {
window.scrollTo(scrollX, scrollY);
window.scrollTo(scrollX, scrollY)
}

@@ -59,7 +59,7 @@

export function supportsHistory() {
var ua = navigator.userAgent;
const 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 false
}
return window.history && 'pushState' in window.history;
return window.history && 'pushState' in window.history
}

@@ -1,12 +0,12 @@

import { mapAsync } from './AsyncUtils';
import { mapAsync } from './AsyncUtils'
function getComponentsForRoute(location, route, callback) {
if (route.component || route.components) {
callback(null, route.component || route.components);
callback(null, route.component || route.components)
} else if (route.getComponent) {
route.getComponent(location, callback);
route.getComponent(location, callback)
} else if (route.getComponents) {
route.getComponents(location, callback);
route.getComponents(location, callback)
} else {
callback();
callback()
}

@@ -24,6 +24,6 @@ }

mapAsync(nextState.routes, function (route, index, callback) {
getComponentsForRoute(nextState.location, route, callback);
}, callback);
getComponentsForRoute(nextState.location, route, callback)
}, callback)
}
export default getComponents;
export default getComponents

@@ -1,2 +0,2 @@

import { getParamNames } from './PatternUtils';
import { getParamNames } from './PatternUtils'

@@ -8,16 +8,16 @@ /**

function getRouteParams(route, params) {
var routeParams = {};
const routeParams = {}
if (!route.path)
return routeParams;
return routeParams
var paramNames = getParamNames(route.path);
const paramNames = getParamNames(route.path)
for (var p in params)
for (const p in params)
if (params.hasOwnProperty(p) && paramNames.indexOf(p) !== -1)
routeParams[p] = params[p];
routeParams[p] = params[p]
return routeParams;
return routeParams
}
export default getRouteParams;
export default getRouteParams

@@ -1,13 +0,13 @@

import { history } from './PropTypes';
import { history } from './PropTypes'
var History = {
const History = {
contextTypes: { history },
componentWillMount () {
this.history = this.context.history;
componentWillMount() {
this.history = this.context.history
}
};
}
export default History;
export default History
/* components */
export Router from './Router';
export Link from './Link';
export Router from './Router'
export Link from './Link'
export IndexLink from './IndexLink'
/* components (configuration) */
export IndexRoute from './IndexRoute';
export Redirect from './Redirect';
export Route from './Route';
export IndexRedirect from './IndexRedirect'
export IndexRoute from './IndexRoute'
export Redirect from './Redirect'
export Route from './Route'
/* mixins */
export History from './History';
export Lifecycle from './Lifecycle';
export RouteContext from './RouteContext';
export History from './History'
export Lifecycle from './Lifecycle'
export RouteContext from './RouteContext'
/* utils */
export useRoutes from './useRoutes';
export { createRoutes } from './RouteUtils';
export RoutingContext from './RoutingContext';
export PropTypes from './PropTypes';
export match from './match';
export useRoutes from './useRoutes'
export { createRoutes } from './RouteUtils'
export RoutingContext from './RoutingContext'
export PropTypes from './PropTypes'
export match from './match'
export default from './Router';
export default from './Router'

@@ -1,5 +0,8 @@

import React from 'react';
import Link from './Link';
import React from 'react'
import Link from './Link'
var IndexLink = React.createClass({
/**
* An <IndexLink> is used to link to an <IndexRoute>.
*/
class IndexLink extends React.Component {

@@ -10,4 +13,4 @@ render() {

});
}
export default IndexLink;
export default IndexLink

@@ -1,8 +0,8 @@

import React from 'react';
import invariant from 'invariant';
import warning from 'warning';
import { createRouteFromReactElement } from './RouteUtils';
import { component, components, falsy } from './PropTypes';
import React from 'react'
import invariant from 'invariant'
import warning from 'warning'
import { createRouteFromReactElement } from './RouteUtils'
import { component, components, falsy } from './PropTypes'
var { bool, func } = React.PropTypes;
const { bool, func } = React.PropTypes

@@ -13,20 +13,16 @@ /**

*/
var IndexRoute = React.createClass({
class IndexRoute extends React.Component {
statics: {
createRouteFromReactElement(element, parentRoute) {
if (parentRoute) {
parentRoute.indexRoute = createRouteFromReactElement(element);
} else {
warning(
false,
'An <IndexRoute> does not make sense at the root of your route config'
);
}
static createRouteFromReactElement(element, parentRoute) {
if (parentRoute) {
parentRoute.indexRoute = createRouteFromReactElement(element)
} else {
warning(
false,
'An <IndexRoute> does not make sense at the root of your route config'
)
}
}
},
propTypes: {
static propTypes = {
path: falsy,

@@ -37,3 +33,3 @@ ignoreScrollBehavior: bool,

getComponents: func
},
}

@@ -44,7 +40,7 @@ render() {

'<IndexRoute> elements are for router configuration only and should not be rendered'
);
)
}
});
}
export default IndexRoute;
export default IndexRoute

@@ -1,36 +0,70 @@

import { matchPattern } from './PatternUtils';
import { matchPattern } from './PatternUtils'
/**
* Returns true if a route and params that match the given
* pathname are currently active.
*/
function pathnameIsActive(pathname, activePathname, activeRoutes, activeParams) {
if (pathname === activePathname || activePathname.indexOf(pathname + '/') === 0)
return true;
function deepEqual(a, b) {
if (a == b)
return true
var route, pattern;
var basename = '';
for (var i = 0, len = activeRoutes.length; i < len; ++i) {
route = activeRoutes[i];
if (!route.path) return false;
pattern = route.path || '';
if (a == null || b == null)
return false
if (pattern.indexOf('/') !== 0)
pattern = basename.replace(/\/*$/, '/') + pattern; // Relative paths build on the parent's path.
if (Array.isArray(a)) {
return Array.isArray(b) && a.length === b.length && a.every(function (item, index) {
return deepEqual(item, b[index])
})
}
var { remainingPathname, paramNames, paramValues } = matchPattern(pattern, pathname);
if (typeof a === 'object') {
for (let p in a)
if (a.hasOwnProperty(p) && (!b.hasOwnProperty(p) || !deepEqual(a[p], b[p])))
return false
if (remainingPathname === '') {
return paramNames.every(function (paramName, index) {
return String(paramValues[index]) === String(activeParams[paramName]);
});
}
return true
}
basename = pattern;
return String(a) === String(b)
}
function paramsAreActive(paramNames, paramValues, activeParams) {
return paramNames.every(function (paramName, index) {
return String(paramValues[index]) === String(activeParams[paramName])
})
}
function getMatchingRoute(pathname, activeRoutes, activeParams) {
let route, pattern, basename = ''
for (let i = 0, len = activeRoutes.length; i < len; ++i) {
route = activeRoutes[i]
pattern = route.path || ''
if (pattern.charAt(0) !== '/')
pattern = basename.replace(/\/*$/, '/') + pattern // Relative paths build on the parent's path.
let { remainingPathname, paramNames, paramValues } = matchPattern(pattern, pathname)
if (remainingPathname === '' && paramsAreActive(paramNames, paramValues, activeParams))
return route
basename = pattern
}
return false;
return null
}
/**
* Returns true if the given pathname matches the active routes
* and params.
*/
function routeIsActive(pathname, activeRoutes, activeParams, indexOnly) {
let route = getMatchingRoute(pathname, activeRoutes, activeParams)
if (route == null)
return false
if (indexOnly)
return activeRoutes.length > 1 && activeRoutes[activeRoutes.length - 1] === route.indexRoute
return true
}
/**
* Returns true if all key/value pairs in the given query are

@@ -41,12 +75,8 @@ * currently active.

if (activeQuery == null)
return query == null;
return query == null
if (query == null)
return true;
return true
for (var p in query)
if (query.hasOwnProperty(p) && String(query[p]) !== String(activeQuery[p]))
return false;
return true;
return deepEqual(query, activeQuery)
}

@@ -60,11 +90,10 @@

if (location == null)
return false;
return false
if (indexOnly && (routes.length < 2 || routes[routes.length - 2].indexRoute !== routes[routes.length - 1]))
return false;
if (!routeIsActive(pathname, routes, params, indexOnly))
return false
return pathnameIsActive(pathname, location.pathname, routes, params) &&
queryIsActive(query, location.query);
return queryIsActive(query, location.query)
}
export default isActive;
export default isActive

@@ -1,10 +0,10 @@

import React from 'react';
import invariant from 'invariant';
import React from 'react'
import invariant from 'invariant'
var { object } = React.PropTypes;
const { object } = React.PropTypes
/**
* The Lifecycle mixin adds the routerWillLeave lifecycle method
* to a component that may be used to cancel a transition or prompt
* the user for confirmation.
* The Lifecycle mixin adds the routerWillLeave lifecycle method to a
* component that may be used to cancel a transition or prompt the user
* for confirmation.
*

@@ -15,15 +15,10 @@ * On standard transitions, routerWillLeave receives a single argument: the

*
* routerWillLeave does not receive a location object during the beforeunload
* event in web browsers (assuming you're using the useBeforeUnload history
* enhancer). In this case, it is not possible for us to know the location
* we're transitioning to so routerWillLeave must return a prompt message to
* prevent the user from closing the tab.
* During the beforeunload event (assuming you're using the useBeforeUnload
* history enhancer), routerWillLeave does not receive a location object
* because it isn't possible for us to know the location we're transitioning
* to. In this case routerWillLeave must return a prompt message to prevent
* the user from closing the window/tab.
*/
var Lifecycle = {
const Lifecycle = {
propTypes: {
// Route components receive the route object as a prop.
route: object
},
contextTypes: {

@@ -37,35 +32,34 @@ history: object.isRequired,

_getRoute() {
var route = this.props.route || this.context.route;
invariant(
route,
'The Lifecycle mixin needs to be used either on 1) a <Route component> or ' +
'2) a descendant of a <Route component> that uses the RouteContext mixin'
);
return route;
propTypes: {
// Route components receive the route object as a prop.
route: object
},
componentWillMount() {
componentDidMount() {
invariant(
this.routerWillLeave,
'The Lifecycle mixin requires you to define a routerWillLeave method'
);
)
this.context.history.registerRouteHook(
this._getRoute(),
const route = this.props.route || this.context.route
invariant(
route,
'The Lifecycle mixin must be used on either a) a <Route component> or ' +
'b) a descendant of a <Route component> that uses the RouteContext mixin'
)
this._unlistenBeforeLeavingRoute = this.context.history.listenBeforeLeavingRoute(
route,
this.routerWillLeave
);
)
},
componentWillUnmount() {
this.context.history.unregisterRouteHook(
this._getRoute(),
this.routerWillLeave
);
if (this._unlistenBeforeLeavingRoute)
this._unlistenBeforeLeavingRoute()
}
};
}
export default Lifecycle;
export default Lifecycle

@@ -1,20 +0,19 @@

import React from 'react';
import warning from 'warning';
import React from 'react'
var { bool, object, string, func } = React.PropTypes;
const { bool, object, string, func } = React.PropTypes
function isLeftClickEvent(event) {
return event.button === 0;
return event.button === 0
}
function isModifiedEvent(event) {
return !!(event.metaKey || event.altKey || event.ctrlKey || event.shiftKey);
return !!(event.metaKey || event.altKey || event.ctrlKey || event.shiftKey)
}
function isEmptyObject(object) {
for (var p in object)
for (let p in object)
if (object.hasOwnProperty(p))
return false;
return false
return true;
return true
}

@@ -24,4 +23,4 @@

* A <Link> is used to create an <a> 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).
* When that route is active, the link gets the value of its
* `activeClassName` prop
*

@@ -41,72 +40,64 @@ * For example, assuming you have the following route:

*/
var Link = React.createClass({
class Link extends React.Component {
contextTypes: {
static contextTypes = {
history: object
},
}
propTypes: {
static propTypes = {
to: string.isRequired,
query: object,
hash: string,
state: object,
activeStyle: object,
activeClassName: string,
onlyActiveOnIndex: bool.isRequired,
to: string.isRequired,
query: object,
state: object,
onClick: func
},
}
getDefaultProps() {
return {
onlyActiveOnIndex: false,
className: '',
style: {}
};
},
static defaultProps = {
onlyActiveOnIndex: false,
className: '',
style: {}
}
handleClick(event) {
var allowTransition = true;
var clickResult;
let allowTransition = true, clickResult
if (this.props.onClick)
clickResult = this.props.onClick(event);
clickResult = this.props.onClick(event)
if (isModifiedEvent(event) || !isLeftClickEvent(event))
return;
return
if (clickResult === false || event.defaultPrevented === true)
allowTransition = false;
allowTransition = false
event.preventDefault();
event.preventDefault()
if (allowTransition)
this.context.history.pushState(this.props.state, this.props.to, this.props.query);
},
this.context.history.pushState(this.props.state, this.props.to, this.props.query)
}
componentWillMount() {
warning(
this.context.history,
'A <Link> should not be rendered outside the context of history; ' +
'some features including real hrefs, active styling, and navigation ' +
'will not function correctly'
);
},
render() {
var { history } = this.context;
var { activeClassName, activeStyle, onlyActiveOnIndex, to, query, state, onClick, ...props } = this.props;
const { to, query, hash, state, activeClassName, activeStyle, onlyActiveOnIndex, ...props } = this.props
props.onClick = this.handleClick;
// Manually override onClick.
props.onClick = (e) => this.handleClick(e)
// Ignore if rendered outside the context
// of history, simplifies unit testing.
// Ignore if rendered outside the context of history, simplifies unit testing.
const { history } = this.context
if (history) {
props.href = history.createHref(to, query);
props.href = history.createHref(to, query)
if (hash)
props.href += hash
if (activeClassName || (activeStyle != null && !isEmptyObject(activeStyle))) {
if (history.isActive(to, query, onlyActiveOnIndex)) {
if (activeClassName)
props.className += props.className === '' ? activeClassName : ` ${activeClassName}`;
props.className += props.className === '' ? activeClassName : ` ${activeClassName}`
if (activeStyle)
props.style = { ...props.style, ...activeStyle };
props.style = { ...props.style, ...activeStyle }
}

@@ -116,7 +107,7 @@ }

return React.createElement('a', props);
return <a {...props} />
}
});
}
export default Link;
export default Link

@@ -1,25 +0,46 @@

import createMemoryHistory from 'history/lib/createMemoryHistory';
import useRoutes from './useRoutes';
import { createRoutes } from './RouteUtils';
import invariant from 'invariant'
import createMemoryHistory from 'history/lib/createMemoryHistory'
import useBasename from 'history/lib/useBasename'
import { createRoutes } from './RouteUtils'
import useRoutes from './useRoutes'
export default function match({
const createHistory = useRoutes(useBasename(createMemoryHistory))
/**
* A high-level API to be used for server-side rendering.
*
* This function matches a location to a set of routes and calls
* callback(error, redirectLocation, renderProps) when finished.
*
* Note: You probably don't want to use this in a browser. Use
* the history.listen API instead.
*/
function match({
routes,
history,
location,
parseQueryString,
stringifyQuery
}, cb) {
let createHistory = history ? () => history : createMemoryHistory;
stringifyQuery,
basename
}, callback) {
invariant(
location,
'match needs a location'
)
let staticHistory = useRoutes(createHistory)({
const history = createHistory({
routes: createRoutes(routes),
parseQueryString,
stringifyQuery
});
stringifyQuery,
basename
})
staticHistory.match(location, function (error, nextLocation, nextState) {
let renderProps = nextState ? {...nextState, history: staticHistory} : null;
cb(error, nextLocation, renderProps);
});
// Allow match({ location: '/the/path', ... })
if (typeof location === 'string')
location = history.createLocation(location)
history.match(location, function (error, redirectLocation, nextState) {
callback(error, redirectLocation, nextState && { ...nextState, history })
})
}
export default match

@@ -1,14 +0,14 @@

import { loopAsync } from './AsyncUtils';
import { matchPattern } from './PatternUtils';
import { createRoutes } from './RouteUtils';
import { loopAsync } from './AsyncUtils'
import { matchPattern } from './PatternUtils'
import { createRoutes } from './RouteUtils'
function getChildRoutes(route, location, callback) {
if (route.childRoutes) {
callback(null, route.childRoutes);
callback(null, route.childRoutes)
} else if (route.getChildRoutes) {
route.getChildRoutes(location, function(error, childRoutes) {
callback(error, !error && createRoutes(childRoutes));
});
route.getChildRoutes(location, function (error, childRoutes) {
callback(error, !error && createRoutes(childRoutes))
})
} else {
callback();
callback()
}

@@ -19,9 +19,9 @@ }

if (route.indexRoute) {
callback(null, route.indexRoute);
callback(null, route.indexRoute)
} else if (route.getIndexRoute) {
route.getIndexRoute(location, function(error, indexRoute) {
callback(error, !error && createRoutes(indexRoute)[0]);
});
route.getIndexRoute(location, function (error, indexRoute) {
callback(error, !error && createRoutes(indexRoute)[0])
})
} else {
callback();
callback()
}

@@ -32,45 +32,45 @@ }

return paramNames.reduceRight(function (params, paramName, index) {
var paramValue = paramValues && paramValues[index];
const paramValue = paramValues && paramValues[index]
if (Array.isArray(params[paramName])) {
params[paramName].unshift(paramValue);
params[paramName].unshift(paramValue)
} else if (paramName in params) {
params[paramName] = [ paramValue, params[paramName] ];
params[paramName] = [ paramValue, params[paramName] ]
} else {
params[paramName] = paramValue;
params[paramName] = paramValue
}
return params;
}, params);
return params
}, params)
}
function createParams(paramNames, paramValues) {
return assignParams({}, paramNames, paramValues);
return assignParams({}, paramNames, paramValues)
}
function matchRouteDeep(basename, route, location, callback) {
var pattern = route.path || '';
let pattern = route.path || ''
if (pattern.indexOf('/') !== 0)
pattern = basename.replace(/\/*$/, '/') + pattern; // Relative paths build on the parent's path.
if (pattern.charAt(0) !== '/')
pattern = basename.replace(/\/*$/, '/') + pattern // Relative paths build on the parent's path.
var { remainingPathname, paramNames, paramValues } = matchPattern(pattern, location.pathname);
var isExactMatch = remainingPathname === '';
const { remainingPathname, paramNames, paramValues } = matchPattern(pattern, location.pathname)
const isExactMatch = remainingPathname === ''
if (isExactMatch && route.path) {
var match = {
const match = {
routes: [ route ],
params: createParams(paramNames, paramValues)
};
}
getIndexRoute(route, location, function (error, indexRoute) {
if (error) {
callback(error);
callback(error)
} else {
if (indexRoute)
match.routes.push(indexRoute);
match.routes.push(indexRoute)
callback(null, match);
callback(null, match)
}
});
})
} else if (remainingPathname != null || route.childRoutes) {

@@ -82,3 +82,3 @@ // Either a) this route matched at least some of the path or b)

if (error) {
callback(error);
callback(error)
} else if (childRoutes) {

@@ -88,17 +88,17 @@ // Check the child routes to see if any of them match.

if (error) {
callback(error);
callback(error)
} else if (match) {
// A child route matched! Augment the match and pass it up the stack.
match.routes.unshift(route);
callback(null, match);
match.routes.unshift(route)
callback(null, match)
} else {
callback();
callback()
}
}, pattern);
}, pattern)
} else {
callback();
callback()
}
});
})
} else {
callback();
callback()
}

@@ -122,10 +122,10 @@ }

if (error || match) {
done(error, match);
done(error, match)
} else {
next();
next()
}
});
}, callback);
})
}, callback)
}
export default matchRoutes;
export default matchRoutes

@@ -1,43 +0,43 @@

import invariant from 'invariant';
import invariant from 'invariant'
function escapeRegExp(string) {
return string.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
return string.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')
}
function escapeSource(string) {
return escapeRegExp(string).replace(/\/+/g, '/+');
return escapeRegExp(string).replace(/\/+/g, '/+')
}
function _compilePattern(pattern) {
var regexpSource = '';
var paramNames = [];
var tokens = [];
let regexpSource = ''
const paramNames = []
const tokens = []
var match, lastIndex = 0, matcher = /:([a-zA-Z_$][a-zA-Z0-9_$]*)|\*|\(|\)/g;
let match, lastIndex = 0, matcher = /:([a-zA-Z_$][a-zA-Z0-9_$]*)|\*|\(|\)/g
while ((match = matcher.exec(pattern))) {
if (match.index !== lastIndex) {
tokens.push(pattern.slice(lastIndex, match.index));
regexpSource += escapeSource(pattern.slice(lastIndex, match.index));
tokens.push(pattern.slice(lastIndex, match.index))
regexpSource += escapeSource(pattern.slice(lastIndex, match.index))
}
if (match[1]) {
regexpSource += '([^/?#]+)';
paramNames.push(match[1]);
regexpSource += '([^/?#]+)'
paramNames.push(match[1])
} else if (match[0] === '*') {
regexpSource += '([\\s\\S]*?)';
paramNames.push('splat');
regexpSource += '([\\s\\S]*?)'
paramNames.push('splat')
} else if (match[0] === '(') {
regexpSource += '(?:';
regexpSource += '(?:'
} else if (match[0] === ')') {
regexpSource += ')?';
regexpSource += ')?'
}
tokens.push(match[0]);
tokens.push(match[0])
lastIndex = matcher.lastIndex;
lastIndex = matcher.lastIndex
}
if (lastIndex !== pattern.length) {
tokens.push(pattern.slice(lastIndex, pattern.length));
regexpSource += escapeSource(pattern.slice(lastIndex, pattern.length));
tokens.push(pattern.slice(lastIndex, pattern.length))
regexpSource += escapeSource(pattern.slice(lastIndex, pattern.length))
}

@@ -50,12 +50,12 @@

tokens
};
}
}
var CompiledPatternsCache = {};
const CompiledPatternsCache = {}
export function compilePattern(pattern) {
if (!(pattern in CompiledPatternsCache))
CompiledPatternsCache[pattern] = _compilePattern(pattern);
CompiledPatternsCache[pattern] = _compilePattern(pattern)
return CompiledPatternsCache[pattern];
return CompiledPatternsCache[pattern]
}

@@ -81,26 +81,26 @@

export function matchPattern(pattern, pathname) {
var { regexpSource, paramNames, tokens } = compilePattern(pattern);
let { regexpSource, paramNames, tokens } = compilePattern(pattern)
regexpSource += '/*'; // Ignore trailing slashes
regexpSource += '/*' // Ignore trailing slashes
var captureRemaining = tokens[tokens.length - 1] !== '*';
const captureRemaining = tokens[tokens.length - 1] !== '*'
if (captureRemaining)
regexpSource += '([\\s\\S]*?)';
regexpSource += '([\\s\\S]*?)'
var match = pathname.match(new RegExp('^' + regexpSource + '$', 'i'));
const match = pathname.match(new RegExp('^' + regexpSource + '$', 'i'))
var remainingPathname, paramValues;
let remainingPathname, paramValues
if (match != null) {
paramValues = Array.prototype.slice.call(match, 1).map(function (v) {
return v != null ? decodeURIComponent(v.replace(/\+/g, '%20')) : v;
});
return v != null ? decodeURIComponent(v.replace(/\+/g, '%20')) : v
})
if (captureRemaining) {
remainingPathname = paramValues.pop();
remainingPathname = paramValues.pop()
} else {
remainingPathname = pathname.replace(match[0], '');
remainingPathname = pathname.replace(match[0], '')
}
} else {
remainingPathname = paramValues = null;
remainingPathname = paramValues = null
}

@@ -112,20 +112,20 @@

paramValues
};
}
}
export function getParamNames(pattern) {
return compilePattern(pattern).paramNames;
return compilePattern(pattern).paramNames
}
export function getParams(pattern, pathname) {
var { paramNames, paramValues } = matchPattern(pattern, pathname);
const { paramNames, paramValues } = matchPattern(pattern, pathname)
if (paramValues != null) {
return paramNames.reduce(function (memo, paramName, index) {
memo[paramName] = paramValues[index];
return memo;
}, {});
memo[paramName] = paramValues[index]
return memo
}, {})
}
return null;
return null
}

@@ -138,13 +138,13 @@

export function formatPattern(pattern, params) {
params = params || {};
params = params || {}
var { tokens } = compilePattern(pattern);
var parenCount = 0, pathname = '', splatIndex = 0;
const { tokens } = compilePattern(pattern)
let parenCount = 0, pathname = '', splatIndex = 0
var token, paramName, paramValue;
for (var i = 0, len = tokens.length; i < len; ++i) {
token = tokens[i];
let token, paramName, paramValue
for (let i = 0, len = tokens.length; i < len; ++i) {
token = tokens[i]
if (token === '*') {
paramValue = Array.isArray(params.splat) ? params.splat[splatIndex++] : params.splat;
paramValue = Array.isArray(params.splat) ? params.splat[splatIndex++] : params.splat

@@ -155,13 +155,13 @@ invariant(

splatIndex, pattern
);
)
if (paramValue != null)
pathname += encodeURI(paramValue).replace(/%20/g, '+');
pathname += encodeURI(paramValue).replace(/%20/g, '+')
} else if (token === '(') {
parenCount += 1;
parenCount += 1
} else if (token === ')') {
parenCount -= 1;
parenCount -= 1
} else if (token.charAt(0) === ':') {
paramName = token.substring(1);
paramValue = params[paramName];
paramName = token.substring(1)
paramValue = params[paramName]

@@ -172,12 +172,12 @@ invariant(

paramName, pattern
);
)
if (paramValue != null)
pathname += encodeURIComponent(paramValue).replace(/%20/g, '+');
pathname += encodeURIComponent(paramValue).replace(/%20/g, '+')
} else {
pathname += token;
pathname += token
}
}
return pathname.replace(/\/+/g, '/');
return pathname.replace(/\/+/g, '/')
}

@@ -1,11 +0,11 @@

import { PropTypes } from 'react';
import { PropTypes } from 'react'
var { func, object, arrayOf, oneOfType, element, shape, string } = PropTypes;
const { func, object, arrayOf, oneOfType, element, shape, string } = PropTypes
export function falsy(props, propName, componentName) {
if (props[propName])
return new Error(`<${componentName}> should not have a "${propName}" prop`);
return new Error(`<${componentName}> should not have a "${propName}" prop`)
}
export var history = shape({
export const history = shape({
listen: func.isRequired,

@@ -15,5 +15,5 @@ pushState: func.isRequired,

go: func.isRequired
});
})
export var location = shape({
export const location = shape({
pathname: string.isRequired,

@@ -24,8 +24,8 @@ search: string.isRequired,

key: string
});
})
export var component = oneOfType([ func, string ]);
export var components = oneOfType([ component, object ]);
export var route = oneOfType([ object, element ]);
export var routes = oneOfType([ route, arrayOf(route) ]);
export const component = oneOfType([ func, string ])
export const components = oneOfType([ component, object ])
export const route = oneOfType([ object, element ])
export const routes = oneOfType([ route, arrayOf(route) ])

@@ -39,2 +39,2 @@ export default {

route
};
}

@@ -1,49 +0,65 @@

import React from 'react';
import invariant from 'invariant';
import { createRouteFromReactElement } from './RouteUtils';
import { formatPattern } from './PatternUtils';
import { falsy } from './PropTypes';
import React from 'react'
import invariant from 'invariant'
import { createRouteFromReactElement } from './RouteUtils'
import { formatPattern } from './PatternUtils'
import { falsy } from './PropTypes'
var { string, object } = React.PropTypes;
const { string, object } = React.PropTypes
/**
* A <Redirect> is used to declare another URL path a client should be sent
* to when they request a given URL.
* A <Redirect> is used to declare another URL path a client should
* be sent to when they request a given URL.
*
* Redirects are placed alongside routes in the route configuration and are
* traversed in the same manner.
* Redirects are placed alongside routes in the route configuration
* and are traversed in the same manner.
*/
var Redirect = React.createClass({
class Redirect extends React.Component {
statics: {
static createRouteFromReactElement(element) {
const route = createRouteFromReactElement(element)
createRouteFromReactElement(element) {
var route = createRouteFromReactElement(element);
if (route.from)
route.path = route.from
if (route.from)
route.path = route.from;
route.onEnter = function (nextState, replaceState) {
const { location, params } = nextState
// TODO: Handle relative pathnames, see #1658
invariant(
route.to.charAt(0) === '/',
'<Redirect to> must be an absolute path. This should be fixed in the future'
);
let pathname
if (route.to.charAt(0) === '/') {
pathname = formatPattern(route.to, params)
} else if (!route.to) {
pathname = location.pathname
} else {
let routeIndex = nextState.routes.indexOf(route)
let parentPattern = Redirect.getRoutePattern(nextState.routes, routeIndex - 1)
let pattern = parentPattern.replace(/\/*$/, '/') + route.to
pathname = formatPattern(pattern, params)
}
route.onEnter = function (nextState, replaceState) {
var { location, params } = nextState;
var pathname = route.to ? formatPattern(route.to, params) : location.pathname;
replaceState(
route.state || location.state,
pathname,
route.query || location.query
)
}
replaceState(
route.state || location.state,
pathname,
route.query || location.query
);
};
return route
}
return route;
static getRoutePattern(routes, routeIndex) {
let parentPattern = ''
for (let i = routeIndex; i >= 0; i--) {
let route = routes[i]
let pattern = route.path || ''
parentPattern = pattern.replace(/\/*$/, '/') + parentPattern
if (pattern.indexOf('/') === 0)
break
}
},
return '/' + parentPattern
}
propTypes: {
static propTypes = {
path: string,

@@ -56,3 +72,3 @@ from: string, // Alias for path

children: falsy
},
}

@@ -63,7 +79,7 @@ render() {

'<Redirect> elements are for router configuration only and should not be rendered'
);
)
}
});
}
export default Redirect;
export default Redirect

@@ -1,42 +0,38 @@

import React from 'react';
import warning from 'warning';
import invariant from 'invariant';
import { createRouteFromReactElement } from './RouteUtils';
import { component, components } from './PropTypes';
import React from 'react'
import warning from 'warning'
import invariant from 'invariant'
import { createRouteFromReactElement } from './RouteUtils'
import { component, components } from './PropTypes'
var { string, bool, func } = React.PropTypes;
const { string, bool, func } = React.PropTypes
/**
* A <Route> is used to declare which components are rendered to the page when
* the URL matches a given pattern.
* A <Route> is used to declare which components 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.
* 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 in the tree.
*/
var Route = React.createClass({
class Route extends React.Component {
statics: {
static createRouteFromReactElement(element) {
const route = createRouteFromReactElement(element)
createRouteFromReactElement(element) {
var route = createRouteFromReactElement(element);
if (route.handler) {
warning(
false,
'<Route handler> is deprecated, use <Route component> instead'
)
if (route.handler) {
warning(
false,
'<Route handler> is deprecated, use <Route component> instead'
);
route.component = route.handler
delete route.handler
}
route.component = route.handler;
delete route.handler;
}
return route
}
return route;
}
},
propTypes: {
static propTypes = {
path: string,

@@ -48,3 +44,3 @@ ignoreScrollBehavior: bool,

getComponents: func
},
}

@@ -55,7 +51,7 @@ render() {

'<Route> elements are for router configuration only and should not be rendered'
);
)
}
});
}
export default Route;
export default Route

@@ -1,4 +0,4 @@

import React from 'react';
import React from 'react'
var { object } = React.PropTypes;
const { object } = React.PropTypes

@@ -11,3 +11,3 @@ /**

*/
var RouteContext = {
const RouteContext = {

@@ -25,7 +25,7 @@ propTypes: {

route: this.props.route
};
}
}
};
}
export default RouteContext;
export default RouteContext

@@ -1,10 +0,10 @@

import React from 'react';
import warning from 'warning';
import createHashHistory from 'history/lib/createHashHistory';
import { createRoutes } from './RouteUtils';
import RoutingContext from './RoutingContext';
import useRoutes from './useRoutes';
import { routes } from './PropTypes';
import React from 'react'
import warning from 'warning'
import createHashHistory from 'history/lib/createHashHistory'
import { createRoutes } from './RouteUtils'
import RoutingContext from './RoutingContext'
import useRoutes from './useRoutes'
import { routes } from './PropTypes'
const { func, object } = React.PropTypes;
const { func, object } = React.PropTypes

@@ -16,5 +16,5 @@ /**

*/
const Router = React.createClass({
class Router extends React.Component {
propTypes: {
static propTypes = {
history: object,

@@ -28,6 +28,8 @@ children: routes,

stringifyQuery: func
},
}
getInitialState() {
return {
constructor(props, context) {
super(props, context)
this.state = {
location: null,

@@ -37,17 +39,17 @@ routes: null,

components: null
};
},
}
}
handleError(error) {
if (this.props.onError) {
this.props.onError.call(this, error);
this.props.onError.call(this, error)
} else {
// Throw errors by default so we don't silently swallow them!
throw error; // This error probably occurred in getChildRoutes or getComponents.
throw error // This error probably occurred in getChildRoutes or getComponents.
}
},
}
componentWillMount() {
let { history, children, routes, parseQueryString, stringifyQuery } = this.props;
let createHistory = history ? () => history : createHashHistory;
let { history, children, routes, parseQueryString, stringifyQuery } = this.props
let createHistory = history ? () => history : createHashHistory

@@ -58,12 +60,12 @@ this.history = useRoutes(createHistory)({

stringifyQuery
});
})
this._unlisten = this.history.listen((error, state) => {
if (error) {
this.handleError(error);
this.handleError(error)
} else {
this.setState(state, this.props.onUpdate);
this.setState(state, this.props.onUpdate)
}
});
},
})
}

@@ -73,17 +75,17 @@ componentWillReceiveProps(nextProps) {

nextProps.history === this.props.history,
"The `history` provided to <Router/> has changed, it will be ignored."
);
},
'You cannot change <Router history>; it will be ignored'
)
}
componentWillUnmount() {
if (this._unlisten)
this._unlisten();
},
this._unlisten()
}
render() {
let { location, routes, params, components } = this.state;
let { createElement } = this.props;
let { location, routes, params, components } = this.state
let { createElement } = this.props
if (location == null)
return null; // Async match
return null // Async match

@@ -97,7 +99,7 @@ return React.createElement(RoutingContext, {

components
});
})
}
});
}
export default Router;
export default Router

@@ -1,21 +0,21 @@

import React from 'react';
import warning from 'warning';
import React from 'react'
import warning from 'warning'
function isValidChild(object) {
return object == null || React.isValidElement(object);
return object == null || React.isValidElement(object)
}
export function isReactChildren(object) {
return isValidChild(object) || (Array.isArray(object) && object.every(isValidChild));
return isValidChild(object) || (Array.isArray(object) && object.every(isValidChild))
}
function checkPropTypes(componentName, propTypes, props) {
componentName = componentName || 'UnknownComponent';
componentName = componentName || 'UnknownComponent'
for (var propName in propTypes) {
for (const propName in propTypes) {
if (propTypes.hasOwnProperty(propName)) {
var error = propTypes[propName](props, propName, componentName);
const error = propTypes[propName](props, propName, componentName)
if (error instanceof Error)
warning(false, error.message);
warning(false, error.message)
}

@@ -26,22 +26,22 @@ }

function createRoute(defaultProps, props) {
return { ...defaultProps, ...props };
return { ...defaultProps, ...props }
}
export function createRouteFromReactElement(element) {
var type = element.type;
var route = createRoute(type.defaultProps, element.props);
const type = element.type
const route = createRoute(type.defaultProps, element.props)
if (type.propTypes)
checkPropTypes(type.displayName || type.name, type.propTypes, route);
checkPropTypes(type.displayName || type.name, type.propTypes, route)
if (route.children) {
var childRoutes = createRoutesFromReactChildren(route.children, route);
const childRoutes = createRoutesFromReactChildren(route.children, route)
if (childRoutes.length)
route.childRoutes = childRoutes;
route.childRoutes = childRoutes
delete route.children;
delete route.children
}
return route;
return route
}

@@ -54,5 +54,5 @@

*
* import { Route, createRoutesFromReactChildren } from 'react-router';
* import { Route, createRoutesFromReactChildren } from 'react-router'
*
* var routes = createRoutesFromReactChildren(
* const routes = createRoutesFromReactChildren(
* <Route component={App}>

@@ -62,3 +62,3 @@ * <Route path="home" component={Dashboard}/>

* </Route>
* );
* )
*

@@ -69,3 +69,3 @@ * Note: This method is automatically used when you provide <Route> children

export function createRoutesFromReactChildren(children, parentRoute) {
var routes = [];
const routes = []

@@ -76,13 +76,13 @@ React.Children.forEach(children, function (element) {

if (element.type.createRouteFromReactElement) {
var route = element.type.createRouteFromReactElement(element, parentRoute);
const route = element.type.createRouteFromReactElement(element, parentRoute)
if (route)
routes.push(route);
routes.push(route)
} else {
routes.push(createRouteFromReactElement(element));
routes.push(createRouteFromReactElement(element))
}
}
});
})
return routes;
return routes
}

@@ -96,8 +96,8 @@

if (isReactChildren(routes)) {
routes = createRoutesFromReactChildren(routes);
} else if (!Array.isArray(routes)) {
routes = [ routes ];
routes = createRoutesFromReactChildren(routes)
} else if (routes && !Array.isArray(routes)) {
routes = [ routes ]
}
return routes;
return routes
}

@@ -1,6 +0,6 @@

import React from 'react';
import invariant from 'invariant';
import getRouteParams from './getRouteParams';
import React from 'react'
import invariant from 'invariant'
import getRouteParams from './getRouteParams'
var { array, func, object } = React.PropTypes;
const { array, func, object } = React.PropTypes

@@ -11,5 +11,5 @@ /**

*/
var RoutingContext = React.createClass({
class RoutingContext extends React.Component {
propTypes: {
static propTypes = {
history: object.isRequired,

@@ -21,14 +21,12 @@ createElement: func.isRequired,

components: array.isRequired
},
}
getDefaultProps() {
return {
createElement: React.createElement
};
},
static defaultProps = {
createElement: React.createElement
}
childContextTypes: {
static childContextTypes = {
history: object.isRequired,
location: object.isRequired
},
}

@@ -39,12 +37,12 @@ getChildContext() {

location: this.props.location
};
},
}
}
createElement(component, props) {
return component == null ? null : this.props.createElement(component, props);
},
return component == null ? null : this.props.createElement(component, props)
}
render() {
var { history, location, routes, params, components } = this.props;
var element = null;
const { history, location, routes, params, components } = this.props
let element = null

@@ -54,7 +52,7 @@ if (components) {

if (components == null)
return element; // Don't create new children; use the grandchildren.
return element // Don't create new children use the grandchildren.
var route = routes[index];
var routeParams = getRouteParams(route, params);
var props = {
const route = routes[index]
const routeParams = getRouteParams(route, params)
const props = {
history,

@@ -66,19 +64,19 @@ location,

routes
};
}
if (element)
props.children = element;
props.children = element
if (typeof components === 'object') {
var elements = {};
const elements = {}
for (var key in components)
for (const key in components)
if (components.hasOwnProperty(key))
elements[key] = this.createElement(components[key], props);
elements[key] = this.createElement(components[key], props)
return elements;
return elements
}
return this.createElement(components, props);
}, element);
return this.createElement(components, props)
}, element)
}

@@ -89,9 +87,9 @@

'The root route must render a single element'
);
)
return element;
return element
}
});
}
export default RoutingContext;
export default RoutingContext

@@ -1,6 +0,6 @@

import { loopAsync } from './AsyncUtils';
import { loopAsync } from './AsyncUtils'
function createEnterHook(hook, route) {
return function (a, b, callback) {
hook.apply(route, arguments);
hook.apply(route, arguments)

@@ -10,5 +10,5 @@ if (hook.length < 3) {

// automatically call the callback.
callback();
callback()
}
};
}
}

@@ -19,6 +19,6 @@

if (route.onEnter)
hooks.push(createEnterHook(route.onEnter, route));
hooks.push(createEnterHook(route.onEnter, route))
return hooks;
}, []);
return hooks
}, [])
}

@@ -37,12 +37,12 @@

export function runEnterHooks(routes, nextState, callback) {
var hooks = getEnterHooks(routes);
const hooks = getEnterHooks(routes)
if (!hooks.length) {
callback();
return;
callback()
return
}
var redirectInfo;
let redirectInfo
function replaceState(state, pathname, query) {
redirectInfo = { pathname, query, state };
redirectInfo = { pathname, query, state }
}

@@ -53,8 +53,8 @@

if (error || redirectInfo) {
done(error, redirectInfo); // No need to continue.
done(error, redirectInfo) // No need to continue.
} else {
next();
next()
}
});
}, callback);
})
}, callback)
}

@@ -66,5 +66,5 @@

export function runLeaveHooks(routes) {
for (var i = 0, len = routes.length; i < len; ++i)
for (let i = 0, len = routes.length; i < len; ++i)
if (routes[i].onLeave)
routes[i].onLeave.call(routes[i]);
routes[i].onLeave.call(routes[i])
}

@@ -1,17 +0,16 @@

import warning from 'warning';
import { REPLACE } from 'history/lib/Actions';
import useQueries from 'history/lib/useQueries';
import createLocation from 'history/lib/createLocation';
import computeChangedRoutes from './computeChangedRoutes';
import { runEnterHooks, runLeaveHooks } from './TransitionUtils';
import { default as _isActive } from './isActive';
import getComponents from './getComponents';
import matchRoutes from './matchRoutes';
import warning from 'warning'
import { REPLACE } from 'history/lib/Actions'
import useQueries from 'history/lib/useQueries'
import computeChangedRoutes from './computeChangedRoutes'
import { runEnterHooks, runLeaveHooks } from './TransitionUtils'
import { default as _isActive } from './isActive'
import getComponents from './getComponents'
import matchRoutes from './matchRoutes'
function hasAnyProperties(object) {
for (var p in object)
for (const p in object)
if (object.hasOwnProperty(p))
return true;
return true
return false;
return false
}

@@ -23,57 +22,54 @@

*
* - isActive(pathname, query)
* - registerRouteHook(route, (location) => {})
* - unregisterRouteHook(route, (location) => {})
* - match(location, (error, nextState, nextLocation) => {})
* Enhances history objects with the following methods:
*
* - listen((error, nextState) => {})
* - listenBeforeLeavingRoute(route, (nextLocation) => {})
* - match(location, (error, redirectLocation, nextState) => {})
* - isActive(pathname, query, indexOnly=false)
*/
function useRoutes(createHistory) {
return function (options={}) {
let { routes, ...historyOptions } = options;
let history = useQueries(createHistory)(historyOptions);
let state = {};
let { routes, ...historyOptions } = options
let history = useQueries(createHistory)(historyOptions)
let state = {}
function isActive(pathname, query, indexOnly=false) {
return _isActive(pathname, query, indexOnly, state.location, state.routes, state.params);
return _isActive(pathname, query, indexOnly, state.location, state.routes, state.params)
}
let partialNextState;
function createLocationFromRedirectInfo({ pathname, query, state }) {
return history.createLocation(
history.createPath(pathname, query), state, REPLACE
)
}
let partialNextState
function match(location, callback) {
if (partialNextState && partialNextState.location === location) {
// Continue from where we left off.
finishMatch(partialNextState, callback);
finishMatch(partialNextState, callback)
} else {
matchRoutes(routes, location, function (error, nextState) {
if (error) {
callback(error, null, null);
callback(error)
} else if (nextState) {
finishMatch({ ...nextState, location }, function (err, nextLocation, nextState) {
if (nextState)
state = nextState;
callback(err, nextLocation, nextState);
});
finishMatch({ ...nextState, location }, callback)
} else {
callback(null, null, null);
callback()
}
});
})
}
}
function createLocationFromRedirectInfo({ pathname, query, state }) {
return createLocation(
history.createPath(pathname, query), state, REPLACE, history.createKey()
);
}
function finishMatch(nextState, callback) {
let { leaveRoutes, enterRoutes } = computeChangedRoutes(state, nextState);
let { leaveRoutes, enterRoutes } = computeChangedRoutes(state, nextState)
runLeaveHooks(leaveRoutes);
runLeaveHooks(leaveRoutes)
runEnterHooks(enterRoutes, nextState, function (error, redirectInfo) {
if (error) {
callback(error);
callback(error)
} else if (redirectInfo) {
callback(null, createLocationFromRedirectInfo(redirectInfo), null);
callback(null, createLocationFromRedirectInfo(redirectInfo))
} else {

@@ -83,24 +79,26 @@ // TODO: Fetch components after state is updated.

if (error) {
callback(error);
callback(error)
} else {
callback(null, null, { ...nextState, components });
// TODO: Make match a pure function and have some other API
// for "match and update state".
callback(null, null, (state = { ...nextState, components }))
}
});
})
}
});
})
}
const RouteHooks = {};
let RouteGuid = 1
let RouteGuid = 1;
function getRouteID(route) {
return route.__id__ || (route.__id__ = RouteGuid++);
return route.__id__ || (route.__id__ = RouteGuid++)
}
const RouteHooks = {}
function getRouteHooksForRoutes(routes) {
return routes.reduce(function (hooks, route) {
hooks.push.apply(hooks, RouteHooks[getRouteID(route)]);
return hooks;
}, []);
hooks.push.apply(hooks, RouteHooks[getRouteID(route)])
return hooks
}, [])
}

@@ -114,4 +112,4 @@

// again in the listen callback.
callback();
return;
callback()
return
}

@@ -121,77 +119,98 @@

// matchRoutes() again in the listen callback.
partialNextState = { ...nextState, location };
partialNextState = { ...nextState, location }
let hooks = getRouteHooksForRoutes(
computeChangedRoutes(state, nextState).leaveRoutes
);
)
let result;
let result
for (let i = 0, len = hooks.length; result == null && i < len; ++i) {
// Passing the location arg here indicates to
// the user that this is a transition hook.
result = hooks[i](location);
result = hooks[i](location)
}
callback(result);
});
callback(result)
})
}
function beforeUnloadHook() {
// Synchronously check to see if any route hooks want to
// prevent the current window/tab from closing.
// Synchronously check to see if any route hooks want
// to prevent the current window/tab from closing.
if (state.routes) {
let hooks = getRouteHooksForRoutes(state.routes);
let hooks = getRouteHooksForRoutes(state.routes)
let message;
let message
for (let i = 0, len = hooks.length; typeof message !== 'string' && i < len; ++i) {
// Passing no args indicates to the user that this is a
// beforeunload hook. We don't know the next location.
message = hooks[i]();
message = hooks[i]()
}
return message;
return message
}
}
function registerRouteHook(route, hook) {
let unlistenBefore, unlistenBeforeUnload
/**
* Registers the given hook function to run before leaving the given route.
*
* During a normal transition, the hook function receives the next location
* as its only argument and must return either a) a prompt message to show
* the user, to make sure they want to leave the page or b) false, to prevent
* the transition.
*
* During the beforeunload event (in browsers) the hook receives no arguments.
* In this case it must return a prompt message to prevent the transition.
*
* Returns a function that may be used to unbind the listener.
*/
function listenBeforeLeavingRoute(route, hook) {
// TODO: Warn if they register for a route that isn't currently
// active. They're probably doing something wrong, like re-creating
// route objects on every location change.
let routeID = getRouteID(route);
let hooks = RouteHooks[routeID];
let routeID = getRouteID(route)
let hooks = RouteHooks[routeID]
if (hooks == null) {
let thereWereNoRouteHooks = !hasAnyProperties(RouteHooks);
let thereWereNoRouteHooks = !hasAnyProperties(RouteHooks)
hooks = RouteHooks[routeID] = [ hook ];
hooks = RouteHooks[routeID] = [ hook ]
if (thereWereNoRouteHooks) {
history.registerTransitionHook(transitionHook);
// setup transition & beforeunload hooks
unlistenBefore = history.listenBefore(transitionHook)
if (history.registerBeforeUnloadHook)
history.registerBeforeUnloadHook(beforeUnloadHook);
if (history.listenBeforeUnload)
unlistenBeforeUnload = history.listenBeforeUnload(beforeUnloadHook)
}
} else if (hooks.indexOf(hook) === -1) {
hooks.push(hook);
hooks.push(hook)
}
}
function unregisterRouteHook(route, hook) {
let routeID = getRouteID(route);
let hooks = RouteHooks[routeID];
return function () {
let hooks = RouteHooks[routeID]
if (hooks != null) {
let newHooks = hooks.filter(item => item !== hook);
if (hooks != null) {
let newHooks = hooks.filter(item => item !== hook)
if (newHooks.length === 0) {
delete RouteHooks[routeID];
if (newHooks.length === 0) {
delete RouteHooks[routeID]
if (!hasAnyProperties(RouteHooks)) {
history.unregisterTransitionHook(transitionHook);
if (!hasAnyProperties(RouteHooks)) {
// teardown transition & beforeunload hooks
if (unlistenBefore) {
unlistenBefore()
unlistenBefore = null
}
if (history.unregisterBeforeUnloadHook)
history.unregisterBeforeUnloadHook(beforeUnloadHook);
if (unlistenBeforeUnload) {
unlistenBeforeUnload()
unlistenBeforeUnload = null
}
}
} else {
RouteHooks[routeID] = newHooks
}
} else {
RouteHooks[routeID] = newHooks;
}

@@ -202,21 +221,20 @@ }

/**
* This is the API for stateful environments. As the location changes,
* we update state and call the listener. Benefits of this API are:
*
* - We automatically manage state on the client
* - We automatically handle redirects on the client
* - We warn when the location doesn't match any routes
* This is the API for stateful environments. As the location
* changes, we update state and call the listener. We can also
* gracefully handle errors and redirects.
*/
function listen(listener) {
// TODO: Only use a single history listener. Otherwise we'll
// end up with multiple concurrent calls to match.
return history.listen(function (location) {
if (state.location === location) {
listener(null, state);
listener(null, state)
} else {
match(location, function (error, nextLocation, nextState) {
match(location, function (error, redirectLocation, nextState) {
if (error) {
listener(error);
listener(error)
} else if (redirectLocation) {
history.transitionTo(redirectLocation)
} else if (nextState) {
listener(null, state); // match mutates state to nextState
} else if (nextLocation) {
history.transitionTo(nextLocation);
listener(null, nextState)
} else {

@@ -226,8 +244,8 @@ warning(

'Location "%s" did not match any routes',
location.pathname + location.search
);
location.pathname + location.search + location.hash
)
}
});
})
}
});
})
}

@@ -238,10 +256,9 @@

isActive,
registerRouteHook,
unregisterRouteHook,
listen,
match
};
};
match,
listenBeforeLeavingRoute,
listen
}
}
}
export default useRoutes;
export default useRoutes

@@ -6,3 +6,3 @@ ## Confirming Navigation

```js
history.registerTransitionHook(function (location) {
history.listenBefore(function (location) {
if (input.value !== '')

@@ -18,3 +18,3 @@ return 'Are you sure you want to leave this page?'

```js
history.registerTransitionHook(function (location, callback) {
history.listenBefore(function (location, callback) {
doSomethingAsync().then(callback)

@@ -30,3 +30,3 @@ })

let history = createHistory({
getUserConfirmation: function (message, callback) {
getUserConfirmation(message, callback) {
callback(window.confirm(message)) // The default behavior

@@ -46,3 +46,3 @@ }

history.registerBeforeUnloadHook(function () {
history.listenBeforeUnload(function () {
return 'Are you sure you want to leave this page?'

@@ -49,0 +49,0 @@ })

@@ -32,3 +32,2 @@ ## Getting Started

- `replaceState(state, path)`
- `setState(state)`
- `go(n)`

@@ -38,3 +37,3 @@ - `goBack()`

The [`path`](Terms.md#path) argument to `pushState` and `replaceState` represents a complete URL path, including the [query string](Terms.md#querystring). The [`state`](Terms.md#locationstate) argument should be a JSON-serializable object. In `setState`, the properties in `state` are shallowly merged into the current state.
The [`path`](Terms.md#path) argument to `pushState` and `replaceState` represents a complete URL path, including the [query string](Terms.md#querystring). The [`state`](Terms.md#locationstate) argument should be a JSON-serializable object.

@@ -69,10 +68,10 @@ ```js

```js
// Browser history
// HTML5 history
import createHistory from 'history/lib/createBrowserHistory'
// Hash history
import createHistory from 'history/lib/createHashHistory'
import createHashHistory from 'history/lib/createHashHistory'
// Memory history
import createHistory from 'history/lib/createMemoryHistory'
import createMemoryHistory from 'history/lib/createMemoryHistory'
```

@@ -17,8 +17,6 @@ ## Location

You may occasionally need to create a `location` object, either for testing or when using `history` in a stateless environment (like a server). `history` exposes the `createLocation` API for this purpose.
You may occasionally need to create a `location` object, either for testing or when using `history` in a stateless environment (like a server). `history` objects have a `createLocation` method for this purpose.
```js
import createLocation from 'history/lib/createLocation'
let location = createLocation('/a/path?a=query', { the: 'state' })
let location = history.createLocation('/a/path?a=query', { the: 'state' })
```
## Query Support
Support for parsing and serializing [URL queries](Terms.md#query) is provided by the `useQueries` [enhancer](Terms.md#createhistoryenhancer) function. Simply use a wrapped version of your `createHistory` function to create your `history` object and you'll have a parsed `location.query` object inside `listen`.
Support for parsing and serializing [URL queries](Terms.md#query) is provided by the `useQueries` [enhancer](Terms.md#createhistoryenhancer) function. Simply use a wrapped version of your `createHistory` function to create your `history` object and you'll have a parsed `location.query` object inside `listen` and `listenBefore` callbacks.

@@ -26,3 +26,3 @@ ```js

Query-used histories also accept URL queries as trailing arguments to `pushState`, `replaceState`, `createPath`, and `createHref`.
Query-enhanced histories also accept URL queries as trailing arguments to `pushState`, `replaceState`, `createPath`, and `createHref`.

@@ -29,0 +29,0 @@ ```js

@@ -7,3 +7,4 @@ ## Table of Contents

- [Query Support](QuerySupport.md)
- [Basename Support](BasenameSupport.md)
- [Caveats of Using Hash History](HashHistoryCaveats.md)
- [Glossary](Terms.md)

@@ -38,9 +38,7 @@ ## Glossary

type History = {
listenBefore: (hook: TransitionHook) => Function;
listen: (listener: LocationListener) => Function;
registerTransitionHook: (hook: TransitionHook) => void;
unregisterTransitionHook: (hook: TransitionHook) => void;
transitionTo(location: Location) => void;
pushState(state: LocationState, path: Path) => void;
replaceState(state: LocationState, path: Path) => void;
setState(state: LocationState) => void;
go(n: number) => void;

@@ -115,3 +113,3 @@ goBack() => void;

A *pathname* is the portion of a URL that describes a hierarchical path, including the preceeding `/`. For example, in `http://example.com/the/path?the=query`, `/the/path` is the pathname. It is synonymous with `window.location.pathname` in web browsers.
A *pathname* is the portion of a URL that describes a hierarchical path, including the preceding `/`. For example, in `http://example.com/the/path?the=query`, `/the/path` is the pathname. It is synonymous with `window.location.pathname` in web browsers.

@@ -122,3 +120,3 @@ ### QueryString

A *query string* is the portion of the URL that follows the [pathname](#pathname), including any preceeding `?`. For example, in `http://example.com/the/path?the=query`, `?the=query` is the query string. It is synonymous with `window.location.search` in web browsers.
A *query string* is the portion of the URL that follows the [pathname](#pathname), including any preceding `?`. For example, in `http://example.com/the/path?the=query`, `?the=query` is the query string. It is synonymous with `window.location.search` in web browsers.

@@ -125,0 +123,0 @@ ### Query

@@ -25,6 +25,2 @@ 'use strict';

var _createLocation = require('./createLocation');
var _createLocation2 = _interopRequireDefault(_createLocation);
/**

@@ -57,6 +53,7 @@ * Creates and returns a history object that uses HTML5's history API

key = history.createKey();
window.history.replaceState(_extends({}, historyState, { key: key }), null, path);
if (isSupported) window.history.replaceState(_extends({}, historyState, { key: key }), null, path);
}
return _createLocation2['default'](path, state, undefined, key);
return history.createLocation(path, state, undefined, key);
}

@@ -81,2 +78,3 @@

function finishTransition(location) {
var basename = location.basename;
var pathname = location.pathname;

@@ -92,3 +90,3 @@ var search = location.search;

var path = pathname + search;
var path = (basename || '') + pathname + search;
var historyState = {

@@ -95,0 +93,0 @@ key: key

@@ -29,6 +29,2 @@ 'use strict';

var _createLocation = require('./createLocation');
var _createLocation2 = _interopRequireDefault(_createLocation);
function isAbsolutePath(path) {

@@ -88,5 +84,7 @@ return typeof path === 'string' && path.charAt(0) === '/';

}
} else {
key = state = null;
}
return _createLocation2['default'](path, state, undefined, key);
return history.createLocation(path, state, undefined, key);
}

@@ -112,2 +110,3 @@

function finishTransition(location) {
var basename = location.basename;
var pathname = location.pathname;

@@ -121,3 +120,3 @@ var search = location.search;

var path = pathname + search;
var path = (basename || '') + pathname + search;

@@ -124,0 +123,0 @@ if (queryKey) path = addQueryStringValueToPath(path, queryKey, key);

@@ -13,6 +13,2 @@ 'use strict';

var _invariant = require('invariant');
var _invariant2 = _interopRequireDefault(_invariant);
var _deepEqual = require('deep-equal');

@@ -26,6 +22,10 @@

var _createLocation = require('./createLocation');
var _runTransitionHook = require('./runTransitionHook');
var _createLocation2 = _interopRequireDefault(_createLocation);
var _runTransitionHook2 = _interopRequireDefault(_runTransitionHook);
var _deprecate = require('./deprecate');
var _deprecate2 = _interopRequireDefault(_deprecate);
function createRandomKey(length) {

@@ -35,2 +35,12 @@ return Math.random().toString(36).substr(2, length);

function extractPath(string) {
var match = string.match(/^https?:\/\/[^\/]*/);
if (match == null) return string;
_warning2['default'](false, 'Location path must be pathname + query string only, not a fully qualified URL like "%s"', string);
return string.substring(match[0].length);
}
function locationsAreEqual(a, b) {

@@ -56,7 +66,17 @@ return a.pathname === b.pathname && a.search === b.search &&

var transitionHooks = [];
function listenBefore(hook) {
transitionHooks.push(hook);
return function () {
transitionHooks = transitionHooks.filter(function (item) {
return item !== hook;
});
};
}
var allKeys = [];
var changeListeners = [];
var location = undefined;
var allKeys = [];
function getCurrent() {

@@ -88,15 +108,5 @@ if (pendingLocation && pendingLocation.action === _Actions.POP) {

function addChangeListener(listener) {
function listen(listener) {
changeListeners.push(listener);
}
function removeChangeListener(listener) {
changeListeners = changeListeners.filter(function (item) {
return item !== listener;
});
}
function listen(listener) {
addChangeListener(listener);
if (location) {

@@ -111,31 +121,11 @@ listener(location);

return function () {
removeChangeListener(listener);
changeListeners = changeListeners.filter(function (item) {
return item !== listener;
});
};
}
function registerTransitionHook(hook) {
if (transitionHooks.indexOf(hook) === -1) transitionHooks.push(hook);
}
function unregisterTransitionHook(hook) {
transitionHooks = transitionHooks.filter(function (item) {
return item !== hook;
});
}
function runTransitionHook(hook, location, callback) {
var result = hook(location, callback);
if (hook.length < 2) {
// Assume the hook runs synchronously and automatically
// call the callback with the return value.
callback(result);
} else {
_warning2['default'](result === undefined, 'You should not "return" in a transition hook with a callback argument call the callback instead');
}
}
function confirmTransitionTo(location, callback) {
_AsyncUtils.loopAsync(transitionHooks.length, function (index, next, done) {
runTransitionHook(transitionHooks[index], location, function (result) {
_runTransitionHook2['default'](transitionHooks[index], location, function (result) {
if (result != null) {

@@ -163,8 +153,6 @@ done(result);

_invariant2['default'](pendingLocation == null, 'transitionTo: Another transition is already in progress');
pendingLocation = nextLocation;
confirmTransitionTo(nextLocation, function (ok) {
pendingLocation = null;
if (pendingLocation !== nextLocation) return; // Transition was interrupted.

@@ -184,23 +172,9 @@ if (ok) {

function pushState(state, path) {
transitionTo(_createLocation2['default'](path, state, _Actions.PUSH, createKey()));
transitionTo(createLocation(path, state, _Actions.PUSH, createKey()));
}
function replaceState(state, path) {
transitionTo(_createLocation2['default'](path, state, _Actions.REPLACE, createKey()));
transitionTo(createLocation(path, state, _Actions.REPLACE, createKey()));
}
function setState(state) {
if (location) {
updateLocationState(location, state);
updateLocation(location);
} else {
updateLocationState(getCurrentLocation(), state);
}
}
function updateLocationState(location, state) {
location.state = _extends({}, location.state, state);
saveState(location.key, location.state);
}
function goBack() {

@@ -223,13 +197,72 @@ go(-1);

function createHref(path) {
return createPath(path);
return path;
}
function createLocation() {
var path = arguments.length <= 0 || arguments[0] === undefined ? '/' : arguments[0];
var state = arguments.length <= 1 || arguments[1] === undefined ? null : arguments[1];
var action = arguments.length <= 2 || arguments[2] === undefined ? _Actions.POP : arguments[2];
var key = arguments.length <= 3 || arguments[3] === undefined ? createKey() : arguments[3];
var pathname = extractPath(path);
var search = '';
var hash = '';
var hashIndex = pathname.indexOf('#');
if (hashIndex !== -1) {
hash = pathname.substring(hashIndex);
pathname = pathname.substring(0, hashIndex);
}
var searchIndex = pathname.indexOf('?');
if (searchIndex !== -1) {
search = pathname.substring(searchIndex);
pathname = pathname.substring(0, searchIndex);
}
if (pathname === '') pathname = '/';
return {
pathname: pathname,
search: search,
hash: hash,
state: state,
action: action,
key: key
};
}
// deprecated
function setState(state) {
if (location) {
updateLocationState(location, state);
updateLocation(location);
} else {
updateLocationState(getCurrentLocation(), state);
}
}
function updateLocationState(location, state) {
location.state = _extends({}, location.state, state);
saveState(location.key, location.state);
}
// deprecated
function registerTransitionHook(hook) {
if (transitionHooks.indexOf(hook) === -1) transitionHooks.push(hook);
}
// deprecated
function unregisterTransitionHook(hook) {
transitionHooks = transitionHooks.filter(function (item) {
return item !== hook;
});
}
return {
listenBefore: listenBefore,
listen: listen,
registerTransitionHook: registerTransitionHook,
unregisterTransitionHook: unregisterTransitionHook,
transitionTo: transitionTo,
pushState: pushState,
replaceState: replaceState,
setState: setState,
go: go,

@@ -240,3 +273,8 @@ goBack: goBack,

createPath: createPath,
createHref: createHref
createHref: createHref,
createLocation: createLocation,
setState: _deprecate2['default'](setState, 'setState is deprecated; use location.key to save state instead'),
registerTransitionHook: _deprecate2['default'](registerTransitionHook, 'registerTransitionHook is deprecated; use listenBefore instead'),
unregisterTransitionHook: _deprecate2['default'](unregisterTransitionHook, 'unregisterTransitionHook is deprecated; use the callback returned from listenBefore instead')
};

@@ -243,0 +281,0 @@ }

@@ -11,2 +11,6 @@ 'use strict';

var _deprecate = require('./deprecate');
var _deprecate2 = _interopRequireDefault(_deprecate);
var _Actions = require('./Actions');

@@ -60,3 +64,3 @@

exports['default'] = createLocation;
exports['default'] = _deprecate2['default'](createLocation, 'createLocation is deprecated; use history.createLocation instead');
module.exports = exports['default'];

@@ -15,6 +15,2 @@ 'use strict';

var _createLocation = require('./createLocation');
var _createLocation2 = _interopRequireDefault(_createLocation);
var _createHistory = require('./createHistory');

@@ -24,3 +20,3 @@

function createStorage(entries) {
function createStateStorage(entries) {
return entries.filter(function (entry) {

@@ -76,3 +72,3 @@ return entry.state;

var storage = createStorage(entries);
var storage = createStateStorage(entries);

@@ -90,6 +86,7 @@ function saveState(key, state) {

var key = entry.key;
var basename = entry.basename;
var pathname = entry.pathname;
var search = entry.search;
var path = pathname + (search || '');
var path = (basename || '') + pathname + (search || '');

@@ -105,3 +102,3 @@ var state = undefined;

return _createLocation2['default'](path, state, undefined, key);
return history.createLocation(path, state, undefined, key);
}

@@ -134,5 +131,3 @@

// remove rest and push new
if (current < entries.length) {
entries.splice(current);
}
if (current < entries.length) entries.splice(current);

@@ -139,0 +134,0 @@ entries.push(location);

@@ -0,1 +1,2 @@

/*eslint-disable no-empty */
'use strict';

@@ -2,0 +3,0 @@

@@ -41,3 +41,3 @@ 'use strict';

function getWindowPath() {
return window.location.pathname + window.location.search;
return window.location.pathname + window.location.search + window.location.hash;
}

@@ -44,0 +44,0 @@

@@ -7,5 +7,5 @@ 'use strict';

var _warning = require('warning');
var _deprecate = require('./deprecate');
var _warning2 = _interopRequireDefault(_warning);
var _deprecate2 = _interopRequireDefault(_deprecate);

@@ -16,9 +16,3 @@ var _useBeforeUnload = require('./useBeforeUnload');

function enableBeforeUnload() {
_warning2['default'](false, 'enableBeforeUnload is deprecated, use useBeforeUnload instead');
return _useBeforeUnload2['default'].apply(this, arguments);
}
exports['default'] = enableBeforeUnload;
exports['default'] = _deprecate2['default'](_useBeforeUnload2['default'], 'enableBeforeUnload is deprecated, use useBeforeUnload instead');
module.exports = exports['default'];

@@ -7,5 +7,5 @@ 'use strict';

var _warning = require('warning');
var _deprecate = require('./deprecate');
var _warning2 = _interopRequireDefault(_warning);
var _deprecate2 = _interopRequireDefault(_deprecate);

@@ -16,9 +16,3 @@ var _useQueries = require('./useQueries');

function enableQueries() {
_warning2['default'](false, 'enableQueries is deprecated, use useQueries instead');
return _useQueries2['default'].apply(this, arguments);
}
exports['default'] = enableQueries;
exports['default'] = _deprecate2['default'](_useQueries2['default'], 'enableQueries is deprecated, use useQueries instead');
module.exports = exports['default'];

@@ -25,7 +25,7 @@ 'use strict';

var _createLocation2 = require('./createLocation');
var _useBasename2 = require('./useBasename');
var _createLocation3 = _interopRequireDefault(_createLocation2);
var _useBasename3 = _interopRequireDefault(_useBasename2);
exports.createLocation = _createLocation3['default'];
exports.useBasename = _useBasename3['default'];

@@ -52,2 +52,8 @@ var _useBeforeUnload2 = require('./useBeforeUnload');

var _createLocation2 = require('./createLocation');
var _createLocation3 = _interopRequireDefault(_createLocation2);
exports.createLocation = _createLocation3['default'];
var _enableBeforeUnload2 = require('./enableBeforeUnload');

@@ -54,0 +60,0 @@

@@ -7,2 +7,8 @@ 'use strict';

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
var _warning = require('warning');
var _warning2 = _interopRequireDefault(_warning);
var _ExecutionEnvironment = require('./ExecutionEnvironment');

@@ -12,2 +18,6 @@

var _deprecate = require('./deprecate');
var _deprecate2 = _interopRequireDefault(_deprecate);
function startBeforeUnloadListener(getBeforeUnloadPromptMessage) {

@@ -50,2 +60,26 @@ function listener(event) {

function listenBeforeUnload(hook) {
beforeUnloadHooks.push(hook);
if (beforeUnloadHooks.length === 1) {
if (_ExecutionEnvironment.canUseDOM) {
stopBeforeUnloadListener = startBeforeUnloadListener(getBeforeUnloadPromptMessage);
} else {
_warning2['default'](false, 'listenBeforeUnload only works in DOM environments');
}
}
return function () {
beforeUnloadHooks = beforeUnloadHooks.filter(function (item) {
return item !== hook;
});
if (beforeUnloadHooks.length === 0 && stopBeforeUnloadListener) {
stopBeforeUnloadListener();
stopBeforeUnloadListener = null;
}
};
}
// deprecated
function registerBeforeUnloadHook(hook) {

@@ -59,2 +93,3 @@ if (_ExecutionEnvironment.canUseDOM && beforeUnloadHooks.indexOf(hook) === -1) {

// deprecated
function unregisterBeforeUnloadHook(hook) {

@@ -71,4 +106,6 @@ if (beforeUnloadHooks.length > 0) {

return _extends({}, history, {
registerBeforeUnloadHook: registerBeforeUnloadHook,
unregisterBeforeUnloadHook: unregisterBeforeUnloadHook
listenBeforeUnload: listenBeforeUnload,
registerBeforeUnloadHook: _deprecate2['default'](registerBeforeUnloadHook, 'registerBeforeUnloadHook is deprecated; use listenBeforeUnload instead'),
unregisterBeforeUnloadHook: _deprecate2['default'](unregisterBeforeUnloadHook, 'unregisterBeforeUnloadHook is deprecated; use the callback returned from listenBeforeUnload instead')
});

@@ -75,0 +112,0 @@ };

@@ -15,2 +15,6 @@ 'use strict';

var _runTransitionHook = require('./runTransitionHook');
var _runTransitionHook2 = _interopRequireDefault(_runTransitionHook);
function defaultStringifyQuery(query) {

@@ -42,30 +46,51 @@ return _qs2['default'].stringify(query, { arrayFormat: 'brackets' });

function addQuery(location) {
if (location.query == null) location.query = parseQueryString(location.search.substring(1));
return location;
}
function appendQuery(pathname, query) {
var queryString = undefined;
if (query && (queryString = stringifyQuery(query)) !== '') return pathname + (pathname.indexOf('?') === -1 ? '?' : '&') + queryString;
return pathname;
}
// Override all read methods with query-aware versions.
function listenBefore(hook) {
return history.listenBefore(function (location, callback) {
_runTransitionHook2['default'](hook, addQuery(location), callback);
});
}
function listen(listener) {
return history.listen(function (location) {
if (!location.query) location.query = parseQueryString(location.search.substring(1));
listener(location);
listener(addQuery(location));
});
}
// Override all write methods with query-aware versions.
function pushState(state, pathname, query) {
return history.pushState(state, createPath(pathname, query));
return history.pushState(state, appendQuery(pathname, query));
}
function replaceState(state, pathname, query) {
return history.replaceState(state, createPath(pathname, query));
return history.replaceState(state, appendQuery(pathname, query));
}
function createPath(pathname, query) {
var queryString = undefined;
if (query == null || (queryString = stringifyQuery(query)) === '') return pathname;
return history.createPath(pathname + (pathname.indexOf('?') === -1 ? '?' : '&') + queryString);
return history.createPath(appendQuery(pathname, query));
}
function createHref(pathname, query) {
return history.createHref(createPath(pathname, query));
return history.createHref(appendQuery(pathname, query));
}
function createLocation() {
return addQuery(history.createLocation.apply(history, arguments));
}
return _extends({}, history, {
listenBefore: listenBefore,
listen: listen,

@@ -75,3 +100,4 @@ pushState: pushState,

createPath: createPath,
createHref: createHref
createHref: createHref,
createLocation: createLocation
});

@@ -78,0 +104,0 @@ };

{
"name": "history",
"version": "1.9.0",
"version": "1.12.1",
"description": "A minimal, functional history implementation for JavaScript",

@@ -8,3 +8,3 @@ "main": "lib/index",

"type": "git",
"url": "https://github.com/rackt/history.git"
"url": "git+https://github.com/rackt/history.git"
},

@@ -15,7 +15,9 @@ "bugs": {

"scripts": {
"build": "babel ./modules -d lib --ignore '__tests__'",
"build": "babel ./modules --stage 0 --loose all -d lib --ignore '__tests__'",
"build-umd": "NODE_ENV=production webpack modules/index.js umd/History.js",
"build-min": "NODE_ENV=production webpack -p modules/index.js umd/History.min.js",
"start": "webpack-dev-server -d --content-base ./ --history-api-fallback --inline modules/index.js",
"test": "eslint modules && karma start",
"test": "npm run lint && karma start",
"lint": "eslint modules",
"postinstall": "node -e \"require('fs').stat('lib', function (e, s) { process.exit(e || !s.isDirectory() ? 1 : 0) })\" || npm run build",
"prepublish": "npm run build"

@@ -34,2 +36,3 @@ },

"devDependencies": {
"assert": "1.3.0",
"babel": "^5.4.7",

@@ -39,4 +42,5 @@ "babel-core": "^5.4.7",

"babel-loader": "^5.0.0",
"eslint": "^1.0.0",
"expect": "^1.8.0",
"eslint": "1.4.1",
"eslint-plugin-react": "3.3.2",
"expect": "^1.12.0",
"karma": "^0.13.3",

@@ -63,13 +67,17 @@ "karma-browserstack-launcher": "^0.1.3",

],
"gitHead": "e9b16da106f1567f81c4f17a709ac287d1396735",
"homepage": "https://github.com/rackt/history",
"_id": "history@1.9.0",
"_shasum": "0527bc87de22e9f11ccf33e8bb8b1a9a89b2d6d7",
"_from": "history@>=1.9.0 <2.0.0",
"_npmVersion": "2.5.1",
"_nodeVersion": "0.12.0",
"gitHead": "0f65e2a1099afb6eec87ebce67971b570fdf4ee5",
"homepage": "https://github.com/rackt/history#readme",
"_id": "history@1.12.1",
"_shasum": "727a69008841e6bb1fe92b22ce7c69974a0c2f38",
"_from": "history@1.12.1",
"_npmVersion": "2.11.3",
"_nodeVersion": "0.12.7",
"_npmUser": {
"name": "ryanflorence",
"email": "rpflorence@gmail.com"
"name": "mjackson",
"email": "mjijackson@gmail.com"
},
"dist": {
"shasum": "727a69008841e6bb1fe92b22ce7c69974a0c2f38",
"tarball": "http://registry.npmjs.org/history/-/history-1.12.1.tgz"
},
"maintainers": [

@@ -85,8 +93,4 @@ {

],
"dist": {
"shasum": "0527bc87de22e9f11ccf33e8bb8b1a9a89b2d6d7",
"tarball": "http://registry.npmjs.org/history/-/history-1.9.0.tgz"
},
"directories": {},
"_resolved": "https://registry.npmjs.org/history/-/history-1.9.0.tgz"
"_resolved": "https://registry.npmjs.org/history/-/history-1.12.1.tgz"
}

@@ -0,1 +1,3 @@

# history
[![build status](https://img.shields.io/travis/rackt/history/master.svg?style=flat-square)](https://travis-ci.org/rackt/history)

@@ -5,12 +7,22 @@ [![npm package](https://img.shields.io/npm/v/history.svg?style=flat-square)](https://www.npmjs.org/package/history)

## history
[`history`](https://www.npmjs.com/package/history) is a JavaScript library that lets you easily manage session history in browsers, testing environments, and (soon, via [React Native](https://facebook.github.io/react-native/)) native devices. `history` abstracts away the differences in these different platforms and provides a minimal API that lets you manage the history stack, navigate, confirm navigation, and persist state between sessions. `history` is library-agnostic and may easily be included in any JavaScript project.
### Installation
## Installation
Using [npm](https://www.npmjs.org/):
$ npm install history
### Basic Usage
Then with a module bundler like [webpack](https://webpack.github.io/), use as you would anything else:
```js
// using an ES6 transpiler, like babel
import { createHistory } from 'history'
// not using an ES6 transpiler
var createHistory = require('history').createHistory
```
## Basic Usage
A "history" encapsulates navigation between different screens in your app, and notifies listeners when the current screen changes.

@@ -25,3 +37,3 @@

// listener is called once immediately.
let unlisten = history.listen(function (location) {
let unlisten = history.listen(location => {
console.log(location.pathname)

@@ -36,5 +48,5 @@ })

Read more about getting started [in the documentation](http://rackt.github.io/history/stable/GettingStarted.html)!
You can find many more examples [in the documentation](https://github.com/rackt/history/tree/master/docs)!
### Thanks
## Thanks

@@ -41,0 +53,0 @@ A big thank-you to [Dan Shaw](https://www.npmjs.com/~dshaw) for letting us use the `history` npm package name! Thanks Dan!

@@ -1,1 +0,1 @@

!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.History=t():e.History=t()}(this,function(){return function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={exports:{},id:r,loaded:!1};return e[r].call(o.exports,o,o.exports,t),o.loaded=!0,o.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}t.__esModule=!0;var o=n(14),a=r(o);t.createHistory=a["default"];var i=n(15),u=r(i);t.createHashHistory=u["default"];var s=n(16),c=r(s);t.createMemoryHistory=c["default"];var f=n(2),l=r(f);t.createLocation=l["default"];var d=n(10),p=r(d);t.useBeforeUnload=p["default"];var y=n(11),h=r(y);t.useQueries=h["default"];var g=n(1),v=r(g);t.Actions=v["default"];var m=n(17),b=r(m);t.enableBeforeUnload=b["default"];var O=n(18),w=r(O);t.enableQueries=w["default"]},function(e,t){"use strict";t.__esModule=!0;var n="PUSH";t.PUSH=n;var r="REPLACE";t.REPLACE=r;var o="POP";t.POP=o,t["default"]={PUSH:n,REPLACE:r,POP:o}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e){var t=e.match(/https?:\/\/[^\/]*/);return null==t?e:(u["default"](!1,'Location path must be pathname + query string only, not a fully qualified URL like "%s"',e),e.substring(t[0].length))}function a(){var e=arguments.length<=0||void 0===arguments[0]?"/":arguments[0],t=arguments.length<=1||void 0===arguments[1]?null:arguments[1],n=arguments.length<=2||void 0===arguments[2]?s.POP:arguments[2],r=arguments.length<=3||void 0===arguments[3]?null:arguments[3];e=o(e);var a=e,i="",u="",c=a.indexOf("#");-1!==c&&(u=a.substring(c),a=a.substring(0,c));var f=a.indexOf("?");return-1!==f&&(i=a.substring(f),a=a.substring(0,f)),""===a&&(a="/"),{pathname:a,search:i,hash:u,state:t,action:n,key:r}}t.__esModule=!0;var i=n(4),u=r(i),s=n(1);t["default"]=a,e.exports=t["default"]},function(e,t,n){"use strict";var r=function(e,t,n,r,o,a,i,u){if(!e){var s;if(void 0===t)s=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var c=[n,r,o,a,i,u],f=0;s=new Error("Invariant Violation: "+t.replace(/%s/g,function(){return c[f++]}))}throw s.framesToPop=1,s}};e.exports=r},function(e,t,n){"use strict";var r=function(){};e.exports=r},function(e,t){"use strict";function n(e,t,n){e.addEventListener?e.addEventListener(t,n,!1):e.attachEvent("on"+t,n)}function r(e,t,n){e.removeEventListener?e.removeEventListener(t,n,!1):e.detachEvent("on"+t,n)}function o(){return window.location.href.split("#")[1]||""}function a(e){window.location.replace(window.location.pathname+window.location.search+"#"+e)}function i(){return window.location.pathname+window.location.search}function u(e){e&&window.history.go(e)}function s(e,t){t(window.confirm(e))}function c(){var e=navigator.userAgent;return-1===e.indexOf("Android 2.")&&-1===e.indexOf("Android 4.0")||-1===e.indexOf("Mobile Safari")||-1!==e.indexOf("Chrome")||-1!==e.indexOf("Windows Phone")?window.history&&"pushState"in window.history:!1}function f(){var e=navigator.userAgent;return-1===e.indexOf("Firefox")}t.__esModule=!0,t.addEventListener=n,t.removeEventListener=r,t.getHashPath=o,t.replaceHashPath=a,t.getWindowPath=i,t.go=u,t.getUserConfirmation=s,t.supportsHistory=c,t.supportsGoWithoutReloadUsingHash=f},function(e,t){"use strict";t.__esModule=!0;var n=!("undefined"==typeof window||!window.document||!window.document.createElement);t.canUseDOM=n},function(e,t){"use strict";function n(e){return a+e}function r(e,t){window.sessionStorage.setItem(n(e),JSON.stringify(t))}function o(e){var t=window.sessionStorage.getItem(n(e));if(t)try{return JSON.parse(t)}catch(r){}return null}t.__esModule=!0,t.saveState=r,t.readState=o;var a="@@History/"},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e){function t(e){return u["default"](s.canUseDOM,"DOM history needs a DOM"),n.listen(e)}var n=l["default"](a({getUserConfirmation:c.getUserConfirmation},e,{go:c.go}));return a({},n,{listen:t})}t.__esModule=!0;var a=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},i=n(3),u=r(i),s=n(6),c=n(5),f=n(9),l=r(f);t["default"]=o,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e){return Math.random().toString(36).substr(2,e)}function a(e,t){return e.pathname===t.pathname&&e.search===t.search&&e.key===t.key&&p["default"](e.state,t.state)}function i(){function e(){return B&&B.action===h.POP?N.indexOf(B.key):R?N.indexOf(R.key):-1}function t(t){var n=e();R=t,R.action===h.PUSH?N=[].concat(N.slice(0,n+1),[R.key]):R.action===h.REPLACE&&(N[n]=R.key),D.forEach(function(e){e(R)})}function n(e){D.push(e)}function r(e){D=D.filter(function(t){return t!==e})}function i(e){if(n(e),R)e(R);else{var o=A();N=[o.key],t(o)}return function(){r(e)}}function s(e){-1===C.indexOf(e)&&C.push(e)}function f(e){C=C.filter(function(t){return t!==e})}function d(e,t,n){var r=e(t,n);e.length<2?n(r):c["default"](void 0===r,'You should not "return" in a transition hook with a callback argument call the callback instead')}function p(e,t){y.loopAsync(C.length,function(t,n,r){d(C[t],e,function(e){null!=e?r(e):n()})},function(e){T&&"string"==typeof e?T(e,function(e){t(e!==!1)}):t(e!==!1)})}function g(e){R&&a(R,e)||(l["default"](null==B,"transitionTo: Another transition is already in progress"),B=e,p(e,function(n){if(B=null,n)L(e),t(e);else if(R&&e.action===h.POP){var r=N.indexOf(R.key),o=N.indexOf(e.key);-1!==r&&-1!==o&&E(r-o)}}))}function b(e,t){g(v["default"](t,e,h.PUSH,_()))}function O(e,t){g(v["default"](t,e,h.REPLACE,_()))}function w(e){R?(x(R,e),t(R)):x(A(),e)}function x(e,t){e.state=u({},e.state,t),M(e.key,e.state)}function j(){E(-1)}function P(){E(1)}function _(){return o(U)}function S(e){return e}function H(e){return S(e)}var k=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],A=k.getCurrentLocation,L=k.finishTransition,M=k.saveState,E=k.go,U=k.keyLength,T=k.getUserConfirmation;"number"!=typeof U&&(U=m);var C=[],D=[],R=void 0,N=[],B=void 0;return{listen:i,registerTransitionHook:s,unregisterTransitionHook:f,transitionTo:g,pushState:b,replaceState:O,setState:w,go:E,goBack:j,goForward:P,createKey:_,createPath:S,createHref:H}}t.__esModule=!0;var u=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},s=n(4),c=r(s),f=n(3),l=r(f),d=n(19),p=r(d),y=n(13),h=n(1),g=n(2),v=r(g),m=6;t["default"]=i,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){function t(t){var n=e();return"string"==typeof n?((t||window.event).returnValue=n,n):void 0}return u.addEventListener(window,"beforeunload",t),function(){u.removeEventListener(window,"beforeunload",t)}}function o(e){return function(t){function n(){for(var e=void 0,t=0,n=f.length;null==e&&n>t;++t)e=f[t].call();return e}function o(e){i.canUseDOM&&-1===f.indexOf(e)&&(f.push(e),1===f.length&&(c=r(n)))}function u(e){f.length>0&&(f=f.filter(function(t){return t!==e}),0===f.length&&c())}var s=e(t),c=void 0,f=[];return a({},s,{registerBeforeUnloadHook:o,unregisterBeforeUnloadHook:u})}}t.__esModule=!0;var a=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},i=n(6),u=n(5);t["default"]=o,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}function a(e){return f["default"].stringify(e,{arrayFormat:"brackets"})}function i(e){return f["default"].parse(e)}function u(e){return function(){function t(e){return y.listen(function(t){t.query||(t.query=d(t.search.substring(1))),e(t)})}function n(e,t,n){return y.pushState(e,u(t,n))}function r(e,t,n){return y.replaceState(e,u(t,n))}function u(e,t){var n=void 0;return null==t||""===(n=l(t))?e:y.createPath(e+(-1===e.indexOf("?")?"?":"&")+n)}function c(e,t){return y.createHref(u(e,t))}var f=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],l=f.stringifyQuery,d=f.parseQueryString,p=o(f,["stringifyQuery","parseQueryString"]),y=e(p);return"function"!=typeof l&&(l=a),"function"!=typeof d&&(d=i),s({},y,{listen:t,pushState:n,replaceState:r,createPath:u,createHref:c})}}t.__esModule=!0;var s=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},c=n(22),f=r(c);t["default"]=u,e.exports=t["default"]},function(e,t){var n={};n.hexTable=new Array(256);for(var r=0;256>r;++r)n.hexTable[r]="%"+((16>r?"0":"")+r.toString(16)).toUpperCase();t.arrayToObject=function(e,t){for(var n=t.plainObjects?Object.create(null):{},r=0,o=e.length;o>r;++r)"undefined"!=typeof e[r]&&(n[r]=e[r]);return n},t.merge=function(e,n,r){if(!n)return e;if("object"!=typeof n)return Array.isArray(e)?e.push(n):"object"==typeof e?e[n]=!0:e=[e,n],e;if("object"!=typeof e)return e=[e].concat(n);Array.isArray(e)&&!Array.isArray(n)&&(e=t.arrayToObject(e,r));for(var o=Object.keys(n),a=0,i=o.length;i>a;++a){var u=o[a],s=n[u];Object.prototype.hasOwnProperty.call(e,u)?e[u]=t.merge(e[u],s,r):e[u]=s}return e},t.decode=function(e){try{return decodeURIComponent(e.replace(/\+/g," "))}catch(t){return e}},t.encode=function(e){if(0===e.length)return e;"string"!=typeof e&&(e=""+e);for(var t="",r=0,o=e.length;o>r;++r){var a=e.charCodeAt(r);45===a||46===a||95===a||126===a||a>=48&&57>=a||a>=65&&90>=a||a>=97&&122>=a?t+=e[r]:128>a?t+=n.hexTable[a]:2048>a?t+=n.hexTable[192|a>>6]+n.hexTable[128|63&a]:55296>a||a>=57344?t+=n.hexTable[224|a>>12]+n.hexTable[128|a>>6&63]+n.hexTable[128|63&a]:(++r,a=65536+((1023&a)<<10|1023&e.charCodeAt(r)),t+=n.hexTable[240|a>>18]+n.hexTable[128|a>>12&63]+n.hexTable[128|a>>6&63]+n.hexTable[128|63&a])}return t},t.compact=function(e,n){if("object"!=typeof e||null===e)return e;n=n||[];var r=n.indexOf(e);if(-1!==r)return n[r];if(n.push(e),Array.isArray(e)){for(var o=[],a=0,i=e.length;i>a;++a)"undefined"!=typeof e[a]&&o.push(e[a]);return o}var u=Object.keys(e);for(a=0,i=u.length;i>a;++a){var s=u[a];e[s]=t.compact(e[s],n)}return e},t.isRegExp=function(e){return"[object RegExp]"===Object.prototype.toString.call(e)},t.isBuffer=function(e){return null===e||"undefined"==typeof e?!1:!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))}},function(e,t){"use strict";function n(e,t,n){function r(){i=!0,n.apply(this,arguments)}function o(){i||(e>a?t.call(this,a++,o,r):r.apply(this,arguments))}var a=0,i=!1;o()}t.__esModule=!0,t.loopAsync=n},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e){function t(e){e=e||window.history.state||{};var t=f.getWindowPath(),n=e,r=n.key,o=void 0;return r?o=l.readState(r):(o=null,r=d.createKey(),window.history.replaceState(a({},e,{key:r}),null,t)),h["default"](t,o,void 0,r)}function n(e){function n(e){void 0!==e.state&&r(t(e.state))}var r=e.transitionTo;return f.addEventListener(window,"popstate",n),function(){f.removeEventListener(window,"popstate",n)}}function r(e){var t=e.pathname,n=e.search,r=e.state,o=e.action,a=e.key;if(o!==s.POP){l.saveState(a,r);var u=t+n,c={key:a};o===s.PUSH?i?window.history.pushState(c,null,u):window.location.href=u:i?window.history.replaceState(c,null,u):window.location.replace(u)}}function o(e){1===++y&&(g=n(d));var t=d.listen(e);return function(){t(),0===--y&&g()}}u["default"](c.canUseDOM,"Browser history needs a DOM");var i=f.supportsHistory(),d=p["default"](a({},e,{getCurrentLocation:t,finishTransition:r,saveState:l.saveState})),y=0,g=void 0;return a({},d,{listen:o})}t.__esModule=!0;var a=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},i=n(3),u=r(i),s=n(1),c=n(6),f=n(5),l=n(7),d=n(8),p=r(d),y=n(2),h=r(y);t["default"]=o,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e){return"string"==typeof e&&"/"===e.charAt(0)}function a(){var e=v.getHashPath();return o(e)?!0:(v.replaceHashPath("/"+e),!1)}function i(e,t,n){return e+(-1===e.indexOf("?")?"?":"&")+(t+"="+n)}function u(e,t){return e.replace(new RegExp("[?&]?"+t+"=[a-zA-Z0-9]+"),"")}function s(e,t){var n=e.match(new RegExp("\\?.*?\\b"+t+"=(.+?)\\b"));return n&&n[1]}function c(){function e(){var e=v.getHashPath(),t=void 0,n=void 0;return w&&(t=s(e,w),e=u(e,w),t?n=m.readState(t):(n=null,t=P.createKey(),v.replaceHashPath(i(e,w,t)))),x["default"](e,n,void 0,t)}function t(t){function n(){a()&&r(e())}var r=t.transitionTo;return a(),v.addEventListener(window,"hashchange",n),function(){v.removeEventListener(window,"hashchange",n)}}function n(e){var t=e.pathname,n=e.search,r=e.state,o=e.action,a=e.key;if(o!==h.POP){var u=t+n;w&&(u=i(u,w,a)),u===v.getHashPath()?d["default"](!1,"You cannot %s the same path using hash history",o):(w?m.saveState(a,r):e.key=e.state=null,o===h.PUSH?window.location.hash=u:v.replaceHashPath(u))}}function r(e){1===++_&&(S=t(P));var n=P.listen(e);return function(){n(),0===--_&&S()}}function o(e,t){d["default"](w||null==e,"You cannot use state without a queryKey it will be dropped"),P.pushState(e,t)}function c(e,t){d["default"](w||null==e,"You cannot use state without a queryKey it will be dropped"),P.replaceState(e,t)}function l(e){d["default"](H,"Hash history go(n) causes a full page reload in this browser"),P.go(e)}function p(e){return"#"+P.createHref(e)}var b=arguments.length<=0||void 0===arguments[0]?{}:arguments[0];y["default"](g.canUseDOM,"Hash history needs a DOM");var w=b.queryKey;(void 0===w||w)&&(w="string"==typeof w?w:j);var P=O["default"](f({},b,{getCurrentLocation:e,finishTransition:n,saveState:m.saveState})),_=0,S=void 0,H=v.supportsGoWithoutReloadUsingHash();return f({},P,{listen:r,pushState:o,replaceState:c,go:l,createHref:p})}t.__esModule=!0;var f=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},l=n(4),d=r(l),p=n(3),y=r(p),h=n(1),g=n(6),v=n(5),m=n(7),b=n(8),O=r(b),w=n(2),x=r(w),j="_k";t["default"]=c,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e){return e.filter(function(e){return e.state}).reduce(function(e,t){return e[t.key]=t.state,e},{})}function a(){function e(e,t){v[e]=t}function t(e){return v[e]}function n(){var e=h[g],n=e.key,r=e.pathname,o=e.search,a=r+(o||""),i=void 0;return n?i=t(n):(i=null,n=d.createKey(),e.key=n),l["default"](a,i,void 0,n)}function r(e){var t=g+e;return t>=0&&t<h.length}function a(e){if(e){s["default"](r(e),"Cannot go(%s) there is not enough history",e),g+=e;var t=n();d.transitionTo(i({},t,{action:c.POP}))}}function u(t){switch(t.action){case c.PUSH:g+=1,g<h.length&&h.splice(g),h.push(t),e(t.key,t.state);break;case c.REPLACE:h[g]=t,e(t.key,t.state)}}var f=arguments.length<=0||void 0===arguments[0]?{}:arguments[0];Array.isArray(f)?f={entries:f}:"string"==typeof f&&(f={entries:[f]});var d=p["default"](i({},f,{getCurrentLocation:n,finishTransition:u,saveState:e,go:a})),y=f,h=y.entries,g=y.current;"string"==typeof h?h=[h]:Array.isArray(h)||(h=["/"]),h=h.map(function(e){var t=d.createKey();return"string"==typeof e?{pathname:e,key:t}:"object"==typeof e&&e?i({},e,{key:t}):void s["default"](!1,"Unable to create history entry from %s",e)}),null==g?g=h.length-1:s["default"](g>=0&&g<h.length,"Current index must be >= 0 and < %s, was %s",h.length,g);var v=o(h);return d}t.__esModule=!0;var i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},u=n(3),s=r(u),c=n(1),f=n(2),l=r(f),d=n(9),p=r(d);t["default"]=a,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(){return i["default"](!1,"enableBeforeUnload is deprecated, use useBeforeUnload instead"),s["default"].apply(this,arguments)}t.__esModule=!0;var a=n(4),i=r(a),u=n(10),s=r(u);t["default"]=o,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(){return i["default"](!1,"enableQueries is deprecated, use useQueries instead"),s["default"].apply(this,arguments)}t.__esModule=!0;var a=n(4),i=r(a),u=n(11),s=r(u);t["default"]=o,e.exports=t["default"]},function(e,t,n){function r(e){return null===e||void 0===e}function o(e){return e&&"object"==typeof e&&"number"==typeof e.length?"function"!=typeof e.copy||"function"!=typeof e.slice?!1:e.length>0&&"number"!=typeof e[0]?!1:!0:!1}function a(e,t,n){var a,f;if(r(e)||r(t))return!1;if(e.prototype!==t.prototype)return!1;if(s(e))return s(t)?(e=i.call(e),t=i.call(t),c(e,t,n)):!1;if(o(e)){if(!o(t))return!1;if(e.length!==t.length)return!1;for(a=0;a<e.length;a++)if(e[a]!==t[a])return!1;return!0}try{var l=u(e),d=u(t)}catch(p){return!1}if(l.length!=d.length)return!1;for(l.sort(),d.sort(),a=l.length-1;a>=0;a--)if(l[a]!=d[a])return!1;for(a=l.length-1;a>=0;a--)if(f=l[a],!c(e[f],t[f],n))return!1;return typeof e==typeof t}var i=Array.prototype.slice,u=n(21),s=n(20),c=e.exports=function(e,t,n){return n||(n={}),e===t?!0:e instanceof Date&&t instanceof Date?e.getTime()===t.getTime():!e||!t||"object"!=typeof e&&"object"!=typeof t?n.strict?e===t:e==t:a(e,t,n)}},function(e,t){function n(e){return"[object Arguments]"==Object.prototype.toString.call(e)}function r(e){return e&&"object"==typeof e&&"number"==typeof e.length&&Object.prototype.hasOwnProperty.call(e,"callee")&&!Object.prototype.propertyIsEnumerable.call(e,"callee")||!1}var o="[object Arguments]"==function(){return Object.prototype.toString.call(arguments)}();t=e.exports=o?n:r,t.supported=n,t.unsupported=r},function(e,t){function n(e){var t=[];for(var n in e)t.push(n);return t}t=e.exports="function"==typeof Object.keys?Object.keys:n,t.shim=n},function(e,t,n){var r=n(24),o=n(23);e.exports={stringify:r,parse:o}},function(e,t,n){var r=n(12),o={delimiter:"&",depth:5,arrayLimit:20,parameterLimit:1e3,strictNullHandling:!1,plainObjects:!1,allowPrototypes:!1};o.parseValues=function(e,t){for(var n={},o=e.split(t.delimiter,t.parameterLimit===1/0?void 0:t.parameterLimit),a=0,i=o.length;i>a;++a){var u=o[a],s=-1===u.indexOf("]=")?u.indexOf("="):u.indexOf("]=")+1;if(-1===s)n[r.decode(u)]="",t.strictNullHandling&&(n[r.decode(u)]=null);else{var c=r.decode(u.slice(0,s)),f=r.decode(u.slice(s+1));Object.prototype.hasOwnProperty.call(n,c)?n[c]=[].concat(n[c]).concat(f):n[c]=f}}return n},o.parseObject=function(e,t,n){if(!e.length)return t;var r,a=e.shift();if("[]"===a)r=[],r=r.concat(o.parseObject(e,t,n));else{r=n.plainObjects?Object.create(null):{};var i="["===a[0]&&"]"===a[a.length-1]?a.slice(1,a.length-1):a,u=parseInt(i,10),s=""+u;!isNaN(u)&&a!==i&&s===i&&u>=0&&n.parseArrays&&u<=n.arrayLimit?(r=[],r[u]=o.parseObject(e,t,n)):r[i]=o.parseObject(e,t,n)}return r},o.parseKeys=function(e,t,n){if(e){n.allowDots&&(e=e.replace(/\.([^\.\[]+)/g,"[$1]"));var r=/^([^\[\]]*)/,a=/(\[[^\[\]]*\])/g,i=r.exec(e),u=[];if(i[1]){if(!n.plainObjects&&Object.prototype.hasOwnProperty(i[1])&&!n.allowPrototypes)return;u.push(i[1])}for(var s=0;null!==(i=a.exec(e))&&s<n.depth;)++s,(n.plainObjects||!Object.prototype.hasOwnProperty(i[1].replace(/\[|\]/g,""))||n.allowPrototypes)&&u.push(i[1]);return i&&u.push("["+e.slice(i.index)+"]"),o.parseObject(u,t,n)}},e.exports=function(e,t){if(t=t||{},t.delimiter="string"==typeof t.delimiter||r.isRegExp(t.delimiter)?t.delimiter:o.delimiter,t.depth="number"==typeof t.depth?t.depth:o.depth,t.arrayLimit="number"==typeof t.arrayLimit?t.arrayLimit:o.arrayLimit,t.parseArrays=t.parseArrays!==!1,t.allowDots=t.allowDots!==!1,t.plainObjects="boolean"==typeof t.plainObjects?t.plainObjects:o.plainObjects,t.allowPrototypes="boolean"==typeof t.allowPrototypes?t.allowPrototypes:o.allowPrototypes,t.parameterLimit="number"==typeof t.parameterLimit?t.parameterLimit:o.parameterLimit,t.strictNullHandling="boolean"==typeof t.strictNullHandling?t.strictNullHandling:o.strictNullHandling,""===e||null===e||"undefined"==typeof e)return t.plainObjects?Object.create(null):{};for(var n="string"==typeof e?o.parseValues(e,t):e,a=t.plainObjects?Object.create(null):{},i=Object.keys(n),u=0,s=i.length;s>u;++u){var c=i[u],f=o.parseKeys(c,n[c],t);a=r.merge(a,f,t)}return r.compact(a)}},function(e,t,n){var r=n(12),o={delimiter:"&",arrayPrefixGenerators:{brackets:function(e,t){return e+"[]"},indices:function(e,t){return e+"["+t+"]"},repeat:function(e,t){return e}},strictNullHandling:!1};o.stringify=function(e,t,n,a,i){if("function"==typeof i)e=i(t,e);else if(r.isBuffer(e))e=e.toString();else if(e instanceof Date)e=e.toISOString();else if(null===e){if(a)return r.encode(t);e=""}if("string"==typeof e||"number"==typeof e||"boolean"==typeof e)return[r.encode(t)+"="+r.encode(e)];var u=[];if("undefined"==typeof e)return u;for(var s=Array.isArray(i)?i:Object.keys(e),c=0,f=s.length;f>c;++c){var l=s[c];u=Array.isArray(e)?u.concat(o.stringify(e[l],n(t,l),n,a,i)):u.concat(o.stringify(e[l],t+"["+l+"]",n,a,i))}return u},e.exports=function(e,t){t=t||{};var n,r,a="undefined"==typeof t.delimiter?o.delimiter:t.delimiter,i="boolean"==typeof t.strictNullHandling?t.strictNullHandling:o.strictNullHandling;"function"==typeof t.filter?(r=t.filter,e=r("",e)):Array.isArray(t.filter)&&(n=r=t.filter);var u=[];if("object"!=typeof e||null===e)return"";var s;s=t.arrayFormat in o.arrayPrefixGenerators?t.arrayFormat:"indices"in t?t.indices?"indices":"repeat":"indices";var c=o.arrayPrefixGenerators[s];n||(n=Object.keys(e));for(var f=0,l=n.length;l>f;++f){var d=n[f];u=u.concat(o.stringify(e[d],d,c,i,r))}return u.join(a)}}])});
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.History=t():e.History=t()}(this,function(){return function(e){function t(r){if(n[r])return n[r].exports;var a=n[r]={exports:{},id:r,loaded:!1};return e[r].call(a.exports,a,a.exports,t),a.loaded=!0,a.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}t.__esModule=!0;var a=n(15),o=r(a);t.createHistory=o["default"];var i=n(16),u=r(i);t.createHashHistory=u["default"];var s=n(18),c=r(s);t.createMemoryHistory=c["default"];var f=n(21),l=r(f);t.useBasename=l["default"];var d=n(11),p=r(d);t.useBeforeUnload=p["default"];var h=n(12),g=r(h);t.useQueries=g["default"];var y=n(1),v=r(y);t.Actions=v["default"];var m=n(17),b=r(m);t.createLocation=b["default"];var O=n(19),w=r(O);t.enableBeforeUnload=w["default"];var x=n(20),P=r(x);t.enableQueries=P["default"]},function(e,t){"use strict";t.__esModule=!0;var n="PUSH";t.PUSH=n;var r="REPLACE";t.REPLACE=r;var a="POP";t.POP=a,t["default"]={PUSH:n,REPLACE:r,POP:a}},function(e,t,n){"use strict";var r=function(){};e.exports=r},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function a(e,t){return function(){return i["default"](!1,t),e.apply(this,arguments)}}t.__esModule=!0;var o=n(2),i=r(o);t["default"]=a,e.exports=t["default"]},function(e,t){"use strict";function n(e,t,n){e.addEventListener?e.addEventListener(t,n,!1):e.attachEvent("on"+t,n)}function r(e,t,n){e.removeEventListener?e.removeEventListener(t,n,!1):e.detachEvent("on"+t,n)}function a(){return window.location.href.split("#")[1]||""}function o(e){window.location.replace(window.location.pathname+window.location.search+"#"+e)}function i(){return window.location.pathname+window.location.search+window.location.hash}function u(e){e&&window.history.go(e)}function s(e,t){t(window.confirm(e))}function c(){var e=navigator.userAgent;return-1===e.indexOf("Android 2.")&&-1===e.indexOf("Android 4.0")||-1===e.indexOf("Mobile Safari")||-1!==e.indexOf("Chrome")||-1!==e.indexOf("Windows Phone")?window.history&&"pushState"in window.history:!1}function f(){var e=navigator.userAgent;return-1===e.indexOf("Firefox")}t.__esModule=!0,t.addEventListener=n,t.removeEventListener=r,t.getHashPath=a,t.replaceHashPath=o,t.getWindowPath=i,t.go=u,t.getUserConfirmation=s,t.supportsHistory=c,t.supportsGoWithoutReloadUsingHash=f},function(e,t){"use strict";t.__esModule=!0;var n=!("undefined"==typeof window||!window.document||!window.document.createElement);t.canUseDOM=n},function(e,t,n){"use strict";var r=function(e,t,n,r,a,o,i,u){if(!e){var s;if(void 0===t)s=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var c=[n,r,a,o,i,u],f=0;s=new Error("Invariant Violation: "+t.replace(/%s/g,function(){return c[f++]}))}throw s.framesToPop=1,s}};e.exports=r},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function a(e,t,n){var r=e(t,n);e.length<2?n(r):i["default"](void 0===r,'You should not "return" in a transition hook with a callback argument; call the callback instead')}t.__esModule=!0;var o=n(2),i=r(o);t["default"]=a,e.exports=t["default"]},function(e,t){"use strict";function n(e){return o+e}function r(e,t){window.sessionStorage.setItem(n(e),JSON.stringify(t))}function a(e){var t=window.sessionStorage.getItem(n(e));if(t)try{return JSON.parse(t)}catch(r){}return null}t.__esModule=!0,t.saveState=r,t.readState=a;var o="@@History/"},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function a(e){function t(e){return u["default"](s.canUseDOM,"DOM history needs a DOM"),n.listen(e)}var n=l["default"](o({getUserConfirmation:c.getUserConfirmation},e,{go:c.go}));return o({},n,{listen:t})}t.__esModule=!0;var o=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},i=n(6),u=r(i),s=n(5),c=n(4),f=n(10),l=r(f);t["default"]=a,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function a(e){return Math.random().toString(36).substr(2,e)}function o(e){var t=e.match(/^https?:\/\/[^\/]*/);return null==t?e:(f["default"](!1,'Location path must be pathname + query string only, not a fully qualified URL like "%s"',e),e.substring(t[0].length))}function i(e,t){return e.pathname===t.pathname&&e.search===t.search&&e.key===t.key&&d["default"](e.state,t.state)}function u(){function e(e){return T.push(e),function(){T=T.filter(function(t){return t!==e})}}function t(){return R&&R.action===h.POP?B.indexOf(R.key):D?B.indexOf(D.key):-1}function n(e){var n=t();D=e,D.action===h.PUSH?B=[].concat(B.slice(0,n+1),[D.key]):D.action===h.REPLACE&&(B[n]=D.key),C.forEach(function(e){e(D)})}function r(e){if(C.push(e),D)e(D);else{var t=H();B=[t.key],n(t)}return function(){C=C.filter(function(t){return t!==e})}}function u(e,t){p.loopAsync(T.length,function(t,n,r){y["default"](T[t],e,function(e){null!=e?r(e):n()})},function(e){E&&"string"==typeof e?E(e,function(e){t(e!==!1)}):t(e!==!1)})}function c(e){D&&i(D,e)||(R=e,u(e,function(t){if(R===e)if(t)L(e),n(e);else if(D&&e.action===h.POP){var r=B.indexOf(D.key),a=B.indexOf(e.key);-1!==r&&-1!==a&&A(r-a)}}))}function f(e,t){c(x(t,e,h.PUSH,v()))}function l(e,t){c(x(t,e,h.REPLACE,v()))}function d(){A(-1)}function g(){A(1)}function v(){return a(U)}function O(e){return e}function w(e){return e}function x(){var e=arguments.length<=0||void 0===arguments[0]?"/":arguments[0],t=arguments.length<=1||void 0===arguments[1]?null:arguments[1],n=arguments.length<=2||void 0===arguments[2]?h.POP:arguments[2],r=arguments.length<=3||void 0===arguments[3]?v():arguments[3],a=o(e),i="",u="",s=a.indexOf("#");-1!==s&&(u=a.substring(s),a=a.substring(0,s));var c=a.indexOf("?");return-1!==c&&(i=a.substring(c),a=a.substring(0,c)),""===a&&(a="/"),{pathname:a,search:i,hash:u,state:t,action:n,key:r}}function P(e){D?(j(D,e),n(D)):j(H(),e)}function j(e,t){e.state=s({},e.state,t),M(e.key,e.state)}function _(e){-1===T.indexOf(e)&&T.push(e)}function k(e){T=T.filter(function(t){return t!==e})}var S=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],H=S.getCurrentLocation,L=S.finishTransition,M=S.saveState,A=S.go,U=S.keyLength,E=S.getUserConfirmation;"number"!=typeof U&&(U=b);var T=[],B=[],C=[],D=void 0,R=void 0;return{listenBefore:e,listen:r,transitionTo:c,pushState:f,replaceState:l,go:A,goBack:d,goForward:g,createKey:v,createPath:O,createHref:w,createLocation:x,setState:m["default"](P,"setState is deprecated; use location.key to save state instead"),registerTransitionHook:m["default"](_,"registerTransitionHook is deprecated; use listenBefore instead"),unregisterTransitionHook:m["default"](k,"unregisterTransitionHook is deprecated; use the callback returned from listenBefore instead")}}t.__esModule=!0;var s=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},c=n(2),f=r(c),l=n(22),d=r(l),p=n(14),h=n(1),g=n(7),y=r(g),v=n(3),m=r(v),b=6;t["default"]=u,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function a(e){function t(t){var n=e();return"string"==typeof n?((t||window.event).returnValue=n,n):void 0}return f.addEventListener(window,"beforeunload",t),function(){f.removeEventListener(window,"beforeunload",t)}}function o(e){return function(t){function n(){for(var e=void 0,t=0,n=p.length;null==e&&n>t;++t)e=p[t].call();return e}function r(e){return p.push(e),1===p.length&&(c.canUseDOM?l=a(n):s["default"](!1,"listenBeforeUnload only works in DOM environments")),function(){p=p.filter(function(t){return t!==e}),0===p.length&&l&&(l(),l=null)}}function o(e){c.canUseDOM&&-1===p.indexOf(e)&&(p.push(e),1===p.length&&(l=a(n)))}function u(e){p.length>0&&(p=p.filter(function(t){return t!==e}),0===p.length&&l())}var f=e(t),l=void 0,p=[];return i({},f,{listenBeforeUnload:r,registerBeforeUnloadHook:d["default"](o,"registerBeforeUnloadHook is deprecated; use listenBeforeUnload instead"),unregisterBeforeUnloadHook:d["default"](u,"unregisterBeforeUnloadHook is deprecated; use the callback returned from listenBeforeUnload instead")})}}t.__esModule=!0;var i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},u=n(2),s=r(u),c=n(5),f=n(4),l=n(3),d=r(l);t["default"]=o,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function a(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}function o(e){return f["default"].stringify(e,{arrayFormat:"brackets"})}function i(e){return f["default"].parse(e)}function u(e){return function(){function t(e){return null==e.query&&(e.query=v(e.search.substring(1))),e}function n(e,t){var n=void 0;return t&&""!==(n=y(t))?e+(-1===e.indexOf("?")?"?":"&")+n:e}function r(e){return b.listenBefore(function(n,r){d["default"](e,t(n),r)})}function u(e){return b.listen(function(n){e(t(n))})}function c(e,t,r){return b.pushState(e,n(t,r))}function f(e,t,r){return b.replaceState(e,n(t,r))}function l(e,t){return b.createPath(n(e,t))}function p(e,t){return b.createHref(n(e,t))}function h(){return t(b.createLocation.apply(b,arguments))}var g=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],y=g.stringifyQuery,v=g.parseQueryString,m=a(g,["stringifyQuery","parseQueryString"]),b=e(m);return"function"!=typeof y&&(y=o),"function"!=typeof v&&(v=i),s({},b,{listenBefore:r,listen:u,pushState:c,replaceState:f,createPath:l,createHref:p,createLocation:h})}}t.__esModule=!0;var s=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},c=n(25),f=r(c),l=n(7),d=r(l);t["default"]=u,e.exports=t["default"]},function(e,t){var n={};n.hexTable=new Array(256);for(var r=0;256>r;++r)n.hexTable[r]="%"+((16>r?"0":"")+r.toString(16)).toUpperCase();t.arrayToObject=function(e,t){for(var n=t.plainObjects?Object.create(null):{},r=0,a=e.length;a>r;++r)"undefined"!=typeof e[r]&&(n[r]=e[r]);return n},t.merge=function(e,n,r){if(!n)return e;if("object"!=typeof n)return Array.isArray(e)?e.push(n):"object"==typeof e?e[n]=!0:e=[e,n],e;if("object"!=typeof e)return e=[e].concat(n);Array.isArray(e)&&!Array.isArray(n)&&(e=t.arrayToObject(e,r));for(var a=Object.keys(n),o=0,i=a.length;i>o;++o){var u=a[o],s=n[u];Object.prototype.hasOwnProperty.call(e,u)?e[u]=t.merge(e[u],s,r):e[u]=s}return e},t.decode=function(e){try{return decodeURIComponent(e.replace(/\+/g," "))}catch(t){return e}},t.encode=function(e){if(0===e.length)return e;"string"!=typeof e&&(e=""+e);for(var t="",r=0,a=e.length;a>r;++r){var o=e.charCodeAt(r);45===o||46===o||95===o||126===o||o>=48&&57>=o||o>=65&&90>=o||o>=97&&122>=o?t+=e[r]:128>o?t+=n.hexTable[o]:2048>o?t+=n.hexTable[192|o>>6]+n.hexTable[128|63&o]:55296>o||o>=57344?t+=n.hexTable[224|o>>12]+n.hexTable[128|o>>6&63]+n.hexTable[128|63&o]:(++r,o=65536+((1023&o)<<10|1023&e.charCodeAt(r)),t+=n.hexTable[240|o>>18]+n.hexTable[128|o>>12&63]+n.hexTable[128|o>>6&63]+n.hexTable[128|63&o])}return t},t.compact=function(e,n){if("object"!=typeof e||null===e)return e;n=n||[];var r=n.indexOf(e);if(-1!==r)return n[r];if(n.push(e),Array.isArray(e)){for(var a=[],o=0,i=e.length;i>o;++o)"undefined"!=typeof e[o]&&a.push(e[o]);return a}var u=Object.keys(e);for(o=0,i=u.length;i>o;++o){var s=u[o];e[s]=t.compact(e[s],n)}return e},t.isRegExp=function(e){return"[object RegExp]"===Object.prototype.toString.call(e)},t.isBuffer=function(e){return null===e||"undefined"==typeof e?!1:!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))}},function(e,t){"use strict";function n(e,t,n){function r(){i=!0,n.apply(this,arguments)}function a(){i||(e>o?t.call(this,o++,a,r):r.apply(this,arguments))}var o=0,i=!1;a()}t.__esModule=!0,t.loopAsync=n},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function a(e){function t(e){e=e||window.history.state||{};var t=f.getWindowPath(),n=e,r=n.key,a=void 0;return r?a=l.readState(r):(a=null,r=d.createKey(),i&&window.history.replaceState(o({},e,{key:r}),null,t)),d.createLocation(t,a,void 0,r)}function n(e){function n(e){void 0!==e.state&&r(t(e.state))}var r=e.transitionTo;return f.addEventListener(window,"popstate",n),function(){f.removeEventListener(window,"popstate",n)}}function r(e){var t=e.basename,n=e.pathname,r=e.search,a=e.state,o=e.action,u=e.key;if(o!==s.POP){l.saveState(u,a);var c=(t||"")+n+r,f={key:u};o===s.PUSH?i?window.history.pushState(f,null,c):window.location.href=c:i?window.history.replaceState(f,null,c):window.location.replace(c)}}function a(e){1===++h&&(g=n(d));var t=d.listen(e);return function(){t(),0===--h&&g()}}u["default"](c.canUseDOM,"Browser history needs a DOM");var i=f.supportsHistory(),d=p["default"](o({},e,{getCurrentLocation:t,finishTransition:r,saveState:l.saveState})),h=0,g=void 0;return o({},d,{listen:a})}t.__esModule=!0;var o=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},i=n(6),u=r(i),s=n(1),c=n(5),f=n(4),l=n(8),d=n(9),p=r(d);t["default"]=a,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function a(e){return"string"==typeof e&&"/"===e.charAt(0)}function o(){var e=v.getHashPath();return a(e)?!0:(v.replaceHashPath("/"+e),!1)}function i(e,t,n){return e+(-1===e.indexOf("?")?"?":"&")+(t+"="+n)}function u(e,t){return e.replace(new RegExp("[?&]?"+t+"=[a-zA-Z0-9]+"),"")}function s(e,t){var n=e.match(new RegExp("\\?.*?\\b"+t+"=(.+?)\\b"));return n&&n[1]}function c(){function e(){var e=v.getHashPath(),t=void 0,n=void 0;return x?(t=s(e,x),e=u(e,x),t?n=m.readState(t):(n=null,t=P.createKey(),v.replaceHashPath(i(e,x,t)))):t=n=null,P.createLocation(e,n,void 0,t)}function t(t){function n(){o()&&r(e())}var r=t.transitionTo;return o(),v.addEventListener(window,"hashchange",n),function(){v.removeEventListener(window,"hashchange",n)}}function n(e){var t=e.basename,n=e.pathname,r=e.search,a=e.state,o=e.action,u=e.key;if(o!==g.POP){var s=(t||"")+n+r;x&&(s=i(s,x,u)),s===v.getHashPath()?d["default"](!1,"You cannot %s the same path using hash history",o):(x?m.saveState(u,a):e.key=e.state=null,o===g.PUSH?window.location.hash=s:v.replaceHashPath(s))}}function r(e){1===++j&&(_=t(P));var n=P.listen(e);return function(){n(),0===--j&&_()}}function a(e,t){d["default"](x||null==e,"You cannot use state without a queryKey it will be dropped"),P.pushState(e,t)}function c(e,t){d["default"](x||null==e,"You cannot use state without a queryKey it will be dropped"),P.replaceState(e,t)}function l(e){d["default"](k,"Hash history go(n) causes a full page reload in this browser"),P.go(e)}function p(e){return"#"+P.createHref(e)}var b=arguments.length<=0||void 0===arguments[0]?{}:arguments[0];h["default"](y.canUseDOM,"Hash history needs a DOM");var x=b.queryKey;(void 0===x||x)&&(x="string"==typeof x?x:w);var P=O["default"](f({},b,{getCurrentLocation:e,finishTransition:n,saveState:m.saveState})),j=0,_=void 0,k=v.supportsGoWithoutReloadUsingHash();return f({},P,{listen:r,pushState:a,replaceState:c,go:l,createHref:p})}t.__esModule=!0;var f=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},l=n(2),d=r(l),p=n(6),h=r(p),g=n(1),y=n(5),v=n(4),m=n(8),b=n(9),O=r(b),w="_k";t["default"]=c,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function a(e){var t=e.match(/https?:\/\/[^\/]*/);return null==t?e:(u["default"](!1,'Location path must be pathname + query string only, not a fully qualified URL like "%s"',e),e.substring(t[0].length))}function o(){var e=arguments.length<=0||void 0===arguments[0]?"/":arguments[0],t=arguments.length<=1||void 0===arguments[1]?null:arguments[1],n=arguments.length<=2||void 0===arguments[2]?f.POP:arguments[2],r=arguments.length<=3||void 0===arguments[3]?null:arguments[3];e=a(e);var o=e,i="",u="",s=o.indexOf("#");-1!==s&&(u=o.substring(s),o=o.substring(0,s));var c=o.indexOf("?");return-1!==c&&(i=o.substring(c),o=o.substring(0,c)),""===o&&(o="/"),{pathname:o,search:i,hash:u,state:t,action:n,key:r}}t.__esModule=!0;var i=n(2),u=r(i),s=n(3),c=r(s),f=n(1);t["default"]=c["default"](o,"createLocation is deprecated; use history.createLocation instead"),e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function a(e){return e.filter(function(e){return e.state}).reduce(function(e,t){return e[t.key]=t.state,e},{})}function o(){function e(e,t){y[e]=t}function t(e){return y[e]}function n(){var e=h[g],n=e.key,r=e.basename,a=e.pathname,o=e.search,i=(r||"")+a+(o||""),u=void 0;return n?u=t(n):(u=null,n=d.createKey(),e.key=n),d.createLocation(i,u,void 0,n)}function r(e){var t=g+e;return t>=0&&t<h.length}function o(e){if(e){s["default"](r(e),"Cannot go(%s) there is not enough history",e),g+=e;var t=n();d.transitionTo(i({},t,{action:c.POP}))}}function u(t){switch(t.action){case c.PUSH:g+=1,g<h.length&&h.splice(g),h.push(t),e(t.key,t.state);break;case c.REPLACE:h[g]=t,e(t.key,t.state)}}var f=arguments.length<=0||void 0===arguments[0]?{}:arguments[0];Array.isArray(f)?f={entries:f}:"string"==typeof f&&(f={entries:[f]});var d=l["default"](i({},f,{getCurrentLocation:n,finishTransition:u,saveState:e,go:o})),p=f,h=p.entries,g=p.current;"string"==typeof h?h=[h]:Array.isArray(h)||(h=["/"]),h=h.map(function(e){var t=d.createKey();return"string"==typeof e?{pathname:e,key:t}:"object"==typeof e&&e?i({},e,{key:t}):void s["default"](!1,"Unable to create history entry from %s",e)}),null==g?g=h.length-1:s["default"](g>=0&&g<h.length,"Current index must be >= 0 and < %s, was %s",h.length,g);var y=a(h);return d}t.__esModule=!0;var i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},u=n(6),s=r(u),c=n(1),f=n(10),l=r(f);t["default"]=o,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}t.__esModule=!0;var a=n(3),o=r(a),i=n(11),u=r(i);t["default"]=o["default"](u["default"],"enableBeforeUnload is deprecated, use useBeforeUnload instead"),e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}t.__esModule=!0;var a=n(3),o=r(a),i=n(12),u=r(i);t["default"]=o["default"](u["default"],"enableQueries is deprecated, use useQueries instead"),e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function a(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}function o(e){return function(){function t(e){return h&&null==e.basename&&(0===e.pathname.indexOf(h)?(e.pathname=e.pathname.substring(h.length),e.basename=h,""===e.pathname&&(e.pathname="/")):e.basename=""),e}function n(e){return h?h+e:e}function r(e){return y.listenBefore(function(n,r){s["default"](e,t(n),r)})}function o(e){return y.listen(function(n){e(t(n))})}function u(e,t){y.pushState(e,n(t))}function c(e,t){y.replaceState(e,n(t))}function f(e){return y.createPath(n(e))}function l(e){return y.createHref(n(e))}function d(){return t(y.createLocation.apply(y,arguments))}var p=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],h=p.basename,g=a(p,["basename"]),y=e(g);return i({},y,{listenBefore:r,listen:o,pushState:u,replaceState:c,createPath:f,createHref:l,createLocation:d})}}t.__esModule=!0;var i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},u=n(7),s=r(u);t["default"]=o,e.exports=t["default"]},function(e,t,n){function r(e){return null===e||void 0===e}function a(e){return e&&"object"==typeof e&&"number"==typeof e.length?"function"!=typeof e.copy||"function"!=typeof e.slice?!1:e.length>0&&"number"!=typeof e[0]?!1:!0:!1}function o(e,t,n){var o,f;if(r(e)||r(t))return!1;if(e.prototype!==t.prototype)return!1;if(s(e))return s(t)?(e=i.call(e),t=i.call(t),c(e,t,n)):!1;if(a(e)){if(!a(t))return!1;if(e.length!==t.length)return!1;for(o=0;o<e.length;o++)if(e[o]!==t[o])return!1;return!0}try{var l=u(e),d=u(t)}catch(p){return!1}if(l.length!=d.length)return!1;for(l.sort(),d.sort(),o=l.length-1;o>=0;o--)if(l[o]!=d[o])return!1;for(o=l.length-1;o>=0;o--)if(f=l[o],!c(e[f],t[f],n))return!1;return typeof e==typeof t}var i=Array.prototype.slice,u=n(24),s=n(23),c=e.exports=function(e,t,n){return n||(n={}),e===t?!0:e instanceof Date&&t instanceof Date?e.getTime()===t.getTime():!e||!t||"object"!=typeof e&&"object"!=typeof t?n.strict?e===t:e==t:o(e,t,n)}},function(e,t){function n(e){return"[object Arguments]"==Object.prototype.toString.call(e)}function r(e){return e&&"object"==typeof e&&"number"==typeof e.length&&Object.prototype.hasOwnProperty.call(e,"callee")&&!Object.prototype.propertyIsEnumerable.call(e,"callee")||!1}var a="[object Arguments]"==function(){return Object.prototype.toString.call(arguments)}();t=e.exports=a?n:r,t.supported=n,t.unsupported=r},function(e,t){function n(e){var t=[];for(var n in e)t.push(n);return t}t=e.exports="function"==typeof Object.keys?Object.keys:n,t.shim=n},function(e,t,n){var r=n(27),a=n(26);e.exports={stringify:r,parse:a}},function(e,t,n){var r=n(13),a={delimiter:"&",depth:5,arrayLimit:20,parameterLimit:1e3,strictNullHandling:!1,plainObjects:!1,allowPrototypes:!1};a.parseValues=function(e,t){for(var n={},a=e.split(t.delimiter,t.parameterLimit===1/0?void 0:t.parameterLimit),o=0,i=a.length;i>o;++o){var u=a[o],s=-1===u.indexOf("]=")?u.indexOf("="):u.indexOf("]=")+1;if(-1===s)n[r.decode(u)]="",t.strictNullHandling&&(n[r.decode(u)]=null);else{var c=r.decode(u.slice(0,s)),f=r.decode(u.slice(s+1));Object.prototype.hasOwnProperty.call(n,c)?n[c]=[].concat(n[c]).concat(f):n[c]=f}}return n},a.parseObject=function(e,t,n){if(!e.length)return t;var r,o=e.shift();if("[]"===o)r=[],r=r.concat(a.parseObject(e,t,n));else{r=n.plainObjects?Object.create(null):{};var i="["===o[0]&&"]"===o[o.length-1]?o.slice(1,o.length-1):o,u=parseInt(i,10),s=""+u;!isNaN(u)&&o!==i&&s===i&&u>=0&&n.parseArrays&&u<=n.arrayLimit?(r=[],r[u]=a.parseObject(e,t,n)):r[i]=a.parseObject(e,t,n)}return r},a.parseKeys=function(e,t,n){if(e){n.allowDots&&(e=e.replace(/\.([^\.\[]+)/g,"[$1]"));var r=/^([^\[\]]*)/,o=/(\[[^\[\]]*\])/g,i=r.exec(e),u=[];if(i[1]){if(!n.plainObjects&&Object.prototype.hasOwnProperty(i[1])&&!n.allowPrototypes)return;u.push(i[1])}for(var s=0;null!==(i=o.exec(e))&&s<n.depth;)++s,(n.plainObjects||!Object.prototype.hasOwnProperty(i[1].replace(/\[|\]/g,""))||n.allowPrototypes)&&u.push(i[1]);return i&&u.push("["+e.slice(i.index)+"]"),a.parseObject(u,t,n)}},e.exports=function(e,t){if(t=t||{},t.delimiter="string"==typeof t.delimiter||r.isRegExp(t.delimiter)?t.delimiter:a.delimiter,t.depth="number"==typeof t.depth?t.depth:a.depth,t.arrayLimit="number"==typeof t.arrayLimit?t.arrayLimit:a.arrayLimit,t.parseArrays=t.parseArrays!==!1,t.allowDots=t.allowDots!==!1,t.plainObjects="boolean"==typeof t.plainObjects?t.plainObjects:a.plainObjects,t.allowPrototypes="boolean"==typeof t.allowPrototypes?t.allowPrototypes:a.allowPrototypes,t.parameterLimit="number"==typeof t.parameterLimit?t.parameterLimit:a.parameterLimit,t.strictNullHandling="boolean"==typeof t.strictNullHandling?t.strictNullHandling:a.strictNullHandling,""===e||null===e||"undefined"==typeof e)return t.plainObjects?Object.create(null):{};for(var n="string"==typeof e?a.parseValues(e,t):e,o=t.plainObjects?Object.create(null):{},i=Object.keys(n),u=0,s=i.length;s>u;++u){var c=i[u],f=a.parseKeys(c,n[c],t);o=r.merge(o,f,t)}return r.compact(o)}},function(e,t,n){var r=n(13),a={delimiter:"&",arrayPrefixGenerators:{brackets:function(e,t){return e+"[]"},indices:function(e,t){return e+"["+t+"]"},repeat:function(e,t){return e}},strictNullHandling:!1};a.stringify=function(e,t,n,o,i){if("function"==typeof i)e=i(t,e);else if(r.isBuffer(e))e=e.toString();else if(e instanceof Date)e=e.toISOString();else if(null===e){if(o)return r.encode(t);e=""}if("string"==typeof e||"number"==typeof e||"boolean"==typeof e)return[r.encode(t)+"="+r.encode(e)];var u=[];if("undefined"==typeof e)return u;for(var s=Array.isArray(i)?i:Object.keys(e),c=0,f=s.length;f>c;++c){var l=s[c];u=Array.isArray(e)?u.concat(a.stringify(e[l],n(t,l),n,o,i)):u.concat(a.stringify(e[l],t+"["+l+"]",n,o,i))}return u},e.exports=function(e,t){t=t||{};var n,r,o="undefined"==typeof t.delimiter?a.delimiter:t.delimiter,i="boolean"==typeof t.strictNullHandling?t.strictNullHandling:a.strictNullHandling;"function"==typeof t.filter?(r=t.filter,e=r("",e)):Array.isArray(t.filter)&&(n=r=t.filter);var u=[];if("object"!=typeof e||null===e)return"";var s;s=t.arrayFormat in a.arrayPrefixGenerators?t.arrayFormat:"indices"in t?t.indices?"indices":"repeat":"indices";var c=a.arrayPrefixGenerators[s];n||(n=Object.keys(e));for(var f=0,l=n.length;l>f;++f){var d=n[f];u=u.concat(a.stringify(e[d],d,c,i,r))}return u.join(o)}}])});
{
"name": "react-router",
"version": "1.0.0-rc1",
"version": "1.0.0-rc2",
"description": "A complete routing library for React.js",

@@ -16,5 +16,6 @@ "main": "lib/index",

"build-min": "NODE_ENV=production webpack -p modules/index.js umd/ReactRouter.min.js",
"start": "webpack-dev-server --config examples/webpack.config.js --content-base examples --inline",
"test": "eslint modules && karma start",
"lint": "eslint modules",
"start": "node examples/server.js",
"test": "npm run lint && karma start",
"lint": "eslint modules examples",
"postinstall": "node -e \"require('fs').stat('lib', function (e, s) { process.exit(e || !s.isDirectory() ? 1 : 0) })\" || npm run build",
"prepublish": "npm run build"

@@ -28,3 +29,3 @@ },

"dependencies": {
"history": "^1.9.0",
"history": "1.12.1",
"invariant": "^2.0.0",

@@ -34,2 +35,3 @@ "warning": "^2.0.0"

"devDependencies": {
"assert": "1.3.0",
"babel": "^5.4.7",

@@ -39,8 +41,9 @@ "babel-core": "^5.4.7",

"babel-loader": "^5.0.0",
"babel-plugin-object-assign": "^1.2.0",
"bundle-loader": "^0.5.2",
"css-loader": "^0.19.0",
"eslint": "1.4.0",
"eslint-plugin-react": "3.3.2",
"events": "1.0.2",
"expect": "^1.6.0",
"expect": "1.10.0",
"express": "^4.13.3",
"express-urlrewrite": "^1.2.0",
"karma": "^0.13.8",

@@ -54,11 +57,9 @@ "karma-browserstack-launcher": "^0.1.4",

"karma-webpack": "^1.7.0",
"marked": "0.3.3",
"mocha": "^2.0.1",
"pygmentize-bundled": "^2.3.0",
"qs": "^4.0.0",
"react": "0.13.x",
"rf-changelog": "^0.4.0",
"rx": "2.3.18",
"slash": "^1.0.0",
"style-loader": "^0.12.4",
"webpack": "^1.4.13",
"webpack-dev-server": "^1.10.1"
"webpack-dev-middleware": "^1.2.0"
},

@@ -65,0 +66,0 @@ "tags": [

@@ -21,2 +21,4 @@ [![build status](https://img.shields.io/travis/rackt/react-router/master.svg?style=flat-square)](https://travis-ci.org/rackt/react-router)

**Note:** *If you are still using React Router 0.13.x [the docs](https://github.com/rackt/react-router/tree/0.13.x/docs/guides) can be found on [the 0.13.x branch](https://github.com/rackt/react-router/tree/0.13.x).*
### Browser Support

@@ -30,3 +32,3 @@

$ npm install react-router
$ npm install react-router@1.0.0-rc1

@@ -37,9 +39,9 @@ Then with a module bundler or webpack, use as you would anything else:

// using an ES6 transpiler, like babel
import { Router, Route, Link } from 'react-router';
import { Router, Route, Link } from 'react-router'
// not using an ES6 transpiler
var ReactRouter = require('react-router');
var Router = ReactRouter.Router;
var Route = ReactRouter.Route;
var Link = ReactRouter.Link;
var ReactRouter = require('react-router')
var Router = ReactRouter.Router
var Route = ReactRouter.Route
var Link = ReactRouter.Link
```

@@ -50,3 +52,3 @@

```js
import { Router } from 'react-router/lib/Router';
import { Router } from 'react-router/lib/Router'
```

@@ -57,3 +59,3 @@

```js
import ReactRouter from 'react-router/umd/ReactRouter';
import ReactRouter from 'react-router/umd/ReactRouter'
```

@@ -70,9 +72,10 @@

```js
import { Router, Route } from 'react-router';
import React from 'react'
import { Router, Route, Link } from 'react-router'
var App = React.createClass({/*...*/});
var About = React.createClass({/*...*/});
const App = React.createClass({/*...*/})
const About = React.createClass({/*...*/})
// etc.
var Users = React.createClass({
const Users = React.createClass({
render() {

@@ -94,7 +97,7 @@ return (

</div>
);
)
}
});
})
var User = React.createClass({
const User = React.createClass({
componentDidMount() {

@@ -104,3 +107,3 @@ this.setState({

user: findUserById(this.props.params.userId)
});
})
},

@@ -114,5 +117,5 @@

</div>
);
)
}
});
})

@@ -132,7 +135,6 @@ // Declarative route configuration (could also load this config lazily

</Router>
), document.body);
), document.body)
```
See more in the [Introduction](/docs/introduction/README.md) and [Advanced
Usage](/docs/advanced/README.md).
See more in the [Introduction](/docs/Introduction.md) and [Advanced Usage](/docs/guides/advanced/README.md).

@@ -139,0 +141,0 @@ ### Thanks

@@ -1,2 +0,2 @@

!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react")):"function"==typeof define&&define.amd?define(["react"],t):"object"==typeof exports?exports.ReactRouter=t(require("react")):e.ReactRouter=t(e.React)}(this,function(e){return function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={exports:{},id:r,loaded:!1};return e[r].call(o.exports,o,o.exports,t),o.loaded=!0,o.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}t.__esModule=!0;var o=n(23),a=r(o);t.Router=a["default"];var u=n(19),i=r(u);t.Link=i["default"];var s=n(17),l=r(s);t.IndexRoute=l["default"];var c=n(20),f=r(c);t.Redirect=f["default"];var p=n(21),d=r(p);t.Route=d["default"];var h=n(16),y=r(h);t.History=y["default"];var m=n(18),g=r(m);t.Lifecycle=g["default"];var v=n(22),b=r(v);t.RouteContext=b["default"];var x=n(10),O=r(x);t.useRoutes=O["default"];var R=n(4);t.createRoutes=R.createRoutes;var _=n(11),P=r(_);t.RoutingContext=P["default"];var w=n(5),j=r(w);t.PropTypes=j["default"];var E=n(29),k=r(E);t.match=k["default"];var A=r(o);t["default"]=A["default"]},function(e,t,n){"use strict";var r=function(e,t,n,r,o,a,u,i){if(!e){var s;if(void 0===t)s=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var l=[n,r,o,a,u,i],c=0;s=new Error("Invariant Violation: "+t.replace(/%s/g,function(){return l[c++]}))}throw s.framesToPop=1,s}};e.exports=r},function(t,n){t.exports=e},function(e,t,n){"use strict";var r=function(){};e.exports=r},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e){return null==e||d["default"].isValidElement(e)}function a(e){return o(e)||Array.isArray(e)&&e.every(o)}function u(e,t,n){e=e||"UnknownComponent";for(var r in t)if(t.hasOwnProperty(r)){var o=t[r](n,r,e);o instanceof Error&&y["default"](!1,o.message)}}function i(e,t){return f({},e,t)}function s(e){var t=e.type,n=i(t.defaultProps,e.props);if(t.propTypes&&u(t.displayName||t.name,t.propTypes,n),n.children){var r=l(n.children,n);r.length&&(n.childRoutes=r),delete n.children}return n}function l(e,t){var n=[];return d["default"].Children.forEach(e,function(e){if(d["default"].isValidElement(e))if(e.type.createRouteFromReactElement){var r=e.type.createRouteFromReactElement(e,t);r&&n.push(r)}else n.push(s(e))}),n}function c(e){return a(e)?e=l(e):Array.isArray(e)||(e=[e]),e}t.__esModule=!0;var f=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e};t.isReactChildren=a,t.createRouteFromReactElement=s,t.createRoutesFromReactChildren=l,t.createRoutes=c;var p=n(2),d=r(p),h=n(3),y=r(h)},function(e,t,n){"use strict";function r(e,t,n){return e[t]?new Error("<"+n+'> should not have a "'+t+'" prop'):void 0}t.__esModule=!0,t.falsy=r;var o=n(2),a=o.PropTypes.func,u=o.PropTypes.object,i=o.PropTypes.arrayOf,s=o.PropTypes.oneOfType,l=o.PropTypes.element,c=o.PropTypes.shape,f=o.PropTypes.string,p=c({listen:a.isRequired,pushState:a.isRequired,replaceState:a.isRequired,go:a.isRequired});t.history=p;var d=c({pathname:f.isRequired,search:f.isRequired,state:u,action:f.isRequired,key:f});t.location=d;var h=s([a,f]);t.component=h;var y=s([h,u]);t.components=y;var m=s([u,l]);t.route=m;var g=s([m,i(m)]);t.routes=g,t["default"]={falsy:r,history:p,location:d,component:h,components:y,route:m}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function a(e){return o(e).replace(/\/+/g,"/+")}function u(e){for(var t,n="",r=[],o=[],u=0,i=/:([a-zA-Z_$][a-zA-Z0-9_$]*)|\*|\(|\)/g;t=i.exec(e);)t.index!==u&&(o.push(e.slice(u,t.index)),n+=a(e.slice(u,t.index))),t[1]?(n+="([^/?#]+)",r.push(t[1])):"*"===t[0]?(n+="([\\s\\S]*?)",r.push("splat")):"("===t[0]?n+="(?:":")"===t[0]&&(n+=")?"),o.push(t[0]),u=i.lastIndex;return u!==e.length&&(o.push(e.slice(u,e.length)),n+=a(e.slice(u,e.length))),{pattern:e,regexpSource:n,paramNames:r,tokens:o}}function i(e){return e in h||(h[e]=u(e)),h[e]}function s(e,t){var n=i(e),r=n.regexpSource,o=n.paramNames,a=n.tokens;r+="/*";var u="*"!==a[a.length-1];u&&(r+="([\\s\\S]*?)");var s,l,c=t.match(new RegExp("^"+r+"$","i"));return null!=c?(l=Array.prototype.slice.call(c,1).map(function(e){return null!=e?decodeURIComponent(e.replace(/\+/g,"%20")):e}),s=u?l.pop():t.replace(c[0],"")):s=l=null,{remainingPathname:s,paramNames:o,paramValues:l}}function l(e){return i(e).paramNames}function c(e,t){var n=s(e,t),r=n.paramNames,o=n.paramValues;return null!=o?r.reduce(function(e,t,n){return e[t]=o[n],e},{}):null}function f(e,t){t=t||{};for(var n,r,o,a=i(e),u=a.tokens,s=0,l="",c=0,f=0,p=u.length;p>f;++f)n=u[f],"*"===n?(o=Array.isArray(t.splat)?t.splat[c++]:t.splat,d["default"](null!=o||s>0,'Missing splat #%s for path "%s"',c,e),null!=o&&(l+=encodeURI(o).replace(/%20/g,"+"))):"("===n?s+=1:")"===n?s-=1:":"===n.charAt(0)?(r=n.substring(1),o=t[r],d["default"](null!=o||s>0,'Missing "%s" parameter for path "%s"',r,e),null!=o&&(l+=encodeURIComponent(o).replace(/%20/g,"+"))):l+=n;return l.replace(/\/+/g,"/")}t.__esModule=!0,t.compilePattern=i,t.matchPattern=s,t.getParamNames=l,t.getParams=c,t.formatPattern=f;var p=n(1),d=r(p),h={}},function(e,t){"use strict";t.__esModule=!0;var n="PUSH";t.PUSH=n;var r="REPLACE";t.REPLACE=r;var o="POP";t.POP=o,t["default"]={PUSH:n,REPLACE:r,POP:o}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e){var t=e.match(/https?:\/\/[^\/]*/);return null==t?e:(i["default"](!1,'Location path must be pathname + query string only, not a fully qualified URL like "%s"',e),e.substring(t[0].length))}function a(){var e=arguments.length<=0||void 0===arguments[0]?"/":arguments[0],t=arguments.length<=1||void 0===arguments[1]?null:arguments[1],n=arguments.length<=2||void 0===arguments[2]?s.POP:arguments[2],r=arguments.length<=3||void 0===arguments[3]?null:arguments[3];e=o(e);var a=e,u="",i="",l=a.indexOf("#");-1!==l&&(i=a.substring(l),a=a.substring(0,l));var c=a.indexOf("?");return-1!==c&&(u=a.substring(c),a=a.substring(0,c)),""===a&&(a="/"),{pathname:a,search:u,hash:i,state:t,action:n,key:r}}t.__esModule=!0;var u=n(3),i=r(u),s=n(7);t["default"]=a,e.exports=t["default"]},function(e,t){"use strict";function n(e,t,n){function r(){u=!0,n.apply(this,arguments)}function o(){u||(e>a?t.call(this,a++,o,r):r.apply(this,arguments))}var a=0,u=!1;o()}function r(e,t,n){function r(e,t,r){u||(t?(u=!0,n(t)):(a[e]=r,u=++i===o,u&&n(null,a)))}var o=e.length,a=[];if(0===o)return n(null,a);var u=!1,i=0;e.forEach(function(e,n){t(e,n,function(e,t){r(n,e,t)})})}t.__esModule=!0,t.loopAsync=n,t.mapAsync=r},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}function a(e){for(var t in e)if(e.hasOwnProperty(t))return!0;return!1}function u(e){return function(){function t(e,t){var n=arguments.length<=2||void 0===arguments[2]?!1:arguments[2];return b["default"](e,t,n,k.location,k.routes,k.params)}function n(e,t){A&&A.location===e?u(A,t):_["default"](w,e,function(n,r){n?t(n,null,null):r?u(i({},r,{location:e}),function(e,n,r){r&&(k=r),t(e,n,r)}):t(null,null,null)})}function r(e){var t=e.pathname,n=e.query,r=e.state;return h["default"](E.createPath(t,n),r,c.REPLACE,E.createKey())}function u(e,t){var n=m["default"](k,e),o=n.leaveRoutes,a=n.enterRoutes;g.runLeaveHooks(o),g.runEnterHooks(a,e,function(n,o){n?t(n):o?t(null,r(o),null):O["default"](e,function(n,r){n?t(n):t(null,null,i({},e,{components:r}))})})}function s(e){return e.__id__||(e.__id__=T++)}function f(e){return e.reduce(function(e,t){return e.push.apply(e,M[s(t)]),e},[])}function d(e,t){_["default"](w,e,function(n,r){if(null==r)return void t();A=i({},r,{location:e});for(var o=f(m["default"](k,r).leaveRoutes),a=void 0,u=0,s=o.length;null==a&&s>u;++u)a=o[u](e);t(a)})}function y(){if(k.routes){for(var e=f(k.routes),t=void 0,n=0,r=e.length;"string"!=typeof t&&r>n;++n)t=e[n]();return t}}function v(e,t){var n=s(e),r=M[n];if(null==r){var o=!a(M);r=M[n]=[t],o&&(E.registerTransitionHook(d),E.registerBeforeUnloadHook&&E.registerBeforeUnloadHook(y))}else-1===r.indexOf(t)&&r.push(t)}function x(e,t){var n=s(e),r=M[n];if(null!=r){var o=r.filter(function(e){return e!==t});0===o.length?(delete M[n],a(M)||(E.unregisterTransitionHook(d),E.unregisterBeforeUnloadHook&&E.unregisterBeforeUnloadHook(y))):M[n]=o}}function R(e){return E.listen(function(t){k.location===t?e(null,k):n(t,function(n,r,o){n?e(n):o?e(null,k):r?E.transitionTo(r):l["default"](!1,'Location "%s" did not match any routes',t.pathname+t.search)})})}var P=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],w=P.routes,j=o(P,["routes"]),E=p["default"](e)(j),k={},A=void 0,M={},T=1;return i({},E,{isActive:t,registerRouteHook:v,unregisterRouteHook:x,listen:R,match:n})}}t.__esModule=!0;var i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},s=n(3),l=r(s),c=n(7),f=n(36),p=r(f),d=n(8),h=r(d),y=n(25),m=r(y),g=n(24),v=n(28),b=r(v),x=n(26),O=r(x),R=n(30),_=r(R);t["default"]=u,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}t.__esModule=!0;var o=n(2),a=r(o),u=n(1),i=r(u),s=n(27),l=r(s),c=a["default"].PropTypes,f=c.array,p=c.func,d=c.object,h=a["default"].createClass({displayName:"RoutingContext",propTypes:{history:d.isRequired,createElement:p.isRequired,location:d.isRequired,routes:f.isRequired,params:d.isRequired,components:f.isRequired},getDefaultProps:function(){return{createElement:a["default"].createElement}},childContextTypes:{history:d.isRequired,location:d.isRequired},getChildContext:function(){return{history:this.props.history,location:this.props.location}},createElement:function(e,t){return null==e?null:this.props.createElement(e,t)},render:function(){var e=this,t=this.props,n=t.history,r=t.location,o=t.routes,u=t.params,s=t.components,c=null;return s&&(c=s.reduceRight(function(t,a,i){if(null==a)return t;var s=o[i],c=l["default"](s,u),f={history:n,location:r,params:u,route:s,routeParams:c,routes:o};if(t&&(f.children=t),"object"==typeof a){var p={};for(var d in a)a.hasOwnProperty(d)&&(p[d]=e.createElement(a[d],f));return p}return e.createElement(a,f)},c)),i["default"](null===c||c===!1||a["default"].isValidElement(c),"The root route must render a single element"),c}});t["default"]=h,e.exports=t["default"]},function(e,t){"use strict";function n(e,t,n){e.addEventListener?e.addEventListener(t,n,!1):e.attachEvent("on"+t,n)}function r(e,t,n){e.removeEventListener?e.removeEventListener(t,n,!1):e.detachEvent("on"+t,n)}function o(){return window.location.href.split("#")[1]||""}function a(e){window.location.replace(window.location.pathname+window.location.search+"#"+e)}function u(){return window.location.pathname+window.location.search}function i(e){e&&window.history.go(e)}function s(e,t){t(window.confirm(e))}function l(){var e=navigator.userAgent;return-1===e.indexOf("Android 2.")&&-1===e.indexOf("Android 4.0")||-1===e.indexOf("Mobile Safari")||-1!==e.indexOf("Chrome")||-1!==e.indexOf("Windows Phone")?window.history&&"pushState"in window.history:!1}function c(){var e=navigator.userAgent;return-1===e.indexOf("Firefox")}t.__esModule=!0,t.addEventListener=n,t.removeEventListener=r,t.getHashPath=o,t.replaceHashPath=a,t.getWindowPath=u,t.go=i,t.getUserConfirmation=s,t.supportsHistory=l,t.supportsGoWithoutReloadUsingHash=c},function(e,t){"use strict";t.__esModule=!0;var n=!("undefined"==typeof window||!window.document||!window.document.createElement);t.canUseDOM=n},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e){return Math.random().toString(36).substr(2,e)}function a(e,t){return e.pathname===t.pathname&&e.search===t.search&&e.key===t.key&&d["default"](e.state,t.state)}function u(){function e(){return I&&I.action===y.POP?U.indexOf(I.key):N?U.indexOf(N.key):-1}function t(t){var n=e();N=t,N.action===y.PUSH?U=[].concat(U.slice(0,n+1),[N.key]):N.action===y.REPLACE&&(U[n]=N.key),q.forEach(function(e){e(N)})}function n(e){q.push(e)}function r(e){q=q.filter(function(t){return t!==e})}function u(e){if(n(e),N)e(N);else{var o=A();U=[o.key],t(o)}return function(){r(e)}}function s(e){-1===L.indexOf(e)&&L.push(e)}function c(e){L=L.filter(function(t){return t!==e})}function p(e,t,n){var r=e(t,n);e.length<2?n(r):l["default"](void 0===r,'You should not "return" in a transition hook with a callback argument call the callback instead')}function d(e,t){h.loopAsync(L.length,function(t,n,r){p(L[t],e,function(e){null!=e?r(e):n()})},function(e){H&&"string"==typeof e?H(e,function(e){t(e!==!1)}):t(e!==!1)})}function m(e){N&&a(N,e)||(f["default"](null==I,"transitionTo: Another transition is already in progress"),I=e,d(e,function(n){if(I=null,n)M(e),t(e);else if(N&&e.action===y.POP){var r=U.indexOf(N.key),o=U.indexOf(e.key);-1!==r&&-1!==o&&S(r-o)}}))}function b(e,t){m(g["default"](t,e,y.PUSH,w()))}function x(e,t){m(g["default"](t,e,y.REPLACE,w()))}function O(e){N?(R(N,e),t(N)):R(A(),e)}function R(e,t){e.state=i({},e.state,t),T(e.key,e.state)}function _(){S(-1)}function P(){S(1)}function w(){return o(C)}function j(e){return e}function E(e){return j(e)}var k=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],A=k.getCurrentLocation,M=k.finishTransition,T=k.saveState,S=k.go,C=k.keyLength,H=k.getUserConfirmation;"number"!=typeof C&&(C=v);var L=[],q=[],N=void 0,U=[],I=void 0;return{listen:u,registerTransitionHook:s,unregisterTransitionHook:c,transitionTo:m,pushState:b,replaceState:x,setState:O,go:S,goBack:_,goForward:P,createKey:w,createPath:j,createHref:E}}t.__esModule=!0;var i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},s=n(3),l=r(s),c=n(1),f=r(c),p=n(37),d=r(p),h=n(31),y=n(7),m=n(8),g=r(m),v=6;t["default"]=u,e.exports=t["default"]},function(e,t){var n={};n.hexTable=new Array(256);for(var r=0;256>r;++r)n.hexTable[r]="%"+((16>r?"0":"")+r.toString(16)).toUpperCase();t.arrayToObject=function(e,t){for(var n=t.plainObjects?Object.create(null):{},r=0,o=e.length;o>r;++r)"undefined"!=typeof e[r]&&(n[r]=e[r]);return n},t.merge=function(e,n,r){if(!n)return e;if("object"!=typeof n)return Array.isArray(e)?e.push(n):"object"==typeof e?e[n]=!0:e=[e,n],e;if("object"!=typeof e)return e=[e].concat(n);Array.isArray(e)&&!Array.isArray(n)&&(e=t.arrayToObject(e,r));for(var o=Object.keys(n),a=0,u=o.length;u>a;++a){var i=o[a],s=n[i];Object.prototype.hasOwnProperty.call(e,i)?e[i]=t.merge(e[i],s,r):e[i]=s}return e},t.decode=function(e){try{return decodeURIComponent(e.replace(/\+/g," "))}catch(t){return e}},t.encode=function(e){if(0===e.length)return e;"string"!=typeof e&&(e=""+e);for(var t="",r=0,o=e.length;o>r;++r){var a=e.charCodeAt(r);45===a||46===a||95===a||126===a||a>=48&&57>=a||a>=65&&90>=a||a>=97&&122>=a?t+=e[r]:128>a?t+=n.hexTable[a]:2048>a?t+=n.hexTable[192|a>>6]+n.hexTable[128|63&a]:55296>a||a>=57344?t+=n.hexTable[224|a>>12]+n.hexTable[128|a>>6&63]+n.hexTable[128|63&a]:(++r,a=65536+((1023&a)<<10|1023&e.charCodeAt(r)),t+=n.hexTable[240|a>>18]+n.hexTable[128|a>>12&63]+n.hexTable[128|a>>6&63]+n.hexTable[128|63&a])}return t},t.compact=function(e,n){if("object"!=typeof e||null===e)return e;n=n||[];var r=n.indexOf(e);if(-1!==r)return n[r];if(n.push(e),Array.isArray(e)){for(var o=[],a=0,u=e.length;u>a;++a)"undefined"!=typeof e[a]&&o.push(e[a]);return o}var i=Object.keys(e);for(a=0,u=i.length;u>a;++a){var s=i[a];e[s]=t.compact(e[s],n)}return e},t.isRegExp=function(e){return"[object RegExp]"===Object.prototype.toString.call(e)},t.isBuffer=function(e){return null===e||"undefined"==typeof e?!1:!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))}},function(e,t,n){"use strict";t.__esModule=!0;var r=n(5),o={contextTypes:{history:r.history},componentWillMount:function(){this.history=this.context.history}};t["default"]=o,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}t.__esModule=!0;var o=n(2),a=r(o),u=n(1),i=r(u),s=n(3),l=r(s),c=n(4),f=n(5),p=a["default"].PropTypes,d=p.bool,h=p.func,y=a["default"].createClass({displayName:"IndexRoute",statics:{createRouteFromReactElement:function(e,t){t?t.indexRoute=c.createRouteFromReactElement(e):l["default"](!1,"An <IndexRoute> does not make sense at the root of your route config")}},propTypes:{path:f.falsy,ignoreScrollBehavior:d,component:f.component,components:f.components,getComponents:h},render:function(){i["default"](!1,"<IndexRoute> elements are for router configuration only and should not be rendered")}});t["default"]=y,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}t.__esModule=!0;var o=n(2),a=r(o),u=n(1),i=r(u),s=a["default"].PropTypes.object,l={propTypes:{route:s},contextTypes:{history:s.isRequired,route:s},_getRoute:function(){var e=this.props.route||this.context.route;return i["default"](e,"The Lifecycle mixin needs to be used either on 1) a <Route component> or 2) a descendant of a <Route component> that uses the RouteContext mixin"),e},componentWillMount:function(){i["default"](this.routerWillLeave,"The Lifecycle mixin requires you to define a routerWillLeave method"),this.context.history.registerRouteHook(this._getRoute(),this.routerWillLeave)},componentWillUnmount:function(){this.context.history.unregisterRouteHook(this._getRoute(),this.routerWillLeave)}};t["default"]=l,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}function a(e){return 0===e.button}function u(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function i(e){for(var t in e)if(e.hasOwnProperty(t))return!1;return!0}t.__esModule=!0;var s=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},l=n(2),c=r(l),f=n(3),p=r(f),d=c["default"].PropTypes,h=d.bool,y=d.object,m=d.string,g=d.func,v=c["default"].createClass({displayName:"Link",contextTypes:{history:y},propTypes:{activeStyle:y,activeClassName:m,onlyActiveOnIndex:h.isRequired,to:m.isRequired,query:y,state:y,onClick:g},getDefaultProps:function(){return{onlyActiveOnIndex:!1,className:"",style:{}}},handleClick:function(e){var t,n=!0;this.props.onClick&&(t=this.props.onClick(e)),!u(e)&&a(e)&&((t===!1||e.defaultPrevented===!0)&&(n=!1),e.preventDefault(),n&&this.context.history.pushState(this.props.state,this.props.to,this.props.query))},componentWillMount:function(){p["default"](this.context.history,"A <Link> should not be rendered outside the context of history; some features including real hrefs, active styling, and navigation will not function correctly")},render:function(){var e=this.context.history,t=this.props,n=t.activeClassName,r=t.activeStyle,a=t.onlyActiveOnIndex,u=t.to,l=t.query,f=(t.state,t.onClick,o(t,["activeClassName","activeStyle","onlyActiveOnIndex","to","query","state","onClick"]));return f.onClick=this.handleClick,e&&(f.href=e.createHref(u,l),(n||null!=r&&!i(r))&&e.isActive(u,l,a)&&(n&&(f.className+=""===f.className?n:" "+n),r&&(f.style=s({},f.style,r)))),c["default"].createElement("a",f)}});t["default"]=v,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}t.__esModule=!0;var o=n(2),a=r(o),u=n(1),i=r(u),s=n(4),l=n(6),c=n(5),f=a["default"].PropTypes,p=f.string,d=f.object,h=a["default"].createClass({displayName:"Redirect",statics:{createRouteFromReactElement:function(e){var t=s.createRouteFromReactElement(e);return t.from&&(t.path=t.from),i["default"]("/"===t.to.charAt(0),"<Redirect to> must be an absolute path. This should be fixed in the future"),t.onEnter=function(e,n){var r=e.location,o=e.params,a=t.to?l.formatPattern(t.to,o):r.pathname;n(t.state||r.state,a,t.query||r.query)},t}},propTypes:{path:p,from:p,to:p.isRequired,query:d,state:d,onEnter:c.falsy,children:c.falsy},render:function(){i["default"](!1,"<Redirect> elements are for router configuration only and should not be rendered")}});t["default"]=h,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}t.__esModule=!0;var o=n(2),a=r(o),u=n(3),i=r(u),s=n(1),l=r(s),c=n(4),f=n(5),p=a["default"].PropTypes,d=p.string,h=p.bool,y=p.func,m=a["default"].createClass({displayName:"Route",statics:{createRouteFromReactElement:function(e){var t=c.createRouteFromReactElement(e);return t.handler&&(i["default"](!1,"<Route handler> is deprecated, use <Route component> instead"),t.component=t.handler,delete t.handler),t}},propTypes:{path:d,ignoreScrollBehavior:h,handler:f.component,component:f.component,components:f.components,getComponents:y},render:function(){l["default"](!1,"<Route> elements are for router configuration only and should not be rendered")}});t["default"]=m,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}t.__esModule=!0;var o=n(2),a=r(o),u=a["default"].PropTypes.object,i={propTypes:{route:u.isRequired},childContextTypes:{route:u.isRequired},getChildContext:function(){return{route:this.props.route}}};t["default"]=i,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}t.__esModule=!0;var o=n(2),a=r(o),u=n(3),i=r(u),s=n(34),l=r(s),c=n(4),f=n(11),p=r(f),d=n(10),h=r(d),y=n(5),m=a["default"].PropTypes,g=m.func,v=m.object,b=a["default"].createClass({displayName:"Router",propTypes:{history:v,children:y.routes,routes:y.routes,createElement:g,onError:g,onUpdate:g,parseQueryString:g,stringifyQuery:g},getInitialState:function(){return{location:null,routes:null,params:null,components:null}},handleError:function(e){if(!this.props.onError)throw e;this.props.onError.call(this,e)},componentWillMount:function(){var e=this,t=this.props,n=t.history,r=t.children,o=t.routes,a=t.parseQueryString,u=t.stringifyQuery,i=n?function(){return n}:l["default"];this.history=h["default"](i)({routes:c.createRoutes(o||r),parseQueryString:a,stringifyQuery:u}),this._unlisten=this.history.listen(function(t,n){t?e.handleError(t):e.setState(n,e.props.onUpdate)})},componentWillReceiveProps:function(e){i["default"](e.history===this.props.history,"The `history` provided to <Router/> has changed, it will be ignored.")},componentWillUnmount:function(){this._unlisten&&this._unlisten()},render:function(){var e=this.state,t=e.location,n=e.routes,r=e.params,o=e.components,u=this.props.createElement;return null==t?null:a["default"].createElement(p["default"],{history:this.history,createElement:u,location:t,routes:n,params:r,components:o})}});t["default"]=b,e.exports=t["default"]},function(e,t,n){"use strict";function r(e,t){return function(n,r,o){e.apply(t,arguments),e.length<3&&o()}}function o(e){return e.reduce(function(e,t){return t.onEnter&&e.push(r(t.onEnter,t)),e},[])}function a(e,t,n){function r(e,t,n){u={pathname:t,query:n,state:e}}var a=o(e);if(!a.length)return void n();var u;i.loopAsync(a.length,function(e,n,o){a[e](t,r,function(e){e||u?o(e,u):n()})},n)}function u(e){for(var t=0,n=e.length;n>t;++t)e[t].onLeave&&e[t].onLeave.call(e[t])}t.__esModule=!0,t.runEnterHooks=a,t.runLeaveHooks=u;var i=n(9)},function(e,t,n){"use strict";function r(e,t,n){if(!e.path)return!1;var r=a.getParamNames(e.path);return r.some(function(e){return t.params[e]!==n.params[e]})}function o(e,t){var n,o,a=e&&e.routes,u=t.routes;return a?(n=a.filter(function(n){return-1===u.indexOf(n)||r(n,e,t)}),n.reverse(),o=u.filter(function(e){return-1===a.indexOf(e)||-1!==n.indexOf(e)})):(n=[],o=u),{leaveRoutes:n,enterRoutes:o}}t.__esModule=!0;var a=n(6);t["default"]=o,e.exports=t["default"]},function(e,t,n){"use strict";function r(e,t,n){t.component||t.components?n(null,t.component||t.components):t.getComponent?t.getComponent(e,n):t.getComponents?t.getComponents(e,n):n()}function o(e,t){a.mapAsync(e.routes,function(t,n,o){r(e.location,t,o)},t)}t.__esModule=!0;var a=n(9);t["default"]=o,e.exports=t["default"]},function(e,t,n){"use strict";function r(e,t){var n={};if(!e.path)return n;var r=o.getParamNames(e.path);for(var a in t)t.hasOwnProperty(a)&&-1!==r.indexOf(a)&&(n[a]=t[a]);return n}t.__esModule=!0;var o=n(6);t["default"]=r,e.exports=t["default"]},function(e,t,n){"use strict";function r(e,t,n,r){if(e===t||0===t.indexOf(e+"/"))return!0;for(var o,a,i="",s=0,l=n.length;l>s;++s){if(o=n[s],!o.path)return!1;a=o.path||"",0!==a.indexOf("/")&&(a=i.replace(/\/*$/,"/")+a);var c=u.matchPattern(a,e),f=c.remainingPathname,p=c.paramNames,d=c.paramValues;if(""===f)return p.every(function(e,t){return String(d[t])===String(r[e])});i=a}return!1}function o(e,t){if(null==t)return null==e;if(null==e)return!0;for(var n in e)if(e.hasOwnProperty(n)&&String(e[n])!==String(t[n]))return!1;return!0}function a(e,t,n,a,u,i){return null==a?!1:n&&(u.length<2||u[u.length-2].indexRoute!==u[u.length-1])?!1:r(e,a.pathname,u,i)&&o(t,a.query)}t.__esModule=!0;var u=n(6);t["default"]=a,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){var n=e.routes,r=e.history,o=e.location,u=e.parseQueryString,s=e.stringifyQuery,f=r?function(){return r}:i["default"],p=l["default"](f)({routes:c.createRoutes(n),parseQueryString:u,stringifyQuery:s});p.match(o,function(e,n,r){var o=r?a({},r,{history:p}):null;t(e,n,o)})}t.__esModule=!0;var a=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e};t["default"]=o;var u=n(35),i=r(u),s=n(10),l=r(s),c=n(4);e.exports=t["default"]},function(e,t,n){"use strict";function r(e,t,n){e.childRoutes?n(null,e.childRoutes):e.getChildRoutes?e.getChildRoutes(t,function(e,t){n(e,!e&&f.createRoutes(t))}):n()}function o(e,t,n){e.indexRoute?n(null,e.indexRoute):e.getIndexRoute?e.getIndexRoute(t,function(e,t){n(e,!e&&f.createRoutes(t)[0])}):n()}function a(e,t,n){return t.reduceRight(function(e,t,r){var o=n&&n[r];return Array.isArray(e[t])?e[t].unshift(o):t in e?e[t]=[o,e[t]]:e[t]=o,e},e)}function u(e,t){return a({},e,t)}function i(e,t,n,a){var i=t.path||"";0!==i.indexOf("/")&&(i=e.replace(/\/*$/,"/")+i);var l=c.matchPattern(i,n.pathname),f=l.remainingPathname,p=l.paramNames,d=l.paramValues,h=""===f;if(h&&t.path){var y={routes:[t],params:u(p,d)};o(t,n,function(e,t){e?a(e):(t&&y.routes.push(t),a(null,y))})}else null!=f||t.childRoutes?r(t,n,function(e,r){e?a(e):r?s(r,n,function(e,n){e?a(e):n?(n.routes.unshift(t),a(null,n)):a()},i):a()}):a()}function s(e,t,n){var r=arguments.length<=3||void 0===arguments[3]?"":arguments[3];l.loopAsync(e.length,function(n,o,a){i(r,e[n],t,function(e,t){e||t?a(e,t):o()})},n)}t.__esModule=!0;var l=n(9),c=n(6),f=n(4);t["default"]=s,e.exports=t["default"]},function(e,t){"use strict";function n(e,t,n){function r(){u=!0,n.apply(this,arguments)}function o(){u||(e>a?t.call(this,a++,o,r):r.apply(this,arguments))}var a=0,u=!1;o()}t.__esModule=!0,t.loopAsync=n},function(e,t){"use strict";function n(e){return a+e}function r(e,t){window.sessionStorage.setItem(n(e),JSON.stringify(t))}function o(e){var t=window.sessionStorage.getItem(n(e));if(t)try{return JSON.parse(t)}catch(r){}return null}t.__esModule=!0,t.saveState=r,t.readState=o;var a="@@History/"},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e){function t(e){return i["default"](s.canUseDOM,"DOM history needs a DOM"),n.listen(e)}var n=f["default"](a({getUserConfirmation:l.getUserConfirmation},e,{go:l.go}));return a({},n,{listen:t})}t.__esModule=!0;var a=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},u=n(1),i=r(u),s=n(13),l=n(12),c=n(14),f=r(c);t["default"]=o,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e){return"string"==typeof e&&"/"===e.charAt(0)}function a(){var e=g.getHashPath();return o(e)?!0:(g.replaceHashPath("/"+e),!1)}function u(e,t,n){return e+(-1===e.indexOf("?")?"?":"&")+(t+"="+n)}function i(e,t){return e.replace(new RegExp("[?&]?"+t+"=[a-zA-Z0-9]+"),"")}function s(e,t){var n=e.match(new RegExp("\\?.*?\\b"+t+"=(.+?)\\b"));return n&&n[1]}function l(){function e(){var e=g.getHashPath(),t=void 0,n=void 0;return O&&(t=s(e,O),e=i(e,O),t?n=v.readState(t):(n=null,t=P.createKey(),g.replaceHashPath(u(e,O,t)))),R["default"](e,n,void 0,t)}function t(t){function n(){a()&&r(e())}var r=t.transitionTo;return a(),g.addEventListener(window,"hashchange",n),function(){g.removeEventListener(window,"hashchange",n)}}function n(e){var t=e.pathname,n=e.search,r=e.state,o=e.action,a=e.key;if(o!==y.POP){var i=t+n;O&&(i=u(i,O,a)),i===g.getHashPath()?p["default"](!1,"You cannot %s the same path using hash history",o):(O?v.saveState(a,r):e.key=e.state=null,o===y.PUSH?window.location.hash=i:g.replaceHashPath(i))}}function r(e){1===++w&&(j=t(P));var n=P.listen(e);return function(){n(),0===--w&&j()}}function o(e,t){p["default"](O||null==e,"You cannot use state without a queryKey it will be dropped"),P.pushState(e,t)}function l(e,t){p["default"](O||null==e,"You cannot use state without a queryKey it will be dropped"),P.replaceState(e,t)}function f(e){p["default"](E,"Hash history go(n) causes a full page reload in this browser"),P.go(e)}function d(e){return"#"+P.createHref(e)}var b=arguments.length<=0||void 0===arguments[0]?{}:arguments[0];h["default"](m.canUseDOM,"Hash history needs a DOM");var O=b.queryKey;(void 0===O||O)&&(O="string"==typeof O?O:_);var P=x["default"](c({},b,{getCurrentLocation:e,finishTransition:n,saveState:v.saveState})),w=0,j=void 0,E=g.supportsGoWithoutReloadUsingHash();return c({},P,{listen:r,pushState:o,replaceState:l,go:f,createHref:d})}t.__esModule=!0;var c=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},f=n(3),p=r(f),d=n(1),h=r(d),y=n(7),m=n(13),g=n(12),v=n(32),b=n(33),x=r(b),O=n(8),R=r(O),_="_k";t["default"]=l,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e){return e.filter(function(e){return e.state}).reduce(function(e,t){return e[t.key]=t.state,e},{})}function a(){function e(e,t){g[e]=t}function t(e){return g[e]}function n(){var e=y[m],n=e.key,r=e.pathname,o=e.search,a=r+(o||""),u=void 0;return n?u=t(n):(u=null,n=p.createKey(),e.key=n),f["default"](a,u,void 0,n)}function r(e){var t=m+e;return t>=0&&t<y.length}function a(e){if(e){s["default"](r(e),"Cannot go(%s) there is not enough history",e),m+=e;var t=n();p.transitionTo(u({},t,{action:l.POP}))}}function i(t){switch(t.action){case l.PUSH:m+=1,m<y.length&&y.splice(m),y.push(t),e(t.key,t.state);break;case l.REPLACE:y[m]=t,e(t.key,t.state)}}var c=arguments.length<=0||void 0===arguments[0]?{}:arguments[0];Array.isArray(c)?c={entries:c}:"string"==typeof c&&(c={entries:[c]});var p=d["default"](u({},c,{getCurrentLocation:n,finishTransition:i,saveState:e,go:a})),h=c,y=h.entries,m=h.current;"string"==typeof y?y=[y]:Array.isArray(y)||(y=["/"]),y=y.map(function(e){var t=p.createKey();return"string"==typeof e?{pathname:e,key:t}:"object"==typeof e&&e?u({},e,{key:t}):void s["default"](!1,"Unable to create history entry from %s",e)}),null==m?m=y.length-1:s["default"](m>=0&&m<y.length,"Current index must be >= 0 and < %s, was %s",y.length,m);var g=o(y);return p}t.__esModule=!0;var u=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];
for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},i=n(1),s=r(i),l=n(7),c=n(8),f=r(c),p=n(14),d=r(p);t["default"]=a,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}function a(e){return c["default"].stringify(e,{arrayFormat:"brackets"})}function u(e){return c["default"].parse(e)}function i(e){return function(){function t(e){return h.listen(function(t){t.query||(t.query=p(t.search.substring(1))),e(t)})}function n(e,t,n){return h.pushState(e,i(t,n))}function r(e,t,n){return h.replaceState(e,i(t,n))}function i(e,t){var n=void 0;return null==t||""===(n=f(t))?e:h.createPath(e+(-1===e.indexOf("?")?"?":"&")+n)}function l(e,t){return h.createHref(i(e,t))}var c=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],f=c.stringifyQuery,p=c.parseQueryString,d=o(c,["stringifyQuery","parseQueryString"]),h=e(d);return"function"!=typeof f&&(f=a),"function"!=typeof p&&(p=u),s({},h,{listen:t,pushState:n,replaceState:r,createPath:i,createHref:l})}}t.__esModule=!0;var s=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},l=n(40),c=r(l);t["default"]=i,e.exports=t["default"]},function(e,t,n){function r(e){return null===e||void 0===e}function o(e){return e&&"object"==typeof e&&"number"==typeof e.length?"function"!=typeof e.copy||"function"!=typeof e.slice?!1:e.length>0&&"number"!=typeof e[0]?!1:!0:!1}function a(e,t,n){var a,c;if(r(e)||r(t))return!1;if(e.prototype!==t.prototype)return!1;if(s(e))return s(t)?(e=u.call(e),t=u.call(t),l(e,t,n)):!1;if(o(e)){if(!o(t))return!1;if(e.length!==t.length)return!1;for(a=0;a<e.length;a++)if(e[a]!==t[a])return!1;return!0}try{var f=i(e),p=i(t)}catch(d){return!1}if(f.length!=p.length)return!1;for(f.sort(),p.sort(),a=f.length-1;a>=0;a--)if(f[a]!=p[a])return!1;for(a=f.length-1;a>=0;a--)if(c=f[a],!l(e[c],t[c],n))return!1;return typeof e==typeof t}var u=Array.prototype.slice,i=n(39),s=n(38),l=e.exports=function(e,t,n){return n||(n={}),e===t?!0:e instanceof Date&&t instanceof Date?e.getTime()===t.getTime():!e||!t||"object"!=typeof e&&"object"!=typeof t?n.strict?e===t:e==t:a(e,t,n)}},function(e,t){function n(e){return"[object Arguments]"==Object.prototype.toString.call(e)}function r(e){return e&&"object"==typeof e&&"number"==typeof e.length&&Object.prototype.hasOwnProperty.call(e,"callee")&&!Object.prototype.propertyIsEnumerable.call(e,"callee")||!1}var o="[object Arguments]"==function(){return Object.prototype.toString.call(arguments)}();t=e.exports=o?n:r,t.supported=n,t.unsupported=r},function(e,t){function n(e){var t=[];for(var n in e)t.push(n);return t}t=e.exports="function"==typeof Object.keys?Object.keys:n,t.shim=n},function(e,t,n){var r=n(42),o=n(41);e.exports={stringify:r,parse:o}},function(e,t,n){var r=n(15),o={delimiter:"&",depth:5,arrayLimit:20,parameterLimit:1e3,strictNullHandling:!1,plainObjects:!1,allowPrototypes:!1};o.parseValues=function(e,t){for(var n={},o=e.split(t.delimiter,t.parameterLimit===1/0?void 0:t.parameterLimit),a=0,u=o.length;u>a;++a){var i=o[a],s=-1===i.indexOf("]=")?i.indexOf("="):i.indexOf("]=")+1;if(-1===s)n[r.decode(i)]="",t.strictNullHandling&&(n[r.decode(i)]=null);else{var l=r.decode(i.slice(0,s)),c=r.decode(i.slice(s+1));Object.prototype.hasOwnProperty.call(n,l)?n[l]=[].concat(n[l]).concat(c):n[l]=c}}return n},o.parseObject=function(e,t,n){if(!e.length)return t;var r,a=e.shift();if("[]"===a)r=[],r=r.concat(o.parseObject(e,t,n));else{r=n.plainObjects?Object.create(null):{};var u="["===a[0]&&"]"===a[a.length-1]?a.slice(1,a.length-1):a,i=parseInt(u,10),s=""+i;!isNaN(i)&&a!==u&&s===u&&i>=0&&n.parseArrays&&i<=n.arrayLimit?(r=[],r[i]=o.parseObject(e,t,n)):r[u]=o.parseObject(e,t,n)}return r},o.parseKeys=function(e,t,n){if(e){n.allowDots&&(e=e.replace(/\.([^\.\[]+)/g,"[$1]"));var r=/^([^\[\]]*)/,a=/(\[[^\[\]]*\])/g,u=r.exec(e),i=[];if(u[1]){if(!n.plainObjects&&Object.prototype.hasOwnProperty(u[1])&&!n.allowPrototypes)return;i.push(u[1])}for(var s=0;null!==(u=a.exec(e))&&s<n.depth;)++s,(n.plainObjects||!Object.prototype.hasOwnProperty(u[1].replace(/\[|\]/g,""))||n.allowPrototypes)&&i.push(u[1]);return u&&i.push("["+e.slice(u.index)+"]"),o.parseObject(i,t,n)}},e.exports=function(e,t){if(t=t||{},t.delimiter="string"==typeof t.delimiter||r.isRegExp(t.delimiter)?t.delimiter:o.delimiter,t.depth="number"==typeof t.depth?t.depth:o.depth,t.arrayLimit="number"==typeof t.arrayLimit?t.arrayLimit:o.arrayLimit,t.parseArrays=t.parseArrays!==!1,t.allowDots=t.allowDots!==!1,t.plainObjects="boolean"==typeof t.plainObjects?t.plainObjects:o.plainObjects,t.allowPrototypes="boolean"==typeof t.allowPrototypes?t.allowPrototypes:o.allowPrototypes,t.parameterLimit="number"==typeof t.parameterLimit?t.parameterLimit:o.parameterLimit,t.strictNullHandling="boolean"==typeof t.strictNullHandling?t.strictNullHandling:o.strictNullHandling,""===e||null===e||"undefined"==typeof e)return t.plainObjects?Object.create(null):{};for(var n="string"==typeof e?o.parseValues(e,t):e,a=t.plainObjects?Object.create(null):{},u=Object.keys(n),i=0,s=u.length;s>i;++i){var l=u[i],c=o.parseKeys(l,n[l],t);a=r.merge(a,c,t)}return r.compact(a)}},function(e,t,n){var r=n(15),o={delimiter:"&",arrayPrefixGenerators:{brackets:function(e,t){return e+"[]"},indices:function(e,t){return e+"["+t+"]"},repeat:function(e,t){return e}},strictNullHandling:!1};o.stringify=function(e,t,n,a,u){if("function"==typeof u)e=u(t,e);else if(r.isBuffer(e))e=e.toString();else if(e instanceof Date)e=e.toISOString();else if(null===e){if(a)return r.encode(t);e=""}if("string"==typeof e||"number"==typeof e||"boolean"==typeof e)return[r.encode(t)+"="+r.encode(e)];var i=[];if("undefined"==typeof e)return i;for(var s=Array.isArray(u)?u:Object.keys(e),l=0,c=s.length;c>l;++l){var f=s[l];i=Array.isArray(e)?i.concat(o.stringify(e[f],n(t,f),n,a,u)):i.concat(o.stringify(e[f],t+"["+f+"]",n,a,u))}return i},e.exports=function(e,t){t=t||{};var n,r,a="undefined"==typeof t.delimiter?o.delimiter:t.delimiter,u="boolean"==typeof t.strictNullHandling?t.strictNullHandling:o.strictNullHandling;"function"==typeof t.filter?(r=t.filter,e=r("",e)):Array.isArray(t.filter)&&(n=r=t.filter);var i=[];if("object"!=typeof e||null===e)return"";var s;s=t.arrayFormat in o.arrayPrefixGenerators?t.arrayFormat:"indices"in t?t.indices?"indices":"repeat":"indices";var l=o.arrayPrefixGenerators[s];n||(n=Object.keys(e));for(var c=0,f=n.length;f>c;++c){var p=n[c];i=i.concat(o.stringify(e[p],p,l,u,r))}return i.join(a)}}])});
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react")):"function"==typeof define&&define.amd?define(["react"],t):"object"==typeof exports?exports.ReactRouter=t(require("react")):e.ReactRouter=t(e.React)}(this,function(e){return function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={exports:{},id:r,loaded:!1};return e[r].call(o.exports,o,o.exports,t),o.loaded=!0,o.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}t.__esModule=!0;var o=n(25),a=r(o);t.Router=a["default"];var u=n(11),i=r(u);t.Link=i["default"];var s=n(19),c=r(s);t.IndexLink=c["default"];var l=n(20),f=r(l);t.IndexRedirect=f["default"];var p=n(21),d=r(p);t.IndexRoute=d["default"];var y=n(12),h=r(y);t.Redirect=h["default"];var m=n(23),v=r(m);t.Route=v["default"];var g=n(18),b=r(g);t.History=b["default"];var O=n(22),_=r(O);t.Lifecycle=_["default"];var x=n(24),P=r(x);t.RouteContext=P["default"];var w=n(9),R=r(w);t.useRoutes=R["default"];var j=n(5);t.createRoutes=j.createRoutes;var E=n(13),k=r(E);t.RoutingContext=k["default"];var T=n(4),S=r(T);t.PropTypes=S["default"];var A=n(31),M=r(A);t.match=M["default"];var C=r(o);t["default"]=C["default"]},function(t,n){t.exports=e},function(e,t,n){"use strict";var r=function(e,t,n,r,o,a,u,i){if(!e){var s;if(void 0===t)s=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var c=[n,r,o,a,u,i],l=0;s=new Error("Invariant Violation: "+t.replace(/%s/g,function(){return c[l++]}))}throw s.framesToPop=1,s}};e.exports=r},function(e,t,n){"use strict";var r=function(){};e.exports=r},function(e,t,n){"use strict";function r(e,t,n){return e[t]?new Error("<"+n+'> should not have a "'+t+'" prop'):void 0}t.__esModule=!0,t.falsy=r;var o=n(1),a=o.PropTypes.func,u=o.PropTypes.object,i=o.PropTypes.arrayOf,s=o.PropTypes.oneOfType,c=o.PropTypes.element,l=o.PropTypes.shape,f=o.PropTypes.string,p=l({listen:a.isRequired,pushState:a.isRequired,replaceState:a.isRequired,go:a.isRequired});t.history=p;var d=l({pathname:f.isRequired,search:f.isRequired,state:u,action:f.isRequired,key:f});t.location=d;var y=s([a,f]);t.component=y;var h=s([y,u]);t.components=h;var m=s([u,c]);t.route=m;var v=s([m,i(m)]);t.routes=v,t["default"]={falsy:r,history:p,location:d,component:y,components:h,route:m}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e){return null==e||d["default"].isValidElement(e)}function a(e){return o(e)||Array.isArray(e)&&e.every(o)}function u(e,t,n){e=e||"UnknownComponent";for(var r in t)if(t.hasOwnProperty(r)){var o=t[r](n,r,e);o instanceof Error&&h["default"](!1,o.message)}}function i(e,t){return f({},e,t)}function s(e){var t=e.type,n=i(t.defaultProps,e.props);if(t.propTypes&&u(t.displayName||t.name,t.propTypes,n),n.children){var r=c(n.children,n);r.length&&(n.childRoutes=r),delete n.children}return n}function c(e,t){var n=[];return d["default"].Children.forEach(e,function(e){if(d["default"].isValidElement(e))if(e.type.createRouteFromReactElement){var r=e.type.createRouteFromReactElement(e,t);r&&n.push(r)}else n.push(s(e))}),n}function l(e){return a(e)?e=c(e):e&&!Array.isArray(e)&&(e=[e]),e}t.__esModule=!0;var f=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e};t.isReactChildren=a,t.createRouteFromReactElement=s,t.createRoutesFromReactChildren=c,t.createRoutes=l;var p=n(1),d=r(p),y=n(3),h=r(y)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function a(e){return o(e).replace(/\/+/g,"/+")}function u(e){for(var t="",n=[],r=[],o=void 0,u=0,i=/:([a-zA-Z_$][a-zA-Z0-9_$]*)|\*|\(|\)/g;o=i.exec(e);)o.index!==u&&(r.push(e.slice(u,o.index)),t+=a(e.slice(u,o.index))),o[1]?(t+="([^/?#]+)",n.push(o[1])):"*"===o[0]?(t+="([\\s\\S]*?)",n.push("splat")):"("===o[0]?t+="(?:":")"===o[0]&&(t+=")?"),r.push(o[0]),u=i.lastIndex;return u!==e.length&&(r.push(e.slice(u,e.length)),t+=a(e.slice(u,e.length))),{pattern:e,regexpSource:t,paramNames:n,tokens:r}}function i(e){return e in y||(y[e]=u(e)),y[e]}function s(e,t){var n=i(e),r=n.regexpSource,o=n.paramNames,a=n.tokens;r+="/*";var u="*"!==a[a.length-1];u&&(r+="([\\s\\S]*?)");var s=t.match(new RegExp("^"+r+"$","i")),c=void 0,l=void 0;return null!=s?(l=Array.prototype.slice.call(s,1).map(function(e){return null!=e?decodeURIComponent(e.replace(/\+/g,"%20")):e}),c=u?l.pop():t.replace(s[0],"")):c=l=null,{remainingPathname:c,paramNames:o,paramValues:l}}function c(e){return i(e).paramNames}function l(e,t){var n=s(e,t),r=n.paramNames,o=n.paramValues;return null!=o?r.reduce(function(e,t,n){return e[t]=o[n],e},{}):null}function f(e,t){t=t||{};for(var n=i(e),r=n.tokens,o=0,a="",u=0,s=void 0,c=void 0,l=void 0,f=0,p=r.length;p>f;++f)s=r[f],"*"===s?(l=Array.isArray(t.splat)?t.splat[u++]:t.splat,d["default"](null!=l||o>0,'Missing splat #%s for path "%s"',u,e),null!=l&&(a+=encodeURI(l).replace(/%20/g,"+"))):"("===s?o+=1:")"===s?o-=1:":"===s.charAt(0)?(c=s.substring(1),l=t[c],d["default"](null!=l||o>0,'Missing "%s" parameter for path "%s"',c,e),null!=l&&(a+=encodeURIComponent(l).replace(/%20/g,"+"))):a+=s;return a.replace(/\/+/g,"/")}t.__esModule=!0,t.compilePattern=i,t.matchPattern=s,t.getParamNames=c,t.getParams=l,t.formatPattern=f;var p=n(2),d=r(p),y={}},function(e,t){"use strict";t.__esModule=!0;var n="PUSH";t.PUSH=n;var r="REPLACE";t.REPLACE=r;var o="POP";t.POP=o,t["default"]={PUSH:n,REPLACE:r,POP:o}},function(e,t){"use strict";function n(e,t,n){function r(){u=!0,n.apply(this,arguments)}function o(){u||(e>a?t.call(this,a++,o,r):r.apply(this,arguments))}var a=0,u=!1;o()}function r(e,t,n){function r(e,t,r){u||(t?(u=!0,n(t)):(a[e]=r,u=++i===o,u&&n(null,a)))}var o=e.length,a=[];if(0===o)return n(null,a);var u=!1,i=0;e.forEach(function(e,n){t(e,n,function(e,t){r(n,e,t)})})}t.__esModule=!0,t.loopAsync=n,t.mapAsync=r},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}function a(e){for(var t in e)if(e.hasOwnProperty(t))return!0;return!1}function u(e){return function(){function t(e,t){var n=arguments.length<=2||void 0===arguments[2]?!1:arguments[2];return v["default"](e,t,n,j.location,j.routes,j.params)}function n(e){var t=e.pathname,n=e.query,r=e.state;return R.createLocation(R.createPath(t,n),r,l.REPLACE)}function r(e,t){E&&E.location===e?u(E,t):_["default"](P,e,function(n,r){n?t(n):r?u(i({},r,{location:e}),t):t()})}function u(e,t){var r=y["default"](j,e),o=r.leaveRoutes,a=r.enterRoutes;h.runLeaveHooks(o),h.runEnterHooks(a,e,function(r,o){r?t(r):o?t(null,n(o)):b["default"](e,function(n,r){n?t(n):t(null,null,j=i({},e,{components:r}))})})}function s(e){return e.__id__||(e.__id__=k++)}function f(e){return e.reduce(function(e,t){return e.push.apply(e,T[s(t)]),e},[])}function d(e,t){_["default"](P,e,function(n,r){if(null==r)return void t();E=i({},r,{location:e});for(var o=f(y["default"](j,r).leaveRoutes),a=void 0,u=0,s=o.length;null==a&&s>u;++u)a=o[u](e);t(a)})}function m(){if(j.routes){for(var e=f(j.routes),t=void 0,n=0,r=e.length;"string"!=typeof t&&r>n;++n)t=e[n]();return t}}function g(e,t){var n=s(e),r=T[n];if(null==r){var o=!a(T);r=T[n]=[t],o&&(S=R.listenBefore(d),R.listenBeforeUnload&&(A=R.listenBeforeUnload(m)))}else-1===r.indexOf(t)&&r.push(t);return function(){var e=T[n];if(null!=e){var r=e.filter(function(e){return e!==t});0===r.length?(delete T[n],a(T)||(S&&(S(),S=null),A&&(A(),A=null))):T[n]=r}}}function O(e){return R.listen(function(t){j.location===t?e(null,j):r(t,function(n,r,o){n?e(n):r?R.transitionTo(r):o?e(null,o):c["default"](!1,'Location "%s" did not match any routes',t.pathname+t.search+t.hash)})})}var x=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],P=x.routes,w=o(x,["routes"]),R=p["default"](e)(w),j={},E=void 0,k=1,T={},S=void 0,A=void 0;return i({},R,{isActive:t,match:r,listenBeforeLeavingRoute:g,listen:O})}}t.__esModule=!0;var i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},s=n(3),c=r(s),l=n(7),f=n(43),p=r(f),d=n(27),y=r(d),h=n(26),m=n(30),v=r(m),g=n(28),b=r(g),O=n(32),_=r(O);t["default"]=u,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e,t,n){var r=e(t,n);e.length<2?n(r):u["default"](void 0===r,'You should not "return" in a transition hook with a callback argument; call the callback instead')}t.__esModule=!0;var a=n(3),u=r(a);t["default"]=o,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function i(e){return 0===e.button}function s(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function c(e){for(var t in e)if(e.hasOwnProperty(t))return!1;return!0}t.__esModule=!0;var l=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},f=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),p=n(1),d=r(p),y=d["default"].PropTypes,h=y.bool,m=y.object,v=y.string,g=y.func,b=function(e){function t(){a(this,t),e.apply(this,arguments)}return u(t,e),t.prototype.handleClick=function(e){var t=!0,n=void 0;this.props.onClick&&(n=this.props.onClick(e)),!s(e)&&i(e)&&((n===!1||e.defaultPrevented===!0)&&(t=!1),e.preventDefault(),t&&this.context.history.pushState(this.props.state,this.props.to,this.props.query))},t.prototype.render=function(){var e=this,t=this.props,n=t.to,r=t.query,a=t.hash,u=(t.state,t.activeClassName),i=t.activeStyle,s=t.onlyActiveOnIndex,f=o(t,["to","query","hash","state","activeClassName","activeStyle","onlyActiveOnIndex"]);f.onClick=function(t){return e.handleClick(t)};var p=this.context.history;return p&&(f.href=p.createHref(n,r),a&&(f.href+=a),(u||null!=i&&!c(i))&&p.isActive(n,r,s)&&(u&&(f.className+=""===f.className?u:" "+u),i&&(f.style=l({},f.style,i)))),d["default"].createElement("a",f)},f(t,null,[{key:"contextTypes",value:{history:m},enumerable:!0},{key:"propTypes",value:{to:v.isRequired,query:m,hash:v,state:m,activeStyle:m,activeClassName:v,onlyActiveOnIndex:h.isRequired,onClick:g},enumerable:!0},{key:"defaultProps",value:{onlyActiveOnIndex:!1,className:"",style:{}},enumerable:!0}]),t}(d["default"].Component);t["default"]=b,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}t.__esModule=!0;var u=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=n(1),s=r(i),c=n(2),l=r(c),f=n(5),p=n(6),d=n(4),y=s["default"].PropTypes,h=y.string,m=y.object,v=function(e){function t(){o(this,t),e.apply(this,arguments)}return a(t,e),t.createRouteFromReactElement=function(e){var n=f.createRouteFromReactElement(e);return n.from&&(n.path=n.from),n.onEnter=function(e,r){var o=e.location,a=e.params,u=void 0;if("/"===n.to.charAt(0))u=p.formatPattern(n.to,a);else if(n.to){var i=e.routes.indexOf(n),s=t.getRoutePattern(e.routes,i-1),c=s.replace(/\/*$/,"/")+n.to;u=p.formatPattern(c,a)}else u=o.pathname;r(n.state||o.state,u,n.query||o.query)},n},t.getRoutePattern=function(e,t){for(var n="",r=t;r>=0;r--){var o=e[r],a=o.path||"";if(n=a.replace(/\/*$/,"/")+n,0===a.indexOf("/"))break}return"/"+n},t.prototype.render=function(){l["default"](!1,"<Redirect> elements are for router configuration only and should not be rendered")},u(t,null,[{key:"propTypes",value:{path:h,from:h,to:h.isRequired,query:m,state:m,onEnter:d.falsy,children:d.falsy},enumerable:!0}]),t}(s["default"].Component);t["default"]=v,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}t.__esModule=!0;var u=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=n(1),s=r(i),c=n(2),l=r(c),f=n(29),p=r(f),d=s["default"].PropTypes,y=d.array,h=d.func,m=d.object,v=function(e){function t(){o(this,t),e.apply(this,arguments)}return a(t,e),t.prototype.getChildContext=function(){return{history:this.props.history,location:this.props.location}},t.prototype.createElement=function(e,t){return null==e?null:this.props.createElement(e,t)},t.prototype.render=function(){var e=this,t=this.props,n=t.history,r=t.location,o=t.routes,a=t.params,u=t.components,i=null;return u&&(i=u.reduceRight(function(t,u,i){if(null==u)return t;var s=o[i],c=p["default"](s,a),l={history:n,location:r,params:a,route:s,routeParams:c,routes:o};if(t&&(l.children=t),"object"==typeof u){var f={};for(var d in u)u.hasOwnProperty(d)&&(f[d]=e.createElement(u[d],l));return f}return e.createElement(u,l)},i)),l["default"](null===i||i===!1||s["default"].isValidElement(i),"The root route must render a single element"),i},u(t,null,[{key:"propTypes",value:{history:m.isRequired,createElement:h.isRequired,location:m.isRequired,routes:y.isRequired,params:m.isRequired,components:y.isRequired},enumerable:!0},{key:"defaultProps",value:{createElement:s["default"].createElement},enumerable:!0},{key:"childContextTypes",value:{history:m.isRequired,location:m.isRequired},enumerable:!0}]),t}(s["default"].Component);t["default"]=v,e.exports=t["default"]},function(e,t){"use strict";function n(e,t,n){e.addEventListener?e.addEventListener(t,n,!1):e.attachEvent("on"+t,n)}function r(e,t,n){e.removeEventListener?e.removeEventListener(t,n,!1):e.detachEvent("on"+t,n)}function o(){return window.location.href.split("#")[1]||""}function a(e){window.location.replace(window.location.pathname+window.location.search+"#"+e)}function u(){return window.location.pathname+window.location.search+window.location.hash}function i(e){e&&window.history.go(e)}function s(e,t){t(window.confirm(e))}function c(){var e=navigator.userAgent;return-1===e.indexOf("Android 2.")&&-1===e.indexOf("Android 4.0")||-1===e.indexOf("Mobile Safari")||-1!==e.indexOf("Chrome")||-1!==e.indexOf("Windows Phone")?window.history&&"pushState"in window.history:!1}function l(){var e=navigator.userAgent;return-1===e.indexOf("Firefox")}t.__esModule=!0,t.addEventListener=n,t.removeEventListener=r,t.getHashPath=o,t.replaceHashPath=a,t.getWindowPath=u,t.go=i,t.getUserConfirmation=s,t.supportsHistory=c,t.supportsGoWithoutReloadUsingHash=l},function(e,t){"use strict";t.__esModule=!0;var n=!("undefined"==typeof window||!window.document||!window.document.createElement);t.canUseDOM=n},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e){return Math.random().toString(36).substr(2,e)}function a(e){var t=e.match(/^https?:\/\/[^\/]*/);return null==t?e:(l["default"](!1,'Location path must be pathname + query string only, not a fully qualified URL like "%s"',e),e.substring(t[0].length))}function u(e,t){return e.pathname===t.pathname&&e.search===t.search&&e.key===t.key&&p["default"](e.state,t.state)}function i(){function e(e){return L.push(e),function(){L=L.filter(function(t){return t!==e})}}function t(){return U&&U.action===y.POP?H.indexOf(U.key):N?H.indexOf(N.key):-1}function n(e){var n=t();N=e,N.action===y.PUSH?H=[].concat(H.slice(0,n+1),[N.key]):N.action===y.REPLACE&&(H[n]=N.key),q.forEach(function(e){e(N)})}function r(e){if(q.push(e),N)e(N);else{var t=k();H=[t.key],n(t)}return function(){q=q.filter(function(t){return t!==e})}}function i(e,t){d.loopAsync(L.length,function(t,n,r){m["default"](L[t],e,function(e){null!=e?r(e):n()})},function(e){C&&"string"==typeof e?C(e,function(e){t(e!==!1)}):t(e!==!1)})}function c(e){N&&u(N,e)||(U=e,i(e,function(t){if(U===e)if(t)T(e),n(e);else if(N&&e.action===y.POP){var r=H.indexOf(N.key),o=H.indexOf(e.key);-1!==r&&-1!==o&&A(r-o)}}))}function l(e,t){c(x(t,e,y.PUSH,v()))}function f(e,t){c(x(t,e,y.REPLACE,v()))}function p(){A(-1)}function h(){A(1)}function v(){return o(M)}function O(e){return e}function _(e){return e}function x(){var e=arguments.length<=0||void 0===arguments[0]?"/":arguments[0],t=arguments.length<=1||void 0===arguments[1]?null:arguments[1],n=arguments.length<=2||void 0===arguments[2]?y.POP:arguments[2],r=arguments.length<=3||void 0===arguments[3]?v():arguments[3],o=a(e),u="",i="",s=o.indexOf("#");-1!==s&&(i=o.substring(s),o=o.substring(0,s));var c=o.indexOf("?");return-1!==c&&(u=o.substring(c),o=o.substring(0,c)),""===o&&(o="/"),{pathname:o,search:u,hash:i,state:t,action:n,key:r}}function P(e){N?(w(N,e),n(N)):w(k(),e)}function w(e,t){e.state=s({},e.state,t),S(e.key,e.state)}function R(e){-1===L.indexOf(e)&&L.push(e)}function j(e){L=L.filter(function(t){return t!==e})}var E=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],k=E.getCurrentLocation,T=E.finishTransition,S=E.saveState,A=E.go,M=E.keyLength,C=E.getUserConfirmation;"number"!=typeof M&&(M=b);var L=[],H=[],q=[],N=void 0,U=void 0;return{listenBefore:e,listen:r,transitionTo:c,pushState:l,replaceState:f,go:A,goBack:p,goForward:h,createKey:v,createPath:O,createHref:_,createLocation:x,setState:g["default"](P,"setState is deprecated; use location.key to save state instead"),registerTransitionHook:g["default"](R,"registerTransitionHook is deprecated; use listenBefore instead"),unregisterTransitionHook:g["default"](j,"unregisterTransitionHook is deprecated; use the callback returned from listenBefore instead")}}t.__esModule=!0;var s=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},c=n(3),l=r(c),f=n(33),p=r(f),d=n(36),y=n(7),h=n(10),m=r(h),v=n(41),g=r(v),b=6;t["default"]=i,e.exports=t["default"]},function(e,t){var n={};n.hexTable=new Array(256);for(var r=0;256>r;++r)n.hexTable[r]="%"+((16>r?"0":"")+r.toString(16)).toUpperCase();t.arrayToObject=function(e,t){for(var n=t.plainObjects?Object.create(null):{},r=0,o=e.length;o>r;++r)"undefined"!=typeof e[r]&&(n[r]=e[r]);return n},t.merge=function(e,n,r){if(!n)return e;if("object"!=typeof n)return Array.isArray(e)?e.push(n):"object"==typeof e?e[n]=!0:e=[e,n],e;if("object"!=typeof e)return e=[e].concat(n);Array.isArray(e)&&!Array.isArray(n)&&(e=t.arrayToObject(e,r));for(var o=Object.keys(n),a=0,u=o.length;u>a;++a){var i=o[a],s=n[i];Object.prototype.hasOwnProperty.call(e,i)?e[i]=t.merge(e[i],s,r):e[i]=s}return e},t.decode=function(e){try{return decodeURIComponent(e.replace(/\+/g," "))}catch(t){return e}},t.encode=function(e){if(0===e.length)return e;"string"!=typeof e&&(e=""+e);for(var t="",r=0,o=e.length;o>r;++r){var a=e.charCodeAt(r);45===a||46===a||95===a||126===a||a>=48&&57>=a||a>=65&&90>=a||a>=97&&122>=a?t+=e[r]:128>a?t+=n.hexTable[a]:2048>a?t+=n.hexTable[192|a>>6]+n.hexTable[128|63&a]:55296>a||a>=57344?t+=n.hexTable[224|a>>12]+n.hexTable[128|a>>6&63]+n.hexTable[128|63&a]:(++r,a=65536+((1023&a)<<10|1023&e.charCodeAt(r)),t+=n.hexTable[240|a>>18]+n.hexTable[128|a>>12&63]+n.hexTable[128|a>>6&63]+n.hexTable[128|63&a])}return t},t.compact=function(e,n){if("object"!=typeof e||null===e)return e;n=n||[];var r=n.indexOf(e);if(-1!==r)return n[r];if(n.push(e),Array.isArray(e)){for(var o=[],a=0,u=e.length;u>a;++a)"undefined"!=typeof e[a]&&o.push(e[a]);return o}var i=Object.keys(e);for(a=0,u=i.length;u>a;++a){var s=i[a];e[s]=t.compact(e[s],n)}return e},t.isRegExp=function(e){return"[object RegExp]"===Object.prototype.toString.call(e)},t.isBuffer=function(e){return null===e||"undefined"==typeof e?!1:!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))}},function(e,t,n){"use strict";t.__esModule=!0;var r=n(4),o={contextTypes:{history:r.history},componentWillMount:function(){this.history=this.context.history}};t["default"]=o,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}t.__esModule=!0;var u=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},i=n(1),s=r(i),c=n(11),l=r(c),f=function(e){function t(){o(this,t),e.apply(this,arguments)}return a(t,e),t.prototype.render=function(){return s["default"].createElement(l["default"],u({},this.props,{onlyActiveOnIndex:!0}))},t}(s["default"].Component);t["default"]=f,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}t.__esModule=!0;var u=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=n(1),s=r(i),c=n(2),l=r(c),f=n(3),p=r(f),d=n(12),y=r(d),h=n(4),m=s["default"].PropTypes,v=m.string,g=m.object,b=function(e){function t(){o(this,t),e.apply(this,arguments)}return a(t,e),t.createRouteFromReactElement=function(e,t){t?t.indexRoute=y["default"].createRouteFromReactElement(e):p["default"](!1,"An <IndexRedirect> does not make sense at the root of your route config")},t.prototype.render=function(){l["default"](!1,"<IndexRedirect> elements are for router configuration only and should not be rendered")},u(t,null,[{key:"propTypes",value:{to:v.isRequired,query:g,state:g,onEnter:h.falsy,children:h.falsy},enumerable:!0}]),t}(s["default"].Component);t["default"]=b,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}t.__esModule=!0;var u=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=n(1),s=r(i),c=n(2),l=r(c),f=n(3),p=r(f),d=n(5),y=n(4),h=s["default"].PropTypes,m=h.bool,v=h.func,g=function(e){function t(){o(this,t),e.apply(this,arguments)}return a(t,e),t.createRouteFromReactElement=function(e,t){t?t.indexRoute=d.createRouteFromReactElement(e):p["default"](!1,"An <IndexRoute> does not make sense at the root of your route config")},t.prototype.render=function(){l["default"](!1,"<IndexRoute> elements are for router configuration only and should not be rendered")},u(t,null,[{key:"propTypes",value:{path:y.falsy,ignoreScrollBehavior:m,component:y.component,components:y.components,getComponents:v},enumerable:!0}]),t}(s["default"].Component);t["default"]=g,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}t.__esModule=!0;var o=n(1),a=r(o),u=n(2),i=r(u),s=a["default"].PropTypes.object,c={contextTypes:{history:s.isRequired,route:s},propTypes:{route:s},componentDidMount:function(){i["default"](this.routerWillLeave,"The Lifecycle mixin requires you to define a routerWillLeave method");var e=this.props.route||this.context.route;i["default"](e,"The Lifecycle mixin must be used on either a) a <Route component> or b) a descendant of a <Route component> that uses the RouteContext mixin"),this._unlistenBeforeLeavingRoute=this.context.history.listenBeforeLeavingRoute(e,this.routerWillLeave)},componentWillUnmount:function(){this._unlistenBeforeLeavingRoute&&this._unlistenBeforeLeavingRoute()}};t["default"]=c,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}t.__esModule=!0;var u=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=n(1),s=r(i),c=n(3),l=r(c),f=n(2),p=r(f),d=n(5),y=n(4),h=s["default"].PropTypes,m=h.string,v=h.bool,g=h.func,b=function(e){function t(){o(this,t),e.apply(this,arguments)}return a(t,e),t.createRouteFromReactElement=function(e){var t=d.createRouteFromReactElement(e);return t.handler&&(l["default"](!1,"<Route handler> is deprecated, use <Route component> instead"),t.component=t.handler,delete t.handler),t},t.prototype.render=function(){p["default"](!1,"<Route> elements are for router configuration only and should not be rendered")},u(t,null,[{key:"propTypes",value:{path:m,ignoreScrollBehavior:v,handler:y.component,component:y.component,components:y.components,getComponents:g},enumerable:!0}]),t}(s["default"].Component);t["default"]=b,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}t.__esModule=!0;var o=n(1),a=r(o),u=a["default"].PropTypes.object,i={propTypes:{route:u.isRequired},childContextTypes:{route:u.isRequired},getChildContext:function(){return{route:this.props.route}}};t["default"]=i,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}t.__esModule=!0;var u=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=n(1),s=r(i),c=n(3),l=r(c),f=n(39),p=r(f),d=n(5),y=n(13),h=r(y),m=n(9),v=r(m),g=n(4),b=s["default"].PropTypes,O=b.func,_=b.object,x=function(e){function t(n,r){o(this,t),e.call(this,n,r),this.state={location:null,routes:null,params:null,components:null}}return a(t,e),u(t,null,[{key:"propTypes",value:{history:_,children:g.routes,routes:g.routes,createElement:O,onError:O,onUpdate:O,parseQueryString:O,stringifyQuery:O},enumerable:!0}]),t.prototype.handleError=function(e){if(!this.props.onError)throw e;this.props.onError.call(this,e)},t.prototype.componentWillMount=function(){var e=this,t=this.props,n=t.history,r=t.children,o=t.routes,a=t.parseQueryString,u=t.stringifyQuery,i=n?function(){return n}:p["default"];this.history=v["default"](i)({routes:d.createRoutes(o||r),parseQueryString:a,stringifyQuery:u}),this._unlisten=this.history.listen(function(t,n){t?e.handleError(t):e.setState(n,e.props.onUpdate)})},t.prototype.componentWillReceiveProps=function(e){l["default"](e.history===this.props.history,"You cannot change <Router history>; it will be ignored")},t.prototype.componentWillUnmount=function(){this._unlisten&&this._unlisten()},t.prototype.render=function(){var e=this.state,t=e.location,n=e.routes,r=e.params,o=e.components,a=this.props.createElement;return null==t?null:s["default"].createElement(h["default"],{history:this.history,createElement:a,location:t,routes:n,params:r,components:o})},t}(s["default"].Component);t["default"]=x,e.exports=t["default"]},function(e,t,n){"use strict";function r(e,t){return function(n,r,o){e.apply(t,arguments),e.length<3&&o()}}function o(e){return e.reduce(function(e,t){return t.onEnter&&e.push(r(t.onEnter,t)),e},[])}function a(e,t,n){function r(e,t,n){u={pathname:t,query:n,state:e}}var a=o(e);if(!a.length)return void n();var u=void 0;i.loopAsync(a.length,function(e,n,o){a[e](t,r,function(e){e||u?o(e,u):n()})},n)}function u(e){for(var t=0,n=e.length;n>t;++t)e[t].onLeave&&e[t].onLeave.call(e[t])}t.__esModule=!0,t.runEnterHooks=a,t.runLeaveHooks=u;var i=n(8)},function(e,t,n){"use strict";function r(e,t,n){if(!e.path)return!1;var r=u.getParamNames(e.path);return r.some(function(e){return t.params[e]!==n.params[e]})}function o(e,t){return e.location.search!==t.location.search}function a(e,t){var n=e&&e.routes,a=t.routes,u=void 0,i=void 0;return n?(u=n.filter(function(n){return-1===a.indexOf(n)||r(n,e,t)||o(e,t)}),u.reverse(),i=a.filter(function(e){return-1===n.indexOf(e)||-1!==u.indexOf(e)})):(u=[],i=a),{leaveRoutes:u,enterRoutes:i}}t.__esModule=!0;var u=n(6);t["default"]=a,e.exports=t["default"]},function(e,t,n){"use strict";function r(e,t,n){t.component||t.components?n(null,t.component||t.components):t.getComponent?t.getComponent(e,n):t.getComponents?t.getComponents(e,n):n()}function o(e,t){a.mapAsync(e.routes,function(t,n,o){r(e.location,t,o)},t)}t.__esModule=!0;var a=n(8);t["default"]=o,e.exports=t["default"]},function(e,t,n){"use strict";function r(e,t){var n={};if(!e.path)return n;var r=o.getParamNames(e.path);for(var a in t)t.hasOwnProperty(a)&&-1!==r.indexOf(a)&&(n[a]=t[a]);return n}t.__esModule=!0;
var o=n(6);t["default"]=r,e.exports=t["default"]},function(e,t,n){"use strict";function r(e,t){if(e==t)return!0;if(null==e||null==t)return!1;if(Array.isArray(e))return Array.isArray(t)&&e.length===t.length&&e.every(function(e,n){return r(e,t[n])});if("object"==typeof e){for(var n in e)if(e.hasOwnProperty(n)&&(!t.hasOwnProperty(n)||!r(e[n],t[n])))return!1;return!0}return String(e)===String(t)}function o(e,t,n){return e.every(function(e,r){return String(t[r])===String(n[e])})}function a(e,t,n){for(var r=void 0,a=void 0,u="",i=0,s=t.length;s>i;++i){r=t[i],a=r.path||"","/"!==a.charAt(0)&&(a=u.replace(/\/*$/,"/")+a);var l=c.matchPattern(a,e),f=l.remainingPathname,p=l.paramNames,d=l.paramValues;if(""===f&&o(p,d,n))return r;u=a}return null}function u(e,t,n,r){var o=a(e,t,n);return null==o?!1:r?t.length>1&&t[t.length-1]===o.indexRoute:!0}function i(e,t){return null==t?null==e:null==e?!0:r(e,t)}function s(e,t,n,r,o,a){return null==r?!1:u(e,o,a,n)?i(t,r.query):!1}t.__esModule=!0;var c=n(6);t["default"]=s,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){var n=e.routes,r=e.location,o=e.parseQueryString,u=e.stringifyQuery,s=e.basename;i["default"](r,"match needs a location");var c=h({routes:p.createRoutes(n),parseQueryString:o,stringifyQuery:u,basename:s});"string"==typeof r&&(r=c.createLocation(r)),c.match(r,function(e,n,r){t(e,n,r&&a({},r,{history:c}))})}t.__esModule=!0;var a=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},u=n(2),i=r(u),s=n(40),c=r(s),l=n(42),f=r(l),p=n(5),d=n(9),y=r(d),h=y["default"](f["default"](c["default"]));t["default"]=o,e.exports=t["default"]},function(e,t,n){"use strict";function r(e,t,n){e.childRoutes?n(null,e.childRoutes):e.getChildRoutes?e.getChildRoutes(t,function(e,t){n(e,!e&&f.createRoutes(t))}):n()}function o(e,t,n){e.indexRoute?n(null,e.indexRoute):e.getIndexRoute?e.getIndexRoute(t,function(e,t){n(e,!e&&f.createRoutes(t)[0])}):n()}function a(e,t,n){return t.reduceRight(function(e,t,r){var o=n&&n[r];return Array.isArray(e[t])?e[t].unshift(o):t in e?e[t]=[o,e[t]]:e[t]=o,e},e)}function u(e,t){return a({},e,t)}function i(e,t,n,a){var i=t.path||"";"/"!==i.charAt(0)&&(i=e.replace(/\/*$/,"/")+i);var c=l.matchPattern(i,n.pathname),f=c.remainingPathname,p=c.paramNames,d=c.paramValues,y=""===f;y&&t.path?!function(){var e={routes:[t],params:u(p,d)};o(t,n,function(t,n){t?a(t):(n&&e.routes.push(n),a(null,e))})}():null!=f||t.childRoutes?r(t,n,function(e,r){e?a(e):r?s(r,n,function(e,n){e?a(e):n?(n.routes.unshift(t),a(null,n)):a()},i):a()}):a()}function s(e,t,n){var r=arguments.length<=3||void 0===arguments[3]?"":arguments[3];c.loopAsync(e.length,function(n,o,a){i(r,e[n],t,function(e,t){e||t?a(e,t):o()})},n)}t.__esModule=!0;var c=n(8),l=n(6),f=n(5);t["default"]=s,e.exports=t["default"]},function(e,t,n){function r(e){return null===e||void 0===e}function o(e){return e&&"object"==typeof e&&"number"==typeof e.length?"function"!=typeof e.copy||"function"!=typeof e.slice?!1:e.length>0&&"number"!=typeof e[0]?!1:!0:!1}function a(e,t,n){var a,l;if(r(e)||r(t))return!1;if(e.prototype!==t.prototype)return!1;if(s(e))return s(t)?(e=u.call(e),t=u.call(t),c(e,t,n)):!1;if(o(e)){if(!o(t))return!1;if(e.length!==t.length)return!1;for(a=0;a<e.length;a++)if(e[a]!==t[a])return!1;return!0}try{var f=i(e),p=i(t)}catch(d){return!1}if(f.length!=p.length)return!1;for(f.sort(),p.sort(),a=f.length-1;a>=0;a--)if(f[a]!=p[a])return!1;for(a=f.length-1;a>=0;a--)if(l=f[a],!c(e[l],t[l],n))return!1;return typeof e==typeof t}var u=Array.prototype.slice,i=n(35),s=n(34),c=e.exports=function(e,t,n){return n||(n={}),e===t?!0:e instanceof Date&&t instanceof Date?e.getTime()===t.getTime():!e||!t||"object"!=typeof e&&"object"!=typeof t?n.strict?e===t:e==t:a(e,t,n)}},function(e,t){function n(e){return"[object Arguments]"==Object.prototype.toString.call(e)}function r(e){return e&&"object"==typeof e&&"number"==typeof e.length&&Object.prototype.hasOwnProperty.call(e,"callee")&&!Object.prototype.propertyIsEnumerable.call(e,"callee")||!1}var o="[object Arguments]"==function(){return Object.prototype.toString.call(arguments)}();t=e.exports=o?n:r,t.supported=n,t.unsupported=r},function(e,t){function n(e){var t=[];for(var n in e)t.push(n);return t}t=e.exports="function"==typeof Object.keys?Object.keys:n,t.shim=n},function(e,t){"use strict";function n(e,t,n){function r(){u=!0,n.apply(this,arguments)}function o(){u||(e>a?t.call(this,a++,o,r):r.apply(this,arguments))}var a=0,u=!1;o()}t.__esModule=!0,t.loopAsync=n},function(e,t){"use strict";function n(e){return a+e}function r(e,t){window.sessionStorage.setItem(n(e),JSON.stringify(t))}function o(e){var t=window.sessionStorage.getItem(n(e));if(t)try{return JSON.parse(t)}catch(r){}return null}t.__esModule=!0,t.saveState=r,t.readState=o;var a="@@History/"},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e){function t(e){return i["default"](s.canUseDOM,"DOM history needs a DOM"),n.listen(e)}var n=f["default"](a({getUserConfirmation:c.getUserConfirmation},e,{go:c.go}));return a({},n,{listen:t})}t.__esModule=!0;var a=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},u=n(2),i=r(u),s=n(15),c=n(14),l=n(16),f=r(l);t["default"]=o,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e){return"string"==typeof e&&"/"===e.charAt(0)}function a(){var e=v.getHashPath();return o(e)?!0:(v.replaceHashPath("/"+e),!1)}function u(e,t,n){return e+(-1===e.indexOf("?")?"?":"&")+(t+"="+n)}function i(e,t){return e.replace(new RegExp("[?&]?"+t+"=[a-zA-Z0-9]+"),"")}function s(e,t){var n=e.match(new RegExp("\\?.*?\\b"+t+"=(.+?)\\b"));return n&&n[1]}function c(){function e(){var e=v.getHashPath(),t=void 0,n=void 0;return x?(t=s(e,x),e=i(e,x),t?n=g.readState(t):(n=null,t=P.createKey(),v.replaceHashPath(u(e,x,t)))):t=n=null,P.createLocation(e,n,void 0,t)}function t(t){function n(){a()&&r(e())}var r=t.transitionTo;return a(),v.addEventListener(window,"hashchange",n),function(){v.removeEventListener(window,"hashchange",n)}}function n(e){var t=e.basename,n=e.pathname,r=e.search,o=e.state,a=e.action,i=e.key;if(a!==h.POP){var s=(t||"")+n+r;x&&(s=u(s,x,i)),s===v.getHashPath()?p["default"](!1,"You cannot %s the same path using hash history",a):(x?g.saveState(i,o):e.key=e.state=null,a===h.PUSH?window.location.hash=s:v.replaceHashPath(s))}}function r(e){1===++w&&(R=t(P));var n=P.listen(e);return function(){n(),0===--w&&R()}}function o(e,t){p["default"](x||null==e,"You cannot use state without a queryKey it will be dropped"),P.pushState(e,t)}function c(e,t){p["default"](x||null==e,"You cannot use state without a queryKey it will be dropped"),P.replaceState(e,t)}function f(e){p["default"](j,"Hash history go(n) causes a full page reload in this browser"),P.go(e)}function d(e){return"#"+P.createHref(e)}var b=arguments.length<=0||void 0===arguments[0]?{}:arguments[0];y["default"](m.canUseDOM,"Hash history needs a DOM");var x=b.queryKey;(void 0===x||x)&&(x="string"==typeof x?x:_);var P=O["default"](l({},b,{getCurrentLocation:e,finishTransition:n,saveState:g.saveState})),w=0,R=void 0,j=v.supportsGoWithoutReloadUsingHash();return l({},P,{listen:r,pushState:o,replaceState:c,go:f,createHref:d})}t.__esModule=!0;var l=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},f=n(3),p=r(f),d=n(2),y=r(d),h=n(7),m=n(15),v=n(14),g=n(37),b=n(38),O=r(b),_="_k";t["default"]=c,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e){return e.filter(function(e){return e.state}).reduce(function(e,t){return e[t.key]=t.state,e},{})}function a(){function e(e,t){m[e]=t}function t(e){return m[e]}function n(){var e=y[h],n=e.key,r=e.basename,o=e.pathname,a=e.search,u=(r||"")+o+(a||""),i=void 0;return n?i=t(n):(i=null,n=p.createKey(),e.key=n),p.createLocation(u,i,void 0,n)}function r(e){var t=h+e;return t>=0&&t<y.length}function a(e){if(e){s["default"](r(e),"Cannot go(%s) there is not enough history",e),h+=e;var t=n();p.transitionTo(u({},t,{action:c.POP}))}}function i(t){switch(t.action){case c.PUSH:h+=1,h<y.length&&y.splice(h),y.push(t),e(t.key,t.state);break;case c.REPLACE:y[h]=t,e(t.key,t.state)}}var l=arguments.length<=0||void 0===arguments[0]?{}:arguments[0];Array.isArray(l)?l={entries:l}:"string"==typeof l&&(l={entries:[l]});var p=f["default"](u({},l,{getCurrentLocation:n,finishTransition:i,saveState:e,go:a})),d=l,y=d.entries,h=d.current;"string"==typeof y?y=[y]:Array.isArray(y)||(y=["/"]),y=y.map(function(e){var t=p.createKey();return"string"==typeof e?{pathname:e,key:t}:"object"==typeof e&&e?u({},e,{key:t}):void s["default"](!1,"Unable to create history entry from %s",e)}),null==h?h=y.length-1:s["default"](h>=0&&h<y.length,"Current index must be >= 0 and < %s, was %s",y.length,h);var m=o(y);return p}t.__esModule=!0;var u=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},i=n(2),s=r(i),c=n(7),l=n(16),f=r(l);t["default"]=a,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){return function(){return u["default"](!1,t),e.apply(this,arguments)}}t.__esModule=!0;var a=n(3),u=r(a);t["default"]=o,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}function a(e){return function(){function t(e){return y&&null==e.basename&&(0===e.pathname.indexOf(y)?(e.pathname=e.pathname.substring(y.length),e.basename=y,""===e.pathname&&(e.pathname="/")):e.basename=""),e}function n(e){return y?y+e:e}function r(e){return m.listenBefore(function(n,r){s["default"](e,t(n),r)})}function a(e){return m.listen(function(n){e(t(n))})}function i(e,t){m.pushState(e,n(t))}function c(e,t){m.replaceState(e,n(t))}function l(e){return m.createPath(n(e))}function f(e){return m.createHref(n(e))}function p(){return t(m.createLocation.apply(m,arguments))}var d=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],y=d.basename,h=o(d,["basename"]),m=e(h);return u({},m,{listenBefore:r,listen:a,pushState:i,replaceState:c,createPath:l,createHref:f,createLocation:p})}}t.__esModule=!0;var u=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},i=n(10),s=r(i);t["default"]=a,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}function a(e){return l["default"].stringify(e,{arrayFormat:"brackets"})}function u(e){return l["default"].parse(e)}function i(e){return function(){function t(e){return null==e.query&&(e.query=v(e.search.substring(1))),e}function n(e,t){var n=void 0;return t&&""!==(n=m(t))?e+(-1===e.indexOf("?")?"?":"&")+n:e}function r(e){return b.listenBefore(function(n,r){p["default"](e,t(n),r)})}function i(e){return b.listen(function(n){e(t(n))})}function c(e,t,r){return b.pushState(e,n(t,r))}function l(e,t,r){return b.replaceState(e,n(t,r))}function f(e,t){return b.createPath(n(e,t))}function d(e,t){return b.createHref(n(e,t))}function y(){return t(b.createLocation.apply(b,arguments))}var h=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],m=h.stringifyQuery,v=h.parseQueryString,g=o(h,["stringifyQuery","parseQueryString"]),b=e(g);return"function"!=typeof m&&(m=a),"function"!=typeof v&&(v=u),s({},b,{listenBefore:r,listen:i,pushState:c,replaceState:l,createPath:f,createHref:d,createLocation:y})}}t.__esModule=!0;var s=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},c=n(44),l=r(c),f=n(10),p=r(f);t["default"]=i,e.exports=t["default"]},function(e,t,n){var r=n(46),o=n(45);e.exports={stringify:r,parse:o}},function(e,t,n){var r=n(17),o={delimiter:"&",depth:5,arrayLimit:20,parameterLimit:1e3,strictNullHandling:!1,plainObjects:!1,allowPrototypes:!1};o.parseValues=function(e,t){for(var n={},o=e.split(t.delimiter,t.parameterLimit===1/0?void 0:t.parameterLimit),a=0,u=o.length;u>a;++a){var i=o[a],s=-1===i.indexOf("]=")?i.indexOf("="):i.indexOf("]=")+1;if(-1===s)n[r.decode(i)]="",t.strictNullHandling&&(n[r.decode(i)]=null);else{var c=r.decode(i.slice(0,s)),l=r.decode(i.slice(s+1));Object.prototype.hasOwnProperty.call(n,c)?n[c]=[].concat(n[c]).concat(l):n[c]=l}}return n},o.parseObject=function(e,t,n){if(!e.length)return t;var r,a=e.shift();if("[]"===a)r=[],r=r.concat(o.parseObject(e,t,n));else{r=n.plainObjects?Object.create(null):{};var u="["===a[0]&&"]"===a[a.length-1]?a.slice(1,a.length-1):a,i=parseInt(u,10),s=""+i;!isNaN(i)&&a!==u&&s===u&&i>=0&&n.parseArrays&&i<=n.arrayLimit?(r=[],r[i]=o.parseObject(e,t,n)):r[u]=o.parseObject(e,t,n)}return r},o.parseKeys=function(e,t,n){if(e){n.allowDots&&(e=e.replace(/\.([^\.\[]+)/g,"[$1]"));var r=/^([^\[\]]*)/,a=/(\[[^\[\]]*\])/g,u=r.exec(e),i=[];if(u[1]){if(!n.plainObjects&&Object.prototype.hasOwnProperty(u[1])&&!n.allowPrototypes)return;i.push(u[1])}for(var s=0;null!==(u=a.exec(e))&&s<n.depth;)++s,(n.plainObjects||!Object.prototype.hasOwnProperty(u[1].replace(/\[|\]/g,""))||n.allowPrototypes)&&i.push(u[1]);return u&&i.push("["+e.slice(u.index)+"]"),o.parseObject(i,t,n)}},e.exports=function(e,t){if(t=t||{},t.delimiter="string"==typeof t.delimiter||r.isRegExp(t.delimiter)?t.delimiter:o.delimiter,t.depth="number"==typeof t.depth?t.depth:o.depth,t.arrayLimit="number"==typeof t.arrayLimit?t.arrayLimit:o.arrayLimit,t.parseArrays=t.parseArrays!==!1,t.allowDots=t.allowDots!==!1,t.plainObjects="boolean"==typeof t.plainObjects?t.plainObjects:o.plainObjects,t.allowPrototypes="boolean"==typeof t.allowPrototypes?t.allowPrototypes:o.allowPrototypes,t.parameterLimit="number"==typeof t.parameterLimit?t.parameterLimit:o.parameterLimit,t.strictNullHandling="boolean"==typeof t.strictNullHandling?t.strictNullHandling:o.strictNullHandling,""===e||null===e||"undefined"==typeof e)return t.plainObjects?Object.create(null):{};for(var n="string"==typeof e?o.parseValues(e,t):e,a=t.plainObjects?Object.create(null):{},u=Object.keys(n),i=0,s=u.length;s>i;++i){var c=u[i],l=o.parseKeys(c,n[c],t);a=r.merge(a,l,t)}return r.compact(a)}},function(e,t,n){var r=n(17),o={delimiter:"&",arrayPrefixGenerators:{brackets:function(e,t){return e+"[]"},indices:function(e,t){return e+"["+t+"]"},repeat:function(e,t){return e}},strictNullHandling:!1};o.stringify=function(e,t,n,a,u){if("function"==typeof u)e=u(t,e);else if(r.isBuffer(e))e=e.toString();else if(e instanceof Date)e=e.toISOString();else if(null===e){if(a)return r.encode(t);e=""}if("string"==typeof e||"number"==typeof e||"boolean"==typeof e)return[r.encode(t)+"="+r.encode(e)];var i=[];if("undefined"==typeof e)return i;for(var s=Array.isArray(u)?u:Object.keys(e),c=0,l=s.length;l>c;++c){var f=s[c];i=Array.isArray(e)?i.concat(o.stringify(e[f],n(t,f),n,a,u)):i.concat(o.stringify(e[f],t+"["+f+"]",n,a,u))}return i},e.exports=function(e,t){t=t||{};var n,r,a="undefined"==typeof t.delimiter?o.delimiter:t.delimiter,u="boolean"==typeof t.strictNullHandling?t.strictNullHandling:o.strictNullHandling;"function"==typeof t.filter?(r=t.filter,e=r("",e)):Array.isArray(t.filter)&&(n=r=t.filter);var i=[];if("object"!=typeof e||null===e)return"";var s;s=t.arrayFormat in o.arrayPrefixGenerators?t.arrayFormat:"indices"in t?t.indices?"indices":"repeat":"indices";var c=o.arrayPrefixGenerators[s];n||(n=Object.keys(e));for(var l=0,f=n.length;f>l;++l){var p=n[l];i=i.concat(o.stringify(e[p],p,c,u,r))}return i.join(a)}}])});

@@ -41,2 +41,23 @@ Upgrade Guide

### Locations
Locations are now called histories (that emit locations). You import
them from the [`history` package](https://github.com/rackt/history), not react router.
```js
// v0.13.x
Router.run(routes, Router.BrowserHistory, (Handler) => {
React.render(<Handler/>, el);
})
// v1.0
import createBrowserHistory from 'history/lib/createBrowserHistory'
let history = createBrowserHistory()
React.render(<Router history={history}>{routes}</Router>, el)
```
If you do not specify a history type (as in the example above) then you will notice some unusual behaviour after updating to 1.0.0. With the default hash based routing a querystring entry not defined by yourself will start appearing in your URLs called "_k". An example of how it looks is this: `?_k=umhx1s`.
This is intended and part of [createHashHistory](https://github.com/rackt/react-router/blob/master/docs/guides/basics/Histories.md#createhashhistory) (which is the default history approach used if one is not specified). You can read more about the feature [here](https://github.com/rackt/react-router/blob/master/docs/guides/basics/Histories.md#what-is-that-_kckuvup-junk-in-the-url) and how to opt out [here](https://rackt.github.io/history/stable/HashHistoryCaveats.html).
### Route Config

@@ -61,3 +82,3 @@

from your API for not matching a route. We've removed it completely
since its simple with a `*` path.
since it's simple with a `*` path.

@@ -75,3 +96,3 @@ ```js

- no more params
- must have absolute "from" (for now)
- must have absolute `from` (for now)

@@ -105,8 +126,8 @@ ```js

In 0.13.x links added the "active" class by default which you could
override with `activeClassName`, or provide `activeStyles`. Most links
override with `activeClassName`, or provide `activeStyle`s. Most links
don't need this and the check is (currently) expensive.
Links no longer add the "active" class by default, you opt-in by
providing one; if no `activeClassName` or `activeStyles` are provided,
the link will not check if its active.
providing one; if no `activeClassName` or `activeStyle`s are provided,
the link will not check if it's active.

@@ -121,3 +142,3 @@ ```js

#### Linking to Default/Index routes
#### Linking to Index routes

@@ -128,2 +149,4 @@ Because named routes are gone, a link to `/` with an index route at `/`

**Note:** `DefaultRoute` is gone.
```js

@@ -142,13 +165,28 @@ // v0.13.x

<Route path="/" component={App}>
<IndexRoute handler={Home}/>
<Route path="about" handler={About}/>
<IndexRoute component={Home}/>
<Route path="about" component={About}/>
</Route>
// will be active only when home is active, not when about is active
<IndexLink to="/">Home</Link>
<IndexLink to="/">Home</IndexLink>
```
### RouteHandler
`RouteHandler` is gone. `Router` now automatically populates
`this.props.children` of your components based on the active route.
```js
// v0.13.x
<RouteHandler/>
<RouteHandler someExtraProp={something}/>
// v1.0
{this.props.children}
{React.cloneElement(this.props.children, {someExtraProp: something })}
```
### Navigation Mixin
If you were using the navigation, instead use the `History` mixin.
If you were using the `Navigation` mixin, use the `History` mixin instead.

@@ -169,3 +207,3 @@ ```js

navigateAfterSomethingHappened () {
// the router is not built on rackt/history, and it is a first class
// the router is now built on rackt/history, and it is a first class
// API in the router for navigating

@@ -205,3 +243,3 @@ this.history.pushState(null, `/users/${user.id}`, query);

// if you are a route component...
<Route component={Assignment/>
<Route component={Assignment} />

@@ -217,4 +255,6 @@ var Assignment = React.createClass({

// if you're not a route component, you need to pass location down the
// tree or get the location from context, we will probably provide a
// higher order component that will do this for you but haven't yet
// tree or get the location from context. We will probably provide a
// higher order component that will do this for you but haven't yet.
// see further down for more information on what can be passed down
// via context
var Assignment = React.createClass({

@@ -236,12 +276,59 @@ contextTypes: {

|-----------------|------------------------------------|
| `getPath()` | `location.pathname+location.query` |
| `getPath()` | `location.pathname+location.search` |
| `getPathname()` | `location.pathname` |
| `getParams()` | `params` |
| `getQuery()` | `query` |
| `getQuery()` | `location.search` |
| `getRoutes()` | `routes` |
| `isActive(to, params, query)` | `history.isActive(pathname, query, onlyActiveOnIndex)` |
Here is another table of properties you used to get via the `State` and
where you can get it now if you are **not** a route component (`this.context`).
| v0.13 (this) | v1.0 (this.context) |
|-----------------|------------------------------------|
| `getPath()` | `location.pathname+location.search`|
| `getPathname()` | `location.pathname` |
| `getQuery()` | `location.search` |
| `isActive(to, params, query)` | `history.isActive(pathname, query, onlyActiveOnIndex)` |
Note not all `State` functionality can be accessed via context in v1.0.
For example, `params` is not available via context.
### Scrolling
In 0.13.x we had a couple of implementations to restore scroll position,
we've realized that we can build a better implementation on top of the
router and will be doing that very soon, before the 1.0 final release,
but it doesn't need to be baked into routing like it was before.
### `willTransitionTo` and `willTransitionFrom`
Routes now define this behavior:
```js
// v0.13.x
var Home = React.createClass({
statics: {
willTransitionTo (transition, params, query, callback) {
}
willTransitionFrom (component, transition, params, query, callback) {
}
}
})
// v1.0
<Route
component={Home}
onEnter={(location, replaceWith) => {}}
onLeave={() => {}}
/>
```
To cancel a "transition from", please refer to the
[Confirming Navigation](docs/guides/advanced/ConfirmingNavigation.md) guide.
### We'll keep updating this
There's a lot of the old API we've missed, please give the [new
docs](/docs) a read and help us fill this guide in. Thansk!
docs](/docs) a read and help us fill this guide in. Thanks!

@@ -841,3 +928,3 @@

`0.8.0` had some transient mixins we didn't intend to document, but had
some miscommunication :( If you were one of three people who used some
some miscommunication :(. If you were one of three people who used some
of these mixins and need help upgrading from `0.8.0 -> 0.9.x` find us on

@@ -884,3 +971,3 @@ freenode in `#rackt` or open a ticket. Thanks!

Though, you may want to embrace this new feature:
Though you may want to embrace this new feature:

@@ -1054,2 +1141,1 @@ ```xml

```

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc