From 7441aed6966237d8dcf821ccbeb489f18db035ad Mon Sep 17 00:00:00 2001 From: Elmore Cheng <9206414+ikeq@users.noreply.github.com> Date: Sat, 31 Aug 2019 02:44:20 -0700 Subject: [PATCH] support custom permalink (#127) --- README.md | 2 -- README_zh-Hans.md | 2 -- lib/config.js | 2 -- lib/filter/post.js | 6 ++--- lib/generator/config.js | 21 ++++++++++++++- lib/generator/entries/pages.js | 6 ++--- lib/generator/entries/posts.js | 4 +-- lib/generator/index.js | 26 +++++++++--------- lib/helper/url_trim.js | 6 ++--- lib/utils.js | 27 +++++++++++-------- package.json | 2 +- source/_resources.json | 2 +- ...66fcad.js => main.3c8fe2175e9d028e033b.js} | 2 +- ....ja.js => main.45d1e4209486560b00ce.ja.js} | 2 +- ...s => main.5f57ed8aacba80770b83.zh-Hans.js} | 2 +- ...s => main.dec5dcd89e85221e092e.zh-Hant.js} | 2 +- test/scripts/filters/post.js | 5 +++- test/scripts/utils/rest.js | 13 ++++----- 18 files changed, 77 insertions(+), 55 deletions(-) rename source/{main.aa5336b38b728b66fcad.js => main.3c8fe2175e9d028e033b.js} (72%) rename source/{main.c53a7c81fe2a67caf1e3.ja.js => main.45d1e4209486560b00ce.ja.js} (73%) rename source/{main.5be06e990995039d250c.zh-Hans.js => main.5f57ed8aacba80770b83.zh-Hans.js} (73%) rename source/{main.8afb50983316ecb0cc35.zh-Hant.js => main.dec5dcd89e85221e092e.zh-Hant.js} (73%) diff --git a/README.md b/README.md index b00e558..1e0cc6c 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,6 @@ - SPA built with [angular] - Custom accent color, background, fonts, dark mode - Custom code syntax highlighting -- Sub-page - Search - Comments - [Disqus] @@ -54,7 +53,6 @@ 2\. Config `HEXO/_config.yml` as follows: ```yml -permalink: post/:title/ theme: inside ``` diff --git a/README_zh-Hans.md b/README_zh-Hans.md index 306db87..9dcbc94 100644 --- a/README_zh-Hans.md +++ b/README_zh-Hans.md @@ -23,7 +23,6 @@ - SPA built with [angular] - 自定义色调、背景、字体、暗色主题 - 自定义代码语法高亮 -- 可嵌套 page 路由 - 评论 - [Disqus] - [LiveRe] @@ -53,7 +52,6 @@ 2\. 配置 `HEXO/_config.yml` 如下: ```yml -permalink: post/:title/ theme: inside ``` diff --git a/lib/config.js b/lib/config.js index 9a1023b..3a92d88 100644 --- a/lib/config.js +++ b/lib/config.js @@ -29,8 +29,6 @@ module.exports = function (hexo) { // override default language site.language = utils.localeId(site.language); - // override default permalink - site.permalink = 'post/:title/'; const __ = this.theme.i18n.__(site.language); diff --git a/lib/filter/post.js b/lib/filter/post.js index 7e527bc..296d016 100644 --- a/lib/filter/post.js +++ b/lib/filter/post.js @@ -2,7 +2,7 @@ const cheerio = require('cheerio'); const { date } = require('hexo/lib/plugins/helper/date'); const bounded = '
'; const table = '
'; -const { snippet, getPagePath, parseToc, isObject, isEmptyObject, localeId, pick } = require('../utils'); +const { snippet, parseToc, isObject, isEmptyObject, localeId, pick, trimHtml } = require('../utils'); // cache let hasComments, hasReward, hasToc, copyright, dateHelper, uriReplacer; @@ -37,7 +37,7 @@ module.exports = function (data) { s => s; // relative link - data.link = isPage ? getPagePath(data.source) : `post/${data.slug}`; + data.link = trimHtml(data.path); // permalink link data.plink = `${config.url}/${data.link}/`; // type @@ -47,7 +47,7 @@ module.exports = function (data) { data.comments = hasComments && data.comments !== false; // asset path - const assetPath = isPage ? getPagePath(data.source, true) : data.link; + const assetPath = isPage ? trimHtml(data.path, true) : data.link; // Make sure articles without titles are also accessible if (!data.title) data.title = data.slug diff --git a/lib/generator/config.js b/lib/generator/config.js index 20ea75b..6240b1d 100644 --- a/lib/generator/config.js +++ b/lib/generator/config.js @@ -25,9 +25,28 @@ module.exports = function (locals) { parseBackground(sidebar_background).color || accent_color] .concat(parseBackground(background).color || (theme.pwa && theme.pwa.theme_color) || []) + // post routes + config.routes = {} + config.routes.posts = [...locals.posts + .reduce((set, post) => { + // convert `/path/to/path/` to `:a/:b/:c` + const link = post.link.split('/').filter(i => i) + .map((_, i) => ':' + String.fromCharCode(97 + i)) + .join('/') + set.add(link) + return set + }, new Set)].sort() // page routes if (locals.pages.length) - config.routes = locals.pages.map(page => page.link).sort(); + config.routes.pages = [...locals.pages + .reduce((set, post) => { + // convert `/path/to/path/` to `path/:a/:b` + const link = post.link.split('/').filter(i => i) + .map((partial, i) => i === 0 ? partial : ':' + String.fromCharCode(97 + i)) + .join('/') + set.add(link) + return set + }, new Set)].sort() if (config.count.categories) config.firstCategory = locals.categories[0].name; diff --git a/lib/generator/entries/pages.js b/lib/generator/entries/pages.js index 273e450..e3485c1 100644 --- a/lib/generator/entries/pages.js +++ b/lib/generator/entries/pages.js @@ -1,16 +1,16 @@ const { flattenDeep } = require('lodash'); -const { getPagePath, pick } = require('../../utils'); +const { pick } = require('../../utils'); const { page: pageProps } = require('./properties'); module.exports = function ({ locals: { pages }, helpers }) { return flattenDeep([ pages.map(page => [ helpers.generateJson({ - path: `page/${page.link}`, + path: page.link, data: pick(page, pageProps) }), helpers.generateHtml({ - path: getPagePath(page.source), + path: page.link, data: page }) ]), diff --git a/lib/generator/entries/posts.js b/lib/generator/entries/posts.js index 0824873..3020ea8 100644 --- a/lib/generator/entries/posts.js +++ b/lib/generator/entries/posts.js @@ -13,7 +13,7 @@ module.exports = function ({ theme, locals: { posts }, helpers }) { return [ helpers.generateJson({ - path: `${post.link}`, + path: post.link, data: pick(post, postProps) }), helpers.generateHtml({ @@ -31,7 +31,7 @@ module.exports = function ({ theme, locals: { posts }, helpers }) { if (a.date === b.date) return 0; return a.date > b.date ? -1 : 1; }).map(pick(postListProps)), { perPage: config.per_page }, [ - { type: 'json', id: 'posts' }, + { type: 'json', id: 'page' }, { type: 'html', id: index => index === 1 ? '' : `page/${index}`, extend: { type: 'posts' } }, ]) ]); diff --git a/lib/generator/index.js b/lib/generator/index.js index 8b7826d..15dea9b 100644 --- a/lib/generator/index.js +++ b/lib/generator/index.js @@ -8,7 +8,7 @@ const generators = [ require('./manifest'), require('./sw') ]; -const builtInRoutes = ['page', 'post', 'categories', 'tags', 'archives', 'search', '404']; +const builtInRoutes = ['page', 'categories', 'tags', 'archives', 'search', '404']; module.exports = function (hexo) { // Remove hexo default generators @@ -27,21 +27,21 @@ module.exports = function (hexo) { return data; }).filter(data => data.posts.length), - pages: locals.pages - // Filter built-in routes to improve compatibility - .filter(page => { - if (builtInRoutes.includes(page.path.split('/')[0])) { - hexo.log.warn(page.path + ' won\'t be rendered.'); - return false; - } + pages: locals.pages.filter(filterBuiltInRoutes).toArray(), - return true; - }) - .toArray(), - - posts: locals.posts.filter(published).sort('-date').toArray() + posts: locals.posts.filter(published).filter(filterBuiltInRoutes).sort('-date').toArray() }; return flatten(generators.map(fn => fn.call(this, sLocals))); }); + + // Filter built-in routes to improve compatibility + function filterBuiltInRoutes(post) { + if (builtInRoutes.includes(post.path.split('/')[0])) { + hexo.log.warn(post.path + ' won\'t be rendered.'); + return false; + } + + return true; + } }; diff --git a/lib/helper/url_trim.js b/lib/helper/url_trim.js index 2504222..e6c95de 100644 --- a/lib/helper/url_trim.js +++ b/lib/helper/url_trim.js @@ -1,5 +1,5 @@ -module.exports = function (url) { - if (!url) return ''; +const { trimHtml } = require('../utils') - return url.replace(/index.html$/, ''); +module.exports = function (url) { + return url ? trimHtml(url) + '/' : ''; } diff --git a/lib/utils.js b/lib/utils.js index e617e77..15de5ea 100644 --- a/lib/utils.js +++ b/lib/utils.js @@ -59,21 +59,26 @@ exports.base64 = function (str) { } /** - * Align page path to support sub page + * Remove `/*.html` * - * source/page/index.md => /root/page - * source/page/v2.md => /root/page/v2 - * - * @param {string} source page.source - * @param {boolean} keepIndex + * @param {string} url + * @param {boolean} keepIndex keep `index` for `index.html`, used for post_asset_folder * @returns {string} */ -exports.getPagePath = function (source, keepIndex) { - let [paths, md] = source.split(/\/(?=[^\/]*md$)/); +exports.trimHtml = function (url, keepIndex) { + if (!url) return ''; + url = url.split('/') + + const last = url.pop() + if (last) { + if (last === 'index.html') { + if (keepIndex) url.push('index') + } else { + url.push(last.split('.')[0]) + } + } - if (md !== 'index.md') paths += '/' + md.substring(0, md.indexOf('.md')); - else if (keepIndex) paths += '/index'; - return paths; + return url.join('/'); } exports.Pagination = class { diff --git a/package.json b/package.json index 8327b39..49d06ab 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "hexo-theme-inside", - "version": "2.4.0-beta.1", + "version": "2.4.0-beta.2", "description": "❤️ SPA, flat and clean theme for Hexo.", "scripts": { "test": "jasmine --config=test/jasmine.json" diff --git a/source/_resources.json b/source/_resources.json index 70a3fc8..b065edd 100644 --- a/source/_resources.json +++ b/source/_resources.json @@ -1 +1 @@ -{"root":"is-a","styles":["styles.9477318680c7e6b720a2.css"],"scripts":["runtime.caef73fae70e33459c5a.js","polyfills.28555e618578fe61f50a.js"],"locales":{"zh-Hans":"main.5be06e990995039d250c.zh-Hans.js","zh-Hant":"main.8afb50983316ecb0cc35.zh-Hant.js","en":"main.aa5336b38b728b66fcad.js","ja":"main.c53a7c81fe2a67caf1e3.ja.js"}} +{"root":"is-a","styles":["styles.9477318680c7e6b720a2.css"],"scripts":["runtime.caef73fae70e33459c5a.js","polyfills.28555e618578fe61f50a.js"],"locales":{"en":"main.3c8fe2175e9d028e033b.js","ja":"main.45d1e4209486560b00ce.ja.js","zh-Hans":"main.5f57ed8aacba80770b83.zh-Hans.js","zh-Hant":"main.dec5dcd89e85221e092e.zh-Hant.js"}} diff --git a/source/main.aa5336b38b728b66fcad.js b/source/main.3c8fe2175e9d028e033b.js similarity index 72% rename from source/main.aa5336b38b728b66fcad.js rename to source/main.3c8fe2175e9d028e033b.js index a61f575..bd73f3b 100644 --- a/source/main.aa5336b38b728b66fcad.js +++ b/source/main.3c8fe2175e9d028e033b.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[1],{0:function(t,e,n){t.exports=n("zUnb")},zUnb:function(t,e,n){"use strict";n.r(e);var r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)};function o(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var i=function(){return(i=Object.assign||function(t){for(var e,n=1,r=arguments.length;n=0;u--)(o=t[u])&&(l=(i<3?o(l):i>3?o(e,n,l):o(e,n))||l);return i>3&&l&&Object.defineProperty(e,n,l),l}function u(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}function a(t){var e="function"==typeof Symbol&&t[Symbol.iterator],n=0;return e?e.call(t):{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}}}function s(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,i=n.call(t),l=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)l.push(r.value)}catch(u){o={error:u}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return l}function c(){for(var t=[],e=0;e0?this._next(e.shift()):0===this.active&&this.hasCompleted&&this.destination.complete()},e}(W);function et(t){return t}function nt(t){return void 0===t&&(t=Number.POSITIVE_INFINITY),J(et,t)}function rt(t,e){return e?K(t,e):new O(F(t))}function ot(){return function(t){return t.lift(new it(t))}}var it=function(){function t(t){this.connectable=t}return t.prototype.call=function(t,e){var n=this.connectable;n._refCount++;var r=new lt(t,n),o=e.subscribe(r);return r.closed||(r.connection=n.connect()),o},t}(),lt=function(t){function e(e,n){var r=t.call(this,e)||this;return r.connectable=n,r}return o(e,t),e.prototype._unsubscribe=function(){var t=this.connectable;if(t){this.connectable=null;var e=t._refCount;if(e<=0)this.connection=null;else if(t._refCount=e-1,e>1)this.connection=null;else{var n=this.connection,r=t._connection;this.connection=null,!r||n&&r!==n||r.unsubscribe()}}else this.connection=null},e}(C),ut=function(t){function e(e,n){var r=t.call(this)||this;return r.source=e,r.subjectFactory=n,r._refCount=0,r._isComplete=!1,r}return o(e,t),e.prototype._subscribe=function(t){return this.getSubject().subscribe(t)},e.prototype.getSubject=function(){var t=this._subject;return t&&!t.isStopped||(this._subject=this.subjectFactory()),this._subject},e.prototype.connect=function(){var t=this._connection;return t||(this._isComplete=!1,(t=this._connection=new v).add(this.source.subscribe(new st(this.getSubject(),this))),t.closed&&(this._connection=null,t=v.EMPTY)),t},e.prototype.refCount=function(){return ot()(this)},e}(O).prototype,at={operator:{value:null},_refCount:{value:0,writable:!0},_subject:{value:null,writable:!0},_connection:{value:null,writable:!0},_subscribe:{value:ut._subscribe},_isComplete:{value:ut._isComplete,writable:!0},getSubject:{value:ut.getSubject},connect:{value:ut.connect},refCount:{value:ut.refCount}},st=function(t){function e(e,n){var r=t.call(this,e)||this;return r.connectable=n,r}return o(e,t),e.prototype._error=function(e){this._unsubscribe(),t.prototype._error.call(this,e)},e.prototype._complete=function(){this.connectable._isComplete=!0,this._unsubscribe(),t.prototype._complete.call(this)},e.prototype._unsubscribe=function(){var t=this.connectable;if(t){this.connectable=null;var e=t._connection;t._refCount=0,t._subject=null,t._connection=null,e&&e.unsubscribe()}},e}(D);function ct(){return new M}var ft="__parameters__",pt="__prop__metadata__";function ht(t){return function(){for(var e=[],n=0;n ");else if("object"==typeof e){var i=[];for(var l in e)if(e.hasOwnProperty(l)){var u=e[l];i.push(l+":"+("string"==typeof u?JSON.stringify(u):Et(u)))}o="{"+i.join(", ")+"}"}return n+(r?"("+r+")":"")+"["+o+"]: "+t.replace(Ut,"\n ")}var Zt=function(){return function(){}}(),Gt=function(){return function(){}}();function Qt(t,e,n){e>=t.length?t.push(n):t.splice(e,0,n)}function Kt(t,e){return e>=t.length-1?t.pop():t.splice(e,1)[0]}var Yt=function(t){return t[t.Emulated=0]="Emulated",t[t.Native=1]="Native",t[t.None=2]="None",t[t.ShadowDom=3]="ShadowDom",t}({}),Jt=function(){return("undefined"!=typeof requestAnimationFrame&&requestAnimationFrame||setTimeout).bind(Dt)}(),Xt="ngDebugContext",te="ngOriginalError",ee="ngErrorLogger";function ne(t){return t[Xt]}function re(t){return t[te]}function oe(t){for(var e=[],n=1;n',!this.inertBodyElement.querySelector||this.inertBodyElement.querySelector("svg")?(this.inertBodyElement.innerHTML='

',this.getInertBodyElement=this.inertBodyElement.querySelector&&this.inertBodyElement.querySelector("svg img")&&function(){try{return!!window.DOMParser}catch(t){return!1}}()?this.getInertBodyElement_DOMParser:this.getInertBodyElement_InertDocument):this.getInertBodyElement=this.getInertBodyElement_XHR}return t.prototype.getInertBodyElement_XHR=function(t){t=""+t+"";try{t=encodeURI(t)}catch(r){return null}var e=new XMLHttpRequest;e.responseType="document",e.open("GET","data:text/html;charset=utf-8,"+t,!1),e.send(void 0);var n=e.response.body;return n.removeChild(n.firstChild),n},t.prototype.getInertBodyElement_DOMParser=function(t){t=""+t+"";try{var e=(new window.DOMParser).parseFromString(t,"text/html").body;return e.removeChild(e.firstChild),e}catch(n){return null}},t.prototype.getInertBodyElement_InertDocument=function(t){var e=this.inertDocument.createElement("template");return"content"in e?(e.innerHTML=t,e):(this.inertBodyElement.innerHTML=t,this.defaultDoc.documentMode&&this.stripCustomNsAttrs(this.inertBodyElement),this.inertBodyElement)},t.prototype.stripCustomNsAttrs=function(t){for(var e=t.attributes,n=e.length-1;0"),!0},t.prototype.endElement=function(t){var e=t.nodeName.toLowerCase();we.hasOwnProperty(e)&&!ve.hasOwnProperty(e)&&(this.buf.push(""))},t.prototype.chars=function(t){this.buf.push(Te(t))},t.prototype.checkClobberedElement=function(t,e){if(e&&(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_CONTAINED_BY)===Node.DOCUMENT_POSITION_CONTAINED_BY)throw new Error("Failed to sanitize html because the element is clobbered: "+t.outerHTML);return e},t}(),ke=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,Ie=/([^\#-~ |!])/g;function Te(t){return t.replace(/&/g,"&").replace(ke,function(t){return"&#"+(1024*(t.charCodeAt(0)-55296)+(t.charCodeAt(1)-56320)+65536)+";"}).replace(Ie,function(t){return"&#"+t.charCodeAt(0)+";"}).replace(//g,">")}function Oe(t){return"content"in t&&function(t){return t.nodeType===Node.ELEMENT_NODE&&"TEMPLATE"===t.nodeName}(t)?t.content:null}var Pe=function(t){return t[t.NONE=0]="NONE",t[t.HTML=1]="HTML",t[t.STYLE=2]="STYLE",t[t.SCRIPT=3]="SCRIPT",t[t.URL=4]="URL",t[t.RESOURCE_URL=5]="RESOURCE_URL",t}({}),Ae=function(){return function(){}}(),Re=new RegExp("^([-,.\"'%_!# a-zA-Z0-9]+|(?:(?:matrix|translate|scale|rotate|skew|perspective)(?:X|Y|Z|3d)?|(?:rgb|hsl)a?|(?:repeating-)?(?:linear|radial)-gradient|(?:calc|attr))\\([-0-9.%, #a-zA-Z]+\\))$","g"),Ne=/^url\(([^)]+)\)$/,De=/([A-Z])/g;function Me(t){try{return null!=t?t.toString().slice(0,30):t}catch(e){return"[ERROR] Exception while trying to serialize the value"}}var Le=function(){function t(){}return t.__NG_ELEMENT_ID__=function(){return je()},t}(),je=function(){for(var t=[],e=0;e-1}(r)||"root"===o.providedIn&&r._def.isRoot))){var c=t._providers.length;return t._def.providers[c]=t._def.providersByKey[e.tokenKey]={flags:5120,value:u.factory,deps:[],index:c,token:e.token},t._providers[c]=Dr,t._providers[c]=Vr(t,t._def.providersByKey[e.tokenKey])}return 4&e.flags?n:t._parent.get(e.token,n)}finally{Bt(i)}}function Vr(t,e){var n;switch(201347067&e.flags){case 512:n=function(t,e,n){var r=n.length;switch(r){case 0:return new e;case 1:return new e(Fr(t,n[0]));case 2:return new e(Fr(t,n[0]),Fr(t,n[1]));case 3:return new e(Fr(t,n[0]),Fr(t,n[1]),Fr(t,n[2]));default:for(var o=new Array(r),i=0;i=n.length)&&(e=n.length-1),e<0)return null;var r=n[e];return r.viewContainerParent=null,Kt(n,e),Jn.dirtyParentQueries(r),Br(r),r}function zr(t,e,n){var r=e?gr(e,e.def.lastRenderRootNode):t.renderElement,o=n.renderer.parentNode(r),i=n.renderer.nextSibling(r);Sr(n,2,o,i,void 0)}function Br(t){Sr(t,3,null,null,void 0)}var qr=new Object;function $r(t,e,n,r,o,i){return new Wr(t,e,n,r,o,i)}var Wr=function(t){function e(e,n,r,o,i,l){var u=t.call(this)||this;return u.selector=e,u.componentType=n,u._inputs=o,u._outputs=i,u.ngContentSelectors=l,u.viewDefFactory=r,u}return o(e,t),Object.defineProperty(e.prototype,"inputs",{get:function(){var t=[],e=this._inputs;for(var n in e)t.push({propName:n,templateName:e[n]});return t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"outputs",{get:function(){var t=[];for(var e in this._outputs)t.push({propName:e,templateName:this._outputs[e]});return t},enumerable:!0,configurable:!0}),e.prototype.create=function(t,e,n,r){if(!r)throw new Error("ngModule should be provided");var o=Cr(this.viewDefFactory),i=o.nodes[0].element.componentProvider.nodeIndex,l=Jn.createRootView(t,e||[],n,o,r,qr),u=Qn(l,i).instance;return n&&l.renderer.setAttribute(Gn(l,0).renderElement,"ng-version",xn.full),new Zr(l,new Yr(l),u)},e}(un),Zr=function(t){function e(e,n,r){var o=t.call(this)||this;return o._view=e,o._viewRef=n,o._component=r,o._elDef=o._view.def.nodes[0],o.hostView=n,o.changeDetectorRef=n,o.instance=r,o}return o(e,t),Object.defineProperty(e.prototype,"location",{get:function(){return new gn(Gn(this._view,this._elDef.nodeIndex).renderElement)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"injector",{get:function(){return new eo(this._view,this._elDef)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"componentType",{get:function(){return this._component.constructor},enumerable:!0,configurable:!0}),e.prototype.destroy=function(){this._viewRef.destroy()},e.prototype.onDestroy=function(t){this._viewRef.onDestroy(t)},e}(ln);function Gr(t,e,n){return new Qr(t,e,n)}var Qr=function(){function t(t,e,n){this._view=t,this._elDef=e,this._data=n,this._embeddedViews=[]}return Object.defineProperty(t.prototype,"element",{get:function(){return new gn(this._data.renderElement)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"injector",{get:function(){return new eo(this._view,this._elDef)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"parentInjector",{get:function(){for(var t=this._view,e=this._elDef.parent;!e&&t;)e=dr(t),t=t.parent;return t?new eo(t,e):new eo(this._view,null)},enumerable:!0,configurable:!0}),t.prototype.clear=function(){for(var t=this._embeddedViews.length-1;t>=0;t--){var e=Hr(this._data,t);Jn.destroyView(e)}},t.prototype.get=function(t){var e=this._embeddedViews[t];if(e){var n=new Yr(e);return n.attachToViewContainerRef(this),n}return null},Object.defineProperty(t.prototype,"length",{get:function(){return this._embeddedViews.length},enumerable:!0,configurable:!0}),t.prototype.createEmbeddedView=function(t,e,n){var r=t.createEmbeddedView(e||{});return this.insert(r,n),r},t.prototype.createComponent=function(t,e,n,r,o){var i=n||this.parentInjector;o||t instanceof hn||(o=i.get(Zt));var l=t.create(i,r,void 0,o);return this.insert(l.hostView,e),l},t.prototype.insert=function(t,e){if(t.destroyed)throw new Error("Cannot insert a destroyed View in a ViewContainer!");var n,r,o,i,l=t;return i=(n=this._data).viewContainer._embeddedViews,null==(r=e)&&(r=i.length),(o=l._view).viewContainerParent=this._view,Qt(i,r,o),function(t,e){var n=hr(e);if(n&&n!==t&&!(16&e.state)){e.state|=16;var r=n.template._projectedViews;r||(r=n.template._projectedViews=[]),r.push(e),function(t,n){if(!(4&n.flags)){e.parent.def.nodeFlags|=4,n.flags|=4;for(var r=n.parent;r;)r.childFlags|=4,r=r.parent}}(0,e.parentNodeDef)}}(n,o),Jn.dirtyParentQueries(o),zr(n,r>0?i[r-1]:null,o),l.attachToViewContainerRef(this),t},t.prototype.move=function(t,e){if(t.destroyed)throw new Error("Cannot move a destroyed View in a ViewContainer!");var n,r,o,i,l,u=this._embeddedViews.indexOf(t._view);return o=e,l=(i=(n=this._data).viewContainer._embeddedViews)[r=u],Kt(i,r),null==o&&(o=i.length),Qt(i,o,l),Jn.dirtyParentQueries(l),Br(l),zr(n,o>0?i[o-1]:null,l),t},t.prototype.indexOf=function(t){return this._embeddedViews.indexOf(t._view)},t.prototype.remove=function(t){var e=Hr(this._data,t);e&&Jn.destroyView(e)},t.prototype.detach=function(t){var e=Hr(this._data,t);return e?new Yr(e):null},t}();function Kr(t){return new Yr(t)}var Yr=function(){function t(t){this._view=t,this._viewContainerRef=null,this._appRef=null}return Object.defineProperty(t.prototype,"rootNodes",{get:function(){return Sr(this._view,0,void 0,void 0,t=[]),t;var t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"context",{get:function(){return this._view.context},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"destroyed",{get:function(){return 0!=(128&this._view.state)},enumerable:!0,configurable:!0}),t.prototype.markForCheck=function(){cr(this._view)},t.prototype.detach=function(){this._view.state&=-5},t.prototype.detectChanges=function(){var t=this._view.root.rendererFactory;t.begin&&t.begin();try{Jn.checkAndUpdateView(this._view)}finally{t.end&&t.end()}},t.prototype.checkNoChanges=function(){Jn.checkNoChangesView(this._view)},t.prototype.reattach=function(){this._view.state|=4},t.prototype.onDestroy=function(t){this._view.disposables||(this._view.disposables=[]),this._view.disposables.push(t)},t.prototype.destroy=function(){this._appRef?this._appRef.detachView(this):this._viewContainerRef&&this._viewContainerRef.detach(this._viewContainerRef.indexOf(this)),Jn.destroyView(this._view)},t.prototype.detachFromAppRef=function(){this._appRef=null,Br(this._view),Jn.dirtyParentQueries(this._view)},t.prototype.attachToAppRef=function(t){if(this._viewContainerRef)throw new Error("This view is already attached to a ViewContainer!");this._appRef=t},t.prototype.attachToViewContainerRef=function(t){if(this._appRef)throw new Error("This view is already attached directly to the ApplicationRef!");this._viewContainerRef=t},t}();function Jr(t,e){return new Xr(t,e)}var Xr=function(t){function e(e,n){var r=t.call(this)||this;return r._parentView=e,r._def=n,r}return o(e,t),e.prototype.createEmbeddedView=function(t){return new Yr(Jn.createEmbeddedView(this._parentView,this._def,this._def.element.template,t))},Object.defineProperty(e.prototype,"elementRef",{get:function(){return new gn(Gn(this._parentView,this._def.nodeIndex).renderElement)},enumerable:!0,configurable:!0}),e}(Un);function to(t,e){return new eo(t,e)}var eo=function(){function t(t,e){this.view=t,this.elDef=e}return t.prototype.get=function(t,e){return void 0===e&&(e=Ve.THROW_IF_NOT_FOUND),Jn.resolveDep(this.view,this.elDef,!!this.elDef&&0!=(33554432&this.elDef.flags),{flags:0,token:t,tokenKey:er(t)},e)},t}();function no(t,e){var n=t.def.nodes[e];if(1&n.flags){var r=Gn(t,n.nodeIndex);return n.element.template?r.template:r.renderElement}if(2&n.flags)return Zn(t,n.nodeIndex).renderText;if(20240&n.flags)return Qn(t,n.nodeIndex).instance;throw new Error("Illegal state: read nodeValue for node index "+e)}function ro(t){return new oo(t.renderer)}var oo=function(){function t(t){this.delegate=t}return t.prototype.selectRootElement=function(t){return this.delegate.selectRootElement(t)},t.prototype.createElement=function(t,e){var n=s(Pr(e),2),r=this.delegate.createElement(n[1],n[0]);return t&&this.delegate.appendChild(t,r),r},t.prototype.createViewRoot=function(t){return t},t.prototype.createTemplateAnchor=function(t){var e=this.delegate.createComment("");return t&&this.delegate.appendChild(t,e),e},t.prototype.createText=function(t,e){var n=this.delegate.createText(e);return t&&this.delegate.appendChild(t,n),n},t.prototype.projectNodes=function(t,e){for(var n=0;n0,e.provider.value,e.provider.deps);if(e.outputs.length)for(var r=0;r0,r=e.provider;switch(201347067&e.flags){case 512:return Eo(t,e.parent,n,r.value,r.deps);case 1024:return function(t,e,n,r,o){var i=o.length;switch(i){case 0:return r();case 1:return r(Io(t,e,n,o[0]));case 2:return r(Io(t,e,n,o[0]),Io(t,e,n,o[1]));case 3:return r(Io(t,e,n,o[0]),Io(t,e,n,o[1]),Io(t,e,n,o[2]));default:for(var l=Array(i),u=0;u0&&(o=setTimeout(function(){r._callbacks=r._callbacks.filter(function(t){return t.timeoutId!==o}),t(r._didWork,r.getPendingTasks())},e)),this._callbacks.push({doneCb:t,timeoutId:o,updateCb:n})},t.prototype.whenStable=function(t,e,n){if(n&&!this.taskTrackingZone)throw new Error('Task tracking zone is required when passing an update callback to whenStable(). Is "zone.js/dist/task-tracking.js" loaded?');this.addCallback(t,e,n),this._runCallbacksIfReady()},t.prototype.getPendingRequestCount=function(){return this._pendingCount},t.prototype.findProviders=function(t,e,n){return[]},t}(),Ei=function(){function t(){this._applications=new Map,ki.addToWindow(this)}return t.prototype.registerApplication=function(t,e){this._applications.set(t,e)},t.prototype.unregisterApplication=function(t){this._applications.delete(t)},t.prototype.unregisterAllApplications=function(){this._applications.clear()},t.prototype.getTestability=function(t){return this._applications.get(t)||null},t.prototype.getAllTestabilities=function(){return Array.from(this._applications.values())},t.prototype.getAllRootElements=function(){return Array.from(this._applications.keys())},t.prototype.findTestabilityInTree=function(t,e){return void 0===e&&(e=!0),ki.findTestabilityInTree(this,t,e)},l([u("design:paramtypes",[])],t)}(),ki=new(function(){function t(){}return t.prototype.addToWindow=function(t){},t.prototype.findTestabilityInTree=function(t,e,n){return null},t}()),Ii=new Mt("AllowMultipleToken"),Ti=function(){return function(t,e){this.name=t,this.token=e}}();function Oi(t,e,n){void 0===n&&(n=[]);var r="Platform: "+e,o=new Mt(r);return function(e){void 0===e&&(e=[]);var i=Pi();if(!i||i.injector.get(Ii,!1))if(t)t(n.concat(e).concat({provide:o,useValue:!0}));else{var l=n.concat(e).concat({provide:o,useValue:!0});!function(t){if(xi&&!xi.destroyed&&!xi.injector.get(Ii,!1))throw new Error("There can be only one platform. Destroy the previous one to create a new one.");xi=t.get(Ai);var e=t.get(Go,null);e&&e.forEach(function(t){return t()})}(Ve.create({providers:l,name:r}))}return function(t){var e=Pi();if(!e)throw new Error("No platform exists!");if(!e.injector.get(t,null))throw new Error("A platform with a different configuration has been created. Please destroy it first.");return e}(o)}}function Pi(){return xi&&!xi.destroyed?xi:null}var Ai=function(){function t(t){this._injector=t,this._modules=[],this._destroyListeners=[],this._destroyed=!1}return t.prototype.bootstrapModuleFactory=function(t,e){var n,r=this,o="noop"===(n=e?e.ngZone:void 0)?new Ci:("zone.js"===n?void 0:n)||new vi({enableLongStackTrace:ae()}),i=[{provide:vi,useValue:o}];return o.run(function(){var e=Ve.create({providers:i,parent:r.injector,name:t.moduleType.name}),n=t.create(e),l=n.injector.get(ie,null);if(!l)throw new Error("No ErrorHandler. Is platform module (BrowserModule) included?");return n.onDestroy(function(){return Di(r._modules,n)}),o.runOutsideAngular(function(){return o.onError.subscribe({next:function(t){l.handleError(t)}})}),function(t,e,o){try{var i=((l=n.injector.get(Wo)).runInitializers(),l.donePromise.then(function(){return r._moduleDoBootstrap(n),n}));return nn(i)?i.catch(function(n){throw e.runOutsideAngular(function(){return t.handleError(n)}),n}):i}catch(u){throw e.runOutsideAngular(function(){return t.handleError(u)}),u}var l}(l,o)})},t.prototype.bootstrapModule=function(t,e){var n=this;void 0===e&&(e=[]);var r=Ri({},e);return function(t,e,n){return t.get(ai).createCompiler([e]).compileModuleAsync(n)}(this.injector,r,t).then(function(t){return n.bootstrapModuleFactory(t,r)})},t.prototype._moduleDoBootstrap=function(t){var e=t.injector.get(Ni);if(t._bootstrapComponents.length>0)t._bootstrapComponents.forEach(function(t){return e.bootstrap(t)});else{if(!t.instance.ngDoBootstrap)throw new Error("The module "+Et(t.instance.constructor)+' was bootstrapped, but it does not declare "@NgModule.bootstrap" components nor a "ngDoBootstrap" method. Please define one of these.');t.instance.ngDoBootstrap(e)}this._modules.push(t)},t.prototype.onDestroy=function(t){this._destroyListeners.push(t)},Object.defineProperty(t.prototype,"injector",{get:function(){return this._injector},enumerable:!0,configurable:!0}),t.prototype.destroy=function(){if(this._destroyed)throw new Error("The platform has already been destroyed!");this._modules.slice().forEach(function(t){return t.destroy()}),this._destroyListeners.forEach(function(t){return t()}),this._destroyed=!0},Object.defineProperty(t.prototype,"destroyed",{get:function(){return this._destroyed},enumerable:!0,configurable:!0}),t}();function Ri(t,e){return Array.isArray(e)?e.reduce(Ri,t):i({},t,e)}var Ni=function(){function t(t,e,n,r,o,i){var l=this;this._zone=t,this._console=e,this._injector=n,this._exceptionHandler=r,this._componentFactoryResolver=o,this._initStatus=i,this._bootstrapListeners=[],this._views=[],this._runningTick=!1,this._enforceNoNewChanges=!1,this._stable=!0,this.componentTypes=[],this.components=[],this._enforceNoNewChanges=ae(),this._zone.onMicrotaskEmpty.subscribe({next:function(){l._zone.run(function(){l.tick()})}});var u=new O(function(t){l._stable=l._zone.isStable&&!l._zone.hasPendingMacrotasks&&!l._zone.hasPendingMicrotasks,l._zone.runOutsideAngular(function(){t.next(l._stable),t.complete()})}),a=new O(function(t){var e;l._zone.runOutsideAngular(function(){e=l._zone.onStable.subscribe(function(){vi.assertNotInAngularZone(),gi(function(){l._stable||l._zone.hasPendingMacrotasks||l._zone.hasPendingMicrotasks||(l._stable=!0,t.next(!0))})})});var n=l._zone.onUnstable.subscribe(function(){vi.assertInAngularZone(),l._stable&&(l._stable=!1,l._zone.runOutsideAngular(function(){t.next(!1)}))});return function(){e.unsubscribe(),n.unsubscribe()}});this.isStable=function(){for(var t=[],e=0;e1&&"number"==typeof t[t.length-1]&&(n=t.pop())):"number"==typeof o&&(n=t.pop()),null===r&&1===t.length&&t[0]instanceof O?t[0]:nt(n)(rt(t,r))}(u,a.pipe(function(t){return ot()((e=ct,function(t){var n;n="function"==typeof e?e:function(){return e};var r=Object.create(t,at);return r.source=t,r.subjectFactory=n,r})(t));var e}))}var e;return e=t,t.prototype.bootstrap=function(t,e){var n,r=this;if(!this._initStatus.done)throw new Error("Cannot bootstrap as there are still asynchronous initializers running. Bootstrap components in the `ngDoBootstrap` method of the root module.");n=t instanceof un?t:this._componentFactoryResolver.resolveComponentFactory(t),this.componentTypes.push(n.componentType);var o=n instanceof hn?null:this._injector.get(Zt),i=n.create(Ve.NULL,[],e||n.selector,o);i.onDestroy(function(){r._unloadComponent(i)});var l=i.injector.get(Si,null);return l&&i.injector.get(Ei).registerApplication(i.location.nativeElement,l),this._loadComponent(i),ae()&&this._console.log("Angular is running in the development mode. Call enableProdMode() to enable the production mode."),i},t.prototype.tick=function(){var t,n,r,o,i=this;if(this._runningTick)throw new Error("ApplicationRef.tick is called recursively");var l=e._tickScope();try{this._runningTick=!0;try{for(var u=a(this._views),s=u.next();!s.done;s=u.next())s.value.detectChanges()}catch(p){t={error:p}}finally{try{s&&!s.done&&(n=u.return)&&n.call(u)}finally{if(t)throw t.error}}if(this._enforceNoNewChanges)try{for(var c=a(this._views),f=c.next();!f.done;f=c.next())f.value.checkNoChanges()}catch(h){r={error:h}}finally{try{f&&!f.done&&(o=c.return)&&o.call(c)}finally{if(r)throw r.error}}}catch(d){this._zone.runOutsideAngular(function(){return i._exceptionHandler.handleError(d)})}finally{this._runningTick=!1,hi(l)}},t.prototype.attachView=function(t){var e=t;this._views.push(e),e.attachToAppRef(this)},t.prototype.detachView=function(t){var e=t;Di(this._views,e),e.detachFromAppRef()},t.prototype._loadComponent=function(t){this.attachView(t.hostView),this.tick(),this.components.push(t),this._injector.get(Ko,[]).concat(this._bootstrapListeners).forEach(function(e){return e(t)})},t.prototype._unloadComponent=function(t){this.detachView(t.hostView),Di(this.components,t)},t.prototype.ngOnDestroy=function(){this._views.slice().forEach(function(t){return t.destroy()})},Object.defineProperty(t.prototype,"viewCount",{get:function(){return this._views.length},enumerable:!0,configurable:!0}),t._tickScope=pi("ApplicationRef#tick()"),t}();function Di(t,e){var n=t.indexOf(e);n>-1&&t.splice(n,1)}var Mi=function(){return function(){}}(),Li=function(){return function(){}}(),ji={factoryPathPrefix:"",factoryPathSuffix:".ngfactory"},Ui=function(){function t(t,e){this._compiler=t,this._config=e||ji}return t.prototype.load=function(t){return this._compiler instanceof ui?this.loadFactory(t):this.loadAndCompile(t)},t.prototype.loadAndCompile=function(t){var e=this,r=s(t.split("#"),2),o=r[0],i=r[1];return void 0===i&&(i="default"),n("zn8P")(o).then(function(t){return t[i]}).then(function(t){return Fi(t,o,i)}).then(function(t){return e._compiler.compileModuleAsync(t)})},t.prototype.loadFactory=function(t){var e=s(t.split("#"),2),r=e[0],o=e[1],i="NgFactory";return void 0===o&&(o="default",i=""),n("zn8P")(this._config.factoryPathPrefix+r+this._config.factoryPathSuffix).then(function(t){return t[o+i]}).then(function(t){return Fi(t,r,o)})},t}();function Fi(t,e,n){if(!t)throw new Error("Cannot find '"+n+"' in '"+e+"'");return t}var Vi=function(){return function(t,e){this.name=t,this.callback=e}}(),Hi=function(){function t(t,e,n){this.listeners=[],this.parent=null,this._debugContext=n,this.nativeNode=t,e&&e instanceof zi&&e.addChild(this)}return Object.defineProperty(t.prototype,"injector",{get:function(){return this._debugContext.injector},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"componentInstance",{get:function(){return this._debugContext.component},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"context",{get:function(){return this._debugContext.context},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"references",{get:function(){return this._debugContext.references},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"providerTokens",{get:function(){return this._debugContext.providerTokens},enumerable:!0,configurable:!0}),t}(),zi=function(t){function e(e,n,r){var o=t.call(this,e,n,r)||this;return o.properties={},o.attributes={},o.classes={},o.styles={},o.childNodes=[],o.nativeElement=e,o}return o(e,t),e.prototype.addChild=function(t){t&&(this.childNodes.push(t),t.parent=this)},e.prototype.removeChild=function(t){var e=this.childNodes.indexOf(t);-1!==e&&(t.parent=null,this.childNodes.splice(e,1))},e.prototype.insertChildrenAfter=function(t,e){var n,r=this,o=this.childNodes.indexOf(t);-1!==o&&((n=this.childNodes).splice.apply(n,c([o+1,0],e)),e.forEach(function(e){e.parent&&e.parent.removeChild(e),t.parent=r}))},e.prototype.insertBefore=function(t,e){var n=this.childNodes.indexOf(t);-1===n?this.addChild(e):(e.parent&&e.parent.removeChild(e),e.parent=this,this.childNodes.splice(n,0,e))},e.prototype.query=function(t){return this.queryAll(t)[0]||null},e.prototype.queryAll=function(t){var e=[];return function t(e,n,r){e.childNodes.forEach(function(e){e instanceof zi&&(n(e)&&r.push(e),t(e,n,r))})}(this,t,e),e},e.prototype.queryAllNodes=function(t){var e=[];return function t(e,n,r){e instanceof zi&&e.childNodes.forEach(function(e){n(e)&&r.push(e),e instanceof zi&&t(e,n,r)})}(this,t,e),e},Object.defineProperty(e.prototype,"children",{get:function(){return this.childNodes.filter(function(t){return t instanceof e})},enumerable:!0,configurable:!0}),e.prototype.triggerEventHandler=function(t,e){this.listeners.forEach(function(n){n.name==t&&n.callback(e)})},e}(Hi),Bi=new Map,qi=function(t){return Bi.get(t)||null};function $i(t){Bi.set(t.nativeNode,t)}var Wi=Oi(null,"core",[{provide:Qo,useValue:"unknown"},{provide:Ai,deps:[Ve]},{provide:Ei,deps:[]},{provide:Yo,deps:[]}]);function Zi(){return Ln}function Gi(){return jn}function Qi(t){return t?(Xo&&(e=r=t,n="Expected localeId to be defined",null==e&&function(t){throw new Error("ASSERTION ERROR: "+t)}(n),"string"==typeof r&&r.toLowerCase().replace(/_/g,"-")),t):Fo;var e,n,r}function Ki(t){var e=[];return t.onStable.subscribe(function(){for(;e.length;)e.pop()()}),function(t){e.push(t)}}var Yi=function(){return function(t){}}();function Ji(t,e,n,r,o,i){t|=1;var l=br(e);return{nodeIndex:-1,parent:null,renderParent:null,bindingIndex:-1,outputIndex:-1,flags:t,checkIndex:-1,childFlags:0,directChildFlags:0,childMatchedQueries:0,matchedQueries:l.matchedQueries,matchedQueryIds:l.matchedQueryIds,references:l.references,ngContentIndex:n,childCount:r,bindings:[],bindingFlags:0,outputs:[],element:{ns:null,name:null,attrs:null,template:i?Cr(i):null,componentProvider:null,componentView:null,componentRendererType:null,publicProviders:null,allProviders:null,handleEvent:o||Xn},provider:null,text:null,query:null,ngContent:null}}function Xi(t,e,n,r,o,i,l,u,a,c,f,p){var h;void 0===l&&(l=[]),c||(c=Xn);var d=br(n),g=d.matchedQueries,v=d.references,y=d.matchedQueryIds,m=null,b=null;i&&(m=(h=s(Pr(i),2))[0],b=h[1]),u=u||[];for(var w=new Array(u.length),_=0;_0)s=g,yl(g)||(c=g);else for(;s&&d===s.nodeIndex+s.childCount;){var m=s.parent;m&&(m.childFlags|=s.childFlags,m.childMatchedQueries|=s.childMatchedQueries),c=(s=m)&&yl(s)?s.renderParent:s}}return{factory:null,nodeFlags:l,rootNodeFlags:u,nodeMatchedQueries:a,flags:t,nodes:e,updateDirectives:n||Xn,updateRenderer:r||Xn,handleEvent:function(t,n,r,o){return e[n].element.handleEvent(t,r,o)},bindingCount:o,outputCount:i,lastRenderRootNode:h}}function yl(t){return 0!=(1&t.flags)&&null===t.element.name}function ml(t,e,n){var r=e.element&&e.element.template;if(r){if(!r.lastRenderRootNode)throw new Error("Illegal State: Embedded templates without nodes are not allowed!");if(r.lastRenderRootNode&&16777216&r.lastRenderRootNode.flags)throw new Error("Illegal State: Last root node of a template can't have embedded views, at index "+e.nodeIndex+"!")}if(20224&e.flags&&0==(1&(t?t.flags:0)))throw new Error("Illegal State: StaticProvider/Directive nodes need to be children of elements or anchors, at index "+e.nodeIndex+"!");if(e.query){if(67108864&e.flags&&(!t||0==(16384&t.flags)))throw new Error("Illegal State: Content Query nodes need to be children of directives, at index "+e.nodeIndex+"!");if(134217728&e.flags&&t)throw new Error("Illegal State: View Query nodes have to be top level nodes, at index "+e.nodeIndex+"!")}if(e.childCount){var o=t?t.nodeIndex+t.childCount:n-1;if(e.nodeIndex<=o&&e.nodeIndex+e.childCount>o)throw new Error("Illegal State: childCount of node leads outside of parent, at index "+e.nodeIndex+"!")}}function bl(t,e,n,r){var o=xl(t.root,t.renderer,t,e,n);return Cl(o,t.component,r),Sl(o),o}function wl(t,e,n){var r=xl(t,t.renderer,null,null,e);return Cl(r,n,n),Sl(r),r}function _l(t,e,n,r){var o,i=e.element.componentRendererType;return o=i?t.root.rendererFactory.createRenderer(r,i):t.root.renderer,xl(t.root,o,t,e.element.componentProvider,n)}function xl(t,e,n,r,o){var i=new Array(o.nodes.length),l=o.outputCount?new Array(o.outputCount):null;return{def:o,parent:n,viewContainerParent:null,parentNodeDef:r,context:null,component:null,nodes:i,state:13,root:t,renderer:e,oldValues:new Array(o.bindingCount),disposables:l,initIndex:-1}}function Cl(t,e,n){t.component=e,t.context=n}function Sl(t){var e;vr(t)&&(e=Gn(t.parent,t.parentNodeDef.parent.nodeIndex).renderElement);for(var n=t.def,r=t.nodes,o=0;o0&&rl(t,e,0,n)&&(h=!0),p>1&&rl(t,e,1,r)&&(h=!0),p>2&&rl(t,e,2,o)&&(h=!0),p>3&&rl(t,e,3,i)&&(h=!0),p>4&&rl(t,e,4,l)&&(h=!0),p>5&&rl(t,e,5,u)&&(h=!0),p>6&&rl(t,e,6,a)&&(h=!0),p>7&&rl(t,e,7,s)&&(h=!0),p>8&&rl(t,e,8,c)&&(h=!0),p>9&&rl(t,e,9,f)&&(h=!0),h}(t,e,n,r,o,i,l,u,a,s,c,f);case 2:return function(t,e,n,r,o,i,l,u,a,s,c,f){var p=!1,h=e.bindings,d=h.length;if(d>0&&ar(t,e,0,n)&&(p=!0),d>1&&ar(t,e,1,r)&&(p=!0),d>2&&ar(t,e,2,o)&&(p=!0),d>3&&ar(t,e,3,i)&&(p=!0),d>4&&ar(t,e,4,l)&&(p=!0),d>5&&ar(t,e,5,u)&&(p=!0),d>6&&ar(t,e,6,a)&&(p=!0),d>7&&ar(t,e,7,s)&&(p=!0),d>8&&ar(t,e,8,c)&&(p=!0),d>9&&ar(t,e,9,f)&&(p=!0),p){var g=e.text.prefix;d>0&&(g+=gl(n,h[0])),d>1&&(g+=gl(r,h[1])),d>2&&(g+=gl(o,h[2])),d>3&&(g+=gl(i,h[3])),d>4&&(g+=gl(l,h[4])),d>5&&(g+=gl(u,h[5])),d>6&&(g+=gl(a,h[6])),d>7&&(g+=gl(s,h[7])),d>8&&(g+=gl(c,h[8])),d>9&&(g+=gl(f,h[9]));var v=Zn(t,e.nodeIndex).renderText;t.renderer.setValue(v,g)}return p}(t,e,n,r,o,i,l,u,a,s,c,f);case 16384:return function(t,e,n,r,o,i,l,u,a,s,c,f){var p=Qn(t,e.nodeIndex),h=p.instance,d=!1,g=void 0,v=e.bindings.length;return v>0&&ur(t,e,0,n)&&(d=!0,g=Oo(t,p,e,0,n,g)),v>1&&ur(t,e,1,r)&&(d=!0,g=Oo(t,p,e,1,r,g)),v>2&&ur(t,e,2,o)&&(d=!0,g=Oo(t,p,e,2,o,g)),v>3&&ur(t,e,3,i)&&(d=!0,g=Oo(t,p,e,3,i,g)),v>4&&ur(t,e,4,l)&&(d=!0,g=Oo(t,p,e,4,l,g)),v>5&&ur(t,e,5,u)&&(d=!0,g=Oo(t,p,e,5,u,g)),v>6&&ur(t,e,6,a)&&(d=!0,g=Oo(t,p,e,6,a,g)),v>7&&ur(t,e,7,s)&&(d=!0,g=Oo(t,p,e,7,s,g)),v>8&&ur(t,e,8,c)&&(d=!0,g=Oo(t,p,e,8,c,g)),v>9&&ur(t,e,9,f)&&(d=!0,g=Oo(t,p,e,9,f,g)),g&&h.ngOnChanges(g),65536&e.flags&&Wn(t,256,e.nodeIndex)&&h.ngOnInit(),262144&e.flags&&h.ngDoCheck(),d}(t,e,n,r,o,i,l,u,a,s,c,f);case 32:case 64:case 128:return function(t,e,n,r,o,i,l,u,a,s,c,f){var p=e.bindings,h=!1,d=p.length;if(d>0&&ar(t,e,0,n)&&(h=!0),d>1&&ar(t,e,1,r)&&(h=!0),d>2&&ar(t,e,2,o)&&(h=!0),d>3&&ar(t,e,3,i)&&(h=!0),d>4&&ar(t,e,4,l)&&(h=!0),d>5&&ar(t,e,5,u)&&(h=!0),d>6&&ar(t,e,6,a)&&(h=!0),d>7&&ar(t,e,7,s)&&(h=!0),d>8&&ar(t,e,8,c)&&(h=!0),d>9&&ar(t,e,9,f)&&(h=!0),h){var g=Kn(t,e.nodeIndex),v=void 0;switch(201347067&e.flags){case 32:v=new Array(p.length),d>0&&(v[0]=n),d>1&&(v[1]=r),d>2&&(v[2]=o),d>3&&(v[3]=i),d>4&&(v[4]=l),d>5&&(v[5]=u),d>6&&(v[6]=a),d>7&&(v[7]=s),d>8&&(v[8]=c),d>9&&(v[9]=f);break;case 64:v={},d>0&&(v[p[0].name]=n),d>1&&(v[p[1].name]=r),d>2&&(v[p[2].name]=o),d>3&&(v[p[3].name]=i),d>4&&(v[p[4].name]=l),d>5&&(v[p[5].name]=u),d>6&&(v[p[6].name]=a),d>7&&(v[p[7].name]=s),d>8&&(v[p[8].name]=c),d>9&&(v[p[9].name]=f);break;case 128:var y=n;switch(d){case 1:v=y.transform(n);break;case 2:v=y.transform(r);break;case 3:v=y.transform(r,o);break;case 4:v=y.transform(r,o,i);break;case 5:v=y.transform(r,o,i,l);break;case 6:v=y.transform(r,o,i,l,u);break;case 7:v=y.transform(r,o,i,l,u,a);break;case 8:v=y.transform(r,o,i,l,u,a,s);break;case 9:v=y.transform(r,o,i,l,u,a,s,c);break;case 10:v=y.transform(r,o,i,l,u,a,s,c,f)}}g.value=v}return h}(t,e,n,r,o,i,l,u,a,s,c,f);default:throw"unreachable"}}(t,e,r,o,i,l,u,a,s,f,p,h):function(t,e,n){switch(201347067&e.flags){case 1:return function(t,e,n){for(var r=!1,o=0;o0&&sr(t,e,0,n),p>1&&sr(t,e,1,r),p>2&&sr(t,e,2,o),p>3&&sr(t,e,3,i),p>4&&sr(t,e,4,l),p>5&&sr(t,e,5,u),p>6&&sr(t,e,6,a),p>7&&sr(t,e,7,s),p>8&&sr(t,e,8,c),p>9&&sr(t,e,9,f)}(t,e,r,o,i,l,u,a,s,c,f,p):function(t,e,n){for(var r=0;r0){var i=new Set(t.modules);Wl.forEach(function(e,r){if(i.has(Ct(r).providedIn)){var o={token:r,flags:e.flags|(n?4096:0),deps:wr(e.deps),value:e.value,index:t.providers.length};t.providers.push(o),t.providersByKey[er(r)]=o}})}}(t=t.factory(function(){return Xn})),t):t}(r))}var $l=new Map,Wl=new Map,Zl=new Map;function Gl(t){var e;$l.set(t.token,t),"function"==typeof t.token&&(e=Ct(t.token))&&"function"==typeof e.providedIn&&Wl.set(t.token,t)}function Ql(t,e){var n=Cr(e.viewDefFactory),r=Cr(n.nodes[0].element.componentView);Zl.set(t,r)}function Kl(){$l.clear(),Wl.clear(),Zl.clear()}function Yl(t){if(0===$l.size)return t;var e=function(t){for(var e=[],n=null,r=0;r0?e.substring(1):e},e.prototype.prepareExternalUrl=function(t){var e=Wu.joinWithSlash(this._baseHref,t);return e.length>0?"#"+e:e},e.prototype.pushState=function(t,e,n,r){var o=this.prepareExternalUrl(n+Wu.normalizeQueryParams(r));0==o.length&&(o=this._platformLocation.pathname),this._platformLocation.pushState(t,e,o)},e.prototype.replaceState=function(t,e,n,r){var o=this.prepareExternalUrl(n+Wu.normalizeQueryParams(r));0==o.length&&(o=this._platformLocation.pathname),this._platformLocation.replaceState(t,e,o)},e.prototype.forward=function(){this._platformLocation.forward()},e.prototype.back=function(){this._platformLocation.back()},e}(qu),Qu=function(t){function e(e,n){var r=t.call(this)||this;if(r._platformLocation=e,null==n&&(n=r._platformLocation.getBaseHrefFromDOM()),null==n)throw new Error("No base href set. Please provide a value for the APP_BASE_HREF token or add a base element to the document.");return r._baseHref=n,r}return o(e,t),e.prototype.onPopState=function(t){this._platformLocation.onPopState(t),this._platformLocation.onHashChange(t)},e.prototype.getBaseHref=function(){return this._baseHref},e.prototype.prepareExternalUrl=function(t){return Wu.joinWithSlash(this._baseHref,t)},e.prototype.path=function(t){void 0===t&&(t=!1);var e=this._platformLocation.pathname+Wu.normalizeQueryParams(this._platformLocation.search),n=this._platformLocation.hash;return n&&t?""+e+n:e},e.prototype.pushState=function(t,e,n,r){var o=this.prepareExternalUrl(n+Wu.normalizeQueryParams(r));this._platformLocation.pushState(t,e,o)},e.prototype.replaceState=function(t,e,n,r){var o=this.prepareExternalUrl(n+Wu.normalizeQueryParams(r));this._platformLocation.replaceState(t,e,o)},e.prototype.forward=function(){this._platformLocation.forward()},e.prototype.back=function(){this._platformLocation.back()},e}(qu),Ku=function(t){return t[t.Zero=0]="Zero",t[t.One=1]="One",t[t.Two=2]="Two",t[t.Few=3]="Few",t[t.Many=4]="Many",t[t.Other=5]="Other",t}({}),Yu=function(t){return t[t.Format=0]="Format",t[t.Standalone=1]="Standalone",t}({}),Ju=function(t){return t[t.Narrow=0]="Narrow",t[t.Abbreviated=1]="Abbreviated",t[t.Wide=2]="Wide",t[t.Short=3]="Short",t}({}),Xu=function(t){return t[t.Short=0]="Short",t[t.Medium=1]="Medium",t[t.Long=2]="Long",t[t.Full=3]="Full",t}({}),ta=function(t){return t[t.Decimal=0]="Decimal",t[t.Group=1]="Group",t[t.List=2]="List",t[t.PercentSign=3]="PercentSign",t[t.PlusSign=4]="PlusSign",t[t.MinusSign=5]="MinusSign",t[t.Exponential=6]="Exponential",t[t.SuperscriptingExponent=7]="SuperscriptingExponent",t[t.PerMille=8]="PerMille",t[t[1/0]=9]="Infinity",t[t.NaN=10]="NaN",t[t.TimeSeparator=11]="TimeSeparator",t[t.CurrencyDecimal=12]="CurrencyDecimal",t[t.CurrencyGroup=13]="CurrencyGroup",t}({});function ea(t,e){return la(Uo(t)[Mo.DateFormat],e)}function na(t,e){return la(Uo(t)[Mo.TimeFormat],e)}function ra(t,e){return la(Uo(t)[Mo.DateTimeFormat],e)}function oa(t,e){var n=Uo(t),r=n[Mo.NumberSymbols][e];if(void 0===r){if(e===ta.CurrencyDecimal)return n[Mo.NumberSymbols][ta.Decimal];if(e===ta.CurrencyGroup)return n[Mo.NumberSymbols][ta.Group]}return r}function ia(t){if(!t[Mo.ExtraData])throw new Error('Missing extra locale data for the locale "'+t[Mo.LocaleId]+'". Use "registerLocaleData" to load new data. See the "I18n guide" on angular.io to know more.')}function la(t,e){for(var n=e;n>-1;n--)if(void 0!==t[n])return t[n];throw new Error("Locale data API: locale data undefined")}function ua(t){var e=s(t.split(":"),2);return{hours:+e[0],minutes:+e[1]}}var aa=/^(\d{4})-?(\d\d)-?(\d\d)(?:T(\d\d)(?::?(\d\d)(?::?(\d\d)(?:\.(\d+))?)?)?(Z|([+-])(\d\d):?(\d\d))?)?$/,sa={},ca=/((?:[^GyMLwWdEabBhHmsSzZO']+)|(?:'(?:[^']|'')*')|(?:G{1,5}|y{1,4}|M{1,5}|L{1,5}|w{1,2}|W{1}|d{1,2}|E{1,6}|a{1,5}|b{1,5}|B{1,5}|h{1,2}|H{1,2}|m{1,2}|s{1,2}|S{1,3}|z{1,4}|Z{1,5}|O{1,4}))([\s\S]*)/,fa=function(t){return t[t.Short=0]="Short",t[t.ShortGMT=1]="ShortGMT",t[t.Long=2]="Long",t[t.Extended=3]="Extended",t}({}),pa=function(t){return t[t.FullYear=0]="FullYear",t[t.Month=1]="Month",t[t.Date=2]="Date",t[t.Hours=3]="Hours",t[t.Minutes=4]="Minutes",t[t.Seconds=5]="Seconds",t[t.FractionalSeconds=6]="FractionalSeconds",t[t.Day=7]="Day",t}({}),ha=function(t){return t[t.DayPeriods=0]="DayPeriods",t[t.Days=1]="Days",t[t.Months=2]="Months",t[t.Eras=3]="Eras",t}({});function da(t,e){return e&&(t=t.replace(/\{([^}]+)}/g,function(t,n){return null!=e&&n in e?e[n]:t})),t}function ga(t,e,n,r,o){void 0===n&&(n="-");var i="";(t<0||o&&t<=0)&&(o?t=1-t:(t=-t,i=n));for(var l=String(t);l.length0||a>-n)&&(a+=n),t===pa.Hours)0===a&&-12===n&&(a=12);else if(t===pa.FractionalSeconds)return u=e,ga(a,3).substr(0,u);var s=oa(l,ta.MinusSign);return ga(a,e,s,r,o)}}function ya(t,e,n,r){return void 0===n&&(n=Yu.Format),void 0===r&&(r=!1),function(o,i){return function(t,e,n,r,o,i){switch(n){case ha.Months:return function(t,e,n){var r=Uo(t),o=la([r[Mo.MonthsFormat],r[Mo.MonthsStandalone]],e);return la(o,n)}(e,o,r)[t.getMonth()];case ha.Days:return function(t,e,n){var r=Uo(t),o=la([r[Mo.DaysFormat],r[Mo.DaysStandalone]],e);return la(o,n)}(e,o,r)[t.getDay()];case ha.DayPeriods:var l=t.getHours(),u=t.getMinutes();if(i){var a,s=function(t){var e=Uo(t);return ia(e),(e[Mo.ExtraData][2]||[]).map(function(t){return"string"==typeof t?ua(t):[ua(t[0]),ua(t[1])]})}(e),c=function(t,e,n){var r=Uo(t);ia(r);var o=la([r[Mo.ExtraData][0],r[Mo.ExtraData][1]],e)||[];return la(o,n)||[]}(e,o,r);if(s.forEach(function(t,e){if(Array.isArray(t)){var n=t[0],r=t[1],o=r.hours;l>=n.hours&&u>=n.minutes&&(l0?Math.floor(o/60):Math.ceil(o/60);switch(t){case fa.Short:return(o>=0?"+":"")+ga(l,2,i)+ga(Math.abs(o%60),2,i);case fa.ShortGMT:return"GMT"+(o>=0?"+":"")+ga(l,1,i);case fa.Long:return"GMT"+(o>=0?"+":"")+ga(l,2,i)+":"+ga(Math.abs(o%60),2,i);case fa.Extended:return 0===r?"Z":(o>=0?"+":"")+ga(l,2,i)+":"+ga(Math.abs(o%60),2,i);default:throw new Error('Unknown zone width "'+t+'"')}}}var ba=0,wa=4;function _a(t,e){return void 0===e&&(e=!1),function(n,r){var o,i,l,u;if(e){var a=new Date(n.getFullYear(),n.getMonth(),1).getDay()-1,s=n.getDate();o=1+Math.floor((s+a)/7)}else{var c=(l=n.getFullYear(),u=new Date(l,ba,1).getDay(),new Date(l,0,1+(u<=wa?wa:wa+7)-u)),f=(i=n,new Date(i.getFullYear(),i.getMonth(),i.getDate()+(wa-i.getDay()))).getTime()-c.getTime();o=1+Math.round(f/6048e5)}return ga(o,t,oa(r,ta.MinusSign))}}var xa={};function Ca(t,e){t=t.replace(/:/g,"");var n=Date.parse("Jan 01, 1970 00:00:00 "+t)/6e4;return isNaN(n)?e:n}function Sa(t){return t instanceof Date&&!isNaN(t.valueOf())}var Ea=new Mt("UseV4Plurals"),ka=function(){return function(){}}(),Ia=function(t){function e(e,n){var r=t.call(this)||this;return r.locale=e,r.deprecatedPluralFn=n,r}return o(e,t),e.prototype.getPluralCategory=function(t,e){switch(this.deprecatedPluralFn?this.deprecatedPluralFn(e||this.locale,t):function(t){return Uo(t)[Mo.PluralCase]}(e||this.locale)(t)){case Ku.Zero:return"zero";case Ku.One:return"one";case Ku.Two:return"two";case Ku.Few:return"few";case Ku.Many:return"many";default:return"other"}},e}(ka),Ta=function(){return function(){}}(),Oa=function(){function t(t,e,n,r){this._iterableDiffers=t,this._keyValueDiffers=e,this._ngEl=n,this._renderer=r,this._initialClasses=[]}return t.prototype.getValue=function(){return null},t.prototype.setClass=function(t){this._removeClasses(this._initialClasses),this._initialClasses="string"==typeof t?t.split(/\s+/):[],this._applyClasses(this._initialClasses),this._applyClasses(this._rawClass)},t.prototype.setNgClass=function(t){this._removeClasses(this._rawClass),this._applyClasses(this._initialClasses),this._iterableDiffer=null,this._keyValueDiffer=null,this._rawClass="string"==typeof t?t.split(/\s+/):t,this._rawClass&&(tn(this._rawClass)?this._iterableDiffer=this._iterableDiffers.find(this._rawClass).create():this._keyValueDiffer=this._keyValueDiffers.find(this._rawClass).create())},t.prototype.applyChanges=function(){if(this._iterableDiffer){var t=this._iterableDiffer.diff(this._rawClass);t&&this._applyIterableChanges(t)}else if(this._keyValueDiffer){var e=this._keyValueDiffer.diff(this._rawClass);e&&this._applyKeyValueChanges(e)}},t.prototype._applyKeyValueChanges=function(t){var e=this;t.forEachAddedItem(function(t){return e._toggleClass(t.key,t.currentValue)}),t.forEachChangedItem(function(t){return e._toggleClass(t.key,t.currentValue)}),t.forEachRemovedItem(function(t){t.previousValue&&e._toggleClass(t.key,!1)})},t.prototype._applyIterableChanges=function(t){var e=this;t.forEachAddedItem(function(t){if("string"!=typeof t.item)throw new Error("NgClass can only toggle CSS classes expressed as strings, got "+Et(t.item));e._toggleClass(t.item,!0)}),t.forEachRemovedItem(function(t){return e._toggleClass(t.item,!1)})},t.prototype._applyClasses=function(t){var e=this;t&&(Array.isArray(t)||t instanceof Set?t.forEach(function(t){return e._toggleClass(t,!0)}):Object.keys(t).forEach(function(n){return e._toggleClass(n,!!t[n])}))},t.prototype._removeClasses=function(t){var e=this;t&&(Array.isArray(t)||t instanceof Set?t.forEach(function(t){return e._toggleClass(t,!1)}):Object.keys(t).forEach(function(t){return e._toggleClass(t,!1)}))},t.prototype._toggleClass=function(t,e){var n=this;(t=t.trim())&&t.split(/\s+/g).forEach(function(t){e?n._renderer.addClass(n._ngEl.nativeElement,t):n._renderer.removeClass(n._ngEl.nativeElement,t)})},t}(),Pa=function(t){function e(e){return t.call(this,e)||this}return o(e,t),Object.defineProperty(e.prototype,"klass",{set:function(t){this._delegate.setClass(t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"ngClass",{set:function(t){this._delegate.setNgClass(t)},enumerable:!0,configurable:!0}),e.prototype.ngDoCheck=function(){this._delegate.applyChanges()},e}(function(){function t(t){this._delegate=t}return t.prototype.getValue=function(){return this._delegate.getValue()},t.ngDirectiveDef=void 0,t}()),Aa=function(){function t(t,e,n,r){this.$implicit=t,this.ngForOf=e,this.index=n,this.count=r}return Object.defineProperty(t.prototype,"first",{get:function(){return 0===this.index},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"last",{get:function(){return this.index===this.count-1},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"even",{get:function(){return this.index%2==0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"odd",{get:function(){return!this.even},enumerable:!0,configurable:!0}),t}(),Ra=function(){function t(t,e,n){this._viewContainer=t,this._template=e,this._differs=n,this._ngForOfDirty=!0,this._differ=null}return Object.defineProperty(t.prototype,"ngForOf",{set:function(t){this._ngForOf=t,this._ngForOfDirty=!0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"ngForTrackBy",{get:function(){return this._trackByFn},set:function(t){ae()&&null!=t&&"function"!=typeof t&&console&&console.warn&&console.warn("trackBy must be a function, but received "+JSON.stringify(t)+". See https://angular.io/docs/ts/latest/api/common/index/NgFor-directive.html#!#change-propagation for more information."),this._trackByFn=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"ngForTemplate",{set:function(t){t&&(this._template=t)},enumerable:!0,configurable:!0}),t.prototype.ngDoCheck=function(){if(this._ngForOfDirty){this._ngForOfDirty=!1;var t=this._ngForOf;if(!this._differ&&t)try{this._differ=this._differs.find(t).create(this.ngForTrackBy)}catch(r){throw new Error("Cannot find a differ supporting object '"+t+"' of type '"+((e=t).name||typeof e)+"'. NgFor only supports binding to Iterables such as Arrays.")}}var e;if(this._differ){var n=this._differ.diff(this._ngForOf);n&&this._applyChanges(n)}},t.prototype._applyChanges=function(t){var e=this,n=[];t.forEachOperation(function(t,r,o){if(null==t.previousIndex){var i=e._viewContainer.createEmbeddedView(e._template,new Aa(null,e._ngForOf,-1,-1),null===o?void 0:o),l=new Na(t,i);n.push(l)}else null==o?e._viewContainer.remove(null===r?void 0:r):null!==r&&(i=e._viewContainer.get(r),e._viewContainer.move(i,o),l=new Na(t,i),n.push(l))});for(var r=0;r"};return t.replace(/&[^;]+;/g,function(t){return e[t]})},t.ngInjectableDef=xt({factory:function(){return new t(qt(Su),qt(Za))},token:t,providedIn:"root"}),t}(),Ja=function(){function t(){this.subject=new M,this.state=this.subject.asObservable(),this.busy=!1}return t.prototype.show=function(){this.busy=!0,this.subject.next(!0)},t.prototype.hide=function(){this.busy=!1,this.subject.next(!1)},t.ngInjectableDef=xt({factory:function(){return new t},token:t,providedIn:"root"}),t}(),Xa=function(){function t(t,e){this.loader=t,this.app=e,this.version="",this.prefix=this.app.config.data_prefix,this.version=this.app.config.hash||""}return t.prototype.get=function(t){var e=this;t=this.getFullUrl(t);var n=this.app.getCache(t.split("?")[0]);return n?Promise.resolve(n):(this.loader.show(),ku.fetch(t).then(function(t){return e.loader.hide(),t.json()}).catch(function(t){return e.loader.hide(),Promise.reject(t)}))},t.prototype.request=function(t){var e=this;return this.loader.show(),ku.fetch(t.url,t).then(function(t){return e.loader.hide(),t.json()}).catch(function(t){return e.loader.hide(),Promise.reject(t)})},t.prototype.getFullUrl=function(t){return this.prefix+"/"+function(t){var e,n,r,o,i,l,u,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",s="",c=0;for(t=function(t){t=t.replace(/\r\n/g,"\n");for(var e="",n=0;n127&&r<2048?(e+=String.fromCharCode(r>>6|192),e+=String.fromCharCode(63&r|128)):(e+=String.fromCharCode(r>>12|224),e+=String.fromCharCode(r>>6&63|128),e+=String.fromCharCode(63&r|128))}return e}(t);c>2,i=(3&e)<<4|(n=t.charCodeAt(c++))>>4,l=(15&n)<<2|(r=t.charCodeAt(c++))>>6,u=63&r,isNaN(n)?l=u=64:isNaN(r)&&(u=64),s=s+a.charAt(o)+a.charAt(i)+a.charAt(l)+a.charAt(u);return s.replace(/=/g,"")}(t.replace(/(^\/*|\/*$)/g,""))+".json?v="+this.version},t.ngInjectableDef=xt({factory:function(){return new t(qt(Ja),qt(Ya))},token:t,providedIn:"root"}),t}();function ts(){for(var t=[],e=0;e0)for(var n=this.count>=this.total?this.total:this.count,r=this.ring,o=0;o=2;return function(r){return r.pipe(t?fs(function(e,n){return t(e,n,r)}):et,vs(1),n?Cs(e):bs(function(){return new rs}))}}function Is(t){return function(e){var n=new Ts(t),r=e.lift(n);return n.caught=r}}var Ts=function(){function t(t){this.selector=t}return t.prototype.call=function(t,e){return e.subscribe(new Os(t,this.selector,this.caught))},t}(),Os=function(t){function e(e,n,r){var o=t.call(this,e)||this;return o.selector=n,o.caught=r,o}return o(e,t),e.prototype.error=function(e){if(!this.isStopped){var n=void 0;try{n=this.selector(e,this.caught)}catch(o){return void t.prototype.error.call(this,o)}this._unsubscribeAndRecycle();var r=new U(this,void 0,void 0);this.add(r),$(this,n,void 0,void 0,r)}},e}(W);function Ps(t){return function(e){return 0===t?as():e.lift(new As(t))}}var As=function(){function t(t){if(this.total=t,this.total<0)throw new gs}return t.prototype.call=function(t,e){return e.subscribe(new Rs(t,this.total))},t}(),Rs=function(t){function e(e,n){var r=t.call(this,e)||this;return r.total=n,r.count=0,r}return o(e,t),e.prototype._next=function(t){var e=this.total,n=++this.count;n<=e&&(this.destination.next(t),n===e&&(this.destination.complete(),this.unsubscribe()))},e}(C);function Ns(t,e){var n=arguments.length>=2;return function(r){return r.pipe(t?fs(function(e,n){return t(e,n,r)}):et,Ps(1),n?Cs(e):bs(function(){return new rs}))}}var Ds=function(){function t(t,e,n){this.predicate=t,this.thisArg=e,this.source=n}return t.prototype.call=function(t,e){return e.subscribe(new Ms(t,this.predicate,this.thisArg,this.source))},t}(),Ms=function(t){function e(e,n,r,o){var i=t.call(this,e)||this;return i.predicate=n,i.thisArg=r,i.source=o,i.index=0,i.thisArg=r||i,i}return o(e,t),e.prototype.notifyComplete=function(t){this.destination.next(t),this.destination.complete()},e.prototype._next=function(t){var e=!1;try{e=this.predicate.call(this.thisArg,t,this.index++,this.source)}catch(n){return void this.destination.error(n)}e||this.notifyComplete(!1)},e.prototype._complete=function(){this.notifyComplete(!0)},e}(C);function Ls(t,e){return"function"==typeof e?function(n){return n.pipe(Ls(function(n,r){return Y(t(n,r)).pipe(Z(function(t,o){return e(n,t,r,o)}))}))}:function(e){return e.lift(new js(t))}}var js=function(){function t(t){this.project=t}return t.prototype.call=function(t,e){return e.subscribe(new Us(t,this.project))},t}(),Us=function(t){function e(e,n){var r=t.call(this,e)||this;return r.project=n,r.index=0,r}return o(e,t),e.prototype._next=function(t){var e,n=this.index++;try{e=this.project(t,n)}catch(r){return void this.destination.error(r)}this._innerSub(e,t,n)},e.prototype._innerSub=function(t,e,n){var r=this.innerSubscription;r&&r.unsubscribe();var o=new U(this,void 0,void 0);this.destination.add(o),this.innerSubscription=$(this,t,e,n,o)},e.prototype._complete=function(){var e=this.innerSubscription;e&&!e.closed||t.prototype._complete.call(this),this.unsubscribe()},e.prototype._unsubscribe=function(){this.innerSubscription=null},e.prototype.notifyComplete=function(e){this.destination.remove(e),this.innerSubscription=null,this.isStopped&&t.prototype._complete.call(this)},e.prototype.notifyNext=function(t,e,n,r,o){this.destination.next(e)},e}(W);function Fs(){for(var t=[],e=0;e=2&&(n=!0),function(r){return r.lift(new Hs(t,e,n))}}var Hs=function(){function t(t,e,n){void 0===n&&(n=!1),this.accumulator=t,this.seed=e,this.hasSeed=n}return t.prototype.call=function(t,e){return e.subscribe(new zs(t,this.accumulator,this.seed,this.hasSeed))},t}(),zs=function(t){function e(e,n,r,o){var i=t.call(this,e)||this;return i.accumulator=n,i._seed=r,i.hasSeed=o,i.index=0,i}return o(e,t),Object.defineProperty(e.prototype,"seed",{get:function(){return this._seed},set:function(t){this.hasSeed=!0,this._seed=t},enumerable:!0,configurable:!0}),e.prototype._next=function(t){if(this.hasSeed)return this._tryNext(t);this.seed=t,this.destination.next(t)},e.prototype._tryNext=function(t){var e,n=this.index++;try{e=this.accumulator(this.seed,t,n)}catch(r){this.destination.error(r)}this.seed=e,this.destination.next(e)},e}(C);function Bs(t,e){return J(t,e,1)}function qs(t,e,n){return function(r){return r.lift(new $s(t,e,n))}}var $s=function(){function t(t,e,n){this.nextOrObserver=t,this.error=e,this.complete=n}return t.prototype.call=function(t,e){return e.subscribe(new Ws(t,this.nextOrObserver,this.error,this.complete))},t}(),Ws=function(t){function e(e,n,r,o){var i=t.call(this,e)||this;return i._tapNext=k,i._tapError=k,i._tapComplete=k,i._tapError=r||k,i._tapComplete=o||k,h(n)?(i._context=i,i._tapNext=n):n&&(i._context=n,i._tapNext=n.next||k,i._tapError=n.error||k,i._tapComplete=n.complete||k),i}return o(e,t),e.prototype._next=function(t){try{this._tapNext.call(this._context,t)}catch(e){return void this.destination.error(e)}this.destination.next(t)},e.prototype._error=function(t){try{this._tapError.call(this._context,t)}catch(t){return void this.destination.error(t)}this.destination.error(t)},e.prototype._complete=function(){try{this._tapComplete.call(this._context)}catch(t){return void this.destination.error(t)}return this.destination.complete()},e}(C),Zs=function(){function t(t){this.callback=t}return t.prototype.call=function(t,e){return e.subscribe(new Gs(t,this.callback))},t}(),Gs=function(t){function e(e,n){var r=t.call(this,e)||this;return r.add(new v(n)),r}return o(e,t),e}(C),Qs=null;function Ks(){return Qs}var Ys,Js=function(t){function e(){var e=t.call(this)||this;e._animationPrefix=null,e._transitionEnd=null;try{var n=e.createElement("div",document);if(null!=e.getStyle(n,"animationName"))e._animationPrefix="";else for(var r=["Webkit","Moz","O","ms"],o=0;o0},e.prototype.tagName=function(t){return t.tagName},e.prototype.attributeMap=function(t){for(var e=new Map,n=t.attributes,r=0;r0;l||(l=t[i]=[]);var a=jc(e)?Zone.root:Zone.current;if(0===l.length)l.push({zone:a,handler:o});else{for(var s=!1,c=0;c-1},e}(vc),$c=["alt","control","meta","shift"],Wc={alt:function(t){return t.altKey},control:function(t){return t.ctrlKey},meta:function(t){return t.metaKey},shift:function(t){return t.shiftKey}},Zc=function(t){function e(e){return t.call(this,e)||this}var n;return o(e,t),n=e,e.prototype.supports=function(t){return null!=n.parseEventName(t)},e.prototype.addEventListener=function(t,e,r){var o=n.parseEventName(e),i=n.eventCallback(o.fullKey,r,this.manager.getZone());return this.manager.getZone().runOutsideAngular(function(){return Ks().onAndCancel(t,o.domEventName,i)})},e.parseEventName=function(t){var e=t.toLowerCase().split("."),r=e.shift();if(0===e.length||"keydown"!==r&&"keyup"!==r)return null;var o=n._normalizeKey(e.pop()),i="";if($c.forEach(function(t){var n=e.indexOf(t);n>-1&&(e.splice(n,1),i+=t+".")}),i+=o,0!=e.length||0===o.length)return null;var l={};return l.domEventName=r,l.fullKey=i,l},e.getEventFullKey=function(t){var e="",n=Ks().getEventKey(t);return" "===(n=n.toLowerCase())?n="space":"."===n&&(n="dot"),$c.forEach(function(r){r!=n&&(0,Wc[r])(t)&&(e+=r+".")}),e+=n},e.eventCallback=function(t,e,r){return function(o){n.getEventFullKey(o)===t&&r.runGuarded(function(){return e(o)})}},e._normalizeKey=function(t){switch(t){case"esc":return"escape";default:return t}},e}(vc),Gc=function(){return function(){}}(),Qc=function(t){function e(e){var n=t.call(this)||this;return n._doc=e,n}return o(e,t),e.prototype.sanitize=function(t,e){if(null==e)return null;switch(t){case Pe.NONE:return e;case Pe.HTML:return e instanceof Yc?e.changingThisBreaksApplicationSecurity:(this.checkNotSafeValue(e,"HTML"),function(t,e){var n=null;try{ge=ge||new se(t);var r=e?String(e):"";n=ge.getInertBodyElement(r);var o=5,i=r;do{if(0===o)throw new Error("Failed to sanitize html because the input is unstable");o--,r=i,i=n.innerHTML,n=ge.getInertBodyElement(r)}while(r!==i);var l=new Ee,u=l.sanitizeChildren(Oe(n)||n);return ae()&&l.sanitizedSomething&&console.warn("WARNING: sanitizing HTML stripped some content, see http://g.co/ng/security#xss"),u}finally{if(n)for(var a=Oe(n)||n;a.firstChild;)a.removeChild(a.firstChild)}}(this._doc,String(e)));case Pe.STYLE:return e instanceof Jc?e.changingThisBreaksApplicationSecurity:(this.checkNotSafeValue(e,"Style"),function(t){if(!(t=String(t).trim()))return"";var e=t.match(Ne);return e&&pe(e[1])===e[1]||t.match(Re)&&function(t){for(var e=!0,n=!0,r=0;rt.length)return null;if("full"===n.pathMatch&&(e.hasChildren()||r.length0?t[t.length-1]:null}function zf(t,e){for(var n in t)t.hasOwnProperty(n)&&e(t[n],n)}function Bf(t){return rn(t)?t:nn(t)?Y(Promise.resolve(t)):ts(t)}function qf(t,e,n){return n?function(t,e){return Ff(t,e)}(t.queryParams,e.queryParams)&&function t(e,n){if(!Gf(e.segments,n.segments))return!1;if(e.numberOfChildren!==n.numberOfChildren)return!1;for(var r in n.children){if(!e.children[r])return!1;if(!t(e.children[r],n.children[r]))return!1}return!0}(t.root,e.root):function(t,e){return Object.keys(e).length<=Object.keys(t).length&&Object.keys(e).every(function(n){return e[n]===t[n]})}(t.queryParams,e.queryParams)&&function t(e,n){return function e(n,r,o){if(n.segments.length>o.length)return!!Gf(l=n.segments.slice(0,o.length),o)&&!r.hasChildren();if(n.segments.length===o.length){if(!Gf(n.segments,o))return!1;for(var i in r.children){if(!n.children[i])return!1;if(!t(n.children[i],r.children[i]))return!1}return!0}var l=o.slice(0,n.segments.length),u=o.slice(n.segments.length);return!!Gf(n.segments,l)&&!!n.children[Tf]&&e(n.children[Tf],r,u)}(e,n,n.segments)}(t.root,e.root)}var $f=function(){function t(t,e,n){this.root=t,this.queryParams=e,this.fragment=n}return Object.defineProperty(t.prototype,"queryParamMap",{get:function(){return this._queryParamMap||(this._queryParamMap=Pf(this.queryParams)),this._queryParamMap},enumerable:!0,configurable:!0}),t.prototype.toString=function(){return Jf.serialize(this)},t}(),Wf=function(){function t(t,e){var n=this;this.segments=t,this.children=e,this.parent=null,zf(e,function(t,e){return t.parent=n})}return t.prototype.hasChildren=function(){return this.numberOfChildren>0},Object.defineProperty(t.prototype,"numberOfChildren",{get:function(){return Object.keys(this.children).length},enumerable:!0,configurable:!0}),t.prototype.toString=function(){return Xf(this)},t}(),Zf=function(){function t(t,e){this.path=t,this.parameters=e}return Object.defineProperty(t.prototype,"parameterMap",{get:function(){return this._parameterMap||(this._parameterMap=Pf(this.parameters)),this._parameterMap},enumerable:!0,configurable:!0}),t.prototype.toString=function(){return ip(this)},t}();function Gf(t,e){return t.length===e.length&&t.every(function(t,n){return t.path===e[n].path})}function Qf(t,e){var n=[];return zf(t.children,function(t,r){r===Tf&&(n=n.concat(e(t,r)))}),zf(t.children,function(t,r){r!==Tf&&(n=n.concat(e(t,r)))}),n}var Kf=function(){return function(){}}(),Yf=function(){function t(){}return t.prototype.parse=function(t){var e=new cp(t);return new $f(e.parseRootSegment(),e.parseQueryParams(),e.parseFragment())},t.prototype.serialize=function(t){var e,n;return"/"+function t(e,n){if(!e.hasChildren())return Xf(e);if(n){var r=e.children[Tf]?t(e.children[Tf],!1):"",o=[];return zf(e.children,function(e,n){n!==Tf&&o.push(n+":"+t(e,!1))}),o.length>0?r+"("+o.join("//")+")":r}var i=Qf(e,function(n,r){return r===Tf?[t(e.children[Tf],!1)]:[r+":"+t(n,!1)]});return Xf(e)+"/("+i.join("//")+")"}(t.root,!0)+(e=t.queryParams,(n=Object.keys(e).map(function(t){var n=e[t];return Array.isArray(n)?n.map(function(e){return ep(t)+"="+ep(e)}).join("&"):ep(t)+"="+ep(n)})).length?"?"+n.join("&"):"")+("string"==typeof t.fragment?"#"+encodeURI(t.fragment):"")},t}(),Jf=new Yf;function Xf(t){return t.segments.map(function(t){return ip(t)}).join("/")}function tp(t){return encodeURIComponent(t).replace(/%40/g,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",")}function ep(t){return tp(t).replace(/%3B/gi,";")}function np(t){return tp(t).replace(/\(/g,"%28").replace(/\)/g,"%29").replace(/%26/gi,"&")}function rp(t){return decodeURIComponent(t)}function op(t){return rp(t.replace(/\+/g,"%20"))}function ip(t){return""+np(t.path)+(e=t.parameters,Object.keys(e).map(function(t){return";"+np(t)+"="+np(e[t])}).join(""));var e}var lp=/^[^\/()?;=#]+/;function up(t){var e=t.match(lp);return e?e[0]:""}var ap=/^[^=?&#]+/,sp=/^[^?&#]+/,cp=function(){function t(t){this.url=t,this.remaining=t}return t.prototype.parseRootSegment=function(){return this.consumeOptional("/"),""===this.remaining||this.peekStartsWith("?")||this.peekStartsWith("#")?new Wf([],{}):new Wf([],this.parseChildren())},t.prototype.parseQueryParams=function(){var t={};if(this.consumeOptional("?"))do{this.parseQueryParam(t)}while(this.consumeOptional("&"));return t},t.prototype.parseFragment=function(){return this.consumeOptional("#")?decodeURIComponent(this.remaining):null},t.prototype.parseChildren=function(){if(""===this.remaining)return{};this.consumeOptional("/");var t=[];for(this.peekStartsWith("(")||t.push(this.parseSegment());this.peekStartsWith("/")&&!this.peekStartsWith("//")&&!this.peekStartsWith("/(");)this.capture("/"),t.push(this.parseSegment());var e={};this.peekStartsWith("/(")&&(this.capture("/"),e=this.parseParens(!0));var n={};return this.peekStartsWith("(")&&(n=this.parseParens(!1)),(t.length>0||Object.keys(e).length>0)&&(n[Tf]=new Wf(t,e)),n},t.prototype.parseSegment=function(){var t=up(this.remaining);if(""===t&&this.peekStartsWith(";"))throw new Error("Empty path url segment cannot have parameters: '"+this.remaining+"'.");return this.capture(t),new Zf(rp(t),this.parseMatrixParams())},t.prototype.parseMatrixParams=function(){for(var t={};this.consumeOptional(";");)this.parseParam(t);return t},t.prototype.parseParam=function(t){var e=up(this.remaining);if(e){this.capture(e);var n="";if(this.consumeOptional("=")){var r=up(this.remaining);r&&this.capture(n=r)}t[rp(e)]=rp(n)}},t.prototype.parseQueryParam=function(t){var e,n=(e=this.remaining.match(ap))?e[0]:"";if(n){this.capture(n);var r="";if(this.consumeOptional("=")){var o=function(t){var e=t.match(sp);return e?e[0]:""}(this.remaining);o&&this.capture(r=o)}var i=op(n),l=op(r);if(t.hasOwnProperty(i)){var u=t[i];Array.isArray(u)||(t[i]=u=[u]),u.push(l)}else t[i]=l}},t.prototype.parseParens=function(t){var e={};for(this.capture("(");!this.consumeOptional(")")&&this.remaining.length>0;){var n=up(this.remaining),r=this.remaining[n.length];if("/"!==r&&")"!==r&&";"!==r)throw new Error("Cannot parse url '"+this.url+"'");var o=void 0;n.indexOf(":")>-1?(o=n.substr(0,n.indexOf(":")),this.capture(o),this.capture(":")):t&&(o=Tf);var i=this.parseChildren();e[o]=1===Object.keys(i).length?i[Tf]:new Wf([],i),this.consumeOptional("//")}return e},t.prototype.peekStartsWith=function(t){return this.remaining.startsWith(t)},t.prototype.consumeOptional=function(t){return!!this.peekStartsWith(t)&&(this.remaining=this.remaining.substring(t.length),!0)},t.prototype.capture=function(t){if(!this.consumeOptional(t))throw new Error('Expected "'+t+'".')},t}(),fp=function(){function t(t){this._root=t}return Object.defineProperty(t.prototype,"root",{get:function(){return this._root.value},enumerable:!0,configurable:!0}),t.prototype.parent=function(t){var e=this.pathFromRoot(t);return e.length>1?e[e.length-2]:null},t.prototype.children=function(t){var e=pp(t,this._root);return e?e.children.map(function(t){return t.value}):[]},t.prototype.firstChild=function(t){var e=pp(t,this._root);return e&&e.children.length>0?e.children[0].value:null},t.prototype.siblings=function(t){var e=hp(t,this._root);return e.length<2?[]:e[e.length-2].children.map(function(t){return t.value}).filter(function(e){return e!==t})},t.prototype.pathFromRoot=function(t){return hp(t,this._root).map(function(t){return t.value})},t}();function pp(t,e){var n,r;if(t===e.value)return e;try{for(var o=a(e.children),i=o.next();!i.done;i=o.next()){var l=pp(t,i.value);if(l)return l}}catch(u){n={error:u}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}return null}function hp(t,e){var n,r;if(t===e.value)return[e];try{for(var o=a(e.children),i=o.next();!i.done;i=o.next()){var l=hp(t,i.value);if(l.length)return l.unshift(e),l}}catch(u){n={error:u}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}return[]}var dp=function(){function t(t,e){this.value=t,this.children=e}return t.prototype.toString=function(){return"TreeNode("+this.value+")"},t}();function gp(t){var e={};return t&&t.children.forEach(function(t){return e[t.value.outlet]=t}),e}var vp=function(t){function e(e,n){var r=t.call(this,e)||this;return r.snapshot=n,xp(r,e),r}return o(e,t),e.prototype.toString=function(){return this.snapshot.toString()},e}(fp);function yp(t,e){var n=function(t,e){var n=new wp([],{},{},"",{},Tf,e,null,t.root,-1,{});return new _p("",new dp(n,[]))}(t,e),r=new es([new Zf("",{})]),o=new es({}),i=new es({}),l=new es({}),u=new es(""),a=new mp(r,o,l,u,i,Tf,e,n.root);return a.snapshot=n.root,new vp(new dp(a,[]),n)}var mp=function(){function t(t,e,n,r,o,i,l,u){this.url=t,this.params=e,this.queryParams=n,this.fragment=r,this.data=o,this.outlet=i,this.component=l,this._futureSnapshot=u}return Object.defineProperty(t.prototype,"routeConfig",{get:function(){return this._futureSnapshot.routeConfig},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"root",{get:function(){return this._routerState.root},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"parent",{get:function(){return this._routerState.parent(this)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"firstChild",{get:function(){return this._routerState.firstChild(this)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"children",{get:function(){return this._routerState.children(this)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"pathFromRoot",{get:function(){return this._routerState.pathFromRoot(this)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"paramMap",{get:function(){return this._paramMap||(this._paramMap=this.params.pipe(Z(function(t){return Pf(t)}))),this._paramMap},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"queryParamMap",{get:function(){return this._queryParamMap||(this._queryParamMap=this.queryParams.pipe(Z(function(t){return Pf(t)}))),this._queryParamMap},enumerable:!0,configurable:!0}),t.prototype.toString=function(){return this.snapshot?this.snapshot.toString():"Future("+this._futureSnapshot+")"},t}();function bp(t,e){void 0===e&&(e="emptyOnly");var n=t.pathFromRoot,r=0;if("always"!==e)for(r=n.length-1;r>=1;){var o=n[r],l=n[r-1];if(o.routeConfig&&""===o.routeConfig.path)r--;else{if(l.component)break;r--}}return function(t){return t.reduce(function(t,e){return{params:i({},t.params,e.params),data:i({},t.data,e.data),resolve:i({},t.resolve,e._resolvedData)}},{params:{},data:{},resolve:{}})}(n.slice(r))}var wp=function(){function t(t,e,n,r,o,i,l,u,a,s,c){this.url=t,this.params=e,this.queryParams=n,this.fragment=r,this.data=o,this.outlet=i,this.component=l,this.routeConfig=u,this._urlSegment=a,this._lastPathIndex=s,this._resolve=c}return Object.defineProperty(t.prototype,"root",{get:function(){return this._routerState.root},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"parent",{get:function(){return this._routerState.parent(this)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"firstChild",{get:function(){return this._routerState.firstChild(this)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"children",{get:function(){return this._routerState.children(this)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"pathFromRoot",{get:function(){return this._routerState.pathFromRoot(this)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"paramMap",{get:function(){return this._paramMap||(this._paramMap=Pf(this.params)),this._paramMap},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"queryParamMap",{get:function(){return this._queryParamMap||(this._queryParamMap=Pf(this.queryParams)),this._queryParamMap},enumerable:!0,configurable:!0}),t.prototype.toString=function(){return"Route(url:'"+this.url.map(function(t){return t.toString()}).join("/")+"', path:'"+(this.routeConfig?this.routeConfig.path:"")+"')"},t}(),_p=function(t){function e(e,n){var r=t.call(this,n)||this;return r.url=e,xp(r,n),r}return o(e,t),e.prototype.toString=function(){return Cp(this._root)},e}(fp);function xp(t,e){e.value._routerState=t,e.children.forEach(function(e){return xp(t,e)})}function Cp(t){var e=t.children.length>0?" { "+t.children.map(Cp).join(", ")+" } ":"";return""+t.value+e}function Sp(t){if(t.snapshot){var e=t.snapshot,n=t._futureSnapshot;t.snapshot=n,Ff(e.queryParams,n.queryParams)||t.queryParams.next(n.queryParams),e.fragment!==n.fragment&&t.fragment.next(n.fragment),Ff(e.params,n.params)||t.params.next(n.params),function(t,e){if(t.length!==e.length)return!1;for(var n=0;n0&&kp(n[0]))throw new Error("Root segment cannot have matrix parameters");var r=n.find(function(t){return"object"==typeof t&&null!=t&&t.outlets});if(r&&r!==Hf(n))throw new Error("{outlets:{}} has to be the last command")}return t.prototype.toRoot=function(){return this.isAbsolute&&1===this.commands.length&&"/"==this.commands[0]},t}(),Op=function(){return function(t,e,n){this.segmentGroup=t,this.processChildren=e,this.index=n}}();function Pp(t){return"object"==typeof t&&null!=t&&t.outlets?t.outlets[Tf]:""+t}function Ap(t,e,n){if(t||(t=new Wf([],{})),0===t.segments.length&&t.hasChildren())return Rp(t,e,n);var r=function(t,e,n){for(var r=0,o=e,i={match:!1,pathIndex:0,commandIndex:0};o=n.length)return i;var l=t.segments[o],u=Pp(n[r]),a=r0&&void 0===u)break;if(u&&a&&"object"==typeof a&&void 0===a.outlets){if(!Lp(u,a,l))return i;r+=2}else{if(!Lp(u,{},l))return i;r++}o++}return{match:!0,pathIndex:o,commandIndex:r}}(t,e,n),o=n.slice(r.commandIndex);if(r.match&&r.pathIndex0?new Wf([],((r={})[Tf]=t,r)):t;return new $f(o,e,n)},t.prototype.expandSegmentGroup=function(t,e,n,r){return 0===n.segments.length&&n.hasChildren()?this.expandChildren(t,e,n).pipe(Z(function(t){return new Wf([],t)})):this.expandSegment(t,n,e,n.segments,r,!0)},t.prototype.expandChildren=function(t,e,n){var r=this;return function(n,o){if(0===Object.keys(n).length)return ts({});var i=[],l=[],u={};return zf(n,function(n,o){var a,s,c=(a=o,s=n,r.expandSegmentGroup(t,e,s,a)).pipe(Z(function(t){return u[o]=t}));o===Tf?i.push(c):l.push(c)}),ts.apply(null,i.concat(l)).pipe(cs(),ks(),Z(function(){return u}))}(n.children)},t.prototype.expandSegment=function(t,e,n,r,o,i){var l=this;return ts.apply(void 0,c(n)).pipe(Z(function(u){return l.expandSegmentAgainstRoute(t,e,n,u,r,o,i).pipe(Is(function(t){if(t instanceof Hp)return ts(null);throw t}))}),cs(),Ns(function(t){return!!t}),Is(function(t,n){if(t instanceof rs||"EmptyError"===t.name){if(l.noLeftoversInUrl(e,r,o))return ts(new Wf([],{}));throw new Hp(e)}throw t}))},t.prototype.noLeftoversInUrl=function(t,e,n){return 0===e.length&&!t.children[n]},t.prototype.expandSegmentAgainstRoute=function(t,e,n,r,o,i,l){return Kp(r)!==i?Bp(e):void 0===r.redirectTo?this.matchSegmentAgainstRoute(t,e,r,o):l&&this.allowRedirects?this.expandSegmentAgainstRouteUsingRedirect(t,e,n,r,o,i):Bp(e)},t.prototype.expandSegmentAgainstRouteUsingRedirect=function(t,e,n,r,o,i){return"**"===r.path?this.expandWildCardWithParamsAgainstRouteUsingRedirect(t,n,r,i):this.expandRegularSegmentAgainstRouteUsingRedirect(t,e,n,r,o,i)},t.prototype.expandWildCardWithParamsAgainstRouteUsingRedirect=function(t,e,n,r){var o=this,i=this.applyRedirectCommands([],n.redirectTo,{});return n.redirectTo.startsWith("/")?qp(i):this.lineralizeSegments(n,i).pipe(J(function(n){var i=new Wf(n,{});return o.expandSegment(t,i,e,n,r,!1)}))},t.prototype.expandRegularSegmentAgainstRouteUsingRedirect=function(t,e,n,r,o,i){var l=this,u=Zp(e,r,o),a=u.consumedSegments,s=u.lastChild,c=u.positionalParamSegments;if(!u.matched)return Bp(e);var f=this.applyRedirectCommands(a,r.redirectTo,c);return r.redirectTo.startsWith("/")?qp(f):this.lineralizeSegments(r,f).pipe(J(function(r){return l.expandSegment(t,e,n,r.concat(o.slice(s)),i,!1)}))},t.prototype.matchSegmentAgainstRoute=function(t,e,n,r){var o=this;if("**"===n.path)return n.loadChildren?this.configLoader.load(t.injector,n).pipe(Z(function(t){return n._loadedConfig=t,new Wf(r,{})})):ts(new Wf(r,{}));var l=Zp(e,n,r),u=l.consumedSegments,s=l.lastChild;if(!l.matched)return Bp(e);var c=r.slice(s);return this.getChildConfig(t,n,r).pipe(J(function(t){var n=t.module,r=t.routes,l=function(t,e,n,r){return n.length>0&&function(t,e,n){return r.some(function(n){return Qp(t,e,n)&&Kp(n)!==Tf})}(t,n)?{segmentGroup:Gp(new Wf(e,function(t,e){var n,r,o={};o[Tf]=e;try{for(var i=a(t),l=i.next();!l.done;l=i.next()){var u=l.value;""===u.path&&Kp(u)!==Tf&&(o[Kp(u)]=new Wf([],{}))}}catch(s){n={error:s}}finally{try{l&&!l.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}return o}(r,new Wf(n,t.children)))),slicedSegments:[]}:0===n.length&&function(t,e,n){return r.some(function(n){return Qp(t,e,n)})}(t,n)?{segmentGroup:Gp(new Wf(t.segments,function(t,e,n,r){var o,l,u={};try{for(var s=a(n),c=s.next();!c.done;c=s.next()){var f=c.value;Qp(t,e,f)&&!r[Kp(f)]&&(u[Kp(f)]=new Wf([],{}))}}catch(p){o={error:p}}finally{try{c&&!c.done&&(l=s.return)&&l.call(s)}finally{if(o)throw o.error}}return i({},r,u)}(t,n,r,t.children))),slicedSegments:n}:{segmentGroup:t,slicedSegments:n}}(e,u,c,r),s=l.segmentGroup,f=l.slicedSegments;return 0===f.length&&s.hasChildren()?o.expandChildren(n,r,s).pipe(Z(function(t){return new Wf(u,t)})):0===r.length&&0===f.length?ts(new Wf(u,{})):o.expandSegment(n,s,r,f,Tf,!0).pipe(Z(function(t){return new Wf(u.concat(t.segments),t.children)}))}))},t.prototype.getChildConfig=function(t,e,n){var r=this;return e.children?ts(new Df(e.children,t)):e.loadChildren?void 0!==e._loadedConfig?ts(e._loadedConfig):function(t,e,n){var r,o=e.canLoad;return o&&0!==o.length?Y(o).pipe(Z(function(r){var o,i=t.get(r);if(function(t){return t&&Fp(t.canLoad)}(i))o=i.canLoad(e,n);else{if(!Fp(i))throw new Error("Invalid CanLoad guard");o=i(e,n)}return Bf(o)})).pipe(cs(),(r=function(t){return!0===t},function(t){return t.lift(new Ds(r,void 0,t))})):ts(!0)}(t.injector,e,n).pipe(J(function(n){return n?r.configLoader.load(t.injector,e).pipe(Z(function(t){return e._loadedConfig=t,t})):function(t){return new O(function(e){return e.error(Rf("Cannot load children because the guard of the route \"path: '"+t.path+"'\" returned false"))})}(e)})):ts(new Df([],t))},t.prototype.lineralizeSegments=function(t,e){for(var n=[],r=e.root;;){if(n=n.concat(r.segments),0===r.numberOfChildren)return ts(n);if(r.numberOfChildren>1||!r.children[Tf])return $p(t.redirectTo);r=r.children[Tf]}},t.prototype.applyRedirectCommands=function(t,e,n){return this.applyRedirectCreatreUrlTree(e,this.urlSerializer.parse(e),t,n)},t.prototype.applyRedirectCreatreUrlTree=function(t,e,n,r){var o=this.createSegmentGroup(t,e.root,n,r);return new $f(o,this.createQueryParams(e.queryParams,this.urlTree.queryParams),e.fragment)},t.prototype.createQueryParams=function(t,e){var n={};return zf(t,function(t,r){if("string"==typeof t&&t.startsWith(":")){var o=t.substring(1);n[r]=e[o]}else n[r]=t}),n},t.prototype.createSegmentGroup=function(t,e,n,r){var o=this,i=this.createSegments(t,e.segments,n,r),l={};return zf(e.children,function(e,i){l[i]=o.createSegmentGroup(t,e,n,r)}),new Wf(i,l)},t.prototype.createSegments=function(t,e,n,r){var o=this;return e.map(function(e){return e.path.startsWith(":")?o.findPosParam(t,e,r):o.findOrReturn(e,n)})},t.prototype.findPosParam=function(t,e,n){var r=n[e.path.substring(1)];if(!r)throw new Error("Cannot redirect to '"+t+"'. Cannot find '"+e.path+"'.");return r},t.prototype.findOrReturn=function(t,e){var n,r,o=0;try{for(var i=a(e),l=i.next();!l.done;l=i.next()){var u=l.value;if(u.path===t.path)return e.splice(o),u;o++}}catch(s){n={error:s}}finally{try{l&&!l.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}return t},t}();function Zp(t,e,n){if(""===e.path)return"full"===e.pathMatch&&(t.hasChildren()||n.length>0)?{matched:!1,consumedSegments:[],lastChild:0,positionalParamSegments:{}}:{matched:!0,consumedSegments:[],lastChild:0,positionalParamSegments:{}};var r=(e.matcher||Nf)(n,t,e);return r?{matched:!0,consumedSegments:r.consumed,lastChild:r.consumed.length,positionalParamSegments:r.posParams}:{matched:!1,consumedSegments:[],lastChild:0,positionalParamSegments:{}}}function Gp(t){if(1===t.numberOfChildren&&t.children[Tf]){var e=t.children[Tf];return new Wf(t.segments.concat(e.segments),e.children)}return t}function Qp(t,e,n){return(!(t.hasChildren()||e.length>0)||"full"!==n.pathMatch)&&""===n.path&&void 0!==n.redirectTo}function Kp(t){return t.outlet||Tf}var Yp=function(){return function(t){this.path=t,this.route=this.path[this.path.length-1]}}(),Jp=function(){return function(t,e){this.component=t,this.route=e}}();function Xp(t,e,n){var r=function(t){if(!t)return null;for(var e=t.parent;e;e=e.parent){var n=e.routeConfig;if(n&&n._loadedConfig)return n._loadedConfig}return null}(e);return(r?r.module.injector:n).get(t)}function th(t,e,n,r,o){void 0===o&&(o={canDeactivateChecks:[],canActivateChecks:[]});var i=gp(e);return t.children.forEach(function(t){!function(t,e,n,r,o){void 0===o&&(o={canDeactivateChecks:[],canActivateChecks:[]});var i=t.value,l=e?e.value:null,u=n?n.getContext(t.value.outlet):null;if(l&&i.routeConfig===l.routeConfig){var a=function(t,e,n){if("function"==typeof n)return n(t,e);switch(n){case"pathParamsChange":return!Gf(t.url,e.url);case"pathParamsOrQueryParamsChange":return!Gf(t.url,e.url)||!Ff(t.queryParams,e.queryParams);case"always":return!0;case"paramsOrQueryParamsChange":return!Ep(t,e)||!Ff(t.queryParams,e.queryParams);case"paramsChange":default:return!Ep(t,e)}}(l,i,i.routeConfig.runGuardsAndResolvers);a?o.canActivateChecks.push(new Yp(r)):(i.data=l.data,i._resolvedData=l._resolvedData),th(t,e,i.component?u?u.children:null:n,r,o),a&&o.canDeactivateChecks.push(new Jp(u&&u.outlet&&u.outlet.component||null,l))}else l&&eh(e,u,o),o.canActivateChecks.push(new Yp(r)),th(t,null,i.component?u?u.children:null:n,r,o)}(t,i[t.value.outlet],n,r.concat([t.value]),o),delete i[t.value.outlet]}),zf(i,function(t,e){return eh(t,n.getContext(e),o)}),o}function eh(t,e,n){var r=gp(t),o=t.value;zf(r,function(t,r){eh(t,o.component?e?e.children.getContext(r):null:e,n)}),n.canDeactivateChecks.push(new Jp(o.component&&e&&e.outlet&&e.outlet.isActivated?e.outlet.component:null,o))}var nh=Symbol("INITIAL_VALUE");function rh(){return Ls(function(t){return(function(){for(var t=[],e=0;e0?Hf(n).parameters:{};o=new wp(n,a,Object.freeze(i({},this.urlTree.queryParams)),this.urlTree.fragment,gh(t),r,t.component,t,ch(e),fh(e)+n.length,vh(t))}else{var s=function(t,e,n){if(""===e.path){if("full"===e.pathMatch&&(t.hasChildren()||n.length>0))throw new ah;return{consumedSegments:[],lastChild:0,parameters:{}}}var r=(e.matcher||Nf)(n,t,e);if(!r)throw new ah;var o={};zf(r.posParams,function(t,e){o[e]=t.path});var l=r.consumed.length>0?i({},o,r.consumed[r.consumed.length-1].parameters):o;return{consumedSegments:r.consumed,lastChild:r.consumed.length,parameters:l}}(e,t,n);l=s.consumedSegments,u=n.slice(s.lastChild),o=new wp(l,s.parameters,Object.freeze(i({},this.urlTree.queryParams)),this.urlTree.fragment,gh(t),r,t.component,t,ch(e),fh(e)+l.length,vh(t))}var c=function(t){return t.children?t.children:t.loadChildren?t._loadedConfig.routes:[]}(t),f=ph(e,l,u,c,this.relativeLinkResolution),p=f.segmentGroup,h=f.slicedSegments;if(0===h.length&&p.hasChildren()){var d=this.processChildren(c,p);return[new dp(o,d)]}if(0===c.length&&0===h.length)return[new dp(o,[])];var g=this.processSegment(c,p,h,Tf);return[new dp(o,g)]},t}();function ch(t){for(var e=t;e._sourceSegment;)e=e._sourceSegment;return e}function fh(t){for(var e=t,n=e._segmentIndexShift?e._segmentIndexShift:0;e._sourceSegment;)n+=(e=e._sourceSegment)._segmentIndexShift?e._segmentIndexShift:0;return n-1}function ph(t,e,n,r,o){if(n.length>0&&function(t,e,n){return r.some(function(n){return hh(t,e,n)&&dh(n)!==Tf})}(t,n)){var l=new Wf(e,function(t,e,n,r){var o,i,l={};l[Tf]=r,r._sourceSegment=t,r._segmentIndexShift=e.length;try{for(var u=a(n),s=u.next();!s.done;s=u.next()){var c=s.value;if(""===c.path&&dh(c)!==Tf){var f=new Wf([],{});f._sourceSegment=t,f._segmentIndexShift=e.length,l[dh(c)]=f}}}catch(p){o={error:p}}finally{try{s&&!s.done&&(i=u.return)&&i.call(u)}finally{if(o)throw o.error}}return l}(t,e,r,new Wf(n,t.children)));return l._sourceSegment=t,l._segmentIndexShift=e.length,{segmentGroup:l,slicedSegments:[]}}if(0===n.length&&function(t,e,n){return r.some(function(n){return hh(t,e,n)})}(t,n)){var u=new Wf(t.segments,function(t,e,n,r,o,l){var u,s,c={};try{for(var f=a(r),p=f.next();!p.done;p=f.next()){var h=p.value;if(hh(t,n,h)&&!o[dh(h)]){var d=new Wf([],{});d._sourceSegment=t,d._segmentIndexShift="legacy"===l?t.segments.length:e.length,c[dh(h)]=d}}}catch(g){u={error:g}}finally{try{p&&!p.done&&(s=f.return)&&s.call(f)}finally{if(u)throw u.error}}return i({},o,c)}(t,e,n,r,t.children,o));return u._sourceSegment=t,u._segmentIndexShift=e.length,{segmentGroup:u,slicedSegments:n}}var s=new Wf(t.segments,t.children);return s._sourceSegment=t,s._segmentIndexShift=e.length,{segmentGroup:s,slicedSegments:n}}function hh(t,e,n){return(!(t.hasChildren()||e.length>0)||"full"!==n.pathMatch)&&""===n.path&&void 0===n.redirectTo}function dh(t){return t.outlet||Tf}function gh(t){return t.data||{}}function vh(t){return t.resolve||{}}function yh(t,e,n,r){var o=Xp(t,e,r);return Bf(o.resolve?o.resolve(e,n):o(e,n))}function mh(t){return function(e){return e.pipe(Ls(function(e){var n=t(e);return n?Y(n).pipe(Z(function(){return e})):Y([e])}))}}var bh=function(){return function(){}}(),wh=function(){function t(){}return t.prototype.shouldDetach=function(t){return!1},t.prototype.store=function(t,e){},t.prototype.shouldAttach=function(t){return!1},t.prototype.retrieve=function(t){return null},t.prototype.shouldReuseRoute=function(t,e){return t.routeConfig===e.routeConfig},t}(),_h=new Mt("ROUTES"),xh=function(){function t(t,e,n,r){this.loader=t,this.compiler=e,this.onLoadStartListener=n,this.onLoadEndListener=r}return t.prototype.load=function(t,e){var n=this;return this.onLoadStartListener&&this.onLoadStartListener(e),this.loadModuleFactory(e.loadChildren).pipe(Z(function(r){n.onLoadEndListener&&n.onLoadEndListener(e);var o=r.create(t);return new Df(Vf(o.injector.get(_h)).map(Uf),o)}))},t.prototype.loadModuleFactory=function(t){var e=this;return"string"==typeof t?Y(this.loader.load(t)):Bf(t()).pipe(J(function(t){return t instanceof Gt?ts(t):Y(e.compiler.compileModuleAsync(t))}))},t}(),Ch=function(){return function(){}}(),Sh=function(){function t(){}return t.prototype.shouldProcessUrl=function(t){return!0},t.prototype.extract=function(t){return t},t.prototype.merge=function(t,e){return t},t}();function Eh(t){throw t}function kh(t,e,n){return e.parse("/")}function Ih(t,e){return ts(null)}var Th=function(){function t(t,e,n,r,o,i,l,u){var a=this;this.rootComponentType=t,this.urlSerializer=e,this.rootContexts=n,this.location=r,this.config=u,this.lastSuccessfulNavigation=null,this.currentNavigation=null,this.navigationId=0,this.isNgZoneEnabled=!1,this.events=new M,this.errorHandler=Eh,this.malformedUriErrorHandler=kh,this.navigated=!1,this.lastSuccessfulId=-1,this.hooks={beforePreactivation:Ih,afterPreactivation:Ih},this.urlHandlingStrategy=new Sh,this.routeReuseStrategy=new wh,this.onSameUrlNavigation="ignore",this.paramsInheritanceStrategy="emptyOnly",this.urlUpdateStrategy="deferred",this.relativeLinkResolution="legacy",this.ngModule=o.get(Zt),this.console=o.get(Yo);var s=o.get(vi);this.isNgZoneEnabled=s instanceof vi,this.resetConfig(u),this.currentUrlTree=new $f(new Wf([],{}),{},null),this.rawUrlTree=this.currentUrlTree,this.browserUrlTree=this.currentUrlTree,this.configLoader=new xh(i,l,function(t){return a.triggerEvent(new wf(t))},function(t){return a.triggerEvent(new _f(t))}),this.routerState=yp(this.currentUrlTree,this.rootComponentType),this.transitions=new es({id:0,currentUrlTree:this.currentUrlTree,currentRawUrl:this.currentUrlTree,extractedUrl:this.urlHandlingStrategy.extract(this.currentUrlTree),urlAfterRedirects:this.urlHandlingStrategy.extract(this.currentUrlTree),rawUrl:this.currentUrlTree,extras:{},resolve:null,reject:null,promise:Promise.resolve(!0),source:"imperative",restoredState:null,currentSnapshot:this.routerState.snapshot,targetSnapshot:null,currentRouterState:this.routerState,targetRouterState:null,guards:{canActivateChecks:[],canDeactivateChecks:[]},guardsResult:null}),this.navigations=this.setupNavigations(this.transitions),this.processNavigations()}return t.prototype.setupNavigations=function(t){var e=this,n=this.events;return t.pipe(fs(function(t){return 0!==t.id}),Z(function(t){return i({},t,{extractedUrl:e.urlHandlingStrategy.extract(t.rawUrl)})}),Ls(function(t){var r,o,l,u,s=!1,c=!1;return ts(t).pipe(qs(function(t){e.currentNavigation={id:t.id,initialUrl:t.currentRawUrl,extractedUrl:t.extractedUrl,trigger:t.source,extras:t.extras,previousNavigation:e.lastSuccessfulNavigation?i({},e.lastSuccessfulNavigation,{previousNavigation:null}):null}}),Ls(function(t){var r,o,l,u,a=!e.navigated||t.extractedUrl.toString()!==e.browserUrlTree.toString();if(("reload"===e.onSameUrlNavigation||a)&&e.urlHandlingStrategy.shouldProcessUrl(t.rawUrl))return ts(t).pipe(Ls(function(t){var r=e.transitions.getValue();return n.next(new ff(t.id,e.serializeUrl(t.extractedUrl),t.source,t.restoredState)),r!==e.transitions.getValue()?us:[t]}),Ls(function(t){return Promise.resolve(t)}),(r=e.ngModule.injector,o=e.configLoader,l=e.urlSerializer,u=e.config,function(t){return t.pipe(Ls(function(t){return function(e,n,r,o,i){return new Wp(e,n,r,t.extractedUrl,i).apply()}(r,o,l,0,u).pipe(Z(function(e){return i({},t,{urlAfterRedirects:e})}))}))}),qs(function(t){e.currentNavigation=i({},e.currentNavigation,{finalUrl:t.urlAfterRedirects})}),function(t,n,r,o,l){return function(r){return r.pipe(J(function(r){return function(t,e,n,r,o,i){return void 0===o&&(o="emptyOnly"),void 0===i&&(i="legacy"),new sh(t,e,n,r,o,i).recognize()}(t,n,r.urlAfterRedirects,(u=r.urlAfterRedirects,e.serializeUrl(u)),o,l).pipe(Z(function(t){return i({},r,{targetSnapshot:t})}));var u}))}}(e.rootComponentType,e.config,0,e.paramsInheritanceStrategy,e.relativeLinkResolution),qs(function(t){"eager"===e.urlUpdateStrategy&&(t.extras.skipLocationChange||e.setBrowserUrl(t.urlAfterRedirects,!!t.extras.replaceUrl,t.id,t.extras.state),e.browserUrlTree=t.urlAfterRedirects)}),qs(function(t){var r=new gf(t.id,e.serializeUrl(t.extractedUrl),e.serializeUrl(t.urlAfterRedirects),t.targetSnapshot);n.next(r)}));if(a&&e.rawUrlTree&&e.urlHandlingStrategy.shouldProcessUrl(e.rawUrlTree)){var s=t.extractedUrl,c=t.source,f=t.restoredState,p=t.extras,h=new ff(t.id,e.serializeUrl(s),c,f);n.next(h);var d=yp(s,e.rootComponentType).snapshot;return ts(i({},t,{targetSnapshot:d,urlAfterRedirects:s,extras:i({},p,{skipLocationChange:!1,replaceUrl:!1})}))}return e.rawUrlTree=t.rawUrl,e.browserUrlTree=t.urlAfterRedirects,t.resolve(null),us}),mh(function(t){var n=t.extras;return e.hooks.beforePreactivation(t.targetSnapshot,{navigationId:t.id,appliedUrlTree:t.extractedUrl,rawUrlTree:t.rawUrl,skipLocationChange:!!n.skipLocationChange,replaceUrl:!!n.replaceUrl})}),qs(function(t){var n=new vf(t.id,e.serializeUrl(t.extractedUrl),e.serializeUrl(t.urlAfterRedirects),t.targetSnapshot);e.triggerEvent(n)}),Z(function(t){return i({},t,{guards:(n=t.targetSnapshot,r=t.currentSnapshot,o=e.rootContexts,l=n._root,th(l,r?r._root:null,o,[l.value]))});var n,r,o,l}),function(t,e){return function(n){return n.pipe(J(function(n){var r=n.targetSnapshot,o=n.currentSnapshot,l=n.guards,u=l.canActivateChecks,a=l.canDeactivateChecks;return 0===a.length&&0===u.length?ts(i({},n,{guardsResult:!0})):function(t,e,n,r){return Y(a).pipe(J(function(t){return function(t,e,n,r,o){var i=e&&e.routeConfig?e.routeConfig.canDeactivate:null;return i&&0!==i.length?ts(i.map(function(i){var l,u=Xp(i,e,o);if(function(t){return t&&Fp(t.canDeactivate)}(u))l=Bf(u.canDeactivate(t,e,n,r));else{if(!Fp(u))throw new Error("Invalid CanDeactivate guard");l=Bf(u(t,e,n,r))}return l.pipe(Ns())})).pipe(rh()):ts(!0)}(t.component,t.route,n,e,r)}),Ns(function(t){return!0!==t},!0))}(0,r,o,t).pipe(J(function(n){return n&&"boolean"==typeof n?function(t,e,n,r){return Y(u).pipe(Bs(function(e){return Y([ih(e.route.parent,r),oh(e.route,r),uh(t,e.path,n),lh(t,e.route,n)]).pipe(cs(),Ns(function(t){return!0!==t},!0))}),Ns(function(t){return!0!==t},!0))}(r,0,t,e):ts(n)}),Z(function(t){return i({},n,{guardsResult:t})}))}))}}(e.ngModule.injector,function(t){return e.triggerEvent(t)}),qs(function(t){if(Vp(t.guardsResult)){var n=Rf('Redirecting to "'+e.serializeUrl(t.guardsResult)+'"');throw n.url=t.guardsResult,n}}),qs(function(t){var n=new yf(t.id,e.serializeUrl(t.extractedUrl),e.serializeUrl(t.urlAfterRedirects),t.targetSnapshot,!!t.guardsResult);e.triggerEvent(n)}),fs(function(t){if(!t.guardsResult){e.resetUrlToCurrentUrlTree();var r=new hf(t.id,e.serializeUrl(t.extractedUrl),"");return n.next(r),t.resolve(!1),!1}return!0}),mh(function(t){if(t.guards.canActivateChecks.length)return ts(t).pipe(qs(function(t){var n=new mf(t.id,e.serializeUrl(t.extractedUrl),e.serializeUrl(t.urlAfterRedirects),t.targetSnapshot);e.triggerEvent(n)}),(n=e.paramsInheritanceStrategy,r=e.ngModule.injector,function(t){return t.pipe(J(function(t){var e=t.targetSnapshot,o=t.guards.canActivateChecks;return o.length?Y(o).pipe(Bs(function(t){return function(t,n,r,o){return function(t,e,n,r){var o=Object.keys(t);if(0===o.length)return ts({});if(1===o.length){var i=o[0];return yh(t[i],e,n,r).pipe(Z(function(t){var e;return(e={})[i]=t,e}))}var l={};return Y(o).pipe(J(function(o){return yh(t[o],e,n,r).pipe(Z(function(t){return l[o]=t,t}))})).pipe(ks(),Z(function(){return l}))}(t._resolve,t,e,o).pipe(Z(function(e){return t._resolvedData=e,t.data=i({},t.data,bp(t,r).resolve),null}))}(t.route,0,n,r)}),function(t,e){return arguments.length>=2?function(n){return I(Vs(t,e),vs(1),Cs(e))(n)}:function(e){return I(Vs(function(e,n,r){return t(e,n,r+1)}),vs(1))(e)}}(function(t,e){return t}),Z(function(e){return t})):ts(t)}))}),qs(function(t){var n=new bf(t.id,e.serializeUrl(t.extractedUrl),e.serializeUrl(t.urlAfterRedirects),t.targetSnapshot);e.triggerEvent(n)}));var n,r}),mh(function(t){var n=t.extras;return e.hooks.afterPreactivation(t.targetSnapshot,{navigationId:t.id,appliedUrlTree:t.extractedUrl,rawUrlTree:t.rawUrl,skipLocationChange:!!n.skipLocationChange,replaceUrl:!!n.replaceUrl})}),Z(function(t){var n,r,o,l=(o=function t(e,n,r){if(r&&e.shouldReuseRoute(n.value,r.value.snapshot)){(s=r.value)._futureSnapshot=n.value;var o=function(e,n,r){return n.children.map(function(n){var o,i;try{for(var l=a(r.children),u=l.next();!u.done;u=l.next()){var s=u.value;if(e.shouldReuseRoute(s.value.snapshot,n.value))return t(e,n,s)}}catch(c){o={error:c}}finally{try{u&&!u.done&&(i=l.return)&&i.call(l)}finally{if(o)throw o.error}}return t(e,n)})}(e,n,r);return new dp(s,o)}var i=e.retrieve(n.value);if(i){var l=i.route;return function t(e,n){if(e.value.routeConfig!==n.value.routeConfig)throw new Error("Cannot reattach ActivatedRouteSnapshot created from a different route");if(e.children.length!==n.children.length)throw new Error("Cannot reattach ActivatedRouteSnapshot with a different number of children");n.value._futureSnapshot=e.value;for(var r=0;ru;){if(a-=u,!(l=l.parent))throw new Error("Invalid number of '../'");u=l.segments.length}return new Op(l,!1,u-a)}()}(i,0,t),u=l.processChildren?Rp(l.segmentGroup,l.index,i.commands):Ap(l.segmentGroup,l.index,i.commands);return Ip(l.segmentGroup,u,e,r,o)}(s,this.currentUrlTree,t,p,f)},t.prototype.navigateByUrl=function(t,e){void 0===e&&(e={skipLocationChange:!1}),ae()&&this.isNgZoneEnabled&&!vi.isInAngularZone()&&this.console.warn("Navigation triggered outside Angular zone, did you forget to call 'ngZone.run()'?");var n=Vp(t)?t:this.parseUrl(t),r=this.urlHandlingStrategy.merge(n,this.rawUrlTree);return this.scheduleNavigation(r,"imperative",null,e)},t.prototype.navigate=function(t,e){return void 0===e&&(e={skipLocationChange:!1}),function(t){for(var e=0;e1?"/"+e:"")).catch(this.error.bind(this))},t.prototype.error=function(t){return this.track<1&&(this.router.navigate(["/"]),this.track++),{}},t.ngInjectableDef=xt({factory:function(){return new t(qt(Ya),qt(Xa),qt(Th))},token:t,providedIn:"root"}),t}(),od=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o(e,t),e.prototype.resolve=function(t){var e=+t.params.page;return"NaN"===String(e)&&(e=1),this.getData("posts",e)},e.ngInjectableDef=xt({factory:function(){return new e(qt(Ya),qt(Xa),qt(Th))},token:e,providedIn:"root"}),e}(rd),id=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o(e,t),e.prototype.resolve=function(t){return this.getData("post/"+t.params.slug)},e.ngInjectableDef=xt({factory:function(){return new e(qt(Ya),qt(Xa),qt(Th))},token:e,providedIn:"root"}),e}(rd),ld=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o(e,t),e.prototype.resolve=function(t){return this.getData("page/"+t.routeConfig.path)},e.ngInjectableDef=xt({factory:function(){return new e(qt(Ya),qt(Xa),qt(Th))},token:e,providedIn:"root"}),e}(rd),ud=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o(e,t),e.prototype.resolve=function(t){var e=+t.params.page;return"NaN"===String(e)&&(e=1),this.getData("archives",e)},e.ngInjectableDef=xt({factory:function(){return new e(qt(Ya),qt(Xa),qt(Th))},token:e,providedIn:"root"}),e}(rd),ad=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o(e,t),e.prototype.resolve=function(t){var e=t.params.name,n=+t.params.page;return"NaN"===String(n)&&(n=1),this.getData("tags/"+e,n)},e.ngInjectableDef=xt({factory:function(){return new e(qt(Ya),qt(Xa),qt(Th))},token:e,providedIn:"root"}),e}(rd),sd=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o(e,t),e.prototype.resolve=function(t){return this.getData("tags")},e.ngInjectableDef=xt({factory:function(){return new e(qt(Ya),qt(Xa),qt(Th))},token:e,providedIn:"root"}),e}(rd),cd=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o(e,t),e.prototype.resolve=function(t){var e=t.params.name,n=+t.params.page;return"NaN"===String(n)&&(n=1),this.getData("categories/"+e,n)},e.ngInjectableDef=xt({factory:function(){return new e(qt(Ya),qt(Xa),qt(Th))},token:e,providedIn:"root"}),e}(rd),fd=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o(e,t),e.prototype.resolve=function(t){return this.getData("categories")},e.ngInjectableDef=xt({factory:function(){return new e(qt(Ya),qt(Xa),qt(Th))},token:e,providedIn:"root"}),e}(rd),pd=function(t){return t[t.sm=0]="sm",t[t.md=1]="md",t[t.lg=2]="lg",t}({}),hd=function(){function t(){var t=this;this.mediaSubject=new M,this.scrollSubject=new M,this.media=this.mediaSubject.asObservable(),this.scroll=this.scrollSubject.asObservable(),this.width=ku.win.innerWidth,this.height=ku.win.innerHeight,ku.win.addEventListener("resize",Nu(function(){t.refreshMedia()},500),{passive:!0})}return t.prototype.initScroll=function(t){var e=this;this.host=t,t.addEventListener("scroll",function(){e.refreshScroll({scrollTop:t.scrollTop})},{passive:!0})},t.prototype.refreshScroll=function(t){this.scrollSubject.next(t||{scrollTop:this.host.scrollTop})},t.prototype.refreshMedia=function(){this.width=ku.win.innerWidth,this.height=ku.win.innerHeight,this.mediaSubject.next({type:this.width<640?pd.sm:this.width<976?pd.md:pd.lg})},t.ngInjectableDef=xt({factory:function(){return new t},token:t,providedIn:"root"}),t}(),dd=function(){return function(){}}(),gd=function(t){return t[t.toTop=0]="toTop",t[t.toBottom=1]="toBottom",t[t.toggleSidebar=2]="toggleSidebar",t[t.toggleToc=3]="toggleToc",t[t.search=4]="search",t}({}),vd=function(){function t(t,e){this.device=t,this.loader=e,this.showMenu=!1,this.busy=!1,this.action=new Vo}return t.prototype.ngOnInit=function(){var t=this;this.device.media.subscribe(function(e){return t.sidebar=e.type!==pd.lg}),this.device.refreshMedia(),this.loader.state.subscribe(function(e){e&&!t.busy&&t.rotate()})},t.prototype.act=function(t){this.action.emit(gd[t])},t.prototype.rotate=function(){var t,e,n,r=this,o=this.controlRef.nativeElement;this.busy=!0,o.classList.add("ch"),e=function(){o.classList.remove("ch"),r.busy=!1,Hu(o),r.loader.busy&&r.rotate()},n=function(r){t===r.target&&(e(),t.removeEventListener(Ru,n))},(t=o).addEventListener(Ru,n,{passive:!0})},t.prototype.toggle=function(){this.showMenu=!this.showMenu},t.prototype.open=function(){this.showMenu=!0},t.prototype.close=function(){this.showMenu=!1},t}(),yd=function(){function t(t,e,n,r,o){var i=this;if(this.er=t,this.route=e,this.router=n,this.device=r,this.app=o,this.config=this.app.config,this.plugins=this.app.getPlugins("sidebar"),this.avatarPlugins=this.app.getPlugins("avatar"),this.config.menu){this.router.events.pipe(fs(function(t){return t instanceof pf})).subscribe(function(){var t=i.route.snapshot.children[0],e=t.data;i.activePath="page"===e.id?t.routeConfig.path:"home"===e.id?"":"category"===e.id?"categories":"tag"===e.id?"tags":e.id,"/"!==i.activePath[0]&&(i.activePath="/"+i.activePath)});var l=[],u=this.config.menu;for(var a in u){var s=u[a];l.push({text:a,href:s,external:Du(s)}),this.menu=l}}}return t.prototype.ngAfterViewInit=function(){var t=this;this.device.media.subscribe(function(){t.adjustFooter()}),this.device.refreshMedia()},t.prototype.isExternal=function(t){return Du(t)},t.prototype.adjustFooter=function(){var t=this.innerRef.nativeElement.children[1];t.classList[this.innerRef.nativeElement.children[0].offsetHeight+t.offsetHeight>this.device.height?"remove":"add"]("dv")},t}(),md=function(){function t(t,e,n){this.app=t,this.device=e,this.er=n,this.scrollTop=0,this.action=new Vo,this.currentId="",this.stacks={},this.linedIds=[],this.config=this.app.config.toc||{},this.syncPosition=Nu(this.syncPosition.bind(this))}return t.prototype.navigate=function(t){this.currentId!==t&&(this.currentId=t,this.action.emit(this.getOffset(t)))},t.prototype.syncPosition=function(){var t=this.scrollTop||0;if(t=n.offset&&(void 0===r||t4&&setTimeout(function(){n.style[ju("transitionDuration")]="",n.style[ju("transitionProperty")]=""},e+100)},t}();function bd(){for(var t=[],e=0;e1&&(r=1),t.scrollPercent=Math.round(100*r)}else t.scrollPercent=0;t.isTocOpen&&t.tocData&&t.toc&&t.toc.syncPosition(),"home"===t.currentId&&(t.indexScrollTop=n)}),this.router.events.pipe(fs(function(t){return t instanceof pf})).subscribe(function(){t.screenType!==pd.lg&&t.isSidebarOpen&&t.toggleSb(),t.isTocOpen&&t.toggleToc(),t.device.refreshScroll();var e,n=t.route.snapshot.children[0].children.length?t.route.snapshot.children[0].children[0].data:t.route.snapshot.children[0].data;if(t.currentId=n.id,"home"===t.currentId)setTimeout(function(){t.pageRef.nativeElement.scrollTop=t.indexScrollTop||0},0);else if("post"===t.currentId||"page"===t.currentId){var r=t.route.fragment.value;r?setTimeout(function(){var e=t.doc.getElementById(r);e&&e.scrollIntoView(!0)},24):t.pageRef.nativeElement.scrollTop=0}else t.pageRef.nativeElement.scrollTop=0;t.tocData=n[t.currentId]&&n[t.currentId].toc?n[t.currentId].toc:null,t.setTitle(n),n.post&&n.post.thumbnail?n.post.color?t.themeColor=t.setColor(n.post.color):n.post.thumbnail&&(e=n.post.thumbnail,Tu[e]?Promise.resolve(Tu[e]):new Promise(function(t,n){var r=new Image;r.crossOrigin="anonymous",r.onload=function(){var n,o=ku.doc.createElement("canvas").getContext("2d");o.drawImage(r,0,0);var i=(n=o.getImageData(0,0,1,1).data.slice(0,3)).reduce(function(t,e){return t+e}),l=Iu[1]-i;l<0?(l=Math.abs(l),l=Math.floor(l/3),n=n.map(function(t){return t-l})):ic.clientX?"left":"right",u=Math.abs(i-c.clientX),Math.abs(l-c.clientY)>=u||Math.abs(u)>e.hold&&(a=!0,o.next({start:i,offset:s(u),direction:n,isStart:r,isEnd:!1}),r=!1)},{passive:!0}),t.addEventListener("touchend",function(){a&&o.next({start:i,offset:s(u),direction:n,isEnd:!0,isStart:!1}),a=!1,i=l=u=0},{passive:!0}),o.asObservable();function s(t){return Math.ceil((t+(t>0?-e.hold:e.hold))*e.scale)}}(this.pageRef.nativeElement,{scale:.382});e.subscribe(function(e){var n,r=.06*t.device.width,o=t.sidebarWidth,i=t.isSidebarOpen,l=e.offset;!t.isSidebarOpen&&e.start>r||(l>o-1&&(l=o-1),l<1&&(l=1),n=~~(o-l),e.isEnd?lo-1&&(l=o-1),l<1&&(l=1),n=~~(o-l),e.isEnd?l0?(this.isTransiting=!0,this.isTocOpen&&this.toggleToc(),r.classList.add("bm"),this.setColor(i),Au(r,function(){0===t&&(r.classList.remove("bm"),n.setColor(n.themeColor)),r.style[ju("transitionDuration")]=r.style[ju("transitionProperty")]="",o.style[ju("transitionDuration")]=o.style[ju("transitionProperty")]="",n.isTransiting=!1})):this.isTransiting||(this.isTransiting=!0,r.classList.add("bm"),this.setColor(i)),r.style[ju("transitionProperty")]=ju("transform",!0)+",border-radius",r.style[ju("transform")]=this.transformer(t,1-.14*t/this.sidebarWidth),r.style[ju("transitionDuration")]=e+"ms",o.style.opacity=t/this.sidebarWidth,o.style[ju("transitionDuration")]=e+"ms"},t.prototype.toggleSb=function(t){this.isTransiting||(this.isSidebarOpen||t?(this.stepSb(0,~~(1.5*this.sidebarWidth)),this.isSidebarOpen=!1):(this.stepSb(this.sidebarWidth,~~(1.5*this.sidebarWidth)),this.isSidebarOpen=!0,this.isSearchOpen=!1))},t.prototype.toggleToc=function(t){this.isTocOpen||t?(this.toc.step(this.toc.width,~~(1.5*this.toc.width)),this.isTocOpen=!1):(this.toc.refresh(),this.toc.syncPosition(),this.toc.step(0,~~(1.5*this.toc.width)),this.isTocOpen=!0,this.isSearchOpen=!1)},t.prototype.toggleSearch=function(t){this.isSearchOpen=!t&&!this.isSearchOpen},t.prototype.setTitle=function(t){var e=this,n={post:function(t){return t.post.title},page:function(t){return t.page.title},tags:function(){return e.app.i18n("title.tags")},tag:function(t){return e.app.i18n("title.tags")+" : "+t.tag.name},categories:function(){return e.app.i18n("title.categories")},category:function(t){return e.app.i18n("title.categories")+" : "+t.category.name},archives:function(){return e.app.i18n("title.archives")},search:function(){return e.app.i18n("title.search")},404:function(){return 404}}[t.id],r=n?n(t)+" - "+this.config.title:this.config.title;this.title.setTitle(r)},t.prototype.setColor=function(t){return this.meta.updateTag({name:"theme-color",content:t=t||this.app.config.color[1]||this.config.color[1]||""}),t},t.prototype.onFabAct=function(t){switch(t){case gd.toTop:this.animateTo(0);break;case gd.toBottom:this.animateTo(this.pageRef.nativeElement.scrollHeight-this.pageHeight);break;case gd.toggleSidebar:this.toggleSb();break;case gd.toggleToc:this.toggleToc();break;case gd.search:this.toggleSearch()}},t.prototype.animateTo=function(t){var e=this.scrollTop||0,n=Math.abs(~~(.618*(t-e)/1));Ou(this.pageRef.nativeElement,"scrollTop",{from:e,to:t,duration:n>618?618:n})},t.prototype.onOverlay=function(){this.isSidebarOpen&&this.toggleSb(),this.isTocOpen&&this.toggleToc()},t.prototype.onkeyup=function(t,e){"Escape"!==t&&27!==e||(this.isSearchOpen&&this.toggleSearch(),this.isTocOpen&&this.toggleToc(),this.isSidebarOpen&&this.toggleSb())},t.prototype.flatPath=function(t){var e=this,n=[];return t?(t.forEach(function(t){if("string"==typeof t)n.push(t);else{var r=Object.keys(t),o=[];r.forEach(function(n){o.push(n),o.push.apply(o,c(e.flatPath(t[n]).map(function(t){return[n,t].join("/")})))}),n=n.concat(o)}}),n):[]},t}(),xd=ir({encapsulation:2,styles:[],data:{}});function Cd(t){return vl(0,[(t()(),Xi(0,16777216,null,null,1,"router-outlet",[],null,null,null,null,null)),vo(1,212992,null,0,Mh,[Dh,Vn,fn,[8,null],Le],null,null)],function(t,e){t(e,1,0)},null)}function Sd(t){return vl(0,[(t()(),Xi(0,0,null,null,1,"ng-component",[],null,null,null,Cd,xd)),vo(1,49152,null,0,If,[],null,null)],null,null)}var Ed=$r("ng-component",If,Sd,{},{},[]),kd=function(){function t(){this.ratio=.625,this.state=-1}return t.prototype.ngOnChanges=function(t){t.src&&(this.state=-1)},t.prototype.onLoad=function(){this.state=1},t.prototype.onError=function(){this.state=0},t}(),Id=ir({encapsulation:2,styles:[],data:{}});function Td(t){return vl(0,[(t()(),Xi(0,0,null,null,6,"span",[["class","cr"]],null,null,null,null,null)),mo(512,null,Ta,Oa,[Nn,Dn,gn,wn]),vo(2,278528,null,0,Pa,[Ta],{klass:[0,"klass"],ngClass:[1,"ngClass"]},null),fl(3,{cs:0}),mo(512,null,ja,Ua,[gn,Dn,wn]),vo(5,278528,null,0,Fa,[ja],{ngStyle:[0,"ngStyle"]},null),fl(6,{padding:0})],function(t,e){var n=e.component,r=t(e,3,0,0===n.state);t(e,2,0,"cr",r);var o=t(e,6,0,(50*n.ratio).toFixed(3)+"% 0");t(e,5,0,o)},null)}function Od(t){return vl(2,[(t()(),Ji(16777216,null,null,1,null,Td)),vo(1,16384,null,0,Da,[Vn,Un],{ngIf:[0,"ngIf"]},null),(t()(),Xi(2,0,null,null,3,"img",[["class","cq"]],[[8,"src",4],[8,"alt",0]],[[null,"load"],[null,"error"]],function(t,e,n){var r=!0,o=t.component;return"load"===e&&(r=!1!==o.onLoad()&&r),"error"===e&&(r=!1!==o.onError()&&r),r},null,null)),mo(512,null,ja,Ua,[gn,Dn,wn]),vo(4,278528,null,0,Fa,[ja],{ngStyle:[0,"ngStyle"]},null),fl(5,{display:0})],function(t,e){var n=e.component;t(e,1,0,1!==n.state);var r=t(e,5,0,1===n.state?"":"none");t(e,4,0,r)},function(t,e){var n=e.component;t(e,2,0,Rr(1,"",n.src,""),Rr(1,"",n.alt,""))})}var Pd=function(){function t(t,e){this.er=t,this.renderer=e,this.className="is-snippet"}return t.prototype.ngAfterViewInit=function(){var t=this;setTimeout(function(){t.process()},0)},t.prototype.process=function(){var t=this,e=/^https?\:\/\/gist.github.com/,n=this.er.nativeElement&&this.er.nativeElement.getElementsByClassName(this.className);n&&n.length&&Array.from(n).forEach(function(n){var r=n.querySelector("script");if(n.classList.remove(t.className),r){var o=r.innerHTML,i=r.src;if(o||i){if(n.removeChild(r),i&&i.match(e)){var l=t.renderer.createElement("iframe");return l.style.display="none",l.onload=function(){var e=l.contentDocument;if(e){var r=t.renderer.createElement("div"),o=e.querySelector('link[rel="stylesheet"]'),i=e.querySelector(".gist");if(o&&i){var u=i.cloneNode();u.innerHTML=i.innerHTML,r.appendChild(o.cloneNode()),r.appendChild(u)}n.removeChild(l),n.appendChild(r),l=e=null}},l.srcdoc='