Socket
Socket
Sign inDemoInstall

history

Package Overview
Dependencies
Maintainers
1
Versions
101
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

history - npm Package Compare versions

Comparing version 1.8.4 to 1.8.5

22

docs/ConfirmingNavigation.md

@@ -8,4 +8,4 @@ ## Confirming Navigation

if (input.value !== '')
return 'Are you sure you want to leave this page?';
});
return 'Are you sure you want to leave this page?'
})
```

@@ -19,4 +19,4 @@

history.registerTransitionHook(function (location, callback) {
doSomethingAsync().then(callback);
});
doSomethingAsync().then(callback)
})
```

@@ -29,7 +29,7 @@

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

@@ -42,11 +42,11 @@

```js
import { createHistory, useBeforeUnload } from 'history';
import { createHistory, useBeforeUnload } from 'history'
var history = useBeforeUnload(createHistory)();
let history = useBeforeUnload(createHistory)()
history.registerBeforeUnloadHook(function () {
return 'Are you sure you want to leave this page?';
});
return 'Are you sure you want to leave this page?'
})
```
Note that because of the nature of the `beforeunload` event all hooks must `return` synchronously. `history` runs all hooks in the order they were registered and displays the first message that is returned.

@@ -12,14 +12,14 @@ ## Getting Started

```js
import { createHistory } from 'history';
import { createHistory } from 'history'
var history = createHistory();
let history = createHistory()
// Listen for changes to the current location. The
// listener is called once immediately.
var unlisten = history.listen(function (location) {
console.log(location.pathname);
});
let unlisten = history.listen(function (location) {
console.log(location.pathname)
})
// When you're finished, stop the listener.
unlisten();
unlisten()
```

@@ -42,11 +42,11 @@

// Push a new entry onto the history stack.
history.pushState({ some: 'state' }, '/home');
history.pushState({ some: 'state' }, '/home')
// Replace the current entry on the history stack.
history.replaceState({ some: 'other state' }, '/profile');
history.replaceState({ some: 'other state' }, '/profile')
// Go back to the previous history entry. The following
// two lines are synonymous.
history.go(-1);
history.goBack();
history.go(-1)
history.goBack()
```

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

```js
var href = history.createHref('/the/path');
let href = history.createHref('/the/path')
```

@@ -71,9 +71,9 @@

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

@@ -8,15 +8,15 @@ ## Caveats of Using Hash History

```js
import createHistory from 'history/lib/createHashHistory';
import createHistory from 'history/lib/createHashHistory'
// Use _key instead of _k.
var history = createHistory({
let history = createHistory({
queryKey: '_key'
});
})
// Opt-out of persistent state, not recommended.
var history = createHistory({
let history = createHistory({
queryKey: false
});
})
```
One other thing to keep in mind when using hash history is that you cannot also use `window.location.hash` as it was originally intended, to link an anchor point within your HTML document.

@@ -20,5 +20,5 @@ ## Location

```js
import createLocation from 'history/lib/createLocation';
import createLocation from 'history/lib/createLocation'
var location = createLocation('/a/path?a=query', { the: 'state' });
let location = createLocation('/a/path?a=query', { the: 'state' })
```

@@ -6,20 +6,20 @@ ## Query Support

```js
import { createHistory, useQueries } from 'history';
import { createHistory, useQueries } from 'history'
// Use the built-in query parsing/serialization.
var history = useQueries(createHistory)();
let history = useQueries(createHistory)()
// Use custom query parsing/serialization.
var history = useQueries(createHistory)({
let history = useQueries(createHistory)({
parseQueryString: function (queryString) {
return qs.parse(queryString);
return qs.parse(queryString)
},
stringifyQuery: function (query) {
return qs.stringify(query, { arrayFormat: 'brackets' });
return qs.stringify(query, { arrayFormat: 'brackets' })
}
});
})
history.listen(function (location) {
console.log(location.query);
});
console.log(location.query)
})
```

@@ -30,4 +30,4 @@

```js
history.createPath('/the/path', { the: 'query' });
history.pushState(null, '/the/path', { the: 'query' });
history.createPath('/the/path', { the: 'query' })
history.pushState(null, '/the/path', { the: 'query' })
```

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

## Terms
## Glossary

@@ -3,0 +3,0 @@ This is a glossary of common terms used in the history codebase and documentation listed in alphabetical order, along with their [type signatures](http://flowtype.org/docs/quick-reference.html).

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

var state;
var state = undefined;
if (key) {

@@ -57,3 +57,3 @@ state = _DOMStateStorage.readState(key);

key = history.createKey();
window.history.replaceState(_extends({}, historyState, { key: key }), path);
window.history.replaceState(_extends({}, historyState, { key: key }), null, path);
}

@@ -119,3 +119,3 @@

var listenerCount = 0,
stopPopStateListener;
stopPopStateListener = undefined;

@@ -122,0 +122,0 @@ function listen(listener) {

@@ -74,3 +74,4 @@ 'use strict';

var key, state;
var key = undefined,
state = undefined;
if (queryKey) {

@@ -99,3 +100,3 @@ key = getQueryStringValueFromPath(path, queryKey);

transitionTo(getCurrentLocation());
};
}

@@ -149,3 +150,3 @@ ensureSlash();

var listenerCount = 0,
stopHashChangeListener;
stopHashChangeListener = undefined;

@@ -165,3 +166,3 @@ function listen(listener) {

function pushState(state, path) {
_warning2['default'](queryKey || state == null, 'You cannot use state without a queryKey; it will be dropped');
_warning2['default'](queryKey || state == null, 'You cannot use state without a queryKey it will be dropped');

@@ -172,3 +173,3 @@ history.pushState(state, path);

function replaceState(state, path) {
_warning2['default'](queryKey || state == null, 'You cannot use state without a queryKey; it will be dropped');
_warning2['default'](queryKey || state == null, 'You cannot use state without a queryKey it will be dropped');

@@ -175,0 +176,0 @@ history.replaceState(state, path);

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

var changeListeners = [];
var location;
var location = undefined;

@@ -101,5 +101,5 @@ var allKeys = [];

} else {
var location = getCurrentLocation();
allKeys = [location.key];
updateLocation(location);
var _location = getCurrentLocation();
allKeys = [_location.key];
updateLocation(_location);
}

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

} else {
_warning2['default'](result === undefined, 'You should not "return" in a transition hook with a callback argument; call the callback instead');
_warning2['default'](result === undefined, 'You should not "return" in a transition hook with a callback argument call the callback instead');
}

@@ -155,3 +155,3 @@ }

var pendingLocation;
var pendingLocation = undefined;

@@ -158,0 +158,0 @@ function transitionTo(nextLocation) {

@@ -33,3 +33,4 @@ 'use strict';

var pathname, search;
var pathname = undefined,
search = undefined;
if (index !== -1) {

@@ -36,0 +37,0 @@ pathname = path.substring(0, index);

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

var state;
var state = undefined;
if (key) {

@@ -112,3 +112,3 @@ state = readState(key);

if (n) {
_invariant2['default'](canGo(n), 'Cannot go(%s); there is not enough history', n);
_invariant2['default'](canGo(n), 'Cannot go(%s) there is not enough history', n);

@@ -115,0 +115,0 @@ current += n;

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

var state;
var state = undefined;
if (key) {

@@ -179,3 +179,3 @@ state = _DOMStateStorage.readState(key);

key = history.createKey();
window.history.replaceState(_extends({}, historyState, { key: key }), path);
window.history.replaceState(_extends({}, historyState, { key: key }), null, path);
}

@@ -241,3 +241,3 @@

var listenerCount = 0,
stopPopStateListener;
stopPopStateListener = undefined;

@@ -584,3 +584,3 @@ function listen(listener) {

var changeListeners = [];
var location;
var location = undefined;

@@ -631,5 +631,5 @@ var allKeys = [];

} else {
var location = getCurrentLocation();
allKeys = [location.key];
updateLocation(location);
var _location = getCurrentLocation();
allKeys = [_location.key];
updateLocation(_location);
}

@@ -660,3 +660,3 @@

} else {
_warning2['default'](result === undefined, 'You should not "return" in a transition hook with a callback argument; call the callback instead');
_warning2['default'](result === undefined, 'You should not "return" in a transition hook with a callback argument call the callback instead');
}

@@ -685,3 +685,3 @@ }

var pendingLocation;
var pendingLocation = undefined;

@@ -1046,3 +1046,4 @@ function transitionTo(nextLocation) {

var pathname, search;
var pathname = undefined,
search = undefined;
if (index !== -1) {

@@ -1147,3 +1148,4 @@ pathname = path.substring(0, index);

var key, state;
var key = undefined,
state = undefined;
if (queryKey) {

@@ -1172,3 +1174,3 @@ key = getQueryStringValueFromPath(path, queryKey);

transitionTo(getCurrentLocation());
};
}

@@ -1222,3 +1224,3 @@ ensureSlash();

var listenerCount = 0,
stopHashChangeListener;
stopHashChangeListener = undefined;

@@ -1238,3 +1240,3 @@ function listen(listener) {

function pushState(state, path) {
_warning2['default'](queryKey || state == null, 'You cannot use state without a queryKey; it will be dropped');
_warning2['default'](queryKey || state == null, 'You cannot use state without a queryKey it will be dropped');

@@ -1245,3 +1247,3 @@ history.pushState(state, path);

function replaceState(state, path) {
_warning2['default'](queryKey || state == null, 'You cannot use state without a queryKey; it will be dropped');
_warning2['default'](queryKey || state == null, 'You cannot use state without a queryKey it will be dropped');

@@ -1370,3 +1372,3 @@ history.replaceState(state, path);

var state;
var state = undefined;
if (key) {

@@ -1390,3 +1392,3 @@ state = readState(key);

if (n) {
_invariant2['default'](canGo(n), 'Cannot go(%s); there is not enough history', n);
_invariant2['default'](canGo(n), 'Cannot go(%s) there is not enough history', n);

@@ -1460,2 +1462,7 @@ current += n;

/**
* Returns a new createHistory function that can be used to create
* history objects that know how to use the beforeunload event in web
* browsers to cancel navigation.
*/
function useBeforeUnload(createHistory) {

@@ -1465,11 +1472,11 @@ return function (options) {

var stopBeforeUnloadListener;
var stopBeforeUnloadListener = undefined;
var beforeUnloadHooks = [];
function getBeforeUnloadPromptMessage() {
var message;
var message = undefined;
for (var i = 0, len = beforeUnloadHooks.length; message == null && i < len; ++i) message = beforeUnloadHooks[i].call();
return message;
for (var i = 0, len = beforeUnloadHooks.length; message == null && i < len; ++i) {
message = beforeUnloadHooks[i].call();
}return message;
}

@@ -1531,2 +1538,6 @@

/**
* Returns a new createHistory function that may be used to create
* history objects that know how to handle URL queries.
*/
function useQueries(createHistory) {

@@ -1563,3 +1574,3 @@ return function () {

function createPath(pathname, query) {
var queryString;
var queryString = undefined;
if (query == null || (queryString = stringifyQuery(query)) === '') return pathname;

@@ -1566,0 +1577,0 @@

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

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

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

/**
* Returns a new createHistory function that can be used to create
* history objects that know how to use the beforeunload event in web
* browsers to cancel navigation.
*/
function useBeforeUnload(createHistory) {

@@ -33,11 +38,11 @@ return function (options) {

var stopBeforeUnloadListener;
var stopBeforeUnloadListener = undefined;
var beforeUnloadHooks = [];
function getBeforeUnloadPromptMessage() {
var message;
var message = undefined;
for (var i = 0, len = beforeUnloadHooks.length; message == null && i < len; ++i) message = beforeUnloadHooks[i].call();
return message;
for (var i = 0, len = beforeUnloadHooks.length; message == null && i < len; ++i) {
message = beforeUnloadHooks[i].call();
}return message;
}

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

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

/**
* Returns a new createHistory function that may be used to create
* history objects that know how to handle URL queries.
*/
function useQueries(createHistory) {

@@ -55,3 +59,3 @@ return function () {

function createPath(pathname, query) {
var queryString;
var queryString = undefined;
if (query == null || (queryString = stringifyQuery(query)) === '') return pathname;

@@ -58,0 +62,0 @@

{
"name": "history",
"version": "1.8.4",
"version": "1.8.5",
"description": "A minimal, functional history implementation for JavaScript",

@@ -5,0 +5,0 @@ "main": "lib/index",

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

```js
import { createHistory } from 'history';
import { createHistory } from 'history'
var history = createHistory();
let history = createHistory()
// Listen for changes to the current location. The
// listener is called once immediately.
var unlisten = history.listen(function (location) {
console.log(location.pathname);
});
let unlisten = history.listen(function (location) {
console.log(location.pathname)
})
history.pushState({ the: 'state' }, '/the/path?a=query');
history.pushState({ the: 'state' }, '/the/path?a=query')
// When you're finished, stop the listener.
unlisten();
unlisten()
```

@@ -34,0 +34,0 @@

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