Files

Return to Package Diff Home.
Brought to you by Intrinsic.

Package Diff: react-router-dom @ 4.2.2 .. 4.3.1

BrowserRouter.js

@@ -1,24 +1,22 @@
-'use strict';
+"use strict";
exports.__esModule = true;
-var _warning = require('warning');
+var _warning = require("warning");
var _warning2 = _interopRequireDefault(_warning);
-var _react = require('react');
+var _react = require("react");
var _react2 = _interopRequireDefault(_react);
-var _propTypes = require('prop-types');
+var _propTypes = require("prop-types");
var _propTypes2 = _interopRequireDefault(_propTypes);
-var _createBrowserHistory = require('history/createBrowserHistory');
+var _history = require("history");
-var _createBrowserHistory2 = _interopRequireDefault(_createBrowserHistory);
-
-var _Router = require('./Router');
+var _Router = require("./Router");
var _Router2 = _interopRequireDefault(_Router);
@@ -45,11 +43,11 @@
args[_key] = arguments[_key];
}
- return _ret = (_temp = (_this = _possibleConstructorReturn(this, _React$Component.call.apply(_React$Component, [this].concat(args))), _this), _this.history = (0, _createBrowserHistory2.default)(_this.props), _temp), _possibleConstructorReturn(_this, _ret);
+ return _ret = (_temp = (_this = _possibleConstructorReturn(this, _React$Component.call.apply(_React$Component, [this].concat(args))), _this), _this.history = (0, _history.createBrowserHistory)(_this.props), _temp), _possibleConstructorReturn(_this, _ret);
}
BrowserRouter.prototype.componentWillMount = function componentWillMount() {
- (0, _warning2.default)(!this.props.history, '<BrowserRouter> ignores the history prop. To use a custom history, ' + 'use `import { Router }` instead of `import { BrowserRouter as Router }`.');
+ (0, _warning2.default)(!this.props.history, "<BrowserRouter> ignores the history prop. To use a custom history, " + "use `import { Router }` instead of `import { BrowserRouter as Router }`.");
};
BrowserRouter.prototype.render = function render() {

es/BrowserRouter.js

@@ -4,11 +4,11 @@
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; }
-import warning from 'warning';
-import React from 'react';
-import PropTypes from 'prop-types';
-import createHistory from 'history/createBrowserHistory';
-import Router from './Router';
+import warning from "warning";
+import React from "react";
+import PropTypes from "prop-types";
+import { createBrowserHistory as createHistory } from "history";
+import Router from "./Router";
/**
* The public API for a <Router> that uses HTML5 history.
@@ -30,7 +30,7 @@
}
BrowserRouter.prototype.componentWillMount = function componentWillMount() {
- warning(!this.props.history, '<BrowserRouter> ignores the history prop. To use a custom history, ' + 'use `import { Router }` instead of `import { BrowserRouter as Router }`.');
+ warning(!this.props.history, "<BrowserRouter> ignores the history prop. To use a custom history, " + "use `import { Router }` instead of `import { BrowserRouter as Router }`.");
};
BrowserRouter.prototype.render = function render() {

es/generatePath.js

@@ -0,0 +1,4 @@
+// Written in this round about way for babel-transform-imports
+import generatePath from "react-router/es/generatePath";
+
+export default generatePath;
\ No newline at end of file

es/HashRouter.js

@@ -4,11 +4,11 @@
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; }
-import warning from 'warning';
-import React from 'react';
-import PropTypes from 'prop-types';
-import createHistory from 'history/createHashHistory';
-import Router from './Router';
+import warning from "warning";
+import React from "react";
+import PropTypes from "prop-types";
+import { createHashHistory as createHistory } from "history";
+import Router from "./Router";
/**
* The public API for a <Router> that uses window.location.hash.
@@ -30,7 +30,7 @@
}
HashRouter.prototype.componentWillMount = function componentWillMount() {
- warning(!this.props.history, '<HashRouter> ignores the history prop. To use a custom history, ' + 'use `import { Router }` instead of `import { HashRouter as Router }`.');
+ warning(!this.props.history, "<HashRouter> ignores the history prop. To use a custom history, " + "use `import { Router }` instead of `import { HashRouter as Router }`.");
};
HashRouter.prototype.render = function render() {
@@ -43,7 +43,7 @@
HashRouter.propTypes = {
basename: PropTypes.string,
getUserConfirmation: PropTypes.func,
- hashType: PropTypes.oneOf(['hashbang', 'noslash', 'slash']),
+ hashType: PropTypes.oneOf(["hashbang", "noslash", "slash"]),
children: PropTypes.node
};

es/index.js

@@ -1,26 +1,28 @@
-import _BrowserRouter from './BrowserRouter';
+import _BrowserRouter from "./BrowserRouter";
export { _BrowserRouter as BrowserRouter };
-import _HashRouter from './HashRouter';
+import _HashRouter from "./HashRouter";
export { _HashRouter as HashRouter };
-import _Link from './Link';
+import _Link from "./Link";
export { _Link as Link };
-import _MemoryRouter from './MemoryRouter';
+import _MemoryRouter from "./MemoryRouter";
export { _MemoryRouter as MemoryRouter };
-import _NavLink from './NavLink';
+import _NavLink from "./NavLink";
export { _NavLink as NavLink };
-import _Prompt from './Prompt';
+import _Prompt from "./Prompt";
export { _Prompt as Prompt };
-import _Redirect from './Redirect';
+import _Redirect from "./Redirect";
export { _Redirect as Redirect };
-import _Route from './Route';
+import _Route from "./Route";
export { _Route as Route };
-import _Router from './Router';
+import _Router from "./Router";
export { _Router as Router };
-import _StaticRouter from './StaticRouter';
+import _StaticRouter from "./StaticRouter";
export { _StaticRouter as StaticRouter };
-import _Switch from './Switch';
+import _Switch from "./Switch";
export { _Switch as Switch };
-import _matchPath from './matchPath';
+import _generatePath from "./generatePath";
+export { _generatePath as generatePath };
+import _matchPath from "./matchPath";
export { _matchPath as matchPath };
-import _withRouter from './withRouter';
+import _withRouter from "./withRouter";
export { _withRouter as withRouter };
\ No newline at end of file

es/Link.js

@@ -8,9 +8,10 @@
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; }
-import React from 'react';
-import PropTypes from 'prop-types';
-import invariant from 'invariant';
+import React from "react";
+import PropTypes from "prop-types";
+import invariant from "invariant";
+import { createLocation } from "history";
var isModifiedEvent = function isModifiedEvent(event) {
return !!(event.metaKey || event.altKey || event.ctrlKey || event.shiftKey);
@@ -36,7 +37,7 @@
if (_this.props.onClick) _this.props.onClick(event);
if (!event.defaultPrevented && // onClick prevented default
- event.button === 0 && // ignore right clicks
+ event.button === 0 && // ignore everything but left clicks
!_this.props.target && // let browser handle "target=_blank" etc.
!isModifiedEvent(event) // ignore clicks with modifier keys
) {
@@ -62,13 +63,18 @@
replace = _props.replace,
to = _props.to,
innerRef = _props.innerRef,
- props = _objectWithoutProperties(_props, ['replace', 'to', 'innerRef']); // eslint-disable-line no-unused-vars
+ props = _objectWithoutProperties(_props, ["replace", "to", "innerRef"]); // eslint-disable-line no-unused-vars
- invariant(this.context.router, 'You should not use <Link> outside a <Router>');
+ invariant(this.context.router, "You should not use <Link> outside a <Router>");
- var href = this.context.router.history.createHref(typeof to === 'string' ? { pathname: to } : to);
+ invariant(to !== undefined, 'You must specify the "to" property');
- return React.createElement('a', _extends({}, props, { onClick: this.handleClick, href: href, ref: innerRef }));
+ var history = this.context.router.history;
+
+ var location = typeof to === "string" ? createLocation(to, null, null, history.location) : to;
+
+ var href = history.createHref(location);
+ return React.createElement("a", _extends({}, props, { onClick: this.handleClick, href: href, ref: innerRef }));
};
return Link;

es/matchPath.js

@@ -1,4 +1,4 @@
// Written in this round about way for babel-transform-imports
-import matchPath from 'react-router/es/matchPath';
+import matchPath from "react-router/es/matchPath";
export default matchPath;
\ No newline at end of file

es/MemoryRouter.js

@@ -1,4 +1,4 @@
// Written in this round about way for babel-transform-imports
-import MemoryRouter from 'react-router/es/MemoryRouter';
+import MemoryRouter from "react-router/es/MemoryRouter";
export default MemoryRouter;
\ No newline at end of file

es/NavLink.js

@@ -4,10 +4,10 @@
function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
-import React from 'react';
-import PropTypes from 'prop-types';
-import Route from './Route';
-import Link from './Link';
+import React from "react";
+import PropTypes from "prop-types";
+import Route from "./Route";
+import Link from "./Link";
/**
* A <Link> wrapper that knows if it's "active" or not.
@@ -22,11 +22,16 @@
activeStyle = _ref.activeStyle,
style = _ref.style,
getIsActive = _ref.isActive,
- ariaCurrent = _ref.ariaCurrent,
- rest = _objectWithoutProperties(_ref, ['to', 'exact', 'strict', 'location', 'activeClassName', 'className', 'activeStyle', 'style', 'isActive', 'ariaCurrent']);
+ ariaCurrent = _ref["aria-current"],
+ rest = _objectWithoutProperties(_ref, ["to", "exact", "strict", "location", "activeClassName", "className", "activeStyle", "style", "isActive", "aria-current"]);
+
+ var path = (typeof to === "undefined" ? "undefined" : _typeof(to)) === "object" ? to.pathname : to;
+
+ // Regex taken from: https://github.com/pillarjs/path-to-regexp/blob/master/index.js#L202
+ var escapedPath = path && path.replace(/([.+*?=^!:${}()[\]|/\\])/g, "\\$1");
return React.createElement(Route, {
- path: (typeof to === 'undefined' ? 'undefined' : _typeof(to)) === 'object' ? to.pathname : to,
+ path: escapedPath,
exact: exact,
strict: strict,
location: location,
@@ -40,9 +45,9 @@
to: to,
className: isActive ? [className, activeClassName].filter(function (i) {
return i;
- }).join(' ') : className,
+ }).join(" ") : className,
style: isActive ? _extends({}, style, activeStyle) : style,
- 'aria-current': isActive && ariaCurrent
+ "aria-current": isActive && ariaCurrent || null
}, rest));
}
});
@@ -58,12 +63,12 @@
activeStyle: PropTypes.object,
style: PropTypes.object,
isActive: PropTypes.func,
- ariaCurrent: PropTypes.oneOf(['page', 'step', 'location', 'true'])
+ "aria-current": PropTypes.oneOf(["page", "step", "location", "date", "time", "true"])
};
NavLink.defaultProps = {
- activeClassName: 'active',
- ariaCurrent: 'true'
+ activeClassName: "active",
+ "aria-current": "page"
};
export default NavLink;
\ No newline at end of file

es/Prompt.js

@@ -1,4 +1,4 @@
// Written in this round about way for babel-transform-imports
-import Prompt from 'react-router/es/Prompt';
+import Prompt from "react-router/es/Prompt";
export default Prompt;
\ No newline at end of file

es/Redirect.js

@@ -1,4 +1,4 @@
// Written in this round about way for babel-transform-imports
-import Redirect from 'react-router/es/Redirect';
+import Redirect from "react-router/es/Redirect";
export default Redirect;
\ No newline at end of file

es/Route.js

@@ -1,4 +1,4 @@
// Written in this round about way for babel-transform-imports
-import Route from 'react-router/es/Route';
+import Route from "react-router/es/Route";
export default Route;
\ No newline at end of file

es/RouterContext.js

@@ -0,0 +1,4 @@
+// Written in this round about way for babel-transform-imports
+import RouterContext from "react-router/es/RouterContext";
+
+export default RouterContext;
\ No newline at end of file

es/Router.js

@@ -1,4 +1,4 @@
// Written in this round about way for babel-transform-imports
-import Router from 'react-router/es/Router';
+import Router from "react-router/es/Router";
export default Router;
\ No newline at end of file

es/StaticRouter.js

@@ -1,4 +1,4 @@
// Written in this round about way for babel-transform-imports
-import StaticRouter from 'react-router/es/StaticRouter';
+import StaticRouter from "react-router/es/StaticRouter";
export default StaticRouter;
\ No newline at end of file

es/Switch.js

@@ -1,4 +1,4 @@
// Written in this round about way for babel-transform-imports
-import Switch from 'react-router/es/Switch';
+import Switch from "react-router/es/Switch";
export default Switch;
\ No newline at end of file

es/withRouter.js

@@ -1,4 +1,4 @@
// Written in this round about way for babel-transform-imports
-import withRouter from 'react-router/es/withRouter';
+import withRouter from "react-router/es/withRouter";
export default withRouter;
\ No newline at end of file

generatePath.js

@@ -0,0 +1,11 @@
+"use strict";
+
+exports.__esModule = true;
+
+var _generatePath = require("react-router/generatePath");
+
+var _generatePath2 = _interopRequireDefault(_generatePath);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+exports.default = _generatePath2.default; // Written in this round about way for babel-transform-imports
\ No newline at end of file

HashRouter.js

@@ -1,24 +1,22 @@
-'use strict';
+"use strict";
exports.__esModule = true;
-var _warning = require('warning');
+var _warning = require("warning");
var _warning2 = _interopRequireDefault(_warning);
-var _react = require('react');
+var _react = require("react");
var _react2 = _interopRequireDefault(_react);
-var _propTypes = require('prop-types');
+var _propTypes = require("prop-types");
var _propTypes2 = _interopRequireDefault(_propTypes);
-var _createHashHistory = require('history/createHashHistory');
+var _history = require("history");
-var _createHashHistory2 = _interopRequireDefault(_createHashHistory);
-
-var _Router = require('./Router');
+var _Router = require("./Router");
var _Router2 = _interopRequireDefault(_Router);
@@ -45,11 +43,11 @@
args[_key] = arguments[_key];
}
- return _ret = (_temp = (_this = _possibleConstructorReturn(this, _React$Component.call.apply(_React$Component, [this].concat(args))), _this), _this.history = (0, _createHashHistory2.default)(_this.props), _temp), _possibleConstructorReturn(_this, _ret);
+ return _ret = (_temp = (_this = _possibleConstructorReturn(this, _React$Component.call.apply(_React$Component, [this].concat(args))), _this), _this.history = (0, _history.createHashHistory)(_this.props), _temp), _possibleConstructorReturn(_this, _ret);
}
HashRouter.prototype.componentWillMount = function componentWillMount() {
- (0, _warning2.default)(!this.props.history, '<HashRouter> ignores the history prop. To use a custom history, ' + 'use `import { Router }` instead of `import { HashRouter as Router }`.');
+ (0, _warning2.default)(!this.props.history, "<HashRouter> ignores the history prop. To use a custom history, " + "use `import { Router }` instead of `import { HashRouter as Router }`.");
};
HashRouter.prototype.render = function render() {
@@ -62,7 +60,7 @@
HashRouter.propTypes = {
basename: _propTypes2.default.string,
getUserConfirmation: _propTypes2.default.func,
- hashType: _propTypes2.default.oneOf(['hashbang', 'noslash', 'slash']),
+ hashType: _propTypes2.default.oneOf(["hashbang", "noslash", "slash"]),
children: _propTypes2.default.node
};
exports.default = HashRouter;
\ No newline at end of file

index.js

@@ -1,57 +1,61 @@
-'use strict';
+"use strict";
exports.__esModule = true;
-exports.withRouter = exports.matchPath = exports.Switch = exports.StaticRouter = exports.Router = exports.Route = exports.Redirect = exports.Prompt = exports.NavLink = exports.MemoryRouter = exports.Link = exports.HashRouter = exports.BrowserRouter = undefined;
+exports.withRouter = exports.matchPath = exports.generatePath = exports.Switch = exports.StaticRouter = exports.Router = exports.Route = exports.Redirect = exports.Prompt = exports.NavLink = exports.MemoryRouter = exports.Link = exports.HashRouter = exports.BrowserRouter = undefined;
-var _BrowserRouter2 = require('./BrowserRouter');
+var _BrowserRouter2 = require("./BrowserRouter");
var _BrowserRouter3 = _interopRequireDefault(_BrowserRouter2);
-var _HashRouter2 = require('./HashRouter');
+var _HashRouter2 = require("./HashRouter");
var _HashRouter3 = _interopRequireDefault(_HashRouter2);
-var _Link2 = require('./Link');
+var _Link2 = require("./Link");
var _Link3 = _interopRequireDefault(_Link2);
-var _MemoryRouter2 = require('./MemoryRouter');
+var _MemoryRouter2 = require("./MemoryRouter");
var _MemoryRouter3 = _interopRequireDefault(_MemoryRouter2);
-var _NavLink2 = require('./NavLink');
+var _NavLink2 = require("./NavLink");
var _NavLink3 = _interopRequireDefault(_NavLink2);
-var _Prompt2 = require('./Prompt');
+var _Prompt2 = require("./Prompt");
var _Prompt3 = _interopRequireDefault(_Prompt2);
-var _Redirect2 = require('./Redirect');
+var _Redirect2 = require("./Redirect");
var _Redirect3 = _interopRequireDefault(_Redirect2);
-var _Route2 = require('./Route');
+var _Route2 = require("./Route");
var _Route3 = _interopRequireDefault(_Route2);
-var _Router2 = require('./Router');
+var _Router2 = require("./Router");
var _Router3 = _interopRequireDefault(_Router2);
-var _StaticRouter2 = require('./StaticRouter');
+var _StaticRouter2 = require("./StaticRouter");
var _StaticRouter3 = _interopRequireDefault(_StaticRouter2);
-var _Switch2 = require('./Switch');
+var _Switch2 = require("./Switch");
var _Switch3 = _interopRequireDefault(_Switch2);
-var _matchPath2 = require('./matchPath');
+var _generatePath2 = require("./generatePath");
+
+var _generatePath3 = _interopRequireDefault(_generatePath2);
+
+var _matchPath2 = require("./matchPath");
var _matchPath3 = _interopRequireDefault(_matchPath2);
-var _withRouter2 = require('./withRouter');
+var _withRouter2 = require("./withRouter");
var _withRouter3 = _interopRequireDefault(_withRouter2);
@@ -68,5 +72,6 @@
exports.Router = _Router3.default;
exports.StaticRouter = _StaticRouter3.default;
exports.Switch = _Switch3.default;
+exports.generatePath = _generatePath3.default;
exports.matchPath = _matchPath3.default;
exports.withRouter = _withRouter3.default;
\ No newline at end of file

Link.js

@@ -1,21 +1,23 @@
-'use strict';
+"use strict";
exports.__esModule = true;
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
-var _react = require('react');
+var _react = require("react");
var _react2 = _interopRequireDefault(_react);
-var _propTypes = require('prop-types');
+var _propTypes = require("prop-types");
var _propTypes2 = _interopRequireDefault(_propTypes);
-var _invariant = require('invariant');
+var _invariant = require("invariant");
var _invariant2 = _interopRequireDefault(_invariant);
+var _history = require("history");
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
@@ -50,7 +52,7 @@
if (_this.props.onClick) _this.props.onClick(event);
if (!event.defaultPrevented && // onClick prevented default
- event.button === 0 && // ignore right clicks
+ event.button === 0 && // ignore everything but left clicks
!_this.props.target && // let browser handle "target=_blank" etc.
!isModifiedEvent(event) // ignore clicks with modifier keys
) {
@@ -76,13 +78,18 @@
replace = _props.replace,
to = _props.to,
innerRef = _props.innerRef,
- props = _objectWithoutProperties(_props, ['replace', 'to', 'innerRef']); // eslint-disable-line no-unused-vars
+ props = _objectWithoutProperties(_props, ["replace", "to", "innerRef"]); // eslint-disable-line no-unused-vars
+
+ (0, _invariant2.default)(this.context.router, "You should not use <Link> outside a <Router>");
+
+ (0, _invariant2.default)(to !== undefined, 'You must specify the "to" property');
- (0, _invariant2.default)(this.context.router, 'You should not use <Link> outside a <Router>');
+ var history = this.context.router.history;
- var href = this.context.router.history.createHref(typeof to === 'string' ? { pathname: to } : to);
+ var location = typeof to === "string" ? (0, _history.createLocation)(to, null, null, history.location) : to;
- return _react2.default.createElement('a', _extends({}, props, { onClick: this.handleClick, href: href, ref: innerRef }));
+ var href = history.createHref(location);
+ return _react2.default.createElement("a", _extends({}, props, { onClick: this.handleClick, href: href, ref: innerRef }));
};
return Link;

matchPath.js

@@ -1,8 +1,8 @@
-'use strict';
+"use strict";
exports.__esModule = true;
-var _matchPath = require('react-router/matchPath');
+var _matchPath = require("react-router/matchPath");
var _matchPath2 = _interopRequireDefault(_matchPath);

MemoryRouter.js

@@ -1,8 +1,8 @@
-'use strict';
+"use strict";
exports.__esModule = true;
-var _MemoryRouter = require('react-router/MemoryRouter');
+var _MemoryRouter = require("react-router/MemoryRouter");
var _MemoryRouter2 = _interopRequireDefault(_MemoryRouter);

NavLink.js

@@ -1,4 +1,4 @@
-'use strict';
+"use strict";
exports.__esModule = true;
@@ -6,19 +6,19 @@
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
-var _react = require('react');
+var _react = require("react");
var _react2 = _interopRequireDefault(_react);
-var _propTypes = require('prop-types');
+var _propTypes = require("prop-types");
var _propTypes2 = _interopRequireDefault(_propTypes);
-var _Route = require('./Route');
+var _Route = require("./Route");
var _Route2 = _interopRequireDefault(_Route);
-var _Link = require('./Link');
+var _Link = require("./Link");
var _Link2 = _interopRequireDefault(_Link);
@@ -39,11 +39,16 @@
activeStyle = _ref.activeStyle,
style = _ref.style,
getIsActive = _ref.isActive,
- ariaCurrent = _ref.ariaCurrent,
- rest = _objectWithoutProperties(_ref, ['to', 'exact', 'strict', 'location', 'activeClassName', 'className', 'activeStyle', 'style', 'isActive', 'ariaCurrent']);
+ ariaCurrent = _ref["aria-current"],
+ rest = _objectWithoutProperties(_ref, ["to", "exact", "strict", "location", "activeClassName", "className", "activeStyle", "style", "isActive", "aria-current"]);
+
+ var path = (typeof to === "undefined" ? "undefined" : _typeof(to)) === "object" ? to.pathname : to;
+
+ // Regex taken from: https://github.com/pillarjs/path-to-regexp/blob/master/index.js#L202
+ var escapedPath = path && path.replace(/([.+*?=^!:${}()[\]|/\\])/g, "\\$1");
return _react2.default.createElement(_Route2.default, {
- path: (typeof to === 'undefined' ? 'undefined' : _typeof(to)) === 'object' ? to.pathname : to,
+ path: escapedPath,
exact: exact,
strict: strict,
location: location,
@@ -57,9 +62,9 @@
to: to,
className: isActive ? [className, activeClassName].filter(function (i) {
return i;
- }).join(' ') : className,
+ }).join(" ") : className,
style: isActive ? _extends({}, style, activeStyle) : style,
- 'aria-current': isActive && ariaCurrent
+ "aria-current": isActive && ariaCurrent || null
}, rest));
}
});
@@ -75,12 +80,12 @@
activeStyle: _propTypes2.default.object,
style: _propTypes2.default.object,
isActive: _propTypes2.default.func,
- ariaCurrent: _propTypes2.default.oneOf(['page', 'step', 'location', 'true'])
+ "aria-current": _propTypes2.default.oneOf(["page", "step", "location", "date", "time", "true"])
};
NavLink.defaultProps = {
- activeClassName: 'active',
- ariaCurrent: 'true'
+ activeClassName: "active",
+ "aria-current": "page"
};
exports.default = NavLink;
\ No newline at end of file

package.json

@@ -1,6 +1,6 @@
{
"name": "react-router-dom",
- "version": "4.2.2",
+ "version": "4.3.1",
"description": "DOM bindings for React Router",
"repository": "ReactTraining/react-router",
"license": "MIT",
@@ -22,12 +22,14 @@
"Switch.js",
"es",
"index.js",
+ "generatePath.js",
"matchPath.js",
"withRouter.js",
"umd"
],
"main": "index.js",
"module": "es/index.js",
+ "sideEffects": false,
"scripts": {
"build": "node ./tools/build.js",
"watch": "babel ./modules -d . --ignore __tests__ --watch",
@@ -41,43 +43,50 @@
},
"dependencies": {
"history": "^4.7.2",
- "invariant": "^2.2.2",
+ "invariant": "^2.2.4",
"loose-envify": "^1.3.1",
- "prop-types": "^15.5.4",
- "react-router": "^4.2.0",
- "warning": "^3.0.0"
+ "prop-types": "^15.6.1",
+ "react-router": "^4.3.1",
+ "warning": "^4.0.1"
},
"devDependencies": {
"babel-cli": "^6.26.0",
- "babel-eslint": "^7.2.3",
+ "babel-eslint": "^8.2.3",
+ "babel-jest": "^23.0.1",
"babel-plugin-dev-expression": "^0.2.1",
"babel-plugin-external-helpers": "^6.22.0",
- "babel-plugin-transform-imports": "^1.2.0",
- "babel-plugin-transform-react-remove-prop-types": "^0.4.8",
+ "babel-plugin-transform-imports": "^1.5.0",
+ "babel-plugin-transform-react-remove-prop-types": "^0.4.13",
"babel-preset-es2015": "^6.14.0",
"babel-preset-react": "^6.5.0",
"babel-preset-stage-1": "^6.5.0",
- "eslint": "^4.5.0",
- "eslint-plugin-import": "^2.2.0",
- "eslint-plugin-react": "^7.3.0",
- "gzip-size": "^3.0.0",
- "jest": "^20.0.4",
- "pretty-bytes": "^4.0.2",
- "react": "^15.4.2",
- "react-addons-test-utils": "^15.4.2",
- "react-dom": "^15.3.0",
- "rollup": "^0.48.2",
- "rollup-plugin-babel": "^3.0.2",
- "rollup-plugin-commonjs": "^8.2.0",
- "rollup-plugin-node-resolve": "^3.0.0",
- "rollup-plugin-replace": "^1.1.1",
- "rollup-plugin-uglify": "^2.0.1"
+ "eslint": "^4.19.1",
+ "eslint-plugin-import": "^2.12.0",
+ "eslint-plugin-react": "^7.9.1",
+ "gzip-size": "^4.1.0",
+ "jest": "^23.1.0",
+ "pretty-bytes": "^5.0.0",
+ "raf": "^3.4.0",
+ "react": "^16.4.0",
+ "react-addons-test-utils": "^15.6.2",
+ "react-dom": "^16.4.0",
+ "rollup": "^0.60.0",
+ "rollup-plugin-babel": "^3.0.4",
+ "rollup-plugin-commonjs": "^9.1.3",
+ "rollup-plugin-node-resolve": "^3.3.0",
+ "rollup-plugin-replace": "^2.0.0",
+ "rollup-plugin-uglify": "^3.0.0"
},
"browserify": {
"transform": [
"loose-envify"
]
},
+ "jest": {
+ "setupFiles": [
+ "raf/polyfill"
+ ]
+ },
"keywords": [
"react",
"router",

Prompt.js

@@ -1,8 +1,8 @@
-'use strict';
+"use strict";
exports.__esModule = true;
-var _Prompt = require('react-router/Prompt');
+var _Prompt = require("react-router/Prompt");
var _Prompt2 = _interopRequireDefault(_Prompt);

README.md

@@ -15,9 +15,9 @@
import { BrowserRouter, Route, Link } from 'react-router-dom'
// using CommonJS modules
-var BrowserRouter = require('react-router-dom').BrowserRouter
-var Route = require('react-router-dom').Route
-var Link = require('react-router-dom').Link
+const BrowserRouter = require('react-router-dom').BrowserRouter
+const Route = require('react-router-dom').Route
+const Link = require('react-router-dom').Link
```
The UMD build is also available on [unpkg](https://unpkg.com):

Redirect.js

@@ -1,8 +1,8 @@
-'use strict';
+"use strict";
exports.__esModule = true;
-var _Redirect = require('react-router/Redirect');
+var _Redirect = require("react-router/Redirect");
var _Redirect2 = _interopRequireDefault(_Redirect);

Route.js

@@ -1,8 +1,8 @@
-'use strict';
+"use strict";
exports.__esModule = true;
-var _Route = require('react-router/Route');
+var _Route = require("react-router/Route");
var _Route2 = _interopRequireDefault(_Route);

Router.js

@@ -1,8 +1,8 @@
-'use strict';
+"use strict";
exports.__esModule = true;
-var _Router = require('react-router/Router');
+var _Router = require("react-router/Router");
var _Router2 = _interopRequireDefault(_Router);

StaticRouter.js

@@ -1,8 +1,8 @@
-'use strict';
+"use strict";
exports.__esModule = true;
-var _StaticRouter = require('react-router/StaticRouter');
+var _StaticRouter = require("react-router/StaticRouter");
var _StaticRouter2 = _interopRequireDefault(_StaticRouter);

Switch.js

@@ -1,8 +1,8 @@
-'use strict';
+"use strict";
exports.__esModule = true;
-var _Switch = require('react-router/Switch');
+var _Switch = require("react-router/Switch");
var _Switch2 = _interopRequireDefault(_Switch);

umd/react-router-dom.js

@@ -4,125 +4,108 @@
(factory((global.ReactRouterDOM = {}),global.React));
}(this, (function (exports,React) { 'use strict';
-React = React && React.hasOwnProperty('default') ? React['default'] : React;
+ React = React && React.hasOwnProperty('default') ? React['default'] : React;
-/**
- * Copyright 2014-2015, Facebook, Inc.
- * All rights reserved.
+ /**
+ * Copyright (c) 2014-present, Facebook, Inc.
*
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
- */
-
-/**
- * Similar to invariant but only logs a warning if the condition is not met.
- * This can be used to log issues in development environments in critical
- * paths. Removing the logging code for production environments will keep the
- * same logic and follow the same code paths.
+ * This source code is licensed under the MIT license found in the
+ * LICENSE file in the root directory of this source tree.
+ *
+ * @providesModule warning
*/
-var __DEV__ = "development" !== 'production';
-
-var warning = function() {};
+ var warning = function () {};
-if (__DEV__) {
- warning = function(condition, format, args) {
+ {
+ var printWarning = function printWarning(format, args) {
var len = arguments.length;
args = new Array(len > 2 ? len - 2 : 0);
for (var key = 2; key < len; key++) {
args[key - 2] = arguments[key];
}
- if (format === undefined) {
- throw new Error(
- '`warning(condition, format, ...args)` requires a warning ' +
- 'message argument'
- );
- }
-
- if (format.length < 10 || (/^[s\W]*$/).test(format)) {
- throw new Error(
- 'The warning format should be able to uniquely identify this ' +
- 'warning. Please, use a more descriptive format than: ' + format
- );
- }
-
- if (!condition) {
var argIndex = 0;
- var message = 'Warning: ' +
- format.replace(/%s/g, function() {
+ var message = 'Warning: ' + format.replace(/%s/g, function () {
return args[argIndex++];
});
if (typeof console !== 'undefined') {
console.error(message);
}
try {
+ // --- Welcome to debugging React ---
// This error was thrown as a convenience so that you can use this stack
// to find the callsite that caused this warning to fire.
throw new Error(message);
- } catch(x) {}
+ } catch (x) {}
+ };
+
+ warning = function (condition, format, args) {
+ var len = arguments.length;
+ args = new Array(len > 2 ? len - 2 : 0);
+ for (var key = 2; key < len; key++) {
+ args[key - 2] = arguments[key];
+ }
+ if (format === undefined) {
+ throw new Error('`warning(condition, format, ...args)` requires a warning ' + 'message argument');
+ }
+ if (!condition) {
+ printWarning.apply(null, [format].concat(args));
}
};
-}
+ }
-var warning_1 = warning;
+ var warning_1 = warning;
-function unwrapExports (x) {
- return x && x.__esModule ? x['default'] : x;
-}
+ var commonjsGlobal = typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
-function createCommonjsModule(fn, module) {
+ function createCommonjsModule(fn, module) {
return module = { exports: {} }, fn(module, module.exports), module.exports;
-}
+ }
-/**
+ /**
* Copyright (c) 2013-present, Facebook, Inc.
- * All rights reserved.
*
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
+ * This source code is licensed under the MIT license found in the
+ * LICENSE file in the root directory of this source tree.
*
*
*/
-function makeEmptyFunction(arg) {
+ function makeEmptyFunction(arg) {
return function () {
return arg;
};
-}
+ }
-/**
+ /**
* This function accepts and discards inputs; it has no side effects. This is
* primarily useful idiomatically for overridable function endpoints which
* always need to be callable, since JS lacks a null-call idiom ala Cocoa.
*/
-var emptyFunction = function emptyFunction() {};
+ var emptyFunction = function emptyFunction() {};
-emptyFunction.thatReturns = makeEmptyFunction;
-emptyFunction.thatReturnsFalse = makeEmptyFunction(false);
-emptyFunction.thatReturnsTrue = makeEmptyFunction(true);
-emptyFunction.thatReturnsNull = makeEmptyFunction(null);
-emptyFunction.thatReturnsThis = function () {
+ emptyFunction.thatReturns = makeEmptyFunction;
+ emptyFunction.thatReturnsFalse = makeEmptyFunction(false);
+ emptyFunction.thatReturnsTrue = makeEmptyFunction(true);
+ emptyFunction.thatReturnsNull = makeEmptyFunction(null);
+ emptyFunction.thatReturnsThis = function () {
return this;
-};
-emptyFunction.thatReturnsArgument = function (arg) {
+ };
+ emptyFunction.thatReturnsArgument = function (arg) {
return arg;
-};
+ };
-var emptyFunction_1 = emptyFunction;
+ var emptyFunction_1 = emptyFunction;
-/**
+ /**
* Copyright (c) 2013-present, Facebook, Inc.
- * All rights reserved.
*
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
+ * This source code is licensed under the MIT license found in the
+ * LICENSE file in the root directory of this source tree.
*
*/
-/**
+ /**
* Use invariant() to assert state which your program assumes to be true.
*
* Provide sprintf-style format (only %s is supported) and arguments
@@ -133,17 +116,17 @@
* will remain to ensure logic does not differ in production.
*/
-var validateFormat = function validateFormat(format) {};
+ var validateFormat = function validateFormat(format) {};
-{
+ {
validateFormat = function validateFormat(format) {
if (format === undefined) {
throw new Error('invariant requires an error message argument');
}
};
-}
+ }
-function invariant(condition, format, a, b, c, d, e, f) {
+ function invariant(condition, format, a, b, c, d, e, f) {
validateFormat(format);
if (!condition) {
@@ -162,21 +145,21 @@
error.framesToPop = 1; // we don't care about invariant's own frame
throw error;
}
-}
+ }
-var invariant_1 = invariant;
+ var invariant_1 = invariant;
-/**
+ /**
* Similar to invariant but only logs a warning if the condition is not met.
* This can be used to log issues in development environments in critical
* paths. Removing the logging code for production environments will keep the
* same logic and follow the same code paths.
*/
-var warning$2 = emptyFunction_1;
+ var warning$1 = emptyFunction_1;
-{
- var printWarning = function printWarning(format) {
+ {
+ var printWarning$1 = function printWarning(format) {
for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
args[_key - 1] = arguments[_key];
}
@@ -196,7 +179,7 @@
} catch (x) {}
};
- warning$2 = function warning(condition, format) {
+ warning$1 = function warning(condition, format) {
if (format === undefined) {
throw new Error('`warning(condition, format, ...args)` requires a warning ' + 'message argument');
}
@@ -210,34 +193,121 @@
args[_key2 - 2] = arguments[_key2];
}
- printWarning.apply(undefined, [format].concat(args));
+ printWarning$1.apply(undefined, [format].concat(args));
}
};
-}
+ }
+
+ var warning_1$1 = warning$1;
+
+ /*
+ object-assign
+ (c) Sindre Sorhus
+ @license MIT
+ */
+ /* eslint-disable no-unused-vars */
+
+ var getOwnPropertySymbols = Object.getOwnPropertySymbols;
+ var hasOwnProperty = Object.prototype.hasOwnProperty;
+ var propIsEnumerable = Object.prototype.propertyIsEnumerable;
+
+ function toObject(val) {
+ if (val === null || val === undefined) {
+ throw new TypeError('Object.assign cannot be called with null or undefined');
+ }
+
+ return Object(val);
+ }
+
+ function shouldUseNative() {
+ try {
+ if (!Object.assign) {
+ return false;
+ }
+
+ // Detect buggy property enumeration order in older V8 versions.
+
+ // https://bugs.chromium.org/p/v8/issues/detail?id=4118
+ var test1 = new String('abc'); // eslint-disable-line no-new-wrappers
+ test1[5] = 'de';
+ if (Object.getOwnPropertyNames(test1)[0] === '5') {
+ return false;
+ }
+
+ // https://bugs.chromium.org/p/v8/issues/detail?id=3056
+ var test2 = {};
+ for (var i = 0; i < 10; i++) {
+ test2['_' + String.fromCharCode(i)] = i;
+ }
+ var order2 = Object.getOwnPropertyNames(test2).map(function (n) {
+ return test2[n];
+ });
+ if (order2.join('') !== '0123456789') {
+ return false;
+ }
-var warning_1$1 = warning$2;
+ // https://bugs.chromium.org/p/v8/issues/detail?id=3056
+ var test3 = {};
+ 'abcdefghijklmnopqrst'.split('').forEach(function (letter) {
+ test3[letter] = letter;
+ });
+ if (Object.keys(Object.assign({}, test3)).join('') !== 'abcdefghijklmnopqrst') {
+ return false;
+ }
-/**
- * Copyright 2013-present, Facebook, Inc.
- * All rights reserved.
+ return true;
+ } catch (err) {
+ // We don't expect any of the above to throw, but better to be safe.
+ return false;
+ }
+ }
+
+ var objectAssign = shouldUseNative() ? Object.assign : function (target, source) {
+ var from;
+ var to = toObject(target);
+ var symbols;
+
+ for (var s = 1; s < arguments.length; s++) {
+ from = Object(arguments[s]);
+
+ for (var key in from) {
+ if (hasOwnProperty.call(from, key)) {
+ to[key] = from[key];
+ }
+ }
+
+ if (getOwnPropertySymbols) {
+ symbols = getOwnPropertySymbols(from);
+ for (var i = 0; i < symbols.length; i++) {
+ if (propIsEnumerable.call(from, symbols[i])) {
+ to[symbols[i]] = from[symbols[i]];
+ }
+ }
+ }
+ }
+
+ return to;
+ };
+
+ /**
+ * Copyright (c) 2013-present, Facebook, Inc.
*
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
+ * This source code is licensed under the MIT license found in the
+ * LICENSE file in the root directory of this source tree.
*/
-var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
+ var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
-var ReactPropTypesSecret_1 = ReactPropTypesSecret;
+ var ReactPropTypesSecret_1 = ReactPropTypesSecret;
-{
+ {
var invariant$1 = invariant_1;
- var warning$3 = warning_1$1;
+ var warning$2 = warning_1$1;
var ReactPropTypesSecret$1 = ReactPropTypesSecret_1;
var loggedTypeFailures = {};
-}
+ }
-/**
+ /**
* Assert that the values match with the type specs.
* Error messages are memorized and will only be shown once.
*
@@ -248,7 +318,7 @@
* @param {?Function} getStack Returns the component stack.
* @private
*/
-function checkPropTypes(typeSpecs, values, location, componentName, getStack) {
+ function checkPropTypes(typeSpecs, values, location, componentName, getStack) {
{
for (var typeSpecName in typeSpecs) {
if (typeSpecs.hasOwnProperty(typeSpecName)) {
@@ -259,12 +329,12 @@
try {
// This is intentionally an invariant that gets caught. It's the same
// behavior as without this statement except with a better message.
- invariant$1(typeof typeSpecs[typeSpecName] === 'function', '%s: %s type `%s` is invalid; it must be a function, usually from ' + 'React.PropTypes.', componentName || 'React class', location, typeSpecName);
+ invariant$1(typeof typeSpecs[typeSpecName] === 'function', '%s: %s type `%s` is invalid; it must be a function, usually from ' + 'the `prop-types` package, but received `%s`.', componentName || 'React class', location, typeSpecName, typeof typeSpecs[typeSpecName]);
error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret$1);
} catch (ex) {
error = ex;
}
- warning$3(!error || error instanceof Error, '%s: type specification of %s `%s` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a %s. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).', componentName || 'React class', location, typeSpecName, typeof error);
+ warning$2(!error || error instanceof Error, '%s: type specification of %s `%s` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a %s. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).', componentName || 'React class', location, typeSpecName, typeof error);
if (error instanceof Error && !(error.message in loggedTypeFailures)) {
// Only monitor this failure once because there tends to be a lot of the
// same error.
@@ -272,16 +342,16 @@
var stack = getStack ? getStack() : '';
- warning$3(false, 'Failed %s type: %s%s', location, error.message, stack != null ? stack : '');
+ warning$2(false, 'Failed %s type: %s%s', location, error.message, stack != null ? stack : '');
+ }
}
}
}
}
-}
-var checkPropTypes_1 = checkPropTypes;
+ var checkPropTypes_1 = checkPropTypes;
-var factoryWithTypeCheckers = function(isValidElement, throwOnDirectAccess) {
+ var factoryWithTypeCheckers = function (isValidElement, throwOnDirectAccess) {
/* global Symbol */
var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec.
@@ -375,7 +445,8 @@
objectOf: createObjectOfTypeChecker,
oneOf: createEnumTypeChecker,
oneOfType: createUnionTypeChecker,
- shape: createShapeTypeChecker
+ shape: createShapeTypeChecker,
+ exact: createStrictShapeTypeChecker
};
/**
@@ -422,30 +493,14 @@
if (secret !== ReactPropTypesSecret_1) {
if (throwOnDirectAccess) {
// New behavior only for users of `prop-types` package
- invariant_1(
- false,
- 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +
- 'Use `PropTypes.checkPropTypes()` to call them. ' +
- 'Read more at http://fb.me/use-check-prop-types'
- );
- } else if ("development" !== 'production' && typeof console !== 'undefined') {
+ invariant_1(false, 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' + 'Use `PropTypes.checkPropTypes()` to call them. ' + 'Read more at http://fb.me/use-check-prop-types');
+ } else if (typeof console !== 'undefined') {
// Old behavior for people using React.PropTypes
var cacheKey = componentName + ':' + propName;
- if (
- !manualPropTypeCallCache[cacheKey] &&
+ if (!manualPropTypeCallCache[cacheKey] &&
// Avoid spamming the console because they are often not actionable except for lib authors
- manualPropTypeWarningCount < 3
- ) {
- warning_1$1(
- false,
- 'You are manually calling a React.PropTypes validation ' +
- 'function for the `%s` prop on `%s`. This is deprecated ' +
- 'and will throw in the standalone `prop-types` package. ' +
- 'You may be seeing this warning due to a third-party PropTypes ' +
- 'library. See https://fb.me/react-warning-dont-call-proptypes ' + 'for details.',
- propFullName,
- componentName
- );
+ manualPropTypeWarningCount < 3) {
+ warning_1$1(false, 'You are manually calling a React.PropTypes validation ' + 'function for the `%s` prop on `%s`. This is deprecated ' + 'and will throw in the standalone `prop-types` package. ' + 'You may be seeing this warning due to a third-party PropTypes ' + 'library. See https://fb.me/react-warning-dont-call-proptypes ' + 'for details.', propFullName, componentName);
manualPropTypeCallCache[cacheKey] = true;
manualPropTypeWarningCount++;
}
@@ -588,13 +643,7 @@
for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
var checker = arrayOfTypeCheckers[i];
if (typeof checker !== 'function') {
- warning_1$1(
- false,
- 'Invalid argument supplid to oneOfType. Expected an array of check functions, but ' +
- 'received %s at index %s.',
- getPostfixForTypeWarning(checker),
- i
- );
+ warning_1$1(false, 'Invalid argument supplied to oneOfType. Expected an array of check functions, but ' + 'received %s at index %s.', getPostfixForTypeWarning(checker), i);
return emptyFunction_1.thatReturnsNull;
}
}
@@ -644,6 +693,32 @@
return createChainableTypeChecker(validate);
}
+ function createStrictShapeTypeChecker(shapeTypes) {
+ function validate(props, propName, componentName, location, propFullName) {
+ var propValue = props[propName];
+ var propType = getPropType(propValue);
+ if (propType !== 'object') {
+ return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
+ }
+ // We need to check all keys in case some are required but missing from
+ // props.
+ var allKeys = objectAssign({}, props[propName], shapeTypes);
+ for (var key in allKeys) {
+ var checker = shapeTypes[key];
+ if (!checker) {
+ return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` key `' + key + '` supplied to `' + componentName + '`.' + '\nBad object: ' + JSON.stringify(props[propName], null, ' ') + '\nValid keys: ' + JSON.stringify(Object.keys(shapeTypes), null, ' '));
+ }
+ var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret_1);
+ if (error) {
+ return error;
+ }
+ }
+ return null;
+ }
+
+ return createChainableTypeChecker(validate);
+ }
+
function isNode(propValue) {
switch (typeof propValue) {
case 'number':
@@ -774,61 +849,39 @@
ReactPropTypes.PropTypes = ReactPropTypes;
return ReactPropTypes;
-};
+ };
-var propTypes = createCommonjsModule(function (module) {
-/**
- * Copyright 2013-present, Facebook, Inc.
- * All rights reserved.
+ var propTypes = createCommonjsModule(function (module) {
+ /**
+ * Copyright (c) 2013-present, Facebook, Inc.
*
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
+ * This source code is licensed under the MIT license found in the
+ * LICENSE file in the root directory of this source tree.
*/
-{
- var REACT_ELEMENT_TYPE = (typeof Symbol === 'function' &&
- Symbol.for &&
- Symbol.for('react.element')) ||
- 0xeac7;
-
- var isValidElement = function(object) {
- return typeof object === 'object' &&
- object !== null &&
- object.$$typeof === REACT_ELEMENT_TYPE;
+ {
+ var REACT_ELEMENT_TYPE = typeof Symbol === 'function' && Symbol.for && Symbol.for('react.element') || 0xeac7;
+
+ var isValidElement = function (object) {
+ return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
};
// By explicitly using `prop-types` you are opting into new development behavior.
// http://fb.me/prop-types-in-prod
var throwOnDirectAccess = true;
module.exports = factoryWithTypeCheckers(isValidElement, throwOnDirectAccess);
-}
-});
-
-/**
- * Copyright 2013-2015, Facebook, Inc.
- * All rights reserved.
- *
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
- */
+ }
+ });
-/**
- * Use invariant() to assert state which your program assumes to be true.
- *
- * Provide sprintf-style format (only %s is supported) and arguments
- * to provide information about what broke and what you were
- * expecting.
+ /**
+ * Copyright (c) 2013-present, Facebook, Inc.
*
- * The invariant message will be stripped in production, but the invariant
- * will remain to ensure logic does not differ in production.
+ * This source code is licensed under the MIT license found in the
+ * LICENSE file in the root directory of this source tree.
*/
-var NODE_ENV = "development";
-
-var invariant$3 = function(condition, format, a, b, c, d, e, f) {
- if (NODE_ENV !== 'production') {
+ var invariant$2 = function (condition, format, a, b, c, d, e, f) {
+ {
if (format === undefined) {
throw new Error('invariant requires an error message argument');
}
@@ -837,41 +890,38 @@
if (!condition) {
var error;
if (format === undefined) {
- error = new Error(
- 'Minified exception occurred; use the non-minified dev environment ' +
- 'for the full error message and additional helpful warnings.'
- );
+ error = new Error('Minified exception occurred; use the non-minified dev environment ' + 'for the full error message and additional helpful warnings.');
} else {
var args = [a, b, c, d, e, f];
var argIndex = 0;
- error = new Error(
- format.replace(/%s/g, function() { return args[argIndex++]; })
- );
+ error = new Error(format.replace(/%s/g, function () {
+ return args[argIndex++];
+ }));
error.name = 'Invariant Violation';
}
error.framesToPop = 1; // we don't care about invariant's own frame
throw error;
}
-};
+ };
-var invariant_1$2 = invariant$3;
+ var invariant_1$1 = invariant$2;
-function isAbsolute(pathname) {
+ function isAbsolute(pathname) {
return pathname.charAt(0) === '/';
-}
+ }
-// About 1.5x faster than the two-arg version of Array#splice()
-function spliceOne(list, index) {
+ // About 1.5x faster than the two-arg version of Array#splice()
+ function spliceOne(list, index) {
for (var i = index, k = i + 1, n = list.length; k < n; i += 1, k += 1) {
list[i] = list[k];
}
list.pop();
-}
+ }
-// This implementation is based heavily on node's url.parse
-function resolvePathname(to) {
+ // This implementation is based heavily on node's url.parse
+ function resolvePathname(to) {
var from = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
var toParts = to && to.split('/') || [];
@@ -924,17 +974,15 @@
if (hasTrailingSlash && result.substr(-1) !== '/') result += '/';
return result;
-}
-
-
-
-var resolvePathname$2 = Object.freeze({
- default: resolvePathname
-});
+ }
-var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
+ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) {
+ return typeof obj;
+ } : function (obj) {
+ return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
+ };
-function valueEqual(a, b) {
+ function valueEqual(a, b) {
if (a === b) return true;
if (a == null || b == null) return false;
@@ -967,39 +1015,29 @@
}
return false;
-}
-
-
-
-var valueEqual$2 = Object.freeze({
- default: valueEqual
-});
-
-var PathUtils = createCommonjsModule(function (module, exports) {
-'use strict';
+ }
-exports.__esModule = true;
-var addLeadingSlash = exports.addLeadingSlash = function addLeadingSlash(path) {
+ var addLeadingSlash = function addLeadingSlash(path) {
return path.charAt(0) === '/' ? path : '/' + path;
-};
+ };
-var stripLeadingSlash = exports.stripLeadingSlash = function stripLeadingSlash(path) {
+ var stripLeadingSlash = function stripLeadingSlash(path) {
return path.charAt(0) === '/' ? path.substr(1) : path;
-};
+ };
-var hasBasename = exports.hasBasename = function hasBasename(path, prefix) {
+ var hasBasename = function hasBasename(path, prefix) {
return new RegExp('^' + prefix + '(\\/|\\?|#|$)', 'i').test(path);
-};
+ };
-var stripBasename = exports.stripBasename = function stripBasename(path, prefix) {
+ var stripBasename = function stripBasename(path, prefix) {
return hasBasename(path, prefix) ? path.substr(prefix.length) : path;
-};
+ };
-var stripTrailingSlash = exports.stripTrailingSlash = function stripTrailingSlash(path) {
+ var stripTrailingSlash = function stripTrailingSlash(path) {
return path.charAt(path.length - 1) === '/' ? path.slice(0, -1) : path;
-};
+ };
-var parsePath = exports.parsePath = function parsePath(path) {
+ var parsePath = function parsePath(path) {
var pathname = path || '/';
var search = '';
var hash = '';
@@ -1021,9 +1059,9 @@
search: search === '?' ? '' : search,
hash: hash === '#' ? '' : hash
};
-};
+ };
-var createPath = exports.createPath = function createPath(location) {
+ var createPath = function createPath(location) {
var pathname = location.pathname,
search = location.search,
hash = location.hash;
@@ -1036,38 +1073,23 @@
if (hash && hash !== '#') path += hash.charAt(0) === '#' ? hash : '#' + hash;
return path;
-};
-});
-
-var _resolvePathname = ( resolvePathname$2 && resolvePathname ) || resolvePathname$2;
-
-var _valueEqual = ( valueEqual$2 && valueEqual ) || valueEqual$2;
-
-var LocationUtils = createCommonjsModule(function (module, exports) {
-'use strict';
-
-exports.__esModule = true;
-exports.locationsAreEqual = exports.createLocation = undefined;
-
-var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
-
-
-
-var _resolvePathname2 = _interopRequireDefault(_resolvePathname);
-
-
-
-var _valueEqual2 = _interopRequireDefault(_valueEqual);
-
-
+ };
-function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+ var _extends = Object.assign || function (target) {
+ for (var i = 1; i < arguments.length; i++) {
+ var source = arguments[i];for (var key in source) {
+ if (Object.prototype.hasOwnProperty.call(source, key)) {
+ target[key] = source[key];
+ }
+ }
+ }return target;
+ };
-var createLocation = exports.createLocation = function createLocation(path, state, key, currentLocation) {
+ var createLocation = function createLocation(path, state, key, currentLocation) {
var location = void 0;
if (typeof path === 'string') {
// Two-arg form: push(path, state)
- location = (0, PathUtils.parsePath)(path);
+ location = parsePath(path);
location.state = state;
} else {
// One-arg form: push(location)
@@ -1107,7 +1129,7 @@
if (!location.pathname) {
location.pathname = currentLocation.pathname;
} else if (location.pathname.charAt(0) !== '/') {
- location.pathname = (0, _resolvePathname2.default)(location.pathname, currentLocation.pathname);
+ location.pathname = resolvePathname(location.pathname, currentLocation.pathname);
}
} else {
// When there is no prior location and pathname is empty, set it to /
@@ -1117,29 +1139,17 @@
}
return location;
-};
-
-var locationsAreEqual = exports.locationsAreEqual = function locationsAreEqual(a, b) {
- return a.pathname === b.pathname && a.search === b.search && a.hash === b.hash && a.key === b.key && (0, _valueEqual2.default)(a.state, b.state);
-};
-});
-
-var createTransitionManager_1 = createCommonjsModule(function (module, exports) {
-'use strict';
-
-exports.__esModule = true;
-
-
-
-var _warning2 = _interopRequireDefault(warning_1);
+ };
-function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+ var locationsAreEqual = function locationsAreEqual(a, b) {
+ return a.pathname === b.pathname && a.search === b.search && a.hash === b.hash && a.key === b.key && valueEqual(a.state, b.state);
+ };
-var createTransitionManager = function createTransitionManager() {
+ var createTransitionManager = function createTransitionManager() {
var prompt = null;
var setPrompt = function setPrompt(nextPrompt) {
- (0, _warning2.default)(prompt == null, 'A history supports only one prompt at a time');
+ warning_1(prompt == null, 'A history supports only one prompt at a time');
prompt = nextPrompt;
@@ -1159,7 +1169,7 @@
if (typeof getUserConfirmation === 'function') {
getUserConfirmation(result, callback);
} else {
- (0, _warning2.default)(false, 'A history needs a getUserConfirmation function in order to use a prompt message');
+ warning_1(false, 'A history needs a getUserConfirmation function in order to use a prompt message');
callback(true);
}
@@ -1207,102 +1217,81 @@
appendListener: appendListener,
notifyListeners: notifyListeners
};
-};
-
-exports.default = createTransitionManager;
-});
-
-var DOMUtils = createCommonjsModule(function (module, exports) {
-'use strict';
+ };
-exports.__esModule = true;
-var canUseDOM = exports.canUseDOM = !!(typeof window !== 'undefined' && window.document && window.document.createElement);
+ var canUseDOM = !!(typeof window !== 'undefined' && window.document && window.document.createElement);
-var addEventListener = exports.addEventListener = function addEventListener(node, event, listener) {
+ var addEventListener = function addEventListener(node, event, listener) {
return node.addEventListener ? node.addEventListener(event, listener, false) : node.attachEvent('on' + event, listener);
-};
+ };
-var removeEventListener = exports.removeEventListener = function removeEventListener(node, event, listener) {
+ var removeEventListener = function removeEventListener(node, event, listener) {
return node.removeEventListener ? node.removeEventListener(event, listener, false) : node.detachEvent('on' + event, listener);
-};
+ };
-var getConfirmation = exports.getConfirmation = function getConfirmation(message, callback) {
+ var getConfirmation = function getConfirmation(message, callback) {
return callback(window.confirm(message));
-}; // eslint-disable-line no-alert
+ }; // eslint-disable-line no-alert
-/**
+ /**
* Returns true if the HTML5 history API is supported. Taken from Modernizr.
*
* https://github.com/Modernizr/Modernizr/blob/master/LICENSE
* https://github.com/Modernizr/Modernizr/blob/master/feature-detects/history.js
* changed to avoid false negatives for Windows Phones: https://github.com/reactjs/react-router/issues/586
*/
-var supportsHistory = exports.supportsHistory = function supportsHistory() {
+ var supportsHistory = function supportsHistory() {
var ua = window.navigator.userAgent;
if ((ua.indexOf('Android 2.') !== -1 || ua.indexOf('Android 4.0') !== -1) && ua.indexOf('Mobile Safari') !== -1 && ua.indexOf('Chrome') === -1 && ua.indexOf('Windows Phone') === -1) return false;
return window.history && 'pushState' in window.history;
-};
+ };
-/**
+ /**
* Returns true if browser fires popstate on hash change.
* IE10 and IE11 do not.
*/
-var supportsPopStateOnHashChange = exports.supportsPopStateOnHashChange = function supportsPopStateOnHashChange() {
+ var supportsPopStateOnHashChange = function supportsPopStateOnHashChange() {
return window.navigator.userAgent.indexOf('Trident') === -1;
-};
+ };
-/**
+ /**
* Returns false if using go(n) with hash history causes a full page reload.
*/
-var supportsGoWithoutReloadUsingHash = exports.supportsGoWithoutReloadUsingHash = function supportsGoWithoutReloadUsingHash() {
+ var supportsGoWithoutReloadUsingHash = function supportsGoWithoutReloadUsingHash() {
return window.navigator.userAgent.indexOf('Firefox') === -1;
-};
+ };
-/**
+ /**
* Returns true if a given popstate event is an extraneous WebKit event.
* Accounts for the fact that Chrome on iOS fires real popstate events
* containing undefined state when pressing the back button.
*/
-var isExtraneousPopstateEvent = exports.isExtraneousPopstateEvent = function isExtraneousPopstateEvent(event) {
+ var isExtraneousPopstateEvent = function isExtraneousPopstateEvent(event) {
return event.state === undefined && navigator.userAgent.indexOf('CriOS') === -1;
-};
-});
-
-var createBrowserHistory_1 = createCommonjsModule(function (module, exports) {
-'use strict';
-
-exports.__esModule = true;
-
-var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
-
-var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
-
-
-
-var _warning2 = _interopRequireDefault(warning_1);
-
-
-
-var _invariant2 = _interopRequireDefault(invariant_1$2);
-
-
-
-
-
-
-
-var _createTransitionManager2 = _interopRequireDefault(createTransitionManager_1);
-
+ };
+ var _typeof$1 = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) {
+ return typeof obj;
+ } : function (obj) {
+ return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
+ };
-function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+ var _extends$1 = Object.assign || function (target) {
+ for (var i = 1; i < arguments.length; i++) {
+ var source = arguments[i];for (var key in source) {
+ if (Object.prototype.hasOwnProperty.call(source, key)) {
+ target[key] = source[key];
+ }
+ }
+ }return target;
+ };
-var PopStateEvent = 'popstate';
-var HashChangeEvent = 'hashchange';
+ var PopStateEvent = 'popstate';
+ var HashChangeEvent = 'hashchange';
-var getHistoryState = function getHistoryState() {
+ var getHistoryState = function getHistoryState() {
try {
return window.history.state || {};
} catch (e) {
@@ -1310,29 +1299,29 @@
// See https://github.com/ReactTraining/history/pull/289
return {};
}
-};
+ };
-/**
+ /**
* Creates a history object that uses the HTML5 history API including
* pushState, replaceState, and the popstate event.
*/
-var createBrowserHistory = function createBrowserHistory() {
+ var createBrowserHistory = function createBrowserHistory() {
var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
- (0, _invariant2.default)(DOMUtils.canUseDOM, 'Browser history needs a DOM');
+ invariant_1$1(canUseDOM, 'Browser history needs a DOM');
var globalHistory = window.history;
- var canUseHistory = (0, DOMUtils.supportsHistory)();
- var needsHashChangeListener = !(0, DOMUtils.supportsPopStateOnHashChange)();
+ var canUseHistory = supportsHistory();
+ var needsHashChangeListener = !supportsPopStateOnHashChange();
var _props$forceRefresh = props.forceRefresh,
forceRefresh = _props$forceRefresh === undefined ? false : _props$forceRefresh,
_props$getUserConfirm = props.getUserConfirmation,
- getUserConfirmation = _props$getUserConfirm === undefined ? DOMUtils.getConfirmation : _props$getUserConfirm,
+ getUserConfirmation = _props$getUserConfirm === undefined ? getConfirmation : _props$getUserConfirm,
_props$keyLength = props.keyLength,
keyLength = _props$keyLength === undefined ? 6 : _props$keyLength;
- var basename = props.basename ? (0, PathUtils.stripTrailingSlash)((0, PathUtils.addLeadingSlash)(props.basename)) : '';
+ var basename = props.basename ? stripTrailingSlash(addLeadingSlash(props.basename)) : '';
var getDOMLocation = function getDOMLocation(historyState) {
var _ref = historyState || {},
@@ -1344,24 +1333,23 @@
search = _window$location.search,
hash = _window$location.hash;
-
var path = pathname + search + hash;
- (0, _warning2.default)(!basename || (0, PathUtils.hasBasename)(path, basename), 'You are attempting to use a basename on a page whose URL path does not begin ' + 'with the basename. Expected path "' + path + '" to begin with "' + basename + '".');
+ warning_1(!basename || hasBasename(path, basename), 'You are attempting to use a basename on a page whose URL path does not begin ' + 'with the basename. Expected path "' + path + '" to begin with "' + basename + '".');
- if (basename) path = (0, PathUtils.stripBasename)(path, basename);
+ if (basename) path = stripBasename(path, basename);
- return (0, LocationUtils.createLocation)(path, state, key);
+ return createLocation(path, state, key);
};
var createKey = function createKey() {
return Math.random().toString(36).substr(2, keyLength);
};
- var transitionManager = (0, _createTransitionManager2.default)();
+ var transitionManager = createTransitionManager();
var setState = function setState(nextState) {
- _extends(history, nextState);
+ _extends$1(history, nextState);
history.length = globalHistory.length;
@@ -1370,7 +1358,7 @@
var handlePopState = function handlePopState(event) {
// Ignore extraneous popstate events in WebKit.
- if ((0, DOMUtils.isExtraneousPopstateEvent)(event)) return;
+ if (isExtraneousPopstateEvent(event)) return;
handlePop(getDOMLocation(event.state));
};
@@ -1427,14 +1415,14 @@
// Public interface
var createHref = function createHref(location) {
- return basename + (0, PathUtils.createPath)(location);
+ return basename + createPath(location);
};
var push = function push(path, state) {
- (0, _warning2.default)(!((typeof path === 'undefined' ? 'undefined' : _typeof(path)) === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored');
+ warning_1(!((typeof path === 'undefined' ? 'undefined' : _typeof$1(path)) === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored');
var action = 'PUSH';
- var location = (0, LocationUtils.createLocation)(path, state, createKey(), history.location);
+ var location = createLocation(path, state, createKey(), history.location);
transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {
if (!ok) return;
@@ -1459,7 +1446,7 @@
setState({ action: action, location: location });
}
} else {
- (0, _warning2.default)(state === undefined, 'Browser history cannot push state in browsers that do not support HTML5 history');
+ warning_1(state === undefined, 'Browser history cannot push state in browsers that do not support HTML5 history');
window.location.href = href;
}
@@ -1467,10 +1454,10 @@
};
var replace = function replace(path, state) {
- (0, _warning2.default)(!((typeof path === 'undefined' ? 'undefined' : _typeof(path)) === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored');
+ warning_1(!((typeof path === 'undefined' ? 'undefined' : _typeof$1(path)) === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored');
var action = 'REPLACE';
- var location = (0, LocationUtils.createLocation)(path, state, createKey(), history.location);
+ var location = createLocation(path, state, createKey(), history.location);
transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {
if (!ok) return;
@@ -1493,7 +1479,7 @@
setState({ action: action, location: location });
}
} else {
- (0, _warning2.default)(state === undefined, 'Browser history cannot replace state in browsers that do not support HTML5 history');
+ warning_1(state === undefined, 'Browser history cannot replace state in browsers that do not support HTML5 history');
window.location.replace(href);
}
@@ -1518,13 +1504,13 @@
listenerCount += delta;
if (listenerCount === 1) {
- (0, DOMUtils.addEventListener)(window, PopStateEvent, handlePopState);
+ addEventListener(window, PopStateEvent, handlePopState);
- if (needsHashChangeListener) (0, DOMUtils.addEventListener)(window, HashChangeEvent, handleHashChange);
+ if (needsHashChangeListener) addEventListener(window, HashChangeEvent, handleHashChange);
} else if (listenerCount === 0) {
- (0, DOMUtils.removeEventListener)(window, PopStateEvent, handlePopState);
+ removeEventListener(window, PopStateEvent, handlePopState);
- if (needsHashChangeListener) (0, DOMUtils.removeEventListener)(window, HashChangeEvent, handleHashChange);
+ if (needsHashChangeListener) removeEventListener(window, HashChangeEvent, handleHashChange);
}
};
@@ -1575,820 +1561,9 @@
};
return history;
-};
-
-exports.default = createBrowserHistory;
-});
-
-var createHistory = unwrapExports(createBrowserHistory_1);
-
-/**
- * Copyright 2014-2015, Facebook, Inc.
- * All rights reserved.
- *
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
- */
-
-/**
- * Similar to invariant but only logs a warning if the condition is not met.
- * This can be used to log issues in development environments in critical
- * paths. Removing the logging code for production environments will keep the
- * same logic and follow the same code paths.
- */
-
-var __DEV__$1 = "development" !== 'production';
-
-var warning$4 = function () {};
-
-if (__DEV__$1) {
- warning$4 = function (condition, format, args) {
- var len = arguments.length;
- args = new Array(len > 2 ? len - 2 : 0);
- for (var key = 2; key < len; key++) {
- args[key - 2] = arguments[key];
- }
- if (format === undefined) {
- throw new Error('`warning(condition, format, ...args)` requires a warning ' + 'message argument');
- }
-
- if (format.length < 10 || /^[s\W]*$/.test(format)) {
- throw new Error('The warning format should be able to uniquely identify this ' + 'warning. Please, use a more descriptive format than: ' + format);
- }
-
- if (!condition) {
- var argIndex = 0;
- var message = 'Warning: ' + format.replace(/%s/g, function () {
- return args[argIndex++];
- });
- if (typeof console !== 'undefined') {
- console.error(message);
- }
- try {
- // This error was thrown as a convenience so that you can use this stack
- // to find the callsite that caused this warning to fire.
- throw new Error(message);
- } catch (x) {}
- }
- };
-}
-
-var warning_1$3 = warning$4;
-
-/**
- * Copyright 2013-2015, Facebook, Inc.
- * All rights reserved.
- *
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
- */
-
-/**
- * Use invariant() to assert state which your program assumes to be true.
- *
- * Provide sprintf-style format (only %s is supported) and arguments
- * to provide information about what broke and what you were
- * expecting.
- *
- * The invariant message will be stripped in production, but the invariant
- * will remain to ensure logic does not differ in production.
- */
-
-var NODE_ENV$1 = "development";
-
-var invariant$5 = function (condition, format, a, b, c, d, e, f) {
- if (NODE_ENV$1 !== 'production') {
- if (format === undefined) {
- throw new Error('invariant requires an error message argument');
- }
- }
-
- if (!condition) {
- var error;
- if (format === undefined) {
- error = new Error('Minified exception occurred; use the non-minified dev environment ' + 'for the full error message and additional helpful warnings.');
- } else {
- var args = [a, b, c, d, e, f];
- var argIndex = 0;
- error = new Error(format.replace(/%s/g, function () {
- return args[argIndex++];
- }));
- error.name = 'Invariant Violation';
- }
-
- error.framesToPop = 1; // we don't care about invariant's own frame
- throw error;
- }
-};
-
-var invariant_1$3 = invariant$5;
-
-/**
- * Copyright (c) 2013-present, Facebook, Inc.
- * All rights reserved.
- *
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
- *
- *
- */
-
-function makeEmptyFunction$1(arg) {
- return function () {
- return arg;
- };
-}
-
-/**
- * This function accepts and discards inputs; it has no side effects. This is
- * primarily useful idiomatically for overridable function endpoints which
- * always need to be callable, since JS lacks a null-call idiom ala Cocoa.
- */
-var emptyFunction$2 = function emptyFunction() {};
-
-emptyFunction$2.thatReturns = makeEmptyFunction$1;
-emptyFunction$2.thatReturnsFalse = makeEmptyFunction$1(false);
-emptyFunction$2.thatReturnsTrue = makeEmptyFunction$1(true);
-emptyFunction$2.thatReturnsNull = makeEmptyFunction$1(null);
-emptyFunction$2.thatReturnsThis = function () {
- return this;
-};
-emptyFunction$2.thatReturnsArgument = function (arg) {
- return arg;
-};
-
-var emptyFunction_1$2 = emptyFunction$2;
-
-/**
- * Copyright (c) 2013-present, Facebook, Inc.
- * All rights reserved.
- *
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
- *
- */
-
-/**
- * Use invariant() to assert state which your program assumes to be true.
- *
- * Provide sprintf-style format (only %s is supported) and arguments
- * to provide information about what broke and what you were
- * expecting.
- *
- * The invariant message will be stripped in production, but the invariant
- * will remain to ensure logic does not differ in production.
- */
-
-var validateFormat$1 = function validateFormat(format) {};
-
-{
- validateFormat$1 = function validateFormat(format) {
- if (format === undefined) {
- throw new Error('invariant requires an error message argument');
- }
- };
-}
-
-function invariant$7(condition, format, a, b, c, d, e, f) {
- validateFormat$1(format);
-
- if (!condition) {
- var error;
- if (format === undefined) {
- error = new Error('Minified exception occurred; use the non-minified dev environment ' + 'for the full error message and additional helpful warnings.');
- } else {
- var args = [a, b, c, d, e, f];
- var argIndex = 0;
- error = new Error(format.replace(/%s/g, function () {
- return args[argIndex++];
- }));
- error.name = 'Invariant Violation';
- }
-
- error.framesToPop = 1; // we don't care about invariant's own frame
- throw error;
- }
-}
-
-var invariant_1$4 = invariant$7;
-
-/**
- * Similar to invariant but only logs a warning if the condition is not met.
- * This can be used to log issues in development environments in critical
- * paths. Removing the logging code for production environments will keep the
- * same logic and follow the same code paths.
- */
-
-var warning$6 = emptyFunction_1$2;
-
-{
- var printWarning$1 = function printWarning(format) {
- for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
- args[_key - 1] = arguments[_key];
- }
-
- var argIndex = 0;
- var message = 'Warning: ' + format.replace(/%s/g, function () {
- return args[argIndex++];
- });
- if (typeof console !== 'undefined') {
- console.error(message);
- }
- try {
- // --- Welcome to debugging React ---
- // This error was thrown as a convenience so that you can use this stack
- // to find the callsite that caused this warning to fire.
- throw new Error(message);
- } catch (x) {}
- };
-
- warning$6 = function warning(condition, format) {
- if (format === undefined) {
- throw new Error('`warning(condition, format, ...args)` requires a warning ' + 'message argument');
- }
-
- if (format.indexOf('Failed Composite propType: ') === 0) {
- return; // Ignore CompositeComponent proptype check.
- }
-
- if (!condition) {
- for (var _len2 = arguments.length, args = Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) {
- args[_key2 - 2] = arguments[_key2];
- }
-
- printWarning$1.apply(undefined, [format].concat(args));
- }
- };
-}
-
-var warning_1$4 = warning$6;
-
-/**
- * Copyright 2013-present, Facebook, Inc.
- * All rights reserved.
- *
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
- */
-
-var ReactPropTypesSecret$3 = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
-
-var ReactPropTypesSecret_1$2 = ReactPropTypesSecret$3;
-
-{
- var invariant$8 = invariant_1$4;
- var warning$7 = warning_1$4;
- var ReactPropTypesSecret$4 = ReactPropTypesSecret_1$2;
- var loggedTypeFailures$1 = {};
-}
-
-/**
- * Assert that the values match with the type specs.
- * Error messages are memorized and will only be shown once.
- *
- * @param {object} typeSpecs Map of name to a ReactPropType
- * @param {object} values Runtime values that need to be type-checked
- * @param {string} location e.g. "prop", "context", "child context"
- * @param {string} componentName Name of the component for error messages.
- * @param {?Function} getStack Returns the component stack.
- * @private
- */
-function checkPropTypes$2(typeSpecs, values, location, componentName, getStack) {
- {
- for (var typeSpecName in typeSpecs) {
- if (typeSpecs.hasOwnProperty(typeSpecName)) {
- var error;
- // Prop type validation may throw. In case they do, we don't want to
- // fail the render phase where it didn't fail before. So we log it.
- // After these have been cleaned up, we'll let them throw.
- try {
- // This is intentionally an invariant that gets caught. It's the same
- // behavior as without this statement except with a better message.
- invariant$8(typeof typeSpecs[typeSpecName] === 'function', '%s: %s type `%s` is invalid; it must be a function, usually from ' + 'React.PropTypes.', componentName || 'React class', location, typeSpecName);
- error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret$4);
- } catch (ex) {
- error = ex;
- }
- warning$7(!error || error instanceof Error, '%s: type specification of %s `%s` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a %s. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).', componentName || 'React class', location, typeSpecName, typeof error);
- if (error instanceof Error && !(error.message in loggedTypeFailures$1)) {
- // Only monitor this failure once because there tends to be a lot of the
- // same error.
- loggedTypeFailures$1[error.message] = true;
-
- var stack = getStack ? getStack() : '';
-
- warning$7(false, 'Failed %s type: %s%s', location, error.message, stack != null ? stack : '');
- }
- }
- }
- }
-}
-
-var checkPropTypes_1$2 = checkPropTypes$2;
-
-var factoryWithTypeCheckers$2 = function (isValidElement, throwOnDirectAccess) {
- /* global Symbol */
- var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
- var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec.
-
- /**
- * Returns the iterator method function contained on the iterable object.
- *
- * Be sure to invoke the function with the iterable as context:
- *
- * var iteratorFn = getIteratorFn(myIterable);
- * if (iteratorFn) {
- * var iterator = iteratorFn.call(myIterable);
- * ...
- * }
- *
- * @param {?object} maybeIterable
- * @return {?function}
- */
- function getIteratorFn(maybeIterable) {
- var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]);
- if (typeof iteratorFn === 'function') {
- return iteratorFn;
- }
- }
-
- /**
- * Collection of methods that allow declaration and validation of props that are
- * supplied to React components. Example usage:
- *
- * var Props = require('ReactPropTypes');
- * var MyArticle = React.createClass({
- * propTypes: {
- * // An optional string prop named "description".
- * description: Props.string,
- *
- * // A required enum prop named "category".
- * category: Props.oneOf(['News','Photos']).isRequired,
- *
- * // A prop named "dialog" that requires an instance of Dialog.
- * dialog: Props.instanceOf(Dialog).isRequired
- * },
- * render: function() { ... }
- * });
- *
- * A more formal specification of how these methods are used:
- *
- * type := array|bool|func|object|number|string|oneOf([...])|instanceOf(...)
- * decl := ReactPropTypes.{type}(.isRequired)?
- *
- * Each and every declaration produces a function with the same signature. This
- * allows the creation of custom validation functions. For example:
- *
- * var MyLink = React.createClass({
- * propTypes: {
- * // An optional string or URI prop named "href".
- * href: function(props, propName, componentName) {
- * var propValue = props[propName];
- * if (propValue != null && typeof propValue !== 'string' &&
- * !(propValue instanceof URI)) {
- * return new Error(
- * 'Expected a string or an URI for ' + propName + ' in ' +
- * componentName
- * );
- * }
- * }
- * },
- * render: function() {...}
- * });
- *
- * @internal
- */
-
- var ANONYMOUS = '<<anonymous>>';
-
- // Important!
- // Keep this list in sync with production version in `./factoryWithThrowingShims.js`.
- var ReactPropTypes = {
- array: createPrimitiveTypeChecker('array'),
- bool: createPrimitiveTypeChecker('boolean'),
- func: createPrimitiveTypeChecker('function'),
- number: createPrimitiveTypeChecker('number'),
- object: createPrimitiveTypeChecker('object'),
- string: createPrimitiveTypeChecker('string'),
- symbol: createPrimitiveTypeChecker('symbol'),
-
- any: createAnyTypeChecker(),
- arrayOf: createArrayOfTypeChecker,
- element: createElementTypeChecker(),
- instanceOf: createInstanceTypeChecker,
- node: createNodeChecker(),
- objectOf: createObjectOfTypeChecker,
- oneOf: createEnumTypeChecker,
- oneOfType: createUnionTypeChecker,
- shape: createShapeTypeChecker
- };
-
- /**
- * inlined Object.is polyfill to avoid requiring consumers ship their own
- * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is
- */
- /*eslint-disable no-self-compare*/
- function is(x, y) {
- // SameValue algorithm
- if (x === y) {
- // Steps 1-5, 7-10
- // Steps 6.b-6.e: +0 != -0
- return x !== 0 || 1 / x === 1 / y;
- } else {
- // Step 6.a: NaN == NaN
- return x !== x && y !== y;
- }
- }
- /*eslint-enable no-self-compare*/
-
- /**
- * We use an Error-like object for backward compatibility as people may call
- * PropTypes directly and inspect their output. However, we don't use real
- * Errors anymore. We don't inspect their stack anyway, and creating them
- * is prohibitively expensive if they are created too often, such as what
- * happens in oneOfType() for any type before the one that matched.
- */
- function PropTypeError(message) {
- this.message = message;
- this.stack = '';
- }
- // Make `instanceof Error` still work for returned errors.
- PropTypeError.prototype = Error.prototype;
-
- function createChainableTypeChecker(validate) {
- {
- var manualPropTypeCallCache = {};
- var manualPropTypeWarningCount = 0;
- }
- function checkType(isRequired, props, propName, componentName, location, propFullName, secret) {
- componentName = componentName || ANONYMOUS;
- propFullName = propFullName || propName;
-
- if (secret !== ReactPropTypesSecret_1$2) {
- if (throwOnDirectAccess) {
- // New behavior only for users of `prop-types` package
- invariant_1$4(false, 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' + 'Use `PropTypes.checkPropTypes()` to call them. ' + 'Read more at http://fb.me/use-check-prop-types');
- } else if ("development" !== 'production' && typeof console !== 'undefined') {
- // Old behavior for people using React.PropTypes
- var cacheKey = componentName + ':' + propName;
- if (!manualPropTypeCallCache[cacheKey] &&
- // Avoid spamming the console because they are often not actionable except for lib authors
- manualPropTypeWarningCount < 3) {
- warning_1$4(false, 'You are manually calling a React.PropTypes validation ' + 'function for the `%s` prop on `%s`. This is deprecated ' + 'and will throw in the standalone `prop-types` package. ' + 'You may be seeing this warning due to a third-party PropTypes ' + 'library. See https://fb.me/react-warning-dont-call-proptypes ' + 'for details.', propFullName, componentName);
- manualPropTypeCallCache[cacheKey] = true;
- manualPropTypeWarningCount++;
- }
- }
- }
- if (props[propName] == null) {
- if (isRequired) {
- if (props[propName] === null) {
- return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required ' + ('in `' + componentName + '`, but its value is `null`.'));
- }
- return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required in ' + ('`' + componentName + '`, but its value is `undefined`.'));
- }
- return null;
- } else {
- return validate(props, propName, componentName, location, propFullName);
- }
- }
-
- var chainedCheckType = checkType.bind(null, false);
- chainedCheckType.isRequired = checkType.bind(null, true);
-
- return chainedCheckType;
- }
-
- function createPrimitiveTypeChecker(expectedType) {
- function validate(props, propName, componentName, location, propFullName, secret) {
- var propValue = props[propName];
- var propType = getPropType(propValue);
- if (propType !== expectedType) {
- // `propValue` being instance of, say, date/regexp, pass the 'object'
- // check, but we can offer a more precise error message here rather than
- // 'of type `object`'.
- var preciseType = getPreciseType(propValue);
-
- return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.'));
- }
- return null;
- }
- return createChainableTypeChecker(validate);
- }
-
- function createAnyTypeChecker() {
- return createChainableTypeChecker(emptyFunction_1$2.thatReturnsNull);
- }
-
- function createArrayOfTypeChecker(typeChecker) {
- function validate(props, propName, componentName, location, propFullName) {
- if (typeof typeChecker !== 'function') {
- return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside arrayOf.');
- }
- var propValue = props[propName];
- if (!Array.isArray(propValue)) {
- var propType = getPropType(propValue);
- return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an array.'));
- }
- for (var i = 0; i < propValue.length; i++) {
- var error = typeChecker(propValue, i, componentName, location, propFullName + '[' + i + ']', ReactPropTypesSecret_1$2);
- if (error instanceof Error) {
- return error;
- }
- }
- return null;
- }
- return createChainableTypeChecker(validate);
- }
-
- function createElementTypeChecker() {
- function validate(props, propName, componentName, location, propFullName) {
- var propValue = props[propName];
- if (!isValidElement(propValue)) {
- var propType = getPropType(propValue);
- return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement.'));
- }
- return null;
- }
- return createChainableTypeChecker(validate);
- }
-
- function createInstanceTypeChecker(expectedClass) {
- function validate(props, propName, componentName, location, propFullName) {
- if (!(props[propName] instanceof expectedClass)) {
- var expectedClassName = expectedClass.name || ANONYMOUS;
- var actualClassName = getClassName(props[propName]);
- return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + actualClassName + '` supplied to `' + componentName + '`, expected ') + ('instance of `' + expectedClassName + '`.'));
- }
- return null;
- }
- return createChainableTypeChecker(validate);
- }
-
- function createEnumTypeChecker(expectedValues) {
- if (!Array.isArray(expectedValues)) {
- warning_1$4(false, 'Invalid argument supplied to oneOf, expected an instance of array.');
- return emptyFunction_1$2.thatReturnsNull;
- }
-
- function validate(props, propName, componentName, location, propFullName) {
- var propValue = props[propName];
- for (var i = 0; i < expectedValues.length; i++) {
- if (is(propValue, expectedValues[i])) {
- return null;
- }
- }
-
- var valuesString = JSON.stringify(expectedValues);
- return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of value `' + propValue + '` ' + ('supplied to `' + componentName + '`, expected one of ' + valuesString + '.'));
- }
- return createChainableTypeChecker(validate);
- }
-
- function createObjectOfTypeChecker(typeChecker) {
- function validate(props, propName, componentName, location, propFullName) {
- if (typeof typeChecker !== 'function') {
- return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside objectOf.');
- }
- var propValue = props[propName];
- var propType = getPropType(propValue);
- if (propType !== 'object') {
- return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an object.'));
- }
- for (var key in propValue) {
- if (propValue.hasOwnProperty(key)) {
- var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret_1$2);
- if (error instanceof Error) {
- return error;
- }
- }
- }
- return null;
- }
- return createChainableTypeChecker(validate);
- }
-
- function createUnionTypeChecker(arrayOfTypeCheckers) {
- if (!Array.isArray(arrayOfTypeCheckers)) {
- warning_1$4(false, 'Invalid argument supplied to oneOfType, expected an instance of array.');
- return emptyFunction_1$2.thatReturnsNull;
- }
-
- for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
- var checker = arrayOfTypeCheckers[i];
- if (typeof checker !== 'function') {
- warning_1$4(false, 'Invalid argument supplid to oneOfType. Expected an array of check functions, but ' + 'received %s at index %s.', getPostfixForTypeWarning(checker), i);
- return emptyFunction_1$2.thatReturnsNull;
- }
- }
-
- function validate(props, propName, componentName, location, propFullName) {
- for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
- var checker = arrayOfTypeCheckers[i];
- if (checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret_1$2) == null) {
- return null;
- }
- }
-
- return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`.'));
- }
- return createChainableTypeChecker(validate);
- }
-
- function createNodeChecker() {
- function validate(props, propName, componentName, location, propFullName) {
- if (!isNode(props[propName])) {
- return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a ReactNode.'));
- }
- return null;
- }
- return createChainableTypeChecker(validate);
- }
-
- function createShapeTypeChecker(shapeTypes) {
- function validate(props, propName, componentName, location, propFullName) {
- var propValue = props[propName];
- var propType = getPropType(propValue);
- if (propType !== 'object') {
- return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
- }
- for (var key in shapeTypes) {
- var checker = shapeTypes[key];
- if (!checker) {
- continue;
- }
- var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret_1$2);
- if (error) {
- return error;
- }
- }
- return null;
- }
- return createChainableTypeChecker(validate);
- }
-
- function isNode(propValue) {
- switch (typeof propValue) {
- case 'number':
- case 'string':
- case 'undefined':
- return true;
- case 'boolean':
- return !propValue;
- case 'object':
- if (Array.isArray(propValue)) {
- return propValue.every(isNode);
- }
- if (propValue === null || isValidElement(propValue)) {
- return true;
- }
-
- var iteratorFn = getIteratorFn(propValue);
- if (iteratorFn) {
- var iterator = iteratorFn.call(propValue);
- var step;
- if (iteratorFn !== propValue.entries) {
- while (!(step = iterator.next()).done) {
- if (!isNode(step.value)) {
- return false;
- }
- }
- } else {
- // Iterator will provide entry [k,v] tuples rather than values.
- while (!(step = iterator.next()).done) {
- var entry = step.value;
- if (entry) {
- if (!isNode(entry[1])) {
- return false;
- }
- }
- }
- }
- } else {
- return false;
- }
-
- return true;
- default:
- return false;
- }
- }
-
- function isSymbol(propType, propValue) {
- // Native Symbol.
- if (propType === 'symbol') {
- return true;
- }
-
- // 19.4.3.5 Symbol.prototype[@@toStringTag] === 'Symbol'
- if (propValue['@@toStringTag'] === 'Symbol') {
- return true;
- }
-
- // Fallback for non-spec compliant Symbols which are polyfilled.
- if (typeof Symbol === 'function' && propValue instanceof Symbol) {
- return true;
- }
-
- return false;
- }
-
- // Equivalent of `typeof` but with special handling for array and regexp.
- function getPropType(propValue) {
- var propType = typeof propValue;
- if (Array.isArray(propValue)) {
- return 'array';
- }
- if (propValue instanceof RegExp) {
- // Old webkits (at least until Android 4.0) return 'function' rather than
- // 'object' for typeof a RegExp. We'll normalize this here so that /bla/
- // passes PropTypes.object.
- return 'object';
- }
- if (isSymbol(propType, propValue)) {
- return 'symbol';
- }
- return propType;
- }
-
- // This handles more types than `getPropType`. Only used for error messages.
- // See `createPrimitiveTypeChecker`.
- function getPreciseType(propValue) {
- if (typeof propValue === 'undefined' || propValue === null) {
- return '' + propValue;
- }
- var propType = getPropType(propValue);
- if (propType === 'object') {
- if (propValue instanceof Date) {
- return 'date';
- } else if (propValue instanceof RegExp) {
- return 'regexp';
- }
- }
- return propType;
- }
-
- // Returns a string that is postfixed to a warning about an invalid type.
- // For example, "undefined" or "of type array"
- function getPostfixForTypeWarning(value) {
- var type = getPreciseType(value);
- switch (type) {
- case 'array':
- case 'object':
- return 'an ' + type;
- case 'boolean':
- case 'date':
- case 'regexp':
- return 'a ' + type;
- default:
- return type;
- }
- }
-
- // Returns class name of the object, if any.
- function getClassName(propValue) {
- if (!propValue.constructor || !propValue.constructor.name) {
- return ANONYMOUS;
- }
- return propValue.constructor.name;
- }
-
- ReactPropTypes.checkPropTypes = checkPropTypes_1$2;
- ReactPropTypes.PropTypes = ReactPropTypes;
-
- return ReactPropTypes;
-};
-
-var propTypes$1 = createCommonjsModule(function (module) {
-/**
- * Copyright 2013-present, Facebook, Inc.
- * All rights reserved.
- *
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
- */
-
-{
- var REACT_ELEMENT_TYPE = typeof Symbol === 'function' && Symbol.for && Symbol.for('react.element') || 0xeac7;
-
- var isValidElement = function (object) {
- return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
};
- // By explicitly using `prop-types` you are opting into new development behavior.
- // http://fb.me/prop-types-in-prod
- var throwOnDirectAccess = true;
- module.exports = factoryWithTypeCheckers$2(isValidElement, throwOnDirectAccess);
-}
-});
-
-var _extends = Object.assign || function (target) {
+ var _extends$2 = Object.assign || function (target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];for (var key in source) {
if (Object.prototype.hasOwnProperty.call(source, key)) {
@@ -2396,325 +1571,61 @@
}
}
}return target;
-};
-
-function _classCallCheck(instance, Constructor) {
- if (!(instance instanceof Constructor)) {
- throw new TypeError("Cannot call a class as a function");
- }
-}
-
-function _possibleConstructorReturn(self, call) {
- if (!self) {
- throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
- }return call && (typeof call === "object" || typeof call === "function") ? call : self;
-}
-
-function _inherits(subClass, superClass) {
- if (typeof superClass !== "function" && superClass !== null) {
- throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
- }subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
-}
-
-/**
- * The public API for putting history on context.
- */
-
-var Router$1 = function (_React$Component) {
- _inherits(Router, _React$Component);
-
- function Router() {
- var _temp, _this, _ret;
-
- _classCallCheck(this, Router);
-
- for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
- args[_key] = arguments[_key];
- }
-
- return _ret = (_temp = (_this = _possibleConstructorReturn(this, _React$Component.call.apply(_React$Component, [this].concat(args))), _this), _this.state = {
- match: _this.computeMatch(_this.props.history.location.pathname)
- }, _temp), _possibleConstructorReturn(_this, _ret);
- }
-
- Router.prototype.getChildContext = function getChildContext() {
- return {
- router: _extends({}, this.context.router, {
- history: this.props.history,
- route: {
- location: this.props.history.location,
- match: this.state.match
- }
- })
- };
- };
-
- Router.prototype.computeMatch = function computeMatch(pathname) {
- return {
- path: '/',
- url: '/',
- params: {},
- isExact: pathname === '/'
- };
};
- Router.prototype.componentWillMount = function componentWillMount() {
- var _this2 = this;
+ var HashChangeEvent$1 = 'hashchange';
- var _props = this.props,
- children = _props.children,
- history = _props.history;
-
- invariant_1$3(children == null || React.Children.count(children) === 1, 'A <Router> may have only one child element');
-
- // Do this here so we can setState when a <Redirect> changes the
- // location in componentWillMount. This happens e.g. when doing
- // server rendering using a <StaticRouter>.
- this.unlisten = history.listen(function () {
- _this2.setState({
- match: _this2.computeMatch(history.location.pathname)
- });
- });
- };
-
- Router.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) {
- warning_1$3(this.props.history === nextProps.history, 'You cannot change <Router history>');
- };
-
- Router.prototype.componentWillUnmount = function componentWillUnmount() {
- this.unlisten();
- };
-
- Router.prototype.render = function render() {
- var children = this.props.children;
-
- return children ? React.Children.only(children) : null;
- };
-
- return Router;
-}(React.Component);
-
-Router$1.propTypes = {
- history: propTypes$1.object.isRequired,
- children: propTypes$1.node
-};
-Router$1.contextTypes = {
- router: propTypes$1.object
-};
-Router$1.childContextTypes = {
- router: propTypes$1.object.isRequired
-};
-
-// Written in this round about way for babel-transform-imports
-
-var _typeof$1 = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) {
- return typeof obj;
-} : function (obj) {
- return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
-};
-
-
-
-
-
-
-
-
-
-
-
-var classCallCheck = function (instance, Constructor) {
- if (!(instance instanceof Constructor)) {
- throw new TypeError("Cannot call a class as a function");
- }
-};
-
-
-
-
-
-
-
-
-
-var _extends$1 = Object.assign || function (target) {
- for (var i = 1; i < arguments.length; i++) {
- var source = arguments[i];
-
- for (var key in source) {
- if (Object.prototype.hasOwnProperty.call(source, key)) {
- target[key] = source[key];
- }
- }
- }
-
- return target;
-};
-
-
-
-var inherits = function (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 objectWithoutProperties = function (obj, keys) {
- var target = {};
-
- for (var i in obj) {
- if (keys.indexOf(i) >= 0) continue;
- if (!Object.prototype.hasOwnProperty.call(obj, i)) continue;
- target[i] = obj[i];
- }
-
- return target;
-};
-
-var possibleConstructorReturn = function (self, call) {
- if (!self) {
- throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
- }
-
- return call && (typeof call === "object" || typeof call === "function") ? call : self;
-};
-
-/**
- * The public API for a <Router> that uses HTML5 history.
- */
-
-var BrowserRouter = function (_React$Component) {
- inherits(BrowserRouter, _React$Component);
-
- function BrowserRouter() {
- var _temp, _this, _ret;
-
- classCallCheck(this, BrowserRouter);
-
- for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
- args[_key] = arguments[_key];
- }
-
- return _ret = (_temp = (_this = possibleConstructorReturn(this, _React$Component.call.apply(_React$Component, [this].concat(args))), _this), _this.history = createHistory(_this.props), _temp), possibleConstructorReturn(_this, _ret);
- }
-
- BrowserRouter.prototype.componentWillMount = function componentWillMount() {
- warning_1(!this.props.history, '<BrowserRouter> ignores the history prop. To use a custom history, ' + 'use `import { Router }` instead of `import { BrowserRouter as Router }`.');
- };
-
- BrowserRouter.prototype.render = function render() {
- return React.createElement(Router$1, { history: this.history, children: this.props.children });
- };
-
- return BrowserRouter;
-}(React.Component);
-
-BrowserRouter.propTypes = {
- basename: propTypes.string,
- forceRefresh: propTypes.bool,
- getUserConfirmation: propTypes.func,
- keyLength: propTypes.number,
- children: propTypes.node
-};
-
-var createHashHistory_1 = createCommonjsModule(function (module, exports) {
-'use strict';
-
-exports.__esModule = true;
-
-var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
-
-
-
-var _warning2 = _interopRequireDefault(warning_1);
-
-
-
-var _invariant2 = _interopRequireDefault(invariant_1$2);
-
-
-
-
-
-
-
-var _createTransitionManager2 = _interopRequireDefault(createTransitionManager_1);
-
-
-
-function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-
-var HashChangeEvent = 'hashchange';
-
-var HashPathCoders = {
+ var HashPathCoders = {
hashbang: {
encodePath: function encodePath(path) {
- return path.charAt(0) === '!' ? path : '!/' + (0, PathUtils.stripLeadingSlash)(path);
+ return path.charAt(0) === '!' ? path : '!/' + stripLeadingSlash(path);
},
decodePath: function decodePath(path) {
return path.charAt(0) === '!' ? path.substr(1) : path;
}
},
noslash: {
- encodePath: PathUtils.stripLeadingSlash,
- decodePath: PathUtils.addLeadingSlash
+ encodePath: stripLeadingSlash,
+ decodePath: addLeadingSlash
},
slash: {
- encodePath: PathUtils.addLeadingSlash,
- decodePath: PathUtils.addLeadingSlash
+ encodePath: addLeadingSlash,
+ decodePath: addLeadingSlash
}
-};
+ };
-var getHashPath = function getHashPath() {
+ var getHashPath = function getHashPath() {
// We can't use window.location.hash here because it's not
// consistent across browsers - Firefox will pre-decode it!
var href = window.location.href;
var hashIndex = href.indexOf('#');
return hashIndex === -1 ? '' : href.substring(hashIndex + 1);
-};
+ };
-var pushHashPath = function pushHashPath(path) {
+ var pushHashPath = function pushHashPath(path) {
return window.location.hash = path;
-};
+ };
-var replaceHashPath = function replaceHashPath(path) {
+ var replaceHashPath = function replaceHashPath(path) {
var hashIndex = window.location.href.indexOf('#');
window.location.replace(window.location.href.slice(0, hashIndex >= 0 ? hashIndex : 0) + '#' + path);
-};
+ };
-var createHashHistory = function createHashHistory() {
+ var createHashHistory = function createHashHistory() {
var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
- (0, _invariant2.default)(DOMUtils.canUseDOM, 'Hash history needs a DOM');
+ invariant_1$1(canUseDOM, 'Hash history needs a DOM');
var globalHistory = window.history;
- var canGoWithoutReload = (0, DOMUtils.supportsGoWithoutReloadUsingHash)();
+ var canGoWithoutReload = supportsGoWithoutReloadUsingHash();
var _props$getUserConfirm = props.getUserConfirmation,
- getUserConfirmation = _props$getUserConfirm === undefined ? DOMUtils.getConfirmation : _props$getUserConfirm,
+ getUserConfirmation = _props$getUserConfirm === undefined ? getConfirmation : _props$getUserConfirm,
_props$hashType = props.hashType,
hashType = _props$hashType === undefined ? 'slash' : _props$hashType;
- var basename = props.basename ? (0, PathUtils.stripTrailingSlash)((0, PathUtils.addLeadingSlash)(props.basename)) : '';
+ var basename = props.basename ? stripTrailingSlash(addLeadingSlash(props.basename)) : '';
var _HashPathCoders$hashT = HashPathCoders[hashType],
encodePath = _HashPathCoders$hashT.encodePath,
@@ -2720,21 +1631,20 @@
encodePath = _HashPathCoders$hashT.encodePath,
decodePath = _HashPathCoders$hashT.decodePath;
-
var getDOMLocation = function getDOMLocation() {
var path = decodePath(getHashPath());
- (0, _warning2.default)(!basename || (0, PathUtils.hasBasename)(path, basename), 'You are attempting to use a basename on a page whose URL path does not begin ' + 'with the basename. Expected path "' + path + '" to begin with "' + basename + '".');
+ warning_1(!basename || hasBasename(path, basename), 'You are attempting to use a basename on a page whose URL path does not begin ' + 'with the basename. Expected path "' + path + '" to begin with "' + basename + '".');
- if (basename) path = (0, PathUtils.stripBasename)(path, basename);
+ if (basename) path = stripBasename(path, basename);
- return (0, LocationUtils.createLocation)(path);
+ return createLocation(path);
};
- var transitionManager = (0, _createTransitionManager2.default)();
+ var transitionManager = createTransitionManager();
var setState = function setState(nextState) {
- _extends(history, nextState);
+ _extends$2(history, nextState);
history.length = globalHistory.length;
@@ -2755,9 +1665,9 @@
var location = getDOMLocation();
var prevLocation = history.location;
- if (!forceNextPop && (0, LocationUtils.locationsAreEqual)(prevLocation, location)) return; // A hashchange doesn't always == location change.
+ if (!forceNextPop && locationsAreEqual(prevLocation, location)) return; // A hashchange doesn't always == location change.
- if (ignorePath === (0, PathUtils.createPath)(location)) return; // Ignore this change; we already setState in push/replace.
+ if (ignorePath === createPath(location)) return; // Ignore this change; we already setState in push/replace.
ignorePath = null;
@@ -2789,11 +1699,11 @@
// keeping a list of paths we've seen in sessionStorage.
// Instead, we just default to 0 for paths we don't know.
- var toIndex = allPaths.lastIndexOf((0, PathUtils.createPath)(toLocation));
+ var toIndex = allPaths.lastIndexOf(createPath(toLocation));
if (toIndex === -1) toIndex = 0;
- var fromIndex = allPaths.lastIndexOf((0, PathUtils.createPath)(fromLocation));
+ var fromIndex = allPaths.lastIndexOf(createPath(fromLocation));
if (fromIndex === -1) fromIndex = 0;
@@ -2812,24 +1722,24 @@
if (path !== encodedPath) replaceHashPath(encodedPath);
var initialLocation = getDOMLocation();
- var allPaths = [(0, PathUtils.createPath)(initialLocation)];
+ var allPaths = [createPath(initialLocation)];
// Public interface
var createHref = function createHref(location) {
- return '#' + encodePath(basename + (0, PathUtils.createPath)(location));
+ return '#' + encodePath(basename + createPath(location));
};
var push = function push(path, state) {
- (0, _warning2.default)(state === undefined, 'Hash history cannot push state; it is ignored');
+ warning_1(state === undefined, 'Hash history cannot push state; it is ignored');
var action = 'PUSH';
- var location = (0, LocationUtils.createLocation)(path, undefined, undefined, history.location);
+ var location = createLocation(path, undefined, undefined, history.location);
transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {
if (!ok) return;
- var path = (0, PathUtils.createPath)(location);
+ var path = createPath(location);
var encodedPath = encodePath(basename + path);
var hashChanged = getHashPath() !== encodedPath;
@@ -2840,7 +1750,7 @@
ignorePath = path;
pushHashPath(encodedPath);
- var prevIndex = allPaths.lastIndexOf((0, PathUtils.createPath)(history.location));
+ var prevIndex = allPaths.lastIndexOf(createPath(history.location));
var nextPaths = allPaths.slice(0, prevIndex === -1 ? 0 : prevIndex + 1);
nextPaths.push(path);
@@ -2848,7 +1758,7 @@
setState({ action: action, location: location });
} else {
- (0, _warning2.default)(false, 'Hash history cannot PUSH the same path; a new entry will not be added to the history stack');
+ warning_1(false, 'Hash history cannot PUSH the same path; a new entry will not be added to the history stack');
setState();
}
@@ -2856,15 +1766,15 @@
};
var replace = function replace(path, state) {
- (0, _warning2.default)(state === undefined, 'Hash history cannot replace state; it is ignored');
+ warning_1(state === undefined, 'Hash history cannot replace state; it is ignored');
var action = 'REPLACE';
- var location = (0, LocationUtils.createLocation)(path, undefined, undefined, history.location);
+ var location = createLocation(path, undefined, undefined, history.location);
transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {
if (!ok) return;
- var path = (0, PathUtils.createPath)(location);
+ var path = createPath(location);
var encodedPath = encodePath(basename + path);
var hashChanged = getHashPath() !== encodedPath;
@@ -2876,7 +1786,7 @@
replaceHashPath(encodedPath);
}
- var prevIndex = allPaths.indexOf((0, PathUtils.createPath)(history.location));
+ var prevIndex = allPaths.indexOf(createPath(history.location));
if (prevIndex !== -1) allPaths[prevIndex] = path;
@@ -2885,7 +1795,7 @@
};
var go = function go(n) {
- (0, _warning2.default)(canGoWithoutReload, 'Hash history go(n) causes a full page reload in this browser');
+ warning_1(canGoWithoutReload, 'Hash history go(n) causes a full page reload in this browser');
globalHistory.go(n);
};
@@ -2904,9 +1814,9 @@
listenerCount += delta;
if (listenerCount === 1) {
- (0, DOMUtils.addEventListener)(window, HashChangeEvent, handleHashChange);
+ addEventListener(window, HashChangeEvent$1, handleHashChange);
} else if (listenerCount === 0) {
- (0, DOMUtils.removeEventListener)(window, HashChangeEvent, handleHashChange);
+ removeEventListener(window, HashChangeEvent$1, handleHashChange);
}
};
@@ -2957,518 +1867,15 @@
};
return history;
-};
-
-exports.default = createHashHistory;
-});
-
-var createHistory$1 = unwrapExports(createHashHistory_1);
-
-/**
- * The public API for a <Router> that uses window.location.hash.
- */
-
-var HashRouter = function (_React$Component) {
- inherits(HashRouter, _React$Component);
-
- function HashRouter() {
- var _temp, _this, _ret;
-
- classCallCheck(this, HashRouter);
-
- for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
- args[_key] = arguments[_key];
- }
-
- return _ret = (_temp = (_this = possibleConstructorReturn(this, _React$Component.call.apply(_React$Component, [this].concat(args))), _this), _this.history = createHistory$1(_this.props), _temp), possibleConstructorReturn(_this, _ret);
- }
-
- HashRouter.prototype.componentWillMount = function componentWillMount() {
- warning_1(!this.props.history, '<HashRouter> ignores the history prop. To use a custom history, ' + 'use `import { Router }` instead of `import { HashRouter as Router }`.');
- };
-
- HashRouter.prototype.render = function render() {
- return React.createElement(Router$1, { history: this.history, children: this.props.children });
- };
-
- return HashRouter;
-}(React.Component);
-
-HashRouter.propTypes = {
- basename: propTypes.string,
- getUserConfirmation: propTypes.func,
- hashType: propTypes.oneOf(['hashbang', 'noslash', 'slash']),
- children: propTypes.node
-};
-
-var isModifiedEvent = function isModifiedEvent(event) {
- return !!(event.metaKey || event.altKey || event.ctrlKey || event.shiftKey);
-};
-
-/**
- * The public API for rendering a history-aware <a>.
- */
-
-var Link = function (_React$Component) {
- inherits(Link, _React$Component);
-
- function Link() {
- var _temp, _this, _ret;
-
- classCallCheck(this, Link);
-
- for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
- args[_key] = arguments[_key];
- }
-
- return _ret = (_temp = (_this = possibleConstructorReturn(this, _React$Component.call.apply(_React$Component, [this].concat(args))), _this), _this.handleClick = function (event) {
- if (_this.props.onClick) _this.props.onClick(event);
-
- if (!event.defaultPrevented && // onClick prevented default
- event.button === 0 && // ignore right clicks
- !_this.props.target && // let browser handle "target=_blank" etc.
- !isModifiedEvent(event) // ignore clicks with modifier keys
- ) {
- event.preventDefault();
-
- var history = _this.context.router.history;
- var _this$props = _this.props,
- replace = _this$props.replace,
- to = _this$props.to;
-
-
- if (replace) {
- history.replace(to);
- } else {
- history.push(to);
- }
- }
- }, _temp), possibleConstructorReturn(_this, _ret);
- }
-
- Link.prototype.render = function render() {
- var _props = this.props,
- replace = _props.replace,
- to = _props.to,
- innerRef = _props.innerRef,
- props = objectWithoutProperties(_props, ['replace', 'to', 'innerRef']); // eslint-disable-line no-unused-vars
-
- invariant_1$2(this.context.router, 'You should not use <Link> outside a <Router>');
-
- var href = this.context.router.history.createHref(typeof to === 'string' ? { pathname: to } : to);
-
- return React.createElement('a', _extends$1({}, props, { onClick: this.handleClick, href: href, ref: innerRef }));
- };
-
- return Link;
-}(React.Component);
-
-Link.propTypes = {
- onClick: propTypes.func,
- target: propTypes.string,
- replace: propTypes.bool,
- to: propTypes.oneOfType([propTypes.string, propTypes.object]).isRequired,
- innerRef: propTypes.oneOfType([propTypes.string, propTypes.func])
-};
-Link.defaultProps = {
- replace: false
-};
-Link.contextTypes = {
- router: propTypes.shape({
- history: propTypes.shape({
- push: propTypes.func.isRequired,
- replace: propTypes.func.isRequired,
- createHref: propTypes.func.isRequired
- }).isRequired
- }).isRequired
-};
-
-var PathUtils$2 = createCommonjsModule(function (module, exports) {
-'use strict';
-
-exports.__esModule = true;
-var addLeadingSlash = exports.addLeadingSlash = function addLeadingSlash(path) {
- return path.charAt(0) === '/' ? path : '/' + path;
-};
-
-var stripLeadingSlash = exports.stripLeadingSlash = function stripLeadingSlash(path) {
- return path.charAt(0) === '/' ? path.substr(1) : path;
-};
-
-var hasBasename = exports.hasBasename = function hasBasename(path, prefix) {
- return new RegExp('^' + prefix + '(\\/|\\?|#|$)', 'i').test(path);
-};
-
-var stripBasename = exports.stripBasename = function stripBasename(path, prefix) {
- return hasBasename(path, prefix) ? path.substr(prefix.length) : path;
-};
-
-var stripTrailingSlash = exports.stripTrailingSlash = function stripTrailingSlash(path) {
- return path.charAt(path.length - 1) === '/' ? path.slice(0, -1) : path;
-};
-
-var parsePath = exports.parsePath = function parsePath(path) {
- var pathname = path || '/';
- var search = '';
- var hash = '';
-
- var hashIndex = pathname.indexOf('#');
- if (hashIndex !== -1) {
- hash = pathname.substr(hashIndex);
- pathname = pathname.substr(0, hashIndex);
- }
-
- var searchIndex = pathname.indexOf('?');
- if (searchIndex !== -1) {
- search = pathname.substr(searchIndex);
- pathname = pathname.substr(0, searchIndex);
- }
-
- return {
- pathname: pathname,
- search: search === '?' ? '' : search,
- hash: hash === '#' ? '' : hash
};
-};
-
-var createPath = exports.createPath = function createPath(location) {
- var pathname = location.pathname,
- search = location.search,
- hash = location.hash;
-
- var path = pathname || '/';
-
- if (search && search !== '?') path += search.charAt(0) === '?' ? search : '?' + search;
-
- if (hash && hash !== '#') path += hash.charAt(0) === '#' ? hash : '#' + hash;
-
- return path;
-};
-});
-
-var PathUtils_1$1 = PathUtils$2.addLeadingSlash;
-var PathUtils_6$1 = PathUtils$2.parsePath;
-var PathUtils_7$1 = PathUtils$2.createPath;
-
-function isAbsolute$1(pathname) {
- return pathname.charAt(0) === '/';
-}
-
-// About 1.5x faster than the two-arg version of Array#splice()
-function spliceOne$1(list, index) {
- for (var i = index, k = i + 1, n = list.length; k < n; i += 1, k += 1) {
- list[i] = list[k];
- }
-
- list.pop();
-}
-
-// This implementation is based heavily on node's url.parse
-function resolvePathname$3(to) {
- var from = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
-
- var toParts = to && to.split('/') || [];
- var fromParts = from && from.split('/') || [];
-
- var isToAbs = to && isAbsolute$1(to);
- var isFromAbs = from && isAbsolute$1(from);
- var mustEndAbs = isToAbs || isFromAbs;
-
- if (to && isAbsolute$1(to)) {
- // to is absolute
- fromParts = toParts;
- } else if (toParts.length) {
- // to is relative, drop the filename
- fromParts.pop();
- fromParts = fromParts.concat(toParts);
- }
- if (!fromParts.length) return '/';
-
- var hasTrailingSlash = void 0;
- if (fromParts.length) {
- var last = fromParts[fromParts.length - 1];
- hasTrailingSlash = last === '.' || last === '..' || last === '';
- } else {
- hasTrailingSlash = false;
- }
-
- var up = 0;
- for (var i = fromParts.length; i >= 0; i--) {
- var part = fromParts[i];
-
- if (part === '.') {
- spliceOne$1(fromParts, i);
- } else if (part === '..') {
- spliceOne$1(fromParts, i);
- up++;
- } else if (up) {
- spliceOne$1(fromParts, i);
- up--;
- }
- }
-
- if (!mustEndAbs) for (; up--; up) {
- fromParts.unshift('..');
- }if (mustEndAbs && fromParts[0] !== '' && (!fromParts[0] || !isAbsolute$1(fromParts[0]))) fromParts.unshift('');
-
- var result = fromParts.join('/');
-
- if (hasTrailingSlash && result.substr(-1) !== '/') result += '/';
-
- return result;
-}
-
-
-
-var resolvePathname$5 = Object.freeze({
- default: resolvePathname$3
-});
-
-var _typeof$2 = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) {
+ var _typeof$2 = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) {
return typeof obj;
-} : function (obj) {
+ } : function (obj) {
return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
-};
-
-function valueEqual$3(a, b) {
- if (a === b) return true;
-
- 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 valueEqual$3(item, b[index]);
- });
- }
-
- var aType = typeof a === 'undefined' ? 'undefined' : _typeof$2(a);
- var bType = typeof b === 'undefined' ? 'undefined' : _typeof$2(b);
-
- if (aType !== bType) return false;
-
- if (aType === 'object') {
- var aValue = a.valueOf();
- var bValue = b.valueOf();
-
- if (aValue !== a || bValue !== b) return valueEqual$3(aValue, bValue);
-
- var aKeys = Object.keys(a);
- var bKeys = Object.keys(b);
-
- if (aKeys.length !== bKeys.length) return false;
-
- return aKeys.every(function (key) {
- return valueEqual$3(a[key], b[key]);
- });
- }
-
- return false;
-}
-
-
-
-var valueEqual$5 = Object.freeze({
- default: valueEqual$3
-});
-
-var _resolvePathname$1 = ( resolvePathname$5 && resolvePathname$3 ) || resolvePathname$5;
-
-var _valueEqual$1 = ( valueEqual$5 && valueEqual$3 ) || valueEqual$5;
-
-var LocationUtils$2 = createCommonjsModule(function (module, exports) {
-'use strict';
-
-exports.__esModule = true;
-exports.locationsAreEqual = exports.createLocation = undefined;
-
-var _extends = Object.assign || function (target) {
- for (var i = 1; i < arguments.length; i++) {
- var source = arguments[i];for (var key in source) {
- if (Object.prototype.hasOwnProperty.call(source, key)) {
- target[key] = source[key];
- }
- }
- }return target;
-};
-
-
-
-var _resolvePathname2 = _interopRequireDefault(_resolvePathname$1);
-
-
-
-var _valueEqual2 = _interopRequireDefault(_valueEqual$1);
-
-
-
-function _interopRequireDefault(obj) {
- return obj && obj.__esModule ? obj : { default: obj };
-}
-
-var createLocation = exports.createLocation = function createLocation(path, state, key, currentLocation) {
- var location = void 0;
- if (typeof path === 'string') {
- // Two-arg form: push(path, state)
- location = (0, PathUtils$2.parsePath)(path);
- location.state = state;
- } else {
- // One-arg form: push(location)
- location = _extends({}, path);
-
- if (location.pathname === undefined) location.pathname = '';
-
- if (location.search) {
- if (location.search.charAt(0) !== '?') location.search = '?' + location.search;
- } else {
- location.search = '';
- }
-
- if (location.hash) {
- if (location.hash.charAt(0) !== '#') location.hash = '#' + location.hash;
- } else {
- location.hash = '';
- }
-
- if (state !== undefined && location.state === undefined) location.state = state;
- }
-
- try {
- location.pathname = decodeURI(location.pathname);
- } catch (e) {
- if (e instanceof URIError) {
- throw new URIError('Pathname "' + location.pathname + '" could not be decoded. ' + 'This is likely caused by an invalid percent-encoding.');
- } else {
- throw e;
- }
- }
-
- if (key) location.key = key;
-
- if (currentLocation) {
- // Resolve incomplete/relative pathname relative to current location.
- if (!location.pathname) {
- location.pathname = currentLocation.pathname;
- } else if (location.pathname.charAt(0) !== '/') {
- location.pathname = (0, _resolvePathname2.default)(location.pathname, currentLocation.pathname);
- }
- } else {
- // When there is no prior location and pathname is empty, set it to /
- if (!location.pathname) {
- location.pathname = '/';
- }
- }
-
- return location;
-};
-
-var locationsAreEqual = exports.locationsAreEqual = function locationsAreEqual(a, b) {
- return a.pathname === b.pathname && a.search === b.search && a.hash === b.hash && a.key === b.key && (0, _valueEqual2.default)(a.state, b.state);
-};
-});
-
-var createTransitionManager_1$1 = createCommonjsModule(function (module, exports) {
-'use strict';
-
-exports.__esModule = true;
-
-
-
-var _warning2 = _interopRequireDefault(warning_1$3);
-
-function _interopRequireDefault(obj) {
- return obj && obj.__esModule ? obj : { default: obj };
-}
-
-var createTransitionManager = function createTransitionManager() {
- var prompt = null;
-
- var setPrompt = function setPrompt(nextPrompt) {
- (0, _warning2.default)(prompt == null, 'A history supports only one prompt at a time');
-
- prompt = nextPrompt;
-
- return function () {
- if (prompt === nextPrompt) prompt = null;
- };
- };
-
- var confirmTransitionTo = function confirmTransitionTo(location, action, getUserConfirmation, callback) {
- // TODO: If another transition starts while we're still confirming
- // the previous one, we may end up in a weird state. Figure out the
- // best way to handle this.
- if (prompt != null) {
- var result = typeof prompt === 'function' ? prompt(location, action) : prompt;
-
- if (typeof result === 'string') {
- if (typeof getUserConfirmation === 'function') {
- getUserConfirmation(result, callback);
- } else {
- (0, _warning2.default)(false, 'A history needs a getUserConfirmation function in order to use a prompt message');
-
- callback(true);
- }
- } else {
- // Return false from a transition hook to cancel the transition.
- callback(result !== false);
- }
- } else {
- callback(true);
- }
- };
-
- var listeners = [];
-
- var appendListener = function appendListener(fn) {
- var isActive = true;
-
- var listener = function listener() {
- if (isActive) fn.apply(undefined, arguments);
};
- listeners.push(listener);
-
- return function () {
- isActive = false;
- listeners = listeners.filter(function (item) {
- return item !== listener;
- });
- };
- };
-
- var notifyListeners = function notifyListeners() {
- for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
- args[_key] = arguments[_key];
- }
-
- listeners.forEach(function (listener) {
- return listener.apply(undefined, args);
- });
- };
-
- return {
- setPrompt: setPrompt,
- confirmTransitionTo: confirmTransitionTo,
- appendListener: appendListener,
- notifyListeners: notifyListeners
- };
-};
-
-exports.default = createTransitionManager;
-});
-
-var createMemoryHistory_1 = createCommonjsModule(function (module, exports) {
-'use strict';
-
-exports.__esModule = true;
-
-var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) {
- return typeof obj;
-} : function (obj) {
- return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
-};
-
-var _extends = Object.assign || function (target) {
+ var _extends$3 = Object.assign || function (target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];for (var key in source) {
if (Object.prototype.hasOwnProperty.call(source, key)) {
@@ -3476,32 +1883,16 @@
}
}
}return target;
-};
-
-
-
-var _warning2 = _interopRequireDefault(warning_1$3);
-
-
-
-
-
-
-
-var _createTransitionManager2 = _interopRequireDefault(createTransitionManager_1$1);
-
-function _interopRequireDefault(obj) {
- return obj && obj.__esModule ? obj : { default: obj };
-}
+ };
-var clamp = function clamp(n, lowerBound, upperBound) {
+ var clamp = function clamp(n, lowerBound, upperBound) {
return Math.min(Math.max(n, lowerBound), upperBound);
-};
+ };
-/**
+ /**
* Creates a history object that stores locations in memory.
*/
-var createMemoryHistory = function createMemoryHistory() {
+ var createMemoryHistory = function createMemoryHistory() {
var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
var getUserConfirmation = props.getUserConfirmation,
_props$initialEntries = props.initialEntries,
@@ -3511,10 +1902,10 @@
_props$keyLength = props.keyLength,
keyLength = _props$keyLength === undefined ? 6 : _props$keyLength;
- var transitionManager = (0, _createTransitionManager2.default)();
+ var transitionManager = createTransitionManager();
var setState = function setState(nextState) {
- _extends(history, nextState);
+ _extends$3(history, nextState);
history.length = history.entries.length;
@@ -3527,18 +1918,18 @@
var index = clamp(initialIndex, 0, initialEntries.length - 1);
var entries = initialEntries.map(function (entry) {
- return typeof entry === 'string' ? (0, LocationUtils$2.createLocation)(entry, undefined, createKey()) : (0, LocationUtils$2.createLocation)(entry, undefined, entry.key || createKey());
+ return typeof entry === 'string' ? createLocation(entry, undefined, createKey()) : createLocation(entry, undefined, entry.key || createKey());
});
// Public interface
- var createHref = PathUtils$2.createPath;
+ var createHref = createPath;
var push = function push(path, state) {
- (0, _warning2.default)(!((typeof path === 'undefined' ? 'undefined' : _typeof(path)) === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored');
+ warning_1(!((typeof path === 'undefined' ? 'undefined' : _typeof$2(path)) === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored');
var action = 'PUSH';
- var location = (0, LocationUtils$2.createLocation)(path, state, createKey(), history.location);
+ var location = createLocation(path, state, createKey(), history.location);
transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {
if (!ok) return;
@@ -3563,10 +1954,10 @@
};
var replace = function replace(path, state) {
- (0, _warning2.default)(!((typeof path === 'undefined' ? 'undefined' : _typeof(path)) === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored');
+ warning_1(!((typeof path === 'undefined' ? 'undefined' : _typeof$2(path)) === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored');
var action = 'REPLACE';
- var location = (0, LocationUtils$2.createLocation)(path, state, createKey(), history.location);
+ var location = createLocation(path, state, createKey(), history.location);
transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {
if (!ok) return;
@@ -3638,36 +2029,374 @@
};
return history;
-};
+ };
-exports.default = createMemoryHistory;
-});
+ var _extends$4 = Object.assign || function (target) {
+ for (var i = 1; i < arguments.length; i++) {
+ var source = arguments[i];for (var key in source) {
+ if (Object.prototype.hasOwnProperty.call(source, key)) {
+ target[key] = source[key];
+ }
+ }
+ }return target;
+ };
-var createHistory$2 = unwrapExports(createMemoryHistory_1);
+ function _classCallCheck(instance, Constructor) {
+ if (!(instance instanceof Constructor)) {
+ throw new TypeError("Cannot call a class as a function");
+ }
+ }
-function _classCallCheck$1(instance, Constructor) {
+ function _possibleConstructorReturn(self, call) {
+ if (!self) {
+ throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
+ }return call && (typeof call === "object" || typeof call === "function") ? call : self;
+ }
+
+ function _inherits(subClass, superClass) {
+ if (typeof superClass !== "function" && superClass !== null) {
+ throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
+ }subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
+ }
+
+ /**
+ * The public API for putting history on context.
+ */
+
+ var Router = function (_React$Component) {
+ _inherits(Router, _React$Component);
+
+ function Router() {
+ var _temp, _this, _ret;
+
+ _classCallCheck(this, Router);
+
+ for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
+ args[_key] = arguments[_key];
+ }
+
+ return _ret = (_temp = (_this = _possibleConstructorReturn(this, _React$Component.call.apply(_React$Component, [this].concat(args))), _this), _this.state = {
+ match: _this.computeMatch(_this.props.history.location.pathname)
+ }, _temp), _possibleConstructorReturn(_this, _ret);
+ }
+
+ Router.prototype.getChildContext = function getChildContext() {
+ return {
+ router: _extends$4({}, this.context.router, {
+ history: this.props.history,
+ route: {
+ location: this.props.history.location,
+ match: this.state.match
+ }
+ })
+ };
+ };
+
+ Router.prototype.computeMatch = function computeMatch(pathname) {
+ return {
+ path: "/",
+ url: "/",
+ params: {},
+ isExact: pathname === "/"
+ };
+ };
+
+ Router.prototype.componentWillMount = function componentWillMount() {
+ var _this2 = this;
+
+ var _props = this.props,
+ children = _props.children,
+ history = _props.history;
+
+ invariant_1$1(children == null || React.Children.count(children) === 1, "A <Router> may have only one child element");
+
+ // Do this here so we can setState when a <Redirect> changes the
+ // location in componentWillMount. This happens e.g. when doing
+ // server rendering using a <StaticRouter>.
+ this.unlisten = history.listen(function () {
+ _this2.setState({
+ match: _this2.computeMatch(history.location.pathname)
+ });
+ });
+ };
+
+ Router.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) {
+ warning_1(this.props.history === nextProps.history, "You cannot change <Router history>");
+ };
+
+ Router.prototype.componentWillUnmount = function componentWillUnmount() {
+ this.unlisten();
+ };
+
+ Router.prototype.render = function render() {
+ var children = this.props.children;
+
+ return children ? React.Children.only(children) : null;
+ };
+
+ return Router;
+ }(React.Component);
+
+ Router.propTypes = {
+ history: propTypes.object.isRequired,
+ children: propTypes.node
+ };
+ Router.contextTypes = {
+ router: propTypes.object
+ };
+ Router.childContextTypes = {
+ router: propTypes.object.isRequired
+ };
+
+ // Written in this round about way for babel-transform-imports
+
+ var _typeof$3 = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) {
+ return typeof obj;
+ } : function (obj) {
+ return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
+ };
+
+ var classCallCheck = function (instance, Constructor) {
if (!(instance instanceof Constructor)) {
throw new TypeError("Cannot call a class as a function");
}
-}
+ };
+
+ var _extends$5 = Object.assign || function (target) {
+ for (var i = 1; i < arguments.length; i++) {
+ var source = arguments[i];
+
+ for (var key in source) {
+ if (Object.prototype.hasOwnProperty.call(source, key)) {
+ target[key] = source[key];
+ }
+ }
+ }
-function _possibleConstructorReturn$1(self, call) {
+ return target;
+ };
+
+ var inherits = function (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 objectWithoutProperties = function (obj, keys) {
+ var target = {};
+
+ for (var i in obj) {
+ if (keys.indexOf(i) >= 0) continue;
+ if (!Object.prototype.hasOwnProperty.call(obj, i)) continue;
+ target[i] = obj[i];
+ }
+
+ return target;
+ };
+
+ var possibleConstructorReturn = function (self, call) {
+ if (!self) {
+ throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
+ }
+
+ return call && (typeof call === "object" || typeof call === "function") ? call : self;
+ };
+
+ /**
+ * The public API for a <Router> that uses HTML5 history.
+ */
+
+ var BrowserRouter = function (_React$Component) {
+ inherits(BrowserRouter, _React$Component);
+
+ function BrowserRouter() {
+ var _temp, _this, _ret;
+
+ classCallCheck(this, BrowserRouter);
+
+ for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
+ args[_key] = arguments[_key];
+ }
+
+ return _ret = (_temp = (_this = possibleConstructorReturn(this, _React$Component.call.apply(_React$Component, [this].concat(args))), _this), _this.history = createBrowserHistory(_this.props), _temp), possibleConstructorReturn(_this, _ret);
+ }
+
+ BrowserRouter.prototype.componentWillMount = function componentWillMount() {
+ warning_1(!this.props.history, "<BrowserRouter> ignores the history prop. To use a custom history, " + "use `import { Router }` instead of `import { BrowserRouter as Router }`.");
+ };
+
+ BrowserRouter.prototype.render = function render() {
+ return React.createElement(Router, { history: this.history, children: this.props.children });
+ };
+
+ return BrowserRouter;
+ }(React.Component);
+
+ BrowserRouter.propTypes = {
+ basename: propTypes.string,
+ forceRefresh: propTypes.bool,
+ getUserConfirmation: propTypes.func,
+ keyLength: propTypes.number,
+ children: propTypes.node
+ };
+
+ /**
+ * The public API for a <Router> that uses window.location.hash.
+ */
+
+ var HashRouter = function (_React$Component) {
+ inherits(HashRouter, _React$Component);
+
+ function HashRouter() {
+ var _temp, _this, _ret;
+
+ classCallCheck(this, HashRouter);
+
+ for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
+ args[_key] = arguments[_key];
+ }
+
+ return _ret = (_temp = (_this = possibleConstructorReturn(this, _React$Component.call.apply(_React$Component, [this].concat(args))), _this), _this.history = createHashHistory(_this.props), _temp), possibleConstructorReturn(_this, _ret);
+ }
+
+ HashRouter.prototype.componentWillMount = function componentWillMount() {
+ warning_1(!this.props.history, "<HashRouter> ignores the history prop. To use a custom history, " + "use `import { Router }` instead of `import { HashRouter as Router }`.");
+ };
+
+ HashRouter.prototype.render = function render() {
+ return React.createElement(Router, { history: this.history, children: this.props.children });
+ };
+
+ return HashRouter;
+ }(React.Component);
+
+ HashRouter.propTypes = {
+ basename: propTypes.string,
+ getUserConfirmation: propTypes.func,
+ hashType: propTypes.oneOf(["hashbang", "noslash", "slash"]),
+ children: propTypes.node
+ };
+
+ var isModifiedEvent = function isModifiedEvent(event) {
+ return !!(event.metaKey || event.altKey || event.ctrlKey || event.shiftKey);
+ };
+
+ /**
+ * The public API for rendering a history-aware <a>.
+ */
+
+ var Link = function (_React$Component) {
+ inherits(Link, _React$Component);
+
+ function Link() {
+ var _temp, _this, _ret;
+
+ classCallCheck(this, Link);
+
+ for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
+ args[_key] = arguments[_key];
+ }
+
+ return _ret = (_temp = (_this = possibleConstructorReturn(this, _React$Component.call.apply(_React$Component, [this].concat(args))), _this), _this.handleClick = function (event) {
+ if (_this.props.onClick) _this.props.onClick(event);
+
+ if (!event.defaultPrevented && // onClick prevented default
+ event.button === 0 && // ignore everything but left clicks
+ !_this.props.target && // let browser handle "target=_blank" etc.
+ !isModifiedEvent(event) // ignore clicks with modifier keys
+ ) {
+ event.preventDefault();
+
+ var history = _this.context.router.history;
+ var _this$props = _this.props,
+ replace = _this$props.replace,
+ to = _this$props.to;
+
+
+ if (replace) {
+ history.replace(to);
+ } else {
+ history.push(to);
+ }
+ }
+ }, _temp), possibleConstructorReturn(_this, _ret);
+ }
+
+ Link.prototype.render = function render() {
+ var _props = this.props,
+ replace = _props.replace,
+ to = _props.to,
+ innerRef = _props.innerRef,
+ props = objectWithoutProperties(_props, ["replace", "to", "innerRef"]); // eslint-disable-line no-unused-vars
+
+ invariant_1$1(this.context.router, "You should not use <Link> outside a <Router>");
+
+ invariant_1$1(to !== undefined, 'You must specify the "to" property');
+
+ var history = this.context.router.history;
+
+ var location = typeof to === "string" ? createLocation(to, null, null, history.location) : to;
+
+ var href = history.createHref(location);
+ return React.createElement("a", _extends$5({}, props, { onClick: this.handleClick, href: href, ref: innerRef }));
+ };
+
+ return Link;
+ }(React.Component);
+
+ Link.propTypes = {
+ onClick: propTypes.func,
+ target: propTypes.string,
+ replace: propTypes.bool,
+ to: propTypes.oneOfType([propTypes.string, propTypes.object]).isRequired,
+ innerRef: propTypes.oneOfType([propTypes.string, propTypes.func])
+ };
+ Link.defaultProps = {
+ replace: false
+ };
+ Link.contextTypes = {
+ router: propTypes.shape({
+ history: propTypes.shape({
+ push: propTypes.func.isRequired,
+ replace: propTypes.func.isRequired,
+ createHref: propTypes.func.isRequired
+ }).isRequired
+ }).isRequired
+ };
+
+ function _classCallCheck$1(instance, Constructor) {
+ if (!(instance instanceof Constructor)) {
+ throw new TypeError("Cannot call a class as a function");
+ }
+ }
+
+ function _possibleConstructorReturn$1(self, call) {
if (!self) {
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
}return call && (typeof call === "object" || typeof call === "function") ? call : self;
-}
+ }
-function _inherits$1(subClass, superClass) {
+ function _inherits$1(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;
-}
+ }
-/**
+ /**
* The public API for a <Router> that stores location in memory.
*/
-var MemoryRouter$1 = function (_React$Component) {
+ var MemoryRouter = function (_React$Component) {
_inherits$1(MemoryRouter, _React$Component);
function MemoryRouter() {
@@ -3679,68 +2408,70 @@
args[_key] = arguments[_key];
}
- return _ret = (_temp = (_this = _possibleConstructorReturn$1(this, _React$Component.call.apply(_React$Component, [this].concat(args))), _this), _this.history = createHistory$2(_this.props), _temp), _possibleConstructorReturn$1(_this, _ret);
+ return _ret = (_temp = (_this = _possibleConstructorReturn$1(this, _React$Component.call.apply(_React$Component, [this].concat(args))), _this), _this.history = createMemoryHistory(_this.props), _temp), _possibleConstructorReturn$1(_this, _ret);
}
MemoryRouter.prototype.componentWillMount = function componentWillMount() {
- warning_1$3(!this.props.history, '<MemoryRouter> ignores the history prop. To use a custom history, ' + 'use `import { Router }` instead of `import { MemoryRouter as Router }`.');
+ warning_1(!this.props.history, "<MemoryRouter> ignores the history prop. To use a custom history, " + "use `import { Router }` instead of `import { MemoryRouter as Router }`.");
};
MemoryRouter.prototype.render = function render() {
- return React.createElement(Router$1, { history: this.history, children: this.props.children });
+ return React.createElement(Router, { history: this.history, children: this.props.children });
};
return MemoryRouter;
-}(React.Component);
+ }(React.Component);
-MemoryRouter$1.propTypes = {
- initialEntries: propTypes$1.array,
- initialIndex: propTypes$1.number,
- getUserConfirmation: propTypes$1.func,
- keyLength: propTypes$1.number,
- children: propTypes$1.node
-};
-
-// Written in this round about way for babel-transform-imports
-
-var isarray = Array.isArray || function (arr) {
- return Object.prototype.toString.call(arr) == '[object Array]';
-};
+ MemoryRouter.propTypes = {
+ initialEntries: propTypes.array,
+ initialIndex: propTypes.number,
+ getUserConfirmation: propTypes.func,
+ keyLength: propTypes.number,
+ children: propTypes.node
+ };
+
+ // Written in this round about way for babel-transform-imports
+
+ var toString = {}.toString;
+
+ var isarray = Array.isArray || function (arr) {
+ return toString.call(arr) == '[object Array]';
+ };
-/**
+ /**
* Expose `pathToRegexp`.
*/
-var pathToRegexp_1 = pathToRegexp;
-var parse_1 = parse;
-var compile_1 = compile;
-var tokensToFunction_1 = tokensToFunction;
-var tokensToRegExp_1 = tokensToRegExp;
+ var pathToRegexp_1 = pathToRegexp;
+ var parse_1 = parse;
+ var compile_1 = compile;
+ var tokensToFunction_1 = tokensToFunction;
+ var tokensToRegExp_1 = tokensToRegExp;
-/**
+ /**
* The main path matching regexp utility.
*
* @type {RegExp}
*/
-var PATH_REGEXP = new RegExp([
-// Match escaped characters that would otherwise appear in future matches.
-// This allows the user to escape special characters that won't transform.
-'(\\\\.)',
-// Match Express-style parameters and un-named parameters with a prefix
-// and optional suffixes. Matches appear as:
-//
-// "/:test(\\d+)?" => ["/", "test", "\d+", undefined, "?", undefined]
-// "/route(\\d+)" => [undefined, undefined, undefined, "\d+", undefined, undefined]
-// "/*" => ["/", undefined, undefined, undefined, undefined, "*"]
-'([\\/.])?(?:(?:\\:(\\w+)(?:\\(((?:\\\\.|[^\\\\()])+)\\))?|\\(((?:\\\\.|[^\\\\()])+)\\))([+*?])?|(\\*))'].join('|'), 'g');
+ var PATH_REGEXP = new RegExp([
+ // Match escaped characters that would otherwise appear in future matches.
+ // This allows the user to escape special characters that won't transform.
+ '(\\\\.)',
+ // Match Express-style parameters and un-named parameters with a prefix
+ // and optional suffixes. Matches appear as:
+ //
+ // "/:test(\\d+)?" => ["/", "test", "\d+", undefined, "?", undefined]
+ // "/route(\\d+)" => [undefined, undefined, undefined, "\d+", undefined, undefined]
+ // "/*" => ["/", undefined, undefined, undefined, undefined, "*"]
+ '([\\/.])?(?:(?:\\:(\\w+)(?:\\(((?:\\\\.|[^\\\\()])+)\\))?|\\(((?:\\\\.|[^\\\\()])+)\\))([+*?])?|(\\*))'].join('|'), 'g');
-/**
+ /**
* Parse a string for the raw tokens.
*
* @param {string} str
* @param {Object=} options
* @return {!Array}
*/
-function parse(str, options) {
+ function parse(str, options) {
var tokens = [];
var key = 0;
var index = 0;
@@ -3804,47 +2535,47 @@
}
return tokens;
-}
+ }
-/**
+ /**
* Compile a string to a template function for the path.
*
* @param {string} str
* @param {Object=} options
* @return {!function(Object=, Object=)}
*/
-function compile(str, options) {
+ function compile(str, options) {
return tokensToFunction(parse(str, options));
-}
+ }
-/**
+ /**
* Prettier encoding of URI path segments.
*
* @param {string}
* @return {string}
*/
-function encodeURIComponentPretty(str) {
+ function encodeURIComponentPretty(str) {
return encodeURI(str).replace(/[\/?#]/g, function (c) {
return '%' + c.charCodeAt(0).toString(16).toUpperCase();
});
-}
+ }
-/**
+ /**
* Encode the asterisk parameter. Similar to `pretty`, but allows slashes.
*
* @param {string}
* @return {string}
*/
-function encodeAsterisk(str) {
+ function encodeAsterisk(str) {
return encodeURI(str).replace(/[?#]/g, function (c) {
return '%' + c.charCodeAt(0).toString(16).toUpperCase();
});
-}
+ }
-/**
+ /**
* Expose a method for transforming tokens into the path function.
*/
-function tokensToFunction(tokens) {
+ function tokensToFunction(tokens) {
// Compile all the tokens into regexps.
var matches = new Array(tokens.length);
@@ -3923,58 +2654,58 @@
return path;
};
-}
+ }
-/**
+ /**
* Escape a regular expression string.
*
* @param {string} str
* @return {string}
*/
-function escapeString(str) {
+ function escapeString(str) {
return str.replace(/([.+*?=^!:${}()[\]|\/\\])/g, '\\$1');
-}
+ }
-/**
+ /**
* Escape the capturing group by escaping special characters and meaning.
*
* @param {string} group
* @return {string}
*/
-function escapeGroup(group) {
+ function escapeGroup(group) {
return group.replace(/([=!:$\/()])/g, '\\$1');
-}
+ }
-/**
+ /**
* Attach the keys as a property of the regexp.
*
* @param {!RegExp} re
* @param {Array} keys
* @return {!RegExp}
*/
-function attachKeys(re, keys) {
+ function attachKeys(re, keys) {
re.keys = keys;
return re;
-}
+ }
-/**
+ /**
* Get the flags for a regexp from the options.
*
* @param {Object} options
* @return {string}
*/
-function flags(options) {
+ function flags(options) {
return options.sensitive ? '' : 'i';
-}
+ }
-/**
+ /**
* Pull out keys from a regexp.
*
* @param {!RegExp} path
* @param {!Array} keys
* @return {!RegExp}
*/
-function regexpToRegexp(path, keys) {
+ function regexpToRegexp(path, keys) {
// Use a negative lookahead to match only capturing groups.
var groups = path.source.match(/\((?!\?)/g);
@@ -3994,9 +2725,9 @@
}
return attachKeys(path, keys);
-}
+ }
-/**
+ /**
* Transform an array into a regexp.
*
* @param {!Array} path
@@ -4004,7 +2735,7 @@
* @param {!Object} options
* @return {!RegExp}
*/
-function arrayToRegexp(path, keys, options) {
+ function arrayToRegexp(path, keys, options) {
var parts = [];
for (var i = 0; i < path.length; i++) {
@@ -4014,9 +2745,9 @@
var regexp = new RegExp('(?:' + parts.join('|') + ')', flags(options));
return attachKeys(regexp, keys);
-}
+ }
-/**
+ /**
* Create a path regexp from string input.
*
* @param {string} path
@@ -4024,11 +2755,11 @@
* @param {!Object} options
* @return {!RegExp}
*/
-function stringToRegexp(path, keys, options) {
+ function stringToRegexp(path, keys, options) {
return tokensToRegExp(parse(path, options), keys, options);
-}
+ }
-/**
+ /**
* Expose a function for taking tokens and returning a RegExp.
*
* @param {!Array} tokens
@@ -4036,7 +2767,7 @@
* @param {Object=} options
* @return {!RegExp}
*/
-function tokensToRegExp(tokens, keys, options) {
+ function tokensToRegExp(tokens, keys, options) {
if (!isarray(keys)) {
options = /** @type {!Object} */keys || options;
keys = [];
@@ -4098,9 +2829,9 @@
}
return attachKeys(new RegExp('^' + route, flags(options)), keys);
-}
+ }
-/**
+ /**
* Normalize the given path string, returning a regular expression.
*
* An empty array can be passed in for the keys, which will hold the
@@ -4112,7 +2843,7 @@
* @param {Object=} options
* @return {!RegExp}
*/
-function pathToRegexp(path, keys, options) {
+ function pathToRegexp(path, keys, options) {
if (!isarray(keys)) {
options = /** @type {!Object} */keys || options;
keys = [];
@@ -4129,19 +2860,18 @@
}
return stringToRegexp( /** @type {string} */path, /** @type {!Array} */keys, options);
-}
-
-pathToRegexp_1.parse = parse_1;
-pathToRegexp_1.compile = compile_1;
-pathToRegexp_1.tokensToFunction = tokensToFunction_1;
-pathToRegexp_1.tokensToRegExp = tokensToRegExp_1;
-
-var patternCache = {};
-var cacheLimit = 10000;
-var cacheCount = 0;
+ }
+ pathToRegexp_1.parse = parse_1;
+ pathToRegexp_1.compile = compile_1;
+ pathToRegexp_1.tokensToFunction = tokensToFunction_1;
+ pathToRegexp_1.tokensToRegExp = tokensToRegExp_1;
+
+ var patternCache = {};
+ var cacheLimit = 10000;
+ var cacheCount = 0;
-var compilePath = function compilePath(pattern, options) {
- var cacheKey = '' + options.end + options.strict + options.sensitive;
+ var compilePath = function compilePath(pattern, options) {
+ var cacheKey = "" + options.end + options.strict + options.sensitive;
var cache = patternCache[cacheKey] || (patternCache[cacheKey] = {});
if (cache[pattern]) return cache[pattern];
@@ -4156,19 +2886,19 @@
}
return compiledPattern;
-};
+ };
-/**
+ /**
* Public API for matching a URL pathname to a path pattern.
*/
-var matchPath = function matchPath(pathname) {
+ var matchPath = function matchPath(pathname) {
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
+ var parent = arguments[2];
- if (typeof options === 'string') options = { path: options };
+ if (typeof options === "string") options = { path: options };
var _options = options,
- _options$path = _options.path,
- path = _options$path === undefined ? '/' : _options$path,
+ path = _options.path,
_options$exact = _options.exact,
exact = _options$exact === undefined ? false : _options$exact,
_options$strict = _options.strict,
@@ -4176,6 +2906,8 @@
_options$sensitive = _options.sensitive,
sensitive = _options$sensitive === undefined ? false : _options$sensitive;
+ if (path == null) return parent;
+
var _compilePath = compilePath(path, { end: exact, strict: strict, sensitive: sensitive }),
re = _compilePath.re,
keys = _compilePath.keys;
@@ -4193,16 +2925,16 @@
return {
path: path, // the path pattern used to match
- url: path === '/' && url === '' ? '/' : url, // the matched portion of the URL
+ url: path === "/" && url === "" ? "/" : url, // the matched portion of the URL
isExact: isExact, // whether or not we matched exactly
params: keys.reduce(function (memo, key, index) {
memo[key.name] = values[index];
return memo;
}, {})
};
-};
+ };
-var _extends$2 = Object.assign || function (target) {
+ var _extends$6 = Object.assign || function (target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];for (var key in source) {
if (Object.prototype.hasOwnProperty.call(source, key)) {
@@ -4210,35 +2942,35 @@
}
}
}return target;
-};
+ };
-function _classCallCheck$2(instance, Constructor) {
+ function _classCallCheck$2(instance, Constructor) {
if (!(instance instanceof Constructor)) {
throw new TypeError("Cannot call a class as a function");
}
-}
+ }
-function _possibleConstructorReturn$2(self, call) {
+ function _possibleConstructorReturn$2(self, call) {
if (!self) {
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
}return call && (typeof call === "object" || typeof call === "function") ? call : self;
-}
+ }
-function _inherits$2(subClass, superClass) {
+ function _inherits$2(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 isEmptyChildren = function isEmptyChildren(children) {
+ var isEmptyChildren = function isEmptyChildren(children) {
return React.Children.count(children) === 0;
-};
+ };
-/**
+ /**
* The public API for matching a single path and rendering.
*/
-var Route$1 = function (_React$Component) {
+ var Route = function (_React$Component) {
_inherits$2(Route, _React$Component);
function Route() {
@@ -4257,7 +2989,7 @@
Route.prototype.getChildContext = function getChildContext() {
return {
- router: _extends$2({}, this.context.router, {
+ router: _extends$6({}, this.context.router, {
route: {
location: this.props.location || this.context.router.route.location,
match: this.state.match
@@ -4276,27 +3008,27 @@
if (computedMatch) return computedMatch; // <Switch> already computed the match for us
- invariant_1$3(router, 'You should not use <Route> or withRouter() outside a <Router>');
+ invariant_1$1(router, "You should not use <Route> or withRouter() outside a <Router>");
var route = router.route;
var pathname = (location || route.location).pathname;
- return path ? matchPath(pathname, { path: path, strict: strict, exact: exact, sensitive: sensitive }) : route.match;
+ return matchPath(pathname, { path: path, strict: strict, exact: exact, sensitive: sensitive }, route.match);
};
Route.prototype.componentWillMount = function componentWillMount() {
- warning_1$3(!(this.props.component && this.props.render), 'You should not use <Route component> and <Route render> in the same route; <Route render> will be ignored');
+ warning_1(!(this.props.component && this.props.render), "You should not use <Route component> and <Route render> in the same route; <Route render> will be ignored");
- warning_1$3(!(this.props.component && this.props.children && !isEmptyChildren(this.props.children)), 'You should not use <Route component> and <Route children> in the same route; <Route children> will be ignored');
+ warning_1(!(this.props.component && this.props.children && !isEmptyChildren(this.props.children)), "You should not use <Route component> and <Route children> in the same route; <Route children> will be ignored");
- warning_1$3(!(this.props.render && this.props.children && !isEmptyChildren(this.props.children)), 'You should not use <Route render> and <Route children> in the same route; <Route children> will be ignored');
+ warning_1(!(this.props.render && this.props.children && !isEmptyChildren(this.props.children)), "You should not use <Route render> and <Route children> in the same route; <Route children> will be ignored");
};
Route.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps, nextContext) {
- warning_1$3(!(nextProps.location && !this.props.location), '<Route> elements should not change from uncontrolled to controlled (or vice versa). You initially used no "location" prop and then provided one on a subsequent render.');
+ warning_1(!(nextProps.location && !this.props.location), '<Route> elements should not change from uncontrolled to controlled (or vice versa). You initially used no "location" prop and then provided one on a subsequent render.');
- warning_1$3(!(!nextProps.location && this.props.location), '<Route> elements should not change from controlled to uncontrolled (or vice versa). You provided a "location" prop initially but omitted it on a subsequent render.');
+ warning_1(!(!nextProps.location && this.props.location), '<Route> elements should not change from controlled to uncontrolled (or vice versa). You provided a "location" prop initially but omitted it on a subsequent render.');
this.setState({
match: this.computeMatch(nextProps, nextContext.router)
@@ -4317,43 +3049,48 @@
var location = this.props.location || route.location;
var props = { match: match, location: location, history: history, staticContext: staticContext };
- return component ? // component prop gets first priority, only called if there's a match
- match ? React.createElement(component, props) : null : render ? // render prop is next, only called if there's a match
- match ? render(props) : null : children ? // children come last, always called
- typeof children === 'function' ? children(props) : !isEmptyChildren(children) ? React.Children.only(children) : null : null;
+ if (component) return match ? React.createElement(component, props) : null;
+
+ if (render) return match ? render(props) : null;
+
+ if (typeof children === "function") return children(props);
+
+ if (children && !isEmptyChildren(children)) return React.Children.only(children);
+
+ return null;
};
return Route;
-}(React.Component);
+ }(React.Component);
-Route$1.propTypes = {
- computedMatch: propTypes$1.object, // private, from <Switch>
- path: propTypes$1.string,
- exact: propTypes$1.bool,
- strict: propTypes$1.bool,
- sensitive: propTypes$1.bool,
- component: propTypes$1.func,
- render: propTypes$1.func,
- children: propTypes$1.oneOfType([propTypes$1.func, propTypes$1.node]),
- location: propTypes$1.object
-};
-Route$1.contextTypes = {
- router: propTypes$1.shape({
- history: propTypes$1.object.isRequired,
- route: propTypes$1.object.isRequired,
- staticContext: propTypes$1.object
+ Route.propTypes = {
+ computedMatch: propTypes.object, // private, from <Switch>
+ path: propTypes.string,
+ exact: propTypes.bool,
+ strict: propTypes.bool,
+ sensitive: propTypes.bool,
+ component: propTypes.func,
+ render: propTypes.func,
+ children: propTypes.oneOfType([propTypes.func, propTypes.node]),
+ location: propTypes.object
+ };
+ Route.contextTypes = {
+ router: propTypes.shape({
+ history: propTypes.object.isRequired,
+ route: propTypes.object.isRequired,
+ staticContext: propTypes.object
})
-};
-Route$1.childContextTypes = {
- router: propTypes$1.object.isRequired
-};
+ };
+ Route.childContextTypes = {
+ router: propTypes.object.isRequired
+ };
-// Written in this round about way for babel-transform-imports
+ // Written in this round about way for babel-transform-imports
-/**
+ /**
* A <Link> wrapper that knows if it's "active" or not.
*/
-var NavLink = function NavLink(_ref) {
+ var NavLink = function NavLink(_ref) {
var to = _ref.to,
exact = _ref.exact,
strict = _ref.strict,
@@ -4363,10 +3100,16 @@
activeStyle = _ref.activeStyle,
style = _ref.style,
getIsActive = _ref.isActive,
- ariaCurrent = _ref.ariaCurrent,
- rest = objectWithoutProperties(_ref, ['to', 'exact', 'strict', 'location', 'activeClassName', 'className', 'activeStyle', 'style', 'isActive', 'ariaCurrent']);
- return React.createElement(Route$1, {
- path: (typeof to === 'undefined' ? 'undefined' : _typeof$1(to)) === 'object' ? to.pathname : to,
+ ariaCurrent = _ref["aria-current"],
+ rest = objectWithoutProperties(_ref, ["to", "exact", "strict", "location", "activeClassName", "className", "activeStyle", "style", "isActive", "aria-current"]);
+
+ var path = (typeof to === "undefined" ? "undefined" : _typeof$3(to)) === "object" ? to.pathname : to;
+
+ // Regex taken from: https://github.com/pillarjs/path-to-regexp/blob/master/index.js#L202
+ var escapedPath = path && path.replace(/([.+*?=^!:${}()[\]|/\\])/g, "\\$1");
+
+ return React.createElement(Route, {
+ path: escapedPath,
exact: exact,
strict: strict,
location: location,
@@ -4376,19 +3119,19 @@
var isActive = !!(getIsActive ? getIsActive(match, location) : match);
- return React.createElement(Link, _extends$1({
+ return React.createElement(Link, _extends$5({
to: to,
className: isActive ? [className, activeClassName].filter(function (i) {
return i;
- }).join(' ') : className,
- style: isActive ? _extends$1({}, style, activeStyle) : style,
- 'aria-current': isActive && ariaCurrent
+ }).join(" ") : className,
+ style: isActive ? _extends$5({}, style, activeStyle) : style,
+ "aria-current": isActive && ariaCurrent || null
}, rest));
}
});
-};
+ };
-NavLink.propTypes = {
+ NavLink.propTypes = {
to: Link.propTypes.to,
exact: propTypes.bool,
strict: propTypes.bool,
@@ -4398,38 +3141,38 @@
activeStyle: propTypes.object,
style: propTypes.object,
isActive: propTypes.func,
- ariaCurrent: propTypes.oneOf(['page', 'step', 'location', 'true'])
-};
+ "aria-current": propTypes.oneOf(["page", "step", "location", "date", "time", "true"])
+ };
-NavLink.defaultProps = {
- activeClassName: 'active',
- ariaCurrent: 'true'
-};
+ NavLink.defaultProps = {
+ activeClassName: "active",
+ "aria-current": "page"
+ };
-function _classCallCheck$3(instance, Constructor) {
+ function _classCallCheck$3(instance, Constructor) {
if (!(instance instanceof Constructor)) {
throw new TypeError("Cannot call a class as a function");
}
-}
+ }
-function _possibleConstructorReturn$3(self, call) {
+ function _possibleConstructorReturn$3(self, call) {
if (!self) {
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
}return call && (typeof call === "object" || typeof call === "function") ? call : self;
-}
+ }
-function _inherits$3(subClass, superClass) {
+ function _inherits$3(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;
-}
+ }
-/**
+ /**
* The public API for prompting the user before navigating away
* from a screen with a component.
*/
-var Prompt$1 = function (_React$Component) {
+ var Prompt = function (_React$Component) {
_inherits$3(Prompt, _React$Component);
function Prompt() {
@@ -4452,7 +3195,7 @@
};
Prompt.prototype.componentWillMount = function componentWillMount() {
- invariant_1$3(this.context.router, 'You should not use <Prompt> outside a <Router>');
+ invariant_1$1(this.context.router, "You should not use <Prompt> outside a <Router>");
if (this.props.when) this.enable(this.props.message);
};
@@ -4474,50 +3217,60 @@
};
return Prompt;
-}(React.Component);
+ }(React.Component);
-Prompt$1.propTypes = {
- when: propTypes$1.bool,
- message: propTypes$1.oneOfType([propTypes$1.func, propTypes$1.string]).isRequired
-};
-Prompt$1.defaultProps = {
+ Prompt.propTypes = {
+ when: propTypes.bool,
+ message: propTypes.oneOfType([propTypes.func, propTypes.string]).isRequired
+ };
+ Prompt.defaultProps = {
when: true
-};
-Prompt$1.contextTypes = {
- router: propTypes$1.shape({
- history: propTypes$1.shape({
- block: propTypes$1.func.isRequired
+ };
+ Prompt.contextTypes = {
+ router: propTypes.shape({
+ history: propTypes.shape({
+ block: propTypes.func.isRequired
}).isRequired
}).isRequired
-};
+ };
-// Written in this round about way for babel-transform-imports
+ // Written in this round about way for babel-transform-imports
-var parsePath = function parsePath(path) {
- var pathname = path || '/';
- var search = '';
- var hash = '';
+ var patternCache$1 = {};
+ var cacheLimit$1 = 10000;
+ var cacheCount$1 = 0;
+
+ var compileGenerator = function compileGenerator(pattern) {
+ var cacheKey = pattern;
+ var cache = patternCache$1[cacheKey] || (patternCache$1[cacheKey] = {});
- var hashIndex = pathname.indexOf('#');
- if (hashIndex !== -1) {
- hash = pathname.substr(hashIndex);
- pathname = pathname.substr(0, hashIndex);
- }
+ if (cache[pattern]) return cache[pattern];
- var searchIndex = pathname.indexOf('?');
- if (searchIndex !== -1) {
- search = pathname.substr(searchIndex);
- pathname = pathname.substr(0, searchIndex);
+ var compiledGenerator = pathToRegexp_1.compile(pattern);
+
+ if (cacheCount$1 < cacheLimit$1) {
+ cache[pattern] = compiledGenerator;
+ cacheCount$1++;
}
- return {
- pathname: pathname,
- search: search === '?' ? '' : search,
- hash: hash === '#' ? '' : hash
+ return compiledGenerator;
+ };
+
+ /**
+ * Public API for generating a URL pathname from a pattern and parameters.
+ */
+ var generatePath = function generatePath() {
+ var pattern = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "/";
+ var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
+
+ if (pattern === "/") {
+ return pattern;
+ }
+ var generator = compileGenerator(pattern);
+ return generator(params, { pretty: true });
};
-};
-var _extends$4 = Object.assign || function (target) {
+ var _extends$7 = Object.assign || function (target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];for (var key in source) {
if (Object.prototype.hasOwnProperty.call(source, key)) {
@@ -4525,120 +3278,32 @@
}
}
}return target;
-};
-
-var createLocation = function createLocation(path, state, key, currentLocation) {
- var location = void 0;
- if (typeof path === 'string') {
- // Two-arg form: push(path, state)
- location = parsePath(path);
- location.state = state;
- } else {
- // One-arg form: push(location)
- location = _extends$4({}, path);
-
- if (location.pathname === undefined) location.pathname = '';
-
- if (location.search) {
- if (location.search.charAt(0) !== '?') location.search = '?' + location.search;
- } else {
- location.search = '';
- }
-
- if (location.hash) {
- if (location.hash.charAt(0) !== '#') location.hash = '#' + location.hash;
- } else {
- location.hash = '';
- }
-
- if (state !== undefined && location.state === undefined) location.state = state;
- }
-
- try {
- location.pathname = decodeURI(location.pathname);
- } catch (e) {
- if (e instanceof URIError) {
- throw new URIError('Pathname "' + location.pathname + '" could not be decoded. ' + 'This is likely caused by an invalid percent-encoding.');
- } else {
- throw e;
- }
- }
-
- if (key) location.key = key;
-
- if (currentLocation) {
- // Resolve incomplete/relative pathname relative to current location.
- if (!location.pathname) {
- location.pathname = currentLocation.pathname;
- } else if (location.pathname.charAt(0) !== '/') {
- location.pathname = resolvePathname$3(location.pathname, currentLocation.pathname);
- }
- } else {
- // When there is no prior location and pathname is empty, set it to /
- if (!location.pathname) {
- location.pathname = '/';
- }
- }
-
- return location;
-};
-
-var locationsAreEqual = function locationsAreEqual(a, b) {
- return a.pathname === b.pathname && a.search === b.search && a.hash === b.hash && a.key === b.key && valueEqual$3(a.state, b.state);
-};
-
-// eslint-disable-line no-alert
-
-/**
- * Returns true if the HTML5 history API is supported. Taken from Modernizr.
- *
- * https://github.com/Modernizr/Modernizr/blob/master/LICENSE
- * https://github.com/Modernizr/Modernizr/blob/master/feature-detects/history.js
- * changed to avoid false negatives for Windows Phones: https://github.com/reactjs/react-router/issues/586
- */
-
-
-/**
- * Returns true if browser fires popstate on hash change.
- * IE10 and IE11 do not.
- */
-
-
-/**
- * Returns false if using go(n) with hash history causes a full page reload.
- */
-
-
-/**
- * Returns true if a given popstate event is an extraneous WebKit event.
- * Accounts for the fact that Chrome on iOS fires real popstate events
- * containing undefined state when pressing the back button.
- */
+ };
-function _classCallCheck$4(instance, Constructor) {
+ function _classCallCheck$4(instance, Constructor) {
if (!(instance instanceof Constructor)) {
throw new TypeError("Cannot call a class as a function");
}
-}
+ }
-function _possibleConstructorReturn$4(self, call) {
+ function _possibleConstructorReturn$4(self, call) {
if (!self) {
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
}return call && (typeof call === "object" || typeof call === "function") ? call : self;
-}
+ }
-function _inherits$4(subClass, superClass) {
+ function _inherits$4(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;
-}
+ }
-/**
+ /**
* The public API for updating the location programmatically
* with a component.
*/
-var Redirect$1 = function (_React$Component) {
+ var Redirect = function (_React$Component) {
_inherits$4(Redirect, _React$Component);
function Redirect() {
@@ -4652,7 +3317,7 @@
};
Redirect.prototype.componentWillMount = function componentWillMount() {
- invariant_1$3(this.context.router, 'You should not use <Redirect> outside a <Router>');
+ invariant_1$1(this.context.router, "You should not use <Redirect> outside a <Router>");
if (this.isStatic()) this.perform();
};
@@ -4666,18 +3331,35 @@
var nextTo = createLocation(this.props.to);
if (locationsAreEqual(prevTo, nextTo)) {
- warning_1$3(false, 'You tried to redirect to the same route you\'re currently on: ' + ('"' + nextTo.pathname + nextTo.search + '"'));
+ warning_1(false, "You tried to redirect to the same route you're currently on: " + ("\"" + nextTo.pathname + nextTo.search + "\""));
return;
}
this.perform();
};
+ Redirect.prototype.computeTo = function computeTo(_ref) {
+ var computedMatch = _ref.computedMatch,
+ to = _ref.to;
+
+ if (computedMatch) {
+ if (typeof to === "string") {
+ return generatePath(to, computedMatch.params);
+ } else {
+ return _extends$7({}, to, {
+ pathname: generatePath(to.pathname, computedMatch.params)
+ });
+ }
+ }
+
+ return to;
+ };
+
Redirect.prototype.perform = function perform() {
var history = this.context.router.history;
- var _props = this.props,
- push = _props.push,
- to = _props.to;
+ var push = this.props.push;
+
+ var to = this.computeTo(this.props);
if (push) {
history.push(to);
@@ -4691,29 +3373,30 @@
};
return Redirect;
-}(React.Component);
+ }(React.Component);
-Redirect$1.propTypes = {
- push: propTypes$1.bool,
- from: propTypes$1.string,
- to: propTypes$1.oneOfType([propTypes$1.string, propTypes$1.object]).isRequired
-};
-Redirect$1.defaultProps = {
+ Redirect.propTypes = {
+ computedMatch: propTypes.object, // private, from <Switch>
+ push: propTypes.bool,
+ from: propTypes.string,
+ to: propTypes.oneOfType([propTypes.string, propTypes.object]).isRequired
+ };
+ Redirect.defaultProps = {
push: false
-};
-Redirect$1.contextTypes = {
- router: propTypes$1.shape({
- history: propTypes$1.shape({
- push: propTypes$1.func.isRequired,
- replace: propTypes$1.func.isRequired
+ };
+ Redirect.contextTypes = {
+ router: propTypes.shape({
+ history: propTypes.shape({
+ push: propTypes.func.isRequired,
+ replace: propTypes.func.isRequired
}).isRequired,
- staticContext: propTypes$1.object
+ staticContext: propTypes.object
}).isRequired
-};
+ };
-// Written in this round about way for babel-transform-imports
+ // Written in this round about way for babel-transform-imports
-var _extends$7 = Object.assign || function (target) {
+ var _extends$8 = Object.assign || function (target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];for (var key in source) {
if (Object.prototype.hasOwnProperty.call(source, key)) {
@@ -4721,91 +3404,76 @@
}
}
}return target;
-};
+ };
-function _objectWithoutProperties(obj, keys) {
+ function _objectWithoutProperties(obj, keys) {
var target = {};for (var i in obj) {
if (keys.indexOf(i) >= 0) continue;if (!Object.prototype.hasOwnProperty.call(obj, i)) continue;target[i] = obj[i];
}return target;
-}
+ }
-function _classCallCheck$5(instance, Constructor) {
+ function _classCallCheck$5(instance, Constructor) {
if (!(instance instanceof Constructor)) {
throw new TypeError("Cannot call a class as a function");
}
-}
+ }
-function _possibleConstructorReturn$5(self, call) {
+ function _possibleConstructorReturn$5(self, call) {
if (!self) {
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
}return call && (typeof call === "object" || typeof call === "function") ? call : self;
-}
+ }
-function _inherits$5(subClass, superClass) {
+ function _inherits$5(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 normalizeLocation = function normalizeLocation(object) {
- var _object$pathname = object.pathname,
- pathname = _object$pathname === undefined ? '/' : _object$pathname,
- _object$search = object.search,
- search = _object$search === undefined ? '' : _object$search,
- _object$hash = object.hash,
- hash = _object$hash === undefined ? '' : _object$hash;
+ }
- return {
- pathname: pathname,
- search: search === '?' ? '' : search,
- hash: hash === '#' ? '' : hash
+ var addLeadingSlash$1 = function addLeadingSlash(path) {
+ return path.charAt(0) === "/" ? path : "/" + path;
};
-};
-var addBasename = function addBasename(basename, location) {
+ var addBasename = function addBasename(basename, location) {
if (!basename) return location;
- return _extends$7({}, location, {
- pathname: PathUtils_1$1(basename) + location.pathname
+ return _extends$8({}, location, {
+ pathname: addLeadingSlash$1(basename) + location.pathname
});
-};
+ };
-var stripBasename$1 = function stripBasename(basename, location) {
+ var stripBasename$1 = function stripBasename(basename, location) {
if (!basename) return location;
- var base = PathUtils_1$1(basename);
+ var base = addLeadingSlash$1(basename);
if (location.pathname.indexOf(base) !== 0) return location;
- return _extends$7({}, location, {
+ return _extends$8({}, location, {
pathname: location.pathname.substr(base.length)
});
-};
-
-var createLocation$1 = function createLocation(location) {
- return typeof location === 'string' ? PathUtils_6$1(location) : normalizeLocation(location);
-};
+ };
-var createURL = function createURL(location) {
- return typeof location === 'string' ? location : PathUtils_7$1(location);
-};
+ var createURL = function createURL(location) {
+ return typeof location === "string" ? location : createPath(location);
+ };
-var staticHandler = function staticHandler(methodName) {
+ var staticHandler = function staticHandler(methodName) {
return function () {
- invariant_1$3(false, 'You cannot %s with <StaticRouter>', methodName);
+ invariant_1$1(false, "You cannot %s with <StaticRouter>", methodName);
+ };
};
-};
-var noop = function noop() {};
+ var noop = function noop() {};
-/**
+ /**
* The public top-level API for a "static" <Router>, so-called because it
* can't actually change the current location. Instead, it just records
* location changes in a context object. Useful mainly in testing and
* server-rendering scenarios.
*/
-var StaticRouter$1 = function (_React$Component) {
+ var StaticRouter = function (_React$Component) {
_inherits$5(StaticRouter, _React$Component);
function StaticRouter() {
@@ -4818,22 +3486,22 @@
}
return _ret = (_temp = (_this = _possibleConstructorReturn$5(this, _React$Component.call.apply(_React$Component, [this].concat(args))), _this), _this.createHref = function (path) {
- return PathUtils_1$1(_this.props.basename + createURL(path));
+ return addLeadingSlash$1(_this.props.basename + createURL(path));
}, _this.handlePush = function (location) {
var _this$props = _this.props,
basename = _this$props.basename,
context = _this$props.context;
- context.action = 'PUSH';
- context.location = addBasename(basename, createLocation$1(location));
+ context.action = "PUSH";
+ context.location = addBasename(basename, createLocation(location));
context.url = createURL(context.location);
}, _this.handleReplace = function (location) {
var _this$props2 = _this.props,
basename = _this$props2.basename,
context = _this$props2.context;
- context.action = 'REPLACE';
- context.location = addBasename(basename, createLocation$1(location));
+ context.action = "REPLACE";
+ context.location = addBasename(basename, createLocation(location));
context.url = createURL(context.location);
}, _this.handleListen = function () {
return noop;
@@ -4851,7 +3519,7 @@
};
StaticRouter.prototype.componentWillMount = function componentWillMount() {
- warning_1$3(!this.props.history, '<StaticRouter> ignores the history prop. To use a custom history, ' + 'use `import { Router }` instead of `import { StaticRouter as Router }`.');
+ warning_1(!this.props.history, "<StaticRouter> ignores the history prop. To use a custom history, " + "use `import { Router }` instead of `import { StaticRouter as Router }`.");
};
StaticRouter.prototype.render = function render() {
@@ -4859,65 +3527,65 @@
basename = _props.basename,
context = _props.context,
location = _props.location,
- props = _objectWithoutProperties(_props, ['basename', 'context', 'location']);
+ props = _objectWithoutProperties(_props, ["basename", "context", "location"]);
var history = {
createHref: this.createHref,
- action: 'POP',
- location: stripBasename$1(basename, createLocation$1(location)),
+ action: "POP",
+ location: stripBasename$1(basename, createLocation(location)),
push: this.handlePush,
replace: this.handleReplace,
- go: staticHandler('go'),
- goBack: staticHandler('goBack'),
- goForward: staticHandler('goForward'),
+ go: staticHandler("go"),
+ goBack: staticHandler("goBack"),
+ goForward: staticHandler("goForward"),
listen: this.handleListen,
block: this.handleBlock
};
- return React.createElement(Router$1, _extends$7({}, props, { history: history }));
+ return React.createElement(Router, _extends$8({}, props, { history: history }));
};
return StaticRouter;
-}(React.Component);
+ }(React.Component);
-StaticRouter$1.propTypes = {
- basename: propTypes$1.string,
- context: propTypes$1.object.isRequired,
- location: propTypes$1.oneOfType([propTypes$1.string, propTypes$1.object])
-};
-StaticRouter$1.defaultProps = {
- basename: '',
- location: '/'
-};
-StaticRouter$1.childContextTypes = {
- router: propTypes$1.object.isRequired
-};
+ StaticRouter.propTypes = {
+ basename: propTypes.string,
+ context: propTypes.object.isRequired,
+ location: propTypes.oneOfType([propTypes.string, propTypes.object])
+ };
+ StaticRouter.defaultProps = {
+ basename: "",
+ location: "/"
+ };
+ StaticRouter.childContextTypes = {
+ router: propTypes.object.isRequired
+ };
-// Written in this round about way for babel-transform-imports
+ // Written in this round about way for babel-transform-imports
-function _classCallCheck$6(instance, Constructor) {
+ function _classCallCheck$6(instance, Constructor) {
if (!(instance instanceof Constructor)) {
throw new TypeError("Cannot call a class as a function");
}
-}
+ }
-function _possibleConstructorReturn$6(self, call) {
+ function _possibleConstructorReturn$6(self, call) {
if (!self) {
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
}return call && (typeof call === "object" || typeof call === "function") ? call : self;
-}
+ }
-function _inherits$6(subClass, superClass) {
+ function _inherits$6(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;
-}
+ }
-/**
+ /**
* The public API for rendering the first <Route> that matches.
*/
-var Switch$1 = function (_React$Component) {
+ var Switch = function (_React$Component) {
_inherits$6(Switch, _React$Component);
function Switch() {
@@ -4927,13 +3595,13 @@
}
Switch.prototype.componentWillMount = function componentWillMount() {
- invariant_1$3(this.context.router, 'You should not use <Switch> outside a <Router>');
+ invariant_1$1(this.context.router, "You should not use <Switch> outside a <Router>");
};
Switch.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) {
- warning_1$3(!(nextProps.location && !this.props.location), '<Switch> elements should not change from uncontrolled to controlled (or vice versa). You initially used no "location" prop and then provided one on a subsequent render.');
+ warning_1(!(nextProps.location && !this.props.location), '<Switch> elements should not change from uncontrolled to controlled (or vice versa). You initially used no "location" prop and then provided one on a subsequent render.');
- warning_1$3(!(!nextProps.location && this.props.location), '<Switch> elements should not change from controlled to uncontrolled (or vice versa). You provided a "location" prop initially but omitted it on a subsequent render.');
+ warning_1(!(!nextProps.location && this.props.location), '<Switch> elements should not change from controlled to uncontrolled (or vice versa). You provided a "location" prop initially but omitted it on a subsequent render.');
};
Switch.prototype.render = function render() {
@@ -4945,8 +3613,7 @@
var match = void 0,
child = void 0;
React.Children.forEach(children, function (element) {
- if (!React.isValidElement(element)) return;
-
+ if (match == null && React.isValidElement(element)) {
var _element$props = element.props,
pathProp = _element$props.path,
exact = _element$props.exact,
@@ -4956,9 +3623,8 @@
var path = pathProp || from;
- if (match == null) {
child = element;
- match = path ? matchPath(location.pathname, { path: path, exact: exact, strict: strict, sensitive: sensitive }) : route.match;
+ match = matchPath(location.pathname, { path: path, exact: exact, strict: strict, sensitive: sensitive }, route.match);
}
});
@@ -4966,38 +3632,46 @@
};
return Switch;
-}(React.Component);
+ }(React.Component);
-Switch$1.contextTypes = {
- router: propTypes$1.shape({
- route: propTypes$1.object.isRequired
+ Switch.contextTypes = {
+ router: propTypes.shape({
+ route: propTypes.object.isRequired
}).isRequired
-};
-Switch$1.propTypes = {
- children: propTypes$1.node,
- location: propTypes$1.object
-};
+ };
+ Switch.propTypes = {
+ children: propTypes.node,
+ location: propTypes.object
+ };
+
+ // Written in this round about way for babel-transform-imports
-// Written in this round about way for babel-transform-imports
+ // Written in this round about way for babel-transform-imports
-// Written in this round about way for babel-transform-imports
+ // Written in this round about way for babel-transform-imports
-/**
+ var hoistNonReactStatics = createCommonjsModule(function (module, exports) {
+ /**
* Copyright 2015, Yahoo! Inc.
* Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.
*/
-var REACT_STATICS = {
+ (function (global, factory) {
+ module.exports = factory();
+ })(commonjsGlobal, function () {
+
+ var REACT_STATICS = {
childContextTypes: true,
contextTypes: true,
defaultProps: true,
displayName: true,
getDefaultProps: true,
+ getDerivedStateFromProps: true,
mixins: true,
propTypes: true,
type: true
-};
+ };
-var KNOWN_STATICS = {
+ var KNOWN_STATICS = {
name: true,
length: true,
prototype: true,
@@ -5005,16 +3679,16 @@
callee: true,
arguments: true,
arity: true
-};
+ };
-var defineProperty$1 = Object.defineProperty;
-var getOwnPropertyNames = Object.getOwnPropertyNames;
-var getOwnPropertySymbols = Object.getOwnPropertySymbols;
-var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
-var getPrototypeOf = Object.getPrototypeOf;
-var objectPrototype = getPrototypeOf && getPrototypeOf(Object);
+ var defineProperty = Object.defineProperty;
+ var getOwnPropertyNames = Object.getOwnPropertyNames;
+ var getOwnPropertySymbols = Object.getOwnPropertySymbols;
+ var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
+ var getPrototypeOf = Object.getPrototypeOf;
+ var objectPrototype = getPrototypeOf && getPrototypeOf(Object);
-var hoistNonReactStatics = function hoistNonReactStatics(targetComponent, sourceComponent, blacklist) {
+ return function hoistNonReactStatics(targetComponent, sourceComponent, blacklist) {
if (typeof sourceComponent !== 'string') {
// don't hoist over string (html) components
@@ -5037,7 +3711,7 @@
var descriptor = getOwnPropertyDescriptor(sourceComponent, key);
try {
// Avoid failures from read-only properties
- defineProperty$1(targetComponent, key, descriptor);
+ defineProperty(targetComponent, key, descriptor);
} catch (e) {}
}
}
@@ -5046,9 +3720,11 @@
}
return targetComponent;
-};
+ };
+ });
+ });
-var _extends$8 = Object.assign || function (target) {
+ var _extends$9 = Object.assign || function (target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];for (var key in source) {
if (Object.prototype.hasOwnProperty.call(source, key)) {
@@ -5056,52 +3732,57 @@
}
}
}return target;
-};
+ };
-function _objectWithoutProperties$1(obj, keys) {
+ function _objectWithoutProperties$1(obj, keys) {
var target = {};for (var i in obj) {
if (keys.indexOf(i) >= 0) continue;if (!Object.prototype.hasOwnProperty.call(obj, i)) continue;target[i] = obj[i];
}return target;
-}
+ }
-/**
+ /**
* A public higher-order component to access the imperative API
*/
-var withRouter$1 = function withRouter(Component) {
+ var withRouter = function withRouter(Component) {
var C = function C(props) {
var wrappedComponentRef = props.wrappedComponentRef,
- remainingProps = _objectWithoutProperties$1(props, ['wrappedComponentRef']);
+ remainingProps = _objectWithoutProperties$1(props, ["wrappedComponentRef"]);
- return React.createElement(Route$1, { render: function render(routeComponentProps) {
- return React.createElement(Component, _extends$8({}, remainingProps, routeComponentProps, { ref: wrappedComponentRef }));
- } });
+ return React.createElement(Route, {
+ children: function children(routeComponentProps) {
+ return React.createElement(Component, _extends$9({}, remainingProps, routeComponentProps, {
+ ref: wrappedComponentRef
+ }));
+ }
+ });
};
- C.displayName = 'withRouter(' + (Component.displayName || Component.name) + ')';
+ C.displayName = "withRouter(" + (Component.displayName || Component.name) + ")";
C.WrappedComponent = Component;
C.propTypes = {
- wrappedComponentRef: propTypes$1.func
+ wrappedComponentRef: propTypes.func
};
return hoistNonReactStatics(C, Component);
-};
+ };
-// Written in this round about way for babel-transform-imports
+ // Written in this round about way for babel-transform-imports
-exports.BrowserRouter = BrowserRouter;
-exports.HashRouter = HashRouter;
-exports.Link = Link;
-exports.MemoryRouter = MemoryRouter$1;
-exports.NavLink = NavLink;
-exports.Prompt = Prompt$1;
-exports.Redirect = Redirect$1;
-exports.Route = Route$1;
-exports.Router = Router$1;
-exports.StaticRouter = StaticRouter$1;
-exports.Switch = Switch$1;
-exports.matchPath = matchPath;
-exports.withRouter = withRouter$1;
+ exports.BrowserRouter = BrowserRouter;
+ exports.HashRouter = HashRouter;
+ exports.Link = Link;
+ exports.MemoryRouter = MemoryRouter;
+ exports.NavLink = NavLink;
+ exports.Prompt = Prompt;
+ exports.Redirect = Redirect;
+ exports.Route = Route;
+ exports.Router = Router;
+ exports.StaticRouter = StaticRouter;
+ exports.Switch = Switch;
+ exports.generatePath = generatePath;
+ exports.matchPath = matchPath;
+ exports.withRouter = withRouter;
-Object.defineProperty(exports, '__esModule', { value: true });
+ Object.defineProperty(exports, '__esModule', { value: true });
})));

umd/react-router-dom.min.js

@@ -1 +1 @@
-!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("react")):"function"==typeof define&&define.amd?define(["exports","react"],e):e(t.ReactRouterDOM={},t.React)}(this,function(t,e){"use strict";function n(t){return t&&t.__esModule?t.default:t}function o(t,e){return e={exports:{}},t(e,e.exports),e.exports}function r(t){return function(){return t}}function i(t){return"/"===t.charAt(0)}function a(t,e){for(var n=e,o=n+1,r=t.length;o<r;n+=1,o+=1)t[n]=t[o];t.pop()}function c(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=t&&t.split("/")||[],o=e&&e.split("/")||[],r=t&&i(t),c=e&&i(e),s=r||c;if(t&&i(t)?o=n:n.length&&(o.pop(),o=o.concat(n)),!o.length)return"/";var u=void 0;if(o.length){var p=o[o.length-1];u="."===p||".."===p||""===p}else u=!1;for(var l=0,f=o.length;f>=0;f--){var h=o[f];"."===h?a(o,f):".."===h?(a(o,f),l++):l&&(a(o,f),l--)}if(!s)for(;l--;l)o.unshift("..");!s||""===o[0]||o[0]&&i(o[0])||o.unshift("");var d=o.join("/");return u&&"/"!==d.substr(-1)&&(d+="/"),d}function s(t,e){if(t===e)return!0;if(null==t||null==e)return!1;if(Array.isArray(t))return Array.isArray(e)&&t.length===e.length&&t.every(function(t,n){return s(t,e[n])});var n=void 0===t?"undefined":ct(t);if(n!==(void 0===e?"undefined":ct(e)))return!1;if("object"===n){var o=t.valueOf(),r=e.valueOf();if(o!==t||r!==e)return s(o,r);var i=Object.keys(t),a=Object.keys(e);return i.length===a.length&&i.every(function(n){return s(t[n],e[n])})}return!1}function u(t){return function(){return t}}function p(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function l(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function f(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function h(t){return"/"===t.charAt(0)}function d(t,e){for(var n=e,o=n+1,r=t.length;o<r;n+=1,o+=1)t[n]=t[o];t.pop()}function y(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=t&&t.split("/")||[],o=e&&e.split("/")||[],r=t&&h(t),i=e&&h(e),a=r||i;if(t&&h(t)?o=n:n.length&&(o.pop(),o=o.concat(n)),!o.length)return"/";var c=void 0;if(o.length){var s=o[o.length-1];c="."===s||".."===s||""===s}else c=!1;for(var u=0,p=o.length;p>=0;p--){var l=o[p];"."===l?d(o,p):".."===l?(d(o,p),u++):u&&(d(o,p),u--)}if(!a)for(;u--;u)o.unshift("..");!a||""===o[0]||o[0]&&h(o[0])||o.unshift("");var f=o.join("/");return c&&"/"!==f.substr(-1)&&(f+="/"),f}function v(t,e){if(t===e)return!0;if(null==t||null==e)return!1;if(Array.isArray(t))return Array.isArray(e)&&t.length===e.length&&t.every(function(t,n){return v(t,e[n])});var n=void 0===t?"undefined":Ft(t);if(n!==(void 0===e?"undefined":Ft(e)))return!1;if("object"===n){var o=t.valueOf(),r=e.valueOf();if(o!==t||r!==e)return v(o,r);var i=Object.keys(t),a=Object.keys(e);return i.length===a.length&&i.every(function(n){return v(t[n],e[n])})}return!1}function m(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function b(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function g(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function w(t,e){for(var n,o=[],r=0,i=0,a="",c=e&&e.delimiter||"/";null!=(n=oe.exec(t));){var s=n[0],u=n[1],p=n.index;if(a+=t.slice(i,p),i=p+s.length,u)a+=u[1];else{var l=t[i],f=n[2],h=n[3],d=n[4],y=n[5],v=n[6],m=n[7];a&&(o.push(a),a="");var b=null!=f&&null!=l&&l!==f,g="+"===v||"*"===v,w="?"===v||"*"===v,O=n[2]||c,P=d||y;o.push({name:h||r++,prefix:f||"",delimiter:O,optional:w,repeat:g,partial:b,asterisk:!!m,pattern:P?E(P):m?".*":"[^"+R(O)+"]+?"})}}return i<t.length&&(a+=t.substr(i)),a&&o.push(a),o}function O(t){return encodeURI(t).replace(/[\/?#]/g,function(t){return"%"+t.charCodeAt(0).toString(16).toUpperCase()})}function P(t){return encodeURI(t).replace(/[?#]/g,function(t){return"%"+t.charCodeAt(0).toString(16).toUpperCase()})}function x(t){for(var e=new Array(t.length),n=0;n<t.length;n++)"object"==typeof t[n]&&(e[n]=new RegExp("^(?:"+t[n].pattern+")$"));return function(n,o){for(var r="",i=n||{},a=(o||{}).pretty?O:encodeURIComponent,c=0;c<t.length;c++){var s=t[c];if("string"!=typeof s){var u,p=i[s.name];if(null==p){if(s.optional){s.partial&&(r+=s.prefix);continue}throw new TypeError('Expected "'+s.name+'" to be defined')}if(Xt(p)){if(!s.repeat)throw new TypeError('Expected "'+s.name+'" to not repeat, but received `'+JSON.stringify(p)+"`");if(0===p.length){if(s.optional)continue;throw new TypeError('Expected "'+s.name+'" to not be empty')}for(var l=0;l<p.length;l++){if(u=a(p[l]),!e[c].test(u))throw new TypeError('Expected all "'+s.name+'" to match "'+s.pattern+'", but received `'+JSON.stringify(u)+"`");r+=(0===l?s.prefix:s.delimiter)+u}}else{if(u=s.asterisk?P(p):a(p),!e[c].test(u))throw new TypeError('Expected "'+s.name+'" to match "'+s.pattern+'", but received "'+u+'"');r+=s.prefix+u}}else r+=s}return r}}function R(t){return t.replace(/([.+*?=^!:${}()[\]|\/\\])/g,"\\$1")}function E(t){return t.replace(/([=!:$\/()])/g,"\\$1")}function j(t,e){return t.keys=e,t}function T(t){return t.sensitive?"":"i"}function S(t,e){var n=t.source.match(/\((?!\?)/g);if(n)for(var o=0;o<n.length;o++)e.push({name:o,prefix:null,delimiter:null,optional:!1,repeat:!1,partial:!1,asterisk:!1,pattern:null});return j(t,e)}function _(t,e,n){for(var o=[],r=0;r<t.length;r++)o.push(A(t[r],e,n).source);return j(new RegExp("(?:"+o.join("|")+")",T(n)),e)}function C(t,e,n){return k(w(t,n),e,n)}function k(t,e,n){Xt(e)||(n=e||n,e=[]);for(var o=(n=n||{}).strict,r=!1!==n.end,i="",a=0;a<t.length;a++){var c=t[a];if("string"==typeof c)i+=R(c);else{var s=R(c.prefix),u="(?:"+c.pattern+")";e.push(c),c.repeat&&(u+="(?:"+s+u+")*"),i+=u=c.optional?c.partial?s+"("+u+")?":"(?:"+s+"("+u+"))?":s+"("+u+")"}}var p=R(n.delimiter||"/"),l=i.slice(-p.length)===p;return o||(i=(l?i.slice(0,-p.length):i)+"(?:"+p+"(?=$))?"),i+=r?"$":o&&l?"":"(?="+p+"|$)",j(new RegExp("^"+i,T(n)),e)}function A(t,e,n){return Xt(e)||(n=e||n,e=[]),n=n||{},t instanceof RegExp?S(t,e):Xt(t)?_(t,e,n):C(t,e,n)}function L(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function M(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function U(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function q(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function H(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function I(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function Y(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function B(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function W(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function N(t,e){var n={};for(var o in t)e.indexOf(o)>=0||Object.prototype.hasOwnProperty.call(t,o)&&(n[o]=t[o]);return n}function D(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function F(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function $(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function V(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function z(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function K(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function G(t,e){var n={};for(var o in t)e.indexOf(o)>=0||Object.prototype.hasOwnProperty.call(t,o)&&(n[o]=t[o]);return n}e=e&&e.hasOwnProperty("default")?e.default:e;var J=function(){},Q=J,X=function(){};X.thatReturns=r,X.thatReturnsFalse=r(!1),X.thatReturnsTrue=r(!0),X.thatReturnsNull=r(null),X.thatReturnsThis=function(){return this},X.thatReturnsArgument=function(t){return t};var Z=X,tt=function(t){},et=function(t,e,n,o,r,i,a,c){if(tt(e),!t){var s;if(void 0===e)s=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var u=[n,o,r,i,a,c],p=0;(s=new Error(e.replace(/%s/g,function(){return u[p++]}))).name="Invariant Violation"}throw s.framesToPop=1,s}},nt="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",ot=function(){function t(t,e,n,o,r,i){i!==nt&&et(!1,"Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types")}function e(){return t}t.isRequired=t;var n={array:t,bool:t,func:t,number:t,object:t,string:t,symbol:t,any:t,arrayOf:e,element:t,instanceOf:e,node:t,objectOf:e,oneOf:e,oneOfType:e,shape:e};return n.checkPropTypes=Z,n.PropTypes=n,n},rt=o(function(t){t.exports=ot()}),it=function(t,e,n,o,r,i,a,c){if(!t){var s;if(void 0===e)s=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var u=[n,o,r,i,a,c],p=0;(s=new Error(e.replace(/%s/g,function(){return u[p++]}))).name="Invariant Violation"}throw s.framesToPop=1,s}},at=Object.freeze({default:c}),ct="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},st=Object.freeze({default:s}),ut=o(function(t,e){e.__esModule=!0;e.addLeadingSlash=function(t){return"/"===t.charAt(0)?t:"/"+t},e.stripLeadingSlash=function(t){return"/"===t.charAt(0)?t.substr(1):t};var n=e.hasBasename=function(t,e){return new RegExp("^"+e+"(\\/|\\?|#|$)","i").test(t)};e.stripBasename=function(t,e){return n(t,e)?t.substr(e.length):t},e.stripTrailingSlash=function(t){return"/"===t.charAt(t.length-1)?t.slice(0,-1):t},e.parsePath=function(t){var e=t||"/",n="",o="",r=e.indexOf("#");-1!==r&&(o=e.substr(r),e=e.substr(0,r));var i=e.indexOf("?");return-1!==i&&(n=e.substr(i),e=e.substr(0,i)),{pathname:e,search:"?"===n?"":n,hash:"#"===o?"":o}},e.createPath=function(t){var e=t.pathname,n=t.search,o=t.hash,r=e||"/";return n&&"?"!==n&&(r+="?"===n.charAt(0)?n:"?"+n),o&&"#"!==o&&(r+="#"===o.charAt(0)?o:"#"+o),r}}),pt=at&&c||at,lt=st&&s||st,ft=o(function(t,e){function n(t){return t&&t.__esModule?t:{default:t}}e.__esModule=!0,e.locationsAreEqual=e.createLocation=void 0;var o=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},r=n(pt),i=n(lt);e.createLocation=function(t,e,n,i){var a=void 0;"string"==typeof t?(a=(0,ut.parsePath)(t)).state=e:(void 0===(a=o({},t)).pathname&&(a.pathname=""),a.search?"?"!==a.search.charAt(0)&&(a.search="?"+a.search):a.search="",a.hash?"#"!==a.hash.charAt(0)&&(a.hash="#"+a.hash):a.hash="",void 0!==e&&void 0===a.state&&(a.state=e));try{a.pathname=decodeURI(a.pathname)}catch(t){throw t instanceof URIError?new URIError('Pathname "'+a.pathname+'" could not be decoded. This is likely caused by an invalid percent-encoding.'):t}return n&&(a.key=n),i?a.pathname?"/"!==a.pathname.charAt(0)&&(a.pathname=(0,r.default)(a.pathname,i.pathname)):a.pathname=i.pathname:a.pathname||(a.pathname="/"),a},e.locationsAreEqual=function(t,e){return t.pathname===e.pathname&&t.search===e.search&&t.hash===e.hash&&t.key===e.key&&(0,i.default)(t.state,e.state)}}),ht=o(function(t,e){e.__esModule=!0;var n=function(t){return t&&t.__esModule?t:{default:t}}(Q);e.default=function(){var t=null,e=[];return{setPrompt:function(e){return(0,n.default)(null==t,"A history supports only one prompt at a time"),t=e,function(){t===e&&(t=null)}},confirmTransitionTo:function(e,o,r,i){if(null!=t){var a="function"==typeof t?t(e,o):t;"string"==typeof a?"function"==typeof r?r(a,i):((0,n.default)(!1,"A history needs a getUserConfirmation function in order to use a prompt message"),i(!0)):i(!1!==a)}else i(!0)},appendListener:function(t){var n=!0,o=function(){n&&t.apply(void 0,arguments)};return e.push(o),function(){n=!1,e=e.filter(function(t){return t!==o})}},notifyListeners:function(){for(var t=arguments.length,n=Array(t),o=0;o<t;o++)n[o]=arguments[o];e.forEach(function(t){return t.apply(void 0,n)})}}}}),dt=o(function(t,e){e.__esModule=!0;e.canUseDOM=!("undefined"==typeof window||!window.document||!window.document.createElement),e.addEventListener=function(t,e,n){return t.addEventListener?t.addEventListener(e,n,!1):t.attachEvent("on"+e,n)},e.removeEventListener=function(t,e,n){return t.removeEventListener?t.removeEventListener(e,n,!1):t.detachEvent("on"+e,n)},e.getConfirmation=function(t,e){return e(window.confirm(t))},e.supportsHistory=function(){var t=window.navigator.userAgent;return(-1===t.indexOf("Android 2.")&&-1===t.indexOf("Android 4.0")||-1===t.indexOf("Mobile Safari")||-1!==t.indexOf("Chrome")||-1!==t.indexOf("Windows Phone"))&&(window.history&&"pushState"in window.history)},e.supportsPopStateOnHashChange=function(){return-1===window.navigator.userAgent.indexOf("Trident")},e.supportsGoWithoutReloadUsingHash=function(){return-1===window.navigator.userAgent.indexOf("Firefox")},e.isExtraneousPopstateEvent=function(t){return void 0===t.state&&-1===navigator.userAgent.indexOf("CriOS")}}),yt=n(o(function(t,e){function n(t){return t&&t.__esModule?t:{default:t}}e.__esModule=!0;var o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},i=n(Q),a=n(it),c=n(ht),s=function(){try{return window.history.state||{}}catch(t){return{}}};e.default=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(0,a.default)(dt.canUseDOM,"Browser history needs a DOM");var e=window.history,n=(0,dt.supportsHistory)(),u=!(0,dt.supportsPopStateOnHashChange)(),p=t.forceRefresh,l=void 0!==p&&p,f=t.getUserConfirmation,h=void 0===f?dt.getConfirmation:f,d=t.keyLength,y=void 0===d?6:d,v=t.basename?(0,ut.stripTrailingSlash)((0,ut.addLeadingSlash)(t.basename)):"",m=function(t){var e=t||{},n=e.key,o=e.state,r=window.location,a=r.pathname+r.search+r.hash;return(0,i.default)(!v||(0,ut.hasBasename)(a,v),'You are attempting to use a basename on a page whose URL path does not begin with the basename. Expected path "'+a+'" to begin with "'+v+'".'),v&&(a=(0,ut.stripBasename)(a,v)),(0,ft.createLocation)(a,o,n)},b=function(){return Math.random().toString(36).substr(2,y)},g=(0,c.default)(),w=function(t){r(L,t),L.length=e.length,g.notifyListeners(L.location,L.action)},O=function(t){(0,dt.isExtraneousPopstateEvent)(t)||R(m(t.state))},P=function(){R(m(s()))},x=!1,R=function(t){x?(x=!1,w()):g.confirmTransitionTo(t,"POP",h,function(e){e?w({action:"POP",location:t}):E(t)})},E=function(t){var e=L.location,n=T.indexOf(e.key);-1===n&&(n=0);var o=T.indexOf(t.key);-1===o&&(o=0);var r=n-o;r&&(x=!0,_(r))},j=m(s()),T=[j.key],S=function(t){return v+(0,ut.createPath)(t)},_=function(t){e.go(t)},C=0,k=function(t){1===(C+=t)?((0,dt.addEventListener)(window,"popstate",O),u&&(0,dt.addEventListener)(window,"hashchange",P)):0===C&&((0,dt.removeEventListener)(window,"popstate",O),u&&(0,dt.removeEventListener)(window,"hashchange",P))},A=!1,L={length:e.length,action:"POP",location:j,createHref:S,push:function(t,r){(0,i.default)(!("object"===(void 0===t?"undefined":o(t))&&void 0!==t.state&&void 0!==r),"You should avoid providing a 2nd state argument to push when the 1st argument is a location-like object that already has state; it is ignored");var a=(0,ft.createLocation)(t,r,b(),L.location);g.confirmTransitionTo(a,"PUSH",h,function(t){if(t){var o=S(a),r=a.key,c=a.state;if(n)if(e.pushState({key:r,state:c},null,o),l)window.location.href=o;else{var s=T.indexOf(L.location.key),u=T.slice(0,-1===s?0:s+1);u.push(a.key),T=u,w({action:"PUSH",location:a})}else(0,i.default)(void 0===c,"Browser history cannot push state in browsers that do not support HTML5 history"),window.location.href=o}})},replace:function(t,r){(0,i.default)(!("object"===(void 0===t?"undefined":o(t))&&void 0!==t.state&&void 0!==r),"You should avoid providing a 2nd state argument to replace when the 1st argument is a location-like object that already has state; it is ignored");var a=(0,ft.createLocation)(t,r,b(),L.location);g.confirmTransitionTo(a,"REPLACE",h,function(t){if(t){var o=S(a),r=a.key,c=a.state;if(n)if(e.replaceState({key:r,state:c},null,o),l)window.location.replace(o);else{var s=T.indexOf(L.location.key);-1!==s&&(T[s]=a.key),w({action:"REPLACE",location:a})}else(0,i.default)(void 0===c,"Browser history cannot replace state in browsers that do not support HTML5 history"),window.location.replace(o)}})},go:_,goBack:function(){return _(-1)},goForward:function(){return _(1)},block:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=g.setPrompt(t);return A||(k(1),A=!0),function(){return A&&(A=!1,k(-1)),e()}},listen:function(t){var e=g.appendListener(t);return k(1),function(){k(-1),e()}}};return L}})),vt=function(){},mt=vt,bt=function(t,e,n,o,r,i,a,c){if(!t){var s;if(void 0===e)s=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var u=[n,o,r,i,a,c],p=0;(s=new Error(e.replace(/%s/g,function(){return u[p++]}))).name="Invariant Violation"}throw s.framesToPop=1,s}},gt=function(){};gt.thatReturns=u,gt.thatReturnsFalse=u(!1),gt.thatReturnsTrue=u(!0),gt.thatReturnsNull=u(null),gt.thatReturnsThis=function(){return this},gt.thatReturnsArgument=function(t){return t};var wt=gt,Ot=function(t){},Pt=function(t,e,n,o,r,i,a,c){if(Ot(e),!t){var s;if(void 0===e)s=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var u=[n,o,r,i,a,c],p=0;(s=new Error(e.replace(/%s/g,function(){return u[p++]}))).name="Invariant Violation"}throw s.framesToPop=1,s}},xt="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",Rt=function(){function t(t,e,n,o,r,i){i!==xt&&Pt(!1,"Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types")}function e(){return t}t.isRequired=t;var n={array:t,bool:t,func:t,number:t,object:t,string:t,symbol:t,any:t,arrayOf:e,element:t,instanceOf:e,node:t,objectOf:e,oneOf:e,oneOfType:e,shape:e};return n.checkPropTypes=wt,n.PropTypes=n,n},Et=o(function(t){t.exports=Rt()}),jt=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},Tt=function(t){function n(){var e,o,r;p(this,n);for(var i=arguments.length,a=Array(i),c=0;c<i;c++)a[c]=arguments[c];return e=o=l(this,t.call.apply(t,[this].concat(a))),o.state={match:o.computeMatch(o.props.history.location.pathname)},r=e,l(o,r)}return f(n,t),n.prototype.getChildContext=function(){return{router:jt({},this.context.router,{history:this.props.history,route:{location:this.props.history.location,match:this.state.match}})}},n.prototype.computeMatch=function(t){return{path:"/",url:"/",params:{},isExact:"/"===t}},n.prototype.componentWillMount=function(){var t=this,n=this.props,o=n.children,r=n.history;bt(null==o||1===e.Children.count(o),"A <Router> may have only one child element"),this.unlisten=r.listen(function(){t.setState({match:t.computeMatch(r.location.pathname)})})},n.prototype.componentWillReceiveProps=function(t){mt(this.props.history===t.history,"You cannot change <Router history>")},n.prototype.componentWillUnmount=function(){this.unlisten()},n.prototype.render=function(){var t=this.props.children;return t?e.Children.only(t):null},n}(e.Component);Tt.propTypes={history:Et.object.isRequired,children:Et.node},Tt.contextTypes={router:Et.object},Tt.childContextTypes={router:Et.object.isRequired};var St="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_t=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},Ct=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},kt=function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)},At=function(t,e){var n={};for(var o in t)e.indexOf(o)>=0||Object.prototype.hasOwnProperty.call(t,o)&&(n[o]=t[o]);return n},Lt=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e},Mt=function(t){function n(){var e,o,r;_t(this,n);for(var i=arguments.length,a=Array(i),c=0;c<i;c++)a[c]=arguments[c];return e=o=Lt(this,t.call.apply(t,[this].concat(a))),o.history=yt(o.props),r=e,Lt(o,r)}return kt(n,t),n.prototype.componentWillMount=function(){},n.prototype.render=function(){return e.createElement(Tt,{history:this.history,children:this.props.children})},n}(e.Component),Ut=n(o(function(t,e){function n(t){return t&&t.__esModule?t:{default:t}}e.__esModule=!0;var o=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},r=n(Q),i=n(it),a=n(ht),c={hashbang:{encodePath:function(t){return"!"===t.charAt(0)?t:"!/"+(0,ut.stripLeadingSlash)(t)},decodePath:function(t){return"!"===t.charAt(0)?t.substr(1):t}},noslash:{encodePath:ut.stripLeadingSlash,decodePath:ut.addLeadingSlash},slash:{encodePath:ut.addLeadingSlash,decodePath:ut.addLeadingSlash}},s=function(){var t=window.location.href,e=t.indexOf("#");return-1===e?"":t.substring(e+1)},u=function(t){return window.location.hash=t},p=function(t){var e=window.location.href.indexOf("#");window.location.replace(window.location.href.slice(0,e>=0?e:0)+"#"+t)};e.default=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(0,i.default)(dt.canUseDOM,"Hash history needs a DOM");var e=window.history,n=(0,dt.supportsGoWithoutReloadUsingHash)(),l=t.getUserConfirmation,f=void 0===l?dt.getConfirmation:l,h=t.hashType,d=void 0===h?"slash":h,y=t.basename?(0,ut.stripTrailingSlash)((0,ut.addLeadingSlash)(t.basename)):"",v=c[d],m=v.encodePath,b=v.decodePath,g=function(){var t=b(s());return(0,r.default)(!y||(0,ut.hasBasename)(t,y),'You are attempting to use a basename on a page whose URL path does not begin with the basename. Expected path "'+t+'" to begin with "'+y+'".'),y&&(t=(0,ut.stripBasename)(t,y)),(0,ft.createLocation)(t)},w=(0,a.default)(),O=function(t){o(U,t),U.length=e.length,w.notifyListeners(U.location,U.action)},P=!1,x=null,R=function(){var t=s(),e=m(t);if(t!==e)p(e);else{var n=g(),o=U.location;if(!P&&(0,ft.locationsAreEqual)(o,n))return;if(x===(0,ut.createPath)(n))return;x=null,E(n)}},E=function(t){P?(P=!1,O()):w.confirmTransitionTo(t,"POP",f,function(e){e?O({action:"POP",location:t}):j(t)})},j=function(t){var e=U.location,n=C.lastIndexOf((0,ut.createPath)(e));-1===n&&(n=0);var o=C.lastIndexOf((0,ut.createPath)(t));-1===o&&(o=0);var r=n-o;r&&(P=!0,k(r))},T=s(),S=m(T);T!==S&&p(S);var _=g(),C=[(0,ut.createPath)(_)],k=function(t){(0,r.default)(n,"Hash history go(n) causes a full page reload in this browser"),e.go(t)},A=0,L=function(t){1===(A+=t)?(0,dt.addEventListener)(window,"hashchange",R):0===A&&(0,dt.removeEventListener)(window,"hashchange",R)},M=!1,U={length:e.length,action:"POP",location:_,createHref:function(t){return"#"+m(y+(0,ut.createPath)(t))},push:function(t,e){(0,r.default)(void 0===e,"Hash history cannot push state; it is ignored");var n=(0,ft.createLocation)(t,void 0,void 0,U.location);w.confirmTransitionTo(n,"PUSH",f,function(t){if(t){var e=(0,ut.createPath)(n),o=m(y+e);if(s()!==o){x=e,u(o);var i=C.lastIndexOf((0,ut.createPath)(U.location)),a=C.slice(0,-1===i?0:i+1);a.push(e),C=a,O({action:"PUSH",location:n})}else(0,r.default)(!1,"Hash history cannot PUSH the same path; a new entry will not be added to the history stack"),O()}})},replace:function(t,e){(0,r.default)(void 0===e,"Hash history cannot replace state; it is ignored");var n=(0,ft.createLocation)(t,void 0,void 0,U.location);w.confirmTransitionTo(n,"REPLACE",f,function(t){if(t){var e=(0,ut.createPath)(n),o=m(y+e);s()!==o&&(x=e,p(o));var r=C.indexOf((0,ut.createPath)(U.location));-1!==r&&(C[r]=e),O({action:"REPLACE",location:n})}})},go:k,goBack:function(){return k(-1)},goForward:function(){return k(1)},block:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=w.setPrompt(t);return M||(L(1),M=!0),function(){return M&&(M=!1,L(-1)),e()}},listen:function(t){var e=w.appendListener(t);return L(1),function(){L(-1),e()}}};return U}})),qt=function(t){function n(){var e,o,r;_t(this,n);for(var i=arguments.length,a=Array(i),c=0;c<i;c++)a[c]=arguments[c];return e=o=Lt(this,t.call.apply(t,[this].concat(a))),o.history=Ut(o.props),r=e,Lt(o,r)}return kt(n,t),n.prototype.componentWillMount=function(){},n.prototype.render=function(){return e.createElement(Tt,{history:this.history,children:this.props.children})},n}(e.Component),Ht=function(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)},It=function(t){function n(){var e,o,r;_t(this,n);for(var i=arguments.length,a=Array(i),c=0;c<i;c++)a[c]=arguments[c];return e=o=Lt(this,t.call.apply(t,[this].concat(a))),o.handleClick=function(t){if(o.props.onClick&&o.props.onClick(t),!t.defaultPrevented&&0===t.button&&!o.props.target&&!Ht(t)){t.preventDefault();var e=o.context.router.history,n=o.props,r=n.replace,i=n.to;r?e.replace(i):e.push(i)}},r=e,Lt(o,r)}return kt(n,t),n.prototype.render=function(){var t=this.props,n=(t.replace,t.to),o=t.innerRef,r=At(t,["replace","to","innerRef"]);this.context.router||it(!1);var i=this.context.router.history.createHref("string"==typeof n?{pathname:n}:n);return e.createElement("a",Ct({},r,{onClick:this.handleClick,href:i,ref:o}))},n}(e.Component);It.defaultProps={replace:!1},It.contextTypes={router:rt.shape({history:rt.shape({push:rt.func.isRequired,replace:rt.func.isRequired,createHref:rt.func.isRequired}).isRequired}).isRequired};var Yt=o(function(t,e){e.__esModule=!0;e.addLeadingSlash=function(t){return"/"===t.charAt(0)?t:"/"+t},e.stripLeadingSlash=function(t){return"/"===t.charAt(0)?t.substr(1):t};var n=e.hasBasename=function(t,e){return new RegExp("^"+e+"(\\/|\\?|#|$)","i").test(t)};e.stripBasename=function(t,e){return n(t,e)?t.substr(e.length):t},e.stripTrailingSlash=function(t){return"/"===t.charAt(t.length-1)?t.slice(0,-1):t},e.parsePath=function(t){var e=t||"/",n="",o="",r=e.indexOf("#");-1!==r&&(o=e.substr(r),e=e.substr(0,r));var i=e.indexOf("?");return-1!==i&&(n=e.substr(i),e=e.substr(0,i)),{pathname:e,search:"?"===n?"":n,hash:"#"===o?"":o}},e.createPath=function(t){var e=t.pathname,n=t.search,o=t.hash,r=e||"/";return n&&"?"!==n&&(r+="?"===n.charAt(0)?n:"?"+n),o&&"#"!==o&&(r+="#"===o.charAt(0)?o:"#"+o),r}}),Bt=Yt.addLeadingSlash,Wt=Yt.parsePath,Nt=Yt.createPath,Dt=Object.freeze({default:y}),Ft="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},$t=Object.freeze({default:v}),Vt=Dt&&y||Dt,zt=$t&&v||$t,Kt=o(function(t,e){function n(t){return t&&t.__esModule?t:{default:t}}e.__esModule=!0,e.locationsAreEqual=e.createLocation=void 0;var o=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},r=n(Vt),i=n(zt);e.createLocation=function(t,e,n,i){var a=void 0;"string"==typeof t?(a=(0,Yt.parsePath)(t)).state=e:(void 0===(a=o({},t)).pathname&&(a.pathname=""),a.search?"?"!==a.search.charAt(0)&&(a.search="?"+a.search):a.search="",a.hash?"#"!==a.hash.charAt(0)&&(a.hash="#"+a.hash):a.hash="",void 0!==e&&void 0===a.state&&(a.state=e));try{a.pathname=decodeURI(a.pathname)}catch(t){throw t instanceof URIError?new URIError('Pathname "'+a.pathname+'" could not be decoded. This is likely caused by an invalid percent-encoding.'):t}return n&&(a.key=n),i?a.pathname?"/"!==a.pathname.charAt(0)&&(a.pathname=(0,r.default)(a.pathname,i.pathname)):a.pathname=i.pathname:a.pathname||(a.pathname="/"),a},e.locationsAreEqual=function(t,e){return t.pathname===e.pathname&&t.search===e.search&&t.hash===e.hash&&t.key===e.key&&(0,i.default)(t.state,e.state)}}),Gt=o(function(t,e){e.__esModule=!0;var n=function(t){return t&&t.__esModule?t:{default:t}}(mt);e.default=function(){var t=null,e=[];return{setPrompt:function(e){return(0,n.default)(null==t,"A history supports only one prompt at a time"),t=e,function(){t===e&&(t=null)}},confirmTransitionTo:function(e,o,r,i){if(null!=t){var a="function"==typeof t?t(e,o):t;"string"==typeof a?"function"==typeof r?r(a,i):((0,n.default)(!1,"A history needs a getUserConfirmation function in order to use a prompt message"),i(!0)):i(!1!==a)}else i(!0)},appendListener:function(t){var n=!0,o=function(){n&&t.apply(void 0,arguments)};return e.push(o),function(){n=!1,e=e.filter(function(t){return t!==o})}},notifyListeners:function(){for(var t=arguments.length,n=Array(t),o=0;o<t;o++)n[o]=arguments[o];e.forEach(function(t){return t.apply(void 0,n)})}}}}),Jt=n(o(function(t,e){function n(t){return t&&t.__esModule?t:{default:t}}e.__esModule=!0;var o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},i=n(mt),a=n(Gt),c=function(t,e,n){return Math.min(Math.max(t,e),n)};e.default=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.getUserConfirmation,n=t.initialEntries,s=void 0===n?["/"]:n,u=t.initialIndex,p=void 0===u?0:u,l=t.keyLength,f=void 0===l?6:l,h=(0,a.default)(),d=function(t){r(w,t),w.length=w.entries.length,h.notifyListeners(w.location,w.action)},y=function(){return Math.random().toString(36).substr(2,f)},v=c(p,0,s.length-1),m=s.map(function(t){return"string"==typeof t?(0,Kt.createLocation)(t,void 0,y()):(0,Kt.createLocation)(t,void 0,t.key||y())}),b=Yt.createPath,g=function(t){var n=c(w.index+t,0,w.entries.length-1),o=w.entries[n];h.confirmTransitionTo(o,"POP",e,function(t){t?d({action:"POP",location:o,index:n}):d()})},w={length:m.length,action:"POP",location:m[v],index:v,entries:m,createHref:b,push:function(t,n){(0,i.default)(!("object"===(void 0===t?"undefined":o(t))&&void 0!==t.state&&void 0!==n),"You should avoid providing a 2nd state argument to push when the 1st argument is a location-like object that already has state; it is ignored");var r=(0,Kt.createLocation)(t,n,y(),w.location);h.confirmTransitionTo(r,"PUSH",e,function(t){if(t){var e=w.index+1,n=w.entries.slice(0);n.length>e?n.splice(e,n.length-e,r):n.push(r),d({action:"PUSH",location:r,index:e,entries:n})}})},replace:function(t,n){(0,i.default)(!("object"===(void 0===t?"undefined":o(t))&&void 0!==t.state&&void 0!==n),"You should avoid providing a 2nd state argument to replace when the 1st argument is a location-like object that already has state; it is ignored");var r=(0,Kt.createLocation)(t,n,y(),w.location);h.confirmTransitionTo(r,"REPLACE",e,function(t){t&&(w.entries[w.index]=r,d({action:"REPLACE",location:r}))})},go:g,goBack:function(){return g(-1)},goForward:function(){return g(1)},canGo:function(t){var e=w.index+t;return e>=0&&e<w.entries.length},block:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return h.setPrompt(t)},listen:function(t){return h.appendListener(t)}};return w}})),Qt=function(t){function n(){var e,o,r;m(this,n);for(var i=arguments.length,a=Array(i),c=0;c<i;c++)a[c]=arguments[c];return e=o=b(this,t.call.apply(t,[this].concat(a))),o.history=Jt(o.props),r=e,b(o,r)}return g(n,t),n.prototype.componentWillMount=function(){mt(!this.props.history,"<MemoryRouter> ignores the history prop. To use a custom history, use `import { Router }` instead of `import { MemoryRouter as Router }`.")},n.prototype.render=function(){return e.createElement(Tt,{history:this.history,children:this.props.children})},n}(e.Component);Qt.propTypes={initialEntries:Et.array,initialIndex:Et.number,getUserConfirmation:Et.func,keyLength:Et.number,children:Et.node};var Xt=Array.isArray||function(t){return"[object Array]"==Object.prototype.toString.call(t)},Zt=A,te=w,ee=x,ne=k,oe=new RegExp(["(\\\\.)","([\\/.])?(?:(?:\\:(\\w+)(?:\\(((?:\\\\.|[^\\\\()])+)\\))?|\\(((?:\\\\.|[^\\\\()])+)\\))([+*?])?|(\\*))"].join("|"),"g");Zt.parse=te,Zt.compile=function(t,e){return x(w(t,e))},Zt.tokensToFunction=ee,Zt.tokensToRegExp=ne;var re={},ie=0,ae=function(t,e){var n=""+e.end+e.strict+e.sensitive,o=re[n]||(re[n]={});if(o[t])return o[t];var r=[],i={re:Zt(t,r,e),keys:r};return ie<1e4&&(o[t]=i,ie++),i},ce=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};"string"==typeof e&&(e={path:e});var n=e,o=n.path,r=void 0===o?"/":o,i=n.exact,a=void 0!==i&&i,c=n.strict,s=void 0!==c&&c,u=n.sensitive,p=ae(r,{end:a,strict:s,sensitive:void 0!==u&&u}),l=p.re,f=p.keys,h=l.exec(t);if(!h)return null;var d=h[0],y=h.slice(1),v=t===d;return a&&!v?null:{path:r,url:"/"===r&&""===d?"/":d,isExact:v,params:f.reduce(function(t,e,n){return t[e.name]=y[n],t},{})}},se=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},ue=function(t){return 0===e.Children.count(t)},pe=function(t){function n(){var e,o,r;L(this,n);for(var i=arguments.length,a=Array(i),c=0;c<i;c++)a[c]=arguments[c];return e=o=M(this,t.call.apply(t,[this].concat(a))),o.state={match:o.computeMatch(o.props,o.context.router)},r=e,M(o,r)}return U(n,t),n.prototype.getChildContext=function(){return{router:se({},this.context.router,{route:{location:this.props.location||this.context.router.route.location,match:this.state.match}})}},n.prototype.computeMatch=function(t,e){var n=t.computedMatch,o=t.location,r=t.path,i=t.strict,a=t.exact,c=t.sensitive;if(n)return n;bt(e,"You should not use <Route> or withRouter() outside a <Router>");var s=e.route,u=(o||s.location).pathname;return r?ce(u,{path:r,strict:i,exact:a,sensitive:c}):s.match},n.prototype.componentWillMount=function(){mt(!(this.props.component&&this.props.render),"You should not use <Route component> and <Route render> in the same route; <Route render> will be ignored"),mt(!(this.props.component&&this.props.children&&!ue(this.props.children)),"You should not use <Route component> and <Route children> in the same route; <Route children> will be ignored"),mt(!(this.props.render&&this.props.children&&!ue(this.props.children)),"You should not use <Route render> and <Route children> in the same route; <Route children> will be ignored")},n.prototype.componentWillReceiveProps=function(t,e){mt(!(t.location&&!this.props.location),'<Route> elements should not change from uncontrolled to controlled (or vice versa). You initially used no "location" prop and then provided one on a subsequent render.'),mt(!(!t.location&&this.props.location),'<Route> elements should not change from controlled to uncontrolled (or vice versa). You provided a "location" prop initially but omitted it on a subsequent render.'),this.setState({match:this.computeMatch(t,e.router)})},n.prototype.render=function(){var t=this.state.match,n=this.props,o=n.children,r=n.component,i=n.render,a=this.context.router,c=a.history,s=a.route,u=a.staticContext,p={match:t,location:this.props.location||s.location,history:c,staticContext:u};return r?t?e.createElement(r,p):null:i?t?i(p):null:o?"function"==typeof o?o(p):ue(o)?null:e.Children.only(o):null},n}(e.Component);pe.propTypes={computedMatch:Et.object,path:Et.string,exact:Et.bool,strict:Et.bool,sensitive:Et.bool,component:Et.func,render:Et.func,children:Et.oneOfType([Et.func,Et.node]),location:Et.object},pe.contextTypes={router:Et.shape({history:Et.object.isRequired,route:Et.object.isRequired,staticContext:Et.object})},pe.childContextTypes={router:Et.object.isRequired};var le=function(t){var n=t.to,o=t.exact,r=t.strict,i=t.location,a=t.activeClassName,c=t.className,s=t.activeStyle,u=t.style,p=t.isActive,l=t.ariaCurrent,f=At(t,["to","exact","strict","location","activeClassName","className","activeStyle","style","isActive","ariaCurrent"]);return e.createElement(pe,{path:"object"===(void 0===n?"undefined":St(n))?n.pathname:n,exact:o,strict:r,location:i,children:function(t){var o=t.location,r=t.match,i=!!(p?p(r,o):r);return e.createElement(It,Ct({to:n,className:i?[c,a].filter(function(t){return t}).join(" "):c,style:i?Ct({},u,s):u,"aria-current":i&&l},f))}})};le.defaultProps={activeClassName:"active",ariaCurrent:"true"};var fe=function(t){function e(){return q(this,e),H(this,t.apply(this,arguments))}return I(e,t),e.prototype.enable=function(t){this.unblock&&this.unblock(),this.unblock=this.context.router.history.block(t)},e.prototype.disable=function(){this.unblock&&(this.unblock(),this.unblock=null)},e.prototype.componentWillMount=function(){bt(this.context.router,"You should not use <Prompt> outside a <Router>"),this.props.when&&this.enable(this.props.message)},e.prototype.componentWillReceiveProps=function(t){t.when?this.props.when&&this.props.message===t.message||this.enable(t.message):this.disable()},e.prototype.componentWillUnmount=function(){this.disable()},e.prototype.render=function(){return null},e}(e.Component);fe.propTypes={when:Et.bool,message:Et.oneOfType([Et.func,Et.string]).isRequired},fe.defaultProps={when:!0},fe.contextTypes={router:Et.shape({history:Et.shape({block:Et.func.isRequired}).isRequired}).isRequired};var he=function(t){var e=t||"/",n="",o="",r=e.indexOf("#");-1!==r&&(o=e.substr(r),e=e.substr(0,r));var i=e.indexOf("?");return-1!==i&&(n=e.substr(i),e=e.substr(0,i)),{pathname:e,search:"?"===n?"":n,hash:"#"===o?"":o}},de=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},ye=function(t,e,n,o){var r=void 0;"string"==typeof t?(r=he(t)).state=e:(void 0===(r=de({},t)).pathname&&(r.pathname=""),r.search?"?"!==r.search.charAt(0)&&(r.search="?"+r.search):r.search="",r.hash?"#"!==r.hash.charAt(0)&&(r.hash="#"+r.hash):r.hash="",void 0!==e&&void 0===r.state&&(r.state=e));try{r.pathname=decodeURI(r.pathname)}catch(t){throw t instanceof URIError?new URIError('Pathname "'+r.pathname+'" could not be decoded. This is likely caused by an invalid percent-encoding.'):t}return n&&(r.key=n),o?r.pathname?"/"!==r.pathname.charAt(0)&&(r.pathname=y(r.pathname,o.pathname)):r.pathname=o.pathname:r.pathname||(r.pathname="/"),r},ve=function(t,e){return t.pathname===e.pathname&&t.search===e.search&&t.hash===e.hash&&t.key===e.key&&v(t.state,e.state)},me=function(t){function e(){return Y(this,e),B(this,t.apply(this,arguments))}return W(e,t),e.prototype.isStatic=function(){return this.context.router&&this.context.router.staticContext},e.prototype.componentWillMount=function(){bt(this.context.router,"You should not use <Redirect> outside a <Router>"),this.isStatic()&&this.perform()},e.prototype.componentDidMount=function(){this.isStatic()||this.perform()},e.prototype.componentDidUpdate=function(t){var e=ye(t.to),n=ye(this.props.to);ve(e,n)?mt(!1,"You tried to redirect to the same route you're currently on: \""+n.pathname+n.search+'"'):this.perform()},e.prototype.perform=function(){var t=this.context.router.history,e=this.props,n=e.push,o=e.to;n?t.push(o):t.replace(o)},e.prototype.render=function(){return null},e}(e.Component);me.propTypes={push:Et.bool,from:Et.string,to:Et.oneOfType([Et.string,Et.object]).isRequired},me.defaultProps={push:!1},me.contextTypes={router:Et.shape({history:Et.shape({push:Et.func.isRequired,replace:Et.func.isRequired}).isRequired,staticContext:Et.object}).isRequired};var be=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},ge=function(t){var e=t.pathname,n=void 0===e?"/":e,o=t.search,r=void 0===o?"":o,i=t.hash,a=void 0===i?"":i;return{pathname:n,search:"?"===r?"":r,hash:"#"===a?"":a}},we=function(t,e){return t?be({},e,{pathname:Bt(t)+e.pathname}):e},Oe=function(t,e){if(!t)return e;var n=Bt(t);return 0!==e.pathname.indexOf(n)?e:be({},e,{pathname:e.pathname.substr(n.length)})},Pe=function(t){return"string"==typeof t?Wt(t):ge(t)},xe=function(t){return"string"==typeof t?t:Nt(t)},Re=function(t){return function(){bt(!1,"You cannot %s with <StaticRouter>",t)}},Ee=function(){},je=function(t){function n(){var e,o,r;D(this,n);for(var i=arguments.length,a=Array(i),c=0;c<i;c++)a[c]=arguments[c];return e=o=F(this,t.call.apply(t,[this].concat(a))),o.createHref=function(t){return Bt(o.props.basename+xe(t))},o.handlePush=function(t){var e=o.props,n=e.basename,r=e.context;r.action="PUSH",r.location=we(n,Pe(t)),r.url=xe(r.location)},o.handleReplace=function(t){var e=o.props,n=e.basename,r=e.context;r.action="REPLACE",r.location=we(n,Pe(t)),r.url=xe(r.location)},o.handleListen=function(){return Ee},o.handleBlock=function(){return Ee},r=e,F(o,r)}return $(n,t),n.prototype.getChildContext=function(){return{router:{staticContext:this.props.context}}},n.prototype.componentWillMount=function(){mt(!this.props.history,"<StaticRouter> ignores the history prop. To use a custom history, use `import { Router }` instead of `import { StaticRouter as Router }`.")},n.prototype.render=function(){var t=this.props,n=t.basename,o=(t.context,t.location),r=N(t,["basename","context","location"]),i={createHref:this.createHref,action:"POP",location:Oe(n,Pe(o)),push:this.handlePush,replace:this.handleReplace,go:Re("go"),goBack:Re("goBack"),goForward:Re("goForward"),listen:this.handleListen,block:this.handleBlock};return e.createElement(Tt,be({},r,{history:i}))},n}(e.Component);je.propTypes={basename:Et.string,context:Et.object.isRequired,location:Et.oneOfType([Et.string,Et.object])},je.defaultProps={basename:"",location:"/"},je.childContextTypes={router:Et.object.isRequired};var Te=function(t){function n(){return V(this,n),z(this,t.apply(this,arguments))}return K(n,t),n.prototype.componentWillMount=function(){bt(this.context.router,"You should not use <Switch> outside a <Router>")},n.prototype.componentWillReceiveProps=function(t){mt(!(t.location&&!this.props.location),'<Switch> elements should not change from uncontrolled to controlled (or vice versa). You initially used no "location" prop and then provided one on a subsequent render.'),mt(!(!t.location&&this.props.location),'<Switch> elements should not change from controlled to uncontrolled (or vice versa). You provided a "location" prop initially but omitted it on a subsequent render.')},n.prototype.render=function(){var t=this.context.router.route,n=this.props.children,o=this.props.location||t.location,r=void 0,i=void 0;return e.Children.forEach(n,function(n){if(e.isValidElement(n)){var a=n.props,c=a.path,s=a.exact,u=a.strict,p=a.sensitive,l=a.from,f=c||l;null==r&&(i=n,r=f?ce(o.pathname,{path:f,exact:s,strict:u,sensitive:p}):t.match)}}),r?e.cloneElement(i,{location:o,computedMatch:r}):null},n}(e.Component);Te.contextTypes={router:Et.shape({route:Et.object.isRequired}).isRequired},Te.propTypes={children:Et.node,location:Et.object};var Se={childContextTypes:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,mixins:!0,propTypes:!0,type:!0},_e={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},Ce=Object.defineProperty,ke=Object.getOwnPropertyNames,Ae=Object.getOwnPropertySymbols,Le=Object.getOwnPropertyDescriptor,Me=Object.getPrototypeOf,Ue=Me&&Me(Object),qe=function t(e,n,o){if("string"!=typeof n){if(Ue){var r=Me(n);r&&r!==Ue&&t(e,r,o)}var i=ke(n);Ae&&(i=i.concat(Ae(n)));for(var a=0;a<i.length;++a){var c=i[a];if(!(Se[c]||_e[c]||o&&o[c])){var s=Le(n,c);try{Ce(e,c,s)}catch(t){}}}return e}return e},He=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t};t.BrowserRouter=Mt,t.HashRouter=qt,t.Link=It,t.MemoryRouter=Qt,t.NavLink=le,t.Prompt=fe,t.Redirect=me,t.Route=pe,t.Router=Tt,t.StaticRouter=je,t.Switch=Te,t.matchPath=ce,t.withRouter=function(t){var n=function(n){var o=n.wrappedComponentRef,r=G(n,["wrappedComponentRef"]);return e.createElement(pe,{render:function(n){return e.createElement(t,He({},r,n,{ref:o}))}})};return n.displayName="withRouter("+(t.displayName||t.name)+")",n.WrappedComponent=t,n.propTypes={wrappedComponentRef:Et.func},qe(n,t)},Object.defineProperty(t,"__esModule",{value:!0})});
+!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("react")):"function"==typeof define&&define.amd?define(["exports","react"],e):e(t.ReactRouterDOM={},t.React)}(this,function(t,e){"use strict";e=e&&e.hasOwnProperty("default")?e.default:e;var n=function(){};"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;function o(t,e){return t(e={exports:{}},e.exports),e.exports}function r(t){return function(){return t}}var i=function(){};i.thatReturns=r,i.thatReturnsFalse=r(!1),i.thatReturnsTrue=r(!0),i.thatReturnsNull=r(null),i.thatReturnsThis=function(){return this},i.thatReturnsArgument=function(t){return t};var a=i,c=function(t){};var s=function(t,e,n,o,r,i,a,s){if(c(e),!t){var u;if(void 0===e)u=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var p=[n,o,r,i,a,s],l=0;(u=new Error(e.replace(/%s/g,function(){return p[l++]}))).name="Invariant Violation"}throw u.framesToPop=1,u}},u=Object.getOwnPropertySymbols,p=Object.prototype.hasOwnProperty,l=Object.prototype.propertyIsEnumerable;(function(){try{if(!Object.assign)return!1;var t=new String("abc");if(t[5]="de","5"===Object.getOwnPropertyNames(t)[0])return!1;for(var e={},n=0;n<10;n++)e["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(e).map(function(t){return e[t]}).join(""))return!1;var o={};return"abcdefghijklmnopqrst".split("").forEach(function(t){o[t]=t}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},o)).join("")}catch(t){return!1}})()&&Object.assign;var f="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",h=o(function(t){t.exports=function(){function t(t,e,n,o,r,i){i!==f&&s(!1,"Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types")}function e(){return t}t.isRequired=t;var n={array:t,bool:t,func:t,number:t,object:t,string:t,symbol:t,any:t,arrayOf:e,element:t,instanceOf:e,node:t,objectOf:e,oneOf:e,oneOfType:e,shape:e,exact:e};return n.checkPropTypes=a,n.PropTypes=n,n}()}),d=function(t,e,n,o,r,i,a,c){if(!t){var s;if(void 0===e)s=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var u=[n,o,r,i,a,c],p=0;(s=new Error(e.replace(/%s/g,function(){return u[p++]}))).name="Invariant Violation"}throw s.framesToPop=1,s}};function y(t){return"/"===t.charAt(0)}function v(t,e){for(var n=e,o=n+1,r=t.length;o<r;n+=1,o+=1)t[n]=t[o];t.pop()}var m="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};var b=function(t){return"/"===t.charAt(0)?t:"/"+t},g=function(t){return"/"===t.charAt(0)?t.substr(1):t},w=function(t,e){return new RegExp("^"+e+"(\\/|\\?|#|$)","i").test(t)},O=function(t,e){return w(t,e)?t.substr(e.length):t},x=function(t){return"/"===t.charAt(t.length-1)?t.slice(0,-1):t},R=function(t){var e=t.pathname,n=t.search,o=t.hash,r=e||"/";return n&&"?"!==n&&(r+="?"===n.charAt(0)?n:"?"+n),o&&"#"!==o&&(r+="#"===o.charAt(0)?o:"#"+o),r},P=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},j=function(t,e,n,o){var r=void 0;"string"==typeof t?(r=function(t){var e=t||"/",n="",o="",r=e.indexOf("#");-1!==r&&(o=e.substr(r),e=e.substr(0,r));var i=e.indexOf("?");return-1!==i&&(n=e.substr(i),e=e.substr(0,i)),{pathname:e,search:"?"===n?"":n,hash:"#"===o?"":o}}(t)).state=e:(void 0===(r=P({},t)).pathname&&(r.pathname=""),r.search?"?"!==r.search.charAt(0)&&(r.search="?"+r.search):r.search="",r.hash?"#"!==r.hash.charAt(0)&&(r.hash="#"+r.hash):r.hash="",void 0!==e&&void 0===r.state&&(r.state=e));try{r.pathname=decodeURI(r.pathname)}catch(t){throw t instanceof URIError?new URIError('Pathname "'+r.pathname+'" could not be decoded. This is likely caused by an invalid percent-encoding.'):t}return n&&(r.key=n),o?r.pathname?"/"!==r.pathname.charAt(0)&&(r.pathname=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=t&&t.split("/")||[],o=e&&e.split("/")||[],r=t&&y(t),i=e&&y(e),a=r||i;if(t&&y(t)?o=n:n.length&&(o.pop(),o=o.concat(n)),!o.length)return"/";var c=void 0;if(o.length){var s=o[o.length-1];c="."===s||".."===s||""===s}else c=!1;for(var u=0,p=o.length;p>=0;p--){var l=o[p];"."===l?v(o,p):".."===l?(v(o,p),u++):u&&(v(o,p),u--)}if(!a)for(;u--;u)o.unshift("..");!a||""===o[0]||o[0]&&y(o[0])||o.unshift("");var f=o.join("/");return c&&"/"!==f.substr(-1)&&(f+="/"),f}(r.pathname,o.pathname)):r.pathname=o.pathname:r.pathname||(r.pathname="/"),r},E=function(t,e){return t.pathname===e.pathname&&t.search===e.search&&t.hash===e.hash&&t.key===e.key&&function t(e,n){if(e===n)return!0;if(null==e||null==n)return!1;if(Array.isArray(e))return Array.isArray(n)&&e.length===n.length&&e.every(function(e,o){return t(e,n[o])});var o=void 0===e?"undefined":m(e);if(o!==(void 0===n?"undefined":m(n)))return!1;if("object"===o){var r=e.valueOf(),i=n.valueOf();if(r!==e||i!==n)return t(r,i);var a=Object.keys(e),c=Object.keys(n);return a.length===c.length&&a.every(function(o){return t(e[o],n[o])})}return!1}(t.state,e.state)},T=function(){var t=null,e=[];return{setPrompt:function(e){return n(null==t,"A history supports only one prompt at a time"),t=e,function(){t===e&&(t=null)}},confirmTransitionTo:function(e,o,r,i){if(null!=t){var a="function"==typeof t?t(e,o):t;"string"==typeof a?"function"==typeof r?r(a,i):(n(!1,"A history needs a getUserConfirmation function in order to use a prompt message"),i(!0)):i(!1!==a)}else i(!0)},appendListener:function(t){var n=!0,o=function(){n&&t.apply(void 0,arguments)};return e.push(o),function(){n=!1,e=e.filter(function(t){return t!==o})}},notifyListeners:function(){for(var t=arguments.length,n=Array(t),o=0;o<t;o++)n[o]=arguments[o];e.forEach(function(t){return t.apply(void 0,n)})}}},C=!("undefined"==typeof window||!window.document||!window.document.createElement),S=function(t,e,n){return t.addEventListener?t.addEventListener(e,n,!1):t.attachEvent("on"+e,n)},k=function(t,e,n){return t.removeEventListener?t.removeEventListener(e,n,!1):t.detachEvent("on"+e,n)},A=function(t,e){return e(window.confirm(t))},_="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},M=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},L=function(){try{return window.history.state||{}}catch(t){return{}}},q=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};d(C,"Browser history needs a DOM");var e,o=window.history,r=(-1===(e=window.navigator.userAgent).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,i=!(-1===window.navigator.userAgent.indexOf("Trident")),a=t.forceRefresh,c=void 0!==a&&a,s=t.getUserConfirmation,u=void 0===s?A:s,p=t.keyLength,l=void 0===p?6:p,f=t.basename?x(b(t.basename)):"",h=function(t){var e=t||{},o=e.key,r=e.state,i=window.location,a=i.pathname+i.search+i.hash;return n(!f||w(a,f),'You are attempting to use a basename on a page whose URL path does not begin with the basename. Expected path "'+a+'" to begin with "'+f+'".'),f&&(a=O(a,f)),j(a,r,o)},y=function(){return Math.random().toString(36).substr(2,l)},v=T(),m=function(t){M($,t),$.length=o.length,v.notifyListeners($.location,$.action)},g=function(t){(function(t){return void 0===t.state&&-1===navigator.userAgent.indexOf("CriOS")})(t)||q(h(t.state))},P=function(){q(h(L()))},E=!1,q=function(t){if(E)E=!1,m();else{v.confirmTransitionTo(t,"POP",u,function(e){e?m({action:"POP",location:t}):U(t)})}},U=function(t){var e=$.location,n=Y.indexOf(e.key);-1===n&&(n=0);var o=Y.indexOf(t.key);-1===o&&(o=0);var r=n-o;r&&(E=!0,I(r))},H=h(L()),Y=[H.key],W=function(t){return f+R(t)},I=function(t){o.go(t)},N=0,B=function(t){1===(N+=t)?(S(window,"popstate",g),i&&S(window,"hashchange",P)):0===N&&(k(window,"popstate",g),i&&k(window,"hashchange",P))},D=!1,$={length:o.length,action:"POP",location:H,createHref:W,push:function(t,e){n(!("object"===(void 0===t?"undefined":_(t))&&void 0!==t.state&&void 0!==e),"You should avoid providing a 2nd state argument to push when the 1st argument is a location-like object that already has state; it is ignored");var i=j(t,e,y(),$.location);v.confirmTransitionTo(i,"PUSH",u,function(t){if(t){var e=W(i),a=i.key,s=i.state;if(r)if(o.pushState({key:a,state:s},null,e),c)window.location.href=e;else{var u=Y.indexOf($.location.key),p=Y.slice(0,-1===u?0:u+1);p.push(i.key),Y=p,m({action:"PUSH",location:i})}else n(void 0===s,"Browser history cannot push state in browsers that do not support HTML5 history"),window.location.href=e}})},replace:function(t,e){n(!("object"===(void 0===t?"undefined":_(t))&&void 0!==t.state&&void 0!==e),"You should avoid providing a 2nd state argument to replace when the 1st argument is a location-like object that already has state; it is ignored");var i=j(t,e,y(),$.location);v.confirmTransitionTo(i,"REPLACE",u,function(t){if(t){var e=W(i),a=i.key,s=i.state;if(r)if(o.replaceState({key:a,state:s},null,e),c)window.location.replace(e);else{var u=Y.indexOf($.location.key);-1!==u&&(Y[u]=i.key),m({action:"REPLACE",location:i})}else n(void 0===s,"Browser history cannot replace state in browsers that do not support HTML5 history"),window.location.replace(e)}})},go:I,goBack:function(){return I(-1)},goForward:function(){return I(1)},block:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=v.setPrompt(t);return D||(B(1),D=!0),function(){return D&&(D=!1,B(-1)),e()}},listen:function(t){var e=v.appendListener(t);return B(1),function(){B(-1),e()}}};return $},U=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},H={hashbang:{encodePath:function(t){return"!"===t.charAt(0)?t:"!/"+g(t)},decodePath:function(t){return"!"===t.charAt(0)?t.substr(1):t}},noslash:{encodePath:g,decodePath:b},slash:{encodePath:b,decodePath:b}},Y=function(){var t=window.location.href,e=t.indexOf("#");return-1===e?"":t.substring(e+1)},W=function(t){var e=window.location.href.indexOf("#");window.location.replace(window.location.href.slice(0,e>=0?e:0)+"#"+t)},I=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};d(C,"Hash history needs a DOM");var e=window.history,o=-1===window.navigator.userAgent.indexOf("Firefox"),r=t.getUserConfirmation,i=void 0===r?A:r,a=t.hashType,c=void 0===a?"slash":a,s=t.basename?x(b(t.basename)):"",u=H[c],p=u.encodePath,l=u.decodePath,f=function(){var t=l(Y());return n(!s||w(t,s),'You are attempting to use a basename on a page whose URL path does not begin with the basename. Expected path "'+t+'" to begin with "'+s+'".'),s&&(t=O(t,s)),j(t)},h=T(),y=function(t){U(F,t),F.length=e.length,h.notifyListeners(F.location,F.action)},v=!1,m=null,g=function(){var t=Y(),e=p(t);if(t!==e)W(e);else{var n=f(),o=F.location;if(!v&&E(o,n))return;if(m===R(n))return;m=null,P(n)}},P=function(t){if(v)v=!1,y();else{h.confirmTransitionTo(t,"POP",i,function(e){e?y({action:"POP",location:t}):_(t)})}},_=function(t){var e=F.location,n=I.lastIndexOf(R(e));-1===n&&(n=0);var o=I.lastIndexOf(R(t));-1===o&&(o=0);var r=n-o;r&&(v=!0,N(r))},M=Y(),L=p(M);M!==L&&W(L);var q=f(),I=[R(q)],N=function(t){n(o,"Hash history go(n) causes a full page reload in this browser"),e.go(t)},B=0,D=function(t){1===(B+=t)?S(window,"hashchange",g):0===B&&k(window,"hashchange",g)},$=!1,F={length:e.length,action:"POP",location:q,createHref:function(t){return"#"+p(s+R(t))},push:function(t,e){n(void 0===e,"Hash history cannot push state; it is ignored");var o=j(t,void 0,void 0,F.location);h.confirmTransitionTo(o,"PUSH",i,function(t){if(t){var e=R(o),r=p(s+e);if(Y()!==r){m=e,function(t){window.location.hash=t}(r);var i=I.lastIndexOf(R(F.location)),a=I.slice(0,-1===i?0:i+1);a.push(e),I=a,y({action:"PUSH",location:o})}else n(!1,"Hash history cannot PUSH the same path; a new entry will not be added to the history stack"),y()}})},replace:function(t,e){n(void 0===e,"Hash history cannot replace state; it is ignored");var o=j(t,void 0,void 0,F.location);h.confirmTransitionTo(o,"REPLACE",i,function(t){if(t){var e=R(o),n=p(s+e);Y()!==n&&(m=e,W(n));var r=I.indexOf(R(F.location));-1!==r&&(I[r]=e),y({action:"REPLACE",location:o})}})},go:N,goBack:function(){return N(-1)},goForward:function(){return N(1)},block:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=h.setPrompt(t);return $||(D(1),$=!0),function(){return $&&($=!1,D(-1)),e()}},listen:function(t){var e=h.appendListener(t);return D(1),function(){D(-1),e()}}};return F},N="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},B=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},D=function(t,e,n){return Math.min(Math.max(t,e),n)},$=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.getUserConfirmation,o=t.initialEntries,r=void 0===o?["/"]:o,i=t.initialIndex,a=void 0===i?0:i,c=t.keyLength,s=void 0===c?6:c,u=T(),p=function(t){B(v,t),v.length=v.entries.length,u.notifyListeners(v.location,v.action)},l=function(){return Math.random().toString(36).substr(2,s)},f=D(a,0,r.length-1),h=r.map(function(t){return j(t,void 0,"string"==typeof t?l():t.key||l())}),d=R,y=function(t){var n=D(v.index+t,0,v.entries.length-1),o=v.entries[n];u.confirmTransitionTo(o,"POP",e,function(t){t?p({action:"POP",location:o,index:n}):p()})},v={length:h.length,action:"POP",location:h[f],index:f,entries:h,createHref:d,push:function(t,o){n(!("object"===(void 0===t?"undefined":N(t))&&void 0!==t.state&&void 0!==o),"You should avoid providing a 2nd state argument to push when the 1st argument is a location-like object that already has state; it is ignored");var r=j(t,o,l(),v.location);u.confirmTransitionTo(r,"PUSH",e,function(t){if(t){var e=v.index+1,n=v.entries.slice(0);n.length>e?n.splice(e,n.length-e,r):n.push(r),p({action:"PUSH",location:r,index:e,entries:n})}})},replace:function(t,o){n(!("object"===(void 0===t?"undefined":N(t))&&void 0!==t.state&&void 0!==o),"You should avoid providing a 2nd state argument to replace when the 1st argument is a location-like object that already has state; it is ignored");var r=j(t,o,l(),v.location);u.confirmTransitionTo(r,"REPLACE",e,function(t){t&&(v.entries[v.index]=r,p({action:"REPLACE",location:r}))})},go:y,goBack:function(){return y(-1)},goForward:function(){return y(1)},canGo:function(t){var e=v.index+t;return e>=0&&e<v.entries.length},block:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return u.setPrompt(t)},listen:function(t){return u.appendListener(t)}};return v},F=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t};function K(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}var V=function(t){function o(){var e,n;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,o);for(var r=arguments.length,i=Array(r),a=0;a<r;a++)i[a]=arguments[a];return e=n=K(this,t.call.apply(t,[this].concat(i))),n.state={match:n.computeMatch(n.props.history.location.pathname)},K(n,e)}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(o,t),o.prototype.getChildContext=function(){return{router:F({},this.context.router,{history:this.props.history,route:{location:this.props.history.location,match:this.state.match}})}},o.prototype.computeMatch=function(t){return{path:"/",url:"/",params:{},isExact:"/"===t}},o.prototype.componentWillMount=function(){var t=this,n=this.props,o=n.children,r=n.history;d(null==o||1===e.Children.count(o),"A <Router> may have only one child element"),this.unlisten=r.listen(function(){t.setState({match:t.computeMatch(r.location.pathname)})})},o.prototype.componentWillReceiveProps=function(t){n(this.props.history===t.history,"You cannot change <Router history>")},o.prototype.componentWillUnmount=function(){this.unlisten()},o.prototype.render=function(){var t=this.props.children;return t?e.Children.only(t):null},o}(e.Component);V.propTypes={history:h.object.isRequired,children:h.node},V.contextTypes={router:h.object},V.childContextTypes={router:h.object.isRequired};var J="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},G=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},z=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},Q=function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)},X=function(t,e){var n={};for(var o in t)e.indexOf(o)>=0||Object.prototype.hasOwnProperty.call(t,o)&&(n[o]=t[o]);return n},Z=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e},tt=function(t){function n(){var e,o;G(this,n);for(var r=arguments.length,i=Array(r),a=0;a<r;a++)i[a]=arguments[a];return e=o=Z(this,t.call.apply(t,[this].concat(i))),o.history=q(o.props),Z(o,e)}return Q(n,t),n.prototype.componentWillMount=function(){},n.prototype.render=function(){return e.createElement(V,{history:this.history,children:this.props.children})},n}(e.Component),et=function(t){function n(){var e,o;G(this,n);for(var r=arguments.length,i=Array(r),a=0;a<r;a++)i[a]=arguments[a];return e=o=Z(this,t.call.apply(t,[this].concat(i))),o.history=I(o.props),Z(o,e)}return Q(n,t),n.prototype.componentWillMount=function(){},n.prototype.render=function(){return e.createElement(V,{history:this.history,children:this.props.children})},n}(e.Component),nt=function(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)},ot=function(t){function n(){var e,o;G(this,n);for(var r=arguments.length,i=Array(r),a=0;a<r;a++)i[a]=arguments[a];return e=o=Z(this,t.call.apply(t,[this].concat(i))),o.handleClick=function(t){if(o.props.onClick&&o.props.onClick(t),!t.defaultPrevented&&0===t.button&&!o.props.target&&!nt(t)){t.preventDefault();var e=o.context.router.history,n=o.props,r=n.replace,i=n.to;r?e.replace(i):e.push(i)}},Z(o,e)}return Q(n,t),n.prototype.render=function(){var t=this.props,n=(t.replace,t.to),o=t.innerRef,r=X(t,["replace","to","innerRef"]);this.context.router||d(!1),void 0===n&&d(!1);var i=this.context.router.history,a="string"==typeof n?j(n,null,null,i.location):n,c=i.createHref(a);return e.createElement("a",z({},r,{onClick:this.handleClick,href:c,ref:o}))},n}(e.Component);function rt(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}ot.defaultProps={replace:!1},ot.contextTypes={router:h.shape({history:h.shape({push:h.func.isRequired,replace:h.func.isRequired,createHref:h.func.isRequired}).isRequired}).isRequired};var it=function(t){function o(){var e,n;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,o);for(var r=arguments.length,i=Array(r),a=0;a<r;a++)i[a]=arguments[a];return e=n=rt(this,t.call.apply(t,[this].concat(i))),n.history=$(n.props),rt(n,e)}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(o,t),o.prototype.componentWillMount=function(){n(!this.props.history,"<MemoryRouter> ignores the history prop. To use a custom history, use `import { Router }` instead of `import { MemoryRouter as Router }`.")},o.prototype.render=function(){return e.createElement(V,{history:this.history,children:this.props.children})},o}(e.Component);it.propTypes={initialEntries:h.array,initialIndex:h.number,getUserConfirmation:h.func,keyLength:h.number,children:h.node};var at={}.toString,ct=Array.isArray||function(t){return"[object Array]"==at.call(t)},st=xt,ut=dt,pt=function(t,e){return vt(dt(t,e))},lt=vt,ft=Ot,ht=new RegExp(["(\\\\.)","([\\/.])?(?:(?:\\:(\\w+)(?:\\(((?:\\\\.|[^\\\\()])+)\\))?|\\(((?:\\\\.|[^\\\\()])+)\\))([+*?])?|(\\*))"].join("|"),"g");function dt(t,e){for(var n,o=[],r=0,i=0,a="",c=e&&e.delimiter||"/";null!=(n=ht.exec(t));){var s=n[0],u=n[1],p=n.index;if(a+=t.slice(i,p),i=p+s.length,u)a+=u[1];else{var l=t[i],f=n[2],h=n[3],d=n[4],y=n[5],v=n[6],m=n[7];a&&(o.push(a),a="");var b=null!=f&&null!=l&&l!==f,g="+"===v||"*"===v,w="?"===v||"*"===v,O=n[2]||c,x=d||y;o.push({name:h||r++,prefix:f||"",delimiter:O,optional:w,repeat:g,partial:b,asterisk:!!m,pattern:x?bt(x):m?".*":"[^"+mt(O)+"]+?"})}}return i<t.length&&(a+=t.substr(i)),a&&o.push(a),o}function yt(t){return encodeURI(t).replace(/[\/?#]/g,function(t){return"%"+t.charCodeAt(0).toString(16).toUpperCase()})}function vt(t){for(var e=new Array(t.length),n=0;n<t.length;n++)"object"==typeof t[n]&&(e[n]=new RegExp("^(?:"+t[n].pattern+")$"));return function(n,o){for(var r="",i=n||{},a=(o||{}).pretty?yt:encodeURIComponent,c=0;c<t.length;c++){var s=t[c];if("string"!=typeof s){var u,p=i[s.name];if(null==p){if(s.optional){s.partial&&(r+=s.prefix);continue}throw new TypeError('Expected "'+s.name+'" to be defined')}if(ct(p)){if(!s.repeat)throw new TypeError('Expected "'+s.name+'" to not repeat, but received `'+JSON.stringify(p)+"`");if(0===p.length){if(s.optional)continue;throw new TypeError('Expected "'+s.name+'" to not be empty')}for(var l=0;l<p.length;l++){if(u=a(p[l]),!e[c].test(u))throw new TypeError('Expected all "'+s.name+'" to match "'+s.pattern+'", but received `'+JSON.stringify(u)+"`");r+=(0===l?s.prefix:s.delimiter)+u}}else{if(u=s.asterisk?encodeURI(p).replace(/[?#]/g,function(t){return"%"+t.charCodeAt(0).toString(16).toUpperCase()}):a(p),!e[c].test(u))throw new TypeError('Expected "'+s.name+'" to match "'+s.pattern+'", but received "'+u+'"');r+=s.prefix+u}}else r+=s}return r}}function mt(t){return t.replace(/([.+*?=^!:${}()[\]|\/\\])/g,"\\$1")}function bt(t){return t.replace(/([=!:$\/()])/g,"\\$1")}function gt(t,e){return t.keys=e,t}function wt(t){return t.sensitive?"":"i"}function Ot(t,e,n){ct(e)||(n=e||n,e=[]);for(var o=(n=n||{}).strict,r=!1!==n.end,i="",a=0;a<t.length;a++){var c=t[a];if("string"==typeof c)i+=mt(c);else{var s=mt(c.prefix),u="(?:"+c.pattern+")";e.push(c),c.repeat&&(u+="(?:"+s+u+")*"),i+=u=c.optional?c.partial?s+"("+u+")?":"(?:"+s+"("+u+"))?":s+"("+u+")"}}var p=mt(n.delimiter||"/"),l=i.slice(-p.length)===p;return o||(i=(l?i.slice(0,-p.length):i)+"(?:"+p+"(?=$))?"),i+=r?"$":o&&l?"":"(?="+p+"|$)",gt(new RegExp("^"+i,wt(n)),e)}function xt(t,e,n){return ct(e)||(n=e||n,e=[]),n=n||{},t instanceof RegExp?function(t,e){var n=t.source.match(/\((?!\?)/g);if(n)for(var o=0;o<n.length;o++)e.push({name:o,prefix:null,delimiter:null,optional:!1,repeat:!1,partial:!1,asterisk:!1,pattern:null});return gt(t,e)}(t,e):ct(t)?function(t,e,n){for(var o=[],r=0;r<t.length;r++)o.push(xt(t[r],e,n).source);return gt(new RegExp("(?:"+o.join("|")+")",wt(n)),e)}(t,e,n):function(t,e,n){return Ot(dt(t,n),e,n)}(t,e,n)}st.parse=ut,st.compile=pt,st.tokensToFunction=lt,st.tokensToRegExp=ft;var Rt={},Pt=0,jt=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments[2];"string"==typeof e&&(e={path:e});var o=e,r=o.path,i=o.exact,a=void 0!==i&&i,c=o.strict,s=void 0!==c&&c,u=o.sensitive,p=void 0!==u&&u;if(null==r)return n;var l=function(t,e){var n=""+e.end+e.strict+e.sensitive,o=Rt[n]||(Rt[n]={});if(o[t])return o[t];var r=[],i={re:st(t,r,e),keys:r};return Pt<1e4&&(o[t]=i,Pt++),i}(r,{end:a,strict:s,sensitive:p}),f=l.re,h=l.keys,d=f.exec(t);if(!d)return null;var y=d[0],v=d.slice(1),m=t===y;return a&&!m?null:{path:r,url:"/"===r&&""===y?"/":y,isExact:m,params:h.reduce(function(t,e,n){return t[e.name]=v[n],t},{})}},Et=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t};function Tt(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}var Ct=function(t){return 0===e.Children.count(t)},St=function(t){function o(){var e,n;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,o);for(var r=arguments.length,i=Array(r),a=0;a<r;a++)i[a]=arguments[a];return e=n=Tt(this,t.call.apply(t,[this].concat(i))),n.state={match:n.computeMatch(n.props,n.context.router)},Tt(n,e)}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(o,t),o.prototype.getChildContext=function(){return{router:Et({},this.context.router,{route:{location:this.props.location||this.context.router.route.location,match:this.state.match}})}},o.prototype.computeMatch=function(t,e){var n=t.computedMatch,o=t.location,r=t.path,i=t.strict,a=t.exact,c=t.sensitive;if(n)return n;d(e,"You should not use <Route> or withRouter() outside a <Router>");var s=e.route,u=(o||s.location).pathname;return jt(u,{path:r,strict:i,exact:a,sensitive:c},s.match)},o.prototype.componentWillMount=function(){n(!(this.props.component&&this.props.render),"You should not use <Route component> and <Route render> in the same route; <Route render> will be ignored"),n(!(this.props.component&&this.props.children&&!Ct(this.props.children)),"You should not use <Route component> and <Route children> in the same route; <Route children> will be ignored"),n(!(this.props.render&&this.props.children&&!Ct(this.props.children)),"You should not use <Route render> and <Route children> in the same route; <Route children> will be ignored")},o.prototype.componentWillReceiveProps=function(t,e){n(!(t.location&&!this.props.location),'<Route> elements should not change from uncontrolled to controlled (or vice versa). You initially used no "location" prop and then provided one on a subsequent render.'),n(!(!t.location&&this.props.location),'<Route> elements should not change from controlled to uncontrolled (or vice versa). You provided a "location" prop initially but omitted it on a subsequent render.'),this.setState({match:this.computeMatch(t,e.router)})},o.prototype.render=function(){var t=this.state.match,n=this.props,o=n.children,r=n.component,i=n.render,a=this.context.router,c=a.history,s=a.route,u=a.staticContext,p={match:t,location:this.props.location||s.location,history:c,staticContext:u};return r?t?e.createElement(r,p):null:i?t?i(p):null:"function"==typeof o?o(p):o&&!Ct(o)?e.Children.only(o):null},o}(e.Component);St.propTypes={computedMatch:h.object,path:h.string,exact:h.bool,strict:h.bool,sensitive:h.bool,component:h.func,render:h.func,children:h.oneOfType([h.func,h.node]),location:h.object},St.contextTypes={router:h.shape({history:h.object.isRequired,route:h.object.isRequired,staticContext:h.object})},St.childContextTypes={router:h.object.isRequired};var kt=function(t){var n=t.to,o=t.exact,r=t.strict,i=t.location,a=t.activeClassName,c=t.className,s=t.activeStyle,u=t.style,p=t.isActive,l=t["aria-current"],f=X(t,["to","exact","strict","location","activeClassName","className","activeStyle","style","isActive","aria-current"]),h="object"===(void 0===n?"undefined":J(n))?n.pathname:n,d=h&&h.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1");return e.createElement(St,{path:d,exact:o,strict:r,location:i,children:function(t){var o=t.location,r=t.match,i=!!(p?p(r,o):r);return e.createElement(ot,z({to:n,className:i?[c,a].filter(function(t){return t}).join(" "):c,style:i?z({},u,s):u,"aria-current":i&&l||null},f))}})};kt.defaultProps={activeClassName:"active","aria-current":"page"};var At=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,t.apply(this,arguments))}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),e.prototype.enable=function(t){this.unblock&&this.unblock(),this.unblock=this.context.router.history.block(t)},e.prototype.disable=function(){this.unblock&&(this.unblock(),this.unblock=null)},e.prototype.componentWillMount=function(){d(this.context.router,"You should not use <Prompt> outside a <Router>"),this.props.when&&this.enable(this.props.message)},e.prototype.componentWillReceiveProps=function(t){t.when?this.props.when&&this.props.message===t.message||this.enable(t.message):this.disable()},e.prototype.componentWillUnmount=function(){this.disable()},e.prototype.render=function(){return null},e}(e.Component);At.propTypes={when:h.bool,message:h.oneOfType([h.func,h.string]).isRequired},At.defaultProps={when:!0},At.contextTypes={router:h.shape({history:h.shape({block:h.func.isRequired}).isRequired}).isRequired};var _t={},Mt=0,Lt=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"/",e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return"/"===t?t:function(t){var e=t,n=_t[e]||(_t[e]={});if(n[t])return n[t];var o=st.compile(t);return Mt<1e4&&(n[t]=o,Mt++),o}(t)(e,{pretty:!0})},qt=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t};var Ut=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,t.apply(this,arguments))}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),e.prototype.isStatic=function(){return this.context.router&&this.context.router.staticContext},e.prototype.componentWillMount=function(){d(this.context.router,"You should not use <Redirect> outside a <Router>"),this.isStatic()&&this.perform()},e.prototype.componentDidMount=function(){this.isStatic()||this.perform()},e.prototype.componentDidUpdate=function(t){var e=j(t.to),o=j(this.props.to);E(e,o)?n(!1,"You tried to redirect to the same route you're currently on: \""+o.pathname+o.search+'"'):this.perform()},e.prototype.computeTo=function(t){var e=t.computedMatch,n=t.to;return e?"string"==typeof n?Lt(n,e.params):qt({},n,{pathname:Lt(n.pathname,e.params)}):n},e.prototype.perform=function(){var t=this.context.router.history,e=this.props.push,n=this.computeTo(this.props);e?t.push(n):t.replace(n)},e.prototype.render=function(){return null},e}(e.Component);Ut.propTypes={computedMatch:h.object,push:h.bool,from:h.string,to:h.oneOfType([h.string,h.object]).isRequired},Ut.defaultProps={push:!1},Ut.contextTypes={router:h.shape({history:h.shape({push:h.func.isRequired,replace:h.func.isRequired}).isRequired,staticContext:h.object}).isRequired};var Ht=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t};function Yt(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}var Wt=function(t){return"/"===t.charAt(0)?t:"/"+t},It=function(t,e){return t?Ht({},e,{pathname:Wt(t)+e.pathname}):e},Nt=function(t){return"string"==typeof t?t:R(t)},Bt=function(t){return function(){d(!1,"You cannot %s with <StaticRouter>",t)}},Dt=function(){},$t=function(t){function o(){var e,n;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,o);for(var r=arguments.length,i=Array(r),a=0;a<r;a++)i[a]=arguments[a];return e=n=Yt(this,t.call.apply(t,[this].concat(i))),n.createHref=function(t){return Wt(n.props.basename+Nt(t))},n.handlePush=function(t){var e=n.props,o=e.basename,r=e.context;r.action="PUSH",r.location=It(o,j(t)),r.url=Nt(r.location)},n.handleReplace=function(t){var e=n.props,o=e.basename,r=e.context;r.action="REPLACE",r.location=It(o,j(t)),r.url=Nt(r.location)},n.handleListen=function(){return Dt},n.handleBlock=function(){return Dt},Yt(n,e)}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(o,t),o.prototype.getChildContext=function(){return{router:{staticContext:this.props.context}}},o.prototype.componentWillMount=function(){n(!this.props.history,"<StaticRouter> ignores the history prop. To use a custom history, use `import { Router }` instead of `import { StaticRouter as Router }`.")},o.prototype.render=function(){var t=this.props,n=t.basename,o=(t.context,t.location),r=function(t,e){var n={};for(var o in t)e.indexOf(o)>=0||Object.prototype.hasOwnProperty.call(t,o)&&(n[o]=t[o]);return n}(t,["basename","context","location"]),i={createHref:this.createHref,action:"POP",location:function(t,e){if(!t)return e;var n=Wt(t);return 0!==e.pathname.indexOf(n)?e:Ht({},e,{pathname:e.pathname.substr(n.length)})}(n,j(o)),push:this.handlePush,replace:this.handleReplace,go:Bt("go"),goBack:Bt("goBack"),goForward:Bt("goForward"),listen:this.handleListen,block:this.handleBlock};return e.createElement(V,Ht({},r,{history:i}))},o}(e.Component);$t.propTypes={basename:h.string,context:h.object.isRequired,location:h.oneOfType([h.string,h.object])},$t.defaultProps={basename:"",location:"/"},$t.childContextTypes={router:h.object.isRequired};var Ft=function(t){function o(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,o),function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,t.apply(this,arguments))}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(o,t),o.prototype.componentWillMount=function(){d(this.context.router,"You should not use <Switch> outside a <Router>")},o.prototype.componentWillReceiveProps=function(t){n(!(t.location&&!this.props.location),'<Switch> elements should not change from uncontrolled to controlled (or vice versa). You initially used no "location" prop and then provided one on a subsequent render.'),n(!(!t.location&&this.props.location),'<Switch> elements should not change from controlled to uncontrolled (or vice versa). You provided a "location" prop initially but omitted it on a subsequent render.')},o.prototype.render=function(){var t=this.context.router.route,n=this.props.children,o=this.props.location||t.location,r=void 0,i=void 0;return e.Children.forEach(n,function(n){if(null==r&&e.isValidElement(n)){var a=n.props,c=a.path,s=a.exact,u=a.strict,p=a.sensitive,l=a.from,f=c||l;i=n,r=jt(o.pathname,{path:f,exact:s,strict:u,sensitive:p},t.match)}}),r?e.cloneElement(i,{location:o,computedMatch:r}):null},o}(e.Component);Ft.contextTypes={router:h.shape({route:h.object.isRequired}).isRequired},Ft.propTypes={children:h.node,location:h.object};var Kt=o(function(t,e){var n,o,r,i,a,c,s,u;t.exports=(n={childContextTypes:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},o={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},r=Object.defineProperty,i=Object.getOwnPropertyNames,a=Object.getOwnPropertySymbols,c=Object.getOwnPropertyDescriptor,s=Object.getPrototypeOf,u=s&&s(Object),function t(e,p,l){if("string"!=typeof p){if(u){var f=s(p);f&&f!==u&&t(e,f,l)}var h=i(p);a&&(h=h.concat(a(p)));for(var d=0;d<h.length;++d){var y=h[d];if(!(n[y]||o[y]||l&&l[y])){var v=c(p,y);try{r(e,y,v)}catch(t){}}}return e}return e})}),Vt=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t};t.BrowserRouter=tt,t.HashRouter=et,t.Link=ot,t.MemoryRouter=it,t.NavLink=kt,t.Prompt=At,t.Redirect=Ut,t.Route=St,t.Router=V,t.StaticRouter=$t,t.Switch=Ft,t.generatePath=Lt,t.matchPath=jt,t.withRouter=function(t){var n=function(n){var o=n.wrappedComponentRef,r=function(t,e){var n={};for(var o in t)e.indexOf(o)>=0||Object.prototype.hasOwnProperty.call(t,o)&&(n[o]=t[o]);return n}(n,["wrappedComponentRef"]);return e.createElement(St,{children:function(n){return e.createElement(t,Vt({},r,n,{ref:o}))}})};return n.displayName="withRouter("+(t.displayName||t.name)+")",n.WrappedComponent=t,n.propTypes={wrappedComponentRef:h.func},Kt(n,t)},Object.defineProperty(t,"__esModule",{value:!0})});

withRouter.js

@@ -1,8 +1,8 @@
-'use strict';
+"use strict";
exports.__esModule = true;
-var _withRouter = require('react-router/withRouter');
+var _withRouter = require("react-router/withRouter");
var _withRouter2 = _interopRequireDefault(_withRouter);