Socket
Socket
Sign inDemoInstall

history

Package Overview
Dependencies
2
Maintainers
1
Versions
101
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 5.0.0 to 5.0.1

12

browser.js

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

function m(){m=Object.assign||function(a){for(var c=1;c<arguments.length;c++){var g=arguments[c],h;for(h in g)Object.prototype.hasOwnProperty.call(g,h)&&(a[h]=g[h])}return a};return m.apply(this,arguments)}var r,v=r||(r={});v.Pop="POP";v.Push="PUSH";v.Replace="REPLACE";var y="production"!==process.env.NODE_ENV?function(a){return Object.freeze(a)}:function(a){return a};function z(a,c){if(!a){"undefined"!==typeof console&&console.warn(c);try{throw Error(c);}catch(g){}}}
function A(a){a.preventDefault();a.returnValue=""}function E(){var a=[];return{get length(){return a.length},push:function(c){a.push(c);return function(){a=a.filter(function(a){return a!==c})}},call:function(c){a.forEach(function(a){return a&&a(c)})}}}
var F=function(a){function c(){var b=n.location,a=p.state||{};return[a.idx,y({pathname:b.pathname,search:b.search,hash:b.hash,state:a.usr||null,key:a.key||"default"})]}function g(b){if("string"===typeof b)var a=b;else{a=b.pathname;var c=b.search;b=b.hash;a=(void 0===a?"/":a)+(void 0===c?"":c)+(void 0===b?"":b)}return a}function h(b,a){void 0===a&&(a=null);var c=m,f=t;if("string"===typeof b){var d={};if(b){var e=b.indexOf("#");0<=e&&(d.hash=b.substr(e),b=b.substr(0,e));e=b.indexOf("?");0<=e&&(d.search=
b.substr(e),b=b.substr(0,e));b&&(d.pathname=b)}b=d}return y(c({},f,{},b,{state:a,key:Math.random().toString(36).substr(2,8)}))}function w(b){x=b;b=c();l=b[0];t=b[1];B.call({action:x,location:t})}function C(b,a){function c(){C(b,a)}var f=r.Push,d=h(b,a);if(!k.length||(k.call({action:f,location:d,retry:c}),!1)){var e=[{usr:d.state,key:d.key,idx:l+1},g(d)];d=e[0];e=e[1];try{p.pushState(d,"",e)}catch(G){n.location.assign(e)}w(f)}}function D(a,c){function b(){D(a,c)}var f=r.Replace,d=h(a,c);k.length&&
(k.call({action:f,location:d,retry:b}),1)||(d=[{usr:d.state,key:d.key,idx:l},g(d)],p.replaceState(d[0],"",d[1]),w(f))}function q(a){p.go(a)}void 0===a&&(a={});a=a.window;var n=void 0===a?document.defaultView:a,p=n.history,u=null;n.addEventListener("popstate",function(){if(u)k.call(u),u=null;else{var a=r.Pop,f=c(),g=f[0];f=f[1];if(k.length)if(null!=g){var h=l-g;h&&(u={action:a,location:f,retry:function(){q(-1*h)}},q(h))}else"production"!==process.env.NODE_ENV?z(!1,"You are trying to block a POP navigation to a location that was not created by the history library. The block will fail silently in production, but in general you should do all navigation with the history library (instead of using window.history.pushState directly) to avoid this situation."):
void 0;else w(a)}});var x=r.Pop;a=c();var l=a[0],t=a[1],B=E(),k=E();null==l&&(l=0,p.replaceState(m({},p.state,{idx:l}),""));return{get action(){return x},get location(){return t},createHref:g,push:C,replace:D,go:q,back:function(){q(-1)},forward:function(){q(1)},listen:function(a){return B.push(a)},block:function(a){var b=k.push(a);1===k.length&&n.addEventListener("beforeunload",A);return function(){b();k.length||n.removeEventListener("beforeunload",A)}}}}();export default F;
function p(){p=Object.assign||function(b){for(var e=1;e<arguments.length;e++){var f=arguments[e],m;for(m in f)Object.prototype.hasOwnProperty.call(f,m)&&(b[m]=f[m])}return b};return p.apply(this,arguments)}var u,x=u||(u={});x.Pop="POP";x.Push="PUSH";x.Replace="REPLACE";var A="production"!==process.env.NODE_ENV?function(b){return Object.freeze(b)}:function(b){return b};function B(b,e){if(!b){"undefined"!==typeof console&&console.warn(e);try{throw Error(e);}catch(f){}}}
function C(b){b.preventDefault();b.returnValue=""}function G(){var b=[];return{get length(){return b.length},push:function(e){b.push(e);return function(){b=b.filter(function(f){return f!==e})}},call:function(e){b.forEach(function(f){return f&&f(e)})}}}
var H=function(b){function e(){var a=q.location,c=r.state||{};return[c.idx,A({pathname:a.pathname,search:a.search,hash:a.hash,state:c.usr||null,key:c.key||"default"})]}function f(a){if("string"===typeof a)var c=a;else{c=a.pathname;var h=a.search;a=a.hash;c=(void 0===c?"/":c)+(void 0===h?"":h)+(void 0===a?"":a)}return c}function m(a,c){void 0===c&&(c=null);var h=p,k=v;if("string"===typeof a){var d={};if(a){var g=a.indexOf("#");0<=g&&(d.hash=a.substr(g),a=a.substr(0,g));g=a.indexOf("?");0<=g&&(d.search=
a.substr(g),a=a.substr(0,g));a&&(d.pathname=a)}a=d}return A(h({},k,a,{state:c,key:Math.random().toString(36).substr(2,8)}))}function y(a){z=a;a=e();n=a[0];v=a[1];D.call({action:z,location:v})}function E(a,c){function h(){E(a,c)}var k=u.Push,d=m(a,c);if(!l.length||(l.call({action:k,location:d,retry:h}),!1)){var g=[{usr:d.state,key:d.key,idx:n+1},f(d)];d=g[0];g=g[1];try{r.pushState(d,"",g)}catch(I){q.location.assign(g)}y(k)}}function F(a,c){function h(){F(a,c)}var k=u.Replace,d=m(a,c);l.length&&(l.call({action:k,
location:d,retry:h}),1)||(d=[{usr:d.state,key:d.key,idx:n},f(d)],r.replaceState(d[0],"",d[1]),y(k))}function t(a){r.go(a)}void 0===b&&(b={});b=b.window;var q=void 0===b?document.defaultView:b,r=q.history,w=null;q.addEventListener("popstate",function(){if(w)l.call(w),w=null;else{var a=u.Pop,c=e(),h=c[0];c=c[1];if(l.length)if(null!=h){var k=n-h;k&&(w={action:a,location:c,retry:function(){t(-1*k)}},t(k))}else"production"!==process.env.NODE_ENV?B(!1,"You are trying to block a POP navigation to a location that was not created by the history library. The block will fail silently in production, but in general you should do all navigation with the history library (instead of using window.history.pushState directly) to avoid this situation."):
void 0;else y(a)}});var z=u.Pop;b=e();var n=b[0],v=b[1],D=G(),l=G();null==n&&(n=0,r.replaceState(p({},r.state,{idx:n}),""));return{get action(){return z},get location(){return v},createHref:f,push:E,replace:F,go:t,back:function(){t(-1)},forward:function(){t(1)},listen:function(a){return D.push(a)},block:function(a){var c=l.push(a);1===l.length&&q.addEventListener("beforeunload",C);return function(){c();l.length||q.removeEventListener("beforeunload",C)}}}}();export default H
//# sourceMappingURL=browser.js.map

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

function m(){m=Object.assign||function(a){for(var b=1;b<arguments.length;b++){var c=arguments[b],g;for(g in c)Object.prototype.hasOwnProperty.call(c,g)&&(a[g]=c[g])}return a};return m.apply(this,arguments)}var r,u=r||(r={});u.Pop="POP";u.Push="PUSH";u.Replace="REPLACE";var v="production"!==process.env.NODE_ENV?function(a){return Object.freeze(a)}:function(a){return a};function w(a,b){if(!a){"undefined"!==typeof console&&console.warn(b);try{throw Error(b);}catch(c){}}}
function A(a){a.preventDefault();a.returnValue=""}function B(){var a=[];return{get length(){return a.length},push:function(b){a.push(b);return function(){a=a.filter(function(a){return a!==b})}},call:function(b){a.forEach(function(a){return a&&a(b)})}}}function C(a){var b=a.pathname,c=a.search;a=a.hash;return(void 0===b?"/":b)+(void 0===c?"":c)+(void 0===a?"":a)}
function D(a){var b={};if(a){var c=a.indexOf("#");0<=c&&(b.hash=a.substr(c),a=a.substr(0,c));c=a.indexOf("?");0<=c&&(b.search=a.substr(c),a=a.substr(0,c));a&&(b.pathname=a)}return b}
var I=function(a){function b(){var a=D(h.location.hash.substr(1)),e=a.pathname,b=a.search;a=a.hash;var c=n.state||{};return[c.idx,v({pathname:void 0===e?"/":e,search:void 0===b?"":b,hash:void 0===a?"":a,state:c.usr||null,key:c.key||"default"})]}function c(){if(t)f.call(t),t=null;else{var a=r.Pop,e=b(),c=e[0];e=e[1];if(f.length)if(null!=c){var x=l-c;x&&(t={action:a,location:e,retry:function(){p(-1*x)}},p(x))}else"production"!==process.env.NODE_ENV?w(!1,"You are trying to block a POP navigation to a location that was not created by the history library. The block will fail silently in production, but in general you should do all navigation with the history library (instead of using window.history.pushState directly) to avoid this situation."):
void 0;else y(a)}}function g(a){var b=document.querySelector("base"),c="";b&&b.getAttribute("href")&&(b=h.location.href,c=b.indexOf("#"),c=-1===c?b:b.slice(0,c));return c+"#"+("string"===typeof a?a:C(a))}function E(a,b){void 0===b&&(b=null);return v(m({},q,{},"string"===typeof a?D(a):a,{state:b,key:Math.random().toString(36).substr(2,8)}))}function y(a){z=a;a=b();l=a[0];q=a[1];F.call({action:z,location:q})}function G(a,b){function c(){G(a,b)}var e=r.Push,d=E(a,b);"production"!==process.env.NODE_ENV?
w("/"===d.pathname.charAt(0),"Relative pathnames are not supported in hash history.push("+JSON.stringify(a)+")"):void 0;if(!f.length||(f.call({action:e,location:d,retry:c}),!1)){var k=[{usr:d.state,key:d.key,idx:l+1},g(d)];d=k[0];k=k[1];try{n.pushState(d,"",k)}catch(J){h.location.assign(k)}y(e)}}function H(a,b){function c(){H(a,b)}var k=r.Replace,d=E(a,b);"production"!==process.env.NODE_ENV?w("/"===d.pathname.charAt(0),"Relative pathnames are not supported in hash history.replace("+JSON.stringify(a)+
")"):void 0;f.length&&(f.call({action:k,location:d,retry:c}),1)||(d=[{usr:d.state,key:d.key,idx:l},g(d)],n.replaceState(d[0],"",d[1]),y(k))}function p(a){n.go(a)}void 0===a&&(a={});a=a.window;var h=void 0===a?document.defaultView:a,n=h.history,t=null;h.addEventListener("popstate",c);h.addEventListener("hashchange",function(){var a=b()[1];C(a)!==C(q)&&c()});var z=r.Pop;a=b();var l=a[0],q=a[1],F=B(),f=B();null==l&&(l=0,n.replaceState(m({},n.state,{idx:l}),""));return{get action(){return z},get location(){return q},
createHref:g,push:G,replace:H,go:p,back:function(){p(-1)},forward:function(){p(1)},listen:function(a){return F.push(a)},block:function(a){var b=f.push(a);1===f.length&&h.addEventListener("beforeunload",A);return function(){b();f.length||h.removeEventListener("beforeunload",A)}}}}();export default I;
function p(){p=Object.assign||function(a){for(var d=1;d<arguments.length;d++){var e=arguments[d],l;for(l in e)Object.prototype.hasOwnProperty.call(e,l)&&(a[l]=e[l])}return a};return p.apply(this,arguments)}var v,x=v||(v={});x.Pop="POP";x.Push="PUSH";x.Replace="REPLACE";var y="production"!==process.env.NODE_ENV?function(a){return Object.freeze(a)}:function(a){return a};function z(a,d){if(!a){"undefined"!==typeof console&&console.warn(d);try{throw Error(d);}catch(e){}}}
function C(a){a.preventDefault();a.returnValue=""}function D(){var a=[];return{get length(){return a.length},push:function(d){a.push(d);return function(){a=a.filter(function(e){return e!==d})}},call:function(d){a.forEach(function(e){return e&&e(d)})}}}function E(a){var d=a.pathname,e=a.search;a=a.hash;return(void 0===d?"/":d)+(void 0===e?"":e)+(void 0===a?"":a)}
function F(a){var d={};if(a){var e=a.indexOf("#");0<=e&&(d.hash=a.substr(e),a=a.substr(0,e));e=a.indexOf("?");0<=e&&(d.search=a.substr(e),a=a.substr(0,e));a&&(d.pathname=a)}return d}
var K=function(a){function d(){var b=F(m.location.hash.substr(1)),c=b.pathname,g=b.search;b=b.hash;var h=q.state||{};return[h.idx,y({pathname:void 0===c?"/":c,search:void 0===g?"":g,hash:void 0===b?"":b,state:h.usr||null,key:h.key||"default"})]}function e(){if(w)k.call(w),w=null;else{var b=v.Pop,c=d(),g=c[0];c=c[1];if(k.length)if(null!=g){var h=n-g;h&&(w={action:b,location:c,retry:function(){r(-1*h)}},r(h))}else"production"!==process.env.NODE_ENV?z(!1,"You are trying to block a POP navigation to a location that was not created by the history library. The block will fail silently in production, but in general you should do all navigation with the history library (instead of using window.history.pushState directly) to avoid this situation."):
void 0;else A(b)}}function l(b){var c=document.querySelector("base"),g="";c&&c.getAttribute("href")&&(c=m.location.href,g=c.indexOf("#"),g=-1===g?c:c.slice(0,g));return g+"#"+("string"===typeof b?b:E(b))}function G(b,c){void 0===c&&(c=null);return y(p({},t,"string"===typeof b?F(b):b,{state:c,key:Math.random().toString(36).substr(2,8)}))}function A(b){B=b;b=d();n=b[0];t=b[1];H.call({action:B,location:t})}function I(b,c){function g(){I(b,c)}var h=v.Push,f=G(b,c);"production"!==process.env.NODE_ENV?
z("/"===f.pathname.charAt(0),"Relative pathnames are not supported in hash history.push("+JSON.stringify(b)+")"):void 0;if(!k.length||(k.call({action:h,location:f,retry:g}),!1)){var u=[{usr:f.state,key:f.key,idx:n+1},l(f)];f=u[0];u=u[1];try{q.pushState(f,"",u)}catch(L){m.location.assign(u)}A(h)}}function J(b,c){function g(){J(b,c)}var h=v.Replace,f=G(b,c);"production"!==process.env.NODE_ENV?z("/"===f.pathname.charAt(0),"Relative pathnames are not supported in hash history.replace("+JSON.stringify(b)+
")"):void 0;k.length&&(k.call({action:h,location:f,retry:g}),1)||(f=[{usr:f.state,key:f.key,idx:n},l(f)],q.replaceState(f[0],"",f[1]),A(h))}function r(b){q.go(b)}void 0===a&&(a={});a=a.window;var m=void 0===a?document.defaultView:a,q=m.history,w=null;m.addEventListener("popstate",e);m.addEventListener("hashchange",function(){var b=d()[1];E(b)!==E(t)&&e()});var B=v.Pop;a=d();var n=a[0],t=a[1],H=D(),k=D();null==n&&(n=0,q.replaceState(p({},q.state,{idx:n}),""));return{get action(){return B},get location(){return t},
createHref:l,push:I,replace:J,go:r,back:function(){r(-1)},forward:function(){r(1)},listen:function(b){return H.push(b)},block:function(b){var c=k.push(b);1===k.length&&m.addEventListener("beforeunload",C);return function(){c();k.length||m.removeEventListener("beforeunload",C)}}}}();export default K
//# sourceMappingURL=hash.js.map

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

var m,x=m||(m={});x.Pop="POP";x.Push="PUSH";x.Replace="REPLACE";function y(c,d){if(!c){"undefined"!==typeof console&&console.warn(d);try{throw Error(d);}catch(f){}}}function z(c){c.preventDefault();c.returnValue=""}function A(){let c=[];return{get length(){return c.length},push(d){c.push(d);return function(){c=c.filter(c=>c!==d)}},call(d){c.forEach(c=>c&&c(d))}}}function B(){return Math.random().toString(36).substr(2,8)}
function C({pathname:c="/",search:d="",hash:f=""}){return c+d+f}function D(c){let d={};if(c){var f=c.indexOf("#");0<=f&&(d.hash=c.substr(f),c=c.substr(0,f));f=c.indexOf("?");0<=f&&(d.search=c.substr(f),c=c.substr(0,f));c&&(d.pathname=c)}return d}
function createBrowserHistory(c={}){function d(){let {pathname:a,search:e,hash:b}=k.location,c=g.state||{};return[c.idx,Object.freeze({pathname:a,search:e,hash:b,state:c.usr||null,key:c.key||"default"})]}function f(a){return"string"===typeof a?a:C(a)}function r(a,e=null){return Object.freeze(Object.assign(Object.assign(Object.assign({},n),"string"===typeof a?D(a):a),{state:e,key:B()}))}function v(a){p=a;[l,n]=d();q.call({action:p,location:n})}function w(a,e){function E(){w(a,e)}let c=m.Push,
d=r(a,e);if(!b.length||(b.call({action:c,location:d,retry:E}),!1)){let [e,a]=[{usr:d.state,key:d.key,idx:l+1},f(d)];try{g.pushState(e,"",a)}catch(F){k.location.assign(a)}v(c)}}function t(a,e){function c(){t(a,e)}let d=m.Replace,h=r(a,e);if(!b.length||(b.call({action:d,location:h,retry:c}),!1)){let [e,a]=[{usr:h.state,key:h.key,idx:l},f(h)];g.replaceState(e,"",a);v(d)}}function u(a){g.go(a)}let {window:k=document.defaultView}=c,g=k.history,h=null;k.addEventListener("popstate",function(){if(h)b.call(h),
h=null;else{let a=m.Pop,[e,c]=d();if(b.length)if(null!=e){let b=l-e;b&&(h={action:a,location:c,retry(){u(-1*b)}},u(b))}else y(!1,"You are trying to block a POP navigation to a location that was not created by the history library. The block will fail silently in production, but in general you should do all navigation with the history library (instead of using window.history.pushState directly) to avoid this situation.");else v(a)}});let p=m.Pop,[l,n]=d(),q=A(),b=A();null==l&&(l=0,g.replaceState(Object.assign(Object.assign({},
g.state),{idx:l}),""));return{get action(){return p},get location(){return n},createHref:f,push:w,replace:t,go:u,back(){u(-1)},forward(){u(1)},listen(a){return q.push(a)},block(a){let e=b.push(a);1===b.length&&k.addEventListener("beforeunload",z);return function(){e();b.length||k.removeEventListener("beforeunload",z)}}}};
function createHashHistory(c={}){function d(){let {pathname:e="/",search:a="",hash:b=""}=D(g.location.hash.substr(1)),c=h.state||{};return[c.idx,Object.freeze({pathname:e,search:a,hash:b,state:c.usr||null,key:c.key||"default"})]}function f(){if(p)a.call(p),p=null;else{let e=m.Pop,[b,c]=d();if(a.length)if(null!=b){let a=n-b;a&&(p={action:e,location:c,retry(){k(-1*a)}},k(a))}else y(!1,"You are trying to block a POP navigation to a location that was not created by the history library. The block will fail silently in production, but in general you should do all navigation with the history library (instead of using window.history.pushState directly) to avoid this situation.");
else w(e)}}function r(a){var e=document.querySelector("base");var b="";e&&e.getAttribute("href")&&(e=g.location.href,b=e.indexOf("#"),b=-1===b?e:e.slice(0,b));e=b;return e+"#"+("string"===typeof a?a:C(a))}function v(a,b=null){return Object.freeze(Object.assign(Object.assign(Object.assign({},q),"string"===typeof a?D(a):a),{state:b,key:B()}))}function w(a){l=a;[n,q]=d();b.call({action:l,location:q})}function t(b,c){function e(){t(b,c)}let d=m.Push,f=v(b,c);y("/"===f.pathname.charAt(0),`Relative pathnames are not supported in hash history.push(${JSON.stringify(b)})`);
if(!a.length||(a.call({action:d,location:f,retry:e}),!1)){let [a,b]=[{usr:f.state,key:f.key,idx:n+1},r(f)];try{h.pushState(a,"",b)}catch(G){g.location.assign(b)}w(d)}}function u(b,c){function e(){u(b,c)}let d=m.Replace,f=v(b,c);y("/"===f.pathname.charAt(0),`Relative pathnames are not supported in hash history.replace(${JSON.stringify(b)})`);if(!a.length||(a.call({action:d,location:f,retry:e}),!1)){let [a,b]=[{usr:f.state,key:f.key,idx:n},r(f)];h.replaceState(a,"",b);w(d)}}function k(a){h.go(a)}let {window:g=
document.defaultView}=c,h=g.history,p=null;g.addEventListener("popstate",f);g.addEventListener("hashchange",()=>{let [,a]=d();C(a)!==C(q)&&f()});let l=m.Pop,[n,q]=d(),b=A(),a=A();null==n&&(n=0,h.replaceState(Object.assign(Object.assign({},h.state),{idx:n}),""));return{get action(){return l},get location(){return q},createHref:r,push:t,replace:u,go:k,back(){k(-1)},forward(){k(1)},listen(a){return b.push(a)},block(b){let c=a.push(b);1===a.length&&g.addEventListener("beforeunload",z);return function(){c();
a.length||g.removeEventListener("beforeunload",z)}}}};
function createMemoryHistory(c={}){function d(b,a=null){return Object.freeze(Object.assign(Object.assign(Object.assign({},l),"string"===typeof b?D(b):b),{state:a,key:B()}))}function f(b,a,c){return!q.length||(q.call({action:b,location:a,retry:c}),!1)}function r(b,a){p=b;l=a;n.call({action:p,location:l})}function v(b,a){let c=m.Push,k=d(b,a);y("/"===l.pathname.charAt(0),`Relative pathnames are not supported in memory history.push(${JSON.stringify(b)})`);f(c,k,function(){v(b,a)})&&(h+=1,g.splice(h,
g.length,k),r(c,k))}function w(b,a){let c=m.Replace,k=d(b,a);y("/"===l.pathname.charAt(0),`Relative pathnames are not supported in memory history.replace(${JSON.stringify(b)})`);f(c,k,function(){w(b,a)})&&(g[h]=k,r(c,k))}function t(b){let a=Math.min(Math.max(h+b,0),g.length-1),c=m.Pop,d=g[a];f(c,d,function(){t(b)})&&(h=a,r(c,d))}let {initialEntries:u=["/"],initialIndex:k}=c,g=u.map(b=>{let a=Object.freeze(Object.assign({pathname:"/",search:"",hash:"",state:null,key:B()},"string"===typeof b?D(b):b));
y("/"===a.pathname.charAt(0),`Relative pathnames are not supported in createMemoryHistory({ initialEntries }) (invalid entry: ${JSON.stringify(b)})`);return a}),h=Math.min(Math.max(null==k?g.length-1:k,0),g.length-1),p=m.Pop,l=g[h],n=A(),q=A();return{get index(){return h},get action(){return p},get location(){return l},createHref:function(b){return"string"===typeof b?b:C(b)},push:v,replace:w,go:t,back(){t(-1)},forward(){t(1)},listen(b){return n.push(b)},block(b){return q.push(b)}}};
export{m as Action,createBrowserHistory,createHashHistory,createMemoryHistory,C as createPath,D as parsePath}
var p,C=p||(p={});C.Pop="POP";C.Push="PUSH";C.Replace="REPLACE";function D(e,g){if(!e){"undefined"!==typeof console&&console.warn(g);try{throw Error(g);}catch(h){}}}function E(e){e.preventDefault();e.returnValue=""}function F(){let e=[];return{get length(){return e.length},push(g){e.push(g);return function(){e=e.filter(h=>h!==g)}},call(g){e.forEach(h=>h&&h(g))}}}function H(){return Math.random().toString(36).substr(2,8)}
function I({pathname:e="/",search:g="",hash:h=""}){return e+g+h}function J(e){let g={};if(e){var h=e.indexOf("#");0<=h&&(g.hash=e.substr(h),e=e.substr(0,h));h=e.indexOf("?");0<=h&&(g.search=e.substr(h),e=e.substr(0,h));e&&(g.pathname=e)}return g}
function createBrowserHistory(e={}){function g(){let {pathname:b,search:a,hash:d}=q.location,f=k.state||{};return[f.idx,Object.freeze({pathname:b,search:a,hash:d,state:f.usr||null,key:f.key||"default"})]}function h(b){return"string"===typeof b?b:I(b)}function w(b,a=null){return Object.freeze(Object.assign(Object.assign(Object.assign({},r),"string"===typeof b?J(b):b),{state:a,key:H()}))}function z(b){u=b;[n,r]=g();v.call({action:u,location:r})}function A(b,a){function d(){A(b,a)}let f=p.Push,
l=w(b,a);if(!c.length||(c.call({action:f,location:l,retry:d}),!1)){let [t,B]=[{usr:l.state,key:l.key,idx:n+1},h(l)];try{k.pushState(t,"",B)}catch(G){q.location.assign(B)}z(f)}}function x(b,a){function d(){x(b,a)}let f=p.Replace,l=w(b,a);if(!c.length||(c.call({action:f,location:l,retry:d}),!1)){let [t,B]=[{usr:l.state,key:l.key,idx:n},h(l)];k.replaceState(t,"",B);z(f)}}function y(b){k.go(b)}let {window:q=document.defaultView}=e,k=q.history,m=null;q.addEventListener("popstate",function(){if(m)c.call(m),
m=null;else{let b=p.Pop,[a,d]=g();if(c.length)if(null!=a){let f=n-a;f&&(m={action:b,location:d,retry(){y(-1*f)}},y(f))}else D(!1,"You are trying to block a POP navigation to a location that was not created by the history library. The block will fail silently in production, but in general you should do all navigation with the history library (instead of using window.history.pushState directly) to avoid this situation.");else z(b)}});let u=p.Pop,[n,r]=g(),v=F(),c=F();null==n&&(n=0,k.replaceState(Object.assign(Object.assign({},
k.state),{idx:n}),""));return{get action(){return u},get location(){return r},createHref:h,push:A,replace:x,go:y,back(){y(-1)},forward(){y(1)},listen(b){return v.push(b)},block(b){let a=c.push(b);1===c.length&&q.addEventListener("beforeunload",E);return function(){a();c.length||q.removeEventListener("beforeunload",E)}}}};
function createHashHistory(e={}){function g(){let {pathname:a="/",search:d="",hash:f=""}=J(k.location.hash.substr(1)),l=m.state||{};return[l.idx,Object.freeze({pathname:a,search:d,hash:f,state:l.usr||null,key:l.key||"default"})]}function h(){if(u)b.call(u),u=null;else{let a=p.Pop,[d,f]=g();if(b.length)if(null!=d){let l=r-d;l&&(u={action:a,location:f,retry(){q(-1*l)}},q(l))}else D(!1,"You are trying to block a POP navigation to a location that was not created by the history library. The block will fail silently in production, but in general you should do all navigation with the history library (instead of using window.history.pushState directly) to avoid this situation.");
else A(a)}}function w(a){var d=document.querySelector("base"),f="";d&&d.getAttribute("href")&&(d=k.location.href,f=d.indexOf("#"),f=-1===f?d:d.slice(0,f));return f+"#"+("string"===typeof a?a:I(a))}function z(a,d=null){return Object.freeze(Object.assign(Object.assign(Object.assign({},v),"string"===typeof a?J(a):a),{state:d,key:H()}))}function A(a){n=a;[r,v]=g();c.call({action:n,location:v})}function x(a,d){function f(){x(a,d)}let l=p.Push,t=z(a,d);D("/"===t.pathname.charAt(0),`Relative pathnames are not supported in hash history.push(${JSON.stringify(a)})`);
if(!b.length||(b.call({action:l,location:t,retry:f}),!1)){let [B,G]=[{usr:t.state,key:t.key,idx:r+1},w(t)];try{m.pushState(B,"",G)}catch(K){k.location.assign(G)}A(l)}}function y(a,d){function f(){y(a,d)}let l=p.Replace,t=z(a,d);D("/"===t.pathname.charAt(0),`Relative pathnames are not supported in hash history.replace(${JSON.stringify(a)})`);if(!b.length||(b.call({action:l,location:t,retry:f}),!1)){let [B,G]=[{usr:t.state,key:t.key,idx:r},w(t)];m.replaceState(B,"",G);A(l)}}function q(a){m.go(a)}let {window:k=
document.defaultView}=e,m=k.history,u=null;k.addEventListener("popstate",h);k.addEventListener("hashchange",()=>{let [,a]=g();I(a)!==I(v)&&h()});let n=p.Pop,[r,v]=g(),c=F(),b=F();null==r&&(r=0,m.replaceState(Object.assign(Object.assign({},m.state),{idx:r}),""));return{get action(){return n},get location(){return v},createHref:w,push:x,replace:y,go:q,back(){q(-1)},forward(){q(1)},listen(a){return c.push(a)},block(a){let d=b.push(a);1===b.length&&k.addEventListener("beforeunload",E);return function(){d();
b.length||k.removeEventListener("beforeunload",E)}}}};
function createMemoryHistory(e={}){function g(c,b=null){return Object.freeze(Object.assign(Object.assign(Object.assign({},n),"string"===typeof c?J(c):c),{state:b,key:H()}))}function h(c,b,a){return!v.length||(v.call({action:c,location:b,retry:a}),!1)}function w(c,b){u=c;n=b;r.call({action:u,location:n})}function z(c,b){let a=p.Push,d=g(c,b);D("/"===n.pathname.charAt(0),`Relative pathnames are not supported in memory history.push(${JSON.stringify(c)})`);h(a,d,function(){z(c,b)})&&(m+=1,k.splice(m,
k.length,d),w(a,d))}function A(c,b){let a=p.Replace,d=g(c,b);D("/"===n.pathname.charAt(0),`Relative pathnames are not supported in memory history.replace(${JSON.stringify(c)})`);h(a,d,function(){A(c,b)})&&(k[m]=d,w(a,d))}function x(c){let b=Math.min(Math.max(m+c,0),k.length-1),a=p.Pop,d=k[b];h(a,d,function(){x(c)})&&(m=b,w(a,d))}let {initialEntries:y=["/"],initialIndex:q}=e,k=y.map(c=>{let b=Object.freeze(Object.assign({pathname:"/",search:"",hash:"",state:null,key:H()},"string"===typeof c?J(c):c));
D("/"===b.pathname.charAt(0),`Relative pathnames are not supported in createMemoryHistory({ initialEntries }) (invalid entry: ${JSON.stringify(c)})`);return b}),m=Math.min(Math.max(null==q?k.length-1:q,0),k.length-1),u=p.Pop,n=k[m],r=F(),v=F();return{get index(){return m},get action(){return u},get location(){return n},createHref:function(c){return"string"===typeof c?c:I(c)},push:z,replace:A,go:x,back(){x(-1)},forward(){x(1)},listen(c){return r.push(c)},block(c){return v.push(c)}}};
export{p as Action,createBrowserHistory,createHashHistory,createMemoryHistory,I as createPath,J as parsePath}
//# sourceMappingURL=history.development.js.map

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

var t,e=t||(t={});function n(t){t.preventDefault(),t.returnValue=""}function a(){let t=[];return{get length(){return t.length},push:e=>(t.push(e),function(){t=t.filter(t=>t!==e)}),call(e){t.forEach(t=>t&&t(e))}}}function l(){return Math.random().toString(36).substr(2,8)}function i({pathname:t="/",search:e="",hash:n=""}){return t+e+n}function r(t){let e={};if(t){var n=t.indexOf("#");0<=n&&(e.hash=t.substr(n),t=t.substr(0,n)),0<=(n=t.indexOf("?"))&&(e.search=t.substr(n),t=t.substr(0,n)),t&&(e.pathname=t)}return e}function o(e={}){function o(){let{pathname:t,search:e,hash:n}=h.location,a=g.state||{};return[a.idx,{pathname:t,search:e,hash:n,state:a.usr||null,key:a.key||"default"}]}function c(t){return"string"==typeof t?t:i(t)}function s(t,e=null){return Object.assign(Object.assign(Object.assign({},b),"string"==typeof t?r(t):t),{state:e,key:l()})}function u(t){d=t,[y,b]=o(),k.call({action:d,location:b})}function f(t){g.go(t)}let{window:h=document.defaultView}=e,g=h.history,p=null;h.addEventListener("popstate",(function(){if(p)m.call(p),p=null;else{let e=t.Pop,[n,a]=o();if(m.length){if(null!=n){let t=y-n;t&&(p={action:e,location:a,retry(){f(-1*t)}},f(t))}}else u(e)}}));let d=t.Pop,[y,b]=o(),k=a(),m=a();return null==y&&(y=0,g.replaceState(Object.assign(Object.assign({},g.state),{idx:y}),"")),{get action(){return d},get location(){return b},createHref:c,push:function e(n,a){let l=t.Push,i=s(n,a);if(!m.length||(m.call({action:l,location:i,retry:function(){e(n,a)}}),0)){let[t,e]=[{usr:i.state,key:i.key,idx:y+1},c(i)];try{g.pushState(t,"",e)}catch(r){h.location.assign(e)}u(l)}},replace:function e(n,a){let l=t.Replace,i=s(n,a);if(!m.length||(m.call({action:l,location:i,retry:function(){e(n,a)}}),0)){let[t,e]=[{usr:i.state,key:i.key,idx:y},c(i)];g.replaceState(t,"",e),u(l)}},go:f,back(){f(-1)},forward(){f(1)},listen:t=>k.push(t),block(t){let e=m.push(t);return 1===m.length&&h.addEventListener("beforeunload",n),function(){e(),m.length||h.removeEventListener("beforeunload",n)}}}}function c(e={}){function o(){let{pathname:t="/",search:e="",hash:n=""}=r(g.location.hash.substr(1)),a=p.state||{};return[a.idx,{pathname:t,search:e,hash:n,state:a.usr||null,key:a.key||"default"}]}function c(){if(d)O.call(d),d=null;else{let e=t.Pop,[n,a]=o();if(O.length){if(null!=n){let t=b-n;t&&(d={action:e,location:a,retry(){h(-1*t)}},h(t))}}else f(e)}}function s(t){var e=document.querySelector("base"),n="";return e&&e.getAttribute("href")&&(n=-1===(n=(e=g.location.href).indexOf("#"))?e:e.slice(0,n)),(e=n)+"#"+("string"==typeof t?t:i(t))}function u(t,e=null){return Object.assign(Object.assign(Object.assign({},k),"string"==typeof t?r(t):t),{state:e,key:l()})}function f(t){y=t,[b,k]=o(),m.call({action:y,location:k})}function h(t){p.go(t)}let{window:g=document.defaultView}=e,p=g.history,d=null;g.addEventListener("popstate",c),g.addEventListener("hashchange",()=>{let[,t]=o();i(t)!==i(k)&&c()});let y=t.Pop,[b,k]=o(),m=a(),O=a();return null==b&&(b=0,p.replaceState(Object.assign(Object.assign({},p.state),{idx:b}),"")),{get action(){return y},get location(){return k},createHref:s,push:function e(n,a){let l=t.Push,i=u(n,a);if(!O.length||(O.call({action:l,location:i,retry:function(){e(n,a)}}),0)){let[t,e]=[{usr:i.state,key:i.key,idx:b+1},s(i)];try{p.pushState(t,"",e)}catch(r){g.location.assign(e)}f(l)}},replace:function e(n,a){let l=t.Replace,i=u(n,a);if(!O.length||(O.call({action:l,location:i,retry:function(){e(n,a)}}),0)){let[t,e]=[{usr:i.state,key:i.key,idx:b},s(i)];p.replaceState(t,"",e),f(l)}},go:h,back(){h(-1)},forward(){h(1)},listen:t=>m.push(t),block(t){let e=O.push(t);return 1===O.length&&g.addEventListener("beforeunload",n),function(){e(),O.length||g.removeEventListener("beforeunload",n)}}}}function s(e={}){function n(t,e=null){return Object.assign(Object.assign(Object.assign({},d),"string"==typeof t?r(t):t),{state:e,key:l()})}function o(t,e,n){return!b.length||(b.call({action:t,location:e,retry:n}),!1)}function c(t,e){p=t,d=e,y.call({action:p,location:d})}function s(e){let n=Math.min(Math.max(g+e,0),h.length-1),a=t.Pop,l=h[n];o(a,l,(function(){s(e)}))&&(g=n,c(a,l))}let{initialEntries:u=["/"],initialIndex:f}=e,h=u.map(t=>Object.assign({pathname:"/",search:"",hash:"",state:null,key:l()},"string"==typeof t?r(t):t)),g=Math.min(Math.max(null==f?h.length-1:f,0),h.length-1),p=t.Pop,d=h[g],y=a(),b=a();return{get index(){return g},get action(){return p},get location(){return d},createHref:function(t){return"string"==typeof t?t:i(t)},push:function e(a,l){let i=t.Push,r=n(a,l);o(i,r,(function(){e(a,l)}))&&(g+=1,h.splice(g,h.length,r),c(i,r))},replace:function e(a,l){let i=t.Replace,r=n(a,l);o(i,r,(function(){e(a,l)}))&&(h[g]=r,c(i,r))},go:s,back(){s(-1)},forward(){s(1)},listen:t=>y.push(t),block:t=>b.push(t)}}e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE";export{t as Action,o as createBrowserHistory,c as createHashHistory,s as createMemoryHistory,i as createPath,r as parsePath};
var t,e=t||(t={});function n(t){t.preventDefault(),t.returnValue=""}function a(){let t=[];return{get length(){return t.length},push:e=>(t.push(e),function(){t=t.filter((t=>t!==e))}),call(e){t.forEach((t=>t&&t(e)))}}}function l(){return Math.random().toString(36).substr(2,8)}function i({pathname:t="/",search:e="",hash:n=""}){return t+e+n}function r(t){let e={};if(t){var n=t.indexOf("#");0<=n&&(e.hash=t.substr(n),t=t.substr(0,n)),0<=(n=t.indexOf("?"))&&(e.search=t.substr(n),t=t.substr(0,n)),t&&(e.pathname=t)}return e}function o(e={}){function o(){let{pathname:t,search:e,hash:n}=h.location,a=g.state||{};return[a.idx,{pathname:t,search:e,hash:n,state:a.usr||null,key:a.key||"default"}]}function c(t){return"string"==typeof t?t:i(t)}function s(t,e=null){return Object.assign(Object.assign(Object.assign({},b),"string"==typeof t?r(t):t),{state:e,key:l()})}function u(t){d=t,[y,b]=o(),k.call({action:d,location:b})}function f(t){g.go(t)}let{window:h=document.defaultView}=e,g=h.history,p=null;h.addEventListener("popstate",(function(){if(p)m.call(p),p=null;else{let e=t.Pop,[n,a]=o();if(m.length){if(null!=n){let t=y-n;t&&(p={action:e,location:a,retry(){f(-1*t)}},f(t))}}else u(e)}}));let d=t.Pop,[y,b]=o(),k=a(),m=a();return null==y&&(y=0,g.replaceState(Object.assign(Object.assign({},g.state),{idx:y}),"")),{get action(){return d},get location(){return b},createHref:c,push:function e(n,a){let l=t.Push,i=s(n,a);if(!m.length||(m.call({action:l,location:i,retry:function(){e(n,a)}}),0)){let[t,e]=[{usr:i.state,key:i.key,idx:y+1},c(i)];try{g.pushState(t,"",e)}catch(r){h.location.assign(e)}u(l)}},replace:function e(n,a){let l=t.Replace,i=s(n,a);if(!m.length||(m.call({action:l,location:i,retry:function(){e(n,a)}}),0)){let[t,e]=[{usr:i.state,key:i.key,idx:y},c(i)];g.replaceState(t,"",e),u(l)}},go:f,back(){f(-1)},forward(){f(1)},listen:t=>k.push(t),block(t){let e=m.push(t);return 1===m.length&&h.addEventListener("beforeunload",n),function(){e(),m.length||h.removeEventListener("beforeunload",n)}}}}function c(e={}){function o(){let{pathname:t="/",search:e="",hash:n=""}=r(g.location.hash.substr(1)),a=p.state||{};return[a.idx,{pathname:t,search:e,hash:n,state:a.usr||null,key:a.key||"default"}]}function c(){if(d)O.call(d),d=null;else{let e=t.Pop,[n,a]=o();if(O.length){if(null!=n){let t=b-n;t&&(d={action:e,location:a,retry(){h(-1*t)}},h(t))}}else f(e)}}function s(t){var e=document.querySelector("base"),n="";return e&&e.getAttribute("href")&&(n=-1===(n=(e=g.location.href).indexOf("#"))?e:e.slice(0,n)),n+"#"+("string"==typeof t?t:i(t))}function u(t,e=null){return Object.assign(Object.assign(Object.assign({},k),"string"==typeof t?r(t):t),{state:e,key:l()})}function f(t){y=t,[b,k]=o(),m.call({action:y,location:k})}function h(t){p.go(t)}let{window:g=document.defaultView}=e,p=g.history,d=null;g.addEventListener("popstate",c),g.addEventListener("hashchange",(()=>{let[,t]=o();i(t)!==i(k)&&c()}));let y=t.Pop,[b,k]=o(),m=a(),O=a();return null==b&&(b=0,p.replaceState(Object.assign(Object.assign({},p.state),{idx:b}),"")),{get action(){return y},get location(){return k},createHref:s,push:function e(n,a){let l=t.Push,i=u(n,a);if(!O.length||(O.call({action:l,location:i,retry:function(){e(n,a)}}),0)){let[t,e]=[{usr:i.state,key:i.key,idx:b+1},s(i)];try{p.pushState(t,"",e)}catch(r){g.location.assign(e)}f(l)}},replace:function e(n,a){let l=t.Replace,i=u(n,a);if(!O.length||(O.call({action:l,location:i,retry:function(){e(n,a)}}),0)){let[t,e]=[{usr:i.state,key:i.key,idx:b},s(i)];p.replaceState(t,"",e),f(l)}},go:h,back(){h(-1)},forward(){h(1)},listen:t=>m.push(t),block(t){let e=O.push(t);return 1===O.length&&g.addEventListener("beforeunload",n),function(){e(),O.length||g.removeEventListener("beforeunload",n)}}}}function s(e={}){function n(t,e=null){return Object.assign(Object.assign(Object.assign({},d),"string"==typeof t?r(t):t),{state:e,key:l()})}function o(t,e,n){return!b.length||(b.call({action:t,location:e,retry:n}),!1)}function c(t,e){p=t,d=e,y.call({action:p,location:d})}function s(e){let n=Math.min(Math.max(g+e,0),h.length-1),a=t.Pop,l=h[n];o(a,l,(function(){s(e)}))&&(g=n,c(a,l))}let{initialEntries:u=["/"],initialIndex:f}=e,h=u.map((t=>Object.assign({pathname:"/",search:"",hash:"",state:null,key:l()},"string"==typeof t?r(t):t))),g=Math.min(Math.max(null==f?h.length-1:f,0),h.length-1),p=t.Pop,d=h[g],y=a(),b=a();return{get index(){return g},get action(){return p},get location(){return d},createHref:function(t){return"string"==typeof t?t:i(t)},push:function e(a,l){let i=t.Push,r=n(a,l);o(i,r,(function(){e(a,l)}))&&(g+=1,h.splice(g,h.length,r),c(i,r))},replace:function e(a,l){let i=t.Replace,r=n(a,l);o(i,r,(function(){e(a,l)}))&&(h[g]=r,c(i,r))},go:s,back(){s(-1)},forward(){s(1)},listen:t=>y.push(t),block:t=>b.push(t)}}e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE";export{t as Action,o as createBrowserHistory,c as createHashHistory,s as createMemoryHistory,i as createPath,r as parsePath};
//# sourceMappingURL=history.production.min.js.map

@@ -108,42 +108,7 @@ /**

*/
export interface PartialPath {
/**
* The URL pathname, beginning with a /.
*
* @see https://github.com/ReactTraining/history/tree/master/docs/api-reference.md#location.pathname
*/
pathname?: Pathname;
/**
* The URL search string, beginning with a ?.
*
* @see https://github.com/ReactTraining/history/tree/master/docs/api-reference.md#location.search
*/
search?: Search;
/**
* The URL fragment identifier, beginning with a #.
*
* @see https://github.com/ReactTraining/history/tree/master/docs/api-reference.md#location.hash
*/
hash?: Hash;
}
export declare type PartialPath = Partial<Path>;
/**
* A partial Location object that may be missing some properties.
*/
export interface PartialLocation<S extends State = State> extends PartialPath {
/**
* An object of arbitrary data associated with this location.
*
* @see https://github.com/ReactTraining/history/tree/master/docs/api-reference.md#location.state
*/
state?: S;
/**
* A unique string associated with this location. May be used to safely store
* and retrieve data in some other storage API, like `localStorage`.
*
* Note: This value is always "default" on the initial location.
*
* @see https://github.com/ReactTraining/history/tree/master/docs/api-reference.md#location.key
*/
key?: Key;
}
export declare type PartialLocation = Partial<Location>;
/**

@@ -369,2 +334,2 @@ * A change to the current location.

*/
export declare function parsePath(path: string): PartialPath;
export declare function parsePath(path: string): Partial<Path>;

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

import _extends from'@babel/runtime/helpers/esm/extends';var m,x=m||(m={});x.Pop="POP";x.Push="PUSH";x.Replace="REPLACE";var y="production"!==process.env.NODE_ENV?function(a){return Object.freeze(a)}:function(a){return a};function z(a,b){if(!a){"undefined"!==typeof console&&console.warn(b);try{throw Error(b);}catch(g){}}}function A(a){a.preventDefault();a.returnValue=""}
function B(){var a=[];return{get length(){return a.length},push:function(b){a.push(b);return function(){a=a.filter(function(a){return a!==b})}},call:function(b){a.forEach(function(a){return a&&a(b)})}}}function D(){return Math.random().toString(36).substr(2,8)}function E(a){var b=a.pathname,g=a.search;a=a.hash;return(void 0===b?"/":b)+(void 0===g?"":g)+(void 0===a?"":a)}
function F(a){var b={};if(a){var g=a.indexOf("#");0<=g&&(b.hash=a.substr(g),a=a.substr(0,g));g=a.indexOf("?");0<=g&&(b.search=a.substr(g),a=a.substr(0,g));a&&(b.pathname=a)}return b}
function createBrowserHistory(a){function b(){var a=h.location,d=f.state||{};return[d.idx,y({pathname:a.pathname,search:a.search,hash:a.hash,state:d.usr||null,key:d.key||"default"})]}function g(a){return"string"===typeof a?a:E(a)}function t(a,d){void 0===d&&(d=null);return y(_extends({},l,{},"string"===typeof a?F(a):a,{state:d,key:D()}))}function v(a){n=a;a=b();q=a[0];l=a[1];c.call({action:n,location:l})}function w(a,d){function c(){w(a,d)}var k=m.Push,C=t(a,d);if(!e.length||(e.call({action:k,
location:C,retry:c}),!1)){var b=[{usr:C.state,key:C.key,idx:q+1},g(C)];C=b[0];b=b[1];try{f.pushState(C,"",b)}catch(G){h.location.assign(b)}v(k)}}function u(a,d){function c(){u(a,d)}var b=m.Replace,k=t(a,d);e.length&&(e.call({action:b,location:k,retry:c}),1)||(k=[{usr:k.state,key:k.key,idx:q},g(k)],f.replaceState(k[0],"",k[1]),v(b))}function r(a){f.go(a)}void 0===a&&(a={});a=a.window;var h=void 0===a?document.defaultView:a,f=h.history,p=null;h.addEventListener("popstate",function(){if(p)e.call(p),
p=null;else{var a=m.Pop,d=b(),c=d[0];d=d[1];if(e.length)if(null!=c){var f=q-c;f&&(p={action:a,location:d,retry:function(){r(-1*f)}},r(f))}else"production"!==process.env.NODE_ENV?z(!1,"You are trying to block a POP navigation to a location that was not created by the history library. The block will fail silently in production, but in general you should do all navigation with the history library (instead of using window.history.pushState directly) to avoid this situation."):void 0;else v(a)}});var n=
m.Pop;a=b();var q=a[0],l=a[1],c=B(),e=B();null==q&&(q=0,f.replaceState(_extends({},f.state,{idx:q}),""));return{get action(){return n},get location(){return l},createHref:g,push:w,replace:u,go:r,back:function(){r(-1)},forward:function(){r(1)},listen:function(a){return c.push(a)},block:function(a){var d=e.push(a);1===e.length&&h.addEventListener("beforeunload",A);return function(){d();e.length||h.removeEventListener("beforeunload",A)}}}};
function createHashHistory(a){function b(){var a=F(f.location.hash.substr(1)),c=a.pathname,b=a.search;a=a.hash;var e=p.state||{};return[e.idx,y({pathname:void 0===c?"/":c,search:void 0===b?"":b,hash:void 0===a?"":a,state:e.usr||null,key:e.key||"default"})]}function g(){if(n)k.call(n),n=null;else{var a=m.Pop,c=b(),e=c[0];c=c[1];if(k.length)if(null!=e){var f=l-e;f&&(n={action:a,location:c,retry:function(){h(-1*f)}},h(f))}else"production"!==process.env.NODE_ENV?z(!1,"You are trying to block a POP navigation to a location that was not created by the history library. The block will fail silently in production, but in general you should do all navigation with the history library (instead of using window.history.pushState directly) to avoid this situation."):
void 0;else w(a)}}function t(a){var d=document.querySelector("base"),c="";d&&d.getAttribute("href")&&(d=f.location.href,c=d.indexOf("#"),c=-1===c?d:d.slice(0,c));return c+"#"+("string"===typeof a?a:E(a))}function v(a,b){void 0===b&&(b=null);return y(_extends({},c,{},"string"===typeof a?F(a):a,{state:b,key:D()}))}function w(a){q=a;a=b();l=a[0];c=a[1];e.call({action:q,location:c})}function u(a,c){function d(){u(a,c)}var b=m.Push,e=v(a,c);"production"!==process.env.NODE_ENV?z("/"===e.pathname.charAt(0),
"Relative pathnames are not supported in hash history.push("+JSON.stringify(a)+")"):void 0;if(!k.length||(k.call({action:b,location:e,retry:d}),!1)){var g=[{usr:e.state,key:e.key,idx:l+1},t(e)];e=g[0];g=g[1];try{p.pushState(e,"",g)}catch(H){f.location.assign(g)}w(b)}}function r(a,c){function d(){r(a,c)}var e=m.Replace,b=v(a,c);"production"!==process.env.NODE_ENV?z("/"===b.pathname.charAt(0),"Relative pathnames are not supported in hash history.replace("+JSON.stringify(a)+")"):void 0;k.length&&(k.call({action:e,
location:b,retry:d}),1)||(b=[{usr:b.state,key:b.key,idx:l},t(b)],p.replaceState(b[0],"",b[1]),w(e))}function h(a){p.go(a)}void 0===a&&(a={});a=a.window;var f=void 0===a?document.defaultView:a,p=f.history,n=null;f.addEventListener("popstate",g);f.addEventListener("hashchange",function(){var a=b()[1];E(a)!==E(c)&&g()});var q=m.Pop;a=b();var l=a[0],c=a[1],e=B(),k=B();null==l&&(l=0,p.replaceState(_extends({},p.state,{idx:l}),""));return{get action(){return q},get location(){return c},createHref:t,push:u,
replace:r,go:h,back:function(){h(-1)},forward:function(){h(1)},listen:function(a){return e.push(a)},block:function(a){var c=k.push(a);1===k.length&&f.addEventListener("beforeunload",A);return function(){c();k.length||f.removeEventListener("beforeunload",A)}}}};
function createMemoryHistory(a){function b(a,b){void 0===b&&(b=null);return y(_extends({},n,{},"string"===typeof a?F(a):a,{state:b,key:D()}))}function g(a,b,f){return!l.length||(l.call({action:a,location:b,retry:f}),!1)}function t(a,b){p=a;n=b;q.call({action:p,location:n})}function v(a,e){var c=m.Push,d=b(a,e);"production"!==process.env.NODE_ENV?z("/"===n.pathname.charAt(0),"Relative pathnames are not supported in memory history.push("+JSON.stringify(a)+")"):void 0;g(c,d,function(){v(a,e)})&&
(f+=1,h.splice(f,h.length,d),t(c,d))}function w(a,e){var c=m.Replace,d=b(a,e);"production"!==process.env.NODE_ENV?z("/"===n.pathname.charAt(0),"Relative pathnames are not supported in memory history.replace("+JSON.stringify(a)+")"):void 0;g(c,d,function(){w(a,e)})&&(h[f]=d,t(c,d))}function u(a){var b=Math.min(Math.max(f+a,0),h.length-1),c=m.Pop,d=h[b];g(c,d,function(){u(a)})&&(f=b,t(c,d))}void 0===a&&(a={});var r=a;a=r.initialEntries;r=r.initialIndex;var h=(void 0===a?["/"]:a).map(function(a){var b=
y(_extends({pathname:"/",search:"",hash:"",state:null,key:D()},"string"===typeof a?F(a):a));"production"!==process.env.NODE_ENV?z("/"===b.pathname.charAt(0),"Relative pathnames are not supported in createMemoryHistory({ initialEntries }) (invalid entry: "+JSON.stringify(a)+")"):void 0;return b}),f=Math.min(Math.max(null==r?h.length-1:r,0),h.length-1),p=m.Pop,n=h[f],q=B(),l=B();return{get index(){return f},get action(){return p},get location(){return n},createHref:function(a){return"string"===typeof a?
a:E(a)},push:v,replace:w,go:u,back:function(){u(-1)},forward:function(){u(1)},listen:function(a){return q.push(a)},block:function(a){return l.push(a)}}};export{m as Action,createBrowserHistory,createHashHistory,createMemoryHistory,E as createPath,F as parsePath}
import _extends from'@babel/runtime/helpers/esm/extends';var r,B=r||(r={});B.Pop="POP";B.Push="PUSH";B.Replace="REPLACE";var C="production"!==process.env.NODE_ENV?function(b){return Object.freeze(b)}:function(b){return b};function D(b,h){if(!b){"undefined"!==typeof console&&console.warn(h);try{throw Error(h);}catch(k){}}}function E(b){b.preventDefault();b.returnValue=""}
function F(){var b=[];return{get length(){return b.length},push:function(h){b.push(h);return function(){b=b.filter(function(k){return k!==h})}},call:function(h){b.forEach(function(k){return k&&k(h)})}}}function H(){return Math.random().toString(36).substr(2,8)}function I(b){var h=b.pathname,k=b.search;b=b.hash;return(void 0===h?"/":h)+(void 0===k?"":k)+(void 0===b?"":b)}
function J(b){var h={};if(b){var k=b.indexOf("#");0<=k&&(h.hash=b.substr(k),b=b.substr(0,k));k=b.indexOf("?");0<=k&&(h.search=b.substr(k),b=b.substr(0,k));b&&(h.pathname=b)}return h}
function createBrowserHistory(b){function h(){var c=p.location,a=m.state||{};return[a.idx,C({pathname:c.pathname,search:c.search,hash:c.hash,state:a.usr||null,key:a.key||"default"})]}function k(c){return"string"===typeof c?c:I(c)}function x(c,a){void 0===a&&(a=null);return C(_extends({},q,"string"===typeof c?J(c):c,{state:a,key:H()}))}function z(c){t=c;c=h();v=c[0];q=c[1];d.call({action:t,location:q})}function A(c,a){function e(){A(c,a)}var l=r.Push,g=x(c,a);if(!f.length||(f.call({action:l,
location:g,retry:e}),!1)){var n=[{usr:g.state,key:g.key,idx:v+1},k(g)];g=n[0];n=n[1];try{m.pushState(g,"",n)}catch(G){p.location.assign(n)}z(l)}}function y(c,a){function e(){y(c,a)}var l=r.Replace,g=x(c,a);f.length&&(f.call({action:l,location:g,retry:e}),1)||(g=[{usr:g.state,key:g.key,idx:v},k(g)],m.replaceState(g[0],"",g[1]),z(l))}function w(c){m.go(c)}void 0===b&&(b={});b=b.window;var p=void 0===b?document.defaultView:b,m=p.history,u=null;p.addEventListener("popstate",function(){if(u)f.call(u),
u=null;else{var c=r.Pop,a=h(),e=a[0];a=a[1];if(f.length)if(null!=e){var l=v-e;l&&(u={action:c,location:a,retry:function(){w(-1*l)}},w(l))}else"production"!==process.env.NODE_ENV?D(!1,"You are trying to block a POP navigation to a location that was not created by the history library. The block will fail silently in production, but in general you should do all navigation with the history library (instead of using window.history.pushState directly) to avoid this situation."):void 0;else z(c)}});var t=
r.Pop;b=h();var v=b[0],q=b[1],d=F(),f=F();null==v&&(v=0,m.replaceState(_extends({},m.state,{idx:v}),""));return{get action(){return t},get location(){return q},createHref:k,push:A,replace:y,go:w,back:function(){w(-1)},forward:function(){w(1)},listen:function(c){return d.push(c)},block:function(c){var a=f.push(c);1===f.length&&p.addEventListener("beforeunload",E);return function(){a();f.length||p.removeEventListener("beforeunload",E)}}}};
function createHashHistory(b){function h(){var a=J(m.location.hash.substr(1)),e=a.pathname,l=a.search;a=a.hash;var g=u.state||{};return[g.idx,C({pathname:void 0===e?"/":e,search:void 0===l?"":l,hash:void 0===a?"":a,state:g.usr||null,key:g.key||"default"})]}function k(){if(t)c.call(t),t=null;else{var a=r.Pop,e=h(),l=e[0];e=e[1];if(c.length)if(null!=l){var g=q-l;g&&(t={action:a,location:e,retry:function(){p(-1*g)}},p(g))}else"production"!==process.env.NODE_ENV?D(!1,"You are trying to block a POP navigation to a location that was not created by the history library. The block will fail silently in production, but in general you should do all navigation with the history library (instead of using window.history.pushState directly) to avoid this situation."):
void 0;else A(a)}}function x(a){var e=document.querySelector("base"),l="";e&&e.getAttribute("href")&&(e=m.location.href,l=e.indexOf("#"),l=-1===l?e:e.slice(0,l));return l+"#"+("string"===typeof a?a:I(a))}function z(a,e){void 0===e&&(e=null);return C(_extends({},d,"string"===typeof a?J(a):a,{state:e,key:H()}))}function A(a){v=a;a=h();q=a[0];d=a[1];f.call({action:v,location:d})}function y(a,e){function l(){y(a,e)}var g=r.Push,n=z(a,e);"production"!==process.env.NODE_ENV?D("/"===n.pathname.charAt(0),
"Relative pathnames are not supported in hash history.push("+JSON.stringify(a)+")"):void 0;if(!c.length||(c.call({action:g,location:n,retry:l}),!1)){var G=[{usr:n.state,key:n.key,idx:q+1},x(n)];n=G[0];G=G[1];try{u.pushState(n,"",G)}catch(K){m.location.assign(G)}A(g)}}function w(a,e){function l(){w(a,e)}var g=r.Replace,n=z(a,e);"production"!==process.env.NODE_ENV?D("/"===n.pathname.charAt(0),"Relative pathnames are not supported in hash history.replace("+JSON.stringify(a)+")"):void 0;c.length&&(c.call({action:g,
location:n,retry:l}),1)||(n=[{usr:n.state,key:n.key,idx:q},x(n)],u.replaceState(n[0],"",n[1]),A(g))}function p(a){u.go(a)}void 0===b&&(b={});b=b.window;var m=void 0===b?document.defaultView:b,u=m.history,t=null;m.addEventListener("popstate",k);m.addEventListener("hashchange",function(){var a=h()[1];I(a)!==I(d)&&k()});var v=r.Pop;b=h();var q=b[0],d=b[1],f=F(),c=F();null==q&&(q=0,u.replaceState(_extends({},u.state,{idx:q}),""));return{get action(){return v},get location(){return d},createHref:x,push:y,
replace:w,go:p,back:function(){p(-1)},forward:function(){p(1)},listen:function(a){return f.push(a)},block:function(a){var e=c.push(a);1===c.length&&m.addEventListener("beforeunload",E);return function(){e();c.length||m.removeEventListener("beforeunload",E)}}}};
function createMemoryHistory(b){function h(d,f){void 0===f&&(f=null);return C(_extends({},t,"string"===typeof d?J(d):d,{state:f,key:H()}))}function k(d,f,c){return!q.length||(q.call({action:d,location:f,retry:c}),!1)}function x(d,f){u=d;t=f;v.call({action:u,location:t})}function z(d,f){var c=r.Push,a=h(d,f);"production"!==process.env.NODE_ENV?D("/"===t.pathname.charAt(0),"Relative pathnames are not supported in memory history.push("+JSON.stringify(d)+")"):void 0;k(c,a,function(){z(d,f)})&&
(m+=1,p.splice(m,p.length,a),x(c,a))}function A(d,f){var c=r.Replace,a=h(d,f);"production"!==process.env.NODE_ENV?D("/"===t.pathname.charAt(0),"Relative pathnames are not supported in memory history.replace("+JSON.stringify(d)+")"):void 0;k(c,a,function(){A(d,f)})&&(p[m]=a,x(c,a))}function y(d){var f=Math.min(Math.max(m+d,0),p.length-1),c=r.Pop,a=p[f];k(c,a,function(){y(d)})&&(m=f,x(c,a))}void 0===b&&(b={});var w=b;b=w.initialEntries;w=w.initialIndex;var p=(void 0===b?["/"]:b).map(function(d){var f=
C(_extends({pathname:"/",search:"",hash:"",state:null,key:H()},"string"===typeof d?J(d):d));"production"!==process.env.NODE_ENV?D("/"===f.pathname.charAt(0),"Relative pathnames are not supported in createMemoryHistory({ initialEntries }) (invalid entry: "+JSON.stringify(d)+")"):void 0;return f}),m=Math.min(Math.max(null==w?p.length-1:w,0),p.length-1),u=r.Pop,t=p[m],v=F(),q=F();return{get index(){return m},get action(){return u},get location(){return t},createHref:function(d){return"string"===typeof d?
d:I(d)},push:z,replace:A,go:y,back:function(){y(-1)},forward:function(){y(1)},listen:function(d){return v.push(d)},block:function(d){return q.push(d)}}};export{r as Action,createBrowserHistory,createHashHistory,createMemoryHistory,I as createPath,J as parsePath}
//# sourceMappingURL=index.js.map

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

'use strict';module.exports="production"===process.env.NODE_ENV?require("./umd/history.production.min.js"):require("./umd/history.development.js");
'use strict';module.exports="production"===process.env.NODE_ENV?require("./umd/history.production.min.js"):require("./umd/history.development.js")
{
"name": "history",
"version": "5.0.0",
"version": "5.0.1",
"description": "Manage session history with JavaScript",

@@ -5,0 +5,0 @@ "author": "React Training <hello@reacttraining.com>",

@@ -30,3 +30,3 @@ # history &middot; [![npm package][npm-badge]][npm] [![Travis][build-badge]][build]

`history` is developed and maintained by [React Training](https://reacttraining.com). If you're interested in learning more about what React can do for your company, please [get in touch](mailto:hello@reacttraining.com)!
`history` is developed and maintained by [Remix](https://remix.run). If you're interested in learning more about what React can do for your company, please [get in touch](mailto:hello@remix.run)!

@@ -33,0 +33,0 @@ ## Thanks

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

'use strict';(function(c,t){"object"===typeof exports&&"undefined"!==typeof module?t(exports):"function"===typeof define&&define.amd?define(["exports"],t):(c=c||self,t(c.HistoryLibrary={}))})(this,function(c){function t(){t=Object.assign||function(a){for(var b=1;b<arguments.length;b++){var f=arguments[b],c;for(c in f)Object.prototype.hasOwnProperty.call(f,c)&&(a[c]=f[c])}return a};return t.apply(this,arguments)}function y(a,b){if(!a){"undefined"!==typeof console&&console.warn(b);try{throw Error(b);
}catch(f){}}}function D(a){a.preventDefault();a.returnValue=""}function z(){var a=[];return{get length(){return a.length},push:function(b){a.push(b);return function(){a=a.filter(function(a){return a!==b})}},call:function(b){a.forEach(function(a){return a&&a(b)})}}}function E(){return Math.random().toString(36).substr(2,8)}function A(a){var b=a.pathname,c=a.search;a=a.hash;return(void 0===b?"/":b)+(void 0===c?"":c)+(void 0===a?"":a)}function B(a){var c={};if(a){var f=a.indexOf("#");0<=f&&(c.hash=a.substr(f),
a=a.substr(0,f));f=a.indexOf("?");0<=f&&(c.search=a.substr(f),a=a.substr(0,f));a&&(c.pathname=a)}return c}(function(a){a.Pop="POP";a.Push="PUSH";a.Replace="REPLACE"})(c.Action||(c.Action={}));c.createBrowserHistory=function(a){function b(){var a=k.location,e=h.state||{};return[e.idx,Object.freeze({pathname:a.pathname,search:a.search,hash:a.hash,state:e.usr||null,key:e.key||"default"})]}function f(a){return"string"===typeof a?a:A(a)}function u(a,e){void 0===e&&(e=null);return Object.freeze(t({},m,
{},"string"===typeof a?B(a):a,{state:e,key:E()}))}function w(a){n=a;a=b();q=a[0];m=a[1];d.call({action:n,location:m})}function x(a,e){function d(){x(a,e)}var l=c.Action.Push,C=u(a,e);if(!g.length||(g.call({action:l,location:C,retry:d}),!1)){var b=[{usr:C.state,key:C.key,idx:q+1},f(C)];C=b[0];b=b[1];try{h.pushState(C,"",b)}catch(F){k.location.assign(b)}w(l)}}function v(a,e){function d(){v(a,e)}var b=c.Action.Replace,l=u(a,e);g.length&&(g.call({action:b,location:l,retry:d}),1)||(l=[{usr:l.state,key:l.key,
idx:q},f(l)],h.replaceState(l[0],"",l[1]),w(b))}function r(a){h.go(a)}void 0===a&&(a={});a=a.window;var k=void 0===a?document.defaultView:a,h=k.history,p=null;k.addEventListener("popstate",function(){if(p)g.call(p),p=null;else{var a=c.Action.Pop,e=b(),d=e[0];e=e[1];if(g.length)if(null!=d){var f=q-d;f&&(p={action:a,location:e,retry:function(){r(-1*f)}},r(f))}else y(!1,"You are trying to block a POP navigation to a location that was not created by the history library. The block will fail silently in production, but in general you should do all navigation with the history library (instead of using window.history.pushState directly) to avoid this situation.");
else w(a)}});var n=c.Action.Pop;a=b();var q=a[0],m=a[1],d=z(),g=z();null==q&&(q=0,h.replaceState(t({},h.state,{idx:q}),""));return{get action(){return n},get location(){return m},createHref:f,push:x,replace:v,go:r,back:function(){r(-1)},forward:function(){r(1)},listen:function(a){return d.push(a)},block:function(a){var e=g.push(a);1===g.length&&k.addEventListener("beforeunload",D);return function(){e();g.length||k.removeEventListener("beforeunload",D)}}}};c.createHashHistory=function(a){function b(){var a=
B(h.location.hash.substr(1)),d=a.pathname,c=a.search;a=a.hash;var b=p.state||{};return[b.idx,Object.freeze({pathname:void 0===d?"/":d,search:void 0===c?"":c,hash:void 0===a?"":a,state:b.usr||null,key:b.key||"default"})]}function f(){if(n)l.call(n),n=null;else{var a=c.Action.Pop,d=b(),g=d[0];d=d[1];if(l.length)if(null!=g){var f=m-g;f&&(n={action:a,location:d,retry:function(){k(-1*f)}},k(f))}else y(!1,"You are trying to block a POP navigation to a location that was not created by the history library. The block will fail silently in production, but in general you should do all navigation with the history library (instead of using window.history.pushState directly) to avoid this situation.");
else x(a)}}function u(a){var e=document.querySelector("base"),d="";e&&e.getAttribute("href")&&(e=h.location.href,d=e.indexOf("#"),d=-1===d?e:e.slice(0,d));return d+"#"+("string"===typeof a?a:A(a))}function w(a,c){void 0===c&&(c=null);return Object.freeze(t({},d,{},"string"===typeof a?B(a):a,{state:c,key:E()}))}function x(a){q=a;a=b();m=a[0];d=a[1];g.call({action:q,location:d})}function v(a,d){function e(){v(a,d)}var b=c.Action.Push,g=w(a,d);y("/"===g.pathname.charAt(0),"Relative pathnames are not supported in hash history.push("+
JSON.stringify(a)+")");if(!l.length||(l.call({action:b,location:g,retry:e}),!1)){var f=[{usr:g.state,key:g.key,idx:m+1},u(g)];g=f[0];f=f[1];try{p.pushState(g,"",f)}catch(G){h.location.assign(f)}x(b)}}function r(a,d){function e(){r(a,d)}var g=c.Action.Replace,b=w(a,d);y("/"===b.pathname.charAt(0),"Relative pathnames are not supported in hash history.replace("+JSON.stringify(a)+")");l.length&&(l.call({action:g,location:b,retry:e}),1)||(b=[{usr:b.state,key:b.key,idx:m},u(b)],p.replaceState(b[0],"",b[1]),
x(g))}function k(a){p.go(a)}void 0===a&&(a={});a=a.window;var h=void 0===a?document.defaultView:a,p=h.history,n=null;h.addEventListener("popstate",f);h.addEventListener("hashchange",function(){var a=b()[1];A(a)!==A(d)&&f()});var q=c.Action.Pop;a=b();var m=a[0],d=a[1],g=z(),l=z();null==m&&(m=0,p.replaceState(t({},p.state,{idx:m}),""));return{get action(){return q},get location(){return d},createHref:u,push:v,replace:r,go:k,back:function(){k(-1)},forward:function(){k(1)},listen:function(a){return g.push(a)},
block:function(a){var d=l.push(a);1===l.length&&h.addEventListener("beforeunload",D);return function(){d();l.length||h.removeEventListener("beforeunload",D)}}}};c.createMemoryHistory=function(a){function b(a,b){void 0===b&&(b=null);return Object.freeze(t({},n,{},"string"===typeof a?B(a):a,{state:b,key:E()}))}function f(a,b,c){return!m.length||(m.call({action:a,location:b,retry:c}),!1)}function u(a,b){p=a;n=b;q.call({action:p,location:n})}function w(a,g){var d=c.Action.Push,e=b(a,g);y("/"===n.pathname.charAt(0),
"Relative pathnames are not supported in memory history.push("+JSON.stringify(a)+")");f(d,e,function(){w(a,g)})&&(h+=1,k.splice(h,k.length,e),u(d,e))}function x(a,g){var d=c.Action.Replace,e=b(a,g);y("/"===n.pathname.charAt(0),"Relative pathnames are not supported in memory history.replace("+JSON.stringify(a)+")");f(d,e,function(){x(a,g)})&&(k[h]=e,u(d,e))}function v(a){var b=Math.min(Math.max(h+a,0),k.length-1),d=c.Action.Pop,e=k[b];f(d,e,function(){v(a)})&&(h=b,u(d,e))}void 0===a&&(a={});var r=
a;a=r.initialEntries;r=r.initialIndex;var k=(void 0===a?["/"]:a).map(function(a){var b=Object.freeze(t({pathname:"/",search:"",hash:"",state:null,key:E()},"string"===typeof a?B(a):a));y("/"===b.pathname.charAt(0),"Relative pathnames are not supported in createMemoryHistory({ initialEntries }) (invalid entry: "+JSON.stringify(a)+")");return b}),h=Math.min(Math.max(null==r?k.length-1:r,0),k.length-1),p=c.Action.Pop,n=k[h],q=z(),m=z();return{get index(){return h},get action(){return p},get location(){return n},
createHref:function(a){return"string"===typeof a?a:A(a)},push:w,replace:x,go:v,back:function(){v(-1)},forward:function(){v(1)},listen:function(a){return q.push(a)},block:function(a){return m.push(a)}}};c.createPath=A;c.parsePath=B;Object.defineProperty(c,"__esModule",{value:!0})});
'use strict';(function(l,y){"object"===typeof exports&&"undefined"!==typeof module?y(exports):"function"===typeof define&&define.amd?define(["exports"],y):(l="undefined"!==typeof globalThis?globalThis:l||self,y(l.HistoryLibrary={}))})(this,function(l){function y(){y=Object.assign||function(b){for(var g=1;g<arguments.length;g++){var h=arguments[g],t;for(t in h)Object.prototype.hasOwnProperty.call(h,t)&&(b[t]=h[t])}return b};return y.apply(this,arguments)}function C(b,g){if(!b){"undefined"!==typeof console&&
console.warn(g);try{throw Error(g);}catch(h){}}}function H(b){b.preventDefault();b.returnValue=""}function D(){var b=[];return{get length(){return b.length},push:function(g){b.push(g);return function(){b=b.filter(function(h){return h!==g})}},call:function(g){b.forEach(function(h){return h&&h(g)})}}}function I(){return Math.random().toString(36).substr(2,8)}function E(b){var g=b.pathname,h=b.search;b=b.hash;return(void 0===g?"/":g)+(void 0===h?"":h)+(void 0===b?"":b)}function F(b){var g={};if(b){var h=
b.indexOf("#");0<=h&&(g.hash=b.substr(h),b=b.substr(0,h));h=b.indexOf("?");0<=h&&(g.search=b.substr(h),b=b.substr(0,h));b&&(g.pathname=b)}return g}l.Action=void 0;(function(b){b.Pop="POP";b.Push="PUSH";b.Replace="REPLACE"})(l.Action||(l.Action={}));l.createBrowserHistory=function(b){function g(){var c=q.location,a=n.state||{};return[a.idx,Object.freeze({pathname:c.pathname,search:c.search,hash:c.hash,state:a.usr||null,key:a.key||"default"})]}function h(c){return"string"===typeof c?c:E(c)}function t(c,
a){void 0===a&&(a=null);return Object.freeze(y({},r,"string"===typeof c?F(c):c,{state:a,key:I()}))}function A(c){u=c;c=g();w=c[0];r=c[1];d.call({action:u,location:r})}function B(c,a){function e(){B(c,a)}var m=l.Action.Push,k=t(c,a);if(!f.length||(f.call({action:m,location:k,retry:e}),!1)){var p=[{usr:k.state,key:k.key,idx:w+1},h(k)];k=p[0];p=p[1];try{n.pushState(k,"",p)}catch(G){q.location.assign(p)}A(m)}}function z(c,a){function e(){z(c,a)}var m=l.Action.Replace,k=t(c,a);f.length&&(f.call({action:m,
location:k,retry:e}),1)||(k=[{usr:k.state,key:k.key,idx:w},h(k)],n.replaceState(k[0],"",k[1]),A(m))}function x(c){n.go(c)}void 0===b&&(b={});b=b.window;var q=void 0===b?document.defaultView:b,n=q.history,v=null;q.addEventListener("popstate",function(){if(v)f.call(v),v=null;else{var c=l.Action.Pop,a=g(),e=a[0];a=a[1];if(f.length)if(null!=e){var m=w-e;m&&(v={action:c,location:a,retry:function(){x(-1*m)}},x(m))}else C(!1,"You are trying to block a POP navigation to a location that was not created by the history library. The block will fail silently in production, but in general you should do all navigation with the history library (instead of using window.history.pushState directly) to avoid this situation.");
else A(c)}});var u=l.Action.Pop;b=g();var w=b[0],r=b[1],d=D(),f=D();null==w&&(w=0,n.replaceState(y({},n.state,{idx:w}),""));return{get action(){return u},get location(){return r},createHref:h,push:B,replace:z,go:x,back:function(){x(-1)},forward:function(){x(1)},listen:function(c){return d.push(c)},block:function(c){var a=f.push(c);1===f.length&&q.addEventListener("beforeunload",H);return function(){a();f.length||q.removeEventListener("beforeunload",H)}}}};l.createHashHistory=function(b){function g(){var a=
F(n.location.hash.substr(1)),e=a.pathname,m=a.search;a=a.hash;var k=v.state||{};return[k.idx,Object.freeze({pathname:void 0===e?"/":e,search:void 0===m?"":m,hash:void 0===a?"":a,state:k.usr||null,key:k.key||"default"})]}function h(){if(u)c.call(u),u=null;else{var a=l.Action.Pop,e=g(),m=e[0];e=e[1];if(c.length)if(null!=m){var k=r-m;k&&(u={action:a,location:e,retry:function(){q(-1*k)}},q(k))}else C(!1,"You are trying to block a POP navigation to a location that was not created by the history library. The block will fail silently in production, but in general you should do all navigation with the history library (instead of using window.history.pushState directly) to avoid this situation.");
else B(a)}}function t(a){var e=document.querySelector("base"),m="";e&&e.getAttribute("href")&&(e=n.location.href,m=e.indexOf("#"),m=-1===m?e:e.slice(0,m));return m+"#"+("string"===typeof a?a:E(a))}function A(a,e){void 0===e&&(e=null);return Object.freeze(y({},d,"string"===typeof a?F(a):a,{state:e,key:I()}))}function B(a){w=a;a=g();r=a[0];d=a[1];f.call({action:w,location:d})}function z(a,e){function m(){z(a,e)}var k=l.Action.Push,p=A(a,e);C("/"===p.pathname.charAt(0),"Relative pathnames are not supported in hash history.push("+
JSON.stringify(a)+")");if(!c.length||(c.call({action:k,location:p,retry:m}),!1)){var G=[{usr:p.state,key:p.key,idx:r+1},t(p)];p=G[0];G=G[1];try{v.pushState(p,"",G)}catch(J){n.location.assign(G)}B(k)}}function x(a,e){function m(){x(a,e)}var k=l.Action.Replace,p=A(a,e);C("/"===p.pathname.charAt(0),"Relative pathnames are not supported in hash history.replace("+JSON.stringify(a)+")");c.length&&(c.call({action:k,location:p,retry:m}),1)||(p=[{usr:p.state,key:p.key,idx:r},t(p)],v.replaceState(p[0],"",p[1]),
B(k))}function q(a){v.go(a)}void 0===b&&(b={});b=b.window;var n=void 0===b?document.defaultView:b,v=n.history,u=null;n.addEventListener("popstate",h);n.addEventListener("hashchange",function(){var a=g()[1];E(a)!==E(d)&&h()});var w=l.Action.Pop;b=g();var r=b[0],d=b[1],f=D(),c=D();null==r&&(r=0,v.replaceState(y({},v.state,{idx:r}),""));return{get action(){return w},get location(){return d},createHref:t,push:z,replace:x,go:q,back:function(){q(-1)},forward:function(){q(1)},listen:function(a){return f.push(a)},
block:function(a){var e=c.push(a);1===c.length&&n.addEventListener("beforeunload",H);return function(){e();c.length||n.removeEventListener("beforeunload",H)}}}};l.createMemoryHistory=function(b){function g(d,f){void 0===f&&(f=null);return Object.freeze(y({},u,"string"===typeof d?F(d):d,{state:f,key:I()}))}function h(d,f,c){return!r.length||(r.call({action:d,location:f,retry:c}),!1)}function t(d,f){v=d;u=f;w.call({action:v,location:u})}function A(d,f){var c=l.Action.Push,a=g(d,f);C("/"===u.pathname.charAt(0),
"Relative pathnames are not supported in memory history.push("+JSON.stringify(d)+")");h(c,a,function(){A(d,f)})&&(n+=1,q.splice(n,q.length,a),t(c,a))}function B(d,f){var c=l.Action.Replace,a=g(d,f);C("/"===u.pathname.charAt(0),"Relative pathnames are not supported in memory history.replace("+JSON.stringify(d)+")");h(c,a,function(){B(d,f)})&&(q[n]=a,t(c,a))}function z(d){var f=Math.min(Math.max(n+d,0),q.length-1),c=l.Action.Pop,a=q[f];h(c,a,function(){z(d)})&&(n=f,t(c,a))}void 0===b&&(b={});var x=
b;b=x.initialEntries;x=x.initialIndex;var q=(void 0===b?["/"]:b).map(function(d){var f=Object.freeze(y({pathname:"/",search:"",hash:"",state:null,key:I()},"string"===typeof d?F(d):d));C("/"===f.pathname.charAt(0),"Relative pathnames are not supported in createMemoryHistory({ initialEntries }) (invalid entry: "+JSON.stringify(d)+")");return f}),n=Math.min(Math.max(null==x?q.length-1:x,0),q.length-1),v=l.Action.Pop,u=q[n],w=D(),r=D();return{get index(){return n},get action(){return v},get location(){return u},
createHref:function(d){return"string"===typeof d?d:E(d)},push:A,replace:B,go:z,back:function(){z(-1)},forward:function(){z(1)},listen:function(d){return w.push(d)},block:function(d){return r.push(d)}}};l.createPath=E;l.parsePath=F;Object.defineProperty(l,"__esModule",{value:!0})})
//# sourceMappingURL=history.development.js.map

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

"use strict";!function(t,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n((t=t||self).HistoryLibrary={})}(this,(function(t){function n(){return(n=Object.assign||function(t){for(var n=1;n<arguments.length;n++){var e,r=arguments[n];for(e in r)Object.prototype.hasOwnProperty.call(r,e)&&(t[e]=r[e])}return t}).apply(this,arguments)}function e(t){t.preventDefault(),t.returnValue=""}function r(){var t=[];return{get length(){return t.length},push:function(n){return t.push(n),function(){t=t.filter((function(t){return t!==n}))}},call:function(n){t.forEach((function(t){return t&&t(n)}))}}}function o(){return Math.random().toString(36).substr(2,8)}function i(t){var n=t.pathname,e=t.search;return(void 0===n?"/":n)+(void 0===e?"":e)+(void 0===(t=t.hash)?"":t)}function a(t){var n={};if(t){var e=t.indexOf("#");0<=e&&(n.hash=t.substr(e),t=t.substr(0,e)),0<=(e=t.indexOf("?"))&&(n.search=t.substr(e),t=t.substr(0,e)),t&&(n.pathname=t)}return n}var c;(c=t.Action||(t.Action={})).Pop="POP",c.Push="PUSH",c.Replace="REPLACE",t.createBrowserHistory=function(c){function u(){var t=p.location,n=d.state||{};return[n.idx,{pathname:t.pathname,search:t.search,hash:t.hash,state:n.usr||null,key:n.key||"default"}]}function l(t){return"string"==typeof t?t:i(t)}function s(t,e){return void 0===e&&(e=null),n({},b,{},"string"==typeof t?a(t):t,{state:e,key:o()})}function f(t){y=t,t=u(),g=t[0],b=t[1],k.call({action:y,location:b})}function h(t){d.go(t)}void 0===c&&(c={});var p=void 0===(c=c.window)?document.defaultView:c,d=p.history,v=null;p.addEventListener("popstate",(function(){if(v)m.call(v),v=null;else{var n=t.Action.Pop,e=u(),r=e[0];if(e=e[1],m.length){if(null!=r){var o=g-r;o&&(v={action:n,location:e,retry:function(){h(-1*o)}},h(o))}}else f(n)}}));var y=t.Action.Pop,g=(c=u())[0],b=c[1],k=r(),m=r();return null==g&&(g=0,d.replaceState(n({},d.state,{idx:g}),"")),{get action(){return y},get location(){return b},createHref:l,push:function n(e,r){var o=t.Action.Push,i=s(e,r);if(!m.length||(m.call({action:o,location:i,retry:function(){n(e,r)}}),0)){var a=[{usr:i.state,key:i.key,idx:g+1},l(i)];i=a[0],a=a[1];try{d.pushState(i,"",a)}catch(t){p.location.assign(a)}f(o)}},replace:function n(e,r){var o=t.Action.Replace,i=s(e,r);m.length&&(m.call({action:o,location:i,retry:function(){n(e,r)}}),1)||(i=[{usr:i.state,key:i.key,idx:g},l(i)],d.replaceState(i[0],"",i[1]),f(o))},go:h,back:function(){h(-1)},forward:function(){h(1)},listen:function(t){return k.push(t)},block:function(t){var n=m.push(t);return 1===m.length&&p.addEventListener("beforeunload",e),function(){n(),m.length||p.removeEventListener("beforeunload",e)}}}},t.createHashHistory=function(c){function u(){var t=a(d.location.hash.substr(1)),n=t.pathname,e=t.search;t=t.hash;var r=v.state||{};return[r.idx,{pathname:void 0===n?"/":n,search:void 0===e?"":e,hash:void 0===t?"":t,state:r.usr||null,key:r.key||"default"}]}function l(){if(y)P.call(y),y=null;else{var n=t.Action.Pop,e=u(),r=e[0];if(e=e[1],P.length){if(null!=r){var o=b-r;o&&(y={action:n,location:e,retry:function(){p(-1*o)}},p(o))}}else h(n)}}function s(t){var n=document.querySelector("base"),e="";return n&&n.getAttribute("href")&&(e=-1===(e=(n=d.location.href).indexOf("#"))?n:n.slice(0,e)),e+"#"+("string"==typeof t?t:i(t))}function f(t,e){return void 0===e&&(e=null),n({},k,{},"string"==typeof t?a(t):t,{state:e,key:o()})}function h(t){g=t,t=u(),b=t[0],k=t[1],m.call({action:g,location:k})}function p(t){v.go(t)}void 0===c&&(c={});var d=void 0===(c=c.window)?document.defaultView:c,v=d.history,y=null;d.addEventListener("popstate",l),d.addEventListener("hashchange",(function(){i(u()[1])!==i(k)&&l()}));var g=t.Action.Pop,b=(c=u())[0],k=c[1],m=r(),P=r();return null==b&&(b=0,v.replaceState(n({},v.state,{idx:b}),"")),{get action(){return g},get location(){return k},createHref:s,push:function n(e,r){var o=t.Action.Push,i=f(e,r);if(!P.length||(P.call({action:o,location:i,retry:function(){n(e,r)}}),0)){var a=[{usr:i.state,key:i.key,idx:b+1},s(i)];i=a[0],a=a[1];try{v.pushState(i,"",a)}catch(t){d.location.assign(a)}h(o)}},replace:function n(e,r){var o=t.Action.Replace,i=f(e,r);P.length&&(P.call({action:o,location:i,retry:function(){n(e,r)}}),1)||(i=[{usr:i.state,key:i.key,idx:b},s(i)],v.replaceState(i[0],"",i[1]),h(o))},go:p,back:function(){p(-1)},forward:function(){p(1)},listen:function(t){return m.push(t)},block:function(t){var n=P.push(t);return 1===P.length&&d.addEventListener("beforeunload",e),function(){n(),P.length||d.removeEventListener("beforeunload",e)}}}},t.createMemoryHistory=function(e){function c(t,e){return void 0===e&&(e=null),n({},v,{},"string"==typeof t?a(t):t,{state:e,key:o()})}function u(t,n,e){return!g.length||(g.call({action:t,location:n,retry:e}),!1)}function l(t,n){d=t,v=n,y.call({action:d,location:v})}function s(n){var e=Math.min(Math.max(p+n,0),h.length-1),r=t.Action.Pop,o=h[e];u(r,o,(function(){s(n)}))&&(p=e,l(r,o))}void 0===e&&(e={});var f=e;e=f.initialEntries,f=f.initialIndex;var h=(void 0===e?["/"]:e).map((function(t){return n({pathname:"/",search:"",hash:"",state:null,key:o()},"string"==typeof t?a(t):t)})),p=Math.min(Math.max(null==f?h.length-1:f,0),h.length-1),d=t.Action.Pop,v=h[p],y=r(),g=r();return{get index(){return p},get action(){return d},get location(){return v},createHref:function(t){return"string"==typeof t?t:i(t)},push:function n(e,r){var o=t.Action.Push,i=c(e,r);u(o,i,(function(){n(e,r)}))&&(p+=1,h.splice(p,h.length,i),l(o,i))},replace:function n(e,r){var o=t.Action.Replace,i=c(e,r);u(o,i,(function(){n(e,r)}))&&(h[p]=i,l(o,i))},go:s,back:function(){s(-1)},forward:function(){s(1)},listen:function(t){return y.push(t)},block:function(t){return g.push(t)}}},t.createPath=i,t.parsePath=a,Object.defineProperty(t,"__esModule",{value:!0})}));
"use strict";!function(t,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n((t="undefined"!=typeof globalThis?globalThis:t||self).HistoryLibrary={})}(this,(function(t){function n(){return(n=Object.assign||function(t){for(var n=1;n<arguments.length;n++){var e,o=arguments[n];for(e in o)Object.prototype.hasOwnProperty.call(o,e)&&(t[e]=o[e])}return t}).apply(this,arguments)}function e(t){t.preventDefault(),t.returnValue=""}function o(){var t=[];return{get length(){return t.length},push:function(n){return t.push(n),function(){t=t.filter((function(t){return t!==n}))}},call:function(n){t.forEach((function(t){return t&&t(n)}))}}}function r(){return Math.random().toString(36).substr(2,8)}function i(t){var n=t.pathname,e=t.search;return(void 0===n?"/":n)+(void 0===e?"":e)+(void 0===(t=t.hash)?"":t)}function a(t){var n={};if(t){var e=t.indexOf("#");0<=e&&(n.hash=t.substr(e),t=t.substr(0,e)),0<=(e=t.indexOf("?"))&&(n.search=t.substr(e),t=t.substr(0,e)),t&&(n.pathname=t)}return n}var c;t.Action=void 0,(c=t.Action||(t.Action={})).Pop="POP",c.Push="PUSH",c.Replace="REPLACE",t.createBrowserHistory=function(c){function u(){var t=d.location,n=p.state||{};return[n.idx,{pathname:t.pathname,search:t.search,hash:t.hash,state:n.usr||null,key:n.key||"default"}]}function l(t){return"string"==typeof t?t:i(t)}function s(t,e){return void 0===e&&(e=null),n({},b,"string"==typeof t?a(t):t,{state:e,key:r()})}function f(t){y=t,t=u(),g=t[0],b=t[1],k.call({action:y,location:b})}function h(t){p.go(t)}void 0===c&&(c={});var d=void 0===(c=c.window)?document.defaultView:c,p=d.history,v=null;d.addEventListener("popstate",(function(){if(v)m.call(v),v=null;else{var n=t.Action.Pop,e=u(),o=e[0];if(e=e[1],m.length){if(null!=o){var r=g-o;r&&(v={action:n,location:e,retry:function(){h(-1*r)}},h(r))}}else f(n)}}));var y=t.Action.Pop,g=(c=u())[0],b=c[1],k=o(),m=o();return null==g&&(g=0,p.replaceState(n({},p.state,{idx:g}),"")),{get action(){return y},get location(){return b},createHref:l,push:function n(e,o){var r=t.Action.Push,i=s(e,o);if(!m.length||(m.call({action:r,location:i,retry:function(){n(e,o)}}),0)){var a=[{usr:i.state,key:i.key,idx:g+1},l(i)];i=a[0],a=a[1];try{p.pushState(i,"",a)}catch(t){d.location.assign(a)}f(r)}},replace:function n(e,o){var r=t.Action.Replace,i=s(e,o);m.length&&(m.call({action:r,location:i,retry:function(){n(e,o)}}),1)||(i=[{usr:i.state,key:i.key,idx:g},l(i)],p.replaceState(i[0],"",i[1]),f(r))},go:h,back:function(){h(-1)},forward:function(){h(1)},listen:function(t){return k.push(t)},block:function(t){var n=m.push(t);return 1===m.length&&d.addEventListener("beforeunload",e),function(){n(),m.length||d.removeEventListener("beforeunload",e)}}}},t.createHashHistory=function(c){function u(){var t=a(p.location.hash.substr(1)),n=t.pathname,e=t.search;t=t.hash;var o=v.state||{};return[o.idx,{pathname:void 0===n?"/":n,search:void 0===e?"":e,hash:void 0===t?"":t,state:o.usr||null,key:o.key||"default"}]}function l(){if(y)P.call(y),y=null;else{var n=t.Action.Pop,e=u(),o=e[0];if(e=e[1],P.length){if(null!=o){var r=b-o;r&&(y={action:n,location:e,retry:function(){d(-1*r)}},d(r))}}else h(n)}}function s(t){var n=document.querySelector("base"),e="";return n&&n.getAttribute("href")&&(e=-1===(e=(n=p.location.href).indexOf("#"))?n:n.slice(0,e)),e+"#"+("string"==typeof t?t:i(t))}function f(t,e){return void 0===e&&(e=null),n({},k,"string"==typeof t?a(t):t,{state:e,key:r()})}function h(t){g=t,t=u(),b=t[0],k=t[1],m.call({action:g,location:k})}function d(t){v.go(t)}void 0===c&&(c={});var p=void 0===(c=c.window)?document.defaultView:c,v=p.history,y=null;p.addEventListener("popstate",l),p.addEventListener("hashchange",(function(){i(u()[1])!==i(k)&&l()}));var g=t.Action.Pop,b=(c=u())[0],k=c[1],m=o(),P=o();return null==b&&(b=0,v.replaceState(n({},v.state,{idx:b}),"")),{get action(){return g},get location(){return k},createHref:s,push:function n(e,o){var r=t.Action.Push,i=f(e,o);if(!P.length||(P.call({action:r,location:i,retry:function(){n(e,o)}}),0)){var a=[{usr:i.state,key:i.key,idx:b+1},s(i)];i=a[0],a=a[1];try{v.pushState(i,"",a)}catch(t){p.location.assign(a)}h(r)}},replace:function n(e,o){var r=t.Action.Replace,i=f(e,o);P.length&&(P.call({action:r,location:i,retry:function(){n(e,o)}}),1)||(i=[{usr:i.state,key:i.key,idx:b},s(i)],v.replaceState(i[0],"",i[1]),h(r))},go:d,back:function(){d(-1)},forward:function(){d(1)},listen:function(t){return m.push(t)},block:function(t){var n=P.push(t);return 1===P.length&&p.addEventListener("beforeunload",e),function(){n(),P.length||p.removeEventListener("beforeunload",e)}}}},t.createMemoryHistory=function(e){function c(t,e){return void 0===e&&(e=null),n({},v,"string"==typeof t?a(t):t,{state:e,key:r()})}function u(t,n,e){return!g.length||(g.call({action:t,location:n,retry:e}),!1)}function l(t,n){p=t,v=n,y.call({action:p,location:v})}function s(n){var e=Math.min(Math.max(d+n,0),h.length-1),o=t.Action.Pop,r=h[e];u(o,r,(function(){s(n)}))&&(d=e,l(o,r))}void 0===e&&(e={});var f=e;e=f.initialEntries,f=f.initialIndex;var h=(void 0===e?["/"]:e).map((function(t){return n({pathname:"/",search:"",hash:"",state:null,key:r()},"string"==typeof t?a(t):t)})),d=Math.min(Math.max(null==f?h.length-1:f,0),h.length-1),p=t.Action.Pop,v=h[d],y=o(),g=o();return{get index(){return d},get action(){return p},get location(){return v},createHref:function(t){return"string"==typeof t?t:i(t)},push:function n(e,o){var r=t.Action.Push,i=c(e,o);u(r,i,(function(){n(e,o)}))&&(d+=1,h.splice(d,h.length,i),l(r,i))},replace:function n(e,o){var r=t.Action.Replace,i=c(e,o);u(r,i,(function(){n(e,o)}))&&(h[d]=i,l(r,i))},go:s,back:function(){s(-1)},forward:function(){s(1)},listen:function(t){return y.push(t)},block:function(t){return g.push(t)}}},t.createPath=i,t.parsePath=a,Object.defineProperty(t,"__esModule",{value:!0})}));
//# sourceMappingURL=history.production.min.js.map

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc