window.System&&"function"==typeof System.amdDefine&&(window.define=System.amdDefine),define("aurelia-templating-router/router-view",["exports","aurelia-dependency-injection","aurelia-binding","aurelia-templating","aurelia-router","aurelia-metadata","aurelia-pal"],function(t,e,r,i,n,o,a){"use strict";function s(t,e,r,i){r&&Object.defineProperty(t,e,{enumerable:r.enumerable,configurable:r.configurable,writable:r.writable,value:r.initializer?r.initializer.call(i):void 0})}function u(t,e,r,i,n){var o={};return Object.keys(i).forEach(function(t){o[t]=i[t]}),o.enumerable=!!o.enumerable,o.configurable=!!o.configurable,("value"in o||o.initializer)&&(o.writable=!0),o=r.slice().reverse().reduce(function(r,i){return i(t,e,r)||r},o),n&&void 0!==o.initializer&&(o.value=o.initializer?o.initializer.call(n):void 0,o.initializer=void 0),void 0===o.initializer&&(Object.defineProperty(t,e,o),o=null),o}Object.defineProperty(t,"__esModule",{value:!0}),t.RouterViewLocator=t.RouterView=void 0;var c,l,h,p,f,v,d,g=(t.RouterView=(c=(0,i.customElement)("router-view"))(l=(0,i.noView)((h=function(){function t(t,e,r,i,n,o,a){s(this,"swapOrder",p,this),s(this,"layoutView",f,this),s(this,"layoutViewModel",v,this),s(this,"layoutModel",d,this),this.element=t,this.container=e,this.viewSlot=r,this.router=i,this.viewLocator=n,this.compositionTransaction=o,this.compositionEngine=a,this.router.registerViewPort(this,this.element.getAttribute("name")),"initialComposition"in o||(o.initialComposition=!0,this.compositionTransactionNotifier=o.enlist())}return t.inject=function(){return[a.DOM.Element,e.Container,i.ViewSlot,n.Router,i.ViewLocator,i.CompositionTransaction,i.CompositionEngine]},t.prototype.created=function(t){this.owningView=t},t.prototype.bind=function(t,e){this.container.viewModel=t,this.overrideContext=e},t.prototype.process=function(t,e){var r=this,n=t.component,a=n.childContainer,s=n.viewModel,u=n.viewModelResource,c=u.metadata,l=n.router.currentInstruction.config,h=l.viewPorts?l.viewPorts[t.name]||{}:{};a.get(g)._notify(this);var p={viewModel:h.layoutViewModel||l.layoutViewModel||this.layoutViewModel,view:h.layoutView||l.layoutView||this.layoutView,model:h.layoutModel||l.layoutModel||this.layoutModel,router:t.component.router,childContainer:a,viewSlot:this.viewSlot},f=this.viewLocator.getViewStrategy(n.view||s);return f&&n.view&&f.makeRelativeTo(o.Origin.get(n.router.container.viewModel.constructor).moduleId),c.load(a,u.value,null,f,!0).then(function(n){if(r.compositionTransactionNotifier||(r.compositionTransactionOwnershipToken=r.compositionTransaction.tryCapture()),(p.viewModel||p.view)&&(t.layoutInstruction=p),t.controller=c.create(a,i.BehaviorInstruction.dynamic(r.element,s,n)),e)return null;r.swap(t)})},t.prototype.swap=function(t){var e=this,n=t.layoutInstruction,o=this.view,a=function(){var t=i.SwapStrategies[e.swapOrder]||i.SwapStrategies.after,r=e.viewSlot;t(r,o,function(){return Promise.resolve(r.add(e.view))}).then(function(){e._notify()})},s=function(r){return t.controller.automate(e.overrideContext,r),e.compositionTransactionOwnershipToken?e.compositionTransactionOwnershipToken.waitForCompositionComplete().then(function(){return e.compositionTransactionOwnershipToken=null,a()}):a()};return n?(n.viewModel||(n.viewModel={}),this.compositionEngine.createController(n).then(function(o){return i.ShadowDOM.distributeView(t.controller.view,o.slots||o.view.slots),o.automate((0,r.createOverrideContext)(n.viewModel),e.owningView),o.view.children.push(t.controller.view),o.view||o}).then(function(t){return e.view=t,s(t)})):(this.view=t.controller.view,s(this.owningView))},t.prototype._notify=function(){this.compositionTransactionNotifier&&(this.compositionTransactionNotifier.done(),this.compositionTransactionNotifier=null)},t}(),p=u(h.prototype,"swapOrder",[i.bindable],{enumerable:!0,initializer:null}),f=u(h.prototype,"layoutView",[i.bindable],{enumerable:!0,initializer:null}),v=u(h.prototype,"layoutViewModel",[i.bindable],{enumerable:!0,initializer:null}),d=u(h.prototype,"layoutModel",[i.bindable],{enumerable:!0,initializer:null}),l=h))||l)||l,t.RouterViewLocator=function(){function t(){var t=this;this.promise=new Promise(function(e){return t.resolve=e})}return t.prototype.findNearest=function(){return this.promise},t.prototype._notify=function(t){this.resolve(t)},t}())}),define("aurelia-templating-router/route-loader",["exports","aurelia-dependency-injection","aurelia-templating","aurelia-router","aurelia-path","aurelia-metadata","./router-view"],function(t,e,r,i,n,o,a){"use strict";function s(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function u(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function c(t){var e,i,n,o=/([^\/^\?]+)\.html/i.exec(t)[1];return e=(0,r.customElement)(o),i=(0,r.useView)(t),e(n=i(n=function(){function t(){}return t.prototype.bind=function(t){this.$parent=t},t}())||n)||n}Object.defineProperty(t,"__esModule",{value:!0}),t.TemplatingRouteLoader=void 0;var l,h,p,f,v=(l=(0,r.inlineView)("<template></template>"))(h=function(){})||h;t.TemplatingRouteLoader=(p=(0,e.inject)(r.CompositionEngine))(f=function(t){function e(e){var r=s(this,t.call(this));return r.compositionEngine=e,r}return u(e,t),e.prototype.loadRoute=function(t,e){var r=t.container.createChild(),s=void 0;s=null===e.moduleId?v:/\.html/i.test(e.moduleId)?c(e.moduleId):(0,n.relativeToFile)(e.moduleId,o.Origin.get(t.container.viewModel.constructor).moduleId);var u={viewModel:s,childContainer:r,view:e.view||e.viewStrategy,router:t};return r.registerSingleton(a.RouterViewLocator),r.getChildRouter=function(){var e=void 0;return r.registerHandler(i.Router,function(i){return e||(e=t.createChild(r))}),r.get(i.Router)},this.compositionEngine.ensureViewModel(u)},e}(i.RouteLoader))||f}),define("aurelia-templating-router/route-href",["exports","aurelia-templating","aurelia-router","aurelia-pal","aurelia-logging"],function(t,e,r,i,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RouteHref=void 0;var o,a,s,u,c,l=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}(n),h=l.getLogger("route-href");t.RouteHref=(o=(0,e.customAttribute)("route-href"),a=(0,e.bindable)({name:"route",changeHandler:"processChange",primaryProperty:!0}),s=(0,e.bindable)({name:"params",changeHandler:"processChange"}),u=(0,e.bindable)({name:"attribute",defaultValue:"href"}),o(c=a(c=s(c=u(c=function(){function t(t,e){this.router=t,this.element=e}return t.inject=function(){return[r.Router,i.DOM.Element]},t.prototype.bind=function(){this.isActive=!0,this.processChange()},t.prototype.unbind=function(){this.isActive=!1},t.prototype.attributeChanged=function(t,e){e&&this.element.removeAttribute(e),this.processChange()},t.prototype.processChange=function(){var t=this;return this.router.ensureConfigured().then(function(){if(!t.isActive)return null;var e=t.router.generate(t.route,t.params);return t.element.au.controller?t.element.au.controller.viewModel[t.attribute]=e:t.element.setAttribute(t.attribute,e),null}).catch(function(t){h.error(t)})},t}())||c)||c)||c)||c)}),define("aurelia-templating-router/aurelia-templating-router",["exports","aurelia-router","./route-loader","./router-view","./route-href"],function(t,e,r,i,n){"use strict";function o(t){t.singleton(e.RouteLoader,r.TemplatingRouteLoader).singleton(e.Router,e.AppRouter).globalResources(i.RouterView,n.RouteHref),t.container.registerAlias(e.Router,e.AppRouter)}Object.defineProperty(t,"__esModule",{value:!0}),t.configure=t.RouteHref=t.RouterView=t.TemplatingRouteLoader=void 0,t.TemplatingRouteLoader=r.TemplatingRouteLoader,t.RouterView=i.RouterView,t.RouteHref=n.RouteHref,t.configure=o}),define("aurelia-templating-router",["aurelia-templating-router/aurelia-templating-router"],function(t){return t}),define("aurelia-router",["exports","aurelia-logging","aurelia-route-recognizer","aurelia-dependency-injection","aurelia-history","aurelia-event-aggregator"],function(t,e,r,i,n,o){"use strict";function a(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function s(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function u(t,e){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return e||"#"===t[0]||(t="#"+t),e&&r&&(t=t.substring(1,t.length)),t}function c(t,e,r,i){if(V.test(t))return t;var n="";return e.length&&"/"!==e[0]&&(n+="/"),n+=e,n.length&&"/"===n[n.length-1]||"/"===t[0]||(n+="/"),n.length&&"/"===n[n.length-1]&&"/"===t[0]&&(n=n.substring(0,n.length-1)),u(n+t,r,i)}function l(t,e,r){return L.test(t)?u(t,r):c(t,e,r)}function h(t){var e=[];if(Array.isArray(t.route))for(var r=0,i=t.route.length;r<i;++r){var n=Object.assign({},t);n.route=t.route[r],e.push(n)}else e.push(Object.assign({},t));return e}function p(t){t.previousInstruction=null,t.plan=null}function f(t){return t&&"function"==typeof t.navigate}function v(t,e){return function(t){return Promise.resolve({status:e,output:t,completed:e===F.completed})}}function d(t,e){var r=t.config;if("redirect"in r){var i=t.router;return i._createNavigationInstruction(r.redirect).then(function(e){var r={};for(var n in e.params){var o=e.params[n];"string"==typeof o&&":"===o[0]?(o=o.slice(1))in t.params&&(r[n]=t.params[o]):r[n]=e.params[n]}var a=i.generate(e.config.name,r,t.options);return t.queryString&&(a+="?"+t.queryString),Promise.resolve(new q(a))})}var n=t.previousInstruction,o={},a=t.router.viewPortDefaults;if(n){var s=g(n,t),u=[];for(var c in n.viewPortInstructions)!function(i){var c=n.viewPortInstructions[i],l=i in r.viewPorts?r.viewPorts[i]:c;null===l.moduleId&&i in t.router.viewPortDefaults&&(l=a[i]);var h=o[i]={name:i,config:l,prevComponent:c.component,prevModuleId:c.moduleId};if(c.moduleId!==l.moduleId)h.strategy=W.replace;else if("determineActivationStrategy"in c.component.viewModel){var p;h.strategy=(p=c.component.viewModel).determineActivationStrategy.apply(p,t.lifecycleArgs)}else r.activationStrategy?h.strategy=r.activationStrategy:h.strategy=s||e?W.invokeLifecycle:W.noChange;if(h.strategy!==W.replace&&c.childRouter){var f=t.getWildcardPath(),v=c.childRouter._createNavigationInstruction(f,t).then(function(t){return h.childNavigationInstruction=t,d(t,h.strategy===W.invokeLifecycle).then(function(e){if(e instanceof q)return Promise.reject(e);t.plan=e})});u.push(v)}}(c);return Promise.all(u).then(function(){return o})}for(var c in r.viewPorts){var l=r.viewPorts[c];null===l.moduleId&&c in t.router.viewPortDefaults&&(l=a[c]),o[c]={name:c,strategy:W.replace,config:l}}return Promise.resolve(o)}function g(t,e){var r=t.params,i=e.params,n=e.config.hasChildRouter?e.getWildCardName():null;for(var o in i)if(o!==n&&r[o]!==i[o])return!0;for(var a in r)if(a!==n&&r[a]!==i[a])return!0;if(!e.options.compareQueryParams)return!1;var s=t.queryParams,u=e.queryParams;for(var c in u)if(s[c]!==u[c])return!0;for(var l in s)if(s[l]!==u[l])return!0;return!1}function y(t,e){return""+(t.baseUrl||"")+(e.getBaseUrl()||"")}function m(t,e){if("object"!==(void 0===t?"undefined":x(t)))throw new Error("Invalid Route Config");if("string"!=typeof t.route){var r=t.name||"(no name)";throw new Error('Invalid Route Config for "'+r+'": You must specify a "route:" pattern.')}if(!("redirect"in t||t.moduleId||t.navigationStrategy||t.viewPorts))throw new Error('Invalid Route Config for "'+t.route+'": You must specify a "moduleId:", "redirect:", "navigationStrategy:", or "viewPorts:".')}function w(t,e,r){return Promise.resolve(e.call(r,t)).then(function(){return"viewPorts"in t.config||(t.config.viewPorts={default:{moduleId:t.config.moduleId}}),t})}function b(t,e,r,i){function n(t){return i||I(t)?o():r.cancel(t)}function o(){if(u--)try{return C(s[u][e](t),n,r.cancel)}catch(t){return r.cancel(t)}return t.router.couldDeactivate=!0,r()}var a=t.plan,s=P(a,e),u=s.length;return o()}function P(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];for(var i in t){var n=t[i],o=n.prevComponent;if((n.strategy===W.invokeLifecycle||n.strategy===W.replace)&&o){var a=o.viewModel;e in a&&r.push(a)}n.strategy===W.replace&&o?R(o,e,r):n.childNavigationInstruction&&P(n.childNavigationInstruction.plan,e,r)}return r}function R(t,e,r){var i=t.childRouter;if(i&&i.currentInstruction){var n=i.currentInstruction.viewPortInstructions;for(var o in n){var a=n[o],s=a.component,u=s.viewModel;e in u&&r.push(u),R(s,e,r)}}}function S(t,e,r,i){function n(t,e){return i||I(t,e)?o():r.cancel(t)}function o(){if(++u<s)try{var t,i=a[u];return C((t=i.viewModel)[e].apply(t,i.lifecycleArgs),function(t){return n(t,i.router)},r.cancel)}catch(t){return r.cancel(t)}return r()}var a=_(t,e),s=a.length,u=-1;return o()}function _(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],i=arguments[3],n=t.plan;return Object.keys(n).filter(function(o){var a=n[o],s=t.viewPortInstructions[o],u=s.component.viewModel;(a.strategy===W.invokeLifecycle||a.strategy===W.replace)&&e in u&&r.push({viewModel:u,lifecycleArgs:s.lifecycleArgs,router:i}),a.childNavigationInstruction&&_(a.childNavigationInstruction,e,r,s.component.childRouter||i)}),r}function I(t,e){return!(t instanceof Error)&&(f(t)?("function"==typeof t.setRouter&&t.setRouter(e),!!t.shouldContinueProcessing):void 0===t||t)}function C(t,e,r){if(t&&"function"==typeof t.then)return Promise.resolve(t).then(e).catch(r);if(t&&"function"==typeof t.subscribe){var i=t;return new Z(function(n){return i.subscribe({next:function(){n.subscribed&&(n.unsubscribe(),e(t))},error:function(t){n.subscribed&&(n.unsubscribe(),r(t))},complete:function(){n.subscribed&&(n.unsubscribe(),e(t))}})})}try{return e(t)}catch(t){return r(t)}}function A(t,e){var r=N(e),i=r.map(function(e){return O(t,e.navigationInstruction,e.viewPortPlan)});return Promise.all(i)}function N(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=t.plan;for(var i in r){var n=r[i];if(n.strategy===W.replace)e.push({viewPortPlan:n,navigationInstruction:t}),n.childNavigationInstruction&&N(n.childNavigationInstruction,e);else{var o=t.addViewPortInstruction(i,n.strategy,n.prevModuleId,n.prevComponent);n.childNavigationInstruction&&(o.childNavigationInstruction=n.childNavigationInstruction,N(n.childNavigationInstruction,e))}}return e}function O(t,e,r){var i=r.config?r.config.moduleId:null;return M(t,e,r.config).then(function(n){var o=e.addViewPortInstruction(r.name,r.strategy,i,n),a=n.childRouter;if(a){var s=e.getWildcardPath();return a._createNavigationInstruction(s,e).then(function(e){return r.childNavigationInstruction=e,d(e).then(function(r){return r instanceof q?Promise.reject(r):(e.plan=r,o.childNavigationInstruction=e,A(t,e))})})}})}function M(t,e,r){var i=e.router,n=e.lifecycleArgs;return t.loadRoute(i,r,e).then(function(t){var e=t.viewModel,o=t.childContainer;if(t.router=i,t.config=r,"configureRouter"in e){var a=o.getChildRouter();return t.childRouter=a,a.configure(function(t){return e.configureRouter.apply(e,[t,a].concat(n))}).then(function(){return t})}return t})}function k(t,e,r,i){e&&"completed"in e&&"output"in e||(e=e||{},e.output=new Error("Expected router pipeline to return a navigation result, but got ["+JSON.stringify(e)+"] instead."));var n=null,o=null;return f(e.output)?o=e.output.navigate(i):(n=e,e.completed||(e.output instanceof Error&&nt.error(e.output),T(i))),Promise.resolve(o).then(function(t){return i._dequeueInstruction(r+1)}).then(function(t){return n||t||e})}function E(t,e,r,i){t.resolve(e);var n={instruction:t,result:e};if(r)i.events.publish("router:navigation:child:complete",n);else{i.isNavigating=!1,i.isExplicitNavigation=!1,i.isExplicitNavigationBack=!1,i.isNavigatingFirst=!1,i.isNavigatingNew=!1,i.isNavigatingRefresh=!1,i.isNavigatingForward=!1,i.isNavigatingBack=!1,i.couldDeactivate=!1;var o=void 0;if(e.output instanceof Error)o="error";else if(e.completed){var a=t.queryString?"?"+t.queryString:"";i.history.previousLocation=t.fragment+a,o="success"}else o="canceled";i.events.publish("router:navigation:"+o,n),i.events.publish("router:navigation:complete",n)}return e}function T(t){t.history.previousLocation?t.navigate(t.history.previousLocation,{trigger:!1,replace:!0}):t.fallbackRoute?t.navigate(t.fallbackRoute,{trigger:!0,replace:!0}):nt.error("Router navigation failed, and no previous location or fallbackRoute could be restored.")}Object.defineProperty(t,"__esModule",{value:!0}),t.AppRouter=t.PipelineProvider=t.LoadRouteStep=t.RouteLoader=t.ActivateNextStep=t.DeactivatePreviousStep=t.CanActivateNextStep=t.CanDeactivatePreviousStep=t.Router=t.BuildNavigationPlanStep=t.activationStrategy=t.RouterConfiguration=t.Pipeline=t.pipelineStatus=t.RedirectToRoute=t.Redirect=t.NavModel=t.NavigationInstruction=t.CommitChangesStep=void 0,t._normalizeAbsolutePath=u,t._createRootedPath=c,t._resolveUrl=l,t._ensureArrayWithSingleRoutePerConfig=h,t.isNavigationCommand=f,t._buildNavigationPlan=d;var j=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}(e),x="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},H=function(){function t(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,r,i){return r&&t(e.prototype,r),i&&t(e,i),e}}(),L=/^#?\//,V=/^([a-z][a-z0-9+\-.]*:)?\/\//i,z=t.CommitChangesStep=function(){function t(){}return t.prototype.run=function(t,e){return t._commitChanges(!0).then(function(){return t._updateTitle(),e()})},t}(),D=t.NavigationInstruction=function(){function t(t){this.plan=null,this.options={},Object.assign(this,t),this.params=this.params||{},this.viewPortInstructions={};var e=[],r=this;do{var i=Object.assign({},r.params);r.config&&r.config.hasChildRouter&&delete i[r.getWildCardName()],e.unshift(i),r=r.parentInstruction}while(r);var n=Object.assign.apply(Object,[{},this.queryParams].concat(e));this.lifecycleArgs=[n,this.config,this]}return t.prototype.getAllInstructions=function(){var t=[this];for(var e in this.viewPortInstructions){var r=this.viewPortInstructions[e].childNavigationInstruction;r&&t.push.apply(t,r.getAllInstructions())}return t},t.prototype.getAllPreviousInstructions=function(){return this.getAllInstructions().map(function(t){return t.previousInstruction}).filter(function(t){return t})},t.prototype.addViewPortInstruction=function(t,e,r,i){var n=Object.assign({},this.lifecycleArgs[1],{currentViewPort:t});return this.viewPortInstructions[t]={name:t,strategy:e,moduleId:r,component:i,childRouter:i.childRouter,lifecycleArgs:[].concat(this.lifecycleArgs[0],n,this.lifecycleArgs[2])}},t.prototype.getWildCardName=function(){var t=this.config.route.lastIndexOf("*");return this.config.route.substr(t+1)},t.prototype.getWildcardPath=function(){var t=this.getWildCardName(),e=this.params[t]||"";return this.queryString&&(e+="?"+this.queryString),e},t.prototype.getBaseUrl=function(){var t=this,e=decodeURI(this.fragment);if(""===e){var r=this.router.routes.find(function(e){return e.name===t.config.name&&""!==e.route});r&&(e=r.route)}if(!this.params)return encodeURI(e);var i=this.getWildCardName(),n=this.params[i]||"";return n?encodeURI(e.substr(0,e.lastIndexOf(n))):encodeURI(e)},t.prototype._commitChanges=function(t){var e=this,r=this.router;r.currentInstruction=this,this.previousInstruction&&(this.previousInstruction.config.navModel.isActive=!1),this.config.navModel.isActive=!0,r.refreshNavigation();var i=[],n=[];for(var o in this.viewPortInstructions)!function(o){var a=e.viewPortInstructions[o],s=r.viewPorts[o];if(!s)throw new Error("There was no router-view found in the view for "+a.moduleId+".");a.strategy===W.replace?a.childNavigationInstruction&&a.childNavigationInstruction.parentCatchHandler?i.push(a.childNavigationInstruction._commitChanges(t)):(t&&n.push({viewPort:s,viewPortInstruction:a}),i.push(s.process(a,t).then(function(e){if(a.childNavigationInstruction)return a.childNavigationInstruction._commitChanges(t)}))):a.childNavigationInstruction&&i.push(a.childNavigationInstruction._commitChanges(t))}(o);return Promise.all(i).then(function(){return n.forEach(function(t){return t.viewPort.swap(t.viewPortInstruction)}),null}).then(function(){return p(e)})},t.prototype._updateTitle=function(){var t=this._buildTitle(this.router.titleSeparator);t&&this.router.history.setTitle(t)},t.prototype._buildTitle=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:" | ",e="",r=[];this.config.navModel.title&&(e=this.router.transformTitle(this.config.navModel.title));for(var i in this.viewPortInstructions){var n=this.viewPortInstructions[i];if(n.childNavigationInstruction){var o=n.childNavigationInstruction._buildTitle(t);o&&r.push(o)}}return r.length&&(e=r.join(t)+(e?t:"")+e),this.router.title&&(e+=(e?t:"")+this.router.transformTitle(this.router.title)),e},t}(),U=t.NavModel=function(){function t(t,e){this.isActive=!1,this.title=null,this.href=null,this.relativeHref=null,this.settings={},this.config=null,this.router=t,this.relativeHref=e}return t.prototype.setTitle=function(t){this.title=t,this.isActive&&this.router.updateTitle()},t}(),q=t.Redirect=function(){function t(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.url=t,this.options=Object.assign({trigger:!0,replace:!0},e),this.shouldContinueProcessing=!1}return t.prototype.setRouter=function(t){this.router=t},t.prototype.navigate=function(t){(this.options.useAppRouter?t:this.router||t).navigate(this.url,this.options)},t}(),F=(t.RedirectToRoute=function(){function t(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this.route=t,this.params=e,this.options=Object.assign({trigger:!0,replace:!0},r),this.shouldContinueProcessing=!1}return t.prototype.setRouter=function(t){this.router=t},t.prototype.navigate=function(t){(this.options.useAppRouter?t:this.router||t).navigateToRoute(this.route,this.params,this.options)},t}(),t.pipelineStatus={completed:"completed",canceled:"canceled",rejected:"rejected",running:"running"}),B=t.Pipeline=function(){function t(){this.steps=[]}return t.prototype.addStep=function(t){var e=void 0;if("function"==typeof t)e=t;else{if("function"==typeof t.getSteps){for(var r=t.getSteps(),i=0,n=r.length;i<n;i++)this.addStep(r[i]);return this}e=t.run.bind(t)}return this.steps.push(e),this},t.prototype.run=function(t){function e(){if(!(++r<i.length))return e.complete();var n=i[r];try{return n(t,e)}catch(t){return e.reject(t)}}var r=-1,i=this.steps;return e.complete=v(e,F.completed),e.cancel=v(e,F.canceled),e.reject=v(e,F.rejected),e()},t}(),$=t.RouterConfiguration=function(){function t(){this.instructions=[],this.options={},this.pipelineSteps=[]}return t.prototype.addPipelineStep=function(t,e){if(null===e||void 0===e)throw new Error("Pipeline step cannot be null or undefined.");return this.pipelineSteps.push({name:t,step:e}),this},t.prototype.addAuthorizeStep=function(t){return this.addPipelineStep("authorize",t)},t.prototype.addPreActivateStep=function(t){return this.addPipelineStep("preActivate",t)},t.prototype.addPreRenderStep=function(t){return this.addPipelineStep("preRender",t)},t.prototype.addPostRenderStep=function(t){return this.addPipelineStep("postRender",t)},t.prototype.fallbackRoute=function(t){return this._fallbackRoute=t,this},t.prototype.map=function(t){return Array.isArray(t)?(t.forEach(this.map.bind(this)),this):this.mapRoute(t)},t.prototype.useViewPortDefaults=function(t){return this.viewPortDefaults=t,this},t.prototype.mapRoute=function(t){return this.instructions.push(function(e){for(var r=h(t),i=void 0,n=0,o=r.length;n<o;++n){var a=r[n];a.settings=a.settings||{},i||(i=e.createNavModel(a)),e.addRoute(a,i)}}),this},t.prototype.mapUnknownRoutes=function(t){return this.unknownRouteConfig=t,this},t.prototype.exportToRouter=function(t){for(var e=this.instructions,r=0,i=e.length;r<i;++r)e[r](t);this.title&&(t.title=this.title),this.titleSeparator&&(t.titleSeparator=this.titleSeparator),this.unknownRouteConfig&&t.handleUnknownRoutes(this.unknownRouteConfig),this._fallbackRoute&&(t.fallbackRoute=this._fallbackRoute),this.viewPortDefaults&&t.useViewPortDefaults(this.viewPortDefaults),Object.assign(t.options,this.options);var n=this.pipelineSteps;if(n.length){if(!t.isRoot)throw new Error("Pipeline steps can only be added to the root router");for(var o=t.pipelineProvider,a=0,s=n.length;a<s;++a){var u=n[a],c=u.name,l=u.step;o.addStep(c,l)}}},t}(),W=t.activationStrategy={noChange:"no-change",invokeLifecycle:"invoke-lifecycle",replace:"replace"},Q=t.BuildNavigationPlanStep=function(){function t(){}return t.prototype.run=function(t,e){return d(t).then(function(r){return r instanceof q?e.cancel(r):(t.plan=r,e())}).catch(e.cancel)},t}(),K=t.Router=function(){function t(t,e){var r=this;this.parent=null,this.options={},this.viewPortDefaults={},this.transformTitle=function(t){return r.parent?r.parent.transformTitle(t):t},this.container=t,this.history=e,this.reset()}return t.prototype.reset=function(){var t=this;this.viewPorts={},this.routes=[],this.baseUrl="",this.isConfigured=!1,this.isNavigating=!1,this.isExplicitNavigation=!1,this.isExplicitNavigationBack=!1,this.isNavigatingFirst=!1,this.isNavigatingNew=!1,this.isNavigatingRefresh=!1,this.isNavigatingForward=!1,this.isNavigatingBack=!1,this.couldDeactivate=!1,this.navigation=[],this.currentInstruction=null,this.viewPortDefaults={},this._fallbackOrder=100,this._recognizer=new r.RouteRecognizer,this._childRecognizer=new r.RouteRecognizer,this._configuredPromise=new Promise(function(e){t._resolveConfiguredPromise=e})},t.prototype.registerViewPort=function(t,e){e=e||"default",this.viewPorts[e]=t},t.prototype.ensureConfigured=function(){return this._configuredPromise},t.prototype.configure=function(t){var e=this;this.isConfigured=!0;var r=t,i=void 0;return"function"==typeof t&&(i=new $,r=t(i)),Promise.resolve(r).then(function(t){t&&t.exportToRouter&&(i=t),i.exportToRouter(e),e.isConfigured=!0,e._resolveConfiguredPromise()})},t.prototype.navigate=function(t,e){return!this.isConfigured&&this.parent?this.parent.navigate(t,e):(this.isExplicitNavigation=!0,this.history.navigate(l(t,this.baseUrl,this.history._hasPushState),e))},t.prototype.navigateToRoute=function(t,e,r){var i=this.generate(t,e);return this.navigate(i,r)},t.prototype.navigateBack=function(){this.isExplicitNavigationBack=!0,this.history.navigateBack()},t.prototype.createChild=function(e){var r=new t(e||this.container.createChild(),this.history);return r.parent=this,r},t.prototype.generate=function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=this._recognizer.hasRoute(t);if((!this.isConfigured||!i)&&this.parent)return this.parent.generate(t,e,r);if(!i)throw new Error("A route with name '"+t+"' could not be found. Check that `name: '"+t+"'` was specified in the route's config.");var n=this._recognizer.generate(t,e),o=c(n,this.baseUrl,this.history._hasPushState,r.absolute);return r.absolute?""+this.history.getAbsoluteRoot()+o:o},t.prototype.createNavModel=function(t){var e=new U(this,"href"in t?t.href:t.route);return e.title=t.title,e.order=t.nav,e.href=t.href,e.settings=t.settings,e.config=t,e},t.prototype.addRoute=function(t,e){if(Array.isArray(t.route)){return void h(t).forEach(this.addRoute.bind(this))}m(t,this.routes),"viewPorts"in t||t.navigationStrategy||(t.viewPorts={default:{moduleId:t.moduleId,view:t.view}}),e||(e=this.createNavModel(t)),this.routes.push(t);var r=t.route;"/"===r.charAt(0)&&(r=r.substr(1));var i=!0===t.caseSensitive,n=this._recognizer.add({path:r,handler:t,caseSensitive:i});if(r){var o=t.settings;delete t.settings;var a=JSON.parse(JSON.stringify(t));t.settings=o,a.route=r+"/*childRoute",a.hasChildRouter=!0,this._childRecognizer.add({path:a.route,handler:a,caseSensitive:i}),a.navModel=e,a.settings=t.settings,a.navigationStrategy=t.navigationStrategy}if(t.navModel=e,(e.order||0===e.order)&&-1===this.navigation.indexOf(e)){if(!e.href&&""!==e.href&&(n.types.dynamics||n.types.stars))throw new Error('Invalid route config for "'+t.route+'" : dynamic routes must specify an "href:" to be included in the navigation model.');"number"!=typeof e.order&&(e.order=++this._fallbackOrder),this.navigation.push(e),this.navigation=this.navigation.sort(function(t,e){return t.order-e.order})}},t.prototype.hasRoute=function(t){return!!(this._recognizer.hasRoute(t)||this.parent&&this.parent.hasRoute(t))},t.prototype.hasOwnRoute=function(t){return this._recognizer.hasRoute(t)},t.prototype.handleUnknownRoutes=function(t){var e=this;if(!t)throw new Error("Invalid unknown route handler");this.catchAllHandler=function(r){return e._createRouteConfig(t,r).then(function(t){return r.config=t,r})}},t.prototype.updateTitle=function(){if(this.parent)return this.parent.updateTitle();this.currentInstruction&&this.currentInstruction._updateTitle()},t.prototype.refreshNavigation=function(){for(var t=this.navigation,e=0,r=t.length;e<r;e++){var i=t[e];i.config.href?i.href=u(i.config.href,this.history._hasPushState):i.href=c(i.relativeHref,this.baseUrl,this.history._hasPushState)}},t.prototype.useViewPortDefaults=function(t){for(var e in t){var r=t[e];this.viewPortDefaults[e]={moduleId:r.moduleId}}},t.prototype._refreshBaseUrl=function(){this.parent&&(this.baseUrl=y(this.parent,this.parent.currentInstruction))},t.prototype._createNavigationInstruction=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r=t,i="",n=t.indexOf("?");-1!==n&&(r=t.substr(0,n),i=t.substr(n+1));var o=this._recognizer.recognize(t);o&&o.length||(o=this._childRecognizer.recognize(t));var a={fragment:r,queryString:i,config:null,parentInstruction:e,previousInstruction:this.currentInstruction,router:this,options:{compareQueryParams:this.options.compareQueryParams}},s=void 0;if(o&&o.length){var u=o[0],c=new D(Object.assign({},a,{params:u.params,queryParams:u.queryParams||o.queryParams,config:u.config||u.handler}));s="function"==typeof u.handler?w(c,u.handler,u):u.handler&&"function"==typeof u.handler.navigationStrategy?w(c,u.handler.navigationStrategy,u.handler):Promise.resolve(c)}else if(this.catchAllHandler){var l=new D(Object.assign({},a,{params:{path:r},queryParams:o?o.queryParams:{},config:null}));s=w(l,this.catchAllHandler)}else if(this.parent){var h=this._parentCatchAllHandler(this.parent);if(h){var p=this._findParentInstructionFromRouter(h,e),f=new D(Object.assign({},a,{params:{path:r},queryParams:o?o.queryParams:{},router:h,parentInstruction:p,parentCatchHandler:!0,config:null}));s=w(f,h.catchAllHandler)}}return s&&e&&(this.baseUrl=y(this.parent,e)),s||Promise.reject(new Error("Route not found: "+t))},t.prototype._findParentInstructionFromRouter=function(t,e){return e.router===t?(e.fragment=t.baseUrl,e):e.parentInstruction?this._findParentInstructionFromRouter(t,e.parentInstruction):void 0},t.prototype._parentCatchAllHandler=function(t){return t.catchAllHandler?t:!!t.parent&&this._parentCatchAllHandler(t.parent)},t.prototype._createRouteConfig=function(t,e){var r=this;return Promise.resolve(t).then(function(t){return"string"==typeof t?{moduleId:t
}:"function"==typeof t?t(e):t}).then(function(t){return"string"==typeof t?{moduleId:t}:t}).then(function(t){return t.route=e.params.path,m(t,r.routes),t.navModel||(t.navModel=r.createNavModel(t)),t})},H(t,[{key:"isRoot",get:function(){return!this.parent}}]),t}(),J=t.CanDeactivatePreviousStep=function(){function t(){}return t.prototype.run=function(t,e){return b(t,"canDeactivate",e)},t}(),Y=t.CanActivateNextStep=function(){function t(){}return t.prototype.run=function(t,e){return S(t,"canActivate",e)},t}(),G=t.DeactivatePreviousStep=function(){function t(){}return t.prototype.run=function(t,e){return b(t,"deactivate",e,!0)},t}(),X=t.ActivateNextStep=function(){function t(){}return t.prototype.run=function(t,e){return S(t,"activate",e,!0)},t}(),Z=function(){function t(t){this._subscribed=!0,this._subscription=t(this),this._subscribed||this.unsubscribe()}return t.prototype.unsubscribe=function(){this._subscribed&&this._subscription&&this._subscription.unsubscribe(),this._subscribed=!1},H(t,[{key:"subscribed",get:function(){return this._subscribed}}]),t}(),tt=t.RouteLoader=function(){function t(){}return t.prototype.loadRoute=function(t,e,r){throw Error('Route loaders must implement "loadRoute(router, config, navigationInstruction)".')},t}(),et=t.LoadRouteStep=function(){function t(t){this.routeLoader=t}return t.inject=function(){return[tt]},t.prototype.run=function(t,e){return A(this.routeLoader,t).then(e).catch(e.cancel)},t}(),rt=function(){function t(t,e,r){this.steps=[],this.container=t,this.slotName=e,this.slotAlias=r}return t.prototype.getSteps=function(){var t=this;return this.steps.map(function(e){return t.container.get(e)})},t}(),it=t.PipelineProvider=function(){function t(t){this.container=t,this.steps=[Q,J,et,this._createPipelineSlot("authorize"),Y,this._createPipelineSlot("preActivate","modelbind"),G,X,this._createPipelineSlot("preRender","precommit"),z,this._createPipelineSlot("postRender","postcomplete")]}return t.inject=function(){return[i.Container]},t.prototype.createPipeline=function(){var t=this,e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],r=new B;return this.steps.forEach(function(i){(e||i!==J)&&r.addStep(t.container.get(i))}),r},t.prototype._findStep=function(t){return this.steps.find(function(e){return e.slotName===t||e.slotAlias===t})},t.prototype.addStep=function(t,e){var r=this._findStep(t);if(!r)throw new Error("Invalid pipeline slot name: "+t+".");r.steps.includes(e)||r.steps.push(e)},t.prototype.removeStep=function(t,e){var r=this._findStep(t);r&&r.steps.splice(r.steps.indexOf(e),1)},t.prototype._clearSteps=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",e=this._findStep(t);e&&(e.steps=[])},t.prototype.reset=function(){this._clearSteps("authorize"),this._clearSteps("preActivate"),this._clearSteps("preRender"),this._clearSteps("postRender")},t.prototype._createPipelineSlot=function(t,e){return new rt(this.container,t,e)},t}(),nt=j.getLogger("app-router");t.AppRouter=function(t){function e(e,r,i,n){var o=a(this,t.call(this,e,r));return o.pipelineProvider=i,o.events=n,o}return s(e,t),e.inject=function(){return[i.Container,n.History,it,o.EventAggregator]},e.prototype.reset=function(){t.prototype.reset.call(this),this.maxInstructionCount=10,this._queue?this._queue.length=0:this._queue=[]},e.prototype.loadUrl=function(t){var e=this;return this._createNavigationInstruction(t).then(function(t){return e._queueInstruction(t)}).catch(function(t){nt.error(t),T(e)})},e.prototype.registerViewPort=function(e,r){var i=this;if(t.prototype.registerViewPort.call(this,e,r),this.isActive)this._dequeueInstruction();else{var n=this._findViewModel(e);if("configureRouter"in n){if(!this.isConfigured){var o=this._resolveConfiguredPromise;return this._resolveConfiguredPromise=function(){},this.configure(function(t){return n.configureRouter(t,i)}).then(function(){i.activate(),o()})}}else this.activate()}return Promise.resolve()},e.prototype.activate=function(t){this.isActive||(this.isActive=!0,this.options=Object.assign({routeHandler:this.loadUrl.bind(this)},this.options,t),this.history.activate(this.options),this._dequeueInstruction())},e.prototype.deactivate=function(){this.isActive=!1,this.history.deactivate()},e.prototype._queueInstruction=function(t){var e=this;return new Promise(function(r){t.resolve=r,e._queue.unshift(t),e._dequeueInstruction()})},e.prototype._dequeueInstruction=function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return Promise.resolve().then(function(){if(!t.isNavigating||e){var r=t._queue.shift();if(t._queue.length=0,r){t.isNavigating=!0;var i=t.history.getState("NavigationTracker");if(i||t.currentNavigationTracker?i?t.currentNavigationTracker?t.currentNavigationTracker<i?t.isNavigatingForward=!0:t.currentNavigationTracker>i&&(t.isNavigatingBack=!0):t.isNavigatingRefresh=!0:t.isNavigatingNew=!0:(t.isNavigatingFirst=!0,t.isNavigatingNew=!0),i||(i=Date.now(),t.history.setState("NavigationTracker",i)),t.currentNavigationTracker=i,r.previousInstruction=t.currentInstruction,e){if(e===t.maxInstructionCount-1)return nt.error(e+1+" navigation instructions have been attempted without success. Restoring last known good location."),T(t),t._dequeueInstruction(e+1);if(e>t.maxInstructionCount)throw new Error("Maximum navigation attempts exceeded. Giving up.")}else t.events.publish("router:navigation:processing",{instruction:r});return t.pipelineProvider.createPipeline(!t.couldDeactivate).run(r).then(function(i){return k(r,i,e,t)}).catch(function(t){return{output:t instanceof Error?t:new Error(t)}}).then(function(i){return E(r,i,!!e,t)})}}})},e.prototype._findViewModel=function(t){if(this.container.viewModel)return this.container.viewModel;if(t.container)for(var e=t.container;e;){if(e.viewModel)return this.container.viewModel=e.viewModel,e.viewModel;e=e.parent}},e}(K)}),define("aurelia-route-recognizer",["exports","aurelia-path"],function(t,e){"use strict";function r(t,e,r,i){var n=t;"/"===t.charAt(0)&&(n=t.substr(1));for(var o=[],a=n.split("/"),s=0,u=a.length;s<u;++s){var c=a[s],v=c.match(/^:([^?]+)(\?)?$/);if(v){var d=v,g=d[1],y=d[2];if(-1!==g.indexOf("="))throw new Error("Parameter "+g+" in route "+t+" has a default value, which is not supported.");o.push(new h(g,!!y)),e.push(g),r.dynamics++}else v=c.match(/^\*(.+)$/),v?(o.push(new p(v[1])),e.push(v[1]),r.stars++):""===c?o.push(new f):(o.push(new l(c,i)),r.statics++)}return o}function i(t){return t.sort(function(t,e){if(t.types.stars!==e.types.stars)return t.types.stars-e.types.stars;if(t.types.stars){if(t.types.statics!==e.types.statics)return e.types.statics-t.types.statics;if(t.types.dynamics!==e.types.dynamics)return e.types.dynamics-t.types.dynamics}return t.types.dynamics!==e.types.dynamics?t.types.dynamics-e.types.dynamics:t.types.statics!==e.types.statics?e.types.statics-t.types.statics:0})}function n(t,e){for(var r=[],i=0,n=t.length;i<n;i++){var o=t[i];r.push.apply(r,o.match(e))}return r}function o(t,e,r){for(var i=t.handlers,n=t.regex,o=e.match(n),a=1,s=new v(r),u=0,c=i.length;u<c;u++){for(var l=i[u],h=l.names,p={},f=0,d=h.length;f<d;f++)p[h[f]]=o[a++];s.push({handler:l.handler,params:p,isDynamic:!!h.length})}return s}function a(t,e){var r=t.put({validChars:"/"}),i=r;return e.eachChar(function(t){i=i.put(t)}),[r,i]}Object.defineProperty(t,"__esModule",{value:!0}),t.RouteRecognizer=t.EpsilonSegment=t.StarSegment=t.DynamicSegment=t.StaticSegment=t.State=void 0;var s=t.State=function(){function t(t){this.charSpec=t,this.nextStates=[]}return t.prototype.get=function(t){for(var e=this.nextStates,r=Array.isArray(e),i=0,e=r?e:e[Symbol.iterator]();;){var n;if(r){if(i>=e.length)break;n=e[i++]}else{if(i=e.next(),i.done)break;n=i.value}var o=n;if(o.charSpec.validChars===t.validChars&&o.charSpec.invalidChars===t.invalidChars)return o}},t.prototype.put=function(e){var r=this.get(e);return r||(r=new t(e),this.nextStates.push(r),e.repeat&&r.nextStates.push(r),r)},t.prototype.match=function(t){for(var e=this.nextStates,r=[],i=0,n=e.length;i<n;i++){var o=e[i],a=o.charSpec;void 0!==a.validChars?-1!==a.validChars.indexOf(t)&&r.push(o):void 0!==a.invalidChars&&-1===a.invalidChars.indexOf(t)&&r.push(o)}return r},t}(),u=["/",".","*","+","?","|","(",")","[","]","{","}","\\"],c=new RegExp("(\\"+u.join("|\\")+")","g"),l=t.StaticSegment=function(){function t(t,e){this.string=t,this.caseSensitive=e}return t.prototype.eachChar=function(t){for(var e=this.string,r=0,i=e.length;r<i;++r){var n=e[r];t({validChars:this.caseSensitive?n:n.toUpperCase()+n.toLowerCase()})}},t.prototype.regex=function(){return this.string.replace(c,"\\$1")},t.prototype.generate=function(){return this.string},t}(),h=t.DynamicSegment=function(){function t(t,e){this.name=t,this.optional=e}return t.prototype.eachChar=function(t){t({invalidChars:"/",repeat:!0})},t.prototype.regex=function(){return"([^/]+)"},t.prototype.generate=function(t,e){return e[this.name]=!0,t[this.name]},t}(),p=t.StarSegment=function(){function t(t){this.name=t}return t.prototype.eachChar=function(t){t({invalidChars:"",repeat:!0})},t.prototype.regex=function(){return"(.+)"},t.prototype.generate=function(t,e){return e[this.name]=!0,t[this.name]},t}(),f=t.EpsilonSegment=function(){function t(){}return t.prototype.eachChar=function(){},t.prototype.regex=function(){return""},t.prototype.generate=function(){return""},t}(),v=(t.RouteRecognizer=function(){function t(){this.rootState=new s,this.names={}}return t.prototype.add=function(t){var e=this;if(Array.isArray(t))return void t.forEach(function(t){return e.add(t)});for(var i=this.rootState,n=[],o="^",s={statics:0,dynamics:0,stars:0},u=[],c=t.handler.name,l=!0,h=r(t.path,u,s,t.caseSensitive),p=0,v=h.length;p<v;p++){var d=h[p];if(!(d instanceof f)){for(var g=a(i,d),y=g[0],m=g[1],w=0,b=n.length;w<b;w++)n[w].nextStates.push(y);d.optional?(n.push(m),o+="(?:/"+d.regex()+")?"):(i=m,o+="/"+d.regex(),n.length=0,l=!1)}}l&&(i=i.put({validChars:"/"}),o+="/?");var P=[{handler:t.handler,names:u}];if(c)for(var R=Array.isArray(c)?c:[c],S=0;S<R.length;S++)this.names[R[S]]={segments:h,handlers:P};for(var _=0;_<n.length;_++){var I=n[_];I.handlers=P,I.regex=new RegExp(o+"$",t.caseSensitive?"":"i"),I.types=s}return i.handlers=P,i.regex=new RegExp(o+"$",t.caseSensitive?"":"i"),i.types=s,i},t.prototype.handlersFor=function(t){var e=this.names[t];if(!e)throw new Error("There is no route named "+t);return[].concat(e.handlers)},t.prototype.hasRoute=function(t){return!!this.names[t]},t.prototype.generate=function(t,r){var i=this.names[t];if(!i)throw new Error("There is no route named "+t);var n=i.handlers[0].handler;if(n.generationUsesHref)return n.href;for(var o=Object.assign({},r),a=i.segments,s={},u="",c=0,l=a.length;c<l;c++){var h=a[c];if(!(h instanceof f)){var p=h.generate(o,s);if(null===p||void 0===p){if(!h.optional)throw new Error("A value is required for route parameter '"+h.name+"' in route '"+t+"'.")}else u+="/",u+=p}}"/"!==u.charAt(0)&&(u="/"+u);for(var v in s)delete o[v];var d=(0,e.buildQueryString)(o);return u+=d?"?"+d:""},t.prototype.recognize=function(t){var r=[this.rootState],a={},s=!1,u=t,c=u.indexOf("?");if(-1!==c){var l=u.substr(c+1,u.length);u=u.substr(0,c),a=(0,e.parseQueryString)(l)}u=decodeURI(u),"/"!==u.charAt(0)&&(u="/"+u);var h=u.length;h>1&&"/"===u.charAt(h-1)&&(u=u.substr(0,h-1),s=!0);for(var p=0,f=u.length;p<f&&(r=n(r,u.charAt(p)),r.length);p++);for(var v=[],d=0,g=r.length;d<g;d++)r[d].handlers&&v.push(r[d]);r=i(v);var y=v[0];if(y&&y.handlers)return s&&"(.+)$"===y.regex.source.slice(-5)&&(u+="/"),o(y,u,a)},t}(),function(t){this.splice=Array.prototype.splice,this.slice=Array.prototype.slice,this.push=Array.prototype.push,this.length=0,this.queryParams=t||{}})}),define("aurelia-history",["exports"],function(t){"use strict";function e(t){throw new Error("History must implement "+t+"().")}Object.defineProperty(t,"__esModule",{value:!0});t.History=function(){function t(){}return t.prototype.activate=function(t){e("activate")},t.prototype.deactivate=function(){e("deactivate")},t.prototype.getAbsoluteRoot=function(){e("getAbsoluteRoot")},t.prototype.navigate=function(t,r){e("navigate")},t.prototype.navigateBack=function(){e("navigateBack")},t.prototype.setTitle=function(t){e("setTitle")},t.prototype.setState=function(t,r){e("setState")},t.prototype.getState=function(t){e("getState")},t}()}),define("aurelia-history-browser",["exports","aurelia-pal","aurelia-history"],function(t,e,r){"use strict";function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function n(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function o(t){t.singleton(r.History,p),t.transient(l,h)}function a(t,e,r){if(r){var i=t.href.replace(/(javascript:|#).*$/,"");t.replace(i+"#"+e)}else t.hash="#"+e}function s(t,e,r){return t+"//"+e+(r?":"+r:"")}Object.defineProperty(t,"__esModule",{value:!0}),t.BrowserHistory=t.DefaultLinkHandler=t.LinkHandler=void 0,t.configure=o;var u,c,l=t.LinkHandler=function(){function t(){}return t.prototype.activate=function(t){},t.prototype.deactivate=function(){},t}(),h=t.DefaultLinkHandler=function(t){function r(){var e=i(this,t.call(this));return e.handler=function(t){var i=r.getEventInfo(t),n=i.shouldHandleEvent,o=i.href;n&&(t.preventDefault(),e.history.navigate(o))},e}return n(r,t),r.prototype.activate=function(t){t._hasPushState&&(this.history=t,e.DOM.addEventListener("click",this.handler,!0))},r.prototype.deactivate=function(){e.DOM.removeEventListener("click",this.handler)},r.getEventInfo=function(t){var e={shouldHandleEvent:!1,href:null,anchor:null},i=r.findClosestAnchor(t.target);if(!i||!r.targetIsThisWindow(i))return e;if(i.hasAttribute("download")||i.hasAttribute("router-ignore"))return e;if(t.altKey||t.ctrlKey||t.metaKey||t.shiftKey)return e;var n=i.getAttribute("href");e.anchor=i,e.href=n;var o=1===t.which,a=n&&!("#"===n.charAt(0)||/^[a-z]+:/i.test(n));return e.shouldHandleEvent=o&&a,e},r.findClosestAnchor=function(t){for(;t;){if("A"===t.tagName)return t;t=t.parentNode}},r.targetIsThisWindow=function(t){var r=t.getAttribute("target"),i=e.PLATFORM.global;return!r||r===i.name||"_self"===r},r}(l),p=t.BrowserHistory=(c=u=function(t){function r(r){var n=i(this,t.call(this));return n._isActive=!1,n._checkUrlCallback=n._checkUrl.bind(n),n.location=e.PLATFORM.location,n.history=e.PLATFORM.history,n.linkHandler=r,n}return n(r,t),r.prototype.activate=function(t){if(this._isActive)throw new Error("History has already been activated.");var r=!!t.pushState;this._isActive=!0,this.options=Object.assign({},{root:"/"},this.options,t),this.root=("/"+this.options.root+"/").replace(v,"/"),this._wantsHashChange=!1!==this.options.hashChange,this._hasPushState=!!(this.options.pushState&&this.history&&this.history.pushState);var i=void 0;if(this._hasPushState?i="popstate":this._wantsHashChange&&(i="hashchange"),e.PLATFORM.addEventListener(i,this._checkUrlCallback),this._wantsHashChange&&r){var n=this.location,o=n.pathname.replace(/[^\/]$/,"$&/")===this.root;if(!this._hasPushState&&!o)return this.fragment=this._getFragment(null,!0),this.location.replace(this.root+this.location.search+"#"+this.fragment),!0;this._hasPushState&&o&&n.hash&&(this.fragment=this._getHash().replace(f,""),this.history.replaceState({},e.DOM.title,this.root+this.fragment+n.search))}if(this.fragment||(this.fragment=this._getFragment()),this.linkHandler.activate(this),!this.options.silent)return this._loadUrl()},r.prototype.deactivate=function(){e.PLATFORM.removeEventListener("popstate",this._checkUrlCallback),e.PLATFORM.removeEventListener("hashchange",this._checkUrlCallback),this._isActive=!1,this.linkHandler.deactivate()},r.prototype.getAbsoluteRoot=function(){return""+s(this.location.protocol,this.location.hostname,this.location.port)+this.root},r.prototype.navigate=function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=r.trigger,n=void 0===i||i,o=r.replace,s=void 0!==o&&o;if(t&&g.test(t))return this.location.href=t,!0;if(!this._isActive)return!1;if(t=this._getFragment(t||""),this.fragment===t&&!s)return!1;this.fragment=t;var u=this.root+t;return""===t&&"/"!==u&&(u=u.slice(0,-1)),this._hasPushState?(u=u.replace("//","/"),this.history[s?"replaceState":"pushState"]({},e.DOM.title,u)):this._wantsHashChange?a(this.location,t,s):this.location.assign(u),!n||this._loadUrl(t)},r.prototype.navigateBack=function(){this.history.back()},r.prototype.setTitle=function(t){e.DOM.title=t},r.prototype.setState=function(t,e){var r=Object.assign({},this.history.state),i=this.location,n=i.pathname,o=i.search,a=i.hash;r[t]=e,this.history.replaceState(r,null,""+n+o+a)},r.prototype.getState=function(t){return Object.assign({},this.history.state)[t]},r.prototype._getHash=function(){return this.location.hash.substr(1)},r.prototype._getFragment=function(t,e){var r=void 0;return t||(this._hasPushState||!this._wantsHashChange||e?(t=this.location.pathname+this.location.search,r=this.root.replace(d,""),t.indexOf(r)||(t=t.substr(r.length))):t=this._getHash()),"/"+t.replace(f,"")},r.prototype._checkUrl=function(){this._getFragment()!==this.fragment&&this._loadUrl()},r.prototype._loadUrl=function(t){var e=this.fragment=this._getFragment(t);return!!this.options.routeHandler&&this.options.routeHandler(e)},r}(r.History),u.inject=[l],c),f=/^#?\/*|\s+$/g,v=/^\/+|\/+$/g,d=/\/$/,g=/^([a-z][a-z0-9+\-.]*:)?\/\//i});