Comparing version 5.0.0-beta.4 to 5.0.0-beta.5
@@ -1,7 +0,7 @@ | ||
function p(){p=Object.assign||function(a){for(var c=1;c<arguments.length;c++){var e=arguments[c],h;for(h in e)Object.prototype.hasOwnProperty.call(e,h)&&(a[h]=e[h])}return a};return p.apply(this,arguments)}var v=__DEV__?function(a){return Object.freeze(a)}:function(a){return a};function w(a,c){if(!a){"undefined"!==typeof console&&console.warn(c);try{throw Error(c);}catch(e){}}} | ||
function A(a){function c(){var b=l.location,a=m.state||{};return[a.idx,v({pathname:b.pathname,search:b.search,hash:b.hash,state:a.usr||null,key:a.key||"default"})]}function e(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=p,g=q;if("string"===typeof b){var e={};if(b){var d=b.indexOf("#");0<=d&&(e.hash=b.substr(d),b=b.substr(0,d));d=b.indexOf("?");0<=d&&(e.search= | ||
b.substr(d),b=b.substr(0,d));b&&(e.pathname=b)}b=e}return v(c({},g,{},b,{state:a,key:Math.random().toString(36).substr(2,8)}))}function t(b){u=b;b=c();k=b[0];q=b[1];x.call({action:u,location:q})}function y(b,a){function c(){y(b,a)}var g=h(b,a);if(!f.length||(f.call({action:"PUSH",location:g,retry:c}),!1)){var d=[{usr:g.state,key:g.key,idx:k+1},e(g)];g=d[0];d=d[1];try{m.pushState(g,null,d)}catch(E){l.location.assign(d)}t("PUSH")}}function z(b,a){function c(){z(b,a)}var d=h(b,a);f.length&&(f.call({action:"REPLACE", | ||
location:d,retry:c}),1)||(d=[{usr:d.state,key:d.key,idx:k},e(d)],m.replaceState(d[0],null,d[1]),t("REPLACE"))}function n(b){m.go(b)}a=(void 0===a?{}:a).window;var l=void 0===a?document.defaultView:a,m=l.history,r=null;l.addEventListener("popstate",function(){if(r)f.call(r),r=null;else{var b=c(),a=b[0];b=b[1];if(f.length)if(null!=a){var e=k-a;e&&(r={action:"POP",location:b,retry:function(){n(-1*e)}},n(e))}else 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."); | ||
else t("POP")}});var u="POP";a=c();var k=a[0],q=a[1],f=B(),x=B();null==k&&(k=0,m.replaceState(p({},m.state,{idx:k}),null));return{get action(){return u},get location(){return q},createHref:e,push:y,replace:z,go:n,back:function(){n(-1)},forward:function(){n(1)},listen:function(a){return x.push(a)},block:function(a){var b=f.push(a);1===f.length&&l.addEventListener("beforeunload",C);return function(){b();f.length||l.removeEventListener("beforeunload",C)}}}} | ||
function C(a){a.preventDefault();a.returnValue=""}function B(){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 D=A();export default D;var createBrowserHistory=A;export{createBrowserHistory}; | ||
function p(){p=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 p.apply(this,arguments)}var v="production"!==process.env.NODE_ENV?function(a){return Object.freeze(a)}:function(a){return a};function w(a,c){if(!a){"undefined"!==typeof console&&console.warn(c);try{throw Error(c);}catch(g){}}}function x(a){a.preventDefault();a.returnValue=""} | ||
function B(){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 C=function(a){function c(){var b=l.location,a=m.state||{};return[a.idx,v({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=p,e=q;if("string"===typeof b){var f={};if(b){var d=b.indexOf("#");0<=d&&(f.hash=b.substr(d),b=b.substr(0,d));d=b.indexOf("?");0<=d&&(f.search= | ||
b.substr(d),b=b.substr(0,d));b&&(f.pathname=b)}b=f}return v(c({},e,{},b,{state:a,key:Math.random().toString(36).substr(2,8)}))}function t(b){u=b;b=c();k=b[0];q=b[1];y.call({action:u,location:q})}function z(b,a){function c(){z(b,a)}var e=h(b,a);if(!d.length||(d.call({action:"PUSH",location:e,retry:c}),!1)){var f=[{usr:e.state,key:e.key,idx:k+1},g(e)];e=f[0];f=f[1];try{m.pushState(e,null,f)}catch(D){l.location.assign(f)}t("PUSH")}}function A(b,a){function c(){A(b,a)}var e=h(b,a);d.length&&(d.call({action:"REPLACE", | ||
location:e,retry:c}),1)||(e=[{usr:e.state,key:e.key,idx:k},g(e)],m.replaceState(e[0],null,e[1]),t("REPLACE"))}function n(a){m.go(a)}a=(void 0===a?{}:a).window;var l=void 0===a?document.defaultView:a,m=l.history,r=null;l.addEventListener("popstate",function(){if(r)d.call(r),r=null;else{var a=c(),f=a[0];a=a[1];if(d.length)if(null!=f){var g=k-f;g&&(r={action:"POP",location:a,retry:function(){n(-1*g)}},n(g))}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 t("POP")}});var u="POP";a=c();var k=a[0],q=a[1],d=B(),y=B();null==k&&(k=0,m.replaceState(p({},m.state,{idx:k}),null));return{get action(){return u},get location(){return q},createHref:g,push:z,replace:A,go:n,back:function(){n(-1)},forward:function(){n(1)},listen:function(a){return y.push(a)},block:function(a){var b=d.push(a);1===d.length&&l.addEventListener("beforeunload",x);return function(){b();d.length||l.removeEventListener("beforeunload",x)}}}}();export default C; | ||
//# sourceMappingURL=browser.js.map |
14
hash.js
@@ -1,8 +0,8 @@ | ||
function p(){p=Object.assign||function(a){for(var c=1;c<arguments.length;c++){var b=arguments[c],f;for(f in b)Object.prototype.hasOwnProperty.call(b,f)&&(a[f]=b[f])}return a};return p.apply(this,arguments)}var r=__DEV__?function(a){return Object.freeze(a)}:function(a){return a};function v(a,c){if(!a){"undefined"!==typeof console&&console.warn(c);try{throw Error(c);}catch(b){}}} | ||
function x(a){function c(){var a=y(g.location.hash.substr(1)),c=a.pathname,b=a.search;a=a.hash;var d=k.state||{};return[d.idx,r({pathname:void 0===c?"/":c,search:void 0===b?"":b,hash:void 0===a?"":a,state:d.usr||null,key:d.key||"default"})]}function b(){if(q)e.call(q),q=null;else{var a=c(),b=a[0];a=a[1];if(e.length)if(null!=b){var t=h-b;t&&(q={action:"POP",location:a,retry:function(){m(-1*t)}},m(t))}else v(!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 u("POP")}}function f(a){var b=document.querySelector("base"),c="";b&&b.getAttribute("href")&&(b=g.location.href,c=b.indexOf("#"),c=-1===c?b:b.slice(0,c));return c+"#"+("string"===typeof a?a:z(a))}function A(a,b){void 0===b&&(b=null);return r(p({},n,{},"string"===typeof a?y(a):a,{state:b,key:Math.random().toString(36).substr(2,8)}))}function u(a){w=a;a=c();h=a[0];n=a[1];B.call({action:w,location:n})}function C(a,b){function c(){C(a,b)}var d=A(a,b);v("/"===d.pathname.charAt(0),"Relative pathnames are not supported in hash history.push("+ | ||
JSON.stringify(a)+")");if(!e.length||(e.call({action:"PUSH",location:d,retry:c}),!1)){var l=[{usr:d.state,key:d.key,idx:h+1},f(d)];d=l[0];l=l[1];try{k.pushState(d,null,l)}catch(H){g.location.assign(l)}u("PUSH")}}function D(a,b){function c(){D(a,b)}var d=A(a,b);v("/"===d.pathname.charAt(0),"Relative pathnames are not supported in hash history.replace("+JSON.stringify(a)+")");e.length&&(e.call({action:"REPLACE",location:d,retry:c}),1)||(d=[{usr:d.state,key:d.key,idx:h},f(d)],k.replaceState(d[0],null, | ||
d[1]),u("REPLACE"))}function m(a){k.go(a)}a=(void 0===a?{}:a).window;var g=void 0===a?document.defaultView:a,k=g.history,q=null;g.addEventListener("popstate",b);g.addEventListener("hashchange",function(){var a=c()[1];z(a)!==z(n)&&b()});var w="POP";a=c();var h=a[0],n=a[1],e=E(),B=E();null==h&&(h=0,k.replaceState(p({},k.state,{idx:h}),null));return{get action(){return w},get location(){return n},createHref:f,push:C,replace:D,go:m,back:function(){m(-1)},forward:function(){m(1)},listen:function(a){return B.push(a)}, | ||
block:function(a){var b=e.push(a);1===e.length&&g.addEventListener("beforeunload",F);return function(){b();e.length||g.removeEventListener("beforeunload",F)}}}}function F(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)})}}} | ||
function z(a){var c=a.pathname,b=a.search;a=a.hash;return(void 0===c?"/":c)+(void 0===b?"":b)+(void 0===a?"":a)}function y(a){var c={};if(a){var b=a.indexOf("#");0<=b&&(c.hash=a.substr(b),a=a.substr(0,b));b=a.indexOf("?");0<=b&&(c.search=a.substr(b),a=a.substr(0,b));a&&(c.pathname=a)}return c}var G=x();export default G;var createHashHistory=x;export{createHashHistory}; | ||
function p(){p=Object.assign||function(a){for(var b=1;b<arguments.length;b++){var c=arguments[b],f;for(f in c)Object.prototype.hasOwnProperty.call(c,f)&&(a[f]=c[f])}return a};return p.apply(this,arguments)}var r="production"!==process.env.NODE_ENV?function(a){return Object.freeze(a)}:function(a){return a};function t(a,b){if(!a){"undefined"!==typeof console&&console.warn(b);try{throw Error(b);}catch(c){}}}function x(a){a.preventDefault();a.returnValue=""} | ||
function y(){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 z(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 A(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 F=function(a){function b(){var a=A(g.location.hash.substr(1)),b=a.pathname,c=a.search;a=a.hash;var d=k.state||{};return[d.idx,r({pathname:void 0===b?"/":b,search:void 0===c?"":c,hash:void 0===a?"":a,state:d.usr||null,key:d.key||"default"})]}function c(){if(q)e.call(q),q=null;else{var a=b(),c=a[0];a=a[1];if(e.length)if(null!=c){var u=h-c;u&&(q={action:"POP",location:a,retry:function(){m(-1*u)}},m(u))}else"production"!==process.env.NODE_ENV?t(!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("POP")}}function f(a){var b=document.querySelector("base"),c="";b&&b.getAttribute("href")&&(b=g.location.href,c=b.indexOf("#"),c=-1===c?b:b.slice(0,c));return c+"#"+("string"===typeof a?a:z(a))}function B(a,b){void 0===b&&(b=null);return r(p({},n,{},"string"===typeof a?A(a):a,{state:b,key:Math.random().toString(36).substr(2,8)}))}function v(a){w=a;a=b();h=a[0];n=a[1];C.call({action:w,location:n})}function D(a,b){function c(){D(a,b)}var d=B(a,b);"production"!==process.env.NODE_ENV?t("/"=== | ||
d.pathname.charAt(0),"Relative pathnames are not supported in hash history.push("+JSON.stringify(a)+")"):void 0;if(!e.length||(e.call({action:"PUSH",location:d,retry:c}),!1)){var l=[{usr:d.state,key:d.key,idx:h+1},f(d)];d=l[0];l=l[1];try{k.pushState(d,null,l)}catch(G){g.location.assign(l)}v("PUSH")}}function E(a,b){function c(){E(a,b)}var d=B(a,b);"production"!==process.env.NODE_ENV?t("/"===d.pathname.charAt(0),"Relative pathnames are not supported in hash history.replace("+JSON.stringify(a)+")"): | ||
void 0;e.length&&(e.call({action:"REPLACE",location:d,retry:c}),1)||(d=[{usr:d.state,key:d.key,idx:h},f(d)],k.replaceState(d[0],null,d[1]),v("REPLACE"))}function m(a){k.go(a)}a=(void 0===a?{}:a).window;var g=void 0===a?document.defaultView:a,k=g.history,q=null;g.addEventListener("popstate",c);g.addEventListener("hashchange",function(){var a=b()[1];z(a)!==z(n)&&c()});var w="POP";a=b();var h=a[0],n=a[1],e=y(),C=y();null==h&&(h=0,k.replaceState(p({},k.state,{idx:h}),null));return{get action(){return w}, | ||
get location(){return n},createHref:f,push:D,replace:E,go:m,back:function(){m(-1)},forward:function(){m(1)},listen:function(a){return C.push(a)},block:function(a){var b=e.push(a);1===e.length&&g.addEventListener("beforeunload",x);return function(){b();e.length||g.removeEventListener("beforeunload",x)}}}}();export default F; | ||
//# sourceMappingURL=hash.js.map |
@@ -1,16 +0,15 @@ | ||
function w(a,d){if(!a){"undefined"!==typeof console&&console.warn(d);try{throw Error(d);}catch(g){}}}function x(a){a.preventDefault();a.returnValue=""}function y(){let a=[];return{get length(){return a.length},push(d){a.push(d);return function(){a=a.filter(a=>a!==d)}},call(d){a.forEach(a=>a&&a(d))}}}function z(){return Math.random().toString(36).substr(2,8)}function A(a){var {pathname:d="/",search:g="",hash:p=""}=a;return d+g+p} | ||
function B(a){let 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)}return d} | ||
var createBrowserHistory=function(a){function d(){let {pathname:c,search:b,hash:e}=n.location,a=f.state||{};return[a.idx,Object.freeze({pathname:c,search:b,hash:e,state:a.usr||null,key:a.key||"default"})]}function g(c){return"string"===typeof c?c:A(c)}function p(c,b){b=void 0===b?null:b;return Object.freeze(Object.assign({},m,"string"===typeof c?B(c):c,{state:b,key:z()}))}function u(c){q=c;[k,m]=d();e.call({action:q,location:m})}function v(c,b){function e(){v(c,b)}let a=p(c,b);if(!l.length||(l.call({action:"PUSH", | ||
location:a,retry:e}),!1)){let [b,c]=[{usr:a.state,key:a.key,idx:k+1},g(a)];try{f.pushState(b,null,c)}catch(C){n.location.assign(c)}u("PUSH")}}function r(c,b){function e(){r(c,b)}let a=p(c,b);if(!l.length||(l.call({action:"REPLACE",location:a,retry:e}),!1)){let [b,c]=[{usr:a.state,key:a.key,idx:k},g(a)];f.replaceState(b,null,c);u("REPLACE")}}function t(c){f.go(c)}var {window:n=document.defaultView}=void 0===a?{}:a;let f=n.history,h=null;n.addEventListener("popstate",function(){if(h)l.call(h),h=null; | ||
else{let [c,b]=d();if(l.length)if(null!=c){let a=k-c;a&&(h={action:"POP",location:b,retry(){t(-1*a)}},t(a))}else 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.");else u("POP")}});let q="POP",[k,m]=d(),l=y(),e=y();null==k&&(k=0,f.replaceState(Object.assign({}, | ||
f.state,{idx:k}),null));return{get action(){return q},get location(){return m},createHref:g,push:v,replace:r,go:t,back(){t(-1)},forward(){t(1)},listen(a){return e.push(a)},block(a){let b=l.push(a);1===l.length&&n.addEventListener("beforeunload",x);return function(){b();l.length||n.removeEventListener("beforeunload",x)}}}}; | ||
var createHashHistory=function(a){function d(){let {pathname:b="/",search:a="",hash:c=""}=B(f.location.hash.substr(1)),e=h.state||{};return[e.idx,Object.freeze({pathname:b,search:a,hash:c,state:e.usr||null,key:e.key||"default"})]}function g(){if(q)e.call(q),q=null;else{let [b,a]=d();if(e.length)if(null!=b){let e=m-b;e&&(q={action:"POP",location:a,retry(){n(-1*e)}},n(e))}else 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."); | ||
else v("POP")}}function p(a){var b=document.querySelector("base");var e="";b&&b.getAttribute("href")&&(b=f.location.href,e=b.indexOf("#"),e=-1===e?b:b.slice(0,e));b=e;return b+"#"+("string"===typeof a?a:A(a))}function u(b,a){a=void 0===a?null:a;return Object.freeze(Object.assign({},l,"string"===typeof b?B(b):b,{state:a,key:z()}))}function v(a){k=a;[m,l]=d();c.call({action:k,location:l})}function r(a,c){function b(){r(a,c)}let d=u(a,c);w("/"===d.pathname.charAt(0),`Relative pathnames are not supported in hash history.push(${JSON.stringify(a)})`); | ||
if(!e.length||(e.call({action:"PUSH",location:d,retry:b}),!1)){let [a,b]=[{usr:d.state,key:d.key,idx:m+1},p(d)];try{h.pushState(a,null,b)}catch(D){f.location.assign(b)}v("PUSH")}}function t(a,c){function b(){t(a,c)}let d=u(a,c);w("/"===d.pathname.charAt(0),`Relative pathnames are not supported in hash history.replace(${JSON.stringify(a)})`);if(!e.length||(e.call({action:"REPLACE",location:d,retry:b}),!1)){let [a,b]=[{usr:d.state,key:d.key,idx:m},p(d)];h.replaceState(a,null,b);v("REPLACE")}}function n(a){h.go(a)} | ||
var {window:f=document.defaultView}=void 0===a?{}:a;let h=f.history,q=null;f.addEventListener("popstate",g);f.addEventListener("hashchange",()=>{let [,a]=d();A(a)!==A(l)&&g()});let k="POP",[m,l]=d(),e=y(),c=y();null==m&&(m=0,h.replaceState(Object.assign({},h.state,{idx:m}),null));return{get action(){return k},get location(){return l},createHref:p,push:r,replace:t,go:n,back(){n(-1)},forward(){n(1)},listen(a){return c.push(a)},block(a){let b=e.push(a);1===e.length&&f.addEventListener("beforeunload", | ||
x);return function(){b();e.length||f.removeEventListener("beforeunload",x)}}}}; | ||
var createMemoryHistory=function(a){function d(a,c){c=void 0===c?null:c;return Object.freeze(Object.assign({},k,"string"===typeof a?B(a):a,{state:c,key:z()}))}function g(a,c,b){return!m.length||(m.call({action:a,location:c,retry:b}),!1)}function p(a,c){q=a;k=c;l.call({action:q,location:k})}function u(a,c){let b=d(a,c);w("/"===k.pathname.charAt(0),`Relative pathnames are not supported in memory history.push(${JSON.stringify(a)})`);g("PUSH",b,function(){u(a,c)})&&(h+=1,f.splice(h,f.length,b),p("PUSH", | ||
b))}function v(a,c){let b=d(a,c);w("/"===k.pathname.charAt(0),`Relative pathnames are not supported in memory history.replace(${JSON.stringify(a)})`);g("REPLACE",b,function(){v(a,c)})&&(f[h]=b,p("REPLACE",b))}function r(a){let c=Math.min(Math.max(h+a,0),f.length-1),b=f[c];g("POP",b,function(){r(a)})&&(h=c,p("POP",b))}var {initialEntries:t=["/"],initialIndex:n=0}=void 0===a?{}:a;let f=t.map(a=>{let c=Object.freeze(Object.assign({},{pathname:"/",search:"",hash:"",state:null,key:z()},"string"===typeof a? | ||
B(a):a));w("/"===c.pathname.charAt(0),`Relative pathnames are not supported in createMemoryHistory({ initialEntries }) (invalid entry: ${JSON.stringify(a)})`);return c}),h=Math.min(Math.max(n,0),f.length-1),q="POP",k=f[h],m=y(),l=y();return{get index(){return h},get action(){return q},get location(){return k},createHref:function(a){return"string"===typeof a?a:A(a)},push:u,replace:v,go:r,back(){r(-1)},forward(){r(1)},listen(a){return l.push(a)},block(a){return m.push(a)}}};var createPath=A; | ||
var parsePath=B;export{createBrowserHistory,createHashHistory,createMemoryHistory,createPath,parsePath}; | ||
function w(a,e){if(!a){"undefined"!==typeof console&&console.warn(e);try{throw Error(e);}catch(f){}}}function x(a){a.preventDefault();a.returnValue=""}function y(){let a=[];return{get length(){return a.length},push(e){a.push(e);return function(){a=a.filter(a=>a!==e)}},call(e){a.forEach(a=>a&&a(e))}}}function z(){return Math.random().toString(36).substr(2,8)}function A({pathname:a="/",search:e="",hash:f=""}){return a+e+f} | ||
function B(a){let e={};if(a){var f=a.indexOf("#");0<=f&&(e.hash=a.substr(f),a=a.substr(0,f));f=a.indexOf("?");0<=f&&(e.search=a.substr(f),a=a.substr(0,f));a&&(e.pathname=a)}return e} | ||
function createBrowserHistory({window:a=document.defaultView}={}){function e(){let {pathname:d,search:c,hash:b}=a.location,u=g.state||{};return[u.idx,Object.freeze({pathname:d,search:c,hash:b,state:u.usr||null,key:u.key||"default"})]}function f(a){return"string"===typeof a?a:A(a)}function q(a,c=null){return Object.freeze({...m,..."string"===typeof a?B(a):a,state:c,key:z()})}function r(a){p=a;[k,m]=e();b.call({action:p,location:m})}function t(b,c){function d(){t(b,c)}let u=q(b,c);if(!l.length|| | ||
(l.call({action:"PUSH",location:u,retry:d}),!1)){let [c,b]=[{usr:u.state,key:u.key,idx:k+1},f(u)];try{g.pushState(c,null,b)}catch(C){a.location.assign(b)}r("PUSH")}}function v(a,c){function b(){v(a,c)}let d=q(a,c);if(!l.length||(l.call({action:"REPLACE",location:d,retry:b}),!1)){let [a,c]=[{usr:d.state,key:d.key,idx:k},f(d)];g.replaceState(a,null,c);r("REPLACE")}}function n(a){g.go(a)}let g=a.history,h=null;a.addEventListener("popstate",function(){if(h)l.call(h),h=null;else{let [a,c]=e();if(l.length)if(null!= | ||
a){let b=k-a;b&&(h={action:"POP",location:c,retry(){n(-1*b)}},n(b))}else 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.");else r("POP")}});let p="POP",[k,m]=e(),l=y(),b=y();null==k&&(k=0,g.replaceState({...g.state,idx:k},null));return{get action(){return p}, | ||
get location(){return m},createHref:f,push:t,replace:v,go:n,back(){n(-1)},forward(){n(1)},listen(a){return b.push(a)},block(b){let c=l.push(b);1===l.length&&a.addEventListener("beforeunload",x);return function(){c();l.length||a.removeEventListener("beforeunload",x)}}}}; | ||
function createHashHistory({window:a=document.defaultView}={}){function e(){let {pathname:c="/",search:b="",hash:d=""}=B(a.location.hash.substr(1)),e=h.state||{};return[e.idx,Object.freeze({pathname:c,search:b,hash:d,state:e.usr||null,key:e.key||"default"})]}function f(){if(p)b.call(p),p=null;else{let [a,d]=e();if(b.length)if(null!=a){let b=m-a;b&&(p={action:"POP",location:d,retry(){g(-1*b)}},g(b))}else 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."); | ||
else t("POP")}}function q(b){var c=document.querySelector("base");var d="";c&&c.getAttribute("href")&&(c=a.location.href,d=c.indexOf("#"),d=-1===d?c:c.slice(0,d));c=d;return c+"#"+("string"===typeof b?b:A(b))}function r(a,b=null){return Object.freeze({...l,..."string"===typeof a?B(a):a,state:b,key:z()})}function t(a){k=a;[m,l]=e();d.call({action:k,location:l})}function v(c,d){function e(){v(c,d)}let f=r(c,d);w("/"===f.pathname.charAt(0),`Relative pathnames are not supported in hash history.push(${JSON.stringify(c)})`); | ||
if(!b.length||(b.call({action:"PUSH",location:f,retry:e}),!1)){let [b,c]=[{usr:f.state,key:f.key,idx:m+1},q(f)];try{h.pushState(b,null,c)}catch(D){a.location.assign(c)}t("PUSH")}}function n(a,d){function c(){n(a,d)}let e=r(a,d);w("/"===e.pathname.charAt(0),`Relative pathnames are not supported in hash history.replace(${JSON.stringify(a)})`);if(!b.length||(b.call({action:"REPLACE",location:e,retry:c}),!1)){let [a,b]=[{usr:e.state,key:e.key,idx:m},q(e)];h.replaceState(a,null,b);t("REPLACE")}}function g(a){h.go(a)} | ||
let h=a.history,p=null;a.addEventListener("popstate",f);a.addEventListener("hashchange",()=>{let [,a]=e();A(a)!==A(l)&&f()});let k="POP",[m,l]=e(),b=y(),d=y();null==m&&(m=0,h.replaceState({...h.state,idx:m},null));return{get action(){return k},get location(){return l},createHref:q,push:v,replace:n,go:g,back(){g(-1)},forward(){g(1)},listen(a){return d.push(a)},block(c){let d=b.push(c);1===b.length&&a.addEventListener("beforeunload",x);return function(){d();b.length||a.removeEventListener("beforeunload", | ||
x)}}}}; | ||
function createMemoryHistory({initialEntries:a=["/"],initialIndex:e=0}={}){function f(a,d=null){return Object.freeze({...k,..."string"===typeof a?B(a):a,state:d,key:z()})}function q(a,d,c){return!m.length||(m.call({action:a,location:d,retry:c}),!1)}function r(a,d){p=a;k=d;l.call({action:p,location:k})}function t(a,d){let b=f(a,d);w("/"===k.pathname.charAt(0),`Relative pathnames are not supported in memory history.push(${JSON.stringify(a)})`);q("PUSH",b,function(){t(a,d)})&&(h+=1,g.splice(h,g.length, | ||
b),r("PUSH",b))}function v(a,d){let b=f(a,d);w("/"===k.pathname.charAt(0),`Relative pathnames are not supported in memory history.replace(${JSON.stringify(a)})`);q("REPLACE",b,function(){v(a,d)})&&(g[h]=b,r("REPLACE",b))}function n(a){let b=Math.min(Math.max(h+a,0),g.length-1),c=g[b];q("POP",c,function(){n(a)})&&(h=b,r("POP",c))}let g=a.map(a=>{let b=Object.freeze({pathname:"/",search:"",hash:"",state:null,key:z(),..."string"===typeof a?B(a):a});w("/"===b.pathname.charAt(0),`Relative pathnames are not supported in createMemoryHistory({ initialEntries }) (invalid entry: ${JSON.stringify(a)})`); | ||
return b}),h=Math.min(Math.max(e,0),g.length-1),p="POP",k=g[h],m=y(),l=y();return{get index(){return h},get action(){return p},get location(){return k},createHref:function(a){return"string"===typeof a?a:A(a)},push:t,replace:v,go:n,back(){n(-1)},forward(){n(1)},listen(a){return l.push(a)},block(a){return m.push(a)}}};export{createBrowserHistory,createHashHistory,createMemoryHistory,A as createPath,B as parsePath} | ||
//# sourceMappingURL=history.development.js.map |
@@ -1,8 +0,8 @@ | ||
import _extends from '@babel/runtime/helpers/esm/extends';var w="production"!==process.env.NODE_ENV?function(a){return Object.freeze(a)}:function(a){return a};function x(a,f){if(!a){"undefined"!==typeof console&&console.warn(f);try{throw Error(f);}catch(h){}}}function y(a){a.preventDefault();a.returnValue=""}function z(){var a=[];return{get length(){return a.length},push:function(f){a.push(f);return function(){a=a.filter(function(a){return a!==f})}},call:function(f){a.forEach(function(a){return a&&a(f)})}}} | ||
import _extends from'@babel/runtime/helpers/esm/extends';var w="production"!==process.env.NODE_ENV?function(a){return Object.freeze(a)}:function(a){return a};function x(a,f){if(!a){"undefined"!==typeof console&&console.warn(f);try{throw Error(f);}catch(h){}}}function y(a){a.preventDefault();a.returnValue=""}function z(){var a=[];return{get length(){return a.length},push:function(f){a.push(f);return function(){a=a.filter(function(a){return a!==f})}},call:function(f){a.forEach(function(a){return a&&a(f)})}}} | ||
function A(){return Math.random().toString(36).substr(2,8)}function C(a){var f=a.pathname,h=a.search;a=a.hash;return(void 0===f?"/":f)+(void 0===h?"":h)+(void 0===a?"":a)}function D(a){var f={};if(a){var h=a.indexOf("#");0<=h&&(f.hash=a.substr(h),a=a.substr(0,h));h=a.indexOf("?");0<=h&&(f.search=a.substr(h),a=a.substr(0,h));a&&(f.pathname=a)}return f} | ||
var createBrowserHistory=function(a){function f(){var a=k.location,e=g.state||{};return[e.idx,w({pathname:a.pathname,search:a.search,hash:a.hash,state:e.usr||null,key:e.key||"default"})]}function h(a){return"string"===typeof a?a:C(a)}function r(a,e){void 0===e&&(e=null);return w(_extends({},m,{},"string"===typeof a?D(a):a,{state:e,key:A()}))}function u(a){n=a;a=f();p=a[0];m=a[1];c.call({action:n,location:m})}function v(a,e){function c(){v(a,e)}var B=r(a,e);if(!b.length||(b.call({action:"PUSH", | ||
function createBrowserHistory(a){function f(){var a=k.location,e=g.state||{};return[e.idx,w({pathname:a.pathname,search:a.search,hash:a.hash,state:e.usr||null,key:e.key||"default"})]}function h(a){return"string"===typeof a?a:C(a)}function r(a,e){void 0===e&&(e=null);return w(_extends({},m,{},"string"===typeof a?D(a):a,{state:e,key:A()}))}function u(a){n=a;a=f();p=a[0];m=a[1];c.call({action:n,location:m})}function v(a,e){function c(){v(a,e)}var B=r(a,e);if(!b.length||(b.call({action:"PUSH", | ||
location:B,retry:c}),!1)){var d=[{usr:B.state,key:B.key,idx:p+1},h(B)];B=d[0];d=d[1];try{g.pushState(B,null,d)}catch(E){k.location.assign(d)}u("PUSH")}}function t(a,e){function c(){t(a,e)}var d=r(a,e);b.length&&(b.call({action:"REPLACE",location:d,retry:c}),1)||(d=[{usr:d.state,key:d.key,idx:p},h(d)],g.replaceState(d[0],null,d[1]),u("REPLACE"))}function l(a){g.go(a)}a=(void 0===a?{}:a).window;var k=void 0===a?document.defaultView:a,g=k.history,q=null;k.addEventListener("popstate",function(){if(q)b.call(q), | ||
q=null;else{var a=f(),e=a[0];a=a[1];if(b.length)if(null!=e){var c=p-e;c&&(q={action:"POP",location:a,retry:function(){l(-1*c)}},l(c))}else"production"!==process.env.NODE_ENV?x(!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 u("POP")}});var n= | ||
"POP";a=f();var p=a[0],m=a[1],b=z(),c=z();null==p&&(p=0,g.replaceState(_extends({},g.state,{idx:p}),null));return{get action(){return n},get location(){return m},createHref:h,push:v,replace:t,go:l,back:function(){l(-1)},forward:function(){l(1)},listen:function(a){return c.push(a)},block:function(a){var e=b.push(a);1===b.length&&k.addEventListener("beforeunload",y);return function(){e();b.length||k.removeEventListener("beforeunload",y)}}}}; | ||
var createHashHistory=function(a){function f(){var a=D(g.location.hash.substr(1)),b=a.pathname,c=a.search;a=a.hash;var d=q.state||{};return[d.idx,w({pathname:void 0===b?"/":b,search:void 0===c?"":c,hash:void 0===a?"":a,state:d.usr||null,key:d.key||"default"})]}function h(){if(n)c.call(n),n=null;else{var a=f(),b=a[0];a=a[1];if(c.length)if(null!=b){var d=m-b;d&&(n={action:"POP",location:a,retry:function(){k(-1*d)}},k(d))}else"production"!==process.env.NODE_ENV?x(!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."): | ||
function createHashHistory(a){function f(){var a=D(g.location.hash.substr(1)),b=a.pathname,c=a.search;a=a.hash;var d=q.state||{};return[d.idx,w({pathname:void 0===b?"/":b,search:void 0===c?"":c,hash:void 0===a?"":a,state:d.usr||null,key:d.key||"default"})]}function h(){if(n)c.call(n),n=null;else{var a=f(),b=a[0];a=a[1];if(c.length)if(null!=b){var d=m-b;d&&(n={action:"POP",location:a,retry:function(){k(-1*d)}},k(d))}else"production"!==process.env.NODE_ENV?x(!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("POP")}}function r(a){var b=document.querySelector("base"),e="";b&&b.getAttribute("href")&&(b=g.location.href,e=b.indexOf("#"),e=-1===e?b:b.slice(0,e));return e+"#"+("string"===typeof a?a:C(a))}function u(a,c){void 0===c&&(c=null);return w(_extends({},b,{},"string"===typeof a?D(a):a,{state:c,key:A()}))}function v(a){p=a;a=f();m=a[0];b=a[1];d.call({action:p,location:b})}function t(a,b){function d(){t(a,b)}var e=u(a,b);"production"!==process.env.NODE_ENV?x("/"===e.pathname.charAt(0),"Relative pathnames are not supported in hash history.push("+ | ||
@@ -12,6 +12,6 @@ JSON.stringify(a)+")"):void 0;if(!c.length||(c.call({action:"PUSH",location:e,retry:d}),!1)){var f=[{usr:e.state,key:e.key,idx:m+1},r(e)];e=f[0];f=f[1];try{q.pushState(e,null,f)}catch(F){g.location.assign(f)}v("PUSH")}}function l(a,b){function e(){l(a,b)}var d=u(a,b);"production"!==process.env.NODE_ENV?x("/"===d.pathname.charAt(0),"Relative pathnames are not supported in hash history.replace("+JSON.stringify(a)+")"):void 0;c.length&&(c.call({action:"REPLACE",location:d,retry:e}),1)||(d=[{usr:d.state, | ||
forward:function(){k(1)},listen:function(a){return d.push(a)},block:function(a){var b=c.push(a);1===c.length&&g.addEventListener("beforeunload",y);return function(){b();c.length||g.removeEventListener("beforeunload",y)}}}}; | ||
var createMemoryHistory=function(a){function f(a,c){void 0===c&&(c=null);return w(_extends({},n,{},"string"===typeof a?D(a):a,{state:c,key:A()}))}function h(a,c,d){return!p.length||(p.call({action:a,location:c,retry:d}),!1)}function r(a,c){q=a;n=c;m.call({action:q,location:n})}function u(a,c){var b=f(a,c);"production"!==process.env.NODE_ENV?x("/"===n.pathname.charAt(0),"Relative pathnames are not supported in memory history.push("+JSON.stringify(a)+")"):void 0;h("PUSH",b,function(){u(a,c)})&&(g+= | ||
function createMemoryHistory(a){function f(a,c){void 0===c&&(c=null);return w(_extends({},n,{},"string"===typeof a?D(a):a,{state:c,key:A()}))}function h(a,c,d){return!p.length||(p.call({action:a,location:c,retry:d}),!1)}function r(a,c){q=a;n=c;m.call({action:q,location:n})}function u(a,c){var b=f(a,c);"production"!==process.env.NODE_ENV?x("/"===n.pathname.charAt(0),"Relative pathnames are not supported in memory history.push("+JSON.stringify(a)+")"):void 0;h("PUSH",b,function(){u(a,c)})&&(g+= | ||
1,k.splice(g,k.length,b),r("PUSH",b))}function v(a,c){var b=f(a,c);"production"!==process.env.NODE_ENV?x("/"===n.pathname.charAt(0),"Relative pathnames are not supported in memory history.replace("+JSON.stringify(a)+")"):void 0;h("REPLACE",b,function(){v(a,c)})&&(k[g]=b,r("REPLACE",b))}function t(a){var b=Math.min(Math.max(g+a,0),k.length-1),d=k[b];h("POP",d,function(){t(a)})&&(g=b,r("POP",d))}var l=void 0===a?{}:a;a=l.initialEntries;l=l.initialIndex;l=void 0===l?0:l;var k=(void 0===a?["/"]:a).map(function(a){var b= | ||
w(_extends({pathname:"/",search:"",hash:"",state:null,key:A()},"string"===typeof a?D(a):a));"production"!==process.env.NODE_ENV?x("/"===b.pathname.charAt(0),"Relative pathnames are not supported in createMemoryHistory({ initialEntries }) (invalid entry: "+JSON.stringify(a)+")"):void 0;return b}),g=Math.min(Math.max(l,0),k.length-1),q="POP",n=k[g],p=z(),m=z();return{get index(){return g},get action(){return q},get location(){return n},createHref:function(a){return"string"===typeof a?a:C(a)},push:u, | ||
replace:v,go:t,back:function(){t(-1)},forward:function(){t(1)},listen:function(a){return m.push(a)},block:function(a){return p.push(a)}}};var createPath=C;var parsePath=D;export{createBrowserHistory,createHashHistory,createMemoryHistory,createPath,parsePath}; | ||
replace:v,go:t,back:function(){t(-1)},forward:function(){t(1)},listen:function(a){return m.push(a)},block:function(a){return p.push(a)}}};export{createBrowserHistory,createHashHistory,createMemoryHistory,C as createPath,D as parsePath} | ||
//# sourceMappingURL=history.js.map |
@@ -1,2 +0,2 @@ | ||
function t(t){t.preventDefault(),t.returnValue=""}function e(){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 n(){return Math.random().toString(36).substr(2,8)}function a(t){var{pathname:e="/",search:n="",hash:a=""}=t;return e+n+a}function l(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}var r=function(r){function i(){let{pathname:t,search:e,hash:n}=f.location,a=h.state||{};return[a.idx,{pathname:t,search:e,hash:n,state:a.usr||null,key:a.key||"default"}]}function o(t){return"string"==typeof t?t:a(t)}function u(t,e){return e=void 0===e?null:e,Object.assign({},y,"string"==typeof t?l(t):t,{state:e,key:n()})}function c(t){d=t,[p,y]=i(),b.call({action:d,location:y})}function s(t){h.go(t)}var{window:f=document.defaultView}=void 0===r?{}:r;let h=f.history,g=null;f.addEventListener("popstate",(function(){if(g)P.call(g),g=null;else{let[t,e]=i();if(P.length){if(null!=t){let n=p-t;n&&(g={action:"POP",location:e,retry(){s(-1*n)}},s(n))}}else c("POP")}}));let d="POP",[p,y]=i(),P=e(),b=e();return null==p&&(p=0,h.replaceState(Object.assign({},h.state,{idx:p}),null)),{get action(){return d},get location(){return y},createHref:o,push:function t(e,n){let a=u(e,n);if(!P.length||(P.call({action:"PUSH",location:a,retry:function(){t(e,n)}}),0)){let[t,e]=[{usr:a.state,key:a.key,idx:p+1},o(a)];try{h.pushState(t,null,e)}catch(l){f.location.assign(e)}c("PUSH")}},replace:function t(e,n){let a=u(e,n);if(!P.length||(P.call({action:"REPLACE",location:a,retry:function(){t(e,n)}}),0)){let[t,e]=[{usr:a.state,key:a.key,idx:p},o(a)];h.replaceState(t,null,e),c("REPLACE")}},go:s,back(){s(-1)},forward(){s(1)},listen:t=>b.push(t),block(e){let n=P.push(e);return 1===P.length&&f.addEventListener("beforeunload",t),function(){n(),P.length||f.removeEventListener("beforeunload",t)}}}},i=function(r){function i(){let{pathname:t="/",search:e="",hash:n=""}=l(h.location.hash.substr(1)),a=g.state||{};return[a.idx,{pathname:t,search:e,hash:n,state:a.usr||null,key:a.key||"default"}]}function o(){if(d)b.call(d),d=null;else{let[t,e]=i();if(b.length){if(null!=t){let n=y-t;n&&(d={action:"POP",location:e,retry(){f(-1*n)}},f(n))}}else s("POP")}}function u(t){var e=document.querySelector("base"),n="";return e&&e.getAttribute("href")&&(n=-1===(n=(e=h.location.href).indexOf("#"))?e:e.slice(0,n)),(e=n)+"#"+("string"==typeof t?t:a(t))}function c(t,e){return e=void 0===e?null:e,Object.assign({},P,"string"==typeof t?l(t):t,{state:e,key:n()})}function s(t){p=t,[y,P]=i(),v.call({action:p,location:P})}function f(t){g.go(t)}var{window:h=document.defaultView}=void 0===r?{}:r;let g=h.history,d=null;h.addEventListener("popstate",o),h.addEventListener("hashchange",()=>{let[,t]=i();a(t)!==a(P)&&o()});let p="POP",[y,P]=i(),b=e(),v=e();return null==y&&(y=0,g.replaceState(Object.assign({},g.state,{idx:y}),null)),{get action(){return p},get location(){return P},createHref:u,push:function t(e,n){let a=c(e,n);if(!b.length||(b.call({action:"PUSH",location:a,retry:function(){t(e,n)}}),0)){let[t,e]=[{usr:a.state,key:a.key,idx:y+1},u(a)];try{g.pushState(t,null,e)}catch(l){h.location.assign(e)}s("PUSH")}},replace:function t(e,n){let a=c(e,n);if(!b.length||(b.call({action:"REPLACE",location:a,retry:function(){t(e,n)}}),0)){let[t,e]=[{usr:a.state,key:a.key,idx:y},u(a)];g.replaceState(t,null,e),s("REPLACE")}},go:f,back(){f(-1)},forward(){f(1)},listen:t=>v.push(t),block(e){let n=b.push(e);return 1===b.length&&h.addEventListener("beforeunload",t),function(){n(),b.length||h.removeEventListener("beforeunload",t)}}}},o=function(t){function r(t,e){return e=void 0===e?null:e,Object.assign({},d,"string"==typeof t?l(t):t,{state:e,key:n()})}function i(t,e,n){return!p.length||(p.call({action:t,location:e,retry:n}),!1)}function o(t,e){g=t,d=e,y.call({action:g,location:d})}function u(t){let e=Math.min(Math.max(h+t,0),f.length-1),n=f[e];i("POP",n,(function(){u(t)}))&&(h=e,o("POP",n))}var{initialEntries:c=["/"],initialIndex:s=0}=void 0===t?{}:t;let f=c.map(t=>Object.assign({},{pathname:"/",search:"",hash:"",state:null,key:n()},"string"==typeof t?l(t):t)),h=Math.min(Math.max(s,0),f.length-1),g="POP",d=f[h],p=e(),y=e();return{get index(){return h},get action(){return g},get location(){return d},createHref:function(t){return"string"==typeof t?t:a(t)},push:function t(e,n){let a=r(e,n);i("PUSH",a,(function(){t(e,n)}))&&(h+=1,f.splice(h,f.length,a),o("PUSH",a))},replace:function t(e,n){let a=r(e,n);i("REPLACE",a,(function(){t(e,n)}))&&(f[h]=a,o("REPLACE",a))},go:u,back(){u(-1)},forward(){u(1)},listen:t=>y.push(t),block:t=>p.push(t)}},u=a,c=l;export{r as createBrowserHistory,i as createHashHistory,o as createMemoryHistory,u as createPath,c as parsePath}; | ||
function t(t){t.preventDefault(),t.returnValue=""}function e(){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 n(){return Math.random().toString(36).substr(2,8)}function l({pathname:t="/",search:e="",hash:n=""}){return t+e+n}function a(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 r({window:r=document.defaultView}={}){function i(){let{pathname:t,search:e,hash:n}=r.location,l=f.state||{};return[l.idx,{pathname:t,search:e,hash:n,state:l.usr||null,key:l.key||"default"}]}function o(t){return"string"==typeof t?t:l(t)}function u(t,e=null){return{...d,..."string"==typeof t?a(t):t,state:e,key:n()}}function c(t){p=t,[g,d]=i(),P.call({action:p,location:d})}function s(t){f.go(t)}let f=r.history,h=null;r.addEventListener("popstate",(function(){if(h)y.call(h),h=null;else{let[t,e]=i();if(y.length){if(null!=t){let n=g-t;n&&(h={action:"POP",location:e,retry(){s(-1*n)}},s(n))}}else c("POP")}}));let p="POP",[g,d]=i(),y=e(),P=e();return null==g&&(g=0,f.replaceState({...f.state,idx:g},null)),{get action(){return p},get location(){return d},createHref:o,push:function t(e,n){let l=u(e,n);if(!y.length||(y.call({action:"PUSH",location:l,retry:function(){t(e,n)}}),0)){let[t,e]=[{usr:l.state,key:l.key,idx:g+1},o(l)];try{f.pushState(t,null,e)}catch(a){r.location.assign(e)}c("PUSH")}},replace:function t(e,n){let l=u(e,n);if(!y.length||(y.call({action:"REPLACE",location:l,retry:function(){t(e,n)}}),0)){let[t,e]=[{usr:l.state,key:l.key,idx:g},o(l)];f.replaceState(t,null,e),c("REPLACE")}},go:s,back(){s(-1)},forward(){s(1)},listen:t=>P.push(t),block(e){let n=y.push(e);return 1===y.length&&r.addEventListener("beforeunload",t),function(){n(),y.length||r.removeEventListener("beforeunload",t)}}}}function i({window:r=document.defaultView}={}){function i(){let{pathname:t="/",search:e="",hash:n=""}=a(r.location.hash.substr(1)),l=h.state||{};return[l.idx,{pathname:t,search:e,hash:n,state:l.usr||null,key:l.key||"default"}]}function o(){if(p)P.call(p),p=null;else{let[t,e]=i();if(P.length){if(null!=t){let n=d-t;n&&(p={action:"POP",location:e,retry(){f(-1*n)}},f(n))}}else s("POP")}}function u(t){var e=document.querySelector("base"),n="";return e&&e.getAttribute("href")&&(n=-1===(n=(e=r.location.href).indexOf("#"))?e:e.slice(0,n)),(e=n)+"#"+("string"==typeof t?t:l(t))}function c(t,e=null){return{...y,..."string"==typeof t?a(t):t,state:e,key:n()}}function s(t){g=t,[d,y]=i(),k.call({action:g,location:y})}function f(t){h.go(t)}let h=r.history,p=null;r.addEventListener("popstate",o),r.addEventListener("hashchange",()=>{let[,t]=i();l(t)!==l(y)&&o()});let g="POP",[d,y]=i(),P=e(),k=e();return null==d&&(d=0,h.replaceState({...h.state,idx:d},null)),{get action(){return g},get location(){return y},createHref:u,push:function t(e,n){let l=c(e,n);if(!P.length||(P.call({action:"PUSH",location:l,retry:function(){t(e,n)}}),0)){let[t,e]=[{usr:l.state,key:l.key,idx:d+1},u(l)];try{h.pushState(t,null,e)}catch(a){r.location.assign(e)}s("PUSH")}},replace:function t(e,n){let l=c(e,n);if(!P.length||(P.call({action:"REPLACE",location:l,retry:function(){t(e,n)}}),0)){let[t,e]=[{usr:l.state,key:l.key,idx:d},u(l)];h.replaceState(t,null,e),s("REPLACE")}},go:f,back(){f(-1)},forward(){f(1)},listen:t=>k.push(t),block(e){let n=P.push(e);return 1===P.length&&r.addEventListener("beforeunload",t),function(){n(),P.length||r.removeEventListener("beforeunload",t)}}}}function o({initialEntries:t=["/"],initialIndex:r=0}={}){function i(t,e=null){return{...p,..."string"==typeof t?a(t):t,state:e,key:n()}}function o(t,e,n){return!g.length||(g.call({action:t,location:e,retry:n}),!1)}function u(t,e){h=t,p=e,d.call({action:h,location:p})}function c(t){let e=Math.min(Math.max(f+t,0),s.length-1),n=s[e];o("POP",n,(function(){c(t)}))&&(f=e,u("POP",n))}let s=t.map(t=>({pathname:"/",search:"",hash:"",state:null,key:n(),..."string"==typeof t?a(t):t})),f=Math.min(Math.max(r,0),s.length-1),h="POP",p=s[f],g=e(),d=e();return{get index(){return f},get action(){return h},get location(){return p},createHref:function(t){return"string"==typeof t?t:l(t)},push:function t(e,n){let l=i(e,n);o("PUSH",l,(function(){t(e,n)}))&&(f+=1,s.splice(f,s.length,l),u("PUSH",l))},replace:function t(e,n){let l=i(e,n);o("REPLACE",l,(function(){t(e,n)}))&&(s[f]=l,u("REPLACE",l))},go:c,back(){c(-1)},forward(){c(1)},listen:t=>d.push(t),block:t=>g.push(t)}}export{r as createBrowserHistory,i as createHashHistory,o as createMemoryHistory,l as createPath,a as parsePath}; | ||
//# sourceMappingURL=history.production.min.js.map |
{ | ||
"name": "history", | ||
"version": "5.0.0-beta.4", | ||
"version": "5.0.0-beta.5", | ||
"description": "Manage session history with JavaScript", | ||
@@ -8,5 +8,6 @@ "repository": "ReactTraining/history", | ||
"author": "React Training <hello@reacttraining.com>", | ||
"main": "node-main.js", | ||
"main": "main.js", | ||
"module": "history.js", | ||
"unpkg": "umd/history.production.min.js", | ||
"types": "history.d.ts", | ||
"sideEffects": false, | ||
@@ -13,0 +14,0 @@ "dependencies": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
21
222
230987