!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var f;"undefined"!=typeof window?f=window:"undefined"!=typeof global?f=global:"undefined"!=typeof self&&(f=self),f.page=e()}}(function(){var define,module,exports;return function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o0){history.back();page.len--}else if(path){setTimeout(function(){page.show(path,state)})}else{setTimeout(function(){page.show(base,state)})}};page.redirect=function(from,to){if("string"===typeof from&&"string"===typeof to){page(from,function(e){setTimeout(function(){page.replace(to)},0)})}if("string"===typeof from&&"undefined"===typeof to){setTimeout(function(){page.replace(from)},0)}};page.replace=function(path,state,init,dispatch){var ctx=new Context(path,state);page.current=ctx.path;ctx.init=init;ctx.save();if(false!==dispatch)page.dispatch(ctx);return ctx};page.dispatch=function(ctx){var prev=prevContext,i=0,j=0;prevContext=ctx;function nextExit(){var fn=page.exits[j++];if(!fn)return nextEnter();fn(prev,nextExit)}function nextEnter(){var fn=page.callbacks[i++];if(ctx.path!==page.current){ctx.handled=false;return}if(!fn)return unhandled(ctx);fn(ctx,nextEnter)}if(prev){nextExit()}else{nextEnter()}};function unhandled(ctx){if(ctx.handled)return;var current;if(hashbang){current=base+location.hash.replace("#!","")}else{current=location.pathname+location.search}if(current===ctx.canonicalPath)return;page.stop();ctx.handled=false;location.href=ctx.canonicalPath}page.exit=function(path,fn){if(typeof path==="function"){return page.exit("*",path)}var route=new Route(path);for(var i=1;i-1)return;if(el.target)return;if(!sameOrigin(el.href))return;var path=el.pathname+el.search+(el.hash||"");if(typeof process!=="undefined"&&path.match(/^\/[a-zA-Z]:\//)){path=path.replace(/^\/[a-zA-Z]:\//,"/")}var orig=path;if(path.indexOf(base)===0){path=path.substr(base.length)}if(hashbang)path=path.replace("#!","");if(base&&orig===path)return;e.preventDefault();page.show(orig)}function which(e){e=e||window.event;return null===e.which?e.button:e.which}function sameOrigin(href){var origin=location.protocol+"//"+location.hostname;if(location.port)origin+=":"+location.port;return href&&0===href.indexOf(origin)}page.sameOrigin=sameOrigin}).call(this,require("_process"))},{_process:2,"path-to-regexp":3}],2:[function(require,module,exports){var process=module.exports={};process.nextTick=function(){var canSetImmediate=typeof window!=="undefined"&&window.setImmediate;var canMutationObserver=typeof window!=="undefined"&&window.MutationObserver;var canPost=typeof window!=="undefined"&&window.postMessage&&window.addEventListener;if(canSetImmediate){return function(f){return window.setImmediate(f)}}var queue=[];if(canMutationObserver){var hiddenDiv=document.createElement("div");var observer=new MutationObserver(function(){var queueList=queue.slice();queue.length=0;queueList.forEach(function(fn){fn()})});observer.observe(hiddenDiv,{attributes:true});return function nextTick(fn){if(!queue.length){hiddenDiv.setAttribute("yes","no")}queue.push(fn)}}if(canPost){window.addEventListener("message",function(ev){var source=ev.source;if((source===window||source===null)&&ev.data==="process-tick"){ev.stopPropagation();if(queue.length>0){var fn=queue.shift();fn()}}},true);return function nextTick(fn){queue.push(fn);window.postMessage("process-tick","*")}}return function nextTick(fn){setTimeout(fn,0)}}();process.title="browser";process.browser=true;process.env={};process.argv=[];function noop(){}process.on=noop;process.addListener=noop;process.once=noop;process.off=noop;process.removeListener=noop;process.removeAllListeners=noop;process.emit=noop;process.binding=function(name){throw new Error("process.binding is not supported")};process.cwd=function(){return"/"};process.chdir=function(dir){throw new Error("process.chdir is not supported")}},{}],3:[function(require,module,exports){var isarray=require("isarray");module.exports=pathToRegexp;module.exports.parse=parse;module.exports.compile=compile;module.exports.tokensToFunction=tokensToFunction;module.exports.tokensToRegExp=tokensToRegExp;var PATH_REGEXP=new RegExp(["(\\\\.)","([\\/.])?(?:(?:\\:(\\w+)(?:\\(((?:\\\\.|[^()])+)\\))?|\\(((?:\\\\.|[^()])+)\\))([+*?])?|(\\*))"].join("|"),"g");function parse(str){var tokens=[];var key=0;var index=0;var path="";var res;while((res=PATH_REGEXP.exec(str))!=null){var m=res[0];var escaped=res[1];var offset=res.index;path+=str.slice(index,offset);index=offset+m.length;if(escaped){path+=escaped[1];continue}if(path){tokens.push(path);path=""}var prefix=res[2];var name=res[3];var capture=res[4];var group=res[5];var suffix=res[6];var asterisk=res[7];var repeat=suffix==="+"||suffix==="*";var optional=suffix==="?"||suffix==="*";var delimiter=prefix||"/";var pattern=capture||group||(asterisk?".*":"[^"+delimiter+"]+?");tokens.push({name:name||key++,prefix:prefix||"",delimiter:delimiter,optional:optional,repeat:repeat,pattern:escapeGroup(pattern)})}if(index