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