Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-history

Package Overview
Dependencies
Maintainers
2
Versions
30
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-history - npm Package Compare versions

Comparing version 0.17.0 to 0.18.0

4

BrowserHistory.js

@@ -71,5 +71,3 @@ 'use strict';

if (typeof children !== 'function') return _react2.default.Children.only(children);
return children(this.history);
return typeof children === 'function' ? children(this.history) : _react2.default.Children.only(children);
};

@@ -76,0 +74,0 @@

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

if (typeof children !== 'function') return _react2.default.Children.only(children);
return children(this.history);
return typeof children === 'function' ? children(this.history) : _react2.default.Children.only(children);
};

@@ -73,0 +71,0 @@

@@ -70,5 +70,3 @@ 'use strict';

if (typeof children !== 'function') return _react2.default.Children.only(children);
return children(this.history);
return typeof children === 'function' ? children(this.history) : _react2.default.Children.only(children);
};

@@ -75,0 +73,0 @@

{
"name": "react-history",
"version": "0.17.0",
"version": "0.18.0",
"description": "Manage session history with React",

@@ -20,3 +20,3 @@ "repository": "mjackson/react-history",

"dependencies": {
"history": "^4.3.0"
"history": "^4.5.0"
},

@@ -23,0 +23,0 @@ "peerDependencies": {

@@ -305,5 +305,3 @@ (function webpackUniversalModuleDefinition(root, factory) {

if (typeof children !== 'function') return _react2.default.Children.only(children);
return children(this.history);
return typeof children === 'function' ? children(this.history) : _react2.default.Children.only(children);
};

@@ -1124,5 +1122,3 @@

if (typeof children !== 'function') return _react2.default.Children.only(children);
return children(this.history);
return typeof children === 'function' ? children(this.history) : _react2.default.Children.only(children);
};

@@ -1536,5 +1532,3 @@

if (typeof children !== 'function') return _react2.default.Children.only(children);
return children(this.history);
return typeof children === 'function' ? children(this.history) : _react2.default.Children.only(children);
};

@@ -1541,0 +1535,0 @@

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

!function(t,n){"object"==typeof exports&&"object"==typeof module?module.exports=n(require("react")):"function"==typeof define&&define.amd?define(["react"],n):"object"==typeof exports?exports.ReactHistory=n(require("react")):t.ReactHistory=n(t.React)}(this,function(t){return function(t){function n(o){if(e[o])return e[o].exports;var r=e[o]={exports:{},id:o,loaded:!1};return t[o].call(r.exports,r,r.exports,n),r.loaded=!0,r.exports}var e={};return n.m=t,n.c=e,n.p="",n(0)}([function(t,n,e){"use strict";function o(t){return t&&t.__esModule?t:{"default":t}}n.__esModule=!0,n.Prompt=n.MemoryHistory=n.HashHistory=n.BrowserHistory=void 0;var r=e(10);Object.keys(r).forEach(function(t){"default"!==t&&"__esModule"!==t&&Object.defineProperty(n,t,{enumerable:!0,get:function(){return r[t]}})});var i=e(11),a=o(i),u=e(12),c=o(u),s=e(13),f=o(s),l=e(14),p=o(l);n.BrowserHistory=a["default"],n.HashHistory=c["default"],n.MemoryHistory=f["default"],n.Prompt=p["default"]},function(n,e){n.exports=t},function(t,n,e){"use strict";n.__esModule=!0,n.history=n.location=n.action=void 0;var o=e(1),r=n.action=o.PropTypes.oneOf(["PUSH","REPLACE","POP"]),i=n.location=o.PropTypes.shape({pathname:o.PropTypes.string.isRequired,search:o.PropTypes.string.isRequired,hash:o.PropTypes.string.isRequired,state:o.PropTypes.object,key:o.PropTypes.string});n.history=o.PropTypes.shape({action:r.isRequired,location:i.isRequired,push:o.PropTypes.func.isRequired,replace:o.PropTypes.func.isRequired,go:o.PropTypes.func.isRequired,goBack:o.PropTypes.func.isRequired,goForward:o.PropTypes.func.isRequired,canGo:o.PropTypes.func,block:o.PropTypes.func.isRequired})},function(t,n,e){"use strict";var o=function(){};t.exports=o},function(t,n,e){"use strict";function o(t){return t&&t.__esModule?t:{"default":t}}n.__esModule=!0,n.locationsAreEqual=n.createLocation=void 0;var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol?"symbol":typeof t},i=Object.assign||function(t){for(var n=1;n<arguments.length;n++){var e=arguments[n];for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])}return t},a=e(18),u=o(a),c=e(5),s=(n.createLocation=function(t,n,e,o){var r=void 0;return"string"==typeof t?(r=(0,c.parsePath)(t),r.state=n):(r=i({},t),void 0===r.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!==n&&void 0===r.state&&(r.state=n)),r.key=e,o&&(r.pathname?"/"!==r.pathname.charAt(0)&&(r.pathname=(0,u["default"])(r.pathname,o.pathname)):r.pathname=o.pathname),r},function f(t,n){if(null==t)return t==n;var e="undefined"==typeof t?"undefined":r(t),o="undefined"==typeof n?"undefined":r(n);if(e!==o)return!1;if(Array.isArray(t))return!(!Array.isArray(n)||t.length!==n.length)&&t.every(function(t,e){return f(t,n[e])});if("object"===e){var i=Object.keys(t),a=Object.keys(n);return i.length===a.length&&i.every(function(e){return f(t[e],n[e])})}return t===n});n.locationsAreEqual=function(t,n){return t.pathname===n.pathname&&t.search===n.search&&t.hash===n.hash&&t.key===n.key&&s(t.state,n.state)}},function(t,n){"use strict";n.__esModule=!0;n.addLeadingSlash=function(t){return"/"===t.charAt(0)?t:"/"+t},n.stripLeadingSlash=function(t){return"/"===t.charAt(0)?t.substr(1):t},n.stripPrefix=function(t,n){return 0===t.indexOf(n)?t.substr(n.length):t},n.parsePath=function(t){var n=t||"/",e="",o="",r=n.indexOf("#");r!==-1&&(o=n.substr(r),n=n.substr(0,r));var i=n.indexOf("?");return i!==-1&&(e=n.substr(i),n=n.substr(0,i)),{pathname:n,search:"?"===e?"":e,hash:"#"===o?"":o}},n.createPath=function(t){var n=t.pathname,e=t.search,o=t.hash,r=n||"/";return e&&"?"!==e&&(r+="?"===e.charAt(0)?e:"?"+e),o&&"#"!==o&&(r+="#"===o.charAt(0)?o:"#"+o),r}},function(t,n,e){"use strict";function o(t){return t&&t.__esModule?t:{"default":t}}n.__esModule=!0;var r=e(3),i=(o(r),function(){var t=null,n=function(n){return t=n,function(){t===n&&(t=null)}},e=function(n,e,o,r){if(null!=t){var i="function"==typeof t?t(n,e):t;"string"==typeof i?"function"==typeof o?o(i,r):r(!0):r(i!==!1)}else r(!0)},o=[],r=function(t){return o.push(t),function(){o=o.filter(function(n){return n!==t})}},i=function(){for(var t=arguments.length,n=Array(t),e=0;e<t;e++)n[e]=arguments[e];return o.forEach(function(t){return t.apply(void 0,n)})};return{setPrompt:n,confirmTransitionTo:e,appendListener:r,notifyListeners:i}});n["default"]=i},function(t,n){"use strict";n.__esModule=!0;n.addEventListener=function(t,n,e){return t.addEventListener?t.addEventListener(n,e,!1):t.attachEvent("on"+n,e)},n.removeEventListener=function(t,n,e){return t.removeEventListener?t.removeEventListener(n,e,!1):t.detachEvent("on"+n,e)},n.getConfirmation=function(t,n){return n(window.confirm(t))},n.supportsHistory=function(){var t=window.navigator.userAgent;return(t.indexOf("Android 2.")===-1&&t.indexOf("Android 4.0")===-1||t.indexOf("Mobile Safari")===-1||t.indexOf("Chrome")!==-1||t.indexOf("Windows Phone")!==-1)&&(window.history&&"pushState"in window.history)},n.supportsPopStateOnHashChange=function(){return window.navigator.userAgent.indexOf("Trident")===-1},n.supportsGoWithoutReloadUsingHash=function(){return window.navigator.userAgent.indexOf("Firefox")===-1}},function(t,n){"use strict";n.__esModule=!0;n.canUseDOM=!("undefined"==typeof window||!window.document||!window.document.createElement)},function(t,n,e){"use strict";var o=function(t,n,e,o,r,i,a,u){if(!t){var c;if(void 0===n)c=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var s=[e,o,r,i,a,u],f=0;c=new Error(n.replace(/%s/g,function(){return s[f++]})),c.name="Invariant Violation"}throw c.framesToPop=1,c}};t.exports=o},function(t,n,e){"use strict";function o(t){return t&&t.__esModule?t:{"default":t}}function r(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}function i(t,n){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!n||"object"!=typeof n&&"function"!=typeof n?t:n}function a(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function, not "+typeof n);t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),n&&(Object.setPrototypeOf?Object.setPrototypeOf(t,n):t.__proto__=n)}n.__esModule=!0,n.Forward=n.Back=n.Pop=n.Replace=n.Push=void 0;var u=e(1),c=o(u),s=e(2),f=function(t){function n(){return r(this,n),i(this,t.apply(this,arguments))}return a(n,t),n.prototype.performAction=function(){this.props.perform(this.context.history)},n.prototype.componentDidMount=function(){this.performAction()},n.prototype.componentDidUpdate=function(){this.performAction()},n.prototype.render=function(){return null},n}(c["default"].Component);f.contextTypes={history:s.history.isRequired};var l=(n.Push=function(t){var n=t.location,e=t.path,o=t.state;return c["default"].createElement(f,{perform:function(t){return t.push(n||e,o)}})},n.Replace=function(t){var n=t.location,e=t.path,o=t.state;return c["default"].createElement(f,{perform:function(t){return t.replace(n||e,o)}})},n.Pop=function(t){var n=t.go;return c["default"].createElement(f,{perform:function(t){return t.go(n)}})});l.defaultProps={go:-1};n.Back=function(){return c["default"].createElement(f,{perform:function(t){return t.goBack()}})},n.Forward=function(){return c["default"].createElement(f,{perform:function(t){return t.goForward()}})}},function(t,n,e){"use strict";function o(t){return t&&t.__esModule?t:{"default":t}}function r(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}function i(t,n){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!n||"object"!=typeof n&&"function"!=typeof n?t:n}function a(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function, not "+typeof n);t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),n&&(Object.setPrototypeOf?Object.setPrototypeOf(t,n):t.__proto__=n)}n.__esModule=!0;var u=e(1),c=o(u),s=e(15),f=o(s),l=e(2),p=function(t){function n(){return r(this,n),i(this,t.apply(this,arguments))}return a(n,t),n.prototype.getChildContext=function(){return{history:this.history}},n.prototype.componentWillMount=function(){var t=this,n=this.props,e=n.basename,o=n.forceRefresh,r=n.getUserConfirmation,i=n.keyLength;this.history=(0,f["default"])({basename:e,forceRefresh:o,getUserConfirmation:r,keyLength:i}),this.unlisten=this.history.listen(function(){return t.forceUpdate()})},n.prototype.componentWillUnmount=function(){this.unlisten()},n.prototype.render=function(){var t=this.props.children;return"function"!=typeof t?c["default"].Children.only(t):t(this.history)},n}(c["default"].Component);p.childContextTypes={history:l.history.isRequired},n["default"]=p},function(t,n,e){"use strict";function o(t){return t&&t.__esModule?t:{"default":t}}function r(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}function i(t,n){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!n||"object"!=typeof n&&"function"!=typeof n?t:n}function a(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function, not "+typeof n);t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),n&&(Object.setPrototypeOf?Object.setPrototypeOf(t,n):t.__proto__=n)}n.__esModule=!0;var u=e(1),c=o(u),s=e(16),f=o(s),l=e(2),p=function(t){function n(){return r(this,n),i(this,t.apply(this,arguments))}return a(n,t),n.prototype.getChildContext=function(){return{history:this.history}},n.prototype.componentWillMount=function(){var t=this,n=this.props,e=n.basename,o=n.getUserConfirmation,r=n.hashType;this.history=(0,f["default"])({basename:e,getUserConfirmation:o,hashType:r}),this.unlisten=this.history.listen(function(){return t.forceUpdate()})},n.prototype.componentWillUnmount=function(){this.unlisten()},n.prototype.render=function(){var t=this.props.children;return"function"!=typeof t?c["default"].Children.only(t):t(this.history)},n}(c["default"].Component);p.childContextTypes={history:l.history.isRequired},n["default"]=p},function(t,n,e){"use strict";function o(t){return t&&t.__esModule?t:{"default":t}}function r(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}function i(t,n){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!n||"object"!=typeof n&&"function"!=typeof n?t:n}function a(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function, not "+typeof n);t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),n&&(Object.setPrototypeOf?Object.setPrototypeOf(t,n):t.__proto__=n)}n.__esModule=!0;var u=e(1),c=o(u),s=e(17),f=o(s),l=e(2),p=function(t){function n(){return r(this,n),i(this,t.apply(this,arguments))}return a(n,t),n.prototype.getChildContext=function(){return{history:this.history}},n.prototype.componentWillMount=function(){var t=this,n=this.props,e=n.getUserConfirmation,o=n.initialEntries,r=n.initialIndex,i=n.keyLength;this.history=(0,f["default"])({getUserConfirmation:e,initialEntries:o,initialIndex:r,keyLength:i}),this.unlisten=this.history.listen(function(){return t.forceUpdate()})},n.prototype.componentWillUnmount=function(){this.unlisten()},n.prototype.render=function(){var t=this.props.children;return"function"!=typeof t?c["default"].Children.only(t):t(this.history)},n}(c["default"].Component);p.childContextTypes={history:l.history.isRequired},n["default"]=p},function(t,n,e){"use strict";function o(t){return t&&t.__esModule?t:{"default":t}}function r(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}function i(t,n){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!n||"object"!=typeof n&&"function"!=typeof n?t:n}function a(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function, not "+typeof n);t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),n&&(Object.setPrototypeOf?Object.setPrototypeOf(t,n):t.__proto__=n)}n.__esModule=!0;var u=e(1),c=o(u),s=e(2),f=function(t){function n(){return r(this,n),i(this,t.apply(this,arguments))}return a(n,t),n.prototype.block=function(){this.teardownPrompt||(this.teardownPrompt=this.context.history.block(this.props.message))},n.prototype.unblock=function(){this.teardownPrompt&&(this.teardownPrompt(),this.teardownPrompt=null)},n.prototype.componentWillMount=function(){this.props.when&&this.block()},n.prototype.componentWillReceiveProps=function(t){t.when?this.block():this.unblock()},n.prototype.componentWillUnmount=function(){this.unblock()},n.prototype.render=function(){return null},n}(c["default"].Component);f.contextTypes={history:s.history.isRequired},f.defaultProps={when:!0},n["default"]=f},function(t,n,e){"use strict";function o(t){return t&&t.__esModule?t:{"default":t}}n.__esModule=!0;var r=("function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol?"symbol":typeof t},Object.assign||function(t){for(var n=1;n<arguments.length;n++){var e=arguments[n];for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])}return t}),i=e(3),a=(o(i),e(9)),u=o(a),c=e(4),s=e(5),f=e(6),l=o(f),p=e(8),h=e(7),d="popstate",y="hashchange",v=function(){try{return window.history.state||{}}catch(t){return{}}},m=function(){var t=arguments.length<=0||void 0===arguments[0]?{}:arguments[0];p.canUseDOM?void 0:(0,u["default"])(!1);var n=window.history,e=(0,h.supportsHistory)(),o=!(0,h.supportsPopStateOnHashChange)(),i=t.basename,a=void 0===i?"":i,f=t.forceRefresh,m=void 0!==f&&f,g=t.getUserConfirmation,w=void 0===g?h.getConfirmation:g,b=t.keyLength,P=void 0===b?6:b,O=function(t){var n=t||{},e=n.key,o=n.state,i=window.location,u=i.pathname,c=i.search,f=i.hash,l=u+c+f;return a&&(l=(0,s.stripPrefix)(l,a)),r({},(0,s.parsePath)(l),{state:o,key:e})},_=function(){return Math.random().toString(36).substr(2,P)},x=(0,l["default"])(),T=function(t){r(G,t),G.length=n.length,x.notifyListeners(G.location,G.action)},E=function(t){void 0!==t.state&&M(O(t.state))},L=function(){M(O(v()))},k=!1,M=function(t){k?(k=!1,T()):!function(){var n="POP";x.confirmTransitionTo(t,n,w,function(e){e?T({action:n,location:t}):C(t)})}()},C=function(t){var n=G.location,e=R.indexOf(n.key);e===-1&&(e=0);var o=R.indexOf(t.key);o===-1&&(o=0);var r=e-o;r&&(k=!0,U(r))},j=O(v()),R=[j.key],S=function(t,o){var r="PUSH",i=(0,c.createLocation)(t,o,_(),G.location);x.confirmTransitionTo(i,r,w,function(t){if(t){var o=a+(0,s.createPath)(i),u=i.key,c=i.state;if(e)if(n.pushState({key:u,state:c},null,o),m)window.location.href=o;else{var f=R.indexOf(G.location.key),l=R.slice(0,f===-1?0:f+1);l.push(i.key),R=l,T({action:r,location:i})}else window.location.href=o}})},A=function(t,o){var r="REPLACE",i=(0,c.createLocation)(t,o,_(),G.location);x.confirmTransitionTo(i,r,w,function(t){if(t){var o=a+(0,s.createPath)(i),u=i.key,c=i.state;if(e)if(n.replaceState({key:u,state:c},null,o),m)window.location.replace(o);else{var f=R.indexOf(G.location.key);f!==-1&&(R[f]=i.key),T({action:r,location:i})}else window.location.replace(o)}})},U=function(t){n.go(t)},q=function(){return U(-1)},H=function(){return U(1)},W=0,B=function(t){W+=t,1===W?((0,h.addEventListener)(window,d,E),o&&(0,h.addEventListener)(window,y,L)):0===W&&((0,h.removeEventListener)(window,d,E),o&&(0,h.removeEventListener)(window,y,L))},F=!1,I=function(){var t=!(arguments.length<=0||void 0===arguments[0])&&arguments[0],n=x.setPrompt(t);return F||(B(1),F=!0),function(){return F&&(F=!1,B(-1)),n()}},D=function(t){var n=x.appendListener(t);return B(1),function(){return B(-1),n()}},G={length:n.length,action:"POP",location:j,push:S,replace:A,go:U,goBack:q,goForward:H,block:I,listen:D};return G};n["default"]=m},function(t,n,e){"use strict";function o(t){return t&&t.__esModule?t:{"default":t}}n.__esModule=!0;var r=Object.assign||function(t){for(var n=1;n<arguments.length;n++){var e=arguments[n];for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])}return t},i=e(3),a=(o(i),e(9)),u=o(a),c=e(4),s=e(5),f=e(6),l=o(f),p=e(8),h=e(7),d="hashchange",y={hashbang:{encodePath:function(t){return"!"===t.charAt(0)?t:"!/"+(0,s.stripLeadingSlash)(t)},decodePath:function(t){return"!"===t.charAt(0)?t.substr(1):t}},noslash:{encodePath:s.stripLeadingSlash,decodePath:s.addLeadingSlash},slash:{encodePath:s.addLeadingSlash,decodePath:s.addLeadingSlash}},v=function(){var t=window.location.href,n=t.indexOf("#");return n===-1?"":t.substring(n+1)},m=function(t){return window.location.hash=t},g=function(t){var n=window.location.href.indexOf("#");window.location.replace(window.location.href.slice(0,n>=0?n:0)+"#"+t)},w=function(){var t=arguments.length<=0||void 0===arguments[0]?{}:arguments[0];p.canUseDOM?void 0:(0,u["default"])(!1);var n=window.history,e=((0,h.supportsGoWithoutReloadUsingHash)(),t.basename),o=void 0===e?"":e,i=t.getUserConfirmation,a=void 0===i?h.getConfirmation:i,f=t.hashType,w=void 0===f?"slash":f,b=y[w],P=b.encodePath,O=b.decodePath,_=function(){var t=O(v());return o&&(t=(0,s.stripPrefix)(t,o)),(0,s.parsePath)(t)},x=(0,l["default"])(),T=function(t){r(z,t),z.length=n.length,x.notifyListeners(z.location,z.action)},E=!1,L=null,k=function(){var t=v(),n=P(t);if(t!==n)g(n);else{var e=_(),o=z.location;if(!E&&(0,c.locationsAreEqual)(o,e))return;if(L===(0,s.createPath)(e))return;L=null,M(e)}},M=function(t){E?(E=!1,T()):!function(){var n="POP";x.confirmTransitionTo(t,n,a,function(e){e?T({action:n,location:t}):C(t)})}()},C=function(t){var n=z.location,e=A.lastIndexOf((0,s.createPath)(n));e===-1&&(e=0);var o=A.lastIndexOf((0,s.createPath)(t));o===-1&&(o=0);var r=e-o;r&&(E=!0,H(r))},j=v(),R=P(j);j!==R&&g(R);var S=_(),A=[(0,s.createPath)(S)],U=function(t,n){var e="PUSH",r=(0,c.createLocation)(t,void 0,void 0,z.location);x.confirmTransitionTo(r,e,a,function(t){if(t){var n=(0,s.createPath)(r),i=P(o+n),a=v()!==i;if(a){L=n,m(i);var u=A.lastIndexOf((0,s.createPath)(z.location)),c=A.slice(0,u===-1?0:u+1);c.push(n),A=c,T({action:e,location:r})}else T()}})},q=function(t,n){var e="REPLACE",r=(0,c.createLocation)(t,void 0,void 0,z.location);x.confirmTransitionTo(r,e,a,function(t){if(t){var n=(0,s.createPath)(r),i=P(o+n),a=v()!==i;a&&(L=n,g(i));var u=A.indexOf((0,s.createPath)(z.location));u!==-1&&(A[u]=n),T({action:e,location:r})}})},H=function(t){n.go(t)},W=function(){return H(-1)},B=function(){return H(1)},F=0,I=function(t){F+=t,1===F?(0,h.addEventListener)(window,d,k):0===F&&(0,h.removeEventListener)(window,d,k)},D=!1,G=function(){var t=!(arguments.length<=0||void 0===arguments[0])&&arguments[0],n=x.setPrompt(t);return D||(I(1),D=!0),function(){return D&&(D=!1,I(-1)),n()}},V=function(t){var n=x.appendListener(t);return I(1),function(){return I(-1),n()}},z={length:n.length,action:"POP",location:S,push:U,replace:q,go:H,goBack:W,goForward:B,block:G,listen:V};return z};n["default"]=w},function(t,n,e){"use strict";function o(t){return t&&t.__esModule?t:{"default":t}}n.__esModule=!0;var r=("function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol?"symbol":typeof t},Object.assign||function(t){for(var n=1;n<arguments.length;n++){var e=arguments[n];for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])}return t}),i=e(3),a=(o(i),e(4)),u=e(6),c=o(u),s=function(t,n,e){return Math.min(Math.max(t,n),e)},f=function(){var t=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],n=t.getUserConfirmation,e=t.initialEntries,o=void 0===e?["/"]:e,i=t.initialIndex,u=void 0===i?0:i,f=t.keyLength,l=void 0===f?6:f,p=(0,c["default"])(),h=function(t){r(T,t),T.length=T.entries.length,p.notifyListeners(T.location,T.action)},d=function(){return Math.random().toString(36).substr(2,l)},y=s(u,0,o.length-1),v=o.map(function(t,n){return"string"==typeof t?(0,a.createLocation)(t,void 0,n?d():void 0):(0,a.createLocation)(t,void 0,n?t.key||d():void 0)}),m=function(t,e){var o="PUSH",r=(0,a.createLocation)(t,e,d(),T.location);p.confirmTransitionTo(r,o,n,function(t){if(t){var n=T.index,e=n+1,i=T.entries.slice(0);i.length>e?i.splice(e,i.length-e,r):i.push(r),h({action:o,location:r,index:e,entries:i})}})},g=function(t,e){var o="REPLACE",r=(0,a.createLocation)(t,e,d(),T.location);p.confirmTransitionTo(r,o,n,function(t){t&&(T.entries[T.index]=r,h({action:o,location:r}))})},w=function(t){var e=s(T.index+t,0,T.entries.length-1),o="POP",r=T.entries[e];p.confirmTransitionTo(r,o,n,function(t){t?h({action:o,location:r,index:e}):h()})},b=function(){return w(-1)},P=function(){return w(1)},O=function(t){var n=T.index+t;return n>=0&&n<T.entries.length},_=function(){var t=!(arguments.length<=0||void 0===arguments[0])&&arguments[0];return p.setPrompt(t)},x=function(t){return p.appendListener(t)},T={length:v.length,action:"POP",location:v[y],index:y,entries:v,push:m,replace:g,go:w,goBack:b,goForward:P,canGo:O,block:_,listen:x};return T};n["default"]=f},function(t,n,e){!function(n,e){t.exports=e()}(this,function(){return function(t){function n(o){if(e[o])return e[o].exports;var r=e[o]={exports:{},id:o,loaded:!1};return t[o].call(r.exports,r,r.exports,n),r.loaded=!0,r.exports}var e={};return n.m=t,n.c=e,n.p="",n(0)}([function(t,n){"use strict";var e=function(t){return"/"===t.charAt(0)},o=function(t,n){for(var e=n,o=e+1,r=t.length;r>o;e+=1,o+=1)t[e]=t[o];t.pop()},r=function(t){var n=arguments.length<=1||void 0===arguments[1]?"":arguments[1],r=t&&t.split("/")||[],i=n&&n.split("/")||[],a=t&&e(t),u=n&&e(n),c=a||u;if(t&&e(t)?i=r:r.length&&(i.pop(),i=i.concat(r)),!i.length)return"/";var s=void 0;if(i.length){var f=i[i.length-1];s="."===f||".."===f||""===f}else s=!1;for(var l=0,p=i.length;p>=0;p--){var h=i[p];"."===h?o(i,p):".."===h?(o(i,p),l++):l&&(o(i,p),l--)}if(!c)for(;l--;l)i.unshift("..");!c||""===i[0]||i[0]&&e(i[0])||i.unshift("");var d=i.join("/");return s&&"/"!==d.substr(-1)&&(d+="/"),d};t.exports=r}])})}])});
!function(t,n){"object"==typeof exports&&"object"==typeof module?module.exports=n(require("react")):"function"==typeof define&&define.amd?define(["react"],n):"object"==typeof exports?exports.ReactHistory=n(require("react")):t.ReactHistory=n(t.React)}(this,function(t){return function(t){function n(o){if(e[o])return e[o].exports;var r=e[o]={exports:{},id:o,loaded:!1};return t[o].call(r.exports,r,r.exports,n),r.loaded=!0,r.exports}var e={};return n.m=t,n.c=e,n.p="",n(0)}([function(t,n,e){"use strict";function o(t){return t&&t.__esModule?t:{"default":t}}n.__esModule=!0,n.Prompt=n.MemoryHistory=n.HashHistory=n.BrowserHistory=void 0;var r=e(10);Object.keys(r).forEach(function(t){"default"!==t&&"__esModule"!==t&&Object.defineProperty(n,t,{enumerable:!0,get:function(){return r[t]}})});var i=e(11),a=o(i),u=e(12),c=o(u),s=e(13),f=o(s),l=e(14),p=o(l);n.BrowserHistory=a["default"],n.HashHistory=c["default"],n.MemoryHistory=f["default"],n.Prompt=p["default"]},function(n,e){n.exports=t},function(t,n,e){"use strict";n.__esModule=!0,n.history=n.location=n.action=void 0;var o=e(1),r=n.action=o.PropTypes.oneOf(["PUSH","REPLACE","POP"]),i=n.location=o.PropTypes.shape({pathname:o.PropTypes.string.isRequired,search:o.PropTypes.string.isRequired,hash:o.PropTypes.string.isRequired,state:o.PropTypes.object,key:o.PropTypes.string});n.history=o.PropTypes.shape({action:r.isRequired,location:i.isRequired,push:o.PropTypes.func.isRequired,replace:o.PropTypes.func.isRequired,go:o.PropTypes.func.isRequired,goBack:o.PropTypes.func.isRequired,goForward:o.PropTypes.func.isRequired,canGo:o.PropTypes.func,block:o.PropTypes.func.isRequired})},function(t,n,e){"use strict";var o=function(){};t.exports=o},function(t,n,e){"use strict";function o(t){return t&&t.__esModule?t:{"default":t}}n.__esModule=!0,n.locationsAreEqual=n.createLocation=void 0;var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol?"symbol":typeof t},i=Object.assign||function(t){for(var n=1;n<arguments.length;n++){var e=arguments[n];for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])}return t},a=e(18),u=o(a),c=e(5),s=(n.createLocation=function(t,n,e,o){var r=void 0;return"string"==typeof t?(r=(0,c.parsePath)(t),r.state=n):(r=i({},t),void 0===r.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!==n&&void 0===r.state&&(r.state=n)),r.key=e,o&&(r.pathname?"/"!==r.pathname.charAt(0)&&(r.pathname=(0,u["default"])(r.pathname,o.pathname)):r.pathname=o.pathname),r},function f(t,n){if(null==t)return t==n;var e="undefined"==typeof t?"undefined":r(t),o="undefined"==typeof n?"undefined":r(n);if(e!==o)return!1;if(Array.isArray(t))return!(!Array.isArray(n)||t.length!==n.length)&&t.every(function(t,e){return f(t,n[e])});if("object"===e){var i=Object.keys(t),a=Object.keys(n);return i.length===a.length&&i.every(function(e){return f(t[e],n[e])})}return t===n});n.locationsAreEqual=function(t,n){return t.pathname===n.pathname&&t.search===n.search&&t.hash===n.hash&&t.key===n.key&&s(t.state,n.state)}},function(t,n){"use strict";n.__esModule=!0;n.addLeadingSlash=function(t){return"/"===t.charAt(0)?t:"/"+t},n.stripLeadingSlash=function(t){return"/"===t.charAt(0)?t.substr(1):t},n.stripPrefix=function(t,n){return 0===t.indexOf(n)?t.substr(n.length):t},n.parsePath=function(t){var n=t||"/",e="",o="",r=n.indexOf("#");r!==-1&&(o=n.substr(r),n=n.substr(0,r));var i=n.indexOf("?");return i!==-1&&(e=n.substr(i),n=n.substr(0,i)),{pathname:n,search:"?"===e?"":e,hash:"#"===o?"":o}},n.createPath=function(t){var n=t.pathname,e=t.search,o=t.hash,r=n||"/";return e&&"?"!==e&&(r+="?"===e.charAt(0)?e:"?"+e),o&&"#"!==o&&(r+="#"===o.charAt(0)?o:"#"+o),r}},function(t,n,e){"use strict";function o(t){return t&&t.__esModule?t:{"default":t}}n.__esModule=!0;var r=e(3),i=(o(r),function(){var t=null,n=function(n){return t=n,function(){t===n&&(t=null)}},e=function(n,e,o,r){if(null!=t){var i="function"==typeof t?t(n,e):t;"string"==typeof i?"function"==typeof o?o(i,r):r(!0):r(i!==!1)}else r(!0)},o=[],r=function(t){return o.push(t),function(){o=o.filter(function(n){return n!==t})}},i=function(){for(var t=arguments.length,n=Array(t),e=0;e<t;e++)n[e]=arguments[e];return o.forEach(function(t){return t.apply(void 0,n)})};return{setPrompt:n,confirmTransitionTo:e,appendListener:r,notifyListeners:i}});n["default"]=i},function(t,n){"use strict";n.__esModule=!0;n.addEventListener=function(t,n,e){return t.addEventListener?t.addEventListener(n,e,!1):t.attachEvent("on"+n,e)},n.removeEventListener=function(t,n,e){return t.removeEventListener?t.removeEventListener(n,e,!1):t.detachEvent("on"+n,e)},n.getConfirmation=function(t,n){return n(window.confirm(t))},n.supportsHistory=function(){var t=window.navigator.userAgent;return(t.indexOf("Android 2.")===-1&&t.indexOf("Android 4.0")===-1||t.indexOf("Mobile Safari")===-1||t.indexOf("Chrome")!==-1||t.indexOf("Windows Phone")!==-1)&&(window.history&&"pushState"in window.history)},n.supportsPopStateOnHashChange=function(){return window.navigator.userAgent.indexOf("Trident")===-1},n.supportsGoWithoutReloadUsingHash=function(){return window.navigator.userAgent.indexOf("Firefox")===-1}},function(t,n){"use strict";n.__esModule=!0;n.canUseDOM=!("undefined"==typeof window||!window.document||!window.document.createElement)},function(t,n,e){"use strict";var o=function(t,n,e,o,r,i,a,u){if(!t){var c;if(void 0===n)c=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var s=[e,o,r,i,a,u],f=0;c=new Error(n.replace(/%s/g,function(){return s[f++]})),c.name="Invariant Violation"}throw c.framesToPop=1,c}};t.exports=o},function(t,n,e){"use strict";function o(t){return t&&t.__esModule?t:{"default":t}}function r(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}function i(t,n){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!n||"object"!=typeof n&&"function"!=typeof n?t:n}function a(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function, not "+typeof n);t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),n&&(Object.setPrototypeOf?Object.setPrototypeOf(t,n):t.__proto__=n)}n.__esModule=!0,n.Forward=n.Back=n.Pop=n.Replace=n.Push=void 0;var u=e(1),c=o(u),s=e(2),f=function(t){function n(){return r(this,n),i(this,t.apply(this,arguments))}return a(n,t),n.prototype.performAction=function(){this.props.perform(this.context.history)},n.prototype.componentDidMount=function(){this.performAction()},n.prototype.componentDidUpdate=function(){this.performAction()},n.prototype.render=function(){return null},n}(c["default"].Component);f.contextTypes={history:s.history.isRequired};var l=(n.Push=function(t){var n=t.location,e=t.path,o=t.state;return c["default"].createElement(f,{perform:function(t){return t.push(n||e,o)}})},n.Replace=function(t){var n=t.location,e=t.path,o=t.state;return c["default"].createElement(f,{perform:function(t){return t.replace(n||e,o)}})},n.Pop=function(t){var n=t.go;return c["default"].createElement(f,{perform:function(t){return t.go(n)}})});l.defaultProps={go:-1};n.Back=function(){return c["default"].createElement(f,{perform:function(t){return t.goBack()}})},n.Forward=function(){return c["default"].createElement(f,{perform:function(t){return t.goForward()}})}},function(t,n,e){"use strict";function o(t){return t&&t.__esModule?t:{"default":t}}function r(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}function i(t,n){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!n||"object"!=typeof n&&"function"!=typeof n?t:n}function a(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function, not "+typeof n);t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),n&&(Object.setPrototypeOf?Object.setPrototypeOf(t,n):t.__proto__=n)}n.__esModule=!0;var u=e(1),c=o(u),s=e(15),f=o(s),l=e(2),p=function(t){function n(){return r(this,n),i(this,t.apply(this,arguments))}return a(n,t),n.prototype.getChildContext=function(){return{history:this.history}},n.prototype.componentWillMount=function(){var t=this,n=this.props,e=n.basename,o=n.forceRefresh,r=n.getUserConfirmation,i=n.keyLength;this.history=(0,f["default"])({basename:e,forceRefresh:o,getUserConfirmation:r,keyLength:i}),this.unlisten=this.history.listen(function(){return t.forceUpdate()})},n.prototype.componentWillUnmount=function(){this.unlisten()},n.prototype.render=function(){var t=this.props.children;return"function"==typeof t?t(this.history):c["default"].Children.only(t)},n}(c["default"].Component);p.childContextTypes={history:l.history.isRequired},n["default"]=p},function(t,n,e){"use strict";function o(t){return t&&t.__esModule?t:{"default":t}}function r(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}function i(t,n){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!n||"object"!=typeof n&&"function"!=typeof n?t:n}function a(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function, not "+typeof n);t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),n&&(Object.setPrototypeOf?Object.setPrototypeOf(t,n):t.__proto__=n)}n.__esModule=!0;var u=e(1),c=o(u),s=e(16),f=o(s),l=e(2),p=function(t){function n(){return r(this,n),i(this,t.apply(this,arguments))}return a(n,t),n.prototype.getChildContext=function(){return{history:this.history}},n.prototype.componentWillMount=function(){var t=this,n=this.props,e=n.basename,o=n.getUserConfirmation,r=n.hashType;this.history=(0,f["default"])({basename:e,getUserConfirmation:o,hashType:r}),this.unlisten=this.history.listen(function(){return t.forceUpdate()})},n.prototype.componentWillUnmount=function(){this.unlisten()},n.prototype.render=function(){var t=this.props.children;return"function"==typeof t?t(this.history):c["default"].Children.only(t)},n}(c["default"].Component);p.childContextTypes={history:l.history.isRequired},n["default"]=p},function(t,n,e){"use strict";function o(t){return t&&t.__esModule?t:{"default":t}}function r(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}function i(t,n){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!n||"object"!=typeof n&&"function"!=typeof n?t:n}function a(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function, not "+typeof n);t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),n&&(Object.setPrototypeOf?Object.setPrototypeOf(t,n):t.__proto__=n)}n.__esModule=!0;var u=e(1),c=o(u),s=e(17),f=o(s),l=e(2),p=function(t){function n(){return r(this,n),i(this,t.apply(this,arguments))}return a(n,t),n.prototype.getChildContext=function(){return{history:this.history}},n.prototype.componentWillMount=function(){var t=this,n=this.props,e=n.getUserConfirmation,o=n.initialEntries,r=n.initialIndex,i=n.keyLength;this.history=(0,f["default"])({getUserConfirmation:e,initialEntries:o,initialIndex:r,keyLength:i}),this.unlisten=this.history.listen(function(){return t.forceUpdate()})},n.prototype.componentWillUnmount=function(){this.unlisten()},n.prototype.render=function(){var t=this.props.children;return"function"==typeof t?t(this.history):c["default"].Children.only(t)},n}(c["default"].Component);p.childContextTypes={history:l.history.isRequired},n["default"]=p},function(t,n,e){"use strict";function o(t){return t&&t.__esModule?t:{"default":t}}function r(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}function i(t,n){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!n||"object"!=typeof n&&"function"!=typeof n?t:n}function a(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function, not "+typeof n);t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),n&&(Object.setPrototypeOf?Object.setPrototypeOf(t,n):t.__proto__=n)}n.__esModule=!0;var u=e(1),c=o(u),s=e(2),f=function(t){function n(){return r(this,n),i(this,t.apply(this,arguments))}return a(n,t),n.prototype.block=function(){this.teardownPrompt||(this.teardownPrompt=this.context.history.block(this.props.message))},n.prototype.unblock=function(){this.teardownPrompt&&(this.teardownPrompt(),this.teardownPrompt=null)},n.prototype.componentWillMount=function(){this.props.when&&this.block()},n.prototype.componentWillReceiveProps=function(t){t.when?this.block():this.unblock()},n.prototype.componentWillUnmount=function(){this.unblock()},n.prototype.render=function(){return null},n}(c["default"].Component);f.contextTypes={history:s.history.isRequired},f.defaultProps={when:!0},n["default"]=f},function(t,n,e){"use strict";function o(t){return t&&t.__esModule?t:{"default":t}}n.__esModule=!0;var r=("function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol?"symbol":typeof t},Object.assign||function(t){for(var n=1;n<arguments.length;n++){var e=arguments[n];for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])}return t}),i=e(3),a=(o(i),e(9)),u=o(a),c=e(4),s=e(5),f=e(6),l=o(f),p=e(8),h=e(7),d="popstate",y="hashchange",v=function(){try{return window.history.state||{}}catch(t){return{}}},m=function(){var t=arguments.length<=0||void 0===arguments[0]?{}:arguments[0];p.canUseDOM?void 0:(0,u["default"])(!1);var n=window.history,e=(0,h.supportsHistory)(),o=!(0,h.supportsPopStateOnHashChange)(),i=t.basename,a=void 0===i?"":i,f=t.forceRefresh,m=void 0!==f&&f,g=t.getUserConfirmation,w=void 0===g?h.getConfirmation:g,b=t.keyLength,P=void 0===b?6:b,O=function(t){var n=t||{},e=n.key,o=n.state,i=window.location,u=i.pathname,c=i.search,f=i.hash,l=u+c+f;return a&&(l=(0,s.stripPrefix)(l,a)),r({},(0,s.parsePath)(l),{state:o,key:e})},_=function(){return Math.random().toString(36).substr(2,P)},x=(0,l["default"])(),T=function(t){r(G,t),G.length=n.length,x.notifyListeners(G.location,G.action)},E=function(t){void 0!==t.state&&M(O(t.state))},L=function(){M(O(v()))},k=!1,M=function(t){k?(k=!1,T()):!function(){var n="POP";x.confirmTransitionTo(t,n,w,function(e){e?T({action:n,location:t}):C(t)})}()},C=function(t){var n=G.location,e=R.indexOf(n.key);e===-1&&(e=0);var o=R.indexOf(t.key);o===-1&&(o=0);var r=e-o;r&&(k=!0,U(r))},j=O(v()),R=[j.key],S=function(t,o){var r="PUSH",i=(0,c.createLocation)(t,o,_(),G.location);x.confirmTransitionTo(i,r,w,function(t){if(t){var o=a+(0,s.createPath)(i),u=i.key,c=i.state;if(e)if(n.pushState({key:u,state:c},null,o),m)window.location.href=o;else{var f=R.indexOf(G.location.key),l=R.slice(0,f===-1?0:f+1);l.push(i.key),R=l,T({action:r,location:i})}else window.location.href=o}})},A=function(t,o){var r="REPLACE",i=(0,c.createLocation)(t,o,_(),G.location);x.confirmTransitionTo(i,r,w,function(t){if(t){var o=a+(0,s.createPath)(i),u=i.key,c=i.state;if(e)if(n.replaceState({key:u,state:c},null,o),m)window.location.replace(o);else{var f=R.indexOf(G.location.key);f!==-1&&(R[f]=i.key),T({action:r,location:i})}else window.location.replace(o)}})},U=function(t){n.go(t)},q=function(){return U(-1)},H=function(){return U(1)},W=0,B=function(t){W+=t,1===W?((0,h.addEventListener)(window,d,E),o&&(0,h.addEventListener)(window,y,L)):0===W&&((0,h.removeEventListener)(window,d,E),o&&(0,h.removeEventListener)(window,y,L))},F=!1,I=function(){var t=!(arguments.length<=0||void 0===arguments[0])&&arguments[0],n=x.setPrompt(t);return F||(B(1),F=!0),function(){return F&&(F=!1,B(-1)),n()}},D=function(t){var n=x.appendListener(t);return B(1),function(){return B(-1),n()}},G={length:n.length,action:"POP",location:j,push:S,replace:A,go:U,goBack:q,goForward:H,block:I,listen:D};return G};n["default"]=m},function(t,n,e){"use strict";function o(t){return t&&t.__esModule?t:{"default":t}}n.__esModule=!0;var r=Object.assign||function(t){for(var n=1;n<arguments.length;n++){var e=arguments[n];for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])}return t},i=e(3),a=(o(i),e(9)),u=o(a),c=e(4),s=e(5),f=e(6),l=o(f),p=e(8),h=e(7),d="hashchange",y={hashbang:{encodePath:function(t){return"!"===t.charAt(0)?t:"!/"+(0,s.stripLeadingSlash)(t)},decodePath:function(t){return"!"===t.charAt(0)?t.substr(1):t}},noslash:{encodePath:s.stripLeadingSlash,decodePath:s.addLeadingSlash},slash:{encodePath:s.addLeadingSlash,decodePath:s.addLeadingSlash}},v=function(){var t=window.location.href,n=t.indexOf("#");return n===-1?"":t.substring(n+1)},m=function(t){return window.location.hash=t},g=function(t){var n=window.location.href.indexOf("#");window.location.replace(window.location.href.slice(0,n>=0?n:0)+"#"+t)},w=function(){var t=arguments.length<=0||void 0===arguments[0]?{}:arguments[0];p.canUseDOM?void 0:(0,u["default"])(!1);var n=window.history,e=((0,h.supportsGoWithoutReloadUsingHash)(),t.basename),o=void 0===e?"":e,i=t.getUserConfirmation,a=void 0===i?h.getConfirmation:i,f=t.hashType,w=void 0===f?"slash":f,b=y[w],P=b.encodePath,O=b.decodePath,_=function(){var t=O(v());return o&&(t=(0,s.stripPrefix)(t,o)),(0,s.parsePath)(t)},x=(0,l["default"])(),T=function(t){r(z,t),z.length=n.length,x.notifyListeners(z.location,z.action)},E=!1,L=null,k=function(){var t=v(),n=P(t);if(t!==n)g(n);else{var e=_(),o=z.location;if(!E&&(0,c.locationsAreEqual)(o,e))return;if(L===(0,s.createPath)(e))return;L=null,M(e)}},M=function(t){E?(E=!1,T()):!function(){var n="POP";x.confirmTransitionTo(t,n,a,function(e){e?T({action:n,location:t}):C(t)})}()},C=function(t){var n=z.location,e=A.lastIndexOf((0,s.createPath)(n));e===-1&&(e=0);var o=A.lastIndexOf((0,s.createPath)(t));o===-1&&(o=0);var r=e-o;r&&(E=!0,H(r))},j=v(),R=P(j);j!==R&&g(R);var S=_(),A=[(0,s.createPath)(S)],U=function(t,n){var e="PUSH",r=(0,c.createLocation)(t,void 0,void 0,z.location);x.confirmTransitionTo(r,e,a,function(t){if(t){var n=(0,s.createPath)(r),i=P(o+n),a=v()!==i;if(a){L=n,m(i);var u=A.lastIndexOf((0,s.createPath)(z.location)),c=A.slice(0,u===-1?0:u+1);c.push(n),A=c,T({action:e,location:r})}else T()}})},q=function(t,n){var e="REPLACE",r=(0,c.createLocation)(t,void 0,void 0,z.location);x.confirmTransitionTo(r,e,a,function(t){if(t){var n=(0,s.createPath)(r),i=P(o+n),a=v()!==i;a&&(L=n,g(i));var u=A.indexOf((0,s.createPath)(z.location));u!==-1&&(A[u]=n),T({action:e,location:r})}})},H=function(t){n.go(t)},W=function(){return H(-1)},B=function(){return H(1)},F=0,I=function(t){F+=t,1===F?(0,h.addEventListener)(window,d,k):0===F&&(0,h.removeEventListener)(window,d,k)},D=!1,G=function(){var t=!(arguments.length<=0||void 0===arguments[0])&&arguments[0],n=x.setPrompt(t);return D||(I(1),D=!0),function(){return D&&(D=!1,I(-1)),n()}},V=function(t){var n=x.appendListener(t);return I(1),function(){return I(-1),n()}},z={length:n.length,action:"POP",location:S,push:U,replace:q,go:H,goBack:W,goForward:B,block:G,listen:V};return z};n["default"]=w},function(t,n,e){"use strict";function o(t){return t&&t.__esModule?t:{"default":t}}n.__esModule=!0;var r=("function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol?"symbol":typeof t},Object.assign||function(t){for(var n=1;n<arguments.length;n++){var e=arguments[n];for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])}return t}),i=e(3),a=(o(i),e(4)),u=e(6),c=o(u),s=function(t,n,e){return Math.min(Math.max(t,n),e)},f=function(){var t=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],n=t.getUserConfirmation,e=t.initialEntries,o=void 0===e?["/"]:e,i=t.initialIndex,u=void 0===i?0:i,f=t.keyLength,l=void 0===f?6:f,p=(0,c["default"])(),h=function(t){r(T,t),T.length=T.entries.length,p.notifyListeners(T.location,T.action)},d=function(){return Math.random().toString(36).substr(2,l)},y=s(u,0,o.length-1),v=o.map(function(t,n){return"string"==typeof t?(0,a.createLocation)(t,void 0,n?d():void 0):(0,a.createLocation)(t,void 0,n?t.key||d():void 0)}),m=function(t,e){var o="PUSH",r=(0,a.createLocation)(t,e,d(),T.location);p.confirmTransitionTo(r,o,n,function(t){if(t){var n=T.index,e=n+1,i=T.entries.slice(0);i.length>e?i.splice(e,i.length-e,r):i.push(r),h({action:o,location:r,index:e,entries:i})}})},g=function(t,e){var o="REPLACE",r=(0,a.createLocation)(t,e,d(),T.location);p.confirmTransitionTo(r,o,n,function(t){t&&(T.entries[T.index]=r,h({action:o,location:r}))})},w=function(t){var e=s(T.index+t,0,T.entries.length-1),o="POP",r=T.entries[e];p.confirmTransitionTo(r,o,n,function(t){t?h({action:o,location:r,index:e}):h()})},b=function(){return w(-1)},P=function(){return w(1)},O=function(t){var n=T.index+t;return n>=0&&n<T.entries.length},_=function(){var t=!(arguments.length<=0||void 0===arguments[0])&&arguments[0];return p.setPrompt(t)},x=function(t){return p.appendListener(t)},T={length:v.length,action:"POP",location:v[y],index:y,entries:v,push:m,replace:g,go:w,goBack:b,goForward:P,canGo:O,block:_,listen:x};return T};n["default"]=f},function(t,n,e){!function(n,e){t.exports=e()}(this,function(){return function(t){function n(o){if(e[o])return e[o].exports;var r=e[o]={exports:{},id:o,loaded:!1};return t[o].call(r.exports,r,r.exports,n),r.loaded=!0,r.exports}var e={};return n.m=t,n.c=e,n.p="",n(0)}([function(t,n){"use strict";var e=function(t){return"/"===t.charAt(0)},o=function(t,n){for(var e=n,o=e+1,r=t.length;r>o;e+=1,o+=1)t[e]=t[o];t.pop()},r=function(t){var n=arguments.length<=1||void 0===arguments[1]?"":arguments[1],r=t&&t.split("/")||[],i=n&&n.split("/")||[],a=t&&e(t),u=n&&e(n),c=a||u;if(t&&e(t)?i=r:r.length&&(i.pop(),i=i.concat(r)),!i.length)return"/";var s=void 0;if(i.length){var f=i[i.length-1];s="."===f||".."===f||""===f}else s=!1;for(var l=0,p=i.length;p>=0;p--){var h=i[p];"."===h?o(i,p):".."===h?(o(i,p),l++):l&&(o(i,p),l--)}if(!c)for(;l--;l)i.unshift("..");!c||""===i[0]||i[0]&&e(i[0])||i.unshift("");var d=i.join("/");return s&&"/"!==d.substr(-1)&&(d+="/"),d};t.exports=r}])})}])});
SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc