!function(t,n){"object"==typeof exports&&"object"==typeof module?module.exports=n():"function"==typeof define&&define.amd?define([],n):"object"==typeof exports?exports.History=n():t.History=n()}(this,function(){return function(t){function n(o){if(e[o])return e[o].exports;var r=e[o]={exports:{},id:o,loaded:!1};return t[o].call(r.exports,r,r.exports,n),r.loaded=!0,r.exports}var e={};return n.m=t,n.c=e,n.p="",n(0)}([function(t,n,e){"use strict";function o(t){return t&&t.__esModule?t:{default:t}}n.__esModule=!0,n.createPath=n.parsePath=n.locationsAreEqual=n.createLocation=n.createMemoryHistory=n.createHashHistory=n.createBrowserHistory=void 0;var r=e(2);Object.defineProperty(n,"createLocation",{enumerable:!0,get:function(){return r.createLocation}}),Object.defineProperty(n,"locationsAreEqual",{enumerable:!0,get:function(){return r.locationsAreEqual}});var i=e(1);Object.defineProperty(n,"parsePath",{enumerable:!0,get:function(){return i.parsePath}}),Object.defineProperty(n,"createPath",{enumerable:!0,get:function(){return i.createPath}});var a=e(7),c=o(a),u=e(8),s=o(u),f=e(9),l=o(f);n.createBrowserHistory=c.default,n.createHashHistory=s.default,n.createMemoryHistory=l.default},function(t,n){"use strict";n.__esModule=!0;n.addLeadingSlash=function(t){return"/"===t.charAt(0)?t:"/"+t},n.stripLeadingSlash=function(t){return"/"===t.charAt(0)?t.substr(1):t},n.stripPrefix=function(t,n){return 0===t.indexOf(n)?t.substr(n.length):t},n.stripTrailingSlash=function(t){return"/"===t.charAt(t.length-1)?t.slice(0,-1):t},n.parsePath=function(t){var n=t||"/",e="",o="",r=n.indexOf("#");r!==-1&&(o=n.substr(r),n=n.substr(0,r));var i=n.indexOf("?");return i!==-1&&(e=n.substr(i),n=n.substr(0,i)),n=decodeURI(n),{pathname:n,search:"?"===e?"":e,hash:"#"===o?"":o}},n.createPath=function(t){var n=t.pathname,e=t.search,o=t.hash,r=encodeURI(n||"/");return e&&"?"!==e&&(r+="?"===e.charAt(0)?e:"?"+e),o&&"#"!==o&&(r+="#"===o.charAt(0)?o:"#"+o),r}},function(t,n,e){"use strict";function o(t){return t&&t.__esModule?t:{default:t}}n.__esModule=!0,n.locationsAreEqual=n.createLocation=void 0;var r=Object.assign||function(t){for(var n=1;n0&&void 0!==arguments[0]?arguments[0]:{};d.canUseDOM?void 0:(0,c.default)(!1);var n=window.history,e=(0,d.supportsHistory)(),o=!(0,d.supportsPopStateOnHashChange)(),i=t.forceRefresh,a=void 0!==i&&i,f=t.getUserConfirmation,y=void 0===f?d.getConfirmation:f,g=t.keyLength,m=void 0===g?6:g,w=t.basename?(0,s.stripTrailingSlash)((0,s.addLeadingSlash)(t.basename)):"",P=function(t){var n=t||{},e=n.key,o=n.state,i=window.location,a=i.pathname,c=i.search,u=i.hash,f=a+c+u;return w&&(f=(0,s.stripPrefix)(f,w)),r({},(0,s.parsePath)(f),{state:o,key:e})},b=function(){return Math.random().toString(36).substr(2,m)},O=(0,l.default)(),x=function(t){r(G,t),G.length=n.length,O.notifyListeners(G.location,G.action)},L=function(t){(0,d.isExtraneousPopstateEvent)(t)||A(P(t.state))},S=function(){A(P(p()))},E=!1,A=function(t){if(E)E=!1,x();else{var n="POP";O.confirmTransitionTo(t,n,y,function(e){e?x({action:n,location:t}):_(t)})}},_=function(t){var n=G.location,e=M.indexOf(n.key);e===-1&&(e=0);var o=M.indexOf(t.key);o===-1&&(o=0);var r=e-o;r&&(E=!0,C(r))},k=P(p()),M=[k.key],T=function(t){return w+(0,s.createPath)(t)},H=function(t,o){var r="PUSH",i=(0,u.createLocation)(t,o,b(),G.location);O.confirmTransitionTo(i,r,y,function(t){if(t){var o=T(i),c=i.key,u=i.state;if(e)if(n.pushState({key:c,state:u},null,o),a)window.location.href=o;else{var s=M.indexOf(G.location.key),f=M.slice(0,s===-1?0:s+1);f.push(i.key),M=f,x({action:r,location:i})}else window.location.href=o}})},j=function(t,o){var r="REPLACE",i=(0,u.createLocation)(t,o,b(),G.location);O.confirmTransitionTo(i,r,y,function(t){if(t){var o=T(i),c=i.key,u=i.state;if(e)if(n.replaceState({key:c,state:u},null,o),a)window.location.replace(o);else{var s=M.indexOf(G.location.key);s!==-1&&(M[s]=i.key),x({action:r,location:i})}else window.location.replace(o)}})},C=function(t){n.go(t)},U=function(){return C(-1)},R=function(){return C(1)},I=0,q=function(t){I+=t,1===I?((0,d.addEventListener)(window,h,L),o&&(0,d.addEventListener)(window,v,S)):0===I&&((0,d.removeEventListener)(window,h,L),o&&(0,d.removeEventListener)(window,v,S))},B=!1,F=function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],n=O.setPrompt(t);return B||(q(1),B=!0),function(){return B&&(B=!1,q(-1)),n()}},D=function(t){var n=O.appendListener(t);return q(1),function(){q(-1),n()}},G={length:n.length,action:"POP",location:k,createHref:T,push:H,replace:j,go:C,goBack:U,goForward:R,block:F,listen:D};return G};n.default=y},function(t,n,e){"use strict";function o(t){return t&&t.__esModule?t:{default:t}}n.__esModule=!0;var r=Object.assign||function(t){for(var n=1;n=0?n:0)+"#"+t)},m=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};d.canUseDOM?void 0:(0,c.default)(!1);var n=window.history,e=((0,d.supportsGoWithoutReloadUsingHash)(),t.getUserConfirmation),o=void 0===e?d.getConfirmation:e,i=t.hashType,a=void 0===i?"slash":i,f=t.basename?(0,s.stripTrailingSlash)((0,s.addLeadingSlash)(t.basename)):"",m=v[a],w=m.encodePath,P=m.decodePath,b=function(){var t=P(p());return f&&(t=(0,s.stripPrefix)(t,f)),(0,s.parsePath)(t)},O=(0,l.default)(),x=function(t){r(V,t),V.length=n.length,O.notifyListeners(V.location,V.action)},L=!1,S=null,E=function(){var t=p(),n=w(t);if(t!==n)g(n);else{var e=b(),o=V.location;if(!L&&(0,u.locationsAreEqual)(o,e))return;if(S===(0,s.createPath)(e))return;S=null,A(e)}},A=function(t){if(L)L=!1,x();else{var n="POP";O.confirmTransitionTo(t,n,o,function(e){e?x({action:n,location:t}):_(t)})}},_=function(t){var n=V.location,e=H.lastIndexOf((0,s.createPath)(n));e===-1&&(e=0);var o=H.lastIndexOf((0,s.createPath)(t));o===-1&&(o=0);var r=e-o;r&&(L=!0,R(r))},k=p(),M=w(k);k!==M&&g(M);var T=b(),H=[(0,s.createPath)(T)],j=function(t){return"#"+w(f+(0,s.createPath)(t))},C=function(t,n){var e="PUSH",r=(0,u.createLocation)(t,void 0,void 0,V.location);O.confirmTransitionTo(r,e,o,function(t){if(t){var n=(0,s.createPath)(r),o=w(f+n),i=p()!==o;if(i){S=n,y(o);var a=H.lastIndexOf((0,s.createPath)(V.location)),c=H.slice(0,a===-1?0:a+1);c.push(n),H=c,x({action:e,location:r})}else x()}})},U=function(t,n){var e="REPLACE",r=(0,u.createLocation)(t,void 0,void 0,V.location);O.confirmTransitionTo(r,e,o,function(t){if(t){var n=(0,s.createPath)(r),o=w(f+n),i=p()!==o;i&&(S=n,g(o));var a=H.indexOf((0,s.createPath)(V.location));a!==-1&&(H[a]=n),x({action:e,location:r})}})},R=function(t){n.go(t)},I=function(){return R(-1)},q=function(){return R(1)},B=0,F=function(t){B+=t,1===B?(0,d.addEventListener)(window,h,E):0===B&&(0,d.removeEventListener)(window,h,E)},D=!1,G=function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],n=O.setPrompt(t);return D||(F(1),D=!0),function(){return D&&(D=!1,F(-1)),n()}},W=function(t){var n=O.appendListener(t);return F(1),function(){F(-1),n()}},V={length:n.length,action:"POP",location:T,createHref:j,push:C,replace:U,go:R,goBack:I,goForward:q,block:G,listen:W};return V};n.default=m},function(t,n,e){"use strict";function o(t){return t&&t.__esModule?t:{default:t}}n.__esModule=!0;var r=("function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Object.assign||function(t){for(var n=1;n0&&void 0!==arguments[0]?arguments[0]:{},n=t.getUserConfirmation,e=t.initialEntries,o=void 0===e?["/"]:e,i=t.initialIndex,u=void 0===i?0:i,l=t.keyLength,d=void 0===l?6:l,h=(0,s.default)(),v=function(t){r(A,t),A.length=A.entries.length,h.notifyListeners(A.location,A.action)},p=function(){return Math.random().toString(36).substr(2,d)},y=f(u,0,o.length-1),g=o.map(function(t){return"string"==typeof t?(0,c.createLocation)(t,void 0,p()):(0,c.createLocation)(t,void 0,t.key||p())}),m=a.createPath,w=function(t,e){var o="PUSH",r=(0,c.createLocation)(t,e,p(),A.location);h.confirmTransitionTo(r,o,n,function(t){if(t){var n=A.index,e=n+1,i=A.entries.slice(0);i.length>e?i.splice(e,i.length-e,r):i.push(r),v({action:o,location:r,index:e,entries:i})}})},P=function(t,e){var o="REPLACE",r=(0,c.createLocation)(t,e,p(),A.location);h.confirmTransitionTo(r,o,n,function(t){t&&(A.entries[A.index]=r,v({action:o,location:r}))})},b=function(t){var e=f(A.index+t,0,A.entries.length-1),o="POP",r=A.entries[e];h.confirmTransitionTo(r,o,n,function(t){t?v({action:o,location:r,index:e}):v()})},O=function(){return b(-1)},x=function(){return b(1)},L=function(t){var n=A.index+t;return n>=0&&n0&&void 0!==arguments[0]&&arguments[0];return h.setPrompt(t)},E=function(t){return h.appendListener(t)},A={length:g.length,action:"POP",location:g[y],index:y,entries:g,createHref:m,push:w,replace:P,go:b,goBack:O,goForward:x,canGo:L,block:S,listen:E};return A};n.default=l},function(t,n){"use strict";var e=function(t){return"/"===t.charAt(0)},o=function(t,n){for(var e=n,o=e+1,r=t.length;o=0;d--){var h=i[d];"."===h?o(i,d):".."===h?(o(i,d),l++):l&&(o(i,d),l--)}if(!u)for(;l--;l)i.unshift("..");!u||""===i[0]||i[0]&&e(i[0])||i.unshift("");var v=i.join("/");return s&&"/"!==v.substr(-1)&&(v+="/"),v};t.exports=r},function(t,n){"use strict";n.__esModule=!0;var e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},o=function t(n,o){if(n===o)return!0;if(null==n||null==o)return!1;if(Array.isArray(n))return!(!Array.isArray(o)||n.length!==o.length)&&n.every(function(n,e){return t(n,o[e])});var r="undefined"==typeof n?"undefined":e(n),i="undefined"==typeof o?"undefined":e(o);if(r!==i)return!1;if("object"===r){var a=n.valueOf(),c=o.valueOf();if(a!==n||c!==o)return t(a,c);var u=Object.keys(n),s=Object.keys(o);return u.length===s.length&&u.every(function(e){return t(n[e],o[e])})}return!1};n.default=o}])});